tcl9.0.3/0000755000175000017500000000000015104662777011565 5ustar sergeisergeitcl9.0.3/win/0000755000175000017500000000000015104662744012354 5ustar sergeisergeitcl9.0.3/win/x86_64-w64-mingw32-nmakehlp.exe0000775000175000017500000006100015104661342017507 0ustar sergeisergeiMZx@x !L!This program cannot be run in DOS mode.$PEd b" 2, @` YpxU(\.text602 `.rdatatP6@@.buildid5pP@@.data$ R@.pdata\@@.tls^@.reloc`@BVH H@H@H@H ?1MZuMHcQ<<PEu@HQH tҁ u"`y\s pylr 1|pH ?93x-H?0H+0H?0(+0AH*?8u H 1H ^ÐH(H?wHwH o?D HD$ H wHwLw- H(H(H> H(fAWAVVWSHW)D$p)D$`)D$P)D$@)D$0)D$ HDŽ$L5~>A>t HL$ %MeH%0HpL=>1I7t%H9t H=9M1I7tH9uH5Q>u p '>t vH ;>H<>w)uH >H>])t1IH=HHt 1ɺE1H VLH =HH )H^=Hv(HHtR1fD1ۅÀ"DH tu߄t fDHHt!|HuA>tD$\D$` Eȉ lHc5uH 'IH~AAH5u1fH (HxH'IHHI'HI9uE1KL5;uH7uH `<H H uHuLuu=tt#=uu 'tHĐ[_^A^A_É'f.DH(H;*H(fH(HH(f.fUAVVWSH`H$I։nJH ;H;H5QJHH ;Hփ|DIF8-u;H'w/HHc H0INH`[_^A^]WML>Hu+HǹIHD$ LHHAIH`[_^A^]ÃIN1܃INIVD@A(HHt9t&1뢃INH`[_^A^]ML; ML;ML;ML=ML<ML=<Hu+HǹwHHD$ LHHAH1ML:uILH`[_^A^]INIVW 1INIV$H1HhsAWAVAUATVWUSH)$IGHW)t$`HD$p)$)$)$)$)$)$HDŽ$L$DŽ$hDŽ$HDŽ$)$HDŽ$DŽ$DŽ$H gL-FHt$XH$E1HIE1AHT$XL$D$0D$(D$ H-EHIH ;kHIE1AHT$XD$0D$(D$ HIMHx;H$@HOFH=@FHLH~;HHD$`HD$HH$HD$@t$0D$(D$ 1HE1E1EH$H=DH$HL$`DHL$hH\$TH\$(D$ H5 L MfH-D11IH$H\$(D$ L j11IH$HL$`8EHL$`H$AA EH$H$H eH:+!H9H iHd:!HH eHN: HH ciH2: HH WeH: HH +iH: E1HACljD$TD$ L9H$L$@+HHH H,)‰T$(HL$ HD$01AE1SCxCHHCHD$ LL$THHACAD($H[]_^A\A]A^A_f.AWAVAUATVWUSHX)$@AIBHW)t$`HD$p)$)$)$)$)$)$HDŽ$L$DŽ$hDŽ$HDŽ$)$HDŽ$DŽ$DŽ$H vcL-AHt$XH$HIE1AHT$XL$D$0D$(D$ H-AHIH gHIE1AHT$XD$0D$(D$ HIMH7H$@"BE~GD1L57H5BH$@L%7HLIHHLHH9uHD$`HD$HH$HD$@t$0D$(D$ E1H$@1E1E1@H$H@H$HL$`V@HL$hHl$THl$(D$ H=F L aH5P@11IH$Hl$(D$ L e11IH$HL$`@HL$`H$AA@H$H$H aaHC6H9H 5eH'6HH )aH6HH dH5qHH `H5UHH dH59E1HAt?ljD$TD$ L75H$L$@+HHH H,)‰T$(HL$ HD$01AE1>?HH?HD$ LL$THHAQ?AD($@HX[]_^A\A]A^A_@AWAVAUATVWUSH8HHHD$(H4HIHKH4HHIL5hLIHLl$0A$H-= LM`H*ht-Lf.Յt'^Hu1IHq1MLLcIf.ՅuA\$Iu1L2Lf.DՅt_Hu1fHGf.H wIsA$@HHHHCHHCHHL$(HH HuHH|$(L1HLl$0tML5;H3HALMHMHL$ HHA=HmHu L1L5gLMHL=2L%jDEALLH?HHWLHtHILLM)tLLLL)HHHGHttHMHHuHOE jHHMHHuILLnLMH|$(H8Ht0f.H7HOHOHHHuLH8[]_^A\A]A^A_SAWAVAUATVWUSH8DHH41NHD$(1HH5eL%1Hl$0"1AH5dHl$0MHdLD$(HHH1IHtHJ(HfCHtHƃrH50H-0IsDALDHRAHDHuAVAHyHt AFIu HL$(HH8[]_^A\A]A^A_f.VH0Ht$ IE1z9HH0^AWAVAUATVWUSHHL$ E1L5/L%93H9L5/L%8fIIcH|$ tK4HHHH=rHl$0HHIufD<0\*D<2HL$ OHHH$@AHHL$ Tests for whether cl.exe supports an option exitcodes: 0 == no, 1 == yes, 2 == error usage: %s -l ? ...? Tests for whether link.exe supports an option exitcodes: 0 == no, 1 == yes, 2 == error usage: %s -f Find a substring within another exitcodes: 0 == no, 1 == yes, 2 == error usage: %s -s Perform a set of string map type substutitions on a file exitcodes: 0 usage: %s -V filename matchstring Extract a version from a file: eg: pkgIndex.tcl "package ifneeded http"usage: %s -Q path Emit the fully qualified path exitcodes: 0 == no, 1 == yes, 2 == error usage: %s -L keypath Emit the fully qualified path of directory containing keypath exitcodes: 0 == success, 1 == not found, 2 == error usage: %s -c|-f|-l|-Q|-s|-V ... This is a little helper app to equalize shell differences between WinNT and Win9x and get nmake.exe to accomplish its job. cl.exe -nologo -c -TC -Zs -X -Fp.\_junk.pch .\nulTried to launch: "%s", but got error [%u]: D4002D9002D2021link.exe -nologo ""LNK1117LNK4044LNK4224rt0123456789.ab.abab% 3d '%s' => '%s' %sXU@[U@aU@....\....\..\..\*Y@@@@X@@ )@@Argument domain error (DOMAIN)Argument singularity (SIGN)Overflow range error (OVERFLOW)Partial loss of significance (PLOSS)Total loss of significance (TLOSS)The result is too small to be represented (UNDERFLOW)Unknown error_matherr(): %s in %s(%g, %g) (retval=%g) 'lG Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. %d bit pseudo relocation at %p out of range, targeting %p, yielding the value %p. Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%xMingw-w64 runtime failure: X@X@runtime error %d _@@@@ )@)@Zd\(Ze]PZ=e0]Z_e]@[e ^p[eP^[e`^\ep_\e_\e______```"`0`>`L`Z`d`~``````aa:aBaJaTafavaaaaaaaaab bbb(b2bFbTbbbtbbbbbbbbcc0cDcTcfcvcccccccdd&d6dPdfdrd~ddddddddd_____```"`0`>`L`Z`d`~``````aa:aBaJaTafavaaaaaaaaab bbb(b2bFbTbbbtbbbbbbbbcc0cDcTcfcvcccccccdd&d6dPdfdrd~ddddddddd_set_new_modecallocfreemalloc__C_specific_handlermemchrmemcpystrstr__p___argc__p___argv__p___wargv__p__acmdln_cexit_configure_narrow_argv_configure_wide_argv_crt_at_quick_exit_crt_atexit_initialize_narrow_environment_initialize_wide_environment_initterm_set_app_type_set_invalid_parameter_handlerabortexitsignal__acrt_iob_func__p__commode__p__fmode__stdio_common_vfprintf__stdio_common_vfwprintf__stdio_common_vsprintffclosefgetsfopenfwriteputs_strdupisspacestrlenstrncmpstrncpyWaitForInputIdleCloseHandleCreatePipeCreateProcessACreateThreadDeleteCriticalSectionDuplicateHandleEnterCriticalSectionFindCloseFindFirstFileAFindNextFileAFormatMessageAGetCurrentProcessGetFileAttributesAGetFullPathNameAGetLastErrorGetStartupInfoAGetStdHandleInitializeCriticalSectionLeaveCriticalSectionReadFileSetEnvironmentVariableASetErrorModeSetUnhandledExceptionFilterSleepTlsGetValueVirtualProtectVirtualQueryWaitForMultipleObjectsWaitForSingleObjectWriteFilelstrcatAlstrcpyAlstrlenA__setusermatherr__p__environ__p__wenviron__daylight__timezone__tzname_tzsetapi-ms-win-crt-heap-l1-1-0.dllapi-ms-win-crt-private-l1-1-0.dllapi-ms-win-crt-runtime-l1-1-0.dllapi-ms-win-crt-stdio-l1-1-0.dllapi-ms-win-crt-string-l1-1-0.dllUSER32.dllKERNEL32.dllapi-ms-win-crt-math-l1-1-0.dllapi-ms-win-crt-environment-l1-1-0.dllapi-ms-win-crt-time-l1-1-0.dll2`B BP;DW/W0p` BP;$7/7B ,0p`P h+Y 0 P p ` h4k 0 P p ` b 0 P p ` b 0 P p `&` q 0 P p `B  b0Pp`BBp`Bp`Bp`Bbp` " 0 p ` P  0p`R`20p`  20p`  20p`2`2`BBbbR`b  B0p`Bp`  B0p`20p``B bpPRSDSv4BLLD PDB. Y@@2@`2@ؑ@@@@ @p8@H@`1@1@2@2@3@@3@PSTPDT3@3@4@;@f9$f@^,f`Lf >`f@Tfpff f #f#%%f0%`%g`%7'g@'X'(g`''0g'2(Dg@((Lg( )Xg ))dg))pg))*xg@*t-g-/g //g//g/X1g`11g1;2g@2^2g22g22g363h@3y3 h33h3 4h4M4$hP44,h4V5sec = usecSincePosixEpoch / 1000000; timePtr->usec = (long)(usecSincePosixEpoch % 1000000); } else { GetTime(timePtr); } } /* *---------------------------------------------------------------------- * * NativeScaleTime -- * * TIP #233: Scale from virtual time to the real-time. For native scaling * the relationship is 1:1 and nothing has to be done. * * Results: * Scales the time in timePtr. * * Side effects: * See above. * *---------------------------------------------------------------------- */ static void NativeScaleTime( TCL_UNUSED(Tcl_Time *), TCL_UNUSED(void *)) { /* * Native scale is 1:1. Nothing is done. */ } /* *---------------------------------------------------------------------- * * IsPerfCounterAvailable -- * * Tests whether the performance counter is available, which is a gnarly * problem on 32-bit systems. Also retrieves the nominal frequency of the * performance counter. * * Results: * 1 if the counter is available, 0 if not. * * Side effects: * Updates fields of the timeInfo global. Make sure you hold the lock * before calling this. * *---------------------------------------------------------------------- */ static inline int IsPerfCounterAvailable(void) { timeInfo.perfCounterAvailable = QueryPerformanceFrequency(&timeInfo.nominalFreq); /* * Some hardware abstraction layers use the CPU clock in place of the * real-time clock as a performance counter reference. This results in: * - inconsistent results among the processors on multi-processor * systems. * - unpredictable changes in performance counter frequency on * "gearshift" processors such as Transmeta and SpeedStep. * * There seems to be no way to test whether the performance counter is * reliable, but a useful heuristic is that if its frequency is 1.193182 * MHz or 3.579545 MHz, it's derived from a colorburst crystal and is * therefore the RTC rather than the TSC. * * A sloppier but serviceable heuristic is that the RTC crystal is * normally less than 15 MHz while the TSC crystal is virtually assured to * be greater than 100 MHz. Since Win98SE appears to fiddle with the * definition of the perf counter frequency (perhaps in an attempt to * calibrate the clock?), we use the latter rule rather than an exact * match. * * We also assume (perhaps questionably) that the vendors have gotten * their act together on Win64, so bypass all this rubbish on that * platform. */ #if !defined(_WIN64) if (timeInfo.perfCounterAvailable && /* * The following lines would do an exact match on crystal * frequency: * * timeInfo.nominalFreq.QuadPart != (long long) 1193182 && * timeInfo.nominalFreq.QuadPart != (long long) 3579545 && */ timeInfo.nominalFreq.QuadPart > (long long) 15000000) { /* * As an exception, if every logical processor on the system is on the * same chip, we use the performance counter anyway, presuming that * everyone's TSC is locked to the same oscillator. */ SYSTEM_INFO systemInfo; int regs[4]; GetSystemInfo(&systemInfo); if (TclWinCPUID(0, regs) == TCL_OK && regs[1] == 0x756E6547 /* "Genu" */ && regs[3] == 0x49656E69 /* "ineI" */ && regs[2] == 0x6C65746E /* "ntel" */ && TclWinCPUID(1, regs) == TCL_OK && ((regs[0]&0x00000F00) == 0x00000F00 /* Pentium 4 */ || ((regs[0] & 0x00F00000) /* Extended family */ && (regs[3] & 0x10000000))) /* Hyperthread */ && (((regs[1]&0x00FF0000) >> 16)/* CPU count */ == (int)systemInfo.dwNumberOfProcessors)) { timeInfo.perfCounterAvailable = TRUE; } else { timeInfo.perfCounterAvailable = FALSE; } } #endif /* above code is Win32 only */ return timeInfo.perfCounterAvailable; } /* *---------------------------------------------------------------------- * * NativeGetMicroseconds -- * * Gets the current system time in microseconds since the beginning * of the epoch: 00:00 UCT, January 1, 1970. * * Results: * Returns the wide integer with number of microseconds from the epoch, or * 0 if high resolution timer is not available. * * Side effects: * On the first call, initializes a set of static variables to keep track * of the base value of the performance counter, the corresponding wall * clock (obtained through ftime) and the frequency of the performance * counter. Also spins a thread whose function is to wake up periodically * and monitor these values, adjusting them as necessary to correct for * drift in the performance counter's oscillator. * *---------------------------------------------------------------------- */ static inline long long NativeCalc100NsTicks( ULONGLONG fileTimeLastCall, LONGLONG perfCounterLastCall, LONGLONG curCounterFreq, LONGLONG curCounter) { return fileTimeLastCall + ((curCounter - perfCounterLastCall) * 10000000 / curCounterFreq); } static long long NativeGetMicroseconds(void) { /* * Initialize static storage on the first trip through. * * Note: Outer check for 'initialized' is a performance win since it * avoids an extra mutex lock in the common case. */ if (!timeInfo.initialized) { TclpInitLock(); if (!timeInfo.initialized) { timeInfo.posixEpoch.LowPart = 0xD53E8000; timeInfo.posixEpoch.HighPart = 0x019DB1DE; /* * If the performance counter is available, start a thread to * calibrate it. */ if (IsPerfCounterAvailable()) { DWORD id; InitializeCriticalSection(&timeInfo.cs); timeInfo.readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); timeInfo.exitEvent = CreateEventW(NULL, FALSE, FALSE, NULL); timeInfo.calibrationThread = CreateThread(NULL, 256, CalibrationThread, (LPVOID) NULL, 0, &id); SetThreadPriority(timeInfo.calibrationThread, THREAD_PRIORITY_HIGHEST); /* * Wait for the thread just launched to start running, and * create an exit handler that kills it so that it doesn't * outlive unloading tclXX.dll */ WaitForSingleObject(timeInfo.readyEvent, INFINITE); CloseHandle(timeInfo.readyEvent); Tcl_CreateExitHandler(StopCalibration, NULL); } timeInfo.initialized = TRUE; } TclpInitUnlock(); } if (timeInfo.perfCounterAvailable && timeInfo.curCounterFreq.QuadPart!=0) { /* * Query the performance counter and use it to calculate the current * time. */ ULONGLONG fileTimeLastCall; LONGLONG perfCounterLastCall, curCounterFreq; /* Copy with current data of calibration * cycle. */ LARGE_INTEGER curCounter; /* Current performance counter. */ QueryPerformanceCounter(&curCounter); /* * Hold time section locked as short as possible */ EnterCriticalSection(&timeInfo.cs); fileTimeLastCall = timeInfo.fileTimeLastCall.QuadPart; perfCounterLastCall = timeInfo.perfCounterLastCall.QuadPart; curCounterFreq = timeInfo.curCounterFreq.QuadPart; LeaveCriticalSection(&timeInfo.cs); /* * If calibration cycle occurred after we get curCounter */ if (curCounter.QuadPart <= perfCounterLastCall) { /* * Calibrated file-time is saved from Posix in 100-ns ticks */ return fileTimeLastCall / 10; } /* * If it appears to be more than 1.1 seconds since the last trip * through the calibration loop, the performance counter may have * jumped forward. (See MSDN Knowledge Base article Q274323 for a * description of the hardware problem that makes this test * necessary.) If the counter jumps, we don't want to use it directly. * Instead, we must return system time. Eventually, the calibration * loop should recover. */ if (curCounter.QuadPart - perfCounterLastCall < 11 * curCounterFreq * timeInfo.calibrationInterv / 10) { /* * Calibrated file-time is saved from Posix in 100-ns ticks. */ return NativeCalc100NsTicks(fileTimeLastCall, perfCounterLastCall, curCounterFreq, curCounter.QuadPart) / 10; } } /* * High resolution timer is not available. */ return 0; } /* *---------------------------------------------------------------------- * * NativeGetTime -- * * TIP #233: Gets the current system time in seconds and microseconds * since the beginning of the epoch: 00:00 UCT, January 1, 1970. * * Results: * Returns the current time in timePtr. * * Side effects: * See NativeGetMicroseconds for more information. * *---------------------------------------------------------------------- */ static void NativeGetTime( Tcl_Time *timePtr, TCL_UNUSED(void *)) { long long usecSincePosixEpoch; /* * Try to use high resolution timer. */ usecSincePosixEpoch = NativeGetMicroseconds(); if (usecSincePosixEpoch) { timePtr->sec = usecSincePosixEpoch / 1000000; timePtr->usec = (long)(usecSincePosixEpoch % 1000000); } else { /* * High resolution timer is not available. Just use ftime. */ struct _timeb t; _ftime(&t); timePtr->sec = t.time; timePtr->usec = t.millitm * 1000; } } /* *---------------------------------------------------------------------- * * StopCalibration -- * * Turns off the calibration thread in preparation for exiting the * process. * * Results: * None. * * Side effects: * Sets the 'exitEvent' event in the 'timeInfo' structure to ask the * thread in question to exit, and waits for it to do so. * *---------------------------------------------------------------------- */ void TclWinResetTimerResolution(void); static void StopCalibration( TCL_UNUSED(void *)) { SetEvent(timeInfo.exitEvent); /* * If Tcl_Finalize was called from DllMain, the calibration thread is in a * paused state so we need to timeout and continue. */ WaitForSingleObject(timeInfo.calibrationThread, 100); CloseHandle(timeInfo.exitEvent); CloseHandle(timeInfo.calibrationThread); } /* *---------------------------------------------------------------------- * * CalibrationThread -- * * Thread that manages calibration of the hi-resolution time derived from * the performance counter, to keep it synchronized with the system * clock. * * Parameters: * arg - Client data from the CreateThread call. This parameter points to * the static TimeInfo structure. * * Return value: * None. This thread embeds an infinite loop. * * Side effects: * At an interval of 1s, this thread performs virtual time discipline. * * Note: When this thread is entered, TclpInitLock has been called to * safeguard the static storage. There is therefore no synchronization in the * body of this procedure. * *---------------------------------------------------------------------- */ static DWORD WINAPI CalibrationThread( TCL_UNUSED(LPVOID)) { FILETIME curFileTime; DWORD waitResult; /* * Get initial system time and performance counter. */ GetSystemTimeAsFileTime(&curFileTime); QueryPerformanceCounter(&timeInfo.perfCounterLastCall); QueryPerformanceFrequency(&timeInfo.curCounterFreq); timeInfo.fileTimeLastCall.LowPart = curFileTime.dwLowDateTime; timeInfo.fileTimeLastCall.HighPart = curFileTime.dwHighDateTime; /* * Calibrated file-time will be saved from Posix in 100-ns ticks. */ timeInfo.fileTimeLastCall.QuadPart -= timeInfo.posixEpoch.QuadPart; ResetCounterSamples(timeInfo.fileTimeLastCall.QuadPart, timeInfo.perfCounterLastCall.QuadPart, timeInfo.curCounterFreq.QuadPart); /* * Wake up the calling thread. When it wakes up, it will release the * initialization lock. */ SetEvent(timeInfo.readyEvent); /* * Run the calibration once a second. */ while (timeInfo.perfCounterAvailable) { /* * If the exitEvent is set, break out of the loop. */ waitResult = WaitForSingleObjectEx(timeInfo.exitEvent, 1000, FALSE); if (waitResult == WAIT_OBJECT_0) { break; } UpdateTimeEachSecond(); } return (DWORD) 0; } /* *---------------------------------------------------------------------- * * UpdateTimeEachSecond -- * * Callback from the waitable timer in the clock calibration thread that * updates system time. * * Parameters: * info - Pointer to the static TimeInfo structure * * Results: * None. * * Side effects: * Performs virtual time calibration discipline. * *---------------------------------------------------------------------- */ static void UpdateTimeEachSecond(void) { LARGE_INTEGER curPerfCounter; /* Current value returned from * QueryPerformanceCounter. */ FILETIME curSysTime; /* Current system time. */ static LARGE_INTEGER lastFileTime; /* File time of the previous calibration */ LARGE_INTEGER curFileTime; /* File time at the time this callback was * scheduled. */ long long estFreq; /* Estimated perf counter frequency. */ long long vt0; /* Tcl time right now. */ long long vt1; /* Tcl time one second from now. */ long long tdiff; /* Difference between system clock and Tcl * time. */ long long driftFreq; /* Frequency needed to drift virtual time into * step over 1 second. */ /* * Sample performance counter and system time (from Posix epoch). */ GetSystemTimeAsFileTime(&curSysTime); curFileTime.LowPart = curSysTime.dwLowDateTime; curFileTime.HighPart = curSysTime.dwHighDateTime; curFileTime.QuadPart -= timeInfo.posixEpoch.QuadPart; /* * If calibration still not needed (check for possible time switch) */ if (curFileTime.QuadPart > lastFileTime.QuadPart && curFileTime.QuadPart < lastFileTime.QuadPart + (timeInfo.calibrationInterv * 10000000)) { /* * Look again in next one second. */ return; } QueryPerformanceCounter(&curPerfCounter); lastFileTime.QuadPart = curFileTime.QuadPart; /* * We divide by timeInfo.curCounterFreq.QuadPart in several places. That * value should always be positive on a correctly functioning system. But * it is good to be defensive about such matters. So if something goes * wrong and the value does goes to zero, we clear the * timeInfo.perfCounterAvailable in order to cause the calibration thread * to shut itself down, then return without additional processing. */ if (timeInfo.curCounterFreq.QuadPart == 0){ timeInfo.perfCounterAvailable = 0; return; } /* * Several things may have gone wrong here that have to be checked for. * (1) The performance counter may have jumped. * (2) The system clock may have been reset. * * In either case, we'll need to reinitialize the circular buffer with * samples relative to the current system time and the NOMINAL performance * frequency (not the actual, because the actual has probably run slow in * the first case). Our estimated frequency will be the nominal frequency. * * Store the current sample into the circular buffer of samples, and * estimate the performance counter frequency. */ estFreq = AccumulateSample(curPerfCounter.QuadPart, (unsigned long long) curFileTime.QuadPart); /* * We want to adjust things so that time appears to be continuous. * Virtual file time, right now, is * * vt0 = 10000000 * (curPerfCounter - perfCounterLastCall) * / curCounterFreq * + fileTimeLastCall * * Ideally, we would like to drift the clock into place over a period of 2 * sec, so that virtual time 2 sec from now will be * * vt1 = 20000000 + curFileTime * * The frequency that we need to use to drift the counter back into place * is estFreq * 20000000 / (vt1 - vt0) */ vt0 = NativeCalc100NsTicks(timeInfo.fileTimeLastCall.QuadPart, timeInfo.perfCounterLastCall.QuadPart, timeInfo.curCounterFreq.QuadPart, curPerfCounter.QuadPart); /* * If we've gotten more than a second away from system time, then drifting * the clock is going to be pretty hopeless. Just let it jump. Otherwise, * compute the drift frequency and fill in everything. */ tdiff = vt0 - curFileTime.QuadPart; if (tdiff > 10000000 || tdiff < -10000000) { /* * Jump to current system time, use curent estimated frequency. */ vt0 = curFileTime.QuadPart; } else { /* * Calculate new frequency and estimate drift to the next second. */ vt1 = 20000000 + curFileTime.QuadPart; driftFreq = (estFreq * 20000000 / (vt1 - vt0)); /* * Avoid too large drifts (only half of the current difference), that * allows also be more accurate (aspire to the smallest tdiff), so * then we can prolong calibration interval by tdiff < 100000 */ driftFreq = timeInfo.curCounterFreq.QuadPart + (driftFreq - timeInfo.curCounterFreq.QuadPart) / 2; /* * Average between estimated, 2 current and 5 drifted frequencies, * (do the soft drifting as possible) */ estFreq = (estFreq + 2 * timeInfo.curCounterFreq.QuadPart + 5 * driftFreq) / 8; } /* * Avoid too large discrepancy from nominal frequency. */ if (estFreq > 1003 * timeInfo.nominalFreq.QuadPart / 1000) { estFreq = 1003 * timeInfo.nominalFreq.QuadPart / 1000; vt0 = curFileTime.QuadPart; } else if (estFreq < 997 * timeInfo.nominalFreq.QuadPart / 1000) { estFreq = 997 * timeInfo.nominalFreq.QuadPart / 1000; vt0 = curFileTime.QuadPart; } else if (vt0 != curFileTime.QuadPart) { /* * Be sure the clock ticks never backwards (avoid it by negative * drifting). Just compare native time (in 100-ns) before and * hereafter using new calibrated values) and do a small adjustment * (short time freeze). */ LARGE_INTEGER newPerfCounter; long long nt0, nt1; QueryPerformanceCounter(&newPerfCounter); nt0 = NativeCalc100NsTicks(timeInfo.fileTimeLastCall.QuadPart, timeInfo.perfCounterLastCall.QuadPart, timeInfo.curCounterFreq.QuadPart, newPerfCounter.QuadPart); nt1 = NativeCalc100NsTicks(vt0, curPerfCounter.QuadPart, estFreq, newPerfCounter.QuadPart); if (nt0 > nt1) { /* * Drifted backwards, try to compensate with new base. * * First adjust with a micro jump (short frozen time is * acceptable). */ vt0 += nt0 - nt1; /* * If drift unavoidable (e. g. we had a time switch), then reset * it. */ vt1 = vt0 - curFileTime.QuadPart; if (vt1 > 10000000 || vt1 < -10000000) { /* * Larger jump resp. shift relative new file-time. */ vt0 = curFileTime.QuadPart; } } } /* * In lock commit new values to timeInfo (hold lock as short as possible) */ EnterCriticalSection(&timeInfo.cs); /* * Grow calibration interval up to 10 seconds (if still precise enough) */ if (tdiff < -100000 || tdiff > 100000) { /* * Too long drift. Reset calibration interval to 1000 second. */ timeInfo.calibrationInterv = 1; } else if (timeInfo.calibrationInterv < 10) { timeInfo.calibrationInterv++; } timeInfo.fileTimeLastCall.QuadPart = vt0; timeInfo.curCounterFreq.QuadPart = estFreq; timeInfo.perfCounterLastCall.QuadPart = curPerfCounter.QuadPart; LeaveCriticalSection(&timeInfo.cs); } /* *---------------------------------------------------------------------- * * ResetCounterSamples -- * * Fills the sample arrays in 'timeInfo' with dummy values that will * yield the current performance counter and frequency. * * Results: * None. * * Side effects: * The array of samples is filled in so that it appears that there are * SAMPLES samples at one-second intervals, separated by precisely the * given frequency. * *---------------------------------------------------------------------- */ static void ResetCounterSamples( unsigned long long fileTime,/* Current file time */ long long perfCounter, /* Current performance counter */ long long perfFreq) /* Target performance frequency */ { int i; for (i = SAMPLES - 1 ; i >= 0 ; --i) { timeInfo.perfCounterSample[i] = perfCounter; timeInfo.fileTimeSample[i] = fileTime; perfCounter -= perfFreq; fileTime -= 10000000; } timeInfo.sampleNo = 0; } /* *---------------------------------------------------------------------- * * AccumulateSample -- * * Updates the circular buffer of performance counter and system time * samples with a new data point. * * Results: * None. * * Side effects: * The new data point replaces the oldest point in the circular buffer, * and the descriptive statistics are updated to accumulate the new * point. * * Several things may have gone wrong here that have to be checked for. * (1) The performance counter may have jumped. * (2) The system clock may have been reset. * * In either case, we'll need to reinitialize the circular buffer with samples * relative to the current system time and the NOMINAL performance frequency * (not the actual, because the actual has probably run slow in the first * case). */ static long long AccumulateSample( long long perfCounter, unsigned long long fileTime) { unsigned long long workFTSample; /* File time sample being removed from or * added to the circular buffer. */ long long workPCSample; /* Performance counter sample being removed * from or added to the circular buffer. */ unsigned long long lastFTSample; /* Last file time sample recorded */ long long lastPCSample; /* Last performance counter sample recorded */ long long FTdiff; /* Difference between last FT and current */ long long PCdiff; /* Difference between last PC and current */ long long estFreq; /* Estimated performance counter frequency */ /* * Test for jumps and reset the samples if we have one. */ if (timeInfo.sampleNo == 0) { lastPCSample = timeInfo.perfCounterSample[timeInfo.sampleNo + SAMPLES - 1]; lastFTSample = timeInfo.fileTimeSample[timeInfo.sampleNo + SAMPLES - 1]; } else { lastPCSample = timeInfo.perfCounterSample[timeInfo.sampleNo - 1]; lastFTSample = timeInfo.fileTimeSample[timeInfo.sampleNo - 1]; } PCdiff = perfCounter - lastPCSample; FTdiff = fileTime - lastFTSample; if (PCdiff < timeInfo.nominalFreq.QuadPart * 9 / 10 || PCdiff > timeInfo.nominalFreq.QuadPart * 11 / 10 || FTdiff < 9000000 || FTdiff > 11000000) { ResetCounterSamples(fileTime, perfCounter, timeInfo.nominalFreq.QuadPart); return timeInfo.nominalFreq.QuadPart; } else { /* * Estimate the frequency. */ workPCSample = timeInfo.perfCounterSample[timeInfo.sampleNo]; workFTSample = timeInfo.fileTimeSample[timeInfo.sampleNo]; estFreq = 10000000 * (perfCounter - workPCSample) / (fileTime - workFTSample); timeInfo.perfCounterSample[timeInfo.sampleNo] = perfCounter; timeInfo.fileTimeSample[timeInfo.sampleNo] = (long long) fileTime; /* * Advance the sample number. */ if (++timeInfo.sampleNo >= SAMPLES) { timeInfo.sampleNo = 0; } return estFreq; } } /* *---------------------------------------------------------------------- * * Tcl_SetTimeProc -- * * TIP #233 (Virtualized Time): Registers two handlers for the * virtualization of Tcl's access to time information. * * Results: * None. * * Side effects: * Remembers the handlers, alters core behaviour. * *---------------------------------------------------------------------- */ void Tcl_SetTimeProc( Tcl_GetTimeProc *getProc, Tcl_ScaleTimeProc *scaleProc, void *clientData) { tclGetTimeProcPtr = getProc; tclScaleTimeProcPtr = scaleProc; tclTimeClientData = clientData; } /* *---------------------------------------------------------------------- * * Tcl_QueryTimeProc -- * * TIP #233 (Virtualized Time): Query which time handlers are registered. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void Tcl_QueryTimeProc( Tcl_GetTimeProc **getProc, Tcl_ScaleTimeProc **scaleProc, void **clientData) { if (getProc) { *getProc = tclGetTimeProcPtr; } if (scaleProc) { *scaleProc = tclScaleTimeProcPtr; } if (clientData) { *clientData = tclTimeClientData; } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinThrd.c0000644000175000017500000006542215104661342014604 0ustar sergeisergei/* * tclWinThread.c -- * * This file implements the Windows-specific thread operations. * * Copyright © 1998 Sun Microsystems, Inc. * Copyright © 1999 Scriptics Corporation * Copyright © 2008 George Peter Staplin * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclWinInt.h" /* Workaround for mingw versions which don't provide this in float.h */ #ifndef _MCW_EM # define _MCW_EM 0x0008001F /* Error masks */ # define _MCW_RC 0x00000300 /* Rounding */ # define _MCW_PC 0x00030000 /* Precision */ _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask); #endif /* * This is the global lock used to serialize access to other serialization * data structures. */ static CRITICAL_SECTION globalLock; static int initialized = 0; /* * This is the global lock used to serialize initialization and finalization * of Tcl as a whole. */ static CRITICAL_SECTION initLock; /* * allocLock is used by Tcl's version of malloc for synchronization. For * obvious reasons, cannot use any dynamically allocated storage. */ #if TCL_THREADS /* * Although CRITICAL_SECTIONs can be nested, we need to keep track * of their lock counts for condition variables. */ typedef struct WMutex { CRITICAL_SECTION crit; volatile LONG thread; int counter; } WMutex; static struct WMutex allocLock; static WMutex *allocLockPtr = &allocLock; static int allocOnce = 0; #endif /* TCL_THREADS */ /* * The joinLock serializes Create- and ExitThread. This is necessary to * prevent a race where a new joinable thread exits before the creating thread * had the time to create the necessary data structures in the emulation * layer. */ static CRITICAL_SECTION joinLock; /* * Condition variables are implemented with a combination of a per-thread * Windows Event and a per-condition waiting queue. The idea is that each * thread has its own Event that it waits on when it is doing a ConditionWait; * it uses the same event for all condition variables because it only waits on * one at a time. Each condition variable has a queue of waiting threads, and * a mutex used to serialize access to this queue. * * Special thanks to David Nichols and Jim Davidson for advice on the * Condition Variable implementation. */ /* * The per-thread event and queue pointers. */ #if TCL_THREADS typedef struct ThreadSpecificData { HANDLE condEvent; /* Per-thread condition event */ struct ThreadSpecificData *nextPtr; /* Queue pointers */ struct ThreadSpecificData *prevPtr; int flags; /* See ThreadStateFlags below */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; #endif /* TCL_THREADS */ /* * State bits for the thread. */ enum ThreadStateFlags { WIN_THREAD_UNINIT = 0x0, /* Uninitialized. Must be zero because of the * way ThreadSpecificData is created. */ WIN_THREAD_RUNNING = 0x1, /* Running, not waiting. */ WIN_THREAD_BLOCKED = 0x2 /* Waiting, or trying to wait. */ }; /* * The per condition queue pointers and the Mutex used to serialize access to * the queue. */ typedef struct { CRITICAL_SECTION condLock; /* Lock to serialize queuing on the * condition. */ ThreadSpecificData *firstPtr; /* Queue pointers */ ThreadSpecificData *lastPtr; } WinCondition; /* * Additions by AOL for specialized thread memory allocator. */ #ifdef USE_THREAD_ALLOC static DWORD tlsKey; typedef struct { Tcl_Mutex tlock; WMutex wm; } allocMutex; #endif /* USE_THREAD_ALLOC */ static void WMutexInit(WMutex *); static void WMutexDestroy(WMutex *); /* * The per thread data passed from TclpThreadCreate * to TclWinThreadStart. */ typedef struct { LPTHREAD_START_ROUTINE lpStartAddress; /* Original startup routine */ LPVOID lpParameter; /* Original startup data */ unsigned int fpControl; /* Floating point control word from the * main thread */ } WinThread; /* *---------------------------------------------------------------------- * * TclWinThreadStart -- * * This procedure is the entry point for all new threads created * by Tcl on Windows. * * Results: * Various, depending on the result of the wrapped thread start * routine. * * Side effects: * Arbitrary, since user code is executed. * *---------------------------------------------------------------------- */ static DWORD WINAPI TclWinThreadStart( LPVOID lpParameter) /* The WinThread structure pointer passed * from TclpThreadCreate */ { WinThread *winThreadPtr = (WinThread *) lpParameter; LPTHREAD_START_ROUTINE lpOrigStartAddress; LPVOID lpOrigParameter; if (!winThreadPtr) { return TCL_ERROR; } _controlfp(winThreadPtr->fpControl, _MCW_EM | _MCW_RC | 0x03000000 /* _MCW_DN */ #if !defined(_WIN64) | _MCW_PC #endif ); lpOrigStartAddress = winThreadPtr->lpStartAddress; lpOrigParameter = winThreadPtr->lpParameter; Tcl_Free(winThreadPtr); return lpOrigStartAddress(lpOrigParameter); } /* *---------------------------------------------------------------------- * * TclpThreadCreate -- * * This procedure creates a new thread. * * Results: * TCL_OK if the thread could be created. The thread ID is returned in a * parameter. * * Side effects: * A new thread is created. * *---------------------------------------------------------------------- */ int TclpThreadCreate( Tcl_ThreadId *idPtr, /* Return, the ID of the thread. */ Tcl_ThreadCreateProc *proc, /* Main() function of the thread. */ void *clientData, /* The one argument to Main(). */ size_t stackSize, /* Size of stack for the new thread. */ int flags) /* Flags controlling behaviour of the new * thread. */ { WinThread *winThreadPtr; /* Per-thread startup info */ HANDLE tHandle; winThreadPtr = (WinThread *)Tcl_Alloc(sizeof(WinThread)); winThreadPtr->lpStartAddress = (LPTHREAD_START_ROUTINE) proc; winThreadPtr->lpParameter = clientData; winThreadPtr->fpControl = _controlfp(0, 0); EnterCriticalSection(&joinLock); *idPtr = 0; /* must initialize as Tcl_Thread is a pointer and * on WIN64 sizeof void* != sizeof unsigned */ #if defined(_MSC_VER) || defined(__MSVCRT__) tHandle = (HANDLE) _beginthreadex(NULL, (unsigned)stackSize, (Tcl_ThreadCreateProc*) TclWinThreadStart, winThreadPtr, 0, (unsigned *)idPtr); #else tHandle = CreateThread(NULL, (DWORD)stackSize, TclWinThreadStart, winThreadPtr, 0, (LPDWORD)idPtr); #endif if (tHandle == NULL) { LeaveCriticalSection(&joinLock); return TCL_ERROR; } else { if (flags & TCL_THREAD_JOINABLE) { TclRememberJoinableThread(*idPtr); } /* * The only purpose of this is to decrement the reference count so the * OS resources will be reacquired when the thread closes. */ CloseHandle(tHandle); LeaveCriticalSection(&joinLock); return TCL_OK; } } /* *---------------------------------------------------------------------- * * Tcl_JoinThread -- * * This procedure waits upon the exit of the specified thread. * * Results: * TCL_OK if the wait was successful, TCL_ERROR else. * * Side effects: * The result area is set to the exit code of the thread we * waited upon. * *---------------------------------------------------------------------- */ int Tcl_JoinThread( Tcl_ThreadId threadId, /* Id of the thread to wait upon */ int *result) /* Reference to the storage the result of the * thread we wait upon will be written into. */ { return TclJoinThread(threadId, result); } /* *---------------------------------------------------------------------- * * TclpThreadExit -- * * This procedure terminates the current thread. * * Results: * None. * * Side effects: * This procedure terminates the current thread. * *---------------------------------------------------------------------- */ TCL_NORETURN void TclpThreadExit( int status) { EnterCriticalSection(&joinLock); TclSignalExitThread(Tcl_GetCurrentThread(), status); LeaveCriticalSection(&joinLock); #if defined(_MSC_VER) || defined(__MSVCRT__) _endthreadex((unsigned) status); #else ExitThread((DWORD) status); #endif } /* *---------------------------------------------------------------------- * * Tcl_GetCurrentThread -- * * This procedure returns the ID of the currently running thread. * * Results: * A thread ID. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_ThreadId Tcl_GetCurrentThread(void) { return (Tcl_ThreadId)INT2PTR(GetCurrentThreadId()); } /* *---------------------------------------------------------------------- * * TclpInitLock * * This procedure is used to grab a lock that serializes initialization * and finalization of Tcl. On some platforms this may also initialize * the mutex used to serialize creation of more mutexes and thread local * storage keys. * * Results: * None. * * Side effects: * Acquire the initialization mutex. * *---------------------------------------------------------------------- */ void TclpInitLock(void) { if (!initialized) { /* * There is a fundamental race here that is solved by creating the * first Tcl interpreter in a single threaded environment. Once the * interpreter has been created, it is safe to create more threads * that create interpreters in parallel. */ initialized = 1; InitializeCriticalSection(&joinLock); InitializeCriticalSection(&initLock); InitializeCriticalSection(&globalLock); } EnterCriticalSection(&initLock); } /* *---------------------------------------------------------------------- * * TclpInitUnlock * * This procedure is used to release a lock that serializes * initialization and finalization of Tcl. * * Results: * None. * * Side effects: * Release the initialization mutex. * *---------------------------------------------------------------------- */ void TclpInitUnlock(void) { LeaveCriticalSection(&initLock); } /* *---------------------------------------------------------------------- * * TclpGlobalLock * * This procedure is used to grab a lock that serializes creation of * mutexes, condition variables, and thread local storage keys. * * This lock must be different than the initLock because the initLock is * held during creation of synchronization objects. * * Results: * None. * * Side effects: * Acquire the global mutex. * *---------------------------------------------------------------------- */ void TclpGlobalLock(void) { if (!initialized) { /* * There is a fundamental race here that is solved by creating the * first Tcl interpreter in a single threaded environment. Once the * interpreter has been created, it is safe to create more threads * that create interpreters in parallel. */ initialized = 1; InitializeCriticalSection(&joinLock); InitializeCriticalSection(&initLock); InitializeCriticalSection(&globalLock); } EnterCriticalSection(&globalLock); } /* *---------------------------------------------------------------------- * * TclpGlobalUnlock * * This procedure is used to release a lock that serializes creation and * deletion of synchronization objects. * * Results: * None. * * Side effects: * Release the global mutex. * *---------------------------------------------------------------------- */ void TclpGlobalUnlock(void) { LeaveCriticalSection(&globalLock); } /* *---------------------------------------------------------------------- * * Tcl_GetAllocMutex * * This procedure returns a pointer to a statically initialized mutex for * use by the memory allocator. The allocator must use this lock, because * all other locks are allocated... * * Results: * A pointer to a mutex that is suitable for passing to Tcl_MutexLock and * Tcl_MutexUnlock. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Mutex * Tcl_GetAllocMutex(void) { #if TCL_THREADS if (!allocOnce) { WMutexInit(&allocLock); allocOnce = 1; } return (Tcl_Mutex *) &allocLockPtr; #else return NULL; #endif } /* *---------------------------------------------------------------------- * * TclFinalizeLock * * This procedure is used to destroy all private resources used in this * file. * * Results: * None. * * Side effects: * Destroys everything private. TclpInitLock must be held entering this * function. * *---------------------------------------------------------------------- */ void TclFinalizeLock(void) { TclpGlobalLock(); DeleteCriticalSection(&joinLock); /* * Destroy the critical section that we are holding! */ DeleteCriticalSection(&globalLock); initialized = 0; #if TCL_THREADS if (allocOnce) { WMutexDestroy(&allocLock); allocOnce = 0; } #endif LeaveCriticalSection(&initLock); /* * Destroy the critical section that we were holding. */ DeleteCriticalSection(&initLock); } #if TCL_THREADS static void WMutexInit( WMutex *wmPtr) { wmPtr->thread = 0; wmPtr->counter = 0; InitializeCriticalSection(&wmPtr->crit); } static void WMutexDestroy( WMutex *wmPtr) { DeleteCriticalSection(&wmPtr->crit); assert(wmPtr->thread == 0 && wmPtr->counter == 0); } static void WMutexLock( WMutex *wmPtr) { LONG mythread = GetCurrentThreadId(); if (wmPtr->thread == mythread) { // We owned the lock already, so it's recursive. wmPtr->counter++; } else { // We don't own the lock, so we can safely lock it. Then we own it. EnterCriticalSection(&wmPtr->crit); wmPtr->thread = mythread; } } static void WMutexUnlock( WMutex *wmPtr) { assert(wmPtr->thread == GetCurrentThreadId()); if (wmPtr->counter) { // It's recursive wmPtr->counter--; } else { wmPtr->thread = 0; LeaveCriticalSection(&wmPtr->crit); } } /* locally used prototype */ static void FinalizeConditionEvent(void *data); /* *---------------------------------------------------------------------- * * Tcl_MutexLock -- * * This procedure is invoked to lock a mutex. This is a self initializing * mutex that is automatically finalized during Tcl_Finalize. * * Results: * None. * * Side effects: * May block the current thread. The mutex is acquired when this returns. * *---------------------------------------------------------------------- */ void Tcl_MutexLock( Tcl_Mutex *mutexPtr) /* Really (WMutex **) */ { WMutex *wmPtr; if (*mutexPtr == NULL) { TclpGlobalLock(); /* * Double inside global lock check to avoid a race. */ if (*mutexPtr == NULL) { wmPtr = (WMutex *) Tcl_Alloc(sizeof(WMutex)); WMutexInit(wmPtr); *mutexPtr = (Tcl_Mutex) wmPtr; TclRememberMutex(mutexPtr); } TclpGlobalUnlock(); } wmPtr = *((WMutex **)mutexPtr); WMutexLock(wmPtr); } /* *---------------------------------------------------------------------- * * Tcl_MutexUnlock -- * * This procedure is invoked to unlock a mutex. * * Results: * None. * * Side effects: * The mutex is released when this returns. * *---------------------------------------------------------------------- */ void Tcl_MutexUnlock( Tcl_Mutex *mutexPtr) /* Really (WMutex **) */ { WMutex *wmPtr = *((WMutex **)mutexPtr); WMutexUnlock(wmPtr); } /* *---------------------------------------------------------------------- * * TclpFinalizeMutex -- * * This procedure is invoked to clean up one mutex. This is only safe to * call at the end of time. * * Results: * None. * * Side effects: * The mutex list is deallocated. * *---------------------------------------------------------------------- */ void TclpFinalizeMutex( Tcl_Mutex *mutexPtr) /* Really (WMutex **) */ { WMutex *wmPtr = *(WMutex **)mutexPtr; if (wmPtr != NULL) { WMutexDestroy(wmPtr); Tcl_Free(wmPtr); *mutexPtr = NULL; } } /* *---------------------------------------------------------------------- * * Tcl_ConditionWait -- * * This procedure is invoked to wait on a condition variable. The mutex * is atomically released as part of the wait, and automatically grabbed * when the condition is signaled. * * The mutex must be held when this procedure is called. * * Results: * None. * * Side effects: * May block the current thread. The mutex is acquired when this returns. * Will allocate memory for a HANDLE and initialize this the first time * this Tcl_Condition is used. * *---------------------------------------------------------------------- */ void Tcl_ConditionWait( Tcl_Condition *condPtr, /* Really (WinCondition **) */ Tcl_Mutex *mutexPtr, /* Really (CRITICAL_SECTION **) */ const Tcl_Time *timePtr) /* Timeout on waiting period */ { WinCondition *winCondPtr; /* Per-condition queue head */ WMutex *wmPtr; /* Caller's Mutex, after casting */ DWORD wtime; /* Windows time value */ int timeout; /* True if we got a timeout */ int counter; /* Caller's Mutex counter */ int doExit = 0; /* True if we need to do exit setup */ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Self initialize the two parts of the condition. The per-condition and * per-thread parts need to be handled independently. */ if (tsdPtr->flags == WIN_THREAD_UNINIT) { TclpGlobalLock(); /* * Create the per-thread event and queue pointers. */ if (tsdPtr->flags == WIN_THREAD_UNINIT) { tsdPtr->condEvent = CreateEventW(NULL, TRUE /* manual reset */, FALSE /* non signaled */, NULL); tsdPtr->nextPtr = NULL; tsdPtr->prevPtr = NULL; tsdPtr->flags = WIN_THREAD_RUNNING; doExit = 1; } TclpGlobalUnlock(); if (doExit) { /* * Create a per-thread exit handler to clean up the condEvent. We * must be careful to do this outside the Global Lock because * Tcl_CreateThreadExitHandler uses its own ThreadSpecificData, * and initializing that may drop back into the Global Lock. */ Tcl_CreateThreadExitHandler(FinalizeConditionEvent, tsdPtr); } } if (*condPtr == NULL) { TclpGlobalLock(); /* * Initialize the per-condition queue pointers and Mutex. */ if (*condPtr == NULL) { winCondPtr = (WinCondition *)Tcl_Alloc(sizeof(WinCondition)); InitializeCriticalSection(&winCondPtr->condLock); winCondPtr->firstPtr = NULL; winCondPtr->lastPtr = NULL; *condPtr = (Tcl_Condition) winCondPtr; TclRememberCondition(condPtr); } TclpGlobalUnlock(); } wmPtr = *((WMutex **)mutexPtr); winCondPtr = *((WinCondition **)condPtr); if (timePtr == NULL) { wtime = INFINITE; } else { wtime = (DWORD)timePtr->sec * 1000 + (DWORD)timePtr->usec / 1000; } /* * Queue the thread on the condition, using the per-condition lock for * serialization. */ tsdPtr->flags = WIN_THREAD_BLOCKED; tsdPtr->nextPtr = NULL; EnterCriticalSection(&winCondPtr->condLock); tsdPtr->prevPtr = winCondPtr->lastPtr; /* A: */ winCondPtr->lastPtr = tsdPtr; if (tsdPtr->prevPtr != NULL) { tsdPtr->prevPtr->nextPtr = tsdPtr; } if (winCondPtr->firstPtr == NULL) { winCondPtr->firstPtr = tsdPtr; } /* * Unlock the caller's mutex and wait for the condition, or a timeout. * There is a minor issue here in that we don't count down the timeout if * we get notified, but another thread grabs the condition before we do. * In that race condition we'll wait again for the full timeout. Timed * waits are dubious anyway. Either you have the locking protocol wrong * and are masking a deadlock, or you are using conditions to pause your * thread. */ counter = wmPtr->counter; wmPtr->counter = 0; LONG mythread = GetCurrentThreadId(); assert(wmPtr->thread == mythread); wmPtr->thread = 0; LeaveCriticalSection(&wmPtr->crit); timeout = 0; while (!timeout && (tsdPtr->flags & WIN_THREAD_BLOCKED)) { ResetEvent(tsdPtr->condEvent); LeaveCriticalSection(&winCondPtr->condLock); if (WaitForSingleObjectEx(tsdPtr->condEvent, wtime, TRUE) == WAIT_TIMEOUT) { timeout = 1; } EnterCriticalSection(&winCondPtr->condLock); } /* * Be careful on timeouts because the signal might arrive right around the * time limit and someone else could have taken us off the queue. */ if (timeout) { if (tsdPtr->flags & WIN_THREAD_RUNNING) { timeout = 0; } else { /* * When dequeueing, we can leave the tsdPtr->nextPtr and * tsdPtr->prevPtr with dangling pointers because they are * reinitialized w/out reading them when the thread is enqueued * later. */ if (winCondPtr->firstPtr == tsdPtr) { winCondPtr->firstPtr = tsdPtr->nextPtr; } else { tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr; } if (winCondPtr->lastPtr == tsdPtr) { winCondPtr->lastPtr = tsdPtr->prevPtr; } else { tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr; } tsdPtr->flags = WIN_THREAD_RUNNING; } } LeaveCriticalSection(&winCondPtr->condLock); EnterCriticalSection(&wmPtr->crit); wmPtr->counter = counter; wmPtr->thread = mythread; } /* *---------------------------------------------------------------------- * * Tcl_ConditionNotify -- * * This procedure is invoked to signal a condition variable. * * The mutex must be held during this call to avoid races, but this * interface does not enforce that. * * Results: * None. * * Side effects: * May unblock another thread. * *---------------------------------------------------------------------- */ void Tcl_ConditionNotify( Tcl_Condition *condPtr) { WinCondition *winCondPtr; ThreadSpecificData *tsdPtr; if (*condPtr != NULL) { winCondPtr = *((WinCondition **)condPtr); if (winCondPtr == NULL) { return; } /* * Loop through all the threads waiting on the condition and notify * them (i.e., broadcast semantics). The queue manipulation is guarded * by the per-condition coordinating mutex. */ EnterCriticalSection(&winCondPtr->condLock); while (winCondPtr->firstPtr != NULL) { tsdPtr = winCondPtr->firstPtr; winCondPtr->firstPtr = tsdPtr->nextPtr; if (winCondPtr->lastPtr == tsdPtr) { winCondPtr->lastPtr = NULL; } tsdPtr->flags = WIN_THREAD_RUNNING; tsdPtr->nextPtr = NULL; tsdPtr->prevPtr = NULL; /* Not strictly necessary, see A: */ SetEvent(tsdPtr->condEvent); } LeaveCriticalSection(&winCondPtr->condLock); } else { /* * No-one has used the condition variable, so there are no waiters. */ } } /* *---------------------------------------------------------------------- * * FinalizeConditionEvent -- * * This procedure is invoked to clean up the per-thread event used to * implement condition waiting. This is only safe to call at the end of * time. * * Results: * None. * * Side effects: * The per-thread event is closed. * *---------------------------------------------------------------------- */ static void FinalizeConditionEvent( void *data) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) data; tsdPtr->flags = WIN_THREAD_UNINIT; CloseHandle(tsdPtr->condEvent); } /* *---------------------------------------------------------------------- * * TclpFinalizeCondition -- * * This procedure is invoked to clean up a condition variable. This is * only safe to call at the end of time. * * This assumes the Global Lock is held. * * Results: * None. * * Side effects: * The condition variable is deallocated. * *---------------------------------------------------------------------- */ void TclpFinalizeCondition( Tcl_Condition *condPtr) { WinCondition *winCondPtr = *(WinCondition **)condPtr; /* * Note - this is called long after the thread-local storage is reclaimed. * The per-thread condition waiting event is reclaimed earlier in a * per-thread exit handler, which is called before thread local storage is * reclaimed. */ if (winCondPtr != NULL) { DeleteCriticalSection(&winCondPtr->condLock); Tcl_Free(winCondPtr); *condPtr = NULL; } } /* * Additions by AOL for specialized thread memory allocator. */ #ifdef USE_THREAD_ALLOC Tcl_Mutex * TclpNewAllocMutex(void) { allocMutex *lockPtr; lockPtr = (allocMutex *)malloc(sizeof(allocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } lockPtr->tlock = (Tcl_Mutex)&lockPtr->wm; WMutexInit(&lockPtr->wm); return &lockPtr->tlock; } void TclpFreeAllocMutex( Tcl_Mutex *mutex) /* The alloc mutex to free. */ { allocMutex *lockPtr = (allocMutex *) mutex; if (!lockPtr || !lockPtr->tlock) { return; } lockPtr->tlock = NULL; WMutexDestroy(&lockPtr->wm); free(lockPtr); } void TclpInitAllocCache(void) { /* * We need to make sure that TclpFreeAllocCache is called on each * thread that calls this, but only on threads that call this. */ tlsKey = TlsAlloc(); if (tlsKey == TLS_OUT_OF_INDEXES) { Tcl_Panic("could not allocate thread local storage"); } } void * TclpGetAllocCache(void) { void *result; result = TlsGetValue(tlsKey); if ((result == NULL) && (GetLastError() != NO_ERROR)) { Tcl_Panic("TlsGetValue failed from TclpGetAllocCache"); } return result; } void TclpSetAllocCache( void *ptr) { BOOL success; success = TlsSetValue(tlsKey, ptr); if (!success) { Tcl_Panic("TlsSetValue failed from TclpSetAllocCache"); } } void TclpFreeAllocCache( void *ptr) { BOOL success; if (ptr != NULL) { /* * Called by TclFinalizeThreadAlloc() and * TclFinalizeThreadAllocThread() during Tcl_Finalize() or * Tcl_FinalizeThread(). This function destroys the tsd key which * stores allocator caches in thread local storage. */ TclFreeAllocCache(ptr); success = TlsSetValue(tlsKey, NULL); if (!success) { Tcl_Panic("TlsSetValue failed from TclpFreeAllocCache"); } } else { /* * Called by us in TclFinalizeThreadAlloc() during the library * finalization initiated from Tcl_Finalize() */ success = TlsFree(tlsKey); if (!success) { Tcl_Panic("TlsFree failed from TclpFreeAllocCache"); } } } #endif /* USE_THREAD_ALLOC */ void * TclpThreadCreateKey(void) { DWORD *key; key = (DWORD *)TclpSysAlloc(sizeof *key); if (key == NULL) { Tcl_Panic("unable to allocate thread key!"); } *key = TlsAlloc(); if (*key == TLS_OUT_OF_INDEXES) { Tcl_Panic("unable to allocate thread-local storage"); } return key; } void TclpThreadDeleteKey( void *keyPtr) { DWORD *key = (DWORD *)keyPtr; if (!TlsFree(*key)) { Tcl_Panic("unable to delete key"); } TclpSysFree(keyPtr); } void TclpThreadSetGlobalTSD( void *tsdKeyPtr, void *ptr) { DWORD *key = (DWORD *)tsdKeyPtr; if (!TlsSetValue(*key, ptr)) { Tcl_Panic("unable to set global TSD value"); } } void * TclpThreadGetGlobalTSD( void *tsdKeyPtr) { DWORD *key = (DWORD *)tsdKeyPtr; return TlsGetValue(*key); } #endif /* TCL_THREADS */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinTest.c0000644000175000017500000004352315104661342014620 0ustar sergeisergei/* * tclWinTest.c -- * * Contains commands for platform specific tests on Windows. * * Copyright © 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef BUILD_tcl #undef STATIC_BUILD #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include "tclInt.h" #ifdef TCL_WITH_EXTERNAL_TOMMATH # include "tommath.h" #else # include "tclTomMath.h" #endif /* * For TestplatformChmod on Windows */ #include #include /* * MinGW 3.4.2 does not define this. */ #ifndef INHERITED_ACE #define INHERITED_ACE (0x10) #endif /* * Forward declarations of functions defined later in this file: */ static Tcl_ObjCmdProc TesteventloopCmd; static Tcl_ObjCmdProc TestvolumetypeCmd; static Tcl_ObjCmdProc TestwinclockCmd; static Tcl_ObjCmdProc TestwinsleepCmd; static Tcl_ObjCmdProc TestExceptionCmd; static int TestplatformChmod(const char *nativePath, int pmode); static Tcl_ObjCmdProc TestchmodCmd; /* *---------------------------------------------------------------------- * * TclplatformtestInit -- * * Defines commands that test platform specific functionality for Windows * platforms. * * Results: * A standard Tcl result. * * Side effects: * Defines new commands. * *---------------------------------------------------------------------- */ int TclplatformtestInit( Tcl_Interp *interp) /* Interpreter to add commands to. */ { /* * Add commands for platform specific tests for Windows here. */ Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testvolumetype", TestvolumetypeCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testwinclock", TestwinclockCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testwinsleep", TestwinsleepCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testexcept", TestExceptionCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * TesteventloopCmd -- * * This function implements the "testeventloop" command. It is used to * test the Tcl notifier from an "external" event loop (i.e. not * Tcl_DoOneEvent()). * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TesteventloopCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "done|wait"); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[1]), "done") == 0) { *framePtr = 1; } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) { int *oldFramePtr, done; int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); /* * Save the old stack frame pointer and set up the current frame. */ oldFramePtr = framePtr; framePtr = &done; /* * Enter a standard Windows event loop until the flag changes. Note * that we do not explicitly call Tcl_ServiceEvent(). */ done = 0; while (!done) { MSG msg; if (!GetMessageW(&msg, NULL, 0, 0)) { /* * The application is exiting, so repost the quit message and * start unwinding. */ PostQuitMessage((int) msg.wParam); break; } TranslateMessage(&msg); DispatchMessageW(&msg); } (void) Tcl_SetServiceMode(oldMode); framePtr = oldFramePtr; } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), "\": must be done or wait", (char *)NULL); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * Testvolumetype -- * * This function implements the "testvolumetype" command. It is used to * check the volume type (FAT, NTFS) of a volume. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestvolumetypeCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { #define VOL_BUF_SIZE 32 int found; char volType[VOL_BUF_SIZE]; const char *path; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?name?"); return TCL_ERROR; } if (objc == 2) { /* * path has to be really a proper volume, but we don't get query APIs * for that until NT5 */ path = Tcl_GetString(objv[1]); } else { path = NULL; } found = GetVolumeInformationA(path, NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); if (found == 0) { Tcl_AppendResult(interp, "could not get volume type for \"", (path?path:""), "\"", (char *)NULL); Tcl_WinConvertError(GetLastError()); return TCL_ERROR; } Tcl_AppendResult(interp, volType, (char *)NULL); return TCL_OK; #undef VOL_BUF_SIZE } /* *---------------------------------------------------------------------- * * TestwinclockCmd -- * * Command that returns the seconds and microseconds portions of the * system clock and of the Tcl clock so that they can be compared to * validate that the Tcl clock is staying in sync. * * Usage: * testclock * * Parameters: * None. * * Results: * Returns a standard Tcl result comprising a four-element list: the * seconds and microseconds portions of the system clock, and the seconds * and microseconds portions of the Tcl clock. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestwinclockCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ { static const FILETIME posixEpoch = { 0xD53E8000, 0x019DB1DE }; /* The Posix epoch, expressed as a Windows * FILETIME */ Tcl_Time tclTime; /* Tcl clock */ FILETIME sysTime; /* System clock */ Tcl_Obj *result; /* Result of the command */ LARGE_INTEGER t1, t2; LARGE_INTEGER p1, p2; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } QueryPerformanceCounter(&p1); Tcl_GetTime(&tclTime); GetSystemTimeAsFileTime(&sysTime); t1.LowPart = posixEpoch.dwLowDateTime; t1.HighPart = posixEpoch.dwHighDateTime; t2.LowPart = sysTime.dwLowDateTime; t2.HighPart = sysTime.dwHighDateTime; t2.QuadPart -= t1.QuadPart; QueryPerformanceCounter(&p2); result = Tcl_NewObj(); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj(t2.QuadPart / 10000000)); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj((t2.QuadPart / 10) % 1000000)); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj(tclTime.sec)); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj(tclTime.usec)); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj(p1.QuadPart)); Tcl_ListObjAppendElement(interp, result, Tcl_NewWideIntObj(p2.QuadPart)); Tcl_SetObjResult(interp, result); return TCL_OK; } static int TestwinsleepCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int ms; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "ms"); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &ms) != TCL_OK) { return TCL_ERROR; } Sleep((DWORD) ms); return TCL_OK; } /* *---------------------------------------------------------------------- * * TestExceptionCmd -- * * Causes this process to end with the named exception. Used for testing * Tcl_WaitPid(). * * Usage: * testexcept * * Parameters: * Type of exception. * * Results: * None, this process closes now and doesn't return. * * Side effects: * This Tcl process closes, hard... Bang! * *---------------------------------------------------------------------- */ static int TestExceptionCmd( TCL_UNUSED(void *), Tcl_Interp* interp, /* Tcl interpreter */ int objc, /* Argument count */ Tcl_Obj *const objv[]) /* Argument vector */ { static const char *const cmds[] = { "access_violation", "datatype_misalignment", "array_bounds", "float_denormal", "float_divbyzero", "float_inexact", "float_invalidop", "float_overflow", "float_stack", "float_underflow", "int_divbyzero", "int_overflow", "private_instruction", "inpageerror", "illegal_instruction", "noncontinue", "stack_overflow", "invalid_disp", "guard_page", "invalid_handle", "ctrl+c", NULL }; static const DWORD exceptions[] = { EXCEPTION_ACCESS_VIOLATION, EXCEPTION_DATATYPE_MISALIGNMENT, EXCEPTION_ARRAY_BOUNDS_EXCEEDED, EXCEPTION_FLT_DENORMAL_OPERAND, EXCEPTION_FLT_DIVIDE_BY_ZERO, EXCEPTION_FLT_INEXACT_RESULT, EXCEPTION_FLT_INVALID_OPERATION, EXCEPTION_FLT_OVERFLOW, EXCEPTION_FLT_STACK_CHECK, EXCEPTION_FLT_UNDERFLOW, EXCEPTION_INT_DIVIDE_BY_ZERO, EXCEPTION_INT_OVERFLOW, EXCEPTION_PRIV_INSTRUCTION, EXCEPTION_IN_PAGE_ERROR, EXCEPTION_ILLEGAL_INSTRUCTION, EXCEPTION_NONCONTINUABLE_EXCEPTION, EXCEPTION_STACK_OVERFLOW, EXCEPTION_INVALID_DISPOSITION, EXCEPTION_GUARD_PAGE, EXCEPTION_INVALID_HANDLE, CONTROL_C_EXIT }; int cmd; if (objc != 2) { Tcl_WrongNumArgs(interp, 0, objv, ""); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], cmds, "command", 0, &cmd) != TCL_OK) { return TCL_ERROR; } /* * Make sure the GPF dialog doesn't popup. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); /* * As Tcl does not handle structured exceptions, this falls all the way * back up the instruction stack to the C run-time portion that called * main() where the process will now be terminated with this exception * code by the default handler the C run-time provides. */ /* SMASH! */ RaiseException(exceptions[cmd], EXCEPTION_NONCONTINUABLE, 0, NULL); return TCL_OK; } /* * This "chmod" works sufficiently for test script purposes. Do not expect * it to be exact emulation of Unix chmod (not sure if that's even possible) */ static int TestplatformChmod( const char *nativePath, int pmode) { /* * Note FILE_DELETE_CHILD missing from dirWriteMask because we do * not want overriding of child's delete setting when testing */ static const DWORD dirWriteMask = FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_ADD_FILE | FILE_ADD_SUBDIRECTORY | STANDARD_RIGHTS_WRITE | DELETE | SYNCHRONIZE; static const DWORD dirReadMask = FILE_READ_ATTRIBUTES | FILE_READ_EA | FILE_LIST_DIRECTORY | STANDARD_RIGHTS_READ | SYNCHRONIZE; /* Note - default user privileges allow ignoring TRAVERSE setting */ static const DWORD dirExecuteMask = FILE_TRAVERSE | STANDARD_RIGHTS_READ | SYNCHRONIZE; static const DWORD fileWriteMask = FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_WRITE_DATA | FILE_APPEND_DATA | STANDARD_RIGHTS_WRITE | DELETE | SYNCHRONIZE; static const DWORD fileReadMask = FILE_READ_ATTRIBUTES | FILE_READ_EA | FILE_READ_DATA | STANDARD_RIGHTS_READ | SYNCHRONIZE; static const DWORD fileExecuteMask = FILE_EXECUTE | STANDARD_RIGHTS_READ | SYNCHRONIZE; DWORD attr, newAclSize; PACL newAcl = NULL; int res = 0; HANDLE hToken = NULL; int i; int nSids = 0; struct { PSID pSid; DWORD mask; DWORD sidLen; } aceEntry[3]; DWORD dw; int isDir; TOKEN_USER *pTokenUser = NULL; Tcl_DString ds; res = -1; /* Assume failure */ Tcl_DStringInit(&ds); Tcl_UtfToChar16DString(nativePath, -1, &ds); attr = GetFileAttributesW((WCHAR *)Tcl_DStringValue(&ds)); if (attr == 0xFFFFFFFF) { goto done; /* Not found */ } isDir = (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) { goto done; } /* Get process SID */ if (!GetTokenInformation(hToken, TokenUser, NULL, 0, &dw) && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { goto done; } pTokenUser = (TOKEN_USER *)Tcl_Alloc(dw); if (!GetTokenInformation(hToken, TokenUser, pTokenUser, dw, &dw)) { goto done; } aceEntry[nSids].sidLen = GetLengthSid(pTokenUser->User.Sid); aceEntry[nSids].pSid = (PSID)Tcl_Alloc(aceEntry[nSids].sidLen); if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid, pTokenUser->User.Sid)) { Tcl_Free(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */ goto done; } /* * Always include DACL modify rights so we don't get locked out */ aceEntry[nSids].mask = READ_CONTROL | WRITE_DAC | WRITE_OWNER | SYNCHRONIZE | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES; if (pmode & 0700) { /* Owner permissions. Assumes current process is owner */ if (pmode & 0400) { aceEntry[nSids].mask |= isDir ? dirReadMask : fileReadMask; } if (pmode & 0200) { aceEntry[nSids].mask |= isDir ? dirWriteMask : fileWriteMask; } if (pmode & 0100) { aceEntry[nSids].mask |= isDir ? dirExecuteMask : fileExecuteMask; } } ++nSids; if (pmode & 0070) { /* Group permissions. */ TOKEN_PRIMARY_GROUP *pTokenGroup; /* Get primary group SID */ if (!GetTokenInformation( hToken, TokenPrimaryGroup, NULL, 0, &dw) && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { goto done; } pTokenGroup = (TOKEN_PRIMARY_GROUP *)Tcl_Alloc(dw); if (!GetTokenInformation(hToken, TokenPrimaryGroup, pTokenGroup, dw, &dw)) { Tcl_Free(pTokenGroup); goto done; } aceEntry[nSids].sidLen = GetLengthSid(pTokenGroup->PrimaryGroup); aceEntry[nSids].pSid = (PSID)Tcl_Alloc(aceEntry[nSids].sidLen); if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid, pTokenGroup->PrimaryGroup)) { Tcl_Free(pTokenGroup); Tcl_Free(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */ goto done; } Tcl_Free(pTokenGroup); /* Generate mask for group ACL */ aceEntry[nSids].mask = 0; if (pmode & 0040) { aceEntry[nSids].mask |= isDir ? dirReadMask : fileReadMask; } if (pmode & 0020) { aceEntry[nSids].mask |= isDir ? dirWriteMask : fileWriteMask; } if (pmode & 0010) { aceEntry[nSids].mask |= isDir ? dirExecuteMask : fileExecuteMask; } ++nSids; } if (pmode & 0007) { /* World permissions */ PSID pWorldSid; if (!ConvertStringSidToSidA("S-1-1-0", &pWorldSid)) { goto done; } aceEntry[nSids].sidLen = GetLengthSid(pWorldSid); aceEntry[nSids].pSid = (PSID)Tcl_Alloc(aceEntry[nSids].sidLen); if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid, pWorldSid)) { LocalFree(pWorldSid); Tcl_Free(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */ goto done; } LocalFree(pWorldSid); /* Generate mask for world ACL */ aceEntry[nSids].mask = 0; if (pmode & 0004) { aceEntry[nSids].mask |= isDir ? dirReadMask : fileReadMask; } if (pmode & 0002) { aceEntry[nSids].mask |= isDir ? dirWriteMask : fileWriteMask; } if (pmode & 0001) { aceEntry[nSids].mask |= isDir ? dirExecuteMask : fileExecuteMask; } ++nSids; } /* Allocate memory and initialize the new ACL. */ newAclSize = sizeof(ACL); /* Add in size required for each ACE entry in the ACL */ for (i = 0; i < nSids; ++i) { newAclSize += offsetof(ACCESS_ALLOWED_ACE, SidStart) + aceEntry[i].sidLen; } newAcl = (PACL)Tcl_Alloc(newAclSize); if (!InitializeAcl(newAcl, newAclSize, ACL_REVISION)) { goto done; } for (i = 0; i < nSids; ++i) { if (!AddAccessAllowedAce(newAcl, ACL_REVISION, aceEntry[i].mask, aceEntry[i].pSid)) { goto done; } } /* * Apply the new ACL. Note PROTECTED_DACL_SECURITY_INFORMATION can be used * to remove inherited ACL (we need to overwrite the default ACL's in this case) */ if (SetNamedSecurityInfoW((LPWSTR)Tcl_DStringValue(&ds), SE_FILE_OBJECT, DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION, NULL, NULL, newAcl, NULL) == ERROR_SUCCESS) { res = 0; } done: if (pTokenUser) { Tcl_Free(pTokenUser); } if (hToken) { CloseHandle(hToken); } if (newAcl) { Tcl_Free(newAcl); } for (i = 0; i < nSids; ++i) { Tcl_Free(aceEntry[i].pSid); } if (res == 0) { /* Run normal chmod command */ res = _wchmod((WCHAR*)Tcl_DStringValue(&ds), pmode); } Tcl_DStringFree(&ds); return res; } /* *--------------------------------------------------------------------------- * * TestchmodCmd -- * * Implements the "testchmod" cmd. Used when testing "file" command. The * only attribute used by the Windows platform is the user write flag; if * this is not set, the file is made read-only. Otherwise, the file is * made read-write. * * Results: * A standard Tcl result. * * Side effects: * Changes permissions of specified files. * *--------------------------------------------------------------------------- */ static int TestchmodCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Parameter count */ Tcl_Obj *const * objv) /* Parameter vector */ { int i, mode; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &mode) != TCL_OK) { return TCL_ERROR; } for (i = 2; i < objc; i++) { Tcl_DString buffer; const char *translated; translated = Tcl_TranslateFileName(interp, Tcl_GetString(objv[i]), &buffer); if (translated == NULL) { return TCL_ERROR; } if (TestplatformChmod(translated, mode) != 0) { Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp), (char *)NULL); return TCL_ERROR; } Tcl_DStringFree(&buffer); } return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinSock.c0000644000175000017500000024605515104661342014605 0ustar sergeisergei/* * tclWinSock.c -- * * This file contains Windows-specific socket related code. * * Copyright © 1995-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. * * ----------------------------------------------------------------------- * The order and naming of functions in this file should minimize * the file diff to tclUnixSock.c. * ----------------------------------------------------------------------- * * General information on how this module works. * * - Each Tcl-thread with its sockets maintains an internal window to receive * socket messages from the OS. * * - To ensure that message reception is always running this window is * actually owned and handled by an internal thread. This we call the * co-thread of Tcl's thread. * * - The whole structure is set up by InitSockets() which is called for each * Tcl thread. The implementation of the co-thread is in SocketThread(), * and the messages are handled by SocketProc(). The connection between * both is not directly visible, it is done through a Win32 window class. * This class is initialized by InitSockets() as well, and used in the * creation of the message receiver windows. * * - An important thing to note is that *both* thread and co-thread have * access to the list of sockets maintained in the private TSD data of the * thread. The co-thread was given access to it upon creation through the * new thread's client-data. * * Because of this dual access the TSD data contains an OS mutex, the * "socketListLock", to mediate exclusion between thread and co-thread. * * The co-thread's access is all in SocketProc(). The thread's access is * through SocketEventProc() (1) and the functions called by it. * * (Ad 1) This is the handler function for all queued socket events, which * all the OS messages are translated to through the EventSource (2) * driven by the OS messages. * * (Ad 2) The main functions for this are SocketSetupProc() and * SocketCheckProc(). */ #include "tclWinInt.h" #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif #ifdef _MSC_VER # pragma comment (lib, "ws2_32") #endif /* * Helper macros to make parts of this file clearer. The macros do exactly * what they say on the tin. :-) They also only ever refer to their arguments * once, and so can be used without regard to side effects. */ #define SET_BITS(var, bits) ((var) |= (bits)) #define CLEAR_BITS(var, bits) ((var) &= ~(bits)) #define GOT_BITS(var, bits) (((var) & (bits)) != 0) /* "sock" + a pointer in hex + \0 */ #define SOCK_CHAN_LENGTH (16 + TCL_INTEGER_SPACE) /* * The following variable is used to tell whether this module has been * initialized. If 1, initialization of sockets was successful, if -1 then * socket initialization failed (WSAStartup failed). */ static int initialized = 0; static const WCHAR className[] = L"TclSocket"; TCL_DECLARE_MUTEX(socketMutex) /* * The following defines declare the messages used on socket windows. */ enum TclSocketMessages { SOCKET_MESSAGE = WM_USER+1, /* Sent by OS: something happened. */ SOCKET_SELECT = WM_USER+2, /* Adjust select mask. */ SOCKET_TERMINATE = WM_USER+3/* Stop worker thread. */ }; /* * Operations used with a SOCKET_SELECT message. */ enum SocketSelectOperations { SELECT = TRUE, /* Add socket to select. */ UNSELECT = FALSE /* Remove socket from select. */ }; /* * This is needed to comply with the strict aliasing rules of GCC, but it also * simplifies casting between the different sockaddr types. */ typedef union { struct sockaddr sa; struct sockaddr_in sa4; struct sockaddr_in6 sa6; struct sockaddr_storage sas; } address; #ifndef IN6_ARE_ADDR_EQUAL #define IN6_ARE_ADDR_EQUAL IN6_ADDR_EQUAL #endif /* * This structure describes per-instance state of a tcp-based channel. */ typedef struct TcpState TcpState; typedef struct TcpFdList { TcpState *statePtr; SOCKET fd; struct TcpFdList *next; } TcpFdList; struct TcpState { Tcl_Channel channel; /* Channel associated with this socket. */ int flags; /* Bit field comprised of the flags described * below. */ struct TcpFdList *sockets; /* Windows SOCKET handle. */ int watchEvents; /* OR'ed combination of FD_READ, FD_WRITE, * FD_CLOSE, FD_ACCEPT and FD_CONNECT that * indicate which events are interesting. */ volatile int readyEvents; /* OR'ed combination of FD_READ, FD_WRITE, * FD_CLOSE, FD_ACCEPT and FD_CONNECT that * indicate which events have occurred. * Set by notifier thread, access must be * protected by semaphore */ int selectEvents; /* OR'ed combination of FD_READ, FD_WRITE, * FD_CLOSE, FD_ACCEPT and FD_CONNECT that * indicate which events are currently being * selected. */ volatile int acceptEventCount; /* Count of the current number of FD_ACCEPTs * that have arrived and not yet processed. * Set by notifier thread, access must be * protected by semaphore */ Tcl_TcpAcceptProc *acceptProc; /* Proc to call on accept. */ void *acceptProcData; /* The data for the accept proc. */ /* * Only needed for client sockets */ struct addrinfo *addrlist; /* Addresses to connect to. */ struct addrinfo *addr; /* Iterator over addrlist. */ struct addrinfo *myaddrlist;/* Local address. */ struct addrinfo *myaddr; /* Iterator over myaddrlist. */ int connectError; /* Cache status of async socket. */ int cachedBlocking; /* Cache blocking mode of async socket. */ volatile int notifierConnectError; /* Async connect error set by notifier thread. * This error is still a windows error code. * Access must be protected by semaphore */ struct TcpState *nextPtr; /* The next socket on the per-thread socket * list. */ }; /* * These bits may be OR'ed together into the "flags" field of a TcpState * structure. */ enum TcpStateFlags { TCP_NONBLOCKING = 1<<0, /* Socket with non-blocking I/O. */ TCP_ASYNC_CONNECT = 1<<1, /* Async connect in progress. */ SOCKET_EOF = 1<<2, /* A zero read happened on the socket. */ SOCKET_PENDING = 1<<3, /* A message has been sent for this socket */ TCP_ASYNC_PENDING = 1<<4, /* TcpConnect was called to process an async * connect. This flag indicates that reentry is * still pending. */ TCP_ASYNC_FAILED = 1<<5, /* An async connect finally failed. */ TCP_ASYNC_TEST_MODE = 1<<8 /* Async testing activated. Do not * automatically continue connection * process */ }; /* * The following structure is what is added to the Tcl event queue when a * socket event occurs. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ SOCKET socket; /* Socket descriptor that is ready. Used to * find the TcpState structure for the file * (can't point directly to the TcpState * structure because it could go away while * the event is queued). */ } SocketEvent; /* * This defines the minimum buffersize maintained by the kernel. */ #define TCP_BUFFER_SIZE 4096 /* * Per (main) thread data, holding list of things being waited upon and the * various handles to things doing the waiting/notification. */ typedef struct { HWND hwnd; /* Handle to window for socket messages. */ HANDLE socketThread; /* Thread handling the window */ Tcl_ThreadId threadId; /* Parent thread. */ HANDLE readyEvent; /* Event indicating that a socket event is * ready. Also used to indicate that the * socketThread has been initialized and has * started. */ HANDLE socketListLock; /* Win32 Event to lock the socketList */ TcpState *pendingTcpState; /* This socket is opened but not jet in the * list. This value is also checked by * the event structure. */ TcpState *socketList; /* Every open socket in this thread has an * entry on this list. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; static WNDCLASSW windowClass; /* * Static routines for this file: */ static int TcpConnect(Tcl_Interp *interp, TcpState *state); static void InitSocketWindowClass(void); static TcpState * NewSocketInfo(SOCKET socket); static void SocketExitHandler(void *clientData); static LRESULT CALLBACK SocketProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); static void TcpAccept(TcpFdList *fds, SOCKET newSocket, address addr); static int WaitForConnect(TcpState *statePtr, int *errorCodePtr); static int WaitForSocketEvent(TcpState *statePtr, int events, int *errorCodePtr); static void AddSocketInfoFd(TcpState *statePtr, SOCKET socket); static int FindFDInList(TcpState *statePtr, SOCKET socket); static DWORD WINAPI SocketThread(LPVOID arg); static void TcpThreadActionProc(void *instanceData, int action); static int TcpCloseProc(void *, Tcl_Interp *); static Tcl_EventCheckProc SocketCheckProc; static Tcl_EventProc SocketEventProc; static Tcl_EventSetupProc SocketSetupProc; static Tcl_DriverBlockModeProc TcpBlockModeProc; static Tcl_DriverClose2Proc TcpClose2Proc; static Tcl_DriverSetOptionProc TcpSetOptionProc; static Tcl_DriverGetOptionProc TcpGetOptionProc; static Tcl_DriverInputProc TcpInputProc; static Tcl_DriverOutputProc TcpOutputProc; static Tcl_DriverWatchProc TcpWatchProc; static Tcl_DriverGetHandleProc TcpGetHandleProc; /* * This structure describes the channel type structure for TCP socket * based IO: */ static const Tcl_ChannelType tcpChannelType = { "tcp", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ TcpInputProc, TcpOutputProc, NULL, /* Deprecated. */ TcpSetOptionProc, TcpGetOptionProc, TcpWatchProc, TcpGetHandleProc, TcpClose2Proc, TcpBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ TcpThreadActionProc, NULL /* Truncate proc. */ }; /* * The following variable holds the network name of this host. */ static TclInitProcessGlobalValueProc InitializeHostName; static ProcessGlobalValue hostName = {0, 0, NULL, NULL, InitializeHostName, NULL, NULL}; /* *---------------------------------------------------------------------- * * SendSelectMessage -- * * Simple wrapper round the SendMessage syscall with a SOCKET_SELECT * message to add a bit of type safety. * *---------------------------------------------------------------------- */ static inline void SendSelectMessage( ThreadSpecificData *tsdPtr, /* Reference to this thread's worker. */ int operation, /* Whether to add or remove from the mask. */ TcpState *payload) /* What socket to add/remove. */ { SendMessageW(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) operation, (LPARAM) payload); } /* * Address print debug functions */ #if 0 static inline void printaddrinfo( struct addrinfo *ai, char *prefix) { char host[NI_MAXHOST], port[NI_MAXSERV]; getnameinfo(ai->ai_addr, ai->ai_addrlen, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); } static void printaddrinfolist( struct addrinfo *addrlist, char *prefix) { struct addrinfo *ai; for (ai = addrlist; ai != NULL; ai = ai->ai_next) { printaddrinfo(ai, prefix); } } #endif /* *---------------------------------------------------------------------- * * InitializeHostName -- * * This routine sets the process global value of the name of the local * host on which the process is running. * * Results: * None. * *---------------------------------------------------------------------- */ void InitializeHostName( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { WCHAR wbuf[256]; DWORD length = sizeof(wbuf) / sizeof(WCHAR); Tcl_DString ds; Tcl_DStringInit(&ds); if (GetComputerNameExW(ComputerNamePhysicalDnsFullyQualified, wbuf, &length) != 0) { /* * Convert string from WCHAR to utf-8, then change to lowercase, * then to system encoding. */ Tcl_DString inDs; Tcl_DStringInit(&inDs); Tcl_UtfToLower(Tcl_WCharToUtfDString(wbuf, TCL_INDEX_NONE, &inDs)); Tcl_UtfToExternalDStringEx(NULL, NULL, Tcl_DStringValue(&inDs), TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); Tcl_DStringFree(&inDs); } else { TclInitSockets(); /* * The buffer size of 256 is recommended by the MSDN page that * documents gethostname() as being always adequate. */ Tcl_DStringInit(&ds); Tcl_DStringSetLength(&ds, 256); gethostname(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_DStringSetLength(&ds, strlen(Tcl_DStringValue(&ds))); } *encodingPtr = Tcl_GetEncoding(NULL, NULL); *lengthPtr = Tcl_DStringLength(&ds); *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); memcpy(*valuePtr, Tcl_DStringValue(&ds), *lengthPtr + 1); Tcl_DStringFree(&ds); } /* *---------------------------------------------------------------------- * * Tcl_GetHostName -- * * Returns the name of the local host. * * Results: * A string containing the network name for this machine, or an empty * string if we can't figure out the name. The caller must not modify or * free this string. * * Side effects: * Caches the name to return for future calls. * *---------------------------------------------------------------------- */ const char * Tcl_GetHostName(void) { return Tcl_GetString(TclGetProcessGlobalValue(&hostName)); } /* *---------------------------------------------------------------------- * * TclInitSockets -- * * Initialization of sockets for the thread. Also creates message * handling window class for the process if needed. * * Results: * Nothing. Panics on failure. * * Side effects: * If not already prepared, initializes the TSD structure and socket * message handling thread associated to the calling thread for the * subsystem of the driver. * *---------------------------------------------------------------------- */ void TclInitSockets(void) { /* Then Per thread initialization. */ DWORD id; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); if (tsdPtr != NULL) { return; } InitSocketWindowClass(); /* * OK, this thread has never done anything with sockets before. Construct * a worker thread to handle asynchronous events related to sockets * assigned to _this_ thread. */ tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->pendingTcpState = NULL; tsdPtr->socketList = NULL; tsdPtr->hwnd = NULL; tsdPtr->threadId = Tcl_GetCurrentThread(); tsdPtr->readyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); if (tsdPtr->readyEvent == NULL) { goto initFailure; } tsdPtr->socketListLock = CreateEventW(NULL, FALSE, TRUE, NULL); if (tsdPtr->socketListLock == NULL) { goto initFailure; } tsdPtr->socketThread = CreateThread(NULL, 256, SocketThread, tsdPtr, 0, &id); if (tsdPtr->socketThread == NULL) { goto initFailure; } SetThreadPriority(tsdPtr->socketThread, THREAD_PRIORITY_HIGHEST); /* * Wait for the thread to signal when the window has been created and if * it is ready to go. */ WaitForSingleObject(tsdPtr->readyEvent, INFINITE); if (tsdPtr->hwnd != NULL) { Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL); return; } initFailure: Tcl_Panic("InitSockets failed"); return; } /* *---------------------------------------------------------------------- * * TclpFinalizeSockets -- * * This function is called from Tcl_FinalizeThread to finalize the * platform specific socket subsystem. Also, it may be called from within * this module to cleanup the state if unable to initialize the sockets * subsystem. * * Results: * None. * * Side effects: * Deletes the event source and destroys the socket thread. * *---------------------------------------------------------------------- */ void TclpFinalizeSockets(void) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); /* * Careful! This is a finalizer! */ if (tsdPtr == NULL) { return; } if (tsdPtr->socketThread != NULL) { if (tsdPtr->hwnd != NULL) { PostMessageW(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0); /* * Wait for the thread to exit. This ensures that we are * completely cleaned up before we leave this function. */ WaitForSingleObject(tsdPtr->socketThread, INFINITE); tsdPtr->hwnd = NULL; } CloseHandle(tsdPtr->socketThread); tsdPtr->socketThread = NULL; } if (tsdPtr->readyEvent != NULL) { CloseHandle(tsdPtr->readyEvent); tsdPtr->readyEvent = NULL; } if (tsdPtr->socketListLock != NULL) { CloseHandle(tsdPtr->socketListLock); tsdPtr->socketListLock = NULL; } Tcl_DeleteEventSource(SocketSetupProc, SocketCheckProc, NULL); } /* *---------------------------------------------------------------------- * * TcpBlockModeProc -- * * This function is invoked by the generic IO level to set blocking and * nonblocking mode on a TCP socket based channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or nonblocking mode. * *---------------------------------------------------------------------- */ static int TcpBlockModeProc( void *instanceData, /* Socket state. */ int mode) /* The mode to set. Can be one of * TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { TcpState *statePtr = (TcpState *)instanceData; if (mode == TCL_MODE_NONBLOCKING) { SET_BITS(statePtr->flags, TCP_NONBLOCKING); } else { CLEAR_BITS(statePtr->flags, TCP_NONBLOCKING); } return 0; } /* *---------------------------------------------------------------------- * * WaitForConnect -- * * Check the state of an async connect process. If a connection attempt * terminated, process it, which may finalize it or may start the next * attempt. If a connect error occures, it is saved in * statePtr->connectError to be reported by 'fconfigure -error'. * * There are two modes of operation, defined by errorCodePtr: * * non-NULL: Called by explicite read/write command. Block if socket * is blocking. * May return two error codes: * * EWOULDBLOCK: if connect is still in progress * * ENOTCONN: if connect failed. This would be the error message * of a recv or sendto syscall so this is emulated here. * * Null: Called by a background operation. Do not block and don't * return any error code. * * Results: * 0 if the connection has completed, -1 if still in progress or there is * an error. * * Side effects: * Processes socket events off the system queue. May process * asynchronous connect. * *---------------------------------------------------------------------- */ static int WaitForConnect( TcpState *statePtr, /* State of the socket. */ int *errorCodePtr) /* Where to store errors? A passed * null-pointer activates background mode. */ { int result; int oldMode; /* * Check if an async connect failed already and error reporting is * demanded, return the error ENOTCONN. */ if (errorCodePtr != NULL && GOT_BITS(statePtr->flags, TCP_ASYNC_FAILED)) { *errorCodePtr = ENOTCONN; return -1; } /* * Check if an async connect is running. If not return ok */ if (!GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { return 0; } /* * In socket test mode do not continue with the connect * Exceptions are: * - Call by recv/send and blocking socket * (errorCodePtr != NULL && !GOT_BITS(flags, TCP_NONBLOCKING)) * - Call by the event queue (errorCodePtr == NULL) */ if (GOT_BITS(statePtr->flags, TCP_ASYNC_TEST_MODE) && errorCodePtr != NULL && GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) { *errorCodePtr = EWOULDBLOCK; return -1; } /* * Be sure to disable event servicing so we are truly modal. */ oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); /* * Loop in the blocking case until the connect signal is present */ while (1) { /* * Get the statePtr lock. */ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Check for connect event. */ if (GOT_BITS(statePtr->readyEvents, FD_CONNECT)) { /* * Consume the connect event. */ CLEAR_BITS(statePtr->readyEvents, FD_CONNECT); /* * For blocking sockets and foreground processing, disable async * connect as we continue now synchronously. */ if (errorCodePtr != NULL && !GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) { CLEAR_BITS(statePtr->flags, TCP_ASYNC_CONNECT); } /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); /* * Continue connect. If switched to synchronous connect, the * connect is terminated. */ result = TcpConnect(NULL, statePtr); /* * Restore event service mode. */ (void) Tcl_SetServiceMode(oldMode); /* * Check for Successful connect or async connect restart */ if (result == TCL_OK) { /* * Check for async connect restart (not possible for * foreground blocking operation) */ if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { if (errorCodePtr != NULL) { *errorCodePtr = EWOULDBLOCK; } return -1; } return 0; } /* * Connect finally failed. For foreground operation return * ENOTCONN. */ if (errorCodePtr != NULL) { *errorCodePtr = ENOTCONN; } return -1; } /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); /* * Background operation returns with no action as there was no connect * event */ if (errorCodePtr == NULL) { return -1; } /* * A non blocking socket waiting for an asynchronous connect * returns directly the error EWOULDBLOCK */ if (GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) { *errorCodePtr = EWOULDBLOCK; return -1; } /* * Wait until something happens. */ WaitForSingleObject(tsdPtr->readyEvent, INFINITE); } } /* *---------------------------------------------------------------------- * * TcpInputProc -- * * This function is invoked by the generic IO level to read input from a * TCP socket based channel. * * Results: * The number of bytes read is returned or -1 on error. An output * argument contains the POSIX error code on error, or zero if no error * occurred. * * Side effects: * Reads input from the input device of the channel. * *---------------------------------------------------------------------- */ static int TcpInputProc( void *instanceData, /* Socket state. */ char *buf, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCodePtr) /* Where to store error code. */ { TcpState *statePtr = (TcpState *)instanceData; int bytesRead; DWORD error; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); *errorCodePtr = 0; /* * First check to see if EOF was already detected, to prevent calling the * socket stack after the first time EOF is detected. */ if (GOT_BITS(statePtr->flags, SOCKET_EOF)) { return 0; } /* * Check if there is an async connect running. * For blocking sockets terminate connect, otherwise do one step. * For a non blocking socket return EWOULDBLOCK if connect not terminated */ if (WaitForConnect(statePtr, errorCodePtr) != 0) { return -1; } /* * No EOF, and it is connected, so try to read more from the socket. Note * that we clear the FD_READ bit because read events are level triggered * so a new event will be generated if there is still data available to be * read. We have to simulate blocking behavior here since we are always * using non-blocking sockets. */ while (1) { SendSelectMessage(tsdPtr, UNSELECT, statePtr); /* * Single fd operation: this proc is only called for a connected * socket. */ bytesRead = recv(statePtr->sockets->fd, buf, bufSize, 0); CLEAR_BITS(statePtr->readyEvents, FD_READ); /* * Check for end-of-file condition or successful read. */ if (bytesRead == 0) { SET_BITS(statePtr->flags, SOCKET_EOF); } if (bytesRead != SOCKET_ERROR) { break; } /* * If an error occurs after the FD_CLOSE has arrived, then ignore the * error and report an EOF. */ if (GOT_BITS(statePtr->readyEvents, FD_CLOSE)) { SET_BITS(statePtr->flags, SOCKET_EOF); bytesRead = 0; break; } error = WSAGetLastError(); /* * If an RST comes, then ignore the error and report an EOF just like * on Unix. */ if (error == WSAECONNRESET) { SET_BITS(statePtr->flags, SOCKET_EOF); bytesRead = 0; break; } /* * Check for error condition or underflow in non-blocking case. */ if (GOT_BITS(statePtr->flags, TCP_NONBLOCKING) || (error != WSAEWOULDBLOCK)) { Tcl_WinConvertError(error); *errorCodePtr = Tcl_GetErrno(); bytesRead = -1; break; } /* * In the blocking case, wait until the file becomes readable or * closed and try again. */ if (!WaitForSocketEvent(statePtr, FD_READ|FD_CLOSE, errorCodePtr)) { bytesRead = -1; break; } } SendSelectMessage(tsdPtr, SELECT, statePtr); return bytesRead; } /* *---------------------------------------------------------------------- * * TcpOutputProc -- * * This function is called by the generic IO level to write data to a * socket based channel. * * Results: * The number of bytes written or -1 on failure. * * Side effects: * Produces output on the socket. * *---------------------------------------------------------------------- */ static int TcpOutputProc( void *instanceData, /* Socket state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { TcpState *statePtr = (TcpState *)instanceData; int written; DWORD error; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); *errorCodePtr = 0; /* * Check if there is an async connect running. * For blocking sockets terminate connect, otherwise do one step. * For a non blocking socket return EWOULDBLOCK if connect not terminated */ if (WaitForConnect(statePtr, errorCodePtr) != 0) { return -1; } while (1) { SendSelectMessage(tsdPtr, UNSELECT, statePtr); /* * Single fd operation: this proc is only called for a connected * socket. */ written = send(statePtr->sockets->fd, buf, toWrite, 0); if (written != SOCKET_ERROR) { /* * Since Windows won't generate a new write event until we hit an * overflow condition, we need to force the event loop to poll * until the condition changes. */ if (GOT_BITS(statePtr->watchEvents, FD_WRITE)) { Tcl_Time blockTime = { 0, 0 }; Tcl_SetMaxBlockTime(&blockTime); } break; } /* * Check for error condition or overflow. In the event of overflow, we * need to clear the FD_WRITE flag so we can detect the next writable * event. Note that Windows only sends a new writable event after a * send fails with WSAEWOULDBLOCK. */ error = WSAGetLastError(); if (error == WSAEWOULDBLOCK) { CLEAR_BITS(statePtr->readyEvents, FD_WRITE); if (GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) { *errorCodePtr = EWOULDBLOCK; written = -1; break; } } else { Tcl_WinConvertError(error); *errorCodePtr = Tcl_GetErrno(); written = -1; break; } /* * In the blocking case, wait until the file becomes writable or * closed and try again. */ if (!WaitForSocketEvent(statePtr, FD_WRITE|FD_CLOSE, errorCodePtr)) { written = -1; break; } } SendSelectMessage(tsdPtr, SELECT, statePtr); return written; } /* *---------------------------------------------------------------------- * * TcpCloseProc -- * * This function is called by the generic IO level to perform channel * type specific cleanup on a socket based channel when the channel is * closed. * * Results: * 0 if successful, the value of errno if failed. * * Side effects: * Closes the socket. * *---------------------------------------------------------------------- */ static int TcpCloseProc( void *instanceData, /* The socket to close. */ TCL_UNUSED(Tcl_Interp *)) { TcpState *statePtr = (TcpState *)instanceData; /* TIP #218 */ int errorCode = 0; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Clean up the OS socket handle. The default Windows setting for a * socket is SO_DONTLINGER, which does a graceful shutdown in the * background. */ while (statePtr->sockets != NULL) { TcpFdList *thisfd = statePtr->sockets; statePtr->sockets = thisfd->next; if (closesocket(thisfd->fd) == SOCKET_ERROR) { Tcl_WinConvertError((DWORD) WSAGetLastError()); errorCode = Tcl_GetErrno(); } Tcl_Free(thisfd); } if (statePtr->addrlist != NULL) { freeaddrinfo(statePtr->addrlist); } if (statePtr->myaddrlist != NULL) { freeaddrinfo(statePtr->myaddrlist); } /* * Clear an eventual tsd info list pointer. * * This may be called, if an async socket connect fails or is closed * between connect and thread action callback. */ if (tsdPtr->pendingTcpState != NULL && tsdPtr->pendingTcpState == statePtr) { /* * Get infoPtr lock, because this concerns the notifier thread. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); tsdPtr->pendingTcpState = NULL; /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); } /* * TIP #218. Removed the code removing the structure from the global * socket list. This is now done by the thread action callbacks, and only * there. This happens before this code is called. We can free without * fear of damaging the list. */ Tcl_Free(statePtr); return errorCode; } /* *---------------------------------------------------------------------- * * TcpClose2Proc -- * * This function is called by the generic IO level to perform the channel * type specific part of a half-close: namely, a shutdown() on a socket. * * Results: * 0 if successful, the value of errno if failed. * * Side effects: * Shuts down one side of the socket. * *---------------------------------------------------------------------- */ static int TcpClose2Proc( void *instanceData, /* The socket to close. */ Tcl_Interp *interp, /* For error reporting. */ int flags) /* Flags that indicate which side to close. */ { TcpState *statePtr = (TcpState *)instanceData; int readError = 0; int writeError = 0; /* * Shutdown the OS socket handle. */ if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) == 0) { return TcpCloseProc(instanceData, interp); } /* * Single fd operation: Tcl_OpenTcpServer() does not set TCL_READABLE or * TCL_WRITABLE so this should never be called for a server socket. */ if ((flags & TCL_CLOSE_READ) && (shutdown(statePtr->sockets->fd, SD_RECEIVE) == SOCKET_ERROR)) { Tcl_WinConvertError((DWORD) WSAGetLastError()); readError = Tcl_GetErrno(); } if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->sockets->fd, SD_SEND) == SOCKET_ERROR)) { Tcl_WinConvertError((DWORD) WSAGetLastError()); writeError = Tcl_GetErrno(); } return (readError != 0) ? readError : writeError; } /* *---------------------------------------------------------------------- * * TcpSetOptionProc -- * * Sets Tcp channel specific options. * * Results: * None, unless an error happens. * * Side effects: * Changes attributes of the socket at the system level. * *---------------------------------------------------------------------- */ static int TcpSetOptionProc( void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { TcpState *statePtr = (TcpState *)instanceData; SOCKET sock; size_t len = 0; if (optionName != NULL) { len = strlen(optionName); } sock = statePtr->sockets->fd; if ((len > 1) && (optionName[1] == 'k') && (strncmp(optionName, "-keepalive", len) == 0)) { BOOL boolVar; int rtn; if (Tcl_GetBoolean(interp, value, &boolVar) != TCL_OK) { return TCL_ERROR; } rtn = setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (const char *) &boolVar, sizeof(boolVar)); if (rtn != 0) { Tcl_WinConvertError(WSAGetLastError()); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't set socket option: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } if ((len > 1) && (optionName[1] == 'n') && (strncmp(optionName, "-nodelay", len) == 0)) { BOOL boolVar; int rtn; if (Tcl_GetBoolean(interp, value, &boolVar) != TCL_OK) { return TCL_ERROR; } rtn = setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *) &boolVar, sizeof(boolVar)); if (rtn != 0) { Tcl_WinConvertError(WSAGetLastError()); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't set socket option: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "keepalive nodelay"); } /* *---------------------------------------------------------------------- * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of * all options and their values. * * Note: This code is based on code contributed by John Haxby. * * Results: * A standard Tcl result. The value of the specified option or a list of * all options and their values is returned in the supplied DString. Sets * Error message if needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TcpGetOptionProc( void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to retrieve the value * for, or NULL to get all options and their * values. */ Tcl_DString *dsPtr) /* Where to store the computed value; * initialized by caller. */ { TcpState *statePtr = (TcpState *)instanceData; char host[NI_MAXHOST], port[NI_MAXSERV]; SOCKET sock; size_t len = 0; int reverseDNS = 0; #define SUPPRESS_RDNS_VAR "::tcl::unsupported::noReverseDNS" #define HAVE_OPTION(option) \ ((len > 1) && (optionName[1] == option[1]) && \ (strncmp(optionName, option, len) == 0)) /* * Go one step in async connect * * If any error is thrown save it as background error to report eventually * below. */ if (!GOT_BITS(statePtr->flags, TCP_ASYNC_TEST_MODE)) { WaitForConnect(statePtr, NULL); } sock = statePtr->sockets->fd; if (optionName != NULL) { len = strlen(optionName); } if (HAVE_OPTION("-error")) { /* * Do not return any errors if async connect is running. */ if (!GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { if (GOT_BITS(statePtr->flags, TCP_ASYNC_FAILED)) { /* * In case of a failed async connect, eventually report the * connect error only once. Do not report the system error, * as this comes again and again. */ if (statePtr->connectError != 0) { Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(statePtr->connectError), TCL_INDEX_NONE); statePtr->connectError = 0; } } else { /* * Report an eventual last error of the socket system. */ int optlen; int ret; DWORD err; /* * Populate the err variable with a POSIX error */ optlen = sizeof(int); ret = getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&err, &optlen); /* * The error was not returned directly but should be taken * from WSA. */ if (ret == SOCKET_ERROR) { err = WSAGetLastError(); } /* * Return error message. */ if (err) { Tcl_WinConvertError(err); Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(Tcl_GetErrno()), TCL_INDEX_NONE); } } } return TCL_OK; } if (HAVE_OPTION("-connecting")) { Tcl_DStringAppend(dsPtr, GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING) ? "1" : "0", TCL_INDEX_NONE); return TCL_OK; } if (interp != NULL && Tcl_GetVar(interp, SUPPRESS_RDNS_VAR, 0) != NULL) { reverseDNS = NI_NUMERICHOST; } if ((len == 0) || HAVE_OPTION("-peername")) { address peername; socklen_t size = sizeof(peername); if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { /* * In async connect output an empty string */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-peername"); Tcl_DStringAppendElement(dsPtr, ""); } else { return TCL_OK; } } else if (getpeername(sock, (LPSOCKADDR) &(peername.sa), &size) == 0) { /* * Peername fetch succeeded - output list */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-peername"); Tcl_DStringStartSublist(dsPtr); } getnameinfo(&(peername.sa), size, host, sizeof(host), NULL, 0, NI_NUMERICHOST); Tcl_DStringAppendElement(dsPtr, host); getnameinfo(&(peername.sa), size, host, sizeof(host), port, sizeof(port), reverseDNS | NI_NUMERICSERV); Tcl_DStringAppendElement(dsPtr, host); Tcl_DStringAppendElement(dsPtr, port); if (len == 0) { Tcl_DStringEndSublist(dsPtr); } else { return TCL_OK; } } else { /* * getpeername failed - but if we were asked for all the options * (len==0), don't flag an error at that point because it could be * an fconfigure request on a server socket (such sockets have no * peer). {Copied from unix/tclUnixChan.c} */ if (len) { Tcl_WinConvertError((DWORD) WSAGetLastError()); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get peername: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } } } if ((len == 0) || HAVE_OPTION("-sockname")) { TcpFdList *fds; address sockname; socklen_t size; int found = 0; if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-sockname"); Tcl_DStringStartSublist(dsPtr); } if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { /* * In async connect output an empty string */ found = 1; } else { for (fds = statePtr->sockets; fds != NULL; fds = fds->next) { sock = fds->fd; size = sizeof(sockname); if (getsockname(sock, &(sockname.sa), &size) >= 0) { int flags = reverseDNS; found = 1; getnameinfo(&sockname.sa, size, host, sizeof(host), NULL, 0, NI_NUMERICHOST); Tcl_DStringAppendElement(dsPtr, host); /* * We don't want to resolve INADDR_ANY and sin6addr_any; * they can sometimes cause problems (and never have a * name). */ flags |= NI_NUMERICSERV; if (sockname.sa.sa_family == AF_INET) { if (sockname.sa4.sin_addr.s_addr == INADDR_ANY) { flags |= NI_NUMERICHOST; } } else if (sockname.sa.sa_family == AF_INET6) { if ((IN6_ARE_ADDR_EQUAL(&sockname.sa6.sin6_addr, &in6addr_any)) || (IN6_IS_ADDR_V4MAPPED(&sockname.sa6.sin6_addr) && sockname.sa6.sin6_addr.s6_addr[12] == 0 && sockname.sa6.sin6_addr.s6_addr[13] == 0 && sockname.sa6.sin6_addr.s6_addr[14] == 0 && sockname.sa6.sin6_addr.s6_addr[15] == 0)) { flags |= NI_NUMERICHOST; } } getnameinfo(&sockname.sa, size, host, sizeof(host), port, sizeof(port), flags); Tcl_DStringAppendElement(dsPtr, host); Tcl_DStringAppendElement(dsPtr, port); } } } if (found) { if (len) { return TCL_OK; } Tcl_DStringEndSublist(dsPtr); } else { if (interp) { Tcl_WinConvertError((DWORD) WSAGetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get sockname: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } } if ((len == 0) || HAVE_OPTION("-keepalive")) { int optlen; BOOL opt = FALSE; if (len == 0) { sock = statePtr->sockets->fd; Tcl_DStringAppendElement(dsPtr, "-keepalive"); } optlen = sizeof(BOOL); getsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&opt, &optlen); Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0"); if (len > 0) { return TCL_OK; } } if ((len == 0) || HAVE_OPTION("-nodelay")) { int optlen; BOOL opt = FALSE; if (len == 0) { sock = statePtr->sockets->fd; Tcl_DStringAppendElement(dsPtr, "-nodelay"); } optlen = sizeof(BOOL); getsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&opt, &optlen); Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0"); if (len > 0) { return TCL_OK; } } if (len > 0) { return Tcl_BadChannelOption(interp, optionName, "connecting keepalive nodelay peername sockname"); } return TCL_OK; } /* *---------------------------------------------------------------------- * * TcpWatchProc -- * * Informs the channel driver of the events that the generic channel code * wishes to receive on this socket. * * Results: * None. * * Side effects: * May cause the notifier to poll if any of the specified conditions are * already true. * *---------------------------------------------------------------------- */ static void TcpWatchProc( void *instanceData, /* The socket state. */ int mask) /* Events of interest; an OR-ed combination of * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { TcpState *statePtr = (TcpState *)instanceData; /* * Update the watch events mask. Only if the socket is not a server * socket. [Bug 557878] */ if (!statePtr->acceptProc) { statePtr->watchEvents = 0; if (GOT_BITS(mask, TCL_READABLE)) { SET_BITS(statePtr->watchEvents, FD_READ | FD_CLOSE); } if (GOT_BITS(mask, TCL_WRITABLE)) { SET_BITS(statePtr->watchEvents, FD_WRITE | FD_CLOSE); } /* * If there are any conditions already set, then tell the notifier to * poll rather than block. */ if (statePtr->readyEvents & statePtr->watchEvents) { Tcl_Time blockTime = { 0, 0 }; Tcl_SetMaxBlockTime(&blockTime); } } } /* *---------------------------------------------------------------------- * * TcpGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * TCP socket based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TcpGetHandleProc( void *instanceData, /* The socket state. */ TCL_UNUSED(int) /*direction*/, void **handlePtr) /* Where to store the handle. */ { TcpState *statePtr = (TcpState *)instanceData; *handlePtr = INT2PTR(statePtr->sockets->fd); return TCL_OK; } /* *---------------------------------------------------------------------- * * TcpConnect -- * * This function opens a new socket in client mode. * * This might be called in 3 circumstances: * - By a regular socket command * - By the event handler to continue an asynchronously connect * - By a blocking socket function (gets/puts) to terminate the * connect synchronously * * Results: * TCL_OK, if the socket was successfully connected or an asynchronous * connection is in progress. If an error occurs, TCL_ERROR is returned * and an error message is left in interp. * * Side effects: * Opens a socket. * * Remarks: * A single host name may resolve to more than one IP address, e.g. for * an IPv4/IPv6 dual stack host. For handling asynchronously connecting * sockets in the background for such hosts, this function can act as a * coroutine. On the first call, it sets up the control variables for the * two nested loops over the local and remote addresses. Once the first * connection attempt is in progress, it sets up itself as a writable * event handler for that socket, and returns. When the callback occurs, * control is transferred to the "reenter" label, right after the initial * return and the loops resume as if they had never been interrupted. * For synchronously connecting sockets, the loops work the usual way. * *---------------------------------------------------------------------- */ static int TcpConnect( Tcl_Interp *interp, /* For error reporting; can be NULL. */ TcpState *statePtr) { DWORD error; int async_connect = GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT); /* We are started with async connect and the * connect notification was not yet * received. */ int async_callback = GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING); /* We were called by the event procedure and * continue our loop. */ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); if (async_callback) { goto reenter; } for (statePtr->addr = statePtr->addrlist; statePtr->addr != NULL; statePtr->addr = statePtr->addr->ai_next) { for (statePtr->myaddr = statePtr->myaddrlist; statePtr->myaddr != NULL; statePtr->myaddr = statePtr->myaddr->ai_next) { /* * No need to try combinations of local and remote addresses * of different families. */ if (statePtr->myaddr->ai_family != statePtr->addr->ai_family) { continue; } /* * Close the socket if it is still open from the last unsuccessful * iteration. */ if (statePtr->sockets->fd != INVALID_SOCKET) { closesocket(statePtr->sockets->fd); } /* * Get statePtr lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Reset last error from last try */ statePtr->notifierConnectError = 0; Tcl_SetErrno(0); statePtr->sockets->fd = socket(statePtr->myaddr->ai_family, SOCK_STREAM, 0); /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); /* * Continue on socket creation error. */ if (statePtr->sockets->fd == INVALID_SOCKET) { Tcl_WinConvertError((DWORD) WSAGetLastError()); continue; } /* * Win-NT has a misfeature that sockets are inherited in child * processes by default. Turn off the inherit bit. */ SetHandleInformation((HANDLE) statePtr->sockets->fd, HANDLE_FLAG_INHERIT, 0); /* * Set kernel space buffering */ TclSockMinimumBuffers((void *)statePtr->sockets->fd, TCP_BUFFER_SIZE); /* * Try to bind to a local port. */ if (bind(statePtr->sockets->fd, statePtr->myaddr->ai_addr, statePtr->myaddr->ai_addrlen) == SOCKET_ERROR) { Tcl_WinConvertError((DWORD) WSAGetLastError()); continue; } /* * For asynchronous connect set the socket in nonblocking mode * and activate connect notification */ if (async_connect) { TcpState *statePtr2; int in_socket_list = 0; /* * Get statePtr lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Bugfig for 336441ed59 to not ignore notifications until the * infoPtr is in the list. * Check if my statePtr is already in the tsdPtr->socketList * It is set after this call by TcpThreadActionProc and is set * on a second round. * * If not, we buffer my statePtr in the tsd memory so it is * not lost by the event procedure */ for (statePtr2 = tsdPtr->socketList; statePtr2 != NULL; statePtr2 = statePtr2->nextPtr) { if (statePtr2 == statePtr) { in_socket_list = 1; break; } } if (!in_socket_list) { tsdPtr->pendingTcpState = statePtr; } /* * Set connect mask to connect events * * This is activated by a SOCKET_SELECT message to the * notifier thread. */ SET_BITS(statePtr->selectEvents, FD_CONNECT); /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); /* * Activate accept notification. */ SendSelectMessage(tsdPtr, SELECT, statePtr); } /* * Attempt to connect to the remote socket. */ connect(statePtr->sockets->fd, statePtr->addr->ai_addr, statePtr->addr->ai_addrlen); error = WSAGetLastError(); Tcl_WinConvertError(error); if (async_connect && error == WSAEWOULDBLOCK) { /* * Asynchronous connect * * Remember that we jump back behind this next round */ SET_BITS(statePtr->flags, TCP_ASYNC_PENDING); return TCL_OK; reenter: /* * Re-entry point for async connect after connect event or * blocking operation * * Clear the reenter flag */ CLEAR_BITS(statePtr->flags, TCP_ASYNC_PENDING); /* * Get statePtr lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Get signaled connect error. */ Tcl_WinConvertError((DWORD) statePtr->notifierConnectError); /* * Clear eventual connect flag. */ CLEAR_BITS(statePtr->selectEvents, FD_CONNECT); /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); } /* * Clear the tsd socket list pointer if we did not wait for * the FD_CONNECT asynchronously */ tsdPtr->pendingTcpState = NULL; if (Tcl_GetErrno() == 0) { goto out; } } } out: /* * Socket connected or connection failed */ /* * Async connect terminated */ CLEAR_BITS(statePtr->flags, TCP_ASYNC_CONNECT); if (Tcl_GetErrno() == 0) { /* * Successfully connected * * Set up the select mask for read/write events. */ statePtr->selectEvents = FD_READ | FD_WRITE | FD_CLOSE; /* * Register for interest in events in the select mask. Note that this * automatically places the socket into non-blocking mode. */ SendSelectMessage(tsdPtr, SELECT, statePtr); } else { /* * Connect failed * * For async connect schedule a writable event to report the fail. */ if (async_callback) { /* * Set up the select mask for read/write events. */ statePtr->selectEvents = FD_WRITE|FD_READ; /* * Get statePtr lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Signal ready readable and writable events. */ SET_BITS(statePtr->readyEvents, FD_WRITE | FD_READ); /* * Flag error to event routine. */ SET_BITS(statePtr->flags, TCP_ASYNC_FAILED); /* * Save connect error to be reported by 'fconfigure -error'. */ statePtr->connectError = Tcl_GetErrno(); /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); } /* * Error message on synchronous connect */ if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open socket: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * Tcl_OpenTcpClient -- * * Opens a TCP client socket and creates a channel around it. * * Results: * The channel or NULL if failed. An error message is returned in the * interpreter on failure. * * Side effects: * Opens a client socket and creates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_OpenTcpClient( Tcl_Interp *interp, /* For error reporting; can be NULL. */ int port, /* Port number to open. */ const char *host, /* Host on which to open port. */ const char *myaddr, /* Client-side address */ int myport, /* Client-side port */ int async) /* If nonzero, attempt to do an asynchronous * connect. Otherwise we do a blocking * connect. */ { TcpState *statePtr; const char *errorMsg = NULL; struct addrinfo *addrlist = NULL, *myaddrlist = NULL; char channelName[SOCK_CHAN_LENGTH]; TclInitSockets(); /* * Do the name lookups for the local and remote addresses. */ if (!TclCreateSocketAddress(interp, &addrlist, host, port, 0, &errorMsg) || !TclCreateSocketAddress(interp, &myaddrlist, myaddr, myport, 1, &errorMsg)) { if (addrlist != NULL) { freeaddrinfo(addrlist); } if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open socket: %s", errorMsg)); } return NULL; } statePtr = NewSocketInfo(INVALID_SOCKET); statePtr->addrlist = addrlist; statePtr->myaddrlist = myaddrlist; if (async) { SET_BITS(statePtr->flags, TCP_ASYNC_CONNECT); } /* * Create a new client socket and wrap it in a channel. */ if (TcpConnect(interp, statePtr) != TCL_OK) { TcpCloseProc(statePtr, NULL); return NULL; } TclWinGenerateChannelName(channelName, "sock", statePtr); statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, (TCL_READABLE | TCL_WRITABLE)); if (TCL_ERROR == Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf")) { Tcl_CloseEx(NULL, statePtr->channel, 0); return NULL; } else if (TCL_ERROR == Tcl_SetChannelOption(NULL, statePtr->channel, "-eofchar", "")) { Tcl_CloseEx(NULL, statePtr->channel, 0); return NULL; } return statePtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_MakeTcpClientChannel -- * * Creates a Tcl_Channel from an existing client TCP socket. * * Results: * The Tcl_Channel wrapped around the preexisting TCP socket. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_MakeTcpClientChannel( void *sock) /* The socket to wrap up into a channel. */ { TclInitSockets(); ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); /* * Set kernel space buffering and non-blocking. */ TclSockMinimumBuffers(sock, TCP_BUFFER_SIZE); TcpState *statePtr = NewSocketInfo((SOCKET) sock); /* * Start watching for read/write events on the socket. */ statePtr->selectEvents = FD_READ | FD_CLOSE | FD_WRITE; SendSelectMessage(tsdPtr, SELECT, statePtr); char channelName[SOCK_CHAN_LENGTH]; TclWinGenerateChannelName(channelName, "sock", statePtr); statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, (TCL_READABLE | TCL_WRITABLE)); Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf"); return statePtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_OpenTcpServerEx -- * * Opens a TCP server socket and creates a channel around it. * * Results: * The channel or NULL if failed. If an error occurred, an error message * is left in the interp's result if interp is not NULL. * * Side effects: * Opens a server socket and creates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_OpenTcpServerEx( Tcl_Interp *interp, /* For error reporting - may be NULL. */ const char *service, /* Port number to open. */ const char *myHost, /* Name of local host. */ unsigned int flags, /* Flags. */ int backlog, /* Length of OS listen backlog queue, or -1 * for default. */ Tcl_TcpAcceptProc *acceptProc, /* Callback for accepting connections from new * clients. */ void *acceptProcData) /* Data for the callback. */ { SOCKET sock = INVALID_SOCKET; unsigned short chosenport = 0; struct addrinfo *addrlist = NULL; struct addrinfo *addrPtr; /* Socket address to listen on. */ TcpState *statePtr = NULL; /* The returned value. */ char channelName[SOCK_CHAN_LENGTH]; u_long flag = 1; /* Indicates nonblocking mode. */ const char *errorMsg = NULL; int optvalue, port; TclInitSockets(); /* * Construct the addresses for each end of the socket. */ if (TclSockGetPort(interp, service, "tcp", &port) != TCL_OK) { errorMsg = "invalid port number"; goto error; } if (!TclCreateSocketAddress(interp, &addrlist, myHost, port, 1, &errorMsg)) { goto error; } for (addrPtr = addrlist; addrPtr != NULL; addrPtr = addrPtr->ai_next) { sock = socket(addrPtr->ai_family, addrPtr->ai_socktype, addrPtr->ai_protocol); if (sock == INVALID_SOCKET) { Tcl_WinConvertError((DWORD) WSAGetLastError()); continue; } /* * Win-NT has a misfeature that sockets are inherited in child * processes by default. Turn off the inherit bit. */ SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0); /* * Set kernel space buffering */ TclSockMinimumBuffers((void *)sock, TCP_BUFFER_SIZE); /* * Make sure we use the same port when opening two server sockets * for IPv4 and IPv6. * * As sockaddr_in6 uses the same offset and size for the port * member as sockaddr_in, we can handle both through the IPv4 API. */ if (port == 0 && chosenport != 0) { ((struct sockaddr_in *) addrPtr->ai_addr)->sin_port = htons(chosenport); } /* * The SO_REUSEADDR option on Windows behaves like SO_REUSEPORT on * unix systems. */ if (GOT_BITS(flags, TCL_TCPSERVER_REUSEPORT)) { optvalue = 1; (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &optvalue, sizeof(optvalue)); } /* * Bind to the specified port. * * Bind should not be affected by the socket having already been * set into nonblocking mode. If there is trouble, this is one * place to look for bugs. */ if (bind(sock, addrPtr->ai_addr, addrPtr->ai_addrlen) == SOCKET_ERROR) { Tcl_WinConvertError((DWORD) WSAGetLastError()); closesocket(sock); sock = INVALID_SOCKET; /* Bug [40b1814b93] */ continue; } if (port == 0 && chosenport == 0) { address sockname; socklen_t namelen = sizeof(sockname); /* * Synchronize port numbers when binding to port 0 of multiple * addresses. */ if (getsockname(sock, &sockname.sa, &namelen) >= 0) { chosenport = ntohs(sockname.sa4.sin_port); } } /* * Set the maximum number of pending connect requests to the max * value allowed on each platform (Win32 and Win32s may be * different, and there may be differences between TCP/IP stacks). */ if (backlog < 0) { backlog = SOMAXCONN; } if (listen(sock, backlog) == SOCKET_ERROR) { Tcl_WinConvertError((DWORD) WSAGetLastError()); closesocket(sock); sock = INVALID_SOCKET; /* Bug [40b1814b93] */ continue; } if (statePtr == NULL) { /* * Add this socket to the global list of sockets. */ statePtr = NewSocketInfo(sock); } else { AddSocketInfoFd(statePtr, sock); } } error: if (addrlist != NULL) { freeaddrinfo(addrlist); } if (statePtr != NULL) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); statePtr->acceptProc = acceptProc; statePtr->acceptProcData = acceptProcData; TclWinGenerateChannelName(channelName, "sock", statePtr); statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, 0); /* * Set up the select mask for connection request events. */ statePtr->selectEvents = FD_ACCEPT; /* * Register for interest in events in the select mask. Note that this * automatically places the socket into non-blocking mode. */ ioctlsocket(sock, (long) FIONBIO, &flag); SendSelectMessage(tsdPtr, SELECT, statePtr); if (Tcl_SetChannelOption(interp, statePtr->channel, "-eofchar", "") == TCL_ERROR) { Tcl_CloseEx(NULL, statePtr->channel, 0); return NULL; } return statePtr->channel; } if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open socket: %s", (errorMsg ? errorMsg : Tcl_PosixError(interp)))); } if (sock != INVALID_SOCKET) { closesocket(sock); } return NULL; } /* *---------------------------------------------------------------------- * * TcpAccept -- * Accept a TCP socket connection. This is called by the event loop. * * Results: * None. * * Side effects: * Creates a new connection socket. Calls the registered callback for the * connection acceptance mechanism. * *---------------------------------------------------------------------- */ static void TcpAccept( TcpFdList *fds, /* Server socket that accepted newSocket. */ SOCKET newSocket, /* Newly accepted socket. */ address addr) /* Address of new socket. */ { TcpState *newInfoPtr; TcpState *statePtr = fds->statePtr; int len = sizeof(addr); char channelName[SOCK_CHAN_LENGTH]; char host[NI_MAXHOST], port[NI_MAXSERV]; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); /* * Win-NT has a misfeature that sockets are inherited in child processes * by default. Turn off the inherit bit. */ SetHandleInformation((HANDLE) newSocket, HANDLE_FLAG_INHERIT, 0); /* * Add this socket to the global list of sockets. */ newInfoPtr = NewSocketInfo(newSocket); /* * Select on read/write events and create the channel. */ newInfoPtr->selectEvents = (FD_READ | FD_WRITE | FD_CLOSE); SendSelectMessage(tsdPtr, SELECT, newInfoPtr); TclWinGenerateChannelName(channelName, "sock", newInfoPtr); newInfoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, newInfoPtr, (TCL_READABLE | TCL_WRITABLE)); if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-translation", "auto crlf") == TCL_ERROR) { Tcl_CloseEx(NULL, newInfoPtr->channel, 0); return; } if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-eofchar", "") == TCL_ERROR) { Tcl_CloseEx(NULL, newInfoPtr->channel, 0); return; } /* * Invoke the accept callback function. */ if (statePtr->acceptProc != NULL) { getnameinfo(&(addr.sa), len, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST|NI_NUMERICSERV); statePtr->acceptProc(statePtr->acceptProcData, newInfoPtr->channel, host, atoi(port)); } } /* *---------------------------------------------------------------------- * * InitSocketWindowClass -- * * Registers the event window class for the socket notifier code. * Caller must not hold socket mutex lock. * * Results: * None. * * Side effects: * Register a new window class. * *---------------------------------------------------------------------- */ static void InitSocketWindowClass(void) { if (initialized) { return; } Tcl_MutexLock(&socketMutex); if (!initialized) { initialized = 1; TclCreateLateExitHandler(SocketExitHandler, NULL); /* * Create the async notification window with a new class. We must * create a new class to avoid a Windows 95 bug that causes us to get * the wrong message number for socket events if the message window is * a subclass of a static control. */ windowClass.style = 0; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = (HINSTANCE)TclWinGetTclInstance(); windowClass.hbrBackground = NULL; windowClass.lpszMenuName = NULL; windowClass.lpszClassName = className; windowClass.lpfnWndProc = SocketProc; windowClass.hIcon = NULL; windowClass.hCursor = NULL; if (!RegisterClassW(&windowClass)) { Tcl_WinConvertError(GetLastError()); goto initFailure; } } Tcl_MutexUnlock(&socketMutex); return; initFailure: Tcl_MutexUnlock(&socketMutex); /* Probably pointless before panicing */ Tcl_Panic("InitSockets failed"); } /* *---------------------------------------------------------------------- * * SocketExitHandler -- * * Callback invoked during exit clean up to delete the socket * communication window. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void SocketExitHandler( TCL_UNUSED(void *)) { Tcl_MutexLock(&socketMutex); /* * Make sure the socket event handling window is cleaned-up for, at * most, this thread. */ TclpFinalizeSockets(); UnregisterClassW(className, (HINSTANCE)TclWinGetTclInstance()); initialized = 0; Tcl_MutexUnlock(&socketMutex); } /* *---------------------------------------------------------------------- * * SocketSetupProc -- * * This function is invoked before Tcl_DoOneEvent blocks waiting for an * event. * * Results: * None. * * Side effects: * Adjusts the block time if needed. * *---------------------------------------------------------------------- */ void SocketSetupProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { TcpState *statePtr; Tcl_Time blockTime = { 0, 0 }; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!GOT_BITS(flags, TCL_FILE_EVENTS)) { return; } /* * Check to see if there is a ready socket. If so, poll. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (statePtr = tsdPtr->socketList; statePtr != NULL; statePtr = statePtr->nextPtr) { if (GOT_BITS(statePtr->readyEvents, statePtr->watchEvents | FD_CONNECT | FD_ACCEPT)) { Tcl_SetMaxBlockTime(&blockTime); break; } } SetEvent(tsdPtr->socketListLock); } /* *---------------------------------------------------------------------- * * SocketCheckProc -- * * This function is called by Tcl_DoOneEvent to check the socket event * source for events. * * Results: * None. * * Side effects: * May queue an event. * *---------------------------------------------------------------------- */ static void SocketCheckProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { TcpState *statePtr; SocketEvent *evPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!GOT_BITS(flags, TCL_FILE_EVENTS)) { return; } /* * Queue events for any ready sockets that don't already have events * queued (caused by persistent states that won't generate WinSock * events). */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (statePtr = tsdPtr->socketList; statePtr != NULL; statePtr = statePtr->nextPtr) { if (GOT_BITS(statePtr->readyEvents, statePtr->watchEvents | FD_CONNECT | FD_ACCEPT) && !GOT_BITS(statePtr->flags, SOCKET_PENDING)) { SET_BITS(statePtr->flags, SOCKET_PENDING); evPtr = (SocketEvent *)Tcl_Alloc(sizeof(SocketEvent)); evPtr->header.proc = SocketEventProc; evPtr->socket = statePtr->sockets->fd; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); } } SetEvent(tsdPtr->socketListLock); } /* *---------------------------------------------------------------------- * * SocketEventProc -- * * This function is called by Tcl_ServiceEvent when a socket event * reaches the front of the event queue. This function is responsible for * notifying the generic channel code. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the channel callback functions do. * *---------------------------------------------------------------------- */ static int SocketEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { TcpState *statePtr; SocketEvent *eventPtr = (SocketEvent *) evPtr; int mask = 0, events; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); TcpFdList *fds; SOCKET newSocket; address addr; int len; if (!GOT_BITS(flags, TCL_FILE_EVENTS)) { return 0; } /* * Find the specified socket on the socket list. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (statePtr = tsdPtr->socketList; statePtr != NULL; statePtr = statePtr->nextPtr) { if (statePtr->sockets->fd == eventPtr->socket) { break; } } /* * Discard events that have gone stale. */ if (!statePtr) { SetEvent(tsdPtr->socketListLock); return 1; } /* * Clear flag that (this) event is pending */ CLEAR_BITS(statePtr->flags, SOCKET_PENDING); /* * Continue async connect if pending and ready */ if (GOT_BITS(statePtr->readyEvents, FD_CONNECT)) { if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { /* * Do one step and save eventual connect error */ SetEvent(tsdPtr->socketListLock); WaitForConnect(statePtr,NULL); } else { /* * No async connect reenter pending. Just clear event. */ CLEAR_BITS(statePtr->readyEvents, FD_CONNECT); SetEvent(tsdPtr->socketListLock); } return 1; } /* * Handle connection requests directly. */ if (GOT_BITS(statePtr->readyEvents, FD_ACCEPT)) { for (fds = statePtr->sockets; fds != NULL; fds = fds->next) { /* * Accept the incoming connection request. */ len = sizeof(address); newSocket = accept(fds->fd, &(addr.sa), &len); /* * On Tcl server sockets with multiple OS fds we loop over the fds * trying an accept() on each, so we expect INVALID_SOCKET. There * are also other network stack conditions that can result in * FD_ACCEPT but a subsequent failure on accept() by the time we * get around to it. * * Access to sockets (acceptEventCount, readyEvents) in socketList * is still protected by the lock (prevents reintroduction of * SF Tcl Bug 3056775. */ if (newSocket == INVALID_SOCKET) { /* int err = WSAGetLastError(); */ continue; } /* * It is possible that more than one FD_ACCEPT has been sent, so * an extra count must be kept. Decrement the count, and reset the * readyEvent bit if the count is no longer > 0. */ statePtr->acceptEventCount--; if (statePtr->acceptEventCount <= 0) { CLEAR_BITS(statePtr->readyEvents, FD_ACCEPT); } SetEvent(tsdPtr->socketListLock); /* * Caution: TcpAccept() has the side-effect of evaluating the * server accept script (via AcceptCallbackProc() in tclIOCmd.c), * which can close the server socket and invalidate statePtr and * fds. If TcpAccept() accepts a socket we must return immediately * and let SocketCheckProc queue additional FD_ACCEPT events. */ TcpAccept(fds, newSocket, addr); return 1; } /* * Loop terminated with no sockets accepted; clear the ready mask so * we can detect the next connection request. Note that connection * requests are level triggered, so if there is a request already * pending, a new event will be generated. */ statePtr->acceptEventCount = 0; CLEAR_BITS(statePtr->readyEvents, FD_ACCEPT); SetEvent(tsdPtr->socketListLock); return 1; } SetEvent(tsdPtr->socketListLock); /* * Mask off unwanted events and compute the read/write mask so we can * notify the channel. */ events = statePtr->readyEvents & statePtr->watchEvents; if (GOT_BITS(events, FD_CLOSE)) { /* * If the socket was closed and the channel is still interested in * read events, then we need to ensure that we keep polling for this * event until someone does something with the channel. Note that we * do this before calling Tcl_NotifyChannel so we don't have to watch * out for the channel being deleted out from under us. This may cause * a redundant trip through the event loop, but it's simpler than * trying to do unwind protection. */ Tcl_Time blockTime = { 0, 0 }; Tcl_SetMaxBlockTime(&blockTime); SET_BITS(mask, TCL_READABLE | TCL_WRITABLE); } else if (GOT_BITS(events, FD_READ)) { /* * Throw the readable event if an async connect failed. */ if (GOT_BITS(statePtr->flags, TCP_ASYNC_FAILED)) { SET_BITS(mask, TCL_READABLE); } else { fd_set readFds; struct timeval timeout; /* * We must check to see if data is really available, since someone * could have consumed the data in the meantime. Turn off async * notification so select will work correctly. If the socket is * still readable, notify the channel driver, otherwise reset the * async select handler and keep waiting. */ SendSelectMessage(tsdPtr, UNSELECT, statePtr); FD_ZERO(&readFds); FD_SET(statePtr->sockets->fd, &readFds); timeout.tv_usec = 0; timeout.tv_sec = 0; if (select(0, &readFds, NULL, NULL, &timeout) != 0) { SET_BITS(mask, TCL_READABLE); } else { CLEAR_BITS(statePtr->readyEvents, FD_READ); SendSelectMessage(tsdPtr, SELECT, statePtr); } } } /* * writable event */ if (GOT_BITS(events, FD_WRITE)) { SET_BITS(mask, TCL_WRITABLE); } /* * Call registered event procedures */ if (mask) { Tcl_NotifyChannel(statePtr->channel, mask); } return 1; } /* *---------------------------------------------------------------------- * * AddSocketInfoFd -- * * This function adds a SOCKET file descriptor to the 'sockets' linked * list of a TcpState structure. * * Results: * None. * * Side effects: * None, except for allocation of memory. * *---------------------------------------------------------------------- */ static void AddSocketInfoFd( TcpState *statePtr, SOCKET socket) { TcpFdList *fds = statePtr->sockets; if (fds == NULL) { /* * Add the first FD. */ statePtr->sockets = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList)); fds = statePtr->sockets; } else { /* * Find end of list and append FD. */ while (fds->next != NULL) { fds = fds->next; } fds->next = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList)); fds = fds->next; } /* * Populate new FD. */ fds->fd = socket; fds->statePtr = statePtr; fds->next = NULL; } /* *---------------------------------------------------------------------- * * NewSocketInfo -- * * This function allocates and initializes a new TcpState structure. * * Results: * Returns a newly allocated TcpState. * * Side effects: * None, except for allocation of memory. * *---------------------------------------------------------------------- */ static TcpState * NewSocketInfo( SOCKET socket) { TcpState *statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState)); memset(statePtr, 0, sizeof(TcpState)); /* * TIP #218. Removed the code inserting the new structure into the global * list. This is now handled in the thread action callbacks, and only * there. */ AddSocketInfoFd(statePtr, socket); return statePtr; } /* *---------------------------------------------------------------------- * * WaitForSocketEvent -- * * Waits until one of the specified events occurs on a socket. * For event FD_CONNECT use WaitForConnect. * * Results: * Returns 1 on success or 0 on failure, with an error code in * errorCodePtr. * * Side effects: * Processes socket events off the system queue. * *---------------------------------------------------------------------- */ static int WaitForSocketEvent( TcpState *statePtr, /* Information about this socket. */ int events, /* Events to look for. May be one of * FD_READ or FD_WRITE. */ int *errorCodePtr) /* Where to store errors? */ { int result = 1; int oldMode; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); /* * Be sure to disable event servicing so we are truly modal. */ oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); /* * Reset WSAAsyncSelect so we have a fresh set of events pending. */ SendSelectMessage(tsdPtr, UNSELECT, statePtr); SendSelectMessage(tsdPtr, SELECT, statePtr); while (1) { int event_found; /* * Get statePtr lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Check if event occurred. */ event_found = GOT_BITS(statePtr->readyEvents, events); /* * Free list lock. */ SetEvent(tsdPtr->socketListLock); /* * Exit loop if event occurred. */ if (event_found) { break; } /* * Exit loop if event did not occur but this is a non-blocking channel */ if (statePtr->flags & TCP_NONBLOCKING) { *errorCodePtr = EWOULDBLOCK; result = 0; break; } /* * Wait until something happens. */ WaitForSingleObject(tsdPtr->readyEvent, INFINITE); } (void) Tcl_SetServiceMode(oldMode); return result; } /* *---------------------------------------------------------------------- * * SocketThread -- * * Helper thread used to manage the socket event handling window. * * Results: * 1 if unable to create socket event window, 0 otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static DWORD WINAPI SocketThread( LPVOID arg) { MSG msg; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)arg; /* * Create a dummy window receiving socket events. */ tsdPtr->hwnd = CreateWindowW(className, className, WS_TILED, 0, 0, 0, 0, NULL, NULL, windowClass.hInstance, arg); /* * Signalize thread creator that we are done creating the window. */ SetEvent(tsdPtr->readyEvent); /* * If unable to create the window, exit this thread immediately. */ if (tsdPtr->hwnd == NULL) { return 1; } /* * Process all messages on the socket window until WM_QUIT. This threads * exits only when instructed to do so by the call to * PostMessageW(SOCKET_TERMINATE) in TclpFinalizeSockets(). */ while (GetMessageW(&msg, NULL, 0, 0) > 0) { DispatchMessageW(&msg); } /* * This releases waiters on thread exit in TclpFinalizeSockets() */ SetEvent(tsdPtr->readyEvent); return msg.wParam; } /* *---------------------------------------------------------------------- * * SocketProc -- * * This function is called when WSAAsyncSelect has been used to register * interest in a socket event, and the event has occurred. * * Results: * 0 on success. * * Side effects: * The flags for the given socket are updated to reflect the event that * occurred. * *---------------------------------------------------------------------- */ static LRESULT CALLBACK SocketProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { int event, error; SOCKET socket; TcpState *statePtr; int info_found = 0; TcpFdList *fds = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) #ifdef _WIN64 GetWindowLongPtrW(hwnd, GWLP_USERDATA); #else GetWindowLongW(hwnd, GWL_USERDATA); #endif switch (message) { default: return DefWindowProcW(hwnd, message, wParam, lParam); break; case WM_CREATE: /* * Store the initial tsdPtr, it's from a different thread, so it's not * directly accessible, but needed. */ #ifdef _WIN64 SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) ((LPCREATESTRUCT)lParam)->lpCreateParams); #else SetWindowLongW(hwnd, GWL_USERDATA, (LONG) ((LPCREATESTRUCT)lParam)->lpCreateParams); #endif break; case WM_DESTROY: PostQuitMessage(0); break; case SOCKET_MESSAGE: event = WSAGETSELECTEVENT(lParam); error = WSAGETSELECTERROR(lParam); socket = (SOCKET) wParam; WaitForSingleObject(tsdPtr->socketListLock, INFINITE); /* * Find the specified socket on the socket list and update its * eventState flag. */ for (statePtr = tsdPtr->socketList; statePtr != NULL; statePtr = statePtr->nextPtr) { if (FindFDInList(statePtr, socket)) { info_found = 1; break; } } /* * Check if there is a pending info structure not jet in the list. */ if (!info_found && tsdPtr->pendingTcpState != NULL && FindFDInList(tsdPtr->pendingTcpState, socket)) { statePtr = tsdPtr->pendingTcpState; info_found = 1; } if (info_found) { /* * Update the socket state. * * A count of FD_ACCEPTS is stored, so if an FD_CLOSE event * happens, then clear the FD_ACCEPT count. Otherwise, increment * the count if the current event is an FD_ACCEPT. */ if (GOT_BITS(event, FD_CLOSE)) { statePtr->acceptEventCount = 0; CLEAR_BITS(statePtr->readyEvents, FD_WRITE | FD_ACCEPT); } else if (GOT_BITS(event, FD_ACCEPT)) { statePtr->acceptEventCount++; } if (GOT_BITS(event, FD_CONNECT)) { /* * Remember any error that occurred so we can report * connection failures. */ if (error != ERROR_SUCCESS) { statePtr->notifierConnectError = error; } } /* * Inform main thread about signaled events */ SET_BITS(statePtr->readyEvents, event); /* * Wake up the Main Thread. */ SetEvent(tsdPtr->readyEvent); Tcl_ThreadAlert(tsdPtr->threadId); } SetEvent(tsdPtr->socketListLock); break; case SOCKET_SELECT: statePtr = (TcpState *) lParam; for (fds = statePtr->sockets; fds != NULL; fds = fds->next) { if (wParam == SELECT) { WSAAsyncSelect(fds->fd, hwnd, SOCKET_MESSAGE, statePtr->selectEvents); } else { /* * Clear the selection mask */ WSAAsyncSelect(fds->fd, hwnd, 0, 0); } } break; case SOCKET_TERMINATE: DestroyWindow(hwnd); break; } return 0; } /* *---------------------------------------------------------------------- * * FindFDInList -- * * Return true, if the given file descriptor is contained in the * file descriptor list. * * Results: * true if found. * * Side effects: * *---------------------------------------------------------------------- */ static int FindFDInList( TcpState *statePtr, SOCKET socket) { TcpFdList *fds; for (fds = statePtr->sockets; fds != NULL; fds = fds->next) { if (fds->fd == socket) { return 1; } } return 0; } /* *---------------------------------------------------------------------- * * TcpThreadActionProc -- * * Insert or remove any thread local refs to this channel. * * Results: * None. * * Side effects: * Changes thread local list of valid channels. * *---------------------------------------------------------------------- */ static void TcpThreadActionProc( void *instanceData, int action) { ThreadSpecificData *tsdPtr; TcpState *statePtr = (TcpState *)instanceData; int notifyCmd; if (action == TCL_CHANNEL_THREAD_INSERT) { /* * Ensure that socket subsystem is initialized in this thread, or else * sockets will not work. */ TclInitSockets(); tsdPtr = TCL_TSD_INIT(&dataKey); WaitForSingleObject(tsdPtr->socketListLock, INFINITE); statePtr->nextPtr = tsdPtr->socketList; tsdPtr->socketList = statePtr; if (statePtr == tsdPtr->pendingTcpState) { tsdPtr->pendingTcpState = NULL; } SetEvent(tsdPtr->socketListLock); notifyCmd = SELECT; } else { TcpState **nextPtrPtr; int removed = 0; tsdPtr = TCL_TSD_INIT(&dataKey); /* * TIP #218, Bugfix: All access to socketList has to be protected by * the lock. */ WaitForSingleObject(tsdPtr->socketListLock, INFINITE); for (nextPtrPtr = &(tsdPtr->socketList); (*nextPtrPtr) != NULL; nextPtrPtr = &((*nextPtrPtr)->nextPtr)) { if ((*nextPtrPtr) == statePtr) { (*nextPtrPtr) = statePtr->nextPtr; removed = 1; break; } } SetEvent(tsdPtr->socketListLock); /* * This could happen if the channel was created in one thread and then * moved to another without updating the thread local data in each * thread. */ if (!removed) { Tcl_Panic("file info ptr not on thread channel list"); } notifyCmd = UNSELECT; } /* * Ensure that, or stop, notifications for the socket occur in this * thread. */ SendSelectMessage(tsdPtr, notifyCmd, statePtr); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * indent-tabs-mode: nil * End: */ tcl9.0.3/win/tclWinSerial.c0000644000175000017500000016523215104661342015122 0ustar sergeisergei/* * tclWinSerial.c -- * * This file implements the Windows-specific serial port functions, and * the "serial" channel driver. * * Copyright © 1999 Scriptics Corp. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * Serial functionality implemented by Rolf.Schroedter@dlr.de */ #include "tclWinInt.h" #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * The following variable is used to tell whether this module has been * initialized. */ static int initialized = 0; /* * The serialMutex locks around access to the initialized variable, and it is * used to protect background threads from being terminated while they are * using APIs that hold locks. */ TCL_DECLARE_MUTEX(serialMutex) /* * Bit masks used in the flags field of the SerialInfo structure below. */ enum SerialFlags { SERIAL_PENDING = 1 << 0, /* Message is pending in the queue. */ SERIAL_ASYNC = 1 << 1, /* Channel is non-blocking. */ /* * Bit masks used in the sharedFlags field of the SerialInfo structure * below. */ SERIAL_EOF = 1 << 2, /* Serial has reached EOF. */ SERIAL_ERROR = 1 << 4, /* * Bit masks used for noting whether to drain or discard output on close. * They are disjoint from each other; at most one may be set at a time. */ SERIAL_CLOSE_DRAIN = 1<<6, /* Drain all output on close. */ SERIAL_CLOSE_DISCARD = 1<<7,/* Discard all output on close. */ SERIAL_CLOSE_MASK = 3<<6 /* Both two bits above. */ }; /* * Default time to block between checking status on the serial port. */ #define SERIAL_DEFAULT_BLOCKTIME 10 /* 10 msec */ /* * Win32 read/write error masks for values returned by ClearCommError() */ enum TclWinCommErrorMasks { SERIAL_READ_ERRORS = /* Errors in the reader side. */ (CE_RXOVER | CE_OVERRUN | CE_RXPARITY | CE_FRAME | CE_BREAK), SERIAL_WRITE_ERRORS = /* Errors in the writer side. */ (CE_TXFULL | CE_PTO) }; /* * This structure describes per-instance data for a serial based channel. */ typedef struct SerialInfo { HANDLE handle; struct SerialInfo *nextPtr; /* Pointer to next registered serial. */ Tcl_Channel channel; /* Pointer to channel structure. */ int validMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which operations are valid on the file. */ int watchMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which events should be reported. */ int flags; /* State flags, see above for a list. */ int readable; /* Flag that the channel is readable. */ int writable; /* Flag that the channel is writable. */ int blockTime; /* Maximum blocktime in msec. */ unsigned long long lastEventTime; /* Time in milliseconds since last readable * event. */ /* Next readable event only after blockTime */ DWORD error; /* pending error code returned by * ClearCommError() */ DWORD lastError; /* last error code, can be fetched with * fconfigure chan -lasterror */ DWORD sysBufRead; /* Win32 system buffer size for read ops, * default=4096 */ DWORD sysBufWrite; /* Win32 system buffer size for write ops, * default=4096 */ Tcl_ThreadId threadId; /* Thread to which events should be reported. * This value is used by the reader/writer * threads. */ OVERLAPPED osRead; /* OVERLAPPED structure for read operations. */ OVERLAPPED osWrite; /* OVERLAPPED structure for write operations */ TclPipeThreadInfo *writeTI; /* Thread info structure of writer worker. */ HANDLE writeThread; /* Handle to writer thread. */ CRITICAL_SECTION csWrite; /* Writer thread synchronisation. */ HANDLE evWritable; /* Manual-reset event to signal when the * writer thread has finished waiting for the * current buffer to be written. */ DWORD writeError; /* An error caused by the last background * write. Set to 0 if no error has been * detected. This word is shared with the * writer thread so access must be * synchronized with the evWritable object. */ char *writeBuf; /* Current background output buffer. Access is * synchronized with the evWritable object. */ int writeBufLen; /* Size of write buffer. Access is * synchronized with the evWritable object. */ int toWrite; /* Current amount to be written. Access is * synchronized with the evWritable object. */ int writeQueue; /* Number of bytes pending in output queue. * Offset to DCB.cbInQue. Used to query * [fconfigure -queue] */ } SerialInfo; typedef struct { /* * The following pointer refers to the head of the list of serials that * are being watched for file events. */ SerialInfo *firstSerialPtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following structure is what is added to the Tcl event queue when serial * events are generated. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ SerialInfo *infoPtr; /* Pointer to serial info structure. Note that * we still have to verify that the serial * exists before dereferencing this * pointer. */ } SerialEvent; /* * We don't use timeouts. */ static COMMTIMEOUTS no_timeout = { 0, /* ReadIntervalTimeout */ 0, /* ReadTotalTimeoutMultiplier */ 0, /* ReadTotalTimeoutConstant */ 0, /* WriteTotalTimeoutMultiplier */ 0, /* WriteTotalTimeoutConstant */ }; /* * Declarations for functions used only in this file. */ static int SerialBlockProc(void *instanceData, int mode); static void SerialCheckProc(void *clientData, int flags); static int SerialCloseProc(void *instanceData, Tcl_Interp *interp, int flags); static int SerialEventProc(Tcl_Event *evPtr, int flags); static void SerialExitHandler(void *clientData); static int SerialGetHandleProc(void *instanceData, int direction, void **handlePtr); static ThreadSpecificData *SerialInit(void); static int SerialInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int SerialOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static void SerialSetupProc(void *clientData, int flags); static void SerialWatchProc(void *instanceData, int mask); static void ProcExitHandler(void *clientData); static int SerialGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static int SerialSetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, const char *value); static DWORD WINAPI SerialWriterThread(LPVOID arg); static void SerialThreadActionProc(void *instanceData, int action); static int SerialBlockingRead(SerialInfo *infoPtr, LPVOID buf, DWORD bufSize, LPDWORD lpRead, LPOVERLAPPED osPtr); static int SerialBlockingWrite(SerialInfo *infoPtr, LPVOID buf, DWORD bufSize, LPDWORD lpWritten, LPOVERLAPPED osPtr); /* * This structure describes the channel type structure for command serial * based IO. */ static const Tcl_ChannelType serialChannelType = { "serial", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ SerialInputProc, SerialOutputProc, NULL, /* Deprecated. */ SerialSetOptionProc, SerialGetOptionProc, SerialWatchProc, SerialGetHandleProc, SerialCloseProc, SerialBlockProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ SerialThreadActionProc, NULL /* Truncate proc. */ }; /* *---------------------------------------------------------------------- * * SerialInit -- * * This function initializes the static variables for this file. * * Results: * None. * * Side effects: * Creates a new event source. * *---------------------------------------------------------------------- */ static ThreadSpecificData * SerialInit(void) { ThreadSpecificData *tsdPtr; /* * Check the initialized flag first, then check it again in the mutex. * This is a speed enhancement. */ if (!initialized) { Tcl_MutexLock(&serialMutex); if (!initialized) { initialized = 1; Tcl_CreateExitHandler(ProcExitHandler, NULL); } Tcl_MutexUnlock(&serialMutex); } tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); if (tsdPtr == NULL) { tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->firstSerialPtr = NULL; Tcl_CreateEventSource(SerialSetupProc, SerialCheckProc, NULL); Tcl_CreateThreadExitHandler(SerialExitHandler, NULL); } return tsdPtr; } /* *---------------------------------------------------------------------- * * SerialExitHandler -- * * This function is called to cleanup the serial module before Tcl is * unloaded. * * Results: * None. * * Side effects: * Removes the serial event source. * *---------------------------------------------------------------------- */ static void SerialExitHandler( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); SerialInfo *infoPtr; /* * Clear all eventually pending output. Otherwise Tcl's exit could totally * block, because it performs a blocking flush on all open channels. Note * that serial write operations may be blocked due to handshake. */ for (infoPtr = tsdPtr->firstSerialPtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { PurgeComm(infoPtr->handle, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR); } Tcl_DeleteEventSource(SerialSetupProc, SerialCheckProc, NULL); } /* *---------------------------------------------------------------------- * * ProcExitHandler -- * * This function is called to cleanup the process list before Tcl is * unloaded. * * Results: * None. * * Side effects: * Resets the process list. * *---------------------------------------------------------------------- */ static void ProcExitHandler( TCL_UNUSED(void *)) { Tcl_MutexLock(&serialMutex); initialized = 0; Tcl_MutexUnlock(&serialMutex); } /* *---------------------------------------------------------------------- * * SerialBlockTime -- * * Wrapper to set Tcl's block time in msec. * * Results: * None. * * Side effects: * Updates the maximum blocking time. * *---------------------------------------------------------------------- */ static void SerialBlockTime( int msec) /* milli-seconds */ { Tcl_Time blockTime; blockTime.sec = msec / 1000; blockTime.usec = (msec % 1000) * 1000; Tcl_SetMaxBlockTime(&blockTime); } /* *---------------------------------------------------------------------- * * SerialGetMilliseconds -- * * Get current time in milliseconds,ignoring integer overruns. * * Results: * The current time. * * Side effects: * None. * *---------------------------------------------------------------------- */ static unsigned long long SerialGetMilliseconds(void) { Tcl_Time time; Tcl_GetTime(&time); return (unsigned long long)time.sec * 1000 + (unsigned long)time.usec / 1000; } /* *---------------------------------------------------------------------- * * SerialSetupProc -- * * This procedure is invoked before Tcl_DoOneEvent blocks waiting for an * event. * * Results: * None. * * Side effects: * Adjusts the block time if needed. * *---------------------------------------------------------------------- */ #ifdef __cplusplus #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif void SerialSetupProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { SerialInfo *infoPtr; int block = 1; int msec = INT_MAX; /* min. found block time */ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { return; } /* * Look to see if any events handlers installed. If they are, do not * block. */ for (infoPtr=tsdPtr->firstSerialPtr ; infoPtr!=NULL ; infoPtr=infoPtr->nextPtr) { if (infoPtr->watchMask & TCL_WRITABLE) { if (WaitForSingleObject(infoPtr->evWritable, 0) != WAIT_TIMEOUT) { block = 0; msec = min(msec, infoPtr->blockTime); } } if (infoPtr->watchMask & TCL_READABLE) { block = 0; msec = min(msec, infoPtr->blockTime); } } if (!block) { SerialBlockTime(msec); } } /* *---------------------------------------------------------------------- * * SerialCheckProc -- * * This procedure is called by Tcl_DoOneEvent to check the serial event * source for events. * * Results: * None. * * Side effects: * May queue an event. * *---------------------------------------------------------------------- */ static void SerialCheckProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { SerialInfo *infoPtr; SerialEvent *evPtr; int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); COMSTAT cStat; unsigned long long time; if (!(flags & TCL_FILE_EVENTS)) { return; } /* * Queue events for any ready serials that don't already have events * queued. */ for (infoPtr=tsdPtr->firstSerialPtr ; infoPtr!=NULL ; infoPtr=infoPtr->nextPtr) { if (infoPtr->flags & SERIAL_PENDING) { continue; } needEvent = 0; /* * If WRITABLE watch mask is set look for infoPtr->evWritable object. */ if (infoPtr->watchMask & TCL_WRITABLE && WaitForSingleObject(infoPtr->evWritable, 0) != WAIT_TIMEOUT) { infoPtr->writable = 1; needEvent = 1; } /* * If READABLE watch mask is set call ClearCommError to poll cbInQue. * Window errors are ignored here. */ if (infoPtr->watchMask & TCL_READABLE) { if (ClearCommError(infoPtr->handle, &infoPtr->error, &cStat)) { /* * Look for characters already pending in windows queue. If * they are, poll. */ if (infoPtr->watchMask & TCL_READABLE) { /* * Force fileevent after serial read error. */ if ((cStat.cbInQue > 0) || (infoPtr->error & SERIAL_READ_ERRORS)) { infoPtr->readable = 1; time = SerialGetMilliseconds(); if ((time - infoPtr->lastEventTime) >= (unsigned long long) infoPtr->blockTime) { needEvent = 1; infoPtr->lastEventTime = time; } } } } } /* * Queue an event if the serial is signaled for reading or writing. */ if (needEvent) { infoPtr->flags |= SERIAL_PENDING; evPtr = (SerialEvent *)Tcl_Alloc(sizeof(SerialEvent)); evPtr->header.proc = SerialEventProc; evPtr->infoPtr = infoPtr; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); } } } /* *---------------------------------------------------------------------- * * SerialBlockProc -- * * Set blocking or non-blocking mode on channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int SerialBlockProc( void *instanceData, /* Instance data for channel. */ int mode) /* TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { int errorCode = 0; SerialInfo *infoPtr = (SerialInfo *) instanceData; /* * Only serial READ can be switched between blocking & nonblocking using * COMMTIMEOUTS. Serial write emulates blocking & nonblocking by the * SerialWriterThread. */ if (mode == TCL_MODE_NONBLOCKING) { infoPtr->flags |= SERIAL_ASYNC; } else { infoPtr->flags &= ~(SERIAL_ASYNC); } return errorCode; } /* *---------------------------------------------------------------------- * * SerialCloseProc -- * * Closes a serial based IO channel. * * Results: * 0 on success, errno otherwise. * * Side effects: * Closes the physical channel. * *---------------------------------------------------------------------- */ static int SerialCloseProc( void *instanceData, /* Pointer to SerialInfo structure. */ TCL_UNUSED(Tcl_Interp *), int flags) { SerialInfo *serialPtr = (SerialInfo *) instanceData; int errorCode = 0, result = 0; SerialInfo *infoPtr, **nextPtrPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; } if (serialPtr->validMask & TCL_READABLE) { PurgeComm(serialPtr->handle, PURGE_RXABORT | PURGE_RXCLEAR); CloseHandle(serialPtr->osRead.hEvent); } serialPtr->validMask &= ~TCL_READABLE; if (serialPtr->writeThread) { TclPipeThreadStop(&serialPtr->writeTI, serialPtr->writeThread); CloseHandle(serialPtr->osWrite.hEvent); CloseHandle(serialPtr->evWritable); CloseHandle(serialPtr->writeThread); serialPtr->writeThread = NULL; PurgeComm(serialPtr->handle, PURGE_TXABORT | PURGE_TXCLEAR); } serialPtr->validMask &= ~TCL_WRITABLE; DeleteCriticalSection(&serialPtr->csWrite); /* * Don't close the Win32 handle if the handle is a standard channel during * the thread exit process. Otherwise, one thread may kill the stdio of * another. */ if (!TclInThreadExit() || ((GetStdHandle(STD_INPUT_HANDLE) != serialPtr->handle) && (GetStdHandle(STD_OUTPUT_HANDLE) != serialPtr->handle) && (GetStdHandle(STD_ERROR_HANDLE) != serialPtr->handle))) { if (CloseHandle(serialPtr->handle) == FALSE) { Tcl_WinConvertError(GetLastError()); errorCode = errno; } } serialPtr->watchMask &= serialPtr->validMask; /* * Remove the file from the list of watched files. */ for (nextPtrPtr=&(tsdPtr->firstSerialPtr), infoPtr=*nextPtrPtr; infoPtr!=NULL; nextPtrPtr=&infoPtr->nextPtr, infoPtr=*nextPtrPtr) { if (infoPtr == (SerialInfo *)serialPtr) { *nextPtrPtr = infoPtr->nextPtr; break; } } /* * Wrap the error file into a channel and give it to the cleanup routine. */ if (serialPtr->writeBuf != NULL) { Tcl_Free(serialPtr->writeBuf); serialPtr->writeBuf = NULL; } Tcl_Free(serialPtr); if (errorCode == 0) { return result; } return errorCode; } /* *---------------------------------------------------------------------- * * SerialBlockingRead -- * * Perform a blocking read into the buffer given. Returns count of how * many bytes were actually read, and an error indication. * * Results: * A count of how many bytes were read is returned and an error * indication is returned. * * Side effects: * Reads input from the actual channel. * *---------------------------------------------------------------------- */ static int SerialBlockingRead( SerialInfo *infoPtr, /* Serial info structure */ LPVOID buf, /* The input buffer pointer */ DWORD bufSize, /* The number of bytes to read */ LPDWORD lpRead, /* Returns number of bytes read */ LPOVERLAPPED osPtr) /* OVERLAPPED structure */ { /* * Perform overlapped blocking read. * 1. Reset the overlapped event * 2. Start overlapped read operation * 3. Wait for completion */ /* * Set Offset to ZERO, otherwise NT4.0 may report an error. */ osPtr->Offset = osPtr->OffsetHigh = 0; ResetEvent(osPtr->hEvent); if (!ReadFile(infoPtr->handle, buf, bufSize, lpRead, osPtr)) { if (GetLastError() != ERROR_IO_PENDING) { /* * ReadFile failed, but it isn't delayed. Report error. */ return FALSE; } else { /* * Read is pending, wait for completion, timeout? */ if (!GetOverlappedResult(infoPtr->handle, osPtr, lpRead, TRUE)) { return FALSE; } } } else { /* * ReadFile completed immediately. */ } return TRUE; } /* *---------------------------------------------------------------------- * * SerialBlockingWrite -- * * Perform a blocking write from the buffer given. Returns count of how * many bytes were actually written, and an error indication. * * Results: * A count of how many bytes were written is returned and an error * indication is returned. * * Side effects: * Writes output to the actual channel. * *---------------------------------------------------------------------- */ static int SerialBlockingWrite( SerialInfo *infoPtr, /* Serial info structure */ LPVOID buf, /* The output buffer pointer */ DWORD bufSize, /* The number of bytes to write */ LPDWORD lpWritten, /* Returns number of bytes written */ LPOVERLAPPED osPtr) /* OVERLAPPED structure */ { int result; /* * Perform overlapped blocking write. * 1. Reset the overlapped event * 2. Remove these bytes from the output queue counter * 3. Start overlapped write operation * 3. Remove these bytes from the output queue counter * 4. Wait for completion * 5. Adjust the output queue counter */ ResetEvent(osPtr->hEvent); EnterCriticalSection(&infoPtr->csWrite); infoPtr->writeQueue -= bufSize; /* * Set Offset to ZERO, otherwise NT4.0 may report an error */ osPtr->Offset = osPtr->OffsetHigh = 0; result = WriteFile(infoPtr->handle, buf, bufSize, lpWritten, osPtr); LeaveCriticalSection(&infoPtr->csWrite); if (result == FALSE) { DWORD err = GetLastError(); switch (err) { case ERROR_IO_PENDING: /* * Write is pending, wait for completion. */ if (!GetOverlappedResult(infoPtr->handle, osPtr, lpWritten, TRUE)) { return FALSE; } break; case ERROR_COUNTER_TIMEOUT: /* * Write timeout handled in SerialOutputProc. */ break; default: /* * WriteFile failed, but it isn't delayed. Report error. */ return FALSE; } } else { /* * WriteFile completed immediately. */ } EnterCriticalSection(&infoPtr->csWrite); infoPtr->writeQueue += (*lpWritten - bufSize); LeaveCriticalSection(&infoPtr->csWrite); return TRUE; } /* *---------------------------------------------------------------------- * * SerialInputProc -- * * Reads input from the IO channel into the buffer given. Returns count * of how many bytes were actually read, and an error indication. * * Results: * A count of how many bytes were read is returned and an error * indication is returned in an output argument. * * Side effects: * Reads input from the actual channel. * *---------------------------------------------------------------------- */ static int SerialInputProc( void *instanceData, /* Serial state. */ char *buf, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCode) /* Where to store error code. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; DWORD bytesRead = 0; COMSTAT cStat; *errorCode = 0; /* * Check if there is a CommError pending from SerialCheckProc */ if (infoPtr->error & SERIAL_READ_ERRORS) { goto commError; } /* * Look for characters already pending in windows queue. This is the * mainly restored good old code from Tcl8.0 */ if (ClearCommError(infoPtr->handle, &infoPtr->error, &cStat)) { /* * Check for errors here, but not in the evSetup/Check procedures. */ if (infoPtr->error & SERIAL_READ_ERRORS) { goto commError; } if (infoPtr->flags & SERIAL_ASYNC) { /* * NON_BLOCKING mode: Avoid blocking by reading more bytes than * available in input buffer. */ if (cStat.cbInQue > 0) { if ((DWORD) bufSize > cStat.cbInQue) { bufSize = cStat.cbInQue; } } else { errno = *errorCode = EWOULDBLOCK; return -1; } } else { /* * BLOCKING mode: Tcl tries to read a full buffer of 4 kBytes here. */ if (cStat.cbInQue > 0) { if ((DWORD) bufSize > cStat.cbInQue) { bufSize = cStat.cbInQue; } } else { bufSize = 1; } } } if (bufSize == 0) { return 0; } /* * Perform blocking read. Doesn't block in non-blocking mode, because we * checked the number of available bytes. */ if (SerialBlockingRead(infoPtr, (LPVOID) buf, (DWORD) bufSize, &bytesRead, &infoPtr->osRead) == FALSE) { Tcl_WinConvertError(GetLastError()); *errorCode = errno; return -1; } return bytesRead; commError: infoPtr->lastError = infoPtr->error; /* save last error code */ infoPtr->error = 0; /* reset error code */ *errorCode = EIO; /* to return read-error only once */ return -1; } /* *---------------------------------------------------------------------- * * SerialOutputProc -- * * Writes the given output on the IO channel. Returns count of how many * characters were actually written, and an error indication. * * Results: * A count of how many characters were written is returned and an error * indication is returned in an output argument. * * Side effects: * Writes output on the actual channel. * *---------------------------------------------------------------------- */ static int SerialOutputProc( void *instanceData, /* Serial state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; DWORD bytesWritten, timeout; *errorCode = 0; /* * At EXIT Tcl tries to flush all open channels in blocking mode. We avoid * blocking output after ExitProc or CloseHandler(chan) has been called by * checking the corresponding variables. */ if (!initialized || TclInExit()) { return toWrite; } /* * Check if there is a CommError pending from SerialCheckProc */ if (infoPtr->error & SERIAL_WRITE_ERRORS) { infoPtr->lastError = infoPtr->error; /* save last error code */ infoPtr->error = 0; /* reset error code */ errno = EIO; goto error; } timeout = (infoPtr->flags & SERIAL_ASYNC) ? 0 : INFINITE; if (WaitForSingleObject(infoPtr->evWritable, timeout) == WAIT_TIMEOUT) { /* * The writer thread is blocked waiting for a write to complete and * the channel is in non-blocking mode. */ errno = EWOULDBLOCK; goto error1; } /* * Check for a background error on the last write. */ if (infoPtr->writeError) { Tcl_WinConvertError(infoPtr->writeError); infoPtr->writeError = 0; goto error1; } /* * Remember the number of bytes in output queue */ EnterCriticalSection(&infoPtr->csWrite); infoPtr->writeQueue += toWrite; LeaveCriticalSection(&infoPtr->csWrite); if (infoPtr->flags & SERIAL_ASYNC) { /* * The serial is non-blocking, so copy the data into the output buffer * and restart the writer thread. */ if (toWrite > infoPtr->writeBufLen) { /* * Reallocate the buffer to be large enough to hold the data. */ if (infoPtr->writeBuf) { Tcl_Free(infoPtr->writeBuf); } infoPtr->writeBufLen = toWrite; infoPtr->writeBuf = (char *)Tcl_Alloc(toWrite); } memcpy(infoPtr->writeBuf, buf, toWrite); infoPtr->toWrite = toWrite; ResetEvent(infoPtr->evWritable); TclPipeThreadSignal(&infoPtr->writeTI); bytesWritten = (DWORD) toWrite; } else { /* * In the blocking case, just try to write the buffer directly. This * avoids an unnecessary copy. */ if (!SerialBlockingWrite(infoPtr, (LPVOID) buf, (DWORD) toWrite, &bytesWritten, &infoPtr->osWrite)) { goto writeError; } if (bytesWritten != (DWORD) toWrite) { /* * Write timeout. */ infoPtr->lastError |= CE_PTO; errno = EIO; goto error; } } return (int) bytesWritten; writeError: Tcl_WinConvertError(GetLastError()); error: /* * Reset the output queue counter on error during blocking output */ /* * EnterCriticalSection(&infoPtr->csWrite); * infoPtr->writeQueue = 0; * LeaveCriticalSection(&infoPtr->csWrite); */ error1: *errorCode = errno; return -1; } /* *---------------------------------------------------------------------- * * SerialEventProc -- * * This function is invoked by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This procedure invokes Tcl_NotifyChannel * on the serial. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the notifier callback does. * *---------------------------------------------------------------------- */ static int SerialEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { SerialEvent *serialEvPtr = (SerialEvent *)evPtr; SerialInfo *infoPtr; int mask; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { return 0; } /* * Search through the list of watched serials for the one whose handle * matches the event. We do this rather than simply dereferencing the * handle in the event so that serials can be deleted while the event is * in the queue. */ for (infoPtr = tsdPtr->firstSerialPtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (serialEvPtr->infoPtr == infoPtr) { infoPtr->flags &= ~(SERIAL_PENDING); break; } } /* * Remove stale events. */ if (!infoPtr) { return 1; } /* * Check to see if the serial is readable. Note that we can't tell if a * serial is writable, so we always report it as being writable unless we * have detected EOF. */ mask = 0; if (infoPtr->watchMask & TCL_WRITABLE) { if (infoPtr->writable) { mask |= TCL_WRITABLE; infoPtr->writable = 0; } } if (infoPtr->watchMask & TCL_READABLE) { if (infoPtr->readable) { mask |= TCL_READABLE; infoPtr->readable = 0; } } /* * Inform the channel of the events. */ Tcl_NotifyChannel(infoPtr->channel, infoPtr->watchMask & mask); return 1; } /* *---------------------------------------------------------------------- * * SerialWatchProc -- * * Called by the notifier to set up to watch for events on this channel. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void SerialWatchProc( void *instanceData, /* Serial state. */ int mask) /* What events to watch for, OR-ed combination * of TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { SerialInfo **nextPtrPtr, *ptr; SerialInfo *infoPtr = (SerialInfo *) instanceData; int oldMask = infoPtr->watchMask; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Since the file is always ready for events, we set the block time so we * will poll. */ infoPtr->watchMask = mask & infoPtr->validMask; if (infoPtr->watchMask) { if (!oldMask) { infoPtr->nextPtr = tsdPtr->firstSerialPtr; tsdPtr->firstSerialPtr = infoPtr; } SerialBlockTime(infoPtr->blockTime); } else if (oldMask) { /* * Remove the serial port from the list of watched serial ports. */ for (nextPtrPtr=&(tsdPtr->firstSerialPtr), ptr=*nextPtrPtr; ptr!=NULL; nextPtrPtr=&ptr->nextPtr, ptr=*nextPtrPtr) { if (infoPtr == ptr) { *nextPtrPtr = ptr->nextPtr; break; } } } } /* *---------------------------------------------------------------------- * * SerialGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * command serial port based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int SerialGetHandleProc( void *instanceData, /* The serial state. */ TCL_UNUSED(int) /*direction*/, void **handlePtr) /* Where to store the handle. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; *handlePtr = (void *)infoPtr->handle; return TCL_OK; } /* *---------------------------------------------------------------------- * * SerialWriterThread -- * * This function runs in a separate thread and writes data onto a serial. * * Results: * Always returns 0. * * Side effects: * Signals the main thread when an output operation is completed. May * cause the main thread to wake up by posting a message. * *---------------------------------------------------------------------- */ static DWORD WINAPI SerialWriterThread( LPVOID arg) { TclPipeThreadInfo *pipeTI = (TclPipeThreadInfo *)arg; SerialInfo *infoPtr = NULL; /* access info only after success init/wait */ DWORD bytesWritten, toWrite; char *buf; OVERLAPPED myWrite; /* Have an own OVERLAPPED in this thread. */ for (;;) { /* * Wait for the main thread to signal before attempting to write. */ if (!TclPipeThreadWaitForSignal(&pipeTI)) { /* exit */ break; } infoPtr = (SerialInfo *) pipeTI->clientData; buf = infoPtr->writeBuf; toWrite = infoPtr->toWrite; myWrite.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); /* * Loop until all of the bytes are written or an error occurs. */ while (toWrite > 0) { /* * Check for pending writeError. Ignore all write operations until * the user has been notified. */ if (infoPtr->writeError) { break; } if (SerialBlockingWrite(infoPtr, (LPVOID) buf, (DWORD) toWrite, &bytesWritten, &myWrite) == FALSE) { infoPtr->writeError = GetLastError(); break; } if (bytesWritten != toWrite) { /* * Write timeout. */ infoPtr->writeError = ERROR_WRITE_FAULT; break; } toWrite -= bytesWritten; buf += bytesWritten; } CloseHandle(myWrite.hEvent); /* * Signal the main thread by signalling the evWritable event and then * waking up the notifier thread. */ SetEvent(infoPtr->evWritable); /* * Alert the foreground thread. Note that we need to treat this like a * critical section so the foreground thread does not terminate this * thread while we are holding a mutex in the notifier code. */ Tcl_MutexLock(&serialMutex); if (infoPtr->threadId != NULL) { /* * TIP #218: When in flight ignore the event, no one will receive * it anyway. */ Tcl_ThreadAlert(infoPtr->threadId); } Tcl_MutexUnlock(&serialMutex); } /* * We're about to close, so do any drain or discard required. */ if (infoPtr) { switch (infoPtr->flags & SERIAL_CLOSE_MASK) { case SERIAL_CLOSE_DRAIN: FlushFileBuffers(infoPtr->handle); break; case SERIAL_CLOSE_DISCARD: PurgeComm(infoPtr->handle, PURGE_TXABORT | PURGE_TXCLEAR); break; } } /* * Worker exit, so inform the main thread or free TI-structure (if owned). */ TclPipeThreadExit(&pipeTI); return 0; } /* *---------------------------------------------------------------------- * * TclWinSerialOpen -- * * Opens or Reopens the serial port with the OVERLAPPED FLAG set * * Results: * Returns the new handle, or INVALID_HANDLE_VALUE. * If an existing channel is specified it is closed and reopened. * * Side effects: * May close/reopen the original handle * *---------------------------------------------------------------------- */ HANDLE TclWinSerialOpen( HANDLE handle, const WCHAR *name, DWORD access) { SerialInit(); /* * If an open channel is specified, close it */ if (handle != INVALID_HANDLE_VALUE && CloseHandle(handle) == FALSE) { return INVALID_HANDLE_VALUE; } /* * Multithreaded I/O needs the overlapped flag set otherwise * ClearCommError blocks under Windows NT/2000 until serial output is * finished */ handle = CreateFileW(name, access, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); return handle; } /* *---------------------------------------------------------------------- * * TclWinOpenSerialChannel -- * * Constructs a Serial port channel for the specified standard OS handle. * This is a helper function to break up the construction of channels * into File, Console, or Serial. * * Results: * Returns the new channel, or NULL. * * Side effects: * May open the channel * *---------------------------------------------------------------------- */ Tcl_Channel TclWinOpenSerialChannel( HANDLE handle, char *channelName, int permissions) { SerialInfo *infoPtr; SerialInit(); infoPtr = (SerialInfo *)Tcl_Alloc(sizeof(SerialInfo)); memset(infoPtr, 0, sizeof(SerialInfo)); infoPtr->validMask = permissions & (TCL_READABLE|TCL_WRITABLE); infoPtr->handle = handle; infoPtr->channel = (Tcl_Channel) NULL; infoPtr->readable = 0; infoPtr->writable = 1; infoPtr->toWrite = infoPtr->writeQueue = 0; infoPtr->blockTime = SERIAL_DEFAULT_BLOCKTIME; infoPtr->lastEventTime = 0; infoPtr->lastError = infoPtr->error = 0; infoPtr->threadId = Tcl_GetCurrentThread(); infoPtr->sysBufRead = 4096; infoPtr->sysBufWrite = 4096; /* * Use the pointer to keep the channel names unique, in case the handles * are shared between multiple channels (stdin/stdout). */ TclWinGenerateChannelName(channelName, "file", infoPtr); infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, infoPtr, permissions); SetupComm(handle, infoPtr->sysBufRead, infoPtr->sysBufWrite); PurgeComm(handle, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR); /* * Default is blocking. */ SetCommTimeouts(handle, &no_timeout); InitializeCriticalSection(&infoPtr->csWrite); if (permissions & TCL_READABLE) { infoPtr->osRead.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); } if (permissions & TCL_WRITABLE) { /* * Initially the channel is writable and the writeThread is idle. */ infoPtr->osWrite.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); infoPtr->evWritable = CreateEventW(NULL, TRUE, TRUE, NULL); infoPtr->writeThread = CreateThread(NULL, 256, SerialWriterThread, TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr), 0, NULL); } Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto"); return infoPtr->channel; } /* *---------------------------------------------------------------------- * * SerialErrorStr -- * * Converts a Win32 serial error code to a list of readable errors. * * Results: * None. * * Side effects: * Generates readable errors in the supplied DString. * *---------------------------------------------------------------------- */ static void SerialErrorStr( DWORD error, /* Win32 serial error code. */ Tcl_DString *dsPtr) /* Where to store string. */ { if (error & CE_RXOVER) { Tcl_DStringAppendElement(dsPtr, "RXOVER"); } if (error & CE_OVERRUN) { Tcl_DStringAppendElement(dsPtr, "OVERRUN"); } if (error & CE_RXPARITY) { Tcl_DStringAppendElement(dsPtr, "RXPARITY"); } if (error & CE_FRAME) { Tcl_DStringAppendElement(dsPtr, "FRAME"); } if (error & CE_BREAK) { Tcl_DStringAppendElement(dsPtr, "BREAK"); } if (error & CE_TXFULL) { Tcl_DStringAppendElement(dsPtr, "TXFULL"); } if (error & CE_PTO) { /* PTO used to signal WRITE-TIMEOUT */ Tcl_DStringAppendElement(dsPtr, "TIMEOUT"); } if (error & ~((DWORD) (SERIAL_READ_ERRORS | SERIAL_WRITE_ERRORS))) { char buf[TCL_INTEGER_SPACE + 1]; snprintf(buf, sizeof(buf), "%ld", error); Tcl_DStringAppendElement(dsPtr, buf); } } /* *---------------------------------------------------------------------- * * SerialModemStatusStr -- * * Converts a Win32 modem status list of readable flags * * Result: * None. * * Side effects: * Appends modem status flag strings to the given DString. * *---------------------------------------------------------------------- */ static void SerialModemStatusStr( DWORD status, /* Win32 modem status. */ Tcl_DString *dsPtr) /* Where to store string. */ { Tcl_DStringAppendElement(dsPtr, "CTS"); Tcl_DStringAppendElement(dsPtr, (status & MS_CTS_ON) ? "1" : "0"); Tcl_DStringAppendElement(dsPtr, "DSR"); Tcl_DStringAppendElement(dsPtr, (status & MS_DSR_ON) ? "1" : "0"); Tcl_DStringAppendElement(dsPtr, "RING"); Tcl_DStringAppendElement(dsPtr, (status & MS_RING_ON) ? "1" : "0"); Tcl_DStringAppendElement(dsPtr, "DCD"); Tcl_DStringAppendElement(dsPtr, (status & MS_RLSD_ON) ? "1" : "0"); } /* *---------------------------------------------------------------------- * * SerialSetOptionProc -- * * Sets an option on a channel. * * Results: * A standard Tcl result. Also sets the interp's result on error if * interp is not NULL. * * Side effects: * May modify an option on a device. * *---------------------------------------------------------------------- */ static int SerialSetOptionProc( void *instanceData, /* Serial state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Which option to set? */ const char *value) /* New value for option. */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; DCB dcb; BOOL result, flag; size_t len, vlen; Tcl_DString ds; const WCHAR *native; Tcl_Size argc; const char **argv; /* * Parse options. This would be far easier if we had Tcl_Objs to work with * as that would let us use Tcl_GetIndexFromObj()... */ len = strlen(optionName); vlen = strlen(value); /* * Option -closemode drain|discard|default */ if ((len > 2) && (strncmp(optionName, "-closemode", len) == 0)) { if (strncasecmp(value, "DEFAULT", vlen) == 0) { infoPtr->flags &= ~SERIAL_CLOSE_MASK; } else if (strncasecmp(value, "DRAIN", vlen) == 0) { infoPtr->flags &= ~SERIAL_CLOSE_MASK; infoPtr->flags |= SERIAL_CLOSE_DRAIN; } else if (strncasecmp(value, "DISCARD", vlen) == 0) { infoPtr->flags &= ~SERIAL_CLOSE_MASK; infoPtr->flags |= SERIAL_CLOSE_DISCARD; } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad mode \"%s\" for -closemode: must be" " default, discard, or drain", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } return TCL_ERROR; } return TCL_OK; } /* * Option -mode baud,parity,databits,stopbits */ if ((len > 2) && (strncmp(optionName, "-mode", len) == 0)) { if (!GetCommState(infoPtr->handle, &dcb)) { goto getStateFailed; } Tcl_DStringInit(&ds); native = Tcl_UtfToWCharDString(value, TCL_INDEX_NONE, &ds); result = BuildCommDCBW(native, &dcb); Tcl_DStringFree(&ds); if (result == FALSE) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -mode: should be baud,parity,data,stop", value)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL); } return TCL_ERROR; } /* * Default settings for serial communications. */ dcb.fBinary = TRUE; dcb.fErrorChar = FALSE; dcb.fNull = FALSE; dcb.fAbortOnError = FALSE; if (!SetCommState(infoPtr->handle, &dcb)) { goto setStateFailed; } return TCL_OK; } /* * Option -handshake none|xonxoff|rtscts|dtrdsr */ if ((len > 1) && (strncmp(optionName, "-handshake", len) == 0)) { if (!GetCommState(infoPtr->handle, &dcb)) { goto getStateFailed; } /* * Reset all handshake options. DTR and RTS are ON by default. */ dcb.fOutX = dcb.fInX = FALSE; dcb.fOutxCtsFlow = dcb.fOutxDsrFlow = dcb.fDsrSensitivity = FALSE; dcb.fDtrControl = DTR_CONTROL_ENABLE; dcb.fRtsControl = RTS_CONTROL_ENABLE; dcb.fTXContinueOnXoff = FALSE; /* * Adjust the handshake limits. Yes, the XonXoff limits seem to * influence even hardware handshake. */ dcb.XonLim = (WORD) (infoPtr->sysBufRead*1/2); dcb.XoffLim = (WORD) (infoPtr->sysBufRead*1/4); if (strncasecmp(value, "NONE", vlen) == 0) { /* * Leave all handshake options disabled. */ } else if (strncasecmp(value, "XONXOFF", vlen) == 0) { dcb.fOutX = dcb.fInX = TRUE; } else if (strncasecmp(value, "RTSCTS", vlen) == 0) { dcb.fOutxCtsFlow = TRUE; dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; } else if (strncasecmp(value, "DTRDSR", vlen) == 0) { dcb.fOutxDsrFlow = TRUE; dcb.fDtrControl = DTR_CONTROL_HANDSHAKE; } else { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -handshake: must be one of" " xonxoff, rtscts, dtrdsr or none", value)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "HANDSHAKE", (char *)NULL); } return TCL_ERROR; } if (!SetCommState(infoPtr->handle, &dcb)) { goto setStateFailed; } return TCL_OK; } /* * Option -xchar {\x11 \x13} */ if ((len > 1) && (strncmp(optionName, "-xchar", len) == 0)) { if (!GetCommState(infoPtr->handle, &dcb)) { goto getStateFailed; } if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; } if (argc != 2) { badXchar: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -xchar: should be a list of" " two elements with each a single 8-bit character", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", (char *)NULL); } Tcl_Free((void *)argv); return TCL_ERROR; } /* * These dereferences are safe, even in the zero-length string cases, * because that just makes the xon/xoff character into NUL. When the * character looks like it is UTF-8 encoded, decode it before casting * into the format required for the Win guts. Note that this does not * convert character sets; it is expected that when people set the * control characters to something large and custom, they'll know the * hex/octal value rather than the printable form. */ dcb.XonChar = argv[0][0]; dcb.XoffChar = argv[1][0]; if (argv[0][0] & 0x80 || argv[1][0] & 0x80) { Tcl_UniChar character = 0; int charLen; charLen = TclUtfToUniChar(argv[0], &character); if ((character > 0xFF) || argv[0][charLen]) { goto badXchar; } dcb.XonChar = (char) character; charLen = TclUtfToUniChar(argv[1], &character); if ((character > 0xFF) || argv[1][charLen]) { goto badXchar; } dcb.XoffChar = (char) character; } Tcl_Free((void *)argv); if (!SetCommState(infoPtr->handle, &dcb)) { goto setStateFailed; } return TCL_OK; } /* * Option -ttycontrol {DTR 1 RTS 0 BREAK 0} */ if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) { Tcl_Size i; int res = TCL_OK; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; } if ((argc % 2) == 1) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -ttycontrol: should be " "a list of signal,value pairs", value)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "TTYCONTROL", (char *)NULL); } Tcl_Free((void *)argv); return TCL_ERROR; } for (i = 0; i < argc - 1; i += 2) { if (Tcl_GetBoolean(interp, argv[i+1], &flag) == TCL_ERROR) { res = TCL_ERROR; break; } if (strncasecmp(argv[i], "DTR", strlen(argv[i])) == 0) { if (!EscapeCommFunction(infoPtr->handle, (DWORD) (flag ? SETDTR : CLRDTR))) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set DTR signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "TTY_SIGNAL", (char *)NULL); } res = TCL_ERROR; break; } } else if (strncasecmp(argv[i], "RTS", strlen(argv[i])) == 0) { if (!EscapeCommFunction(infoPtr->handle, (DWORD) (flag ? SETRTS : CLRRTS))) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set RTS signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "TTY_SIGNAL", (char *)NULL); } res = TCL_ERROR; break; } } else if (strncasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) { if (!EscapeCommFunction(infoPtr->handle, (DWORD) (flag ? SETBREAK : CLRBREAK))) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't set BREAK signal", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "TTY_SIGNAL", (char *)NULL); } res = TCL_ERROR; break; } } else { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad signal name \"%s\" for -ttycontrol: must be" " DTR, RTS or BREAK", argv[i])); Tcl_SetErrorCode(interp, "TCL", "VALUE", "TTY_SIGNAL", (char *)NULL); } res = TCL_ERROR; break; } } Tcl_Free((void *)argv); return res; } /* * Option -sysbuffer {read_size write_size} * Option -sysbuffer read_size */ if ((len > 1) && (strncmp(optionName, "-sysbuffer", len) == 0)) { /* * -sysbuffer 4096 or -sysbuffer {64536 4096} */ int inSize = -1, outSize = -1; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; } if (argc == 1) { inSize = atoi(argv[0]); outSize = infoPtr->sysBufWrite; } else if (argc == 2) { inSize = atoi(argv[0]); outSize = atoi(argv[1]); } Tcl_Free((void *)argv); if ((argc < 1) || (argc > 2) || (inSize <= 0) || (outSize <= 0)) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad value \"%s\" for -sysbuffer: should be " "a list of one or two integers > 0", value)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SYS_BUFFER", (char *)NULL); } return TCL_ERROR; } if (!SetupComm(infoPtr->handle, inSize, outSize)) { if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't setup comm buffers: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } infoPtr->sysBufRead = inSize; infoPtr->sysBufWrite = outSize; /* * Adjust the handshake limits. Yes, the XonXoff limits seem to * influence even hardware handshake. */ if (!GetCommState(infoPtr->handle, &dcb)) { goto getStateFailed; } dcb.XonLim = (WORD) (infoPtr->sysBufRead*1/2); dcb.XoffLim = (WORD) (infoPtr->sysBufRead*1/4); if (!SetCommState(infoPtr->handle, &dcb)) { goto setStateFailed; } return TCL_OK; } /* * Option -pollinterval msec */ if ((len > 1) && (strncmp(optionName, "-pollinterval", len) == 0)) { if (Tcl_GetInt(interp, value, &(infoPtr->blockTime)) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } /* * Option -timeout msec */ if ((len > 2) && (strncmp(optionName, "-timeout", len) == 0)) { int msec; COMMTIMEOUTS tout = {0,0,0,0,0}; if (Tcl_GetInt(interp, value, &msec) != TCL_OK) { return TCL_ERROR; } tout.ReadTotalTimeoutConstant = msec; if (!SetCommTimeouts(infoPtr->handle, &tout)) { if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't set comm timeouts: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "closemode mode handshake pollinterval sysbuffer timeout " "ttycontrol xchar"); getStateFailed: if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get comm state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; setStateFailed: if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't set comm state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * SerialGetOptionProc -- * * Gets a mode associated with an IO channel. If the optionName arg is * non NULL, retrieves the value of that option. If the optionName arg is * NULL, retrieves a list of alternating option names and values for the * given channel. * * Results: * A standard Tcl result. Also sets the supplied DString to the string * value of the option(s) returned. * * Side effects: * The string returned by this function is in static storage and may be * reused at any time subsequent to the call. * *---------------------------------------------------------------------- */ static int SerialGetOptionProc( void *instanceData, /* Serial state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Option to get. */ Tcl_DString *dsPtr) /* Where to store value(s). */ { SerialInfo *infoPtr = (SerialInfo *) instanceData; DCB dcb; size_t len; int valid = 0; /* Flag if valid option parsed. */ if (optionName == NULL) { len = 0; } else { len = strlen(optionName); } /* * Get option -closemode */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-closemode"); } if (len==0 || (len>1 && strncmp(optionName, "-closemode", len)==0)) { switch (infoPtr->flags & SERIAL_CLOSE_MASK) { case SERIAL_CLOSE_DRAIN: Tcl_DStringAppendElement(dsPtr, "drain"); break; case SERIAL_CLOSE_DISCARD: Tcl_DStringAppendElement(dsPtr, "discard"); break; default: Tcl_DStringAppendElement(dsPtr, "default"); break; } } /* * Get option -mode */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-mode"); } if (len==0 || (len>2 && (strncmp(optionName, "-mode", len) == 0))) { char parity; const char *stop; char buf[2 * TCL_INTEGER_SPACE + 16]; if (!GetCommState(infoPtr->handle, &dcb)) { if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get comm state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } valid = 1; parity = 'n'; if (dcb.Parity <= 4) { parity = "noems"[dcb.Parity]; } stop = (dcb.StopBits == ONESTOPBIT) ? "1" : (dcb.StopBits == ONE5STOPBITS) ? "1.5" : "2"; snprintf(buf, sizeof(buf), "%ld,%c,%d,%s", dcb.BaudRate, parity, dcb.ByteSize, stop); Tcl_DStringAppendElement(dsPtr, buf); } /* * Get option -pollinterval */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-pollinterval"); } if (len==0 || (len>1 && strncmp(optionName, "-pollinterval", len)==0)) { char buf[TCL_INTEGER_SPACE + 1]; valid = 1; snprintf(buf, sizeof(buf), "%d", infoPtr->blockTime); Tcl_DStringAppendElement(dsPtr, buf); } /* * Get option -sysbuffer */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-sysbuffer"); Tcl_DStringStartSublist(dsPtr); } if (len==0 || (len>1 && strncmp(optionName, "-sysbuffer", len) == 0)) { char buf[TCL_INTEGER_SPACE + 1]; valid = 1; snprintf(buf, sizeof(buf), "%ld", infoPtr->sysBufRead); Tcl_DStringAppendElement(dsPtr, buf); snprintf(buf, sizeof(buf), "%ld", infoPtr->sysBufWrite); Tcl_DStringAppendElement(dsPtr, buf); } if (len == 0) { Tcl_DStringEndSublist(dsPtr); } /* * Get option -xchar */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-xchar"); Tcl_DStringStartSublist(dsPtr); } if (len==0 || (len>1 && strncmp(optionName, "-xchar", len) == 0)) { char buf[4]; valid = 1; if (!GetCommState(infoPtr->handle, &dcb)) { if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get comm state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } buf[Tcl_UniCharToUtf(UCHAR(dcb.XonChar), buf)] = '\0'; Tcl_DStringAppendElement(dsPtr, buf); buf[Tcl_UniCharToUtf(UCHAR(dcb.XoffChar), buf)] = '\0'; Tcl_DStringAppendElement(dsPtr, buf); } if (len == 0) { Tcl_DStringEndSublist(dsPtr); } /* * Get option -lasterror * * Option is readonly and returned by [fconfigure chan -lasterror] but not * returned by unnamed [fconfigure chan]. */ if (len>1 && strncmp(optionName, "-lasterror", len)==0) { valid = 1; SerialErrorStr(infoPtr->lastError, dsPtr); } /* * get option -queue * * Option is readonly and returned by [fconfigure chan -queue]. */ if (len>1 && strncmp(optionName, "-queue", len)==0) { char buf[TCL_INTEGER_SPACE + 1]; COMSTAT cStat; DWORD error; int inBuffered, outBuffered, count; valid = 1; /* * Query the pending data in Tcl's internal queues. */ inBuffered = Tcl_InputBuffered(infoPtr->channel); outBuffered = Tcl_OutputBuffered(infoPtr->channel); /* * Query the number of bytes in our output queue: * 1. The bytes pending in the output thread * 2. The bytes in the system drivers buffer * The writer thread should not interfere this action. */ EnterCriticalSection(&infoPtr->csWrite); ClearCommError(infoPtr->handle, &error, &cStat); count = (int) cStat.cbOutQue + infoPtr->writeQueue; LeaveCriticalSection(&infoPtr->csWrite); snprintf(buf, sizeof(buf), "%ld", inBuffered + cStat.cbInQue); Tcl_DStringAppendElement(dsPtr, buf); snprintf(buf, sizeof(buf), "%d", outBuffered + count); Tcl_DStringAppendElement(dsPtr, buf); } /* * get option -ttystatus * * Option is readonly and returned by [fconfigure chan -ttystatus] but not * returned by unnamed [fconfigure chan]. */ if (len>4 && strncmp(optionName, "-ttystatus", len)==0) { DWORD status; if (!GetCommModemStatus(infoPtr->handle, &status)) { if (interp != NULL) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get tty status: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } valid = 1; SerialModemStatusStr(status, dsPtr); } if (valid) { return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "closemode mode pollinterval lasterror queue sysbuffer ttystatus " "xchar"); } /* *---------------------------------------------------------------------- * * SerialThreadActionProc -- * * Insert or remove any thread local refs to this channel. * * Results: * None. * * Side effects: * Changes thread local list of valid channels. * *---------------------------------------------------------------------- */ static void SerialThreadActionProc( void *instanceData, int action) { SerialInfo *infoPtr = (SerialInfo *) instanceData; /* * We do not access firstSerialPtr in the thread structures. This is not * for all serials managed by the thread, but only those we are watching. * Removal of the fileevent handlers before transfer thus takes care of * this structure. */ Tcl_MutexLock(&serialMutex); if (action == TCL_CHANNEL_THREAD_INSERT) { /* * We can't copy the thread information from the channel when the * channel is created. At this time the channel back pointer has not * been set yet. However in that case the threadId has already been * set by TclpCreateCommandChannel itself, so the structure is still * good. */ SerialInit(); if (infoPtr->channel != NULL) { infoPtr->threadId = Tcl_GetChannelThread(infoPtr->channel); } } else { infoPtr->threadId = NULL; } Tcl_MutexUnlock(&serialMutex); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinReg.c0000644000175000017500000012121615104661342014412 0ustar sergeisergei/* * tclWinReg.c -- * * This file contains the implementation of the "registry" Tcl built-in * command. This command is built as a dynamically loadable extension in * a separate DLL. * * Copyright (c) 1997 by Sun Microsystems, Inc. * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include "tclInt.h" #ifdef _MSC_VER # pragma comment (lib, "advapi32.lib") #endif #include #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * Ensure that we can say which registry is being accessed. */ #ifndef KEY_WOW64_64KEY # define KEY_WOW64_64KEY (0x0100) #endif #ifndef KEY_WOW64_32KEY # define KEY_WOW64_32KEY (0x0200) #endif /* * The maximum length of a sub-key name. */ #ifndef MAX_KEY_LENGTH # define MAX_KEY_LENGTH 256 #endif /* * The following macros convert between different endian ints. */ #define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) #define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x))) /* * The following flag is used in OpenKeys to indicate that the specified key * should be created if it doesn't currently exist. */ enum OpenKeysFlags { REG_CREATE = 1 }; /* * The following tables contain the mapping from registry root names to the * system predefined keys. */ static const char *const rootKeyNames[] = { "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT", "HKEY_CURRENT_USER", "HKEY_CURRENT_CONFIG", "HKEY_PERFORMANCE_DATA", "HKEY_DYN_DATA", NULL }; static const HKEY rootKeys[] = { HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, HKEY_DYN_DATA }; static const char REGISTRY_ASSOC_KEY[] = "registry::command"; /* * The following table maps from registry types to strings. Note that the * indices for this array are the same as the constants for the known registry * types so we don't need a separate table to hold the mapping. */ static const char *const typeNames[] = { "none", "sz", "expand_sz", "binary", "dword", "dword_big_endian", "link", "multi_sz", "resource_list", NULL }; static DWORD lastType = REG_RESOURCE_LIST; #if TCL_MAJOR_VERSION < 9 # if TCL_UTF_MAX > 3 # define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c) # define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c) # else # define Tcl_WCharToUtfDString(a,b,c) Tcl_UniCharToUtfDString((Tcl_UniChar *)(a),b,c) # define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_UtfToUniCharDString(a,b,c) # endif #ifndef Tcl_Size # define Tcl_Size int #endif #ifndef Tcl_CreateObjCommand2 # define Tcl_CreateObjCommand2 Tcl_CreateObjCommand #endif #endif /* * Declarations for functions defined in this file. */ static void AppendSystemError(Tcl_Interp *interp, DWORD error); static int BroadcastValue(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static DWORD ConvertDWORD(DWORD type, DWORD value); static void DeleteCmd(void *clientData); static int DeleteKey(Tcl_Interp *interp, Tcl_Obj *keyNameObj, REGSAM mode); static int DeleteValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, REGSAM mode); static int GetKeyNames(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *patternObj, REGSAM mode); static int GetType(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, REGSAM mode); static int GetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, REGSAM mode); static int GetValueNames(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *patternObj, REGSAM mode); static int OpenKey(Tcl_Interp *interp, Tcl_Obj *keyNameObj, REGSAM mode, int flags, HKEY *keyPtr); static DWORD OpenSubKey(char *hostName, HKEY rootKey, char *keyName, REGSAM mode, int flags, HKEY *keyPtr); static int ParseKeyName(Tcl_Interp *interp, char *name, char **hostNamePtr, HKEY *rootKeyPtr, char **keyNamePtr); static DWORD RecursiveDeleteKey(HKEY hStartKey, const WCHAR * pKeyName, REGSAM mode); static int RegistryObjCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, Tcl_Obj *dataObj, Tcl_Obj *typeObj, REGSAM mode); #ifdef __cplusplus extern "C" { #endif DLLEXPORT int Registry_Init(Tcl_Interp *interp); DLLEXPORT int Registry_Unload(Tcl_Interp *interp, int flags); #if TCL_MAJOR_VERSION < 9 /* With those additional entries, "load tclregistry13.dll" works without 3th argument */ DLLEXPORT int Tclregistry_Init(Tcl_Interp *interp); DLLEXPORT int Tclregistry_Unload(Tcl_Interp *interp, int flags); #endif #ifdef __cplusplus } #endif /* *---------------------------------------------------------------------- * * Registry_Init -- * * This function initializes the registry command. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Registry_Init( Tcl_Interp *interp) { Tcl_Command cmd; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } cmd = Tcl_CreateObjCommand2(interp, "registry", RegistryObjCmd, interp, DeleteCmd); Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, cmd); return Tcl_PkgProvideEx(interp, "registry", "1.3.7", NULL); } #if TCL_MAJOR_VERSION < 9 int Tclregistry_Init( Tcl_Interp *interp) { return Registry_Init(interp); } #endif /* *---------------------------------------------------------------------- * * Registry_Unload -- * * This function removes the registry command. * * Results: * A standard Tcl result. * * Side effects: * The registry command is deleted and the dll may be unloaded. * *---------------------------------------------------------------------- */ int Registry_Unload( Tcl_Interp *interp, /* Interpreter for unloading */ int flags) /* Flags passed by the unload system */ { Tcl_Command cmd; Tcl_Obj *objv[3]; (void)flags; /* * Unregister the registry package. There is no Tcl_PkgForget() */ objv[0] = Tcl_NewStringObj("package", -1); objv[1] = Tcl_NewStringObj("forget", -1); objv[2] = Tcl_NewStringObj("registry", -1); Tcl_EvalObjv(interp, 3, objv, TCL_EVAL_GLOBAL); /* * Delete the originally registered command. */ cmd = (Tcl_Command)Tcl_GetAssocData(interp, REGISTRY_ASSOC_KEY, NULL); if (cmd != NULL) { Tcl_DeleteCommandFromToken(interp, cmd); } return TCL_OK; } #if TCL_MAJOR_VERSION < 9 int Tclregistry_Unload( Tcl_Interp *interp, int flags) { return Registry_Unload(interp, flags); } #endif /* *---------------------------------------------------------------------- * * DeleteCmd -- * * Cleanup the interp command token so that unloading doesn't try to * re-delete the command (which will crash). * * Results: * None. * * Side effects: * The unload command will not attempt to delete this command. * *---------------------------------------------------------------------- */ static void DeleteCmd( void *clientData) { Tcl_Interp *interp = (Tcl_Interp *)clientData; Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, NULL); } /* *---------------------------------------------------------------------- * * RegistryObjCmd -- * * This function implements the Tcl "registry" command. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int RegistryObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tcl_Size n = 1, argc; int index; REGSAM mode = 0; const char *errString = NULL; static const char *const subcommands[] = { "broadcast", "delete", "get", "keys", "set", "type", "values", NULL }; enum SubCmdIdx { BroadcastIdx, DeleteIdx, GetIdx, KeysIdx, SetIdx, TypeIdx, ValuesIdx }; static const char *const modes[] = { "-32bit", "-64bit", NULL }; (void)dummy; if (objc < 2) { wrongArgs: Tcl_WrongNumArgs(interp, 1, objv, "?-32bit|-64bit? option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetString(objv[n])[0] == '-') { if (Tcl_GetIndexFromObj(interp, objv[n++], modes, "mode", 0, &index) != TCL_OK) { return TCL_ERROR; } switch (index) { case 0: /* -32bit */ mode |= KEY_WOW64_32KEY; break; case 1: /* -64bit */ mode |= KEY_WOW64_64KEY; break; } if (objc < 3) { goto wrongArgs; } } if (Tcl_GetIndexFromObj(interp, objv[n++], subcommands, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } argc = (objc - n); switch (index) { case BroadcastIdx: /* broadcast */ if (argc == 1 || argc == 3) { int res = BroadcastValue(interp, argc, objv + n); if (res != TCL_BREAK) { return res; } } errString = "keyName ?-timeout milliseconds?"; break; case DeleteIdx: /* delete */ if (argc == 1) { return DeleteKey(interp, objv[n], mode); } else if (argc == 2) { return DeleteValue(interp, objv[n], objv[n+1], mode); } errString = "keyName ?valueName?"; break; case GetIdx: /* get */ if (argc == 2) { return GetValue(interp, objv[n], objv[n+1], mode); } errString = "keyName valueName"; break; case KeysIdx: /* keys */ if (argc == 1) { return GetKeyNames(interp, objv[n], NULL, mode); } else if (argc == 2) { return GetKeyNames(interp, objv[n], objv[n+1], mode); } errString = "keyName ?pattern?"; break; case SetIdx: /* set */ if (argc == 1) { HKEY key; /* * Create the key and then close it immediately. */ mode |= KEY_ALL_ACCESS; if (OpenKey(interp, objv[n], mode, REG_CREATE, &key) != TCL_OK) { return TCL_ERROR; } RegCloseKey(key); return TCL_OK; } else if (argc == 3) { return SetValue(interp, objv[n], objv[n+1], objv[n+2], NULL, mode); } else if (argc == 4) { return SetValue(interp, objv[n], objv[n+1], objv[n+2], objv[n+3], mode); } errString = "keyName ?valueName data ?type??"; break; case TypeIdx: /* type */ if (argc == 2) { return GetType(interp, objv[n], objv[n+1], mode); } errString = "keyName valueName"; break; case ValuesIdx: /* values */ if (argc == 1) { return GetValueNames(interp, objv[n], NULL, mode); } else if (argc == 2) { return GetValueNames(interp, objv[n], objv[n+1], mode); } errString = "keyName ?pattern?"; break; } Tcl_WrongNumArgs(interp, (mode ? 3 : 2), objv, errString); return TCL_ERROR; } /* *---------------------------------------------------------------------- * * DeleteKey -- * * This function deletes a registry key. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int DeleteKey( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Name of key to delete. */ REGSAM mode) /* Mode flags to pass. */ { char *tail, *buffer, *hostName, *keyName; const WCHAR *nativeTail; HKEY rootKey, subkey; DWORD result; Tcl_DString buf; REGSAM saveMode = mode; Tcl_Size len; /* * Find the parent of the key being deleted and open it. */ keyName = Tcl_GetStringFromObj(keyNameObj, &len); buffer = (char *)Tcl_Alloc(len + 1); strcpy(buffer, keyName); if (ParseKeyName(interp, buffer, &hostName, &rootKey, &keyName) != TCL_OK) { Tcl_Free(buffer); return TCL_ERROR; } if (*keyName == '\0') { Tcl_SetObjResult(interp, Tcl_NewStringObj("bad key: cannot delete root keys", -1)); Tcl_SetErrorCode(interp, "WIN_REG", "DEL_ROOT_KEY", (char *)NULL); Tcl_Free(buffer); return TCL_ERROR; } tail = strrchr(keyName, '\\'); if (tail) { *tail++ = '\0'; } else { tail = keyName; keyName = NULL; } mode |= KEY_ENUMERATE_SUB_KEYS | DELETE; result = OpenSubKey(hostName, rootKey, keyName, mode, 0, &subkey); if (result != ERROR_SUCCESS) { Tcl_Free(buffer); if (result == ERROR_FILE_NOT_FOUND) { return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to delete key: ", -1)); AppendSystemError(interp, result); return TCL_ERROR; } /* * Now we recursively delete the key and everything below it. */ Tcl_DStringInit(&buf); nativeTail = Tcl_UtfToWCharDString(tail, -1, &buf); result = RecursiveDeleteKey(subkey, nativeTail, saveMode); Tcl_DStringFree(&buf); if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) { Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to delete key: ", -1)); AppendSystemError(interp, result); result = TCL_ERROR; } else { result = TCL_OK; } RegCloseKey(subkey); Tcl_Free(buffer); return result; } /* *---------------------------------------------------------------------- * * DeleteValue -- * * This function deletes a value from a registry key. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int DeleteValue( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Name of key. */ Tcl_Obj *valueNameObj, /* Name of value to delete. */ REGSAM mode) /* Mode flags to pass. */ { HKEY key; char *valueName; DWORD result; Tcl_DString ds; Tcl_Size len; /* * Attempt to open the key for deletion. */ mode |= KEY_SET_VALUE; if (OpenKey(interp, keyNameObj, mode, 0, &key) != TCL_OK) { return TCL_ERROR; } valueName = Tcl_GetStringFromObj(valueNameObj, &len); Tcl_DStringInit(&ds); Tcl_UtfToWCharDString(valueName, len, &ds); result = RegDeleteValueW(key, (const WCHAR *)Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); if (result != ERROR_SUCCESS) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unable to delete value \"%s\" from key \"%s\": ", Tcl_GetString(valueNameObj), Tcl_GetString(keyNameObj))); AppendSystemError(interp, result); result = TCL_ERROR; } else { result = TCL_OK; } RegCloseKey(key); return result; } /* *---------------------------------------------------------------------- * * GetKeyNames -- * * This function enumerates the subkeys of a given key. If the optional * pattern is supplied, then only keys that match the pattern will be * returned. * * Results: * Returns the list of subkeys in the result object of the interpreter, * or an error message on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int GetKeyNames( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Key to enumerate. */ Tcl_Obj *patternObj, /* Optional match pattern. */ REGSAM mode) /* Mode flags to pass. */ { const char *pattern; /* Pattern being matched against subkeys */ HKEY key; /* Handle to the key being examined */ WCHAR buffer[MAX_KEY_LENGTH]; /* Buffer to hold the subkey name */ DWORD bufSize; /* Size of the buffer */ DWORD index; /* Position of the current subkey */ char *name; /* Subkey name */ Tcl_Obj *resultPtr; /* List of subkeys being accumulated */ int result = TCL_OK; /* Return value from this command */ Tcl_DString ds; /* Buffer to translate subkey name to UTF-8 */ if (patternObj) { pattern = Tcl_GetString(patternObj); } else { pattern = NULL; } /* * Attempt to open the key for enumeration. */ mode |= KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS; if (OpenKey(interp, keyNameObj, mode, 0, &key) != TCL_OK) { return TCL_ERROR; } /* * Enumerate the subkeys. */ resultPtr = Tcl_NewObj(); for (index = 0;; ++index) { bufSize = MAX_KEY_LENGTH; result = RegEnumKeyExW(key, index, buffer, &bufSize, NULL, NULL, NULL, NULL); if (result != ERROR_SUCCESS) { if (result == ERROR_NO_MORE_ITEMS) { result = TCL_OK; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unable to enumerate subkeys of \"%s\": ", Tcl_GetString(keyNameObj))); AppendSystemError(interp, result); result = TCL_ERROR; } break; } Tcl_DStringInit(&ds); name = Tcl_WCharToUtfDString(buffer, bufSize, &ds); if (pattern && !Tcl_StringMatch(name, pattern)) { Tcl_DStringFree(&ds); continue; } result = Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(name, Tcl_DStringLength(&ds))); Tcl_DStringFree(&ds); if (result != TCL_OK) { break; } } if (result == TCL_OK) { Tcl_SetObjResult(interp, resultPtr); } else { Tcl_DecrRefCount(resultPtr); /* BUGFIX: Don't leak on failure. */ } RegCloseKey(key); return result; } /* *---------------------------------------------------------------------- * * GetType -- * * This function gets the type of a given registry value and places it in * the interpreter result. * * Results: * Returns a normal Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int GetType( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Name of key. */ Tcl_Obj *valueNameObj, /* Name of value to get. */ REGSAM mode) /* Mode flags to pass. */ { HKEY key; DWORD result, type; Tcl_DString ds; const char *valueName; const WCHAR *nativeValue; Tcl_Size len; /* * Attempt to open the key for reading. */ mode |= KEY_QUERY_VALUE; if (OpenKey(interp, keyNameObj, mode, 0, &key) != TCL_OK) { return TCL_ERROR; } /* * Get the type of the value. */ valueName = Tcl_GetStringFromObj(valueNameObj, &len); Tcl_DStringInit(&ds); nativeValue = Tcl_UtfToWCharDString(valueName, len, &ds); result = RegQueryValueExW(key, nativeValue, NULL, &type, NULL, NULL); Tcl_DStringFree(&ds); RegCloseKey(key); if (result != ERROR_SUCCESS) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unable to get type of value \"%s\" from key \"%s\": ", Tcl_GetString(valueNameObj), Tcl_GetString(keyNameObj))); AppendSystemError(interp, result); return TCL_ERROR; } /* * Set the type into the result. Watch out for unknown types. If we don't * know about the type, just use the numeric value. */ if (type > lastType) { Tcl_SetObjResult(interp, Tcl_NewIntObj((int) type)); } else { Tcl_SetObjResult(interp, Tcl_NewStringObj(typeNames[type], -1)); } return TCL_OK; } /* *---------------------------------------------------------------------- * * GetValue -- * * This function gets the contents of a registry value and places a list * containing the data and the type in the interpreter result. * * Results: * Returns a normal Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int GetValue( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Name of key. */ Tcl_Obj *valueNameObj, /* Name of value to get. */ REGSAM mode) /* Mode flags to pass. */ { HKEY key; const char *valueName; const WCHAR *nativeValue; DWORD result, type, length; Tcl_DString data, buf; Tcl_Size len; /* * Attempt to open the key for reading. */ mode |= KEY_QUERY_VALUE; if (OpenKey(interp, keyNameObj, mode, 0, &key) != TCL_OK) { return TCL_ERROR; } /* * Initialize a Dstring to maximum statically allocated size we could get * one more byte by avoiding Tcl_DStringSetLength() and just setting * length to TCL_DSTRING_STATIC_SIZE, but this should be safer if the * implementation of Dstrings changes. * * This allows short values to be read from the registry in one call. * Longer values need a second call with an expanded DString. */ Tcl_DStringInit(&data); Tcl_DStringSetLength(&data, TCL_DSTRING_STATIC_SIZE - 1); length = TCL_DSTRING_STATIC_SIZE/sizeof(WCHAR) - 1; valueName = Tcl_GetStringFromObj(valueNameObj, &len); Tcl_DStringInit(&buf); nativeValue = Tcl_UtfToWCharDString(valueName, len, &buf); result = RegQueryValueExW(key, nativeValue, NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length); while (result == ERROR_MORE_DATA) { /* * The Windows docs say that in this error case, we just need to * expand our buffer and request more data. Required for * HKEY_PERFORMANCE_DATA */ length = (DWORD)(Tcl_DStringLength(&data) * (2 / sizeof(WCHAR))); Tcl_DStringSetLength(&data, length * sizeof(WCHAR)); result = RegQueryValueExW(key, nativeValue, NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length); } Tcl_DStringFree(&buf); RegCloseKey(key); if (result != ERROR_SUCCESS) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unable to get value \"%s\" from key \"%s\": ", Tcl_GetString(valueNameObj), Tcl_GetString(keyNameObj))); AppendSystemError(interp, result); Tcl_DStringFree(&data); return TCL_ERROR; } /* * If the data is a 32-bit quantity, store it as an integer object. If it * is a multi-string, store it as a list of strings. For null-terminated * strings, append up the to first null. Otherwise, store it as a binary * string. */ if (type == REG_DWORD || type == REG_DWORD_BIG_ENDIAN) { Tcl_SetObjResult(interp, Tcl_NewIntObj((int) ConvertDWORD(type, *((DWORD *) Tcl_DStringValue(&data))))); } else if (type == REG_MULTI_SZ) { char *p = Tcl_DStringValue(&data); char *end = Tcl_DStringValue(&data) + length; Tcl_Obj *resultPtr = Tcl_NewObj(); /* * Multistrings are stored as an array of null-terminated strings, * terminated by two null characters. Also do a bounds check in case * we get bogus data. */ while ((p < end) && *((WCHAR *) p) != 0) { WCHAR *wp = (WCHAR *) p; Tcl_DStringInit(&buf); Tcl_WCharToUtfDString(wp, wcslen(wp), &buf); Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(Tcl_DStringValue(&buf), Tcl_DStringLength(&buf))); while (*wp++ != 0); /* empty loop body */ p = (char *) wp; Tcl_DStringFree(&buf); } Tcl_SetObjResult(interp, resultPtr); } else if ((type == REG_SZ) || (type == REG_EXPAND_SZ)) { WCHAR *wp = (WCHAR *) Tcl_DStringValue(&data); Tcl_DStringInit(&buf); Tcl_WCharToUtfDString((const WCHAR *)Tcl_DStringValue(&data), wcslen(wp), &buf); Tcl_DStringResult(interp, &buf); } else { /* * Save binary data as a byte array. */ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( (BYTE *) Tcl_DStringValue(&data), length)); } Tcl_DStringFree(&data); return result; } /* *---------------------------------------------------------------------- * * GetValueNames -- * * This function enumerates the values of the given key. If the * optional pattern is supplied, then only value names that match the * pattern will be returned. * * Results: * Returns the list of value names in the result object of the * interpreter, or an error message on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int GetValueNames( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Key to enumerate. */ Tcl_Obj *patternObj, /* Optional match pattern. */ REGSAM mode) /* Mode flags to pass. */ { HKEY key; Tcl_Obj *resultPtr; DWORD index, size, result; Tcl_DString buffer, ds; const char *pattern, *name; /* * Attempt to open the key for enumeration. */ mode |= KEY_QUERY_VALUE; if (OpenKey(interp, keyNameObj, mode, 0, &key) != TCL_OK) { return TCL_ERROR; } resultPtr = Tcl_NewObj(); Tcl_DStringInit(&buffer); Tcl_DStringSetLength(&buffer, MAX_KEY_LENGTH * sizeof(WCHAR)); index = 0; result = TCL_OK; if (patternObj) { pattern = Tcl_GetString(patternObj); } else { pattern = NULL; } /* * Enumerate the values under the given subkey until we get an error, * indicating the end of the list. Note that we need to reset size after * each iteration because RegEnumValue smashes the old value. */ size = MAX_KEY_LENGTH; while (RegEnumValueW(key,index, (WCHAR *)Tcl_DStringValue(&buffer), &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { Tcl_DStringInit(&ds); Tcl_WCharToUtfDString((const WCHAR *)Tcl_DStringValue(&buffer), size, &ds); name = Tcl_DStringValue(&ds); if (!pattern || Tcl_StringMatch(name, pattern)) { result = Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(name, Tcl_DStringLength(&ds))); if (result != TCL_OK) { Tcl_DStringFree(&ds); break; } } Tcl_DStringFree(&ds); index++; size = MAX_KEY_LENGTH; } Tcl_SetObjResult(interp, resultPtr); Tcl_DStringFree(&buffer); RegCloseKey(key); return result; } /* *---------------------------------------------------------------------- * * OpenKey -- * * This function opens the specified key. This function is a simple * wrapper around ParseKeyName and OpenSubKey. * * Results: * Returns the opened key in the keyPtr argument and a Tcl result code. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int OpenKey( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Key to open. */ REGSAM mode, /* Access mode. */ int flags, /* 0 or REG_CREATE. */ HKEY *keyPtr) /* Returned HKEY. */ { char *keyName, *buffer, *hostName; HKEY rootKey; DWORD result; Tcl_Size len; keyName = Tcl_GetStringFromObj(keyNameObj, &len); buffer = (char *)Tcl_Alloc(len + 1); strcpy(buffer, keyName); result = ParseKeyName(interp, buffer, &hostName, &rootKey, &keyName); if (result == TCL_OK) { result = OpenSubKey(hostName, rootKey, keyName, mode, flags, keyPtr); if (result != ERROR_SUCCESS) { Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to open key: ", -1)); AppendSystemError(interp, result); result = TCL_ERROR; } else { result = TCL_OK; } } Tcl_Free(buffer); return result; } /* *---------------------------------------------------------------------- * * OpenSubKey -- * * Opens a given subkey of the given root key on the specified * host. * * Results: * Returns the opened key in the keyPtr and a Windows error code as the * return value. * * Side effects: * None. * *---------------------------------------------------------------------- */ static DWORD OpenSubKey( char *hostName, /* Host to access, or NULL for local. */ HKEY rootKey, /* Root registry key. */ char *keyName, /* Subkey name. */ REGSAM mode, /* Access mode. */ int flags, /* 0 or REG_CREATE. */ HKEY *keyPtr) /* Returned HKEY. */ { DWORD result; Tcl_DString buf; /* * Attempt to open the root key on a remote host if necessary. */ if (hostName) { Tcl_DStringInit(&buf); hostName = (char *) Tcl_UtfToWCharDString(hostName, -1, &buf); result = RegConnectRegistryW((WCHAR *)hostName, rootKey, &rootKey); Tcl_DStringFree(&buf); if (result != ERROR_SUCCESS) { return result; } } /* * Now open the specified key with the requested permissions. Note that * this key must be closed by the caller. */ if (keyName) { Tcl_DStringInit(&buf); keyName = (char *) Tcl_UtfToWCharDString(keyName, -1, &buf); } if (flags & REG_CREATE) { DWORD create; result = RegCreateKeyExW(rootKey, (WCHAR *)keyName, 0, NULL, REG_OPTION_NON_VOLATILE, mode, NULL, keyPtr, &create); } else if (rootKey == HKEY_PERFORMANCE_DATA) { /* * Here we fudge it for this special root key. See MSDN for more info * on HKEY_PERFORMANCE_DATA and the peculiarities surrounding it. */ *keyPtr = HKEY_PERFORMANCE_DATA; result = ERROR_SUCCESS; } else { result = RegOpenKeyExW(rootKey, (WCHAR *)keyName, 0, mode, keyPtr); } if (keyName) { Tcl_DStringFree(&buf); } /* * Be sure to close the root key since we are done with it now. */ if (hostName) { RegCloseKey(rootKey); } return result; } /* *---------------------------------------------------------------------- * * ParseKeyName -- * * Parses a key name into the host, root, and subkey parts. * * Results: * The pointers to the start of the host and subkey names are returned in * the hostNamePtr and keyNamePtr variables. The specified root HKEY is * returned in rootKeyPtr. Returns a standard Tcl result. * * Side effects: * Modifies the name string by inserting nulls. * *---------------------------------------------------------------------- */ static int ParseKeyName( Tcl_Interp *interp, /* Current interpreter. */ char *name, char **hostNamePtr, HKEY *rootKeyPtr, char **keyNamePtr) { char *rootName; int result, index; Tcl_Obj *rootObj; /* * Split the key into host and root portions. */ *hostNamePtr = *keyNamePtr = rootName = NULL; if (name[0] == '\\') { if (name[1] == '\\') { *hostNamePtr = name; for (rootName = name+2; *rootName != '\0'; rootName++) { if (*rootName == '\\') { *rootName++ = '\0'; break; } } } } else { rootName = name; } if (!rootName) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad key \"%s\": must start with a valid root", name)); Tcl_SetErrorCode(interp, "WIN_REG", "NO_ROOT_KEY", (char *)NULL); return TCL_ERROR; } /* * Split the root into root and subkey portions. */ for (*keyNamePtr = rootName; **keyNamePtr != '\0'; (*keyNamePtr)++) { if (**keyNamePtr == '\\') { **keyNamePtr = '\0'; (*keyNamePtr)++; break; } } /* * Look for a matching root name. */ rootObj = Tcl_NewStringObj(rootName, -1); result = Tcl_GetIndexFromObj(interp, rootObj, rootKeyNames, "root name", TCL_EXACT, &index); Tcl_DecrRefCount(rootObj); if (result != TCL_OK) { return TCL_ERROR; } *rootKeyPtr = rootKeys[index]; return TCL_OK; } /* *---------------------------------------------------------------------- * * RecursiveDeleteKey -- * * This function recursively deletes all the keys below a starting key. * Although Windows 95 does this automatically, we still need to do this * for Windows NT. * * Results: * Returns a Windows error code. * * Side effects: * Deletes all of the keys and values below the given key. * *---------------------------------------------------------------------- */ static DWORD RecursiveDeleteKey( HKEY startKey, /* Parent of key to be deleted. */ const WCHAR *keyName, /* Name of key to be deleted in external * encoding, not UTF. */ REGSAM mode) /* Mode flags to pass. */ { DWORD result, size; Tcl_DString subkey; HKEY hKey; REGSAM saveMode = mode; static int checkExProc = 0; typedef LONG (* regDeleteKeyExProc) (HKEY, LPCWSTR, REGSAM, DWORD); static regDeleteKeyExProc regDeleteKeyEx = (regDeleteKeyExProc) NULL; /* Really RegDeleteKeyExW() but that's not * available on all versions of Windows * supported by Tcl. */ /* * Do not allow NULL or empty key name. */ if (!keyName || *keyName == '\0') { return ERROR_BADKEY; } mode |= KEY_ENUMERATE_SUB_KEYS | DELETE | KEY_QUERY_VALUE; result = RegOpenKeyExW(startKey, keyName, 0, mode, &hKey); if (result != ERROR_SUCCESS) { return result; } Tcl_DStringInit(&subkey); Tcl_DStringSetLength(&subkey, MAX_KEY_LENGTH * sizeof(WCHAR)); mode = saveMode; while (result == ERROR_SUCCESS) { /* * Always get index 0 because key deletion changes ordering. */ size = MAX_KEY_LENGTH; result = RegEnumKeyExW(hKey, 0, (WCHAR *)Tcl_DStringValue(&subkey), &size, NULL, NULL, NULL, NULL); if (result == ERROR_NO_MORE_ITEMS) { /* * RegDeleteKeyEx doesn't exist on non-64bit XP platforms, so we * can't compile with it in. We need to check for it at runtime * and use it if we find it. */ if (mode && !checkExProc) { HMODULE handle; checkExProc = 1; handle = GetModuleHandleW(L"ADVAPI32"); regDeleteKeyEx = (regDeleteKeyExProc) (void *) GetProcAddress(handle, "RegDeleteKeyExW"); } if (mode && regDeleteKeyEx) { result = regDeleteKeyEx(startKey, keyName, mode, 0); } else { result = RegDeleteKeyW(startKey, keyName); } break; } else if (result == ERROR_SUCCESS) { result = RecursiveDeleteKey(hKey, (const WCHAR *) Tcl_DStringValue(&subkey), mode); } } Tcl_DStringFree(&subkey); RegCloseKey(hKey); return result; } /* *---------------------------------------------------------------------- * * SetValue -- * * This function sets the contents of a registry value. If the key or * value does not exist, it will be created. If it does exist, then the * data and type will be replaced. * * Results: * Returns a normal Tcl result. * * Side effects: * May create new keys or values. * *---------------------------------------------------------------------- */ static int SetValue( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Obj *keyNameObj, /* Name of key. */ Tcl_Obj *valueNameObj, /* Name of value to set. */ Tcl_Obj *dataObj, /* Data to be written. */ Tcl_Obj *typeObj, /* Type of data to be written. */ REGSAM mode) /* Mode flags to pass. */ { int type; DWORD result; HKEY key; const char *valueName; Tcl_DString nameBuf; Tcl_Size len; if (typeObj == NULL) { type = REG_SZ; } else if (Tcl_GetIndexFromObj(interp, typeObj, typeNames, "type", 0, (int *) &type) != TCL_OK) { if (Tcl_GetIntFromObj(NULL, typeObj, (int *) &type) != TCL_OK) { return TCL_ERROR; } Tcl_ResetResult(interp); } mode |= KEY_ALL_ACCESS; if (OpenKey(interp, keyNameObj, mode, REG_CREATE, &key) != TCL_OK) { return TCL_ERROR; } valueName = Tcl_GetStringFromObj(valueNameObj, &len); Tcl_DStringInit(&nameBuf); valueName = (char *) Tcl_UtfToWCharDString(valueName, len, &nameBuf); if (type == REG_DWORD || type == REG_DWORD_BIG_ENDIAN) { int value; if (Tcl_GetIntFromObj(interp, dataObj, &value) != TCL_OK) { RegCloseKey(key); Tcl_DStringFree(&nameBuf); return TCL_ERROR; } value = ConvertDWORD((DWORD) type, (DWORD) value); result = RegSetValueExW(key, (WCHAR *) valueName, 0, (DWORD) type, (BYTE *) &value, sizeof(DWORD)); } else if (type == REG_MULTI_SZ) { Tcl_DString data, buf; Tcl_Size objc, i; Tcl_Obj **objv; if (Tcl_ListObjGetElements(interp, dataObj, &objc, &objv) != TCL_OK) { RegCloseKey(key); Tcl_DStringFree(&nameBuf); return TCL_ERROR; } /* * Append the elements as null terminated strings. Note that we must * not assume the length of the string in case there are embedded * nulls, which aren't allowed in REG_MULTI_SZ values. */ Tcl_DStringInit(&data); for (i = 0; i < objc; i++) { const char *bytes = Tcl_GetStringFromObj(objv[i], &len); Tcl_DStringAppend(&data, bytes, len); /* * Add a null character to separate this value from the next. */ Tcl_DStringAppend(&data, "", 1); /* NUL-terminated string */ } Tcl_DStringInit(&buf); Tcl_UtfToWCharDString(Tcl_DStringValue(&data), Tcl_DStringLength(&data)+1, &buf); result = RegSetValueExW(key, (WCHAR *) valueName, 0, (DWORD) type, (BYTE *) Tcl_DStringValue(&buf), (DWORD) Tcl_DStringLength(&buf)); Tcl_DStringFree(&data); Tcl_DStringFree(&buf); } else if (type == REG_SZ || type == REG_EXPAND_SZ) { Tcl_DString buf; const char *data = Tcl_GetStringFromObj(dataObj, &len); Tcl_DStringInit(&buf); data = (char *) Tcl_UtfToWCharDString(data, len, &buf); /* * Include the null in the length, padding if needed for WCHAR. */ Tcl_DStringSetLength(&buf, Tcl_DStringLength(&buf)+1); result = RegSetValueExW(key, (WCHAR *) valueName, 0, (DWORD) type, (BYTE *) data, (DWORD) Tcl_DStringLength(&buf) + 1); Tcl_DStringFree(&buf); } else { BYTE *data; Tcl_Size bytelength; /* * Store binary data in the registry. */ data = (BYTE *) Tcl_GetByteArrayFromObj(dataObj, &bytelength); result = RegSetValueExW(key, (WCHAR *) valueName, 0, (DWORD) type, data, (DWORD) bytelength); } Tcl_DStringFree(&nameBuf); RegCloseKey(key); if (result != ERROR_SUCCESS) { Tcl_SetObjResult(interp, Tcl_NewStringObj("unable to set value: ", -1)); AppendSystemError(interp, result); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * BroadcastValue -- * * This function broadcasts a WM_SETTINGCHANGE message to indicate to * other programs that we have changed the contents of a registry value. * * Results: * Returns a normal Tcl result. * * Side effects: * Will cause other programs to reload their system settings. * *---------------------------------------------------------------------- */ static int BroadcastValue( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { LRESULT result; DWORD_PTR sendResult; int timeout = 3000; Tcl_Size len; const char *str; Tcl_Obj *objPtr; WCHAR *wstr; Tcl_DString ds; if (objc == 3) { str = Tcl_GetStringFromObj(objv[1], &len); if ((len < 2) || (*str != '-') || strncmp(str, "-timeout", len)) { return TCL_BREAK; } if (Tcl_GetIntFromObj(interp, objv[2], &timeout) != TCL_OK) { return TCL_ERROR; } } str = Tcl_GetStringFromObj(objv[0], &len); Tcl_DStringInit(&ds); wstr = Tcl_UtfToWCharDString(str, len, &ds); if (Tcl_DStringLength(&ds) == 0) { wstr = NULL; } /* * Use the ignore the result. */ result = SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM) 0, (LPARAM) wstr, SMTO_ABORTIFHUNG, (UINT) timeout, &sendResult); Tcl_DStringFree(&ds); objPtr = Tcl_NewObj(); Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewWideIntObj((Tcl_WideInt) result)); Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewWideIntObj((Tcl_WideInt) sendResult)); Tcl_SetObjResult(interp, objPtr); return TCL_OK; } /* *---------------------------------------------------------------------- * * AppendSystemError -- * * Formats a Windows system error message and places it into * the interpreter result. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AppendSystemError( Tcl_Interp *interp, /* Current interpreter. */ DWORD error) /* Result code from error. */ { Tcl_Size length; WCHAR *tMsgPtr, **tMsgPtrPtr = &tMsgPtr; const char *msg; char id[TCL_INTEGER_SPACE], msgBuf[24 + TCL_INTEGER_SPACE]; Tcl_DString ds; Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); if (Tcl_IsShared(resultPtr)) { resultPtr = Tcl_DuplicateObj(resultPtr); } length = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) tMsgPtrPtr, 0, NULL); if (length == 0) { snprintf(msgBuf, sizeof(msgBuf), "unknown error: %ld", error); msg = msgBuf; } else { char *msgPtr; Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(tMsgPtr, wcslen(tMsgPtr), &ds); LocalFree(tMsgPtr); msgPtr = Tcl_DStringValue(&ds); length = Tcl_DStringLength(&ds); /* * Trim the trailing CR/LF from the system message. */ if (msgPtr[length-1] == '\n') { --length; } if (msgPtr[length-1] == '\r') { --length; } msgPtr[length] = 0; msg = msgPtr; } snprintf(id, sizeof(id), "%ld", error); Tcl_SetErrorCode(interp, "WINDOWS", id, msg, (char *)NULL); Tcl_AppendToObj(resultPtr, msg, length); Tcl_SetObjResult(interp, resultPtr); if (length != 0) { Tcl_DStringFree(&ds); } } /* *---------------------------------------------------------------------- * * ConvertDWORD -- * * Determines whether a DWORD needs to be byte swapped, and * returns the appropriately swapped value. * * Results: * Returns a converted DWORD. * * Side effects: * None. * *---------------------------------------------------------------------- */ static DWORD ConvertDWORD( DWORD type, /* Either REG_DWORD or REG_DWORD_BIG_ENDIAN */ DWORD value) /* The value to be converted. */ { const DWORD order = 1; DWORD localType; /* * Check to see if the low bit is in the first byte. */ localType = (*((const char *) &order) == 1) ? REG_DWORD : REG_DWORD_BIG_ENDIAN; return (type != localType) ? (DWORD) SWAPLONG(value) : value; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinPort.h0000644000175000017500000003202015104661342014620 0ustar sergeisergei/* * tclWinPort.h -- * * This header file handles porting issues that occur because of * differences between Windows and Unix. It should be the only * file that contains #ifdefs to handle different flavors of OS. * * Copyright (c) 1994-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. */ #ifndef _TCLWINPORT #define _TCLWINPORT #if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT) /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT #endif #if defined(_MSC_VER) && defined(_WIN64) && !defined(STATIC_BUILD) \ && !defined(MP_32BIT) && !defined(MP_64BIT) # define MP_64BIT #endif /* * We must specify the lower version we intend to support. * * WINVER = 0x0601 means Windows 7 and above */ #ifndef WINVER # define WINVER 0x0601 #endif #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0601 #endif #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN /* Compatibility to older visual studio / windows platform SDK */ #if !defined(MAXULONG_PTR) typedef DWORD DWORD_PTR; typedef DWORD_PTR * PDWORD_PTR; #endif /* * Ask for the winsock function typedefs, also. */ #ifndef INCL_WINSOCK_API_TYPEDEFS # define INCL_WINSOCK_API_TYPEDEFS 1 #endif #include #include #ifdef HAVE_WSPIAPI_H # include #endif /* * Pull in the typedef of TCHAR for windows. */ #include #ifndef _TCHAR_DEFINED /* Borland seems to forget to set this. */ typedef _TCHAR TCHAR; # define _TCHAR_DEFINED #endif #if defined(_MSC_VER) && defined(__STDC__) /* VS2005 SP1 misses this. See [Bug #3110161] */ typedef _TCHAR TCHAR; #endif /* *--------------------------------------------------------------------------- * The following sets of #includes and #ifdefs are required to get Tcl to * compile under the windows compilers. *--------------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_INTTYPES_H # include #endif #include #ifndef __GNUC__ # define strncasecmp _strnicmp # define strcasecmp _stricmp #endif /* * Need to block out these includes for building extensions with MetroWerks * compiler for Win32. */ #ifndef __MWERKS__ #include #include #include #endif /* __MWERKS__ */ /* * The following defines redefine the Windows Socket errors as * BSD errors so Tcl_PosixError can do the right thing. */ #ifndef ENOTEMPTY # define ENOTEMPTY 41 /* Directory not empty */ #endif #ifndef EREMOTE # define EREMOTE 66 /* The object is remote */ #endif #ifndef EPFNOSUPPORT # define EPFNOSUPPORT 96 /* Protocol family not supported */ #endif #ifndef EADDRINUSE # define EADDRINUSE 100 /* Address already in use */ #endif #ifndef EADDRNOTAVAIL # define EADDRNOTAVAIL 101 /* Can't assign requested address */ #endif #ifndef EAFNOSUPPORT # define EAFNOSUPPORT 102 /* Address family not supported */ #endif #ifndef EALREADY # define EALREADY 103 /* Operation already in progress */ #endif #ifndef EBADMSG # define EBADMSG 104 /* Not a data message */ #endif #ifndef ECANCELED # define ECANCELED 105 /* Canceled */ #endif #ifndef ECONNABORTED # define ECONNABORTED 106 /* Software caused connection abort */ #endif #ifndef ECONNREFUSED # define ECONNREFUSED 107 /* Connection refused */ #endif #ifndef ECONNRESET # define ECONNRESET 108 /* Connection reset by peer */ #endif #ifndef EDESTADDRREQ # define EDESTADDRREQ 109 /* Destination address required */ #endif #ifndef EHOSTUNREACH # define EHOSTUNREACH 110 /* No route to host */ #endif #ifndef EIDRM # define EIDRM 111 /* Identifier removed */ #endif #ifndef EINPROGRESS # define EINPROGRESS 112 /* Operation now in progress */ #endif #ifndef EISCONN # define EISCONN 113 /* Socket is already connected */ #endif #ifndef ELOOP # define ELOOP 114 /* Symbolic link loop */ #endif #ifndef EMSGSIZE # define EMSGSIZE 115 /* Message too long */ #endif #ifndef ENETDOWN # define ENETDOWN 116 /* Network is down */ #endif #ifndef ENETRESET # define ENETRESET 117 /* Network dropped connection on reset */ #endif #ifndef ENETUNREACH # define ENETUNREACH 118 /* Network is unreachable */ #endif #ifndef ENOBUFS # define ENOBUFS 119 /* No buffer space available */ #endif #ifndef ENODATA # define ENODATA 120 /* No data available */ #endif #ifndef ENOLINK # define ENOLINK 121 /* Link has be severed */ #endif #ifndef ENOMSG # define ENOMSG 122 /* No message of desired type */ #endif #ifndef ENOPROTOOPT # define ENOPROTOOPT 123 /* Protocol not available */ #endif #ifndef ENOSR # define ENOSR 124 /* Out of stream resources */ #endif #ifndef ENOSTR # define ENOSTR 125 /* Not a stream device */ #endif #ifndef ENOTCONN # define ENOTCONN 126 /* Socket is not connected */ #endif #ifndef ENOTRECOVERABLE # define ENOTRECOVERABLE 127 /* Not recoverable */ #endif #ifndef ENOTSOCK # define ENOTSOCK 128 /* Socket operation on non-socket */ #endif #ifndef ENOTSUP # define ENOTSUP 129 /* Operation not supported */ #endif #ifndef EOPNOTSUPP # define EOPNOTSUPP 130 /* Operation not supported on socket */ #endif #ifndef EOTHER # define EOTHER 131 /* Other error */ #endif #ifndef EOVERFLOW # define EOVERFLOW 132 /* File too big */ #endif #ifndef EOWNERDEAD # define EOWNERDEAD 133 /* Owner dead */ #endif #ifndef EPROTO # define EPROTO 134 /* Protocol error */ #endif #ifndef EPROTONOSUPPORT # define EPROTONOSUPPORT 135 /* Protocol not supported */ #endif #ifndef EPROTOTYPE # define EPROTOTYPE 136 /* Protocol wrong type for socket */ #endif #ifndef ETIME # define ETIME 137 /* Timer expired */ #endif #ifndef ETIMEDOUT # define ETIMEDOUT 138 /* Connection timed out */ #endif #ifndef ETXTBSY # define ETXTBSY 139 /* Text file or pseudo-device busy */ #endif #ifndef EWOULDBLOCK # define EWOULDBLOCK 140 /* Operation would block */ #endif /* Visual Studio doesn't have these, so just choose some high numbers */ #ifndef ESOCKTNOSUPPORT # define ESOCKTNOSUPPORT 240 /* Socket type not supported */ #endif #ifndef ESHUTDOWN # define ESHUTDOWN 241 /* Can't send after socket shutdown */ #endif #ifndef ETOOMANYREFS # define ETOOMANYREFS 242 /* Too many references: can't splice */ #endif #ifndef EHOSTDOWN # define EHOSTDOWN 243 /* Host is down */ #endif #ifndef EUSERS # define EUSERS 244 /* Too many users (for UFS) */ #endif #ifndef EDQUOT # define EDQUOT 245 /* Disc quota exceeded */ #endif #ifndef ESTALE # define ESTALE 246 /* Stale NFS file handle */ #endif /* * Signals not known to the standard ANSI signal.h. These are used * by Tcl_WaitPid() and generic/tclPosixStr.c */ #ifndef SIGTRAP # define SIGTRAP 5 #endif #ifndef SIGBUS # define SIGBUS 10 #endif /* * Supply definitions for macros to query wait status, if not already * defined in header files above. */ #ifdef TCL_UNION_WAIT # define WAIT_STATUS_TYPE union wait #else # define WAIT_STATUS_TYPE int #endif /* TCL_UNION_WAIT */ #ifndef WIFEXITED # define WIFEXITED(stat) (((*((int *) &(stat))) & 0xC0000000) == 0) #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat) (*((int *) &(stat))) #endif #ifndef WIFSIGNALED # define WIFSIGNALED(stat) ((*((int *) &(stat))) & 0xC0000000) #endif #ifndef WTERMSIG # define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F) #endif #ifndef WIFSTOPPED # define WIFSTOPPED(stat) 0 #endif #ifndef WSTOPSIG # define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF) #endif /* * Define constants for waitpid() system call if they aren't defined * by a system header file. */ #ifndef WNOHANG # define WNOHANG 1 #endif #ifndef WUNTRACED # define WUNTRACED 2 #endif /* * Define access mode constants if they aren't already defined. */ #ifndef F_OK # define F_OK 00 #endif #ifndef X_OK # define X_OK 01 #endif #ifndef W_OK # define W_OK 02 #endif #ifndef R_OK # define R_OK 04 #endif #ifndef O_ACCMODE # define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) #endif /* * Define macros to query file type bits, if they're not already * defined. */ #ifndef S_IFLNK # define S_IFLNK 0120000 /* Symbolic Link */ #endif /* * Windows compilers do not define S_IFBLK. However, Tcl uses it in * GetTypeFromMode to identify blockSpecial devices based on the * value in the statsbuf st_mode field. We have no other way to pass this * from NativeStat on Windows so are forced to define it here. * The definition here is essentially what is seen on Linux and MingW. * XXX - the root problem is Tcl using Unix definitions instead of * abstracting the structure into a platform independent one. Sigh - perhaps * Tcl 9 */ #ifndef S_IFBLK # define S_IFBLK (S_IFDIR | S_IFCHR) #endif #ifndef S_ISREG # ifdef S_IFREG # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) # else # define S_ISREG(m) 0 # endif #endif /* !S_ISREG */ #ifndef S_ISDIR # ifdef S_IFDIR # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # else # define S_ISDIR(m) 0 # endif #endif /* !S_ISDIR */ #ifndef S_ISCHR # ifdef S_IFCHR # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) # else # define S_ISCHR(m) 0 # endif #endif /* !S_ISCHR */ #ifndef S_ISBLK # ifdef S_IFBLK # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) # else # define S_ISBLK(m) 0 # endif #endif /* !S_ISBLK */ #ifndef S_ISFIFO # ifdef S_IFIFO # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) # else # define S_ISFIFO(m) 0 # endif #endif /* !S_ISFIFO */ #ifndef S_ISLNK # ifdef S_IFLNK # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) # else # define S_ISLNK(m) 0 # endif #endif /* !S_ISLNK */ /* * Define MAXPATHLEN in terms of MAXPATH if available */ #ifndef MAXPATH # define MAXPATH MAX_PATH #endif /* MAXPATH */ #ifndef MAXPATHLEN # define MAXPATHLEN MAXPATH #endif /* MAXPATHLEN */ /* * Define pid_t and uid_t if they're not already defined. */ #if !defined(TCL_PID_T) # define pid_t int #endif /* !TCL_PID_T */ #if !defined(TCL_UID_T) # define uid_t int #endif /* !TCL_UID_T */ /* * Visual C++ has some odd names for common functions, so we need to * define a few macros to handle them. Also, it defines EDEADLOCK and * EDEADLK as the same value, which confuses Tcl_ErrnoId(). */ #if defined(_MSC_VER) || defined(__MSVCRT__) # define environ _environ # define exception _exception # undef EDEADLOCK # if defined(_MSC_VER) # define timezone _timezone # endif #endif /* _MSC_VER || __MSVCRT__ */ #if defined(_MSC_VER) # pragma warning(disable:4090) /* see: https://developercommunity.visualstudio.com/t/c-compiler-incorrect-propagation-of-const-qualifie/390711 */ # pragma warning(disable:4146) # pragma warning(disable:4244) #if !defined(_WIN64) # pragma warning(disable:4305) #endif # pragma warning(disable:4267) # pragma warning(disable:4996) # pragma warning(disable:5287) /* See [1dcda0e862] */ #endif /* *--------------------------------------------------------------------------- * The following macros and declarations represent the interface between * generic and windows-specific parts of Tcl. Some of the macros may * override functions declared in tclInt.h. *--------------------------------------------------------------------------- */ /* * The default platform eol translation on Windows is TCL_TRANSLATE_CRLF: */ #define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF /* * Declare dynamic loading extension macro. */ #define TCL_SHLIB_EXT ".dll" /* * The following define ensures that we use the native putenv * implementation to modify the environment array. This keeps * the C level environment in synch with the system level environment. */ #define USE_PUTENV 1 #define USE_PUTENV_FOR_UNSET 1 /* * Msvcrt's putenv() copies the string rather than takes ownership of it. */ #if defined(_MSC_VER) || defined(__MSVCRT__) # define HAVE_PUTENV_THAT_COPIES 1 #endif /* * Older version of Mingw are known to lack a MWMO_ALERTABLE define. */ #if !defined(MWMO_ALERTABLE) # define MWMO_ALERTABLE 2 #endif /* * The following defines wrap the system memory allocation routines for * use by tclAlloc.c. */ #define TclpSysAlloc(size) ((void*)HeapAlloc(GetProcessHeap(), \ 0, size)) #define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \ 0, (HGLOBAL)ptr)) #define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \ 0, (LPVOID)ptr, size)) /* This type is not defined in the Windows headers */ #define socklen_t int /* * The following macros have trivial definitions, allowing generic code to * address platform-specific issues. */ #define TclpReleaseFile(file) Tcl_Free(file) /* * The following macros and declarations wrap the C runtime library * functions. */ #ifndef INVALID_SET_FILE_POINTER #define INVALID_SET_FILE_POINTER 0xFFFFFFFF #endif /* INVALID_SET_FILE_POINTER */ #ifndef LABEL_SECURITY_INFORMATION # define LABEL_SECURITY_INFORMATION (0x00000010L) #endif #endif /* _TCLWINPORT */ tcl9.0.3/win/tclWinPipe.c0000644000175000017500000027417615104661342014610 0ustar sergeisergei/* * tclWinPipe.c -- * * This file implements the Windows-specific exec pipeline functions, the * "pipe" channel driver, and the "pid" Tcl command. * * Copyright © 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. */ #include "tclWinInt.h" #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * The following variable is used to tell whether this module has been * initialized. */ static int initialized = 0; /* * The pipeMutex locks around access to the initialized and procList * variables, and it is used to protect background threads from being * terminated while they are using APIs that hold locks. */ TCL_DECLARE_MUTEX(pipeMutex) /* * The following defines identify the various types of applications that run * under windows. There is special case code for the various types. */ #define APPL_NONE 0 #define APPL_DOS 1 #define APPL_WIN3X 2 #define APPL_WIN32 3 /* * The following constants and structures are used to encapsulate the state of * various types of files used in a pipeline. This used to have a 1 && 2 that * supported Win32s. */ #define WIN_FILE 3 /* Basic Win32 file. */ /* * This structure encapsulates the common state associated with all file types * used in a pipeline. */ typedef struct { int type; /* One of the file types defined above. */ HANDLE handle; /* Open file handle. */ } WinFile; /* * This list is used to map from pids to process handles. */ typedef struct ProcInfo { HANDLE hProcess; int dwProcessId; struct ProcInfo *nextPtr; } ProcInfo; static ProcInfo *procList; /* * Bit masks used in the flags field of the PipeInfo structure below. */ #define PIPE_PENDING (1<<0) /* Message is pending in the queue. */ #define PIPE_ASYNC (1<<1) /* Channel is non-blocking. */ /* * Bit masks used in the sharedFlags field of the PipeInfo structure below. */ #define PIPE_EOF (1<<2) /* Pipe has reached EOF. */ #define PIPE_EXTRABYTE (1<<3) /* The reader thread has consumed one byte. */ /* * TODO: It appears the whole EXTRABYTE machinery is in place to support * outdated Win 95 systems. If this can be confirmed, much code can be * deleted. */ /* * This structure describes per-instance data for a pipe based channel. */ typedef struct PipeInfo { struct PipeInfo *nextPtr; /* Pointer to next registered pipe. */ Tcl_Channel channel; /* Pointer to channel structure. */ int validMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which operations are valid on the file. */ int watchMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which events should be reported. */ int flags; /* State flags, see above for a list. */ TclFile readFile; /* Output from pipe. */ TclFile writeFile; /* Input from pipe. */ TclFile errorFile; /* Error output from pipe. */ size_t numPids; /* Number of processes attached to pipe. */ Tcl_Pid *pidPtr; /* Pids of attached processes. */ Tcl_ThreadId threadId; /* Thread to which events should be reported. * This value is used by the reader/writer * threads. */ TclPipeThreadInfo *writeTI; /* Thread info of writer and reader, this */ TclPipeThreadInfo *readTI; /* structure owned by corresponding thread. */ HANDLE writeThread; /* Handle to writer thread. */ HANDLE readThread; /* Handle to reader thread. */ HANDLE writable; /* Manual-reset event to signal when the * writer thread has finished waiting for the * current buffer to be written. */ HANDLE readable; /* Manual-reset event to signal when the * reader thread has finished waiting for * input. */ DWORD writeError; /* An error caused by the last background * write. Set to 0 if no error has been * detected. This word is shared with the * writer thread so access must be * synchronized with the writable object. */ char *writeBuf; /* Current background output buffer. Access is * synchronized with the writable object. */ int writeBufLen; /* Size of write buffer. Access is * synchronized with the writable object. */ int toWrite; /* Current amount to be written. Access is * synchronized with the writable object. */ int readFlags; /* Flags that are shared with the reader * thread. Access is synchronized with the * readable object. */ char extraByte; /* Buffer for extra character consumed by * reader thread. This byte is shared with the * reader thread so access must be * synchronized with the readable object. */ } PipeInfo; typedef struct { /* * The following pointer refers to the head of the list of pipes that are * being watched for file events. */ PipeInfo *firstPipePtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following structure is what is added to the Tcl event queue when pipe * events are generated. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ PipeInfo *infoPtr; /* Pointer to pipe info structure. Note that * we still have to verify that the pipe * exists before dereferencing this * pointer. */ } PipeEvent; /* * Declarations for functions used only in this file. */ static int ApplicationType(Tcl_Interp *interp, const char *fileName, char *fullName); static void BuildCommandLine(const char *executable, size_t argc, const char **argv, Tcl_DString *linePtr); static BOOL HasConsole(void); static int PipeBlockModeProc(void *instanceData, int mode); static void PipeCheckProc(void *clientData, int flags); static int PipeClose2Proc(void *instanceData, Tcl_Interp *interp, int flags); static int PipeEventProc(Tcl_Event *evPtr, int flags); static int PipeGetHandleProc(void *instanceData, int direction, void **handlePtr); static void PipeInit(void); static int PipeInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int PipeOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static DWORD WINAPI PipeReaderThread(LPVOID arg); static void PipeSetupProc(void *clientData, int flags); static void PipeWatchProc(void *instanceData, int mask); static DWORD WINAPI PipeWriterThread(LPVOID arg); static int TempFileName(WCHAR name[MAX_PATH]); static int WaitForRead(PipeInfo *infoPtr, int blocking); static void PipeThreadActionProc(void *instanceData, int action); /* * This structure describes the channel type structure for command pipe based * I/O. */ static const Tcl_ChannelType pipeChannelType = { "pipe", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ PipeInputProc, PipeOutputProc, NULL, /* Deprecated. */ NULL, /* Set option proc. */ NULL, /* Get option proc. */ PipeWatchProc, PipeGetHandleProc, PipeClose2Proc, PipeBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ PipeThreadActionProc, NULL /* Truncate proc. */ }; /* *---------------------------------------------------------------------- * * PipeInit -- * * This function initializes the static variables for this file. * * Results: * None. * * Side effects: * Creates a new event source. * *---------------------------------------------------------------------- */ static void PipeInit(void) { ThreadSpecificData *tsdPtr; /* * Check the initialized flag first, then check again in the mutex. This * is a speed enhancement. */ if (!initialized) { Tcl_MutexLock(&pipeMutex); if (!initialized) { initialized = 1; procList = NULL; } Tcl_MutexUnlock(&pipeMutex); } tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); if (tsdPtr == NULL) { tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->firstPipePtr = NULL; Tcl_CreateEventSource(PipeSetupProc, PipeCheckProc, NULL); } } /* *---------------------------------------------------------------------- * * TclpFinalizePipes -- * * This function is called from Tcl_FinalizeThread to finalize the * platform specific pipe subsystem. * * Results: * None. * * Side effects: * Removes the pipe event source. * *---------------------------------------------------------------------- */ void TclpFinalizePipes(void) { ThreadSpecificData *tsdPtr; tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); if (tsdPtr != NULL) { Tcl_DeleteEventSource(PipeSetupProc, PipeCheckProc, NULL); } } /* *---------------------------------------------------------------------- * * PipeSetupProc -- * * This function is invoked before Tcl_DoOneEvent blocks waiting for an * event. * * Results: * None. * * Side effects: * Adjusts the block time if needed. * *---------------------------------------------------------------------- */ void PipeSetupProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { PipeInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; int block = 1; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { return; } /* * Look to see if any events are already pending. If they are, poll. */ for (infoPtr = tsdPtr->firstPipePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->watchMask & TCL_WRITABLE) { if (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT) { block = 0; } } if (infoPtr->watchMask & TCL_READABLE) { if (WaitForRead(infoPtr, 0) >= 0) { block = 0; } } } if (!block) { Tcl_SetMaxBlockTime(&blockTime); } } /* *---------------------------------------------------------------------- * * PipeCheckProc -- * * This function is called by Tcl_DoOneEvent to check the pipe event * source for events. * * Results: * None. * * Side effects: * May queue an event. * *---------------------------------------------------------------------- */ static void PipeCheckProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { PipeInfo *infoPtr; PipeEvent *evPtr; int needEvent; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { return; } /* * Queue events for any ready pipes that don't already have events queued. */ for (infoPtr = tsdPtr->firstPipePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->flags & PIPE_PENDING) { continue; } /* * Queue an event if the pipe is signaled for reading or writing. */ needEvent = 0; if ((infoPtr->watchMask & TCL_WRITABLE) && (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT)) { needEvent = 1; } if ((infoPtr->watchMask & TCL_READABLE) && (WaitForRead(infoPtr, 0) >= 0)) { needEvent = 1; } if (needEvent) { infoPtr->flags |= PIPE_PENDING; evPtr = (PipeEvent *)Tcl_Alloc(sizeof(PipeEvent)); evPtr->header.proc = PipeEventProc; evPtr->infoPtr = infoPtr; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); } } } /* *---------------------------------------------------------------------- * * TclWinMakeFile -- * * This function constructs a new TclFile from a given data and type * value. * * Results: * Returns a newly allocated WinFile as a TclFile. * * Side effects: * None. * *---------------------------------------------------------------------- */ TclFile TclWinMakeFile( HANDLE handle) /* Type-specific data. */ { WinFile *filePtr; filePtr = (WinFile *)Tcl_Alloc(sizeof(WinFile)); filePtr->type = WIN_FILE; filePtr->handle = handle; return (TclFile)filePtr; } /* *---------------------------------------------------------------------- * * TempFileName -- * * Gets a temporary file name and deals with the fact that the temporary * file path provided by Windows may not actually exist if the TMP or * TEMP environment variables refer to a non-existent directory. * * Results: * 0 if error, non-zero otherwise. If non-zero is returned, the name * buffer will be filled with a name that can be used to construct a * temporary file. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TempFileName( WCHAR name[MAX_PATH]) /* Buffer in which name for temporary file * gets stored. */ { const WCHAR *prefix = L"TCL"; if (GetTempPathW(MAX_PATH, name) != 0) { if (GetTempFileNameW(name, prefix, 0, name) != 0) { return 1; } } name[0] = '.'; name[1] = '\0'; return GetTempFileNameW(name, prefix, 0, name); } /* *---------------------------------------------------------------------- * * TclpMakeFile -- * * Make a TclFile from a channel. * * Results: * Returns a new TclFile or NULL on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ TclFile TclpMakeFile( Tcl_Channel channel, /* Channel to get file from. */ int direction) /* Either TCL_READABLE or TCL_WRITABLE. */ { HANDLE handle; if (Tcl_GetChannelHandle(channel, direction, (void **) &handle) == TCL_OK) { return TclWinMakeFile(handle); } else { return (TclFile) NULL; } } /* *---------------------------------------------------------------------- * * TclpOpenFile -- * * This function opens files for use in a pipeline. * * Results: * Returns a newly allocated TclFile structure containing the file * handle. * * Side effects: * None. * *---------------------------------------------------------------------- */ TclFile TclpOpenFile( const char *path, /* The name of the file to open. */ int mode) /* In what mode to open the file? */ { HANDLE handle; DWORD accessMode, createMode, shareMode, flags; Tcl_DString ds; const WCHAR *nativePath; /* * Map the access bits to the NT access mode. */ switch (mode & O_ACCMODE) { case O_RDONLY: accessMode = GENERIC_READ; break; case O_WRONLY: accessMode = GENERIC_WRITE; break; case O_RDWR: accessMode = (GENERIC_READ | GENERIC_WRITE); break; default: Tcl_WinConvertError(ERROR_INVALID_FUNCTION); return NULL; } /* * Map the creation flags to the NT create mode. */ switch (mode & (O_CREAT | O_EXCL | O_TRUNC)) { case (O_CREAT | O_EXCL): case (O_CREAT | O_EXCL | O_TRUNC): createMode = CREATE_NEW; break; case (O_CREAT | O_TRUNC): createMode = CREATE_ALWAYS; break; case O_CREAT: createMode = OPEN_ALWAYS; break; case O_TRUNC: case (O_TRUNC | O_EXCL): createMode = TRUNCATE_EXISTING; break; default: createMode = OPEN_EXISTING; break; } Tcl_DStringInit(&ds); nativePath = Tcl_UtfToWCharDString(path, TCL_INDEX_NONE, &ds); /* * If the file is not being created, use the existing file attributes. */ flags = 0; if (!(mode & O_CREAT)) { flags = GetFileAttributesW(nativePath); if (flags == 0xFFFFFFFF) { flags = 0; } } /* * Set up the file sharing mode. We want to allow simultaneous access. */ shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; /* * Now we get to create the file. */ handle = CreateFileW(nativePath, accessMode, shareMode, NULL, createMode, flags, NULL); Tcl_DStringFree(&ds); if (handle == INVALID_HANDLE_VALUE) { DWORD err; err = GetLastError(); if ((err & 0xFFFFL) == ERROR_OPEN_FAILED) { err = (mode & O_CREAT) ? ERROR_FILE_EXISTS : ERROR_FILE_NOT_FOUND; } Tcl_WinConvertError(err); return NULL; } /* * Seek to the end of file if we are writing. */ if (mode & (O_WRONLY|O_APPEND)) { SetFilePointer(handle, 0, NULL, FILE_END); } return TclWinMakeFile(handle); } /* *---------------------------------------------------------------------- * * TclpCreateTempFile -- * * This function opens a unique file with the property that it will be * deleted when its file handle is closed. The temporary file is created * in the system temporary directory. * * Results: * Returns a valid TclFile, or NULL on failure. * * Side effects: * Creates a new temporary file. * *---------------------------------------------------------------------- */ TclFile TclpCreateTempFile( const char *contents) /* String to write into temp file, or NULL. */ { WCHAR name[MAX_PATH]; const char *native = NULL; Tcl_DString dstring; HANDLE handle; if (TempFileName(name) == 0) { return NULL; } handle = CreateFileW(name, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY|FILE_FLAG_DELETE_ON_CLOSE, NULL); if (handle == INVALID_HANDLE_VALUE) { goto error; } /* * Write the file out, doing line translations on the way. */ if (contents != NULL) { DWORD result, length; const char *p; int toCopy; /* * Convert the contents from UTF to native encoding */ if (Tcl_UtfToExternalDStringEx(NULL, NULL, contents, TCL_INDEX_NONE, 0, &dstring, NULL) != TCL_OK) { goto error; } native = Tcl_DStringValue(&dstring); toCopy = Tcl_DStringLength(&dstring); for (p = native; toCopy > 0; p++, toCopy--) { if (*p == '\n') { length = p - native; if (length > 0) { if (!WriteFile(handle, native, length, &result, NULL)) { goto error; } } if (!WriteFile(handle, "\r\n", 2, &result, NULL)) { goto error; } native = p+1; } } length = p - native; if (length > 0) { if (!WriteFile(handle, native, length, &result, NULL)) { goto error; } } Tcl_DStringFree(&dstring); if (SetFilePointer(handle, 0, NULL, FILE_BEGIN) == 0xFFFFFFFF) { goto error; } } return TclWinMakeFile(handle); error: /* * Free the native representation of the contents if necessary. */ if (contents != NULL) { Tcl_DStringFree(&dstring); } if (native != NULL) { Tcl_WinConvertError(GetLastError()); } CloseHandle(handle); DeleteFileW(name); return NULL; } /* *---------------------------------------------------------------------- * * TclpTempFileName -- * * This function returns a unique filename. * * Results: * Returns a valid Tcl_Obj* with refCount 0, or NULL on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Obj * TclpTempFileName(void) { WCHAR fileName[MAX_PATH]; if (TempFileName(fileName) == 0) { return NULL; } return TclpNativeToNormalized(fileName); } /* *---------------------------------------------------------------------- * * TclpCreatePipe -- * * Creates an anonymous pipe. * * Results: * Returns 1 on success, 0 on failure. * * Side effects: * Creates a pipe. * *---------------------------------------------------------------------- */ int TclpCreatePipe( TclFile *readPipe, /* Location to store file handle for read side * of pipe. */ TclFile *writePipe) /* Location to store file handle for write * side of pipe. */ { HANDLE readHandle, writeHandle; if (CreatePipe(&readHandle, &writeHandle, NULL, 0) != 0) { *readPipe = TclWinMakeFile(readHandle); *writePipe = TclWinMakeFile(writeHandle); return 1; } Tcl_WinConvertError(GetLastError()); return 0; } /* *---------------------------------------------------------------------- * * TclpCloseFile -- * * Closes a pipeline file handle. These handles are created by * TclpOpenFile, TclpCreatePipe, or TclpMakeFile. * * Results: * 0 on success, -1 on failure. * * Side effects: * The file is closed and deallocated. * *---------------------------------------------------------------------- */ int TclpCloseFile( TclFile file) /* The file to close. */ { WinFile *filePtr = (WinFile *) file; switch (filePtr->type) { case WIN_FILE: /* * Don't close the Win32 handle if the handle is a standard channel * during the thread exit process. Otherwise, one thread may kill the * stdio of another. */ if (!TclInThreadExit() || ((GetStdHandle(STD_INPUT_HANDLE) != filePtr->handle) && (GetStdHandle(STD_OUTPUT_HANDLE) != filePtr->handle) && (GetStdHandle(STD_ERROR_HANDLE) != filePtr->handle))) { if (filePtr->handle != NULL && CloseHandle(filePtr->handle) == FALSE) { Tcl_WinConvertError(GetLastError()); Tcl_Free(filePtr); return -1; } } break; default: Tcl_Panic("TclpCloseFile: unexpected file type"); } Tcl_Free(filePtr); return 0; } /* *-------------------------------------------------------------------------- * * TclpGetPid -- * * Given a HANDLE to a child process, return the process id for that * child process. * * Results: * Returns the process id for the child process. If the pid was not known * by Tcl, either because the pid was not created by Tcl or the child * process has already been reaped, TCL_INDEX_NONE is returned. * * Side effects: * None. * *-------------------------------------------------------------------------- */ Tcl_Size TclpGetPid( Tcl_Pid pid) /* The HANDLE of the child process. */ { ProcInfo *infoPtr; PipeInit(); Tcl_MutexLock(&pipeMutex); for (infoPtr = procList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->dwProcessId == (Tcl_Size)pid) { Tcl_MutexUnlock(&pipeMutex); return infoPtr->dwProcessId; } } Tcl_MutexUnlock(&pipeMutex); return -1; } /* *---------------------------------------------------------------------- * * TclpCreateProcess -- * * Create a child process that has the specified files as its standard * input, output, and error. The child process runs asynchronously under * Windows NT and Windows 9x, and runs with the same environment * variables as the creating process. * * The complete Windows search path is searched to find the specified * executable. If an executable by the given name is not found, * automatically tries appending standard extensions to the * executable name. * * Results: * The return value is TCL_ERROR and an error message is left in the * interp's result if there was a problem creating the child process. * Otherwise, the return value is TCL_OK and *pidPtr is filled with the * process id of the child process. * * Side effects: * A process is created. * *---------------------------------------------------------------------- */ int TclpCreateProcess( Tcl_Interp *interp, /* Interpreter in which to leave errors that * occurred when creating the child process. * Error messages from the child process * itself are sent to errorFile. */ size_t argc, /* Number of arguments in following array. */ const char **argv, /* Array of argument strings. argv[0] contains * the name of the executable converted to * native format (using the * Tcl_TranslateFileName call). Additional * arguments have not been converted. */ TclFile inputFile, /* If non-NULL, gives the file to use as input * for the child process. If inputFile file is * not readable or is NULL, the child will * receive no standard input. */ TclFile outputFile, /* If non-NULL, gives the file that receives * output from the child process. If * outputFile file is not writable or is * NULL, output from the child will be * discarded. */ TclFile errorFile, /* If non-NULL, gives the file that receives * errors from the child process. If errorFile * file is not writable or is NULL, errors * from the child will be discarded. errorFile * may be the same as outputFile. */ Tcl_Pid *pidPtr) /* If this function is successful, pidPtr is * filled with the process id of the child * process. */ { int result, applType, createFlags; Tcl_DString cmdLine; /* Complete command line (WCHAR). */ STARTUPINFOW startInfo; PROCESS_INFORMATION procInfo; SECURITY_ATTRIBUTES secAtts; HANDLE hProcess, h, inputHandle, outputHandle, errorHandle; char execPath[MAX_PATH * 3]; WinFile *filePtr; PipeInit(); applType = ApplicationType(interp, argv[0], execPath); if (applType == APPL_NONE) { return TCL_ERROR; } result = TCL_ERROR; Tcl_DStringInit(&cmdLine); hProcess = GetCurrentProcess(); /* * STARTF_USESTDHANDLES must be used to pass handles to child process. * Using SetStdHandle() and/or dup2() only works when a console mode * parent process is spawning an attached console mode child process. */ ZeroMemory(&startInfo, sizeof(startInfo)); startInfo.cb = sizeof(startInfo); startInfo.dwFlags = STARTF_USESTDHANDLES; startInfo.hStdInput = INVALID_HANDLE_VALUE; startInfo.hStdOutput= INVALID_HANDLE_VALUE; startInfo.hStdError = INVALID_HANDLE_VALUE; secAtts.nLength = sizeof(SECURITY_ATTRIBUTES); secAtts.lpSecurityDescriptor = NULL; secAtts.bInheritHandle = TRUE; /* * We have to check the type of each file, since we cannot duplicate some * file types. */ inputHandle = INVALID_HANDLE_VALUE; if (inputFile != NULL) { filePtr = (WinFile *)inputFile; if (filePtr->type == WIN_FILE) { inputHandle = filePtr->handle; } } outputHandle = INVALID_HANDLE_VALUE; if (outputFile != NULL) { filePtr = (WinFile *)outputFile; if (filePtr->type == WIN_FILE) { outputHandle = filePtr->handle; } } errorHandle = INVALID_HANDLE_VALUE; if (errorFile != NULL) { filePtr = (WinFile *)errorFile; if (filePtr->type == WIN_FILE) { errorHandle = filePtr->handle; } } /* * Duplicate all the handles which will be passed off as stdin, stdout and * stderr of the child process. The duplicate handles are set to be * inheritable, so the child process can use them. */ if (inputHandle == INVALID_HANDLE_VALUE) { /* * If handle was not set, stdin should return immediate EOF. Under * Windows95, some applications (both 16 and 32 bit!) cannot read from * the NUL device; they read from console instead. When running tk, * this is fatal because the child process would hang forever waiting * for EOF from the unmapped console window used by the helper * application. * * Fortunately, the helper application detects a closed pipe as an * immediate EOF and can pass that information to the child process. */ if (CreatePipe(&startInfo.hStdInput, &h, &secAtts, 0) != FALSE) { CloseHandle(h); } } else { DuplicateHandle(hProcess, inputHandle, hProcess, &startInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); } if (startInfo.hStdInput == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't duplicate input handle: %s", Tcl_PosixError(interp))); goto end; } if (outputHandle == INVALID_HANDLE_VALUE) { /* * If handle was not set, output should be sent to an infinitely deep * sink. Under Windows 95, some 16 bit applications cannot have stdout * redirected to NUL; they send their output to the console instead. * Some applications, like "more" or "dir /p", when outputting * multiple pages to the console, also then try and read from the * console to go the next page. When running tk, this is fatal because * the child process would hang forever waiting for input from the * unmapped console window used by the helper application. * * Fortunately, the helper application will detect a closed pipe as a * sink. */ startInfo.hStdOutput = CreateFileW(L"NUL:", GENERIC_WRITE, 0, &secAtts, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); } else { DuplicateHandle(hProcess, outputHandle, hProcess, &startInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); } if (startInfo.hStdOutput == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't duplicate output handle: %s", Tcl_PosixError(interp))); goto end; } if (errorHandle == INVALID_HANDLE_VALUE) { /* * If handle was not set, errors should be sent to an infinitely deep * sink. */ startInfo.hStdError = CreateFileW(L"NUL:", GENERIC_WRITE, 0, &secAtts, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); } else { DuplicateHandle(hProcess, errorHandle, hProcess, &startInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS); } if (startInfo.hStdError == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't duplicate error handle: %s", Tcl_PosixError(interp))); goto end; } /* * If we do not have a console window, then we must run DOS and WIN32 * console mode applications as detached processes. This tells the loader * that the child application should not inherit the console, and that it * should not create a new console window for the child application. The * child application should get its stdio from the redirection handles * provided by this application, and run in the background. * * If we are starting a GUI process, they don't automatically get a * console, so it doesn't matter if they are started as foreground or * detached processes. The GUI window will still pop up to the foreground. */ if (HasConsole()) { createFlags = 0; } else if (applType == APPL_DOS) { /* * Under NT, 16-bit DOS applications will not run unless they can * be attached to a console. If we are running without a console, * run the 16-bit program as an normal process inside of a hidden * console application, and then run that hidden console as a * detached process. */ startInfo.wShowWindow = SW_HIDE; startInfo.dwFlags |= STARTF_USESHOWWINDOW; createFlags = CREATE_NEW_CONSOLE; TclDStringAppendLiteral(&cmdLine, "cmd.exe /c"); } else { createFlags = DETACHED_PROCESS; } /* * cmdLine gets the full command line used to invoke the executable, * including the name of the executable itself. The command line arguments * in argv[] are stored in cmdLine separated by spaces. Special characters * in individual arguments from argv[] must be quoted when being stored in * cmdLine. * * When calling any application, bear in mind that arguments that specify * a path name are not converted. If an argument contains forward slashes * as path separators, it may or may not be recognized as a path name, * depending on the program. In general, most applications accept forward * slashes only as option delimiters and backslashes only as paths. * * Additionally, when calling a 16-bit dos or windows application, all * path names must use the short, cryptic, path format (e.g., using * ab~1.def instead of "a b.default"). */ BuildCommandLine(execPath, argc, argv, &cmdLine); if (CreateProcessW(NULL, (WCHAR *) Tcl_DStringValue(&cmdLine), NULL, NULL, TRUE, (DWORD) createFlags, NULL, NULL, &startInfo, &procInfo) == 0) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf("couldn't execute \"%s\": %s", argv[0], Tcl_PosixError(interp))); goto end; } /* * This wait is used to force the OS to give some time to the DOS process. */ if (applType == APPL_DOS) { WaitForSingleObject(procInfo.hProcess, 50); } /* * "When an application spawns a process repeatedly, a new thread instance * will be created for each process but the previous instances may not be * cleaned up. This results in a significant virtual memory loss each time * the process is spawned. If there is a WaitForInputIdle() call between * CreateProcessW() and CloseHandle(), the problem does not occur." PSS ID * Number: Q124121 */ WaitForInputIdle(procInfo.hProcess, 5000); CloseHandle(procInfo.hThread); *pidPtr = (Tcl_Pid)INT2PTR(procInfo.dwProcessId); if (*pidPtr != 0) { TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId); } result = TCL_OK; end: Tcl_DStringFree(&cmdLine); if (startInfo.hStdInput != INVALID_HANDLE_VALUE) { CloseHandle(startInfo.hStdInput); } if (startInfo.hStdOutput != INVALID_HANDLE_VALUE) { CloseHandle(startInfo.hStdOutput); } if (startInfo.hStdError != INVALID_HANDLE_VALUE) { CloseHandle(startInfo.hStdError); } return result; } /* *---------------------------------------------------------------------- * * HasConsole -- * * Determines whether the current application is attached to a console. * * Results: * Returns TRUE if this application has a console, else FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static BOOL HasConsole(void) { HANDLE handle; handle = CreateFileW(L"CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (handle != INVALID_HANDLE_VALUE) { CloseHandle(handle); return TRUE; } else { return FALSE; } } /* *-------------------------------------------------------------------- * * ApplicationType -- * * Search for the specified program and identify if it refers to a DOS, * Windows 3.X, or Win32 program. Used to determine how to invoke a * program, or if it can even be invoked. * * It is possible to almost positively identify DOS and Windows * applications that contain the appropriate magic numbers. However, DOS * .com files do not seem to contain a magic number; if the program name * ends with .com and could not be identified as a Windows .com file, it * will be assumed to be a DOS application, even if it was just random * data. If the program name does not end with .com, no such assumption * is made. * * The Win32 function GetBinaryType incorrectly identifies any junk file * that ends with .exe as a dos executable and some executables that * don't end with .exe as not executable. Plus it doesn't exist under * win95, so I won't feel bad about reimplementing functionality. * * Results: * The return value is one of APPL_DOS, APPL_WIN3X, or APPL_WIN32 if the * filename referred to the corresponding application type. If the file * name could not be found or did not refer to any known application * type, APPL_NONE is returned and an error message is left in interp. * .bat files are identified as APPL_DOS. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int ApplicationType( Tcl_Interp *interp, /* Interp, for error message. */ const char *originalName, /* Name of the application to find. */ char fullName[]) /* Filled with complete path to * application. */ { int applType, i, nameLen, found; HANDLE hFile; WCHAR *rest; char *ext; char buf[2]; DWORD attr, read; IMAGE_DOS_HEADER header; Tcl_DString nameBuf, ds; const WCHAR *nativeName; WCHAR nativeFullPath[MAX_PATH]; static const char extensions[][5] = {"", ".com", ".exe", ".bat", ".cmd"}; /* * Look for the program as an external program. First try the name as it * is, then try adding .com, .exe, .bat and .cmd, in that order, to the name, * looking for an executable. * * Using the raw SearchPathW() function doesn't do quite what is necessary. * If the name of the executable already contains a '.' character, it will * not try appending the specified extension when searching (in other * words, SearchPath will not find the program "a.b.exe" if the arguments * specified "a.b" and ".exe"). So, first look for the file as it is * named. Then manually append the extensions, looking for a match. */ applType = APPL_NONE; Tcl_DStringInit(&nameBuf); Tcl_DStringAppend(&nameBuf, originalName, TCL_INDEX_NONE); nameLen = Tcl_DStringLength(&nameBuf); for (i = 0; i < (int) (sizeof(extensions) / sizeof(extensions[0])); i++) { Tcl_DStringSetLength(&nameBuf, nameLen); Tcl_DStringAppend(&nameBuf, extensions[i], TCL_INDEX_NONE); Tcl_DStringInit(&ds); nativeName = Tcl_UtfToWCharDString(Tcl_DStringValue(&nameBuf), Tcl_DStringLength(&nameBuf), &ds); found = SearchPathW(NULL, nativeName, NULL, MAX_PATH, nativeFullPath, &rest); Tcl_DStringFree(&ds); if (found == 0) { continue; } /* * Ignore matches on directories or data files, return if identified a * known type. */ attr = GetFileAttributesW(nativeFullPath); if ((attr == 0xFFFFFFFF) || (attr & FILE_ATTRIBUTE_DIRECTORY)) { continue; } Tcl_DStringInit(&ds); strcpy(fullName, Tcl_WCharToUtfDString(nativeFullPath, TCL_INDEX_NONE, &ds)); Tcl_DStringFree(&ds); ext = strrchr(fullName, '.'); if ((ext != NULL) && (strcasecmp(ext, ".cmd") == 0 || strcasecmp(ext, ".bat") == 0)) { applType = APPL_DOS; break; } hFile = CreateFileW(nativeFullPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OPEN_REPARSE_POINT, NULL); if (hFile == INVALID_HANDLE_VALUE) { continue; } if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * But [4f0b5767ac]. Likely a App Execution Alias. This can only * be a Win32 APP. Attempt to ReadFile below will fail. We assume * that if it is on the PATH, and it is a reparse point, it is an * App Execution Alias. */ CloseHandle(hFile); applType = APPL_WIN32; break; } header.e_magic = 0; ReadFile(hFile, (void *)&header, sizeof(header), &read, NULL); if (header.e_magic != IMAGE_DOS_SIGNATURE) { /* * Doesn't have the magic number for relocatable executables. If * filename ends with .com, assume it's a DOS application anyhow. * Note that we didn't make this assumption at first, because some * supposed .com files are really 32-bit executables with all the * magic numbers and everything. */ CloseHandle(hFile); if ((ext != NULL) && (strcasecmp(ext, ".com") == 0)) { applType = APPL_DOS; break; } continue; } if (header.e_lfarlc != sizeof(header)) { /* * All Windows 3.X and Win32 and some DOS programs have this value * set here. If it doesn't, assume that since it already had the * other magic number it was a DOS application. */ CloseHandle(hFile); applType = APPL_DOS; break; } /* * The DWORD at header.e_lfanew points to yet another magic number. */ buf[0] = '\0'; SetFilePointer(hFile, header.e_lfanew, NULL, FILE_BEGIN); ReadFile(hFile, (void *)buf, 2, &read, NULL); CloseHandle(hFile); if ((buf[0] == 'N') && (buf[1] == 'E')) { applType = APPL_WIN3X; } else if ((buf[0] == 'P') && (buf[1] == 'E')) { applType = APPL_WIN32; } else { /* * Strictly speaking, there should be a test that there is an 'L' * and 'E' at buf[0..1], to identify the type as DOS, but of * course we ran into a DOS executable that _doesn't_ have the * magic number - specifically, one compiled using the Lahey * Fortran90 compiler. */ applType = APPL_DOS; } break; } Tcl_DStringFree(&nameBuf); if (applType == APPL_NONE) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf("couldn't execute \"%s\": %s", originalName, Tcl_PosixError(interp))); return APPL_NONE; } if (applType == APPL_WIN3X) { /* * Replace long path name of executable with short path name for * 16-bit applications. Otherwise the application may not be able to * correctly parse its own command line to separate off the * application name from the arguments. */ GetShortPathNameW(nativeFullPath, nativeFullPath, MAX_PATH); Tcl_DStringInit(&ds); strcpy(fullName, Tcl_WCharToUtfDString(nativeFullPath, TCL_INDEX_NONE, &ds)); Tcl_DStringFree(&ds); } return applType; } /* *---------------------------------------------------------------------- * * BuildCommandLine -- * * The command line arguments are stored in linePtr separated by spaces, * in a form that CreateProcessW() understands. Special characters in * individual arguments from argv[] must be quoted when being stored in * cmdLine. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static const char * BuildCmdLineBypassBS( const char *current, const char **bspos) { /* * Mark first backslash position. */ if (!*bspos) { *bspos = current; } do { current++; } while (*current == '\\'); return current; } static void QuoteCmdLineBackslash( Tcl_DString *dsPtr, const char *start, const char *current, const char *bspos) { if (!bspos) { if (current > start) { /* part before current (special) */ Tcl_DStringAppend(dsPtr, start, (int) (current - start)); } } else { if (bspos > start) { /* part before first backslash */ Tcl_DStringAppend(dsPtr, start, (int) (bspos - start)); } while (bspos++ < current) { /* each backslash twice */ TclDStringAppendLiteral(dsPtr, "\\\\"); } } } static const char * QuoteCmdLinePart( Tcl_DString *dsPtr, const char *start, const char *special, const char *specMetaChars, const char **bspos) { if (!*bspos) { /* * Rest before special (before quote). */ QuoteCmdLineBackslash(dsPtr, start, special, NULL); start = special; } else { /* * Rest before first backslash and backslashes into new quoted block. */ QuoteCmdLineBackslash(dsPtr, start, *bspos, NULL); start = *bspos; } /* * escape all special chars enclosed in quotes like `"..."`, note that * here we don't must escape `\` (with `\`), because it's outside of the * main quotes, so `\` remains `\`, but important - not at end of part, * because results as before the quote, so `%\%\` should be escaped as * `"%\%"\\`). */ TclDStringAppendLiteral(dsPtr, "\""); /* opening escape quote-char */ do { *bspos = NULL; special++; if (*special == '\\') { /* * Bypass backslashes (and mark first backslash position). */ special = BuildCmdLineBypassBS(special, bspos); if (*special == '\0') { break; } } } while (*special && strchr(specMetaChars, *special)); if (!*bspos) { /* * Unescaped rest before quote. */ QuoteCmdLineBackslash(dsPtr, start, special, NULL); } else { /* * Unescaped rest before first backslash (rather belongs to the main * block). */ QuoteCmdLineBackslash(dsPtr, start, *bspos, NULL); } TclDStringAppendLiteral(dsPtr, "\""); /* closing escape quote-char */ return special; } static void BuildCommandLine( const char *executable, /* Full path of executable (including * extension). Replacement for argv[0]. */ size_t argc, /* Number of arguments. */ const char **argv, /* Argument strings in UTF. */ Tcl_DString *linePtr) /* Initialized Tcl_DString that receives the * command line (WCHAR). */ { const char *arg, *start, *special, *bspos; int quote = 0; size_t i; Tcl_DString ds; #ifdef TCL_WIN_PIPE_FULLESC /* full escape inclusive %-subst avoidance */ static const char specMetaChars[] = "&|^<>!()%"; /* Characters to enclose in quotes if unpaired * quote flag set. */ static const char specMetaChars2[] = "%"; /* Character to enclose in quotes in any case * (regardless of unpaired-flag). */ #else /* escape considering quotation only (no %-subst avoidance) */ static const char specMetaChars[] = "&|^<>!()"; /* Characters to enclose in quotes if unpaired * quote flag set. */ #endif /* * Quote flags: * CL_ESCAPE - escape argument; * CL_QUOTE - enclose in quotes; * CL_UNPAIRED - previous arguments chain contains unpaired quote-char; */ enum {CL_ESCAPE = 1, CL_QUOTE = 2, CL_UNPAIRED = 4}; Tcl_DStringInit(&ds); /* * Prime the path. Add a space separator if we were primed with something. */ TclDStringAppendDString(&ds, linePtr); if (Tcl_DStringLength(linePtr) > 0) { TclDStringAppendLiteral(&ds, " "); } for (i = 0; i < argc; i++) { if (i == 0) { arg = executable; } else { arg = argv[i]; TclDStringAppendLiteral(&ds, " "); } quote &= ~(CL_ESCAPE|CL_QUOTE); /* reset escape flags */ bspos = NULL; if (arg[0] == '\0') { quote = CL_QUOTE; } else { for (start = arg; *start != '\0' && (quote & (CL_ESCAPE|CL_QUOTE)) != (CL_ESCAPE|CL_QUOTE); start++) { if (*start & 0x80) { continue; } if (TclIsSpaceProc(*start)) { quote |= CL_QUOTE; /* quote only */ if (bspos) { /* if backslash found, escape & quote */ quote |= CL_ESCAPE; break; } continue; } if (strchr(specMetaChars, *start)) { quote |= (CL_ESCAPE|CL_QUOTE); /* escape & quote */ break; } if (*start == '"') { quote |= CL_ESCAPE; /* escape only */ continue; } if (*start == '\\') { bspos = start; if (quote & CL_QUOTE) { /* if quote, escape & quote */ quote |= CL_ESCAPE; break; } continue; } } bspos = NULL; } if (quote & CL_QUOTE) { /* * Start of argument (main opening quote-char). */ TclDStringAppendLiteral(&ds, "\""); } if (!(quote & CL_ESCAPE)) { /* * Nothing to escape. */ Tcl_DStringAppend(&ds, arg, TCL_INDEX_NONE); } else { start = arg; for (special = arg; *special != '\0'; ) { /* * Position of `\` is important before quote or at end (equal * `\"` because quoted). */ if (*special == '\\') { /* * Bypass backslashes (and mark first backslash position) */ special = BuildCmdLineBypassBS(special, &bspos); if (*special == '\0') { break; } } /* ["] */ if (*special == '"') { /* * Invert the unpaired flag - observe unpaired quotes */ quote ^= CL_UNPAIRED; /* * Add part before (and escape backslashes before quote). */ QuoteCmdLineBackslash(&ds, start, special, bspos); bspos = NULL; /* * Escape using backslash */ TclDStringAppendLiteral(&ds, "\\\""); start = ++special; continue; } /* * Unpaired (escaped) quote causes special handling on * meta-chars */ if ((quote & CL_UNPAIRED) && strchr(specMetaChars, *special)) { special = QuoteCmdLinePart(&ds, start, special, specMetaChars, &bspos); /* * Start to current or first backslash */ start = !bspos ? special : bspos; continue; } #ifdef TCL_WIN_PIPE_FULLESC /* * Special case for % - should be enclosed always (paired * also) */ if (strchr(specMetaChars2, *special)) { special = QuoteCmdLinePart(&ds, start, special, specMetaChars2, &bspos); /* * Start to current or first backslash. */ start = !bspos ? special : bspos; continue; } #endif /* * Other not special (and not meta) character */ bspos = NULL; /* reset last backslash position (not * interesting) */ special++; } /* * Rest of argument (and escape backslashes before closing main * quote) */ QuoteCmdLineBackslash(&ds, start, special, (quote & CL_QUOTE) ? bspos : NULL); } if (quote & CL_QUOTE) { /* * End of argument (main closing quote-char) */ TclDStringAppendLiteral(&ds, "\""); } } Tcl_DStringFree(linePtr); Tcl_DStringInit(linePtr); Tcl_UtfToWCharDString(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), linePtr); Tcl_DStringFree(&ds); } /* *---------------------------------------------------------------------- * * TclpCreateCommandChannel -- * * This function is called by Tcl_OpenCommandChannel to perform the * platform specific channel initialization for a command channel. * * Results: * Returns a new channel or NULL on failure. * * Side effects: * Allocates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel TclpCreateCommandChannel( TclFile readFile, /* If non-null, gives the file for reading. */ TclFile writeFile, /* If non-null, gives the file for writing. */ TclFile errorFile, /* If non-null, gives the file where errors * can be read. */ size_t numPids, /* The number of pids in the pid array. */ Tcl_Pid *pidPtr) /* An array of process identifiers. */ { char channelName[16 + TCL_INTEGER_SPACE]; PipeInfo *infoPtr = (PipeInfo *)Tcl_Alloc(sizeof(PipeInfo)); PipeInit(); infoPtr->watchMask = 0; infoPtr->flags = 0; infoPtr->readFlags = 0; infoPtr->readFile = readFile; infoPtr->writeFile = writeFile; infoPtr->errorFile = errorFile; infoPtr->numPids = numPids; infoPtr->pidPtr = pidPtr; infoPtr->writeBuf = 0; infoPtr->writeBufLen = 0; infoPtr->writeError = 0; infoPtr->channel = NULL; infoPtr->validMask = 0; infoPtr->threadId = Tcl_GetCurrentThread(); if (readFile != NULL) { /* * Start the background reader thread. */ infoPtr->readable = CreateEventW(NULL, TRUE, TRUE, NULL); infoPtr->readThread = CreateThread(NULL, 256, PipeReaderThread, TclPipeThreadCreateTI(&infoPtr->readTI, infoPtr), 0, NULL); SetThreadPriority(infoPtr->readThread, THREAD_PRIORITY_HIGHEST); infoPtr->validMask |= TCL_READABLE; } else { infoPtr->readTI = NULL; infoPtr->readThread = 0; } if (writeFile != NULL) { /* * Start the background writer thread. */ infoPtr->writable = CreateEventW(NULL, TRUE, TRUE, NULL); infoPtr->writeThread = CreateThread(NULL, 256, PipeWriterThread, TclPipeThreadCreateTI(&infoPtr->writeTI, infoPtr), 0, NULL); SetThreadPriority(infoPtr->writeThread, THREAD_PRIORITY_HIGHEST); infoPtr->validMask |= TCL_WRITABLE; } else { infoPtr->writeTI = NULL; infoPtr->writeThread = 0; } /* * For backward compatibility with previous versions of Tcl, we use * "file%d" as the base name for pipes even though it would be more * natural to use "pipe%d". Use the pointer to keep the channel names * unique, in case channels share handles (stdin/stdout). */ TclWinGenerateChannelName(channelName, "file", infoPtr); infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, infoPtr, infoPtr->validMask); Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto"); return infoPtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_CreatePipe -- * * System dependent interface to create a pipe for the [chan pipe] * command. Stolen from TclX. * * Results: * TCL_OK or TCL_ERROR. * *---------------------------------------------------------------------- */ int Tcl_CreatePipe( Tcl_Interp *interp, /* Errors returned in result.*/ Tcl_Channel *rchan, /* Where to return the read side. */ Tcl_Channel *wchan, /* Where to return the write side. */ TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */ { HANDLE readHandle, writeHandle; SECURITY_ATTRIBUTES sec; sec.nLength = sizeof(SECURITY_ATTRIBUTES); sec.lpSecurityDescriptor = NULL; sec.bInheritHandle = FALSE; if (!CreatePipe(&readHandle, &writeHandle, &sec, 0)) { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "pipe creation failed: %s", Tcl_PosixError(interp))); return TCL_ERROR; } *rchan = Tcl_MakeFileChannel((void *)readHandle, TCL_READABLE); Tcl_RegisterChannel(interp, *rchan); *wchan = Tcl_MakeFileChannel((void *)writeHandle, TCL_WRITABLE); Tcl_RegisterChannel(interp, *wchan); return TCL_OK; } /* *---------------------------------------------------------------------- * * TclGetAndDetachPids -- * * Stores a list of the command PIDs for a command channel in the * interp's result. * * Results: * None. * * Side effects: * Modifies the interp's result. * *---------------------------------------------------------------------- */ void TclGetAndDetachPids( Tcl_Interp *interp, Tcl_Channel chan) { PipeInfo *pipePtr; const Tcl_ChannelType *chanTypePtr; Tcl_Obj *pidsObj; size_t i; /* * Punt if the channel is not a command channel. */ chanTypePtr = Tcl_GetChannelType(chan); if (chanTypePtr != &pipeChannelType) { return; } pipePtr = (PipeInfo *)Tcl_GetChannelInstanceData(chan); TclNewObj(pidsObj); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewWideIntObj( TclpGetPid(pipePtr->pidPtr[i]))); Tcl_DetachPids(1, &pipePtr->pidPtr[i]); } Tcl_SetObjResult(interp, pidsObj); if (pipePtr->numPids > 0) { Tcl_Free(pipePtr->pidPtr); pipePtr->numPids = 0; } } /* *---------------------------------------------------------------------- * * PipeBlockModeProc -- * * Set blocking or non-blocking mode on channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int PipeBlockModeProc( void *instanceData, /* Instance data for channel. */ int mode) /* TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { PipeInfo *infoPtr = (PipeInfo *) instanceData; /* * Pipes on Windows can not be switched between blocking and nonblocking, * hence we have to emulate the behavior. This is done in the input * function by checking against a bit in the state. We set or unset the * bit here to cause the input function to emulate the correct behavior. */ if (mode == TCL_MODE_NONBLOCKING) { infoPtr->flags |= PIPE_ASYNC; } else { infoPtr->flags &= ~(PIPE_ASYNC); } return 0; } /* *---------------------------------------------------------------------- * * PipeClose2Proc -- * * Closes a pipe based IO channel. * * Results: * 0 on success, errno otherwise. * * Side effects: * Closes the physical channel. * *---------------------------------------------------------------------- */ static int PipeClose2Proc( void *instanceData, /* Pointer to PipeInfo structure. */ Tcl_Interp *interp, /* For error reporting. */ int flags) /* Flags that indicate which side to close. */ { PipeInfo *pipePtr = (PipeInfo *) instanceData; Tcl_Channel errChan; int errorCode, result; PipeInfo *infoPtr, **nextPtrPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); int inExit = (TclInExit() || TclInThreadExit()); errorCode = 0; result = 0; if ((!flags || flags & TCL_CLOSE_READ) && (pipePtr->readFile != NULL)) { /* * Clean up the background thread if necessary. Note that this must be * done before we can close the file, since the thread may be blocking * trying to read from the pipe. */ if (pipePtr->readThread) { TclPipeThreadStop(&pipePtr->readTI, pipePtr->readThread); CloseHandle(pipePtr->readThread); CloseHandle(pipePtr->readable); pipePtr->readThread = NULL; } if (TclpCloseFile(pipePtr->readFile) != 0) { errorCode = errno; } pipePtr->validMask &= ~TCL_READABLE; pipePtr->readFile = NULL; } if ((!flags || flags & TCL_CLOSE_WRITE) && (pipePtr->writeFile != NULL)) { if (pipePtr->writeThread) { /* * Wait for the writer thread to finish the current buffer, then * terminate the thread and close the handles. If the channel is * nonblocking or may block during exit, bail out since the worker * thread is not interruptible and we want TIP#398-fast-exit. */ if ((pipePtr->flags & PIPE_ASYNC) && inExit) { /* give it a chance to leave honorably */ TclPipeThreadStopSignal(&pipePtr->writeTI); if (WaitForSingleObject(pipePtr->writable, 20) == WAIT_TIMEOUT) { return EWOULDBLOCK; } } else { WaitForSingleObject(pipePtr->writable, inExit ? 5000 : INFINITE); } TclPipeThreadStop(&pipePtr->writeTI, pipePtr->writeThread); CloseHandle(pipePtr->writable); CloseHandle(pipePtr->writeThread); pipePtr->writeThread = NULL; } if (TclpCloseFile(pipePtr->writeFile) != 0) { if (errorCode == 0) { errorCode = errno; } } pipePtr->validMask &= ~TCL_WRITABLE; pipePtr->writeFile = NULL; } pipePtr->watchMask &= pipePtr->validMask; /* * Don't free the channel if any of the flags were set. */ if (flags) { return errorCode; } /* * Remove the file from the list of watched files. */ for (nextPtrPtr = &(tsdPtr->firstPipePtr), infoPtr = *nextPtrPtr; infoPtr != NULL; nextPtrPtr = &infoPtr->nextPtr, infoPtr = *nextPtrPtr) { if (infoPtr == (PipeInfo *)pipePtr) { *nextPtrPtr = infoPtr->nextPtr; break; } } if ((pipePtr->flags & PIPE_ASYNC) || inExit) { /* * If the channel is non-blocking or Tcl is being cleaned up, just * detach the children PIDs, reap them (important if we are in a * dynamic load module), and discard the errorFile. */ Tcl_DetachPids(pipePtr->numPids, pipePtr->pidPtr); Tcl_ReapDetachedProcs(); if (pipePtr->errorFile) { if (TclpCloseFile(pipePtr->errorFile) != 0) { if (errorCode == 0) { errorCode = errno; } } } result = 0; } else { /* * Wrap the error file into a channel and give it to the cleanup * routine. */ if (pipePtr->errorFile) { WinFile *filePtr = (WinFile *) pipePtr->errorFile; errChan = Tcl_MakeFileChannel((void *)filePtr->handle, TCL_READABLE); Tcl_Free(filePtr); Tcl_SetChannelOption(NULL, errChan, "-profile", "replace"); } else { errChan = NULL; } result = TclCleanupChildren(interp, pipePtr->numPids, pipePtr->pidPtr, errChan); } if (pipePtr->numPids > 0) { Tcl_Free(pipePtr->pidPtr); } if (pipePtr->writeBuf != NULL) { Tcl_Free(pipePtr->writeBuf); } Tcl_Free(pipePtr); if (errorCode == 0) { return result; } return errorCode; } /* *---------------------------------------------------------------------- * * PipeInputProc -- * * Reads input from the IO channel into the buffer given. Returns count * of how many bytes were actually read, and an error indication. * * Results: * A count of how many bytes were read is returned and an error * indication is returned in an output argument. * * Side effects: * Reads input from the actual channel. * *---------------------------------------------------------------------- */ static int PipeInputProc( void *instanceData, /* Pipe state. */ char *buf, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCode) /* Where to store error code. */ { PipeInfo *infoPtr = (PipeInfo *) instanceData; WinFile *filePtr = (WinFile*) infoPtr->readFile; DWORD count, bytesRead = 0; int result; *errorCode = 0; /* * Synchronize with the reader thread. */ result = WaitForRead(infoPtr, (infoPtr->flags & PIPE_ASYNC) ? 0 : 1); /* * If an error occurred, return immediately. */ if (result == -1) { *errorCode = errno; return -1; } if (infoPtr->readFlags & PIPE_EXTRABYTE) { /* * The reader thread consumed 1 byte as a side effect of waiting so we * need to move it into the buffer. */ *buf = infoPtr->extraByte; infoPtr->readFlags &= ~PIPE_EXTRABYTE; buf++; bufSize--; bytesRead = 1; /* * If further read attempts would block, return what we have. */ if (result == 0) { return bytesRead; } } /* * Attempt to read bufSize bytes. The read will return immediately if * there is any data available. Otherwise it will block until at least one * byte is available or an EOF occurs. */ if (ReadFile(filePtr->handle, (LPVOID) buf, (DWORD) bufSize, &count, (LPOVERLAPPED) NULL) == TRUE) { return bytesRead + count; } else if (bytesRead) { /* * Ignore errors if we have data to return. */ return bytesRead; } Tcl_WinConvertError(GetLastError()); if (errno == EPIPE) { infoPtr->readFlags |= PIPE_EOF; return 0; } *errorCode = errno; return -1; } /* *---------------------------------------------------------------------- * * PipeOutputProc -- * * Writes the given output on the IO channel. Returns count of how many * characters were actually written, and an error indication. * * Results: * A count of how many characters were written is returned and an error * indication is returned in an output argument. * * Side effects: * Writes output on the actual channel. * *---------------------------------------------------------------------- */ static int PipeOutputProc( void *instanceData, /* Pipe state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { PipeInfo *infoPtr = (PipeInfo *) instanceData; WinFile *filePtr = (WinFile*) infoPtr->writeFile; DWORD bytesWritten, timeout; *errorCode = 0; /* avoid blocking if pipe-thread exited */ timeout = ((infoPtr->flags & PIPE_ASYNC) || !TclPipeThreadIsAlive(&infoPtr->writeTI) || TclInExit() || TclInThreadExit()) ? 0 : INFINITE; if (WaitForSingleObject(infoPtr->writable, timeout) == WAIT_TIMEOUT) { /* * The writer thread is blocked waiting for a write to complete and * the channel is in non-blocking mode. */ errno = EWOULDBLOCK; goto error; } /* * Check for a background error on the last write. */ if (infoPtr->writeError) { Tcl_WinConvertError(infoPtr->writeError); infoPtr->writeError = 0; goto error; } if (infoPtr->flags & PIPE_ASYNC) { /* * The pipe is non-blocking, so copy the data into the output buffer * and restart the writer thread. */ if (toWrite > infoPtr->writeBufLen) { /* * Reallocate the buffer to be large enough to hold the data. */ if (infoPtr->writeBuf) { Tcl_Free(infoPtr->writeBuf); } infoPtr->writeBufLen = toWrite; infoPtr->writeBuf = (char *)Tcl_Alloc(toWrite); } memcpy(infoPtr->writeBuf, buf, toWrite); infoPtr->toWrite = toWrite; ResetEvent(infoPtr->writable); TclPipeThreadSignal(&infoPtr->writeTI); bytesWritten = toWrite; } else { /* * In the blocking case, just try to write the buffer directly. This * avoids an unnecessary copy. */ if (WriteFile(filePtr->handle, (LPVOID) buf, (DWORD) toWrite, &bytesWritten, (LPOVERLAPPED) NULL) == FALSE) { Tcl_WinConvertError(GetLastError()); goto error; } } return bytesWritten; error: *errorCode = errno; return -1; } /* *---------------------------------------------------------------------- * * PipeEventProc -- * * This function is invoked by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This function invokes Tcl_NotifyChannel * on the pipe. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the notifier callback does. * *---------------------------------------------------------------------- */ static int PipeEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to * handle, such as TCL_FILE_EVENTS. */ { PipeEvent *pipeEvPtr = (PipeEvent *)evPtr; PipeInfo *infoPtr; int mask; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!(flags & TCL_FILE_EVENTS)) { return 0; } /* * Search through the list of watched pipes for the one whose handle * matches the event. We do this rather than simply dereferencing the * handle in the event so that pipes can be deleted while the event is in * the queue. */ for (infoPtr = tsdPtr->firstPipePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (pipeEvPtr->infoPtr == infoPtr) { infoPtr->flags &= ~(PIPE_PENDING); break; } } /* * Remove stale events. */ if (!infoPtr) { return 1; } /* * Check to see if the pipe is readable. Note that we can't tell if a pipe * is writable, so we always report it as being writable unless we have * detected EOF. */ mask = 0; if ((infoPtr->watchMask & TCL_WRITABLE) && (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT)) { mask = TCL_WRITABLE; } if ((infoPtr->watchMask & TCL_READABLE) && (WaitForRead(infoPtr,0) >= 0)) { if (infoPtr->readFlags & PIPE_EOF) { mask = TCL_READABLE; } else { mask |= TCL_READABLE; } } /* * Inform the channel of the events. */ Tcl_NotifyChannel(infoPtr->channel, infoPtr->watchMask & mask); return 1; } /* *---------------------------------------------------------------------- * * PipeWatchProc -- * * Called by the notifier to set up to watch for events on this channel. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void PipeWatchProc( void *instanceData, /* Pipe state. */ int mask) /* What events to watch for, OR-ed combination * of TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { PipeInfo **nextPtrPtr, *ptr; PipeInfo *infoPtr = (PipeInfo *) instanceData; int oldMask = infoPtr->watchMask; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Since most of the work is handled by the background threads, we just * need to update the watchMask and then force the notifier to poll once. */ infoPtr->watchMask = mask & infoPtr->validMask; if (infoPtr->watchMask) { Tcl_Time blockTime = { 0, 0 }; if (!oldMask) { infoPtr->nextPtr = tsdPtr->firstPipePtr; tsdPtr->firstPipePtr = infoPtr; } Tcl_SetMaxBlockTime(&blockTime); } else { if (oldMask) { /* * Remove the pipe from the list of watched pipes. */ for (nextPtrPtr = &(tsdPtr->firstPipePtr), ptr = *nextPtrPtr; ptr != NULL; nextPtrPtr = &ptr->nextPtr, ptr = *nextPtrPtr) { if (infoPtr == ptr) { *nextPtrPtr = ptr->nextPtr; break; } } } } } /* *---------------------------------------------------------------------- * * PipeGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * command pipeline based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int PipeGetHandleProc( void *instanceData, /* The pipe state. */ int direction, /* TCL_READABLE or TCL_WRITABLE */ void **handlePtr) /* Where to store the handle. */ { PipeInfo *infoPtr = (PipeInfo *) instanceData; WinFile *filePtr; if (direction == TCL_READABLE && infoPtr->readFile) { filePtr = (WinFile*) infoPtr->readFile; *handlePtr = (void *)filePtr->handle; return TCL_OK; } if (direction == TCL_WRITABLE && infoPtr->writeFile) { filePtr = (WinFile*) infoPtr->writeFile; *handlePtr = (void *)filePtr->handle; return TCL_OK; } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * Tcl_WaitPid -- * * Emulates the waitpid system call. * * Results: * Returns 0 if the process is still alive, -1 on an error, or the pid on * a clean close. * * Side effects: * Unless WNOHANG is set and the wait times out, the process information * record will be deleted and the process handle will be closed. * *---------------------------------------------------------------------- */ Tcl_Pid Tcl_WaitPid( Tcl_Pid pid, int *statPtr, int options) { ProcInfo *infoPtr = NULL, **prevPtrPtr; DWORD flags; Tcl_Pid result; DWORD ret, exitCode; PipeInit(); /* * If no pid is specified, do nothing. */ if (pid == 0) { *statPtr = 0; return 0; } /* * Find the process and cut it from the process list. */ Tcl_MutexLock(&pipeMutex); prevPtrPtr = &procList; for (infoPtr = procList; infoPtr != NULL; prevPtrPtr = &infoPtr->nextPtr, infoPtr = infoPtr->nextPtr) { if (infoPtr->dwProcessId == (Tcl_Size)pid) { *prevPtrPtr = infoPtr->nextPtr; break; } } Tcl_MutexUnlock(&pipeMutex); /* * If the pid is not one of the processes we know about (we started it) * then do nothing. */ if (infoPtr == NULL) { *statPtr = 0; return 0; } /* * Officially "wait" for it to finish. We either poll (WNOHANG) or wait * for an infinite amount of time. */ if (options & WNOHANG) { flags = 0; } else { flags = INFINITE; } ret = WaitForSingleObject(infoPtr->hProcess, flags); if (ret == WAIT_TIMEOUT) { *statPtr = 0; if (options & WNOHANG) { /* * Re-insert this infoPtr back on the list. */ Tcl_MutexLock(&pipeMutex); infoPtr->nextPtr = procList; procList = infoPtr; Tcl_MutexUnlock(&pipeMutex); return 0; } else { result = 0; } } else if (ret == WAIT_OBJECT_0) { GetExitCodeProcess(infoPtr->hProcess, &exitCode); /* * Does the exit code look like one of the exception codes? */ switch (exitCode) { case EXCEPTION_FLT_DENORMAL_OPERAND: case EXCEPTION_FLT_DIVIDE_BY_ZERO: case EXCEPTION_FLT_INEXACT_RESULT: case EXCEPTION_FLT_INVALID_OPERATION: case EXCEPTION_FLT_OVERFLOW: case EXCEPTION_FLT_STACK_CHECK: case EXCEPTION_FLT_UNDERFLOW: case EXCEPTION_INT_DIVIDE_BY_ZERO: case EXCEPTION_INT_OVERFLOW: *statPtr = 0xC0000000 | SIGFPE; break; case EXCEPTION_PRIV_INSTRUCTION: case EXCEPTION_ILLEGAL_INSTRUCTION: *statPtr = 0xC0000000 | SIGILL; break; case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_NONCONTINUABLE_EXCEPTION: case EXCEPTION_INVALID_DISPOSITION: case EXCEPTION_GUARD_PAGE: case EXCEPTION_INVALID_HANDLE: *statPtr = 0xC0000000 | SIGSEGV; break; case EXCEPTION_DATATYPE_MISALIGNMENT: *statPtr = 0xC0000000 | SIGBUS; break; case EXCEPTION_BREAKPOINT: case EXCEPTION_SINGLE_STEP: *statPtr = 0xC0000000 | SIGTRAP; break; case CONTROL_C_EXIT: *statPtr = 0xC0000000 | SIGINT; break; default: /* * Non-exceptional, normal, exit code. Note that the exit code is * truncated to a signed short range [-32768,32768) whether it * fits into this range or not. * * BUG: Even though the exit code is a DWORD, it is understood by * convention to be a signed integer, yet there isn't enough room * to fit this into the POSIX style waitstatus mask without * truncating it. */ *statPtr = exitCode; break; } result = pid; } else { errno = ECHILD; *statPtr = 0xC0000000 | ECHILD; result = (Tcl_Pid)-1; } /* * Officially close the process handle. */ CloseHandle(infoPtr->hProcess); Tcl_Free(infoPtr); return result; } /* *---------------------------------------------------------------------- * * TclWinAddProcess -- * * Add a process to the process list so that we can use Tcl_WaitPid on * the process. * * Results: * None * * Side effects: * Adds the specified process handle to the process list so Tcl_WaitPid * knows about it. * *---------------------------------------------------------------------- */ void TclWinAddProcess( void *hProcess, /* Handle to process */ Tcl_Size id) /* Global process identifier */ { ProcInfo *procPtr = (ProcInfo *)Tcl_Alloc(sizeof(ProcInfo)); PipeInit(); procPtr->hProcess = hProcess; procPtr->dwProcessId = id; Tcl_MutexLock(&pipeMutex); procPtr->nextPtr = procList; procList = procPtr; Tcl_MutexUnlock(&pipeMutex); } /* *---------------------------------------------------------------------- * * Tcl_PidObjCmd -- * * This function is invoked to process the "pid" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ int Tcl_PidObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Channel chan; const Tcl_ChannelType *chanTypePtr; PipeInfo *pipePtr; size_t i; Tcl_Obj *resultPtr; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?channel?"); return TCL_ERROR; } if (objc == 1) { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid())); } else { chan = Tcl_GetChannel(interp, TclGetString(objv[1]), NULL); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } chanTypePtr = Tcl_GetChannelType(chan); if (chanTypePtr != &pipeChannelType) { return TCL_OK; } pipePtr = (PipeInfo *) Tcl_GetChannelInstanceData(chan); TclNewObj(resultPtr); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(/*interp*/ NULL, resultPtr, Tcl_NewWideIntObj( TclpGetPid(pipePtr->pidPtr[i]))); } Tcl_SetObjResult(interp, resultPtr); } return TCL_OK; } /* *---------------------------------------------------------------------- * * WaitForRead -- * * Wait until some data is available, the pipe is at EOF or the reader * thread is blocked waiting for data (if the channel is in non-blocking * mode). * * Results: * Returns 1 if pipe is readable. Returns 0 if there is no data on the * pipe, but there is buffered data. Returns -1 if an error occurred. If * an error occurred, the threads may not be synchronized. * * Side effects: * Updates the shared state flags and may consume 1 byte of data from the * pipe. If no error occurred, the reader thread is blocked waiting for a * signal from the main thread. * *---------------------------------------------------------------------- */ static int WaitForRead( PipeInfo *infoPtr, /* Pipe state. */ int blocking) /* Indicates whether call should be blocking * or not. */ { DWORD timeout, count; HANDLE handle = ((WinFile *) infoPtr->readFile)->handle; while (1) { /* * Synchronize with the reader thread. */ /* avoid blocking if pipe-thread exited */ timeout = (!blocking || !TclPipeThreadIsAlive(&infoPtr->readTI) || TclInExit() || TclInThreadExit()) ? 0 : INFINITE; if (WaitForSingleObject(infoPtr->readable, timeout) == WAIT_TIMEOUT) { /* * The reader thread is blocked waiting for data and the channel * is in non-blocking mode. */ errno = EWOULDBLOCK; return -1; } /* * At this point, the two threads are synchronized, so it is safe to * access shared state. */ /* * If the pipe has hit EOF, it is always readable. */ if (infoPtr->readFlags & PIPE_EOF) { return 1; } /* * Check to see if there is any data sitting in the pipe. */ if (PeekNamedPipe(handle, (LPVOID) NULL, (DWORD) 0, (LPDWORD) NULL, &count, (LPDWORD) NULL) != TRUE) { Tcl_WinConvertError(GetLastError()); /* * Check to see if the peek failed because of EOF. */ if (errno == EPIPE) { infoPtr->readFlags |= PIPE_EOF; return 1; } /* * Ignore errors if there is data in the buffer. */ if (infoPtr->readFlags & PIPE_EXTRABYTE) { return 0; } else { return -1; } } /* * We found some data in the pipe, so it must be readable. */ if (count > 0) { return 1; } /* * The pipe isn't readable, but there is some data sitting in the * buffer, so return immediately. */ if (infoPtr->readFlags & PIPE_EXTRABYTE) { return 0; } /* * There wasn't any data available, so reset the thread and try again. */ ResetEvent(infoPtr->readable); TclPipeThreadSignal(&infoPtr->readTI); } } /* *---------------------------------------------------------------------- * * PipeReaderThread -- * * This function runs in a separate thread and waits for input to become * available on a pipe. * * Results: * None. * * Side effects: * Signals the main thread when input become available. May cause the * main thread to wake up by posting a message. May consume one byte from * the pipe for each wait operation. Will cause a memory leak of ~4k, if * forcefully terminated with TerminateThread(). * *---------------------------------------------------------------------- */ static DWORD WINAPI PipeReaderThread( LPVOID arg) { TclPipeThreadInfo *pipeTI = (TclPipeThreadInfo *) arg; PipeInfo *infoPtr = NULL; /* access info only after success init/wait */ HANDLE handle = NULL; DWORD count, err; int done = 0; while (!done) { /* * Wait for the main thread to signal before attempting to wait on the * pipe becoming readable. */ if (!TclPipeThreadWaitForSignal(&pipeTI)) { /* exit */ break; } if (!infoPtr) { infoPtr = (PipeInfo *) pipeTI->clientData; handle = ((WinFile *) infoPtr->readFile)->handle; } /* * Try waiting for 0 bytes. This will block until some data is * available on NT, but will return immediately on Win 95. So, if no * data is available after the first read, we block until we can read * a single byte off of the pipe. */ if (ReadFile(handle, NULL, 0, &count, NULL) == FALSE || PeekNamedPipe(handle, NULL, 0, NULL, &count, NULL) == FALSE) { /* * The error is a result of an EOF condition, so set the EOF bit * before signalling the main thread. */ err = GetLastError(); if (err == ERROR_BROKEN_PIPE) { infoPtr->readFlags |= PIPE_EOF; done = 1; } else if (err == ERROR_INVALID_HANDLE) { done = 1; } } else if (count == 0) { if (ReadFile(handle, &(infoPtr->extraByte), 1, &count, NULL) != FALSE) { /* * One byte was consumed as a side effect of waiting for the * pipe to become readable. */ infoPtr->readFlags |= PIPE_EXTRABYTE; } else { err = GetLastError(); if (err == ERROR_BROKEN_PIPE) { /* * The error is a result of an EOF condition, so set the * EOF bit before signalling the main thread. */ infoPtr->readFlags |= PIPE_EOF; done = 1; } else if (err == ERROR_INVALID_HANDLE) { done = 1; } } } /* * Signal the main thread by signalling the readable event and then * waking up the notifier thread. */ SetEvent(infoPtr->readable); /* * Alert the foreground thread. Note that we need to treat this like a * critical section so the foreground thread does not terminate this * thread while we are holding a mutex in the notifier code. */ Tcl_MutexLock(&pipeMutex); if (infoPtr->threadId != NULL) { /* * TIP #218. When in flight ignore the event, no one will receive * it anyway. */ Tcl_ThreadAlert(infoPtr->threadId); } Tcl_MutexUnlock(&pipeMutex); } /* * If state of thread was set to stop, we can sane free info structure, * otherwise it is shared with main thread, so main thread will own it */ TclPipeThreadExit(&pipeTI); return 0; } /* *---------------------------------------------------------------------- * * PipeWriterThread -- * * This function runs in a separate thread and writes data onto a pipe. * * Results: * Always returns 0. * * Side effects: * Signals the main thread when an output operation is completed. May * cause the main thread to wake up by posting a message. * *---------------------------------------------------------------------- */ static DWORD WINAPI PipeWriterThread( LPVOID arg) { TclPipeThreadInfo *pipeTI = (TclPipeThreadInfo *)arg; PipeInfo *infoPtr = NULL; /* access info only after success init/wait */ HANDLE handle = NULL; DWORD count, toWrite; char *buf; int done = 0; while (!done) { /* * Wait for the main thread to signal before attempting to write. */ if (!TclPipeThreadWaitForSignal(&pipeTI)) { /* exit */ break; } if (!infoPtr) { infoPtr = (PipeInfo *)pipeTI->clientData; handle = ((WinFile *) infoPtr->writeFile)->handle; } buf = infoPtr->writeBuf; toWrite = infoPtr->toWrite; /* * Loop until all of the bytes are written or an error occurs. */ while (toWrite > 0) { if (WriteFile(handle, buf, toWrite, &count, NULL) == FALSE) { infoPtr->writeError = GetLastError(); done = 1; break; } else { toWrite -= count; buf += count; } } /* * Signal the main thread by signalling the writable event and then * waking up the notifier thread. */ SetEvent(infoPtr->writable); /* * Alert the foreground thread. Note that we need to treat this like a * critical section so the foreground thread does not terminate this * thread while we are holding a mutex in the notifier code. */ Tcl_MutexLock(&pipeMutex); if (infoPtr->threadId != NULL) { /* * TIP #218. When in flight ignore the event, no one will receive * it anyway. */ Tcl_ThreadAlert(infoPtr->threadId); } Tcl_MutexUnlock(&pipeMutex); } /* * If state of thread was set to stop, we can sane free info structure, * otherwise it is shared with main thread, so main thread will own it. */ TclPipeThreadExit(&pipeTI); return 0; } /* *---------------------------------------------------------------------- * * PipeThreadActionProc -- * * Insert or remove any thread local refs to this channel. * * Results: * None. * * Side effects: * Changes thread local list of valid channels. * *---------------------------------------------------------------------- */ static void PipeThreadActionProc( void *instanceData, int action) { PipeInfo *infoPtr = (PipeInfo *) instanceData; /* * We do not access firstPipePtr in the thread structures. This is not for * all pipes managed by the thread, but only those we are watching. * Removal of the fileevent handlers before transfer thus takes care of * this structure. */ Tcl_MutexLock(&pipeMutex); if (action == TCL_CHANNEL_THREAD_INSERT) { /* * We can't copy the thread information from the channel when the * channel is created. At this time the channel back pointer has not * been set yet. However in that case the threadId has already been * set by TclpCreateCommandChannel itself, so the structure is still * good. */ PipeInit(); if (infoPtr->channel != NULL) { infoPtr->threadId = Tcl_GetChannelThread(infoPtr->channel); } } else { infoPtr->threadId = NULL; } Tcl_MutexUnlock(&pipeMutex); } /* *---------------------------------------------------------------------- * * TclpOpenTemporaryFile -- * * Creates a temporary file, possibly based on the supplied bits and * pieces of template supplied in the first three arguments. If the * fourth argument is non-NULL, it contains a Tcl_Obj to store the name * of the temporary file in (and it is caller's responsibility to clean * up). If the fourth argument is NULL, try to arrange for the temporary * file to go away once it is no longer needed. * * Results: * A read-write Tcl Channel open on the file. * *---------------------------------------------------------------------- */ Tcl_Channel TclpOpenTemporaryFile( TCL_UNUSED(Tcl_Obj *) /*dirObj*/, Tcl_Obj *basenameObj, TCL_UNUSED(Tcl_Obj *) /*extensionObj*/, Tcl_Obj *resultingNameObj) { WCHAR name[MAX_PATH]; char *namePtr; HANDLE handle; DWORD flags = FILE_ATTRIBUTE_TEMPORARY; Tcl_Size length; int counter, counter2; Tcl_DString buf; if (!resultingNameObj) { flags |= FILE_FLAG_DELETE_ON_CLOSE; } namePtr = (char *) name; length = GetTempPathW(MAX_PATH, name); if (length == 0) { goto gotError; } namePtr += length * sizeof(WCHAR); if (basenameObj) { const char *string = TclGetStringFromObj(basenameObj, &length); Tcl_DStringInit(&buf); Tcl_UtfToWCharDString(string, length, &buf); memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf)); namePtr += Tcl_DStringLength(&buf); Tcl_DStringFree(&buf); } else { const WCHAR *baseStr = L"TCL"; length = 3 * sizeof(WCHAR); memcpy(namePtr, baseStr, length); namePtr += length; } counter = TclpGetClicks() % 65533; counter2 = 1024; /* Only try this many times! Prevents * an infinite loop. */ do { char number[TCL_INTEGER_SPACE + 4]; snprintf(number, sizeof(number), "%d.TMP", counter); counter = (unsigned short) (counter + 1); Tcl_DStringInit(&buf); Tcl_UtfToWCharDString(number, strlen(number), &buf); Tcl_DStringSetLength(&buf, Tcl_DStringLength(&buf) + 1); memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf) + 1); Tcl_DStringFree(&buf); handle = CreateFileW(name, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, flags, NULL); } while (handle == INVALID_HANDLE_VALUE && --counter2 > 0 && GetLastError() == ERROR_FILE_EXISTS); if (handle == INVALID_HANDLE_VALUE) { goto gotError; } if (resultingNameObj) { Tcl_Obj *tmpObj = TclpNativeToNormalized(name); Tcl_AppendObjToObj(resultingNameObj, tmpObj); TclDecrRefCount(tmpObj); } return Tcl_MakeFileChannel((void *)handle, TCL_READABLE|TCL_WRITABLE); gotError: Tcl_WinConvertError(GetLastError()); return NULL; } /* *---------------------------------------------------------------------- * * TclPipeThreadCreateTI -- * * Creates a thread info structure, can be owned by worker. * * Results: * Pointer to created TI structure. * *---------------------------------------------------------------------- */ TclPipeThreadInfo * TclPipeThreadCreateTI( TclPipeThreadInfo **pipeTIPtr, void *clientData) { TclPipeThreadInfo *pipeTI; #ifndef _PTI_USE_CKALLOC pipeTI = (TclPipeThreadInfo *)malloc(sizeof(TclPipeThreadInfo)); #else pipeTI = (TclPipeThreadInfo *)Tcl_Alloc(sizeof(TclPipeThreadInfo)); #endif /* !_PTI_USE_CKALLOC */ pipeTI->evControl = CreateEventW(NULL, FALSE, FALSE, NULL); pipeTI->state = PTI_STATE_IDLE; pipeTI->clientData = clientData; return (*pipeTIPtr = pipeTI); } /* *---------------------------------------------------------------------- * * TclPipeThreadWaitForSignal -- * * Wait for work/stop signals inside pipe worker. * * Results: * 1 if signaled to work, 0 if signaled to stop. * * Side effects: * If this function returns 0, TI-structure pointer given via pipeTIPtr * may be NULL, so not accessible (can be owned by main thread). * *---------------------------------------------------------------------- */ int TclPipeThreadWaitForSignal( TclPipeThreadInfo **pipeTIPtr) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; LONG state; DWORD waitResult; if (!pipeTI) { return 0; } /* * Wait for the main thread to signal before attempting to do the work. */ /* * Reset work state of thread (idle/waiting) */ state = InterlockedCompareExchange(&pipeTI->state, PTI_STATE_IDLE, PTI_STATE_WORK); if (state & (PTI_STATE_STOP|PTI_STATE_END)) { /* * End of work, check the owner of structure. */ goto end; } /* * Entering wait */ waitResult = WaitForSingleObject(pipeTI->evControl, INFINITE); if (waitResult != WAIT_OBJECT_0) { /* * The control event was not signaled, so end of work (unexpected * behaviour, main thread can be dead?). */ goto end; } /* * Try to set work state of thread */ state = InterlockedCompareExchange(&pipeTI->state, PTI_STATE_WORK, PTI_STATE_IDLE); if (state & (PTI_STATE_STOP|PTI_STATE_END)) { /* * End of work */ goto end; } /* * Signaled to work. */ return 1; end: /* * End of work, check the owner of the TI structure. */ if (state != PTI_STATE_STOP) { *pipeTIPtr = NULL; } return 0; } /* *---------------------------------------------------------------------- * * TclPipeThreadStopSignal -- * * Send stop signal to the pipe worker (without waiting). * * After calling of this function, TI-structure pointer given via pipeTIPtr * may be NULL. * * Results: * 1 if signaled (or pipe-thread is down), 0 if pipe thread still working. * *---------------------------------------------------------------------- */ int TclPipeThreadStopSignal( TclPipeThreadInfo **pipeTIPtr) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; HANDLE evControl; int state; if (!pipeTI) { return 1; } evControl = pipeTI->evControl; state = InterlockedCompareExchange(&pipeTI->state, PTI_STATE_STOP, PTI_STATE_IDLE); switch (state) { case PTI_STATE_IDLE: /* * Thread was idle/waiting, notify it goes teardown */ SetEvent(evControl); *pipeTIPtr = NULL; TCL_FALLTHROUGH(); case PTI_STATE_DOWN: return 1; default: /* * Thread works currently, we should try to end it, own the TI * structure (because of possible sharing the joint structures with * thread) */ InterlockedExchange(&pipeTI->state, PTI_STATE_END); break; } return 0; } /* *---------------------------------------------------------------------- * * TclPipeThreadStop -- * * Send stop signal to the pipe worker and wait for thread completion. * * May be combined with TclPipeThreadStopSignal. * * After calling of this function, TI-structure pointer given via pipeTIPtr * is not accessible (owned by pipe worker or released here). * * Results: * None. * * Side effects: * Can terminate pipe worker (and / or stop its synchronous operations). * *---------------------------------------------------------------------- */ void TclPipeThreadStop( TclPipeThreadInfo **pipeTIPtr, HANDLE hThread) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; HANDLE evControl; int state; if (!pipeTI) { return; } pipeTI = *pipeTIPtr; evControl = pipeTI->evControl; /* * Try to sane stop the pipe worker, corresponding its current state */ state = InterlockedCompareExchange(&pipeTI->state, PTI_STATE_STOP, PTI_STATE_IDLE); switch (state) { case PTI_STATE_IDLE: /* * Thread was idle/waiting, notify it goes teardown */ SetEvent(evControl); /* * We don't need to wait for it at all, thread frees himself (owns the * TI structure) */ pipeTI = NULL; break; case PTI_STATE_STOP: /* * Already stopped, thread frees himself (owns the TI structure) */ pipeTI = NULL; break; case PTI_STATE_DOWN: /* * Thread already down (?), do nothing */ /* * We don't need to wait for it, but we should free pipeTI */ hThread = NULL; break; /* case PTI_STATE_WORK: */ default: /* * Thread works currently, we should try to end it, own the TI * structure (because of possible sharing the joint structures with * thread) */ state = InterlockedCompareExchange(&pipeTI->state, PTI_STATE_END, PTI_STATE_WORK); if (state == PTI_STATE_DOWN) { /* * We don't need to wait for it, but we should free pipeTI */ hThread = NULL; } break; } if (pipeTI && hThread) { DWORD exitCode; /* * The thread may already have closed on its own. Check its exit * code. */ GetExitCodeThread(hThread, &exitCode); if (exitCode == STILL_ACTIVE) { int inExit = (TclInExit() || TclInThreadExit()); /* * Set the stop event so that if the pipe thread is blocked * somewhere, it may hereafter sane exit cleanly. */ SetEvent(evControl); /* * Cancel all sync-IO of this thread (may be blocked there). */ CancelSynchronousIo(hThread); /* * Wait at most 20 milliseconds for the reader thread to close * (regarding TIP#398-fast-exit). */ /* * If we want TIP#398-fast-exit. */ if (WaitForSingleObject(hThread, inExit ? 0 : 20) == WAIT_TIMEOUT) { /* * The thread must be blocked waiting for the pipe to become * readable in ReadFile(). There isn't a clean way to exit the * thread from this condition. We should terminate the child * process instead to get the reader thread to fall out of * ReadFile with a FALSE. (below) is not the correct way to do * this, but will stay here until a better solution is found. * * Note that we need to guard against terminating the thread * while it is in the middle of Tcl_ThreadAlert because it * won't be able to release the notifier lock. * * Also note that terminating threads during their * initialization or teardown phase may result in ntdll.dll's * LoaderLock to remain locked indefinitely. This causes * ntdll.dll's LdrpInitializeThread() to deadlock trying to * acquire LoaderLock. LdrpInitializeThread() is executed * within new threads to perform initialization and to execute * DllMain() of all loaded dlls. As a result, all new threads * are deadlocked in their initialization phase and never * execute, even though CreateThread() reports successful * thread creation. This results in a very weird process-wide * behavior, which is extremely hard to debug. * * THREADS SHOULD NEVER BE TERMINATED. Period. * * But for now, check if thread is exiting, and if so, let it * die peacefully. * * Also don't terminate if in exit (otherwise deadlocked in * ntdll.dll's). */ if (pipeTI->state != PTI_STATE_DOWN && WaitForSingleObject(hThread, inExit ? 50 : 5000) != WAIT_OBJECT_0) { /* BUG: this leaks memory */ if (inExit || !TerminateThread(hThread, 0)) { /* * in exit or terminate fails, just give thread a * chance to exit */ if (InterlockedExchange(&pipeTI->state, PTI_STATE_STOP) != PTI_STATE_DOWN) { pipeTI = NULL; } } } } } } *pipeTIPtr = NULL; if (pipeTI) { CloseHandle(pipeTI->evControl); #ifndef _PTI_USE_CKALLOC free(pipeTI); #else Tcl_Free(pipeTI); #endif /* !_PTI_USE_CKALLOC */ } } /* *---------------------------------------------------------------------- * * TclPipeThreadExit -- * * Clean-up for the pipe thread (removes owned TI-structure in worker). * * Should be executed on worker exit, to inform the main thread or * free TI-structure (if owned). * * After calling of this function, TI-structure pointer given via pipeTIPtr * is not accessible (owned by main thread or released here). * * Results: * None. * *---------------------------------------------------------------------- */ void TclPipeThreadExit( TclPipeThreadInfo **pipeTIPtr) { LONG state; TclPipeThreadInfo *pipeTI = *pipeTIPtr; /* * If state of thread was set to stop (exactly), we can sane free its info * structure, otherwise it is shared with main thread, so main thread will * own it. */ if (!pipeTI) { return; } *pipeTIPtr = NULL; state = InterlockedExchange(&pipeTI->state, PTI_STATE_DOWN); if (state == PTI_STATE_STOP) { CloseHandle(pipeTI->evControl); #ifndef _PTI_USE_CKALLOC free(pipeTI); #else Tcl_Free(pipeTI); /* be sure all subsystems used are finalized */ Tcl_FinalizeThread(); #endif /* !_PTI_USE_CKALLOC */ } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinPanic.c0000644000175000017500000000404415104661342014726 0ustar sergeisergei/* * tclWinPanic.c -- * * Contains the Windows-specific command-line panic proc. * * Copyright © 2013 Jan Nijtmans. * All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" /* *---------------------------------------------------------------------- * * Tcl_ConsolePanic -- * * Display a message. If a debugger is present, present it directly to * the debugger, otherwise send it to stderr. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ TCL_NORETURN void Tcl_ConsolePanic( const char *format, ...) { #define TCL_MAX_WARN_LEN 26000 va_list argList; WCHAR msgString[TCL_MAX_WARN_LEN]; char buf[TCL_MAX_WARN_LEN * 3]; HANDLE handle = GetStdHandle(STD_ERROR_HANDLE); DWORD dummy; va_start(argList, format); vsnprintf(buf+3, sizeof(buf)-3, format, argList); buf[sizeof(buf)-1] = 0; msgString[TCL_MAX_WARN_LEN-1] = '\0'; MultiByteToWideChar(CP_UTF8, 0, buf+3, -1, msgString, TCL_MAX_WARN_LEN); /* * Truncate MessageBox string if it is too long to not overflow the buffer. */ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') { memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR)); } if (IsDebuggerPresent()) { OutputDebugStringW(msgString); } else if (_isatty(2)) { WriteConsoleW(handle, msgString, (DWORD)wcslen(msgString), &dummy, 0); } else { buf[0] = '\xEF'; buf[1] = '\xBB'; buf[2] = '\xBF'; /* UTF-8 bom */ WriteFile(handle, buf, (DWORD)strlen(buf), &dummy, 0); WriteFile(handle, "\n", 1, &dummy, 0); FlushFileBuffers(handle); } # if defined(__GNUC__) __builtin_trap(); # elif defined(_WIN64) __debugbreak(); # elif defined(_MSC_VER) _asm {int 3} # else DebugBreak(); # endif #if defined(_WIN32) ExitProcess(1); #else abort(); #endif } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ tcl9.0.3/win/tclWinNotify.c0000644000175000017500000003732715104661342015156 0ustar sergeisergei/* * tclWinNotify.c -- * * This file contains Windows-specific procedures for the notifier, which * is the lowest-level part of the Tcl event loop. This file works * together with ../generic/tclNotify.c. * * Copyright © 1995-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. */ #include "tclInt.h" /* * The following static indicates whether this module has been initialized. */ #define INTERVAL_TIMER 1 /* Handle of interval timer. */ #define WM_WAKEUP WM_USER /* Message that is send by * Tcl_AlertNotifier. */ /* * The following static structure contains the state information for the * Windows implementation of the Tcl notifier. One of these structures is * created for each thread that is using the notifier. */ typedef struct { CRITICAL_SECTION crit; /* Monitor for this notifier. */ DWORD thread; /* Identifier for thread associated with this * notifier. */ HANDLE event; /* Event object used to wake up the notifier * thread. */ int pending; /* Alert message pending, this field is locked * by the notifierMutex. */ HWND hwnd; /* Messaging window. */ int timerActive; /* 1 if interval timer is running. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following static indicates the number of threads that have initialized * notifiers. It controls the lifetime of the TclNotifier window class. * * You must hold the notifierMutex lock before accessing this variable. */ static int notifierCount = 0; static const WCHAR className[] = L"TclNotifier"; static int initialized = 0; static CRITICAL_SECTION notifierMutex; /* * Static routines defined in this file. */ static LRESULT CALLBACK NotifierProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* *---------------------------------------------------------------------- * * Tcl_InitNotifier -- * * Initializes the platform specific notifier state. * * Results: * Returns a handle to the notifier state for this thread.. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpInitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); TclpGlobalLock(); if (!initialized) { initialized = 1; InitializeCriticalSection(¬ifierMutex); } TclpGlobalUnlock(); /* * Register Notifier window class if this is the first thread to use this * module. */ EnterCriticalSection(¬ifierMutex); if (notifierCount == 0) { WNDCLASSW clazz; clazz.style = 0; clazz.cbClsExtra = 0; clazz.cbWndExtra = 0; clazz.hInstance = (HINSTANCE) TclWinGetTclInstance(); clazz.hbrBackground = NULL; clazz.lpszMenuName = NULL; clazz.lpszClassName = className; clazz.lpfnWndProc = NotifierProc; clazz.hIcon = NULL; clazz.hCursor = NULL; if (!RegisterClassW(&clazz)) { Tcl_Panic("Tcl_InitNotifier: %s", "unable to register TclNotifier window class"); } } notifierCount++; LeaveCriticalSection(¬ifierMutex); tsdPtr->pending = 0; tsdPtr->timerActive = 0; InitializeCriticalSection(&tsdPtr->crit); tsdPtr->hwnd = NULL; tsdPtr->thread = GetCurrentThreadId(); tsdPtr->event = CreateEventW(NULL, TRUE /* manual */, FALSE /* !signaled */, NULL); return tsdPtr; } /* *---------------------------------------------------------------------- * * TclpFinalizeNotifier -- * * This function is called to cleanup the notifier state before a thread * is terminated. * * Results: * None. * * Side effects: * May dispose of the notifier window and class. * *---------------------------------------------------------------------- */ void TclpFinalizeNotifier( void *clientData) /* Pointer to notifier data. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; /* * Only finalize the notifier if a notifier was installed in the current * thread; there is a route in which this is not guaranteed to be true * (when tclWin32Dll.c:DllMain() is called with the flag * DLL_PROCESS_DETACH by the OS, which could be doing so from a thread * that's never previously been involved with Tcl, e.g. the task manager) * so this check is important. * * Fixes Bug #217982 reported by Hugh Vu and Gene Leache. */ if (tsdPtr == NULL) { return; } DeleteCriticalSection(&tsdPtr->crit); CloseHandle(tsdPtr->event); /* * Clean up the timer and messaging window for this thread. */ if (tsdPtr->hwnd) { KillTimer(tsdPtr->hwnd, INTERVAL_TIMER); DestroyWindow(tsdPtr->hwnd); } /* * If this is the last thread to use the notifier, unregister the notifier * window class. */ EnterCriticalSection(¬ifierMutex); if (notifierCount) { notifierCount--; if (notifierCount == 0) { UnregisterClassW(className, (HINSTANCE) TclWinGetTclInstance()); } } LeaveCriticalSection(¬ifierMutex); } /* *---------------------------------------------------------------------- * * TclpAlertNotifier -- * * Wake up the specified notifier from any thread. This routine is called * by the platform independent notifier code whenever the Tcl_ThreadAlert * routine is called. This routine is guaranteed not to be called on a * given notifier after Tcl_FinalizeNotifier is called for that notifier. * This routine is typically called from a thread other than the * notifier's thread. * * Results: * None. * * Side effects: * Sends a message to the messaging window for the notifier if there * isn't already one pending. * *---------------------------------------------------------------------- */ void TclpAlertNotifier( void *clientData) /* Pointer to thread data. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; /* * Note that we do not need to lock around access to the hwnd because the * race condition has no effect since any race condition implies that the * notifier thread is already awake. */ if (tsdPtr->hwnd) { /* * We do need to lock around access to the pending flag. */ EnterCriticalSection(&tsdPtr->crit); if (!tsdPtr->pending) { PostMessageW(tsdPtr->hwnd, WM_WAKEUP, 0, 0); } tsdPtr->pending = 1; LeaveCriticalSection(&tsdPtr->crit); } else { SetEvent(tsdPtr->event); } } /* *---------------------------------------------------------------------- * * TclpSetTimer -- * * This procedure sets the current notifier timer value. The notifier * will ensure that Tcl_ServiceAll() is called after the specified * interval, even if no events have occurred. * * Results: * None. * * Side effects: * Replaces any previous timer. * *---------------------------------------------------------------------- */ void TclpSetTimer( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); UINT timeout; /* * We only need to set up an interval timer if we're being called from an * external event loop. If we don't have a window handle then we just * return immediately and let Tcl_WaitForEvent handle timeouts. */ if (!tsdPtr->hwnd) { return; } if (!timePtr) { timeout = 0; } else { /* * Make sure we pass a non-zero value into the timeout argument. * Windows seems to get confused by zero length timers. */ timeout = (UINT)timePtr->sec * 1000 + (unsigned long)timePtr->usec / 1000; if (timeout == 0) { timeout = 1; } } if (timeout != 0) { tsdPtr->timerActive = 1; SetTimer(tsdPtr->hwnd, INTERVAL_TIMER, timeout, NULL); } else { tsdPtr->timerActive = 0; KillTimer(tsdPtr->hwnd, INTERVAL_TIMER); } } /* *---------------------------------------------------------------------- * * TclpServiceModeHook -- * * This function is invoked whenever the service mode changes. * * Results: * None. * * Side effects: * If this is the first time the notifier is set into TCL_SERVICE_ALL, * then the communication window is created. * *---------------------------------------------------------------------- */ void TclpServiceModeHook( int mode) /* Either TCL_SERVICE_ALL, or * TCL_SERVICE_NONE. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * If this is the first time that the notifier has been used from a modal * loop, then create a communication window. Note that after this point, * the application needs to service events in a timely fashion or Windows * will hang waiting for the window to respond to synchronous system * messages. At some point, we may want to consider destroying the window * if we leave the modal loop, but for now we'll leave it around. */ if (mode == TCL_SERVICE_ALL && !tsdPtr->hwnd) { tsdPtr->hwnd = CreateWindowW(className, className, WS_TILED, 0, 0, 0, 0, NULL, NULL, (HINSTANCE) TclWinGetTclInstance(), NULL); /* * Send an initial message to the window to ensure that we wake up the * notifier once we get into the modal loop. This will force the * notifier to recompute the timeout value and schedule a timer if one * is needed. */ Tcl_AlertNotifier(tsdPtr); } } /* *---------------------------------------------------------------------- * * TclAsyncNotifier -- * * This procedure is a no-op on Windows. * * Result: * Always true. * * Side effetcs: * None. *---------------------------------------------------------------------- */ int TclAsyncNotifier( TCL_UNUSED(int), /* Signal number. */ TCL_UNUSED(Tcl_ThreadId), /* Target thread. */ TCL_UNUSED(void *), /* Notifier data. */ TCL_UNUSED(int *), /* Flag to mark. */ TCL_UNUSED(int)) /* Value of mark. */ { return 0; } /* *---------------------------------------------------------------------- * * NotifierProc -- * * This procedure is invoked by Windows to process events on the notifier * window. Messages will be sent to this window in response to external * timer events or calls to TclpAlertTsdPtr-> * * Results: * A standard windows result. * * Side effects: * Services any pending events. * *---------------------------------------------------------------------- */ static LRESULT CALLBACK NotifierProc( HWND hwnd, /* Passed on... */ UINT message, /* What messsage is this? */ WPARAM wParam, /* Passed on... */ LPARAM lParam) /* Passed on... */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (message == WM_WAKEUP) { EnterCriticalSection(&tsdPtr->crit); tsdPtr->pending = 0; LeaveCriticalSection(&tsdPtr->crit); } else if (message != WM_TIMER) { return DefWindowProcW(hwnd, message, wParam, lParam); } /* * Process all of the runnable events. */ Tcl_ServiceAll(); return 0; } /* *---------------------------------------------------------------------- * * TclpNotifierData -- * * This function returns a void pointer to be associated * with a Tcl_AsyncHandler. * * Results: * On Windows, returns always NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpNotifierData(void) { return NULL; } /* *---------------------------------------------------------------------- * * TclpWaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then Tcl_WaitForEvent just * polls the event queue without blocking. * * Results: * Returns -1 if a WM_QUIT message is detected, returns 1 if a message * was dispatched, otherwise returns 0. * * Side effects: * Dispatches a message to a window procedure, which could do anything. * *---------------------------------------------------------------------- */ int TclpWaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); MSG msg; DWORD timeout, result; int status; /* * Compute the timeout in milliseconds. */ if (timePtr) { /* * TIP #233 (Virtualized Time). Convert virtual domain delay to * real-time. */ Tcl_Time myTime; myTime.sec = timePtr->sec; myTime.usec = timePtr->usec; if (myTime.sec != 0 || myTime.usec != 0) { TclScaleTime(&myTime); } timeout = (DWORD)myTime.sec * 1000 + (unsigned long)myTime.usec / 1000; } else { timeout = INFINITE; } /* * Check to see if there are any messages in the queue before waiting * because MsgWaitForMultipleObjects will not wake up if there are events * currently sitting in the queue. */ if (!PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) { /* * Wait for something to happen (a signal from another thread, a * message, or timeout) or loop servicing asynchronous procedure calls * queued to this thread. */ do { result = MsgWaitForMultipleObjectsEx(1, &tsdPtr->event, timeout, QS_ALLINPUT, MWMO_ALERTABLE); } while (result == WAIT_IO_COMPLETION); if (result == WAIT_FAILED) { status = -1; goto end; } } /* * Check to see if there are any messages to process. */ if (PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE)) { /* * Retrieve and dispatch the first message. */ result = GetMessageW(&msg, NULL, 0, 0); if (result == 0) { /* * We received a request to exit this thread (WM_QUIT), so * propagate the quit message and start unwinding. */ PostQuitMessage((int) msg.wParam); status = -1; } else if (result == (DWORD) -1) { /* * We got an error from the system. I have no idea why this would * happen, so we'll just unwind. */ status = -1; } else { TranslateMessage(&msg); DispatchMessageW(&msg); status = 1; } } else { status = 0; } end: ResetEvent(tsdPtr->event); return status; } /* *---------------------------------------------------------------------- * * Tcl_Sleep -- * * Delay execution for the specified number of milliseconds. * * Results: * None. * * Side effects: * Time passes. * *---------------------------------------------------------------------- */ void Tcl_Sleep( int ms) /* Number of milliseconds to sleep. */ { /* * Simply calling 'Sleep' for the requisite number of milliseconds can * make the process appear to wake up early because it isn't synchronized * with the CPU performance counter that is used in tclWinTime.c. This * behavior is probably benign, but messes up some of the corner cases in * the test suite. We get around this problem by repeating the 'Sleep' * call as many times as necessary to make the clock advance by the * requisite amount. */ Tcl_Time now; /* Current wall clock time. */ Tcl_Time desired; /* Desired wakeup time. */ Tcl_Time vdelay; /* Time to sleep, for scaling virtual -> * real. */ DWORD sleepTime; /* Time to sleep, real-time */ vdelay.sec = ms / 1000; vdelay.usec = (ms % 1000) * 1000; Tcl_GetTime(&now); desired.sec = now.sec + vdelay.sec; desired.usec = now.usec + vdelay.usec; if (desired.usec > 1000000) { ++desired.sec; desired.usec -= 1000000; } /* * TIP #233: Scale delay from virtual to real-time. */ TclScaleTime(&vdelay); sleepTime = (DWORD)vdelay.sec * 1000 + (unsigned long)vdelay.usec / 1000; for (;;) { SleepEx(sleepTime, TRUE); Tcl_GetTime(&now); if (now.sec > desired.sec) { break; } else if ((now.sec == desired.sec) && (now.usec >= desired.usec)) { break; } vdelay.sec = desired.sec - now.sec; vdelay.usec = desired.usec - now.usec; TclScaleTime(&vdelay); sleepTime = (DWORD)vdelay.sec * 1000 + (unsigned long)vdelay.usec / 1000; } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinLoad.c0000644000175000017500000002773615104661342014570 0ustar sergeisergei/* * tclWinLoad.c -- * * This function provides a version of the TclLoadFile that works with * the Windows "LoadLibrary" and "GetProcAddress" API for dynamic * loading. * * Copyright © 1995-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. */ #include "tclWinInt.h" #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * Native name of the directory in the native filesystem where DLLs used in * this process are copied prior to loading, and mutex used to protect its * allocation. */ static WCHAR *dllDirectoryName = NULL; #if TCL_THREADS static Tcl_Mutex dllDirectoryNameMutex; #endif /* * Static functions defined within this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static int InitDLLDirectoryName(void); static void UnloadFile(Tcl_LoadHandle loadHandle); /* *---------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interp's result. * * Side effects: * New code suddenly appears in memory. * *---------------------------------------------------------------------- */ int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ TCL_UNUSED(int) /*flags*/) { HINSTANCE hInstance = NULL; const WCHAR *nativeName; Tcl_LoadHandle handlePtr; DWORD firstError; /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ nativeName = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (nativeName != NULL) { hInstance = LoadLibraryExW(nativeName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); } if (hInstance == NULL) { /* * Let the OS loader examine the binary search path for whatever * string the user gave us which hopefully refers to a file on the * binary path. */ Tcl_DString ds; /* * Remember the first error on load attempt to be used if the * second load attempt below also fails. */ firstError = (nativeName == NULL) ? ERROR_MOD_NOT_FOUND : GetLastError(); Tcl_DStringInit(&ds); nativeName = Tcl_UtfToWCharDString(TclGetString(pathPtr), TCL_INDEX_NONE, &ds); hInstance = LoadLibraryExW(nativeName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); Tcl_DStringFree(&ds); } if (hInstance == NULL) { DWORD lastError; Tcl_Obj *errMsg; /* * We choose to only use the error from the second call if the first * call failed due to the file not being found. Else stick to the * first error for reporting purposes. */ if (firstError == ERROR_MOD_NOT_FOUND || firstError == ERROR_DLL_NOT_FOUND) { lastError = GetLastError(); } else { lastError = firstError; } errMsg = Tcl_ObjPrintf("couldn't load library \"%s\": ", TclGetString(pathPtr)); /* * Check for possible DLL errors. This doesn't work quite right, * because Windows seems to only return ERROR_MOD_NOT_FOUND for just * about any problem, but it's better than nothing. It'd be even * better if there was a way to get what DLLs */ if (interp) { switch (lastError) { case ERROR_MOD_NOT_FOUND: Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", (char *)NULL); goto notFoundMsg; case ERROR_DLL_NOT_FOUND: Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", (char *)NULL); notFoundMsg: Tcl_AppendToObj(errMsg, "this library or a dependent library" " could not be found in library path", TCL_INDEX_NONE); break; case ERROR_PROC_NOT_FOUND: Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", (char *)NULL); Tcl_AppendToObj(errMsg, "A function specified in the import" " table could not be resolved by the system. Windows" " is not telling which one, I'm sorry.", TCL_INDEX_NONE); break; case ERROR_INVALID_DLL: Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", (char *)NULL); Tcl_AppendToObj(errMsg, "this library or a dependent library" " is damaged", TCL_INDEX_NONE); break; case ERROR_DLL_INIT_FAILED: Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", (char *)NULL); Tcl_AppendToObj(errMsg, "the library initialization" " routine failed", TCL_INDEX_NONE); break; case ERROR_BAD_EXE_FORMAT: Tcl_SetErrorCode(interp, "WIN_LOAD", "BAD_EXE_FORMAT", (char *)NULL); Tcl_AppendToObj(errMsg, "Bad exe format. Possibly a 32/64-bit mismatch.", TCL_INDEX_NONE); break; default: Tcl_WinConvertError(lastError); Tcl_AppendToObj(errMsg, Tcl_PosixError(interp), TCL_INDEX_NONE); } Tcl_SetObjResult(interp, errMsg); } return TCL_ERROR; } /* * Succeded; package everything up for Tcl. */ handlePtr = (Tcl_LoadHandle)Tcl_Alloc(sizeof(struct Tcl_LoadHandle_)); handlePtr->clientData = (void *)hInstance; handlePtr->findSymbolProcPtr = &FindSymbol; handlePtr->unloadFileProcPtr = &UnloadFile; *loadHandle = handlePtr; *unloadProcPtr = &UnloadFile; return TCL_OK; } /* *---------------------------------------------------------------------- * * FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void * FindSymbol( Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol) { HINSTANCE hInstance = (HINSTANCE) loadHandle->clientData; void *proc = NULL; /* * For each symbol, check for both Symbol and _Symbol, since Borland * generates C symbols with a leading '_' by default. */ proc = (void *)GetProcAddress(hInstance, symbol); if (proc == NULL) { Tcl_DString ds; const char *sym2; Tcl_DStringInit(&ds); TclDStringAppendLiteral(&ds, "_"); sym2 = Tcl_DStringAppend(&ds, symbol, TCL_INDEX_NONE); proc = (void *)GetProcAddress(hInstance, sym2); Tcl_DStringFree(&ds); } if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (char *)NULL); } return proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamically loaded binary code file from memory. Code * pointers in the formerly loaded file are no longer valid after calling * this function. * * Results: * None. * * Side effects: * Code removed from memory. * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { HINSTANCE hInstance = (HINSTANCE) loadHandle->clientData; FreeLibrary(hInstance); Tcl_Free(loadHandle); } /* *---------------------------------------------------------------------- * * TclpTempFileNameForLibrary -- * * Constructs a temporary file name for loading a shared object (DLL). * * Results: * Returns the constructed file name. * * On Windows, a DLL is identified by the final component of its path name. * Cross linking among DLL's (and hence, preloading) will not work unless this * name is preserved when copying a DLL from a VFS to a temp file for * preloading. For this reason, all DLLs in a given process are copied to a * temp directory, and their names are preserved. * *---------------------------------------------------------------------- */ Tcl_Obj * TclpTempFileNameForLibrary( Tcl_Interp *interp, /* Tcl interpreter. */ Tcl_Obj *path) /* Path name of the DLL in the VFS. */ { Tcl_Obj *fileName; /* Name of the temp file. */ Tcl_Obj *tail; /* Tail of the source path. */ Tcl_MutexLock(&dllDirectoryNameMutex); if (dllDirectoryName == NULL) { if (InitDLLDirectoryName() == TCL_ERROR) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't create temporary directory: %s", Tcl_PosixError(interp))); Tcl_MutexUnlock(&dllDirectoryNameMutex); return NULL; } } Tcl_MutexUnlock(&dllDirectoryNameMutex); /* * Now we know where to put temporary DLLs, construct the name. */ fileName = TclpNativeToNormalized(dllDirectoryName); tail = TclPathPart(interp, path, TCL_PATH_TAIL); if (tail == NULL) { Tcl_DecrRefCount(fileName); return NULL; } Tcl_AppendToObj(fileName, "/", 1); Tcl_AppendObjToObj(fileName, tail); return fileName; } /* *---------------------------------------------------------------------- * * InitDLLDirectoryName -- * * Helper for TclpTempFileNameForLibrary; builds a temporary directory * that is specific to the current process. Should only be called once * per process start. Caller must hold dllDirectoryNameMutex. * * Results: * Tcl result code. * * Side-effects: * Creates temp directory. * Allocates memory pointed to by dllDirectoryName. * *---------------------------------------------------------------------- * [Candidate for process global?] */ static int InitDLLDirectoryName(void) { size_t nameLen; /* Length of the temp folder name. */ WCHAR name[MAX_PATH]; /* Path name of the temp folder. */ DWORD id; /* The process id. */ DWORD lastError; /* Last error to happen in Win API. */ int i; /* * Determine the name of the directory to use, and create it. (Keep * trying with new names until an attempt to create the directory * succeeds) */ nameLen = GetTempPathW(MAX_PATH, name); if (nameLen >= MAX_PATH-12) { Tcl_SetErrno(ENAMETOOLONG); return TCL_ERROR; } wcscpy(name+nameLen, L"TCLXXXXXXXX"); nameLen += 11; id = GetCurrentProcessId(); lastError = ERROR_ALREADY_EXISTS; for (i=0 ; i<256 ; i++) { wsprintfW(name+nameLen-8, L"%08x", id); if (CreateDirectoryW(name, NULL)) { /* * Issue: we don't schedule this directory for deletion by anyone. * Can we ask the OS to do this for us? There appears to be * potential for using CreateFile (with the flag * FILE_FLAG_BACKUP_SEMANTICS) and RemoveDirectory to do this... */ goto copyToGlobalBuffer; } lastError = GetLastError(); if (lastError != ERROR_ALREADY_EXISTS) { break; } id *= 16777619; } Tcl_WinConvertError(lastError); return TCL_ERROR; /* * Store our computed value in the global. */ copyToGlobalBuffer: dllDirectoryName = (WCHAR *)Tcl_Alloc((nameLen+1) * sizeof(WCHAR)); wcscpy(dllDirectoryName, name); return TCL_OK; } /* * These functions are fallbacks if we somehow determine that the platform can * do loading from memory but the user wishes to disable it. They just report * (gracefully) that they fail. */ #ifdef TCL_LOAD_FROM_MEMORY MODULE_SCOPE void * TclpLoadMemoryGetBuffer( TCL_UNUSED(size_t)) { return NULL; } MODULE_SCOPE int TclpLoadMemory( TCL_UNUSED(void *), TCL_UNUSED(size_t), TCL_UNUSED(Tcl_Size), TCL_UNUSED(const char *), TCL_UNUSED(Tcl_LoadHandle *), TCL_UNUSED(Tcl_FSUnloadFileProc **), TCL_UNUSED(int)) { return TCL_ERROR; } #endif /* TCL_LOAD_FROM_MEMORY */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinInt.h0000644000175000017500000001027215104661342014433 0ustar sergeisergei/* * tclWinInt.h -- * * Declarations of Windows-specific shared variables and procedures. * * Copyright (c) 1994-1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TCLWININT #define _TCLWININT #include "tclInt.h" #ifdef HAVE_NO_SEH /* * Unlike Borland and Microsoft, we don't register exception handlers by * pushing registration records onto the runtime stack. Instead, we register * them by creating an TCLEXCEPTION_REGISTRATION within the activation record. */ typedef struct TCLEXCEPTION_REGISTRATION { struct TCLEXCEPTION_REGISTRATION *link; EXCEPTION_DISPOSITION (*handler)( struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); void *ebp; void *esp; int status; } TCLEXCEPTION_REGISTRATION; #endif /* * Declarations of functions that are not accessible by way of the * stubs table. */ MODULE_SCOPE char TclWinDriveLetterForVolMountPoint( const WCHAR *mountPoint); MODULE_SCOPE void TclWinEncodingsCleanup(void); MODULE_SCOPE void TclWinInit(HINSTANCE hInst); MODULE_SCOPE TclFile TclWinMakeFile(HANDLE handle); MODULE_SCOPE Tcl_Channel TclWinOpenConsoleChannel(HANDLE handle, char *channelName, int permissions); MODULE_SCOPE Tcl_Channel TclWinOpenSerialChannel(HANDLE handle, char *channelName, int permissions); MODULE_SCOPE HANDLE TclWinSerialOpen(HANDLE handle, const WCHAR *name, DWORD access); MODULE_SCOPE int TclWinSymLinkCopyDirectory(const WCHAR *LinkOriginal, const WCHAR *LinkCopy); MODULE_SCOPE int TclWinSymLinkDelete(const WCHAR *LinkOriginal, int linkOnly); MODULE_SCOPE int TclWinFileOwned(Tcl_Obj *); MODULE_SCOPE void TclWinGenerateChannelName(char channelName[], const char *channelTypeName, void *channelImpl); MODULE_SCOPE const char*TclpGetUserName(Tcl_DString *bufferPtr); /* Needed by tclWinFile.c and tclWinFCmd.c */ #ifndef FILE_ATTRIBUTE_REPARSE_POINT #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 #endif /* *---------------------------------------------------------------------- * Declarations of helper-workers threaded facilities for a pipe based channel. * * Corresponding functionality provided in "tclWinPipe.c". *---------------------------------------------------------------------- */ typedef struct TclPipeThreadInfo { HANDLE evControl; /* Auto-reset event used by the main thread to * signal when the pipe thread should attempt * to do read/write operation. Additionally * used as signal to stop (state set to -1) */ volatile LONG state; /* Indicates current state of the thread */ void *clientData; /* Referenced data of the main thread */ } TclPipeThreadInfo; /* If pipe-workers will use some tcl subsystem, we can use Tcl_Alloc without * more overhead for finalize thread (should be executed anyway) * * #define _PTI_USE_CKALLOC 1 */ /* * State of the pipe-worker. * * State PTI_STATE_STOP possible from idle state only, worker owns TI structure. * Otherwise PTI_STATE_END used (main thread hold ownership of the TI). */ enum PipeWorkerStates { PTI_STATE_IDLE = 0, /* idle or not yet initialzed */ PTI_STATE_WORK = 1, /* in work */ PTI_STATE_STOP = 2, /* thread should stop work (owns TI structure) */ PTI_STATE_END = 4, /* thread should stop work (worker is busy) */ PTI_STATE_DOWN = 8 /* worker is down */ }; MODULE_SCOPE TclPipeThreadInfo * TclPipeThreadCreateTI(TclPipeThreadInfo **pipeTIPtr, void *clientData); MODULE_SCOPE int TclPipeThreadWaitForSignal( TclPipeThreadInfo **pipeTIPtr); static inline void TclPipeThreadSignal( TclPipeThreadInfo **pipeTIPtr) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; if (pipeTI) { SetEvent(pipeTI->evControl); } }; static inline int TclPipeThreadIsAlive( TclPipeThreadInfo **pipeTIPtr) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; return (pipeTI && pipeTI->state != PTI_STATE_DOWN); }; MODULE_SCOPE int TclPipeThreadStopSignal(TclPipeThreadInfo **pipeTIPtr); MODULE_SCOPE void TclPipeThreadStop(TclPipeThreadInfo **pipeTIPtr, HANDLE hThread); MODULE_SCOPE void TclPipeThreadExit(TclPipeThreadInfo **pipeTIPtr); #endif /* _TCLWININT */ tcl9.0.3/win/tclWinInit.c0000644000175000017500000005073715104661342014611 0ustar sergeisergei/* * tclWinInit.c -- * * Contains the Windows-specific interpreter initialization functions. * * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclWinInt.h" #include #include #include #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * GetUserNameW() is found in advapi32.dll */ #ifdef _MSC_VER # pragma comment(lib, "advapi32.lib") #endif /* * The following declaration is a workaround for some Microsoft brain damage. * The SYSTEM_INFO structure is different in various releases, even though the * layout is the same. So we overlay our own structure on top of it so we can * access the interesting slots in a uniform way. */ typedef struct { WORD wProcessorArchitecture; WORD wReserved; } OemId; /* * The following arrays contain the human readable strings for the * processor values. */ #define NUMPROCESSORS 15 static const char *const processors[NUMPROCESSORS] = { "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", "amd64", "ia32_on_win64", "neutral", "arm64", "arm32_on_win64", "ia32_on_arm64" }; /* * Forward declarations */ static TclInitProcessGlobalValueProc InitializeDefaultLibraryDir; static TclInitProcessGlobalValueProc InitializeSourceLibraryDir; static void AppendEnvironment(Tcl_Obj *listPtr, const char *lib); /* * The default directory in which the init.tcl file is expected to be found. */ static ProcessGlobalValue defaultLibraryDir = {0, 0, NULL, NULL, InitializeDefaultLibraryDir, NULL, NULL}; static ProcessGlobalValue sourceLibraryDir = {0, 0, NULL, NULL, InitializeSourceLibraryDir, NULL, NULL}; /* * TclpGetWindowsVersionOnce -- * * Callback to retrieve Windows version information. To be invoked only * through InitOnceExecuteOnce for thread safety. * * Results: * None. */ static BOOL CALLBACK TclpGetWindowsVersionOnce( TCL_UNUSED(PINIT_ONCE), TCL_UNUSED(PVOID), PVOID *lpContext) { typedef int(__stdcall getVersionProc)(void *); static OSVERSIONINFOW osInfo; /* * GetVersionExW will not return the "real" Windows version so use * RtlGetVersion if available and falling back. */ HMODULE handle = GetModuleHandleW(L"NTDLL"); getVersionProc *getVersion = (getVersionProc *)(void *)GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (getVersion == NULL || getVersion(&osInfo)) { if (!GetVersionExW(&osInfo)) { /* Should never happen but ...*/ return FALSE; } } *lpContext = (LPVOID)&osInfo; return TRUE; } /* * TclpGetWindowsVersion -- * * Returns a pointer to the OSVERSIONINFOW structure containing the * version information for the current Windows version. * * Results: * Pointer to OSVERSIONINFOW structure. */ static const OSVERSIONINFOW *TclpGetWindowsVersion(void) { static INIT_ONCE osInfoOnce = INIT_ONCE_STATIC_INIT; OSVERSIONINFOW *osInfoPtr = NULL; BOOL result = InitOnceExecuteOnce( &osInfoOnce, TclpGetWindowsVersionOnce, NULL, (LPVOID *)&osInfoPtr); return result ? osInfoPtr : NULL; } /* * TclpGetCodePageOnce -- * * Callback to retrieve user code page. To be invoked only * through InitOnceExecuteOnce for thread safety. * * Results: * None. */ static BOOL CALLBACK TclpGetCodePageOnce( TCL_UNUSED(PINIT_ONCE), TCL_UNUSED(PVOID), PVOID *lpContext) { static char codePage[20]; codePage[0] = 'c'; codePage[1] = 'p'; DWORD size = sizeof(codePage) - 2; /* * When retrieving code page from registry, * - use ANSI API's since all values will be ASCII and saves conversion * - use RegGetValue, not RegQueryValueEx, since the latter does not * guarantee the value is null terminated * - added bonus, RegGetValue is much more convenient to use */ if (RegGetValueA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage", "ACP", RRF_RT_REG_SZ, NULL, codePage+2, &size) != ERROR_SUCCESS) { /* On failure, fallback to GetACP() */ UINT acp = GetACP(); snprintf(codePage, sizeof(codePage), "cp%u", acp); } if (strcmp(codePage, "cp65001") == 0) { strcpy(codePage, "utf-8"); } *lpContext = (LPVOID)&codePage[0]; return TRUE; } /* * TclpGetCodePage -- * * Returns a pointer to the string identifying the user code page. * * For consistency with Windows, which caches the code page at program * startup, the code page is not updated even if the value in the registry * changes. (This is similar to environment variables.) */ static const char * TclpGetCodePage(void) { static INIT_ONCE codePageOnce = INIT_ONCE_STATIC_INIT; const char *codePagePtr = NULL; BOOL result = InitOnceExecuteOnce( &codePageOnce, TclpGetCodePageOnce, NULL, (LPVOID *)&codePagePtr); #ifdef NDEBUG (void) result; /* Keep gcc unused variable quiet */ #else assert(result == TRUE); #endif assert(codePagePtr != NULL); return codePagePtr; } /* *--------------------------------------------------------------------------- * * TclpInitPlatform -- * * Initialize all the platform-dependent things like signals, * floating-point error handling and sockets. * * Called at process initialization time. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void TclpInitPlatform(void) { WSADATA wsaData; WORD wVersionRequested = MAKEWORD(2, 2); tclPlatform = TCL_PLATFORM_WINDOWS; /* * Initialize the winsock library. On Windows XP and higher this * can never fail. */ WSAStartup(wVersionRequested, &wsaData); #ifdef STATIC_BUILD /* * If we are in a statically linked executable, then we need to explicitly * initialize the Windows function tables here since DllMain() will not be * invoked. */ TclWinInit(GetModuleHandleW(NULL)); #endif /* Initialize code page once at startup, will not be updated */ (void)TclpGetCodePage(); } /* *------------------------------------------------------------------------- * * TclpInitLibraryPath -- * * This is the fallback routine that sets the library path if the * application has not set one by the first time it is needed. * * Results: * None. * * Side effects: * Sets the library path to an initial value. * *------------------------------------------------------------------------- */ void TclpInitLibraryPath( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { #define LIBRARY_SIZE 64 Tcl_Obj *pathPtr; char installLib[LIBRARY_SIZE]; const char *bytes; Tcl_Size length; TclNewObj(pathPtr); /* * Initialize the substring used when locating the script library. The * installLib variable computes the script library path relative to the * installed DLL. */ snprintf(installLib, sizeof(installLib), "lib/tcl%s", TCL_VERSION); /* * Look for the library relative to the TCL_LIBRARY env variable. If the * last dirname in the TCL_LIBRARY path does not match the last dirname in * the installLib variable, use the last dir name of installLib in * addition to the original TCL_LIBRARY path. */ AppendEnvironment(pathPtr, installLib); /* * Look for the library in its default location. */ Tcl_ListObjAppendElement(NULL, pathPtr, TclGetProcessGlobalValue(&defaultLibraryDir)); /* * Look for the library in its source checkout location. */ Tcl_ListObjAppendElement(NULL, pathPtr, TclGetProcessGlobalValue(&sourceLibraryDir)); *encodingPtr = NULL; bytes = TclGetStringFromObj(pathPtr, &length); *lengthPtr = length++; *valuePtr = (char *)Tcl_Alloc(length); memcpy(*valuePtr, bytes, length); Tcl_DecrRefCount(pathPtr); } /* *--------------------------------------------------------------------------- * * AppendEnvironment -- * * Append the value of the TCL_LIBRARY environment variable onto the path * pointer. If the env variable points to another version of tcl (e.g. * "tcl8.6") also append the path to this version (e.g., * "tcl8.6/../tcl9.0") * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static void AppendEnvironment( Tcl_Obj *pathPtr, const char *lib) { Tcl_Size pathc; WCHAR wBuf[MAX_PATH]; DWORD dw; char buf[MAX_PATH * 3]; Tcl_Obj *objPtr; Tcl_DString ds; const char **pathv; char *shortlib; /* * The shortlib value needs to be the tail component of the lib path. For * example, "lib/tcl9.0" -> "tcl9.0" while "usr/share/tcl9.0" -> "tcl9.0". */ for (shortlib = (char *) &lib[strlen(lib)-1]; shortlib>lib ; shortlib--) { if (*shortlib == '/') { if ((size_t)(shortlib - lib) == strlen(lib) - 1) { Tcl_Panic("last character in lib cannot be '/'"); } shortlib++; break; } } if (shortlib == lib) { Tcl_Panic("no '/' character found in lib"); } dw = GetEnvironmentVariableW(L"TCL_LIBRARY", wBuf, MAX_PATH); if (dw <= 0 || dw >= MAX_PATH) { return; } if (WideCharToMultiByte( CP_UTF8, 0, wBuf, -1, buf, MAX_PATH * 3, NULL, NULL) == 0) { return; } if (buf[0] != '\0') { objPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE); Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); TclWinNoBackslash(buf); Tcl_SplitPath(buf, &pathc, &pathv); /* * The lstrcmpiA() will work even if pathv[pathc-1] is random UTF-8 * chars because I know shortlib is ascii. */ if ((pathc > 0) && (lstrcmpiA(shortlib, pathv[pathc - 1]) != 0)) { /* * TCL_LIBRARY is set but refers to a different tcl installation * than the current version. Try fiddling with the specified * directory to make it refer to this installation by removing the * old "tclX.Y" and substituting the current version string. */ pathv[pathc - 1] = shortlib; Tcl_DStringInit(&ds); (void) Tcl_JoinPath(pathc, pathv, &ds); objPtr = Tcl_DStringToObj(&ds); } else { objPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE); } Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); Tcl_Free((void *)pathv); } } /* *--------------------------------------------------------------------------- * * InitializeDefaultLibraryDir -- * * Locate the Tcl script library default location relative to the * location of the Tcl DLL. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static void InitializeDefaultLibraryDir( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { HMODULE hModule = (HMODULE)TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)); WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); end = strrchr(name, '\\'); *end = '\0'; p = strrchr(name, '\\'); if (p != NULL) { end = p; } *end = '\\'; TclWinNoBackslash(name); snprintf(end + 1, LIBRARY_SIZE, "lib/tcl%s", TCL_VERSION); *lengthPtr = strlen(name); *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); *encodingPtr = NULL; memcpy(*valuePtr, name, *lengthPtr + 1); } /* *--------------------------------------------------------------------------- * * InitializeSourceLibraryDir -- * * Locate the Tcl script library default location relative to the * location of the Tcl DLL as it exists in the build output directory * associated with the source checkout. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static void InitializeSourceLibraryDir( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { HMODULE hModule = (HMODULE)TclWinGetTclInstance(); WCHAR wName[MAX_PATH + LIBRARY_SIZE]; char name[(MAX_PATH + LIBRARY_SIZE) * 3]; char *end, *p; GetModuleFileNameW(hModule, wName, sizeof(wName)/sizeof(WCHAR)); WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); end = strrchr(name, '\\'); *end = '\0'; p = strrchr(name, '\\'); if (p != NULL) { end = p; } *end = '\\'; TclWinNoBackslash(name); snprintf(end + 1, LIBRARY_SIZE, "../library"); *lengthPtr = strlen(name); *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); *encodingPtr = NULL; memcpy(*valuePtr, name, *lengthPtr + 1); } /* *--------------------------------------------------------------------------- * * TclpSetInitialEncodings -- * * Based on the locale, determine the encoding of the operating system * and the default encoding for newly opened files. * * Called at process initialization time, and part way through startup, * we verify that the initial encodings were correctly setup. Depending * on Tcl's environment, there may not have been enough information first * time through (above). * * Results: * None. * * Side effects: * The Tcl library path is converted from native encoding to UTF-8, on * the first call, and the encodings may be changed on first or second * call. * *--------------------------------------------------------------------------- */ void TclpSetInitialEncodings(void) { Tcl_DString encodingName; Tcl_SetSystemEncoding(NULL, Tcl_GetEncodingNameFromEnvironment(&encodingName)); Tcl_DStringFree(&encodingName); } const char * Tcl_GetEncodingNameForUser( Tcl_DString *bufPtr) { Tcl_DStringInit(bufPtr); Tcl_DStringAppend(bufPtr, TclpGetCodePage(), -1); return Tcl_DStringValue(bufPtr); } const char * Tcl_GetEncodingNameFromEnvironment( Tcl_DString *bufPtr) { const OSVERSIONINFOW *osInfoPtr = TclpGetWindowsVersion(); /* * TIP 716 - for Build 18362 or higher, force utf-8. Note Windows build * numbers always increase, so no need to check major / minor versions. */ if (osInfoPtr && osInfoPtr->dwBuildNumber >= 18362) { Tcl_DStringInit(bufPtr); Tcl_DStringAppend(bufPtr, "utf-8", 5); return Tcl_DStringValue(bufPtr); } else { return Tcl_GetEncodingNameForUser(bufPtr); } } const char * TclpGetUserName( Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * the name of user. */ { Tcl_DStringInit(bufferPtr); if (TclGetEnv("USERNAME", bufferPtr) == NULL) { WCHAR szUserName[UNLEN+1]; DWORD cchUserNameLen = UNLEN; if (!GetUserNameW(szUserName, &cchUserNameLen)) { return NULL; } cchUserNameLen--; Tcl_DStringInit(bufferPtr); Tcl_WCharToUtfDString(szUserName, cchUserNameLen, bufferPtr); } return Tcl_DStringValue(bufferPtr); } /* *--------------------------------------------------------------------------- * * TclpSetVariables -- * * Performs platform-specific interpreter initialization related to the * tcl_platform and env variables, and other platform-specific things. * * Results: * None. * * Side effects: * Sets "tcl_platform", and "env(HOME)" Tcl variables. * *---------------------------------------------------------------------- */ void TclpSetVariables( Tcl_Interp *interp) /* Interp to initialize. */ { typedef int(__stdcall getVersionProc)(void *); const char *ptr; char buffer[TCL_INTEGER_SPACE * 2]; union { SYSTEM_INFO info; OemId oemId; } sys; static OSVERSIONINFOW osInfo; static int osInfoInitialized = 0; Tcl_DString ds; Tcl_SetVar2Ex(interp, "tclDefaultLibrary", NULL, TclGetProcessGlobalValue(&defaultLibraryDir), TCL_GLOBAL_ONLY); if (!osInfoInitialized) { HMODULE handle = GetModuleHandleW(L"NTDLL"); getVersionProc *getVersion = (getVersionProc *) (void *) GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (!getVersion || getVersion(&osInfo)) { GetVersionExW(&osInfo); } osInfoInitialized = 1; } GetSystemInfo(&sys.info); /* * Define the tcl_platform array. */ Tcl_SetVar2(interp, "tcl_platform", "platform", "windows", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY); if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) { osInfo.dwMajorVersion = 11; } snprintf(buffer, sizeof(buffer), "%ld.%ld", osInfo.dwMajorVersion, osInfo.dwMinorVersion); Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY); if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) { Tcl_SetVar2(interp, "tcl_platform", "machine", processors[sys.oemId.wProcessorArchitecture], TCL_GLOBAL_ONLY); } /* * Set up the HOME environment variable from the HOMEDRIVE & HOMEPATH * environment variables, if necessary. */ Tcl_DStringInit(&ds); ptr = Tcl_GetVar2(interp, "env", "HOME", TCL_GLOBAL_ONLY); if (ptr == NULL) { ptr = Tcl_GetVar2(interp, "env", "HOMEDRIVE", TCL_GLOBAL_ONLY); if (ptr != NULL) { Tcl_DStringAppend(&ds, ptr, TCL_INDEX_NONE); } ptr = Tcl_GetVar2(interp, "env", "HOMEPATH", TCL_GLOBAL_ONLY); if (ptr != NULL) { Tcl_DStringAppend(&ds, ptr, TCL_INDEX_NONE); } if (Tcl_DStringLength(&ds) > 0) { Tcl_SetVar2(interp, "env", "HOME", Tcl_DStringValue(&ds), TCL_GLOBAL_ONLY); } else { /* None of HOME, HOMEDRIVE, HOMEPATH exists. Try USERPROFILE */ ptr = Tcl_GetVar2(interp, "env", "USERPROFILE", TCL_GLOBAL_ONLY); if (ptr != NULL && ptr[0]) { Tcl_SetVar2(interp, "env", "HOME", ptr, TCL_GLOBAL_ONLY); } else { /* Last resort */ Tcl_SetVar2(interp, "env", "HOME", "c:\\", TCL_GLOBAL_ONLY); } } } /* * Initialize the user name from the environment first, since this is much * faster than asking the system. * Note: cchUserNameLen is number of characters including nul terminator. */ ptr = TclpGetUserName(&ds); Tcl_SetVar2(interp, "tcl_platform", "user", ptr ? ptr : "", TCL_GLOBAL_ONLY); Tcl_DStringFree(&ds); /* * Define what the platform PATH separator is. [TIP #315] */ Tcl_SetVar2(interp, "tcl_platform", "pathSeparator", ";", TCL_GLOBAL_ONLY); } /* *---------------------------------------------------------------------- * * TclpFindVariable -- * * Locate the entry in environ for a given name. On Unix this routine is * case sensitive, on Windows this matches mixed case. * * Results: * The return value is the index in environ of an entry with the name * "name", or -1 if there is no such entry. The integer * at *lengthPtr is filled in with the length of name (if a matching * entry is found) or the length of the environ array (if no * matching entry is found). * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Size TclpFindVariable( const char *name, /* Name of desired environment variable * (UTF-8). */ Tcl_Size *lengthPtr) /* Used to return length of name (for * successful searches) or number of non-NULL * entries in environ (for unsuccessful * searches). */ { Tcl_Size i, length, result = TCL_INDEX_NONE; const WCHAR *env; const char *p1, *p2; char *envUpper, *nameUpper; Tcl_DString envString; /* * Convert the name to all upper case for the case insensitive comparison. */ length = strlen(name); nameUpper = (char *)Tcl_Alloc(length + 1); memcpy(nameUpper, name, length+1); Tcl_UtfToUpper(nameUpper); Tcl_DStringInit(&envString); for (i = 0, env = _wenviron[i]; env != NULL; i++, env = _wenviron[i]) { /* * Chop the env string off after the equal sign, then Convert the name * to all upper case, so we do not have to convert all the characters * after the equal sign. */ Tcl_DStringInit(&envString); envUpper = Tcl_WCharToUtfDString(env, TCL_INDEX_NONE, &envString); p1 = strchr(envUpper, '='); if (p1 == NULL) { continue; } length = p1 - envUpper; Tcl_DStringSetLength(&envString, length+1); Tcl_UtfToUpper(envUpper); p1 = envUpper; p2 = nameUpper; for (; *p2 == *p1; p1++, p2++) { /* NULL loop body. */ } if ((*p1 == '=') && (*p2 == '\0')) { *lengthPtr = length; result = i; goto done; } Tcl_DStringFree(&envString); } *lengthPtr = i; done: Tcl_DStringFree(&envString); Tcl_Free(nameUpper); return result; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinFile.c0000644000175000017500000024735515104661342014571 0ustar sergeisergei/* * tclWinFile.c -- * * This file contains temporary wrappers around UNIX file handling * functions. These wrappers map the UNIX functions to Win32 HANDLE-style * files, which can be manipulated through the Win32 console redirection * interfaces. * * Copyright © 1995-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclWinInt.h" #include "tclFileSystem.h" #include #include #include /* For TclpGetUserHome(). */ #include /* For TclpGetUserHome(). */ #include /* For GetNamedSecurityInfo */ #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif #ifdef _MSC_VER # pragma comment(lib, "userenv.lib") #endif /* * The number of 100-ns intervals between the Windows system epoch (1601-01-01 * on the proleptic Gregorian calendar) and the Posix epoch (1970-01-01). */ #define POSIX_EPOCH_AS_FILETIME \ ((long long) 116444736 * (long long) 1000000000) /* * Declarations for 'link' related information. This information should come * with VC++ 6.0, but is not in some older SDKs. In any case it is not well * documented. */ #ifndef IO_REPARSE_TAG_RESERVED_ONE # define IO_REPARSE_TAG_RESERVED_ONE 0x000000001 #endif #ifndef IO_REPARSE_TAG_RESERVED_RANGE # define IO_REPARSE_TAG_RESERVED_RANGE 0x000000001 #endif #ifndef IO_REPARSE_TAG_VALID_VALUES # define IO_REPARSE_TAG_VALID_VALUES 0x0E000FFFF #endif #ifndef IO_REPARSE_TAG_HSM # define IO_REPARSE_TAG_HSM 0x0C0000004 #endif #ifndef IO_REPARSE_TAG_NSS # define IO_REPARSE_TAG_NSS 0x080000005 #endif #ifndef IO_REPARSE_TAG_NSSRECOVER # define IO_REPARSE_TAG_NSSRECOVER 0x080000006 #endif #ifndef IO_REPARSE_TAG_SIS # define IO_REPARSE_TAG_SIS 0x080000007 #endif #ifndef IO_REPARSE_TAG_DFS # define IO_REPARSE_TAG_DFS 0x080000008 #endif #ifndef IO_REPARSE_TAG_RESERVED_ZERO # define IO_REPARSE_TAG_RESERVED_ZERO 0x00000000 #endif #ifndef FILE_FLAG_OPEN_REPARSE_POINT # define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #endif #ifndef IO_REPARSE_TAG_MOUNT_POINT # define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 #endif #ifndef IsReparseTagValid # define IsReparseTagValid(x) \ (!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE)) #endif #ifndef IO_REPARSE_TAG_SYMBOLIC_LINK # define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO #endif #ifndef FILE_SPECIAL_ACCESS # define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) #endif #ifndef FSCTL_SET_REPARSE_POINT # define FSCTL_SET_REPARSE_POINT \ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) # define FSCTL_GET_REPARSE_POINT \ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) # define FSCTL_DELETE_REPARSE_POINT \ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) #endif #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) #endif /* * Maximum reparse buffer info size. The max user defined reparse data is * 16KB, plus there's a header. */ #define MAX_REPARSE_SIZE 17000 /* * Undocumented REPARSE_MOUNTPOINT_HEADER_SIZE structure definition. This is * found in winnt.h. * * IMPORTANT: caution when using this structure, since the actual structures * used will want to store a full path in the 'PathBuffer' field, but there * isn't room (there's only a single WCHAR!). Therefore one must artificially * create a larger space of memory and then cast it to this type. We use the * 'DUMMY_REPARSE_BUFFER' struct just below to deal with this problem. */ #define REPARSE_MOUNTPOINT_HEADER_SIZE 8 #ifndef REPARSE_DATA_BUFFER_HEADER_SIZE typedef struct _REPARSE_DATA_BUFFER { DWORD ReparseTag; WORD ReparseDataLength; WORD Reserved; union { struct { WORD SubstituteNameOffset; WORD SubstituteNameLength; WORD PrintNameOffset; WORD PrintNameLength; ULONG Flags; WCHAR PathBuffer[1]; } SymbolicLinkReparseBuffer; struct { WORD SubstituteNameOffset; WORD SubstituteNameLength; WORD PrintNameOffset; WORD PrintNameLength; WCHAR PathBuffer[1]; } MountPointReparseBuffer; struct { BYTE DataBuffer[1]; } GenericReparseBuffer; }; } REPARSE_DATA_BUFFER; #endif typedef struct { REPARSE_DATA_BUFFER dummy; WCHAR dummyBuf[MAX_PATH * 3]; } DUMMY_REPARSE_BUFFER; /* * Other typedefs required by this code. */ static __time64_t ToCTime(FILETIME fileTime); static void FromCTime(__time64_t posixTime, FILETIME *fileTime); /* * Declarations for local functions defined in this file: */ static int NativeAccess(const WCHAR *path, int mode); static int NativeDev(const WCHAR *path); static int NativeStat(const WCHAR *path, Tcl_StatBuf *statPtr, int checkLinks); static unsigned short NativeStatMode(DWORD attr, int checkLinks, int isExec); static int NativeIsExec(const WCHAR *path); static int NativeReadReparse(const WCHAR *LinkDirectory, REPARSE_DATA_BUFFER *buffer, DWORD desiredAccess); static int NativeWriteReparse(const WCHAR *LinkDirectory, REPARSE_DATA_BUFFER *buffer); static int NativeMatchType(int isDrive, DWORD attr, const WCHAR *nativeName, Tcl_GlobTypeData *types); static int WinIsDrive(const char *name, size_t nameLen); static size_t WinIsReserved(const char *path); static Tcl_Obj * WinReadLink(const WCHAR *LinkSource); static Tcl_Obj * WinReadLinkDirectory(const WCHAR *LinkDirectory); static int WinLink(const WCHAR *LinkSource, const WCHAR *LinkTarget, int linkAction); static int WinSymLinkDirectory(const WCHAR *LinkDirectory, const WCHAR *LinkTarget); MODULE_SCOPE void tclWinDebugPanic(const char *format, ...); /* *-------------------------------------------------------------------- * * WinLink -- * * Make a link from source to target. * *-------------------------------------------------------------------- */ static int WinLink( const WCHAR *linkSourcePath, const WCHAR *linkTargetPath, int linkAction) { WCHAR tempFileName[MAX_PATH]; WCHAR *tempFilePart; DWORD attr; /* * Get the full path referenced by the target. */ if (!GetFullPathNameW(linkTargetPath, MAX_PATH, tempFileName, &tempFilePart)) { /* * Invalid file. */ Tcl_WinConvertError(GetLastError()); return -1; } /* * Make sure source file doesn't exist. */ attr = GetFileAttributesW(linkSourcePath); if (attr != INVALID_FILE_ATTRIBUTES) { Tcl_SetErrno(EEXIST); return -1; } /* * Get the full path referenced by the source file/directory. */ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName, &tempFilePart)) { /* * Invalid file. */ Tcl_WinConvertError(GetLastError()); return -1; } /* * Check the target. */ attr = GetFileAttributesW(linkTargetPath); if (attr == INVALID_FILE_ATTRIBUTES) { /* * The target doesn't exist. */ Tcl_WinConvertError(GetLastError()); } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) { /* * It is a file. */ if (linkAction & TCL_CREATE_HARD_LINK) { if (CreateHardLinkW(linkSourcePath, linkTargetPath, NULL)) { /* * Success! */ return 0; } Tcl_WinConvertError(GetLastError()); } else if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { if (CreateSymbolicLinkW(linkSourcePath, linkTargetPath, 0x2 /* SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE */)) { /* * Success! */ return 0; } else { Tcl_WinConvertError(GetLastError()); } } else { Tcl_SetErrno(ENODEV); } } else { /* * We've got a directory. Now check whether what we're trying to do is * reasonable. */ if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { return WinSymLinkDirectory(linkSourcePath, linkTargetPath); } else if (linkAction & TCL_CREATE_HARD_LINK) { /* * Can't hard link directories. */ Tcl_SetErrno(EISDIR); } else { Tcl_SetErrno(ENODEV); } } return -1; } /* *-------------------------------------------------------------------- * * WinReadLink -- * * What does 'LinkSource' point to? * *-------------------------------------------------------------------- */ static Tcl_Obj * WinReadLink( const WCHAR *linkSourcePath) { WCHAR tempFileName[MAX_PATH]; WCHAR *tempFilePart; DWORD attr; /* * Get the full path referenced by the target. */ if (!GetFullPathNameW(linkSourcePath, MAX_PATH, tempFileName, &tempFilePart)) { /* * Invalid file. */ Tcl_WinConvertError(GetLastError()); return NULL; } /* * Make sure source file does exist. */ attr = GetFileAttributesW(linkSourcePath); if (attr == INVALID_FILE_ATTRIBUTES) { /* * The source doesn't exist. */ Tcl_WinConvertError(GetLastError()); return NULL; } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) { /* * It is a file - this is not yet supported. */ Tcl_SetErrno(ENOTDIR); return NULL; } return WinReadLinkDirectory(linkSourcePath); } /* *-------------------------------------------------------------------- * * WinSymLinkDirectory -- * * This routine creates a NTFS junction, using the undocumented * FSCTL_SET_REPARSE_POINT structure Win2K uses for mount points and * junctions. * * Assumption that linkTargetPath is a valid, existing directory. * * Returns: * Zero on success. * *-------------------------------------------------------------------- */ static int WinSymLinkDirectory( const WCHAR *linkDirPath, const WCHAR *linkTargetPath) { DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER *) &dummy; int len; WCHAR nativeTarget[MAX_PATH]; WCHAR *loop; /* * Make the native target name. */ memcpy(nativeTarget, L"\\??\\", 4 * sizeof(WCHAR)); memcpy(nativeTarget + 4, linkTargetPath, sizeof(WCHAR) * (1+wcslen((WCHAR *) linkTargetPath))); len = wcslen(nativeTarget); /* * We must have backslashes only. This is VERY IMPORTANT. If we have any * forward slashes everything appears to work, but the resulting symlink * is useless! */ for (loop = nativeTarget; *loop != 0; loop++) { if (*loop == '/') { *loop = '\\'; } } if ((nativeTarget[len-1] == '\\') && (nativeTarget[len-2] != ':')) { nativeTarget[len-1] = 0; } /* * Build the reparse info. */ memset(reparseBuffer, 0, sizeof(DUMMY_REPARSE_BUFFER)); reparseBuffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; reparseBuffer->MountPointReparseBuffer.SubstituteNameLength = wcslen(nativeTarget) * sizeof(WCHAR); reparseBuffer->Reserved = 0; reparseBuffer->MountPointReparseBuffer.PrintNameLength = 0; reparseBuffer->MountPointReparseBuffer.PrintNameOffset = reparseBuffer->MountPointReparseBuffer.SubstituteNameLength + sizeof(WCHAR); memcpy(reparseBuffer->MountPointReparseBuffer.PathBuffer, nativeTarget, sizeof(WCHAR) + reparseBuffer->MountPointReparseBuffer.SubstituteNameLength); reparseBuffer->ReparseDataLength = reparseBuffer->MountPointReparseBuffer.SubstituteNameLength+12; return NativeWriteReparse(linkDirPath, reparseBuffer); } /* *-------------------------------------------------------------------- * * TclWinSymLinkCopyDirectory -- * * Copy a Windows NTFS junction. This function assumes that LinkOriginal * exists and is a valid junction point, and that LinkCopy does not * exist. * * Returns: * Zero on success. * *-------------------------------------------------------------------- */ int TclWinSymLinkCopyDirectory( const WCHAR *linkOrigPath, /* Existing junction - reparse point */ const WCHAR *linkCopyPath) /* Will become a duplicate junction */ { DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER *) &dummy; if (NativeReadReparse(linkOrigPath, reparseBuffer, GENERIC_READ)) { return -1; } return NativeWriteReparse(linkCopyPath, reparseBuffer); } /* *-------------------------------------------------------------------- * * TclWinSymLinkDelete -- * * Delete a Windows NTFS junction. Once the junction information is * deleted, the filesystem object becomes an ordinary directory. Unless * 'linkOnly' is given, that directory is also removed. * * Assumption that LinkOriginal is a valid, existing junction. * * Returns: * Zero on success. * *-------------------------------------------------------------------- */ int TclWinSymLinkDelete( const WCHAR *linkOrigPath, int linkOnly) { /* * It is a symbolic link - remove it. */ DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER *) &dummy; HANDLE hFile; DWORD returnedLength; memset(reparseBuffer, 0, sizeof(DUMMY_REPARSE_BUFFER)); reparseBuffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; hFile = CreateFileW(linkOrigPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile != INVALID_HANDLE_VALUE) { if (!DeviceIoControl(hFile, FSCTL_DELETE_REPARSE_POINT, reparseBuffer, REPARSE_MOUNTPOINT_HEADER_SIZE,NULL,0,&returnedLength,NULL)) { /* * Error setting junction. */ Tcl_WinConvertError(GetLastError()); CloseHandle(hFile); } else { CloseHandle(hFile); if (!linkOnly) { RemoveDirectoryW(linkOrigPath); } return 0; } } return -1; } /* *-------------------------------------------------------------------- * * WinReadLinkDirectory -- * * This routine reads a NTFS junction, using the undocumented * FSCTL_GET_REPARSE_POINT structure Win2K uses for mount points and * junctions. * * Assumption that LinkDirectory is a valid, existing directory. * * Returns: * A Tcl_Obj with refCount of 1 (i.e. owned by the caller), or NULL if * anything went wrong. * * In the future we should enhance this to return a path object rather * than a string. * *-------------------------------------------------------------------- */ #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #endif static Tcl_Obj * WinReadLinkDirectory( const WCHAR *linkDirPath) { int attr, len, offset; DUMMY_REPARSE_BUFFER dummy; REPARSE_DATA_BUFFER *reparseBuffer = (REPARSE_DATA_BUFFER *) &dummy; Tcl_Obj *retVal; Tcl_DString ds; const char *copy; attr = GetFileAttributesW(linkDirPath); if (!(attr & FILE_ATTRIBUTE_REPARSE_POINT)) { goto invalidError; } if (NativeReadReparse(linkDirPath, reparseBuffer, 0)) { return NULL; } switch (reparseBuffer->ReparseTag) { case 0x80000000|IO_REPARSE_TAG_SYMBOLIC_LINK: case IO_REPARSE_TAG_SYMBOLIC_LINK: case IO_REPARSE_TAG_MOUNT_POINT: /* * Certain native path representations on Windows have a special * prefix to indicate that they are to be treated specially. For * example extremely long paths, or symlinks, or volumes mounted * inside directories. * * There is an assumption in this code that 'wide' interfaces are * being used (see tclWin32Dll.c), which is true for the only systems * which support reparse tags at present. If that changes in the * future, this code will have to be generalised. */ offset = 0; if (reparseBuffer->MountPointReparseBuffer.PathBuffer[0] == '\\') { /* * Check whether this is a mounted volume. */ if (wcsncmp(reparseBuffer->MountPointReparseBuffer.PathBuffer, L"\\??\\Volume{",11) == 0) { char drive; /* * There is some confusion between \??\ and \\?\ which we have * to fix here. It doesn't seem very well documented. */ reparseBuffer->MountPointReparseBuffer.PathBuffer[1] = '\\'; /* * Check if a corresponding drive letter exists, and use that * if it is found */ drive = TclWinDriveLetterForVolMountPoint( reparseBuffer->MountPointReparseBuffer.PathBuffer); if (drive != -1) { char driveSpec[3] = { '\0', ':', '\0' }; driveSpec[0] = drive; retVal = Tcl_NewStringObj(driveSpec,2); Tcl_IncrRefCount(retVal); return retVal; } /* * This is actually a mounted drive, which doesn't exists as a * DOS drive letter. This means the path isn't actually a * link, although we partially treat it like one ('file type' * will return 'link'), but then the link will actually just * be treated like an ordinary directory. I don't believe any * serious inconsistency will arise from this, but it is * something to be aware of. */ goto invalidError; } else if (wcsncmp(reparseBuffer->MountPointReparseBuffer .PathBuffer, L"\\\\?\\",4) == 0) { /* * Strip off the prefix. */ offset = 4; } else if (wcsncmp(reparseBuffer->MountPointReparseBuffer .PathBuffer, L"\\??\\",4) == 0) { /* * Strip off the prefix. */ offset = 4; } } Tcl_DStringInit(&ds); Tcl_WCharToUtfDString( reparseBuffer->MountPointReparseBuffer.PathBuffer, reparseBuffer->MountPointReparseBuffer .SubstituteNameLength>>1, &ds); copy = Tcl_DStringValue(&ds)+offset; len = Tcl_DStringLength(&ds)-offset; retVal = Tcl_NewStringObj(copy,len); Tcl_IncrRefCount(retVal); Tcl_DStringFree(&ds); return retVal; } invalidError: Tcl_SetErrno(EINVAL); return NULL; } #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic pop #endif /* *-------------------------------------------------------------------- * * NativeReadReparse -- * * Read the junction/reparse information from a given NTFS directory. * * Assumption that linkDirPath is a valid, existing directory. * * Returns: * Zero on success. * *-------------------------------------------------------------------- */ static int NativeReadReparse( const WCHAR *linkDirPath, /* The junction to read */ REPARSE_DATA_BUFFER *buffer,/* Pointer to buffer. Cannot be NULL */ DWORD desiredAccess) { HANDLE hFile; DWORD returnedLength; hFile = CreateFileW(linkDirPath, desiredAccess, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) { /* * Error creating directory. */ Tcl_WinConvertError(GetLastError()); return -1; } /* * Get the link. */ if (!DeviceIoControl(hFile, FSCTL_GET_REPARSE_POINT, NULL, 0, buffer, sizeof(DUMMY_REPARSE_BUFFER), &returnedLength, NULL)) { /* * Error setting junction. */ Tcl_WinConvertError(GetLastError()); CloseHandle(hFile); return -1; } CloseHandle(hFile); if (!IsReparseTagValid(buffer->ReparseTag)) { Tcl_SetErrno(EINVAL); return -1; } return 0; } /* *-------------------------------------------------------------------- * * NativeWriteReparse -- * * Write the reparse information for a given directory. * * Assumption that LinkDirectory does not exist. * *-------------------------------------------------------------------- */ static int NativeWriteReparse( const WCHAR *linkDirPath, REPARSE_DATA_BUFFER *buffer) { HANDLE hFile; DWORD returnedLength; /* * Create the directory - it must not already exist. */ if (CreateDirectoryW(linkDirPath, NULL) == 0) { /* * Error creating directory. */ Tcl_WinConvertError(GetLastError()); return -1; } hFile = CreateFileW(linkDirPath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (hFile == INVALID_HANDLE_VALUE) { /* * Error creating directory. */ Tcl_WinConvertError(GetLastError()); return -1; } /* * Set the link. */ if (!DeviceIoControl(hFile, FSCTL_SET_REPARSE_POINT, buffer, (DWORD) buffer->ReparseDataLength + REPARSE_MOUNTPOINT_HEADER_SIZE, NULL, 0, &returnedLength, NULL)) { /* * Error setting junction. */ Tcl_WinConvertError(GetLastError()); CloseHandle(hFile); RemoveDirectoryW(linkDirPath); return -1; } CloseHandle(hFile); /* * We succeeded. */ return 0; } /* *---------------------------------------------------------------------- * * tclWinDebugPanic -- * * Display a message. If a debugger is present, present it directly to * the debugger, otherwise use a MessageBox. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void tclWinDebugPanic( const char *format, ...) { #define TCL_MAX_WARN_LEN 1024 va_list argList; char buf[TCL_MAX_WARN_LEN * 3]; WCHAR msgString[TCL_MAX_WARN_LEN]; va_start(argList, format); vsnprintf(buf, sizeof(buf), format, argList); msgString[TCL_MAX_WARN_LEN-1] = '\0'; MultiByteToWideChar(CP_UTF8, 0, buf, -1, msgString, TCL_MAX_WARN_LEN); /* * Truncate MessageBox string if it is too long to not overflow the screen * and cause possible oversized window error. */ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') { memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR)); } if (IsDebuggerPresent()) { OutputDebugStringW(msgString); } else { MessageBeep(MB_ICONEXCLAMATION); MessageBoxW(NULL, msgString, L"Fatal Error", MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); } } /* *--------------------------------------------------------------------------- * * TclpFindExecutable -- * * This function computes the absolute path name of the current * application. * * Results: * None. * * Side effects: * The computed path is stored. * *--------------------------------------------------------------------------- */ void TclpFindExecutable( TCL_UNUSED(const char *)) { WCHAR wName[MAX_PATH]; char name[MAX_PATH * TCL_UTF_MAX]; GetModuleFileNameW(NULL, wName, sizeof(wName)/sizeof(wName[0])); WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); TclWinNoBackslash(name); TclSetObjNameOfExecutable(Tcl_NewStringObj(name, TCL_INDEX_NONE), NULL); #if !defined(STATIC_BUILD) HMODULE hModule = (HMODULE)TclWinGetTclInstance(); if (hModule) { GetModuleFileNameW(hModule, wName, sizeof(wName) / sizeof(wName[0])); WideCharToMultiByte(CP_UTF8, 0, wName, -1, name, sizeof(name), NULL, NULL); TclSetObjNameOfShlib(Tcl_NewStringObj(name, TCL_AUTO_LENGTH), NULL); } #endif } /* *---------------------------------------------------------------------- * * TclpMatchInDirectory -- * * This routine is used by the globbing code to search a directory for * all files which match a given pattern. * * Results: * The return value is a standard Tcl result indicating whether an error * occurred in globbing. Errors are left in interp, good results are * lappended to resultPtr (which must be a valid object). * * Side effects: * None. * *---------------------------------------------------------------------- */ int TclpMatchInDirectory( Tcl_Interp *interp, /* Interpreter to receive errors. */ Tcl_Obj *resultPtr, /* List object to lappend results. */ Tcl_Obj *pathPtr, /* Contains path to directory to search. */ const char *pattern, /* Pattern to match against. */ Tcl_GlobTypeData *types) /* Object containing list of acceptable types. * May be NULL. In particular the directory * flag is very important. */ { const WCHAR *native; if (types != NULL && types->type == TCL_GLOB_TYPE_MOUNT) { /* * The native filesystem never adds mounts. */ return TCL_OK; } if (pattern == NULL || (*pattern == '\0')) { Tcl_Obj *norm = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (norm != NULL) { /* * Match a single file directly. */ DWORD attr; WIN32_FILE_ATTRIBUTE_DATA data; Tcl_Size len = 0; const char *str; if (norm != pathPtr) { Tcl_IncrRefCount(norm); } str = TclGetStringFromObj(norm, &len); native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (GetFileAttributesExW(native, GetFileExInfoStandard, &data) != TRUE) { if (norm != pathPtr) { Tcl_DecrRefCount(norm); } return TCL_OK; } attr = data.dwFileAttributes; if (NativeMatchType(WinIsDrive(str, len), attr, native, types)) { Tcl_ListObjAppendElement(interp, resultPtr, pathPtr); } if (norm != pathPtr) { Tcl_DecrRefCount(norm); } } return TCL_OK; } else { DWORD attr; HANDLE handle; WIN32_FIND_DATAW data; const char *dirName; /* UTF-8 dir name, later with pattern * appended. */ Tcl_Size dirLength; int matchSpecialDots; Tcl_DString ds; /* Native encoding of dir, also used * temporarily for other things. */ Tcl_DString dsOrig; /* UTF-8 encoding of dir. */ Tcl_Obj *fileNamePtr; char lastChar; /* * Get the normalized path representation (the main thing is we dont * want any '~' sequences). */ fileNamePtr = Tcl_FSGetNormalizedPath(interp, pathPtr); if (fileNamePtr == NULL) { return TCL_ERROR; } /* Ensure it'd be alive, while used. */ if (fileNamePtr != pathPtr) { Tcl_IncrRefCount(fileNamePtr); } /* * Verify that the specified path exists and is actually a directory. */ native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (native == NULL) { if (fileNamePtr != pathPtr) { Tcl_DecrRefCount(fileNamePtr); } return TCL_OK; } attr = GetFileAttributesW(native); if ((attr == INVALID_FILE_ATTRIBUTES) || ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0)) { if (fileNamePtr != pathPtr) { Tcl_DecrRefCount(fileNamePtr); } return TCL_OK; } /* * Build up the directory name for searching, including a trailing * directory separator. */ Tcl_DStringInit(&dsOrig); dirName = TclGetStringFromObj(fileNamePtr, &dirLength); Tcl_DStringAppend(&dsOrig, dirName, dirLength); lastChar = dirName[dirLength -1]; if ((lastChar != '\\') && (lastChar != '/') && (lastChar != ':')) { TclDStringAppendLiteral(&dsOrig, "/"); dirLength++; } if (fileNamePtr != pathPtr) { Tcl_DecrRefCount(fileNamePtr); } dirName = Tcl_DStringValue(&dsOrig); /* * We need to check all files in the directory, so we append '*.*' to * the path, unless the pattern we've been given is rather simple, * when we can use that instead. */ if (strpbrk(pattern, "[]\\") == NULL) { /* * The pattern is a simple one containing just '*' and/or '?'. * This means we can get the OS to help us, by passing it the * pattern. */ dirName = Tcl_DStringAppend(&dsOrig, pattern, TCL_INDEX_NONE); } else { dirName = TclDStringAppendLiteral(&dsOrig, "*.*"); } Tcl_DStringInit(&ds); native = Tcl_UtfToWCharDString(dirName, TCL_INDEX_NONE, &ds); if ((types == NULL) || (types->type != TCL_GLOB_TYPE_DIR)) { handle = FindFirstFileW(native, &data); } else { /* * We can be more efficient, for pure directory requests. */ handle = FindFirstFileExW(native, FindExInfoStandard, &data, FindExSearchLimitToDirectories, NULL, 0); } if (handle == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); Tcl_DStringFree(&ds); if (err == ERROR_FILE_NOT_FOUND) { /* * We used our 'pattern' above, and matched nothing. This * means we just return TCL_OK, indicating no results found. */ Tcl_DStringFree(&dsOrig); return TCL_OK; } Tcl_WinConvertError(err); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read directory \"%s\": %s", Tcl_DStringValue(&dsOrig), Tcl_PosixError(interp))); } Tcl_DStringFree(&dsOrig); return TCL_ERROR; } Tcl_DStringFree(&ds); /* * We may use this later, so we must restore it to its length * including the directory delimiter. */ Tcl_DStringSetLength(&dsOrig, dirLength); /* * Check to see if the pattern should match the special . and * .. names, referring to the current directory, or the directory * above. We need a special check for this because paths beginning * with a dot are not considered hidden on Windows, and so otherwise a * relative glob like 'glob -join * *' will actually return * './. ../..' etc. */ if ((pattern[0] == '.') || ((pattern[0] == '\\') && (pattern[1] == '.'))) { matchSpecialDots = 1; } else { matchSpecialDots = 0; } /* * Now iterate over all of the files in the directory, starting with * the first one we found. */ do { const char *utfname; int checkDrive = 0, isDrive; native = data.cFileName; attr = data.dwFileAttributes; Tcl_DStringInit(&ds); utfname = Tcl_WCharToUtfDString(native, TCL_INDEX_NONE, &ds); if (!matchSpecialDots) { /* * If it is exactly '.' or '..' then we ignore it. */ if ((utfname[0] == '.') && (utfname[1] == '\0' || (utfname[1] == '.' && utfname[2] == '\0'))) { Tcl_DStringFree(&ds); continue; } } else if (utfname[0] == '.' && utfname[1] == '.' && utfname[2] == '\0') { /* * Have to check if this is a drive below, so we can correctly * match 'hidden' and not hidden files. */ checkDrive = 1; } /* * Check to see if the file matches the pattern. Note that we are * ignoring the case sensitivity flag because Windows doesn't * honor case even if the volume is case sensitive. If the volume * also doesn't preserve case, then we previously returned the * lower case form of the name. This didn't seem quite right since * there are non-case-preserving volumes that actually return * mixed case. So now we are returning exactly what we get from * the system. */ if (Tcl_StringCaseMatch(utfname, pattern, 1)) { /* * If the file matches, then we need to process the remainder * of the path. */ if (checkDrive) { const char *fullname = Tcl_DStringAppend(&dsOrig, utfname, Tcl_DStringLength(&ds)); isDrive = WinIsDrive(fullname, Tcl_DStringLength(&dsOrig)); Tcl_DStringSetLength(&dsOrig, dirLength); } else { isDrive = 0; } if (NativeMatchType(isDrive, attr, native, types)) { Tcl_ListObjAppendElement(interp, resultPtr, TclNewFSPathObj(pathPtr, utfname, Tcl_DStringLength(&ds))); } } /* * Free ds here to ensure that native is valid above. */ Tcl_DStringFree(&ds); } while (FindNextFileW(handle, &data) == TRUE); FindClose(handle); Tcl_DStringFree(&dsOrig); return TCL_OK; } } /* * Does the given path represent a root volume? We need this special case * because for NTFS root volumes, the getFileAttributesProc returns a 'hidden' * attribute when it should not. */ static int WinIsDrive( const char *name, /* Name (UTF-8) */ size_t len) /* Length of name */ { int remove = 0; while (len > 4) { if ((name[len-1] != '.' || name[len-2] != '.') || (name[len-3] != '/' && name[len-3] != '\\')) { /* * We don't have '/..' at the end. */ if (remove == 0) { break; } remove--; while (len > 0) { len--; if (name[len] == '/' || name[len] == '\\') { break; } } if (len < 4) { len++; break; } } else { /* * We do have '/..' */ len -= 3; remove++; } } if (len < 4) { if (len == 0) { /* * Not sure if this is possible, but we pass it on anyway. */ } else if (len == 1 && (name[0] == '/' || name[0] == '\\')) { /* * Path is pointing to the root volume. */ return 1; } else if ((name[1] == ':') && (len == 2 || (name[2] == '/' || name[2] == '\\'))) { /* * Path is of the form 'x:' or 'x:/' or 'x:\' */ return 1; } } return 0; } /* * Does the given path represent a reserved window path name? If not return 0, * if true, return the number of characters of the path that we actually want * (not any trailing :). */ static size_t WinIsReserved( const char *path) /* Path in UTF-8 */ { if ((path[0] == 'c' || path[0] == 'C') && (path[1] == 'o' || path[1] == 'O')) { if ((path[2] == 'm' || path[2] == 'M') && path[3] >= '1' && path[3] <= '9') { /* * May have match for 'com[1-9]:?', which is a serial port. */ if (path[4] == '\0') { return 4; } else if (path[4] == ':' && path[5] == '\0') { return 4; } } else if ((path[2] == 'n' || path[2] == 'N') && path[3] == '\0') { /* * Have match for 'con' */ return 3; } } else if ((path[0] == 'l' || path[0] == 'L') && (path[1] == 'p' || path[1] == 'P') && (path[2] == 't' || path[2] == 'T')) { if (path[3] >= '1' && path[3] <= '9') { /* * May have match for 'lpt[1-9]:?' */ if (path[4] == '\0') { return 4; } else if (path[4] == ':' && path[5] == '\0') { return 4; } } } else if (!strcasecmp(path, "prn") || !strcasecmp(path, "nul") || !strcasecmp(path, "aux")) { /* * Have match for 'prn', 'nul' or 'aux'. */ return 3; } return 0; } /* *---------------------------------------------------------------------- * * NativeMatchType -- * * This function needs a special case for a path which is a root volume, * because for NTFS root volumes, the getFileAttributesProc returns a * 'hidden' attribute when it should not. * * We never make any calls to a 'get attributes' routine here, since we * have arranged things so that our caller already knows such * information. * * Results: * 0 = file doesn't match * 1 = file matches * *---------------------------------------------------------------------- */ static int NativeMatchType( int isDrive, /* Is this a drive. */ DWORD attr, /* We already know the attributes for the * file. */ const WCHAR *nativeName, /* Native path to check. */ Tcl_GlobTypeData *types) /* Type description to match against. */ { /* * 'attr' represents the attributes of the file, but we only want to * retrieve this info if it is absolutely necessary because it is an * expensive call. Unfortunately, to deal with hidden files properly, we * must always retrieve it. */ if (types == NULL) { /* * If invisible, don't return the file. */ return !(attr & FILE_ATTRIBUTE_HIDDEN && !isDrive); } if (attr & FILE_ATTRIBUTE_HIDDEN && !isDrive) { /* * If invisible. */ if ((types->perm == 0) || !(types->perm & TCL_GLOB_PERM_HIDDEN)) { return 0; } } else { /* * Visible. */ if (types->perm & TCL_GLOB_PERM_HIDDEN) { return 0; } } if (types->perm != 0) { if (((types->perm & TCL_GLOB_PERM_RONLY) && !(attr & FILE_ATTRIBUTE_READONLY)) || ((types->perm & TCL_GLOB_PERM_R) && (0 /* File exists => R_OK on Windows */)) || ((types->perm & TCL_GLOB_PERM_W) && (attr & FILE_ATTRIBUTE_READONLY)) || ((types->perm & TCL_GLOB_PERM_X) && (!(attr & FILE_ATTRIBUTE_DIRECTORY) && !NativeIsExec(nativeName)))) { return 0; } } if ((types->type & TCL_GLOB_TYPE_DIR) && (attr & FILE_ATTRIBUTE_DIRECTORY)) { /* * Quicker test for directory, which is a common case. */ return 1; } else if (types->type != 0) { unsigned short st_mode; int isExec = NativeIsExec(nativeName); st_mode = NativeStatMode(attr, 0, isExec); /* * In order bcdpfls as in 'find -t' */ if (((types->type&TCL_GLOB_TYPE_BLOCK) && S_ISBLK(st_mode)) || ((types->type&TCL_GLOB_TYPE_CHAR) && S_ISCHR(st_mode)) || ((types->type&TCL_GLOB_TYPE_DIR) && S_ISDIR(st_mode)) || ((types->type&TCL_GLOB_TYPE_PIPE) && S_ISFIFO(st_mode)) || #ifdef S_ISSOCK ((types->type&TCL_GLOB_TYPE_SOCK) && S_ISSOCK(st_mode)) || #endif ((types->type&TCL_GLOB_TYPE_FILE) && S_ISREG(st_mode))) { /* * Do nothing - this file is ok. */ } else { #ifdef S_ISLNK if (types->type & TCL_GLOB_TYPE_LINK) { st_mode = NativeStatMode(attr, 1, isExec); if (S_ISLNK(st_mode)) { return 1; } } #endif /* S_ISLNK */ return 0; } } return 1; } /* *---------------------------------------------------------------------- * * TclpGetUserHome -- * * This function takes the passed in user name and finds the * corresponding home directory specified in the password file. * * Results: * The result is a pointer to a string specifying the user's home * directory, or NULL if the user's home directory could not be * determined. Storage for the result string is allocated in bufferPtr; * the caller must call Tcl_DStringFree() when the result is no longer * needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * TclpGetUserHome( const char *name, /* User name for desired home directory. */ Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * name of user's home directory. */ { char *result = NULL; USER_INFO_1 *uiPtr; Tcl_DString ds; int nameLen = -1; int rc = 0; const char *domain; WCHAR *wName, *wHomeDir, *wDomain; Tcl_DStringInit(bufferPtr); wDomain = NULL; domain = Tcl_UtfFindFirst(name, '@'); if (domain == NULL) { const char *ptr; /* * Treat the current user as a special case because the general case * below does not properly retrieve the path. The NetUserGetInfo * call returns an empty path and the code defaults to the user's * name in the profiles directory. On modern Windows systems, this * is generally wrong as when the account is a Microsoft account, * for example abcdefghi@outlook.com, the directory name is * abcde and not abcdefghi. * * Note we could have just used env(USERPROFILE) here but * the intent is to retrieve (as on Unix) the system's view * of the home irrespective of environment settings of HOME * and USERPROFILE. * * Fixing this for the general user needs more investigating but * at least for the current user we can use a direct call. */ ptr = TclpGetUserName(&ds); if (ptr != NULL && strcasecmp(name, ptr) == 0) { HANDLE hProcess; WCHAR buf[MAX_PATH]; DWORD nChars = sizeof(buf) / sizeof(buf[0]); /* Sadly GetCurrentProcessToken not in Win 7 so slightly longer */ hProcess = GetCurrentProcess(); /* Need not be closed */ if (hProcess) { HANDLE hToken; if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken)) { if (GetUserProfileDirectoryW(hToken, buf, &nChars)) { result = Tcl_WCharToUtfDString(buf, nChars-1, (bufferPtr)); rc = 1; } CloseHandle(hToken); } } } Tcl_DStringFree(&ds); } else { Tcl_DStringInit(&ds); wName = Tcl_UtfToWCharDString(domain + 1, TCL_INDEX_NONE, &ds); rc = NetGetDCName(NULL, wName, (LPBYTE *) &wDomain); Tcl_DStringFree(&ds); nameLen = domain - name; } if (rc == 0) { Tcl_DStringInit(&ds); wName = Tcl_UtfToWCharDString(name, nameLen, &ds); while (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) &uiPtr) != 0) { /* * User does not exist; if domain was not specified, try again * using current domain. */ rc = 1; if (domain != NULL) { break; } /* * Get current domain */ rc = NetGetDCName(NULL, NULL, (LPBYTE *) &wDomain); if (rc != 0) { break; } domain = (const char *)INT2PTR(-1); /* repeat once */ } if (rc == 0) { DWORD i, size = MAX_PATH; wHomeDir = uiPtr->usri1_home_dir; if ((wHomeDir != NULL) && (wHomeDir[0] != '\0')) { size = lstrlenW(wHomeDir); Tcl_WCharToUtfDString(wHomeDir, size, bufferPtr); } else { WCHAR buf[MAX_PATH]; /* * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ GetProfilesDirectoryW(buf, &size); Tcl_WCharToUtfDString(buf, size-1, bufferPtr); Tcl_DStringAppend(bufferPtr, "/", 1); Tcl_DStringAppend(bufferPtr, name, nameLen); } result = Tcl_DStringValue(bufferPtr); /* * Be sure we return normalized path */ for (i = 0; i < size; ++i) { if (result[i] == '\\') { result[i] = '/'; } } NetApiBufferFree((void *)uiPtr); } Tcl_DStringFree(&ds); } if (wDomain != NULL) { NetApiBufferFree((void *)wDomain); } return result; } /* *--------------------------------------------------------------------------- * * NativeAccess -- * * This function replaces the library version of access(), fixing the * following bugs: * * 1. access() returns that all files have execute permission. * * Results: * See access documentation. * * Side effects: * See access documentation. * *--------------------------------------------------------------------------- */ static int NativeAccess( const WCHAR *nativePath, /* Path of file to access, native encoding. */ int mode) /* Permission setting. */ { DWORD attr; attr = GetFileAttributesW(nativePath); if (attr == INVALID_FILE_ATTRIBUTES) { /* * File might not exist. */ DWORD lasterror = GetLastError(); if (lasterror != ERROR_SHARING_VIOLATION) { Tcl_WinConvertError(lasterror); return -1; } } if (mode == F_OK) { /* * File exists, nothing else to check. */ return 0; } /* * If it's not a directory (assume file), do several fast checks: */ if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) { /* * If the attributes say this is not writable at all. The file is a * regular file (i.e., not a directory), then the file is not * writable, full stop. For directories, the read-only bit is * (mostly) ignored by Windows, so we can't ascertain anything about * directory access from the attrib data. However, if we have the * advanced 'getFileSecurityProc', then more robust ACL checks will be * done below. */ if ((mode & W_OK) && (attr & FILE_ATTRIBUTE_READONLY)) { Tcl_SetErrno(EACCES); return -1; } /* * If doesn't have the correct extension, it can't be executable */ if ((mode & X_OK) && !NativeIsExec(nativePath)) { Tcl_SetErrno(EACCES); return -1; } /* * Special case for read/write/executable check on file */ if ((mode & (R_OK|W_OK|X_OK)) && !(mode & ~(R_OK|W_OK|X_OK))) { DWORD mask = 0; HANDLE hFile; if (mode & R_OK) { mask |= GENERIC_READ; } if (mode & W_OK) { mask |= GENERIC_WRITE; } if (mode & X_OK) { mask |= GENERIC_EXECUTE; } hFile = CreateFileW(nativePath, mask, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL); if (hFile != INVALID_HANDLE_VALUE) { CloseHandle(hFile); return 0; } /* * Fast exit if access was denied */ if (GetLastError() == ERROR_ACCESS_DENIED) { Tcl_SetErrno(EACCES); return -1; } } /* * We cannot verify the access fast, check it below using security * info. */ } /* * It looks as if the permissions are ok, but if we are on NT, 2000 or XP, * we have a more complex permissions structure so we try to check that. * The code below is remarkably complex for such a simple thing as finding * what permissions the OS has set for a file. */ { SECURITY_DESCRIPTOR *sdPtr = NULL; unsigned long size; PSID pSid = 0; BOOL SidDefaulted; SID_IDENTIFIER_AUTHORITY samba_unmapped = {{0, 0, 0, 0, 0, 22}}; GENERIC_MAPPING genMap; HANDLE hToken = NULL; DWORD desiredAccess = 0, grantedAccess = 0; BOOL accessYesNo = FALSE; PRIVILEGE_SET privSet; DWORD privSetSize = sizeof(PRIVILEGE_SET); int error; /* * First find out how big the buffer needs to be. */ size = 0; GetFileSecurityW(nativePath, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION, 0, 0, &size); /* * Should have failed with ERROR_INSUFFICIENT_BUFFER */ error = GetLastError(); if (error != ERROR_INSUFFICIENT_BUFFER) { /* * Most likely case is ERROR_ACCESS_DENIED, which we will convert * to EACCES - just what we want! */ Tcl_WinConvertError((DWORD) error); return -1; } /* * Now size contains the size of buffer needed. */ sdPtr = (SECURITY_DESCRIPTOR *) HeapAlloc(GetProcessHeap(), 0, size); if (sdPtr == NULL) { goto accessError; } /* * Call GetFileSecurityW() for real. */ if (!GetFileSecurityW(nativePath, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION, sdPtr, size, &size)) { /* * Error getting owner SD */ goto accessError; } /* * As of Samba 3.0.23 (10-Jul-2006), unmapped users and groups are * assigned to SID domains S-1-22-1 and S-1-22-2, where "22" is the * top-level authority. If the file owner and group is unmapped then * the ACL access check below will only test against world access, * which is likely to be more restrictive than the actual access * restrictions. Since the ACL tests are more likely wrong than * right, skip them. Moreover, the unix owner access permissions are * usually mapped to the Windows attributes, so if the user is the * file owner then the attrib checks above are correct (as far as they * go). */ if(!GetSecurityDescriptorOwner(sdPtr,&pSid,&SidDefaulted) || memcmp(GetSidIdentifierAuthority(pSid),&samba_unmapped, sizeof(SID_IDENTIFIER_AUTHORITY))==0) { HeapFree(GetProcessHeap(), 0, sdPtr); return 0; /* Attrib tests say access allowed. */ } /* * Perform security impersonation of the user and open the resulting * thread token. */ if (!ImpersonateSelf(SecurityImpersonation)) { /* * Unable to perform security impersonation. */ goto accessError; } if (!OpenThreadToken(GetCurrentThread(), TOKEN_DUPLICATE | TOKEN_QUERY, FALSE, &hToken)) { /* * Unable to get current thread's token. */ goto accessError; } RevertToSelf(); /* * Setup desiredAccess according to the access privileges we are * checking. */ if (mode & R_OK) { desiredAccess |= FILE_GENERIC_READ; } if (mode & W_OK) { desiredAccess |= FILE_GENERIC_WRITE; } if (mode & X_OK) { desiredAccess |= FILE_GENERIC_EXECUTE; } memset(&genMap, 0x0, sizeof(GENERIC_MAPPING)); genMap.GenericRead = FILE_GENERIC_READ; genMap.GenericWrite = FILE_GENERIC_WRITE; genMap.GenericExecute = FILE_GENERIC_EXECUTE; genMap.GenericAll = FILE_ALL_ACCESS; /* * Perform access check using the token. */ if (!AccessCheck(sdPtr, hToken, desiredAccess, &genMap, &privSet, &privSetSize, &grantedAccess, &accessYesNo)) { /* * Unable to perform access check. */ accessError: Tcl_WinConvertError(GetLastError()); if (sdPtr != NULL) { HeapFree(GetProcessHeap(), 0, sdPtr); } if (hToken != NULL) { CloseHandle(hToken); } return -1; } /* * Clean up. */ HeapFree(GetProcessHeap(), 0, sdPtr); CloseHandle(hToken); if (!accessYesNo) { Tcl_SetErrno(EACCES); return -1; } } return 0; } /* *---------------------------------------------------------------------- * * NativeIsExec -- * * Determines if a path is executable. On windows this is simply defined * by whether the path ends in a standard executable extension. * * Results: * 1 = executable, 0 = not. * *---------------------------------------------------------------------- */ static int NativeIsExec( const WCHAR *path) { int len = wcslen(path); if (len < 5) { return 0; } if (path[len-4] != '.') { return 0; } path += len-3; if ((_wcsicmp(path, L"exe") == 0) || (_wcsicmp(path, L"com") == 0) || (_wcsicmp(path, L"cmd") == 0) || (_wcsicmp(path, L"bat") == 0)) { return 1; } return 0; } /* *---------------------------------------------------------------------- * * TclpObjChdir -- * * This function replaces the library version of chdir(). * * Results: * See chdir() documentation. * * Side effects: * See chdir() documentation. * *---------------------------------------------------------------------- */ int TclpObjChdir( Tcl_Obj *pathPtr) /* Path to new working directory. */ { int result; const WCHAR *nativePath; nativePath = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (!nativePath) { return -1; } result = SetCurrentDirectoryW(nativePath); if (result == 0) { Tcl_WinConvertError(GetLastError()); return -1; } return 0; } /* *---------------------------------------------------------------------- * * TclpGetCwd -- * * This function replaces the library version of getcwd(). (Obsolete * function, only retained for old extensions which may call it * directly). * * Results: * The result is a pointer to a string specifying the current directory, * or NULL if the current directory could not be determined. If NULL is * returned, an error message is left in the interp's result. Storage for * the result string is allocated in bufferPtr; the caller must call * Tcl_DStringFree() when the result is no longer needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * TclpGetCwd( Tcl_Interp *interp, /* If non-NULL, used for error reporting. */ Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * name of current directory. */ { WCHAR buffer[MAX_PATH]; char *p; WCHAR *native; if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) { Tcl_WinConvertError(GetLastError()); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error getting working directory name: %s", Tcl_PosixError(interp))); } return NULL; } /* * Watch for the weird Windows c:\\UNC syntax. */ native = (WCHAR *) buffer; if ((native[0] != '\0') && (native[1] == ':') && (native[2] == '\\') && (native[3] == '\\')) { native += 2; } Tcl_DStringInit(bufferPtr); Tcl_WCharToUtfDString(native, TCL_INDEX_NONE, bufferPtr); /* * Convert to forward slashes for easier use in scripts. */ for (p = Tcl_DStringValue(bufferPtr); *p != '\0'; p++) { if (*p == '\\') { *p = '/'; } } return Tcl_DStringValue(bufferPtr); } int TclpObjStat( Tcl_Obj *pathPtr, /* Path of file to stat. */ Tcl_StatBuf *statPtr) /* Filled with results of stat call. */ { /* * Ensure correct file sizes by forcing the OS to write any pending data * to disk. This is done only for channels which are dirty, i.e. have been * written to since the last flush here. */ TclWinFlushDirtyChannels(); return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 0); } /* *---------------------------------------------------------------------- * * NativeStat -- * * This function replaces the library version of stat(), fixing the * following bugs: * * 1. stat("c:") returns an error. * 2. Borland stat() return time in GMT instead of localtime. * 3. stat("\\server\mount") would return error. * 4. Accepts slashes or backslashes. * 5. st_dev and st_rdev were wrong for UNC paths. * * Results: * See stat documentation. * * Side effects: * See stat documentation. * *---------------------------------------------------------------------- */ static int NativeStat( const WCHAR *nativePath, /* Path of file to stat */ Tcl_StatBuf *statPtr, /* Filled with results of stat call. */ int checkLinks) /* If non-zero, behave like 'lstat' */ { DWORD attr; int dev, nlink = 1; unsigned short mode; unsigned int inode = 0; HANDLE fileHandle; DWORD fileType = FILE_TYPE_UNKNOWN; /* * If we can use 'createFile' on this, then we can use the resulting * fileHandle to read more information (nlink, ino) than we can get from * other attributes reading APIs. If not, then we try to fall back on the * 'getFileAttributesExProc', and if that isn't available, then on even * simpler routines. * * Special consideration must be given to Windows hard-coded names like * CON, NULL, COM1, LPT1 etc. For these, we still need to do the * CreateFile as some may not exist (e.g. there is no CON in wish by * default). However the subsequent GetFileInformationByHandle will * fail. We do a WinIsReserved to see if it is one of the special names, * and if successful, mock up a BY_HANDLE_FILE_INFORMATION structure. */ fileHandle = CreateFileW(nativePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL); if (fileHandle != INVALID_HANDLE_VALUE) { BY_HANDLE_FILE_INFORMATION data; if (GetFileInformationByHandle(fileHandle,&data) != TRUE) { fileType = GetFileType(fileHandle); CloseHandle(fileHandle); if (fileType != FILE_TYPE_CHAR && fileType != FILE_TYPE_DISK) { Tcl_SetErrno(ENOENT); return -1; } /* * Mock up the expected structure */ memset(&data, 0, sizeof(data)); statPtr->st_atime = 0; statPtr->st_mtime = 0; statPtr->st_ctime = 0; } else { CloseHandle(fileHandle); statPtr->st_atime = ToCTime(data.ftLastAccessTime); statPtr->st_mtime = ToCTime(data.ftLastWriteTime); statPtr->st_ctime = ToCTime(data.ftCreationTime); } attr = data.dwFileAttributes; statPtr->st_size = ((long long) data.nFileSizeLow) | (((long long) data.nFileSizeHigh) << 32); /* * On Unix, for directories, nlink apparently depends on the number of * files in the directory. We could calculate that, but it would be a * bit of a performance penalty, I think. Hence we just use what * Windows gives us, which is the same as Unix for files, at least. */ nlink = data.nNumberOfLinks; /* * Unfortunately our stat definition's inode field (unsigned short) * will throw away most of the precision we have here, which means we * can't rely on inode as a unique identifier of a file. We'd really * like to do something like how we handle 'st_size'. */ inode = data.nFileIndexHigh | data.nFileIndexLow; } else { /* * Fall back on the less capable routines. This means no nlink or ino. */ WIN32_FILE_ATTRIBUTE_DATA data; if (GetFileAttributesExW(nativePath, GetFileExInfoStandard, &data) != TRUE) { HANDLE hFind; WIN32_FIND_DATAW ffd; DWORD lasterror = GetLastError(); if (lasterror != ERROR_SHARING_VIOLATION) { Tcl_WinConvertError(lasterror); return -1; } hFind = FindFirstFileW(nativePath, &ffd); if (hFind == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); return -1; } memcpy(&data, &ffd, sizeof(data)); FindClose(hFind); } attr = data.dwFileAttributes; statPtr->st_size = ((long long) data.nFileSizeLow) | (((long long) data.nFileSizeHigh) << 32); statPtr->st_atime = ToCTime(data.ftLastAccessTime); statPtr->st_mtime = ToCTime(data.ftLastWriteTime); statPtr->st_ctime = ToCTime(data.ftCreationTime); } dev = NativeDev(nativePath); mode = NativeStatMode(attr, checkLinks, NativeIsExec(nativePath)); if (fileType == FILE_TYPE_CHAR) { mode &= ~S_IFMT; mode |= S_IFCHR; } else if (fileType == FILE_TYPE_DISK) { mode &= ~S_IFMT; mode |= S_IFBLK; } statPtr->st_dev = (dev_t) dev; statPtr->st_ino = inode; statPtr->st_mode = mode; statPtr->st_nlink = nlink; statPtr->st_uid = 0; statPtr->st_gid = 0; statPtr->st_rdev = (dev_t) dev; return 0; } /* *---------------------------------------------------------------------- * * NativeDev -- * * Calculate just the 'st_dev' field of a 'stat' structure. * *---------------------------------------------------------------------- */ static int NativeDev( const WCHAR *nativePath) /* Full path of file to stat */ { int dev; Tcl_DString ds; WCHAR nativeFullPath[MAX_PATH]; WCHAR *nativePart; const char *fullPath; GetFullPathNameW(nativePath, MAX_PATH, nativeFullPath, &nativePart); Tcl_DStringInit(&ds); fullPath = Tcl_WCharToUtfDString(nativeFullPath, TCL_INDEX_NONE, &ds); if ((fullPath[0] == '\\') && (fullPath[1] == '\\')) { const char *p; DWORD dw; const WCHAR *nativeVol; Tcl_DString volString; p = strchr(fullPath + 2, '\\'); p = strchr(p + 1, '\\'); if (p == NULL) { /* * Add terminating backslash to fullpath or GetVolumeInformationW() * won't work. */ fullPath = TclDStringAppendLiteral(&ds, "\\"); p = fullPath + Tcl_DStringLength(&ds); } else { p++; } Tcl_DStringInit(&volString); nativeVol = Tcl_UtfToWCharDString(fullPath, p - fullPath, &volString); dw = (DWORD) -1; GetVolumeInformationW(nativeVol, NULL, 0, &dw, NULL, NULL, NULL, 0); /* * GetFullPathNameW() turns special devices like "NUL" into "\\.\NUL", * but GetVolumeInformationW() returns failure for "\\.\NUL". This will * cause "NUL" to get a drive number of -1, which makes about as much * sense as anything since the special devices don't live on any * drive. */ dev = dw; Tcl_DStringFree(&volString); } else if ((fullPath[0] != '\0') && (fullPath[1] == ':')) { dev = Tcl_UniCharToLower(fullPath[0]) - 'a'; } else { dev = -1; } Tcl_DStringFree(&ds); return dev; } /* *---------------------------------------------------------------------- * * NativeStatMode -- * * Calculate just the 'st_mode' field of a 'stat' structure. * * In many places we don't need the full stat structure, and it's much * faster just to calculate these pieces, if that's all we need. * *---------------------------------------------------------------------- */ static unsigned short NativeStatMode( DWORD attr, int checkLinks, int isExec) { int mode; if (checkLinks && (attr & FILE_ATTRIBUTE_REPARSE_POINT)) { /* * It is a link. */ mode = S_IFLNK; } else { mode = (attr & FILE_ATTRIBUTE_DIRECTORY) ? S_IFDIR|S_IEXEC : S_IFREG; } mode |= (attr & FILE_ATTRIBUTE_READONLY) ? S_IREAD : S_IREAD|S_IWRITE; if (isExec) { mode |= S_IEXEC; } /* * Propagate the S_IREAD, S_IWRITE, S_IEXEC bits to the group and other * positions. */ mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 3; mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 6; return (unsigned short) mode; } /* *------------------------------------------------------------------------ * * ToCTime -- * * Converts a Windows FILETIME to a __time64_t in UTC. * * Results: * Returns the count of seconds from the Posix epoch. * *------------------------------------------------------------------------ */ static __time64_t ToCTime( FILETIME fileTime) /* UTC time */ { LARGE_INTEGER convertedTime; convertedTime.LowPart = fileTime.dwLowDateTime; convertedTime.HighPart = (LONG) fileTime.dwHighDateTime; return (__time64_t) ((convertedTime.QuadPart - (long long) POSIX_EPOCH_AS_FILETIME) / (long long) 10000000); } /* *------------------------------------------------------------------------ * * FromCTime -- * * Converts a __time64_t to a Windows FILETIME * * Results: * Returns the count of 100-ns ticks seconds from the Windows epoch. * *------------------------------------------------------------------------ */ static void FromCTime( __time64_t posixTime, FILETIME *fileTime) /* UTC Time */ { LARGE_INTEGER convertedTime; convertedTime.QuadPart = ((LONGLONG) posixTime) * 10000000 + POSIX_EPOCH_AS_FILETIME; fileTime->dwLowDateTime = convertedTime.LowPart; fileTime->dwHighDateTime = convertedTime.HighPart; } /* *--------------------------------------------------------------------------- * * TclpGetNativeCwd -- * * This function replaces the library version of getcwd(). * * Results: * The input and output are filesystem paths in native form. The result * is either the given clientData, if the working directory hasn't * changed, or a new clientData (owned by our caller), giving the new * native path, or NULL if the current directory could not be determined. * If NULL is returned, the caller can examine the standard Posix error * codes to determine the cause of the problem. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpGetNativeCwd( void *clientData) { WCHAR buffer[MAX_PATH]; if (GetCurrentDirectoryW(MAX_PATH, buffer) == 0) { Tcl_WinConvertError(GetLastError()); return NULL; } if (clientData != NULL) { if (wcscmp((const WCHAR *) clientData, buffer) == 0) { return clientData; } } return TclNativeDupInternalRep(buffer); } int TclpObjAccess( Tcl_Obj *pathPtr, int mode) { return NativeAccess((const WCHAR *)Tcl_FSGetNativePath(pathPtr), mode); } int TclpObjLstat( Tcl_Obj *pathPtr, Tcl_StatBuf *statPtr) { /* * Ensure correct file sizes by forcing the OS to write any pending data * to disk. This is done only for channels which are dirty, i.e. have been * written to since the last flush here. */ TclWinFlushDirtyChannels(); return NativeStat((const WCHAR *)Tcl_FSGetNativePath(pathPtr), statPtr, 1); } #ifdef S_IFLNK Tcl_Obj * TclpObjLink( Tcl_Obj *pathPtr, Tcl_Obj *toPtr, int linkAction) { if (toPtr != NULL) { int res; const WCHAR *LinkTarget; const WCHAR *LinkSource = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); Tcl_Obj *normToPtr = Tcl_FSGetNormalizedPath(NULL, toPtr); if (normToPtr == NULL) { return NULL; } if (normToPtr != toPtr) { Tcl_IncrRefCount(normToPtr); } LinkTarget = (const WCHAR *)Tcl_FSGetNativePath(normToPtr); if (LinkSource == NULL || LinkTarget == NULL) { if (normToPtr != toPtr) { Tcl_DecrRefCount(normToPtr); } return NULL; } res = WinLink(LinkSource, LinkTarget, linkAction); if (normToPtr != toPtr) { Tcl_DecrRefCount(normToPtr); } if (res == 0) { return toPtr; } else { return NULL; } } else { const WCHAR *LinkSource = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (LinkSource == NULL) { return NULL; } return WinReadLink(LinkSource); } } #endif /* S_IFLNK */ /* *--------------------------------------------------------------------------- * * TclpFilesystemPathType -- * * This function is part of the native filesystem support, and returns * the path type of the given path. Returns NTFS or FAT or whatever is * returned by the 'volume information' proc. * * Results: * NULL at present. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpFilesystemPathType( Tcl_Obj *pathPtr) { #define VOL_BUF_SIZE 32 int found; WCHAR volType[VOL_BUF_SIZE]; char *firstSeparator; const char *path; Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (normPath == NULL) { return NULL; } path = TclGetString(normPath); if (path == NULL) { return NULL; } firstSeparator = strchr((char *)path, '/'); if (firstSeparator == NULL) { found = GetVolumeInformationW((const WCHAR *)Tcl_FSGetNativePath(pathPtr), NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); } else { Tcl_Obj *driveName = Tcl_NewStringObj(path, firstSeparator - path+1); Tcl_IncrRefCount(driveName); found = GetVolumeInformationW((const WCHAR *)Tcl_FSGetNativePath(driveName), NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); Tcl_DecrRefCount(driveName); } if (found == 0) { return NULL; } else { Tcl_DString ds; Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(volType, TCL_INDEX_NONE, &ds); return Tcl_DStringToObj(&ds); } #undef VOL_BUF_SIZE } /* * This define can be turned on to experiment with a different way of * normalizing paths (using a different Windows API). Unfortunately the new * path seems to take almost exactly the same amount of time as the old path! * The primary time taken by normalization is in * GetFileAttributesEx/FindFirstFile or GetFileAttributesEx/GetLongPathName. * Conversion to/from native is not a significant factor at all. * * Also, since we have to check for symbolic links (reparse points) then we * have to call GetFileAttributes on each path segment anyway, so there's no * benefit to doing anything clever there. */ /* #define TclNORM_LONG_PATH */ /* *--------------------------------------------------------------------------- * * TclpObjNormalizePath -- * * This function scans through a path specification and replaces it, in * place, with a normalized version. This means using the 'longname', and * expanding any symbolic links contained within the path. * * Results: * The new 'nextCheckpoint' value, giving as far as we could understand * in the path. * * Side effects: * The pathPtr string, which must contain a valid path, is possibly * modified in place. * *--------------------------------------------------------------------------- */ int TclpObjNormalizePath( TCL_UNUSED(Tcl_Interp *), Tcl_Obj *pathPtr, /* An unshared object containing the path to * normalize */ int nextCheckpoint) /* offset to start at in pathPtr */ { char *lastValidPathEnd = NULL; Tcl_DString dsNorm; /* This will hold the normalized string. */ char *path, *currentPathEndPosition; Tcl_Obj *temp = NULL; int isDrive = 1; Tcl_DString ds; /* Some workspace. */ Tcl_DStringInit(&dsNorm); path = TclGetString(pathPtr); currentPathEndPosition = path + nextCheckpoint; if (*currentPathEndPosition == '/') { currentPathEndPosition++; } while (1) { char cur = *currentPathEndPosition; if ((cur=='/' || cur==0) && (path != currentPathEndPosition)) { /* * Reached directory separator, or end of string. */ WIN32_FILE_ATTRIBUTE_DATA data; const WCHAR *nativePath; Tcl_DStringInit(&ds); nativePath = Tcl_UtfToWCharDString(path, currentPathEndPosition - path, &ds); if (GetFileAttributesExW(nativePath, GetFileExInfoStandard, &data) != TRUE) { /* * File doesn't exist. */ if (isDrive) { size_t len = WinIsReserved(path); if (len > 0) { /* * Actually it does exist - COM1, etc. */ size_t i; for (i=0 ; i= 'a') { wc -= ('a' - 'A'); ((WCHAR *) nativePath)[i] = wc; } } Tcl_DStringAppend(&dsNorm, (const char *)nativePath, sizeof(WCHAR) * len); lastValidPathEnd = currentPathEndPosition; } else if (nextCheckpoint == 0) { /* * Path starts with a drive designation that's not * actually on the system. We still must normalize up * past the first separator. [Bug 3603434] */ currentPathEndPosition++; } } Tcl_DStringFree(&ds); break; } /* * File 'nativePath' does exist if we get here. We now want to * check if it is a symlink and otherwise continue with the * rest of the path. */ /* * Check for symlinks, except at last component of path (we don't * follow final symlinks). Also a drive (C:/) for example, may * sometimes have the reparse flag set for some reason I don't * understand. We therefore don't perform this check for drives. */ if (cur != 0 && !isDrive && data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT){ Tcl_Obj *to = WinReadLinkDirectory(nativePath); if (to != NULL) { /* * Read the reparse point ok. Now, reparse points need not * be normalized, otherwise we could use: * * Tcl_GetStringFromObj(to, &pathLen); * nextCheckpoint = pathLen; * * So, instead we have to start from the beginning. */ nextCheckpoint = 0; Tcl_AppendToObj(to, currentPathEndPosition, TCL_INDEX_NONE); /* * Convert link to forward slashes. */ for (path = TclGetString(to); *path != 0; path++) { if (*path == '\\') { *path = '/'; } } path = TclGetString(to); currentPathEndPosition = path + nextCheckpoint; if (temp != NULL) { Tcl_DecrRefCount(temp); } temp = to; /* * Reset variables so we can restart normalization. */ isDrive = 1; Tcl_DStringFree(&dsNorm); Tcl_DStringFree(&ds); continue; } } #ifndef TclNORM_LONG_PATH /* * Now we convert the tail of the current path to its 'long form', * and append it to 'dsNorm' which holds the current normalized * path */ if (isDrive) { WCHAR drive = ((WCHAR *) nativePath)[0]; if (drive >= 'a') { drive -= ('a' - 'A'); ((WCHAR *) nativePath)[0] = drive; } Tcl_DStringAppend(&dsNorm, (const char *)nativePath, Tcl_DStringLength(&ds)); } else { char *checkDots = NULL; if (lastValidPathEnd[1] == '.') { checkDots = lastValidPathEnd + 1; while (checkDots < currentPathEndPosition) { if (*checkDots != '.') { checkDots = NULL; break; } checkDots++; } } if (checkDots != NULL) { int dotLen = currentPathEndPosition-lastValidPathEnd; /* * Path is just dots. We shouldn't really ever see a path * like that. However, to be nice we at least don't mangle * the path - we just add the dots as a path segment and * continue. */ Tcl_DStringAppend(&dsNorm, ((const char *)nativePath) + Tcl_DStringLength(&ds) - (dotLen * sizeof(WCHAR)), dotLen * sizeof(WCHAR)); } else { /* * Normal path. */ WIN32_FIND_DATAW fData; HANDLE handle; handle = FindFirstFileW((WCHAR *) nativePath, &fData); if (handle == INVALID_HANDLE_VALUE) { /* * This is usually the '/' in 'c:/' at end of string. */ Tcl_DStringAppend(&dsNorm, (const char *) L"/", sizeof(WCHAR)); } else { WCHAR *nativeName; if (fData.cFileName[0] != '\0') { nativeName = fData.cFileName; } else { nativeName = fData.cAlternateFileName; } FindClose(handle); Tcl_DStringAppend(&dsNorm, (const char *) L"/", sizeof(WCHAR)); Tcl_DStringAppend(&dsNorm, (const char *) nativeName, wcslen(nativeName)*sizeof(WCHAR)); } } } #endif /* !TclNORM_LONG_PATH */ Tcl_DStringFree(&ds); lastValidPathEnd = currentPathEndPosition; if (cur == 0) { break; } /* * If we get here, we've got past one directory delimiter, so we * know it is no longer a drive. */ isDrive = 0; } currentPathEndPosition++; #ifdef TclNORM_LONG_PATH /* * Convert the entire known path to long form. */ WCHAR wpath[MAX_PATH]; const WCHAR *nativePath; DWORD wpathlen; Tcl_DStringInit(&ds); nativePath = Tcl_UtfToWCharDString(path, lastValidPathEnd - path, &ds); wpathlen = GetLongPathNameProc(nativePath, (WCHAR *) wpath, MAX_PATH); /* * We have to make the drive letter uppercase. */ if (wpath[0] >= 'a') { wpath[0] -= ('a' - 'A'); } Tcl_DStringAppend(&dsNorm, (const char *) wpath, wpathlen * sizeof(WCHAR)); Tcl_DStringFree(&ds); #endif /* TclNORM_LONG_PATH */ } /* * Common code path for all Windows platforms. */ nextCheckpoint = currentPathEndPosition - path; if (lastValidPathEnd != NULL) { /* * Concatenate the normalized string in dsNorm with the tail of the * path which we didn't recognise. The string in dsNorm is in the * native encoding, so we have to convert it to Utf. */ Tcl_DStringInit(&ds); Tcl_WCharToUtfDString((const WCHAR *) Tcl_DStringValue(&dsNorm), Tcl_DStringLength(&dsNorm)>>1, &ds); nextCheckpoint = Tcl_DStringLength(&ds); if (*lastValidPathEnd != 0) { /* * Not the end of the string. */ Tcl_Obj *tmpPathPtr; Tcl_Size len; tmpPathPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), nextCheckpoint); Tcl_AppendToObj(tmpPathPtr, lastValidPathEnd, TCL_INDEX_NONE); path = TclGetStringFromObj(tmpPathPtr, &len); Tcl_SetStringObj(pathPtr, path, len); Tcl_DecrRefCount(tmpPathPtr); } else { /* * End of string was reached above. */ Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds), nextCheckpoint); } Tcl_DStringFree(&ds); } Tcl_DStringFree(&dsNorm); /* * This must be done after we are totally finished with 'path' as we are * sharing the same underlying string. */ if (temp != NULL) { Tcl_DecrRefCount(temp); } return nextCheckpoint; } /* *--------------------------------------------------------------------------- * * TclWinVolumeRelativeNormalize -- * * Only Windows has volume-relative paths. These paths are rather rare, * but it is nice if Tcl can handle them. It is much better if we can * handle them here, rather than in the native fs code, because we really * need to have a real absolute path just below. * * We do not let this block compile on non-Windows platforms because the * test suite's manual forcing of tclPlatform can otherwise cause this * code path to be executed, causing various errors because * volume-relative paths really do not exist. * * Results: * A valid normalized path. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclWinVolumeRelativeNormalize( Tcl_Interp *interp, const char *path, Tcl_Obj **useThisCwdPtr) { Tcl_Obj *absolutePath, *useThisCwd; useThisCwd = Tcl_FSGetCwd(interp); if (useThisCwd == NULL) { return NULL; } if (path[0] == '/') { /* * Path of form /foo/bar which is a path in the root directory of the * current volume. */ const char *drive = TclGetString(useThisCwd); absolutePath = Tcl_NewStringObj(drive,2); Tcl_AppendToObj(absolutePath, path, TCL_INDEX_NONE); Tcl_IncrRefCount(absolutePath); /* * We have a refCount on the cwd. */ } else { /* * Path of form C:foo/bar, but this only makes sense if the cwd is * also on drive C. */ Tcl_Size cwdLen; const char *drive = TclGetStringFromObj(useThisCwd, &cwdLen); char drive_cur = path[0]; if (drive_cur >= 'a') { drive_cur -= ('a' - 'A'); } if (drive[0] == drive_cur) { absolutePath = Tcl_DuplicateObj(useThisCwd); /* * We have a refCount on the cwd, which we will release later. */ if (drive[cwdLen-1] != '/' && (path[2] != '\0')) { /* * Only add a trailing '/' if needed, which is if there isn't * one already, and if we are going to be adding some more * characters. */ Tcl_AppendToObj(absolutePath, "/", 1); } } else { Tcl_DecrRefCount(useThisCwd); useThisCwd = NULL; /* * The path is not in the current drive, but is volume-relative. * The way Tcl 8.3 handles this is that it treats such a path as * relative to the root of the drive. We therefore behave the same * here. This behaviour is, however, different to that of the * windows command-line. If we want to fix this at some point in * the future (at the expense of a behaviour change to Tcl), we * could use the '_dgetdcwd' Win32 API to get the drive's cwd. */ absolutePath = Tcl_NewStringObj(path, 2); Tcl_AppendToObj(absolutePath, "/", 1); } Tcl_IncrRefCount(absolutePath); Tcl_AppendToObj(absolutePath, path+2, TCL_INDEX_NONE); } *useThisCwdPtr = useThisCwd; return absolutePath; } /* *--------------------------------------------------------------------------- * * TclpNativeToNormalized -- * * Convert native format to a normalized path object, with refCount of * zero. * * Currently assumes all native paths are actually normalized already, so * if the path given is not normalized this will actually just convert to * a valid string path, but not necessarily a normalized one. * * Results: * A valid normalized path. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpNativeToNormalized( void *clientData) { Tcl_DString ds; Tcl_Obj *objPtr; size_t len; char *copy, *p; Tcl_DStringInit(&ds); Tcl_WCharToUtfDString((const WCHAR *) clientData, TCL_INDEX_NONE, &ds); copy = Tcl_DStringValue(&ds); len = Tcl_DStringLength(&ds); /* * Certain native path representations on Windows have this special prefix * to indicate that they are to be treated specially. For example * extremely long paths, or symlinks. */ if (*copy == '\\') { if (0 == strncmp(copy,"\\??\\",4)) { copy += 4; len -= 4; } else if (0 == strncmp(copy,"\\\\?\\",4)) { copy += 4; len -= 4; } } /* * Ensure we are using forward slashes only. */ for (p = copy; *p != '\0'; p++) { if (*p == '\\') { *p = '/'; } } objPtr = Tcl_NewStringObj(copy,len); Tcl_DStringFree(&ds); return objPtr; } /* *--------------------------------------------------------------------------- * * TclNativeCreateNativeRep -- * * Create a native representation for the given path. * * Results: * The nativePath representation. * * Side effects: * Memory will be allocated. The path might be normalized. * *--------------------------------------------------------------------------- */ void * TclNativeCreateNativeRep( Tcl_Obj *pathPtr) { WCHAR *nativePathPtr = NULL; const char *str; Tcl_Obj *validPathPtr; Tcl_Size len; WCHAR *wp; if (TclFSCwdIsNative() || Tcl_FSGetPathType(pathPtr) == TCL_PATH_ABSOLUTE) { /* * The cwd is native (or path is absolute), use the translated path * without worrying about normalization (this will also usually be * shorter so the utf-to-external conversion will be somewhat faster). */ validPathPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); if (validPathPtr == NULL) { return NULL; } /* * refCount of validPathPtr was already incremented in * Tcl_FSGetTranslatedPath */ } else { /* * Make sure the normalized path is set. */ validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (validPathPtr == NULL) { return NULL; } /* * validPathPtr returned from Tcl_FSGetNormalizedPath is owned by Tcl, * so incr refCount here */ Tcl_IncrRefCount(validPathPtr); } str = TclGetStringFromObj(validPathPtr, &len); if (strlen(str) != (size_t)len) { /* * String contains NUL-bytes. This is invalid. */ goto done; } /* * For a reserved device, strip a possible postfix ':' */ len = WinIsReserved(str); if (len == 0) { /* * Let MultiByteToWideChar check for other invalid sequences, like * 0xC0 0x80 (== overlong NUL). See bug [3118489]: NUL in filenames */ len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, 0, 0); if (len==0) { goto done; } } /* * Overallocate 6 chars, making some room for extended paths */ wp = nativePathPtr = (WCHAR *)Tcl_Alloc((len + 6) * sizeof(WCHAR)); if (nativePathPtr==0) { goto done; } MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nativePathPtr, len + 2); nativePathPtr[len] = 0; /* * If path starts with "//?/" or "\\?\" (extended path), translate any * slashes to backslashes but leave the '?' intact */ if ((str[0] == '\\' || str[0] == '/') && (str[1] == '\\' || str[1] == '/') && str[2] == '?' && (str[3] == '\\' || str[3] == '/')) { wp[0] = wp[1] = wp[3] = '\\'; str += 4; wp += 4; } /* * If there is no "\\?\" prefix but there is a drive or UNC path prefix * and the path is larger than MAX_PATH chars, no Win32 API function can * handle that unless it is prefixed with the extended path prefix. See: * */ if (((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) && str[1] == ':') { if (wp == nativePathPtr && len > MAX_PATH && (str[2] == '\\' || str[2] == '/')) { memmove(wp + 4, wp, len * sizeof(WCHAR)); memcpy(wp, L"\\\\?\\", 4 * sizeof(WCHAR)); wp += 4; } /* * If (remainder of) path starts with ":", leave the ':' * intact. */ wp += 2; } else if (wp == nativePathPtr && len > MAX_PATH && (str[0] == '\\' || str[0] == '/') && (str[1] == '\\' || str[1] == '/') && str[2] != '?') { memmove(wp + 6, wp, len * sizeof(WCHAR)); memcpy(wp, L"\\\\?\\UNC", 7 * sizeof(WCHAR)); wp += 7; } /* * In the remainder of the path, translate invalid characters to * characters in the Unicode private use area. */ while (*wp != '\0') { if ((*wp < ' ') || wcschr(L"\"*<>?|", *wp)) { *wp |= 0xF000; } else if (*wp == '/') { *wp = '\\'; } ++wp; } done: TclDecrRefCount(validPathPtr); return nativePathPtr; } /* *--------------------------------------------------------------------------- * * TclNativeDupInternalRep -- * * Duplicate the native representation. * * Results: * The copied native representation, or NULL if it is not possible to * copy the representation. * * Side effects: * Memory allocation for the copy. * *--------------------------------------------------------------------------- */ void * TclNativeDupInternalRep( void *clientData) { char *copy; size_t len; if (clientData == NULL) { return NULL; } len = sizeof(WCHAR) * (wcslen((const WCHAR *) clientData) + 1); copy = (char *)Tcl_Alloc(len); memcpy(copy, clientData, len); return copy; } /* *--------------------------------------------------------------------------- * * TclpUtime -- * * Set the modification date for a file. * * Results: * 0 on success, -1 on error. * * Side effects: * Sets errno to a representation of any Windows problem that's observed * in the process. * *--------------------------------------------------------------------------- */ int TclpUtime( Tcl_Obj *pathPtr, /* File to modify */ struct utimbuf *tval) /* New modification date structure */ { int res = 0; HANDLE fileHandle; const WCHAR *native; DWORD attr = 0; DWORD flags = FILE_ATTRIBUTE_NORMAL; FILETIME lastAccessTime, lastModTime; FromCTime(tval->actime, &lastAccessTime); FromCTime(tval->modtime, &lastModTime); native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); attr = GetFileAttributesW(native); if (attr != INVALID_FILE_ATTRIBUTES && attr & FILE_ATTRIBUTE_DIRECTORY) { flags = FILE_FLAG_BACKUP_SEMANTICS; } /* * We use the native APIs (not 'utime') because there are some daylight * savings complications that utime gets wrong. */ fileHandle = CreateFileW(native, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, flags, NULL); if (fileHandle == INVALID_HANDLE_VALUE || !SetFileTime(fileHandle, NULL, &lastAccessTime, &lastModTime)) { Tcl_WinConvertError(GetLastError()); res = -1; } if (fileHandle != INVALID_HANDLE_VALUE) { CloseHandle(fileHandle); } return res; } /* *--------------------------------------------------------------------------- * * TclWinFileOwned -- * * Returns 1 if the specified file exists and is owned by the current * user and 0 otherwise. Like the Unix case, the check is made using * the real process SID, not the effective (impersonation) one. * *--------------------------------------------------------------------------- */ int TclWinFileOwned( Tcl_Obj *pathPtr) /* File whose ownership is to be checked */ { const WCHAR *native; PSID ownerSid = NULL; PSECURITY_DESCRIPTOR secd = NULL; HANDLE token; LPBYTE buf = NULL; DWORD bufsz; int owned = 0; native = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (GetNamedSecurityInfoW((LPWSTR) native, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION, &ownerSid, NULL, NULL, NULL, &secd) != ERROR_SUCCESS) { /* * Either not a file, or we do not have access to it in which case we * are in all likelihood not the owner. */ return 0; } /* * Getting the current process SID is a multi-step process. We make the * assumption that if a call fails, this process is so underprivileged it * could not possibly own anything. Normally a process can *always* look * up its own token. */ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { /* * Find out how big the buffer needs to be. */ bufsz = 0; GetTokenInformation(token, TokenUser, NULL, 0, &bufsz); if (bufsz) { buf = (LPBYTE)Tcl_Alloc(bufsz); if (GetTokenInformation(token, TokenUser, buf, bufsz, &bufsz)) { owned = EqualSid(ownerSid, ((PTOKEN_USER) buf)->User.Sid); } } CloseHandle(token); } /* * Free allocations and be done. */ if (secd) { LocalFree(secd); /* Also frees ownerSid */ } if (buf) { Tcl_Free(buf); } return (owned != 0); /* Convert non-0 to 1 */ } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinFCmd.c0000644000175000017500000016125515104661342014515 0ustar sergeisergei/* * tclWinFCmd.c * * This file implements the Windows specific portion of file manipulation * subcommands of the "file" command. * * Copyright © 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclWinInt.h" #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif /* * The following constants specify the type of callback when * TraverseWinTree() calls the traverseProc() */ enum TclTraverseWinTreeTypes { DOTREE_PRED = 1, /* pre-order directory */ DOTREE_POSTD = 2, /* post-order directory */ DOTREE_F = 3, /* regular file */ DOTREE_LINK = 4 /* symbolic link */ }; /* * Callbacks for file attributes code. */ static int GetWinFileAttributes(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int GetWinFileLongName(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int GetWinFileShortName(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int SetWinFileAttributes(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); static int CannotSetAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* * Constants and variables necessary for file attributes subcommand. */ enum { WIN_ARCHIVE_ATTRIBUTE, WIN_HIDDEN_ATTRIBUTE, WIN_LONGNAME_ATTRIBUTE, WIN_READONLY_ATTRIBUTE, WIN_SHORTNAME_ATTRIBUTE, WIN_SYSTEM_ATTRIBUTE }; static const int attributeArray[] = { FILE_ATTRIBUTE_ARCHIVE, // -archive FILE_ATTRIBUTE_HIDDEN, // -hidden 0, // -longname FILE_ATTRIBUTE_READONLY, // -readonly 0, // -shortname FILE_ATTRIBUTE_SYSTEM // -system }; const char *const tclpFileAttrStrings[] = { "-archive", "-hidden", "-longname", "-readonly", "-shortname", "-system", NULL }; const TclFileAttrProcs tclpFileAttrProcs[] = { {GetWinFileAttributes, SetWinFileAttributes}, // -archive {GetWinFileAttributes, SetWinFileAttributes}, // -hidden {GetWinFileLongName, CannotSetAttribute}, // -longname {GetWinFileAttributes, SetWinFileAttributes}, // -readonly {GetWinFileShortName, CannotSetAttribute}, // -shortname {GetWinFileAttributes, SetWinFileAttributes} // -system }; /* * Prototype for the TraverseWinTree callback function. */ typedef int (TraversalProc)(const WCHAR *srcPtr, const WCHAR *dstPtr, int type, Tcl_DString *errorPtr); /* * Declarations for local functions defined in this file: */ static void StatError(Tcl_Interp *interp, Tcl_Obj *fileName); static int ConvertFileNameFormat(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, int longShort, Tcl_Obj **attributePtrPtr); static int DoCopyFile(const WCHAR *srcPtr, const WCHAR *dstPtr); static int DoCreateDirectory(const WCHAR *pathPtr); static int DoRemoveJustDirectory(const WCHAR *nativeSrc, int ignoreError, Tcl_DString *errorPtr); static int DoRemoveDirectory(Tcl_DString *pathPtr, int recursive, Tcl_DString *errorPtr); static int DoRenameFile(const WCHAR *nativeSrc, const WCHAR *dstPtr); static int TraversalCopy(const WCHAR *srcPtr, const WCHAR *dstPtr, int type, Tcl_DString *errorPtr); static int TraversalDelete(const WCHAR *srcPtr, const WCHAR *dstPtr, int type, Tcl_DString *errorPtr); static int TraverseWinTree(TraversalProc *traverseProc, Tcl_DString *sourcePtr, Tcl_DString *dstPtr, Tcl_DString *errorPtr); /* *--------------------------------------------------------------------------- * * TclpObjRenameFile, DoRenameFile -- * * Changes the name of an existing file or directory, from src to dst. * If src and dst refer to the same file or directory, does nothing and * returns success. Otherwise if dst already exists, it will be deleted * and replaced by src subject to the following conditions: * If src is a directory, dst may be an empty directory. * If src is a file, dst may be a file. * In any other situation where dst already exists, the rename will fail. * * Results: * If the file or directory was successfully renamed, returns TCL_OK. * Otherwise the return value is TCL_ERROR and errno is set to indicate * the error. Some possible values for errno are: * * ENAMETOOLONG: src or dst names are too long. * EACCES: src or dst parent directory can't be read and/or written. * EEXIST: dst is a non-empty directory. * EINVAL: src is a root directory or dst is a subdirectory of src. * EISDIR: dst is a directory, but src is not. * ENOENT: src doesn't exist. src or dst is "". * ENOTDIR: src is a directory, but dst is not. * EXDEV: src and dst are on different filesystems. * * EACCES: exists an open file already referring to src or dst. * EACCES: src or dst specify the current working directory (NT). * EACCES: src specifies a char device (nul:, com1:, etc.) * EEXIST: dst specifies a char device (nul:, com1:, etc.) (NT) * EACCES: dst specifies a char device (nul:, com1:, etc.) (95) * * Side effects: * The implementation supports cross-filesystem renames of files, but the * caller should be prepared to emulate cross-filesystem renames of * directories if errno is EXDEV. * *--------------------------------------------------------------------------- */ int TclpObjRenameFile( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr) { return DoRenameFile((const WCHAR *)Tcl_FSGetNativePath(srcPathPtr), (const WCHAR *)Tcl_FSGetNativePath(destPathPtr)); } static int DoRenameFile( const WCHAR *nativeSrc, /* Pathname of file or dir to be renamed * (native). */ const WCHAR *nativeDst) /* New pathname for file or directory * (native). */ { #if defined(HAVE_NO_SEH) && !defined(_WIN64) TCLEXCEPTION_REGISTRATION registration; #endif DWORD srcAttr, dstAttr; int retval = -1; /* * The MoveFile API acts differently under Win95/98 and NT WRT NULL and * "". Avoid passing these values. */ if (nativeSrc == NULL || nativeSrc[0] == '\0' || nativeDst == NULL || nativeDst[0] == '\0') { Tcl_SetErrno(ENOENT); return TCL_ERROR; } /* * The MoveFile API would throw an exception under NT if one of the * arguments is a char block device. */ #if defined(HAVE_NO_SEH) && !defined(_WIN64) /* * Don't have SEH available, do things the hard way. Note that this needs * to be one block of asm, to avoid stack imbalance; also, it is illegal * for one asm block to contain a jump to another. */ __asm__ __volatile__ ( /* * Pick up params before messing with the stack. */ "movl %[nativeDst], %%ebx" "\n\t" "movl %[nativeSrc], %%ecx" "\n\t" /* * Construct an TCLEXCEPTION_REGISTRATION to protect the call to * MoveFile. */ "leal %[registration], %%edx" "\n\t" "movl %%fs:0, %%eax" "\n\t" "movl %%eax, 0x0(%%edx)" "\n\t" /* link */ "leal 1f, %%eax" "\n\t" "movl %%eax, 0x4(%%edx)" "\n\t" /* handler */ "movl %%ebp, 0x8(%%edx)" "\n\t" /* ebp */ "movl %%esp, 0xC(%%edx)" "\n\t" /* esp */ "movl $0, 0x10(%%edx)" "\n\t" /* status */ /* * Link the TCLEXCEPTION_REGISTRATION on the chain. */ "movl %%edx, %%fs:0" "\n\t" /* * Call MoveFileW(nativeSrc, nativeDst) */ "pushl %%ebx" "\n\t" "pushl %%ecx" "\n\t" "movl %[moveFileW], %%eax" "\n\t" "call *%%eax" "\n\t" /* * Come here on normal exit. Recover the TCLEXCEPTION_REGISTRATION and * put the status return from MoveFile into it. */ "movl %%fs:0, %%edx" "\n\t" "movl %%eax, 0x10(%%edx)" "\n\t" "jmp 2f" "\n" /* * Come here on an exception. Recover the TCLEXCEPTION_REGISTRATION */ "1:" "\t" "movl %%fs:0, %%edx" "\n\t" "movl 0x8(%%edx), %%edx" "\n\t" /* * Come here however we exited. Restore context from the * TCLEXCEPTION_REGISTRATION in case the stack is unbalanced. */ "2:" "\t" "movl 0xC(%%edx), %%esp" "\n\t" "movl 0x8(%%edx), %%ebp" "\n\t" "movl 0x0(%%edx), %%eax" "\n\t" "movl %%eax, %%fs:0" "\n\t" : /* No outputs */ : [registration] "m" (registration), [nativeDst] "m" (nativeDst), [nativeSrc] "m" (nativeSrc), [moveFileW] "r" (MoveFileW) : "%eax", "%ebx", "%ecx", "%edx", "memory" ); if (registration.status != FALSE) { retval = TCL_OK; } #else #ifndef HAVE_NO_SEH __try { #endif if ((*MoveFileW)(nativeSrc, nativeDst) != FALSE) { retval = TCL_OK; } #ifndef HAVE_NO_SEH } __except (EXCEPTION_EXECUTE_HANDLER) {} #endif #endif if (retval != -1) { return retval; } Tcl_WinConvertError(GetLastError()); srcAttr = GetFileAttributesW(nativeSrc); dstAttr = GetFileAttributesW(nativeDst); if (srcAttr == 0xFFFFFFFF) { if (GetFullPathNameW(nativeSrc, 0, NULL, NULL) >= MAX_PATH) { errno = ENAMETOOLONG; return TCL_ERROR; } srcAttr = 0; } if (dstAttr == 0xFFFFFFFF) { if (GetFullPathNameW(nativeDst, 0, NULL, NULL) >= MAX_PATH) { errno = ENAMETOOLONG; return TCL_ERROR; } dstAttr = 0; } if (errno == EBADF) { errno = EACCES; return TCL_ERROR; } if (errno == EACCES) { decode: if (srcAttr & FILE_ATTRIBUTE_DIRECTORY) { WCHAR *nativeSrcRest, *nativeDstRest; const char **srcArgv, **dstArgv; size_t size; Tcl_Size srcArgc, dstArgc; WCHAR nativeSrcPath[MAX_PATH]; WCHAR nativeDstPath[MAX_PATH]; Tcl_DString srcString, dstString; const char *src, *dst; size = GetFullPathNameW(nativeSrc, MAX_PATH, nativeSrcPath, &nativeSrcRest); if ((size == 0) || (size > MAX_PATH)) { return TCL_ERROR; } size = GetFullPathNameW(nativeDst, MAX_PATH, nativeDstPath, &nativeDstRest); if ((size == 0) || (size > MAX_PATH)) { return TCL_ERROR; } CharLowerW(nativeSrcPath); CharLowerW(nativeDstPath); Tcl_DStringInit(&srcString); Tcl_DStringInit(&dstString); src = Tcl_WCharToUtfDString(nativeSrcPath, TCL_INDEX_NONE, &srcString); dst = Tcl_WCharToUtfDString(nativeDstPath, TCL_INDEX_NONE, &dstString); /* * Check whether the destination path is actually inside the * source path. This is true if the prefix matches, and the next * character is either end-of-string or a directory separator */ if ((strncmp(src, dst, Tcl_DStringLength(&srcString))==0) && (dst[Tcl_DStringLength(&srcString)] == '\\' || dst[Tcl_DStringLength(&srcString)] == '/' || dst[Tcl_DStringLength(&srcString)] == '\0')) { /* * Trying to move a directory into itself. */ errno = EINVAL; Tcl_DStringFree(&srcString); Tcl_DStringFree(&dstString); return TCL_ERROR; } Tcl_SplitPath(src, &srcArgc, &srcArgv); Tcl_SplitPath(dst, &dstArgc, &dstArgv); Tcl_DStringFree(&srcString); Tcl_DStringFree(&dstString); if (srcArgc == 1) { /* * They are trying to move a root directory. Whether or not it * is across filesystems, this cannot be done. */ Tcl_SetErrno(EINVAL); } else if ((srcArgc > 0) && (dstArgc > 0) && (strcmp(srcArgv[0], dstArgv[0]) != 0)) { /* * If src is a directory and dst filesystem != src filesystem, * errno should be EXDEV. It is very important to get this * behavior, so that the caller can respond to a cross * filesystem rename by simulating it with copy and delete. * The MoveFile system call already handles the case of moving * a file between filesystems. */ Tcl_SetErrno(EXDEV); } Tcl_Free((void *)srcArgv); Tcl_Free((void *)dstArgv); } /* * Other types of access failure is that dst is a read-only * filesystem, that an open file referred to src or dest, or that src * or dest specified the current working directory on the current * filesystem. EACCES is returned for those cases. */ } else if (Tcl_GetErrno() == EEXIST) { /* * Reports EEXIST any time the target already exists. If it makes * sense, remove the old file and try renaming again. */ if (srcAttr & FILE_ATTRIBUTE_DIRECTORY) { if (dstAttr & FILE_ATTRIBUTE_DIRECTORY) { /* * Overwrite empty dst directory with src directory. The * following call will remove an empty directory. If it fails, * it's because it wasn't empty. */ if (DoRemoveJustDirectory(nativeDst, 0, NULL) == TCL_OK) { /* * Now that that empty directory is gone, we can try * renaming again. If that fails, we'll put this empty * directory back, for completeness. */ if (MoveFileW(nativeSrc, nativeDst) != FALSE) { return TCL_OK; } /* * Some new error has occurred. Don't know what it could * be, but report this one. */ Tcl_WinConvertError(GetLastError()); CreateDirectoryW(nativeDst, NULL); SetFileAttributesW(nativeDst, dstAttr); if (Tcl_GetErrno() == EACCES) { /* * Decode the EACCES to a more meaningful error. */ goto decode; } } } else { /* (dstAttr & FILE_ATTRIBUTE_DIRECTORY) == 0 */ Tcl_SetErrno(ENOTDIR); } } else { /* (srcAttr & FILE_ATTRIBUTE_DIRECTORY) == 0 */ if (dstAttr & FILE_ATTRIBUTE_DIRECTORY) { Tcl_SetErrno(EISDIR); } else { /* * Overwrite existing file by: * * 1. Rename existing file to temp name. * 2. Rename old file to new name. * 3. If success, delete temp file. If failure, put temp file * back to old name. */ WCHAR *nativeRest, *nativeTmp, *nativePrefix; int result, size; WCHAR tempBuf[MAX_PATH]; size = GetFullPathNameW(nativeDst, MAX_PATH, tempBuf, &nativeRest); if ((size == 0) || (size > MAX_PATH) || (nativeRest == NULL)) { return TCL_ERROR; } nativeTmp = (WCHAR *) tempBuf; nativeRest[0] = '\0'; result = TCL_ERROR; nativePrefix = (WCHAR *)L"tclr"; if (GetTempFileNameW(nativeTmp, nativePrefix, 0, tempBuf) != 0) { /* * Strictly speaking, need the following DeleteFile and * MoveFile to be joined as an atomic operation so no * other app comes along in the meantime and creates the * same temp file. */ nativeTmp = tempBuf; DeleteFileW(nativeTmp); if (MoveFileW(nativeDst, nativeTmp) != FALSE) { if (MoveFileW(nativeSrc, nativeDst) != FALSE) { SetFileAttributesW(nativeTmp, FILE_ATTRIBUTE_NORMAL); DeleteFileW(nativeTmp); return TCL_OK; } else { DeleteFileW(nativeDst); MoveFileW(nativeTmp, nativeDst); } } /* * Can't backup dst file or move src file. Return that * error. Could happen if an open file refers to dst. */ Tcl_WinConvertError(GetLastError()); if (Tcl_GetErrno() == EACCES) { /* * Decode the EACCES to a more meaningful error. */ goto decode; } } return result; } } } return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TclpObjCopyFile, DoCopyFile -- * * Copy a single file (not a directory). If dst already exists and is not * a directory, it is removed. * * Results: * If the file was successfully copied, returns TCL_OK. Otherwise the * return value is TCL_ERROR and errno is set to indicate the error. * Some possible values for errno are: * * EACCES: src or dst parent directory can't be read and/or written. * EISDIR: src or dst is a directory. * ENOENT: src doesn't exist. src or dst is "". * * EACCES: exists an open file already referring to dst (95). * EACCES: src specifies a char device (nul:, com1:, etc.) (NT) * ENOENT: src specifies a char device (nul:, com1:, etc.) (95) * * Side effects: * It is not an error to copy to a char device. * *--------------------------------------------------------------------------- */ int TclpObjCopyFile( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr) { return DoCopyFile((const WCHAR *)Tcl_FSGetNativePath(srcPathPtr), (const WCHAR *)Tcl_FSGetNativePath(destPathPtr)); } static int DoCopyFile( const WCHAR *nativeSrc, /* Pathname of file to be copied (native). */ const WCHAR *nativeDst) /* Pathname of file to copy to (native). */ { #if defined(HAVE_NO_SEH) && !defined(_WIN64) TCLEXCEPTION_REGISTRATION registration; #endif int retval = -1; /* * The CopyFile API acts differently under Win95/98 and NT WRT NULL and * "". Avoid passing these values. */ if (nativeSrc == NULL || nativeSrc[0] == '\0' || nativeDst == NULL || nativeDst[0] == '\0') { Tcl_SetErrno(ENOENT); return TCL_ERROR; } /* * The CopyFile API would throw an exception under NT if one of the * arguments is a char block device. */ #if defined(HAVE_NO_SEH) && !defined(_WIN64) /* * Don't have SEH available, do things the hard way. Note that this needs * to be one block of asm, to avoid stack imbalance; also, it is illegal * for one asm block to contain a jump to another. */ __asm__ __volatile__ ( /* * Pick up parameters before messing with the stack */ "movl %[nativeDst], %%ebx" "\n\t" "movl %[nativeSrc], %%ecx" "\n\t" /* * Construct an TCLEXCEPTION_REGISTRATION to protect the call to * CopyFile. */ "leal %[registration], %%edx" "\n\t" "movl %%fs:0, %%eax" "\n\t" "movl %%eax, 0x0(%%edx)" "\n\t" /* link */ "leal 1f, %%eax" "\n\t" "movl %%eax, 0x4(%%edx)" "\n\t" /* handler */ "movl %%ebp, 0x8(%%edx)" "\n\t" /* ebp */ "movl %%esp, 0xC(%%edx)" "\n\t" /* esp */ "movl $0, 0x10(%%edx)" "\n\t" /* status */ /* * Link the TCLEXCEPTION_REGISTRATION on the chain. */ "movl %%edx, %%fs:0" "\n\t" /* * Call CopyFileW(nativeSrc, nativeDst, 0) */ "movl %[copyFileW], %%eax" "\n\t" "pushl $0" "\n\t" "pushl %%ebx" "\n\t" "pushl %%ecx" "\n\t" "call *%%eax" "\n\t" /* * Come here on normal exit. Recover the TCLEXCEPTION_REGISTRATION and * put the status return from CopyFile into it. */ "movl %%fs:0, %%edx" "\n\t" "movl %%eax, 0x10(%%edx)" "\n\t" "jmp 2f" "\n" /* * Come here on an exception. Recover the TCLEXCEPTION_REGISTRATION */ "1:" "\t" "movl %%fs:0, %%edx" "\n\t" "movl 0x8(%%edx), %%edx" "\n\t" /* * Come here however we exited. Restore context from the * TCLEXCEPTION_REGISTRATION in case the stack is unbalanced. */ "2:" "\t" "movl 0xC(%%edx), %%esp" "\n\t" "movl 0x8(%%edx), %%ebp" "\n\t" "movl 0x0(%%edx), %%eax" "\n\t" "movl %%eax, %%fs:0" "\n\t" : /* No outputs */ : [registration] "m" (registration), [nativeDst] "m" (nativeDst), [nativeSrc] "m" (nativeSrc), [copyFileW] "r" (CopyFileW) : "%eax", "%ebx", "%ecx", "%edx", "memory" ); if (registration.status != FALSE) { retval = TCL_OK; } #else #ifndef HAVE_NO_SEH __try { #endif if (CopyFileW(nativeSrc, nativeDst, 0) != FALSE) { retval = TCL_OK; } #ifndef HAVE_NO_SEH } __except (EXCEPTION_EXECUTE_HANDLER) {} #endif #endif if (retval != -1) { return retval; } Tcl_WinConvertError(GetLastError()); if (Tcl_GetErrno() == EBADF) { Tcl_SetErrno(EACCES); return TCL_ERROR; } if (Tcl_GetErrno() == EACCES) { DWORD srcAttr, dstAttr; srcAttr = GetFileAttributesW(nativeSrc); dstAttr = GetFileAttributesW(nativeDst); if (srcAttr != 0xFFFFFFFF) { if (dstAttr == 0xFFFFFFFF) { dstAttr = 0; } if ((srcAttr & FILE_ATTRIBUTE_DIRECTORY) || (dstAttr & FILE_ATTRIBUTE_DIRECTORY)) { if (srcAttr & FILE_ATTRIBUTE_REPARSE_POINT) { /* Source is a symbolic link -- copy it */ if (TclWinSymLinkCopyDirectory(nativeSrc, nativeDst)==0) { return TCL_OK; } } Tcl_SetErrno(EISDIR); } if (dstAttr & FILE_ATTRIBUTE_READONLY) { SetFileAttributesW(nativeDst, dstAttr & ~((DWORD)FILE_ATTRIBUTE_READONLY)); if (CopyFileW(nativeSrc, nativeDst, 0) != FALSE) { return TCL_OK; } /* * Still can't copy onto dst. Return that error, and restore * attributes of dst. */ Tcl_WinConvertError(GetLastError()); SetFileAttributesW(nativeDst, dstAttr); } } } return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TclpObjDeleteFile, TclpDeleteFile -- * * Removes a single file (not a directory). * * Results: * If the file was successfully deleted, returns TCL_OK. Otherwise the * return value is TCL_ERROR and errno is set to indicate the error. * Some possible values for errno are: * * EACCES: a parent directory can't be read and/or written. * EISDIR: path is a directory. * ENOENT: path doesn't exist or is "". * * EACCES: exists an open file already referring to path. * EACCES: path is a char device (nul:, com1:, etc.) * * Side effects: * The file is deleted, even if it is read-only. * *--------------------------------------------------------------------------- */ int TclpObjDeleteFile( Tcl_Obj *pathPtr) { return TclpDeleteFile(Tcl_FSGetNativePath(pathPtr)); } int TclpDeleteFile( const void *nativePath) /* Pathname of file to be removed (native). */ { DWORD attr; const WCHAR *path = (const WCHAR *)nativePath; /* * The DeleteFile API acts differently under Win95/98 and NT WRT NULL and * "". Avoid passing these values. */ if (path == NULL || path[0] == '\0') { Tcl_SetErrno(ENOENT); return TCL_ERROR; } if (DeleteFileW(path) != FALSE) { return TCL_OK; } Tcl_WinConvertError(GetLastError()); if (Tcl_GetErrno() == EACCES) { attr = GetFileAttributesW(path); if (attr != 0xFFFFFFFF) { if (attr & FILE_ATTRIBUTE_DIRECTORY) { if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * It is a symbolic link - remove it. */ if (TclWinSymLinkDelete(path, 0) == 0) { return TCL_OK; } } /* * If we fall through here, it is a directory. * * Windows NT reports removing a directory as EACCES instead * of EISDIR. */ Tcl_SetErrno(EISDIR); } else if (attr & FILE_ATTRIBUTE_READONLY) { int res = SetFileAttributesW(path, attr & ~((DWORD) FILE_ATTRIBUTE_READONLY)); if ((res != 0) && (DeleteFileW(path) != FALSE)) { return TCL_OK; } Tcl_WinConvertError(GetLastError()); if (res != 0) { SetFileAttributesW(path, attr); } } } } else if (Tcl_GetErrno() == ENOENT) { attr = GetFileAttributesW(path); if (attr != 0xFFFFFFFF) { if (attr & FILE_ATTRIBUTE_DIRECTORY) { /* * Windows 95 reports removing a directory as ENOENT instead * of EISDIR. */ Tcl_SetErrno(EISDIR); } } } else if (Tcl_GetErrno() == EINVAL) { /* * Windows NT reports removing a char device as EINVAL instead of * EACCES. */ Tcl_SetErrno(EACCES); } return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TclpObjCreateDirectory -- * * Creates the specified directory. All parent directories of the * specified directory must already exist. The directory is automatically * created with permissions so that user can access the new directory and * create new files or subdirectories in it. * * Results: * If the directory was successfully created, returns TCL_OK. Otherwise * the return value is TCL_ERROR and errno is set to indicate the error. * Some possible values for errno are: * * EACCES: a parent directory can't be read and/or written. * EEXIST: path already exists. * ENOENT: a parent directory doesn't exist. * * Side effects: * A directory is created. * *--------------------------------------------------------------------------- */ int TclpObjCreateDirectory( Tcl_Obj *pathPtr) { return DoCreateDirectory((const WCHAR *)Tcl_FSGetNativePath(pathPtr)); } static int DoCreateDirectory( const WCHAR *nativePath) /* Pathname of directory to create (native). */ { if (CreateDirectoryW(nativePath, NULL) == 0) { DWORD error = GetLastError(); Tcl_WinConvertError(error); return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TclpObjCopyDirectory -- * * Recursively copies a directory. The target directory dst must not * already exist. Note that this function does not merge two directory * hierarchies, even if the target directory is an empty directory. * * Results: * If the directory was successfully copied, returns TCL_OK. Otherwise * the return value is TCL_ERROR, errno is set to indicate the error, and * the pathname of the file that caused the error is stored in errorPtr. * See TclpCreateDirectory and TclpCopyFile for a description of possible * values for errno. * * Side effects: * An exact copy of the directory hierarchy src will be created with the * name dst. If an error occurs, the error will be returned immediately, * and remaining files will not be processed. * *--------------------------------------------------------------------------- */ int TclpObjCopyDirectory( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr) { Tcl_DString ds; Tcl_DString srcString, dstString; Tcl_Obj *normSrcPtr, *normDestPtr; int ret; normSrcPtr = Tcl_FSGetNormalizedPath(NULL,srcPathPtr); if (normSrcPtr == NULL) { return TCL_ERROR; } if (normSrcPtr != srcPathPtr) { Tcl_IncrRefCount(normSrcPtr); } normDestPtr = Tcl_FSGetNormalizedPath(NULL,destPathPtr); if (normDestPtr == NULL) { if (normSrcPtr != srcPathPtr) { Tcl_DecrRefCount(normSrcPtr); } return TCL_ERROR; } if (normDestPtr != destPathPtr) { Tcl_IncrRefCount(normDestPtr); } Tcl_DStringInit(&srcString); Tcl_DStringInit(&dstString); Tcl_UtfToWCharDString(TclGetString(normSrcPtr), TCL_INDEX_NONE, &srcString); Tcl_UtfToWCharDString(TclGetString(normDestPtr), TCL_INDEX_NONE, &dstString); ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds); Tcl_DStringFree(&srcString); Tcl_DStringFree(&dstString); if (ret != TCL_OK) { if (!strcmp(Tcl_DStringValue(&ds), TclGetString(normSrcPtr))) { *errorPtr = srcPathPtr; } else if (!strcmp(Tcl_DStringValue(&ds), TclGetString(normDestPtr))) { *errorPtr = destPathPtr; } else { *errorPtr = Tcl_DStringToObj(&ds); } Tcl_DStringFree(&ds); Tcl_IncrRefCount(*errorPtr); } if (normSrcPtr != srcPathPtr) { Tcl_DecrRefCount(normSrcPtr); } if (normDestPtr != destPathPtr) { Tcl_DecrRefCount(normDestPtr); } return ret; } /* *---------------------------------------------------------------------- * * TclpObjRemoveDirectory, DoRemoveDirectory -- * * Removes directory (and its contents, if the recursive flag is set). * * Results: * If the directory was successfully removed, returns TCL_OK. Otherwise * the return value is TCL_ERROR, errno is set to indicate the error, and * the pathname of the file that caused the error is stored in errorPtr. * Some possible values for errno are: * * EACCES: path directory can't be read and/or written. * EEXIST: path is a non-empty directory. * EINVAL: path is root directory or current directory. * ENOENT: path doesn't exist or is "". * ENOTDIR: path is not a directory. * * EACCES: path is a char device (nul:, com1:, etc.) (95) * EINVAL: path is a char device (nul:, com1:, etc.) (NT) * * Side effects: * Directory removed. If an error occurs, the error will be returned * immediately, and remaining files will not be deleted. * *---------------------------------------------------------------------- */ int TclpObjRemoveDirectory( Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr) { Tcl_DString ds; Tcl_Obj *normPtr = NULL; int ret; if (recursive) { /* * In the recursive case, the string rep is used to construct a * Tcl_DString which may be used extensively, so we can't optimize * this case easily. */ Tcl_DString native; normPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (normPtr == NULL) { return TCL_ERROR; } if (normPtr != pathPtr) { Tcl_IncrRefCount(normPtr); } Tcl_DStringInit(&native); Tcl_UtfToWCharDString(TclGetString(normPtr), TCL_INDEX_NONE, &native); ret = DoRemoveDirectory(&native, recursive, &ds); Tcl_DStringFree(&native); } else { ret = DoRemoveJustDirectory((const WCHAR *)Tcl_FSGetNativePath(pathPtr), 0, &ds); } if (ret != TCL_OK) { if (Tcl_DStringLength(&ds) > 0) { if (normPtr != NULL && !strcmp(Tcl_DStringValue(&ds), TclGetString(normPtr))) { *errorPtr = pathPtr; } else { *errorPtr = Tcl_DStringToObj(&ds); } Tcl_IncrRefCount(*errorPtr); } Tcl_DStringFree(&ds); } if (normPtr && normPtr != pathPtr) { Tcl_DecrRefCount(normPtr); } return ret; } static int DoRemoveJustDirectory( const WCHAR *nativePath, /* Pathname of directory to be removed * (native). */ int ignoreError, /* If non-zero, don't initialize the errorPtr * under some circumstances on return. */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { DWORD attr; /* * The RemoveDirectory API acts differently under Win95/98 and NT WRT NULL * and "". Avoid passing these values. */ if (nativePath == NULL || nativePath[0] == '\0') { Tcl_SetErrno(ENOENT); Tcl_DStringInit(errorPtr); return TCL_ERROR; } attr = GetFileAttributesW(nativePath); if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * It is a symbolic link - remove it. */ if (TclWinSymLinkDelete(nativePath, 0) == 0) { return TCL_OK; } } else { /* * Ordinary directory. */ if (RemoveDirectoryW(nativePath) != FALSE) { return TCL_OK; } } Tcl_WinConvertError(GetLastError()); if (Tcl_GetErrno() == EACCES) { attr = GetFileAttributesW(nativePath); if (attr != 0xFFFFFFFF) { if ((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) { /* * Windows 95 reports calling RemoveDirectory on a file as an * EACCES, not an ENOTDIR. */ Tcl_SetErrno(ENOTDIR); goto end; } if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * It is a symbolic link - remove it. */ if (TclWinSymLinkDelete(nativePath, 1) != 0) { goto end; } } if (attr & FILE_ATTRIBUTE_READONLY) { attr &= ~FILE_ATTRIBUTE_READONLY; if (SetFileAttributesW(nativePath, attr) == FALSE) { goto end; } if (RemoveDirectoryW(nativePath) != FALSE) { return TCL_OK; } Tcl_WinConvertError(GetLastError()); SetFileAttributesW(nativePath, attr | FILE_ATTRIBUTE_READONLY); } } } if (Tcl_GetErrno() == ENOTEMPTY) { /* * The caller depends on EEXIST to signify that the directory is not * empty, not ENOTEMPTY. */ Tcl_SetErrno(EEXIST); } if ((ignoreError != 0) && (Tcl_GetErrno() == EEXIST)) { /* * If we're being recursive, this error may actually be ok, so we * don't want to initialise the errorPtr yet. */ return TCL_ERROR; } end: if (errorPtr != NULL) { char *p; Tcl_DStringInit(errorPtr); p = Tcl_WCharToUtfDString(nativePath, TCL_INDEX_NONE, errorPtr); for (; *p; ++p) { if (*p == '\\') { *p = '/'; } } } return TCL_ERROR; } static int DoRemoveDirectory( Tcl_DString *pathPtr, /* Pathname of directory to be removed * (native). */ int recursive, /* If non-zero, removes directories that are * nonempty. Otherwise, will only remove empty * directories. */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { int res = DoRemoveJustDirectory((const WCHAR *)Tcl_DStringValue(pathPtr), recursive, errorPtr); if ((res == TCL_ERROR) && (recursive != 0) && (Tcl_GetErrno() == EEXIST)) { /* * The directory is nonempty, but the recursive flag has been * specified, so we recursively remove all the files in the directory. */ return TraverseWinTree(TraversalDelete, pathPtr, NULL, errorPtr); } else { return res; } } /* *--------------------------------------------------------------------------- * * TraverseWinTree -- * * Traverse directory tree specified by sourcePtr, calling the function * traverseProc for each file and directory encountered. If destPtr is * non-null, each of name in the sourcePtr directory is appended to the * directory specified by destPtr and passed as the second argument to * traverseProc(). * * Results: * Standard Tcl result. * * Side effects: * None caused by TraverseWinTree, however the user specified * traverseProc() may change state. If an error occurs, the error will be * returned immediately, and remaining files will not be processed. * *--------------------------------------------------------------------------- */ static int TraverseWinTree( TraversalProc *traverseProc,/* Function to call for every file and * directory in source hierarchy. */ Tcl_DString *sourcePtr, /* Pathname of source directory to be * traversed (native). */ Tcl_DString *targetPtr, /* Pathname of directory to traverse in * parallel with source directory (native), * may be NULL. */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { DWORD sourceAttr; WCHAR *nativeSource, *nativeTarget, *nativeErrfile; int result, found; Tcl_Size sourceLen, oldSourceLen, oldTargetLen, targetLen = 0; HANDLE handle; WIN32_FIND_DATAW data; nativeErrfile = NULL; result = TCL_OK; oldTargetLen = 0; nativeSource = (WCHAR *) Tcl_DStringValue(sourcePtr); nativeTarget = (WCHAR *) (targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr)); oldSourceLen = Tcl_DStringLength(sourcePtr); sourceAttr = GetFileAttributesW(nativeSource); if (sourceAttr == 0xFFFFFFFF) { nativeErrfile = nativeSource; goto end; } if (sourceAttr & FILE_ATTRIBUTE_REPARSE_POINT) { /* * Process the symbolic link */ return traverseProc(nativeSource, nativeTarget, DOTREE_LINK, errorPtr); } if ((sourceAttr & FILE_ATTRIBUTE_DIRECTORY) == 0) { /* * Process the regular file */ return traverseProc(nativeSource, nativeTarget, DOTREE_F, errorPtr); } Tcl_DStringAppend(sourcePtr, (char *) L"\\*.*", 4 * sizeof(WCHAR) + 1); Tcl_DStringSetLength(sourcePtr, Tcl_DStringLength(sourcePtr) - 1); nativeSource = (WCHAR *) Tcl_DStringValue(sourcePtr); handle = FindFirstFileW(nativeSource, &data); if (handle == INVALID_HANDLE_VALUE) { /* * Can't read directory. */ Tcl_WinConvertError(GetLastError()); nativeErrfile = nativeSource; goto end; } Tcl_DStringSetLength(sourcePtr, oldSourceLen + 1); Tcl_DStringSetLength(sourcePtr, oldSourceLen); result = traverseProc(nativeSource, nativeTarget, DOTREE_PRED, errorPtr); if (result != TCL_OK) { FindClose(handle); return result; } sourceLen = oldSourceLen + sizeof(WCHAR); Tcl_DStringAppend(sourcePtr, (char *) L"\\", sizeof(WCHAR) + 1); Tcl_DStringSetLength(sourcePtr, sourceLen); if (targetPtr != NULL) { oldTargetLen = Tcl_DStringLength(targetPtr); targetLen = oldTargetLen; targetLen += sizeof(WCHAR); Tcl_DStringAppend(targetPtr, (char *) L"\\", sizeof(WCHAR) + 1); Tcl_DStringSetLength(targetPtr, targetLen); } found = 1; for (; found; found = FindNextFileW(handle, &data)) { WCHAR *nativeName; size_t len; WCHAR *wp = data.cFileName; if (*wp == '.') { wp++; if (*wp == '.') { wp++; } if (*wp == '\0') { continue; } } nativeName = (WCHAR *) data.cFileName; len = wcslen(data.cFileName) * sizeof(WCHAR); /* * Append name after slash, and recurse on the file. */ Tcl_DStringAppend(sourcePtr, (char *) nativeName, len + 1); Tcl_DStringSetLength(sourcePtr, Tcl_DStringLength(sourcePtr) - 1); if (targetPtr != NULL) { Tcl_DStringAppend(targetPtr, (char *) nativeName, len + 1); Tcl_DStringSetLength(targetPtr, Tcl_DStringLength(targetPtr) - 1); } result = TraverseWinTree(traverseProc, sourcePtr, targetPtr, errorPtr); if (result != TCL_OK) { break; } /* * Remove name after slash. */ Tcl_DStringSetLength(sourcePtr, sourceLen); if (targetPtr != NULL) { Tcl_DStringSetLength(targetPtr, targetLen); } } FindClose(handle); /* * Strip off the trailing slash we added. */ Tcl_DStringSetLength(sourcePtr, oldSourceLen + 1); Tcl_DStringSetLength(sourcePtr, oldSourceLen); if (targetPtr != NULL) { Tcl_DStringSetLength(targetPtr, oldTargetLen + 1); Tcl_DStringSetLength(targetPtr, oldTargetLen); } if (result == TCL_OK) { /* * Call traverseProc() on a directory after visiting all the * files in that directory. */ result = traverseProc((const WCHAR *)Tcl_DStringValue(sourcePtr), (const WCHAR *)(targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr)), DOTREE_POSTD, errorPtr); } end: if (nativeErrfile != NULL) { Tcl_WinConvertError(GetLastError()); if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); Tcl_WCharToUtfDString(nativeErrfile, TCL_INDEX_NONE, errorPtr); } result = TCL_ERROR; } return result; } /* *---------------------------------------------------------------------- * * TraversalCopy * * Called from TraverseUnixTree in order to execute a recursive copy of a * directory. * * Results: * Standard Tcl result. * * Side effects: * Depending on the value of type, src may be copied to dst. * *---------------------------------------------------------------------- */ static int TraversalCopy( const WCHAR *nativeSrc, /* Source pathname to copy. */ const WCHAR *nativeDst, /* Destination pathname of copy. */ int type, /* Reason for call - see TraverseWinTree() */ Tcl_DString *errorPtr) /* If non-NULL, initialized DString filled * with UTF-8 name of file causing error. */ { switch (type) { case DOTREE_F: if (DoCopyFile(nativeSrc, nativeDst) == TCL_OK) { return TCL_OK; } break; case DOTREE_LINK: if (TclWinSymLinkCopyDirectory(nativeSrc, nativeDst) == TCL_OK) { return TCL_OK; } break; case DOTREE_PRED: if (DoCreateDirectory(nativeDst) == TCL_OK) { DWORD attr = GetFileAttributesW(nativeSrc); if (SetFileAttributesW(nativeDst, attr) != FALSE) { return TCL_OK; } Tcl_WinConvertError(GetLastError()); } break; case DOTREE_POSTD: return TCL_OK; } /* * There shouldn't be a problem with src, because we already checked it to * get here. */ if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); Tcl_WCharToUtfDString(nativeDst, TCL_INDEX_NONE, errorPtr); } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * TraversalDelete -- * * Called by function TraverseWinTree for every file and directory that * it encounters in a directory hierarchy. This function unlinks files, * and removes directories after all the containing files have been * processed. * * Results: * Standard Tcl result. * * Side effects: * Files or directory specified by src will be deleted. If an error * occurs, the windows error is converted to a Posix error and errno is * set accordingly. * *---------------------------------------------------------------------- */ static int TraversalDelete( const WCHAR *nativeSrc, /* Source pathname to delete. */ TCL_UNUSED(const WCHAR *) /*dstPtr*/, int type, /* Reason for call - see TraverseWinTree() */ Tcl_DString *errorPtr) /* If non-NULL, initialized DString filled * with UTF-8 name of file causing error. */ { switch (type) { case DOTREE_F: if (TclpDeleteFile(nativeSrc) == TCL_OK) { return TCL_OK; } break; case DOTREE_LINK: if (DoRemoveJustDirectory(nativeSrc, 0, NULL) == TCL_OK) { return TCL_OK; } break; case DOTREE_PRED: return TCL_OK; case DOTREE_POSTD: if (DoRemoveJustDirectory(nativeSrc, 0, NULL) == TCL_OK) { return TCL_OK; } break; } if (errorPtr != NULL) { Tcl_DStringInit(errorPtr); Tcl_WCharToUtfDString(nativeSrc, TCL_INDEX_NONE, errorPtr); } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * StatError -- * * Sets the object result with the appropriate error. * * Results: * None. * * Side effects: * The interp's object result is set with an error message based on the * objIndex, fileName and errno. * *---------------------------------------------------------------------- */ static void StatError( Tcl_Interp *interp, /* The interp that has the error */ Tcl_Obj *fileName) /* The name of the file which caused the * error. */ { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf("could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } /* *---------------------------------------------------------------------- * * GetWinFileAttributes -- * * Returns a Tcl_Obj containing the value of a file attribute. This * routine gets the -hidden, -readonly or -system attribute. * * Results: * Standard Tcl result and a Tcl_Obj in attributePtrPtr. The object will * have ref count 0. If the return value is not TCL_OK, attributePtrPtr * is not touched. * * Side effects: * A new object is allocated if the file is valid. * *---------------------------------------------------------------------- */ static int GetWinFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { DWORD result; const WCHAR *nativeName; int attr; nativeName = (const WCHAR *)Tcl_FSGetNativePath(fileName); result = GetFileAttributesW(nativeName); if (result == 0xFFFFFFFF) { StatError(interp, fileName); return TCL_ERROR; } attr = (int)(result & attributeArray[objIndex]); if ((objIndex == WIN_HIDDEN_ATTRIBUTE) && (attr != 0)) { /* * It is hidden. However there is a bug on some Windows OSes in which * root volumes (drives) formatted as NTFS are declared hidden when * they are not (and cannot be). * * We test for, and fix that case, here. */ Tcl_Size len; const char *str = TclGetStringFromObj(fileName, &len); if (len < 4) { if (len == 0) { /* * Not sure if this is possible, but we pass it on anyway. */ } else if (len == 1 && (str[0] == '/' || str[0] == '\\')) { /* * Path is pointing to the root volume. */ attr = 0; } else if ((str[1] == ':') && (len == 2 || (str[2] == '/' || str[2] == '\\'))) { /* * Path is of the form 'x:' or 'x:/' or 'x:\' */ attr = 0; } } } TclNewIntObj(*attributePtrPtr, attr != 0); return TCL_OK; } /* *---------------------------------------------------------------------- * * ConvertFileNameFormat -- * * Returns a Tcl_Obj containing either the long or short version of the * file name. * * Results: * Standard Tcl result and a Tcl_Obj in attributePtrPtr. The object will * have ref count 0. If the return value is not TCL_OK, attributePtrPtr * is not touched. * * Warning: if you pass this function a drive name like 'c:' it will * actually return the current working directory on that drive. To avoid * this, make sure the drive name ends in a slash, like this 'c:/'. * * Side effects: * A new object is allocated if the file is valid. * *---------------------------------------------------------------------- */ static int ConvertFileNameFormat( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file. */ int longShort, /* 0 to short name, 1 to long name. */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_Size pathc, i, length; Tcl_Obj *splitPath; splitPath = Tcl_FSSplitPath(fileName, &pathc); if (splitPath == NULL || pathc == 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": no such file or directory", TclGetString(fileName))); errno = ENOENT; Tcl_PosixError(interp); } goto cleanup; } /* * We will decrement this again at the end. It is safer to do this in * case any of the calls below retain a reference to splitPath. */ Tcl_IncrRefCount(splitPath); for (i = 0; i < pathc; i++) { Tcl_Obj *elt; char *pathv; Tcl_ListObjIndex(NULL, splitPath, i, &elt); pathv = TclGetStringFromObj(elt, &length); if ((pathv[0] == '/') || ((length == 3) && (pathv[1] == ':')) || (strcmp(pathv, ".") == 0) || (strcmp(pathv, "..") == 0)) { /* * Handle "/", "//machine/export", "c:/", "." or ".." by just * copying the string literally. Uppercase the drive letter, just * because it looks better under Windows to do so. */ simple: /* * Here we are modifying the string representation in place. * * I believe this is legal, since this won't affect any file * representation this thing may have. */ pathv[0] = (char) Tcl_UniCharToUpper(UCHAR(pathv[0])); } else { Tcl_Obj *tempPath; Tcl_DString ds; Tcl_DString dsTemp; const WCHAR *nativeName; const char *tempString; WIN32_FIND_DATAW data; HANDLE handle; DWORD attr; tempPath = Tcl_FSJoinPath(splitPath, i+1); Tcl_IncrRefCount(tempPath); /* * We'd like to call Tcl_FSGetNativePath(tempPath) but that is * likely to lead to infinite loops. */ tempString = TclGetStringFromObj(tempPath, &length); Tcl_DStringInit(&ds); nativeName = Tcl_UtfToWCharDString(tempString, length, &ds); Tcl_DecrRefCount(tempPath); handle = FindFirstFileW(nativeName, &data); if (handle == INVALID_HANDLE_VALUE) { /* * FindFirstFileW() doesn't like root directories. We would * only get a root directory here if the caller specified "c:" * or "c:." and the current directory on the drive was the * root directory */ attr = GetFileAttributesW(nativeName); if ((attr!=0xFFFFFFFF) && (attr & FILE_ATTRIBUTE_DIRECTORY)) { Tcl_DStringFree(&ds); goto simple; } } if (handle == INVALID_HANDLE_VALUE) { Tcl_DStringFree(&ds); if (interp != NULL) { StatError(interp, fileName); } goto cleanup; } nativeName = data.cAlternateFileName; if (longShort) { if (data.cFileName[0] != '\0') { nativeName = data.cFileName; } } else { if (data.cAlternateFileName[0] == '\0') { nativeName = (WCHAR *) data.cFileName; } } /* * Purify reports a extraneous UMR in Tcl_WCharToUtfDString() trying * to dereference nativeName as a Unicode string. I have proven to * myself that purify is wrong by running the following example * when nativeName == data.w.cAlternateFileName and noting that * purify doesn't complain about the first line, but does complain * about the second. * * fprintf(stderr, "%d\n", data.w.cAlternateFileName[0]); * fprintf(stderr, "%d\n", ((WCHAR *) nativeName)[0]); */ Tcl_DStringInit(&dsTemp); Tcl_WCharToUtfDString(nativeName, TCL_INDEX_NONE, &dsTemp); Tcl_DStringFree(&ds); tempPath = Tcl_DStringToObj(&dsTemp); Tcl_ListObjReplace(NULL, splitPath, i, 1, 1, &tempPath); FindClose(handle); } } *attributePtrPtr = Tcl_FSJoinPath(splitPath, TCL_INDEX_NONE); if (splitPath != NULL) { /* * Unfortunately, the object we will return may have its only refCount * as part of the list splitPath. This means if we free splitPath, the * object will disappear. So, we have to be very careful here. * Unfortunately this means we must manipulate the object's refCount * directly. */ Tcl_IncrRefCount(*attributePtrPtr); Tcl_DecrRefCount(splitPath); --(*attributePtrPtr)->refCount; } return TCL_OK; cleanup: if (splitPath != NULL) { Tcl_DecrRefCount(splitPath); } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * GetWinFileLongName -- * * Returns a Tcl_Obj containing the long version of the file name. * * Results: * Standard Tcl result and a Tcl_Obj in attributePtrPtr. The object will * have ref count 0. If the return value is not TCL_OK, attributePtrPtr * is not touched. * * Side effects: * A new object is allocated if the file is valid. * *---------------------------------------------------------------------- */ static int GetWinFileLongName( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { return ConvertFileNameFormat(interp, objIndex, fileName, 1, attributePtrPtr); } /* *---------------------------------------------------------------------- * * GetWinFileShortName -- * * Returns a Tcl_Obj containing the short version of the file name. * * Results: * Standard Tcl result and a Tcl_Obj in attributePtrPtr. The object will * have ref count 0. If the return value is not TCL_OK, attributePtrPtr * is not touched. * * Side effects: * A new object is allocated if the file is valid. * *---------------------------------------------------------------------- */ static int GetWinFileShortName( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { return ConvertFileNameFormat(interp, objIndex, fileName, 0, attributePtrPtr); } /* *---------------------------------------------------------------------- * * SetWinFileAttributes -- * * Set the file attributes to the value given by attributePtr. This * routine sets the -hidden, -readonly, or -system attributes. * * Results: * Standard TCL error. * * Side effects: * The file's attribute is set. * *---------------------------------------------------------------------- */ static int SetWinFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ Tcl_Obj *attributePtr) /* The new value of the attribute. */ { DWORD fileAttributes, old; int yesNo, result; const WCHAR *nativeName; nativeName = (const WCHAR *)Tcl_FSGetNativePath(fileName); fileAttributes = old = GetFileAttributesW(nativeName); if (fileAttributes == 0xFFFFFFFF) { StatError(interp, fileName); return TCL_ERROR; } result = Tcl_GetBooleanFromObj(interp, attributePtr, &yesNo); if (result != TCL_OK) { return result; } if (yesNo) { fileAttributes |= (attributeArray[objIndex]); } else { fileAttributes &= ~(attributeArray[objIndex]); } if ((fileAttributes != old) && !SetFileAttributesW(nativeName, fileAttributes)) { StatError(interp, fileName); return TCL_ERROR; } return result; } /* *---------------------------------------------------------------------- * * SetWinFileLongName -- * * The attribute in question is a readonly attribute and cannot be set. * * Results: * TCL_ERROR * * Side effects: * The object result is set to a pertinent error message. * *---------------------------------------------------------------------- */ static int CannotSetAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file. */ TCL_UNUSED(Tcl_Obj *) /*attributePtr*/) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot set attribute \"%s\" for file \"%s\": attribute is readonly", tclpFileAttrStrings[objIndex], TclGetString(fileName))); errno = EINVAL; Tcl_PosixError(interp); return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TclpObjListVolumes -- * * Lists the currently mounted volumes * * Results: * The list of volumes. * * Side effects: * None * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpObjListVolumes(void) { Tcl_Obj *resultPtr, *elemPtr; char buf[40 * 4]; /* There couldn't be more than 30 drives??? */ int i; char *p; TclNewObj(resultPtr); /* * On Win32s: * GetLogicalDriveStrings() isn't implemented. * GetLogicalDrives() returns incorrect information. */ if (GetLogicalDriveStringsA(sizeof(buf), buf) == 0) { /* * GetVolumeInformationW() will detects all drives, but causes * chattering on empty floppy drives. We only do this if * GetLogicalDriveStrings() didn't work. It has also been reported * that on some laptops it takes a while for GetVolumeInformationW() to * return when pinging an empty floppy drive, another reason to try to * avoid calling it. */ buf[1] = ':'; buf[2] = '/'; buf[3] = '\0'; for (i = 0; i < 26; i++) { buf[0] = (char) ('a' + i); if (GetVolumeInformationA(buf, NULL, 0, NULL, NULL, NULL, NULL, 0) || (GetLastError() == ERROR_NOT_READY)) { elemPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE); Tcl_ListObjAppendElement(NULL, resultPtr, elemPtr); } } } else { for (p = buf; *p != '\0'; p += 4) { p[2] = '/'; elemPtr = Tcl_NewStringObj(p, TCL_INDEX_NONE); Tcl_ListObjAppendElement(NULL, resultPtr, elemPtr); } } Tcl_IncrRefCount(resultPtr); return resultPtr; } /* *---------------------------------------------------------------------- * * TclpCreateTemporaryDirectory -- * * Creates a temporary directory, possibly based on the supplied bits and * pieces of template supplied in the arguments. * * Results: * An object (refcount 0) containing the name of the newly-created * directory, or NULL on failure. * * Side effects: * Accesses the native filesystem. Makes a directory. * *---------------------------------------------------------------------- */ Tcl_Obj * TclpCreateTemporaryDirectory( Tcl_Obj *dirObj, Tcl_Obj *basenameObj) { Tcl_DString base, name; /* Contains WCHARs */ Tcl_Size baseLen; DWORD error; WCHAR tempBuf[MAX_PATH + 1]; DWORD len = GetTempPathW(MAX_PATH, tempBuf); /* * Build the path in writable memory from the user-supplied pieces and * some defaults. First, the parent temporary directory. */ if (dirObj) { TclGetString(dirObj); if (dirObj->length < 1) { goto useSystemTemp; } Tcl_DStringInit(&base); Tcl_UtfToWCharDString(TclGetString(dirObj), TCL_INDEX_NONE, &base); if (dirObj->bytes[dirObj->length - 1] != '\\') { Tcl_UtfToWCharDString("\\", TCL_INDEX_NONE, &base); } } else { useSystemTemp: Tcl_DStringInit(&base); Tcl_DStringAppend(&base, (char *) tempBuf, len * sizeof(WCHAR)); } /* * Next, the base of the directory name. */ #define DEFAULT_TEMP_DIR_PREFIX "tcl" #define SUFFIX_LENGTH 8 if (basenameObj) { Tcl_UtfToWCharDString(TclGetString(basenameObj), TCL_INDEX_NONE, &base); } else { Tcl_UtfToWCharDString(DEFAULT_TEMP_DIR_PREFIX, TCL_INDEX_NONE, &base); } Tcl_UtfToWCharDString("_", TCL_INDEX_NONE, &base); /* * Now we keep on trying random suffixes until we get one that works * (i.e., that doesn't trigger the ERROR_ALREADY_EXISTS error). Note that * SUFFIX_LENGTH is longer than on Unix because we expect to be not on a * case-sensitive filesystem. */ baseLen = Tcl_DStringLength(&base); do { char tempbuf[SUFFIX_LENGTH + 1]; int i; static const char randChars[] = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890"; static const int numRandChars = sizeof(randChars) - 1; /* * Put a random suffix on the end. */ error = ERROR_SUCCESS; tempbuf[SUFFIX_LENGTH] = '\0'; for (i = 0 ; i < SUFFIX_LENGTH; i++) { tempbuf[i] = randChars[(int) (rand() % numRandChars)]; } Tcl_DStringSetLength(&base, baseLen); Tcl_UtfToWCharDString(tempbuf, TCL_INDEX_NONE, &base); } while (!CreateDirectoryW((LPCWSTR) Tcl_DStringValue(&base), NULL) && (error = GetLastError()) == ERROR_ALREADY_EXISTS); /* * Check for other errors. The big ones are ERROR_PATH_NOT_FOUND and * ERROR_ACCESS_DENIED. */ if (error != ERROR_SUCCESS) { Tcl_WinConvertError(error); Tcl_DStringFree(&base); return NULL; } /* * We actually made the directory, so we're done! Report what we made back * as a (clean) Tcl_Obj. */ Tcl_DStringInit(&name); Tcl_WCharToUtfDString((LPCWSTR) Tcl_DStringValue(&base), TCL_INDEX_NONE, &name); Tcl_DStringFree(&base); return Tcl_DStringToObj(&name); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinError.c0000644000175000017500000002674015104661342014774 0ustar sergeisergei/* * tclWinError.c -- * * This file contains code for converting from Win32 errors to errno * errors. * * Copyright © 1995-1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" /* * The following table contains the mapping from Win32 errors to errno errors. */ static const unsigned char errorTable[] = { 0, EINVAL, /* ERROR_INVALID_FUNCTION 1 */ ENOENT, /* ERROR_FILE_NOT_FOUND 2 */ ENOENT, /* ERROR_PATH_NOT_FOUND 3 */ EMFILE, /* ERROR_TOO_MANY_OPEN_FILES 4 */ EACCES, /* ERROR_ACCESS_DENIED 5 */ EBADF, /* ERROR_INVALID_HANDLE 6 */ ENOMEM, /* ERROR_ARENA_TRASHED 7 */ ENOMEM, /* ERROR_NOT_ENOUGH_MEMORY 8 */ ENOMEM, /* ERROR_INVALID_BLOCK 9 */ E2BIG, /* ERROR_BAD_ENVIRONMENT 10 */ ENOEXEC, /* ERROR_BAD_FORMAT 11 */ EACCES, /* ERROR_INVALID_ACCESS 12 */ EINVAL, /* ERROR_INVALID_DATA 13 */ ENOMEM, /* ERROR_OUT_OF_MEMORY 14 */ ENOENT, /* ERROR_INVALID_DRIVE 15 */ EACCES, /* ERROR_CURRENT_DIRECTORY 16 */ EXDEV, /* ERROR_NOT_SAME_DEVICE 17 */ ENOENT, /* ERROR_NO_MORE_FILES 18 */ EROFS, /* ERROR_WRITE_PROTECT 19 */ ENXIO, /* ERROR_BAD_UNIT 20 */ EBUSY, /* ERROR_NOT_READY 21 */ EIO, /* ERROR_BAD_COMMAND 22 */ EIO, /* ERROR_CRC 23 */ EIO, /* ERROR_BAD_LENGTH 24 */ EIO, /* ERROR_SEEK 25 */ EIO, /* ERROR_NOT_DOS_DISK 26 */ ENXIO, /* ERROR_SECTOR_NOT_FOUND 27 */ EBUSY, /* ERROR_OUT_OF_PAPER 28 */ EIO, /* ERROR_WRITE_FAULT 29 */ EIO, /* ERROR_READ_FAULT 30 */ EIO, /* ERROR_GEN_FAILURE 31 */ EACCES, /* ERROR_SHARING_VIOLATION 32 */ EACCES, /* ERROR_LOCK_VIOLATION 33 */ ENXIO, /* ERROR_WRONG_DISK 34 */ ENFILE, /* ERROR_FCB_UNAVAILABLE 35 */ ENFILE, /* ERROR_SHARING_BUFFER_EXCEEDED 36 */ EINVAL, /* 37 */ EINVAL, /* 38 */ ENOSPC, /* ERROR_HANDLE_DISK_FULL 39 */ EINVAL, /* 40 */ EINVAL, /* 41 */ EINVAL, /* 42 */ EINVAL, /* 43 */ EINVAL, /* 44 */ EINVAL, /* 45 */ EINVAL, /* 46 */ EINVAL, /* 47 */ EINVAL, /* 48 */ EINVAL, /* 49 */ ENODEV, /* ERROR_NOT_SUPPORTED 50 */ EBUSY, /* ERROR_REM_NOT_LIST 51 */ EEXIST, /* ERROR_DUP_NAME 52 */ ENOENT, /* ERROR_BAD_NETPATH 53 */ EBUSY, /* ERROR_NETWORK_BUSY 54 */ ENODEV, /* ERROR_DEV_NOT_EXIST 55 */ EAGAIN, /* ERROR_TOO_MANY_CMDS 56 */ EIO, /* ERROR_ADAP_HDW_ERR 57 */ EIO, /* ERROR_BAD_NET_RESP 58 */ EIO, /* ERROR_UNEXP_NET_ERR 59 */ EINVAL, /* ERROR_BAD_REM_ADAP 60 */ EFBIG, /* ERROR_PRINTQ_FULL 61 */ ENOSPC, /* ERROR_NO_SPOOL_SPACE 62 */ ENOENT, /* ERROR_PRINT_CANCELLED 63 */ ENOENT, /* ERROR_NETNAME_DELETED 64 */ EACCES, /* ERROR_NETWORK_ACCESS_DENIED 65 */ ENODEV, /* ERROR_BAD_DEV_TYPE 66 */ ENOENT, /* ERROR_BAD_NET_NAME 67 */ ENFILE, /* ERROR_TOO_MANY_NAMES 68 */ EIO, /* ERROR_TOO_MANY_SESS 69 */ EAGAIN, /* ERROR_SHARING_PAUSED 70 */ EINVAL, /* ERROR_REQ_NOT_ACCEP 71 */ EAGAIN, /* ERROR_REDIR_PAUSED 72 */ EINVAL, /* 73 */ EINVAL, /* 74 */ EINVAL, /* 75 */ EINVAL, /* 76 */ EINVAL, /* 77 */ EINVAL, /* 78 */ EINVAL, /* 79 */ EEXIST, /* ERROR_FILE_EXISTS 80 */ EINVAL, /* 81 */ ENOSPC, /* ERROR_CANNOT_MAKE 82 */ EIO, /* ERROR_FAIL_I24 83 */ ENFILE, /* ERROR_OUT_OF_STRUCTURES 84 */ EEXIST, /* ERROR_ALREADY_ASSIGNED 85 */ EPERM, /* ERROR_INVALID_PASSWORD 86 */ EINVAL, /* ERROR_INVALID_PARAMETER 87 */ EIO, /* ERROR_NET_WRITE_FAULT 88 */ EAGAIN, /* ERROR_NO_PROC_SLOTS 89 */ EINVAL, /* 90 */ EINVAL, /* 91 */ EINVAL, /* 92 */ EINVAL, /* 93 */ EINVAL, /* 94 */ EINVAL, /* 95 */ EINVAL, /* 96 */ EINVAL, /* 97 */ EINVAL, /* 98 */ EINVAL, /* 99 */ EINVAL, /* 100 */ EINVAL, /* 101 */ EINVAL, /* 102 */ EINVAL, /* 103 */ EINVAL, /* 104 */ EINVAL, /* 105 */ EINVAL, /* 106 */ EXDEV, /* ERROR_DISK_CHANGE 107 */ EAGAIN, /* ERROR_DRIVE_LOCKED 108 */ EPIPE, /* ERROR_BROKEN_PIPE 109 */ ENOENT, /* ERROR_OPEN_FAILED 110 */ EINVAL, /* ERROR_BUFFER_OVERFLOW 111 */ ENOSPC, /* ERROR_DISK_FULL 112 */ EMFILE, /* ERROR_NO_MORE_SEARCH_HANDLES 113 */ EBADF, /* ERROR_INVALID_TARGET_HANDLE 114 */ EFAULT, /* ERROR_PROTECTION_VIOLATION 115 */ EINVAL, /* 116 */ EINVAL, /* 117 */ EINVAL, /* 118 */ EINVAL, /* 119 */ EINVAL, /* 120 */ EINVAL, /* 121 */ EINVAL, /* 122 */ ENOENT, /* ERROR_INVALID_NAME 123 */ EINVAL, /* 124 */ EINVAL, /* 125 */ EINVAL, /* 126 */ EINVAL, /* ERROR_PROC_NOT_FOUND 127 */ ECHILD, /* ERROR_WAIT_NO_CHILDREN 128 */ ECHILD, /* ERROR_CHILD_NOT_COMPLETE 129 */ EBADF, /* ERROR_DIRECT_ACCESS_HANDLE 130 */ EINVAL, /* ERROR_NEGATIVE_SEEK 131 */ ESPIPE, /* ERROR_SEEK_ON_DEVICE 132 */ EINVAL, /* 133 */ EINVAL, /* 134 */ EINVAL, /* 135 */ EINVAL, /* 136 */ EINVAL, /* 137 */ EINVAL, /* 138 */ EINVAL, /* 139 */ EINVAL, /* 140 */ EINVAL, /* 141 */ EAGAIN, /* ERROR_BUSY_DRIVE 142 */ EINVAL, /* 143 */ EINVAL, /* 144 */ EEXIST, /* ERROR_DIR_NOT_EMPTY 145 */ EINVAL, /* 146 */ EINVAL, /* 147 */ EINVAL, /* 148 */ EINVAL, /* 149 */ EINVAL, /* 150 */ EINVAL, /* 151 */ EINVAL, /* 152 */ EINVAL, /* 153 */ EINVAL, /* 154 */ EINVAL, /* 155 */ EINVAL, /* 156 */ EINVAL, /* 157 */ EACCES, /* ERROR_NOT_LOCKED 158 */ EINVAL, /* 159 */ EINVAL, /* 160 */ ENOENT, /* ERROR_BAD_PATHNAME 161 */ EINVAL, /* 162 */ EINVAL, /* 163 */ EINVAL, /* 164 */ EINVAL, /* 165 */ EINVAL, /* 166 */ EACCES, /* ERROR_LOCK_FAILED 167 */ EINVAL, /* 168 */ EINVAL, /* 169 */ EINVAL, /* 170 */ EINVAL, /* 171 */ EINVAL, /* 172 */ EINVAL, /* 173 */ EINVAL, /* 174 */ EINVAL, /* 175 */ EINVAL, /* 176 */ EINVAL, /* 177 */ EINVAL, /* 178 */ EINVAL, /* 179 */ EINVAL, /* 180 */ EINVAL, /* 181 */ EINVAL, /* 182 */ EEXIST, /* ERROR_ALREADY_EXISTS 183 */ ECHILD, /* ERROR_NO_CHILD_PROCESS 184 */ EINVAL, /* 185 */ EINVAL, /* 186 */ EINVAL, /* 187 */ EINVAL, /* 188 */ EINVAL, /* 189 */ EINVAL, /* 190 */ EINVAL, /* 191 */ EINVAL, /* 192 */ EINVAL, /* 193 */ EINVAL, /* 194 */ EINVAL, /* 195 */ EINVAL, /* 196 */ EINVAL, /* 197 */ EINVAL, /* 198 */ EINVAL, /* 199 */ EINVAL, /* 200 */ EINVAL, /* 201 */ EINVAL, /* 202 */ EINVAL, /* 203 */ EINVAL, /* 204 */ EINVAL, /* 205 */ ENAMETOOLONG,/* ERROR_FILENAME_EXCED_RANGE 206 */ EINVAL, /* 207 */ EINVAL, /* 208 */ EINVAL, /* 209 */ EINVAL, /* 210 */ EINVAL, /* 211 */ EINVAL, /* 212 */ EINVAL, /* 213 */ EINVAL, /* 214 */ EINVAL, /* 215 */ EINVAL, /* 216 */ EINVAL, /* 217 */ EINVAL, /* 218 */ EINVAL, /* 219 */ EINVAL, /* 220 */ EINVAL, /* 221 */ EINVAL, /* 222 */ EINVAL, /* 223 */ EINVAL, /* 224 */ EINVAL, /* 225 */ EINVAL, /* 226 */ EINVAL, /* 227 */ EINVAL, /* 228 */ EINVAL, /* 229 */ EPIPE, /* ERROR_BAD_PIPE 230 */ EAGAIN, /* ERROR_PIPE_BUSY 231 */ EPIPE, /* ERROR_NO_DATA 232 */ EPIPE, /* ERROR_PIPE_NOT_CONNECTED 233 */ EINVAL, /* 234 */ EINVAL, /* 235 */ EINVAL, /* 236 */ EINVAL, /* 237 */ EINVAL, /* 238 */ EINVAL, /* 239 */ EINVAL, /* 240 */ EINVAL, /* 241 */ EINVAL, /* 242 */ EINVAL, /* 243 */ EINVAL, /* 244 */ EINVAL, /* 245 */ EINVAL, /* 246 */ EINVAL, /* 247 */ EINVAL, /* 248 */ EINVAL, /* 249 */ EINVAL, /* 250 */ EINVAL, /* 251 */ EINVAL, /* 252 */ EINVAL, /* 253 */ EINVAL, /* 254 */ EINVAL, /* 255 */ EINVAL, /* 256 */ EINVAL, /* 257 */ EINVAL, /* 258 */ EINVAL, /* 259 */ EINVAL, /* 260 */ EINVAL, /* 261 */ EINVAL, /* 262 */ EINVAL, /* 263 */ EINVAL, /* 264 */ EINVAL, /* 265 */ EINVAL, /* 266 */ ENOTDIR /* ERROR_DIRECTORY 267 */ }; /* * The following table contains the mapping from WinSock errors to * errno errors. */ static const unsigned char wsaErrorTable[] = { EWOULDBLOCK, /* WSAEWOULDBLOCK */ EINPROGRESS, /* WSAEINPROGRESS */ EALREADY, /* WSAEALREADY */ ENOTSOCK, /* WSAENOTSOCK */ EDESTADDRREQ, /* WSAEDESTADDRREQ */ EMSGSIZE, /* WSAEMSGSIZE */ EPROTOTYPE, /* WSAEPROTOTYPE */ ENOPROTOOPT, /* WSAENOPROTOOPT */ EPROTONOSUPPORT, /* WSAEPROTONOSUPPORT */ ESOCKTNOSUPPORT, /* WSAESOCKTNOSUPPORT */ EOPNOTSUPP, /* WSAEOPNOTSUPP */ EPFNOSUPPORT, /* WSAEPFNOSUPPORT */ EAFNOSUPPORT, /* WSAEAFNOSUPPORT */ EADDRINUSE, /* WSAEADDRINUSE */ EADDRNOTAVAIL, /* WSAEADDRNOTAVAIL */ ENETDOWN, /* WSAENETDOWN */ ENETUNREACH, /* WSAENETUNREACH */ ENETRESET, /* WSAENETRESET */ ECONNABORTED, /* WSAECONNABORTED */ ECONNRESET, /* WSAECONNRESET */ ENOBUFS, /* WSAENOBUFS */ EISCONN, /* WSAEISCONN */ ENOTCONN, /* WSAENOTCONN */ ESHUTDOWN, /* WSAESHUTDOWN */ ETOOMANYREFS, /* WSAETOOMANYREFS */ ETIMEDOUT, /* WSAETIMEDOUT */ ECONNREFUSED, /* WSAECONNREFUSED */ ELOOP, /* WSAELOOP */ ENAMETOOLONG, /* WSAENAMETOOLONG */ EHOSTDOWN, /* WSAEHOSTDOWN */ EHOSTUNREACH, /* WSAEHOSTUNREACH */ ENOTEMPTY, /* WSAENOTEMPTY */ EAGAIN, /* WSAEPROCLIM */ EUSERS, /* WSAEUSERS */ EDQUOT, /* WSAEDQUOT */ ESTALE, /* WSAESTALE */ EREMOTE /* WSAEREMOTE */ }; /* *---------------------------------------------------------------------- * * Tcl_WinConvertError -- * * This routine converts a Win32 error into an errno value. * * Results: * None. * * Side effects: * Sets the errno global variable. * *---------------------------------------------------------------------- */ void Tcl_WinConvertError( unsigned errCode) /* Win32 error code. */ { if ((unsigned)errCode >= sizeof(errorTable)/sizeof(errorTable[0])) { errCode -= WSAEWOULDBLOCK; if ((unsigned)errCode >= sizeof(wsaErrorTable)/sizeof(wsaErrorTable[0])) { Tcl_SetErrno(errorTable[1]); } else { Tcl_SetErrno(wsaErrorTable[errCode]); } } else { Tcl_SetErrno(errorTable[errCode]); } } #ifdef __CYGWIN__ /* *---------------------------------------------------------------------- * * tclWinDebugPanic -- * * Display a message. If a debugger is present, present it directly to * the debugger, otherwise send it to stderr. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ MODULE_SCOPE void tclWinDebugPanic( const char *format, ...) { #define TCL_MAX_WARN_LEN 1024 va_list argList; va_start(argList, format); if (IsDebuggerPresent()) { WCHAR msgString[TCL_MAX_WARN_LEN]; char buf[TCL_MAX_WARN_LEN * 3]; vsnprintf(buf, sizeof(buf), format, argList); msgString[TCL_MAX_WARN_LEN-1] = '\0'; MultiByteToWideChar(CP_UTF8, 0, buf, -1, msgString, TCL_MAX_WARN_LEN); /* * Truncate MessageBox string if it is too long to not overflow the buffer. */ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') { memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR)); } OutputDebugStringW(msgString); } else { if (!isatty(fileno(stderr))) { fprintf(stderr, "\xEF\xBB\xBF"); } vfprintf(stderr, format, argList); fprintf(stderr, "\n"); fflush(stderr); } } #endif /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ tcl9.0.3/win/tclWinDde.c0000644000175000017500000015237615104656623014412 0ustar sergeisergei/* * tclWinDde.c -- * * This file provides functions that implement the "send" command, * allowing commands to be passed from interpreter to interpreter. * * Copyright (c) 1997 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include "tclInt.h" #include #include #include #if defined (__clang__) && (__clang_major__ > 20) #pragma clang diagnostic ignored "-Wc++-keyword" #endif #if !defined(NDEBUG) /* test POKE server Implemented for debug mode only */ # undef CBF_FAIL_POKES # define CBF_FAIL_POKES 0 #endif /* * The following structure is used to keep track of the interpreters * registered by this process. */ typedef struct RegisteredInterp { struct RegisteredInterp *nextPtr; /* The next interp this application knows * about. */ WCHAR *name; /* Interpreter's name (malloc-ed). */ Tcl_Obj *handlerPtr; /* The server handler command */ Tcl_Interp *interp; /* The interpreter attached to this name. */ } RegisteredInterp; /* * Used to keep track of conversations. */ typedef struct Conversation { struct Conversation *nextPtr; /* The next conversation in the list. */ RegisteredInterp *riPtr; /* The info we know about the conversation. */ HCONV hConv; /* The DDE handle for this conversation. */ Tcl_Obj *returnPackagePtr; /* The result package for this conversation. */ } Conversation; typedef struct { Tcl_Interp *interp; int result; ATOM service; ATOM topic; HWND hwnd; } DdeEnumServices; typedef struct { Conversation *currentConversations; /* A list of conversations currently being * processed. */ RegisteredInterp *interpListPtr; /* List of all interpreters registered in the * current process. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following variables cannot be placed in thread-local storage. The Mutex * ddeMutex guards access to the ddeInstance. */ static HSZ ddeServiceGlobal = 0; static DWORD ddeInstance; /* The application instance handle given to us * by DdeInitialize. */ static int ddeIsServer = 0; #define TCL_DDE_VERSION "1.4.6" #define TCL_DDE_PACKAGE_NAME "dde" #define TCL_DDE_SERVICE_NAME L"TclEval" #define TCL_DDE_EXECUTE_RESULT L"$TCLEVAL$EXECUTE$RESULT" #define DDE_FLAG_ASYNC 1 #define DDE_FLAG_BINARY 2 #define DDE_FLAG_FORCE 4 TCL_DECLARE_MUTEX(ddeMutex) #if TCL_MAJOR_VERSION < 9 # if TCL_UTF_MAX > 3 # define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c) # define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c) # else # define Tcl_WCharToUtfDString(a,b,c) Tcl_UniCharToUtfDString((Tcl_UniChar *)(a),b,c) # define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_UtfToUniCharDString(a,b,c) # endif #ifndef Tcl_Size # define Tcl_Size int #endif #ifndef Tcl_CreateObjCommand2 # define Tcl_CreateObjCommand2 Tcl_CreateObjCommand #endif #endif /* * Declarations for functions defined in this file. */ static LRESULT CALLBACK DdeClientWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static int DdeCreateClient(DdeEnumServices *es); static BOOL CALLBACK DdeEnumWindowsCallback(HWND hwndTarget, LPARAM lParam); static void DdeExitProc(void *clientData); static int DdeGetServicesList(Tcl_Interp *interp, const WCHAR *serviceName, const WCHAR *topicName); static HDDEDATA CALLBACK DdeServerProc(UINT uType, UINT uFmt, HCONV hConv, HSZ ddeTopic, HSZ ddeItem, HDDEDATA hData, DWORD dwData1, DWORD dwData2); static LRESULT DdeServicesOnAck(HWND hwnd, WPARAM wParam, LPARAM lParam); static void DeleteProc(void *clientData); static Tcl_Obj * ExecuteRemoteObject(RegisteredInterp *riPtr, Tcl_Obj *ddeObjectPtr); static int MakeDdeConnection(Tcl_Interp *interp, const WCHAR *name, HCONV *ddeConvPtr); static void SetDdeError(Tcl_Interp *interp); static int DdeObjCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); #ifdef __cplusplus extern "C" { #endif DLLEXPORT int Dde_Init(Tcl_Interp *interp); DLLEXPORT int Dde_SafeInit(Tcl_Interp *interp); #if TCL_MAJOR_VERSION < 9 /* With those additional entries, "load tcldde14.dll" works without 3th argument */ DLLEXPORT int Tcldde_Init(Tcl_Interp *interp); DLLEXPORT int Tcldde_SafeInit(Tcl_Interp *interp); #endif #ifdef __cplusplus } #endif /* *---------------------------------------------------------------------- * * Dde_Init -- * * This function initializes the dde command. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Dde_Init( Tcl_Interp *interp) { if (!Tcl_InitStubs(interp, "8.5-", 0)) { return TCL_ERROR; } Tcl_CreateObjCommand2(interp, "dde", DdeObjCmd, NULL, NULL); Tcl_CreateExitHandler(DdeExitProc, NULL); return Tcl_PkgProvideEx(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION, NULL); } #if TCL_MAJOR_VERSION < 9 int Tcldde_Init( Tcl_Interp *interp) { return Dde_Init(interp); } #endif /* *---------------------------------------------------------------------- * * Dde_SafeInit -- * * This function initializes the dde command within a safe interp * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Dde_SafeInit( Tcl_Interp *interp) { int result = Dde_Init(interp); if (result == TCL_OK) { Tcl_HideCommand(interp, "dde", "dde"); } return result; } #if TCL_MAJOR_VERSION < 9 int Tcldde_SafeInit( Tcl_Interp *interp) { return Dde_SafeInit(interp); } #endif /* *---------------------------------------------------------------------- * * Initialize -- * * Initialize the global DDE instance. * * Results: * None. * * Side effects: * Registers the DDE server proc. * *---------------------------------------------------------------------- */ static void Initialize(void) { int nameFound = 0; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * See if the application is already registered; if so, remove its current * name from the registry. The deletion of the command will take care of * disposing of this entry. */ if (tsdPtr->interpListPtr != NULL) { nameFound = 1; } /* * Make sure that the DDE server is there. This is done only once, add an * exit handler tear it down. */ if (ddeInstance == 0) { Tcl_MutexLock(&ddeMutex); if (ddeInstance == 0) { if (DdeInitializeW(&ddeInstance, (PFNCALLBACK)(void *)DdeServerProc, CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS | CBF_FAIL_POKES, 0) != DMLERR_NO_ERROR) { ddeInstance = 0; } } Tcl_MutexUnlock(&ddeMutex); } if ((ddeServiceGlobal == 0) && (nameFound != 0)) { Tcl_MutexLock(&ddeMutex); if ((ddeServiceGlobal == 0) && (nameFound != 0)) { ddeIsServer = 1; Tcl_CreateExitHandler(DdeExitProc, NULL); ddeServiceGlobal = DdeCreateStringHandleW(ddeInstance, TCL_DDE_SERVICE_NAME, CP_WINUNICODE); DdeNameService(ddeInstance, ddeServiceGlobal, 0L, DNS_REGISTER); } else { ddeIsServer = 0; } Tcl_MutexUnlock(&ddeMutex); } } /* *---------------------------------------------------------------------- * * DdeSetServerName -- * * This function is called to associate an ASCII name with a Dde server. * If the interpreter has already been named, the name replaces the old * one. * * Results: * The return value is the name actually given to the interp. This will * normally be the same as name, but if name was already in use for a Dde * Server then a name of the form "name #2" will be chosen, with a high * enough number to make the name unique. * * Side effects: * Registration info is saved, thereby allowing the "send" command to be * used later to invoke commands in the application. In addition, the * "send" command is created in the application's interpreter. The * registration will be removed automatically if the interpreter is * deleted or the "send" command is removed. * *---------------------------------------------------------------------- */ static const WCHAR * DdeSetServerName( Tcl_Interp *interp, const WCHAR *name, /* The name that will be used to refer to the * interpreter in later "send" commands. Must * be globally unique. */ int flags, /* DDE_FLAG_FORCE or 0 */ Tcl_Obj *handlerPtr) /* Name of the optional proc/command to handle * incoming Dde eval's */ { int suffix; RegisteredInterp *riPtr, *prevPtr; Tcl_DString dString; const WCHAR *actualName; Tcl_Obj *srvListPtr = NULL, **srvPtrPtr = NULL; Tcl_Size n, srvCount = 0, offset; int lastSuffix, r = TCL_OK; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * See if the application is already registered; if so, remove its current * name from the registry. The deletion of the command will take care of * disposing of this entry. */ for (riPtr = tsdPtr->interpListPtr, prevPtr = NULL; riPtr != NULL; prevPtr = riPtr, riPtr = riPtr->nextPtr) { if (riPtr->interp == interp) { if (name != NULL) { if (prevPtr == NULL) { tsdPtr->interpListPtr = tsdPtr->interpListPtr->nextPtr; } else { prevPtr->nextPtr = riPtr->nextPtr; } break; } else { /* * The name was NULL, so the caller is asking for the name of * the current interp. */ return riPtr->name; } } } if (name == NULL) { /* * The name was NULL, so the caller is asking for the name of the * current interp, but it doesn't have a name. */ return L""; } /* * Get the list of currently registered Tcl interpreters by calling the * internal implementation of the 'dde services' command. */ Tcl_DStringInit(&dString); actualName = name; if (!(flags & DDE_FLAG_FORCE)) { r = DdeGetServicesList(interp, TCL_DDE_SERVICE_NAME, NULL); if (r == TCL_OK) { srvListPtr = Tcl_GetObjResult(interp); } if (r == TCL_OK) { r = Tcl_ListObjGetElements(interp, srvListPtr, &srvCount, &srvPtrPtr); } if (r != TCL_OK) { Tcl_DStringInit(&dString); OutputDebugStringW(Tcl_UtfToWCharDString(Tcl_GetString(Tcl_GetObjResult(interp)), -1, &dString)); Tcl_DStringFree(&dString); return NULL; } /* * Pick a name to use for the application. Use "name" if it's not * already in use. Otherwise add a suffix such as " #2", trying larger * and larger numbers until we eventually find one that is unique. */ offset = lastSuffix = 0; suffix = 1; while (suffix != lastSuffix) { lastSuffix = suffix; if (suffix > 1) { if (suffix == 2) { Tcl_DStringAppend(&dString, (char *)name, wcslen(name) * sizeof(WCHAR)); Tcl_DStringAppend(&dString, (char *)L" #", 2 * sizeof(WCHAR)); offset = Tcl_DStringLength(&dString); Tcl_DStringSetLength(&dString, offset + sizeof(WCHAR) * TCL_INTEGER_SPACE); actualName = (WCHAR *) Tcl_DStringValue(&dString); } _snwprintf((WCHAR *) (Tcl_DStringValue(&dString) + offset), TCL_INTEGER_SPACE, L"%d", suffix); } /* * See if the name is already in use, if so increment suffix. */ for (n = 0; n < srvCount; ++n) { Tcl_Obj* namePtr; Tcl_DString ds; Tcl_ListObjIndex(interp, srvPtrPtr[n], 1, &namePtr); Tcl_DStringInit(&ds); Tcl_UtfToWCharDString(Tcl_GetString(namePtr), -1, &ds); if (wcscmp(actualName, (WCHAR *)Tcl_DStringValue(&ds)) == 0) { suffix++; Tcl_DStringFree(&ds); break; } Tcl_DStringFree(&ds); } } } /* * We have found a unique name. Now add it to the registry. */ riPtr = (RegisteredInterp *) Tcl_Alloc(sizeof(RegisteredInterp)); riPtr->interp = interp; riPtr->name = (WCHAR *) Tcl_Alloc((wcslen(actualName) + 1) * sizeof(WCHAR)); riPtr->nextPtr = tsdPtr->interpListPtr; riPtr->handlerPtr = handlerPtr; if (riPtr->handlerPtr != NULL) { Tcl_IncrRefCount(riPtr->handlerPtr); } tsdPtr->interpListPtr = riPtr; wcscpy(riPtr->name, actualName); if (Tcl_IsSafe(interp)) { Tcl_ExposeCommand(interp, "dde", "dde"); } Tcl_CreateObjCommand2(interp, "dde", DdeObjCmd, riPtr, DeleteProc); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "dde", "dde"); } Tcl_DStringFree(&dString); /* * Re-initialize with the new name. */ Initialize(); return riPtr->name; } /* *---------------------------------------------------------------------- * * DdeGetRegistrationPtr * * Retrieve the registration info for an interpreter. * * Results: * Returns a pointer to the registration structure or NULL * * Side effects: * None * *---------------------------------------------------------------------- */ static RegisteredInterp * DdeGetRegistrationPtr( Tcl_Interp *interp) { RegisteredInterp *riPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; riPtr = riPtr->nextPtr) { if (riPtr->interp == interp) { break; } } return riPtr; } /* *---------------------------------------------------------------------- * * DeleteProc * * This function is called when the command "dde" is destroyed. * * Results: * none * * Side effects: * The interpreter given by riPtr is unregistered. * *---------------------------------------------------------------------- */ static void DeleteProc( void *clientData) /* The interp we are deleting. */ { RegisteredInterp *riPtr = (RegisteredInterp *) clientData; RegisteredInterp *searchPtr, *prevPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); for (searchPtr = tsdPtr->interpListPtr, prevPtr = NULL; (searchPtr != NULL) && (searchPtr != riPtr); prevPtr = searchPtr, searchPtr = searchPtr->nextPtr) { /* * Empty loop body. */ } if (searchPtr != NULL) { if (prevPtr == NULL) { tsdPtr->interpListPtr = tsdPtr->interpListPtr->nextPtr; } else { prevPtr->nextPtr = searchPtr->nextPtr; } } Tcl_Free((char *) riPtr->name); if (riPtr->handlerPtr) { Tcl_DecrRefCount(riPtr->handlerPtr); } Tcl_EventuallyFree(clientData, TCL_DYNAMIC); } /* *---------------------------------------------------------------------- * * ExecuteRemoteObject -- * * Takes the package delivered by DDE and executes it in the server's * interpreter. * * Results: * A list Tcl_Obj * that describes what happened. The first element is * the numerical return code (TCL_ERROR, etc.). The second element is the * result of the script. If the return result was TCL_ERROR, then the * third element will be the value of the global "errorCode", and the * fourth will be the value of the global "errorInfo". The return result * will have a refCount of 0. * * Side effects: * A Tcl script is run, which can cause all kinds of other things to * happen. * *---------------------------------------------------------------------- */ static Tcl_Obj * ExecuteRemoteObject( RegisteredInterp *riPtr, /* Info about this server. */ Tcl_Obj *ddeObjectPtr) /* The object to execute. */ { Tcl_Obj *returnPackagePtr; int result = TCL_OK; if ((riPtr->handlerPtr == NULL) && Tcl_IsSafe(riPtr->interp)) { Tcl_SetObjResult(riPtr->interp, Tcl_NewStringObj("permission denied: " "a handler procedure must be defined for use in a safe " "interp", -1)); Tcl_SetErrorCode(riPtr->interp, "TCL", "DDE", "SECURITY_CHECK", (char *)NULL); result = TCL_ERROR; } if (riPtr->handlerPtr != NULL) { /* * Add the dde request data to the handler proc list. */ Tcl_Obj *cmdPtr = Tcl_DuplicateObj(riPtr->handlerPtr); result = Tcl_ListObjAppendElement(riPtr->interp, cmdPtr, ddeObjectPtr); if (result == TCL_OK) { ddeObjectPtr = cmdPtr; } } if (result == TCL_OK) { result = Tcl_EvalObjEx(riPtr->interp, ddeObjectPtr, TCL_EVAL_GLOBAL); } returnPackagePtr = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(NULL, returnPackagePtr, Tcl_NewIntObj(result)); Tcl_ListObjAppendElement(NULL, returnPackagePtr, Tcl_GetObjResult(riPtr->interp)); if (result == TCL_ERROR) { Tcl_Obj *errorObjPtr = Tcl_GetVar2Ex(riPtr->interp, "errorCode", NULL, TCL_GLOBAL_ONLY); if (errorObjPtr) { Tcl_ListObjAppendElement(NULL, returnPackagePtr, errorObjPtr); } errorObjPtr = Tcl_GetVar2Ex(riPtr->interp, "errorInfo", NULL, TCL_GLOBAL_ONLY); if (errorObjPtr) { Tcl_ListObjAppendElement(NULL, returnPackagePtr, errorObjPtr); } } return returnPackagePtr; } /* *---------------------------------------------------------------------- * * DdeServerProc -- * * Handles all transactions for this server. Can handle execute, request, * and connect protocols. Dde will call this routine when a client * attempts to run a dde command using this server. * * Results: * A DDE Handle with the result of the dde command. * * Side effects: * Depending on which command is executed, arbitrary Tcl scripts can be * run. * *---------------------------------------------------------------------- */ static HDDEDATA CALLBACK DdeServerProc( UINT uType, /* The type of DDE transaction we are * performing. */ UINT uFmt, /* The format that data is sent or received */ HCONV hConv, /* The conversation associated with the * current transaction. */ HSZ ddeTopic, HSZ ddeItem, /* String handles. Transaction-type * dependent. */ HDDEDATA hData, /* DDE data. Transaction-type dependent. */ DWORD unused1, DWORD unused2) /* Transaction-dependent data. */ { Tcl_DString dString; Tcl_Size len; DWORD dlen; WCHAR *utilString; Tcl_Obj *ddeObjectPtr; HDDEDATA ddeReturn = NULL; RegisteredInterp *riPtr; Conversation *convPtr, *prevConvPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); (void)unused1; (void)unused2; switch(uType) { case XTYP_CONNECT: /* * Dde is trying to initialize a conversation with us. Check and make * sure we have a valid topic. */ len = DdeQueryStringW(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE); Tcl_DStringInit(&dString); Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1); utilString = (WCHAR *) Tcl_DStringValue(&dString); DdeQueryStringW(ddeInstance, ddeTopic, utilString, (DWORD) len + 1, CP_WINUNICODE); for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; riPtr = riPtr->nextPtr) { if (_wcsicmp(utilString, riPtr->name) == 0) { Tcl_DStringFree(&dString); return (HDDEDATA) TRUE; } } Tcl_DStringFree(&dString); return (HDDEDATA) FALSE; case XTYP_CONNECT_CONFIRM: /* * Dde has decided that we can connect, so it gives us a conversation * handle. We need to keep track of it so we know which execution * result to return in an XTYP_REQUEST. */ len = DdeQueryStringW(ddeInstance, ddeTopic, NULL, 0, CP_WINUNICODE); Tcl_DStringInit(&dString); Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1); utilString = (WCHAR *) Tcl_DStringValue(&dString); DdeQueryStringW(ddeInstance, ddeTopic, utilString, (DWORD) len + 1, CP_WINUNICODE); for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; riPtr = riPtr->nextPtr) { if (_wcsicmp(riPtr->name, utilString) == 0) { convPtr = (Conversation *) Tcl_Alloc(sizeof(Conversation)); convPtr->nextPtr = tsdPtr->currentConversations; convPtr->returnPackagePtr = NULL; convPtr->hConv = hConv; convPtr->riPtr = riPtr; tsdPtr->currentConversations = convPtr; break; } } Tcl_DStringFree(&dString); return (HDDEDATA) TRUE; case XTYP_DISCONNECT: /* * The client has disconnected from our server. Forget this * conversation. */ for (convPtr = tsdPtr->currentConversations, prevConvPtr = NULL; convPtr != NULL; prevConvPtr = convPtr, convPtr = convPtr->nextPtr) { if (hConv == convPtr->hConv) { if (prevConvPtr == NULL) { tsdPtr->currentConversations = convPtr->nextPtr; } else { prevConvPtr->nextPtr = convPtr->nextPtr; } if (convPtr->returnPackagePtr != NULL) { Tcl_DecrRefCount(convPtr->returnPackagePtr); } Tcl_Free((char *) convPtr); break; } } return (HDDEDATA) TRUE; case XTYP_REQUEST: /* * This could be either a request for a value of a Tcl variable, or it * could be the send command requesting the results of the last * execute. */ if ((uFmt != CF_TEXT) && (uFmt != CF_UNICODETEXT)) { return (HDDEDATA) FALSE; } ddeReturn = (HDDEDATA) FALSE; for (convPtr = tsdPtr->currentConversations; (convPtr != NULL) && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) { /* * Empty loop body. */ } if (convPtr != NULL) { Tcl_DString dsBuf; char *returnString; len = DdeQueryStringW(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE); Tcl_DStringInit(&dString); Tcl_DStringInit(&dsBuf); Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1); utilString = (WCHAR *) Tcl_DStringValue(&dString); DdeQueryStringW(ddeInstance, ddeItem, utilString, (DWORD) len + 1, CP_WINUNICODE); if (_wcsicmp(utilString, TCL_DDE_EXECUTE_RESULT) == 0) { returnString = Tcl_GetStringFromObj(convPtr->returnPackagePtr, &len); if (uFmt != CF_TEXT) { Tcl_DStringInit(&dsBuf); Tcl_UtfToWCharDString(returnString, len, &dsBuf); returnString = Tcl_DStringValue(&dsBuf); len = Tcl_DStringLength(&dsBuf) + sizeof(WCHAR) - 1; } ddeReturn = DdeCreateDataHandle(ddeInstance, (BYTE *)returnString, (DWORD) len+1, 0, ddeItem, uFmt, 0); } else { if (Tcl_IsSafe(convPtr->riPtr->interp)) { ddeReturn = NULL; } else { Tcl_DString ds; Tcl_Obj *variableObjPtr; Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(utilString, wcslen(utilString), &ds); variableObjPtr = Tcl_GetVar2Ex( convPtr->riPtr->interp, Tcl_DStringValue(&ds), NULL, TCL_GLOBAL_ONLY); if (variableObjPtr != NULL) { returnString = Tcl_GetStringFromObj(variableObjPtr, &len); if (uFmt != CF_TEXT) { Tcl_DStringInit(&dsBuf); Tcl_UtfToWCharDString(returnString, len, &dsBuf); returnString = Tcl_DStringValue(&dsBuf); len = Tcl_DStringLength(&dsBuf) + sizeof(WCHAR) - 1; } ddeReturn = DdeCreateDataHandle(ddeInstance, (BYTE *)returnString, (DWORD) len+1, 0, ddeItem, uFmt, 0); } else { ddeReturn = NULL; } Tcl_DStringFree(&ds); } } Tcl_DStringFree(&dsBuf); Tcl_DStringFree(&dString); } return ddeReturn; #if !CBF_FAIL_POKES case XTYP_POKE: /* * This is a poke for a Tcl variable, only implemented in * debug/UNICODE mode. */ ddeReturn = DDE_FNOTPROCESSED; if ((uFmt != CF_TEXT) && (uFmt != CF_UNICODETEXT)) { return ddeReturn; } for (convPtr = tsdPtr->currentConversations; (convPtr != NULL) && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) { /* * Empty loop body. */ } if (convPtr && !Tcl_IsSafe(convPtr->riPtr->interp)) { Tcl_DString ds, ds2; Tcl_Obj *variableObjPtr; DWORD len2; Tcl_DStringInit(&dString); Tcl_DStringInit(&ds2); len = DdeQueryStringW(ddeInstance, ddeItem, NULL, 0, CP_WINUNICODE); Tcl_DStringSetLength(&dString, (len + 1) * sizeof(WCHAR) - 1); utilString = (WCHAR *) Tcl_DStringValue(&dString); DdeQueryStringW(ddeInstance, ddeItem, utilString, (DWORD) len + 1, CP_WINUNICODE); Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(utilString, wcslen(utilString), &ds); utilString = (WCHAR *) DdeAccessData(hData, &len2); len = len2; if (uFmt != CF_TEXT) { Tcl_DStringInit(&ds2); Tcl_WCharToUtfDString(utilString, wcslen(utilString), &ds2); utilString = (WCHAR *) Tcl_DStringValue(&ds2); } variableObjPtr = Tcl_NewStringObj((char *)utilString, -1); Tcl_SetVar2Ex(convPtr->riPtr->interp, Tcl_DStringValue(&ds), NULL, variableObjPtr, TCL_GLOBAL_ONLY); Tcl_DStringFree(&ds2); Tcl_DStringFree(&ds); Tcl_DStringFree(&dString); ddeReturn = (HDDEDATA) DDE_FACK; } return ddeReturn; #endif case XTYP_EXECUTE: { /* * Execute this script. The results will be saved into a list object * which will be retrieved later. See ExecuteRemoteObject. */ Tcl_Obj *returnPackagePtr; char *string; for (convPtr = tsdPtr->currentConversations; (convPtr != NULL) && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) { /* * Empty loop body. */ } if (convPtr == NULL) { return (HDDEDATA) DDE_FNOTPROCESSED; } utilString = (WCHAR *) DdeAccessData(hData, &dlen); string = (char *) utilString; if (!dlen) { /* Empty binary array. */ ddeObjectPtr = Tcl_NewObj(); } else if ((dlen & 1) || utilString[(dlen>>1)-1]) { /* Cannot be Unicode, so assume utf-8 */ if (!string[dlen-1]) { dlen--; } ddeObjectPtr = Tcl_NewStringObj(string, dlen); } else { /* Unicode */ Tcl_DString dsBuf; Tcl_DStringInit(&dsBuf); Tcl_WCharToUtfDString(utilString, (dlen>>1) - 1, &dsBuf); ddeObjectPtr = Tcl_NewStringObj(Tcl_DStringValue(&dsBuf), Tcl_DStringLength(&dsBuf)); Tcl_DStringFree(&dsBuf); } Tcl_IncrRefCount(ddeObjectPtr); DdeUnaccessData(hData); if (convPtr->returnPackagePtr != NULL) { Tcl_DecrRefCount(convPtr->returnPackagePtr); } convPtr->returnPackagePtr = NULL; returnPackagePtr = ExecuteRemoteObject(convPtr->riPtr, ddeObjectPtr); Tcl_IncrRefCount(returnPackagePtr); for (convPtr = tsdPtr->currentConversations; (convPtr != NULL) && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) { /* * Empty loop body. */ } if (convPtr != NULL) { convPtr->returnPackagePtr = returnPackagePtr; } else { Tcl_DecrRefCount(returnPackagePtr); } Tcl_DecrRefCount(ddeObjectPtr); if (returnPackagePtr == NULL) { return (HDDEDATA) DDE_FNOTPROCESSED; } else { return (HDDEDATA) DDE_FACK; } } case XTYP_WILDCONNECT: { /* * Dde wants a list of services and topics that we support. */ HSZPAIR *returnPtr; Tcl_Size i; DWORD numItems; for (i = 0, riPtr = tsdPtr->interpListPtr; riPtr != NULL; i++, riPtr = riPtr->nextPtr) { /* * Empty loop body. */ } if ((size_t)i >= UINT_MAX/sizeof(HSZPAIR)) { return NULL; } numItems = (DWORD)i; ddeReturn = DdeCreateDataHandle(ddeInstance, NULL, (numItems + 1) * (DWORD)sizeof(HSZPAIR), 0, 0, 0, 0); returnPtr = (HSZPAIR *) DdeAccessData(ddeReturn, &dlen); len = dlen; for (i = 0, riPtr = tsdPtr->interpListPtr; i < (Tcl_Size)numItems; i++, riPtr = riPtr->nextPtr) { returnPtr[i].hszSvc = DdeCreateStringHandleW(ddeInstance, TCL_DDE_SERVICE_NAME, CP_WINUNICODE); returnPtr[i].hszTopic = DdeCreateStringHandleW(ddeInstance, riPtr->name, CP_WINUNICODE); } returnPtr[i].hszSvc = NULL; returnPtr[i].hszTopic = NULL; DdeUnaccessData(ddeReturn); return ddeReturn; } default: return NULL; } } /* *---------------------------------------------------------------------- * * DdeExitProc -- * * Gets rid of our DDE server when we go away. * * Results: * None. * * Side effects: * The DDE server is deleted. * *---------------------------------------------------------------------- */ static void DdeExitProc( void *dummy) /* Not used. */ { (void)dummy; DdeNameService(ddeInstance, NULL, 0, DNS_UNREGISTER); DdeUninitialize(ddeInstance); ddeInstance = 0; } /* *---------------------------------------------------------------------- * * MakeDdeConnection -- * * This function is a utility used to connect to a DDE server when given * a server name and a topic name. * * Results: * A standard Tcl result. * * Side effects: * Passes back a conversation through ddeConvPtr * *---------------------------------------------------------------------- */ static int MakeDdeConnection( Tcl_Interp *interp, /* Used to report errors. */ const WCHAR *name, /* The connection to use. */ HCONV *ddeConvPtr) { HSZ ddeTopic, ddeService; HCONV ddeConv; ddeService = DdeCreateStringHandleW(ddeInstance, TCL_DDE_SERVICE_NAME, CP_WINUNICODE); ddeTopic = DdeCreateStringHandleW(ddeInstance, name, CP_WINUNICODE); ddeConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL); DdeFreeStringHandle(ddeInstance, ddeService); DdeFreeStringHandle(ddeInstance, ddeTopic); if (ddeConv == (HCONV) NULL) { if (interp != NULL) { Tcl_DString dString; Tcl_DStringInit(&dString); Tcl_WCharToUtfDString(name, wcslen(name), &dString); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no registered server named \"%s\"", Tcl_DStringValue(&dString))); Tcl_DStringFree(&dString); Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", (char *)NULL); } return TCL_ERROR; } *ddeConvPtr = ddeConv; return TCL_OK; } /* *---------------------------------------------------------------------- * * DdeGetServicesList -- * * This function obtains the list of DDE services. * * The functions between here and this function are all involved with * handling the DDE callbacks for this. They are: DdeCreateClient, * DdeClientWindowProc, DdeServicesOnAck, and DdeEnumWindowsCallback * * Results: * A standard Tcl result. * * Side effects: * Sets the services list into the interp result. * *---------------------------------------------------------------------- */ static int DdeCreateClient( DdeEnumServices *es) { WNDCLASSEXW wc; static const WCHAR *szDdeClientClassName = L"TclEval client class"; static const WCHAR *szDdeClientWindowName = L"TclEval client window"; memset(&wc, 0, sizeof(wc)); wc.cbSize = sizeof(wc); wc.lpfnWndProc = DdeClientWindowProc; wc.lpszClassName = szDdeClientClassName; wc.cbWndExtra = sizeof(DdeEnumServices *); /* * Register and create the callback window. */ RegisterClassExW(&wc); es->hwnd = CreateWindowExW(0, szDdeClientClassName, szDdeClientWindowName, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, (LPVOID)es); return TCL_OK; } static LRESULT CALLBACK DdeClientWindowProc( HWND hwnd, /* What window is the message for */ UINT uMsg, /* The type of message received */ WPARAM wParam, LPARAM lParam) /* (Potentially) our local handle */ { switch (uMsg) { case WM_CREATE: { LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lParam; DdeEnumServices *es = (DdeEnumServices *) lpcs->lpCreateParams; #ifdef _WIN64 SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) es); #else SetWindowLongW(hwnd, GWL_USERDATA, (LONG) es); #endif return (LRESULT) 0L; } case WM_DDE_ACK: return DdeServicesOnAck(hwnd, wParam, lParam); default: return DefWindowProcW(hwnd, uMsg, wParam, lParam); } } static LRESULT DdeServicesOnAck( HWND hwnd, WPARAM wParam, LPARAM lParam) { HWND hwndRemote = (HWND)wParam; ATOM service = (ATOM)LOWORD(lParam); ATOM topic = (ATOM)HIWORD(lParam); DdeEnumServices *es; WCHAR sz[255]; Tcl_DString dString; #ifdef _WIN64 es = (DdeEnumServices *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); #else es = (DdeEnumServices *) GetWindowLongW(hwnd, GWL_USERDATA); #endif if (((es->service == (ATOM)0) || (es->service == service)) && ((es->topic == (ATOM)0) || (es->topic == topic))) { Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL); Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp); GlobalGetAtomNameW(service, sz, 255); Tcl_DStringInit(&dString); Tcl_WCharToUtfDString(sz, wcslen(sz), &dString); Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(Tcl_DStringValue(&dString), -1)); Tcl_DStringFree(&dString); GlobalGetAtomNameW(topic, sz, 255); Tcl_DStringInit(&dString); Tcl_WCharToUtfDString(sz, wcslen(sz), &dString); Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(Tcl_DStringValue(&dString), -1)); Tcl_DStringFree(&dString); /* * Adding the hwnd as a third list element provides a unique * identifier in the case of multiple servers with the name * application and topic names. */ /* * Needs a TIP though: * Tcl_ListObjAppendElement(NULL, matchPtr, * Tcl_NewLongObj((long)hwndRemote)); */ if (Tcl_IsShared(resultPtr)) { resultPtr = Tcl_DuplicateObj(resultPtr); } if (Tcl_ListObjAppendElement(es->interp, resultPtr, matchPtr) == TCL_OK) { Tcl_SetObjResult(es->interp, resultPtr); } } /* * Tell the server we are no longer interested. */ PostMessageW(hwndRemote, WM_DDE_TERMINATE, (WPARAM)hwnd, 0L); return 0L; } static BOOL CALLBACK DdeEnumWindowsCallback( HWND hwndTarget, LPARAM lParam) { DWORD_PTR dwResult = 0; DdeEnumServices *es = (DdeEnumServices *) lParam; SendMessageTimeoutW(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd, MAKELONG(es->service, es->topic), SMTO_ABORTIFHUNG, 1000, &dwResult); return TRUE; } static int DdeGetServicesList( Tcl_Interp *interp, const WCHAR *serviceName, const WCHAR *topicName) { DdeEnumServices es; es.interp = interp; es.result = TCL_OK; es.service = (serviceName == NULL) ? (ATOM)0 : GlobalAddAtomW(serviceName); es.topic = (topicName == NULL) ? (ATOM)0 : GlobalAddAtomW(topicName); Tcl_ResetResult(interp); /* our list is to be appended to result. */ DdeCreateClient(&es); EnumWindows(DdeEnumWindowsCallback, (LPARAM)&es); if (IsWindow(es.hwnd)) { DestroyWindow(es.hwnd); } if (es.service != (ATOM)0) { GlobalDeleteAtom(es.service); } if (es.topic != (ATOM)0) { GlobalDeleteAtom(es.topic); } return es.result; } /* *---------------------------------------------------------------------- * * SetDdeError -- * * Sets the interp result to a cogent error message describing the last * DDE error. * * Results: * None. * * Side effects: * The interp's result object is changed. * *---------------------------------------------------------------------- */ static void SetDdeError( Tcl_Interp *interp) /* The interp to put the message in. */ { const char *errorMessage, *errorCode; switch (DdeGetLastError(ddeInstance)) { case DMLERR_DATAACKTIMEOUT: case DMLERR_EXECACKTIMEOUT: case DMLERR_POKEACKTIMEOUT: errorMessage = "remote interpreter did not respond"; errorCode = "TIMEOUT"; break; case DMLERR_BUSY: errorMessage = "remote server is busy"; errorCode = "BUSY"; break; case DMLERR_NOTPROCESSED: errorMessage = "remote server cannot handle this command"; errorCode = "NOCANDO"; break; default: errorMessage = "dde command failed"; errorCode = "FAILED"; } Tcl_SetObjResult(interp, Tcl_NewStringObj(errorMessage, -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", errorCode, (char *)NULL); } /* *---------------------------------------------------------------------- * * DdeObjCmd -- * * This function is invoked to process the "dde" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int DdeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* The interp we are sending from */ Tcl_Size objc, /* Number of arguments */ Tcl_Obj *const *objv) /* The arguments */ { static const char *const ddeCommands[] = { "servername", "execute", "poke", "request", "services", "eval", NULL}; enum DdeSubcommands { DDE_SERVERNAME, DDE_EXECUTE, DDE_POKE, DDE_REQUEST, DDE_SERVICES, DDE_EVAL }; static const char *const ddeSrvOptions[] = { "-force", "-handler", "--", NULL }; enum DdeSrvOptions { DDE_SERVERNAME_EXACT, DDE_SERVERNAME_HANDLER, DDE_SERVERNAME_LAST, }; static const char *const ddeExecOptions[] = { "-async", "-binary", NULL }; enum DdeExecOptions { DDE_EXEC_ASYNC, DDE_EXEC_BINARY }; static const char *const ddeEvalOptions[] = { "-async", NULL }; static const char *const ddeReqOptions[] = { "-binary", NULL }; int index, argIndex; Tcl_Size length, i, firstArg = 0; int flags = 0, result = TCL_OK; HSZ ddeService = NULL, ddeTopic = NULL, ddeItem = NULL, ddeCookie = NULL; HDDEDATA ddeData = NULL, ddeItemData = NULL, ddeReturn; HCONV hConv = NULL; const WCHAR *serviceName = NULL, *topicName = NULL; const char *string; DWORD ddeResult; Tcl_Obj *objPtr, *handlerPtr = NULL; Tcl_DString serviceBuf, topicBuf, itemBuf; (void)dummy; /* * Initialize DDE server/client */ if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "command ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], ddeCommands, "command", 0, &index) != TCL_OK) { return TCL_ERROR; } Tcl_DStringInit(&serviceBuf); Tcl_DStringInit(&topicBuf); Tcl_DStringInit(&itemBuf); switch ((enum DdeSubcommands) index) { case DDE_SERVERNAME: for (i = 2; i < objc; i++) { if (Tcl_GetIndexFromObj(interp, objv[i], ddeSrvOptions, "option", 0, &argIndex) != TCL_OK) { /* * If it is the last argument, it might be a server name * instead of a bad argument. */ if (i != objc-1) { return TCL_ERROR; } Tcl_ResetResult(interp); break; } if (argIndex == DDE_SERVERNAME_EXACT) { flags |= DDE_FLAG_FORCE; } else if (argIndex == DDE_SERVERNAME_HANDLER) { if ((objc - i) == 1) { /* return current handler */ RegisteredInterp *riPtr = DdeGetRegistrationPtr(interp); if (riPtr && riPtr->handlerPtr) { Tcl_SetObjResult(interp, riPtr->handlerPtr); } else { Tcl_ResetResult(interp); } return TCL_OK; } handlerPtr = objv[++i]; } else if (argIndex == DDE_SERVERNAME_LAST) { i++; break; } } if ((objc - i) > 1) { Tcl_ResetResult(interp); Tcl_WrongNumArgs(interp, 2, objv, "?-force? ?-handler proc? ?--? ?serverName?"); return TCL_ERROR; } firstArg = (objc == i) ? 1 : i; break; case DDE_EXECUTE: if (objc == 5) { firstArg = 2; break; } else if ((objc >= 6) && (objc <= 7)) { firstArg = objc - 3; for (i = 2; i < firstArg; i++) { if (Tcl_GetIndexFromObj(interp, objv[i], ddeExecOptions, "option", 0, &argIndex) != TCL_OK) { goto wrongDdeExecuteArgs; } if (argIndex == DDE_EXEC_ASYNC) { flags |= DDE_FLAG_ASYNC; } else { flags |= DDE_FLAG_BINARY; } } break; } /* otherwise... */ wrongDdeExecuteArgs: Tcl_WrongNumArgs(interp, 2, objv, "?-async? ?-binary? serviceName topicName value"); return TCL_ERROR; case DDE_POKE: if (objc == 6) { firstArg = 2; break; } else if ((objc == 7) && (Tcl_GetIndexFromObj(NULL, objv[2], ddeReqOptions, "option", 0, &argIndex) == TCL_OK)) { flags |= DDE_FLAG_BINARY; firstArg = 3; break; } /* * Otherwise... */ Tcl_WrongNumArgs(interp, 2, objv, "?-binary? serviceName topicName item value"); return TCL_ERROR; case DDE_REQUEST: if (objc == 5) { firstArg = 2; break; } else if ((objc == 6) && (Tcl_GetIndexFromObj(NULL, objv[2], ddeReqOptions, "option", 0, &argIndex) == TCL_OK)) { flags |= DDE_FLAG_BINARY; firstArg = 3; break; } /* * Otherwise ... */ Tcl_WrongNumArgs(interp, 2, objv, "?-binary? serviceName topicName value"); return TCL_ERROR; case DDE_SERVICES: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "serviceName topicName"); return TCL_ERROR; } firstArg = 2; break; case DDE_EVAL: if (objc < 4) { wrongDdeEvalArgs: Tcl_WrongNumArgs(interp, 2, objv, "?-async? serviceName args"); return TCL_ERROR; } else { firstArg = 2; if (Tcl_GetIndexFromObj(NULL, objv[2], ddeEvalOptions, "option", 0, &argIndex) == TCL_OK) { if (objc < 5) { goto wrongDdeEvalArgs; } flags |= DDE_FLAG_ASYNC; firstArg++; } break; } } Initialize(); if (firstArg != 1) { const char *src = Tcl_GetStringFromObj(objv[firstArg], &length); Tcl_DStringInit(&serviceBuf); Tcl_UtfToWCharDString(src, length, &serviceBuf); serviceName = (WCHAR *) Tcl_DStringValue(&serviceBuf); length = Tcl_DStringLength(&serviceBuf) / sizeof(WCHAR); } else { length = 0; } if (length == 0) { serviceName = NULL; } else if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) { ddeService = DdeCreateStringHandleW(ddeInstance, serviceName, CP_WINUNICODE); } if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) { const char *src = Tcl_GetStringFromObj(objv[firstArg + 1], &length); Tcl_DStringInit(&topicBuf); topicName = Tcl_UtfToWCharDString(src, length, &topicBuf); length = Tcl_DStringLength(&topicBuf) / sizeof(WCHAR); if (length == 0) { topicName = NULL; } else { ddeTopic = DdeCreateStringHandleW(ddeInstance, topicName, CP_WINUNICODE); } } switch ((enum DdeSubcommands) index) { case DDE_SERVERNAME: serviceName = DdeSetServerName(interp, serviceName, flags, handlerPtr); if (serviceName != NULL) { Tcl_DString dsBuf; Tcl_DStringInit(&dsBuf); Tcl_WCharToUtfDString(serviceName, wcslen(serviceName), &dsBuf); Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_DStringValue(&dsBuf), Tcl_DStringLength(&dsBuf))); Tcl_DStringFree(&dsBuf); } else { Tcl_ResetResult(interp); } break; case DDE_EXECUTE: { Tcl_Size dataLength; const void *dataString; Tcl_DString dsBuf; Tcl_DStringInit(&dsBuf); if (flags & DDE_FLAG_BINARY) { dataString = Tcl_GetByteArrayFromObj(objv[firstArg + 2], &dataLength); } else { const char *src; src = Tcl_GetStringFromObj(objv[firstArg + 2], &dataLength); Tcl_DStringInit(&dsBuf); dataString = Tcl_UtfToWCharDString(src, dataLength, &dsBuf); dataLength = Tcl_DStringLength(&dsBuf) + sizeof(WCHAR); } if (dataLength + 1 < 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot execute null data", -1)); Tcl_DStringFree(&dsBuf); Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (char *)NULL); result = TCL_ERROR; break; } hConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL); DdeFreeStringHandle(ddeInstance, ddeService); DdeFreeStringHandle(ddeInstance, ddeTopic); if (hConv == NULL) { Tcl_DStringFree(&dsBuf); SetDdeError(interp); result = TCL_ERROR; break; } ddeData = DdeCreateDataHandle(ddeInstance, (BYTE *) dataString, (DWORD) dataLength, 0, 0, (flags & DDE_FLAG_BINARY) ? CF_TEXT : CF_UNICODETEXT, 0); if (ddeData != NULL) { if (flags & DDE_FLAG_ASYNC) { DdeClientTransaction((LPBYTE) ddeData, 0xFFFFFFFF, hConv, 0, (flags & DDE_FLAG_BINARY) ? CF_TEXT : CF_UNICODETEXT, XTYP_EXECUTE, TIMEOUT_ASYNC, &ddeResult); DdeAbandonTransaction(ddeInstance, hConv, ddeResult); } else { ddeReturn = DdeClientTransaction((LPBYTE) ddeData, 0xFFFFFFFF, hConv, 0, (flags & DDE_FLAG_BINARY) ? CF_TEXT : CF_UNICODETEXT, XTYP_EXECUTE, 30000, NULL); if (ddeReturn == 0) { SetDdeError(interp); result = TCL_ERROR; } } DdeFreeDataHandle(ddeData); } else { SetDdeError(interp); result = TCL_ERROR; } Tcl_DStringFree(&dsBuf); break; } case DDE_REQUEST: { const WCHAR *itemString; const char *src; src = Tcl_GetStringFromObj(objv[firstArg + 2], &length); Tcl_DStringInit(&itemBuf); itemString = Tcl_UtfToWCharDString(src, length, &itemBuf); length = Tcl_DStringLength(&itemBuf) / sizeof(WCHAR); if (length == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot request value of null data", -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (char *)NULL); result = TCL_ERROR; goto cleanup; } hConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL); DdeFreeStringHandle(ddeInstance, ddeService); DdeFreeStringHandle(ddeInstance, ddeTopic); if (hConv == NULL) { SetDdeError(interp); result = TCL_ERROR; } else { Tcl_Obj *returnObjPtr; ddeItem = DdeCreateStringHandleW(ddeInstance, itemString, CP_WINUNICODE); if (ddeItem != NULL) { ddeData = DdeClientTransaction(NULL, 0, hConv, ddeItem, (flags & DDE_FLAG_BINARY) ? CF_TEXT : CF_UNICODETEXT, XTYP_REQUEST, 5000, NULL); if (ddeData == NULL) { SetDdeError(interp); result = TCL_ERROR; } else { DWORD tmp; WCHAR *dataString = (WCHAR *) DdeAccessData(ddeData, &tmp); if (flags & DDE_FLAG_BINARY) { returnObjPtr = Tcl_NewByteArrayObj((BYTE *) dataString, tmp); } else { Tcl_DString dsBuf; if ((tmp >= sizeof(WCHAR)) && !dataString[tmp / sizeof(WCHAR) - 1]) { tmp -= (DWORD)sizeof(WCHAR); } Tcl_DStringInit(&dsBuf); Tcl_WCharToUtfDString(dataString, tmp>>1, &dsBuf); returnObjPtr = Tcl_NewStringObj(Tcl_DStringValue(&dsBuf), Tcl_DStringLength(&dsBuf)); Tcl_DStringFree(&dsBuf); } DdeUnaccessData(ddeData); DdeFreeDataHandle(ddeData); Tcl_SetObjResult(interp, returnObjPtr); } } else { SetDdeError(interp); result = TCL_ERROR; } } break; } case DDE_POKE: { Tcl_DString dsBuf; const WCHAR *itemString; BYTE *dataString; const char *src; src = Tcl_GetStringFromObj(objv[firstArg + 2], &length); Tcl_DStringInit(&itemBuf); itemString = Tcl_UtfToWCharDString(src, length, &itemBuf); length = Tcl_DStringLength(&itemBuf) / sizeof(WCHAR); if (length == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("cannot have a null item", -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", "NULL", (char *)NULL); result = TCL_ERROR; goto cleanup; } Tcl_DStringInit(&dsBuf); if (flags & DDE_FLAG_BINARY) { dataString = (BYTE *) Tcl_GetByteArrayFromObj(objv[firstArg + 3], &length); } else { const char *data = Tcl_GetStringFromObj(objv[firstArg + 3], &length); Tcl_DStringInit(&dsBuf); dataString = (BYTE *) Tcl_UtfToWCharDString(data, length, &dsBuf); length = Tcl_DStringLength(&dsBuf) + sizeof(WCHAR); } hConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL); DdeFreeStringHandle(ddeInstance, ddeService); DdeFreeStringHandle(ddeInstance, ddeTopic); if (hConv == NULL) { SetDdeError(interp); result = TCL_ERROR; } else { ddeItem = DdeCreateStringHandleW(ddeInstance, itemString, CP_WINUNICODE); if (ddeItem != NULL) { ddeData = DdeClientTransaction(dataString, (DWORD) length, hConv, ddeItem, (flags & DDE_FLAG_BINARY) ? CF_TEXT : CF_UNICODETEXT, XTYP_POKE, 5000, NULL); if (ddeData == NULL) { SetDdeError(interp); result = TCL_ERROR; } } else { SetDdeError(interp); result = TCL_ERROR; } } Tcl_DStringFree(&dsBuf); break; } case DDE_SERVICES: result = DdeGetServicesList(interp, serviceName, topicName); break; case DDE_EVAL: { RegisteredInterp *riPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (serviceName == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid service name \"\"", -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", "NO_SERVER", (char *)NULL); result = TCL_ERROR; goto cleanup; } objc -= firstArg + 1; objv += firstArg + 1; /* * See if the target interpreter is local. If so, execute the command * directly without going through the DDE server. Don't exchange * objects between interps. The target interp could compile an object, * producing a bytecode structure that refers to other objects owned * by the target interp. If the target interp is then deleted, the * bytecode structure would be referring to deallocated objects. */ for (riPtr = tsdPtr->interpListPtr; riPtr != NULL; riPtr = riPtr->nextPtr) { if (_wcsicmp(serviceName, riPtr->name) == 0) { break; } } if (riPtr != NULL) { Tcl_Interp *sendInterp; /* * This command is to a local interp. No need to go through the * server. */ Tcl_Preserve(riPtr); sendInterp = riPtr->interp; Tcl_Preserve(sendInterp); /* * Don't exchange objects between interps. The target interp would * compile an object, producing a bytecode structure that refers * to other objects owned by the target interp. If the target * interp is then deleted, the bytecode structure would be * referring to deallocated objects. */ if (Tcl_IsSafe(riPtr->interp) && (riPtr->handlerPtr == NULL)) { Tcl_SetObjResult(riPtr->interp, Tcl_NewStringObj( "permission denied: a handler procedure must be" " defined for use in a safe interp", -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", "SECURITY_CHECK", (char *)NULL); result = TCL_ERROR; } if (result == TCL_OK) { if (objc == 1) { objPtr = objv[0]; } else { objPtr = Tcl_ConcatObj(objc, objv); } if (riPtr->handlerPtr != NULL) { /* add the dde request data to the handler proc list */ /* *result = Tcl_ListObjReplace(sendInterp, objPtr, 0, 0, 1, * &(riPtr->handlerPtr)); */ Tcl_Obj *cmdPtr = Tcl_DuplicateObj(riPtr->handlerPtr); result = Tcl_ListObjAppendElement(sendInterp, cmdPtr, objPtr); if (result == TCL_OK) { objPtr = cmdPtr; } } } if (result == TCL_OK) { Tcl_IncrRefCount(objPtr); result = Tcl_EvalObjEx(sendInterp, objPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(objPtr); } if (interp != sendInterp) { if (result == TCL_ERROR) { /* * An error occurred, so transfer error information from * the destination interpreter back to our interpreter. */ Tcl_ResetResult(interp); objPtr = Tcl_GetVar2Ex(sendInterp, "errorInfo", NULL, TCL_GLOBAL_ONLY); if (objPtr) { Tcl_AppendObjToErrorInfo(interp, objPtr); } objPtr = Tcl_GetVar2Ex(sendInterp, "errorCode", NULL, TCL_GLOBAL_ONLY); if (objPtr) { Tcl_SetObjErrorCode(interp, objPtr); } } Tcl_SetObjResult(interp, Tcl_GetObjResult(sendInterp)); } Tcl_Release(riPtr); Tcl_Release(sendInterp); } else { Tcl_DString dsBuf; /* * This is a non-local request. Send the script to the server and * poll it for a result. */ if (MakeDdeConnection(interp, serviceName, &hConv) != TCL_OK) { invalidServerResponse: Tcl_SetObjResult(interp, Tcl_NewStringObj("invalid data returned from server", -1)); Tcl_SetErrorCode(interp, "TCL", "DDE", "BAD_RESPONSE", (char *)NULL); result = TCL_ERROR; goto cleanup; } objPtr = Tcl_ConcatObj(objc, objv); string = Tcl_GetStringFromObj(objPtr, &length); Tcl_DStringInit(&dsBuf); Tcl_UtfToWCharDString(string, length, &dsBuf); string = Tcl_DStringValue(&dsBuf); length = Tcl_DStringLength(&dsBuf) + sizeof(WCHAR); ddeItemData = DdeCreateDataHandle(ddeInstance, (BYTE *) string, (DWORD) length, 0, 0, CF_UNICODETEXT, 0); Tcl_DStringFree(&dsBuf); if (flags & DDE_FLAG_ASYNC) { ddeData = DdeClientTransaction((LPBYTE) ddeItemData, 0xFFFFFFFF, hConv, 0, CF_UNICODETEXT, XTYP_EXECUTE, TIMEOUT_ASYNC, &ddeResult); DdeAbandonTransaction(ddeInstance, hConv, ddeResult); } else { ddeData = DdeClientTransaction((LPBYTE) ddeItemData, 0xFFFFFFFF, hConv, 0, CF_UNICODETEXT, XTYP_EXECUTE, 30000, NULL); if (ddeData != 0) { ddeCookie = DdeCreateStringHandleW(ddeInstance, TCL_DDE_EXECUTE_RESULT, CP_WINUNICODE); ddeData = DdeClientTransaction(NULL, 0, hConv, ddeCookie, CF_UNICODETEXT, XTYP_REQUEST, 30000, NULL); } } Tcl_DecrRefCount(objPtr); if (ddeData == 0) { SetDdeError(interp); result = TCL_ERROR; goto cleanup; } if (!(flags & DDE_FLAG_ASYNC)) { Tcl_Obj *resultPtr; WCHAR *ddeDataString; /* * The return handle has a two or four element list in it. The * first element is the return code (TCL_OK, TCL_ERROR, etc.). * The second is the result of the script. If the return code * is TCL_ERROR, then the third element is the value of the * variable "errorCode", and the fourth is the value of the * variable "errorInfo". */ length = DdeGetData(ddeData, NULL, 0, 0); ddeDataString = (WCHAR *) Tcl_Alloc(length); DdeGetData(ddeData, (BYTE *) ddeDataString, (DWORD) length, 0); if (length > (Tcl_Size)sizeof(WCHAR)) { length -= sizeof(WCHAR); } Tcl_DStringInit(&dsBuf); Tcl_WCharToUtfDString(ddeDataString, length>>1, &dsBuf); resultPtr = Tcl_NewStringObj(Tcl_DStringValue(&dsBuf), Tcl_DStringLength(&dsBuf)); Tcl_DStringFree(&dsBuf); Tcl_Free((char *) ddeDataString); if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr) != TCL_OK) { Tcl_DecrRefCount(resultPtr); goto invalidServerResponse; } if (Tcl_GetIntFromObj(NULL, objPtr, &result) != TCL_OK) { Tcl_DecrRefCount(resultPtr); goto invalidServerResponse; } if (result == TCL_ERROR) { Tcl_ResetResult(interp); if (Tcl_ListObjIndex(NULL, resultPtr, 3, &objPtr) != TCL_OK) { Tcl_DecrRefCount(resultPtr); goto invalidServerResponse; } Tcl_AppendObjToErrorInfo(interp, objPtr); Tcl_ListObjIndex(NULL, resultPtr, 2, &objPtr); Tcl_SetObjErrorCode(interp, objPtr); } if (Tcl_ListObjIndex(NULL, resultPtr, 1, &objPtr) != TCL_OK) { Tcl_DecrRefCount(resultPtr); goto invalidServerResponse; } Tcl_SetObjResult(interp, objPtr); Tcl_DecrRefCount(resultPtr); } } } } cleanup: if (ddeCookie != NULL) { DdeFreeStringHandle(ddeInstance, ddeCookie); } if (ddeItem != NULL) { DdeFreeStringHandle(ddeInstance, ddeItem); } if (ddeItemData != NULL) { DdeFreeDataHandle(ddeItemData); } if (ddeData != NULL) { DdeFreeDataHandle(ddeData); } if (hConv != NULL) { DdeDisconnect(hConv); } Tcl_DStringFree(&itemBuf); Tcl_DStringFree(&topicBuf); Tcl_DStringFree(&serviceBuf); return result; } /* * Local variables: * mode: c * indent-tabs-mode: t * tab-width: 8 * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinConsole.c0000644000175000017500000022671315104661342015307 0ustar sergeisergei/* * tclWinConsole.c -- * * This file implements the Windows-specific console functions, and the * "console" channel driver. Windows 7 or later required. * * Copyright © 2022 Ashok P. Nadkarni * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifdef TCL_CONSOLE_DEBUG #undef NDEBUG /* Enable asserts */ #endif #include "tclWinInt.h" #include /* * A general note on the design: The console channel driver differs from * most other drivers in the following respects: * * - There can be at most 3 console handles at any time since Windows does * support allocation of more than one console (with three handles * corresponding to stdin, stdout, stderr) * * - Consoles are created / inherited at process startup. There is currently * no way in Tcl to programmatically create a console. Even if these were * added the above Windows limitation would still apply. * * - Unlike files, sockets etc. where there is a one-to-one * correspondence between Tcl channels and operating system handles, * std* channels are shared amongst threads which means there can be * multiple Tcl channels corresponding to a single console handle. * * - Even with multiple threads, more than one file event handler is * unlikely. It does not make sense for multiple threads to register * handlers for stdin because the input would be randomly fragmented amongst * the threads. * * Various design factors are driven by the above, e.g. use of lists instead * of hash tables (at most 3 console handles) and use of global instead of * per thread queues which simplifies lock management particularly because * thread-console relation is not one-one and is likely more performant as * well with fewer locks needing to be obtained. * * Some additional design notes/reminders for the future: * * Aligned, synchronous reads are done directly by interpreter thread. * Unaligned or asynchronous reads are done through the reader thread. * * The reader thread does not read ahead. That is, it will not post a read * until some interpreter thread is actually requesting a read. This is * because an interpreter may (for example) turn off echo for passwords and * the read ahead would come in the way of that. * * If multiple threads are reading from stdin, the input is sprayed in * random fashion. This is not good application design and hence no plan to * address this (not clear what should be done even in theory). * * For output, we do not restrict all output to the console writer threads. * See ConsoleOutputProc for the conditions. * * Locks are never held when calling the ReadConsole/WriteConsole API's * since they may block. */ static int gInitialized = 0; /* * INPUT_BUFFER_SIZE is size of buffer passed to ReadConsole in bytes. * Note that ReadConsole will only allow reading of line lengths up to the * max of 256 and buffer size passed to it. So dropping this below 512 * means user can type at most 256 chars. */ #ifndef INPUT_BUFFER_SIZE #define INPUT_BUFFER_SIZE 8192 /* In bytes, so 4096 chars */ #endif /* * CONSOLE_BUFFER_SIZE is size of storage used in ring buffers. * In theory, at least sizeof(WCHAR) but note the Tcl channel bug * https://core.tcl-lang.org/tcl/tktview/b3977d199b08e3979a8da970553d5209b3042e9c * will cause failures in test suite if close to max input line in the suite. */ #ifndef CONSOLE_BUFFER_SIZE #define CONSOLE_BUFFER_SIZE 8192 /* In bytes */ #endif /* * Ring buffer for storing data. Actual data is from bufPtr[start]:bufPtr[size-1] * and bufPtr[0]:bufPtr[length - (size-start)]. */ typedef struct RingBuffer { char *bufPtr; /* Pointer to buffer storage */ Tcl_Size capacity; /* Size of the buffer in RingBufferChar */ Tcl_Size start; /* Start of the data within the buffer. */ Tcl_Size length; /* Number of RingBufferChar*/ } RingBuffer; #define RingBufferLength(ringPtr_) \ ((ringPtr_)->length) #define RingBufferHasFreeSpace(ringPtr_) \ ((ringPtr_)->length < (ringPtr_)->capacity) #define RINGBUFFER_ASSERT(ringPtr_) \ assert(RingBufferCheck(ringPtr_)) /* * The Win32 console API does not support non-blocking I/O in any form. Thus * the actual calls are made on a separate thread. Moreover, separate * threads are needed for each handle because (for example) blocking on user * input on stdin should not prevent output to stdout when non-blocking i/o * is configured at the script level. * * In the input (e.g. stdin) case, the console stdin thread is the producer * writing to the buffer ring buffer. The Tcl interpreter threads are the * consumer. For the output (e.g. stdout/stderr) case, the Tcl interpreter * are the producers while the console stdout/stderr threads are the * consumers. * * Consoles are identified purely by handles and multiple threads may open * them (as stdin/stdout/stderr are shared). * * Note on reference counting - a ConsoleHandleInfo instance has multiple * references to it - one each from every channel that is attached to it * plus one from the console thread itself which also serves as the reference * from gConsoleHandleInfoList. */ typedef struct ConsoleHandleInfo { struct ConsoleHandleInfo *nextPtr; /* Process-global list of consoles */ HANDLE console; /* Console handle */ HANDLE consoleThread; /* Handle to thread doing actual i/o on the * console */ SRWLOCK lock; /* Controls access to this structure. Cheaper * than CRITICAL_SECTION but note does not * support recursive locks or Try* style * attempts. */ CONDITION_VARIABLE consoleThreadCV;/* For awakening console thread */ CONDITION_VARIABLE interpThreadCV; /* For awakening interpthread(s) */ RingBuffer buffer; /* Buffer for data transferred between console * threads and Tcl threads. For input consoles, * written by the console thread and read by Tcl * threads. The converse for output threads */ DWORD initMode; /* Initial console mode. */ DWORD lastError; /* An error caused by the last background * operation. Set to 0 if no error has been * detected. */ int numRefs; /* See comments above */ int permissions; /* TCL_READABLE for input consoles, * TCL_WRITABLE for output. Only one or the * other can be set. */ int flags; /* State flags */ } ConsoleHandleInfo; enum ConsoleHandleInfoFlags { CONSOLE_DATA_AWAITED = 1 /* An interpreter is awaiting data */ }; /* * This structure describes per-instance data for a console based channel. * * Note on locking - this structure has no locks because it is accessed * only from the thread owning channel EXCEPT when a console traverses it * looking for a channel that is watching for events on the console. Even * in that case, no locking is required because that access is only under * the gConsoleLock lock which prevents the channel from being removed from * the gWatchingChannelList which in turn means it will not be deallocated * from under the console thread. Access to individual fields does not need * to be controlled because * - the console thread does not write to any fields * - changes to the nextWatchingChannelPtr field * - changes to other fields do not matter because after being read for * queueing events, they are verified again when the event is received * in the interpreter thread (since they could have changed anyways while * the event was in-flight on the event queue) * * Note on reference counting - a structure instance may be referenced from * three places: * - the Tcl channel subsystem. This reference is created when on channel * opening and dropped on channel close. This also covers the reference * from gWatchingChannelList since queueing / dequeuing from that list * happens in conjunction with channel operations. * - the Tcl event queue entries. This reference is added when the event * is queued and dropped on receipt. */ typedef struct ConsoleChannelInfo { HANDLE handle; /* Console handle */ Tcl_ThreadId threadId; /* Id of owning thread */ struct ConsoleChannelInfo *nextWatchingChannelPtr; /* Pointer to next channel watching events. */ Tcl_Channel channel; /* Pointer to channel structure. */ DWORD initMode; /* Initial console mode. */ int numRefs; /* See comments above */ int permissions; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which operations are valid on the file. */ int watchMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which events should be reported. */ int flags; /* State flags */ } ConsoleChannelInfo; enum ConsoleChannelInfoFlags { CONSOLE_EVENT_QUEUED = 1, /* Notification event already queued */ CONSOLE_ASYNC = 2, /* Channel is non-blocking. */ CONSOLE_READ_OPS = 4 /* Channel supports read-related ops. */ }; /* * The following structure is what is added to the Tcl event queue when * console events are generated. */ typedef struct { Tcl_Event header; /* Information that is standard for all events. */ ConsoleChannelInfo *chanInfoPtr; /* Pointer to console info structure. Note * that we still have to verify that the * console exists before dereferencing this * pointer. */ } ConsoleEvent; /* * Declarations for functions used only in this file. */ static int ConsoleBlockModeProc(void *instanceData, int mode); static void ConsoleCheckProc(void *clientData, int flags); static int ConsoleCloseProc(void *instanceData, Tcl_Interp *interp, int flags); static int ConsoleEventProc(Tcl_Event *evPtr, int flags); static void ConsoleExitHandler(void *clientData); static int ConsoleGetHandleProc(void *instanceData, int direction, void **handlePtr); static int ConsoleGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static void ConsoleInit(void); static int ConsoleInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int ConsoleOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static int ConsoleSetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, const char *value); static void ConsoleSetupProc(void *clientData, int flags); static void ConsoleWatchProc(void *instanceData, int mask); static void ProcExitHandler(void *clientData); static void ConsoleThreadActionProc(void *instanceData, int action); static DWORD ReadConsoleChars(HANDLE hConsole, WCHAR *lpBuffer, Tcl_Size nChars, Tcl_Size *nCharsReadPtr); static DWORD WriteConsoleChars(HANDLE hConsole, const WCHAR *lpBuffer, Tcl_Size nChars, Tcl_Size *nCharsWritten); static void RingBufferInit(RingBuffer *ringPtr, Tcl_Size capacity); static void RingBufferClear(RingBuffer *ringPtr); static Tcl_Size RingBufferIn(RingBuffer *ringPtr, const char *srcPtr, Tcl_Size srcLen, int partialCopyOk); static Tcl_Size RingBufferOut(RingBuffer *ringPtr, char *dstPtr, Tcl_Size dstCapacity, int partialCopyOk); static ConsoleHandleInfo *AllocateConsoleHandleInfo(HANDLE consoleHandle, int permissions); static ConsoleHandleInfo *FindConsoleInfo(const ConsoleChannelInfo *); static DWORD WINAPI ConsoleReaderThread(LPVOID arg); static DWORD WINAPI ConsoleWriterThread(LPVOID arg); static void NudgeWatchers(HANDLE consoleHandle); #ifndef NDEBUG static int RingBufferCheck(const RingBuffer *ringPtr); #endif /* * Static data. */ typedef struct { /* Currently this struct is only used to detect thread initialization */ int notUsed; /* Dummy field */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * All access to static data is controlled through a single process-wide * lock. A process can have only a single console at a time, with three * handles for stdin, stdout and stderr. Creation/destruction of consoles is * a relatively rare event (currently only possible during process start), * the number of consoles (as opposed to channels) is small (only stdin, * stdout and stderr), and contention low. More finer-grained locking would * likely not only complicate implementation but be slower due to multiple * locks being held. Note console channels also differ from other Tcl * channel types in that the channel<->OS descriptor mapping is not one-to-one. */ SRWLOCK gConsoleLock; /* Process-wide list of console handles. Access control through gConsoleLock */ static ConsoleHandleInfo *gConsoleHandleInfoList; /* * Process-wide list of channels that are listening for events. Again access * control through gConsoleLock. Common list for all threads is simplifies * locking and bookkeeping and is workable because in practice multiple * threads are very unlikely to be all waiting on stdin (not workable * because input would be randomly distributed to threads) */ static ConsoleChannelInfo *gWatchingChannelList; /* * This structure describes the channel type structure for command console * based IO. */ static const Tcl_ChannelType consoleChannelType = { "console", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ ConsoleInputProc, ConsoleOutputProc, NULL, /* Deprecated. */ ConsoleSetOptionProc, ConsoleGetOptionProc, ConsoleWatchProc, ConsoleGetHandleProc, ConsoleCloseProc, ConsoleBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ ConsoleThreadActionProc, NULL /* Truncation proc. */ }; /* *------------------------------------------------------------------------ * * RingBufferInit -- * * Initializes the ring buffer to a given size. * * Results: * None. * * Side effects: * Panics on allocation failure. * *------------------------------------------------------------------------ */ static void RingBufferInit( RingBuffer *ringPtr, Tcl_Size capacity) { if (capacity <= 0 || capacity > TCL_SIZE_MAX) { Tcl_Panic("Internal error: invalid ring buffer capacity requested."); } ringPtr->bufPtr = (char *)Tcl_Alloc(capacity); ringPtr->capacity = capacity; ringPtr->start = 0; ringPtr->length = 0; } /* *------------------------------------------------------------------------ * * RingBufferClear * * Clears the contents of a ring buffer. * * Results: * None. * * Side effects: * The allocated internal buffer is freed. * *------------------------------------------------------------------------ */ static void RingBufferClear( RingBuffer *ringPtr) { if (ringPtr->bufPtr) { Tcl_Free(ringPtr->bufPtr); ringPtr->bufPtr = NULL; } ringPtr->capacity = 0; ringPtr->start = 0; ringPtr->length = 0; } /* *------------------------------------------------------------------------ * * RingBufferIn -- * * Appends data to the ring buffer. * * Results: * Returns number of bytes copied. * * Side effects: * Internal buffer is updated. * *------------------------------------------------------------------------ */ static Tcl_Size RingBufferIn( RingBuffer *ringPtr, const char *srcPtr, /* Source to be copied */ Tcl_Size srcLen, /* Length of source */ int partialCopyOk) /* If true, partial copy is permitted */ { Tcl_Size freeSpace; RINGBUFFER_ASSERT(ringPtr); freeSpace = ringPtr->capacity - ringPtr->length; if (freeSpace < srcLen) { if (!partialCopyOk) { return 0; } /* Copy only as much as free space allows */ srcLen = freeSpace; } if (ringPtr->capacity - ringPtr->start > ringPtr->length) { /* There is room at the back */ Tcl_Size endSpaceStart = ringPtr->start + ringPtr->length; Tcl_Size endSpace = ringPtr->capacity - endSpaceStart; if (endSpace >= srcLen) { /* Everything fits at the back */ memmove(endSpaceStart + ringPtr->bufPtr, srcPtr, srcLen); } else { /* srcLen > endSpace */ memmove(endSpaceStart + ringPtr->bufPtr, srcPtr, endSpace); memmove(ringPtr->bufPtr, endSpace + srcPtr, srcLen - endSpace); } } else { /* No room at the back. Existing data wrap to front. */ Tcl_Size wrapLen = ringPtr->start + ringPtr->length - ringPtr->capacity; memmove(wrapLen + ringPtr->bufPtr, srcPtr, srcLen); } ringPtr->length += srcLen; RINGBUFFER_ASSERT(ringPtr); return srcLen; } /* *------------------------------------------------------------------------ * * RingBufferOut -- * * Moves data out of the ring buffer. If dstPtr is NULL, the data * is simply removed. * * Results: * Returns number of bytes copied or removed. * * Side effects: * Internal buffer is updated. * *------------------------------------------------------------------------ */ static Tcl_Size RingBufferOut( RingBuffer *ringPtr, char *dstPtr, /* Buffer for output data. May be NULL */ Tcl_Size dstCapacity, /* Size of buffer */ int partialCopyOk) /* If true, return what's available */ { Tcl_Size leadLen; RINGBUFFER_ASSERT(ringPtr); if (dstCapacity > ringPtr->length) { if (dstPtr && !partialCopyOk) { return 0; } dstCapacity = ringPtr->length; } if (ringPtr->start <= (ringPtr->capacity - ringPtr->length)) { /* No content wrap around. So leadLen is entire content */ leadLen = ringPtr->length; } else { /* Content wraps around so lead segment stretches to end of buffer */ leadLen = ringPtr->capacity - ringPtr->start; } if (leadLen >= dstCapacity) { if (dstPtr) { memmove(dstPtr, ringPtr->start + ringPtr->bufPtr, dstCapacity); } ringPtr->start += dstCapacity; } else { Tcl_Size wrapLen = dstCapacity - leadLen; if (dstPtr) { memmove(dstPtr, ringPtr->start + ringPtr->bufPtr, leadLen); memmove(leadLen + dstPtr, ringPtr->bufPtr, wrapLen); } ringPtr->start = wrapLen; } ringPtr->length -= dstCapacity; if (ringPtr->start == ringPtr->capacity || ringPtr->length == 0) { ringPtr->start = 0; } RINGBUFFER_ASSERT(ringPtr); return dstCapacity; } #ifndef NDEBUG static int RingBufferCheck( const RingBuffer *ringPtr) { return (ringPtr->bufPtr != NULL && ringPtr->capacity == CONSOLE_BUFFER_SIZE && ringPtr->start < ringPtr->capacity && ringPtr->length <= ringPtr->capacity); } #endif /* *------------------------------------------------------------------------ * * ReadConsoleChars -- * * Wrapper for ReadConsoleW. * * Results: * Returns 0 on success, else Windows error code. * * Side effects: * On success the number of characters (not bytes) read is stored in * *nCharsReadPtr. This will be 0 if the operation was interrupted by * a Ctrl-C or a CancelIo call. * *------------------------------------------------------------------------ */ static DWORD ReadConsoleChars( HANDLE hConsole, WCHAR *lpBuffer, Tcl_Size nChars, Tcl_Size *nCharsReadPtr) { DWORD nRead; /* * If user types a Ctrl-Break or Ctrl-C, ReadConsole will return success * with ntchars == 0 and GetLastError() will be ERROR_OPERATION_ABORTED. * If no Ctrl signal handlers have been established, the default signal * OS handler in a separate thread will terminate the program. If a Ctrl * signal handler has been established (through an extension for * example), it will run and take whatever action it deems appropriate. * * If one thread closes its channel, it calls CancelSynchronousIo on the * console handle which results again in success being returned and * GetLastError() being ERROR_OPERATION_ABORTED but ntchars in * unmodified. * * In both cases above we will return success but with nbytesread as 0. * This allows caller to check for thread termination etc. * * See https://bugs.python.org/issue30237 * or https://github.com/microsoft/terminal/issues/12143 */ nRead = (DWORD)-1; if (!ReadConsoleW(hConsole, lpBuffer, nChars, &nRead, NULL)) { return GetLastError(); } if ((nRead == 0 || nRead == (DWORD)-1) && GetLastError() == ERROR_OPERATION_ABORTED) { nRead = 0; } *nCharsReadPtr = nRead; return 0; } /* *------------------------------------------------------------------------ * * WriteConsoleChars -- * * Wrapper for WriteConsoleW. * * Results: * Returns 0 on success, Windows error code on failure. * * Side effects: * On success the number of characters (not bytes) written is stored in * *nCharsWrittenPtr. This will be 0 if the operation was interrupted by * a Ctrl-C or a CancelIo call. * *------------------------------------------------------------------------ */ static DWORD WriteConsoleChars( HANDLE hConsole, const WCHAR *lpBuffer, Tcl_Size nChars, Tcl_Size *nCharsWrittenPtr) { DWORD nCharsWritten; /* See comments in ReadConsoleChars, not sure that applies here */ nCharsWritten = (DWORD)-1; if (!WriteConsoleW(hConsole, lpBuffer, nChars, &nCharsWritten, NULL)) { return GetLastError(); } if (nCharsWritten == (DWORD) -1) { nCharsWritten = 0; } *nCharsWrittenPtr = nCharsWritten; return 0; } /* *---------------------------------------------------------------------- * * ConsoleInit -- * * This function initializes the static variables for this file. * * Results: * None. * * Side effects: * Creates a new event source. * *---------------------------------------------------------------------- */ static void ConsoleInit(void) { /* * Check the initialized flag first, then check again in the mutex. This * is a speed enhancement. */ if (!gInitialized) { AcquireSRWLockExclusive(&gConsoleLock); if (!gInitialized) { gInitialized = 1; Tcl_CreateExitHandler(ProcExitHandler, NULL); } ReleaseSRWLockExclusive(&gConsoleLock); } if (TclThreadDataKeyGet(&dataKey) == NULL) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->notUsed = 0; Tcl_CreateEventSource(ConsoleSetupProc, ConsoleCheckProc, NULL); Tcl_CreateThreadExitHandler(ConsoleExitHandler, NULL); } } /* *---------------------------------------------------------------------- * * ConsoleExitHandler -- * * This function is called to cleanup the console module before Tcl is * unloaded. * * Results: * None. * * Side effects: * Removes the console event source. * *---------------------------------------------------------------------- */ static void ConsoleExitHandler( TCL_UNUSED(void *)) { Tcl_DeleteEventSource(ConsoleSetupProc, ConsoleCheckProc, NULL); } /* *---------------------------------------------------------------------- * * ProcExitHandler -- * * This function is called to cleanup the process list before Tcl is * unloaded. * * Results: * None. * * Side effects: * Resets the process list. * *---------------------------------------------------------------------- */ static void ProcExitHandler( TCL_UNUSED(void *)) { AcquireSRWLockExclusive(&gConsoleLock); gInitialized = 0; ReleaseSRWLockExclusive(&gConsoleLock); } /* *------------------------------------------------------------------------ * * NudgeWatchers -- * * Wakes up all threads which have file event watchers on the passed * console handle. * * The function locks and releases gConsoleLock. * Caller must not be holding locks that will violate lock hierarchy. * * Results: * None. * * Side effects: * As above. *------------------------------------------------------------------------ */ static void NudgeWatchers( HANDLE consoleHandle) { ConsoleChannelInfo *chanInfoPtr; AcquireSRWLockShared(&gConsoleLock); /* Shared-read lock */ for (chanInfoPtr = gWatchingChannelList; chanInfoPtr; chanInfoPtr = chanInfoPtr->nextWatchingChannelPtr) { /* * Notify channels interested in our handle AND that have * a thread attached. * No lock needed for chanInfoPtr. See ConsoleChannelInfo. */ if (chanInfoPtr->handle == consoleHandle && chanInfoPtr->threadId != NULL) { Tcl_ThreadAlert(chanInfoPtr->threadId); } } ReleaseSRWLockShared(&gConsoleLock); } /* *---------------------------------------------------------------------- * * ConsoleSetupProc -- * * This procedure is invoked before Tcl_DoOneEvent blocks waiting for an * event. It walks the channel list and if any input channel has data * available or output channel has space for data, sets the event loop * blocking time to 0 so that it will poll immediately. * * Results: * None. * * Side effects: * Adjusts the block time if needed. * *---------------------------------------------------------------------- */ void ConsoleSetupProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { ConsoleChannelInfo *chanInfoPtr; Tcl_Time blockTime = { 0, 0 }; int block = 1; if (!(flags & TCL_FILE_EVENTS)) { return; } /* * Walk the list of channels. See general comments for struct * ConsoleChannelInfo with regard to locking and field access. */ AcquireSRWLockShared(&gConsoleLock); /* READ lock - no data modification */ for (chanInfoPtr = gWatchingChannelList; block && chanInfoPtr != NULL; chanInfoPtr = chanInfoPtr->nextWatchingChannelPtr) { ConsoleHandleInfo *handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr != NULL) { AcquireSRWLockShared(&handleInfoPtr->lock); /* Remember at most one of READABLE, WRITABLE set */ if (chanInfoPtr->watchMask & TCL_READABLE) { if (RingBufferLength(&handleInfoPtr->buffer) > 0 || handleInfoPtr->lastError != ERROR_SUCCESS) { block = 0; /* Input data available */ } } else if (chanInfoPtr->watchMask & TCL_WRITABLE) { if (RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { /* TCL_WRITABLE */ block = 0; /* Output space available */ } } ReleaseSRWLockShared(&handleInfoPtr->lock); } } ReleaseSRWLockShared(&gConsoleLock); if (!block) { /* At least one channel is readable/writable. Set block time to 0 */ Tcl_SetMaxBlockTime(&blockTime); } } /* *---------------------------------------------------------------------- * * ConsoleCheckProc -- * * This procedure is called by Tcl_DoOneEvent to check the console event * source for events. * * Results: * None. * * Side effects: * May queue an event. * *---------------------------------------------------------------------- */ static void ConsoleCheckProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { ConsoleChannelInfo *chanInfoPtr; Tcl_ThreadId me; int needEvent; if (!(flags & TCL_FILE_EVENTS)) { return; } me = Tcl_GetCurrentThread(); /* * Acquire a shared lock. Note this is ok even though we potentially * modify the chanInfoPtr->flags because chanInfoPtr is only modified * when it belongs to this thread and no other thread will write to it. * THe shared lock is intended to protect the global gWatchingChannelList * as we traverse it. */ AcquireSRWLockShared(&gConsoleLock); for (chanInfoPtr = gWatchingChannelList; chanInfoPtr != NULL; chanInfoPtr = chanInfoPtr->nextWatchingChannelPtr) { ConsoleHandleInfo *handleInfoPtr; if (chanInfoPtr->threadId != me) { /* Some other thread owns the channel */ continue; } if (chanInfoPtr->flags & CONSOLE_EVENT_QUEUED) { /* A notification event already queued. No point in another. */ continue; } handleInfoPtr = FindConsoleInfo(chanInfoPtr); /* Pointer is safe to access as we are holding gConsoleLock */ if (handleInfoPtr == NULL) { /* Stale event */ continue; } needEvent = 0; AcquireSRWLockShared(&handleInfoPtr->lock); /* Rememeber channel is read or write, never both */ if (chanInfoPtr->watchMask & TCL_READABLE) { if (RingBufferLength(&handleInfoPtr->buffer) > 0 || handleInfoPtr->lastError != ERROR_SUCCESS) { needEvent = 1; /* Input data available or error/EOF */ } /* * TCL_READABLE watch means someone is looking out for data being * available, let reader thread know. Note channel need not be * ASYNC! (Bug [baa51423c2]) */ handleInfoPtr->flags |= CONSOLE_DATA_AWAITED; WakeConditionVariable(&handleInfoPtr->consoleThreadCV); } else if (chanInfoPtr->watchMask & TCL_WRITABLE) { if (RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { needEvent = 1; /* Output space available */ } } ReleaseSRWLockShared(&handleInfoPtr->lock); if (needEvent) { ConsoleEvent *evPtr = (ConsoleEvent *)Tcl_Alloc(sizeof(ConsoleEvent)); /* See note above loop why this can be accessed without locks */ chanInfoPtr->flags |= CONSOLE_EVENT_QUEUED; chanInfoPtr->numRefs += 1; /* So it does not go away while event * is in queue */ evPtr->header.proc = ConsoleEventProc; evPtr->chanInfoPtr = chanInfoPtr; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); } } ReleaseSRWLockShared(&gConsoleLock); } /* *---------------------------------------------------------------------- * * ConsoleBlockModeProc -- * * Set blocking or non-blocking mode on channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int ConsoleBlockModeProc( void *instanceData, /* Instance data for channel. */ int mode) /* TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; /* * Consoles on Windows can not be switched between blocking and * nonblocking, hence we have to emulate the behavior. This is done in the * input function by checking against a bit in the state. We set or unset * the bit here to cause the input function to emulate the correct * behavior. */ if (mode == TCL_MODE_NONBLOCKING) { chanInfoPtr->flags |= CONSOLE_ASYNC; } else { chanInfoPtr->flags &= ~CONSOLE_ASYNC; } return 0; } /* *---------------------------------------------------------------------- * * ConsoleCloseProc -- * * Closes a console based IO channel. * * Results: * 0 on success, errno otherwise. * * Side effects: * Closes the physical channel. * *---------------------------------------------------------------------- */ static int ConsoleCloseProc( void *instanceData, /* Pointer to ConsoleChannelInfo structure. */ TCL_UNUSED(Tcl_Interp *), int flags) { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; ConsoleHandleInfo *handleInfoPtr; int errorCode = 0; ConsoleChannelInfo **nextPtrPtr; int closeHandle; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; } /* * Don't close the Win32 handle if the handle is a standard channel * during the thread exit process. Otherwise, one thread may kill the * stdio of another while exiting. Note an explicit close in script will * still close the handle. That's historical behavior on all platforms. */ if (!TclInThreadExit() || ( (GetStdHandle(STD_INPUT_HANDLE) != chanInfoPtr->handle) && (GetStdHandle(STD_OUTPUT_HANDLE) != chanInfoPtr->handle) && (GetStdHandle(STD_ERROR_HANDLE) != chanInfoPtr->handle))) { closeHandle = 1; } else { closeHandle = 0; } AcquireSRWLockExclusive(&gConsoleLock); /* Remove channel from watchers' list */ for (nextPtrPtr = &gWatchingChannelList; *nextPtrPtr != NULL; nextPtrPtr = &(*nextPtrPtr)->nextWatchingChannelPtr) { if (*nextPtrPtr == (ConsoleChannelInfo *) chanInfoPtr) { *nextPtrPtr = (*nextPtrPtr)->nextWatchingChannelPtr; break; } } handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr) { /* * Console thread may be blocked either waiting for console i/o * or waiting on the condition variable for buffer empty/full */ AcquireSRWLockShared(&handleInfoPtr->lock); if (closeHandle) { handleInfoPtr->console = INVALID_HANDLE_VALUE; } /* Break the thread out of blocking console i/o */ handleInfoPtr->numRefs -= 1; /* Remove reference from this channel */ if (handleInfoPtr->numRefs == 1) { /* * Abort the i/o if no other threads are listening on it. * Note without this check, an input line will be skipped on * the cancel. */ CancelSynchronousIo(handleInfoPtr->consoleThread); } /* * Wake up the console handling thread. Note we do not explicitly * tell it handle is closed (below). It will find out on next access */ WakeConditionVariable(&handleInfoPtr->consoleThreadCV); ReleaseSRWLockShared(&handleInfoPtr->lock); } ReleaseSRWLockExclusive(&gConsoleLock); chanInfoPtr->channel = NULL; chanInfoPtr->watchMask = 0; chanInfoPtr->permissions = 0; if (closeHandle && chanInfoPtr->handle != INVALID_HANDLE_VALUE) { if (CloseHandle(chanInfoPtr->handle) == FALSE) { Tcl_WinConvertError(GetLastError()); errorCode = errno; } chanInfoPtr->handle = INVALID_HANDLE_VALUE; } /* * Note, we can check and manipulate numRefs without a lock because * we have removed it from the watch queue so the console thread cannot * get at it. */ if (chanInfoPtr->numRefs > 1) { /* There may be references already on the event queue */ chanInfoPtr->numRefs -= 1; } else { Tcl_Free(chanInfoPtr); } return errorCode; } /* *---------------------------------------------------------------------- * * ConsoleInputProc -- * * Reads input from the IO channel into the buffer given. Returns count * of how many bytes were actually read, and an error indication. * * Results: * A count of how many bytes were read is returned and an error * indication is returned in an output argument. * * Side effects: * Reads input from the actual channel. * *---------------------------------------------------------------------- */ static int ConsoleInputProc( void *instanceData, /* Console state. */ char *bufPtr, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCode) /* Where to store error code. */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; ConsoleHandleInfo *handleInfoPtr; Tcl_Size numRead; if (chanInfoPtr->handle == INVALID_HANDLE_VALUE) { return 0; /* EOF */ } *errorCode = 0; AcquireSRWLockShared(&gConsoleLock); handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr == NULL) { /* Really shouldn't happen since channel is holding a reference */ ReleaseSRWLockShared(&gConsoleLock); return 0; /* EOF */ } AcquireSRWLockExclusive(&handleInfoPtr->lock); ReleaseSRWLockShared(&gConsoleLock); /* AFTER acquiring handleInfoPtr->lock */ while (1) { numRead = RingBufferOut(&handleInfoPtr->buffer, bufPtr, bufSize, 1); /* * Note: even if channel is closed or has an error, as long there is * buffered data, we will pass it up. */ if (numRead != 0) { break; } /* * No data available. * - If an error was recorded, generate that and reset it. * - If EOF, indicate as much. It is up to the application to close * the channel. * - Otherwise, if non-blocking return EAGAIN or wait for more data. */ if (handleInfoPtr->lastError != 0) { if (handleInfoPtr->lastError == ERROR_INVALID_HANDLE) { numRead = 0; /* Treat as EOF */ } else { Tcl_WinConvertError(handleInfoPtr->lastError); handleInfoPtr->lastError = 0; *errorCode = Tcl_GetErrno(); numRead = -1; } break; } if (handleInfoPtr->console == INVALID_HANDLE_VALUE) { /* EOF - break with numRead == 0 */ chanInfoPtr->handle = INVALID_HANDLE_VALUE; break; } /* For async, tell caller we are blocked */ if (chanInfoPtr->flags & CONSOLE_ASYNC) { *errorCode = EWOULDBLOCK; numRead = -1; break; } /* * Blocking read. Just get data from directly from console. There * is a small complication in that * 1. The destination buffer should be WCHAR aligned. * 2. We can only read even number of bytes (wide-character API). * 3. Caller has large enough buffer (else length of line user can * enter will be limited) * If any condition is not met, we defer to the * reader thread which handles these cases rather than dealing with * them here (which is a little trickier than it might sound.) * * TODO - not clear this block is a useful optimization. bufSize by * default is 4K which is < INPUT_BUFFER_SIZE and will rarely be * increased on stdin. */ if ((1 & (size_t)bufPtr) == 0 /* aligned buffer */ && (1 & bufSize) == 0 /* Even number of bytes */ && bufSize > INPUT_BUFFER_SIZE) { DWORD lastError; Tcl_Size numChars; ReleaseSRWLockExclusive(&handleInfoPtr->lock); lastError = ReadConsoleChars(chanInfoPtr->handle, (WCHAR *)bufPtr, bufSize / sizeof(WCHAR), &numChars); /* NOTE lock released so DON'T break. Return instead */ if (lastError != ERROR_SUCCESS) { Tcl_WinConvertError(lastError); *errorCode = Tcl_GetErrno(); return -1; } else if (numChars > 0) { /* Successfully read something. */ return numChars * sizeof(WCHAR); } else { /* * Ctrl-C/Ctrl-Brk interrupt. Loop around to retry. * We have to reacquire the lock. No worried about handleInfoPtr * having gone away since the channel holds a reference. */ AcquireSRWLockExclusive(&handleInfoPtr->lock); continue; } } /* * Deferring blocking read to reader thread. * Release the lock and sleep. Note that because the channel * holds a reference count on handleInfoPtr, it will not * be deallocated while the lock is released. */ handleInfoPtr->flags |= CONSOLE_DATA_AWAITED; WakeConditionVariable(&handleInfoPtr->consoleThreadCV); if (!SleepConditionVariableSRW(&handleInfoPtr->interpThreadCV, &handleInfoPtr->lock, INFINITE, 0)) { Tcl_WinConvertError(GetLastError()); *errorCode = Tcl_GetErrno(); numRead = -1; break; } /* Lock is reacquired, loop back to try again */ } /* We read data. Ask for more if either async or watching for reads */ if ((chanInfoPtr->flags & CONSOLE_ASYNC) || (chanInfoPtr->watchMask & TCL_READABLE)) { handleInfoPtr->flags |= CONSOLE_DATA_AWAITED; WakeConditionVariable(&handleInfoPtr->consoleThreadCV); } ReleaseSRWLockExclusive(&handleInfoPtr->lock); return numRead; } /* *---------------------------------------------------------------------- * * ConsoleOutputProc -- * * Writes the given output on the IO channel. Returns count of how many * characters were actually written, and an error indication. * * Results: * A count of how many characters were written is returned and an error * indication is returned in an output argument. * * Side effects: * Writes output on the actual channel. * *---------------------------------------------------------------------- */ static int ConsoleOutputProc( void *instanceData, /* Console state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; ConsoleHandleInfo *handleInfoPtr; Tcl_Size numWritten; *errorCode = 0; if (chanInfoPtr->handle == INVALID_HANDLE_VALUE) { /* Some other thread would have *previously* closed the stdio handle */ *errorCode = EPIPE; return -1; } AcquireSRWLockShared(&gConsoleLock); handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr == NULL) { /* Really shouldn't happen since channel is holding a reference */ *errorCode = EPIPE; ReleaseSRWLockShared(&gConsoleLock); return -1; } AcquireSRWLockExclusive(&handleInfoPtr->lock); ReleaseSRWLockShared(&gConsoleLock); /* AFTER acquiring handleInfoPtr->lock */ /* Keep looping until all written. Break out for async and errors */ numWritten = 0; while (1) { /* Check for error and closing on every loop. */ if (handleInfoPtr->lastError != 0) { Tcl_WinConvertError(handleInfoPtr->lastError); *errorCode = Tcl_GetErrno(); numWritten = -1; break; } if (handleInfoPtr->console == INVALID_HANDLE_VALUE) { *errorCode = EPIPE; chanInfoPtr->handle = INVALID_HANDLE_VALUE; numWritten = -1; break; } /* * We can either write directly or through the console thread's * ring buffer. We have to do the latter when * (1) the operation is async since WriteConsoleChars is always blocking * (2) when there is already data in the ring buffer because we don't * want to reorder output from within a thread * (3) when there are an odd number of bytes since WriteConsole * takes whole WCHARs * (4) when the pointer is not aligned on WCHAR * The ring buffer deals with cases (3) and (4). It would be harder * to duplicate that here. */ if ((chanInfoPtr->flags & CONSOLE_ASYNC) /* Case (1) */ || RingBufferLength(&handleInfoPtr->buffer) != 0 /* Case (2) */ || (toWrite & 1) != 0 /* Case (3) */ || (PTR2INT(buf) & 1) != 0) { /* Case (4) */ numWritten += RingBufferIn(&handleInfoPtr->buffer, numWritten + buf, toWrite - numWritten, 1); if (numWritten == toWrite || chanInfoPtr->flags & CONSOLE_ASYNC) { /* All done or async, just accept whatever was written */ break; } /* * Release the lock and sleep. Note that because the channel * holds a reference count on handleInfoPtr, it will not * be deallocated while the lock is released. */ WakeConditionVariable(&handleInfoPtr->consoleThreadCV); if (!SleepConditionVariableSRW(&handleInfoPtr->interpThreadCV, &handleInfoPtr->lock, INFINITE, 0)) { /* Report the error */ Tcl_WinConvertError(GetLastError()); *errorCode = Tcl_GetErrno(); numWritten = -1; break; } } else { /* Direct output */ DWORD winStatus; HANDLE consoleHandle = handleInfoPtr->console; /* Unlock before blocking in WriteConsole */ ReleaseSRWLockExclusive(&handleInfoPtr->lock); /* UNLOCKED so return, DON'T break out of loop as it will unlock * again! */ winStatus = WriteConsoleChars(consoleHandle, (WCHAR *)buf, toWrite / sizeof(WCHAR), &numWritten); if (winStatus == ERROR_SUCCESS) { return numWritten * sizeof(WCHAR); } else { Tcl_WinConvertError(winStatus); *errorCode = Tcl_GetErrno(); return -1; } } /* Lock must have been reacquired before continuing loop */ } WakeConditionVariable(&handleInfoPtr->consoleThreadCV); ReleaseSRWLockExclusive(&handleInfoPtr->lock); return numWritten; } /* *---------------------------------------------------------------------- * * ConsoleEventProc -- * * This function is invoked by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This procedure invokes Tcl_NotifyChannel * on the console. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the notifier callback does. * *---------------------------------------------------------------------- */ static int ConsoleEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { ConsoleEvent *consoleEvPtr = (ConsoleEvent *) evPtr; ConsoleChannelInfo *chanInfoPtr; int freeChannel; int mask = 0; if (!(flags & TCL_FILE_EVENTS)) { return 0; } chanInfoPtr = consoleEvPtr->chanInfoPtr; /* * We know chanInfoPtr is valid because its reference count would have * been incremented when the event was queued. The corresponding release * happens in this function. */ /* * Global lock used for chanInfoPtr. A read (shared) lock suffices * because all access is within the channel owning thread with the * exception of watchers which is a read-only access. See comments * to ConsoleChannelInfo. */ AcquireSRWLockShared(&gConsoleLock); chanInfoPtr->flags &= ~CONSOLE_EVENT_QUEUED; /* * Only handle the event if the Tcl channel has not gone away AND is * still owned by this thread AND is still watching events. */ if (chanInfoPtr->channel && chanInfoPtr->threadId == Tcl_GetCurrentThread() && (chanInfoPtr->watchMask & (TCL_READABLE|TCL_WRITABLE))) { ConsoleHandleInfo *handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr == NULL) { /* Console was closed. EOF->read event only (not write) */ if (chanInfoPtr->watchMask & TCL_READABLE) { mask = TCL_READABLE; } } else { AcquireSRWLockShared(&handleInfoPtr->lock); /* Remember at most one of READABLE, WRITABLE set */ if ((chanInfoPtr->watchMask & TCL_READABLE) && RingBufferLength(&handleInfoPtr->buffer)) { mask = TCL_READABLE; } else if ((chanInfoPtr->watchMask & TCL_WRITABLE) && RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { /* Generate write event space available */ mask = TCL_WRITABLE; } ReleaseSRWLockShared(&handleInfoPtr->lock); } } /* * Tcl_NotifyChannel can recurse through the file event callback so need * to release locks first. Our reference still holds so no danger of * chanInfoPtr being deallocated if the callback closes the channel. */ ReleaseSRWLockShared(&gConsoleLock); if (mask) { Tcl_NotifyChannel(chanInfoPtr->channel, mask); /* Note: chanInfoPtr ref count may have changed */ } /* No need to lock - see comments earlier */ /* Remove the reference to the channel from event record */ if (chanInfoPtr->numRefs > 1) { chanInfoPtr->numRefs -= 1; freeChannel = 0; } else { assert(chanInfoPtr->channel == NULL); freeChannel = 1; } if (freeChannel) { Tcl_Free(chanInfoPtr); } return 1; } /* *---------------------------------------------------------------------- * * ConsoleWatchProc -- * * Called by the notifier to set up to watch for events on this channel. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void ConsoleWatchProc( void *instanceData, /* Console state. */ int newMask) /* What events to watch for, one of * TCL_READABLE, TCL_WRITABLE */ { ConsoleChannelInfo **nextPtrPtr, *ptr; ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; int oldMask = chanInfoPtr->watchMask; /* * Since most of the work is handled by the background threads, we just * need to update the watchMask and then force the notifier to poll once. */ chanInfoPtr->watchMask = newMask & chanInfoPtr->permissions; if (chanInfoPtr->watchMask) { Tcl_Time blockTime = { 0, 0 }; if (!oldMask) { AcquireSRWLockExclusive(&gConsoleLock); /* Add to list of watched channels */ chanInfoPtr->nextWatchingChannelPtr = gWatchingChannelList; gWatchingChannelList = chanInfoPtr; /* * For read channels, need to tell the console reader thread * that we are looking for data since it will not do reads until * it knows someone is awaiting. */ ConsoleHandleInfo *handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr) { AcquireSRWLockExclusive(&handleInfoPtr->lock); handleInfoPtr->flags |= CONSOLE_DATA_AWAITED; WakeConditionVariable(&handleInfoPtr->consoleThreadCV); ReleaseSRWLockExclusive(&handleInfoPtr->lock); } ReleaseSRWLockExclusive(&gConsoleLock); } Tcl_SetMaxBlockTime(&blockTime); } else if (oldMask) { /* Remove from list of watched channels */ AcquireSRWLockExclusive(&gConsoleLock); for (nextPtrPtr = &gWatchingChannelList, ptr = *nextPtrPtr; ptr != NULL; nextPtrPtr = &ptr->nextWatchingChannelPtr, ptr = *nextPtrPtr) { if (chanInfoPtr == ptr) { *nextPtrPtr = ptr->nextWatchingChannelPtr; break; } } ReleaseSRWLockExclusive(&gConsoleLock); } } /* *---------------------------------------------------------------------- * * ConsoleGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * command consoleline based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int ConsoleGetHandleProc( void *instanceData, /* The console state. */ TCL_UNUSED(int) /*direction*/, void **handlePtr) /* Where to store the handle. */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; if (chanInfoPtr->handle == INVALID_HANDLE_VALUE) { return TCL_ERROR; } *handlePtr = chanInfoPtr->handle; return TCL_OK; } /* *------------------------------------------------------------------------ * * ConsoleDataAvailable -- * * Checks if there is data in the console input queue. * * Results: * Returns 1 if the input queue has data, -1 on error else 0 if empty. * * Side effects: * None. * *------------------------------------------------------------------------ */ static int ConsoleDataAvailable( HANDLE consoleHandle) { INPUT_RECORD input[10]; DWORD count; DWORD i; /* * Need at least one keyboard event. */ if (PeekConsoleInputW(consoleHandle, input, sizeof(input) / sizeof(input[0]), &count) == FALSE) { return -1; } /* * Even if windows size and mouse events are disabled, can still have * events other than keyboard, like focus events. Look for at least one * keydown event because a trailing LF keyup is always present from the * last input. However, if our buffer is full, assume there is a key * down somewhere in the unread buffer. I suppose we could expand the * buffer but not worth... */ if (count == (sizeof(input)/sizeof(input[0]))) { return 1; } for (i = 0; i < count; ++i) { if (input[i].EventType == KEY_EVENT && input[i].Event.KeyEvent.bKeyDown) { return 1; } } return 0; } /* *---------------------------------------------------------------------- * * ConsoleReaderThread -- * * This function runs in a separate thread and waits for input to become * available on a console. * * Results: * Always 0. * * Side effects: * Signals the main thread when input become available. * *---------------------------------------------------------------------- */ static DWORD WINAPI ConsoleReaderThread( LPVOID arg) { ConsoleHandleInfo *handleInfoPtr = (ConsoleHandleInfo *) arg; ConsoleHandleInfo **iterator; Tcl_Size inputLen = 0; Tcl_Size inputOffset = 0; Tcl_Size lastReadSize = 0; DWORD sleepTime; char inputChars[INPUT_BUFFER_SIZE]; /* * Keep looping until one of the following happens. * - there are no more channels listening on the console * - the console handle has been closed */ /* This thread is holding a reference so pointer is safe */ AcquireSRWLockExclusive(&handleInfoPtr->lock); while (1) { if (handleInfoPtr->numRefs == 1) { /* * Sole reference. That's this thread. Exit since no clients * and no way for a thread to attach to a console after process * start. */ break; } /* * Shared buffer has no data. If we have some in our private buffer * copy that. Else check if there has been an error. In both cases * notify the interp threads. */ if (inputLen > 0 || handleInfoPtr->lastError != 0) { HANDLE consoleHandle; if (inputLen > 0) { /* Private buffer has data. Copy it over. */ Tcl_Size nStored; assert((inputLen - inputOffset) > 0); nStored = RingBufferIn(&handleInfoPtr->buffer, inputOffset + inputChars, inputLen - inputOffset, 1); inputOffset += nStored; if (inputOffset == inputLen) { /* Temp buffer now empty */ inputOffset = 0; inputLen = 0; } } else { /* * On error, nothing but inform caller and wait * We do not want to exit until there are no client interps. */ } /* * Wake up any threads waiting either synchronously or * asynchronously. Since we are providing data, turn off the * AWAITED flag. If the data provided is not sufficient the * clients will request again. Note we have to wake up ALL * awaiting threads, not just one, so they can all reissue * requests if needed. (In a properly designed app, at most one * thread should be reading standard input but...) */ handleInfoPtr->flags &= ~CONSOLE_DATA_AWAITED; /* Wake synchronous channels */ WakeAllConditionVariable(&handleInfoPtr->interpThreadCV); /* * Wake up async channels registered for file events. Note in * order to follow the locking hierarchy, we need to release * handleInfoPtr->lock before calling NudgeWatchers. */ consoleHandle = handleInfoPtr->console; ReleaseSRWLockExclusive(&handleInfoPtr->lock); NudgeWatchers(consoleHandle); AcquireSRWLockExclusive(&handleInfoPtr->lock); /* * Loop back to recheck for exit conditions changes while the * lock was not held. */ continue; } assert(inputLen == 0); /* * Read more data in two cases: * 1. The previous read filled the buffer and there could be more * data in the console internal *text* buffer. Note * ConsolePendingInput (checked in ConsoleDataAvailable) will NOT * show this. It holds input events not yet translated to text. * 2. Tcl threads want more data AND there is data in the * ConsolePendingInput buffer. The latter check necessary because * we do not want to read ahead because the interp thread might * change the read mode, e.g. turning off echo for password * input. So only do so if at least one interpreter has requested * data. */ if (lastReadSize == sizeof(inputChars) || ((handleInfoPtr->flags & CONSOLE_DATA_AWAITED) && ConsoleDataAvailable(handleInfoPtr->console))) { DWORD error; /* Do not hold the lock while blocked in console */ ReleaseSRWLockExclusive(&handleInfoPtr->lock); error = ReadConsoleChars(handleInfoPtr->console, (WCHAR *)inputChars, sizeof(inputChars) / sizeof(WCHAR), &inputLen); AcquireSRWLockExclusive(&handleInfoPtr->lock); if (error == 0) { inputLen *= sizeof(WCHAR); lastReadSize = inputLen; } else { /* * We only store the last error. It is up to channel * handlers whether to close or not in case of errors. */ lastReadSize = 0; handleInfoPtr->lastError = error; if (handleInfoPtr->lastError == ERROR_INVALID_HANDLE) { handleInfoPtr->console = INVALID_HANDLE_VALUE; } } } else { /* * Either no one was asking for data, or no data was available. * In the former case, wait until someone wakes us asking for * data. In the latter case, there is no alternative but to * poll since ReadConsole does not support async operation. * So sleep for a short while and loop back to retry. */ sleepTime = handleInfoPtr->flags & CONSOLE_DATA_AWAITED ? 50 : INFINITE; SleepConditionVariableSRW(&handleInfoPtr->consoleThreadCV, &handleInfoPtr->lock, sleepTime, 0); } /* Loop again to check for exit or wait for readers to wake us */ } /* * Exiting: * - remove the console from global list * - close the handle if still valid * - release the structure * Note there is not need to check for any watchers because we only * exit when there are no channels open to this console. */ ReleaseSRWLockExclusive(&handleInfoPtr->lock); AcquireSRWLockExclusive(&gConsoleLock); /* Modifying - exclusive lock */ for (iterator = &gConsoleHandleInfoList; *iterator; iterator = &(*iterator)->nextPtr) { if (*iterator == handleInfoPtr) { *iterator = handleInfoPtr->nextPtr; break; } } ReleaseSRWLockExclusive(&gConsoleLock); /* No need for relocking - no other thread should have access to it now */ RingBufferClear(&handleInfoPtr->buffer); if (handleInfoPtr->console != INVALID_HANDLE_VALUE && handleInfoPtr->lastError != ERROR_INVALID_HANDLE) { SetConsoleMode(handleInfoPtr->console, handleInfoPtr->initMode); /* * NOTE: we do not call CloseHandle(handleInfoPtr->console) here. * As per the GetStdHandle documentation, it need not be closed. * Other components may be directly using it. Note however that * an explicit chan close script command does close the handle * for all threads. */ } Tcl_Free(handleInfoPtr); return 0; } /* *---------------------------------------------------------------------- * * ConsoleWriterThread -- * * This function runs in a separate thread and writes data onto a * console. * * Results: * Always returns 0. * * Side effects: * Signals the main thread when an output operation is completed. * *---------------------------------------------------------------------- */ static DWORD WINAPI ConsoleWriterThread( LPVOID arg) { ConsoleHandleInfo *handleInfoPtr = (ConsoleHandleInfo *) arg; ConsoleHandleInfo **iterator; BOOL success; Tcl_Size numBytes; /* * This buffer size has no relation really with the size of the shared * buffer. Could be bigger or smaller. Make larger as multiple threads * could potentially be writing to it. */ char buffer[2*CONSOLE_BUFFER_SIZE]; /* * Keep looping until one of the following happens. * * - there are not more channels listening on the console * - the console handle has been closed * * On each iteration, * - if the channel buffer is empty, wait for some channel writer to write * - if there is data in our buffer, write it to the console */ /* This thread is holding a reference so pointer is safe */ AcquireSRWLockExclusive(&handleInfoPtr->lock); while (1) { /* handleInfoPtr->lock must be held on entry to loop */ int offset; HANDLE consoleHandle; /* * Sadly, we need to do another copy because do not want to hold * a lock on handleInfoPtr->buffer while calling WriteConsole as that * might block. Also, we only want to copy an integral number of * WCHAR's, i.e. even number of chars so do some length checks up * front. */ numBytes = RingBufferLength(&handleInfoPtr->buffer); numBytes &= ~1; /* Copy integral number of WCHARs -> even number of bytes */ if (numBytes == 0) { /* No data to write */ if (handleInfoPtr->numRefs == 1) { /* * Sole reference. That's this thread. Exit since no clients * and no buffered output. */ break; } /* Wake up any threads waiting synchronously. */ WakeConditionVariable(&handleInfoPtr->interpThreadCV); success = SleepConditionVariableSRW(&handleInfoPtr->consoleThreadCV, &handleInfoPtr->lock, INFINITE, 0); /* Note: lock has been acquired again! */ if (!success && GetLastError() != ERROR_TIMEOUT) { /* TODO - what can be done? Should not happen */ /* For now keep going */ } continue; } /* We have data to write */ if ((size_t)numBytes > (sizeof(buffer) / sizeof(buffer[0]))) { numBytes = sizeof(buffer); } /* No need to check result, we already checked length bytes available */ RingBufferOut(&handleInfoPtr->buffer, buffer, numBytes, 0); consoleHandle = handleInfoPtr->console; WakeConditionVariable(&handleInfoPtr->interpThreadCV); ReleaseSRWLockExclusive(&handleInfoPtr->lock); offset = 0; while (numBytes > 0) { Tcl_Size numWChars = numBytes / sizeof(WCHAR); DWORD status; status = WriteConsoleChars(handleInfoPtr->console, (WCHAR *)(offset + buffer), numWChars, &numWChars); if (status != 0) { /* Only overwrite if no previous error */ if (handleInfoPtr->lastError == 0) { handleInfoPtr->lastError = status; } if (status == ERROR_INVALID_HANDLE) { handleInfoPtr->console = INVALID_HANDLE_VALUE; } /* Assume this write is done but keep looping in case * it is a transient error. Not sure just closing handle * and exiting thread is a good idea until all references * from interp threads are gone. */ break; } numBytes -= numWChars * sizeof(WCHAR); offset += numWChars * sizeof(WCHAR); } /* Wake up any threads waiting synchronously. */ WakeConditionVariable(&handleInfoPtr->interpThreadCV); /* * Wake up all channels registered for file events. Note in * order to follow the locking hierarchy, we cannot hold any locks * when calling NudgeWatchers. */ NudgeWatchers(consoleHandle); AcquireSRWLockExclusive(&handleInfoPtr->lock); } /* * Exiting: * - remove the console from global list * - release the structure * NOTE: we do not call CloseHandle(handleInfoPtr->console) here. * As per the GetStdHandle documentation, it need not be closed. * Other components may be directly using it. Note however that * an explicit chan close script command does close the handle * for all threads. */ ReleaseSRWLockExclusive(&handleInfoPtr->lock); AcquireSRWLockExclusive(&gConsoleLock); /* Modifying - exclusive lock */ for (iterator = &gConsoleHandleInfoList; *iterator; iterator = &(*iterator)->nextPtr) { if (*iterator == handleInfoPtr) { *iterator = handleInfoPtr->nextPtr; break; } } ReleaseSRWLockExclusive(&gConsoleLock); RingBufferClear(&handleInfoPtr->buffer); Tcl_Free(handleInfoPtr); return 0; } /* *------------------------------------------------------------------------ * * AllocateConsoleHandleInfo -- * * Allocates a ConsoleHandleInfo for the passed console handle. As * a side effect starts a console thread to handle i/o on the handle. * * Important: Caller must be holding an EXCLUSIVE lock on gConsoleLock * when calling this function. The lock continues to be held on return. * * Results: * Pointer to an unlocked ConsoleHandleInfo structure. The reference * count on the structure is 1. This corresponds to the common reference * from the console thread and the gConsoleHandleInfoList. Returns NULL * on error. * * Side effects: * A console reader or writer thread is started. The returned structure * is placed on the active console handler list gConsoleHandleInfoList. * *------------------------------------------------------------------------ */ static ConsoleHandleInfo * AllocateConsoleHandleInfo( HANDLE consoleHandle, int permissions) /* TCL_READABLE or TCL_WRITABLE */ { ConsoleHandleInfo *handleInfoPtr; DWORD consoleMode; handleInfoPtr = (ConsoleHandleInfo *)Tcl_Alloc(sizeof(*handleInfoPtr)); memset(handleInfoPtr, 0, sizeof(*handleInfoPtr)); handleInfoPtr->console = consoleHandle; InitializeSRWLock(&handleInfoPtr->lock); InitializeConditionVariable(&handleInfoPtr->consoleThreadCV); InitializeConditionVariable(&handleInfoPtr->interpThreadCV); RingBufferInit(&handleInfoPtr->buffer, CONSOLE_BUFFER_SIZE); handleInfoPtr->lastError = 0; handleInfoPtr->permissions = permissions; handleInfoPtr->numRefs = 1; /* See function header */ if (permissions == TCL_READABLE) { GetConsoleMode(consoleHandle, &handleInfoPtr->initMode); consoleMode = handleInfoPtr->initMode; consoleMode &= ~(ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT); consoleMode |= ENABLE_LINE_INPUT; SetConsoleMode(consoleHandle, consoleMode); } handleInfoPtr->consoleThread = CreateThread( NULL, /* default security descriptor */ 2*CONSOLE_BUFFER_SIZE, /* Stack size - gets rounded up to granularity */ permissions == TCL_READABLE ? ConsoleReaderThread : ConsoleWriterThread, handleInfoPtr, /* Pass to thread */ 0, /* Flags - no special cases */ NULL); /* Don't care about thread id */ if (handleInfoPtr->consoleThread == NULL) { /* Note - SRWLock and condition variables do not need finalization */ RingBufferClear(&handleInfoPtr->buffer); Tcl_Free(handleInfoPtr); return NULL; } /* Chain onto global list */ handleInfoPtr->nextPtr = gConsoleHandleInfoList; gConsoleHandleInfoList = handleInfoPtr; return handleInfoPtr; } /* *------------------------------------------------------------------------ * * FindConsoleInfo -- * * Finds the ConsoleHandleInfo record for a given ConsoleChannelInfo. * The found record must match the console handle. It is the caller's * responsibility to check the permissions (read/write) in the returned * ConsoleHandleInfo match permissions in chanInfoPtr. This function does * not check that. * * Important: Caller must be holding an shared or exclusive lock on * gConsoleMutex. That ensures the returned pointer stays valid on * return without risk of deallocation by other threads. * * Results: * Pointer to the found ConsoleHandleInfo or NULL if not found * * Side effects: * None. * *------------------------------------------------------------------------ */ static ConsoleHandleInfo * FindConsoleInfo( const ConsoleChannelInfo *chanInfoPtr) { ConsoleHandleInfo *handleInfoPtr; for (handleInfoPtr = gConsoleHandleInfoList; handleInfoPtr; handleInfoPtr = handleInfoPtr->nextPtr) { if (handleInfoPtr->console == chanInfoPtr->handle) { return handleInfoPtr; } } return NULL; } /* *---------------------------------------------------------------------- * * TclWinOpenConsoleChannel -- * * Constructs a Console channel for the specified standard OS handle. * This is a helper function to break up the construction of channels * into File, Console, or Serial. * * Results: * Returns the new channel, or NULL. * * Side effects: * May open the channel. * *---------------------------------------------------------------------- */ Tcl_Channel TclWinOpenConsoleChannel( HANDLE handle, char *channelName, int permissions) { ConsoleChannelInfo *chanInfoPtr; ConsoleHandleInfo *handleInfoPtr; /* A console handle can either be input or output, not both */ if (permissions != TCL_READABLE && permissions != TCL_WRITABLE) { return NULL; } ConsoleInit(); chanInfoPtr = (ConsoleChannelInfo *)Tcl_Alloc(sizeof(*chanInfoPtr)); memset(chanInfoPtr, 0, sizeof(*chanInfoPtr)); chanInfoPtr->permissions = permissions; chanInfoPtr->handle = handle; chanInfoPtr->channel = (Tcl_Channel) NULL; chanInfoPtr->threadId = Tcl_GetCurrentThread(); /* * Use the pointer for the name of the result channel. This keeps the * channel names unique, since some may share handles (stdin/stdout/stderr * for instance). */ TclWinGenerateChannelName(channelName, "file", chanInfoPtr); if (permissions & TCL_READABLE) { /* * Make sure the console input buffer is ready for only character * input notifications and the buffer is set for line buffering. IOW, * we only want to catch when complete lines are ready for reading. */ chanInfoPtr->flags |= CONSOLE_READ_OPS; GetConsoleMode(handle, &chanInfoPtr->initMode); #ifdef OBSOLETE /* Why was priority being set on console input? Code smell */ SetThreadPriority(infoPtr->reader.thread, THREAD_PRIORITY_HIGHEST); #endif } else { /* Already checked permissions is WRITABLE if not READABLE */ /* TODO - enable ansi escape processing? */ } /* * Global lock but that's ok. See comments top of file. Allocations * will happen only a few times in the life of a process and that too * generally at start up where only one thread is active. */ AcquireSRWLockExclusive(&gConsoleLock); /*Allocate needs exclusive lock */ handleInfoPtr = FindConsoleInfo(chanInfoPtr); if (handleInfoPtr == NULL) { /* Not found. Allocate one */ handleInfoPtr = AllocateConsoleHandleInfo(handle, permissions); } else { /* Found. Its direction (read/write) better be the same */ if (handleInfoPtr->permissions != permissions) { handleInfoPtr = NULL; } } if (handleInfoPtr == NULL) { ReleaseSRWLockExclusive(&gConsoleLock); if (permissions == TCL_READABLE) { SetConsoleMode(handle, chanInfoPtr->initMode); } Tcl_Free(chanInfoPtr); return NULL; } /* * There is effectively a reference to this structure from the Tcl * channel subsystem. So record that. This reference will be dropped * when the Tcl channel is closed. */ chanInfoPtr->numRefs = 1; /* * Need to keep track of number of referencing channels for closing. * The pointer is safe since there is a reference held to it from * gConsoleHandleInfoList but still need to lock the structure itself */ AcquireSRWLockExclusive(&handleInfoPtr->lock); handleInfoPtr->numRefs += 1; ReleaseSRWLockExclusive(&handleInfoPtr->lock); ReleaseSRWLockExclusive(&gConsoleLock); /* Note Tcl_CreateChannel never fails other than panic on error */ chanInfoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName, chanInfoPtr, permissions); /* * Consoles have default translation of auto and ^Z eof char, which means * that a ^Z will be accepted as EOF when reading. */ Tcl_SetChannelOption(NULL, chanInfoPtr->channel, "-translation", "auto"); Tcl_SetChannelOption(NULL, chanInfoPtr->channel, "-encoding", "utf-16"); return chanInfoPtr->channel; } /* *---------------------------------------------------------------------- * * ConsoleThreadActionProc -- * * Insert or remove any thread local refs to this channel. * * Results: * None. * * Side effects: * Changes thread local list of valid channels. * *---------------------------------------------------------------------- */ static void ConsoleThreadActionProc( void *instanceData, int action) { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; /* No need for any locks as no other thread will be writing to it */ if (action == TCL_CHANNEL_THREAD_INSERT) { ConsoleInit(); /* Needed to set up event source handlers for this thread */ chanInfoPtr->threadId = Tcl_GetCurrentThread(); } else { chanInfoPtr->threadId = NULL; } } /* *---------------------------------------------------------------------- * * ConsoleSetOptionProc -- * * Sets an option on a channel. * * Results: * A standard Tcl result. Also sets the interp's result on error if * interp is not NULL. * * Side effects: * May modify an option on a console. Sets Error message if needed (by * calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static int ConsoleSetOptionProc( void *instanceData, /* File state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Which option to set? */ const char *value) /* New value for option. */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; int len = strlen(optionName); int vlen = strlen(value); /* * Option -inputmode normal|password|raw */ if ((chanInfoPtr->flags & CONSOLE_READ_OPS) && (len > 1) && (strncmp(optionName, "-inputmode", len) == 0)) { DWORD mode; if (GetConsoleMode(chanInfoPtr->handle, &mode) == 0) { Tcl_WinConvertError(GetLastError()); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read console mode: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } if (strncasecmp(value, "NORMAL", vlen) == 0) { mode |= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; } else if (strncasecmp(value, "PASSWORD", vlen) == 0) { mode |= ENABLE_LINE_INPUT|ENABLE_PROCESSED_INPUT; mode &= ~ENABLE_ECHO_INPUT; } else if (strncasecmp(value, "RAW", vlen) == 0) { mode &= ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT); } else if (strncasecmp(value, "RESET", vlen) == 0) { /* * Reset to the initial mode, whatever that is. */ mode = chanInfoPtr->initMode; } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad mode \"%s\" for -inputmode: must be" " normal, password, raw, or reset", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } return TCL_ERROR; } if (SetConsoleMode(chanInfoPtr->handle, mode) == 0) { Tcl_WinConvertError(GetLastError()); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't set console mode: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } if (chanInfoPtr->flags & CONSOLE_READ_OPS) { return Tcl_BadChannelOption(interp, optionName, "inputmode"); } else { return Tcl_BadChannelOption(interp, optionName, ""); } } /* *---------------------------------------------------------------------- * * ConsoleGetOptionProc -- * * Gets a mode associated with an IO channel. If the optionName arg is * non-NULL, retrieves the value of that option. If the optionName arg is * NULL, retrieves a list of alternating option names and values for the * given channel. * * Results: * A standard Tcl result. Also sets the supplied DString to the string * value of the option(s) returned. Sets error message if needed * (by calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static int ConsoleGetOptionProc( void *instanceData, /* File state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Option to get. */ Tcl_DString *dsPtr) /* Where to store value(s). */ { ConsoleChannelInfo *chanInfoPtr = (ConsoleChannelInfo *)instanceData; int valid = 0; /* Flag if valid option parsed. */ unsigned int len; char buf[TCL_INTEGER_SPACE]; if (optionName == NULL) { len = 0; } else { len = strlen(optionName); } /* * Get option -inputmode * * This is a great simplification of the underlying reality, but actually * represents what almost all scripts really want to know. */ if (chanInfoPtr->flags & CONSOLE_READ_OPS) { if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-inputmode"); } if (len==0 || (len>1 && strncmp(optionName, "-inputmode", len)==0)) { DWORD mode; valid = 1; if (GetConsoleMode(chanInfoPtr->handle, &mode) == 0) { Tcl_WinConvertError(GetLastError()); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read console mode: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } if (mode & ENABLE_LINE_INPUT) { if (mode & ENABLE_ECHO_INPUT) { Tcl_DStringAppendElement(dsPtr, "normal"); } else { Tcl_DStringAppendElement(dsPtr, "password"); } } else { Tcl_DStringAppendElement(dsPtr, "raw"); } } } else { /* * Output channel. Get option -winsize * Option is readonly and returned by [fconfigure chan -winsize] but not * returned by [fconfigure chan] without explicit option name. */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-winsize"); } if (len == 0 || (len > 1 && strncmp(optionName, "-winsize", len) == 0)) { CONSOLE_SCREEN_BUFFER_INFO consoleInfo; valid = 1; if (!GetConsoleScreenBufferInfo(chanInfoPtr->handle, &consoleInfo)) { Tcl_WinConvertError(GetLastError()); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read console size: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } Tcl_DStringStartSublist(dsPtr); snprintf(buf, sizeof(buf), "%d", consoleInfo.srWindow.Right - consoleInfo.srWindow.Left + 1); Tcl_DStringAppendElement(dsPtr, buf); snprintf(buf, sizeof(buf), "%d", consoleInfo.srWindow.Bottom - consoleInfo.srWindow.Top + 1); Tcl_DStringAppendElement(dsPtr, buf); Tcl_DStringEndSublist(dsPtr); } } if (valid) { return TCL_OK; } if (chanInfoPtr->flags & CONSOLE_READ_OPS) { return Tcl_BadChannelOption(interp, optionName, "inputmode"); } else { return Tcl_BadChannelOption(interp, optionName, "winsize"); } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWinChan.c0000644000175000017500000013251615104661342014553 0ustar sergeisergei/* * tclWinChan.c * * Channel drivers for Windows channels based on files, command pipes and * TCP sockets. * * Copyright © 1995-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. */ #include "tclWinInt.h" #include "tclFileSystem.h" #include "tclIO.h" /* * State flags used in the info structures below. */ #define FILE_PENDING (1<<0) /* Message is pending in the queue. */ #define FILE_ASYNC (1<<1) /* Channel is non-blocking. */ #define FILE_APPEND (1<<2) /* File is in append mode. */ #define FILE_TYPE_SERIAL (FILE_TYPE_PIPE+1) #define FILE_TYPE_CONSOLE (FILE_TYPE_PIPE+2) /* * The following structure contains per-instance data for a file based * channel. */ typedef struct FileInfo { Tcl_Channel channel; /* Pointer to channel structure. */ int validMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which operations are valid on the file. */ int watchMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which events should be reported. */ int flags; /* State flags, see above for a list. */ HANDLE handle; /* Input/output file. */ struct FileInfo *nextPtr; /* Pointer to next registered file. */ int dirty; /* Boolean flag. Set if the OS may have data * pending on the channel. */ } FileInfo; typedef struct { /* * List of all file channels currently open. */ FileInfo *firstFilePtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following structure is what is added to the Tcl event queue when file * events are generated. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ FileInfo *infoPtr; /* Pointer to file info structure. Note that * we still have to verify that the file * exists before dereferencing this * pointer. */ } FileEvent; /* * Static routines for this file: */ static int FileBlockProc(void *instanceData, int mode); static void FileChannelExitHandler(void *clientData); static void FileCheckProc(void *clientData, int flags); static int FileCloseProc(void *instanceData, Tcl_Interp *interp, int flags); static int FileEventProc(Tcl_Event *evPtr, int flags); static int FileGetHandleProc(void *instanceData, int direction, void **handlePtr); static int FileGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static ThreadSpecificData *FileInit(void); static int FileInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int FileOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static long long FileWideSeekProc(void *instanceData, long long offset, int mode, int *errorCode); static void FileSetupProc(void *clientData, int flags); static void FileWatchProc(void *instanceData, int mask); static void FileThreadActionProc(void *instanceData, int action); static int FileTruncateProc(void *instanceData, long long length); static DWORD FileGetType(HANDLE handle); static int NativeIsComPort(const WCHAR *nativeName); static Tcl_Channel OpenFileChannel(HANDLE handle, char *channelName, int permissions, int appendMode); /* * This structure describes the channel type structure for file based IO. */ static const Tcl_ChannelType fileChannelType = { "file", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ FileInputProc, FileOutputProc, NULL, /* Deprecated. */ NULL, /* Set option proc. */ FileGetOptionProc, FileWatchProc, FileGetHandleProc, FileCloseProc, FileBlockProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ FileWideSeekProc, FileThreadActionProc, FileTruncateProc }; /* * General useful clarification macros. */ #define SET_FLAG(var, flag) ((var) |= (flag)) #define CLEAR_FLAG(var, flag) ((var) &= ~(flag)) #define TEST_FLAG(value, flag) (((value) & (flag)) != 0) /* * The number of 100-ns intervals between the Windows system epoch (1601-01-01 * on the proleptic Gregorian calendar) and the Posix epoch (1970-01-01). */ #define POSIX_EPOCH_AS_FILETIME \ ((long long) 116444736 * (long long) 1000000000) /* *---------------------------------------------------------------------- * * TclWinGenerateChannelName -- * * This function generates names for channels. * * Results: * None. * * Side effects: * Creates a new window and creates an exit handler. * *---------------------------------------------------------------------- */ void TclWinGenerateChannelName( char channelName[], /* Buffer to accept the name. */ const char *channelTypeName,/* Name of type of channel. */ void *channelImpl) /* Pointer to channel implementation * structure, used to generate a unique * ID. */ { snprintf(channelName, 16 + TCL_INTEGER_SPACE, "%s%" TCL_Z_MODIFIER "x", channelTypeName, (size_t) channelImpl); } /* *---------------------------------------------------------------------- * * FileInit -- * * This function creates the window used to simulate file events. * * Results: * None. * * Side effects: * Creates a new window and creates an exit handler. * *---------------------------------------------------------------------- */ static ThreadSpecificData * FileInit(void) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey); if (tsdPtr == NULL) { tsdPtr = TCL_TSD_INIT(&dataKey); tsdPtr->firstFilePtr = NULL; Tcl_CreateEventSource(FileSetupProc, FileCheckProc, NULL); Tcl_CreateThreadExitHandler(FileChannelExitHandler, NULL); } return tsdPtr; } /* *---------------------------------------------------------------------- * * FileChannelExitHandler -- * * This function is called to cleanup the channel driver before Tcl is * unloaded. * * Results: * None. * * Side effects: * Destroys the communication window. * *---------------------------------------------------------------------- */ static void FileChannelExitHandler( TCL_UNUSED(void *)) { Tcl_DeleteEventSource(FileSetupProc, FileCheckProc, NULL); } /* *---------------------------------------------------------------------- * * FileSetupProc -- * * This function is invoked before Tcl_DoOneEvent blocks waiting for an * event. * * Results: * None. * * Side effects: * Adjusts the block time if needed. * *---------------------------------------------------------------------- */ void FileSetupProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { FileInfo *infoPtr; Tcl_Time blockTime = { 0, 0 }; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) { return; } /* * Check to see if there is a ready file. If so, poll. */ for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->watchMask) { Tcl_SetMaxBlockTime(&blockTime); break; } } } /* *---------------------------------------------------------------------- * * FileCheckProc -- * * This function is called by Tcl_DoOneEvent to check the file event * source for events. * * Results: * None. * * Side effects: * May queue an event. * *---------------------------------------------------------------------- */ static void FileCheckProc( TCL_UNUSED(void *), int flags) /* Event flags as passed to Tcl_DoOneEvent. */ { FileEvent *evPtr; FileInfo *infoPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) { return; } /* * Queue events for any ready files that don't already have events queued * (caused by persistent states that won't generate WinSock events). */ for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->watchMask && !TEST_FLAG(infoPtr->flags, FILE_PENDING)) { SET_FLAG(infoPtr->flags, FILE_PENDING); evPtr = (FileEvent *)Tcl_Alloc(sizeof(FileEvent)); evPtr->header.proc = FileEventProc; evPtr->infoPtr = infoPtr; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); } } } /* *---------------------------------------------------------------------- * * FileEventProc -- * * This function is invoked by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This function invokes Tcl_NotifyChannel * on the file. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the notifier callback does. * *---------------------------------------------------------------------- */ static int FileEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { FileEvent *fileEvPtr = (FileEvent *)evPtr; FileInfo *infoPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!TEST_FLAG(flags, TCL_FILE_EVENTS)) { return 0; } /* * Search through the list of watched files for the one whose handle * matches the event. We do this rather than simply dereferencing the * handle in the event so that files can be deleted while the event is in * the queue. */ for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (fileEvPtr->infoPtr == infoPtr) { CLEAR_FLAG(infoPtr->flags, FILE_PENDING); Tcl_NotifyChannel(infoPtr->channel, infoPtr->watchMask); break; } } return 1; } /* *---------------------------------------------------------------------- * * FileBlockProc -- * * Set blocking or non-blocking mode on channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int FileBlockProc( void *instanceData, /* Instance data for channel. */ int mode) /* TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { FileInfo *infoPtr = (FileInfo *)instanceData; /* * Files on Windows can not be switched between blocking and nonblocking, * hence we have to emulate the behavior. This is done in the input * function by checking against a bit in the state. We set or unset the * bit here to cause the input function to emulate the correct behavior. */ if (mode == TCL_MODE_NONBLOCKING) { SET_FLAG(infoPtr->flags, FILE_ASYNC); } else { CLEAR_FLAG(infoPtr->flags, FILE_ASYNC); } return 0; } /* *---------------------------------------------------------------------- * * FileCloseProc -- * * Closes the IO channel. * * Results: * 0 if successful, the value of errno if failed. * * Side effects: * Closes the physical channel * *---------------------------------------------------------------------- */ static int FileCloseProc( void *instanceData, /* Pointer to FileInfo structure. */ TCL_UNUSED(Tcl_Interp *), int flags) { FileInfo *fileInfoPtr = (FileInfo *)instanceData; FileInfo *infoPtr; ThreadSpecificData *tsdPtr; int errorCode = 0; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; } /* * Remove the file from the watch list. */ FileWatchProc(instanceData, 0); /* * Don't close the Win32 handle if the handle is a standard channel during * the thread exit process. Otherwise, one thread may kill the stdio of * another. */ if (!TclInThreadExit() || ((GetStdHandle(STD_INPUT_HANDLE) != fileInfoPtr->handle) && (GetStdHandle(STD_OUTPUT_HANDLE) != fileInfoPtr->handle) && (GetStdHandle(STD_ERROR_HANDLE) != fileInfoPtr->handle))) { if (CloseHandle(fileInfoPtr->handle) == FALSE) { Tcl_WinConvertError(GetLastError()); errorCode = errno; } } /* * See if this FileInfo* is still on the thread local list. */ tsdPtr = TCL_TSD_INIT(&dataKey); for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr == fileInfoPtr) { /* * This channel exists on the thread local list. It should have * been removed by an earlier Threadaction call, but do that now * since just deallocating fileInfoPtr would leave an deallocated * pointer on the thread local list. */ FileThreadActionProc(fileInfoPtr,TCL_CHANNEL_THREAD_REMOVE); break; } } Tcl_Free(fileInfoPtr); return errorCode; } /* *---------------------------------------------------------------------- * * FileWideSeekProc -- * * Seeks on a file-based channel. Returns the new position. * * Results: * -1 if failed, the new position if successful. If failed, it also sets * *errorCodePtr to the error code. * * Side effects: * Moves the location at which the channel will be accessed in future * operations. * *---------------------------------------------------------------------- */ static long long FileWideSeekProc( void *instanceData, /* File state. */ long long offset, /* Offset to seek to. */ int mode, /* Relative to where should we seek? */ int *errorCodePtr) /* To store error code. */ { FileInfo *infoPtr = (FileInfo *)instanceData; DWORD moveMethod; LONG newPos, newPosHigh; *errorCodePtr = 0; if (mode == SEEK_SET) { moveMethod = FILE_BEGIN; } else if (mode == SEEK_CUR) { moveMethod = FILE_CURRENT; } else { moveMethod = FILE_END; } newPosHigh = (LONG)(offset >> 32); newPos = SetFilePointer(infoPtr->handle, (LONG)offset, &newPosHigh, moveMethod); if (newPos == (LONG) INVALID_SET_FILE_POINTER) { DWORD winError = GetLastError(); if (winError != NO_ERROR) { Tcl_WinConvertError(winError); *errorCodePtr = errno; return -1; } } return (((long long)((unsigned)newPos)) | ((long long)newPosHigh << 32)); } /* *---------------------------------------------------------------------- * * FileTruncateProc -- * * Truncates a file-based channel. Returns the error code. * * Results: * 0 if successful, POSIX-y error code if it failed. * * Side effects: * Truncates the file, may move file pointers too. * *---------------------------------------------------------------------- */ static int FileTruncateProc( void *instanceData, /* File state. */ long long length) /* Length to truncate at. */ { FileInfo *infoPtr = (FileInfo *)instanceData; LONG newPos, newPosHigh, oldPos, oldPosHigh; /* * Save where we were... */ oldPosHigh = 0; oldPos = SetFilePointer(infoPtr->handle, 0, &oldPosHigh, FILE_CURRENT); if (oldPos == (LONG) INVALID_SET_FILE_POINTER) { DWORD winError = GetLastError(); if (winError != NO_ERROR) { Tcl_WinConvertError(winError); return errno; } } /* * Move to where we want to truncate */ newPosHigh = (LONG)(length >> 32); newPos = SetFilePointer(infoPtr->handle, (LONG)length, &newPosHigh, FILE_BEGIN); if (newPos == (LONG) INVALID_SET_FILE_POINTER) { DWORD winError = GetLastError(); if (winError != NO_ERROR) { Tcl_WinConvertError(winError); return errno; } } /* * Perform the truncation (unlike POSIX ftruncate(), we needed to move to * the location to truncate at first). */ if (!SetEndOfFile(infoPtr->handle)) { Tcl_WinConvertError(GetLastError()); return errno; } /* * Move back. If this last step fails, we don't care; it's just a "best * effort" attempt to restore our file pointer to where it was. */ SetFilePointer(infoPtr->handle, oldPos, &oldPosHigh, FILE_BEGIN); return 0; } /* *---------------------------------------------------------------------- * * FileInputProc -- * * Reads input from the IO channel into the buffer given. Returns count * of how many bytes were actually read, and an error indication. * * Results: * A count of how many bytes were read is returned and an error * indication is returned in an output argument. * * Side effects: * Reads input from the actual channel. * *---------------------------------------------------------------------- */ static int FileInputProc( void *instanceData, /* File state. */ char *buf, /* Where to store data read. */ int bufSize, /* Num bytes available in buffer. */ int *errorCode) /* Where to store error code. */ { FileInfo *infoPtr = (FileInfo *)instanceData; DWORD bytesRead; *errorCode = 0; /* * TODO: This comment appears to be out of date. We *do* have a console * driver, over in tclWinConsole.c. After some Windows developer confirms, * this comment should be revised. * * Note that we will block on reads from a console buffer until a full * line has been entered. The only way I know of to get around this is to * write a console driver. We should probably do this at some point, but * for now, we just block. The same problem exists for files being read * over the network. */ if (ReadFile(infoPtr->handle, (LPVOID) buf, (DWORD) bufSize, &bytesRead, (LPOVERLAPPED) NULL) != FALSE) { return (int)bytesRead; } Tcl_WinConvertError(GetLastError()); *errorCode = errno; if (errno == EPIPE) { return 0; } return -1; } /* *---------------------------------------------------------------------- * * FileOutputProc -- * * Writes the given output on the IO channel. Returns count of how many * characters were actually written, and an error indication. * * Results: * A count of how many characters were written is returned and an error * indication is returned in an output argument. * * Side effects: * Writes output on the actual channel. * *---------------------------------------------------------------------- */ static int FileOutputProc( void *instanceData, /* File state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { FileInfo *infoPtr = (FileInfo *)instanceData; DWORD bytesWritten; *errorCode = 0; /* * If we are writing to a file that was opened with O_APPEND, we need to * seek to the end of the file before writing the current buffer. */ if (TEST_FLAG(infoPtr->flags, FILE_APPEND)) { SetFilePointer(infoPtr->handle, 0, NULL, FILE_END); } if (WriteFile(infoPtr->handle, (LPVOID) buf, (DWORD) toWrite, &bytesWritten, (LPOVERLAPPED) NULL) == FALSE) { Tcl_WinConvertError(GetLastError()); *errorCode = errno; return -1; } infoPtr->dirty = 1; return (int)bytesWritten; } /* *---------------------------------------------------------------------- * * FileWatchProc -- * * Called by the notifier to set up to watch for events on this channel. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void FileWatchProc( void *instanceData, /* File state. */ int mask) /* What events to watch for; OR-ed combination * of TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { FileInfo *infoPtr = (FileInfo *)instanceData; Tcl_Time blockTime = { 0, 0 }; /* * Since the file is always ready for events, we set the block time to * zero so we will poll. */ infoPtr->watchMask = mask & infoPtr->validMask; if (infoPtr->watchMask) { Tcl_SetMaxBlockTime(&blockTime); } } /* *---------------------------------------------------------------------- * * FileGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from a file * based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int FileGetHandleProc( void *instanceData, /* The file state. */ int direction, /* TCL_READABLE or TCL_WRITABLE */ void **handlePtr) /* Where to store the handle. */ { FileInfo *infoPtr = (FileInfo *)instanceData; if (!TEST_FLAG(direction, infoPtr->validMask)) { return TCL_ERROR; } *handlePtr = (void *)infoPtr->handle; return TCL_OK; } /* *---------------------------------------------------------------------- * * FileGetOptionProc -- * * Gets an option associated with an open file. If the optionName arg is * non-NULL, retrieves the value of that option. If the optionName arg is * NULL, retrieves a list of alternating option names and values for the * given channel. * * Results: * A standard Tcl result. Also sets the supplied DString to the string * value of the option(s) returned. Sets error message if needed * (by calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static inline ULONGLONG CombineDwords( DWORD hi, DWORD lo) { ULARGE_INTEGER converter; converter.LowPart = lo; converter.HighPart = hi; return converter.QuadPart; } static inline time_t ToCTime( FILETIME fileTime) /* UTC time */ { LARGE_INTEGER convertedTime; convertedTime.LowPart = fileTime.dwLowDateTime; convertedTime.HighPart = (LONG) fileTime.dwHighDateTime; return (time_t) ((convertedTime.QuadPart - (long long) POSIX_EPOCH_AS_FILETIME) / (long long) 10000000); } static Tcl_Obj * StatOpenFile( FileInfo *infoPtr) { DWORD attr; int dev, nlink = 1; unsigned short mode; unsigned long long size, inode; long long atime, ctime, mtime; BY_HANDLE_FILE_INFORMATION data; Tcl_Obj *dictObj; if (GetFileInformationByHandle(infoPtr->handle, &data) != TRUE) { Tcl_SetErrno(ENOENT); return NULL; } atime = ToCTime(data.ftLastAccessTime); mtime = ToCTime(data.ftLastWriteTime); ctime = ToCTime(data.ftCreationTime); attr = data.dwFileAttributes; size = CombineDwords(data.nFileSizeHigh, data.nFileSizeLow); nlink = data.nNumberOfLinks; /* * Unfortunately our stat definition's inode field (unsigned short) will * throw away most of the precision we have here, which means we can't * rely on inode as a unique identifier of a file. We'd really like to do * something like how we handle 'st_size'. */ inode = CombineDwords(data.nFileIndexHigh, data.nFileIndexLow); dev = data.dwVolumeSerialNumber; /* * Note that this code has no idea whether the file can be executed. */ mode = (attr & FILE_ATTRIBUTE_DIRECTORY) ? S_IFDIR|S_IEXEC : S_IFREG; mode |= (attr & FILE_ATTRIBUTE_READONLY) ? S_IREAD : S_IREAD|S_IWRITE; mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 3; mode |= (mode & (S_IREAD|S_IWRITE|S_IEXEC)) >> 6; /* * We don't construct a Tcl_StatBuf; we're using the info immediately. */ TclNewObj(dictObj); #define STORE_ELEM(name, value) TclDictPut(NULL, dictObj, name, value) STORE_ELEM("dev", Tcl_NewWideIntObj((long) dev)); STORE_ELEM("ino", Tcl_NewWideIntObj((long long) inode)); STORE_ELEM("nlink", Tcl_NewIntObj(nlink)); STORE_ELEM("uid", Tcl_NewIntObj(0)); STORE_ELEM("gid", Tcl_NewIntObj(0)); STORE_ELEM("size", Tcl_NewWideIntObj((long long) size)); STORE_ELEM("atime", Tcl_NewWideIntObj(atime)); STORE_ELEM("mtime", Tcl_NewWideIntObj(mtime)); STORE_ELEM("ctime", Tcl_NewWideIntObj(ctime)); STORE_ELEM("mode", Tcl_NewWideIntObj(mode)); /* * Windows only has files and directories, as far as we're concerned. * Anything else and we definitely couldn't have got here anyway. */ if (attr & FILE_ATTRIBUTE_DIRECTORY) { STORE_ELEM("type", Tcl_NewStringObj("directory", TCL_INDEX_NONE)); } else { STORE_ELEM("type", Tcl_NewStringObj("file", TCL_INDEX_NONE)); } #undef STORE_ELEM return dictObj; } static int FileGetOptionProc( void *instanceData, /* The file state. */ Tcl_Interp *interp, /* For error reporting. */ const char *optionName, /* What option to read, or NULL for all. */ Tcl_DString *dsPtr) /* Where to write the value read. */ { FileInfo *infoPtr = (FileInfo *)instanceData; int valid = 0; /* Flag if valid option parsed. */ int len; if (optionName == NULL) { len = 0; valid = 1; } else { len = strlen(optionName); } /* * Get option -stat * Option is readonly and returned by [fconfigure chan -stat] but not * returned by [fconfigure chan] without explicit option name. */ if ((len > 1) && (strncmp(optionName, "-stat", len) == 0)) { Tcl_Obj *dictObj = StatOpenFile(infoPtr); const char *dictContents; Tcl_Size dictLength; if (dictObj == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read file channel status: %s", Tcl_PosixError(interp))); return TCL_ERROR; } /* * Transfer dictionary to the DString. Note that we don't do this as * an element as this is an option that can't be retrieved with a * general probe. */ dictContents = TclGetStringFromObj(dictObj, &dictLength); Tcl_DStringAppend(dsPtr, dictContents, dictLength); Tcl_DecrRefCount(dictObj); return TCL_OK; } if (valid) { return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "stat"); } /* *---------------------------------------------------------------------- * * TclpOpenFileChannel -- * * Open an File based channel on Unix systems. * * Results: * The new channel or NULL. If NULL, the output argument errorCodePtr is * set to a POSIX error. * * Side effects: * May open the channel and may cause creation of a file on the file * system. * *---------------------------------------------------------------------- */ Tcl_Channel TclpOpenFileChannel( Tcl_Interp *interp, /* Interpreter for error reporting; can be * NULL. */ Tcl_Obj *pathPtr, /* Name of file to open. */ int mode, /* POSIX mode. */ int permissions) /* If the open involves creating a file, with * what modes to create it? */ { Tcl_Channel channel = 0; int channelPermissions = 0; DWORD accessMode = 0, createMode, shareMode, flags; const WCHAR *nativeName; HANDLE handle; char channelName[16 + TCL_INTEGER_SPACE]; TclFile readFile = NULL, writeFile = NULL; nativeName = (const WCHAR *)Tcl_FSGetNativePath(pathPtr); if (nativeName == NULL) { if (interp) { /* * We need this just to ensure we return the correct error messages under * some circumstances (relative paths only), so because the normalization * is very expensive, don't invoke it for native or absolute paths. * Note: since paths starting with ~ are relative in 9.0 for windows, * it doesn't need to consider tilde expansion (in opposite to 8.x). */ if ( ( !TclFSCwdIsNative() && (Tcl_FSGetPathType(pathPtr) != TCL_PATH_ABSOLUTE) ) && Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL ) { return NULL; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open \"%s\": filename is invalid on this platform", TclGetString(pathPtr))); } return NULL; } switch (mode & O_ACCMODE) { case O_RDONLY: accessMode = GENERIC_READ; channelPermissions = TCL_READABLE; break; case O_WRONLY: accessMode = GENERIC_WRITE; channelPermissions = TCL_WRITABLE; break; case O_RDWR: accessMode = (GENERIC_READ | GENERIC_WRITE); channelPermissions = (TCL_READABLE | TCL_WRITABLE); break; default: Tcl_Panic("TclpOpenFileChannel: invalid mode value"); break; } /* * Map the creation flags to the NT create mode. */ switch (mode & (O_CREAT | O_EXCL | O_TRUNC)) { case (O_CREAT | O_EXCL): case (O_CREAT | O_EXCL | O_TRUNC): createMode = CREATE_NEW; break; case (O_CREAT | O_TRUNC): createMode = CREATE_ALWAYS; break; case O_CREAT: createMode = OPEN_ALWAYS; break; case O_TRUNC: case (O_TRUNC | O_EXCL): createMode = TRUNCATE_EXISTING; break; default: createMode = OPEN_EXISTING; break; } /* * [2413550] Avoid double-open of serial ports on Windows. Special * handling for Windows serial ports by a "name-hint" to directly open it * with the OVERLAPPED flag set. */ if (NativeIsComPort(nativeName)) { handle = TclWinSerialOpen(INVALID_HANDLE_VALUE, nativeName, accessMode); if (handle == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open serial \"%s\": %s", TclGetString(pathPtr), Tcl_PosixError(interp))); } return NULL; } /* * For natively-named Windows serial ports we are done. */ channel = TclWinOpenSerialChannel(handle, channelName, channelPermissions); return channel; } /* * If the file is being created, get the file attributes from the * permissions argument, else use the existing file attributes. */ if (TEST_FLAG(mode, O_CREAT)) { if (TEST_FLAG(permissions, S_IWRITE)) { flags = FILE_ATTRIBUTE_NORMAL; } else { flags = FILE_ATTRIBUTE_READONLY; } } else { flags = GetFileAttributesW(nativeName); if (flags == 0xFFFFFFFF) { flags = 0; } } /* * Set up the file sharing mode. We want to allow simultaneous access. */ shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; /* * Now we get to create the file. */ handle = CreateFileW(nativeName, accessMode, shareMode, NULL, createMode, flags, (HANDLE) NULL); if (handle == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); if ((err & 0xFFFFL) == ERROR_OPEN_FAILED) { err = TEST_FLAG(mode, O_CREAT) ? ERROR_FILE_EXISTS : ERROR_FILE_NOT_FOUND; } Tcl_WinConvertError(err); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open \"%s\": %s", TclGetString(pathPtr), Tcl_PosixError(interp))); } return NULL; } channel = NULL; switch (FileGetType(handle)) { case FILE_TYPE_SERIAL: /* * Natively named serial ports "com1-9", "\\\\.\\comXX" are already * done with the code above. Here we handle all other serial port * names. * * Reopen channel for OVERLAPPED operation. Normally this shouldn't * fail, because the channel exists. */ handle = TclWinSerialOpen(handle, nativeName, accessMode); if (handle == INVALID_HANDLE_VALUE) { Tcl_WinConvertError(GetLastError()); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't reopen serial \"%s\": %s", TclGetString(pathPtr), Tcl_PosixError(interp))); } return NULL; } channel = TclWinOpenSerialChannel(handle, channelName, channelPermissions); break; case FILE_TYPE_CONSOLE: channel = TclWinOpenConsoleChannel(handle, channelName, channelPermissions); break; case FILE_TYPE_PIPE: if (TEST_FLAG(channelPermissions, TCL_READABLE)) { readFile = TclWinMakeFile(handle); } if (TEST_FLAG(channelPermissions, TCL_WRITABLE)) { writeFile = TclWinMakeFile(handle); } channel = TclpCreateCommandChannel(readFile, writeFile, NULL, 0, NULL); break; case FILE_TYPE_CHAR: case FILE_TYPE_DISK: case FILE_TYPE_UNKNOWN: channel = OpenFileChannel(handle, channelName, channelPermissions, TEST_FLAG(mode, O_APPEND) ? FILE_APPEND : 0); break; default: /* * The handle is of an unknown type, probably /dev/nul equivalent or * possibly a closed handle. */ channel = NULL; Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open \"%s\": bad file type", TclGetString(pathPtr))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "BAD_TYPE", (char *)NULL); break; } return channel; } /* *---------------------------------------------------------------------- * * Tcl_MakeFileChannel -- * * Creates a Tcl_Channel from an existing platform specific file handle. * * Results: * The Tcl_Channel created around the preexisting file. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_MakeFileChannel( void *rawHandle, /* OS level handle */ int mode) /* OR'ed combination of TCL_READABLE and * TCL_WRITABLE to indicate file mode. */ { #if defined(HAVE_NO_SEH) && !defined(_WIN64) && !defined(__clang__) TCLEXCEPTION_REGISTRATION registration; #endif char channelName[16 + TCL_INTEGER_SPACE]; Tcl_Channel channel = NULL; HANDLE handle = (HANDLE) rawHandle; HANDLE dupedHandle; TclFile readFile = NULL, writeFile = NULL; BOOL result; if ((mode & (TCL_READABLE|TCL_WRITABLE)) == 0) { return NULL; } switch (FileGetType(handle)) { case FILE_TYPE_SERIAL: channel = TclWinOpenSerialChannel(handle, channelName, mode); break; case FILE_TYPE_CONSOLE: channel = TclWinOpenConsoleChannel(handle, channelName, mode); break; case FILE_TYPE_PIPE: if (TEST_FLAG(mode, TCL_READABLE)) { readFile = TclWinMakeFile(handle); } if (TEST_FLAG(mode, TCL_WRITABLE)) { writeFile = TclWinMakeFile(handle); } channel = TclpCreateCommandChannel(readFile, writeFile, NULL, 0, NULL); break; case FILE_TYPE_DISK: case FILE_TYPE_CHAR: channel = OpenFileChannel(handle, channelName, mode, 0); break; case FILE_TYPE_UNKNOWN: default: /* * The handle is of an unknown type. Test the validity of this OS * handle by duplicating it, then closing the dupe. The Win32 API * doesn't provide an IsValidHandle() function, so we have to emulate * it here. This test will not work on a console handle reliably, * which is why we can't test every handle that comes into this * function in this way. */ result = DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(), &dupedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS); if (result == 0) { /* * Unable to make a duplicate. It's definitely invalid at this * point. */ return NULL; } /* * Use structured exception handling (Win32 SEH) to protect the close * of this duped handle which might throw EXCEPTION_INVALID_HANDLE. */ result = 0; #if defined(HAVE_NO_SEH) && !defined(_WIN64) && !defined(__clang__) /* * Don't have SEH available, do things the hard way. Note that this * needs to be one block of asm, to avoid stack imbalance; also, it is * illegal for one asm block to contain a jump to another. */ __asm__ __volatile__ ( /* * Pick up parameters before messing with the stack */ "movl %[dupedHandle], %%ebx" "\n\t" /* * Construct an TCLEXCEPTION_REGISTRATION to protect the call to * CloseHandle. */ "leal %[registration], %%edx" "\n\t" "movl %%fs:0, %%eax" "\n\t" "movl %%eax, 0x0(%%edx)" "\n\t" /* link */ "leal 1f, %%eax" "\n\t" "movl %%eax, 0x4(%%edx)" "\n\t" /* handler */ "movl %%ebp, 0x8(%%edx)" "\n\t" /* ebp */ "movl %%esp, 0xC(%%edx)" "\n\t" /* esp */ "movl $0, 0x10(%%edx)" "\n\t" /* status */ /* * Link the TCLEXCEPTION_REGISTRATION on the chain. */ "movl %%edx, %%fs:0" "\n\t" /* * Call CloseHandle(dupedHandle). */ "pushl %%ebx" "\n\t" "call _CloseHandle@4" "\n\t" /* * Come here on normal exit. Recover the TCLEXCEPTION_REGISTRATION * and put a TRUE status return into it. */ "movl %%fs:0, %%edx" "\n\t" "movl $1, %%eax" "\n\t" "movl %%eax, 0x10(%%edx)" "\n\t" "jmp 2f" "\n" /* * Come here on an exception. Recover the TCLEXCEPTION_REGISTRATION */ "1:" "\t" "movl %%fs:0, %%edx" "\n\t" "movl 0x8(%%edx), %%edx" "\n\t" /* * Come here however we exited. Restore context from the * TCLEXCEPTION_REGISTRATION in case the stack is unbalanced. */ "2:" "\t" "movl 0xC(%%edx), %%esp" "\n\t" "movl 0x8(%%edx), %%ebp" "\n\t" "movl 0x0(%%edx), %%eax" "\n\t" "movl %%eax, %%fs:0" "\n\t" : /* No outputs */ : [registration] "m" (registration), [dupedHandle] "m" (dupedHandle) : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory" ); result = registration.status; #else #ifndef HAVE_NO_SEH __try { #endif CloseHandle(dupedHandle); result = 1; #ifndef HAVE_NO_SEH } __except (EXCEPTION_EXECUTE_HANDLER) {} #endif #endif if (result == FALSE) { return NULL; } /* * Fall through, the handle is valid. * * Create the undefined channel, anyways, because we know the handle * is valid to something. */ channel = OpenFileChannel(handle, channelName, mode, 0); } return channel; } /* *---------------------------------------------------------------------- * * TclpGetDefaultStdChannel -- * * Constructs a channel for the specified standard OS handle. * * Results: * Returns the specified default standard channel, or NULL. * * Side effects: * May cause the creation of a standard channel and the underlying file. * *---------------------------------------------------------------------- */ Tcl_Channel TclpGetDefaultStdChannel( int type) /* One of TCL_STDIN, TCL_STDOUT, or * TCL_STDERR. */ { Tcl_Channel channel; HANDLE handle; int mode = -1; const char *bufMode = NULL; DWORD handleId = (DWORD) -1; /* Standard handle to retrieve. */ switch (type) { case TCL_STDIN: handleId = STD_INPUT_HANDLE; mode = TCL_READABLE; bufMode = "line"; break; case TCL_STDOUT: handleId = STD_OUTPUT_HANDLE; mode = TCL_WRITABLE; bufMode = "line"; break; case TCL_STDERR: handleId = STD_ERROR_HANDLE; mode = TCL_WRITABLE; bufMode = "none"; break; default: Tcl_Panic("TclGetDefaultStdChannel: Unexpected channel type"); break; } handle = GetStdHandle(handleId); /* * Note that we need to check for 0 because Windows may return 0 if this * is not a console mode application, even though this is not a valid * handle. */ if ((handle == INVALID_HANDLE_VALUE) || (handle == 0)) { return (Tcl_Channel) NULL; } channel = Tcl_MakeFileChannel(handle, mode); if (channel == NULL) { return (Tcl_Channel) NULL; } /* * Set up the normal channel options for stdio handles. */ if (Tcl_SetChannelOption(NULL,channel,"-translation","auto")!=TCL_OK || Tcl_SetChannelOption(NULL,channel,"-buffering",bufMode)!=TCL_OK) { Tcl_CloseEx(NULL, channel, 0); return (Tcl_Channel) NULL; } return channel; } /* *---------------------------------------------------------------------- * * OpenFileChannel -- * * Constructs a File channel for the specified standard OS handle. This * is a helper function to break up the construction of channels into * File, Console, or Serial. * * Results: * Returns the new channel, or NULL. * * Side effects: * May open the channel and may cause creation of a file on the file * system. * *---------------------------------------------------------------------- */ Tcl_Channel OpenFileChannel( HANDLE handle, /* Win32 HANDLE to swallow */ char *channelName, /* Buffer to receive channel name */ int permissions, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION, indicating * which operations are valid on the file. */ int appendMode) /* OR'ed combination of bits indicating what * additional configuration of the channel is * present. */ { FileInfo *infoPtr; ThreadSpecificData *tsdPtr = FileInit(); /* * See if a channel with this handle already exists. */ for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->handle == (HANDLE) handle) { return ((permissions & (TCL_READABLE|TCL_WRITABLE|TCL_EXCEPTION))==infoPtr->validMask) ? infoPtr->channel : NULL; } } infoPtr = (FileInfo *)Tcl_Alloc(sizeof(FileInfo)); /* * TIP #218. Removed the code inserting the new structure into the global * list. This is now handled in the thread action callbacks, and only * there. */ infoPtr->nextPtr = NULL; infoPtr->validMask = permissions & (TCL_READABLE|TCL_WRITABLE|TCL_EXCEPTION); infoPtr->watchMask = 0; infoPtr->flags = appendMode; infoPtr->handle = handle; infoPtr->dirty = 0; TclWinGenerateChannelName(channelName, "file", infoPtr); infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName, infoPtr, permissions); /* * Files have default translation of AUTO and ^Z eof char, which means * that a ^Z will be accepted as EOF when reading. */ Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto"); return infoPtr->channel; } /* *---------------------------------------------------------------------- * * TclWinFlushDirtyChannels -- * * Flush all dirty channels to disk, so that requesting the size of any * file returns the correct value. * * Results: * None. * * Side effects: * Information is actually written to disk now, rather than later. Don't * call this too often, or there will be a performance hit (i.e. only * call when we need to ask for the size of a file). * *---------------------------------------------------------------------- */ void TclWinFlushDirtyChannels(void) { FileInfo *infoPtr; ThreadSpecificData *tsdPtr = FileInit(); /* * Flush all channels which are dirty, i.e. may have data pending in the * OS. */ for (infoPtr = tsdPtr->firstFilePtr; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { if (infoPtr->dirty) { FlushFileBuffers(infoPtr->handle); infoPtr->dirty = 0; } } } /* *---------------------------------------------------------------------- * * FileThreadActionProc -- * * Insert or remove any thread local refs to this channel. * * Results: * None. * * Side effects: * Changes thread local list of valid channels. * *---------------------------------------------------------------------- */ static void FileThreadActionProc( void *instanceData, int action) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileInfo *infoPtr = (FileInfo *)instanceData; if (action == TCL_CHANNEL_THREAD_INSERT) { infoPtr->nextPtr = tsdPtr->firstFilePtr; tsdPtr->firstFilePtr = infoPtr; } else { FileInfo **nextPtrPtr; int removed = 0; for (nextPtrPtr = &(tsdPtr->firstFilePtr); (*nextPtrPtr) != NULL; nextPtrPtr = &((*nextPtrPtr)->nextPtr)) { if ((*nextPtrPtr) == infoPtr) { (*nextPtrPtr) = infoPtr->nextPtr; removed = 1; break; } } /* * This could happen if the channel was created in one thread and then * moved to another without updating the thread local data in each * thread. */ if (!removed) { Tcl_Panic("file info ptr not on thread channel list"); } } } /* *---------------------------------------------------------------------- * * FileGetType -- * * Given a file handle, return its type * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DWORD FileGetType( HANDLE handle) /* Opened file handle */ { DWORD type; type = GetFileType(handle); /* * If the file is a character device, we need to try to figure out whether * it is a serial port, a console, or something else. We test for the * console case first because this is more common. */ if ((type == FILE_TYPE_CHAR) || ((type == FILE_TYPE_UNKNOWN) && !GetLastError())) { DWORD consoleParams; if (GetConsoleMode(handle, &consoleParams)) { type = FILE_TYPE_CONSOLE; } else { DCB dcb; dcb.DCBlength = sizeof(DCB); if (GetCommState(handle, &dcb)) { type = FILE_TYPE_SERIAL; } } } return type; } /* *---------------------------------------------------------------------- * * NativeIsComPort -- * * Determines if a path refers to a Windows serial port. A simple and * efficient solution is to use a "name hint" to detect COM ports by * their filename instead of resorting to a syscall to detect serialness * after the fact. * * The following patterns cover common serial port names: * COM[1-9] * \\.\COM[0-9]+ * * Results: * 1 = serial port, 0 = not. * *---------------------------------------------------------------------- */ static int NativeIsComPort( const WCHAR *nativePath) /* Path of file to access, native encoding. */ { const WCHAR *p = (const WCHAR *) nativePath; size_t i, len = wcslen(p); /* * 1. Look for com[1-9]:? */ if ((len == 4) && (_wcsnicmp(p, L"com", 3) == 0)) { /* * The 4th character must be a digit 1..9 */ if ((p[3] < '1') || (p[3] > '9')) { return 0; } return 1; } /* * 2. Look for \\.\com[0-9]+ */ if ((len >= 8) && (_wcsnicmp(p, L"\\\\.\\com", 7) == 0)) { /* * Charaters 8..end must be a digits 0..9 */ for (i=7; i '9')) { return 0; } } return 1; } return 0; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclWin32Dll.c0000644000175000017500000002750115104661342014557 0ustar sergeisergei/* * tclWin32Dll.c -- * * This file contains the DLL entry point and other low-level bit bashing * code that needs inline assembly. * * Copyright © 1995-1996 Sun Microsystems, Inc. * Copyright © 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclWinInt.h" #if defined(HAVE_CPUID_H) # include #elif defined(_MSC_VER) # include #endif /* * The following variables keep track of information about this DLL on a * per-instance basis. Each time this DLL is loaded, it gets its own new data * segment with its own copy of all static and global information. */ static HINSTANCE hInstance; /* HINSTANCE of this DLL. */ /* * The following declaration is for the VC++ DLL entry point. */ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved); /* * The following structure and linked list is to allow us to map between * volume mount points and drive letters on the fly (no Win API exists for * this). */ typedef struct MountPointMap { WCHAR *volumeName; /* Native wide string volume name. */ WCHAR driveLetter; /* Drive letter corresponding to the volume * name. */ struct MountPointMap *nextPtr; /* Pointer to next structure in list, or * NULL. */ } MountPointMap; /* * This is the head of the linked list, which is protected by the mutex which * follows, for thread-enabled builds. */ MountPointMap *driveLetterLookup = NULL; TCL_DECLARE_MUTEX(mountPointMap) /* * We will need this below. */ #ifdef _WIN32 #ifndef STATIC_BUILD /* *---------------------------------------------------------------------- * * DllEntryPoint -- * * This wrapper function is used by Borland to invoke the initialization * code for Tcl. It simply calls the DllMain routine. * * Results: * See DllMain. * * Side effects: * See DllMain. * *---------------------------------------------------------------------- */ BOOL APIENTRY DllEntryPoint( HINSTANCE hInst, /* Library instance handle. */ DWORD reason, /* Reason this function is being called. */ LPVOID reserved) { return DllMain(hInst, reason, reserved); } /* *---------------------------------------------------------------------- * * DllMain -- * * This routine is called by the VC++ C run time library init code, or * the DllEntryPoint routine. It is responsible for initializing various * dynamically loaded libraries. * * Results: * TRUE on sucess, FALSE on failure. * * Side effects: * Initializes most rudimentary Windows bits. * *---------------------------------------------------------------------- */ BOOL APIENTRY DllMain( HINSTANCE hInst, /* Library instance handle. */ DWORD reason, /* Reason this function is being called. */ TCL_UNUSED(LPVOID)) { switch (reason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInst); TclWinInit(hInst); return TRUE; /* * DLL_PROCESS_DETACH is unnecessary as the user should call * Tcl_Finalize explicitly before unloading Tcl. */ } return TRUE; } #endif /* !STATIC_BUILD */ #endif /* _WIN32 */ /* *---------------------------------------------------------------------- * * TclWinGetTclInstance -- * * Retrieves the global library instance handle. * * Results: * Returns the global library instance handle. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclWinGetTclInstance(void) { return hInstance; } /* *---------------------------------------------------------------------- * * TclWinInit -- * * This function initializes the internal state of the tcl library. * * Results: * None. * * Side effects: * Initializes the tclPlatformId variable. * *---------------------------------------------------------------------- */ void TclWinInit( HINSTANCE hInst) /* Library instance handle. */ { OSVERSIONINFOW os; hInstance = hInst; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); /* * We no longer support Win32s or Win9x or Windows CE or Windows XP, so just * in case someone manages to get a runtime there, make sure they know that. */ if (os.dwPlatformId != VER_PLATFORM_WIN32_NT) { Tcl_Panic("Windows 7 is the minimum supported platform"); } } /* *------------------------------------------------------------------------- * * TclWinNoBackslash -- * * We're always iterating through a string in Windows, changing the * backslashes to slashes for use in Tcl. * * Results: * All backslashes in given string are changed to slashes. * * Side effects: * None. * *------------------------------------------------------------------------- */ char * TclWinNoBackslash( char *path) /* String to change. */ { char *p; for (p = path; *p != '\0'; p++) { if (*p == '\\') { *p = '/'; } } return path; } /* *--------------------------------------------------------------------------- * * TclWinEncodingsCleanup -- * * Called during finalization to clean up any memory allocated in our * mount point map which is used to follow certain kinds of symlinks. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void TclWinEncodingsCleanup(void) { MountPointMap *dlIter, *dlIter2; /* * Clean up the mount point map. */ Tcl_MutexLock(&mountPointMap); dlIter = driveLetterLookup; while (dlIter != NULL) { dlIter2 = dlIter->nextPtr; Tcl_Free(dlIter->volumeName); Tcl_Free(dlIter); dlIter = dlIter2; } Tcl_MutexUnlock(&mountPointMap); } /* *-------------------------------------------------------------------- * * TclWinDriveLetterForVolMountPoint * * Unfortunately, Windows provides no easy way at all to get hold of the * drive letter for a volume mount point, but we need that information to * understand paths correctly. So, we have to build an associated array * to find these correctly, and allow quick and easy lookup from volume * mount points to drive letters. * * We assume here that we are running on a system for which the wide * character interfaces are used, which is valid for Win 2000 and WinXP * which are the only systems on which this function will ever be called. * * Result: * The drive letter, or -1 if no drive letter corresponds to the given * mount point. * *-------------------------------------------------------------------- */ char TclWinDriveLetterForVolMountPoint( const WCHAR *mountPoint) { MountPointMap *dlIter, *dlPtr2; WCHAR Target[55]; /* Target of mount at mount point */ WCHAR drive[4] = L"A:\\"; /* * Detect the volume mounted there. Unfortunately, there is no simple way * to map a unique volume name to a DOS drive letter. So, we have to build * an associative array. */ Tcl_MutexLock(&mountPointMap); dlIter = driveLetterLookup; while (dlIter != NULL) { if (wcscmp(dlIter->volumeName, mountPoint) == 0) { /* * We need to check whether this information is still valid, since * either the user or various programs could have adjusted the * mount points on the fly. */ drive[0] = (WCHAR) dlIter->driveLetter; /* * Try to read the volume mount point and see where it points. */ if (GetVolumeNameForVolumeMountPointW(drive, Target, 55) != 0) { if (wcscmp(dlIter->volumeName, Target) == 0) { /* * Nothing has changed. */ Tcl_MutexUnlock(&mountPointMap); return (char) dlIter->driveLetter; } } /* * If we reach here, unfortunately, this mount point is no longer * valid at all. */ if (driveLetterLookup == dlIter) { dlPtr2 = dlIter; driveLetterLookup = dlIter->nextPtr; } else { for (dlPtr2 = driveLetterLookup; dlPtr2 != NULL; dlPtr2 = dlPtr2->nextPtr) { if (dlPtr2->nextPtr == dlIter) { dlPtr2->nextPtr = dlIter->nextPtr; dlPtr2 = dlIter; break; } } } /* * Now dlPtr2 points to the structure to free. */ Tcl_Free(dlPtr2->volumeName); Tcl_Free(dlPtr2); /* * Restart the loop - we could try to be clever and continue half * way through, but the logic is a bit messy, so it's cleanest * just to restart. */ dlIter = driveLetterLookup; continue; } dlIter = dlIter->nextPtr; } /* * We couldn't find it, so we must iterate over the letters. */ for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) { /* * Try to read the volume mount point and see where it points. */ if (GetVolumeNameForVolumeMountPointW(drive, Target, 55) != 0) { int alreadyStored = 0; for (dlIter = driveLetterLookup; dlIter != NULL; dlIter = dlIter->nextPtr) { if (wcscmp(dlIter->volumeName, Target) == 0) { alreadyStored = 1; break; } } if (!alreadyStored) { dlPtr2 = (MountPointMap *)Tcl_Alloc(sizeof(MountPointMap)); dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep(Target); dlPtr2->driveLetter = (WCHAR) drive[0]; dlPtr2->nextPtr = driveLetterLookup; driveLetterLookup = dlPtr2; } } } /* * Try again. */ for (dlIter = driveLetterLookup; dlIter != NULL; dlIter = dlIter->nextPtr) { if (wcscmp(dlIter->volumeName, mountPoint) == 0) { Tcl_MutexUnlock(&mountPointMap); return (char) dlIter->driveLetter; } } /* * The volume doesn't appear to correspond to a drive letter - we remember * that fact and store '-1' so we don't have to look it up each time. */ dlPtr2 = (MountPointMap *)Tcl_Alloc(sizeof(MountPointMap)); dlPtr2->volumeName = (WCHAR *)TclNativeDupInternalRep((void *)mountPoint); dlPtr2->driveLetter = (WCHAR)-1; dlPtr2->nextPtr = driveLetterLookup; driveLetterLookup = dlPtr2; Tcl_MutexUnlock(&mountPointMap); return -1; } /* *------------------------------------------------------------------------ * * TclWinCPUID -- * * Get CPU ID information on an Intel box under Windows * * Results: * Returns TCL_OK if successful, TCL_ERROR if CPUID is not supported or * fails. * * Side effects: * If successful, stores EAX, EBX, ECX and EDX registers after the CPUID * instruction in the four integers designated by 'regsPtr' * *---------------------------------------------------------------------- */ int TclWinCPUID( int index, /* Which CPUID value to retrieve. */ int *regsPtr) /* Registers after the CPUID. */ { int status = TCL_ERROR; #if defined(HAVE_CPUID_H) unsigned int *regs = (unsigned int *)regsPtr; __get_cpuid(index, ®s[0], ®s[1], ®s[2], ®s[3]); status = TCL_OK; #elif defined(_MSC_VER) && defined(_WIN64) && defined(HAVE_CPUID) __cpuid((int *)regsPtr, index); status = TCL_OK; #elif defined (_M_IX86) /* * Define a structure in the stack frame to hold the registers. */ struct { DWORD dw0; DWORD dw1; DWORD dw2; DWORD dw3; } regs; regs.dw0 = index; /* * Execute the CPUID instruction and save regs in the stack frame. */ _try { _asm { push ebx push ecx push edx mov eax, regs.dw0 cpuid mov regs.dw0, eax mov regs.dw1, ebx mov regs.dw2, ecx mov regs.dw3, edx pop edx pop ecx pop ebx } /* * Copy regs back out to the caller. */ regsPtr[0] = regs.dw0; regsPtr[1] = regs.dw1; regsPtr[2] = regs.dw2; regsPtr[3] = regs.dw3; status = TCL_OK; } __except(EXCEPTION_EXECUTE_HANDLER) { /* do nothing */ } #else (void)index; (void)regsPtr; /* * Don't know how to do assembly code for this compiler and/or * architecture. */ #endif return status; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tclUuid.h.in0000644000175000017500000000003315076154273014540 0ustar sergeisergei#define TCL_VERSION_UUID \ tcl9.0.3/win/tcltest.rc0000644000175000017500000000340315104661342014355 0ustar sergeisergei// // Version Resource Script // #include #include // // build-up the name suffix that defines the type of build this is. // #if STATIC_BUILD #define SUFFIX_STATIC "s" #else #define SUFFIX_STATIC "" #endif #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Tcltest Application\0" VALUE "OriginalFilename", "tcltest" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".exe\0" VALUE "FileVersion", TCL_PATCH_LEVEL VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" VALUE "ProductName", "Tcl " TCL_VERSION " for Windows\0" VALUE "ProductVersion", TCL_PATCH_LEVEL END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END // // Icon // tclsh ICON DISCARDABLE "tclsh.ico" // // This is needed for Windows 8.1 onwards. // #ifndef RT_MANIFEST #define RT_MANIFEST 24 #endif #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 #endif CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "tclsh.exe.manifest" tcl9.0.3/win/tclsh.rc0000644000175000017500000000337715104661342014022 0ustar sergeisergei// // Version Resource Script // #include #include // // build-up the name suffix that defines the type of build this is. // #if STATIC_BUILD #define SUFFIX_STATIC "s" #else #define SUFFIX_STATIC "" #endif #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif #define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_APP FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Tclsh Application\0" VALUE "OriginalFilename", "tclsh" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".exe\0" VALUE "FileVersion", TCL_PATCH_LEVEL VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" VALUE "ProductName", "Tcl " TCL_VERSION " for Windows\0" VALUE "ProductVersion", TCL_PATCH_LEVEL END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END // // Icon // tclsh ICON DISCARDABLE "tclsh.ico" // // This is needed for Windows 8.1 onwards. // #ifndef RT_MANIFEST #define RT_MANIFEST 24 #endif #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 #endif CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "tclsh.exe.manifest" tcl9.0.3/win/tclsh.ico0000644000175000017500000015727615076154273014210 0ustar sergeisergei @@ (B00 %B  h Ny hւ00>  Hhַ00> hV(@ Y7 %000003%N { .~+m@/qsnR2% +*+)mC#e4\/mC#e4e4c3  mC#e4e4e4e4 bı-kB"e4e4e4e4`1;}}zp]9U4e4e4e4e4e4yK'dd_j9V-:$٤e4e4e4e4e4e4 g ŷe4e4! ڤe4e4e4e4`1c3N( îe4e4 e4e4e4e4X. . 552®e4e4+b3e4e4e4e47"LLIðe4e4{K'uH%e4e4e4e4d3q5GFCŴe4e4e4:$٤e4e4e4e4e4rF$ E&%#Ƕe4e4e4 e4e4e4e4e4e4 ! ɺe4e4e4`;Z.e4e4e4e4e4\0Ve4e4e4d3\9e4e4e4e4e4e4 qDe4e4e4 " ٤e4e4e4e4e4e4[/\bb^{e4e4e4F,d3e4e4e4e4e4e4nĴe4e4e4[/|L'e4e4e4e4e4e4Y.\ e4e4e4e4 +ؤe4e4e4e4e4e4e4 ^^ZsGe4e4e4rG$]0e4e4e4e4e4e4P)6e4e4e4e4H,ܤe4e4e4e4e4e4e40ʼvJȾtHe4\:c3e4e4e4e4e4e4c= [[Wfe4e4e? e4e4e4e4e4e4d4c}ve4e4G, e4e4e4e4e4e4e4A)''%e4e4c3O)e4e4e4e4e4e4b2,Ƶe4e4e43( ؤe4e4e4e4e4e4e4% @^^Zg6e4e4a1Y.e4e4e4e4e4e4Z.21/pe4e4e4A(5!٤e4e4e4e4e4e4e4 XȺe4e4e4e4\/e4e4e4e4xK& [[XxMe4e4e4Q*;$٤e4e4e4e4e46ǻe4e4e4e4,]0e4e4e4e4^/-stp`e4e4e4d4B(ۤe4e4e4e4e4f? 'Ʒe4e4e4e4^0 ښ_1e4e4e4e4e4U"" e4e4e4e4}M'P1٤e4e4e4e4e4|L' lmi[e4]e4e4N(פe4e4e4e4e4e4.n@we4e4e4e4e4e4e4e43 :dg6e4e4e4e4e4e4e4Z.x 酈e4e4e4e4e4e4e4e3/0, rEe4e4e4e4e4e4e4 GGDǸg6e4e4e4e4e4e4 mnjĴe4e4e4e4e4e4" t~f5e4e4e4e4-HJFsGe4e4e41 Y\V힓k 不8"wI&n,Ҥe4c3 J ! Ӥe4e4e4 *)&DZ% פe4e4e4T+)VWShicrR1 ܤe4e4e4e4099<;7k S3פe4e4e4b4ïe4e4e4C*c3e4e4e4d= .$#![j:pCb3T+e4e4e4d4w/]\Wűe4e4e4e4e4e4" Nxwr{Qe4e4e4e4e4e> viie ĸe4e4e4e4e4zL'KKH𼠄e4e4e4e4V-LBB>me4e4e4b2Z22/츢e4e4e4 P UTL䛁ef5$))z,?????( @ Ghhhh2>$ %#  ґZ. ٤e4e4 jg,+)譬ɴ e4e4V-|vsmuC)e4e4h@! [,lO)]0e4S+pe4`;ؤe4e4  gc]e4! $ Τe4e4\/"Y42.̺e4jA!e4e4e46!e4c3{M'e4e4b3I|Se4/ Ϥe4e4e45!a2/,ê]/U,e4e4]/\YS⼰e4" ,ˤe4e4e4 |e4X-]0e4e4Q*){olgee46!>&ˤe4e4rF%C4 e4d4 Ǟa2e4N).xuowe4W-^:Ϥe4e4;$&鸞qDl=O(ؤe4e4a2Ji9e4e4e4.qRQMe4e4e48"^NMGYe4e4I-f983浔ve4[8k VQI]J7pho??(0 JFjCAk  '&$!h@!׀O)eppkƷ [8Фe4H,]~èW5L/ʤe4P1¦Z. ˤe4Q* ǯe4 ңd4e4 @ƽe4|L'e4[/q}wm?e> +ˤe4e4,^,)&ȷ[ԗ]0e4Z. HFBP1=%ʤe4e4(S¦c3 ўa2e4xJ&Cgd\oB~M(V5̤e4=&ڼe4e> ɣd4e4  M.-)漢]a2e4V5IrXWR꓏h8e4Y.Ơ{e4b2vpd~XY????(  Y-xMKD7ۇEǝۇEU3ǝۇEمDǝǝۇEQ2# ǝۇEۇEǝǝۇE ǝc=ۇEU4ǝǝZ.ۇEǝǝۇE&*(ǝK&&#??(0` 8"wI&,e4c3 ! e4e4e4 *)&DZ% e4e4e4T+VWShicrR1 e4e4e4e40<;7k S3e4e4e4b4ïe4e4e4C*c3e4e4e4d= $#!㯂[j:pCb3T+e4e4e4d4]\Wűe4e4e4e4e4e4" xwr淺{Qe4e4e4e4e4e> iie ĸe4e4e4e4e4zL'KKHe4e4e4e4V-BB>me4e4e4b222/e4e4e4 UTLef5?????( @ %#  Z. e4e4 ,+)ɴ e4e4V-vsmuC)e4e4h@! lO)]0e4S+pe4`;e4e4  gc]e4! $ e4e4\/42.̺e4jA!e4e4e46!Ǥe4c3{M'e4e4b3|Se4/ e4e4e45!2/,ê]/U,e4e4]/\YSe4" ,e4e4e4 e4X-]0e4e4Q*olgee46!>&e4e4rF% e4d4 a2e4N)xuowe4W-^:e4e4;$qDl=O(e4e4a2i9e4e4e4RQMe4e4e48"NMGYe4e4I-983ve4[8 VQI]J7??(0 &$!h@!O)ppkƷ [8e4H,èW5L/e4P1¦Z. e4Q*ǯe4 d4e4 ƽe4|L'e4[/}wm?e> +e4e4,,)&ȷ[]0e4Z. HFBP1=%e4e4c3 a2e4xJ&gd\oB~M(V5e4=&e4e> d4e4 .-)]a2e4V5XWRh8e4Y.{e4b2vpd~X????( MKDۇEǝۇEU3ǝۇEمDǝǝۇEQ2 ǝۇEۇEǝǝۇE ǝc=ۇEU4ǝǝZ.ۇEǝǝۇE&*(ǝ&&#??(0`           ! ! " % ' ) ,6!8":$$#!'&#@()'$B)C**)&J-L/M/N0R1S3U422/d= <;7e> h@!pD$BB>sG$FD@wI&HFB|L'}M(LJFKKHP)T*T+T+V-W-UTLWUOZ/VWS\/\/]/_1`1]\Wa2a2b2b2b3b4c3c3c4d3d4e4e4f5f6j:j:k<igchiciiemkfpCrEqpjyN{Q{R{zve[|kmmrìïűDZĸȹ˼˽}$= "_Z __^ ,___Lfv1____6d ___D?J_\___Hk__E___h__-0___P>__K____'l__V___Yw__;____3~__@#_____A___\____q__/8_____{|jn[_____.&,+)2/,42.[8983jA!{M'N)O(O)NMGQ*S+VQIRQMU,V-W-X-Z.\/]/]0]0a2b3c3d4e4e4gc]i9l=olgqDvsmxuo|SYelpvuwêɴ̺ ^2_] <<TW <<<<-R<<<)E<<#L<",??/#(0   +,=%&$!=&,)&L/.-)P1V5e> h@!HFBxJ&|L'~M(O)Q*Z.[/]0a2a2b2c3d4e4e4h8gd\m?oBvpdppk~X}w[]{¦èǯȷƽƷB 1A + <+;"+!>+)+ @++#3. ++ ?4$+:++8(&+-/+=+)*95%+7,+6+'02 ?//C##??(  &&#&*(Q2U3U4c=MKDZ.مDۇEǝ          ????tcl9.0.3/win/tclsh.exe.manifest.in0000644000175000017500000000306515104661342016403 0ustar sergeisergei Tcl command line shell (tclsh) true tcl9.0.3/win/tclooConfig.sh0000644000175000017500000000140315104661342015145 0ustar sergeisergei# tclooConfig.sh -- # # This shell script (for sh) is generated automatically by TclOO's configure # script, or would be except it has no values that we substitute. It will # create shell variables for most of the configuration options discovered by # the configure script. This script is intended to be included by TEA-based # configure scripts for TclOO extensions so that they don't have to figure # this all out for themselves. # # The information in this file is specific to a single platform. # These are mostly empty because no special steps are ever needed from Tcl 8.6 # onwards; all libraries and include files are just part of Tcl. TCLOO_LIB_SPEC="" TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" TCLOO_VERSION=1.3 tcl9.0.3/win/tclConfig.sh.in0000644000175000017500000001410015104661342015212 0ustar sergeisergei# tclConfig.sh -- # # This shell script (for sh) is generated automatically by Tcl's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Tcl extensions so that they don't have to figure this all # out for themselves. # # The information in this file is specific to a single platform. TCL_DLL_FILE="@TCL_DLL_FILE@" # Tcl's version number. TCL_VERSION='@TCL_VERSION@' TCL_MAJOR_VERSION='@TCL_MAJOR_VERSION@' TCL_MINOR_VERSION='@TCL_MINOR_VERSION@' TCL_PATCH_LEVEL='@TCL_PATCH_LEVEL@' # C compiler to use for compilation. TCL_CC='@CC@' # -D flags for use with the C compiler. TCL_DEFS='@DEFS@' # Default flags used in an optimized and debuggable build, respectively. TCL_CFLAGS_DEBUG='@CFLAGS_DEBUG@' TCL_CFLAGS_OPTIMIZE='@CFLAGS_OPTIMIZE@' # Default linker flags used in an optimized and debuggable build, respectively. TCL_LDFLAGS_DEBUG='@LDFLAGS_DEBUG@' TCL_LDFLAGS_OPTIMIZE='@LDFLAGS_OPTIMIZE@' # Flag, 1: we built a shared lib, 0 we didn't TCL_SHARED_BUILD=@TCL_SHARED_BUILD@ # The name of the Tcl library (may be either a .a file or a shared library): TCL_LIB_FILE='@TCL_LIB_FILE@' # The name of a zip containing the /library and /encodings (may be either a .zip file or a shared library): TCL_ZIP_FILE='@TCL_ZIP_FILE@' # Flag to indicate whether shared libraries need export files. TCL_NEEDS_EXP_FILE='' # Additional libraries to use when linking Tcl. TCL_LIBS='@LIBS@' # Top-level directory in which Tcl's platform-independent files are # installed. TCL_PREFIX='@prefix@' # Top-level directory in which Tcl's platform-specific files (e.g. # executables) are installed. TCL_EXEC_PREFIX='@exec_prefix@' # Flags to pass to cc when compiling the components of a shared library: TCL_SHLIB_CFLAGS='@SHLIB_CFLAGS@' # Flags to pass to cc to get warning messages TCL_CFLAGS_WARNING='@CFLAGS_WARNING@' # Extra flags to pass to cc: TCL_EXTRA_CFLAGS='@EXTRA_CFLAGS@' # Base command to use for combining object files into a shared library: TCL_SHLIB_LD='@SHLIB_LD@' # Base command to use for combining object files into a static library: TCL_STLIB_LD='@STLIB_LD@' # Either '$LIBS' (if dependent libraries should be included when linking # shared libraries) or an empty string. See Tcl's configure.ac for more # explanation. TCL_SHLIB_LD_LIBS='@SHLIB_LD_LIBS@' # Suffix to use for the name of a shared library. TCL_SHLIB_SUFFIX='@SHLIB_SUFFIX@' # Library file(s) to include in tclsh and other base applications # in order to provide facilities needed by DLOBJ above. TCL_DL_LIBS='' # Flags to pass to the compiler when linking object files into # an executable tclsh or tcltest binary. TCL_LD_FLAGS='@LDFLAGS@' # Flags to pass to cc/ld, such as "-R /usr/local/tcl/lib", that tell the # run-time dynamic linker where to look for shared libraries such as # libtcl.so. Used when linking applications. Only works if there # is a variable "LIB_RUNTIME_DIR" defined in the Makefile. TCL_CC_SEARCH_FLAGS='' TCL_LD_SEARCH_FLAGS='' # Additional object files linked with Tcl to provide compatibility # with standard facilities from ANSI C or POSIX. TCL_COMPAT_OBJS='@LIBOBJS@' # Name of the ranlib program to use. TCL_RANLIB='@RANLIB@' # -l flag to pass to the linker to pick up the Tcl library TCL_LIB_FLAG='@TCL_LIB_FLAG@' # String to pass to linker to pick up the Tcl library from its # build directory. TCL_BUILD_LIB_SPEC='@TCL_BUILD_LIB_SPEC@' # String to pass to linker to pick up the Tcl library from its # installed directory. TCL_LIB_SPEC='@TCL_LIB_SPEC@' # String to pass to the compiler so that an extension can # find installed Tcl headers. TCL_INCLUDE_SPEC='@TCL_INCLUDE_SPEC@' # Indicates whether a version numbers should be used in -l switches # ("ok" means it's safe to use switches like -ltcl7.5; "nodots" means # use switches like -ltcl75). SunOS and FreeBSD require "nodots", for # example. TCL_LIB_VERSIONS_OK='nodots' # String that can be evaluated to generate the part of a shared library # name that comes after the "libxxx" (includes version number, if any, # extension, and anything else needed). May depend on the variables # VERSION and SHLIB_SUFFIX. On most UNIX systems this is # ${VERSION}${SHLIB_SUFFIX}. TCL_SHARED_LIB_SUFFIX='@CFG_TCL_SHARED_LIB_SUFFIX@' # String that can be evaluated to generate the part of an unshared library # name that comes after the "libxxx" (includes version number, if any, # extension, and anything else needed). May depend on the variable # VERSION. On most UNIX systems this is ${VERSION}.a. TCL_UNSHARED_LIB_SUFFIX='@CFG_TCL_UNSHARED_LIB_SUFFIX@' # Location of the top-level source directory from which Tcl was built. # This is the directory that contains a README file as well as # subdirectories such as generic, unix, etc. If Tcl was compiled in a # different place than the directory containing the source files, this # points to the location of the sources, not the location where Tcl was # compiled. TCL_SRC_DIR='@TCL_SRC_DIR@' # List of standard directories in which to look for packages during # "package require" commands. Contains the "prefix" directory plus also # the "exec_prefix" directory, if it is different. TCL_PACKAGE_PATH='@TCL_PACKAGE_PATH@' # Tcl supports stub. TCL_SUPPORTS_STUBS=1 # The name of the Tcl stub library (.a): TCL_STUB_LIB_FILE='@TCL_STUB_LIB_FILE@' # -l flag to pass to the linker to pick up the Tcl stub library TCL_STUB_LIB_FLAG='@TCL_STUB_LIB_FLAG@' # String to pass to linker to pick up the Tcl stub library from its # build directory. TCL_BUILD_STUB_LIB_SPEC='@TCL_BUILD_STUB_LIB_SPEC@' # String to pass to linker to pick up the Tcl stub library from its # installed directory. TCL_STUB_LIB_SPEC='@TCL_STUB_LIB_SPEC@' # Path to the Tcl stub library in the build directory. TCL_BUILD_STUB_LIB_PATH='@TCL_BUILD_STUB_LIB_PATH@' # Path to the Tcl stub library in the install directory. TCL_STUB_LIB_PATH='@TCL_STUB_LIB_PATH@' # Name of the zlib library that extensions should use TCL_ZLIB_LIB_NAME='@TCL_ZLIB_LIB_NAME@' # Name of the tommath library that extensions should use TCL_TOMMATH_LIB_NAME='@TCL_TOMMATH_LIB_NAME@' tcl9.0.3/win/tclAppInit.c0000644000175000017500000001265415104661342014570 0ustar sergeisergei/* * tclAppInit.c -- * * Provides a default version of the main program and Tcl_AppInit * procedure for tclsh and other Tcl-based applications (without Tk). * Note that this program must be built in Win32 console mode to work * properly. * * Copyright (c) 1993 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tcl.h" #if TCL_MAJOR_VERSION < 9 # if defined(USE_TCL_STUBS) # error "Don't build with USE_TCL_STUBS!" # endif # define Tcl_LibraryInitProc Tcl_PackageInitProc # define Tcl_StaticLibrary Tcl_StaticPackage #endif #ifdef TCL_TEST #ifdef __cplusplus extern "C" { #endif extern Tcl_LibraryInitProc Tcltest_Init; extern Tcl_LibraryInitProc Tcltest_SafeInit; #ifdef __cplusplus } #endif #endif /* TCL_TEST */ #if defined(STATIC_BUILD) extern Tcl_LibraryInitProc Registry_Init; extern Tcl_LibraryInitProc Dde_Init; extern Tcl_LibraryInitProc Dde_SafeInit; #endif #define WIN32_LEAN_AND_MEAN #define STRICT /* See MSDN Article Q83456 */ #include #undef STRICT #undef WIN32_LEAN_AND_MEAN #include #include #include #if defined(__GNUC__) int _CRT_glob = 0; #endif /* __GNUC__ */ /* * The following #if block allows you to change the AppInit function by using * a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The * #if checks for that #define and uses Tcl_AppInit if it does not exist. */ #ifndef TCL_LOCAL_APPINIT #define TCL_LOCAL_APPINIT Tcl_AppInit #endif #ifndef MODULE_SCOPE # define MODULE_SCOPE extern #endif MODULE_SCOPE int TCL_LOCAL_APPINIT(Tcl_Interp *); /* * The following #if block allows you to change how Tcl finds the startup * script, prime the library or encoding paths, fiddle with the argv, etc., * without needing to rewrite Tcl_Main() */ #ifdef TCL_LOCAL_MAIN_HOOK MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv); #endif /* *---------------------------------------------------------------------- * * main -- * * This is the main program for the application. * * Results: * None: Tcl_Main never returns here, so this procedure never returns * either. * * Side effects: * Just about anything, since from here we call arbitrary Tcl code. * *---------------------------------------------------------------------- */ int _tmain( int argc, /* Number of command-line arguments. */ TCHAR *argv[]) /* Values of command-line arguments. */ { TCHAR *p; /* * Set up the default locale to be standard "C" locale so parsing is * performed correctly. */ setlocale(LC_ALL, "C"); /* * Forward slashes substituted for backslashes. */ for (p = argv[0]; *p != '\0'; p++) { if (*p == '\\') { *p = '/'; } } #ifdef TCL_LOCAL_MAIN_HOOK TCL_LOCAL_MAIN_HOOK(&argc, &argv); #elif TCL_MAJOR_VERSION > 8 && (!defined(_WIN32) || defined(UNICODE)) /* New in Tcl 9.0. This doesn't work on Windows without UNICODE */ TclZipfs_AppHook(&argc, &argv); #endif Tcl_Main(argc, argv, TCL_LOCAL_APPINIT); return 0; /* Needed only to prevent compiler warning. */ } /* *---------------------------------------------------------------------- * * Tcl_AppInit -- * * This procedure performs application-specific initialization. Most * applications, especially those that incorporate additional packages, * will have their own version of this procedure. * * Results: * Returns a standard Tcl completion code, and leaves an error message in * the interp's result if an error occurs. * * Side effects: * Depends on the startup script. * *---------------------------------------------------------------------- */ int Tcl_AppInit( Tcl_Interp *interp) /* Interpreter for application. */ { if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #if defined(STATIC_BUILD) if (Registry_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticLibrary(interp, "Registry", Registry_Init, NULL); if (Dde_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticLibrary(interp, "Dde", Dde_Init, Dde_SafeInit); #endif #ifdef TCL_TEST if (Tcltest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticLibrary(interp, "Tcltest", Tcltest_Init, Tcltest_SafeInit); #endif /* TCL_TEST */ /* * Call the init procedures for included packages. Each call should look * like this: * * if (Mod_Init(interp) == TCL_ERROR) { * return TCL_ERROR; * } * * where "Mod" is the name of the module. (Dynamically-loadable packages * should have the same entry-point name.) */ /* * Call Tcl_CreateObjCommand for application-specific commands, if they * weren't already created by the init procedures called above. */ /* * Specify a user-specific startup file to invoke if the application is * run interactively. Typically the startup file is "~/.apprc" where "app" * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ (void)Tcl_EvalEx(interp, "set tcl_rcFileName [file tildeexpand ~/tclshrc.tcl]", TCL_AUTO_LENGTH, TCL_EVAL_GLOBAL); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/win/tcl.rc0000644000175000017500000000254215104661342013460 0ustar sergeisergei// // Version Resource Script // #include #include // // build-up the name suffix that defines the type of build this is. // #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif #define SUFFIX SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ VS_VERSION_INFO VERSIONINFO FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */ BEGIN VALUE "FileDescription", "Tcl DLL\0" VALUE "OriginalFilename", "tcl" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".dll\0" VALUE "FileVersion", TCL_PATCH_LEVEL VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0" VALUE "ProductName", "Tcl " TCL_VERSION " for Windows\0" VALUE "ProductVersion", TCL_PATCH_LEVEL END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END tcl9.0.3/win/tcl.m40000644000175000017500000011014215104661342013370 0ustar sergeisergei#------------------------------------------------------------------------ # SC_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TCLCONFIG], [ # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [with_tclconfig="${withval}"]) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /cygdrive/c/Tcl/lib 2>/dev/null` \ `ls -d /cygdrive/c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d /c/Tcl/lib 2>/dev/null` \ `ls -d /c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh]) else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # SC_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AS_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), [with_tkconfig="${withval}"]) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case "${with_tkconfig}" in */tkConfig.sh ) if test -f "${with_tkconfig}"; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /cygdrive/c/Tcl/lib 2>/dev/null` \ `ls -d /cygdrive/c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d /c/Tcl/lib 2>/dev/null` \ `ls -d /c/Progra~1/Tcl/lib 2>/dev/null` \ `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh]) else no_tk= TK_BIN_DIR="${ac_cv_c_tkconfig}" AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # SC_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file. # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Substitutes the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_DEFS) ]) #------------------------------------------------------------------------ # SC_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) ]) #------------------------------------------------------------------------ # SC_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, [ --enable-shared build and link with shared libraries (default: on)], [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging # can also be enabled. # # Arguments: # none # # Requires the following vars to be set in the Makefile: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED) else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?]) AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem compile debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # NOTE: The backslashes in quotes below are substituted twice # due to the fact that they are in a macro and then inlined # in the final configure script. # # Arguments: # none # # Results: # # Can the following vars: # EXTRA_CFLAGS # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # CFLAGS_WARNING # CFLAGS_NOLTO # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # LDFLAGS_CONSOLE # LDFLAGS_WINDOW # CC_OBJNAME # CC_EXENAME # CYGPATH # STLIB_LD # SHLIB_LD # SHLIB_LD_LIBS # LIBS # AR # RC # RES # # MAKE_LIB # MAKE_STUB_LIB # MAKE_EXE # MAKE_DLL # # LIBSUFFIX # LIBFLAGSUFFIX # LIBPREFIX # LIBRARIES # EXESUFFIX # DLLSUFFIX # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_CFLAGS], [ # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT($do64bit) # Set some defaults (may get changed below) EXTRA_CFLAGS="" AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) AC_CHECK_PROG(WINE, wine, wine,) SHLIB_SUFFIX=".dll" # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|arm64|ia64. MACHINE="X86" if test "$GCC" = "yes"; then AC_CACHE_CHECK(for cross-compile version of gcc, ac_cv_cross, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifndef _WIN32 #error cross-compiler #endif ]], [[]])], [ac_cv_cross=no], [ac_cv_cross=yes]) ) if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-${CC}" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; arm64|aarch64) CC="aarch64-w64-mingw32-${CC}" LD="aarch64-w64-mingw32-ld" AR="aarch64-w64-mingw32-ar" RANLIB="aarch64-w64-mingw32-ranlib" RC="aarch64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi fi # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires # Windows native paths while Cygwin should work # with both. Avoid the bug by passing a POSIX # path when using the Cygwin toolchain. if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then conftest=/tmp/conftest.rc echo "STRINGTABLE BEGIN" > $conftest echo "101 \"name\"" >> $conftest echo "END" >> $conftest AC_MSG_CHECKING([for Windows native path bug in windres]) cyg_conftest=`$CYGPATH $conftest` if AC_TRY_COMMAND($RC -o conftest.res.o $cyg_conftest) ; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) CYGPATH=echo fi conftest= cyg_conftest= fi if test "$CYGPATH" = "echo"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' fi # set various compiler flags depending on whether we are using gcc or cl if test "${GCC}" = "yes" ; then extra_cflags="-pipe" extra_ldflags="-pipe -static-libgcc" AC_CACHE_CHECK(for mingw32 version of gcc, ac_cv_win32, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef _WIN32 #error win32 #endif ]], [[]])], [ac_cv_win32=no], [ac_cv_win32=yes]) ) if test "$ac_cv_win32" != "yes"; then AC_MSG_ERROR([${CC} cannot produce win32 executables.]) fi if test "$do64bit" != "arm64" -a "$do64bit" != "aarch64"; then extra_cflags="$extra_cflags -DHAVE_CPUID=1" fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" AC_CACHE_CHECK(for working -municode linker flag, ac_cv_municode, AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} ]], [[]])], [ac_cv_municode=yes], [ac_cv_municode=no]) ) CFLAGS=$hold_cflags if test "$ac_cv_municode" = "yes" ; then extra_ldflags="$extra_ldflags -municode" fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" AC_CACHE_CHECK(for working -fno-lto, ac_cv_nolto, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ac_cv_nolto=yes], [ac_cv_nolto=no]) ) CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi AC_CACHE_CHECK([if the linker understands --disable-high-entropy-va], tcl_cv_ld_high_entropy, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--disable-high-entropy-va" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_ld_high_entropy=yes],[tcl_cv_ld_high_entropy=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_ld_high_entropy = yes; then extra_ldflags="$extra_ldflags -Wl,--disable-high-entropy-va" fi AC_CACHE_CHECK([if the compiler understands -finput-charset], tcl_cv_cc_input_charset, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_input_charset=yes],[tcl_cv_cc_input_charset=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_input_charset = yes; then extra_cflags="$extra_cflags -finput-charset=UTF-8" fi fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--enable-auto-image-base" AC_CACHE_CHECK(for working --enable-auto-image-base, ac_cv_enable_auto_image_base, AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [ac_cv_enable_auto_image_base=yes], [ac_cv_enable_auto_image_base=no]) ) CFLAGS=$hold_cflags if test "$ac_cv_enable_auto_image_base" = "yes" ; then extra_ldflags="$extra_ldflags -Wl,--enable-auto-image-base" fi AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32 -lwinspool" STLIB_LD='${AR} cr' RC_OUT=-o RC_TYPE= RC_INCLUDE=--include RC_DEFINE=--define RES=res.o MAKE_LIB="\${STLIB_LD} \[$]@" MAKE_STUB_LIB="\${STLIB_LD} \[$]@" POST_MAKE_LIB="\${RANLIB} \[$]@" MAKE_EXE="\${CC} -o \[$]@" LIBPREFIX="lib" if test "${SHARED_BUILD}" = "0" ; then # static AC_MSG_RESULT([using static flags]) runtime= LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s.exe" else # dynamic AC_MSG_RESULT([using shared flags]) # ad-hoc check to see if CC supports -shared. if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then AC_MSG_ERROR([${CC} does not support the -shared option. You will need to upgrade to a newer version of the toolchain.]) fi runtime= # Add SHLIB_LD_LIBS to the Make rule, not here. EXESUFFIX=".exe" LIBRARIES="\${SHARED_LIBRARIES}" fi # Link with gcc since ld does not link to default libs like # -luser32 and -lmsvcrt by default. SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \ -Wl,--out-implib,\$(patsubst %.dll,lib%.dll.a,\[$]@)" # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX=".dll" LIBSUFFIX=".a" LIBFLAGSUFFIX="" SHLIB_SUFFIX=.dll EXTRA_CFLAGS="${extra_cflags}" CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= case "${CC}" in *++) CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac # Specify the CC output file names based on the target name CC_OBJNAME="-o \[$]@" CC_EXENAME="-o \[$]@" # Specify linker flags depending on the type of app being # built -- Console vs. Window. # # ORIGINAL COMMENT: # We need to pass -e _WinMain@16 so that ld will use # WinMain() instead of main() as the entry point. We can't # use autoconf to check for this case since it would need # to run an executable and that does not work when # cross compiling. Remove this -e workaround once we # require a gcc that does not have this bug. # # MK NOTE: Tk should use a different mechanism. This causes # interesting problems, such as wish dying at startup. #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) ;; arm64|aarch64) MACHINE="ARM64" AC_MSG_RESULT([ Using ARM64 $MACHINE mode]) ;; ia64) MACHINE="IA64" AC_MSG_RESULT([ Using IA64 $MACHINE mode]) ;; *) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifndef _WIN64 #error 32-bit #endif ]], [[]])], [tcl_win_64bit=yes], [tcl_win_64bit=no] ) if test "$tcl_win_64bit" = "yes" ; then do64bit=amd64 MACHINE="AMD64" AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi ;; esac else if test "${SHARED_BUILD}" = "0" ; then # static AC_MSG_RESULT([using static flags]) runtime=-MT LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s.exe" else # dynamic AC_MSG_RESULT([using shared flags]) runtime=-MD # Add SHLIB_LD_LIBS to the Make rule, not here. LIBRARIES="\${SHARED_LIBRARIES}" EXESUFFIX=".exe" case "x`echo \${VisualStudioVersion}`" in x1[[4-9]]*) lflags="${lflags} -nodefaultlib:ucrt.lib" ;; *) ;; esac fi MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@" # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX=".dll" LIBSUFFIX=".lib" LIBFLAGSUFFIX="" if test "$do64bit" != "no" ; then case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; arm64|aarch64) MACHINE="ARM64" ;; ia64) MACHINE="IA64" ;; esac AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in x1[[4-9]]*) LIBS="$LIBS ucrt.lib" ;; *) ;; esac if test "$do64bit" != "no" ; then RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo -MACHINE:${MACHINE}" LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 LIBS="$LIBS bufferoverflowU.lib" else RC="rc" # -Od - no optimization # -WX - warnings as errors CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib winspool.lib" SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}" SHLIB_LD_LIBS='${LIBS}' # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" RC_OUT=-fo RC_TYPE=-r RC_INCLUDE=-i RC_DEFINE=-d RES=res MAKE_LIB="\${STLIB_LD} -out:\[$]@" MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\[$]@" POST_MAKE_LIB= MAKE_EXE="\${CC} -Fe\[$]@" LIBPREFIX="" CFLAGS_DEBUG="${CFLAGS_DEBUG} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" EXTRA_CFLAGS="" CFLAGS_WARNING="-W3" LDFLAGS_DEBUG="-debug" LDFLAGS_OPTIMIZE="-release" # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\[$]@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. if test "${TARGETCPU}" != "X86"; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi if test "$do64bit" != "no" ; then AC_DEFINE(TCL_CFG_DO64BIT) fi if test "${GCC}" = "yes" ; then AC_CACHE_CHECK(for SEH support in compiler, tcl_cv_seh, AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } ]])], [tcl_cv_seh=yes], [tcl_cv_seh=no], [tcl_cv_seh=no]) ) if test "$tcl_cv_seh" = "no" ; then AC_DEFINE(HAVE_NO_SEH, 1, [Defined when mingw does not support SEH]) fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files, tcl_cv_eh_disposition, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN ]], [[ EXCEPTION_DISPOSITION x; ]])], [tcl_cv_eh_disposition=yes], [tcl_cv_eh_disposition=no]) ) if test "$tcl_cv_eh_disposition" = "no" ; then AC_DEFINE(EXCEPTION_DISPOSITION, int, [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. AC_CACHE_CHECK(for cast to union support, tcl_cv_cast_to_union, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ union foo { int i; double d; }; union foo f = (union foo) (int) 0; ]])], [tcl_cv_cast_to_union=yes], [tcl_cv_cast_to_union=no]) ) if test "$tcl_cv_cast_to_union" = "yes"; then AC_DEFINE(HAVE_CAST_TO_UNION, 1, [Defined when compiler supports casting to union type.]) fi fi # DL_LIBS is empty, but then we match the Unix version AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(CFLAGS_NOLTO) ]) #------------------------------------------------------------------------ # SC_WITH_TCL -- # # Location of the Tcl build directory. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the tcl build dir. #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ if test -d ../../tcl9.0$1/win; then TCL_BIN_DEFAULT=../../tcl9.0$1/win else TCL_BIN_DEFAULT=../../tcl9.0/win fi AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.x binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) fi if test ! -f $TCL_BIN_DIR/Makefile; then AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) else echo "building against Tcl binaries in: $TCL_BIN_DIR" fi AC_SUBST(TCL_BIN_DIR) ]) #------------------------------------------------------------------------ # SC_PROG_TCLSH # Locate a tclsh shell installed on the system path. This macro # will only find a Tcl shell that already exists on the system. # It will not find a Tcl shell in the Tcl build directory or # a Tcl shell that has been installed from the Tcl build directory. # If a Tcl shell can't be located on the PATH, then TCLSH_PROG will # be set to "". Extensions should take care not to create Makefile # rules that are run by default and depend on TCLSH_PROG. An # extension can't assume that an executable Tcl shell exists at # build time. # # Arguments # none # # Results # Substitutes the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([SC_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) AC_CACHE_VAL(ac_cv_path_tclsh, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[[8-9]]*.exe 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ]) if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" AC_MSG_RESULT($TCLSH_PROG) else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" AC_MSG_RESULT([No tclsh found on PATH]) fi AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # SC_BUILD_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory. This macro will correctly determine # the name of the tclsh executable even if tclsh has not yet # been built in the build directory. The build tclsh must be used # when running tests from an extension build directory. It is not # correct to use the TCLSH_PROG in cases like this. # # Arguments # none # # Results # Substitutes the following values: # BUILD_TCLSH #------------------------------------------------------------------------ AC_DEFUN([SC_BUILD_TCLSH], [ AC_MSG_CHECKING([for tclsh in Tcl build directory]) BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}\${EXESUFFIX} AC_MSG_RESULT($BUILD_TCLSH) AC_SUBST(BUILD_TCLSH) ]) #-------------------------------------------------------------------- # SC_TCL_CFG_ENCODING TIP #59 # # Declare the encoding to use for embedded configuration information. # # Arguments: # None. # # Results: # Might append to the following vars: # DEFS (implicit) # # Will define the following vars: # TCL_CFGVAL_ENCODING # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}") else AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8") fi ]) #-------------------------------------------------------------------- # SC_EMBED_MANIFEST # # Figure out if we can embed the manifest where necessary # # Arguments: # An optional manifest to merge into DLL/EXE. # # Results: # Will define the following vars: # VC_MANIFEST_EMBED_DLL # VC_MANIFEST_EMBED_EXE # #-------------------------------------------------------------------- AC_DEFUN([SC_EMBED_MANIFEST], [ AC_MSG_CHECKING(whether to embed manifest) AC_ARG_ENABLE(embedded-manifest, AS_HELP_STRING([--enable-embedded-manifest], [embed manifest if possible (default: yes)]), [embed_ok=$enableval], [embed_ok=yes]) VC_MANIFEST_EMBED_DLL= VC_MANIFEST_EMBED_EXE= result=no if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \ -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe AC_EGREP_CPP([manifest needed], [ #if defined(_MSC_VER) && _MSC_VER >= 1400 print("manifest needed") #endif ], [ # Could do a CHECK_PROG for mt, but should always be with MSVC8+ # Could add 'if test -f' check, but manifest should be created # in this compiler case # Add in a manifest argument that may be specified # XXX Needs improvement so that the test for existence accounts # XXX for a provided (known) manifest VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;2 ; fi" VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;1 ; fi" result=yes if test "x$1" != x ; then result="yes ($1)" fi ]) fi AC_MSG_RESULT([$result]) AC_SUBST(VC_MANIFEST_EMBED_DLL) AC_SUBST(VC_MANIFEST_EMBED_EXE) ]) #------------------------------------------------------------------------ # SC_CC_FOR_BUILD # For cross compiles, locate a C compiler that can generate native binaries. # # Arguments: # none # # Results: # Substitutes the following vars: # CC_FOR_BUILD # EXEEXT_FOR_BUILD #------------------------------------------------------------------------ dnl Get a default for CC_FOR_BUILD to put into Makefile. AC_DEFUN([AX_CC_FOR_BUILD], [# Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else AC_MSG_CHECKING([for gcc]) AC_CACHE_VAL(ac_cv_path_cc, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/gcc 2> /dev/null` \ `ls -r $dir/gcc 2> /dev/null` ; do if test x"$ac_cv_path_cc" = x ; then if test -f "$j" ; then ac_cv_path_cc=$j break fi fi done done ]) fi fi AC_SUBST(CC_FOR_BUILD) # Also set EXEEXT_FOR_BUILD. if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, [rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; esac done rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi AC_SUBST(EXEEXT_FOR_BUILD)])dnl AC_SUBST(OBJEXT_FOR_BUILD)])dnl #------------------------------------------------------------------------ # SC_ZIPFS_SUPPORT # Locate a zip encoder installed on the system path, or none. # # Arguments: # none # # Results: # Substitutes the following vars: # ZIP_PROG # ZIP_PROG_OPTIONS # ZIP_PROG_VFSSEARCH # ZIP_INSTALL_OBJS #------------------------------------------------------------------------ AC_DEFUN([SC_ZIPFS_SUPPORT], [ ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" AC_MSG_CHECKING([for zip]) AC_CACHE_VAL(ac_cv_path_zip, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ]) if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" AC_MSG_RESULT([$ZIP_PROG]) ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" AC_MSG_RESULT([Found INFO Zip in environment]) # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" AC_MSG_RESULT([No zip found on PATH building minizip]) fi AC_SUBST(ZIP_PROG) AC_SUBST(ZIP_PROG_OPTIONS) AC_SUBST(ZIP_PROG_VFSSEARCH) AC_SUBST(ZIP_INSTALL_OBJS) ]) tcl9.0.3/win/tcl.dsw0000644000175000017500000000102115035744306013645 0ustar sergeisergeiMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "tcl"=.\tcl.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### tcl9.0.3/win/tcl.dsp0000644000175000017500000006630515104661342013651 0ustar sergeisergei# Microsoft Developer Studio Project File - Name="tcl" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 CFG=tcl - Win32 Debug Static !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "tcl.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "tcl.mak" CFG="tcl - Win32 Debug Static" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "tcl - Win32 Release" (based on "Win32 (x86) External Target") !MESSAGE "tcl - Win32 Debug" (based on "Win32 (x86) External Target") !MESSAGE "tcl - Win32 Debug Static" (based on "Win32 (x86) External Target") !MESSAGE "tcl - Win32 Release Static" (based on "Win32 (x86) External Target") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "tcl - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release\tcl_Dynamic" # PROP BASE Cmd_Line "nmake -nologo -f makefile.vc MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Release\tclsh90.exe" # PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release\tcl_Dynamic" # PROP Cmd_Line "nmake -nologo -f makefile.vc MSVCDIR=IDE" # PROP Rebuild_Opt "clean release" # PROP Target_File "Release\tclsh90t.exe" # PROP Bsc_Name "" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "tcl - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug\tcl_Dynamic" # PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Debug\tclsh90g.exe" # PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug\tcl_Dynamic" # PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=threads,symbols MSVCDIR=IDE" # PROP Rebuild_Opt "clean release" # PROP Target_File "Debug\tclsh90tg.exe" # PROP Bsc_Name "" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "tcl - Win32 Debug Static" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug\tcl_Static" # PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Debug\tclsh90sg.exe" # PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug\tcl_Static" # PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static MSVCDIR=IDE" # PROP Rebuild_Opt "-a" # PROP Target_File "Debug\tclsh90sg.exe" # PROP Bsc_Name "" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "tcl - Win32 Release Static" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release\tcl_Static" # PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=static MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Release\tclsh90s.exe" # PROP BASE Bsc_Name "" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release\tcl_Static" # PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=static MSVCDIR=IDE" # PROP Rebuild_Opt "-a" # PROP Target_File "Release\tclsh90s.exe" # PROP Bsc_Name "" # PROP Target_Dir "" !ENDIF # Begin Target # Name "tcl - Win32 Release" # Name "tcl - Win32 Debug" # Name "tcl - Win32 Debug Static" # Name "tcl - Win32 Release Static" !IF "$(CFG)" == "tcl - Win32 Release" !ELSEIF "$(CFG)" == "tcl - Win32 Debug" !ELSEIF "$(CFG)" == "tcl - Win32 Debug Static" !ELSEIF "$(CFG)" == "tcl - Win32 Release Static" !ENDIF # Begin Group "compat" # PROP Default_Filter "" # Begin Source File SOURCE=..\compat\dlfcn.h # End Source File # Begin Source File SOURCE=..\compat\gettod.c # End Source File # Begin Source File SOURCE=..\compat\limits.h # End Source File # Begin Source File SOURCE=..\compat\README # End Source File # Begin Source File SOURCE=..\compat\string.h # End Source File # End Group # Begin Group "doc" # PROP Default_Filter "" # Begin Source File SOURCE=..\doc\Access.3 # End Source File # Begin Source File SOURCE=..\doc\AddErrInfo.3 # End Source File # Begin Source File SOURCE=..\doc\after.n # End Source File # Begin Source File SOURCE=..\doc\Alloc.3 # End Source File # Begin Source File SOURCE=..\doc\AllowExc.3 # End Source File # Begin Source File SOURCE=..\doc\append.n # End Source File # Begin Source File SOURCE=..\doc\AppInit.3 # End Source File # Begin Source File SOURCE=..\doc\array.n # End Source File # Begin Source File SOURCE=..\doc\AssocData.3 # End Source File # Begin Source File SOURCE=..\doc\Async.3 # End Source File # Begin Source File SOURCE=..\doc\BackgdErr.3 # End Source File # Begin Source File SOURCE=..\doc\Backslash.3 # End Source File # Begin Source File SOURCE=..\doc\bgerror.n # End Source File # Begin Source File SOURCE=..\doc\binary.n # End Source File # Begin Source File SOURCE=..\doc\BoolObj.3 # End Source File # Begin Source File SOURCE=..\doc\break.n # End Source File # Begin Source File SOURCE=..\doc\ByteArrObj.3 # End Source File # Begin Source File SOURCE=..\doc\CallDel.3 # End Source File # Begin Source File SOURCE=..\doc\catch.n # End Source File # Begin Source File SOURCE=..\doc\cd.n # End Source File # Begin Source File SOURCE=..\doc\ChnlStack.3 # End Source File # Begin Source File SOURCE=..\doc\clock.n # End Source File # Begin Source File SOURCE=..\doc\close.n # End Source File # Begin Source File SOURCE=..\doc\CmdCmplt.3 # End Source File # Begin Source File SOURCE=..\doc\Concat.3 # End Source File # Begin Source File SOURCE=..\doc\concat.n # End Source File # Begin Source File SOURCE=..\doc\continue.n # End Source File # Begin Source File SOURCE=..\doc\CrtChannel.3 # End Source File # Begin Source File SOURCE=..\doc\CrtChnlHdlr.3 # End Source File # Begin Source File SOURCE=..\doc\CrtCloseHdlr.3 # End Source File # Begin Source File SOURCE=..\doc\CrtCommand.3 # End Source File # Begin Source File SOURCE=..\doc\CrtFileHdlr.3 # End Source File # Begin Source File SOURCE=..\doc\CrtInterp.3 # End Source File # Begin Source File SOURCE=..\doc\CrtMathFnc.3 # End Source File # Begin Source File SOURCE=..\doc\CrtObjCmd.3 # End Source File # Begin Source File SOURCE=..\doc\CrtAlias.3 # End Source File # Begin Source File SOURCE=..\doc\CrtTimerHdlr.3 # End Source File # Begin Source File SOURCE=..\doc\CrtTrace.3 # End Source File # Begin Source File SOURCE=..\doc\dde.n # End Source File # Begin Source File SOURCE=..\doc\DetachPids.3 # End Source File # Begin Source File SOURCE=..\doc\DoOneEvent.3 # End Source File # Begin Source File SOURCE=..\doc\DoubleObj.3 # End Source File # Begin Source File SOURCE=..\doc\DoWhenIdle.3 # End Source File # Begin Source File SOURCE=..\doc\DString.3 # End Source File # Begin Source File SOURCE=..\doc\DumpActiveMemory.3 # End Source File # Begin Source File SOURCE=..\doc\Encoding.3 # End Source File # Begin Source File SOURCE=..\doc\encoding.n # End Source File # Begin Source File SOURCE=..\doc\Environment.3 # End Source File # Begin Source File SOURCE=..\doc\eof.n # End Source File # Begin Source File SOURCE=..\doc\error.n # End Source File # Begin Source File SOURCE=..\doc\Eval.3 # End Source File # Begin Source File SOURCE=..\doc\eval.n # End Source File # Begin Source File SOURCE=..\doc\exec.n # End Source File # Begin Source File SOURCE=..\doc\Exit.3 # End Source File # Begin Source File SOURCE=..\doc\exit.n # End Source File # Begin Source File SOURCE=..\doc\expr.n # End Source File # Begin Source File SOURCE=..\doc\ExprLong.3 # End Source File # Begin Source File SOURCE=..\doc\ExprLongObj.3 # End Source File # Begin Source File SOURCE=..\doc\fblocked.n # End Source File # Begin Source File SOURCE=..\doc\fconfigure.n # End Source File # Begin Source File SOURCE=..\doc\fcopy.n # End Source File # Begin Source File SOURCE=..\doc\file.n # End Source File # Begin Source File SOURCE=..\doc\fileevent.n # End Source File # Begin Source File SOURCE=..\doc\filename.n # End Source File # Begin Source File SOURCE=..\doc\FileSystem.3 # End Source File # Begin Source File SOURCE=..\doc\FindExec.3 # End Source File # Begin Source File SOURCE=..\doc\flush.n # End Source File # Begin Source File SOURCE=..\doc\for.n # End Source File # Begin Source File SOURCE=..\doc\foreach.n # End Source File # Begin Source File SOURCE=..\doc\format.n # End Source File # Begin Source File SOURCE=..\doc\GetCwd.3 # End Source File # Begin Source File SOURCE=..\doc\GetHostName.3 # End Source File # Begin Source File SOURCE=..\doc\GetIndex.3 # End Source File # Begin Source File SOURCE=..\doc\GetInt.3 # End Source File # Begin Source File SOURCE=..\doc\GetOpnFl.3 # End Source File # Begin Source File SOURCE=..\doc\gets.n # End Source File # Begin Source File SOURCE=..\doc\GetStdChan.3 # End Source File # Begin Source File SOURCE=..\doc\GetVersion.3 # End Source File # Begin Source File SOURCE=..\doc\glob.n # End Source File # Begin Source File SOURCE=..\doc\global.n # End Source File # Begin Source File SOURCE=..\doc\Hash.3 # End Source File # Begin Source File SOURCE=..\doc\history.n # End Source File # Begin Source File SOURCE=..\doc\http.n # End Source File # Begin Source File SOURCE=..\doc\if.n # End Source File # Begin Source File SOURCE=..\doc\incr.n # End Source File # Begin Source File SOURCE=..\doc\info.n # End Source File # Begin Source File SOURCE=..\doc\Init.3 # End Source File # Begin Source File SOURCE=..\doc\InitStubs.3 # End Source File # Begin Source File SOURCE=..\doc\Interp.3 # End Source File # Begin Source File SOURCE=..\doc\interp.n # End Source File # Begin Source File SOURCE=..\doc\IntObj.3 # End Source File # Begin Source File SOURCE=..\doc\join.n # End Source File # Begin Source File SOURCE=..\doc\lappend.n # End Source File # Begin Source File SOURCE=..\doc\library.n # End Source File # Begin Source File SOURCE=..\doc\lindex.n # End Source File # Begin Source File SOURCE=..\doc\LinkVar.3 # End Source File # Begin Source File SOURCE=..\doc\linsert.n # End Source File # Begin Source File SOURCE=..\doc\list.n # End Source File # Begin Source File SOURCE=..\doc\ListObj.3 # End Source File # Begin Source File SOURCE=..\doc\llength.n # End Source File # Begin Source File SOURCE=..\doc\load.n # End Source File # Begin Source File SOURCE=..\doc\lrange.n # End Source File # Begin Source File SOURCE=..\doc\lreplace.n # End Source File # Begin Source File SOURCE=..\doc\lsearch.n # End Source File # Begin Source File SOURCE=..\doc\lsort.n # End Source File # Begin Source File SOURCE=..\doc\man.macros # End Source File # Begin Source File SOURCE=..\doc\memory.n # End Source File # Begin Source File SOURCE=..\doc\msgcat.n # End Source File # Begin Source File SOURCE=..\doc\namespace.n # End Source File # Begin Source File SOURCE=..\doc\Notifier.3 # End Source File # Begin Source File SOURCE=..\doc\Object.3 # End Source File # Begin Source File SOURCE=..\doc\ObjectType.3 # End Source File # Begin Source File SOURCE=..\doc\open.n # End Source File # Begin Source File SOURCE=..\doc\OpenFileChnl.3 # End Source File # Begin Source File SOURCE=..\doc\OpenTcp.3 # End Source File # Begin Source File SOURCE=..\doc\package.n # End Source File # Begin Source File SOURCE=..\doc\packagens.n # End Source File # Begin Source File SOURCE=..\doc\Panic.3 # End Source File # Begin Source File SOURCE=..\doc\ParseCmd.3 # End Source File # Begin Source File SOURCE=..\doc\pid.n # End Source File # Begin Source File SOURCE=..\doc\pkgMkIndex.n # End Source File # Begin Source File SOURCE=..\doc\PkgRequire.3 # End Source File # Begin Source File SOURCE=..\doc\Preserve.3 # End Source File # Begin Source File SOURCE=..\doc\PrintDbl.3 # End Source File # Begin Source File SOURCE=..\doc\proc.n # End Source File # Begin Source File SOURCE=..\doc\puts.n # End Source File # Begin Source File SOURCE=..\doc\pwd.n # End Source File # Begin Source File SOURCE=..\doc\re_syntax.n # End Source File # Begin Source File SOURCE=..\doc\read.n # End Source File # Begin Source File SOURCE=..\doc\RecEvalObj.3 # End Source File # Begin Source File SOURCE=..\doc\RecordEval.3 # End Source File # Begin Source File SOURCE=..\doc\RegExp.3 # End Source File # Begin Source File SOURCE=..\doc\regexp.n # End Source File # Begin Source File SOURCE=..\doc\registry.n # End Source File # Begin Source File SOURCE=..\doc\regsub.n # End Source File # Begin Source File SOURCE=..\doc\rename.n # End Source File # Begin Source File SOURCE=..\doc\return.n # End Source File # Begin Source File SOURCE=..\doc\safe.n # End Source File # Begin Source File SOURCE=..\doc\SaveInterpState.3 # End Source File # Begin Source File SOURCE=..\doc\scan.n # End Source File # Begin Source File SOURCE=..\doc\seek.n # End Source File # Begin Source File SOURCE=..\doc\set.n # End Source File # Begin Source File SOURCE=..\doc\SetErrno.3 # End Source File # Begin Source File SOURCE=..\doc\SetRecLmt.3 # End Source File # Begin Source File SOURCE=..\doc\SetResult.3 # End Source File # Begin Source File SOURCE=..\doc\SetVar.3 # End Source File # Begin Source File SOURCE=..\doc\Signal.3 # End Source File # Begin Source File SOURCE=..\doc\Sleep.3 # End Source File # Begin Source File SOURCE=..\doc\socket.n # End Source File # Begin Source File SOURCE=..\doc\source.n # End Source File # Begin Source File SOURCE=..\doc\SourceRCFile.3 # End Source File # Begin Source File SOURCE=..\doc\split.n # End Source File # Begin Source File SOURCE=..\doc\SplitList.3 # End Source File # Begin Source File SOURCE=..\doc\SplitPath.3 # End Source File # Begin Source File SOURCE=..\doc\StaticLibrary.3 # End Source File # Begin Source File SOURCE=..\doc\StdChannels.3 # End Source File # Begin Source File SOURCE=..\doc\string.n # End Source File # Begin Source File SOURCE=..\doc\StringObj.3 # End Source File # Begin Source File SOURCE=..\doc\StrMatch.3 # End Source File # Begin Source File SOURCE=..\doc\subst.n # End Source File # Begin Source File SOURCE=..\doc\SubstObj.3 # End Source File # Begin Source File SOURCE=..\doc\switch.n # End Source File # Begin Source File SOURCE=..\doc\Tcl.n # End Source File # Begin Source File SOURCE=..\doc\Tcl_Main.3 # End Source File # Begin Source File SOURCE=..\doc\TCL_MEM_DEBUG.3 # End Source File # Begin Source File SOURCE=..\doc\tclsh.1 # End Source File # Begin Source File SOURCE=..\doc\tcltest.n # End Source File # Begin Source File SOURCE=..\doc\tclvars.n # End Source File # Begin Source File SOURCE=..\doc\tell.n # End Source File # Begin Source File SOURCE=..\doc\Thread.3 # End Source File # Begin Source File SOURCE=..\doc\time.n # End Source File # Begin Source File SOURCE=..\doc\ToUpper.3 # End Source File # Begin Source File SOURCE=..\doc\trace.n # End Source File # Begin Source File SOURCE=..\doc\TraceVar.3 # End Source File # Begin Source File SOURCE=..\doc\Translate.3 # End Source File # Begin Source File SOURCE=..\doc\UniCharIsAlpha.3 # End Source File # Begin Source File SOURCE=..\doc\unknown.n # End Source File # Begin Source File SOURCE=..\doc\unset.n # End Source File # Begin Source File SOURCE=..\doc\update.n # End Source File # Begin Source File SOURCE=..\doc\uplevel.n # End Source File # Begin Source File SOURCE=..\doc\UpVar.3 # End Source File # Begin Source File SOURCE=..\doc\upvar.n # End Source File # Begin Source File SOURCE=..\doc\Utf.3 # End Source File # Begin Source File SOURCE=..\doc\variable.n # End Source File # Begin Source File SOURCE=..\doc\vwait.n # End Source File # Begin Source File SOURCE=..\doc\while.n # End Source File # Begin Source File SOURCE=..\doc\WrongNumArgs.3 # End Source File # End Group # Begin Group "generic" # PROP Default_Filter "" # Begin Source File SOURCE=..\generic\README # End Source File # Begin Source File SOURCE=..\generic\regc_color.c # End Source File # Begin Source File SOURCE=..\generic\regc_cvec.c # End Source File # Begin Source File SOURCE=..\generic\regc_lex.c # End Source File # Begin Source File SOURCE=..\generic\regc_locale.c # End Source File # Begin Source File SOURCE=..\generic\regc_nfa.c # End Source File # Begin Source File SOURCE=..\generic\regcomp.c # End Source File # Begin Source File SOURCE=..\generic\regcustom.h # End Source File # Begin Source File SOURCE=..\generic\rege_dfa.c # End Source File # Begin Source File SOURCE=..\generic\regerror.c # End Source File # Begin Source File SOURCE=..\generic\regerrs.h # End Source File # Begin Source File SOURCE=..\generic\regex.h # End Source File # Begin Source File SOURCE=..\generic\regexec.c # End Source File # Begin Source File SOURCE=..\generic\regfree.c # End Source File # Begin Source File SOURCE=..\generic\regfronts.c # End Source File # Begin Source File SOURCE=..\generic\regguts.h # End Source File # Begin Source File SOURCE=..\generic\tcl.decls # End Source File # Begin Source File SOURCE=..\generic\tcl.h # End Source File # Begin Source File SOURCE=..\generic\tclAlloc.c # End Source File # Begin Source File SOURCE=..\generic\tclAsync.c # End Source File # Begin Source File SOURCE=..\generic\tclBasic.c # End Source File # Begin Source File SOURCE=..\generic\tclBinary.c # End Source File # Begin Source File SOURCE=..\generic\tclCkalloc.c # End Source File # Begin Source File SOURCE=..\generic\tclClock.c # End Source File # Begin Source File SOURCE=..\generic\tclCmdAH.c # End Source File # Begin Source File SOURCE=..\generic\tclCmdIL.c # End Source File # Begin Source File SOURCE=..\generic\tclCmdMZ.c # End Source File # Begin Source File SOURCE=..\generic\tclCompCmds.c # End Source File # Begin Source File SOURCE=..\generic\tclCompExpr.c # End Source File # Begin Source File SOURCE=..\generic\tclCompile.c # End Source File # Begin Source File SOURCE=..\generic\tclCompile.h # End Source File # Begin Source File SOURCE=..\generic\tclDate.c # End Source File # Begin Source File SOURCE=..\generic\tclDecls.h # End Source File # Begin Source File SOURCE=..\generic\tclEncoding.c # End Source File # Begin Source File SOURCE=..\generic\tclEnv.c # End Source File # Begin Source File SOURCE=..\generic\tclEvent.c # End Source File # Begin Source File SOURCE=..\generic\tclExecute.c # End Source File # Begin Source File SOURCE=..\generic\tclFCmd.c # End Source File # Begin Source File SOURCE=..\generic\tclFileName.c # End Source File # Begin Source File SOURCE=..\generic\tclGet.c # End Source File # Begin Source File SOURCE=..\generic\tclGetDate.y # End Source File # Begin Source File SOURCE=..\generic\tclHash.c # End Source File # Begin Source File SOURCE=..\generic\tclHistory.c # End Source File # Begin Source File SOURCE=..\generic\tclIndexObj.c # End Source File # Begin Source File SOURCE=..\generic\tclInt.decls # End Source File # Begin Source File SOURCE=..\generic\tclInt.h # End Source File # Begin Source File SOURCE=..\generic\tclIntDecls.h # End Source File # Begin Source File SOURCE=..\generic\tclInterp.c # End Source File # Begin Source File SOURCE=..\generic\tclIntPlatDecls.h # End Source File # Begin Source File SOURCE=..\generic\tclIO.c # End Source File # Begin Source File SOURCE=..\generic\tclIO.h # End Source File # Begin Source File SOURCE=..\generic\tclIOCmd.c # End Source File # Begin Source File SOURCE=..\generic\tclIOGT.c # End Source File # Begin Source File SOURCE=..\generic\tclIOSock.c # End Source File # Begin Source File SOURCE=..\generic\tclIOUtil.c # End Source File # Begin Source File SOURCE=..\generic\tclLink.c # End Source File # Begin Source File SOURCE=..\generic\tclListObj.c # End Source File # Begin Source File SOURCE=..\generic\tclLiteral.c # End Source File # Begin Source File SOURCE=..\generic\tclLoad.c # End Source File # Begin Source File SOURCE=..\generic\tclLoadNone.c # End Source File # Begin Source File SOURCE=..\generic\tclMain.c # End Source File # Begin Source File SOURCE=..\generic\tclNamesp.c # End Source File # Begin Source File SOURCE=..\generic\tclNotify.c # End Source File # Begin Source File SOURCE=..\generic\tclObj.c # End Source File # Begin Source File SOURCE=..\generic\tclPanic.c # End Source File # Begin Source File SOURCE=..\generic\tclParse.c # End Source File # Begin Source File SOURCE=..\generic\tclPipe.c # End Source File # Begin Source File SOURCE=..\generic\tclPkg.c # End Source File # Begin Source File SOURCE=..\generic\tclPlatDecls.h # End Source File # Begin Source File SOURCE=..\generic\tclPort.h # End Source File # Begin Source File SOURCE=..\generic\tclPosixStr.c # End Source File # Begin Source File SOURCE=..\generic\tclPreserve.c # End Source File # Begin Source File SOURCE=..\generic\tclProc.c # End Source File # Begin Source File SOURCE=..\generic\tclProcess.c # End Source File # Begin Source File SOURCE=..\generic\tclRegexp.c # End Source File # Begin Source File SOURCE=..\generic\tclRegexp.h # End Source File # Begin Source File SOURCE=..\generic\tclResolve.c # End Source File # Begin Source File SOURCE=..\generic\tclResult.c # End Source File # Begin Source File SOURCE=..\generic\tclScan.c # End Source File # Begin Source File SOURCE=..\generic\tclStringObj.c # End Source File # Begin Source File SOURCE=..\generic\tclStubInit.c # End Source File # Begin Source File SOURCE=..\generic\tclStubLib.c # End Source File # Begin Source File SOURCE=..\generic\tclStubCall.c # End Source File # Begin Source File SOURCE=..\generic\tclStubLibTbl.c # End Source File # Begin Source File SOURCE=..\generic\tclOOStubLib.c # End Source File # Begin Source File SOURCE=..\generic\tclTomMathStubLib.c # End Source File # Begin Source File SOURCE=..\generic\tclTest.c # End Source File # Begin Source File SOURCE=..\generic\tclTestObj.c # End Source File # Begin Source File SOURCE=..\generic\tclTestProcBodyObj.c # End Source File # Begin Source File SOURCE=..\generic\tclThread.c # End Source File # Begin Source File SOURCE=..\generic\tclThreadJoin.c # End Source File # Begin Source File SOURCE=..\generic\tclThreadTest.c # End Source File # Begin Source File SOURCE=..\generic\tclTimer.c # End Source File # Begin Source File SOURCE=..\generic\tclUniData.c # End Source File # Begin Source File SOURCE=..\generic\tclUtf.c # End Source File # Begin Source File SOURCE=..\generic\tclUtil.c # End Source File # Begin Source File SOURCE=..\generic\tclVar.c # End Source File # End Group # Begin Group "library" # PROP Default_Filter "" # Begin Source File SOURCE=..\library\auto.tcl # End Source File # Begin Source File SOURCE=..\library\history.tcl # End Source File # Begin Source File SOURCE=..\library\init.tcl # End Source File # Begin Source File SOURCE=..\library\ldAout.tcl # End Source File # Begin Source File SOURCE=..\library\package.tcl # End Source File # Begin Source File SOURCE=..\library\parray.tcl # End Source File # Begin Source File SOURCE=..\library\safe.tcl # End Source File # Begin Source File SOURCE=..\library\tclIndex # End Source File # Begin Source File SOURCE=..\library\word.tcl # End Source File # End Group # Begin Group "mac" # PROP Default_Filter "" # End Group # Begin Group "tests" # PROP Default_Filter "" # End Group # Begin Group "tools" # PROP Default_Filter "" # End Group # Begin Group "unix" # PROP Default_Filter "" # End Group # Begin Group "win" # PROP Default_Filter "" # Begin Source File SOURCE=.\aclocal.m4 # End Source File # Begin Source File SOURCE=.\cat.c # End Source File # Begin Source File SOURCE=.\configure # End Source File # Begin Source File SOURCE=.\configure.ac # End Source File # Begin Source File SOURCE=.\Makefile.in # End Source File # Begin Source File SOURCE=.\makefile.vc # End Source File # Begin Source File SOURCE=.\mkd.bat # End Source File # Begin Source File SOURCE=.\README # End Source File # Begin Source File SOURCE=.\README.binary # End Source File # Begin Source File SOURCE=.\rmd.bat # End Source File # Begin Source File SOURCE=.\rules.vc # End Source File # Begin Source File SOURCE=.\tcl.m4 # End Source File # Begin Source File SOURCE=.\tcl.rc # End Source File # Begin Source File SOURCE=.\tclAppInit.c # End Source File # Begin Source File SOURCE=.\tclConfig.sh.in # End Source File # Begin Source File SOURCE=.\tclsh.ico # End Source File # Begin Source File SOURCE=.\tclsh.rc # End Source File # Begin Source File SOURCE=.\tclWin32Dll.c # End Source File # Begin Source File SOURCE=.\tclWinChan.c # End Source File # Begin Source File SOURCE=.\tclWinConsole.c # End Source File # Begin Source File SOURCE=.\tclWinDde.c # End Source File # Begin Source File SOURCE=.\tclWinError.c # End Source File # Begin Source File SOURCE=.\tclWinFCmd.c # End Source File # Begin Source File SOURCE=.\tclWinFile.c # End Source File # Begin Source File SOURCE=.\tclWinInit.c # End Source File # Begin Source File SOURCE=.\tclWinInt.h # End Source File # Begin Source File SOURCE=.\tclWinLoad.c # End Source File # Begin Source File SOURCE=.\tclWinNotify.c # End Source File # Begin Source File SOURCE=.\tclWinPanic.c # End Source File # Begin Source File SOURCE=.\tclWinPipe.c # End Source File # Begin Source File SOURCE=.\tclWinPort.h # End Source File # Begin Source File SOURCE=.\tclWinReg.c # End Source File # Begin Source File SOURCE=.\tclWinSerial.c # End Source File # Begin Source File SOURCE=.\tclWinSock.c # End Source File # Begin Source File SOURCE=.\tclWinTest.c # End Source File # Begin Source File SOURCE=.\tclWinThrd.c # End Source File # Begin Source File SOURCE=.\tclWinTime.c # End Source File # End Group # End Target # End Project tcl9.0.3/win/targets.vc0000644000175000017500000000517115104661342014354 0ustar sergeisergei#------------------------------------------------------------- -*- makefile -*- # targets.vc -- # # Part of the nmake based build system for Tcl and its extensions. # This file defines some standard targets for the convenience of extensions # and can be optionally included by the extension makefile. # See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs. $(PROJECT): setup pkgindex $(PRJLIB) !ifdef PRJ_STUBOBJS $(PROJECT): $(PRJSTUBLIB) $(PRJSTUBLIB): $(PRJ_STUBOBJS) $(LIBCMD) $** $(PRJ_STUBOBJS): $(CCSTUBSCMD) %s !endif # PRJ_STUBOBJS !ifdef PRJ_MANIFEST $(PROJECT): $(PRJLIB).manifest $(PRJLIB).manifest: $(PRJ_MANIFEST) @nmakehlp -s << $** >$@ @MACHINE@ $(MACHINE:IX86=X86) << !endif !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" $(PRJLIB): $(PRJ_OBJS) $(RESFILE) !if $(STATIC_BUILD) $(LIBCMD) $** !else $(DLLCMD) $** $(_VC_MANIFEST_EMBED_DLL) !endif -@del $*.exp !endif !if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != "" $(PRJ_OBJS): $(PRJ_HEADERS) !endif # If parent makefile has defined stub objects, add their installation # to the default install !if "$(PRJ_STUBOBJS)" != "" default-install: default-install-stubs !endif # Unlike the other default targets, these cannot be in rules.vc because # the executed command depends on existence of macro PRJ_HEADERS_PUBLIC # that the parent makefile will not define until after including rules-ext.vc !if "$(PRJ_HEADERS_PUBLIC)" != "" default-install: default-install-headers default-install-headers: @echo Installing headers to '$(INCLUDE_INSTALL_DIR)' @if not exist "$(INCLUDE_INSTALL_DIR)" $(MKDIR) "$(INCLUDE_INSTALL_DIR)" @for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)" !endif !if "$(DISABLE_STANDARD_TARGETS)" == "" DISABLE_STANDARD_TARGETS = 0 !endif !if "$(DISABLE_TARGET_setup)" == "" DISABLE_TARGET_setup = 0 !endif !if "$(DISABLE_TARGET_install)" == "" DISABLE_TARGET_install = 0 !endif !if "$(DISABLE_TARGET_clean)" == "" DISABLE_TARGET_clean = 0 !endif !if "$(DISABLE_TARGET_test)" == "" DISABLE_TARGET_test = 0 !endif !if "$(DISABLE_TARGET_shell)" == "" DISABLE_TARGET_shell = 0 !endif !if !$(DISABLE_STANDARD_TARGETS) !if !$(DISABLE_TARGET_setup) setup: default-setup !endif !if !$(DISABLE_TARGET_install) install: default-install !endif !if !$(DISABLE_TARGET_clean) clean: default-clean realclean: hose hose: default-hose distclean: realclean default-distclean !endif !if !$(DISABLE_TARGET_test) test: default-test !endif !if !$(DISABLE_TARGET_shell) shell: default-shell !endif !endif # DISABLE_STANDARD_TARGETS tcl9.0.3/win/svnmanifest.in0000644000175000017500000000000515076154273015235 0ustar sergeisergeisvn-rtcl9.0.3/win/rules.vc0000644000175000017500000017404215104661342014041 0ustar sergeisergei#------------------------------------------------------------- -*- makefile -*- # rules.vc -- # # Part of the nmake based build system for Tcl and its extensions. # This file does all the hard work in terms of parsing build options, # compiler switches, defining common targets and macros. The Tcl makefile # directly includes this. Extensions include it via "rules-ext.vc". # # See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for # detailed documentation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2003 David Gravereaux. # Copyright (c) 2003-2008 Patrick Thoyts # Copyright (c) 2017 Ashok P. Nadkarni #------------------------------------------------------------------------------ !ifndef _RULES_VC _RULES_VC = 1 # The following macros define the version of the rules.vc nmake build system # For modifications that are not backward-compatible, you *must* change # the major version. RULES_VERSION_MAJOR = 1 RULES_VERSION_MINOR = 15 # The PROJECT macro must be defined by parent makefile. !if "$(PROJECT)" == "" !error *** Error: Macro PROJECT not defined! Please define it before including rules.vc !endif !if "$(PRJ_PACKAGE_TCLNAME)" == "" PRJ_PACKAGE_TCLNAME = $(PROJECT) !endif # Also special case Tcl and Tk to save some typing later DOING_TCL = 0 DOING_TK = 0 !if "$(PROJECT)" == "tcl" DOING_TCL = 1 !elseif "$(PROJECT)" == "tk" DOING_TK = 1 !endif !ifndef NEED_TK # Backwards compatibility !ifdef PROJECT_REQUIRES_TK NEED_TK = $(PROJECT_REQUIRES_TK) !else NEED_TK = 0 !endif !endif !ifndef NEED_TCL_SOURCE NEED_TCL_SOURCE = 0 !endif !ifdef NEED_TK_SOURCE !if $(NEED_TK_SOURCE) NEED_TK = 1 !endif !else NEED_TK_SOURCE = 0 !endif ################################################################ # Nmake is a pretty weak environment in syntax and capabilities # so this file is necessarily verbose. It's broken down into # the following parts. # # 0. Sanity check that compiler environment is set up and initialize # any built-in settings from the parent makefile # 1. First define the external tools used for compiling, copying etc. # as this is independent of everything else. # 2. Figure out our build structure in terms of the directory, whether # we are building Tcl or an extension, etc. # 3. Determine the compiler and linker versions # 4. Build the nmakehlp helper application # 5. Determine the supported compiler options and features # 6. Extract Tcl, Tk, and possibly extensions, version numbers from the # headers # 7. Parse the OPTS macro value for user-specified build configuration # 8. Parse the STATS macro value for statistics instrumentation # 9. Parse the CHECKS macro for additional compilation checks # 10. Based on this selected configuration, construct the output # directory and file paths # 11. Construct the paths where the package is to be installed # 12. Set up the actual options passed to compiler and linker based # on the information gathered above. # 13. Define some standard build targets and implicit rules. These may # be optionally disabled by the parent makefile. # 14. (For extensions only.) Compare the configuration of the target # Tcl and the extensions and warn against discrepancies. # # One final note about the macro names used. They are as they are # for historical reasons. We would like legacy extensions to # continue to work with this make include file so be wary of # changing them for consistency or clarity. # 0. Sanity check compiler environment # Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or # VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) MSG = ^ Visual C++ compiler environment not initialized. !error $(MSG) !endif # We need to run from the directory the parent makefile is located in. # nmake does not tell us what makefile was used to invoke it so parent # makefile has to set the MAKEFILEVC macro or we just make a guess and # warn if we think that is not the case. !if "$(MAKEFILEVC)" == "" !if exist("$(PROJECT).vc") MAKEFILEVC = $(PROJECT).vc !elseif exist("makefile.vc") MAKEFILEVC = makefile.vc !endif !endif # "$(MAKEFILEVC)" == "" !if !exist("$(MAKEFILEVC)") MSG = ^ You must run nmake from the directory containing the project makefile.^ If you are doing that and getting this message, set the MAKEFILEVC^ macro to the name of the project makefile. !message WARNING: $(MSG) !endif ################################################################ # 1. Define external programs being used #---------------------------------------------------------- # Set the proper copy method to avoid overwrite questions # to the user when copying files and selecting the right # "delete all" method. #---------------------------------------------------------- RMDIR = rmdir /S /Q CPY = xcopy /i /y >NUL CPYDIR = xcopy /e /i /y >NUL COPY = copy /y >NUL MKDIR = mkdir ###################################################################### # 2. Figure out our build environment in terms of what we're building. # # (a) Tcl itself # (b) Tk # (c) a Tcl extension using libraries/includes from an *installed* Tcl # (d) a Tcl extension using libraries/includes from Tcl source directory # # This last is needed because some extensions still need # some Tcl interfaces that are not publicly exposed. # # The fragment will set the following macros: # ROOT - root of this module sources # COMPATDIR - source directory that holds compatibility sources # DOCDIR - source directory containing documentation files # GENERICDIR - platform-independent source directory # WIN_DIR - Windows-specific source directory # TESTDIR - directory containing test files # TOOLSDIR - directory containing build tools # _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set # when building Tcl itself. # _INSTALLDIR - native form of the installation path. For Tcl # this will be the root of the Tcl installation. For extensions # this will be the lib directory under the root. # TCLINSTALL - set to 1 if _TCLDIR refers to # headers and libraries from an installed Tcl, and 0 if built against # Tcl sources. Not set when building Tcl itself. Yes, not very well # named. # _TCL_H - native path to the tcl.h file # # If Tk is involved, also sets the following # _TKDIR - native form Tk installation OR Tk source. Not set if building # Tk itself. # TKINSTALL - set 1 if _TKDIR refers to installed Tk and 0 if Tk sources # _TK_H - native path to the tk.h file # Root directory for sources and assumed subdirectories ROOT = $(MAKEDIR)\.. # The following paths CANNOT have spaces in them as they appear on the # left side of implicit rules. !ifndef COMPATDIR COMPATDIR = $(ROOT)\compat !endif !ifndef DOCDIR DOCDIR = $(ROOT)\doc !endif !ifndef GENERICDIR GENERICDIR = $(ROOT)\generic !endif !ifndef TOOLSDIR TOOLSDIR = $(ROOT)\tools !endif !ifndef TESTDIR TESTDIR = $(ROOT)\tests !endif !ifndef LIBDIR !if exist("$(ROOT)\library") LIBDIR = $(ROOT)\library !else LIBDIR = $(ROOT)\lib !endif !endif !ifndef DEMODIR !if exist("$(LIBDIR)\demos") DEMODIR = $(LIBDIR)\demos !else DEMODIR = $(ROOT)\demos !endif !endif # ifndef DEMODIR # Do NOT use WINDIR because it is Windows internal environment # variable to point to c:\windows! WIN_DIR = $(ROOT)\win !ifndef RCDIR !if exist("$(WIN_DIR)\rc") RCDIR = $(WIN_DIR)\rc !else RCDIR = $(WIN_DIR) !endif !endif RCDIR = $(RCDIR:/=\) # The target directory where the built packages and binaries will be installed. # INSTALLDIR is the (optional) path specified by the user. # _INSTALLDIR is INSTALLDIR using the backslash separator syntax !ifdef INSTALLDIR ### Fix the path separators. _INSTALLDIR = $(INSTALLDIR:/=\) !else ### Assume the normal default. _INSTALLDIR = $(HOMEDRIVE)\Tcl !endif !if $(DOING_TCL) # BEGIN Case 2(a) - Building Tcl itself # Only need to define _TCL_H _TCL_H = ..\generic\tcl.h # END Case 2(a) - Building Tcl itself !elseif $(DOING_TK) # BEGIN Case 2(b) - Building Tk TCLINSTALL = 0 # Tk always builds against Tcl source, not an installed Tcl !if "$(TCLDIR)" == "" !if [echo TCLDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] !error *** Could not locate Tcl source directory. !endif !include nmakehlp.out !endif # TCLDIR == "" _TCLDIR = $(TCLDIR:/=\) _TCL_H = $(_TCLDIR)\generic\tcl.h !if !exist("$(_TCL_H)") !error Could not locate tcl.h. Please set the TCLDIR macro to point to the Tcl *source* directory. !endif _TK_H = ..\generic\tk.h # END Case 2(b) - Building Tk !else # BEGIN Case 2(c) or (d) - Building an extension other than Tk # If command line has specified Tcl location through TCLDIR, use it # else default to the INSTALLDIR setting !if "$(TCLDIR)" != "" _TCLDIR = $(TCLDIR:/=\) !if exist("$(_TCLDIR)\include\tcl.h") # Case 2(c) with TCLDIR defined TCLINSTALL = 1 _TCL_H = $(_TCLDIR)\include\tcl.h !elseif exist("$(_TCLDIR)\generic\tcl.h") # Case 2(d) with TCLDIR defined TCLINSTALL = 0 _TCL_H = $(_TCLDIR)\generic\tcl.h !endif !else # # Case 2(c) for extensions with TCLDIR undefined # Need to locate Tcl depending on whether it needs Tcl source or not. # If we don't, check the INSTALLDIR for an installed Tcl first !if exist("$(_INSTALLDIR)\include\tcl.h") && !$(NEED_TCL_SOURCE) TCLINSTALL = 1 TCLDIR = $(_INSTALLDIR)\.. # NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions # later so the \.. accounts for the /lib _TCLDIR = $(_INSTALLDIR)\.. _TCL_H = $(_TCLDIR)\include\tcl.h !else # exist(...) && !$(NEED_TCL_SOURCE) !if [echo _TCLDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] !error *** Could not locate Tcl source directory. !endif !include nmakehlp.out TCLINSTALL = 0 TCLDIR = $(_TCLDIR) _TCL_H = $(_TCLDIR)\generic\tcl.h !endif # exist(...) && !$(NEED_TCL_SOURCE) !endif # TCLDIR !ifndef _TCL_H MSG =^ Failed to find tcl.h. The TCLDIR macro is set incorrectly or is not set and default path does not contain tcl.h. !error $(MSG) !endif # Now do the same to locate Tk headers and libs if project requires Tk !if $(NEED_TK) !if "$(TKDIR)" != "" _TKDIR = $(TKDIR:/=\) !if exist("$(_TKDIR)\include\tk.h") TKINSTALL = 1 _TK_H = $(_TKDIR)\include\tk.h !elseif exist("$(_TKDIR)\generic\tk.h") TKINSTALL = 0 _TK_H = $(_TKDIR)\generic\tk.h !endif !else # TKDIR not defined # Need to locate Tcl depending on whether it needs Tcl source or not. # If we don't, check the INSTALLDIR for an installed Tcl first !if exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) TKINSTALL = 1 # NOTE: we will be resetting _INSTALLDIR to _INSTALLDIR/lib for extensions # later so the \.. accounts for the /lib _TKDIR = $(_INSTALLDIR)\.. _TK_H = $(_TKDIR)\include\tk.h TKDIR = $(_TKDIR) !else # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) !if [echo _TKDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tk.h >> nmakehlp.out] !error *** Could not locate Tk source directory. !endif !include nmakehlp.out TKINSTALL = 0 TKDIR = $(_TKDIR) _TK_H = $(_TKDIR)\generic\tk.h !endif # exist("$(_INSTALLDIR)\include\tk.h") && !$(NEED_TK_SOURCE) !endif # TKDIR !ifndef _TK_H MSG =^ Failed to find tk.h. The TKDIR macro is set incorrectly or is not set and default path does not contain tk.h. !error $(MSG) !endif !endif # NEED_TK !if $(NEED_TCL_SOURCE) && $(TCLINSTALL) MSG = ^ *** Warning: This extension requires the source distribution of Tcl.^ *** Please set the TCLDIR macro to point to the Tcl sources. !error $(MSG) !endif !if $(NEED_TK_SOURCE) !if $(TKINSTALL) MSG = ^ *** Warning: This extension requires the source distribution of Tk.^ *** Please set the TKDIR macro to point to the Tk sources. !error $(MSG) !endif !endif # If INSTALLDIR set to Tcl installation root dir then reset to the # lib dir for installing extensions !if exist("$(_INSTALLDIR)\include\tcl.h") _INSTALLDIR=$(_INSTALLDIR)\lib !endif # END Case 2(c) or (d) - Building an extension !endif # if $(DOING_TCL) ################################################################ # 3. Determine compiler version and architecture # In this section, we figure out the compiler version and the # architecture for which we are building. This sets the # following macros: # VCVERSION - the internal compiler version as 1200, 1400, 1910 etc. # This is also printed by the compiler in dotted form 19.10 etc. # VCVER - the "marketing version", for example Visual C++ 6 for internal # compiler version 1200. This is kept only for legacy reasons as it # does not make sense for recent Microsoft compilers. Only used for # output directory names. # ARCH - set to IX86, ARM64 or AMD64 depending on 32- or 64-bit target # NATIVE_ARCH - set to IX86, ARM64 or AMD64 for the host machine # MACHINE - same as $(ARCH) - legacy # _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed cc32 = $(CC) # built-in default. link32 = link lib32 = lib rc32 = $(RC) # built-in default. #---------------------------------------------------------------- # Figure out the compiler architecture and version by writing # the C macros to a file, preprocessing them with the C # preprocessor and reading back the created file _HASH=^# _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ && ![echo ARCH=IX86 >> vercl.x] \ && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ && ![echo ARCH=AMD64 >> vercl.x] \ && ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \ && ![echo ARCH=ARM64 >> vercl.x] \ && ![echo $(_HASH)endif >> vercl.x] \ && ![$(cc32) -nologo -TC -P vercl.x 2>NUL] !include vercl.i !if $(VCVERSION) < 1900 !if ![echo VCVER= ^\> vercl.vc] \ && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] !include vercl.vc !endif !else # The simple calculation above does not apply to new Visual Studio releases # Keep the compiler version in its native form. VCVER = $(VCVERSION) !endif !endif !if ![del 2>NUL /q/f vercl.x vercl.i vercl.vc] !endif #---------------------------------------------------------------- # The MACHINE macro is used by legacy makefiles so set it as well !ifdef MACHINE !if "$(MACHINE)" == "x86" !undef MACHINE MACHINE = IX86 !elseif "$(MACHINE)" == "arm64" !undef MACHINE MACHINE = ARM64 !elseif "$(MACHINE)" == "x64" !undef MACHINE MACHINE = AMD64 !endif !if "$(MACHINE)" != "$(ARCH)" !error Specified MACHINE macro $(MACHINE) does not match detected target architecture $(ARCH). !endif !else MACHINE=$(ARCH) !endif #--------------------------------------------------------------- # The PLATFORM_IDENTIFY macro matches the values returned by # the Tcl platform::identify command !if "$(MACHINE)" == "AMD64" PLATFORM_IDENTIFY = win32-x86_64 !elseif "$(MACHINE)" == "ARM64" PLATFORM_IDENTIFY = win32-arm !else PLATFORM_IDENTIFY = win32-ix86 !endif # The MULTIPLATFORM macro controls whether binary extensions are installed # in platform-specific directories. Intended to be set/used by extensions. !ifndef MULTIPLATFORM_INSTALL MULTIPLATFORM_INSTALL = 0 !endif #------------------------------------------------------------ # Figure out the *host* architecture by reading the registry !if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] NATIVE_ARCH=IX86 !elseif ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i ARM | findstr /i 64-bit] NATIVE_ARCH=ARM64 !else NATIVE_ARCH=AMD64 !endif # Since MSVC8 we must deal with manifest resources. !if $(VCVERSION) >= 1400 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 !endif ################################################################ # 4. Build the nmakehlp program # This is a helper app we need to overcome nmake's limiting # environment. We will call out to it to get various bits of # information about supported compiler options etc. # # Tcl itself will always use the nmakehlp.c program which is # in its own source. It will be kept updated there. # # Extensions built against an installed Tcl will use the installed # copy of Tcl's nmakehlp.c if there is one and their own version # otherwise. In the latter case, they would also be using their own # rules.vc. Note that older versions of Tcl do not install nmakehlp.c # or rules.vc. # # Extensions built against Tcl sources will use the one from the Tcl source. # # When building an extension using a sufficiently new version of Tcl, # rules-ext.vc will define NMAKEHLPC appropriately to point to the # copy of nmakehlp.c to be used. !ifndef NMAKEHLPC # Default to the one in the current directory (the extension's own nmakehlp.c) NMAKEHLPC = nmakehlp.c !if !$(DOING_TCL) !if $(TCLINSTALL) !if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c") NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c !endif !else # !$(TCLINSTALL) !if exist("$(_TCLDIR)\win\nmakehlp.c") NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c !endif !endif # $(TCLINSTALL) !endif # !$(DOING_TCL) !endif # NMAKEHLPC # We always build nmakehlp even if it exists since we do not know # what source it was built from. !if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" !if [$(cc32) -nologo "$(NMAKEHLPC)" -link -subsystem:console > nul] !endif !else !if [copy $(NMAKEHLPC:nmakehlp.c=x86_64-w64-mingw32-nmakehlp.exe) nmakehlp.exe >NUL] !endif !endif ################################################################ # 5. Test for compiler features # Visual C++ compiler options have changed over the years. Check # which options are supported by the compiler in use. # # The following macros are set: # OPTIMIZATIONS - the compiler flags to be used for optimized builds # DEBUGFLAGS - the compiler flags to be used for debug builds # LINKERFLAGS - Flags passed to the linker # # Note that these are the compiler settings *available*, not those # that will be *used*. The latter depends on the OPTS macro settings # which we have not yet parsed. # # Also note that some of the flags in OPTIMIZATIONS are not really # related to optimization. They are placed there only for legacy reasons # as some extensions expect them to be included in that macro. # -Op improves float consistency. Note only needed for older compilers # Newer compilers do not need or support this option. !if [nmakehlp -c -Op] FPOPTS = -Op !endif # Strict floating point semantics - present in newer compilers in lieu of -Op !if [nmakehlp -c -fp:strict] FPOPTS = $(FPOPTS) -fp:strict !endif !if "$(MACHINE)" == "IX86" ### test for pentium errata !if [nmakehlp -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' FPOPTS = $(FPOPTS) -QI0f !else !message *** Compiler does not have 'Pentium 0x0f fix' !endif !endif ### test for optimizations # /O2 optimization includes /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy as per # documentation. Note we do NOT want /Gs as that inserts a _chkstk # stack probe at *every* function entry, not just those with more than # a page of stack allocation resulting in a performance hit. However, # /O2 documentation is misleading as its stack probes are simply the # default page size locals allocation probes and not what is implied # by an explicit /Gs option. OPTIMIZATIONS = $(FPOPTS) !if [nmakehlp -c -O2] OPTIMIZING = 1 OPTIMIZATIONS = $(OPTIMIZATIONS) -O2 !else # Legacy, really. All modern compilers support this !message *** Compiler does not have 'Optimizations' OPTIMIZING = 0 !endif # Checks for buffer overflows in local arrays !if [nmakehlp -c -GS] OPTIMIZATIONS = $(OPTIMIZATIONS) -GS !endif # Link time optimization. Note that this option (potentially) makes # generated libraries only usable by the specific VC++ version that # created it. Requires /LTCG linker option !if [nmakehlp -c -GL] OPTIMIZATIONS = $(OPTIMIZATIONS) -GL CC_GL_OPT_ENABLED = 1 !else # In newer compilers -GL and -YX are incompatible. !if [nmakehlp -c -YX] OPTIMIZATIONS = $(OPTIMIZATIONS) -YX !endif !endif # [nmakehlp -c -GL] DEBUGFLAGS = $(FPOPTS) # Run time error checks. Not available or valid in a release, non-debug build # RTC is for modern compilers, -GZ is legacy !if [nmakehlp -c -RTC1] DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 !elseif [nmakehlp -c -GZ] DEBUGFLAGS = $(DEBUGFLAGS) -GZ !endif #---------------------------------------------------------------- # Linker flags # LINKER_TESTFLAGS are for internal use when we call nmakehlp to test # if the linker supports a specific option. Without these flags link will # return "LNK1561: entry point must be defined" error compiling from VS-IDE: # They are not passed through to the actual application / extension # link rules. !ifndef LINKER_TESTFLAGS LINKER_TESTFLAGS = /DLL /NOENTRY /OUT:nmakehlp.out !endif LINKERFLAGS = # If compiler has enabled link time optimization, linker must too with -ltcg !ifdef CC_GL_OPT_ENABLED !if [nmakehlp -l -ltcg $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS) -ltcg !endif !endif ################################################################ # 6. Extract various version numbers from headers # For Tcl and Tk, version numbers are extracted from tcl.h and tk.h # respectively. For extensions, versions are extracted from the # configure.in or configure.ac from the TEA configuration if it # exists, and unset otherwise. # Sets the following macros: # TCL_MAJOR_VERSION # TCL_MINOR_VERSION # TCL_RELEASE_SERIAL # TCL_PATCH_LEVEL # TCL_PATCH_LETTER # TCL_VERSION # TK_MAJOR_VERSION # TK_MINOR_VERSION # TK_RELEASE_SERIAL # TK_PATCH_LEVEL # TK_PATCH_LETTER # TK_VERSION # DOTVERSION - set as (for example) 2.5 # VERSION - set as (for example 25) #-------------------------------------------------------------- !if [echo REM = This file is generated from rules.vc > versions.vc] !endif !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" "define TCL_MAJOR_VERSION" >> versions.vc] !endif !if [echo TCL_MINOR_VERSION = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" "define TCL_MINOR_VERSION" >> versions.vc] !endif !if [echo TCL_RELEASE_SERIAL = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_RELEASE_SERIAL >> versions.vc] !endif !if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] !endif !if defined(_TK_H) !if [echo TK_MAJOR_VERSION = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) "define TK_MAJOR_VERSION" >> versions.vc] !endif !if [echo TK_MINOR_VERSION = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] !endif !if [echo TK_RELEASE_SERIAL = \>> versions.vc] \ && [nmakehlp -V "$(_TK_H)" TK_RELEASE_SERIAL >> versions.vc] !endif !if [echo TK_PATCH_LEVEL = \>> versions.vc] \ && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] !endif !endif # _TK_H !include versions.vc TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) !if [nmakehlp -f $(TCL_PATCH_LEVEL) "a"] TCL_PATCH_LETTER = a !elseif [nmakehlp -f $(TCL_PATCH_LEVEL) "b"] TCL_PATCH_LETTER = b !else TCL_PATCH_LETTER = . !endif !if defined(_TK_H) TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) !if [nmakehlp -f $(TK_PATCH_LEVEL) "a"] TK_PATCH_LETTER = a !elseif [nmakehlp -f $(TK_PATCH_LEVEL) "b"] TK_PATCH_LETTER = b !else TK_PATCH_LETTER = . !endif !endif # Set DOTVERSION and VERSION !if $(DOING_TCL) DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) VERSION = $(TCL_VERSION) !elseif $(DOING_TK) DOTVERSION = $(TK_DOTVERSION) VERSION = $(TK_VERSION) !else # Doing a non-Tk extension # If parent makefile has not defined DOTVERSION, try to get it from TEA # first from a configure.in file, and then from configure.ac !ifndef DOTVERSION !if [echo DOTVERSION = \> versions.vc] \ || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc] !if [echo DOTVERSION = \> versions.vc] \ || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc] !error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc. !endif !endif !include versions.vc !endif # DOTVERSION VERSION = $(DOTVERSION:.=) !endif # $(DOING_TCL) ... etc. # Windows RC files have 3 version components. Ensure this irrespective # of how many components the package has specified. Basically, ensure # minimum 4 components by appending 4 0's and then pick out the first 4. # Also take care of the fact that DOTVERSION may have "a" or "b" instead # of "." separating the version components. DOTSEPARATED=$(DOTVERSION:a=.) DOTSEPARATED=$(DOTSEPARATED:b=.) !if [echo RCCOMMAVERSION = \> versions.vc] \ || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc] !error *** Could not generate RCCOMMAVERSION *** !endif !include versions.vc ######################################################################## # 7. Parse the OPTS macro to work out the requested build configuration. # Based on this, we will construct the actual switches to be passed to the # compiler and linker using the macros defined in the previous section. # The following macros are defined by this section based on OPTS # STATIC_BUILD - 0 -> Tcl is to be built as a shared library # 1 -> build as a static library and shell # TCL_THREADS - legacy but always 1 on Windows since winsock requires it. # DEBUG - 1 -> debug build, 0 -> release builds # SYMBOLS - 1 -> generate PDB's, 0 -> no PDB's # PROFILE - 1 -> generate profiling info, 0 -> no profiling # PGO - 1 -> profile based optimization, 0 -> no # MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build # 0 -> link to static C runtime for static Tcl build. # Does not impact shared Tcl builds (STATIC_BUILD == 0) # Default: 1 for Tcl 9.0 and up, 0 otherwise. # TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions # in the Tcl and Wish shell. 0 -> keep them as shared libraries. Does # not impact shared Tcl builds. Implied by STATIC_BUILD since Tcl 9.0. # USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. # 0 -> Use the non-thread allocator. # UNCHECKED - 1 -> when doing a debug build with symbols, use the release # C runtime, 0 -> use the debug C runtime. # USE_STUBS - 1 -> compile to use stubs interfaces, 0 -> direct linking # CONFIG_CHECK - 1 -> check current build configuration against Tcl # configuration (ignored for Tcl itself) # _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build # (CRT library should support this, not needed for Tcl 9.x) # Further, LINKERFLAGS are modified based on above. # Default values for all the above STATIC_BUILD = 0 TCL_THREADS = 1 DEBUG = 0 SYMBOLS = 0 PROFILE = 0 PGO = 0 MSVCRT = 1 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 UNCHECKED = 0 CONFIG_CHECK = 1 !if $(DOING_TCL) USE_STUBS = 0 !else USE_STUBS = 1 !endif # If OPTS is not empty AND does not contain "none" which turns off all OPTS # set the above macros based on OPTS content !if "$(OPTS)" != "" && ![nmakehlp -f "$(OPTS)" "none"] # OPTS are specified, parse them !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static STATIC_BUILD = 1 !endif !if [nmakehlp -f $(OPTS) "nostubs"] !message *** Not using stubs USE_STUBS = 0 !endif !if [nmakehlp -f $(OPTS) "nomsvcrt"] !message *** Doing nomsvcrt MSVCRT = 0 !else !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt !else !if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 && $(STATIC_BUILD) MSVCRT = 0 !endif !endif !endif # [nmakehlp -f $(OPTS) "nomsvcrt"] !if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !endif !if [nmakehlp -f $(OPTS) "nothreads"] !message *** Compile explicitly for non-threaded tcl TCL_THREADS = 0 USE_THREAD_ALLOC= 0 !endif !if [nmakehlp -f $(OPTS) "tcl8"] !message *** Build for Tcl8 TCL_BUILD_FOR = 8 !endif !if $(TCL_MAJOR_VERSION) == 8 !if [nmakehlp -f $(OPTS) "time64bit"] !message *** Force 64-bit time_t _USE_64BIT_TIME_T = 1 !endif !endif # Yes, it's weird that the "symbols" option controls DEBUG and # the "pdbs" option controls SYMBOLS. That's historical. !if [nmakehlp -f $(OPTS) "symbols"] !message *** Doing symbols DEBUG = 1 !else DEBUG = 0 !endif !if [nmakehlp -f $(OPTS) "pdbs"] !message *** Doing pdbs SYMBOLS = 1 !else SYMBOLS = 0 !endif !if [nmakehlp -f $(OPTS) "profile"] !message *** Doing profile PROFILE = 1 !else PROFILE = 0 !endif !if [nmakehlp -f $(OPTS) "pgi"] !message *** Doing profile guided optimization instrumentation PGO = 1 !elseif [nmakehlp -f $(OPTS) "pgo"] !message *** Doing profile guided optimization PGO = 2 !else PGO = 0 !endif !if [nmakehlp -f $(OPTS) "loimpact"] !message *** Warning: ignoring option "loimpact" - deprecated on modern Windows. !endif # TBD - should get rid of this option !if [nmakehlp -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 !endif !if [nmakehlp -f $(OPTS) "tclalloc"] USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] !message *** Doing unchecked UNCHECKED = 1 !else UNCHECKED = 0 !endif !if [nmakehlp -f $(OPTS) "noconfigcheck"] CONFIG_CHECK = 1 !else CONFIG_CHECK = 0 !endif !endif # "$(OPTS)" != "" && ... parsing of OPTS # Set linker flags based on above !if $(PGO) > 1 !if [nmakehlp -l -ltcg:pgoptimize $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize !else MSG=^ This compiler does not support profile guided optimization. !error $(MSG) !endif !elseif $(PGO) > 0 !if [nmakehlp -l -ltcg:pginstrument $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument !else MSG=^ This compiler does not support profile guided optimization. !error $(MSG) !endif !endif ################################################################ # 8. Parse the STATS macro to configure code instrumentation # The following macros are set by this section: # TCL_MEM_DEBUG - 1 -> enables memory allocation instrumentation # 0 -> disables # TCL_COMPILE_DEBUG - 1 -> enables byte compiler logging # 0 -> disables # Default both are off TCL_MEM_DEBUG = 0 TCL_COMPILE_DEBUG = 0 !if "$(STATS)" != "" && ![nmakehlp -f "$(STATS)" "none"] !if [nmakehlp -f $(STATS) "memdbg"] !message *** Doing memdbg TCL_MEM_DEBUG = 1 !else TCL_MEM_DEBUG = 0 !endif !if [nmakehlp -f $(STATS) "compdbg"] !message *** Doing compdbg TCL_COMPILE_DEBUG = 1 !else TCL_COMPILE_DEBUG = 0 !endif !endif #################################################################### # 9. Parse the CHECKS macro to configure additional compiler checks # The following macros are set by this section: # WARNINGS - compiler switches that control the warnings level # TCL_NO_DEPRECATED - 1 -> disable support for deprecated functions # 0 -> enable deprecated functions # Defaults - Permit deprecated functions and warning level 3 TCL_NO_DEPRECATED = 0 WARNINGS = -W3 !if "$(CHECKS)" != "" && ![nmakehlp -f "$(CHECKS)" "none"] !if [nmakehlp -f $(CHECKS) "nodep"] !message *** Doing nodep check TCL_NO_DEPRECATED = 1 !endif !if [nmakehlp -f $(CHECKS) "fullwarn"] !message *** Doing full warnings check WARNINGS = -W4 !if [nmakehlp -l -warn:3 $(LINKER_TESTFLAGS)] LINKERFLAGS = $(LINKERFLAGS) -warn:3 !endif !endif !if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] !message *** Doing 64bit portability warnings WARNINGS = $(WARNINGS) -Wp64 !endif !endif ################################################################ # 10. Construct output directory and file paths # Figure-out how to name our intermediate and output directories. # In order to avoid inadvertent mixing of object files built using # different compilers, build configurations etc., # # Naming convention (suffixes): # t = full thread support. (Not used for Tcl >= 9.0) # s = static library (as opposed to an import library) # g = linked to the debug enabled C run-time. # x = special static build when it links to the dynamic C run-time. # # The following macros are set in this section: # SUFX - the suffix to use for binaries based on above naming convention # BUILDDIRTOP - the toplevel default output directory # is of the form {Release,Debug}[_AMD64][_COMPILERVERSION] # TMP_DIR - directory where object files are created # OUT_DIR - directory where output executables are created # Both TMP_DIR and OUT_DIR are defaulted only if not defined by the # parent makefile (or command line). The default values are # based on BUILDDIRTOP. # STUBPREFIX - name of the stubs library for this project # PRJIMPLIB - output path of the generated project import library # PRJLIBNAME - name of generated project library # PRJLIB - output path of generated project library # PRJSTUBLIBNAME - name of the generated project stubs library # PRJSTUBLIB - output path of the generated project stubs library # RESFILE - output resource file (only if not static build) SUFX = tsgx !if $(DEBUG) BUILDDIRTOP = Debug !else BUILDDIRTOP = Release !endif !if "$(MACHINE)" != "IX86" BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) !endif !if $(VCVER) > 6 BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) !endif !if !$(DEBUG) || $(TCL_VERSION) > 86 || $(DEBUG) && $(UNCHECKED) SUFX = $(SUFX:g=) !endif TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX !if !$(STATIC_BUILD) TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib !if $(MSVCRT) && $(TCL_VERSION) > 86 || !$(MSVCRT) && $(TCL_VERSION) < 87 TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) !endif !endif !if !$(TCL_THREADS) || $(TCL_VERSION) > 86 TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) SUFX = $(SUFX:t=) !endif !ifndef TMP_DIR TMP_DIR = $(TMP_DIRFULL) !ifndef OUT_DIR OUT_DIR = .\$(BUILDDIRTOP) !endif !else !ifndef OUT_DIR OUT_DIR = $(TMP_DIR) !endif !endif # Relative paths -> absolute !if [echo OUT_DIR = \> nmakehlp.out] \ || [nmakehlp -Q "$(OUT_DIR)" >> nmakehlp.out] !error *** Could not fully qualify path OUT_DIR=$(OUT_DIR) !endif !if [echo TMP_DIR = \>> nmakehlp.out] \ || [nmakehlp -Q "$(TMP_DIR)" >> nmakehlp.out] !error *** Could not fully qualify path TMP_DIR=$(TMP_DIR) !endif !include nmakehlp.out # The name of the stubs library for the project being built STUBPREFIX = $(PROJECT)stub # # Set up paths to various Tcl executables and libraries needed by extensions # # TIP 430. Unused for 8.6 but no harm defining it to allow a common rules.vc TCL_ZIP_FILE = libtcl$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip TK_ZIP_FILE = libtk$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip !if $(DOING_TCL) TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe TCLSH = $(OUT_DIR)\$(TCLSHNAME) TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) TCLSCRIPTZIP = $(OUT_DIR)\$(TCL_ZIP_FILE) !if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib !else TCLSTUBLIBNAME = $(STUBPREFIX).lib !endif TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" !else # !$(DOING_TCL) !if $(TCLINSTALL) # Building against an installed Tcl # When building extensions, we need to locate tclsh. Depending on version # of Tcl we are building against, this may or may not have a "t" suffix. # Try various possibilities in turn. TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe !if !exist("$(TCLSH)") TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif !if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib !else TCLSTUBLIB = $(_TCLDIR)\lib\tclstub.lib !endif TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.6). If lib not found check for that possibility. !if !exist("$(TCLIMPLIB)") TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)t$(SUFX:t=).lib !endif TCL_LIBRARY = $(_TCLDIR)\lib TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib TCLDDELIB = $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib TCLSCRIPTZIP = $(_TCLDIR)\lib\$(TCL_ZIP_FILE) TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target TCL_INCLUDES = -I"$(_TCLDIR)\include" !else # Building against Tcl sources TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe !if !exist($(TCLSH)) TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe !endif !if $(TCL_MAJOR_VERSION) == 8 TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib !else TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub.lib !endif TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib # When building extensions, may be linking against Tcl that does not add # "t" suffix (e.g. 8.6). If lib not found check for that possibility. !if !exist("$(TCLIMPLIB)") TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)t$(SUFX:t=).lib !endif TCL_LIBRARY = $(_TCLDIR)\library TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib TCLSCRIPTZIP = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCL_ZIP_FILE) TCLTOOLSDIR = $(_TCLDIR)\tools TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" !endif # TCLINSTALL !if !$(STATIC_BUILD) && "$(TCL_BUILD_FOR)" == "8" tcllibs = "$(TCLSTUBLIB)" !else tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)" !endif !endif # $(DOING_TCL) # We need a tclsh that will run on the host machine as part of the build. # IX86 runs on all architectures. !ifndef TCLSH_NATIVE !if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" TCLSH_NATIVE = $(TCLSH) !else !error You must explicitly set TCLSH_NATIVE for cross-compilation !endif !endif # Do the same for Tk and Tk extensions that require the Tk libraries !if $(DOING_TK) || $(NEED_TK) WISHNAMEPREFIX = wish WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe TKLIBNAME8 = tk$(TK_VERSION)$(SUFX).$(EXT) TKLIBNAME9 = tcl9tk$(TK_VERSION)$(SUFX).$(EXT) !if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" TKLIBNAME = tk$(TK_VERSION)$(SUFX).$(EXT) TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib !else TKLIBNAME = tcl9tk$(TK_VERSION)$(SUFX).$(EXT) TKIMPLIBNAME = tcl9tk$(TK_VERSION)$(SUFX).lib !endif !if $(TK_MAJOR_VERSION) == 8 TKSTUBLIBNAME = tkstub$(TK_VERSION).lib !else TKSTUBLIBNAME = tkstub.lib !endif !if $(DOING_TK) WISH = $(OUT_DIR)\$(WISHNAME) TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME) TKLIB = $(OUT_DIR)\$(TKLIBNAME) TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" TKSCRIPTZIP = $(OUT_DIR)\$(TK_ZIP_FILE) !else # effectively NEED_TK !if $(TKINSTALL) # Building against installed Tk WISH = $(_TKDIR)\bin\$(WISHNAME) TKSTUBLIB = $(_TKDIR)\lib\$(TKSTUBLIBNAME) TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) # When building extensions, may be linking against Tk that does not add # "t" suffix (e.g. 8.6). If lib not found check for that possibility. !if !exist("$(TKIMPLIB)") TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) !endif TK_INCLUDES = -I"$(_TKDIR)\include" TKSCRIPTZIP = $(_TKDIR)\lib\$(TK_ZIP_FILE) !else # Building against Tk sources WISH = $(_TKDIR)\win\$(BUILDDIRTOP)\$(WISHNAME) TKSTUBLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSTUBLIBNAME) TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) # When building extensions, may be linking against Tk that does not add # "t" suffix (e.g. 8.6). If lib not found check for that possibility. !if !exist("$(TKIMPLIB)") TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX:t=).lib TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) !endif TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" TKSCRIPTZIP = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TK_ZIP_FILE) !endif # TKINSTALL tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" !endif # $(DOING_TK) !endif # $(DOING_TK) || $(NEED_TK) # Various output paths PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib # Even when building against Tcl 9, PRJLIBNAME8 must have "t" PRJLIBNAME8 = $(PROJECT)$(VERSION)t$(SUFX:t=).$(EXT) # Even when building against Tcl 8, PRJLIBNAME9 must not have "t" PRJLIBNAME9 = tcl9$(PROJECT)$(VERSION)$(SUFX:t=).$(EXT) !if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8" PRJLIBNAME = $(PRJLIBNAME8) !else PRJLIBNAME = $(PRJLIBNAME9) !endif PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) !if $(TCL_MAJOR_VERSION) == 8 PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib !else PRJSTUBLIBNAME = $(STUBPREFIX).lib !endif PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME) # If extension parent makefile has not defined a resource definition file, # we will generate one from standard template. !if !$(DOING_TCL) && !$(DOING_TK) && !$(STATIC_BUILD) !ifdef RCFILE RESFILE = $(TMP_DIR)\$(RCFILE:.rc=.res) !else RESFILE = $(TMP_DIR)\$(PROJECT).res !endif !endif ################################################################### # 11. Construct the paths for the installation directories # The following macros get defined in this section: # LIB_INSTALL_DIR - where libraries should be installed # BIN_INSTALL_DIR - where the executables should be installed # DOC_INSTALL_DIR - where documentation should be installed # SCRIPT_INSTALL_DIR - where scripts should be installed # INCLUDE_INSTALL_DIR - where C include files should be installed # DEMO_INSTALL_DIR - where demos should be installed # PRJ_INSTALL_DIR - where package will be installed (not set for Tcl and Tk) !if $(DOING_TCL) || $(DOING_TK) LIB_INSTALL_DIR = $(_INSTALLDIR)\lib BIN_INSTALL_DIR = $(_INSTALLDIR)\bin DOC_INSTALL_DIR = $(_INSTALLDIR)\doc !if $(DOING_TCL) SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) MODULE_INSTALL_DIR = $(_INSTALLDIR)\lib\tcl$(TCL_MAJOR_VERSION) !else # DOING_TK SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) !endif DEMO_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)\demos INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include !else # extension other than Tk PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION) !if $(MULTIPLATFORM_INSTALL) LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY) BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR)\$(PLATFORM_IDENTIFY) !else LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR) BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR) !endif DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR) SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR) DEMO_INSTALL_DIR = $(PRJ_INSTALL_DIR)\demos INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include !endif ################################################################### # 12. Set up actual options to be passed to the compiler and linker # Now we have all the information we need, set up the actual flags and # options that we will pass to the compiler and linker. The main # makefile should use these in combination with whatever other flags # and switches are specific to it. # The following macros are defined, names are for historical compatibility: # OPTDEFINES - /Dxxx C macro flags based on user-specified OPTS # COMPILERFLAGS - /Dxxx C macro flags independent of any configuration options # crt - Compiler switch that selects the appropriate C runtime # cdebug - Compiler switches related to debug AND optimizations # cwarn - Compiler switches that set warning levels # cflags - complete compiler switches (subsumes cdebug and cwarn) # ldebug - Linker switches controlling debug information and optimization # lflags - complete linker switches (subsumes ldebug) except subsystem type # dlllflags - complete linker switches to build DLLs (subsumes lflags) # conlflags - complete linker switches for console program (subsumes lflags) # guilflags - complete linker switches for GUI program (subsumes lflags) # baselibs - minimum Windows libraries required. Parent makefile can # define PRJ_LIBS before including rules.rc if additional libs are needed OPTDEFINES = /DSTDC_HEADERS /DUSE_NMAKE=1 !if $(VCVERSION) > 1600 OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1 !else OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1 !endif !if $(VCVERSION) >= 1800 OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1 /DHAVE_STDBOOL_H=1 !endif !if $(TCL_MEM_DEBUG) OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG !endif !if $(TCL_COMPILE_DEBUG) OPTDEFINES = $(OPTDEFINES) /DTCL_COMPILE_DEBUG /DTCL_COMPILE_STATS !endif !if $(TCL_THREADS) && $(TCL_VERSION) < 87 OPTDEFINES = $(OPTDEFINES) /DTCL_THREADS=1 !if $(USE_THREAD_ALLOC) && $(TCL_VERSION) < 87 OPTDEFINES = $(OPTDEFINES) /DUSE_THREAD_ALLOC=1 !endif !endif !if $(STATIC_BUILD) OPTDEFINES = $(OPTDEFINES) /DSTATIC_BUILD !elseif $(TCL_VERSION) > 86 OPTDEFINES = $(OPTDEFINES) /DTCL_WITH_EXTERNAL_TOMMATH !if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" OPTDEFINES = $(OPTDEFINES) /DMP_64BIT !endif !endif !if $(TCL_NO_DEPRECATED) OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED !endif !if $(USE_STUBS) # Note we do not define USE_TCL_STUBS even when building tk since some # test targets in tk do not use stubs !if !$(DOING_TCL) USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS !if $(NEED_TK) USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS !endif !endif !endif # USE_STUBS !if !$(DEBUG) OPTDEFINES = $(OPTDEFINES) /DNDEBUG !if $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_OPTIMIZED !endif !endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT !endif !if $(VCVERSION) < 1300 OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1 !endif !if $(TCL_MAJOR_VERSION) == 8 !if "$(_USE_64BIT_TIME_T)" == "1" OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1 !endif !endif !if "$(TCL_BUILD_FOR)" == "8" OPTDEFINES = $(OPTDEFINES) /DTCL_MAJOR_VERSION=8 /DTK_MAJOR_VERSION=8 !endif # Like the TEA system only set this non empty for non-Tk extensions # Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME # so we pass both !if !$(DOING_TCL) && !$(DOING_TK) PKGNAMEFLAGS = /DPACKAGE_NAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ /DPACKAGE_TCLNAME="\"$(PRJ_PACKAGE_TCLNAME)\"" \ /DPACKAGE_VERSION="\"$(DOTVERSION)\"" \ /DMODULE_SCOPE=extern !endif # crt picks the C run time based on selected OPTS !if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else crt = -MD !endif !else !if $(DEBUG) && !$(UNCHECKED) crt = -MTd !else crt = -MT !endif !endif # cdebug includes compiler options for debugging as well as optimization. !if $(DEBUG) # In debugging mode, optimizations need to be disabled cdebug = -Zi -Od $(DEBUGFLAGS) !else cdebug = $(OPTIMIZATIONS) !if $(SYMBOLS) cdebug = $(cdebug) -Zi !endif !endif # $(DEBUG) # cwarn includes default warning levels, also C4090 (buggy) and C4146 is useless. cwarn = $(WARNINGS) -wd4090 -wd4146 !if "$(MACHINE)" == "AMD64" || "$(MACHINE)" == "ARM64" # Disable pointer<->int warnings related to cast between different sizes # There are a gadzillion of these due to use of ClientData and # clutter up compiler # output increasing chance of a real warning getting lost. So disable them. # Eventually some day, Tcl will be 64-bit clean. cwarn = $(cwarn) -wd4311 -wd4312 !endif ### Common compiler options that are architecture specific !if "$(MACHINE)" == "ARM" carch = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE !else carch = !endif # cpuid is only available on intel machines !if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "AMD64" carch = $(carch) /DHAVE_CPUID=1 !endif !if $(DEBUG) # Turn warnings into errors cwarn = $(cwarn) -WX !endif INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES) !if !$(DOING_TCL) && !$(DOING_TK) INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)" !endif # These flags are defined roughly in the order of the pre-reform # rules.vc/makefile.vc to help visually compare that the pre- and # post-reform build logs # cflags contains generic flags used for building practically all object files cflags = -nologo -c $(COMPILERFLAGS) $(carch) $(cwarn) -Fp$(TMP_DIR)^\ $(cdebug) !if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 cflags = $(cflags) -DTcl_Size=int !endif # appcflags contains $(cflags) and flags for building the application # object files (e.g. tclsh, or wish) pkgcflags contains $(cflags) plus # flags used for building shared object files The two differ in the # BUILD_$(PROJECT) macro which should be defined only for the shared # library *implementation* and not for its caller interface appcflags_nostubs = $(cflags) $(crt) $(INCLUDES) $(TCL_DEFINES) $(PRJ_DEFINES) $(OPTDEFINES) appcflags = $(appcflags_nostubs) $(USE_STUBS_DEFS) pkgcflags = $(appcflags) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT) pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) /DBUILD_$(PROJECT) # stubscflags contains $(cflags) plus flags used for building a stubs # library for the package. Note: /DSTATIC_BUILD is defined in # $(OPTDEFINES) only if the OPTS configuration indicates a static # library. However the stubs library is ALWAYS static hence included # here irrespective of the OPTS setting. # # TBD - tclvfs has a comment that stubs libs should not be compiled with -GL # without stating why. Tcl itself compiled stubs libs with this flag. # so we do not remove it from cflags. -GL may prevent extensions # compiled with one VC version to fail to link against stubs library # compiled with another VC version. Check for this and fix accordingly. stubscflags = $(cflags) $(PKGNAMEFLAGS) $(PRJ_DEFINES) $(OPTDEFINES) /Zl /GL- /DSTATIC_BUILD $(INCLUDES) $(USE_STUBS_DEFS) # Link flags !if $(DEBUG) ldebug = -debug -debugtype:cv !else ldebug = -release -opt:ref -opt:icf,3 !if $(SYMBOLS) ldebug = $(ldebug) -debug -debugtype:cv !endif !endif # Note: Profiling is currently only possible with the Visual Studio Enterprise !if $(PROFILE) ldebug= $(ldebug) -profile !endif ### Declarations common to all linker versions lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) !if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 lflags = $(lflags) -nodefaultlib:ucrt.lib !endif dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows # Libraries that are required for every image. # Extensions should define any additional libraries with $(PRJ_LIBS) winlibs = kernel32.lib advapi32.lib !if $(NEED_TK) winlibs = $(winlibs) gdi32.lib user32.lib uxtheme.lib !endif # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "AMD64" !if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 winlibs = $(winlibs) bufferoverflowU.lib !endif !endif baselibs = $(winlibs) $(PRJ_LIBS) !if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 baselibs = $(baselibs) ucrt.lib !endif ################################################################ # 13. Define standard commands, common make targets and implicit rules CCPKGCMD = $(cc32) $(pkgcflags) -Fo$(TMP_DIR)^\ CCAPPCMD = $(cc32) $(appcflags) -Fo$(TMP_DIR)^\ CCSTUBSCMD = $(cc32) $(stubscflags) -Fo$(TMP_DIR)^\ LIBCMD = $(lib32) -nologo $(LINKERFLAGS) -out:$@ DLLCMD = $(link32) $(dlllflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) CONEXECMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ $(TCL_INCLUDES) /DSTATIC_BUILD=$(STATIC_BUILD) \ /DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ /DCOMMAVERSION=$(RCCOMMAVERSION) \ /DDOTVERSION=\"$(DOTVERSION)\" \ /DVERSION=\"$(VERSION)\" \ /DSUFX=\"$(SUFX)\" \ /DPROJECT=\"$(PROJECT)\" \ /DPRJLIBNAME=\"$(PRJLIBNAME)\" !ifndef DEFAULT_BUILD_TARGET DEFAULT_BUILD_TARGET = $(PROJECT) !endif default-target: $(DEFAULT_BUILD_TARGET) !if $(MULTIPLATFORM_INSTALL) default-pkgindex: @echo if {[package vsatisfies [package provide Tcl] 9.0]} { > $(OUT_DIR)\pkgIndex.tcl @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl @echo } else { >> $(OUT_DIR)\pkgIndex.tcl @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl @echo } >> $(OUT_DIR)\pkgIndex.tcl !else default-pkgindex: @echo if {[package vsatisfies [package provide Tcl] 9.0]} { > $(OUT_DIR)\pkgIndex.tcl @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ [list load [file join $$dir $(PRJLIBNAME9)]] >> $(OUT_DIR)\pkgIndex.tcl @echo } else { >> $(OUT_DIR)\pkgIndex.tcl @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ [list load [file join $$dir $(PRJLIBNAME8)]] >> $(OUT_DIR)\pkgIndex.tcl @echo } >> $(OUT_DIR)\pkgIndex.tcl !endif default-pkgindex-tea: @if exist $(ROOT)\pkgIndex.tcl.in nmakehlp -s << $(ROOT)\pkgIndex.tcl.in > $(OUT_DIR)\pkgIndex.tcl @PACKAGE_VERSION@ $(DOTVERSION) @PACKAGE_NAME@ $(PRJ_PACKAGE_TCLNAME) @PACKAGE_TCLNAME@ $(PRJ_PACKAGE_TCLNAME) @PKG_LIB_FILE@ $(PRJLIBNAME) @PKG_LIB_FILE8@ $(PRJLIBNAME8) @PKG_LIB_FILE9@ $(PRJLIBNAME9) << default-install: default-install-binaries default-install-libraries !if $(SYMBOLS) default-install: default-install-pdbs !endif # Again to deal with historical brokenness, there is some confusion # in terminlogy. For extensions, the "install-binaries" was used to # locate target directory for *binary shared libraries* and thus # the appropriate macro is LIB_INSTALL_DIR since BIN_INSTALL_DIR is # for executables (exes). On the other hand the "install-libraries" # target is for *scripts* and should have been called "install-scripts". default-install-binaries: $(PRJLIB) @echo Installing binaries to '$(LIB_INSTALL_DIR)' @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" @$(CPY) $(PRJLIB) "$(LIB_INSTALL_DIR)" >NUL # Alias for default-install-scripts default-install-libraries: default-install-scripts default-install-scripts: $(OUT_DIR)\pkgIndex.tcl @echo Installing libraries to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)" @echo Installing package index in '$(SCRIPT_INSTALL_DIR)' @$(CPY) $(OUT_DIR)\pkgIndex.tcl $(SCRIPT_INSTALL_DIR) default-install-stubs: @echo Installing stubs library to '$(SCRIPT_INSTALL_DIR)' @if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" @$(CPY) $(PRJSTUBLIB) "$(SCRIPT_INSTALL_DIR)" >NUL default-install-pdbs: @echo Installing PDBs to '$(LIB_INSTALL_DIR)' @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" @$(CPY) "$(OUT_DIR)\*.pdb" "$(LIB_INSTALL_DIR)\" # "emacs font-lock highlighting fix default-install-docs-html: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.html" "$(DOCDIR)\*.css" "$(DOCDIR)\*.png") do @$(COPY) %f "$(DOC_INSTALL_DIR)" default-install-docs-n: @echo Installing documentation files to '$(DOC_INSTALL_DIR)' @if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)" @if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.n") do @$(COPY) %f "$(DOC_INSTALL_DIR)" default-install-demos: @echo Installing demos to '$(DEMO_INSTALL_DIR)' @if not exist "$(DEMO_INSTALL_DIR)" mkdir "$(DEMO_INSTALL_DIR)" @if exist $(DEMODIR) $(CPYDIR) "$(DEMODIR)" "$(DEMO_INSTALL_DIR)" default-clean: @echo Cleaning $(TMP_DIR)\* ... @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) @echo Cleaning $(WIN_DIR)\nmakehlp.obj, nmakehlp.exe ... @if exist $(WIN_DIR)\nmakehlp.obj del $(WIN_DIR)\nmakehlp.obj @if exist $(WIN_DIR)\nmakehlp.exe del $(WIN_DIR)\nmakehlp.exe @if exist $(WIN_DIR)\nmakehlp.out del $(WIN_DIR)\nmakehlp.out @echo Cleaning $(WIN_DIR)\nmhlp-out.txt ... @if exist $(WIN_DIR)\nmhlp-out.txt del $(WIN_DIR)\nmhlp-out.txt @echo Cleaning $(WIN_DIR)\_junk.pch ... @if exist $(WIN_DIR)\_junk.pch del $(WIN_DIR)\_junk.pch @echo Cleaning $(WIN_DIR)\vercl.x, vercl.i ... @if exist $(WIN_DIR)\vercl.x del $(WIN_DIR)\vercl.x @if exist $(WIN_DIR)\vercl.i del $(WIN_DIR)\vercl.i @echo Cleaning $(WIN_DIR)\versions.vc, version.vc ... @if exist $(WIN_DIR)\versions.vc del $(WIN_DIR)\versions.vc @if exist $(WIN_DIR)\version.vc del $(WIN_DIR)\version.vc default-hose: default-clean @echo Hosing $(OUT_DIR)\* ... @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) # Only for backward compatibility default-distclean: default-hose default-setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) !if "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !endif default-test: default-setup $(PROJECT) @set TCLLIBPATH=$(OUT_DIR:\=/) @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" cd "$(TESTDIR)" && $(DEBUGGER) $(TCLSH) all.tcl $(TESTFLAGS) default-shell: default-setup $(PROJECT) @set TCLLIBPATH=$(OUT_DIR:\=/) @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)" $(DEBUGGER) $(TCLSH) # Generation of Windows version resource !ifdef RCFILE # Note: don't use $** in below rule because there may be other dependencies # and only the "main" rc must be passed to the resource compiler $(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc $(RESCMD) $(RCDIR)\$(PROJECT).rc !else # If parent makefile has not defined a resource definition file, # we will generate one from standard template. $(TMP_DIR)\$(PROJECT).res: $(TMP_DIR)\$(PROJECT).rc $(TMP_DIR)\$(PROJECT).rc: @$(COPY) << $(TMP_DIR)\$(PROJECT).rc #include VS_VERSION_INFO VERSIONINFO FILEVERSION COMMAVERSION PRODUCTVERSION COMMAVERSION FILEFLAGSMASK 0x3fL #ifdef DEBUG FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Tcl extension " PROJECT VALUE "OriginalFilename", PRJLIBNAME VALUE "FileVersion", DOTVERSION VALUE "ProductName", "Package " PROJECT " for Tcl" VALUE "ProductVersion", DOTVERSION END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END << !endif # ifdef RCFILE !ifndef DISABLE_IMPLICIT_RULES DISABLE_IMPLICIT_RULES = 0 !endif !if !$(DISABLE_IMPLICIT_RULES) # Implicit rule definitions - only for building library objects. For stubs and # main application, the makefile should define explicit rules. {$(ROOT)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(WIN_DIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(COMPATDIR)}.c{$(TMP_DIR)}.obj:: $(CCPKGCMD) @<< $< << {$(RCDIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< {$(WIN_DIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< {$(TMP_DIR)}.rc{$(TMP_DIR)}.res: $(RESCMD) $< .SUFFIXES: .SUFFIXES:.c .rc !endif ################################################################ # 14. Sanity check selected options against Tcl build options # When building an extension, certain configuration options should # match the ones used when Tcl was built. Here we check and # warn on a mismatch. !if !$(DOING_TCL) !if $(TCLINSTALL) # Building against an installed Tcl !if exist("$(_TCLDIR)\lib\nmake\tcl.nmake") TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake" !endif !else # !$(TCLINSTALL) - building against Tcl source !if exist("$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake") TCLNMAKECONFIG = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake" !endif !endif # TCLINSTALL !if $(CONFIG_CHECK) !ifdef TCLNMAKECONFIG !include $(TCLNMAKECONFIG) !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)" !error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)). !endif !if $(TCL_VERSION) < 87 && defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC) !message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)). !endif !if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG) !message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)). !endif !endif !endif # TCLNMAKECONFIG !endif # !$(DOING_TCL) #---------------------------------------------------------- # Display stats being used. #---------------------------------------------------------- !if !$(DOING_TCL) !message *** Building against Tcl at '$(_TCLDIR)' !endif !if !$(DOING_TK) && $(NEED_TK) !message *** Building against Tk at '$(_TKDIR)' !endif !message *** Intermediate directory will be '$(TMP_DIR)' !message *** Output directory will be '$(OUT_DIR)' !message *** Installation, if selected, will be in '$(_INSTALLDIR)' !message *** Suffix for binaries will be '$(SUFX)' !message *** Compiler version $(VCVER). Target $(MACHINE), host $(NATIVE_ARCH). !endif # ifdef _RULES_VC tcl9.0.3/win/rules-ext.vc0000644000175000017500000000755115076154273014647 0ustar sergeisergei# This file should only be included in makefiles for Tcl extensions, # NOT in the makefile for Tcl itself. !ifndef _RULES_EXT_VC # We need to run from the directory the parent makefile is located in. # nmake does not tell us what makefile was used to invoke it so parent # makefile has to set the MAKEFILEVC macro or we just make a guess and # warn if we think that is not the case. !if "$(MAKEFILEVC)" == "" !if exist("$(PROJECT).vc") MAKEFILEVC = $(PROJECT).vc !elseif exist("makefile.vc") MAKEFILEVC = makefile.vc !endif !endif # "$(MAKEFILEVC)" == "" !if !exist("$(MAKEFILEVC)") MSG = ^ You must run nmake from the directory containing the project makefile.^ If you are doing that and getting this message, set the MAKEFILEVC^ macro to the name of the project makefile. !message WARNING: $(MSG) !endif !if "$(PROJECT)" == "tcl" !error The rules-ext.vc file is not intended for Tcl itself. !endif # We extract version numbers using the nmakehlp program. For now use # the local copy of nmakehlp. Once we locate Tcl, we will use that # one if it is newer. !if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)" !if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul] !endif !else !if [copy x86_64-w64-mingw32-nmakehlp.exe nmakehlp.exe >NUL] !endif !endif # First locate the Tcl directory that we are working with. !if "$(TCLDIR)" != "" _RULESDIR = $(TCLDIR:/=\) !else # If an installation path is specified, that is also the Tcl directory. # Also Tk never builds against an installed Tcl, it needs Tcl sources !if defined(INSTALLDIR) && "$(PROJECT)" != "tk" _RULESDIR=$(INSTALLDIR:/=\) !else # Locate Tcl sources !if [echo _RULESDIR = \> nmakehlp.out] \ || [nmakehlp -L generic\tcl.h >> nmakehlp.out] _RULESDIR = ..\..\tcl !else !include nmakehlp.out !endif !endif # defined(INSTALLDIR).... !endif # ifndef TCLDIR # Now look for the targets.vc file under the Tcl root. Note we check this # file and not rules.vc because the latter also exists on older systems. !if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl _RULESDIR = $(_RULESDIR)\lib\nmake !elseif exist("$(_RULESDIR)\win\targets.vc") # Building against Tcl sources _RULESDIR = $(_RULESDIR)\win !else # If we have not located Tcl's targets file, most likely we are compiling # against an older version of Tcl and so must use our own support files. _RULESDIR = . !endif !if "$(_RULESDIR)" != "." # Potentially using Tcl's support files. If this extension has its own # nmake support files, need to compare the versions and pick newer. !if exist("rules.vc") # The extension has its own copy !if [echo TCL_RULES_MAJOR = \> versions.vc] \ && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc] !endif !if [echo TCL_RULES_MINOR = \>> versions.vc] \ && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc] !endif !if [echo OUR_RULES_MAJOR = \>> versions.vc] \ && [nmakehlp -V "rules.vc" RULES_VERSION_MAJOR >> versions.vc] !endif !if [echo OUR_RULES_MINOR = \>> versions.vc] \ && [nmakehlp -V "rules.vc" RULES_VERSION_MINOR >> versions.vc] !endif !include versions.vc # We have a newer version of the support files, use them !if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR)) _RULESDIR = . !endif !endif # if exist("rules.vc") !endif # if $(_RULESDIR) != "." # Let rules.vc know what copy of nmakehlp.c to use. NMAKEHLPC = $(_RULESDIR)\nmakehlp.c # Get rid of our internal defines before calling rules.vc !undef TCL_RULES_MAJOR !undef TCL_RULES_MINOR !undef OUR_RULES_MAJOR !undef OUR_RULES_MINOR !if exist("$(_RULESDIR)\rules.vc") !message *** Using $(_RULESDIR)\rules.vc !include "$(_RULESDIR)\rules.vc" !else !error *** Could not locate rules.vc in $(_RULESDIR) !endif !endif # _RULES_EXT_VCtcl9.0.3/win/README0000644000175000017500000000643115104661342013231 0ustar sergeisergeiTcl 9.0 for Windows 1. Introduction --------------- This is the directory where you configure and compile the Windows version of Tcl. This directory also contains source files for Tcl that are specific to Microsoft Windows. The information in this file is maintained on the web at: https://www.tcl-lang.org/doc/howto/compile.html#win 2. Compiling Tcl ---------------- In order to compile Tcl for Windows, you need the following: Tcl 9.0 Source Distribution (plus any patches) and Visual Studio 2015 or newer or Linux + MinGW-w64 [https://www.mingw-w64.org/] (win32 or win64) or Cygwin + MinGW-w64 [https://cygwin.com/install.html] (win32 or win64) or Darwin + MinGW-w64 [https://www.mingw-w64.org/] (win32 or win64) or Msys + MinGW-w64 [https://www.mingw-w64.org/] (win32 or win64) or LLVM MinGW [https://github.com/mstorsjo/llvm-mingw/] (win32 or win64, IX86, AMD64 or ARM64) In practice, this release is built with Visual C++ 6.0 and the TEA Makefile. If you are building with Visual C++, in the "win" subdirectory of the source release, you will find "makefile.vc". This is the makefile for the Visual C++ compiler and uses the stock NMAKE tool. Detailed directions for using it, are in the comments of "makefile.vc". A quick example would be: C:\tcl_source\win\>nmake -f makefile.vc There is also a Developer Studio workspace and project file, too, if you would like to use them. If you are building with Linux, Cygwin or Msys, you can use the configure script that lives in the win subdirectory. The Linux/Cygwin/Msys based configure/build process works just like the UNIX one, so you will want to refer to ../unix/README for available configure options. If you want 64-bit executables (x86_64), you need to configure using the --enable-64bit (or --enable-64bit=arm64) option. Make sure that the x86_64-w64-mingw32 (or aarch64-w64-mingw32) compiler is present. For Cygwin the x86_64 compiler can be found in the "mingw64-x86_64-gcc-core" package, which can be installed through the normal Cygwin install process. If you only want 32-bit executables, the "mingw64-i686-gcc-core" package is what you need. For Linux, Darwin and Msys, you can download a suitable win32 or win64 compiler from [https://sourceforge.net/projects/mingw-w64/files/] Use the Makefile "install" target to install Tcl. It will install it according to the prefix options you provided in the correct directory structure. Note that in order to run tclsh90.exe, you must ensure that tcl90.dll, libtommath.dll and zlib1.dll are on your path, in the system directory, or in the directory containing tclsh90.exe. Note: Tcl no longer provides support for systems earlier than Windows 7. You will also need the Windows Universal C runtime (UCRT): [https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c] 3. Test suite ------------- This distribution contains an extensive test suite for Tcl. Some of the tests are timing dependent and will fail from time to time. If a test is failing consistently, please send us a bug report with as much detail as you can manage to our tracker: https://core.tcl-lang.org/tcl/reportlist In order to run the test suite, you build the "test" target using the appropriate makefile for your compiler. tcl9.0.3/win/nmakehlp.c0000644000175000017500000005115515076154273014327 0ustar sergeisergei/* * ---------------------------------------------------------------------------- * nmakehlp.c -- * * This is used to fix limitations within nmake and the environment. * * Copyright (c) 2002 David Gravereaux. * Copyright (c) 2006 Pat Thoyts * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include #ifdef _MSC_VER #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") #endif #include /* * This library is required for x64 builds with _some_ versions of MSVC */ #if defined(_M_IA64) || defined(_M_AMD64) #if _MSC_VER >= 1400 && _MSC_VER < 1500 #pragma comment(lib, "bufferoverflowU") #endif #endif /* ISO hack for dumb VC++ */ #if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif /* protos */ static int CheckForCompilerFeature(const char *option); static int CheckForLinkerFeature(char **options, int count); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); static int LocateDependency(const char *keyfile); static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); static DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ #define CHUNK 25 #define STATICBUFFERSIZE 1000 typedef struct { HANDLE pipe; char buffer[STATICBUFFERSIZE]; } pipeinfo; pipeinfo Out = {INVALID_HANDLE_VALUE, ""}; pipeinfo Err = {INVALID_HANDLE_VALUE, ""}; /* * exitcodes: 0 == no, 1 == yes, 2 == error */ int main( int argc, char *argv[]) { char msg[300]; DWORD dwWritten; int chars; const char *s; /* * Make sure children (cl.exe and link.exe) are kept quiet. */ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); /* * Make sure the compiler and linker aren't effected by the outside world. */ SetEnvironmentVariable("CL", ""); SetEnvironmentVariable("LINK", ""); if (argc > 1 && *argv[1] == '-') { switch (*(argv[1]+1)) { case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c \n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForCompilerFeature(argv[2]); case 'l': if (argc < 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -l ? ...?\n" "Tests for whether link.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return CheckForLinkerFeature(&argv[2], argc-2); case 'f': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -f \n" "Find a substring within another\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } else if (argc == 3) { /* * If the string is blank, there is no match. */ return 0; } else { return IsIn(argv[2], argv[3]); } case 's': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -s \n" "Perform a set of string map type substutitions on a file\n" "exitcodes: 0\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return SubstituteFile(argv[2], argv[3]); case 'V': if (argc != 4) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -V filename matchstring\n" "Extract a version from a file:\n" "eg: pkgIndex.tcl \"package ifneeded http\"", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 0; } s = GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0'); if (s && *s) { printf("%s\n", s); return 0; } else return 1; /* Version not found. Return non-0 exit code */ case 'Q': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -Q path\n" "Emit the fully qualified path\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return QualifyPath(argv[2]); case 'L': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -L keypath\n" "Emit the fully qualified path of directory containing keypath\n" "exitcodes: 0 == success, 1 == not found, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } return LocateDependency(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, "usage: %s -c|-f|-l|-Q|-s|-V ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } static int CheckForCompilerFeature( const char *option) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; char cmdline[100]; hProcess = GetCurrentProcess(); memset(&pi, 0, sizeof(PROCESS_INFORMATION)); memset(&si, 0, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; memset(&sa, 0, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = FALSE; /* * Create a non-inheritable pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritable, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch "); /* * Append our option for testing */ lstrcat(cmdline, option); /* * Filename to compile, which exists, but is nothing and empty. */ lstrcat(cmdline, " .\\nul"); ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in both streams. * - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002. */ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL || strstr(Out.buffer, "D9002") != NULL || strstr(Err.buffer, "D9002") != NULL || strstr(Out.buffer, "D2021") != NULL || strstr(Err.buffer, "D2021") != NULL); } static int CheckForLinkerFeature( char **options, int count) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; DWORD threadID; char msg[300]; BOOL ok; HANDLE hProcess, h, pipeThreads[2]; int i; char cmdline[255]; hProcess = GetCurrentProcess(); memset(&pi, 0, sizeof(PROCESS_INFORMATION)); memset(&si, 0, sizeof(STARTUPINFO)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = INVALID_HANDLE_VALUE; memset(&sa, 0, sizeof(SECURITY_ATTRIBUTES)); sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; /* * Create a non-inheritible pipe. */ CreatePipe(&Out.pipe, &h, &sa, 0); /* * Dupe the write side, make it inheritable, and close the original. */ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Same as above, but for the error side. */ CreatePipe(&Err.pipe, &h, &sa, 0); DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE); /* * Base command line. */ lstrcpy(cmdline, "link.exe -nologo "); /* * Append our option for testing. */ for (i = 0; i < count; i++) { lstrcat(cmdline, " \""); lstrcat(cmdline, options[i]); lstrcat(cmdline, "\""); } ok = CreateProcess( NULL, /* Module name. */ cmdline, /* Command line. */ NULL, /* Process handle not inheritable. */ NULL, /* Thread handle not inheritable. */ TRUE, /* yes, inherit handles. */ DETACHED_PROCESS, /* No console for you. */ NULL, /* Use parent's environment block. */ NULL, /* Use parent's starting directory. */ &si, /* Pointer to STARTUPINFO structure. */ &pi); /* Pointer to PROCESS_INFORMATION structure. */ if (!ok) { DWORD err = GetLastError(); int chars = snprintf(msg, sizeof(msg) - 1, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } /* * Close our references to the write handles that have now been inherited. */ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); WaitForInputIdle(pi.hProcess, 5000); CloseHandle(pi.hThread); /* * Start the pipe reader threads. */ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID); pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID); /* * Block waiting for the process to end. */ WaitForSingleObject(pi.hProcess, INFINITE); CloseHandle(pi.hProcess); /* * Wait for our pipe to get done reading, should it be a little slow. */ WaitForMultipleObjects(2, pipeThreads, TRUE, 500); CloseHandle(pipeThreads[0]); CloseHandle(pipeThreads[1]); /* * Look for the commandline warning code in the stderr stream. */ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL || strstr(Out.buffer, "LNK4044") != NULL || strstr(Err.buffer, "LNK4044") != NULL || strstr(Out.buffer, "LNK4224") != NULL || strstr(Err.buffer, "LNK4224") != NULL); } static DWORD WINAPI ReadFromPipe( LPVOID args) { pipeinfo *pi = (pipeinfo *) args; char *lastBuf = pi->buffer; DWORD dwRead; BOOL ok; again: if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) { CloseHandle(pi->pipe); return (DWORD)-1; } ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L); if (!ok || dwRead == 0) { CloseHandle(pi->pipe); return 0; } lastBuf += dwRead; goto again; return 0; /* makes the compiler happy */ } static int IsIn( const char *string, const char *substring) { return (strstr(string, substring) != NULL); } /* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version * following the match where a version is anything acceptable to * package provide or package ifneeded. */ static const char * GetVersionFromFile( const char *filename, const char *match, int numdots) { static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); if (fp != NULL) { /* * Read data until we see our match string. */ while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); if (p != NULL) { /* * Skip to first digit after the match. */ p += strlen(match); while (*p && !isdigit((unsigned char)*p)) { ++p; } /* * Find ending whitespace. */ q = p; while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q) && !strchr("ab", q[-1])) || --numdots))) { ++q; } *q = 0; szResult = p; break; } } fclose(fp); } return szResult; } /* * List helpers for the SubstituteFile function */ typedef struct list_item_t { struct list_item_t *nextPtr; char * key; char * value; } list_item_t; /* insert a list item into the list (list may be null) */ static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); itemPtr->nextPtr = NULL; while(*listPtrPtr) { listPtrPtr = &(*listPtrPtr)->nextPtr; } *listPtrPtr = itemPtr; } return itemPtr; } static void list_free(list_item_t **listPtrPtr) { list_item_t *tmpPtr, *listPtr = *listPtrPtr; while (listPtr) { tmpPtr = listPtr; listPtr = listPtr->nextPtr; free(tmpPtr->key); free(tmpPtr->value); free(tmpPtr); } } /* * SubstituteFile -- * As windows doesn't provide anything useful like sed and it's unreliable * to use the tclsh you are building against (consider x-platform builds - * e.g. compiling AMD64 target from IX86) we provide a simple substitution * option here to handle autoconf style substitutions. * The substitution file is whitespace and line delimited. The file should * consist of lines matching the regular expression: * \s*\S+\s+\S*$ * * Usage is something like: * nmakehlp -S << $** > $@ * @PACKAGE_NAME@ $(PACKAGE_NAME) * @PACKAGE_VERSION@ $(PACKAGE_VERSION) * << */ static int SubstituteFile( const char *substitutions, const char *filename) { static char szBuffer[1024], szCopy[1024]; list_item_t *substPtr = NULL; FILE *fp, *sp; fp = fopen(filename, "rt"); if (fp != NULL) { /* * Build a list of substitutions from the first filename */ sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) { unsigned char *ks, *ke, *vs, *ve; ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; vs = ke; while (vs && *vs && isspace(*vs)) ++vs; ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } /* debug: dump the list */ #ifndef NDEBUG { int n = 0; list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr, ++n) { fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value); } } #endif /* * Run the substitutions over each line of the input */ while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); if (m) { char *cp, *op, *sp; cp = szCopy; op = szBuffer; while (op != m) *cp++ = *op++; sp = p->value; while (sp && *sp) *cp++ = *sp++; op += strlen(p->key); while (*op) *cp++ = *op++; *cp = 0; memcpy(szBuffer, szCopy, sizeof(szCopy)); } } printf("%s", szBuffer); } list_free(&substPtr); } fclose(fp); return 0; } BOOL FileExists(LPCTSTR szPath) { #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) #endif DWORD pathAttr = GetFileAttributes(szPath); return (pathAttr != INVALID_FILE_ATTRIBUTES && !(pathAttr & FILE_ATTRIBUTE_DIRECTORY)); } /* * QualifyPath -- * * This composes the current working directory with a provided path * and returns the fully qualified and normalized path. * Mostly needed to setup paths for testing. */ static int QualifyPath( const char *szPath) { char szCwd[MAX_PATH + 1]; GetFullPathName(szPath, sizeof(szCwd)-1, szCwd, NULL); printf("%s\n", szCwd); return 0; } /* * Implements LocateDependency for a single directory. See that command * for an explanation. * Returns 0 if found after printing the directory. * Returns 1 if not found but no errors. * Returns 2 on any kind of error * Basically, these are used as exit codes for the process. */ static int LocateDependencyHelper(const char *dir, const char *keypath) { HANDLE hSearch; char path[MAX_PATH+1]; size_t dirlen; int keylen, ret; WIN32_FIND_DATA finfo; if (dir == NULL || keypath == NULL) { return 2; /* Have no real error reporting mechanism into nmake */ } dirlen = strlen(dir); if (dirlen > sizeof(path) - 3) { return 2; } strncpy(path, dir, dirlen); strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ keylen = strlen(keypath); #if 0 /* This function is not available in Visual C++ 6 */ /* * Use numerics 0 -> FindExInfoStandard, * 1 -> FindExSearchLimitToDirectories, * as these are not defined in Visual C++ 6 */ hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0); #else hSearch = FindFirstFile(path, &finfo); #endif if (hSearch == INVALID_HANDLE_VALUE) { return 1; /* Not found */ } /* Loop through all subdirs checking if the keypath is under there */ ret = 1; /* Assume not found */ do { int sublen; /* * We need to check it is a directory despite the * FindExSearchLimitToDirectories in the above call. See SDK docs */ if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { continue; } sublen = strlen(finfo.cFileName); if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) { continue; /* Path does not fit, assume not matched */ } strncpy(path+dirlen+1, finfo.cFileName, sublen); path[dirlen+1+sublen] = '\\'; strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); if (FileExists(path)) { /* Found a match, print to stdout */ path[dirlen+1+sublen] = '\0'; QualifyPath(path); ret = 0; break; } } while (FindNextFile(hSearch, &finfo)); FindClose(hSearch); return ret; } /* * LocateDependency -- * * Locates a dependency for a package. * keypath - a relative path within the package directory * that is used to confirm it is the correct directory. * The search path for the package directory is currently only * the parent and grandparent of the current working directory. * If found, the command prints * name_DIRPATH= * and returns 0. If not found, does not print anything and returns 1. */ static int LocateDependency(const char *keypath) { size_t i; int ret; static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { ret = LocateDependencyHelper(paths[i], keypath); if (ret == 0) { return ret; } } return ret; } /* * Local variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * indent-tabs-mode: t * tab-width: 8 * End: */ tcl9.0.3/win/makefile.vc0000644000175000017500000012375115104661342014465 0ustar sergeisergei#------------------------------------------------------------- -*- makefile -*- # # Microsoft Visual C++ makefile for building Tcl with nmake # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. # Copyright (c) 2001-2004 David Gravereaux. # Copyright (c) 2003-2008 Pat Thoyts. # Copyright (c) 2017 Ashok P. Nadkarni #------------------------------------------------------------------------------ # General usage: # nmake [-nologo] -f makefile.vc [TARGET|MACRODEF [TARGET|MACRODEF] [...]] # # For MACRODEF, see TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) # or examine Sections 7-9 in rules.vc. # # Possible values for TARGET are: # release -- Builds everything that ships with a release. (default) # core -- Builds the core [tclXX.(dll|lib)] # shell -- Builds tclsh and the core. # dlls -- Just builds the windows extensions. # all -- Builds everything. # test -- Builds and runs the test suite. # tcltest -- Just builds the test shell. # install -- Installs the built binaries and libraries to $(INSTALLDIR) # as the root of the install tree. # tidy/clean/hose -- varying levels of cleaning. # genstubs -- Rebuilds the Stubs table and support files (dev only). # depend -- Generates an accurate set of source dependancies for this # makefile. Helpful to avoid problems when the sources are # refreshed and you rebuild, but can "overbuild" when common # headers like tclInt.h just get small changes. # htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the # troff manual pages found in $(ROOT)\doc. You need to # have installed the HTML Help Compiler package from Microsoft # to produce the .chm file. # # The steps to setup a Visual C++ environment depend on which # version of Visual Studio and/or the Windows SDK you are building # against and are not described here. The simplest method is generally # to start a command shell using one of the short cuts installed by # Visual Studio/Windows SDK for the appropriate target architecture. # # NOTE: For older (Visual C++ 6 or the 2003 SDK), to use the Platform # SDK (not expressly needed), run setenv.bat after vcvars32.bat # according to the instructions for it. This can also turn on the # 64-bit compiler, if your SDK has it. # # Basic macros and options usable on the commandline (see rules.vc for more info): # OPTS=nomsvcrt,noembed,nothreads,pdbs,profile,static,symbols,thrdalloc,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # # noembed = Without this option, the Tcl core library scripts # are embedded into the executable if "static" is # specified in OPTS, or into the DLL otherwise. If # "noembed" is specified, the scripts are not embedded # but copied to the installation target (as in 8.6). # nomsvcrt = Affects the static option only to switch it from # using msvcrt(d) as the C runtime [by default] to # libcmt(d). This is useful for static embedding # support. # none = Overrides all other options to nothing. # nothreads = Turns off full multithreading support (default on). # pdbs = Produce separate debug symbol files. # profile = Adds profiling hooks. Map file is assumed. # static = Builds a static library of the core instead of a # dll. The shell will be static (and large), and # have the dde and registry extensions linked inside. # symbols = Adds symbols for step debugging. # thrdalloc = Use the thread allocator (shared global free pool). # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # # compdbg = Enables byte compilation logging. # memdbg = Enables the debugging memory allocator. # # CHECKS=64bit,fullwarn,nodep,none # Sets special macros for checking compatibility. # # 64bit = Enable 64bit portability warnings (if available) # fullwarn = Builds with full compiler and link warnings enabled. # Very verbose. # nodep = Turns off compatibility macros to ensure the core # isn't being built with deprecated functions. # # MACHINE=(ALPHA|AMD64|ARM64|IA64|IX86) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default # when not specified. If the CPU environment variable has been # set (ie: recent Platform SDK) then MACHINE is set from CPU. # # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be # changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will be $(OUT_DIR)\ by default. # # TESTPAT= # Reads the tests requested to be run from this file. # # Examples: # c:\tcl_src\win\>nmake -f makefile.vc release # c:\tcl_src\win\>nmake -f makefile.vc test # c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl # c:\tcl_src\win\>nmake -f makefile.vc release OPTS=pdbs # c:\tcl_src\win\>nmake -f makefile.vc release OPTS=symbols # # NOTE: # Before modifying this file, check whether the modification is applicable # to building extensions as well and if so, modify rules.vc instead. # The PROJECT macro is used by rules.vc for generating appropriate # macros and rules. PROJECT = tcl # Default target to build if no target is specified. If unspecified, the # rules.vc file will set up "all" as the target. DEFAULT_BUILD_TARGET = release # We have a custom resource file RCFILE = tcl.rc # The rules.vc file does much of the hard work in terms of defining # the build configuration, macros, output directories etc. !include "rules.vc" # # The tclsh executable without the embedded libzip. We need this # separately from tclsh to have dependency and build order work right. # Ditto for the DLL and tcltest TCLSHRAW=$(TCLSH:.exe=-raw.exe) TCLLIBRAW=$(TCLLIB:.dll=-raw.dll) # Tcl version info based on macros set up by rules.vc DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) # The staticpkg option is not longer supported in Tcl 9.0 # though extensions may still be using it. If specified together # with "static", ignore it as that is now the default for # static build. For non-static builds, no longer supported # now (was permitted in 8.6) !if $(TCL_USE_STATIC_PACKAGES) !if $(STATIC_BUILD) !message *** NOTE: The "staticpkg" option redundant in 9.0. !else !message *** NOTE: The "staticpkg" option ignored for shared library builds. !endif !endif !if [nmakehlp -f $(OPTS) "noembed"] !message *** Option noembed specified. Tcl script library will not be appended to the binary. TCL_EMBED_SCRIPTS = 0 TCL_TEST_LIBRARY=$(ROOT:\=/)/library !else !message *** Tcl script library will be appended to the binary. TCL_EMBED_SCRIPTS = 1 TCL_TEST_LIBRARY= !endif # We need versions of various core packages to generate appropriate # file names during installation. !if [echo REM = This file is generated from makefile.vc > versions.vc] !endif !if [echo PKG_HTTP_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] !endif !if [echo PKG_OPT_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\opt\pkgIndex.tcl opt >> versions.vc] !endif !if [echo PKG_COOKIEJAR_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\cookiejar\pkgIndex.tcl cookiejar >> versions.vc] !endif !if [echo PKG_TCLTEST_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] !endif !if [echo PKG_MSGCAT_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] !endif !if [echo PKG_PLATFORM_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] !endif !if [echo PKG_SHELL_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] !endif !if [echo PKG_DDE_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] !endif !if [echo PKG_REG_VER =\>> versions.vc] \ && [nmakehlp -V ..\library\registry\pkgIndex.tcl "registry " >> versions.vc] !endif !include versions.vc DDEDOTVERSION = 1.4 DDEVERSION = $(DDEDOTVERSION:.=) REGDOTVERSION = 1.3 REGVERSION = $(REGDOTVERSION:.=) TCLREGLIBNAME = $(PROJECT)9registry$(REGVERSION)$(SUFX:t=).$(EXT) TCLREGLIB = $(OUT_DIR)\$(TCLREGLIBNAME) TCLDDELIBNAME = $(PROJECT)9dde$(DDEVERSION)$(SUFX:t=).$(EXT) TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME) TCLTEST = $(OUT_DIR)\$(PROJECT)test$(VERSION)$(SUFX:t=).exe TCLTESTRAW = $(TCLTEST:.exe=-raw.exe) TCLSHOBJS = \ $(TMP_DIR)\tclAppInit.obj \ $(TMP_DIR)\tclsh.res TCLTESTOBJS = \ $(TMP_DIR)\tclTest.obj \ $(TMP_DIR)\tclTestObj.obj \ $(TMP_DIR)\tclTestProcBodyObj.obj \ $(TMP_DIR)\tclMutexTest.obj \ $(TMP_DIR)\tclThreadTest.obj \ $(TMP_DIR)\tclWinTest.obj \ $(TMP_DIR)\tclTestABSList.obj \ !if !$(STATIC_BUILD) $(OUT_DIR)\tommath.lib \ !endif $(TMP_DIR)\testMain.obj \ $(TMP_DIR)\tcltest.res COREOBJS = \ $(TMP_DIR)\regcomp.obj \ $(TMP_DIR)\regerror.obj \ $(TMP_DIR)\regexec.obj \ $(TMP_DIR)\regfree.obj \ $(TMP_DIR)\tclArithSeries.obj \ $(TMP_DIR)\tclAlloc.obj \ $(TMP_DIR)\tclAssembly.obj \ $(TMP_DIR)\tclAsync.obj \ $(TMP_DIR)\tclBasic.obj \ $(TMP_DIR)\tclBinary.obj \ $(TMP_DIR)\tclCkalloc.obj \ $(TMP_DIR)\tclClock.obj \ $(TMP_DIR)\tclClockFmt.obj \ $(TMP_DIR)\tclCmdAH.obj \ $(TMP_DIR)\tclCmdIL.obj \ $(TMP_DIR)\tclCmdMZ.obj \ $(TMP_DIR)\tclCompCmds.obj \ $(TMP_DIR)\tclCompCmdsGR.obj \ $(TMP_DIR)\tclCompCmdsSZ.obj \ $(TMP_DIR)\tclCompExpr.obj \ $(TMP_DIR)\tclCompile.obj \ $(TMP_DIR)\tclConfig.obj \ $(TMP_DIR)\tclDate.obj \ $(TMP_DIR)\tclDictObj.obj \ $(TMP_DIR)\tclDisassemble.obj \ $(TMP_DIR)\tclEncoding.obj \ $(TMP_DIR)\tclEnsemble.obj \ $(TMP_DIR)\tclEnv.obj \ $(TMP_DIR)\tclEvent.obj \ $(TMP_DIR)\tclExecute.obj \ $(TMP_DIR)\tclFCmd.obj \ $(TMP_DIR)\tclFileName.obj \ $(TMP_DIR)\tclGet.obj \ $(TMP_DIR)\tclHash.obj \ $(TMP_DIR)\tclHistory.obj \ $(TMP_DIR)\tclIcu.obj \ $(TMP_DIR)\tclIndexObj.obj \ $(TMP_DIR)\tclInterp.obj \ $(TMP_DIR)\tclIO.obj \ $(TMP_DIR)\tclIOCmd.obj \ $(TMP_DIR)\tclIOGT.obj \ $(TMP_DIR)\tclIOSock.obj \ $(TMP_DIR)\tclIOUtil.obj \ $(TMP_DIR)\tclIORChan.obj \ $(TMP_DIR)\tclIORTrans.obj \ $(TMP_DIR)\tclLink.obj \ $(TMP_DIR)\tclListObj.obj \ $(TMP_DIR)\tclLiteral.obj \ $(TMP_DIR)\tclLoad.obj \ $(TMP_DIR)\tclMainW.obj \ $(TMP_DIR)\tclMain.obj \ $(TMP_DIR)\tclNamesp.obj \ $(TMP_DIR)\tclNotify.obj \ $(TMP_DIR)\tclOO.obj \ $(TMP_DIR)\tclOOBasic.obj \ $(TMP_DIR)\tclOOCall.obj \ $(TMP_DIR)\tclOODefineCmds.obj \ $(TMP_DIR)\tclOOInfo.obj \ $(TMP_DIR)\tclOOMethod.obj \ $(TMP_DIR)\tclOOProp.obj \ $(TMP_DIR)\tclOOStubInit.obj \ $(TMP_DIR)\tclObj.obj \ $(TMP_DIR)\tclOptimize.obj \ $(TMP_DIR)\tclPanic.obj \ $(TMP_DIR)\tclParse.obj \ $(TMP_DIR)\tclPathObj.obj \ $(TMP_DIR)\tclPipe.obj \ $(TMP_DIR)\tclPkg.obj \ $(TMP_DIR)\tclPkgConfig.obj \ $(TMP_DIR)\tclPosixStr.obj \ $(TMP_DIR)\tclPreserve.obj \ $(TMP_DIR)\tclProc.obj \ $(TMP_DIR)\tclProcess.obj \ $(TMP_DIR)\tclRegexp.obj \ $(TMP_DIR)\tclResolve.obj \ $(TMP_DIR)\tclResult.obj \ $(TMP_DIR)\tclScan.obj \ $(TMP_DIR)\tclStringObj.obj \ $(TMP_DIR)\tclStrIdxTree.obj \ $(TMP_DIR)\tclStrToD.obj \ $(TMP_DIR)\tclStubInit.obj \ $(TMP_DIR)\tclThread.obj \ $(TMP_DIR)\tclThreadAlloc.obj \ $(TMP_DIR)\tclThreadJoin.obj \ $(TMP_DIR)\tclThreadStorage.obj \ $(TMP_DIR)\tclTimer.obj \ $(TMP_DIR)\tclTomMathInterface.obj \ $(TMP_DIR)\tclTrace.obj \ $(TMP_DIR)\tclUtf.obj \ $(TMP_DIR)\tclUtil.obj \ $(TMP_DIR)\tclVar.obj \ $(TMP_DIR)\tclZipfs.obj \ $(TMP_DIR)\tclZlib.obj !if $(STATIC_BUILD) ZLIBOBJS = \ $(TMP_DIR)\adler32.obj \ $(TMP_DIR)\compress.obj \ $(TMP_DIR)\crc32.obj \ $(TMP_DIR)\deflate.obj \ $(TMP_DIR)\infback.obj \ $(TMP_DIR)\inffast.obj \ $(TMP_DIR)\inflate.obj \ $(TMP_DIR)\inftrees.obj \ $(TMP_DIR)\trees.obj \ $(TMP_DIR)\uncompr.obj \ $(TMP_DIR)\zutil.obj !else ZLIBOBJS = $(OUT_DIR)\zdll.lib !endif !if $(STATIC_BUILD) TOMMATHOBJS = \ $(TMP_DIR)\bn_mp_add.obj \ $(TMP_DIR)\bn_mp_add_d.obj \ $(TMP_DIR)\bn_mp_and.obj \ $(TMP_DIR)\bn_mp_clamp.obj \ $(TMP_DIR)\bn_mp_clear.obj \ $(TMP_DIR)\bn_mp_clear_multi.obj \ $(TMP_DIR)\bn_mp_cmp.obj \ $(TMP_DIR)\bn_mp_cmp_d.obj \ $(TMP_DIR)\bn_mp_cmp_mag.obj \ $(TMP_DIR)\bn_mp_cnt_lsb.obj \ $(TMP_DIR)\bn_mp_copy.obj \ $(TMP_DIR)\bn_mp_count_bits.obj \ $(TMP_DIR)\bn_mp_div.obj \ $(TMP_DIR)\bn_mp_div_d.obj \ $(TMP_DIR)\bn_mp_div_2.obj \ $(TMP_DIR)\bn_mp_div_2d.obj \ $(TMP_DIR)\bn_s_mp_div_3.obj \ $(TMP_DIR)\bn_mp_exch.obj \ $(TMP_DIR)\bn_mp_expt_n.obj \ $(TMP_DIR)\bn_mp_get_mag_u64.obj \ $(TMP_DIR)\bn_mp_grow.obj \ $(TMP_DIR)\bn_mp_init.obj \ $(TMP_DIR)\bn_mp_init_copy.obj \ $(TMP_DIR)\bn_mp_init_i64.obj \ $(TMP_DIR)\bn_mp_init_multi.obj \ $(TMP_DIR)\bn_mp_init_set.obj \ $(TMP_DIR)\bn_mp_init_size.obj \ $(TMP_DIR)\bn_mp_init_u64.obj \ $(TMP_DIR)\bn_mp_lshd.obj \ $(TMP_DIR)\bn_mp_mod.obj \ $(TMP_DIR)\bn_mp_mod_2d.obj \ $(TMP_DIR)\bn_mp_mul.obj \ $(TMP_DIR)\bn_mp_mul_2.obj \ $(TMP_DIR)\bn_mp_mul_2d.obj \ $(TMP_DIR)\bn_mp_mul_d.obj \ $(TMP_DIR)\bn_mp_neg.obj \ $(TMP_DIR)\bn_mp_or.obj \ $(TMP_DIR)\bn_mp_pack.obj \ $(TMP_DIR)\bn_mp_pack_count.obj \ $(TMP_DIR)\bn_mp_radix_size.obj \ $(TMP_DIR)\bn_mp_radix_smap.obj \ $(TMP_DIR)\bn_mp_read_radix.obj \ $(TMP_DIR)\bn_mp_rshd.obj \ $(TMP_DIR)\bn_mp_set_i64.obj \ $(TMP_DIR)\bn_mp_set_u64.obj \ $(TMP_DIR)\bn_mp_shrink.obj \ $(TMP_DIR)\bn_mp_sqr.obj \ $(TMP_DIR)\bn_mp_sqrt.obj \ $(TMP_DIR)\bn_mp_sub.obj \ $(TMP_DIR)\bn_mp_sub_d.obj \ $(TMP_DIR)\bn_mp_signed_rsh.obj \ $(TMP_DIR)\bn_mp_to_ubin.obj \ $(TMP_DIR)\bn_mp_to_radix.obj \ $(TMP_DIR)\bn_mp_ubin_size.obj \ $(TMP_DIR)\bn_mp_unpack.obj \ $(TMP_DIR)\bn_mp_xor.obj \ $(TMP_DIR)\bn_mp_zero.obj \ $(TMP_DIR)\bn_s_mp_add.obj \ $(TMP_DIR)\bn_s_mp_balance_mul.obj \ $(TMP_DIR)\bn_s_mp_karatsuba_mul.obj \ $(TMP_DIR)\bn_s_mp_karatsuba_sqr.obj \ $(TMP_DIR)\bn_s_mp_mul_digs.obj \ $(TMP_DIR)\bn_s_mp_mul_digs_fast.obj \ $(TMP_DIR)\bn_s_mp_reverse.obj \ $(TMP_DIR)\bn_s_mp_sqr.obj \ $(TMP_DIR)\bn_s_mp_sqr_fast.obj \ $(TMP_DIR)\bn_s_mp_sub.obj \ $(TMP_DIR)\bn_s_mp_toom_sqr.obj \ $(TMP_DIR)\bn_s_mp_toom_mul.obj !else TOMMATHOBJS = $(OUT_DIR)\tommath.lib !endif PLATFORMOBJS = \ $(TMP_DIR)\tclWin32Dll.obj \ $(TMP_DIR)\tclWinChan.obj \ $(TMP_DIR)\tclWinConsole.obj \ $(TMP_DIR)\tclWinError.obj \ $(TMP_DIR)\tclWinFCmd.obj \ $(TMP_DIR)\tclWinFile.obj \ $(TMP_DIR)\tclWinInit.obj \ $(TMP_DIR)\tclWinLoad.obj \ $(TMP_DIR)\tclWinNotify.obj \ $(TMP_DIR)\tclWinPipe.obj \ $(TMP_DIR)\tclWinSerial.obj \ $(TMP_DIR)\tclWinSock.obj \ $(TMP_DIR)\tclWinThrd.obj \ $(TMP_DIR)\tclWinTime.obj \ !if $(STATIC_BUILD) $(TMP_DIR)\tclWinPanic.obj \ $(TMP_DIR)\tclWinReg.obj \ $(TMP_DIR)\tclWinDde.obj \ !else $(TMP_DIR)\tcl.res !endif TCLOBJS = $(COREOBJS) $(ZLIBOBJS) $(TOMMATHOBJS) $(PLATFORMOBJS) TCLSTUBOBJS = \ $(TMP_DIR)\tclStubLib.obj \ $(TMP_DIR)\tclStubCall.obj \ $(TMP_DIR)\tclStubLibTbl.obj \ $(TMP_DIR)\tclTomMathStubLib.obj \ $(TMP_DIR)\tclOOStubLib.obj \ $(TMP_DIR)\tclWinPanic.obj ### The following paths CANNOT have spaces in them as they appear on ### the left side of implicit rules. TOMMATHDIR = $(ROOT)\libtommath PKGSDIR = $(ROOT)\pkgs LIBTCLVFSSUBDIR = libtcl.vfs LIBTCLVFS = $(OUT_DIR)\$(LIBTCLVFSSUBDIR) # Additional include and C macro definitions for the implicit rules # defined in rules.vc PRJ_INCLUDES = -I"$(TOMMATHDIR)" PRJ_DEFINES = /DMP_PREC=4 /Dinline=__inline /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMP_FIXED_CUTOFFS !if $(STATIC_BUILD) PRJ_DEFINES = $(PRJ_DEFINES) /DTCL_WITH_INTERNAL_ZLIB !endif # Additional Link libraries needed beyond those in rules.vc PRJ_LIBS = netapi32.lib user32.lib userenv.lib ws2_32.lib #--------------------------------------------------------------------- # TclTest flags #--------------------------------------------------------------------- !if "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !endif #--------------------------------------------------------------------- # Project specific targets # There are 4 primary build configurations to consider from the combination # of static/shared and embed/noembed of the library zip. The targets are # done in the following order. # $(TCLLIB) - this is either the core static .lib or the .dll. The target # build does not embed the library zip in the DLL irrespective # of the noembed setting. A copy is made as $(TCLLIBRAW) # as the $(TCLLIB) binary is potentially modified later. # dlls - these are the registry and dde DLL's or static libraries # $(TCLSH) - the Tcl shell WITHOUT any embedded zip. This needs $(TCLLIB) # to be built first as it links against it. A copy is made # as $(TCLSHRAW) as $(TCLSH) binary may be modified later. # $(TCLSCRIPTZIP) - the zip file that is to be embedded. Note this also # ships separately and needs to be built irrespective of the # whether it is embedded or not. All above targets need to # be built prior as they are used to build the zip (unlike # Unix where the external zip program is used.) # core - this virtual target builds the final release ready Tcl # library. For shared, embedded builds it appends $(TCLSCRIPTZIP) # to the $(TCLLIB). For other build configurations, this # is a no-op. # shell - this virtual target builds the final release ready tclsh shell. # For static, embedded builds it appends $(TCLSCRIPTZIP) # to the $(TCLSH). For other build configurations, this # is a no-op. # release - Everything that builds as part of a release #--------------------------------------------------------------------- release: setup libtclzip core dlls shell pkgs all: setup libtclzip core dlls shell pkgs core: setup $(TCLLIB) !if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD) core: libtclzip @$(COPY) /b "$(TCLLIBRAW)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)" !endif shell: setup core $(TCLSH) !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) shell: libtclzip @$(COPY) /b "$(TCLSHRAW)"+"$(TCLSCRIPTZIP)" "$(TCLSH)" !endif dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll libtclzip: $(TCLSCRIPTZIP) tcltest: setup core $(TCLTEST) dlls !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) tcltest: libtclzip @$(COPY) /b "$(TCLTESTRAW)"+"$(TCLSCRIPTZIP)" "$(TCLTEST)" !endif install: install-binaries install-libraries install-docs install-pkgs !if $(SYMBOLS) install: install-pdbs !endif setup: default-setup test: test-core test-pkgs test-core: tcltest set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile << package ifneeded dde 1.4.6 [list load "$(TCLDDELIB:\=/)"] package ifneeded registry 1.3.7 [list load "$(TCLREGLIB:\=/)"] << runtest: setup $(TCLTEST) dlls set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLTEST) $(SCRIPT) runshell: setup core shell dlls set TCL_LIBRARY=$(TCL_TEST_LIBRARY) $(DEBUGGER) $(TCLSH) $(SCRIPT) !if $(STATIC_BUILD) $(TCLLIB): $(TCLOBJS) $(LIBCMD) @<< $** << !else $(TCLLIB): $(TCLOBJS) $(DLLCMD) @<< $** << $(_VC_MANIFEST_EMBED_DLL) !if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD) $(COPY) $@ $(TCLLIBRAW) !endif $(TCLIMPLIB): $(TCLLIB) !endif # $(STATIC_BUILD) $(TCLSTUBLIB): $(TCLSTUBOBJS) $(LIBCMD) -nodefaultlib $(TCLSTUBOBJS) $(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(CONEXECMD) -stack:2300000 $** copy $(TMP_DIR)\tclsh.exe.manifest $(TCLSH).manifest $(_VC_MANIFEST_EMBED_EXE) !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) $(COPY) $@ $(TCLSHRAW) !endif $(TCLTEST): $(TCLTESTOBJS) $(TCLSTUBLIB) $(TCLIMPLIB) $(CONEXECMD) -stack:2300000 $** copy $(TMP_DIR)\tclsh.exe.manifest $(TCLTEST).manifest $(_VC_MANIFEST_EMBED_EXE) !if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD) $(COPY) $@ $(TCLTESTRAW) !endif !if $(STATIC_BUILD) $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(LIBCMD) $** !else $(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB) $(DLLCMD) $** $(_VC_MANIFEST_EMBED_DLL) !endif !if $(STATIC_BUILD) $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(LIBCMD) $** !else $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB) $(DLLCMD) $** $(_VC_MANIFEST_EMBED_DLL) !endif !if "$(MACHINE)" == "ARM64" $(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win64-arm\zlib1.dll $(COPY) $(COMPATDIR)\zlib\win64-arm\zlib1.dll $(OUT_DIR)\zlib1.dll $(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win64-arm\zdll.lib $(COPY) $(COMPATDIR)\zlib\win64-arm\zdll.lib $(OUT_DIR)\zdll.lib $(OUT_DIR)\libtommath.dll: $(TOMMATHDIR)\win64-arm\libtommath.dll $(COPY) $(TOMMATHDIR)\win64-arm\libtommath.dll $(OUT_DIR)\libtommath.dll $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win64-arm\tommath.lib $(COPY) $(TOMMATHDIR)\win64-arm\tommath.lib $(OUT_DIR)\tommath.lib !elseif "$(MACHINE)" == "IX86" $(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win32\zlib1.dll $(COPY) $(COMPATDIR)\zlib\win32\zlib1.dll $(OUT_DIR)\zlib1.dll $(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win32\zdll.lib $(COPY) $(COMPATDIR)\zlib\win32\zdll.lib $(OUT_DIR)\zdll.lib $(OUT_DIR)\libtommath.dll: $(TOMMATHDIR)\win32\libtommath.dll $(COPY) $(TOMMATHDIR)\win32\libtommath.dll $(OUT_DIR)\libtommath.dll $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win32\tommath.lib $(COPY) $(TOMMATHDIR)\win32\tommath.lib $(OUT_DIR)\tommath.lib !else $(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win64\zlib1.dll $(COPY) $(COMPATDIR)\zlib\win64\zlib1.dll $(OUT_DIR)\zlib1.dll $(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win64\zdll.lib $(COPY) $(COMPATDIR)\zlib\win64\zdll.lib $(OUT_DIR)\zdll.lib $(OUT_DIR)\libtommath.dll: $(TOMMATHDIR)\win64\libtommath.dll $(COPY) $(TOMMATHDIR)\win64\libtommath.dll $(OUT_DIR)\libtommath.dll $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win64\tommath.lib $(COPY) $(TOMMATHDIR)\win64\tommath.lib $(OUT_DIR)\tommath.lib !endif $(TCLSCRIPTZIP): $(TCLLIB) $(TCLSH) dlls @echo Building Tcl library zip file $(TCLSCRIPTZIP) @set TCL_LIBRARY=$(ROOT:\=/)/library @if exist "$(LIBTCLVFS)" $(RMDIR) "$(LIBTCLVFS)" @$(MKDIR) "$(LIBTCLVFS)" @$(CPYDIR) $(LIBDIR) "$(LIBTCLVFS)\tcl_library" @move /y "$(LIBTCLVFS)\tcl_library\manifest.txt" "$(LIBTCLVFS)\tcl_library\pkgIndex.tcl" > NUL # Remove the registry and dde directories as the DLLS are still external @del "$(LIBTCLVFS)\tcl_library\registry\pkgIndex.tcl" @rmdir "$(LIBTCLVFS)\tcl_library\registry" @del "$(LIBTCLVFS)\tcl_library\dde\pkgIndex.tcl" @rmdir "$(LIBTCLVFS)\tcl_library\dde" @echo cd {$(OUT_DIR)} > "$(OUT_DIR)\zipper.tcl" @echo file delete -force {$(@F)} >> "$(OUT_DIR)\zipper.tcl" @echo zipfs mkzip {$(@F)} {$(LIBTCLVFSSUBDIR)} {$(LIBTCLVFSSUBDIR)} >> "$(OUT_DIR)\zipper.tcl" @$(TCLSH_NATIVE) "$(OUT_DIR)/zipper.tcl" pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ pushd "%~fd\win" & \ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) &\ popd \ ) test-pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ pushd "%~fd\win" & \ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) test &\ popd \ ) install-pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ pushd "%~fd\win" & \ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) install &\ popd \ ) clean-pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ pushd "%~fd\win" & \ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) clean &\ popd \ ) hose-pkgs: @for /d %d in ($(PKGSDIR)\*) do \ @if exist "%~fd\win\makefile.vc" ( \ pushd "%~fd\win" & \ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) hose &\ popd \ ) #--------------------------------------------------------------------- # Regenerate the stubs files. [Development use only] #--------------------------------------------------------------------- genstubs: !if !exist($(TCLSH)) @echo Build tclsh first! !else $(TCLSH) $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ $(GENERICDIR:\=/)/tcl.decls $(GENERICDIR:\=/)/tclInt.decls \ $(GENERICDIR:\=/)/tclTomMath.decls $(TCLSH) $(TOOLSDIR:\=/)/genStubs.tcl $(GENERICDIR:\=/) \ $(GENERICDIR:\=/)/tclOO.decls !endif #--------------------------------------------------------------------- # Build the Windows HTML help file. #--------------------------------------------------------------------- !if defined(PROCESSOR_ARCHITECTURE) && "$(PROCESSOR_ARCHITECTURE)" == "AMD64" HHC="%ProgramFiles(x86)%\HTML Help Workshop\hhc.exe" !else HHC="%ProgramFiles%\HTML Help Workshop\hhc.exe" !endif HTMLDIR=$(OUT_DIR)\html HTMLBASE=TclTk$(VERSION) HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm htmlhelp: $(CHMFILE) htmldocs: $(DOCDIR)\* @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl "--htmldir=$(HTMLDIR)" $(CHMFILE): htmldocs chmsetup @echo Compiling HTML help project -"$(HHC)" <<$(HHPFILE) >NUL [OPTIONS] Compatibility=1.1 or later Compiled file=$(HTMLBASE).chm Default topic=index.html Display compile progress=no Error log file=$(HTMLBASE).log Full-text search=Yes Language=0x409 English (United States) Title=Tcl/Tk $(DOTVERSION) Help [FILES] index.html docs.css Keywords\*.html TclCmd\*.html TclLib\*.html TkCmd\*.html TkLib\*.html UserCmd\*.html << chmsetup: @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) install-docs: !if exist("$(CHMFILE)") @echo Installing compiled HTML help @$(CPY) "$(CHMFILE)" "$(DOC_INSTALL_DIR)\" !endif # "emacs font-lock highlighting fix #--------------------------------------------------------------------- # Generate the tcl.nmake file which contains the options used to build # Tcl itself. This is used when building extensions. #--------------------------------------------------------------------- tcl-nmake: $(OUT_DIR)\tcl.nmake $(OUT_DIR)\tcl.nmake: @type << >$@ CORE_MACHINE = $(MACHINE) CORE_DEBUG = $(DEBUG) CORE_USE_THREAD_ALLOC = $(USE_THREAD_ALLOC) << #--------------------------------------------------------------------- # Build tclConfig.sh for the TEA build system. #--------------------------------------------------------------------- tclConfig: $(OUT_DIR)\tclConfig.sh # TBD - is this tclConfig.sh file ever used? The values are incorrect! $(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in @echo Creating tclConfig.sh @nmakehlp -s << $** >$@ @TCL_DLL_FILE@ $(TCLLIBNAME) @TCL_VERSION@ $(DOTVERSION) @TCL_MAJOR_VERSION@ $(TCL_MAJOR_VERSION) @TCL_MINOR_VERSION@ $(TCL_MINOR_VERSION) @TCL_PATCH_LEVEL@ $(TCL_PATCH_LEVEL) @CC@ $(CC) @DEFS@ $(pkgcflags) @CFLAGS_DEBUG@ -nologo -c -W3 -YX -Fp$(TMP_DIR)\ -MDd @CFLAGS_OPTIMIZE@ -nologo -c -W3 -YX -Fp$(TMP_DIR)\ -MD @LDFLAGS_DEBUG@ -nologo -machine:$(MACHINE) -debug -debugtype:cv @LDFLAGS_OPTIMIZE@ -nologo -machine:$(MACHINE) -release -opt:ref -opt:icf,3 @TCL_LIB_FILE@ $(PROJECT)$(VERSION)$(SUFX).lib @LIBS@ $(baselibs) $(PRJ_LIBS) @prefix@ $(_INSTALLDIR) @exec_prefix@ $(BIN_INSTALL_DIR) @SHLIB_CFLAGS@ @STLIB_CFLAGS@ @CFLAGS_WARNING@ -W3 @EXTRA_CFLAGS@ -YX @SHLIB_LD@ $(link32) $(dlllflags) @STLIB_LD@ $(lib32) -nologo @SHLIB_LD_LIBS@ $(baselibs) $(PRJ_LIBS) @SHLIB_SUFFIX@ .dll @LDFLAGS@ @LIBOBJS@ @RANLIB@ @TCL_LIB_FLAG@ $(PROJECT)$(VERSION)$(SUFX).lib @TCL_BUILD_LIB_SPEC@ $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib @TCL_LIB_SPEC@ $(LIB_INSTALL_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib @TCL_INCLUDE_SPEC@ -I$(INCLUDE_INSTALL_DIR) @TCL_SRC_DIR@ $(ROOT) @TCL_PACKAGE_PATH@ $(LIB_INSTALL_DIR) @TCL_STUB_LIB_FILE@ $(TCLSTUBLIBNAME) @TCL_STUB_LIB_FLAG@ $(TCLSTUBLIBNAME) @TCL_STUB_LIB_SPEC@ -L$(LIB_INSTALL_DIR) $(TCLSTUBLIBNAME) @TCL_BUILD_STUB_LIB_SPEC@ -L$(OUT_DIR) $(TCLSTUBLIBNAME) @TCL_BUILD_STUB_LIB_PATH@ $(TCLSTUBLIB) @TCL_STUB_LIB_PATH@ $(LIB_INSTALL_DIR)\$(TCLSTUBLIBNAME) @CFG_TCL_SHARED_LIB_SUFFIX@ $(VERSION)$(SUFX).dll @CFG_TCL_UNSHARED_LIB_SUFFIX@ $(VERSION)$(SUFX).lib !if $(STATIC_BUILD) @TCL_SHARED_BUILD@ 0 !else @TCL_SHARED_BUILD@ 1 !endif @TCL_ZLIB_LIB_NAME@ zdll.lib @TCL_TOMMATH_LIB_NAME@ tommath.lib << #--------------------------------------------------------------------- # The following target generates the file generic/tclDate.c # from the yacc grammar found in generic/tclGetDate.y. This is # only run by hand as yacc is not available in all environments. # The name of the .c file is different than the name of the .y file # so that make doesn't try to automatically regenerate the .c file. #--------------------------------------------------------------------- gendate: bison --output-file=$(GENERICDIR)/tclDate.c \ --name-prefix=TclDate \ $(GENERICDIR)/tclGetDate.y #--------------------------------------------------------------------- # Special case object file targets #--------------------------------------------------------------------- $(TMP_DIR)\testMain.obj: $(WIN_DIR)\tclAppInit.c $(cc32) $(appcflags) /DTCL_TEST /DUNICODE /D_UNICODE \ -Fo$@ $? $(TMP_DIR)\tclMainW.obj: $(GENERICDIR)\tclMain.c $(cc32) $(pkgcflags) /DUNICODE /D_UNICODE \ -Fo$@ $? $(ROOT)\manifest.uuid: copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid git rev-parse HEAD >>$(ROOT)\manifest.uuid $(TMP_DIR)\tclUuid.h: $(ROOT)\manifest.uuid copy $(WIN_DIR)\tclUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tclUuid.h $(TMP_DIR)\tclEvent.obj: $(GENERICDIR)\tclEvent.c $(TMP_DIR)\tclUuid.h $(cc32) $(pkgcflags) -I$(COMPATDIR)\zlib -I$(TMP_DIR) \ -Fo$@ $(GENERICDIR)\tclEvent.c $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c $(TMP_DIR)\tclUuid.h $(cc32) $(appcflags) -I$(TMP_DIR) \ -Fo$@ $(GENERICDIR)\tclTest.c $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c $(cc32) $(appcflags) -Fo$@ $? $(TMP_DIR)\tclTestABSList.obj: $(GENERICDIR)\tclTestABSList.c $(cc32) $(appcflags) -Fo$@ $? $(TMP_DIR)\tclWinTest.obj: $(WIN_DIR)\tclWinTest.c $(CCAPPCMD) $? $(TMP_DIR)\tclZipfs.obj: $(GENERICDIR)\tclZipfs.c $(cc32) $(pkgcflags) \ -I$(COMPATDIR)\zlib -I$(COMPATDIR)\zlib\contrib\minizip \ -Fo$@ $? $(TMP_DIR)\tclZlib.obj: $(GENERICDIR)\tclZlib.c $(cc32) $(pkgcflags) -I$(COMPATDIR)\zlib -Fo$@ $? # Following the lead of the autoconf based make, we define the # CFG_RUNTIME_*DIR flags specifically for tclPkgConfig # and not as part of the global defines. These are all defined # as empty strings because they are intended to represent paths # at *runtime*, not build time. This may make sense on Unix systems # where end-user does configure and make on the target system. It # makes no sense on Windows where binary distributions may be installed # anywhere. Storing build time paths as runtime paths is misleading # at best and inefficient at worst as the code goes looking for # files and directories that do not exist. # Note: the same is true for the other CFG_RUNTIME* and CFG_INSTALL* # settings as well but they are historical and I do not want to change # them. $(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c $(cc32) $(pkgcflags) \ /DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \ /DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \ /DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \ /DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \ /DCFG_INSTALL_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_LIBDIR="\"$(LIB_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_SCRDIR="\"$(SCRIPT_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_INCDIR="\"$(INCLUDE_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_DOCDIR="\"$(DOC_INSTALL_DIR:\=\\)\"" \ /DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ -Fo$@ $? $(TMP_DIR)\tclAppInit.obj: $(WIN_DIR)\tclAppInit.c $(cc32) $(appcflags) /DUNICODE /D_UNICODE \ -Fo$@ $? ### The following objects should be built using the stub interfaces $(TMP_DIR)\tclWinReg.obj: $(WIN_DIR)\tclWinReg.c $(cc32) $(appcflags_nostubs) /DUSE_TCL_STUBS=1 -Fo$@ $? $(TMP_DIR)\tclWinDde.obj: $(WIN_DIR)\tclWinDde.c $(cc32) $(appcflags_nostubs) /DUSE_TCL_STUBS=1 -Fo$@ $? ### The following objects are part of the stub library and should not ### be built as DLL objects. -Zl is used to avoid a dependency on any ### specific C run-time. $(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c $(cc32) $(stubscflags) -Fo$@ $? $(TMP_DIR)\tclStubCall.obj: $(GENERICDIR)\tclStubCall.c $(cc32) $(stubscflags) \ /DCFG_RUNTIME_DLLFILE="\"$(TCLLIBNAME)\"" \ /DCFG_RUNTIME_BINDIR="\"$(BIN_INSTALL_DIR:\=\\)\"" \ $(TCL_INCLUDES) -Fo$@ $? $(TMP_DIR)\tclStubLibTbl.obj: $(GENERICDIR)\tclStubLibTbl.c $(cc32) $(stubscflags) $(TCL_INCLUDES) -Fo$@ $? $(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c $(cc32) $(stubscflags) -Fo$@ $? $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c $(cc32) $(stubscflags) -Fo$@ $? $(TMP_DIR)\tclWinPanic.obj: $(WIN_DIR)\tclWinPanic.c $(cc32) $(stubscflags) -Fo$@ $? $(TMP_DIR)\tclsh.exe.manifest: $(WIN_DIR)\tclsh.exe.manifest.in @nmakehlp -s << $** >$@ @MACHINE@ $(MACHINE:IX86=X86) @TCL_WIN_VERSION@ $(DOTVERSION).0.0 << #--------------------------------------------------------------------- # Generate the source dependencies. Having dependency rules will # improve incremental build accuracy without having to resort to a # full rebuild just because some non-global header file like # tclCompile.h was changed. These rules aren't needed when building # from scratch. #--------------------------------------------------------------------- depend: !if !exist($(TCLSH)) @echo Build tclsh first! !else $(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ -passthru:"/DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \ $(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WIN_DIR),$$(WIN_DIR) @<< $(TCLOBJS) << !endif #--------------------------------------------------------------------- # Dependency rules #--------------------------------------------------------------------- !if exist("$(OUT_DIR)\depend.mk") !include "$(OUT_DIR)\depend.mk" !message *** Dependency rules in use. !else !message *** Dependency rules are not being used. !endif ### add a spacer in the output !message #--------------------------------------------------------------------- # Implicit rules that are not covered by the common ones defined in # rules.vc. A limitation exists with nmake that requires that # source directory can not contain spaces in the path. This an # absolute. #--------------------------------------------------------------------- {$(TOMMATHDIR)}.c{$(TMP_DIR)}.obj:: $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<< $< << {$(COMPATDIR)\zlib}.c{$(TMP_DIR)}.obj:: $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<< $< << $(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tclsh.rc $(TMP_DIR)\tcltest.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tcltest.rc #--------------------------------------------------------------------- # Installation. #--------------------------------------------------------------------- install-binaries: @echo Installing to '$(_INSTALLDIR)' @echo Installing $(TCLLIBNAME) !if "$(TCLLIB)" != "$(TCLIMPLIB)" @$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\" !endif @$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\zlib1.dll" "$(BIN_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\libtommath.dll" "$(BIN_INSTALL_DIR)\" !if !$(STATIC_BUILD) @$(CPY) "$(OUT_DIR)\zdll.lib" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(OUT_DIR)\tommath.lib" "$(LIB_INSTALL_DIR)\" !endif !if exist($(TCLSH)) @echo Installing $(TCLSHNAME) @$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\" !endif @echo Installing $(TCLSTUBLIBNAME) @$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\" install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @if not exist "$(LIB_INSTALL_DIR)\nmake" \ $(MKDIR) "$(LIB_INSTALL_DIR)\nmake" @echo Installing header files @$(CPY) "$(GENERICDIR)\tcl.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclDecls.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclOO.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclOODecls.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclTomMath.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclTomMathDecls.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(TOMMATHDIR)\tommath.h" "$(INCLUDE_INSTALL_DIR)\" !if !$(TCL_EMBED_SCRIPTS) @echo Installing library files to $(SCRIPT_INSTALL_DIR) @if not exist "$(SCRIPT_INSTALL_DIR)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)" @$(CPY) "$(ROOT)\library\*.tcl" "$(SCRIPT_INSTALL_DIR)\" @$(CPY) "$(ROOT)\library\tclIndex" "$(SCRIPT_INSTALL_DIR)\" !endif @$(CPY) "$(OUT_DIR)\tclConfig.sh" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(WIN_DIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(TCLSCRIPTZIP)" "$(LIB_INSTALL_DIR)\" @$(CPY) "$(WIN_DIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(WIN_DIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(WIN_DIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(WIN_DIR)\x86_64-w64-mingw32-nmakehlp.exe" "$(LIB_INSTALL_DIR)\nmake\" @$(CPY) "$(OUT_DIR)\tcl.nmake" "$(LIB_INSTALL_DIR)\nmake\" !if !$(TCL_EMBED_SCRIPTS) @echo Installing package cookiejar $(PKG_COOKIEJAR_VER) @if not exist "$(SCRIPT_INSTALL_DIR)\cookiejar0.2" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\cookiejar0.2" @$(CPY) "$(ROOT)\library\cookiejar\*.tcl" \ "$(SCRIPT_INSTALL_DIR)\cookiejar0.2\" @$(CPY) "$(ROOT)\library\cookiejar\*.gz" \ "$(SCRIPT_INSTALL_DIR)\cookiejar0.2\" @echo Installing package opt $(PKG_OPT_VER) @if not exist "$(SCRIPT_INSTALL_DIR)\opt0.4" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\opt0.4" @$(CPY) "$(ROOT)\library\opt\*.tcl" \ "$(SCRIPT_INSTALL_DIR)\opt0.4\" @if not exist "$(MODULE_INSTALL_DIR)" \ $(MKDIR) "$(MODULE_INSTALL_DIR)" @echo Installing package http $(PKG_HTTP_VER) as a Tcl Module @if not exist "$(MODULE_INSTALL_DIR)\9.0" \ $(MKDIR) "$(MODULE_INSTALL_DIR)\9.0" @$(COPY) "$(ROOT)\library\http\http.tcl" \ "$(MODULE_INSTALL_DIR)\9.0\http-$(PKG_HTTP_VER).tm" @echo Installing package msgcat $(PKG_MSGCAT_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\msgcat\msgcat.tcl" \ "$(MODULE_INSTALL_DIR)\9.0\msgcat-$(PKG_MSGCAT_VER).tm" @echo Installing package tcltest $(PKG_TCLTEST_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\tcltest\tcltest.tcl" \ "$(MODULE_INSTALL_DIR)\9.0\tcltest-$(PKG_TCLTEST_VER).tm" @echo Installing package platform $(PKG_PLATFORM_VER) as a Tcl Module @if not exist "$(MODULE_INSTALL_DIR)\9.0\platform" \ $(MKDIR) "$(MODULE_INSTALL_DIR)\9.0\platform" @$(COPY) "$(ROOT)\library\platform\platform.tcl" \ "$(MODULE_INSTALL_DIR)\9.0\platform-$(PKG_PLATFORM_VER).tm" @echo Installing package platform::shell $(PKG_SHELL_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\platform\shell.tcl" \ "$(MODULE_INSTALL_DIR)\9.0\platform\shell-$(PKG_SHELL_VER).tm" !endif @echo Installing $(TCLDDELIBNAME) @$(CPY) "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\" @$(CPY) "$(ROOT)\library\dde\pkgIndex.tcl" \ "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\" @echo Installing $(TCLREGLIBNAME) @$(CPY) "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\registry$(REGDOTVERSION)\" @$(CPY) "$(ROOT)\library\registry\pkgIndex.tcl" \ "$(LIB_INSTALL_DIR)\registry$(REGDOTVERSION)\" !if !$(TCL_EMBED_SCRIPTS) @echo Installing encodings @$(CPY) "$(ROOT)\library\encoding\*.enc" \ "$(SCRIPT_INSTALL_DIR)\encoding\" !endif # "emacs font-lock highlighting fix install-tzdata: !if !$(TCL_EMBED_SCRIPTS) @echo Installing time zone data @set TCL_LIBRARY=$(ROOT:\=/)/library @$(TCLSH_NATIVE) "$(ROOT:\=/)/tools/installData.tcl" \ "$(ROOT:\=/)/library/tzdata" "$(SCRIPT_INSTALL_DIR)/tzdata" !endif install-msgs: !if !$(TCL_EMBED_SCRIPTS) @echo Installing message catalogs @set TCL_LIBRARY=$(ROOT:\=/)/library @$(TCLSH_NATIVE) "$(ROOT:\=/)/tools/installData.tcl" \ "$(ROOT:\=/)/library/msgs" "$(SCRIPT_INSTALL_DIR)/msgs" !endif install-pdbs: @echo Installing debug symbols @$(CPY) "$(OUT_DIR)\*.pdb" "$(BIN_INSTALL_DIR)\" # "emacs font-lock highlighting fix #--------------------------------------------------------------------- # Clean up #--------------------------------------------------------------------- tidy: !if "$(TCLLIB)" != "$(TCLIMPLIB)" @echo Removing $(TCLLIB) ... @if exist $(TCLLIB) del $(TCLLIB) !endif @echo Removing $(TCLIMPLIB) ... @if exist $(TCLIMPLIB) del $(TCLIMPLIB) @echo Removing $(TCLSH) ... @if exist $(TCLSH) del $(TCLSH) @echo Removing $(TCLTEST) ... @if exist $(TCLTEST) del $(TCLTEST) @echo Removing $(TCLDDELIB) ... @if exist $(TCLDDELIB) del $(TCLDDELIB) @echo Removing $(TCLREGLIB) ... @if exist $(TCLREGLIB) del $(TCLREGLIB) clean: default-clean clean-pkgs hose: default-hose hose-pkgs realclean: hose .PHONY: # Local Variables: # mode: makefile # End: tcl9.0.3/win/Makefile.in0000644000175000017500000012066315104661342014422 0ustar sergeisergei# # This file is a Makefile for Tcl. If it has the name "Makefile.in" then it # is a template for a Makefile; to generate the actual Makefile, run # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. VERSION = @TCL_VERSION@ #-------------------------------------------------------------------------- # Things you can change to personalize the Makefile for your own site (you can # make these changes in either Makefile.in or Makefile, but changes to # Makefile will get lost if you re-run the configuration script). #-------------------------------------------------------------------------- # Default top-level directories in which to install architecture-specific # files (exec_prefix) and machine-independent files such as scripts (prefix). # The values specified here may be overridden at configure-time with the # --exec-prefix and --prefix options to the "configure" script. prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ runstatedir = @runstatedir@ mandir = @mandir@ # Configure arguments PKG_CFG_ARGS = @PKG_CFG_ARGS@ # The following definition can be set to non-null for special systems like AFS # with replication. It allows the pathnames used for installation to be # different than those used for actually reference files at run-time. # INSTALL_ROOT is prepended to $prefix and $exec_prefix when installing files. INSTALL_ROOT = # Directory from which applications will reference the library of Tcl scripts # (note: you can set the TCL_LIBRARY environment variable at run-time to # override this value): TCL_LIBRARY = $(prefix)/lib/tcl$(VERSION) # Path to use at runtime to refer to LIB_INSTALL_DIR: LIB_RUNTIME_DIR = $(libdir) # Directory in which to install the program tclsh: BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tcl library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY) # Path name to use when installing Tcl modules. MODULE_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)/../tcl9 # Directory in which to install the include file tcl.h: INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) # Directory in which to (optionally) install the private tcl headers: PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) # Top-level directory in which to install manual entries: MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir) # Directory in which to install manual entry for tclsh: MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1 # Directory in which to install manual entries for Tcl's C library procedures: MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 # Directory in which to install manual entries for the built-in Tcl commands: MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann # warning flags CFLAGS_WARNING = @CFLAGS_WARNING@ # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ # To change the compiler switches, for example to change from optimization to # debugging symbols, change the following line: #CFLAGS = $(CFLAGS_DEBUG) #CFLAGS = $(CFLAGS_OPTIMIZE) #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -DMP_FIXED_CUTOFFS -D__USE_MINGW_ANSI_STDIO=0 # To compile without backward compatibility and deprecated code uncomment the # following NO_DEPRECATED_FLAGS = #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED # To enable compilation debugging reverse the comment characters on one of the # following lines. COMPILE_DEBUG_FLAGS = #COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG #COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS SRC_DIR = @srcdir@ ROOT_DIR = @srcdir@/.. TOP_DIR = $(shell cd @srcdir@/..; pwd -W 2>/dev/null || pwd -P) BUILD_DIR = @builddir@ GENERIC_DIR = $(TOP_DIR)/generic WIN_DIR = $(TOP_DIR)/win UNIX_DIR = $(TOP_DIR)/unix COMPAT_DIR = $(TOP_DIR)/compat PKGS_DIR = $(TOP_DIR)/pkgs TOOL_DIR = $(TOP_DIR)/tools ZLIB_DIR = $(COMPAT_DIR)/zlib MINIZIP_DIR = $(ZLIB_DIR)/contrib/minizip TOMMATH_DIR = $(TOP_DIR)/libtommath # Converts a POSIX path to a Windows native path. CYGPATH = @CYGPATH@ libdir_native = $(shell $(CYGPATH) '$(libdir)') bindir_native = $(shell $(CYGPATH) '$(bindir)') includedir_native = $(shell $(CYGPATH) '$(includedir)') mandir_native = $(shell $(CYGPATH) '$(mandir)') TCL_LIBRARY_NATIVE = $(shell $(CYGPATH) '$(TCL_LIBRARY)') GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)') WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)') ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)') TOOL_DIR_NATIVE = $(shell $(CYGPATH) '$(TOOL_DIR)') SCRIPT_INSTALL_DIR_NATIVE = $(shell $(CYGPATH) '$(SCRIPT_INSTALL_DIR)') INCLUDE_INSTALL_DIR_NATIVE = $(shell $(CYGPATH) '$(INCLUDE_INSTALL_DIR)') MAN_INSTALL_DIR_NATIVE = $(shell $(CYGPATH) '$(MAN_INSTALL_DIR)') ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W 2>/dev/null || pwd -P) ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)') MINIZIP_DIR_NATIVE = $(shell $(CYGPATH) '$(MINIZIP_DIR)') TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ VER = @TCL_MAJOR_VERSION@@TCL_MINOR_VERSION@ DOTVER = @TCL_MAJOR_VERSION@.@TCL_MINOR_VERSION@ DDEVER = @TCL_DDE_MAJOR_VERSION@@TCL_DDE_MINOR_VERSION@ DDEDOTVER = @TCL_DDE_MAJOR_VERSION@.@TCL_DDE_MINOR_VERSION@ REGVER = @TCL_REG_MAJOR_VERSION@@TCL_REG_MINOR_VERSION@ REGDOTVER = @TCL_REG_MAJOR_VERSION@.@TCL_REG_MINOR_VERSION@ TCL_ZIP_FILE = @TCL_ZIP_FILE@ TCL_VFS_PATH = libtcl.vfs/tcl_library TCL_VFS_ROOT = libtcl.vfs TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_DLL_FILE = @TCL_DLL_FILE@ TCL_LIB_FILE = @TCL_LIB_FILE@ DDE_DLL_FILE = tcl9dde$(DDEVER)${DLLSUFFIX} DDE_DLL_FILE8 = tcldde$(DDEVER)${DLLSUFFIX} DDE_LIB_FILE = @LIBPREFIX@tcldde$(DDEVER)${DLLSUFFIX}${LIBSUFFIX} REG_DLL_FILE = tcl9registry$(REGVER)${DLLSUFFIX} REG_DLL_FILE8 = tclregistry$(REGVER)${DLLSUFFIX} REG_LIB_FILE = @LIBPREFIX@tclregistry$(REGVER)${DLLSUFFIX}${LIBSUFFIX} TEST_DLL_FILE = tcltest$(VER)${DLLSUFFIX} TEST_EXE_FILE = tcltest${EXESUFFIX} TEST_LIB_FILE = @LIBPREFIX@tcltest$(VER)${DLLSUFFIX}${LIBSUFFIX} TEST_LOAD_PRMS = lappend ::auto_path {$(ROOT_DIR_WIN_NATIVE)/tests};\ package ifneeded dde 1.4.6 [list load ${DDE_DLL_FILE}];\ package ifneeded registry 1.3.7 [list load ${REG_DLL_FILE}] TEST_LOAD_FACILITIES = package ifneeded tcl::test ${VERSION}@TCL_PATCH_LEVEL@ [list load ${TEST_DLL_FILE} Tcltest];\ $(TEST_LOAD_PRMS) ZLIB_DLL_FILE = zlib1.dll TOMMATH_DLL_FILE = libtommath.dll SHARED_LIBRARIES = $(TCL_DLL_FILE) @ZLIB_DLL_FILE@ @TOMMATH_DLL_FILE@ STATIC_LIBRARIES = $(TCL_LIB_FILE) TCLSH = tclsh$(VER)${EXESUFFIX} WINE = @WINE@ CAT32 = cat32$(EXEEXT) # For cross-compiled builds, TCL_EXE is the name of a tclsh executable that is # available *BEFORE* running make for the first time. Certain build targets # (make genstubs, make install) need it to be available on the PATH. This # executable should *NOT* be required just to do a normal build although # it can be required to run make dist. TCL_EXE = @TCL_EXE@ @SET_MAKE@ # Setting the VPATH variable to a list of paths will cause the Makefile to # look into these paths when resolving .c to .obj dependencies. VPATH = $(GENERIC_DIR):$(WIN_DIR):$(COMPAT_DIR):$(ZLIB_DIR):$(TOMMATH_DIR) AR = @AR@ RANLIB = @RANLIB@ CC = @CC@ RC = @RC@ RES = @RES@ AC_FLAGS = @EXTRA_CFLAGS@ @DEFS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ LDFLAGS = @LDFLAGS@ @LDFLAGS_DEFAULT@ LDFLAGS_CONSOLE = @LDFLAGS_CONSOLE@ LDFLAGS_WINDOW = @LDFLAGS_WINDOW@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ STLIB_LD = @STLIB_LD@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ LIBS = @LIBS@ $(shell $(CYGPATH) '@ZLIB_LIBS@') $(shell $(CYGPATH) '@TOMMATH_LIBS@') RMDIR = rm -rf MKDIR = mkdir -p SHELL = @SHELL@ RM = rm -f COPY = cp LN = ln GDB = gdb INSTALL = $(SHELL) $(UNIX_DIR)/install-sh -c INSTALL_PROGRAM = ${INSTALL} INSTALL_LIBRARY = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA_DIR = ${INSTALL} -d -m 755 ### # Tip 430 - ZipFS Modifications ### TCL_ZIP_FILE = @TCL_ZIP_FILE@ TCL_VFS_PATH = libtcl.vfs/tcl_library TCL_VFS_ROOT = libtcl.vfs HOST_CC = @CC_FOR_BUILD@ HOST_EXEEXT = @EXEEXT_FOR_BUILD@ HOST_OBJEXT = @OBJEXT_FOR_BUILD@ ZIPFS_BUILD = @ZIPFS_BUILD@ NATIVE_ZIP = @ZIP_PROG@ ZIP_PROG_OPTIONS = @ZIP_PROG_OPTIONS@ ZIP_PROG_VFSSEARCH = @ZIP_PROG_VFSSEARCH@ SHARED_BUILD = @SHARED_BUILD@ INSTALL_MSGS = @INSTALL_MSGS@ INSTALL_LIBRARIES = @INSTALL_LIBRARIES@ # Fully qualify library path so that `make test` # does not depend on the current directory. # Only define these if not embedding the library ifeq ($(ZIPFS_BUILD), 0) LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P) LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') endif # Minizip MINIZIP_OBJS = \ adler32.$(HOST_OBJEXT) \ compress.$(HOST_OBJEXT) \ crc32.$(HOST_OBJEXT) \ deflate.$(HOST_OBJEXT) \ infback.$(HOST_OBJEXT) \ inffast.$(HOST_OBJEXT) \ inflate.$(HOST_OBJEXT) \ inftrees.$(HOST_OBJEXT) \ ioapi.$(HOST_OBJEXT) \ iowin32.$(HOST_OBJEXT) \ trees.$(HOST_OBJEXT) \ uncompr.$(HOST_OBJEXT) \ zip.$(HOST_OBJEXT) \ zutil.$(HOST_OBJEXT) \ minizip.$(HOST_OBJEXT) ZIP_INSTALL_OBJS = @ZIP_INSTALL_OBJS@ CC_SWITCHES = -I"${BUILD_DIR}" -I"${GENERIC_DIR_NATIVE}" -I"${TOMMATH_DIR_NATIVE}" \ -I"${ZLIB_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -DMP_PREC=4 \ ${AC_FLAGS} ${COMPILE_DEBUG_FLAGS} ${NO_DEPRECATED_FLAGS} CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ STUB_CC_SWITCHES = -I"${GENERIC_DIR_NATIVE}" -I"${TOMMATH_DIR_NATIVE}" \ -I"${ZLIB_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -DMP_PREC=4 \ ${AC_FLAGS} ${COMPILE_DEBUG_FLAGS} TCLTEST_OBJS = \ tclTest.$(OBJEXT) \ tclTestABSList.$(OBJEXT) \ tclTestObj.$(OBJEXT) \ tclTestProcBodyObj.$(OBJEXT) \ tclMutexTest.$(OBJEXT) \ tclThreadTest.$(OBJEXT) \ tclWinTest.$(OBJEXT) GENERIC_OBJS = \ regcomp.$(OBJEXT) \ regexec.$(OBJEXT) \ regfree.$(OBJEXT) \ regerror.$(OBJEXT) \ tclAlloc.$(OBJEXT) \ tclArithSeries.$(OBJEXT) \ tclAssembly.$(OBJEXT) \ tclAsync.$(OBJEXT) \ tclBasic.$(OBJEXT) \ tclBinary.$(OBJEXT) \ tclCkalloc.$(OBJEXT) \ tclClock.$(OBJEXT) \ tclClockFmt.$(OBJEXT) \ tclCmdAH.$(OBJEXT) \ tclCmdIL.$(OBJEXT) \ tclCmdMZ.$(OBJEXT) \ tclCompCmds.$(OBJEXT) \ tclCompCmdsGR.$(OBJEXT) \ tclCompCmdsSZ.$(OBJEXT) \ tclCompExpr.$(OBJEXT) \ tclCompile.$(OBJEXT) \ tclConfig.$(OBJEXT) \ tclDate.$(OBJEXT) \ tclDictObj.$(OBJEXT) \ tclDisassemble.$(OBJEXT) \ tclEncoding.$(OBJEXT) \ tclEnsemble.$(OBJEXT) \ tclEnv.$(OBJEXT) \ tclEvent.$(OBJEXT) \ tclExecute.$(OBJEXT) \ tclFCmd.$(OBJEXT) \ tclFileName.$(OBJEXT) \ tclGet.$(OBJEXT) \ tclHash.$(OBJEXT) \ tclHistory.$(OBJEXT) \ tclIcu.$(OBJEXT) \ tclIndexObj.$(OBJEXT) \ tclInterp.$(OBJEXT) \ tclIO.$(OBJEXT) \ tclIOCmd.$(OBJEXT) \ tclIOGT.$(OBJEXT) \ tclIORChan.$(OBJEXT) \ tclIORTrans.$(OBJEXT) \ tclIOSock.$(OBJEXT) \ tclIOUtil.$(OBJEXT) \ tclLink.$(OBJEXT) \ tclLiteral.$(OBJEXT) \ tclListObj.$(OBJEXT) \ tclLoad.$(OBJEXT) \ tclMainW.$(OBJEXT) \ tclMain.$(OBJEXT) \ tclNamesp.$(OBJEXT) \ tclNotify.$(OBJEXT) \ tclOO.$(OBJEXT) \ tclOOBasic.$(OBJEXT) \ tclOOCall.$(OBJEXT) \ tclOODefineCmds.$(OBJEXT) \ tclOOInfo.$(OBJEXT) \ tclOOMethod.$(OBJEXT) \ tclOOProp.$(OBJEXT) \ tclOOStubInit.$(OBJEXT) \ tclObj.$(OBJEXT) \ tclOptimize.$(OBJEXT) \ tclPanic.$(OBJEXT) \ tclParse.$(OBJEXT) \ tclPathObj.$(OBJEXT) \ tclPipe.$(OBJEXT) \ tclPkg.$(OBJEXT) \ tclPkgConfig.$(OBJEXT) \ tclPosixStr.$(OBJEXT) \ tclPreserve.$(OBJEXT) \ tclProc.$(OBJEXT) \ tclProcess.$(OBJEXT) \ tclRegexp.$(OBJEXT) \ tclResolve.$(OBJEXT) \ tclResult.$(OBJEXT) \ tclScan.$(OBJEXT) \ tclStringObj.$(OBJEXT) \ tclStrIdxTree.$(OBJEXT) \ tclStrToD.$(OBJEXT) \ tclStubInit.$(OBJEXT) \ tclThread.$(OBJEXT) \ tclThreadAlloc.$(OBJEXT) \ tclThreadJoin.$(OBJEXT) \ tclThreadStorage.$(OBJEXT) \ tclTimer.$(OBJEXT) \ tclTomMathInterface.$(OBJEXT) \ tclTrace.$(OBJEXT) \ tclUtf.$(OBJEXT) \ tclUtil.$(OBJEXT) \ tclVar.$(OBJEXT) \ tclZipfs.$(OBJEXT) \ tclZlib.$(OBJEXT) TOMMATH_OBJS = \ bn_mp_add.${OBJEXT} \ bn_mp_add_d.${OBJEXT} \ bn_mp_and.${OBJEXT} \ bn_mp_clamp.${OBJEXT} \ bn_mp_clear.${OBJEXT} \ bn_mp_clear_multi.${OBJEXT} \ bn_mp_cmp.${OBJEXT} \ bn_mp_cmp_d.${OBJEXT} \ bn_mp_cmp_mag.${OBJEXT} \ bn_mp_cnt_lsb.${OBJEXT} \ bn_mp_copy.${OBJEXT} \ bn_mp_count_bits.${OBJEXT} \ bn_mp_div.${OBJEXT} \ bn_mp_div_d.${OBJEXT} \ bn_mp_div_2.${OBJEXT} \ bn_mp_div_2d.${OBJEXT} \ bn_s_mp_div_3.${OBJEXT} \ bn_mp_exch.${OBJEXT} \ bn_mp_expt_n.${OBJEXT} \ bn_mp_get_mag_u64.${OBJEXT} \ bn_mp_grow.${OBJEXT} \ bn_mp_init.${OBJEXT} \ bn_mp_init_copy.${OBJEXT} \ bn_mp_init_i64.${OBJEXT} \ bn_mp_init_multi.${OBJEXT} \ bn_mp_init_set.${OBJEXT} \ bn_mp_init_size.${OBJEXT} \ bn_mp_init_u64.${OBJEXT} \ bn_mp_lshd.${OBJEXT} \ bn_mp_mod.${OBJEXT} \ bn_mp_mod_2d.${OBJEXT} \ bn_mp_mul.${OBJEXT} \ bn_mp_mul_2.${OBJEXT} \ bn_mp_mul_2d.${OBJEXT} \ bn_mp_mul_d.${OBJEXT} \ bn_mp_neg.${OBJEXT} \ bn_mp_or.${OBJEXT} \ bn_mp_pack.${OBJEXT} \ bn_mp_pack_count.${OBJEXT} \ bn_mp_radix_size.${OBJEXT} \ bn_mp_radix_smap.${OBJEXT} \ bn_mp_read_radix.${OBJEXT} \ bn_mp_rshd.${OBJEXT} \ bn_mp_set_i64.${OBJEXT} \ bn_mp_set_u64.${OBJEXT} \ bn_mp_shrink.${OBJEXT} \ bn_mp_sqr.${OBJEXT} \ bn_mp_sqrt.${OBJEXT} \ bn_mp_sub.${OBJEXT} \ bn_mp_sub_d.${OBJEXT} \ bn_mp_signed_rsh.${OBJEXT} \ bn_mp_to_ubin.${OBJEXT} \ bn_mp_to_radix.${OBJEXT} \ bn_mp_ubin_size.${OBJEXT} \ bn_mp_unpack.${OBJEXT} \ bn_mp_xor.${OBJEXT} \ bn_mp_zero.${OBJEXT} \ bn_s_mp_add.${OBJEXT} \ bn_s_mp_balance_mul.$(OBJEXT) \ bn_s_mp_karatsuba_mul.${OBJEXT} \ bn_s_mp_karatsuba_sqr.$(OBJEXT) \ bn_s_mp_mul_digs.${OBJEXT} \ bn_s_mp_mul_digs_fast.${OBJEXT} \ bn_s_mp_reverse.${OBJEXT} \ bn_s_mp_sqr_fast.${OBJEXT} \ bn_s_mp_sqr.${OBJEXT} \ bn_s_mp_sub.${OBJEXT} \ bn_s_mp_toom_mul.${OBJEXT} \ bn_s_mp_toom_sqr.${OBJEXT} WIN_OBJS = \ tclWin32Dll.$(OBJEXT) \ tclWinChan.$(OBJEXT) \ tclWinConsole.$(OBJEXT) \ tclWinSerial.$(OBJEXT) \ tclWinError.$(OBJEXT) \ tclWinFCmd.$(OBJEXT) \ tclWinFile.$(OBJEXT) \ tclWinInit.$(OBJEXT) \ tclWinLoad.$(OBJEXT) \ tclWinNotify.$(OBJEXT) \ tclWinPipe.$(OBJEXT) \ tclWinSock.$(OBJEXT) \ tclWinThrd.$(OBJEXT) \ tclWinTime.$(OBJEXT) DDE_OBJS = tclWinDde.$(OBJEXT) REG_OBJS = tclWinReg.$(OBJEXT) STUB_OBJS = \ tclStubLib.$(OBJEXT) \ tclStubCall.$(OBJEXT) \ tclStubLibTbl.$(OBJEXT) \ tclTomMathStubLib.$(OBJEXT) \ tclOOStubLib.$(OBJEXT) \ tclWinPanic.$(OBJEXT) TCLSH_OBJS = tclAppInit.$(OBJEXT) ZLIB_OBJS = \ adler32.$(OBJEXT) \ compress.$(OBJEXT) \ crc32.$(OBJEXT) \ deflate.$(OBJEXT) \ infback.$(OBJEXT) \ inffast.$(OBJEXT) \ inflate.$(OBJEXT) \ inftrees.$(OBJEXT) \ trees.$(OBJEXT) \ uncompr.$(OBJEXT) \ zutil.$(OBJEXT) TCL_OBJS = ${GENERIC_OBJS} ${WIN_OBJS} @ZLIB_OBJS@ @TOMMATH_OBJS@ TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n] all: binaries libraries doc packages # Test-suite helper (can be used to test Tcl from build directory with all expected modules). # To start from windows shell use: # > tcltest.cmd -verbose bps -file fileName.test # or from mingw/msys shell: # $ ./tcltest -verbose bps -file fileName.test tcltest.cmd: Makefile @echo 'Create tcltest.cmd helpers'; @(\ echo '@echo off'; \ echo 'rem set LANG=en_US'; \ echo 'set BDP=%~dp0'; \ echo 'set OWD=%CD%'; \ echo 'cd /d %TEMP%'; \ echo 'rem "%BDP%\$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" %TESTFLAGS% -load "$(TEST_LOAD_FACILITIES)" %*'; \ echo '"%BDP%\$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" %TESTFLAGS% -load "$(TEST_LOAD_PRMS)" %*'; \ echo 'cd /d %OWD%'; \ ) > tcltest.cmd; @(\ echo '#!/bin/sh'; \ echo '#LANG=en_US'; \ echo 'BDP=$$(dirname $$(readlink -f %0))'; \ echo 'cd /tmp'; \ echo '#"$$BDP/$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $$TESTFLAGS -load "$(TEST_LOAD_FACILITIES)" "$$@"'; \ echo '"$$BDP/$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $$TESTFLAGS -load "$(TEST_LOAD_PRMS)" "$$@"'; \ ) > tcltest.sh; tcltest.sh: tcltest.cmd tcltest: binaries $(TEST_EXE_FILE) $(TEST_DLL_FILE) $(CAT32) tcltest.cmd binaries: $(TCL_STUB_LIB_FILE) @LIBRARIES@ winextensions ${TCL_ZIP_FILE} $(TCLSH) winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} ${DDE_DLL_FILE8} ${REG_DLL_FILE8} libraries: doc: tclzipfile: ${TCL_ZIP_FILE} ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} ${DDE_DLL_FILE} ${REG_DLL_FILE} @rm -rf ${TCL_VFS_ROOT} @mkdir -p ${TCL_VFS_PATH} @echo "creating ${TCL_VFS_PATH} (prepare compression)" @( \ $(COPY) -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \ $(COPY) -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \ rm -rf ${TCL_VFS_PATH}/dde; \ rm -rf ${TCL_VFS_PATH}/registry; \ ) (zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \ (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \ cd ${TCL_VFS_ROOT} && \ $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null && \ echo "${TCL_ZIP_FILE} successful created with $$zip" && \ cd ..) $(TCLSH): $(TCLSH_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES) ${TCL_ZIP_FILE} $(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE) $(COPY) tclsh.exe.manifest $(TCLSH).manifest @VC_MANIFEST_EMBED_EXE@ @if test "${ZIPFS_BUILD}" = "2" ; then \ cat ${TCL_ZIP_FILE} >> ${TCLSH}; \ fi cat32.$(OBJEXT): cat.c $(CC) -c $(CC_SWITCHES) -DUNICODE -D_UNICODE @DEPARG@ $(CC_OBJNAME) $(CAT32): cat32.$(OBJEXT) $(CC) $(CFLAGS) cat32.$(OBJEXT) $(CC_EXENAME) $(LIBS) $(LDFLAGS_CONSOLE) # The following targets are configured by autoconf to generate either a shared # library or static library ${TCL_STUB_LIB_FILE}: ${STUB_OBJS} ${DDE_OBJS} ${REG_OBJS} @$(RM) ${TCL_STUB_LIB_FILE} @MAKE_STUB_LIB@ ${STUB_OBJS} ${DDE_OBJS} ${REG_OBJS} @POST_MAKE_LIB@ ${TCL_DLL_FILE}: ${TCL_LIB_FILE} ${TCL_OBJS} tcl.$(RES) @ZLIB_DLL_FILE@ @TOMMATH_DLL_FILE@ ${TCL_ZIP_FILE} @$(RM) ${TCL_DLL_FILE} $(TCL_LIB_FILE) @MAKE_DLL@ ${TCL_OBJS} tcl.$(RES) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${TCL_DLL_FILE}.manifest @VC_MANIFEST_EMBED_DLL@ @if test "${ZIPFS_BUILD}" = "1" ; then \ cat ${TCL_ZIP_FILE} >> ${TCL_DLL_FILE}; \ fi ifeq (,$(findstring --disable-shared,$(PKG_CFG_ARGS))) ${TCL_LIB_FILE}: @$(RM) ${TCL_DLL_FILE} $(TCL_LIB_FILE) else ${TCL_LIB_FILE}: ${TCL_OBJS} tclWinPanic.$(OBJEXT) ${DDE_OBJS} ${REG_OBJS} @$(RM) ${TCL_LIB_FILE} @MAKE_LIB@ ${TCL_OBJS} tclWinPanic.$(OBJEXT) ${DDE_OBJS} ${REG_OBJS} @POST_MAKE_LIB@ endif ${DDE_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${DDE_OBJS} @MAKE_DLL@ ${DDE_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${DDE_DLL_FILE}.manifest ${REG_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${REG_OBJS} @MAKE_DLL@ ${REG_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${REG_DLL_FILE}.manifest ${DDE_DLL_FILE8}: ${TCL_STUB_LIB_FILE} tcl8WinDde.$(OBJEXT) @MAKE_DLL@ tcl8WinDde.$(OBJEXT) $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${DDE_DLL_FILE8}.manifest ${REG_DLL_FILE8}: ${TCL_STUB_LIB_FILE} tcl8WinReg.$(OBJEXT) @MAKE_DLL@ -DTCL_MAJOR_VERSION=8 tcl8WinReg.$(OBJEXT) $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${REG_DLL_FILE8}.manifest ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} @$(RM) ${TEST_DLL_FILE} ${TEST_LIB_FILE} @MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS) $(COPY) tclsh.exe.manifest ${TEST_DLL_FILE}.manifest ${TEST_EXE_FILE}: @LIBRARIES@ ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} tclTestMain.${OBJEXT} @$(RM) ${TEST_EXE_FILE} $(CC) $(CFLAGS) $(TCLTEST_OBJS) tclTestMain.$(OBJEXT) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE) $(COPY) tclsh.exe.manifest ${TEST_EXE_FILE}.manifest # use prebuilt zlib1.dll ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} @if test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win64-arm/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win64-arm/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ elif test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.aset" ; then \ $(COPY) $(ZLIB_DIR)/win64-arm/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ elif test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ else \ $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ fi; # use pre-built libtommath.dll ${TOMMATH_DLL_FILE}: ${TCL_STUB_LIB_FILE} @if test "@TOMMATH_LIBS@set" = "${TOMMATH_DIR_NATIVE}/win64-arm/tommath.libset" ; then \ $(COPY) $(TOMMATH_DIR)/win64-arm/${TOMMATH_DLL_FILE} ${TOMMATH_DLL_FILE}; \ elif test "@TOMMATH_LIBS@set" = "${TOMMATH_DIR_NATIVE}/win64-arm/libtommath.dll.aset" ; then \ $(COPY) $(TOMMATH_DIR)/win64-arm/${TOMMATH_DLL_FILE} ${TOMMATH_DLL_FILE}; \ elif test "@TOMMATH_LIBS@set" = "${TOMMATH_DIR_NATIVE}/win32/tommath.libset" ; then \ $(COPY) $(TOMMATH_DIR)/win32/${TOMMATH_DLL_FILE} ${TOMMATH_DLL_FILE}; \ else \ $(COPY) $(TOMMATH_DIR)/win64/${TOMMATH_DLL_FILE} ${TOMMATH_DLL_FILE}; \ fi; # Add the object extension to the implicit rules. By default .obj is not # automatically added. .SUFFIXES: .${OBJEXT} .SUFFIXES: .$(RES) .SUFFIXES: .rc # Special case object targets tclTestMain.${OBJEXT}: tclAppInit.c $(CC) -c $(CC_SWITCHES) -DTCL_TEST -DUNICODE -D_UNICODE $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tclWinInit.${OBJEXT}: tclWinInit.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tclWinPipe.${OBJEXT}: tclWinPipe.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tclWinReg.${OBJEXT}: tclWinReg.c $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tcl8WinReg.${OBJEXT}: tclWinReg.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tclWinDde.${OBJEXT}: tclWinDde.c $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tcl8WinDde.${OBJEXT}: tclWinDde.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) tclAppInit.${OBJEXT}: tclAppInit.c $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) -DUNICODE -D_UNICODE @DEPARG@ $(CC_OBJNAME) tclMainW.${OBJEXT}: tclMain.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl -DUNICODE -D_UNICODE @DEPARG@ $(CC_OBJNAME) # TIP #430, ZipFS Support tclZipfs.${OBJEXT}: $(GENERIC_DIR)/tclZipfs.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl \ $(ZLIB_INCLUDE) -I$(MINIZIP_DIR_NATIVE) @DEPARG@ $(CC_OBJNAME) # TIP #59, embedding of configuration information into the binary library. # # Part of Tcl's configuration information are the paths where it was installed # and where it will look for its libraries (which can be different). We derive # this information from the variables which can be overridden by the user. As # every path can be configured separately we do not remember one general # prefix/exec_prefix but all the different paths individually. tclPkgConfig.${OBJEXT}: tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR_NATIVE)\"" \ -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR_NATIVE)\"" \ -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR_NATIVE)\"" \ -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR_NATIVE)\"" \ -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR_NATIVE)\"" \ \ -DCFG_RUNTIME_LIBDIR="\"$(libdir_native)\"" \ -DCFG_RUNTIME_BINDIR="\"$(bindir_native)\"" \ -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY_NATIVE)\"" \ -DCFG_RUNTIME_INCDIR="\"$(includedir_native)\"" \ -DCFG_RUNTIME_DOCDIR="\"$(mandir_native)\"" \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_DLL_FILE)\"" \ -DBUILD_tcl \ @DEPARG@ $(CC_OBJNAME) tclEvent.${OBJEXT}: tclEvent.c tclUuid.h tclTest.${OBJEXT}: tclTest.c tclUuid.h $(TOP_DIR)/manifest.uuid: printf "git-" >$(TOP_DIR)/manifest.uuid (cd $(TOP_DIR); git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid || \ (printf "svn-r" >$(TOP_DIR)/manifest.uuid ; \ svn info --show-item last-changed-revision >>$(TOP_DIR)/manifest.uuid) || \ printf "unknown" >$(TOP_DIR)/manifest.uuid) tclUuid.h: $(TOP_DIR)/manifest.uuid echo "#define TCL_VERSION_UUID \\" >$@ cat $(TOP_DIR)/manifest.uuid >>$@ echo "" >>$@ # The following objects are part of the stub library and should not be built # as DLL objects but none of the symbols should be exported tclStubLib.${OBJEXT}: tclStubLib.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @CFLAGS_NOLTO@ @DEPARG@ $(CC_OBJNAME) tclStubCall.${OBJEXT}: tclStubCall.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_DLL_FILE)\"" \ -DCFG_RUNTIME_BINDIR="\"$(bindir_native)\"" \ @DEPARG@ $(CC_OBJNAME) tclStubLibTbl.${OBJEXT}: tclStubLibTbl.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) tclTomMathStubLib.${OBJEXT}: tclTomMathStubLib.c $(CC) -c $(CC_SWITCHES) @CFLAGS_NOLTO@ @DEPARG@ $(CC_OBJNAME) tclOOStubLib.${OBJEXT}: tclOOStubLib.c $(CC) -c $(CC_SWITCHES) @CFLAGS_NOLTO@ @DEPARG@ $(CC_OBJNAME) tclWinPanic.${OBJEXT}: tclWinPanic.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) # Implicit rule for all object files that will end up in the Tcl library %.${OBJEXT}: %.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(CC_OBJNAME) .rc.$(RES): $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_DEFINES@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(WIN_DIR_NATIVE)" @DEPARG@ #-------------------------------------------------------------------------- # Minizip implementation #-------------------------------------------------------------------------- adler32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/adler32.c compress.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/compress.c crc32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/crc32.c deflate.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/deflate.c ioapi.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/ioapi.c iowin32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/iowin32.c infback.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/infback.c inffast.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inffast.c inflate.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inflate.c inftrees.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inftrees.c trees.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/trees.c uncompr.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/uncompr.c zip.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/zip.c zutil.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/zutil.c minizip.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/minizip.c minizip${HOST_EXEEXT}: $(MINIZIP_OBJS) $(HOST_CC) -o $@ $(MINIZIP_OBJS) # The following target generates the file generic/tclDate.c from the yacc # grammar found in generic/tclGetDate.y. This is only run by hand as yacc is # not available in all environments. The name of the .c file is different than # the name of the .y file so that make doesn't try to automatically regenerate # the .c file. gendate: bison --output-file=$(GENERIC_DIR)/tclDate.c \ --name-prefix=TclDate \ --no-lines \ $(GENERIC_DIR)/tclGetDate.y INSTALL_BASE_TARGETS = install-binaries $(INSTALL_LIBRARIES) $(INSTALL_MSGS) $(INSTALL_TZDATA) INSTALL_DOC_TARGETS = install-doc INSTALL_PACKAGE_TARGETS = install-packages INSTALL_DEV_TARGETS = install-headers INSTALL_EXTRA_TARGETS = INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \ $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS) install: $(INSTALL_TARGETS) install-binaries: binaries @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(MKDIR) "$$i"; \ chmod 755 "$$i"; \ else true; \ fi; \ done; @for i in dde${DDEDOTVER} registry${REGDOTVER}; \ do \ if [ ! -d "$(LIB_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(LIB_INSTALL_DIR)/$$i"; \ $(MKDIR) "$(LIB_INSTALL_DIR)/$$i"; \ else true; \ fi; \ done; @for i in $(TCL_DLL_FILE) $(ZLIB_DLL_FILE) $(TOMMATH_DLL_FILE) $(TCLSH); \ do \ if [ -f $$i ]; then \ echo "Installing $$i to $(BIN_INSTALL_DIR)/"; \ $(COPY) $$i "$(BIN_INSTALL_DIR)"; \ fi; \ done @for i in tclConfig.sh tclooConfig.sh $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) @ZLIB_LIBS@ @TOMMATH_LIBS@; \ do \ if [ -f $$i ]; then \ echo "Installing $$i to $(LIB_INSTALL_DIR)/"; \ $(COPY) $$i "$(LIB_INSTALL_DIR)"; \ fi; \ done @if [ -f $(DDE_DLL_FILE) ]; then \ echo Installing $(DDE_DLL_FILE); \ $(COPY) $(DDE_DLL_FILE) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ $(COPY) $(ROOT_DIR)/library/dde/pkgIndex.tcl \ "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ fi @if [ -f $(DDE_DLL_FILE8) ]; then \ echo Installing $(DDE_DLL_FILE8); \ $(COPY) $(DDE_DLL_FILE8) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ fi @if [ -f $(DDE_LIB_FILE) ]; then \ echo Installing $(DDE_LIB_FILE); \ $(COPY) $(DDE_LIB_FILE) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \ fi @if [ -f $(REG_DLL_FILE) ]; then \ echo Installing $(REG_DLL_FILE); \ $(COPY) $(REG_DLL_FILE) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ $(COPY) $(ROOT_DIR)/library/registry/pkgIndex.tcl \ "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ fi @if [ -f $(REG_DLL_FILE8) ]; then \ echo Installing $(REG_DLL_FILE8); \ $(COPY) $(REG_DLL_FILE8) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ fi @if [ -f $(REG_LIB_FILE) ]; then \ echo Installing $(REG_LIB_FILE); \ $(COPY) $(REG_LIB_FILE) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \ fi @echo "Installing pkg-config file to $(LIB_INSTALL_DIR)/pkgconfig/" @$(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/pkgconfig" @$(INSTALL_DATA) tcl.pc "$(LIB_INSTALL_DIR)/pkgconfig/tcl.pc" install-libraries: libraries install-tzdata install-msgs @for i in "$(prefix)/lib" "$(INCLUDE_INSTALL_DIR)" \ "$(SCRIPT_INSTALL_DIR)" "$(MODULE_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(MKDIR) "$$i"; \ else true; \ fi; \ done; @for i in opt0.4 cookiejar0.2 encoding; \ do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \ else true; \ fi; \ done; @for i in 9.0 9.0/platform; \ do \ if [ ! -d "$(MODULE_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(MODULE_INSTALL_DIR)/$$i"; \ $(MKDIR) "$(MODULE_INSTALL_DIR)/$$i"; \ else true; \ fi; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex; do \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)"; \ done; @echo "Installing package cookiejar 0.2" @for j in $(ROOT_DIR)/library/cookiejar/*.tcl \ $(ROOT_DIR)/library/cookiejar/*.gz; do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \ done; @echo "Installing package http 2.10.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/http/http.tcl "$(MODULE_INSTALL_DIR)/9.0/http-2.10.1.tm"; @echo "Installing package opt 0.4.10"; @for j in $(ROOT_DIR)/library/opt/*.tcl; do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \ done; @echo "Installing package msgcat 1.7.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/9.0/msgcat-1.7.1.tm"; @echo "Installing package tcltest 2.5.10 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.10.tm"; @echo "Installing package platform 1.1.0 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/9.0/platform-1.1.0.tm"; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/shell.tcl "$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm"; @echo "Installing encodings"; @for i in $(ROOT_DIR)/library/encoding/*.enc ; do \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \ done; install-tzdata: @echo "Installing time zone data" @$(TCL_EXE) "$(ROOT_DIR)/tools/installData.tcl" \ "$(ROOT_DIR)/library/tzdata" "$(SCRIPT_INSTALL_DIR_NATIVE)/tzdata" install-msgs: @echo "Installing message catalogs" $(TCL_EXE) "$(ROOT_DIR)/tools/installData.tcl" \ "$(ROOT_DIR)/library/msgs" "$(SCRIPT_INSTALL_DIR_NATIVE)/msgs" install-doc: doc @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)" ; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ else true; \ fi; \ done; @echo "Installing and cross-linking top-level (.1) docs to $(MAN1_INSTALL_DIR)/"; @for i in $(TOP_DIR)/doc/*.1; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \ done @echo "Installing and cross-linking C API (.3) docs to $(MAN3_INSTALL_DIR)/"; @for i in $(TOP_DIR)/doc/*.3; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \ done @echo "Installing and cross-linking command (.n) docs to $(MANN_INSTALL_DIR)/"; @for i in $(TOP_DIR)/doc/*.n; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \ done install-headers: @for i in "$(INCLUDE_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(MKDIR) "$$i"; \ chmod 755 "$$i"; \ else true; \ fi; \ done; @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/"; @for i in $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \ $(GENERIC_DIR)/tclOO.h $(GENERIC_DIR)/tclOODecls.h \ $(GENERIC_DIR)/tclPlatDecls.h \ $(GENERIC_DIR)/tclTomMath.h \ $(GENERIC_DIR)/tclTomMathDecls.h \ $(TOMMATH_DIR)/tommath.h ; \ do \ $(COPY) $$i "$(INCLUDE_INSTALL_DIR)"; \ done; # Optional target to install private headers install-private-headers: libraries @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ do \ if [ ! -d $$i ] ; then \ echo "Making directory $$i"; \ $(MKDIR) $$i; \ else true; \ fi; \ done; @echo "Installing private header files"; @for i in "$(GENERIC_DIR)/tclInt.h" "$(GENERIC_DIR)/tclIntDecls.h" \ "$(GENERIC_DIR)/tclIntPlatDecls.h" "$(GENERIC_DIR)/tclPort.h" \ "$(GENERIC_DIR)/tclOOInt.h" "$(GENERIC_DIR)/tclOOIntDecls.h" \ "$(WIN_DIR)/tclWinPort.h" ; \ do \ $(COPY) "$$i" "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ done; # Specifying TESTFLAGS on the command line is the standard way to pass args to # tcltest, i.e.: # % make test TESTFLAGS="-verbose bps -file fileName.test" test: test-tcl test-packages test-tcl: tcltest TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ $(WINE) ./$(TCLSH) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \ -load "$(TEST_LOAD_FACILITIES)" # Useful target to launch a built tclsh with the proper path,... runtest: tcltest @TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ $(WINE) ./$(TCLSH) $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" $(SCRIPT) # This target can be used to run tclsh from the build directory via # `make shell SCRIPT=foo.tcl` shell: binaries @TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ $(WINE) ./$(TCLSH) $(SCRIPT) # This target can be used to run tclsh inside either gdb or insight gdb: binaries @echo "set env TCL_LIBRARY=$(LIBRARY_DIR)" > gdb.run $(GDB) ./$(TCLSH) --command=gdb.run rm gdb.run shquotequote = $(subst ',\",$(subst ",\",$(1))) gdb-test: tcltest @printf '%s ' 'set env TCL_LIBRARY=$(LIBRARY_DIR)' > gdb.run @printf '\n' >>gdb.run @printf '%s ' set args $(ROOT_DIR_NATIVE)/tests/all.tcl \ $(call shquotequote,$(TESTFLAGS)) -singleproc 1 >> gdb.run $(GDB) ${TEST_EXE_FILE} --command=gdb.run rm gdb.run depend: Makefile: $(SRC_DIR)/Makefile.in ./config.status cleanhelp: $(RM) *.hlp *.cnt *.GID clean: cleanhelp clean-packages $(RM) *.lib *.a *.exp *.dll *.$(RES) *.${OBJEXT} *~ \#* TAGS a.out $(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest.sh # remaining binaries (inclusive manifests) by version/branch switch, but retain tclsh.exe.manifest (that created on configure phase) find . -maxdepth 1 -type f -regex '\./tcl\(sh[^.]+\|test\|[^.]+.dll\)\.[^.]*\(\.manifest\)?' \ -a -not -name 'tclsh.exe.manifest' -exec rm {} \; $(RM) *.pch *.ilk *.pdb *.zip $(RM) minizip${HOST_EXEEXT} *.${HOST_OBJEXT} $(RMDIR) *.vfs distclean: distclean-packages clean $(RM) Makefile config.status config.cache config.log tclConfig.sh \ config.status.lineno tclsh.exe.manifest tclUuid.h # # Bundled package targets # PKG_DIR = ./pkgs packages: @builddir=`$(CYGPATH) $$(pwd -P)`; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ if [ -x $$i/configure ] ; then \ pkg=`basename $$i`; \ mkdir -p $(PKG_DIR)/$$pkg; \ if [ ! -f $(PKG_DIR)/$$pkg/Makefile ]; then \ ( cd $(PKG_DIR)/$$pkg; \ echo "Configuring package '$$i' wd = `$(CYGPATH) $$(pwd -P)`"; \ $$i/configure --with-tcl=$$builddir --with-tclinclude=$(GENERIC_DIR_NATIVE) $(PKG_CFG_ARGS) --enable-shared; ) \ fi ; \ echo "Building package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE); ) \ fi; \ fi; \ done; \ cd $$builddir install-packages: packages @builddir=`pwd -P`; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ]; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ]; then \ echo "Installing package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) install "DESTDIR=$(INSTALL_ROOT)"; ) \ fi; \ fi; \ done; \ cd $$builddir test-packages: tcltest packages @builddir=`pwd -P`; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ]; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ]; then \ echo "Testing package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) "LD_LIBRARY_PATH=$$builddir:${LD_LIBRARY_PATH}" "TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" "TCLLIBPATH=$$builddir/pkgs" test "TCLSH_PROG=$$builddir/${TCLSH}"; ) \ fi; \ fi; \ done; \ cd $$builddir clean-packages: @builddir=`pwd -P`; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ]; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ]; then \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) clean; ) \ fi; \ fi; \ done; \ cd $$builddir distclean-packages: @builddir=`pwd -P`; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ]; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ]; then \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) distclean; ) \ fi; \ cd $$builddir; \ rm -rf $(PKG_DIR)/$$pkg; \ fi; \ done; \ rm -rf $(PKG_DIR) # # Regenerate the stubs files. # $(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls \ $(GENERIC_DIR)/tclInt.decls @echo "Warning: tclStubInit.c may be out of date." @echo "Developers may want to run \"make genstubs\" to regenerate." @echo "This warning can be safely ignored, do not report as a bug!" genstubs: $(TCL_EXE) "$(TOOL_DIR_NATIVE)/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ "$(GENERIC_DIR_NATIVE)/tcl.decls" \ "$(GENERIC_DIR_NATIVE)/tclInt.decls" \ "$(GENERIC_DIR_NATIVE)/tclTomMath.decls" $(TCL_EXE) "$(TOOL_DIR_NATIVE)/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ "$(GENERIC_DIR_NATIVE)/tclOO.decls" # # This target creates the HTML folder for Tcl & Tk and places it in # DISTDIR/html. It uses the tcltk-man2html.tcl tool from the Tcl group's tool # workspace. It depends on the Tcl & Tk being in directories called tcl9.* & # tk8.* up two directories from the TOOL_DIR. # TOOL_DIR=$(ROOT_DIR)/tools HTML_INSTALL_DIR=$(ROOT_DIR)/html html: $(MAKE) shell SCRIPT="$(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) --srcdir=$(ROOT_DIR)/.. $(BUILD_HTML_FLAGS)" html-tcl: $(TCLSH) $(MAKE) shell SCRIPT="$(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) --srcdir=$(ROOT_DIR)/.. $(BUILD_HTML_FLAGS) --tcl" html-tk: $(TCLSH) $(MAKE) shell SCRIPT="$(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) --srcdir=$(ROOT_DIR)/.. $(BUILD_HTML_FLAGS) --tk" # # The list of all the targets that do not correspond to real files. This stops # 'make' from getting confused when someone makes an error in a rule. # .PHONY: all tcltest binaries libraries doc gendate gentommath_h install .PHONY: install-binaries install-libraries install-tzdata install-msgs .PHONY: install-doc install-private-headers test test-tcl runtest shell .PHONY: gdb depend cleanhelp clean distclean packages install-packages .PHONY: test-packages clean-packages distclean-packages genstubs html .PHONY: html-tcl html-tk genscript .PHONY: tclzipfile # DO NOT DELETE THIS LINE -- make depend depends on it. tcl9.0.3/win/license.terms0000644000175000017500000000431715076154263015057 0ustar sergeisergeiThis software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. tcl9.0.3/win/gitmanifest.in0000644000175000017500000000000415076154273015211 0ustar sergeisergeigit-tcl9.0.3/win/configure.ac0000644000175000017500000003477515104661342014653 0ustar sergeisergei#! /bin/bash -norc # This file is an input file used by the GNU "autoconf" program to # generate the file "configure", which is run during Tcl installation # to configure the system for the local environment. AC_INIT([tcl],[9.0]) AC_CONFIG_SRCDIR([../generic/tcl.h]) AC_PREREQ([2.69]) # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 TCL_PATCH_LEVEL=".3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 TCL_DDE_MAJOR_VERSION=1 TCL_DDE_MINOR_VERSION=4 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION TCL_REG_VERSION=1.3 TCL_REG_MAJOR_VERSION=1 TCL_REG_MINOR_VERSION=3 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION PKG_CFG_ARGS=$@ #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ rm -Rf pkgs #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # libdir must be a fully qualified path (not ${exec_prefix}/lib) eval libdir="$libdir" #------------------------------------------------------------------------ # Standard compiler checks #------------------------------------------------------------------------ # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_C_INLINE AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib) AC_CHECK_TOOL(RC, windres) #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ SC_TCL_CFG_ENCODING #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- SC_ENABLE_SHARED #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- SC_CONFIG_CFLAGS # Cross-compiling case ${host_alias} in *mingw32*) TCL_EXE="tclsh" ;; *) TCL_EXE="TCL_LIBRARY=\"\${LIBRARY_DIR}\"; export TCL_LIBRARY; ./\${TCLSH}" ;; esac #------------------------------------------------------------------------ # Add stuff for zlib/libtommath; note that this is mostly done in the # makefile now as we just assume that the platform hasn't got usable # z.lib/tommath.lib #------------------------------------------------------------------------ AS_IF([test "${enable_shared+set}" = "set"], [ enableval="$enable_shared" tcl_ok=$enableval ], [ tcl_ok=yes ]) zlib_lib_name=zdll.lib tommath_lib_name=tommath.lib AS_IF([test "$tcl_ok" = "yes"], [ AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}]) AC_SUBST(TOMMATH_DLL_FILE,[\${TOMMATH_DLL_FILE}]) AC_DEFINE(TCL_WITH_EXTERNAL_TOMMATH, 1, [Tcl with external libtommath]) AS_IF([test "$do64bit" != "no"], [ AC_DEFINE(MP_64BIT, 1, [Using libtommath.dll in 64-bit mode]) AS_IF([test "$do64bit" = "arm64" -o "$do64bit" = "aarch64"], [ AS_IF([test "$GCC" = "yes"],[ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.a]) AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64-arm/libtommath.dll.a]) zlib_lib_name=libz.dll.a tommath_lib_name=libtommath.dll.a ], [ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/zdll.lib]) AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64-arm/tommath.lib]) ]) ], [ AS_IF([test "$GCC" = "yes"],[ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a]) AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a]) zlib_lib_name=libz.dll.a tommath_lib_name=libtommath.dll.a ], [ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib]) AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win64/tommath.lib]) ]) ]) ], [ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win32/zdll.lib]) AC_SUBST(TOMMATH_LIBS,[\${TOMMATH_DIR_NATIVE}/win32/tommath.lib]) ]) ], [ AC_DEFINE(TCL_WITH_INTERNAL_ZLIB, 1, [Tcl with internal zlib]) AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}]) AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}]) ]) AC_SUBST(TCL_ZLIB_LIB_NAME, $zlib_lib_name) AC_SUBST(TCL_TOMMATH_LIB_NAME, $tommath_lib_name) AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[ #include ]]) #-------------------------------------------------------------------- # Zipfs support - Tip 430 #-------------------------------------------------------------------- AC_ARG_ENABLE(zipfs, AS_HELP_STRING([--enable-zipfs], [build with Zipfs support (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes" ; then # # Find a native compiler # AX_CC_FOR_BUILD # # Find a native zip implementation # SC_PROG_TCLSH SC_ZIPFS_SUPPORT ZIPFS_BUILD=1 TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with zipfs]) if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) else AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ fi AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi AC_SUBST(ZIPFS_BUILD) AC_SUBST(TCL_ZIP_FILE) AC_SUBST(INSTALL_LIBRARIES) AC_SUBST(INSTALL_MSGS) #-------------------------------------------------------------------- # Perform additinal compiler tests. #-------------------------------------------------------------------- # See if declarations like FINDEX_INFO_LEVELS are # missing from winbase.h. This is known to be # a problem with VC++ 5.2. AC_CACHE_CHECK(for FINDEX_INFO_LEVELS in winbase.h, tcl_cv_findex_enums, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN ]], [[ FINDEX_INFO_LEVELS i; FINDEX_SEARCH_OPS j; ]])], [tcl_cv_findex_enums=yes], [tcl_cv_findex_enums=no]) ) if test "$tcl_cv_findex_enums" = "no"; then AC_DEFINE(HAVE_NO_FINDEX_ENUMS, 1, [Defined when enums are missing from winbase.h]) fi # See if the compiler supports intrinsics. AC_CACHE_CHECK(for intrinsics support in compiler, tcl_cv_intrinsics, AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include ]], [[ __cpuidex(0,0,0); ]])], [tcl_cv_intrinsics=yes], [tcl_cv_intrinsics=no]) ) if test "$tcl_cv_intrinsics" = "yes"; then AC_DEFINE(HAVE_INTRIN_H, 1, [Defined when the compilers supports intrinsics]) fi # See if the compiler supports cpuid header. AC_CACHE_CHECK(for cpuid.h, tcl_cv_cpuid_h, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ __get_cpuid(0, 0, 0, 0, 0); ]])], [tcl_cv_cpuid_h=yes], [tcl_cv_cpuid_h=no]) ) if test "$tcl_cv_cpuid_h" = "yes"; then AC_DEFINE(HAVE_CPUID_H, 1, [Defined when cpuid.h exists]) fi # See if the header file is present AC_CACHE_CHECK(for wspiapi.h, tcl_cv_wspiapi_h, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[]])], [tcl_cv_wspiapi_h=yes], [tcl_cv_wspiapi_h=no]) ) if test "$tcl_cv_wspiapi_h" = "yes"; then AC_DEFINE(HAVE_WSPIAPI_H, 1, [Defined when wspiapi.h exists]) fi # See if declarations like FINDEX_INFO_LEVELS are # missing from winbase.h. This is known to be # a problem with VC++ 5.2. AC_CACHE_CHECK(for FINDEX_INFO_LEVELS in winbase.h, tcl_cv_findex_enums, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN ]], [[ FINDEX_INFO_LEVELS i; FINDEX_SEARCH_OPS j; ]])], [tcl_cv_findex_enums=yes], [tcl_cv_findex_enums=no]) ) if test "$tcl_cv_findex_enums" = "no"; then AC_DEFINE(HAVE_NO_FINDEX_ENUMS, 1, [Defined when enums are missing from winbase.h]) fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called # after SC_CONFIG_CFLAGS macro is called. #-------------------------------------------------------------------- SC_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Embed the manifest if we can determine how #-------------------------------------------------------------------- SC_EMBED_MANIFEST #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- # Perform final evaluations of variables with possible substitutions. #-------------------------------------------------------------------- eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${LIBFLAGSUFFIX}\"" eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TCL_LIB_FLAG=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\"" eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\"" else eval "TCL_LIB_FLAG=\"-ltcl${VER}${FLAGSUFFIX}\"" eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${DLLSUFFIX}.a\"" fi eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX} CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX} #-------------------------------------------------------------------- # Adjust the defines for how the resources are built depending # on symbols and static vs. shared. #-------------------------------------------------------------------- if test ${SHARED_BUILD} = 0 ; then RC_DEFINES="${RC_DEFINE} STATIC_BUILD" else RC_DEFINES="" fi #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which # gives a list of directories that may contain packages. The list # consists of one directory for machine-dependent binaries and # another for platform-independent scripts. #-------------------------------------------------------------------- if test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir};${prefix}\\lib" else TCL_PACKAGE_PATH="${prefix}\\lib" fi # The tclsh.exe.manifest requires these # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs # the release level, and must account for interim release versioning case "$TCL_PATCH_LEVEL" in *a*) TCL_RELEASE_LEVEL=0 ;; *b*) TCL_RELEASE_LEVEL=1 ;; *) TCL_RELEASE_LEVEL=2 ;; esac TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d ab.`" AC_SUBST(TCL_WIN_VERSION) # X86|AMD64|ARM64|IA64 for manifest AC_SUBST(MACHINE) AC_SUBST(TCL_VERSION) AC_SUBST(TCL_MAJOR_VERSION) AC_SUBST(TCL_MINOR_VERSION) AC_SUBST(TCL_PATCH_LEVEL) AC_SUBST(PKG_CFG_ARGS) AC_SUBST(TCL_EXE) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_STATIC_LIB_FILE) AC_SUBST(TCL_STATIC_LIB_FLAG) AC_SUBST(TCL_IMPORT_LIB_FILE) AC_SUBST(TCL_IMPORT_LIB_FLAG) # empty on win AC_SUBST(TCL_LIBS) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_PATH) AC_SUBST(TCL_INCLUDE_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_PATH) AC_SUBST(TCL_DLL_FILE) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_BIN_DIR) AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX) # win/tcl.m4 doesn't set (CFLAGS) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(EXTRA_CFLAGS) AC_SUBST(CYGPATH) AC_SUBST(DEPARG) AC_SUBST(CC_OBJNAME) AC_SUBST(CC_EXENAME) # win/tcl.m4 doesn't set (LDFLAGS) AC_SUBST(LDFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) AC_SUBST(LDFLAGS_CONSOLE) AC_SUBST(LDFLAGS_WINDOW) AC_SUBST(AR) AC_SUBST(RANLIB) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_SUFFIX) AC_SUBST(TCL_SHARED_BUILD) AC_SUBST(LIBS) AC_SUBST(LIBS_GUI) AC_SUBST(DLLSUFFIX) AC_SUBST(LIBPREFIX) AC_SUBST(LIBSUFFIX) AC_SUBST(EXESUFFIX) AC_SUBST(LIBRARIES) AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(POST_MAKE_LIB) AC_SUBST(MAKE_DLL) AC_SUBST(MAKE_EXE) AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_PACKAGE_PATH) # win only AC_SUBST(TCL_DDE_VERSION) AC_SUBST(TCL_DDE_MAJOR_VERSION) AC_SUBST(TCL_DDE_MINOR_VERSION) AC_SUBST(TCL_REG_VERSION) AC_SUBST(TCL_REG_MAJOR_VERSION) AC_SUBST(TCL_REG_MINOR_VERSION) AC_SUBST(RC) AC_SUBST(RC_OUT) AC_SUBST(RC_TYPE) AC_SUBST(RC_INCLUDE) AC_SUBST(RC_DEFINE) AC_SUBST(RC_DEFINES) AC_SUBST(RES) AC_CONFIG_FILES([Makefile tclConfig.sh tclsh.exe.manifest tcl.pc:../unix/tcl.pc.in]) AC_OUTPUT dnl Local Variables: dnl mode: autoconf dnl End: tcl9.0.3/win/configure0000755000175000017500000057661515104661342014300 0ustar sergeisergei#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for tcl 9.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' PACKAGE_VERSION='9.0' PACKAGE_STRING='tcl 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="../generic/tcl.h" ac_subst_vars='LTLIBOBJS LIBOBJS RES RC_DEFINES RC_DEFINE RC_INCLUDE RC_TYPE RC_OUT TCL_REG_MINOR_VERSION TCL_REG_MAJOR_VERSION TCL_REG_VERSION TCL_DDE_MINOR_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_VERSION TCL_PACKAGE_PATH TCL_BUILD_LIB_SPEC MAKE_EXE MAKE_DLL POST_MAKE_LIB MAKE_STUB_LIB MAKE_LIB LIBRARIES EXESUFFIX LIBSUFFIX LIBPREFIX DLLSUFFIX LIBS_GUI TCL_SHARED_BUILD SHLIB_SUFFIX SHLIB_CFLAGS SHLIB_LD_LIBS SHLIB_LD STLIB_LD LDFLAGS_WINDOW LDFLAGS_CONSOLE LDFLAGS_OPTIMIZE LDFLAGS_DEBUG CC_EXENAME CC_OBJNAME DEPARG EXTRA_CFLAGS CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_SHARED_LIB_SUFFIX TCL_BIN_DIR TCL_SRC_DIR TCL_DLL_FILE TCL_BUILD_STUB_LIB_PATH TCL_BUILD_STUB_LIB_SPEC TCL_INCLUDE_SPEC TCL_STUB_LIB_PATH TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIBS TCL_IMPORT_LIB_FLAG TCL_IMPORT_LIB_FILE TCL_STATIC_LIB_FLAG TCL_STATIC_LIB_FILE TCL_LIB_FLAG TCL_LIB_FILE TCL_EXE PKG_CFG_ARGS TCL_PATCH_LEVEL TCL_MINOR_VERSION TCL_MAJOR_VERSION TCL_VERSION MACHINE TCL_WIN_VERSION VC_MANIFEST_EMBED_EXE VC_MANIFEST_EMBED_DLL CPP LDFLAGS_DEFAULT CFLAGS_DEFAULT INSTALL_MSGS INSTALL_LIBRARIES TCL_ZIP_FILE ZIPFS_BUILD ZIP_INSTALL_OBJS ZIP_PROG_VFSSEARCH ZIP_PROG_OPTIONS ZIP_PROG TCLSH_PROG EXEEXT_FOR_BUILD CC_FOR_BUILD TCL_TOMMATH_LIB_NAME TCL_ZLIB_LIB_NAME TOMMATH_OBJS ZLIB_OBJS TOMMATH_LIBS ZLIB_LIBS TOMMATH_DLL_FILE ZLIB_DLL_FILE CFLAGS_NOLTO CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG DL_LIBS WINE CYGPATH SHARED_BUILD SET_MAKE RC RANLIB AR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL OBJEXT_FOR_BUILD' ac_subst_files='' ac_user_opts=' enable_option_checking with_encoding enable_shared enable_64bit enable_zipfs enable_symbols enable_embedded_manifest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures tcl 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tcl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tcl 9.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (where applicable) --enable-zipfs build with Zipfs support (default: on) --enable-symbols build with debugging symbols (default: off) --enable-embedded-manifest embed manifest if possible (default: yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tcl configure 9.0 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then 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 fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; 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 eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 TCL_PATCH_LEVEL=".3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 TCL_DDE_MAJOR_VERSION=1 TCL_DDE_MINOR_VERSION=4 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION TCL_REG_VERSION=1.3 TCL_REG_MAJOR_VERSION=1 TCL_REG_MINOR_VERSION=3 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION PKG_CFG_ARGS=$@ #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ rm -Rf pkgs #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # libdir must be a fully qualified path (not ${exec_prefix}/lib) eval libdir="$libdir" #------------------------------------------------------------------------ # Standard compiler checks #------------------------------------------------------------------------ # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo (void) {return 0; } $ac_kw foo_t foo (void) {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RC"; then ac_cv_prog_RC="$RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RC=$ac_cv_prog_RC if test -n "$RC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 printf "%s\n" "$RC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 printf "%s\n" "$ac_ct_RC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RC" = x; then RC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RC=$ac_ct_RC fi else RC="$ac_cv_prog_RC" fi #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ # Check whether --with-encoding was given. if test ${with_encoding+y} then : withval=$with_encoding; with_tcencoding=${withval} fi if test x"${with_tcencoding}" != x ; then printf "%s\n" "#define TCL_CFGVAL_ENCODING \"${with_tcencoding}\"" >>confdefs.h else printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 printf %s "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_BUILD=1 else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } SHARED_BUILD=0 printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- # Step 0: Enable 64 bit support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 printf %s "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test ${enable_64bit+y} then : enableval=$enable_64bit; do64bit=$enableval else case e in #( e) do64bit=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 printf "%s\n" "$do64bit" >&6; } # Set some defaults (may get changed below) EXTRA_CFLAGS="" printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CYGPATH+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi ;; esac fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 printf "%s\n" "$CYGPATH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "wine", so it can be a program name with args. set dummy wine; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_WINE+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$WINE"; then ac_cv_prog_WINE="$WINE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_WINE="wine" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi WINE=$ac_cv_prog_WINE if test -n "$WINE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WINE" >&5 printf "%s\n" "$WINE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi SHLIB_SUFFIX=".dll" # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|arm64|ia64. MACHINE="X86" if test "$GCC" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 printf %s "checking for cross-compile version of gcc... " >&6; } if test ${ac_cv_cross+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _WIN32 #error cross-compiler #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cross=no else case e in #( e) ac_cv_cross=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 printf "%s\n" "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-${CC}" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; arm64|aarch64) CC="aarch64-w64-mingw32-${CC}" LD="aarch64-w64-mingw32-ld" AR="aarch64-w64-mingw32-ar" RANLIB="aarch64-w64-mingw32-ranlib" RC="aarch64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi fi # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires # Windows native paths while Cygwin should work # with both. Avoid the bug by passing a POSIX # path when using the Cygwin toolchain. if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then conftest=/tmp/conftest.rc echo "STRINGTABLE BEGIN" > $conftest echo "101 \"name\"" >> $conftest echo "END" >> $conftest { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Windows native path bug in windres" >&5 printf %s "checking for Windows native path bug in windres... " >&6; } cyg_conftest=`$CYGPATH $conftest` if { ac_try='$RC -o conftest.res.o $cyg_conftest' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CYGPATH=echo fi conftest= cyg_conftest= fi if test "$CYGPATH" = "echo"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' fi # set various compiler flags depending on whether we are using gcc or cl if test "${GCC}" = "yes" ; then extra_cflags="-pipe" extra_ldflags="-pipe -static-libgcc" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mingw32 version of gcc" >&5 printf %s "checking for mingw32 version of gcc... " >&6; } if test ${ac_cv_win32+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 #error win32 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_win32=no else case e in #( e) ac_cv_win32=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_win32" >&5 printf "%s\n" "$ac_cv_win32" >&6; } if test "$ac_cv_win32" != "yes"; then as_fn_error $? "${CC} cannot produce win32 executables." "$LINENO" 5 fi if test "$do64bit" != "arm64" -a "$do64bit" != "aarch64"; then extra_cflags="$extra_cflags -DHAVE_CPUID=1" fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -municode linker flag" >&5 printf %s "checking for working -municode linker flag... " >&6; } if test ${ac_cv_municode+y} then : printf %s "(cached) " >&6 else case e in #( e) # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_municode=yes else case e in #( e) ac_cv_municode=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_municode" >&5 printf "%s\n" "$ac_cv_municode" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_municode" = "yes" ; then extra_ldflags="$extra_ldflags -municode" fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 printf %s "checking for working -fno-lto... " >&6; } if test ${ac_cv_nolto+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_nolto=yes else case e in #( e) ac_cv_nolto=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 printf "%s\n" "$ac_cv_nolto" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker understands --disable-high-entropy-va" >&5 printf %s "checking if the linker understands --disable-high-entropy-va... " >&6; } if test ${tcl_cv_ld_high_entropy+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--disable-high-entropy-va" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_ld_high_entropy=yes else case e in #( e) tcl_cv_ld_high_entropy=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_high_entropy" >&5 printf "%s\n" "$tcl_cv_ld_high_entropy" >&6; } if test $tcl_cv_ld_high_entropy = yes; then extra_ldflags="$extra_ldflags -Wl,--disable-high-entropy-va" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5 printf %s "checking if the compiler understands -finput-charset... " >&6; } if test ${tcl_cv_cc_input_charset+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_input_charset=yes else case e in #( e) tcl_cv_cc_input_charset=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5 printf "%s\n" "$tcl_cv_cc_input_charset" >&6; } if test $tcl_cv_cc_input_charset = yes; then extra_cflags="$extra_cflags -finput-charset=UTF-8" fi fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--enable-auto-image-base" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working --enable-auto-image-base" >&5 printf %s "checking for working --enable-auto-image-base... " >&6; } if test ${ac_cv_enable_auto_image_base+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_enable_auto_image_base=yes else case e in #( e) ac_cv_enable_auto_image_base=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_auto_image_base" >&5 printf "%s\n" "$ac_cv_enable_auto_image_base" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_enable_auto_image_base" = "yes" ; then extra_ldflags="$extra_ldflags -Wl,--enable-auto-image-base" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler flags" >&5 printf %s "checking compiler flags... " >&6; } if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32 -lwinspool" STLIB_LD='${AR} cr' RC_OUT=-o RC_TYPE= RC_INCLUDE=--include RC_DEFINE=--define RES=res.o MAKE_LIB="\${STLIB_LD} \$@" MAKE_STUB_LIB="\${STLIB_LD} \$@" POST_MAKE_LIB="\${RANLIB} \$@" MAKE_EXE="\${CC} -o \$@" LIBPREFIX="lib" if test "${SHARED_BUILD}" = "0" ; then # static { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using static flags" >&5 printf "%s\n" "using static flags" >&6; } runtime= LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s.exe" else # dynamic { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using shared flags" >&5 printf "%s\n" "using shared flags" >&6; } # ad-hoc check to see if CC supports -shared. if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then as_fn_error $? "${CC} does not support the -shared option. You will need to upgrade to a newer version of the toolchain." "$LINENO" 5 fi runtime= # Add SHLIB_LD_LIBS to the Make rule, not here. EXESUFFIX=".exe" LIBRARIES="\${SHARED_LIBRARIES}" fi # Link with gcc since ld does not link to default libs like # -luser32 and -lmsvcrt by default. SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \$@ ${extra_ldflags} \ -Wl,--out-implib,\$(patsubst %.dll,lib%.dll.a,\$@)" # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX=".dll" LIBSUFFIX=".a" LIBFLAGSUFFIX="" SHLIB_SUFFIX=.dll EXTRA_CFLAGS="${extra_cflags}" CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= case "${CC}" in *++) CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac # Specify the CC output file names based on the target name CC_OBJNAME="-o \$@" CC_EXENAME="-o \$@" # Specify linker flags depending on the type of app being # built -- Console vs. Window. # # ORIGINAL COMMENT: # We need to pass -e _WinMain@16 so that ld will use # WinMain() instead of main() as the entry point. We can't # use autoconf to check for this case since it would need # to run an executable and that does not work when # cross compiling. Remove this -e workaround once we # require a gcc that does not have this bug. # # MK NOTE: Tk should use a different mechanism. This causes # interesting problems, such as wish dying at startup. #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 printf "%s\n" " Using 64-bit $MACHINE mode" >&6; } ;; arm64|aarch64) MACHINE="ARM64" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using ARM64 $MACHINE mode" >&5 printf "%s\n" " Using ARM64 $MACHINE mode" >&6; } ;; ia64) MACHINE="IA64" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using IA64 $MACHINE mode" >&5 printf "%s\n" " Using IA64 $MACHINE mode" >&6; } ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _WIN64 #error 32-bit #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_win_64bit=yes else case e in #( e) tcl_win_64bit=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$tcl_win_64bit" = "yes" ; then do64bit=amd64 MACHINE="AMD64" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 printf "%s\n" " Using 64-bit $MACHINE mode" >&6; } fi ;; esac else if test "${SHARED_BUILD}" = "0" ; then # static { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using static flags" >&5 printf "%s\n" "using static flags" >&6; } runtime=-MT LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s.exe" else # dynamic { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using shared flags" >&5 printf "%s\n" "using shared flags" >&6; } runtime=-MD # Add SHLIB_LD_LIBS to the Make rule, not here. LIBRARIES="\${SHARED_LIBRARIES}" EXESUFFIX=".exe" case "x`echo \${VisualStudioVersion}`" in x1[4-9]*) lflags="${lflags} -nodefaultlib:ucrt.lib" ;; *) ;; esac fi MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@" # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX=".dll" LIBSUFFIX=".lib" LIBFLAGSUFFIX="" if test "$do64bit" != "no" ; then case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; arm64|aarch64) MACHINE="ARM64" ;; ia64) MACHINE="IA64" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 printf "%s\n" " Using 64-bit $MACHINE mode" >&6; } fi LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) ;; esac if test "$do64bit" != "no" ; then RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo -MACHINE:${MACHINE}" LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 LIBS="$LIBS bufferoverflowU.lib" else RC="rc" # -Od - no optimization # -WX - warnings as errors CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo" LINKBIN="link" fi LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib uuid.lib winspool.lib" SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}" SHLIB_LD_LIBS='${LIBS}' # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" RC_OUT=-fo RC_TYPE=-r RC_INCLUDE=-i RC_DEFINE=-d RES=res MAKE_LIB="\${STLIB_LD} -out:\$@" MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\$@" POST_MAKE_LIB= MAKE_EXE="\${CC} -Fe\$@" LIBPREFIX="" CFLAGS_DEBUG="${CFLAGS_DEBUG} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" EXTRA_CFLAGS="" CFLAGS_WARNING="-W3" LDFLAGS_DEBUG="-debug" LDFLAGS_OPTIMIZE="-release" # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\$@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. if test "${TARGETCPU}" != "X86"; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi if test "$do64bit" != "no" ; then printf "%s\n" "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi if test "${GCC}" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 printf %s "checking for SEH support in compiler... " >&6; } if test ${tcl_cv_seh+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : tcl_cv_seh=no else case e in #( e) # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO" then : tcl_cv_seh=yes else case e in #( e) tcl_cv_seh=no ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 printf "%s\n" "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then printf "%s\n" "#define HAVE_NO_SEH 1" >>confdefs.h fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 printf %s "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } if test ${tcl_cv_eh_disposition+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN int main (void) { EXCEPTION_DISPOSITION x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_eh_disposition=yes else case e in #( e) tcl_cv_eh_disposition=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 printf "%s\n" "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then printf "%s\n" "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 printf %s "checking for cast to union support... " >&6; } if test ${tcl_cv_cast_to_union+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cast_to_union=yes else case e in #( e) tcl_cv_cast_to_union=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 printf "%s\n" "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi fi # DL_LIBS is empty, but then we match the Unix version # Cross-compiling case ${host_alias} in *mingw32*) TCL_EXE="tclsh" ;; *) TCL_EXE="TCL_LIBRARY=\"\${LIBRARY_DIR}\"; export TCL_LIBRARY; ./\${TCLSH}" ;; esac #------------------------------------------------------------------------ # Add stuff for zlib/libtommath; note that this is mostly done in the # makefile now as we just assume that the platform hasn't got usable # z.lib/tommath.lib #------------------------------------------------------------------------ if test "${enable_shared+set}" = "set" then : enableval="$enable_shared" tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi zlib_lib_name=zdll.lib tommath_lib_name=tommath.lib if test "$tcl_ok" = "yes" then : ZLIB_DLL_FILE=\${ZLIB_DLL_FILE} TOMMATH_DLL_FILE=\${TOMMATH_DLL_FILE} printf "%s\n" "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h if test "$do64bit" != "no" then : printf "%s\n" "#define MP_64BIT 1" >>confdefs.h if test "$do64bit" = "arm64" -o "$do64bit" = "aarch64" then : if test "$GCC" = "yes" then : ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.a TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64-arm/libtommath.dll.a zlib_lib_name=libz.dll.a tommath_lib_name=libtommath.dll.a else case e in #( e) ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64-arm/zdll.lib TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64-arm/tommath.lib ;; esac fi else case e in #( e) if test "$GCC" = "yes" then : ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/libz.dll.a TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64/libtommath.dll.a zlib_lib_name=libz.dll.a tommath_lib_name=libtommath.dll.a else case e in #( e) ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/zdll.lib TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win64/tommath.lib ;; esac fi ;; esac fi else case e in #( e) ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win32/zdll.lib TOMMATH_LIBS=\${TOMMATH_DIR_NATIVE}/win32/tommath.lib ;; esac fi else case e in #( e) printf "%s\n" "#define TCL_WITH_INTERNAL_ZLIB 1" >>confdefs.h ZLIB_OBJS=\${ZLIB_OBJS} TOMMATH_OBJS=\${TOMMATH_OBJS} ;; esac fi TCL_ZLIB_LIB_NAME=$zlib_lib_name TCL_TOMMATH_LIB_NAME=$tommath_lib_name ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" " #include " if test "x$ac_cv_type_intptr_t" = xyes then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" " #include " if test "x$ac_cv_type_uintptr_t" = xyes then : printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h fi #-------------------------------------------------------------------- # Zipfs support - Tip 430 #-------------------------------------------------------------------- # Check whether --enable-zipfs was given. if test ${enable_zipfs+y} then : enableval=$enable_zipfs; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" ; then # # Find a native compiler # # Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5 printf %s "checking for gcc... " >&6; } if test ${ac_cv_path_cc+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/gcc 2> /dev/null` \ `ls -r $dir/gcc 2> /dev/null` ; do if test x"$ac_cv_path_cc" = x ; then if test -f "$j" ; then ac_cv_path_cc=$j break fi fi done done ;; esac fi fi fi # Also set EXEEXT_FOR_BUILD. if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5 printf %s "checking for build system executable suffix... " >&6; } if test ${bfd_cv_build_exeext+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; esac done rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5 printf "%s\n" "$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi # # Find a native zip implementation # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 printf %s "checking for tclsh... " >&6; } if test ${ac_cv_path_tclsh+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]*.exe 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 printf "%s\n" "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 printf "%s\n" "No tclsh found on PATH" >&6; } fi ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zip" >&5 printf %s "checking for zip... " >&6; } if test ${ac_cv_path_zip+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5 printf "%s\n" "$ZIP_PROG" >&6; } ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5 printf "%s\n" "Found INFO Zip in environment" >&6; } # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH building minizip" >&5 printf "%s\n" "No zip found on PATH building minizip" >&6; } fi ZIPFS_BUILD=1 TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5 printf %s "checking for building with zipfs... " >&6; } if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h else printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi #-------------------------------------------------------------------- # Perform additinal compiler tests. #-------------------------------------------------------------------- # See if declarations like FINDEX_INFO_LEVELS are # missing from winbase.h. This is known to be # a problem with VC++ 5.2. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FINDEX_INFO_LEVELS in winbase.h" >&5 printf %s "checking for FINDEX_INFO_LEVELS in winbase.h... " >&6; } if test ${tcl_cv_findex_enums+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main (void) { FINDEX_INFO_LEVELS i; FINDEX_SEARCH_OPS j; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_findex_enums=yes else case e in #( e) tcl_cv_findex_enums=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_findex_enums" >&5 printf "%s\n" "$tcl_cv_findex_enums" >&6; } if test "$tcl_cv_findex_enums" = "no"; then printf "%s\n" "#define HAVE_NO_FINDEX_ENUMS 1" >>confdefs.h fi # See if the compiler supports intrinsics. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intrinsics support in compiler" >&5 printf %s "checking for intrinsics support in compiler... " >&6; } if test ${tcl_cv_intrinsics+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include int main (void) { __cpuidex(0,0,0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_intrinsics=yes else case e in #( e) tcl_cv_intrinsics=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_intrinsics" >&5 printf "%s\n" "$tcl_cv_intrinsics" >&6; } if test "$tcl_cv_intrinsics" = "yes"; then printf "%s\n" "#define HAVE_INTRIN_H 1" >>confdefs.h fi # See if the compiler supports cpuid header. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cpuid.h" >&5 printf %s "checking for cpuid.h... " >&6; } if test ${tcl_cv_cpuid_h+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { __get_cpuid(0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cpuid_h=yes else case e in #( e) tcl_cv_cpuid_h=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid_h" >&5 printf "%s\n" "$tcl_cv_cpuid_h" >&6; } if test "$tcl_cv_cpuid_h" = "yes"; then printf "%s\n" "#define HAVE_CPUID_H 1" >>confdefs.h fi # See if the header file is present { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wspiapi.h" >&5 printf %s "checking for wspiapi.h... " >&6; } if test ${tcl_cv_wspiapi_h+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_wspiapi_h=yes else case e in #( e) tcl_cv_wspiapi_h=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_wspiapi_h" >&5 printf "%s\n" "$tcl_cv_wspiapi_h" >&6; } if test "$tcl_cv_wspiapi_h" = "yes"; then printf "%s\n" "#define HAVE_WSPIAPI_H 1" >>confdefs.h fi # See if declarations like FINDEX_INFO_LEVELS are # missing from winbase.h. This is known to be # a problem with VC++ 5.2. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FINDEX_INFO_LEVELS in winbase.h" >&5 printf %s "checking for FINDEX_INFO_LEVELS in winbase.h... " >&6; } if test ${tcl_cv_findex_enums+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main (void) { FINDEX_INFO_LEVELS i; FINDEX_SEARCH_OPS j; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_findex_enums=yes else case e in #( e) tcl_cv_findex_enums=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_findex_enums" >&5 printf "%s\n" "$tcl_cv_findex_enums" >&6; } if test "$tcl_cv_findex_enums" = "no"; then printf "%s\n" "#define HAVE_NO_FINDEX_ENUMS 1" >>confdefs.h fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called # after SC_CONFIG_CFLAGS macro is called. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 printf %s "checking for build with symbols... " >&6; } # Check whether --enable-symbols was given. if test ${enable_symbols+y} then : enableval=$enable_symbols; tcl_ok=$enableval else case e in #( e) tcl_ok=no ;; esac fi # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' printf "%s\n" "#define NDEBUG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 printf "%s\n" "yes (standard debugging)" >&6; } fi fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_COMPILE_DEBUG 1" >>confdefs.h printf "%s\n" "#define TCL_COMPILE_STATS 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 printf "%s\n" "enabled symbols mem compile debugging" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 printf "%s\n" "enabled $tcl_ok debugging" >&6; } fi fi #-------------------------------------------------------------------- # Embed the manifest if we can determine how #-------------------------------------------------------------------- ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to embed manifest" >&5 printf %s "checking whether to embed manifest... " >&6; } # Check whether --enable-embedded-manifest was given. if test ${enable_embedded_manifest+y} then : enableval=$enable_embedded_manifest; embed_ok=$enableval else case e in #( e) embed_ok=yes ;; esac fi VC_MANIFEST_EMBED_DLL= VC_MANIFEST_EMBED_EXE= result=no if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \ -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 print("manifest needed") #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "manifest needed" >/dev/null 2>&1 then : # Could do a CHECK_PROG for mt, but should always be with MSVC8+ # Could add 'if test -f' check, but manifest should be created # in this compiler case # Add in a manifest argument that may be specified # XXX Needs improvement so that the test for existence accounts # XXX for a provided (known) manifest VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi" VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi" result=yes if test "x" != x ; then result="yes ()" fi fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $result" >&5 printf "%s\n" "$result" >&6; } #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- # Perform final evaluations of variables with possible substitutions. #-------------------------------------------------------------------- eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${LIBFLAGSUFFIX}\"" eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then eval "TCL_LIB_FLAG=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\"" eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${LIBSUFFIX}\"" else eval "TCL_LIB_FLAG=\"-ltcl${VER}${FLAGSUFFIX}\"" eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl${VER}${DLLSUFFIX}.a\"" fi eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX} CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX} #-------------------------------------------------------------------- # Adjust the defines for how the resources are built depending # on symbols and static vs. shared. #-------------------------------------------------------------------- if test ${SHARED_BUILD} = 0 ; then RC_DEFINES="${RC_DEFINE} STATIC_BUILD" else RC_DEFINES="" fi #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which # gives a list of directories that may contain packages. The list # consists of one directory for machine-dependent binaries and # another for platform-independent scripts. #-------------------------------------------------------------------- if test "$prefix/lib" != "$libdir"; then TCL_PACKAGE_PATH="${libdir};${prefix}\\lib" else TCL_PACKAGE_PATH="${prefix}\\lib" fi # The tclsh.exe.manifest requires these # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs # the release level, and must account for interim release versioning case "$TCL_PATCH_LEVEL" in *a*) TCL_RELEASE_LEVEL=0 ;; *b*) TCL_RELEASE_LEVEL=1 ;; *) TCL_RELEASE_LEVEL=2 ;; esac TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d ab.`" # X86|AMD64|ARM64|IA64 for manifest # empty on win # win/tcl.m4 doesn't set (CFLAGS) # win/tcl.m4 doesn't set (LDFLAGS) # win only ac_config_files="$ac_config_files Makefile tclConfig.sh tclsh.exe.manifest tcl.pc:../unix/tcl.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # '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" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[][ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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 Configuration files: $config_files Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ tcl config.status 9.0 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tclConfig.sh") CONFIG_FILES="$CONFIG_FILES tclConfig.sh" ;; "tclsh.exe.manifest") CONFIG_FILES="$CONFIG_FILES tclsh.exe.manifest" ;; "tcl.pc") CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tcl9.0.3/win/cat.c0000644000175000017500000000116015104661342013256 0ustar sergeisergei/* * cat.c -- * * Program used when testing tclWinPipe.c * * Copyright (c) 1996 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include #include #include #include int _tmain(void) { char buf[1024]; int n; const char *err; while (1) { n = _read(0, buf, sizeof(buf)); if (n <= 0) { break; } _write(1, buf, n); } err = (sizeof(int) == 2) ? "stderr16" : "stderr32"; _write(2, err, (unsigned int)strlen(err)); return 0; } tcl9.0.3/win/buildall.vc.bat0000755000175000017500000000554715104661341015251 0ustar sergeisergei@echo off :: This is an example batchfile for building everything. Please :: edit this (or make your own) for your needs and wants using :: the instructions for calling makefile.vc found in makefile.vc set SYMBOLS= :OPTIONS if "%1" == "/?" goto help if /i "%1" == "/help" goto help if %1.==symbols. goto SYMBOLS if %1.==debug. goto SYMBOLS goto OPTIONS_DONE :SYMBOLS set SYMBOLS=symbols shift goto OPTIONS :OPTIONS_DONE :: reset errorlevel cd > nul :: You might have installed your developer studio to add itself to the :: path or have already run vcvars32.bat. Testing these envars proves :: cl.exe and friends are in your path. :: if defined VCINSTALLDIR (goto :startBuilding) if defined MSDEVDIR (goto :startBuilding) if defined MSVCDIR (goto :startBuilding) if defined MSSDK (goto :startBuilding) if defined WINDOWSSDKDIR (goto :startBuilding) :: We need to run the development environment batch script that comes :: with developer studio (v4,5,6,7,etc...) All have it. This path :: might not be correct. You should call it yourself prior to running :: this batchfile. :: REM call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" set "VSCMD_START_DIR=%CD%" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" if errorlevel 1 (goto no_vcvars) :startBuilding echo. echo Sit back and have a cup of coffee while this grinds through ;) echo You asked for *everything*, remember? echo. title Building Tcl, please wait... :: makefile.vc uses this for its default anyways, but show its use here :: just to be explicit and convey understanding to the user. Setting :: the INSTALLDIR envar prior to running this batchfile affects all builds. :: if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl :: Build the normal stuff along with the help file. :: set OPTS=none if not %SYMBOLS%.==. set OPTS=symbols nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1 if errorlevel 1 goto error :: Build the static core and shell. :: set OPTS=static if not %SYMBOLS%.==. set OPTS=symbols,static nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 if errorlevel 1 goto error set OPTS= set SYMBOLS= goto end :error echo *** BOOM! *** goto end :no_vcvars echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. goto out :help title buildall.vc.bat help message echo usage: echo %0 : builds Tcl for all build types (do this first) echo %0 install : installs all the release builds (do this second) echo %0 symbols : builds Tcl for all debugging build types echo %0 symbols install : install all the debug builds. echo. goto out :end title Building Tcl, please wait... DONE! echo DONE! goto out :out pause title Command Prompt tcl9.0.3/win/aclocal.m40000644000175000017500000000003015035744306014203 0ustar sergeisergeibuiltin(include,tcl.m4) tcl9.0.3/unix/0000755000175000017500000000000015104662752012541 5ustar sergeisergeitcl9.0.3/unix/tclXtTest.c0000644000175000017500000000620515104661341014637 0ustar sergeisergei/* * tclXtTest.c -- * * Contains commands for Xt notifier specific tests on Unix. * * Copyright © 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. */ #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include #include "tcl.h" static Tcl_ObjCmdProc TesteventloopCmd; /* * Functions defined in tclXtNotify.c for use by users of the Xt Notifier: */ extern void InitNotifier(void); extern XtAppContext TclSetAppContext(XtAppContext ctx); /* *---------------------------------------------------------------------- * * Tclxttest_Init -- * * This procedure performs application-specific initialization. Most * applications, especially those that incorporate additional packages, * will have their own version of this procedure. * * Results: * Returns a standard Tcl completion code, and leaves an error message in * the interp's result if an error occurs. * * Side effects: * Depends on the startup script. * *---------------------------------------------------------------------- */ DLLEXPORT int Tclxttest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } XtToolkitInitialize(); InitNotifier(); Tcl_CreateObjCommand(interp, "testeventloop", TesteventloopCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * TesteventloopCmd -- * * This procedure implements the "testeventloop" command. It is used to * test the Tcl notifier from an "external" event loop (i.e. not * Tcl_DoOneEvent()). * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TesteventloopCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { static int *framePtr = NULL;/* Pointer to integer on stack frame of * innermost invocation of the "wait" * subcommand. */ if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[1]), "done") == 0) { *framePtr = 1; } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) { int *oldFramePtr; int done; int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); /* * Save the old stack frame pointer and set up the current frame. */ oldFramePtr = framePtr; framePtr = &done; /* * Enter an Xt event loop until the flag changes. Note that we do not * explicitly call Tcl_ServiceEvent(). */ done = 0; while (!done) { XtAppProcessEvent(TclSetAppContext(NULL), XtIMAll); } (void) Tcl_SetServiceMode(oldMode); framePtr = oldFramePtr; } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), "\": must be done or wait", (char *)NULL); return TCL_ERROR; } return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ tcl9.0.3/unix/tclXtNotify.c0000644000175000017500000003753615104661341015203 0ustar sergeisergei/* * tclXtNotify.c -- * * This file contains the notifier driver implementation for the Xt * intrinsics. * * Copyright © 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. */ #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include #include "tclInt.h" /* * This structure is used to keep track of the notifier info for a * registered file. */ typedef struct FileHandler { int fd; int mask; /* Mask of desired events: TCL_READABLE, * etc. */ int readyMask; /* Events that have been seen since the last * time FileHandlerEventProc was called for * this file. */ XtInputId read; /* Xt read callback handle. */ XtInputId write; /* Xt write callback handle. */ XtInputId except; /* Xt exception callback handle. */ Tcl_FileProc *proc; /* Procedure to call, in the style of * Tcl_CreateFileHandler. */ void *clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ } FileHandler; /* * The following structure is what is added to the Tcl event queue when file * handlers are ready to fire. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find * the FileHandler structure for the file * (can't point directly to the FileHandler * structure because it could go away while * the event is queued). */ } FileHandlerEvent; /* * The following static structure contains the state information for the Xt * based implementation of the Tcl notifier. */ static struct NotifierState { XtAppContext appContext; /* The context used by the Xt notifier. Can be * set with TclSetAppContext. */ int appContextCreated; /* Was it created by us? */ XtIntervalId currentTimeout;/* Handle of current timer. */ FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ } notifier; /* * The following static indicates whether this module has been initialized. */ static int initialized = 0; /* * Static routines defined in this file. */ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); static void FileProc(XtPointer clientData, int *source, XtInputId *id); static void NotifierExitHandler(void *clientData); static void TimerProc(XtPointer clientData, XtIntervalId *id); static void CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, void *clientData); static void DeleteFileHandler(int fd); static void SetTimer(const Tcl_Time * timePtr); static int WaitForEvent(const Tcl_Time * timePtr); /* * Functions defined in this file for use by users of the Xt Notifier: */ MODULE_SCOPE void InitNotifier(void); MODULE_SCOPE XtAppContext TclSetAppContext(XtAppContext ctx); /* *---------------------------------------------------------------------- * * TclSetAppContext -- * * Set the notifier application context. * * Results: * None. * * Side effects: * Sets the application context used by the notifier. Panics if the * context is already set when called. * *---------------------------------------------------------------------- */ XtAppContext TclSetAppContext( XtAppContext appContext) { if (!initialized) { InitNotifier(); } /* * If we already have a context we check whether we were asked to set a * new context. If so, we panic because we try to prevent switching * contexts by mistake. Otherwise, we return the one we have. */ if (notifier.appContext != NULL) { if (appContext != NULL) { /* * We already have a context. We do not allow switching contexts * after initialization, so we panic. */ Tcl_Panic("TclSetAppContext: multiple application contexts"); } } else { /* * If we get here we have not yet gotten a context, so either create * one or use the one supplied by our caller. */ if (appContext == NULL) { /* * We must create a new context and tell our caller what it is, so * she can use it too. */ notifier.appContext = XtCreateApplicationContext(); notifier.appContextCreated = 1; } else { /* * Otherwise we remember the context that our caller gave us and * use it. */ notifier.appContextCreated = 0; notifier.appContext = appContext; } } return notifier.appContext; } /* *---------------------------------------------------------------------- * * InitNotifier -- * * Initializes the notifier state. * * Results: * None. * * Side effects: * Creates a new exit handler. * *---------------------------------------------------------------------- */ void InitNotifier(void) { static const Tcl_NotifierProcs np = SetTimer, WaitForEvent, CreateFileHandler, DeleteFileHandler, NULL, NULL, NULL, NULL }; /* * Only reinitialize if we are not in exit handling. The notifier can get * reinitialized after its own exit handler has run, because of exit * handlers for the I/O and timer sub-systems (order dependency). */ if (TclInExit()) { return; } Tcl_SetNotifier(&np); /* * DO NOT create the application context yet; doing so would prevent * external applications from setting it for us to their own ones. */ initialized = 1; Tcl_CreateExitHandler(NotifierExitHandler, NULL); } /* *---------------------------------------------------------------------- * * NotifierExitHandler -- * * This function is called to cleanup the notifier state before Tcl is * unloaded. * * Results: * None. * * Side effects: * Destroys the notifier window. * *---------------------------------------------------------------------- */ static void NotifierExitHandler( TCL_UNUSED(void *)) { if (notifier.currentTimeout != 0) { XtRemoveTimeOut(notifier.currentTimeout); } for (; notifier.firstFileHandlerPtr != NULL; ) { Tcl_DeleteFileHandler(notifier.firstFileHandlerPtr->fd); } if (notifier.appContextCreated) { XtDestroyApplicationContext(notifier.appContext); notifier.appContextCreated = 0; notifier.appContext = NULL; } initialized = 0; } /* *---------------------------------------------------------------------- * * SetTimer -- * * This procedure sets the current notifier timeout value. * * Results: * None. * * Side effects: * Replaces any previous timer. * *---------------------------------------------------------------------- */ static void SetTimer( const Tcl_Time *timePtr) /* Timeout value, may be NULL. */ { unsigned long timeout; if (!initialized) { InitNotifier(); } TclSetAppContext(NULL); if (notifier.currentTimeout != 0) { XtRemoveTimeOut(notifier.currentTimeout); } if (timePtr) { timeout = timePtr->sec * 1000 + timePtr->usec / 1000; notifier.currentTimeout = XtAppAddTimeOut(notifier.appContext, timeout, TimerProc, NULL); } else { notifier.currentTimeout = 0; } } /* *---------------------------------------------------------------------- * * TimerProc -- * * This procedure is the XtTimerCallbackProc used to handle timeouts. * * Results: * None. * * Side effects: * Processes all queued events. * *---------------------------------------------------------------------- */ static void TimerProc( TCL_UNUSED(XtPointer), XtIntervalId *id) { if (*id != notifier.currentTimeout) { return; } notifier.currentTimeout = 0; Tcl_ServiceAll(); } /* *---------------------------------------------------------------------- * * CreateFileHandler -- * * This procedure registers a file handler with the Xt notifier. * * Results: * None. * * Side effects: * Creates a new file handler structure and registers one or more input * procedures with Xt. * *---------------------------------------------------------------------- */ static void CreateFileHandler( int fd, /* Handle of stream to watch. */ int mask, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION: indicates * conditions under which proc should be * called. */ Tcl_FileProc *proc, /* Procedure to call for each selected * event. */ void *clientData) /* Arbitrary data to pass to proc. */ { FileHandler *filePtr; if (!initialized) { InitNotifier(); } TclSetAppContext(NULL); for (filePtr = notifier.firstFileHandlerPtr; filePtr != NULL; filePtr = filePtr->nextPtr) { if (filePtr->fd == fd) { break; } } if (filePtr == NULL) { filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->read = 0; filePtr->write = 0; filePtr->except = 0; filePtr->readyMask = 0; filePtr->mask = 0; filePtr->nextPtr = notifier.firstFileHandlerPtr; notifier.firstFileHandlerPtr = filePtr; } filePtr->proc = proc; filePtr->clientData = clientData; /* * Register the file with the Xt notifier, if it hasn't been done yet. */ if (mask & TCL_READABLE) { if (!(filePtr->mask & TCL_READABLE)) { filePtr->read = XtAppAddInput(notifier.appContext, fd, INT2PTR(XtInputReadMask), FileProc, filePtr); } } else { if (filePtr->mask & TCL_READABLE) { XtRemoveInput(filePtr->read); } } if (mask & TCL_WRITABLE) { if (!(filePtr->mask & TCL_WRITABLE)) { filePtr->write = XtAppAddInput(notifier.appContext, fd, INT2PTR(XtInputWriteMask), FileProc, filePtr); } } else { if (filePtr->mask & TCL_WRITABLE) { XtRemoveInput(filePtr->write); } } if (mask & TCL_EXCEPTION) { if (!(filePtr->mask & TCL_EXCEPTION)) { filePtr->except = XtAppAddInput(notifier.appContext, fd, INT2PTR(XtInputExceptMask), FileProc, filePtr); } } else { if (filePtr->mask & TCL_EXCEPTION) { XtRemoveInput(filePtr->except); } } filePtr->mask = mask; } /* *---------------------------------------------------------------------- * * DeleteFileHandler -- * * Cancel a previously-arranged callback arrangement for a file. * * Results: * None. * * Side effects: * If a callback was previously registered on file, remove it. * *---------------------------------------------------------------------- */ static void DeleteFileHandler( int fd) /* Stream id for which to remove callback * procedure. */ { FileHandler *filePtr, *prevPtr; if (!initialized) { InitNotifier(); } TclSetAppContext(NULL); /* * Find the entry for the given file (and return if there isn't one). */ for (prevPtr = NULL, filePtr = notifier.firstFileHandlerPtr; ; prevPtr = filePtr, filePtr = filePtr->nextPtr) { if (filePtr == NULL) { return; } if (filePtr->fd == fd) { break; } } /* * Clean up information in the callback record. */ if (prevPtr == NULL) { notifier.firstFileHandlerPtr = filePtr->nextPtr; } else { prevPtr->nextPtr = filePtr->nextPtr; } if (filePtr->mask & TCL_READABLE) { XtRemoveInput(filePtr->read); } if (filePtr->mask & TCL_WRITABLE) { XtRemoveInput(filePtr->write); } if (filePtr->mask & TCL_EXCEPTION) { XtRemoveInput(filePtr->except); } Tcl_Free(filePtr); } /* *---------------------------------------------------------------------- * * FileProc -- * * These procedures are called by Xt when a file becomes readable, * writable, or has an exception. * * Results: * None. * * Side effects: * Makes an entry on the Tcl event queue if the event is interesting. * *---------------------------------------------------------------------- */ static void FileProc( XtPointer clientData, int *fd, XtInputId *id) { FileHandler *filePtr = (FileHandler *) clientData; FileHandlerEvent *fileEvPtr; int mask = 0; /* * Determine which event happened. */ if (*id == filePtr->read) { mask = TCL_READABLE; } else if (*id == filePtr->write) { mask = TCL_WRITABLE; } else if (*id == filePtr->except) { mask = TCL_EXCEPTION; } /* * Ignore unwanted or duplicate events. */ if (!(filePtr->mask & mask) || (filePtr->readyMask & mask)) { return; } /* * This is an interesting event, so put it onto the event queue. */ filePtr->readyMask |= mask; fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); /* * Process events on the Tcl event queue before returning to Xt. */ Tcl_ServiceAll(); } /* *---------------------------------------------------------------------- * * FileHandlerEventProc -- * * This procedure is called by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This procedure is responsible for * actually handling the event by invoking the callback for the file * handler. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the file handler's callback procedure does. * *---------------------------------------------------------------------- */ static int FileHandlerEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { FileHandler *filePtr; FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr; int mask; if (!(flags & TCL_FILE_EVENTS)) { return 0; } /* * Search through the file handlers to find the one whose handle matches * the event. We do this rather than keeping a pointer to the file handler * directly in the event, so that the handler can be deleted while the * event is queued without leaving a dangling pointer. */ for (filePtr = notifier.firstFileHandlerPtr; filePtr != NULL; filePtr = filePtr->nextPtr) { if (filePtr->fd != fileEvPtr->fd) { continue; } /* * The code is tricky for two reasons: * 1. The file handler's desired events could have changed since the * time when the event was queued, so AND the ready mask with the * desired mask. * 2. The file could have been closed and re-opened since the time * when the event was queued. This is why the ready mask is stored * in the file handler rather than the queued event: it will be * zeroed when a new file handler is created for the newly opened * file. */ mask = filePtr->readyMask & filePtr->mask; filePtr->readyMask = 0; if (mask != 0) { filePtr->proc(filePtr->clientData, mask); } break; } return 1; } /* *---------------------------------------------------------------------- * * WaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then Tcl_WaitForEvent just * polls without blocking. * * Results: * Returns 1 if an event was found, else 0. This ensures that * Tcl_DoOneEvent will return 1, even if the event is handled by non-Tcl * code. * * Side effects: * Queues file events that are detected by the select. * *---------------------------------------------------------------------- */ static int WaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { int timeout; if (!initialized) { InitNotifier(); } TclSetAppContext(NULL); if (timePtr) { timeout = timePtr->sec * 1000 + timePtr->usec / 1000; if (timeout == 0) { if (XtAppPending(notifier.appContext)) { goto process; } else { return 0; } } else { Tcl_SetTimer(timePtr); } } process: XtAppProcessEvent(notifier.appContext, XtIMAll); return 1; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixTime.c0000644000175000017500000002205115104661341015143 0ustar sergeisergei/* * tclUnixTime.c -- * * Contains Unix specific versions of Tcl functions that obtain time * values from the operating system. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #if defined(TCL_WIDE_CLICKS) && defined(MAC_OSX_TCL) #include #endif /* * Static functions declared in this file. */ static void NativeScaleTime(Tcl_Time *timebuf, void *clientData); static void NativeGetTime(Tcl_Time *timebuf, void *clientData); /* * TIP #233 (Virtualized Time): Data for the time hooks, if any. */ Tcl_GetTimeProc *tclGetTimeProcPtr = NativeGetTime; Tcl_ScaleTimeProc *tclScaleTimeProcPtr = NativeScaleTime; void *tclTimeClientData = NULL; /* * Inlined version of Tcl_GetTime. */ static inline void GetTime( Tcl_Time *timePtr) { tclGetTimeProcPtr(timePtr, tclTimeClientData); } #if defined(NO_GETTOD) || defined(TCL_WIDE_CLICKS) static inline int IsTimeNative(void) { return tclGetTimeProcPtr == NativeGetTime; } #endif /* *---------------------------------------------------------------------- * * TclpGetSeconds -- * * This procedure returns the number of seconds from the epoch. On most * Unix systems the epoch is Midnight Jan 1, 1970 GMT. * * Results: * Number of seconds from the epoch. * * Side effects: * None. * *---------------------------------------------------------------------- */ unsigned long long TclpGetSeconds(void) { return (unsigned long long) time(NULL); } /* *---------------------------------------------------------------------- * * TclpGetMicroseconds -- * * This procedure returns the number of microseconds from the epoch. * On most Unix systems the epoch is Midnight Jan 1, 1970 GMT. * * Results: * Number of microseconds from the epoch. * * Side effects: * None. * *---------------------------------------------------------------------- */ long long TclpGetMicroseconds(void) { Tcl_Time time; GetTime(&time); return time.sec * 1000000 + time.usec; } /* *---------------------------------------------------------------------- * * TclpGetClicks -- * * This procedure returns a value that represents the highest resolution * clock available on the system. There are no guarantees on what the * resolution will be. In Tcl we will call this value a "click". The * start time is also system dependent. * * Results: * Number of clicks from some start time. * * Side effects: * None. * *---------------------------------------------------------------------- */ unsigned long long TclpGetClicks(void) { unsigned long long now; #ifdef NO_GETTOD if (!IsTimeNative()) { Tcl_Time time; GetTime(&time); now = ((unsigned long long)(time.sec)*1000000ULL) + (unsigned long long)(time.usec); } else { /* * A semi-NativeGetTime, specialized to clicks. */ struct tms dummy; now = (unsigned long long) times(&dummy); } #else /* !NO_GETTOD */ Tcl_Time time; GetTime(&time); now = ((unsigned long long)(time.sec)*1000000ULL) + (unsigned long long)(time.usec); #endif /* NO_GETTOD */ return now; } #ifdef TCL_WIDE_CLICKS /* *---------------------------------------------------------------------- * * TclpGetWideClicks -- * * This procedure returns a WideInt value that represents the highest * resolution clock available on the system. There are no guarantees on * what the resolution will be. In Tcl we will call this value a "click". * The start time is also system dependent. * * Results: * Number of WideInt clicks from some start time. * * Side effects: * None. * *---------------------------------------------------------------------- */ long long TclpGetWideClicks(void) { long long now; if (!IsTimeNative()) { Tcl_Time time; GetTime(&time); now = ((long long) time.sec)*1000000 + time.usec; } else { #ifdef MAC_OSX_TCL now = (long long) (mach_absolute_time() & INT64_MAX); #else #error Wide high-resolution clicks not implemented on this platform #endif /* MAC_OSX_TCL */ } return now; } /* *---------------------------------------------------------------------- * * TclpWideClicksToNanoseconds -- * * This procedure converts click values from the TclpGetWideClicks native * resolution to nanosecond resolution. * * Results: * Number of nanoseconds from some start time. * * Side effects: * None. * *---------------------------------------------------------------------- */ double TclpWideClicksToNanoseconds( long long clicks) { double nsec; if (!IsTimeNative()) { nsec = clicks * 1000; } else { #ifdef MAC_OSX_TCL static mach_timebase_info_data_t tb; static uint64_t maxClicksForUInt64; if (!tb.denom) { mach_timebase_info(&tb); maxClicksForUInt64 = UINT64_MAX / tb.numer; } if ((uint64_t) clicks < maxClicksForUInt64) { nsec = ((uint64_t) clicks) * tb.numer / tb.denom; } else { nsec = ((long double) (uint64_t) clicks) * tb.numer / tb.denom; } #else #error Wide high-resolution clicks not implemented on this platform #endif /* MAC_OSX_TCL */ } return nsec; } /* *---------------------------------------------------------------------- * * TclpWideClickInMicrosec -- * * This procedure return scale to convert click values from the * TclpGetWideClicks native resolution to microsecond resolution * and back. * * Results: * 1 click in microseconds as double. * * Side effects: * None. * *---------------------------------------------------------------------- */ double TclpWideClickInMicrosec(void) { if (!IsTimeNative()) { return 1.0; } else { #ifdef MAC_OSX_TCL static int initialized = 0; static double scale = 0.0; if (!initialized) { mach_timebase_info_data_t tb; mach_timebase_info(&tb); /* value of tb.numer / tb.denom = 1 click in nanoseconds */ scale = ((double) tb.numer) / tb.denom / 1000; initialized = 1; } return scale; #else #error Wide high-resolution clicks not implemented on this platform #endif /* MAC_OSX_TCL */ } } #endif /* TCL_WIDE_CLICKS */ /* *---------------------------------------------------------------------- * * Tcl_GetTime -- * * Gets the current system time in seconds and microseconds since the * beginning of the epoch: 00:00 UCT, January 1, 1970. * * This function is hooked, allowing users to specify their own virtual * system time. * * Results: * Returns the current time in timePtr. * * Side effects: * None. * *---------------------------------------------------------------------- */ void Tcl_GetTime( Tcl_Time *timePtr) /* Location to store time information. */ { GetTime(timePtr); } /* *---------------------------------------------------------------------- * * Tcl_SetTimeProc -- * * TIP #233 (Virtualized Time): Registers two handlers for the * virtualization of Tcl's access to time information. * * Results: * None. * * Side effects: * Remembers the handlers, alters core behaviour. * *---------------------------------------------------------------------- */ void Tcl_SetTimeProc( Tcl_GetTimeProc *getProc, Tcl_ScaleTimeProc *scaleProc, void *clientData) { tclGetTimeProcPtr = getProc; tclScaleTimeProcPtr = scaleProc; tclTimeClientData = clientData; } /* *---------------------------------------------------------------------- * * Tcl_QueryTimeProc -- * * TIP #233 (Virtualized Time): Query which time handlers are registered. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void Tcl_QueryTimeProc( Tcl_GetTimeProc **getProc, Tcl_ScaleTimeProc **scaleProc, void **clientData) { if (getProc) { *getProc = tclGetTimeProcPtr; } if (scaleProc) { *scaleProc = tclScaleTimeProcPtr; } if (clientData) { *clientData = tclTimeClientData; } } /* *---------------------------------------------------------------------- * * NativeScaleTime -- * * TIP #233: Scale from virtual time to the real-time. For native scaling * the relationship is 1:1 and nothing has to be done. * * Results: * Scales the time in timePtr. * * Side effects: * See above. * *---------------------------------------------------------------------- */ static void NativeScaleTime( TCL_UNUSED(Tcl_Time *), TCL_UNUSED(void *)) { /* Native scale is 1:1. Nothing is done */ } /* *---------------------------------------------------------------------- * * NativeGetTime -- * * TIP #233: Gets the current system time in seconds and microseconds * since the beginning of the epoch: 00:00 UCT, January 1, 1970. * * Results: * Returns the current time in timePtr. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void NativeGetTime( Tcl_Time *timePtr, TCL_UNUSED(void *)) { struct timeval tv; (void) gettimeofday(&tv, NULL); timePtr->sec = tv.tv_sec; timePtr->usec = tv.tv_usec; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixThrd.c0000644000175000017500000005062315104661341015154 0ustar sergeisergei/* * tclUnixThrd.c -- * * This file implements the UNIX-specific thread support. * * Copyright © 1991-1994 The Regents of the University of California. * Copyright © 1994-1997 Sun Microsystems, Inc. * Copyright © 2008 George Peter Staplin * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #if TCL_THREADS /* * TIP #509. Ensures that Tcl's mutexes are reentrant. * *---------------------------------------------------------------------- * * PMutexInit -- * * Sets up the memory pointed to by its argument so that it contains the * implementation of a recursive lock. Caller supplies the space. * *---------------------------------------------------------------------- * * PMutexDestroy -- * * Tears down the implementation of a recursive lock (but does not * deallocate the space holding the lock). * *---------------------------------------------------------------------- * * PMutexLock -- * * Locks a recursive lock. (Similar to pthread_mutex_lock) * *---------------------------------------------------------------------- * * PMutexUnlock -- * * Unlocks a recursive lock. (Similar to pthread_mutex_unlock) * *---------------------------------------------------------------------- * * PCondWait -- * * Waits on a condition variable linked a recursive lock. (Similar to * pthread_cond_wait) * *---------------------------------------------------------------------- * * PCondTimedWait -- * * Waits for a limited amount of time on a condition variable linked to a * recursive lock. (Similar to pthread_cond_timedwait) * *---------------------------------------------------------------------- */ /* * No correct native support for reentrant mutexes. Emulate them with a counter. */ #ifndef PTHREAD_NULL # define PTHREAD_NULL (pthread_t)0 #endif typedef struct PMutex { pthread_mutex_t mutex; volatile pthread_t thread; int counter; // Number of additional locks in the same thread. } PMutex; static void PMutexInit( PMutex *pmutexPtr) { pmutexPtr->thread = PTHREAD_NULL; pmutexPtr->counter = 0; pthread_mutex_init(&pmutexPtr->mutex, NULL); } static void PMutexDestroy( PMutex *pmutexPtr) { pthread_mutex_destroy(&pmutexPtr->mutex); assert(pthread_equal(pmutexPtr->thread, PTHREAD_NULL) && !pmutexPtr->counter); } static void PMutexLock( PMutex *pmutexPtr) { pthread_t mythread = pthread_self(); if (pthread_equal(pmutexPtr->thread, mythread)) { // We own the lock already, so it's recursive. pmutexPtr->counter++; } else { // We don't owns the lock, so we have to lock it. Then we own it. pthread_mutex_lock(&pmutexPtr->mutex); pmutexPtr->thread = mythread; } } static void PMutexUnlock( PMutex *pmutexPtr) { assert(pthread_equal(pmutexPtr->thread, pthread_self())); if (pmutexPtr->counter) { // It's recursive pmutexPtr->counter--; } else { pmutexPtr->thread = PTHREAD_NULL; pthread_mutex_unlock(&pmutexPtr->mutex); } } static void PCondWait( pthread_cond_t *pcondPtr, PMutex *pmutexPtr) { pthread_t mythread = pthread_self(); assert(pthread_equal(pmutexPtr->thread, mythread)); int counter = pmutexPtr->counter; pmutexPtr->counter = 0; pmutexPtr->thread = PTHREAD_NULL; pthread_cond_wait(pcondPtr, &pmutexPtr->mutex); pmutexPtr->thread = mythread; pmutexPtr->counter = counter; } static void PCondTimedWait( pthread_cond_t *pcondPtr, PMutex *pmutexPtr, struct timespec *ptime) { pthread_t mythread = pthread_self(); assert(pthread_equal(pmutexPtr->thread, mythread)); int counter = pmutexPtr->counter; pmutexPtr->counter = 0; pmutexPtr->thread = PTHREAD_NULL; pthread_cond_timedwait(pcondPtr, &pmutexPtr->mutex, ptime); pmutexPtr->thread = mythread; pmutexPtr->counter = counter; } /* * globalLock is used to serialize creation of mutexes, condition variables, * and thread local storage. This is the only place that can count on the * ability to statically initialize the mutex. */ static pthread_mutex_t globalLock = PTHREAD_MUTEX_INITIALIZER; /* * initLock is used to serialize initialization and finalization of Tcl. It * cannot use any dynamically allocated storage. */ static pthread_mutex_t initLock = PTHREAD_MUTEX_INITIALIZER; /* * allocLock is used by Tcl's version of malloc for synchronization. For * obvious reasons, cannot use any dynamically allocated storage. */ static PMutex allocLock; static pthread_once_t allocLockInitOnce = PTHREAD_ONCE_INIT; static void allocLockInit(void) { PMutexInit(&allocLock); } static PMutex *allocLockPtr = &allocLock; #endif /* TCL_THREADS */ /* *---------------------------------------------------------------------- * * TclpThreadCreate -- * * This procedure creates a new thread. * * Results: * TCL_OK if the thread could be created. The thread ID is returned in a * parameter. * * Side effects: * A new thread is created. * *---------------------------------------------------------------------- */ int TclpThreadCreate( Tcl_ThreadId *idPtr, /* Return, the ID of the thread */ Tcl_ThreadCreateProc *proc, /* Main() function of the thread */ void *clientData, /* The one argument to Main() */ size_t stackSize, /* Size of stack for the new thread */ int flags) /* Flags controlling behaviour of the new * thread. */ { #if TCL_THREADS pthread_attr_t attr; pthread_t theThread; int result; pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE if (stackSize != TCL_THREAD_STACK_DEFAULT) { pthread_attr_setstacksize(&attr, stackSize); #ifdef TCL_THREAD_STACK_MIN } else { /* * Certain systems define a thread stack size that by default is too * small for many operations. The user has the option of defining * TCL_THREAD_STACK_MIN to a value large enough to work for their * needs. This would look like (for 128K min stack): * make MEM_DEBUG_FLAGS=-DTCL_THREAD_STACK_MIN=131072L * * This solution is not optimal, as we should allow the user to * specify a size at runtime, but we don't want to slow this function * down, and that would still leave the main thread at the default. */ size_t size; result = pthread_attr_getstacksize(&attr, &size); if (!result && (size < TCL_THREAD_STACK_MIN)) { pthread_attr_setstacksize(&attr, (size_t)TCL_THREAD_STACK_MIN); } #endif /* TCL_THREAD_STACK_MIN */ } #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */ if (!(flags & TCL_THREAD_JOINABLE)) { pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); } if (pthread_create(&theThread, &attr, (void * (*)(void *))(void *)proc, (void *)clientData) && pthread_create(&theThread, NULL, (void * (*)(void *))(void *)proc, (void *)clientData)) { result = TCL_ERROR; } else { *idPtr = (Tcl_ThreadId)theThread; result = TCL_OK; } pthread_attr_destroy(&attr); return result; #else (void)idPtr; (void)proc; (void)clientData; (void)stackSize; (void)flags; return TCL_ERROR; #endif /* TCL_THREADS */ } /* *---------------------------------------------------------------------- * * Tcl_JoinThread -- * * This procedure waits upon the exit of the specified thread. * * Results: * TCL_OK if the wait was successful, TCL_ERROR else. * * Side effects: * The result area is set to the exit code of the thread we waited upon. * *---------------------------------------------------------------------- */ int Tcl_JoinThread( Tcl_ThreadId threadId, /* Id of the thread to wait upon. */ int *state) /* Reference to the storage the result of the * thread we wait upon will be written into. * May be NULL. */ { #if TCL_THREADS int result; unsigned long retcode, *retcodePtr = &retcode; result = pthread_join((pthread_t) threadId, (void**) retcodePtr); if (state) { *state = (int) retcode; } return (result == 0) ? TCL_OK : TCL_ERROR; #else (void)threadId; (void)state; return TCL_ERROR; #endif } /* *---------------------------------------------------------------------- * * TclpThreadExit -- * * This procedure terminates the current thread. * * Results: * None. * * Side effects: * This procedure terminates the current thread. * *---------------------------------------------------------------------- */ TCL_NORETURN void TclpThreadExit( int status) { #if TCL_THREADS pthread_exit(INT2PTR(status)); #else /* TCL_THREADS */ exit(status); #endif /* TCL_THREADS */ } /* *---------------------------------------------------------------------- * * Tcl_GetCurrentThread -- * * This procedure returns the ID of the currently running thread. * * Results: * A thread ID. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_ThreadId Tcl_GetCurrentThread(void) { #if TCL_THREADS return (Tcl_ThreadId) pthread_self(); #else return (Tcl_ThreadId) 0; #endif } /* *---------------------------------------------------------------------- * * TclpInitLock * * This procedure is used to grab a lock that serializes initialization * and finalization of Tcl. On some platforms this may also initialize * the mutex used to serialize creation of more mutexes and thread local * storage keys. * * Results: * None. * * Side effects: * Acquire the initialization mutex. * *---------------------------------------------------------------------- */ void TclpInitLock(void) { #if TCL_THREADS pthread_mutex_lock(&initLock); #endif } /* *---------------------------------------------------------------------- * * TclFinalizeLock * * This procedure is used to destroy all private resources used in this * file. * * Results: * None. * * Side effects: * Destroys everything private. TclpInitLock must be held entering this * function. * *---------------------------------------------------------------------- */ void TclFinalizeLock(void) { #if TCL_THREADS /* * You do not need to destroy mutexes that were created with the * PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need any * destruction: globalLock, allocLock, and initLock. */ pthread_mutex_unlock(&initLock); #endif } /* *---------------------------------------------------------------------- * * TclpInitUnlock * * This procedure is used to release a lock that serializes * initialization and finalization of Tcl. * * Results: * None. * * Side effects: * Release the initialization mutex. * *---------------------------------------------------------------------- */ void TclpInitUnlock(void) { #if TCL_THREADS pthread_mutex_unlock(&initLock); #endif } /* *---------------------------------------------------------------------- * * TclpGlobalLock * * This procedure is used to grab a lock that serializes creation and * finalization of serialization objects. This interface is only needed * in finalization; it is hidden during creation of the objects. * * This lock must be different than the initLock because the initLock is * held during creation of synchronization objects. * * Results: * None. * * Side effects: * Acquire the global mutex. * *---------------------------------------------------------------------- */ void TclpGlobalLock(void) { #if TCL_THREADS pthread_mutex_lock(&globalLock); #endif } /* *---------------------------------------------------------------------- * * TclpGlobalUnlock * * This procedure is used to release a lock that serializes creation and * finalization of synchronization objects. * * Results: * None. * * Side effects: * Release the global mutex. * *---------------------------------------------------------------------- */ void TclpGlobalUnlock(void) { #if TCL_THREADS pthread_mutex_unlock(&globalLock); #endif } /* *---------------------------------------------------------------------- * * Tcl_GetAllocMutex * * This procedure returns a pointer to a statically initialized mutex for * use by the memory allocator. The allocator must use this lock, because * all other locks are allocated... * * Results: * A pointer to a mutex that is suitable for passing to Tcl_MutexLock and * Tcl_MutexUnlock. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Mutex * Tcl_GetAllocMutex(void) { #if TCL_THREADS pthread_once(&allocLockInitOnce, allocLockInit); return (Tcl_Mutex *) &allocLockPtr; #else return NULL; #endif } #if TCL_THREADS /* *---------------------------------------------------------------------- * * Tcl_MutexLock -- * * This procedure is invoked to lock a mutex. This procedure handles * initializing the mutex, if necessary. The caller can rely on the fact * that Tcl_Mutex is an opaque pointer. This routine will change that * pointer from NULL after first use. * * Results: * None. * * Side effects: * May block the current thread. The mutex is acquired when this returns. * Will allocate memory for a pthread_mutex_t and initialize this the * first time this Tcl_Mutex is used. * *---------------------------------------------------------------------- */ void Tcl_MutexLock( Tcl_Mutex *mutexPtr) /* Really (PMutex **) */ { PMutex *pmutexPtr; if (*mutexPtr == NULL) { pthread_mutex_lock(&globalLock); if (*mutexPtr == NULL) { /* * Double inside global lock check to avoid a race condition. */ pmutexPtr = (PMutex *)Tcl_Alloc(sizeof(PMutex)); PMutexInit(pmutexPtr); *mutexPtr = (Tcl_Mutex) pmutexPtr; TclRememberMutex(mutexPtr); } pthread_mutex_unlock(&globalLock); } pmutexPtr = *((PMutex **) mutexPtr); PMutexLock(pmutexPtr); } /* *---------------------------------------------------------------------- * * Tcl_MutexUnlock -- * * This procedure is invoked to unlock a mutex. The mutex must have been * locked by Tcl_MutexLock. * * Results: * None. * * Side effects: * The mutex is released when this returns. * *---------------------------------------------------------------------- */ void Tcl_MutexUnlock( Tcl_Mutex *mutexPtr) /* Really (PMutex **) */ { PMutex *pmutexPtr = *(PMutex **) mutexPtr; PMutexUnlock(pmutexPtr); } /* *---------------------------------------------------------------------- * * TclpFinalizeMutex -- * * This procedure is invoked to clean up one mutex. This is only safe to * call at the end of time. * * This assumes the Global Lock is held. * * Results: * None. * * Side effects: * The mutex list is deallocated. * *---------------------------------------------------------------------- */ void TclpFinalizeMutex( Tcl_Mutex *mutexPtr) { PMutex *pmutexPtr = *(PMutex **)mutexPtr; if (pmutexPtr != NULL) { PMutexDestroy(pmutexPtr); Tcl_Free(pmutexPtr); *mutexPtr = NULL; } } /* *---------------------------------------------------------------------- * * Tcl_ConditionWait -- * * This procedure is invoked to wait on a condition variable. The mutex * is automically released as part of the wait, and automatically grabbed * when the condition is signaled. * * The mutex must be held when this procedure is called. * * Results: * None. * * Side effects: * May block the current thread. The mutex is acquired when this returns. * Will allocate memory for a pthread_mutex_t and initialize this the * first time this Tcl_Mutex is used. * *---------------------------------------------------------------------- */ void Tcl_ConditionWait( Tcl_Condition *condPtr, /* Really (pthread_cond_t **) */ Tcl_Mutex *mutexPtr, /* Really (PMutex **) */ const Tcl_Time *timePtr) /* Timeout on waiting period */ { pthread_cond_t *pcondPtr; PMutex *pmutexPtr; struct timespec ptime; if (*condPtr == NULL) { pthread_mutex_lock(&globalLock); /* * Double check inside mutex to avoid race, then initialize condition * variable if necessary. */ if (*condPtr == NULL) { pcondPtr = (pthread_cond_t *)Tcl_Alloc(sizeof(pthread_cond_t)); pthread_cond_init(pcondPtr, NULL); *condPtr = (Tcl_Condition) pcondPtr; TclRememberCondition(condPtr); } pthread_mutex_unlock(&globalLock); } pmutexPtr = *((PMutex **)mutexPtr); pcondPtr = *((pthread_cond_t **)condPtr); if (timePtr == NULL) { PCondWait(pcondPtr, pmutexPtr); } else { Tcl_Time now; /* * Make sure to take into account the microsecond component of the * current time, including possible overflow situations. [Bug #411603] */ Tcl_GetTime(&now); ptime.tv_sec = timePtr->sec + now.sec + (timePtr->usec + now.usec) / 1000000; ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000); PCondTimedWait(pcondPtr, pmutexPtr, &ptime); } } /* *---------------------------------------------------------------------- * * Tcl_ConditionNotify -- * * This procedure is invoked to signal a condition variable. * * The mutex must be held during this call to avoid races, but this * interface does not enforce that. * * Results: * None. * * Side effects: * May unblock another thread. * *---------------------------------------------------------------------- */ void Tcl_ConditionNotify( Tcl_Condition *condPtr) { pthread_cond_t *pcondPtr = *((pthread_cond_t **)condPtr); if (pcondPtr != NULL) { pthread_cond_broadcast(pcondPtr); } else { /* * No-one has used the condition variable, so there are no waiters. */ } } /* *---------------------------------------------------------------------- * * TclpFinalizeCondition -- * * This procedure is invoked to clean up a condition variable. This is * only safe to call at the end of time. * * This assumes the Global Lock is held. * * Results: * None. * * Side effects: * The condition variable is deallocated. * *---------------------------------------------------------------------- */ void TclpFinalizeCondition( Tcl_Condition *condPtr) { pthread_cond_t *pcondPtr = *(pthread_cond_t **)condPtr; if (pcondPtr != NULL) { pthread_cond_destroy(pcondPtr); Tcl_Free(pcondPtr); *condPtr = NULL; } } /* * Additions by AOL for specialized thread memory allocator. */ #ifdef USE_THREAD_ALLOC static pthread_key_t key; typedef struct { Tcl_Mutex tlock; PMutex plock; } AllocMutex; Tcl_Mutex * TclpNewAllocMutex(void) { AllocMutex *lockPtr; PMutex *plockPtr; lockPtr = (AllocMutex *)malloc(sizeof(AllocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } plockPtr = &lockPtr->plock; lockPtr->tlock = (Tcl_Mutex) plockPtr; PMutexInit(&lockPtr->plock); return &lockPtr->tlock; } void TclpFreeAllocMutex( Tcl_Mutex *mutex) /* The alloc mutex to free. */ { AllocMutex *lockPtr = (AllocMutex *)mutex; if (!lockPtr) { return; } PMutexDestroy(&lockPtr->plock); free(lockPtr); } void TclpInitAllocCache(void) { pthread_key_create(&key, NULL); } void TclpFreeAllocCache( void *ptr) { if (ptr != NULL) { /* * Called by TclFinalizeThreadAllocThread() during the thread * finalization initiated from Tcl_FinalizeThread() */ TclFreeAllocCache(ptr); pthread_setspecific(key, NULL); } else { /* * Called by TclFinalizeThreadAlloc() during the process * finalization initiated from Tcl_Finalize() */ pthread_key_delete(key); } } void * TclpGetAllocCache(void) { return pthread_getspecific(key); } void TclpSetAllocCache( void *arg) { pthread_setspecific(key, arg); } #endif /* USE_THREAD_ALLOC */ void * TclpThreadCreateKey(void) { pthread_key_t *ptkeyPtr; ptkeyPtr = (pthread_key_t *)TclpSysAlloc(sizeof(pthread_key_t)); if (NULL == ptkeyPtr) { Tcl_Panic("unable to allocate thread key!"); } if (pthread_key_create(ptkeyPtr, NULL)) { Tcl_Panic("unable to create pthread key!"); } return ptkeyPtr; } void TclpThreadDeleteKey( void *keyPtr) { pthread_key_t *ptkeyPtr = (pthread_key_t *)keyPtr; if (pthread_key_delete(*ptkeyPtr)) { Tcl_Panic("unable to delete key!"); } TclpSysFree(keyPtr); } void TclpThreadSetGlobalTSD( void *tsdKeyPtr, void *ptr) { pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr; if (pthread_setspecific(*ptkeyPtr, ptr)) { Tcl_Panic("unable to set global TSD value"); } } void * TclpThreadGetGlobalTSD( void *tsdKeyPtr) { pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr; return pthread_getspecific(*ptkeyPtr); } #endif /* TCL_THREADS */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixTest.c0000644000175000017500000004222215104661341015166 0ustar sergeisergei/* * tclUnixTest.c -- * * Contains platform specific test commands for the Unix platform. * * Copyright © 1996-1997 Sun Microsystems, Inc. * Copyright © 1998 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef BUILD_tcl #undef STATIC_BUILD #ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #include "tclInt.h" /* * The headers are needed for the testalarm command that verifies the use of * SA_RESTART in signal handlers. */ #include #include /* * The following macros convert between TclFile's and fd's. The conversion * simple involves shifting fd's up by one to ensure that no valid fd is ever * the same as NULL. Note that this code is duplicated from tclUnixPipe.c */ #define MakeFile(fd) ((TclFile)INT2PTR(((int)(fd))+1)) #define GetFd(file) (PTR2INT(file)-1) /* * The stuff below is used to keep track of file handlers created and * exercised by the "testfilehandler" command. */ typedef struct { TclFile readFile; /* File handle for reading from the pipe. NULL * means pipe doesn't exist yet. */ TclFile writeFile; /* File handle for writing from the pipe. */ int readCount; /* Number of times the file handler for this * file has triggered and the file was * readable. */ int writeCount; /* Number of times the file handler for this * file has triggered and the file was * writable. */ } Pipe; #define MAX_PIPES 10 static Pipe testPipes[MAX_PIPES]; /* * The stuff below is used by the testalarm and testgotsig ommands. */ static const char *gotsig = "0"; /* * Forward declarations of functions defined later in this file: */ static Tcl_ObjCmdProc TestalarmCmd; static Tcl_ObjCmdProc TestchmodCmd; static Tcl_ObjCmdProc TestfilehandlerCmd; static Tcl_ObjCmdProc TestfilewaitCmd; static Tcl_ObjCmdProc TestfindexecutableCmd; static Tcl_ObjCmdProc TestforkCmd; static Tcl_ObjCmdProc TestgotsigCmd; static Tcl_FileProc TestFileHandlerProc; static void AlarmHandler(int signum); /* *---------------------------------------------------------------------- * * TclplatformtestInit -- * * Defines commands that test platform specific functionality for Unix * platforms. * * Results: * A standard Tcl result. * * Side effects: * Defines new commands. * *---------------------------------------------------------------------- */ int TclplatformtestInit( Tcl_Interp *interp) /* Interpreter to add commands to. */ { Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testfilehandler", TestfilehandlerCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testfilewait", TestfilewaitCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testfindexecutable", TestfindexecutableCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testfork", TestforkCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testalarm", TestalarmCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "testgotsig", TestgotsigCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * TestfilehandlerCmd -- * * This function implements the "testfilehandler" command. It is used to * test Tcl_CreateFileHandler, Tcl_DeleteFileHandler, and TclWaitForFile. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestfilehandlerCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Pipe *pipePtr; int i, mask, timeout; static int initialized = 0; char buffer[4000]; TclFile file; /* * NOTE: When we make this code work on Windows also, the following * variable needs to be made Unix-only. */ if (!initialized) { for (i = 0; i < MAX_PIPES; i++) { testPipes[i].readFile = NULL; } initialized = 1; } if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ..."); return TCL_ERROR; } pipePtr = NULL; if (objc >= 3) { if (Tcl_GetIntFromObj(interp, objv[2], &i) != TCL_OK) { return TCL_ERROR; } if (i >= MAX_PIPES) { Tcl_AppendResult(interp, "bad index ", objv[2], (char *)NULL); return TCL_ERROR; } pipePtr = &testPipes[i]; } if (strcmp(Tcl_GetString(objv[1]), "close") == 0) { for (i = 0; i < MAX_PIPES; i++) { if (testPipes[i].readFile != NULL) { TclpCloseFile(testPipes[i].readFile); testPipes[i].readFile = NULL; TclpCloseFile(testPipes[i].writeFile); testPipes[i].writeFile = NULL; } } } else if (strcmp(Tcl_GetString(objv[1]), "clear") == 0) { if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); return TCL_ERROR; } pipePtr->readCount = pipePtr->writeCount = 0; } else if (strcmp(Tcl_GetString(objv[1]), "counts") == 0) { char buf[TCL_INTEGER_SPACE * 2]; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); return TCL_ERROR; } snprintf(buf, sizeof(buf), "%d %d", pipePtr->readCount, pipePtr->writeCount); Tcl_AppendResult(interp, buf, (char *)NULL); } else if (strcmp(Tcl_GetString(objv[1]), "create") == 0) { if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "index readMode writeMode"); return TCL_ERROR; } if (pipePtr->readFile == NULL) { if (!TclpCreatePipe(&pipePtr->readFile, &pipePtr->writeFile)) { Tcl_AppendResult(interp, "couldn't open pipe: ", Tcl_PosixError(interp), (char *)NULL); return TCL_ERROR; } #ifdef O_NONBLOCK fcntl(GetFd(pipePtr->readFile), F_SETFL, O_NONBLOCK); fcntl(GetFd(pipePtr->writeFile), F_SETFL, O_NONBLOCK); #else Tcl_AppendResult(interp, "cannot make pipes non-blocking", (char *)NULL); return TCL_ERROR; #endif } pipePtr->readCount = 0; pipePtr->writeCount = 0; if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) { Tcl_CreateFileHandler(GetFd(pipePtr->readFile), TCL_READABLE, TestFileHandlerProc, pipePtr); } else if (strcmp(Tcl_GetString(objv[3]), "off") == 0) { Tcl_DeleteFileHandler(GetFd(pipePtr->readFile)); } else if (strcmp(Tcl_GetString(objv[3]), "disabled") == 0) { Tcl_CreateFileHandler(GetFd(pipePtr->readFile), 0, TestFileHandlerProc, pipePtr); } else { Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[3]), "\"", (char *)NULL); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[4]), "writable") == 0) { Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), TCL_WRITABLE, TestFileHandlerProc, pipePtr); } else if (strcmp(Tcl_GetString(objv[4]), "off") == 0) { Tcl_DeleteFileHandler(GetFd(pipePtr->writeFile)); } else if (strcmp(Tcl_GetString(objv[4]), "disabled") == 0) { Tcl_CreateFileHandler(GetFd(pipePtr->writeFile), 0, TestFileHandlerProc, pipePtr); } else { Tcl_AppendResult(interp, "bad read mode \"", Tcl_GetString(objv[4]), "\"", (char *)NULL); return TCL_ERROR; } } else if (strcmp(Tcl_GetString(objv[1]), "empty") == 0) { if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); return TCL_ERROR; } while (read(GetFd(pipePtr->readFile), buffer, 4000) > 0) { /* Empty loop body. */ } } else if (strcmp(Tcl_GetString(objv[1]), "fill") == 0) { if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); return TCL_ERROR; } memset(buffer, 'a', 4000); while (write(GetFd(pipePtr->writeFile), buffer, 4000) > 0) { /* Empty loop body. */ } } else if (strcmp(Tcl_GetString(objv[1]), "fillpartial") == 0) { char buf[TCL_INTEGER_SPACE]; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); return TCL_ERROR; } memset(buffer, 'b', 10); TclFormatInt(buf, write(GetFd(pipePtr->writeFile), buffer, 10)); Tcl_AppendResult(interp, buf, (char *)NULL); } else if (strcmp(Tcl_GetString(objv[1]), "oneevent") == 0) { Tcl_DoOneEvent(TCL_FILE_EVENTS|TCL_DONT_WAIT); } else if (strcmp(Tcl_GetString(objv[1]), "wait") == 0) { if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "index readable|writable timeout"); return TCL_ERROR; } if (pipePtr->readFile == NULL) { Tcl_AppendResult(interp, "pipe ", Tcl_GetString(objv[2]), " doesn't exist", (char *)NULL); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[3]), "readable") == 0) { mask = TCL_READABLE; file = pipePtr->readFile; } else { mask = TCL_WRITABLE; file = pipePtr->writeFile; } if (Tcl_GetIntFromObj(interp, objv[4], &timeout) != TCL_OK) { return TCL_ERROR; } i = TclUnixWaitForFile(GetFd(file), mask, timeout); if (i & TCL_READABLE) { Tcl_AppendElement(interp, "readable"); } if (i & TCL_WRITABLE) { Tcl_AppendElement(interp, "writable"); } } else if (strcmp(Tcl_GetString(objv[1]), "windowevent") == 0) { Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT); } else { Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), "\": must be close, clear, counts, create, empty, fill, " "fillpartial, oneevent, wait, or windowevent", (char *)NULL); return TCL_ERROR; } return TCL_OK; } static void TestFileHandlerProc( void *clientData, /* Points to a Pipe structure. */ int mask) /* Indicates which events happened: * TCL_READABLE or TCL_WRITABLE. */ { Pipe *pipePtr = (Pipe *)clientData; if (mask & TCL_READABLE) { pipePtr->readCount++; } if (mask & TCL_WRITABLE) { pipePtr->writeCount++; } } /* *---------------------------------------------------------------------- * * TestfilewaitCmd -- * * This function implements the "testfilewait" command. It is used to * test TclUnixWaitForFile. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestfilewaitCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { int mask, result, timeout; Tcl_Channel channel; int fd; void *data; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "file readable|writable|both timeout"); return TCL_ERROR; } channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); if (channel == NULL) { return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[2]), "readable") == 0) { mask = TCL_READABLE; } else if (strcmp(Tcl_GetString(objv[2]), "writable") == 0){ mask = TCL_WRITABLE; } else if (strcmp(Tcl_GetString(objv[2]), "both") == 0){ mask = TCL_WRITABLE|TCL_READABLE; } else { Tcl_AppendResult(interp, "bad argument \"", Tcl_GetString(objv[2]), "\": must be readable, writable, or both", (char *)NULL); return TCL_ERROR; } if (Tcl_GetChannelHandle(channel, (mask & TCL_READABLE) ? TCL_READABLE : TCL_WRITABLE, (void **) &data) != TCL_OK) { Tcl_AppendResult(interp, "couldn't get channel file", (char *)NULL); return TCL_ERROR; } fd = PTR2INT(data); if (Tcl_GetIntFromObj(interp, objv[3], &timeout) != TCL_OK) { return TCL_ERROR; } result = TclUnixWaitForFile(fd, mask, timeout); if (result & TCL_READABLE) { Tcl_AppendElement(interp, "readable"); } if (result & TCL_WRITABLE) { Tcl_AppendElement(interp, "writable"); } return TCL_OK; } /* *---------------------------------------------------------------------- * * TestfindexecutableCmd -- * * This function implements the "testfindexecutable" command. It is used * to test TclpFindExecutable. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestfindexecutableCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Obj *saveName; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "argv0"); return TCL_ERROR; } saveName = TclGetObjNameOfExecutable(); Tcl_IncrRefCount(saveName); TclpFindExecutable(Tcl_GetString(objv[1])); Tcl_SetObjResult(interp, TclGetObjNameOfExecutable()); TclSetObjNameOfExecutable(saveName, NULL); Tcl_DecrRefCount(saveName); return TCL_OK; } /* *---------------------------------------------------------------------- * * TestforkCmd -- * * This function implements the "testfork" command. It is used to * fork the Tcl process for specific test cases. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TestforkCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { pid_t pid; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } pid = fork(); if (pid == -1) { Tcl_AppendResult(interp, "Cannot fork", (char *)NULL); return TCL_ERROR; } /* Only needed when pthread_atfork is not present, * should not hurt otherwise. */ if (pid==0) { Tcl_InitNotifier(); } Tcl_SetObjResult(interp, Tcl_NewWideIntObj(pid)); return TCL_OK; } /* *---------------------------------------------------------------------- * * TestalarmCmd -- * * Test that EINTR is handled correctly by generating and handling a * signal. This requires using the SA_RESTART flag when registering the * signal handler. * * Results: * None. * * Side Effects: * Sets up an signal and async handlers. * *---------------------------------------------------------------------- */ static int TestalarmCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { #ifdef SA_RESTART unsigned int sec = 1; struct sigaction action; if (objc > 1) { Tcl_GetIntFromObj(interp, objv[1], (int *)&sec); } /* * Setup the signal handling that automatically retries any interrupted * I/O system calls. */ action.sa_handler = AlarmHandler; memset((void *)&action.sa_mask, 0, sizeof(sigset_t)); action.sa_flags = SA_RESTART; if (sigaction(SIGALRM, &action, NULL) < 0) { Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), (char *)NULL); return TCL_ERROR; } (void) alarm(sec); return TCL_OK; #else Tcl_AppendResult(interp, "warning: sigaction SA_RESTART not support on this platform", (char *)NULL); return TCL_ERROR; #endif } /* *---------------------------------------------------------------------- * * AlarmHandler -- * * Signal handler for the alarm command. * * Results: * None. * * Side effects: * Calls the Tcl Async handler. * *---------------------------------------------------------------------- */ static void AlarmHandler( TCL_UNUSED(int) /*signum*/) { gotsig = "1"; } /* *---------------------------------------------------------------------- * * TestgotsigCmd -- * * Verify the signal was handled after the testalarm command. * * Results: * None. * * Side Effects: * Resets the value of gotsig back to '0'. * *---------------------------------------------------------------------- */ static int TestgotsigCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ TCL_UNUSED(int) /*objc*/, TCL_UNUSED(Tcl_Obj *const *)) { Tcl_AppendResult(interp, gotsig, (char *)NULL); gotsig = "0"; return TCL_OK; } /* *--------------------------------------------------------------------------- * * TestchmodCmd -- * * Implements the "testchmod" cmd. Used when testing "file" command. * The only attribute used by the Windows platform is the user write * flag; if this is not set, the file is made read-only. Otherwise, the * file is made read-write. * * Results: * A standard Tcl result. * * Side effects: * Changes permissions of specified files. * *--------------------------------------------------------------------------- */ static int TestchmodCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { int i, mode; Tcl_DString ds; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?"); return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[1], &mode) != TCL_OK) { return TCL_ERROR; } Tcl_DStringInit(&ds); for (i = 2; i < objc; i++) { Tcl_DString buffer; const char *translated; translated = Tcl_TranslateFileName(interp, Tcl_GetString(objv[i]), &buffer); if (translated == NULL) { Tcl_DStringFree(&ds); return TCL_ERROR; } Tcl_UtfToExternalDString(NULL, translated, -1, &ds); if (chmod(Tcl_DStringValue(&ds), mode) != 0) { Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp), (char *)NULL); Tcl_DStringFree(&ds); return TCL_ERROR; } Tcl_DStringFree(&buffer); Tcl_DStringSetLength(&ds, 0); } Tcl_DStringFree(&ds); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ tcl9.0.3/unix/tclUnixSock.c0000644000175000017500000014736215104661341015161 0ustar sergeisergei/* * tclUnixSock.c -- * * This file contains Unix-specific socket related code. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include /* * Helper macros to make parts of this file clearer. The macros do exactly * what they say on the tin. :-) They also only ever refer to their arguments * once, and so can be used without regard to side effects. */ #define SET_BITS(var, bits) ((var) |= (bits)) #define CLEAR_BITS(var, bits) ((var) &= ~(bits)) #define GOT_BITS(var, bits) (((var) & (bits)) != 0) /* "sock" + a pointer in hex + \0 */ #define SOCK_CHAN_LENGTH (4 + sizeof(void *) * 2 + 1) #define SOCK_TEMPLATE "sock%" TCL_Z_MODIFIER "x" #undef SOCKET /* Possible conflict with win32 SOCKET */ /* * This is needed to comply with the strict aliasing rules of GCC, but it also * simplifies casting between the different sockaddr types. */ typedef union { struct sockaddr sa; struct sockaddr_in sa4; struct sockaddr_in6 sa6; struct sockaddr_storage sas; } address; /* * This structure describes per-instance state of a tcp-based channel. */ typedef struct TcpState TcpState; typedef struct TcpFdList { TcpState *statePtr; int fd; struct TcpFdList *next; } TcpFdList; struct TcpState { Tcl_Channel channel; /* Channel associated with this file. */ int flags; /* OR'ed combination of the bitfields defined * below. */ TcpFdList fds; /* The file descriptors of the sockets. */ int interest; /* Event types of interest */ /* * Only needed for server sockets */ Tcl_TcpAcceptProc *acceptProc; /* Proc to call on accept. */ void *acceptProcData; /* The data for the accept proc. */ /* * Only needed for client sockets */ struct addrinfo *addrlist; /* Addresses to connect to. */ struct addrinfo *addr; /* Iterator over addrlist. */ struct addrinfo *myaddrlist;/* Local address. */ struct addrinfo *myaddr; /* Iterator over myaddrlist. */ int filehandlers; /* Caches FileHandlers that get set up while * an async socket is not yet connected. */ int connectError; /* Cache SO_ERROR of async socket. */ int cachedBlocking; /* Cache blocking mode of async socket. */ }; /* * These bits may be OR'ed together into the "flags" field of a TcpState * structure. */ #define TCP_NONBLOCKING (1<<0) /* Socket with non-blocking I/O */ #define TCP_ASYNC_CONNECT (1<<1) /* Async connect in progress. */ #define TCP_ASYNC_PENDING (1<<4) /* TcpConnect was called to * process an async connect. This * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ #define TCP_ASYNC_TEST_MODE (1<<8) /* Async testing activated. Do not * automatically continue connection * process. */ /* * The following defines the maximum length of the listen queue. This is the * number of outstanding yet-to-be-serviced requests for a connection on a * server socket, more than this number of outstanding requests and the * connection request will fail. */ #ifndef SOMAXCONN # define SOMAXCONN 100 #elif (SOMAXCONN < 100) # undef SOMAXCONN # define SOMAXCONN 100 #endif /* SOMAXCONN < 100 */ /* * The following defines how much buffer space the kernel should maintain for * a socket. */ #define SOCKET_BUFSIZE 4096 /* * Static routines for this file: */ static void TcpAsyncCallback(void *clientData, int mask); static int TcpConnect(Tcl_Interp *interp, TcpState *state); static void TcpAccept(void *data, int mask); static int TcpBlockModeProc(void *data, int mode); static int TcpCloseProc(void *instanceData, Tcl_Interp *interp); static int TcpClose2Proc(void *instanceData, Tcl_Interp *interp, int flags); static int TcpGetHandleProc(void *instanceData, int direction, void **handlePtr); static int TcpGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static int TcpInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int TcpOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static int TcpSetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, const char *value); static void TcpThreadActionProc(void *instanceData, int action); static void TcpWatchProc(void *instanceData, int mask); static int WaitForConnect(TcpState *statePtr, int *errorCodePtr); static Tcl_FileProc WrapNotify; /* * This structure describes the channel type structure for TCP socket * based IO: */ static const Tcl_ChannelType tcpChannelType = { "tcp", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ TcpInputProc, TcpOutputProc, NULL, /* Deprecated. */ TcpSetOptionProc, TcpGetOptionProc, TcpWatchProc, TcpGetHandleProc, TcpClose2Proc, TcpBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ TcpThreadActionProc, NULL /* Truncate proc. */ }; /* * The following variable holds the network name of this host. */ static TclInitProcessGlobalValueProc InitializeHostName; static ProcessGlobalValue hostName = {0, 0, NULL, NULL, InitializeHostName, NULL, NULL}; #if 0 /* printf debugging */ void printaddrinfo( struct addrinfo *addrlist, char *prefix) { char host[NI_MAXHOST], port[NI_MAXSERV]; struct addrinfo *ai; for (ai = addrlist; ai != NULL; ai = ai->ai_next) { getnameinfo(ai->ai_addr, ai->ai_addrlen, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST|NI_NUMERICSERV); fprintf(stderr,"%s: %s:%s\n", prefix, host, port); } } #endif /* * ---------------------------------------------------------------------- * * InitializeHostName -- * * This routine sets the process global value of the name of the local * host on which the process is running. * * Results: * None. * * ---------------------------------------------------------------------- */ static void InitializeHostName( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { const char *native = NULL; #ifndef NO_UNAME struct utsname u; struct hostent *hp; memset(&u, (int) 0, sizeof(struct utsname)); if (uname(&u) >= 0) { /* INTL: Native. */ hp = TclpGetHostByName(u.nodename); /* INTL: Native. */ if (hp == NULL) { /* * Sometimes the nodename is fully qualified, but gets truncated * as it exceeds SYS_NMLN. See if we can just get the immediate * nodename and get a proper answer that way. */ char *dot = strchr(u.nodename, '.'); if (dot != NULL) { char *node = (char *)Tcl_Alloc(dot - u.nodename + 1); memcpy(node, u.nodename, dot - u.nodename); node[dot - u.nodename] = '\0'; hp = TclpGetHostByName(node); Tcl_Free(node); } } if (hp != NULL) { native = hp->h_name; } else { native = u.nodename; } } #else /* !NO_UNAME */ /* * Uname doesn't exist; try gethostname instead. * * There is no portable macro for the maximum length of host names * returned by gethostbyname(). We should only trust SYS_NMLN if it is at * least 255 + 1 bytes to comply with DNS host name limits. * * Note: SYS_NMLN is a restriction on "uname" not on gethostbyname! * * For example HP-UX 10.20 has SYS_NMLN == 9, while gethostbyname() can * return a fully qualified name from DNS of up to 255 bytes. * * Fix suggested by Viktor Dukhovni (viktor@esm.com) */ # if defined(SYS_NMLN) && (SYS_NMLEN >= 256) char buffer[SYS_NMLEN]; # else char buffer[256]; # endif if (gethostname(buffer, sizeof(buffer)) >= 0) { /* INTL: Native. */ native = buffer; } #endif /* NO_UNAME */ *encodingPtr = Tcl_GetEncoding(NULL, NULL); if (native) { *lengthPtr = strlen(native); *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); memcpy(*valuePtr, native, *lengthPtr + 1); } else { *lengthPtr = 0; *valuePtr = (char *)Tcl_Alloc(1); *valuePtr[0] = '\0'; } } /* * ---------------------------------------------------------------------- * * Tcl_GetHostName -- * * Returns the name of the local host. * * Results: * A string containing the network name for this machine, or an empty * string if we can't figure out the name. The caller must not modify or * free this string. * * Side effects: * Caches the name to return for future calls. * * ---------------------------------------------------------------------- */ const char * Tcl_GetHostName(void) { Tcl_Obj *tclObj = TclGetProcessGlobalValue(&hostName); return TclGetString(tclObj); } /* * ---------------------------------------------------------------------- * * TclpFinalizeSockets -- * * Performs per-thread socket subsystem finalization. * * Results: * None. * * Side effects: * None. * * ---------------------------------------------------------------------- */ void TclpFinalizeSockets(void) { return; } /* * ---------------------------------------------------------------------- * * TcpBlockModeProc -- * * This function is invoked by the generic IO level to set blocking and * nonblocking mode on a TCP socket based channel. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or nonblocking mode. * * ---------------------------------------------------------------------- */ static int TcpBlockModeProc( void *instanceData, /* Socket state. */ int mode) /* The mode to set. Can be one of * TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { TcpState *statePtr = (TcpState *)instanceData; if (mode == TCL_MODE_BLOCKING) { CLEAR_BITS(statePtr->flags, TCP_NONBLOCKING); } else { SET_BITS(statePtr->flags, TCP_NONBLOCKING); } if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { statePtr->cachedBlocking = mode; return 0; } if (TclUnixSetBlockingMode(statePtr->fds.fd, mode) < 0) { return errno; } return 0; } /* * ---------------------------------------------------------------------- * * WaitForConnect -- * * Check the state of an async connect process. If a connection attempt * terminated, process it, which may finalize it or may start the next * attempt. If a connect error occurs, it is saved in * statePtr->connectError to be reported by 'fconfigure -error'. * * There are two modes of operation, defined by errorCodePtr: * * non-NULL: Called by explicit read/write command. Blocks if the * socket is blocking. * May return two error codes: * * EWOULDBLOCK: if connect is still in progress * * ENOTCONN: if connect failed. This would be the error message * of a recv or sendto syscall so this is emulated here. * * NULL: Called by a background operation. Do not block and do not * return any error code. * * Results: * 0 if the connection has completed, -1 if still in progress or there is * an error. * * Side effects: * Processes socket events off the system queue. May process * asynchronous connects. * *---------------------------------------------------------------------- */ static int WaitForConnect( TcpState *statePtr, /* State of the socket. */ int *errorCodePtr) { int timeout; /* * Check if an async connect failed already and error reporting is * demanded, return the error ENOTCONN */ if (errorCodePtr != NULL && GOT_BITS(statePtr->flags, TCP_ASYNC_FAILED)) { *errorCodePtr = ENOTCONN; return -1; } /* * Check if an async connect is running. If not return ok. */ if (!GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { return 0; } /* * In socket test mode do not continue with the connect. * Exceptions are: * - Call by recv/send and blocking socket * (errorCodePtr != NULL && !GOT_BITS(flags, TCP_NONBLOCKING)) */ if (GOT_BITS(statePtr->flags, TCP_ASYNC_TEST_MODE) && !(errorCodePtr != NULL && !GOT_BITS(statePtr->flags, TCP_NONBLOCKING))) { *errorCodePtr = EWOULDBLOCK; return -1; } if (errorCodePtr == NULL || GOT_BITS(statePtr->flags, TCP_NONBLOCKING)) { timeout = 0; } else { timeout = -1; } do { if (TclUnixWaitForFile(statePtr->fds.fd, TCL_WRITABLE | TCL_EXCEPTION, timeout) != 0) { TcpConnect(NULL, statePtr); } /* * Do this only once in the nonblocking case and repeat it until the * socket is final when blocking. */ } while (timeout == -1 && GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)); if (errorCodePtr != NULL) { if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { *errorCodePtr = EAGAIN; return -1; } else if (statePtr->connectError != 0) { *errorCodePtr = ENOTCONN; return -1; } } return 0; } /* *---------------------------------------------------------------------- * * TcpInputProc -- * * This function is invoked by the generic IO level to read input from a * TCP socket based channel. * * NOTE: We cannot share code with FilePipeInputProc because here we must * use recv to obtain the input from the channel, not read. * * Results: * The number of bytes read is returned or -1 on error. An output * argument contains the POSIX error code on error, or zero if no error * occurred. * * Side effects: * Reads input from the input device of the channel. * *---------------------------------------------------------------------- */ static int TcpInputProc( void *instanceData, /* Socket state. */ char *buf, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCodePtr) /* Where to store error code. */ { TcpState *statePtr = (TcpState *)instanceData; ssize_t bytesRead; *errorCodePtr = 0; if (WaitForConnect(statePtr, errorCodePtr) != 0) { return -1; } bytesRead = recv(statePtr->fds.fd, buf, bufSize, 0); if (bytesRead >= 0) { return (int)bytesRead; } if (errno == ECONNRESET) { /* * Turn ECONNRESET into a soft EOF condition. */ return 0; } *errorCodePtr = errno; return -1; } /* *---------------------------------------------------------------------- * * TcpOutputProc -- * * This function is invoked by the generic IO level to write output to a * TCP socket based channel. * * NOTE: We cannot share code with FilePipeOutputProc because here we * must use send, not write, to get reliable error reporting. * * Results: * The number of bytes written is returned. An output argument is set to * a POSIX error code if an error occurred, or zero. * * Side effects: * Writes output on the output device of the channel. * *---------------------------------------------------------------------- */ static int TcpOutputProc( void *instanceData, /* Socket state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { TcpState *statePtr = (TcpState *)instanceData; ssize_t written; *errorCodePtr = 0; if (WaitForConnect(statePtr, errorCodePtr) != 0) { return -1; } written = send(statePtr->fds.fd, buf, toWrite, 0); if (written >= 0) { return (int)written; } *errorCodePtr = errno; return -1; } /* *---------------------------------------------------------------------- * * TcpCloseProc -- * * This function is invoked by the generic IO level to perform * channel-type-specific cleanup when a TCP socket based channel is * closed. * * Results: * 0 if successful, the value of errno if failed. * * Side effects: * Closes the socket of the channel. * *---------------------------------------------------------------------- */ static int TcpCloseProc( void *instanceData, /* The socket to close. */ TCL_UNUSED(Tcl_Interp *)) { TcpState *statePtr = (TcpState *)instanceData; int errorCode = 0; TcpFdList *fds; /* * Delete a file handler that may be active for this socket if this is a * server socket - the file handler was created automatically by Tcl as * part of the mechanism to accept new client connections. Channel * handlers are already deleted in the generic IO channel closing code * that called this function, so we do not have to delete them here. */ for (fds = &statePtr->fds; fds != NULL; fds = fds->next) { if (fds->fd < 0) { continue; } Tcl_DeleteFileHandler(fds->fd); if (close(fds->fd) < 0) { errorCode = errno; } } fds = statePtr->fds.next; while (fds != NULL) { TcpFdList *next = fds->next; Tcl_Free(fds); fds = next; } if (statePtr->addrlist != NULL) { freeaddrinfo(statePtr->addrlist); } if (statePtr->myaddrlist != NULL) { freeaddrinfo(statePtr->myaddrlist); } Tcl_Free(statePtr); return errorCode; } /* *---------------------------------------------------------------------- * * TcpClose2Proc -- * * This function is called by the generic IO level to perform the channel * type specific part of a half-close: namely, a shutdown() on a socket. * * Results: * 0 if successful, the value of errno if failed. * * Side effects: * Shuts down one side of the socket. * *---------------------------------------------------------------------- */ static int TcpClose2Proc( void *instanceData, /* The socket to close. */ TCL_UNUSED(Tcl_Interp *), int flags) /* Flags that indicate which side to close. */ { TcpState *statePtr = (TcpState *)instanceData; int readError = 0; int writeError = 0; /* * Shutdown the OS socket handle. */ if ((flags & (TCL_CLOSE_READ|TCL_CLOSE_WRITE)) == 0) { return TcpCloseProc(instanceData, NULL); } if ((flags & TCL_CLOSE_READ) && (shutdown(statePtr->fds.fd, SHUT_RD) < 0)) { readError = errno; } if ((flags & TCL_CLOSE_WRITE) && (shutdown(statePtr->fds.fd, SHUT_WR) < 0)) { writeError = errno; } return (readError != 0) ? readError : writeError; } /* *---------------------------------------------------------------------- * * TcpHostPortList -- * * This function is called by the -gethostname and -getpeername switches * of TcpGetOptionProc() to add three list elements with the textual * representation of the given address to the given DString. * * Results: * None. * * Side effects: * Adds three elements do dsPtr * *---------------------------------------------------------------------- */ #ifndef NEED_FAKE_RFC2553 #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif static inline int IPv6AddressNeedsNumericRendering( struct in6_addr addr) { if (IN6_ARE_ADDR_EQUAL(&addr, &in6addr_any)) { return 1; } /* * The IN6_IS_ADDR_V4MAPPED macro has a problem with aliasing warnings on * at least some versions of OSX. */ if (!IN6_IS_ADDR_V4MAPPED(&addr)) { return 0; } return (addr.s6_addr[12] == 0 && addr.s6_addr[13] == 0 && addr.s6_addr[14] == 0 && addr.s6_addr[15] == 0); } #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic pop #endif #endif /* NEED_FAKE_RFC2553 */ static void TcpHostPortList( Tcl_Interp *interp, Tcl_DString *dsPtr, address addr, socklen_t salen) { #define SUPPRESS_RDNS_VAR "::tcl::unsupported::noReverseDNS" char host[NI_MAXHOST], nhost[NI_MAXHOST], nport[NI_MAXSERV]; int flags = 0; getnameinfo(&addr.sa, salen, nhost, sizeof(nhost), nport, sizeof(nport), NI_NUMERICHOST | NI_NUMERICSERV); Tcl_DStringAppendElement(dsPtr, nhost); /* * We don't want to resolve INADDR_ANY and sin6addr_any; they can * sometimes cause problems (and never have a name). */ if (addr.sa.sa_family == AF_INET) { if (addr.sa4.sin_addr.s_addr == INADDR_ANY) { flags |= NI_NUMERICHOST; } #ifndef NEED_FAKE_RFC2553 } else if (addr.sa.sa_family == AF_INET6) { if (IPv6AddressNeedsNumericRendering(addr.sa6.sin6_addr)) { flags |= NI_NUMERICHOST; } #endif /* NEED_FAKE_RFC2553 */ } /* * Check if reverse DNS has been switched off globally. */ if (interp != NULL && Tcl_GetVar2(interp, SUPPRESS_RDNS_VAR, NULL, 0) != NULL) { flags |= NI_NUMERICHOST; } if (getnameinfo(&addr.sa, salen, host, sizeof(host), NULL, 0, flags) == 0) { /* * Reverse mapping worked. */ Tcl_DStringAppendElement(dsPtr, host); } else { /* * Reverse mapping failed - use the numeric rep once more. */ Tcl_DStringAppendElement(dsPtr, nhost); } Tcl_DStringAppendElement(dsPtr, nport); } /* *---------------------------------------------------------------------- * * TcpSetOptionProc -- * * Sets TCP channel specific options. * * Results: * None, unless an error happens. * * Side effects: * Changes attributes of the socket at the system level. * *---------------------------------------------------------------------- */ static int TcpSetOptionProc( void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { TcpState *statePtr = (TcpState *)instanceData; size_t len = 0; if (optionName != NULL) { len = strlen(optionName); } if ((len > 1) && (optionName[1] == 'k') && (strncmp(optionName, "-keepalive", len) == 0)) { int val = 0, ret; if (Tcl_GetBoolean(interp, value, &val) != TCL_OK) { return TCL_ERROR; } #if defined(SO_KEEPALIVE) ret = setsockopt(statePtr->fds.fd, SOL_SOCKET, SO_KEEPALIVE, (const char *) &val, sizeof(int)); #else ret = -1; Tcl_SetErrno(ENOTSUP); #endif if (ret < 0) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't set socket option: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } if ((len > 1) && (optionName[1] == 'n') && (strncmp(optionName, "-nodelay", len) == 0)) { int val = 0, ret; if (Tcl_GetBoolean(interp, value, &val) != TCL_OK) { return TCL_ERROR; } #if defined(SOL_TCP) && defined(TCP_NODELAY) ret = setsockopt(statePtr->fds.fd, SOL_TCP, TCP_NODELAY, (const char *) &val, sizeof(int)); #else ret = -1; Tcl_SetErrno(ENOTSUP); #endif if (ret < 0) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't set socket option: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "keepalive nodelay"); } /* *---------------------------------------------------------------------- * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of * all options and their values. * * Note: This code is based on code contributed by John Haxby. * * Results: * A standard Tcl result. The value of the specified option or a list of * all options and their values is returned in the supplied DString. Sets * Error message if needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int TcpGetOptionProc( void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Name of the option to retrieve the value * for, or NULL to get all options and their * values. */ Tcl_DString *dsPtr) /* Where to store the computed value; * initialized by caller. */ { TcpState *statePtr = (TcpState *)instanceData; size_t len = 0; if (optionName != NULL) { len = strlen(optionName); } if ((len > 1) && (optionName[1] == 'e') && (strncmp(optionName, "-error", len) == 0)) { socklen_t optlen = sizeof(int); WaitForConnect(statePtr, NULL); if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { /* * Suppress errors as long as we are not done. */ errno = 0; } else if (statePtr->connectError != 0) { errno = statePtr->connectError; statePtr->connectError = 0; } else { int err; getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_ERROR, (char *) &err, &optlen); errno = err; } if (errno != 0) { Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(errno), TCL_INDEX_NONE); } return TCL_OK; } if ((len > 1) && (optionName[1] == 'c') && (strncmp(optionName, "-connecting", len) == 0)) { WaitForConnect(statePtr, NULL); Tcl_DStringAppend(dsPtr, GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT) ? "1" : "0", TCL_INDEX_NONE); return TCL_OK; } if ((len == 0) || ((len > 1) && (optionName[1] == 'p') && (strncmp(optionName, "-peername", len) == 0))) { address peername; socklen_t size = sizeof(peername); WaitForConnect(statePtr, NULL); if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { /* * In async connect output an empty string */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-peername"); Tcl_DStringAppendElement(dsPtr, ""); } else { return TCL_OK; } } else if (getpeername(statePtr->fds.fd, &peername.sa, &size) >= 0) { /* * Peername fetch succeeded - output list */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-peername"); Tcl_DStringStartSublist(dsPtr); } TcpHostPortList(interp, dsPtr, peername, size); if (len) { return TCL_OK; } Tcl_DStringEndSublist(dsPtr); } else { /* * getpeername failed - but if we were asked for all the options * (len==0), don't flag an error at that point because it could be * an fconfigure request on a server socket (which have no peer). * Same must be done on win&mac. */ if (len) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get peername: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } } } if ((len == 0) || ((len > 1) && (optionName[1] == 's') && (strncmp(optionName, "-sockname", len) == 0))) { TcpFdList *fds; address sockname; socklen_t size; int found = 0; WaitForConnect(statePtr, NULL); if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-sockname"); Tcl_DStringStartSublist(dsPtr); } if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { /* * In async connect output an empty string */ found = 1; } else { for (fds = &statePtr->fds; fds != NULL; fds = fds->next) { size = sizeof(sockname); if (getsockname(fds->fd, &(sockname.sa), &size) >= 0) { found = 1; TcpHostPortList(interp, dsPtr, sockname, size); } } } if (found) { if (len) { return TCL_OK; } Tcl_DStringEndSublist(dsPtr); } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't get sockname: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } } if ((len == 0) || ((len > 1) && (optionName[1] == 'k') && (strncmp(optionName, "-keepalive", len) == 0))) { int opt = 0; #if defined(SO_KEEPALIVE) socklen_t size = sizeof(opt); #endif if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-keepalive"); } #if defined(SO_KEEPALIVE) getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &opt, &size); #endif Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0"); if (len > 0) { return TCL_OK; } } if ((len == 0) || ((len > 1) && (optionName[1] == 'n') && (strncmp(optionName, "-nodelay", len) == 0))) { int opt = 0; #if defined(SOL_TCP) && defined(TCP_NODELAY) socklen_t size = sizeof(opt); #endif if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-nodelay"); } #if defined(SOL_TCP) && defined(TCP_NODELAY) getsockopt(statePtr->fds.fd, SOL_TCP, TCP_NODELAY, (char *) &opt, &size); #endif Tcl_DStringAppendElement(dsPtr, opt ? "1" : "0"); if (len > 0) { return TCL_OK; } } if (len > 0) { return Tcl_BadChannelOption(interp, optionName, "connecting keepalive nodelay peername sockname"); } return TCL_OK; } /* * ---------------------------------------------------------------------- * * TcpThreadActionProc -- * * Handles detach/attach for asynchronously connecting socket. * * Reassigning the file handler associated with thread-related channel * notification, responsible for callbacks (signaling that asynchronous * connection attempt has succeeded or failed). * * Results: * None. * * ---------------------------------------------------------------------- */ static void TcpThreadActionProc( void *instanceData, int action) { TcpState *statePtr = (TcpState *)instanceData; if (GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT)) { /* * Async-connecting socket must get reassigned handler if it have been * transferred to another thread. Remove the handler if the socket is * not managed by this thread anymore and create new handler (TSD related) * so the callback will run in the correct thread, bug [f583715154]. */ switch (action) { case TCL_CHANNEL_THREAD_REMOVE: CLEAR_BITS(statePtr->flags, TCP_ASYNC_PENDING); Tcl_DeleteFileHandler(statePtr->fds.fd); break; case TCL_CHANNEL_THREAD_INSERT: Tcl_CreateFileHandler(statePtr->fds.fd, TCL_WRITABLE | TCL_EXCEPTION, TcpAsyncCallback, statePtr); SET_BITS(statePtr->flags, TCP_ASYNC_PENDING); break; } } } /* * ---------------------------------------------------------------------- * * TcpWatchProc -- * * Initialize the notifier to watch the fd from this channel. * * Results: * None. * * Side effects: * Sets up the notifier so that a future event on the channel will be * seen by Tcl. * * ---------------------------------------------------------------------- */ static void WrapNotify( void *clientData, int mask) { TcpState *statePtr = (TcpState *) clientData; int newmask = mask & statePtr->interest; if (newmask == 0) { /* * There was no overlap between the states the channel is interested * in notifications for, and the states that are reported present on * the file descriptor by select(). The only way that can happen is * when the channel is interested in a writable condition, and only a * readable state is reported present (see TcpWatchProc() below). In * that case, signal back to the caller the writable state, which is * really an error condition. As an extra check on that assumption, * check for a non-zero value of errno before reporting an artificial * writable state. */ if (errno == 0) { return; } newmask = TCL_WRITABLE; } Tcl_NotifyChannel(statePtr->channel, newmask); } static void TcpWatchProc( void *instanceData, /* The socket state. */ int mask) /* Events of interest; an OR-ed combination of * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { TcpState *statePtr = (TcpState *)instanceData; if (statePtr->acceptProc != NULL) { /* * Make sure we don't mess with server sockets since they will never * be readable or writable at the Tcl level. This keeps Tcl scripts * from interfering with the -accept behavior (bug #3394732). */ return; } if (GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING)) { /* * Async sockets use a FileHandler internally while connecting, so we * need to cache this request until the connection has succeeded. */ statePtr->filehandlers = mask; } else if (mask) { /* * Whether it is a bug or feature or otherwise, it is a fact of life * that on at least some Linux kernels select() fails to report that a * socket file descriptor is writable when the other end of the socket * is closed. This is in contrast to the guarantees Tcl makes that * its channels become writable and fire writable events on an error * condition. This has caused a leak of file descriptors in a state of * background flushing. See Tcl ticket 1758a0b603. * * As a workaround, when our caller indicates an interest in writable * notifications, we must tell the notifier built around select() that * we are interested in the readable state of the file descriptor as * well, as that is the only reliable means to get notified of error * conditions. Then it is the task of WrapNotify() above to untangle * the meaning of these channel states and report the chan events as * best it can. We save a copy of the mask passed in to assist with * that. */ statePtr->interest = mask; Tcl_CreateFileHandler(statePtr->fds.fd, mask|TCL_READABLE, WrapNotify, statePtr); } else { Tcl_DeleteFileHandler(statePtr->fds.fd); } } /* * ---------------------------------------------------------------------- * * TcpGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * TCP socket based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * * ---------------------------------------------------------------------- */ static int TcpGetHandleProc( void *instanceData, /* The socket state. */ TCL_UNUSED(int) /*direction*/, void **handlePtr) /* Where to store the handle. */ { TcpState *statePtr = (TcpState *)instanceData; *handlePtr = INT2PTR(statePtr->fds.fd); return TCL_OK; } /* * ---------------------------------------------------------------------- * * TcpAsyncCallback -- * * Called by the event handler that TcpConnect sets up internally for * [socket -async] to get notified when the asynchronous connection * attempt has succeeded or failed. * * ---------------------------------------------------------------------- */ static void TcpAsyncCallback( void *clientData, /* The socket state. */ TCL_UNUSED(int) /*mask*/) { TcpConnect(NULL, (TcpState *)clientData); } /* * ---------------------------------------------------------------------- * * TcpConnect -- * * This function opens a new socket in client mode. * * Results: * TCL_OK, if the socket was successfully connected or an asynchronous * connection is in progress. If an error occurs, TCL_ERROR is returned * and an error message is left in interp. * * Side effects: * Opens a socket. * * Remarks: * A single host name may resolve to more than one IP address, e.g. for * an IPv4/IPv6 dual stack host. For handling asynchronously connecting * sockets in the background for such hosts, this function can act as a * coroutine. On the first call, it sets up the control variables for the * two nested loops over the local and remote addresses. Once the first * connection attempt is in progress, it sets up itself as a writable * event handler for that socket, and returns. When the callback occurs, * control is transferred to the "reenter" label, right after the initial * return and the loops resume as if they had never been interrupted. * For synchronously connecting sockets, the loops work the usual way. * * ---------------------------------------------------------------------- */ static int TcpConnect( Tcl_Interp *interp, /* For error reporting; can be NULL. */ TcpState *statePtr) { socklen_t optlen; int async_callback = GOT_BITS(statePtr->flags, TCP_ASYNC_PENDING); int ret = -1, error = EHOSTUNREACH; int async = GOT_BITS(statePtr->flags, TCP_ASYNC_CONNECT); static const int reuseaddr = 1; if (async_callback) { goto reenter; } for (statePtr->addr = statePtr->addrlist; statePtr->addr != NULL; statePtr->addr = statePtr->addr->ai_next) { for (statePtr->myaddr = statePtr->myaddrlist; statePtr->myaddr != NULL; statePtr->myaddr = statePtr->myaddr->ai_next) { /* * No need to try combinations of local and remote addresses of * different families. */ if (statePtr->myaddr->ai_family != statePtr->addr->ai_family) { continue; } /* * Close the socket if it is still open from the last unsuccessful * iteration. */ if (statePtr->fds.fd >= 0) { close(statePtr->fds.fd); statePtr->fds.fd = -1; errno = 0; } statePtr->fds.fd = socket(statePtr->addr->ai_family, SOCK_STREAM, 0); if (statePtr->fds.fd < 0) { continue; } /* * Set the close-on-exec flag so that the socket will not get * inherited by child processes. */ fcntl(statePtr->fds.fd, F_SETFD, FD_CLOEXEC); /* * Set kernel space buffering */ TclSockMinimumBuffers(INT2PTR(statePtr->fds.fd), SOCKET_BUFSIZE); if (async) { ret = TclUnixSetBlockingMode(statePtr->fds.fd, TCL_MODE_NONBLOCKING); if (ret < 0) { continue; } } /* * Must reset the error variable here, before we use it for the * first time in this iteration. */ error = 0; (void) setsockopt(statePtr->fds.fd, SOL_SOCKET, SO_REUSEADDR, (char *) &reuseaddr, sizeof(reuseaddr)); ret = bind(statePtr->fds.fd, statePtr->myaddr->ai_addr, statePtr->myaddr->ai_addrlen); if (ret < 0) { error = errno; continue; } /* * Attempt to connect. The connect may fail at present with an * EINPROGRESS but at a later time it will complete. The caller * will set up a file handler on the socket if she is interested * in being informed when the connect completes. */ ret = connect(statePtr->fds.fd, statePtr->addr->ai_addr, statePtr->addr->ai_addrlen); if (ret < 0) { error = errno; } if (ret < 0 && errno == EINPROGRESS) { Tcl_CreateFileHandler(statePtr->fds.fd, TCL_WRITABLE | TCL_EXCEPTION, TcpAsyncCallback, statePtr); errno = EWOULDBLOCK; SET_BITS(statePtr->flags, TCP_ASYNC_PENDING); return TCL_OK; reenter: CLEAR_BITS(statePtr->flags, TCP_ASYNC_PENDING); Tcl_DeleteFileHandler(statePtr->fds.fd); /* * Read the error state from the socket to see if the async * connection has succeeded or failed. As this clears the * error condition, we cache the status in the socket state * struct for later retrieval by [fconfigure -error]. */ optlen = sizeof(int); getsockopt(statePtr->fds.fd, SOL_SOCKET, SO_ERROR, (char *) &error, &optlen); errno = error; } if (error == 0) { goto out; } } } out: statePtr->connectError = error; CLEAR_BITS(statePtr->flags, TCP_ASYNC_CONNECT); if (async_callback) { /* * An asynchonous connection has finally succeeded or failed. */ TcpWatchProc(statePtr, statePtr->filehandlers); TclUnixSetBlockingMode(statePtr->fds.fd, statePtr->cachedBlocking); if (error != 0) { SET_BITS(statePtr->flags, TCP_ASYNC_FAILED); } /* * We need to forward the writable event that brought us here, because * upon reading of getsockopt(SO_ERROR), at least some OSes clear the * writable state from the socket, and so a subsequent select() on * behalf of a script level [fileevent] would not fire. It doesn't * hurt that this is also called in the successful case and will save * the event mechanism one roundtrip through select(). */ if (statePtr->cachedBlocking == TCL_MODE_NONBLOCKING) { Tcl_NotifyChannel(statePtr->channel, TCL_WRITABLE); } } if (error != 0) { /* * Failure for either a synchronous connection, or an async one that * failed before it could enter background mode, e.g. because an * invalid -myaddr was given. */ if (interp != NULL) { errno = error; Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open socket: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * Tcl_OpenTcpClient -- * * Opens a TCP client socket and creates a channel around it. * * Results: * The channel or NULL if failed. An error message is returned in the * interpreter on failure. * * Side effects: * Opens a client socket and creates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_OpenTcpClient( Tcl_Interp *interp, /* For error reporting; can be NULL. */ int port, /* Port number to open. */ const char *host, /* Host on which to open port. */ const char *myaddr, /* Client-side address */ int myport, /* Client-side port */ int async) /* If nonzero, attempt to do an asynchronous * connect. Otherwise we do a blocking * connect. */ { TcpState *statePtr; const char *errorMsg = NULL; struct addrinfo *addrlist = NULL, *myaddrlist = NULL; char channelName[SOCK_CHAN_LENGTH]; /* * Do the name lookups for the local and remote addresses. */ if (!TclCreateSocketAddress(interp, &addrlist, host, port, 0, &errorMsg) || !TclCreateSocketAddress(interp, &myaddrlist, myaddr, myport, 1, &errorMsg)) { if (addrlist != NULL) { freeaddrinfo(addrlist); } if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open socket: %s", errorMsg)); } return NULL; } /* * Allocate a new TcpState for this socket. */ statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState)); memset(statePtr, 0, sizeof(TcpState)); statePtr->flags = async ? TCP_ASYNC_CONNECT : 0; statePtr->cachedBlocking = TCL_MODE_BLOCKING; statePtr->addrlist = addrlist; statePtr->myaddrlist = myaddrlist; statePtr->fds.fd = -1; /* * Create a new client socket and wrap it in a channel. */ if (TcpConnect(interp, statePtr) != TCL_OK) { TcpCloseProc(statePtr, NULL); return NULL; } snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr)); statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, TCL_READABLE | TCL_WRITABLE); if (Tcl_SetChannelOption(interp, statePtr->channel, "-translation", "auto crlf") == TCL_ERROR) { Tcl_CloseEx(NULL, statePtr->channel, 0); return NULL; } return statePtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_MakeTcpClientChannel -- * * Creates a Tcl_Channel from an existing client TCP socket. * * Results: * The Tcl_Channel wrapped around the preexisting TCP socket. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_MakeTcpClientChannel( void *sock) /* The socket to wrap up into a channel. */ { return (Tcl_Channel) TclpMakeTcpClientChannelMode(sock, TCL_READABLE | TCL_WRITABLE); } /* *---------------------------------------------------------------------- * * TclpMakeTcpClientChannelMode -- * * Creates a Tcl_Channel from an existing client TCP socket * with given mode. * * Results: * The Tcl_Channel wrapped around the preexisting TCP socket. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpMakeTcpClientChannelMode( void *sock, /* The socket to wrap up into a channel. */ int mode) /* OR'ed combination of TCL_READABLE and * TCL_WRITABLE to indicate file mode. */ { TcpState *statePtr; char channelName[SOCK_CHAN_LENGTH]; statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState)); memset(statePtr, 0, sizeof(TcpState)); statePtr->fds.fd = (int)PTR2INT(sock); statePtr->flags = 0; snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr)); statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, mode); if (Tcl_SetChannelOption(NULL, statePtr->channel, "-translation", "auto crlf") == TCL_ERROR) { Tcl_CloseEx(NULL, statePtr->channel, 0); return NULL; } return statePtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_OpenTcpServerEx -- * * Opens a TCP server socket and creates a channel around it. * * Results: * The channel or NULL if failed. If an error occurred, an error message * is left in the interp's result if interp is not NULL. * * Side effects: * Opens a server socket and creates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_OpenTcpServerEx( Tcl_Interp *interp, /* For error reporting - may be NULL. */ const char *service, /* Port number to open. */ const char *myHost, /* Name of local host. */ unsigned int flags, /* Flags. */ int backlog, /* Length of OS listen backlog queue. */ Tcl_TcpAcceptProc *acceptProc, /* Callback for accepting connections from new * clients. */ void *acceptProcData) /* Data for the callback. */ { int status = 0, sock = -1, optvalue, port, chosenport; struct addrinfo *addrlist = NULL, *addrPtr; /* socket address */ TcpState *statePtr = NULL; char channelName[SOCK_CHAN_LENGTH]; const char *errorMsg = NULL; TcpFdList *fds = NULL, *newfds; /* * Try to record and return the most meaningful error message, i.e. the * one from the first socket that went the farthest before it failed. */ enum { LOOKUP, SOCKET, BIND, LISTEN } howfar = LOOKUP; int my_errno = 0; /* * If we were called with port 0 to listen on a random port number, we * copy the port number from the first member of the addrinfo list to all * subsequent members, so that IPv4 and IPv6 listen on the same port. This * might fail to bind() with EADDRINUSE if a port is free on the first * address family in the list but already used on the other. In this case * we revert everything we've done so far and start from scratch hoping * that next time we'll find a port number that is usable on all address * families. We try this at most MAXRETRY times to avoid an endless loop * if all ports are taken. */ int retry = 0; #define MAXRETRY 10 repeat: if (retry > 0) { if (statePtr != NULL) { TcpCloseProc(statePtr, NULL); statePtr = NULL; } if (addrlist != NULL) { freeaddrinfo(addrlist); addrlist = NULL; } if (retry >= MAXRETRY) { goto error; } } retry++; chosenport = 0; if (TclSockGetPort(interp, service, "tcp", &port) != TCL_OK) { errorMsg = "invalid port number"; goto error; } if (!TclCreateSocketAddress(interp, &addrlist, myHost, port, 1, &errorMsg)) { my_errno = errno; goto error; } for (addrPtr = addrlist; addrPtr != NULL; addrPtr = addrPtr->ai_next) { sock = socket(addrPtr->ai_family, addrPtr->ai_socktype, addrPtr->ai_protocol); if (sock == -1) { if (howfar < SOCKET) { howfar = SOCKET; my_errno = errno; } continue; } /* * Set the close-on-exec flag so that the socket will not get * inherited by child processes. */ fcntl(sock, F_SETFD, FD_CLOEXEC); /* * Set kernel space buffering */ TclSockMinimumBuffers(INT2PTR(sock), SOCKET_BUFSIZE); /* * Set up to reuse server addresses and/or ports if requested. */ if (GOT_BITS(flags, TCL_TCPSERVER_REUSEADDR)) { optvalue = 1; (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &optvalue, sizeof(optvalue)); } if (GOT_BITS(flags, TCL_TCPSERVER_REUSEPORT)) { #ifndef SO_REUSEPORT /* * If the platform doesn't support the SO_REUSEPORT flag we can't * do much beside erroring out. */ errorMsg = "SO_REUSEPORT isn't supported by this platform"; goto error; #else optvalue = 1; (void) setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (char *) &optvalue, sizeof(optvalue)); #endif } /* * Make sure we use the same port number when opening two server * sockets for IPv4 and IPv6 on a random port. * * As sockaddr_in6 uses the same offset and size for the port member * as sockaddr_in, we can handle both through the IPv4 API. */ if (port == 0 && chosenport != 0) { ((struct sockaddr_in *)addrPtr->ai_addr)->sin_port = htons((uint16_t)chosenport); } #ifdef IPV6_V6ONLY /* * Missing on: Solaris 2.8 */ if (addrPtr->ai_family == AF_INET6) { int v6only = 1; (void) setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, sizeof(v6only)); } #endif /* IPV6_V6ONLY */ status = bind(sock, addrPtr->ai_addr, addrPtr->ai_addrlen); if (status == -1) { if (howfar < BIND) { howfar = BIND; my_errno = errno; } close(sock); sock = -1; if (port == 0 && errno == EADDRINUSE) { goto repeat; } continue; } if (port == 0 && chosenport == 0) { address sockname; socklen_t namelen = sizeof(sockname); /* * Synchronize port numbers when binding to port 0 of multiple * addresses. */ if (getsockname(sock, &sockname.sa, &namelen) >= 0) { chosenport = ntohs(sockname.sa4.sin_port); } } if (backlog < 0) { backlog = SOMAXCONN; } status = listen(sock, backlog); if (status < 0) { if (howfar < LISTEN) { howfar = LISTEN; my_errno = errno; } close(sock); sock = -1; if (port == 0 && errno == EADDRINUSE) { goto repeat; } continue; } if (statePtr == NULL) { /* * Allocate a new TcpState for this socket. */ statePtr = (TcpState *)Tcl_Alloc(sizeof(TcpState)); memset(statePtr, 0, sizeof(TcpState)); statePtr->acceptProc = acceptProc; statePtr->acceptProcData = acceptProcData; snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(statePtr)); newfds = &statePtr->fds; } else { newfds = (TcpFdList *)Tcl_Alloc(sizeof(TcpFdList)); memset(newfds, (int) 0, sizeof(TcpFdList)); fds->next = newfds; } newfds->fd = sock; newfds->statePtr = statePtr; fds = newfds; /* * Set up the callback mechanism for accepting connections from new * clients. */ Tcl_CreateFileHandler(sock, TCL_READABLE, TcpAccept, fds); } error: if (addrlist != NULL) { freeaddrinfo(addrlist); } if (statePtr != NULL) { statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, statePtr, 0); return statePtr->channel; } if (interp != NULL) { Tcl_Obj *errorObj = Tcl_NewStringObj("couldn't open socket: ", TCL_INDEX_NONE); if (errorMsg == NULL) { errno = my_errno; Tcl_AppendToObj(errorObj, Tcl_PosixError(interp), TCL_INDEX_NONE); } else { Tcl_AppendToObj(errorObj, errorMsg, TCL_INDEX_NONE); } Tcl_SetObjResult(interp, errorObj); } if (sock != -1) { close(sock); } return NULL; } /* *---------------------------------------------------------------------- * * TcpAccept -- * Accept a TCP socket connection. This is called by the event loop. * * Results: * None. * * Side effects: * Creates a new connection socket. Calls the registered callback for the * connection acceptance mechanism. * *---------------------------------------------------------------------- */ static void TcpAccept( void *data, /* Callback token. */ TCL_UNUSED(int) /*mask*/) { TcpFdList *fds = (TcpFdList *)data; /* Client data of server socket. */ int newsock; /* The new client socket */ TcpState *newSockState; /* State for new socket. */ address addr; /* The remote address */ socklen_t len; /* For accept interface */ char channelName[SOCK_CHAN_LENGTH]; char host[NI_MAXHOST], port[NI_MAXSERV]; len = sizeof(addr); newsock = accept(fds->fd, &addr.sa, &len); if (newsock < 0) { return; } /* * Set close-on-exec flag to prevent the newly accepted socket from being * inherited by child processes. */ (void) fcntl(newsock, F_SETFD, FD_CLOEXEC); newSockState = (TcpState *)Tcl_Alloc(sizeof(TcpState)); memset(newSockState, 0, sizeof(TcpState)); newSockState->flags = 0; newSockState->fds.fd = newsock; snprintf(channelName, sizeof(channelName), SOCK_TEMPLATE, PTR2INT(newSockState)); newSockState->channel = Tcl_CreateChannel(&tcpChannelType, channelName, newSockState, TCL_READABLE | TCL_WRITABLE); Tcl_SetChannelOption(NULL, newSockState->channel, "-translation", "auto crlf"); if (fds->statePtr->acceptProc != NULL) { getnameinfo(&addr.sa, len, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST|NI_NUMERICSERV); fds->statePtr->acceptProc(fds->statePtr->acceptProcData, newSockState->channel, host, atoi(port)); } } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * indent-tabs-mode: nil * End: */ tcl9.0.3/unix/tclUnixPort.h0000644000175000017500000004433315104661341015205 0ustar sergeisergei/* * tclUnixPort.h -- * * This header file handles porting issues that occur because of * differences between systems. It reads in UNIX-related header files and * sets up UNIX-related macros for Tcl's UNIX core. It should be the only * file that contains #ifdefs to handle different flavors of UNIX. This * file sets up the union of all UNIX-related things needed by any of the * Tcl core files. This file depends on configuration #defines such as * HAVE_SYS_PARAM_H that are set up by the "configure" script. * * Much of the material in this file was originally contributed by Karl * Lehenbauer, Mark Diekhans and Peter da Silva. * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-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. */ #ifndef _TCLUNIXPORT #define _TCLUNIXPORT /* *--------------------------------------------------------------------------- * The following sets of #includes and #ifdefs are required to get Tcl to * compile under the various flavors of unix. *--------------------------------------------------------------------------- */ #include #include #ifdef HAVE_NET_ERRNO_H # include #endif #include #include #ifdef HAVE_SYS_PARAM_H # include #endif #include #include /* *--------------------------------------------------------------------------- * Parameterize for 64-bit filesystem support. *--------------------------------------------------------------------------- */ #ifdef HAVE_STRUCT_DIRENT64 typedef struct dirent64 Tcl_DirEntry; # define TclOSreaddir readdir64 #else typedef struct dirent Tcl_DirEntry; # define TclOSreaddir readdir #endif #ifdef HAVE_DIR64 typedef DIR64 TclDIR; # define TclOSopendir opendir64 # define TclOSrewinddir rewinddir64 # define TclOSclosedir closedir64 #else typedef DIR TclDIR; # define TclOSopendir opendir # define TclOSrewinddir rewinddir # define TclOSclosedir closedir #endif #ifdef HAVE_TYPE_OFF64_T typedef off64_t Tcl_SeekOffset; # define TclOSseek lseek64 # define TclOSopen open64 #else typedef off_t Tcl_SeekOffset; # define TclOSseek lseek # define TclOSopen open #endif #ifdef __CYGWIN__ #ifdef __cplusplus extern "C" { #endif /* Make some symbols available without including */ # define CP_UTF8 65001 # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 # define HMODULE void * # define MAX_PATH 260 # define SOCKET unsigned int # define WSAEWOULDBLOCK 10035 typedef unsigned short WCHAR; __declspec(dllimport) extern int GetModuleHandleExW(unsigned int, const void *, void *); __declspec(dllimport) extern int GetModuleFileNameW(void *, const void *, int); __declspec(dllimport) extern int WideCharToMultiByte(int, int, const void *, int, char *, int, const char *, void *); __declspec(dllimport) extern int MultiByteToWideChar(int, int, const char *, int, WCHAR *, int); __declspec(dllimport) extern void OutputDebugStringW(const WCHAR *); __declspec(dllimport) extern int IsDebuggerPresent(void); __declspec(dllimport) extern int GetLastError(void); __declspec(dllimport) extern int GetFileAttributesW(const WCHAR *); __declspec(dllimport) extern int SetFileAttributesW(const WCHAR *, int); __declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int); # define timezone _timezone extern int TclOSfstat(int fd, void *statBuf); extern int TclOSstat(const char *name, void *statBuf); extern int TclOSlstat(const char *name, void *statBuf); #ifdef __cplusplus } #endif #else # define TclOSfstat(fd, buf) fstat(fd, (struct stat *)buf) # define TclOSstat(name, buf) stat(name, (struct stat *)buf) # define TclOSlstat(name, buf) lstat(name, (struct stat *)buf) #endif /* *--------------------------------------------------------------------------- * Miscellaneous includes that might be missing. *--------------------------------------------------------------------------- */ #include #ifdef HAVE_SYS_SELECT_H # include #endif #include #ifdef HAVE_SYS_TIME_H # include #endif #include #ifndef NO_SYS_WAIT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #include #include MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode); #include /* *--------------------------------------------------------------------------- * Socket support stuff: This likely needs more work to parameterize for each * system. *--------------------------------------------------------------------------- */ #include /* struct sockaddr, SOCK_STREAM, ... */ #ifndef NO_UNAME # include /* uname system call. */ #endif #include /* struct in_addr, struct sockaddr_in */ #include /* inet_ntoa() */ #include /* getaddrinfo() */ #ifdef NEED_FAKE_RFC2553 # include "../compat/fake-rfc2553.h" #endif /* *--------------------------------------------------------------------------- * Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look * for an alternative definition. If no other alternative is available we use * a reasonable guess. *--------------------------------------------------------------------------- */ #include #ifndef FLT_MAX # ifdef MAXFLOAT # define FLT_MAX MAXFLOAT # else # define FLT_MAX 3.402823466E+38F # endif #endif #ifndef FLT_MIN # ifdef MINFLOAT # define FLT_MIN MINFLOAT # else # define FLT_MIN 1.175494351E-38F # endif #endif /* *--------------------------------------------------------------------------- * NeXT doesn't define O_NONBLOCK, so #define it here if necessary. *--------------------------------------------------------------------------- */ #ifndef O_NONBLOCK # define O_NONBLOCK 0x80 #endif /* *--------------------------------------------------------------------------- * The type of the status returned by wait varies from UNIX system to UNIX * system. The macro below defines it: *--------------------------------------------------------------------------- */ #ifdef _AIX # define WAIT_STATUS_TYPE pid_t #else #ifndef NO_UNION_WAIT # define WAIT_STATUS_TYPE union wait #else # define WAIT_STATUS_TYPE int #endif #endif /* *--------------------------------------------------------------------------- * Supply definitions for macros to query wait status, if not already defined * in header files above. *--------------------------------------------------------------------------- */ #ifndef WIFEXITED # define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0) #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF) #endif #ifndef WIFSIGNALED # define WIFSIGNALED(stat) \ (((*((int *) &(stat)))) && ((*((int *) &(stat))) \ == ((*((int *) &(stat))) & 0x00FF))) #endif #ifndef WTERMSIG # define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F) #endif #ifndef WIFSTOPPED # define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177) #endif #ifndef WSTOPSIG # define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF) #endif /* *--------------------------------------------------------------------------- * Define constants for waitpid() system call if they aren't defined by a * system header file. *--------------------------------------------------------------------------- */ #ifndef WNOHANG # define WNOHANG 1 #endif #ifndef WUNTRACED # define WUNTRACED 2 #endif /* *--------------------------------------------------------------------------- * Supply macros for seek offsets, if they're not already provided by an * include file. *--------------------------------------------------------------------------- */ #ifndef SEEK_SET # define SEEK_SET 0 #endif #ifndef SEEK_CUR # define SEEK_CUR 1 #endif #ifndef SEEK_END # define SEEK_END 2 #endif /* *--------------------------------------------------------------------------- * The stuff below is needed by the "time" command. If this system has no * gettimeofday call, then must use times() instead. *--------------------------------------------------------------------------- */ #ifdef NO_GETTOD # include #else # ifdef HAVE_BSDGETTIMEOFDAY # define gettimeofday BSDgettimeofday # endif #endif #ifdef GETTOD_NOT_DECLARED extern int gettimeofday(struct timeval *tp, struct timezone *tzp); #endif /* *--------------------------------------------------------------------------- * Define access mode constants if they aren't already defined. *--------------------------------------------------------------------------- */ #ifndef F_OK # define F_OK 00 #endif #ifndef X_OK # define X_OK 01 #endif #ifndef W_OK # define W_OK 02 #endif #ifndef R_OK # define R_OK 04 #endif /* *--------------------------------------------------------------------------- * Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already * defined. *--------------------------------------------------------------------------- */ #ifndef FD_CLOEXEC # define FD_CLOEXEC 1 #endif /* *--------------------------------------------------------------------------- * On systems without symbolic links (i.e. S_IFLNK isn't defined) define * "lstat" to use "stat" instead. *--------------------------------------------------------------------------- */ #ifndef S_IFLNK # undef TclOSlstat # define lstat stat # define lstat64 stat64 # define TclOSlstat TclOSstat #endif /* *--------------------------------------------------------------------------- * Define macros to query file type bits, if they're not already defined. *--------------------------------------------------------------------------- */ #ifndef S_ISREG # ifdef S_IFREG # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) # else # define S_ISREG(m) 0 # endif #endif /* !S_ISREG */ #ifndef S_ISDIR # ifdef S_IFDIR # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # else # define S_ISDIR(m) 0 # endif #endif /* !S_ISDIR */ #ifndef S_ISCHR # ifdef S_IFCHR # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) # else # define S_ISCHR(m) 0 # endif #endif /* !S_ISCHR */ #ifndef S_ISBLK # ifdef S_IFBLK # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) # else # define S_ISBLK(m) 0 # endif #endif /* !S_ISBLK */ #ifndef S_ISFIFO # ifdef S_IFIFO # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) # else # define S_ISFIFO(m) 0 # endif #endif /* !S_ISFIFO */ #ifndef S_ISLNK # ifdef S_IFLNK # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) # else # define S_ISLNK(m) 0 # endif #endif /* !S_ISLNK */ #ifndef S_ISSOCK # ifdef S_IFSOCK # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) # else # define S_ISSOCK(m) 0 # endif #endif /* !S_ISSOCK */ /* *--------------------------------------------------------------------------- * Make sure that MAXPATHLEN and MAXNAMLEN are defined. *--------------------------------------------------------------------------- */ #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 2048 # endif #endif #ifndef MAXNAMLEN # ifdef NAME_MAX # define MAXNAMLEN NAME_MAX # else # define MAXNAMLEN 255 # endif #endif /* *--------------------------------------------------------------------------- * The following macro defines the type of the mask arguments to select: *--------------------------------------------------------------------------- */ #ifndef NO_FD_SET # define SELECT_MASK fd_set #else /* NO_FD_SET */ # ifndef _AIX typedef long fd_mask; # endif /* !AIX */ # if defined(_IBMR2) # define SELECT_MASK void # else /* !defined(_IBMR2) */ # define SELECT_MASK int # endif /* defined(_IBMR2) */ #endif /* !NO_FD_SET */ /* *--------------------------------------------------------------------------- * Define "NBBY" (number of bits per byte) if it's not already defined. *--------------------------------------------------------------------------- */ #ifndef NBBY # define NBBY 8 #endif /* *--------------------------------------------------------------------------- * The following macro defines the number of fd_masks in an fd_set: *--------------------------------------------------------------------------- */ #ifndef FD_SETSIZE # ifdef OPEN_MAX # define FD_SETSIZE OPEN_MAX # else # define FD_SETSIZE 256 # endif #endif /* FD_SETSIZE */ #ifndef howmany # define howmany(x, y) (((x)+((y)-1))/(y)) #endif /* !defined(howmany) */ #ifndef NFDBITS # define NFDBITS NBBY*sizeof(fd_mask) #endif /* NFDBITS */ #define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) /* *--------------------------------------------------------------------------- * Not all systems declare the errno variable in errno.h, so this file does it * explicitly. The list of system error messages also isn't generally declared * in a header file anywhere. *--------------------------------------------------------------------------- */ #ifdef NO_ERRNO extern int errno; #endif /* NO_ERRNO */ /* *--------------------------------------------------------------------------- * Not all systems declare all the errors that Tcl uses! Provide some * work-arounds... *--------------------------------------------------------------------------- */ #ifndef EOVERFLOW # ifdef EFBIG # define EOVERFLOW EFBIG # else /* !EFBIG */ # define EOVERFLOW EINVAL # endif /* EFBIG */ #endif /* EOVERFLOW */ /* *--------------------------------------------------------------------------- * Variables provided by the C library: *--------------------------------------------------------------------------- */ #if defined(__APPLE__) && defined(__DYNAMIC__) # include # define environ (*_NSGetEnviron()) # define USE_PUTENV 1 #else # if defined(_sgi) || defined(__sgi) # define environ _environ # endif extern char ** environ; #endif /* *--------------------------------------------------------------------------- * Darwin specifc configure overrides. *--------------------------------------------------------------------------- */ #ifdef __APPLE__ /* *--------------------------------------------------------------------------- * Support for fat compiles: configure runs only once for multiple architectures *--------------------------------------------------------------------------- */ # if defined(__LP64__) && defined (NO_COREFOUNDATION_64) # undef HAVE_COREFOUNDATION # endif /* __LP64__ && NO_COREFOUNDATION_64 */ # include # ifdef __DARWIN_UNIX03 # if __DARWIN_UNIX03 # undef HAVE_PUTENV_THAT_COPIES # else # define HAVE_PUTENV_THAT_COPIES 1 # endif # endif /* __DARWIN_UNIX03 */ /* *--------------------------------------------------------------------------- * Include AvailabilityMacros.h here (when available) to ensure any symbolic * MAC_OS_X_VERSION_* constants passed on the command line are translated. *--------------------------------------------------------------------------- */ # include /* *--------------------------------------------------------------------------- * Support for weak import. *--------------------------------------------------------------------------- */ # ifdef HAVE_WEAK_IMPORT # ifndef WEAK_IMPORT_ATTRIBUTE # define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import)) # endif # endif /* HAVE_WEAK_IMPORT */ /* * For now, test exec-17.1 fails (I/O setup after closing stdout) with * posix_spawnp(), but the classic implementation (based on fork()+execvp()) * works well under macOS. */ # undef HAVE_POSIX_SPAWNP # undef HAVE_VFORK #endif /* __APPLE__ */ /* *--------------------------------------------------------------------------- * The following macros and declarations represent the interface between * generic and unix-specific parts of Tcl. Some of the macros may override * functions declared in tclInt.h. *--------------------------------------------------------------------------- */ /* * The default platform eol translation on Unix is TCL_TRANSLATE_LF. */ #ifdef DJGPP #define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF typedef int socklen_t; #else #define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF #endif /* *--------------------------------------------------------------------------- * The following macros have trivial definitions, allowing generic code to * address platform-specific issues. *--------------------------------------------------------------------------- */ #define TclpReleaseFile(file) /* Nothing. */ /* *--------------------------------------------------------------------------- * The following defines wrap the system memory allocation routines. *--------------------------------------------------------------------------- */ #define TclpSysAlloc(size) malloc(size) #define TclpSysFree(ptr) free(ptr) #define TclpSysRealloc(ptr, size) realloc(ptr, size) /* *--------------------------------------------------------------------------- * The following macros and declaration wrap the C runtime library functions. *--------------------------------------------------------------------------- */ #if !defined(TCL_THREADS) || TCL_THREADS # include #endif /* TCL_THREADS */ /* FIXME - Hyper-enormous platform assumption! */ #ifndef AF_INET6 # define AF_INET6 10 #endif /* *--------------------------------------------------------------------------- * Set of MT-safe implementations of some known-to-be-MT-unsafe library calls. * Instead of returning pointers to the static storage, those return pointers * to the TSD data. *--------------------------------------------------------------------------- */ #include #include MODULE_SCOPE struct passwd * TclpGetPwNam(const char *name); MODULE_SCOPE struct group * TclpGetGrNam(const char *name); MODULE_SCOPE struct passwd * TclpGetPwUid(uid_t uid); MODULE_SCOPE struct group * TclpGetGrGid(gid_t gid); MODULE_SCOPE struct hostent * TclpGetHostByName(const char *name); MODULE_SCOPE struct hostent * TclpGetHostByAddr(const char *addr, int length, int type); MODULE_SCOPE void *TclpMakeTcpClientChannelMode( void *tcpSocket, int mode); #endif /* _TCLUNIXPORT */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixPipe.c0000644000175000017500000010604715104661341015152 0ustar sergeisergei/* * tclUnixPipe.c -- * * This file implements the UNIX-specific exec pipeline functions, the * "pipe" channel driver, and the "pid" Tcl command. * * Copyright © 1991-1994 The Regents of the University of California. * Copyright © 1994-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. */ #include "tclInt.h" #ifdef HAVE_POSIX_SPAWNP # if defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2) \ && defined(HAVE_POSIX_SPAWNATTR_SETFLAGS) \ && !defined(HAVE_VFORK) # include # include # else # undef HAVE_POSIX_SPAWNP # endif #endif #ifdef HAVE_VFORK #define fork vfork #endif /* * The following macros convert between TclFile's and fd's. The conversion * simple involves shifting fd's up by one to ensure that no valid fd is ever * the same as NULL. */ #define MakeFile(fd) ((TclFile)INT2PTR((fd) + 1)) #define GetFd(file) ((int)PTR2INT(file) - 1) /* * This structure describes per-instance state of a pipe based channel. */ typedef struct { Tcl_Channel channel; /* Channel associated with this file. */ TclFile inFile; /* Output from pipe. */ TclFile outFile; /* Input to pipe. */ TclFile errorFile; /* Error output from pipe. */ size_t numPids; /* How many processes are attached to this * pipe? */ Tcl_Pid *pidPtr; /* The process IDs themselves. Allocated by * the creator of the pipe. */ int isNonBlocking; /* Nonzero when the pipe is in nonblocking * mode. Used to decide whether to wait for * the children at close time. */ } PipeState; /* * Declarations for local functions defined in this file: */ static int PipeBlockModeProc(void *instanceData, int mode); static int PipeClose2Proc(void *instanceData, Tcl_Interp *interp, int flags); static int PipeGetHandleProc(void *instanceData, int direction, void **handlePtr); static int PipeInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int PipeOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static void PipeWatchProc(void *instanceData, int mask); static void RestoreSignals(void); static int SetupStdFile(TclFile file, int type); /* * This structure describes the channel type structure for command pipe based * I/O: */ static const Tcl_ChannelType pipeChannelType = { "pipe", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ PipeInputProc, PipeOutputProc, NULL, /* Deprecated. */ NULL, /* Set option proc. */ NULL, /* Get option proc. */ PipeWatchProc, PipeGetHandleProc, PipeClose2Proc, PipeBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ NULL, /* Thread action proc. */ NULL /* Truncation proc. */ }; /* *---------------------------------------------------------------------- * * TclpMakeFile -- * * Make a TclFile from a channel. * * Results: * Returns a new TclFile or NULL on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ TclFile TclpMakeFile( Tcl_Channel channel, /* Channel to get file from. */ int direction) /* Either TCL_READABLE or TCL_WRITABLE. */ { void *data; if (Tcl_GetChannelHandle(channel, direction, &data) != TCL_OK) { return NULL; } return MakeFile(PTR2INT(data)); } /* *---------------------------------------------------------------------- * * TclpOpenFile -- * * Open a file for use in a pipeline. * * Results: * Returns a new TclFile handle or NULL on failure. * * Side effects: * May cause a file to be created on the file system. * *---------------------------------------------------------------------- */ TclFile TclpOpenFile( const char *fname, /* The name of the file to open. */ int mode) /* In what mode to open the file? */ { int fd; const char *native; Tcl_DString ds; if (Tcl_UtfToExternalDStringEx(NULL, NULL, fname, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } native = Tcl_DStringValue(&ds); fd = TclOSopen(native, mode, 0666); /* INTL: Native. */ Tcl_DStringFree(&ds); if (fd != -1) { fcntl(fd, F_SETFD, FD_CLOEXEC); /* * If the file is being opened for writing, seek to the end so we can * append to any data already in the file. */ if ((mode & O_WRONLY) && !(mode & O_APPEND)) { TclOSseek(fd, 0, SEEK_END); } /* * Increment the fd so it can't be 0, which would conflict with the * NULL return for errors. */ return MakeFile(fd); } return NULL; } /* *---------------------------------------------------------------------- * * TclpCreateTempFile -- * * This function creates a temporary file initialized with an optional * string, and returns a file handle with the file pointer at the * beginning of the file. * * Results: * A handle to a file. * * Side effects: * None. * *---------------------------------------------------------------------- */ TclFile TclpCreateTempFile( const char *contents) /* String to write into temp file, or NULL. */ { int fd = TclUnixOpenTemporaryFile(NULL, NULL, NULL, NULL); if (fd == -1) { return NULL; } fcntl(fd, F_SETFD, FD_CLOEXEC); if (contents != NULL) { Tcl_DString dstring; char *native; if (Tcl_UtfToExternalDStringEx(NULL, NULL, contents, TCL_INDEX_NONE, 0, &dstring, NULL) != TCL_OK) { close(fd); Tcl_DStringFree(&dstring); return NULL; } native = Tcl_DStringValue(&dstring); if (write(fd, native, Tcl_DStringLength(&dstring)) == -1) { close(fd); Tcl_DStringFree(&dstring); return NULL; } Tcl_DStringFree(&dstring); TclOSseek(fd, 0, SEEK_SET); } return MakeFile(fd); } /* *---------------------------------------------------------------------- * * TclpTempFileName -- * * This function returns unique filename. * * Results: * Returns a valid Tcl_Obj* with refCount 0, or NULL on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Obj * TclpTempFileName(void) { Tcl_Obj *retVal, *nameObj; int fd; TclNewObj(nameObj); Tcl_IncrRefCount(nameObj); fd = TclUnixOpenTemporaryFile(NULL, NULL, NULL, nameObj); if (fd == -1) { Tcl_DecrRefCount(nameObj); return NULL; } fcntl(fd, F_SETFD, FD_CLOEXEC); TclpObjDeleteFile(nameObj); close(fd); retVal = Tcl_DuplicateObj(nameObj); Tcl_DecrRefCount(nameObj); return retVal; } /* *---------------------------------------------------------------------------- * * TclpTempFileNameForLibrary -- * * Constructs a file name in the native file system where a dynamically * loaded library may be placed. * * Results: * Returns the constructed file name. If an error occurs, returns NULL * and leaves an error message in the interpreter result. * * On Unix, it works to load a shared object from a file of any name, so this * function is merely a thin wrapper around TclpTempFileName(). * *---------------------------------------------------------------------------- */ Tcl_Obj * TclpTempFileNameForLibrary( Tcl_Interp *interp, /* Tcl interpreter. */ TCL_UNUSED(Tcl_Obj *) /*path*/) { Tcl_Obj *retval = TclpTempFileName(); if (retval == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't create temporary file: %s", Tcl_PosixError(interp))); } return retval; } /* *---------------------------------------------------------------------- * * TclpCreatePipe -- * * Creates a pipe - simply calls the pipe() function. * * Results: * Returns 1 on success, 0 on failure. * * Side effects: * Creates a pipe. * *---------------------------------------------------------------------- */ int TclpCreatePipe( TclFile *readPipe, /* Location to store file handle for read side * of pipe. */ TclFile *writePipe) /* Location to store file handle for write * side of pipe. */ { int pipeIds[2]; if (pipe(pipeIds) != 0) { return 0; } fcntl(pipeIds[0], F_SETFD, FD_CLOEXEC); fcntl(pipeIds[1], F_SETFD, FD_CLOEXEC); *readPipe = MakeFile(pipeIds[0]); *writePipe = MakeFile(pipeIds[1]); return 1; } /* *---------------------------------------------------------------------- * * TclpCloseFile -- * * Implements a mechanism to close a UNIX file. * * Results: * Returns 0 on success, or -1 on error, setting errno. * * Side effects: * The file is closed. * *---------------------------------------------------------------------- */ int TclpCloseFile( TclFile file) /* The file to close. */ { int fd = GetFd(file); /* * Refuse to close the fds for stdin, stdout and stderr. */ if ((fd == 0) || (fd == 1) || (fd == 2)) { return 0; } Tcl_DeleteFileHandler(fd); return close(fd); } /* *--------------------------------------------------------------------------- * * TclpCreateProcess -- * * Create a child process that has the specified files as its standard * input, output, and error. The child process runs asynchronously and * runs with the same environment variables as the creating process. * * The path is searched to find the specified executable. * * Results: * The return value is TCL_ERROR and an error message is left in the * interp's result if there was a problem creating the child process. * Otherwise, the return value is TCL_OK and *pidPtr is filled with the * process id of the child process. * * Side effects: * A process is created. * *--------------------------------------------------------------------------- */ int TclpCreateProcess( Tcl_Interp *interp, /* Interpreter in which to leave errors that * occurred when creating the child process. * Error messages from the child process * itself are sent to errorFile. */ size_t argc, /* Number of arguments in following array. */ const char **argv, /* Array of argument strings in UTF-8. * argv[0] contains the name of the executable * translated using Tcl_TranslateFileName * call). Additional arguments have not been * converted. */ TclFile inputFile, /* If non-NULL, gives the file to use as input * for the child process. If inputFile file is * not readable or is NULL, the child will * receive no standard input. */ TclFile outputFile, /* If non-NULL, gives the file that receives * output from the child process. If * outputFile file is not writable or is * NULL, output from the child will be * discarded. */ TclFile errorFile, /* If non-NULL, gives the file that receives * errors from the child process. If errorFile * file is not writable or is NULL, errors * from the child will be discarded. errorFile * may be the same as outputFile. */ Tcl_Pid *pidPtr) /* If this function is successful, pidPtr is * filled with the process id of the child * process. */ { TclFile errPipeIn, errPipeOut; ssize_t count; int status, fd; char errSpace[200 + TCL_INTEGER_SPACE]; Tcl_DString *volatile dsArray; char **volatile newArgv; int pid; size_t i; #if defined(HAVE_POSIX_SPAWNP) int childErrno; static int use_spawn = -1; #endif errPipeIn = NULL; errPipeOut = NULL; pid = -1; /* * Create a pipe that the child can use to return error information if * anything goes wrong. */ if (TclpCreatePipe(&errPipeIn, &errPipeOut) == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't create pipe: %s", Tcl_PosixError(interp))); goto error; } /* * We need to allocate and convert this before the fork so it is properly * deallocated later */ dsArray = (Tcl_DString *)TclStackAlloc(interp, argc * sizeof(Tcl_DString)); newArgv = (char **)TclStackAlloc(interp, (argc+1) * sizeof(char *)); newArgv[argc] = NULL; for (i = 0; i < argc; i++) { if (Tcl_UtfToExternalDStringEx(interp, NULL, argv[i], TCL_INDEX_NONE, 0, &dsArray[i], NULL) != TCL_OK) { while (i-- > 0) { Tcl_DStringFree(&dsArray[i]); } TclStackFree(interp, newArgv); TclStackFree(interp, dsArray); goto error; } newArgv[i] = Tcl_DStringValue(&dsArray[i]); } #if defined(HAVE_VFORK) || defined(HAVE_POSIX_SPAWNP) /* * After vfork(), do not call code in the child that changes global state, * because it is using the parent's memory space at that point and writes * might corrupt the parent: so ensure standard channels are initialized * in the parent, otherwise SetupStdFile() might initialize them in the * child. */ if (!inputFile) { Tcl_GetStdChannel(TCL_STDIN); } if (!outputFile) { Tcl_GetStdChannel(TCL_STDOUT); } if (!errorFile) { Tcl_GetStdChannel(TCL_STDERR); } #endif #ifdef HAVE_POSIX_SPAWNP #ifdef _CS_GNU_LIBC_VERSION if (use_spawn < 0) { char conf[32], *p; int major = 0, minor = 0; use_spawn = 0; memset(conf, 0, sizeof(conf)); confstr(_CS_GNU_LIBC_VERSION, conf, sizeof(conf)); p = strchr(conf, ' '); /* skip "glibc" */ if (p != NULL) { ++p; if (sscanf(p, "%d.%d", &major, &minor) > 1) { if ((major > 2) || ((major == 2) && (minor >= 24))) { use_spawn = 1; } } } } #endif status = -1; if (use_spawn) { posix_spawn_file_actions_t actions; posix_spawnattr_t attr; sigset_t sigs; posix_spawn_file_actions_init(&actions); posix_spawnattr_init(&attr); sigfillset(&sigs); sigdelset(&sigs, SIGKILL); sigdelset(&sigs, SIGSTOP); posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF #ifdef POSIX_SPAWN_USEVFORK | POSIX_SPAWN_USEVFORK #endif ); posix_spawnattr_setsigdefault(&attr, &sigs); posix_spawn_file_actions_adddup2(&actions, GetFd(inputFile), 0); posix_spawn_file_actions_adddup2(&actions, GetFd(outputFile), 1); posix_spawn_file_actions_adddup2(&actions, GetFd(errorFile), 2); status = posix_spawnp(&pid, newArgv[0], &actions, &attr, newArgv, environ); childErrno = errno; posix_spawn_file_actions_destroy(&actions); posix_spawnattr_destroy(&attr); /* * Fork semantics: * - pid == 0: child process * - pid == -1: error * - pid > 0: parent process * * Mimic fork semantics to minimize changes below, * but retry with fork() as last ressort. */ } if (status != 0) { pid = fork(); childErrno = errno; } #else pid = fork(); #endif if (pid == 0) { size_t len; int joinThisError = errorFile && (errorFile == outputFile); fd = GetFd(errPipeOut); /* * Set up stdio file handles for the child process. */ if (!SetupStdFile(inputFile, TCL_STDIN) || !SetupStdFile(outputFile, TCL_STDOUT) || (!joinThisError && !SetupStdFile(errorFile, TCL_STDERR)) || (joinThisError && ((dup2(1,2) == -1) || (fcntl(2, F_SETFD, 0) != 0)))) { snprintf(errSpace, sizeof(errSpace), "%dforked process couldn't set up input/output", errno); len = strlen(errSpace); if (len != (size_t) write(fd, errSpace, len)) { Tcl_Panic("TclpCreateProcess: unable to write to errPipeOut"); } _exit(1); } /* * Close the input side of the error pipe. */ RestoreSignals(); execvp(newArgv[0], newArgv); /* INTL: Native. */ snprintf(errSpace, sizeof(errSpace), "%dcouldn't execute \"%.150s\"", errno, argv[0]); len = strlen(errSpace); if (len != (size_t) write(fd, errSpace, len)) { Tcl_Panic("TclpCreateProcess: unable to write to errPipeOut"); } _exit(1); } /* * Free the mem we used for the fork */ for (i = 0; i < argc; i++) { Tcl_DStringFree(&dsArray[i]); } TclStackFree(interp, newArgv); TclStackFree(interp, dsArray); if (pid == -1) { #ifdef HAVE_POSIX_SPAWNP errno = childErrno; #endif Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't fork child process: %s", Tcl_PosixError(interp))); goto error; } /* * Read back from the error pipe to see if the child started up OK. The * info in the pipe (if any) consists of a decimal errno value followed by * an error message. */ TclpCloseFile(errPipeOut); errPipeOut = NULL; fd = GetFd(errPipeIn); count = read(fd, errSpace, sizeof(errSpace) - 1); if (count > 0) { char *end; errSpace[count] = 0; errno = (int)strtol(errSpace, &end, 10); Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s: %s", end, Tcl_PosixError(interp))); goto error; } TclpCloseFile(errPipeIn); *pidPtr = (Tcl_Pid)INT2PTR(pid); return TCL_OK; error: if (pid != -1) { /* * Reap the child process now if an error occurred during its startup. * We don't call this with WNOHANG because that can lead to defunct * processes on an MP system. We shouldn't have to worry about hanging * here, since this is the error case. [Bug: 6148] */ Tcl_WaitPid((Tcl_Pid)INT2PTR(pid), &status, 0); } if (errPipeIn) { TclpCloseFile(errPipeIn); } if (errPipeOut) { TclpCloseFile(errPipeOut); } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * RestoreSignals -- * * This function is invoked in a forked child process just before * exec-ing a new program to restore all signals to their default * settings. * * Results: * None. * * Side effects: * Signal settings get changed. * *---------------------------------------------------------------------- */ static void RestoreSignals(void) { #ifdef SIGABRT signal(SIGABRT, SIG_DFL); #endif #ifdef SIGALRM signal(SIGALRM, SIG_DFL); #endif #ifdef SIGFPE signal(SIGFPE, SIG_DFL); #endif #ifdef SIGHUP signal(SIGHUP, SIG_DFL); #endif #ifdef SIGILL signal(SIGILL, SIG_DFL); #endif #ifdef SIGINT signal(SIGINT, SIG_DFL); #endif #ifdef SIGPIPE signal(SIGPIPE, SIG_DFL); #endif #ifdef SIGQUIT signal(SIGQUIT, SIG_DFL); #endif #ifdef SIGSEGV signal(SIGSEGV, SIG_DFL); #endif #ifdef SIGTERM signal(SIGTERM, SIG_DFL); #endif #ifdef SIGUSR1 signal(SIGUSR1, SIG_DFL); #endif #ifdef SIGUSR2 signal(SIGUSR2, SIG_DFL); #endif #ifdef SIGCHLD signal(SIGCHLD, SIG_DFL); #endif #ifdef SIGCONT signal(SIGCONT, SIG_DFL); #endif #ifdef SIGTSTP signal(SIGTSTP, SIG_DFL); #endif #ifdef SIGTTIN signal(SIGTTIN, SIG_DFL); #endif #ifdef SIGTTOU signal(SIGTTOU, SIG_DFL); #endif } /* *---------------------------------------------------------------------- * * SetupStdFile -- * * Set up stdio file handles for the child process, using the current * standard channels if no other files are specified. If no standard * channel is defined, or if no file is associated with the channel, then * the corresponding standard fd is closed. * * Results: * Returns 1 on success, or 0 on failure. * * Side effects: * Replaces stdio fds. * *---------------------------------------------------------------------- */ static int SetupStdFile( TclFile file, /* File to dup, or NULL. */ int type) /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR */ { Tcl_Channel channel; int fd; int targetFd = 0; /* Initializations here needed only to */ int direction = 0; /* prevent warnings about using uninitialized * variables. */ switch (type) { case TCL_STDIN: targetFd = 0; direction = TCL_READABLE; break; case TCL_STDOUT: targetFd = 1; direction = TCL_WRITABLE; break; case TCL_STDERR: targetFd = 2; direction = TCL_WRITABLE; break; } if (!file) { channel = Tcl_GetStdChannel(type); if (channel) { file = TclpMakeFile(channel, direction); } } if (file) { fd = GetFd(file); if (fd != targetFd) { if (dup2(fd, targetFd) == -1) { return 0; } /* * Must clear the close-on-exec flag for the target FD, since some * systems (e.g. Ultrix) do not clear the CLOEXEC flag on the * target FD. */ fcntl(targetFd, F_SETFD, 0); } else { /* * Since we aren't dup'ing the file, we need to explicitly clear * the close-on-exec flag. */ fcntl(fd, F_SETFD, 0); } } else { close(targetFd); } return 1; } /* *---------------------------------------------------------------------- * * TclpCreateCommandChannel -- * * This function is called by the generic IO level to perform the * platform specific channel initialization for a command channel. * * Results: * Returns a new channel or NULL on failure. * * Side effects: * Allocates a new channel. * *---------------------------------------------------------------------- */ Tcl_Channel TclpCreateCommandChannel( TclFile readFile, /* If non-null, gives the file for reading. */ TclFile writeFile, /* If non-null, gives the file for writing. */ TclFile errorFile, /* If non-null, gives the file where errors * can be read. */ size_t numPids, /* The number of pids in the pid array. */ Tcl_Pid *pidPtr) /* An array of process identifiers. Allocated * by the caller, freed when the channel is * closed or the processes are detached (in a * background exec). */ { char channelName[16 + TCL_INTEGER_SPACE]; int fd; PipeState *statePtr = (PipeState *)Tcl_Alloc(sizeof(PipeState)); int mode; statePtr->inFile = readFile; statePtr->outFile = writeFile; statePtr->errorFile = errorFile; statePtr->numPids = numPids; statePtr->pidPtr = pidPtr; statePtr->isNonBlocking = 0; mode = 0; if (readFile) { mode |= TCL_READABLE; } if (writeFile) { mode |= TCL_WRITABLE; } /* * Use one of the fds associated with the channel as the channel id. */ if (readFile) { fd = GetFd(readFile); } else if (writeFile) { fd = GetFd(writeFile); } else if (errorFile) { fd = GetFd(errorFile); } else { fd = 0; } /* * For backward compatibility with previous versions of Tcl, we use * "file%d" as the base name for pipes even though it would be more * natural to use "pipe%d". */ snprintf(channelName, sizeof(channelName), "file%d", fd); statePtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, statePtr, mode); return statePtr->channel; } /* *---------------------------------------------------------------------- * * Tcl_CreatePipe -- * * System dependent interface to create a pipe for the [chan pipe] * command. Stolen from TclX. * * Results: * TCL_OK or TCL_ERROR. * * Side effects: * Registers two channels. * *---------------------------------------------------------------------- */ int Tcl_CreatePipe( Tcl_Interp *interp, /* Errors returned in result. */ Tcl_Channel *rchan, /* Returned read side. */ Tcl_Channel *wchan, /* Returned write side. */ TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */ { int fileNums[2]; if (pipe(fileNums) < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("pipe creation failed: %s", Tcl_PosixError(interp))); return TCL_ERROR; } fcntl(fileNums[0], F_SETFD, FD_CLOEXEC); fcntl(fileNums[1], F_SETFD, FD_CLOEXEC); *rchan = Tcl_MakeFileChannel(INT2PTR(fileNums[0]), TCL_READABLE); Tcl_RegisterChannel(interp, *rchan); *wchan = Tcl_MakeFileChannel(INT2PTR(fileNums[1]), TCL_WRITABLE); Tcl_RegisterChannel(interp, *wchan); return TCL_OK; } /* *---------------------------------------------------------------------- * * TclGetAndDetachPids -- * * This function is invoked in the generic implementation of a * background "exec" (an exec when invoked with a terminating "&") to * store a list of the PIDs for processes in a command pipeline in the * interp's result and to detach the processes. * * Results: * None. * * Side effects: * Modifies the interp's result. Detaches processes. * *---------------------------------------------------------------------- */ void TclGetAndDetachPids( Tcl_Interp *interp, /* Interpreter to append the PIDs to. */ Tcl_Channel chan) /* Handle for the pipeline. */ { PipeState *pipePtr; const Tcl_ChannelType *chanTypePtr; Tcl_Obj *pidsObj; size_t i; /* * Punt if the channel is not a command channel. */ chanTypePtr = Tcl_GetChannelType(chan); if (chanTypePtr != &pipeChannelType) { return; } pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan); TclNewObj(pidsObj); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewWideIntObj( PTR2INT(pipePtr->pidPtr[i]))); Tcl_DetachPids(1, &pipePtr->pidPtr[i]); } Tcl_SetObjResult(interp, pidsObj); if (pipePtr->numPids > 0) { Tcl_Free(pipePtr->pidPtr); pipePtr->numPids = 0; } } /* *---------------------------------------------------------------------- * * PipeBlockModeProc -- * * Helper function to set blocking and nonblocking modes on a pipe based * channel. Invoked by generic IO level code. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int PipeBlockModeProc( void *instanceData, /* Pipe state. */ int mode) /* The mode to set. Can be one of * TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { PipeState *psPtr = (PipeState *)instanceData; if (psPtr->inFile && TclUnixSetBlockingMode(GetFd(psPtr->inFile), mode) < 0) { return errno; } if (psPtr->outFile && TclUnixSetBlockingMode(GetFd(psPtr->outFile), mode) < 0) { return errno; } psPtr->isNonBlocking = (mode == TCL_MODE_NONBLOCKING); return 0; } /* *---------------------------------------------------------------------- * * PipeClose2Proc * * This function is invoked by the generic IO level to perform * pipeline-type-specific half or full-close. * * Results: * 0 on success, errno otherwise. * * Side effects: * Closes the command pipeline channel. * *---------------------------------------------------------------------- */ static int PipeClose2Proc( void *instanceData, /* The pipe to close. */ Tcl_Interp *interp, /* For error reporting. */ int flags) /* Flags that indicate which side to close. */ { PipeState *pipePtr = (PipeState *)instanceData; Tcl_Channel errChan; int errorCode, result; errorCode = 0; result = 0; if (((!flags) || (flags & TCL_CLOSE_READ)) && (pipePtr->inFile != NULL)) { if (TclpCloseFile(pipePtr->inFile) < 0) { errorCode = errno; } else { pipePtr->inFile = NULL; } } if (((!flags) || (flags & TCL_CLOSE_WRITE)) && (pipePtr->outFile != NULL) && (errorCode == 0)) { if (TclpCloseFile(pipePtr->outFile) < 0) { errorCode = errno; } else { pipePtr->outFile = NULL; } } /* * If half-closing, stop here. */ if (flags) { return errorCode; } if (pipePtr->isNonBlocking || TclInExit()) { /* * If the channel is non-blocking or Tcl is being cleaned up, just * detach the children PIDs, reap them (important if we are in a * dynamic load module), and discard the errorFile. */ Tcl_DetachPids(pipePtr->numPids, pipePtr->pidPtr); Tcl_ReapDetachedProcs(); if (pipePtr->errorFile) { TclpCloseFile(pipePtr->errorFile); } } else { /* * Wrap the error file into a channel and give it to the cleanup * routine. */ if (pipePtr->errorFile) { errChan = Tcl_MakeFileChannel( INT2PTR(GetFd(pipePtr->errorFile)), TCL_READABLE); /* Error channels should not raise encoding errors */ Tcl_SetChannelOption(NULL, errChan, "-profile", "replace"); } else { errChan = NULL; } result = TclCleanupChildren(interp, pipePtr->numPids, pipePtr->pidPtr, errChan); } if (pipePtr->numPids != 0) { Tcl_Free(pipePtr->pidPtr); } Tcl_Free(pipePtr); if (errorCode == 0) { return result; } return errorCode; } /* *---------------------------------------------------------------------- * * PipeInputProc -- * * This function is invoked from the generic IO level to read input from * a command pipeline based channel. * * Results: * The number of bytes read is returned or -1 on error. An output * argument contains a POSIX error code if an error occurs, or zero. * * Side effects: * Reads input from the input device of the channel. * *---------------------------------------------------------------------- */ static int PipeInputProc( void *instanceData, /* Pipe state. */ char *buf, /* Where to store data read. */ int toRead, /* How much space is available in the * buffer? */ int *errorCodePtr) /* Where to store error code. */ { PipeState *psPtr = (PipeState *)instanceData; ssize_t bytesRead; /* How many bytes were actually read from the * input device? */ *errorCodePtr = 0; /* * Assume there is always enough input available. This will block * appropriately, and read will unblock as soon as a short read is * possible, if the channel is in blocking mode. If the channel is * nonblocking, the read will never block. Some OSes can throw an * interrupt error, for which we should immediately retry. [Bug #415131] */ do { bytesRead = read(GetFd(psPtr->inFile), buf, toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { *errorCodePtr = errno; return -1; } return (int)bytesRead; } /* *---------------------------------------------------------------------- * * PipeOutputProc-- * * This function is invoked from the generic IO level to write output to * a command pipeline based channel. * * Results: * The number of bytes written is returned or -1 on error. An output * argument contains a POSIX error code if an error occurred, or zero. * * Side effects: * Writes output on the output device of the channel. * *---------------------------------------------------------------------- */ static int PipeOutputProc( void *instanceData, /* Pipe state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { PipeState *psPtr = (PipeState *)instanceData; ssize_t written; *errorCodePtr = 0; /* * Some OSes can throw an interrupt error, for which we should immediately * retry. [Bug #415131] */ do { written = write(GetFd(psPtr->outFile), buf, toWrite); } while ((written < 0) && (errno == EINTR)); if (written < 0) { *errorCodePtr = errno; return -1; } return (int)written; } /* *---------------------------------------------------------------------- * * PipeWatchProc -- * * Initialize the notifier to watch the fds from this channel. * * Results: * None. * * Side effects: * Sets up the notifier so that a future event on the channel will be * seen by Tcl. * *---------------------------------------------------------------------- */ /* * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc, * so do not pass it to directly to Tcl_CreateFileHandler. * Instead, pass a wrapper which is a Tcl_FileProc. */ static void PipeWatchNotifyChannelWrapper( void *clientData, int mask) { Tcl_Channel channel = (Tcl_Channel)clientData; Tcl_NotifyChannel(channel, mask); } static void PipeWatchProc( void *instanceData, /* The pipe state. */ int mask) /* Events of interest; an OR-ed combination of * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { PipeState *psPtr = (PipeState *)instanceData; int newmask; if (psPtr->inFile) { newmask = mask & (TCL_READABLE | TCL_EXCEPTION); if (newmask) { Tcl_CreateFileHandler(GetFd(psPtr->inFile), newmask, PipeWatchNotifyChannelWrapper, psPtr->channel); } else { Tcl_DeleteFileHandler(GetFd(psPtr->inFile)); } } if (psPtr->outFile) { newmask = mask & (TCL_WRITABLE | TCL_EXCEPTION); if (newmask) { Tcl_CreateFileHandler(GetFd(psPtr->outFile), newmask, PipeWatchNotifyChannelWrapper, psPtr->channel); } else { Tcl_DeleteFileHandler(GetFd(psPtr->outFile)); } } } /* *---------------------------------------------------------------------- * * PipeGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from inside a * command pipeline based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int PipeGetHandleProc( void *instanceData, /* The pipe state. */ int direction, /* TCL_READABLE or TCL_WRITABLE */ void **handlePtr) /* Where to store the handle. */ { PipeState *psPtr = (PipeState *)instanceData; if (direction == TCL_READABLE && psPtr->inFile) { *handlePtr = INT2PTR(GetFd(psPtr->inFile)); return TCL_OK; } if (direction == TCL_WRITABLE && psPtr->outFile) { *handlePtr = INT2PTR(GetFd(psPtr->outFile)); return TCL_OK; } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * Tcl_WaitPid -- * * Implements the waitpid system call on Unix systems. * * Results: * Result of calling waitpid. * * Side effects: * Waits for a process to terminate. * *---------------------------------------------------------------------- */ Tcl_Pid Tcl_WaitPid( Tcl_Pid pid, int *statPtr, int options) { int result; pid_t real_pid = (pid_t) PTR2INT(pid); while (1) { result = (int) waitpid(real_pid, statPtr, options); if ((result != -1) || (errno != EINTR)) { return (Tcl_Pid)INT2PTR(result); } } } /* *---------------------------------------------------------------------- * * Tcl_PidObjCmd -- * * This function is invoked to process the "pid" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ int Tcl_PidObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const *objv) /* Argument strings. */ { Tcl_Channel chan; PipeState *pipePtr; size_t i; Tcl_Obj *resultPtr; if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?channel?"); return TCL_ERROR; } if (objc == 1) { Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid())); } else { /* * Get the channel and make sure that it refers to a pipe. */ chan = Tcl_GetChannel(interp, TclGetString(objv[1]), NULL); if (chan == NULL) { return TCL_ERROR; } if (Tcl_GetChannelType(chan) != &pipeChannelType) { return TCL_OK; } /* * Extract the process IDs from the pipe structure. */ pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan); TclNewObj(resultPtr); for (i = 0; i < pipePtr->numPids; i++) { Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewWideIntObj(TclpGetPid(pipePtr->pidPtr[i]))); } Tcl_SetObjResult(interp, resultPtr); } return TCL_OK; } /* *---------------------------------------------------------------------- * * TclpFinalizePipes -- * * Cleans up the pipe subsystem from Tcl_FinalizeThread * * Results: * None. * * Notes: * This function carries out no operation on Unix. * *---------------------------------------------------------------------- */ void TclpFinalizePipes(void) { } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixNotfy.c0000644000175000017500000004131315104661341015346 0ustar sergeisergei/* * tclUnixNotfy.c -- * * This file contains subroutines shared by all notifier backend * implementations on *nix platforms. It is *included* by the epoll, * kqueue and select notifier implementation files. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 2016 Lucio Andrés Illanes Albornoz * Copyright © 2021 Donal K. Fellows * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include #include "tclInt.h" /* * Static routines defined in this file. */ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); #if !TCL_THREADS # undef NOTIFIER_EPOLL # undef NOTIFIER_KQUEUE # define NOTIFIER_SELECT #elif !defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE) # define NOTIFIER_SELECT static TCL_NORETURN void NotifierThreadProc(void *clientData); # if defined(HAVE_PTHREAD_ATFORK) static void AtForkChild(void); # endif /* HAVE_PTHREAD_ATFORK */ /* *---------------------------------------------------------------------- * * StartNotifierThread -- * * Start a notifier thread and wait for the notifier pipe to be created. * * Results: * None. * * Side effects: * Running Thread. * *---------------------------------------------------------------------- */ static void StartNotifierThread( const char *proc) { if (!notifierThreadRunning) { pthread_mutex_lock(¬ifierInitMutex); if (!notifierThreadRunning) { if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL, TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) { Tcl_Panic("%s: unable to start notifier thread", proc); } pthread_mutex_lock(¬ifierMutex); /* * Wait for the notifier pipe to be created. */ while (triggerPipe < 0) { pthread_cond_wait(¬ifierCV, ¬ifierMutex); } pthread_mutex_unlock(¬ifierMutex); notifierThreadRunning = 1; } pthread_mutex_unlock(¬ifierInitMutex); } } #endif /* NOTIFIER_SELECT */ /* *---------------------------------------------------------------------- * * TclpAlertNotifier -- * * Wake up the specified notifier from any thread. This routine is called * by the platform independent notifier code whenever the Tcl_ThreadAlert * routine is called. This routine is guaranteed not to be called on a * given notifier after Tcl_FinalizeNotifier is called for that notifier. * * Results: * None. * * Side effects: * select(2) notifier: * signals the notifier condition variable for the specified * notifier. * epoll(7) notifier: * write(2)s to the eventfd(2) of the specified thread. * kqueue(2) notifier: * write(2)s to the trigger pipe(2) of the specified thread. * *---------------------------------------------------------------------- */ void TclpAlertNotifier( void *clientData) { #ifdef NOTIFIER_SELECT #if TCL_THREADS ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; pthread_mutex_lock(¬ifierMutex); tsdPtr->eventReady = 1; # ifdef __CYGWIN__ PostMessageW(tsdPtr->hwnd, 1024, 0, 0); # else pthread_cond_broadcast(&tsdPtr->waitCV); # endif /* __CYGWIN__ */ pthread_mutex_unlock(¬ifierMutex); #else (void)clientData; #endif /* TCL_THREADS */ #else /* !NOTIFIER_SELECT */ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; #if defined(NOTIFIER_EPOLL) && defined(HAVE_EVENTFD) uint64_t eventFdVal = 1; if (write(tsdPtr->triggerEventFd, &eventFdVal, sizeof(eventFdVal)) != sizeof(eventFdVal)) { Tcl_Panic("Tcl_AlertNotifier: unable to write to %p->triggerEventFd", tsdPtr); } #else if (write(tsdPtr->triggerPipe[1], "", 1) != 1) { Tcl_Panic("Tcl_AlertNotifier: unable to write to %p->triggerPipe", tsdPtr); } #endif /* NOTIFIER_EPOLL && HAVE_EVENTFD */ #endif /* NOTIFIER_SELECT */ } /* *---------------------------------------------------------------------- * * LookUpFileHandler -- * * Look up the file handler structure (and optionally the previous one in * the chain) associated with a file descriptor. * * Returns: * A pointer to the file handler, or NULL if it can't be found. * * Side effects: * If prevPtrPtr is non-NULL, it will be written to if the file handler * is found. * *---------------------------------------------------------------------- */ static inline FileHandler * LookUpFileHandler( ThreadSpecificData *tsdPtr, /* Where to look things up. */ int fd, /* What we are looking for. */ FileHandler **prevPtrPtr) /* If non-NULL, where to report the previous * pointer. */ { FileHandler *filePtr, *prevPtr; /* * Find the entry for the given file (and return if there isn't one). */ for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ; prevPtr = filePtr, filePtr = filePtr->nextPtr) { if (filePtr == NULL) { return NULL; } if (filePtr->fd == fd) { break; } } /* * Report what we've found to our caller. */ if (prevPtrPtr) { *prevPtrPtr = prevPtr; } return filePtr; } /* *---------------------------------------------------------------------- * * TclpSetTimer -- * * This function sets the current notifier timer value. This interface is * not implemented in this notifier because we are always running inside * of Tcl_DoOneEvent. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void TclpSetTimer( TCL_UNUSED(const Tcl_Time *)) /* Timeout value, may be NULL. */ { /* * The interval timer doesn't do anything in this implementation, because * the only event loop is via Tcl_DoOneEvent, which passes timeout values * to Tcl_WaitForEvent. */ } /* *---------------------------------------------------------------------- * * Tcl_ServiceModeHook -- * * This function is invoked whenever the service mode changes. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void TclpServiceModeHook( int mode) /* Either TCL_SERVICE_ALL, or * TCL_SERVICE_NONE. */ { if (mode == TCL_SERVICE_ALL) { #ifdef NOTIFIER_SELECT #if TCL_THREADS StartNotifierThread("Tcl_ServiceModeHook"); #endif #endif /* NOTIFIER_SELECT */ } } /* *---------------------------------------------------------------------- * * FileHandlerEventProc -- * * This function is called by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This function is responsible for * actually handling the event by invoking the callback for the file * handler. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the file handler's callback function does. * *---------------------------------------------------------------------- */ static int FileHandlerEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { int mask; FileHandler *filePtr; FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr; ThreadSpecificData *tsdPtr; if (!(flags & TCL_FILE_EVENTS)) { return 0; } /* * Search through the file handlers to find the one whose handle matches * the event. We do this rather than keeping a pointer to the file handler * directly in the event, so that the handler can be deleted while the * event is queued without leaving a dangling pointer. */ tsdPtr = TCL_TSD_INIT(&dataKey); for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL; filePtr = filePtr->nextPtr) { if (filePtr->fd != fileEvPtr->fd) { continue; } /* * The code is tricky for two reasons: * 1. The file handler's desired events could have changed since the * time when the event was queued, so AND the ready mask with the * desired mask. * 2. The file could have been closed and re-opened since the time * when the event was queued. This is why the ready mask is stored * in the file handler rather than the queued event: it will be * zeroed when a new file handler is created for the newly opened * file. */ mask = filePtr->readyMask & filePtr->mask; filePtr->readyMask = 0; if (mask != 0) { filePtr->proc(filePtr->clientData, mask); } break; } return 1; } #ifdef NOTIFIER_SELECT #if TCL_THREADS /* *---------------------------------------------------------------------- * * AlertSingleThread -- * * Notify a single thread that is waiting on a file descriptor to become * readable or writable or to have an exception condition. * notifierMutex must be held. * * Result: * None. * * Side effects: * The condition variable associated with the thread is broadcasted. * *---------------------------------------------------------------------- */ static void AlertSingleThread( ThreadSpecificData *tsdPtr) { tsdPtr->eventReady = 1; if (tsdPtr->onList) { /* * Remove the ThreadSpecificData structure of this thread from the * waiting list. This prevents us from continuously spinning on * epoll_wait until the other threads runs and services the file * event. */ if (tsdPtr->prevPtr) { tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr; } else { waitingListPtr = tsdPtr->nextPtr; } if (tsdPtr->nextPtr) { tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr; } tsdPtr->nextPtr = tsdPtr->prevPtr = NULL; tsdPtr->onList = 0; tsdPtr->pollState = 0; } #ifdef __CYGWIN__ PostMessageW(tsdPtr->hwnd, 1024, 0, 0); #else /* !__CYGWIN__ */ pthread_cond_broadcast(&tsdPtr->waitCV); #endif /* __CYGWIN__ */ } #if defined(HAVE_PTHREAD_ATFORK) /* *---------------------------------------------------------------------- * * AtForkChild -- * * Unlock and reinstall the notifier in the child after a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkChild(void) { if (notifierThreadRunning == 1) { pthread_cond_destroy(¬ifierCV); } pthread_mutex_init(¬ifierInitMutex, NULL); pthread_mutex_init(¬ifierMutex, NULL); pthread_cond_init(¬ifierCV, NULL); #ifdef NOTIFIER_SELECT asyncPending = 0; #endif /* * notifierThreadRunning == 1: thread is running, (there might be data in * notifier lists) * atForkInit == 0: InitNotifier was never called * notifierCount != 0: unbalanced InitNotifier() / FinalizeNotifier calls * waitingListPtr != 0: there are threads currently waiting for events. */ if (atForkInit == 1) { notifierCount = 0; if (notifierThreadRunning == 1) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); notifierThreadRunning = 0; close(triggerPipe); triggerPipe = -1; #ifdef NOTIFIER_SELECT close(otherPipe); otherPipe = -1; #endif /* * The waitingListPtr might contain event info from multiple * threads, which are invalid here, so setting it to NULL is not * unreasonable. */ waitingListPtr = NULL; /* * The tsdPtr from before the fork is copied as well. But since we * are paranoiac, we don't trust its condvar and reset it. */ #ifdef __CYGWIN__ DestroyWindow(tsdPtr->hwnd); tsdPtr->hwnd = CreateWindowExW(NULL, className, className, 0, 0, 0, 0, 0, NULL, NULL, TclWinGetTclInstance(), NULL); ResetEvent(tsdPtr->event); #else /* !__CYGWIN__ */ pthread_cond_destroy(&tsdPtr->waitCV); pthread_cond_init(&tsdPtr->waitCV, NULL); #endif /* __CYGWIN__ */ /* * In case, we had multiple threads running before the fork, * make sure, we don't try to reach out to their thread local data. */ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL; /* * The list of registered event handlers at fork time is in * tsdPtr->firstFileHandlerPtr; */ } } Tcl_InitNotifier(); #ifdef NOTIFIER_SELECT /* * Restart the notifier thread for signal handling. */ StartNotifierThread("AtForkChild"); #endif } #endif /* HAVE_PTHREAD_ATFORK */ #endif /* TCL_THREADS */ #endif /* NOTIFIER_SELECT */ /* *---------------------------------------------------------------------- * * TclpNotifierData -- * * This function returns a void pointer to be associated * with a Tcl_AsyncHandler. * * Results: * For the epoll and kqueue notifiers, this function returns the * thread specific data. Otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpNotifierData(void) { #if defined(NOTIFIER_EPOLL) || defined(NOTIFIER_KQUEUE) ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); return tsdPtr; #else return NULL; #endif } /* *---------------------------------------------------------------------- * * TclUnixWaitForFile -- * * This function waits synchronously for a file to become readable or * writable, with an optional timeout. * * Results: * The return value is an OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION, indicating the conditions that are * present on file at the time of the return. This function will not * return until either "timeout" milliseconds have elapsed or at least * one of the conditions given by mask has occurred for file (a return * value of 0 means that a timeout occurred). No normal events will be * serviced during the execution of this function. * * Side effects: * Time passes. * *---------------------------------------------------------------------- */ #ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is * in tclMacOSXNotify.c */ int TclUnixWaitForFile( int fd, /* Handle for file on which to wait. */ int mask, /* What to wait for: OR'ed combination of * TCL_READABLE, TCL_WRITABLE, and * TCL_EXCEPTION. */ int timeout) /* Maximum amount of time to wait for one of * the conditions in mask to occur, in * milliseconds. A value of 0 means don't wait * at all, and a value of -1 means wait * forever. */ { Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */ struct timeval blockTime, *timeoutPtr; struct pollfd pollFds[1]; int numFound, result = 0, pollTimeout; /* * If there is a non-zero finite timeout, compute the time when we give * up. */ if (timeout > 0) { Tcl_GetTime(&now); abortTime.sec = now.sec + timeout / 1000; abortTime.usec = now.usec + (timeout % 1000) * 1000; if (abortTime.usec >= 1000000) { abortTime.usec -= 1000000; abortTime.sec += 1; } timeoutPtr = &blockTime; } else if (timeout == 0) { timeoutPtr = &blockTime; blockTime.tv_sec = 0; blockTime.tv_usec = 0; } else { timeoutPtr = NULL; } /* * Setup the pollfd structure for the fd. */ pollFds[0].fd = fd; pollFds[0].events = pollFds[0].revents = 0; if (mask & TCL_READABLE) { pollFds[0].events |= (POLLIN | POLLHUP); } if (mask & TCL_WRITABLE) { pollFds[0].events |= POLLOUT; } if (mask & TCL_EXCEPTION) { pollFds[0].events |= POLLERR; } /* * Loop in a mini-event loop of our own, waiting for either the file to * become ready or a timeout to occur. */ do { if (timeout > 0) { blockTime.tv_sec = abortTime.sec - now.sec; blockTime.tv_usec = abortTime.usec - now.usec; if (blockTime.tv_usec < 0) { blockTime.tv_sec -= 1; blockTime.tv_usec += 1000000; } if (blockTime.tv_sec < 0) { blockTime.tv_sec = 0; blockTime.tv_usec = 0; } } /* * Wait for the event or a timeout. */ if (!timeoutPtr) { pollTimeout = -1; } else if (!timeoutPtr->tv_sec && !timeoutPtr->tv_usec) { pollTimeout = 0; } else { pollTimeout = (int) timeoutPtr->tv_sec * 1000; if (timeoutPtr->tv_usec) { pollTimeout += (int) timeoutPtr->tv_usec / 1000; } } numFound = poll(pollFds, 1, pollTimeout); if (numFound == 1) { result = 0; if (pollFds[0].revents & (POLLIN | POLLHUP)) { result |= TCL_READABLE; } if (pollFds[0].revents & POLLOUT) { result |= TCL_WRITABLE; } if (pollFds[0].revents & POLLERR) { result |= TCL_EXCEPTION; } if (result) { break; } } if (timeout == 0) { break; } if (timeout < 0) { continue; } /* * The select returned early, so we need to recompute the timeout. */ Tcl_GetTime(&now); } while ((abortTime.sec > now.sec) || (abortTime.sec == now.sec && abortTime.usec > now.usec)); return result; } #endif /* !HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixInit.c0000644000175000017500000007201415104661341015154 0ustar sergeisergei/* * tclUnixInit.c -- * * Contains the Unix-specific interpreter initialization functions. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 1999 Scriptics Corporation. * All rights reserved. */ #include "tclInt.h" #ifdef HAVE_LANGINFO # include #endif #include #if defined(__FreeBSD__) && defined(__GNUC__) # include #endif #if defined(__bsdi__) # include # if _BSDI_VERSION > 199501 # include # endif #endif #ifdef __CYGWIN__ #ifdef __cplusplus extern "C" { #endif DLLIMPORT extern unsigned char GetVersionExW(void *); DLLIMPORT extern void *GetModuleHandleW(const void *); DLLIMPORT extern void FreeLibrary(void *); DLLIMPORT extern void *GetProcAddress(void *, const char *); DLLIMPORT extern void GetSystemInfo(void *); #ifdef __cplusplus } #endif #define NUMPROCESSORS 15 static const char *const processors[NUMPROCESSORS] = { "i686", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", "x86_64", "ia32_on_win64", "neutral", "arm64", "arm32_on_win64", "ia32_on_arm64" }; typedef struct { union { unsigned int dwOemId; struct { int wProcessorArchitecture; int wReserved; }; }; unsigned int dwPageSize; void *lpMinimumApplicationAddress; void *lpMaximumApplicationAddress; void *dwActiveProcessorMask; unsigned int dwNumberOfProcessors; unsigned int dwProcessorType; unsigned int dwAllocationGranularity; int wProcessorLevel; int wProcessorRevision; } SYSTEM_INFO; typedef struct { unsigned int dwOSVersionInfoSize; unsigned int dwMajorVersion; unsigned int dwMinorVersion; unsigned int dwBuildNumber; unsigned int dwPlatformId; WCHAR szCSDVersion[128]; } OSVERSIONINFOW; #endif #ifdef HAVE_COREFOUNDATION #include #endif /* * Tcl tries to use standard and homebrew methods to guess the right encoding * on the platform. However, there is always a final fallback, and this value * is it. Make sure it is a real Tcl encoding. */ #ifndef TCL_DEFAULT_ENCODING #define TCL_DEFAULT_ENCODING "utf-8" #endif /* * Default directory in which to look for Tcl library scripts. The symbol is * defined by Makefile. */ static const char defaultLibraryDir[] = TCL_LIBRARY; /* * Directory in which to look for packages (each package is typically * installed as a subdirectory of this directory). The symbol is defined by * Makefile. */ static const char pkgPath[] = TCL_PACKAGE_PATH; /* * The following table is used to map from Unix locale strings to encoding * files. If HAVE_LANGINFO is defined, then this is a fallback table when the * result from nl_langinfo isn't a recognized encoding. Otherwise this is the * first list checked for a mapping from env encoding to Tcl encoding name. */ typedef struct { const char *lang; const char *encoding; } LocaleTable; /* * The table below is sorted for the sake of doing binary searches on it. The * indenting reflects different categories of data. The leftmost data * represent the encoding names directly implemented by data files in Tcl's * default encoding directory. Indented by one TAB are the encoding names that * are common alternative spellings. Indented by two TABs are the accumulated * "bug fixes" that have been added to deal with the wide variability seen * among existing platforms. */ static const LocaleTable localeTable[] = { {"", "iso8859-1"}, {"ansi-1251", "cp1251"}, {"ansi_x3.4-1968", "iso8859-1"}, {"ascii", "ascii"}, {"big5", "big5"}, {"cp1250", "cp1250"}, {"cp1251", "cp1251"}, {"cp1252", "cp1252"}, {"cp1253", "cp1253"}, {"cp1254", "cp1254"}, {"cp1255", "cp1255"}, {"cp1256", "cp1256"}, {"cp1257", "cp1257"}, {"cp1258", "cp1258"}, {"cp437", "cp437"}, {"cp737", "cp737"}, {"cp775", "cp775"}, {"cp850", "cp850"}, {"cp852", "cp852"}, {"cp855", "cp855"}, {"cp857", "cp857"}, {"cp860", "cp860"}, {"cp861", "cp861"}, {"cp862", "cp862"}, {"cp863", "cp863"}, {"cp864", "cp864"}, {"cp865", "cp865"}, {"cp866", "cp866"}, {"cp869", "cp869"}, {"cp874", "cp874"}, {"cp932", "cp932"}, {"cp936", "cp936"}, {"cp949", "cp949"}, {"cp950", "cp950"}, {"dingbats", "dingbats"}, {"ebcdic", "ebcdic"}, {"euc-cn", "euc-cn"}, {"euc-jp", "euc-jp"}, {"euc-kr", "euc-kr"}, {"eucjp", "euc-jp"}, {"euckr", "euc-kr"}, {"euctw", "euc-cn"}, {"gb12345", "gb12345"}, {"gb1988", "gb1988"}, {"gb2312", "gb2312"}, {"gb2312-1980", "gb2312"}, {"gb2312-raw", "gb2312-raw"}, {"greek8", "cp869"}, {"ibm1250", "cp1250"}, {"ibm1251", "cp1251"}, {"ibm1252", "cp1252"}, {"ibm1253", "cp1253"}, {"ibm1254", "cp1254"}, {"ibm1255", "cp1255"}, {"ibm1256", "cp1256"}, {"ibm1257", "cp1257"}, {"ibm1258", "cp1258"}, {"ibm437", "cp437"}, {"ibm737", "cp737"}, {"ibm775", "cp775"}, {"ibm850", "cp850"}, {"ibm852", "cp852"}, {"ibm855", "cp855"}, {"ibm857", "cp857"}, {"ibm860", "cp860"}, {"ibm861", "cp861"}, {"ibm862", "cp862"}, {"ibm863", "cp863"}, {"ibm864", "cp864"}, {"ibm865", "cp865"}, {"ibm866", "cp866"}, {"ibm869", "cp869"}, {"ibm874", "cp874"}, {"ibm932", "cp932"}, {"ibm936", "cp936"}, {"ibm949", "cp949"}, {"ibm950", "cp950"}, {"iso-2022", "iso2022"}, {"iso-2022-jp", "iso2022-jp"}, {"iso-2022-kr", "iso2022-kr"}, {"iso-8859-1", "iso8859-1"}, {"iso-8859-10", "iso8859-10"}, {"iso-8859-13", "iso8859-13"}, {"iso-8859-14", "iso8859-14"}, {"iso-8859-15", "iso8859-15"}, {"iso-8859-16", "iso8859-16"}, {"iso-8859-2", "iso8859-2"}, {"iso-8859-3", "iso8859-3"}, {"iso-8859-4", "iso8859-4"}, {"iso-8859-5", "iso8859-5"}, {"iso-8859-6", "iso8859-6"}, {"iso-8859-7", "iso8859-7"}, {"iso-8859-8", "iso8859-8"}, {"iso-8859-9", "iso8859-9"}, {"iso2022", "iso2022"}, {"iso2022-jp", "iso2022-jp"}, {"iso2022-kr", "iso2022-kr"}, {"iso8859-1", "iso8859-1"}, {"iso8859-10", "iso8859-10"}, {"iso8859-13", "iso8859-13"}, {"iso8859-14", "iso8859-14"}, {"iso8859-15", "iso8859-15"}, {"iso8859-16", "iso8859-16"}, {"iso8859-2", "iso8859-2"}, {"iso8859-3", "iso8859-3"}, {"iso8859-4", "iso8859-4"}, {"iso8859-5", "iso8859-5"}, {"iso8859-6", "iso8859-6"}, {"iso8859-7", "iso8859-7"}, {"iso8859-8", "iso8859-8"}, {"iso8859-9", "iso8859-9"}, {"iso88591", "iso8859-1"}, {"iso885915", "iso8859-15"}, {"iso88592", "iso8859-2"}, {"iso88595", "iso8859-5"}, {"iso88596", "iso8859-6"}, {"iso88597", "iso8859-7"}, {"iso88598", "iso8859-8"}, {"iso88599", "iso8859-9"}, #ifdef hpux {"ja", "shiftjis"}, #else {"ja", "euc-jp"}, #endif {"ja_jp", "euc-jp"}, {"ja_jp.euc", "euc-jp"}, {"ja_jp.eucjp", "euc-jp"}, {"ja_jp.jis", "iso2022-jp"}, {"ja_jp.mscode", "shiftjis"}, {"ja_jp.sjis", "shiftjis"}, {"ja_jp.ujis", "euc-jp"}, {"japan", "euc-jp"}, #ifdef hpux {"japanese", "shiftjis"}, #else {"japanese", "euc-jp"}, #endif {"japanese-sjis", "shiftjis"}, {"japanese-ujis", "euc-jp"}, {"japanese.euc", "euc-jp"}, {"japanese.sjis", "shiftjis"}, {"jis0201", "jis0201"}, {"jis0208", "jis0208"}, {"jis0212", "jis0212"}, {"jp_jp", "shiftjis"}, {"ko", "euc-kr"}, {"ko_kr", "euc-kr"}, {"ko_kr.euc", "euc-kr"}, {"ko_kw.euckw", "euc-kr"}, {"koi8-r", "koi8-r"}, {"koi8-u", "koi8-u"}, {"korean", "euc-kr"}, {"ksc5601", "ksc5601"}, {"maccenteuro", "macCentEuro"}, {"maccroatian", "macCroatian"}, {"maccyrillic", "macCyrillic"}, {"macdingbats", "macDingbats"}, {"macgreek", "macGreek"}, {"maciceland", "macIceland"}, {"macjapan", "macJapan"}, {"macroman", "macRoman"}, {"macromania", "macRomania"}, {"macthai", "macThai"}, {"macturkish", "macTurkish"}, {"macukraine", "macUkraine"}, {"roman8", "iso8859-1"}, {"ru", "iso8859-5"}, {"ru_ru", "iso8859-5"}, {"ru_su", "iso8859-5"}, {"shiftjis", "shiftjis"}, {"sjis", "shiftjis"}, {"symbol", "symbol"}, {"tis-620", "tis-620"}, {"tis620", "tis-620"}, {"turkish8", "cp857"}, {"utf8", "utf-8"}, {"zh", "cp936"}, {"zh_cn.gb2312", "euc-cn"}, {"zh_cn.gbk", "euc-cn"}, {"zh_cz.gb2312", "euc-cn"}, {"zh_tw", "euc-tw"}, {"zh_tw.big5", "big5"}, }; #ifdef HAVE_COREFOUNDATION static int MacOSXGetLibraryPath(Tcl_Interp *interp, int maxPathLen, char *tclLibPath); #endif /* HAVE_COREFOUNDATION */ /* *--------------------------------------------------------------------------- * * TclpInitPlatform -- * * Initialize all the platform-dependent things like signals and * floating-point error handling. * * Called at process initialization time. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void TclpInitPlatform(void) { #ifdef DJGPP tclPlatform = TCL_PLATFORM_WINDOWS; #else tclPlatform = TCL_PLATFORM_UNIX; #endif /* * Make sure, that the standard FDs exist. [Bug 772288] */ if (TclOSseek(0, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_RDONLY); } if (TclOSseek(1, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_WRONLY); } if (TclOSseek(2, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_WRONLY); } /* * The code below causes SIGPIPE (broken pipe) errors to be ignored. This * is needed so that Tcl processes don't die if they create child * processes (e.g. using "exec" or "open") that terminate prematurely. * The signal handler is only set up when the first interpreter is * created; after this the application can override the handler with a * different one of its own, if it wants. */ #ifdef SIGPIPE (void) signal(SIGPIPE, SIG_IGN); #endif /* SIGPIPE */ #if defined(__FreeBSD__) && defined(__GNUC__) (void) fpsetmask(0L); #endif #if defined(__bsdi__) && (_BSDI_VERSION > 199501) /* * Find local symbols. Don't report an error if we fail. */ (void) dlopen(NULL, RTLD_NOW); /* INTL: Native. */ #endif /* * Initialize the C library's locale subsystem. This is required for input * methods to work properly on X11. We only do this for LC_CTYPE because * that's the necessary one, and we don't want to affect LC_TIME here. * The side effect of setting the default locale should be to load any * locale specific modules that are needed by X. [BUG: 5422 3345 4236 2522 * 2521]. */ setlocale(LC_CTYPE, ""); /* * In case the initial locale is not "C", ensure that the numeric * processing is done in "C" locale regardless. This is needed because Tcl * relies on routines like strtol/strtoul, but should not have locale dependent * behavior. */ setlocale(LC_NUMERIC, "C"); } /* *--------------------------------------------------------------------------- * * TclpInitLibraryPath -- * * This is the fallback routine that sets the library path if the * application has not set one by the first time it is needed. * * Results: * None. * * Side effects: * Sets the library path to an initial value. * *------------------------------------------------------------------------- */ void TclpInitLibraryPath( char **valuePtr, size_t *lengthPtr, Tcl_Encoding *encodingPtr) { #define LIBRARY_SIZE 32 Tcl_Obj *pathPtr, *objPtr; const char *str; Tcl_DString buffer; TclNewObj(pathPtr); /* * Look for the library relative to the TCL_LIBRARY env variable. If the * last dirname in the TCL_LIBRARY path does not match the last dirname in * the installLib variable, use the last dir name of installLib in * addition to the original TCL_LIBRARY path. */ str = getenv("TCL_LIBRARY"); /* INTL: Native. */ if (str != NULL) { Tcl_ExternalToUtfDStringEx(NULL, NULL, str, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &buffer, NULL); str = Tcl_DStringValue(&buffer); } else { Tcl_DStringInit(&buffer); } if ((str != NULL) && (str[0] != '\0')) { Tcl_DString ds; Tcl_Size pathc; const char **pathv; char installLib[LIBRARY_SIZE]; Tcl_DStringInit(&ds); /* * Initialize the substrings used when locating an executable. The * installLib variable computes the path as though the executable is * installed. */ snprintf(installLib, sizeof(installLib), "lib/tcl%s", TCL_VERSION); /* * If TCL_LIBRARY is set, search there. */ Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_NewStringObj(str, TCL_INDEX_NONE)); Tcl_SplitPath(str, &pathc, &pathv); if ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc-1]) != 0)) { /* * If TCL_LIBRARY is set but refers to a different tcl * installation than the current version, try fiddling with the * specified directory to make it refer to this installation by * removing the old "tclX.Y" and substituting the current version * string. */ pathv[pathc - 1] = installLib + 4; str = Tcl_JoinPath(pathc, pathv, &ds); Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_DStringToObj(&ds)); } Tcl_Free(pathv); } /* * Finally, look for the library relative to the compiled-in path. This is * needed when users install Tcl with an exec-prefix that is different * from the prefix. */ { #ifdef HAVE_COREFOUNDATION char tclLibPath[MAXPATHLEN + 1]; if (MacOSXGetLibraryPath(NULL, MAXPATHLEN, tclLibPath) == TCL_OK) { str = tclLibPath; } else #endif /* HAVE_COREFOUNDATION */ { /* * TODO: Pull this value from the TIP 59 table. */ str = defaultLibraryDir; } if (str[0] != '\0') { objPtr = Tcl_NewStringObj(str, TCL_INDEX_NONE); Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); } } Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); /* * Note lengthPtr is (size_t *) which is unsigned so cannot * pass directly to Tcl_GetStringFromObj. * TODO - why is the type size_t anyways? */ Tcl_Size length; str = TclGetStringFromObj(pathPtr, &length); *lengthPtr = length; *valuePtr = (char *)Tcl_Alloc(length + 1); memcpy(*valuePtr, str, length + 1); Tcl_DecrRefCount(pathPtr); } /* *--------------------------------------------------------------------------- * * TclpSetInitialEncodings -- * * Based on the locale, determine the encoding of the operating system * and the default encoding for newly opened files. * * Called at process initialization time, and part way through startup, * we verify that the initial encodings were correctly setup. Depending * on Tcl's environment, there may not have been enough information first * time through (above). * * Results: * None. * * Side effects: * The Tcl library path is converted from native encoding to UTF-8, on * the first call, and the encodings may be changed on first or second * call. * *--------------------------------------------------------------------------- */ void TclpSetInitialEncodings(void) { Tcl_DString encodingName; Tcl_SetSystemEncoding(NULL, Tcl_GetEncodingNameFromEnvironment(&encodingName)); Tcl_DStringFree(&encodingName); } static const char * SearchKnownEncodings( const char *encoding) { int left = 0; int right = sizeof(localeTable)/sizeof(LocaleTable); /* Here, search for i in the interval left <= i < right. */ while (left < right) { int test = (left + right)/2; int code = strcmp(localeTable[test].lang, encoding); if (code == 0) { /* Found it at i == test. */ return localeTable[test].encoding; } if (code < 0) { /* Restrict the search to the interval test < i < right. */ left = test+1; } else { /* Restrict the search to the interval left <= i < test. */ right = test; } } return NULL; } const char * Tcl_GetEncodingNameFromEnvironment( Tcl_DString *bufPtr) { const char *encoding; const char *knownEncoding; Tcl_DStringInit(bufPtr); /* * Determine the current encoding from the LC_* or LANG environment * variables. We previously used setlocale() to determine the locale, but * this does not work on some systems (e.g. Linux/i386 RH 5.0). */ #ifdef HAVE_LANGINFO if ( #ifdef WEAK_IMPORT_NL_LANGINFO nl_langinfo != NULL && #endif setlocale(LC_CTYPE, "") != NULL) { Tcl_DString ds; /* * Use a DString so we can modify case. */ Tcl_DStringInit(&ds); encoding = Tcl_DStringAppend(&ds, nl_langinfo(CODESET), TCL_INDEX_NONE); Tcl_UtfToLower(Tcl_DStringValue(&ds)); knownEncoding = SearchKnownEncodings(encoding); if (knownEncoding != NULL) { Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE); } else if (NULL != Tcl_GetEncoding(NULL, encoding)) { Tcl_DStringAppend(bufPtr, encoding, TCL_INDEX_NONE); } Tcl_DStringFree(&ds); if (Tcl_DStringLength(bufPtr)) { return Tcl_DStringValue(bufPtr); } } #endif /* HAVE_LANGINFO */ /* * Classic fallback check. This tries a homebrew algorithm to determine * what encoding should be used based on env vars. */ encoding = getenv("LC_ALL"); if (encoding == NULL || encoding[0] == '\0') { encoding = getenv("LC_CTYPE"); } if (encoding == NULL || encoding[0] == '\0') { encoding = getenv("LANG"); } if (encoding == NULL || encoding[0] == '\0') { encoding = NULL; } if (encoding != NULL) { const char *p; Tcl_DString ds; Tcl_DStringInit(&ds); p = encoding; encoding = Tcl_DStringAppend(&ds, p, TCL_INDEX_NONE); Tcl_UtfToLower(Tcl_DStringValue(&ds)); knownEncoding = SearchKnownEncodings(encoding); if (knownEncoding != NULL) { Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE); } else if (NULL != Tcl_GetEncoding(NULL, encoding)) { Tcl_DStringAppend(bufPtr, encoding, TCL_INDEX_NONE); } if (Tcl_DStringLength(bufPtr)) { Tcl_DStringFree(&ds); return Tcl_DStringValue(bufPtr); } /* * We didn't recognize the full value as an encoding name. If there is * an encoding subfield, we can try to guess from that. */ for (p = encoding; *p != '\0'; p++) { if (*p == '.') { p++; break; } } if (*p != '\0') { knownEncoding = SearchKnownEncodings(p); if (knownEncoding != NULL) { Tcl_DStringAppend(bufPtr, knownEncoding, TCL_INDEX_NONE); } else if (NULL != Tcl_GetEncoding(NULL, p)) { Tcl_DStringAppend(bufPtr, p, TCL_INDEX_NONE); } } Tcl_DStringFree(&ds); if (Tcl_DStringLength(bufPtr)) { return Tcl_DStringValue(bufPtr); } } return Tcl_DStringAppend(bufPtr, TCL_DEFAULT_ENCODING, TCL_INDEX_NONE); } /* *--------------------------------------------------------------------------- * * TclpSetVariables -- * * Performs platform-specific interpreter initialization related to the * tcl_library and tcl_platform variables, and other platform-specific * things. * * Results: * None. * * Side effects: * Sets "tclDefaultLibrary", "tcl_pkgPath", and "tcl_platform" Tcl * variables. * *---------------------------------------------------------------------- */ #if defined(HAVE_COREFOUNDATION) /* * Helper because whether CFLocaleCopyCurrent and CFLocaleGetIdentifier are * strongly or weakly bound varies by version of OSX, triggering warnings. */ static inline void InitMacLocaleInfoVar( CFLocaleRef (*localeCopyCurrent)(void), CFStringRef (*localeGetIdentifier)(CFLocaleRef), Tcl_Interp *interp) { CFLocaleRef localeRef; CFStringRef locale; char loc[256]; if (localeCopyCurrent == NULL || localeGetIdentifier == NULL) { return; } localeRef = localeCopyCurrent(); if (!localeRef) { return; } locale = localeGetIdentifier(localeRef); if (locale && CFStringGetCString(locale, loc, 256, kCFStringEncodingUTF8)) { if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) { Tcl_ResetResult(interp); } Tcl_SetVar2(interp, "::tcl::mac::locale", NULL, loc, TCL_GLOBAL_ONLY); } CFRelease(localeRef); } #endif /*defined(HAVE_COREFOUNDATION)*/ void TclpSetVariables( Tcl_Interp *interp) { #ifdef __CYGWIN__ SYSTEM_INFO sysInfo; static OSVERSIONINFOW osInfo; static int osInfoInitialized = 0; char buffer[TCL_INTEGER_SPACE * 2]; #elif !defined(NO_UNAME) struct utsname name; #endif int unameOK; const char *p, *q; Tcl_Obj *pkgListObj = Tcl_NewObj(); #ifdef HAVE_COREFOUNDATION char tclLibPath[MAXPATHLEN + 1]; /* * Set msgcat fallback locale to current CFLocale identifier. */ InitMacLocaleInfoVar(CFLocaleCopyCurrent, CFLocaleGetIdentifier, interp); if (MacOSXGetLibraryPath(interp, MAXPATHLEN, tclLibPath) == TCL_OK) { const char *str; CFBundleRef bundleRef; Tcl_DString ds; Tcl_SetVar2(interp, "tclDefaultLibrary", NULL, tclLibPath, TCL_GLOBAL_ONLY); Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); str = TclGetEnv("DYLD_FRAMEWORK_PATH", &ds); if ((str != NULL) && (str[0] != '\0')) { p = Tcl_DStringValue(&ds); while ((q = strchr(p, ':')) != NULL) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p)); p = q+1; } if (*p) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1)); } Tcl_DStringFree(&ds); } bundleRef = CFBundleGetMainBundle(); if (bundleRef) { CFURLRef frameworksURL; Tcl_StatBuf statBuf; frameworksURL = CFBundleCopyPrivateFrameworksURL(bundleRef); if (frameworksURL) { if (CFURLGetFileSystemRepresentation(frameworksURL, TRUE, (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); } CFRelease(frameworksURL); } frameworksURL = CFBundleCopySharedFrameworksURL(bundleRef); if (frameworksURL) { if (CFURLGetFileSystemRepresentation(frameworksURL, TRUE, (unsigned char*) tclLibPath, MAXPATHLEN) && ! TclOSstat(tclLibPath, &statBuf) && S_ISDIR(statBuf.st_mode)) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(tclLibPath, -1)); } CFRelease(frameworksURL); } } } #endif /* HAVE_COREFOUNDATION */ p = pkgPath; while ((q = strchr(p, ':')) != NULL) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p)); p = q+1; } if (*p) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, -1)); } Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_pkgPath", -1), NULL, pkgListObj, TCL_GLOBAL_ONLY); { /* Some platforms build configure scripts expect ~ expansion so do that */ Tcl_Obj *origPaths; Tcl_Obj *resolvedPaths; origPaths = Tcl_GetVar2Ex(interp, "tcl_pkgPath", NULL, TCL_GLOBAL_ONLY); resolvedPaths = TclResolveTildePathList(origPaths); if (resolvedPaths != origPaths && resolvedPaths != NULL) { Tcl_SetVar2Ex(interp, "tcl_pkgPath", NULL, resolvedPaths, TCL_GLOBAL_ONLY); } } #ifdef DJGPP Tcl_SetVar2(interp, "tcl_platform", "platform", "dos", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "tcl_platform", "platform", "unix", TCL_GLOBAL_ONLY); #endif unameOK = 0; #ifdef __CYGWIN__ unameOK = 1; if (!osInfoInitialized) { void *handle = GetModuleHandleW(L"NTDLL"); int(*getversion)(void *) = (int(*)(void *))GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (!getversion || getversion(&osInfo)) { GetVersionExW(&osInfo); } osInfoInitialized = 1; } GetSystemInfo(&sysInfo); if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) { osInfo.dwMajorVersion = 11; } Tcl_SetVar2(interp, "tcl_platform", "os", "Windows NT", TCL_GLOBAL_ONLY); snprintf(buffer, sizeof(buffer), "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion); Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY); if (sysInfo.wProcessorArchitecture < NUMPROCESSORS) { Tcl_SetVar2(interp, "tcl_platform", "machine", processors[sysInfo.wProcessorArchitecture], TCL_GLOBAL_ONLY); } #elif !defined NO_UNAME if (uname(&name) >= 0) { const char *native; Tcl_DString ds; unameOK = 1; native = Tcl_ExternalToUtfDString(NULL, name.sysname, TCL_INDEX_NONE, &ds); Tcl_SetVar2(interp, "tcl_platform", "os", native, TCL_GLOBAL_ONLY); Tcl_DStringFree(&ds); /* * The following code is a special hack to handle differences in the * way version information is returned by uname. On most systems the * full version number is available in name.release. However, under * AIX the major version number is in name.version and the minor * version number is in name.release. */ if ((strchr(name.release, '.') != NULL) || !isdigit(UCHAR(name.version[0]))) { /* INTL: digit */ Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, TCL_GLOBAL_ONLY); } else { #ifdef DJGPP /* * For some obscure reason DJGPP puts major version into * name.release and minor into name.version. As of DJGPP 2.04 this * is documented in djgpp libc.info file. */ Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "osVersion", ".", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.version, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); #else Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.version, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "osVersion", ".", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); Tcl_SetVar2(interp, "tcl_platform", "osVersion", name.release, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE); #endif /* DJGPP */ } Tcl_SetVar2(interp, "tcl_platform", "machine", name.machine, TCL_GLOBAL_ONLY); } #endif /* !NO_UNAME */ if (!unameOK) { Tcl_SetVar2(interp, "tcl_platform", "os", "", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "osVersion", "", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "tcl_platform", "machine", "", TCL_GLOBAL_ONLY); } /* * Copy the username of the real user (according to getuid()) into * tcl_platform(user). */ { struct passwd *pwEnt = TclpGetPwUid(getuid()); const char *user; Tcl_DString ds; if (pwEnt == NULL) { user = ""; Tcl_DStringInit(&ds); /* ensure cleanliness */ } else { user = Tcl_ExternalToUtfDString(NULL, pwEnt->pw_name, TCL_INDEX_NONE, &ds); } Tcl_SetVar2(interp, "tcl_platform", "user", user, TCL_GLOBAL_ONLY); Tcl_DStringFree(&ds); } /* * Define what the platform PATH separator is. [TIP #315] */ Tcl_SetVar2(interp, "tcl_platform","pathSeparator", ":", TCL_GLOBAL_ONLY); } /* *---------------------------------------------------------------------- * * TclpFindVariable -- * * Locate the entry in environ for a given name. On Unix this routine is * case sensitive, on Windows this matches mixed case. * * Results: * The return value is the index in environ of an entry with the name * "name", or -1 if there is no such entry. The integer at *lengthPtr is * filled in with the length of name (if a matching entry is found) or * the length of the environ array (if no matching entry is found). * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Size TclpFindVariable( const char *name, /* Name of desired environment variable * (native). */ Tcl_Size *lengthPtr) /* Used to return length of name (for * successful searches) or number of non-NULL * entries in environ (for unsuccessful * searches). */ { Tcl_Size i, result = -1; const char *env, *p1, *p2; Tcl_DString envString; Tcl_DStringInit(&envString); for (i = 0, env = environ[i]; env != NULL; i++, env = environ[i]) { p1 = Tcl_ExternalToUtfDString(NULL, env, TCL_INDEX_NONE, &envString); p2 = name; for (; *p2 == *p1; p1++, p2++) { /* NULL loop body. */ } if ((*p1 == '=') && (*p2 == '\0')) { *lengthPtr = p2 - name; result = i; goto done; } Tcl_DStringFree(&envString); } *lengthPtr = i; done: Tcl_DStringFree(&envString); return result; } /* *---------------------------------------------------------------------- * * MacOSXGetLibraryPath -- * * If we have a bundle structure for the Tcl installation, then check * there first to see if we can find the libraries there. * * Results: * TCL_OK if we have found the tcl library; TCL_ERROR otherwise. * * Side effects: * Same as for Tcl_MacOSXOpenVersionedBundleResources. * *---------------------------------------------------------------------- */ #ifdef HAVE_COREFOUNDATION #ifdef TCL_FRAMEWORK static int MacOSXGetLibraryPath( Tcl_Interp *interp, int maxPathLen, char *tclLibPath) { return Tcl_MacOSXOpenVersionedBundleResources(interp, "com.tcltk.tcllibrary", TCL_FRAMEWORK_VERSION, 0, maxPathLen, tclLibPath); } #else static int MacOSXGetLibraryPath( TCL_UNUSED(Tcl_Interp *), TCL_UNUSED(int), TCL_UNUSED(char *)) { return TCL_ERROR; } #endif #endif /* HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixFile.c0000644000175000017500000010073015104661341015125 0ustar sergeisergei/* * tclUnixFile.c -- * * This file contains wrappers around UNIX file handling functions. * These wrappers mask differences between Windows and UNIX. * * Copyright © 1995-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclFileSystem.h" #if !defined(NO_DLFCN_H) #include #endif static int NativeMatchType(Tcl_Interp *interp, const char* nativeEntry, const char* nativeName, Tcl_GlobTypeData *types); /* *--------------------------------------------------------------------------- * * TclpFindExecutable -- * * This function computes the absolute path name of the current * application, given its argv[0] value. For Cygwin, argv[0] is * ignored and the path is determined the same as under win32. * * In the case of shared Tcl library, the absolute path name of the * Tcl library is also determined. * * Results: * None. * * Side effects: * The computed path name(s) are stored as ProcessGlobalValue entries. * *--------------------------------------------------------------------------- */ #ifdef __CYGWIN__ void TclpFindExecutable( TCL_UNUSED(const char *) /*argv0*/) { size_t length; WCHAR buf[PATH_MAX] = L""; char name[PATH_MAX * TCL_UTF_MAX + 1]; GetModuleFileNameW(NULL, buf, PATH_MAX); cygwin_conv_path(3, buf, name, sizeof(name)); length = strlen(name); if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) { /* Strip '.exe' part. */ length -= 4; } TclSetObjNameOfExecutable(Tcl_NewStringObj(name, length), NULL); #if !defined(STATIC_BUILD) HMODULE hModule = (HMODULE)TclWinGetTclInstance(); if (GetModuleFileNameW(hModule, buf, PATH_MAX) < PATH_MAX) { cygwin_conv_path(3, buf, name, sizeof(name)); } TclSetObjNameOfShlib(Tcl_NewStringObj(name, TCL_AUTO_LENGTH), NULL); #endif } #else void TclpFindExecutable( const char *argv0) /* The value of the application's argv[0] * (native). */ { const char *name, *p; Tcl_StatBuf statBuf; Tcl_DString buffer, nameString, cwd, utfName; Tcl_Obj *obj; if (argv0 == NULL) { return; } Tcl_DStringInit(&buffer); name = argv0; for (p = name; *p != '\0'; p++) { if (*p == '/') { /* * The name contains a slash, so use the name directly without * doing a path search. */ goto gotName; } } p = getenv("PATH"); /* INTL: Native. */ if (p == NULL) { /* * There's no PATH environment variable; use the default that is used * by sh. */ p = ":/bin:/usr/bin"; } else if (*p == '\0') { /* * An empty path is equivalent to ".". */ p = "./"; } /* * Search through all the directories named in the PATH variable to see if * argv[0] is in one of them. If so, use that file name. */ while (1) { while (TclIsSpaceProcM(*p)) { p++; } name = p; while ((*p != ':') && (*p != 0)) { p++; } TclDStringClear(&buffer); if (p != name) { Tcl_DStringAppend(&buffer, name, p - name); if (p[-1] != '/') { TclDStringAppendLiteral(&buffer, "/"); } } name = Tcl_DStringAppend(&buffer, argv0, TCL_INDEX_NONE); /* * INTL: The following calls to access() and stat() should not be * converted to Tclp routines because they need to operate on native * strings directly. */ if ((access(name, X_OK) == 0) /* INTL: Native. */ && (TclOSstat(name, &statBuf) == 0) /* INTL: Native. */ && S_ISREG(statBuf.st_mode)) { goto gotName; } if (p[0] == '\0') { break; } else if (p[1] == 0) { p = "./"; } else { p++; } } TclNewObj(obj); TclSetObjNameOfExecutable(obj, NULL); goto getShlibName; /* * If the name starts with "/" then just store it */ gotName: #ifdef DJGPP if (name[1] == ':') #else if (name[0] == '/') #endif { Tcl_ExternalToUtfDStringEx(NULL, NULL, name, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &utfName, NULL); TclSetObjNameOfExecutable(Tcl_DStringToObj(&utfName), NULL); goto getShlibName; } if (TclpGetCwd(NULL, &cwd) == NULL) { TclNewObj(obj); TclSetObjNameOfExecutable(obj, NULL); goto getShlibName; } /* * The name is relative to the current working directory. First strip off * a leading "./", if any, then add the full path name of the current * working directory. */ if ((name[0] == '.') && (name[1] == '/')) { name += 2; } Tcl_DStringInit(&nameString); Tcl_DStringAppend(&nameString, name, TCL_INDEX_NONE); Tcl_DStringFree(&buffer); Tcl_UtfToExternalDStringEx(NULL, NULL, Tcl_DStringValue(&cwd), Tcl_DStringLength(&cwd), TCL_ENCODING_PROFILE_TCL8, &buffer, NULL); if (Tcl_DStringValue(&cwd)[Tcl_DStringLength(&cwd) -1] != '/') { TclDStringAppendLiteral(&buffer, "/"); } Tcl_DStringFree(&cwd); TclDStringAppendDString(&buffer, &nameString); Tcl_DStringFree(&nameString); Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(&buffer), TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &utfName, NULL); TclSetObjNameOfExecutable(Tcl_DStringToObj(&utfName), NULL); getShlibName: #if !defined(STATIC_BUILD) name = CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_DLLFILE; # if !defined(NO_DLFCN_H) Dl_info dlinfo; if (dladdr((const void *)TclpFindExecutable, &dlinfo) && dlinfo.dli_fname) { name = dlinfo.dli_fname; } # endif TclSetObjNameOfShlib(Tcl_NewStringObj(name, TCL_AUTO_LENGTH), NULL); #endif /* STATIC_BUILD */ Tcl_DStringFree(&buffer); } #endif /* *---------------------------------------------------------------------- * * TclpMatchInDirectory -- * * This routine is used by the globbing code to search a directory for * all files which match a given pattern. * * Results: * The return value is a standard Tcl result indicating whether an error * occurred in globbing. Errors are left in interp, good results are * [lappend]ed to resultPtr (which must be a valid object). * * Side effects: * None. * *---------------------------------------------------------------------- */ int TclpMatchInDirectory( Tcl_Interp *interp, /* Interpreter to receive errors. */ Tcl_Obj *resultPtr, /* List object to lappend results. */ Tcl_Obj *pathPtr, /* Contains path to directory to search. */ const char *pattern, /* Pattern to match against. */ Tcl_GlobTypeData *types) /* Object containing list of acceptable types. * May be NULL. In particular the directory * flag is very important. */ { const char *native; Tcl_Obj *fileNamePtr; int matchResult = 0; if (types != NULL && types->type == TCL_GLOB_TYPE_MOUNT) { /* * The native filesystem never adds mounts. */ return TCL_OK; } fileNamePtr = Tcl_FSGetTranslatedPath(interp, pathPtr); if (fileNamePtr == NULL) { return TCL_ERROR; } if (pattern == NULL || (*pattern == '\0')) { /* * Match a file directly. */ Tcl_Obj *tailPtr; const char *nativeTail; native = (const char *)Tcl_FSGetNativePath(pathPtr); tailPtr = TclPathPart(interp, pathPtr, TCL_PATH_TAIL); nativeTail = (const char *)Tcl_FSGetNativePath(tailPtr); matchResult = NativeMatchType(interp, native, nativeTail, types); if (matchResult == 1) { Tcl_ListObjAppendElement(interp, resultPtr, pathPtr); } Tcl_DecrRefCount(tailPtr); Tcl_DecrRefCount(fileNamePtr); } else { TclDIR *d; Tcl_DirEntry *entryPtr; const char *dirName; Tcl_Size dirLength, nativeDirLen; int matchHidden, matchHiddenPat; Tcl_StatBuf statBuf; Tcl_DString ds; /* native encoding of dir */ Tcl_DString dsOrig; /* utf-8 encoding of dir */ Tcl_DStringInit(&dsOrig); dirName = TclGetStringFromObj(fileNamePtr, &dirLength); Tcl_DStringAppend(&dsOrig, dirName, dirLength); /* * Make sure that the directory part of the name really is a * directory. If the directory name is "", use the name "." instead, * because some UNIX systems don't treat "" like "." automatically. * Keep the "" for use in generating file names, otherwise "glob * foo.c" would return "./foo.c". */ if (dirLength == 0) { dirName = "."; } else { dirName = Tcl_DStringValue(&dsOrig); /* * Make sure we have a trailing directory delimiter. */ if (dirName[dirLength-1] != '/') { dirName = TclDStringAppendLiteral(&dsOrig, "/"); dirLength++; } } /* * Now open the directory for reading and iterate over the contents. */ if (Tcl_UtfToExternalDStringEx(interp, NULL, dirName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&dsOrig); Tcl_DStringFree(&ds); Tcl_DecrRefCount(fileNamePtr); return TCL_ERROR; } native = Tcl_DStringValue(&ds); if ((TclOSstat(native, &statBuf) != 0) /* INTL: Native. */ || !S_ISDIR(statBuf.st_mode)) { Tcl_DStringFree(&dsOrig); Tcl_DStringFree(&ds); Tcl_DecrRefCount(fileNamePtr); return TCL_OK; } d = TclOSopendir(native); /* INTL: Native. */ if (d == NULL) { Tcl_DStringFree(&ds); if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read directory \"%s\": %s", Tcl_DStringValue(&dsOrig), Tcl_PosixError(interp))); } Tcl_DStringFree(&dsOrig); Tcl_DecrRefCount(fileNamePtr); return TCL_ERROR; } nativeDirLen = Tcl_DStringLength(&ds); /* * Check to see if -type or the pattern requests hidden files. */ matchHiddenPat = (pattern[0] == '.') || ((pattern[0] == '\\') && (pattern[1] == '.')); matchHidden = matchHiddenPat || (types && (types->perm & TCL_GLOB_PERM_HIDDEN)); while ((entryPtr = TclOSreaddir(d)) != NULL) { /* INTL: Native. */ Tcl_DString utfDs; const char *utfname; /* * Skip this file if it doesn't agree with the hidden parameters * requested by the user (via -type or pattern). */ if (*entryPtr->d_name == '.') { if (!matchHidden) { continue; } } else { #ifdef MAC_OSX_TCL if (matchHiddenPat) { continue; } /* Also need to check HFS hidden flag in TclMacOSXMatchType. */ #else if (matchHidden) { continue; } #endif } /* * Now check to see if the file matches, according to both type * and pattern. If so, add the file to the result. */ if (Tcl_ExternalToUtfDStringEx(interp, NULL, entryPtr->d_name, TCL_INDEX_NONE, 0, &utfDs, NULL) != TCL_OK) { matchResult = -1; break; } utfname = Tcl_DStringValue(&utfDs); if (Tcl_StringCaseMatch(utfname, pattern, 0)) { int typeOk = 1; if (types != NULL) { Tcl_DStringSetLength(&ds, nativeDirLen); native = Tcl_DStringAppend(&ds, entryPtr->d_name, TCL_INDEX_NONE); matchResult = NativeMatchType(interp, native, entryPtr->d_name, types); typeOk = (matchResult == 1); } if (typeOk) { Tcl_ListObjAppendElement(interp, resultPtr, TclNewFSPathObj(pathPtr, utfname, Tcl_DStringLength(&utfDs))); } } Tcl_DStringFree(&utfDs); if (matchResult < 0) { break; } } TclOSclosedir(d); Tcl_DStringFree(&ds); Tcl_DStringFree(&dsOrig); Tcl_DecrRefCount(fileNamePtr); } if (matchResult < 0) { return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * NativeMatchType -- * * This routine is used by the globbing code to check if a file matches a * given type description. * * Results: * The return value is 1, 0 or -1 indicating whether the file matches the * given criteria, does not match them, or an error occurred (in which * case an error is left in interp). * * Side effects: * None. * *---------------------------------------------------------------------- */ static int NativeMatchType( Tcl_Interp *interp, /* Interpreter to receive errors. */ const char *nativeEntry, /* Native path to check. */ const char *nativeName, /* Native filename to check. */ Tcl_GlobTypeData *types) /* Type description to match against. */ { Tcl_StatBuf buf; if (types == NULL) { /* * Simply check for the file's existence, but do it with lstat, in * case it is a link to a file which doesn't exist (since that case * would not show up if we used 'access' or 'stat') */ if (TclOSlstat(nativeEntry, &buf) != 0) { return 0; } return 1; } if (types->perm != 0) { if (TclOSstat(nativeEntry, &buf) != 0) { /* * Either the file has disappeared between the 'readdir' call and * the 'stat' call, or the file is a link to a file which doesn't * exist (which we could ascertain with lstat), or there is some * other strange problem. In all these cases, we define this to * mean the file does not match any defined permission, and * therefore it is not added to the list of files to return. */ return 0; } /* * readonly means that there are NO write permissions (even for user), * but execute is OK for anybody OR that the user immutable flag is * set (where supported). */ if (((types->perm & TCL_GLOB_PERM_RONLY) && #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) !(buf.st_flags & UF_IMMUTABLE) && #endif (buf.st_mode & (S_IWOTH|S_IWGRP|S_IWUSR))) || ((types->perm & TCL_GLOB_PERM_R) && (access(nativeEntry, R_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_W) && (access(nativeEntry, W_OK) != 0)) || ((types->perm & TCL_GLOB_PERM_X) && (access(nativeEntry, X_OK) != 0)) #ifndef MAC_OSX_TCL || ((types->perm & TCL_GLOB_PERM_HIDDEN) && (*nativeName != '.')) #endif /* MAC_OSX_TCL */ ) { return 0; } } if (types->type != 0) { if (types->perm == 0) { /* * We haven't yet done a stat on the file. */ if (TclOSstat(nativeEntry, &buf) != 0) { /* * Posix error occurred. The only ok case is if this is a link * to a nonexistent file, and the user did 'glob -l'. So we * check that here: */ if ((types->type & TCL_GLOB_TYPE_LINK) && (TclOSlstat(nativeEntry, &buf) == 0) && S_ISLNK(buf.st_mode)) { return 1; } return 0; } } /* * In order bcdpsfl as in 'find -t' */ if ( ((types->type & TCL_GLOB_TYPE_BLOCK)&& S_ISBLK(buf.st_mode)) || ((types->type & TCL_GLOB_TYPE_CHAR) && S_ISCHR(buf.st_mode)) || ((types->type & TCL_GLOB_TYPE_DIR) && S_ISDIR(buf.st_mode)) || ((types->type & TCL_GLOB_TYPE_PIPE) && S_ISFIFO(buf.st_mode))|| #ifdef S_ISSOCK ((types->type & TCL_GLOB_TYPE_SOCK) && S_ISSOCK(buf.st_mode))|| #endif /* S_ISSOCK */ ((types->type & TCL_GLOB_TYPE_FILE) && S_ISREG(buf.st_mode))) { /* * Do nothing - this file is ok. */ } else { #ifdef S_ISLNK if ((types->type & TCL_GLOB_TYPE_LINK) && (TclOSlstat(nativeEntry, &buf) == 0) && S_ISLNK(buf.st_mode)) { goto filetypeOK; } #endif /* S_ISLNK */ return 0; } } filetypeOK: /* * If we're on OSX, we also have to worry about matching the file creator * code (if specified). Do that now. */ #ifdef MAC_OSX_TCL if (types->macType != NULL || types->macCreator != NULL || (types->perm & TCL_GLOB_PERM_HIDDEN)) { int matchResult; if (types->perm == 0 && types->type == 0) { /* * We haven't yet done a stat on the file. */ if (TclOSstat(nativeEntry, &buf) != 0) { return 0; } } matchResult = TclMacOSXMatchType(interp, nativeEntry, nativeName, &buf, types); if (matchResult != 1) { return matchResult; } } #else (void)interp; #endif /* MAC_OSX_TCL */ return 1; } /* *--------------------------------------------------------------------------- * * TclpGetUserHome -- * * This function takes the specified user name and finds their home * directory. * * Results: * The result is a pointer to a string specifying the user's home * directory, or NULL if the user's home directory could not be * determined. Storage for the result string is allocated in bufferPtr; * the caller must call Tcl_DStringFree() when the result is no longer * needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * TclpGetUserHome( const char *name, /* User name for desired home directory. */ Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * name of user's home directory. */ { struct passwd *pwPtr; Tcl_DString ds; const char *native; if (Tcl_UtfToExternalDStringEx(NULL, NULL, name, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } native = Tcl_DStringValue(&ds); pwPtr = TclpGetPwNam(native); /* INTL: Native. */ Tcl_DStringFree(&ds); if (pwPtr == NULL) { return NULL; } if (Tcl_ExternalToUtfDStringEx(NULL, NULL, pwPtr->pw_dir, TCL_INDEX_NONE, 0, bufferPtr, NULL) != TCL_OK) { return NULL; } else { return Tcl_DStringValue(bufferPtr); } } /* *--------------------------------------------------------------------------- * * TclpObjAccess -- * * This function replaces the library version of access(). * * Results: * See access() documentation. * * Side effects: * See access() documentation. * *--------------------------------------------------------------------------- */ int TclpObjAccess( Tcl_Obj *pathPtr, /* Path of file to access */ int mode) /* Permission setting. */ { const char *path = (const char *)Tcl_FSGetNativePath(pathPtr); if (path == NULL) { return -1; } return access(path, mode); } /* *--------------------------------------------------------------------------- * * TclpObjChdir -- * * This function replaces the library version of chdir(). * * Results: * See chdir() documentation. * * Side effects: * See chdir() documentation. * *--------------------------------------------------------------------------- */ int TclpObjChdir( Tcl_Obj *pathPtr) /* Path to new working directory */ { const char *path = (const char *)Tcl_FSGetNativePath(pathPtr); if (path == NULL) { return -1; } return chdir(path); } /* *---------------------------------------------------------------------- * * TclpObjLstat -- * * This function replaces the library version of lstat(). * * Results: * See lstat() documentation. * * Side effects: * See lstat() documentation. * *---------------------------------------------------------------------- */ int TclpObjLstat( Tcl_Obj *pathPtr, /* Path of file to stat */ Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */ { return TclOSlstat((const char *)Tcl_FSGetNativePath(pathPtr), bufPtr); } /* *--------------------------------------------------------------------------- * * TclpGetNativeCwd -- * * This function replaces the library version of getcwd(). * * Results: * The input and output are filesystem paths in native form. The result * is either the given clientData, if the working directory hasn't * changed, or a new clientData (owned by our caller), giving the new * native path, or NULL if the current directory could not be determined. * If NULL is returned, the caller can examine the standard Posix error * codes to determine the cause of the problem. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpGetNativeCwd( void *clientData) { char buffer[MAXPATHLEN+1]; #ifdef USEGETWD if (getwd(buffer) == NULL) { /* INTL: Native. */ return NULL; } #else if (getcwd(buffer, MAXPATHLEN+1) == NULL) { /* INTL: Native. */ return NULL; } #endif /* USEGETWD */ if ((clientData == NULL) || strcmp(buffer, (const char *) clientData)) { char *newCd = (char *)Tcl_Alloc(strlen(buffer) + 1); strcpy(newCd, buffer); return newCd; } /* * No change to pwd. */ return clientData; } /* *--------------------------------------------------------------------------- * * TclpGetCwd -- * * This function replaces the library version of getcwd(). (Obsolete * function, only retained for old extensions which may call it * directly). * * Results: * The result is a pointer to a string specifying the current directory, * or NULL if the current directory could not be determined. If NULL is * returned, an error message is left in the interp's result. Storage for * the result string is allocated in bufferPtr; the caller must call * Tcl_DStringFree() when the result is no longer needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * TclpGetCwd( Tcl_Interp *interp, /* If non-NULL, used for error reporting. */ Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * name of current directory. */ { char buffer[MAXPATHLEN+1]; #ifdef USEGETWD if (getwd(buffer) == NULL) /* INTL: Native. */ #else if (getcwd(buffer, MAXPATHLEN+1) == NULL) /* INTL: Native. */ #endif /* USEGETWD */ { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error getting working directory name: %s", Tcl_PosixError(interp))); } return NULL; } if (Tcl_ExternalToUtfDStringEx(interp, NULL, buffer, TCL_INDEX_NONE, 0, bufferPtr, NULL) != TCL_OK) { return NULL; } return Tcl_DStringValue(bufferPtr); } /* *--------------------------------------------------------------------------- * * TclpReadlink -- * * This function replaces the library version of readlink(). * * Results: * The result is a pointer to a string specifying the contents of the * symbolic link given by 'path', or NULL if the symbolic link could not * be read. Storage for the result string is allocated in bufferPtr; the * caller must call Tcl_DStringFree() when the result is no longer * needed. * * Side effects: * See readlink() documentation. * *--------------------------------------------------------------------------- */ char * TclpReadlink( const char *path, /* Path of file to readlink (UTF-8). */ Tcl_DString *linkPtr) /* Uninitialized or free DString filled with * contents of link (UTF-8). */ { #ifndef DJGPP char link[MAXPATHLEN]; Tcl_Size length; const char *native; Tcl_DString ds; if (Tcl_UtfToExternalDStringEx(NULL, NULL, path, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } native = Tcl_DStringValue(&ds); length = readlink(native, link, sizeof(link)); /* INTL: Native. */ Tcl_DStringFree(&ds); if (length < 0) { return NULL; } if (Tcl_ExternalToUtfDStringEx(NULL, NULL, link, length, 0, linkPtr, NULL) == TCL_OK) { return Tcl_DStringValue(linkPtr); } #endif /* !DJGPP */ return NULL; } /* *---------------------------------------------------------------------- * * TclpObjStat -- * * This function replaces the library version of stat(). * * Results: * See stat() documentation. * * Side effects: * See stat() documentation. * *---------------------------------------------------------------------- */ int TclpObjStat( Tcl_Obj *pathPtr, /* Path of file to stat */ Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */ { const char *path = (const char *)Tcl_FSGetNativePath(pathPtr); if (path == NULL) { return -1; } return TclOSstat(path, bufPtr); } #ifdef S_IFLNK Tcl_Obj * TclpObjLink( Tcl_Obj *pathPtr, Tcl_Obj *toPtr, int linkAction) { if (toPtr != NULL) { const char *src = (const char *)Tcl_FSGetNativePath(pathPtr); const char *target = NULL; if (src == NULL) { return NULL; } /* * If we're making a symbolic link and the path is relative, then we * must check whether it exists _relative_ to the directory in which * the src is found (not relative to the current cwd which is just not * relevant in this case). * * If we're making a hard link, then a relative path is just converted * to absolute relative to the cwd. */ if ((linkAction & TCL_CREATE_SYMBOLIC_LINK) && (Tcl_FSGetPathType(toPtr) == TCL_PATH_RELATIVE)) { Tcl_Obj *dirPtr, *absPtr; dirPtr = TclPathPart(NULL, pathPtr, TCL_PATH_DIRNAME); if (dirPtr == NULL) { return NULL; } absPtr = Tcl_FSJoinToPath(dirPtr, 1, &toPtr); Tcl_IncrRefCount(absPtr); if (Tcl_FSAccess(absPtr, F_OK) == -1) { Tcl_DecrRefCount(absPtr); Tcl_DecrRefCount(dirPtr); /* * Target doesn't exist. */ errno = ENOENT; return NULL; } /* * Target exists; we'll construct the relative path we want below. */ Tcl_DecrRefCount(absPtr); Tcl_DecrRefCount(dirPtr); } else { target = (const char*)Tcl_FSGetNativePath(toPtr); if (target == NULL) { return NULL; } if (access(target, F_OK) == -1) { /* * Target doesn't exist. */ errno = ENOENT; return NULL; } } if (access(src, F_OK) != -1) { /* * Src exists. */ errno = EEXIST; return NULL; } /* * Check symbolic link flag first, since we prefer to create these. */ if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { Tcl_DString ds; Tcl_Obj *transPtr; Tcl_Size length; /* * Now we don't want to link to the absolute, normalized path. * Relative links are quite acceptable (but links to ~user are not * -- these must be expanded first). */ transPtr = Tcl_FSGetTranslatedPath(NULL, toPtr); if (transPtr == NULL) { return NULL; } target = TclGetStringFromObj(transPtr, &length); if (Tcl_UtfToExternalDStringEx(NULL, NULL, target, length, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } target = Tcl_DStringValue(&ds); Tcl_DecrRefCount(transPtr); if (symlink(target, src) != 0) { toPtr = NULL; } Tcl_DStringFree(&ds); } else if (linkAction & TCL_CREATE_HARD_LINK) { if (link(target, src) != 0) { return NULL; } } else { errno = ENODEV; return NULL; } return toPtr; } else { Tcl_Obj *linkPtr = NULL; char link[MAXPATHLEN]; ssize_t length; Tcl_DString ds; Tcl_Obj *transPtr; transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); if (transPtr == NULL) { return NULL; } Tcl_DecrRefCount(transPtr); length = readlink((const char *)Tcl_FSGetNativePath(pathPtr), link, sizeof(link)); if (length < 0) { return NULL; } if (Tcl_ExternalToUtfDStringEx(NULL, NULL, link, (size_t)length, 0, &ds, NULL) != TCL_OK) { return NULL; } linkPtr = Tcl_DStringToObj(&ds); Tcl_IncrRefCount(linkPtr); return linkPtr; } } #endif /* S_IFLNK */ /* *--------------------------------------------------------------------------- * * TclpFilesystemPathType -- * * This function is part of the native filesystem support, and returns * the path type of the given path. Right now it simply returns NULL. In * the future it could return specific path types, like 'nfs', 'samba', * 'FAT32', etc. * * Results: * NULL at present. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpFilesystemPathType( TCL_UNUSED(Tcl_Obj *)) { /* * All native paths are of the same type. */ return NULL; } /* *--------------------------------------------------------------------------- * * TclpNativeToNormalized -- * * Convert native format to a normalized path object, with refCount of * zero. * * Currently assumes all native paths are actually normalized already, so * if the path given is not normalized this will actually just convert to * a valid string path, but not necessarily a normalized one. * * Results: * A valid normalized path. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpNativeToNormalized( void *clientData) { Tcl_DString ds; Tcl_ExternalToUtfDStringEx(NULL, NULL, (const char *) clientData, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); return Tcl_DStringToObj(&ds); } /* *--------------------------------------------------------------------------- * * TclNativeCreateNativeRep -- * * Create a native representation for the given path. * * Results: * The nativePath representation. * * Side effects: * Memory will be allocated. The path may need to be normalized. * *--------------------------------------------------------------------------- */ void * TclNativeCreateNativeRep( Tcl_Obj *pathPtr) { char *nativePathPtr; const char *str; Tcl_DString ds; Tcl_Obj *validPathPtr; Tcl_Size len; if (TclFSCwdIsNative() || Tcl_FSGetPathType(pathPtr) == TCL_PATH_ABSOLUTE) { /* * The cwd is native (or path is absolute), use the translated path * without worrying about normalization (this will also usually be * shorter so the utf-to-external conversion will be somewhat faster). */ validPathPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); if (validPathPtr == NULL) { return NULL; } } else { /* * Make sure the normalized path is set. */ validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); if (validPathPtr == NULL) { return NULL; } Tcl_IncrRefCount(validPathPtr); } str = TclGetStringFromObj(validPathPtr, &len); if (Tcl_UtfToExternalDStringEx(NULL, NULL, str, len, 0, &ds, NULL) != TCL_OK) { Tcl_DecrRefCount(validPathPtr); Tcl_DStringFree(&ds); return NULL; } len = Tcl_DStringLength(&ds) + sizeof(char); if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) { /* See bug [3118489]: NUL in filenames */ Tcl_DecrRefCount(validPathPtr); Tcl_DStringFree(&ds); return NULL; } Tcl_DecrRefCount(validPathPtr); nativePathPtr = (char *)Tcl_Alloc(len); memcpy(nativePathPtr, Tcl_DStringValue(&ds), len); Tcl_DStringFree(&ds); return nativePathPtr; } /* *--------------------------------------------------------------------------- * * TclNativeDupInternalRep -- * * Duplicate the native representation. * * Results: * The copied native representation, or NULL if it is not possible to * copy the representation. * * Side effects: * Memory will be allocated for the copy. * *--------------------------------------------------------------------------- */ void * TclNativeDupInternalRep( void *clientData) { char *copy; size_t len; if (clientData == NULL) { return NULL; } /* * ASCII representation when running on Unix. */ len = (strlen((const char*) clientData) + 1) * sizeof(char); copy = (char *)Tcl_Alloc(len); memcpy(copy, clientData, len); return copy; } /* *--------------------------------------------------------------------------- * * TclpUtime -- * * Set the modification date for a file. * * Results: * 0 on success, -1 on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ int TclpUtime( Tcl_Obj *pathPtr, /* File to modify */ struct utimbuf *tval) /* New modification date structure */ { return utime((const char *)Tcl_FSGetNativePath(pathPtr), tval); } #ifdef __CYGWIN__ int TclOSfstat( int fd, void *cygstat) { struct stat buf; Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat; int result = fstat(fd, &buf); statBuf->st_mode = (unsigned short)buf.st_mode; statBuf->st_ino = (unsigned short)buf.st_ino; statBuf->st_dev = buf.st_dev; statBuf->st_rdev = buf.st_rdev; statBuf->st_nlink = buf.st_nlink; statBuf->st_uid = (short)buf.st_uid; statBuf->st_gid = (short)buf.st_gid; statBuf->st_size = buf.st_size; statBuf->st_atime = buf.st_atime; statBuf->st_mtime = buf.st_mtime; statBuf->st_ctime = buf.st_ctime; return result; } int TclOSstat( const char *name, void *cygstat) { struct stat buf; Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat; int result = stat(name, &buf); statBuf->st_mode = (unsigned short)buf.st_mode; statBuf->st_ino = (unsigned short)buf.st_ino; statBuf->st_dev = buf.st_dev; statBuf->st_rdev = buf.st_rdev; statBuf->st_nlink = buf.st_nlink; statBuf->st_uid = (short)buf.st_uid; statBuf->st_gid = (short)buf.st_gid; statBuf->st_size = buf.st_size; statBuf->st_atime = buf.st_atime; statBuf->st_mtime = buf.st_mtime; statBuf->st_ctime = buf.st_ctime; return result; } int TclOSlstat( const char *name, void *cygstat) { struct stat buf; Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat; int result = lstat(name, &buf); statBuf->st_mode = (unsigned short)buf.st_mode; statBuf->st_ino = (unsigned short)buf.st_ino; statBuf->st_dev = buf.st_dev; statBuf->st_rdev = buf.st_rdev; statBuf->st_nlink = buf.st_nlink; statBuf->st_uid = (short)buf.st_uid; statBuf->st_gid = (short)buf.st_gid; statBuf->st_size = buf.st_size; statBuf->st_atime = buf.st_atime; statBuf->st_mtime = buf.st_mtime; statBuf->st_ctime = buf.st_ctime; return result; } #endif /* CYGWIN */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixFCmd.c0000644000175000017500000020656715104661341015076 0ustar sergeisergei/* * tclUnixFCmd.c * * This file implements the Unix specific portion of file manipulation * subcommands of the "file" command. All filename arguments should * already be translated to native format. * * Copyright © 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * Portions of this code were derived from NetBSD source code which has the * following copyright notice: * * Copyright © 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #include "tclInt.h" #ifndef HAVE_STRUCT_STAT_ST_BLKSIZE #ifndef NO_FSTATFS #include #endif #endif /* !HAVE_STRUCT_STAT_ST_BLKSIZE */ #ifdef HAVE_FTS #include #endif /* * The following constants specify the type of callback when * TraverseUnixTree() calls the traverseProc() */ #define DOTREE_PRED 1 /* pre-order directory */ #define DOTREE_POSTD 2 /* post-order directory */ #define DOTREE_F 3 /* regular file */ /* * Fallback temporary file location the temporary file generation code. Can be * overridden at compile time for when it is known that temp files can't be * written to /tmp (hello, iOS!). */ #ifndef TCL_TEMPORARY_FILE_DIRECTORY #define TCL_TEMPORARY_FILE_DIRECTORY "/tmp" #endif /* * Callbacks for file attributes code. */ static int GetGroupAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int GetOwnerAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int GetPermissionsAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int SetGroupAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); static int SetOwnerAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); static int SetPermissionsAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); static int GetModeFromPermString(Tcl_Interp *interp, const char *modeStringPtr, mode_t *modePtr); #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__) static int GetUnixFileAttributes(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); static int SetUnixFileAttributes(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); #endif /* * Prototype for the TraverseUnixTree callback function. */ typedef int (TraversalProc)(Tcl_DString *srcPtr, Tcl_DString *dstPtr, const Tcl_StatBuf *statBufPtr, int type, Tcl_DString *errorPtr); /* * Constants and variables necessary for file attributes subcommand. * * IMPORTANT: The permissions attribute is assumed to be the third item (i.e. * to be indexed with '2' in arrays) in code in tclIOUtil.c and possibly * elsewhere in Tcl's core. */ #ifndef DJGPP enum { #if defined(__CYGWIN__) UNIX_ARCHIVE_ATTRIBUTE, #endif UNIX_GROUP_ATTRIBUTE, #if defined(__CYGWIN__) UNIX_HIDDEN_ATTRIBUTE, #endif UNIX_OWNER_ATTRIBUTE, UNIX_PERMISSIONS_ATTRIBUTE, #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__) UNIX_READONLY_ATTRIBUTE, #endif #if defined(__CYGWIN__) UNIX_SYSTEM_ATTRIBUTE, #endif #ifdef MAC_OSX_TCL MACOSX_CREATOR_ATTRIBUTE, MACOSX_TYPE_ATTRIBUTE, MACOSX_HIDDEN_ATTRIBUTE, MACOSX_RSRCLENGTH_ATTRIBUTE, #endif UNIX_INVALID_ATTRIBUTE }; const char *const tclpFileAttrStrings[] = { #if defined(__CYGWIN__) "-archive", #endif "-group", #if defined(__CYGWIN__) "-hidden", #endif "-owner", "-permissions", #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__) "-readonly", #endif #if defined(__CYGWIN__) "-system", #endif #ifdef MAC_OSX_TCL "-creator", "-type", "-hidden", "-rsrclength", #endif NULL }; const TclFileAttrProcs tclpFileAttrProcs[] = { #if defined(__CYGWIN__) {GetUnixFileAttributes, SetUnixFileAttributes}, #endif {GetGroupAttribute, SetGroupAttribute}, #if defined(__CYGWIN__) {GetUnixFileAttributes, SetUnixFileAttributes}, #endif {GetOwnerAttribute, SetOwnerAttribute}, {GetPermissionsAttribute, SetPermissionsAttribute}, #if defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) || defined(__CYGWIN__) {GetUnixFileAttributes, SetUnixFileAttributes}, #endif #if defined(__CYGWIN__) {GetUnixFileAttributes, SetUnixFileAttributes}, #endif #ifdef MAC_OSX_TCL {TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute}, {TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute}, {TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute}, {TclMacOSXGetFileAttribute, TclMacOSXSetFileAttribute}, #endif }; #endif /* DJGPP */ /* * This is the maximum number of consecutive readdir/unlink calls that can be * made (with no intervening rewinddir or closedir/opendir) before triggering * a bug that makes readdir return NULL even though some directory entries * have not been processed. The bug afflicts SunOS's readdir when applied to * ufs file systems and Darwin 6.5's (and OSX v.10.3.8's) HFS+. JH found the * Darwin readdir to reset at 147, so 130 is chosen to be conservative. We * can't do a general rewind on failure as NFS can create special files that * recreate themselves when you try and delete them. 8.4.8 added a solution * that was affected by a single such NFS file, this solution should not be * affected by less than THRESHOLD such files. [Bug 1034337] */ #define MAX_READDIR_UNLINK_THRESHOLD 130 /* * Declarations for local procedures defined in this file: */ static int CopyFileAtts(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); static const char * DefaultTempDir(void); static int DoCopyFile(const char *srcPtr, const char *dstPtr, const Tcl_StatBuf *statBufPtr); static int DoCreateDirectory(const char *pathPtr); static int DoRemoveDirectory(Tcl_DString *pathPtr, int recursive, Tcl_DString *errorPtr); static int DoRenameFile(const char *src, const char *dst); static int TraversalCopy(Tcl_DString *srcPtr, Tcl_DString *dstPtr, const Tcl_StatBuf *statBufPtr, int type, Tcl_DString *errorPtr); static int TraversalDelete(Tcl_DString *srcPtr, Tcl_DString *dstPtr, const Tcl_StatBuf *statBufPtr, int type, Tcl_DString *errorPtr); static int TraverseUnixTree(TraversalProc *traversalProc, Tcl_DString *sourcePtr, Tcl_DString *destPtr, Tcl_DString *errorPtr, int doRewind); #ifdef PURIFY /* * realpath and purify don't mix happily. It has been noted that realpath * should not be used with purify because of bogus warnings, but just * memset'ing the resolved path will squelch those. This assumes we are * passing the standard MAXPATHLEN size resolved arg. */ static char * Realpath(const char *path, char *resolved); char * Realpath( const char *path, char *resolved) { memset(resolved, 0, MAXPATHLEN); return realpath(path, resolved); } #else # define Realpath realpath #endif /* PURIFY */ #ifndef NO_REALPATH # define haveRealpath 1 #endif /* NO_REALPATH */ #ifdef HAVE_FTS #if defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__) /* fts doesn't do stat64 */ # define noFtsStat 1 #else # define noFtsStat 0 #endif #endif /* HAVE_FTS */ /* *--------------------------------------------------------------------------- * * TclpObjRenameFile, DoRenameFile -- * * Changes the name of an existing file or directory, from src to dst. If * src and dst refer to the same file or directory, does nothing and * returns success. Otherwise if dst already exists, it will be deleted * and replaced by src subject to the following conditions: * If src is a directory, dst may be an empty directory. * If src is a file, dst may be a file. * In any other situation where dst already exists, the rename will fail. * * Results: * If the directory was successfully created, returns TCL_OK. Otherwise * the return value is TCL_ERROR and errno is set to indicate the error. * Some possible values for errno are: * * EACCES: src or dst parent directory can't be read and/or written. * EEXIST: dst is a non-empty directory. * EINVAL: src is a root directory or dst is a subdirectory of src. * EISDIR: dst is a directory, but src is not. * ENOENT: src doesn't exist, or src or dst is "". * ENOTDIR: src is a directory, but dst is not. * EXDEV: src and dst are on different filesystems. * * Side effects: * The implementation of rename may allow cross-filesystem renames, but * the caller should be prepared to emulate it with copy and delete if * errno is EXDEV. * *--------------------------------------------------------------------------- */ int TclpObjRenameFile( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr) { return DoRenameFile((const char *)Tcl_FSGetNativePath(srcPathPtr), (const char *)Tcl_FSGetNativePath(destPathPtr)); } static int DoRenameFile( const char *src, /* Pathname of file or dir to be renamed * (native). */ const char *dst) /* New pathname of file or directory * (native). */ { if (rename(src, dst) == 0) { /* INTL: Native. */ return TCL_OK; } if (errno == ENOTEMPTY) { errno = EEXIST; } /* * IRIX returns EIO when you attempt to move a directory into itself. We * just map EIO to EINVAL get the right message on SGI. Most platforms * don't return EIO except in really strange cases. */ if (errno == EIO) { errno = EINVAL; } #ifndef NO_REALPATH /* * SunOS 4.1.4 reports overwriting a non-empty directory with a directory * as EINVAL instead of EEXIST (first rule out the correct EINVAL result * code for moving a directory into itself). Must be conditionally * compiled because realpath() not defined on all systems. */ if (errno == EINVAL && haveRealpath) { char srcPath[MAXPATHLEN], dstPath[MAXPATHLEN]; TclDIR *dirPtr; Tcl_DirEntry *dirEntPtr; if ((Realpath((char *) src, srcPath) != NULL) /* INTL: Native. */ && (Realpath((char *) dst, dstPath) != NULL) /* INTL: Native */ && (strncmp(srcPath, dstPath, strlen(srcPath)) != 0)) { dirPtr = TclOSopendir(dst); /* INTL: Native. */ if (dirPtr != NULL) { while (1) { dirEntPtr = TclOSreaddir(dirPtr); /* INTL: Native. */ if (dirEntPtr == NULL) { break; } if ((strcmp(dirEntPtr->d_name, ".") != 0) && (strcmp(dirEntPtr->d_name, "..") != 0)) { errno = EEXIST; TclOSclosedir(dirPtr); return TCL_ERROR; } } TclOSclosedir(dirPtr); } } errno = EINVAL; } #endif /* !NO_REALPATH */ if (strcmp(src, "/") == 0) { /* * Alpha reports renaming / as EBUSY and Linux reports it as EACCES, * instead of EINVAL. */ errno = EINVAL; } /* * DEC Alpha OSF1 V3.0 returns EACCES when attempting to move a file * across filesystems and the parent directory of that file is not * writable. Most other systems return EXDEV. Does nothing to correct this * behavior. */ return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TclpObjCopyFile, DoCopyFile -- * * Copy a single file (not a directory). If dst already exists and is not * a directory, it is removed. * * Results: * If the file was successfully copied, returns TCL_OK. Otherwise the * return value is TCL_ERROR and errno is set to indicate the error. Some * possible values for errno are: * * EACCES: src or dst parent directory can't be read and/or written. * EISDIR: src or dst is a directory. * ENOENT: src doesn't exist. src or dst is "". * * Side effects: * This procedure will also copy symbolic links, block, and character * devices, and fifos. For symbolic links, the links themselves will be * copied and not what they point to. For the other special file types, * the directory entry will be copied and not the contents of the device * that it refers to. * *--------------------------------------------------------------------------- */ int TclpObjCopyFile( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr) { const char *src = (const char *)Tcl_FSGetNativePath(srcPathPtr); Tcl_StatBuf srcStatBuf; if (TclOSlstat(src, &srcStatBuf) != 0) { /* INTL: Native. */ return TCL_ERROR; } return DoCopyFile(src, (const char *)Tcl_FSGetNativePath(destPathPtr), &srcStatBuf); } static int DoCopyFile( const char *src, /* Pathname of file to be copied (native). */ const char *dst, /* Pathname of file to copy to (native). */ const Tcl_StatBuf *statBufPtr) /* Used to determine filetype. */ { Tcl_StatBuf dstStatBuf; if (S_ISDIR(statBufPtr->st_mode)) { errno = EISDIR; return TCL_ERROR; } /* * Symlink, and some of the other calls will fail if the target exists, so * we remove it first. */ if (TclOSlstat(dst, &dstStatBuf) == 0) { /* INTL: Native. */ if (S_ISDIR(dstStatBuf.st_mode)) { errno = EISDIR; return TCL_ERROR; } } if (unlink(dst) != 0) { /* INTL: Native. */ if (errno != ENOENT) { return TCL_ERROR; } } switch ((int)(statBufPtr->st_mode & S_IFMT)) { #ifndef DJGPP case S_IFLNK: { char linkBuf[MAXPATHLEN+1]; ssize_t length; length = readlink(src, linkBuf, MAXPATHLEN); /* INTL: Native. */ if (length == -1) { return TCL_ERROR; } linkBuf[length] = '\0'; if (symlink(linkBuf, dst) < 0) { /* INTL: Native. */ return TCL_ERROR; } #ifdef MAC_OSX_TCL TclMacOSXCopyFileAttributes(src, dst, statBufPtr); #endif break; } #endif /* !DJGPP */ case S_IFBLK: case S_IFCHR: if (mknod(dst, statBufPtr->st_mode, /* INTL: Native. */ statBufPtr->st_rdev) < 0) { return TCL_ERROR; } return CopyFileAtts(src, dst, statBufPtr); case S_IFIFO: if (mkfifo(dst, statBufPtr->st_mode) < 0) { /* INTL: Native. */ return TCL_ERROR; } return CopyFileAtts(src, dst, statBufPtr); default: return TclUnixCopyFile(src, dst, statBufPtr, 0); } return TCL_OK; } /* *---------------------------------------------------------------------- * * TclUnixCopyFile - * * Helper function for TclpCopyFile. Copies one regular file, using * read() and write(). * * Results: * A standard Tcl result. * * Side effects: * A file is copied. Dst will be overwritten if it exists. * *---------------------------------------------------------------------- */ int TclUnixCopyFile( const char *src, /* Pathname of file to copy (native). */ const char *dst, /* Pathname of file to create/overwrite * (native). */ const Tcl_StatBuf *statBufPtr, /* Used to determine mode and blocksize. */ int dontCopyAtts) /* If flag set, don't copy attributes. */ { int srcFd, dstFd; size_t blockSize; /* Optimal I/O blocksize for filesystem */ char *buffer; /* Data buffer for copy */ ssize_t nread; #ifdef DJGPP #define BINMODE |O_BINARY #else #define BINMODE #endif /* DJGPP */ #define DEFAULT_COPY_BLOCK_SIZE 4096 if ((srcFd = TclOSopen(src, O_RDONLY BINMODE, 0)) < 0) { /* INTL: Native */ return TCL_ERROR; } dstFd = TclOSopen(dst, O_CREAT|O_TRUNC|O_WRONLY BINMODE, /* INTL: Native */ statBufPtr->st_mode); if (dstFd < 0) { close(srcFd); return TCL_ERROR; } /* * Try to work out the best size of buffer to use for copying. If we * can't, it's no big deal as we can just use a (32-bit) page, since * that's likely to be fairly efficient anyway. */ #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE blockSize = statBufPtr->st_blksize; #elif !defined(NO_FSTATFS) { struct statfs fs; if (fstatfs(srcFd, &fs) == 0) { blockSize = fs.f_bsize; } else { blockSize = DEFAULT_COPY_BLOCK_SIZE; } } #else blockSize = DEFAULT_COPY_BLOCK_SIZE; #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */ /* * [SF Tcl Bug 1586470] Even if we HAVE_STRUCT_STAT_ST_BLKSIZE, there are * filesystems which report a bogus value for the blocksize. An example * is the Andrew Filesystem (afs), reporting a blocksize of 0. When * detecting such a situation we now simply fall back to a hardwired * default size. */ if (blockSize <= 0) { blockSize = DEFAULT_COPY_BLOCK_SIZE; } buffer = (char *)Tcl_Alloc(blockSize); while (1) { nread = read(srcFd, buffer, blockSize); if ((nread == -1) || (nread == 0)) { break; } if (write(dstFd, buffer, nread) != nread) { nread = -1; break; } } Tcl_Free(buffer); close(srcFd); if ((close(dstFd) != 0) || (nread == -1)) { unlink(dst); /* INTL: Native. */ return TCL_ERROR; } if (!dontCopyAtts && CopyFileAtts(src, dst, statBufPtr) == TCL_ERROR) { /* * The copy succeeded, but setting the permissions failed, so be in a * consistent state, we remove the file that was created by the copy. */ unlink(dst); /* INTL: Native. */ return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TclpObjDeleteFile, TclpDeleteFile -- * * Removes a single file (not a directory). * * Results: * If the file was successfully deleted, returns TCL_OK. Otherwise the * return value is TCL_ERROR and errno is set to indicate the error. Some * possible values for errno are: * * EACCES: a parent directory can't be read and/or written. * EISDIR: path is a directory. * ENOENT: path doesn't exist or is "". * * Side effects: * The file is deleted, even if it is read-only. * *--------------------------------------------------------------------------- */ int TclpObjDeleteFile( Tcl_Obj *pathPtr) { return TclpDeleteFile(Tcl_FSGetNativePath(pathPtr)); } int TclpDeleteFile( const void *path) /* Pathname of file to be removed (native). */ { if (unlink((const char *)path) != 0) { return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TclpCreateDirectory, DoCreateDirectory -- * * Creates the specified directory. All parent directories of the * specified directory must already exist. The directory is automatically * created with permissions so that user can access the new directory and * create new files or subdirectories in it. * * Results: * If the directory was successfully created, returns TCL_OK. Otherwise * the return value is TCL_ERROR and errno is set to indicate the error. * Some possible values for errno are: * * EACCES: a parent directory can't be read and/or written. * EEXIST: path already exists. * ENOENT: a parent directory doesn't exist. * * Side effects: * A directory is created with the current umask, except that permission * for u+rwx will always be added. * *--------------------------------------------------------------------------- */ int TclpObjCreateDirectory( Tcl_Obj *pathPtr) { return DoCreateDirectory((const char *)Tcl_FSGetNativePath(pathPtr)); } static int DoCreateDirectory( const char *path) /* Pathname of directory to create (native). */ { mode_t mode; mode = umask(0); umask(mode); /* * umask return value is actually the inverse of the permissions. */ mode = (0777 & ~mode) | S_IRUSR | S_IWUSR | S_IXUSR; if (mkdir(path, mode) != 0) { /* INTL: Native. */ return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TclpObjCopyDirectory -- * * Recursively copies a directory. The target directory dst must not * already exist. Note that this function does not merge two directory * hierarchies, even if the target directory is an empty directory. * * Results: * If the directory was successfully copied, returns TCL_OK. Otherwise * the return value is TCL_ERROR, errno is set to indicate the error, and * the pathname of the file that caused the error is stored in errorPtr. * See TclpObjCreateDirectory and TclpObjCopyFile for a description of * possible values for errno. * * Side effects: * An exact copy of the directory hierarchy src will be created with the * name dst. If an error occurs, the error will be returned immediately, * and remaining files will not be processed. * *--------------------------------------------------------------------------- */ int TclpObjCopyDirectory( Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr) { Tcl_DString ds; Tcl_DString srcString, dstString; int ret; Tcl_Obj *transPtr; transPtr = Tcl_FSGetTranslatedPath(NULL,srcPathPtr); ret = Tcl_UtfToExternalDStringEx(NULL, NULL, (transPtr != NULL ? TclGetString(transPtr) : NULL), -1, 0, &srcString, NULL); if (transPtr != NULL) { Tcl_DecrRefCount(transPtr); } if (ret != TCL_OK) { *errorPtr = srcPathPtr; } else { transPtr = Tcl_FSGetTranslatedPath(NULL,destPathPtr); ret = Tcl_UtfToExternalDStringEx(NULL, NULL, (transPtr != NULL ? TclGetString(transPtr) : NULL), -1, TCL_ENCODING_PROFILE_TCL8, &dstString, NULL); if (transPtr != NULL) { Tcl_DecrRefCount(transPtr); } if (ret != TCL_OK) { *errorPtr = destPathPtr; } else { ret = TraverseUnixTree(TraversalCopy, &srcString, &dstString, &ds, 0); /* Note above call only sets ds on error */ if (ret != TCL_OK) { *errorPtr = Tcl_DStringToObj(&ds); } Tcl_DStringFree(&dstString); } Tcl_DStringFree(&srcString); } if (ret != TCL_OK) { Tcl_IncrRefCount(*errorPtr); } return ret; } /* *--------------------------------------------------------------------------- * * TclpRemoveDirectory, DoRemoveDirectory -- * * Removes directory (and its contents, if the recursive flag is set). * * Results: * If the directory was successfully removed, returns TCL_OK. Otherwise * the return value is TCL_ERROR, errno is set to indicate the error, and * the pathname of the file that caused the error is stored in errorPtr. * Some possible values for errno are: * * EACCES: path directory can't be read and/or written. * EEXIST: path is a non-empty directory. * EINVAL: path is a root directory. * ENOENT: path doesn't exist or is "". * ENOTDIR: path is not a directory. * * Side effects: * Directory removed. If an error occurs, the error will be returned * immediately, and remaining files will not be deleted. * *--------------------------------------------------------------------------- */ int TclpObjRemoveDirectory( Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr) { Tcl_DString ds; Tcl_DString pathString; int ret; Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); ret = Tcl_UtfToExternalDStringEx(NULL, NULL, (transPtr != NULL ? TclGetString(transPtr) : NULL), -1, TCL_ENCODING_PROFILE_TCL8, &pathString, NULL); if (transPtr != NULL) { Tcl_DecrRefCount(transPtr); } if (ret != TCL_OK) { *errorPtr = pathPtr; } else { ret = DoRemoveDirectory(&pathString, recursive, &ds); Tcl_DStringFree(&pathString); /* Note above call only sets ds on error */ if (ret != TCL_OK) { *errorPtr = Tcl_DStringToObj(&ds); } } if (ret != TCL_OK) { Tcl_IncrRefCount(*errorPtr); } return ret; } static int DoRemoveDirectory( Tcl_DString *pathPtr, /* Pathname of directory to be removed * (native). */ int recursive, /* If non-zero, removes directories that are * nonempty. Otherwise, will only remove empty * directories. */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { const char *path; mode_t oldPerm = 0; int result; path = Tcl_DStringValue(pathPtr); if (recursive != 0) { /* * We should try to change permissions so this can be deleted. */ Tcl_StatBuf statBuf; int newPerm; if (TclOSstat(path, &statBuf) == 0) { oldPerm = (mode_t) (statBuf.st_mode & 0x00007FFF); } newPerm = oldPerm | (64+128+256); chmod(path, (mode_t) newPerm); } if (rmdir(path) == 0) { /* INTL: Native. */ return TCL_OK; } if (errno == ENOTEMPTY) { errno = EEXIST; } result = TCL_OK; if ((errno != EEXIST) || (recursive == 0)) { if (errorPtr != NULL) { Tcl_ExternalToUtfDStringEx(NULL, NULL, path, TCL_INDEX_NONE, 0, errorPtr, NULL); } result = TCL_ERROR; } /* * The directory is nonempty, but the recursive flag has been specified, * so we recursively remove all the files in the directory. */ if (result == TCL_OK) { result = TraverseUnixTree(TraversalDelete, pathPtr, NULL, errorPtr, 1); } if ((result != TCL_OK) && (recursive != 0)) { /* * Try to restore permissions. */ chmod(path, oldPerm); } return result; } /* *--------------------------------------------------------------------------- * * TraverseUnixTree -- * * Traverse directory tree specified by sourcePtr, calling the function * traverseProc for each file and directory encountered. If destPtr is * non-null, each of name in the sourcePtr directory is appended to the * directory specified by destPtr and passed as the second argument to * traverseProc(). * * Results: * Standard Tcl result. * * Side effects: * None caused by TraverseUnixTree, however the user specified * traverseProc() may change state. If an error occurs, the error will be * returned immediately, and remaining files will not be processed. * *--------------------------------------------------------------------------- */ static int TraverseUnixTree( TraversalProc *traverseProc,/* Function to call for every file and * directory in source hierarchy. */ Tcl_DString *sourcePtr, /* Pathname of source directory to be * traversed (native). */ Tcl_DString *targetPtr, /* Pathname of directory to traverse in * parallel with source directory (native). */ Tcl_DString *errorPtr, /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ int doRewind) /* Flag indicating that to ensure complete * traversal of source hierarchy, the readdir * loop should be rewound whenever * traverseProc has returned TCL_OK; this is * required when traverseProc modifies the * source hierarchy, e.g. by deleting * files. */ { Tcl_StatBuf statBuf; const char *source, *errfile; int result; size_t targetLen, sourceLen; #ifndef HAVE_FTS int numProcessed = 0; Tcl_DirEntry *dirEntPtr; TclDIR *dirPtr; #else const char *paths[2] = {NULL, NULL}; FTS *fts = NULL; FTSENT *ent; #endif errfile = NULL; result = TCL_OK; targetLen = 0; source = Tcl_DStringValue(sourcePtr); if (TclOSlstat(source, &statBuf) != 0) { /* INTL: Native. */ errfile = source; goto end; } if (!S_ISDIR(statBuf.st_mode)) { /* * Process the regular file */ return traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_F, errorPtr); } #ifndef HAVE_FTS dirPtr = TclOSopendir(source); /* INTL: Native. */ if (dirPtr == NULL) { /* * Can't read directory */ errfile = source; goto end; } result = traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_PRED, errorPtr); if (result != TCL_OK) { TclOSclosedir(dirPtr); return result; } TclDStringAppendLiteral(sourcePtr, "/"); sourceLen = Tcl_DStringLength(sourcePtr); if (targetPtr != NULL) { TclDStringAppendLiteral(targetPtr, "/"); targetLen = Tcl_DStringLength(targetPtr); } while ((dirEntPtr = TclOSreaddir(dirPtr)) != NULL) { /* INTL: Native. */ if ((dirEntPtr->d_name[0] == '.') && ((dirEntPtr->d_name[1] == '\0') || (strcmp(dirEntPtr->d_name, "..") == 0))) { continue; } /* * Append name after slash, and recurse on the file. */ Tcl_DStringAppend(sourcePtr, dirEntPtr->d_name, TCL_INDEX_NONE); if (targetPtr != NULL) { Tcl_DStringAppend(targetPtr, dirEntPtr->d_name, TCL_INDEX_NONE); } result = TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr, doRewind); if (result != TCL_OK) { break; } else { numProcessed++; } /* * Remove name after slash. */ Tcl_DStringSetLength(sourcePtr, sourceLen); if (targetPtr != NULL) { Tcl_DStringSetLength(targetPtr, targetLen); } if (doRewind && (numProcessed > MAX_READDIR_UNLINK_THRESHOLD)) { /* * Call rewinddir if we've called unlink or rmdir so many times * (since the opendir or the previous rewinddir), to avoid a * NULL-return that may a symptom of a buggy readdir. */ TclOSrewinddir(dirPtr); numProcessed = 0; } } TclOSclosedir(dirPtr); /* * Strip off the trailing slash we added */ Tcl_DStringSetLength(sourcePtr, sourceLen - 1); if (targetPtr != NULL) { Tcl_DStringSetLength(targetPtr, targetLen - 1); } if (result == TCL_OK) { /* * Call traverseProc() on a directory after visiting all the files in * that directory. */ result = traverseProc(sourcePtr, targetPtr, &statBuf, DOTREE_POSTD, errorPtr); } #else /* HAVE_FTS */ paths[0] = source; fts = fts_open((char **) paths, FTS_PHYSICAL | FTS_NOCHDIR | (noFtsStat || doRewind ? FTS_NOSTAT : 0), NULL); if (fts == NULL) { errfile = source; goto end; } sourceLen = Tcl_DStringLength(sourcePtr); if (targetPtr != NULL) { targetLen = Tcl_DStringLength(targetPtr); } while ((ent = fts_read(fts)) != NULL) { unsigned short info = ent->fts_info; char *path = ent->fts_path + sourceLen; Tcl_Size pathlen = ent->fts_pathlen - sourceLen; int type; Tcl_StatBuf *statBufPtr = NULL; if (info == FTS_DNR || info == FTS_ERR || info == FTS_NS) { errfile = ent->fts_path; break; } Tcl_DStringAppend(sourcePtr, path, pathlen); if (targetPtr != NULL) { Tcl_DStringAppend(targetPtr, path, pathlen); } switch (info) { case FTS_D: type = DOTREE_PRED; break; case FTS_DP: type = DOTREE_POSTD; break; default: type = DOTREE_F; break; } if (!doRewind) { /* no need to stat for delete */ if (noFtsStat) { statBufPtr = &statBuf; if (TclOSlstat(ent->fts_path, statBufPtr) != 0) { errfile = ent->fts_path; break; } } else { statBufPtr = (Tcl_StatBuf *) ent->fts_statp; } } result = traverseProc(sourcePtr, targetPtr, statBufPtr, type, errorPtr); if (result != TCL_OK) { break; } Tcl_DStringSetLength(sourcePtr, sourceLen); if (targetPtr != NULL) { Tcl_DStringSetLength(targetPtr, targetLen); } } #endif /* !HAVE_FTS */ end: if (errfile != NULL) { if (errorPtr != NULL) { Tcl_ExternalToUtfDStringEx(NULL, NULL, errfile, TCL_INDEX_NONE, 0, errorPtr, NULL); } result = TCL_ERROR; } #ifdef HAVE_FTS if (fts != NULL) { fts_close(fts); } #endif return result; } /* *---------------------------------------------------------------------- * * TraversalCopy * * Called from TraverseUnixTree in order to execute a recursive copy of a * directory. * * Results: * Standard Tcl result. * * Side effects: * The file or directory src may be copied to dst, depending on the value * of type. * *---------------------------------------------------------------------- */ static int TraversalCopy( Tcl_DString *srcPtr, /* Source pathname to copy (native). */ Tcl_DString *dstPtr, /* Destination pathname of copy (native). */ const Tcl_StatBuf *statBufPtr, /* Stat info for file specified by srcPtr. */ int type, /* Reason for call - see TraverseUnixTree(). */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { switch (type) { case DOTREE_F: if (DoCopyFile(Tcl_DStringValue(srcPtr), Tcl_DStringValue(dstPtr), statBufPtr) == TCL_OK) { return TCL_OK; } break; case DOTREE_PRED: if (DoCreateDirectory(Tcl_DStringValue(dstPtr)) == TCL_OK) { return TCL_OK; } break; case DOTREE_POSTD: if (CopyFileAtts(Tcl_DStringValue(srcPtr), Tcl_DStringValue(dstPtr), statBufPtr) == TCL_OK) { return TCL_OK; } break; } /* * There shouldn't be a problem with src, because we already checked it to * get here. */ if (errorPtr != NULL) { Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(dstPtr), Tcl_DStringLength(dstPtr), 0, errorPtr, NULL); } return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * TraversalDelete -- * * Called by procedure TraverseUnixTree for every file and directory that * it encounters in a directory hierarchy. This procedure unlinks files, * and removes directories after all the containing files have been * processed. * * Results: * Standard Tcl result. * * Side effects: * Files or directory specified by src will be deleted. * *---------------------------------------------------------------------- */ static int TraversalDelete( Tcl_DString *srcPtr, /* Source pathname (native). */ TCL_UNUSED(Tcl_DString *), TCL_UNUSED(const Tcl_StatBuf *), int type, /* Reason for call - see TraverseUnixTree(). */ Tcl_DString *errorPtr) /* If non-NULL, uninitialized or free DString * filled with UTF-8 name of file causing * error. */ { switch (type) { case DOTREE_F: if (TclpDeleteFile(Tcl_DStringValue(srcPtr)) == 0) { return TCL_OK; } break; case DOTREE_PRED: return TCL_OK; case DOTREE_POSTD: if (DoRemoveDirectory(srcPtr, 0, NULL) == 0) { return TCL_OK; } break; } if (errorPtr != NULL) { Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(srcPtr), Tcl_DStringLength(srcPtr), 0, errorPtr, NULL); } return TCL_ERROR; } /* *--------------------------------------------------------------------------- * * CopyFileAtts -- * * Copy the file attributes such as owner, group, permissions, and * modification date from one file to another. * * Results: * Standard Tcl result. * * Side effects: * User id, group id, permission bits, last modification time, and last * access time are updated in the new file to reflect the old file. * *--------------------------------------------------------------------------- */ static int CopyFileAtts( #ifdef MAC_OSX_TCL const char *src, /* Path name of source file (native). */ #else TCL_UNUSED(const char *) /*src*/, #endif const char *dst, /* Path name of target file (native). */ const Tcl_StatBuf *statBufPtr) /* Stat info for source file */ { struct utimbuf tval; mode_t newMode; newMode = statBufPtr->st_mode & (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO); /* * Note that if you copy a setuid file that is owned by someone else, and * you are not root, then the copy will be setuid to you. The most correct * implementation would probably be to have the copy not setuid to anyone * if the original file was owned by someone else, but this corner case * isn't currently handled. It would require another lstat(), or getuid(). */ if (chmod(dst, newMode)) { /* INTL: Native. */ newMode &= ~(S_ISUID | S_ISGID); if (chmod(dst, newMode)) { /* INTL: Native. */ return TCL_ERROR; } } tval.actime = Tcl_GetAccessTimeFromStat(statBufPtr); tval.modtime = Tcl_GetModificationTimeFromStat(statBufPtr); if (utime(dst, &tval)) { /* INTL: Native. */ return TCL_ERROR; } #ifdef MAC_OSX_TCL TclMacOSXCopyFileAttributes(src, dst, statBufPtr); #endif return TCL_OK; } /* *---------------------------------------------------------------------- * * GetGroupAttribute * * Gets the group attribute of a file. * * Results: * Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there * is no error. * * Side effects: * A new object is allocated. * *---------------------------------------------------------------------- */ static int GetGroupAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; struct group *groupPtr; int result; result = TclpObjStat(fileName, &statBuf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } groupPtr = TclpGetGrGid(statBuf.st_gid); if (groupPtr == NULL) { TclNewIntObj(*attributePtrPtr, statBuf.st_gid); } else { Tcl_DString ds; const char *utf; utf = Tcl_ExternalToUtfDString(NULL, groupPtr->gr_name, TCL_INDEX_NONE, &ds); *attributePtrPtr = Tcl_NewStringObj(utf, TCL_INDEX_NONE); Tcl_DStringFree(&ds); } return TCL_OK; } /* *---------------------------------------------------------------------- * * GetOwnerAttribute * * Gets the owner attribute of a file. * * Results: * Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there * is no error. * * Side effects: * A new object is allocated. * *---------------------------------------------------------------------- */ static int GetOwnerAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; struct passwd *pwPtr; int result; result = TclpObjStat(fileName, &statBuf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } pwPtr = TclpGetPwUid(statBuf.st_uid); if (pwPtr == NULL) { TclNewIntObj(*attributePtrPtr, statBuf.st_uid); } else { Tcl_DString ds; (void)Tcl_ExternalToUtfDString(NULL, pwPtr->pw_name, TCL_INDEX_NONE, &ds); *attributePtrPtr = Tcl_DStringToObj(&ds); } return TCL_OK; } /* *---------------------------------------------------------------------- * * GetPermissionsAttribute * * Gets the group attribute of a file. * * Results: * Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there * is no error. The object will have ref count 0. * * Side effects: * A new object is allocated. * *---------------------------------------------------------------------- */ static int GetPermissionsAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; int result; result = TclpObjStat(fileName, &statBuf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } *attributePtrPtr = Tcl_ObjPrintf( "%0#5o", ((int)statBuf.st_mode & 0x7FFF)); return TCL_OK; } /* *--------------------------------------------------------------------------- * * SetGroupAttribute -- * * Sets the group of the file to the specified group. * * Results: * Standard TCL result. * * Side effects: * As above. * *--------------------------------------------------------------------------- */ static int SetGroupAttribute( Tcl_Interp *interp, /* The interp for error reporting. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* New group for file. */ { Tcl_WideInt gid; int result; const char *native; if (TclGetWideIntFromObj(NULL, attributePtr, &gid) != TCL_OK) { Tcl_DString ds; struct group *groupPtr = NULL; const char *string; Tcl_Size length; string = TclGetStringFromObj(attributePtr, &length); if (Tcl_UtfToExternalDStringEx(interp, NULL, string, length, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); groupPtr = TclpGetGrNam(native); /* INTL: Native. */ Tcl_DStringFree(&ds); if (groupPtr == NULL) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set group for file \"%s\":" " group \"%s\" does not exist", TclGetString(fileName), string)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETGRP", "NO_GROUP", (char *)NULL); } return TCL_ERROR; } gid = groupPtr->gr_gid; } native = (const char *)Tcl_FSGetNativePath(fileName); result = chown(native, (uid_t) -1, (gid_t) gid); /* INTL: Native. */ if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set group for file \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * SetOwnerAttribute -- * * Sets the owner of the file to the specified owner. * * Results: * Standard TCL result. * * Side effects: * As above. * *--------------------------------------------------------------------------- */ static int SetOwnerAttribute( Tcl_Interp *interp, /* The interp for error reporting. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* New owner for file. */ { Tcl_WideInt uid; int result; const char *native; if (TclGetWideIntFromObj(NULL, attributePtr, &uid) != TCL_OK) { Tcl_DString ds; struct passwd *pwPtr = NULL; const char *string; Tcl_Size length; string = TclGetStringFromObj(attributePtr, &length); if (Tcl_UtfToExternalDStringEx(interp, NULL, string, length, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); pwPtr = TclpGetPwNam(native); /* INTL: Native. */ Tcl_DStringFree(&ds); if (pwPtr == NULL) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set owner for file \"%s\":" " user \"%s\" does not exist", TclGetString(fileName), string)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SETOWN", "NO_USER", (char *)NULL); } return TCL_ERROR; } uid = pwPtr->pw_uid; } native = (const char *)Tcl_FSGetNativePath(fileName); result = chown(native, (uid_t) uid, (gid_t) -1); /* INTL: Native. */ if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set owner for file \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * SetPermissionsAttribute * * Sets the file to the given permission. * * Results: * Standard TCL result. * * Side effects: * The permission of the file is changed. * *--------------------------------------------------------------------------- */ static int SetPermissionsAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* The attribute to set. */ { Tcl_WideInt mode; mode_t newMode; int result = TCL_ERROR; const char *native; const char *modeStringPtr = TclGetString(attributePtr); Tcl_Size scanned = TclParseAllWhiteSpace(modeStringPtr, -1); /* * First supply support for octal number format */ if ((modeStringPtr[scanned] == '0') && (modeStringPtr[scanned+1] >= '0') && (modeStringPtr[scanned+1] <= '7')) { /* Leading zero - attempt octal interpretation */ Tcl_Obj *modeObj; TclNewLiteralStringObj(modeObj, "0o"); Tcl_AppendToObj(modeObj, modeStringPtr+scanned+1, TCL_INDEX_NONE); result = TclGetWideIntFromObj(NULL, modeObj, &mode); Tcl_DecrRefCount(modeObj); } if (result == TCL_OK || TclGetWideIntFromObj(NULL, attributePtr, &mode) == TCL_OK) { newMode = (mode_t) (mode & 0x00007FFF); } else { Tcl_StatBuf buf; /* * Try the forms "rwxrwxrwx" and "ugo=rwx" * * We get the current mode of the file, in order to allow for ug+-=rwx * style chmod strings. */ result = TclpObjStat(fileName, &buf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } newMode = (mode_t) (buf.st_mode & 0x00007FFF); if (GetModeFromPermString(NULL, modeStringPtr, &newMode) != TCL_OK) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown permission string format \"%s\"", modeStringPtr)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "PERMISSION", (char *)NULL); } return TCL_ERROR; } } native = (const char *)Tcl_FSGetNativePath(fileName); result = chmod(native, newMode); /* INTL: Native. */ if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set permissions for file \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } #ifndef DJGPP /* *--------------------------------------------------------------------------- * * TclpObjListVolumes -- * * Lists the currently mounted volumes, which on UNIX is just /. * * Results: * The list of volumes. * * Side effects: * None. * *--------------------------------------------------------------------------- */ Tcl_Obj * TclpObjListVolumes(void) { Tcl_Obj *resultPtr; TclNewLiteralStringObj(resultPtr, "/"); Tcl_IncrRefCount(resultPtr); return resultPtr; } #endif /* *---------------------------------------------------------------------- * * GetModeFromPermString -- * * This procedure is invoked to process the "file permissions" Tcl * command, to check for a "rwxrwxrwx" or "ugoa+-=rwxst" string. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int GetModeFromPermString( TCL_UNUSED(Tcl_Interp *), const char *modeStringPtr, /* Permissions string */ mode_t *modePtr) /* pointer to the mode value */ { mode_t newMode; mode_t oldMode; /* Storage for the value of the old mode (that * is passed in), to allow for the chmod style * manipulation. */ int i,n, who, op, what, op_found, who_found; /* * We start off checking for an "rwxrwxrwx" style permissions string */ if (strlen(modeStringPtr) != 9) { goto chmodStyleCheck; } newMode = 0; for (i = 0; i < 9; i++) { switch (modeStringPtr[i]) { case 'r': if ((i%3) != 0) { goto chmodStyleCheck; } newMode |= (1<<(8-i)); break; case 'w': if ((i%3) != 1) { goto chmodStyleCheck; } newMode |= (1<<(8-i)); break; case 'x': if ((i%3) != 2) { goto chmodStyleCheck; } newMode |= (1<<(8-i)); break; case 's': if (((i%3) != 2) || (i > 5)) { goto chmodStyleCheck; } newMode |= (1<<(8-i)); newMode |= (1<<(11-(i/3))); break; case 'S': if (((i%3) != 2) || (i > 5)) { goto chmodStyleCheck; } newMode |= (1<<(11-(i/3))); break; case 't': if (i != 8) { goto chmodStyleCheck; } newMode |= (1<<(8-i)); newMode |= (1<<9); break; case 'T': if (i != 8) { goto chmodStyleCheck; } newMode |= (1<<9); break; case '-': break; default: /* * Oops, not what we thought it was, so go on */ goto chmodStyleCheck; } } *modePtr = newMode; return TCL_OK; chmodStyleCheck: /* * We now check for an "ugoa+-=rwxst" style permissions string */ for (n = 0 ; modeStringPtr[n] != '\0' ; n += i) { oldMode = *modePtr; who = op = what = op_found = who_found = 0; for (i = 0 ; modeStringPtr[n + i] != '\0' ; i++ ) { if (!who_found) { /* who */ switch (modeStringPtr[n + i]) { case 'u': who |= 0x9C0; continue; case 'g': who |= 0x438; continue; case 'o': who |= 0x207; continue; case 'a': who |= 0xFFF; continue; } } who_found = 1; if (who == 0) { who = 0xFFF; } if (!op_found) { /* op */ switch (modeStringPtr[n + i]) { case '+': op = 1; op_found = 1; continue; case '-': op = 2; op_found = 1; continue; case '=': op = 3; op_found = 1; continue; default: return TCL_ERROR; } } /* what */ switch (modeStringPtr[n + i]) { case 'r': what |= 0x124; continue; case 'w': what |= 0x92; continue; case 'x': what |= 0x49; continue; case 's': what |= 0xC00; continue; case 't': what |= 0x200; continue; case ',': break; default: return TCL_ERROR; } if (modeStringPtr[n + i] == ',') { i++; break; } } switch (op) { case 1: *modePtr = oldMode | (who & what); continue; case 2: *modePtr = oldMode & ~(who & what); continue; case 3: *modePtr = (oldMode & ~who) | (who & what); continue; } } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TclpObjNormalizePath -- * * Replaces each component except that last one in a pathname that is a * symbolic link with the fully resolved target of that link. * * Results: * Stores the resulting path in pathPtr and returns the offset of the last * byte processed to obtain the resulting path. * * Side effects: * *--------------------------------------------------------------------------- */ int TclpObjNormalizePath( Tcl_Interp *interp, Tcl_Obj *pathPtr, /* An unshared object containing the path to * normalize. */ int nextCheckpoint) /* offset to start at in pathPtr. Must either * be 0 or the offset of a directory separator * at the end of a path part that is already * normalized. I.e. this is not the index of * the byte just after the separator. */ { const char *currentPathEndPosition; char cur; Tcl_Size pathLen; const char *path = TclGetStringFromObj(pathPtr, &pathLen); Tcl_DString ds; const char *nativePath; #ifndef NO_REALPATH char normPath[MAXPATHLEN]; #endif currentPathEndPosition = path + nextCheckpoint; if (*currentPathEndPosition == '/') { currentPathEndPosition++; } #ifndef NO_REALPATH if (nextCheckpoint == 0 && haveRealpath) { /* * Try to get the entire path in one go */ const char *lastDir = strrchr(currentPathEndPosition, '/'); if (lastDir != NULL) { if (Tcl_UtfToExternalDStringEx(interp, NULL, path, lastDir-path, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return -1; } nativePath = Tcl_DStringValue(&ds); if (Realpath(nativePath, normPath) != NULL) { if (*nativePath != '/' && *normPath == '/') { /* * realpath transformed a relative path into an * absolute path. Fall back to the long way. */ /* * To do: This logic seems to be out of date. This whole * routine should be reviewed and cleaed up. */ } else { nextCheckpoint = (int)(lastDir - path); goto wholeStringOk; } } Tcl_DStringFree(&ds); } } /* * Else do it the slow way. */ #endif while (1) { cur = *currentPathEndPosition; if ((cur == '/') && (path != currentPathEndPosition)) { /* * Reached directory separator. */ int accessOk; if (Tcl_UtfToExternalDStringEx(interp, NULL, path, currentPathEndPosition - path, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return -1; } nativePath = Tcl_DStringValue(&ds); accessOk = access(nativePath, F_OK); Tcl_DStringFree(&ds); if (accessOk != 0) { /* * File doesn't exist. */ break; } /* * Assign the end of the current component to nextCheckpoint */ nextCheckpoint = (int)(currentPathEndPosition - path); } else if (cur == 0) { /* * The end of the string. */ break; } currentPathEndPosition++; } /* * Call 'realpath' to obtain a canonical path. */ #ifndef NO_REALPATH if (haveRealpath) { if (nextCheckpoint == 0) { /* * The path contains at most one component, e.g. '/foo' or '/', * so there is nothing to resolve. Also, on some platforms * 'Realpath' transforms an empty string into the normalized pwd, * which is the wrong answer. */ return 0; } if (Tcl_UtfToExternalDStringEx(interp, NULL, path,nextCheckpoint, 0, &ds, NULL)) { Tcl_DStringFree(&ds); return -1; } nativePath = Tcl_DStringValue(&ds); if (Realpath(nativePath, normPath) != NULL) { Tcl_Size newNormLen; wholeStringOk: newNormLen = strlen(normPath); if ((newNormLen == Tcl_DStringLength(&ds)) && (strcmp(normPath, nativePath) == 0)) { /* * The original path is unchanged. */ Tcl_DStringFree(&ds); /* * Uncommenting this would mean that this native filesystem * routine claims the path is normalized if the file exists, * which would permit the caller to avoid iterating through * other filesystems. Saving lots of calls is * probably worth the extra access() time, but in the common * case that no other filesystems are registered this is an * unnecessary expense. * if (0 == access(normPath, F_OK)) { return pathLen; } */ return nextCheckpoint; } /* * Free the original path and replace it with the normalized path. */ Tcl_DStringFree(&ds); Tcl_ExternalToUtfDStringEx(NULL, NULL, normPath, newNormLen, 0, &ds, NULL); if (path[nextCheckpoint] != '\0') { /* * Append the remaining path components. */ Tcl_Size normLen = Tcl_DStringLength(&ds); Tcl_DStringAppend(&ds, path + nextCheckpoint, pathLen - nextCheckpoint); /* * characters up to and including the directory separator have * been processed */ nextCheckpoint = (int)normLen + 1; } else { /* * We recognise the whole string. */ nextCheckpoint = (int)Tcl_DStringLength(&ds); } Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); } Tcl_DStringFree(&ds); } #endif /* !NO_REALPATH */ return nextCheckpoint; } /* *---------------------------------------------------------------------- * * TclpOpenTemporaryFile, TclUnixOpenTemporaryFile -- * * Creates a temporary file, possibly based on the supplied bits and * pieces of template supplied in the first three arguments. If the * fourth argument is non-NULL, it contains a Tcl_Obj to store the name * of the temporary file in (and it is caller's responsibility to clean * up). If the fourth argument is NULL, try to arrange for the temporary * file to go away once it is no longer needed. * * Results: * A read-write Tcl Channel open on the file for TclpOpenTemporaryFile, * or a file descriptor (or -1 on failure) for TclUnixOpenTemporaryFile. * * Side effects: * Accesses the filesystem. Will set the contents of the Tcl_Obj fourth * argument (if that is non-NULL). * *---------------------------------------------------------------------- */ Tcl_Channel TclpOpenTemporaryFile( Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj) { int fd = TclUnixOpenTemporaryFile(dirObj, basenameObj, extensionObj, resultingNameObj); if (fd == -1) { return NULL; } return Tcl_MakeFileChannel(INT2PTR(fd), TCL_READABLE|TCL_WRITABLE); } int TclUnixOpenTemporaryFile( Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj) { Tcl_DString templ, tmp; const char *string; int fd; Tcl_Size length; /* * We should also check against making more than TMP_MAX of these. */ if (dirObj) { string = TclGetStringFromObj(dirObj, &length); if (Tcl_UtfToExternalDStringEx(NULL, NULL, string, length, 0, &templ, NULL) != TCL_OK) { return -1; } } else { Tcl_DStringInit(&templ); Tcl_DStringAppend(&templ, DefaultTempDir(), TCL_INDEX_NONE); /* INTL: native */ } TclDStringAppendLiteral(&templ, "/"); if (basenameObj) { string = TclGetStringFromObj(basenameObj, &length); if (Tcl_UtfToExternalDStringEx(NULL, NULL, string, length, 0, &tmp, NULL) != TCL_OK) { Tcl_DStringFree(&tmp); return -1; } TclDStringAppendDString(&templ, &tmp); Tcl_DStringFree(&tmp); } else { TclDStringAppendLiteral(&templ, "tcl"); } TclDStringAppendLiteral(&templ, "_XXXXXX"); #ifdef HAVE_MKSTEMPS if (extensionObj) { string = TclGetStringFromObj(extensionObj, &length); if (Tcl_UtfToExternalDStringEx(NULL, NULL, string, length, 0, &tmp, NULL) != TCL_OK) { Tcl_DStringFree(&templ); return -1; } TclDStringAppendDString(&templ, &tmp); fd = mkstemps(Tcl_DStringValue(&templ), (int)Tcl_DStringLength(&tmp)); Tcl_DStringFree(&tmp); } else #endif { fd = mkstemp(Tcl_DStringValue(&templ)); } if (fd == -1) { Tcl_DStringFree(&templ); return -1; } if (resultingNameObj) { if (Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(&templ), Tcl_DStringLength(&templ), 0, &tmp, NULL) != TCL_OK) { Tcl_DStringFree(&templ); return -1; } Tcl_SetStringObj(resultingNameObj, Tcl_DStringValue(&tmp), Tcl_DStringLength(&tmp)); Tcl_DStringFree(&tmp); } else { /* * Try to delete the file immediately since we're not reporting the * name to anyone. Note that we're *not* handling any errors from * this! */ unlink(Tcl_DStringValue(&templ)); errno = 0; } Tcl_DStringFree(&templ); return fd; } /* * Helper that does *part* of what tempnam() does. */ static const char * DefaultTempDir(void) { const char *dir; Tcl_StatBuf buf; dir = getenv("TMPDIR"); if (dir && dir[0] && TclOSstat(dir, &buf) == 0 && S_ISDIR(buf.st_mode) && access(dir, W_OK) == 0) { return dir; } #ifdef P_tmpdir dir = P_tmpdir; if (TclOSstat(dir, &buf)==0 && S_ISDIR(buf.st_mode) && access(dir, W_OK)==0) { return dir; } #endif /* * Assume that the default location ("/tmp" if not overridden) is always * an existing writable directory; we've no recovery mechanism if it * isn't. */ return TCL_TEMPORARY_FILE_DIRECTORY; } /* *---------------------------------------------------------------------- * * TclpCreateTemporaryDirectory -- * * Creates a temporary directory, possibly based on the supplied bits and * pieces of template supplied in the arguments. * * Results: * An object (refcount 0) containing the name of the newly-created * directory, or NULL on failure. * * Side effects: * Accesses the native filesystem. Makes a directory. * *---------------------------------------------------------------------- */ Tcl_Obj * TclpCreateTemporaryDirectory( Tcl_Obj *dirObj, Tcl_Obj *basenameObj) { Tcl_DString templ, tmp; const char *string; #define DEFAULT_TEMP_DIR_PREFIX "tcl" /* * Build the template in writable memory from the user-supplied pieces and * some defaults. */ if (dirObj) { string = TclGetString(dirObj); if (Tcl_UtfToExternalDStringEx(NULL, NULL, string, dirObj->length, 0, &templ, NULL) != TCL_OK) { return NULL; } } else { Tcl_DStringInit(&templ); Tcl_DStringAppend(&templ, DefaultTempDir(), TCL_INDEX_NONE); /* INTL: native */ } if (Tcl_DStringValue(&templ)[Tcl_DStringLength(&templ) - 1] != '/') { TclDStringAppendLiteral(&templ, "/"); } if (basenameObj) { string = TclGetString(basenameObj); if (basenameObj->length) { if (Tcl_UtfToExternalDStringEx(NULL, NULL, string, basenameObj->length, 0, &tmp, NULL) != TCL_OK) { Tcl_DStringFree(&templ); return NULL; } TclDStringAppendDString(&templ, &tmp); Tcl_DStringFree(&tmp); } else { TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX); } } else { TclDStringAppendLiteral(&templ, DEFAULT_TEMP_DIR_PREFIX); } TclDStringAppendLiteral(&templ, "_XXXXXX"); /* * Make the temporary directory. */ if (mkdtemp(Tcl_DStringValue(&templ)) == NULL) { Tcl_DStringFree(&templ); return NULL; } /* * The template has been updated. Tell the caller what it was. */ if (Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(&templ), Tcl_DStringLength(&templ), 0, &tmp, NULL) != TCL_OK) { Tcl_DStringFree(&templ); return NULL; } Tcl_DStringFree(&templ); return Tcl_DStringToObj(&tmp); } #if defined(__CYGWIN__) static void StatError( Tcl_Interp *interp, /* The interp that has the error */ Tcl_Obj *fileName) /* The name of the file which caused the * error. */ { Tcl_WinConvertError(GetLastError()); Tcl_SetObjResult(interp, Tcl_ObjPrintf("could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } static WCHAR * winPathFromObj( Tcl_Obj *fileName) { int size; const char *native = (const char *)Tcl_FSGetNativePath(fileName); WCHAR *winPath; size = cygwin_conv_path(1, native, NULL, 0); winPath = (WCHAR *)Tcl_Alloc(size); cygwin_conv_path(1, native, winPath, size); return winPath; } static const int attributeArray[] = { 0x20, 0, 2, 0, 0, 1, 4 }; /* *---------------------------------------------------------------------- * * GetUnixFileAttributes * * Gets an attribute of a file. * * Results: * A standard Tcl result. * * Side effects: * If there is no error assigns to *attributePtrPtr the address of a new * Tcl_Obj having a refCount of zero and containing the value of the * specified attribute. * * *---------------------------------------------------------------------- */ static int GetUnixFileAttributes( Tcl_Interp *interp, /* The interp to report errors to. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The pathname of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* Where to store the result. */ { int fileAttributes; WCHAR *winPath = winPathFromObj(fileName); fileAttributes = GetFileAttributesW(winPath); Tcl_Free(winPath); if (fileAttributes == -1) { StatError(interp, fileName); return TCL_ERROR; } TclNewIntObj(*attributePtrPtr, (fileAttributes & attributeArray[objIndex]) != 0); return TCL_OK; } /* *--------------------------------------------------------------------------- * * SetUnixFileAttributes * * Sets the readonly attribute of a file. * * Results: * Standard TCL result. * * Side effects: * The readonly attribute of the file is changed. * *--------------------------------------------------------------------------- */ static int SetUnixFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* The attribute to set. */ { int yesNo, fileAttributes, old; WCHAR *winPath; if (Tcl_GetBooleanFromObj(interp, attributePtr, &yesNo) != TCL_OK) { return TCL_ERROR; } winPath = winPathFromObj(fileName); fileAttributes = old = GetFileAttributesW(winPath); if (fileAttributes == -1) { Tcl_Free(winPath); StatError(interp, fileName); return TCL_ERROR; } if (yesNo) { fileAttributes |= attributeArray[objIndex]; } else { fileAttributes &= ~attributeArray[objIndex]; } if ((fileAttributes != old) && !SetFileAttributesW(winPath, fileAttributes)) { Tcl_Free(winPath); StatError(interp, fileName); return TCL_ERROR; } Tcl_Free(winPath); return TCL_OK; } #elif defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) /* *---------------------------------------------------------------------- * * GetUnixFileAttributes * * Gets the readonly attribute (user immutable flag) of a file. * * Results: * Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there * is no error. The object will have ref count 0. * * Side effects: * A new object is allocated. * *---------------------------------------------------------------------- */ static int GetUnixFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; int result; result = TclpObjStat(fileName, &statBuf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } TclNewIntObj(*attributePtrPtr, (statBuf.st_flags & UF_IMMUTABLE) != 0); return TCL_OK; } /* *--------------------------------------------------------------------------- * * SetUnixFileAttributes * * Sets the readonly attribute (user immutable flag) of a file. * * Results: * Standard TCL result. * * Side effects: * The readonly attribute of the file is changed. * *--------------------------------------------------------------------------- */ static int SetUnixFileAttributes( Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* The attribute to set. */ { Tcl_StatBuf statBuf; int result, readonly; const char *native; if (Tcl_GetBooleanFromObj(interp, attributePtr, &readonly) != TCL_OK) { return TCL_ERROR; } result = TclpObjStat(fileName, &statBuf); if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } if (readonly) { statBuf.st_flags |= UF_IMMUTABLE; } else { statBuf.st_flags &= ~UF_IMMUTABLE; } native = (const char *)Tcl_FSGetNativePath(fileName); result = chflags(native, statBuf.st_flags); /* INTL: Native. */ if (result != 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set flags for file \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); } return TCL_ERROR; } return TCL_OK; } #endif /* defined(HAVE_CHFLAGS) && defined(UF_IMMUTABLE) */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixEvent.c0000644000175000017500000000421315104661341015326 0ustar sergeisergei/* * tclUnixEvent.c -- * * This file implements Unix specific event related routines. * * Copyright © 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. */ #include "tclInt.h" #ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is * in tclMacOSXNotify.c */ /* *---------------------------------------------------------------------- * * Tcl_Sleep -- * * Delay execution for the specified number of milliseconds. * * Results: * None. * * Side effects: * Time passes. * *---------------------------------------------------------------------- */ void Tcl_Sleep( int ms) /* Number of milliseconds to sleep. */ { struct timeval delay; Tcl_Time before, after, vdelay; /* * The only trick here is that select appears to return early under some * conditions, so we have to check to make sure that the right amount of * time really has elapsed. If it's too early, go back to sleep again. */ Tcl_GetTime(&before); after = before; after.sec += ms/1000; after.usec += (ms%1000)*1000; if (after.usec > 1000000) { after.usec -= 1000000; after.sec += 1; } while (1) { /* * TIP #233: Scale from virtual time to real-time for select. */ vdelay.sec = after.sec - before.sec; vdelay.usec = after.usec - before.usec; if (vdelay.usec < 0) { vdelay.usec += 1000000; vdelay.sec -= 1; } if ((vdelay.sec != 0) || (vdelay.usec != 0)) { TclScaleTime(&vdelay); } delay.tv_sec = vdelay.sec; delay.tv_usec = vdelay.usec; /* * Special note: must convert delay.tv_sec to int before comparing to * zero, since delay.tv_usec is unsigned on some platforms. */ if ((((int) delay.tv_sec) < 0) || ((delay.tv_usec == 0) && (delay.tv_sec == 0))) { break; } (void) select(0, (SELECT_MASK *) 0, (SELECT_MASK *) 0, (SELECT_MASK *) 0, &delay); Tcl_GetTime(&before); } } #else TCL_MAC_EMPTY_FILE(unix_tclUnixEvent_c) #endif /* HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixCompat.c0000644000175000017500000005642415104661341015503 0ustar sergeisergei/* * tclUnixCompat.c * * Written by: Zoran Vasiljevic (vasiljevic@users.sourceforge.net). * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include #include /* * See also: SC_BLOCKING_STYLE in unix/tcl.m4 */ #ifdef USE_FIONBIO # ifdef HAVE_SYS_FILIO_H # include /* For FIONBIO. */ # endif # ifdef HAVE_SYS_IOCTL_H # include # endif #endif /* USE_FIONBIO */ /* * Used to pad structures at size'd boundaries * * This macro assumes that the pointer 'buffer' was created from an aligned * pointer by adding the 'length'. If this 'length' was not a multiple of the * 'size' the result is unaligned and PadBuffer corrects both the pointer, * _and_ the 'length'. The latter means that future increments of 'buffer' by * 'length' stay aligned. */ #define PadBuffer(buffer, length, size) \ if (((length) % (size))) { \ (buffer) += ((size) - ((length) % (size))); \ (length) += ((size) - ((length) % (size))); \ } /* * Per-thread private storage used to store values returned from MT-unsafe * library calls. */ #if TCL_THREADS typedef struct { struct passwd pwd; #if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5) #define NEED_PW_CLEANER 1 char *pbuf; int pbuflen; #else char pbuf[2048]; #endif struct group grp; #if defined(HAVE_GETGRNAM_R_5) || defined(HAVE_GETGRGID_R_5) #define NEED_GR_CLEANER 1 char *gbuf; int gbuflen; #else char gbuf[2048]; #endif #if !defined(HAVE_MTSAFE_GETHOSTBYNAME) || !defined(HAVE_MTSAFE_GETHOSTBYADDR) struct hostent hent; char hbuf[2048]; #endif } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; #if ((!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R)) && \ (!defined(HAVE_MTSAFE_GETHOSTBYNAME) || \ !defined(HAVE_MTSAFE_GETHOSTBYADDR))) || \ !defined(HAVE_GETPWNAM_R) || !defined(HAVE_GETPWUID_R) || \ !defined(HAVE_GETGRNAM_R) || !defined(HAVE_GETGRGID_R) /* * Mutex to lock access to MT-unsafe calls. This is just to protect our own * usage. It does not protect us from others calling the same functions * without (or using some different) lock. */ static Tcl_Mutex compatLock; /* * Helper function declarations. Note that these are only used if needed and * only defined if used (via the NEED_* macros). */ #undef NEED_COPYARRAY #undef NEED_COPYGRP #undef NEED_COPYHOSTENT #undef NEED_COPYPWD #undef NEED_COPYSTRING #if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4) #define NEED_COPYGRP 1 static int CopyGrp(struct group *tgtPtr, char *buf, int buflen); #endif #if !defined(HAVE_GETPWNAM_R_5) && !defined(HAVE_GETPWNAM_R_4) #define NEED_COPYPWD 1 static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen); #endif static size_t CopyArray(char **src, int elsize, char *buf, size_t buflen); static int CopyHostent(struct hostent *tgtPtr, char *buf, size_t buflen); static size_t CopyString(const char *src, char *buf, size_t buflen); #endif #ifdef NEED_PW_CLEANER static void FreePwBuf(void *dummy); #endif #ifdef NEED_GR_CLEANER static void FreeGrBuf(void *dummy); #endif #endif /* TCL_THREADS */ /* *--------------------------------------------------------------------------- * * TclUnixSetBlockingMode -- * * Set the blocking mode of a file descriptor. * * Results: * * 0 on success, -1 (with errno set) on error. * *--------------------------------------------------------------------------- */ int TclUnixSetBlockingMode( int fd, /* File descriptor */ int mode) /* Either TCL_MODE_BLOCKING or * TCL_MODE_NONBLOCKING. */ { #ifndef USE_FIONBIO int flags = fcntl(fd, F_GETFL); if (mode == TCL_MODE_BLOCKING) { flags &= ~O_NONBLOCK; } else { flags |= O_NONBLOCK; } return fcntl(fd, F_SETFL, flags); #else /* USE_FIONBIO */ int state = (mode == TCL_MODE_NONBLOCKING); return ioctl(fd, FIONBIO, &state); #endif /* !USE_FIONBIO */ } /* *--------------------------------------------------------------------------- * * TclpGetPwNam -- * * Thread-safe wrappers for getpwnam(). See "man getpwnam" for more * details. * * Results: * Pointer to struct passwd on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct passwd * TclpGetPwNam( const char *name) { #if !TCL_THREADS return getpwnam(name); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETPWNAM_R_5) struct passwd *pwPtr = NULL; /* * How to allocate a buffer of the right initial size. If you want the * gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt * and weep. */ if (tsdPtr->pbuf == NULL) { tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX); if (tsdPtr->pbuflen < 1) { tsdPtr->pbuflen = 1024; } tsdPtr->pbuf = (char *)Tcl_Alloc(tsdPtr->pbuflen); Tcl_CreateThreadExitHandler(FreePwBuf, NULL); } while (1) { int e = getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, tsdPtr->pbuflen, &pwPtr); if (e == 0) { break; } else if (e != ERANGE) { return NULL; } tsdPtr->pbuflen *= 2; tsdPtr->pbuf = (char *)Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen); } return (pwPtr != NULL ? &tsdPtr->pwd : NULL); #elif defined(HAVE_GETPWNAM_R_4) return getpwnam_r(name, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else struct passwd *pwPtr; Tcl_MutexLock(&compatLock); pwPtr = getpwnam(name); if (pwPtr != NULL) { tsdPtr->pwd = *pwPtr; pwPtr = &tsdPtr->pwd; if (CopyPwd(&tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)) == -1) { pwPtr = NULL; } } Tcl_MutexUnlock(&compatLock); return pwPtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * TclpGetPwUid -- * * Thread-safe wrappers for getpwuid(). See "man getpwuid" for more * details. * * Results: * Pointer to struct passwd on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct passwd * TclpGetPwUid( uid_t uid) { #if !TCL_THREADS return getpwuid(uid); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETPWUID_R_5) struct passwd *pwPtr = NULL; /* * How to allocate a buffer of the right initial size. If you want the * gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt * and weep. */ if (tsdPtr->pbuf == NULL) { tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX); if (tsdPtr->pbuflen < 1) { tsdPtr->pbuflen = 1024; } tsdPtr->pbuf = (char *)Tcl_Alloc(tsdPtr->pbuflen); Tcl_CreateThreadExitHandler(FreePwBuf, NULL); } while (1) { int e = getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, tsdPtr->pbuflen, &pwPtr); if (e == 0) { break; } else if (e != ERANGE) { return NULL; } tsdPtr->pbuflen *= 2; tsdPtr->pbuf = (char *)Tcl_Realloc(tsdPtr->pbuf, tsdPtr->pbuflen); } return (pwPtr != NULL ? &tsdPtr->pwd : NULL); #elif defined(HAVE_GETPWUID_R_4) return getpwuid_r(uid, &tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)); #else struct passwd *pwPtr; Tcl_MutexLock(&compatLock); pwPtr = getpwuid(uid); if (pwPtr != NULL) { tsdPtr->pwd = *pwPtr; pwPtr = &tsdPtr->pwd; if (CopyPwd(&tsdPtr->pwd, tsdPtr->pbuf, sizeof(tsdPtr->pbuf)) == -1) { pwPtr = NULL; } } Tcl_MutexUnlock(&compatLock); return pwPtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * FreePwBuf -- * * Helper that is used to dispose of space allocated and referenced from * the ThreadSpecificData for user entries. (Darn that baroque POSIX * reentrant interface.) * *--------------------------------------------------------------------------- */ #ifdef NEED_PW_CLEANER static void FreePwBuf( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); Tcl_Free(tsdPtr->pbuf); } #endif /* NEED_PW_CLEANER */ /* *--------------------------------------------------------------------------- * * TclpGetGrNam -- * * Thread-safe wrappers for getgrnam(). See "man getgrnam" for more * details. * * Results: * Pointer to struct group on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct group * TclpGetGrNam( const char *name) { #if !TCL_THREADS return getgrnam(name); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETGRNAM_R_5) struct group *grPtr = NULL; /* * How to allocate a buffer of the right initial size. If you want the * gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt * and weep. */ if (tsdPtr->gbuf == NULL) { tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX); if (tsdPtr->gbuflen < 1) { tsdPtr->gbuflen = 1024; } tsdPtr->gbuf = (char *)Tcl_Alloc(tsdPtr->gbuflen); Tcl_CreateThreadExitHandler(FreeGrBuf, NULL); } while (1) { int e = getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, tsdPtr->gbuflen, &grPtr); if (e == 0) { break; } else if (e != ERANGE) { return NULL; } tsdPtr->gbuflen *= 2; tsdPtr->gbuf = (char *)Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen); } return (grPtr != NULL ? &tsdPtr->grp : NULL); #elif defined(HAVE_GETGRNAM_R_4) return getgrnam_r(name, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else struct group *grPtr; Tcl_MutexLock(&compatLock); grPtr = getgrnam(name); if (grPtr != NULL) { tsdPtr->grp = *grPtr; grPtr = &tsdPtr->grp; if (CopyGrp(&tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)) == -1) { grPtr = NULL; } } Tcl_MutexUnlock(&compatLock); return grPtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * TclpGetGrGid -- * * Thread-safe wrappers for getgrgid(). See "man getgrgid" for more * details. * * Results: * Pointer to struct group on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct group * TclpGetGrGid( gid_t gid) { #if !TCL_THREADS return getgrgid(gid); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETGRGID_R_5) struct group *grPtr = NULL; /* * How to allocate a buffer of the right initial size. If you want the * gory detail, see http://www.opengroup.org/austin/docs/austin_328.txt * and weep. */ if (tsdPtr->gbuf == NULL) { tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX); if (tsdPtr->gbuflen < 1) { tsdPtr->gbuflen = 1024; } tsdPtr->gbuf = (char *)Tcl_Alloc(tsdPtr->gbuflen); Tcl_CreateThreadExitHandler(FreeGrBuf, NULL); } while (1) { int e = getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, tsdPtr->gbuflen, &grPtr); if (e == 0) { break; } else if (e != ERANGE) { return NULL; } tsdPtr->gbuflen *= 2; tsdPtr->gbuf = (char *)Tcl_Realloc(tsdPtr->gbuf, tsdPtr->gbuflen); } return (grPtr != NULL ? &tsdPtr->grp : NULL); #elif defined(HAVE_GETGRGID_R_4) return getgrgid_r(gid, &tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)); #else struct group *grPtr; Tcl_MutexLock(&compatLock); grPtr = getgrgid(gid); if (grPtr != NULL) { tsdPtr->grp = *grPtr; grPtr = &tsdPtr->grp; if (CopyGrp(&tsdPtr->grp, tsdPtr->gbuf, sizeof(tsdPtr->gbuf)) == -1) { grPtr = NULL; } } Tcl_MutexUnlock(&compatLock); return grPtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * FreeGrBuf -- * * Helper that is used to dispose of space allocated and referenced from * the ThreadSpecificData for group entries. (Darn that baroque POSIX * reentrant interface.) * *--------------------------------------------------------------------------- */ #ifdef NEED_GR_CLEANER static void FreeGrBuf( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); Tcl_Free(tsdPtr->gbuf); } #endif /* NEED_GR_CLEANER */ /* *--------------------------------------------------------------------------- * * TclpGetHostByName -- * * Thread-safe wrappers for gethostbyname(). See "man gethostbyname" for * more details. * * Results: * Pointer to struct hostent on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct hostent * TclpGetHostByName( const char *name) { #if !TCL_THREADS || defined(HAVE_MTSAFE_GETHOSTBYNAME) return gethostbyname(name); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETHOSTBYNAME_R_5) int local_errno; return gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf), &local_errno); #elif defined(HAVE_GETHOSTBYNAME_R_6) struct hostent *hePtr = NULL; int local_errno, result; result = gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf), &hePtr, &local_errno); return (result == 0) ? hePtr : NULL; #elif defined(HAVE_GETHOSTBYNAME_R_3) struct hostent_data data; return (gethostbyname_r(name, &tsdPtr->hent, &data) == 0) ? &tsdPtr->hent : NULL; #else #define NEED_COPYHOSTENT 1 struct hostent *hePtr; Tcl_MutexLock(&compatLock); hePtr = gethostbyname(name); if (hePtr != NULL) { tsdPtr->hent = *hePtr; hePtr = &tsdPtr->hent; if (CopyHostent(&tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf)) == -1) { hePtr = NULL; } } Tcl_MutexUnlock(&compatLock); return hePtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * TclpGetHostByAddr -- * * Thread-safe wrappers for gethostbyaddr(). See "man gethostbyaddr" for * more details. * * Results: * Pointer to struct hostent on success or NULL on error. * * Side effects: * None. * *--------------------------------------------------------------------------- */ struct hostent * TclpGetHostByAddr( const char *addr, int length, int type) { #if !TCL_THREADS || defined(HAVE_MTSAFE_GETHOSTBYADDR) return gethostbyaddr(addr, length, type); #else ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if defined(HAVE_GETHOSTBYADDR_R_7) int local_errno; return gethostbyaddr_r(addr, length, type, &tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf), &local_errno); #elif defined(HAVE_GETHOSTBYADDR_R_8) struct hostent *hePtr; int local_errno; return (gethostbyaddr_r(addr, length, type, &tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf), &hePtr, &local_errno) == 0) ? &tsdPtr->hent : NULL; #else #define NEED_COPYHOSTENT 1 struct hostent *hePtr; Tcl_MutexLock(&compatLock); hePtr = gethostbyaddr(addr, length, type); if (hePtr != NULL) { tsdPtr->hent = *hePtr; hePtr = &tsdPtr->hent; if (CopyHostent(&tsdPtr->hent, tsdPtr->hbuf, sizeof(tsdPtr->hbuf)) == -1) { hePtr = NULL; } } Tcl_MutexUnlock(&compatLock); return hePtr; #endif return NULL; /* Not reached. */ #endif /* TCL_THREADS */ } /* *--------------------------------------------------------------------------- * * CopyGrp -- * * Copies string fields of the group structure to the private buffer, * honouring the size of the buffer. * * Results: * 0 on success or -1 on error (errno = ERANGE). * * Side effects: * None. * *--------------------------------------------------------------------------- */ #ifdef NEED_COPYGRP #define NEED_COPYARRAY 1 #define NEED_COPYSTRING 1 static int CopyGrp( struct group *tgtPtr, char *buf, int buflen) { char *p = buf; int copied, len = 0; /* * Copy username. */ copied = CopyString(tgtPtr->gr_name, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->gr_name = (copied > 0) ? p : NULL; len += copied; p = buf + len; /* * Copy password. */ copied = CopyString(tgtPtr->gr_passwd, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->gr_passwd = (copied > 0) ? p : NULL; len += copied; p = buf + len; /* * Copy group members. */ PadBuffer(p, len, sizeof(char *)); copied = CopyArray((char **)tgtPtr->gr_mem, -1, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->gr_mem = (copied > 0) ? (char **)p : NULL; return 0; range: errno = ERANGE; return -1; } #endif /* NEED_COPYGRP */ /* *--------------------------------------------------------------------------- * * CopyHostent -- * * Copies string fields of the hostent structure to the private buffer, * honouring the size of the buffer. * * Results: * Number of bytes copied on success or -1 on error (errno = ERANGE) * * Side effects: * None * *--------------------------------------------------------------------------- */ #ifdef NEED_COPYHOSTENT #define NEED_COPYSTRING 1 #define NEED_COPYARRAY 1 static int CopyHostent( struct hostent *tgtPtr, char *buf, size_t buflen) { char *p = buf; Tcl_Size copied, len = 0; copied = CopyString(tgtPtr->h_name, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->h_name = (copied > 0) ? p : NULL; len += copied; p = buf + len; PadBuffer(p, len, sizeof(char *)); copied = CopyArray(tgtPtr->h_aliases, -1, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->h_aliases = (copied > 0) ? (char **)p : NULL; len += copied; p += len; PadBuffer(p, len, sizeof(char *)); copied = CopyArray(tgtPtr->h_addr_list, tgtPtr->h_length, p, buflen-len); if (copied == -1) { goto range; } tgtPtr->h_addr_list = (copied > 0) ? (char **)p : NULL; return 0; range: errno = ERANGE; return -1; } #endif /* NEED_COPYHOSTENT */ /* *--------------------------------------------------------------------------- * * CopyPwd -- * * Copies string fields of the passwd structure to the private buffer, * honouring the size of the buffer. * * Results: * 0 on success or -1 on error (errno = ERANGE). * * Side effects: * We are not copying the gecos field as it may not be supported on all * platforms. * *--------------------------------------------------------------------------- */ #ifdef NEED_COPYPWD #define NEED_COPYSTRING 1 static int CopyPwd( struct passwd *tgtPtr, char *buf, int buflen) { char *p = buf; int copied, len = 0; copied = CopyString(tgtPtr->pw_name, p, buflen - len); if (copied == -1) { range: errno = ERANGE; return -1; } tgtPtr->pw_name = (copied > 0) ? p : NULL; len += copied; p = buf + len; copied = CopyString(tgtPtr->pw_passwd, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->pw_passwd = (copied > 0) ? p : NULL; len += copied; p = buf + len; copied = CopyString(tgtPtr->pw_dir, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->pw_dir = (copied > 0) ? p : NULL; len += copied; p = buf + len; copied = CopyString(tgtPtr->pw_shell, p, buflen - len); if (copied == -1) { goto range; } tgtPtr->pw_shell = (copied > 0) ? p : NULL; return 0; } #endif /* NEED_COPYPWD */ /* *--------------------------------------------------------------------------- * * CopyArray -- * * Copies array of NULL-terminated or fixed-length strings to the private * buffer, honouring the size of the buffer. * * Results: * Number of bytes copied on success or -1 on error (errno = ERANGE) * * Side effects: * None. * *--------------------------------------------------------------------------- */ #ifdef NEED_COPYARRAY static size_t CopyArray( char **src, /* Array of elements to copy. */ int elsize, /* Size of each element, or -1 to indicate * that they are C strings of dynamic * length. */ char *buf, /* Buffer to copy into. */ size_t buflen) /* Size of buffer. */ { size_t i, j, len = 0; char *p, **newBuffer; if (src == NULL) { return 0; } for (i = 0; src[i] != NULL; i++) { /* * Empty loop to count how many. */ } len = sizeof(char *) * (i + 1); /* Leave place for the array. */ if (len > buflen) { return -1; } newBuffer = (char **)buf; p = buf + len; for (j = 0; j < i; j++) { size_t sz = (elsize<0 ? strlen(src[j]) + 1 : (size_t)elsize); len += sz; if (len > buflen) { return -1; } memcpy(p, src[j], sz); newBuffer[j] = p; p = buf + len; } newBuffer[j] = NULL; return len; } #endif /* NEED_COPYARRAY */ /* *--------------------------------------------------------------------------- * * CopyString -- * * Copies a NULL-terminated string to the private buffer, honouring the * size of the buffer * * Results: * 0 success or -1 on error (errno = ERANGE) * * Side effects: * None * *--------------------------------------------------------------------------- */ #ifdef NEED_COPYSTRING static size_t CopyString( const char *src, /* String to copy. */ char *buf, /* Buffer to copy into. */ size_t buflen) /* Size of buffer. */ { size_t len = 0; if (src != NULL) { len = strlen(src) + 1; if (len > buflen) { return -1; } memcpy(buf, src, len); } return len; } #endif /* NEED_COPYSTRING */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* *------------------------------------------------------------------------ * * TclWinCPUID -- * * Get CPU ID information on an Intel box under UNIX (either Linux or Cygwin) * * Results: * Returns TCL_OK if successful, TCL_ERROR if CPUID is not supported. * * Side effects: * If successful, stores EAX, EBX, ECX and EDX registers after the CPUID * instruction in the four integers designated by 'regsPtr' * *---------------------------------------------------------------------- */ int TclWinCPUID( int index, /* Which CPUID value to retrieve. */ int *regsPtr) /* Registers after the CPUID. */ { int status = TCL_ERROR; /* See: */ #if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64) __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */ "cpuid \n\t" "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) : "a"(index)); status = TCL_OK; #elif defined(__i386__) || defined(_M_IX86) __asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */ "cpuid \n\t" "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) : "a"(index)); status = TCL_OK; #else (void)index; (void)regsPtr; #endif return status; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclUnixChan.c0000644000175000017500000016145615104661341015133 0ustar sergeisergei/* * tclUnixChan.c * * Common channel driver for Unix channels based on files, command pipes * and TCP sockets. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" /* Internal definitions for Tcl. */ #include "tclFileSystem.h" #include "tclIO.h" /* To get Channel type declaration. */ #undef SUPPORTS_TTY #if defined(HAVE_TERMIOS_H) # define SUPPORTS_TTY 1 # include # ifdef HAVE_SYS_IOCTL_H # include # endif /* HAVE_SYS_IOCTL_H */ # ifdef HAVE_SYS_MODEM_H # include # endif /* HAVE_SYS_MODEM_H */ # ifdef FIONREAD # define GETREADQUEUE(fd, int) ioctl((fd), FIONREAD, &(int)) # elif defined(FIORDCHK) # define GETREADQUEUE(fd, int) int = ioctl((fd), FIORDCHK, NULL) # else # define GETREADQUEUE(fd, int) int = 0 # endif # ifdef TIOCOUTQ # define GETWRITEQUEUE(fd, int) ioctl((fd), TIOCOUTQ, &(int)) # else # define GETWRITEQUEUE(fd, int) int = 0 # endif # if !defined(CRTSCTS) && defined(CNEW_RTSCTS) # define CRTSCTS CNEW_RTSCTS # endif /* !CRTSCTS&CNEW_RTSCTS */ # if !defined(PAREXT) && defined(CMSPAR) # define PAREXT CMSPAR # endif /* !PAREXT&&CMSPAR */ #endif /* HAVE_TERMIOS_H */ /* * The bits supported for describing the closeMode field of TtyState. */ enum CloseModeBits { CLOSE_DEFAULT, CLOSE_DRAIN, CLOSE_DISCARD }; /* * Helper macros to make parts of this file clearer. The macros do exactly * what they say on the tin. :-) They also only ever refer to their arguments * once, and so can be used without regard to side effects. */ #define SET_BITS(var, bits) ((var) |= (bits)) #define CLEAR_BITS(var, bits) ((var) &= ~(bits)) /* * These structures describe per-instance state of file-based and serial-based * channels. */ typedef struct { Tcl_Channel channel; /* Channel associated with this file. */ int fd; /* File handle. */ int validMask; /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, or TCL_EXCEPTION: indicates * which operations are valid on the file. */ } FileState; typedef struct { FileState fileState; #ifdef SUPPORTS_TTY int closeMode; /* One of CLOSE_DEFAULT, CLOSE_DRAIN or * CLOSE_DISCARD. */ int doReset; /* Whether we should do a terminal reset on * close. */ struct termios initState; /* The state of the terminal when it was * opened. */ #endif /* SUPPORTS_TTY */ } TtyState; #ifdef SUPPORTS_TTY /* * The following structure is used to set or get the serial port attributes in * a platform-independent manner. */ typedef struct { int baud; int parity; int data; int stop; } TtyAttrs; #endif /* SUPPORTS_TTY */ #define UNSUPPORTED_OPTION(detail) \ if (interp) { \ Tcl_SetObjResult(interp, Tcl_ObjPrintf( \ "%s not supported for this platform", (detail))); \ Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (char *)NULL); \ } /* * Static routines for this file: */ static int FileBlockModeProc(void *instanceData, int mode); static int FileCloseProc(void *instanceData, Tcl_Interp *interp, int flags); static int FileGetHandleProc(void *instanceData, int direction, void **handlePtr); static int FileGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static int FileInputProc(void *instanceData, char *buf, int toRead, int *errorCode); static int FileOutputProc(void *instanceData, const char *buf, int toWrite, int *errorCode); static int FileTruncateProc(void *instanceData, long long length); static long long FileWideSeekProc(void *instanceData, long long offset, int mode, int *errorCode); static void FileWatchProc(void *instanceData, int mask); #ifdef SUPPORTS_TTY static int TtyCloseProc(void *instanceData, Tcl_Interp *interp, int flags); static void TtyGetAttributes(int fd, TtyAttrs *ttyPtr); static int TtyGetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); static int TtyGetBaud(speed_t speed); static speed_t TtyGetSpeed(int baud); static void TtyInit(int fd); static void TtyModemStatusStr(int status, Tcl_DString *dsPtr); static int TtyParseMode(Tcl_Interp *interp, const char *mode, TtyAttrs *ttyPtr); static void TtySetAttributes(int fd, TtyAttrs *ttyPtr); static int TtySetOptionProc(void *instanceData, Tcl_Interp *interp, const char *optionName, const char *value); #endif /* SUPPORTS_TTY */ /* * This structure describes the channel type structure for file based IO: */ static const Tcl_ChannelType fileChannelType = { "file", /* Type name. */ TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ FileInputProc, FileOutputProc, NULL, /* Deprecated. */ NULL, /* Set option proc. */ FileGetOptionProc, FileWatchProc, FileGetHandleProc, FileCloseProc, FileBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ FileWideSeekProc, NULL, /* Thread action proc. */ FileTruncateProc }; #ifdef SUPPORTS_TTY /* * This structure describes the channel type structure for serial IO. * Note that this type is a subclass of the "file" type. */ static const Tcl_ChannelType ttyChannelType = { "tty", TCL_CHANNEL_VERSION_5, NULL, /* Deprecated. */ FileInputProc, FileOutputProc, NULL, /* Deprecated. */ TtySetOptionProc, TtyGetOptionProc, FileWatchProc, FileGetHandleProc, TtyCloseProc, FileBlockModeProc, NULL, /* Flush proc. */ NULL, /* Bubbled event handler proc. */ NULL, /* Seek proc. */ NULL, /* Thread action proc. */ NULL /* Truncate proc. */ }; #endif /* SUPPORTS_TTY */ /* *---------------------------------------------------------------------- * * FileBlockModeProc -- * * Helper function to set blocking and nonblocking modes on a file based * channel. Invoked by generic IO level code. * * Results: * 0 if successful, errno when failed. * * Side effects: * Sets the device into blocking or non-blocking mode. * *---------------------------------------------------------------------- */ static int FileBlockModeProc( void *instanceData, /* File state. */ int mode) /* The mode to set. Can be TCL_MODE_BLOCKING * or TCL_MODE_NONBLOCKING. */ { FileState *fsPtr = (FileState *)instanceData; if (TclUnixSetBlockingMode(fsPtr->fd, mode) < 0) { return errno; } return 0; } /* *---------------------------------------------------------------------- * * FileInputProc -- * * This function is invoked from the generic IO level to read input from * a file based channel. * * Results: * The number of bytes read is returned or -1 on error. An output * argument contains a POSIX error code if an error occurs, or zero. * * Side effects: * Reads input from the input device of the channel. * *---------------------------------------------------------------------- */ static int FileInputProc( void *instanceData, /* File state. */ char *buf, /* Where to store data read. */ int toRead, /* How much space is available in the * buffer? */ int *errorCodePtr) /* Where to store error code. */ { FileState *fsPtr = (FileState *)instanceData; ssize_t bytesRead; /* How many bytes were actually read from the * input device? */ *errorCodePtr = 0; /* * Assume there is always enough input available. This will block * appropriately, and read will unblock as soon as a short read is * possible, if the channel is in blocking mode. If the channel is * nonblocking, the read will never block. */ do { bytesRead = read(fsPtr->fd, buf, toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { *errorCodePtr = errno; return -1; } return (int)bytesRead; } /* *---------------------------------------------------------------------- * * FileOutputProc-- * * This function is invoked from the generic IO level to write output to * a file channel. * * Results: * The number of bytes written is returned or -1 on error. An output * argument contains a POSIX error code if an error occurred, or zero. * * Side effects: * Writes output on the output device of the channel. * *---------------------------------------------------------------------- */ static int FileOutputProc( void *instanceData, /* File state. */ const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCodePtr) /* Where to store error code. */ { FileState *fsPtr = (FileState *)instanceData; ssize_t written; *errorCodePtr = 0; if (toWrite == 0) { /* * SF Tcl Bug 465765. Do not try to write nothing into a file. STREAM * based implementations will considers this as EOF (if there is a * pipe behind the file). */ return 0; } written = write(fsPtr->fd, buf, toWrite); if (written >= 0) { return (int)written; } *errorCodePtr = errno; return -1; } /* *---------------------------------------------------------------------- * * FileCloseProc, TtyCloseProc -- * * These functions are called from the generic IO level to perform * channel-type-specific cleanup when a file- or tty-based channel is * closed. * * Results: * 0 if successful, errno if failed. * * Side effects: * Closes the device of the channel. * *---------------------------------------------------------------------- */ static int FileCloseProc( void *instanceData, /* File state. */ TCL_UNUSED(Tcl_Interp *), int flags) { FileState *fsPtr = (FileState *)instanceData; int errorCode = 0; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; } Tcl_DeleteFileHandler(fsPtr->fd); /* * Do not close standard channels while in thread-exit. */ if (!TclInThreadExit() || ((fsPtr->fd != 0) && (fsPtr->fd != 1) && (fsPtr->fd != 2))) { if (close(fsPtr->fd) < 0) { errorCode = errno; } } Tcl_Free(fsPtr); return errorCode; } #ifdef SUPPORTS_TTY static int TtyCloseProc( void *instanceData, Tcl_Interp *interp, int flags) { TtyState *ttyPtr = (TtyState*)instanceData; if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) { return EINVAL; } /* * If we've been asked by the user to drain or flush, do so now. */ switch (ttyPtr->closeMode) { case CLOSE_DRAIN: tcdrain(ttyPtr->fileState.fd); break; case CLOSE_DISCARD: tcflush(ttyPtr->fileState.fd, TCIOFLUSH); break; default: /* Do nothing */ break; } /* * If we've had our state changed from the default, reset now. */ if (ttyPtr->doReset) { tcsetattr(ttyPtr->fileState.fd, TCSANOW, &ttyPtr->initState); } /* * Delegate to close for files. */ return FileCloseProc(instanceData, interp, flags); } #endif /* SUPPORTS_TTY */ /* *---------------------------------------------------------------------- * * FileWideSeekProc -- * * This function is called by the generic IO level to move the access * point in a file based channel, with offsets expressed as wide * integers. * * Results: * -1 if failed, the new position if successful. An output argument * contains the POSIX error code if an error occurred, or zero. * * Side effects: * Moves the location at which the channel will be accessed in future * operations. * *---------------------------------------------------------------------- */ static long long FileWideSeekProc( void *instanceData, /* File state. */ long long offset, /* Offset to seek to. */ int mode, /* Relative to where should we seek? Can be * one of SEEK_START, SEEK_CUR or SEEK_END. */ int *errorCodePtr) /* To store error code. */ { FileState *fsPtr = (FileState *)instanceData; long long newLoc; newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode); *errorCodePtr = (newLoc == -1) ? errno : 0; return newLoc; } /* *---------------------------------------------------------------------- * * FileWatchProc -- * * Initialize the notifier to watch the fd from this channel. * * Results: * None. * * Side effects: * Sets up the notifier so that a future event on the channel will * be seen by Tcl. * *---------------------------------------------------------------------- */ /* * Bug ad5a57f2f271: Tcl_NotifyChannel is not a Tcl_FileProc, * so do not pass it to directly to Tcl_CreateFileHandler. * Instead, pass a wrapper which is a Tcl_FileProc. */ static void FileWatchNotifyChannelWrapper( void *clientData, int mask) { Tcl_Channel channel = (Tcl_Channel)clientData; Tcl_NotifyChannel(channel, mask); } static void FileWatchProc( void *instanceData, /* The file state. */ int mask) /* Events of interest; an OR-ed combination of * TCL_READABLE, TCL_WRITABLE and * TCL_EXCEPTION. */ { FileState *fsPtr = (FileState *)instanceData; /* * Make sure we only register for events that are valid on this file. */ mask &= fsPtr->validMask; if (mask) { Tcl_CreateFileHandler(fsPtr->fd, mask, FileWatchNotifyChannelWrapper, fsPtr->channel); } else { Tcl_DeleteFileHandler(fsPtr->fd); } } /* *---------------------------------------------------------------------- * * FileGetHandleProc -- * * Called from Tcl_GetChannelHandle to retrieve OS handles from a file * based channel. * * Results: * Returns TCL_OK with the fd in handlePtr, or TCL_ERROR if there is no * handle for the specified direction. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int FileGetHandleProc( void *instanceData, /* The file state. */ int direction, /* TCL_READABLE or TCL_WRITABLE */ void **handlePtr) /* Where to store the handle. */ { FileState *fsPtr = (FileState *)instanceData; if (direction & fsPtr->validMask) { *handlePtr = INT2PTR(fsPtr->fd); return TCL_OK; } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * FileGetOptionProc -- * * Gets an option associated with an open file. If the optionName arg is * non-NULL, retrieves the value of that option. If the optionName arg is * NULL, retrieves a list of alternating option names and values for the * given channel. * * Results: * A standard Tcl result. Also sets the supplied DString to the string * value of the option(s) returned. Sets error message if needed * (by calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static inline const char * GetTypeFromMode( int mode) { /* * TODO: deduplicate with tclCmdAH.c */ if (S_ISREG(mode)) { return "file"; } else if (S_ISDIR(mode)) { return "directory"; } else if (S_ISCHR(mode)) { return "characterSpecial"; } else if (S_ISBLK(mode)) { return "blockSpecial"; } else if (S_ISFIFO(mode)) { return "fifo"; #ifdef S_ISLNK } else if (S_ISLNK(mode)) { return "link"; #endif #ifdef S_ISSOCK } else if (S_ISSOCK(mode)) { return "socket"; #endif } return "unknown"; } static Tcl_Obj * StatOpenFile( FileState *fsPtr) { Tcl_StatBuf statBuf; /* Not allocated on heap; we're definitely * API-synchronized with how Tcl is built! */ Tcl_Obj *dictObj; unsigned short mode; if (TclOSfstat(fsPtr->fd, &statBuf) < 0) { return NULL; } /* * TODO: merge with TIP 594 implementation (it's silly to have a * duplicate!) */ TclNewObj(dictObj); #define STORE_ELEM(name, value) TclDictPut(NULL, dictObj, name, value) STORE_ELEM("dev", Tcl_NewWideIntObj((long) statBuf.st_dev)); STORE_ELEM("ino", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_ino)); STORE_ELEM("nlink", Tcl_NewWideIntObj((long) statBuf.st_nlink)); STORE_ELEM("uid", Tcl_NewWideIntObj((long) statBuf.st_uid)); STORE_ELEM("gid", Tcl_NewWideIntObj((long) statBuf.st_gid)); STORE_ELEM("size", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_size)); #ifdef HAVE_STRUCT_STAT_ST_BLOCKS STORE_ELEM("blocks", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_blocks)); #endif #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE STORE_ELEM("blksize", Tcl_NewWideIntObj((long) statBuf.st_blksize)); #endif #ifdef HAVE_STRUCT_STAT_ST_RDEV if (S_ISCHR(statBuf.st_mode) || S_ISBLK(statBuf.st_mode)) { STORE_ELEM("rdev", Tcl_NewWideIntObj((long) statBuf.st_rdev)); } #endif STORE_ELEM("atime", Tcl_NewWideIntObj( Tcl_GetAccessTimeFromStat(&statBuf))); STORE_ELEM("mtime", Tcl_NewWideIntObj( Tcl_GetModificationTimeFromStat(&statBuf))); STORE_ELEM("ctime", Tcl_NewWideIntObj( Tcl_GetChangeTimeFromStat(&statBuf))); mode = (unsigned short) statBuf.st_mode; STORE_ELEM("mode", Tcl_NewWideIntObj(mode)); STORE_ELEM("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1)); #undef STORE_ELEM return dictObj; } static int FileGetOptionProc( void *instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr) { FileState *fsPtr = (FileState *)instanceData; int valid = 0; /* Flag if valid option parsed. */ size_t len; if (optionName == NULL) { len = 0; valid = 1; } else { len = strlen(optionName); } /* * Get option -stat * Option is readonly and returned by [fconfigure chan -stat] but not * returned by [fconfigure chan] without explicit option name. */ if ((len > 1) && (strncmp(optionName, "-stat", len) == 0)) { Tcl_Obj *dictObj = StatOpenFile(fsPtr); const char *dictContents; Tcl_Size dictLength; if (dictObj == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read file channel status: %s", Tcl_PosixError(interp))); return TCL_ERROR; } /* * Transfer dictionary to the DString. Note that we don't do this as * an element as this is an option that can't be retrieved with a * general probe. */ dictContents = TclGetStringFromObj(dictObj, &dictLength); Tcl_DStringAppend(dsPtr, dictContents, dictLength); Tcl_DecrRefCount(dictObj); return TCL_OK; } if (valid) { return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "stat"); } #ifdef SUPPORTS_TTY /* *---------------------------------------------------------------------- * * TtyModemStatusStr -- * * Converts a RS232 modem status list of readable flags * *---------------------------------------------------------------------- */ static void TtyModemStatusStr( int status, /* RS232 modem status */ Tcl_DString *dsPtr) /* Where to store string */ { #ifdef TIOCM_CTS Tcl_DStringAppendElement(dsPtr, "CTS"); Tcl_DStringAppendElement(dsPtr, (status & TIOCM_CTS) ? "1" : "0"); #endif /* TIOCM_CTS */ #ifdef TIOCM_DSR Tcl_DStringAppendElement(dsPtr, "DSR"); Tcl_DStringAppendElement(dsPtr, (status & TIOCM_DSR) ? "1" : "0"); #endif /* TIOCM_DSR */ #ifdef TIOCM_RNG Tcl_DStringAppendElement(dsPtr, "RING"); Tcl_DStringAppendElement(dsPtr, (status & TIOCM_RNG) ? "1" : "0"); #endif /* TIOCM_RNG */ #ifdef TIOCM_CD Tcl_DStringAppendElement(dsPtr, "DCD"); Tcl_DStringAppendElement(dsPtr, (status & TIOCM_CD) ? "1" : "0"); #endif /* TIOCM_CD */ } /* *---------------------------------------------------------------------- * * TtySetOptionProc -- * * Sets an option on a channel. * * Results: * A standard Tcl result. Also sets the interp's result on error if * interp is not NULL. * * Side effects: * May modify an option on a device. Sets Error message if needed (by * calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static int TtySetOptionProc( void *instanceData, /* File state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Which option to set? */ const char *value) /* New value for option. */ { TtyState *fsPtr = (TtyState *)instanceData; size_t len, vlen; TtyAttrs tty; Tcl_Size argc; const char **argv; struct termios iostate; len = strlen(optionName); vlen = strlen(value); /* * Option -mode baud,parity,databits,stopbits */ if ((len > 2) && (strncmp(optionName, "-mode", len) == 0)) { if (TtyParseMode(interp, value, &tty) != TCL_OK) { return TCL_ERROR; } /* * system calls results should be checked there. - dl */ TtySetAttributes(fsPtr->fileState.fd, &tty); return TCL_OK; } /* * Option -handshake none|xonxoff|rtscts|dtrdsr */ if ((len > 1) && (strncmp(optionName, "-handshake", len) == 0)) { /* * Reset all handshake options. DTR and RTS are ON by default. */ tcgetattr(fsPtr->fileState.fd, &iostate); CLEAR_BITS(iostate.c_iflag, IXON | IXOFF | IXANY); #ifdef CRTSCTS CLEAR_BITS(iostate.c_cflag, CRTSCTS); #endif /* CRTSCTS */ if (strncasecmp(value, "NONE", vlen) == 0) { /* * Leave all handshake options disabled. */ } else if (strncasecmp(value, "XONXOFF", vlen) == 0) { SET_BITS(iostate.c_iflag, IXON | IXOFF | IXANY); } else if (strncasecmp(value, "RTSCTS", vlen) == 0) { #ifdef CRTSCTS SET_BITS(iostate.c_cflag, CRTSCTS); #else /* !CRTSTS */ UNSUPPORTED_OPTION("-handshake RTSCTS"); return TCL_ERROR; #endif /* CRTSCTS */ } else if (strncasecmp(value, "DTRDSR", vlen) == 0) { UNSUPPORTED_OPTION("-handshake DTRDSR"); return TCL_ERROR; } else { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -handshake: must be one of" " xonxoff, rtscts, dtrdsr or none", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } return TCL_ERROR; } tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate); return TCL_OK; } /* * Option -xchar {\x11 \x13} */ if ((len > 1) && (strncmp(optionName, "-xchar", len) == 0)) { if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; } else if (argc != 2) { badXchar: if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -xchar: should be a list of" " two elements with each a single 8-bit character", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "XCHAR", (char *)NULL); } Tcl_Free(argv); return TCL_ERROR; } tcgetattr(fsPtr->fileState.fd, &iostate); iostate.c_cc[VSTART] = argv[0][0]; iostate.c_cc[VSTOP] = argv[1][0]; if (argv[0][0] & 0x80 || argv[1][0] & 0x80) { Tcl_UniChar character = 0; Tcl_Size charLen; charLen = TclUtfToUniChar(argv[0], &character); if ((character > 0xFF) || argv[0][charLen]) { goto badXchar; } iostate.c_cc[VSTART] = (cc_t)character; charLen = TclUtfToUniChar(argv[1], &character); if ((character > 0xFF) || argv[1][charLen]) { goto badXchar; } iostate.c_cc[VSTOP] = (cc_t)character; } Tcl_Free(argv); tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate); return TCL_OK; } /* * Option -timeout msec */ if ((len > 2) && (strncmp(optionName, "-timeout", len) == 0)) { int msec; tcgetattr(fsPtr->fileState.fd, &iostate); if (Tcl_GetInt(interp, value, &msec) != TCL_OK) { return TCL_ERROR; } iostate.c_cc[VMIN] = 0; iostate.c_cc[VTIME] = (msec==0) ? 0 : (msec<100) ? 1 : (cc_t)((msec+50)/100); tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate); return TCL_OK; } /* * Option -ttycontrol {DTR 1 RTS 0 BREAK 0} */ if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) { #if defined(TIOCMGET) && defined(TIOCMSET) int control, flag; Tcl_Size i; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; } if ((argc % 2) == 1) { if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "bad value for -ttycontrol: should be a list of" " signal,value pairs", -1)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } Tcl_Free(argv); return TCL_ERROR; } ioctl(fsPtr->fileState.fd, TIOCMGET, &control); for (i = 0; i < argc-1; i += 2) { if (Tcl_GetBoolean(interp, argv[i+1], &flag) == TCL_ERROR) { Tcl_Free(argv); return TCL_ERROR; } if (strncasecmp(argv[i], "DTR", strlen(argv[i])) == 0) { if (flag) { SET_BITS(control, TIOCM_DTR); } else { CLEAR_BITS(control, TIOCM_DTR); } } else if (strncasecmp(argv[i], "RTS", strlen(argv[i])) == 0) { if (flag) { SET_BITS(control, TIOCM_RTS); } else { CLEAR_BITS(control, TIOCM_RTS); } } else if (strncasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) { #if defined(TIOCSBRK) && defined(TIOCCBRK) if (flag) { ioctl(fsPtr->fileState.fd, TIOCSBRK, NULL); } else { ioctl(fsPtr->fileState.fd, TIOCCBRK, NULL); } #else /* TIOCSBRK & TIOCCBRK */ UNSUPPORTED_OPTION("-ttycontrol BREAK"); Tcl_Free(argv); return TCL_ERROR; #endif /* TIOCSBRK & TIOCCBRK */ } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad signal \"%s\" for -ttycontrol: must be" " DTR, RTS or BREAK", argv[i])); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } Tcl_Free(argv); return TCL_ERROR; } } /* -ttycontrol options loop */ ioctl(fsPtr->fileState.fd, TIOCMSET, &control); Tcl_Free(argv); return TCL_OK; #else /* TIOCMGET&TIOCMSET */ UNSUPPORTED_OPTION("-ttycontrol"); #endif /* TIOCMGET&TIOCMSET */ } /* * Option -closemode drain|discard */ if ((len > 2) && (strncmp(optionName, "-closemode", len) == 0)) { if (strncasecmp(value, "DEFAULT", vlen) == 0) { fsPtr->closeMode = CLOSE_DEFAULT; } else if (strncasecmp(value, "DRAIN", vlen) == 0) { fsPtr->closeMode = CLOSE_DRAIN; } else if (strncasecmp(value, "DISCARD", vlen) == 0) { fsPtr->closeMode = CLOSE_DISCARD; } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad mode \"%s\" for -closemode: must be" " default, discard, or drain", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } return TCL_ERROR; } return TCL_OK; } /* * Option -inputmode normal|password|raw */ if ((len > 2) && (strncmp(optionName, "-inputmode", len) == 0)) { if (tcgetattr(fsPtr->fileState.fd, &iostate) < 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read serial terminal control state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } if (strncasecmp(value, "NORMAL", vlen) == 0) { SET_BITS(iostate.c_iflag, BRKINT | IGNPAR | ISTRIP | ICRNL | IXON); SET_BITS(iostate.c_oflag, OPOST); SET_BITS(iostate.c_lflag, ECHO | ECHONL | ICANON | ISIG); } else if (strncasecmp(value, "PASSWORD", vlen) == 0) { SET_BITS(iostate.c_iflag, BRKINT | IGNPAR | ISTRIP | ICRNL | IXON); SET_BITS(iostate.c_oflag, OPOST); CLEAR_BITS(iostate.c_lflag, ECHO); /* * Note: password input turns out to be best if you echo the * newline that the user types. Theoretically we could get users * to do the processing of this in their scripts, but it always * feels highly unnatural to do so in practice. */ SET_BITS(iostate.c_lflag, ECHONL | ICANON | ISIG); } else if (strncasecmp(value, "RAW", vlen) == 0) { #ifdef HAVE_CFMAKERAW cfmakeraw(&iostate); #else /* !HAVE_CFMAKERAW */ CLEAR_BITS(iostate.c_iflag, IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); CLEAR_BITS(iostate.c_oflag, OPOST); CLEAR_BITS(iostate.c_lflag, ECHO | ECHONL | ICANON | ISIG | IEXTEN); CLEAR_BITS(iostate.c_cflag, CSIZE | PARENB); SET_BITS(iostate.c_cflag, CS8); #endif /* HAVE_CFMAKERAW */ } else if (strncasecmp(value, "RESET", vlen) == 0) { /* * Reset to the initial state, whatever that is. */ memcpy(&iostate, &fsPtr->initState, sizeof(struct termios)); } else { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad mode \"%s\" for -inputmode: must be" " normal, password, raw, or reset", value)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FCONFIGURE", "VALUE", (char *)NULL); } return TCL_ERROR; } if (tcsetattr(fsPtr->fileState.fd, TCSADRAIN, &iostate) < 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't update serial terminal control state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } /* * If we've changed the state from default, schedule a reset later. * Note that this specifically does not detect changes made by calling * an external stty program; that is deliberate, as it maintains * compatibility with existing code! * * This mechanism in Tcl is not intended to be a full replacement for * what stty does; it just handles a few common cases and tries not to * leave things in a broken state. */ fsPtr->doReset = (memcmp(&iostate, &fsPtr->initState, sizeof(struct termios)) != 0); return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "closemode inputmode mode handshake timeout ttycontrol xchar"); } /* *---------------------------------------------------------------------- * * TtyGetOptionProc -- * * Gets a mode associated with an IO channel. If the optionName arg is * non-NULL, retrieves the value of that option. If the optionName arg is * NULL, retrieves a list of alternating option names and values for the * given channel. * * Results: * A standard Tcl result. Also sets the supplied DString to the string * value of the option(s) returned. Sets error message if needed * (by calling Tcl_BadChannelOption). * *---------------------------------------------------------------------- */ static int TtyGetOptionProc( void *instanceData, /* File state. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */ const char *optionName, /* Option to get. */ Tcl_DString *dsPtr) /* Where to store value(s). */ { TtyState *fsPtr = (TtyState *)instanceData; size_t len; char buf[3*TCL_INTEGER_SPACE + 16]; int valid = 0; /* Flag if valid option parsed. */ struct termios iostate; if (optionName == NULL) { len = 0; } else { len = strlen(optionName); } /* * Get option -closemode */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-closemode"); } if (len==0 || (len>1 && strncmp(optionName, "-closemode", len)==0)) { switch (fsPtr->closeMode) { case CLOSE_DRAIN: Tcl_DStringAppendElement(dsPtr, "drain"); break; case CLOSE_DISCARD: Tcl_DStringAppendElement(dsPtr, "discard"); break; default: Tcl_DStringAppendElement(dsPtr, "default"); break; } } /* * Get option -inputmode * * This is a great simplification of the underlying reality, but actually * represents what almost all scripts really want to know. */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-inputmode"); } if (len==0 || (len>1 && strncmp(optionName, "-inputmode", len)==0)) { valid = 1; if (tcgetattr(fsPtr->fileState.fd, &iostate) < 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read serial terminal control state: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } if (iostate.c_lflag & ICANON) { if (iostate.c_lflag & ECHO) { Tcl_DStringAppendElement(dsPtr, "normal"); } else { Tcl_DStringAppendElement(dsPtr, "password"); } } else { Tcl_DStringAppendElement(dsPtr, "raw"); } } /* * Get option -mode */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-mode"); } if (len==0 || (len>2 && strncmp(optionName, "-mode", len)==0)) { TtyAttrs tty; valid = 1; TtyGetAttributes(fsPtr->fileState.fd, &tty); snprintf(buf, sizeof(buf), "%d,%c,%d,%d", tty.baud, tty.parity, tty.data, tty.stop); Tcl_DStringAppendElement(dsPtr, buf); } /* * Get option -xchar */ if (len == 0) { Tcl_DStringAppendElement(dsPtr, "-xchar"); Tcl_DStringStartSublist(dsPtr); } if (len==0 || (len>1 && strncmp(optionName, "-xchar", len)==0)) { Tcl_DString ds; valid = 1; tcgetattr(fsPtr->fileState.fd, &iostate); Tcl_DStringInit(&ds); Tcl_ExternalToUtfDStringEx(NULL, NULL, (char *) &iostate.c_cc[VSTART], 1, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds)); TclDStringClear(&ds); Tcl_ExternalToUtfDStringEx(NULL, NULL, (char *) &iostate.c_cc[VSTOP], 1, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); Tcl_DStringAppendElement(dsPtr, Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); } if (len == 0) { Tcl_DStringEndSublist(dsPtr); } /* * Get option -queue * Option is readonly and returned by [fconfigure chan -queue] but not * returned by unnamed [fconfigure chan]. */ if ((len > 1) && (strncmp(optionName, "-queue", len) == 0)) { int inQueue=0, outQueue=0, inBuffered, outBuffered; valid = 1; GETREADQUEUE(fsPtr->fileState.fd, inQueue); GETWRITEQUEUE(fsPtr->fileState.fd, outQueue); inBuffered = Tcl_InputBuffered(fsPtr->fileState.channel); outBuffered = Tcl_OutputBuffered(fsPtr->fileState.channel); snprintf(buf, sizeof(buf), "%d", inBuffered+inQueue); Tcl_DStringAppendElement(dsPtr, buf); snprintf(buf, sizeof(buf), "%d", outBuffered+outQueue); Tcl_DStringAppendElement(dsPtr, buf); } #if defined(TIOCMGET) /* * Get option -ttystatus * Option is readonly and returned by [fconfigure chan -ttystatus] but not * returned by unnamed [fconfigure chan]. */ if ((len > 4) && (strncmp(optionName, "-ttystatus", len) == 0)) { int status; valid = 1; ioctl(fsPtr->fileState.fd, TIOCMGET, &status); TtyModemStatusStr(status, dsPtr); } #endif /* TIOCMGET */ #if defined(TIOCGWINSZ) /* * Get option -winsize * Option is readonly and returned by [fconfigure chan -winsize] but not * returned by [fconfigure chan] without explicit option name. */ if ((len > 1) && (strncmp(optionName, "-winsize", len) == 0)) { struct winsize ws; valid = 1; if (ioctl(fsPtr->fileState.fd, TIOCGWINSZ, &ws) < 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't read terminal size: %s", Tcl_PosixError(interp))); } return TCL_ERROR; } snprintf(buf, sizeof(buf), "%d", ws.ws_col); Tcl_DStringAppendElement(dsPtr, buf); snprintf(buf, sizeof(buf), "%d", ws.ws_row); Tcl_DStringAppendElement(dsPtr, buf); } #endif /* TIOCGWINSZ */ if (valid) { return TCL_OK; } return Tcl_BadChannelOption(interp, optionName, "closemode inputmode mode queue ttystatus winsize xchar"); } static const struct {int baud; speed_t speed;} speeds[] = { #ifdef B0 {0, B0}, #endif #ifdef B50 {50, B50}, #endif #ifdef B75 {75, B75}, #endif #ifdef B110 {110, B110}, #endif #ifdef B134 {134, B134}, #endif #ifdef B150 {150, B150}, #endif #ifdef B200 {200, B200}, #endif #ifdef B300 {300, B300}, #endif #ifdef B600 {600, B600}, #endif #ifdef B1200 {1200, B1200}, #endif #ifdef B1800 {1800, B1800}, #endif #ifdef B2400 {2400, B2400}, #endif #ifdef B4800 {4800, B4800}, #endif #ifdef B9600 {9600, B9600}, #endif #ifdef B14400 {14400, B14400}, #endif #ifdef B19200 {19200, B19200}, #endif #ifdef EXTA {19200, EXTA}, #endif #ifdef B28800 {28800, B28800}, #endif #ifdef B38400 {38400, B38400}, #endif #ifdef EXTB {38400, EXTB}, #endif #ifdef B57600 {57600, B57600}, #endif #ifdef _B57600 {57600, _B57600}, #endif #ifdef B76800 {76800, B76800}, #endif #ifdef B115200 {115200, B115200}, #endif #ifdef _B115200 {115200, _B115200}, #endif #ifdef B153600 {153600, B153600}, #endif #ifdef B230400 {230400, B230400}, #endif #ifdef B307200 {307200, B307200}, #endif #ifdef B460800 {460800, B460800}, #endif #ifdef B500000 {500000, B500000}, #endif #ifdef B576000 {576000, B576000}, #endif #ifdef B921600 {921600, B921600}, #endif #ifdef B1000000 {1000000, B1000000}, #endif #ifdef B1152000 {1152000, B1152000}, #endif #ifdef B1500000 {1500000,B1500000}, #endif #ifdef B2000000 {2000000, B2000000}, #endif #ifdef B2500000 {2500000,B2500000}, #endif #ifdef B3000000 {3000000,B3000000}, #endif #ifdef B3500000 {3500000,B3500000}, #endif #ifdef B4000000 {4000000,B4000000}, #endif {-1, 0} }; /* *--------------------------------------------------------------------------- * * TtyGetSpeed -- * * Given an integer baud rate, get the speed_t value that should be * used to select that baud rate. * * Results: * As above. * *--------------------------------------------------------------------------- */ static speed_t TtyGetSpeed( int baud) /* The baud rate to look up. */ { int bestIdx, bestDiff, i, diff; bestIdx = 0; bestDiff = 1000000; /* * If the baud rate does not correspond to one of the known mask values, * choose the mask value whose baud rate is closest to the specified baud * rate. */ for (i = 0; speeds[i].baud >= 0; i++) { diff = speeds[i].baud - baud; if (diff < 0) { diff = -diff; } if (diff < bestDiff) { bestIdx = i; bestDiff = diff; } } return speeds[bestIdx].speed; } /* *--------------------------------------------------------------------------- * * TtyGetBaud -- * * Return the integer baud rate corresponding to a given speed_t value. * * Results: * As above. If the mask value was not recognized, 0 is returned. * *--------------------------------------------------------------------------- */ static int TtyGetBaud( speed_t speed) /* Speed mask value to look up. */ { int i; for (i = 0; speeds[i].baud >= 0; i++) { if (speeds[i].speed == speed) { return speeds[i].baud; } } return 0; } /* *--------------------------------------------------------------------------- * * TtyGetAttributes -- * * Get the current attributes of the specified serial device. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static void TtyGetAttributes( int fd, /* Open file descriptor for serial port to be * queried. */ TtyAttrs *ttyPtr) /* Buffer filled with serial port * attributes. */ { struct termios iostate; int baud, parity, data, stop; tcgetattr(fd, &iostate); baud = TtyGetBaud(cfgetospeed(&iostate)); parity = 'n'; #ifdef PAREXT switch ((int) (iostate.c_cflag & (PARENB | PARODD | PAREXT))) { case PARENB : parity = 'e'; break; case PARENB | PARODD : parity = 'o'; break; case PARENB | PAREXT : parity = 's'; break; case PARENB | PARODD | PAREXT : parity = 'm'; break; } #else /* !PAREXT */ switch ((int) (iostate.c_cflag & (PARENB | PARODD))) { case PARENB : parity = 'e'; break; case PARENB | PARODD : parity = 'o'; break; } #endif /* PAREXT */ data = iostate.c_cflag & CSIZE; data = (data == CS5) ? 5 : (data == CS6) ? 6 : (data == CS7) ? 7 : 8; stop = (iostate.c_cflag & CSTOPB) ? 2 : 1; ttyPtr->baud = baud; ttyPtr->parity = parity; ttyPtr->data = data; ttyPtr->stop = stop; } /* *--------------------------------------------------------------------------- * * TtySetAttributes -- * * Set the current attributes of the specified serial device. * * Results: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static void TtySetAttributes( int fd, /* Open file descriptor for serial port to be * modified. */ TtyAttrs *ttyPtr) /* Buffer containing new attributes for serial * port. */ { struct termios iostate; int parity, data, flag; tcgetattr(fd, &iostate); cfsetospeed(&iostate, TtyGetSpeed(ttyPtr->baud)); cfsetispeed(&iostate, TtyGetSpeed(ttyPtr->baud)); flag = 0; parity = ttyPtr->parity; if (parity != 'n') { SET_BITS(flag, PARENB); #ifdef PAREXT CLEAR_BITS(iostate.c_cflag, PAREXT); if ((parity == 'm') || (parity == 's')) { SET_BITS(flag, PAREXT); } #endif /* PAREXT */ if ((parity == 'm') || (parity == 'o')) { SET_BITS(flag, PARODD); } } data = ttyPtr->data; SET_BITS(flag, (data == 5) ? CS5 : (data == 6) ? CS6 : (data == 7) ? CS7 : CS8); if (ttyPtr->stop == 2) { SET_BITS(flag, CSTOPB); } CLEAR_BITS(iostate.c_cflag, PARENB | PARODD | CSIZE | CSTOPB); SET_BITS(iostate.c_cflag, flag); tcsetattr(fd, TCSADRAIN, &iostate); } /* *--------------------------------------------------------------------------- * * TtyParseMode -- * * Parse the "-mode" argument to the fconfigure command. The argument is * of the form baud,parity,data,stop. * * Results: * The return value is TCL_OK if the argument was successfully parsed, * TCL_ERROR otherwise. If TCL_ERROR is returned, an error message is * left in the interp's result (if interp is non-NULL). * *--------------------------------------------------------------------------- */ static int TtyParseMode( Tcl_Interp *interp, /* If non-NULL, interp for error return. */ const char *mode, /* Mode string to be parsed. */ TtyAttrs *ttyPtr) /* Filled with data from mode string */ { int i, end; char parity; const char *bad = "bad value for -mode"; i = sscanf(mode, "%d,%c,%d,%d%n", &ttyPtr->baud, &parity, &ttyPtr->data, &ttyPtr->stop, &end); if ((i != 4) || (mode[end] != '\0')) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s: should be baud,parity,data,stop", bad)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL); } return TCL_ERROR; } /* * Only allow setting mark/space parity on platforms that support it Make * sure to allow for the case where strchr is a macro. [Bug: 5089] * * We cannot if/else/endif the strchr arguments, it has to be the whole * function. On AIX this function is apparently a macro, and macros do * not allow preprocessor directives in their arguments. */ #ifdef PAREXT #define PARITY_CHARS "noems" #define PARITY_MSG "n, o, e, m, or s" #else #define PARITY_CHARS "noe" #define PARITY_MSG "n, o, or e" #endif /* PAREXT */ if (strchr(PARITY_CHARS, parity) == NULL) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s parity: should be %s", bad, PARITY_MSG)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL); } return TCL_ERROR; } ttyPtr->parity = parity; if ((ttyPtr->data < 5) || (ttyPtr->data > 8)) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s data: should be 5, 6, 7, or 8", bad)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL); } return TCL_ERROR; } if ((ttyPtr->stop < 0) || (ttyPtr->stop > 2)) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s stop: should be 1 or 2", bad)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "SERIALMODE", (char *)NULL); } return TCL_ERROR; } return TCL_OK; } /* *--------------------------------------------------------------------------- * * TtyInit -- * * Given file descriptor that refers to a serial port, initialize the * serial port to a set of sane values so that Tcl can talk to a device * located on the serial port. * * Side effects: * Serial device initialized to non-blocking raw mode, similar to sockets * All other modes can be simulated on top of this in Tcl. * *--------------------------------------------------------------------------- */ static void TtyInit( int fd) /* Open file descriptor for serial port to be * initialized. */ { struct termios iostate; tcgetattr(fd, &iostate); if (iostate.c_iflag != IGNBRK || iostate.c_oflag != 0 || iostate.c_lflag != 0 || iostate.c_cflag & CREAD || iostate.c_cc[VMIN] != 1 || iostate.c_cc[VTIME] != 0) { iostate.c_iflag = IGNBRK; iostate.c_oflag = 0; iostate.c_lflag = 0; iostate.c_cflag |= CREAD; iostate.c_cc[VMIN] = 1; iostate.c_cc[VTIME] = 0; tcsetattr(fd, TCSADRAIN, &iostate); } } #endif /* SUPPORTS_TTY */ /* *---------------------------------------------------------------------- * * TclpOpenFileChannel -- * * Open an file based channel on Unix systems. * * Results: * The new channel or NULL. If NULL, the output argument errorCodePtr is * set to a POSIX error and an error message is left in the interp's * result if interp is not NULL. * * Side effects: * May open the channel and may cause creation of a file on the file * system. * *---------------------------------------------------------------------- */ Tcl_Channel TclpOpenFileChannel( Tcl_Interp *interp, /* Interpreter for error reporting; can be * NULL. */ Tcl_Obj *pathPtr, /* Name of file to open. */ int mode, /* POSIX open mode. */ int permissions) /* If the open involves creating a file, with * what modes to create it? */ { int fd, channelPermissions; TtyState *fsPtr; const char *native, *translation; char channelName[16 + TCL_INTEGER_SPACE]; const Tcl_ChannelType *channelTypePtr; switch (mode & O_ACCMODE) { case O_RDONLY: channelPermissions = TCL_READABLE; break; case O_WRONLY: channelPermissions = TCL_WRITABLE; break; case O_RDWR: channelPermissions = (TCL_READABLE | TCL_WRITABLE); break; default: /* * This may occurr if modeString was "", for example. */ Tcl_Panic("TclpOpenFileChannel: invalid mode value"); return NULL; } native = (const char *)Tcl_FSGetNativePath(pathPtr); if (native == NULL) { if (interp != (Tcl_Interp *) NULL) { /* * We need this just to ensure we return the correct error messages under * some circumstances (relative paths only), so because the normalization * is very expensive, don't invoke it for native or absolute paths. * Note: since paths starting with ~ are absolute, it also considers tilde expansion, * (proper error message of tests *io-40.17 "tilde substitution in open") */ if (((!TclFSCwdIsNative() && (Tcl_FSGetPathType(pathPtr) != TCL_PATH_ABSOLUTE)) || (*TclGetString(pathPtr) == '~')) /* possible tilde expansion */ && Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL) { return NULL; } Tcl_AppendResult(interp, "couldn't open \"", TclGetString(pathPtr), "\": filename is invalid on this platform", (char *)NULL); } return NULL; } #ifdef DJGPP SET_BITS(mode, O_BINARY); #endif fd = TclOSopen(native, mode, permissions); if (fd < 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't open \"%s\": %s", TclGetString(pathPtr), Tcl_PosixError(interp))); } return NULL; } /* * Set close-on-exec flag on the fd so that child processes will not * inherit this fd. */ fcntl(fd, F_SETFD, FD_CLOEXEC); #ifdef SUPPORTS_TTY if (strcmp(native, "/dev/tty") != 0 && isatty(fd)) { /* * Initialize the serial port to a set of sane parameters. Especially * important if the remote device is set to echo and the serial port * driver was also set to echo -- as soon as a char were sent to the * serial port, the remote device would echo it, then the serial * driver would echo it back to the device, etc. * * Note that we do not do this if we're dealing with /dev/tty itself, * as that tends to cause Bad Things To Happen when you're working * interactively. Strictly a better check would be to see if the FD * being set up is a device and has the same major/minor as the * initial std FDs (beware reopening!) but that's nearly as messy. */ translation = "auto crlf"; channelTypePtr = &ttyChannelType; TtyInit(fd); snprintf(channelName, sizeof(channelName), "serial%d", fd); } else #endif /* SUPPORTS_TTY */ { translation = NULL; channelTypePtr = &fileChannelType; snprintf(channelName, sizeof(channelName), "file%d", fd); } fsPtr = (TtyState *)Tcl_Alloc(sizeof(TtyState)); fsPtr->fileState.validMask = channelPermissions | TCL_EXCEPTION; fsPtr->fileState.fd = fd; #ifdef SUPPORTS_TTY if (channelTypePtr == &ttyChannelType) { fsPtr->closeMode = CLOSE_DEFAULT; fsPtr->doReset = 0; tcgetattr(fsPtr->fileState.fd, &fsPtr->initState); } #endif /* SUPPORTS_TTY */ fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName, fsPtr, channelPermissions); if (translation != NULL) { /* * Gotcha. Most modems need a "\r" at the end of the command sequence. * If you just send "at\n", the modem will not respond with "OK" * because it never got a "\r" to actually invoke the command. So, by * default, newlines are translated to "\r\n" on output to avoid "bug" * reports that the serial port isn't working. */ if (Tcl_SetChannelOption(interp, fsPtr->fileState.channel, "-translation", translation) != TCL_OK) { Tcl_CloseEx(NULL, fsPtr->fileState.channel, 0); return NULL; } } return fsPtr->fileState.channel; } /* *---------------------------------------------------------------------- * * Tcl_MakeFileChannel -- * * Makes a Tcl_Channel from an existing OS level file handle. * * Results: * The Tcl_Channel created around the preexisting OS level file handle. * * Side effects: * None. * *---------------------------------------------------------------------- */ Tcl_Channel Tcl_MakeFileChannel( void *handle, /* OS level handle. */ int mode) /* OR'ed combination of TCL_READABLE and * TCL_WRITABLE to indicate file mode. */ { TtyState *fsPtr; char channelName[16 + TCL_INTEGER_SPACE]; int fd = (int)PTR2INT(handle); const Tcl_ChannelType *channelTypePtr; Tcl_StatBuf buf; if (mode == 0) { return NULL; } #ifdef SUPPORTS_TTY if (isatty(fd)) { channelTypePtr = &ttyChannelType; snprintf(channelName, sizeof(channelName), "serial%d", fd); } else #endif /* SUPPORTS_TTY */ if (TclOSfstat(fd, &buf) == 0 && S_ISSOCK(buf.st_mode)) { struct sockaddr sockaddr; socklen_t sockaddrLen = sizeof(sockaddr); sockaddr.sa_family = AF_UNSPEC; if ((getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0) && (sockaddrLen > 0) && (sockaddr.sa_family == AF_INET || sockaddr.sa_family == AF_INET6)) { return (Tcl_Channel)TclpMakeTcpClientChannelMode(INT2PTR(fd), mode); } goto normalChannelAfterAll; } else { normalChannelAfterAll: channelTypePtr = &fileChannelType; snprintf(channelName, sizeof(channelName), "file%d", fd); } fsPtr = (TtyState *)Tcl_Alloc(sizeof(TtyState)); fsPtr->fileState.fd = fd; fsPtr->fileState.validMask = mode | TCL_EXCEPTION; fsPtr->fileState.channel = Tcl_CreateChannel(channelTypePtr, channelName, fsPtr, mode); #ifdef SUPPORTS_TTY if (channelTypePtr == &ttyChannelType) { fsPtr->closeMode = CLOSE_DEFAULT; fsPtr->doReset = 0; tcgetattr(fsPtr->fileState.fd, &fsPtr->initState); } #endif /* SUPPORTS_TTY */ return fsPtr->fileState.channel; } /* *---------------------------------------------------------------------- * * TclpGetDefaultStdChannel -- * * Creates channels for standard input, standard output or standard error * output if they do not already exist. * * Results: * Returns the specified default standard channel, or NULL. * * Side effects: * May cause the creation of a standard channel and the underlying file. * *---------------------------------------------------------------------- */ Tcl_Channel TclpGetDefaultStdChannel( int type) /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ { Tcl_Channel channel = NULL; int fd = 0; /* Initializations needed to prevent */ int mode = 0; /* compiler warning (used before set). */ const char *bufMode = NULL; /* * Some #def's to make the code a little clearer! */ #define ERROR_OFFSET ((Tcl_SeekOffset) -1) switch (type) { case TCL_STDIN: if ((TclOSseek(0, 0, SEEK_CUR) == ERROR_OFFSET) && (errno == EBADF)) { return NULL; } fd = 0; mode = TCL_READABLE; bufMode = "line"; break; case TCL_STDOUT: if ((TclOSseek(1, 0, SEEK_CUR) == ERROR_OFFSET) && (errno == EBADF)) { return NULL; } fd = 1; mode = TCL_WRITABLE; bufMode = "line"; break; case TCL_STDERR: if ((TclOSseek(2, 0, SEEK_CUR) == ERROR_OFFSET) && (errno == EBADF)) { return NULL; } fd = 2; mode = TCL_WRITABLE; bufMode = "none"; break; default: Tcl_Panic("TclGetDefaultStdChannel: Unexpected channel type"); break; } #undef ERROR_OFFSET channel = Tcl_MakeFileChannel(INT2PTR(fd), mode); if (channel == NULL) { return NULL; } /* * Set up the normal channel options for stdio handles. */ if (Tcl_GetChannelType(channel) == &fileChannelType) { Tcl_SetChannelOption(NULL, channel, "-translation", "auto"); } else { Tcl_SetChannelOption(NULL, channel, "-translation", "auto crlf"); } Tcl_SetChannelOption(NULL, channel, "-buffering", bufMode); return channel; } /* *---------------------------------------------------------------------- * * Tcl_GetOpenFile -- * * Given a name of a channel registered in the given interpreter, returns * a FILE * for it. * * Results: * A standard Tcl result. If the channel is registered in the given * interpreter and it is managed by the "file" channel driver, and it is * open for the requested mode, then the output parameter filePtr is set * to a FILE * for the underlying file. On error, the filePtr is not set, * TCL_ERROR is returned and an error message is left in the interp's * result. * * Side effects: * May invoke fdopen to create the FILE * for the requested file. * *---------------------------------------------------------------------- */ int Tcl_GetOpenFile( Tcl_Interp *interp, /* Interpreter in which to find file. */ const char *chanID, /* String that identifies file. */ int forWriting, /* 1 means the file is going to be used for * writing, 0 means for reading. */ TCL_UNUSED(int), /* Obsolete argument. * Ignored, we always check that * the channel is open for the requested * mode. */ void **filePtr) /* Store pointer to FILE structure here. */ { Tcl_Channel chan; int chanMode, fd; const Tcl_ChannelType *chanTypePtr; void *data; FILE *f; chan = Tcl_GetChannel(interp, chanID, &chanMode); if (chan == NULL) { return TCL_ERROR; } if (forWriting && !(chanMode & TCL_WRITABLE)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" wasn't opened for writing", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_WRITABLE", (char *)NULL); return TCL_ERROR; } else if (!forWriting && !(chanMode & TCL_READABLE)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" wasn't opened for reading", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NOT_READABLE", (char *)NULL); return TCL_ERROR; } /* * We allow creating a FILE * out of file based, pipe based and socket * based channels. We currently do not allow any other channel types, * because it is likely that stdio will not know what to do with them. */ chanTypePtr = Tcl_GetChannelType(chan); if ((chanTypePtr == &fileChannelType) #ifdef SUPPORTS_TTY || (chanTypePtr == &ttyChannelType) #endif /* SUPPORTS_TTY */ || (strcmp(chanTypePtr->typeName, "tcp") == 0) || (strcmp(chanTypePtr->typeName, "pipe") == 0)) { if (Tcl_GetChannelHandle(chan, (forWriting ? TCL_WRITABLE : TCL_READABLE), &data) == TCL_OK) { fd = (int)PTR2INT(data); /* * The call to fdopen below is probably dangerous, since it will * truncate an existing file if the file is being opened for * writing.... */ f = fdopen(fd, (forWriting ? "w" : "r")); if (f == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot get a FILE * for \"%s\"", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "FILE_FAILURE", (char *)NULL); return TCL_ERROR; } *filePtr = f; return TCL_OK; } } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" cannot be used to get a FILE *", chanID)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "CHANNEL", "NO_DESCRIPTOR", (char *)NULL); return TCL_ERROR; } /* *---------------------------------------------------------------------- * * FileTruncateProc -- * * Truncates a file to a given length. * * Results: * 0 if the operation succeeded, and -1 if it failed (in which case * *errorCodePtr will be set to errno). * * Side effects: * The underlying file is potentially truncated. This can have a wide * variety of side effects, including moving file pointers that point at * places later in the file than the truncate point. * *---------------------------------------------------------------------- */ static int FileTruncateProc( void *instanceData, long long length) { FileState *fsPtr = (FileState *)instanceData; int result; #ifdef HAVE_TYPE_OFF64_T /* * We assume this goes with the type for now... */ result = ftruncate64(fsPtr->fd, (off64_t) length); #else result = ftruncate(fsPtr->fd, (off_t) length); #endif if (result) { return errno; } return 0; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclSelectNotfy.c0000644000175000017500000010023015104661341015634 0ustar sergeisergei/* * tclSelectNotfy.c -- * * This file contains the implementation of the select()-based generic * Unix notifier, which is the lowest-level part of the Tcl event loop. * This file works together with generic/tclNotify.c. * * Copyright © 1995-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. */ #include "tclInt.h" #ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is * in tclMacOSXNotify.c */ #if (!defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE)) || !TCL_THREADS #include /* * This structure is used to keep track of the notifier info for a registered * file. */ typedef struct FileHandler { int fd; int mask; /* Mask of desired events: TCL_READABLE, * etc. */ int readyMask; /* Mask of events that have been seen since * the last time file handlers were invoked * for this file. */ Tcl_FileProc *proc; /* Function to call, in the style of * Tcl_CreateFileHandler. */ void *clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ } FileHandler; /* * The following structure contains a set of select() masks to track readable, * writable, and exception conditions. */ typedef struct { fd_set readable; fd_set writable; fd_set exception; } SelectMasks; /* * The following structure is what is added to the Tcl event queue when file * handlers are ready to fire. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find * the FileHandler structure for the file * (can't point directly to the FileHandler * structure because it could go away while * the event is queued). */ } FileHandlerEvent; /* * The following static structure contains the state information for the * select based implementation of the Tcl notifier. One of these structures is * created for each thread that is using the notifier. */ typedef struct ThreadSpecificData { FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ SelectMasks checkMasks; /* This structure is used to build up the * masks to be used in the next call to * select. Bits are set in response to calls * to Tcl_CreateFileHandler. */ SelectMasks readyMasks; /* This array reflects the readable/writable * conditions that were found to exist by the * last call to select. */ int numFdBits; /* Number of valid bits in checkMasks (one * more than highest fd for which * Tcl_WatchFile has been called). */ #if TCL_THREADS int onList; /* True if it is in this list */ unsigned int pollState; /* pollState is used to implement a polling * handshake between each thread and the * notifier thread. Bits defined below. */ struct ThreadSpecificData *nextPtr, *prevPtr; /* All threads that are currently waiting on * an event have their ThreadSpecificData * structure on a doubly-linked listed formed * from these pointers. You must hold the * notifierMutex lock before accessing these * fields. */ #ifdef __CYGWIN__ void *event; /* Any other thread alerts a notifier that an * event is ready to be processed by sending * this event. */ void *hwnd; /* Messaging window. */ #else /* !__CYGWIN__ */ pthread_cond_t waitCV; /* Any other thread alerts a notifier that an * event is ready to be processed by signaling * this condition variable. */ #endif /* __CYGWIN__ */ int waitCVinitialized; /* Variable to flag initialization of the * structure. */ int eventReady; /* True if an event is ready to be processed. * Used as condition flag together with waitCV * above. */ #endif /* TCL_THREADS */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; #if TCL_THREADS /* * The following static indicates the number of threads that have initialized * notifiers. * * You must hold the notifierMutex lock before accessing this variable. */ static int notifierCount = 0; /* * The following variable points to the head of a doubly-linked list of * ThreadSpecificData structures for all threads that are currently waiting on * an event. * * You must hold the notifierMutex lock before accessing this list. */ static ThreadSpecificData *waitingListPtr = NULL; /* * The notifier thread spends all its time in select() waiting for a file * descriptor associated with one of the threads on the waitingListPtr list to * do something interesting. But if the contents of the waitingListPtr list * ever changes, we need to wake up and restart the select() system call. You * can wake up the notifier thread by writing a single byte to the file * descriptor defined below. This file descriptor is the input-end of a pipe * and the notifier thread is listening for data on the output-end of the same * pipe. Hence writing to this file descriptor will cause the select() system * call to return and wake up the notifier thread. * * You must hold the notifierMutex lock before writing to the pipe. */ static int triggerPipe = -1; static int otherPipe = -1; /* * The notifierMutex locks access to all of the global notifier state. */ static pthread_mutex_t notifierInitMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t notifierMutex = PTHREAD_MUTEX_INITIALIZER; /* * The following static indicates if the notifier thread is running. * * You must hold the notifierInitMutex before accessing this variable. */ static int notifierThreadRunning = 0; /* * The following static flag indicates that async handlers are pending. */ static int asyncPending = 0; /* * The notifier thread signals the notifierCV when it has finished * initializing the triggerPipe and right before the notifier thread * terminates. This condition is used to deal with the signal mask, too. */ static pthread_cond_t notifierCV = PTHREAD_COND_INITIALIZER; /* * The pollState bits: * * POLL_WANT is set by each thread before it waits on its condition variable. * It is checked by the notifier before it does select. * * POLL_DONE is set by the notifier if it goes into select after seeing * POLL_WANT. The idea is to ensure it tries a select with the same bits * the initial thread had set. */ #define POLL_WANT 0x1 #define POLL_DONE 0x2 /* * This is the thread ID of the notifier thread that does select. */ static Tcl_ThreadId notifierThread; /* * Signal mask information for notifier thread. */ static sigset_t notifierSigMask; #ifndef HAVE_PSELECT static sigset_t allSigMask; #endif /* HAVE_PSELECT */ #endif /* TCL_THREADS */ /* * Static routines defined in this file. */ #if TCL_THREADS static TCL_NORETURN void NotifierThreadProc(void *clientData); #if defined(HAVE_PTHREAD_ATFORK) static int atForkInit = 0; static void AtForkChild(void); #endif /* HAVE_PTHREAD_ATFORK */ #endif /* TCL_THREADS */ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); /* * Import of critical bits of Windows API when building threaded with Cygwin. */ #if defined(__CYGWIN__) #ifdef __cplusplus extern "C" { #endif typedef struct { void *hwnd; /* Messaging window. */ unsigned int *message; /* Message payload. */ size_t wParam; /* Event-specific "word" parameter. */ size_t lParam; /* Event-specific "long" parameter. */ int time; /* Event timestamp. */ int x; /* Event location (where meaningful). */ int y; int lPrivate; } MSG; typedef struct { unsigned int style; void *lpfnWndProc; int cbClsExtra; int cbWndExtra; void *hInstance; void *hIcon; void *hCursor; void *hbrBackground; const void *lpszMenuName; const void *lpszClassName; } WNDCLASSW; extern void CloseHandle(void *); extern void *CreateEventW(void *, unsigned char, unsigned char, void *); extern void *CreateWindowExW(void *, const void *, const void *, unsigned int, int, int, int, int, void *, void *, void *, void *); extern unsigned int DefWindowProcW(void *, int, void *, void *); extern unsigned char DestroyWindow(void *); extern int DispatchMessageW(const MSG *); extern unsigned char GetMessageW(MSG *, void *, int, int); extern void MsgWaitForMultipleObjects(unsigned int, void *, unsigned char, unsigned int, unsigned int); extern unsigned char PeekMessageW(MSG *, void *, int, int, int); extern unsigned char PostMessageW(void *, unsigned int, void *, void *); extern void PostQuitMessage(int); extern void *RegisterClassW(const WNDCLASSW *); extern unsigned char ResetEvent(void *); extern unsigned char TranslateMessage(const MSG *); /* * Threaded-cygwin specific constants and functions in this file: */ #if TCL_THREADS && defined(__CYGWIN__) static const WCHAR className[] = L"TclNotifier"; static unsigned int NotifierProc(void *hwnd, unsigned int message, void *wParam, void *lParam); #endif /* TCL_THREADS && defined(__CYGWIN__) */ #ifdef __cplusplus } #endif #endif /* TCL_THREADS && __CYGWIN__ */ /* * Incorporate the base notifier implementation. */ #include "tclUnixNotfy.c" /* *---------------------------------------------------------------------- * * TclpInitNotifier -- * * Initializes the platform specific notifier state. * * Results: * Returns a handle to the notifier state for this thread. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpInitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if TCL_THREADS tsdPtr->eventReady = 0; /* * Initialize thread specific condition variable for this thread. */ if (tsdPtr->waitCVinitialized == 0) { #ifdef __CYGWIN__ WNDCLASSW clazz; clazz.style = 0; clazz.cbClsExtra = 0; clazz.cbWndExtra = 0; clazz.hInstance = TclWinGetTclInstance(); clazz.hbrBackground = NULL; clazz.lpszMenuName = NULL; clazz.lpszClassName = className; clazz.lpfnWndProc = (void *)NotifierProc; clazz.hIcon = NULL; clazz.hCursor = NULL; RegisterClassW(&clazz); tsdPtr->hwnd = CreateWindowExW(NULL, clazz.lpszClassName, clazz.lpszClassName, 0, 0, 0, 0, 0, NULL, NULL, clazz.hInstance, NULL); tsdPtr->event = CreateEventW(NULL, 1 /* manual */, 0 /* !signaled */, NULL); #else /* !__CYGWIN__ */ pthread_cond_init(&tsdPtr->waitCV, NULL); #endif /* __CYGWIN__ */ tsdPtr->waitCVinitialized = 1; } pthread_mutex_lock(¬ifierInitMutex); #if defined(HAVE_PTHREAD_ATFORK) /* * Install pthread_atfork handlers to clean up the notifier in the child * of a fork. */ if (!atForkInit) { int result = pthread_atfork(NULL, NULL, AtForkChild); if (result) { Tcl_Panic("Tcl_InitNotifier: %s", "pthread_atfork failed"); } atForkInit = 1; } #endif /* HAVE_PTHREAD_ATFORK */ notifierCount++; pthread_mutex_unlock(¬ifierInitMutex); #endif /* TCL_THREADS */ return tsdPtr; } /* *---------------------------------------------------------------------- * * TclpFinalizeNotifier -- * * This function is called to cleanup the notifier state before a thread * is terminated. * * Results: * None. * * Side effects: * May terminate the background notifier thread if this is the last * notifier instance. * *---------------------------------------------------------------------- */ void TclpFinalizeNotifier( TCL_UNUSED(void *)) { #if TCL_THREADS ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); pthread_mutex_lock(¬ifierInitMutex); notifierCount--; /* * If this is the last thread to use the notifier, close the notifier pipe * and wait for the background thread to terminate. */ if (notifierCount == 0 && triggerPipe != -1) { if (write(triggerPipe, "q", 1) != 1) { Tcl_Panic("Tcl_FinalizeNotifier: %s", "unable to write 'q' to triggerPipe"); } close(triggerPipe); pthread_mutex_lock(¬ifierMutex); while(triggerPipe != -1) { pthread_cond_wait(¬ifierCV, ¬ifierMutex); } pthread_mutex_unlock(¬ifierMutex); if (notifierThreadRunning) { int result = pthread_join((pthread_t) notifierThread, NULL); if (result) { Tcl_Panic("Tcl_FinalizeNotifier: %s", "unable to join notifier thread"); } notifierThreadRunning = 0; /* * If async marks are outstanding, perform actions now. */ if (asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } } } /* * Clean up any synchronization objects in the thread local storage. */ #ifdef __CYGWIN__ DestroyWindow(tsdPtr->hwnd); CloseHandle(tsdPtr->event); #else /* !__CYGWIN__ */ pthread_cond_destroy(&tsdPtr->waitCV); #endif /* __CYGWIN__ */ tsdPtr->waitCVinitialized = 0; pthread_mutex_unlock(¬ifierInitMutex); #endif /* TCL_THREADS */ } /* *---------------------------------------------------------------------- * * TclpCreateFileHandler -- * * This function registers a file handler with the select notifier. * * Results: * None. * * Side effects: * Creates a new file handler structure. * *---------------------------------------------------------------------- */ void TclpCreateFileHandler( int fd, /* Handle of stream to watch. */ int mask, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION: indicates * conditions under which proc should be * called. */ Tcl_FileProc *proc, /* Function to call for each selected * event. */ void *clientData) /* Arbitrary data to pass to proc. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL); if (filePtr == NULL) { filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->readyMask = 0; filePtr->nextPtr = tsdPtr->firstFileHandlerPtr; tsdPtr->firstFileHandlerPtr = filePtr; } filePtr->proc = proc; filePtr->clientData = clientData; filePtr->mask = mask; /* * Update the check masks for this file. */ if (mask & TCL_READABLE) { FD_SET(fd, &tsdPtr->checkMasks.readable); } else { FD_CLR(fd, &tsdPtr->checkMasks.readable); } if (mask & TCL_WRITABLE) { FD_SET(fd, &tsdPtr->checkMasks.writable); } else { FD_CLR(fd, &tsdPtr->checkMasks.writable); } if (mask & TCL_EXCEPTION) { FD_SET(fd, &tsdPtr->checkMasks.exception); } else { FD_CLR(fd, &tsdPtr->checkMasks.exception); } if (tsdPtr->numFdBits <= fd) { tsdPtr->numFdBits = fd + 1; } } /* *---------------------------------------------------------------------- * * TclpDeleteFileHandler -- * * Cancel a previously-arranged callback arrangement for a file. * * Results: * None. * * Side effects: * If a callback was previously registered on file, remove it. * *---------------------------------------------------------------------- */ void TclpDeleteFileHandler( int fd) /* Stream id for which to remove callback * function. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr, *prevPtr; int i; /* * Find the entry for the given file (and return if there isn't one). */ filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr); if (filePtr == NULL) { return; } /* * Update the check masks for this file. */ if (filePtr->mask & TCL_READABLE) { FD_CLR(fd, &tsdPtr->checkMasks.readable); } if (filePtr->mask & TCL_WRITABLE) { FD_CLR(fd, &tsdPtr->checkMasks.writable); } if (filePtr->mask & TCL_EXCEPTION) { FD_CLR(fd, &tsdPtr->checkMasks.exception); } /* * Find current max fd. */ if (fd + 1 == tsdPtr->numFdBits) { int numFdBits = 0; for (i = fd - 1; i >= 0; i--) { if (FD_ISSET(i, &tsdPtr->checkMasks.readable) || FD_ISSET(i, &tsdPtr->checkMasks.writable) || FD_ISSET(i, &tsdPtr->checkMasks.exception)) { numFdBits = i + 1; break; } } tsdPtr->numFdBits = numFdBits; } /* * Clean up information in the callback record. */ if (prevPtr == NULL) { tsdPtr->firstFileHandlerPtr = filePtr->nextPtr; } else { prevPtr->nextPtr = filePtr->nextPtr; } Tcl_Free(filePtr); } #if TCL_THREADS && defined(__CYGWIN__) static unsigned int NotifierProc( void *hwnd, unsigned int message, void *wParam, void *lParam) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (message != 1024) { return DefWindowProcW(hwnd, message, wParam, lParam); } /* * Process all of the runnable events. */ tsdPtr->eventReady = 1; Tcl_ServiceAll(); return 0; } #endif /* TCL_THREADS && __CYGWIN__ */ /* *---------------------------------------------------------------------- * * TclpWaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then Tcl_WaitForEvent just * polls without blocking. * * Results: * Returns -1 if the select would block forever, otherwise returns 0. * * Side effects: * Queues file events that are detected by the select. * *---------------------------------------------------------------------- */ int TclpWaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { FileHandler *filePtr; int mask; Tcl_Time vTime; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #if TCL_THREADS int waitForFiles; # ifdef __CYGWIN__ MSG msg; # endif /* __CYGWIN__ */ #else /* !TCL_THREADS */ /* * Impl. notes: timeout & timeoutPtr are used if, and only if threads are * not enabled. They are the arguments for the regular select() used when * the core is not thread-enabled. */ struct timeval timeout, *timeoutPtr; int numFound; #endif /* TCL_THREADS */ /* * Set up the timeout structure. Note that if there are no events to check * for, we return with a negative result rather than blocking forever. */ if (timePtr != NULL) { /* * TIP #233 (Virtualized Time). Is virtual time in effect? And do we * actually have something to scale? If yes to both then we call the * handler to do this scaling. */ if (timePtr->sec != 0 || timePtr->usec != 0) { vTime = *timePtr; TclScaleTime(&vTime); timePtr = &vTime; } #if !TCL_THREADS timeout.tv_sec = timePtr->sec; timeout.tv_usec = timePtr->usec; timeoutPtr = &timeout; } else if (tsdPtr->numFdBits == 0) { /* * If there are no threads, no timeout, and no fds registered, then * there are no events possible and we must avoid deadlock. Note that * this is not entirely correct because there might be a signal that * could interrupt the select call, but we don't handle that case if * we aren't using threads. */ return -1; } else { timeoutPtr = NULL; #endif /* !TCL_THREADS */ } #if TCL_THREADS /* * Start notifier thread and place this thread on the list of interested * threads, signal the notifier thread, and wait for a response or a * timeout. */ StartNotifierThread("Tcl_WaitForEvent"); pthread_mutex_lock(¬ifierMutex); if (timePtr != NULL && timePtr->sec == 0 && (timePtr->usec == 0 #if defined(__APPLE__) && defined(__LP64__) /* * On 64-bit Darwin, pthread_cond_timedwait() appears to have a * bug that causes it to wait forever when passed an absolute time * which has already been exceeded by the system time; as a * workaround, when given a very brief timeout, just do a poll. * [Bug 1457797] */ || timePtr->usec < 10 #endif /* __APPLE__ && __LP64__ */ )) { /* * Cannot emulate a polling select with a polling condition variable. * Instead, pretend to wait for files and tell the notifier thread * what we are doing. The notifier thread makes sure it goes through * select with its select mask in the same state as ours currently is. * We block until that happens. */ waitForFiles = 1; tsdPtr->pollState = POLL_WANT; timePtr = NULL; } else { waitForFiles = (tsdPtr->numFdBits > 0); tsdPtr->pollState = 0; } if (waitForFiles) { /* * Add the ThreadSpecificData structure of this thread to the list of * ThreadSpecificData structures of all threads that are waiting on * file events. */ tsdPtr->nextPtr = waitingListPtr; if (waitingListPtr) { waitingListPtr->prevPtr = tsdPtr; } tsdPtr->prevPtr = 0; waitingListPtr = tsdPtr; tsdPtr->onList = 1; if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) { Tcl_Panic("Tcl_WaitForEvent: %s", "unable to write to triggerPipe"); } } FD_ZERO(&tsdPtr->readyMasks.readable); FD_ZERO(&tsdPtr->readyMasks.writable); FD_ZERO(&tsdPtr->readyMasks.exception); if (!tsdPtr->eventReady) { #ifdef __CYGWIN__ if (!PeekMessageW(&msg, NULL, 0, 0, 0)) { long long timeout; if (timePtr) { timeout = timePtr->sec * 1000 + timePtr->usec / 1000; if (timeout > UINT_MAX) { timeout = UINT_MAX; } } else { timeout = UINT_MAX; } pthread_mutex_unlock(¬ifierMutex); MsgWaitForMultipleObjects(1, &tsdPtr->event, 0, (unsigned int)timeout, 1279); pthread_mutex_lock(¬ifierMutex); } #else /* !__CYGWIN__ */ if (timePtr != NULL) { Tcl_Time now; struct timespec ptime; Tcl_GetTime(&now); ptime.tv_sec = timePtr->sec + now.sec + (timePtr->usec + now.usec) / 1000000; ptime.tv_nsec = 1000 * ((timePtr->usec + now.usec) % 1000000); pthread_cond_timedwait(&tsdPtr->waitCV, ¬ifierMutex, &ptime); } else { pthread_cond_wait(&tsdPtr->waitCV, ¬ifierMutex); } #endif /* __CYGWIN__ */ } tsdPtr->eventReady = 0; #ifdef __CYGWIN__ while (PeekMessageW(&msg, NULL, 0, 0, 0)) { /* * Retrieve and dispatch the message. */ unsigned int result = GetMessageW(&msg, NULL, 0, 0); if (result == 0) { PostQuitMessage((int)msg.wParam); /* What to do here? */ } else if (result != (unsigned int) -1) { TranslateMessage(&msg); DispatchMessageW(&msg); } } ResetEvent(tsdPtr->event); #endif /* __CYGWIN__ */ if (waitForFiles && tsdPtr->onList) { /* * Remove the ThreadSpecificData structure of this thread from the * waiting list. Alert the notifier thread to recompute its select * masks - skipping this caused a hang when trying to close a pipe * which the notifier thread was still doing a select on. */ if (tsdPtr->prevPtr) { tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr; } else { waitingListPtr = tsdPtr->nextPtr; } if (tsdPtr->nextPtr) { tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr; } tsdPtr->nextPtr = tsdPtr->prevPtr = NULL; tsdPtr->onList = 0; if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) { Tcl_Panic("Tcl_WaitForEvent: %s", "unable to write to triggerPipe"); } } #else /* !TCL_THREADS */ tsdPtr->readyMasks = tsdPtr->checkMasks; numFound = select(tsdPtr->numFdBits, &tsdPtr->readyMasks.readable, &tsdPtr->readyMasks.writable, &tsdPtr->readyMasks.exception, timeoutPtr); /* * Some systems don't clear the masks after an error, so we have to do it * here. */ if (numFound == -1) { FD_ZERO(&tsdPtr->readyMasks.readable); FD_ZERO(&tsdPtr->readyMasks.writable); FD_ZERO(&tsdPtr->readyMasks.exception); } #endif /* TCL_THREADS */ /* * Queue all detected file events before returning. */ for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL); filePtr = filePtr->nextPtr) { mask = 0; if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.readable)) { mask |= TCL_READABLE; } if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.writable)) { mask |= TCL_WRITABLE; } if (FD_ISSET(filePtr->fd, &tsdPtr->readyMasks.exception)) { mask |= TCL_EXCEPTION; } if (!mask) { continue; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); } filePtr->readyMask = mask; } #if TCL_THREADS pthread_mutex_unlock(¬ifierMutex); #endif /* TCL_THREADS */ return 0; } /* *---------------------------------------------------------------------- * * TclAsyncNotifier -- * * This procedure sets the async mark of an async handler to a * given value, if it is called from the notifier thread. * * Result: * True, when the handler will be marked, false otherwise. * * Side effetcs: * The trigger pipe is written when called from the notifier * thread. * *---------------------------------------------------------------------- */ int TclAsyncNotifier( int sigNumber, /* Signal number. */ TCL_UNUSED(Tcl_ThreadId), /* Target thread. */ TCL_UNUSED(void *), /* Notifier data. */ int *flagPtr, /* Flag to mark. */ int value) /* Value of mark. */ { #if TCL_THREADS /* * WARNING: * This code most likely runs in a signal handler. Thus, * only few async-signal-safe system calls are allowed, * e.g. pthread_self(), sem_post(), write(). */ if (pthread_equal(pthread_self(), (pthread_t) notifierThread)) { if (notifierThreadRunning) { *flagPtr = value; if (!asyncPending) { asyncPending = 1; if (write(triggerPipe, "S", 1) != 1) { asyncPending = 0; return 0; }; } return 1; } return 0; } /* * Re-send the signal to the notifier thread. */ pthread_kill((pthread_t) notifierThread, sigNumber); #else (void)sigNumber; (void)flagPtr; (void)value; #endif return 0; } /* *---------------------------------------------------------------------- * * NotifierThreadProc -- * * This routine is the initial (and only) function executed by the * special notifier thread. Its job is to wait for file descriptors to * become readable or writable or to have an exception condition and then * to notify other threads who are interested in this information by * signalling a condition variable. Other threads can signal this * notifier thread of a change in their interests by writing a single * byte to a special pipe that the notifier thread is monitoring. * * Result: * None. Once started, this routine normally never exits and usually dies * with the overall process, but it can be shut down if the Tcl library * is finalized. * * Side effects: * The trigger pipe used to signal the notifier thread is created when * the notifier thread first starts. * *---------------------------------------------------------------------- */ #if TCL_THREADS static TCL_NORETURN void NotifierThreadProc( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr; fd_set readableMask; fd_set writableMask; fd_set exceptionMask; int i, fds[2], receivePipe, ret; long found; struct timeval poll = {0, 0}, *timePtr; char buf[2]; int numFdBits = 0; if (pipe(fds) != 0) { Tcl_Panic("NotifierThreadProc: %s", "could not create trigger pipe"); } /* * Ticket [c6897e6e6a]. */ if (fds[0] >= FD_SETSIZE || fds[1] >= FD_SETSIZE) { Tcl_Panic("NotifierThreadProc: %s", "too many open files"); } receivePipe = fds[0]; if (TclUnixSetBlockingMode(receivePipe, TCL_MODE_NONBLOCKING) < 0) { Tcl_Panic("NotifierThreadProc: %s", "could not make receive pipe non blocking"); } if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) { Tcl_Panic("NotifierThreadProc: %s", "could not make trigger pipe non blocking"); } if (fcntl(receivePipe, F_SETFD, FD_CLOEXEC) < 0) { Tcl_Panic("NotifierThreadProc: %s", "could not make receive pipe close-on-exec"); } if (fcntl(fds[1], F_SETFD, FD_CLOEXEC) < 0) { Tcl_Panic("NotifierThreadProc: %s", "could not make trigger pipe close-on-exec"); } /* * Install the write end of the pipe into the global variable. */ pthread_mutex_lock(¬ifierMutex); triggerPipe = fds[1]; otherPipe = fds[0]; /* * Signal any threads that are waiting. */ pthread_cond_broadcast(¬ifierCV); pthread_mutex_unlock(¬ifierMutex); /* * Look for file events and report them to interested threads. */ while (1) { FD_ZERO(&readableMask); FD_ZERO(&writableMask); FD_ZERO(&exceptionMask); /* * Compute the logical OR of the masks from all the waiting * notifiers. */ pthread_mutex_lock(¬ifierMutex); timePtr = NULL; for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { for (i = tsdPtr->numFdBits-1; i >= 0; --i) { if (FD_ISSET(i, &tsdPtr->checkMasks.readable)) { FD_SET(i, &readableMask); } if (FD_ISSET(i, &tsdPtr->checkMasks.writable)) { FD_SET(i, &writableMask); } if (FD_ISSET(i, &tsdPtr->checkMasks.exception)) { FD_SET(i, &exceptionMask); } } if (tsdPtr->numFdBits > numFdBits) { numFdBits = tsdPtr->numFdBits; } if (tsdPtr->pollState & POLL_WANT) { /* * Here we make sure we go through select() with the same mask * bits that were present when the thread tried to poll. */ tsdPtr->pollState |= POLL_DONE; timePtr = &poll; } } pthread_mutex_unlock(¬ifierMutex); /* * Set up the mask to include the receive pipe. */ if (receivePipe >= numFdBits) { numFdBits = receivePipe + 1; } FD_SET(receivePipe, &readableMask); /* * Signals are unblocked only during select(). */ #ifdef HAVE_PSELECT { struct timespec tspec, *tspecPtr; if (timePtr == NULL) { tspecPtr = NULL; } else { tspecPtr = &tspec; tspecPtr->tv_sec = timePtr->tv_sec; tspecPtr->tv_nsec = timePtr->tv_usec * 1000; } ret = pselect(numFdBits, &readableMask, &writableMask, &exceptionMask, tspecPtr, ¬ifierSigMask); } #else pthread_sigmask(SIG_SETMASK, ¬ifierSigMask, NULL); ret = select(numFdBits, &readableMask, &writableMask, &exceptionMask, timePtr); pthread_sigmask(SIG_BLOCK, &allSigMask, NULL); #endif if (ret == -1) { /* * In case a signal was caught during select(), * perform work on async handlers now. */ if (errno == EINTR && asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } /* * Try again immediately on select() error. */ continue; } /* * Alert any threads that are waiting on a ready file descriptor. */ pthread_mutex_lock(¬ifierMutex); for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { found = 0; for (i = tsdPtr->numFdBits - 1; i >= 0; --i) { if (FD_ISSET(i, &tsdPtr->checkMasks.readable) && FD_ISSET(i, &readableMask)) { FD_SET(i, &tsdPtr->readyMasks.readable); found = 1; } if (FD_ISSET(i, &tsdPtr->checkMasks.writable) && FD_ISSET(i, &writableMask)) { FD_SET(i, &tsdPtr->readyMasks.writable); found = 1; } if (FD_ISSET(i, &tsdPtr->checkMasks.exception) && FD_ISSET(i, &exceptionMask)) { FD_SET(i, &tsdPtr->readyMasks.exception); found = 1; } } if (found || (tsdPtr->pollState & POLL_DONE)) { AlertSingleThread(tsdPtr); } } pthread_mutex_unlock(¬ifierMutex); /* * Consume the next byte from the notifier pipe if the pipe was * readable. Note that there may be multiple bytes pending, but to * avoid a race condition we only read one at a time. */ do { i = (int)read(receivePipe, buf, 1); if (i <= 0) { break; } else if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) { /* * Someone closed the write end of the pipe or sent us a Quit * message [Bug: 4139] and then closed the write end of the * pipe so we need to shut down the notifier thread. */ break; } } while (1); if (asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } if ((i == 0) || (buf[0] == 'q')) { break; } } /* * Clean up the read end of the pipe and signal any threads waiting on * termination of the notifier thread. */ close(receivePipe); pthread_mutex_lock(¬ifierMutex); triggerPipe = -1; otherPipe = -1; pthread_cond_broadcast(¬ifierCV); pthread_mutex_unlock(¬ifierMutex); TclpThreadExit(0); } #endif /* TCL_THREADS */ #endif /* (!NOTIFIER_EPOLL && !NOTIFIER_KQUEUE) || !TCL_THREADS */ #else TCL_MAC_EMPTY_FILE(unix_tclSelectNotfy_c) #endif /* !HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclooConfig.sh0000644000175000017500000000140315104661341015332 0ustar sergeisergei# tclooConfig.sh -- # # This shell script (for sh) is generated automatically by TclOO's configure # script, or would be except it has no values that we substitute. It will # create shell variables for most of the configuration options discovered by # the configure script. This script is intended to be included by TEA-based # configure scripts for TclOO extensions so that they don't have to figure # this all out for themselves. # # The information in this file is specific to a single platform. # These are mostly empty because no special steps are ever needed from Tcl 8.6 # onwards; all libraries and include files are just part of Tcl. TCLOO_LIB_SPEC="" TCLOO_STUB_LIB_SPEC="" TCLOO_INCLUDE_SPEC="" TCLOO_PRIVATE_INCLUDE_SPEC="" TCLOO_CFLAGS="" TCLOO_VERSION=1.3 tcl9.0.3/unix/tclLoadShl.c0000644000175000017500000001275115104661341014735 0ustar sergeisergei/* * tclLoadShl.c -- * * This procedure provides a version of the TclLoadFile that works with * the "shl_load" and "shl_findsym" library procedures for dynamic * loading (e.g. for HP machines). * * Copyright © 1995-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. */ #include #include "tclInt.h" /* * Static functions defined within this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static void UnloadFile(Tcl_LoadHandle handle); /* *---------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interp's result. * * Side effects: * New code suddenly appears in memory. * *--------------------------------------------------------------------------- */ int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { shl_t handle; Tcl_LoadHandle newHandle; const char *native; char *fileName = TclGetString(pathPtr); /* * The flags below used to be BIND_IMMEDIATE; they were changed at the * suggestion of Wolfgang Kechel (wolfgang@prs.de): "This enables * verbosity for missing symbols when loading a shared lib and allows to * load libtk9.0.sl into tclsh9.0 without problems. In general, this * delays resolving symbols until they are actually needed. Shared libs * do no longer need all libraries linked in when they are build." */ /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ native = Tcl_FSGetNativePath(pathPtr); handle = shl_load(native, BIND_DEFERRED|BIND_VERBOSE, 0L); if (handle == NULL) { /* * Let the OS loader examine the binary search path for whatever * string the user gave us which hopefully refers to a file on the * binary path. */ Tcl_DString ds; if (Tcl_UtfToExternalDStringEx(interp, NULL, fileName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); handle = shl_load(native, BIND_DEFERRED|BIND_VERBOSE|DYNAMIC_PATH, 0L); Tcl_DStringFree(&ds); } if (handle == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't load file \"%s\": %s", fileName, Tcl_PosixError(interp))); return TCL_ERROR; } newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = handle; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; return TCL_OK; } /* *---------------------------------------------------------------------- * * Tcl_FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void* FindSymbol( Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol) { Tcl_DString newName; Tcl_LibraryInitProc *proc = NULL; shl_t handle = (shl_t) loadHandle->clientData; /* * Some versions of the HP system software still use "_" at the beginning * of exported symbols while others don't; try both forms of each name. */ if (shl_findsym(&handle, symbol, (short) TYPE_PROCEDURE, (void *)&proc) != 0) { Tcl_DStringInit(&newName); TclDStringAppendLiteral(&newName, "_"); Tcl_DStringAppend(&newName, symbol, TCL_INDEX_NONE); if (shl_findsym(&handle, Tcl_DStringValue(&newName), (short) TYPE_PROCEDURE, (void *)&proc) != 0) { proc = NULL; } Tcl_DStringFree(&newName); } if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\": %s", symbol, Tcl_PosixError(interp))); } return proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamically loaded binary code file from memory. Code * pointers in the formerly loaded file are no longer valid after calling * this function. * * Results: * None. * * Side effects: * Code removed from memory. * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { shl_t handle = (shl_t) loadHandle->clientData; shl_unload(handle); Tcl_Free(loadHandle); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclLoadOSF.c0000644000175000017500000001314515104661341014634 0ustar sergeisergei/* * tclLoadOSF.c -- * * This function provides a version of the TclLoadFile that works under * OSF/1 1.0/1.1/1.2 and related systems, utilizing the old OSF/1 * /sbin/loader and /usr/include/loader.h. OSF/1 versions from 1.3 and on * use ELF, rtld, and dlopen()[/usr/include/ldfcn.h]. * * This is useful for: * OSF/1 1.0, 1.1, 1.2 (from OSF) * includes: MK4 and AD1 (from OSF RI) * OSF/1 1.3 (from OSF) using ROSE * HP OSF/1 1.0 ("Acorn") using COFF * * This is likely to be useful for: * Paragon OSF/1 (from Intel) * HI-OSF/1 (from Hitachi) * * This is NOT to be used on: * Digitial Alpha OSF/1 systems * OSF/1 1.3 or later (from OSF) using ELF * includes: MK6, MK7, AD2, AD3 (from OSF RI) * * This approach to things was utter @&^#; thankfully, OSF/1 eventually * supported dlopen(). * * John Robert LoVerso * * Copyright © 1995-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. */ #include "tclInt.h" #include #include /* * Static procedures defined within this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static void UnloadFile(Tcl_LoadHandle loadHandle); /* *--------------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interp's result. * * Side effects: * New code suddenly appears in memory. * *--------------------------------------------------------------------------- */ int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { Tcl_LoadHandle newHandle; ldr_module_t lm; char *pkg; char *fileName = TclGetString(pathPtr); const char *native; /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ native = Tcl_FSGetNativePath(pathPtr); lm = (Tcl_LibraryInitProc *) load(native, LDR_NOFLAGS); if (lm == LDR_NULL_MODULE) { /* * Let the OS loader examine the binary search path for whatever * string the user gave us which hopefully refers to a file on the * binary path */ Tcl_DString ds; if (Tcl_UtfToExternalDStringEx(interp, NULL, fileName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); lm = (Tcl_LibraryInitProc *) load(native, LDR_NOFLAGS); Tcl_DStringFree(&ds); } if (lm == LDR_NULL_MODULE) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't load file \"%s\": %s", fileName, Tcl_PosixError(interp))); return TCL_ERROR; } *clientDataPtr = NULL; /* * My convention is to use a [OSF loader] package name the same as shlib, * since the idiots never implemented ldr_lookup() and it is otherwise * impossible to get a package name given a module. * * I build loadable modules with a makefile rule like * ld ... -export $@: -o $@ $(OBJS) */ if ((pkg = strrchr(fileName, '/')) == NULL) { pkg = fileName; } else { pkg++; } newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = pkg; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; return TCL_OK; } /* *---------------------------------------------------------------------- * * FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void * FindSymbol( Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol) { void *proc = ldr_lookup_package((char *) loadHandle, symbol); if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (char *)NULL); } return proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamically loaded binary code file from memory. Code * pointers in the formerly loaded file are no longer valid after calling * this function. * * Results: * None. * * Side effects: * Does nothing. Can anything be done? * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { Tcl_Free(loadHandle); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclLoadNext.c0000644000175000017500000001162515104661341015124 0ustar sergeisergei/* * tclLoadNext.c -- * * This procedure provides a version of the TclLoadFile that works with * NeXTs rld_* dynamic loading. This file provided by Pedja Bogdanovich. * * Copyright © 1995-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. */ #include "tclInt.h" #include #include /* * Static procedures defined within this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static void UnloadFile(Tcl_LoadHandle loadHandle); /* *--------------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interp's result. * * Side effects: * New code suddenly appears in memory. * *--------------------------------------------------------------------------- */ int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { Tcl_LoadHandle newHandle; struct mach_header *header; char *fileName; char *files[2]; const char *native; int result = 1; NXStream *errorStream = NXOpenMemory(0,0,NX_READWRITE); fileName = TclGetString(pathPtr); /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ native = Tcl_FSGetNativePath(pathPtr); files = {native,NULL}; result = rld_load(errorStream, &header, files, NULL); if (!result) { /* * Let the OS loader examine the binary search path for whatever * string the user gave us which hopefully refers to a file on the * binary path. */ Tcl_DString ds; if (Tcl_UtfToExternalDStringEx(interp, NULL, fileName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); files = {native,NULL}; result = rld_load(errorStream, &header, files, NULL); Tcl_DStringFree(&ds); } if (!result) { char *data; int len, maxlen; NXGetMemoryBuffer(errorStream, &data, &len, &maxlen); Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't load file \"%s\": %s", fileName, data)); NXCloseMemory(errorStream, NX_FREEBUFFER); return TCL_ERROR; } NXCloseMemory(errorStream, NX_FREEBUFFER); newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = INT2PTR(1); newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; return TCL_OK; } /* *---------------------------------------------------------------------- * * FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void * FindSymbol( Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol) { Tcl_LibraryInitProc *proc = NULL; if (symbol) { char sym[strlen(symbol) + 2]; sym[0] = '_'; sym[1] = 0; strcat(sym, symbol); rld_lookup(NULL, sym, (unsigned long *) &proc); } if (proc == NULL && interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\"", symbol)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (char *)NULL); } return proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamically loaded binary code file from memory. Code * pointers in the formerly loaded file are no longer valid after calling * this function. * * Results: * None. * * Side effects: * Does nothing. Can anything be done? * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { Tcl_Free(loadHandle); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclLoadDyld.c0000644000175000017500000003560715104661341015110 0ustar sergeisergei/* * tclLoadDyld.c -- * * This procedure provides a version of the TclLoadFile that works with * Apple's dyld dynamic loading. * Original version of his file (superseded long ago) provided by * Wilfredo Sanchez (wsanchez@apple.com). * * Copyright © 1995 Apple Computer, Inc. * Copyright © 2001-2007 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #ifndef MODULE_SCOPE # define MODULE_SCOPE extern #endif /* * Use includes for the API we're using. */ #include #if defined(TCL_LOAD_FROM_MEMORY) #if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif #include #include #include #include #include #include typedef struct Tcl_DyldModuleHandle { struct Tcl_DyldModuleHandle *nextPtr; NSModule module; } Tcl_DyldModuleHandle; #endif /* TCL_LOAD_FROM_MEMORY */ typedef struct { void *dlHandle; #if defined(TCL_LOAD_FROM_MEMORY) const struct mach_header *dyldLibHeader; Tcl_DyldModuleHandle *modulePtr; #endif } Tcl_DyldLoadHandle; /* * Static functions defined in this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static void UnloadFile(Tcl_LoadHandle handle); /* *---------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interpreter's result. * * Side effects: * New code suddenly appears in memory. * *---------------------------------------------------------------------- */ MODULE_SCOPE int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { Tcl_DyldLoadHandle *dyldLoadHandle; Tcl_LoadHandle newHandle; void *dlHandle = NULL; #if defined(TCL_LOAD_FROM_MEMORY) const struct mach_header *dyldLibHeader = NULL; Tcl_DyldModuleHandle *modulePtr = NULL; #endif const char *errMsg = NULL; int result; Tcl_DString ds; const char *nativePath, *nativeFileName = NULL; int dlopenflags = 0; /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ nativePath = (const char *)Tcl_FSGetNativePath(pathPtr); if (Tcl_UtfToExternalDStringEx(interp, NULL, TclGetString(pathPtr), TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } nativeFileName = Tcl_DStringValue(&ds); /* * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070] */ if (flags & TCL_LOAD_GLOBAL) { dlopenflags |= RTLD_GLOBAL; } else { dlopenflags |= RTLD_LOCAL; } if (flags & TCL_LOAD_LAZY) { dlopenflags |= RTLD_LAZY; } else { dlopenflags |= RTLD_NOW; } dlHandle = dlopen(nativePath, dlopenflags); if (!dlHandle) { /* * Let the OS loader examine the binary search path for whatever string * the user gave us which hopefully refers to a file on the binary * path. */ dlHandle = dlopen(nativeFileName, dlopenflags); if (!dlHandle) { errMsg = dlerror(); } } if (dlHandle) { dyldLoadHandle = (Tcl_DyldLoadHandle *)Tcl_Alloc(sizeof(Tcl_DyldLoadHandle)); dyldLoadHandle->dlHandle = dlHandle; #if defined(TCL_LOAD_FROM_MEMORY) dyldLoadHandle->dyldLibHeader = dyldLibHeader; dyldLoadHandle->modulePtr = modulePtr; #endif /* TCL_LOAD_FROM_MEMORY */ newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = dyldLoadHandle; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; result = TCL_OK; } else { Tcl_Obj *errObj; TclNewObj(errObj); if (errMsg != NULL) { Tcl_AppendToObj(errObj, errMsg, TCL_INDEX_NONE); } Tcl_SetObjResult(interp, errObj); result = TCL_ERROR; } Tcl_DStringFree(&ds); return result; } /* *---------------------------------------------------------------------- * * FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void * FindSymbol( Tcl_Interp *interp, /* For error reporting. */ Tcl_LoadHandle loadHandle, /* Handle from TclpDlopen. */ const char *symbol) /* Symbol name to look up. */ { Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData; Tcl_LibraryInitProc *proc = NULL; const char *errMsg = NULL; Tcl_DString ds; const char *native; if (Tcl_UtfToExternalDStringEx(interp, NULL, symbol, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } native = Tcl_DStringValue(&ds); if (dyldLoadHandle->dlHandle) { proc = (Tcl_LibraryInitProc *)dlsym(dyldLoadHandle->dlHandle, native); if (!proc) { errMsg = dlerror(); } } else { #if defined(TCL_LOAD_FROM_MEMORY) NSSymbol nsSymbol = NULL; Tcl_DString newName; /* * dyld adds an underscore to the beginning of symbol names. */ Tcl_DStringInit(&newName); TclDStringAppendLiteral(&newName, "_"); native = Tcl_DStringAppend(&newName, native, TCL_INDEX_NONE); if (dyldLoadHandle->dyldLibHeader) { nsSymbol = NSLookupSymbolInImage(dyldLoadHandle->dyldLibHeader, native, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); if (nsSymbol) { /* * Until dyld supports unloading of MY_DYLIB binaries, the * following is not needed. */ #ifdef DYLD_SUPPORTS_DYLIB_UNLOADING NSModule module = NSModuleForSymbol(nsSymbol); Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr; while (modulePtr != NULL) { if (module == modulePtr->module) { break; } modulePtr = modulePtr->nextPtr; } if (modulePtr == NULL) { modulePtr = (Tcl_DyldModuleHandle *)Tcl_Alloc(sizeof(Tcl_DyldModuleHandle)); modulePtr->module = module; modulePtr->nextPtr = dyldLoadHandle->modulePtr; dyldLoadHandle->modulePtr = modulePtr; } #endif /* DYLD_SUPPORTS_DYLIB_UNLOADING */ } else { NSLinkEditErrors editError; int errorNumber; const char *errorName; NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg); } } else if (dyldLoadHandle->modulePtr) { nsSymbol = NSLookupSymbolInModule( dyldLoadHandle->modulePtr->module, native); } if (nsSymbol) { proc = (Tcl_LibraryInitProc *)NSAddressOfSymbol(nsSymbol); } Tcl_DStringFree(&newName); #endif /* TCL_LOAD_FROM_MEMORY */ } Tcl_DStringFree(&ds); if (errMsg && (interp != NULL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\": %s", symbol, errMsg)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (char *)NULL); } return (void *)proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamically loaded binary code file from memory. Code * pointers in the formerly loaded file are no longer valid after calling * this function. * * Results: * None. * * Side effects: * Code dissapears from memory. Note that dyld currently only supports * unloading of binaries of type MH_BUNDLE loaded with NSLinkModule() in * TclpDlopen() above. * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *)loadHandle->clientData; if (dyldLoadHandle->dlHandle) { (void) dlclose(dyldLoadHandle->dlHandle); } else { #if defined(TCL_LOAD_FROM_MEMORY) Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr; while (modulePtr != NULL) { void *ptr = modulePtr; (void) NSUnLinkModule(modulePtr->module, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); modulePtr = modulePtr->nextPtr; Tcl_Free(ptr); } #endif /* TCL_LOAD_FROM_MEMORY */ } Tcl_Free(dyldLoadHandle); Tcl_Free(loadHandle); } /* *---------------------------------------------------------------------- * * TclpLoadMemoryGetBuffer -- * * Allocate a buffer that can be used with TclpLoadMemory() below. * * Results: * Pointer to allocated buffer or NULL if an error occurs. * * Side effects: * Buffer is allocated. * *---------------------------------------------------------------------- */ #ifdef TCL_LOAD_FROM_MEMORY MODULE_SCOPE void * TclpLoadMemoryGetBuffer( size_t size) /* Size of desired buffer. */ { void *buffer = NULL; /* * We must allocate the buffer using vm_allocate, because * NSCreateObjectFileImageFromMemory will dispose of it using * vm_deallocate. */ if (vm_allocate(mach_task_self(), (vm_address_t *) &buffer, size, 1)) { buffer = NULL; } return buffer; } #endif /* TCL_LOAD_FROM_MEMORY */ /* *---------------------------------------------------------------------- * * TclpLoadMemory -- * * Dynamically loads binary code file from memory and returns a handle to * the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interpreter's result. * * Side effects: * New code is loaded from memory. * *---------------------------------------------------------------------- */ #ifdef TCL_LOAD_FROM_MEMORY MODULE_SCOPE int TclpLoadMemory( void *buffer, /* Buffer containing the desired code * (allocated with TclpLoadMemoryGetBuffer). */ size_t size, /* Allocation size of buffer. */ Tcl_Size codeSize, /* Size of code data read into buffer or -1 if * an error occurred and the buffer should * just be freed. */ const char *path, Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { Tcl_LoadHandle newHandle; Tcl_DyldLoadHandle *dyldLoadHandle; NSObjectFileImage dyldObjFileImage = NULL; Tcl_DyldModuleHandle *modulePtr; NSModule module; int nsflags = NSLINKMODULE_OPTION_RETURN_ON_ERROR; /* * Try to create an object file image that we can load from. */ if (codeSize >= 0) { NSObjectFileImageReturnCode err = NSObjectFileImageSuccess; const struct fat_header *fh = (const struct fat_header *)buffer; uint32_t ms = 0; #ifndef __LP64__ const struct mach_header *mh = NULL; # define mh_size sizeof(struct mach_header) # define mh_magic MH_MAGIC # define arch_abi 0 #else const struct mach_header_64 *mh = NULL; # define mh_size sizeof(struct mach_header_64) # define mh_magic MH_MAGIC_64 # define arch_abi CPU_ARCH_ABI64 #endif /* __LP64__ */ if ((size_t)codeSize >= sizeof(struct fat_header) && fh->magic == OSSwapHostToBigInt32(FAT_MAGIC)) { uint32_t fh_nfat_arch = OSSwapBigToHostInt32(fh->nfat_arch); /* * Fat binary, try to find mach_header for our architecture */ if ((size_t)codeSize >= sizeof(struct fat_header) + fh_nfat_arch * sizeof(struct fat_arch)) { void *fatarchs = (char *)buffer + sizeof(struct fat_header); const NXArchInfo *arch = NXGetLocalArchInfo(); struct fat_arch *fa; if (fh->magic != FAT_MAGIC) { swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder); } fa = NXFindBestFatArch(arch->cputype | arch_abi, arch->cpusubtype, (struct fat_arch *)fatarchs, fh_nfat_arch); if (fa) { mh = (const struct mach_header_64 *)((char *) buffer + fa->offset); ms = fa->size; } else { err = NSObjectFileImageInappropriateFile; } if (fh->magic != FAT_MAGIC) { swap_fat_arch((struct fat_arch *)fatarchs, fh_nfat_arch, arch->byteorder); } } else { err = NSObjectFileImageInappropriateFile; } } else { /* * Thin binary */ mh = (const struct mach_header_64 *)buffer; ms = codeSize; } if (ms && !(ms >= mh_size && mh->magic == mh_magic && mh->filetype == MH_BUNDLE)) { err = NSObjectFileImageInappropriateFile; } if (err == NSObjectFileImageSuccess) { err = NSCreateObjectFileImageFromMemory(buffer, codeSize, &dyldObjFileImage); } } /* * If it went wrong (or we were asked to just deallocate), get rid of the * memory block. */ if (dyldObjFileImage == NULL) { vm_deallocate(mach_task_self(), (vm_address_t) buffer, size); return TCL_ERROR; } /* * Extract the module we want from the image of the object file. */ if (!(flags & 1)) { nsflags |= NSLINKMODULE_OPTION_PRIVATE; } if (!(flags & 2)) { nsflags |= NSLINKMODULE_OPTION_BINDNOW; } module = NSLinkModule(dyldObjFileImage, (path ? path : "[Memory Based Bundle]"), nsflags); NSDestroyObjectFileImage(dyldObjFileImage); if (!module) { NSLinkEditErrors editError; int errorNumber; const char *errorName, *errMsg; NSLinkEditError(&editError, &errorNumber, &errorName, &errMsg); return TCL_ERROR; } /* * Stash the module reference within the load handle we create and return. */ modulePtr = (Tcl_DyldModuleHandle *)Tcl_Alloc(sizeof(Tcl_DyldModuleHandle)); modulePtr->module = module; modulePtr->nextPtr = NULL; dyldLoadHandle = (Tcl_DyldLoadHandle *)Tcl_Alloc(sizeof(Tcl_DyldLoadHandle)); dyldLoadHandle->dlHandle = NULL; dyldLoadHandle->dyldLibHeader = NULL; dyldLoadHandle->modulePtr = modulePtr; newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = dyldLoadHandle; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; *loadHandle = newHandle; *unloadProcPtr = &UnloadFile; return TCL_OK; } #endif /* TCL_LOAD_FROM_MEMORY */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 79 * End: */ tcl9.0.3/unix/tclLoadDl.c0000644000175000017500000002001715104661341014540 0ustar sergeisergei/* * tclLoadDl.c -- * * This procedure provides a version of the TclLoadFile that works with * the "dlopen" and "dlsym" library procedures for dynamic loading. * * Copyright © 1995-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. */ #include "tclInt.h" #ifdef NO_DLFCN_H # include "../compat/dlfcn.h" #else # include #endif /* * In some systems, like SunOS 4.1.3, the RTLD_NOW flag isn't defined and this * argument to dlopen must always be 1. The RTLD_LOCAL flag doesn't exist on * some platforms; if it doesn't exist, set it to 0 so it has no effect. * See [Bug #3216070] */ #ifndef RTLD_NOW # define RTLD_NOW 1 #endif #ifndef RTLD_LOCAL # define RTLD_LOCAL 0 #endif /* * Static procedures defined within this file. */ static void * FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle loadHandle, const char *symbol); static void UnloadFile(Tcl_LoadHandle loadHandle); /* *--------------------------------------------------------------------------- * * TclpDlopen -- * * Dynamically loads a binary code file into memory and returns a handle * to the new code. * * Results: * A standard Tcl completion code. If an error occurs, an error message * is left in the interp's result. * * Side effects: * New code suddenly appears in memory. * *--------------------------------------------------------------------------- */ int TclpDlopen( Tcl_Interp *interp, /* Used for error reporting. */ Tcl_Obj *pathPtr, /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr, /* Filled with address of Tcl_FSUnloadFileProc * function which should be used for this * file. */ int flags) { void *handle; Tcl_LoadHandle newHandle; const char *native; int dlopenflags = 0; /* * First try the full path the user gave us. This is particularly * important if the cwd is inside a vfs, and we are trying to load using a * relative path. */ native = (const char *)Tcl_FSGetNativePath(pathPtr); /* * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070] */ if (flags & TCL_LOAD_GLOBAL) { dlopenflags |= RTLD_GLOBAL; } else { dlopenflags |= RTLD_LOCAL; } if (flags & TCL_LOAD_LAZY) { dlopenflags |= RTLD_LAZY; } else { dlopenflags |= RTLD_NOW; } handle = dlopen(native, dlopenflags); if (handle == NULL) { /* * Let the OS loader examine the binary search path for whatever * string the user gave us which hopefully refers to a file on the * binary path. */ Tcl_DString ds; const char *fileName = TclGetString(pathPtr); if (Tcl_UtfToExternalDStringEx(interp, NULL, fileName, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } native = Tcl_DStringValue(&ds); /* * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070] */ handle = dlopen(native, dlopenflags); Tcl_DStringFree(&ds); } if (handle == NULL) { /* * Write the string to a variable first to work around a compiler bug * in the Sun Forte 6 compiler. [Bug 1503729] */ const char *errorStr = dlerror(); if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't load file \"%s\": %s", TclGetString(pathPtr), errorStr)); } return TCL_ERROR; } newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = handle; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; *unloadProcPtr = &UnloadFile; *loadHandle = newHandle; return TCL_OK; } /* *---------------------------------------------------------------------- * * FindSymbol -- * * Looks up a symbol, by name, through a handle associated with a * previously loaded piece of code (shared library). * * Results: * Returns a pointer to the function associated with 'symbol' if it is * found. Otherwise returns NULL and may leave an error message in the * interp's result. * *---------------------------------------------------------------------- */ static void * FindSymbol( Tcl_Interp *interp, /* Place to put error messages. */ Tcl_LoadHandle loadHandle, /* Value from TcpDlopen(). */ const char *symbol) /* Symbol to look up. */ { const char *native; /* Name of the library to be loaded, in * system encoding */ Tcl_DString newName, ds; /* Buffers for converting the name to * system encoding and prepending an * underscore*/ void *handle = loadHandle->clientData; /* Native handle to the loaded library */ void *proc; /* Address corresponding to the resolved * symbol */ /* * Some platforms still add an underscore to the beginning of symbol * names. If we can't find a name without an underscore, try again with * the underscore. */ if (Tcl_UtfToExternalDStringEx(interp, NULL, symbol, TCL_INDEX_NONE, 0, &ds, NULL) != TCL_OK) { Tcl_DStringFree(&ds); return NULL; } native = Tcl_DStringValue(&ds); proc = dlsym(handle, native); /* INTL: Native. */ if (proc == NULL) { Tcl_DStringInit(&newName); TclDStringAppendLiteral(&newName, "_"); native = Tcl_DStringAppend(&newName, native, TCL_INDEX_NONE); proc = dlsym(handle, native); /* INTL: Native. */ Tcl_DStringFree(&newName); } #ifdef __cplusplus if (proc == NULL) { char buf[32]; snprintf(buf, sizeof(buf), "%d", (int)Tcl_DStringLength(&ds)); Tcl_DStringInit(&newName); TclDStringAppendLiteral(&newName, "__Z"); Tcl_DStringAppend(&newName, buf, TCL_INDEX_NONE); Tcl_DStringAppend(&newName, Tcl_DStringValue(&ds), TCL_INDEX_NONE); TclDStringAppendLiteral(&newName, "P10Tcl_Interp"); native = Tcl_DStringValue(&newName); proc = dlsym(handle, native + 1); /* INTL: Native. */ if (proc == NULL) { proc = dlsym(handle, native); /* INTL: Native. */ } if (proc == NULL) { TclDStringAppendLiteral(&newName, "i"); native = Tcl_DStringValue(&newName); proc = dlsym(handle, native + 1); /* INTL: Native. */ } if (proc == NULL) { proc = dlsym(handle, native); /* INTL: Native. */ } Tcl_DStringFree(&newName); } #endif Tcl_DStringFree(&ds); if (proc == NULL) { const char *errorStr = dlerror(); if (interp) { if (!errorStr) { errorStr = "unknown"; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "cannot find symbol \"%s\": %s", symbol, errorStr)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, (char *)NULL); } } return proc; } /* *---------------------------------------------------------------------- * * UnloadFile -- * * Unloads a dynamic shared object, after which all pointers to functions * in the formerly-loaded object are no longer valid. * * Results: * None. * * Side effects: * Memory for the loaded object is deallocated. * *---------------------------------------------------------------------- */ static void UnloadFile( Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to * TclpDlopen(). The loadHandle is a token * that represents the loaded file. */ { void *handle = loadHandle->clientData; dlclose(handle); Tcl_Free(loadHandle); } /* * These functions are fallbacks if we somehow determine that the platform can * do loading from memory but the user wishes to disable it. They just report * (gracefully) that they fail. */ #ifdef TCL_LOAD_FROM_MEMORY MODULE_SCOPE void * TclpLoadMemoryGetBuffer( TCL_UNUSED(size_t)) { return NULL; } MODULE_SCOPE int TclpLoadMemory( TCL_UNUSED(void *), TCL_UNUSED(size_t), TCL_UNUSED(Tcl_Size), TCL_UNUSED(const char *), TCL_UNUSED(Tcl_LoadHandle *), TCL_UNUSED(Tcl_FSUnloadFileProc **), TCL_UNUSED(int)) { return TCL_ERROR; } #endif /* TCL_LOAD_FROM_MEMORY */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclLoadAix.c0000644000175000017500000003127115104661341014726 0ustar sergeisergei/* * tclLoadAix.c -- * * This file implements the dlopen and dlsym APIs under the AIX operating * system, to enable the Tcl "load" command to work. This code was * provided by Jens-Uwe Mager. * * This file is subject to the following copyright notice, which is * different from the notice used elsewhere in Tcl. The file has been * modified to incorporate the file dlfcn.h in-line. * * Copyright © 1992,1993,1995,1996, Jens-Uwe Mager, Helios Software GmbH * Not derived from licensed software. * * Permission is granted to freely use, copy, modify, and redistribute * this software, provided that the author is not construed to be liable * for any results of using the software, alterations are clearly marked * as such, and this notice is not modified. * * Note: this file has been altered from the original in a few ways in order * to work properly with Tcl. */ /* * @(#)dlfcn.c 1.7 revision of 95/08/14 19:08:38 * This is an unpublished work copyright © 1992 HELIOS Software GmbH * 30159 Hannover, Germany */ #include #include #include #include #include #include #include #include #include "../compat/dlfcn.h" /* * We simulate dlopen() et al. through a call to load. Because AIX has no call * to find an exported symbol we read the loader section of the loaded module * and build a list of exported symbols and their virtual address. */ typedef struct { char *name; /* The symbols's name. */ void *addr; /* Its relocated virtual address. */ } Export, *ExportPtr; /* * xlC uses the following structure to list its constructors and destructors. * This is gleaned from the output of munch. */ typedef struct { void (*init)(void); /* call static constructors */ void (*term)(void); /* call static destructors */ } Cdtor, *CdtorPtr; /* * The void * handle returned from dlopen is actually a ModulePtr. */ typedef struct Module { struct Module *next; char *name; /* module name for refcounting */ int refCnt; /* the number of references */ void *entry; /* entry point from load */ struct dl_info *info; /* optional init/terminate functions */ CdtorPtr cdtors; /* optional C++ constructors */ int nExports; /* the number of exports found */ ExportPtr exports; /* the array of exports */ } Module, *ModulePtr; /* * We keep a list of all loaded modules to be able to call the fini handlers * and destructors at atexit() time. */ static ModulePtr modList; /* * The last error from one of the dl* routines is kept in static variables * here. Each error is returned only once to the caller. */ static char errbuf[BUFSIZ]; static int errvalid; static void caterr(char *); static int readExports(ModulePtr); static void terminate(void); static void *findMain(void); void * dlopen( const char *path, int mode) { ModulePtr mp; static void *mainModule; /* * Upon the first call register a terminate handler that will close all * libraries. Also get a reference to the main module for use with * loadbind. */ if (!mainModule) { mainModule = findMain(); if (mainModule == NULL) { return NULL; } atexit(terminate); } /* * Scan the list of modules if we have the module already loaded. */ for (mp = modList; mp; mp = mp->next) { if (strcmp(mp->name, path) == 0) { mp->refCnt++; return (void *)mp; } } mp = (ModulePtr) calloc(1, sizeof(*mp)); if (mp == NULL) { errvalid++; strcpy(errbuf, "calloc: "); strcat(errbuf, strerror(errno)); return NULL; } mp->name = malloc(strlen(path) + 1); strcpy(mp->name, path); /* * load should be declared load(const char *...). Thus we cast the path to * a normal char *. Ugly. */ mp->entry = (void *)load((char *)path, L_NOAUTODEFER, NULL); if (mp->entry == NULL) { free(mp->name); free(mp); errvalid++; strcpy(errbuf, "dlopen: "); strcat(errbuf, path); strcat(errbuf, ": "); /* * If AIX says the file is not executable, the error can be further * described by querying the loader about the last error. */ if (errno == ENOEXEC) { char *tmp[BUFSIZ/sizeof(char *)], **p; if (loadquery(L_GETMESSAGES, tmp, sizeof(tmp)) == -1) { strcpy(errbuf, strerror(errno)); } else { for (p=tmp ; *p ; p++) { caterr(*p); } } } else { strcat(errbuf, strerror(errno)); } return NULL; } mp->refCnt = 1; mp->next = modList; modList = mp; if (loadbind(0, mainModule, mp->entry) == -1) { loadbindFailure: dlclose(mp); errvalid++; strcpy(errbuf, "loadbind: "); strcat(errbuf, strerror(errno)); return NULL; } /* * If the user wants global binding, loadbind against all other loaded * modules. */ if (mode & RTLD_GLOBAL) { ModulePtr mp1; for (mp1 = mp->next; mp1; mp1 = mp1->next) { if (loadbind(0, mp1->entry, mp->entry) == -1) { goto loadbindFailure; } } } if (readExports(mp) == -1) { dlclose(mp); return NULL; } /* * If there is a dl_info structure, call the init function. */ if (mp->info = (struct dl_info *)dlsym(mp, "dl_info")) { if (mp->info->init) { mp->info->init(); } } else { errvalid = 0; } /* * If the shared object was compiled using xlC we will need to call static * constructors (and later on dlclose destructors). */ if (mp->cdtors = (CdtorPtr) dlsym(mp, "__cdtors")) { while (mp->cdtors->init) { mp->cdtors->init(); mp->cdtors++; } } else { errvalid = 0; } return (void *)mp; } /* * Attempt to decipher an AIX loader error message and append it to our static * error message buffer. */ static void caterr( char *s) { char *p = s; while (*p >= '0' && *p <= '9') { p++; } switch (atoi(s)) { /* INTL: "C", UTF safe. */ case L_ERROR_TOOMANY: strcat(errbuf, "to many errors"); break; case L_ERROR_NOLIB: strcat(errbuf, "cannot load library"); strcat(errbuf, p); break; case L_ERROR_UNDEF: strcat(errbuf, "cannot find symbol"); strcat(errbuf, p); break; case L_ERROR_RLDBAD: strcat(errbuf, "bad RLD"); strcat(errbuf, p); break; case L_ERROR_FORMAT: strcat(errbuf, "bad exec format in"); strcat(errbuf, p); break; case L_ERROR_ERRNO: strcat(errbuf, strerror(atoi(++p))); /* INTL: "C", UTF safe. */ break; default: strcat(errbuf, s); break; } } void * dlsym( void *handle, const char *symbol) { ModulePtr mp = (ModulePtr)handle; ExportPtr ep; int i; /* * Could speed up the search, but I assume that one assigns the result to * function pointers anyways. */ for (ep = mp->exports, i = mp->nExports; i; i--, ep++) { if (strcmp(ep->name, symbol) == 0) { return ep->addr; } } errvalid++; strcpy(errbuf, "dlsym: undefined symbol "); strcat(errbuf, symbol); return NULL; } char * dlerror(void) { if (errvalid) { errvalid = 0; return errbuf; } return NULL; } int dlclose( void *handle) { ModulePtr mp = (ModulePtr)handle; int result; ModulePtr mp1; if (--mp->refCnt > 0) { return 0; } if (mp->info && mp->info->fini) { mp->info->fini(); } if (mp->cdtors) { while (mp->cdtors->term) { mp->cdtors->term(); mp->cdtors++; } } result = unload(mp->entry); if (result == -1) { errvalid++; strcpy(errbuf, strerror(errno)); } if (mp->exports) { ExportPtr ep; int i; for (ep = mp->exports, i = mp->nExports; i; i--, ep++) { if (ep->name) { free(ep->name); } } free(mp->exports); } if (mp == modList) { modList = mp->next; } else { for (mp1 = modList; mp1; mp1 = mp1->next) { if (mp1->next == mp) { mp1->next = mp->next; break; } } } free(mp->name); free(mp); return result; } static void terminate(void) { while (modList) { dlclose(modList); } } /* * Build the export table from the XCOFF .loader section. */ static int readExports( ModulePtr mp) { LDFILE *ldp = NULL; SCNHDR sh, shdata; LDHDR *lhp; char *ldbuf; LDSYM *ls; int i; ExportPtr ep; const char *errMsg; #define Error(msg) do{errMsg=(msg);goto error;}while(0) #define SysErr() Error(strerror(errno)) ldp = ldopen(mp->name, ldp); if (ldp == NULL) { struct ld_info *lp; char *buf; int size = 0; if (errno != ENOENT) { SysErr(); } /* * The module might be loaded due to the LIBPATH environment variable. * Search for the loaded module using L_GETINFO. */ while (1) { size += 4 * 1024; buf = malloc(size); if (buf == NULL) { SysErr(); } i = loadquery(L_GETINFO, buf, size); if (i != -1) { break; } free(buf); if (errno != ENOMEM) { SysErr(); } } /* * Traverse the list of loaded modules. The entry point returned by * load() does actually point to the data segment origin. */ lp = (struct ld_info *) buf; while (lp) { if (lp->ldinfo_dataorg == mp->entry) { ldp = ldopen(lp->ldinfo_filename, ldp); break; } if (lp->ldinfo_next == 0) { lp = NULL; } else { lp = (struct ld_info *)((char *)lp + lp->ldinfo_next); } } free(buf); if (!ldp) { SysErr(); } } if (TYPE(ldp) != U802TOCMAGIC) { Error("bad magic"); } /* * Get the padding for the data section. This is needed for AIX 4.1 * compilers. This is used when building the final function pointer to the * exported symbol. */ if (ldnshread(ldp, _DATA, &shdata) != SUCCESS) { Error("cannot read data section header"); } if (ldnshread(ldp, _LOADER, &sh) != SUCCESS) { Error("cannot read loader section header"); } /* * We read the complete loader section in one chunk, this makes finding * long symbol names residing in the string table easier. */ ldbuf = (char *) malloc(sh.s_size); if (ldbuf == NULL) { SysErr(); } if (FSEEK(ldp, sh.s_scnptr, BEGINNING) != OKFSEEK) { free(ldbuf); Error("cannot seek to loader section"); } if (FREAD(ldbuf, sh.s_size, 1, ldp) != 1) { free(ldbuf); Error("cannot read loader section"); } lhp = (LDHDR *) ldbuf; ls = (LDSYM *)(ldbuf + LDHDRSZ); /* * Count the number of exports to include in our export table. */ for (i = lhp->l_nsyms; i; i--, ls++) { if (!LDR_EXPORT(*ls)) { continue; } mp->nExports++; } mp->exports = (ExportPtr) calloc(mp->nExports, sizeof(*mp->exports)); if (mp->exports == NULL) { free(ldbuf); SysErr(); } /* * Fill in the export table. All entries are relative to the entry point * we got from load. */ ep = mp->exports; ls = (LDSYM *)(ldbuf + LDHDRSZ); for (i=lhp->l_nsyms ; i!=0 ; i--,ls++) { char *symname; char tmpsym[SYMNMLEN+1]; if (!LDR_EXPORT(*ls)) { continue; } if (ls->l_zeroes == 0) { symname = ls->l_offset + lhp->l_stoff + ldbuf; } else { /* * The l_name member is not zero terminated, we must copy the * first SYMNMLEN chars and make sure we have a zero byte at the * end. */ strncpy(tmpsym, ls->l_name, SYMNMLEN); tmpsym[SYMNMLEN] = '\0'; symname = tmpsym; } ep->name = malloc(strlen(symname) + 1); strcpy(ep->name, symname); ep->addr = (void *)((unsigned long) mp->entry + ls->l_value - shdata.s_vaddr); ep++; } free(ldbuf); while (ldclose(ldp) == FAILURE) { /* Empty body */ } return 0; /* * This is a factoring out of the error-handling code to make the rest of * the function much simpler to read. */ error: errvalid++; strcpy(errbuf, "readExports: "); strcat(errbuf, errMsg); if (ldp != NULL) { while (ldclose(ldp) == FAILURE) { /* Empty body */ } } return -1; } /* * Find the main modules entry point. This is used as export pointer for * loadbind() to be able to resolve references to the main part. */ static void * findMain(void) { struct ld_info *lp; char *buf; int size = 4*1024; int i; void *ret; buf = malloc(size); if (buf == NULL) { goto error; } while ((i = loadquery(L_GETINFO, buf, size)) == -1 && errno == ENOMEM) { free(buf); size += 4*1024; buf = malloc(size); if (buf == NULL) { goto error; } } if (i == -1) { free(buf); goto error; } /* * The first entry is the main module. The entry point returned by load() * does actually point to the data segment origin. */ lp = (struct ld_info *) buf; ret = lp->ldinfo_dataorg; free(buf); return ret; error: errvalid++; strcpy(errbuf, "findMain: "); strcat(errbuf, strerror(errno)); return NULL; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclKqueueNotfy.c0000644000175000017500000006036515104661341015672 0ustar sergeisergei/* * tclKqueueNotfy.c -- * * This file contains the implementation of the kqueue()-based * DragonFly/Free/Net/OpenBSD-specific notifier, which is the lowest- * level part of the Tcl event loop. This file works together with * generic/tclNotify.c. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 2016 Lucio Andrés Illanes Albornoz * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is * in tclMacOSXNotify.c */ #if defined(NOTIFIER_KQUEUE) && TCL_THREADS #include #include #include #include #include /* * This structure is used to keep track of the notifier info for a registered * file. */ struct PlatformEventData; typedef struct FileHandler { int fd; /* File descriptor that this is describing a * handler for. */ int mask; /* Mask of desired events: TCL_READABLE, * etc. */ int readyMask; /* Mask of events that have been seen since * the last time file handlers were invoked * for this file. */ Tcl_FileProc *proc; /* Function to call, in the style of * Tcl_CreateFileHandler. */ void *clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ LIST_ENTRY(FileHandler) readyNode; /* Next/previous in list of FileHandlers asso- * ciated with regular files (S_IFREG) that are * ready for I/O. */ struct PlatformEventData *pedPtr; /* Pointer to PlatformEventData associating this * FileHandler with kevent(2) events. */ } FileHandler; /* * The following structure associates a FileHandler and the thread that owns * it with the file descriptors of interest and their event masks passed to * kevent(2) and their corresponding event(s) returned by kevent(2). */ struct ThreadSpecificData; struct PlatformEventData { FileHandler *filePtr; struct ThreadSpecificData *tsdPtr; }; /* * The following structure is what is added to the Tcl event queue when file * handlers are ready to fire. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find * the FileHandler structure for the file * (can't point directly to the FileHandler * structure because it could go away while * the event is queued). */ } FileHandlerEvent; /* * The following static structure contains the state information for the * kqueue based implementation of the Tcl notifier. One of these structures is * created for each thread that is using the notifier. */ LIST_HEAD(PlatformReadyFileHandlerList, FileHandler); typedef struct ThreadSpecificData { FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ struct PlatformReadyFileHandlerList firstReadyFileHandlerPtr; /* Pointer to head of list of FileHandlers * associated with regular files (S_IFREG) * that are ready for I/O. */ pthread_mutex_t notifierMutex; /* Mutex protecting notifier termination in * TclpFinalizeNotifier. */ int triggerPipe[2]; /* pipe(2) used by other threads to wake * up this thread for inter-thread IPC. */ int eventsFd; /* kqueue(2) file descriptor used to wait for * fds. */ struct kevent *readyEvents; /* Pointer to at most maxReadyEvents events * returned by kevent(2). */ size_t maxReadyEvents; /* Count of kevents in readyEvents. */ int asyncPending; /* True when signal triggered thread. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * Forward declarations of internal functions. */ static void PlatformEventsControl(FileHandler *filePtr, ThreadSpecificData *tsdPtr, int op, int isNew); static int PlatformEventsTranslate(struct kevent *eventPtr); static int PlatformEventsWait(struct kevent *events, size_t numEvents, struct timeval *timePtr); /* * Incorporate the base notifier implementation. */ #include "tclUnixNotfy.c" /* *---------------------------------------------------------------------- * * PlatformEventsControl -- * * This function registers interest for the file descriptor and the mask * of TCL_* bits associated with filePtr on the kqueue file descriptor * associated with tsdPtr. * * Future calls to kevent will return filePtr and tsdPtr alongside with * the event registered here via the PlatformEventData struct. * * Results: * None. * * Side effects: * - If adding a new file descriptor, a PlatformEventData struct will be * allocated and associated with filePtr. * - fstat is called on the file descriptor; if it is associated with * a regular file (S_IFREG,) filePtr is considered to be ready for I/O * and added to or deleted from the corresponding list in tsdPtr. * - If it is not associated with a regular file, the file descriptor is * added, modified concerning its mask of events of interest, or * deleted from the epoll file descriptor of the calling thread. * - If deleting a file descriptor, kevent(2) is called twice specifying * EVFILT_READ first and then EVFILT_WRITE (see note below.) * *---------------------------------------------------------------------- */ static void PlatformEventsControl( FileHandler *filePtr, ThreadSpecificData *tsdPtr, int op, int isNew) { int numChanges; struct kevent changeList[2]; struct PlatformEventData *newPedPtr; Tcl_StatBuf fdStat; if (isNew) { newPedPtr = (struct PlatformEventData *) Tcl_Alloc(sizeof(struct PlatformEventData)); newPedPtr->filePtr = filePtr; newPedPtr->tsdPtr = tsdPtr; filePtr->pedPtr = newPedPtr; } /* * N.B. As discussed in Tcl_WaitForEvent(), kqueue(2) does not reproduce * the `always ready' {select,poll}(2) behaviour for regular files * (S_IFREG) prior to FreeBSD 11.0-RELEASE. Therefore, filePtr is in these * cases simply added or deleted from the list of FileHandlers associated * with regular files belonging to tsdPtr. */ if (TclOSfstat(filePtr->fd, &fdStat) == -1) { Tcl_Panic("fstat: %s", strerror(errno)); } else if ((fdStat.st_mode & S_IFMT) == S_IFREG || (fdStat.st_mode & S_IFMT) == S_IFDIR || (fdStat.st_mode & S_IFMT) == S_IFLNK) { switch (op) { case EV_ADD: if (isNew) { LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr, readyNode); } break; case EV_DELETE: LIST_REMOVE(filePtr, readyNode); break; } return; } numChanges = 0; switch (op) { case EV_ADD: if (filePtr->mask & (TCL_READABLE | TCL_EXCEPTION)) { EV_SET(&changeList[numChanges], (uintptr_t) filePtr->fd, EVFILT_READ, op, 0, 0, filePtr->pedPtr); numChanges++; } if (filePtr->mask & TCL_WRITABLE) { EV_SET(&changeList[numChanges], (uintptr_t) filePtr->fd, EVFILT_WRITE, op, 0, 0, filePtr->pedPtr); numChanges++; } if (numChanges) { if (kevent(tsdPtr->eventsFd, changeList, numChanges, NULL, 0, NULL) == -1) { Tcl_Panic("kevent: %s", strerror(errno)); } } break; case EV_DELETE: /* * N.B. kqueue(2) has separate filters for readability and writability * fd events. We therefore need to ensure that fds are ompletely * removed from the kqueue(2) fd when deleting. This is exacerbated * by changes to filePtr->mask w/o calls to PlatforEventsControl() * after e.g. an exec(3) in a child process. * * As one of these calls can fail, two separate kevent(2) calls are * made for EVFILT_{READ,WRITE}. */ EV_SET(&changeList[0], (uintptr_t) filePtr->fd, EVFILT_READ, op, 0, 0, NULL); if ((kevent(tsdPtr->eventsFd, changeList, 1, NULL, 0, NULL) == -1) && (errno != ENOENT)) { Tcl_Panic("kevent: %s", strerror(errno)); } EV_SET(&changeList[0], (uintptr_t) filePtr->fd, EVFILT_WRITE, op, 0, 0, NULL); if ((kevent(tsdPtr->eventsFd, changeList, 1, NULL, 0, NULL) == -1) && (errno != ENOENT)) { Tcl_Panic("kevent: %s", strerror(errno)); } break; } } /* *---------------------------------------------------------------------- * * TclpFinalizeNotifier -- * * This function closes the pipe and the kqueue file descriptors and * frees the kevent structs owned by the thread of the caller. The above * operations are protected by tsdPtr->notifierMutex, which is destroyed * thereafter. * * Results: * None. * * Side effects: * While tsdPtr->notifierMutex is held: * The per-thread pipe(2) fds are closed, if non-zero, and set to -1. * The per-thread kqueue(2) fd is closed, if non-zero, and set to 0. * The per-thread kevent structs are freed, if any, and set to 0. * * tsdPtr->notifierMutex is destroyed. * *---------------------------------------------------------------------- */ void TclpFinalizeNotifier( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); pthread_mutex_lock(&tsdPtr->notifierMutex); if (tsdPtr->triggerPipe[0]) { close(tsdPtr->triggerPipe[0]); tsdPtr->triggerPipe[0] = -1; } if (tsdPtr->triggerPipe[1]) { close(tsdPtr->triggerPipe[1]); tsdPtr->triggerPipe[1] = -1; } if (tsdPtr->eventsFd > 0) { close(tsdPtr->eventsFd); tsdPtr->eventsFd = 0; } if (tsdPtr->readyEvents) { Tcl_Free(tsdPtr->readyEvents); tsdPtr->maxReadyEvents = 0; } pthread_mutex_unlock(&tsdPtr->notifierMutex); if ((errno = pthread_mutex_destroy(&tsdPtr->notifierMutex))) { Tcl_Panic("pthread_mutex_destroy: %s", strerror(errno)); } } /* *---------------------------------------------------------------------- * * TclpInitNotifier -- * * Initializes the platform specific notifier state. * * This function abstracts creating a kqueue fd via the kqueue system * call and allocating memory for the kevents structs in tsdPtr for the * thread of the caller. * * Results: * Returns a handle to the notifier state for this thread. * * Side effects: * The following per-thread entities are initialised: * - notifierMutex is initialised. * - The pipe(2) is created; fcntl(2) is called on both fds to set * FD_CLOEXEC and O_NONBLOCK. * - The kqueue(2) fd is created; fcntl(2) is called on it to set * FD_CLOEXEC. * - A FileHandler struct is allocated and initialised for the event- * fd(2), registering interest for TCL_READABLE on it via Platform- * EventsControl(). * - readyEvents and maxReadyEvents are initialised with 512 kevents. * *---------------------------------------------------------------------- */ void * TclpInitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); int i, fdFl; FileHandler *filePtr; errno = pthread_mutex_init(&tsdPtr->notifierMutex, NULL); if (errno) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex"); } if (pipe(tsdPtr->triggerPipe) != 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger pipe"); } else for (i = 0; i < 2; i++) { if (fcntl(tsdPtr->triggerPipe[i], F_SETFD, FD_CLOEXEC) == -1) { Tcl_Panic("fcntl: %s", strerror(errno)); } else { fdFl = fcntl(tsdPtr->triggerPipe[i], F_GETFL); fdFl |= O_NONBLOCK; } if (fcntl(tsdPtr->triggerPipe[i], F_SETFL, fdFl) == -1) { Tcl_Panic("fcntl: %s", strerror(errno)); } } if ((tsdPtr->eventsFd = kqueue()) == -1) { Tcl_Panic("kqueue: %s", strerror(errno)); } else if (fcntl(tsdPtr->eventsFd, F_SETFD, FD_CLOEXEC) == -1) { Tcl_Panic("fcntl: %s", strerror(errno)); } filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = tsdPtr->triggerPipe[0]; filePtr->mask = TCL_READABLE; PlatformEventsControl(filePtr, tsdPtr, EV_ADD, 1); if (!tsdPtr->readyEvents) { tsdPtr->maxReadyEvents = 512; tsdPtr->readyEvents = (struct kevent *) Tcl_Alloc( tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0])); } LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr); return tsdPtr; } /* *---------------------------------------------------------------------- * * PlatformEventsTranslate -- * * This function translates the platform-specific mask of returned * events in eventPtr to a mask of TCL_* bits. * * Results: * Returns the translated mask. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int PlatformEventsTranslate( struct kevent *eventPtr) { int mask; mask = 0; if (eventPtr->filter == EVFILT_READ) { mask |= TCL_READABLE; if (eventPtr->flags & EV_ERROR) { mask |= TCL_EXCEPTION; } } if (eventPtr->filter == EVFILT_WRITE) { mask |= TCL_WRITABLE; if (eventPtr->flags & EV_ERROR) { mask |= TCL_EXCEPTION; } } return mask; } /* *---------------------------------------------------------------------- * * PlatformEventsWait -- * * This function abstracts waiting for I/O events via the kevent system * call. * * Results: * Returns -1 if kevent failed. Returns 0 if polling and if no events * became available whilst polling. Returns a pointer to and the count of * all returned events in all other cases. * * Side effects: * gettimeofday(2), kevent(2), and gettimeofday(2) are called, in the * specified order. * If timePtr specifies a positive value, it is updated to reflect the * amount of time that has passed; if its value would {under, over}flow, * it is set to zero. * *---------------------------------------------------------------------- */ static int PlatformEventsWait( struct kevent *events, size_t numEvents, struct timeval *timePtr) { int numFound; struct timeval tv0, tv1, tv_delta; struct timespec timeout, *timeoutPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * If timePtr is NULL, kevent(2) will wait indefinitely. If it specifies a * timeout of {0,0}, kevent(2) will poll. Otherwise, the timeout will * simply be converted to a timespec. */ if (!timePtr) { timeoutPtr = NULL; } else if (!timePtr->tv_sec && !timePtr->tv_usec) { timeout.tv_sec = 0; timeout.tv_nsec = 0; timeoutPtr = &timeout; } else { timeout.tv_sec = timePtr->tv_sec; timeout.tv_nsec = timePtr->tv_usec * 1000; timeoutPtr = &timeout; } /* * Call (and possibly block on) kevent(2) and substract the delta of * gettimeofday(2) before and after the call from timePtr if the latter is * not NULL. Return the number of events returned by kevent(2). */ gettimeofday(&tv0, NULL); numFound = kevent(tsdPtr->eventsFd, NULL, 0, events, (int) numEvents, timeoutPtr); gettimeofday(&tv1, NULL); if (timePtr && (timePtr->tv_sec && timePtr->tv_usec)) { timersub(&tv1, &tv0, &tv_delta); if (!timercmp(&tv_delta, timePtr, >)) { timersub(timePtr, &tv_delta, timePtr); } else { timePtr->tv_sec = 0; timePtr->tv_usec = 0; } } if (tsdPtr->asyncPending) { tsdPtr->asyncPending = 0; TclAsyncMarkFromNotifier(); } return numFound; } /* *---------------------------------------------------------------------- * * TclpCreateFileHandler -- * * This function registers a file handler with the kqueue notifier * of the thread of the caller. * * Results: * None. * * Side effects: * Creates a new file handler structure. * PlatformEventsControl() is called for the new file handler structure. * *---------------------------------------------------------------------- */ void TclpCreateFileHandler( int fd, /* Handle of stream to watch. */ int mask, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION: indicates * conditions under which proc should be * called. */ Tcl_FileProc *proc, /* Function to call for each selected * event. */ void *clientData) /* Arbitrary data to pass to proc. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL); int isNew = (filePtr == NULL); if (isNew) { filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->readyMask = 0; filePtr->nextPtr = tsdPtr->firstFileHandlerPtr; tsdPtr->firstFileHandlerPtr = filePtr; } filePtr->proc = proc; filePtr->clientData = clientData; filePtr->mask = mask; PlatformEventsControl(filePtr, tsdPtr, EV_ADD, isNew); } /* *---------------------------------------------------------------------- * * TclpDeleteFileHandler -- * * Cancel a previously-arranged callback arrangement for a file on the * kqueue of the thread of the caller. * * Results: * None. * * Side effects: * If a callback was previously registered on file, remove it. * PlatformEventsControl() is called for the file handler structure. * The PlatformEventData struct associated with the new file handler * structure is freed. * *---------------------------------------------------------------------- */ void TclpDeleteFileHandler( int fd) /* Stream id for which to remove callback * function. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr, *prevPtr; /* * Find the entry for the given file (and return if there isn't one). */ filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr); if (filePtr == NULL) { return; } /* * Update the check masks for this file. */ PlatformEventsControl(filePtr, tsdPtr, EV_DELETE, 0); if (filePtr->pedPtr) { Tcl_Free(filePtr->pedPtr); } /* * Clean up information in the callback record. */ if (prevPtr == NULL) { tsdPtr->firstFileHandlerPtr = filePtr->nextPtr; } else { prevPtr->nextPtr = filePtr->nextPtr; } Tcl_Free(filePtr); } /* *---------------------------------------------------------------------- * * TclpWaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then TclpWaitForEvent just * polls without blocking. * * The waiting logic is implemented in PlatformEventsWait. * * Results: * Returns -1 if PlatformEventsWait() would block forever, otherwise * returns 0. * * Side effects: * Queues file events that are detected by PlatformEventsWait(). * *---------------------------------------------------------------------- */ int TclpWaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { FileHandler *filePtr; int mask; Tcl_Time vTime; struct timeval timeout, *timeoutPtr; /* Impl. notes: timeout & timeoutPtr are used * if, and only if threads are not enabled. * They are the arguments for the regular * epoll_wait() used when the core is not * thread-enabled. */ int numFound, numEvent; struct PlatformEventData *pedPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); int numQueued; ssize_t i; char buf[1]; /* * Set up the timeout structure. Note that if there are no events to check * for, we return with a negative result rather than blocking forever. */ if (timePtr != NULL) { /* * TIP #233 (Virtualized Time). Is virtual time in effect? And do we * actually have something to scale? If yes to both then we call the * handler to do this scaling. */ if (timePtr->sec != 0 || timePtr->usec != 0) { vTime = *timePtr; TclScaleTime(&vTime); timePtr = &vTime; } timeout.tv_sec = timePtr->sec; timeout.tv_usec = timePtr->usec; timeoutPtr = &timeout; } else { timeoutPtr = NULL; } /* * Walk the list of FileHandlers associated with regular files (S_IFREG) * belonging to tsdPtr, queue Tcl events for them, and update their mask * of events of interest. * * kqueue(2), unlike epoll(7), does support regular files, but EVFILT_READ * only `[r]eturns when the file pointer is not at the end of file' as * opposed to unconditionally. While FreeBSD 11.0-RELEASE adds support for * this mode (NOTE_FILE_POLL,) this is not used for reasons of * compatibility. * * Therefore, the behaviour of {select,poll}(2) is simply simulated here: * fds associated with regular files are added to this list by * PlatformEventsControl() and processed here before calling (and possibly * blocking) on PlatformEventsWait(). */ numQueued = 0; LIST_FOREACH(filePtr, &tsdPtr->firstReadyFileHandlerPtr, readyNode) { mask = 0; if (filePtr->mask & TCL_READABLE) { mask |= TCL_READABLE; } if (filePtr->mask & TCL_WRITABLE) { mask |= TCL_WRITABLE; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); numQueued++; } filePtr->readyMask = mask; } /* * If any events were queued in the above loop, force PlatformEventsWait() * to poll as there already are events that need to be processed at this * point. */ if (numQueued) { timeout.tv_sec = 0; timeout.tv_usec = 0; timeoutPtr = &timeout; } /* * Wait or poll for new events, queue Tcl events for the FileHandlers * corresponding to them, and update the FileHandlers' mask of events of * interest registered by the last call to Tcl_CreateFileHandler(). * * Events for the trigger pipe are processed here in order to facilitate * inter-thread IPC. If another thread intends to wake up this thread * whilst it's blocking on PlatformEventsWait(), it write(2)s to the other * end of the pipe (see Tcl_AlertNotifier(),) which in turn will cause * PlatformEventsWait() to return immediately. */ numFound = PlatformEventsWait(tsdPtr->readyEvents, tsdPtr->maxReadyEvents, timeoutPtr); for (numEvent = 0; numEvent < numFound; numEvent++) { pedPtr = (struct PlatformEventData *) tsdPtr->readyEvents[numEvent].udata; filePtr = pedPtr->filePtr; mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]); if (filePtr->fd == tsdPtr->triggerPipe[0]) { i = read(tsdPtr->triggerPipe[0], buf, 1); if ((i == -1) && (errno != EAGAIN)) { Tcl_Panic("Tcl_WaitForEvent: read from %p->triggerPipe: %s", tsdPtr, strerror(errno)); } continue; } if (!mask) { continue; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); } filePtr->readyMask |= mask; } return 0; } /* *---------------------------------------------------------------------- * * TclAsyncNotifier -- * * This procedure sets the async mark of an async handler to a * given value, if it is called from the target thread. * * Result: * True, when the handler will be marked, false otherwise. * * Side effects: * The signal may be resent to the target thread. * *---------------------------------------------------------------------- */ int TclAsyncNotifier( int sigNumber, /* Signal number. */ Tcl_ThreadId threadId, /* Target thread. */ void *clientData, /* Notifier data. */ int *flagPtr, /* Flag to mark. */ int value) /* Value of mark. */ { #if TCL_THREADS /* * WARNING: * This code most likely runs in a signal handler. Thus, * only few async-signal-safe system calls are allowed, * e.g. pthread_self(), sem_post(), write(). */ if (pthread_equal(pthread_self(), (pthread_t) threadId)) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; *flagPtr = value; if (tsdPtr != NULL && !tsdPtr->asyncPending) { tsdPtr->asyncPending = 1; TclpAlertNotifier(tsdPtr); return 1; } return 0; } /* * Re-send the signal to the proper target thread. */ pthread_kill((pthread_t) threadId, sigNumber); #else (void)sigNumber; (void)threadId; (void)clientData; (void)flagPtr; (void)value; #endif return 0; } #endif /* NOTIFIER_KQUEUE && TCL_THREADS */ #else TCL_MAC_EMPTY_FILE(unix_tclKqueueNotfy_c) #endif /* !HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclEpollNotfy.c0000644000175000017500000006031315104661341015477 0ustar sergeisergei/* * tclEpollNotfy.c -- * * This file contains the implementation of the epoll()-based * Linux-specific notifier, which is the lowest-level part of the Tcl * event loop. This file works together with generic/tclNotify.c. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 2016 Lucio Andrés Illanes Albornoz * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is * in tclMacOSXNotify.c */ #if defined(NOTIFIER_EPOLL) && TCL_THREADS #ifndef _GNU_SOURCE # define _GNU_SOURCE /* For pipe2(2) */ #endif #include #include #include #ifdef HAVE_EVENTFD #include #endif /* HAVE_EVENTFD */ #include /* * This structure is used to keep track of the notifier info for a registered * file. */ struct PlatformEventData; typedef struct FileHandler { int fd; int mask; /* Mask of desired events: TCL_READABLE, * etc. */ int readyMask; /* Mask of events that have been seen since * the last time file handlers were invoked * for this file. */ Tcl_FileProc *proc; /* Function to call, in the style of * Tcl_CreateFileHandler. */ void *clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ LIST_ENTRY(FileHandler) readyNode; /* Next/previous in list of FileHandlers asso- * ciated with regular files (S_IFREG) that are * ready for I/O. */ struct PlatformEventData *pedPtr; /* Pointer to PlatformEventData associating this * FileHandler with epoll(7) events. */ } FileHandler; /* * The following structure associates a FileHandler and the thread that owns * it with the file descriptors of interest and their event masks passed to * epoll_ctl(2) and their corresponding event(s) returned by epoll_wait(2). */ struct ThreadSpecificData; struct PlatformEventData { FileHandler *filePtr; struct ThreadSpecificData *tsdPtr; }; /* * The following structure is what is added to the Tcl event queue when file * handlers are ready to fire. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find * the FileHandler structure for the file * (can't point directly to the FileHandler * structure because it could go away while * the event is queued). */ } FileHandlerEvent; /* * The following static structure contains the state information for the * epoll based implementation of the Tcl notifier. One of these structures is * created for each thread that is using the notifier. */ LIST_HEAD(PlatformReadyFileHandlerList, FileHandler); typedef struct ThreadSpecificData { FileHandler *triggerFilePtr; FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ struct PlatformReadyFileHandlerList firstReadyFileHandlerPtr; /* Pointer to head of list of FileHandlers * associated with regular files (S_IFREG) * that are ready for I/O. */ pthread_mutex_t notifierMutex; /* Mutex protecting notifier termination in * TclpFinalizeNotifier. */ #ifdef HAVE_EVENTFD int triggerEventFd; /* eventfd(2) used by other threads to wake * up this thread for inter-thread IPC. */ #else int triggerPipe[2]; /* pipe(2) used by other threads to wake * up this thread for inter-thread IPC. */ #endif /* HAVE_EVENTFD */ int eventsFd; /* epoll(7) file descriptor used to wait for * fds */ struct epoll_event *readyEvents; /* Pointer to at most maxReadyEvents events * returned by epoll_wait(2). */ size_t maxReadyEvents; /* Count of epoll_events in readyEvents. */ int asyncPending; /* True when signal triggered thread. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * Forward declarations. */ static void PlatformEventsControl(FileHandler *filePtr, ThreadSpecificData *tsdPtr, int op, int isNew); static void PlatformEventsInit(void); static int PlatformEventsTranslate(struct epoll_event *event); static int PlatformEventsWait(struct epoll_event *events, size_t numEvents, struct timeval *timePtr); /* * Incorporate the base notifier implementation. */ #include "tclUnixNotfy.c" /* *---------------------------------------------------------------------- * * TclpInitNotifier -- * * Initializes the platform specific notifier state. * * Results: * Returns a handle to the notifier state for this thread. * * Side effects: * If no initNotifierProc notifier hook exists, PlatformEventsInit is * called. * *---------------------------------------------------------------------- */ void * TclpInitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); PlatformEventsInit(); return tsdPtr; } /* *---------------------------------------------------------------------- * * PlatformEventsControl -- * * This function registers interest for the file descriptor and the mask * of TCL_* bits associated with filePtr on the epoll file descriptor * associated with tsdPtr. * * Future calls to epoll_wait will return filePtr and tsdPtr alongside * with the event registered here via the PlatformEventData struct. * * Results: * None. * * Side effects: * - If adding a new file descriptor, a PlatformEventData struct will be * allocated and associated with filePtr. * - fstat is called on the file descriptor; if it is associated with a * regular file (S_IFREG,) filePtr is considered to be ready for I/O * and added to or deleted from the corresponding list in tsdPtr. * - If it is not associated with a regular file, the file descriptor is * added, modified concerning its mask of events of interest, or * deleted from the epoll file descriptor of the calling thread. * *---------------------------------------------------------------------- */ static void PlatformEventsControl( FileHandler *filePtr, ThreadSpecificData *tsdPtr, int op, int isNew) { struct epoll_event newEvent; struct PlatformEventData *newPedPtr; Tcl_StatBuf fdStat; newEvent.events = 0; if (filePtr->mask & (TCL_READABLE | TCL_EXCEPTION)) { newEvent.events |= EPOLLIN; } if (filePtr->mask & TCL_WRITABLE) { newEvent.events |= EPOLLOUT; } if (isNew) { newPedPtr = (struct PlatformEventData *) Tcl_Alloc(sizeof(struct PlatformEventData)); newPedPtr->filePtr = filePtr; newPedPtr->tsdPtr = tsdPtr; filePtr->pedPtr = newPedPtr; } newEvent.data.ptr = filePtr->pedPtr; /* * N.B. As discussed in Tcl_WaitForEvent(), epoll(7) does not support * regular files (S_IFREG). Therefore, filePtr is in these cases simply * added or deleted from the list of FileHandlers associated with regular * files belonging to tsdPtr. */ if (TclOSfstat(filePtr->fd, &fdStat) == -1) { /* * The tclEpollNotfy PlatformEventsControl function panics if the TclOSfstat * call returns -1, which occurs when using a websocket to a browser and the * browser page is refreshed. It seems the fstat call isn't doing anything * useful, in particular the contents of the statbuf aren't examined afterwards * on success and at best it changes the panic message. Instead we avoid the * panic at the cost of a memory leak. See [010d8f38] */ return; } else if (epoll_ctl(tsdPtr->eventsFd, op, filePtr->fd, &newEvent) == -1) { switch (errno) { case EPERM: switch (op) { case EPOLL_CTL_ADD: if (isNew) { LIST_INSERT_HEAD(&tsdPtr->firstReadyFileHandlerPtr, filePtr, readyNode); } break; case EPOLL_CTL_DEL: LIST_REMOVE(filePtr, readyNode); break; } break; default: Tcl_Panic("epoll_ctl: %s", strerror(errno)); } } return; } /* *---------------------------------------------------------------------- * * TclpFinalizeNotifier -- * * This function closes the eventfd and the epoll file descriptor and * frees the epoll_event structs owned by the thread of the caller. The * above operations are protected by tsdPtr->notifierMutex, which is * destroyed thereafter. * * Results: * None. * * Side effects: * While tsdPtr->notifierMutex is held: * - The per-thread eventfd(2) is closed, if non-zero, and set to -1. * - The per-thread epoll(7) fd is closed, if non-zero, and set to 0. * - The per-thread epoll_event structs are freed, if any, and set to 0. * * tsdPtr->notifierMutex is destroyed. * *---------------------------------------------------------------------- */ void TclpFinalizeNotifier( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); pthread_mutex_lock(&tsdPtr->notifierMutex); #ifdef HAVE_EVENTFD if (tsdPtr->triggerEventFd) { close(tsdPtr->triggerEventFd); tsdPtr->triggerEventFd = -1; } #else /* !HAVE_EVENTFD */ if (tsdPtr->triggerPipe[0]) { close(tsdPtr->triggerPipe[0]); tsdPtr->triggerPipe[0] = -1; } if (tsdPtr->triggerPipe[1]) { close(tsdPtr->triggerPipe[1]); tsdPtr->triggerPipe[1] = -1; } #endif /* HAVE_EVENTFD */ Tcl_Free(tsdPtr->triggerFilePtr->pedPtr); Tcl_Free(tsdPtr->triggerFilePtr); if (tsdPtr->eventsFd > 0) { close(tsdPtr->eventsFd); tsdPtr->eventsFd = 0; } if (tsdPtr->readyEvents) { Tcl_Free(tsdPtr->readyEvents); tsdPtr->maxReadyEvents = 0; } pthread_mutex_unlock(&tsdPtr->notifierMutex); if ((errno = pthread_mutex_destroy(&tsdPtr->notifierMutex))) { Tcl_Panic("pthread_mutex_destroy: %s", strerror(errno)); } } /* *---------------------------------------------------------------------- * * PlatformEventsInit -- * * This function abstracts creating a kqueue fd via the epoll_create * system call and allocating memory for the epoll_event structs in * tsdPtr for the thread of the caller. * * Results: * None. * * Side effects: * The following per-thread entities are initialised: * - notifierMutex is initialised. * - The eventfd(2) is created w/ EFD_CLOEXEC and EFD_NONBLOCK. * - The epoll(7) fd is created w/ EPOLL_CLOEXEC. * - A FileHandler struct is allocated and initialised for the * eventfd(2), registering interest for TCL_READABLE on it via * PlatformEventsControl(). * - readyEvents and maxReadyEvents are initialised with 512 * epoll_events. * *---------------------------------------------------------------------- */ static void PlatformEventsInit(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr; errno = pthread_mutex_init(&tsdPtr->notifierMutex, NULL); if (errno) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create mutex"); } filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); #ifdef HAVE_EVENTFD tsdPtr->triggerEventFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK); if (tsdPtr->triggerEventFd <= 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger eventfd"); } filePtr->fd = tsdPtr->triggerEventFd; #else /* !HAVE_EVENTFD */ if (pipe2(tsdPtr->triggerPipe, O_CLOEXEC | O_NONBLOCK) != 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger pipe"); } filePtr->fd = tsdPtr->triggerPipe[0]; #endif /* HAVE_EVENTFD */ tsdPtr->triggerFilePtr = filePtr; if ((tsdPtr->eventsFd = epoll_create1(EPOLL_CLOEXEC)) == -1) { Tcl_Panic("epoll_create1: %s", strerror(errno)); } filePtr->mask = TCL_READABLE; PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_ADD, 1); if (!tsdPtr->readyEvents) { tsdPtr->maxReadyEvents = 512; tsdPtr->readyEvents = (struct epoll_event *) Tcl_Alloc( tsdPtr->maxReadyEvents * sizeof(tsdPtr->readyEvents[0])); } LIST_INIT(&tsdPtr->firstReadyFileHandlerPtr); } /* *---------------------------------------------------------------------- * * PlatformEventsTranslate -- * * This function translates the platform-specific mask of returned events * in eventPtr to a mask of TCL_* bits. * * Results: * Returns the translated mask. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int PlatformEventsTranslate( struct epoll_event *eventPtr) { int mask; mask = 0; if (eventPtr->events & (EPOLLIN | EPOLLHUP)) { mask |= TCL_READABLE; } if (eventPtr->events & EPOLLOUT) { mask |= TCL_WRITABLE; } if (eventPtr->events & EPOLLERR) { mask |= TCL_EXCEPTION; } return mask; } /* *---------------------------------------------------------------------- * * PlatformEventsWait -- * * This function abstracts waiting for I/O events via epoll_wait. * * Results: * Returns -1 if epoll_wait failed. Returns 0 if polling and if no events * became available whilst polling. Returns a pointer to and the count of * all returned events in all other cases. * * Side effects: * gettimeofday(2), epoll_wait(2), and gettimeofday(2) are called, in the * specified order. * If timePtr specifies a positive value, it is updated to reflect the * amount of time that has passed; if its value would {under, over}flow, * it is set to zero. * *---------------------------------------------------------------------- */ static int PlatformEventsWait( struct epoll_event *events, size_t numEvents, struct timeval *timePtr) { int numFound; struct timeval tv0, tv1, tv_delta; int timeout; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * If timePtr is NULL, epoll_wait(2) will wait indefinitely. If it * specifies a timeout of {0,0}, epoll_wait(2) will poll. Otherwise, the * timeout will simply be converted to milliseconds. */ if (!timePtr) { timeout = -1; } else if (!timePtr->tv_sec && !timePtr->tv_usec) { timeout = 0; } else { timeout = (int) timePtr->tv_sec * 1000; if (timePtr->tv_usec) { timeout += (int) timePtr->tv_usec / 1000; } } /* * Call (and possibly block on) epoll_wait(2) and substract the delta of * gettimeofday(2) before and after the call from timePtr if the latter is * not NULL. Return the number of events returned by epoll_wait(2). */ gettimeofday(&tv0, NULL); numFound = epoll_wait(tsdPtr->eventsFd, events, (int) numEvents, timeout); gettimeofday(&tv1, NULL); if (timePtr && (timePtr->tv_sec && timePtr->tv_usec)) { timersub(&tv1, &tv0, &tv_delta); if (!timercmp(&tv_delta, timePtr, >)) { timersub(timePtr, &tv_delta, timePtr); } else { timePtr->tv_sec = 0; timePtr->tv_usec = 0; } } if (tsdPtr->asyncPending) { tsdPtr->asyncPending = 0; TclAsyncMarkFromNotifier(); } return numFound; } /* *---------------------------------------------------------------------- * * TclpCreateFileHandler -- * * This function registers a file handler with the epoll notifier of the * thread of the caller. * * Results: * None. * * Side effects: * Creates a new file handler structure. * PlatformEventsControl() is called for the new file handler structure. * *---------------------------------------------------------------------- */ void TclpCreateFileHandler( int fd, /* Handle of stream to watch. */ int mask, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION: indicates * conditions under which proc should be * called. */ Tcl_FileProc *proc, /* Function to call for each selected * event. */ void *clientData) /* Arbitrary data to pass to proc. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL); int isNew = (filePtr == NULL); if (isNew) { filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->readyMask = 0; filePtr->nextPtr = tsdPtr->firstFileHandlerPtr; tsdPtr->firstFileHandlerPtr = filePtr; } filePtr->proc = proc; filePtr->clientData = clientData; filePtr->mask = mask; PlatformEventsControl(filePtr, tsdPtr, isNew ? EPOLL_CTL_ADD : EPOLL_CTL_MOD, isNew); } /* *---------------------------------------------------------------------- * * TclpDeleteFileHandler -- * * Cancel a previously-arranged callback arrangement for a file on the * epoll file descriptor of the thread of the caller. * * Results: * None. * * Side effects: * If a callback was previously registered on file, remove it. * PlatformEventsControl() is called for the file handler structure. * The PlatformEventData struct associated with the new file handler * structure is freed. * *---------------------------------------------------------------------- */ void TclpDeleteFileHandler( int fd) /* Stream id for which to remove callback * function. */ { FileHandler *filePtr, *prevPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Find the entry for the given file (and return if there isn't one). */ filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr); if (filePtr == NULL) { return; } /* * Update the check masks for this file. */ PlatformEventsControl(filePtr, tsdPtr, EPOLL_CTL_DEL, 0); if (filePtr->pedPtr) { Tcl_Free(filePtr->pedPtr); } /* * Clean up information in the callback record. */ if (prevPtr == NULL) { tsdPtr->firstFileHandlerPtr = filePtr->nextPtr; } else { prevPtr->nextPtr = filePtr->nextPtr; } Tcl_Free(filePtr); } /* *---------------------------------------------------------------------- * * TclpWaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then TclpWaitForEvent just * polls without blocking. * * The waiting logic is implemented in PlatformEventsWait. * * Results: * Returns -1 if PlatformEventsWait() would block forever, otherwise * returns 0. * * Side effects: * Queues file events that are detected by PlatformEventsWait(). * *---------------------------------------------------------------------- */ int TclpWaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { FileHandler *filePtr; Tcl_Time vTime; struct timeval timeout, *timeoutPtr; /* Impl. notes: timeout & timeoutPtr are used * if, and only if threads are not enabled. * They are the arguments for the regular * epoll_wait() used when the core is not * thread-enabled. */ int mask, numFound, numEvent; struct PlatformEventData *pedPtr; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); int numQueued; ssize_t i; /* * Set up the timeout structure. Note that if there are no events to check * for, we return with a negative result rather than blocking forever. */ if (timePtr != NULL) { /* * TIP #233 (Virtualized Time). Is virtual time in effect? And do we * actually have something to scale? If yes to both then we call the * handler to do this scaling. */ if (timePtr->sec != 0 || timePtr->usec != 0) { vTime = *timePtr; TclScaleTime(&vTime); timePtr = &vTime; } timeout.tv_sec = timePtr->sec; timeout.tv_usec = timePtr->usec; timeoutPtr = &timeout; } else { timeoutPtr = NULL; } /* * Walk the list of FileHandlers associated with regular files (S_IFREG) * belonging to tsdPtr, queue Tcl events for them, and update their mask * of events of interest. * * As epoll(7) does not support regular files, the behaviour of * {select,poll}(2) is simply simulated here: fds associated with regular * files are added to this list by PlatformEventsControl() and processed * here before calling (and possibly blocking) on PlatformEventsWait(). */ numQueued = 0; LIST_FOREACH(filePtr, &tsdPtr->firstReadyFileHandlerPtr, readyNode) { mask = 0; if (filePtr->mask & TCL_READABLE) { mask |= TCL_READABLE; } if (filePtr->mask & TCL_WRITABLE) { mask |= TCL_WRITABLE; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); numQueued++; } filePtr->readyMask = mask; } /* * If any events were queued in the above loop, force PlatformEventsWait() * to poll as there already are events that need to be processed at this * point. */ if (numQueued) { timeout.tv_sec = 0; timeout.tv_usec = 0; timeoutPtr = &timeout; } /* * Wait or poll for new events, queue Tcl events for the FileHandlers * corresponding to them, and update the FileHandlers' mask of events of * interest registered by the last call to Tcl_CreateFileHandler(). * * Events for the eventfd(2)/trigger pipe are processed here in order to * facilitate inter-thread IPC. If another thread intends to wake up this * thread whilst it's blocking on PlatformEventsWait(), it write(2)s to * the eventfd(2)/trigger pipe (see Tcl_AlertNotifier(),) which in turn * will cause PlatformEventsWait() to return immediately. */ numFound = PlatformEventsWait(tsdPtr->readyEvents, tsdPtr->maxReadyEvents, timeoutPtr); for (numEvent = 0; numEvent < numFound; numEvent++) { pedPtr = (struct PlatformEventData *) tsdPtr->readyEvents[numEvent].data.ptr; filePtr = pedPtr->filePtr; mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]); #ifdef HAVE_EVENTFD if (filePtr->fd == tsdPtr->triggerEventFd) { uint64_t eventFdVal; i = read(tsdPtr->triggerEventFd, &eventFdVal, sizeof(eventFdVal)); if ((i != sizeof(eventFdVal)) && (errno != EAGAIN)) { Tcl_Panic("%s: read from %p->triggerEventFd: %s", "Tcl_WaitForEvent", tsdPtr, strerror(errno)); } continue; } #else /* !HAVE_EVENTFD */ if (filePtr->fd == tsdPtr->triggerPipe[0]) { char triggerPipeVal; i = read(tsdPtr->triggerPipe[0], &triggerPipeVal, sizeof(triggerPipeVal)); if ((i != sizeof(triggerPipeVal)) && (errno != EAGAIN)) { Tcl_Panic("%s: read from %p->triggerPipe[0]: %s", "Tcl_WaitForEvent", tsdPtr, strerror(errno)); } continue; } #endif /* HAVE_EVENTFD */ if (!mask) { continue; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); } filePtr->readyMask = mask; } return 0; } /* *---------------------------------------------------------------------- * * TclAsyncNotifier -- * * This procedure sets the async mark of an async handler to a * given value, if it is called from the target thread. * * Result: * True, when the handler will be marked, false otherwise. * * Side effects: * The signal may be resent to the target thread. * *---------------------------------------------------------------------- */ int TclAsyncNotifier( int sigNumber, /* Signal number. */ Tcl_ThreadId threadId, /* Target thread. */ void *clientData, /* Notifier data. */ int *flagPtr, /* Flag to mark. */ int value) /* Value of mark. */ { #if TCL_THREADS /* * WARNING: * This code most likely runs in a signal handler. Thus, * only few async-signal-safe system calls are allowed, * e.g. pthread_self(), sem_post(), write(). */ if (pthread_equal(pthread_self(), (pthread_t) threadId)) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; *flagPtr = value; if (tsdPtr != NULL && !tsdPtr->asyncPending) { tsdPtr->asyncPending = 1; TclpAlertNotifier(tsdPtr); return 1; } return 0; } /* * Re-send the signal to the proper target thread. */ pthread_kill((pthread_t) threadId, sigNumber); #else (void)sigNumber; (void)threadId; (void)clientData; (void)flagPtr; (void)value; #endif return 0; } #endif /* NOTIFIER_EPOLL && TCL_THREADS */ #else TCL_MAC_EMPTY_FILE(unix_tclEpollNotfy_c) #endif /* !HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tclConfig.sh.in0000644000175000017500000001347415104661341015414 0ustar sergeisergei# tclConfig.sh -- # # This shell script (for sh) is generated automatically by Tcl's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Tcl extensions so that they don't have to figure this all # out for themselves. # # The information in this file is specific to a single platform. # Tcl's version number. TCL_VERSION='@TCL_VERSION@' TCL_MAJOR_VERSION='@TCL_MAJOR_VERSION@' TCL_MINOR_VERSION='@TCL_MINOR_VERSION@' TCL_PATCH_LEVEL='@TCL_PATCH_LEVEL@' # C compiler to use for compilation. TCL_CC='@CC@' # -D flags for use with the C compiler. TCL_DEFS='@DEFS@' # Default flags used in an optimized and debuggable build, respectively. TCL_CFLAGS_DEBUG='@CFLAGS_DEBUG@' TCL_CFLAGS_OPTIMIZE='@CFLAGS_OPTIMIZE@' # Default linker flags used in an optimized and debuggable build, respectively. TCL_LDFLAGS_DEBUG='@LDFLAGS_DEBUG@' TCL_LDFLAGS_OPTIMIZE='@LDFLAGS_OPTIMIZE@' # Flag, 1: we built a shared lib, 0 we didn't TCL_SHARED_BUILD=@TCL_SHARED_BUILD@ # The name of the Tcl library (may be either a .a file or a shared library): TCL_LIB_FILE='@TCL_LIB_FILE@' # The name of a zip containing the /library and /encodings (may be either a .zip file or a shared library): TCL_ZIP_FILE='@TCL_ZIP_FILE@' # Additional libraries to use when linking Tcl. TCL_LIBS='@TCL_LIBS@' # Top-level directory in which Tcl's platform-independent files are # installed. TCL_PREFIX='@prefix@' # Top-level directory in which Tcl's platform-specific files (e.g. # executables) are installed. TCL_EXEC_PREFIX='@exec_prefix@' # Flags to pass to cc when compiling the components of a shared library: TCL_SHLIB_CFLAGS='@SHLIB_CFLAGS@' # Flags to pass to cc to get warning messages TCL_CFLAGS_WARNING='@CFLAGS_WARNING@' # Extra flags to pass to cc: TCL_EXTRA_CFLAGS='@CFLAGS@' # Base command to use for combining object files into a shared library: TCL_SHLIB_LD='@SHLIB_LD@' # Base command to use for combining object files into a static library: TCL_STLIB_LD='@STLIB_LD@' # Either '$LIBS' (if dependent libraries should be included when linking # shared libraries) or an empty string. See Tcl's configure.ac for more # explanation. TCL_SHLIB_LD_LIBS='@SHLIB_LD_LIBS@' # Suffix to use for the name of a shared library. TCL_SHLIB_SUFFIX='@SHLIB_SUFFIX@' # Library file(s) to include in tclsh and other base applications # in order to provide facilities needed by DLOBJ above. TCL_DL_LIBS='@DL_LIBS@' # Flags to pass to the compiler when linking object files into # an executable tclsh or tcltest binary. TCL_LD_FLAGS='@LDFLAGS@' # Flags to pass to cc/ld, such as "-R /usr/local/tcl/lib", that tell the # run-time dynamic linker where to look for shared libraries such as # libtcl.so. Used when linking applications. Only works if there # is a variable "LIB_RUNTIME_DIR" defined in the Makefile. TCL_CC_SEARCH_FLAGS='@CC_SEARCH_FLAGS@' TCL_LD_SEARCH_FLAGS='@LD_SEARCH_FLAGS@' # Additional object files linked with Tcl to provide compatibility # with standard facilities from ANSI C or POSIX. TCL_COMPAT_OBJS='@LIBOBJS@' # Name of the ranlib program to use. TCL_RANLIB='@RANLIB@' # -l flag to pass to the linker to pick up the Tcl library TCL_LIB_FLAG='@TCL_LIB_FLAG@' # String to pass to linker to pick up the Tcl library from its # build directory. TCL_BUILD_LIB_SPEC='@TCL_BUILD_LIB_SPEC@' # String to pass to linker to pick up the Tcl library from its # installed directory. TCL_LIB_SPEC='@TCL_LIB_SPEC@' # String to pass to the compiler so that an extension can # find installed Tcl headers. TCL_INCLUDE_SPEC='@TCL_INCLUDE_SPEC@' # Indicates whether a version numbers should be used in -l switches # ("ok" means it's safe to use switches like -ltcl7.5; "nodots" means # use switches like -ltcl75). SunOS and FreeBSD require "nodots", for # example. TCL_LIB_VERSIONS_OK='@TCL_LIB_VERSIONS_OK@' # String that can be evaluated to generate the part of a shared library # name that comes after the "libxxx" (includes version number, if any, # extension, and anything else needed). May depend on the variables # VERSION and SHLIB_SUFFIX. On most UNIX systems this is # ${VERSION}${SHLIB_SUFFIX}. TCL_SHARED_LIB_SUFFIX='@CFG_TCL_SHARED_LIB_SUFFIX@' # String that can be evaluated to generate the part of an unshared library # name that comes after the "libxxx" (includes version number, if any, # extension, and anything else needed). May depend on the variable # VERSION. On most UNIX systems this is ${VERSION}.a. TCL_UNSHARED_LIB_SUFFIX='@CFG_TCL_UNSHARED_LIB_SUFFIX@' # Location of the top-level source directory from which Tcl was built. # This is the directory that contains a README file as well as # subdirectories such as generic, unix, etc. If Tcl was compiled in a # different place than the directory containing the source files, this # points to the location of the sources, not the location where Tcl was # compiled. TCL_SRC_DIR='@TCL_SRC_DIR@' # List of standard directories in which to look for packages during # "package require" commands. Contains the "prefix" directory plus also # the "exec_prefix" directory, if it is different. TCL_PACKAGE_PATH='@TCL_PACKAGE_PATH@' # Tcl supports stub. TCL_SUPPORTS_STUBS=1 # The name of the Tcl stub library (.a): TCL_STUB_LIB_FILE='@TCL_STUB_LIB_FILE@' # -l flag to pass to the linker to pick up the Tcl stub library TCL_STUB_LIB_FLAG='@TCL_STUB_LIB_FLAG@' # String to pass to linker to pick up the Tcl stub library from its # build directory. TCL_BUILD_STUB_LIB_SPEC='@TCL_BUILD_STUB_LIB_SPEC@' # String to pass to linker to pick up the Tcl stub library from its # installed directory. TCL_STUB_LIB_SPEC='@TCL_STUB_LIB_SPEC@' # Path to the Tcl stub library in the build directory. TCL_BUILD_STUB_LIB_PATH='@TCL_BUILD_STUB_LIB_PATH@' # Path to the Tcl stub library in the install directory. TCL_STUB_LIB_PATH='@TCL_STUB_LIB_PATH@' tcl9.0.3/unix/tclConfig.h.in0000644000175000017500000003167015104662056015233 0ustar sergeisergei/* ../unix/tclConfig.h.in. Generated from configure.ac by autoheader. */ #ifndef _TCLCONFIG #define _TCLCONFIG /* Is gettimeofday() actually declared in ? */ #undef GETTOD_NOT_DECLARED /* Define to 1 if the system has the type 'blkcnt_t'. */ #undef HAVE_BLKCNT_T /* Defined when compiler supports casting to union type. */ #undef HAVE_CAST_TO_UNION /* Define to 1 if you have the 'cfmakeraw' function. */ #undef HAVE_CFMAKERAW /* Define to 1 if you have the 'chflags' function. */ #undef HAVE_CHFLAGS /* Define to 1 if you have the 'copyfile' function. */ #undef HAVE_COPYFILE /* Define to 1 if you have the header file. */ #undef HAVE_COPYFILE_H /* Do we have access to Darwin CoreFoundation.framework? */ #undef HAVE_COREFOUNDATION /* Is the cpuid instruction usable? */ #undef HAVE_CPUID /* Define to 1 if you have the declaration of 'gethostbyaddr_r', and to 0 if you don't. */ #undef HAVE_DECL_GETHOSTBYADDR_R /* Define to 1 if you have the declaration of 'gethostbyname_r', and to 0 if you don't. */ #undef HAVE_DECL_GETHOSTBYNAME_R /* Is 'DIR64' in ? */ #undef HAVE_DIR64 /* Is eventfd(2) supported? */ #undef HAVE_EVENTFD /* Define to 1 if you have the 'freeaddrinfo' function. */ #undef HAVE_FREEADDRINFO /* Do we have fts functions? */ #undef HAVE_FTS /* Define to 1 if you have the 'gai_strerror' function. */ #undef HAVE_GAI_STRERROR /* Define to 1 if you have the 'getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the 'getattrlist' function. */ #undef HAVE_GETATTRLIST /* Define to 1 if you have the 'getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if getgrgid_r is available. */ #undef HAVE_GETGRGID_R /* Define to 1 if getgrgid_r takes 4 args. */ #undef HAVE_GETGRGID_R_4 /* Define to 1 if getgrgid_r takes 5 args. */ #undef HAVE_GETGRGID_R_5 /* Define to 1 if getgrnam_r is available. */ #undef HAVE_GETGRNAM_R /* Define to 1 if getgrnam_r takes 4 args. */ #undef HAVE_GETGRNAM_R_4 /* Define to 1 if getgrnam_r takes 5 args. */ #undef HAVE_GETGRNAM_R_5 /* Define to 1 if gethostbyaddr_r is available. */ #undef HAVE_GETHOSTBYADDR_R /* Define to 1 if gethostbyaddr_r takes 7 args. */ #undef HAVE_GETHOSTBYADDR_R_7 /* Define to 1 if gethostbyaddr_r takes 8 args. */ #undef HAVE_GETHOSTBYADDR_R_8 /* Define to 1 if gethostbyname_r is available. */ #undef HAVE_GETHOSTBYNAME_R /* Define to 1 if gethostbyname_r takes 3 args. */ #undef HAVE_GETHOSTBYNAME_R_3 /* Define to 1 if gethostbyname_r takes 5 args. */ #undef HAVE_GETHOSTBYNAME_R_5 /* Define to 1 if gethostbyname_r takes 6 args. */ #undef HAVE_GETHOSTBYNAME_R_6 /* Define to 1 if you have the 'getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if getpwnam_r is available. */ #undef HAVE_GETPWNAM_R /* Define to 1 if getpwnam_r takes 4 args. */ #undef HAVE_GETPWNAM_R_4 /* Define to 1 if getpwnam_r takes 5 args. */ #undef HAVE_GETPWNAM_R_5 /* Define to 1 if getpwuid_r is available. */ #undef HAVE_GETPWUID_R /* Define to 1 if getpwuid_r takes 4 args. */ #undef HAVE_GETPWUID_R_4 /* Define to 1 if getpwuid_r takes 5 args. */ #undef HAVE_GETPWUID_R_5 /* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R /* Compiler support for module scope symbols */ #undef HAVE_HIDDEN /* Define to 1 if the system has the type 'intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Do we have nl_langinfo()? */ #undef HAVE_LANGINFO /* Define to 1 if you have the header file. */ #undef HAVE_LIBKERN_OSATOMIC_H /* Define to 1 if you have the 'localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if you have the 'lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the 'mkstemps' function. */ #undef HAVE_MKSTEMPS /* Do we have MT-safe gethostbyaddr() ? */ #undef HAVE_MTSAFE_GETHOSTBYADDR /* Do we have MT-safe gethostbyname() ? */ #undef HAVE_MTSAFE_GETHOSTBYNAME /* Do we have ? */ #undef HAVE_NET_ERRNO_H /* Define to 1 if you have the 'open64' function. */ #undef HAVE_OPEN64 /* Define to 1 if you have the 'OSSpinLockLock' function. */ #undef HAVE_OSSPINLOCKLOCK /* Define to 1 if you have the 'posix_spawnattr_setflags' function. */ #undef HAVE_POSIX_SPAWNATTR_SETFLAGS /* Define to 1 if you have the 'posix_spawnp' function. */ #undef HAVE_POSIX_SPAWNP /* Define to 1 if you have the 'posix_spawn_file_actions_adddup2' function. */ #undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 /* Should we use pselect()? */ #undef HAVE_PSELECT /* Define to 1 if you have the 'pthread_atfork' function. */ #undef HAVE_PTHREAD_ATFORK /* Define to 1 if you have the 'pthread_attr_setstacksize' function. */ #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE /* Does putenv() copy strings or incorporate them by reference? */ #undef HAVE_PUTENV_THAT_COPIES /* Are characters signed? */ #undef HAVE_SIGNED_CHAR /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if the system has the type 'struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Is 'struct dirent64' in ? */ #undef HAVE_STRUCT_DIRENT64 /* Define to 1 if the system has the type 'struct in6_addr'. */ #undef HAVE_STRUCT_IN6_ADDR /* Define to 1 if the system has the type 'struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6 /* Define to 1 if the system has the type 'struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if 'st_blksize' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if 'st_blocks' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS /* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EPOLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EVENTFD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EVENT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MODEM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Should we include ? */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Should we use the global timezone variable? */ #undef HAVE_TIMEZONE_VAR /* Should we use the tm_gmtoff field of struct tm? */ #undef HAVE_TM_GMTOFF /* Should we use the tm_tzadj field of struct tm? */ #undef HAVE_TM_TZADJ /* Is off64_t in ? */ #undef HAVE_TYPE_OFF64_T /* Define to 1 if the system has the type 'uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the 'vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the 'waitpid' function. */ #undef HAVE_WAITPID /* Is weak import available? */ #undef HAVE_WEAK_IMPORT /* Is this a Mac I see before me? */ #undef MAC_OSX_TCL /* No Compiler support for module scope symbols */ #undef MODULE_SCOPE /* Default libtommath precision. */ #undef MP_PREC /* Is no debugging enabled? */ #undef NDEBUG /* Use compat implementation of getaddrinfo() and friends */ #undef NEED_FAKE_RFC2553 /* Is epoll(7) supported? */ #undef NOTIFIER_EPOLL /* Is kqueue(2) supported? */ #undef NOTIFIER_KQUEUE /* Is Darwin CoreFoundation unavailable for 64-bit? */ #undef NO_COREFOUNDATION_64 /* Do we have ? */ #undef NO_DLFCN_H /* Do we have fd_set? */ #undef NO_FD_SET /* Do we have fork() */ #undef NO_FORK /* Do we have fstatfs()? */ #undef NO_FSTATFS /* Do we have gettimeofday()? */ #undef NO_GETTOD /* Do we have getwd() */ #undef NO_GETWD /* Do we have mknod() */ #undef NO_MKNOD /* Do we have realpath() */ #undef NO_REALPATH /* Do we have strerror() */ #undef NO_STRERROR /* Do we have ? */ #undef NO_SYS_WAIT_H /* Do we have tcdrain() */ #undef NO_TCDRAIN /* Do we have uname() */ #undef NO_UNAME /* Do we have a usable 'union wait'? */ #undef NO_UNION_WAIT /* Do we have wait3() */ #undef NO_WAIT3 /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Is this a static build? */ #undef STATIC_BUILD /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* What encoding should be used for embedded configuration info? */ #undef TCL_CFGVAL_ENCODING /* Is this a 64-bit build? */ #undef TCL_CFG_DO64BIT /* Is this an optimized build? */ #undef TCL_CFG_OPTIMIZED /* Is bytecode debugging enabled? */ #undef TCL_COMPILE_DEBUG /* Are bytecode statistics enabled? */ #undef TCL_COMPILE_STATS /* Is Tcl built as a framework? */ #undef TCL_FRAMEWORK /* Can this platform load code from memory? */ #undef TCL_LOAD_FROM_MEMORY /* Is memory debugging enabled? */ #undef TCL_MEM_DEBUG /* What is the default extension for shared libraries? */ #undef TCL_SHLIB_EXT /* Do we allow unloading of shared libraries? */ #undef TCL_UNLOAD_DLLS /* Does this platform have wide high-resolution clicks? */ #undef TCL_WIDE_CLICKS /* Do 'long' and 'long long' have the same size (64-bit)? */ #undef TCL_WIDE_INT_IS_LONG /* Tcl with external libtommath */ #undef TCL_WITH_EXTERNAL_TOMMATH /* Tcl with internal zlib */ #undef TCL_WITH_INTERNAL_ZLIB /* Is getcwd Posix-compliant? */ #undef USEGETWD /* Are we building with DTrace support? */ #undef USE_DTRACE /* Should we use FIONBIO? */ #undef USE_FIONBIO /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Are we building with zipfs enabled? */ #undef ZIPFS_BUILD /* Are Darwin SUSv3 extensions available? */ #undef _DARWIN_C_SOURCE /* Add the _FILE_OFFSET_BITS flag when building */ #undef _FILE_OFFSET_BITS /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE /* Add the _LARGEFILE64_SOURCE flag when building */ #undef _LARGEFILE64_SOURCE /* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ #undef _OE_SOCKETS /* Do we really want to follow the standard? Yes we do! */ #undef _POSIX_PTHREAD_SEMANTICS /* Do we want the reentrant OS API? */ #undef _REENTRANT /* Do we want the thread-safe OS API? */ #undef _THREAD_SAFE /* _TIME_BITS=64 enables 64-bit time_t. */ #undef _TIME_BITS /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED /* Define to 1 if type 'char' is unsigned and your compiler does not predefine this macro. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif /* Define as 'int' if doesn't define. */ #undef gid_t /* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to 'int' if does not define. */ #undef mode_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define as int if socklen_t is not available */ #undef socklen_t /* Define as 'int' if doesn't define. */ #undef uid_t /* Undef unused package specific autoheader defines so that we can * include both tclConfig.h and tkConfig.h at the same time: */ /* override */ #undef PACKAGE_NAME /* override */ #undef PACKAGE_TARNAME /* override */ #undef PACKAGE_VERSION /* override */ #undef PACKAGE_STRING #endif /* _TCLCONFIG */ tcl9.0.3/unix/tclAppInit.c0000644000175000017500000001136415104661341014752 0ustar sergeisergei/* * tclAppInit.c -- * * Provides a default version of the main program and Tcl_AppInit * procedure for tclsh and other Tcl-based applications (without Tk). * * Copyright (c) 1993 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tcl.h" #if TCL_MAJOR_VERSION < 9 # if defined(USE_TCL_STUBS) # error "Don't build with USE_TCL_STUBS!" # endif # define Tcl_LibraryInitProc Tcl_PackageInitProc # define Tcl_StaticLibrary Tcl_StaticPackage #endif #ifdef TCL_TEST #ifdef __cplusplus extern "C" { #endif extern Tcl_LibraryInitProc Tcltest_Init; extern Tcl_LibraryInitProc Tcltest_SafeInit; #ifdef __cplusplus } #endif #endif /* TCL_TEST */ #ifdef TCL_XT_TEST extern void XtToolkitInitialize(void); extern Tcl_LibraryInitProc Tclxttest_Init; #endif /* TCL_XT_TEST */ /* * The following #if block allows you to change the AppInit function by using * a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The * #if checks for that #define and uses Tcl_AppInit if it does not exist. */ #ifndef TCL_LOCAL_APPINIT #define TCL_LOCAL_APPINIT Tcl_AppInit #endif #ifndef MODULE_SCOPE # define MODULE_SCOPE extern #endif MODULE_SCOPE int TCL_LOCAL_APPINIT(Tcl_Interp *); MODULE_SCOPE int main(int, char **); /* * The following #if block allows you to change how Tcl finds the startup * script, prime the library or encoding paths, fiddle with the argv, etc., * without needing to rewrite Tcl_Main() */ #ifdef TCL_LOCAL_MAIN_HOOK MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv); #endif /* *---------------------------------------------------------------------- * * main -- * * This is the main program for the application. * * Results: * None: Tcl_Main never returns here, so this procedure never returns * either. * * Side effects: * Just about anything, since from here we call arbitrary Tcl code. * *---------------------------------------------------------------------- */ int main( int argc, /* Number of command-line arguments. */ char *argv[]) /* Values of command-line arguments. */ { #ifdef TCL_XT_TEST XtToolkitInitialize(); #endif #ifdef TCL_LOCAL_MAIN_HOOK TCL_LOCAL_MAIN_HOOK(&argc, &argv); #elif TCL_MAJOR_VERSION > 8 && (!defined(_WIN32) || defined(UNICODE)) /* New in Tcl 9.0. This doesn't work on Windows without UNICODE */ TclZipfs_AppHook(&argc, &argv); #endif Tcl_Main(argc, argv, TCL_LOCAL_APPINIT); return 0; /* Needed only to prevent compiler warning. */ } /* *---------------------------------------------------------------------- * * Tcl_AppInit -- * * This procedure performs application-specific initialization. Most * applications, especially those that incorporate additional packages, * will have their own version of this procedure. * * Results: * Returns a standard Tcl completion code, and leaves an error message in * the interp's result if an error occurs. * * Side effects: * Depends on the startup script. * *---------------------------------------------------------------------- */ int Tcl_AppInit( Tcl_Interp *interp) /* Interpreter for application. */ { if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #ifdef TCL_XT_TEST if (Tclxttest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #endif #ifdef TCL_TEST if (Tcltest_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Tcl_StaticLibrary(interp, "Tcltest", Tcltest_Init, Tcltest_SafeInit); #endif /* TCL_TEST */ /* * Call the init procedures for included packages. Each call should look * like this: * * if (Mod_Init(interp) == TCL_ERROR) { * return TCL_ERROR; * } * * where "Mod" is the name of the module. (Dynamically-loadable packages * should have the same entry-point name.) */ /* * Call Tcl_CreateObjCommand for application-specific commands, if they * weren't already created by the init procedures called above. */ /* * Specify a user-specific startup file to invoke if the application is * run interactively. Typically the startup file is "~/.apprc" where "app" * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ #ifdef DJGPP #define INITFILENAME "tclshrc.tcl" #else #define INITFILENAME ".tclshrc" #endif (void) Tcl_EvalEx(interp, "set tcl_rcFileName [file tildeexpand ~/" INITFILENAME "]", -1, TCL_EVAL_GLOBAL); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/unix/tcl.spec0000644000175000017500000000251115104661341014167 0ustar sergeisergei# This file is the basis for a binary Tcl RPM for Linux. %{!?directory:%define directory /usr/local} Name: tcl Summary: Tcl scripting language development environment Version: 9.0.3 Release: 2 License: BSD Group: Development/Languages Source: https://prdownloads.sourceforge.net/tcl/tcl%{version}-src.tar.gz URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} %description The Tcl (Tool Command Language) provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications. %prep %setup -q -n %{name}%{version} %build cd unix CFLAGS="%optflags" ./configure \ --prefix=%{directory} \ --exec-prefix=%{directory} \ --libdir=%{directory}/%{_lib} make %install cd unix make INSTALL_ROOT=%{buildroot} install %clean rm -rf %buildroot %files %defattr(-,root,root) %if %{_lib} != lib %{directory}/%{_lib} %endif %{directory}/lib %{directory}/bin %{directory}/include %{directory}/man/man1 %{directory}/man/man3 %{directory}/man/mann tcl9.0.3/unix/tcl.pc.in0000644000175000017500000000101215104661341014237 0ustar sergeisergei# tcl pkg-config source file prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libfile=@TCL_LIB_FILE@ Name: Tool Command Language Description: Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses. URL: https://www.tcl-lang.org/ Version: @TCL_VERSION@@TCL_PATCH_LEVEL@ Requires.private: @TCL_PC_REQUIRES_PRIVATE@ zlib >= 1.2.3 Libs: -L${libdir} @TCL_LIB_FLAG@ @TCL_STUB_LIB_FLAG@ Libs.private: @TCL_LIBS@ Cflags: -I${includedir} @TCL_PC_CFLAGS@ tcl9.0.3/unix/tcl.m40000644000175000017500000027560615104661341013576 0ustar sergeisergei#------------------------------------------------------------------------ # SC_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TCLCONFIG], [ # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [with_tclconfig="${withval}"]) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh]) else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # SC_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AS_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), [with_tkconfig="${withval}"]) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case "${with_tkconfig}" in */tkConfig.sh ) if test -f "${with_tkconfig}"; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tk9.0 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tk9.0 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh]) else no_tk= TK_BIN_DIR="${ac_cv_c_tkconfig}" AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # SC_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Substitutes the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitrary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd "${TCL_BIN_DIR}"; pwd`" \ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi AC_SUBST(TCL_VERSION) AC_SUBST(TCL_PATCH_LEVEL) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # SC_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}" TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}" TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitrary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd "${TK_BIN_DIR}"; pwd`" \ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # SC_PROG_TCLSH # Locate a tclsh shell installed on the system path. This macro # will only find a Tcl shell that already exists on the system. # It will not find a Tcl shell in the Tcl build directory or # a Tcl shell that has been installed from the Tcl build directory. # If a Tcl shell can't be located on the PATH, then TCLSH_PROG will # be set to "". Extensions should take care not to create Makefile # rules that are run by default and depend on TCLSH_PROG. An # extension can't assume that an executable Tcl shell exists at # build time. # # Arguments: # none # # Results: # Substitutes the following vars: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([SC_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) AC_CACHE_VAL(ac_cv_path_tclsh, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[[8-9]]* 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ]) if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" AC_MSG_RESULT([$TCLSH_PROG]) else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" AC_MSG_RESULT([No tclsh found on PATH]) fi AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # SC_BUILD_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory. This macro will correctly determine # the name of the tclsh executable even if tclsh has not yet # been built in the build directory. The build tclsh must be used # when running tests from an extension build directory. It is not # correct to use the TCLSH_PROG in cases like this. # # Arguments: # none # # Results: # Substitutes the following values: # BUILD_TCLSH #------------------------------------------------------------------------ AC_DEFUN([SC_BUILD_TCLSH], [ AC_MSG_CHECKING([for tclsh in Tcl build directory]) BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh AC_MSG_RESULT([$BUILD_TCLSH]) AC_SUBST(BUILD_TCLSH) ]) #------------------------------------------------------------------------ # SC_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, AS_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # SC_ENABLE_FRAMEWORK -- # # Allows the building of shared libraries into frameworks # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-framework=yes|no # # Sets the following vars: # FRAMEWORK_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_FRAMEWORK], [ if test "`uname -s`" = "Darwin" ; then AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, AS_HELP_STRING([--enable-framework], [package shared libraries in MacOSX frameworks (default: off)]), [enable_framework=$enableval], [enable_framework=no]) if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes]) enable_framework=no fi if test $tcl_corefoundation = no; then AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available]) enable_framework=no fi fi if test $enable_framework = yes; then AC_MSG_RESULT([framework]) FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then AC_MSG_RESULT([shared library]) else AC_MSG_RESULT([static library]) fi FRAMEWORK_BUILD=0 fi fi ]) #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging # can also be enabled. # # Arguments: # none # # Requires the following vars to be set in the Makefile: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, AS_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?]) else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi ifelse($1,bccdebug,dnl Only enable 'compile' for the Tcl core itself if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?]) AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?]) fi) if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem ]ifelse($1,bccdebug,[compile ])[debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, AS_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nl_langinfo(CODESET);]])], [tcl_cv_langinfo_h=yes], [tcl_cv_langinfo_h=no])]) AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # SC_CONFIG_MANPAGES # # Decide whether to use symlinks for linking the manpages, # whether to compress the manpages after installation, and # whether to add a package name suffix to the installed # manpages to avoidfile name clashes. # If compression is enabled also find out what file name suffix # the given compression program is using. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-man-symlinks # --enable-man-compression=PROG # --enable-man-suffix[=STRING] # # Defines the following variable: # # MAN_FLAGS - The apropriate flags for installManPage # according to the user's selection. # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_MANPAGES], [ AC_MSG_CHECKING([whether to use symlinks for manpages]) AC_ARG_ENABLE(man-symlinks, AS_HELP_STRING([--enable-man-symlinks], [use symlinks for the manpages (default: off)]), [test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks"], [enableval="no"]) AC_MSG_RESULT([$enableval]) AC_MSG_CHECKING([whether to compress the manpages]) AC_ARG_ENABLE(man-compression, AS_HELP_STRING([--enable-man-compression=PROG], [compress the manpages with PROG (default: off)]), [case $enableval in yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac], [enableval="no"]) AC_MSG_RESULT([$enableval]) if test "$enableval" != "no"; then AC_MSG_CHECKING([for compressed file suffix]) touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" AC_MSG_RESULT([$Z]) fi AC_MSG_CHECKING([whether to add a package name suffix for the manpages]) AC_ARG_ENABLE(man-suffix, AS_HELP_STRING([--enable-man-suffix=STRING], [use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]), [case $enableval in yes) enableval="AC_PACKAGE_NAME" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac], [enableval="no"]) AC_MSG_RESULT([$enableval]) AC_SUBST(MAN_FLAGS) ]) #-------------------------------------------------------------------- # SC_CONFIG_SYSTEM # # Determine what the system is (some things cannot be easily checked # on a feature-driven basis, alas). This can usually be done via the # "uname" command. # # Arguments: # none # # Results: # Defines the following var: # # system - System/platform/version identification code. # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_SYSTEM], [ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_WARN([can't find uname command]) tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ]) system=$tcl_cv_sys_version ]) #-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # MAKE_LIB - Command to execute to build the a library; # differs when building shared or static. # MAKE_STUB_LIB - # Command to execute to build a stub library. # INSTALL_LIB - Command to execute to install a library; # differs when building shared or static. # INSTALL_STUB_LIB - # Command to execute to install a stub library. # STLIB_LD - Base command to use for combining object files # into a static library. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol defaults to # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on some # SunOS systems, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS # TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the # tclConfig.sh, since they are only used for the build # of Tcl and Tk. # Examples: MacOS X records the library version and # compatibility version in the shared library. But # of course the Tcl version of this is only used for Tcl. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_LIBS - # Libs to use when linking Tcl shell or some other # shell that includes Tcl libs. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_CFLAGS], [ # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, AS_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, AS_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) # Force 64bit on with VIS AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes]) # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. AC_CACHE_CHECK([if compiler supports visibility "hidden"], tcl_cv_cc_visibility_hidden, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {}]], [[f();]])], [tcl_cv_cc_visibility_hidden=yes], [tcl_cv_cc_visibility_hidden=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ AC_DEFINE(MODULE_SCOPE, [extern __attribute__((__visibility__("hidden")))], [Compiler support for module scope symbols]) AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols]) ]) # Step 0.d: Disable -rpath support? AC_MSG_CHECKING([if rpath support is requested]) AC_ARG_ENABLE(rpath, AS_HELP_STRING([--disable-rpath], [disable rpath support (default: on)]), [doRpath=$enableval], [doRpath=yes]) AC_MSG_RESULT([$doRpath]) # Step 1: set the variable "system" to hold the name and version number # for the system. SC_CONFIG_SYSTEM # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # 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] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" case "${CC}" in *++|*++-*) ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac ], [ CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" ]) AC_CHECK_TOOL(AR, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" AS_IF([test "x${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"]) case $system in AIX-*) AS_IF([test "$GCC" != "yes"], [ # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'` ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) ]) LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # ldAix No longer needed with use of -bexpall/-brtl # but some extensions may still reference it LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported with GCC on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" ]) ]) AS_IF([test "`uname -m`" = ia64], [ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" AS_IF([test "$GCC" = yes], [ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ], [ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' ]) LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ], [ AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared -Wl,-bexpall' ], [ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" ]) SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*|MINGW32_*|MSYS_*) SHLIB_CFLAGS="-fno-common" SHLIB_LD='${CC} -shared -Wl,--out-implib,$(patsubst cyg%.dll,lib%.dll,$[@]).a' SHLIB_SUFFIX=".dll" DL_OBJS="tclLoadDl.o" PLAT_OBJS='${CYGWIN_OBJS}' PLAT_SRCS='${CYGWIN_SRCS}' DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" AC_CACHE_CHECK(for Cygwin version of gcc, ac_cv_cygwin, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef __CYGWIN__ #error cygwin #endif ]], [[]])], [ac_cv_cygwin=no], [ac_cv_cygwin=yes]) ) if test "$ac_cv_cygwin" = "no"; then AC_MSG_ERROR([${CC} is not a cygwin compiler.]) fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32" # The eval makes quoting arguments work. if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix then : else { echo "configure: error: configure failed for ../win" 1>&2; exit 1; } fi fi ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"]) ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) LIBS="$LIBS -lxnet" # Use the XOPEN network library AS_IF([test "`uname -m`" = ia64], [ SHLIB_SUFFIX=".so" ], [ SHLIB_SUFFIX=".sl" ]) AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ], [ CFLAGS="$CFLAGS -z" ]) # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = "yes"], [ AS_IF([test "$GCC" = yes], [ case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac ], [ do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" ]) ]) ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AC_LIBOBJ(mkstemp) AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AC_LIBOBJ(mkstemp) AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AS_IF([test "$GCC" = yes], [ CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" ], [ case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" ]) ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AC_LIBOBJ(mkstemp) AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported by gcc]) ], [ do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" ]) ]) ;; Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) SHLIB_CFLAGS="-fPIC -fno-common" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) AS_IF([test $do64bit = yes], [ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_m64 = yes], [ CFLAGS="$CFLAGS -m64" do64bit_ok=yes ]) ]) # The combo of gcc + glibc has a bug related to inlining of # functions like strtol()/strtoul(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"]) ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; Darwin-*) CFLAGS_OPTIMIZE="-O2" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" AS_IF([test $do64bit = yes], [ case `arch` in ppc) AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], tcl_cv_cc_arch_ppc64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes ]);; i386|x86_64) AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], tcl_cv_cc_arch_x86_64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [ CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes ]);; arm64) AC_CACHE_CHECK([if compiler accepts -arch arm64 flag], tcl_cv_cc_arch_arm64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch arm64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_arch_arm64=yes],[tcl_cv_cc_arch_arm64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_arm64 = yes], [ CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes ]);; *) AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; esac ], [ # Check for combined 32-bit and 64-bit fat build AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ fat_32_64=yes]) ]) SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [tcl_cv_ld_search_paths_first=yes], [tcl_cv_ld_search_paths_first=no]) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_search_paths_first = yes], [ LDFLAGS="$LDFLAGS -Wl,-search_paths_first" ]) AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ AC_DEFINE(MODULE_SCOPE, [__private_extern__], [Compiler support for module scope symbols]) tcl_cv_cc_visibility_hidden=yes ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH" AC_DEFINE(MAC_OSX_TCL, 1, [Is this a Mac I see before me?]) PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' AC_MSG_CHECKING([whether to use CoreFoundation]) AC_ARG_ENABLE(corefoundation, AS_HELP_STRING([--enable-corefoundation], [use CoreFoundation API on MacOSX (default: on)]), [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) AC_MSG_RESULT([$tcl_corefoundation]) AS_IF([test $tcl_corefoundation = yes], [ AC_CACHE_CHECK([for CoreFoundation.framework], tcl_cv_lib_corefoundation, [ hold_libs=$LIBS AS_IF([test "$fat_32_64" = yes], [ for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit # archs from CFLAGS et al. while testing for # presence of CF. 64-bit CF is disabled in # tclUnixPort.h if necessary. eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done]) LIBS="$LIBS -framework CoreFoundation" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[CFBundleRef b = CFBundleGetMainBundle();]])], [tcl_cv_lib_corefoundation=yes], [tcl_cv_lib_corefoundation=no]) AS_IF([test "$fat_32_64" = yes], [ for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done]) LIBS=$hold_libs]) AS_IF([test $tcl_cv_lib_corefoundation = yes], [ LIBS="$LIBS -framework CoreFoundation" AC_DEFINE(HAVE_COREFOUNDATION, 1, [Do we have access to Darwin CoreFoundation.framework?]) ], [tcl_corefoundation=no]) AS_IF([test "$fat_32_64" = yes -a $tcl_corefoundation = yes],[ AC_CACHE_CHECK([for 64-bit CoreFoundation], tcl_cv_lib_corefoundation_64, [ for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[CFBundleRef b = CFBundleGetMainBundle();]])], [tcl_cv_lib_corefoundation_64=yes], [tcl_cv_lib_corefoundation_64=no]) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done]) AS_IF([test $tcl_cv_lib_corefoundation_64 = no], [ AC_DEFINE(NO_COREFOUNDATION_64, 1, [Is Darwin CoreFoundation unavailable for 64-bit?]) LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" ]) ]) ]) ;; OS/390-*) SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" AS_IF([test "$SHARED_BUILD" = 1], [ SHLIB_LD='${CC} -shared' ], [ SHLIB_LD='${CC} -non_shared' ]) SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) # see pthread_intro(3) for pthread support on osf1, k.furukawa CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` AS_IF([test "$GCC" = yes], [ LIBS="$LIBS -lpthread -lmach -lexc" ], [ CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ]) ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. AS_IF([test "$GCC" = yes], [ SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" ], [ SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" ]) SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ], [ SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ arch=`isainfo` AS_IF([test "$arch" = "sparcv9 sparc"], [ AS_IF([test "$GCC" = yes], [ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" ]) ], [ do64bit_ok=yes AS_IF([test "$do64bitVIS" = yes], [ CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" ], [ CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" ]) # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" ]) ], [AS_IF([test "$arch" = "amd64 i386"], [ AS_IF([test "$GCC" = yes], [ case $system in SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]);; esac ], [ do64bit_ok=yes case $system in SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac ]) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- AS_IF([test "$GCC" = yes],[use_sunmath=no],[ arch=`isainfo` AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) AS_IF([test "$arch" = "amd64 i386" -o "$arch" = "i386"], [ AC_MSG_RESULT([yes]) MATH_LIBS="-lsunmath $MATH_LIBS" AC_CHECK_HEADER(sunmath.h) use_sunmath=yes ], [ AC_MSG_RESULT([no]) use_sunmath=no ]) ]) SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "$do64bit_ok" = yes], [ AS_IF([test "$arch" = "sparcv9 sparc"], [ # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" ], [AS_IF([test "$arch" = "amd64 i386"], [ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" ])]) ]) ], [ AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) case $system in SunOS-5.[[1-9]][[0-9]]*|SunOS-5.[[7-9]]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ]) ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no]) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_Bexport = yes], [ LDFLAGS="$LDFLAGS -Wl,-Bexport" ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) ]) AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = yes], [ AC_DEFINE(TCL_CFG_DO64BIT, 1, [Is this a 64-bit build?]) ]) dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so dnl # until the end of configure, as configure's compile and link tests use dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's dnl # preprocessing tests use only CPPFLAGS. AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, AS_HELP_STRING([--enable-load], [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) AS_IF([test "$tcl_ok" = no], [DL_OBJS=""]) AS_IF([test "x$DL_OBJS" != x], [BUILD_DLTEST="\$(DLTEST_TARGETS)"], [ AC_MSG_WARN([Can't figure out how to do dynamic loading or shared libraries on this system.]) SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" ]) LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. AS_IF([test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes], [ case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*|MSYS_*) ;; HP-UX*) ;; Darwin-*) ;; IRIX*) ;; Linux*|GNU*) ;; NetBSD-*|OpenBSD-*) ;; OSF1-*) ;; SCO_SV-3.2*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac]) AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ AC_DEFINE(MODULE_SCOPE, [extern], [No Compiler support for module scope symbols]) ]) AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [ SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}']) AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ UNSHARED_LIB_SUFFIX='${VERSION}.a']) DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [ LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ]) ], [ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} AS_IF([test "$RANLIB" = ""], [ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}' ], [ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@' ]) INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ]) # Stub lib does not depend on shared/static configuration AS_IF([test "$RANLIB" = ""], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}' ], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@' ]) INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. AS_IF([test "x${TCL_LIBS}" = x], [ TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"]) AC_SUBST(TCL_LIBS) # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. AC_CACHE_CHECK(for cast to union support, tcl_cv_cast_to_union, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ union foo { int i; double d; }; union foo f = (union foo) (int) 0; ]])], [tcl_cv_cast_to_union=yes], [tcl_cv_cast_to_union=no]) ) if test "$tcl_cv_cast_to_union" = "yes"; then AC_DEFINE(HAVE_CAST_TO_UNION, 1, [Defined when compiler supports casting to union type.]) fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" AC_CACHE_CHECK(for working -fno-lto, ac_cv_nolto, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [ac_cv_nolto=yes], [ac_cv_nolto=no]) ) CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi AC_CACHE_CHECK([if the compiler understands -finput-charset], tcl_cv_cc_input_charset, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_input_charset=yes],[tcl_cv_cc_input_charset=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi # Check for vfork, posix_spawnp() and friends unconditionally AC_CHECK_FUNCS(vfork posix_spawnp posix_spawn_file_actions_adddup2 posix_spawnattr_setflags) # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. AC_SUBST(DL_LIBS) AC_SUBST(DL_OBJS) AC_SUBST(PLAT_OBJS) AC_SUBST(PLAT_SRCS) AC_SUBST(LDAIX_SRC) AC_SUBST(CFLAGS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(CFLAGS_NOLTO) AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) AC_SUBST(CC_SEARCH_FLAGS) AC_SUBST(LD_SEARCH_FLAGS) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(TCL_SHLIB_LD_EXTRAS) AC_SUBST(TK_SHLIB_LD_EXTRAS) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_SUFFIX) AC_DEFINE_UNQUOTED(TCL_SHLIB_EXT,"${SHLIB_SUFFIX}", [What is the default extension for shared libraries?]) AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(INSTALL_LIB) AC_SUBST(DLL_INSTALL_DIR) AC_SUBST(INSTALL_STUB_LIB) AC_SUBST(RANLIB) ]) #-------------------------------------------------------------------- # SC_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol or strtoul in some # versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H # HAVE_STRING_H ? # #-------------------------------------------------------------------- AC_DEFUN([SC_MISSING_POSIX_HEADERS], [ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_CHECK_HEADERS([sys/param.h]) ]) #-------------------------------------------------------------------- # SC_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # #-------------------------------------------------------------------- AC_DEFUN([SC_PATH_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[],[not_really_there="yes"]) else if test ! -r $x_includes/X11/Xlib.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[found_xincludes="yes"],[found_xincludes="no"]) if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Xlib.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test "$found_xincludes" = "no"; then AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi ]) #-------------------------------------------------------------------- # SC_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([SC_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) SC_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) case $system in OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([SC_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_tzadj;]])], [tcl_cv_member_tm_tzadj=yes], [tcl_cv_member_tm_tzadj=no])]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_gmtoff;]])], [tcl_cv_member_tm_gmtoff=yes], [tcl_cv_member_tm_gmtoff=no])]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[extern long timezone; timezone += 1; exit (0);]])], [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[extern time_t timezone; timezone += 1; exit (0);]])], [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # SC_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm), socket stuff (-lsocket vs. # -lnsl), zlib (-lz) and libtommath (-ltommath) or thread library # (-lpthread) are dealt with here. # # Arguments: # None. # # Results: # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # _REENTRANT # _THREAD_SAFE # # Might append to the following vars: # LIBS # MATH_LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, _ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else AC_MSG_WARN([Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile...]) fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork) LIBS=$ac_saved_libs ]) #-------------------------------------------------------------------- # SC_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _FILE_OFFSET_BITS # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[ ]$2]], [[$3]])], [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)])) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([SC_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include ], [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # SC_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # HAVE_STRUCT_DIRENT64, HAVE_DIR64 # HAVE_TYPE_OFF64_T # _TIME_BITS # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([if 'long' and 'long long' have the same size (64-bit)?]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if we could use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) { case 1: case (sizeof(long long)==sizeof(long)): ; }]])],[tcl_cv_type_64bit="long long"],[])]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) # Now check for auxiliary declarations AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], [tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])]) if test "x${tcl_cv_time_t_64}" = "xno" ; then # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 # which SC_TCL_EARLY_FLAGS has defined if necessary. AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64 #include ]], [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], [tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])]) if test "x${tcl_cv__time_bits}" = "xyes" ; then AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.]) fi fi AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct dirent64 p;]])], [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d);]])], [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) if test "x${tcl_cv_DIR64}" = "xyes" ; then AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in ?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[off64_t offset; ]])], [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])]) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ]) #-------------------------------------------------------------------- # SC_TCL_CFG_ENCODING TIP #59 # # Declare the encoding to use for embedded configuration information. # # Arguments: # None. # # Results: # Might append to the following vars: # DEFS (implicit) # # Will define the following vars: # TCL_CFGVAL_ENCODING # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_CFG_ENCODING], [ AC_ARG_WITH(encoding, AS_HELP_STRING([--with-encoding], [encoding for configuration values (default: utf-8)]), [with_tcencoding=${withval}]) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}", [What encoding should be used for embedded configuration info?]) else AC_DEFINE(TCL_CFGVAL_ENCODING,"utf-8", [What encoding should be used for embedded configuration info?]) fi ]) #-------------------------------------------------------------------- # SC_TCL_CHECK_BROKEN_FUNC # # Check for broken function. # # Arguments: # funcName - function to test for # advancedTest - the advanced test to run if the function is present # # Results: # Might cause compatibility versions of the function to be used. # Might affect the following vars: # USE_COMPAT (implicit) # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[ AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0) if test ["$tcl_ok"] = 1; then AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken], AC_RUN_IFELSE([AC_LANG_SOURCE([[[ #include #include int main() {]$2[}]]])],[tcl_cv_$1_unbroken=ok], [tcl_cv_$1_unbroken=broken],[tcl_cv_$1_unbroken=unknown])) if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then tcl_ok=1 else tcl_ok=0 fi fi if test ["$tcl_ok"] = 0; then AC_LIBOBJ($1) USE_COMPAT=1 fi ]) #-------------------------------------------------------------------- # SC_TCL_GETHOSTBYADDR_R # # Check if we have MT-safe variant of gethostbyaddr(). # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETHOSTBYADDR_R # HAVE_GETHOSTBYADDR_R_7 # HAVE_GETHOSTBYADDR_R_8 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [ # Avoids picking hidden internal symbol from libc SC_TCL_GETHOSTBYADDR_R_DECL if test "$tcl_cv_api_gethostbyaddr_r" = yes; then SC_TCL_GETHOSTBYADDR_R_TYPE fi ]) AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_DECL], [AC_CHECK_DECLS(gethostbyaddr_r, [ tcl_cv_api_gethostbyaddr_r=yes],[tcl_cv_api_gethostbyaddr_r=no],[#include ]) ]) AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [ AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char *addr; int length; int type; struct hostent *result; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop); ]])],[tcl_cv_api_gethostbyaddr_r_7=yes],[tcl_cv_api_gethostbyaddr_r_7=no])]) tcl_ok=$tcl_cv_api_gethostbyaddr_r_7 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [Define to 1 if gethostbyaddr_r takes 7 args.]) else AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char *addr; int length; int type; struct hostent *result, *resultp; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop); ]])],[tcl_cv_api_gethostbyaddr_r_8=yes],[tcl_cv_api_gethostbyaddr_r_8=no])]) tcl_ok=$tcl_cv_api_gethostbyaddr_r_8 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [Define to 1 if gethostbyaddr_r takes 8 args.]) fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1, [Define to 1 if gethostbyaddr_r is available.]) fi ])]) #-------------------------------------------------------------------- # SC_TCL_GETHOSTBYNAME_R # # Check to see what variant of gethostbyname_r() we have. # Based on David Arnold's example from the comp.programming.threads # FAQ Q213 # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETHOSTBYNAME_R # HAVE_GETHOSTBYNAME_R_3 # HAVE_GETHOSTBYNAME_R_5 # HAVE_GETHOSTBYNAME_R_6 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [ # Avoids picking hidden internal symbol from libc SC_TCL_GETHOSTBYNAME_R_DECL if test "$tcl_cv_api_gethostbyname_r" = yes; then SC_TCL_GETHOSTBYNAME_R_TYPE fi ]) AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_DECL], [AC_CHECK_DECLS(gethostbyname_r, [ tcl_cv_api_gethostbyname_r=yes],[tcl_cv_api_gethostbyname_r=no],[#include ]) ]) AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [ AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char *name; struct hostent *he, *res; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop); ]])],[tcl_cv_api_gethostbyname_r_6=yes],[tcl_cv_api_gethostbyname_r_6=no])]) tcl_ok=$tcl_cv_api_gethostbyname_r_6 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [Define to 1 if gethostbyname_r takes 6 args.]) else AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char *name; struct hostent *he; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop); ]])],[tcl_cv_api_gethostbyname_r_5=yes],[tcl_cv_api_gethostbyname_r_5=no])]) tcl_ok=$tcl_cv_api_gethostbyname_r_5 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [Define to 1 if gethostbyname_r takes 5 args.]) else AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char *name; struct hostent *he; struct hostent_data data; (void) gethostbyname_r(name, he, &data); ]])],[tcl_cv_api_gethostbyname_r_3=yes],[tcl_cv_api_gethostbyname_r_3=no])]) tcl_ok=$tcl_cv_api_gethostbyname_r_3 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [Define to 1 if gethostbyname_r takes 3 args.]) fi fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, [Define to 1 if gethostbyname_r is available.]) fi ])]) #-------------------------------------------------------------------- # SC_TCL_GETPWUID_R # # Check if we have MT-safe variant of getpwuid() and if yes, # which one exactly. # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETPWUID_R # HAVE_GETPWUID_R_4 # HAVE_GETPWUID_R_5 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [ AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ uid_t uid; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwuid_r(uid, &pw, buf, buflen, &pwp); ]])],[tcl_cv_api_getpwuid_r_5=yes],[tcl_cv_api_getpwuid_r_5=no])]) tcl_ok=$tcl_cv_api_getpwuid_r_5 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWUID_R_5, 1, [Define to 1 if getpwuid_r takes 5 args.]) else AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ uid_t uid; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(uid, &pw, buf, buflen); ]])],[tcl_cv_api_getpwuid_r_4=yes],[tcl_cv_api_getpwuid_r_4=no])]) tcl_ok=$tcl_cv_api_getpwuid_r_4 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWUID_R_4, 1, [Define to 1 if getpwuid_r takes 4 args.]) fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWUID_R, 1, [Define to 1 if getpwuid_r is available.]) fi ])]) #-------------------------------------------------------------------- # SC_TCL_GETPWNAM_R # # Check if we have MT-safe variant of getpwnam() and if yes, # which one exactly. # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETPWNAM_R # HAVE_GETPWNAM_R_4 # HAVE_GETPWNAM_R_5 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [ AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ char *name; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwnam_r(name, &pw, buf, buflen, &pwp); ]])],[tcl_cv_api_getpwnam_r_5=yes],[tcl_cv_api_getpwnam_r_5=no])]) tcl_ok=$tcl_cv_api_getpwnam_r_5 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWNAM_R_5, 1, [Define to 1 if getpwnam_r takes 5 args.]) else AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ char *name; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(name, &pw, buf, buflen); ]])],[tcl_cv_api_getpwnam_r_4=yes],[tcl_cv_api_getpwnam_r_4=no])]) tcl_ok=$tcl_cv_api_getpwnam_r_4 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWNAM_R_4, 1, [Define to 1 if getpwnam_r takes 4 args.]) fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETPWNAM_R, 1, [Define to 1 if getpwnam_r is available.]) fi ])]) #-------------------------------------------------------------------- # SC_TCL_GETGRGID_R # # Check if we have MT-safe variant of getgrgid() and if yes, # which one exactly. # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETGRGID_R # HAVE_GETGRGID_R_4 # HAVE_GETGRGID_R_5 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [ AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ gid_t gid; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrgid_r(gid, &gr, buf, buflen, &grp); ]])],[tcl_cv_api_getgrgid_r_5=yes],[tcl_cv_api_getgrgid_r_5=no])]) tcl_ok=$tcl_cv_api_getgrgid_r_5 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRGID_R_5, 1, [Define to 1 if getgrgid_r takes 5 args.]) else AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ gid_t gid; struct group gr; char buf[512]; int buflen = 512; (void)getgrgid_r(gid, &gr, buf, buflen); ]])],[tcl_cv_api_getgrgid_r_4=yes],[tcl_cv_api_getgrgid_r_4=no])]) tcl_ok=$tcl_cv_api_getgrgid_r_4 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRGID_R_4, 1, [Define to 1 if getgrgid_r takes 4 args.]) fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRGID_R, 1, [Define to 1 if getgrgid_r is available.]) fi ])]) #-------------------------------------------------------------------- # SC_TCL_GETGRNAM_R # # Check if we have MT-safe variant of getgrnam() and if yes, # which one exactly. # # Arguments: # None # # Results: # # Might define the following vars: # HAVE_GETGRNAM_R # HAVE_GETGRNAM_R_4 # HAVE_GETGRNAM_R_5 # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [ AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ char *name; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrnam_r(name, &gr, buf, buflen, &grp); ]])],[tcl_cv_api_getgrnam_r_5=yes],[tcl_cv_api_getgrnam_r_5=no])]) tcl_ok=$tcl_cv_api_getgrnam_r_5 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRNAM_R_5, 1, [Define to 1 if getgrnam_r takes 5 args.]) else AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ char *name; struct group gr; char buf[512]; int buflen = 512; (void)getgrnam_r(name, &gr, buf, buflen); ]])],[tcl_cv_api_getgrnam_r_4=yes],[tcl_cv_api_getgrnam_r_4=no])]) tcl_ok=$tcl_cv_api_getgrnam_r_4 if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRNAM_R_4, 1, [Define to 1 if getgrnam_r takes 4 args.]) fi fi if test "$tcl_ok" = yes; then AC_DEFINE(HAVE_GETGRNAM_R, 1, [Define to 1 if getgrnam_r is available.]) fi ])]) AC_DEFUN([SC_TCL_IPV6],[ NEED_FAKE_RFC2553=0 AC_CHECK_FUNCS(getnameinfo getaddrinfo freeaddrinfo gai_strerror,,[NEED_FAKE_RFC2553=1]) AC_CHECK_TYPES([ struct addrinfo, struct in6_addr, struct sockaddr_in6, struct sockaddr_storage],,[NEED_FAKE_RFC2553=1],[[ #include #include #include #include ]]) if test "x$NEED_FAKE_RFC2553" = "x1"; then AC_DEFINE([NEED_FAKE_RFC2553], 1, [Use compat implementation of getaddrinfo() and friends]) AC_LIBOBJ([fake-rfc2553]) AC_CHECK_FUNC(strlcpy) fi ]) #------------------------------------------------------------------------ # SC_CC_FOR_BUILD # For cross compiles, locate a C compiler that can generate native binaries. # # Arguments: # none # # Results: # Substitutes the following vars: # CC_FOR_BUILD # EXEEXT_FOR_BUILD #------------------------------------------------------------------------ dnl Get a default for CC_FOR_BUILD to put into Makefile. AC_DEFUN([AX_CC_FOR_BUILD],[# Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else AC_MSG_CHECKING([for gcc]) AC_CACHE_VAL(ac_cv_path_cc, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/gcc 2> /dev/null` \ `ls -r $dir/gcc 2> /dev/null` ; do if test x"$ac_cv_path_cc" = x ; then if test -f "$j" ; then ac_cv_path_cc=$j break fi fi done done ]) fi fi AC_SUBST(CC_FOR_BUILD) # Also set EXEEXT_FOR_BUILD. if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, [rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; esac done rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi AC_SUBST(EXEEXT_FOR_BUILD)])dnl AC_SUBST(OBJEXT_FOR_BUILD)])dnl ]) #------------------------------------------------------------------------ # SC_ZIPFS_SUPPORT # Locate a zip encoder installed on the system path, or none. # # Arguments: # none # # Results: # Substitutes the following vars: # MACHER_PROG # ZIP_PROG # ZIP_PROG_OPTIONS # ZIP_PROG_VFSSEARCH # ZIP_INSTALL_OBJS #------------------------------------------------------------------------ AC_DEFUN([SC_ZIPFS_SUPPORT], [ MACHER_PROG="" ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" AC_MSG_CHECKING([for macher]) AC_CACHE_VAL(ac_cv_path_macher, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/macher 2> /dev/null` \ `ls -r $dir/macher 2> /dev/null` ; do if test x"$ac_cv_path_macher" = x ; then if test -f "$j" ; then ac_cv_path_macher=$j break fi fi done done ]) if test -f "$ac_cv_path_macher" ; then MACHER_PROG="$ac_cv_path_macher" AC_MSG_RESULT([$MACHER_PROG]) else AC_MSG_RESULT([Macher not found]) fi AC_MSG_CHECKING([for zip]) AC_CACHE_VAL(ac_cv_path_zip, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ]) if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" AC_MSG_RESULT([$ZIP_PROG]) ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" AC_MSG_RESULT([No zip found on PATH. Building minizip]) fi AC_SUBST(MACHER_PROG) AC_SUBST(ZIP_PROG) AC_SUBST(ZIP_PROG_OPTIONS) AC_SUBST(ZIP_PROG_VFSSEARCH) AC_SUBST(ZIP_INSTALL_OBJS) ]) # Local Variables: # mode: autoconf # End: tcl9.0.3/unix/README0000644000175000017500000002017015104661341013412 0ustar sergeisergeiTcl UNIX README --------------- This is the directory where you configure, compile, test, and install UNIX versions of Tcl. This directory also contains source files for Tcl that are specific to UNIX. Some of the files in this directory are used on the PC or MacOSX platform too, but they all depend on UNIX (POSIX/ANSI C) interfaces and some of them only make sense under UNIX. Updated forms of the information found in this file is available at: https://www.tcl-lang.org/doc/howto/compile.html#unix For information on platforms where Tcl is known to compile, along with any porting notes for getting it to work on those platforms, see: https://www.tcl-lang.org/software/tcltk/platforms.html The rest of this file contains instructions on how to do this. The release should compile and run either "out of the box" or with trivial changes on any UNIX-like system that approximates POSIX, BSD, or System V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To compile for MacOSX, see the README file in the directory ../macosx. How To Compile And Install Tcl: ------------------------------- (a) If you have already compiled Tcl once in this directory and are now preparing to compile again in the same directory but for a different platform, or if you have applied patches, type "make distclean" to discard all the configuration information computed previously. (b) If you need to reconfigure because you changed any of the .in or .m4 files, you will need to run autoconf to create a new ./configure script. Most users will NOT need to do this since a configure script is already provided. (in the tcl/unix directory) autoconf (c) Type "./configure". This runs a configuration script created by GNU autoconf, which configures Tcl for your system and creates a Makefile. The configure script allows you to customize the Tcl configuration for your site; for details on how you can do this, type "./configure --help" or refer to the autoconf documentation (not included here). Tcl's "configure" supports the following special switches in addition to the standard ones: --disable-load If this switch is specified then Tcl will configure itself not to allow dynamic loading, even if your system appears to support it. Normally you can leave this switch out and Tcl will build itself for dynamic loading if your system supports it. --disable-dll-unloading Disables support for the [unload] command even on platforms that can support it. Meaningless when Tcl is compiled with --disable-load. --enable-shared If this switch is specified, Tcl will compile itself as a shared library if it can figure out how to do that on this platform. This is the default on platforms where we know how to build shared libraries. --disable-shared If this switch is specified, Tcl will compile itself as a static library. --enable-symbols Build with debugging symbols. By default standard debugging symbols are used. You can specify the value "mem" to include TCL_MEM_DEBUG memory debugging, "compile" to include TCL_COMPILE_DEBUG debugging, or "all" to enable all internal debugging. --disable-symbols Build without debugging symbols --enable-64bit Enable 64bit support (where applicable) --disable-64bit Disable 64bit support (where applicable) --enable-64bit-vis Enable 64bit Sparc VIS support --disable-64bit-vis Disable 64bit Sparc VIS support --enable-langinfo Allows use of modern nl_langinfo check for better localization support. This is on by default on platforms where nl_langinfo is found. --disable-langinfo Specifically disables use of nl_langinfo. --enable-man-symlinks Use symlinks for linking the manpages that should be reachable under several names. --enable-man-suffix[=STRING] Append STRING to the names of installed manual pages (prior to applying compression, if that is also enabled). If STRING is omitted, defaults to 'tcl'. --enable-man-compression=PROG Compress the manpages using PROG. --enable-dtrace Enable tcl DTrace provider (if DTrace is available on the platform), c.f. tclDTrace.d for descriptions of the probes made available, see https://wiki.tcl-lang.org/page/DTrace for more details --with-encoding=ENCODING Specifies the encoding for compile-time configuration values. Defaults to utf-8, which is also sufficient for ASCII. --with-tzdata=FLAG Specifies whether to install timezone data. By default, the configure script tries to detect whether a usable timezone database is present on the system already. Mac OS X only (i.e. completely unsupported on other platforms): --enable-framework Package Tcl as a framework. --disable-corefoundation Disable use of CoreFoundation API and revert to standard select based notifier, required when using naked fork (i.e. not followed by execve). Note: by default gcc will be used if it can be located on the PATH. If you want to use cc instead of gcc, set the CC environment variable to "cc" before running configure. It is not safe to edit the Makefile to use gcc after configure is run. Also note that you should use the same compiler when building extensions. Note: be sure to use only absolute path names (those starting with "/") in the --prefix and --exec-prefix options. (d) Type "make". This will create a library archive called "libtcl.a" or "libtcl.so" and an interpreter application called "tclsh" that allows you to type Tcl commands interactively or execute script files. It will also create a stub library archive "libtclstub.a" that developers may link against other C code to produce loadable extensions for Tcl. (e) If the make fails then you'll have to personalize the Makefile for your site or possibly modify the distribution in other ways. First check the porting Web page above to see if there are hints for compiling on your system. If you need to modify Makefile, there are comments at the beginning of it that describe the things you might want to change and how to change them. (f) Type "make install" to install Tcl binaries and script files in standard places. You'll need write permission on the installation directories to do this. The installation directories are determined by the "configure" script and may be specified with the standard --prefix and --exec-prefix options to "configure". See the Makefile for information on what directories were chosen; you can override these choices by modifying the "prefix" and "exec_prefix" variables in the Makefile. The installed binaries have embedded within them path values relative to the install directory. If you change your mind about where Tcl should be installed, start this procedure over again from step (a) so that the path embedded in the binaries agrees with the install location. (g) At this point you can play with Tcl by running the installed "tclsh" executable, or via the "make shell" target, and typing Tcl commands at the interactive prompt. If you have trouble compiling Tcl, see the URL noted above about working platforms. It contains information that people have provided about changes they had to make to compile Tcl in various environments. We're also interested in hearing how to change the configuration setup so that Tcl compiles on additional platforms "out of the box". Test suite ---------- There is a relatively complete test suite for all of the Tcl core in the subdirectory "tests". To use it just type "make test" in this directory. You should then see a printout of the test files processed. If any errors occur, you'll see a much more substantial printout for each error. See the README file in the "tests" directory for more information on the test suite. Note: don't run the tests as superuser: this will cause several of them to fail. If a test is failing consistently, please send us a bug report with as much detail as you can manage to our tracker: https://core.tcl-lang.org/tcl/reportlist tcl9.0.3/unix/Makefile.in0000644000175000017500000026334315104661341014612 0ustar sergeisergei# # This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is # a template for a Makefile; to generate the actual Makefile, run # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ MINOR_VERSION = @TCL_MINOR_VERSION@ PATCH_LEVEL = @TCL_PATCH_LEVEL@ #-------------------------------------------------------------------------- # Things you can change to personalize the Makefile for your own site (you can # make these changes in either Makefile.in or Makefile, but changes to # Makefile will get lost if you re-run the configuration script). #-------------------------------------------------------------------------- # Default top-level directories in which to install architecture-specific # files (exec_prefix) and machine-independent files such as scripts (prefix). # The values specified here may be overridden at configure-time with the # --exec-prefix and --prefix options to the "configure" script. The *dir vars # are standard configure substitutions that are based off prefix and # exec_prefix. prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ runstatedir = @runstatedir@ mandir = @mandir@ # The following definition can be set to non-null for special systems like AFS # with replication. It allows the pathnames used for installation to be # different than those used for actually reference files at run-time. # INSTALL_ROOT is prepended to $prefix and $exec_prefix when installing files. INSTALL_ROOT = $(DESTDIR) # Path for the platform independent Tcl scripting libraries: TCL_LIBRARY = @TCL_LIBRARY@ # Path to use at runtime to refer to LIB_INSTALL_DIR: LIB_RUNTIME_DIR = $(libdir) # Directory in which to install the program tclsh: BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install libtcl.so or libtcl.a: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) DLL_INSTALL_DIR = @DLL_INSTALL_DIR@ # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY) # Path name to use when installing Tcl modules. MODULE_INSTALL_DIR = $(SCRIPT_INSTALL_DIR)/../tcl9 # Directory in which to install the include file tcl.h: INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) # Path to the private tcl header dir: PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@ # Directory in which to (optionally) install the private tcl headers: PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(PRIVATE_INCLUDE_DIR) # Top-level directory in which to install manual entries: MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir) # Directory in which to install manual entry for tclsh: MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1 # Directory in which to install manual entries for Tcl's C library procedures: MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 # Directory in which to install manual entries for the built-in Tcl commands: MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann # Path to the html documentation dir: HTML_DIR = @HTML_DIR@ # Directory in which to install html documentation: HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR) # Directory in which to install the configuration file tclConfig.sh CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) # Directory in which to install bundled packages: PACKAGE_DIR = @PACKAGE_DIR@ # Package search path. TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ # Tcl Module default path roots (TIP189). TCL_MODULE_PATH = @TCL_MODULE_PATH@ # warning flags CFLAGS_WARNING = @CFLAGS_WARNING@ # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ # To change the compiler switches, for example to change from optimization to # debugging symbols, change the following line: #CFLAGS = $(CFLAGS_DEBUG) #CFLAGS = $(CFLAGS_OPTIMIZE) #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) CFLAGS = @CFLAGS_DEFAULT@ @CFLAGS@ # Flags to pass to the linker LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ # If you use the setenv, putenv, or unsetenv procedures to modify environment # variables in your application and you'd like those modifications to appear # in the "env" Tcl variable, switch the comments on the two lines below so # that Tcl provides these procedures instead of your standard C library. ENV_FLAGS = #ENV_FLAGS = -DTclSetEnv=setenv -DTcl_PutEnv=putenv -DTclUnsetEnv=unsetenv # To enable memory debugging, call configure with --enable-symbols=mem # Warning: if you enable memory debugging, you must do it *everywhere*, # including all the code that calls Tcl, and you must use Tcl_Alloc and Tcl_Free # everywhere instead of malloc and free. TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ #TCL_STUB_LIB_FILE = libtclstub.a # Generic stub lib name used in rules that apply to tcl and tk STUB_LIB_FILE = ${TCL_STUB_LIB_FILE} TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ #TCL_STUB_LIB_FLAG = -ltclstub # To compile without backward compatibility and deprecated code uncomment the # following NO_DEPRECATED_FLAGS = #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED # Some versions of make, like SGI's, use the following variable to determine # which shell to use for executing commands: SHELL = @MAKEFILE_SHELL@ # Tcl used to let the configure script choose which program to use for # installing, but there are just too many different versions of "install" # around; better to use the install-sh script that comes with the # distribution, which is slower but guaranteed to work. INSTALL_STRIP_PROGRAM = strip INSTALL_STRIP_LIBRARY = strip -x INSTALL = $(SHELL) $(UNIX_DIR)/install-sh -c INSTALL_PROGRAM = ${INSTALL} -m 755 INSTALL_LIBRARY = ${INSTALL} -m 755 INSTALL_DATA = ${INSTALL} -m 644 INSTALL_DATA_DIR = ${INSTALL} -d -m 755 # NATIVE_TCLSH is the name of a tclsh executable that is available *BEFORE* # running make for the first time. Certain build targets (make genstubs) need # it to be available on the PATH. This executable should *NOT* be required # just to do a normal build although it can be required to run make dist. # Do not use SHELL_ENV for NATIVE_TCLSH unless it is the tclsh being built. EXE_SUFFIX = @EXEEXT@ TCL_EXE = tclsh${EXE_SUFFIX} TCLTEST_EXE = tcltest${EXE_SUFFIX} NATIVE_TCLSH = @TCLSH_PROG@ # The symbols below provide support for dynamic loading and shared libraries. # See configure.ac for a description of what the symbols mean. The values of # the symbols are normally set by the configure script. You shouldn't normally # need to modify any of these definitions by hand. STLIB_LD = @STLIB_LD@ SHLIB_LD = @SHLIB_LD@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ TCL_SHLIB_LD_EXTRAS = @TCL_SHLIB_LD_EXTRAS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ DLTEST_TARGETS = dltest.marker # Additional search flags needed to find the various shared libraries at # run-time. The first symbol is for use when creating a binary with cc, and # the second is for use when running ld directly. CC_SEARCH_FLAGS = @CC_SEARCH_FLAGS@ LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@ # The following symbol is defined to "$(DLTEST_TARGETS)" if dynamic loading is # available; this causes everything in the "dltest" subdirectory to be built # when making "tcltest. If dynamic loading isn't available, configure defines # this symbol to an empty string, in which case the shared libraries aren't # built. BUILD_DLTEST = @BUILD_DLTEST@ #BUILD_DLTEST = TCL_LIB_FILE = @TCL_LIB_FILE@ #TCL_LIB_FILE = libtcl.a # Generic lib name used in rules that apply to tcl and tk LIB_FILE = ${TCL_LIB_FILE} TCL_LIB_FLAG = @TCL_LIB_FLAG@ #TCL_LIB_FLAG = -ltcl # support for embedded libraries on Darwin / Mac OS X DYLIB_INSTALL_DIR = $(libdir) #-------------------------------------------------------------------------- # The information below is modified by the configure script when Makefile is # generated from Makefile.in. You shouldn't normally modify any of this stuff # by hand. #-------------------------------------------------------------------------- COMPAT_OBJS = @LIBOBJS@ AC_FLAGS = @DEFS@ AR = @AR@ RANLIB = @RANLIB@ DTRACE = @DTRACE@ SRC_DIR = @srcdir@ TOP_DIR = @TCL_SRC_DIR@ BUILD_DIR = @builddir@ GENERIC_DIR = $(TOP_DIR)/generic COMPAT_DIR = $(TOP_DIR)/compat TOOL_DIR = $(TOP_DIR)/tools UNIX_DIR = $(TOP_DIR)/unix MAC_OSX_DIR = $(TOP_DIR)/macosx PKGS_DIR = $(TOP_DIR)/pkgs # Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below. DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest # Must be absolute to so the corresponding tcltest's tcl_library is absolute. TCL_BUILDTIME_LIBRARY = @TCL_BUILDTIME_LIBRARY@ ZLIB_DIR = ${COMPAT_DIR}/zlib ZLIB_INCLUDE = @ZLIB_INCLUDE@ TOMMATH_DIR = $(TOP_DIR)/libtommath TOMMATH_INCLUDE = @TOMMATH_INCLUDE@ CC = @CC@ OBJEXT = @OBJEXT@ #CC = purify -best-effort @CC@ -DPURIFY # Flags to be passed to installManPage to control how the manpages should be # installed (symlinks, compression, package name suffix). MAN_FLAGS = @MAN_FLAGS@ # If non-empty, install the timezone files that are included with Tcl, # otherwise use the ones that ship with the OS. INSTALL_TZDATA = @INSTALL_TZDATA@ #-------------------------------------------------------------------------- # The information below is usually usable as is. The configure script won't # modify it and it only exists to make working around selected rare system # configurations easier. #-------------------------------------------------------------------------- GDB = gdb LLDB = lldb TRACE = strace TRACE_OPTS = VALGRIND = valgrind VALGRINDARGS = --tool=memcheck --num-callers=24 \ --leak-resolution=high --leak-check=yes --show-reachable=yes -v \ --keep-debuginfo=yes \ --suppressions=$(TOOL_DIR)/valgrind_suppress #-------------------------------------------------------------------------- # The information below should be usable as is. The configure script won't # modify it and you shouldn't need to modify it either. #-------------------------------------------------------------------------- STUB_CC_SWITCHES = -I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \ ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ \ ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS CC_SWITCHES = $(STUB_CC_SWITCHES) -DBUILD_tcl APP_CC_SWITCHES = $(STUB_CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@ LIBS = @TCL_LIBS@ DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ ${AC_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ TCLSH_OBJS = tclAppInit.o TCLTEST_OBJS = tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \ tclMutexTest.o tclThreadTest.o tclUnixTest.o tclTestABSList.o XTTEST_OBJS = xtTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \ tclMutexTest.o tclThreadTest.o tclUnixTest.o tclXtNotify.o tclXtTest.o \ tclTestABSList.o GENERIC_OBJS = regcomp.o regexec.o regfree.o regerror.o tclAlloc.o \ tclArithSeries.o tclAssembly.o tclAsync.o tclBasic.o tclBinary.o \ tclCkalloc.o tclClock.o tclClockFmt.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o \ tclCompCmds.o tclCompCmdsGR.o tclCompCmdsSZ.o tclCompExpr.o \ tclCompile.o tclConfig.o tclDate.o tclDictObj.o tclDisassemble.o \ tclEncoding.o tclEnsemble.o \ tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \ tclHash.o tclHistory.o \ tclIcu.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \ tclIORChan.o tclIORTrans.o tclIOGT.o tclIOSock.o tclIOUtil.o \ tclLink.o tclListObj.o \ tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \ tclObj.o tclOptimize.o tclPanic.o tclParse.o tclPathObj.o tclPipe.o \ tclPkg.o tclPkgConfig.o tclPosixStr.o \ tclPreserve.o tclProc.o tclProcess.o tclRegexp.o \ tclResolve.o tclResult.o tclScan.o tclStringObj.o tclStrIdxTree.o \ tclStrToD.o tclThread.o \ tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \ tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o tclZlib.o \ tclTomMathInterface.o tclZipfs.o OO_OBJS = tclOO.o tclOOBasic.o tclOOCall.o tclOODefineCmds.o tclOOInfo.o \ tclOOMethod.o tclOOProp.o tclOOStubInit.o TOMMATH_OBJS = bn_s_mp_reverse.o bn_s_mp_mul_digs_fast.o \ bn_s_mp_sqr_fast.o bn_mp_add.o bn_mp_and.o \ bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \ bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_copy.o \ bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_s_mp_div_3.o bn_mp_exch.o bn_mp_expt_n.o \ bn_mp_get_mag_u64.o \ bn_mp_grow.o bn_mp_init.o \ bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \ bn_mp_init_size.o bn_s_mp_karatsuba_mul.o \ bn_mp_init_i64.o bn_mp_init_u64.o \ bn_s_mp_karatsuba_sqr.o bn_s_mp_balance_mul.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \ bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o \ bn_mp_pack_count.o bn_mp_radix_size.o bn_mp_radix_smap.o \ bn_mp_set_i64.o bn_mp_read_radix.o bn_mp_rshd.o \ bn_mp_set_u64.o bn_mp_shrink.o \ bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_signed_rsh.o \ bn_mp_to_ubin.o bn_mp_unpack.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o bn_mp_to_radix.o \ bn_mp_ubin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \ bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o STUB_LIB_OBJS = tclStubLib.o \ tclStubCall.o \ tclStubLibTbl.o \ tclTomMathStubLib.o \ tclOOStubLib.o \ ${COMPAT_OBJS} UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \ tclUnixFile.o tclUnixPipe.o tclUnixSock.o \ tclUnixTime.o tclUnixInit.o tclUnixThrd.o \ tclUnixCompat.o NOTIFY_OBJS = tclEpollNotfy.o tclKqueueNotfy.o tclSelectNotfy.o MAC_OSX_OBJS = tclMacOSXBundle.o tclMacOSXFCmd.o tclMacOSXNotify.o CYGWIN_OBJS = tclWinError.o DTRACE_OBJ = tclDTrace.o ZLIB_OBJS = Zadler32.o Zcompress.o Zcrc32.o Zdeflate.o Zinfback.o \ Zinffast.o Zinflate.o Zinftrees.o Ztrees.o Zuncompr.o Zzutil.o TCL_OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} \ ${OO_OBJS} @DL_OBJS@ @PLAT_OBJS@ OBJS = ${TCL_OBJS} @DTRACE_OBJ@ @ZLIB_OBJS@ @TOMMATH_OBJS@ TCL_DECLS = \ $(GENERIC_DIR)/tcl.decls \ $(GENERIC_DIR)/tclInt.decls \ $(GENERIC_DIR)/tclOO.decls \ $(GENERIC_DIR)/tclTomMath.decls GENERIC_HDRS = \ $(GENERIC_DIR)/tcl.h \ $(GENERIC_DIR)/tclDecls.h \ $(GENERIC_DIR)/tclInt.h \ $(GENERIC_DIR)/tclIntDecls.h \ $(GENERIC_DIR)/tclIntPlatDecls.h \ $(GENERIC_DIR)/tclTomMath.h \ $(GENERIC_DIR)/tclTomMathDecls.h \ $(GENERIC_DIR)/tclOO.h \ $(GENERIC_DIR)/tclOODecls.h \ $(GENERIC_DIR)/tclOOInt.h \ $(GENERIC_DIR)/tclOOIntDecls.h \ $(GENERIC_DIR)/tclPatch.h \ $(GENERIC_DIR)/tclPlatDecls.h \ $(GENERIC_DIR)/tclPort.h \ $(GENERIC_DIR)/tclRegexp.h GENERIC_SRCS = \ $(GENERIC_DIR)/regcomp.c \ $(GENERIC_DIR)/regexec.c \ $(GENERIC_DIR)/regfree.c \ $(GENERIC_DIR)/regerror.c \ $(GENERIC_DIR)/tclAlloc.c \ $(GENERIC_DIR)/tclArithSeries.c \ $(GENERIC_DIR)/tclAssembly.c \ $(GENERIC_DIR)/tclAsync.c \ $(GENERIC_DIR)/tclBasic.c \ $(GENERIC_DIR)/tclBinary.c \ $(GENERIC_DIR)/tclCkalloc.c \ $(GENERIC_DIR)/tclClock.c \ $(GENERIC_DIR)/tclClockFmt.c \ $(GENERIC_DIR)/tclCmdAH.c \ $(GENERIC_DIR)/tclCmdIL.c \ $(GENERIC_DIR)/tclCmdMZ.c \ $(GENERIC_DIR)/tclCompCmds.c \ $(GENERIC_DIR)/tclCompCmdsGR.c \ $(GENERIC_DIR)/tclCompCmdsSZ.c \ $(GENERIC_DIR)/tclCompExpr.c \ $(GENERIC_DIR)/tclCompile.c \ $(GENERIC_DIR)/tclConfig.c \ $(GENERIC_DIR)/tclDate.c \ $(GENERIC_DIR)/tclDictObj.c \ $(GENERIC_DIR)/tclDisassemble.c \ $(GENERIC_DIR)/tclEncoding.c \ $(GENERIC_DIR)/tclEnsemble.c \ $(GENERIC_DIR)/tclEnv.c \ $(GENERIC_DIR)/tclEvent.c \ $(GENERIC_DIR)/tclExecute.c \ $(GENERIC_DIR)/tclFCmd.c \ $(GENERIC_DIR)/tclFileName.c \ $(GENERIC_DIR)/tclGet.c \ $(GENERIC_DIR)/tclHash.c \ $(GENERIC_DIR)/tclHistory.c \ $(GENERIC_DIR)/tclIcu.c \ $(GENERIC_DIR)/tclIndexObj.c \ $(GENERIC_DIR)/tclInterp.c \ $(GENERIC_DIR)/tclIO.c \ $(GENERIC_DIR)/tclIOCmd.c \ $(GENERIC_DIR)/tclIOGT.c \ $(GENERIC_DIR)/tclIOSock.c \ $(GENERIC_DIR)/tclIOUtil.c \ $(GENERIC_DIR)/tclIORChan.c \ $(GENERIC_DIR)/tclIORTrans.c \ $(GENERIC_DIR)/tclLink.c \ $(GENERIC_DIR)/tclListObj.c \ $(GENERIC_DIR)/tclLiteral.c \ $(GENERIC_DIR)/tclLoad.c \ $(GENERIC_DIR)/tclMain.c \ $(GENERIC_DIR)/tclNamesp.c \ $(GENERIC_DIR)/tclNotify.c \ $(GENERIC_DIR)/tclObj.c \ $(GENERIC_DIR)/tclOptimize.c \ $(GENERIC_DIR)/tclParse.c \ $(GENERIC_DIR)/tclPathObj.c \ $(GENERIC_DIR)/tclPipe.c \ $(GENERIC_DIR)/tclPkg.c \ $(GENERIC_DIR)/tclPkgConfig.c \ $(GENERIC_DIR)/tclPosixStr.c \ $(GENERIC_DIR)/tclPreserve.c \ $(GENERIC_DIR)/tclProc.c \ $(GENERIC_DIR)/tclProcess.c \ $(GENERIC_DIR)/tclRegexp.c \ $(GENERIC_DIR)/tclResolve.c \ $(GENERIC_DIR)/tclResult.c \ $(GENERIC_DIR)/tclScan.c \ $(GENERIC_DIR)/tclStubInit.c \ $(GENERIC_DIR)/tclStringObj.c \ $(GENERIC_DIR)/tclStrIdxTree.c \ $(GENERIC_DIR)/tclStrToD.c \ $(GENERIC_DIR)/tclTest.c \ $(GENERIC_DIR)/tclTestABSList.c \ $(GENERIC_DIR)/tclTestObj.c \ $(GENERIC_DIR)/tclTestProcBodyObj.c \ $(GENERIC_DIR)/tclThread.c \ $(GENERIC_DIR)/tclThreadAlloc.c \ $(GENERIC_DIR)/tclThreadJoin.c \ $(GENERIC_DIR)/tclThreadStorage.c \ $(GENERIC_DIR)/tclTimer.c \ $(GENERIC_DIR)/tclTrace.c \ $(GENERIC_DIR)/tclUtil.c \ $(GENERIC_DIR)/tclVar.c \ $(GENERIC_DIR)/tclAssembly.c \ $(GENERIC_DIR)/tclZlib.c \ $(GENERIC_DIR)/tclZipfs.c OO_SRCS = \ $(GENERIC_DIR)/tclOO.c \ $(GENERIC_DIR)/tclOOBasic.c \ $(GENERIC_DIR)/tclOOCall.c \ $(GENERIC_DIR)/tclOODefineCmds.c \ $(GENERIC_DIR)/tclOOInfo.c \ $(GENERIC_DIR)/tclOOMethod.c \ $(GENERIC_DIR)/tclOOProp.c \ $(GENERIC_DIR)/tclOOStubInit.c STUB_SRCS = \ $(GENERIC_DIR)/tclStubLib.c \ $(GENERIC_DIR)/tclStubCall.c \ $(GENERIC_DIR)/tclStubLibTbl.c \ $(GENERIC_DIR)/tclTomMathStubLib.c \ $(GENERIC_DIR)/tclOOStubLib.c TOMMATH_SRCS = \ $(TOMMATH_DIR)/bn_cutoffs.c \ $(TOMMATH_DIR)/bn_deprecated.c \ $(TOMMATH_DIR)/bn_mp_2expt.c \ $(TOMMATH_DIR)/bn_mp_abs.c \ $(TOMMATH_DIR)/bn_mp_add.c \ $(TOMMATH_DIR)/bn_mp_add_d.c \ $(TOMMATH_DIR)/bn_mp_addmod.c \ $(TOMMATH_DIR)/bn_mp_and.c \ $(TOMMATH_DIR)/bn_mp_clamp.c \ $(TOMMATH_DIR)/bn_mp_clear.c \ $(TOMMATH_DIR)/bn_mp_clear_multi.c \ $(TOMMATH_DIR)/bn_mp_cmp.c \ $(TOMMATH_DIR)/bn_mp_cmp_d.c \ $(TOMMATH_DIR)/bn_mp_cmp_mag.c \ $(TOMMATH_DIR)/bn_mp_cnt_lsb.c \ $(TOMMATH_DIR)/bn_mp_complement.c \ $(TOMMATH_DIR)/bn_mp_copy.c \ $(TOMMATH_DIR)/bn_mp_count_bits.c \ $(TOMMATH_DIR)/bn_mp_decr.c \ $(TOMMATH_DIR)/bn_mp_div.c \ $(TOMMATH_DIR)/bn_mp_div_2.c \ $(TOMMATH_DIR)/bn_mp_div_2d.c \ $(TOMMATH_DIR)/bn_s_mp_div_3.c \ $(TOMMATH_DIR)/bn_mp_div_d.c \ $(TOMMATH_DIR)/bn_mp_dr_is_modulus.c \ $(TOMMATH_DIR)/bn_mp_dr_reduce.c \ $(TOMMATH_DIR)/bn_mp_dr_setup.c \ $(TOMMATH_DIR)/bn_mp_error_to_string.c \ $(TOMMATH_DIR)/bn_mp_exch.c \ $(TOMMATH_DIR)/bn_mp_expt_n.c \ $(TOMMATH_DIR)/bn_mp_exptmod.c \ $(TOMMATH_DIR)/bn_mp_exteuclid.c \ $(TOMMATH_DIR)/bn_mp_fread.c \ $(TOMMATH_DIR)/bn_mp_from_sbin.c \ $(TOMMATH_DIR)/bn_mp_from_ubin.c \ $(TOMMATH_DIR)/bn_mp_fwrite.c \ $(TOMMATH_DIR)/bn_mp_gcd.c \ $(TOMMATH_DIR)/bn_mp_get_double.c \ $(TOMMATH_DIR)/bn_mp_get_i32.c \ $(TOMMATH_DIR)/bn_mp_get_i64.c \ $(TOMMATH_DIR)/bn_mp_get_l.c \ $(TOMMATH_DIR)/bn_mp_get_mag_u32.c \ $(TOMMATH_DIR)/bn_mp_get_mag_u64.c \ $(TOMMATH_DIR)/bn_mp_get_mag_ul.c \ $(TOMMATH_DIR)/bn_mp_grow.c \ $(TOMMATH_DIR)/bn_mp_incr.c \ $(TOMMATH_DIR)/bn_mp_init.c \ $(TOMMATH_DIR)/bn_mp_init_copy.c \ $(TOMMATH_DIR)/bn_mp_init_i32.c \ $(TOMMATH_DIR)/bn_mp_init_i64.c \ $(TOMMATH_DIR)/bn_mp_init_l.c \ $(TOMMATH_DIR)/bn_mp_init_multi.c \ $(TOMMATH_DIR)/bn_mp_init_set.c \ $(TOMMATH_DIR)/bn_mp_init_size.c \ $(TOMMATH_DIR)/bn_mp_init_u32.c \ $(TOMMATH_DIR)/bn_mp_init_u64.c \ $(TOMMATH_DIR)/bn_mp_init_ul.c \ $(TOMMATH_DIR)/bn_mp_invmod.c \ $(TOMMATH_DIR)/bn_mp_is_square.c \ $(TOMMATH_DIR)/bn_mp_iseven.c \ $(TOMMATH_DIR)/bn_mp_isodd.c \ $(TOMMATH_DIR)/bn_mp_kronecker.c \ $(TOMMATH_DIR)/bn_mp_lcm.c \ $(TOMMATH_DIR)/bn_mp_log_n.c \ $(TOMMATH_DIR)/bn_s_mp_log.c \ $(TOMMATH_DIR)/bn_s_mp_log_2expt.c \ $(TOMMATH_DIR)/bn_s_mp_log_d.c \ $(TOMMATH_DIR)/bn_mp_lshd.c \ $(TOMMATH_DIR)/bn_mp_mod.c \ $(TOMMATH_DIR)/bn_mp_mod_2d.c \ $(TOMMATH_DIR)/bn_mp_mod_d.c \ $(TOMMATH_DIR)/bn_mp_montgomery_calc_normalization.c \ $(TOMMATH_DIR)/bn_mp_montgomery_reduce.c \ $(TOMMATH_DIR)/bn_mp_montgomery_setup.c \ $(TOMMATH_DIR)/bn_mp_mul.c \ $(TOMMATH_DIR)/bn_mp_mul_2.c \ $(TOMMATH_DIR)/bn_mp_mul_2d.c \ $(TOMMATH_DIR)/bn_mp_mul_d.c \ $(TOMMATH_DIR)/bn_mp_mulmod.c \ $(TOMMATH_DIR)/bn_mp_neg.c \ $(TOMMATH_DIR)/bn_mp_or.c \ $(TOMMATH_DIR)/bn_mp_pack.c \ $(TOMMATH_DIR)/bn_mp_pack_count.c \ $(TOMMATH_DIR)/bn_mp_prime_fermat.c \ $(TOMMATH_DIR)/bn_mp_prime_frobenius_underwood.c \ $(TOMMATH_DIR)/bn_mp_prime_is_prime.c \ $(TOMMATH_DIR)/bn_mp_prime_miller_rabin.c \ $(TOMMATH_DIR)/bn_mp_prime_next_prime.c \ $(TOMMATH_DIR)/bn_mp_prime_rabin_miller_trials.c \ $(TOMMATH_DIR)/bn_mp_prime_rand.c \ $(TOMMATH_DIR)/bn_mp_prime_strong_lucas_selfridge.c \ $(TOMMATH_DIR)/bn_mp_radix_size.c \ $(TOMMATH_DIR)/bn_mp_radix_smap.c \ $(TOMMATH_DIR)/bn_mp_rand.c \ $(TOMMATH_DIR)/bn_mp_read_radix.c \ $(TOMMATH_DIR)/bn_mp_reduce.c \ $(TOMMATH_DIR)/bn_mp_reduce_2k.c \ $(TOMMATH_DIR)/bn_mp_reduce_2k_l.c \ $(TOMMATH_DIR)/bn_mp_reduce_2k_setup.c \ $(TOMMATH_DIR)/bn_mp_reduce_2k_setup_l.c \ $(TOMMATH_DIR)/bn_mp_reduce_is_2k.c \ $(TOMMATH_DIR)/bn_mp_reduce_is_2k_l.c \ $(TOMMATH_DIR)/bn_mp_reduce_setup.c \ $(TOMMATH_DIR)/bn_mp_root_n.c \ $(TOMMATH_DIR)/bn_mp_rshd.c \ $(TOMMATH_DIR)/bn_mp_sbin_size.c \ $(TOMMATH_DIR)/bn_mp_set.c \ $(TOMMATH_DIR)/bn_mp_set_double.c \ $(TOMMATH_DIR)/bn_mp_set_i32.c \ $(TOMMATH_DIR)/bn_mp_set_i64.c \ $(TOMMATH_DIR)/bn_mp_set_l.c \ $(TOMMATH_DIR)/bn_mp_set_u32.c \ $(TOMMATH_DIR)/bn_mp_set_u64.c \ $(TOMMATH_DIR)/bn_mp_set_ul.c \ $(TOMMATH_DIR)/bn_mp_shrink.c \ $(TOMMATH_DIR)/bn_mp_signed_rsh.c \ $(TOMMATH_DIR)/bn_mp_sqr.c \ $(TOMMATH_DIR)/bn_mp_sqrmod.c \ $(TOMMATH_DIR)/bn_mp_sqrt.c \ $(TOMMATH_DIR)/bn_mp_sqrtmod_prime.c \ $(TOMMATH_DIR)/bn_mp_sub.c \ $(TOMMATH_DIR)/bn_mp_sub_d.c \ $(TOMMATH_DIR)/bn_mp_submod.c \ $(TOMMATH_DIR)/bn_mp_to_radix.c \ $(TOMMATH_DIR)/bn_mp_to_sbin.c \ $(TOMMATH_DIR)/bn_mp_to_ubin.c \ $(TOMMATH_DIR)/bn_mp_ubin_size.c \ $(TOMMATH_DIR)/bn_mp_unpack.c \ $(TOMMATH_DIR)/bn_mp_xor.c \ $(TOMMATH_DIR)/bn_mp_zero.c \ $(TOMMATH_DIR)/bn_prime_tab.c \ $(TOMMATH_DIR)/bn_s_mp_add.c \ $(TOMMATH_DIR)/bn_s_mp_balance_mul.c \ $(TOMMATH_DIR)/bn_s_mp_exptmod.c \ $(TOMMATH_DIR)/bn_s_mp_exptmod_fast.c \ $(TOMMATH_DIR)/bn_s_mp_get_bit.c \ $(TOMMATH_DIR)/bn_s_mp_invmod_fast.c \ $(TOMMATH_DIR)/bn_s_mp_invmod_slow.c \ $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c \ $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c \ $(TOMMATH_DIR)/bn_s_mp_montgomery_reduce_fast.c \ $(TOMMATH_DIR)/bn_s_mp_mul_digs.c \ $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c \ $(TOMMATH_DIR)/bn_s_mp_mul_high_digs.c \ $(TOMMATH_DIR)/bn_s_mp_mul_high_digs_fast.c \ $(TOMMATH_DIR)/bn_s_mp_prime_is_divisible.c \ $(TOMMATH_DIR)/bn_s_mp_rand_jenkins.c \ $(TOMMATH_DIR)/bn_s_mp_rand_platform.c \ $(TOMMATH_DIR)/bn_s_mp_reverse.c \ $(TOMMATH_DIR)/bn_s_mp_sqr.c \ $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c \ $(TOMMATH_DIR)/bn_s_mp_sub.c \ $(TOMMATH_DIR)/bn_s_mp_toom_mul.c \ $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c UNIX_HDRS = \ $(UNIX_DIR)/tclUnixPort.h # $(UNIX_DIR)/tclConfig.h UNIX_SRCS = \ $(UNIX_DIR)/tclAppInit.c \ $(UNIX_DIR)/tclUnixChan.c \ $(UNIX_DIR)/tclUnixEvent.c \ $(UNIX_DIR)/tclUnixFCmd.c \ $(UNIX_DIR)/tclUnixFile.c \ $(UNIX_DIR)/tclUnixPipe.c \ $(UNIX_DIR)/tclUnixSock.c \ $(UNIX_DIR)/tclUnixTest.c \ $(UNIX_DIR)/tclUnixThrd.c \ $(UNIX_DIR)/tclUnixTime.c \ $(UNIX_DIR)/tclUnixInit.c \ $(UNIX_DIR)/tclUnixCompat.c NOTIFY_SRCS = \ $(UNIX_DIR)/tclEpollNotfy.c \ $(UNIX_DIR)/tclKqueueNotfy.c \ $(UNIX_DIR)/tclSelectNotfy.c \ $(UNIX_DIR)/tclUnixNotfy.c DL_SRCS = \ $(UNIX_DIR)/tclLoadAix.c \ $(UNIX_DIR)/tclLoadDl.c \ $(UNIX_DIR)/tclLoadDl2.c \ $(UNIX_DIR)/tclLoadDld.c \ $(UNIX_DIR)/tclLoadDyld.c \ $(GENERIC_DIR)/tclLoadNone.c \ $(UNIX_DIR)/tclLoadOSF.c \ $(UNIX_DIR)/tclLoadShl.c MAC_OSX_SRCS = \ $(MAC_OSX_DIR)/tclMacOSXBundle.c \ $(MAC_OSX_DIR)/tclMacOSXFCmd.c \ $(MAC_OSX_DIR)/tclMacOSXNotify.c CYGWIN_SRCS = \ $(TOP_DIR)/win/tclWinError.c DTRACE_HDR = tclDTrace.h DTRACE_SRC = $(GENERIC_DIR)/tclDTrace.d ZLIB_SRCS = \ $(ZLIB_DIR)/adler32.c \ $(ZLIB_DIR)/compress.c \ $(ZLIB_DIR)/crc32.c \ $(ZLIB_DIR)/deflate.c \ $(ZLIB_DIR)/infback.c \ $(ZLIB_DIR)/inffast.c \ $(ZLIB_DIR)/inflate.c \ $(ZLIB_DIR)/inftrees.c \ $(ZLIB_DIR)/trees.c \ $(ZLIB_DIR)/uncompr.c \ $(ZLIB_DIR)/zutil.c # Note: don't include DL_SRCS or MAC_OSX_SRCS in SRCS: most of those files # won't compile on the current machine, and they will cause problems for # things like "make depend". SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \ $(OO_SRCS) $(STUB_SRCS) @PLAT_SRCS@ @ZLIB_SRCS@ @TOMMATH_SRCS@ ### # Tip 430 - ZipFS Modifications ### TCL_ZIP_FILE = @TCL_ZIP_FILE@ TCL_VFS_ROOT = libtcl.vfs TCL_VFS_PATH = ${TCL_VFS_ROOT}/tcl_library HOST_CC = @CC_FOR_BUILD@ HOST_EXEEXT = @EXEEXT_FOR_BUILD@ HOST_OBJEXT = @OBJEXT_FOR_BUILD@ ZIPFS_BUILD = @ZIPFS_BUILD@ MACHER = @MACHER_PROG@ NATIVE_ZIP = @ZIP_PROG@ ZIP_PROG_OPTIONS = @ZIP_PROG_OPTIONS@ ZIP_PROG_VFSSEARCH = @ZIP_PROG_VFSSEARCH@ SHARED_BUILD = @SHARED_BUILD@ INSTALL_LIBRARIES = @INSTALL_LIBRARIES@ INSTALL_MSGS = @INSTALL_MSGS@ # Minizip MINIZIP_OBJS = \ adler32.$(HOST_OBJEXT) \ compress.$(HOST_OBJEXT) \ crc32.$(HOST_OBJEXT) \ deflate.$(HOST_OBJEXT) \ infback.$(HOST_OBJEXT) \ inffast.$(HOST_OBJEXT) \ inflate.$(HOST_OBJEXT) \ inftrees.$(HOST_OBJEXT) \ ioapi.$(HOST_OBJEXT) \ trees.$(HOST_OBJEXT) \ uncompr.$(HOST_OBJEXT) \ zip.$(HOST_OBJEXT) \ zutil.$(HOST_OBJEXT) \ minizip.$(HOST_OBJEXT) ZIP_INSTALL_OBJS = @ZIP_INSTALL_OBJS@ #-------------------------------------------------------------------------- # Start of rules #-------------------------------------------------------------------------- all: binaries libraries doc packages binaries: ${LIB_FILE} ${TCL_EXE} libraries: doc: tclzipfile: ${TCL_ZIP_FILE} ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} @rm -rf ${TCL_VFS_ROOT} @mkdir -p ${TCL_VFS_PATH} @echo "creating ${TCL_VFS_PATH} (prepare compression)" @if \ ln -s $(TOP_DIR)/library/* ${TCL_VFS_PATH}/; \ then : ; else \ cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \ fi mv ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl rm -rf ${TCL_VFS_PATH}/dde ${TCL_VFS_PATH}/registry @find ${TCL_VFS_ROOT} -type d -empty -delete @echo "creating ${TCL_ZIP_FILE} from ${TCL_VFS_PATH}" @(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}' || \ echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?") 2>/dev/null`; \ echo 'cd ${TCL_VFS_ROOT} &&' $$zip '${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH}'; \ cd ${TCL_VFS_ROOT} && \ $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null) # The following target is configured by autoconf to generate either a shared # library or non-shared library for Tcl. ${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${TCL_ZIP_FILE} rm -f $@ @MAKE_LIB@ @if test "${ZIPFS_BUILD}" = "1" ; then \ if test "x$(MACHER)" = "x" ; then \ cat ${TCL_ZIP_FILE} >> ${LIB_FILE}; \ else $(MACHER) append ${LIB_FILE} ${TCL_ZIP_FILE} /tmp/macher_output; \ mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \ fi; \ fi ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} @if [ "x${LIB_FILE}" = "xcygtcl${MAJOR_VERSION}.${MINOR_VERSION}.dll" ] ; then \ ( cd ${TOP_DIR}/win; ${MAKE} winextensions ); \ fi rm -f $@ @MAKE_STUB_LIB@ # Make target which outputs the list of the .o contained in the Tcl lib useful # to build a single big shared library containing Tcl and other extensions. # Used for the Tcl Plugin. -- dl # The dependency on OBJS is not there because we just want the list of objects # here, not actually building them tclLibObjs: @echo ${OBJS} # This targets actually build the objects needed for the lib in the above case objs: ${OBJS} ${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${TCL_ZIP_FILE} ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} \ @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ ${CC_SEARCH_FLAGS} -o ${TCL_EXE} @if test "${ZIPFS_BUILD}" = "2" ; then \ if test "x$(MACHER)" = "x" ; then \ cat ${TCL_ZIP_FILE} >> ${TCL_EXE}; \ else $(MACHER) append ${TCL_EXE} ${TCL_ZIP_FILE} /tmp/macher_output; \ mv /tmp/macher_output ${TCL_EXE}; chmod u+x ${TCL_EXE}; \ fi; \ fi # Must be empty so it doesn't conflict with rule for ${TCL_EXE} above ${NATIVE_TCLSH}: Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in $(SHELL) config.status #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in # $(SHELL) config.status clean: clean-packages rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \ errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@ \ minizip${HOST_EXEEXT} *.${HOST_OBJEXT} *.zip *.vfs (cd dltest ; $(MAKE) clean) distclean: distclean-packages clean rm -rf Makefile config.status config.cache config.log tclConfig.sh \ tclConfig.h *.plist Tcl.framework tcl.pc tclUuid.h (cd dltest ; $(MAKE) distclean) depend: makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) #-------------------------------------------------------------------------- # The following target outputs the name of the top-level source directory for # Tcl (it is used by Tk's configure script, for example). The .NO_PARALLEL # line is needed to avoid problems under Sun's "pmake". Note: this target is # now obsolete (use the autoconf variable TCL_SRC_DIR from tclConfig.sh # instead). #-------------------------------------------------------------------------- .NO_PARALLEL: topDirName topDirName: @cd $(TOP_DIR); pwd #-------------------------------------------------------------------------- # Rules for testing #-------------------------------------------------------------------------- # Resetting the LIB_RUNTIME_DIR below is required so that the generated # tcltest executable gets the build directory burned into its ld search path. # This keeps tcltest from picking up an already installed version of the Tcl # library. SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \ TCLLIBPATH="@abs_builddir@/pkgs" \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}" ${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} ${TCL_ZIP_FILE} $(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`" tcltest-real: ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} \ @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ ${CC_SEARCH_FLAGS} -o ${TCLTEST_EXE} @if test "${ZIPFS_BUILD}" = "2" ; then \ if test "x$(MACHER)" = "x" ; then \ cat ${TCL_ZIP_FILE} >> ${TCLTEST_EXE}; \ else $(MACHER) append ${TCLTEST_EXE} ${TCL_ZIP_FILE} /tmp/macher_output; \ mv /tmp/macher_output ${TCLTEST_EXE}; chmod u+x ${TCLTEST_EXE}; \ fi; \ fi # Note, in the targets below TCL_LIBRARY needs to be set or else "make test" # won't work in the case where the compilation directory isn't the same as the # source directory. # # Specifying TESTFLAGS on the command line is the standard way to pass args to # tcltest, ie: # % make test TESTFLAGS="-verbose bps -file fileName.test" test: test-tcl test-packages test-tcl: ${TCLTEST_EXE} $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) gdb-test: ${TCLTEST_EXE} $(SHELL_ENV) $(GDB) --args ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl \ $(TESTFLAGS) -singleproc 1 lldb-test: ${TCLTEST_EXE} $(SHELL_ENV) $(LLDB) -- ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl \ $(TESTFLAGS) -singleproc 1 # Useful target to launch a built tcltest with the proper path,... runtest: ${TCLTEST_EXE} $(SHELL_ENV) ./${TCLTEST_EXE} # Useful target for running the test suite with an unwritable current # directory... ro-test: ${TCLTEST_EXE} echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE} # The following target generates the shared libraries in dltest/ that are used # for testing; they are included as part of the "tcltest" target (via the # BUILD_DLTEST variable) if dynamic loading is supported on this platform. The # Makefile in the dltest subdirectory creates the dltest.marker file in this # directory after a successful build. dltest.marker: ${STUB_LIB_FILE} cd dltest ; $(MAKE) #-------------------------------------------------------------------------- # Rules for running a shell before installation #-------------------------------------------------------------------------- # This target can be used to run tclsh from the build directory # via `make shell SCRIPT=/tmp/foo.tcl` shell: ${TCL_EXE} $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT) # This target can be used to run tclsh inside either gdb or insight gdb: ${TCL_EXE} $(SHELL_ENV) $(GDB) ./${TCL_EXE} lldb: ${TCL_EXE} $(SHELL_ENV) $(LLDB) ./${TCL_EXE} valgrind: ${TCL_EXE} ${TCLTEST_EXE} $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \ $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \ $(TESTFLAGS) testresults/valgrind/%.result: ${TCL_EXE} ${TCLTEST_EXE} @mkdir -p testresults/valgrind $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \ $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \ -file $(basename $(notdir $@)) > $@.tmp 2>&1 @mv $@.tmp $@ .PRECIOUS: testresults/valgrind/%.result testresults/valgrind/%.success: testresults/valgrind/%.result @printf '%s' valgrind >&2 @printf ' %s' $(basename $(notdir $@)) >&2 @printf '\n >&2' @status=$$(./${TCLTEST_EXE} $(TOP_DIR)/tools/valgrind_check_success \ file $(basename $@).result); \ if [ "$$status" -eq 1 ]; then touch $@; exit 0; else exit 1; fi valgrind_each: $(addprefix testresults/valgrind/,$(addsuffix .success,$(notdir\ $(wildcard $(TOP_DIR)/tests/*.test)))) valgrindshell: ${TCL_EXE} $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT) trace-shell: ${TCL_EXE} $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT) trace-test: ${TCLTEST_EXE} $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS) #-------------------------------------------------------------------------- # Installation rules #-------------------------------------------------------------------------- INSTALL_BASE_TARGETS = install-binaries $(INSTALL_LIBRARIES) $(INSTALL_MSGS) $(INSTALL_TZDATA) INSTALL_DOC_TARGETS = install-doc INSTALL_PACKAGE_TARGETS = install-packages INSTALL_DEV_TARGETS = install-headers INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@ INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DEV_TARGETS) $(INSTALL_DOC_TARGETS) \ $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS) install: $(INSTALL_TARGETS) install-strip: $(MAKE) $(INSTALL_TARGETS) \ INSTALL_PROGRAM="STRIPPROG='${INSTALL_STRIP_PROGRAM}' $(INSTALL_PROGRAM) -s" \ INSTALL_LIBRARY="STRIPPROG='${INSTALL_STRIP_LIBRARY}' $(INSTALL_LIBRARY) -s" install-binaries: binaries @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \ "$(CONFIG_INSTALL_DIR)" ; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}" @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}" @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/" @$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)/tclConfig.sh" @echo "Installing tclooConfig.sh to $(CONFIG_INSTALL_DIR)/" @$(INSTALL_DATA) $(UNIX_DIR)/tclooConfig.sh \ "$(CONFIG_INSTALL_DIR)/tclooConfig.sh" @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ fi @EXTRA_INSTALL_BINARIES@ @echo "Installing pkg-config file to $(LIB_INSTALL_DIR)/pkgconfig/" @$(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/pkgconfig" @$(INSTALL_DATA) tcl.pc "$(LIB_INSTALL_DIR)/pkgconfig/tcl.pc" install-libraries: libraries @for i in "$(SCRIPT_INSTALL_DIR)" "$(MODULE_INSTALL_DIR)"; \ do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done; @for i in opt0.4 cookiejar0.2 encoding; \ do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \ else true; \ fi; \ done; @for i in 9.0 9.0/platform; \ do \ if [ ! -d "$(MODULE_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(MODULE_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(MODULE_INSTALL_DIR)/$$i"; \ fi; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/" @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \ $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@ ; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done; @echo "Installing package cookiejar 0.2 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.2/" @for i in $(TOP_DIR)/library/cookiejar/*.tcl \ $(TOP_DIR)/library/cookiejar/*.gz; \ do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/cookiejar0.2"; \ done @echo "Installing package http 2.10.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl \ "$(MODULE_INSTALL_DIR)/9.0/http-2.10.1.tm" @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/" @for i in $(TOP_DIR)/library/opt/*.tcl; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/opt0.4"; \ done @echo "Installing package msgcat 1.7.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \ "$(MODULE_INSTALL_DIR)/9.0/msgcat-1.7.1.tm" @echo "Installing package tcltest 2.5.10 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \ "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.10.tm" @echo "Installing package platform 1.1.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \ "$(MODULE_INSTALL_DIR)/9.0/platform-1.1.0.tm" @echo "Installing package platform::shell 1.1.4 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \ "$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm" @echo "Installing encoding files to $(SCRIPT_INSTALL_DIR)/encoding/" @for i in $(TOP_DIR)/library/encoding/*.enc; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/encoding"; \ done @if [ -n "$(TCL_MODULE_PATH)" -a -f $(TOP_DIR)/library/tm.tcl ] ; then \ echo "Customizing tcl module path"; \ echo "if {![interp issafe]} {" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ echo " ::tcl::tm::roots [lmap p [split {$(TCL_MODULE_PATH)} :] {" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ echo " if {[catch {file tildeexpand [set p]} p]} continue" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ echo " set p" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ echo " }]" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ echo "}" >> \ "$(SCRIPT_INSTALL_DIR)/tm.tcl"; \ fi install-tzdata: @for i in tzdata; do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \ fi; \ done @echo "Installing time zone files to $(SCRIPT_INSTALL_DIR)/tzdata/" @for i in $(TOP_DIR)/library/tzdata/*; do \ if [ -d $$i ] ; then \ ii=`basename $$i`; \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii" ] ; then \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii"; \ fi; \ for j in $$i/*; do \ if [ -d $$j ] ; then \ jj=`basename $$j`; \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj" ] ; then \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj"; \ fi; \ for k in $$j/*; do \ $(INSTALL_DATA) $$k "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii/$$jj"; \ done; \ else \ $(INSTALL_DATA) $$j "$(SCRIPT_INSTALL_DIR)/tzdata/$$ii"; \ fi; \ done; \ else \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/tzdata"; \ fi; \ done install-msgs: @for i in msgs; do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)/$$i" ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)/$$i"; \ fi; \ done @echo "Installing message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/" @for i in $(TOP_DIR)/library/msgs/*.msg; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \ done install-doc: doc @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)"; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done @echo "Installing and cross-linking top-level (.1) docs to $(MAN1_INSTALL_DIR)/" @for i in $(TOP_DIR)/doc/*.1; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \ done @echo "Installing and cross-linking C API (.3) docs to $(MAN3_INSTALL_DIR)/" @for i in $(TOP_DIR)/doc/*.3; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \ done @echo "Installing and cross-linking command (.n) docs to $(MANN_INSTALL_DIR)/"; @for i in $(TOP_DIR)/doc/*.n; do \ $(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \ done # Public headers that define Tcl's API TCL_PUBLIC_HEADERS = $(GENERIC_DIR)/tcl.h $(GENERIC_DIR)/tclDecls.h \ $(GENERIC_DIR)/tclOO.h $(GENERIC_DIR)/tclOODecls.h \ $(GENERIC_DIR)/tclPlatDecls.h $(GENERIC_DIR)/tclTomMath.h \ $(GENERIC_DIR)/tclTomMathDecls.h # Private headers that define Tcl's internal API TCL_PRIVATE_HEADERS = $(GENERIC_DIR)/tclInt.h $(GENERIC_DIR)/tclIntDecls.h \ $(GENERIC_DIR)/tclIntPlatDecls.h $(GENERIC_DIR)/tclPort.h \ $(GENERIC_DIR)/tclOOInt.h $(GENERIC_DIR)/tclOOIntDecls.h \ $(UNIX_DIR)/tclUnixPort.h # Any other headers you find in the Tcl sources are purely part of Tcl's # implementation, and aren't to be installed. install-headers: @for i in "$(INCLUDE_INSTALL_DIR)"; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/"; @for i in $(TCL_PUBLIC_HEADERS); do \ $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \ done # Optional target to install private headers install-private-headers: @for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; do \ if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/"; @for i in $(TCL_PRIVATE_HEADERS); do \ $(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ done @if test -f tclConfig.h; then\ $(INSTALL_DATA) tclConfig.h "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ fi #-------------------------------------------------------------------------- # Rules for how to compile C files #-------------------------------------------------------------------------- # Test binaries. The rules for tclTestInit.o and xtTestInit.o are complicated # because they are compiled from tclAppInit.c. Can't use the "-o" option # because this doesn't work on some strange compilers (e.g. UnixWare). # # To enable concurrent parallel make of tclsh and tcltest resp xttest, these # targets have to depend on tclsh, this ensures that linking of tclsh with # tclAppInit.o does not execute concurrently with the renaming and recompiling # of that same object file in the targets below. tclTestInit.o: $(UNIX_DIR)/tclAppInit.c ${TCL_EXE} @if test -f tclAppInit.o ; then \ rm -f tclAppInit.sav; \ mv tclAppInit.o tclAppInit.sav; \ fi $(CC) -c $(APP_CC_SWITCHES) \ -DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \ -DTCL_TEST $(UNIX_DIR)/tclAppInit.c @rm -f tclTestInit.o mv tclAppInit.o tclTestInit.o @if test -f tclAppInit.sav ; then \ mv tclAppInit.sav tclAppInit.o; \ fi xtTestInit.o: $(UNIX_DIR)/tclAppInit.c ${TCL_EXE} @if test -f tclAppInit.o ; then \ rm -f tclAppInit.sav; \ mv tclAppInit.o tclAppInit.sav; \ fi $(CC) -c $(APP_CC_SWITCHES) \ -DTCL_BUILDTIME_LIBRARY="\"${TCL_BUILDTIME_LIBRARY}\"" \ -DTCL_TEST -DTCL_XT_TEST $(UNIX_DIR)/tclAppInit.c @rm -f xtTestInit.o mv tclAppInit.o xtTestInit.o @if test -f tclAppInit.sav ; then \ mv tclAppInit.sav tclAppInit.o; \ fi # Object files used on all Unix systems: REGHDRS = $(GENERIC_DIR)/regex.h $(GENERIC_DIR)/regguts.h \ $(GENERIC_DIR)/regcustom.h TCLREHDRS = $(GENERIC_DIR)/tclRegexp.h COMPILEHDR = $(GENERIC_DIR)/tclCompile.h FSHDR = $(GENERIC_DIR)/tclFileSystem.h IOHDR = $(GENERIC_DIR)/tclIO.h MATHHDRS = $(GENERIC_DIR)/tclTomMath.h $(GENERIC_DIR)/tclTomMathDecls.h PARSEHDR = $(GENERIC_DIR)/tclParse.h NREHDR = $(GENERIC_DIR)/tclInt.h TRIMHDR = $(GENERIC_DIR)/tclStringTrim.h TCL_LOCATIONS = -DTCL_LIBRARY="\"${TCL_LIBRARY}\"" \ -DTCL_PACKAGE_PATH="\"${TCL_PACKAGE_PATH}\"" TCLDATEHDR=$(GENERIC_DIR)/tclDate.h $(GENERIC_DIR)/tclStrIdxTree.h regcomp.o: $(REGHDRS) $(GENERIC_DIR)/regcomp.c $(GENERIC_DIR)/regc_lex.c \ $(GENERIC_DIR)/regc_color.c $(GENERIC_DIR)/regc_locale.c \ $(GENERIC_DIR)/regc_nfa.c $(GENERIC_DIR)/regc_cvec.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regcomp.c regexec.o: $(REGHDRS) $(GENERIC_DIR)/regexec.c $(GENERIC_DIR)/rege_dfa.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regexec.c regfree.o: $(REGHDRS) $(GENERIC_DIR)/regfree.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regfree.c regerror.o: $(REGHDRS) $(GENERIC_DIR)/regerrs.h $(GENERIC_DIR)/regerror.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/regerror.c tclAppInit.o: $(UNIX_DIR)/tclAppInit.c $(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclAppInit.c tclAlloc.o: $(GENERIC_DIR)/tclAlloc.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAlloc.c tclArithSeries.o: $(GENERIC_DIR)/tclArithSeries.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclArithSeries.c tclAssembly.o: $(GENERIC_DIR)/tclAssembly.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAssembly.c tclAsync.o: $(GENERIC_DIR)/tclAsync.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclAsync.c tclBasic.o: $(GENERIC_DIR)/tclBasic.c $(COMPILEHDR) $(MATHHDRS) $(NREHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclBasic.c tclBinary.o: $(GENERIC_DIR)/tclBinary.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclBinary.c tclCkalloc.o: $(GENERIC_DIR)/tclCkalloc.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCkalloc.c tclClock.o: $(GENERIC_DIR)/tclClock.c $(TCLDATEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclClock.c tclClockFmt.o: $(GENERIC_DIR)/tclClockFmt.c $(TCLDATEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclClockFmt.c tclCmdAH.o: $(GENERIC_DIR)/tclCmdAH.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdAH.c tclCmdIL.o: $(GENERIC_DIR)/tclCmdIL.c $(TCLREHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdIL.c tclCmdMZ.o: $(GENERIC_DIR)/tclCmdMZ.c $(TCLREHDRS) $(TRIMHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCmdMZ.c tclDate.o: $(GENERIC_DIR)/tclDate.c $(TCLDATEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDate.c tclCompCmds.o: $(GENERIC_DIR)/tclCompCmds.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmds.c tclCompCmdsGR.o: $(GENERIC_DIR)/tclCompCmdsGR.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmdsGR.c tclCompCmdsSZ.o: $(GENERIC_DIR)/tclCompCmdsSZ.c $(COMPILEHDR) $(TRIMHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompCmdsSZ.c tclCompExpr.o: $(GENERIC_DIR)/tclCompExpr.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompExpr.c tclCompile.o: $(GENERIC_DIR)/tclCompile.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclCompile.c tclConfig.o: $(GENERIC_DIR)/tclConfig.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclConfig.c tclDictObj.o: $(GENERIC_DIR)/tclDictObj.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDictObj.c tclDisassemble.o: $(GENERIC_DIR)/tclDisassemble.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclDisassemble.c tclEncoding.o: $(GENERIC_DIR)/tclEncoding.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEncoding.c tclEnsemble.o: $(GENERIC_DIR)/tclEnsemble.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnsemble.c tclEnv.o: $(GENERIC_DIR)/tclEnv.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEnv.c tclEvent.o: $(GENERIC_DIR)/tclEvent.c tclUuid.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclEvent.c tclExecute.o: $(GENERIC_DIR)/tclExecute.c $(COMPILEHDR) $(MATHHDRS) $(NREHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclExecute.c tclFCmd.o: $(GENERIC_DIR)/tclFCmd.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclFCmd.c tclFileName.o: $(GENERIC_DIR)/tclFileName.c $(FSHDR) $(TCLREHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclFileName.c tclGet.o: $(GENERIC_DIR)/tclGet.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclGet.c tclHash.o: $(GENERIC_DIR)/tclHash.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclHash.c tclHistory.o: $(GENERIC_DIR)/tclHistory.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclHistory.c tclIcu.o: $(GENERIC_DIR)/tclIcu.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIcu.c tclIndexObj.o: $(GENERIC_DIR)/tclIndexObj.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIndexObj.c tclInterp.o: $(GENERIC_DIR)/tclInterp.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclInterp.c tclIO.o: $(GENERIC_DIR)/tclIO.c $(IOHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIO.c tclIOCmd.o: $(GENERIC_DIR)/tclIOCmd.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOCmd.c tclIOGT.o: $(GENERIC_DIR)/tclIOGT.c $(IOHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOGT.c tclIOSock.o: $(GENERIC_DIR)/tclIOSock.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOSock.c tclIOUtil.o: $(GENERIC_DIR)/tclIOUtil.c $(FSHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIOUtil.c tclIORChan.o: $(GENERIC_DIR)/tclIORChan.c $(IOHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIORChan.c tclIORTrans.o: $(GENERIC_DIR)/tclIORTrans.c $(IOHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclIORTrans.c tclLink.o: $(GENERIC_DIR)/tclLink.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLink.c tclListObj.o: $(GENERIC_DIR)/tclListObj.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclListObj.c tclLiteral.o: $(GENERIC_DIR)/tclLiteral.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLiteral.c tclObj.o: $(GENERIC_DIR)/tclObj.c $(COMPILEHDR) $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclObj.c tclOptimize.o: $(GENERIC_DIR)/tclOptimize.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOptimize.c tclLoad.o: $(GENERIC_DIR)/tclLoad.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLoad.c tclLoadAix.o: $(UNIX_DIR)/tclLoadAix.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadAix.c tclLoadDl.o: $(UNIX_DIR)/tclLoadDl.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDl.c tclLoadDl2.o: $(UNIX_DIR)/tclLoadDl2.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDl2.c tclLoadDld.o: $(UNIX_DIR)/tclLoadDld.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDld.c tclLoadDyld.o: $(UNIX_DIR)/tclLoadDyld.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadDyld.c tclLoadNone.o: $(GENERIC_DIR)/tclLoadNone.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclLoadNone.c tclLoadOSF.o: $(UNIX_DIR)/tclLoadOSF.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadOSF.c tclLoadShl.o: $(UNIX_DIR)/tclLoadShl.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclLoadShl.c tclMain.o: $(GENERIC_DIR)/tclMain.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclMain.c tclNamesp.o: $(GENERIC_DIR)/tclNamesp.c $(COMPILEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNamesp.c tclNotify.o: $(GENERIC_DIR)/tclNotify.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNotify.c tclOO.o: $(GENERIC_DIR)/tclOO.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOO.c tclOOBasic.o: $(GENERIC_DIR)/tclOOBasic.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOBasic.c tclOOCall.o: $(GENERIC_DIR)/tclOOCall.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOCall.c tclOODefineCmds.o: $(GENERIC_DIR)/tclOODefineCmds.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOODefineCmds.c tclOOInfo.o: $(GENERIC_DIR)/tclOOInfo.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOInfo.c tclOOMethod.o: $(GENERIC_DIR)/tclOOMethod.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOMethod.c tclOOProp.o: $(GENERIC_DIR)/tclOOProp.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOProp.c tclOOStubInit.o: $(GENERIC_DIR)/tclOOStubInit.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclOOStubInit.c tclParse.o: $(GENERIC_DIR)/tclParse.c $(PARSEHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c tclPanic.o: $(GENERIC_DIR)/tclPanic.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPanic.c tclPathObj.o: $(GENERIC_DIR)/tclPathObj.c $(FSHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPathObj.c tclPipe.o: $(GENERIC_DIR)/tclPipe.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPipe.c tclPkg.o: $(GENERIC_DIR)/tclPkg.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPkg.c # TIP #59, embedding of configuration information into the binary library. # # Part of Tcl's configuration information are the paths where it was installed # and where it will look for its libraries (which can be different). We derive # this information from the variables which can be overridden by the user. As # every path can be configured separately we do not remember one general # prefix/exec_prefix but all the different paths individually. tclPkgConfig.o: $(GENERIC_DIR)/tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR)\"" \ -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR)\"" \ -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR)\"" \ -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR)\"" \ -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ -DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \ -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY)\"" \ -DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \ -DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ $(GENERIC_DIR)/tclPkgConfig.c tclPosixStr.o: $(GENERIC_DIR)/tclPosixStr.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPosixStr.c tclPreserve.o: $(GENERIC_DIR)/tclPreserve.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPreserve.c tclProc.o: $(GENERIC_DIR)/tclProc.c $(COMPILEHDR) $(NREHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProc.c tclProcess.o: $(GENERIC_DIR)/tclProcess.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclProcess.c tclRegexp.o: $(GENERIC_DIR)/tclRegexp.c $(TCLREHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclRegexp.c tclResolve.o: $(GENERIC_DIR)/tclResolve.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclResolve.c tclResult.o: $(GENERIC_DIR)/tclResult.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclResult.c tclScan.o: $(GENERIC_DIR)/tclScan.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclScan.c tclStringObj.o: $(GENERIC_DIR)/tclStringObj.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStringObj.c tclStrIdxTree.o: $(GENERIC_DIR)/tclStrIdxTree.c $(GENERIC_DIR)/tclStrIdxTree.h $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStrIdxTree.c tclStrToD.o: $(GENERIC_DIR)/tclStrToD.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStrToD.c tclStubInit.o: $(GENERIC_DIR)/tclStubInit.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclStubInit.c tclTrace.o: $(GENERIC_DIR)/tclTrace.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTrace.c tclUtil.o: $(GENERIC_DIR)/tclUtil.c $(PARSEHDR) $(TRIMHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtil.c tclUtf.o: $(GENERIC_DIR)/tclUtf.c $(GENERIC_DIR)/tclUniData.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclUtf.c tclVar.o: $(GENERIC_DIR)/tclVar.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclVar.c tclZlib.o: $(GENERIC_DIR)/tclZlib.c $(CC) -c $(CC_SWITCHES) $(ZLIB_INCLUDE) $(GENERIC_DIR)/tclZlib.c tclZipfs.o: $(GENERIC_DIR)/tclZipfs.c $(CC) -c $(CC_SWITCHES) -D_GNU_SOURCE \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip \ $(GENERIC_DIR)/tclZipfs.c tclTest.o: $(GENERIC_DIR)/tclTest.c $(IOHDR) $(TCLREHDRS) tclUuid.h $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTest.c tclTestABSList.o: $(GENERIC_DIR)/tclTestABSList.c $(MATHHDRS) $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTestABSList.c tclTestObj.o: $(GENERIC_DIR)/tclTestObj.c $(MATHHDRS) $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTestObj.c tclTestProcBodyObj.o: $(GENERIC_DIR)/tclTestProcBodyObj.c $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclTestProcBodyObj.c tclTimer.o: $(GENERIC_DIR)/tclTimer.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTimer.c tclThread.o: $(GENERIC_DIR)/tclThread.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThread.c tclThreadAlloc.o: $(GENERIC_DIR)/tclThreadAlloc.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThreadAlloc.c tclThreadJoin.o: $(GENERIC_DIR)/tclThreadJoin.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThreadJoin.c tclThreadStorage.o: $(GENERIC_DIR)/tclThreadStorage.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclThreadStorage.c tclMutexTest.o: $(GENERIC_DIR)/tclMutexTest.c $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclMutexTest.c tclThreadTest.o: $(GENERIC_DIR)/tclThreadTest.c $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tclThreadTest.c tclTomMathInterface.o: $(GENERIC_DIR)/tclTomMathInterface.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclTomMathInterface.c bn_s_mp_reverse.o: $(TOMMATH_DIR)/bn_s_mp_reverse.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_reverse.c bn_s_mp_mul_digs_fast.o: $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_mul_digs_fast.c bn_s_mp_sqr_fast.o: $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_sqr_fast.c bn_mp_add.o: $(TOMMATH_DIR)/bn_mp_add.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_add.c bn_mp_add_d.o: $(TOMMATH_DIR)/bn_mp_add_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_add_d.c bn_mp_and.o: $(TOMMATH_DIR)/bn_mp_and.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_and.c bn_mp_clamp.o: $(TOMMATH_DIR)/bn_mp_clamp.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_clamp.c bn_mp_clear.o: $(TOMMATH_DIR)/bn_mp_clear.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_clear.c bn_mp_clear_multi.o: $(TOMMATH_DIR)/bn_mp_clear_multi.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_clear_multi.c bn_mp_cmp.o: $(TOMMATH_DIR)/bn_mp_cmp.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp.c bn_mp_cmp_d.o: $(TOMMATH_DIR)/bn_mp_cmp_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp_d.c bn_mp_cmp_mag.o: $(TOMMATH_DIR)/bn_mp_cmp_mag.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cmp_mag.c bn_mp_cnt_lsb.o: $(TOMMATH_DIR)/bn_mp_cnt_lsb.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_cnt_lsb.c bn_mp_copy.o: $(TOMMATH_DIR)/bn_mp_copy.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_copy.c bn_mp_count_bits.o: $(TOMMATH_DIR)/bn_mp_count_bits.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_count_bits.c bn_mp_div.o: $(TOMMATH_DIR)/bn_mp_div.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_div.c bn_mp_div_d.o: $(TOMMATH_DIR)/bn_mp_div_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_div_d.c bn_mp_div_2.o: $(TOMMATH_DIR)/bn_mp_div_2.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_div_2.c bn_mp_div_2d.o: $(TOMMATH_DIR)/bn_mp_div_2d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_div_2d.c bn_s_mp_div_3.o: $(TOMMATH_DIR)/bn_s_mp_div_3.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_div_3.c bn_mp_exch.o: $(TOMMATH_DIR)/bn_mp_exch.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_exch.c bn_mp_expt_n.o: $(TOMMATH_DIR)/bn_mp_expt_n.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_n.c bn_mp_get_mag_u64.o: $(TOMMATH_DIR)/bn_mp_get_mag_u64.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_get_mag_u64.c bn_mp_grow.o: $(TOMMATH_DIR)/bn_mp_grow.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_grow.c bn_mp_init.o: $(TOMMATH_DIR)/bn_mp_init.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init.c bn_mp_init_copy.o: $(TOMMATH_DIR)/bn_mp_init_copy.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_copy.c bn_mp_init_i64.o:$(TOMMATH_DIR)/bn_mp_init_i64.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_i64.c bn_mp_init_multi.o: $(TOMMATH_DIR)/bn_mp_init_multi.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_multi.c bn_mp_init_set.o: $(TOMMATH_DIR)/bn_mp_init_set.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_set.c bn_mp_init_size.o:$(TOMMATH_DIR)/bn_mp_init_size.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_size.c bn_mp_init_u64.o:$(TOMMATH_DIR)/bn_mp_init_u64.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init_u64.c bn_s_mp_karatsuba_mul.o: $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_karatsuba_mul.c bn_s_mp_karatsuba_sqr.o: $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_karatsuba_sqr.c bn_s_mp_balance_mul.o: $(TOMMATH_DIR)/bn_s_mp_balance_mul.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_balance_mul.c bn_mp_lshd.o: $(TOMMATH_DIR)/bn_mp_lshd.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_lshd.c bn_mp_mod.o: $(TOMMATH_DIR)/bn_mp_mod.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mod.c bn_mp_mod_2d.o: $(TOMMATH_DIR)/bn_mp_mod_2d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mod_2d.c bn_mp_mul.o: $(TOMMATH_DIR)/bn_mp_mul.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mul.c bn_mp_mul_2.o: $(TOMMATH_DIR)/bn_mp_mul_2.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mul_2.c bn_mp_mul_2d.o: $(TOMMATH_DIR)/bn_mp_mul_2d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mul_2d.c bn_mp_mul_d.o: $(TOMMATH_DIR)/bn_mp_mul_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_mul_d.c bn_mp_neg.o: $(TOMMATH_DIR)/bn_mp_neg.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_neg.c bn_mp_or.o: $(TOMMATH_DIR)/bn_mp_or.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_or.c bn_mp_pack.o: $(TOMMATH_DIR)/bn_mp_pack.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_pack.c bn_mp_pack_count.o: $(TOMMATH_DIR)/bn_mp_pack_count.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_pack_count.c bn_mp_radix_size.o: $(TOMMATH_DIR)/bn_mp_radix_size.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_radix_size.c bn_mp_radix_smap.o: $(TOMMATH_DIR)/bn_mp_radix_smap.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_radix_smap.c bn_mp_read_radix.o: $(TOMMATH_DIR)/bn_mp_read_radix.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_read_radix.c bn_mp_rshd.o: $(TOMMATH_DIR)/bn_mp_rshd.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_rshd.c bn_mp_set_i64.o: $(TOMMATH_DIR)/bn_mp_set_i64.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_i64.c bn_mp_set_u64.o: $(TOMMATH_DIR)/bn_mp_set_u64.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_set_u64.c bn_mp_shrink.o: $(TOMMATH_DIR)/bn_mp_shrink.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_shrink.c bn_mp_sqr.o: $(TOMMATH_DIR)/bn_mp_sqr.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sqr.c bn_mp_sqrt.o: $(TOMMATH_DIR)/bn_mp_sqrt.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sqrt.c bn_mp_sub.o: $(TOMMATH_DIR)/bn_mp_sub.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub.c bn_mp_sub_d.o: $(TOMMATH_DIR)/bn_mp_sub_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub_d.c bn_mp_signed_rsh.o: $(TOMMATH_DIR)/bn_mp_signed_rsh.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_signed_rsh.c bn_mp_to_ubin.o: $(TOMMATH_DIR)/bn_mp_to_ubin.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_ubin.c bn_s_mp_toom_mul.o: $(TOMMATH_DIR)/bn_s_mp_toom_mul.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_toom_mul.c bn_s_mp_toom_sqr.o: $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_toom_sqr.c bn_mp_to_radix.o: $(TOMMATH_DIR)/bn_mp_to_radix.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_radix.c bn_mp_ubin_size.o: $(TOMMATH_DIR)/bn_mp_ubin_size.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_ubin_size.c bn_mp_unpack.o: $(TOMMATH_DIR)/bn_mp_unpack.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_unpack.c bn_mp_xor.o: $(TOMMATH_DIR)/bn_mp_xor.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_xor.c bn_mp_zero.o: $(TOMMATH_DIR)/bn_mp_zero.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_zero.c bn_s_mp_add.o: $(TOMMATH_DIR)/bn_s_mp_add.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_add.c bn_s_mp_mul_digs.o: $(TOMMATH_DIR)/bn_s_mp_mul_digs.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_mul_digs.c bn_s_mp_sqr.o: $(TOMMATH_DIR)/bn_s_mp_sqr.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_sqr.c bn_s_mp_sub.o: $(TOMMATH_DIR)/bn_s_mp_sub.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_sub.c tclUnixChan.o: $(UNIX_DIR)/tclUnixChan.c $(IOHDR) $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixChan.c tclUnixEvent.o: $(UNIX_DIR)/tclUnixEvent.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixEvent.c tclUnixFCmd.o: $(UNIX_DIR)/tclUnixFCmd.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixFCmd.c tclUnixFile.o: $(UNIX_DIR)/tclUnixFile.c $(FSHDR) $(CC) -c $(CC_SWITCHES) \ -D_GNU_SOURCE \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ $(UNIX_DIR)/tclUnixFile.c tclEpollNotfy.o: $(UNIX_DIR)/tclEpollNotfy.c $(UNIX_DIR)/tclUnixNotfy.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclEpollNotfy.c tclKqueueNotfy.o: $(UNIX_DIR)/tclKqueueNotfy.c $(UNIX_DIR)/tclUnixNotfy.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclKqueueNotfy.c tclSelectNotfy.o: $(UNIX_DIR)/tclSelectNotfy.c $(UNIX_DIR)/tclUnixNotfy.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclSelectNotfy.c tclUnixPipe.o: $(UNIX_DIR)/tclUnixPipe.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixPipe.c tclUnixSock.o: $(UNIX_DIR)/tclUnixSock.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixSock.c tclUnixTest.o: $(UNIX_DIR)/tclUnixTest.c $(CC) -c $(APP_CC_SWITCHES) $(UNIX_DIR)/tclUnixTest.c tclUnixThrd.o: $(UNIX_DIR)/tclUnixThrd.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixThrd.c tclUnixTime.o: $(UNIX_DIR)/tclUnixTime.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixTime.c tclUnixInit.o: $(UNIX_DIR)/tclUnixInit.c tclConfig.sh $(CC) -c $(CC_SWITCHES) $(TCL_LOCATIONS) $(UNIX_DIR)/tclUnixInit.c tclUnixCompat.o: $(UNIX_DIR)/tclUnixCompat.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tclUnixCompat.c # The following are Mac OS X only sources: tclMacOSXBundle.o: $(MAC_OSX_DIR)/tclMacOSXBundle.c $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tclMacOSXBundle.c tclMacOSXFCmd.o: $(MAC_OSX_DIR)/tclMacOSXFCmd.c $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tclMacOSXFCmd.c tclMacOSXNotify.o: $(MAC_OSX_DIR)/tclMacOSXNotify.c $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tclMacOSXNotify.c # The following is a CYGWIN only source: tclWinError.o: $(TOP_DIR)/win/tclWinError.c $(CC) -c $(CC_SWITCHES) $(TOP_DIR)/win/tclWinError.c # DTrace support $(TCL_OBJS) $(STUB_LIB_OBJS) $(TCLSH_OBJS) $(TCLTEST_OBJS) $(XTTEST_OBJS) $(TOMMATH_OBJS): @DTRACE_HDR@ $(DTRACE_HDR): $(DTRACE_SRC) $(DTRACE) -h $(DTRACE_SWITCHES) -o $@ -s $(DTRACE_SRC) $(DTRACE_OBJ): $(DTRACE_SRC) $(TCL_OBJS) $(DTRACE) -G $(DTRACE_SWITCHES) -o $@ -s $(DTRACE_SRC) $(TCL_OBJS) #-------------------------------------------------------------------------- # The following targets are not completely general. They are provide purely # for documentation purposes so people who are interested in the Xt based # notifier can modify them to suit their own installation. #-------------------------------------------------------------------------- xttest: ${XTTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST} ${CC} ${CFLAGS} ${LDFLAGS} ${XTTEST_OBJS} \ @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ ${CC_SEARCH_FLAGS} -L/usr/openwin/lib -lXt -o xttest tclXtNotify.o: $(UNIX_DIR)/tclXtNotify.c $(CC) -c $(APP_CC_SWITCHES) -I/usr/openwin/include \ $(UNIX_DIR)/tclXtNotify.c tclXtTest.o: $(UNIX_DIR)/tclXtTest.c $(CC) -c $(APP_CC_SWITCHES) -I/usr/openwin/include \ $(UNIX_DIR)/tclXtTest.c #-------------------------------------------------------------------------- # Compat binaries, these must be compiled for use in a shared library even # though they may be placed in a static executable or library. Since they are # included in both the tcl library and the stub library, they need to be # relocatable. #-------------------------------------------------------------------------- mkstemp.o: $(COMPAT_DIR)/mkstemp.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/mkstemp.c strncasecmp.o: $(COMPAT_DIR)/strncasecmp.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strncasecmp.c waitpid.o: $(COMPAT_DIR)/waitpid.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/waitpid.c fake-rfc2553.o: $(COMPAT_DIR)/fake-rfc2553.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/fake-rfc2553.c # For building zlib, only used in some build configurations Zadler32.o: $(ZLIB_DIR)/adler32.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/adler32.c Zcompress.o: $(ZLIB_DIR)/compress.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/compress.c Zcrc32.o: $(ZLIB_DIR)/crc32.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/crc32.c Zdeflate.o: $(ZLIB_DIR)/deflate.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/deflate.c Zinfback.o: $(ZLIB_DIR)/infback.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/infback.c Zinffast.o: $(ZLIB_DIR)/inffast.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inffast.c Zinflate.o: $(ZLIB_DIR)/inflate.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inflate.c Zinftrees.o: $(ZLIB_DIR)/inftrees.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/inftrees.c Ztrees.o: $(ZLIB_DIR)/trees.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/trees.c Zuncompr.o: $(ZLIB_DIR)/uncompr.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/uncompr.c Zzutil.o: $(ZLIB_DIR)/zutil.c $(CC) -c -o $@ $(CC_SWITCHES) -I$(ZLIB_DIR) $(ZLIB_DIR)/zutil.c #-------------------------------------------------------------------------- # Stub library binaries, these must be compiled for use in a shared library # even though they will be placed in a static archive #-------------------------------------------------------------------------- tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclStubLib.c tclStubCall.o: $(GENERIC_DIR)/tclStubCall.c $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD \ -DCFG_RUNTIME_DLLFILE="\"$(TCL_LIB_FILE)\"" \ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ -DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \ $(GENERIC_DIR)/tclStubCall.c tclStubLibTbl.o: $(GENERIC_DIR)/tclStubLibTbl.c $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLibTbl.c tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c $(CC) -c $(STUB_CC_SWITCHES) @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclTomMathStubLib.c tclOOStubLib.o: $(GENERIC_DIR)/tclOOStubLib.c $(CC) -c $(STUB_CC_SWITCHES) @CFLAGS_NOLTO@ $(GENERIC_DIR)/tclOOStubLib.c .c.o: $(CC) -c $(CC_SWITCHES) $< #-------------------------------------------------------------------------- # Minizip implementation #-------------------------------------------------------------------------- adler32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/adler32.c compress.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/compress.c crc32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/crc32.c deflate.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/deflate.c ioapi.$(HOST_OBJEXT): $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \ $(ZLIB_DIR)/contrib/minizip/ioapi.c infback.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/infback.c inffast.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inffast.c inflate.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inflate.c inftrees.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/inftrees.c trees.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/trees.c uncompr.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/uncompr.c zip.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \ $(ZLIB_DIR)/contrib/minizip/zip.c zutil.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/zutil.c minizip.$(HOST_OBJEXT): $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c \ $(ZLIB_DIR)/contrib/minizip/minizip.c minizip${HOST_EXEEXT}: $(MINIZIP_OBJS) $(HOST_CC) -o $@ $(MINIZIP_OBJS) #-------------------------------------------------------------------------- # Bundled Package targets #-------------------------------------------------------------------------- # Propagate configure args like --enable-64bit to package configure PKG_CFG_ARGS = @PKG_CFG_ARGS@ # If PKG_DIR is changed to a different relative depth to the build dir, need # to adapt the ../.. relative paths below and at the top of configure.ac (we # cannot use absolute paths due to issues in nested configure when path to # build dir contains spaces). PKG_DIR = ./pkgs PKG8_DIR = ./pkgs8 configure-packages: @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ if [ -x $$i/configure ] ; then \ pkg=`basename $$i`; \ echo "Configuring package '$$pkg'"; \ mkdir -p $(PKG8_DIR)/$$pkg; \ if [ ! -f $(PKG8_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG8_DIR)/$$pkg; \ $$i/configure --with-tcl8 --with-tcl=../.. \ --with-tclinclude=$(GENERIC_DIR) \ $(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \ --enable-shared; ) || exit $$?; \ fi; \ mkdir -p $(PKG_DIR)/$$pkg; \ if [ ! -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG_DIR)/$$pkg; \ $$i/configure --with-tcl=../.. \ --with-tclinclude=$(GENERIC_DIR) \ $(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \ --enable-shared; ) || exit $$?; \ fi; \ fi; \ fi; \ done packages: configure-packages ${STUB_LIB_FILE} @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG8_DIR)/$$pkg/Makefile ] ; then \ echo "Building package '$$pkg' for Tcl 8"; \ ( cd $(PKG8_DIR)/$$pkg; $(MAKE); ) || exit $$?; \ fi; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ echo "Building package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE); ) || exit $$?; \ fi; \ fi; \ done install-packages: packages @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG8_DIR)/$$pkg/Makefile ] ; then \ echo "Installing package '$$pkg' for Tcl 8"; \ ( cd $(PKG8_DIR)/$$pkg; $(MAKE) install \ "DESTDIR=$(INSTALL_ROOT)"; ) || exit $$?; \ fi; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ echo "Installing package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) install \ "DESTDIR=$(INSTALL_ROOT)"; ) || exit $$?; \ fi; \ fi; \ done test-packages: ${TCLTEST_EXE} packages @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ echo "Testing package '$$pkg'"; \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) \ "@LD_LIBRARY_PATH_VAR@=../..:$${@LD_LIBRARY_PATH_VAR@}" \ "TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" \ "TCLLIBPATH=../../pkgs" test \ "TCLSH_PROG=../../${TCLTEST_EXE}"; ) \ fi; \ fi; \ done clean-packages: @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG8_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG8_DIR)/$$pkg; $(MAKE) clean; ) \ fi; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) clean; ) \ fi; \ fi; \ done distclean-packages: @for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG8_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG8_DIR)/$$pkg; $(MAKE) distclean; ) \ fi; \ rm -rf $(PKG8_DIR)/$$pkg; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) distclean; ) \ fi; \ rm -rf $(PKG_DIR)/$$pkg; \ fi; \ done; \ rm -rf $(PKG8_DIR) rm -rf $(PKG_DIR) dist-packages: configure-packages @rm -rf $(DISTROOT)/pkgs; \ mkdir -p $(DISTROOT)/pkgs; \ for i in $(PKGS_DIR)/*; do \ if [ -d $$i ] ; then \ pkg=`basename $$i`; \ if [ -f $(PKG_DIR)/$$pkg/Makefile ] ; then \ ( cd $(PKG_DIR)/$$pkg; $(MAKE) dist \ "DIST_ROOT=$(DISTROOT)/pkgs"; ) || exit $$?; \ fi; \ fi; \ done #-------------------------------------------------------------------------- # Maintainer-only targets #-------------------------------------------------------------------------- # The following target generates the file generic/tclDate.c from the yacc # grammar found in generic/tclGetDate.y. This is only run by hand as yacc is # not available in all environments. The name of the .c file is different than # the name of the .y file so that make doesn't try to automatically regenerate # the .c file. # gendate: bison --output-file=$(GENERIC_DIR)/tclDate.c \ --no-lines \ --name-prefix=TclDate \ $(GENERIC_DIR)/tclGetDate.y # yacc -l $(GENERIC_DIR)/tclGetDate.y # sed -e 's/yy/TclDate/g' -e '/^#include /d' \ # -e 's?SCCSID?RCS: @(#) ?' \ # -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \ # -e '/TclDatenewstate:/d' -e '/#pragma/d' \ # -e '/#include /d' \ # -e '/#define YYNEW/s/malloc/TclDateAlloc/g' \ # -e '/#define YYENLARGE/,/realloc/s/realloc/TclDateRealloc/g' \ # $(GENERIC_DIR)/tclDate.c # rm y.tab.c # # Target to regenerate header files and stub files from the *.decls tables. # $(GENERIC_DIR)/tclStubInit.c: $(GENERIC_DIR)/tcl.decls \ $(GENERIC_DIR)/tclInt.decls $(GENERIC_DIR)/tclTomMath.decls @echo "Warning: tclStubInit.c may be out of date." @echo "Developers may want to run \"make genstubs\" to regenerate." @echo "This warning can be safely ignored, do not report as a bug!" $(GENERIC_DIR)/tclOOStubInit.c: $(GENERIC_DIR)/tclOO.decls @echo "Warning: tclOOStubInit.c may be out of date." @echo "Developers may want to run \"make genstubs\" to regenerate." @echo "This warning can be safely ignored, do not report as a bug!" genstubs: $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ $(GENERIC_DIR)/tcl.decls $(GENERIC_DIR)/tclInt.decls \ $(GENERIC_DIR)/tclTomMath.decls $(NATIVE_TCLSH) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ $(GENERIC_DIR)/tclOO.decls # # Target to check that all exported functions have an entry in the stubs # tables. # checkstubs: $(TCL_LIB_FILE) -@for i in `nm -p $(TCL_LIB_FILE) \ | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \ | sort -n` ; do \ match=0; \ for j in $(TCL_DECLS); do \ if [ `grep -c "$$i *(" $$j` -gt 0 ] ; then \ match=1; \ fi; \ done; \ if [ $$match -eq 0 ] ; then \ echo $$i; \ fi; \ done # # Target to check that all public APIs which are not command implementations # have an entry in section three of the distributed manpages. # checkdoc: $(TCL_LIB_FILE) -@for i in `nm -p $(TCL_LIB_FILE) | awk '$$3 ~ /Tcl_/ { print $$3 }' \ | grep -Fv . | grep -v 'Cmd$$' | sort -n`; do \ match=0; \ i=`echo $$i | sed 's/^_//'`; \ for j in $(TOP_DIR)/doc/*.3; do \ if [ `grep '\-' $$j | grep -c $$i` -gt 0 ]; then \ match=1; \ fi; \ done; \ if [ $$match -eq 0 ]; then \ echo $$i; \ fi; \ done # # Target to check for proper usage of UCHAR macro. # checkuchar: -@egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR # # Target to make sure that only symbols with "Tcl" prefixes are exported. # checkexports: $(TCL_LIB_FILE) -@nm -p $(TCL_LIB_FILE) \ | awk '$$2 ~ /^[TDBCS]$$/ { sub("^_", "", $$3); print $$3 }' \ | sort -n | grep -E -v '^[Tt]cl' || true #-------------------------------------------------------------------------- # Distribution building rules #-------------------------------------------------------------------------- # # Target to create a Tcl RPM for Linux. Requires that you be on a Linux # system. # RPM_PLATFORMS = i386 rpm: all -@rm -f THIS.TCL.SPEC echo "%define _builddir `pwd`" > THIS.TCL.SPEC echo "%define _rpmdir `pwd`/RPMS" >> THIS.TCL.SPEC cat tcl.spec >> THIS.TCL.SPEC for platform in $(RPM_PLATFORMS); do \ mkdir -p RPMS/$$platform && \ rpmbuild -bb THIS.TCL.SPEC && \ mv RPMS/$$platform/*.rpm .; \ done -rm -rf RPMS THIS.TCL.SPEC # # Target to create a proper Tcl distribution from information in the # source directory. DISTDIR must be defined to indicate where to put # the distribution. DISTDIR must be an absolute path name. # DISTROOT = /tmp/dist DISTNAME = tcl${VERSION}${PATCH_LEVEL} ZIPNAME = tcl${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip DISTDIR = $(DISTROOT)/$(DISTNAME) DIST_INSTALL_DATA = $(INSTALL) -p -m 644 DIST_INSTALL_SCRIPT = $(INSTALL) -p -m 755 BUILTIN_PACKAGE_LIST = cookiejar http opt msgcat registry dde tcltest platform $(UNIX_DIR)/configure: $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tcl.m4 \ $(UNIX_DIR)/aclocal.m4 cd $(UNIX_DIR); autoconf $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure cd $(MAC_OSX_DIR); autoconf $(UNIX_DIR)/tclConfig.h.in: $(MAC_OSX_DIR)/configure cd $(MAC_OSX_DIR); autoheader; touch $@ tclUuid.h: $(TOP_DIR)/manifest.uuid echo "#define TCL_VERSION_UUID \\" >$@ cat $(TOP_DIR)/manifest.uuid >>$@ echo "" >>$@ $(TOP_DIR)/manifest.uuid: printf "git-" >$(TOP_DIR)/manifest.uuid (cd $(TOP_DIR); git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid || \ (printf "svn-r" >$(TOP_DIR)/manifest.uuid ; \ svn info --show-item last-changed-revision >>$(TOP_DIR)/manifest.uuid) || \ printf "unknown" >$(TOP_DIR)/manifest.uuid) dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in genstubs \ $(MAC_OSX_DIR)/configure $(TOP_DIR)/manifest.uuid dist-packages ${NATIVE_TCLSH} rm -rf $(DISTDIR) $(INSTALL_DATA_DIR) $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(TOP_DIR)/manifest.uuid $(DISTDIR) $(DIST_INSTALL_DATA) $(UNIX_DIR)/*.c $(UNIX_DIR)/tclUnixPort.h $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(UNIX_DIR)/configure.ac \ $(UNIX_DIR)/tcl.m4 $(UNIX_DIR)/aclocal.m4 \ $(UNIX_DIR)/tclConfig.sh.in $(UNIX_DIR)/tclooConfig.sh \ $(UNIX_DIR)/install-sh \ $(UNIX_DIR)/README $(UNIX_DIR)/tcl.spec \ $(UNIX_DIR)/installManPage $(UNIX_DIR)/tclConfig.h.in \ $(UNIX_DIR)/tcl.pc.in $(DISTDIR)/unix $(DIST_INSTALL_SCRIPT) $(UNIX_DIR)/configure $(UNIX_DIR)/ldAix $(DISTDIR)/unix $(INSTALL_DATA_DIR) $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.[cdh] $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.decls $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/README $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/tclGetDate.y $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(TOP_DIR)/changes.md $(TOP_DIR)/README.md \ $(TOP_DIR)/license.terms $(DISTDIR) $(INSTALL_DATA_DIR) $(DISTDIR)/library $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \ $(TOP_DIR)/library/manifest.txt \ $(TOP_DIR)/library/tclIndex $(DISTDIR)/library @for i in $(BUILTIN_PACKAGE_LIST); do \ $(INSTALL_DATA_DIR) $(DISTDIR)/library/$$i;\ $(DIST_INSTALL_DATA) $(TOP_DIR)/library/$$i/*.tcl $(DISTDIR)/library/$$i; \ done $(DIST_INSTALL_DATA) $(TOP_DIR)/library/cookiejar/*.dat.gz $(DISTDIR)/library/cookiejar $(INSTALL_DATA_DIR) $(DISTDIR)/library/encoding $(DIST_INSTALL_DATA) $(TOP_DIR)/library/encoding/*.enc $(DISTDIR)/library/encoding $(INSTALL_DATA_DIR) $(DISTDIR)/library/msgs $(DIST_INSTALL_DATA) $(TOP_DIR)/library/msgs/*.msg $(DISTDIR)/library/msgs @echo cp -r $(TOP_DIR)/library/tzdata $(DISTDIR)/library/tzdata @( cd $(TOP_DIR); find library/tzdata -type f -print ) \ | ( cd $(TOP_DIR) ; xargs tar cf - ) \ | ( cd $(DISTDIR) ; tar xfp - ) $(INSTALL_DATA_DIR) $(DISTDIR)/doc $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \ $(TOP_DIR)/doc/man.macros $(DISTDIR)/doc $(INSTALL_DATA_DIR) $(DISTDIR)/compat $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(COMPAT_DIR)/*.[ch] \ $(COMPAT_DIR)/README $(DISTDIR)/compat $(INSTALL_DATA_DIR) $(DISTDIR)/compat/zlib @echo cp -r $(COMPAT_DIR)/zlib $(DISTDIR)/compat/zlib @( cd $(COMPAT_DIR)/zlib; find . -type f -print ) \ | ( cd $(COMPAT_DIR)/zlib ; xargs tar cf - ) \ | ( cd $(DISTDIR)/compat/zlib ; tar xfp - ) $(INSTALL_DATA_DIR) $(DISTDIR)/libtommath @echo cp -r $(TOP_DIR)/libtommath $(DISTDIR)/libtommath @( cd $(TOP_DIR)/libtommath; find . -type f -print ) \ | ( cd $(TOP_DIR)/libtommath ; xargs tar cf - ) \ | ( cd $(DISTDIR)/libtommath ; tar xfp - ) $(INSTALL_DATA_DIR) $(DISTDIR)/tests $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/tests $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/*.test $(TOP_DIR)/tests/README \ $(TOP_DIR)/tests/*.bench $(TOP_DIR)/tests/*.tar.gz \ $(TOP_DIR)/tests/httpd $(TOP_DIR)/tests/*.tcl \ $(TOP_DIR)/tests/*.zip $(DISTDIR)/tests @mkdir $(DISTDIR)/tests/auto0 for i in auto1 auto2 ; \ do \ $(INSTALL_DATA_DIR) $(DISTDIR)/tests/auto0/$$i ;\ $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/auto0/$$i/tclIndex $(TOP_DIR)/tests/auto0/$$i/*.tcl \ $(DISTDIR)/tests/auto0/$$i; \ done; for i in modules modules/mod1 modules/mod2 ; \ do \ $(INSTALL_DATA_DIR) $(DISTDIR)/tests/auto0/$$i ;\ $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/auto0/$$i/*.tm \ $(DISTDIR)/tests/auto0/$$i; \ done; @mkdir $(DISTDIR)/tests/zipfiles $(INSTALL_DATA_DIR) $(DISTDIR)/tests/zipfiles $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/*.zip \ $(DISTDIR)/tests/zipfiles $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/README \ $(DISTDIR)/tests/zipfiles $(DIST_INSTALL_DATA) $(TOP_DIR)/tests/zipfiles/LICENSE-libzip \ $(DISTDIR)/tests/zipfiles $(INSTALL_DATA_DIR) $(DISTDIR)/tests-perf $(DIST_INSTALL_DATA) $(TOP_DIR)/tests-perf/*.tcl $(DISTDIR)/tests-perf $(INSTALL_DATA_DIR) $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/configure.ac \ $(TOP_DIR)/win/tclConfig.sh.in $(TOP_DIR)/win/tclooConfig.sh \ $(TOP_DIR)/win/tcl.m4 $(TOP_DIR)/win/aclocal.m4 \ $(TOP_DIR)/win/tclsh.exe.manifest.in $(TOP_DIR)/win/tclUuid.h.in \ $(TOP_DIR)/win/gitmanifest.in $(TOP_DIR)/win/svnmanifest.in \ $(TOP_DIR)/win/x86_64-w64-mingw32-nmakehlp.exe $(DISTDIR)/win chmod 775 $(DISTDIR)/win/x86_64-w64-mingw32-nmakehlp.exe $(DIST_INSTALL_SCRIPT) $(TOP_DIR)/win/configure $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.ico $(TOP_DIR)/win/*.rc \ $(TOP_DIR)/win/tclWinInt.h $(TOP_DIR)/win/tclWinPort.h \ $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.bat $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.vc $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/tcl.ds* $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/README $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/win $(INSTALL_DATA_DIR) $(DISTDIR)/macosx $(DIST_INSTALL_DATA) $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \ $(MAC_OSX_DIR)/*.c $(MAC_OSX_DIR)/*.in \ $(MAC_OSX_DIR)/*.ac \ $(DISTDIR)/macosx $(DIST_INSTALL_SCRIPT) $(MAC_OSX_DIR)/configure $(DISTDIR)/macosx $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/macosx $(INSTALL_DATA_DIR) $(DISTDIR)/unix/dltest $(DIST_INSTALL_DATA) $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \ $(UNIX_DIR)/dltest/README $(DISTDIR)/unix/dltest $(INSTALL_DATA_DIR) $(DISTDIR)/tools $(DIST_INSTALL_DATA) $(TOOL_DIR)/README $(TOOL_DIR)/*.c $(TOOL_DIR)/*.svg \ $(TOOL_DIR)/*.tcl $(TOOL_DIR)/*.bmp $(TOOL_DIR)/valgrind_suppress \ $(TOOL_DIR)/valgrind_check_success $(DISTDIR)/tools chmod 755 $(DISTDIR)/tools/checkLibraryDoc.tcl \ $(DISTDIR)/tools/findBadExternals.tcl \ $(DISTDIR)/tools/loadICU.tcl $(DISTDIR)/tools/addVerToFile.tcl \ $(DISTDIR)/tools/makeTestCases.tcl $(DISTDIR)/tools/tclZIC.tcl \ $(DISTDIR)/tools/tcltk-man2html.tcl $(DISTDIR)/win/buildall.vc.bat \ $(DISTDIR)/unix/install-sh $(DISTDIR)/unix/installManPage $(INSTALL_DATA_DIR) $(DISTDIR)/pkgs $(DIST_INSTALL_DATA) $(TOP_DIR)/pkgs/README $(DISTDIR)/pkgs $(DIST_INSTALL_DATA) $(TOP_DIR)/pkgs/package.list.txt $(DISTDIR)/pkgs for i in `ls $(DISTROOT)/pkgs/*.tar.gz 2> /dev/null`; do \ tar -C $(DISTDIR)/pkgs -xzf "$$i"; \ done $(INSTALL_DATA_DIR) $(DISTDIR)/.github/workflows $(DIST_INSTALL_DATA) $(TOP_DIR)/.github/workflows/*.yml $(DISTDIR)/.github/workflows alldist: dist rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME) ( cd $(DISTROOT); \ tar cf $(DISTNAME)-src.tar $(DISTNAME); \ gzip -9 $(DISTNAME)-src.tar; \ zip -qr8 $(ZIPNAME) $(DISTNAME) ) #-------------------------------------------------------------------------- # This target creates the HTML folder for Tcl & Tk and places it in # DISTDIR/html. It uses the tcltk-man2html.tcl tool from the Tcl group's tool # workspace. It depends on the Tcl & Tk being in directories called tcl9.* & # tk9.* up two directories from the TOOL_DIR. # # Note that for platforms where this is important, it is more common to use a # build of this HTML documentation that has already been placed online. As # such, this rule is not guaranteed to work well on all systems; it only needs # to function on those of the Tcl/Tk maintainers. # # Also note that the 8.6 tool build requires an installed 8.6 native Tcl # interpreter in order to be able to run. #-------------------------------------------------------------------------- html: ${NATIVE_TCLSH} $(BUILD_HTML) @EXTRA_BUILD_HTML@ html-tcl: ${NATIVE_TCLSH} $(BUILD_HTML) --tcl @EXTRA_BUILD_HTML@ html-tk: ${NATIVE_TCLSH} $(BUILD_HTML) --tk @EXTRA_BUILD_HTML@ BUILD_HTML = \ @${NATIVE_TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl \ --useversion=$(MAJOR_VERSION).$(MINOR_VERSION) \ --htmldir="$(HTML_INSTALL_DIR)" \ --srcdir=$(TOP_DIR) $(BUILD_HTML_FLAGS) #-------------------------------------------------------------------------- # The list of all the targets that do not correspond to real files. This stops # 'make' from getting confused when someone makes an error in a rule. #-------------------------------------------------------------------------- .PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest .PHONY: install install-strip install-binaries install-libraries .PHONY: install-headers install-private-headers install-doc .PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar .PHONY: shell gdb valgrind valgrindshell dist alldist rpm .PHONY: tclLibObjs tcltest-real test-tcl gdb-test ro-test trace-test xttest .PHONY: topDirName gendate gentommath_h trace-shell checkdoc .PHONY: install-tzdata install-msgs .PHONY: packages configure-packages test-packages clean-packages .PHONY: dist-packages distclean-packages install-packages .PHONY: tclzipfile #-------------------------------------------------------------------------- # DO NOT DELETE THIS LINE -- make depend depends on it. tcl9.0.3/unix/ldAix0000755000175000017500000000373515076154272013541 0ustar sergeisergei#!/bin/sh # # ldAix ldCmd ldArg ldArg ... # # This shell script provides a wrapper for ld under AIX in order to # create the .exp file required for linking. Its arguments consist # of the name and arguments that would normally be provided to the # ld command. This script extracts the names of the object files # from the argument list, creates a .exp file describing all of the # symbols exported by those files, and then invokes "ldCmd" to # perform the real link. # Extract from the arguments the names of all of the object files. args=$* ofiles="" for i do x=`echo $i | grep '[^.].o$'` if test "$x" != ""; then ofiles="$ofiles $i" fi done # Extract the name of the object file that we're linking. outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'` # Create the export file from all of the object files, using nm followed # by sed editing. Here are some tricky aspects of this: # # - Use the -X32_64 switch to nm to handle 32 or 64bit compiles. # - Eliminate lines that end in ":": these are the names of object files # - Eliminate entries with the "U" key letter; these are undefined symbols # - If a line starts with ".", delete the leading ".", since this will just # cause confusion later # - Eliminate everything after the first field in a line, so that we're # left with just the symbol name nmopts="-g -C -h -X32_64" rm -f lib.exp echo "#! $outputFile" >lib.exp /usr/ccs/bin/nm $nmopts $ofiles | sed -e '/:$/d' -e '/ U /d' -e 's/^\.//' -e 's/[ |].*//' | sort | uniq >>lib.exp # If we're linking a .a file, then link all the objects together into a # single file "shr.o" and then put that into the archive. Otherwise link # the object files directly into the .a file. noDotA=`echo $outputFile | sed -e '/\.a$/d'` echo "noDotA=\"$noDotA\"" if test "$noDotA" = "" ; then linkArgs=`echo $args | sed -e 's/-o .*\.a /-o shr.o /'` echo $linkArgs eval $linkArgs echo ar cr $outputFile shr.o ar cr $outputFile shr.o rm -f shr.o else eval $args fi tcl9.0.3/unix/installManPage0000755000175000017500000000610115076154272015365 0ustar sergeisergei#!/bin/sh ######################################################################## ### Parse Options ### Gzip=: Sym="" Loc="" Gz="" Suffix="" while true; do case $1 in -s | --symlinks ) Sym="-s " ;; -z | --compress ) Gzip=$2; shift ;; -e | --extension ) Gz=$2; shift ;; -x | --suffix ) Suffix=$2; shift ;; -*) cat < file dir" exit 1 fi ######################################################################## ### Parse Required Arguments ### ManPage=$1 Dir=$2 if test -f $ManPage ; then : ; else echo "source manual page file must exist" exit 1 fi if test -d "$Dir" ; then : ; else echo "target directory must exist" exit 1 fi test -z "$Sym" && Loc="$Dir/" ######################################################################## ### Extract Target Names from Manual Page ### # A sed script to parse the alternative names out of a man page. # # Backslashes are trippled in the sed script, because it is in # backticks which doesn't pass backslashes literally. # Names=`sed -n ' # Look for a line that starts with .SH NAME /^\.SH NAME/,/^\./{ /^\./!{ # Remove all commas... s/,//g # ... and backslash-escaped spaces. s/\\\ //g /\\\-.*/{ # Delete from \- to the end of line s/ \\\-.*// h s/.*/./ x } # Convert all non-space non-alphanum sequences # to single underscores. s/[^ A-Za-z0-9][^ A-Za-z0-9]*/_/g p g /^\./{ q } } }' $ManPage` if test -z "$Names" ; then echo "warning: no target names found in $ManPage" fi ######################################################################## ### Remaining Set Up ### case $ManPage in *.1) Section=1 ;; *.3) Section=3 ;; *.n) Section=n ;; *) echo "unknown section for $ManPage" exit 2 ;; esac Name=`basename $ManPage .$Section` SrcDir=`dirname $ManPage` ######################################################################## ### Process Page to Create Target Pages ### Specials="DString Thread Notifier RegExp library packagens pkgMkIndex safesock FindPhoto FontId MeasureChar" for n in $Specials; do if [ "$Name" = "$n" ] ; then Names="$n $Names" fi done First="" for Target in $Names; do Target=$Target.$Section$Suffix rm -f "$Dir/$Target" "$Dir/$Target.*" if test -z "$First" ; then First=$Target sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ $ManPage > "$Dir/$First" chmod 644 "$Dir/$First" $Gzip "$Dir/$First" else ln $Sym"$Loc$First$Gz" "$Dir/$Target$Gz" fi done ######################################################################## exit 0 tcl9.0.3/unix/install-sh0000755000175000017500000003577615076154272014570 0ustar sergeisergei#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: tcl9.0.3/unix/dltest/0000755000175000017500000000000015104662760014037 5ustar sergeisergeitcl9.0.3/unix/dltest/README0000644000175000017500000000037015035744306014717 0ustar sergeisergeiThis directory contains several files for testing Tcl's dynamic loading/unloading capabilities. If shared libraries are supported then the build system in the parent directory will create the shared libs and load them into the tcltest executable. tcl9.0.3/unix/dltest/pkgπ.c0000644000175000017500000000366515104661341015507 0ustar sergeisergei/* * pkgπ.c -- * * This file contains a simple Tcl package "pkgπ" that is intended for * testing the Tcl dynamic loading facilities. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" /* *---------------------------------------------------------------------- * * Pkga_EqObjCmd -- * * This procedure is invoked to process the "pkga_eq" Tcl command. It * expects two arguments and returns 1 if they are the same, 0 if they * are different. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkg\u03C0_\u03A0ObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewDoubleObj(3.14159)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgπ_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkg\u03C0_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "9.0", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgπ", "1.0"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "π", Pkg\u03C0_\u03A0ObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/pkgua.c0000644000175000017500000002104415104661341015305 0ustar sergeisergei/* * pkgua.c -- * * This file contains a simple Tcl package "pkgua" that is intended for * testing the Tcl dynamic unloading facilities. * * Copyright © 1995 Sun Microsystems, Inc. * Copyright © 2004 Georgios Petasis * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tcl.h" /* * In the following hash table we are going to store a struct that holds all * the command tokens created by Tcl_CreateObjCommand in an interpreter, * indexed by the interpreter. In this way, we can find which command tokens * we have registered in a specific interpreter, in order to unload them. We * need to keep the various command tokens we have registered, as they are the * only safe way to unregister our registered commands, even if they have been * renamed. */ typedef struct ThreadSpecificData { int interpTokenMapInitialised; Tcl_HashTable interpTokenMap; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; #define MAX_REGISTERED_COMMANDS 2 static void CommandDeleted(void *clientData) { Tcl_Command *cmdToken = (Tcl_Command *)clientData; *cmdToken = NULL; } static void PkguaInitTokensHashTable(void) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData)); if (tsdPtr->interpTokenMapInitialised) { return; } Tcl_InitHashTable(&tsdPtr->interpTokenMap, TCL_ONE_WORD_KEYS); tsdPtr->interpTokenMapInitialised = 1; } static void PkguaFreeTokensHashTable(void) { Tcl_HashSearch search; Tcl_HashEntry *entryPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData)); for (entryPtr = Tcl_FirstHashEntry(&tsdPtr->interpTokenMap, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) { Tcl_Free((char *) Tcl_GetHashValue(entryPtr)); } tsdPtr->interpTokenMapInitialised = 0; } static Tcl_Command * PkguaInterpToTokens( Tcl_Interp *interp) { int newEntry; Tcl_Command *cmdTokens; ThreadSpecificData *tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData((&dataKey), sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr = Tcl_CreateHashEntry(&tsdPtr->interpTokenMap, (char *) interp, &newEntry); if (newEntry) { cmdTokens = (Tcl_Command *) Tcl_Alloc(sizeof(Tcl_Command) * (MAX_REGISTERED_COMMANDS)); for (newEntry=0 ; newEntryinterpTokenMap, interp); if (entryPtr) { Tcl_Free((char *) Tcl_GetHashValue(entryPtr)); Tcl_DeleteHashEntry(entryPtr); } } /* *---------------------------------------------------------------------- * * PkguaEqObjCmd -- * * This procedure is invoked to process the "pkgua_eq" Tcl command. It * expects two arguments and returns 1 if they are the same, 0 if they * are different. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int PkguaEqObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; const char *str1, *str2; Tcl_Size len1, len2; (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string1 string2"); return TCL_ERROR; } str1 = Tcl_GetStringFromObj(objv[1], &len1); str2 = Tcl_GetStringFromObj(objv[2], &len2); len1 = Tcl_NumUtfChars(str1, len1); len2 = Tcl_NumUtfChars(str2, len2); if (len1 == len2) { result = (Tcl_UtfNcmp(str1, str2, (size_t)len1) == 0); } else { result = 0; } Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); return TCL_OK; } /* *---------------------------------------------------------------------- * * PkguaQuoteObjCmd -- * * This procedure is invoked to process the "pkgua_quote" Tcl command. It * expects one argument, which it returns as result. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int PkguaQuoteObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "value"); return TCL_ERROR; } Tcl_SetObjResult(interp, objv[1]); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgua_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgua_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; Tcl_Command *cmdTokens; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } /* * Initialize our Hash table, where we store the registered command tokens * for each interpreter. */ PkguaInitTokensHashTable(); code = Tcl_PkgProvide(interp, "pkgua", "1.0"); if (code != TCL_OK) { return code; } Tcl_SetVar2(interp, "::pkgua_loaded", NULL, ".", TCL_APPEND_VALUE); cmdTokens = PkguaInterpToTokens(interp); cmdTokens[0] = Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, &cmdTokens[0], CommandDeleted); cmdTokens[1] = Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd, &cmdTokens[1], CommandDeleted); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgua_SafeInit -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to a safe interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgua_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { return Pkgua_Init(interp); } /* *---------------------------------------------------------------------- * * Pkgua_Unload -- * * This is a package unloading initialization procedure, which is called * by Tcl when this package is to be unloaded from an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgua_Unload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ int flags) /* Flags passed by the unloading mechanism */ { int code, cmdIndex; Tcl_Command *cmdTokens = PkguaInterpToTokens(interp); for (cmdIndex=0 ; cmdIndex /* *---------------------------------------------------------------------- * * Pkgooa_StubsOKObjCmd -- * * This procedure is invoked to process the "pkgooa_stubsok" Tcl command. * It gives 1 if stubs are used correctly, 0 if stubs are not OK. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgooa_StubsOKObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj( Tcl_CopyObjectInstance == tclOOStubsPtr->tcl_CopyObjectInstance)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgooa_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ extern void *tclOOIntStubsPtr; static TclOOStubs stubsCopy = { TCL_STUB_MAGIC, NULL, /* It doesn't really matter what implementation of * Tcl_CopyObjectInstance is put in the "pseudo" * stub table, since the test-case never actually * calls this function. All that matters is that it's * a function with a different memory address than * the real Tcl_CopyObjectInstance function in Tcl. */ (Tcl_Object (*) (Tcl_Interp *, Tcl_Object, const char *, const char *t))(void *)Pkgooa_StubsOKObjCmd, /* More entries could be here, but those are not used * for this test-case. So, being NULL is OK. */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; DLLEXPORT int Pkgooa_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; /* Any TclOO extension which uses stubs, calls * both Tcl_InitStubs and Tcl_OOInitStubs() and * does not use any Tcl 8.6 features should be * loadable in Tcl 8.5 as well, provided the * TclOO extension (for Tcl 8.5) is installed. * This worked in Tcl 8.6.0, and is expected * to keep working in all future Tcl 8.x releases. */ if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } if (tclStubsPtr == NULL) { Tcl_AppendResult(interp, "Tcl stubs are not initialized, " "did you compile using -DUSE_TCL_STUBS? ", (char *)NULL); return TCL_ERROR; } if (Tcl_OOInitStubs(interp) == NULL) { return TCL_ERROR; } if (tclOOStubsPtr == NULL) { Tcl_AppendResult(interp, "TclOO stubs are not initialized", (char *)NULL); return TCL_ERROR; } if (tclOOIntStubsPtr == NULL) { Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", (char *)NULL); return TCL_ERROR; } /* Test case for Bug [f51efe99a7]. * * Let tclOOStubsPtr point to an alternate stub table * (with only a single function, that's enough for * this test). This way, the function "pkgooa_stubsok" * can check whether the TclOO function calls really * use the stub table, or only pretend to. * * On platforms without backlinking (Windows, Cygwin, * AIX), this code doesn't even compile without using * stubs, but on UNIX ELF systems, the problem is * less visible. */ tclOOStubsPtr = &stubsCopy; code = Tcl_PkgProvide(interp, "pkgooa", "1.0"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgooa_stubsok", Pkgooa_StubsOKObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/pkge.c0000644000175000017500000000223415104661341015124 0ustar sergeisergei/* * pkge.c -- * * This file contains a simple Tcl package "pkge" that is intended for * testing the Tcl dynamic loading facilities. Its Init procedure returns * an error in order to test how this is handled. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" /* *---------------------------------------------------------------------- * * Pkge_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * Returns TCL_ERROR and leaves an error message in interp->result. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkge_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { static const char script[] = "if 44 {open non_existent}"; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } return Tcl_EvalEx(interp, script, TCL_INDEX_NONE, 0); } tcl9.0.3/unix/dltest/pkgd.c0000644000175000017500000000731415104661341015127 0ustar sergeisergei/* * pkgd.c -- * * This file contains a simple Tcl package "pkgd" that is intended for * testing the Tcl dynamic loading facilities. It can be used in both * safe and unsafe interpreters. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" /* *---------------------------------------------------------------------- * * Pkgd_SubObjCmd -- * * This procedure is invoked to process the "pkgd_sub" Tcl command. It * expects two arguments and returns their difference. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgd_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "num num"); return TCL_ERROR; } if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) { return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgd_UnsafeCmd -- * * This procedure is invoked to process the "pkgd_unsafe" Tcl command. It * just returns a constant string. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgd_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; (void)objc; (void)objv; Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", TCL_INDEX_NONE)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgd_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgd_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgd", "7.3"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgd_SafeInit -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to a safe interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgd_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgd", "7.3"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/pkgc.c0000644000175000017500000000732015104661341015123 0ustar sergeisergei/* * pkgc.c -- * * This file contains a simple Tcl package "pkgc" that is intended for * testing the Tcl dynamic loading facilities. It can be used in both * safe and unsafe interpreters. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" /* *---------------------------------------------------------------------- * * Pkgc_SubObjCmd -- * * This procedure is invoked to process the "pkgc_sub" Tcl command. It * expects two arguments and returns their difference. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgc_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "num num"); return TCL_ERROR; } if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) { return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgc_UnsafeCmd -- * * This procedure is invoked to process the "pkgc_unsafe" Tcl command. It * just returns a constant string. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgc_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; (void)objc; (void)objv; Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", TCL_INDEX_NONE)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgc_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgc_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgc", "1.7.2"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgc_SafeInit -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to a safe interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgc_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgc", "1.7.2"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/pkgb.c0000644000175000017500000001114515104661341015122 0ustar sergeisergei/* * pkgb.c -- * * This file contains a simple Tcl package "pkgb" that is intended for * testing the Tcl dynamic loading facilities. It can be used in both * safe and unsafe interpreters. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" #if defined(_WIN32) && defined(_MSC_VER) # define snprintf _snprintf #endif /* *---------------------------------------------------------------------- * * Pkgb_SubObjCmd -- * * This procedure is invoked to process the "pkgb_sub" Tcl command. It * expects two arguments and returns their difference. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgb_SubObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int first, second; (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "num num"); return TCL_ERROR; } if ((Tcl_GetIntFromObj(interp, objv[1], &first) != TCL_OK) || (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) { char buf[TCL_INTEGER_SPACE]; snprintf(buf, sizeof(buf), "%d", Tcl_GetErrorLine(interp)); Tcl_AppendResult(interp, " in line: ", buf, (char *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgb_UnsafeObjCmd -- * * This procedure is invoked to process the "pkgb_unsafe" Tcl command. It * just returns a constant string. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkgb_UnsafeObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void)dummy; (void)objc; (void)objv; return Tcl_EvalEx(interp, "list unsafe command invoked", TCL_INDEX_NONE, TCL_EVAL_GLOBAL); } static int Pkgb_DemoObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_WideInt numChars; int result; (void)dummy; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "arg1 arg2 num"); return TCL_ERROR; } if (Tcl_GetWideIntFromObj(interp, objv[3], &numChars) != TCL_OK) { return TCL_ERROR; } result = Tcl_UtfNcmp(Tcl_GetString(objv[1]), Tcl_GetString(objv[2]), (size_t)numChars); Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgb_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgb_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgb", "2.3"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkgb_SafeInit -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to a safe interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkgb_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkgb", "2.3"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/pkga.c0000644000175000017500000000617015104661341015123 0ustar sergeisergei/* * pkga.c -- * * This file contains a simple Tcl package "pkga" that is intended for * testing the Tcl dynamic loading facilities. * * Copyright © 1995 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #undef STATIC_BUILD #include "tcl.h" /* *---------------------------------------------------------------------- * * Pkga_EqObjCmd -- * * This procedure is invoked to process the "pkga_eq" Tcl command. It * expects two arguments and returns 1 if they are the same, 0 if they * are different. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkga_EqObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { int result; const char *str1, *str2; Tcl_Size len1, len2; (void)dummy; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string1 string2"); return TCL_ERROR; } str1 = Tcl_GetStringFromObj(objv[1], &len1); str2 = Tcl_GetStringFromObj(objv[2], &len2); len1 = Tcl_NumUtfChars(str1, len1); len2 = Tcl_NumUtfChars(str2, len2); if (len1 == len2) { result = (Tcl_UtfNcmp(str1, str2, (size_t)len1) == 0); } else { result = 0; } Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkga_QuoteObjCmd -- * * This procedure is invoked to process the "pkga_quote" Tcl command. It * expects one argument, which it returns as result. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ static int Pkga_QuoteObjCmd( void *dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "value"); return TCL_ERROR; } Tcl_SetObjResult(interp, objv[1]); return TCL_OK; } /* *---------------------------------------------------------------------- * * Pkga_Init -- * * This is a package initialization procedure, which is called by Tcl * when this package is to be added to an interpreter. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ DLLEXPORT int Pkga_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ { int code; if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } code = Tcl_PkgProvide(interp, "pkga", "1.0"); if (code != TCL_OK) { return code; } Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL, NULL); return TCL_OK; } tcl9.0.3/unix/dltest/Makefile.in0000644000175000017500000001215615104661341016103 0ustar sergeisergei# This Makefile is used to create several test cases for Tcl's load # command. It also illustrates how to take advantage of configuration # exported by Tcl to set up Makefiles for shared libraries. CC = @CC@ LIBS = @TCL_BUILD_STUB_LIB_SPEC@ @TCL_LIBS@ AC_FLAGS = @DEFS@ SHLIB_LD = @SHLIB_LD@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ DLTEST_LD = @DLTEST_LD@ DLTEST_SUFFIX = @DLTEST_SUFFIX@ SRC_DIR = @TCL_SRC_DIR@/unix/dltest BUILD_DIR = @builddir@ TCL_VERSION= @TCL_VERSION@ CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ CFLAGS = @CFLAGS_DEFAULT@ @CFLAGS@ -DTCL_NO_DEPRECATED=1 -Wall -Wextra -Wc++-compat -Wconversion -Werror LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic \ ${SHLIB_CFLAGS} -DUSE_TCL_STUBS ${AC_FLAGS} all: embtest tcl9pkga${SHLIB_SUFFIX} tcl9pkgb${SHLIB_SUFFIX} tcl9pkgc${SHLIB_SUFFIX} \ tcl9pkgd${SHLIB_SUFFIX} tcl9pkge${SHLIB_SUFFIX} tcl9pkgt${SHLIB_SUFFIX} tcl9pkgua${SHLIB_SUFFIX} \ tcl9pkgooa${SHLIB_SUFFIX} pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} pkgt${SHLIB_SUFFIX} @if test -n "$(DLTEST_SUFFIX)"; then $(MAKE) dltest_suffix; fi @touch ../dltest.marker dltest_suffix: tcl9pkga${DLTEST_SUFFIX} tcl9pkgb${DLTEST_SUFFIX} tcl9pkgc${DLTEST_SUFFIX} \ tcl9pkgd${DLTEST_SUFFIX} tcl9pkge${DLTEST_SUFFIX} tcl9pkgt${DLTEST_SUFFIX} tcl9pkgua${DLTEST_SUFFIX} \ tcl9pkgooa${DLTEST_SUFFIX} pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} pkgt${DLTEST_SUFFIX} @touch ../dltest.marker embtest.o: $(SRC_DIR)/embtest.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/embtest.c pkgπ.o: $(SRC_DIR)/pkgπ.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgπ.c pkga.o: $(SRC_DIR)/pkga.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkga.c pkgb.o: $(SRC_DIR)/pkgb.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgb.c pkgc.o: $(SRC_DIR)/pkgc.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgc.c pkgt.o: $(SRC_DIR)/pkgt.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgt.c tcl8pkga.o: $(SRC_DIR)/pkga.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkga.c tcl8pkgb.o: $(SRC_DIR)/pkgb.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgb.c tcl8pkgc.o: $(SRC_DIR)/pkgc.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgc.c tcl8pkgt.o: $(SRC_DIR)/pkgt.c $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgt.c pkgd.o: $(SRC_DIR)/pkgd.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgd.c pkge.o: $(SRC_DIR)/pkge.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkge.c pkgua.o: $(SRC_DIR)/pkgua.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgua.c pkgooa.o: $(SRC_DIR)/pkgooa.c $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgooa.c embtest: embtest.o $(CC) $(CC_SWITCHES) -o $@ embtest.o ${SHLIB_LD_LIBS} tcl9pkgπ${SHLIB_SUFFIX}: pkgπ.o ${SHLIB_LD} -o $@ pkgπ.o ${SHLIB_LD_LIBS} tcl9pkga${SHLIB_SUFFIX}: pkga.o ${SHLIB_LD} -o $@ pkga.o ${SHLIB_LD_LIBS} tcl9pkgb${SHLIB_SUFFIX}: pkgb.o ${SHLIB_LD} -o $@ pkgb.o ${SHLIB_LD_LIBS} tcl9pkgc${SHLIB_SUFFIX}: pkgc.o ${SHLIB_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS} tcl9pkgt${SHLIB_SUFFIX}: pkgt.o ${SHLIB_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS} pkga${SHLIB_SUFFIX}: tcl8pkga.o ${SHLIB_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS} pkgb${SHLIB_SUFFIX}: tcl8pkgb.o ${SHLIB_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS} pkgc${SHLIB_SUFFIX}: tcl8pkgc.o ${SHLIB_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS} pkgt${SHLIB_SUFFIX}: tcl8pkgt.o ${SHLIB_LD} -o $@ tcl8pkgt.o ${SHLIB_LD_LIBS} tcl9pkgd${SHLIB_SUFFIX}: pkgd.o ${SHLIB_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS} tcl9pkge${SHLIB_SUFFIX}: pkge.o ${SHLIB_LD} -o $@ pkge.o ${SHLIB_LD_LIBS} tcl9pkgua${SHLIB_SUFFIX}: pkgua.o ${SHLIB_LD} -o $@ pkgua.o ${SHLIB_LD_LIBS} tcl9pkgooa${SHLIB_SUFFIX}: pkgooa.o ${SHLIB_LD} -o $@ pkgooa.o ${SHLIB_LD_LIBS} tcl9pkgπ${DLTEST_SUFFIX}: pkgπ.o ${DLTEST_LD} -o $@ pkgπ.o ${SHLIB_LD_LIBS} tcl9pkga${DLTEST_SUFFIX}: pkga.o ${DLTEST_LD} -o $@ pkga.o ${SHLIB_LD_LIBS} tcl9pkgb${DLTEST_SUFFIX}: pkgb.o ${DLTEST_LD} -o $@ pkgb.o ${SHLIB_LD_LIBS} tcl9pkgc${DLTEST_SUFFIX}: pkgc.o ${DLTEST_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS} tcl9pkgt${DLTEST_SUFFIX}: pkgt.o ${DLTEST_LD} -o $@ pkgt.o ${SHLIB_LD_LIBS} pkga${DLTEST_SUFFIX}: tcl8pkga.o ${DLTEST_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS} pkgb${DLTEST_SUFFIX}: tcl8pkgb.o ${DLTEST_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS} pkgc${DLTEST_SUFFIX}: tcl8pkgc.o ${DLTEST_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS} pkgt${DLTEST_SUFFIX}: tcl8pkgt.o ${DLTEST_LD} -o $@ tcl8pkgt.o ${SHLIB_LD_LIBS} tcl9pkgd${DLTEST_SUFFIX}: pkgd.o ${DLTEST_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS} tcl9pkge${DLTEST_SUFFIX}: pkge.o ${DLTEST_LD} -o $@ pkge.o ${SHLIB_LD_LIBS} tcl9pkgua${DLTEST_SUFFIX}: pkgua.o ${DLTEST_LD} -o $@ pkgua.o ${SHLIB_LD_LIBS} tcl9pkgooa${DLTEST_SUFFIX}: pkgooa.o ${DLTEST_LD} -o $@ pkgooa.o ${SHLIB_LD_LIBS} clean: rm -f embtest *.o lib.exp ../dltest.marker @if test "$(SHLIB_SUFFIX)" != ""; then \ echo "rm -f *${SHLIB_SUFFIX}" ; \ rm -f *${SHLIB_SUFFIX} ; \ fi @if test "$(DLTEST_SUFFIX)" != ""; then \ echo "rm -f *${DLTEST_SUFFIX}" ; \ rm -f *${DLTEST_SUFFIX} ; \ fi distclean: clean rm -f Makefile tcl9.0.3/unix/dltest/embtest.c0000644000175000017500000000200315104661341015633 0ustar sergeisergei#include "tcl.h" #include MODULE_SCOPE const TclStubs *tclStubsPtr; int main(int argc, char **argv) { const char *version; int exitcode = 0; (void)argc; if (tclStubsPtr != NULL) { printf("ERROR: stub table is already initialized"); exitcode = 1; } tclStubsPtr = NULL; version = Tcl_SetPanicProc(Tcl_ConsolePanic); if (tclStubsPtr == NULL) { printf("ERROR: Tcl_SetPanicProc does not initialize the stub table\n"); exitcode = 1; } tclStubsPtr = NULL; version = Tcl_InitSubsystems(); if (tclStubsPtr == NULL) { printf("ERROR: Tcl_InitSubsystems does not initialize the stub table\n"); exitcode = 1; } tclStubsPtr = NULL; version = Tcl_FindExecutable(argv[0]); if (version != NULL) { printf("Tcl_FindExecutable gives version %s\n", version); } if (tclStubsPtr == NULL) { printf("ERROR: Tcl_FindExecutable does not initialize the stub table\n"); exitcode = 1; } if (!exitcode) { printf("All OK!\n"); } return exitcode; } tcl9.0.3/unix/configure.ac0000644000175000017500000010650215104661341015024 0ustar sergeisergei#! /bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. AC_INIT([tcl],[9.0]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac m4_ifdef([SC_USE_CONFIG_HEADERS], [ AC_CONFIG_HEADERS([tclConfig.h:../unix/tclConfig.h.in]) AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TCL_CONFIG_H -imacros tclConfig.h"]) AH_TOP([ #ifndef _TCLCONFIG #define _TCLCONFIG]) AH_BOTTOM([ /* Undef unused package specific autoheader defines so that we can * include both tclConfig.h and tkConfig.h at the same time: */ /* override */ #undef PACKAGE_NAME /* override */ #undef PACKAGE_TARNAME /* override */ #undef PACKAGE_VERSION /* override */ #undef PACKAGE_STRING #endif /* _TCLCONFIG */]) ]) TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 TCL_PATCH_LEVEL=".3" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} EXTRA_BUILD_HTML=${EXTRA_BUILD_HTML:-"@:"} #------------------------------------------------------------------------ # Setup configure arguments for bundled packages #------------------------------------------------------------------------ PKG_CFG_ARGS="$ac_configure_args ${PKG_CFG_ARGS}" if test -r "$cache_file" -a -f "$cache_file"; then case $cache_file in [[\\/]]* | ?:[[\\/]]* ) pkg_cache_file=$cache_file ;; *) pkg_cache_file=../../$cache_file ;; esac PKG_CFG_ARGS="${PKG_CFG_ARGS} --cache-file=$pkg_cache_file" fi #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ #rm -Rf pkgs if test -f Makefile; then make distclean-packages fi #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # Make sure srcdir is fully qualified! srcdir="`cd "$srcdir" ; pwd`" TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ # Compress and/or soft link the manpages? #------------------------------------------------------------------------ SC_CONFIG_MANPAGES #------------------------------------------------------------------------ # Standard compiler checks #------------------------------------------------------------------------ # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_C_INLINE #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special notes: # - stdlib.h doesn't define strtol or strtoul in some versions # of SunOS # - some versions of string.h don't declare procedures such # as strstr # Do this early, otherwise an autoconf bug throws errors on configure #-------------------------------------------------------------------- SC_MISSING_POSIX_HEADERS #-------------------------------------------------------------------- # Determines the correct executable file extension (.exe) #-------------------------------------------------------------------- AC_EXEEXT #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then AC_CACHE_CHECK([if the compiler understands -pipe], tcl_cv_cc_pipe, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ SC_TCL_CFG_ENCODING #-------------------------------------------------------------------- # Look for libraries that we will need when compiling the Tcl shell #-------------------------------------------------------------------- SC_TCL_LINK_LIBS # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" SC_ENABLE_SHARED #-------------------------------------------------------------------- # Look for a native installed tclsh binary (if available) # If one cannot be found then use the binary we build (fails for # cross compiling). This is used for NATIVE_TCLSH in Makefile. #-------------------------------------------------------------------- SC_PROG_TCLSH if test "$TCLSH_PROG" = ""; then TCLSH_PROG='./${TCL_EXE}' fi #------------------------------------------------------------------------ # Add stuff for zlib #------------------------------------------------------------------------ zlib_ok=yes AC_CHECK_HEADER([zlib.h],[ AC_CHECK_TYPE([gz_header],[],[zlib_ok=no],[#include ])],[ zlib_ok=no]) AS_IF([test $zlib_ok = yes], [ AC_SEARCH_LIBS([deflateSetHeader],[z],[],[ zlib_ok=no ])]) AS_IF([test $zlib_ok = no], [ AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}]) AC_SUBST(ZLIB_SRCS,[\${ZLIB_SRCS}]) AC_SUBST(ZLIB_INCLUDE,[-I\${ZLIB_DIR}]) AC_DEFINE(TCL_WITH_INTERNAL_ZLIB, 1, [Tcl with internal zlib]) ]) #------------------------------------------------------------------------ # Add stuff for libtommath libtommath_ok=yes AC_ARG_WITH(system-libtommath, AS_HELP_STRING([--with-system-libtommath], [use external libtommath (default: true if available, false otherwise)]), [libtommath_ok=${withval}]) if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then AC_CHECK_HEADER([tommath.h],[ AC_CHECK_TYPE([mp_int],[],[libtommath_ok=no],[#include ])],[ libtommath_ok=no]) AS_IF([test $libtommath_ok = yes], [ AC_CHECK_LIB([tommath],[mp_log_u32],[MATH_LIBS="$MATH_LIBS -ltommath"],[ libtommath_ok=no])]) fi AS_IF([test $libtommath_ok = yes], [ AC_SUBST(TCL_PC_REQUIRES_PRIVATE, ['libtommath >= 1.2.0,']) AC_SUBST(TCL_PC_CFLAGS, ['-DTCL_WITH_EXTERNAL_TOMMATH']) AC_DEFINE(TCL_WITH_EXTERNAL_TOMMATH, 1, [Tcl with external libtommath]) ], [ AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}]) AC_SUBST(TOMMATH_SRCS,[\${TOMMATH_SRCS}]) AC_SUBST(TOMMATH_INCLUDE,[-I\${TOMMATH_DIR}]) ]) #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- SC_CONFIG_CFLAGS SC_ENABLE_SYMBOLS(bccdebug) AC_DEFINE(MP_PREC, 4, [Default libtommath precision.]) #-------------------------------------------------------------------- # Detect what compiler flags to set for 64-bit support. #-------------------------------------------------------------------- SC_TCL_EARLY_FLAGS SC_TCL_64BIT_FLAGS #-------------------------------------------------------------------- # Check endianness because we can optimize comparisons of # Tcl_UniChar strings to memcmp on big-endian systems. #-------------------------------------------------------------------- AC_C_BIGENDIAN(,,,[#]) #-------------------------------------------------------------------- # Supply substitutes for missing POSIX library procedures, or # set flags so Tcl uses alternate procedures. #-------------------------------------------------------------------- # Check if Posix compliant getcwd exists, if not we'll use getwd. AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD, 1, [Is getcwd Posix-compliant?])]) # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? AC_REPLACE_FUNCS(mkstemp waitpid) AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])]) AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])]) AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])]) AC_CHECK_FUNC(fork, , [AC_DEFINE(NO_FORK, 1, [Do we have fork()])]) AC_CHECK_FUNC(mknod, , [AC_DEFINE(NO_MKNOD, 1, [Do we have mknod()])]) AC_CHECK_FUNC(tcdrain, , [AC_DEFINE(NO_TCDRAIN, 1, [Do we have tcdrain()])]) AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_UNAME, 1, [Do we have uname()])]) if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print [$]1}'`" -lt 7; then # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232 ac_cv_func_realpath=no fi AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH, 1, [Do we have realpath()])]) SC_TCL_IPV6 #-------------------------------------------------------------------- # Look for thread-safe variants of some library functions. #-------------------------------------------------------------------- SC_TCL_GETPWUID_R SC_TCL_GETPWNAM_R SC_TCL_GETGRGID_R SC_TCL_GETGRNAM_R if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1, [Do we have MT-safe gethostbyname() ?]) AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1, [Do we have MT-safe gethostbyaddr() ?]) elif test "`uname -s`" = "HP-UX" && \ test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then # Starting with HPUX 11.00 (we believe), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1, [Do we have MT-safe gethostbyname() ?]) AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1, [Do we have MT-safe gethostbyaddr() ?]) else SC_TCL_GETHOSTBYNAME_R SC_TCL_GETHOSTBYADDR_R fi #--------------------------------------------------------------------------- # Check for serial port interface. # # termios.h is present on all POSIX systems. # sys/ioctl.h is almost always present, though what it contains # is system-specific. # sys/modem.h is needed on HP-UX. #--------------------------------------------------------------------------- AC_CHECK_HEADERS(termios.h) AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/modem.h) #-------------------------------------------------------------------- # Include sys/select.h if it exists and if it supplies things # that appear to be useful and aren't already in sys/types.h. # This appears to be true only on the RS/6000 under AIX. Some # systems like OSF/1 have a sys/select.h that's of no use, and # other systems like SCO UNIX have a sys/select.h that's # pernicious. If "fd_set" isn't defined anywhere then set a # special flag. #-------------------------------------------------------------------- AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[fd_set readMask, writeMask;]])], [tcl_cv_type_fd_set=yes],[tcl_cv_type_fd_set=no])]) tcl_ok=$tcl_cv_type_fd_set if test $tcl_ok = no; then AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [ AC_EGREP_HEADER(fd_mask, sys/select.h, tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)]) if test $tcl_cv_grep_fd_mask = present; then AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include ?]) tcl_ok=yes fi fi if test $tcl_ok = no; then AC_DEFINE(NO_FD_SET, 1, [Do we have fd_set?]) fi AC_CACHE_CHECK([for pselect], tcl_cv_func_pselect, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[void *func = pselect;]])],[tcl_cv_func_pselect=yes],[tcl_cv_func_pselect=no])]) tcl_ok=$tcl_cv_func_pselect if test $tcl_ok = yes; then AC_DEFINE(HAVE_PSELECT, 1, [Should we use pselect()?]) fi #------------------------------------------------------------------------ # Options for the notifier. Checks for epoll(7) on Linux, and # kqueue(2) on {DragonFly,Free,Net,Open}BSD #------------------------------------------------------------------------ AC_MSG_CHECKING([for advanced notifier support]) case x`uname -s` in xLinux) AC_MSG_RESULT([epoll(7)]) AC_CHECK_HEADERS([sys/epoll.h], [AC_DEFINE(NOTIFIER_EPOLL, [1], [Is epoll(7) supported?])]) AC_CHECK_HEADERS([sys/eventfd.h], [AC_DEFINE(HAVE_EVENTFD, [1], [Is eventfd(2) supported?])]);; xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD) AC_MSG_RESULT([kqueue(2)]) # Messy because we want to check if *all* the headers are present, and not # just *any* tcl_kqueue_headers=x AC_CHECK_HEADERS([sys/types.h sys/event.h sys/time.h], [tcl_kqueue_headers=${tcl_kqueue_headers}y]) AS_IF([test $tcl_kqueue_headers = xyyy], [ AC_DEFINE(NOTIFIER_KQUEUE, [1], [Is kqueue(2) supported?])]);; xDarwin) # Assume that we've got CoreFoundation present (checked elsewhere because # of wider impact). AC_MSG_RESULT([OSX]);; *) AC_MSG_RESULT([none]);; esac #------------------------------------------------------------------------------ # Find out all about time handling differences. #------------------------------------------------------------------------------ SC_TIME_HANDLER #-------------------------------------------------------------------- # Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But # we might be able to use fstatfs instead. Some systems (OpenBSD?) also # lack blkcnt_t. #-------------------------------------------------------------------- if test "$ac_cv_cygwin" != "yes"; then AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize, struct stat.st_rdev]) fi AC_CHECK_TYPES([blkcnt_t]) AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])]) #-------------------------------------------------------------------- # Check for various typedefs and provide substitutes if # they don't exist. #-------------------------------------------------------------------- AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[ socklen_t foo; ]])],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])]) if test $tcl_cv_type_socklen_t = no; then AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available]) fi AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[ #include ]]) #-------------------------------------------------------------------- # The check below checks whether defines the type # "union wait" correctly. It's needed because of weirdness in # HP-UX where "union wait" is defined in both the BSD and SYS-V # environments. Checking the usability of WIFEXITED seems to do # the trick. #-------------------------------------------------------------------- AC_CACHE_CHECK([union wait], tcl_cv_union_wait, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[ union wait x; WIFEXITED(x); /* Generates compiler error if WIFEXITED * uses an int. */ ]])],[tcl_cv_union_wait=yes],[tcl_cv_union_wait=no])]) if test $tcl_cv_union_wait = no; then AC_DEFINE(NO_UNION_WAIT, 1, [Do we have a usable 'union wait'?]) fi #-------------------------------------------------------------------- # Check whether there is an strncasecmp function on this system. # This is a bit tricky because under SCO it's in -lsocket and # under Sequent Dynix it's in -linet. #-------------------------------------------------------------------- AC_CHECK_FUNC(strncasecmp, tcl_ok=1, tcl_ok=0) if test "$tcl_ok" = 0; then AC_CHECK_LIB(socket, strncasecmp, tcl_ok=1, tcl_ok=0) fi if test "$tcl_ok" = 0; then AC_CHECK_LIB(inet, strncasecmp, tcl_ok=1, tcl_ok=0) fi if test "$tcl_ok" = 0; then AC_LIBOBJ([strncasecmp]) USE_COMPAT=1 fi #-------------------------------------------------------------------- # The code below deals with several issues related to gettimeofday: # 1. Some systems don't provide a gettimeofday function at all # (set NO_GETTOD if this is the case). # 2. See if gettimeofday is declared in the header file. # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can # declare it. #-------------------------------------------------------------------- AC_CHECK_FUNC(gettimeofday,[],[ AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?]) ]) AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [ AC_EGREP_HEADER(gettimeofday, sys/time.h, tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)]) if test $tcl_cv_grep_gettimeofday = missing ; then AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in ?]) fi #-------------------------------------------------------------------- # The following code checks to see whether it is possible to get # signed chars on this platform. This is needed in order to # properly generate sign-extended ints from character values. #-------------------------------------------------------------------- AC_C_CHAR_UNSIGNED AC_CACHE_CHECK([signed char declarations], tcl_cv_char_signed, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ signed char *p; p = 0; ]])],[tcl_cv_char_signed=yes],[tcl_cv_char_signed=no])]) if test $tcl_cv_char_signed = yes; then AC_DEFINE(HAVE_SIGNED_CHAR, 1, [Are characters signed?]) fi #-------------------------------------------------------------------- # Does putenv() copy or not? We need to know to avoid memory leaks. #-------------------------------------------------------------------- AC_CACHE_CHECK([for a putenv() that copies the buffer], tcl_cv_putenv_copy, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #define OURVAR "havecopy=yes" int main (int argc, char *argv[]) { char *foo, *bar; foo = (char *)strdup(OURVAR); putenv(foo); strcpy((char *)(strchr(foo, '=') + 1), "no"); bar = getenv("havecopy"); if (!strcmp(bar, "no")) { /* doesnt copy */ return 0; } else { /* does copy */ return 1; } } ]])], [tcl_cv_putenv_copy=no], [tcl_cv_putenv_copy=yes], [tcl_cv_putenv_copy=no])]) if test $tcl_cv_putenv_copy = yes; then AC_DEFINE(HAVE_PUTENV_THAT_COPIES, 1, [Does putenv() copy strings or incorporate them by reference?]) fi #-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- SC_ENABLE_LANGINFO #-------------------------------------------------------------------- # Check for support of cfmakeraw, chflags and mkstemps functions #-------------------------------------------------------------------- AC_CHECK_FUNCS(cfmakeraw chflags mkstemps) #-------------------------------------------------------------------- # Darwin specific API checks and defines #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then AC_CHECK_FUNCS(getattrlist) AC_CHECK_HEADERS(copyfile.h) AC_CHECK_FUNCS(copyfile) if test $tcl_corefoundation = yes; then AC_CHECK_HEADERS(libkern/OSAtomic.h) AC_CHECK_FUNCS(OSSpinLockLock) fi AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1, [Can this platform load code from memory?]) AC_DEFINE(TCL_WIDE_CLICKS, 1, [Does this platform have wide high-resolution clicks?]) AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ int rand(void) __attribute__((weak_import)); ]], [[rand();]])], [tcl_cv_cc_weak_import=yes],[tcl_cv_cc_weak_import=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_weak_import = yes; then AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?]) fi AC_CACHE_CHECK([if Darwin SUSv3 extensions are available], tcl_cv_cc_darwin_c_source, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _DARWIN_C_SOURCE 1 #include ]], [[]])],[tcl_cv_cc_darwin_c_source=yes],[tcl_cv_cc_darwin_c_source=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_darwin_c_source = yes; then AC_DEFINE(_DARWIN_C_SOURCE, 1, [Are Darwin SUSv3 extensions available?]) fi # Build .bundle dltest binaries in addition to .dylib DLTEST_LD='${CC} -bundle -Wl,-w ${CFLAGS} ${LDFLAGS}' DLTEST_SUFFIX=".bundle" else DLTEST_LD='${SHLIB_LD}' DLTEST_SUFFIX="" fi #-------------------------------------------------------------------- # Check for support of fts functions (readdir replacement) #-------------------------------------------------------------------- AC_CACHE_CHECK([for fts], tcl_cv_api_fts, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ char*const p[2] = {"/", NULL}; FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL); FTSENT *e = fts_read(f); fts_close(f); ]])],[tcl_cv_api_fts=yes],[tcl_cv_api_fts=no])]) if test $tcl_cv_api_fts = yes; then AC_DEFINE(HAVE_FTS, 1, [Do we have fts functions?]) fi #-------------------------------------------------------------------- # The statements below check for systems where POSIX-style non-blocking # I/O (O_NONBLOCK) doesn't work or is unimplemented. On these systems # (mostly older ones), use the old BSD-style FIONBIO approach instead. #-------------------------------------------------------------------- SC_BLOCKING_STYLE #------------------------------------------------------------------------ AC_MSG_CHECKING([whether to use dll unloading]) AC_ARG_ENABLE(dll-unloading, AS_HELP_STRING([--enable-dll-unloading], [enable the 'unload' command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test $tcl_ok = yes; then AC_DEFINE(TCL_UNLOAD_DLLS, 1, [Do we allow unloading of shared libraries?]) fi AC_MSG_RESULT([$tcl_ok]) #------------------------------------------------------------------------ # Check whether the timezone data is supplied by the OS or has # to be installed by Tcl. The default is autodetection, but can # be overridden on the configure command line either way. #------------------------------------------------------------------------ AC_MSG_CHECKING([for timezone data]) AC_ARG_WITH(tzdata, AS_HELP_STRING([--with-tzdata], [install timezone data (default: autodetect)]), [tcl_ok=$withval], [tcl_ok=auto]) # # Any directories that get added here must also be added to the # search path in ::tcl::clock::Initialize (library/clock.tcl). # case $tcl_ok in no) AC_MSG_RESULT([supplied by OS vendor]) ;; yes) # nothing to do here ;; auto*) AC_CACHE_VAL([tcl_cv_dir_zoneinfo], [ for dir in /usr/share/zoneinfo \ /usr/share/lib/zoneinfo \ /usr/lib/zoneinfo do if test -f $dir/UTC -o -f $dir/GMT then tcl_cv_dir_zoneinfo="$dir" break fi done]) if test -n "$tcl_cv_dir_zoneinfo"; then tcl_ok=no AC_MSG_RESULT([$dir]) else tcl_ok=yes fi ;; *) AC_MSG_ERROR([invalid argument: $tcl_ok]) ;; esac if test $tcl_ok = yes then AC_MSG_RESULT([supplied by Tcl]) INSTALL_TZDATA=install-tzdata fi #-------------------------------------------------------------------- # DTrace support #-------------------------------------------------------------------- AC_ARG_ENABLE(dtrace, AS_HELP_STRING([--enable-dtrace], [build with DTrace support (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test $tcl_ok = yes; then AC_CHECK_HEADER(sys/sdt.h, [tcl_ok=yes], [tcl_ok=no]) fi if test $tcl_ok = yes; then AC_PATH_PROG(DTRACE, dtrace,, [$PATH:/usr/sbin]) test -z "$ac_cv_path_DTRACE" && tcl_ok=no fi AC_MSG_CHECKING([whether to enable DTrace support]) MAKEFILE_SHELL='/bin/sh' if test $tcl_ok = yes; then AC_DEFINE(USE_DTRACE, 1, [Are we building with DTrace support?]) DTRACE_SRC="\${DTRACE_SRC}" DTRACE_HDR="\${DTRACE_HDR}" if test "`uname -s`" != "Darwin" ; then DTRACE_OBJ="\${DTRACE_OBJ}" if test "`uname -s`" = "SunOS" -a "$SHARED_BUILD" = "0" ; then # Need to create an intermediate object file to ensure tclDTrace.o # gets included when linking against the static tcl library. STLIB_LD='stlib_ld () { /usr/ccs/bin/ld -r -o $${1%.a}.o "$${@:2}" && '"${STLIB_LD}"' $${1} $${1%.a}.o ; } && stlib_ld' MAKEFILE_SHELL='/bin/bash' # Force use of Sun ar and ranlib, the GNU versions choke on # tclDTrace.o and the combined object file above. AR='/usr/ccs/bin/ar' RANLIB='/usr/ccs/bin/ranlib' fi fi fi AC_MSG_RESULT([$tcl_ok]) #-------------------------------------------------------------------- # The check below checks whether the cpuid instruction is usable. #-------------------------------------------------------------------- AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ int index,regsPtr[4]; __asm__ __volatile__("mov %%ebx, %%edi \n\t" "cpuid \n\t" "mov %%ebx, %%esi \n\t" "mov %%edi, %%ebx \n\t" : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) : "a"(index) : "edi"); ]])],[tcl_cv_cpuid=yes],[tcl_cv_cpuid=no])]) if test $tcl_cv_cpuid = yes; then AC_DEFINE(HAVE_CPUID, 1, [Is the cpuid instruction usable?]) fi #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX} if test "$ac_cv_cygwin" = "yes" -a "$SHARED_BUILD" != "0"; then eval "TCL_LIB_FILE=cygtcl${LIB_SUFFIX}" EXTRA_INSTALL_BINARIES='$(INSTALL_LIBRARY) $(patsubst cyg%.dll,lib%.dll.a,${LIB_FILE}) "$(LIB_INSTALL_DIR)"' else eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}" fi # tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed # since on some platforms TCL_LIB_FILE contains shell escapes. # (See also: TCL_TRIM_DOTS). eval "TCL_LIB_FILE=${TCL_LIB_FILE}" test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)' PRIVATE_INCLUDE_DIR='$(includedir)' HTML_DIR='$(DISTDIR)/html' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. if test "`uname -s`" = "Darwin" ; then SC_ENABLE_FRAMEWORK TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' AC_CONFIG_FILES([Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in]) TCL_YEAR="`date +%Y`" fi if test "$FRAMEWORK_BUILD" = "1" ; then AC_DEFINE(TCL_FRAMEWORK, 1, [Is Tcl built as a framework?]) # Construct a fake local framework structure to make linking with # '-framework Tcl' and running of tcltest work AC_CONFIG_COMMANDS([Tcl.framework], [n=Tcl && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && unset n f v ], VERSION=${TCL_VERSION}) LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" # default install directory for bundled packages if test "${libdir}" = '${exec_prefix}/lib' -o "`basename ${libdir}`" = 'Frameworks'; then PACKAGE_DIR="/Library/Tcl" else PACKAGE_DIR="$libdir" fi if test "${libdir}" = '${exec_prefix}/lib'; then # override libdir default libdir="/Library/Frameworks" fi TCL_LIB_FILE="Tcl" TCL_LIB_FLAG="-framework Tcl" TCL_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tcl" TCL_LIB_SPEC="-F${libdir} -framework Tcl" libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" TCL_LIBRARY="${libdir}/Resources/Scripts" includedir="${libdir}/Headers" PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" EXTRA_INSTALL="install-private-headers html-tcl" EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)/TclTOC.html"' EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' # Don't use AC_DEFINE for the following as the framework version define # needs to go into the Makefile even when using autoheader, so that we # can pick up a potential make override of VERSION. Also, don't put this # into CFLAGS as it should not go into tclConfig.sh EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"' else # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" # default install directory for bundled packages PACKAGE_DIR="$libdir" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TCL_LIB_FLAG="-ltcl${TCL_VERSION}" else TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" fi VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" VERSION=${TCL_VERSION} #-------------------------------------------------------------------- # Zipfs support - Tip 430 #-------------------------------------------------------------------- AC_ARG_ENABLE(zipfs, AS_HELP_STRING([--enable-zipfs], [build with Zipfs support (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then # # Find a native compiler # AX_CC_FOR_BUILD # # Find a native zip implementation # SC_ZIPFS_SUPPORT ZIPFS_BUILD=1 TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with zipfs]) if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; AC_DEFINE(ZIPFS_BUILD, 2, [Are we building with zipfs enabled?]) else AC_DEFINE(ZIPFS_BUILD, 1, [Are we building with zipfs enabled?])\ fi AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi # Point to tcl script library if we are not embedding it. if test "${ZIPFS_BUILD}" = 0; then TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library fi AC_SUBST(ZIPFS_BUILD) AC_SUBST(TCL_ZIP_FILE) AC_SUBST(INSTALL_LIBRARIES) AC_SUBST(INSTALL_MSGS) AC_SUBST(TCL_BUILDTIME_LIBRARY) #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which # gives a list of directories that may contain packages. The list # consists of one directory for machine-dependent binaries and # another for platform-independent scripts. #-------------------------------------------------------------------- if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ TCL_MODULE_PATH="~/Library/Tcl:/Library/Tcl" elif test "$prefix/lib" != "$libdir"; then test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" else test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib" fi #-------------------------------------------------------------------- # The statements below define various symbols relating to Tcl # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TCL_VERSION} # double-eval to account for TCL_TRIM_DOTS. # eval "TCL_STUB_LIB_FILE=libtclstub.a" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_DIR=\"${libdir}\"" TCL_STUB_LIB_FLAG="-ltclstub" TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} AC_SUBST(TCL_VERSION) AC_SUBST(TCL_MAJOR_VERSION) AC_SUBST(TCL_MINOR_VERSION) AC_SUBST(TCL_PATCH_LEVEL) AC_SUBST(TCL_YEAR) AC_SUBST(PKG_CFG_ARGS) AC_SUBST(TCL_ZIP_FILE) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_PATH) AC_SUBST(TCL_INCLUDE_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_PATH) AC_SUBST(TCL_SRC_DIR) AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX) AC_SUBST(TCL_SHARED_BUILD) AC_SUBST(LD_LIBRARY_PATH_VAR) AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_LIB_VERSIONS_OK) AC_SUBST(TCL_SHARED_LIB_SUFFIX) AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) AC_SUBST(TCL_HAS_LONGLONG) AC_SUBST(INSTALL_TZDATA) AC_SUBST(DTRACE_SRC) AC_SUBST(DTRACE_HDR) AC_SUBST(DTRACE_OBJ) AC_SUBST(MAKEFILE_SHELL) AC_SUBST(BUILD_DLTEST) AC_SUBST(TCL_PACKAGE_PATH) AC_SUBST(TCL_MODULE_PATH) AC_SUBST(TCL_LIBRARY) AC_SUBST(PRIVATE_INCLUDE_DIR) AC_SUBST(HTML_DIR) AC_SUBST(PACKAGE_DIR) AC_SUBST(EXTRA_CC_SWITCHES) AC_SUBST(EXTRA_APP_CC_SWITCHES) AC_SUBST(EXTRA_INSTALL) AC_SUBST(EXTRA_INSTALL_BINARIES) AC_SUBST(EXTRA_BUILD_HTML) AC_SUBST(EXTRA_TCLSH_LIBS) AC_SUBST(DLTEST_LD) AC_SUBST(DLTEST_SUFFIX) dnl Disable the automake-friendly normalization of LIBOBJS dnl performed by autoconf 2.53 and later. It's not correct for us. define([_AC_LIBOBJS_NORMALIZE],[]) AC_CONFIG_FILES([ Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in ]) AC_OUTPUT dnl Local Variables: dnl mode: autoconf dnl End: tcl9.0.3/unix/configure0000755000175000017500000121365515104662051014455 0ustar sergeisergei#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for tcl 9.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' PACKAGE_VERSION='9.0' PACKAGE_STRING='tcl 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='DLTEST_SUFFIX DLTEST_LD EXTRA_TCLSH_LIBS EXTRA_BUILD_HTML EXTRA_INSTALL_BINARIES EXTRA_INSTALL EXTRA_APP_CC_SWITCHES EXTRA_CC_SWITCHES PACKAGE_DIR HTML_DIR PRIVATE_INCLUDE_DIR TCL_LIBRARY TCL_MODULE_PATH TCL_PACKAGE_PATH BUILD_DLTEST MAKEFILE_SHELL DTRACE_OBJ DTRACE_HDR DTRACE_SRC INSTALL_TZDATA TCL_HAS_LONGLONG TCL_UNSHARED_LIB_SUFFIX TCL_SHARED_LIB_SUFFIX TCL_LIB_VERSIONS_OK TCL_BUILD_LIB_SPEC LD_LIBRARY_PATH_VAR TCL_SHARED_BUILD CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_SHARED_LIB_SUFFIX TCL_SRC_DIR TCL_BUILD_STUB_LIB_PATH TCL_BUILD_STUB_LIB_SPEC TCL_INCLUDE_SPEC TCL_STUB_LIB_PATH TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE PKG_CFG_ARGS TCL_YEAR TCL_PATCH_LEVEL TCL_MINOR_VERSION TCL_MAJOR_VERSION TCL_VERSION TCL_BUILDTIME_LIBRARY INSTALL_MSGS INSTALL_LIBRARIES TCL_ZIP_FILE ZIPFS_BUILD ZIP_INSTALL_OBJS ZIP_PROG_VFSSEARCH ZIP_PROG_OPTIONS ZIP_PROG MACHER_PROG EXEEXT_FOR_BUILD CC_FOR_BUILD DTRACE LDFLAGS_DEFAULT CFLAGS_DEFAULT INSTALL_STUB_LIB DLL_INSTALL_DIR INSTALL_LIB MAKE_STUB_LIB MAKE_LIB SHLIB_SUFFIX SHLIB_CFLAGS SHLIB_LD_LIBS TK_SHLIB_LD_EXTRAS TCL_SHLIB_LD_EXTRAS SHLIB_LD STLIB_LD LD_SEARCH_FLAGS CC_SEARCH_FLAGS LDFLAGS_OPTIMIZE LDFLAGS_DEBUG CFLAGS_NOLTO CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG LDAIX_SRC PLAT_SRCS PLAT_OBJS DL_OBJS DL_LIBS TCL_LIBS LIBOBJS AR RANLIB TOMMATH_INCLUDE TOMMATH_SRCS TOMMATH_OBJS TCL_PC_CFLAGS TCL_PC_REQUIRES_PRIVATE ZLIB_INCLUDE ZLIB_SRCS ZLIB_OBJS TCLSH_PROG SHARED_BUILD CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAN_FLAGS target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL OBJEXT_FOR_BUILD' ac_subst_files='' ac_user_opts=' enable_option_checking enable_man_symlinks enable_man_compression enable_man_suffix with_encoding enable_shared with_system_libtommath enable_64bit enable_64bit_vis enable_rpath enable_corefoundation enable_load enable_symbols enable_langinfo enable_dll_unloading with_tzdata enable_dtrace enable_framework enable_zipfs ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures tcl 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tcl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tcl 9.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-man-symlinks use symlinks for the manpages (default: off) --enable-man-compression=PROG compress the manpages with PROG (default: off) --enable-man-suffix=STRING use STRING as a suffix to manpage file names (default: no, tcl if enabled without specifying STRING) --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-corefoundation use CoreFoundation API on MacOSX (default: on) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on) --enable-dll-unloading enable the 'unload' command (default: on) --enable-dtrace build with DTrace support (default: off) --enable-framework package shared libraries in MacOSX frameworks (default: off) --enable-zipfs build with Zipfs support (default: on) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values (default: utf-8) --with-system-libtommath use external libtommath (default: true if available, false otherwise) --with-tzdata install timezone data (default: autodetect) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tcl configure 9.0 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) eval "$4=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then 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 fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; 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 eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 TCL_PATCH_LEVEL=".3" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} EXTRA_BUILD_HTML=${EXTRA_BUILD_HTML:-"@:"} #------------------------------------------------------------------------ # Setup configure arguments for bundled packages #------------------------------------------------------------------------ PKG_CFG_ARGS="$ac_configure_args ${PKG_CFG_ARGS}" if test -r "$cache_file" -a -f "$cache_file"; then case $cache_file in [\\/]* | ?:[\\/]* ) pkg_cache_file=$cache_file ;; *) pkg_cache_file=../../$cache_file ;; esac PKG_CFG_ARGS="${PKG_CFG_ARGS} --cache-file=$pkg_cache_file" fi #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ #rm -Rf pkgs if test -f Makefile; then make distclean-packages fi #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # Make sure srcdir is fully qualified! srcdir="`cd "$srcdir" ; pwd`" TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ # Compress and/or soft link the manpages? #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 printf %s "checking whether to use symlinks for manpages... " >&6; } # Check whether --enable-man-symlinks was given. if test ${enable_man_symlinks+y} then : enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 printf %s "checking whether to compress the manpages... " >&6; } # Check whether --enable-man-compression was given. if test ${enable_man_compression+y} then : enableval=$enable_man_compression; case $enableval in yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } if test "$enableval" != "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 printf %s "checking for compressed file suffix... " >&6; } touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 printf "%s\n" "$Z" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 printf %s "checking whether to add a package name suffix for the manpages... " >&6; } # Check whether --enable-man-suffix was given. if test ${enable_man_suffix+y} then : enableval=$enable_man_suffix; case $enableval in yes) enableval="tcl" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } #------------------------------------------------------------------------ # Standard compiler checks #------------------------------------------------------------------------ # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo (void) {return 0; } $ac_kw foo_t foo (void) {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special notes: # - stdlib.h doesn't define strtol or strtoul in some versions # of SunOS # - some versions of string.h don't declare procedures such # as strstr # Do this early, otherwise an autoconf bug throws errors on configure #-------------------------------------------------------------------- ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "strstr" >/dev/null 2>&1 then : else case e in #( e) tcl_ok=0 ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "strerror" >/dev/null 2>&1 then : else case e in #( e) tcl_ok=0 ;; esac fi rm -rf conftest* ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes then : else case e in #( e) printf "%s\n" "#define NO_SYS_WAIT_H 1" >>confdefs.h ;; esac fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : else case e in #( e) printf "%s\n" "#define NO_DLFCN_H 1" >>confdefs.h ;; esac fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Determines the correct executable file extension (.exe) #-------------------------------------------------------------------- #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 printf %s "checking if the compiler understands -pipe... " >&6; } if test ${tcl_cv_cc_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_pipe=yes else case e in #( e) tcl_cv_cc_pipe=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 printf "%s\n" "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ # Check whether --with-encoding was given. if test ${with_encoding+y} then : withval=$with_encoding; with_tcencoding=${withval} fi if test x"${with_tcencoding}" != x ; then printf "%s\n" "#define TCL_CFGVAL_ENCODING \"${with_tcencoding}\"" >>confdefs.h else printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi #-------------------------------------------------------------------- # Look for libraries that we will need when compiling the Tcl shell #-------------------------------------------------------------------- #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" if test "x$ac_cv_func_sin" = xyes then : MATH_LIBS="" else case e in #( e) MATH_LIBS="-lm" ;; esac fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 printf %s "checking for main in -linet... " >&6; } if test ${ac_cv_lib_inet_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_inet_main=yes else case e in #( e) ac_cv_lib_inet_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 printf "%s\n" "$ac_cv_lib_inet_main" >&6; } if test "x$ac_cv_lib_inet_main" = xyes then : LIBS="$LIBS -linet" fi ac_fn_c_check_header_compile "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" if test "x$ac_cv_header_net_errno_h" = xyes then : printf "%s\n" "#define HAVE_NET_ERRNO_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes then : tcl_checkSocket=0 else case e in #( e) tcl_checkSocket=1 ;; esac fi if test "$tcl_checkSocket" = 1; then ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" if test "x$ac_cv_func_setsockopt" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 printf %s "checking for setsockopt in -lsocket... " >&6; } if test ${ac_cv_lib_socket_setsockopt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char setsockopt (void); int main (void) { return setsockopt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_setsockopt=yes else case e in #( e) ac_cv_lib_socket_setsockopt=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 printf "%s\n" "$ac_cv_lib_socket_setsockopt" >&6; } if test "x$ac_cv_lib_socket_setsockopt" = xyes then : LIBS="$LIBS -lsocket" else case e in #( e) tcl_checkBoth=1 ;; esac fi ;; esac fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" if test "x$ac_cv_func_accept" = xyes then : tcl_checkNsl=0 else case e in #( e) LIBS=$tk_oldLibs ;; esac fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes else case e in #( e) ac_cv_lib_nsl_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes then : LIBS="$LIBS -lnsl" fi ;; esac fi printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 printf %s "checking for pthread_mutex_init in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthread_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 printf %s "checking for __pthread_mutex_init in -lpthread... " >&6; } if test ${ac_cv_lib_pthread___pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (void); int main (void) { return __pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread___pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthread___pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 printf %s "checking for pthread_mutex_init in -lpthreads... " >&6; } if test ${ac_cv_lib_pthreads_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthreads_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthreads_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes then : _ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 printf %s "checking for pthread_mutex_init in -lc... " >&6; } if test ${ac_cv_lib_c_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_c_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_c_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 printf %s "checking for pthread_mutex_init in -lc_r... " >&6; } if test ${ac_cv_lib_c_r_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_c_r_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5 printf "%s\n" "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;} fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" ac_fn_c_check_func "$LINENO" "pthread_attr_setstacksize" "ac_cv_func_pthread_attr_setstacksize" if test "x$ac_cv_func_pthread_attr_setstacksize" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork" if test "x$ac_cv_func_pthread_atfork" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_ATFORK 1" >>confdefs.h fi LIBS=$ac_saved_libs # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 printf %s "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_BUILD=1 else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } SHARED_BUILD=0 printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h fi #-------------------------------------------------------------------- # Look for a native installed tclsh binary (if available) # If one cannot be found then use the binary we build (fails for # cross compiling). This is used for NATIVE_TCLSH in Makefile. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 printf %s "checking for tclsh... " >&6; } if test ${ac_cv_path_tclsh+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]* 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 printf "%s\n" "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 printf "%s\n" "No tclsh found on PATH" >&6; } fi if test "$TCLSH_PROG" = ""; then TCLSH_PROG='./${TCL_EXE}' fi #------------------------------------------------------------------------ # Add stuff for zlib #------------------------------------------------------------------------ zlib_ok=yes ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes then : ac_fn_c_check_type "$LINENO" "gz_header" "ac_cv_type_gz_header" "#include " if test "x$ac_cv_type_gz_header" = xyes then : else case e in #( e) zlib_ok=no ;; esac fi else case e in #( e) zlib_ok=no ;; esac fi if test $zlib_ok = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing deflateSetHeader" >&5 printf %s "checking for library containing deflateSetHeader... " >&6; } if test ${ac_cv_search_deflateSetHeader+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char deflateSetHeader (void); int main (void) { return deflateSetHeader (); ; return 0; } _ACEOF for ac_lib in '' z do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_deflateSetHeader=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_deflateSetHeader+y} then : break fi done if test ${ac_cv_search_deflateSetHeader+y} then : else case e in #( e) ac_cv_search_deflateSetHeader=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateSetHeader" >&5 printf "%s\n" "$ac_cv_search_deflateSetHeader" >&6; } ac_res=$ac_cv_search_deflateSetHeader if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else case e in #( e) zlib_ok=no ;; esac fi fi if test $zlib_ok = no then : ZLIB_OBJS=\${ZLIB_OBJS} ZLIB_SRCS=\${ZLIB_SRCS} ZLIB_INCLUDE=-I\${ZLIB_DIR} printf "%s\n" "#define TCL_WITH_INTERNAL_ZLIB 1" >>confdefs.h fi #------------------------------------------------------------------------ # Add stuff for libtommath libtommath_ok=yes # Check whether --with-system-libtommath was given. if test ${with_system_libtommath+y} then : withval=$with_system_libtommath; libtommath_ok=${withval} fi if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then ac_fn_c_check_header_compile "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default" if test "x$ac_cv_header_tommath_h" = xyes then : ac_fn_c_check_type "$LINENO" "mp_int" "ac_cv_type_mp_int" "#include " if test "x$ac_cv_type_mp_int" = xyes then : else case e in #( e) libtommath_ok=no ;; esac fi else case e in #( e) libtommath_ok=no ;; esac fi if test $libtommath_ok = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mp_log_u32 in -ltommath" >&5 printf %s "checking for mp_log_u32 in -ltommath... " >&6; } if test ${ac_cv_lib_tommath_mp_log_u32+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltommath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char mp_log_u32 (void); int main (void) { return mp_log_u32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_tommath_mp_log_u32=yes else case e in #( e) ac_cv_lib_tommath_mp_log_u32=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tommath_mp_log_u32" >&5 printf "%s\n" "$ac_cv_lib_tommath_mp_log_u32" >&6; } if test "x$ac_cv_lib_tommath_mp_log_u32" = xyes then : MATH_LIBS="$MATH_LIBS -ltommath" else case e in #( e) libtommath_ok=no ;; esac fi fi fi if test $libtommath_ok = yes then : TCL_PC_REQUIRES_PRIVATE='libtommath >= 1.2.0,' TCL_PC_CFLAGS='-DTCL_WITH_EXTERNAL_TOMMATH' printf "%s\n" "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h else case e in #( e) TOMMATH_OBJS=\${TOMMATH_OBJS} TOMMATH_SRCS=\${TOMMATH_SRCS} TOMMATH_INCLUDE=-I\${TOMMATH_DIR} ;; esac fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Step 0.a: Enable 64 bit support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 printf %s "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test ${enable_64bit+y} then : enableval=$enable_64bit; do64bit=$enableval else case e in #( e) do64bit=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 printf "%s\n" "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 printf %s "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. if test ${enable_64bit_vis+y} then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else case e in #( e) do64bitVIS=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 printf "%s\n" "$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes" then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 printf %s "checking if compiler supports visibility \"hidden\"... " >&6; } if test ${tcl_cv_cc_visibility_hidden+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main (void) { f(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_visibility_hidden=yes else case e in #( e) tcl_cv_cc_visibility_hidden=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 printf "%s\n" "$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes then : printf "%s\n" "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h printf "%s\n" "#define HAVE_HIDDEN 1" >>confdefs.h fi # Step 0.d: Disable -rpath support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 printf %s "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. if test ${enable_rpath+y} then : enableval=$enable_rpath; doRpath=$enableval else case e in #( e) doRpath=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 printf "%s\n" "$doRpath" >&6; } # Step 1: set the variable "system" to hold the name and version number # for the system. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 printf %s "checking system version... " >&6; } if test ${tcl_cv_sys_version+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 printf "%s\n" "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : have_dl=yes else case e in #( e) have_dl=no ;; esac fi # Require ranlib early so we can override it in special cases below. # 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] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = yes then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" case "${CC}" in *++|*++-*) ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac else case e in #( e) CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" ;; esac fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" if test "x${SHLIB_VERSION}" = x then : SHLIB_VERSION="1.0" fi case $system in AIX-*) if test "$GCC" != "yes" then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 printf "%s\n" "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # ldAix No longer needed with use of -bexpall/-brtl # but some extensions may still reference it LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : if test "$GCC" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" ;; esac fi fi if test "`uname -m`" = ia64 then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = yes then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else case e in #( e) CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' ;; esac fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else case e in #( e) if test "$GCC" = yes then : SHLIB_LD='${CC} -shared -Wl,-bexpall' else case e in #( e) SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" ;; esac fi SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; esac fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 printf %s "checking for inet_ntoa in -lbind... " >&6; } if test ${ac_cv_lib_bind_inet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (void); int main (void) { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bind_inet_ntoa=yes else case e in #( e) ac_cv_lib_bind_inet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_bind_inet_ntoa" >&6; } if test "x$ac_cv_lib_bind_inet_ntoa" = xyes then : LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*|MINGW32_*|MSYS_*) SHLIB_CFLAGS="-fno-common" SHLIB_LD='${CC} -shared -Wl,--out-implib,$(patsubst cyg%.dll,lib%.dll,$@).a' SHLIB_SUFFIX=".dll" DL_OBJS="tclLoadDl.o" PLAT_OBJS='${CYGWIN_OBJS}' PLAT_SRCS='${CYGWIN_SRCS}' DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 printf %s "checking for Cygwin version of gcc... " >&6; } if test ${ac_cv_cygwin+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __CYGWIN__ #error cygwin #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cygwin=no else case e in #( e) ac_cv_cygwin=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 printf "%s\n" "$ac_cv_cygwin" >&6; } if test "$ac_cv_cygwin" = "no"; then as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32" # The eval makes quoting arguments work. if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix then : else { echo "configure: error: configure failed for ../win" 1>&2; exit 1; } fi fi ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 printf %s "checking for inet_ntoa in -lnetwork... " >&6; } if test ${ac_cv_lib_network_inet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (void); int main (void) { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_network_inet_ntoa=yes else case e in #( e) ac_cv_lib_network_inet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_network_inet_ntoa" >&6; } if test "x$ac_cv_lib_network_inet_ntoa" = xyes then : LIBS="$LIBS -lnetwork" fi ;; HP-UX-*.11.*) # Use updated header definitions where possible printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h printf "%s\n" "#define _XOPEN_SOURCE 1" >>confdefs.h LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = ia64 then : SHLIB_SUFFIX=".so" else case e in #( e) SHLIB_SUFFIX=".sl" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = yes then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else case e in #( e) CFLAGS="$CFLAGS -z" ;; esac fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" then : if test "$GCC" = yes then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" ;; esac fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = yes then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case e in #( e) case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" ;; esac fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : if test "$GCC" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else case e in #( e) do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" ;; esac fi fi ;; Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) SHLIB_CFLAGS="-fPIC -fno-common" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" then : CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 printf %s "checking if compiler accepts -m64 flag... " >&6; } if test ${tcl_cv_cc_m64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_m64=yes else case e in #( e) tcl_cv_cc_m64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 printf "%s\n" "$tcl_cv_cc_m64" >&6; } if test $tcl_cv_cc_m64 = yes then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related to inlining of # functions like strtol()/strtoul(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x then : CFLAGS="$CFLAGS -fno-inline" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; Darwin-*) CFLAGS_OPTIMIZE="-O2" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes then : case `arch` in ppc) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; } if test ${tcl_cv_cc_arch_ppc64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_ppc64=yes else case e in #( e) tcl_cv_cc_arch_ppc64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; } if test $tcl_cv_cc_arch_ppc64 = yes then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386|x86_64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; } if test ${tcl_cv_cc_arch_x86_64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_x86_64=yes else case e in #( e) tcl_cv_cc_arch_x86_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 printf "%s\n" "$tcl_cv_cc_arch_x86_64" >&6; } if test $tcl_cv_cc_arch_x86_64 = yes then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; arm64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64 flag" >&5 printf %s "checking if compiler accepts -arch arm64 flag... " >&6; } if test ${tcl_cv_cc_arch_arm64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch arm64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_arm64=yes else case e in #( e) tcl_cv_cc_arch_arm64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64" >&5 printf "%s\n" "$tcl_cv_cc_arch_arm64" >&6; } if test $tcl_cv_cc_arch_arm64 = yes then : CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes fi;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else case e in #( e) # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) ' then : fat_32_64=yes fi ;; esac fi SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="$LDFLAGS -headerpad_max_install_names" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 printf %s "checking if ld accepts -search_paths_first flag... " >&6; } if test ${tcl_cv_ld_search_paths_first+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_ld_search_paths_first=yes else case e in #( e) tcl_cv_ld_search_paths_first=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 printf "%s\n" "$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes then : printf "%s\n" "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH" printf "%s\n" "#define MAC_OSX_TCL 1" >>confdefs.h PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 printf %s "checking whether to use CoreFoundation... " >&6; } # Check whether --enable-corefoundation was given. if test ${enable_corefoundation+y} then : enableval=$enable_corefoundation; tcl_corefoundation=$enableval else case e in #( e) tcl_corefoundation=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 printf "%s\n" "$tcl_corefoundation" >&6; } if test $tcl_corefoundation = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 printf %s "checking for CoreFoundation.framework... " >&6; } if test ${tcl_cv_lib_corefoundation+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_libs=$LIBS if test "$fat_32_64" = yes then : for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit # archs from CFLAGS et al. while testing for # presence of CF. 64-bit CF is disabled in # tclUnixPort.h if necessary. eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi LIBS="$LIBS -framework CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_lib_corefoundation=yes else case e in #( e) tcl_cv_lib_corefoundation=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$fat_32_64" = yes then : for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi LIBS=$hold_libs ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 printf "%s\n" "$tcl_cv_lib_corefoundation" >&6; } if test $tcl_cv_lib_corefoundation = yes then : LIBS="$LIBS -framework CoreFoundation" printf "%s\n" "#define HAVE_COREFOUNDATION 1" >>confdefs.h else case e in #( e) tcl_corefoundation=no ;; esac fi if test "$fat_32_64" = yes -a $tcl_corefoundation = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 printf %s "checking for 64-bit CoreFoundation... " >&6; } if test ${tcl_cv_lib_corefoundation_64+y} then : printf %s "(cached) " >&6 else case e in #( e) for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_lib_corefoundation_64=yes else case e in #( e) tcl_cv_lib_corefoundation_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 printf "%s\n" "$tcl_cv_lib_corefoundation_64" >&6; } if test $tcl_cv_lib_corefoundation_64 = no then : printf "%s\n" "#define NO_COREFOUNDATION_64 1" >>confdefs.h LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi fi fi ;; OS/390-*) SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy printf "%s\n" "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = 1 then : SHLIB_LD='${CC} -shared' else case e in #( e) SHLIB_LD='${CC} -non_shared' ;; esac fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes then : CFLAGS="$CFLAGS -mieee" else case e in #( e) CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" ;; esac fi # see pthread_intro(3) for pthread support on osf1, k.furukawa CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = yes then : LIBS="$LIBS -lpthread -lmach -lexc" else case e in #( e) CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; esac fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = yes then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else case e in #( e) SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" ;; esac fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else case e in #( e) SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; esac fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : arch=`isainfo` if test "$arch" = "sparcv9 sparc" then : if test "$GCC" = yes then : if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" ;; esac fi else case e in #( e) do64bit_ok=yes if test "$do64bitVIS" = yes then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else case e in #( e) CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" ;; esac fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" ;; esac fi else case e in #( e) if test "$arch" = "amd64 i386" then : if test "$GCC" = yes then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else case e in #( e) do64bit_ok=yes case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac ;; esac fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} ;; esac fi ;; esac fi fi #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- if test "$GCC" = yes then : use_sunmath=no else case e in #( e) arch=`isainfo` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 printf %s "checking whether to use -lsunmath for fp rounding control... " >&6; } if test "$arch" = "amd64 i386" -o "$arch" = "i386" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } MATH_LIBS="-lsunmath $MATH_LIBS" ac_fn_c_check_header_compile "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" if test "x$ac_cv_header_sunmath_h" = xyes then : fi use_sunmath=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } use_sunmath=no ;; esac fi ;; esac fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = yes then : if test "$arch" = "sparcv9 sparc" then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else case e in #( e) if test "$arch" = "amd64 i386" then : SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi ;; esac fi fi else case e in #( e) if test "$use_sunmath" = yes then : textmode=textoff else case e in #( e) textmode=text ;; esac fi case $system in SunOS-5.[1-9][0-9]*|SunOS-5.[7-9]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ;; esac fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 printf %s "checking for ld accepts -Bexport flag... " >&6; } if test ${tcl_cv_ld_Bexport+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_ld_Bexport=yes else case e in #( e) tcl_cv_ld_Bexport=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 printf "%s\n" "$tcl_cv_ld_Bexport" >&6; } if test $tcl_cv_ld_Bexport = yes then : LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = yes -a "$do64bit_ok" = no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 printf "%s\n" "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi if test "$do64bit" = yes -a "$do64bit_ok" = yes then : printf "%s\n" "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load was given. if test ${enable_load+y} then : enableval=$enable_load; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = no then : DL_OBJS="" fi if test "x$DL_OBJS" != x then : BUILD_DLTEST="\$(DLTEST_TARGETS)" else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 printf "%s\n" "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" ;; esac fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes then : case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*|MSYS_*) ;; HP-UX*) ;; Darwin-*) ;; IRIX*) ;; Linux*|GNU*) ;; NetBSD-*|OpenBSD-*) ;; OSF1-*) ;; SCO_SV-3.2*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$tcl_cv_cc_visibility_hidden" != yes then : printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h fi if test "$SHARED_LIB_SUFFIX" = "" then : SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" then : UNSHARED_LIB_SUFFIX='${VERSION}.a' fi DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != "" then : LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll" then : INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else case e in #( e) INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ;; esac fi else case e in #( e) LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} if test "$RANLIB" = "" then : MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' else case e in #( e) MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' ;; esac fi INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ;; esac fi # Stub lib does not depend on shared/static configuration if test "$RANLIB" = "" then : MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' else case e in #( e) MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' ;; esac fi INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. if test "x${TCL_LIBS}" = x then : TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 printf %s "checking for cast to union support... " >&6; } if test ${tcl_cv_cast_to_union+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cast_to_union=yes else case e in #( e) tcl_cv_cast_to_union=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 printf "%s\n" "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 printf %s "checking for working -fno-lto... " >&6; } if test ${ac_cv_nolto+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_nolto=yes else case e in #( e) ac_cv_nolto=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 printf "%s\n" "$ac_cv_nolto" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5 printf %s "checking if the compiler understands -finput-charset... " >&6; } if test ${tcl_cv_cc_input_charset+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_input_charset=yes else case e in #( e) tcl_cv_cc_input_charset=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5 printf "%s\n" "$tcl_cv_cc_input_charset" >&6; } if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi # Check for vfork, posix_spawnp() and friends unconditionally ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" if test "x$ac_cv_func_vfork" = xyes then : printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" if test "x$ac_cv_func_posix_spawnp" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2" if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags" if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h fi # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 printf %s "checking for build with symbols... " >&6; } # Check whether --enable-symbols was given. if test ${enable_symbols+y} then : enableval=$enable_symbols; tcl_ok=$enableval else case e in #( e) tcl_ok=no ;; esac fi # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' printf "%s\n" "#define NDEBUG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 printf "%s\n" "yes (standard debugging)" >&6; } fi fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_COMPILE_DEBUG 1" >>confdefs.h printf "%s\n" "#define TCL_COMPILE_STATS 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 printf "%s\n" "enabled symbols mem compile debugging" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 printf "%s\n" "enabled $tcl_ok debugging" >&6; } fi fi printf "%s\n" "#define MP_PREC 4" >>confdefs.h #-------------------------------------------------------------------- # Detect what compiler flags to set for 64-bit support. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 printf %s "checking for required early compiler flags... " >&6; } tcl_flags="" if test ${tcl_cv_flag__isoc99_source+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__isoc99_source=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main (void) { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__isoc99_source=yes else case e in #( e) tcl_cv_flag__isoc99_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test ${tcl_cv_flag__file_offset_bits+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__file_offset_bits=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include int main (void) { switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__file_offset_bits=yes else case e in #( e) tcl_cv_flag__file_offset_bits=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi if test ${tcl_cv_flag__largefile64_source+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__largefile64_source=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main (void) { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__largefile64_source=yes else case e in #( e) tcl_cv_flag__largefile64_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 printf "%s\n" "${tcl_flags}" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5 printf %s "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; } if test ${tcl_cv_type_64bit+y} then : printf %s "(cached) " >&6 else case e in #( e) tcl_cv_type_64bit=none # See if we could use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { switch (0) { case 1: case (sizeof(long long)==sizeof(long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_64bit="long long" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "${tcl_cv_type_64bit}" = none ; then printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } # Now check for auxiliary declarations { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit time_t" >&5 printf %s "checking for 64-bit time_t... " >&6; } if test ${tcl_cv_time_t_64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_time_t_64=yes else case e in #( e) tcl_cv_time_t_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_time_t_64" >&5 printf "%s\n" "$tcl_cv_time_t_64" >&6; } if test "x${tcl_cv_time_t_64}" = "xno" ; then # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 # which SC_TCL_EARLY_FLAGS has defined if necessary. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _TIME_BITS=64 enables 64-bit time_t" >&5 printf %s "checking if _TIME_BITS=64 enables 64-bit time_t... " >&6; } if test ${tcl_cv__time_bits+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _TIME_BITS 64 #include int main (void) { switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv__time_bits=yes else case e in #( e) tcl_cv__time_bits=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv__time_bits" >&5 printf "%s\n" "$tcl_cv__time_bits" >&6; } if test "x${tcl_cv__time_bits}" = "xyes" ; then printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 printf %s "checking for struct dirent64... " >&6; } if test ${tcl_cv_struct_dirent64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { struct dirent64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_struct_dirent64=yes else case e in #( e) tcl_cv_struct_dirent64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 printf "%s\n" "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then printf "%s\n" "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5 printf %s "checking for DIR64... " >&6; } if test ${tcl_cv_DIR64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_DIR64=yes else case e in #( e) tcl_cv_DIR64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 printf "%s\n" "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64" if test "x$ac_cv_func_lseek64" = xyes then : printf "%s\n" "#define HAVE_LSEEK64 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 printf %s "checking for off64_t... " >&6; } if test ${tcl_cv_type_off64_t+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { off64_t offset; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_off64_t=yes else case e in #( e) tcl_cv_type_off64_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then printf "%s\n" "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi #-------------------------------------------------------------------- # Check endianness because we can optimize comparisons of # Tcl_UniChar strings to memcmp on big-endian systems. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO" then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } int main (int argc, char **argv) { /* Intimidate the compiler so that it does not optimize the arrays away. */ char *p = argv[0]; ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; return use_ascii (argc) == use_ebcdic (*p); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no else case e in #( e) ac_cv_c_bigendian=yes ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) # ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac #-------------------------------------------------------------------- # Supply substitutes for missing POSIX library procedures, or # set flags so Tcl uses alternate procedures. #-------------------------------------------------------------------- # Check if Posix compliant getcwd exists, if not we'll use getwd. for ac_func in getcwd do : ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" if test "x$ac_cv_func_getcwd" = xyes then : printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h else case e in #( e) printf "%s\n" "#define USEGETWD 1" >>confdefs.h ;; esac fi done # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes then : printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" if test "x$ac_cv_func_waitpid" = xyes then : printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" waitpid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes then : else case e in #( e) printf "%s\n" "#define NO_STRERROR 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" if test "x$ac_cv_func_getwd" = xyes then : else case e in #( e) printf "%s\n" "#define NO_GETWD 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" if test "x$ac_cv_func_wait3" = xyes then : else case e in #( e) printf "%s\n" "#define NO_WAIT3 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" if test "x$ac_cv_func_fork" = xyes then : else case e in #( e) printf "%s\n" "#define NO_FORK 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod" if test "x$ac_cv_func_mknod" = xyes then : else case e in #( e) printf "%s\n" "#define NO_MKNOD 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain" if test "x$ac_cv_func_tcdrain" = xyes then : else case e in #( e) printf "%s\n" "#define NO_TCDRAIN 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes then : else case e in #( e) printf "%s\n" "#define NO_UNAME 1" >>confdefs.h ;; esac fi if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print $1}'`" -lt 7; then # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232 ac_cv_func_realpath=no fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes then : else case e in #( e) printf "%s\n" "#define NO_REALPATH 1" >>confdefs.h ;; esac fi NEED_FAKE_RFC2553=0 for ac_func in getnameinfo getaddrinfo freeaddrinfo gai_strerror do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi done ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #include #include #include #include " if test "x$ac_cv_type_struct_addrinfo" = xyes then : printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " #include #include #include #include " if test "x$ac_cv_type_struct_in6_addr" = xyes then : printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " #include #include #include #include " if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #include #include #include #include " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi if test "x$NEED_FAKE_RFC2553" = "x1"; then printf "%s\n" "#define NEED_FAKE_RFC2553 1" >>confdefs.h case " $LIBOBJS " in *" fake-rfc2553.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fake-rfc2553.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes then : fi fi #-------------------------------------------------------------------- # Look for thread-safe variants of some library functions. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" if test "x$ac_cv_func_getpwuid_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 5 args" >&5 printf %s "checking for getpwuid_r with 5 args... " >&6; } if test ${tcl_cv_api_getpwuid_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { uid_t uid; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwuid_r(uid, &pw, buf, buflen, &pwp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwuid_r_5=yes else case e in #( e) tcl_cv_api_getpwuid_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_5" >&5 printf "%s\n" "$tcl_cv_api_getpwuid_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 4 args" >&5 printf %s "checking for getpwuid_r with 4 args... " >&6; } if test ${tcl_cv_api_getpwuid_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { uid_t uid; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(uid, &pw, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwuid_r_4=yes else case e in #( e) tcl_cv_api_getpwuid_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_4" >&5 printf "%s\n" "$tcl_cv_api_getpwuid_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r" if test "x$ac_cv_func_getpwnam_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 5 args" >&5 printf %s "checking for getpwnam_r with 5 args... " >&6; } if test ${tcl_cv_api_getpwnam_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwnam_r(name, &pw, buf, buflen, &pwp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwnam_r_5=yes else case e in #( e) tcl_cv_api_getpwnam_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_5" >&5 printf "%s\n" "$tcl_cv_api_getpwnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 4 args" >&5 printf %s "checking for getpwnam_r with 4 args... " >&6; } if test ${tcl_cv_api_getpwnam_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(name, &pw, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwnam_r_4=yes else case e in #( e) tcl_cv_api_getpwnam_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_4" >&5 printf "%s\n" "$tcl_cv_api_getpwnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" if test "x$ac_cv_func_getgrgid_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 5 args" >&5 printf %s "checking for getgrgid_r with 5 args... " >&6; } if test ${tcl_cv_api_getgrgid_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { gid_t gid; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrgid_r(gid, &gr, buf, buflen, &grp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrgid_r_5=yes else case e in #( e) tcl_cv_api_getgrgid_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_5" >&5 printf "%s\n" "$tcl_cv_api_getgrgid_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 4 args" >&5 printf %s "checking for getgrgid_r with 4 args... " >&6; } if test ${tcl_cv_api_getgrgid_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { gid_t gid; struct group gr; char buf[512]; int buflen = 512; (void)getgrgid_r(gid, &gr, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrgid_r_4=yes else case e in #( e) tcl_cv_api_getgrgid_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_4" >&5 printf "%s\n" "$tcl_cv_api_getgrgid_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r" if test "x$ac_cv_func_getgrnam_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 5 args" >&5 printf %s "checking for getgrnam_r with 5 args... " >&6; } if test ${tcl_cv_api_getgrnam_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrnam_r(name, &gr, buf, buflen, &grp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrnam_r_5=yes else case e in #( e) tcl_cv_api_getgrnam_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_5" >&5 printf "%s\n" "$tcl_cv_api_getgrnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 4 args" >&5 printf %s "checking for getgrnam_r with 4 args... " >&6; } if test ${tcl_cv_api_getgrnam_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct group gr; char buf[512]; int buflen = 512; (void)getgrnam_r(name, &gr, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrnam_r_4=yes else case e in #( e) tcl_cv_api_getgrnam_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_4" >&5 printf "%s\n" "$tcl_cv_api_getgrnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h fi fi if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print $1}'`" -gt 5; then # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h elif test "`uname -s`" = "HP-UX" && \ test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then # Starting with HPUX 11.00 (we believe), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac # Avoids picking hidden internal symbol from libc ac_fn_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_gethostbyname_r" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : tcl_cv_api_gethostbyname_r=yes else case e in #( e) tcl_cv_api_gethostbyname_r=no ;; esac fi if test "$tcl_cv_api_gethostbyname_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" if test "x$ac_cv_func_gethostbyname_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 args" >&5 printf %s "checking for gethostbyname_r with 6 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_6+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he, *res; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_6=yes else case e in #( e) tcl_cv_api_gethostbyname_r_6=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_6" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_6" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_6 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 args" >&5 printf %s "checking for gethostbyname_r with 5 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_5=yes else case e in #( e) tcl_cv_api_gethostbyname_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_5" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_5" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 3 args" >&5 printf %s "checking for gethostbyname_r with 3 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he; struct hostent_data data; (void) gethostbyname_r(name, he, &data); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_3=yes else case e in #( e) tcl_cv_api_gethostbyname_r_3=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_3" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_3" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_3 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h fi fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h fi fi fi # Avoids picking hidden internal symbol from libc ac_fn_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : tcl_cv_api_gethostbyaddr_r=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r=no ;; esac fi if test "$tcl_cv_api_gethostbyaddr_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r" if test "x$ac_cv_func_gethostbyaddr_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 7 args" >&5 printf %s "checking for gethostbyaddr_r with 7 args... " >&6; } if test ${tcl_cv_api_gethostbyaddr_r_7+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *addr; int length; int type; struct hostent *result; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyaddr_r_7=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r_7=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_7" >&5 printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_7" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_7 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 8 args" >&5 printf %s "checking for gethostbyaddr_r with 8 args... " >&6; } if test ${tcl_cv_api_gethostbyaddr_r_8+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *addr; int length; int type; struct hostent *result, *resultp; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyaddr_r_8=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r_8=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_8" >&5 printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_8" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_8 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R 1" >>confdefs.h fi fi fi fi #--------------------------------------------------------------------------- # Check for serial port interface. # # termios.h is present on all POSIX systems. # sys/ioctl.h is almost always present, though what it contains # is system-specific. # sys/modem.h is needed on HP-UX. #--------------------------------------------------------------------------- ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" if test "x$ac_cv_header_sys_modem_h" = xyes then : printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Include sys/select.h if it exists and if it supplies things # that appear to be useful and aren't already in sys/types.h. # This appears to be true only on the RS/6000 under AIX. Some # systems like OSF/1 have a sys/select.h that's of no use, and # other systems like SCO UNIX have a sys/select.h that's # pernicious. If "fd_set" isn't defined anywhere then set a # special flag. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 printf %s "checking for fd_set in sys/types... " >&6; } if test ${tcl_cv_type_fd_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { fd_set readMask, writeMask; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_fd_set=yes else case e in #( e) tcl_cv_type_fd_set=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 printf "%s\n" "$tcl_cv_type_fd_set" >&6; } tcl_ok=$tcl_cv_type_fd_set if test $tcl_ok = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 printf %s "checking for fd_mask in sys/select... " >&6; } if test ${tcl_cv_grep_fd_mask+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "fd_mask" >/dev/null 2>&1 then : tcl_cv_grep_fd_mask=present else case e in #( e) tcl_cv_grep_fd_mask=missing ;; esac fi rm -rf conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 printf "%s\n" "$tcl_cv_grep_fd_mask" >&6; } if test $tcl_cv_grep_fd_mask = present; then printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h tcl_ok=yes fi fi if test $tcl_ok = no; then printf "%s\n" "#define NO_FD_SET 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 printf %s "checking for pselect... " >&6; } if test ${tcl_cv_func_pselect+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *func = pselect; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_func_pselect=yes else case e in #( e) tcl_cv_func_pselect=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_func_pselect" >&5 printf "%s\n" "$tcl_cv_func_pselect" >&6; } tcl_ok=$tcl_cv_func_pselect if test $tcl_ok = yes; then printf "%s\n" "#define HAVE_PSELECT 1" >>confdefs.h fi #------------------------------------------------------------------------ # Options for the notifier. Checks for epoll(7) on Linux, and # kqueue(2) on {DragonFly,Free,Net,Open}BSD #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for advanced notifier support" >&5 printf %s "checking for advanced notifier support... " >&6; } case x`uname -s` in xLinux) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: epoll(7)" >&5 printf "%s\n" "epoll(7)" >&6; } for ac_header in sys/epoll.h do : ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h printf "%s\n" "#define NOTIFIER_EPOLL 1" >>confdefs.h fi done for ac_header in sys/eventfd.h do : ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_eventfd_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h fi done;; xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue(2)" >&5 printf "%s\n" "kqueue(2)" >&6; } # Messy because we want to check if *all* the headers are present, and not # just *any* tcl_kqueue_headers=x for ac_header in sys/types.h sys/event.h sys/time.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF tcl_kqueue_headers=${tcl_kqueue_headers}y fi done if test $tcl_kqueue_headers = xyyy then : printf "%s\n" "#define NOTIFIER_KQUEUE 1" >>confdefs.h fi;; xDarwin) # Assume that we've got CoreFoundation present (checked elsewhere because # of wider impact). { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OSX" >&5 printf "%s\n" "OSX" >&6; };; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; };; esac #------------------------------------------------------------------------------ # Find out all about time handling differences. #------------------------------------------------------------------------------ ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" if test "x$ac_cv_func_gmtime_r" = xyes then : printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" if test "x$ac_cv_func_localtime_r" = xyes then : printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_tzadj in struct tm" >&5 printf %s "checking tm_tzadj in struct tm... " >&6; } if test ${tcl_cv_member_tm_tzadj+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct tm tm; (void)tm.tm_tzadj; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_member_tm_tzadj=yes else case e in #( e) tcl_cv_member_tm_tzadj=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_tzadj" >&5 printf "%s\n" "$tcl_cv_member_tm_tzadj" >&6; } if test $tcl_cv_member_tm_tzadj = yes ; then printf "%s\n" "#define HAVE_TM_TZADJ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_gmtoff in struct tm" >&5 printf %s "checking tm_gmtoff in struct tm... " >&6; } if test ${tcl_cv_member_tm_gmtoff+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct tm tm; (void)tm.tm_gmtoff; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_member_tm_gmtoff=yes else case e in #( e) tcl_cv_member_tm_gmtoff=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_gmtoff" >&5 printf "%s\n" "$tcl_cv_member_tm_gmtoff" >&6; } if test $tcl_cv_member_tm_gmtoff = yes ; then printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking long timezone variable" >&5 printf %s "checking long timezone variable... " >&6; } if test ${tcl_cv_timezone_long+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { extern long timezone; timezone += 1; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_timezone_long=yes else case e in #( e) tcl_cv_timezone_long=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_long" >&5 printf "%s\n" "$tcl_cv_timezone_long" >&6; } if test $tcl_cv_timezone_long = yes ; then printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking time_t timezone variable" >&5 printf %s "checking time_t timezone variable... " >&6; } if test ${tcl_cv_timezone_time+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { extern time_t timezone; timezone += 1; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_timezone_time=yes else case e in #( e) tcl_cv_timezone_time=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_time" >&5 printf "%s\n" "$tcl_cv_timezone_time" >&6; } if test $tcl_cv_timezone_time = yes ; then printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h fi fi #-------------------------------------------------------------------- # Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But # we might be able to use fstatfs instead. Some systems (OpenBSD?) also # lack blkcnt_t. #-------------------------------------------------------------------- if test "$ac_cv_cygwin" != "yes"; then ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blocks" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blksize" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_rdev" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h fi fi ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "$ac_includes_default" if test "x$ac_cv_type_blkcnt_t" = xyes then : printf "%s\n" "#define HAVE_BLKCNT_T 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs" if test "x$ac_cv_func_fstatfs" = xyes then : else case e in #( e) printf "%s\n" "#define NO_FSTATFS 1" >>confdefs.h ;; esac fi #-------------------------------------------------------------------- # Check for various typedefs and provide substitutes if # they don't exist. #-------------------------------------------------------------------- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : else case e in #( e) printf "%s\n" "#define mode_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default " if test "x$ac_cv_type_pid_t" = xyes then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else case e in #( e) ac_pid_type='__int64' ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else case e in #( e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" if test "x$ac_cv_type_uid_t" = xyes then : else case e in #( e) printf "%s\n" "#define uid_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" if test "x$ac_cv_type_gid_t" = xyes then : else case e in #( e) printf "%s\n" "#define gid_t int" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 printf %s "checking for socklen_t... " >&6; } if test ${tcl_cv_type_socklen_t+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { socklen_t foo; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_socklen_t=yes else case e in #( e) tcl_cv_type_socklen_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_socklen_t" >&5 printf "%s\n" "$tcl_cv_type_socklen_t" >&6; } if test $tcl_cv_type_socklen_t = no; then printf "%s\n" "#define socklen_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" " #include " if test "x$ac_cv_type_intptr_t" = xyes then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" " #include " if test "x$ac_cv_type_uintptr_t" = xyes then : printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h fi #-------------------------------------------------------------------- # The check below checks whether defines the type # "union wait" correctly. It's needed because of weirdness in # HP-UX where "union wait" is defined in both the BSD and SYS-V # environments. Checking the usability of WIFEXITED seems to do # the trick. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking union wait" >&5 printf %s "checking union wait... " >&6; } if test ${tcl_cv_union_wait+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { union wait x; WIFEXITED(x); /* Generates compiler error if WIFEXITED * uses an int. */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_union_wait=yes else case e in #( e) tcl_cv_union_wait=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_union_wait" >&5 printf "%s\n" "$tcl_cv_union_wait" >&6; } if test $tcl_cv_union_wait = no; then printf "%s\n" "#define NO_UNION_WAIT 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check whether there is an strncasecmp function on this system. # This is a bit tricky because under SCO it's in -lsocket and # under Sequent Dynix it's in -linet. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi if test "$tcl_ok" = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -lsocket" >&5 printf %s "checking for strncasecmp in -lsocket... " >&6; } if test ${ac_cv_lib_socket_strncasecmp+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char strncasecmp (void); int main (void) { return strncasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_strncasecmp=yes else case e in #( e) ac_cv_lib_socket_strncasecmp=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_strncasecmp" >&5 printf "%s\n" "$ac_cv_lib_socket_strncasecmp" >&6; } if test "x$ac_cv_lib_socket_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi fi if test "$tcl_ok" = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -linet" >&5 printf %s "checking for strncasecmp in -linet... " >&6; } if test ${ac_cv_lib_inet_strncasecmp+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char strncasecmp (void); int main (void) { return strncasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_inet_strncasecmp=yes else case e in #( e) ac_cv_lib_inet_strncasecmp=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_strncasecmp" >&5 printf "%s\n" "$ac_cv_lib_inet_strncasecmp" >&6; } if test "x$ac_cv_lib_inet_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi fi if test "$tcl_ok" = 0; then case " $LIBOBJS " in *" strncasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" ;; esac USE_COMPAT=1 fi #-------------------------------------------------------------------- # The code below deals with several issues related to gettimeofday: # 1. Some systems don't provide a gettimeofday function at all # (set NO_GETTOD if this is the case). # 2. See if gettimeofday is declared in the header file. # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can # declare it. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes then : else case e in #( e) printf "%s\n" "#define NO_GETTOD 1" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday declaration" >&5 printf %s "checking for gettimeofday declaration... " >&6; } if test ${tcl_cv_grep_gettimeofday+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "gettimeofday" >/dev/null 2>&1 then : tcl_cv_grep_gettimeofday=present else case e in #( e) tcl_cv_grep_gettimeofday=missing ;; esac fi rm -rf conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_gettimeofday" >&5 printf "%s\n" "$tcl_cv_grep_gettimeofday" >&6; } if test $tcl_cv_grep_gettimeofday = missing ; then printf "%s\n" "#define GETTOD_NOT_DECLARED 1" >>confdefs.h fi #-------------------------------------------------------------------- # The following code checks to see whether it is possible to get # signed chars on this platform. This is needed in order to # properly generate sign-extended ints from character values. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 printf %s "checking whether char is unsigned... " >&6; } if test ${ac_cv_c_char_unsigned+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_char_unsigned=no else case e in #( e) ac_cv_c_char_unsigned=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes; then printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking signed char declarations" >&5 printf %s "checking signed char declarations... " >&6; } if test ${tcl_cv_char_signed+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { signed char *p; p = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_char_signed=yes else case e in #( e) tcl_cv_char_signed=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_char_signed" >&5 printf "%s\n" "$tcl_cv_char_signed" >&6; } if test $tcl_cv_char_signed = yes; then printf "%s\n" "#define HAVE_SIGNED_CHAR 1" >>confdefs.h fi #-------------------------------------------------------------------- # Does putenv() copy or not? We need to know to avoid memory leaks. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a putenv() that copies the buffer" >&5 printf %s "checking for a putenv() that copies the buffer... " >&6; } if test ${tcl_cv_putenv_copy+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : tcl_cv_putenv_copy=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #define OURVAR "havecopy=yes" int main (int argc, char *argv[]) { char *foo, *bar; foo = (char *)strdup(OURVAR); putenv(foo); strcpy((char *)(strchr(foo, '=') + 1), "no"); bar = getenv("havecopy"); if (!strcmp(bar, "no")) { /* doesnt copy */ return 0; } else { /* does copy */ return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO" then : tcl_cv_putenv_copy=no else case e in #( e) tcl_cv_putenv_copy=yes ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_putenv_copy" >&5 printf "%s\n" "$tcl_cv_putenv_copy" >&6; } if test $tcl_cv_putenv_copy = yes; then printf "%s\n" "#define HAVE_PUTENV_THAT_COPIES 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- # Check whether --enable-langinfo was given. if test ${enable_langinfo+y} then : enableval=$enable_langinfo; langinfo_ok=$enableval else case e in #( e) langinfo_ok=yes ;; esac fi HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes then : langinfo_ok=yes else case e in #( e) langinfo_ok=no ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use nl_langinfo" >&5 printf %s "checking whether to use nl_langinfo... " >&6; } if test "$langinfo_ok" = "yes"; then if test ${tcl_cv_langinfo_h+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { nl_langinfo(CODESET); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_langinfo_h=yes else case e in #( e) tcl_cv_langinfo_h=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_langinfo_h" >&5 printf "%s\n" "$tcl_cv_langinfo_h" >&6; } if test $tcl_cv_langinfo_h = yes; then printf "%s\n" "#define HAVE_LANGINFO 1" >>confdefs.h fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $langinfo_ok" >&5 printf "%s\n" "$langinfo_ok" >&6; } fi #-------------------------------------------------------------------- # Check for support of cfmakeraw, chflags and mkstemps functions #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "cfmakeraw" "ac_cv_func_cfmakeraw" if test "x$ac_cv_func_cfmakeraw" = xyes then : printf "%s\n" "#define HAVE_CFMAKERAW 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" if test "x$ac_cv_func_chflags" = xyes then : printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkstemps" "ac_cv_func_mkstemps" if test "x$ac_cv_func_mkstemps" = xyes then : printf "%s\n" "#define HAVE_MKSTEMPS 1" >>confdefs.h fi #-------------------------------------------------------------------- # Darwin specific API checks and defines #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" if test "x$ac_cv_func_getattrlist" = xyes then : printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "copyfile.h" "ac_cv_header_copyfile_h" "$ac_includes_default" if test "x$ac_cv_header_copyfile_h" = xyes then : printf "%s\n" "#define HAVE_COPYFILE_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "copyfile" "ac_cv_func_copyfile" if test "x$ac_cv_func_copyfile" = xyes then : printf "%s\n" "#define HAVE_COPYFILE 1" >>confdefs.h fi if test $tcl_corefoundation = yes; then ac_fn_c_check_header_compile "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default" if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes then : printf "%s\n" "#define HAVE_LIBKERN_OSATOMIC_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "OSSpinLockLock" "ac_cv_func_OSSpinLockLock" if test "x$ac_cv_func_OSSpinLockLock" = xyes then : printf "%s\n" "#define HAVE_OSSPINLOCKLOCK 1" >>confdefs.h fi fi printf "%s\n" "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h printf "%s\n" "#define TCL_WIDE_CLICKS 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 printf %s "checking if weak import is available... " >&6; } if test ${tcl_cv_cc_weak_import+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int rand(void) __attribute__((weak_import)); int main (void) { rand(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_weak_import=yes else case e in #( e) tcl_cv_cc_weak_import=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 printf "%s\n" "$tcl_cv_cc_weak_import" >&6; } if test $tcl_cv_cc_weak_import = yes; then printf "%s\n" "#define HAVE_WEAK_IMPORT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 printf %s "checking if Darwin SUSv3 extensions are available... " >&6; } if test ${tcl_cv_cc_darwin_c_source+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _DARWIN_C_SOURCE 1 #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_darwin_c_source=yes else case e in #( e) tcl_cv_cc_darwin_c_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 printf "%s\n" "$tcl_cv_cc_darwin_c_source" >&6; } if test $tcl_cv_cc_darwin_c_source = yes; then printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h fi # Build .bundle dltest binaries in addition to .dylib DLTEST_LD='${CC} -bundle -Wl,-w ${CFLAGS} ${LDFLAGS}' DLTEST_SUFFIX=".bundle" else DLTEST_LD='${SHLIB_LD}' DLTEST_SUFFIX="" fi #-------------------------------------------------------------------- # Check for support of fts functions (readdir replacement) #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fts" >&5 printf %s "checking for fts... " >&6; } if test ${tcl_cv_api_fts+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { char*const p[2] = {"/", NULL}; FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL); FTSENT *e = fts_read(f); fts_close(f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_api_fts=yes else case e in #( e) tcl_cv_api_fts=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_fts" >&5 printf "%s\n" "$tcl_cv_api_fts" >&6; } if test $tcl_cv_api_fts = yes; then printf "%s\n" "#define HAVE_FTS 1" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below check for systems where POSIX-style non-blocking # I/O (O_NONBLOCK) doesn't work or is unimplemented. On these systems # (mostly older ones), use the old BSD-style FIONBIO approach instead. #-------------------------------------------------------------------- ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_filio_h" = xyes then : printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 printf %s "checking system version... " >&6; } if test ${tcl_cv_sys_version+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 printf "%s\n" "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 printf %s "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... " >&6; } case $system in OSF*) printf "%s\n" "#define USE_FIONBIO 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FIONBIO" >&5 printf "%s\n" "FIONBIO" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: O_NONBLOCK" >&5 printf "%s\n" "O_NONBLOCK" >&6; } ;; esac #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use dll unloading" >&5 printf %s "checking whether to use dll unloading... " >&6; } # Check whether --enable-dll-unloading was given. if test ${enable_dll_unloading+y} then : enableval=$enable_dll_unloading; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test $tcl_ok = yes; then printf "%s\n" "#define TCL_UNLOAD_DLLS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 printf "%s\n" "$tcl_ok" >&6; } #------------------------------------------------------------------------ # Check whether the timezone data is supplied by the OS or has # to be installed by Tcl. The default is autodetection, but can # be overridden on the configure command line either way. #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5 printf %s "checking for timezone data... " >&6; } # Check whether --with-tzdata was given. if test ${with_tzdata+y} then : withval=$with_tzdata; tcl_ok=$withval else case e in #( e) tcl_ok=auto ;; esac fi # # Any directories that get added here must also be added to the # search path in ::tcl::clock::Initialize (library/clock.tcl). # case $tcl_ok in no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by OS vendor" >&5 printf "%s\n" "supplied by OS vendor" >&6; } ;; yes) # nothing to do here ;; auto*) if test ${tcl_cv_dir_zoneinfo+y} then : printf %s "(cached) " >&6 else case e in #( e) for dir in /usr/share/zoneinfo \ /usr/share/lib/zoneinfo \ /usr/lib/zoneinfo do if test -f $dir/UTC -o -f $dir/GMT then tcl_cv_dir_zoneinfo="$dir" break fi done ;; esac fi if test -n "$tcl_cv_dir_zoneinfo"; then tcl_ok=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dir" >&5 printf "%s\n" "$dir" >&6; } else tcl_ok=yes fi ;; *) as_fn_error $? "invalid argument: $tcl_ok" "$LINENO" 5 ;; esac if test $tcl_ok = yes then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by Tcl" >&5 printf "%s\n" "supplied by Tcl" >&6; } INSTALL_TZDATA=install-tzdata fi #-------------------------------------------------------------------- # DTrace support #-------------------------------------------------------------------- # Check whether --enable-dtrace was given. if test ${enable_dtrace+y} then : enableval=$enable_dtrace; tcl_ok=$enableval else case e in #( e) tcl_ok=no ;; esac fi if test $tcl_ok = yes; then ac_fn_c_check_header_compile "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sdt_h" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi fi if test $tcl_ok = yes; then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DTRACE+y} then : printf %s "(cached) " >&6 else case e in #( e) case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_DTRACE="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 printf "%s\n" "$DTRACE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$ac_cv_path_DTRACE" && tcl_ok=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable DTrace support" >&5 printf %s "checking whether to enable DTrace support... " >&6; } MAKEFILE_SHELL='/bin/sh' if test $tcl_ok = yes; then printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h DTRACE_SRC="\${DTRACE_SRC}" DTRACE_HDR="\${DTRACE_HDR}" if test "`uname -s`" != "Darwin" ; then DTRACE_OBJ="\${DTRACE_OBJ}" if test "`uname -s`" = "SunOS" -a "$SHARED_BUILD" = "0" ; then # Need to create an intermediate object file to ensure tclDTrace.o # gets included when linking against the static tcl library. STLIB_LD='stlib_ld () { /usr/ccs/bin/ld -r -o $${1%.a}.o "$${@:2}" && '"${STLIB_LD}"' $${1} $${1%.a}.o ; } && stlib_ld' MAKEFILE_SHELL='/bin/bash' # Force use of Sun ar and ranlib, the GNU versions choke on # tclDTrace.o and the combined object file above. AR='/usr/ccs/bin/ar' RANLIB='/usr/ccs/bin/ranlib' fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 printf "%s\n" "$tcl_ok" >&6; } #-------------------------------------------------------------------- # The check below checks whether the cpuid instruction is usable. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cpuid instruction is usable" >&5 printf %s "checking whether the cpuid instruction is usable... " >&6; } if test ${tcl_cv_cpuid+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int index,regsPtr[4]; __asm__ __volatile__("mov %%ebx, %%edi \n\t" "cpuid \n\t" "mov %%ebx, %%esi \n\t" "mov %%edi, %%ebx \n\t" : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) : "a"(index) : "edi"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cpuid=yes else case e in #( e) tcl_cv_cpuid=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid" >&5 printf "%s\n" "$tcl_cv_cpuid" >&6; } if test $tcl_cv_cpuid = yes; then printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX} if test "$ac_cv_cygwin" = "yes" -a "$SHARED_BUILD" != "0"; then eval "TCL_LIB_FILE=cygtcl${LIB_SUFFIX}" EXTRA_INSTALL_BINARIES='$(INSTALL_LIBRARY) $(patsubst cyg%.dll,lib%.dll.a,${LIB_FILE}) "$(LIB_INSTALL_DIR)"' else eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}" fi # tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed # since on some platforms TCL_LIB_FILE contains shell escapes. # (See also: TCL_TRIM_DOTS). eval "TCL_LIB_FILE=${TCL_LIB_FILE}" test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)' PRIVATE_INCLUDE_DIR='$(includedir)' HTML_DIR='$(DISTDIR)/html' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 printf %s "checking how to package libraries... " >&6; } # Check whether --enable-framework was given. if test ${enable_framework+y} then : enableval=$enable_framework; enable_framework=$enableval else case e in #( e) enable_framework=no ;; esac fi if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 printf "%s\n" "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 printf "%s\n" "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: framework" >&5 printf "%s\n" "framework" >&6; } FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 printf "%s\n" "shared library" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static library" >&5 printf "%s\n" "static library" >&6; } fi FRAMEWORK_BUILD=0 fi fi TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' ac_config_files="$ac_config_files Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" TCL_YEAR="`date +%Y`" fi if test "$FRAMEWORK_BUILD" = "1" ; then printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h # Construct a fake local framework structure to make linking with # '-framework Tcl' and running of tcltest work ac_config_commands="$ac_config_commands Tcl.framework" LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" # default install directory for bundled packages if test "${libdir}" = '${exec_prefix}/lib' -o "`basename ${libdir}`" = 'Frameworks'; then PACKAGE_DIR="/Library/Tcl" else PACKAGE_DIR="$libdir" fi if test "${libdir}" = '${exec_prefix}/lib'; then # override libdir default libdir="/Library/Frameworks" fi TCL_LIB_FILE="Tcl" TCL_LIB_FLAG="-framework Tcl" TCL_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tcl" TCL_LIB_SPEC="-F${libdir} -framework Tcl" libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" TCL_LIBRARY="${libdir}/Resources/Scripts" includedir="${libdir}/Headers" PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" EXTRA_INSTALL="install-private-headers html-tcl" EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)/TclTOC.html"' EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' # Don't use AC_DEFINE for the following as the framework version define # needs to go into the Makefile even when using autoheader, so that we # can pick up a potential make override of VERSION. Also, don't put this # into CFLAGS as it should not go into tclConfig.sh EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"' else # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" # default install directory for bundled packages PACKAGE_DIR="$libdir" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TCL_LIB_FLAG="-ltcl${TCL_VERSION}" else TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" fi VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" VERSION=${TCL_VERSION} #-------------------------------------------------------------------- # Zipfs support - Tip 430 #-------------------------------------------------------------------- # Check whether --enable-zipfs was given. if test ${enable_zipfs+y} then : enableval=$enable_zipfs; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then # # Find a native compiler # # Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5 printf %s "checking for gcc... " >&6; } if test ${ac_cv_path_cc+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/gcc 2> /dev/null` \ `ls -r $dir/gcc 2> /dev/null` ; do if test x"$ac_cv_path_cc" = x ; then if test -f "$j" ; then ac_cv_path_cc=$j break fi fi done done ;; esac fi fi fi # Also set EXEEXT_FOR_BUILD. if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5 printf %s "checking for build system executable suffix... " >&6; } if test ${bfd_cv_build_exeext+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; esac done rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5 printf "%s\n" "$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi # # Find a native zip implementation # MACHER_PROG="" ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macher" >&5 printf %s "checking for macher... " >&6; } if test ${ac_cv_path_macher+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/macher 2> /dev/null` \ `ls -r $dir/macher 2> /dev/null` ; do if test x"$ac_cv_path_macher" = x ; then if test -f "$j" ; then ac_cv_path_macher=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_macher" ; then MACHER_PROG="$ac_cv_path_macher" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHER_PROG" >&5 printf "%s\n" "$MACHER_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Macher not found" >&5 printf "%s\n" "Macher not found" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zip" >&5 printf %s "checking for zip... " >&6; } if test ${ac_cv_path_zip+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5 printf "%s\n" "$ZIP_PROG" >&6; } ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5 printf "%s\n" "No zip found on PATH. Building minizip" >&6; } fi ZIPFS_BUILD=1 TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5 printf %s "checking for building with zipfs... " >&6; } if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h else printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi # Point to tcl script library if we are not embedding it. if test "${ZIPFS_BUILD}" = 0; then TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library fi #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which # gives a list of directories that may contain packages. The list # consists of one directory for machine-dependent binaries and # another for platform-independent scripts. #-------------------------------------------------------------------- if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ TCL_MODULE_PATH="~/Library/Tcl:/Library/Tcl" elif test "$prefix/lib" != "$libdir"; then test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" else test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib" fi #-------------------------------------------------------------------- # The statements below define various symbols relating to Tcl # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TCL_VERSION} # double-eval to account for TCL_TRIM_DOTS. # eval "TCL_STUB_LIB_FILE=libtclstub.a" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_DIR=\"${libdir}\"" TCL_STUB_LIB_FLAG="-ltclstub" TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} ac_config_files="$ac_config_files Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # '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" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[][ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ tcl config.status 9.0 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # VERSION=${TCL_VERSION} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Tcl-Info.plist") CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;; "Tclsh-Info.plist") CONFIG_FILES="$CONFIG_FILES Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" ;; "Tcl.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; "dltest/Makefile") CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;; "tclConfig.sh") CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;; "tcl.pc") CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "Tcl.framework":C) n=Tcl && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && unset n f v ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tcl9.0.3/unix/aclocal.m40000644000175000017500000000004015035744306014372 0ustar sergeisergeibuiltin(include,../unix/tcl.m4) tcl9.0.3/tools/0000755000175000017500000000000015104662774012722 5ustar sergeisergeitcl9.0.3/tools/white.bmp0000644000175000017500000005005215035744306014537 0ustar sergeisergeiBM*P>(UOtttcl9.0.3/tools/valgrind_suppress0000644000175000017500000001043615104661341016410 0ustar sergeisergei#{ # Tcl_GetChannelOption/TcpGetOptionProc/TcphostPortList/getnameinfo/gethostbyaddr_r # Memcheck:Leak # match-leak-kinds: reachable # fun:malloc # fun:strdup # ... # fun:module_load # ... # fun:getnameinfo # ... # fun:Tcl_GetChannelOption #} { TclCreatesocketAddress/getaddrinfo/calloc Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:getaddrinfo fun:TclCreateSocketAddress } { TclCreatesocketAddress/getaddrinfo/malloc Memcheck:Leak match-leak-kinds: definite fun:malloc ... fun:getaddrinfo fun:TclCreateSocketAddress } { TclCreatesocketAddress/getaddrinfo/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:getaddrinfo fun:TclCreateSocketAddress } { TclpDlopen/decompose_rpath Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:decompose_rpath ... fun:dlopen_doit ... fun:TclpDlopen } { TclpDlopen/load Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:dlopen fun:TclpDlopen } { TclpDlopen/load Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:dlopen fun:TclpDlopen } { TclpGetGrNam/__nss_next2/calloc Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:__nss_next2 ... fun:TclpGetGrNam } { TclpGetGrNam/__nss_next2/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:__nss_next2 ... fun:TclpGetGrNam } { TclpGetGrNam/__nss_systemd_getfrname_r/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:_nss_systemd_getgrnam_r ... fun:TclpGetGrNam } { TclpGeHostByName/gethostbyname_r/strdup/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc fun:strdup ... fun:dl_open_worker ... fun:do_dlopen ... fun:TclpGetHostByName } { TclpGeHostByName/gethostbyname_r/calloc Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:dl_open_worker ... fun:do_dlopen ... fun:TclpGetHostByName } { TclpGeHostByName/gethostbyname_r/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:dl_open_worker ... fun:do_dlopen ... fun:TclpGetHostByName } { TclpGetPwNam/getpwname_r/__nss_next2/calloc Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:__nss_next2 ... fun:TclpGetPwNam } { TclpGetPwNam/getpwname_r/__nss_next2/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:__nss_next2 ... fun:TclpGetPwNam } { TclpGetPwNam/getpwname_r/_nss_systemd_getpwnam_r/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:_nss_systemd_getpwnam_r ... fun:TclpGetPwNam } { TclpGetGrGid/getgrgid_r/tls_get_addr_tail Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:tls_get_addr_tail ... fun:TclpGetGrGid } { TclpGetGrGid/getgrgid_r/module_load Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:module_load ... fun:TclpGetGrGid } { TclpGetGrGid/getgrgid_r/module_load Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:module_load ... fun:TclpGetGrGid } { TcphostPortList/getnameinfo/module_load/calloc Memcheck:Leak match-leak-kinds: definite,reachable fun:calloc ... fun:dl_open_worker_begin ... fun:module_load ... fun:getnameinfo fun:TcpHostPortList } { # see sourceware glibc Bug 14984 - getnameinfo() might be leaking memory TcphostPortList/getnameinfo/module_load/mallco Memcheck:Leak match-leak-kinds: definite,reachable fun:malloc ... fun:dl_open_worker_begin ... fun:module_load ... fun:getnameinfo fun:TcpHostPortList } { TclpThreadExit/pthread_exit/calloc Memcheck:Leak match-leak-kinds: reachable fun:calloc ... fun:pthread_exit fun:TclpThreadExit } { TclpThreadExit/pthread_exit/malloc Memcheck:Leak match-leak-kinds: reachable fun:malloc ... fun:pthread_exit fun:TclpThreadExit } { TclpThreadExit/pthread_exit/malloc Memcheck:Leak match-leak-kinds: definite fun:malloc ... fun:pthread_exit fun:TclpThreadExit } tcl9.0.3/tools/valgrind_check_success0000644000175000017500000000074215104661341017330 0ustar sergeisergei#! /usr/bin/env tclsh proc main {sourcetype source} { switch $sourcetype { file { set chan [open $source] try { set data [read $chan] } finally { close $chan } } string { set data $source } default { error [list {wrong # args}] } } set found [regexp -inline -all {blocks are\ (?:(?:(?:definitely|indirectly|possibly) lost)|still reachable)} $data] if {[llength $found]} { puts 0 } else { puts 1 } flush stdout } main {*}$argv tcl9.0.3/tools/uniParse.tcl0000644000175000017500000002535715104661341015215 0ustar sergeisergei# uniParse.tcl -- # # This program parses the UnicodeData file and generates the # corresponding tclUniData.c file with compressed character # data tables. The input to this program should be the latest # UnicodeData file from: # ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt # # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. namespace eval uni { set shift 5; # number of bits of data within a page # This value can be adjusted to find the # best split to minimize table size variable pMap; # map from page to page index, each entry is # an index into the pages table, indexed by # page number variable pages; # map from page index to page info, each # entry is a list of indices into the groups # table, the list is indexed by the offset variable groups; # list of character info values, indexed by # group number, initialized with the # unassigned character group variable categories { Cn Lu Ll Lt Lm Lo Mn Me Mc Nd Nl No Zs Zl Zp Cc Cf Co Cs Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So }; # Ordered list of character categories, must # match the enumeration in the header file. } proc uni::getValue {items index} { variable categories # Extract character info set category [lindex $items 2] if {[scan [lindex $items 12] %x toupper] == 1} { set toupper [expr {$index - $toupper}] } else { set toupper 0 } if {[scan [lindex $items 13] %x tolower] == 1} { set tolower [expr {$tolower - $index}] } else { set tolower 0 } if {[scan [lindex $items 14] %x totitle] == 1} { set totitle [expr {$index - $totitle}] } elseif {$tolower} { set totitle 0 } else { set totitle $toupper } set categoryIndex [lsearch -exact $categories $category] if {$categoryIndex < 0} { error "Unexpected character category: $index($category)" } return [list $categoryIndex $toupper $tolower $totitle] } proc uni::getGroup {value} { variable groups set gIndex [lsearch -exact $groups $value] if {$gIndex < 0} { set gIndex [llength $groups] lappend groups $value } return $gIndex } proc uni::addPage {info} { variable pMap variable pages variable shift set pIndex [lsearch -exact $pages $info] if {$pIndex < 0} { set pIndex [llength $pages] lappend pages $info } lappend pMap [expr {$pIndex << $shift}] return } proc uni::buildTables {data} { variable shift variable pMap {} variable pages {} variable groups {{0 0 0 0}} variable next 0 set info {} ;# temporary page info set mask [expr {(1 << $shift) - 1}] foreach line [split $data \n] { if {$line eq ""} { if {!($next & $mask)} { # next character is already on page boundary continue } # fill remaining page set line [format %X [expr {($next-1)|$mask}]] append line ";;Cn;0;ON;;;;;N;;;;;\n" } set items [split $line \;] scan [lindex $items 0] %x index if {$index > 0x3FFFF} then { # Ignore characters > plane 3 continue } set index [format %d $index] set gIndex [getGroup [getValue $items $index]] # Since the input table omits unassigned characters, these will # show up as gaps in the index sequence. There are a few special cases # where the gaps correspond to a uniform block of assigned characters. # These are indicated as such in the character name. # Enter all unassigned characters up to the current character. if {($index > $next) \ && ![regexp "Last>$" [lindex $items 1]]} { for {} {$next < $index} {incr next} { lappend info 0 if {($next & $mask) == $mask} { addPage $info set info {} } } } # Enter all assigned characters up to the current character for {set i $next} {$i <= $index} {incr i} { # Add the group index to the info for the current page lappend info $gIndex # If this is the last entry in the page, add the page if {($i & $mask) == $mask} { addPage $info set info {} } } set next [expr {$index + 1}] } return } proc uni::main {} { global argc argv0 argv variable pMap variable pages variable groups variable shift variable next if {$argc != 2} { puts stderr "\nusage: $argv0 \n" exit 1 } set f [open [lindex $argv 0] r] set data [read $f] close $f buildTables $data puts "X = [llength $pMap] Y= [llength $pages] A= [llength $groups]" set size [expr {[llength $pMap]*2 + ([llength $pages]<<$shift)}] puts "shift = $shift, space = $size" set f [open [file join [lindex $argv 1] tclUniData.c] w] fconfigure $f -translation lf -encoding utf-8 puts $f "/* * tclUniData.c -- * * Declarations of Unicode character information tables. This file is * automatically generated by the tools/uniParse.tcl script. Do not * modify this file by hand. * * Copyright © 1998 Scriptics Corporation. * All rights reserved. */ /* * A 16-bit Unicode character is split into two parts in order to index * into the following tables. The lower OFFSET_BITS comprise an offset * into a page of characters. The upper bits comprise the page number. */ #define OFFSET_BITS $shift /* * The pageMap is indexed by page number and returns an alternate page number * that identifies a unique page of characters. Many Unicode characters map * to the same alternate page number. */ static const unsigned short pageMap\[\] = {" set line " " set last [expr {[llength $pMap] - 1}] for {set i 0} {$i <= $last} {incr i} { if {$i == [expr {0x10000 >> $shift}]} { set line [string trimright $line " \t,"] puts $f $line set lastpage [expr {[lindex $line end] >> $shift}] puts stdout "lastpage: $lastpage" puts $f "#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8" set line " ," } append line [lindex $pMap $i] if {$i != $last} { append line ", " } if {[string length $line] > 70} { puts $f [string trimright $line] set line " " } } puts $f $line puts $f "#endif /* TCL_UTF_MAX > 3 */" puts $f "}; /* * The groupMap is indexed by combining the alternate page number with * the page offset and returns a group number that identifies a unique * set of character attributes. */ static const unsigned char groupMap\[\] = {" set line " " set lasti [expr {[llength $pages] - 1}] for {set i 0} {$i <= $lasti} {incr i} { set page [lindex $pages $i] set lastj [expr {[llength $page] - 1}] if {$i == ($lastpage + 1)} { puts $f [string trimright $line " \t,"] puts $f "#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8" set line " ," } for {set j 0} {$j <= $lastj} {incr j} { append line [lindex $page $j] if {$j != $lastj || $i != $lasti} { append line ", " } if {[string length $line] > 70} { puts $f [string trimright $line] set line " " } } } puts $f $line puts $f "#endif /* TCL_UTF_MAX > 3 */" puts $f "}; /* * Each group represents a unique set of character attributes. The attributes * are encoded into a 32-bit value as follows: * * Bits 0-4 Character category: see the constants listed below. * * Bits 5-7 Case delta type: 000 = identity * 010 = add delta for lower * 011 = add delta for lower, add 1 for title * 100 = subtract delta for title/upper * 101 = sub delta for upper, sub 1 for title * 110 = sub delta for upper, add delta for lower * 111 = subtract delta for upper * * Bits 8-31 Case delta: delta for case conversions. This should be the * highest field so we can easily sign extend. */ static const int groups\[\] = {" set line " " set last [expr {[llength $groups] - 1}] for {set i 0} {$i <= $last} {incr i} { foreach {type toupper tolower totitle} [lindex $groups $i] {} # Compute the case conversion type and delta if {$totitle} { if {$totitle == $toupper} { # subtract delta for title or upper set case 4 set delta $toupper if {$tolower} { error "New case conversion type needed: $toupper $tolower $totitle" } } elseif {$toupper} { # subtract delta for upper, subtract 1 for title set case 5 set delta $toupper if {($totitle != 1) || $tolower} { error "New case conversion type needed: $toupper $tolower $totitle" } } else { # add delta for lower, add 1 for title set case 3 set delta $tolower if {$totitle != -1} { error "New case conversion type needed: $toupper $tolower $totitle" } } } elseif {$toupper} { set delta $toupper if {$tolower == $toupper} { # subtract delta for upper, add delta for lower set case 6 } elseif {!$tolower} { # subtract delta for upper set case 7 } else { error "New case conversion type needed: $toupper $tolower $totitle" } } elseif {$tolower} { # add delta for lower set case 2 set delta $tolower } else { # noop set case 0 set delta 0 } append line [expr {($delta << 8) | ($case << 5) | $type}] if {$i != $last} { append line ", " } if {[string length $line] > 65} { puts $f [string trimright $line] set line " " } } puts $f $line puts -nonewline $f "}; #if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 # define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1FFFFF) >= [format 0x%X $next]) #else # define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1F0000) != 0) #endif /* * The following constants are used to determine the category of a * Unicode character. */ enum { UNASSIGNED, UPPERCASE_LETTER, LOWERCASE_LETTER, TITLECASE_LETTER, MODIFIER_LETTER, OTHER_LETTER, NON_SPACING_MARK, ENCLOSING_MARK, COMBINING_SPACING_MARK, DECIMAL_DIGIT_NUMBER, LETTER_NUMBER, OTHER_NUMBER, SPACE_SEPARATOR, LINE_SEPARATOR, PARAGRAPH_SEPARATOR, CONTROL, FORMAT, PRIVATE_USE, SURROGATE, CONNECTOR_PUNCTUATION, DASH_PUNCTUATION, OPEN_PUNCTUATION, CLOSE_PUNCTUATION, INITIAL_QUOTE_PUNCTUATION, FINAL_QUOTE_PUNCTUATION, OTHER_PUNCTUATION, MATH_SYMBOL, CURRENCY_SYMBOL, MODIFIER_SYMBOL, OTHER_SYMBOL }; /* * The following macros extract the fields of the character info. The * GetDelta() macro is complicated because we can't rely on the C compiler * to do sign extension on right shifts. */ #define GetCaseType(info) (((info) & 0xE0) >> 5) #define GetCategory(ch) (GetUniCharInfo(ch) & 0x1F) #define GetDelta(info) ((info) >> 8) /* * This macro extracts the information about a character from the * Unicode character tables. */ #if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 # define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0x1FFFFF) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\]) #else # define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0xFFFF) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\]) #endif " close $f } uni::main return tcl9.0.3/tools/uniClass.tcl0000644000175000017500000000656615104656622015217 0ustar sergeisergei#!/bin/sh # The next line is executed by /bin/sh, but not tcl \ exec tclsh "$0" ${1+"$@"} # # uniClass.tcl -- # # Generates the character ranges and singletons that are used in # generic/regc_locale.c for translation of character classes. # This file must be generated using a tclsh that contains the # correct corresponding tclUniData.c file (generated by uniParse.tcl) # in order for the class ranges to match. # proc emitRange {first last} { global ranges numranges chars numchars extchars extranges if {$first < ($last-1)} { if {!$extranges && ($first) > 0xFFFF} { set extranges 1 set numranges 0 set ranges [string trimright $ranges " \n\r\t,"] append ranges "\n#if CHRBITS > 16\n ," } append ranges [format "{0x%X, 0x%X}, " \ $first $last] if {[incr numranges] % 4 == 0} { set ranges [string trimright $ranges] append ranges "\n " } } else { if {!$extchars && ($first) > 0xFFFF} { set extchars 1 set numchars 0 set chars [string trimright $chars " \n\r\t,"] append chars "\n#if CHRBITS > 16\n ," } append chars [format "0x%X, " $first] incr numchars if {$numchars % 9 == 0} { set chars [string trimright $chars] append chars "\n " } if {$first != $last} { append chars [format "0x%X, " $last] incr numchars if {$numchars % 9 == 0} { append chars "\n " } } } } proc genTable {type} { global first last ranges numranges chars numchars extchars extranges set first -2 set last -2 set ranges " " set numranges 0 set chars " " set numchars 0 set extchars 0 set extranges 0 for {set i 0} {$i <= 0xEFFFF} {incr i} { if {$i == 0xD800} { # Skip surrogates set i 0xE000 } if {$i == 0xE000} { # Skip private set i 0xF900 } if {[string is $type [format %c $i]]} { if {$i == ($last + 1)} { set last $i } else { if {$first >= 0} { emitRange $first $last } set first $i set last $i } } } emitRange $first $last set ranges [string trimright $ranges "\t\n ,"] if {$extranges} { append ranges "\n#endif" } set chars [string trimright $chars "\t\n ,"] if {$extchars} { append chars "\n#endif" } if {$ranges ne ""} { puts "static const crange ${type}RangeTable\[\] = {\n$ranges\n};\n" puts "#define NUM_[string toupper $type]_RANGE ((int)(sizeof(${type}RangeTable)/sizeof(crange)))\n" } else { puts "/* no contiguous ranges of $type characters */\n" } if {$chars ne ""} { puts "static const chr ${type}CharTable\[\] = {\n$chars\n};\n" puts "#define NUM_[string toupper $type]_CHAR ((int)(sizeof(${type}CharTable)/sizeof(chr)))\n" } else { puts "/*\n * no singletons of $type characters.\n */\n" } } puts "/* * Declarations of Unicode character ranges. This code * is automatically generated by the tools/uniClass.tcl script * and used in generic/regc_locale.c. Do not modify by hand. */ " foreach {type desc} { alpha "alphabetic characters" control "control characters" digit "decimal digit characters" punct "punctuation characters" space "white space characters" lower "lowercase characters" upper "uppercase characters" graph "unicode print characters excluding space" } { puts "/*\n * Unicode: $desc.\n */\n" genTable $type } puts "/* * End of auto-generated Unicode character ranges declarations. */" tcl9.0.3/tools/ucm2tests.tcl0000644000175000017500000002275415104661341015356 0ustar sergeisergei# ucm2tests.tcl # # Parses given ucm files (from ICU) to generate test data # for encodings. # # tclsh ucm2tests.tcl PATH_TO_ICU_UCM_DIRECTORY ?OUTPUTPATH? # namespace eval ucm { # No means to change these currently but ... variable outputPath variable outputChan variable errorChan stderr variable verbose 0 # Map Tcl encoding name to ICU UCM file name variable encNameMap array set encNameMap { cp1250 glibc-CP1250-2.1.2 cp1251 glibc-CP1251-2.1.2 cp1252 glibc-CP1252-2.1.2 cp1253 glibc-CP1253-2.1.2 cp1254 glibc-CP1254-2.1.2 cp1255 glibc-CP1255-2.1.2 cp1256 glibc-CP1256-2.1.2 cp1257 glibc-CP1257-2.1.2 cp1258 glibc-CP1258-2.1.2 gb1988 glibc-GB_1988_80-2.3.3 iso8859-1 glibc-ISO_8859_1-2.1.2 iso8859-2 glibc-ISO_8859_2-2.1.2 iso8859-3 glibc-ISO_8859_3-2.1.2 iso8859-4 glibc-ISO_8859_4-2.1.2 iso8859-5 glibc-ISO_8859_5-2.1.2 iso8859-6 glibc-ISO_8859_6-2.1.2 iso8859-7 glibc-ISO_8859_7-2.3.3 iso8859-8 glibc-ISO_8859_8-2.3.3 iso8859-9 glibc-ISO_8859_9-2.1.2 iso8859-10 glibc-ISO_8859_10-2.1.2 iso8859-11 glibc-ISO_8859_11-2.1.2 iso8859-13 glibc-ISO_8859_13-2.3.3 iso8859-14 glibc-ISO_8859_14-2.1.2 iso8859-15 glibc-ISO_8859_15-2.1.2 iso8859-16 glibc-ISO_8859_16-2.3.3 } # Array keyed by Tcl encoding name. Each element contains mapping of # Unicode code point -> byte sequence for that encoding as a flat list # (or dictionary). Both are stored as hex strings variable charMap # Array keyed by Tcl encoding name. List of invalid code sequences # each being a hex string. variable invalidCodeSequences # Array keyed by Tcl encoding name. List of unicode code points that are # not mapped, each being a hex string. variable unmappedCodePoints # The fallback character per encoding variable encSubchar } proc ucm::abort {msg} { variable errorChan puts $errorChan $msg exit 1 } proc ucm::warn {msg} { variable errorChan puts $errorChan $msg } proc ucm::log {msg} { variable verbose if {$verbose} { variable errorChan puts $errorChan $msg } } proc ucm::print {s} { variable outputChan puts $outputChan $s } proc ucm::parse_SBCS {encName fd} { variable charMap variable invalidCodeSequences variable unmappedCodePoints set result {} while {[gets $fd line] >= 0} { if {[string match #* $line]} { continue } if {[string equal "END CHARMAP" [string trim $line]]} { break } if {![regexp {^\s*\s*((\\x[[:xdigit:]]{2})+)\s*(\|(0|1|2|3|4))} $line -> unichar bytes - - precision]} { error "Unexpected line parsing SBCS: $line" } set bytes [string map {\\x {}} $bytes]; # \xNN -> NN if {$precision eq "" || $precision eq "0"} { lappend result $unichar $bytes } else { # It is a fallback mapping - ignore } } set charMap($encName) $result # Find out invalid code sequences and unicode code points that are not mapped set valid {} set mapped {} foreach {unich bytes} $result { lappend mapped $unich lappend valid $bytes } set invalidCodeSequences($encName) {} for {set i 0} {$i <= 255} {incr i} { set hex [format %.2X $i] if {[lsearch -exact $valid $hex] < 0} { lappend invalidCodeSequences($encName) $hex } } set unmappedCodePoints($encName) {} for {set i 0} {$i <= 65535} {incr i} { set hex [format %.4X $i] if {[lsearch -exact $mapped $hex] < 0} { lappend unmappedCodePoints($encName) $hex # Only look for (at most) one below 256 and one above 1024 if {$i < 255} { # Found one so jump past 8 bits set i 255 } else { break } } if {$i == 255} { set i 1023 } } lappend unmappedCodePoints($encName) D800 DC00 10000 10FFFF } proc ucm::generate_boilerplate {} { # Common procedures print { # This file is automatically generated by ucm2tests.tcl. # Edits will be overwritten on next generation. # # Generates tests comparing Tcl encodings to ICU. # The generated file is NOT standalone. It should be sourced into a test script. proc ucmConvertfromMismatches {enc map} { set mismatches {} foreach {unihex hex} $map { set unihex [string range 00000000$unihex end-7 end]; # Make 8 digits set unich [subst "\\U$unihex"] if {[encoding convertfrom -profile strict $enc [binary decode hex $hex]] ne $unich} { lappend mismatches "<[printable $unich],$hex>" } } return $mismatches } proc ucmConverttoMismatches {enc map} { set mismatches {} foreach {unihex hex} $map { set unihex [string range 00000000$unihex end-7 end]; # Make 8 digits set unich [subst "\\U$unihex"] if {[encoding convertto -profile strict $enc $unich] ne [binary decode hex $hex]} { lappend mismatches "<[printable $unich],$hex>" } } return $mismatches } if {[info commands printable] eq ""} { proc printable {s} { set print "" foreach c [split $s ""] { set i [scan $c %c] if {[string is print $c] && ($i <= 127)} { append print $c } elseif {$i <= 0xff} { append print \\x[format %02X $i] } elseif {$i <= 0xffff} { append print \\u[format %04X $i] } else { append print \\U[format %08X $i] } } return $print } } } } ; # generate_boilerplate proc ucm::generate_tests {} { variable encNameMap variable charMap variable invalidCodeSequences variable unmappedCodePoints variable outputPath variable outputChan variable encSubchar if {[info exists outputPath]} { set outputChan [open $outputPath w] fconfigure $outputChan -translation lf } else { set outputChan stdout } array set tclNames {} foreach encName [encoding names] { set tclNames($encName) "" } generate_boilerplate foreach encName [lsort -dictionary [array names encNameMap]] { if {![info exists charMap($encName)]} { warn "No character map read for $encName" continue } unset tclNames($encName) # Print the valid tests print "\n#\n# $encName (generated from $encNameMap($encName))" print "\ntest encoding-convertfrom-ucmCompare-$encName {Compare against ICU UCM} -body \{" print " ucmConvertfromMismatches $encName {$charMap($encName)}" print "\} -result {}" print "\ntest encoding-convertto-ucmCompare-$encName {Compare against ICU UCM} -body \{" print " ucmConverttoMismatches $encName {$charMap($encName)}" print "\} -result {}" if {0} { # This will generate individual tests for every char # and test in lead, tail, middle, solo configurations # but takes considerable time print "lappend encValidStrings \{*\}\{" foreach {unich hex} $charMap($encName) { print " $encName \\u$unich $hex {} {}" } print "\}; # $encName" } # Generate the invalidity checks print "\n# $encName - invalid byte sequences" print "lappend encInvalidBytes \{*\}\{" foreach hex $invalidCodeSequences($encName) { # Map XXXX... to \xXX\xXX... set uhex [regsub -all .. $hex {\\x\0}] set uhex \\U[string range 00000000$hex end-7 end] print " $encName $hex tcl8 $uhex -1 {} {}" print " $encName $hex replace \\uFFFD -1 {} {}" print " $encName $hex strict {} 0 {} {}" } print "\}; # $encName" print "\n# $encName - invalid byte sequences" print "lappend encUnencodableStrings \{*\}\{" if {[info exists encSubchar($encName)]} { set subchar $encSubchar($encName) } else { set subchar "3F"; # Tcl uses ? by default } foreach hex $unmappedCodePoints($encName) { set uhex \\U[string range 00000000$hex end-7 end] print " $encName $uhex tcl8 $subchar -1 {} {}" print " $encName $uhex replace $subchar -1 {} {}" print " $encName $uhex strict {} 0 {} {}" } print "\}; # $encName" } if {[array size tclNames]} { warn "Missing encoding: [lsort [array names tclNames]]" } if {[info exists outputPath]} { close $outputChan unset outputChan } } proc ucm::parse_file {encName ucmPath} { variable charMap variable encSubchar set fd [open $ucmPath] try { # Parse the metadata unset -nocomplain state while {[gets $fd line] >= 0} { if {[regexp {<(code_set_name|mb_cur_max|mb_cur_min|uconv_class|subchar)>\s+(\S+)} $line -> key val]} { set state($key) $val } elseif {[regexp {^\s*CHARMAP\s*$} $line]} { set state(charmap) "" break } else { # Skip all else } } if {![info exists state(charmap)]} { abort "Error: $ucmPath has No CHARMAP line." } foreach key {code_set_name uconv_class} { if {[info exists state($key)]} { set state($key) [string trim $state($key) {"}] } } if {[info exists charMap($encName)]} { abort "Duplicate file for $encName ($path)" } if {![info exists state(uconv_class)]} { abort "Error: $ucmPath has no uconv_class definition." } if {[info exists state(subchar)]} { # \xNN\xNN.. -> NNNN.. set encSubchar($encName) [string map {\\x {}} $state(subchar)] } switch -exact -- $state(uconv_class) { SBCS { if {[catch { parse_SBCS $encName $fd } result]} { abort "Could not process $ucmPath. $result" } } default { log "Skipping $ucmPath -- not SBCS encoding." return } } } finally { close $fd } } proc ucm::run {} { variable encNameMap variable outputPath switch [llength $::argv] { 2 {set outputPath [lindex $::argv 1]} 1 {} default { abort "Usage: [info nameofexecutable] $::argv0 path/to/icu/ucm/data ?outputfile?" } } foreach {encName fname} [array get encNameMap] { ucm::parse_file $encName [file join [lindex $::argv 0] ${fname}.ucm] } generate_tests } ucm::run tcl9.0.3/tools/tsdPerf.tcl0000644000175000017500000000077015076154271015035 0ustar sergeisergei package require Thread set ::tids [list] for {set i 0} {$i < 4} {incr i} { lappend ::tids [thread::create [string map [list IVALUE $i] { set curdir [file dirname [info script]] load [file join $curdir tsdPerf[info sharedlibextension]] while 1 { tsdPerfSet IVALUE } }]] } puts TIDS:$::tids set curdir [file dirname [info script]] load [file join $curdir tsdPerf[info sharedlibextension]] tsdPerfSet 1234 while 1 { puts "TIME:[time {set value [tsdPerfGet]} 1000] VALUE:$value" } tcl9.0.3/tools/tsdPerf.c0000644000175000017500000000223715104661341014466 0ustar sergeisergei#include extern DLLEXPORT Tcl_LibraryInitProc Tsdperf_Init; static Tcl_ThreadDataKey key; typedef struct { Tcl_WideInt value; } TsdPerf; static int tsdPerfSetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); Tcl_WideInt i; if (2 != objc) { Tcl_WrongNumArgs(interp, 1, objv, "value"); return TCL_ERROR; } if (TCL_OK != Tcl_GetWideIntFromObj(interp, objv[1], &i)) { return TCL_ERROR; } perf->value = i; return TCL_OK; } static int tsdPerfGetObjCmd(void *cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { TsdPerf *perf = Tcl_GetThreadData(&key, sizeof(TsdPerf)); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(perf->value)); return TCL_OK; } int Tsdperf_Init(Tcl_Interp *interp) { if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) { return TCL_ERROR; } Tcl_CreateObjCommand(interp, "tsdPerfSet", tsdPerfSetObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "tsdPerfGet", tsdPerfGetObjCmd, NULL, NULL); return TCL_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/tools/tclZIC.tcl0000755000175000017500000010647515104661341014563 0ustar sergeisergei#---------------------------------------------------------------------- # # tclZIC.tcl -- # # Take the time zone data source files from Arthur Olson's # repository at https://www.iana.org/time-zones, and prepare time zone # information files for Tcl. # # Usage: # tclsh tclZIC.tcl inputDir outputDir # # Parameters: # inputDir - Directory (e.g., tzdata2022a) where Olson's source # files are to be found. # outputDir - Directory (e.g., ../library/tzdata) where # the time zone information files are to be placed. # # Results: # May produce error messages on the standard error. An exit # code of zero denotes success; any other exit code is failure. # # This program parses the timezone data in a means analogous to the # 'zic' command, and produces Tcl time zone information files suitable # for loading into the 'clock' namespace. # #---------------------------------------------------------------------- # # Copyright © 2004 Kevin B. Kenny. All rights reserved. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- # Define the names of the Olson files that we need to load. # We avoid the solar time files and the leap seconds. set olsonFiles { africa antarctica asia australasia backward etcetera europe northamerica southamerica } # Define the year at which the DST information will stop. set maxyear 2100 # Determine how big a wide integer is. set MAXWIDE [expr {wide(1)}] while 1 { set next [expr {wide($MAXWIDE + $MAXWIDE + 1)}] if {$next < 0} { break } set MAXWIDE $next } set MINWIDE [expr {-$MAXWIDE-1}] #---------------------------------------------------------------------- # # loadFiles -- # # Loads the time zone files for each continent into memory # # Parameters: # dir - Directory where the time zone source files are found # # Results: # None. # # Side effects: # Calls 'loadZIC' for each continent's data file in turn. # Reports progress on stdout. # #---------------------------------------------------------------------- proc loadFiles {dir} { variable olsonFiles foreach file $olsonFiles { puts "loading: [file join $dir $file]" loadZIC [file join $dir $file] } return } #---------------------------------------------------------------------- # # checkForwardRuleRefs -- # # Checks to make sure that all references to Daylight Saving # Time rules designate defined rules. # # Parameters: # None. # # Results: # None. # # Side effects: # Produces an error message and increases the error count if # any undefined rules are present. # #---------------------------------------------------------------------- proc checkForwardRuleRefs {} { variable forwardRuleRefs variable rules foreach {rule where} [array get forwardRuleRefs] { if {![info exists rules($rule)]} { foreach {fileName lno} $where { puts stderr "$fileName:$lno:can't locate rule \"$rule\"" incr errorCount } } } } #---------------------------------------------------------------------- # # loadZIC -- # # Load one continent's data into memory. # # Parameters: # fileName -- Name of the time zone source file. # # Results: # None. # # Side effects: # The global variable, 'errorCount' counts the number of errors. # The global array, 'links', contains a distillation of the # 'Link' directives in the file. The keys are 'links to' and # the values are 'links from'. The 'parseRule' and 'parseZone' # procedures are called to handle 'Rule' and 'Zone' directives. # #---------------------------------------------------------------------- proc loadZIC {fileName} { variable errorCount variable links # Suck the text into memory. set f [open $fileName r] set data [read $f] close $f # Break the input into lines, and count line numbers. set lno 0 foreach line [split $data \n] { incr lno # Break a line of input into words. regsub {\s*(\#.*)?$} $line {} line if {$line eq ""} { continue } set words {} if {[regexp {^\s} $line]} { # Detect continuations of a zone and flag the list appropriately lappend words "" } lappend words {*}[regexp -all -inline {\S+} $line] # Switch on the directive switch -exact -- [lindex $words 0] { Rule { parseRule $fileName $lno $words } Link { set links([lindex $words 2]) [lindex $words 1] } Zone { set lastZone [lindex $words 1] set until [parseZone $fileName $lno \ $lastZone [lrange $words 2 end] "minimum"] } {} { set i 0 foreach word $words { if {[lindex $words $i] ne ""} { break } incr i } set words [lrange $words $i end] set until [parseZone $fileName $lno $lastZone $words $until] } default { incr errorCount puts stderr "$fileName:$lno:unknown line type \"[lindex $words 0]\"" } } } return } #---------------------------------------------------------------------- # # parseRule -- # # Parses a Rule directive in an Olson file. # # Parameters: # fileName -- Name of the file being parsed. # lno - Line number within the file # words - The line itself, broken into words. # # Results: # None. # # Side effects: # The rule is analyzed and added to the 'rules' array. # Errors are reported and counted. # #---------------------------------------------------------------------- proc parseRule {fileName lno words} { variable rules variable errorCount # Break out the columns lassign $words Rule name from to type in on at save letter # Handle the 'only' keyword if {$to eq "only"} { set to $from } # Process the start year if {![string is integer $from]} { if {![string equal -length [string length $from] $from "minimum"]} { puts stderr "$fileName:$lno:FROM field \"$from\" not an integer." incr errorCount return } else { set from "minimum" } } # Process the end year if {![string is integer $to]} { if {![string equal -length [string length $to] $to "maximum"]} { puts stderr "$fileName:$lno:TO field \"$to\" not an integer." incr errorCount return } else { set to "maximum" } } # Process the type of year in which the rule applies if {$type ne "-"} { puts stderr "$fileName:$lno:year types are not yet supported." incr errorCount return } # Process the month in which the rule starts if {[catch {lookupMonth $in} in]} { puts stderr "$fileName:$lno:$in" incr errorCount return } # Process the day of the month on which the rule starts if {[catch {parseON $on} on]} { puts stderr "$fileName:$lno:$on" incr errorCount return } # Process the time of day on which the rule starts if {[catch {parseTOD $at} at]} { puts stderr "$fileName:$lno:$at" incr errorCount return } # Process the DST adder if {[catch {parseOffsetTime $save} save]} { puts stderr "$fileName:$lno:$save" incr errorCount return } # Process the letter to use for summer time if {$letter eq "-"} { set letter "" } # Accumulate all the data. lappend rules($name) $from $to $type $in $on $at $save $letter return } #---------------------------------------------------------------------- # # parseON -- # # Parse a specification for a day of the month # # Parameters: # on - the ON field from a line in an Olson file. # # Results: # Returns a partial Tcl command. When the year and number of the # month are appended, the command will return the Julian Day Number # of the desired date. # # Side effects: # None. # # The specification can be: # - a simple number, which designates a constant date. # - The name of a weekday, followed by >= or <=, followed by a number. # This designates the nearest occurrence of the given weekday on # or before (on or after) the given day of the month. # - The word 'last' followed by a weekday name with no intervening # space. This designates the last occurrence of the given weekday # in the month. # #---------------------------------------------------------------------- proc parseON {on} { if {![regexp -expanded { ^(?: # first possibility - simple number - field 1 ([[:digit:]]+) | # second possibility - weekday >= (or <=) number # field 2 - weekday ([[:alpha:]]+) # field 3 - direction ([<>]=) # field 4 - number ([[:digit:]]+) | # third possibility - lastWeekday - field 5 last([[:alpha:]]+) )$ } $on -> dom1 wday2 dir2 num2 wday3]} { error "can't parse ON field \"$on\"" } if {$dom1 ne ""} { return [list onDayOfMonth $dom1] } elseif {$wday2 ne ""} { set wday2 [lookupDayOfWeek $wday2] return [list onWeekdayInMonth $wday2 $dir2 $num2] } elseif {$wday3 ne ""} { set wday3 [lookupDayOfWeek $wday3] return [list onLastWeekdayInMonth $wday3] } else { error "in parseOn \"$on\": can't happen" } } #---------------------------------------------------------------------- # # onDayOfMonth -- # # Find a given day of a given month # # Parameters: # day - Day of the month # year - Gregorian year # month - Number of the month (1-12) # # Results: # Returns the Julian Day Number of the desired day. # # Side effects: # None. # #---------------------------------------------------------------------- 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] return [dict get $date julianDay] } #---------------------------------------------------------------------- # # onWeekdayInMonth -- # # Find the weekday falling on or after (on or before) a # given day of the month # # Parameters: # dayOfWeek - Day of the week (Monday=1, Sunday=7) # relation - <= for the weekday on or before a given date, >= for # the weekday on or after the given date. # dayOfMonth - Day of the month # year - Gregorian year # month - Number of the month (1-12) # # Results: # Returns the Juloan Day Number of the desired day. # # Side effects: # None. # # onWeekdayInMonth is used to compute Daylight Saving Time rules # like 'Sun>=1' (for the nearest Sunday on or after the first of the month) # or "Mon<=4' (for the Monday on or before the fourth of the month). # #---------------------------------------------------------------------- proc onWeekdayInMonth {dayOfWeek relation dayOfMonth year month} { set date [::tcl::clock::GetJulianDayFromEraYearMonthDay [dict create \ era CE year $year month $month dayOfMonth $dayOfMonth] 2361222] switch -exact -- $relation { <= { return [::tcl::clock::WeekdayOnOrBefore $dayOfWeek \ [dict get $date julianDay]] } >= { return [::tcl::clock::WeekdayOnOrBefore $dayOfWeek \ [expr {[dict get $date julianDay] + 6}]] } } } #---------------------------------------------------------------------- # # onLastWeekdayInMonth -- # # Find the last instance of a given weekday in a month. # # Parameters: # dayOfWeek - Weekday to find (Monday=1, Sunday=7) # year - Gregorian year # month - Month (1-12) # # Results: # Returns the Julian Day number of the last instance of # the given weekday in the given month # # Side effects: # None. # #---------------------------------------------------------------------- proc onLastWeekdayInMonth {dayOfWeek year month} { incr month # Find day 0 of the following month, which is the last day of # the current month. Yes, it works to ask for day 0 of month 13! set date [::tcl::clock::GetJulianDayFromEraYearMonthDay [dict create \ era CE year $year month $month dayOfMonth 0] 2361222] return [::tcl::clock::WeekdayOnOrBefore $dayOfWeek \ [dict get $date julianDay]] } #---------------------------------------------------------------------- # # parseTOD -- # # Parses the specification of a time of day in an Olson file. # # Parameters: # tod - Time of day, which may be followed by 'w', 's', 'u', 'g' # or 'z'. 'w' (or no letter) designates a wall clock time, # 's' designates Standard Time in the given zone, and # 'u', 'g', and 'z' all designate UTC. # # Results: # Returns a two element list containing a count of seconds from # midnight and the letter that followed the time. # # Side effects: # Reports and counts an error if the time cannot be parsed. # #---------------------------------------------------------------------- proc parseTOD {tod} { if {![regexp -expanded { ^ ([[:digit:]]{1,2}) # field 1 - hour (?: :([[:digit:]]{2}) # field 2 - minute (?: :([[:digit:]]{2}) # field 3 - second )? )? (?: ([wsugz]) # field 4 - type indicator )? } $tod -> hour minute second ind]} { puts stderr "$fileName:$lno:can't parse time field \"$tod\"" incr errorCount } scan $hour %d hour if {$minute ne ""} { scan $minute %d minute } else { set minute 0 } if {$second ne ""} { scan $second %d second } else { set second 0 } if {$ind eq ""} { set ind w } return [list [expr {($hour * 60 + $minute) * 60 + $second}] $ind] } #---------------------------------------------------------------------- # # parseOffsetTime -- # # Parses the specification of an offset time in an Olson file. # # Parameters: # offset - Offset time as [+-]hh:mm:ss # # Results: # Returns the offset time as a count of seconds. # # Side effects: # Reports and counts an error if the time cannot be parsed. # #---------------------------------------------------------------------- proc parseOffsetTime {offset} { if {![regexp -expanded { ^ ([-+])? # field 1 - signum ([[:digit:]]{1,2}) # field 2 - hour (?: :([[:digit:]]{2}) # field 3 - minute (?: :([[:digit:]]{2}) # field 4 - second )? )? } $offset -> signum hour minute second]} { puts stderr "$fileName:$lno:can't parse offset time \"$offset\"" incr errorCount } append signum 1 scan $hour %d hour if {$minute ne ""} { scan $minute %d minute } else { set minute 0 } if {$second ne ""} { scan $second %d second } else { set second 0 } return [expr {(($hour * 60 + $minute) * 60 + $second) * $signum}] } #---------------------------------------------------------------------- # # lookupMonth - # Looks up a month by name # # Parameters: # month - Name of a month. # # Results: # Returns the number of the month. # # Side effects: # None. # #---------------------------------------------------------------------- proc lookupMonth {month} { set indx [lsearch -regexp { {} January February March April May June July August September October November December } ${month}.*] if {$indx < 1} { error "unknown month name \"$month\"" } return $indx } #---------------------------------------------------------------------- # # lookupDayOfWeek -- # # Looks up the name of a weekday. # # Parameters: # wday - Weekday name (or a unique prefix). # # Results: # Returns the weekday number (Monday=1, Sunday=7) # # Side effects: # None. # #---------------------------------------------------------------------- proc lookupDayOfWeek {wday} { set indx [lsearch -regexp { {} Monday Tuesday Wednesday Thursday Friday Saturday Sunday } ${wday}.*] if {$indx < 1} { error "unknown weekday name \"$wday\"" } return $indx } #---------------------------------------------------------------------- # # parseZone -- # # Parses a Zone directive in an Olson file # # Parameters: # fileName -- Name of the file being parsed. # lno -- Line number within the file. # zone -- Name of the time zone # words -- Remaining words on the line. # start -- 'Until' time from the previous line if this is a # continuation line, or 'minimum' if this is the first line. # # Results: # Returns the 'until' field of the current line # # Side effects: # Stores a row in the 'zones' array describing the current zone. # The row consists of a start time (year month day tod), a Standard # Time offset from Greenwich, a Daylight Saving Time offset from # Standard Time, and a format for printing the time zone. # # The start time is the result of an earlier call to 'parseUntil' # or else the keyword 'minimum'. The GMT offset is the # result of a call to 'parseOffsetTime'. The Daylight Saving # Time offset is represented as a partial Tcl command. To the # command will be appended a start time (seconds from epoch) # the current offset of Standard Time from Greenwich, the current # offset of Daylight Saving Time from Greenwich, the default # offset from this line, the name pattern from this line, # the 'until' field from this line, and a variable name where points # are to be stored. This command is implemented by the 'applyNoRule', # 'applyDSTOffset' and 'applyRules' procedures. # #---------------------------------------------------------------------- proc parseZone {fileName lno zone words start} { variable zones variable rules variable errorCount variable forwardRuleRefs lassign $words gmtoff save format if {[catch {parseOffsetTime $gmtoff} gmtoff]} { puts stderr "$fileName:$lno:$gmtoff" incr errorCount return } if {[info exists rules($save)]} { set save [list applyRules $save] } elseif {$save eq "-"} { set save [list applyNoRule] } elseif {[catch {parseOffsetTime $save} save2]} { lappend forwardRuleRefs($save) $fileName $lno set save [list applyRules $save] } else { set save [list applyDSTOffset $save2] } lappend zones($zone) $start $gmtoff $save $format if {[llength $words] >= 4} { return [parseUntil [lrange $words 3 end]] } else { return {} } } #---------------------------------------------------------------------- # # parseUntil -- # # Parses the 'UNTIL' part of a 'Zone' directive. # # Parameters: # words - The 'UNTIL' part of the directie. # # Results: # Returns a list comprising the year, the month, the day, and # the time of day. Time of day is represented as the result of # 'parseTOD'. # #---------------------------------------------------------------------- proc parseUntil {words} { variable firstYear if {[llength $words] >= 1} { set year [lindex $words 0] if {![string is integer $year]} { error "can't parse UNTIL field \"$words\"" } if {![info exists firstYear] || $year < $firstYear} { set firstYear $year } } else { set year "maximum" } if {[llength $words] >= 2} { set month [lookupMonth [lindex $words 1]] } else { set month 1 } if {[llength $words] >= 3} { set day [parseON [lindex $words 2]] } else { set day {onDayOfMonth 1} } if {[llength $words] >= 4} { set tod [parseTOD [lindex $words 3]] } else { set tod {0 w} } return [list $year $month $day $tod] } #---------------------------------------------------------------------- # # applyNoRule -- # # Generates time zone data for a zone without Daylight Saving # Time. # # Parameters: # year - Year in which the rule applies # startSecs - Time at which the rule starts. # stdGMTOffset - Offset from Greenwich prior to the start of the # rule # DSTOffset - Offset of Daylight from Standard prior to the # start of the rule. # nextGMTOffset - Offset from Greenwich when the rule is in effect. # namePattern - Name of the timezone. # until - Time at which the rule expires. # pointsVar - Name of a variable in callers scope that receives # transition times # # Results: # Returns a two element list comprising 'nextGMTOffset' and # 0 - the zero indicates that Daylight Saving Time is not # in effect. # # Side effects: # Appends a row to the 'points' variable comprising the start time, # the offset from GMT, a zero (indicating that DST is not in effect), # and the name of the time zone. # #---------------------------------------------------------------------- proc applyNoRule {year startSecs stdGMTOffset DSTOffset nextGMTOffset namePattern until pointsVar} { upvar 1 $pointsVar points lappend points $startSecs $nextGMTOffset 0 \ [convertNamePattern $namePattern -] return [list $nextGMTOffset 0] } #---------------------------------------------------------------------- # # applyDSTOffset -- # # Generates time zone data for a zone with permanent Daylight # Saving Time. # # Parameters: # nextDSTOffset - Offset of Daylight from Standard while the # rule is in effect. # year - Year in which the rule applies # startSecs - Time at which the rule starts. # stdGMTOffset - Offset from Greenwich prior to the start of the # rule # DSTOffset - Offset of Daylight from Standard prior to the # start of the rule. # nextGMTOffset - Offset from Greenwich when the rule is in effect. # namePattern - Name of the timezone. # until - Time at which the rule expires. # pointsVar - Name of a variable in callers scope that receives # transition times # # Results: # Returns a two element list comprising 'nextGMTOffset' and # 'nextDSTOffset'. # # Side effects: # Appends a row to the 'points' variable comprising the start time, # the offset from GMT, a one (indicating that DST is in effect), # and the name of the time zone. # #---------------------------------------------------------------------- proc applyDSTOffset {nextDSTOffset year startSecs stdGMTOffset DSTOffset nextGMTOffset namePattern until pointsVar} { upvar 1 $pointsVar points lappend points \ $startSecs \ [expr {$nextGMTOffset + $nextDSTOffset}] \ 1 \ [convertNamePattern $namePattern S] return [list $nextGMTOffset $nextDSTOffset] } #---------------------------------------------------------------------- # # applyRules -- # # Applies a rule set to a time zone for a given range of time # # Parameters: # ruleSet - Name of the rule set to apply # year - Starting year for the rules # startSecs - Time at which the rules begin to apply # stdGMTOffset - Offset from Greenwich prior to the start of the # rules. # DSTOffset - Offset of Daylight from Standard prior to the # start of the rules. # nextGMTOffset - Offset from Greenwich when the rules are in effect. # namePattern - Name pattern for the time zone. # until - Time at which the rule set expires. # pointsVar - Name of a variable in callers scope that receives # transition times # # Results: # Returns a two element list comprising the offset from GMT # to Standard and the offset from Standard to Daylight (if DST # is in effect) at the end of the period in which the rules apply # # Side effects: # Appends one or more rows to the 'points' variable, each of which # comprises a transition time, the offset from GMT that is # in effect after the transition, a flag for whether DST is in # effect, and the name of the time zone. # #---------------------------------------------------------------------- proc applyRules {ruleSet year startSecs stdGMTOffset DSTOffset nextGMTOffset namePattern until pointsVar} { variable done variable rules variable maxyear upvar 1 $pointsVar points # Extract the rules that apply to the current year, and the number # of rules (now or in future) that will end at a specific year. # Ignore rules entirely in the past. lassign [divideRules $ruleSet $year] currentRules nSunsetRules # If the first transition is later than $startSecs, and $stdGMTOffset is # different from $nextGMTOffset, we will need an initial record like: # lappend points $startSecs $stdGMTOffset 0 \ # [convertNamePattern $namePattern -] set didTransitionIn false # Determine the letter to use in Standard Time set prevLetter "" foreach { fromYear toYear yearType monthIn daySpecOn timeAt save letter } $rules($ruleSet) { if {$save == 0} { set prevLetter $letter break } } # Walk through each year in turn. This loop will break when # (a) the 'until' time is passed # or (b) the 'until' time is empty and all remaining rules extend to # the end of time set stdGMTOffset $nextGMTOffset # convert "until" to seconds from epoch in current time zone if {$until ne ""} { lassign $until untilYear untilMonth untilDaySpec untilTimeOfDay lappend untilDaySpec $untilYear $untilMonth set untilJCD [eval $untilDaySpec] set untilBaseSecs [expr { wide(86400) * wide($untilJCD) - 210866803200 }] set untilSecs [convertTimeOfDay $untilBaseSecs $stdGMTOffset \ $DSTOffset {*}$untilTimeOfDay] } set origStartSecs $startSecs while {($until ne "" && $startSecs < $untilSecs) || ($until eq "" && ($nSunsetRules > 0 || $year < $maxyear))} { set remainingRules $currentRules while {[llength $remainingRules] > 0} { # Find the rule with the earliest start time from among the # active rules that haven't yet been processed. lassign [findEarliestRule $remainingRules $year \ $stdGMTOffset $DSTOffset] earliestSecs earliestIndex set endi [expr {$earliestIndex + 7}] set rule [lrange $remainingRules $earliestIndex $endi] lassign $rule fromYear toYear \ yearType monthIn daySpecOn timeAt save letter # Test if the rule is in effect. if { $earliestSecs > $startSecs && ($until eq "" || $earliestSecs < $untilSecs) } { # Test if the initial transition has been done. # If not, do it now. if {!$didTransitionIn && $earliestSecs > $origStartSecs} { set nm [convertNamePattern $namePattern $prevLetter] lappend points \ $origStartSecs \ [expr {$stdGMTOffset + $DSTOffset}] \ 0 \ $nm set didTransitionIn true } # Add a row to 'points' for the rule set nm [convertNamePattern $namePattern $letter] lappend points \ $earliestSecs \ [expr {$stdGMTOffset + $save}] \ [expr {$save != 0}] \ $nm } # Remove the rule just applied from the queue set remainingRules [lreplace \ $remainingRules[set remainingRules {}] \ $earliestIndex $endi] # Update current DST offset and time zone letter set DSTOffset $save set prevLetter $letter # Reconvert the 'until' time in the current zone. if {$until ne ""} { set untilSecs [convertTimeOfDay $untilBaseSecs \ $stdGMTOffset $DSTOffset {*}$untilTimeOfDay] } } # Advance to the next year incr year set date [::tcl::clock::GetJulianDayFromEraYearMonthDay \ [dict create era CE year $year month 1 dayOfMonth 1] 2361222] set startSecs [expr { [dict get $date julianDay] * wide(86400) - 210866803200 - $stdGMTOffset - $DSTOffset }] # Get rules in effect in the new year. lassign [divideRules $ruleSet $year] currentRules nSunsetRules } return [list $stdGMTOffset $DSTOffset] } #---------------------------------------------------------------------- # # divideRules -- # Determine what Daylight Saving Time rules may be in effect in # a given year. # # Parameters: # ruleSet - Set of rules from 'parseRule' # year - Year to test # # Results: # Returns a two element list comprising the subset of 'ruleSet' # that is in effect in the given year, and the count of rules # that expire in the future (as opposed to those that expire in # the past or not at all). If this count is zero, the rules do # not change in future years. # # Side effects: # None. # #---------------------------------------------------------------------- proc divideRules {ruleSet year} { variable rules set currentRules {} set nSunsetRules 0 foreach { fromYear toYear yearType monthIn daySpecOn timeAt save letter } $rules($ruleSet) { if {$toYear ne "maximum" && $year > $toYear} { # ignore - rule is in the past } else { if {$fromYear eq "minimum" || $fromYear <= $year} { lappend currentRules $fromYear $toYear $yearType $monthIn \ $daySpecOn $timeAt $save $letter } if {$toYear ne "maximum"} { incr nSunsetRules } } } return [list $currentRules $nSunsetRules] } #---------------------------------------------------------------------- # # findEarliestRule -- # # Find the rule in a rule set that has the earliest start time. # # Parameters: # remainingRules -- Rules to search # year - Year being processed. # stdGMTOffset - Current offset of standard time from GMT # DSTOffset - Current offset of daylight time from standard, # if daylight time is in effect. # # Results: # Returns the index in remainingRules of the next rule to # go into effect. # # Side effects: # None. # #---------------------------------------------------------------------- proc findEarliestRule {remainingRules year stdGMTOffset DSTOffset} { set earliest $::MAXWIDE set i 0 foreach { fromYear toYear yearType monthIn daySpecOn timeAt save letter } $remainingRules { lappend daySpecOn $year $monthIn set dayIn [eval $daySpecOn] set secs [expr {wide(86400) * wide($dayIn) - 210866803200}] set secs [convertTimeOfDay $secs \ $stdGMTOffset $DSTOffset {*}$timeAt] if {$secs < $earliest} { set earliest $secs set earliestIdx $i } incr i 8 } return [list $earliest $earliestIdx] } #---------------------------------------------------------------------- # # convertNamePattern -- # # Converts a name pattern to the name of the time zone. # # Parameters: # pattern - Patthern to convert # flag - Daylight Time flag. An empty string denotes Standard # Time, anything else is Daylight Time. # # Results; # Returns the name of the time zone. # # Side effects: # None. # #---------------------------------------------------------------------- proc convertNamePattern {pattern flag} { if {[regexp {(.*)/(.*)} $pattern -> standard daylight]} { if {$flag ne ""} { set pattern $daylight } else { set pattern $standard } } return [string map [list %s $flag] $pattern] } #---------------------------------------------------------------------- # # convertTimeOfDay -- # # Takes a time of day specifier from 'parseAt' and converts # to seconds from the Epoch, # # Parameters: # seconds -- Time at which the GMT day starts, in seconds # from the Posix epoch # stdGMTOffset - Offset of Standard Time from Greenwich # DSTOffset - Offset of Daylight Time from standard. # timeOfDay - Time of day to convert, in seconds from midnight # flag - Flag indicating whether the time is Greenwich, Standard # or wall-clock. (g, s, or w) # # Results: # Returns the time of day in seconds from the Posix epoch. # # Side effects: # None. # #---------------------------------------------------------------------- proc convertTimeOfDay {seconds stdGMTOffset DSTOffset timeOfDay flag} { incr seconds $timeOfDay switch -exact $flag { g - u - z { } w { incr seconds [expr {-$stdGMTOffset}] incr seconds [expr {-$DSTOffset}] } s { incr seconds [expr {-$stdGMTOffset}] } } return $seconds } #---------------------------------------------------------------------- # # processTimeZone -- # # Generate the information about all time transitions in a # time zone. # # Parameters: # zoneName - Name of the time zone # zoneData - List containing the rows describing the time zone, # obtained from 'parseZone. # # Results: # Returns a list of rows. Each row consists of a time in # seconds from the Posix epoch, an offset from GMT to local # that begins at that time, a flag indicating whether DST # is in effect after that time, and the printable name of the # timezone that goes into effect at that time. # # Side effects: # None. # #---------------------------------------------------------------------- proc processTimeZone {zoneName zoneData} { set points {} set i 0 foreach {startTime nextGMTOffset dstRule namePattern} $zoneData { incr i 4 set until [lindex $zoneData $i] if {![info exists stdGMTOffset]} { set stdGMTOffset $nextGMTOffset } if {![info exists DSTOffset]} { set DSTOffset 0 } if {$startTime eq "minimum"} { set secs $::MINWIDE set year 0 } else { lassign $startTime year month dayRule timeOfDay lappend dayRule $year $month set startDay [eval $dayRule] set secs [expr {wide(86400) * wide($startDay) -210866803200}] set secs [convertTimeOfDay $secs \ $stdGMTOffset $DSTOffset {*}$timeOfDay] } lappend dstRule \ $year $secs $stdGMTOffset $DSTOffset $nextGMTOffset \ $namePattern $until points lassign [eval $dstRule] stdGMTOffset DSTOffset } return $points } #---------------------------------------------------------------------- # # writeZones -- # # Writes all the time zone information files. # # Parameters: # outDir - Directory in which to store the files. # # Results: # None. # # Side effects: # Writes the time zone information files; traces what's happening # on the standard output. # #---------------------------------------------------------------------- proc writeZones {outDir} { variable zones # Walk the zones foreach zoneName [lsort -dictionary [array names zones]] { puts "calculating: $zoneName" set fileName [eval [list file join $outDir] [file split $zoneName]] # Create directories as needed set dirName [file dirname $fileName] if {![file exists $dirName]} { puts "creating directory: $dirName" file mkdir $dirName } # Generate data for a zone set data "" set tzmapped {} foreach { time offset dst name } [processTimeZone $zoneName $zones($zoneName)] { if {$name eq "%z"} { # map %z to pure offset zone (e. g. offset -7200 -> -0200): set name [format "%+03d%02d" [expr { $offset / 60 / 60 }] [expr { (abs($offset) / 60) % 60 }] ] if {![dict exists $tzmapped $offset]} { # output once per offs puts "\tmap %z ($offset) -> $name" dict set tzmapped $offset $name } } append data "\n " [list [list $time $offset $dst $name]] } append data \n # Write the data to the information file set f [open $fileName w] fconfigure $f -translation lf -encoding utf-8 puts $f "\# created by $::argv0 - do not edit" puts $f "" puts $f [list set TZData(:$zoneName) $data] close $f } return } #---------------------------------------------------------------------- # # writeLinks -- # # Write files describing time zone synonyms (the Link directives # from the Olson files) # # Parameters: # outDir - Name of the directory where the output files go. # # Results: # None. # # Side effects: # Creates a file for each link. proc writeLinks {outDir} { variable links # Walk the links foreach zoneName [lsort -dictionary [array names links]] { puts "creating link: $zoneName" set fileName [eval [list file join $outDir] [file split $zoneName]] # Create directories as needed set dirName [file dirname $fileName] if {![file exists $dirName]} { puts "creating directory: $dirName" file mkdir $dirName } # Create code for the synonym set linkTo $links($zoneName) set sourceCmd "\n [list LoadTimeZoneFile $linkTo]\n" set ifCmd [list if "!\[info exists TZData($linkTo)\]" $sourceCmd] set setCmd "set TZData(:$zoneName) \$TZData(:$linkTo)" # Write the file set f [open $fileName w] fconfigure $f -translation lf -encoding utf-8 puts $f "\# created by $::argv0 - do not edit" puts $f $ifCmd puts $f $setCmd close $f } return } #---------------------------------------------------------------------- # # MAIN PROGRAM # #---------------------------------------------------------------------- puts "Compiling time zones -- [clock format [clock seconds] \ -format {%x %X} -locale system]" # Determine directories lassign $argv inDir outDir puts "Olson files in $inDir" puts "Tcl files to be placed in $outDir" # Initialize count of errors set errorCount 0 # Parse the Olson files loadFiles $inDir if {$errorCount > 0} { exit 1 } # Check that all riles appearing in Zone and Link lines actually exist checkForwardRuleRefs if {$errorCount > 0} { exit 1 } # Write the time zone information files writeZones $outDir writeLinks $outDir if {$errorCount > 0} { exit 1 } # All done! exit tcl9.0.3/tools/tcltk-man2html.tcl0000755000175000017500000005616015104661341016267 0ustar sergeisergei#!/usr/bin/env tclsh if {[catch {package require Tcl 8.6-} msg]} { puts stderr "ERROR: $msg" puts stderr "If running this script from 'make html', set the\ NATIVE_TCLSH environment\nvariable to point to an installed\ tclsh9.0 (or the equivalent tclsh90.exe\non Windows)." exit 1 } # Convert Ousterhout format man pages into highly crosslinked hypertext. # # Along the way detect many unmatched font changes and other odd things. # # Note well, this program is a hack rather than a piece of software # engineering. In that sense it's probably a good example of things # that a scripting language, like Tcl, can do well. It is offered as # an example of how someone might convert a specific set of man pages # into hypertext, not as a general solution to the problem. If you # try to use this, you'll be very much on your own. # # Copyright © 1995-1997 Roger E. Critchlow Jr # Copyright © 2004-2010 Donal K. Fellows set ::Version "50/9.0" set ::CSSFILE "docs.css" ## ## Source the utility functions that provide most of the ## implementation of the transformation from nroff to html. ## source -encoding utf-8 [file join [file dirname [info script]] tcltk-man2html-utils.tcl] proc getversion {tclh {name {}}} { if {[file exists $tclh]} { set chan [open $tclh] set data [read $chan] close $chan if {$name eq ""} { set name [string toupper [file root [file tail $tclh]]] } # backslash isn't required in front of quote, but it keeps syntax # highlighting straight in some editors if {[regexp -lineanchor \ [string map [list @name@ $name] \ {^#\s*define\s+@name@_VERSION\s+\"([^.])+\.([^.\"]+)}] \ $data -> major minor]} { return [list $major $minor] } } } proc findversion {top name useversion} { # Default search version is a glob pattern, switch it for string match: if {$useversion eq {{,[8-9].[0-9]{,[.ab][0-9]{,[0-9]}}}}} { set useversion {[8-9].[0-9]} } # Search: set upper [string toupper $name] foreach top1 [list $top $top/..] sub {{} generic} { foreach dirname [ glob -nocomplain -tails -type d -directory $top1 *] { set tclh [join [list $top1 $dirname {*}$sub ${name}.h] /] set v [getversion $tclh $upper] if {[llength $v]} { lassign $v major minor # to do # use glob matching instead of string matching or add # brace handling to [string matcch] if {$useversion eq "" || [string match $useversion $major.$minor]} { set top [file dirname [file dirname $tclh]] set prefix [file dirname $top] return [list $prefix [file tail $top] $major $minor] } } } } } proc parse_command_line {} { global argv Version # These variables determine where the man pages come from and where # the converted pages go to. global tcltkdir tkdir tcldir webdir build_tcl build_tk verbose # Set defaults based on original code. set tcltkdir ../.. set tkdir {} set tcldir {} set webdir ../html set build_tcl 0 set opt_build_tcl 0 set build_tk 0 set opt_build_tk 0 set verbose 0 # Default search version is a glob pattern set useversion {{,[8-9].[0-9]{,[.ab][0-9]{,[0-9]}}}} # Handle arguments a la GNU: # --version # --useversion= # --help # --srcdir=/path # --htmldir=/path foreach option $argv { switch -glob -- $option { --version { puts "tcltk-man-html $Version" exit 0 } --help { puts "usage: tcltk-man-html \[OPTION\] ...\n" puts " --help print this help, then exit" puts " --version print version number, then exit" puts " --srcdir=DIR find tcl and tk source below DIR" puts " --htmldir=DIR put generated HTML in DIR" puts " --tcl build tcl help" puts " --tk build tk help" puts " --useversion version of tcl/tk to search for" puts " --verbose whether to print longer messages" exit 0 } --srcdir=* { # length of "--srcdir=" is 9. set tcltkdir [string range $option 9 end] } --htmldir=* { # length of "--htmldir=" is 10 set webdir [string range $option 10 end] } --useversion=* { # length of "--useversion=" is 13 set useversion [string range $option 13 end] } --tcl { set build_tcl 1 set opt_build_tcl 1 } --tk { set build_tk 1 set opt_build_tk 1 } --verbose=* { set verbose [string range $option \ [string length --verbose=] end] } default { puts stderr "tcltk-man-html: unrecognized option -- `$option'" exit 1 } } } if {!$build_tcl && !$build_tk} { set build_tcl 1; set build_tk 1 } set major "" set minor "" if {$build_tcl} { # Find Tcl (firstly using glob pattern / backwards compatible way) set tcldir [lindex [lsort [glob -nocomplain -tails -type d \ -directory $tcltkdir tcl$useversion]] end] if {$tcldir ne ""} { # obtain version from generic header if we can: lassign [getversion [file join $tcltkdir $tcldir generic tcl.h]] major minor } else { lassign [findversion $tcltkdir tcl $useversion] tcltkdir tcldir major minor } if {$tcldir eq "" && $opt_build_tcl} { puts stderr "tcltk-man-html: couldn't find Tcl below $tcltkdir" exit 1 } puts "using Tcl source directory [file join $tcltkdir $tcldir]" } if {$build_tk} { # Find Tk (firstly using glob pattern / backwards compatible way) set tkdir [lindex [lsort [glob -nocomplain -tails -type d \ -directory $tcltkdir tk$useversion]] end] if {$tkdir ne ""} { if {$major eq ""} { # obtain version from generic header if we can: lassign [getversion [file join $tcltkdir $tkdir generic tk.h]] major minor } } else { lassign [findversion $tcltkdir tk $useversion] tcltkdir tkdir major minor } if {$tkdir eq "" && $opt_build_tk} { puts stderr "tcltk-man-html: couldn't find Tk below $tcltkdir" exit 1 } puts "using Tk source directory [file join $tcltkdir $tkdir]" } puts "verbose messages are [expr {$verbose ? {on} : {off}}]" # the title for the man pages overall global overall_title set overall_title "" if {$build_tcl} { if {$major ne ""} { append overall_title "Tcl $major.$minor" } else { append overall_title "Tcl [capitalize $tcldir]" } } if {$build_tcl && $build_tk} { append overall_title "/" } if {$build_tk} { append overall_title "[capitalize $tkdir]" } append overall_title " Documentation" } proc capitalize {string} { return [string toupper $string 0] } ## ## Returns the style sheet. ## proc css-style args { upvar 1 style style set body [uplevel 1 [list subst [lindex $args end]]] set tokens [join [lrange $args 0 end-1] ", "] append style $tokens " \{" $body "\}\n" } proc css-stylesheet {} { set hBd "1px dotted #11577B" css-style body div p th td li dd ul ol dl dt blockquote { font-family: Verdana, sans-serif; } css-style pre code { font-family: 'Courier New', Courier, monospace; } css-style pre { background-color: #F6FCEC; border-top: 1px solid #6A6A6A; border-bottom: 1px solid #6A6A6A; padding: 1em; overflow: auto; } css-style body { background-color: #FFFFFF; font-size: 12px; line-height: 1.25; letter-spacing: .2px; padding-left: .5em; } css-style h1 h2 h3 h4 { font-family: Georgia, serif; padding-left: 1em; margin-top: 1em; } css-style h1 { font-size: 18px; color: #11577B; border-bottom: $hBd; margin-top: 0px; } css-style h2 { font-size: 14px; color: #11577B; background-color: #C5DCE8; padding-left: 1em; border: 1px solid #6A6A6A; } css-style h3 h4 { color: #1674A4; background-color: #E8F2F6; border-bottom: $hBd; border-top: $hBd; } css-style h3 { font-size: 12px; } css-style h4 { font-size: 11px; } css-style ".keylist dt" ".arguments dt" { width: 25em; float: left; padding: 2px; border-top: 1px solid #999999; } css-style ".keylist dt" { font-weight: bold; } css-style ".keylist dd" ".arguments dd" { margin-left: 25em; padding: 2px; border-top: 1px solid #999999; } css-style .copy { background-color: #F6FCFC; white-space: pre; font-size: 80%; border-top: 1px solid #6A6A6A; margin-top: 2em; } css-style .tablecell { font-size: 12px; padding-left: .5em; padding-right: .5em; } } ## ## foreach of the man directories specified by args ## convert manpages into hypertext in the directory ## specified by html. ## proc make-man-pages {html args} { global manual overall_title tcltkdesc verbose global excluded_pages forced_index_pages process_first_patterns makedirhier $html set cssfd [open $html/$::CSSFILE w] fconfigure $cssfd -translation lf -encoding utf-8 puts $cssfd [css-stylesheet] close $cssfd set manual(short-toc-n) 1 set manual(short-toc-fp) [open $html/[indexfile] w] fconfigure $manual(short-toc-fp) -translation lf -encoding utf-8 puts $manual(short-toc-fp) [htmlhead $overall_title $overall_title] puts $manual(short-toc-fp) "
" set manual(merge-copyrights) {} foreach arg $args { # preprocess to set up subheader for the rest of the files if {![llength $arg]} { continue } lassign $arg -> name file if {[regexp {(.*)(?: Package)? Commands(?:, version .*)?} $name -> pkg]} { set name "$pkg Commands" } elseif {[regexp {(.*)(?: Package)? C API(?:, version .*)?} $name -> pkg]} { set name "$pkg C API" } lappend manual(subheader) $name $file } ## ## parse the manpages in a section of the docs (split by ## package) and construct formatted manpages ## foreach arg $args { if {[llength $arg]} { make-manpage-section $html $arg } } ## ## build the keyword index. ## if {!$verbose} { puts stderr "Assembling index" } file delete -force -- $html/Keywords makedirhier $html/Keywords set keyfp [open $html/Keywords/[indexfile] w] fconfigure $keyfp -translation lf -encoding utf-8 puts $keyfp [htmlhead "$tcltkdesc Keywords" "$tcltkdesc Keywords" \ $overall_title "../[indexfile]"] set letters {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} # Create header first set keyheader {} foreach a $letters { set keys [array names manual "keyword-\[[string totitle $a$a]\]*"] if {[llength $keys]} { lappend keyheader "$a" } else { # No keywords for this letter lappend keyheader $a } } set keyheader

[join $keyheader " |\n"]

puts $keyfp $keyheader foreach a $letters { set keys [array names manual "keyword-\[[string totitle $a$a]\]*"] if {![llength $keys]} { continue } # Per-keyword page set afp [open $html/Keywords/$a.html w] fconfigure $afp -translation lf -encoding utf-8 puts $afp [htmlhead "$tcltkdesc Keywords - $a" \ "$tcltkdesc Keywords - $a" \ $overall_title "../[indexfile]"] puts $afp $keyheader puts $afp "
" foreach k [lsort -dictionary $keys] { set k [string range $k 8 end] puts $afp "
$k
" puts $afp "
" set refs {} foreach man $manual(keyword-$k) { set name [lindex $man 0] set file [lindex $man 1] if {[info exists manual(tooltip-$file)]} { set tooltip $manual(tooltip-$file) if {[string match {*[<>""]*} $tooltip]} { manerror "bad tooltip for $file: \"$tooltip\"" } lappend refs "$name" } else { lappend refs "$name" } } puts $afp "[join $refs {, }]
" } puts $afp "
" # insert merged copyrights puts $afp [copyout $manual(merge-copyrights)] puts $afp "" close $afp } # insert merged copyrights puts $keyfp [copyout $manual(merge-copyrights)] puts $keyfp "" close $keyfp ## ## finish off short table of contents ## puts $manual(short-toc-fp) "
Keywords
The keywords from the $tcltkdesc man pages." puts $manual(short-toc-fp) "
" # insert merged copyrights puts $manual(short-toc-fp) [copyout $manual(merge-copyrights)] puts $manual(short-toc-fp) "" close $manual(short-toc-fp) ## ## output man pages ## unset manual(section) if {!$verbose} { puts stderr "Rescanning [llength $manual(all-pages)] pages to build cross links and write out" } foreach path $manual(all-pages) wing_name $manual(all-page-domains) { set manual(wing-file) [file dirname $path] set manual(tail) [file tail $path] set manual(name) [file root $manual(tail)] try { set text $manual(output-$manual(wing-file)-$manual(name)) set ntext 0 foreach item $text { incr ntext [llength [split $item \n]] incr ntext } set toc $manual(toc-$manual(wing-file)-$manual(name)) set ntoc 0 foreach item $toc { incr ntoc [llength [split $item \n]] incr ntoc } if {$verbose} { puts stderr "rescanning page $manual(name) $ntoc/$ntext" } else { puts -nonewline stderr . } set outfd [open $html/$manual(wing-file)/$manual(name).html w] fconfigure $outfd -translation lf -encoding utf-8 puts $outfd [htmlhead "$manual($manual(wing-file)-$manual(name)-title)" \ $manual(name) $wing_name "[indexfile]" \ $overall_title "../[indexfile]"] if {($ntext > 60) && ($ntoc > 32)} { foreach item $toc { puts $outfd $item } } elseif {$manual(name) in $forced_index_pages} { if {!$verbose} {puts stderr ""} manerror "forcing index generation" foreach item $toc { puts $outfd $item } } foreach item $text { puts $outfd [insert-cross-references $item] } puts $outfd "" } on error msg { if {$verbose} { puts stderr $msg } else { puts stderr "\nError when processing $manual(name): $msg" } } finally { catch {close $outfd} } } if {!$verbose} { puts stderr "\nDone" } return {} } ## ## Helper for assembling the descriptions of base packages (i.e., Tcl and Tk). ## proc plus-base {var root glob name dir desc} { global tcltkdir if {$var} { if {[file exists $tcltkdir/$root/README.md]} { set f [open $tcltkdir/$root/README.md] fconfigure $f -encoding utf-8 set d [read $f] close $f if {[regexp {This is the \*\*\w+ (\S+)\*\* source distribution} $d -> version]} { append name ", version $version" } } set glob $root/$glob return [list $tcltkdir/$glob $name $dir $desc] } } ## ## Helper for assembling the descriptions of contributed packages. ## proc plus-pkgs {type args} { global build_tcl tcltkdir tcldir if {$type ni {n 3}} { error "unknown type \"$type\": must be 3 or n" } if {!$build_tcl} return set result {} set pkgsdir $tcltkdir/$tcldir/pkgs foreach {dir name version} $args { set globpat $pkgsdir/$dir/doc/*.$type if {![llength [glob -type f -nocomplain $globpat]]} { # Fallback for manpages generated using doctools set globpat $pkgsdir/$dir/doc/man/*.$type if {![llength [glob -type f -nocomplain $globpat]]} { continue } } set dir [string trimright $dir "0123456789-."] switch $type { n { set title "$name Package Commands" if {$version ne ""} { append title ", version $version" } set dir [string totitle $dir]Cmd set desc \ "The additional commands provided by the $name package." } 3 { set title "$name Package C API" if {$version ne ""} { append title ", version $version" } set dir [string totitle $dir]Lib set desc \ "The additional C functions provided by the $name package." } } lappend result [list $globpat $title $dir $desc] } return $result } ## ## Set up some special cases. It would be nice if we didn't have them, ## but we do... ## set excluded_pages {} set forced_index_pages {GetDash} set process_first_patterns {*/ttk_widget.n */options.n} set ensemble_commands { after array binary chan clock dde dict encoding file history info interp memory namespace package registry self string trace update zlib clipboard console font grab grid image option pack place selection tk tkwait ttk::style winfo wm itcl::delete itcl::find itcl::is } array set remap_link_target { stdin Tcl_GetStdChannel stdout Tcl_GetStdChannel stderr Tcl_GetStdChannel style ttk::style {style map} ttk::style {tk busy} busy library auto_execok safe-tcl safe tclvars env tcl_break catch tcl_continue catch tcl_error catch tcl_ok catch tcl_return catch int() mathfunc wide() mathfunc packagens pkg::create pkgMkIndex pkg_mkIndex pkg_mkIndex pkg_mkIndex Tcl_Obj Tcl_NewObj Tcl_ObjType Tcl_RegisterObjType Tcl_OpenFileChannelProc Tcl_FSOpenFileChannel errorinfo env errorcode env tcl_pkgpath env Tcl_Command Tcl_CreateObjCommand Tcl_CmdProc Tcl_CreateObjCommand Tcl_CmdDeleteProc Tcl_CreateObjCommand Tcl_ObjCmdProc Tcl_CreateObjCommand Tcl_Channel Tcl_OpenFileChannel Tcl_WideInt Tcl_NewIntObj Tcl_ChannelType Tcl_CreateChannel Tcl_DString Tcl_DStringInit Tcl_Namespace Tcl_AppendExportList Tcl_Object Tcl_NewObjectInstance Tcl_Class Tcl_GetObjectAsClass Tcl_Event Tcl_QueueEvent Tcl_Time Tcl_GetTime Tcl_ThreadId Tcl_CreateThread Tk_Window Tk_WindowId Tk_3DBorder Tk_Get3DBorder Tk_Anchor Tk_GetAnchor Tk_Cursor Tk_GetCursor Tk_Dash Tk_GetDash Tk_Font Tk_GetFont Tk_Image Tk_GetImage Tk_ImageMaster Tk_GetImage Tk_ImageModel Tk_GetImage Tk_ItemType Tk_CreateItemType Tk_Justify Tk_GetJustify Ttk_Theme Ttk_GetTheme } array set exclude_refs_map { bind.n {button destroy option} clock.n {next} history.n {exec} next.n {unknown} zlib.n {binary close filename text} canvas.n {bitmap text} console.n {eval} checkbutton.n {image} clipboard.n {string} entry.n {string} event.n {return} font.n {menu} getOpenFile.n {file open text} grab.n {global} interp.n {time} menu.n {checkbutton radiobutton} messageBox.n {error info} options.n {bitmap image set} radiobutton.n {image} safe.n {join split} scale.n {label variable} scrollbar.n {set} selection.n {string} tcltest.n {error} text.n {bind image lower raise} tkvars.n {tk} tkwait.n {variable} tm.n {exec} ttk_checkbutton.n {variable} ttk_combobox.n {selection} ttk_entry.n {focus variable} ttk_intro.n {focus text} ttk_label.n {font text} ttk_labelframe.n {text} ttk_menubutton.n {flush} ttk_notebook.n {image text} ttk_progressbar.n {variable} ttk_radiobutton.n {variable} ttk_scale.n {variable} ttk_scrollbar.n {set} ttk_spinbox.n {format} ttk_treeview.n {text open focus selection} ttk_widget.n {image text variable} TclZlib.3 {binary flush filename text} } array set exclude_when_followed_by_map { canvas.n { bind widget focus widget image are lower widget raise widget } selection.n { clipboard selection clipboard ; } ttk_image.n { image imageSpec } fontchooser.n { tk fontchooser } } try { # Parse what the user told us to do parse_command_line # Some strings depend on what options are specified set tcltkdesc ""; set cmdesc ""; set appdir "" if {$build_tcl} { append tcltkdesc "Tcl" append cmdesc "Tcl" append appdir "$tcldir" } if {$build_tcl && $build_tk} { append tcltkdesc "/" append cmdesc " and " append appdir "," } if {$build_tk} { append tcltkdesc "Tk" append cmdesc "Tk" append appdir "$tkdir" } apply {{} { global packageBuildList tcltkdir tcldir build_tcl # When building docs for Tcl, try to build docs for bundled packages too set packageBuildList {} if {$build_tcl} { set pkgsDir [file join $tcltkdir $tcldir pkgs] set subdirs [glob -nocomplain -types d -tails -directory $pkgsDir *] foreach dir [lsort $subdirs] { # Parse the subdir name into (name, version) as fallback... set description [split $dir -] if {2 != [llength $description]} { regexp {([^0-9]*)(.*)} $dir -> n v set description [list $n $v] } # ... but try to extract (name, version) from subdir contents try { try { set f [open [file join $pkgsDir $dir configure.in]] } trap {POSIX ENOENT} {} { set f [open [file join $pkgsDir $dir configure.ac]] } fconfigure $f -encoding utf-8 foreach line [split [read $f] \n] { if {2 == [scan $line \ { AC_INIT ( [%[^]]] , [%[^]]] ) } n v]} { set description [list $n $v] break } } } on error {} { puts "package folder without package ignored: $dir" continue } finally { catch {close $f; unset f} } if {[file exists [file join $pkgsDir $dir configure]]} { # Looks like a package, record our best extraction attempt lappend packageBuildList $dir {*}$description } } } # Get the list of packages to try, and what their human-readable names # are. Note that the package directory list should be version-less. try { set packageDirNameMap {} if {$build_tcl} { set f [open $tcltkdir/$tcldir/pkgs/package.list.txt] fconfigure $f -encoding utf-8 try { foreach line [split [read $f] \n] { if {[string trim $line] eq ""} continue if {[string match #* $line]} continue lassign $line dir name lappend packageDirNameMap $dir $name } } finally { close $f } } } trap {POSIX ENOENT} {} { set packageDirNameMap { itcl {[incr Tcl]} tdbc {TDBC} thread Thread } } # Convert to human readable names, if applicable for {set idx 0} {$idx < [llength $packageBuildList]} {incr idx 3} { lassign [lrange $packageBuildList $idx $idx+2] d n v if {[dict exists $packageDirNameMap $n]} { lset packageBuildList $idx+1 [dict get $packageDirNameMap $n] } } }} # # Invoke the scraper/converter engine. # make-man-pages $webdir \ [list $tcltkdir/{$appdir}/doc/*.1 "$tcltkdesc Applications" UserCmd \ "The interpreters which implement $cmdesc."] \ [plus-base $build_tcl $tcldir doc/*.n {Tcl Commands} TclCmd \ "The commands which the tclsh interpreter implements."] \ [plus-base $build_tk $tkdir doc/*.n {Tk Commands} TkCmd \ "The additional commands which the wish interpreter implements."] \ {*}[plus-pkgs n {*}$packageBuildList] \ [plus-base $build_tcl $tcldir doc/*.3 {Tcl C API} TclLib \ "The C functions which a Tcl extended C program may use."] \ [plus-base $build_tk $tkdir doc/*.3 {Tk C API} TkLib \ "The additional C functions which a Tk extended C program may use."] \ {*}[plus-pkgs 3 {*}$packageBuildList] } on error {msg opts} { # On failure make sure we show what went wrong. We're not supposed # to get here though; it represents a bug in the script. puts $msg\n[dict get $opts -errorinfo] exit 1 } # Local-Variables: # mode: tcl # End: tcl9.0.3/tools/tcltk-man2html-utils.tcl0000644000175000017500000012653215104661341017423 0ustar sergeisergei## ## Utility functions for Man->HTML converter. Note that these ## functions are specifically intended to work with the format as used ## by Tcl and Tk; they do not cope with arbitrary nroff markup. ## ## Copyright © 1995-1997 Roger E. Critchlow Jr ## Copyright © 2004-2011 Donal K. Fellows set ::manual(report-level) 1 proc manerror {msg} { global manual set name {} set subj {} set procname [lindex [info level -1] 0] if {[info exists manual(name)]} { set name $manual(name) } if {[info exists manual(section)] && [string length $manual(section)]} { puts stderr "$name: $manual(section): $procname: $msg" } else { puts stderr "$name: $procname: $msg" } } proc manreport {level msg} { global manual if {$level < $manual(report-level)} { uplevel 1 [list manerror $msg] } } proc fatal {msg} { global manual uplevel 1 [list manerror $msg] exit 1 } ## ## templating ## proc indexfile {} { if {[info exists ::TARGET] && $::TARGET eq "devsite"} { return "index.tml" } else { return "index.html" } } proc copyright {copyright {level {}}} { # We don't actually generate a separate copyright page anymore #set page "${level}copyright.html" #return "Copyright © [htmlize-text [lrange $copyright 2 end]]" # obfuscate any email addresses that may appear in name set who [string map {@ (at)} [lrange $copyright 2 end]] return "Copyright © [htmlize-text $who]" } proc copyout {copyrights {level {}}} { set count 0 set out "
" foreach c $copyrights { if {$count > 0} { append out
} append out "[copyright $c $level]\n" incr count } append out "
" return $out } proc CSS {{level ""}} { return "\n" } proc htmlhead {title header args} { set level "" if {[lindex $args end] eq "../[indexfile]"} { # XXX hack - assume same level for CSS file set level "../" } set out "\n\n$title\n[CSS $level]\n" foreach {uptitle url} $args { set header "$uptitle > $header" } append out "

$header

" global manual if {[info exists manual(subheader)]} { set subs {} foreach {name subdir} $manual(subheader) { if {$name eq $title} { lappend subs $name } else { lappend subs "$name" } } append out "\n

[join $subs { | }]

" } return $out } ## ## parsing ## proc unquote arg { return [string map [list \" {}] $arg] } proc parse-directive {line codename restname} { upvar 1 $codename code $restname rest return [regexp {^(\.[.a-zA-Z0-9]*) *(.*)} $line all code rest] } proc nospace-text {text} { return [regsub -all " " $text _] } proc htmlize-text {text {charmap {}}} { # contains some extras for use in nroff->html processing # build on the list passed in, if any lappend charmap \ "–" "–" \ {&} {&} \ {\\} "\" \ {\e} "\" \ {\ } { } \ {\|} { } \ {\0} { } \ \" {"} \ {<} {<} \ {>} {>} \ \u201C "“" \ \u201D "”" return [string map $charmap $text] } proc process-text {text} { global manual # preprocess text; note that this is an incomplete map, and will probably # need to have things added to it as the manuals expand to use them. set charmap [list \ {\&} "\t" \ {\%} {} \ "\\\n" "\n" \ {\(r!} "¡" \ {\(ct} "¢" \ {\(Po} "£" \ {\(Cs} "¤" \ {\(Ye} "¥" \ {\(bb} "¦" \ {\(sc} "§" \ {\(ad} "¨" \ {\(co} "©" \ {\(Of} "ª" \ {\(Fo} "«" \ {\(no} "¬" \ {\(rg} "®" \ {\(a-} "¯" \ {\(de} "°" \ {\(+-} "±" \ {\(S2} "²" \ {\(S3} "³" \ {\(aa} "´" \ {\(mc} "µ" \ {\(ps} "¶" \ {\(pc} "·" \ {\(ac} "¸" \ {\(S1} "¹" \ {\(Om} "º" \ {\(Fc} "»" \ {\(14} "¼" \ {\(12} "½" \ {\(34} "¾" \ {\(r?} "¿" \ {\(AE} "Æ" \ {\(-D} "Ð" \ {\(mu} "×" \ {\(TP} "Þ" \ {\(ss} "ß" \ {\(ae} "æ" \ {\(Sd} "ð" \ {\(di} "÷" \ {\(Tp} "þ" \ {\(em} "—" \ {\(en} "–" \ {\(fm} "′" \ {\(mi} "−" \ {\(.i} "ı" \ {\(.j} "ȷ" \ {\(Fn} "ƒ" \ {\(OE} "Œ" \ {\(oe} "œ" \ {\(IJ} "IJ" \ {\(ij} "ij" \ {\(<-} "" \ {\(->} "" \ {\(eu} "€" \ {\fP} {\fR} \ {\.} . \ {\(bu} "•" \ {\*(qo} "ô" \ ] # This might make a few invalid mappings, but we don't use them foreach c {a c e g i l n o s t u y z A C E G I L N O S T U Y Z} { foreach {prefix suffix} { o ring / slash : uml ' acute ^ circ ` grave ~ tilde , cedil v caron } { lappend charmap "\\\[${prefix}${c}\]" "&${c}${suffix};" lappend charmap "\\(${prefix}${c}" "&${c}${suffix};" } } lappend charmap {\-\|\-} -- ; # two hyphens lappend charmap {\-} - ; # a hyphen set text [htmlize-text $text $charmap] # General quoted entity regsub -all {\\N'(\d+)'} $text "\\&#\\1;" text while {[string first "\\" $text] >= 0} { # C R if {[regsub {^([^\\]*)\\fC([^\\]*)\\fR(.*)$} $text \ {\1\2\3} text]} continue # B R if {[regsub {^([^\\]*)\\fB([^\\]*)\\fR(.*)$} $text \ {\1\2\3} text]} continue # B I if {[regsub {^([^\\]*)\\fB([^\\]*)\\fI(.*)$} $text \ {\1\2\\fI\3} text]} continue # I R if {[regsub {^([^\\]*)\\fI([^\\]*)\\fR(.*)$} $text \ {\1\2\3} text]} continue # I B if {[regsub {^([^\\]*)\\fI([^\\]*)\\fB(.*)$} $text \ {\1\2\\fB\3} text]} continue # B B, I I, R R if { [regsub {^([^\\]*)\\fB([^\\]*)\\fB(.*)$} $text \ {\1\\fB\2\3} ntext] || [regsub {^([^\\]*)\\fI([^\\]*)\\fI(.*)$} $text \ {\1\\fI\2\3} ntext] || [regsub {^([^\\]*)\\fR([^\\]*)\\fR(.*)$} $text \ {\1\\fR\2\3} ntext] } { manerror "impotent font change: $text" set text $ntext continue } # unrecognized manerror "uncaught backslash: $text" set text [string map [list "\\" "\"] $text] } return $text } ## ## pass 2 text input and matching ## proc open-text {} { global manual set manual(text-length) [llength $manual(text)] set manual(text-pointer) 0 } proc more-text {} { global manual return [expr {$manual(text-pointer) < $manual(text-length)}] } proc next-text {} { global manual if {[more-text]} { set text [lindex $manual(text) $manual(text-pointer)] incr manual(text-pointer) return $text } manerror "read past end of text" error "fatal" } proc is-a-directive {line} { return [string match .* $line] } proc split-directive {line opname restname} { upvar 1 $opname op $restname rest set op [string range $line 0 2] set rest [string trim [string range $line 3 end]] } proc next-op-is {op restname} { global manual upvar 1 $restname rest if {[more-text]} { set text [lindex $manual(text) $manual(text-pointer)] if {[string equal -length 3 $text $op]} { set rest [string range $text 4 end] incr manual(text-pointer) return 1 } } return 0 } proc backup-text {n} { global manual if {$manual(text-pointer)-$n >= 0} { incr manual(text-pointer) -$n } } proc match-text args { global manual set nargs [llength $args] if {$manual(text-pointer) + $nargs > $manual(text-length)} { return 0 } set nback 0 foreach arg $args { if {![more-text]} { backup-text $nback return 0 } set arg [string trim $arg] set targ [string trim [lindex $manual(text) $manual(text-pointer)]] if {$arg eq $targ} { incr nback incr manual(text-pointer) continue } if {[regexp {^@(\w+)$} $arg all name]} { upvar 1 $name var set var $targ incr nback incr manual(text-pointer) continue } if {[regexp -nocase {^(\.[A-Z][A-Z])@(\w+)$} $arg all op name]\ && [string equal $op [lindex $targ 0]]} { upvar 1 $name var set var [lrange $targ 1 end] incr nback incr manual(text-pointer) continue } backup-text $nback return 0 } return 1 } proc expand-next-text {n} { global manual return [join [lrange $manual(text) $manual(text-pointer) \ [expr {$manual(text-pointer)+$n-1}]] \n\n] } ## ## pass 2 output ## proc man-puts {text} { global manual lappend manual(output-$manual(wing-file)-$manual(name)) $text } ## ## build hypertext links to tables of contents ## proc long-toc {text} { global manual set here M[incr manual(section-toc-n)] set manual($manual(name)-id-$text) $here set there L[incr manual(long-toc-n)] lappend manual(section-toc) \ "
$text" return "$text" } proc option-toc {name class switch} { global manual # Special case handling, oh we hate it but must do it if {[string match "*OPTIONS" $manual(section)]} { if {$manual(name) ne "ttk_widget" && ($manual(name) ne "ttk_entry" || ![string match validate* $name])} { # link the defined option into the long table of contents set link [long-toc "$switch, $name, $class"] regsub -- "$switch, $name, $class" $link "$switch" link return $link } } elseif {"$manual(name):$manual(section)" ne "options:DESCRIPTION"} { error "option-toc in $manual(name) section $manual(section)" } # link the defined standard option to the long table of contents and make # a target for the standard option references from other man pages. set first [lindex $switch 0] set here M$first set there L[incr manual(long-toc-n)] set manual(standard-option-$manual(name)-$first) \ "$switch, $name, $class" lappend manual(section-toc) \ "
$switch, $name, $class" return "$switch" } proc std-option-toc {name page} { global manual if {[info exists manual(standard-option-$page-$name)]} { lappend manual(section-toc)
$manual(standard-option-$page-$name) return $manual(standard-option-$page-$name) } manerror "missing reference to \"$name\" in $page.n" set here M[incr manual(section-toc-n)] set there L[incr manual(long-toc-n)] set other M$name lappend manual(section-toc) "
$name" return "$name" } ## ## process the widget option section ## in widget and options man pages ## proc output-widget-options {rest} { global manual man-puts
lappend manual(section-toc)
backup-text 1 set para {} while {[next-op-is .OP rest]} { switch -exact -- [llength $rest] { 3 { lassign $rest switch name class } 5 { set switch [lrange $rest 0 2] set name [lindex $rest 3] set class [lindex $rest 4] } default { fatal "bad .OP $rest" } } if {![regexp {^(<.>)([-\w ]+)()$} $switch \ all oswitch switch cswitch]} { if {![regexp {^(<.>)([-\w ]+) or ([-\w ]+)()$} $switch \ all oswitch switch1 switch2 cswitch]} { error "not Switch: $switch" } set switch "$switch1$cswitch or $oswitch$switch2" } if {![regexp {^(<.>)([\w]*)()$} $name all oname name cname]} { error "not Name: $name" } if {![regexp {^(<.>)([\w]*)()$} $class all oclass class cclass]} { error "not Class: $class" } man-puts "$para
Command-Line Name: $oswitch[option-toc $name $class $switch]$cswitch" man-puts "
Database Name: $oname$name$cname" man-puts "
Database Class: $oclass$class$cclass" man-puts
[next-text] set para

if {[next-op-is .RS rest]} { while {[more-text]} { set line [next-text] if {[is-a-directive $line]} { split-directive $line code rest switch -exact -- $code { .RE { break } .SH - .SS { manerror "unbalanced .RS at section end" backup-text 1 break } default { output-directive $line } } } else { man-puts $line } } } } man-puts

lappend manual(section-toc)
} ## ## process .RS lists ## proc output-RS-list {} { global manual if {[next-op-is .IP rest]} { output-IP-list .RS .IP $rest if {[match-text .RE .sp .RS @rest .IP @rest2]} { man-puts

$rest output-IP-list .RS .IP $rest2 } if {[match-text .RE .sp .RS @rest .RE]} { man-puts

$rest return } if {[next-op-is .RE rest]} { return } } man-puts

while {[more-text]} { set line [next-text] if {[is-a-directive $line]} { split-directive $line code rest switch -exact -- $code { .RE { break } .SH - .SS { manerror "unbalanced .RS at section end" backup-text 1 break } default { output-directive $line } } } else { man-puts $line } } man-puts
} ## ## process .IP lists which may be plain indents, ## numeric lists, or definition lists ## proc output-IP-list {context code rest} { global manual if {![string length $rest]} { # blank label, plain indent, no contents entry man-puts
while {[more-text]} { set line [next-text] if {[is-a-directive $line]} { split-directive $line code rest if {$code eq ".IP" && $rest eq {}} { man-puts "

" continue } if {$code in {.br .DS .RS}} { output-directive $line } else { backup-text 1 break } } else { man-puts $line } } man-puts

} else { # labelled list, make contents if {$context ne ".SH" && $context ne ".SS"} { man-puts

} set dl "

" set enddl "
" if {$code eq ".IP"} { if {[regexp {^\[[\da-f]+\]|\(?[\da-f]+\)$} $rest]} { set dl "
    " set enddl "
" } elseif {"•" eq $rest} { set dl "
    " set enddl "
" } } man-puts $dl lappend manual(section-toc) $dl backup-text 1 set accept_RE 0 set para {} while {[more-text]} { set line [next-text] if {[is-a-directive $line]} { split-directive $line code rest switch -exact -- $code { .IP { if {$accept_RE} { output-IP-list .IP $code $rest continue } if {$manual(section) eq "ARGUMENTS"} { man-puts "$para
$rest
" } elseif {[regexp {^\[([\da-f]+)\]$} $rest -> value]} { man-puts "$para
  • " } elseif {[regexp {^\(?([\da-f]+)\)$} $rest -> value]} { man-puts "$para
  • " } elseif {"•" eq $rest} { man-puts "$para
  • " } else { man-puts "$para
    [long-toc $rest]
    " } } .sp - .br - .DS - .CS { output-directive $line } .RS { if {[match-text .RS]} { output-directive $line incr accept_RE 1 } elseif {[match-text .CS]} { output-directive .CS incr accept_RE 1 } elseif {[match-text .PP]} { output-directive .PP incr accept_RE 1 } elseif {[match-text .DS]} { output-directive .DS incr accept_RE 1 } else { output-directive $line } } .PP { if {[match-text @rest1 .br @rest2 .RS]} { # yet another nroff kludge as above man-puts "$para
    [long-toc $rest1]" man-puts "
    [long-toc $rest2]
    " incr accept_RE 1 } elseif {[match-text @rest .RE]} { # gad, this is getting ridiculous if {!$accept_RE} { man-puts "$enddl

    $rest$dl" backup-text 1 set para {} break } man-puts "

    $rest" incr accept_RE -1 } elseif {$accept_RE} { output-directive $line } else { backup-text 1 break } } .RE { if {!$accept_RE} { backup-text 1 break } incr accept_RE -1 } default { backup-text 1 break } } } else { man-puts $line } set para

    } man-puts "$para$enddl" lappend manual(section-toc) $enddl if {$accept_RE} { manerror "missing .RE in output-IP-list" } } } ## ## handle the NAME section lines ## there's only one line in the NAME section, ## consisting of a comma separated list of names, ## followed by a hyphen and a short description. ## proc output-name {line} { global manual # split name line into pieces regexp {^([^-]+) - (.*)$} [regsub -all {[ \n\r\t]+} $line " "] -> head tail # output line to manual page untouched man-puts "$head — $tail" # output line to long table of contents lappend manual(section-toc) "

    $head — $tail
    " # separate out the names for future reference foreach name [split $head ,] { set name [string trim $name] if {[llength $name] > 1} { manerror "name has a space: {$name}\nfrom: $line" } lappend manual(wing-toc) $name lappend manual(name-$name) $manual(wing-file)/$manual(name) } set manual(tooltip-$manual(wing-file)/$manual(name).html) $line } ## ## build a cross-reference link if appropriate ## proc cross-reference {ref} { global manual remap_link_target global ensemble_commands exclude_refs_map exclude_when_followed_by_map set manname $manual(name) set mantail $manual(tail) if {[string match "Tcl_*" $ref] || [string match "Tk_*" $ref] || [string match "Ttk_*" $ref] || [string match "Itcl_*" $ref] || [string match "Tdbc_*" $ref]} { regexp {^\w+} $ref lref ## ## apply a link remapping if available ## if {[info exists remap_link_target($lref)]} { set lref $remap_link_target($lref) } } elseif {$ref eq "Tcl"} { set lref $ref } elseif { [regexp {^[A-Z0-9 ?!]+$} $ref] && [info exists manual($manname-id-$ref)] } { return "$ref" } else { set lref [string tolower $ref] ## ## apply a link remapping if available ## if {[info exists remap_link_target($lref)]} { set lref $remap_link_target($lref) } } ## ## nothing to reference ## if {![info exists manual(name-$lref)]} { foreach name $ensemble_commands { if { [regexp "^$name \[a-z0-9]*\$" $lref] && [info exists manual(name-$name)] && $mantail ne "$name.n" && (![info exists exclude_refs_map($mantail)] || $manual(name-$name) ni $exclude_refs_map($mantail)) } { return "$ref" } } if {$lref in {end}} { # no good place to send this tcl token? } return $ref } set manref $manual(name-$lref) ## ## would be a self reference ## foreach name $manref { if {"$manual(wing-file)/$manname" in $name} { return $ref } } ## ## multiple choices for reference ## if {[llength $manref] > 1} { set tcl_i [lsearch -glob $manref *TclCmd*] if {$tcl_i >= 0 && $manual(wing-file) eq "TclCmd" || $manual(wing-file) eq "TclLib"} { set tcl_ref [lindex $manref $tcl_i] return "$ref" } set tk_i [lsearch -glob $manref *TkCmd*] if {$tk_i >= 0 && $manual(wing-file) eq "TkCmd" || $manual(wing-file) eq "TkLib"} { set tk_ref [lindex $manref $tk_i] return "$ref" } if {$lref eq "exit" && $mantail eq "tclsh.1" && $tcl_i >= 0} { set tcl_ref [lindex $manref $tcl_i] return "$ref" } puts stderr "multiple cross reference to $ref in $manref from $manual(wing-file)/$mantail" return $ref } ## ## exceptions, sigh, to the rule ## if {[info exists exclude_when_followed_by_map($mantail)]} { upvar 1 text tail set following_word [lindex [regexp -inline {\S+} $tail] 0] foreach {this that} $exclude_when_followed_by_map($mantail) { # only a ref if $this is not followed by $that if {$lref eq $this && [string match $that* $following_word]} { return $ref } } } if { [info exists exclude_refs_map($mantail)] && $lref in $exclude_refs_map($mantail) } { return $ref } ## ## return the cross reference ## return "$ref" } ## ## reference generation errors ## proc reference-error {msg text} { global manual puts stderr "$manual(tail): $msg: {$text}" return $text } ## ## insert as many cross references into this text string as are appropriate ## proc insert-cross-references {text} { global manual set result "" while 1 { ## ## we identify cross references by: ## ``quotation'' ## emboldening ## Tcl_ prefix ## Tk_ prefix ## [a-zA-Z0-9]+ manual entry ## and we avoid messing with already anchored text ## ## ## find where each item lives - EXPENSIVE - and accumulate a list ## unset -nocomplain offsets foreach {name pattern} { anchor {} quote {``} end-quote {''} bold {} end-bold {} c.tcl {Tcl_} c.tk {Tk_} c.ttk {Ttk_} c.tdbc {Tdbc_} c.itcl {Itcl_} Tcl1 {Tcl manual entry} Tcl2 {Tcl overview manual entry} url {http://} } { set o [string first $pattern $text] if {[set offset($name) $o] >= 0} { set invert($o) $name lappend offsets $o } } ## ## if nothing, then we're done. ## if {![info exists offsets]} { return [append result $text] } ## ## sort the offsets ## set offsets [lsort -integer $offsets] ## ## see which we want to use ## switch -exact -- $invert([lindex $offsets 0]) { anchor { if {$offset(end-anchor) < 0} { return [reference-error {Missing end anchor} $text] } append result [string range $text 0 $offset(end-anchor)] set text [string range $text[set text ""] \ [expr {$offset(end-anchor)+1}] end] continue } quote { if {$offset(end-quote) < 0} { return [reference-error "Missing end quote" $text] } if {$invert([lindex $offsets 1]) in {tcl tk ttk}} { set offsets [lreplace $offsets 1 1] } switch -exact -- $invert([lindex $offsets 1]) { end-quote { if {$offset(quote) > 0} { append result [string range $text 0 [expr {$offset(quote)-1}]] } set body [string range $text [expr {$offset(quote)+2}] \ [expr {$offset(end-quote)-1}]] set text [string range $text[set text ""] \ [expr {$offset(end-quote)+2}] end] append result `` [cross-reference $body] '' continue } bold - anchor { append result [string range $text \ 0 [expr {$offset(end-quote)+1}]] set text [string range $text[set text ""] \ [expr {$offset(end-quote)+2}] end] continue } } return [reference-error "Uncaught quote case" $text] } bold { if {$offset(end-bold) < 0} { return [append result $text] } if {[string match "c.*" $invert([lindex $offsets 1])]} { set offsets [lreplace $offsets 1 1] } switch -exact -- $invert([lindex $offsets 1]) { url - end-bold { if {$offset(bold) > 0} { append result \ [string range $text 0 [expr {$offset(bold)-1}]] } set body [string range $text [expr {$offset(bold)+3}] \ [expr {$offset(end-bold)-1}]] set text [string range $text[set text ""] \ [expr {$offset(end-bold)+4}] end] regsub {http://[\w/.-]+} $body {&} body append result [cross-reference $body] continue } anchor { append result \ [string range $text 0 [expr {$offset(end-bold)+3}]] set text [string range $text[set text ""] \ [expr {$offset(end-bold)+4}] end] continue } default { return [reference-error "Uncaught bold case" $text] } } } c.tk - c.ttk - c.tcl - c.tdbc - c.itcl { if {[lindex $offsets 0] > 0} { append result [string range $text 0 \ [expr {[lindex $offsets 0]-1}]] } regexp -indices -start [lindex $offsets 0] {\w+} $text range set body [string range $text {*}$range] set text [string range $text[set text ""] \ [expr {[lindex $range 1]+1}] end] append result [cross-reference $body] continue } Tcl1 - Tcl2 { set off [lindex $offsets 0] if {$off > 0} { append result [string range $text 0 [expr {$off-1}]] } set text [string range $text[set text ""] [expr {$off+3}] end] append result [cross-reference Tcl] continue } url { set off [lindex $offsets 0] if {$off > 0} { append result [string range $text 0 [expr {$off-1}]] } regexp -indices -start $off {http://[\w/.-]+} $text range set url [string range $text {*}$range] append result "$url" set text [string range $text[set text ""] \ [expr {[lindex $range 1]+1}] end] continue } end-anchor - end-bold - end-quote { return [reference-error "Out of place $invert([lindex $offsets 0])" $text] } } } } ## ## process formatting directives ## proc output-directive {line} { global manual # process format directive split-directive $line code rest switch -exact -- $code { .BS - .BE { # man-puts
    } .SH - .SS { # drain any open lists # announce the subject set manual(section) $rest # start our own stack of stuff set manual($manual(name)-$manual(section)) {} lappend manual(has-$manual(section)) $manual(name) if {$code ne ".SS"} { man-puts "

    [long-toc $manual(section)]

    " } else { man-puts "

    [long-toc $manual(section)]

    " } # some sections can simply free wheel their way through the text # some sections can be processed in their own loops switch -exact -- [string index $code end]:$manual(section) { H:NAME { set names {} while {1} { set line [next-text] if {[is-a-directive $line]} { backup-text 1 if {[llength $names]} { output-name [join $names { }] } return } lappend names [string trim $line] } } H:SYNOPSIS { lappend manual(section-toc)
    while {1} { if { [next-op-is .nf rest] || [next-op-is .br rest] || [next-op-is .fi rest] } { continue } if { [next-op-is .SH rest] || [next-op-is .SS rest] || [next-op-is .BE rest] || [next-op-is .SO rest] } { backup-text 1 break } if {[next-op-is .sp rest]} { #man-puts

    continue } set more [next-text] if {[is-a-directive $more]} { manerror "in SYNOPSIS found $more" backup-text 1 break } foreach more [split $more \n] { regexp {^(\s*)(.*)} $more -> spaces more set spaces [string map {" " " "} $spaces] if {[string length $spaces]} { set spaces $spaces } man-puts $spaces$more
    if {$manual(wing-file) in {TclLib TkLib}} { lappend manual(section-toc)

    $more } } } lappend manual(section-toc)
    return } {H:SEE ALSO} { while {[more-text]} { if {[next-op-is .SH rest] || [next-op-is .SS rest]} { backup-text 1 return } set more [next-text] if {[is-a-directive $more]} { manerror "$more" backup-text 1 return } set nmore {} foreach cr [split $more ,] { set cr [string trim $cr] if {![regexp {^.*$} $cr]} { set cr $cr } if {[regexp {^(.*)\([13n]\)$} $cr all name]} { set cr $name } lappend nmore $cr } man-puts [join $nmore {, }] } return } H:KEYWORDS { while {[more-text]} { if {[next-op-is .SH rest] || [next-op-is .SS rest]} { backup-text 1 return } set more [next-text] if {[is-a-directive $more]} { manerror "$more" backup-text 1 return } set keys {} foreach key [split $more ,] { set key [string trim $key] lappend manual(keyword-$key) [list $manual(name) \ $manual(wing-file)/$manual(name).html] set initial [string toupper [string index $key 0]] lappend keys "$key" } man-puts [join $keys {, }] } return } } if {[next-op-is .IP rest]} { output-IP-list $code .IP $rest return } if {[next-op-is .PP rest]} { return } return } .SO { # When there's a sequence of multiple .SO chunks, process into one set optslist {} while 1 { if {[match-text @stuff .SE]} { foreach opt [split $stuff \n\t] { lappend optslist [list $opt $rest] } } else { manerror "unexpected .SO format:\n[expand-next-text 2]" } if {![next-op-is .SO rest]} { break } } output-directive {.SH STANDARD OPTIONS} man-puts
    lappend manual(section-toc)
    foreach optionpair [lsort -dictionary -index 0 $optslist] { lassign $optionpair option targetPage man-puts "
    [std-option-toc $option $targetPage]" } man-puts
    lappend manual(section-toc)
    } .OP { output-widget-options $rest return } .IP { output-IP-list .IP .IP $rest return } .PP - .sp { man-puts

    } .RS { output-RS-list return } .br { man-puts
    return } .DS { if {[next-op-is .ta rest]} { # skip the leading .ta directive if it is there } if {[match-text @stuff .DE]} { set td "

    " set bodyText [string map [list \n $td \t $td] \n$stuff] man-puts "

    $bodyText
    " #man-puts
    $stuff
    } elseif {[match-text .fi @ul1 @ul2 .nf @stuff .DE]} { man-puts "
    [lindex $ul1 1][lindex $ul2 1]\n$stuff
    " } else { manerror "unexpected .DS format:\n[expand-next-text 2]" } return } .CS { if {[next-op-is .ta rest]} { # ??? } if {[match-text @stuff .CE]} { man-puts
    $stuff
    } else { manerror "unexpected .CS format:\n[expand-next-text 2]" } return } .nf { if {[match-text @more .fi]} { foreach more [split $more \n] { man-puts $more
    } } elseif {[match-text .RS @more .RE .fi]} { man-puts
    foreach more [split $more \n] { man-puts $more
    } man-puts
    } elseif {[match-text .RS @more .RS @more2 .RE .RE .fi]} { man-puts
    foreach more [split $more \n] { man-puts $more
    } man-puts
    foreach more2 [split $more2 \n] { man-puts $more2
    } man-puts
    } elseif {[match-text .RS @more .RS @more2 .RE @more3 .RE .fi]} { man-puts
    foreach more [split $more \n] { man-puts $more
    } man-puts
    foreach more2 [split $more2 \n] { man-puts $more2
    } man-puts
    foreach more3 [split $more3 \n] { man-puts $more3
    } man-puts
    } elseif {[match-text .sp .RS @more .RS @more2 .sp .RE .RE .fi]} { man-puts

    foreach more [split $more \n] { man-puts $more
    } man-puts
    foreach more2 [split $more2 \n] { man-puts $more2
    } man-puts

    } elseif {[match-text .RS .sp @more .sp .RE .fi]} { man-puts

    foreach more [split $more \n] { man-puts $more
    } man-puts

    } else { manerror "ignoring $line" } } .RE - .DE - .CE { manerror "unexpected $code" return } .ta - .fi - .na - .ad - .UL - .ie - .el - .ne { manerror "ignoring $line" } default { manerror "unrecognized format directive: $line" } } } ## ## merge copyright listings ## proc merge-copyrights {l1 l2} { set merge {} set re1 {^Copyright +(?:\(c\)|\\\(co|©|©) +(\w.*?)(?:all rights reserved)?(?:\. )*$} set re2 {^(\d+) +(?:by +)?(\w.*)$} ;# date who set re3 {^(\d+)-(\d+) +(?:by +)?(\w.*)$} ;# from to who set re4 {^(\d+), *(\d+) +(?:by +)?(\w.*)$} ;# date1 date2 who foreach copyright [concat $l1 $l2] { if {[regexp -nocase -- $re1 $copyright -> info]} { set info [string trimright $info ". "] ; # remove extra period if {[regexp -- $re2 $info -> date who]} { lappend dates($who) $date continue } elseif {[regexp -- $re3 $info -> from to who]} { for {set date $from} {$date <= $to} {incr date} { lappend dates($who) $date } continue } elseif {[regexp -- $re3 $info -> date1 date2 who]} { lappend dates($who) $date1 $date2 continue } } puts "oops: $copyright" } foreach who [array names dates] { set list [lsort -dictionary $dates($who)] if {[llength $list] == 1 || [lindex $list 0] eq [lrange $list end end]} { lappend merge "Copyright © [lindex $list 0] $who" } else { lappend merge "Copyright © [lindex $list 0]-[lrange $list end end] $who" } } return [lsort -dictionary $merge] } ## ## foreach of the man pages in the section specified by ## sectionDescriptor, convert manpages into hypertext in ## the directory specified by outputDir. ## proc make-manpage-section {outputDir sectionDescriptor} { global manual overall_title tcltkdesc verbose global excluded_pages forced_index_pages process_first_patterns set LQ \u201C set RQ \u201D lassign $sectionDescriptor \ manual(wing-glob) \ manual(wing-name) \ manual(wing-file) \ manual(wing-description) set manual(wing-copyrights) {} makedirhier $outputDir/$manual(wing-file) set manual(wing-toc-fp) [open $outputDir/$manual(wing-file)/[indexfile] w] fconfigure $manual(wing-toc-fp) -translation lf -encoding utf-8 # whistle puts stderr "scanning section $manual(wing-name)" # put the entry for this section into the short table of contents if {[regexp {^(.+), version (.+)$} $manual(wing-name) -> name version]} { puts $manual(short-toc-fp) "

    $name
    $manual(wing-description)
    " } else { puts $manual(short-toc-fp) "
    $manual(wing-name)
    $manual(wing-description)
    " } # initialize the wing table of contents puts $manual(wing-toc-fp) [htmlhead $manual(wing-name) \ $manual(wing-name) $overall_title "../[indexfile]"] # initialize the short table of contents for this section set manual(wing-toc) {} # initialize the man directory for this section makedirhier $outputDir/$manual(wing-file) # initialize the long table of contents for this section set manual(long-toc-n) 1 # get the manual pages for this section set manual(pages) [lsort -dictionary [glob -nocomplain $manual(wing-glob)]] # Some pages have to go first so that their links override others foreach pat $process_first_patterns { set n [lsearch -glob $manual(pages) $pat] if {$n >= 0} { set f [lindex $manual(pages) $n] puts stderr "shuffling [file tail $f] to front of processing queue" set manual(pages) \ [linsert [lreplace $manual(pages) $n $n] 0 $f] } } # set manual(pages) [lrange $manual(pages) 0 5] foreach manual_page $manual(pages) { set manual(page) [file normalize $manual_page] # whistle if {$verbose} { puts stderr "scanning page $manual(page)" } else { puts -nonewline stderr . } set manual(tail) [file tail $manual(page)] set manual(name) [file root $manual(tail)] set manual(section) {} if {$manual(name) in $excluded_pages} { # obsolete if {!$verbose} { puts stderr "" } manerror "discarding $manual(name)" continue } set manual(infp) [open $manual(page)] fconfigure $manual(infp) -encoding utf-8 set manual(text) {} set manual(partial-text) {} foreach p {.RS .DS .CS .SO} { set manual($p) 0 } set manual(stack) {} set manual(section) {} set manual(section-toc) {} set manual(section-toc-n) 1 set manual(copyrights) {} lappend manual(all-pages) $manual(wing-file)/$manual(tail) lappend manual(all-page-domains) $manual(wing-name) manreport 100 $manual(name) while {[gets $manual(infp) line] >= 0} { manreport 100 $line if {[regexp {^[`'][/\\]} $line]} { if {[regexp {Copyright (?:\(c\)|\\\(co).*$} $line copyright]} { lappend manual(copyrights) $copyright } # comment continue } if {"$line" eq {'}} { # comment continue } if {![parse-directive $line code rest]} { addbuffer $line continue } switch -exact -- $code { .if - .nr - .ti - .in - .ie - .el - .ad - .na - .so - .ne - .AS - .HS - .VE - .VS - . { # ignore continue } } switch -exact -- $code { .SH - .SS { flushbuffer if {[llength $rest] == 0} { gets $manual(infp) rest } lappend manual(text) "$code [unquote $rest]" } .TH { flushbuffer lappend manual(text) "$code [unquote $rest]" } .QW { lassign [regexp -all -inline {\"(?:[^""]+)\"|\S+} $rest] \ inQuote afterwards addbuffer $LQ [unquote $inQuote] $RQ [unquote $afterwards] } .PQ { lassign [regexp -all -inline {\"(?:[^""]+)\"|\S+} $rest] \ inQuote punctuation afterwards addbuffer ( $LQ [unquote $inQuote] $RQ \ [unquote $punctuation] ) [unquote $afterwards] } .QR { lassign [regexp -all -inline {\"(?:[^""]+)\"|\S+} $rest] \ rangeFrom rangeTo afterwards addbuffer $LQ [unquote $rangeFrom] "–" \ [unquote $rangeTo] $RQ [unquote $afterwards] } .MT { addbuffer $LQ$RQ } .HS - .UL - .ta { flushbuffer lappend manual(text) "$code [unquote $rest]" } .BS - .BE - .br - .fi - .sp - .nf { flushbuffer if {$rest ne ""} { if {!$verbose} { puts stderr "" } manerror "unexpected argument: $line" } lappend manual(text) $code } .AP { flushbuffer lappend manual(text) [concat .IP [process-text \ "[lindex $rest 0] \\fB[lindex $rest 1]\\fR ([lindex $rest 2])"]] } .IP { flushbuffer regexp {^(.*) +\d+$} $rest all rest lappend manual(text) ".IP [process-text \ [unquote [string trim $rest]]]" } .TP { flushbuffer while {[is-a-directive [set next [gets $manual(infp)]]]} { if {!$verbose} { puts stderr "" } manerror "ignoring $next after .TP" } if {"$next" ne {'}} { lappend manual(text) ".IP [process-text $next]" } } .OP { flushbuffer lassign $rest cmdName dbName dbClass lappend manual(text) [concat .OP [process-text \ "\\fB$cmdName\\fR \\fB$dbName\\fR \\fB$dbClass\\fR"]] } .PP - .LP { flushbuffer lappend manual(text) {.PP} } .RS { flushbuffer incr manual(.RS) lappend manual(text) $code } .RE { flushbuffer incr manual(.RS) -1 lappend manual(text) $code } .SO { flushbuffer incr manual(.SO) if {[llength $rest] == 0} { lappend manual(text) "$code options" } else { lappend manual(text) "$code [unquote $rest]" } } .SE { flushbuffer incr manual(.SO) -1 lappend manual(text) $code } .DS { flushbuffer incr manual(.DS) lappend manual(text) $code } .DE { flushbuffer incr manual(.DS) -1 lappend manual(text) $code } .CS { flushbuffer incr manual(.CS) lappend manual(text) $code } .CE { flushbuffer incr manual(.CS) -1 lappend manual(text) $code } .de { while {[gets $manual(infp) line] >= 0} { if {[string match "..*" $line]} { break } } } .. { if {!$verbose} { puts stderr "" } error "found .. outside of .de" } default { if {!$verbose} { puts stderr "" } flushbuffer manerror "unrecognized format directive: $line" } } } flushbuffer close $manual(infp) # fixups if {$manual(.RS) != 0} { if {!$verbose} { puts stderr "" } puts "unbalanced .RS .RE" } if {$manual(.DS) != 0} { if {!$verbose} { puts stderr "" } puts "unbalanced .DS .DE" } if {$manual(.CS) != 0} { if {!$verbose} { puts stderr "" } puts "unbalanced .CS .CE" } if {$manual(.SO) != 0} { if {!$verbose} { puts stderr "" } puts "unbalanced .SO .SE" } # output conversion open-text set haserror 0 if {[next-op-is .HS rest]} { set manual($manual(wing-file)-$manual(name)-title) \ "[join [lrange $rest 1 end] { }] [lindex $rest 0] manual page" } elseif {[next-op-is .TH rest]} { set manual($manual(wing-file)-$manual(name)-title) \ "[lindex $rest 0] manual page - [join [lrange $rest 4 end] { }]" } else { set haserror 1 if {!$verbose} { puts stderr "" } manerror "no .HS or .TH record found" } if {!$haserror} { while {[more-text]} { set line [next-text] if {[is-a-directive $line]} { output-directive $line } else { man-puts $line } } man-puts [copyout $manual(copyrights) "../"] set manual(wing-copyrights) [merge-copyrights \ $manual(wing-copyrights) $manual(copyrights)] } # # make the long table of contents for this page # set manual(toc-$manual(wing-file)-$manual(name)) \ [concat
    $manual(section-toc)
    ] } if {!$verbose} { puts stderr "" } if {![llength $manual(wing-toc)]} { fatal "not table of contents." } # # make the wing table of contents for the section # set width 0 foreach name $manual(wing-toc) { if {[string length $name] > $width} { set width [string length $name] } } set perline [expr {118 / $width}] set nrows [expr {([llength $manual(wing-toc)]+$perline)/$perline}] set n 0 catch {unset rows} foreach name [lsort -dictionary $manual(wing-toc)] { set tail $manual(name-$name) if {[llength $tail] > 1} { manerror "$name is defined in more than one file: $tail" set tail [lindex $tail [expr {[llength $tail]-1}]] } set tail [file tail $tail] if {[info exists manual(tooltip-$manual(wing-file)/$tail.html)]} { set tooltip $manual(tooltip-$manual(wing-file)/$tail.html) set tooltip [string map {[ {\[} ] {\]} $ {\$} \\ \\\\} $tooltip] regsub {^[^-]+-\s*(.)} $tooltip {[string totitle \1]} tooltip append rows([expr {$n%$nrows}]) \ " $name " } else { append rows([expr {$n%$nrows}]) \ " $name " } incr n } puts $manual(wing-toc-fp) foreach row [lsort -integer [array names rows]] { puts $manual(wing-toc-fp) $rows($row) } puts $manual(wing-toc-fp)
    # # insert wing copyrights # puts $manual(wing-toc-fp) [copyout $manual(wing-copyrights) "../"] puts $manual(wing-toc-fp) "" close $manual(wing-toc-fp) set manual(merge-copyrights) \ [merge-copyrights $manual(merge-copyrights) $manual(wing-copyrights)] } proc makedirhier {dir} { try { if {![file isdirectory $dir]} { file mkdir $dir } } on error msg { return -code error "cannot create directory $dir: $msg" } } proc addbuffer {args} { global manual if {$manual(partial-text) ne ""} { append manual(partial-text) \n } append manual(partial-text) [join $args ""] } proc flushbuffer {} { global manual if {$manual(partial-text) ne ""} { lappend manual(text) [process-text $manual(partial-text)] set manual(partial-text) "" } } return tcl9.0.3/tools/tclsh.svg0000644000175000017500000001534515076154271014564 0ustar sergeisergei tcl9.0.3/tools/regexpTestLib.tcl0000644000175000017500000001665015104661341016204 0ustar sergeisergei# regexpTestLib.tcl -- # # This file contains tcl procedures used by spencer2testregexp.tcl and # spencer2regexp.tcl, which are programs written to convert Henry # Spencer's test suite to tcl test files. # # Copyright © 1996 Sun Microsystems, Inc. proc readInputFile {} { global inFileName global lineArray set fileId [open $inFileName r] set i 0 while {[gets $fileId line] >= 0} { set len [string length $line] if {($len > 0) && ([string index $line [expr {$len - 1}]] eq "\\")} { if {[info exists lineArray(c$i)] == 0} { set lineArray(c$i) 1 } else { incr lineArray(c$i) } set line [string range $line 0 [expr {$len - 2}]] append lineArray($i) $line continue } if {[info exists lineArray(c$i)] == 0} { set lineArray(c$i) 1 } else { incr lineArray(c$i) } append lineArray($i) $line incr i } close $fileId return $i } # # strings with embedded @'s are truncated # unpreceded @'s are replaced by {} # proc removeAts {ls} { set len [llength $ls] set newLs {} foreach item $ls { regsub @.* $item "" newItem lappend newLs $newItem } return $newLs } proc convertErrCode {code} { set errMsg "cannot compile regular expression pattern:" if {[string compare $code "INVARG"] == 0} { return "$errMsg invalid argument to regex routine" } elseif {[string compare $code "BADRPT"] == 0} { return "$errMsg ?+* follows nothing" } elseif {[string compare $code "BADBR"] == 0} { return "$errMsg invalid repetition count(s)" } elseif {[string compare $code "BADOPT"] == 0} { return "$errMsg invalid embedded option" } elseif {[string compare $code "EPAREN"] == 0} { return "$errMsg unmatched ()" } elseif {[string compare $code "EBRACE"] == 0} { return "$errMsg unmatched {}" } elseif {[string compare $code "EBRACK"] == 0} { return "$errMsg unmatched \[\]" } elseif {[string compare $code "ERANGE"] == 0} { return "$errMsg invalid character range" } elseif {[string compare $code "ECTYPE"] == 0} { return "$errMsg invalid character class" } elseif {[string compare $code "ECOLLATE"] == 0} { return "$errMsg invalid collating element" } elseif {[string compare $code "EESCAPE"] == 0} { return "$errMsg invalid escape sequence" } elseif {[string compare $code "BADPAT"] == 0} { return "$errMsg invalid regular expression" } elseif {[string compare $code "ESUBREG"] == 0} { return "$errMsg invalid backreference number" } elseif {[string compare $code "IMPOSS"] == 0} { return "$errMsg can never match" } return "$errMsg $code" } proc writeOutputFile {numLines fcn} { global outFileName global lineArray # open output file and write file header info to it. set fileId [open $outFileName w] puts $fileId "# Commands covered: $fcn" puts $fileId "#" puts $fileId "# This Tcl-generated file contains tests for the $fcn tcl command." puts $fileId "# Sourcing this file into Tcl runs the tests and generates output for" puts $fileId "# errors. No output means no errors were found. Setting VERBOSE to" puts $fileId "# -1 will run tests that are known to fail." puts $fileId "#" puts $fileId "# Copyright © 1998 Sun Microsystems, Inc." puts $fileId "#" puts $fileId "# See the file \"license.terms\" for information on usage and redistribution" puts $fileId "# of this file, and for a DISCLAIMER OF ALL WARRANTIES." puts $fileId "#" puts $fileId "\# SCCS: \%Z\% \%M\% \%I\% \%E\% \%U\%" puts $fileId "\nproc print \{arg\} \{puts \$arg\}\n" puts $fileId "if \{\[string compare test \[info procs test\]\] == 1\} \{" puts $fileId " source defs ; set VERBOSE -1\n\}\n" puts $fileId "if \{\$VERBOSE != -1\} \{" puts $fileId " proc print \{arg\} \{\}\n\}\n" puts $fileId "#" puts $fileId "# The remainder of this file is Tcl tests that have been" puts $fileId "# converted from Henry Spencer's regexp test suite." puts $fileId "#\n" set lineNum 0 set srcLineNum 1 while {$lineNum < $numLines} { set currentLine $lineArray($lineNum) # copy comment string to output file and continue if {[string index $currentLine 0] eq "#"} { puts $fileId $currentLine incr srcLineNum $lineArray(c$lineNum) incr lineNum continue } set len [llength $currentLine] # copy empty string to output file and continue if {$len == 0} { puts $fileId "\n" incr srcLineNum $lineArray(c$lineNum) incr lineNum continue } if {($len < 3)} { puts "warning: test is too short --\n\t$currentLine" incr srcLineNum $lineArray(c$lineNum) incr lineNum continue } puts $fileId [convertTestLine $currentLine $len $lineNum $srcLineNum] incr srcLineNum $lineArray(c$lineNum) incr lineNum } close $fileId } proc convertTestLine {currentLine len lineNum srcLineNum} { regsub -all {(?b)\\} $currentLine {\\\\} currentLine set re [lindex $currentLine 0] set flags [lindex $currentLine 1] set str [lindex $currentLine 2] # based on flags, decide whether to skip the test if {[findSkipFlag $flags]} { regsub -all {\[|\]|\(|\)|\{|\}|\#} $currentLine {\&} line set msg "\# skipping char mapping test from line $srcLineNum\n" append msg "print \{... skip test from line $srcLineNum: $line\}" return $msg } # perform mapping if '=' flag exists set noBraces 0 if {[regexp {=|>} $flags] == 1} { regsub -all {_} $currentLine {\\ } currentLine regsub -all {A} $currentLine {\\x07} currentLine regsub -all {B} $currentLine {\\b} currentLine regsub -all {E} $currentLine {\\x1B} currentLine regsub -all {F} $currentLine {\\f} currentLine regsub -all {N} $currentLine {\\n} currentLine # if and \r substitutions are made, do not wrap re, flags, # str, and result in braces set noBraces [regsub -all {R} $currentLine {\\\x0D} currentLine] regsub -all {T} $currentLine {\\t} currentLine regsub -all {V} $currentLine {\\v} currentLine if {[regexp {=} $flags] == 1} { set re [lindex $currentLine 0] } set str [lindex $currentLine 2] } set flags [removeFlags $flags] # find the test result set numVars [expr {$len - 3}] set vars {} set vals {} set result 0 set v 0 if {[regsub {\*} "$flags" "" newFlags] == 1} { # an error is expected if {[string compare $str "EMPTY"] == 0} { # empty regexp is not an error # skip this test return "\# skipping the empty-re test from line $srcLineNum\n" } set flags $newFlags set result "\{1 \{[convertErrCode $str]\}\}" } elseif {$numVars > 0} { # at least 1 match is made if {[regexp {s} $flags] == 1} { set result "\{0 1\}" } else { while {$v < $numVars} { append vars " var($v)" append vals " \$var($v)" incr v } set tmp [removeAts [lrange $currentLine 3 $len]] set result "\{0 \{1 $tmp\}\}" if {$noBraces} { set result "\[subst $result\]" } } } else { # no match is made set result "\{0 0\}" } # set up the test and write it to the output file set cmd [prepareCmd $flags $re $str $vars $noBraces] if {$cmd == -1} { return "\# skipping test with metasyntax from line $srcLineNum\n" } set test "test regexp-1.$srcLineNum \{converted from line $srcLineNum\} \{\n" append test "\tcatch {unset var}\n" append test "\tlist \[catch \{\n" append test "\t\tset match \[$cmd\]\n" append test "\t\tlist \$match $vals\n" append test "\t\} msg\] \$msg\n" append test "\} $result\n" return $test } tcl9.0.3/tools/README0000644000175000017500000000077415104661341013577 0ustar sergeisergeiThis directory contains unsupported tools used to build parts of Tcl for distribution. uniParse.tcl -- Script for converting the Unicode character database into a compact table stored in generic/tclUniData.c. uniClass.tcl -- Script for generating regexp class tables from the Tcl "string is" classes Generating HTML files. This script is very picky about the organization of man pages, effectively acting as a style enforcer. The resulting documentation can be found at /tmp/dist/tcl/html tcl9.0.3/tools/mkVfs.tcl0000644000175000017500000000527615104661341014513 0ustar sergeisergeiproc cat fname { set fname [open $fname r] set data [read $fname] close $fname return $data } proc pkgIndexDir {root fout d1} { puts [format {%*sIndexing %s} [expr {4 * [info level]}] {} \ [file tail $d1]] set idx [string length $root] foreach ftail [glob -directory $d1 -nocomplain -tails *] { set f [file join $d1 $ftail] if {[file isdirectory $f] && [string compare CVS $ftail]} { pkgIndexDir $root $fout $f } elseif {[file tail $f] eq "pkgIndex.tcl"} { puts $fout "set dir \${VFSROOT}[string range $d1 $idx end]" puts $fout [cat $f] } } } ### # Script to build the VFS file system ### proc copyDir {d1 d2} { puts [format {%*sCreating %s} [expr {4 * [info level]}] {} \ [file tail $d2]] file delete -force -- $d2 file mkdir $d2 foreach ftail [glob -directory $d1 -nocomplain -tails *] { set f [file join $d1 $ftail] if {[file isdirectory $f] && [string compare CVS $ftail]} { copyDir $f [file join $d2 $ftail] } elseif {[file isfile $f]} { file copy -force $f [file join $d2 $ftail] if {$::tcl_platform(platform) eq {unix}} { file attributes [file join $d2 $ftail] -permissions 0o644 } else { file attributes [file join $d2 $ftail] -readonly 1 } } } if {$::tcl_platform(platform) eq {unix}} { file attributes $d2 -permissions 0o755 } else { file attributes $d2 -readonly 1 } } if {[llength $argv] < 3} { puts "Usage: VFS_ROOT TCLSRC_ROOT PLATFORM" exit 1 } set TCL_SCRIPT_DIR [lindex $argv 0] set TCLSRC_ROOT [lindex $argv 1] set PLATFORM [lindex $argv 2] set TKDLL [lindex $argv 3] set TKVER [lindex $argv 4] puts "Building [file tail $TCL_SCRIPT_DIR] for $PLATFORM" copyDir ${TCLSRC_ROOT}/library ${TCL_SCRIPT_DIR} if {$PLATFORM == "windows"} { set ddedll [glob -nocomplain ${TCLSRC_ROOT}/win/tcldde*.dll] puts "DDE DLL $ddedll" if {$ddedll != {}} { file copy $ddedll ${TCL_SCRIPT_DIR}/dde } set regdll [glob -nocomplain ${TCLSRC_ROOT}/win/tclreg*.dll] puts "REG DLL $ddedll" if {$regdll != {}} { file copy $regdll ${TCL_SCRIPT_DIR}/reg } } else { # Remove the dde and reg package paths file delete -force ${TCL_SCRIPT_DIR}/dde file delete -force ${TCL_SCRIPT_DIR}/reg } # For the following packages, cat their pkgIndex files to tclIndex file attributes ${TCL_SCRIPT_DIR}/tclIndex -readonly 0 set fout [open ${TCL_SCRIPT_DIR}/tclIndex a] puts $fout {# # MANIFEST OF INCLUDED PACKAGES # set VFSROOT $dir } if {$TKDLL ne {} && [file exists $TKDLL]} { file copy $TKDLL ${TCL_SCRIPT_DIR} puts $fout [list package ifneeded Tk $TKVER "load \$dir $TKDLL"] } pkgIndexDir ${TCL_SCRIPT_DIR} $fout ${TCL_SCRIPT_DIR} close $fout tcl9.0.3/tools/mkdepend.tcl0000644000175000017500000002207215104661341015205 0ustar sergeisergei#============================================================================== # # mkdepend : generate dependency information from C/C++ files # # Copyright © 1998, Nat Pryce # # Permission is hereby granted, without written agreement and without # license or royalty fees, to use, copy, modify, and distribute this # software and its documentation for any purpose, provided that the # above copyright notice and the following two paragraphs appear in # all copies of this software. # # IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, # SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF # THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED # OF THE POSSIBILITY OF SUCH DAMAGE. # # THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A # PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" # BASIS, AND THE AUTHOR HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, # UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #============================================================================== # # Modified heavily by David Gravereaux about 9/17/2006. # Original can be found @ # http://web.archive.org/web/20070616205924/http://www.doc.ic.ac.uk/~np2/software/mkdepend.html #============================================================================== array set mode_data {} set mode_data(vc32) {cl -nologo -E} set source_extensions [list .c .cpp .cxx .cc] set excludes [list] if [info exists env(INCLUDE)] { set rawExcludes [split [string trim $env(INCLUDE) ";"] ";"] foreach exclude $rawExcludes { lappend excludes [file normalize $exclude] } } # openOutput -- # # Opens the output file. # # Arguments: # file The file to open # # Results: # None. proc openOutput {file} { global output set output [open $file w] puts $output "# Automatically generated at [clock format [clock seconds] -format "%Y-%m-%dT%H:%M:%S"] by [info script]\n" } # closeOutput -- # # Closes output file. # # Arguments: # none # # Results: # None. proc closeOutput {} { global output if {[string match stdout $output] != 0} { close $output } } # readDepends -- # # Read off CCP pipe for #line references. # # Arguments: # chan The pipe channel we are reading in. # # Results: # Raw dependency list pairs. proc readDepends {chan} { set line "" array set depends {} while {[gets $chan line] >= 0} { if {[regexp {^#line [0-9]+ \"(.*)\"$} $line dummy fname] != 0} { set fname [file normalize $fname] if {![info exists target]} { # this is ourself set target $fname puts stderr "processing [file tail $fname]" } else { # don't include ourselves as a dependency of ourself. if {![string compare $fname $target]} {continue} # store in an array so multiple occurrences are not counted. set depends($target|$fname) "" } } } set result {} foreach n [array names depends] { set pair [split $n "|"] lappend result [list [lindex $pair 0] [lindex $pair 1]] } return $result } # writeDepends -- # # Write the processed list out to the file. # # Arguments: # out The channel to write to. # depends The list of dependency pairs # # Results: # None. proc writeDepends {out depends} { foreach pair $depends { puts $out "[lindex $pair 0] : \\\n\t[join [lindex $pair 1] " \\\n\t"]" } } # stringStartsWith -- # # Compares second string to the beginning of the first. # # Arguments: # str The string to test the beginning of. # prefix The string to test against # # Results: # the result of the comparison. proc stringStartsWith {str prefix} { set front [string range $str 0 [expr {[string length $prefix] - 1}]] return [expr {[string compare [string tolower $prefix] \ [string tolower $front]] == 0}] } # filterExcludes -- # # Remove non-project header files. # # Arguments: # depends List of dependency pairs. # excludes List of directories that should be removed # # Results: # the processed dependency list. proc filterExcludes {depends excludes} { set filtered {} foreach pair $depends { set excluded 0 set file [lindex $pair 1] foreach dir $excludes { if [stringStartsWith $file $dir] { set excluded 1 break; } } if {!$excluded} { lappend filtered $pair } } return $filtered } # replacePrefix -- # # Take the normalized search path and put back the # macro name for it. # # Arguments: # file filename. # # Results: # filename properly replaced with macro for it. proc replacePrefix {file} { global srcPathList srcPathReplaceList foreach was $srcPathList is $srcPathReplaceList { regsub $was $file $is file } return $file } # rebaseFiles -- # # Replaces normalized paths with original macro names. # # Arguments: # depends Dependency pair list. # # Results: # The processed dependency pair list. proc rebaseFiles {depends} { set rebased {} foreach pair $depends { lappend rebased [list \ [replacePrefix [lindex $pair 0]] \ [replacePrefix [lindex $pair 1]]] } return $rebased } # compressDeps -- # # Compresses same named tragets into one pair with # multiple deps. # # Arguments: # depends Dependency pair list. # # Results: # The processed list. proc compressDeps {depends} { array set compressed [list] foreach pair $depends { lappend compressed([lindex $pair 0]) [lindex $pair 1] } set result [list] foreach n [array names compressed] { lappend result [list $n [lsort $compressed($n)]] } return $result } # addSearchPath -- # # Adds a new set of path and replacement string to the global list. # # Arguments: # newPathInfo comma separated path and replacement string # # Results: # None. proc addSearchPath {newPathInfo} { global srcPathList srcPathReplaceList set infoList [split $newPathInfo ,] lappend srcPathList [file normalize [lindex $infoList 0]] lappend srcPathReplaceList [lindex $infoList 1] } # displayUsage -- # # Displays usage to stderr # # Arguments: # none. # # Results: # None. proc displayUsage {} { puts stderr "mkdepend.tcl \[options\] genericDir,macroName compatDir,macroName platformDir,macroName" } # readInputListFile -- # # Open and read the object file list. # # Arguments: # objectListFile - name of the file to open. # # Results: # None. proc readInputListFile {objectListFile} { global srcFileList srcPathList source_extensions set f [open $objectListFile r] set fl [read $f] close $f # fix native path separator so it isn't treated as an escape. regsub -all {\\} $fl {/} fl # Treat the string as a list so filenames between double quotes are # treated as list elements. foreach fname $fl { # Compiled .res resource files should be ignored. if {[file extension $fname] ne ".obj"} {continue} # Just filename without path or extension because the path is # the build directory, not where the source files are located. set baseName [file rootname [file tail $fname]] set found 0 foreach path $srcPathList { foreach ext $source_extensions { set test [file join $path ${baseName}${ext}] if {[file exist $test]} { lappend srcFileList $test set found 1 break } } if {$found} break } } } # main -- # # The main procedure of this script. # # Arguments: # none. # # Results: # None. proc main {} { global argc argv mode mode_data srcFileList srcPathList excludes global remove_prefix target_prefix output env set srcPathList [list] set srcFileList [list] if {$argc == 1} {displayUsage} # Parse mkdepend input for {set i 0} {$i < [llength $argv]} {incr i} { switch -glob -- [set arg [lindex $argv $i]] { -vc32 { set mode vc32 } -bc32 { set mode bc32 } -wc32 { set mode wc32 } -lc32 { set mode lc32 } -mgw32 { set mode mgw32 } -passthru:* { set passthru [string range $arg 10 end] regsub -all {"} $passthru {\"} passthru regsub -all {\\} $passthru {/} passthru } -out:* { openOutput [string range $arg 5 end] } @* { set objfile [string range $arg 1 end] regsub -all {\\} $objfile {/} objfile readInputListFile $objfile } -? - -help - --help { displayUsage exit 1 } default { if {![info exist mode]} { puts stderr "mode not set" displayUsage } addSearchPath $arg } } } # Execute the CPP command and parse output foreach srcFile $srcFileList { if {[catch { set command "$mode_data($mode) $passthru \"$srcFile\"" set input [open |$command r] set depends [readDepends $input] set status [catch {close $input} result] if {$status == 1 && [lindex $::errorCode 0] eq "CHILDSTATUS"} { foreach { - pid code } $::errorCode break if {$code == 2} { # preprocessor died a cruel death. error $result } } } err]} { puts stderr "error ocurred: $err\n" continue } set depends [filterExcludes $depends $excludes] set depends [rebaseFiles $depends] set depends [compressDeps $depends] writeDepends $output $depends } closeOutput } # kick it up. main tcl9.0.3/tools/makeTestCases.tcl0000755000175000017500000007762315104661341016171 0ustar sergeisergei# TODO - When integrating this with the Core, path names will need to be # swizzled here. package require msgcat set d [file dirname [file dirname [info script]]] puts "getting transition data from [file join $d library tzdata America Detroit]" source -encoding utf-8 [file join $d library/tzdata/America/Detroit] namespace eval ::tcl::clock { ::msgcat::mcmset en_US_roman { LOCALE_ERAS { {-62164627200 {} 0} {-59008867200 c 100} {-55853107200 cc 200} {-52697347200 ccc 300} {-49541587200 cd 400} {-46385827200 d 500} {-43230067200 dc 600} {-40074307200 dcc 700} {-36918547200 dccc 800} {-33762787200 cm 900} {-30607027200 m 1000} {-27451267200 mc 1100} {-24295507200 mcc 1200} {-21139747200 mccc 1300} {-17983987200 mcd 1400} {-14828227200 md 1500} {-11672467200 mdc 1600} {-8516707200 mdcc 1700} {-5364662400 mdccc 1800} {-2208988800 mcm 1900} {946684800 mm 2000} } LOCALE_NUMERALS { ? i ii iii iv v vi vii viii ix x xi xii xiii xiv xv xvi xvii xviii xix xx xxi xxii xxiii xxiv xxv xxvi xxvii xxviii xxix xxx xxxi xxxii xxxiii xxxiv xxxv xxxvi xxxvii xxxviii xxxix xl xli xlii xliii xliv xlv xlvi xlvii xlviii xlix l li lii liii liv lv lvi lvii lviii lix lx lxi lxii lxiii lxiv lxv lxvi lxvii lxviii lxix lxx lxxi lxxii lxxiii lxxiv lxxv lxxvi lxxvii lxxviii lxxix lxxx lxxxi lxxxii lxxxiii lxxxiv lxxxv lxxxvi lxxxvii lxxxviii lxxxix xc xci xcii xciii xciv xcv xcvi xcvii xcviii xcix c } DATE_FORMAT {%m/%d/%Y} TIME_FORMAT {%H:%M:%S} DATE_TIME_FORMAT {%x %X} LOCALE_DATE_FORMAT {die %Od mensis %Om annoque %EY} LOCALE_TIME_FORMAT {%OH h %OM m %OS s} LOCALE_DATE_TIME_FORMAT {%Ex %EX} } } #---------------------------------------------------------------------- # # listYears -- # # List the years to test in the common clock test cases. # # Parameters: # startOfYearArray - Name of an array in caller's scope that will # be initialized as # Results: # None # # Side effects: # Determines the year numbers of one common year, one leap year, one year # following a common year, and one year following a leap year -- starting # on each day of the week -- in the XIXth, XXth and XXIth centuries. # Initializes the given array to have keys equal to the year numbers and # values equal to [clock seconds] at the start of the corresponding # years. # #---------------------------------------------------------------------- proc listYears { startOfYearArray } { upvar 1 $startOfYearArray startOfYear # List years after 1970 set y 1970 set s 0 set dw 4 ;# Thursday while { $y < 2100 } { if { $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 } { set l 1 incr dw 366 set s2 [expr { $s + wide( 366 * 86400 ) }] } else { set l 0 incr dw 365 set s2 [expr { $s + wide( 365 * 86400 ) }] } set x [expr { $y >= 2037 }] set dw [expr {$dw % 7}] set c [expr { $y / 100 }] if { ![info exists do($x$c$dw$l)] } { set do($x$c$dw$l) $y set startOfYear($y) $s set startOfYear([expr {$y + 1}]) $s2 } set s $s2 incr y } # List years before 1970 set y 1970 set s 0 set dw 4; # Thursday while { $y >= 1801 } { set s0 $s incr dw 371 incr y -1 if { $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 } { set l 1 incr dw -366 set s [expr { $s - wide(366 * 86400) }] } else { set l 0 incr dw -365 set s [expr { $s - wide(365 * 86400) }] } set dw [expr {$dw % 7}] set c [expr { $y / 100 }] if { ![info exists do($c$dw$l)] } { set do($c$dw$l) $y set startOfYear($y) $s set startOfYear([expr {$y + 1}]) $s0 } } } #---------------------------------------------------------------------- # # processFile - # # Processes the 'clock.test' file, updating the test cases in it. # # Parameters: # None. # # Side effects: # Replaces the file with a new copy, constructing needed test cases. # #---------------------------------------------------------------------- proc processFile {d} { # Open two files set f1 [open [file join $d tests/clock.test] r] set f2 [open [file join $d tests/clock.new] w] # Copy leading portion of the test file set state {} while { [gets $f1 line] >= 0 } { switch -exact -- $state { {} { puts $f2 $line if { [regexp "^\# BEGIN (.*)" $line -> cases] && [string compare {} [info commands $cases]] } { set state inCaseSet $cases $f2 } } inCaseSet { if { [regexp "^\#\ END $cases\$" $line] } { puts $f2 $line set state {} } } } } # Rotate the files close $f1 close $f2 file delete -force [file join $d tests/clock.bak] file rename -force [file join $d tests/clock.test] \ [file join $d tests/clock.bak] file rename [file join $d tests/clock.new] [file join $d tests/clock.test] } #---------------------------------------------------------------------- # # testcases2 -- # # Outputs the 'clock-2.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for formatting in Gregorian calendar are written to the # output file. # #---------------------------------------------------------------------- proc testcases2 { f2 } { listYears startOfYear # Define the roman numerals set roman { ? i ii iii iv v vi vii viii ix x xi xii xiii xiv xv xvi xvii xviii xix xx xxi xxii xxiii xxiv xxv xxvi xxvii xxviii xxix xxx xxxi xxxii xxxiii xxxiv xxxv xxxvi xxxvii xxxviii xxxix xl xli xlii xliii xliv xlv xlvi xlvii xlviii xlix l li lii liii liv lv lvi lvii lviii lix lx lxi lxii lxiii lxiv lxv lxvi lxvii lxviii lxix lxx lxxi lxxii lxxiii lxxiv lxxv lxxvi lxxvii lxxviii lxxix lxxx lxxxi lxxxii lxxxiii lxxxiv lxxxv lxxxvi lxxxvii lxxxviii lxxxix xc xci xcii xciii xciv xcv xcvi xcvii xcviii xcix c } set romanc { ? c cc ccc cd d dc dcc dccc cm m mc mcc mccc mcd md mdc mdcc mdccc mcm mm mmc mmcc mmccc mmcd mmd mmdc mmdcc mmdccc mmcm mmm mmmc mmmcc mmmccc mmmcd mmmd mmmdc mmmdcc mmmdccc mmmcm } # Names of the months set short {{} Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec} set long { {} January February March April May June July August September October November December } # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test formatting of Gregorian year, month, day, all formats" puts $f2 "\# Formats tested: %b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y %EY" puts $f2 "" # Generate the test cases for the first and last day of every month # from 1896 to 2045 set n 0 foreach { y } [lsort -integer [array names startOfYear]] { set s [expr { $startOfYear($y) + wide(12*3600 + 34*60 + 56) }] set m 0 set yd 1 foreach hath { 31 28 31 30 31 30 31 31 30 31 30 31 } { incr m if { $m == 2 && ( $y%4 == 0 && $y%100 != 0 || $y%400 == 0 ) } { incr hath } set b [lindex $short $m] set B [lindex $long $m] set C [format %02d [expr { $y / 100 }]] set h $b set j [format %03d $yd] set mm [format %02d $m] set N [format %2d $m] set yy [format %02d [expr { $y % 100 }]] set J [expr { ( $s / 86400 ) + 2440588 }] set dt $y-$mm-01 set result "" append result $b " " $B " " \ $mm /01/ $y " 12:34:56 " \ "die i mensis " [lindex $roman $m] " annoque " \ [lindex $romanc [expr { $y / 100 }]] \ [lindex $roman [expr { $y % 100 }]] " " \ [lindex $roman 12] " h " [lindex $roman 34] " m " \ [lindex $roman 56] " s " \ $C " " [lindex $romanc [expr { $y / 100 }]] \ " 01 i 1 i " \ $h " " $j " " $J " " $mm " " [lindex $roman $m] " " $N \ " " $mm "/01/" $y \ " die i mensis " [lindex $roman $m] " annoque " \ [lindex $romanc [expr { $y / 100 }]] \ [lindex $roman [expr { $y % 100 }]] \ " " $yy " " [lindex $roman [expr { $y % 100 }]] " " $y puts $f2 "test clock-2.[incr n] {conversion of $dt} {" puts $f2 " clock format $s \\" puts $f2 "\t-format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \\" puts $f2 "\t-gmt true -locale en_US_roman" puts $f2 "} {$result}" set hm1 [expr { $hath - 1 }] incr s [expr { 86400 * ( $hath - 1 ) }] incr yd $hm1 set dd [format %02d $hath] set ee [format %2d $hath] set j [format %03d $yd] set J [expr { ( $s / 86400 ) + 2440588 }] set dt $y-$mm-$dd set result "" append result $b " " $B " " \ $mm / $dd / $y " 12:34:56 " \ "die " [lindex $roman $hath] " mensis " [lindex $roman $m] \ " annoque " \ [lindex $romanc [expr { $y / 100 }]] \ [lindex $roman [expr { $y % 100 }]] " " \ [lindex $roman 12] " h " [lindex $roman 34] " m " \ [lindex $roman 56] " s " \ $C " " [lindex $romanc [expr { $y / 100 }]] \ " " $dd " " [lindex $roman $hath] " " \ $ee " " [lindex $roman $hath] " "\ $h " " $j " " $J " " $mm " " [lindex $roman $m] " " $N \ " " $mm "/" $dd "/" $y \ " die " [lindex $roman $hath] " mensis " [lindex $roman $m] \ " annoque " \ [lindex $romanc [expr { $y / 100 }]] \ [lindex $roman [expr { $y % 100 }]] \ " " $yy " " [lindex $roman [expr { $y % 100 }]] " " $y puts $f2 "test clock-2.[incr n] {conversion of $dt} {" puts $f2 " clock format $s \\" puts $f2 "\t-format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \\" puts $f2 "\t-gmt true -locale en_US_roman" puts $f2 "} {$result}" incr s 86400 incr yd } } puts "testcases2: $n test cases" } #---------------------------------------------------------------------- # # testcases3 -- # # Generate test cases for ISO8601 calendar. # # Parameters: # f2 - Channel handle to the output file # # Results: # None # # Side effects: # Makes a test case for the first and last day of weeks 51, 52, and 1 # plus the first and last day of a year. Does so for each possible # weekday on which a Common Year or Leap Year can begin. # #---------------------------------------------------------------------- proc testcases3 { f2 } { listYears startOfYear set case 0 foreach { y } [lsort -integer [array names startOfYear]] { set secs $startOfYear($y) set ym1 [expr { $y - 1 }] set dow [expr { ( $secs / 86400 + 4 ) % 7}] switch -exact $dow { 0 { # Year starts on a Sunday. # Prior year started on a Friday or Saturday, and was # a 52-week year. # 1 January is ISO week 52 of the prior year. 2 January # begins ISO week 1 of the current year. # 1 January is week 1 according to %U. According to %W, # week 1 begins on 2 January testISO $f2 $ym1 52 1 [expr { $secs - 6*86400 }] testISO $f2 $ym1 52 6 [expr { $secs - 86400 }] testISO $f2 $ym1 52 7 $secs testISO $f2 $y 1 1 [expr { $secs + 86400 }] testISO $f2 $y 1 6 [expr { $secs + 6*86400}] testISO $f2 $y 1 7 [expr { $secs + 7*86400 }] testISO $f2 $y 2 1 [expr { $secs + 8*86400 }] } 1 { # Year starts on a Monday. # Previous year started on a Saturday or Sunday, and was # a 52-week year. # 1 January is ISO week 1 of the current year # According to %U, it's week 0 until 7 January # 1 January is week 1 according to %W testISO $f2 $ym1 52 1 [expr { $secs - 7*86400 }] testISO $f2 $ym1 52 6 [expr {$secs - 2*86400}] testISO $f2 $ym1 52 7 [expr { $secs - 86400 }] testISO $f2 $y 1 1 $secs testISO $f2 $y 1 6 [expr {$secs + 5*86400}] testISO $f2 $y 1 7 [expr { $secs + 6*86400 }] testISO $f2 $y 2 1 [expr { $secs + 7*86400 }] } 2 { # Year starts on a Tuesday. testISO $f2 $ym1 52 1 [expr { $secs - 8*86400 }] testISO $f2 $ym1 52 6 [expr {$secs - 3*86400}] testISO $f2 $ym1 52 7 [expr { $secs - 2*86400 }] testISO $f2 $y 1 1 [expr { $secs - 86400 }] testISO $f2 $y 1 2 $secs testISO $f2 $y 1 6 [expr {$secs + 4*86400}] testISO $f2 $y 1 7 [expr { $secs + 5*86400 }] testISO $f2 $y 2 1 [expr { $secs + 6*86400 }] } 3 { testISO $f2 $ym1 52 1 [expr { $secs - 9*86400 }] testISO $f2 $ym1 52 6 [expr {$secs - 4*86400}] testISO $f2 $ym1 52 7 [expr { $secs - 3*86400 }] testISO $f2 $y 1 1 [expr { $secs - 2*86400 }] testISO $f2 $y 1 3 $secs testISO $f2 $y 1 6 [expr {$secs + 3*86400}] testISO $f2 $y 1 7 [expr { $secs + 4*86400 }] testISO $f2 $y 2 1 [expr { $secs + 5*86400 }] } 4 { testISO $f2 $ym1 52 1 [expr { $secs - 10*86400 }] testISO $f2 $ym1 52 6 [expr {$secs - 5*86400}] testISO $f2 $ym1 52 7 [expr { $secs - 4*86400 }] testISO $f2 $y 1 1 [expr { $secs - 3*86400 }] testISO $f2 $y 1 4 $secs testISO $f2 $y 1 6 [expr {$secs + 2*86400}] testISO $f2 $y 1 7 [expr { $secs + 3*86400 }] testISO $f2 $y 2 1 [expr { $secs + 4*86400 }] } 5 { testISO $f2 $ym1 53 1 [expr { $secs - 4*86400 }] testISO $f2 $ym1 53 5 $secs testISO $f2 $ym1 53 6 [expr {$secs + 86400}] testISO $f2 $ym1 53 7 [expr { $secs + 2*86400 }] testISO $f2 $y 1 1 [expr { $secs + 3*86400 }] testISO $f2 $y 1 6 [expr {$secs + 8*86400}] testISO $f2 $y 1 7 [expr { $secs + 9*86400 }] testISO $f2 $y 2 1 [expr { $secs + 10*86400 }] } 6 { # messy case because previous year may have had 52 or 53 weeks if { $y%4 == 1 } { testISO $f2 $ym1 53 1 [expr { $secs - 5*86400 }] testISO $f2 $ym1 53 6 $secs testISO $f2 $ym1 53 7 [expr { $secs + 86400 }] } else { testISO $f2 $ym1 52 1 [expr { $secs - 5*86400 }] testISO $f2 $ym1 52 6 $secs testISO $f2 $ym1 52 7 [expr { $secs + 86400 }] } testISO $f2 $y 1 1 [expr { $secs + 2*86400 }] testISO $f2 $y 1 6 [expr { $secs + 7*86400 }] testISO $f2 $y 1 7 [expr { $secs + 8*86400 }] testISO $f2 $y 2 1 [expr { $secs + 9*86400 }] } } } puts "testcases3: $case test cases." } proc testISO { f2 G V u secs } { upvar 1 case case set longdays {Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday} set shortdays {Sun Mon Tue Wed Thu Fri Sat Sun} puts $f2 "test clock-3.[incr case] {ISO week-based calendar [format %04d-W%02d-%d $G $V $u]} {" puts $f2 " clock format $secs -format {%a %A %g %G %u %U %V %w %W} -gmt true; \# $G-W[format %02d $V]-$u" puts $f2 "} {[lindex $shortdays $u] [lindex $longdays $u]\ [format %02d [expr { $G % 100 }]] $G\ $u\ [clock format $secs -format %U -gmt true]\ [format %02d $V] [expr { $u % 7 }]\ [clock format $secs -format %W -gmt true]}" } #---------------------------------------------------------------------- # # testcases4 -- # # Makes the test cases that test formatting of time of day. # # Parameters: # f2 - Channel handle to the output file # # Results: # None. # # Side effects: # Writes test cases to the output. # #---------------------------------------------------------------------- proc testcases4 { f2 } { puts $f2 {} puts $f2 "\# Test formatting of time of day" puts $f2 "\# Format groups tested: %H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+" puts $f2 {} set i 0 set fmt "%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+" foreach { h romanH I romanI am } { 0 ? 12 xii AM 1 i 1 i AM 11 xi 11 xi AM 12 xii 12 xii PM 13 xiii 1 i PM 23 xxiii 11 xi PM } { set hh [format %02d $h] set II [format %02d $I] set hs [format %2d $h] set Is [format %2d $I] foreach { m romanM } { 0 ? 1 i 58 lviii 59 lix } { set mm [format %02d $m] foreach { s romanS } { 0 ? 1 i 58 lviii 59 lix } { set ss [format %02d $s] set x [expr { ( $h * 60 + $m ) * 60 + $s }] set result "" append result $hh " " $romanH " " $II " " $romanI " " \ $hs " " $romanH " " $Is " " $romanI " " $mm " " $romanM " " \ $am " " [string tolower $am] " " \ $II ":" $mm ":" $ss " " [string tolower $am] " " \ $hh ":" $mm " " \ $ss " " $romanS " " \ $hh ":" $mm ":" $ss " " \ $hh ":" $mm ":" $ss " " \ $romanH " h " $romanM " m " $romanS " s " \ "Thu Jan 1 " $hh : $mm : $ss " GMT 1970" puts $f2 "test clock-4.[incr i] { format time of day $hh:$mm:$ss } {" puts $f2 " clock format $x \\" puts $f2 " -format [list $fmt] \\" puts $f2 " -locale en_US_roman \\" puts $f2 " -gmt true" puts $f2 "} {$result}" } } } puts "testcases4: $i test cases." } #---------------------------------------------------------------------- # # testcases5 -- # # Generates the test cases for Daylight Saving Time # # Parameters: # f2 - Channel handle for the input file # # Results: # None. # # Side effects: # Makes test cases for each known or anticipated time change # in Detroit. # #---------------------------------------------------------------------- proc testcases5 { f2 } { variable TZData puts $f2 {} puts $f2 "\# Test formatting of Daylight Saving Time" puts $f2 {} set fmt {%H:%M:%S %z %Z} set i 0 puts $f2 "test clock-5.[incr i] {does Detroit exist} {" puts $f2 " clock format 0 -format {} -timezone :America/Detroit" puts $f2 " concat" puts $f2 "} {}" puts $f2 "test clock-5.[incr i] {does Detroit have a Y2038 problem} detroit {" puts $f2 " if { \[clock format 2158894800 -format %z -timezone :America/Detroit\] ne {-0400} } {" puts $f2 " concat {y2038 problem}" puts $f2 " } else {" puts $f2 " concat {ok}" puts $f2 " }" puts $f2 "} ok" foreach row $TZData(:America/Detroit) { foreach { t offset isdst tzname } $row break if { $t > -4000000000000 } { set conds [list detroit] if { $t > wide(0x7FFFFFFF) } { set conds [list detroit y2038] } incr t -1 set x [clock format $t -format {%Y-%m-%d %H:%M:%S} \ -timezone :America/Detroit] set r [clock format $t -format $fmt \ -timezone :America/Detroit] puts $f2 "test clock-5.[incr i] {time zone boundary case $x} [list $conds] {" puts $f2 " clock format $t -format [list $fmt] \\" puts $f2 " -timezone :America/Detroit" puts $f2 "} [list $r]" incr t set x [clock format $t -format {%Y-%m-%d %H:%M:%S} \ -timezone :America/Detroit] set r [clock format $t -format $fmt \ -timezone :America/Detroit] puts $f2 "test clock-5.[incr i] {time zone boundary case $x} [list $conds] {" puts $f2 " clock format $t -format [list $fmt] \\" puts $f2 " -timezone :America/Detroit" puts $f2 "} [list $r]" incr t set x [clock format $t -format {%Y-%m-%d %H:%M:%S} \ -timezone :America/Detroit] set r [clock format $t -format $fmt \ -timezone :America/Detroit] puts $f2 "test clock-5.[incr i] {time zone boundary case $x} [list $conds] {" puts $f2 " clock format $t -format [list $fmt] \\" puts $f2 " -timezone :America/Detroit" puts $f2 "} [list $r]" } } puts "testcases5: $i test cases" } #---------------------------------------------------------------------- # # testcases8 -- # # Outputs the 'clock-8.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing dates in ccyymmdd format are written to the # output file. # #---------------------------------------------------------------------- proc testcases8 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of ccyymmdd" puts $f2 "" set n 0 foreach year {1970 1971 2000 2001} { foreach month {01 12} { foreach day {02 31} { set scanned [clock scan $year$month$day -gmt true] foreach ccyy {%C%y %Y} { foreach mm {%b %B %h %m %Om %N} { foreach dd {%d %Od %e %Oe} { set string [clock format $scanned \ -format "$ccyy $mm $dd" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-8.[incr n] {parse ccyymmdd} {" puts $f2 " [list clock scan $string -format [list $ccyy $mm $dd] -locale en_US_roman -gmt 1]" puts $f2 "} $scanned" } } } foreach fmt {%x %D} { set string [clock format $scanned \ -format $fmt \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-8.[incr n] {parse ccyymmdd} {" puts $f2 " [list clock scan $string -format $fmt -locale en_US_roman -gmt 1]" puts $f2 "} $scanned" } } } } puts "testcases8: $n test cases" } #---------------------------------------------------------------------- # # testcases11 -- # # Outputs the 'clock-11.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for precedence among YYYYMMDD and YYYYDDD are written # to f2. # #---------------------------------------------------------------------- proc testcases11 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test precedence among yyyymmdd and yyyyddd" puts $f2 "" array set v { Y 1970 m 01 d 01 j 002 } set n 0 foreach {a b c d} { Y m d j m Y d j d Y m j j Y m d Y m j d m Y j d d Y j m j Y d m Y d m j m d Y j d m Y j j m Y d Y d j m m d j Y d m j Y j m d Y Y j m d m j Y d d j Y m j d Y m Y j d m m j d Y d j m Y j d m Y } { foreach x [list $a $b $c $d] { switch -exact -- $x { m - d { set value 0 } j { set value 86400 } } } set format "%$a%$b%$c%$d" set string "$v($a)$v($b)$v($c)$v($d)" puts $f2 "test clock-11.[incr n] {precedence of ccyyddd and ccyymmdd} {" puts $f2 " [list clock scan $string -format $format -gmt 1]" puts $f2 "} $value" } puts "testcases11: $n test cases" } #---------------------------------------------------------------------- # # testcases12 -- # # Outputs the 'clock-12.x' test cases, parsing CCyyWwwd # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing dates in Gregorian calendar are written to the # output file. # #---------------------------------------------------------------------- proc testcases12 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of ccyyWwwd" puts $f2 "" set n 0 foreach year {1970 1971 2000 2001} { foreach month {01 12} { foreach day {02 31} { set scanned [clock scan $year$month$day -gmt true] foreach d {%a %A %u %w %Ou %Ow} { set string [clock format $scanned \ -format "%G W%V $d" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-12.[incr n] {parse ccyyWwwd} {" puts $f2 " [list clock scan $string -format [list %G W%V $d] -locale en_US_roman -gmt 1]" puts $f2 "} $scanned" } } } } puts "testcases12: $n test cases" } #---------------------------------------------------------------------- # # testcases14 -- # # Outputs the 'clock-14.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing yymmdd dates are output. # #---------------------------------------------------------------------- proc testcases14 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of yymmdd" puts $f2 "" set n 0 foreach year {1938 1970 2000 2037} { foreach month {01 12} { foreach day {02 31} { set scanned [clock scan $year$month$day -gmt true] foreach yy {%y %Oy} { foreach mm {%b %B %h %m %Om %N} { foreach dd {%d %Od %e %Oe} { set string [clock format $scanned \ -format "$yy $mm $dd" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-14.[incr n] {parse yymmdd} {" puts $f2 " [list clock scan $string -format [list $yy $mm $dd] -locale en_US_roman -gmt 1]" puts $f2 "} $scanned" } } } } } } puts "testcases14: $n test cases" } #---------------------------------------------------------------------- # # testcases17 -- # # Outputs the 'clock-17.x' test cases, parsing yyWwwd # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing dates in Gregorian calendar are written to the # output file. # #---------------------------------------------------------------------- proc testcases17 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of yyWwwd" puts $f2 "" set n 0 foreach year {1970 1971 2000 2001} { foreach month {01 12} { foreach day {02 31} { set scanned [clock scan $year$month$day -gmt true] foreach d {%a %A %u %w %Ou %Ow} { set string [clock format $scanned \ -format "%g W%V $d" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-17.[incr n] {parse yyWwwd} {" puts $f2 " [list clock scan $string -format [list %g W%V $d] -locale en_US_roman -gmt 1]" puts $f2 "} $scanned" } } } } puts "testcases17: $n test cases" } #---------------------------------------------------------------------- # # testcases19 -- # # Outputs the 'clock-19.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing mmdd dates are output. # #---------------------------------------------------------------------- proc testcases19 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of mmdd" puts $f2 "" set n 0 foreach year {1938 1970 2000 2037} { set base [clock scan ${year}0101 -gmt true] foreach month {01 12} { foreach day {02 31} { set scanned [clock scan $year$month$day -gmt true] foreach mm {%b %B %h %m %Om %N} { foreach dd {%d %Od %e %Oe} { set string [clock format $scanned \ -format "$mm $dd" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-19.[incr n] {parse mmdd} {" puts $f2 " [list clock scan $string -format [list $mm $dd] -locale en_US_roman -base $base -gmt 1]" puts $f2 "} $scanned" } } } } } puts "testcases19: $n test cases" } #---------------------------------------------------------------------- # # testcases21 -- # # Outputs the 'clock-21.x' test cases, parsing Wwwd # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing dates in Gregorian calendar are written to the # output file. # #---------------------------------------------------------------------- proc testcases22 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of Wwwd" puts $f2 "" set n 0 foreach year {1970 1971 2000 2001} { set base [clock scan ${year}0104 -gmt true] foreach month {03 10} { foreach day {01 31} { set scanned [clock scan $year$month$day -gmt true] foreach d {%a %A %u %w %Ou %Ow} { set string [clock format $scanned \ -format "W%V $d" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-22.[incr n] {parse Wwwd} {" puts $f2 " [list clock scan $string -format [list W%V $d] -locale en_US_roman -gmt 1] -base $base" puts $f2 "} $scanned" } } } } puts "testcases22: $n test cases" } #---------------------------------------------------------------------- # # testcases24 -- # # Outputs the 'clock-24.x' test cases. # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing naked day of the month are output. # #---------------------------------------------------------------------- proc testcases24 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of naked day-of-month" puts $f2 "" set n 0 foreach year {1970 2000} { foreach month {01 12} { set base [clock scan ${year}${month}01 -gmt true] foreach day {02 28} { set scanned [clock scan $year$month$day -gmt true] foreach dd {%d %Od %e %Oe} { set string [clock format $scanned \ -format "$dd" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-24.[incr n] {parse naked day of month} {" puts $f2 " [list clock scan $string -format $dd -locale en_US_roman -base $base -gmt 1]" puts $f2 "} $scanned" } } } } puts "testcases24: $n test cases" } #---------------------------------------------------------------------- # # testcases26 -- # # Outputs the 'clock-26.x' test cases, parsing naked day of week # # Parameters: # f2 -- Channel handle to the output file # # Results: # None. # # Side effects: # Test cases for parsing dates in Gregorian calendar are written to the # output file. # #---------------------------------------------------------------------- proc testcases26 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of naked day of week" puts $f2 "" set n 0 foreach year {1970 2001} { foreach week {01 52} { set base [clock scan ${year}W${week}4 \ -format %GW%V%u -gmt true] foreach day {1 7} { set scanned [clock scan ${year}W${week}${day} \ -format %GW%V%u -gmt true] foreach d {%a %A %u %w %Ou %Ow} { set string [clock format $scanned \ -format "$d" \ -locale en_US_roman \ -gmt true] puts $f2 "test clock-26.[incr n] {parse naked day of week} {" puts $f2 " [list clock scan $string -format $d -locale en_US_roman -gmt 1] -base $base" puts $f2 "} $scanned" } } } } puts "testcases26: $n test cases" } #---------------------------------------------------------------------- # # testcases29 -- # # Makes test cases for parsing of time of day. # # Parameters: # f2 -- Channel where tests are to be written # # Results: # None. # # Side effects: # Writes the tests. # #---------------------------------------------------------------------- proc testcases29 { f2 } { # Put out a header describing the tests puts $f2 "" puts $f2 "\# Test parsing of time of day" puts $f2 "" set n 0 foreach hour {0 1 11 12 13 23} \ hampm {12 1 11 12 1 11} \ lhour {? i xi xii xiii xxiii} \ lhampm {xii i xi xii i xi} \ ampmind {am am am pm pm pm} { set sphr [format %2d $hour] set 2dhr [format %02d $hour] set sphampm [format %2d $hampm] set 2dhampm [format %02d $hampm] set AMPMind [string toupper $ampmind] foreach minute {00 01 59} lminute {? i lix} { foreach second {00 01 59} lsecond {? i lix} { set time [expr { ( 60 * $hour + $minute ) * 60 + $second }] foreach {hfmt afmt} [list \ %H {} %k {} %OH {} %Ok {} \ %I %p %l %p \ %OI %p %Ol %p \ %I %P %l %P \ %OI %P %Ol %P] \ {hfld afld} [list \ $2dhr {} $sphr {} $lhour {} $lhour {} \ $2dhampm $AMPMind $sphampm $AMPMind \ $lhampm $AMPMind $lhampm $AMPMind \ $2dhampm $ampmind $sphampm $ampmind \ $lhampm $ampmind $lhampm $ampmind] \ { if { $second eq "00" } { if { $minute eq "00" } { puts $f2 "test clock-29.[incr n] {time parsing} {" puts $f2 " clock scan {2440588 $hfld $afld} \\" puts $f2 " -gmt true -locale en_US_roman \\" puts $f2 " -format {%J $hfmt $afmt}" puts $f2 "} $time" } puts $f2 "test clock-29.[incr n] {time parsing} {" puts $f2 " clock scan {2440588 $hfld:$minute $afld} \\" puts $f2 " -gmt true -locale en_US_roman \\" puts $f2 " -format {%J $hfmt:%M $afmt}" puts $f2 "} $time" puts $f2 "test clock-29.[incr n] {time parsing} {" puts $f2 " clock scan {2440588 $hfld:$lminute $afld} \\" puts $f2 " -gmt true -locale en_US_roman \\" puts $f2 " -format {%J $hfmt:%OM $afmt}" puts $f2 "} $time" } puts $f2 "test clock-29.[incr n] {time parsing} {" puts $f2 " clock scan {2440588 $hfld:$minute:$second $afld} \\" puts $f2 " -gmt true -locale en_US_roman \\" puts $f2 " -format {%J $hfmt:%M:%S $afmt}" puts $f2 "} $time" puts $f2 "test clock-29.[incr n] {time parsing} {" puts $f2 " clock scan {2440588 $hfld:$lminute:$lsecond $afld} \\" puts $f2 " -gmt true -locale en_US_roman \\" puts $f2 " -format {%J $hfmt:%OM:%OS $afmt}" puts $f2 "} $time" } } } } puts "testcases29: $n test cases" } processFile $d tcl9.0.3/tools/loadICU.tcl0000755000175000017500000004551115104661341014704 0ustar sergeisergei#---------------------------------------------------------------------- # # loadICU,tcl -- # # Extracts locale strings from a distribution of ICU # (http://oss.software.ibm.com/developerworks/opensource/icu/project/) # and makes Tcl message catalogs for the 'clock' command. # # Usage: # loadICU.tcl sourceDir destDir # # Parameters: # sourceDir -- Path name of the 'data' directory of your ICU4C # distribution. # destDir -- Directory into which the Tcl message catalogs should go. # # Results: # None. # # Side effects: # Creates the message catalogs. # #---------------------------------------------------------------------- # # Copyright © 2004 Kevin B. Kenny. All rights reserved. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- puts stdout "TODO: output in UTF-8 in stead of using \\uhhhh sequences" exit; # Remove those two lines after modifying this tool. # Calculate the Chinese numerals from zero to ninety-nine. set zhDigits [list {} \u4e00 \u4e8c \u4e09 \u56db \ \u4e94 \u516d \u4e03 \u516b \u4e5d] set t 0 foreach zt $zhDigits { if { $t == 0 } { set zt {} } elseif { $t == 10 } { set zt \u5341 } else { append zt \u5341 } set d 0 foreach zd $zhDigits { if { $t == 0 && $d == 0 } { set zd \u3007 } elseif { $t == 20 && $d != 0 } { set zt \u5eff } elseif { $t == 30 && $d != 0 } { set zt \u5345 } lappend zhNumbers $zt$zd incr d } incr t 10 } # Set format overrides for various locales. set format(zh,LOCALE_NUMERALS) $zhNumbers set format(ja,LOCALE_ERAS) [list \ [list -9223372036854775808 \u897f\u66a6 0 ] \ [list -3061011600 \u660e\u6cbb 1867] \ [list -1812186000 \u5927\u6b63 1911] \ [list -1357635600 \u662d\u548c 1925] \ [list 600220800 \u5e73\u6210 1988]] set format(zh,LOCALE_DATE_FORMAT) "\u516c\u5143%Y\u5e74%B%Od\u65E5" set format(ja,LOCALE_DATE_FORMAT) "%EY\u5e74%m\u6708%d\u65E5" set format(ko,LOCALE_DATE_FORMAT) "%Y\ub144%B%Od\uc77c" set format(zh,LOCALE_TIME_FORMAT) "%OH\u65f6%OM\u5206%OS\u79d2" set format(ja,LOCALE_TIME_FORMAT) "%H\u6642%M\u5206%S\u79d2" set format(ko,LOCALE_TIME_FORMAT) "%H\uc2dc%M\ubd84%S\ucd08" set format(zh,LOCALE_DATE_TIME_FORMAT) "%A %Y\u5e74%B%Od\u65E5%OH\u65f6%OM\u5206%OS\u79d2 %z" set format(ja,LOCALE_DATE_TIME_FORMAT) "%EY\u5e74%m\u6708%d\u65E5 (%a) %H\u6642%M\u5206%S\u79d2 %z" set format(ko,LOCALE_DATE_TIME_FORMAT) "%A %Y\ub144%B%Od\uc77c%H\uc2dc%M\ubd84%S\ucd08 %z" set format(ja,TIME_FORMAT_12) {%P %I:%M:%S} # The next set of format overrides were obtained from the glibc # localization strings. set format(cs_CZ,DATE_FORMAT) %d.%m.%Y set format(cs_CZ,DATE_TIME_FORMAT) {%a %e. %B %Y, %H:%M:%S %z} set format(cs_CZ,TIME_FORMAT) %H:%M:%S set format(cs_CZ,TIME_FORMAT_12) %I:%M:%S set format(da_DK,DATE_FORMAT) %d-%m-%Y set format(da_DK,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(da_DK,TIME_FORMAT) %T set format(da_DK,TIME_FORMAT_12) %T set format(de_AT,DATE_FORMAT) %Y-%m-%d set format(de_AT,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(de_AT,TIME_FORMAT) %T set format(de_AT,TIME_FORMAT_12) %T set format(de_BE,DATE_FORMAT) %Y-%m-%d set format(de_BE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(de_BE,TIME_FORMAT) %T set format(de_BE,TIME_FORMAT_12) %T set format(de_CH,DATE_FORMAT) %Y-%m-%d set format(de_CH,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(de_CH,TIME_FORMAT) %T set format(de_CH,TIME_FORMAT_12) %T set format(de_DE,DATE_FORMAT) %Y-%m-%d set format(de_DE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(de_DE,TIME_FORMAT) %T set format(de_DE,TIME_FORMAT_12) %T set format(de_LU,DATE_FORMAT) %Y-%m-%d set format(de_LU,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(de_LU,TIME_FORMAT) %T set format(de_LU,TIME_FORMAT_12) %T set format(en_CA,DATE_FORMAT) %d/%m/%y set format(en_CA,DATE_TIME_FORMAT) {%a %d %b %Y %r %z} set format(en_CA,TIME_FORMAT) %r set format(en_CA,TIME_FORMAT_12) {%I:%M:%S %p} set format(en_DK,DATE_FORMAT) %Y-%m-%d set format(en_DK,DATE_TIME_FORMAT) {%Y-%m-%dT%T %z} set format(en_DK,TIME_FORMAT) %T set format(en_DK,TIME_FORMAT_12) %T set format(en_GB,DATE_FORMAT) %d/%m/%y set format(en_GB,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(en_GB,TIME_FORMAT) %T set format(en_GB,TIME_FORMAT_12) %T set format(en_IE,DATE_FORMAT) %d/%m/%y set format(en_IE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(en_IE,TIME_FORMAT) %T set format(en_IE,TIME_FORMAT_12) %T set format(en_US,DATE_FORMAT) %m/%d/%y set format(en_US,DATE_TIME_FORMAT) {%a %d %b %Y %r %z} set format(en_US,TIME_FORMAT) %r set format(en_US,TIME_FORMAT_12) {%I:%M:%S %p} set format(es_ES,DATE_FORMAT) %d/%m/%y set format(es_ES,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(es_ES,TIME_FORMAT) %T set format(es_ES,TIME_FORMAT_12) %T set format(et_EE,DATE_FORMAT) %d.%m.%Y set format(et_EE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(et_EE,TIME_FORMAT) %T set format(et_EE,TIME_FORMAT_12) %T set format(eu_ES,DATE_FORMAT) {%a, %Yeko %bren %da} set format(eu_ES,DATE_TIME_FORMAT) {%y-%m-%d %T %z} set format(eu_ES,TIME_FORMAT) %T set format(eu_ES,TIME_FORMAT_12) %T set format(fi_FI,DATE_FORMAT) %d.%m.%Y set format(fi_FI,DATE_TIME_FORMAT) {%a %e %B %Y %T} set format(fi_FI,TIME_FORMAT) %T set format(fi_FI,TIME_FORMAT_12) %T set format(fo_FO,DATE_FORMAT) %d/%m-%Y set format(fo_FO,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fo_FO,TIME_FORMAT) %T set format(fo_FO,TIME_FORMAT_12) %T set format(fr_BE,DATE_FORMAT) %d/%m/%y set format(fr_BE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fr_BE,TIME_FORMAT) %T set format(fr_BE,TIME_FORMAT_12) %T set format(fr_CA,DATE_FORMAT) %Y-%m-%d set format(fr_CA,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fr_CA,TIME_FORMAT) %T set format(fr_CA,TIME_FORMAT_12) %T set format(fr_CH,DATE_FORMAT) {%d. %m. %y} set format(fr_CH,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fr_CH,TIME_FORMAT) %T set format(fr_CH,TIME_FORMAT_12) %T set format(fr_FR,DATE_FORMAT) %d.%m.%Y set format(fr_FR,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fr_FR,TIME_FORMAT) %T set format(fr_FR,TIME_FORMAT_12) %T set format(fr_LU,DATE_FORMAT) %d.%m.%Y set format(fr_LU,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(fr_LU,TIME_FORMAT) %T set format(fr_LU,TIME_FORMAT_12) %T set format(ga_IE,DATE_FORMAT) %d.%m.%y set format(ga_IE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(ga_IE,TIME_FORMAT) %T set format(ga_IE,TIME_FORMAT_12) %T set format(gr_GR,DATE_FORMAT) %d/%m/%Y set format(gr_GR,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(gr_GR,TIME_FORMAT) %T set format(gr_GR,TIME_FORMAT_12) %T set format(hr_HR,DATE_FORMAT) %d.%m.%y set format(hr_HR,DATE_TIME_FORMAT) {%a %d %b %Y %T} set format(hr_HR,TIME_FORMAT) %T set format(hr_HR,TIME_FORMAT_12) %T set format(hu_HU,DATE_FORMAT) %Y-%m-%d set format(hu_HU,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(hu_HU,TIME_FORMAT) %T set format(hu_HU,TIME_FORMAT_12) %T set format(is_IS,DATE_FORMAT) {%a %e.%b %Y} set format(is_IS,DATE_TIME_FORMAT) {%a %e.%b %Y, %T %z} set format(is_IS,TIME_FORMAT) %T set format(is_IS,TIME_FORMAT_12) %T set format(it_IT,DATE_FORMAT) %d/%m/%Y set format(it_IT,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(it_IT,TIME_FORMAT) %T set format(it_IT,TIME_FORMAT_12) %T set format(iw_IL,DATE_FORMAT) %d/%m/%y set format(iw_IL,DATE_TIME_FORMAT) {%z %H:%M:%S %Y %b %d %a} set format(iw_IL,TIME_FORMAT) %H:%M:%S set format(iw_IL,TIME_FORMAT_12) {%I:%M:%S %P} set format(kl_GL,DATE_FORMAT) {%d %b %Y} set format(kl_GL,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(kl_GL,TIME_FORMAT) %T set format(kl_GL,TIME_FORMAT_12) %T set format(lt_LT,DATE_FORMAT) %Y.%m.%d set format(lt_LT,DATE_TIME_FORMAT) {%Y m. %B %d d. %T} set format(lt_LT,TIME_FORMAT) %T set format(lt_LT,TIME_FORMAT_12) %T set format(lv_LV,DATE_FORMAT) %Y.%m.%d. set format(lv_LV,DATE_TIME_FORMAT) {%A, %Y. gada %e. %B, plkst. %H un %M} set format(lv_LV,TIME_FORMAT) %T set format(lv_LV,TIME_FORMAT_12) %T set format(nl_BE,DATE_FORMAT) %d-%m-%y set format(nl_BE,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(nl_BE,TIME_FORMAT) %T set format(nl_BE,TIME_FORMAT_12) %T set format(nl_NL,DATE_FORMAT) %d-%m-%y set format(nl_NL,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(nl_NL,TIME_FORMAT) %T set format(nl_NL,TIME_FORMAT_12) %T set format(no_NO,DATE_FORMAT) %d-%m-%Y set format(no_NO,DATE_TIME_FORMAT) {%a %d-%m-%Y %T %z} set format(no_NO,TIME_FORMAT) %T set format(no_NO,TIME_FORMAT_12) %T set format(pl_PL,DATE_FORMAT) %Y-%m-%d set format(pl_PL,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(pl_PL,TIME_FORMAT) %T set format(pl_PL,TIME_FORMAT_12) %T set format(pt_BR,DATE_FORMAT) %d-%m-%Y set format(pt_BR,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(pt_BR,TIME_FORMAT) %T set format(pt_BR,TIME_FORMAT_12) %T set format(pt_PT,DATE_FORMAT) %d-%m-%Y set format(pt_PT,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(pt_PT,TIME_FORMAT) %T set format(pt_PT,TIME_FORMAT_12) %T set format(ro_RO,DATE_FORMAT) %Y-%m-%d set format(ro_RO,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(ro_RO,TIME_FORMAT) %T set format(ro_RO,TIME_FORMAT_12) %T set format(ru_RU,DATE_FORMAT) %d.%m.%Y set format(ru_RU,DATE_TIME_FORMAT) {%a %d %b %Y %T} set format(ru_RU,TIME_FORMAT) %T set format(ru_RU,TIME_FORMAT_12) %T set format(sl_SI,DATE_FORMAT) %d.%m.%Y set format(sl_SI,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(sl_SI,TIME_FORMAT) %T set format(sl_SI,TIME_FORMAT_12) %T set format(sv_FI,DATE_FORMAT) %Y-%m-%d set format(sv_FI,DATE_TIME_FORMAT) {%a %e %b %Y %H.%M.%S} set format(sv_FI,TIME_FORMAT) %H.%M.%S set format(sv_FI,TIME_FORMAT_12) %H.%M.%S set format(sv_SE,DATE_FORMAT) %Y-%m-%d set format(sv_SE,DATE_TIME_FORMAT) {%a %e %b %Y %H.%M.%S} set format(sv_SE,TIME_FORMAT) %H.%M.%S set format(sv_SE,TIME_FORMAT_12) %H.%M.%S set format(tr_TR,DATE_FORMAT) %Y-%m-%d set format(tr_TR,DATE_TIME_FORMAT) {%a %d %b %Y %T %z} set format(tr_TR,TIME_FORMAT) %T set format(tr_TR,TIME_FORMAT_12) %T #---------------------------------------------------------------------- # # handleLocaleFile -- # # Extracts strings from an ICU locale definition. # # Parameters: # localeName - Name of the locale (e.g., de_AT_euro) # fileName - Name of the file containing the data # msgFileName - Name of the file containing the Tcl message catalog # # Results: # None. # # Side effects: # Writes the Tcl message catalog. # #---------------------------------------------------------------------- proc handleLocaleFile { localeName fileName msgFileName } { variable format # Get the content of the ICU file set f [open $fileName r] fconfigure $f -encoding utf-8 set data [read $f] close $f # Parse the ICU data set state {} foreach line [split $data \n] { switch -exact -- $state { {} { # Look for the beginnings of data blocks switch -regexp -- $line { {^[[:space:]]*AmPmMarkers[[:space:]]+[\{]} { set state data set key AmPmMarkers } {^[[:space:]]*DateTimePatterns[[:space:]]+[\{]} { set state data set key DateTimePatterns } {^[[:space:]]*DayAbbreviations[[:space:]]+[\{]} { set state data set key DayAbbreviations } {^[[:space:]]*DayNames[[:space:]]+[\{]} { set state data set key DayNames } {^[[:space:]]*Eras[[:space:]]+[\{]} { set state data set key Eras } {^[[:space:]]*MonthAbbreviations[[:space:]]+[\{]} { set state data set key MonthAbbreviations } {^[[:space:]]*MonthNames[[:space:]]+[\{]} { set state data set key MonthNames } } } data { # Inside a data block, collect the strings, doing backslash # expansion to pick up the Unicodes if { [regexp {"(.*)",} $line -> item] } { lappend items($key) [subst -nocommands -novariables $item] } elseif { [regexp {^[[:space:]]*[\}][[:space:]]*$} $line] } { set state {} } } } } # Skip locales that don't change time strings. if {![array exists items]} return # Write the Tcl message catalog set f [open $msgFileName w] # Write a header puts $f "\# created by $::argv0 -- do not edit" puts $f "namespace eval ::tcl::clock \{" # Do ordinary sets of strings (weekday and month names) foreach key { DayAbbreviations DayNames MonthAbbreviations MonthNames } tkey { DAYS_OF_WEEK_ABBREV DAYS_OF_WEEK_FULL MONTHS_ABBREV MONTHS_FULL } { if { [info exists items($key)] } { set itemList $items($key) set cmd1 " ::msgcat::mcset " append cmd1 $localeName " " $tkey " \[list " foreach item $itemList { append cmd1 \\\n { } \" [backslashify $item] \" } append cmd1 \] puts $f $cmd1 } } # Do the eras, B.C.E., and C.E. if { [info exists items(Eras)] } { foreach { bce ce } $items(Eras) break set cmd " ::msgcat::mcset " append cmd $localeName " " BCE " \"" [backslashify $bce] \" puts $f $cmd set cmd " ::msgcat::mcset " append cmd $localeName " " CE " \"" [backslashify $ce] \" puts $f $cmd } # Do the AM and PM markers if { [info exists items(AmPmMarkers)] } { foreach { am pm } $items(AmPmMarkers) break set cmd " ::msgcat::mcset " append cmd $localeName " " AM " \"" [backslashify $am] \" puts $f $cmd set cmd " ::msgcat::mcset " append cmd $localeName " " PM " \"" [backslashify $pm] \" puts $f $cmd } # Do the date/time patterns. First date... if { [info exists format($localeName,DATE_FORMAT)] || [info exists items(DateTimePatterns)] } { # Find the shortest date format that includes a 4-digit year. if { ![info exists format($localeName,DATE_FORMAT)] } { for { set i 7 } { $i >= 4 } { incr i -1 } { if { [regexp yyyy [lindex $items(DateTimePatterns) $i]] } { break } } set fmt \ [backslashify \ [percentify [lindex $items(DateTimePatterns) $i]]] set format($localeName,DATE_FORMAT) $fmt } # Put it to the message catalog set cmd " ::msgcat::mcset " append cmd $localeName " DATE_FORMAT \"" \ $format($localeName,DATE_FORMAT) "\"" puts $f $cmd } # Time if { [info exists format($localeName,TIME_FORMAT)] || [info exists items(DateTimePatterns)] } { # Find the shortest time pattern that includes the seconds if { ![info exists format($localeName,TIME_FORMAT)] } { for { set i 3 } { $i >= 0 } { incr i -1 } { if { [regexp H [lindex $items(DateTimePatterns) $i]] && [regexp s [lindex $items(DateTimePatterns) $i]] } { break } } if { $i >= 0 } { set fmt \ [backslashify \ [percentify [lindex $items(DateTimePatterns) $i]]] regsub { %Z} $fmt {} format($localeName,TIME_FORMAT) } } # Put it to the message catalog if { [info exists format($localeName,TIME_FORMAT)] } { set cmd " ::msgcat::mcset " append cmd $localeName " TIME_FORMAT \"" \ $format($localeName,TIME_FORMAT) "\"" puts $f $cmd } } # 12-hour time... if { [info exists format($localeName,TIME_FORMAT_12)] || [info exists items(DateTimePatterns)] } { # Shortest patterm with 12-hour time that includes seconds if { ![info exists format($localeName,TIME_FORMAT_12)] } { for { set i 3 } { $i >= 0 } { incr i -1 } { if { [regexp h [lindex $items(DateTimePatterns) $i]] && [regexp s [lindex $items(DateTimePatterns) $i]] } { break } } if { $i >= 0 } { set fmt \ [backslashify \ [percentify [lindex $items(DateTimePatterns) $i]]] regsub { %Z} $fmt {} format($localeName,TIME_FORMAT_12) } } # Put it to the catalog if { [info exists format($localeName,TIME_FORMAT_12)] } { set cmd " ::msgcat::mcset " append cmd $localeName " TIME_FORMAT_12 \"" \ $format($localeName,TIME_FORMAT_12) "\"" puts $f $cmd } } # Date and time... Prefer 24-hour format to 12-hour format. if { ![info exists format($localeName,DATE_TIME_FORMAT)] && [info exists format($localeName,DATE_FORMAT)] && [info exists format($localeName,TIME_FORMAT)]} { set format($localeName,DATE_TIME_FORMAT) \ $format($localeName,DATE_FORMAT) append format($localeName,DATE_TIME_FORMAT) \ " " $format($localeName,TIME_FORMAT) " %z" } if { ![info exists format($localeName,DATE_TIME_FORMAT)] && [info exists format($localeName,DATE_FORMAT)] && [info exists format($localeName,TIME_FORMAT_12)]} { set format($localeName,DATE_TIME_FORMAT) \ $format($localeName,DATE_FORMAT) append format($localeName,DATE_TIME_FORMAT) \ " " $format($localeName,TIME_FORMAT_12) " %z" } # Write date/time format to the file if { [info exists format($localeName,DATE_TIME_FORMAT)] } { set cmd " ::msgcat::mcset " append cmd $localeName " DATE_TIME_FORMAT \"" \ $format($localeName,DATE_TIME_FORMAT) "\"" puts $f $cmd } # Write the string sets to the file. foreach key { LOCALE_NUMERALS LOCALE_DATE_FORMAT LOCALE_TIME_FORMAT LOCALE_DATE_TIME_FORMAT LOCALE_ERAS LOCALE_YEAR_FORMAT } { if { [info exists format($localeName,$key)] } { set cmd " ::msgcat::mcset " append cmd $localeName " " $key " \"" \ [backslashify $format($localeName,$key)] "\"" puts $f $cmd } } # Footer puts $f "\}" close $f } #---------------------------------------------------------------------- # # percentify -- # # Converts a Java/ICU-style time format to a C/Tcl style one. # # Parameters: # string -- Format to convert # # Results: # Returns the converted format. # # Side effects: # None. # #---------------------------------------------------------------------- proc percentify { string } { set retval {} foreach { unquoted quoted } [split $string '] { append retval [string map { EEEE %A MMMM %B yyyy %Y MMM %b EEE %a dd %d hh %I HH %H mm %M MM %m ss %S yy %y a %P d %e h %l H %k M %m z %z } $unquoted] append retval $quoted } return $retval } #---------------------------------------------------------------------- # # backslashify -- # # Converts a UTF-8 string to a plain ASCII one with escapes. # # Parameters: # string -- String to convert # # Results: # Returns the converted string # # Side effects: # None. # #---------------------------------------------------------------------- proc backslashify { string } { set retval {} foreach char [split $string {}] { scan $char %c ccode if { $ccode >= 0x20 && $ccode < 0x7F && $char ne "\"" && $char ne "\{" && $char ne "\}" && $char ne "\[" && $char ne "\]" && $char ne "\\" && $char ne "\$" } { append retval $char } else { append retval \\u [format %04x $ccode] } } return $retval } #---------------------------------------------------------------------- # # MAIN PROGRAM # #---------------------------------------------------------------------- # Extract directories from command line foreach { icudir msgdir } $argv break # Walk the ICU files and create corresponding Tcl message catalogs foreach fileName [glob -directory $icudir *.txt] { set n [file rootname [file tail $fileName]] if { [regexp {^[a-z]{2,3}(_[A-Z]{2,3}(_.*)?)?$} $n] } { handleLocaleFile $n $fileName [file join $msgdir [string tolower $n].msg] } } tcl9.0.3/tools/installVfs.tcl0000644000175000017500000000316315104661341015543 0ustar sergeisergei#!/bin/sh #\ exec tclsh "$0" ${1+"$@"} #---------------------------------------------------------------------- # # installVfs.tcl -- # # This file wraps the /library file system around a binary # #---------------------------------------------------------------------- # # Copyright © 2018 Sean Woods. All rights reserved. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- proc mapDir {resultvar prefix filepath} { upvar 1 $resultvar result if {![info exists result]} { set result {} } set queue [list $prefix $filepath] while {[llength $queue]} { set queue [lassign $queue qprefix qpath] foreach ftail [glob -directory $qpath -nocomplain -tails *] { set f [file join $qpath $ftail] if {[file isdirectory $f]} { if {$ftail eq "CVS"} continue lappend queue [file join $qprefix $ftail] $f } elseif {[file isfile $f]} { if {$ftail eq "pkgIndex.tcl"} continue if {$ftail eq "manifest.txt"} { lappend result $f [file join $qprefix pkgIndex.tcl] } else { lappend result $f [file join $qprefix $ftail] } } } } } if {[llength $argv]<4} { error "Usage: [file tail [info script]] IMG_OUTPUT IMG_INPUT PREFIX FILE_SYSTEM ?PREFIX FILE_SYSTEM?..." } set paths [lassign $argv DLL_OUTPUT DLL_INPUT] foreach {prefix fpath} $paths { mapDir files $prefix [file normalize $fpath] } if {$DLL_INPUT != {}} { zipfs lmkzip $DLL_OUTPUT $files } else { zipfs lmkimg $DLL_OUTPUT $files {} $DLL_INPUT } tcl9.0.3/tools/installData.tcl0000644000175000017500000000267215104661341015662 0ustar sergeisergei#!/bin/sh #\ exec tclsh "$0" ${1+"$@"} #---------------------------------------------------------------------- # # installData.tcl -- # # This file installs a hierarchy of data found in the directory # specified by its first argument into the directory specified # by its second. # #---------------------------------------------------------------------- # # Copyright © 2004 Kevin B. Kenny. All rights reserved. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- proc copyDir {d1 d2} { puts [format {%*sCreating %s} [expr {4 * [info level]}] {} \ [file tail $d2]] file delete -force -- $d2 file mkdir $d2 foreach ftail [glob -directory $d1 -nocomplain -tails *] { set f [file join $d1 $ftail] if {[file isdirectory $f] && [string compare CVS $ftail]} { copyDir $f [file join $d2 $ftail] } elseif {[file isfile $f]} { file copy -force $f [file join $d2 $ftail] if {$::tcl_platform(platform) eq {unix}} { file attributes [file join $d2 $ftail] -permissions 0o644 } else { file attributes [file join $d2 $ftail] -readonly 1 } } } if {$::tcl_platform(platform) eq {unix}} { file attributes $d2 -permissions 0o755 } else { file attributes $d2 -readonly 1 } } copyDir [file normalize [lindex $argv 0]] [file normalize [lindex $argv 1]] tcl9.0.3/tools/index.tcl0000644000175000017500000001026715104661341014530 0ustar sergeisergei# index.tcl -- # # This file defines procedures that are used during the first pass of # the man page conversion. It is used to extract information used to # generate a table of contents and a keyword list. # # Copyright © 1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Global variables used by these scripts: # # state - state variable that controls action of text proc. # # topics - array indexed by (package,section,topic) with value # of topic ID. # # keywords - array indexed by keyword string with value of topic ID. # # curID - current topic ID, starts at 0 and is incremented for # each new topic file. # # curPkg - current package name (e.g. Tcl). # # curSect - current section title (e.g. "Tcl Built-In Commands"). # # getPackages -- # # Generate a sorted list of package names from the topics array. # # Arguments: # none. proc getPackages {} { global topics foreach i [array names topics] { regsub {^(.*),.*,.*$} $i {\1} i set temp($i) {} } lsort [array names temp] } # getSections -- # # Generate a sorted list of section titles in the specified package # from the topics array. # # Arguments: # pkg - Name of package to search. proc getSections {pkg} { global topics regsub -all {[][*?\\]} $pkg {\\&} pkg foreach i [array names topics "${pkg},*"] { regsub {^.*,(.*),.*$} $i {\1} i set temp($i) {} } lsort [array names temp] } # getTopics -- # # Generate a sorted list of topics in the specified section of the # specified package from the topics array. # # Arguments: # pkg - Name of package to search. # sect - Name of section to search. proc getTopics {pkg sect} { global topics regsub -all {[][*?\\]} $pkg {\\&} pkg regsub -all {[][*?\\]} $sect {\\&} sect foreach i [array names topics "${pkg},${sect},*"] { regsub {^.*,.*,(.*)$} $i {\1} i set temp($i) {} } lsort [array names temp] } # text -- # # This procedure adds entries to the hypertext arrays topics and keywords. # # Arguments: # string - Text to index. proc text string { global state curID curPkg curSect topics keywords switch $state { NAME { foreach i [split $string ","] { set topic [string trim $i] set index "$curPkg,$curSect,$topic" if {[info exists topics($index)] && [string compare $topics($index) $curID] != 0} { puts stderr "duplicate topic $topic in $curPkg" } set topics($index) $curID lappend keywords($topic) $curID } } KEY { foreach i [split $string ","] { lappend keywords([string trim $i]) $curID } } DT - OFF - DASH {} default { puts stderr "text: unknown state: $state" } } } # macro -- # # This procedure is invoked to process macro invocations that start # with "." (instead of '). # # Arguments: # name - The name of the macro (without the "."). # args - Any additional arguments to the macro. proc macro {name args} { switch $name { SH - SS { global state switch $args { NAME { if {$state eq "INIT" } { set state NAME } } DESCRIPTION {set state DT} INTRODUCTION {set state DT} KEYWORDS {set state KEY} default {set state OFF} } } TH { global state curID curPkg curSect topics keywords set state INIT if {[llength $args] != 5} { set args [join $args " "] puts stderr "Bad .TH macro: .$name $args" } incr curID set topic [lindex $args 0] ;# Tcl_UpVar set curPkg [lindex $args 3] ;# Tcl set curSect [lindex $args 4] ;# {Tcl Library Procedures} regsub -all {\\ } $curSect { } curSect set index "$curPkg,$curSect,$topic" set topics($index) $curID lappend keywords($topic) $curID } } } # dash -- # # This procedure is invoked to handle dash characters ("\-" in # troff). It only function in pass1 is to terminate the NAME state. # # Arguments: # None. proc dash {} { global state if {$state eq "NAME"} { set state DASH } } # initGlobals, tab, font, char, macro2 -- # # These procedures do nothing during the first pass. # # Arguments: # None. proc initGlobals {} {} proc newline {} {} proc tab {} {} proc font type {} proc char name {} proc macro2 {name args} {} tcl9.0.3/tools/genStubs.tcl0000644000175000017500000007454515104661341015224 0ustar sergeisergei# genStubs.tcl -- # # This script generates a set of stub files for a given # interface. # # # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2007 Daniel A. Steffen # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. namespace eval genStubs { # libraryName -- # # The name of the entire library. This value is used to compute # the USE_*_STUBS macro and the name of the init file. variable libraryName "UNKNOWN" # interfaces -- # # An array indexed by interface name that is used to maintain # the set of valid interfaces. The value is empty. array set interfaces {} # curName -- # # The name of the interface currently being defined. variable curName "UNKNOWN" # scspec -- # # Storage class specifier for external function declarations. # Normally "EXTERN", may be set to something like XYZAPI # variable scspec "EXTERN" # epoch, revision -- # # The epoch and revision numbers of the interface currently being defined. # (@@@TODO: should be an array mapping interface names -> numbers) # variable epoch {} variable revision 0 # hooks -- # # An array indexed by interface name that contains the set of # subinterfaces that should be defined for a given interface. array set hooks {} # stubs -- # # This three dimensional array is indexed first by interface name, # second by platform name, and third by a numeric offset or the # constant "lastNum". The lastNum entry contains the largest # numeric offset used for a given interface/platform combo. Each # numeric offset contains the C function specification that # should be used for the given entry in the stub table. The spec # consists of a list in the form returned by parseDecl. array set stubs {} # outDir -- # # The directory where the generated files should be placed. variable outDir . } # genStubs::library -- # # This function is used in the declarations file to set the name # of the library that the interfaces are associated with (e.g. "tcl"). # This value will be used to define the inline conditional macro. # # Arguments: # name The library name. # # Results: # None. proc genStubs::library {name} { variable libraryName $name } # genStubs::interface -- # # This function is used in the declarations file to set the name # of the interface currently being defined. # # Arguments: # name The name of the interface. # # Results: # None. proc genStubs::interface {name} { variable curName $name variable interfaces set interfaces($name) {} return } # genStubs::scspec -- # # Define the storage class macro used for external function declarations. # Typically, this will be a macro like XYZAPI or EXTERN that # expands to either DLLIMPORT or DLLEXPORT, depending on whether # -DBUILD_XYZ has been set. # proc genStubs::scspec {value} { variable scspec $value } # genStubs::epoch -- # # Define the epoch number for this library. The epoch # should be incrememented when a release is made that # contains incompatible changes to the public API. # proc genStubs::epoch {value} { variable epoch $value } # genStubs::hooks -- # # This function defines the subinterface hooks for the current # interface. # # Arguments: # names The ordered list of interfaces that are reachable through the # hook vector. # # Results: # None. proc genStubs::hooks {names} { variable curName variable hooks set hooks($curName) $names return } # genStubs::declare -- # # This function is used in the declarations file to declare a new # interface entry. # # Arguments: # index The index number of the interface. # platform The platform the interface belongs to. Should be one # of generic, win, unix, or macosx or aqua or x11. # decl The C function declaration, or {} for an undefined # entry. # # Results: # None. proc genStubs::declare {args} { variable stubs variable curName variable revision incr revision if {[llength $args] == 2} { lassign $args index decl set platformList generic } elseif {[llength $args] == 3} { lassign $args index platformList decl } else { puts stderr "wrong # args: declare $args" return } # Check for duplicate declarations, then add the declaration and # bump the lastNum counter if necessary. foreach platform $platformList { if {[info exists stubs($curName,$platform,$index)]} { puts stderr "Duplicate entry: declare $args" } } regsub -all "\[ \t\n\]+" [string trim $decl] " " decl set decl [parseDecl $decl] if {([lindex $platformList 0] eq "deprecated")} { set stubs($curName,deprecated,$index) [lindex $platformList 1] set stubs($curName,generic,$index) $decl if {![info exists stubs($curName,generic,lastNum)] \ || ($index > $stubs($curName,generic,lastNum))} { set stubs($curName,generic,lastNum) $index } } elseif {([lindex $platformList 0] eq "nostub")} { set stubs($curName,nostub,$index) [lindex $platformList 1] set stubs($curName,generic,$index) $decl if {![info exists stubs($curName,generic,lastNum)] \ || ($index > $stubs($curName,generic,lastNum))} { set stubs($curName,generic,lastNum) $index } } else { foreach platform $platformList { if {$decl ne ""} { set stubs($curName,$platform,$index) $decl if {![info exists stubs($curName,$platform,lastNum)] \ || ($index > $stubs($curName,$platform,lastNum))} { set stubs($curName,$platform,lastNum) $index } } } } return } # genStubs::export -- # # This function is used in the declarations file to declare a symbol # that is exported from the library but is not in the stubs table. # # Arguments: # decl The C function declaration, or {} for an undefined # entry. # # Results: # None. proc genStubs::export {args} { if {[llength $args] != 1} { puts stderr "wrong # args: export $args" } return } # genStubs::rewriteFile -- # # This function replaces the machine generated portion of the # specified file with new contents. It looks for the !BEGIN! and # !END! comments to determine where to place the new text. # # Arguments: # file The name of the file to modify. # text The new text to place in the file. # # Results: # None. proc genStubs::rewriteFile {file text} { if {![file exists $file]} { puts stderr "Cannot find file: $file" return } set in [open ${file} r] fconfigure $in -eofchar "\x1A {}" -encoding utf-8 set out [open ${file}.new w] fconfigure $out -translation lf -encoding utf-8 while {![eof $in]} { set line [gets $in] if {[string match "*!BEGIN!*" $line]} { break } puts $out $line } puts $out "/* !BEGIN!: Do not edit below this line. */" puts $out $text while {![eof $in]} { set line [gets $in] if {[string match "*!END!*" $line]} { break } } puts $out "/* !END!: Do not edit above this line. */" puts -nonewline $out [read $in] close $in close $out file rename -force ${file}.new ${file} return } # genStubs::addPlatformGuard -- # # Wrap a string inside a platform #ifdef. # # Arguments: # plat Platform to test. # # Results: # Returns the original text inside an appropriate #ifdef. proc genStubs::addPlatformGuard {plat iftxt {eltxt {}} {withCygwin 0}} { set text "" switch $plat { win { append text "#if defined(_WIN32)" if {$withCygwin} { append text " || defined(__CYGWIN__)" } append text " /* WIN */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* WIN */\n${eltxt}" } append text "#endif /* WIN */\n" } unix { append text "#if !defined(_WIN32)" if {$withCygwin} { append text " && !defined(__CYGWIN__)" } append text " && !defined(MAC_OSX_TCL)\ /* UNIX */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* UNIX */\n${eltxt}" } append text "#endif /* UNIX */\n" } macosx { append text "#ifdef MAC_OSX_TCL /* MACOSX */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* MACOSX */\n${eltxt}" } append text "#endif /* MACOSX */\n" } aqua { append text "#ifdef MAC_OSX_TK /* AQUA */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* AQUA */\n${eltxt}" } append text "#endif /* AQUA */\n" } x11 { append text "#if !(defined(_WIN32)" if {$withCygwin} { append text " || defined(__CYGWIN__)" } append text " || defined(MAC_OSX_TK))\ /* X11 */\n${iftxt}" if {$eltxt ne ""} { append text "#else /* X11 */\n${eltxt}" } append text "#endif /* X11 */\n" } default { append text "${iftxt}${eltxt}" } } return $text } # genStubs::emitSlots -- # # Generate the stub table slots for the given interface. If there # are no generic slots, then one table is generated for each # platform, otherwise one table is generated for all platforms. # # Arguments: # name The name of the interface being emitted. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitSlots {name textVar} { upvar $textVar text forAllStubs $name makeSlot 1 text {" void (*reserved$i)(void);\n"} return } # genStubs::parseDecl -- # # Parse a C function declaration into its component parts. # # Arguments: # decl The function declaration. # # Results: # Returns a list of the form {returnType name args}. The args # element consists of a list of type/name pairs, or a single # element "void". If the function declaration is malformed # then an error is displayed and the return value is {}. proc genStubs::parseDecl {decl} { if {![regexp {^(.*)\((.*)\)$} $decl all prefix args]} { set prefix $decl set args {} } set prefix [string trim $prefix] if {![regexp {^(.+[ ][*]*)([^ *]+)$} $prefix all rtype fname]} { puts stderr "Bad return type: $decl" return } set rtype [string trim $rtype] if {$args eq ""} { return [list $rtype $fname {}] } foreach arg [split $args ,] { lappend argList [string trim $arg] } if {![string compare [lindex $argList end] "..."]} { set args TCL_VARARGS foreach arg [lrange $argList 0 end-1] { set argInfo [parseArg $arg] if {[llength $argInfo] == 2 || [llength $argInfo] == 3} { lappend args $argInfo } else { puts stderr "Bad argument: '$arg' in '$decl'" return } } } else { set args {} foreach arg $argList { set argInfo [parseArg $arg] if {![string compare $argInfo "void"]} { lappend args "void" break } elseif {[llength $argInfo] == 2 || [llength $argInfo] == 3} { lappend args $argInfo } else { puts stderr "Bad argument: '$arg' in '$decl'" return } } } return [list $rtype $fname $args] } # genStubs::parseArg -- # # This function parses a function argument into a type and name. # # Arguments: # arg The argument to parse. # # Results: # Returns a list of type and name with an optional third array # indicator. If the argument is malformed, returns "". proc genStubs::parseArg {arg} { if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} { if {$arg eq "void"} { return $arg } else { return } } set result [list [string trim $type] $name] if {$array ne ""} { lappend result $array } return $result } # genStubs::makeDecl -- # # Generate the prototype for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted declaration string. proc genStubs::makeDecl {name decl index} { variable scspec variable stubs variable libraryName lassign $decl rtype fname args append text "/* $index */\n" if {[info exists stubs($name,deprecated,$index)]} { append text "[string toupper $libraryName]_DEPRECATED(\"$stubs($name,deprecated,$index)\")\n" set line "$rtype" } elseif {[string range $rtype end-5 end] eq "MP_WUR"} { set line "$scspec [string trim [string range $rtype 0 end-6]]" } else { set line "$scspec $rtype" } set count [expr {2 - ([string length $line] / 8)}] if {$count >= 0} { append line [string range "\t\t\t" 0 $count] } set pad [expr {24 - [string length $line]}] if {$pad <= 0} { append line " " set pad 0 } if {$args eq ""} { append line $fname append text $line append text ";\n" return $text } append line $fname set arg1 [lindex $args 0] switch -exact $arg1 { void { append line "(void)" } TCL_VARARGS { set sep "(" foreach arg [lrange $args 1 end] { append line $sep set next {} append next [lindex $arg 0] if {[string index $next end] ne "*"} { append next " " } append next [lindex $arg 1] [lindex $arg 2] if {[string length $line] + [string length $next] \ + $pad > 76} { append text [string trimright $line] \n set line "\t\t\t\t" set pad 28 } append line $next set sep ", " } append line ", ...)" if {[lindex $args end] eq "{const char *} format"} { append line " TCL_FORMAT_PRINTF(" [expr {[llength $args] - 1}] ", " [llength $args] ")" } } default { set sep "(" foreach arg $args { append line $sep set next {} append next [lindex $arg 0] if {[string index $next end] ne "*"} { append next " " } append next [lindex $arg 1] [lindex $arg 2] if {[string length $line] + [string length $next] \ + $pad > 76} { append text [string trimright $line] \n set line "\t\t\t\t" set pad 28 } append line $next set sep ", " } append line ")" } } if {[string range $rtype end-5 end] eq "MP_WUR"} { append line " MP_WUR" } return "$text$line;\n" } # genStubs::makeMacro -- # # Generate the inline macro for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted macro definition. proc genStubs::makeMacro {name decl index} { lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] append lfname [string range $fname 1 end] set text "#define $fname \\\n\t(" if {$args eq ""} { append text "*" } append text "${name}StubsPtr->$lfname)" append text " /* $index */\n" return $text } # genStubs::makeSlot -- # # Generate the stub table entry for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted table entry. proc genStubs::makeSlot {name decl index} { lassign $decl rtype fname args variable stubs set lfname [string tolower [string index $fname 0]] append lfname [string range $fname 1 end] set text " " if {[info exists stubs($name,deprecated,$index)]} { append text "TCL_DEPRECATED_API(\"$stubs($name,deprecated,$index)\") " } elseif {[info exists stubs($name,nostub,$index)]} { append text "TCL_DEPRECATED_API(\"$stubs($name,nostub,$index)\") " } if {$args eq ""} { append text $rtype " *" $lfname "; /* $index */\n" return $text } if {[string range $rtype end-8 end] eq "__stdcall"} { append text [string trim [string range $rtype 0 end-9]] " (__stdcall *" $lfname ") " } elseif {[string range $rtype 0 11] eq "TCL_NORETURN"} { append text "TCL_NORETURN1 " [string trim [string range $rtype 12 end]] " (*" $lfname ") " } elseif {[string range $rtype end-5 end] eq "MP_WUR"} { append text [string trim [string range $rtype 0 end-6]] " (*" $lfname ") " } else { append text $rtype " (*" $lfname ") " } set arg1 [lindex $args 0] switch -exact $arg1 { void { append text "(void)" } TCL_VARARGS { set sep "(" foreach arg [lrange $args 1 end] { append text $sep [lindex $arg 0] if {[string index $text end] ne "*"} { append text " " } append text [lindex $arg 1] [lindex $arg 2] set sep ", " } append text ", ...)" if {[lindex $args end] eq "{const char *} format"} { append text " TCL_FORMAT_PRINTF(" [expr {[llength $args] - 1}] ", " [llength $args] ")" } } default { set sep "(" foreach arg $args { append text $sep [lindex $arg 0] if {[string index $text end] ne "*"} { append text " " } append text [lindex $arg 1] [lindex $arg 2] set sep ", " } append text ")" } } if {[string range $rtype end-5 end] eq "MP_WUR"} { append text " MP_WUR" } append text "; /* $index */\n" return $text } # genStubs::makeInit -- # # Generate the prototype for a function. # # Arguments: # name The interface name. # decl The function declaration. # index The slot index for this function. # # Results: # Returns the formatted declaration string. proc genStubs::makeInit {name decl index} { if {[lindex $decl 2] eq ""} { append text " &" [lindex $decl 1] ", /* " $index " */\n" } else { append text " " [lindex $decl 1] ", /* " $index " */\n" } return $text } # genStubs::forAllStubs -- # # This function iterates over all of the platforms and invokes # a callback for each slot. The result of the callback is then # placed inside appropriate platform guards. # # Arguments: # name The interface name. # slotProc The proc to invoke to handle the slot. It will # have the interface name, the declaration, and # the index appended. # onAll If 1, emit the skip string even if there are # definitions for one or more platforms. # textVar The variable to use for output. # skipString The string to emit if a slot is skipped. This # string will be subst'ed in the loop so "$i" can # be used to substitute the index value. # # Results: # None. proc genStubs::forAllStubs {name slotProc onAll textVar {skipString {"/* Slot $i is reserved */\n"}}} { variable stubs upvar $textVar text set plats [array names stubs $name,*,lastNum] if {[info exists stubs($name,generic,lastNum)]} { # Emit integrated stubs block set lastNum -1 foreach plat [array names stubs $name,*,lastNum] { if {$stubs($plat) > $lastNum} { set lastNum $stubs($plat) } } for {set i 0} {$i <= $lastNum} {incr i} { set slots [array names stubs $name,*,$i] set emit 0 if {[info exists stubs($name,deprecated,$i)]} { append text [$slotProc $name $stubs($name,generic,$i) $i] set emit 1 } elseif {[info exists stubs($name,nostub,$i)]} { append text [$slotProc $name $stubs($name,generic,$i) $i] set emit 1 } elseif {[info exists stubs($name,generic,$i)]} { if {[llength $slots] > 1} { puts stderr "conflicting generic and platform entries:\ $name $i" } append text [$slotProc $name $stubs($name,generic,$i) $i] set emit 1 } elseif {[llength $slots] > 0} { array set slot {unix 0 x11 0 win 0 macosx 0 aqua 0} foreach s $slots { set slot([lindex [split $s ,] 1]) 1 } # "aqua", "macosx" and "x11" are special cases: # "macosx" implies "unix", "aqua" implies "macosx" and "x11" # implies "unix", so we need to be careful not to emit # duplicate stubs entries: if {($slot(unix) && $slot(macosx)) || ( ($slot(unix) || $slot(macosx)) && ($slot(x11) || $slot(aqua)))} { puts stderr "conflicting platform entries: $name $i" } ## unix ## set temp {} set plat unix if {!$slot(aqua) && !$slot(x11)} { if {$slot($plat)} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } elseif {$onAll} { eval {append temp} $skipString } } if {$temp ne ""} { append text [addPlatformGuard $plat $temp] set emit 1 } ## x11 ## set temp {} set plat x11 if {!$slot(unix) && !$slot(macosx)} { if {$slot($plat)} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } elseif {$onAll} { eval {append temp} $skipString } } if {$temp ne ""} { append text [addPlatformGuard $plat $temp] set emit 1 } ## win ## set temp {} set plat win if {$slot($plat)} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } elseif {$onAll} { eval {append temp} $skipString } if {$temp ne ""} { append text [addPlatformGuard $plat $temp] set emit 1 } ## macosx ## set temp {} set plat macosx if {!$slot(aqua) && !$slot(x11)} { if {$slot($plat)} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } elseif {$slot(unix)} { append temp [$slotProc $name $stubs($name,unix,$i) $i] } elseif {$onAll} { eval {append temp} $skipString } } if {$temp ne ""} { append text [addPlatformGuard $plat $temp] set emit 1 } ## aqua ## set temp {} set plat aqua if {!$slot(unix) && !$slot(macosx)} { if {[string range $skipString 1 2] ne "/*"} { # genStubs.tcl previously had a bug here causing it to # erroneously generate both a unix entry and an aqua # entry for a given stubs table slot. To preserve # backwards compatibility, generate a dummy stubs entry # before every aqua entry (note that this breaks the # correspondence between emitted entry number and # actual position of the entry in the stubs table, e.g. # TkIntStubs entry 113 for aqua is in fact at position # 114 in the table, entry 114 at position 116 etc). eval {append temp} $skipString set temp "# if TCL_MAJOR_VERSION < 9\n[string range $temp 0 end-1] /*\ Dummy entry for stubs table backwards\ compatibility */\n# endif /* TCL_MAJOR_VERSION < 9 */\n" } if {$slot($plat)} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } elseif {$onAll} { eval {append temp} $skipString } } if {$temp ne ""} { append text [addPlatformGuard $plat $temp] set emit 1 } } if {!$emit} { eval {append text} $skipString } } } else { # Emit separate stubs blocks per platform array set block {unix 0 x11 0 win 0 macosx 0 aqua 0} foreach s [array names stubs $name,*,lastNum] { set block([lindex [split $s ,] 1]) 1 } ## unix ## if {$block(unix) && !$block(x11)} { set temp {} set plat unix set lastNum $stubs($name,$plat,lastNum) for {set i 0} {$i <= $lastNum} {incr i} { if {[info exists stubs($name,$plat,$i)]} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } else { eval {append temp} $skipString } } append text [addPlatformGuard $plat $temp {} true] } ## win ## if {$block(win)} { set temp {} set plat win set lastNum $stubs($name,$plat,lastNum) for {set i 0} {$i <= $lastNum} {incr i} { if {[info exists stubs($name,$plat,$i)]} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] } else { eval {append temp} $skipString } } append text [addPlatformGuard $plat $temp {} true] } ## macosx ## if {($block(unix) || $block(macosx)) && !$block(aqua) && !$block(x11)} { set temp {} set lastNum -1 foreach plat {unix macosx} { if {$block($plat)} { set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum) ? $lastNum : $stubs($name,$plat,lastNum)}] } } for {set i 0} {$i <= $lastNum} {incr i} { set emit 0 foreach plat {unix macosx} { if {[info exists stubs($name,$plat,$i)]} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] set emit 1 break } } if {!$emit} { eval {append temp} $skipString } } append text [addPlatformGuard macosx $temp] } ## aqua ## if {$block(aqua)} { set temp {} set lastNum -1 foreach plat {unix macosx aqua} { if {$block($plat)} { set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum) ? $lastNum : $stubs($name,$plat,lastNum)}] } } for {set i 0} {$i <= $lastNum} {incr i} { set emit 0 foreach plat {unix macosx aqua} { if {[info exists stubs($name,$plat,$i)]} { append temp [$slotProc $name $stubs($name,$plat,$i) $i] set emit 1 break } } if {!$emit} { eval {append temp} $skipString } } append text [addPlatformGuard aqua $temp] } ## x11 ## if {$block(x11)} { set temp {} set lastNum -1 foreach plat {unix macosx x11} { if {$block($plat)} { set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum) ? $lastNum : $stubs($name,$plat,lastNum)}] } } for {set i 0} {$i <= $lastNum} {incr i} { set emit 0 foreach plat {unix macosx x11} { if {[info exists stubs($name,$plat,$i)]} { if {$plat ne "macosx"} { append temp [$slotProc $name \ $stubs($name,$plat,$i) $i] } else { eval {set etxt} $skipString append temp [addPlatformGuard $plat [$slotProc \ $name $stubs($name,$plat,$i) $i] $etxt true] } set emit 1 break } } if {!$emit} { eval {append temp} $skipString } } append text [addPlatformGuard x11 $temp {} true] } } } # genStubs::emitDeclarations -- # # This function emits the function declarations for this interface. # # Arguments: # name The interface name. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitDeclarations {name textVar} { upvar $textVar text append text "\n/*\n * Exported function declarations:\n */\n\n" forAllStubs $name makeDecl 0 text return } # genStubs::emitMacros -- # # This function emits the inline macros for an interface. # # Arguments: # name The name of the interface being emitted. # textVar The variable to use for output. # # Results: # None. proc genStubs::emitMacros {name textVar} { variable libraryName upvar $textVar text set upName [string toupper $libraryName] append text "\n#if defined(USE_${upName}_STUBS)\n" append text "\n/*\n * Inline function declarations:\n */\n\n" forAllStubs $name makeMacro 0 text append text "\n#endif /* defined(USE_${upName}_STUBS) */\n" return } # genStubs::emitHeader -- # # This function emits the body of the Decls.h file for # the specified interface. # # Arguments: # name The name of the interface being emitted. # # Results: # None. proc genStubs::emitHeader {name} { variable outDir variable hooks variable epoch variable revision set capName [string toupper [string index $name 0]] append capName [string range $name 1 end] if {$epoch ne ""} { set CAPName [string toupper $name] append text "\n" append text "#define ${CAPName}_STUBS_EPOCH $epoch\n" append text "#define ${CAPName}_STUBS_REVISION $revision\n" } append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n" emitDeclarations $name text if {[info exists hooks($name)]} { append text "\ntypedef struct {\n" foreach hook $hooks($name) { set capHook [string toupper [string index $hook 0]] append capHook [string range $hook 1 end] append text " const struct ${capHook}Stubs *${hook}Stubs;\n" } append text "} ${capName}StubHooks;\n" } append text "\ntypedef struct ${capName}Stubs {\n" append text " int magic;\n" if {$epoch ne ""} { append text " int epoch;\n" append text " int revision;\n" } if {[info exists hooks($name)]} { append text " const ${capName}StubHooks *hooks;\n\n" } else { append text " void *hooks;\n\n" } emitSlots $name text append text "} ${capName}Stubs;\n\n" append text "extern const ${capName}Stubs *${name}StubsPtr;\n\n" append text "#ifdef __cplusplus\n}\n#endif\n" emitMacros $name text rewriteFile [file join $outDir ${name}Decls.h] $text return } # genStubs::emitInit -- # # Generate the table initializers for an interface. # # Arguments: # name The name of the interface to initialize. # textVar The variable to use for output. # # Results: # Returns the formatted output. proc genStubs::emitInit {name textVar} { variable hooks variable interfaces variable epoch upvar $textVar text set root 1 set capName [string toupper [string index $name 0]] append capName [string range $name 1 end] if {[info exists hooks($name)]} { append text "\nstatic const ${capName}StubHooks ${name}StubHooks = \{\n" set sep " " foreach sub $hooks($name) { append text $sep "&${sub}Stubs" set sep ",\n " } append text "\n\};\n" } foreach intf [array names interfaces] { if {[info exists hooks($intf)]} { if {$name in $hooks($intf)} { set root 0 break } } } append text "\n" if {!$root} { append text "static " } append text "const ${capName}Stubs ${name}Stubs = \{\n TCL_STUB_MAGIC,\n" if {$epoch ne ""} { set CAPName [string toupper $name] append text " ${CAPName}_STUBS_EPOCH,\n" append text " ${CAPName}_STUBS_REVISION,\n" } if {[info exists hooks($name)]} { append text " &${name}StubHooks,\n" } else { append text " 0,\n" } forAllStubs $name makeInit 1 text {" 0, /* $i */\n"} append text "\};\n" return } # genStubs::emitInits -- # # This function emits the body of the StubInit.c file for # the specified interface. # # Arguments: # name The name of the interface being emitted. # # Results: # None. proc genStubs::emitInits {} { variable hooks variable outDir variable libraryName variable interfaces # Assuming that dependencies only go one level deep, we need to emit # all of the leaves first to avoid needing forward declarations. set leaves {} set roots {} foreach name [lsort [array names interfaces]] { if {[info exists hooks($name)]} { lappend roots $name } else { lappend leaves $name } } foreach name $leaves { emitInit $name text } foreach name $roots { emitInit $name text } rewriteFile [file join $outDir ${libraryName}StubInit.c] $text } # genStubs::init -- # # This is the main entry point. # # Arguments: # None. # # Results: # None. proc genStubs::init {} { global argv argv0 variable outDir variable interfaces if {[llength $argv] < 2} { puts stderr "usage: $argv0 outDir declFile ?declFile...?" exit 1 } set outDir [lindex $argv 0] foreach file [lrange $argv 1 end] { source -encoding utf-8 $file } foreach name [lsort [array names interfaces]] { puts "Emitting $name" emitHeader $name } emitInits } # lassign -- # # This function emulates the TclX lassign command. # # Arguments: # valueList A list containing the values to be assigned. # args The list of variables to be assigned. # # Results: # Returns any values that were not assigned to variables. if {[namespace which lassign] ne ""} { proc lassign {valueList args} { if {[llength $args] == 0} { error "wrong # args: should be \"lassign list varName ?varName ...?\"" } uplevel [list foreach $args $valueList {break}] return [lrange $valueList [llength $args] end] } } genStubs::init tcl9.0.3/tools/findDocWords.tcl0000644000175000017500000000306015104661341015777 0ustar sergeisergei# findDocWords.tcl -- # # This script attempts to find all non-dictionary words in the Tcl or Tk # documentation tree. It handles the fairly common compoundWord trick our # docs use, and isn't confused by nroff formatting directives, so it isn't # just a standard spell check. # # Arguments: # 1: Directory to look for man source files in. # 2: Path to a plain text dictionary. Try /usr/share/dict/words on Linux. # # Copyright © 2024 Donal K Fellows. # See "license.terms" for the license. lassign $argv dir dictionary set f [open $dictionary] while {[gets $f line] > 0} { dict set realWord [string tolower $line] yes } close $f puts "loaded [dict size $realWord] words from dictionary" set files [glob -directory $dir {*.[13n]}] set found {} proc identifyWords {fragment filename} { global realWord found foreach frag [split [string map {\\fB "" \\fR "" \\fI "" \\fP "" \\0 _} $fragment] _] { if {[string is entier $frag]} continue set frag [string trim $frag "\\0123456789"] if {$frag eq ""} continue foreach word [regexp -all -inline {^[a-z]+|[A-Z][a-z]*} $frag] { set word [string tolower $word] if {![dict exists $realWord $word]} { dict lappend found $word $filename } } } } foreach fn $files { set f [open $fn] foreach word [regexp -all -inline {[\\\w]+} [read $f]] { identifyWords $word $fn } close $f } set len [tcl::mathfunc::max {*}[lmap word [dict keys $found] {string length $word}]] foreach word [lsort [dict keys $found]] { puts [format "%-${len}s: %s" $word [lindex [dict get $found $word] 0]] } tcl9.0.3/tools/findBadExternals.tcl0000755000175000017500000000233415104661341016635 0ustar sergeisergei# findBadExternals.tcl -- # # This script scans the Tcl load library for exported symbols # that do not begin with 'Tcl' or 'tcl'. It reports them on the # standard output. It is used to make sure that the library does # not inadvertently export externals that may be in conflict with # other code. # # Usage: # # tclsh findBadExternals.tcl /path/to/tclXX.so-or-.dll # # Copyright © 2005 George Peter Staplin and Kevin Kenny # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- proc main {argc argv} { if {$argc != 1} { puts stderr "syntax is: [info script] libtcl" return 1 } switch -exact -- $::tcl_platform(platform) { unix - macosx { set status [catch { exec nm --extern-only --defined-only [lindex $argv 0] } result] } windows { set status [catch { exec dumpbin /exports [lindex $argv 0] } result] } } if {$status != 0 && $::errorCode ne "NONE"} { puts $result return 1 } foreach line [split $result \n] { if {! [string match {* [Tt]cl*} $line]} { puts $line } } return 0 } exit [main $::argc $::argv] tcl9.0.3/tools/feather.bmp0000644000175000017500000000406615035744306015041 0ustar sergeisergeiBM66( ʦ @ ` @@ @@@`@@@@`` `@`````` @` @` @` @`@@ @@@`@@@@@ @ @ @@ `@ @ @ @ @@@@ @@@@@`@@@@@@@@@`@` @`@@``@`@`@`@`@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@ @` @ ` @@ @@@`@@@@`` `@`````` @` @` @` @` @` @ ` @@ @@@`@@@@`` `@`````` @` @` @`ФЛtcl9.0.3/tools/checkLibraryDoc.tcl0000755000175000017500000001612215104661341016450 0ustar sergeisergei# checkLibraryDoc.tcl -- # # This script attempts to determine what APIs exist in the source base that # have not been documented. By grepping through all of the doc/*.3 man # pages, looking for "Pkg_*" (e.g., Tcl_ or Tk_), and comparing this list # against the list of Pkg_ APIs found in the source (e.g., tcl9.0/*/*.[ch]) # we create six lists: # 1) APIs in Source not in Docs. # 2) APIs in Docs not in Source. # 3) Internal APIs and structs. # 4) Misc APIs and structs that we are not documenting. # 5) Command APIs (e.g., Tcl_ArrayObjCmd.) # 6) Proc pointers (e.g., Tcl_CloseProc.) # # Note: Each list is "a best guess" approximation. If developers write # non-standard code, this script will produce erroneous results. Each # list should be carefully checked for accuracy. # # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. lappend auto_path "c:/program\ files/tclpro1.2/win32-ix86/bin" #lappend auto_path "/home/surles/cvs/tclx8.0/tcl/unix" if {[catch {package require Tclx}]} { puts "error: could not load TclX. Please set TCL_LIBRARY." exit 1 } # A list of structs that are known to be undocumented. set StructList { Tcl_AsyncHandler \ Tcl_CallFrame \ Tcl_Condition \ Tcl_Encoding \ Tcl_EncodingState \ Tcl_EncodingType \ Tcl_HashEntry \ Tcl_HashSearch \ Tcl_HashTable \ Tcl_Mutex \ Tcl_Pid \ Tcl_QueuePosition \ Tcl_ResolvedVarInfo \ Tcl_ThreadDataKey \ Tcl_ThreadId \ Tcl_Time \ Tcl_TimerToken \ Tcl_Token \ Tcl_Trace \ Tcl_Var \ Tk_3DBorder \ Tk_ArgvInfo \ Tk_BindingTable \ Tk_Canvas \ Tk_CanvasTextInfo \ Tk_ConfigSpec \ Tk_ConfigTypes \ Tk_Cursor \ Tk_CustomOption \ Tk_ErrorHandler \ Tk_FakeWin \ Tk_Font \ Tk_FontMetrics \ Tk_GeomMgr \ Tk_Image \ Tk_ImageMaster \ Tk_ImageModel \ Tk_ImageType \ Tk_Item \ Tk_ItemType \ Tk_OptionSpec\ Tk_OptionTable \ Tk_OptionType \ Tk_PhotoHandle \ Tk_PhotoImageBlock \ Tk_PhotoImageFormat \ Tk_PostscriptInfo \ Tk_SavedOption \ Tk_SavedOptions \ Tk_SegType \ Tk_TextLayout \ Tk_Window \ } # Misc junk that appears in the comments of the source. This just # allows us to filter comments that "fool" the script. set CommentList { Tcl_Create\[Obj\]Command \ Tcl_DecrRefCount\\n \ Tcl_NewObj\\n \ Tk_GetXXX \ } # Main entry point to this script. proc main {} { global argv0 global argv set len [llength $argv] if {($len != 2) && ($len != 3)} { puts "usage: $argv0 pkgName pkgDir \[outFile\]" puts " pkgName == Tcl,Tk" exit 1 } set pkg [lindex $argv 0] set dir [lindex $argv 1] if {[llength $argv] == 3} { set file [open [lindex $argv 2] w] } else { set file stdout } foreach {c d} [compare [grepCode $dir $pkg] [grepDocs $dir $pkg]] {} filter $c $d $dir $pkg $file if {$file ne "stdout"} { close $file } return } # Intersect the two list and write out the sets of APIs in one # list that is not in the other. proc compare {list1 list2} { set inter [intersect3 $list1 $list2] return [list [lindex $inter 0] [lindex $inter 2]] } # Filter the lists into the six lists we report on. Then write # the results to the file. proc filter {code docs dir pkg {outFile stdout}} { set apis {} # A list of Tcl command APIs. These are not documented. # This list should just be verified for accuracy. set cmds {} # A list of proc pointer structs. These are not documented. # This list should just be verified for accuracy. set procs {} # A list of internal declarations. These are not documented. # This list should just be verified for accuracy. set decls [grepDecl $dir $pkg] # A list of misc. procedure declarations that are not documented. # This list should just be verified for accuracy. set misc [grepMisc $dir $pkg] set pat1 ".*(${pkg}_\[A-z0-9]+).*$" # A list of APIs in the source, not in the docs. # This list should just be verified for accuracy. foreach x $code { if {[string match *Cmd $x]} { if {[string match ${pkg}* $x]} { lappend cmds $x } } elseif {[string match *Proc $x]} { if {[string match ${pkg}* $x]} { lappend procs $x } } elseif {[lsearch -exact $decls $x] >= 0} { # No Op. } elseif {[lsearch -exact $misc $x] >= 0} { # No Op. } else { lappend apis $x } } dump $apis "APIs in Source not in Docs." $outFile dump $docs "APIs in Docs not in Source." $outFile dump $decls "Internal APIs and structs." $outFile dump $misc "Misc APIs and structs that we are not documenting." $outFile dump $cmds "Command APIs." $outFile dump $procs "Proc pointers." $outFile return } # Print the list of APIs if the list is not null. proc dump {list title file} { if {$list ne ""} { puts $file "" puts $file $title puts $file "---------------------------------------------------------" foreach x $list { puts $file $x } } } # Grep into "dir/*/*.[ch]" looking for APIs that match $pkg_*. # (e.g., Tcl_Exit). Return a list of APIs. proc grepCode {dir pkg} { set apis [myGrep "${pkg}_\.\*" "${dir}/\*/\*\.\[ch\]"] set pat1 ".*(${pkg}_\[A-z0-9]+).*$" foreach a $apis { if {[regexp -- $pat1 $a main n1]} { set result([string trim $n1]) 1 } } return [lsort [array names result]] } # Grep into "dir/doc/*.3" looking for APIs that match $pkg_*. # (e.g., Tcl_Exit). Return a list of APIs. proc grepDocs {dir pkg} { set apis [myGrep "\\fB${pkg}_\.\*\\fR" "${dir}/doc/\*\.3"] set pat1 ".*(${pkg}_\[A-z0-9]+)\\\\fR.*$" foreach a $apis { if {[regexp -- $pat1 $a main n1]} { set result([string trim $n1]) 1 } } return [lsort [array names result]] } # Grep into "generic/pkgIntDecls.h" looking for APIs that match $pkg_*. # (e.g., Tcl_Export). Return a list of APIs. proc grepDecl {dir pkg} { set file [file join $dir generic "[string tolower $pkg]IntDecls.h"] set apis [myGrep "^EXTERN.*\[ \t\]${pkg}_.*" $file] set pat1 ".*(${pkg}_\[A-z0-9]+).*$" foreach a $apis { if {[regexp -- $pat1 $a main n1]} { set result([string trim $n1]) 1 } } return [lsort [array names result]] } # Grep into "*/*.[ch]" looking for APIs that match $pkg_Db*. # (e.g., Tcl_DbCkalloc). Return a list of APIs. proc grepMisc {dir pkg} { global CommentList global StructList set apis [myGrep "^EXTERN.*\[ \t\]${pkg}_Db.*" "${dir}/\*/\*\.\[ch\]"] set pat1 ".*(${pkg}_\[A-z0-9]+).*$" foreach a $apis { if {[regexp -- $pat1 $a main n1]} { set dbg([string trim $n1]) 1 } } set result {} eval {lappend result} $StructList eval {lappend result} [lsort [array names dbg]] eval {lappend result} $CommentList return $result } proc myGrep {searchPat globPat} { set result {} foreach file [glob -nocomplain $globPat] { set file [open $file r] set data [read $file] close $file foreach line [split $data "\n"] { if {[regexp "^.*${searchPat}.*\$" $line]} { lappend result $line } } } return $result } main tcl9.0.3/tools/addVerToFile.tcl0000755000175000017500000000033115104661341015723 0ustar sergeisergei#!/usr/bin/env tclsh if {$argc < 1} { error "need a filename argument" } lassign $argv filename set f [open $filename a] puts $f "TCL_VERSION=[info tclversion]" puts $f "TCL_PATCHLEVEL=[info patchlevel]" close $f tcl9.0.3/tests-perf/0000755000175000017500000000000015104662715013651 5ustar sergeisergeitcl9.0.3/tests-perf/timer-event.perf.tcl0000644000175000017500000001435715104661341017553 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # timer-event.perf.tcl -- # # This file provides performance tests for comparison of tcl-speed # of timer events (event-driven tcl-handling). # # ------------------------------------------------------------------------ # # Copyright © 2014 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # if {![namespace exists ::tclTestPerf]} { source [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-Timer-Event { namespace path {::tclTestPerf} proc test-queue {{reptime {1000 10000}}} { set howmuch [lindex $reptime 1] # because of extremely short measurement times by tests below, wait a little bit (warming-up), # to minimize influence of the time-gradation (just for better dispersion resp. result-comparison) timerate {after 0} 156 puts "*** up to $howmuch events ***" # single iteration by update, so using -no-result (measure only): _test_run -no-result $reptime [string map [list \{*\}\$reptime $reptime \$howmuch $howmuch \\# \#] { # generate up to $howmuch idle-events: {after idle {set foo bar}} # update / after idle: {update; if {![llength [after info]]} break} # generate up to $howmuch idle-events: {after idle {set foo bar}} # update idletasks / after idle: {update idletasks; if {![llength [after info]]} break} # generate up to $howmuch immediate events: {after 0 {set foo bar}} # update / after 0: {update; if {![llength [after info]]} break} # generate up to $howmuch 1-ms events: {after 1 {set foo bar}} setup {after 1} # update / after 1: {update; if {![llength [after info]]} break} # generate up to $howmuch immediate events (+ 1 event of the second generation): {after 0 {after 0 {}}} # update / after 0 (double generation): {update; if {![llength [after info]]} break} # cancel forwards "after idle" / $howmuch idle-events in queue: setup {set i 0; timerate {set ev([incr i]) [after idle {set foo bar}]} {*}$reptime} setup {set le $i; set i 0; list 1 .. $le; # cancel up to $howmuch events} {after cancel $ev([incr i]); if {$i >= $le} break} cleanup {update; unset -nocomplain ev} # cancel backwards "after idle" / $howmuch idle-events in queue: setup {set i 0; timerate {set ev([incr i]) [after idle {set foo bar}]} {*}$reptime} setup {set le $i; incr i; list $le .. 1; # cancel up to $howmuch events} {after cancel $ev([incr i -1]); if {$i <= 1} break} cleanup {update; unset -nocomplain ev} # cancel forwards "after 0" / $howmuch timer-events in queue: setup {set i 0; timerate {set ev([incr i]) [after 0 {set foo bar}]} {*}$reptime} setup {set le $i; set i 0; list 1 .. $le; # cancel up to $howmuch events} {after cancel $ev([incr i]); if {$i >= $le} break} cleanup {update; unset -nocomplain ev} # cancel backwards "after 0" / $howmuch timer-events in queue: setup {set i 0; timerate {set ev([incr i]) [after 0 {set foo bar}]} {*}$reptime} setup {set le $i; incr i; list $le .. 1; # cancel up to $howmuch events} {after cancel $ev([incr i -1]); if {$i <= 1} break} cleanup {update; unset -nocomplain ev} # end $howmuch events. cleanup {if [llength [after info]] {error "unexpected: [llength [after info]] events are still there."}} }] } proc test-access {{reptime {1000 5000}}} { set howmuch [lindex $reptime 1] _test_run $reptime [string map [list \{*\}\$reptime $reptime \$howmuch $howmuch] { # event random access: after idle + after info (by $howmuch events) setup {set i -1; timerate {set ev([incr i]) [after idle {}]} {*}$reptime} {after info $ev([expr {int(rand()*$i)}])} cleanup {update; unset -nocomplain ev} # event random access: after 0 + after info (by $howmuch events) setup {set i -1; timerate {set ev([incr i]) [after 0 {}]} {*}$reptime} {after info $ev([expr {int(rand()*$i)}])} cleanup {update; unset -nocomplain ev} # end $howmuch events. cleanup {if [llength [after info]] {error "unexpected: [llength [after info]] events are still there."}} }] } proc test-exec {{reptime 1000}} { _test_run $reptime { # after idle + after cancel {after cancel [after idle {set foo bar}]} # after 0 + after cancel {after cancel [after 0 {set foo bar}]} # after idle + update idletasks {after idle {set foo bar}; update idletasks} # after idle + update {after idle {set foo bar}; update} # immediate: after 0 + update {after 0 {set foo bar}; update} # delayed: after 1 + update {after 1 {set foo bar}; update} # empty update: {update} # empty update idle tasks: {update idletasks} # simple shortest sleep: {after 0} } } proc test-nrt-capability {{reptime 1000}} { _test_run $reptime { # comparison values: {after 0 {set a 5}; update} {after 0 {set a 5}; vwait a} # conditional vwait with very brief wait-time: {after 1 {set a timeout}; vwait a; expr {$::a ne "timeout" ? 1 : "0[unset ::a]"}} {after 0 {set a timeout}; vwait a; expr {$::a ne "timeout" ? 1 : "0[unset ::a]"}} } } proc test-long {{reptime 1000}} { _test_run $reptime { # in-between important event by amount of idle events: {time {after idle {after 30}} 10; after 1 {set important 1}; vwait important;} cleanup {foreach i [after info] {after cancel $i}} # in-between important event (of new generation) by amount of idle events: {time {after idle {after 30}} 10; after 1 {after 0 {set important 1}}; vwait important;} cleanup {foreach i [after info] {after cancel $i}} } } proc test {{reptime 1000}} { test-exec $reptime foreach howmuch {5000 50000} { test-access [list $reptime $howmuch] } test-nrt-capability $reptime test-long $reptime puts "" foreach howmuch { 10000 20000 40000 60000 } { test-queue [list $reptime $howmuch] } puts \n**OK** } }; # end of ::tclTestPerf-Timer-Event # ------------------------------------------------------------------------ # if calling direct: if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { array set in {-time 500} array set in $argv ::tclTestPerf-Timer-Event::test $in(-time) } tcl9.0.3/tests-perf/test-performance.tcl0000644000175000017500000001306315104661341017630 0ustar sergeisergei# ------------------------------------------------------------------------ # # test-performance.tcl -- # # This file provides common performance tests for comparison of tcl-speed # degradation or regression by switching between branches. # # To execute test case evaluate direct corresponding file "tests-perf\*.perf.tcl". # # ------------------------------------------------------------------------ # # Copyright © 2014 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # namespace eval ::tclTestPerf { # warm-up interpreter compiler env, calibrate timerate measurement functionality: # if no timerate here - import from unsupported: if {[namespace which -command timerate] eq {}} { namespace inscope ::tcl::unsupported {namespace export timerate} namespace import ::tcl::unsupported::timerate } # if not yet calibrated: if {[lindex [timerate {} 10] 6] >= (10-1)} { puts -nonewline "Calibration ... "; flush stdout puts "done: [lrange \ [timerate -calibrate {}] \ 0 1]" } proc {**STOP**} {args} { return -code error -level 4 "**STOP** in [info level [expr {[info level]-2}]] [join $args { }]" } proc _test_get_commands {lst} { regsub -all {(?:^|\n)[ \t]*(\#[^\n]*|\msetup\M[^\n]*|\mcleanup\M[^\n]*)(?=\n\s*(?:[\{\#]|setup|cleanup|$))} $lst "\n{\\1}" } proc _test_out_total {} { upvar _ _ set tcnt [llength $_(itm)] if {!$tcnt} { puts "" return } set mintm 0x7FFFFFFF set maxtm 0 set nettm 0 set wtm 0 set wcnt 0 set i 0 foreach tm $_(itm) { if {[llength $tm] > 6} { set nettm [expr {$nettm + [lindex $tm 6]}] } set wtm [expr {$wtm + [lindex $tm 0]}] set wcnt [expr {$wcnt + [lindex $tm 2]}] set tm [lindex $tm 0] if {$tm > $maxtm} {set maxtm $tm; set maxi $i} if {$tm < $mintm} {set mintm $tm; set mini $i} incr i } puts [string repeat ** 40] set s [format "%d cases in %.2f sec." $tcnt [expr {([clock milliseconds] - $_(starttime)) / 1000.0}]] if {$nettm > 0} { append s [format " (%.2f net-sec.)" [expr {$nettm / 1000.0}]] } puts "Total $s:" lset _(m) 0 [format %.6f $wtm] lset _(m) 2 $wcnt lset _(m) 4 [format %.3f [expr {$wcnt / (($nettm ? $nettm : ($tcnt * [lindex $_(reptime) 0])) / 1000.0)}]] if {[llength $_(m)] > 6} { lset _(m) 6 [format %.3f $nettm] } puts $_(m) puts "Average:" lset _(m) 0 [format %.6f [expr {[lindex $_(m) 0] / $tcnt}]] lset _(m) 2 [expr {[lindex $_(m) 2] / $tcnt}] if {[llength $_(m)] > 6} { lset _(m) 6 [format %.3f [expr {[lindex $_(m) 6] / $tcnt}]] lset _(m) 4 [format %.0f [expr {[lindex $_(m) 2] / [lindex $_(m) 6] * 1000}]] } puts $_(m) puts "Min:" puts [lindex $_(itm) $mini] puts "Max:" puts [lindex $_(itm) $maxi] puts [string repeat ** 40] puts "" unset -nocomplain _(itm) _(starttime) } proc _test_start {reptime} { upvar _ _ array set _ [list itm {} reptime $reptime starttime [clock milliseconds] -from-run 0] } proc _test_iter {args} { if {[llength $args] > 2} { return -code error "wrong # args: should be \"[lindex [info level [info level]] 0] ?level? measure-result\"" } set lvl 1 if {[llength $args] > 1} { set args [lassign $args lvl] } upvar $lvl _ _ puts [set _(m) {*}$args] lappend _(itm) $_(m) puts "" } proc _adjust_maxcount {reptime maxcount} { if {[llength $reptime] > 1} { lreplace $reptime 1 1 [expr {min($maxcount,[lindex $reptime 1])}] } else { lappend reptime $maxcount } } proc _test_run {args} { upvar _ _ # parse args: array set _ {-no-result 0 -uplevel 0 -convert-result {}} while {[llength $args] > 2} { if {![info exists _([set o [lindex $args 0]])]} { break } if {[string is boolean -strict $_($o)]} { set _($o) [expr {! $_($o)}] set args [lrange $args 1 end] } else { if {[llength $args] <= 2} { return -code error "value expected for option $o" } set _($o) [lindex $args 1] set args [lrange $args 2 end] } } unset -nocomplain o if {[llength $args] < 2 || [llength $args] > 3} { return -code error "wrong # args: should be \"[lindex [info level [info level]] 0] ?-no-result? reptime lst ?outcmd?\"" } set _(outcmd) {puts} set args [lassign $args reptime lst] if {[llength $args]} { set _(outcmd) [lindex $args 0] } # avoid output if only once: if {[lindex $reptime 0] <= 1 || ([llength $reptime] > 1 && [lindex $reptime 1] == 1)} { set _(-no-result) 1 } if {![info exists _(itm)]} { array set _ [list itm {} reptime $reptime starttime [clock milliseconds] -from-run 1] } else { array set _ [list reptime $reptime] } # process measurement: foreach _(c) [_test_get_commands $lst] { {*}$_(outcmd) "% [regsub -all {\n[ \t]*} $_(c) {; }]" if {[regexp {^\s*\#} $_(c)]} continue if {[regexp {^\s*(?:setup|cleanup)\s+} $_(c)]} { set _(c) [lindex $_(c) 1] if {$_(-uplevel)} { set _(c) [list uplevel 1 $_(c)] } {*}$_(outcmd) [if 1 $_(c)] continue } if {$_(-uplevel)} { set _(c) [list uplevel 1 $_(c)] } set _(ittime) $_(reptime) # if output result (and not once): if {!$_(-no-result)} { set _(r) [if 1 $_(c)] if {$_(-convert-result) ne ""} { set _(r) [if 1 $_(-convert-result)] } {*}$_(outcmd) $_(r) if {[llength $_(ittime)] > 1} { # decrement max-count lset _(ittime) 1 [expr {[lindex $_(ittime) 1] - 1}] } } {*}$_(outcmd) [set _(m) [timerate $_(c) {*}$_(ittime)]] lappend _(itm) $_(m) {*}$_(outcmd) "" } if {$_(-from-run)} { _test_out_total } } }; # end of namespace ::tclTestPerf tcl9.0.3/tests-perf/listPerf.tcl0000644000175000017500000011150615104661341016143 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # listPerf.tcl -- # # This file provides performance tests for list operations. Run # tclsh listPerf.tcl help # for options. # ------------------------------------------------------------------------ # # See the file "license.terms" for information on usage and redistribution # of this file. # # Note: this file does not use the test-performance.tcl framework as we want # more direct control over timerate options. catch {package require twapi} namespace eval perf::list { variable perfScript [file normalize [info script]] # Test for each of these lengths variable Lengths {10 100 1000 10000} variable RunTimes set RunTimes(command) 0.0 set RunTimes(total) 0.0 variable Options array set Options { --print-comments 0 --print-iterations 0 } # Procs used for calibrating overhead proc proc2args {a b} {} proc proc3args {a b c} {} proc print {s} { puts $s } proc print_usage {} { puts stderr "Usage: [file tail [info nameofexecutable]] $::argv0 \[options\] \[command ...\]" puts stderr "\t--description DESC\tHuman readable description of test run" puts stderr "\t--label LABEL\tA label used to identify test environment" puts stderr "\t--print-comments\tPrint comment for each test" puts stderr "\t--print-iterations\tPrint number of iterations run for each test" } proc setup {argv} { variable Options variable Lengths while {[llength $argv]} { set argv [lassign $argv arg] switch -glob -- $arg { --print-comments - --print-iterations { set Options($arg) 1 } --label - --description { if {[llength $argv] == 0} { error "Missing value for option $arg" } set argv [lassign $argv val] set Options($arg) $val } --lengths { if {[llength $argv] == 0} { error "Missing value for option $arg" } set argv [lassign $argv val] set Lengths $val } -- { # Remaining will be passed back to the caller break } --* { puts stderr "Unknown option $arg" print_usage exit 1 } default { # Remaining will be passed back to the caller set argv [linsert $argv 0 $arg] break; } } } return $argv } proc format_timings {us iters} { variable Options if {!$Options(--print-iterations)} { return "[format {%#10.4f} $us]" } return "[format {%#10.4f} $us] [format {%8d} $iters]" } proc measure {id script args} { variable NullOverhead variable RunTimes variable Options set opts(-overhead) "" set opts(-runs) 5 while {[llength $args]} { set args [lassign $args opt] if {[llength $args] == 0} { error "No argument supplied for $opt option. Test: $id" } set args [lassign $args val] switch $opt { -setup - -cleanup - -overhead - -time - -runs - -reps { set opts($opt) $val } default { error "Unknown option $opt. Test: $id" } } } set timerate_args {} if {[info exists opts(-time)]} { lappend timerate_args $opts(-time) } if {[info exists opts(-reps)]} { if {[info exists opts(-time)]} { set timerate_args [list $opts(-time) $opts(-reps)] } else { # Force the default for first time option set timerate_args [list 1000 $opts(-reps)] } } elseif {[info exists opts(-time)]} { set timerate_args [list $opts(-time)] } if {[info exists opts(-setup)]} { uplevel 1 $opts(-setup) } # Cache the empty overhead to prevent unnecessary delays. Note if you modify # to cache other scripts, the cache key must be AFTER substituting the # overhead script in the caller's context. if {$opts(-overhead) eq ""} { if {![info exists NullOverhead]} { set NullOverhead [lindex [timerate {}] 0] } set overhead_us $NullOverhead } else { # The overhead measurements might use setup so we need to setup # first and then cleanup in preparation for setting up again for # the script to be measured if {[info exists opts(-setup)]} { uplevel 1 $opts(-setup) } set overhead_us [lindex [uplevel 1 [list timerate $opts(-overhead)]] 0] if {[info exists opts(-cleanup)]} { uplevel 1 $opts(-cleanup) } } set timings {} for {set i 0} {$i < $opts(-runs)} {incr i} { if {[info exists opts(-setup)]} { uplevel 1 $opts(-setup) } lappend timings [uplevel 1 [list timerate -overhead $overhead_us $script {*}$timerate_args]] if {[info exists opts(-cleanup)]} { uplevel 1 $opts(-cleanup) } } set timings [lsort -real -index 0 $timings] if {$opts(-runs) > 15} { set ignore [expr {$opts(-runs)/8}] } elseif {$opts(-runs) >= 5} { set ignore 2 } else { set ignore 0 } # Ignore highest and lowest set timings [lrange $timings 0 end-$ignore] # Average it out set us 0 set iters 0 foreach timing $timings { set us [expr {$us + [lindex $timing 0]}] set iters [expr {$iters + [lindex $timing 2]}] } set us [expr {$us/[llength $timings]}] set iters [expr {$iters/[llength $timings]}] set RunTimes(command) [expr {$RunTimes(command) + $us}] print "P [format_timings $us $iters] $id" } proc comment {args} { variable Options if {$Options(--print-comments)} { print "# [join $args { }]" } } proc spanned_list {len} { # Note - for small len, this will not create a spanned list set delta [expr {$len/8}] return [lrange [lrepeat [expr {$len+(2*$delta)}] a] $delta [expr {$delta+$len-1}]] } proc print_separator {command} { comment [string repeat = 80] comment Command: $command } oo::class create ListPerf { constructor {args} { my variable Opts # Note default Opts can be overridden in construct as well as in measure set Opts [dict merge { -setup { set L [lrepeat $len a] set Lspan [perf::list::spanned_list $len] } -cleanup { unset -nocomplain L unset -nocomplain Lspan unset -nocomplain L2 } } $args] } method measure {comment script locals args} { my variable Opts dict with locals {} ::perf::list::measure $comment $script {*}[dict merge $Opts $args] } method option {opt val} { my variable Opts dict set Opts $opt $val } method option_unset {opt} { my variable Opts unset -nocomplain Opts($opt) } } proc linsert_describe {share_mode len at num iters} { return "linsert L\[$len\] $share_mode $num elems $iters times at $at" } proc linsert_perf {} { variable Lengths print_separator linsert ListPerf create perf -overhead {set L {}} -time 1000 # Note: Const indices take different path through bytecode than variable # indices hence separate cases below # Var case foreach share_mode {shared unshared} { set idx 0 if {$share_mode eq "shared"} { comment == Insert into empty lists comment Insert one element into empty list measure [linsert_describe shared 0 "0 (var)" 1 1] {linsert $L $idx ""} -setup {set idx 0; set L {}} } else { comment == Insert into empty lists comment Insert one element into empty list measure [linsert_describe unshared 0 "0 (var)" 1 1] {linsert {} $idx ""} -setup {set idx 0} } foreach idx_str [list 0 1 mid end-1 end] { foreach len $Lengths { if {$idx_str eq "mid"} { set idx [expr {$len/2}] } else { set idx $idx_str } # perf option -reps $reps set reps 1000 if {$share_mode eq "shared"} { comment Insert once to shared list with variable index perf measure [linsert_describe shared $len "$idx (var)" 1 1] \ {linsert $L $idx x} [list len $len idx $idx] -overhead {} -reps 100000 comment Insert multiple times to shared list with variable index perf measure [linsert_describe shared $len "$idx (var)" 1 $reps] { set L [linsert $L $idx X] } [list len $len idx $idx] -reps $reps comment Insert multiple items multiple times to shared list with variable index perf measure [linsert_describe shared $len "$idx (var)" 5 $reps] { set L [linsert $L $idx X X X X X] } [list len $len idx $idx] -reps $reps } else { # NOTE : the Insert once case is left out for unshared lists # because it requires re-init on every iteration resulting # in a lot of measurement noise comment Insert multiple times to unshared list with variable index perf measure [linsert_describe unshared $len "$idx (var)" 1 $reps] { set L [linsert $L[set L {}] $idx X] } [list len $len idx $idx] -reps $reps comment Insert multiple items multiple times to unshared list with variable index perf measure [linsert_describe unshared $len "$idx (var)" 5 $reps] { set L [linsert $L[set L {}] $idx X X X X X] } [list len $len idx $idx] -reps $reps } } } } # Const index foreach share_mode {shared unshared} { if {$share_mode eq "shared"} { comment == Insert into empty lists comment Insert one element into empty list measure [linsert_describe shared 0 "0 (const)" 1 1] {linsert $L 0 ""} -setup {set L {}} } else { comment == Insert into empty lists comment Insert one element into empty list measure [linsert_describe unshared 0 "0 (const)" 1 1] {linsert {} 0 ""} } foreach idx_str [list 0 1 mid end end-1] { foreach len $Lengths { # Note end, end-1 explicitly calculated as otherwise they # are not treated as const if {$idx_str eq "mid"} { set idx [expr {$len/2}] } elseif {$idx_str eq "end"} { set idx [expr {$len-1}] } elseif {$idx_str eq "end-1"} { set idx [expr {$len-2}] } else { set idx $idx_str } #perf option -reps $reps set reps 100 if {$share_mode eq "shared"} { comment Insert once to shared list with const index perf measure [linsert_describe shared $len "$idx (const)" 1 1] \ "linsert \$L $idx x" [list len $len] -overhead {} -reps 10000 comment Insert multiple times to shared list with const index perf measure [linsert_describe shared $len "$idx (const)" 1 $reps] \ "set L \[linsert \$L $idx X\]" [list len $len] -reps $reps comment Insert multiple items multiple times to shared list with const index perf measure [linsert_describe shared $len "$idx (const)" 5 $reps] \ "set L \[linsert \$L $idx X X X X X\]" [list len $len] -reps $reps } else { comment Insert multiple times to unshared list with const index perf measure [linsert_describe unshared $len "$idx (const)" 1 $reps] \ "set L \[linsert \$L\[set L {}\] $idx X]" [list len $len] -reps $reps comment Insert multiple items multiple times to unshared list with const index perf measure [linsert_describe unshared $len "$idx (const)" 5 $reps] \ "set L \[linsert \$L\[set L {}\] $idx X X X X X]" [list len $len] -reps $reps } } } } # Note: no span tests because the inserts above will themselves create # spanned lists perf destroy } proc list_describe {len text} { return "list L\[$len\] $text" } proc list_perf {} { variable Lengths print_separator list ListPerf create perf foreach len $Lengths { set s [join [lrepeat $len x]] comment Create a list from a string perf measure [list_describe $len "from a string"] {list $s} [list s $s len $len] } foreach len $Lengths { comment Create a list from expansion - single list (special optimal case) perf measure [list_describe $len "from a {*}list"] {list {*}$L} [list len $len] comment Create a list from two lists - real test of expansion speed perf measure [list_describe $len "from a {*}list {*}list"] {list {*}$L {*}$L} [list len [expr {$len/2}]] } perf destroy } proc lappend_describe {share_mode len num iters} { return "lappend L\[$len\] $share_mode $num elems $iters times" } proc lappend_perf {} { variable Lengths print_separator lappend ListPerf create perf -setup {set L [lrepeat [expr {$len/4}] x]} # Shared foreach len $Lengths { comment Append to a shared list variable multiple times perf measure [lappend_describe shared [expr {$len/2}] 1 $len] { set L2 $L; # Make shared lappend L x } [list len $len] -reps $len -overhead {set L2 $L} } # Unshared foreach len $Lengths { comment Append to a unshared list variable multiple times perf measure [lappend_describe unshared [expr {$len/2}] 1 $len] { lappend L x } [list len $len] -reps $len } # Span foreach len $Lengths { comment Append to a unshared-span list variable multiple times perf measure [lappend_describe unshared-span [expr {$len/2}] 1 $len] { lappend Lspan x } [list len $len] -reps $len } perf destroy } proc lpop_describe {share_mode len at reps} { return "lpop L\[$len\] $share_mode at $at $reps times" } proc lpop_perf {} { variable Lengths print_separator lpop ListPerf create perf # Shared perf option -overhead {set L2 $L} foreach len $Lengths { set reps [expr {($len >= 1000 ? ($len/2) : $len) - 2}] foreach idx {0 1 end-1 end} { comment Pop element at position $idx from a shared list variable perf measure [lpop_describe shared $len $idx $reps] { set L2 $L lpop L $idx } [list len $len idx $idx] -reps $reps } } # Unshared perf option -overhead {} foreach len $Lengths { set reps [expr {($len >= 1000 ? ($len/2) : $len) - 2}] foreach idx {0 1 end-1 end} { comment Pop element at position $idx from an unshared list variable perf measure [lpop_describe unshared $len $idx $reps] { lpop L $idx } [list len $len idx $idx] -reps $reps } } perf destroy # Nested ListPerf create perf -setup { set L [lrepeat $len [list a b]] } # Shared, nested index perf option -overhead {set L2 $L; set L L2} foreach len $Lengths { set reps [expr {($len >= 1000 ? ($len/2) : $len) - 2}] foreach idx {0 1 end-1 end} { perf measure [lpop_describe shared $len "{$idx 0}" $reps] { set L2 $L lpop L $idx 0 set L $L2 } [list len $len idx $idx] -reps $reps } } # TODO - Nested Unshared # Not sure how to measure performance. When unshared there is no copy # so deleting a nested index repeatedly is not feasible perf destroy } proc lassign_describe {share_mode len num reps} { return "lassign L\[$len\] $share_mode $num elems $reps times" } proc lassign_perf {} { variable Lengths print_separator lassign ListPerf create perf foreach share_mode {shared unshared} { foreach len $Lengths { if {$share_mode eq "shared"} { set reps 1000 comment Reflexive lassign - shared perf measure [lassign_describe shared $len 1 $reps] { set L2 $L set L2 [lassign $L2 v] } [list len $len] -overhead {set L2 $L} -reps $reps comment Reflexive lassign - shared, multiple perf measure [lassign_describe shared $len 5 $reps] { set L2 $L set L2 [lassign $L2 a b c d e] } [list len $len] -overhead {set L2 $L} -reps $reps } else { set reps [expr {($len >= 1000 ? ($len/2) : $len) - 2}] comment Reflexive lassign - unshared perf measure [lassign_describe unshared $len 1 $reps] { set L [lassign $L v] } [list len $len] -reps $reps } } } perf destroy } proc lrepeat_describe {len num} { return "lrepeat L\[$len\] $num elems at a time" } proc lrepeat_perf {} { variable Lengths print_separator lrepeat ListPerf create perf -reps 100000 foreach len $Lengths { comment Generate a list from a single repeated element perf measure [lrepeat_describe $len 1] { lrepeat $len a } [list len $len] comment Generate a list from multiple repeated elements perf measure [lrepeat_describe $len 5] { lrepeat $len a b c d e } [list len $len] } perf destroy } proc lreverse_describe {share_mode len} { return "lreverse L\[$len\] $share_mode" } proc lreverse_perf {} { variable Lengths print_separator lreverse ListPerf create perf -reps 10000 foreach share_mode {shared unshared} { foreach len $Lengths { if {$share_mode eq "shared"} { comment Reverse a shared list perf measure [lreverse_describe shared $len] { lreverse $L } [list len $len] if {$len > 100} { comment Reverse a shared-span list perf measure [lreverse_describe shared-span $len] { lreverse $Lspan } [list len $len] } } else { comment Reverse a unshared list perf measure [lreverse_describe unshared $len] { set L [lreverse $L[set L {}]] } [list len $len] -overhead {set L $L; set L {}} if {$len >= 100} { comment Reverse a unshared-span list perf measure [lreverse_describe unshared-span $len] { set Lspan [lreverse $Lspan[set Lspan {}]] } [list len $len] -overhead {set Lspan $Lspan; set Lspan {}} } } } } perf destroy } proc llength_describe {share_mode len} { return "llength L\[$len\] $share_mode" } proc llength_perf {} { variable Lengths print_separator llength ListPerf create perf -reps 100000 foreach len $Lengths { comment Length of a list perf measure [llength_describe shared $len] { llength $L } [list len $len] if {$len >= 100} { comment Length of a span list perf measure [llength_describe shared-span $len] { llength $Lspan } [list len $len] } } perf destroy } proc lindex_describe {share_mode len at} { return "lindex L\[$len\] $share_mode at $at" } proc lindex_perf {} { variable Lengths print_separator lindex ListPerf create perf -reps 100000 foreach len $Lengths { comment Index into a list set idx [expr {$len/2}] perf measure [lindex_describe shared $len $idx] { lindex $L $idx } [list len $len idx $idx] if {$len >= 100} { comment Index into a span list perf measure [lindex_describe shared-span $len $idx] { lindex $Lspan $idx } [list len $len idx $idx] } } perf destroy } proc lrange_describe {share_mode len range} { return "lrange L\[$len\] $share_mode range $range" } proc lrange_perf {} { variable Lengths print_separator lrange ListPerf create perf -time 1000 -reps 100000 foreach share_mode {shared unshared} { foreach len $Lengths { set eighth [expr {$len/8}] set ranges [list \ [list 0 0] [list 0 end-1] \ [list $eighth [expr {3*$eighth}]] \ [list $eighth [expr {7*$eighth}]] \ [list 1 end] [list end-1 end] \ ] foreach range $ranges { comment Range $range in $share_mode list of length $len if {$share_mode eq "shared"} { perf measure [lrange_describe shared $len $range] \ "lrange \$L $range" [list len $len range $range] } else { perf measure [lrange_describe unshared $len $range] \ "lrange \[lrepeat \$len\ a] $range" \ [list len $len range $range] -overhead {lrepeat $len a} } } if {$len >= 100} { foreach range $ranges { comment Range $range in ${share_mode}-span list of length $len if {$share_mode eq "shared"} { perf measure [lrange_describe shared-span $len $range] \ "lrange \$Lspan {*}$range" [list len $len range $range] } else { perf measure [lrange_describe unshared-span $len $range] \ "lrange \[perf::list::spanned_list \$len\] $range" \ [list len $len range $range] -overhead {perf::list::spanned_list $len} } } } } } perf destroy } proc lset_describe {share_mode len at} { return "lset L\[$len\] $share_mode at $at" } proc lset_perf {} { variable Lengths print_separator lset ListPerf create perf -reps 10000 # Shared foreach share_mode {shared unshared} { foreach len $Lengths { foreach idx {0 1 end-1 end end+1} { comment lset at position $idx in a $share_mode list variable if {$share_mode eq "shared"} { perf measure [lset_describe shared $len $idx] { set L2 $L lset L $idx X } [list len $len idx $idx] -overhead {set L2 $L} } else { perf measure [lset_describe unshared $len $idx] { lset L $idx X } [list len $len idx $idx] } } } } perf destroy # Nested ListPerf create perf -setup { set L [lrepeat $len [list a b]] } foreach share_mode {shared unshared} { foreach len $Lengths { foreach idx {0 1 end-1 end} { comment lset at position $idx in a $share_mode list variable if {$share_mode eq "shared"} { perf measure [lset_describe shared $len "{$idx 0}"] { set L2 $L lset L $idx 0 X } [list len $len idx $idx] -overhead {set L2 $L} } else { perf measure [lset_describe unshared $len "{$idx 0}"] { lset L $idx 0 {X Y} } [list len $len idx $idx] } } } } perf destroy } proc lremove_describe {share_mode len at nremoved} { return "lremove L\[$len\] $share_mode $nremoved elements at $at" } proc lremove_perf {} { variable Lengths print_separator lremove ListPerf create perf -reps 10000 foreach share_mode {shared unshared} { foreach len $Lengths { foreach idx [list 0 1 [expr {$len/2}] end-1 end] { if {$share_mode eq "shared"} { comment Remove one element from shared list perf measure [lremove_describe shared $len $idx 1] \ {lremove $L $idx} [list len $len idx $idx] } else { comment Remove one element from unshared list set reps [expr {$len >= 1000 ? ($len/8) : ($len-2)}] perf measure [lremove_describe unshared $len $idx 1] \ {set L [lremove $L[set L {}] $idx]} [list len $len idx $idx] \ -overhead {set L $L; set L {}} -reps $reps } } if {$share_mode eq "shared"} { comment Remove multiple elements from shared list perf measure [lremove_describe shared $len [list 0 1 [expr {$len/2}] end-1 end] 5] { lremove $L 0 1 [expr {$len/2}] end-1 end } [list len $len] } } # Span foreach len $Lengths { foreach idx [list 0 1 [expr {$len/2}] end-1 end] { if {$share_mode eq "shared"} { comment Remove one element from shared-span list perf measure [lremove_describe shared-span $len $idx 1] \ {lremove $Lspan $idx} [list len $len idx $idx] } else { comment Remove one element from unshared-span list set reps [expr {$len >= 1000 ? ($len/8) : ($len-2)}] perf measure [lremove_describe unshared-span $len $idx 1] \ {set Lspan [lremove $Lspan[set Lspan {}] $idx]} [list len $len idx $idx] \ -overhead {set Lspan $Lspan; set Lspan {}} -reps $reps } } if {$share_mode eq "shared"} { comment Remove multiple elements from shared-span list perf measure [lremove_describe shared-span $len [list 0 1 [expr {$len/2}] end-1 end] 5] { lremove $Lspan 0 1 [expr {$len/2}] end-1 end } [list len $len] } } } perf destroy } proc lreplace_describe {share_mode len first last ninsert {times 1}} { if {$last < $first} { return "lreplace L\[$len\] $share_mode 0 ($first:$last) elems at $first with $ninsert elems $times times." } return "lreplace L\[$len\] $share_mode $first:$last with $ninsert elems $times times." } proc lreplace_perf {} { variable Lengths print_separator lreplace set default_reps 10000 ListPerf create perf -reps $default_reps foreach share_mode {shared unshared} { # Insert only foreach len $Lengths { set reps [expr {$len <= 100 ? ($len-2) : ($len/8)}] foreach first [list 0 1 [expr {$len/2}] end-1 end] { if {$share_mode eq "shared"} { comment Insert one to shared list perf measure [lreplace_describe shared $len $first -1 1] { lreplace $L $first -1 x } [list len $len first $first] comment Insert multiple to shared list perf measure [lreplace_describe shared $len $first -1 10] { lreplace $L $first -1 X X X X X X X X X X } [list len $len first $first] comment Insert one to shared list repeatedly perf measure [lreplace_describe shared $len $first -1 1 $reps] { set L [lreplace $L $first -1 x] } [list len $len first $first] -reps $reps comment Insert multiple to shared list repeatedly perf measure [lreplace_describe shared $len $first -1 10 $reps] { set L [lreplace $L $first -1 X X X X X X X X X X] } [list len $len first $first] -reps $reps } else { comment Insert one to unshared list perf measure [lreplace_describe unshared $len $first -1 1] { set L [lreplace $L[set L {}] $first -1 x] } [list len $len first $first] -overhead { set L $L; set L {} } -reps $reps comment Insert multiple to unshared list perf measure [lreplace_describe unshared $len $first -1 10] { set L [lreplace $L[set L {}] $first -1 X X X X X X X X X X] } [list len $len first $first] -overhead { set L $L; set L {} } -reps $reps } } } # Delete only foreach len $Lengths { set reps [expr {$len <= 100 ? ($len-2) : ($len/8)}] foreach first [list 0 1 [expr {$len/2}] end-1 end] { if {$share_mode eq "shared"} { comment Delete one from shared list perf measure [lreplace_describe shared $len $first $first 0] { lreplace $L $first $first } [list len $len first $first] } else { comment Delete one from unshared list perf measure [lreplace_describe unshared $len $first $first 0] { set L [lreplace $L[set L {}] $first $first x] } [list len $len first $first] -overhead { set L $L; set L {} } -reps $reps } } } # Insert + delete foreach len $Lengths { set reps [expr {$len <= 100 ? ($len-2) : ($len/8)}] foreach range [list {0 1} {1 2} {end-2 end-1} {end-1 end}] { lassign $range first last if {$share_mode eq "shared"} { comment Insertions more than deletions from shared list perf measure [lreplace_describe shared $len $first $last 3] { lreplace $L $first $last X Y Z } [list len $len first $first last $last] comment Insertions same as deletions from shared list perf measure [lreplace_describe shared $len $first $last 2] { lreplace $L $first $last X Y } [list len $len first $first last $last] comment Insertions fewer than deletions from shared list perf measure [lreplace_describe shared $len $first $last 1] { lreplace $L $first $last X } [list len $len first $first last $last] } else { comment Insertions more than deletions from unshared list perf measure [lreplace_describe unshared $len $first $last 3] { set L [lreplace $L[set L {}] $first $last X Y Z] } [list len $len first $first last $last] -overhead { set L $L; set L {} } -reps $reps comment Insertions same as deletions from unshared list perf measure [lreplace_describe unshared $len $first $last 2] { set L [lreplace $L[set L {}] $first $last X Y ] } [list len $len first $first last $last] -overhead { set L $L; set L {} } -reps $reps comment Insertions fewer than deletions from unshared list perf measure [lreplace_describe unshared $len $first $last 1] { set L [lreplace $L[set L {}] $first $last X] } [list len $len first $first last $last] -overhead { set L $L; set L {} } -reps $reps } } } # Spanned Insert + delete foreach len $Lengths { set reps [expr {$len <= 100 ? ($len-2) : ($len/8)}] foreach range [list {0 1} {1 2} {end-2 end-1} {end-1 end}] { lassign $range first last if {$share_mode eq "shared"} { comment Insertions more than deletions from shared-span list perf measure [lreplace_describe shared-span $len $first $last 3] { lreplace $Lspan $first $last X Y Z } [list len $len first $first last $last] comment Insertions same as deletions from shared-span list perf measure [lreplace_describe shared-span $len $first $last 2] { lreplace $Lspan $first $last X Y } [list len $len first $first last $last] comment Insertions fewer than deletions from shared-span list perf measure [lreplace_describe shared-span $len $first $last 1] { lreplace $Lspan $first $last X } [list len $len first $first last $last] } else { comment Insertions more than deletions from unshared-span list perf measure [lreplace_describe unshared-span $len $first $last 3] { set Lspan [lreplace $Lspan[set Lspan {}] $first $last X Y Z] } [list len $len first $first last $last] -overhead { set Lspan $Lspan; set Lspan {} } -reps $reps comment Insertions same as deletions from unshared-span list perf measure [lreplace_describe unshared-span $len $first $last 2] { set Lspan [lreplace $Lspan[set Lspan {}] $first $last X Y ] } [list len $len first $first last $last] -overhead { set Lspan $Lspan; set Lspan {} } -reps $reps comment Insertions fewer than deletions from unshared-span list perf measure [lreplace_describe unshared-span $len $first $last 1] { set Lspan [lreplace $Lspan[set Lspan {}] $first $last X] } [list len $len first $first last $last] -overhead { set Lspan $Lspan; set Lspan {} } -reps $reps } } } } perf destroy } proc split_describe {len} { return "split L\[$len\]" } proc split_perf {} { variable Lengths print_separator split ListPerf create perf -setup {set S [string repeat "x " $len]} foreach len $Lengths { comment Split a string perf measure [split_describe $len] { split $S " " } [list len $len] } } proc join_describe {share_mode len} { return "join L\[$len\] $share_mode" } proc join_perf {} { variable Lengths print_separator join ListPerf create perf -reps 10000 foreach len $Lengths { comment Join a list perf measure [join_describe shared $len] { join $L } [list len $len] } foreach len $Lengths { comment Join a spanned list perf measure [join_describe shared-span $len] { join $Lspan } [list len $len] } perf destroy } proc lsearch_describe {share_mode len} { return "lsearch L\[$len\] $share_mode" } proc lsearch_perf {} { variable Lengths print_separator lsearch ListPerf create perf -reps 100000 foreach len $Lengths { comment Search a list perf measure [lsearch_describe shared $len] { lsearch $L needle } [list len $len] } foreach len $Lengths { comment Search a spanned list perf measure [lsearch_describe shared-span $len] { lsearch $Lspan needle } [list len $len] } perf destroy } proc foreach_describe {share_mode len} { return "foreach L\[$len\] $share_mode" } proc foreach_perf {} { variable Lengths print_separator foreach ListPerf create perf -reps 10000 foreach len $Lengths { comment Iterate through a list perf measure [foreach_describe shared $len] { foreach e $L {} } [list len $len] } foreach len $Lengths { comment Iterate a spanned list perf measure [foreach_describe shared-span $len] { foreach e $Lspan {} } [list len $len] } perf destroy } proc lmap_describe {share_mode len} { return "lmap L\[$len\] $share_mode" } proc lmap_perf {} { variable Lengths print_separator lmap ListPerf create perf -reps 10000 foreach len $Lengths { comment Iterate through a list perf measure [lmap_describe shared $len] { lmap e $L {} } [list len $len] } foreach len $Lengths { comment Iterate a spanned list perf measure [lmap_describe shared-span $len] { lmap e $Lspan {} } [list len $len] } perf destroy } proc get_sort_sample {{spanned 0}} { variable perfScript variable sortSampleText if {![info exists sortSampleText]} { set fd [open $perfScript] set sortSampleText [split [read $fd] ""] close $fd } set sortSampleText [string range $sortSampleText 0 9999] # NOTE: do NOT cache list result in a variable as we need it unshared if {$spanned} { return [lrange [split $sortSampleText ""] 1 end-1] } else { return [split $sortSampleText ""] } } proc lsort_describe {share_mode len} { return "lsort L\[$len] $share_mode" } proc lsort_perf {} { print_separator lsort ListPerf create perf -setup {} comment Sort a shared list perf measure [lsort_describe shared [llength [perf::list::get_sort_sample]]] { lsort $L } {} -setup {set L [perf::list::get_sort_sample]} comment Sort a shared-span list perf measure [lsort_describe shared-span [llength [perf::list::get_sort_sample 1]]] { lsort $L } {} -setup {set L [perf::list::get_sort_sample 1]} comment Sort an unshared list perf measure [lsort_describe unshared [llength [perf::list::get_sort_sample]]] { lsort [perf::list::get_sort_sample] } {} -overhead {perf::list::get_sort_sample} comment Sort an unshared-span list perf measure [lsort_describe unshared-span [llength [perf::list::get_sort_sample 1]]] { lsort [perf::list::get_sort_sample 1] } {} -overhead {perf::list::get_sort_sample 1} perf destroy } proc concat_describe {canonicality len elemlen} { return "concat L\[$len\] $canonicality with elements of length $elemlen" } proc concat_perf {} { variable Lengths print_separator concat ListPerf create perf -reps 100000 foreach len $Lengths { foreach elemlen {1 100} { comment Pure lists (no string representation) perf measure [concat_describe "pure lists" $len $elemlen] { concat $L $L } [list len $len elemlen $elemlen] -setup { set L [lrepeat $len [string repeat a $elemlen]] } comment Canonical lists (with string representation) perf measure [concat_describe "canonical lists" $len $elemlen] { concat $L $L } [list len $len elemlen $elemlen] -setup { set L [lrepeat $len [string repeat a $elemlen]] append x x $L; # Generate string while keeping internal rep list unset x } comment Non-canonical lists perf measure [concat_describe "non-canonical lists" $len $elemlen] { concat $L $L } [list len $len elemlen $elemlen] -setup { set L [string repeat "[string repeat a $elemlen] " $len] llength $L } } } # Span version foreach len $Lengths { foreach elemlen {1 100} { comment Pure span lists (no string representation) perf measure [concat_describe "pure spanned lists" $len $elemlen] { concat $L $L } [list len $len elemlen $elemlen] -setup { set L [lrange [lrepeat [expr {$len+2}] [string repeat a $elemlen]] 1 end-1] } comment Canonical span lists (with string representation) perf measure [concat_describe "canonical spanned lists" $len $elemlen] { concat $L $L } [list len $len elemlen $elemlen] -setup { set L [lrange [lrepeat [expr {$len+2}] [string repeat a $elemlen]] 1 end-1] append x x $L; # Generate string while keeping internal rep list unset x } } } perf destroy } proc test {} { variable RunTimes variable Options set selections [perf::list::setup $::argv] if {[llength $selections] == 0} { set commands [info commands ::perf::list::*_perf] } else { set commands [lmap sel $selections { if {$sel eq "help"} { print_usage exit 0 } set cmd ::perf::list::${sel}_perf if {$cmd ni [info commands ::perf::list::*_perf]} { puts stderr "Error: command $sel is not known or supported. Skipping." continue } set cmd }] } comment Setting up timerate -calibrate {} if {[info exists Options(--label)]} { print "L $Options(--label)" } print "V [info patchlevel]" print "E [info nameofexecutable]" if {[info exists Options(--description)]} { print "D $Options(--description)" } set twapi_keys {-privatebytes -workingset -workingsetpeak} if {[info commands ::twapi::get_process_memory_info] ne ""} { set twapi_vm_pre [::twapi::get_process_memory_info] } foreach cmd [lsort -dictionary $commands] { set RunTimes(command) 0.0 $cmd set RunTimes(total) [expr {$RunTimes(total)+$RunTimes(command)}] print "P [format_timings $RunTimes(command) 1] [string range $cmd 14 end-5] total run time" } # Print total runtime in same format as timerate output print "P [format_timings $RunTimes(total) 1] Total run time" if {[info exists twapi_vm_pre]} { set twapi_vm_post [::twapi::get_process_memory_info] set MB 1048576.0 foreach key $twapi_keys { set pre [expr {[dict get $twapi_vm_pre $key]/$MB}] set post [expr {[dict get $twapi_vm_post $key]/$MB}] print "P [format_timings $pre 1] Memory (MB) $key pre-test" print "P [format_timings $post 1] Memory (MB) $key post-test" print "P [format_timings [expr {$post-$pre}] 1] Memory (MB) delta $key" } } if {[info commands memory] ne ""} { foreach line [split [memory info] \n] { if {$line eq ""} continue set line [split $line] set val [expr {[lindex $line end]/1000.0}] set line [string trim [join [lrange $line 0 end-1]]] print "P [format_timings $val 1] memdbg $line (in thousands)" } print "# Allocations not freed on exit written to the lost-memory.tmp file." print "# These will have to be manually compared." # env TCL_FINALIZE_ON_EXIT must be set to 1 for this. # DO NOT SET HERE - set ::env(TCL_FINALIZE_ON_EXIT) 1 # Must be set in environment before starting tclsh else bogus results if {[info exists Options(--label)]} { set dump_file list-memory-$Options(--label).memdmp } else { set dump_file list-memory-[pid].memdmp } memory onexit $dump_file } } } if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { ::perf::list::test } tcl9.0.3/tests-perf/list.perf.tcl0000644000175000017500000001041215104661341016253 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # list.perf.tcl -- # # This file provides performance tests for comparison of tcl-speed # of list facilities. # # ------------------------------------------------------------------------ # # Copyright (c) 2024 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # if {![namespace exists ::tclTestPerf]} { source [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-List { namespace path {::tclTestPerf} proc test-lsearch-regress {{reptime 1000}} { _test_run -no-result $reptime { # found-first immediately, list with 5000 strings with ca. 50 chars elements: setup { set str [join [lrepeat 13 "XXX"] /]; set l [lrepeat 5000 $str]; llength $l } { lsearch $l $str } { lsearch -glob $l $str } { lsearch -exact $l $str } { lsearch -dictionary $l $str } { lsearch -exact -dictionary $l $str } { lsearch -nocase $l $str } { lsearch -nocase -glob $l $str } { lsearch -nocase -exact $l $str } { lsearch -nocase -dictionary $l $str } { lsearch -nocase -exact -dictionary $l $str } } } proc test-lsearch-nf-regress {{reptime 1000}} { _test_run -no-result $reptime { # not-found, list with 5000 strings with ca. 50 chars elements: setup { set str [join [lrepeat 13 "XXX"] /]; set sNF $str/NF; set l [lrepeat 5000 $str]; llength $l } { lsearch $l $sNF } { lsearch -glob $l $sNF } { lsearch -exact $l $sNF } { lsearch -dictionary $l $sNF } { lsearch -exact -dictionary $l $sNF } { lsearch -sorted $l $sNF } { lsearch -bisect $l $sNF } { lsearch -nocase $l $sNF } { lsearch -nocase -glob $l $sNF } { lsearch -nocase -exact $l $sNF } { lsearch -nocase -dictionary $l $sNF } { lsearch -nocase -exact -dictionary $l $sNF } { lsearch -nocase -sorted $l $sNF } { lsearch -nocase -bisect $l $sNF } } } proc test-lsearch-nf-non-opti-fast {{reptime 1000}} { _test_run -no-result $reptime { # not-found, list with 5000 strings with ca. 50 chars elements: setup { set str [join [lrepeat 13 "XXX"] /]; set sNF "$str/*"; set l [lrepeat 5000 $str]; llength $l } { lsearch -sorted -dictionary $l $sNF } { lsearch -bisect -dictionary $l $sNF } { lsearch -sorted -nocase -dictionary $l $sNF } { lsearch -bisect -nocase -dictionary $l $sNF } } } proc test-lsearch-nf-non-opti-slow {{reptime 1000}} { _test_run -no-result $reptime { # not-found, list with 5000 strings with ca. 50 chars elements: setup { set str [join [lrepeat 13 "XXX"] /]; set sNF "$str/*"; set l [lrepeat 5000 $str]; llength $l } { lsearch $l $sNF } { lsearch -glob $l $sNF } { lsearch -nocase $l $sNF } { lsearch -nocase -glob $l $sNF } } } proc test-lseq {{reptime 1000}} { _test_run $reptime { setup { set i 0 } { lseq 10 } { lseq 0 count 10 } { lseq 0 count 10 by 1 } { lseq 0 9 } { lseq 0 to 9 } { lseq 0 9 1 } { lseq 0 to 9 by 1 } } } proc test-lseq-expr {{reptime 1000}} { _test_run $reptime { setup { set i 0 } { lseq [expr {$i+10}] } { lseq {$i+10} } { lseq [expr {$i+0}] count [expr {$i+10}] } { lseq {$i+0} count {$i+10} } { lseq [expr {$i+0}] count [expr {$i+10}] by [expr {$i+1}] } { lseq {$i+0} count {$i+10} by {$i+1} } { lseq [expr {$i+0}] [expr {$i+9}] } { lseq {$i+0} {$i+9} } { lseq [expr {$i+0}] to [expr {$i+9}] } { lseq {$i+0} to {$i+9} } { lseq [expr {$i+0}] [expr {$i+9}] [expr {$i+1}] } { lseq {$i+0} {$i+9} {$i+1} } { lseq [expr {$i+0}] to [expr {$i+9}] by [expr {$i+1}] } { lseq {$i+0} to {$i+9} by {$i+1} } } } proc test {{reptime 1000}} { test-lsearch-regress $reptime test-lsearch-nf-regress $reptime test-lsearch-nf-non-opti-fast $reptime test-lsearch-nf-non-opti-slow $reptime test-lseq [expr {$reptime/2}] test-lseq-expr [expr {$reptime/2}] puts \n**OK** } }; # end of ::tclTestPerf-List # ------------------------------------------------------------------------ # if calling direct: if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { array set in {-time 500} array set in $argv ::tclTestPerf-List::test $in(-time) } tcl9.0.3/tests-perf/file.perf.tcl0000644000175000017500000000477615076154263016247 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # file.perf.tcl -- # # This file provides performance tests for comparison of tcl-speed # of file commands and subsystem. # # ------------------------------------------------------------------------ # # Copyright (c) 2024 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # if {![namespace exists ::tclTestPerf]} { source -encoding utf-8 [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-File { namespace path {::tclTestPerf} proc _get_new_file_path_obj [list [list p [info script]]] { # always generate new string object here (ensure it is not a "cached" object of type path): string trimright "$p "; # costs of object "creation" smaller than 1 microsecond } # regression tests for bug-02d5d65d70adab97 (fix for [02d5d65d70adab97]): proc test-file-access-regress {{reptime 1000}} { _test_run -no-result $reptime { setup { set fn [::tclTestPerf-File::_get_new_file_path_obj] } # file exists on "cached" file path: { file exists $fn } # file exists on not "cached" (fresh generated) file path: { set fn [::tclTestPerf-File::_get_new_file_path_obj]; file exists $fn } setup { set fn [::tclTestPerf-File::_get_new_file_path_obj] } # file attributes on "cached" file path: { file attributes $fn -readonly } # file attributes on not "cached" (fresh generated) file path: { set fn [::tclTestPerf-File::_get_new_file_path_obj]; file attributes $fn -readonly } setup { set fn [::tclTestPerf-File::_get_new_file_path_obj] } # file stat on "cached" file path: { file stat $fn st } # file stat on not "cached" (fresh generated) file path: { set fn [::tclTestPerf-File::_get_new_file_path_obj]; file stat $fn st } setup { set fn [::tclTestPerf-File::_get_new_file_path_obj] } # touch on "cached" file path: { close [open $fn rb] } # touch on not "cached" (fresh generated) file path: { set fn [::tclTestPerf-File::_get_new_file_path_obj]; close [open $fn rb] } } } proc test {{reptime 1000}} { test-file-access-regress $reptime puts \n**OK** } }; # end of ::tclTestPerf-File # ------------------------------------------------------------------------ # if calling direct: if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { array set in {-time 500} array set in $argv ::tclTestPerf-File::test $in(-time) } tcl9.0.3/tests-perf/comparePerf.tcl0000644000175000017500000002376215104661341016624 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # comparePerf.tcl -- # # Script to compare performance data from multiple runs. # # ------------------------------------------------------------------------ # # See the file "license.terms" for information on usage and redistribution # of this file. # # Usage: # tclsh comparePerf.tcl [--regexp RE] [--ratio time|rate] [--combine] [--base BASELABEL] PERFFILE ... # # The test data from each input file is tabulated so as to compare the results # of test runs. If a PERFFILE does not exist, it is retried by adding the # .perf extension. If the --regexp is specified, only test results whose # id matches RE are examined. # # If the --combine option is specified, results of test sets with the same # label are combined and averaged in the output. # # If the --base option is specified, the BASELABEL is used as the label to use # the base timing. Otherwise, the label of the first data file is used. # # If --ratio option is "time" the ratio of test timing vs base test timing # is shown. If "rate" (default) the inverse is shown. # # If --no-header is specified, the header describing test configuration is # not output. # # The format of input files is as follows: # # Each line must begin with one of the characters below followed by a space # followed by a string whose semantics depend on the initial character. # E - Full path to the Tcl executable that was used to generate the file # V - The Tcl patchlevel of the implementation # D - A description for the test run for human consumption # L - A label used to identify run environment. The --combine option will # average all measuremets that have the same label. An input file without # a label is treated as having a unique label and not combined with any other. # P - A test measurement (see below) # R - The number of runs made for the each test # # - A comment, may be an arbitrary string. Usually included in performance # data to describe the test. This is silently ignored # # Any lines not matching one of the above are ignored with a warning to stderr. # # A line beginning with the "P" marker is a test measurement. The first word # following is a floating point number representing the test runtime. # The remaining line (after trimming of whitespace) is the id of the test. # Test generators are encouraged to make the id a well-defined machine-parseable # as well human readable description of the test. The id must not appear more # than once. An example test measurement line: # P 2.32280 linsert in unshared L[10000] 1 elems 10000 times at 0 (var) # Note here the iteration count is not present. # namespace eval perf::compare { # List of dictionaries, one per input file variable PerfData } proc perf::compare::warn {message} { puts stderr "Warning: $message" } proc perf::compare::print {text} { puts stdout $text } proc perf::compare::slurp {testrun_path} { variable PerfData set runtimes [dict create] set path [file normalize $testrun_path] set fd [open $path] array set header {} while {[gets $fd line] >= 0} { set line [regsub -all {\s+} [string trim $line] " "] switch -glob -- $line { "#*" { # Skip comments } "R *" - "L *" - "D *" - "V *" - "T *" - "E *" { set marker [lindex $line 0] if {[info exists header($marker)]} { warn "Ignoring $marker record (duplicate): \"$line\"" } set header($marker) [string range $line 2 end] } "P *" { if {[scan $line "P %f %n" runtime id_start] == 2} { set id [string range $line $id_start end] if {[dict exists $runtimes $id]} { warn "Ignoring duplicate test id \"$id\"" } else { dict set runtimes $id $runtime } } else { warn "Invalid test result line format: \"$line\"" } } default { puts stderr "Warning: ignoring unrecognized line \"$line\"" } } } close $fd set result [dict create Input $path Runtimes $runtimes] foreach {c k} { L Label V Version E Executable D Description } { if {[info exists header($c)]} { dict set result $k $header($c) } } return $result } proc perf::compare::burp {test_sets} { variable Options # Print the key for each test run set header " " set separator " " foreach test_set $test_sets { set test_set_key "\[[incr test_set_num]\]" if {! $Options(--no-header)} { print "$test_set_key" foreach k {Label Executable Version Input Description} { if {[dict exists $test_set $k]} { print "$k: [dict get $test_set $k]" } } } append header $test_set_key $separator set separator " "; # Expand because later columns have ratio } set header [string trimright $header] if {! $Options(--no-header)} { print "" if {$Options(--ratio) eq "rate"} { set ratio_description "ratio of baseline to the measurement (higher is faster)." } else { set ratio_description "ratio of measurement to the baseline (lower is faster)." } print "The first column \[1\] is the baseline measurement." print "Subsequent columns are pairs of the additional measurement and " print $ratio_description print "" } # Print the actual test run data print $header set test_sets [lassign $test_sets base_set] set fmt {%#10.5f} set fmt_ratio {%-6.2f} foreach {id base_runtime} [dict get $base_set Runtimes] { if {[info exists Options(--regexp)]} { if {![regexp $Options(--regexp) $id]} { continue } } if {$Options(--print-test-number)} { set line "[format %-4s [incr counter].]" } else { set line "" } append line [format $fmt $base_runtime] foreach test_set $test_sets { if {[dict exists $test_set Runtimes $id]} { set runtime [dict get $test_set Runtimes $id] if {$Options(--ratio) eq "time"} { if {$base_runtime != 0} { set ratio [format $fmt_ratio [expr {$runtime/$base_runtime}]] } else { if {$runtime == 0} { set ratio "NaN " } else { set ratio "Inf " } } } else { if {$runtime != 0} { set ratio [format $fmt_ratio [expr {$base_runtime/$runtime}]] } else { if {$base_runtime == 0} { set ratio "NaN " } else { set ratio "Inf " } } } append line "|" [format $fmt $runtime] "|" $ratio } else { append line [string repeat { } 11] } } append line "|" $id print $line } } proc perf::compare::chew {test_sets} { variable Options # Combine test sets that have the same label, averaging the values set unlabeled_sets {} array set labeled_sets {} foreach test_set $test_sets { # If there is no label, treat as independent set if {![dict exists $test_set Label]} { lappend unlabeled_sets $test_set } else { lappend labeled_sets([dict get $test_set Label]) $test_set } } foreach label [array names labeled_sets] { set combined_set [lindex $labeled_sets($label) 0] set runtimes [dict get $combined_set Runtimes] foreach test_set [lrange $labeled_sets($label) 1 end] { dict for {id timing} [dict get $test_set Runtimes] { dict lappend runtimes $id $timing } } dict for {id timings} $runtimes { set total [tcl::mathop::+ {*}$timings] dict set runtimes $id [expr {$total/[llength $timings]}] } dict set combined_set Runtimes $runtimes set labeled_sets($label) $combined_set } # Choose the "base" test set if {![info exists Options(--base)]} { set first_set [lindex $test_sets 0] if {[dict exists $first_set Label]} { # Use label of first as the base set Options(--base) [dict get $first_set Label] } } if {[info exists Options(--base)] && $Options(--base) ne ""} { lappend combined_sets $labeled_sets($Options(--base));# Will error if no such unset labeled_sets($Options(--base)) } else { lappend combined_sets [lindex $unlabeled_sets 0] set unlabeled_sets [lrange $unlabeled_sets 1 end] } foreach label [array names labeled_sets] { lappend combined_sets $labeled_sets($label) } lappend combined_sets {*}$unlabeled_sets return $combined_sets } proc perf::compare::setup {argv} { variable Options array set Options { --ratio rate --combine 0 --print-test-number 0 --no-header 0 } while {[llength $argv]} { set argv [lassign $argv arg] switch -glob -- $arg { -r - --regexp { if {[llength $argv] == 0} { error "Missing value for option $arg" } set argv [lassign $argv val] set Options(--regexp) $val } --ratio { if {[llength $argv] == 0} { error "Missing value for option $arg" } set argv [lassign $argv val] if {$val ni {time rate}} { error "Value for option $arg must be either \"time\" or \"rate\"" } set Options(--ratio) $val } --print-test-number - --combine - --no-header { set Options($arg) 1 } --base { if {[llength $argv] == 0} { error "Missing value for option $arg" } set argv [lassign $argv val] set Options($arg) $val } -- { # Remaining will be passed back to the caller break } --* { error "Unknown option $arg" } -* { error "Unknown option -[lindex $arg 0]" } default { # Remaining will be passed back to the caller set argv [linsert $argv 0 $arg] break; } } } set paths {} foreach path $argv { set path [file join $path]; # Convert from native else glob fails if {[file isfile $path]} { lappend paths $path continue } if {[file isfile $path.perf]} { lappend paths $path.perf continue } lappend paths {*}[glob -nocomplain $path] } return $paths } proc perf::compare::main {} { variable Options set paths [setup $::argv] if {[llength $paths] == 0} { error "No test data files specified." } set test_data [list ] set seen [dict create] foreach path $paths { if {![dict exists $seen $path]} { lappend test_data [slurp $path] dict set seen $path "" } } if {$Options(--combine)} { set test_data [chew $test_data] } burp $test_data } perf::compare::main tcl9.0.3/tests-perf/clock.perf.tcl0000644000175000017500000004670215104661341016406 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # test-performance.tcl -- # # This file provides common performance tests for comparison of tcl-speed # degradation by switching between branches. # (currently for clock ensemble only) # # ------------------------------------------------------------------------ # # Copyright © 2014 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # array set in {-time 500} if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { array set in $argv } ## common test performance framework: if {![namespace exists ::tclTestPerf]} { source [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-TclClock { namespace path {::tclTestPerf} ## set testing defaults: set ::env(TCL_TZ) :CET # warm-up interpreter compiler env, clock platform-related features: ## warm-up test-related features (load clock.tcl, system zones, locales, etc.): clock scan "" -gmt 1 clock scan "" clock scan "" -timezone :CET clock scan "" -format "" -locale en clock scan "" -format "" -locale de ## ------------------------------------------ proc test-format {{reptime 1000}} { _test_run $reptime { # Format : short, week only (in gmt) {clock format 1482525936 -format "%u" -gmt 1} # Format : short, week only (system zone) {clock format 1482525936 -format "%u"} # Format : short, week only (CEST) {clock format 1482525936 -format "%u" -timezone :CET} # Format : date only (in gmt) {clock format 1482525936 -format "%Y-%m-%d" -gmt 1} # Format : date only (system zone) {clock format 1482525936 -format "%Y-%m-%d"} # Format : date only (CEST) {clock format 1482525936 -format "%Y-%m-%d" -timezone :CET} # Format : time only (in gmt) {clock format 1482525936 -format "%H:%M" -gmt 1} # Format : time only (system zone) {clock format 1482525936 -format "%H:%M"} # Format : time only (CEST) {clock format 1482525936 -format "%H:%M" -timezone :CET} # Format : time only (in gmt) {clock format 1482525936 -format "%H:%M:%S" -gmt 1} # Format : time only (system zone) {clock format 1482525936 -format "%H:%M:%S"} # Format : time only (CEST) {clock format 1482525936 -format "%H:%M:%S" -timezone :CET} # Format : default (in gmt) {clock format 1482525936 -gmt 1 -locale en} # Format : default (system zone) {clock format 1482525936 -locale en} # Format : default (CEST) {clock format 1482525936 -timezone :CET -locale en} # Format : ISO date-time (in gmt, numeric zone) {clock format 1246379400 -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1} # Format : ISO date-time (system zone, CEST, numeric zone) {clock format 1246379400 -format "%Y-%m-%dT%H:%M:%S %z"} # Format : ISO date-time (CEST, numeric zone) {clock format 1246379400 -format "%Y-%m-%dT%H:%M:%S %z" -timezone :CET} # Format : ISO date-time (system zone, CEST) {clock format 1246379400 -format "%Y-%m-%dT%H:%M:%S %Z"} # Format : julian day with time (in gmt): {clock format 1246379415 -format "%J %H:%M:%S" -gmt 1} # Format : julian day with time (system zone): {clock format 1246379415 -format "%J %H:%M:%S"} # Format : locale date-time (en): {clock format 1246379415 -format "%x %X" -locale en} # Format : locale date-time (de): {clock format 1246379415 -format "%x %X" -locale de} # Format : locale lookup table month: {clock format 1246379400 -format "%b" -locale en -gmt 1} # Format : locale lookup 2 tables - month and day: {clock format 1246379400 -format "%b %Od" -locale en -gmt 1} # Format : locale lookup 3 tables - week, month and day: {clock format 1246379400 -format "%a %b %Od" -locale en -gmt 1} # Format : locale lookup 4 tables - week, month, day and year: {clock format 1246379400 -format "%a %b %Od %Oy" -locale en -gmt 1} # Format : dynamic clock value (without converter caches): setup {set i 0} {clock format [incr i] -format "%Y-%m-%dT%H:%M:%S" -locale en -timezone :CET} cleanup {puts [clock format $i -format "%Y-%m-%dT%H:%M:%S" -locale en -timezone :CET]} # Format : dynamic clock value (without any converter caches, zone range overflow): setup {set i 0} {clock format [incr i 86400] -format "%Y-%m-%dT%H:%M:%S" -locale en -timezone :CET} cleanup {puts [clock format $i -format "%Y-%m-%dT%H:%M:%S" -locale en -timezone :CET]} # Format : dynamic format (cacheable) {clock format 1246379415 -format [string trim "%d.%m.%Y %H:%M:%S "] -gmt 1} # Format : all (in gmt, locale en) {clock format 1482525936 -format "%%a = %a | %%A = %A | %%b = %b | %%h = %h | %%B = %B | %%C = %C | %%d = %d | %%e = %e | %%g = %g | %%G = %G | %%H = %H | %%I = %I | %%j = %j | %%J = %J | %%k = %k | %%l = %l | %%m = %m | %%M = %M | %%N = %N | %%p = %p | %%P = %P | %%Q = %Q | %%s = %s | %%S = %S | %%t = %t | %%u = %u | %%U = %U | %%V = %V | %%w = %w | %%W = %W | %%y = %y | %%Y = %Y | %%z = %z | %%Z = %Z | %%n = %n | %%EE = %EE | %%EC = %EC | %%Ey = %Ey | %%n = %n | %%Od = %Od | %%Oe = %Oe | %%OH = %OH | %%Ok = %Ok | %%OI = %OI | %%Ol = %Ol | %%Om = %Om | %%OM = %OM | %%OS = %OS | %%Ou = %Ou | %%Ow = %Ow | %%Oy = %Oy" -gmt 1 -locale en} # Format : all (in CET, locale de) {clock format 1482525936 -format "%%a = %a | %%A = %A | %%b = %b | %%h = %h | %%B = %B | %%C = %C | %%d = %d | %%e = %e | %%g = %g | %%G = %G | %%H = %H | %%I = %I | %%j = %j | %%J = %J | %%k = %k | %%l = %l | %%m = %m | %%M = %M | %%N = %N | %%p = %p | %%P = %P | %%Q = %Q | %%s = %s | %%S = %S | %%t = %t | %%u = %u | %%U = %U | %%V = %V | %%w = %w | %%W = %W | %%y = %y | %%Y = %Y | %%z = %z | %%Z = %Z | %%n = %n | %%EE = %EE | %%EC = %EC | %%Ey = %Ey | %%n = %n | %%Od = %Od | %%Oe = %Oe | %%OH = %OH | %%Ok = %Ok | %%OI = %OI | %%Ol = %Ol | %%Om = %Om | %%OM = %OM | %%OS = %OS | %%Ou = %Ou | %%Ow = %Ow | %%Oy = %Oy" -timezone :CET -locale de} } } proc test-scan {{reptime 1000}} { _test_run -convert-result {clock format $_(r) -locale en} $reptime { # Scan : date (in gmt) {clock scan "25.11.2015" -format "%d.%m.%Y" -base 0 -gmt 1} # Scan : date (system time zone, with base) {clock scan "25.11.2015" -format "%d.%m.%Y" -base 0} # Scan : date (system time zone, without base) {clock scan "25.11.2015" -format "%d.%m.%Y"} # Scan : greedy match {clock scan "111" -format "%d%m%y" -base 0 -gmt 1} {clock scan "1111" -format "%d%m%y" -base 0 -gmt 1} {clock scan "11111" -format "%d%m%y" -base 0 -gmt 1} {clock scan "111111" -format "%d%m%y" -base 0 -gmt 1} # Scan : greedy match (space separated) {clock scan "1 1 1" -format "%d%m%y" -base 0 -gmt 1} {clock scan "111 1" -format "%d%m%y" -base 0 -gmt 1} {clock scan "1 111" -format "%d%m%y" -base 0 -gmt 1} {clock scan "1 11 1" -format "%d%m%y" -base 0 -gmt 1} {clock scan "1 11 11" -format "%d%m%y" -base 0 -gmt 1} {clock scan "11 11 11" -format "%d%m%y" -base 0 -gmt 1} # Scan : time (in gmt) {clock scan "10:35:55" -format "%H:%M:%S" -base 1000000000 -gmt 1} # Scan : time (system time zone, with base) {clock scan "10:35:55" -format "%H:%M:%S" -base 1000000000} # Scan : time (gmt, without base) {clock scan "10:35:55" -format "%H:%M:%S" -gmt 1} # Scan : time (system time zone, without base) {clock scan "10:35:55" -format "%H:%M:%S"} # Scan : date-time (in gmt) {clock scan "25.11.2015 10:35:55" -format "%d.%m.%Y %H:%M:%S" -base 0 -gmt 1} # Scan : date-time (system time zone with base) {clock scan "25.11.2015 10:35:55" -format "%d.%m.%Y %H:%M:%S" -base 0} # Scan : date-time (system time zone without base) {clock scan "25.11.2015 10:35:55" -format "%d.%m.%Y %H:%M:%S"} # Scan : julian day in gmt {clock scan 2451545 -format %J -gmt 1} # Scan : julian day in system TZ {clock scan 2451545 -format %J} # Scan : julian day in other TZ {clock scan 2451545 -format %J -timezone +0200} # Scan : julian day with time: {clock scan "2451545 10:20:30" -format "%J %H:%M:%S"} # Scan : julian day with time (greedy match): {clock scan "2451545 102030" -format "%J%H%M%S"} # Scan : century, lookup table month {clock scan {1970 Jan 2} -format {%C%y %b %d} -locale en -gmt 1} # Scan : century, lookup table month and day (both entries are first) {clock scan {1970 Jan 01} -format {%C%y %b %Od} -locale en -gmt 1} # Scan : century, lookup table month and day (list scan: entries with position 12 / 31) {clock scan {2016 Dec 31} -format {%C%y %b %Od} -locale en -gmt 1} # Scan : ISO date-time (CEST) {clock scan "2009-06-30T18:30:00+02:00" -format "%Y-%m-%dT%H:%M:%S%z"} {clock scan "2009-06-30T18:30:00 CEST" -format "%Y-%m-%dT%H:%M:%S %z"} # Scan : ISO date-time (UTC) {clock scan "2009-06-30T18:30:00Z" -format "%Y-%m-%dT%H:%M:%S%z"} {clock scan "2009-06-30T18:30:00 UTC" -format "%Y-%m-%dT%H:%M:%S %z"} # Scan : locale date-time (en): {clock scan "06/30/2009 18:30:15" -format "%x %X" -gmt 1 -locale en} # Scan : locale date-time (de): {clock scan "30.06.2009 18:30:15" -format "%x %X" -gmt 1 -locale de} # Scan : dynamic format (cacheable) {clock scan "25.11.2015 10:35:55" -format [string trim "%d.%m.%Y %H:%M:%S "] -base 0 -gmt 1} break # # Scan : long format test (allock chain) # {clock scan "25.11.2015" -format "%d.%m.%Y %d.%m.%Y %d.%m.%Y %d.%m.%Y %d.%m.%Y %d.%m.%Y %d.%m.%Y %d.%m.%Y" -base 0 -gmt 1} # # Scan : dynamic, very long format test (create obj representation, allock chain, GC, etc): # {clock scan "25.11.2015" -format [string repeat "[incr i] %d.%m.%Y %d.%m.%Y" 10] -base 0 -gmt 1} # # Scan : again: # {clock scan "25.11.2015" -format [string repeat "[incr i -1] %d.%m.%Y %d.%m.%Y" 10] -base 0 -gmt 1} } } proc test-freescan {{reptime 1000}} { _test_run -convert-result {clock format $_(r) -locale en} $reptime { # FreeScan : relative date {clock scan "5 years 18 months 385 days" -base 0 -gmt 1} # FreeScan : relative date with relative weekday {clock scan "5 years 18 months 385 days Fri" -base 0 -gmt 1} # FreeScan : relative date with ordinal month {clock scan "5 years 18 months 385 days next 1 January" -base 0 -gmt 1} # FreeScan : relative date with ordinal month and relative weekday {clock scan "5 years 18 months 385 days next January Fri" -base 0 -gmt 1} # FreeScan : ordinal month {clock scan "next January" -base 0 -gmt 1} # FreeScan : relative week {clock scan "next Fri" -base 0 -gmt 1} # FreeScan : relative weekday and week offset {clock scan "next January + 2 week" -base 0 -gmt 1} # FreeScan : time only with base {clock scan "19:18:30" -base 148863600 -gmt 1} # FreeScan : time only without base, gmt {clock scan "19:18:30" -gmt 1} # FreeScan : time only without base, system {clock scan "19:18:30"} # FreeScan : date, system time zone {clock scan "05/08/2016 20:18:30"} # FreeScan : date, supplied time zone {clock scan "05/08/2016 20:18:30" -timezone :CET} # FreeScan : date, supplied gmt (equivalent -timezone :GMT) {clock scan "05/08/2016 20:18:30" -gmt 1} # FreeScan : date, supplied time zone gmt {clock scan "05/08/2016 20:18:30" -timezone :GMT} # FreeScan : time only, numeric zone in string, base time gmt (exchange zones between gmt / -0500) {clock scan "20:18:30 -0500" -base 148863600 -gmt 1} # FreeScan : time only, zone in string (exchange zones between system / gmt) {clock scan "19:18:30 GMT" -base 148863600} # FreeScan : fast switch of zones in cycle - GMT, MST, CET (system) and EST {clock scan "19:18:30 MST" -base 148863600 -gmt 1 clock scan "19:18:30 EST" -base 148863600 } } } proc test-add {{reptime 1000}} { set tests { # Add : years {clock add 1246379415 5 years -gmt 1} # Add : months {clock add 1246379415 18 months -gmt 1} # Add : weeks {clock add 1246379415 20 weeks -gmt 1} # Add : days {clock add 1246379415 385 days -gmt 1} # Add : weekdays {clock add 1246379415 3 weekdays -gmt 1} # Add : hours {clock add 1246379415 5 hours -gmt 1} # Add : minutes {clock add 1246379415 55 minutes -gmt 1} # Add : seconds {clock add 1246379415 100 seconds -gmt 1} # Add : +/- in gmt {clock add 1246379415 -5 years +21 months -20 weeks +386 days -19 hours +30 minutes -10 seconds -gmt 1} # Add : +/- in system timezone {clock add 1246379415 -5 years +21 months -20 weeks +386 days -19 hours +30 minutes -10 seconds -timezone :CET} # Add : gmt {clock add 1246379415 -5 years 18 months 366 days 5 hours 30 minutes 10 seconds -gmt 1} # Add : system timezone {clock add 1246379415 -5 years 18 months 366 days 5 hours 30 minutes 10 seconds -timezone :CET} # Add : all in gmt {clock add 1246379415 4 years 18 months 50 weeks 378 days 3 weekdays 5 hours 30 minutes 10 seconds -gmt 1} # Add : all in system timezone {clock add 1246379415 4 years 18 months 50 weeks 378 days 3 weekdays 5 hours 30 minutes 10 seconds -timezone :CET} } # if does not support add of weekdays: if {[catch {clock add 0 3 weekdays -gmt 1}]} { regsub -all {\mweekdays\M} $tests "days" tests } _test_run -convert-result {clock format $_(r) -locale en} $reptime $tests } proc test-convert {{reptime 1000}} { _test_run $reptime { # Convert locale (en -> de): {clock format [clock scan "Tue May 30 2017" -format "%a %b %d %Y" -gmt 1 -locale en] -format "%a %b %d %Y" -gmt 1 -locale de} # Convert locale (de -> en): {clock format [clock scan "Di Mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale de] -format "%a %b %d %Y" -gmt 1 -locale en} # Convert TZ: direct {clock format [clock scan "19:18:30" -base 148863600 -timezone EST] -timezone MST} {clock format [clock scan "19:18:30" -base 148863600 -timezone MST] -timezone EST} # Convert TZ: included in scan string & format {clock format [clock scan "19:18:30 EST" -base 148863600] -format "%H:%M:%S %z" -timezone MST} {clock format [clock scan "19:18:30 EST" -base 148863600] -format "%H:%M:%S %z" -timezone EST} # Format locale 1x: comparison values {clock format 0 -gmt 1 -locale en} {clock format 0 -gmt 1 -locale de} {clock format 0 -gmt 1 -locale fr} # Format locale 2x: without switching locale (en, en) {clock format 0 -gmt 1 -locale en; clock format 0 -gmt 1 -locale en} # Format locale 2x: with switching locale (en, de) {clock format 0 -gmt 1 -locale en; clock format 0 -gmt 1 -locale de} # Format locale 3x: without switching locale (en, en, en) {clock format 0 -gmt 1 -locale en; clock format 0 -gmt 1 -locale en; clock format 0 -gmt 1 -locale en} # Format locale 3x: with switching locale (en, de, fr) {clock format 0 -gmt 1 -locale en; clock format 0 -gmt 1 -locale de; clock format 0 -gmt 1 -locale fr} # Scan locale 2x: without switching locale (en, en) + (de, de) {clock scan "Tue May 30 2017" -format "%a %b %d %Y" -gmt 1 -locale en; clock scan "Tue May 30 2017" -format "%a %b %d %Y" -gmt 1 -locale en} {clock scan "Di Mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale de; clock scan "Di Mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale de} # Scan locale 2x: with switching locale (en, de) {clock scan "Tue May 30 2017" -format "%a %b %d %Y" -gmt 1 -locale en; clock scan "Di Mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale de} # Scan locale 3x: with switching locale (en, de, fr) {clock scan "Tue May 30 2017" -format "%a %b %d %Y" -gmt 1 -locale en; clock scan "Di Mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale de; clock scan "mar. mai 30 2017" -format "%a %b %d %Y" -gmt 1 -locale fr} # Format TZ 2x: comparison values {clock format 0 -timezone CET -format "%Y-%m-%d %H:%M:%S %z"} {clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"} # Format TZ 2x: without switching {clock format 0 -timezone CET -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone CET -format "%Y-%m-%d %H:%M:%S %z"} {clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"} # Format TZ 2x: with switching {clock format 0 -timezone CET -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"} # Format TZ 3x: with switching (CET, EST, MST) {clock format 0 -timezone CET -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone MST -format "%Y-%m-%d %H:%M:%S %z"} # Format TZ 3x: with switching (GMT, EST, MST) {clock format 0 -gmt 1 -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone EST -format "%Y-%m-%d %H:%M:%S %z"; clock format 0 -timezone MST -format "%Y-%m-%d %H:%M:%S %z"} # FreeScan TZ 2x (+1 system-default): without switching TZ {clock scan "19:18:30 MST" -base 148863600; clock scan "19:18:30 MST" -base 148863600} {clock scan "19:18:30 EST" -base 148863600; clock scan "19:18:30 EST" -base 148863600} # FreeScan TZ 2x (+1 system-default): with switching TZ {clock scan "19:18:30 MST" -base 148863600; clock scan "19:18:30 EST" -base 148863600} # FreeScan TZ 2x (+1 gmt, +1 system-default) {clock scan "19:18:30 MST" -base 148863600 -gmt 1; clock scan "19:18:30 EST" -base 148863600} # Scan TZ: comparison included in scan string vs. given {clock scan "2009-06-30T18:30:00 CEST" -format "%Y-%m-%dT%H:%M:%S %z"} {clock scan "2009-06-30T18:30:00 CET" -format "%Y-%m-%dT%H:%M:%S %z"} {clock scan "2009-06-30T18:30:00" -timezone CET -format "%Y-%m-%dT%H:%M:%S"} } } proc test-other {{reptime 1000}} { _test_run $reptime { # Bad zone {catch {clock scan "1 day" -timezone BAD_ZONE -locale en}} # Scan : julian day (overflow) {catch {clock scan 5373485 -format %J}} setup {set _(org-reptime) $_(reptime); lset _(reptime) 1 50} # Scan : test rotate of GC objects (format is dynamic, so tcl-obj removed with last reference) setup {set i -1} {clock scan "[incr i] - 25.11.2015" -format "$i - %d.%m.%Y" -base 0 -gmt 1} # Scan : test reusability of GC objects (format is dynamic, so tcl-obj removed with last reference) setup {incr i; set j $i} {clock scan "[incr j -1] - 25.11.2015" -format "$j - %d.%m.%Y" -base 0 -gmt 1} setup {set _(reptime) $_(org-reptime); set j $i} {clock scan "[incr j -1] - 25.11.2015" -format "$j - %d.%m.%Y" -base 0 -gmt 1; if {!$j} {set j $i}} } } proc test-ensemble-perf {{reptime 1000}} { _test_run $reptime { # Clock clicks (ensemble) {clock clicks} # Clock clicks (direct) {::tcl::clock::clicks} # Clock seconds (ensemble) {clock seconds} # Clock seconds (direct) {::tcl::clock::seconds} # Clock microseconds (ensemble) {clock microseconds} # Clock microseconds (direct) {::tcl::clock::microseconds} # Clock scan (ensemble) {clock scan ""} # Clock scan (direct) {::tcl::clock::scan ""} # Clock format (ensemble) {clock format 0 -f %s} # Clock format (direct) {::tcl::clock::format 0 -f %s} } } proc test {{reptime 1000}} { puts "" test-ensemble-perf [expr {$reptime / 2}]; #fast enough test-format $reptime test-scan $reptime test-freescan $reptime test-add $reptime test-convert [expr {$reptime / 2}]; #fast enough test-other $reptime puts \n**OK** } }; # end of ::tclTestPerf-TclClock # ------------------------------------------------------------------------ # if calling direct: if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { ::tclTestPerf-TclClock::test $in(-time) } tcl9.0.3/tests-perf/chan.perf.tcl0000644000175000017500000000500115104661341016207 0ustar sergeisergei#!/usr/bin/tclsh # ------------------------------------------------------------------------ # # chan.perf.tcl -- # # This file provides performance tests for comparison of tcl-speed # of channel subsystem. # # ------------------------------------------------------------------------ # # Copyright (c) 2024 Serg G. Brester (aka sebres) # # See the file "license.terms" for information on usage and redistribution # of this file. # if {![namespace exists ::tclTestPerf]} { source [file join [file dirname [info script]] test-performance.tcl] } namespace eval ::tclTestPerf-Chan { namespace path {::tclTestPerf} proc _get_test_chan {{bufSize 4096}} { lassign [chan pipe] ch wch; fconfigure $ch -translation lf -encoding utf-8 -buffersize $bufSize -buffering full fconfigure $wch -translation lf -encoding utf-8 -buffersize $bufSize -buffering full exec [info nameofexecutable] -- $bufSize >@$wch << { set bufSize [lindex $::argv end] fconfigure stdout -translation lf -encoding utf-8 -buffersize $bufSize -buffering full set buf [string repeat test 1000]; # 4K # write ~ 10*1M + 10*2M + 10*10M + 1*20M: set i 0; while {$i < int((10*1e6 + 10*2e6 + 10*10e6 + 1*20e6)/4e3)} { #puts -nonewline stdout $i\t puts stdout $buf #flush stdout; # don't flush to use full buffer incr i } } & close $wch return $ch } # regression tests for [bug-da16d15574] (fix for [db4f2843cd]): proc test-read-regress {{reptime {50000 10}}} { _test_run -no-result $reptime { # with 4KB buffersize: setup { set ch [::tclTestPerf-Chan::_get_test_chan 4096]; fconfigure $ch -buffersize } # 10 * 1M: {read $ch [expr {int(1e6)}]} # 10 * 2M: {read $ch [expr {int(2e6)}]} # 10 * 10M: {read $ch [expr {int(10e6)}]} # 1 * 20M: {read $ch; break} cleanup { close $ch } # with 1MB buffersize: setup { set ch [::tclTestPerf-Chan::_get_test_chan 1048576]; fconfigure $ch -buffersize } # 10 * 1M: {read $ch [expr {int(1e6)}]} # 10 * 2M: {read $ch [expr {int(2e6)}]} # 10 * 10M: {read $ch [expr {int(10e6)}]} # 1 * 20M: {read $ch; break} cleanup { close $ch } } } proc test {{reptime 1000}} { test-read-regress puts \n**OK** } }; # end of ::tclTestPerf-Chan # ------------------------------------------------------------------------ # if calling direct: if {[info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]]} { array set in {-time 500} array set in $argv ::tclTestPerf-Chan::test $in(-time) } tcl9.0.3/tests/0000755000175000017500000000000015104662673012722 5ustar sergeisergeitcl9.0.3/tests/zlib.test0000644000175000017500000011476615104661341014571 0ustar sergeisergei# The file tests the tclZlib.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996-1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] testConstraint zlib [llength [info commands zlib]] testConstraint recentZlib 0 catch { # Work around a bug in some versions of zlib; known to manifest on at # least Mac OS X Mountain Lion... testConstraint recentZlib \ [package vsatisfies [zlib::pkgconfig get zlibVersion] 1.2.6] } test zlib-1.1 {zlib basics} -constraints zlib -returnCodes error -body { zlib } -result {wrong # args: should be "zlib subcommand ?arg ...?"} test zlib-1.2 {zlib basics} -constraints zlib -returnCodes error -body { zlib ? {} } -result {unknown or ambiguous subcommand "?": must be adler32, compress, crc32, decompress, deflate, gunzip, gzip, inflate, push, or stream} test zlib-1.3 {zlib basics} -constraints zlib -body { zlib::pkgconfig list } -result zlibVersion test zlib-1.4 {zlib basics} -constraints zlib -body { package present tcl::zlib } -result 2.0.1 test zlib-2.1 {zlib compress/decompress} zlib { zlib decompress [zlib compress abcdefghijklm] } abcdefghijklm test zlib-3.1 {zlib deflate/inflate} zlib { zlib inflate [zlib deflate abcdefghijklm] } abcdefghijklm test zlib-4.1 {zlib gzip/gunzip} zlib { zlib gunzip [zlib gzip abcdefghijklm] } abcdefghijklm test zlib-4.2 {zlib gzip/gunzip} zlib { set s [string repeat abcdef 5] list [zlib gunzip [zlib gzip $s -header {comment gorp}] -header head] \ [dict get $head comment] [dict get $head size] } {abcdefabcdefabcdefabcdefabcdef gorp 30} test zlib-5.1 {zlib adler32} zlib { format %x [expr {[zlib adler32 abcdeabcdeabcdeabcdeabcdeabcde] & 0xffffffff}] } b3b50b9b test zlib-5.2 {zlib adler32} zlib { format %x [expr {[zlib adler32 abcdeabcdeabcdeabcdeabcdeabcde 42] & 0xffffffff}] } b8830bc4 test zlib-5.3 {zlib adler32} -constraints zlib -returnCodes error -body { zlib adler32 abcdeabcdeabcdeabcdeabcdeabcde 42 x } -result {wrong # args: should be "zlib adler32 data ?startValue?"} test zlib-6.1 {zlib crc32} zlib { format %x [expr {[zlib crc32 abcdeabcdeabcdeabcdeabcdeabcde] & 0xffffffff}] } 6f73e901 test zlib-6.2 {zlib crc32} zlib { format %x [expr {[zlib crc32 abcdeabcdeabcdeabcdeabcdeabcde 42] & 0xffffffff}] } ce1c4914 test zlib-6.3 {zlib crc32} -constraints zlib -returnCodes error -body { zlib crc32 abcdeabcdeabcdeabcdeabcdeabcde 42 x } -result {wrong # args: should be "zlib crc32 data ?startValue?"} test zlib-6.4 {zlib crc32: bug 2662434} -constraints zlib -body { zlib crc32 "dabale arroz a la zorra el abad" } -result 3842832571 test zlib-7.0 {zlib stream} -constraints zlib -returnCodes error -setup { set s [zlib stream compress] } -body { $s ? } -cleanup { $s close } -result {bad option "?": must be add, checksum, close, eof, finalize, flush, fullflush, get, header, put, or reset} test zlib-7.1 {zlib stream} zlib { set s [zlib stream compress] $s put -finalize abcdeEDCBA set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result [zlib decompress $data] } {{} 136f033f abcdeEDCBA} test zlib-7.2 {zlib stream} zlib { set s [zlib stream decompress] $s put -finalize [zlib compress abcdeEDCBA] set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result $data } {{} 136f033f abcdeEDCBA} test zlib-7.3 {zlib stream} zlib { set s [zlib stream deflate] $s put -finalize abcdeEDCBA set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result [zlib inflate $data] } {{} 1 abcdeEDCBA} test zlib-7.4 {zlib stream} zlib { set s [zlib stream inflate] $s put -finalize [zlib deflate abcdeEDCBA] set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result $data } {{} 1 abcdeEDCBA} test zlib-7.5 {zlib stream} zlib { set s [zlib stream gzip] $s put -finalize abcdeEDCBA.. set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result [zlib gunzip $data] } {{} 69f34b6a abcdeEDCBA..} test zlib-7.6 {zlib stream} zlib { set s [zlib stream gunzip] $s put -finalize [zlib gzip abcdeEDCBA..] set data [$s get] set result [list [$s get] [format %x [$s checksum]]] $s close lappend result $data } {{} 69f34b6a abcdeEDCBA..} test zlib-7.7 {zlib stream: Bug 25842c161} -constraints zlib -body { set s [zlib stream deflate] $s put {} } -cleanup { catch {$s close} } -result "" # Also causes Tk Bug 10f2e7872b test zlib-7.8 {zlib stream: Bug b26e38a3e4} -constraints zlib -setup { expr {srand(12345)} set randdata {} for {set i 0} {$i<6001} {incr i} { append randdata [binary format c [expr {int(256*rand())}]] } } -body { set strm [zlib stream compress] for {set i 1} {$i<3000} {incr i} { $strm put $randdata } $strm put -finalize $randdata set data [$strm get] list [string length $data] [string length [zlib decompress $data]] } -cleanup { catch {$strm close} unset -nocomplain randdata data } -result {120185 18003000} test zlib-7.9 {zlib stream finalize (bug 25842c161)} -constraints zlib -setup { set z1 [zlib stream gzip] set z2 [zlib stream gzip] } -body { $z1 put ABCDEedbca.. $z1 finalize zlib gunzip [$z1 get] } -cleanup { $z1 close } -result ABCDEedbca.. test zlib-7.10 {zlib stream finalize (bug 25842c161)} -constraints zlib -setup { set z2 [zlib stream gzip] } -body { $z2 put -finalize ABCDEedbca.. zlib gunzip [$z2 get] } -cleanup { $z2 close } -result ABCDEedbca.. test zlib-7.11 {zlib stream put -finalize (bug 25842c161)} -constraints zlib -setup { set c [zlib stream gzip] set d [zlib stream gunzip] } -body { $c put abcdeEDCBA.. $c finalize $d put [$c get] $d finalize $d get } -cleanup { $c close $d close } -result abcdeEDCBA.. test zlib-7.12 {zlib stream put; zlib stream finalize (bug 25842c161)} -constraints zlib -setup { set c [zlib stream gzip] set d [zlib stream gunzip] } -body { $c put -finalize abcdeEDCBA.. $d put -finalize [$c get] $d get } -cleanup { $c close $d close } -result abcdeEDCBA.. test zlib-8.1 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.gz] } -body { set f [zlib push gzip [open $file w] -header {comment gorp}] puts $f "ok" close $f set f [zlib push gunzip [open $file]] list [gets $f] [dict get [chan configure $f -header] comment] } -cleanup { close $f removeFile $file } -result {ok gorp} test zlib-8.2 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.z] } -body { set f [zlib push compress [open $file w]] puts $f "ok" close $f set f [zlib push decompress [open $file]] gets $f } -cleanup { close $f removeFile $file } -result ok test zlib-8.3 {zlib transformation and fileevent} -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { fconfigure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [zlib gzip [string repeat a 81920]] close $c }}} 0] set port [lindex [fconfigure $srv -sockname] 2] set file [makeFile {} test.gz] set fout [open $file wb] } -body { set sin [socket localhost $port] try { fconfigure $sin -translation binary zlib push gunzip $sin after 1000 {set total timeout} fcopy $sin $fout -command {apply {{c {e {}}} { set ::total [expr {$e eq {} ? $c : $e}] }}} vwait total after cancel {set total timeout} } finally { close $sin } append total --> [file size $file] } -cleanup { close $fout close $srv removeFile $file } -result 81920-->81920 test zlib-8.4 {transformation and flushing: Bug 3517696} -setup { set file [makeFile {} test.z] set fd [open $file w] } -constraints zlib -body { zlib push compress $fd puts $fd "qwertyuiop" fconfigure $fd -flush sync puts $fd "qwertyuiop" } -cleanup { catch {close $fd} removeFile $file } -result {} test zlib-8.5 {transformation and flushing and fileevents: Bug 3525907} -setup { foreach {r w} [chan pipe] break } -constraints zlib -body { set ::res {} fconfigure $w -buffering none zlib push compress $w puts -nonewline $w qwertyuiop chan configure $w -flush sync after 500 {puts -nonewline $w asdfghjkl;close $w} fconfigure $r -blocking 0 -buffering none zlib push decompress $r fileevent $r readable {set msg [read $r];lappend ::res $msg;if {[eof $r]} {set ::done 1}} after 250 {lappend ::res MIDDLE} vwait ::done set ::res } -cleanup { catch {close $r} } -result {qwertyuiop MIDDLE asdfghjkl {}} test zlib-8.6 {transformation and fconfigure} -setup { set file [makeFile {} test.z] set fd [open $file wb] } -constraints zlib -body { list [fconfigure $fd] [zlib push compress $fd; fconfigure $fd] \ [chan pop $fd; fconfigure $fd] } -cleanup { catch {close $fd} removeFile $file } -result {{-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf} {-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf -checksum 1 -dictionary {}} {-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf}} test zlib-8.7 {transformation and fconfigure} -setup { set file [makeFile {} test.gz] set fd [open $file wb] } -constraints zlib -body { list [fconfigure $fd] [zlib push gzip $fd; fconfigure $fd] \ [chan pop $fd; fconfigure $fd] } -cleanup { catch {close $fd} removeFile $file } -result {{-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf} {-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf -checksum 0} {-blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar {} -profile strict -translation lf}} # Input is headers from fetching SPDY draft # Dictionary is that which is proposed _in_ SPDY draft set spdyHeaders "HTTP/1.0 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nX-Robots-Tag: noarchive\r\nLast-Modified: Tue, 05 Jun 2012 02:43:25 GMT\r\nETag: \"1338864205129|#public|0|en|||0\"\r\nExpires: Tue, 05 Jun 2012 16:17:11 GMT\r\nDate: Tue, 05 Jun 2012 16:17:06 GMT\r\nCache-Control: public, max-age=5\r\nX-Content-Type-Options: nosniff\r\nX-XSS-Protection: 1; mode=block\r\nServer: GSE\r\n" set spdyDict "optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchif-rangeif-unmodifiedsincemax-forwardsproxy-authorizationrangerefererteuser-agent100101200201202203204205206300301302303304305306307400401402403404405406407408409410411412413414415416417500501502503504505accept-rangesageetaglocationproxy-authenticatepublicretry-afterservervarywarningwww-authenticateallowcontent-basecontent-encodingcache-controlconnectiondatetrailertransfer-encodingupgradeviawarningcontent-languagecontent-lengthcontent-locationcontent-md5content-rangecontent-typeetagexpireslast-modifiedset-cookieMondayTuesdayWednesdayThursdayFridaySaturdaySundayJanFebMarAprMayJunJulAugSepOctNovDecchunkedtext/htmlimage/pngimage/jpgimage/gifapplication/xmlapplication/xhtmltext/plainpublicmax-agecharset=iso-8859-1utf-8gzipdeflateHTTP/1.1statusversionurl" test zlib-8.8 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide } -constraints zlib -body { zlib push compress $outSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -translation binary -buffering none fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide chan close $outSide set compressed [read $inSide] catch {zlib decompress $compressed} err opt list [string length [zlib decompress [zlib compress $spdyHeaders]]] \ $err [dict get $opt -errorcode] [zlib adler32 $spdyDict] } -cleanup { catch {close $outSide} catch {close $inSide} } -result {358 {need dictionary} {TCL ZLIB NEED_DICT 2381337010} 2381337010} test zlib-8.9 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream decompress] } -constraints zlib -body { zlib push compress $outSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -translation binary -buffering none fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders set result [fconfigure $outSide -checksum] chan pop $outSide chan close $outSide $strm put -dictionary $spdyDict [read $inSide] lappend result [string length $spdyHeaders] [string length [$strm get]] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {3064818174 358 358} test zlib-8.10 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide } -constraints {zlib recentZlib} -body { zlib push deflate $outSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -translation binary -buffering none fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide chan close $outSide set compressed [read $inSide] catch { zlib inflate $compressed throw UNREACHABLE "should be unreachable" } err opt list [string length [zlib deflate $spdyHeaders]] \ [string length $compressed] \ $err [dict get $opt -errorcode] } -cleanup { catch {close $outSide} catch {close $inSide} } -result {254 212 {data error} {TCL ZLIB DATA}} test zlib-8.11 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream inflate] } -constraints zlib -body { zlib push deflate $outSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -translation binary -buffering none fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide chan close $outSide $strm put -dictionary $spdyDict [read $inSide] list [string length $spdyHeaders] [string length [$strm get]] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {358 358} test zlib-8.12 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream compress] } -constraints zlib -body { $strm put -dictionary $spdyDict -finalize $spdyHeaders zlib push decompress $inSide fconfigure $outSide -blocking 1 -translation binary fconfigure $inSide -translation binary -dictionary $spdyDict puts -nonewline $outSide [$strm get] close $outSide list [string length $spdyHeaders] [string length [read $inSide]] \ [fconfigure $inSide -checksum] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {358 358 3064818174} test zlib-8.13 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream compress] } -constraints zlib -body { $strm put -dictionary $spdyDict -finalize $spdyHeaders zlib push decompress $inSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -translation binary fconfigure $inSide -translation binary puts -nonewline $outSide [$strm get] close $outSide list [string length $spdyHeaders] [string length [read $inSide]] \ [fconfigure $inSide -checksum] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {358 358 3064818174} test zlib-8.14 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream deflate] } -constraints zlib -body { $strm put -finalize -dictionary $spdyDict $spdyHeaders zlib push inflate $inSide fconfigure $outSide -blocking 1 -buffering none -translation binary fconfigure $inSide -translation binary -dictionary $spdyDict puts -nonewline $outSide [$strm get] close $outSide list [string length $spdyHeaders] [string length [read $inSide]] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {358 358} test zlib-8.15 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide set strm [zlib stream deflate] } -constraints zlib -body { $strm put -finalize -dictionary $spdyDict $spdyHeaders zlib push inflate $inSide -dictionary $spdyDict fconfigure $outSide -blocking 1 -buffering none -translation binary fconfigure $inSide -translation binary puts -nonewline $outSide [$strm get] close $outSide list [string length $spdyHeaders] [string length [read $inSide]] } -cleanup { catch {close $outSide} catch {close $inSide} catch {$strm close} } -result {358 358} test zlib-8.16 {Bug 3603553: buffer transfer with large writes} -setup { # Actual data isn't very important; needs to be substantially larger than # the internal buffer (32kB) and incompressible. set largeData {} for {set i 0;expr {srand(1)}} {$i < 100000} {incr i} { append largeData [lindex "a b c d e f g h i j k l m n o p" \ [expr {int(16*rand())}]] } set file [makeFile {} test.gz] } -constraints zlib -body { set f [open $file wb] fconfigure $f -buffering none zlib push gzip $f puts -nonewline $f $largeData close $f expr {[file size $file]<57648} } -cleanup { removeFile $file } -result 1 test zlib-8.17 {Bug dd260aaf: fconfigure} -setup { lassign [chan pipe] inSide outSide } -constraints zlib -body { zlib push inflate $inSide zlib push deflate $outSide list [chan configure $inSide -dictionary] [chan configure $outSide -dictionary] } -cleanup { catch {close $inSide} catch {close $outSide} } -result {{} {}} test zlib-8.18 {Bug dd260aaf: fconfigure} -setup { lassign [chan pipe] inSide outSide } -constraints zlib -body { zlib push inflate $inSide -dictionary "one two" zlib push deflate $outSide -dictionary "one two" list [chan configure $inSide -dictionary] [chan configure $outSide -dictionary] } -cleanup { catch {close $inSide} catch {close $outSide} } -result {{one two} {one two}} test zlib-8.19 {zlib transformation, bug f9eafc3886} -constraints zlib -setup { set file [makeFile {} test.gz] } -body { set f [zlib push gzip [open $file w] -header [list comment [string repeat A 500]]] } -cleanup { catch {close $f} removeFile $file } -returnCodes 1 -result {Comment too large for zip} test zlib-8.20 {zlib transformation, bug f9eafc3886} -constraints zlib -setup { set file [makeFile {} test.gz] } -body { set f [zlib push gzip [open $file w] -header [list filename [string repeat A 5000]]] } -cleanup { catch {close $f} removeFile $file } -returnCodes 1 -result {Filename too large for zip} test zlib-8.21 {zlib transformation, bug f9eafc3886} -constraints zlib -setup { set file [makeFile {} test.gz] } -body { set f [zlib push gzip [open $file w] -header [list comment \u100]] } -cleanup { catch {close $f} removeFile $file } -returnCodes 1 -result {Comment contains characters > 0xFF} test zlib-8.22 {zlib transformation, bug f9eafc3886} -constraints zlib -setup { set file [makeFile {} test.gz] } -body { set f [zlib push gzip [open $file w] -header [list filename \u100]] } -cleanup { catch {close $f} removeFile $file } -returnCodes 1 -result {Filename contains characters > 0xFF} test zlib-9.1 "check fcopy with push" -constraints zlib -setup { set sfile [makeFile {} testsrc.gz] set file [makeFile {} test.gz] set f [open $sfile wb] puts -nonewline $f [zlib gzip [string repeat a 81920]] close $f } -body { set fin [zlib push gunzip [open $sfile rb]] set fout [open $file wb] set total [fcopy $fin $fout] close $fin ; close $fout list copied $total size [file size $file] } -cleanup { removeFile $file removeFile $sfile } -result {copied 81920 size 81920} test zlib-9.2 "socket fcopy with push" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [zlib gzip [string repeat a 81920]] close $c set ::total -1 }}} 0] set file [makeFile {} test.gz] } -body { lassign [chan configure $srv -sockname] addr name port set sin [socket $addr $port] chan configure $sin -translation binary zlib push gunzip $sin after 1000 {set ::total timeout} vwait ::total after cancel {set ::total timeout} if {$::total != -1} {error "unexpected value $::total of ::total"} set total [fcopy $sin [set fout [open $file wb]]] close $sin close $fout list read $total size [file size $file] } -cleanup { close $srv removeFile $file } -result {read 81920 size 81920} test zlib-9.3 "socket fcopy bg (identity)" -constraints {tempNotWin zlib} -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { #puts "connection from $a:$p on $c" chan configure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [string repeat a 81920] close $c }}} 0] set file [makeFile {} test.gz] } -body { lassign [chan configure $srv -sockname] addr name port #puts "listening for connections on $addr $port" set sin [socket localhost $port] chan configure $sin -translation binary update set fout [open $file wb] after 1000 {set ::total timeout} fcopy $sin $fout -command {apply {{c {e {}}} { set ::total [expr {$e eq {} ? $c : $e}] }}} vwait ::total after cancel {set ::total timeout} close $sin; close $fout list read $::total size [file size $file] } -cleanup { close $srv removeFile $file } -returnCodes {ok error} -result {read 81920 size 81920} test zlib-9.4 "socket fcopy bg (gzip)" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [zlib gzip [string repeat a 81920]] close $c }}} 0] set file [makeFile {} test.gz] } -body { lassign [chan configure $srv -sockname] addr name port set sin [socket $addr $port] chan configure $sin -translation binary zlib push gunzip $sin update set fout [open $file wb] after 1000 {set ::total timeout} fcopy $sin $fout -command {apply {{c {e {}}} { set ::total [expr {$e eq {} ? $c : $e}] }}} vwait ::total after cancel {set ::total timeout} close $sin; close $fout list read $::total size [file size $file] } -cleanup { close $srv removeFile $file } -result {read 81920 size 81920} test zlib-9.5 "socket fcopy incremental (gzip)" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [zlib gzip [string repeat a 81920]] close $c }}} 0] proc zlib95copy {i o t c {e {}}} { incr t $c if {$e ne {}} { set ::total [list error $e] } elseif {[eof $i]} { set ::total [list eof $t] } else { fcopy $i $o -size 8192 -command [list zlib95copy $i $o $t] } } set file [makeFile {} test.gz] } -body { lassign [chan configure $srv -sockname] addr name port set sin [socket $addr $port] chan configure $sin -translation binary zlib push gunzip $sin update set fout [open $file wb] after 1000 {set ::total timeout} fcopy $sin $fout -size 8192 -command [list zlib95copy $sin $fout 0] vwait ::total after cancel {set ::total timeout} close $sin; close $fout list $::total size [file size $file] } -cleanup { close $srv rename zlib95copy {} removeFile $file } -result {{eof 81920} size 81920} test zlib-9.6 "bug #2818131 (gzip)" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push gzip $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary zlib push gunzip $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total after cancel {set ::total timeout} close $s set ::total } -cleanup { close $srv unset -nocomplain total } -result {eof 500} test zlib-9.7 "bug #2818131 (compress)" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push compress $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary zlib push decompress $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total after cancel {set ::total timeout} close $s set ::total } -cleanup { close $srv unset -nocomplain total } -result {eof 500} test zlib-9.8 "bug #2818131 (deflate)" -constraints zlib -setup { set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push deflate $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary zlib push inflate $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total after cancel {set ::total timeout} close $s set ::total } -cleanup { unset -nocomplain total close $srv } -result {eof 500} test zlib-9.9 "bug #2818131 (gzip mismatch)" -constraints zlib -setup { proc bgerror {s} {set ::total [list error $s]} set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push gzip $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] try { chan configure $s -translation binary zlib push inflate $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total } finally { after cancel {set ::total timeout} close $s } set ::total } -cleanup { unset -nocomplain total close $srv rename bgerror {} } -result {error {invalid block type}} test zlib-9.10 "bug #2818131 (compress mismatch)" -constraints zlib -setup { proc bgerror {s} {set ::total [list error $s]} set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push compress $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] try { chan configure $s -translation binary zlib push inflate $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total } finally { after cancel {set ::total timeout} close $s } set ::total } -cleanup { unset -nocomplain total close $srv rename bgerror {} } -result {error {invalid stored block lengths}} test zlib-9.11 "bug #2818131 (deflate mismatch)" -constraints zlib -setup { proc bgerror {s} {set ::total [list error $s]} set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary -buffering none -blocking 0 zlib push deflate $c puts -nonewline $c [string repeat hello 100] close $c }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] try { chan configure $s -translation binary zlib push gunzip $s chan event $s readable [list apply {{s} { set d [read $s] if {[eof $s]} { chan event $s readable {} set ::total [list eof [string length $d]] } }} $s] vwait ::total } finally { after cancel {set ::total timeout} close $s } set ::total } -cleanup { unset -nocomplain total close $srv rename bgerror {} } -result {error {incorrect header check}} test zlib-10.0 "bug #2818131 (close with null interp)" -constraints { zlib } -setup { proc bgerror {s} {set ::total [list error $s]} set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary zlib push inflate $c chan event $c readable [list apply {{c} { set d [read $c] if {[eof $c]} { chan event $c readable {} close $c set ::total [list eof [string length $d]] } }} $c] }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary -buffering none -blocking 0 zlib push gzip $s chan event $s xyzzy [list apply {{s} { if {[gets $s line] < 0} { chan close $s } }} $s] after idle [list apply {{s} { puts $s test chan close $s after 100 {set ::total done} }} $s] vwait ::total after cancel {set ::total timeout} after cancel {set ::total done} set ::total } -cleanup { close $srv rename bgerror {} } -returnCodes error \ -result {bad event name "xyzzy": must be readable or writable} test zlib-10.1 "bug #2818131 (mismatch read)" -constraints { zlib } -setup { proc bgerror {s} {set ::total [list error $s]} proc zlibRead {c} { set d [read $c] if {[eof $c]} { chan event $c readable {} close $c set ::total [list eof [string length $d]] } } set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary zlib push inflate $c chan event $c readable [list zlibRead $c] }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary -buffering none -blocking 0 zlib push gzip $s chan event $s readable [list zlibRead $s] after idle [list apply {{s} { puts $s test chan close $s after 100 {set ::total done} }} $s] vwait ::total after cancel {set ::total timeout} after cancel {set ::total done} set ::total } -cleanup { close $srv rename bgerror {} rename zlibRead {} } -result {error {invalid block type}} test zlib-10.2 "bug #2818131 (mismatch gets)" -constraints { zlib } -setup { proc bgerror {s} {set ::total [list error $s]} proc zlibRead {c} { if {[gets $c line] < 0} { close $c set ::total [list error -1] } elseif {[eof $c]} { chan event $c readable {} close $c set ::total [list eof 0] } } set srv [socket -myaddr localhost -server {apply {{c a p} { chan configure $c -translation binary zlib push inflate $c chan event $c readable [list zlibRead $c] }}} 0] } -body { lassign [chan configure $srv -sockname] addr name port after 1000 {set ::total timeout} set s [socket $addr $port] chan configure $s -translation binary -buffering none -blocking 0 zlib push gzip $s chan event $s readable [list zlibRead $s] after idle [list apply {{s} { puts $s test chan close $s after 100 {set ::total done} }} $s] vwait ::total after cancel {set ::total timeout} after cancel {set ::total done} set ::total } -cleanup { close $srv rename bgerror {} rename zlibRead {} } -result {error {invalid block type}} test zlib-11.1 "Bug #3390073: mis-applied gzip filtering" -setup { set file [makeFile {} test.input] } -constraints zlib -body { set f [open $file wb] puts -nonewline [zlib push gzip $f] [string repeat "hello" 1000] close $f set f [open $file rb] set d [read $f] close $f set d [zlib gunzip $d] list [regexp -all "hello" $d] [string length [regsub -all "hello" $d {}]] } -cleanup { removeFile $file } -result {1000 0} test zlib-11.2 "Bug #3390073: mis-applied gzip filtering" -setup { set file [makeFile {} test.input] } -constraints zlib -body { set f [open $file wb] puts -nonewline [zlib push gzip $f -header {filename /foo/bar}] \ [string repeat "hello" 1000] close $f set f [open $file rb] set d [read $f] close $f set d [zlib gunzip $d -header h] list [regexp -all "hello" $d] [dict get $h filename] \ [string length [regsub -all "hello" $d {}]] } -cleanup { removeFile $file } -result {1000 /foo/bar 0} test zlib-11.3 {Bug 3595576 variant} -setup { set file [makeFile {} test.input] } -constraints zlib -body { set f [open $file wb] puts -nonewline [zlib push gzip $f -header {filename /foo/bar}] \ [string repeat "hello" 1000] close $f set f [open $file rb] set d [read $f] close $f zlib gunzip $d -header noSuchNs::foo } -cleanup { removeFile $file } -returnCodes error -result {can't set "noSuchNs::foo": parent namespace doesn't exist} test zlib-12.1 {Tk Bug 9eb55debc5} -constraints zlib -setup { set stream [zlib stream compress] } -body { for {set opts {};set y 0} {$y < 60} {incr y} { for {set line {};set x 0} {$x < 100} {incr x} { append line [binary format ccc $x $y 128] } if {$y == 59} { set opts -finalize } $stream put {*}$opts $line } set data [$stream get] list [string length $data] [string length [zlib decompress $data]] } -cleanup { $stream close } -result {12026 18000} test zlib-12.2 {Patrick Dunnigan's issue} -constraints zlib -setup { set filesrc [makeFile {} test.input] set filedst [makeFile {} test.output] set f [open $filesrc "wb"] for {set i 0} {$i < 10000} {incr i} { puts -nonewline $f "x" } close $f } -body { set fin [open $filesrc "rb"] set fout [open $filedst "wb"] set header [dict create filename "test.input" time 0] try { fcopy $fin [zlib push gzip $fout -header $header] } finally { close $fin close $fout } file size $filedst } -cleanup { removeFile $filesrc removeFile $filedst } -result 56 set zlibbinf "" proc _zlibbinf {} { # inlined zlib.bin file creator: variable zlibbinf if {$zlibbinf eq ""} { set zlibbinf [makeFile {} test-zlib-13.bin] set f [open $zlibbinf wb] puts -nonewline $f [zlib decompress [binary decode base64 { eJx7e+6s1+EAgYaLjK3ratptGmOck0vT/y/ZujHAd0qJelDBXfUPJ3tfrtLbpX+wOOFHmtn03/tizm /+tXROXU3d203b79p5X6/0cvUyFzTsqOj4sa9r8SrZI5zT7265e2Xzq595Fb9LbpgffVy7cZaJ/d15 4U9L7LLM2vdqut8+aSU/r6q9Ltv6+T9mBhTgIK97bH33m/O1C1eBwf9FDKNgaIDaj9wA+5hToA== }]] close $f } return $zlibbinf } test zlib-13.1 {Ticket [8af92dfb66] - zlib stream mis-expansion} -constraints zlib -setup { set pathin [_zlibbinf] set chanin [open $pathin rb] set pathout [makeFile {} test-zlib-13.deflated] set chanout [open $pathout wb] zlib push inflate $chanin fcopy $chanin $chanout close $chanin close $chanout } -body { file size $pathout } -cleanup { removeFile $pathout unset chanin pathin chanout pathout } -result 458752 test zlib-13.2 {Ticket [f70ce1fead] - zlib multi-stream expansion} -constraints zlib -setup { # Start from the basic asset set pathin [_zlibbinf] set chanin [open $pathin rb] # Create a multi-stream by copying the asset twice into it. set pathout [makeFile {} test-zlib-13.multi] set chanout [open $pathout wb] fcopy $chanin $chanout seek $chanin 0 start fcopy $chanin $chanout close $chanin close $chanout # The multi-stream file shall be our input set pathin $pathout set chanin [open $pathin rb] # And our destinations set pathout1 [makeFile {} test-zlib-13.multi-1] set pathout2 [makeFile {} test-zlib-13.multi-2] } -body { # Decode first stream set chanout [open $pathout1 wb] zlib push inflate $chanin fcopy $chanin $chanout chan pop $chanin close $chanout # Decode second stream set chanout [open $pathout2 wb] zlib push inflate $chanin fcopy $chanin $chanout chan pop $chanin close $chanout # list [file size $pathout1] [file size $pathout2] } -cleanup { close $chanin removeFile $pathout removeFile $pathout1 removeFile $pathout2 unset chanin pathin chanout pathout pathout1 pathout2 } -result {458752 458752} if {$zlibbinf ne ""} { removeFile $zlibbinf } unset zlibbinf rename _zlibbinf {} test zlib-14.1 {Bug 9ee9f4d7be: compression header added to source channel} -setup { set data hello set src [file tempfile] puts -nonewline $src $data flush $src chan configure $src -translation binary set dst [file tempfile] chan configure $dst -translation binary set result {} } -constraints knownBug -body { for {set i 0} {$i < 3} {incr i} { # Determine size of src channel seek $src 0 end set size [chan tell $src] seek $src 0 start # Determine size of content in src channel set data [read $src] set size2 [string length $data] seek $src 0 start # Copy src over to dst, keep dst empty zlib push deflate $src -level 6 chan truncate $dst 0 chan copy $src $dst set size3 [chan tell $dst] chan pop $src # Show sizes lappend result $size $size2 ->$size3 } return $result } -cleanup { chan close $src chan close $dst } -result {5 5 ->5 5 5 ->5 5 5 ->5} test zlib-15.1 {Bug cfdf80a2efc6 - negative checksums} -setup { set compressor [zlib stream gzip -header {comment "A zlib demo"}] $compressor put abcd $compressor finalize } -body { $compressor checksum } -cleanup { $compressor close } -result 3984772369 ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/zipfs.test0000644000175000017500000024356415104661341014763 0ustar sergeisergei# The file tests the tclZlib.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996-1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2023 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] testConstraint zipfs [expr {[llength [info commands zipfs]]}] testConstraint thread [expr {0 == [catch {package require Thread 2.8-}]}] set ziproot [zipfs root] set CWD [pwd] set tmpdir [file join $CWD tmp] file mkdir $tmpdir test zipfs-0.1 {zipfs basics} -constraints zipfs -body { expr {${ziproot} in [file volumes]} } -result 1 if {[string match ${ziproot}* $tcl_library]} { testConstraint zipfslib 1 set zipLibTop [file tail [file join {*}[lrange [file split $tcl_library] 0 1]]] } else { set zipLibTop "" } test zipfs-0.2 {zipfs basics} -constraints zipfslib -body { string match ${ziproot}* $tcl_library } -result 1 test zipfs-0.3 {zipfs basics: glob} -constraints zipfslib -setup { set pwd [pwd] } -body { cd $tcl_library expr { [file join . http] in [glob -dir . http*] } } -cleanup { cd $pwd } -result 1 test zipfs-0.4 {zipfs basics: glob} -constraints zipfslib -setup { set pwd [pwd] } -body { cd $tcl_library expr { [file join $tcl_library http] in [glob -dir [pwd] http*] } } -cleanup { cd $pwd } -result 1 test zipfs-0.5 {zipfs basics: glob} -constraints zipfslib -body { expr { [file join $tcl_library http] in [glob -dir $tcl_library http*] } } -result 1 test zipfs-0.6 {zipfs basics: glob} -constraints zipfslib -body { expr { [file join $tcl_library http] in [glob [file join $tcl_library http*]] } } -result 1 test zipfs-0.7 {zipfs basics: glob} -constraints zipfslib -body { expr { "http" in [glob -tails -dir $tcl_library http*] } } -result 1 test zipfs-0.8 {zipfs basics: glob} -constraints zipfslib -body { expr { "http" in [glob -nocomplain -tails -types d -dir $tcl_library http*] } } -result 1 test zipfs-0.9 {zipfs basics: glob} -constraints zipfslib -body { glob -nocomplain -tails -types f -dir $tcl_library http* } -result {} test zipfs-0.10 {zipfs basics: join} -constraints {zipfs zipfslib} -body { file join ${ziproot} bar baz } -result "${ziproot}bar/baz" test zipfs-0.11 {zipfs basics: join} -constraints {zipfs zipfslib} -body { file normalize ${ziproot} } -result "${ziproot}" test zipfs-0.12 {zipfs basics: join} -constraints {zipfs zipfslib} -body { file normalize ${ziproot}//bar/baz//qux/../ } -result "${ziproot}bar/baz" file mkdir tmp test zipfs-2.1 {zipfs mkzip empty archive} -constraints zipfs -returnCodes error -body { zipfs mkzip [file join $tmpdir empty.zip] $tcl_library/xxxx } -result {empty archive} ### # The next series of tests operate within a zipfile created a temporary # directory. ### set zipfile [file join $tmpdir abc.zip] if {[file exists $zipfile]} { file delete $zipfile } test zipfs-2.2 {zipfs mkzip} -constraints zipfs -body { cd $tcl_library/encoding zipfs mkzip $zipfile . zipfs mount $zipfile ${ziproot}abc zipfs list -glob ${ziproot}abc/cp850.* } -cleanup { cd $CWD } -result "${ziproot}abc/cp850.enc" testConstraint zipfsenc [zipfs exists ${ziproot}abc/cp850.enc] test zipfs-2.3 {zipfs info} -constraints {zipfs zipfsenc} -body { set r [zipfs info ${ziproot}abc/cp850.enc] lrange $r 0 2 } -result [list $zipfile 1090 527] ;# NOTE: Only the first 3 results are stable test zipfs-2.4 {zipfs data} -constraints {zipfs zipfsenc} -body { set zipfd [open ${ziproot}/abc/cp850.enc] ;# FIXME: leave open - see later test read $zipfd } -result {# Encoding file: cp850, single-byte S 003F 0 1 00 0000000100020003000400050006000700080009000A000B000C000D000E000F 0010001100120013001400150016001700180019001A001B001C001D001E001F 0020002100220023002400250026002700280029002A002B002C002D002E002F 0030003100320033003400350036003700380039003A003B003C003D003E003F 0040004100420043004400450046004700480049004A004B004C004D004E004F 0050005100520053005400550056005700580059005A005B005C005D005E005F 0060006100620063006400650066006700680069006A006B006C006D006E006F 0070007100720073007400750076007700780079007A007B007C007D007E007F 00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 00C900E600C600F400F600F200FB00F900FF00D600DC00F800A300D800D70192 00E100ED00F300FA00F100D100AA00BA00BF00AE00AC00BD00BC00A100AB00BB 2591259225932502252400C100C200C000A9256325512557255D00A200A52510 25142534252C251C2500253C00E300C3255A25542569256625602550256C00A4 00F000D000CA00CB00C8013100CD00CE00CF2518250C2588258400A600CC2580 00D300DF00D400D200F500D500B500FE00DE00DA00DB00D900FD00DD00AF00B4 00AD00B1201700BE00B600A700F700B800B000A800B700B900B300B225A000A0 } ;# FIXME: result depends on content of encodings dir test zipfs-2.5 {zipfs exists} -constraints {zipfs zipfsenc} -body { zipfs exists ${ziproot}abc/cp850.enc } -result 1 test zipfs-2.6 {zipfs unmount while busy} -constraints {zipfs zipfsenc} -body { zipfs unmount /abc } -returnCodes error -result {filesystem is busy} test zipfs-2.7 {zipfs unmount} -constraints {zipfs zipfsenc} -body { close $zipfd zipfs unmount /abc zipfs exists /abc/cp850.enc } -result 0 ### # Repeat the tests for a buffer mounted archive ### test zipfs-2.8 {zipfs mkzip} -constraints zipfs -body { cd $tcl_library/encoding zipfs mkzip $zipfile . set fin [open $zipfile r] fconfigure $fin -translation binary set dat [read $fin] close $fin zipfs mountdata $dat def zipfs list -glob ${ziproot}def/cp850.* } -cleanup { cd $CWD } -result "${ziproot}def/cp850.enc" testConstraint zipfsencbuf [zipfs exists ${ziproot}def/cp850.enc] test zipfs-2.9 {zipfs info} -constraints {zipfs zipfsencbuf} -body { set r [zipfs info ${ziproot}def/cp850.enc] lrange $r 0 2 } -result [list {Memory Buffer} 1090 527] ;# NOTE: Only the first 3 results are stable test zipfs-2.10 {zipfs data} -constraints {zipfs zipfsencbuf} -body { set zipfd [open ${ziproot}/def/cp850.enc] ;# FIXME: leave open - see later test read $zipfd } -result {# Encoding file: cp850, single-byte S 003F 0 1 00 0000000100020003000400050006000700080009000A000B000C000D000E000F 0010001100120013001400150016001700180019001A001B001C001D001E001F 0020002100220023002400250026002700280029002A002B002C002D002E002F 0030003100320033003400350036003700380039003A003B003C003D003E003F 0040004100420043004400450046004700480049004A004B004C004D004E004F 0050005100520053005400550056005700580059005A005B005C005D005E005F 0060006100620063006400650066006700680069006A006B006C006D006E006F 0070007100720073007400750076007700780079007A007B007C007D007E007F 00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 00C900E600C600F400F600F200FB00F900FF00D600DC00F800A300D800D70192 00E100ED00F300FA00F100D100AA00BA00BF00AE00AC00BD00BC00A100AB00BB 2591259225932502252400C100C200C000A9256325512557255D00A200A52510 25142534252C251C2500253C00E300C3255A25542569256625602550256C00A4 00F000D000CA00CB00C8013100CD00CE00CF2518250C2588258400A600CC2580 00D300DF00D400D200F500D500B500FE00DE00DA00DB00D900FD00DD00AF00B4 00AD00B1201700BE00B600A700F700B800B000A800B700B900B300B225A000A0 } ;# FIXME: result depends on content of encodings dir test zipfs-2.11 {zipfs exists} -constraints {zipfs zipfsencbuf} -body { zipfs exists ${ziproot}def/cp850.enc } -result 1 test zipfs-2.12 {zipfs unmount while busy} -constraints {zipfs zipfsencbuf} -body { zipfs unmount /def } -returnCodes error -result {filesystem is busy} test zipfs-2.13 {zipfs unmount} -constraints {zipfs zipfsencbuf} -body { close $zipfd zipfs unmount /def zipfs exists /def/cp850.enc } -result 0 catch {file delete -force $tmpdir} test zipfs-3.1 {zipfs in child interpreters} -constraints zipfs -setup { set interp [interp create] } -body { interp eval $interp { zipfs ? } } -returnCodes error -cleanup { interp delete $interp } -result {unknown or ambiguous subcommand "?": must be canonical, exists, find, info, list, lmkimg, lmkzip, mkimg, mkkey, mkzip, mount, mountdata, root, or unmount} test zipfs-3.2 {zipfs in child interpreters} -constraints zipfs -setup { set interp [interp create] } -body { interp eval $interp { zipfs mkzip } } -returnCodes error -cleanup { interp delete $interp } -result {wrong # args: should be "zipfs mkzip outfile indir ?strip? ?password?"} test zipfs-3.3 {zipfs in child interpreters} -constraints zipfs -setup { set safe [interp create -safe] } -body { interp eval $safe { zipfs ? } } -returnCodes error -cleanup { interp delete $safe } -result {invalid command name "zipfs"} test zipfs-3.4 {zipfs in safe interpreters} -constraints zipfs -setup { set safe [interp create -safe] } -body { interp eval $safe { zipfs } } -returnCodes error -cleanup { interp delete $safe } -result {invalid command name "zipfs"} test zipfs-4.1 {zipfs lmkimg} -constraints zipfs -setup { set baseImage [makeFile "return sourceWorking\n\x1A" base] set targetImage [makeFile "" target] set addFile [makeFile "return mountWorking" add.data] file delete $targetImage } -body { zipfs lmkimg $targetImage [list $addFile test/add.tcl] {} $baseImage zipfs mount $targetImage ziptest try { list [source $targetImage] [source ${ziproot}ziptest/test/add.tcl] } finally { zipfs unmount ziptest } } -cleanup { removeFile $baseImage removeFile $targetImage removeFile $addFile } -result {sourceWorking mountWorking} test zipfs-4.2 {zipfs lmkimg: making an image from an image} -constraints zipfs -setup { set baseImage [makeFile "return sourceWorking\n\x1A" base_image.tcl] set midImage [makeFile "" mid_image.tcl] set targetImage [makeFile "" target_image.tcl] set addFile [makeFile "return mountWorking" add.data] file delete $midImage $targetImage } -body { zipfs lmkimg $midImage [list $addFile test/ko.tcl] {} $baseImage zipfs lmkimg $targetImage [list $addFile test/ok.tcl] {} $midImage zipfs mount $targetImage ziptest try { list [glob -tails -directory ${ziproot}/ziptest/test *.tcl] \ [if {[file size $midImage] == [file size $targetImage]} { string cat equal } else { list mid=[file size $midImage] target=[file size $targetImage] }] } finally { zipfs unmount ziptest } } -cleanup { removeFile $baseImage removeFile $midImage removeFile $targetImage removeFile $addFile } -result {ok.tcl equal} test zipfs-4.3 {zipfs lmkimg: stripping password} -constraints zipfs -setup { set baseImage [makeFile "return sourceWorking\n\x1A" base_image.tcl] set midImage [makeFile "" mid_image.tcl] set targetImage [makeFile "" target_image.tcl] set addFile [makeFile "return mountWorking" add.data] file delete $midImage $targetImage } -body { set pass gorp zipfs lmkimg $midImage [list $addFile test/add.tcl] $pass $baseImage zipfs lmkimg $targetImage [list $addFile test/ok.tcl] {} $midImage zipfs mount $targetImage ziptest try { glob -tails -directory ${ziproot}/ziptest/test *.tcl } finally { zipfs unmount ziptest } } -cleanup { removeFile $baseImage removeFile $midImage removeFile $targetImage removeFile $addFile } -result {ok.tcl} test zipfs-4.4 {zipfs lmkimg: final password} -constraints zipfs -setup { set baseImage [makeFile "return sourceWorking\n\x1A" base_image.tcl] set midImage [makeFile "" mid_image.tcl] set targetImage [makeFile "" target_image.tcl] set addFile [makeFile "return mountWorking" add.data] file delete $midImage $targetImage } -body { set pass gorp zipfs lmkimg $midImage [list $addFile test/add.tcl] {} $baseImage zipfs lmkimg $targetImage [list $addFile test/ok.tcl] $pass $midImage zipfs mount $targetImage ziptest try { glob -tails -directory ${ziproot}/ziptest/test *.tcl } finally { zipfs unmount ziptest } } -cleanup { removeFile $baseImage removeFile $midImage removeFile $targetImage removeFile $addFile } -result {ok.tcl} test zipfs-4.5 {zipfs lmkimg: making image from mounted} -constraints zipfs -setup { set baseImage [makeFile "return sourceWorking\n\x1A" base_image.tcl] set midImage [makeFile "" mid_image.tcl] set targetImage [makeFile "" target_image.tcl] set addFile [makeFile "return mountWorking" add.data] file delete $midImage $targetImage } -body { zipfs lmkimg $midImage [list $addFile test/add.tcl] {} $baseImage zipfs mount $midImage ziptest set f [glob -directory ${ziproot}/ziptest/test *.tcl] zipfs lmkimg $targetImage [list $f test/ok.tcl] {} $midImage zipfs unmount ziptest zipfs mount $targetImage ziptest list $f [glob -directory ${ziproot}/ziptest/test *.tcl] } -cleanup { zipfs unmount ziptest removeFile $baseImage removeFile $midImage removeFile $targetImage removeFile $addFile } -result [list ${ziproot}/ziptest/test/add.tcl ${ziproot}/ziptest/test/ok.tcl] test zipfs-5.1 {zipfs mountdata: short data} -constraints zipfs -body { zipfs mountdata {} gorp } -returnCodes error -result {illegal file size} test zipfs-5.2 {zipfs mountdata: short data} -constraints zipfs -body { zipfs mountdata gorpGORPgorp gorp } -returnCodes error -result {illegal file size} test zipfs-5.3 {zipfs mountdata: short data} -constraints zipfs -body { set data PK\x03\x04..................................... append data PK\x01\x02..................................... append data PK\x05\x06..................................... zipfs mountdata $data gorp } -returnCodes error -result {archive directory truncated} test zipfs-6.1 {zipfs mkkey} -constraints zipfs -body { binary scan [zipfs mkkey gorp] cu* x return $x } -result {224 226 111 103 4 80 75 90 90} # # Additional tests for more coverage. Some of the ones above may be duplicated. namespace eval test_ns_zipfs { namespace import ::tcltest::test namespace path ::tcltests variable zipTestDir [file normalize [file join [file dirname [info script]] zipfiles]] variable defMountPt [file join [zipfs root] testmount] proc readbin {path} { set fd [open $path rb] set data [read $fd] close $fd return $data } # Wrapper to ease transition if Tcl changes order of argument to zipfs mount # or the zipfs prefix proc mount [list zippath [list mountpoint $defMountPt]] { return [zipfs mount $zippath $mountpoint] } # Make full path to zip file proc zippath {zippath} { variable zipTestDir if {[file pathtype $zippath] eq "absolute"} { return $zippath } else { return [file join $zipTestDir $zippath] } } # list of paths -> list of paths under mount point mt proc zipfspathsmt {mt args} { return [lsort [lmap path $args {file join $mt $path}]] } # list of paths -> list of paths under [zipfs root] proc zipfspaths {args} { return [zipfspathsmt [zipfs root] {*}$args] } proc cleanup {} { dict for {mount -} [zipfs mount] { if {[string match //zipfs:/test* $mount]} { zipfs unmount $mount } } zipfs unmount [zipfs root] } proc mounttarget {mountpoint} { return [dict getdef [zipfs mount] $mountpoint ""] } # # zipfs root - only arg count check since do not want to assume # what it resolves to testnumargs "zipfs root" "" "" # # zipfs mount proc testbadmount {id zippath messagePattern args} { variable defMountPt set zippath [zippath $zippath] test zipfs-mount-$id $id -body { list [catch {mount $zippath} message] \ [string match $messagePattern $message] \ [mounttarget $defMountPt] } -cleanup { # In case mount succeeded when it should not cleanup } -result {1 1 {}} {*}$args if {![file exists $zippath]} { return } set data [readbin $zippath] test zipfs-mountdata-$id $id -body { list [catch {zipfs mountdata $data $defMountPt} message] \ [string match $messagePattern $message] \ [mounttarget $defMountPt] } -cleanup { # In case mount succeeded when it should not cleanup } -result {1 1 {}} {*}$args } # Generates tests for file, file on root, memory buffer cases for an archive proc testmount {id zippath checkPath mountpoint args} { set zippath [zippath $zippath] test zipfs-mount-$id "zipfs mount $id" -body { set canon [mount $zippath $mountpoint] list [file exists [file join $canon $checkPath]] \ [zipfs mount $canon] [zipfs mount $mountpoint] } -cleanup { zipfs unmount $mountpoint } -result [list 1 $zippath $zippath] {*}$args # Mount memory buffer test zipfs-mountdata-$id "zipfs mountdata $id" -body { set canon [zipfs mountdata [readbin $zippath] $mountpoint] list [file exists [file join $canon $checkPath]] \ [zipfs mount $canon] [zipfs mount $mountpoint] } -cleanup { cleanup } -result [list 1 {Memory Buffer} {Memory Buffer}] {*}$args } testnumargs "zipfs mount" "" "?zipfile? ?mountpoint? ?password?" testnumargs "zipfs mountdata" "data mountpoint" "" # Not supported zip files testbadmount non-existent-file nosuchfile.zip "couldn't open*nosuchfile.zip*no such file or directory" testbadmount not-zipfile [file normalize [info script]] "archive directory end signature not found" testbadmount zip64-unsupported zip64.zip "wrong header signature" # Inconsistent metadata testbadmount bad-directory-offset incons-cdoffset.zip "archive directory truncated" testbadmount bad-directory-magic incons-central-magic-bad.zip "wrong header signature" testbadmount bad-local-magic incons-local-magic-bad.zip "Failed to find local header" testbadmount bad-file-count-high incons-file-count-high.zip "truncated directory" testbadmount bad-file-count-low incons-file-count-low.zip "short file count" test zipfs-mount-on-drive "Mount point include drive" -body { zipfs mount [zippath test.zip] C:/foo } -result {Invalid mount path "C:/foo"} -returnCodes error -constraints win test zipfs-mountdata-on-drive "Mount point include drive" -body { zipfs mountdata [readbin [zippath test.zip]] C:/foo } -result {Invalid mount path "C:/foo"} -returnCodes error -constraints win test zipfs-mount-on-unc "Mount point is unc" -body { zipfs mount [zippath test.zip] //unc/share/foo } -result {Invalid mount path "//unc/share/foo"} -returnCodes error test zipfs-mountdata-on-unc "Mount point include unc" -body { zipfs mountdata [readbin [zippath test.zip]] //unc/share/foo } -result {Invalid mount path "//unc/share/foo"} -returnCodes error # Good mounts testmount basic test.zip testdir/test2 $defMountPt testmount basic-on-default test.zip testdir/test2 "" testmount basic-on-root test.zip testdir/test2 [zipfs root] testmount basic-on-slash test.zip testdir/test2 / testmount basic-on-bslash test.zip testdir/test2 \\ -constraints win testmount basic-on-relative test.zip testdir/test2 testmount testmount basic-on-absolute test.zip testdir/test2 /testmount testmount basic-on-absolute-bslash test.zip testdir/test2 \\testmount -constraints win testmount zip-at-end junk-at-start.zip testdir/test2 $defMountPt testmount zip-at-start junk-at-end.zip testdir/test2 $defMountPt testmount zip-in-zip [file join [zipfs root] test2 test.zip] testdir/test2 $defMountPt -setup { mount [zippath test-zip-in-zip.zip] [file join [zipfs root] test2] } -cleanup { zipfs unmount $mountpoint zipfs unmount [file join [zipfs root] test2] } testmount relative-mount-point test.zip testdir/test2 "" test zipfs-mount-busy-1 "Attempt to mount on existing mount point" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { zipfs mount [zippath testfile-cp437.zip] $defMountPt } -result "[zippath test.zip] is already mounted on $defMountPt" -returnCodes error test zipfs-mount-no-args-1 "mount - get mount list" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set mounts [zipfs mount] lsearch -inline -stride 2 $mounts $defMountPt } -result [list $defMountPt [zippath test.zip]] test zipfs-mount-one-arg-1 "mount - get mount target - absolute path" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { zipfs mount $defMountPt } -result [zippath test.zip] test zipfs-mount-one-arg-2 "mount - get mount target - relative path" -setup { file copy [zippath test.zip] test.zip mount ./test.zip } -cleanup { cleanup file delete ./test.zip } -body { zipfs mount $defMountPt } -result [file normalize ./test.zip] test zipfs-mount-password-1 "mount - verify plaintext readable without password" -body { zipfs mount [zippath test-password.zip] $defMountPt readbin [file join $defMountPt plain.txt] } -cleanup { cleanup } -result plaintext test zipfs-mount-password-2 "mount - verify uncompressed cipher unreadable without password" -body { zipfs mount [zippath test-password.zip] $defMountPt set chans [lsort [chan names]]; # Want to ensure open does not leave dangling channel set result [list ] lappend result [catch {open [file join $defMountPt cipher.bin]} message] lappend result $message lappend result [string equal $chans [lsort [chan names]]] } -cleanup { cleanup } -result {1 {decryption failed - no password provided} 1} test zipfs-mount-password-3 "mount - verify compressed cipher unreadable without password" -body { zipfs mount [zippath test-password.zip] $defMountPt set chans [lsort [chan names]]; # Want to ensure open does not leave dangling channel set result [list ] lappend result [catch {open [file join $defMountPt cipher-deflate.bin]} message] lappend result $message lappend result [string equal $chans [lsort [chan names]]] } -cleanup { cleanup } -result {1 {decryption failed - no password provided} 1} test zipfs-mount-nested-1 "mount - nested mount on non-existing path" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set newmount [file join $defMountPt newdir] mount [zippath test-overlay.zip] $newmount list \ [lsort [glob -tails -dir $defMountPt *]] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{newdir test testdir} {test2 test3} test2-overlay} test zipfs-mount-nested-2 "mount - nested mount on existing path" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set newmount [file join $defMountPt testdir] mount [zippath test-overlay.zip] $newmount # Note - file from existing mount is preserved (testdir/test2) # Not clear this is desired but defined as such by the # current implementation list \ [lsort [glob -tails -dir $defMountPt *]] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result [list {test testdir} {test2 test3} test\n] # # unmount - only special cases. Normal case already tested as part of other tests testnumargs "zipfs unmount" "mountpoint" "" test zipfs-unmount-1 "Unmount bogus mount" -body { zipfs unmount [file join [zipfs root] nosuchmount] } -result "" test zipfs-unmount-2 "Unmount mount with open files" -setup { mount [zippath test.zip] set fd [open [file join $defMountPt test]] } -cleanup { close $fd cleanup } -body { zipfs unmount $defMountPt } -result {filesystem is busy} -returnCodes error test zipfs-unmount-3 "Unmount mount with current directory" -setup { set cwd [pwd] mount [zippath test.zip] } -cleanup { cd $cwd cleanup } -body { # Current directory does not change on unmount. # This is the same behavior as when USB pen drive is unmounted set cwd2 [file join $defMountPt testdir] cd $cwd2 list [pwd] [zipfs unmount $defMountPt] [string equal [pwd] $cwd2] } -result [list [file join $defMountPt testdir] {} 1] test zipfs-unmount-nested-1 "unmount parent of nested mount on new directory should not affect nested mount" -setup { mount [zippath test.zip] set newmount [file join [zipfs root] test newdir] mount [zippath test-overlay.zip] $newmount } -cleanup { cleanup } -body { zipfs unmount $defMountPt list \ [zipfs mount $defMountPt] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{} {test2 test3} test2-overlay} test zipfs-unmount-nested-2 "unmount parent of nested mount on existing directory should not affect nested mount" -setup { mount [zippath test.zip] set newmount [file join [zipfs root] test testdir] mount [zippath test-overlay.zip] $newmount } -constraints bug_4ae42446ab -cleanup { cleanup } -body { # KNOWN BUG. The test2 file is also present in parent mount. # After the unmount, the test2 in the nested mount is not # made available. zipfs unmount $defMountPt list \ [zipfs mount $defMountPt] \ [lsort [glob -tails -dir $newmount *]] \ [readbin [file join $newmount test2]] } -result {{} {test2 test3} test2-overlay} # # paths inside a zip # TODO - paths encoded in utf-8 vs fallback encoding test zipfs-content-paths-1 "Test absolute and full paths" -setup { mount [zippath test-paths.zip] } -cleanup { cleanup } -body { # Primarily verifies that drive letters are stripped and paths maintained lsort [zipfs find $defMountPt] } -result {//zipfs:/testmount/filename.txt //zipfs:/testmount/src //zipfs:/testmount/src/tcltk //zipfs:/testmount/src/tcltk/wip //zipfs:/testmount/src/tcltk/wip/tcl //zipfs:/testmount/src/tcltk/wip/tcl/tests //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/abspath.txt //zipfs:/testmount/src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt} # # zipfs list testnumargs "zipfs list" "" "?(-glob|-regexp)? ?pattern?" # Generates zipfs list tests for file, memory buffer cases for an archive proc testzipfslist {id cmdargs mounts resultpaths args} { set resultpaths [lmap path $resultpaths { file join [zipfs root] $path }] set resultpaths [lsort $resultpaths] test zipfs-list-$id "zipfs list $id" -body { lsort [zipfs list {*}$cmdargs] } -setup { foreach {zippath mountpoint} $mounts { zipfs mount [zippath $zippath] [file join [zipfs root] $mountpoint] } } -cleanup { cleanup } -result $resultpaths {*}$args # Mount memory buffer test zipfs-list-memory-$id "zipfs list memory $id" -body { lsort [zipfs list {*}$cmdargs] } -setup { foreach {zippath mountpoint} $mounts { zipfs mountdata [readbin [zippath $zippath]] [file join [zipfs root] $mountpoint] } } -cleanup { cleanup } -result $resultpaths {*}$args } # Some tests have !zipfslib constraint because otherwise they dump the entire Tcl library which is mounted on root testzipfslist no-mounts "" {} {} -constraints !zipfslib testzipfslist no-pattern "" {test.zip testmountA} {testmountA testmountA/test testmountA/testdir testmountA/testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-empty "" {test.zip {}} {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-root "" [list test.zip [zipfs root]] {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-slash "" [list test.zip /] {{} test testdir testdir/test2} -constraints !zipfslib testzipfslist no-pattern-mount-on-mezzo "" [list test.zip testmt/a/b] {testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2} -constraints {!zipfslib} testzipfslist no-pattern-multiple "" {test.zip testmountA test.zip testmountB/subdir} { testmountA testmountA/test testmountA/testdir testmountA/testdir/test2 testmountB/subdir testmountB/subdir/test testmountB/subdir/testdir testmountB/subdir/testdir/test2 } -constraints !zipfslib testzipfslist glob [list "*testmount*2*"] {test.zip testmountA test.zip testmountB/subdir} { testmountA/testdir/test2 testmountB/subdir/testdir/test2 } testzipfslist opt-glob [list -glob "*testmount*2*"] {test.zip testmountA test.zip testmountB/subdir} { testmountA/testdir/test2 testmountB/subdir/testdir/test2 } testzipfslist opt-regexp [list -regexp "testmount.*(A|2)"] {test.zip testmountA test.zip testmountB/subdir} { testmountA testmountA/test testmountA/testdir testmountA/testdir/test2 testmountB/subdir/testdir/test2 } # # zipfs exists testnumargs "zipfs exists" "filename" "" # Generates tests for zipfs exists proc testzipfsexists [list id path result [list mountpoint $defMountPt] args] { test zipfs-exists-$id "zipfs exists $id" -body { zipfs exists $path } -setup { mount [zippath test.zip] $mountpoint } -cleanup { zipfs unmount $mountpoint cleanup } -result $result {*}$args } testzipfsexists native-file [info nameofexecutable] 0 testzipfsexists enoent [file join $defMountPt nosuchfile] 0 testzipfsexists file [file join $defMountPt test] 1 testzipfsexists dir [file join $defMountPt testdir] 1 testzipfsexists mountpoint $defMountPt 1 testzipfsexists root [zipfs root] 1 $defMountPt testzipfsexists mezzo [file join $defMountPt a b] 1 [file join $defMountPt a b c] testzipfsexists mezzo-enoent [file join $defMountPt a c] 0 [file join $defMountPt a b c] # # zipfs find testnumargs "zipfs find" "directoryName" "" # Generates zipfs find tests for file, memory buffer cases for an archive proc testzipfsfind {id findtarget mounts resultpaths args} { set setup { foreach {zippath mountpoint} $mounts { zipfs mount [zippath $zippath] [file join [zipfs root] $mountpoint] } } set memory_setup { foreach {zippath mountpoint} $mounts { zipfs mountdata [readbin [zippath $zippath]] [file join [zipfs root] $mountpoint] } } if {[dict exists $args -setup]} { append setup \n[dict get $args -setup] append memory_setup \n[dict get $args -setup] dict unset args -setup } set cleanup cleanup if {[dict exists $args -cleanup]} { set cleanup "[dict get $args -cleanup]\n$cleanup" dict unset args -cleanup } set resultpaths [lsort $resultpaths] test zipfs-find-$id "zipfs find $id" -body { lsort [zipfs find $findtarget] } -setup $setup -cleanup $cleanup -result $resultpaths {*}$args # Mount memory buffer test zipfs-find-memory-$id "zipfs find memory $id" -body { lsort [zipfs find $findtarget] } -setup $memory_setup -cleanup $cleanup -result $resultpaths {*}$args } testzipfsfind nonexistingmount [file join [zipfs root] nosuchmount] { test.zip testmountA test.zip testmountB/subdir } {} testzipfsfind absolute-path [file join [zipfs root] testmountA] { test.zip testmountA test.zip testmountB/subdir } [zipfspaths testmountA/test testmountA/testdir testmountA/testdir/test2] testzipfsfind relative-path testdir { test.zip testmountA test.zip testmountB/subdir } { testdir/test2 } -setup { set cwd [pwd] cd [file join [zipfs root] testmountA] } -cleanup { cd $cwd } # bug-6183f535c8 testzipfsfind root-path [zipfs root] { test.zip {} test.zip testmountB/subdir } [zipfspaths test testdir testdir/test2 testmountB testmountB/subdir testmountB/subdir/test testmountB/subdir/testdir testmountB/subdir/testdir/test2] -constraints !zipfslib testzipfsfind mezzo [file join [zipfs root] testmt a] { test.zip testmt/a/b } [zipfspaths testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] testzipfsfind mezzo-root [zipfs root] { test.zip testmt/a/b } [zipfspaths testmt testmt/a testmt/a/b testmt/a/b/test testmt/a/b/testdir testmt/a/b/testdir/test2] -constraints !zipfslib test zipfs-find-native-absolute "zipfs find on native file system" -setup { set dir [makeDirectory zipfs-native-absolute] set subdir [file join $dir subdir] file mkdir $subdir set file [file join $subdir native] close [open $file w] } -cleanup { removeDirectory zipfs-native-absolute } -body { string equal [zipfs find $dir] [list $subdir $file] } -result 1 test zipfs-find-native-relative "zipfs find relative on native file system" -setup { set dir [makeDirectory zipfs-native-relative] set subdir [file join $dir subdir] file mkdir $subdir set file [file join $subdir native] close [open $file w] set cwd [pwd] } -cleanup { cd $cwd removeDirectory zipfs-native-relative } -body { cd [file dirname $dir] # string equal [zipfs find [file tail $subdir]] [list subdir subdir/native] zipfs find [file tail $dir] } -result {zipfs-native-relative/subdir zipfs-native-relative/subdir/native} # # zipfs info testnumargs "zipfs info" "filename" "" test zipfs-info-native-nosuchfile "zipfs info on non-existent native path" -body { zipfs info nosuchfile } -result {path "nosuchfile" not found in any zipfs volume} -returnCodes error test zipfs-info-native-file "zipfs info on native path" -body { zipfs info [info nameofexecutable] } -result "path \"[info nameofexecutable]\" not found in any zipfs volume" -returnCodes error test zipfs-info-nosuchfile "zipfs info non-existent path in mounted archive" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { zipfs info [file join $defMountPt nosuchfile] } -result "path \"[file join $defMountPt nosuchfile]\" not found in any zipfs volume" -returnCodes error test zipfs-info-file "zipfs info file within mounted archive" -setup { mount [zippath testdeflated2.zip] } -cleanup { cleanup } -body { zipfs info [file join $defMountPt abac-repeat.txt] } -result [list [zippath testdeflated2.zip] 60 17 108] test zipfs-info-dir "zipfs info dir within mounted archive" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { zipfs info [file join $defMountPt testdir] } -result [list [zippath test.zip] 0 0 119] test zipfs-info-mountpoint "zipfs info on mount point - verify correct offset of zip content" -setup { # zip starts at offset 4 mount [zippath junk-at-start.zip] } -cleanup { cleanup } -body { zipfs info $defMountPt } -result [list [zippath junk-at-start.zip] 0 0 4] test zipfs-info-mezzo "zipfs info on mount point - verify correct offset of zip content" -setup { # zip starts at offset 4 mount [zippath junk-at-start.zip] /testmt/a/b } -cleanup { cleanup } -body { zipfs info [file join [zipfs root] testmt a] } -result {path "//zipfs:/testmt/a" not found in any zipfs volume} -returnCodes error test zipfs-info-tcllib-1 "zipfs info offset on tcl library" -constraints zipfslib -body { expr {[lindex [zipfs info [file dirname $::tcl_library]] 3] > 0} } -result 1 test zipfs-info-tcllib-2 "extract zip using zipfs info" -constraints zipfslib -cleanup { cleanup } -body { set mt [file dirname $::tcl_library] lassign [zipfs info $mt] container_path - - offset set fd [open $container_path rb] chan seek $fd $offset set zipdata [read $fd] zipfs mountdata $zipdata /testmt list [expr {$offset > 0}] [file exists [file join [zipfs root] testmt tcl_library]] } -result {1 1} # # zipfs canonical test zipfs-canonical-minargs {zipfs canonical min args} -body { zipfs canonical } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename"} test zipfs-canonical-maxargs {zipfs canonical max args} -body { zipfs canonical a b c } -returnCodes error -result {wrong # args: should be "zipfs canonical ?mountpoint? filename"} proc testzipfscanonical {id cmdargs result args} { test zipfs-canonical-$id "zipfs canonical $id" \ -body [list zipfs canonical {*}$cmdargs] \ -result $result {*}$args } testzipfscanonical default-relative [list a] [file join [zipfs root] a] testzipfscanonical default-absolute [list /a] [file join [zipfs root] a] testzipfscanonical root-relative-1 [list [zipfs root] a] [file join [zipfs root] a] testzipfscanonical root-relative-2 [list / a] [file join [zipfs root] a] testzipfscanonical root-absolute-1 [list [zipfs root] /a] [file join [zipfs root] a] testzipfscanonical root-absolute-2 [list / /a] [file join [zipfs root] a] testzipfscanonical absolute-relative [list /MT a] [file join [zipfs root] MT a] testzipfscanonical absolute-absolute [list /MT /a] [file join [zipfs root] MT a] testzipfscanonical relative-relative [list MT a] [file join [zipfs root] MT a] testzipfscanonical relative-absolute [list MT /a] [file join [zipfs root] MT a] testzipfscanonical mountpoint-trailslash-relative [list MT/ a] [file join [zipfs root] MT a] testzipfscanonical mountpoint-trailslash-absolute [list MT/ /a] [file join [zipfs root] MT a] testzipfscanonical mountpoint-root-relative [list [zipfs root] a] [file join [zipfs root] a] testzipfscanonical mountpoint-root-absolute [list [zipfs root] /a] [file join [zipfs root] a] testzipfscanonical mountpoint-empty-relative [list {} a] [file join [zipfs root] a] testzipfscanonical driveletter [list X:] [zipfs root] -constraints win testzipfscanonical drivepath [list X:/foo/bar] [file join [zipfs root] foo bar] -constraints win testzipfscanonical drivepath-1 [list MT X:/foo/bar] [file join [zipfs root] MT foo bar] -constraints win testzipfscanonical backslashes [list X:\\\\foo\\\\bar] [file join [zipfs root] foo bar] -constraints win testzipfscanonical backslashes-1 [list X:/foo\\\\bar] [file join [zipfs root] foo bar] -constraints win testzipfscanonical zipfspath [list //zipfs:/x/y] [file join [zipfs root] x y] testzipfscanonical zipfspath-1 [list MT //zipfs:/x/y] [file join [zipfs root] x y] # # Read/uncompress proc testzipfsread {id zippath result {filename abac-repeat.txt} {openopts {}} args} { variable defMountPt set zippath [zippath $zippath] test zipfs-read-$id "zipfs read $id" -setup { unset -nocomplain fd zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body { set fd [open [file join $defMountPt $filename] {*}$openopts] gets $fd } -result $result {*}$args set data [readbin $zippath] test zipfs-read-memory-$id "zipfs read in-memory $id" -setup { unset -nocomplain fd zipfs mountdata $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body { set fd [open [file join $defMountPt $filename] {*}$openopts] gets $fd } -result $result {*}$args } testzipfsread stored test.zip test test testzipfsread stored-1 teststored.zip aaaaaaaaaaaaaa testzipfsread deflate testdeflated2.zip aaaaaaaaaaaaaa testzipfsread bug-23dd83ce7c empty.zip {} empty.txt # Test open modes - see bug [4645658689] testzipfsread stored-r+ teststored.zip aaaaaaaaaaaaaa abac-repeat.txt r+ testzipfsread deflate-r+ testdeflated2.zip aaaaaaaaaaaaaa abac-repeat.txt r+ testzipfsread stored-w+ teststored.zip {} abac-repeat.txt w+ testzipfsread deflate-w+ testdeflated2.zip {} abac-repeat.txt w+ testzipfsread stored-a+ teststored.zip {} abac-repeat.txt a+ testzipfsread deflate-a+ testdeflated2.zip {} abac-repeat.txt a+ testzipfsread enoent test.zip "file \"//zipfs:/testmount/nosuchfile\" not found: no such file or directory" nosuchfile {} -returnCodes error testzipfsread bzip2 testbzip2.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread lzma testfile-lzma.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread xz testfile-xz.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread zstd testfile-zstd.zip {unsupported compression method} abac-repeat.txt {} -returnCodes error testzipfsread deflate-error broken.zip {decompression error} deflatezliberror {} -returnCodes error test zipfs-read-unwritable "Writes not allowed on file opened for read" -setup { mount [zippath test.zip] } -cleanup { close $fd cleanup } -body { set fd [open [file join $defMountPt test]] puts $fd blah } -result {channel "*" wasn't opened for writing} -match glob -returnCodes error # # Write proc testzipfswrite {id zippath result filename mode args} { variable defMountPt set zippath [zippath $zippath] set path [file join $defMountPt $filename] set body { set fd [open $path $mode] fconfigure $fd -translation binary puts -nonewline $fd XYZ seek $fd 0 puts -nonewline $fd xyz close $fd set fd [open $path] fconfigure $fd -translation binary read $fd } test zipfs-write-$id "zipfs write $id" -setup { unset -nocomplain fd zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body $body -result $result {*}$args set data [readbin $zippath] test zipfs-write-memory-$id "zipfs write in-memory $id" -setup { unset -nocomplain fd zipfs mountdata $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body $body -result $result {*}$args } testzipfswrite create-w test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w -returnCodes error testzipfswrite create-w+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile w+ -returnCodes error testzipfswrite create-a test.zip "file \"$defMountPt/newfile\" not created: operation not supported" newfile a -returnCodes error testzipfswrite create-a+ test.zip "file \"//zipfs:/testmount/newfile\" not created: operation not supported" newfile a+ -returnCodes error testzipfswrite store-w teststored.zip "xyz" abac-repeat.txt w testzipfswrite deflate-w testdeflated2.zip "xyz" abac-repeat.txt w testzipfswrite store-w+ teststored.zip "xyz" abac-repeat.txt w+ testzipfswrite deflate-w+ testdeflated2.zip "xyz" abac-repeat.txt w+ testzipfswrite stored-a teststored.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZxyz" abac-repeat.txt a testzipfswrite deflate-a testdeflated2.zip "aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZxyz" abac-repeat.txt a testzipfswrite store-a+ teststored.zip "xyzaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZ" abac-repeat.txt a+ testzipfswrite deflate-a+ testdeflated2.zip "xyzaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\nXYZ" abac-repeat.txt a+ testzipfswrite bug-23dd83ce7c-w empty.zip "xyz" empty.txt w test zipfs-write-unreadable "Reads not allowed on file opened for write" -setup { mount [zippath test.zip] } -cleanup { close $fd cleanup } -body { set fd [open [file join $defMountPt test] w] read $fd } -result {channel "*" wasn't opened for reading} -match glob -returnCodes error test zipfs-write-persist "Writes persist ONLY while mounted" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set path [file join $defMountPt test] set fd [open $path w] puts -nonewline $fd newtext close $fd set fd [open $path] set result [list [read $fd]] close $fd zipfs unmount $defMountPt mount [zippath test.zip] set fd [open $path] lappend result [read $fd] close $fd set result } -result [list newtext test\n] test zipfs-write-size-limit-0 "Writes more than size limit with flush" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { close $fd set ::tcl::zipfs::wrmax $origlimit cleanup } -body { set ::tcl::zipfs::wrmax 10 set fd [open [file join $defMountPt test] w] puts $fd [string repeat x 11] flush $fd } -result {error flushing *: file too large} -match glob -returnCodes error test zipfs-write-size-limit-1 "Writes size limit on close" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { set ::tcl::zipfs::wrmax $origlimit cleanup } -body { set ::tcl::zipfs::wrmax 10 set fd [open [file join $defMountPt test] w] puts $fd [string repeat x 11] close $fd } -result {file too large} -match glob -returnCodes error test zipfs-write-size-limit-2 "Writes max size" -setup { set origlimit $::tcl::zipfs::wrmax set ::tcl::zipfs::wrmax 10000000 mount [zippath test.zip] } -cleanup { set ::tcl::zipfs::wrmax $origlimit cleanup } -body { set fd [open [file join $defMountPt test] w] puts -nonewline $fd [string repeat x $::tcl::zipfs::wrmax] close $fd file size [file join $defMountPt test] } -result 10000000 test zipfs-write-size-limit-3 "Writes incrementally - buffer growth" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set fd [open [file join $defMountPt test] w] fconfigure $fd -buffering none for {set i 0} {$i < 100000} {incr i} { puts -nonewline $fd 0123456789 } close $fd readbin [file join $defMountPt test] } -result [string repeat 0123456789 100000] test zipfs-write-size-limit-4 "Writes disallowed" -setup { set origlimit $::tcl::zipfs::wrmax mount [zippath test.zip] } -cleanup { set ::tcl::zipfs::wrmax $origlimit cleanup } -body { set ::tcl::zipfs::wrmax -1 open [file join $defMountPt test] w } -result {writes not permitted: permission denied} -returnCodes error # # read/seek/write proc testzipfsrw {id zippath expected filename mode args} { variable defMountPt set zippath [zippath $zippath] set path [file join $defMountPt $filename] set body { set result "" set fd [open $path $mode] fconfigure $fd -translation binary append result [gets $fd], set pos [tell $fd] append result $pos, puts -nonewline $fd "0123456789" append result [gets $fd], seek $fd $pos append result [gets $fd], seek $fd -6 end append result [read $fd]| close $fd # Reopen after closing - bug [f91ee30d3] set fd [open $path rb] append result [read $fd] } test zipfs-rw-$id "zipfs read/seek/write $id" -setup { unset -nocomplain fd zipfs mount $zippath $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body $body -result $expected {*}$args set data [readbin $zippath] test zipfs-rw-memory-$id "zipfs read/seek/write in-memory $id" -setup { unset -nocomplain fd zipfs mountdata $data $defMountPt } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body $body -result $expected {*}$args } testzipfsrw store-r+ teststored.zip "aaaaaaaaaaaaaa,15,bbbb,0123456789bbbb,ccccc\n|aaaaaaaaaaaaaa\n0123456789bbbb\naaaaaaaaaaaaaa\ncccccccccccccc\n" abac-repeat.txt r+ testzipfsrw store-w+ teststored.zip ",0,,0123456789,456789|0123456789" abac-repeat.txt w+ testzipfsrw store-a+ teststored.zip ",60,,0123456789,456789|aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\n0123456789" abac-repeat.txt a+ testzipfsrw deflate-r+ testdeflated2.zip "aaaaaaaaaaaaaa,15,bbbb,0123456789bbbb,ccccc\n|aaaaaaaaaaaaaa\n0123456789bbbb\naaaaaaaaaaaaaa\ncccccccccccccc\n" abac-repeat.txt r+ testzipfsrw deflate-w+ testdeflated2.zip ",0,,0123456789,456789|0123456789" abac-repeat.txt w+ testzipfsrw deflate-a+ testdeflated2.zip ",60,,0123456789,456789|aaaaaaaaaaaaaa\nbbbbbbbbbbbbbb\naaaaaaaaaaaaaa\ncccccccccccccc\n0123456789" abac-repeat.txt a+ test zipfs-rw-bug-f91ee30d33 "Bug f91ee30d33 - truncates at last read" -setup { mount [zippath test.zip] } -cleanup { close $fd cleanup } -body { set path [file join $defMountPt test] set fd [open $path r+] puts -nonewline $fd X close $fd set fd [open $path r] read $fd } -result "Xest\n" # # Password protected proc testpasswordr {id zipfile filename password result args} { variable defMountPt set zippath [zippath $zipfile] test zipfs-password-read-$id "zipfs password read $id" -setup { unset -nocomplain fd if {$password ne ""} { zipfs mount $zippath $defMountPt $password } else { zipfs mount $zippath $defMountPt } } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body { set fd [open [file join $defMountPt $filename]] gets $fd } -result $result {*}$args -constraints bbe7c6ff9e } # The bug bbe7c6ff9e only manifests on macos testConstraint bbe7c6ff9e [expr {$::tcl_platform(os) ne "Darwin"}] # NOTE: test-password.zip is the DOS time based encryption header validity check (infozip style) # test-password2.zip is the CRC based encryption header validity check (pkware style) testpasswordr plain test-password.zip plain.txt password plaintext testpasswordr plain-nopass test-password.zip plain.txt "" plaintext testpasswordr plain-badpass test-password.zip plain.txt badpassword plaintext testpasswordr cipher-1 test-password.zip cipher.bin password ciphertext testpasswordr cipher-2 test-password2.zip cipher.bin password ciphertext testpasswordr cipher-nopass-1 test-password.zip cipher.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-nopass-2 test-password2.zip cipher.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-badpass-1 test-password.zip cipher.bin badpassword "invalid password" -returnCodes error testpasswordr cipher-badpass-2 test-password2.zip cipher.bin badpassword "invalid password" -returnCodes error testpasswordr cipher-deflate test-password.zip cipher-deflate.bin password [lseq 100] testpasswordr cipher-deflate-nopass test-password.zip cipher-deflate.bin {} "decryption failed - no password provided" -returnCodes error testpasswordr cipher-deflate-badpass test-password.zip cipher-deflate.bin badpassword "invalid password" -returnCodes error proc testpasswordw {id zippath filename password mode result args} { variable defMountPt set zippath [zippath $zippath] set path [file join $defMountPt $filename] set body { set fd [open $path $mode] fconfigure $fd -translation binary puts -nonewline $fd "xyz" close $fd set fd [open $path] fconfigure $fd -translation binary read $fd } test zipfs-password-write-$id "zipfs write $id" -setup { unset -nocomplain fd if {$password ne ""} { zipfs mount $zippath $defMountPt $password } else { zipfs mount $zippath $defMountPt } } -cleanup { # In case open succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body $body -result $result {*}$args -constraints bbe7c6ff9e } # NOTE: test-password.zip is the DOS time based encryption header validity check (infozip style) # test-password2.zip is the CRC based encryption header validity check (pkware style) testpasswordw cipher-w-1 test-password.zip cipher.bin password w xyz testpasswordw cipher-w-2 test-password2.zip cipher.bin password w xyz testpasswordw cipher-deflate-w test-password2.zip cipher-deflate.bin password w xyz testpasswordw cipher-badpass-w-1 test-password.zip cipher.bin badpass w {invalid password} -returnCodes error testpasswordw cipher-badpass-w-2 test-password2.zip cipher.bin badpass w {invalid password} -returnCodes error testpasswordw cipher-badpass-deflate-w test-password2.zip cipher-deflate.bin badpass w {invalid password} -returnCodes error testpasswordw cipher-w+ test-password.zip cipher.bin password w xyz testpasswordw cipher-deflate-w+ test-password2.zip cipher-deflate.bin password w xyz testpasswordw cipher-badpass-w+ test-password.zip cipher.bin badpass w {invalid password} -returnCodes error testpasswordw cipher-badpass-deflate-w+ test-password2.zip cipher-deflate.bin badpass w {invalid password} -returnCodes error testpasswordw cipher-a+ test-password.zip cipher.bin password a+ ciphertextxyz testpasswordw cipher-deflate-a+ test-password2.zip cipher-deflate.bin password a+ [lseq 100]xyz testpasswordw cipher-badpass-a+ test-password.zip cipher.bin badpass a+ {invalid password} -returnCodes error testpasswordw cipher-badpass-deflate-a+ test-password2.zip cipher-deflate.bin badpass a+ {invalid password} -returnCodes error # # CRC errors proc testcrc {id zippath filename result args} { variable defMountPt set zippath [zippath $zippath] test zipfs-crc-$id "zipfs crc $id" -setup { unset -nocomplain fd zipfs mount $zippath $defMountPt } -cleanup { # In case mount succeeded when it should not if {[info exists fd]} { close $fd } cleanup } -body { set fd [open [file join $defMountPt $filename]] } -result $result -returnCodes error {*}$args # Mount memory buffer test zipfs-crc-memory-$id "zipfs crc memory $id" -setup { zipfs mountdata [readbin [zippath $zippath]] $defMountPt } -cleanup { cleanup } -body { set fd [open [file join $defMountPt $filename]] } -result $result -returnCodes error {*}$args } testcrc local incons-local-crc.zip a "invalid CRC" testcrc store-crc broken.zip storedcrcerror "invalid CRC" testcrc deflate-crc broken.zip deflatecrcerror "invalid CRC" test zipfs-crc-false-positives { Verify no false positives in CRC checking } -constraints zipfslib -body { # Just loop ensuring no crc failures foreach f [zipfs list] { if {[file isfile $f]} { close [open $f] incr count } } expr {$count > 0} } -result 1 # # file stat,lstat proc fixuptime {t} { # To compensate for the lack of timezone in zip, all dates # expressed as strings and translated to local time if {[regexp {^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d} $t]} { return [clock scan $t -format "%Y-%m-%d %H:%M:%S"] } return $t } proc fixupstat {stat} { foreach key {atime ctime mtime} { # ZIP files have no TZ info so zipfs uses mktime which is localtime dict set stat $key [fixuptime [dict get $stat $key]] } if {$::tcl_platform(platform) ne "windows"} { dict set stat blksize 0 dict set stat blocks 0 } return [lsort -stride 2 $stat] } # Wraps stat and lstat proc testzipfsstat {id mountpoint target result args} { test zipfs-file-stat-$id "file stat $id" -setup { zipfs mount [zippath test.zip] $mountpoint } -cleanup cleanup -body { lsort -stride 2 [file stat [file join $mountpoint $target]] } -result $result {*}$args test zipfs-file-lstat-$id "file lstat $id" -setup { mount [zippath test.zip] } -cleanup cleanup -body { lsort -stride 2 [file lstat [file join $mountpoint $target]] } -result $result {*}$args } testzipfsstat enoent $defMountPt enoent "could not read \"[file join $defMountPt enoent]\": no such file or directory" -returnCodes error testzipfsstat nosuchmount $defMountPt //zipfs:/notamount/test "could not read \"//zipfs:/notamount/test\": no such file or directory" -returnCodes error testzipfsstat file $defMountPt test [fixupstat {atime {2003-10-06 15:46:42} ctime {2003-10-06 15:46:42} dev 0 gid 0 ino 0 mode 33133 mtime {2003-10-06 15:46:42} nlink 0 size 5 type file uid 0}] testzipfsstat dir $defMountPt testdir [fixupstat {atime {2005-01-11 19:03:54} ctime {2005-01-11 19:03:54} dev 0 gid 0 ino 0 mode 16749 mtime {2005-01-11 19:03:54} nlink 0 size 0 type directory uid 0}] testzipfsstat root-mount [zipfs root] [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp testzipfsstat root-subdir-mount $defMountPt [zipfs root] [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp testzipfsstat mezzo [file join $defMountPt mt2] $defMountPt [fixupstat {atime .* ctime .* dev 0 gid 0 ino 0 mode 16749 mtime .* nlink 0 size 0 type directory uid 0}] -match regexp # # glob of zipfs file proc testzipfsglob {id mounts cmdopts result args} { set setup { foreach {zippath mountpoint} $mounts { zipfs mount [zippath $zippath] [file join [zipfs root] $mountpoint] } } if {[dict exists $args -setup]} { append setup \n[dict get $args -setup] dict unset args -setup } set cleanup cleanup if {[dict exists $args -cleanup]} { set cleanup "[dict get $args -cleanup]\n$cleanup" dict unset args -cleanup } test zipfs-glob-$id "zipfs glob $id $cmdopts" -body { lsort [glob {*}$cmdopts] } -setup $setup -cleanup $cleanup -result $result {*}$args } set basicMounts [list test.zip $defMountPt] testzipfsglob basic $basicMounts [list $defMountPt/*] [zipfspathsmt $defMountPt test testdir] testzipfsglob basic-pat $basicMounts [list $defMountPt/t*d*] [zipfspathsmt $defMountPt testdir] testzipfsglob basic-deep $basicMounts [list $defMountPt/tes*/*] [zipfspathsmt $defMountPt testdir/test2] testzipfsglob basic-dir $basicMounts [list -directory $defMountPt *] [zipfspathsmt $defMountPt test testdir] testzipfsglob basic-dir-tails $basicMounts [list -tails -dir $defMountPt *] [list test testdir] testzipfsglob basic-type-d $basicMounts [list -type d $defMountPt/*] [zipfspathsmt $defMountPt testdir] testzipfsglob basic-type-f $basicMounts [list -type f $defMountPt/*] [zipfspathsmt $defMountPt test] testzipfsglob basic-type-d-f $basicMounts [list -type {d f} $defMountPt/*] [zipfspathsmt $defMountPt test testdir] testzipfsglob basic-type-l $basicMounts [list -type l $defMountPt/*] {} foreach type {b c l p s} { testzipfsglob basic-type-1-$type $basicMounts [list -type $type $defMountPt/*] {} testzipfsglob basic-type-f-$type $basicMounts [list -type [list f $type] $defMountPt/*] [zipfspathsmt $defMountPt test] testzipfsglob basic-type-d-$type $basicMounts [list -type [list d $type] $defMountPt/*] [zipfspathsmt $defMountPt testdir] } testzipfsglob basic-path $basicMounts [list -path $defMountPt/t *d*] [zipfspathsmt $defMountPt testdir] testzipfsglob basic-enoent $basicMounts [list $defMountPt/x*] {} testzipfsglob basic-enoent-ok $basicMounts [list -nocomplain $defMountPt/x*] {} # NOTE: test root mounts separately because some bugs only showed up on these set rootMounts [list test.zip /] testzipfsglob root-1 $rootMounts [list [zipfs root]*] [zipfspaths $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-2 $rootMounts [list [zipfs root]*] [zipfspaths test testdir] -constraints !zipfslib testzipfsglob root-pat $rootMounts [list [zipfs root]t*d*] [zipfspaths testdir] testzipfsglob root-deep $rootMounts [list [zipfs root]tes*/*] [zipfspaths testdir/test2] testzipfsglob root-dir-1 $rootMounts [list -directory [zipfs root] *] [zipfspaths $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-dir-2 $rootMounts [list -directory [zipfs root] *] [zipfspaths test testdir] -constraints !zipfslib testzipfsglob root-dir-tails-1 $rootMounts [list -tails -dir [zipfs root] *] [list $::zipLibTop test testdir] -constraints zipfslib testzipfsglob root-dir-tails-2 $rootMounts [list -tails -dir [zipfs root] *] [list test testdir] -constraints !zipfslib testzipfsglob root-type-d-1 $rootMounts [list -type d [zipfs root]*] [zipfspaths $::zipLibTop testdir] -constraints zipfslib testzipfsglob root-type-d-2 $rootMounts [list -type d [zipfs root]*] [zipfspaths testdir] -constraints !zipfslib testzipfsglob root-type-f $rootMounts [list -type f [zipfs root]*] [zipfspaths test] testzipfsglob root-type-d-f $rootMounts [list -type {d f} [zipfs root]*] [zipfspaths test testdir] -constraints !zipfslib testzipfsglob root-path $rootMounts [list -path [zipfs root]t *d*] [zipfspaths testdir] testzipfsglob root-enoent $rootMounts [list [zipfs root]x*] {} testzipfsglob root-enoent-ok $rootMounts [list -nocomplain [zipfs root]x*] {} # glob operations on intermediate directories (mezzo) in mount # paths is another source of bugs set mezzoMounts [list test.zip $defMountPt/a/b test-overlay.zip $defMountPt/a/c] testzipfsglob mezzo-root-1 $mezzoMounts [list [zipfs root]*] [zipfspaths $::zipLibTop $defMountPt] -constraints zipfslib testzipfsglob mezzo-root-2 $mezzoMounts [list [zipfs root]*] [list $defMountPt] -constraints !zipfslib testzipfsglob mezzo-mountgrandparent $mezzoMounts [list $defMountPt/*] [list $defMountPt/a] testzipfsglob mezzo-mountparent $mezzoMounts [list $defMountPt/a/*] [zipfspathsmt $defMountPt/a b c] testzipfsglob mezzo-overlay [list test.zip $defMountPt/a/b test-overlay.zip $defMountPt/a] [list $defMountPt/a/*] [zipfspathsmt $defMountPt/a b test2 test3] # # file attributes proc testzipfsfileattr [list id path result [list mountpoint $defMountPt] args] { test zipfs-file-attrs-$id "zipfs file attrs $id" -setup { mount [zippath test.zip] $mountpoint } -cleanup cleanup -body { lsort -stride 2 [file attributes $path] } -result $result {*}$args } testzipfsfileattr noent [file join $defMountPt nosuchfile] \ {file not found: no such file or directory} $defMountPt -returnCodes error testzipfsfileattr file [file join $defMountPt test] \ [list -archive [zippath test.zip] -compsize 5 -crc [expr 0x3BB935C6] -mount $defMountPt -offset 55 -permissions 0o555 -uncompsize 5] testzipfsfileattr dir [file join $defMountPt testdir] \ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defMountPt -offset 119 -permissions 0o555 -uncompsize 0] testzipfsfileattr root [zipfs root] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} testzipfsfileattr mountpoint $defMountPt \ [list -archive [zippath test.zip] -compsize 0 -crc 0 -mount $defMountPt -offset 0 -permissions 0o555 -uncompsize 0] testzipfsfileattr mezzo [file join $defMountPt a b] {-archive {} -compsize 0 -crc 0 -mount {} -offset 0 -permissions 0o555 -uncompsize 0} [file join $defMountPt a b c] foreach attr {-uncompsize -compsize -offset -mount -archive -permissions -crc} { test zipfs-file-attrs-set$attr "Set zipfs file attribute $attr" -setup { mount [zippath test.zip] } -cleanup cleanup \ -body "file attributes [file join $defMountPt test] $attr {}" \ -result "unsupported operation" -returnCodes error } # # file normalize proc testzipfsnormalize {id path result {dir {}}} { if {$dir eq ""} { test zipfs-file-normalize-$id "zipfs file normalize $id" -body { file normalize $path } -result $result } else { test zipfs-file-normalize-$id "zipfs file normalize $id" -setup { set cwd [pwd] mount [zippath test.zip] [zipfs root] cd $dir } -cleanup { cd $cwd cleanup } -body { file normalize $path } -result $result } } # The parsing requires all these cases for various code paths # in particular, root, one below root and more than one below root testzipfsnormalize dot-1 [zipfs root] [zipfs root] testzipfsnormalize dot-2 [file join [zipfs root] .] [zipfs root] testzipfsnormalize dot-3 [file join [zipfs root] . .] [zipfs root] testzipfsnormalize dot-4 [file join [zipfs root] a .] [file join [zipfs root] a] testzipfsnormalize dot-5 [file join [zipfs root] a . . .] [file join [zipfs root] a] testzipfsnormalize dot-6 [file join [zipfs root] a b .] [file join [zipfs root] a b] testzipfsnormalize dot-7 [file join [zipfs root] a b . .] [file join [zipfs root] a b] testzipfsnormalize dotdot-1 [file join [zipfs root] ..] [zipfs root] testzipfsnormalize dotdot-2 [file join [zipfs root] .. ..] [zipfs root] testzipfsnormalize dotdot-3 [file join [zipfs root] a ..] [zipfs root] testzipfsnormalize dotdot-4 [file join [zipfs root] a .. .. ..] [zipfs root] testzipfsnormalize dotdot-5 [file join [zipfs root] a b ..] [file join [zipfs root] a] testzipfsnormalize dotdot-6 [file join [zipfs root] a b ..] [file join [zipfs root] a] testzipfsnormalize dotdot-7 [file join [zipfs root] a b .. ..] [zipfs root] testzipfsnormalize dotdot-8 [file join [zipfs root] a b .. .. .. ..] [zipfs root] testzipfsnormalize relative-1 a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-2 . [zipfs root] [zipfs root] testzipfsnormalize relative-3 ./ [zipfs root] [zipfs root] testzipfsnormalize relative-4 ./a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-5 ../ [file join [zipfs root]] [zipfs root] testzipfsnormalize relative-6 ../a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-7 ../a/ [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-8 ../.. [zipfs root] [zipfs root] testzipfsnormalize relative-9 dir/a [file join [zipfs root] dir a] [zipfs root] testzipfsnormalize relative-10 dir/dirb/.. [file join [zipfs root] dir] [zipfs root] testzipfsnormalize relative-11 dir/../a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-12 dir/../a/ [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-13 dir/../../../a [file join [zipfs root] a] [zipfs root] testzipfsnormalize relative-14 a [file join [zipfs root] testdir a] [file join [zipfs root] testdir] # # file copy test zipfs-file-copy-tozip-new {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { removeFile $_ cleanup } -body { file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt X] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt X]\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-tozip-existing {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { removeFile $_ cleanup } -body { file copy [set _ [makeFile "newtext" source.tmp]] [file join $defMountPt test] } -result "error copying *: file exists" -match glob -returnCodes error test zipfs-file-copy-tozip-existing-force {Copy native file to archive} -setup { mount [zippath test.zip] } -cleanup { removeFile $_ cleanup } -body { set to [file join $defMountPt test] file copy -force [set _ [makeFile "newtext" source.tmp]] $to readbin $to } -result "newtext\n" test zipfs-file-copy-tozipdir {Copy native file to archive directory} -setup { mount [zippath test.zip] } -cleanup { removeFile $_ cleanup } -body { file copy [set _ [makeFile "" source.tmp]] [file join $defMountPt testdir] } -result "error copying \"*source.tmp\" to \"[file join $defMountPt testdir]/source.tmp\": operation not supported" \ -match glob -returnCodes error test zipfs-file-copydir-tozipdir {Copy native dir to archive directory} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { file copy [temporaryDirectory] [file join $defMountPt testdir] } -result "can't create directory *: operation not supported" \ -match glob -returnCodes error test zipfs-file-copy-fromzip-new {Copy archive file to native} -setup { mount [zippath test.zip] set dst [file join [temporaryDirectory] dst.tmp] file delete $dst } -cleanup { file delete $dst cleanup } -body { file copy [file join $defMountPt test] $dst readbin $dst } -result "test\n" test zipfs-file-copydir-fromzip-1 {Copy archive dir to native} -setup { mount [zippath test.zip] set dst [file join [temporaryDirectory] dstdir.tmp] file delete -force $dst } -cleanup { file delete -force $dst cleanup } -body { file copy [file join $defMountPt testdir] $dst zipfs find $dst } -result [file join [temporaryDirectory] dstdir.tmp test2] test zipfs-file-copymount-fromzip-new {Copy archive mount to native} -setup { mount [zippath test.zip] set dst [file join [temporaryDirectory] dstdir2.tmp] file delete -force $dst } -cleanup { file delete -force $dst cleanup } -body { file copy $defMountPt $dst list [file isfile [file join $dst test]] \ [file isdirectory [file join $dst testdir]] \ [file isfile [file join $dst testdir test2]] } -result {1 1 1} # # file delete test zipfs-file-delete "Delete file in zip archive" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set file [file join $defMountPt test] list \ [file exists $file] \ [catch {file delete $file} msg] \ $msg \ [file exists $file] } -result [list 1 1 {error deleting "//zipfs:/testmount/test": operation not supported} 1] test zipfs-file-delete-enoent "Delete nonexisting path in zip archive" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set file [file join $defMountPt enoent] list \ [file exists $file] \ [catch {file delete $file} msg] \ $msg \ [file exists $file] } -result [list 0 0 {} 0] test zipfs-file-delete-dir "Delete dir in zip archive" -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set dir [file join $defMountPt testdir] list \ [file isdirectory $dir] \ [catch {file delete -force $dir} msg] \ $msg \ [file isdirectory $dir] } -result [list 1 1 {error deleting unknown file: operation not supported} 1] # # file join test zipfs-file-join-1 "Ensure file join recognizes zipfs path as absolute" -body { file join /abc [zipfs root]a/b/c } -result [zipfs root]a/b/c # # file mkdir test zipfs-file-mkdir {Make a directory in zip archive} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { file mkdir [file join $defMountPt newdir] } -result "can't create directory \"[file join $defMountPt newdir]\": operation not supported" -returnCodes error test zipfs-file-mkdir-existing {Make a an existing directory in zip archive} -setup { mount [zippath test.zip] } -cleanup { cleanup } -body { set dir [file join $defMountPt testdir] file mkdir $dir file isdirectory $dir } -result 1 # Standard paths for file command tests. Because code paths are different, # we need tests for... set targetMountParent $defMountPt; # Parent of mount directory set targetMount [file join $targetMountParent mt] ; # Mount directory set targetFile [file join $targetMount test]; # Normal file set targetDir [file join $targetMount testdir]; # Directory set targetEnoent [file join $targetMount enoent]; # Non-existing path proc testzipfsfile {id cmdargs result args} { variable targetMount test zipfs-file-$id "file $id on zipfs" -setup { zipfs mount [zippath test.zip] $targetMount } -cleanup cleanup -body { file {*}$cmdargs } -result $result {*}$args } proc testzipfsenotsup {id cmdargs args} { testzipfsfile $id $cmdargs "*: operation not supported" -match glob -returnCodes error } # # file atime testzipfsfile atime-get-file [list atime $targetFile] [fixuptime {2003-10-06 15:46:42}] testzipfsfile atime-get-dir [list atime $targetDir] [fixuptime {2005-01-11 19:03:54}] testzipfsfile atime-get-mount [list atime $targetMount] {\d+} -match regexp testzipfsfile atime-get-mezzo [list atime $targetMountParent] {\d+} -match regexp testzipfsfile atime-get-root [list atime [zipfs root]] {\d+} -match regexp testzipfsfile atime-get-enoent [list atime $targetEnoent] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error set t [clock seconds] testzipfsenotsup atime-set-file [list atime $targetFile $t] testzipfsenotsup atime-set-dir [list atime $targetDir $t] testzipfsenotsup atime-set-mount [list atime $targetMount $t] testzipfsenotsup atime-set-mezzo [list atime $targetMountParent $t] testzipfsenotsup atime-set-root [list atime [zipfs root] $t] testzipfsfile atime-set-enoent [list atime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # # file dirname testzipfsfile dirname-file [list dirname $targetFile] $targetMount testzipfsfile dirname-dir [list dirname $targetDir] $targetMount testzipfsfile dirname-mount [list dirname $targetMount] $targetMountParent testzipfsfile dirname-mezzo [list dirname $targetMountParent] [zipfs root] testzipfsfile dirname-root [list dirname [zipfs root]] [zipfs root] testzipfsfile dirname-enoent [list dirname $targetEnoent] $targetMount # # file executable testzipfsfile executable-file [list executable $targetFile] 0 testzipfsfile executable-dir [list executable $targetDir] 0 testzipfsfile executable-mount [list executable $targetMount] 0 testzipfsfile executable-mezzo [list executable $targetMountParent] 0 testzipfsfile executable-root [list executable [zipfs root]] 0 testzipfsfile executable-enoent [list executable $targetEnoent] 0 # # file exists testzipfsfile exists-file [list exists $targetFile] 1 testzipfsfile exists-dir [list exists $targetDir] 1 testzipfsfile exists-mount [list exists $targetMount] 1 testzipfsfile exists-mezzo [list exists $targetMountParent] 1 testzipfsfile exists-root [list exists [zipfs root]] 1 testzipfsfile exists-enoent [list exists $targetEnoent] 0 # # file isdirectory testzipfsfile isdirectory-file [list isdirectory $targetFile] 0 testzipfsfile isdirectory-dir [list isdirectory $targetDir] 1 testzipfsfile isdirectory-mount [list isdirectory $targetMount] 1 testzipfsfile isdirectory-mezzo [list isdirectory $targetMountParent] 1 testzipfsfile isdirectory-root [list isdirectory [zipfs root]] 1 testzipfsfile isdirectory-enoent [list isdirectory $targetEnoent] 0 # # file isfile testzipfsfile isfile-file [list isfile $targetFile] 1 testzipfsfile isfile-dir [list isfile $targetDir] 0 testzipfsfile isfile-mount [list isfile $targetMount] 0 testzipfsfile isfile-mezzo [list isfile $targetMountParent] 0 testzipfsfile isfile-root [list isfile [zipfs root]] 0 testzipfsfile isfile-enoent [list isfile $targetEnoent] 0 # # file link testzipfsfile link-read-enoent [list link [file join $targetDir l]] {could not read link "//zipfs:/testmount/mt/testdir/l": operation not supported} -returnCodes error testzipfsfile link-read-notalink [list link $targetFile] {could not read link "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error testzipfsfile link-write [list link [file join $targetDir l] $targetFile] {could not create new link "//zipfs:/testmount/mt/testdir/l" pointing to "//zipfs:/testmount/mt/test": operation not supported} -returnCodes error # # file mtime testzipfsfile mtime-get-file [list mtime $targetFile] [fixuptime {2003-10-06 15:46:42}] testzipfsfile mtime-get-dir [list mtime $targetDir] [fixuptime {2005-01-11 19:03:54}] testzipfsfile mtime-get-mount [list mtime $targetMount] {\d+} -match regexp testzipfsfile mtime-get-mezzo [list mtime $targetMountParent] {\d+} -match regexp testzipfsfile mtime-get-root [list mtime [zipfs root]] {\d+} -match regexp testzipfsfile mtime-set-enoent [list mtime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error set t [clock seconds] testzipfsenotsup mtime-set-file [list mtime $targetFile $t] testzipfsenotsup mtime-set-dir [list mtime $targetDir $t] testzipfsenotsup mtime-set-mount [list mtime $targetMount $t] testzipfsenotsup mtime-set-mezzo [list mtime $targetMountParent $t] testzipfsenotsup mtime-set-root [list mtime [zipfs root] $t] testzipfsfile mtime-set-enoent-1 [list mtime $targetEnoent $t] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # # file owned testzipfsfile owned-file [list owned $targetFile] 1 testzipfsfile owned-dir [list owned $targetDir] 1 testzipfsfile owned-mount [list owned $targetMount] 1 testzipfsfile owned-mezzo [list owned $targetMountParent] 1 testzipfsfile owned-root [list owned [zipfs root]] 1 testzipfsfile owned-enoent [list owned $targetEnoent] 0 # # file pathtype testzipfsfile pathtype [list pathtype $targetFile] absolute # # file readable testzipfsfile readable-file [list readable $targetFile] 1 testzipfsfile readable-dir [list readable $targetDir] 1 testzipfsfile readable-mount [list readable $targetMount] 1 testzipfsfile readable-mezzo [list readable $targetMountParent] 1 testzipfsfile readable-root [list readable [zipfs root]] 1 testzipfsfile readable-enoent [list readable $targetEnoent] 0 # # file separator testzipfsfile separator [list separator $targetFile] / # # file size testzipfsfile size-file [list size $targetFile] 5 testzipfsfile size-dir [list size $targetDir] 0 testzipfsfile size-mount [list size $targetMount] 0 testzipfsfile size-mezzo [list size $targetMountParent] 0 testzipfsfile size-root [list size [zipfs root]] 0 testzipfsfile size-enoent [list size $targetEnoent] \ "could not read \"$targetEnoent\": no such file or directory" -returnCodes error # # file split testzipfsfile split-file [list split $targetFile] [list [zipfs root] testmount mt test] testzipfsfile split-root [list split [zipfs root]] [list [zipfs root]] testzipfsfile split-enoent [list split $targetEnoent] [list [zipfs root] testmount mt enoent] # # file system testzipfsfile system-file [list system $targetFile] {zipfs zip} testzipfsfile system-root [list system [zipfs root]] {zipfs zip} testzipfsfile system-enoent [list system $targetEnoent] {zipfs zip} # # file type testzipfsfile type-file [list type $targetFile] file testzipfsfile type-dir [list type $targetDir] directory testzipfsfile type-mount [list type $targetMount] directory testzipfsfile type-mezzo [list type $targetMountParent] directory testzipfsfile type-root [list type [zipfs root]] directory testzipfsfile type-enoent [list type $targetEnoent] {could not read "//zipfs:/testmount/mt/enoent": no such file or directory} -returnCodes error # # file writable testzipfsfile writable-file [list writable $targetFile] 1 testzipfsfile writable-dir [list writable $targetDir] 0 testzipfsfile writable-mount [list writable $targetMount] 0 testzipfsfile writable-mezzo [list writable $targetMountParent] 0 testzipfsfile writable-root [list writable [zipfs root]] 0 testzipfsfile writable-enoent [list writable $targetEnoent] 0 # TODO - mkkey, mkimg, mkzip, lmkimg, lmkzip testnumargs "zipfs mkkey" "password" "" -constraints zipfs testnumargs "zipfs mkimg" "outfile indir" "?strip? ?password? ?infile?" testnumargs "zipfs lmkimg" "outfile inlist" "?password? ?infile?" testnumargs "zipfs mkzip" "outfile indir" "?strip? ?password?" testnumargs "zipfs lmkzip" "outfile inlist" "?password?" # # Bug regressions test bug-6ed3447a7e "Crash opening file in streamed archive" -setup { mount [zippath streamed.zip] } -cleanup { cleanup } -body { set fd [open [file join $defMountPt -]] list [catch {read $fd} message] [close $fd] $message close $fd } -result {file size error (may be zip64)} -returnCodes error test bug-8259d74a64 "Crash exiting with open files" -setup { set path [zippath test.zip] set script "zipfs mount $path /\n" append script {open [zipfs root]test} \n append script "exit\n" } -body { set fd [open |[info nameofexecutable] r+] puts $fd $script flush $fd read $fd close $fd } -result "" # Following will only show a leak with valgrind test bug-9525f4c8bc "Memory leak with long mount paths" -body { set mt //zipfs:[string repeat /x 240] zipfs mount [zippath test.zip] $mt zipfs unmount $mt } -result "" test bug-33b2486199 "zipfs unmounted on thread exit" -constraints { thread } -body { set before [lsort [zipfs mount]] thread::release [thread::create] after 100; # Needed to allow the spawned thread to exit to trigger bug string equal $before [lsort [zipfs mount]] } -result 1 test bug-7d5f1c1308 "zipfs error on dotfiles" -setup { set basename bug-7d5f1c1308 set mt //zipfs:/$basename-mt set zipfile $basename.zip set dir [makeDirectory $basename] close [open [file join $dir .ext] w] } -cleanup { zipfs unmount $mt file delete $zipfile removeDirectory $basename } -body { zipfs mkzip $zipfile $dir [file dirname $dir] zipfs mount $zipfile $mt lsort [zipfs list $mt/*] } -result {//zipfs:/bug-7d5f1c1308-mt/bug-7d5f1c1308 //zipfs:/bug-7d5f1c1308-mt/bug-7d5f1c1308/.ext} } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/zipfiles/0000755000175000017500000000000015104662711014540 5ustar sergeisergeitcl9.0.3/tests/zipfiles/zip64.zip0000644000175000017500000000030615104661341016235 0ustar sergeisergeiPK-Or[@-a PK-Or[@-PK,-/5PKdPK/5tcl9.0.3/tests/zipfiles/teststored.zip0000644000175000017500000000027415104661341017465 0ustar sergeisergeiPK TtE.tcl9.0.3/tests/zipfiles/testdeflated2.zip0000644000175000017500000000041615104661341020015 0ustar sergeisergeiPK7wFH@5<abac-repeat2.txtKLD\I(+U6pPKTtEO)7]<.#C HV@?<^sD j!j$ bL1 QALUT W`ddPK }F/5;testUT Ar?Ar?Uxdtest PK {+2testdir/UT  AAUxdPK }F/5; testdir/test2UT Ar?Ar?Uxdtest PK }F/5; testUTAr?UxPK {+2 A<testdir/UT AUxPK }F/5; wtestdir/test2UTAr?UxPKPK vR] test.zipSDUTW`PKG<tcl9.0.3/tests/zipfiles/test-paths.zip0000644000175000017500000000123715104661341017361 0ustar sergeisergeiPK FLW$c///C:/src/tcltk/wip/tcl/tests/zipfiles/abspath.txtC:/src/tcltk/wip/tcl/tests/zipfiles/abspath.txtPK ѤLWȏ filename.txtfilename.txtPK LWf..-src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt/src/tcltk/wip/tcl/tests/zipfiles/fullpath.txtPK? FLW$c///$ C:/src/tcltk/wip/tcl/tests/zipfiles/abspath.txt 4{yPK? ѤLWȏ $ |filename.txt 2PK? LWf..-$ src/tcltk/wip/tcl/tests/zipfiles/fullpath.txt APK^+tcl9.0.3/tests/zipfiles/test-password2.zip0000644000175000017500000000073615104661341020171 0ustar sergeisergeiPK̰O)7]<.#C HV@?<^sD j!j$ bL1 QALUT NdNdNdplaintextPK )Wu&w zcipher.binSDes~cd`ia``0` fd3YE>O)7]<.#C HV@?<^sD j!j$ bL1 QALUT NdNdNdx"/ ͸_ElPKu&w PK  )WCۘ!zcipher-deflate.binSDes~cd`ia``0` fd3YE>O)7]<.#C HV@?<^sD j!j$ bL1 QALUT PdPdPd4r\3P& [ޘÿN /V6ATt{we3ȿ';Vp(yᠹO1s+"Ű;bj}~ a @*햾'C~ŕFH`Lޯ&PKCۘ!PK )W  plain.txtSDUTNdPK )Wu&w  cipher.binSDUTNdPK  )WCۘ! rcipher-deflate.binSDUTPdPKtcl9.0.3/tests/zipfiles/test-overlay.zip0000644000175000017500000000076215104661341017725 0ustar sergeisergeiPK (D*W& ztest2SDes~cd`ia``0` fd3YE>O)7]<.#C HV@?<^sD j!j$ bL1 QALUT 1d1d1dtest2-overlayPK -D*W2 ztest3SDes~cd`ia``0` fd3YE>O)7]<.#C HV@?<^sD j!j$ bL1 QALUT 1d1d1dtest3-overlayPK (D*W&  test2SDUT1dPK -D*W2  test3SDUT1dPKTtcl9.0.3/tests/zipfiles/streamed.zip0000644000175000017500000000017015104661341017064 0ustar sergeisergeiPK-R@-KPKPK-R@-PK/3tcl9.0.3/tests/zipfiles/README0000644000175000017500000000045215104661341015417 0ustar sergeisergeiThe files in this directory are used for testing zipfs file systems. They fall under the following licenses: test-overlay.zip, test-password[2].zip, test-zip-in-zip.zip - Tcl's license All other files - test files from libzip (https://libzip.org) and are covered by the license in LICENSE-libzip.tcl9.0.3/tests/zipfiles/LICENSE-libzip0000644000175000017500000000265615104661341017043 0ustar sergeisergeiCopyright (C) 1999-2020 Dieter Baron and Thomas Klausner The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. tcl9.0.3/tests/zipfiles/junk-at-start.zip0000644000175000017500000000064015104661341017766 0ustar sergeisergeifoo PK }F/5;testUT Ar?Ar?Uxdtest PK {+2testdir/UT  AAUxdPK }F/5; testdir/test2UT Ar?Ar?Uxdtest PK }F/5; testUTAr?UxPK {+2 A<testdir/UT AUxPK }F/5; wtestdir/test2UTAr?UxPKtcl9.0.3/tests/zipfiles/junk-at-end.zip0000644000175000017500000000064015104661341017377 0ustar sergeisergeiPK }F/5;testUT Ar?Ar?Uxdtest PK {+2testdir/UT  AAUxdPK }F/5; testdir/test2UT Ar?Ar?Uxdtest PK }F/5; testUTAr?UxPK {+2 A<testdir/UT AUxPK }F/5; wtestdir/test2UTAr?UxPKbar tcl9.0.3/tests/zipfiles/incons-local-magic-bad.zip0000644000175000017500000000023115104661341021441 0ustar sergeisergei@K t@CaUT ͞O͞Oux daPK t@CaUT͞Oux dPKG<tcl9.0.3/tests/zipfiles/incons-local-crc.zip0000644000175000017500000000023115104661341020404 0ustar sergeisergeiPK t@CaUT ͞O͞Oux daPK t@CaUT͞Oux dPKG<tcl9.0.3/tests/zipfiles/incons-file-count-low.zip0000644000175000017500000000046015104661341021415 0ustar sergeisergeiPKUF1(,file1content1PKUFq`!file2content2PKUFP&file3content3PKUF1(,file1PKUFq`!+file2PKUFP&Vfile3PKtcl9.0.3/tests/zipfiles/incons-file-count-high.zip0000644000175000017500000000023115104661341021527 0ustar sergeisergeiPK t@CaUT ͞O͞Oux daPK t@CaUT͞Oux dPK G<tcl9.0.3/tests/zipfiles/incons-central-magic-bad.zip0000644000175000017500000000023115104661341021777 0ustar sergeisergeiPK t@CaUT ͞O͞Oux da@K t@CaUT͞Oux dPKG<tcl9.0.3/tests/zipfiles/incons-central-crc.zip0000644000175000017500000000023115104661341020742 0ustar sergeisergeiPK t@CaUT ͞O͞Oux daPK t@CaUT͞Oux dPKG<tcl9.0.3/tests/zipfiles/incons-cdoffset.zip0000644000175000017500000000023115104661341020342 0ustar sergeisergeiPK t@CaUT ͞O͞Oux daPK t@CaUT͞Oux dPKG< tcl9.0.3/tests/zipfiles/empty.zip0000644000175000017500000000102015104661341016411 0ustar sergeisergeiPK :W empty.txtSDjs~cd`ia``0bbFV0UHS"yCœ/q1210010 0gkD #.!> , `U 6PJ!FZ0 UT  e eePK :W cipher.txtSDjs~cd`ia``0bbFV0UHS"yCœ/q1210010 0gkD #.!> , `U 6PJ!FZ0 UT  eee瀑U'-PK PK :W  empty.txtSDUT ePK :W  cipher.txtSDUT ePKitcl9.0.3/tests/zipfiles/broken.zip0000644000175000017500000022252315104661341016550 0ustar sergeisergeiPK (+2Li((storedokUT >A>AUxde$fFg}]2\,=#P"ɯ[5ٗm.,}RhX>CfWA UR Γ<8IС_83 a RQ죙Y6Y7MU< :;gz,+(G/AΛ?q 6wDyU?=ݳ]u2x y1=;G8Jo(@b<21彑7b6Bde!&}ـX [Y=7:}|H-qnD ;N ᅣn[u|;g x#P)`/e1^a4֥kA;S=:?h*RHŤ%B^MzQXѩuwU*D0$:P%o^;ZIBC;ĕ.{1.C$^=bZCzfJ|^DIZ^^[WqBzY{;S8*/,+Յ;UnBOD/ZJE;mV6 @)nwᵦ! JAuzf.3!o(؆,;d7jxfgMe GdULb~cٺBڌ DSdS$DjFXB]y2({[)} 5I2r$hn)fՠ#y9U80E|eh.ZvD+SrM=\w^8Q͔:+4l~x)Ooj43Zת+s *Lhm/j#"86aL6P(DmG6Q-i ͜[zP&ݨr{5ޠns]ઊ81>!;!j*F12 )<XU][D0]q얜>Xe 6¶^RCo|؇ nR;p*<{6VFEYlpqaZx),U2xЋʾ{f)l^'`glǏWVBjbѾBVacl_b)7{j2UVSo|7ܱV$1&|sH+_rT:V'Q8kUJ~@QkHk iH<3'+ ֗mH`WsQ'~:Ooh8s$љ]Be);'5|k!9d9h?UYBpu$qMEN,g)=jWyEƕZf3e!=301WW&.kI*= ҝVm,ZTz(Yf%ClI+˽$KG1"Ro|̨6Dǫ:5D3ZBal>Q AJ7tg±hϮ{#qy'/VPk~f{>724$jpnĤ`Sk:栕E>ZGRe| njR۬tRbd:\v/aSe\ ,Q9009TbXn{קJr[[PfMZ|Np,+FTww\r9ӊ̠y_dvui ?Q}MSӂ tYW_+GNHW f ^voTHz[Yn`E^M沮nlFi&Om<>v1tUV1#3ąV&"g(*#gxЮryJ#u ;C(xGw= XlefUSC`mUfh85~XT D,,n=+ʊAD/ުf0\-fs O]{mҷٌ<&Ǔ77u~ncbԃ2/ĤsGIWg3vƚaQ@l+ЋQYgPiC@hM֧ _^Q,@;L 뻏}z;xZW']6^*l zZK/u=573{DlSeFb`0adpAQOlK6zT Q*ri V: _?!_ckqA-E JC?;RO7y#o%3++D黳I)UMrfm9Vnù -D-Xd yυxC~fI3iҿ钂$9'gp ut>ڮLz:t j+T9uU@⥯mu^rB)j~O1dPD%٫ʈYƒ3a\-K&(9N:W>&7;%Gb_2>b5&"2DoWs6nl9Pj9jO.ӳ>ՠf>6gI$F*)j !V<_;tZ~w˫Yq B΁dIhpjK>p]hpd*Zd.!A N:+ RM;@Ov_>K, O0\Sֈ}w9ٚ RyvIY ϖ/*X^0׬,!{8?.B0%s0]d2I`+iBIߧS-^Qk׌ 5#.ȴU#G& j,oV;$AZ͞ vQ %OhItd uJԢVPй87iٯtFR >n;A ś.S)O͏8F|_oR{Em修hyD+ݶշU2>H'`pSS*SU2,۪4G9o8u6-E~`d]fh.by pw.{؊#y-GЀ2Ynk< J^dFB2Mz3I)#둳D׬x ]PNA[=͔U 81(9ԦPf 2:Ec;Z[7W=D,sbXzEqqށh]{X+bմWj;N "?7YyIaJQt/B@e#0pcӟsϖ/NhP];qA ;1́Ӣη%2J| Ŵ;_\fpMkdH#剿+Bb9<>r,K11d] LStGuXPW]9c󨀳ʚ6q.y ±ݬM%lcc,=xQ1g/u|XC /2IYwI4i9`1b$TB L XojNcxcg׺ՁCvtS$E`XʸI0-q-Ӹͷ2=\r=t\ˆ,vFteC)0gլHQ4@g-d_ı'rWRU0kX3#~w۩m(:?31mLN[ن}xw:\'Bp"zUݳ2F1%}Θ<M3@ARqJ,wҟ\MUHBGqN9߼Zzeq)P{l>O = 3k1I #ZЏysΐ0/`2YgX6&{MbC-LB^aiGU:“*q^++hҋ/*mWy7UJj+)뀈NM>Pӭvns96i K>'godL /`4m@[JPن;aNXN^fo?ݪj2koZp n2XICUp._/2,HZ5 "CR[ `~U4uGZ v,a -pS ӽ%8dKAU BɹAu6i9: Ԭ.-܃(D ۣEXl{el09D`S޹'Cj_'g- (<ɿZ~)XG Or9ƛ]$T?%O{݈^Lu}׽-1~.̰C˰ot*Lm18}xzG+{֭wFl:cz8#\gݜdo{p)%3 M I|vk`NkלpZ W>^K DVT&? p?<}j)H?: BW5d H鹟˒?9pqb6Nw0aA짔ʝI#y<oo,Ie6Zѯ MҺjS*X-\HhߤS -@ rb]jWE=}01ُA ~@R,i#mJF֥> D5qh+31oZFxLu!^8#K5(ڕCrUyk,}wCҷ}REb TĪ5 {)p4X-4mHrq4oR#2@'j|bMbgGcVT藖AWMBYH;~C$*='%)h5mX &Lf8(rIU6UOӡ7\/3X[1Z/O pd[ۥ-BGH;Wtun2 uuģ:8|N7t2`Q є".čd.GO%WE9j+XC\3%\rv>M#ۮH"л I7Ew%"5( 8v#J4`X&czMv Z $ 8u,@@0ʟxf󨟴7ujS*%G/ql+4c!}RYì4@Vg q6Vٞ6[śi9%M ;}y/Ctʍ Pt/\Y4"^k~pOvq/$#'Pv6 f$jڜ]% )Ah|24=0O{,97AhQoŗ9PCidkxY,ӃWҊ^;+]ǞphnR.}>HP23/,Ȭt-G&3mh˓'~nD}W?@CoC<<RlDشHv3/GIO:%7RIo`zkN]ޕvFrX}e;t 5RlQF`h->J\U=.;82$:%\$t}ۼ:F/͸uDBq|9]ꔘ<ÊǴf{'ЧpW;6@NPk f9e]gűS?AI$kY>XFK~i^OWW'XaL$wL֥;>U˚ےܾs E*Za(`*G,oCL.$jtE- =nG XW1"Ǥ`Qhȥ8`NA0/kfďG uAUp*cG7Fa濺\CxI-=CAW)4A3j)&(M`#jNЀTJW"S)9E6Vˮ$(SYi^ҵ5׊Pe%HʆpX?4xbh?ЌGbd}S~üV".)(9զ08Vղ[/qY1aUB&l!^[ E0IZ_wcQ)u k uBR-0pj0+U!P#TM{}N88%\lӍg#rrHɶ+ 0w-5n"8M5P>ޝ."@¥Nf*%?eA[wKeMwÞ j./HUL7`$-I 2&Za*(A.@4ڔ5@ "a `Fq@?rӳ#ؤU㇓&-*@U qAd0M:5:VD|,`P5.XP'9_ vo]Dg,]OF{oJuWy#̾PUQl.)ֵOFk]?&Ap(vPJS"M9=6:y^ʎ׫~~~lqN1{W9>!XA dw5X''-].Zði!;W ,&&]R5ֆzmqxgIq -ݜ@f"?c*U]A>AUxde$fFg}]2\,=#P"ɯ[5ٗm.,}RhX>CfWA UR Γ<8IС_83 a RQ죙Y6Y7MU< :;gz,+(G/AΛ?q 6wDyU?=ݳ]u2x y1=;G8Jo(@b<21彑7b6Bde!&}ـX [Y=7:}|H-qnD ;N ᅣn[u|;g x#P)`/e1^a4֥kA;S=:?h*RHŤ%B^MzQXѩuwU*D0$:P%o^;ZIBC;ĕ.{1.C$^=bZCzfJ|^DIZ^^[WqBzY{;S8*/,+Յ;UnBOD/ZJE;mV6 @)nwᵦ! JAuzf.3!o(؆,;d7jxfgMe GdULb~cٺBڌ DSdS$DjFXB]y2({[)} 5I2r$hn)fՠ#y9U80E|eh.ZvD+SrM=\w^8Q͔:+4l~x)Ooj43Zת+s *Lhm/j#"86aL6P(DmG6Q-i ͜[zP&ݨr{5ޠns]ઊ81>!;!j*F12 )<XU][D0]q얜>Xe 6¶^RCo|؇ nR;p*<{6VFEYlpqaZx),U2xЋʾ{f)l^'`glǏWVBjbѾBVacl_b)7{j2UVSo|7ܱV$1&|sH+_rT:V'Q8kUJ~@QkHk iH<3'+ ֗mH`WsQ'~:Ooh8s$љ]Be);'5|k!9d9h?UYBpu$qMEN,g)=jWyEƕZf3e!=301WW&.kI*= ҝVm,ZTz(Yf%ClI+˽$KG1"Ro|̨6Dǫ:5D3ZBal>Q AJ7tg±hϮ{#qy'/VPk~f{>724$jpnĤ`Sk:栕E>ZGRe| njR۬tRbd:\v/aSe\ ,Q9009TbXn{קJr[[PfMZ|Np,+FTww\r9ӊ̠y_dvui ?Q}MSӂ tYW_+GNHW f ^voTHz[Yn`E^M沮nlFi&Om<>v1tUV1#3ąV&"g(*#gxЮryJ#u ;C(xGw= XlefUSC`mUfh85~XT D,,n=+ʊAD/ުf0\-fs O]{mҷٌ<&Ǔ77u~ncbԃ2/ĤsGIWg3vƚaQ@l+ЋQYgPiC@hM֧ _^Q,@;L 뻏}z;xZW']6^*l zZK/u=573{DlSeFb`0adpAQOlK6zT Q*ri V: _?!_ckqA-E JC?;RO7y#o%3++D黳I)UMrfm9Vnù -D-Xd yυxC~fI3iҿ钂$9'gp ut>ڮLz:t j+T9uU@⥯mu^rB)j~O1dPD%٫ʈYƒ3a\-K&(9N:W>&7;%Gb_2>b5&"2DoWs6nl9Pj9jO.ӳ>ՠf>6gI$F*)j !V<_;tZ~w˫Yq B΁dIhpjK>p]hpd*Zd.!A N:+ RM;@Ov_>K, O0\Sֈ}w9ٚ RyvIY ϖ/*X^0׬,!{8?.B0%s0]d2I`+iBIߧS-^Qk׌ 5#.ȴU#G& j,oV;$AZ͞ vQ %OhItd uJԢVPй87iٯtFR >n;A ś.S)O͏8F|_oR{Em修hyD+ݶշU2>H'`pSS*SU2,۪4G9o8u6-E~`d]fh.by pw.{؊#y-GЀ2Ynk< J^dFB2Mz3I)#둳D׬x ]PNA[=͔U 81(9ԦPf 2:Ec;Z[7W=D,sbXzEqqށh]{X+bմWj;N "?7YyIaJQt/B@e#0pcӟsϖ/NhP];qA ;1́Ӣη%2J| Ŵ;_\fpMkdH#剿+Bb9<>r,K11d] LStGuXPW]9c󨀳ʚ6q.y ±ݬM%lcc,=xQ1g/u|XC /2IYwI4i9`1b$TB L XojNcxcg׺ՁCvtS$E`XʸI0-q-Ӹͷ2=\r=t\ˆ,vFteC)0gլHQ4@g-d_ı'rWRU0kX3#~w۩m(:?31mLN[ن}xw:\'Bp"zUݳ2F1%}Θ<M3@ARqJ,wҟ\MUHBGqN9߼Zzeq)P{l>O = 3k1I #ZЏysΐ0/`2YgX6&{MbC-LB^aiGU:“*q^++hҋ/*mWy7UJj+)뀈NM>Pӭvns96i K>'godL /`4m@[JPن;aNXN^fo?ݪj2koZp n2XICUp._/2,HZ5 "CR[ `~U4uGZ v,a -pS ӽ%8dKAU BɹAu6i9: Ԭ.-܃(D ۣEXl{el09D`S޹'Cj_'g- (<ɿZ~)XG Or9ƛ]$T?%O{݈^Lu}׽-1~.̰C˰ot*Lm18}xzG+{֭wFl:cz8#\gݜdo{p)%3 M I|vk`NkלpZ W>^K DVT&? p?<}j)H?: BW5d H鹟˒?9pqb6Nw0aA짔ʝI#y<oo,Ie6Zѯ MҺjS*X-\HhߤS -@ rb]jWE=}01ُA ~@R,i#mJF֥> D5qh+31oZFxLu!^8#K5(ڕCrUyk,}wCҷ}REb TĪ5 {)p4X-4mHrq4oR#2@'j|bMbgGcVT藖AWMBYH;~C$*='%)h5mX &Lf8(rIU6UOӡ7\/3X[1Z/O pd[ۥ-BGH;Wtun2 uuģ:8|N7t2`Q є".čd.GO%WE9j+XC\3%\rv>M#ۮH"л I7Ew%"5( 8v#J4`X&czMv Z $ 8u,@@0ʟxf󨟴7ujS*%G/ql+4c!}RYì4@Vg q6Vٞ6[śi9%M ;}y/Ctʍ Pt/\Y4"^k~pOvq/$#'Pv6 f$jڜ]% )Ah|24=0O{,97AhQoŗ9PCidkxY,ӃWҊ^;+]ǞphnR.}>HP23/,Ȭt-G&3mh˓'~nD}W?@CoC<<RlDشHv3/GIO:%7RIo`zkN]ޕvFrX}e;t 5RlQF`h->J\U=.;82$:%\$t}ۼ:F/͸uDBq|9]ꔘ<ÊǴf{'ЧpW;6@NPk f9e]gűS?AI$kY>XFK~i^OWW'XaL$wL֥;>U˚ےܾs E*Za(`*G,oCL.$jtE- =nG XW1"Ǥ`Qhȥ8`NA0/kfďG uAUp*cG7Fa濺\CxI-=CAW)4A3j)&(M`#jNЀTJW"S)9E6Vˮ$(SYi^ҵ5׊Pe%HʆpX?4xbh?ЌGbd}S~üV".)(9զ08Vղ[/qY1aUB&l!^[ E0IZ_wcQ)u k uBR-0pj0+U!P#TM{}N88%\lӍg#rrHɶ+ 0w-5n"8M5P>ޝ."@¥Nf*%?eA[wKeMwÞ j./HUL7`$-I 2&Za*(A.@4ڔ5@ "a `Fq@?rӳ#ؤU㇓&-*@U qAd0M:5:VD|,`P5.XP'9_ vo]Dg,]OF{oJuWy#̾PUQl.)ֵOFk]?&Ap(vPJS"M9=6:y^ʎ׫~~~lqN1{W9>!XA dw5X''-].Zði!;W ,&&]R5ֆzmqxgIq -ݜ@f"?c*U]A>AUxd?B&͵ޫdeMV$T)d;BB;+H|>{=|^}[,D껎y,בo{:-><9ֻY:~#udh"ĞXҋ' N ;5YVUb9+rP~$72xw*% 9$9{GmSt4ӏ k6{8{D/me_=D"c"qնؘbi];oјõPJ>\jm+ܾ]5%Y~/&{m4ۏY;*~# }ݐPβ[nl ó7m+q.ks"V3 Βy<Ns#f:G#FUOw*j2uP薍S"b|q9mrKnМ?/xOBW]+H;R5-qelMaЂ`^0$]JwDUn- >VC9jтgr ǽG[7 :^d2qII keV絵a[ح:bwiq u)eUzڎn7f6~`:Fo;sMQTwζ7+#Bˆ65N(Y3Q=*eQѤQ?5K[P-MԔ?ry`PVځnFRt)%-e.Ga]$""-ϱ){{$]{x,\&b2DKWyqdɉrLU)I`s>Ci$Ʒ3Nr_ltRAcw{+K{H/YU ^IcT&Q6n!T?q'}Zʏ OK>uy_~%iZpJ z\Cv|Uz)#A$C|1K4 _ Ts L~&ku#fIrfu_9}B]HTXzw[RS}Q7n94psq꘯>智-vR/2p6^7᠁{8'ß&]_VgYJfпe:E S̙ݬ- Ɍ [$9s[VyOCRj~8#93ďgn$?`fuCTQ[XP}չ&QAudw[>[FçC2K.0$ }w9w%0GgetC9}2FFVV9Ż lfޕ X!РDU[@@{M}7&I*Vݐ>*芁 | .vT-0x:Ie-m9)aO n^7FjoEv*'n"YǕerAaKf^w=@>Pڞ2~dy*۬]!h;o,`8˅+EV&=*=ze?ڨإgyܯLsU`L)vXz{4QJ#g&g~_sej\Bnj"\vim%6ړ|(a ݂֓-OЬN=ՂU]f;-OPQC6E !Wۛ?J3,La̔!JbjШaܖO?mӉYdl R]0L҆wp[#%MqN_D=J͗,[KH6kެV!z;>v.Tˍdnn2GvpSuyQ~Mܱ^n]뷓{/kW&=?[8yۥd|v)L>(1̄bnݼd9Wxu, 3f&Jϝ3`?ez]DP&SdA҉qx_I dl-柳u|a7yqw77:d :5Ϙ}3g/s`i:足+q5U&MLS苗19wM. z_6%;Ux5I pv<;˨k`+b8[IlX& ohun҄6 (zw/gӹbWqHeմy;Jb_a<3\rWEeFPa ח KO x`eԠa(wv8qrD$#~hgiae֥Wc#:H [=CjYqf#UJ>6d%n߰GPWMJ3FzC;E~3rÄゎD4#~E> s,.žx,(Q摙Q/?ئJ}Ucs:ɒo|\׷z+8F؉>$2S~+QW~NH H0'op?6av;cc t $HCvdvfU֞"g"?DuO5axU߳Xq5 + A ︊V,%~~>m iH;(oT.n<2`lӧVv9<\ʌw:CQtZ|&wVm+KF=fIիwxHU.'Ft_'B9z!O,jd*oMTYJ<}lzC-˫|es@I7SQۑGtq&_v\T&_K3zb0M3+Yhw!&[O__kNz2^JO9yeچ }m/ws!Z"ք:Ye&$r7jEn~:ۼU,ICvm̷^1A4_yeMv$!V 1a)"w?uې*{/^Ii3%#tB޾08qVzf2+fvhi_ [6|>,+̨u"@>fmord_ z? N ?_x([3{bW/v#?yɮ֓241!\! J&qxKo).-`֭$){IzMU^GQSH"c5k}@;>!$ZN"*aLy״Z[n9Տ#v]^y#Ha~#ZqQu7]˴Y[Lv[ #.ߙr#6 CmM/w\=}]ZP bWdߘ )]WMnqY'g}gMӕH@^+Yb8Ҕi_Л* R)"nMej^۳ WޙO%ݷ qOx[rL)}l*܉BMGb>wAܫa;}1dRf<ﱂ:mYTʞWzMf|~ߐܓs[[XEDEI6-}1N>`q>+8NӻtYoTEMay_]ْ葶hwݩdpN56vb&ۍ zYaImdڰ\3f|$M!Az&ysgC jtyJ)y\124[lVs's]8$K*a7Mo5h͟Q/eC)kI4XI,0Տ簻D5jưAChXNLKZDŐ~)sYS jċn6IT "&ԽrYť&EeGڞC.qJ!٣Ώq湻+A£,u5= %}I[7tӭ&O<r/xQTGB!QS;̣g\$umD~qou=k.$}rتހzG>%䫻I竩>q:5Rd&T'uwjh1Nw]+֌mN5h"?auJu9W{Cjzik/+r,}p)Zg&e.0KT E[^w/)kcl*-ٺĹ0Q{&+Ha͟^i/'w;"_@̙)ﶶlj6^<׾S(#KW^W`;dMɞu3zM[mѤ?IDKW@r?̉Wjד7 0)4İ {&#C>'G~}tWJw'tG4͠RrcȁKI[G[ K&%2)D*i,ЮDԔq_vJܮ_L7Msܜ9A4)Fspx^aqkcg*yv*ӻR,A[MC߉=m[_[ʕ,C30,ߊ"U/󱒐پ> ]?F GS}V5%kk?X|1-C=4B|-2c?}c|hfpodX,+2vK8 9'^:H_f{S[DŽ{.~k 6&qlOJ&? sֱ{ QD߸^mvYq0`jXy9ߛrN<mG~+RF_iYip+2Sg4w"EjUt~cqZN-IUyc5{.{$18~xʝ9|UgҜk ͧՏt{Qؾ FBi;$)}@JOO M4 uiv) _# |X OM;8}NAe]%ƅy}>zd9`k_!Mխ^wŸn7= QQ,DY =7k.^]'fx_?8g:_<9F[j;7-&ԇ>fm-껯z+p\潬qd@3Ou F:KQ-lr䱟U?2ԥyV*^Bx1cRh#}ڠW GO/ țSr;IɾnL04L<&8y!*:^YP˾~`'v fCئpZLV6v$xkVvdFÙ54 IiʍQnU'љ&Oʜ2&>?ݑU?e%I\"CZ?GU:_xODsmw9tCL.gD{LCUJ-Pޫw>ː_ ,owi7.n-_% x O96oF[ >ABYvʽ#6 ^9 !v1VC~R^VMβmy-Ažw&^k}%B/Nͽ Mqݔe`[E zƿ]8P+baw|9K|y;7cӑ=aLosh~td"a>>2g UjF'wT&UTa$;zNOH獤YZ\+QPD]k|ۗw~gR;0ͺ|Ke"A֪k~#vFKKZ%G,.6d_?sRnxH|\7Y&2 kz]>* ,%Fݳu:QҰ ! 1dlm0$QS%\#Dn.;KC' ?xF$S/3ę-2eAV7xդ=2w+Sp/+O_ңEq)OM.RF~\oX lv\Ɇ?y8ܑ[F3O)??Kx,LK&n4'?dG^s9+v\{ű~CW uҦ(^.3њx鼋䣘%GFWqeֳڑ~|i,Xx\;S[8DqH˫J|d:uV1'n[S"F~M5ϲ=M4/kSj~>Oc&%g/8"߸[Wq-Ú+km&v䞭m!+E)?Y%>/91/{Cc5]RlIŌ QxO>s'&KVa7+֟}^!Xɱ2M m#26;* ~3%1Q(ǵ 96_F? R5mKqj)*d/=dsMҶZUy{LJm{^[ogwG^;^yxǨ~ǘ~Ǹ~DŽ~@8PC@<PC@?$!~H!~H @?CP@?C@?4 ~ha~a:~a~Xa~Xa~X~8᠗~x~x臇~xG~G~z}ߟh) Z zޡh)-Z zޣi)$L$P# G@ E2 B  *  @5@%! 06PI.H.../H///0, T2 B R b r     8<@DHLPTXB%! OoЏܐqqqqqqqqqsT2222222~x@%o/ ~Dqqqqqqqqqh{ T222222222~ZJBABABABABABABABABAbPI8H8H8H8H8H8H8H8H8H*         N@%! ! ! ! ! ! ! ! ! 1 t2 2 2 2 2 2 2 2 2 JBAAAAAAAAAAAAAAAAA!QPI8(8(8(8(8(8(x A>AUxd?B&͵ޫdeMV$T)d;BB;+H|>{=|^}[,D껎y,בo{:-><9ֻY:~#udh"ĞXҋ' N ;5YVUb9+rP~$72xw*% 9$9{GmSt4ӏ k6{8{D/me_=D"c"qնؘbi];oјõPJ>\jm+ܾ]5%Y~/&{m4ۏY;*~# }ݐPβ[nl ó7m+q.ks"V3 Βy<Ns#f:G#FUOw*j2uP薍S"b|q9mrKnМ?/xOBW]+H;R5-qelMaЂ`^0$]JwDUn- >VC9jтgr ǽG[7 :^d2qII keV絵a[ح:bwiq u)eUzڎn7f6~`:Fo;sMQTwζ7+#Bˆ65N(Y3Q=*eQѤQ?5K[P-MԔ?ry`PVځnFRt)%-e.Ga]$""-ϱ){{$]{x,\&b2DKWyqdɉrLU)I`s>Ci$Ʒ3Nr_ltRAcw{+K{H/YU ^IcT&Q6n!T?q'}Zʏ OK>uy_~%iZpJ z\Cv|Uz)#A$C|1K4 _ Ts L~&ku#fIrfu_9}B]HTXzw[RS}Q7n94psq꘯>智-vR/2p6^7᠁{8'ß&]_VgYJfпe:E S̙ݬ- Ɍ [$9s[VyOCRj~8#93ďgn$?`fuCTQ[XP}չ&QAudw[>[FçC2K.0$ }w9w%0GgetC9}2FFVV9Ż lfޕ X!РDU[@@{M}7&I*Vݐ>*芁 | .vT-0x:Ie-m9)aO n^7FjoEv*'n"YǕerAaKf^w=@>Pڞ2~dy*۬]!h;o,`8˅+EV&=*=ze?ڨإgyܯLsU`L)vXz{4QJ#g&g~_sej\Bnj"\vim%6ړ|(a ݂֓-OЬN=ՂU]f;-OPQC6E !Wۛ?J3,La̔!JbjШaܖO?mӉYdl R]0L҆wp[#%MqN_D=J͗,[KH6kެV!z;>v.Tˍdnn2GvpSuyQ~Mܱ^n]뷓{/kW&=?[8yۥd|v)L>(1̄bnݼd9Wxu, 3f&Jϝ3`?ez]DP&SdA҉qx_I dl-柳u|a7yqw77:d :5Ϙ}3g/s`i:足+q5U&MLS苗19wM. z_6%;Ux5I pv<;˨k`+b8[IlX& ohun҄6 (zw/gӹbWqHeմy;Jb_a<3\rWEeFPa ח KO x`eԠa(wv8qrD$#~hgiae֥Wc#:H [=CjYqf#UJ>6d%n߰GPWMJ3FzC;E~3rÄゎD4#~E> s,.žx,(Q摙Q/?ئJ}Ucs:ɒo|\׷z+8F؉>$2S~+QW~NH H0'op?6av;cc t $HCvdvfU֞"g"?DuO5axU߳Xq5 + A ︊V,%~~>m iH;(oT.n<2`lӧVv9<\ʌw:CQtZ|&wVm+KF=fIիwxHU.'Ft_'B9z!O,jd*oMTYJ<}lzC-˫|es@I7SQۑGtq&_v\T&_K3zb0M3+Yhw!&[O__kNz2^JO9yeچ }m/ws!Z"ք:Ye&$r7jEn~:ۼU,ICvm̷^1A4_yeMv$!V 1a)"w?uې*{/^Ii3%#tB޾08qVzf2+fvhi_ [6|>,+̨u"@>fmord_ z? N ?_x([3{bW/v#?yɮ֓241!\! J&qxKo).-`֭$){IzMU^GQSH"c5k}@;>!$ZN"*aLy״Z[n9Տ#v]^y#Ha~#ZqQu7]˴Y[Lv[ #.ߙr#6 CmM/w\=}]ZP bWdߘ )]WMnqY'g}gMӕH@^+Yb8Ҕi_Л* R)"nMej^۳ WޙO%ݷ qOx[rL)}l*܉BMGb>wAܫa;}1dRf<ﱂ:mYTʞWzMf|~ߐܓs[[XEDEI6-}1N>`q>+8NӻtYoTEMay_]ْ葶hwݩdpN56vb&ۍ zYaImdڰ\3f|$M!Az&ysgC jtyJ)y\124[lVs's]8$K*a7Mo5h͟Q/eC)kI4XI,0Տ簻D5jưAChXNLKZDŐ~)sYS jċn6IT "&ԽrYť&EeGڞC.qJ!٣Ώq湻+A£,u5= %}I[7tӭ&O<r/xQTGB!QS;̣g\$umD~qou=k.$}rتހzG>%䫻I竩>q:5Rd&T'uwjh1Nw]+֌mN5h"?auJu9W{Cjzik/+r,}p)Zg&e.0KT E[^w/)kcl*-ٺĹ0Q{&+Ha͟^i/'w;"_@̙)ﶶlj6^<׾S(#KW^W`;dMɞu3zM[mѤ?IDKW@r?̉Wjד7 0)4İ {&#C>'G~}tWJw'tG4͠RrcȁKI[G[ K&%2)D*i,ЮDԔq_vJܮ_L7Msܜ9A4)Fspx^aqkcg*yv*ӻR,A[MC߉=m[_[ʕ,C30,ߊ"U/󱒐پ> ]?F GS}V5%kk?X|1-C=4B|-2c?}c|hfpodX,+2vK8 9'^:H_f{S[DŽ{.~k 6&qlOJ&? sֱ{ QD߸^mvYq0`jXy9ߛrN<mG~+RF_iYip+2Sg4w"EjUt~cqZN-IUyc5{.{$18~xʝ9|UgҜk ͧՏt{Qؾ FBi;$)}@JOO M4 uiv) _# |X OM;8}NAe]%ƅy}>zd9`k_!Mխ^wŸn7= QQ,DY =7k.^]'fx_?8g:_<9F[j;7-&ԇ>fm-껯z+p\潬qd@3Ou F:KQ-lr䱟U?2ԥyV*^Bx1cRh#}ڠW GO/ țSr;IɾnL04L<&8y!*:^YP˾~`'v fCئpZLV6v$xkVvdFÙ54 IiʍQnU'љ&Oʜ2&>?ݑU?e%I\"CZ?GU:_xODsmw9tCL.gD{LCUJ-Pޫw>ː_ ,owi7.n-_% x O96oF[ >ABYvʽ#6 ^9 !v1VC~R^VMβmy-Ažw&^k}%B/Nͽ Mqݔe`[E zƿ]8P+baw|9K|y;7cӑ=aLosh~td"a>>2g UjF'wT&UTa$;zNOH獤YZ\+QPD]k|ۗw~gR;0ͺ|Ke"A֪k~#vFKKZ%G,.6d_?sRnxH|\7Y&2 kz]>* ,%Fݳu:QҰ ! 1dlm0$QS%\#Dn.;KC' ?xF$S/3ę-2eAV7xդ=2w+Sp/+O_ңEq)OM.RF~\oX lv\Ɇ?y8ܑ[F3O)??Kx,LK&n4'?dG^s9+v\{ű~CW uҦ(^.3њx鼋䣘%GFWqeֳڑ~|i,Xx\;S[8DqH˫J|d:uV1'n[S"F~M5ϲ=M4/kSj~>Oc&%g/8"߸[Wq-Ú+km&v䞭m!+E)?Y%>/91/{Cc5]RlIŌ QxO>s'&KVa7+֟}^!Xɱ2M m#26;* ~3%1Q(ǵ 96_F? R5mKqj)*d/=dsMҶZUy{LJm{^[ogwG^;^yxǨ~ǘ~Ǹ~DŽ~@8PC@<PC@?$!~H!~H @?CP@?C@?4 ~ha~a:~a~Xa~Xa~X~8᠗~x~x臇~xG~G~z}ߟh) Z zޡh)-Z zޣi)$L$P# G@ E2 B  *  @5@%! 06PI.H.../H///0, T2 B R b r     8<@DHLPTXB%! OoЏܐqqqqqqqqqsT2222222~x@%o/ ~Dqqqqqqqqqh{ T222222222~ZJBABABABABABABABABAbPI8H8H8H8H8H8H8H8H8H*         N@%! ! ! ! ! ! ! ! ! 1 t2 2 2 2 2 2 2 2 2 JBAAAAAAAAAAAAAAAAA!QPI8(8(8(8(8(8(x A>AUxd?B&͵ޫdeMV$T)d;BB;+H|>{=|^}[,D껎y,בo{:-><9ֻY:~#udh"ĞXҋ' N ;5YVUb9+rP~$72xw*% 9$9{GmSt4ӏ k6{8{D/me_=D"c"qնؘbi];oјõPJ>\jm+ܾ]5%Y~/&{m4ۏY;*~# }ݐPβ[nl ó7m+q.ks"V3 Βy<Ns#f:G#FUOw*j2uP薍S"b|q9mrKnМ?/xOBW]+H;R5-qelMaЂ`^0$]JwDUn- >VC9jтgr ǽG[7 :^d2qII keV絵a[ح:bwiq u)eUzڎn7f6~`:Fo;sMQTwζ7+#Bˆ65N(Y3Q=*eQѤQ?5K[P-MԔ?ry`PVځnFRt)%-e.Ga]$""-ϱ){{$]{x,\&b2DKWyqdɉrLU)I`s>Ci$Ʒ3Nr_ltRAcw{+K{H/YU ^IcT&Q6n!T?q'}Zʏ OK>uy_~%iZpJ z\Cv|Uz)#A$C|1K4 _ Ts L~&ku#fIrfu_9}B]HTXzw[RS}Q7n94psq꘯>智-vR/2p6^7᠁{8'ß&]_VgYJfпe:E S̙ݬ- Ɍ [$9s[VyOCRj~8#93ďgn$?`fuCTQ[XP}չ&QAudw[>[FçC2K.0$ }w9w%0GgetC9}2FFVV9Ż lfޕ X!РDU[@@{M}7&I*Vݐ>*芁 | .vT-0x:Ie-m9)aO n^7FjoEv*'n"YǕerAaKf^w=@>Pڞ2~dy*۬]!h;o,`8˅+EV&=*=ze?ڨإgyܯLsU`L)vXz{4QJ#g&g~_sej\Bnj"\vim%6ړ|(a ݂֓-OЬN=ՂU]f;-OPQC6E !Wۛ?J3,La̔!JbjШaܖO?mӉYdl R]0L҆wp[#%MqN_D=J͗,[KH6kެV!z;>v.Tˍdnn2GvpSuyQ~Mܱ^n]뷓{/kW&=?[8yۥd|v)L>(1̄bnݼd9Wxu, 3f&Jϝ3`?ez]DP&SdA҉qx_I dl-柳u|a7yqw77:d :5Ϙ}3g/s`i:足+q5U&MLS苗19wM. z_6%;Ux5I pv<;˨k`+b8[IlX& ohun҄6 (zw/gӹbWqHeմy;Jb_a<3\rWEeFPa ח KO x`eԠa(wv8qrD$#~hgiae֥Wc#:H [=CjYqf#UJ>6d%n߰GPWMJ3FzC;E~3rÄゎD4#~E> s,.žx,(Q摙Q/?ئJ}Ucs:ɒo|\׷z+8F؉>$2S~+QW~NH H0'op?6av;cc t $HCvdvfU֞"g"?DuO5axU߳Xq5 + A ︊V,%~~>m iH;(oT.n<2`lӧVv9<\ʌw:CQtZ|&wVm+KF=fIիwxHU.'Ft_'B9z!O,jd*oMTYJ<}lzC-˫|es@I7SQۑGtq&_v\T&_K3zb0M3+Yhw!&[O__kNz2^JO9yeچ }m/ws!Z"ք:Ye&$r7jEn~:ۼU,ICvm̷^1A4_yeMv$!V 1a)"w?uې*{/^Ii3%#tB޾08qVzf2+fvhi_ [6|>,+̨u"@>fmord_ z? N ?_x([3{bW/v#?yɮ֓241!\! J&qxKo).-`֭$){IzMU^GQSH"c5k}@;>!$ZN"*aLy״Z[n9Տ#v]^y#Ha~#ZqQu7]˴Y[Lv[ #.ߙr#6 CmM/w\=}]ZP bWdߘ )]WMnqY'g}gMӕH@^+Yb8Ҕi_Л* R)"nMej^۳ WޙO%ݷ qOx[rL)}l*܉BMGb>wAܫa;}1dRf<ﱂ:mYTʞWzMf|~ߐܓs[[XEDEI6-}1N>`q>+8NӻtYoTEMay_]ْ葶hwݩdpN56vb&ۍ zYaImdڰ\3f|$M!Az&ysgC jtyJ)y\124[lVs's]8$K*a7Mo5h͟Q/eC)kI4XI,0Տ簻D5jưAChXNLKZDŐ~)sYS jċn6IT "&ԽrYť&EeGڞC.qJ!٣Ώq湻+A£,u5= %}I[7tӭ&O<r/xQTGB!QS;̣g\$umD~qou=k.$}rتހzG>%䫻I竩>q:5Rd&T'uwjh1Nw]+֌mN5h"?auJu9W{Cjzik/+r,}p)Zg&e.0KT E[^w/)kcl*-ٺĹ0Q{&+Ha͟^i/'w;"_@̙)ﶶlj6^<׾S(#KW^W`;dMɞu3zM[mѤ?IDKW@r?̉Wjד7 0)4İ {&#C>'G~}tWJw'tG4͠RrcȁKI[G[ K&%2)D*i,ЮDԔq_vJܮ_L7Msܜ9A4)Fspx^aqkcg*yv*ӻR,A[MC߉=m[_[ʕ,C30,ߊ"U/󱒐پ> ]?F GS}V5%kk?X|1-C=4B|-2c?}c|hfpodX,+2vK8 9'^:H_f{S[DŽ{.~k 6&qlOJ&? sֱ{ QD߸^mvYq0`jXy9ߛrN<mG~+RF_iYip+2Sg4w"EjUt~cqZN-IUyc5{.{$18~xʝ9|UgҜk ͧՏt{Qؾ FBi;$)}@JOO M4 uiv) _# |X OM;8}NAe]%ƅy}>zd9`k_!Mխ^wŸn7= QQ,DY =7k.^]'fx_?8g:_<9F[j;7-&ԇ>fm-껯z+p\潬qd@3Ou F:KQ-lr䱟U?2ԥyV*^Bx1cRh#}ڠW GO/ țSr;IɾnL04L<&8y!*:^YP˾~`'v fCئpZLV6v$xkVvdFÙ54 IiʍQnU'љ&Oʜ2&>?ݑU?e%I\"CZ?GU:_xODsmw9tCL.gD{LCUJ-Pޫw>ː_ ,owi7.n-_% x O96oF[ >ABYvʽ#6 ^9 !v1VC~R^VMβmy-Ažw&^k}%B/Nͽ Mqݔe`[E zƿ]8P+baw|9K|y;7cӑ=aLosh~td"a>>2g UjF'wT&UTa$;zNOH獤YZ\+QPD]k|ۗw~gR;0ͺ|Ke"A֪k~#vFKKZ%G,.6d_?sRnxH|\7Y&2 kz]>* ,%Fݳu:QҰ ! 1dlm0$QS%\#Dn.;KC' ?xF$S/3ę-2eAV7xդ=2w+Sp/+O_ңEq)OM.RF~\oX lv\Ɇ?y8ܑ[F3O)??Kx,LK&n4'?dG^s9+v\{ű~CW uҦ(^.3њx鼋䣘%GFWqeֳڑ~|i,Xx\;S[8DqH˫J|d:uV1'n[S"F~M5ϲ=M4/kSj~>Oc&%g/8"߸[Wq-Ú+km&v䞭m!+E)?Y%>/91/{Cc5]RlIŌ QxO>s'&KVa7+֟}^!Xɱ2M m#26;* ~3%1Q(ǵ 96_F? R5mKqj)*d/=dsMҶZUy{LJm{^[ogwG^;^yxǨ~ǘ~Ǹ~DŽ~@8PC@<PC@?$!~H!~H @?CP@?C@?4 ~ha~a:~a~Xa~Xa~X~8᠗~x~x臇~xG~G~z}ߟh) Z zޡh)-Z zޣi)$L$P# G@ E2 B  *  @5@%! 06PI.H.../H///0, T2 B R b r     8<@DHLPTXB%! OoЏܐqqqqqqqqqsT2222222~x@%o/ ~Dqqqqqqqqqh{ T222222222~ZJBABABABABABABABABAbPI8H8H8H8H8H8H8H8H8H*         N@%! ! ! ! ! ! ! ! ! 1 t2 2 2 2 2 2 2 2 2 JBAAAAAAAAAAAAAAAAA!QPI8(8(8(8(8(8(x AIUxd=c<IH3/9~^M}j}{] {F0Ɩ<՜"|Bj.jPr~+/'t;"`X ZjpVYT4x"ݿ*3 #=hZޞԈݸe]KlTi#B%ySgXiu|a|yށJ4 +B`P,PJz(5榃  +8`. vJ@:ۃmEr";qއLqRQoioCp\{m!! ۼ^x=yr-陠zC$4)R9hB'\+WȊy'*Rt2 ~eiǦ|=nS8]e1)֍:p ń.MG.m>آ잛EF ށfĝ Q//pa+QOTh?YoPeY% DM*ڣe i.>/x4Bۮep/BOžN I\iL$8.Jgzl>^?Y6ȼNVH! W6$ xd)+PDGl]B&쪂?-0C! |7[m{SM){{:|};Wf6qMoZUੑ07)nAS̴4%jJmt$٭D^ogj(2DKW^/=Ke^+1)y׳:v"j8cxY/n#e[25#G4,:y8*]~y$ hYY,'' ;:D ~%z:g׼; K7Kl Bas q0fPעu cm9%u.!J.տ:Ff}()xS[.(Q'8bA4^æ޽%,g 9+\ Qo@z|3BUz-E .fF,"Oz{pBY{uyz,C4Bн^&tX* 5 t*p*ԖJIc"Tg9HGM_ 6%o1a|5T,wGfp3=M3-mKnB{ X8߮iɮpaVהj OJ~/V7T=p]">=IFȟ_P}\v2w8tC?OO8q|`:: 7'l퐧<Dfg|cT5Q#O4t8VGtBLn1 d~ݺ5O۶̿ViIʿdzѼY 1 |{2CoDn읐%8lv ?H3aKkA x*.u=Z ^4'쳸͛գ[ێDrE.!QiYs,`axɻ-nbL r[;T O KHd?'gNLŜnz]:H[|}&wQ?pڑYyF@s&x~͢q&@>:ѡ A+R YbWh7TZk'q.6{hpY ­v+t\ܾV2H"q|IÖrGfza_H~7T=fZfjM&eo좻.>Ŀ"&yuŝfwz )AnCOX R XYM1MsIy@?N^Ecy;XIڴ1^$e*:9Ukэ*GT5w"'t(EO RO^JR(^f4mOYyBcV[Jutw|xC: D 5[Z{(xMQfۿR5y 8]_\49W-W_܌UHe`j% rϽpaln Ep߯,8zszvGF5V7ZX6m6+ZGX9"7 j8sO":v?\f{J:# <5#4p bp_?`> Ǹdx? pM WPEݘPˣ&8ƅW#0@$.30Wzo+7?f/m+&a+5)zlIUdrƿ.N{݁j4a)PvɅq` fcRDZ^Fipp.W8\ Wy_l5xd43o.0F8d\$X[Fn4Jx{'p|dsQL+5Pi&ʊ--S#v BMCSFK'()D"wM:&6ޭ =p֚; 9bvԒɮA foiG>g/ VkB=]}d_RJ`Fq=4VMY9i2@*IM\H]]k帹O!˳淄x}.K`oUW. /JQ6_pj*UўXH8Vm-뿺;qmZvC{;AчO-Ĝj(S%9f TIC&љ55ycEzakLo#y;~b:o̍'ce+x+%;5%| Ǭ]lH4OIArE灑3F)rzߝ!w\ 6@jbu|Qz1nuzZQhuF<!M_[Θ' YﷀHuvl =#>$[%x~LSo6߫[? ks?6@^}@-)F6u;m'U+?۠VS3y7Z 7g/R.|:Bu 3!=`18̾=" LZT{Vd6n ;MsZ?ZQi~շBI $6+3uN[ŗDR=TٞU À[@NeO{/I5?&&p-!X 4[h5N=\6Mw&Fq(؎T$Hsqe*'KR!xEk__ɊIj 8?G##qm2oDcǯZdܓPaSd)SȲ<96!;Cvx)#tqUrs亼s> Q02qIH1Iن7z' Oh>(!eQ'2_uuJ~.3~@Jp*eBt &"wbǶլ}eP䖿N0 XߞsMtkJ;,BA!Ъ1R4g[@d5%2Qk[ ى&B|e썞#Y.#1YnX.ݝchh;JRN G,or(m}٦o[~LP$ES1Pf'gq&m`M<5kfR*cƟ Myo؎puKzEm`I.X{woSD4:F,g;Jnks+<$r,?.Mv{5WmXf?ҦIit\/8<7rX`:1\+JP 2ZӞHDVD1B@i<(,\-V@Tc<K YǢk&P(ꢌ,™j˧' }`p)'Ֆlg};(rȨ2{kwPƋpf,/ /I ˤ)ݏ2$|/Ǡ4Տx2Z>Q<>aOm< NfeڣD1 h P7܍gG<7TR(7 N9g=+\:!T۾*mR(\4!Yd׈6/?'ߐ[_,)Nʂ@iu2{j~1q=E7q{3 Jik͘Z1*AoJļ~EY.!OH8ƞ8zG,j-kїD Mis;pr"I"A$lhN΄p`Pf}8Z$2c] V1FcBBJ$!{J .5͖ ïP Qz~R')i~06J.NfzmNaFSRjO~Z[Q h!@L\*HS^ g0)bv=ђz\j5pōCRt²QJ3w;̧;!ab;3=oz3W2~L6j?0cѝU=;@L$ ;Tl)%.~nGmK!su8ֵd^I}|W$&⍔?6<7c{@\p-b&_]&Z,((i붯 uep%n(ZІ6m+L|]} "&̯>lHP`3i]{[Ho;V$ P웘67 | pߖITW{HwfvnU ?Cd2&ƵR 8FKfd!$$bDK֠fl |gl4 S f1rnn}j2,:Үޭ|;qƓe@i؄ 7֚[d,H Do#ü̋?tl&%, HzH%*䂰mDŽ^nI#"na+\:zi?(ϴq MI &tC:+.0A=.70tSUBi::YJ'dJ&#ujWk#B쉍,\4N|Æ>nr ;eWh,1o'}G,3x<5>ʨ~}Ѻ"<]f#),^yK}@O{QM/r/_"W2)R #-4o$Gl"%b5coT2|Ww*Jk;74AT/j1ùRC25VcsK-8@̈?2$sSE图^DG(Pq@9gfx9 BzD[*~>+MTEg"< ߬h $u/ qoEp* _JO;\J+6k Jzl5(bC|R 2LX،1sV$oI^WbaxE<`ei-=f\b<QKƁ/tDTh HKѯNϳ :ҴϬm69> ^Y6QZ#&T{ߵ9V!z`]3sF ~9Z?1Dd1b.7eJ=R\ g}4k+EOwz R^"{&e愨!xMR & /iNtښR:P]%w$ Y+|\)bv59n#gwÂ&kHb䓎žٰ*<0d ?*C#7)O즙X%NhQɨm|ZsǒLԶ&#a#! [܎ ":]ldnQ4Ҁǎ"Ɛeϣ{dC4yp&eKP¡Ĉ{$eZNFC5<oKf̎J佀j\j'& jlB0 e(غ (LݴΧlO5gz'@] 8Pέ0 Dk.˭KlnuF_ylNXJL(:[WAQ_4\Mc;n$DWePh7K}ov;8L0.sptϵ}(,ͫ/MMqBɄx(8~ ɂ Ny/3 ^ Y?5Kni}`(~"$09!2o O( Ķ_R"t@\.s~IƐժ Ž)?S2!v- ؏ϸ-js]\S;)'fAJd\S"||@/Dg:wp4sYOb^d5UO㿚,gYhIرH.C7XqA/`z^kK]i9u*1=b{¢NχE3POUS ]Ev@lKhC1f^f̈́uEBEe!IH46X<&uaO8HG81YӲ~u@lm˗ Tґ+1rI qDN:{LG׸k ꩣڲ·aOK#C8f.Uw+ԭu2u“UæאPzy^+^b{B:'';7Bwx $zg_^TzEPzefdv ]3+:RVp eli ʩ P0k#7wWNկ]u'JpJ\^îsu?&۝ ļ_4i`b--N5|ۄ|F1G5s?R JZ$CGa# !\K^0 ?K8U-}S"Q":?^g0"~jЈ Qٛ`k% q;UlO,B1;U ;\*Sf,]2Sed6ëb> M՟')}Ovh}w$Uil;lܢ|p\ҠҒGF|_GZĿ>v7/f39C c%v@`j,)sl\z3.vCy Cl5ިlȓHaUndtEa!IVP;gh41c&ZFEL6>yǃ嫽%Nmpb; BM-TGy&6͊iI_X!OG \ &$\U)Ȣu}P6ad(BC1n!ghg:,2O~07teU.֝?IY U{NMwQępR4 2ZOcA3c IJ&<ɼjȉ=9hVLQ 6N7'k@Ss[p#PY'o g:ϴa 83gٹ<eҾ۵uzfv[X]#~뤒#%sN*h854v?f11Dw;~5Y!:6QDlQS4Mkr[Xmm:N0ZjoDUWvra&?tV M-7oI|+?*g`0zmDb/tGot.ь^f,)0Gj1!ЍWzr3bǐ:T)8 e1l@Dr;Ȉ@ ]M=tv4nH *X̮^0,+RH)6?I{WZ̏A '%nc|Ά| oؔ:Cb,ǢgDxon)6ᄘ((1MaW_K#NMx$Tu#(VH)$x}kCP/R?ZR#V@mÀsڪ-7 D*?r*TАfjEUaC E Ƈk;D8c 9|JIh oH54HG4ɭRKy.2Qڲ=>kZnL$փ!E7ďvkT#@wd*q&z*|'e<ӑt ~p{]CFY(rKl-r͡> Ö~?6D6dHe23.p- ǣ*M&'\{)9#8/4C%bV0u=nԟ7qΕA+xu_[):8g?Bk h }u޼S5/+Bex2Xc?4ӹkjb5rZBiy*\17d6ux@E<<>mӅ?}rPybX$/v&jXqK ak=?ck?qݨu N3~;$DrV ͪf(:GuW4r{ h]n](1PKə4}PK (+2Li(( storedokUT>AUxPK )+2Mi(( ;(storedcrcerrorUT>AUxPKL+2ə|4} |PdeflateokUT>AUxPKK+2ʙ|4} 4deflatecrcerrorUT>AUxPKR+2ə|4} deflatezliberrorUT>AUxPK L+2ə4} cryptokUT>AUxPK#tcl9.0.3/tests/word.test0000644000175000017500000001326115104661341014570 0ustar sergeisergei# This file is a Tcl script to test the [tcl_startOf|endOf]* functions in # word.tcl. It is organized in the standard fashion for Tcl tests. # # Copyright © 2024 Jan Nijtmans # All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] test word-1.0 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" -1 } -result 2 test word-1.1 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 0 } -result 2 test word-1.2 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 1 } -result 2 test word-1.3 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 2 } -result -1 test word-1.4 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 3 } -result -1 test word-1.5 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 4 } -result -1 test word-1.6 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" 5 } -result -1 test word-1.7 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" end } -result -1 test word-1.8 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" end-1 } -result -1 test word-1.9 {tcl_endOfWord} -body { tcl_endOfWord "ab cd" {} } -result 2 test word-2.0 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" -1 } -result -1 test word-2.1 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 0 } -result -1 test word-2.2 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 1 } -result 0 test word-2.3 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 2 } -result 0 test word-2.4 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 3 } -result 0 test word-2.5 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 4 } -result 3 test word-2.6 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" 5 } -result 3 test word-2.7 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" end } -result 3 test word-2.8 {tcl_startOfPreviousWord, bug [16e25e1402]} -body { tcl_startOfPreviousWord "ab cd" end-1 } -result 0 test word-2.9 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord "ab cd" {} } -result -1 test word-3.0 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" -1 } -result 3 test word-3.1 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 0 } -result 3 test word-3.2 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 1 } -result 3 test word-3.3 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 2 } -result 3 test word-3.4 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 3 } -result -1 test word-3.5 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 4 } -result -1 test word-3.6 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" 5 } -result -1 test word-3.7 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" end } -result -1 test word-3.8 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" end-1 } -result -1 test word-3.9 {tcl_startOfNextWord} -body { tcl_startOfNextWord "ab cd" {} } -result 3 test word-4.0 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" -1 } -result -1 test word-4.1 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 0 } -result -1 test word-4.2 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 1 } -result -1 test word-4.3 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 2 } -result 2 test word-4.4 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 3 } -result 3 test word-4.5 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 4 } -result 3 test word-4.6 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" 5 } -result 3 test word-4.7 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" end } -result 3 test word-4.8 {tcl_wordBreakBefore} -body { tcl_startOfNextWord "ab cd" end-1 } -result -1 test word-4.9 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore "ab cd" {} } -result -1 test word-5.0 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" -1 } -result 2 test word-5.1 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 0 } -result 2 test word-5.2 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 1 } -result 2 test word-5.3 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 2 } -result 3 test word-5.4 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 3 } -result -1 test word-5.5 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 4 } -result -1 test word-5.6 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" 5 } -result -1 test word-5.7 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" end } -result -1 test word-5.8 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" end-1 } -result -1 test word-5.9 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter "ab cd" {} } -result 2 test word-6.0 {tcl_startOfPreviousWord} -body { tcl_startOfPreviousWord a b c d } -returnCodes 1 -result {wrong # args: should be "tcl_startOfPreviousWord str start"} test word-6.1 {tcl_startOfNextWord} -body { tcl_startOfNextWord a b c d } -returnCodes 1 -result {wrong # args: should be "tcl_startOfNextWord str start"} test word-6.2 {tcl_endOfWord} -body { tcl_endOfWord a b c d } -returnCodes 1 -result {wrong # args: should be "tcl_endOfWord str start"} test word-6.3 {tcl_wordBreakBefore} -body { tcl_wordBreakBefore a b c d } -returnCodes 1 -result {wrong # args: should be "tcl_wordBreakBefore str start"} test word-6.4 {tcl_wordBreakAfter} -body { tcl_wordBreakAfter a b c d } -returnCodes 1 -result {wrong # args: should be "tcl_wordBreakAfter str start"} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/winTime.test0000644000175000017500000000376015104661341015234 0ustar sergeisergei# This file tests the tclWinTime.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testwinclock [llength [info commands testwinclock]] # The next two tests will crash on Windows if the check for negative # clock values is not done properly. test winTime-1.1 {TclpGetDate} {win} { set ::env(TZ) JST-9 set result [clock format -1 -format %Y] unset ::env(TZ) set result } {1970} test winTime-1.2 {TclpGetDate} {win} { set ::env(TZ) PST8 set result [clock format 1 -format %Y] unset ::env(TZ) set result } {1969} # Next test tries to make sure that the Tcl clock stays in step # with the Windows clock. 30 sec really isn't enough, # but how much time does a tester have patience for? test winTime-2.1 {Synchronization of Tcl and Windows clocks} testwinclock { # May fail due to OS/hardware discrepancies. See: # http://support.microsoft.com/default.aspx?scid=kb;en-us;274323 set failed {} set ok 1 foreach start_sec [testwinclock] break while { 1 } { foreach { sys_sec sys_usec tcl_sec tcl_usec } [testwinclock] break set diff [expr { $tcl_sec - $sys_sec + 1.0e-6 * ( $tcl_usec - $sys_usec ) }] if { abs($diff) > 0.1 } { set failed "Tcl clock differs from system clock by $diff sec" break } else { testwinsleep 1 } if { $sys_sec - $start_sec >= 30 } break } set failed } {} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/winPipe.test0000644000175000017500000005217215104661341015234 0ustar sergeisergei# # winPipe.test -- # # This file contains a collection of tests for tclWinPipe.c # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output (except for one message) means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain path catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] set ::tcltestlib [info loaded {} Tcltest] } set org_pwd [pwd] set bindir [file join $org_pwd [file dirname [info nameofexecutable]]] set cat32 [file join $bindir cat32.exe] testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # several test-cases here expect current directory == [temporaryDirectory]: cd [temporaryDirectory] testConstraint exec [llength [info commands exec]] testConstraint cat32 [file exists $cat32] testConstraint AllocConsole [catch {puts console1 ""}] testConstraint RealConsole [expr {![testConstraint AllocConsole]}] testConstraint testexcept [llength [info commands testexcept]] testConstraint slowTest 0 set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n append big $big append big $big append big $big append big $big append big $big append big $big set path(little) [makeFile {} little] set f [open $path(little) w] puts -nonewline $f "little" close $f set path(big) [makeFile {} big] set f [open $path(big) w] puts -nonewline $f $big close $f proc contents {file} { set f [open $file r] set r [read $f] close $f set r } set path(more) [makeFile { while {[eof stdin] == 0} { puts -nonewline [read stdin] } } more] set path(stdout) [makeFile {} stdout] set path(stderr) [makeFile {} stderr] test winpipe-1.1 {32 bit comprehensive tests: from little file} {win exec cat32} { exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.2 {32 bit comprehensive tests: from big file} {win exec cat32} { exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.3 {32 bit comprehensive tests: a little from pipe} {win exec cat32} { exec [interpreter] $path(more) < $path(little) | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.4 {32 bit comprehensive tests: a lot from pipe} {win exec cat32} { exec [interpreter] $path(more) < $path(big) | $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.6 {32 bit comprehensive tests: from console} \ {win cat32 AllocConsole} { # would block waiting for human input } {} test winpipe-1.7 {32 bit comprehensive tests: from NUL} {win exec cat32} { exec $cat32 < nul > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {{} stderr32} test winpipe-1.8 {32 bit comprehensive tests: from socket} {win cat32} { # doesn't work } {} test winpipe-1.9 {32 bit comprehensive tests: from nowhere} \ {win exec cat32 RealConsole} { exec $cat32 > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {{} stderr32} test winpipe-1.10 {32 bit comprehensive tests: from file handle} \ {win exec cat32} { set f [open $path(little) r] exec $cat32 <@$f > $path(stdout) 2> $path(stderr) close $f list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.11 {32 bit comprehensive tests: read from application} \ {win exec cat32} { set f [open "|[list $cat32] < [list $path(little)]" r] gets $f line catch {close $f} msg list $line $msg } {little stderr32} test winpipe-1.12 {32 bit comprehensive tests: a little to file} \ {win exec cat32} { exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.13 {32 bit comprehensive tests: a lot to file} \ {win exec cat32} { exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.14 {32 bit comprehensive tests: a little to pipe} \ {win exec stdio cat32} { exec $cat32 < $path(little) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.15 {32 bit comprehensive tests: a lot to pipe} \ {win exec stdio cat32} { exec $cat32 < $path(big) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr) list [contents $path(stdout)] [contents $path(stderr)] } "{$big} stderr32" test winpipe-1.16 {32 bit comprehensive tests: to console} {win exec cat32} { catch {exec $cat32 << "You should see this\n" >@stdout} msg set msg } stderr32 test winpipe-1.17 {32 bit comprehensive tests: to NUL} {win exec cat32} { # some apps hang when sending a large amount to NUL. $cat32 isn't one. catch {exec $cat32 < $path(big) > nul} msg set msg } stderr32 test winpipe-1.18 {32 bit comprehensive tests: to nowhere} \ {win exec cat32 RealConsole} { exec $cat32 < $path(big) >&@stdout } {} test winpipe-1.19 {32 bit comprehensive tests: to file handle} {win exec cat32} { set f1 [open $path(stdout) w] set f2 [open $path(stderr) w] exec $cat32 < $path(little) >@$f1 2>@$f2 close $f1 close $f2 list [contents $path(stdout)] [contents $path(stderr)] } {little stderr32} test winpipe-1.20 {32 bit comprehensive tests: write to application} \ {win exec cat32} { set f [open |[list $cat32 >$path(stdout)] w] puts -nonewline $f "foo" catch {close $f} msg list [contents $path(stdout)] $msg } {foo stderr32} test winpipe-1.21 {32 bit comprehensive tests: read/write application} \ {win exec cat32} { set f [open "|[list $cat32]" r+] puts $f $big puts $f \x1A flush $f set r [read $f 64] catch {close $f} set r } "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" test winpipe-4.1 {Tcl_WaitPid} {win exec cat32} { proc readResults {f} { global x result if { [eof $f] } { close $f set x 1 } else { set line [read $f ] set result "$result$line" } } set f [open "|[list $cat32] < $path(big) 2> $path(stderr)" r] fconfigure $f -buffering none -blocking 0 fileevent $f readable "readResults $f" set x 0 set result "" vwait x list $result $x [contents $path(stderr)] } "{$big} 1 stderr32" test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" puts $f "testexcept float_underflow" set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGFPE} test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" puts $f "testexcept access_violation" set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGSEGV} test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" puts $f "testexcept illegal_instruction" set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGILL} test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {win exec testexcept notWine} { set f [open "|[list [interpreter]]" w+] set pid [pid $f] puts $f "load $::tcltestlib Tcltest" puts $f "testexcept ctrl+c" set status [catch {close $f}] list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2] } {1 1 SIGINT} set path(nothing) [makeFile {} nothing] close [open $path(nothing) w] catch {set env_tmp $env(TMP)} catch {set env_temp $env(TEMP)} set env(TMP) c:/ set env(TEMP) c:/ test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {win exec} { set x {} set existing [glob -nocomplain c:/tcl*.tmp] exec [interpreter] < $path(nothing) foreach p [glob -nocomplain c:/tcl*.tmp] { if {$p ni $existing} { lappend x $p } } set x } {} test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {win exec} { set tmp $env(TMP) set temp $env(TEMP) unset env(TMP) unset env(TEMP) exec [interpreter] < $path(nothing) set env(TMP) $tmp set env(TEMP) $temp set x {} } {} test winpipe-5.3 {TclpCreateTempFile: TMP specifies non-existent directory} \ {win exec } { set tmp $env(TMP) set env(TMP) snarky exec [interpreter] < $path(nothing) set env(TMP) $tmp set x {} } {} test winpipe-5.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \ {win exec} { set tmp $env(TMP) set temp $env(TEMP) unset env(TMP) set env(TEMP) snarky exec [interpreter] < $path(nothing) set env(TMP) $tmp set env(TEMP) $temp set x {} } {} test winpipe-6.1 {PipeSetupProc & PipeCheckProc: read threads} \ {win exec cat32} { set f [open "|[list $cat32]" r+] fconfigure $f -blocking 0 fileevent $f writable { set x writable } set x {} vwait x fileevent $f writable {} fileevent $f readable { lappend x readable } after 100 { lappend x timeout } vwait x puts $f foobar flush $f vwait x lappend x [read $f] after 100 { lappend x timeout } vwait x fconfigure $f -blocking 1 lappend x [catch {close $f} msg] $msg } {writable timeout readable {foobar } timeout 1 stderr32} test winpipe-6.2 {PipeSetupProc & PipeCheckProc: write threads} \ {win exec cat32} { set f [open "|[list $cat32]" r+] fconfigure $f -blocking 0 fileevent $f writable { set x writable } set x {} vwait x puts -nonewline $f $big$big$big$big flush $f after 100 { lappend x timeout } vwait x lappend x [catch {close $f} msg] $msg } {writable timeout 0 {}} proc _testExecArgs {flags args} { variable path if {![info exists path(echoArgs.tcl)] || ![file exists $path(echoArgs.tcl)]} { set path(echoArgs.tcl) [makeFile { puts "[list [file tail $argv0] {*}$argv]" } echoArgs.tcl] } if {![info exists path(echoArgs.bat)] || ![file exists $path(echoArgs.bat)]} { set path(echoArgs.bat) [makeFile "@[file native [interpreter]] $path(echoArgs.tcl) %*" "echoArgs.bat"] } set cmds [list [list [interpreter] $path(echoArgs.tcl)]] if {"exe-only" ni $flags} { if {"batch2" ni $flags} { lappend cmds [list $path(echoArgs.bat)] } else { if {![info exists path(echoArgs2.bat)] || ![file exists $path(echoArgs2.bat)]} { set path(echoArgs2.bat) [makeFile \ "@[file native [interpreter]] $path(echoArgs.tcl) %*" \ "echo(Cmd)Test Args & Batch.bat" [makeDirectory test(Dir)Check]] } lappend cmds [list $path(echoArgs2.bat)] } } set broken {} foreach args $args { if {"enclose" in $flags} { # enclose single test-arg between 1st/3rd to be sure nothing is truncated # (e. g. to cover unexpected trim by nts-zero case, and args don't recombined): set args [list "1st" $args "3rd"] } set args [list {*}$args]; # normalized canonical list foreach cmd $cmds { set e [linsert $args 0 [file tail $path(echoArgs.tcl)]] tcltest::DebugPuts 4 " ## test exec [file extension [lindex $cmd 0]] ($cmd) for\n ## $args" if {[catch { exec {*}$cmd {*}$args } r]} { set r "ERROR: $r" } if {[file extension [lindex $cmd 0]] eq ".bat"} { set evm {}; foreach ev [lsort -unique [regexp -inline -all {%[A-Z]+%} $e]] { set ev [string range $ev 1 end-1] if {[info exists ::env($ev)]} { lappend evm %$ev% $::env($ev) } } set e [string map $evm $e] } if {$r ne $e} { append broken "\[ERROR\]: exec [file extension [lindex $cmd 0]] on $args\n -- result:\n$r\n -- expected:\n$e\n" } } } return $broken } ### validate the raw output of BuildCommandLine(). ### test winpipe-7.1 {BuildCommandLine: null arguments} {win exec} { exec $env(COMSPEC) /c echo foo "" bar } {foo "" bar} test winpipe-7.2 {BuildCommandLine: null arguments} {win exec} { exec $env(COMSPEC) /c echo foo {} bar } {foo "" bar} test winpipe-7.3 {BuildCommandLine: dbl quote quoting #1} {win exec} { exec $env(COMSPEC) /c echo foo "\"" bar } {foo \" bar} test winpipe-7.4 {BuildCommandLine: dbl quote quoting #2} {win exec} { exec $env(COMSPEC) /c echo foo {""} bar } {foo \"\" bar} test winpipe-7.5 {BuildCommandLine: dbl quote quoting #3} {win exec} { exec $env(COMSPEC) /c echo foo "\" " bar } {foo "\" " bar} test winpipe-7.6 {BuildCommandLine: dbl quote quoting #4} {win exec} { exec $env(COMSPEC) /c echo foo {a="b"} bar } {foo a=\"b\" bar} test winpipe-7.7 {BuildCommandLine: dbl quote quoting #5} {win exec} { exec $env(COMSPEC) /c echo foo {a = "b"} bar } {foo "a = \"b\"" bar} test winpipe-7.8 {BuildCommandLine: dbl quote quoting #6} {win exec} { exec $env(COMSPEC) /c echo {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo} "he \" llo" } {\"hello\" \"\"hello\"\" \"\"\"hello\"\"\" \"\\\"hello\\\"\" "he llo" "he \" llo"} test winpipe-7.9 {BuildCommandLine: N backslashes followed a quote rule #1} {win exec} { exec $env(COMSPEC) /c echo foo \\ bar } {foo \ bar} test winpipe-7.10 {BuildCommandLine: N backslashes followed a quote rule #2} {win exec} { exec $env(COMSPEC) /c echo foo \\\\ bar } {foo \\ bar} test winpipe-7.11 {BuildCommandLine: N backslashes followed a quote rule #3} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\ bar } {foo "\ \\" bar} test winpipe-7.12 {BuildCommandLine: N backslashes followed a quote rule #4} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\\\ bar } {foo "\ \\\\" bar} test winpipe-7.13 {BuildCommandLine: N backslashes followed a quote rule #5} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\\\\\ bar } {foo "\ \\\\\\" bar} test winpipe-7.14 {BuildCommandLine: N backslashes followed a quote rule #6} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\\" bar } {foo "\ \\\"" bar} test winpipe-7.15 {BuildCommandLine: N backslashes followed a quote rule #7} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\\\\" bar } {foo "\ \\\\\"" bar} test winpipe-7.16 {BuildCommandLine: N backslashes followed a quote rule #8} {win exec} { exec $env(COMSPEC) /c echo foo \\\ \\\\\\\" bar } {foo "\ \\\\\\\"" bar} test winpipe-7.17 {BuildCommandLine: special chars #4} {win exec} { exec $env(COMSPEC) /c echo foo \{ bar } "foo \{ bar" test winpipe-7.18 {BuildCommandLine: special chars #5} {win exec} { exec $env(COMSPEC) /c echo foo \} bar } "foo \} bar" set injectList { {test"whoami} {test""whoami} {test"""whoami} {test""""whoami} "test\"whoami\\" "test\"\"whoami\\" "test\"\"\"whoami\\" "test\"\"\"\"whoami\\" {test\\&\\test} {test"\\&\\test} {"test\\&\\test} {"test"\\&\\"test"} {test\\"&"\\test} {test"\\"&"\\test} {"test\\"&"\\test} {"test"\\"&"\\"test"} {test\"&whoami} {test"\"&whoami} {test""\"&whoami} {test"""\"&whoami} {test\"\&whoami} {test"\"\&whoami} {test""\"\&whoami} {test"""\"\&whoami} {test&whoami} {test|whoami} {"test&whoami} {"test|whoami} {test"&whoami} {test"|whoami} {"test"&whoami} {"test"|whoami} {""test"&whoami} {""test"|whoami} {test&echo "} {test|echo "} {"test&echo "} {"test|echo "} {test"&echo "} {test"|echo "} {"test"&echo "} {"test"|echo "} {""test"&echo "} {""test"|echo "} {test&echo ""} {test|echo ""} {"test&echo ""} {"test|echo ""} {test"&echo ""} {test"|echo ""} {"test"&echo ""} {"test"|echo ""} {""test"&echo ""} {""test"|echo ""} {test>whoami} {testwhoami} {"testwhoami} {test"whoami} {"test"whoami} {""test"!()%} {\&|^<>!()% } {"\&|^<>!()%} {"\&|^<>!()% } {"""""\\\\\&|^<>!()%} {"""""\\\\\&|^<>!()% } } set i 0 time { set args {[incr i].} time { set map [lindex $maps [expr {int(rand()*[llength $maps])}]] # be sure arg has some prefix (avoid special handling, like |& etc) set a {x} while {[string length $a] < 50} { append a [string index $map [expr {int(rand()*[string length $map])}]] } lappend args $a } 20 lappend lst $args } 10 _testExecArgs {} {*}$lst } -result {} -cleanup { unset -nocomplain lst args a map maps } set injectList { "test\"\nwhoami" "test\"\"\nwhoami" "test\"\"\"\nwhoami" "test\"\"\"\"\nwhoami" "test;\n&echo \"" "\"test;\n&echo \"" "test\";\n&echo \"" "\"test\";\n&echo \"" "\"\"test\";\n&echo \"" } test winpipe-8.6 {BuildCommandLine/parse_cmdline pass-thru: check new-line quoted in args} \ -constraints {win exec} -body { # test exe only, because currently there is no proper way to escape a new-line char resp. # to supply a new-line to the batch-files within arguments (command line is truncated). _testExecArgs exe-only \ [list START {*}$injectList END] \ [list "START\"" {*}$injectList END] \ [list START {*}$injectList "\"END"] \ [list "START\"" {*}$injectList "\"END"] } -result {} test winpipe-8.7 {BuildCommandLine/parse_cmdline pass-thru: check new-line quoted in args (batch)} \ -constraints {win exec knownBug} -body { # this will fail if executed batch-file, because currently there is no proper way to escape a new-line char. _testExecArgs {} $injectList } -result {} rename _testExecArgs {} # restore old values for env(TMP) and env(TEMP) if {[catch {set env(TMP) $env_tmp}]} { unset env(TMP) } if {[catch {set env(TEMP) $env_temp}]} { unset env(TEMP) } # cleanup removeFile little removeFile big removeFile more removeFile stdout removeFile stderr removeFile nothing if {[info exists path(echoArgs.tcl)]} { removeFile echoArgs.tcl } if {[info exists path(echoArgs.bat)]} { removeFile echoArgs.bat } if {[info exists path(echoArgs2.bat)]} { removeDirectory test(Dir)Check } unset -nocomplain path ::tcltest::cleanupTests # back to original directory: cd $org_pwd; unset org_pwd return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/winNotify.test0000644000175000017500000000744615104661341015613 0ustar sergeisergei# This file tests the tclWinNotify.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testeventloop [expr {[info commands testeventloop] != {}}] # There is no explicit test for InitNotifier or NotifierExitHandler test winNotify-1.1 {Tcl_SetTimer: positive timeout} {win} { set done 0 after 1000 { set done 1 } vwait done set done } 1 test winNotify-1.2 {Tcl_SetTimer: positive timeout, message pending} {win} { set x 0 set y 1 set a1 [after 0 { incr y }] after cancel $a1 after 500 { incr x } vwait x list $x $y } {1 1} test winNotify-1.3 {Tcl_SetTimer: cancelling positive timeout} {win} { set x 0 set y 1 set id [after 10000 { incr y }] after 0 { incr x } vwait x after cancel $id list $x $y } {1 1} test winNotify-1.4 {Tcl_SetTimer: null timeout, message pending} {win} { set x 0 set y 1 after 0 { incr x } after 0 { incr y } vwait x list $x $y } {1 2} test winNotify-2.1 {Tcl_ResetIdleTimer} {win} { set x 0 update after idle { incr x } vwait x set x } 1 test winNotify-2.2 {Tcl_ResetIdleTimer: message pending} {win} { set x 0 set y 1 update after idle { incr x } after idle { incr y } update list $x $y } {1 2} test winNotify-3.1 {NotifierProc: non-modal normal timer} {win testeventloop} { update set x 0 foreach i [after info] { after cancel $i } after 500 { incr x; testeventloop done } testeventloop wait set x } 1 test winNotify-3.2 {NotifierProc: non-modal normal timer, rescheduled} {win testeventloop} { update set x 0 foreach i [after info] { after cancel $i } after 500 { incr x; after 100 {incr x; testeventloop done }} testeventloop wait set x } 2 test winNotify-3.3 {NotifierProc: modal normal timer} {win} { update set x 0 foreach i [after info] { after cancel $i } after 500 { incr x } vwait x set x } 1 test winNotify-3.4 {NotifierProc: modal normal timer, rescheduled} {win} { update set x 0 foreach i [after info] { after cancel $i } set y 0 after 500 { incr y; after 100 {incr x}} vwait x list $x $y } {1 1} test winNotify-3.5 {NotifierProc: non-modal idle timer} {win testeventloop} { update set x 0 foreach i [after info] { after cancel $i } after idle { incr x; testeventloop done } testeventloop wait set x } 1 test winNotify-3.6 {NotifierProc: non-modal idle timer, rescheduled} {win testeventloop} { update set x 0 foreach i [after info] { after cancel $i } after idle { incr x; after idle {incr x; testeventloop done }} testeventloop wait set x } 2 test winNotify-3.7 {NotifierProc: modal idle timer} {win} { update set x 0 foreach i [after info] { after cancel $i } after idle { incr x } vwait x set x } 1 test winNotify-3.8 {NotifierProc: modal idle timer, rescheduled} {win} { update set x 0 foreach i [after info] { after cancel $i } set y 0 after idle { incr y; after idle {incr x}} vwait x list $x $y } {1 1} # Tcl_DoOneEvent is tested by the timer.test, io.test, and event.test files # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/winFile.test0000644000175000017500000001453115104661341015213 0ustar sergeisergei# This file tests the tclWinFile.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testvolumetype [llength [info commands testvolumetype]] testConstraint notNTFS 0 if {[testConstraint testvolumetype]} { testConstraint notNTFS [expr {[testvolumetype] eq "NTFS"}] } testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] test winFile-1.1 {TclpGetUserHome} -constraints {win} -body { glob ~nosuchuser } -result {} test winFile-1.2 {TclpGetUserHome} -constraints {win nonPortable} -body { # The administrator account should always exist. glob ~administrator } -match glob -result * test winFile-1.4 {TclpGetUserHome} {win nonPortable} { catch {glob ~stanton@workgroup} } {0} test winFile-2.1 {TclpMatchFiles: case sensitivity} -constraints {win} -body { makeFile {} GlobCapS set args [list -nocomplain -tails -directory [temporaryDirectory]] list [glob {*}$args GlobC*] [glob {*}$args globc*]} -cleanup { removeFile GlobCapS } -result {GlobCapS GlobCapS} test winFile-2.2 {TclpMatchFiles: case sensitivity} -constraints {win} -body { makeFile {} globlower set args [list -nocomplain -tails -directory [temporaryDirectory]] list [glob {*}$args globl*] [glob {*}$args gLOBl*] } -cleanup { removeFile globlower } -result {globlower globlower} test winFile-3.1 {file system} -constraints {win testvolumetype} -setup { set res "" } -body { foreach vol [file volumes] { # Have to catch in case there is a removable drive (CDROM, floppy) # with nothing in it. catch { if {[lindex [file system $vol] 1] ne [testvolumetype $vol]} { append res "For $vol, we found [file system $vol]\ and [testvolumetype $vol] are different\n" } } } set res } -result {} proc cacls {fname args} { string trim [eval [list exec cacls [file nativename $fname]] $args < 50000} { tcltest::Skip "limit-reached:no-collistion" } set filename [file join $dirname Test[incr ndx]] set f [open $filename w] close $f file stat $filename stat if {[set n [lsearch -exact -integer $inodes $stat(ino)]] >= 0} { return [list [file join $dirname Test$n] $filename] } lappend inodes $stat(ino) unset stat } } test winFCmd-1.38 {TclpRenameFile: check rename of conflicting inodes} -setup { cleanup } -constraints {win winNonZeroInodes knownMsvcBug notInCIenv extensive} -body { file mkdir td1 lassign [MakeFiles td1] a b file rename -force $a $b file exists $a } -cleanup { cleanup } -result 0 test winFCmd-2.1 {TclpCopyFile: errno: EACCES} -setup { cleanup } -constraints {win cdrom testfile} -body { testfile cp $cdfile $cdrom/dummy~~.fil } -returnCodes error -result EACCES test winFCmd-2.2 {TclpCopyFile: errno: EISDIR} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cp td1 tf1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.3 {TclpCopyFile: errno: EISDIR} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 file mkdir td1 testfile cp tf1 td1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.4 {TclpCopyFile: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile cp tf1 tf2 } -returnCodes error -result ENOENT test winFCmd-2.5 {TclpCopyFile: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile cp "" tf2 } -returnCodes error -result ENOENT test winFCmd-2.6 {TclpCopyFile: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 testfile cp tf1 "" } -cleanup { cleanup } -returnCodes error -result ENOENT test winFCmd-2.10 {TclpCopyFile: CopyFile succeeds} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 tf1 testfile cp tf1 tf2 list [contents tf1] [contents tf2] } -cleanup { cleanup } -result {tf1 tf1} test winFCmd-2.11 {TclpCopyFile: CopyFile succeeds} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 tf1 createfile tf2 tf2 testfile cp tf1 tf2 list [contents tf1] [contents tf2] } -cleanup { cleanup } -result {tf1 tf1} test winFCmd-2.12 {TclpCopyFile: CopyFile succeeds} -setup { cleanup } -constraints {win testfile testchmod} -body { createfile tf1 tf1 file attribute tf1 -readonly 1 testfile cp tf1 tf2 list [contents tf2] [file writable tf2] } -cleanup { testchmod 0o660 tf1 cleanup } -result {tf1 0} test winFCmd-2.13 {TclpCopyFile: CopyFile fails} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 file mkdir td1 testfile cp tf1 td1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.14 {TclpCopyFile: errno == EACCES} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cp td1 tf1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.15 {TclpCopyFile: src is directory} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cp td1 tf1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.16 {TclpCopyFile: dst is directory} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 file mkdir td1 testfile cp tf1 td1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-2.17 {TclpCopyFile: dst is readonly} -setup { cleanup } -constraints {win testfile testchmod} -body { createfile tf1 tf1 createfile tf2 tf2 file attribute tf2 -readonly 1 testfile cp tf1 tf2 list [file writable tf2] [contents tf2] } -cleanup { cleanup } -result {1 tf1} test winFCmd-3.1 {TclpDeleteFile: errno: EACCES} -body { testfile rm $cdfile $cdrom/dummy~~.fil } -constraints {win cdrom testfile} -returnCodes error -result EACCES test winFCmd-3.2 {TclpDeleteFile: errno: EISDIR} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile rm td1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-3.3 {TclpDeleteFile: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile rm tf1 } -returnCodes error -result ENOENT test winFCmd-3.4 {TclpDeleteFile: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile rm "" } -returnCodes error -result ENOENT test winFCmd-3.5 {TclpDeleteFile: errno: EACCES} -setup { cleanup } -constraints {win testfile} -body { set fd [open tf1 w] testfile rm tf1 } -cleanup { close $fd cleanup } -returnCodes error -result EACCES test winFCmd-3.6 {TclpDeleteFile: errno: EACCES} -setup { cleanup } -constraints {win testfile} -body { testfile rm nul } -returnCodes error -result EACCES test winFCmd-3.7 {TclpDeleteFile: DeleteFile succeeds} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 testfile rm tf1 file exists tf1 } -result {0} test winFCmd-3.8 {TclpDeleteFile: DeleteFile fails} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile rm td1 } -cleanup { cleanup } -returnCodes error -result EISDIR test winFCmd-3.9 {TclpDeleteFile: errno == EACCES} -setup { cleanup } -constraints {win testfile} -body { set fd [open tf1 w] testfile rm tf1 } -cleanup { close $fd } -returnCodes error -result EACCES test winFCmd-3.10 {TclpDeleteFile: path is readonly} -setup { cleanup } -constraints {win testfile testchmod} -body { createfile tf1 testchmod 0 tf1 testfile rm tf1 file exists tf1 } -result {0} test winFCmd-3.11 {TclpDeleteFile: still can't remove path} -setup { cleanup } -constraints {win testfile testchmod} -body { set fd [open tf1 w] testchmod 0 tf1 testfile rm tf1 } -cleanup { close $fd cleanup } -returnCodes error -result EACCES test winFCmd-4.1 {TclpCreateDirectory: errno: EACCES} -body { testfile mkdir $cdrom/dummy~~.dir } -constraints {win cdrom testfile} -returnCodes error -result EACCES test winFCmd-4.3 {TclpCreateDirectory: errno: EEXIST} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile mkdir td1 } -cleanup { cleanup } -returnCodes error -result EEXIST test winFCmd-4.4 {TclpCreateDirectory: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile mkdir td1/td2 } -returnCodes error -result ENOENT test winFCmd-4.5 {TclpCreateDirectory: CreateDirectory succeeds} -setup { cleanup } -constraints {win testfile} -body { testfile mkdir td1 file type td1 } -cleanup cleanup -result directory test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cpdir td1 td2 list [file type td1] [file type td2] } -cleanup { cleanup } -result {directory directory} test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup { cleanup } -constraints {win testfile testchmod notInCIenv} -body { # Parent's FILE_DELETE_CHILD setting permits deletion of subdir # even when subdir DELETE mask is clear. So we need an intermediate # parent td0 with FILE_DELETE_CHILD turned off while allowing R/W. file mkdir td0/td1 testchmod 0o777 td0 testchmod 0 td0/td1 testfile rmdir td0/td1 file exists td0/td1 } -returnCodes error -cleanup { cleanup } -result {td0/td1 EACCES} # This next test has a very hokey way of matching... test winFCmd-6.2 {TclpRemoveDirectory: errno: EEXIST} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td2 list [catch {testfile rmdir td1} msg] [file tail $msg] } -result {1 {td1 EEXIST}} test winFCmd-6.3 {TclpRemoveDirectory: errno: EACCES} {win emptyTest trashSystem} { # can't test this w/o removing everything on your hard disk first! # testfile rmdir / } {} # This next test has a very hokey way of matching... test winFCmd-6.4 {TclpRemoveDirectory: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { list [catch {testfile rmdir td1} msg] [file tail $msg] } -result {1 {td1 ENOENT}} test winFCmd-6.5 {TclpRemoveDirectory: errno: ENOENT} -setup { cleanup } -constraints {win testfile} -body { testfile rmdir "" } -returnCodes error -result ENOENT # This next test has a very hokey way of matching... test winFCmd-6.6 {TclpRemoveDirectory: errno: ENOTDIR} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 list [catch {testfile rmdir tf1} msg] [file tail $msg] } -result {1 {tf1 ENOTDIR}} test winFCmd-6.7 {TclpRemoveDirectory: RemoveDirectory succeeds} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile rmdir td1 file exists td1 } -result {0} # This next test has a very hokey way of matching... test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 list [catch {testfile rmdir tf1} msg] [file tail $msg] } -result {1 {tf1 ENOTDIR}} # winFCmd-6.9 removed - was exact dup of winFCmd-6.1 test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} -setup { cleanup } -constraints {win testfile notInCIenv} -body { testfile rmdir / # WinXP returns EEXIST, WinNT seems to return EACCES, WINE returns # ENODEV. No policy decision has been made as to which is correct. } -returnCodes error -match regexp -result {^/ E(ACCES|EXIST|NODEV)$} test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup { cleanup } -constraints {win testfile testchmod notInCIenv} -body { # Parent's FILE_DELETE_CHILD setting permits deletion of subdir # even when subdir DELETE mask is clear. So we need an intermediate # parent td0 with FILE_DELETE_CHILD turned off while allowing R/W. file mkdir td0/td1 testchmod 0o770 td0 testchmod 0o444 td0/td1 testfile rmdir td0/td1 file exists td0/td1 } -cleanup { testchmod 0o770 td0/td1 cleanup } -returnCodes error -result {td0/td1 EACCES} # This next test has a very hokey way of matching... test winFCmd-6.15 {TclpRemoveDirectory: !recursive} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td2 list [catch {testfile rmdir td1} msg] [file tail $msg] } -result {1 {td1 EEXIST}} test winFCmd-6.16 {TclpRemoveDirectory: recursive, but errno != EEXIST} -setup { cleanup } -constraints {win testfile} -body { createfile tf1 testfile rmdir -force tf1 } -returnCodes error -result {tf1 ENOTDIR} test winFCmd-6.17 {TclpRemoveDirectory: calls TraverseWinTree} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td2 testfile rmdir -force td1 file exists td1 } -result {0} test winFCmd-7.1 {TraverseWinTree: targetPtr == NULL} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td2/td3 testfile rmdir -force td1 file exists td1 } -result {0} test winFCmd-7.2 {TraverseWinTree: targetPtr != NULL} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td2/td3 testfile cpdir td1 td2 list [file exists td1] [file exists td2] } -cleanup { cleanup } -result {1 1} test winFCmd-7.3 {TraverseWinTree: sourceAttr == -1} -setup { cleanup } -constraints {win testfile} -body { testfile cpdir td1 td2 } -returnCodes error -result {td1 ENOENT} test winFCmd-7.4 {TraverseWinTree: source isn't directory} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } -cleanup { cleanup } -result {tf1} test winFCmd-7.5 {TraverseWinTree: call TraversalCopy: DOTREE_F} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } -cleanup { cleanup } -result {tf1} test winFCmd-7.6 {TraverseWinTree: call TraversalDelete: DOTREE_F} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } -result {0} test winFCmd-7.7 {TraverseWinTree: append \ to source if necessary} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } -cleanup { cleanup } -result {tf1} test winFCmd-7.9 {TraverseWinTree: append \ to source if necessary} -body { testfile rmdir $cdrom/ } -constraints {win cdrom testfile} -returnCodes error -match glob \ -result {* EACCES} test winFCmd-7.10 {TraverseWinTree: can't read directory: handle == INVALID} \ {win emptyTest} { # can't make it happen } {} test winFCmd-7.11 {TraverseWinTree: call TraversalCopy: DOTREE_PRED} -setup { cleanup } -constraints {win testfile testchmod} -body { file mkdir td1 createfile td1/tf1 tf1 testchmod 0o770 td1/tf1; # Else tf2 will have no ACL after td1 testchmod testchmod 0o400 td1 testfile cpdir td1 td2 list [file exists td2] [file writable td2] } -cleanup { testchmod 0o660 td1 cleanup } -result {1 1} test winFCmd-7.12 {TraverseWinTree: call TraversalDelete: DOTREE_PRED} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } -result {0} test winFCmd-7.13 {TraverseWinTree: append \ to target if necessary} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile cpdir td1 td2 contents td2/tf1 } -cleanup { cleanup } -result {tf1} test winFCmd-7.15 {TraverseWinTree: append \ to target if necessary} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cpdir td1 / } -cleanup { cleanup # Windows7 returns EEXIST, XP returns EACCES } -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$} test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cpdir td1 td2 } -cleanup { cleanup } -result {} test winFCmd-7.17 {TraverseWinTree: recurse on files: one file} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/td2 testfile cpdir td1 td2 glob td2/* } -cleanup { cleanup } -result {td2/td2} test winFCmd-7.18 {TraverseWinTree: recurse on files: several files and dir} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 createfile td1/tf2 file mkdir td1/td2/td3 createfile td1/tf3 createfile td1/tf4 testfile cpdir td1 td2 lsort [glob td2/*] } -cleanup { cleanup } -result {td2/td2 td2/tf1 td2/tf2 td2/tf3 td2/tf4} test winFCmd-7.19 {TraverseWinTree: call TraversalCopy: DOTREE_POSTD} -setup { cleanup } -constraints {win testfile testchmod} -body { file mkdir td1 createfile td1/tf1 tf1 testchmod 0o770 td1/tf1; # Else tf2 will have no ACL after td1 testchmod testchmod 0o400 td1 testfile cpdir td1 td2 list [file exists td2] [file writable td2] } -cleanup { testchmod 0o660 td1 cleanup } -result {1 1} test winFCmd-7.20 {TraverseWinTree: call TraversalDelete: DOTREE_POSTD} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 tf1 testfile rmdir -force td1 file exists td1 } -result {0} test winFCmd-7.21 {TraverseWinTree: fill errorPtr} -setup { cleanup } -constraints {win testfile} -body { testfile cpdir td1 td2 } -returnCodes error -result {td1 ENOENT} test winFCmd-8.1 {TraversalCopy: DOTREE_F} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cpdir td1 td1 } -returnCodes error -result {td1 EEXIST} test winFCmd-8.2 {TraversalCopy: DOTREE_PRED} -setup { cleanup } -constraints {win testfile testchmod} -body { file mkdir td1/td2 testchmod 0o770 td1/td2; # Else td2 will have no ACL after td1 testchmod testchmod 0o400 td1 testfile cpdir td1 td2 list [file writable td1] [file writable td1/td2] } -cleanup { testchmod 0o660 td1 cleanup } -result {0 1} test winFCmd-8.3 {TraversalCopy: DOTREE_POSTD} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 testfile cpdir td1 td2 } -cleanup { cleanup } -result {} test winFCmd-9.1 {TraversalDelete: DOTREE_F} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1 createfile td1/tf1 testfile rmdir -force td1 } -result {} test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup { cleanup } -constraints {win testfile testchmod notInCIenv} -body { # Parent's FILE_DELETE_CHILD setting permits deletion of subdir # even when subdir DELETE mask is clear. So we need an intermediate # parent td0 with FILE_DELETE_CHILD turned off while allowing R/W. file mkdir td0/td1/td2 testchmod 0o770 td0 testchmod 0o400 td0/td1 testfile rmdir -force td0/td1 file exists td1 } -cleanup { testchmod 0o770 td0/td1 cleanup } -returnCodes error -result {td0/td1 EACCES} test winFCmd-9.4 {TraversalDelete: DOTREE_POSTD} -setup { cleanup } -constraints {win testfile} -body { file mkdir td1/td1/td3/td4/td5 testfile rmdir -force td1 } -result {} test winFCmd-10.1 {AttributesPosixError - get} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive } -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-10.2 {AttributesPosixError - set} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 } -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-11.1 {GetWinFileAttributes} -constraints {win} -setup { cleanup } -body { createfile td1 {} file attributes td1 -archive } -cleanup { cleanup } -result 1 test winFCmd-11.2 {GetWinFileAttributes} -constraints {win} -setup { cleanup } -body { createfile td1 {} file attributes td1 -readonly } -cleanup { cleanup } -result 0 test winFCmd-11.3 {GetWinFileAttributes} -constraints {win} -setup { cleanup } -body { createfile td1 {} file attributes td1 -hidden } -cleanup { cleanup } -result 0 test winFCmd-11.4 {GetWinFileAttributes} -constraints {win} -setup { cleanup } -body { createfile td1 {} file attributes td1 -system } -cleanup { cleanup } -result 0 test winFCmd-11.5 {GetWinFileAttributes} -constraints {win} -setup { set old [pwd] } -body { # Attr of relative paths that resolve to root was failing don't care about # answer, just that test runs. cd c:/ file attr c: file attr c:. file attr . } -cleanup { cd $old } -match glob -result * test winFCmd-11.6 {GetWinFileAttributes} -constraints {win} -body { file attr c:/ -hidden } -result {0} test winFCmd-12.1 {ConvertFileNameFormat} -constraints {win} -setup { cleanup } -body { createfile td1 {} string tolower [file attributes td1 -longname] } -cleanup { cleanup } -result {td1} test winFCmd-12.2 {ConvertFileNameFormat} -constraints {win} -setup { cleanup } -body { file mkdir td1 createfile td1/td1 {} string tolower [file attributes td1/td1 -longname] } -cleanup { cleanup } -result {td1/td1} test winFCmd-12.3 {ConvertFileNameFormat} -constraints {win} -setup { cleanup } -body { file mkdir td1 file mkdir td1/td2 createfile td1/td3 {} string tolower [file attributes td1/td2/../td3 -longname] } -cleanup { cleanup } -result {td1/td2/../td3} test winFCmd-12.4 {ConvertFileNameFormat} -constraints {win} -setup { cleanup } -body { createfile td1 {} string tolower [file attributes ./td1 -longname] } -cleanup { cleanup } -result {./td1} test winFCmd-12.5 {ConvertFileNameFormat: absolute path} -body { list [file attributes / -longname] [file attributes \\ -longname] } -constraints {win} -result {/ /} test winFCmd-12.6 {ConvertFileNameFormat: absolute path with drive (in temp folder)} -setup { catch {file delete -force -- $::env(TEMP)/td1} } -constraints {win} -body { createfile $::env(TEMP)/td1 {} string equal [string tolower [file attributes $::env(TEMP)/td1 -longname]] \ [string tolower [file normalize $::env(TEMP)]/td1] } -cleanup { file delete -force -- $::env(TEMP)/td1 } -result 1 test winFCmd-12.7 {ConvertFileNameFormat} -body { string tolower [file attributes //bisque/tcl/ws -longname] } -constraints {nonPortable win} -result {//bisque/tcl/ws} test winFCmd-12.8 {ConvertFileNameFormat} -setup { cleanup } -constraints {win longFileNames} -body { createfile td1 {} string tolower [file attributes td1 -longname] } -cleanup { cleanup } -result {td1} test winFCmd-12.10 {ConvertFileNameFormat} -setup { cleanup } -constraints {longFileNames win} -body { createfile td1td1td1 {} file attributes td1td1td1 -shortname } -cleanup { cleanup } -match glob -result * test winFCmd-12.11 {ConvertFileNameFormat} -setup { cleanup } -constraints {longFileNames win} -body { createfile td1 {} string tolower [file attributes td1 -shortname] } -cleanup { cleanup } -result {td1} test winFCmd-13.1 {GetWinFileLongName} -constraints {win} -setup { cleanup } -body { createfile td1 {} string tolower [file attributes td1 -longname] } -cleanup { cleanup } -result td1 test winFCmd-14.1 {GetWinFileShortName} -constraints {win} -setup { cleanup } -body { createfile td1 {} string tolower [file attributes td1 -shortname] } -cleanup { cleanup } -result td1 test winFCmd-15.1 {SetWinFileAttributes} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 } -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -archive 1] [file attributes td1 -archive] } -cleanup { cleanup } -result {{} 1} test winFCmd-15.3 {SetWinFileAttributes - archive} -constraints {win notInCIenv} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -archive 0] [file attributes td1 -archive] } -cleanup { cleanup } -result {{} 0} test winFCmd-15.4 {SetWinFileAttributes - hidden} -constraints {win notInCIenv} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -hidden 1] [file attributes td1 -hidden] \ [file attributes td1 -hidden 0] } -cleanup { cleanup } -result {{} 1 {}} test winFCmd-15.5 {SetWinFileAttributes - hidden} -constraints {win} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -hidden 0] [file attributes td1 -hidden] } -cleanup { cleanup } -result {{} 0} test winFCmd-15.6 {SetWinFileAttributes - readonly} -setup { cleanup } -constraints {win} -body { createfile td1 {} list [file attributes td1 -readonly 1] [file attributes td1 -readonly] } -cleanup { cleanup } -result {{} 1} test winFCmd-15.7 {SetWinFileAttributes - readonly} -setup { cleanup } -constraints {win} -body { createfile td1 {} list [file attributes td1 -readonly 0] [file attributes td1 -readonly] } -cleanup { cleanup } -result {{} 0} test winFCmd-15.8 {SetWinFileAttributes - system} -constraints {win notInCIenv} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -system 1] [file attributes td1 -system] } -cleanup { cleanup } -result {{} 1} test winFCmd-15.9 {SetWinFileAttributes - system} -constraints {win} -setup { cleanup } -body { createfile td1 {} list [file attributes td1 -system 0] [file attributes td1 -system] } -cleanup { cleanup } -result {{} 0} test winFCmd-15.10 {SetWinFileAttributes - failing} -setup { cleanup } -constraints {win cdrom} -body { file attributes $cdfile -archive 1 } -returnCodes error -match glob -result * test winFCmd-16.1 {Windows file normalization} -constraints {win} -body { list [file normalize c:/] [file normalize C:/] } -result {C:/ C:/} test winFCmd-16.2 {Windows file normalization} -constraints {win} -body { createfile td1... {} file tail [file normalize td1] } -cleanup { file delete td1... } -result {td1} set pwd [pwd] set d [string index $pwd 0] test winFCmd-16.3 {Windows file normalization} -constraints {win} -body { file norm ${d}:foo } -result [file join $pwd foo] test winFCmd-16.4 {Windows file normalization} -constraints {win} -body { file norm [string tolower ${d}]:foo } -result [file join $pwd foo] test winFCmd-16.5 {Windows file normalization} -constraints {win} -body { file norm ${d}:foo/bar } -result [file join $pwd foo/bar] test winFCmd-16.6 {Windows file normalization} -constraints {win} -body { file norm ${d}:foo\\bar } -result [file join $pwd foo/bar] test winFCmd-16.7 {Windows file normalization} -constraints {win} -body { file norm /bar } -result "${d}:/bar" test winFCmd-16.8 {Windows file normalization} -constraints {win} -body { file norm ///bar } -result "${d}:/bar" test winFCmd-16.9 {Windows file normalization} -constraints {win} -body { file norm /bar/foo } -result "${d}:/bar/foo" if {$d eq "C"} { set dd "D" } else { set dd "C" } test winFCmd-16.10 {Windows file normalization} -constraints {win} -body { file norm ${dd}:foo } -result "${dd}:/foo" test winFCmd-16.11 {Windows file normalization} -body { cd ${d}: cd $cdrom cd ${d}: cd $cdrom # Must not crash set result "no crash" } -constraints {win cdrom} -cleanup { cd $pwd } -result {no crash} test winFCmd-16.12 {Windows file normalization - no crash} \ -constraints win -setup { set oldhome "" catch {set oldhome $::env(HOME)} } -body { set expectedResult [file normalize ${d}:] set ::env(HOME) ${d}: cd # At one point this led to an infinite recursion in Tcl set result [pwd]; # <- Must not crash set result "no crash" } -cleanup { set ::env(HOME) $oldhome cd $pwd } -result {no crash} test winFCmd-16.13 {Windows file normalization - absolute HOME} -setup { set oldhome "" catch {set oldhome $::env(HOME)} } -constraints win -body { # Test 'cd' normalization when HOME is absolute set ::env(HOME) ${d}:/ cd pwd } -cleanup { set ::env(HOME) $oldhome cd $pwd } -result [file normalize ${d}:/] test winFCmd-16.14 {Windows file normalization - relative HOME} -setup { set oldhome "" catch {set oldhome $::env(HOME)} } -constraints win -body { # Test 'cd' normalization when HOME is relative set ::env(HOME) ${d}: cd pwd } -cleanup { set ::env(HOME) $oldhome cd $pwd } -result $pwd test winFCmd-17.1 {Windows bad permissions cd} -constraints win -body { set d {} foreach dd {c:/ d:/ e:/} { eval lappend d [glob -nocomplain \ -types hidden -dir $dd "System Volume Information"] } # Old versions of Tcl gave a misleading error that the # directory in question didn't exist. if {[llength $d] && [catch {cd [lindex $d 0]} err]} { regsub ".*: " $err "" err set err } else { set err "permission denied" } } -cleanup { cd $pwd } -result "permission denied" cd $pwd unset d dd pwd test winFCmd-18.1 {Windows reserved path names} -constraints win -body { file pathtype com1 } -result "absolute" test winFCmd-18.1.2 {Windows reserved path names} -constraints win -body { file pathtype com4 } -result "absolute" test winFCmd-18.1.3 {Windows reserved path names} -constraints win -body { file pathtype com9 } -result "absolute" test winFCmd-18.1.4 {Windows reserved path names} -constraints win -body { file pathtype lpt3 } -result "absolute" test winFCmd-18.1.5 {Windows reserved path names} -constraints win -body { file pathtype lpt9 } -result "absolute" test winFCmd-18.1.6 {Windows reserved path names} -constraints win -body { file pathtype nul } -result "absolute" test winFCmd-18.1.7 {Windows reserved path names} -constraints win -body { file pathtype null } -result "relative" test winFCmd-18.2 {Windows reserved path names} -constraints win -body { file pathtype com1: } -result "absolute" test winFCmd-18.3 {Windows reserved path names} -constraints win -body { file pathtype COM1 } -result "absolute" test winFCmd-18.4 {Windows reserved path names} -constraints win -body { file pathtype CoM1: } -result "absolute" test winFCmd-18.5 {Windows reserved path names} -constraints win -body { file normalize com1: } -result COM1 test winFCmd-18.6 {Windows reserved path names} -constraints win -body { file normalize COM1: } -result COM1 test winFCmd-18.7 {Windows reserved path names} -constraints win -body { file normalize cOm1 } -result COM1 test winFCmd-18.8 {Windows reserved path names} -constraints win -body { file normalize cOm1: } -result COM1 test winFCmd-19.1 {Windows extended path names} -constraints win -body { file normalize //?/c:/windows/win.ini } -result //?/c:/windows/win.ini test winFCmd-19.2 {Windows extended path names} -constraints win -body { file normalize //?/c:/windows/../windows/win.ini } -result //?/c:/windows/win.ini test winFCmd-19.3 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) tcl[string repeat x 20].tmp] set tmpfile [file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res } -cleanup { catch {file delete $tmpfile} } -result [list 0 {}] test winFCmd-19.4 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) tcl[string repeat x 20].tmp] set tmpfile //?/[file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res } -cleanup { catch {file delete $tmpfile} } -result [list 0 {}] test winFCmd-19.5 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) tcl[string repeat x 248].tmp] set tmpfile [file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res } -cleanup { catch {file delete $tmpfile} } -result [list 0 {}] test winFCmd-19.6 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) tcl[string repeat x 248].tmp] set tmpfile //?/[file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res } -cleanup { catch {file delete $tmpfile} } -result [list 0 {}] test winFCmd-19.7 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) "tcl[pid].tmp "] set tmpfile [file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res [glob -directory $::env(TEMP) -tails tcl[pid].*] } -cleanup { catch {file delete $tmpfile} } -result [list 0 {} [list tcl[pid].tmp]] test winFCmd-19.8 {Windows extended path names} -constraints win -setup { set tmpfile [file join $::env(TEMP) "tcl[pid].tmp "] set tmpfile //?/[file normalize $tmpfile] } -body { list [catch { set f [open $tmpfile [list WRONLY CREAT]] close $f } res] $res [glob -directory $::env(TEMP) -tails tcl[pid].*] } -cleanup { catch {file delete $tmpfile} } -result [list 0 {} [list "tcl[pid].tmp "]] test winFCmd-19.9 {Windows devices path names} -constraints win -body { file normalize //./com1 } -result //./com1 # This block of code used to occur after the "return" call, so I'm # commenting it out and assuming that this code is still under construction. #foreach source {tef ted tnf tnd "" nul com1} { # foreach chmodsrc {000 755} { # foreach dest "tfn tfe tdn tdempty tdfull td1/td2 $p $p/td1 {} nul" { # foreach chmoddst {000 755} { # puts hi # cleanup # file delete -force ted tef # file mkdir ted # createfile tef # createfile tfe # file mkdir tdempty # file mkdir tdfull/td1/td2 # # catch {testchmod $chmodsrc $source} # catch {testchmod $chmoddst $dest} # # if [catch {file rename $source $dest} msg] { # puts "file rename $source ($chmodsrc) $dest ($chmoddst)" # puts $msg # } # } # } # } #} cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/winDde.test0000644000175000017500000004113215104661341015025 0ustar sergeisergei# This file tests the tclWinDde.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] testConstraint dde 0 if {[testConstraint win]} { if {![catch { ::tcltest::loadTestedCommands set ::ddever [package require dde 1.4.6] set ::ddelib [info loaded {} Dde]}]} { testConstraint dde 1 } } testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # ------------------------------------------------------------------------- # Setup a script for a test server # set scriptName [makeFile {} script1.tcl] proc createChildProcess {ddeServerName args} { file delete -force $::scriptName set f [open $::scriptName w+] fconfigure $f -encoding utf-8 puts $f [list set ddeServerName $ddeServerName] puts $f [list load $::ddelib Dde] puts $f { # DDE child server - # if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # If an error occurs during the tests, this process may end up not # being closed down. To deal with this we create a 30s timeout. proc ::DoTimeout {} { global done ddeServerName set done 1 puts "winDde.test child process $ddeServerName timed out." flush stdout } set timeout [after 30000 ::DoTimeout] # Define a restricted handler. proc Handler1 {cmd} { if {$cmd eq "stop"} {set ::done 1} if {$cmd eq ""} { set cmd "null data" } puts $cmd ; flush stdout return } proc Handler2 {cmd} { if {$cmd eq "stop"} {set ::done 1} puts [uplevel \#0 $cmd] ; flush stdout return } proc Handler3 {prefix cmd} { if {$cmd eq "stop"} {set ::done 1} puts [list $prefix $cmd] ; flush stdout return } } # set the dde server name to the supplied argument. puts $f [list dde servername {*}$args -- $ddeServerName] puts $f { # run the server and handle final cleanup. after 200;# give dde a chance to get going. puts ready flush stdout vwait done # allow enough time for the calling process to # claim all results, to avoid spurious "server did # not respond" after 200 {set reallyDone 1} vwait reallyDone exit } close $f # run the child server script. set f [open |[list [interpreter] $::scriptName] r] fconfigure $f -buffering line -encoding utf-8 gets $f line return $f } # ------------------------------------------------------------------------- test winDde-1.0 {check if we are testing the right dll} {win dde} { set ::ddever } {1.4.6} test winDde-1.1 {Settings the server's topic name} -constraints dde -body { list [dde servername foobar] [dde servername] [dde servername self] } -result {foobar foobar self} test winDde-2.1 {Checking for other services} -constraints dde -body { expr {[llength [dde services {} {}]] >= 0} } -result 1 test winDde-2.2 {Checking for existence, with service and topic specified} \ -constraints dde -body { llength [dde services TclEval self] } -result 1 test winDde-2.3 {Checking for existence, with only the service specified} \ -constraints dde -body { expr {[llength [dde services TclEval {}]] >= 1} } -result 1 test winDde-2.4 {Checking for existence, with only the topic specified} \ -constraints dde -body { expr {[llength [dde services {} self]] >= 1} } -result 1 # ------------------------------------------------------------------------- test winDde-3.1 {DDE execute locally} -constraints dde -body { set \xE1 "" dde execute TclEval self [list set \xE1 foo] set \xE1 } -result foo test winDde-3.2 {DDE execute -async locally} -constraints dde -body { set \xE1 "" dde execute -async TclEval self [list set \xE1 foo] update set \xE1 } -result foo test winDde-3.3 {DDE request locally} -constraints dde -body { set \xE1 "" dde execute TclEval self [list set \xE1 foo] dde request TclEval self \xE1 } -result foo test winDde-3.4 {DDE eval locally} -constraints dde -body { set \xE1 "" dde eval self set \xE1 foo } -result foo test winDde-3.5 {DDE request locally} -constraints dde -body { set \xE1 "" dde execute TclEval self [list set \xE1 foo] dde request -binary TclEval self \xE1 } -result "foo\x00" # Set variable a to A with diaeresis (Unicode C4) by relying on the fact # that utf-8 is sent (e.g. "c3 84" on the wire) test winDde-3.6 {DDE request utf-8} -constraints dde -body { set \xE1 "not set" dde execute TclEval self "set \xE1 \xC4" scan [set \xE1] %c } -result 196 # Set variable a to A with diaeresis (Unicode C4) using binary execute # and compose utf-8 (e.g. "c3 84" ) manually test winDde-3.7 {DDE request binary} -constraints {dde notWine} -body { set \xE1 "not set" dde execute -binary TclEval self [list set \xC3\xA1 \xC3\x84\x00] scan [set \xE1] %c } -result 196 test winDde-3.8 {DDE poke locally} -constraints {dde debug} -body { set \xE1 "" dde poke TclEval self \xE1 \xC4 dde request TclEval self \xE1 } -result \xC4 test winDde-3.9 {DDE poke -binary locally} -constraints {dde debug} -body { set \xE1 "" dde poke -binary TclEval self \xE1 \xC3\x84\x00 dde request TclEval self \xE1 } -result \xC4 # ------------------------------------------------------------------------- test winDde-4.1 {DDE execute remotely} -constraints {dde stdio} -body { set \xE1 "" set name ch\xEDld-4.1 set child [createChildProcess $name] dde execute TclEval $name [list set \xE1 foo] dde execute TclEval $name {set done 1} update set \xE1 } -result "" test winDde-4.2 {DDE execute async remotely} -constraints {dde stdio} -body { set \xE1 "" set name ch\xEDld-4.2 set child [createChildProcess $name] dde execute -async TclEval $name [list set \xE1 foo] update dde execute TclEval $name {set done 1} update set \xE1 } -result "" test winDde-4.3 {DDE request remotely} -constraints {dde stdio} -body { set \xE1 "" set name ch\xEDld-4.3 set child [createChildProcess $name] dde execute TclEval $name [list set \xE1 foo] set \xE1 [dde request TclEval $name \xE1] dde execute TclEval $name {set done 1} update set \xE1 } -result foo test winDde-4.4 {DDE eval remotely} -constraints {dde stdio} -body { set \xE1 "" set name ch\xEDld-4.4 set child [createChildProcess $name] set \xE1 [dde eval $name set \xE1 foo] dde execute TclEval $name {set done 1} update set \xE1 } -result foo test winDde-4.5 {DDE poke remotely} -constraints {dde debug stdio} -body { set \xE1 "" set name ch\xEDld-4.5 set child [createChildProcess $name] dde poke TclEval $name \xE1 foo set \xE1 [dde request TclEval $name \xE1] dde execute TclEval $name {set done 1} update set \xE1 } -result foo # ------------------------------------------------------------------------- test winDde-5.1 {check for bad arguments} -constraints dde -body { dde execute "" "" "" "" } -returnCodes error -result {wrong # args: should be "dde execute ?-async? ?-binary? serviceName topicName value"} test winDde-5.2 {check for bad arguments} -constraints dde -body { dde execute -binary "" "" "" } -returnCodes error -result {cannot execute null data} test winDde-5.3 {check for bad arguments} -constraints dde -body { dde execute -foo "" "" "" } -returnCodes error -result {wrong # args: should be "dde execute ?-async? ?-binary? serviceName topicName value"} test winDde-5.4 {DDE eval bad arguments} -constraints dde -body { dde eval "" "foo" } -returnCodes error -result {invalid service name ""} # ------------------------------------------------------------------------- test winDde-6.1 {DDE servername bad arguments} -constraints dde -body { dde servername -z -z -z } -returnCodes error -result {bad option "-z": must be -force, -handler, or --} test winDde-6.2 {DDE servername set name} -constraints dde -body { dde servername -- winDde-6.2 } -result {winDde-6.2} test winDde-6.3 {DDE servername set exact name} -constraints dde -body { dde servername -force winDde-6.3 } -result {winDde-6.3} test winDde-6.4 {DDE servername set exact name} -constraints dde -body { dde servername -force -- winDde-6.4 } -result {winDde-6.4} test winDde-6.5 {DDE remote servername collision} -constraints {dde stdio} -setup { set name ch\xEDld-6.5 set child [createChildProcess $name] } -body { dde servername -- $name } -cleanup { dde execute TclEval $name {set done 1} update } -result "ch\xEDld-6.5 #2" test winDde-6.6 {DDE remote servername collision force} -constraints {dde stdio} -setup { set name ch\xEDld-6.6 set child [createChildProcess $name] } -body { dde servername -force -- $name } -cleanup { dde execute TclEval $name {set done 1} update } -result "ch\xEDld-6.6" # ------------------------------------------------------------------------- test winDde-7.1 {Load DDE in child interpreter} -constraints dde -setup { interp create child } -body { child eval [list load $::ddelib Dde] child eval [list dde servername -- dde-interp-7.1] } -cleanup { interp delete child } -result {dde-interp-7.1} test winDde-7.2 {DDE child cleanup} -constraints dde -setup { interp create child child eval [list load $::ddelib Dde] child eval [list dde servername -- dde-interp-7.5] interp delete child } -body { dde services TclEval {} set s [dde services TclEval {}] set m [list [list TclEval dde-interp-7.5]] if {$m in $s} { set s } } -result {} test winDde-7.3 {DDE present in child interp} -constraints dde -setup { interp create child child eval [list load $::ddelib Dde] child eval [list dde servername -- dde-interp-7.3] } -body { dde services TclEval dde-interp-7.3 } -cleanup { interp delete child } -result {{TclEval dde-interp-7.3}} test winDde-7.4 {interp name collision with -force} -constraints dde -setup { interp create child child eval [list load $::ddelib Dde] child eval [list dde servername -- dde-interp-7.4] } -body { dde servername -force -- dde-interp-7.4 } -cleanup { interp delete child } -result {dde-interp-7.4} test winDde-7.5 {interp name collision without -force} -constraints dde -setup { interp create child child eval [list load $::ddelib Dde] child eval [list dde servername -- dde-interp-7.5] } -body { dde servername -- dde-interp-7.5 } -cleanup { interp delete child } -result "dde-interp-7.5 #2" # ------------------------------------------------------------------------- test winDde-8.1 {Safe DDE load} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde } -body { child eval dde servername child } -cleanup { interp delete child } -returnCodes error -result {invalid command name "dde"} test winDde-8.2 {Safe DDE set servername} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde } -body { child invokehidden dde servername child } -cleanup {interp delete child} -result {child} test winDde-8.3 {Safe DDE check handler required for eval} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child invokehidden dde servername child } -body { catch {dde eval child set a 1} msg } -cleanup {interp delete child} -result {1} test winDde-8.4 {Safe DDE check that execute is denied} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child invokehidden dde servername child } -body { child eval set a 1 dde execute TclEval child {set a 2} child eval set a } -cleanup {interp delete child} -result 1 test winDde-8.5 {Safe DDE check that request is denied} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child invokehidden dde servername child } -body { child eval set a 1 dde request TclEval child a } -cleanup { interp delete child } -returnCodes error -result {remote server cannot handle this command} test winDde-8.6 {Safe DDE assign handler procedure} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD $cmd}} } -body { child invokehidden dde servername -handler DDEACCEPT child } -cleanup {interp delete child} -result child test winDde-8.7 {Safe DDE check simple command} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD $cmd}} child invokehidden dde servername -handler DDEACCEPT child } -body { dde eval child set x 1 } -cleanup {interp delete child} -result {set x 1} test winDde-8.8 {Safe DDE check non-list command} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD $cmd}} child invokehidden dde servername -handler DDEACCEPT child } -body { set s "c:\\Program Files\\Microsoft Visual Studio\\" dde eval child $s string equal [child eval set DDECMD] $s } -cleanup {interp delete child} -result 1 test winDde-8.9 {Safe DDE check command evaluation} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD [uplevel \#0 $cmd]}} child invokehidden dde servername -handler DDEACCEPT child } -body { dde eval child set \xE1 1 child eval set \xE1 } -cleanup {interp delete child} -result 1 test winDde-8.10 {Safe DDE check command evaluation (2)} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD [uplevel \#0 $cmd]}} child invokehidden dde servername -handler DDEACCEPT child } -body { dde eval child [list set x 1] child eval set x } -cleanup {interp delete child} -result 1 test winDde-8.11 {Safe DDE check command evaluation (3)} -constraints dde -setup { interp create -safe child child invokehidden load $::ddelib Dde child eval {proc DDEACCEPT {cmd} {set ::DDECMD [uplevel \#0 $cmd]}} child invokehidden dde servername -handler DDEACCEPT child } -body { dde eval child [list [list set x 1]] child eval set x } -cleanup {interp delete child} -returnCodes error -result {invalid command name "set x 1"} # ------------------------------------------------------------------------- test winDde-9.1 {External safe DDE check string passing} -constraints {dde stdio} -setup { set name ch\xEDld-9.1 set child [createChildProcess $name -handler Handler1] file copy -force script1.tcl dde-script.tcl } -body { dde eval $name set x 1 gets $child line set line } -cleanup { dde execute TclEval $name stop update file delete -force -- dde-script.tcl } -result {set x 1} test winDde-9.2 {External safe DDE check command evaluation} -constraints {dde stdio} -setup { set name ch\xEDld-9.2 set child [createChildProcess $name -handler Handler2] file copy -force script1.tcl dde-script.tcl } -body { dde eval $name set x 1 gets $child line set line } -cleanup { dde execute TclEval $name stop update file delete -force -- dde-script.tcl } -result 1 test winDde-9.3 {External safe DDE check prefixed arguments} -constraints {dde stdio} -setup { set name ch\xEDld-9.3 set child [createChildProcess $name -handler [list Handler3 ARG]] file copy -force script1.tcl dde-script.tcl } -body { dde eval $name set x 1 gets $child line set line } -cleanup { dde execute TclEval $name stop update file delete -force -- dde-script.tcl } -result {ARG {set x 1}} test winDde-9.4 {External safe DDE check null data passing} -constraints {dde stdio} -setup { set name ch\xEDld-9.4 set child [createChildProcess $name -handler Handler1] file copy -force script1.tcl dde-script.tcl } -body { dde execute TclEval $name "" gets $child line set line } -cleanup { dde execute TclEval $name stop update file delete -force -- dde-script.tcl } -result {null data} # ------------------------------------------------------------------------- #cleanup #catch {interp delete $child}; # ensure we clean up the child. file delete -force $::scriptName ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/winConsole.test0000644000175000017500000003243615104661341015742 0ustar sergeisergei# This file tests the tclWinConsole.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # NOTE THIS CANNOT BE RUN VIA nmake/make test since stdin is connected to # nmake in that case. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {package require twapi} ;# Only to bring window to foreground. Not critical ::tcltest::ConstraintInitializer haveThread { expr {![catch {package require Thread}]} } # Prompt user for a yes/no response proc yesno {question {default "Y"}} { set answer "" # Make sure we are seen but catch because ui and console # packages may not be available catch {twapi::set_foreground_window [twapi::get_console_window]} while {![string is boolean -strict $answer]} { puts -nonewline stdout "$question Type Y/N followed by Enter \[$default\] : " flush stdout set answer [string trim [gets stdin]] if {$answer eq ""} { set answer $default } } return [expr {!! $answer}] } proc prompt {prompt} { # Make sure we are seen but catch because twapi ui and console # packages may not be available catch {twapi::set_foreground_window [twapi::get_console_window]} puts -nonewline stdout "$prompt" flush stdout } # Input tests test console-input-1.0 {Console blocking gets} -constraints {win interactive} -body { prompt "Type \"xyz\" and hit Enter: " gets stdin } -result xyz test console-input-1.1 {Console file channel: non-blocking gets} -constraints { win interactive } -setup { unset -nocomplain result unset -nocomplain result2 } -body { set oldmode [fconfigure stdin] prompt "Type \"abc\" and hit Enter: " fileevent stdin readable { if {[gets stdin line] >= 0} { lappend result2 $line if {[llength $result2] > 1} { set result $result2 } else { prompt "Type \"def\" and hit Enter: " } } elseif {[eof stdin]} { set result "gets failed" } } fconfigure stdin -blocking 0 -buffering line vwait result #cleanup the fileevent fileevent stdin readable {} fconfigure stdin {*}$oldmode set result } -result {abc def} test console-input-1.1.1 {Bug baa51423c28a: Console file channel: fileevent with blocking gets} -constraints { win interactive } -setup { unset -nocomplain result unset -nocomplain result2 } -body { prompt "Type \"abc\" and hit Enter: " fileevent stdin readable { if {[gets stdin line] >= 0} { lappend result2 $line if {[llength $result2] > 1} { set result $result2 } else { prompt "Type \"def\" and hit Enter: " } } elseif {[eof stdin]} { set result "gets failed" } } vwait result #cleanup the fileevent fileevent stdin readable {} set result } -result {abc def} test console-input-2.0 {Console blocking read} -constraints {win interactive} -setup { set oldmode [fconfigure stdin] fconfigure stdin -inputmode raw } -cleanup { fconfigure stdin {*}$oldmode } -body { prompt "Type the key \"a\". Do NOT hit Enter. You will NOT see characters echoed." set c [read stdin 1] puts "" set c } -result a test console-input-2.1 {Console file channel: non-blocking read} -constraints { win interactive } -setup { set oldmode [fconfigure stdin] } -cleanup { fconfigure stdin {*}$oldmode puts ""; # Because CRLF also would not have been echoed } -body { set input "" fconfigure stdin -blocking 0 -buffering line -inputmode raw prompt "Type \"abc\". Do NOT hit Enter. You will NOT see characters echoed." fileevent stdin readable { set c [read stdin 1] if {$c eq ""} { if {[eof stdin]} { set result "read eof" } } else { append input $c if {[string length $input] == 3} { set result $input } } } set result {} vwait result fileevent stdin readable {} set result } -result abc test console-input-3.0 {Console gets blocking - long lines bug-bda99f2393} -constraints { win interactive } -body { prompt "Try typing a line of at least 256 characters. Hit ENTER exactly once unless you don't see another prompt.\n" gets stdin line set len [string length $line] list [yesno "Did you hit ENTER only once?"] [expr {$len > 256}] [yesno "Line length was $len characters. Is this correct?"] } -result {1 1 1} test console-input-3.1 {Console gets blocking, small channel buffer size - long lines bug-bda99f2393} -constraints { win interactive } -body { prompt "Try typing a line of at least 256 characters. Hit ENTER exactly once unless you don't see another prompt.\n" set bufSize [fconfigure stdin -buffersize] fconfigure stdin -buffersize 10 gets stdin line fconfigure stdin -buffersize $bufSize set len [string length $line] list [yesno "Did you hit ENTER only once?"] [expr {$len > 256}] [yesno "Line length was $len characters. Is this correct?"] } -result {1 1 1} test console-input-3.2 {Console gets nonblocking - long lines bug-bda99f2393} -constraints { win interactive } -body { prompt "Try typing a line of at least 256 characters. Hit ENTER exactly once unless you don't see another prompt.\n" fconfigure stdin -blocking 0 while {[gets stdin line] < 0} { after 1000 } fconfigure stdin -blocking 1 set len [string length $line] list [yesno "Did you hit ENTER only once?"] [expr {$len > 256}] [yesno "Line length was $len characters. Is this correct?"] } -result {1 1 1} test console-input-3.3 {Console gets nonblocking small channel buffer size - long lines bug-bda99f2393} -constraints { win interactive } -body { prompt "Try typing a line of at least 256 characters. Hit ENTER exactly once unless you don't see another prompt.\n" set bufSize [fconfigure stdin -buffersize] fconfigure stdin -blocking 0 -buffersize 10 while {[gets stdin line] < 0} { after 1000 } fconfigure stdin -blocking 1 -buffersize $bufSize set len [string length $line] list [yesno "Did you hit ENTER only once?"] [expr {$len > 256}] [yesno "Line length was $len characters. Is this correct?"] } -result {1 1 1} # Output tests test console-output-1.0 {Console blocking puts stdout} -constraints {win interactive} -body { puts stdout "123" yesno "Did you see the string \"123\"?" } -result 1 test console-output-1.1 {Console non-blocking puts stdout} -constraints { win interactive } -setup { set oldmode [fconfigure stdout] dict unset oldmode -winsize } -cleanup { fconfigure stdout {*}$oldmode } -body { fconfigure stdout -blocking 0 -buffering line set count 0 fileevent stdout writable { if {[incr count] < 4} { puts "$count" } else { fileevent stdout writable {} set done 1 } } vwait done yesno "Did you see 1, 2, 3 printed on consecutive lines?" } -result 1 test console-output-2.0 {Console blocking puts stderr} -constraints {win interactive} -body { puts stderr "456" yesno "Did you see the string \"456\"?" } -result 1 # fconfigure get tests ## fconfigure get stdin test console-fconfigure-get-1.0 { Console get stdin configuration } -constraints {win interactive} -body { lsort [dict keys [fconfigure stdin]] } -result {-blocking -buffering -buffersize -encoding -eofchar -inputmode -profile -translation} set testnum 0 foreach {opt result} { -blocking 1 -buffering line -buffersize 4096 -encoding utf-16 -inputmode normal -translation auto } { test console-fconfigure-get-1.[incr testnum] "Console get stdin option $opt" \ -constraints {win interactive} -body { fconfigure stdin $opt } -result $result } test console-fconfigure-get-1.[incr testnum] { Console get stdin option -eofchar } -constraints {win interactive} -body { fconfigure stdin -eofchar } -result "" test console-fconfigure-get-1.[incr testnum] { fconfigure -winsize } -constraints {win interactive} -body { fconfigure stdin -winsize } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -profile, -translation, or -inputmode} -returnCodes error ## fconfigure get stdout/stderr foreach chan {stdout stderr} major {2 3} { test console-fconfigure-get-$major.0 "Console get $chan configuration" -constraints { win interactive } -body { lsort [dict keys [fconfigure $chan]] } -result {-blocking -buffering -buffersize -encoding -eofchar -profile -translation -winsize} set testnum 0 foreach {opt result} { -blocking 1 -buffersize 4096 -encoding utf-16 -translation crlf } { test console-fconfigure-get-$major.[incr testnum] "Console get $chan option $opt" \ -constraints {win interactive} -body { fconfigure $chan $opt } -result $result } test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -winsize" \ -constraints {win interactive} -body { fconfigure $chan -winsize } -result {\d+ \d+} -match regexp test console-fconfigure-get-$major.[incr testnum] "Console get $chan option -buffering" \ -constraints {win interactive} -body { fconfigure $chan -buffering } -result [expr {$chan eq "stdout" ? "line" : "none"}] test console-fconfigure-get-$major.[incr testnum] { fconfigure -inputmode } -constraints {win interactive} -body { fconfigure $chan -inputmode } -result {bad option "-inputmode": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -profile, -translation, or -winsize} -returnCodes error } ## fconfigure set stdin test console-fconfigure-set-1.0 { fconfigure -inputmode password } -constraints {win interactive} -body { set result {} prompt "Type \"pass\" and hit Enter. You should NOT see characters echoed: " fconfigure stdin -inputmode password lappend result [gets stdin] lappend result [fconfigure stdin -inputmode] fconfigure stdin -inputmode normal lappend result [yesno "\nWere the characters echoed?"] prompt "Type \"norm\" and hit Enter. You should see characters echoed: " lappend result [gets stdin] lappend result [fconfigure stdin -inputmode] lappend result [yesno "Were the characters echoed?"] set result } -result [list pass password 0 norm normal 1] test console-fconfigure-set-1.1 { fconfigure -inputmode raw } -constraints {win interactive} -body { set result {} prompt "Type the keys \"a\", Ctrl-H, \"b\". Do NOT hit Enter. You should NOT see characters echoed: " fconfigure stdin -inputmode raw lappend result [read stdin 3] lappend result [fconfigure stdin -inputmode] fconfigure stdin -inputmode normal lappend result [yesno "\nWere the characters echoed?"] prompt "Type the keys \"c\", Ctrl-H, \"d\" and hit Enter. You should see characters echoed: " lappend result [gets stdin] lappend result [fconfigure stdin -inputmode] lappend result [yesno "Were the characters echoed (c replaced by d)?"] set result } -result [list a\x08b raw 0 d normal 1] test console-fconfigure-set-1.2 { fconfigure -inputmode reset } -constraints {win interactive} -body { set result {} prompt "Type \"pass\" and hit Enter. You should NOT see characters echoed: " fconfigure stdin -inputmode password lappend result [gets stdin] lappend result [fconfigure stdin -inputmode] fconfigure stdin -inputmode reset lappend result [yesno "\nWere the characters echoed?"] prompt "Type \"reset\" and hit Enter. You should see characters echoed: " lappend result [gets stdin] lappend result [fconfigure stdin -inputmode] lappend result [yesno "Were the characters echoed?"] set result } -result [list pass password 0 reset normal 1] test console-fconfigure-set-1.3 { fconfigure stdin -winsize } -constraints {win interactive} -body { fconfigure stdin -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -profile, -translation, or -inputmode} -returnCodes error ## fconfigure set stdout,stderr test console-fconfigure-set-2.0 { fconfigure stdout -winsize } -constraints {win interactive} -body { fconfigure stdout -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -profile, or -translation} -returnCodes error test console-fconfigure-set-3.0 { fconfigure stderr -winsize } -constraints {win interactive} -body { fconfigure stderr -winsize {10 30} } -result {bad option "-winsize": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, -profile, or -translation} -returnCodes error # Multiple threads test console-thread-input-1.0 {Get input in thread} -constraints { win interactive haveThread } -setup { set tid [thread::create] } -cleanup { thread::release $tid } -body { prompt "Type \"xyz\" and hit Enter: " thread::send $tid {gets stdin} } -result xyz test console-thread-output-1.0 {Output from thread} -constraints { win interactive haveThread } -setup { set tid [thread::create] } -cleanup { thread::release $tid } -body { thread::send $tid {puts [thread::id]} yesno "Did you see $tid printed?" } -result 1 ::tcltest::cleanupTests return tcl9.0.3/tests/while.test0000644000175000017500000003663015104661341014732 0ustar sergeisergei# Commands covered: while # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Basic "while" operation. catch {unset i} catch {unset a} test while-1.1 {TclCompileWhileCmd: missing test expression} -body { while } -returnCodes error -result {wrong # args: should be "while test command"} test while-1.2 {TclCompileWhileCmd: error in test expression} -body { set i 0 catch {while {$i<} break} return $::errorInfo } -cleanup { unset i } -match glob -result {*"while {$i<} break"} test while-1.3 {TclCompileWhileCmd: error in test expression} -body { while {"a"+"b"} {error "loop aborted"} } -returnCodes error -result {cannot use non-numeric string "a" as left operand of "+"} test while-1.4 {TclCompileWhileCmd: multiline test expr} -body { set value 1 while {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} { incr value break } return $value } -cleanup { unset value } -result {2} test while-1.5 {TclCompileWhileCmd: non-numeric boolean test expr} -body { set value 1 while {"true"} { incr value; if {$value > 5} { break; } } return $value } -cleanup { unset value } -result 6 test while-1.6 {TclCompileWhileCmd: test expr is enclosed in quotes} { set i 0 while "$i > 5" {} } {} test while-1.7 {TclCompileWhileCmd: missing command body} -body { set i 0 while {$i < 5} } -returnCodes error -result {wrong # args: should be "while test command"} test while-1.8 {TclCompileWhileCmd: error compiling command body} -body { set i 0 catch {while {$i < 5} {set}} return $::errorInfo } -match glob -cleanup { unset i } -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test while-1.9 {TclCompileWhileCmd: simple command body} -body { set a {} set i 1 while {$i<6} { if {$i==4} break set a [concat $a $i] incr i } return $a } -cleanup { unset a i } -result {1 2 3} test while-1.10 {TclCompileWhileCmd: command body in quotes} -body { set a {} set i 1 while {$i<6} "append a x; incr i" return $a } -cleanup { unset a i } -result {xxxxx} test while-1.11 {TclCompileWhileCmd: computed command body} -setup { catch {unset x1} catch {unset bb} catch {unset x2} } -body { set x1 {append a x1; } set bb {break} set x2 {; append a x2; incr i} set a {} set i 1 while {$i<6} $x1$bb$x2 return $a } -cleanup { unset x1 bb x2 a i } -result {x1} test while-1.12 {TclCompileWhileCmd: long command body} -body { set a {} set i 1 while {$i<6} { if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i } -result {1 2 3} test while-1.13 {TclCompileWhileCmd: while command result} -body { set i 0 set a [while {$i < 5} {incr i}] return $a } -cleanup { unset a i } -result {} test while-1.14 {TclCompileWhileCmd: while command result} -body { set i 0 set a [while {$i < 5} {if {$i==3} break; incr i}] return $a } -cleanup { unset a i } -result {} # Check "while" and "continue". test while-2.1 {continue tests} -body { set a {} set i 1 while {$i <= 4} { incr i if {$i == 3} continue set a [concat $a $i] } return $a } -cleanup { unset a i } -result {2 4 5} test while-2.2 {continue tests} -body { set a {} set i 1 while {$i <= 4} { incr i if {$i != 2} continue set a [concat $a $i] } return $a } -cleanup { unset a i } -result {2} test while-2.3 {continue tests, nested loops} -body { set msg {} set i 1 while {$i <= 4} { incr i set a 1 while {$a <= 2} { incr a if {$i>=3 && $a>=3} continue set msg [concat $msg "$i.$a"] } } return $msg } -cleanup { unset a i msg } -result {2.2 2.3 3.2 4.2 5.2} test while-2.4 {continue tests, long command body} -body { set a {} set i 1 while {$i<6} { if {$i==2} {incr i; continue} if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i } -result {1 3} # Check "while" and "break". test while-3.1 {break tests} -body { set a {} set i 1 while {$i <= 4} { if {$i == 3} break set a [concat $a $i] incr i } return $a } -cleanup { unset a i } -result {1 2} test while-3.2 {break tests, nested loops} -body { set msg {} set i 1 while {$i <= 4} { set a 1 while {$a <= 2} { if {$i>=2 && $a>=2} break set msg [concat $msg "$i.$a"] incr a } incr i } return $msg } -cleanup { unset a i msg } -result {1.1 1.2 2.1 3.1 4.1} test while-3.3 {break tests, long command body} -body { set a {} set i 1 while {$i<6} { if {$i==2} {incr i; continue} if {$i==5} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i==4} break if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i } -result {1 3} # Check "while" with computed command names. test while-4.1 {while and computed command names} -body { set i 0 set z while $z {$i < 10} { incr i } return $i } -cleanup { unset i z } -result 10 test while-4.2 {while (not compiled): missing test expression} -body { set z while $z } -returnCodes error -cleanup { unset z } -result {wrong # args: should be "while test command"} test while-4.3 {while (not compiled): error in test expression} -body { set i 0 set z while catch {$z {$i<} {set x 1}} return $::errorInfo } -match glob -cleanup { unset i z } -result {*"$z {$i<} {set x 1}"} test while-4.4 {while (not compiled): error in test expression} -body { set z while $z {"a"+"b"} {error "loop aborted"} } -returnCodes error -result {cannot use non-numeric string "a" as left operand of "+"} test while-4.5 {while (not compiled): multiline test expr} -body { set value 1 set z while $z {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} { incr value break } return $value } -cleanup { unset value z } -result {2} test while-4.6 {while (not compiled): non-numeric boolean test expr} -body { set value 1 set z while $z {"true"} { incr value; if {$value > 5} { break; } } return $value } -cleanup { unset value z } -result 6 test while-4.7 {while (not compiled): test expr is enclosed in quotes} -body { set i 0 set z while $z "$i > 5" {} } -cleanup { unset i z } -result {} test while-4.8 {while (not compiled): missing command body} -body { set i 0 set z while $z {$i < 5} } -returnCodes error -cleanup { unset i z } -result {wrong # args: should be "while test command"} test while-4.9 {while (not compiled): error compiling command body} -body { set i 0 set z while catch {$z {$i < 5} {set}} set ::errorInfo } -match glob -cleanup { unset i z } -result {wrong # args: should be "set varName ?newValue?" while *ing "set" ("while" body line 1) invoked from within "$z {$i < 5} {set}"} test while-4.10 {while (not compiled): simple command body} -body { set a {} set i 1 set z while $z {$i<6} { if {$i==4} break set a [concat $a $i] incr i } return $a } -cleanup { unset a i z } -result {1 2 3} test while-4.11 {while (not compiled): command body in quotes} -body { set a {} set i 1 set z while $z {$i<6} "append a x; incr i" return $a } -cleanup { unset a i z } -result {xxxxx} test while-4.12 {while (not compiled): computed command body} -setup { catch {unset x1} catch {unset bb} catch {unset x2} } -body { set z while set x1 {append a x1; } set bb {break} set x2 {; append a x2; incr i} set a {} set i 1 $z {$i<6} $x1$bb$x2 return $a } -cleanup { unset z x1 bb x2 a i } -result {x1} test while-4.13 {while (not compiled): long command body} -body { set a {} set z while set i 1 $z {$i<6} { if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i z } -result {1 2 3} test while-4.14 {while (not compiled): while command result} -body { set i 0 set z while set a [$z {$i < 5} {incr i}] return $a } -cleanup { unset a i z } -result {} test while-4.15 {while (not compiled): while command result} -body { set i 0 set z while set a [$z {$i < 5} {if {$i==3} break; incr i}] return $a } -cleanup { unset a i z } -result {} # Check "break" with computed command names. test while-5.1 {break and computed command names} -body { set i 0 set z break while 1 { if {$i > 10} $z incr i } return $i } -cleanup { unset i z } -result 11 test while-5.2 {break tests with computed command names} -body { set a {} set i 1 set z break while {$i <= 4} { if {$i == 3} $z set a [concat $a $i] incr i } return $a } -cleanup { unset a i z } -result {1 2} test while-5.3 {break tests, nested loops with computed command names} -body { set msg {} set i 1 set z break while {$i <= 4} { set a 1 while {$a <= 2} { if {$i>=2 && $a>=2} $z set msg [concat $msg "$i.$a"] incr a } incr i } return $msg } -cleanup { unset a i z msg } -result {1.1 1.2 2.1 3.1 4.1} test while-5.4 {break tests, long command body with computed command names} -body { set a {} set i 1 set z break while {$i<6} { if {$i==2} {incr i; continue} if {$i==5} $z if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i==4} $z if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i z } -result {1 3} # Check "continue" with computed command names. test while-6.1 {continue and computed command names} -body { set i 0 set z continue while 1 { incr i if {$i < 10} $z break } return $i } -cleanup { unset i z } -result 10 test while-6.2 {continue tests} -body { set a {} set i 1 set z continue while {$i <= 4} { incr i if {$i == 3} $z set a [concat $a $i] } return $a } -cleanup { unset a i z } -result {2 4 5} test while-6.3 {continue tests with computed command names} -body { set a {} set i 1 set z continue while {$i <= 4} { incr i if {$i != 2} $z set a [concat $a $i] } return $a } -cleanup { unset a i z } -result {2} test while-6.4 {continue tests, nested loops with computed command names} -body { set msg {} set i 1 set z continue while {$i <= 4} { incr i set a 1 while {$a <= 2} { incr a if {$i>=3 && $a>=3} $z set msg [concat $msg "$i.$a"] } } return $msg } -cleanup { unset a i z msg } -result {2.2 2.3 3.2 4.2 5.2} test while-6.5 {continue tests, long command body with computed command names} -body { set a {} set i 1 set z continue while {$i<6} { if {$i==2} {incr i; continue} if {$i==4} break if {$i>5} $z if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] incr i } return $a } -cleanup { unset a i z } -result {1 3} # Test for incorrect "double evaluation" semantics test while-7.1 {delayed substitution of body} -body { set i 0 while {[incr i] < 10} " set result $i " proc p {} { set i 0 while {[incr i] < 10} " set result $i " return $result } append result [p] } -cleanup { unset result i } -result {00} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/while-old.test0000644000175000017500000000642515104661341015505 0ustar sergeisergei# Commands covered: while # # This file contains the original set of tests for Tcl's while command. # Since the while command is now compiled, a new set of tests covering # the new implementation is in the file "while.test". Sourcing this file # into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test while-old-1.1 {basic while loops} { set count 0 while {$count < 10} {set count [expr {$count + 1}]} set count } 10 test while-old-1.2 {basic while loops} { set value xxx while {2 > 3} {set value yyy} set value } xxx test while-old-1.3 {basic while loops} { set value 1 while {"true"} { incr value; if {$value > 5} { break; } } set value } 6 test while-old-1.4 {basic while loops, multiline test expr} { set value 1 while {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} { incr value break } set value } {2} test while-old-1.5 {basic while loops, test expr in quotes} { set value 1 while "0 < 3" {set value 2; break} set value } {2} test while-old-2.1 {continue in while loop} { set list {1 2 3 4 5} set index 0 set result {} while {$index < 5} { if {$index == 2} {set index [expr {$index + 1}]; continue} set result [concat $result [lindex $list $index]] set index [expr {$index + 1}] } set result } {1 2 4 5} test while-old-3.1 {break in while loop} { set list {1 2 3 4 5} set index 0 set result {} while {$index < 5} { if {$index == 3} break set result [concat $result [lindex $list $index]] set index [expr {$index + 1}] } set result } {1 2 3} test while-old-4.1 {errors in while loops} { set err [catch {while} msg] list $err $msg } {1 {wrong # args: should be "while test command"}} test while-old-4.2 {errors in while loops} { set err [catch {while 1} msg] list $err $msg } {1 {wrong # args: should be "while test command"}} test while-old-4.3 {errors in while loops} { set err [catch {while 1 2 3} msg] list $err $msg } {1 {wrong # args: should be "while test command"}} test while-old-4.4 {errors in while loops} { set err [catch {while {"a"+"b"} {error "loop aborted"}} msg] list $err $msg } {1 {cannot use non-numeric string "a" as left operand of "+"}} test while-old-4.5 {errors in while loops} { catch {unset x} set x 1 set err [catch {while {$x} {set x foo}} msg] list $err $msg } {1 {expected boolean value but got "foo"}} test while-old-4.6 {errors in while loops} { set err [catch {while {1} {error "loop aborted"}} msg] list $err $msg $::errorInfo } {1 {loop aborted} {loop aborted while executing "error "loop aborted""}} test while-old-5.1 {while return result} { while {0} {set a 400} } {} test while-old-5.2 {while return result} { set x 1 while {$x} {set x 0} } {} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/var.test0000644000175000017500000017350115104661341014411 0ustar sergeisergei# This file contains tests for the tclVar.c source file. Tests appear in the # same order as the C code that they test. The set of tests is currently # incomplete since it currently includes only new tests for code changed for # the addition of Tcl namespaces. Other variable-related tests appear in # several other test files including namespace.test, set.test, trace.test, and # upvar.test. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testupvar [llength [info commands testupvar]] testConstraint testgetvarfullname [llength [info commands testgetvarfullname]] testConstraint testsetnoerr [llength [info commands testsetnoerr]] testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc getbytes {} { return [lindex [split [memory info] \n] 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } catch {rename p ""} catch {namespace delete test_ns_var} catch {unset xx} catch {unset x} catch {unset y} catch {unset i} catch {unset a} catch {unset arr} test var-1.1 {TclLookupVar, Array handling} -setup { catch {unset a} } -body { set x "incr" ;# force no compilation and runtime call to Tcl_IncrCmd set i 10 set arr(foo) 37 list [$x i] $i [$x arr(foo)] $arr(foo) } -result {11 11 38 38} set ::x "global value" namespace eval test_ns_var { variable x "namespace value" } test var-1.2 {TclLookupVar, TCL_GLOBAL_ONLY implies global namespace var} { namespace eval test_ns_var { proc p {} { global x ;# specifies TCL_GLOBAL_ONLY to get global x return $x } } test_ns_var::p } {global value} test var-1.3 {TclLookupVar, TCL_NAMESPACE_ONLY implies namespace var} { namespace eval test_ns_var { proc q {} { variable x ;# specifies TCL_NAMESPACE_ONLY to get namespace x return $x } } test_ns_var::q } {namespace value} test var-1.4 {TclLookupVar, no active call frame implies global namespace var} { set x } {global value} test var-1.5 {TclLookupVar, active call frame pushed for namespace eval implies namespace var} { namespace eval test_ns_var {set x} } {namespace value} test var-1.6 {TclLookupVar, name starts with :: implies some namespace var} { namespace eval test_ns_var {set ::x} } {global value} test var-1.7 {TclLookupVar, error finding namespace var} -body { set a:::b } -returnCodes error -result {can't read "a:::b": no such variable} test var-1.8 {TclLookupVar, error finding namespace var} -body { set ::foobarfoo } -returnCodes error -result {can't read "::foobarfoo": no such variable} test var-1.9 {TclLookupVar, create new namespace var} { namespace eval test_ns_var { set v hello } } {hello} test var-1.10 {TclLookupVar, create new namespace var} -setup { catch {unset y} } -body { namespace eval test_ns_var { set ::y 789 } set y } -result {789} test var-1.11 {TclLookupVar, error creating new namespace var} -body { namespace eval test_ns_var { set ::test_ns_var::foo::bar 314159 } } -returnCodes error -result {can't set "::test_ns_var::foo::bar": parent namespace doesn't exist} test var-1.12 {TclLookupVar, error creating new namespace var} -body { namespace eval test_ns_var { set ::test_ns_var::foo:: 1997 } } -returnCodes error -result {can't set "::test_ns_var::foo::": parent namespace doesn't exist} test var-1.13 {TclLookupVar, new namespace var is created in a particular namespace} { catch {unset aNeWnAmEiNnS} namespace eval test_ns_var { namespace eval test_ns_var2::test_ns_var3 { set aNeWnAmEiNnS 77777 } # namespace which builds a name by traversing nsPtr chain to :: namespace which -variable test_ns_var2::test_ns_var3::aNeWnAmEiNnS } } {::test_ns_var::test_ns_var2::test_ns_var3::aNeWnAmEiNnS} test var-1.14 {TclLookupVar, namespace code ignores ":"s in middle and end of var names} { namespace eval test_ns_var { set : 123 set v: 456 set x:y: 789 list [set :] [set v:] [set x:y:] \ ${:} ${v:} ${x:y:} \ [expr {":" in [info vars]}] \ [expr {"v:" in [info vars]}] \ [expr {"x:y:" in [info vars]}] } } {123 456 789 123 456 789 1 1 1} test var-1.15 {TclLookupVar, resurrect variable via upvar to deleted namespace: compiled code path} { namespace eval test_ns_var { variable foo 2 } proc p {} { variable ::test_ns_var::foo lappend result [catch {set foo} msg] $msg namespace delete ::test_ns_var lappend result [catch {set foo 3} msg] $msg lappend result [catch {set foo(3) 3} msg] $msg } p } {0 2 1 {can't set "foo": upvar refers to variable in deleted namespace} 1 {can't set "foo(3)": upvar refers to variable in deleted namespace}} test var-1.16 {TclLookupVar, resurrect variable via upvar to deleted namespace: uncompiled code path} { namespace eval test_ns_var { variable result namespace eval subns { variable foo 2 } upvar 0 subns::foo foo lappend result [catch {set foo} msg] $msg namespace delete subns lappend result [catch {set foo 3} msg] $msg lappend result [catch {set foo(3) 3} msg] $msg namespace delete [namespace current] set result } } {0 2 1 {can't set "foo": upvar refers to variable in deleted namespace} 1 {can't set "foo(3)": upvar refers to variable in deleted namespace}} test var-1.17 {TclLookupVar, resurrect array element via upvar to deleted array: compiled code path} { namespace eval test_ns_var { variable result proc p {} { array set x {1 2 3 4} upvar 0 x(1) foo lappend result [catch {set foo} msg] $msg unset x lappend result [catch {set foo 3} msg] $msg } set result [p] namespace delete [namespace current] set result } } {0 2 1 {can't set "foo": upvar refers to element in deleted array}} test var-1.18 {TclLookupVar, resurrect array element via upvar to deleted array: uncompiled code path} -setup { unset -nocomplain test_ns_var::x } -body { namespace eval test_ns_var { variable result {} variable x array set x {1 2 3 4} upvar 0 x(1) foo lappend result [catch {set foo} msg] $msg unset x lappend result [catch {set foo 3} msg] $msg namespace delete [namespace current] set result } } -result {0 2 1 {can't set "foo": upvar refers to element in deleted array}} test var-1.19 {TclLookupVar, right error message when parsing variable name} -body { [format set] thisvar(doesntexist) } -returnCodes error -result {can't read "thisvar(doesntexist)": no such variable} test var-1.20 {TclLookupVar, regression on utf-8 variable names} -setup { proc p [list € ä] {info vars} } -body { # test variable with non-ascii name is available (euro and a-uml chars here): list \ [p 1 2] \ [apply [list [list € ä] {info vars}] 1 2] \ [apply [list [list [list € €] [list ä ä]] {info vars}]] \ } -cleanup { rename p {} } -result [lrepeat 3 [list € ä]] test var-1.21 {TclLookupVar, regression on utf-8 variable names} -setup { proc p [list [list € v€] [list ä vä]] {list [set €] [set ä]} } -body { # test variable with non-ascii name (and default) is resolvable (euro and a-uml chars here): list \ [p] \ [apply [list [list € ä] {list [set €] [set ä]}] v€ vä] \ [apply [list [list [list € v€] [list ä vä]] {list [set €] [set ä]}]] \ } -cleanup { rename p {} } -result [lrepeat 3 [list v€ vä]] test var-2.1 {Tcl_LappendObjCmd, create var if new} { catch {unset x} lappend x 1 2 } {1 2} test var-3.1 {MakeUpvar, TCL_NAMESPACE_ONLY not specified for other var} -setup { catch {unset x} } -body { set x 1997 proc p {} { global x ;# calls MakeUpvar with TCL_NAMESPACE_ONLY for other var x return $x } p } -result {1997} test var-3.2 {MakeUpvar, other var has TCL_NAMESPACE_ONLY specified} { namespace eval test_ns_var { catch {unset v} variable v 1998 proc p {} { variable v ;# TCL_NAMESPACE_ONLY specified for other var x return $v } p } } {1998} test var-3.3 {MakeUpvar, my var has TCL_GLOBAL_ONLY specified} -setup { catch {unset a} } -constraints testupvar -body { set a 123321 proc p {} { # create global xx linked to global a testupvar 1 a {} xx global } list [p] $xx [set xx 789] $a } -result {{} 123321 789 789} test var-3.4 {MakeUpvar, my var has TCL_NAMESPACE_ONLY specified} -setup { catch {unset a} } -constraints testupvar -body { set a 456 namespace eval test_ns_var { catch {unset ::test_ns_var::vv} proc p {} { # create namespace var vv linked to global a testupvar 2 a {} vv namespace } p } # Modified: that should create a global var according to the docs! list $test_ns_var::vv [set test_ns_var::vv 123] $a } -result {456 123 123} test var-3.5 {MakeUpvar, no call frame so my var will be in global :: ns} -setup { catch {unset aaaaa} catch {unset xxxxx} } -body { set aaaaa 77777 upvar #0 aaaaa xxxxx list [set xxxxx] [set aaaaa] } -result {77777 77777} test var-3.6 {MakeUpvar, active call frame pushed for namespace eval} -setup { catch {unset a} } -body { set a 121212 namespace eval test_ns_var { upvar ::a vvv set vvv } } -result {121212} test var-3.7 {MakeUpvar, my var has ::s} -setup { catch {unset a} } -body { set a 789789 upvar #0 a test_ns_var::lnk namespace eval test_ns_var { set lnk } } -result {789789} test var-3.8 {MakeUpvar, my var already exists in global ns} -setup { upvar #0 aaaaa xxxxx catch {unset aaaaa} catch {unset xxxxx} } -body { set aaaaa 456654 set xxxxx hello upvar #0 aaaaa xxxxx set xxxxx } -result {hello} test var-3.9 {MakeUpvar, my var has invalid ns name} -setup { catch {unset aaaaa} } -returnCodes error -body { set aaaaa 789789 upvar #0 aaaaa test_ns_fred::lnk } -cleanup { unset ::aaaaa } -result {can't create "test_ns_fred::lnk": parent namespace doesn't exist} test var-3.10 {MakeUpvar, between namespaces} -body { namespace eval {} { variable bar 0 namespace eval foo upvar bar bar set foo::bar 1 list $bar $foo::bar } } -result {1 1} test var-3.11 {MakeUpvar, my var looks like array elem} -setup { catch {unset aaaaa} } -returnCodes error -body { set aaaaa 789789 upvar #0 aaaaa foo(bar) } -result {bad variable name "foo(bar)": can't create a scalar variable that looks like an array element} test var-4.1 {Tcl_GetVariableName, global variable} testgetvarfullname { catch {unset a} set a 123 testgetvarfullname a global } ::a test var-4.2 {Tcl_GetVariableName, namespace variable} testgetvarfullname { namespace eval test_ns_var { variable george testgetvarfullname george namespace } } ::test_ns_var::george test var-4.3 {Tcl_GetVariableName, variable can't be array element} -setup { catch {unset a} } -constraints testgetvarfullname -body { set a(1) foo testgetvarfullname a(1) global } -returnCodes error -result {unknown variable "a(1)"} test var-5.1 {Tcl_GetVariableFullName, global variable} -setup { catch {unset a} } -body { set a bar namespace which -variable a } -result {::a} test var-5.2 {Tcl_GetVariableFullName, namespace variable} { namespace eval test_ns_var { variable martha namespace which -variable martha } } {::test_ns_var::martha} test var-5.3 {Tcl_GetVariableFullName, namespace variable} -setup { namespace eval test_ns_var {variable martha} } -body { namespace which -variable test_ns_var::martha } -result {::test_ns_var::martha} test var-6.1 {Tcl_GlobalObjCmd, variable is qualified by a namespace name} { namespace eval test_ns_var { variable boeing 777 } apply {{} { global ::test_ns_var::boeing set boeing }} } {777} test var-6.2 {Tcl_GlobalObjCmd, variable is qualified by a namespace name} { namespace eval test_ns_var { namespace eval test_ns_nested { variable java java } proc p {} { global ::test_ns_var::test_ns_nested::java set java } } test_ns_var::p } {java} test var-6.3 {Tcl_GlobalObjCmd, variable named {} qualified by a namespace name} { namespace eval ::test_ns_var::test_ns_nested {} set ::test_ns_var::test_ns_nested:: 24 apply {{} { global ::test_ns_var::test_ns_nested:: set {} }} } {24} test var-6.4 {Tcl_GlobalObjCmd, variable name matching :*} { # Test for Tcl Bug 480176 set :v broken proc p {} { global :v set :v fixed } p set :v } {fixed} test var-6.5 {Tcl_GlobalObjCmd, no-op case (TIP 323)} { global } {} test var-6.6 {Tcl_GlobalObjCmd, no-op case (TIP 323)} { proc p {} { global } p } {} test var-7.1 {Tcl_VariableObjCmd, create and initialize one new ns variable} -setup { catch {namespace delete test_ns_var} } -body { namespace eval test_ns_var { variable one 1 } list [info vars test_ns_var::*] [set test_ns_var::one] } -result {::test_ns_var::one 1} test var-7.2 {Tcl_VariableObjCmd, if new and no value, leave undefined} { set two 2222222 namespace eval test_ns_var { variable two } list [info exists test_ns_var::two] [catch {set test_ns_var::two} msg] $msg } {0 1 {can't read "test_ns_var::two": no such variable}} test var-7.3 {Tcl_VariableObjCmd, "define" var already created above} -setup { catch {namespace delete test_ns_var} namespace eval test_ns_var {variable one 1} } -body { namespace eval test_ns_var { variable two 2 } list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {set two}] } -result [list [lsort {::test_ns_var::two ::test_ns_var::one}] 2] test var-7.4 {Tcl_VariableObjCmd, list of vars} -setup { catch {namespace delete test_ns_var} namespace eval test_ns_var {variable one 1; variable two 2} } -body { namespace eval test_ns_var { variable three 3 four 4 } list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {expr {$three+$four}}] } -result [list [lsort {::test_ns_var::four ::test_ns_var::three ::test_ns_var::two ::test_ns_var::one}] 7] test var-7.5 {Tcl_VariableObjCmd, value for last var is optional} -setup { catch {unset a} catch {unset five} catch {unset six} } -body { set a "" set five 555 set six 666 namespace eval test_ns_var { variable five 5 six lappend ::a $five } lappend a $test_ns_var::five \ [set test_ns_var::six 6] [set test_ns_var::six] $six } -cleanup { catch {unset five} catch {unset six} } -result {5 5 6 6 666} test var-7.6 {Tcl_VariableObjCmd, variable name can be qualified} -setup { catch {unset newvar} } -body { namespace eval test_ns_var { variable ::newvar cheers! } return $newvar } -cleanup { catch {unset newvar} } -result {cheers!} test var-7.7 {Tcl_VariableObjCmd, bad var name} -returnCodes error -body { namespace eval test_ns_var { variable sev:::en 7 } } -result {can't define "sev:::en": parent namespace doesn't exist} test var-7.8 {Tcl_VariableObjCmd, if var already exists and no value is given, leave value unchanged} { set a "" namespace eval test_ns_var { variable eight 8 lappend ::a $eight variable eight lappend ::a $eight } set a } {8 8} test var-7.9 {Tcl_VariableObjCmd, mark as namespace var so var persists until namespace is destroyed or var is unset} -setup { catch {namespace delete test_ns_var2} } -body { set a "" namespace eval test_ns_var2 { variable x 123 variable y variable z } lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::x] [info exists test_ns_var2::y] \ [info exists test_ns_var2::z] lappend a [list [catch {set test_ns_var2::y} msg] $msg] lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [set test_ns_var2::y hello] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [list [catch {unset test_ns_var2::y} msg] $msg] lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [list [catch {unset test_ns_var2::z} msg] $msg] lappend a [namespace delete test_ns_var2] } -result [list [lsort {::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z}] 1 0 0\ {1 {can't read "test_ns_var2::y": no such variable}}\ [lsort {::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z}] 0 0\ hello 1 0\ {0 {}}\ [lsort {::test_ns_var2::x ::test_ns_var2::z}] 0 0\ {1 {can't unset "test_ns_var2::z": no such variable}}\ {}] test var-7.10 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} -setup { namespace eval test_ns_var { variable eight 8 } } -body { namespace eval test_ns_var { proc p {} { variable eight list [set eight] [info vars] } p } } -result {8 eight} test var-7.11 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} -setup { namespace eval test_ns_var { variable eight 8 } } -body { proc p {} { ;# note this proc is at global :: scope variable test_ns_var::eight list [set eight] [info vars] } p } -result {8 eight} test var-7.12 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} { namespace eval test_ns_var { variable {} {My name is empty} } proc p {} { ;# note this proc is at global :: scope variable test_ns_var:: list [set {}] [info vars] } p } {{My name is empty} {{}}} test var-7.13 {Tcl_VariableObjCmd, variable named ":"} { namespace eval test_ns_var { variable : {My name is ":"} proc p {} { variable : list [set :] [info vars] } p } } {{My name is ":"} :} test var-7.14 {Tcl_VariableObjCmd, array element parameter} -body { namespace eval test_ns_var { variable arrayvar(1) } } -returnCodes error -result "can't define \"arrayvar(1)\": name refers to an element in an array" test var-7.15 {Tcl_VariableObjCmd, array element parameter} -body { namespace eval test_ns_var { variable arrayvar set arrayvar(1) x variable arrayvar(1) y } } -returnCodes error -result "can't define \"arrayvar(1)\": name refers to an element in an array" test var-7.16 {Tcl_VariableObjCmd, no args (TIP 323)} { variable } {} test var-7.17 {Tcl_VariableObjCmd, no args (TIP 323)} { namespace eval test_ns_var { variable } } {} test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var names} -setup { catch {namespace delete test_ns_var} catch {unset a} } -body { namespace eval test_ns_var { variable v 123 variable info "" proc traceUnset {name1 name2 op} { variable info set info [concat $info [list $name1 $name2 $op]] } trace add var v unset [namespace code traceUnset] } list [unset test_ns_var::v] $test_ns_var::info } -result {{} {test_ns_var::v {} unset}} test var-8.2 {TclDeleteNamespaceVars, "unset" traces on ns delete are called with fully-qualified var names} -setup { catch {namespace delete test_ns_var} catch {unset a} } -body { set info "" namespace eval test_ns_var { variable v 123 1 trace add var v unset ::traceUnset } proc traceUnset {name1 name2 op} { set ::info [concat $::info [list $name1 $name2 $op]] } list [namespace delete test_ns_var] $::info } -result {{} {::test_ns_var::v {} unset}} test var-8.3 {TclDeleteNamespaceVars, mem leak} -constraints memory -setup { proc ::t {a i o} { set $a 321 } } -body { leaktest { namespace eval n { variable v 123 trace add variable v unset ::t } namespace delete n } } -cleanup { rename ::t {} } -result 0 test var-9.1 {behaviour of TclGet/SetVar simple get/set} -setup { catch {unset u} catch {unset v} } -constraints testsetnoerr -body { list \ [set u a; testsetnoerr u] \ [testsetnoerr v b] \ [testseterr u] \ [unset v; testseterr v b] } -result [list {before get a} {before set b} {before get a} {before set b}] test var-9.2 {behaviour of TclGet/SetVar namespace get/set} -setup { catch {namespace delete ns} } -constraints testsetnoerr -body { namespace eval ns {variable u a; variable v} list \ [testsetnoerr ns::u] \ [testsetnoerr ns::v b] \ [testseterr ns::u] \ [unset ns::v; testseterr ns::v b] } -result [list {before get a} {before set b} {before get a} {before set b}] test var-9.3 {behaviour of TclGetVar no variable} -setup { catch {unset u} } -constraints testsetnoerr -body { list \ [catch {testsetnoerr u} res] $res \ [catch {testseterr u} res] $res } -result {1 {before get} 1 {can't read "u": no such variable}} test var-9.4 {behaviour of TclGetVar no namespace variable} -setup { catch {namespace delete ns} } -constraints testsetnoerr -body { namespace eval ns {} list \ [catch {testsetnoerr ns::w} res] $res \ [catch {testseterr ns::w} res] $res } -result {1 {before get} 1 {can't read "ns::w": no such variable}} test var-9.5 {behaviour of TclGetVar no namespace} -setup { catch {namespace delete ns} } -constraints testsetnoerr -body { list \ [catch {testsetnoerr ns::u} res] $res \ [catch {testseterr ns::v} res] $res } -result {1 {before get} 1 {can't read "ns::v": no such variable}} test var-9.6 {behaviour of TclSetVar no namespace} -setup { catch {namespace delete ns} } -constraints testsetnoerr -body { list \ [catch {testsetnoerr ns::v 1} res] $res \ [catch {testseterr ns::v 1} res] $res } -result {1 {before set} 1 {can't set "ns::v": parent namespace doesn't exist}} test var-9.7 {behaviour of TclGetVar array variable} -setup { catch {unset arr} } -constraints testsetnoerr -body { set arr(1) 1 list \ [catch {testsetnoerr arr} res] $res \ [catch {testseterr arr} res] $res } -result {1 {before get} 1 {can't read "arr": variable is array}} test var-9.8 {behaviour of TclSetVar array variable} -setup { catch {unset arr} } -constraints testsetnoerr -body { set arr(1) 1 list \ [catch {testsetnoerr arr 2} res] $res \ [catch {testseterr arr 2} res] $res } -result {1 {before set} 1 {can't set "arr": variable is array}} test var-9.9 {behaviour of TclGetVar read trace success} -setup { catch {unset u} catch {unset v} } -constraints testsetnoerr -body { proc resetvar {val name elem op} {upvar 1 $name v; set v $val} set u 10 trace add var u read [list resetvar 1] trace add var v read [list resetvar 2] list \ [testsetnoerr u] \ [testseterr v] } -result {{before get 1} {before get 2}} test var-9.10 {behaviour of TclGetVar read trace error} testsetnoerr { proc writeonly args {error "write-only"} set v 456 trace add var v read writeonly list \ [catch {testsetnoerr v} msg] $msg \ [catch {testseterr v} msg] $msg } {1 {before get} 1 {can't read "v": write-only}} test var-9.11 {behaviour of TclSetVar write trace success} -setup { catch {unset u} catch {unset v} } -constraints testsetnoerr -body { proc doubleval {name elem op} {upvar 1 $name v; set v [expr {2 * $v}]} set v 1 trace add var v write doubleval trace add var u write doubleval list \ [testsetnoerr u 2] \ [testseterr v 3] } -result {{before set 4} {before set 6}} test var-9.12 {behaviour of TclSetVar write trace error} testsetnoerr { proc readonly args {error "read-only"} set v 456 trace add var v write readonly list \ [catch {testsetnoerr v 2} msg] $msg $v \ [catch {testseterr v 3} msg] $msg $v } {1 {before set} 2 1 {can't set "v": read-only} 3} test var-10.1 {can't nest arrays with array set} -setup { catch {unset arr} } -returnCodes error -body { array set arr(x) {a 1 b 2} } -result {can't set "arr(x)": variable isn't array} test var-10.2 {can't nest arrays with array set} -setup { catch {unset arr} } -returnCodes error -body { array set arr(x) {} } -result {can't set "arr(x)": variable isn't array} test var-11.1 {array unset} -setup { catch {unset a} } -body { array set a { 1,1 a 1,2 b 2,1 c 2,3 d } array unset a 1,* lsort -dict [array names a] } -result {2,1 2,3} test var-11.2 {array unset} -setup { catch {unset a} } -body { array set a { 1,1 a 1,2 b } array unset a array exists a } -result 0 test var-11.3 {array unset errors} -setup { catch {unset a} } -returnCodes error -body { array set a { 1,1 a 1,2 b } array unset a pattern too } -result {wrong # args: should be "array unset arrayName ?pattern?"} test var-12.1 {TclFindCompiledLocals, {} array name} { namespace eval n { proc p {} { variable {} set (0) 0 set (1) 1 set n 2 set ($n) 2 set ($n,foo) 2 } p lsort -dictionary [array names {}] } } {0 1 2 2,foo} test var-13.1 {Tcl_UnsetVar2, unset array with trace set on element} -setup { catch {unset t} } -body { proc foo {var ind op} { global t set foo bar } namespace eval :: { set t(1) 1 trace add variable t(1) unset foo unset t } set x "If you see this, it worked" } -result "If you see this, it worked" test var-13.2 {unset array with search, bug 46a2410650} -body { apply {{} { array set a {aa 11 bb 22 cc 33 dd 44 ee 55 ff 66} set s [array startsearch a] unset a([array nextelement a $s]) array nextelement a $s }} } -returnCodes error -result {couldn't find search "s-1-a"} test var-13.3 {unset array with search, SIGSEGV, bug 46a2410650} -body { apply {{} { array set a {aa 11 bb 22 cc 33 dd 44 ee 55 ff 66} set s [array startsearch a] unset a(ff) array nextelement a $s }} } -returnCodes error -result {couldn't find search "s-1-a"} test var-14.1 {array names syntax} -body { array names foo bar baz snafu } -returnCodes 1 -match glob -result * test var-14.2 {array names -glob} -body { array names tcl_platform -glob os } -result os test var-15.1 {segfault in [unset], [Bug 735335]} { proc A { name } { upvar $name var set var $name } # # Note that the variable name has to be # unused previously for the segfault to # be triggered. # namespace eval test A useSomeUnlikelyNameHere namespace eval test unset useSomeUnlikelyNameHere } {} test var-15.2 {compiled unset evaluation order, Bug 3970f54c4e} { apply {{} {unset foo [return ok]}} } ok test var-16.1 {CallVarTraces: save/restore interp error state} { trace add variable ::errorCode write " ;#" catch {error foo bar baz} trace remove variable ::errorCode write " ;#" set ::errorInfo } bar test var-17.1 {TclArraySet [Bug 1669489]} -setup { unset -nocomplain ::a } -body { namespace eval :: { set elements {1 2 3 4} trace add variable a write "string length \$elements ;#" array set a $elements } } -cleanup { unset -nocomplain ::a ::elements } -result {} test var-17.2 {TclArraySet Dict shortcut only on pure value} -setup { unset -nocomplain a d set d {p 1 p 2} dict get $d p set foo 0 } -body { trace add variable a write "[list incr [namespace which -variable foo]];#" array set a $d set foo } -cleanup { unset -nocomplain a d foo } -result 2 test var-18.1 {array unset and unset traces: Bug 2939073} -setup { set already 0 unset -nocomplain x } -body { array set x {e 1 i 1} trace add variable x unset {apply {args { global already x if {!$already} { set already 1 unset x(i) } }}} # The next command would crash reliably with memory debugging prior to the # bug fix. array unset x * array size x } -cleanup { unset x already } -result 0 test var-19.1 {crash when freeing locals hashtable: Bug 3037525} { proc foo {} { catch {upvar 0 dummy \$index} } foo ; # This crashes without the fix for the bug rename foo {} } {} test var-20.1 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { global x array set x {a 1} }} array size x } -result 1 test var-20.2 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { global x array set x {} }} array size x } -result 0 test var-20.3 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { array set ::x {a 1} }} array size x } -result 1 test var-20.4 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { array set ::x {} }} array size x } -result 0 test var-20.5 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { global x eval {array set x {a 1}} }} array size x } -result 1 test var-20.6 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { global x eval {array set x {}} }} array size x } -result 0 test var-20.7 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { eval {array set ::x {a 1}} }} array size x } -result 1 test var-20.8 {array set compilation correctness: Bug 3603163} -setup { unset -nocomplain x } -body { apply {{} { eval {array set ::x {}} }} array size x } -result 0 test var-20.9 {[bc1a96407a] array set compiled w/ trace} -setup { variable foo variable lambda unset -nocomplain lambda foo array set foo {} lappend lambda {} lappend lambda [list array set [namespace which -variable foo] {a 1}] } -body { after 0 [list apply $lambda] vwait [namespace which -variable foo] } -cleanup { unset -nocomplain lambda foo } -result {} test var-20.10 {[bc1a96407a] array set don't compile bad varname} -body { apply {{} {set name foo(bar); array set $name {a 1}}} } -returnCodes error -match glob -result * test var-20.11 {array set don't compile bad initializer} -setup { unset -nocomplain foo trace add variable foo array {set foo(bar) baz;#} } -body { catch {array set foo bad} set foo(bar) } -cleanup { unset -nocomplain foo } -result baz test var-20.12 {array set don't compile bad initializer} -setup { unset -nocomplain ::foo trace add variable ::foo array {set ::foo(bar) baz;#} } -body { catch {apply {{} { set value bad array set ::foo $value }}} set ::foo(bar) } -cleanup { unset -nocomplain ::foo } -result baz test var-21.0 {PushVarNameWord OBOE in compiled unset} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { set foo bar unset foo {*}{ } [return [incr n -[linenumber]]] }} [linenumber] } -cleanup { rename linenumber {} } -result 1 test var-22.0 {leak in array element unset: Bug a3309d01db} -setup { proc doit k { variable A set A($k) {} foreach n [array names A] { if {$n <= $k-1} { unset A($n) } } } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { doit $i set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { array unset A rename doit {} } -result 0 test var-22.1 {leak in localVarName internalrep: Bug 80304238ac} -setup { proc doit {} { interp create child child eval { proc doit script { eval $script set foo bar } doit {foreach foo baz {}} } interp delete child } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { doit set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { array unset A rename doit {} } -result 0 test var-22.2 {leak in parsedVarName} -constraints memory -body { set i 0 leaktest {lappend x($i)} } -cleanup { unset -nocomplain i x } -result 0 unset -nocomplain a k v test var-23.1 {array command, for loop, too many args} -returnCodes error -body { array for {k v} c d e {} } -result {wrong # args: should be "array for {key value} arrayName script"} test var-23.2 {array command, for loop, not enough args} -returnCodes error -body { array for {k v} {} } -result {wrong # args: should be "array for {key value} arrayName script"} test var-23.3 {array command, for loop, too many list args} -setup { unset -nocomplain a } -returnCodes error -body { array for {k v w} a {} } -result {must have two variable names} test var-23.4 {array command, for loop, not enough list args} -setup { unset -nocomplain a } -returnCodes error -body { array for {k} a {} } -result {must have two variable names} test var-23.5 {array command, for loop, no array} -setup { unset -nocomplain a } -returnCodes error -body { array for {k v} a {} } -result {"a" isn't an array} test var-23.6 {array command, for loop, array doesn't exist yet but has compiler-allocated procedure slot} -setup { catch {rename p ""} } -returnCodes error -body { apply {{x} { if {$x==1} { return [array for {k v} a {}] } set a(x) 123 }} 1 } -result {"a" isn't an array} test var-23.7 {array enumeration} -setup { unset -nocomplain a set reslist [list] } -body { array set a {a 1 b 2 c 3} array for {k v} a { lappend reslist $k $v } lsort -stride 2 -index 0 $reslist } -cleanup { unset -nocomplain a unset -nocomplain reslist } -result {a 1 b 2 c 3} test var-23.9 {array enumeration, nested} -setup { unset -nocomplain a set reslist [list] } -body { array set a {a 1 b 2 c 3} array for {k1 v1} a { lappend reslist $k1 $v1 set r2 {} array for {k2 v2} a { lappend r2 $k2 $v2 } lappend reslist [lsort -stride 2 -index 0 $r2] } # there is no guarantee in which order the array contents will be # returned. lsort -stride 3 -index 0 $reslist } -cleanup { unset -nocomplain a unset -nocomplain reslist } -result {a 1 {a 1 b 2 c 3} b 2 {a 1 b 2 c 3} c 3 {a 1 b 2 c 3}} test var-23.10 {array enumeration, delete key} -match glob -setup { unset -nocomplain a set reslist [list] } -body { set retval {} try { array set a {a 1 b 2 c 3 d 4} array for {k v} a { lappend reslist $k $v if { $k eq "a" } { unset a(c) } } lsort -stride 2 -index 0 $reslist } on error {err res} { set retval [dict get $res -errorinfo] } set retval } -cleanup { unset -nocomplain a unset -nocomplain reslist unset -nocomplain retval } -result {array changed during iteration*} test var-23.11 {array enumeration, insert key} -match glob -setup { unset -nocomplain a set reslist [list] } -body { set retval {} try { array set a {a 1 b 2 c 3 d 4} array for {k v} a { lappend reslist $k $v if { $k eq "a" } { set a(e) 5 } } lsort -stride 2 -index 0 $reslist } on error {err res} { set retval [dict get $res -errorinfo] } } -cleanup { unset -nocomplain a unset -nocomplain reslist } -result {array changed during iteration*} test var-23.12 {array enumeration, change value} -setup { unset -nocomplain a set reslist [list] } -body { array set a {a 1 b 2 c 3} array for {k v} a { lappend reslist $k $v if { $k eq "a" } { set a(c) 9 } } lsort -stride 2 -index 0 $reslist } -cleanup { unset -nocomplain a unset -nocomplain reslist } -result {a 1 b 2 c 9} test var-23.13 {array enumeration, number of traces} -setup { set ::countarrayfor 0 proc ::tracearrayfor { args } { incr ::countarrayfor } unset -nocomplain ::a set reslist [list] } -body { array set ::a {a 1 b 2 c 3} foreach {k} [array names a] { trace add variable ::a($k) read ::tracearrayfor } array for {k v} ::a { lappend reslist $k $v } set ::countarrayfor } -cleanup { unset -nocomplain ::countarrayfor unset -nocomplain ::a unset -nocomplain reslist } -result 3 test var-23.14 {array for, shared arguments} -setup { set vn {k v} unset -nocomplain $vn } -body { array set $vn {a 1 b 2 c 3} array for $vn $vn {} } -cleanup { unset -nocomplain $vn vn } -result {} test var-24.1 {array default set and get: interpreted} -setup { unset -nocomplain ary } -body { array set ary {a 3} array default set ary 7 list $ary(a) $ary(b) [info exist ary(a)] [info exist ary(b)] \ [array default get ary] } -cleanup { unset -nocomplain ary } -result {3 7 1 0 7} test var-24.2 {array default set and get: compiled} { apply {{} { array set ary {a 3} array default set ary 7 list $ary(a) $ary(b) [info exist ary(a)] [info exist ary(b)] \ [array default get ary] }} } {3 7 1 0 7} test var-24.3 {array default unset: interpreted} -setup { unset -nocomplain ary } -body { array set ary {a 3} array default set ary 7 list $ary(a) $ary(b) [array default unset ary] $ary(a) [catch {set ary(b)}] } -cleanup { unset -nocomplain ary } -result {3 7 {} 3 1} test var-24.4 {array default unset: compiled} { apply {{} { array set ary {a 3} array default set ary 7 list $ary(a) $ary(b) [array default unset ary] $ary(a) \ [catch {set ary(b)}] }} } {3 7 {} 3 1} test var-24.5 {array default exists: interpreted} -setup { unset -nocomplain ary result set result {} } -body { array set ary {a 3} lappend result [info exists ary],[array exists ary],[array default exists ary] array default set ary 7 lappend result [info exists ary],[array exists ary],[array default exists ary] array default unset ary lappend result [info exists ary],[array exists ary],[array default exists ary] unset ary lappend result [info exists ary],[array exists ary],[array default exists ary] array default set ary 11 lappend result [info exists ary],[array exists ary],[array default exists ary] } -cleanup { unset -nocomplain ary result } -result {1,1,0 1,1,1 1,1,0 0,0,0 1,1,1} test var-24.6 {array default exists: compiled} { apply {{} { array set ary {a 3} lappend result [info exists ary],[array exists ary],[array default exists ary] array default set ary 7 lappend result [info exists ary],[array exists ary],[array default exists ary] array default unset ary lappend result [info exists ary],[array exists ary],[array default exists ary] unset ary lappend result [info exists ary],[array exists ary],[array default exists ary] array default set ary 11 lappend result [info exists ary],[array exists ary],[array default exists ary] }} } {1,1,0 1,1,1 1,1,0 0,0,0 1,1,1} test var-24.7 {array default and append: interpreted} -setup { unset -nocomplain ary result set result {} } -body { array default set ary grill lappend result [array size ary] [info exist ary(x)] append ary(x) abc lappend result [array size ary] $ary(x) array default unset ary append ary(x) def append ary(y) ghi lappend result [array size ary] $ary(x) $ary(y) } -cleanup { unset -nocomplain ary result } -result {0 0 1 grillabc 2 grillabcdef ghi} test var-24.8 {array default and append: compiled} { apply {{} { array default set ary grill lappend result [array size ary] [info exist ary(x)] append ary(x) abc lappend result [array size ary] $ary(x) array default unset ary append ary(x) def append ary(y) ghi lappend result [array size ary] $ary(x) $ary(y) }} } {0 0 1 grillabc 2 grillabcdef ghi} test var-24.9 {array default and lappend: interpreted} -setup { unset -nocomplain ary result set result {} } -body { array default set ary grill lappend result [array size ary] [info exist ary(x)] lappend ary(x) abc lappend result [array size ary] $ary(x) array default unset ary lappend ary(x) def lappend ary(y) ghi lappend result [array size ary] $ary(x) $ary(y) } -cleanup { unset -nocomplain ary result } -result {0 0 1 {grill abc} 2 {grill abc def} ghi} test var-24.10 {array default and lappend: compiled} { apply {{} { array default set ary grill lappend result [array size ary] [info exist ary(x)] lappend ary(x) abc lappend result [array size ary] $ary(x) array default unset ary lappend ary(x) def lappend ary(y) ghi lappend result [array size ary] $ary(x) $ary(y) }} } {0 0 1 {grill abc} 2 {grill abc def} ghi} test var-24.11 {array default and incr: interpreted} -setup { unset -nocomplain ary result set result {} } -body { array default set ary 7 lappend result [array size ary] [info exist ary(x)] incr ary(x) 11 lappend result [array size ary] $ary(x) array default unset ary incr ary(x) incr ary(y) lappend result [array size ary] $ary(x) $ary(y) } -cleanup { unset -nocomplain ary result } -result {0 0 1 18 2 19 1} test var-24.12 {array default and incr: compiled} { apply {{} { array default set ary 7 lappend result [array size ary] [info exist ary(x)] incr ary(x) 11 lappend result [array size ary] $ary(x) array default unset ary incr ary(x) incr ary(y) lappend result [array size ary] $ary(x) $ary(y) }} } {0 0 1 18 2 19 1} test var-24.13 {array default and dict: interpreted} -setup { unset -nocomplain ary x y z } -body { array default set ary {x y} dict lappend ary(p) x z dict update ary(q) x y { set y z } dict with ary(r) { set x 123 } lsort -stride 2 -index 0 [array get ary] } -cleanup { unset -nocomplain ary x y z } -result {p {x {y z}} q {x z} r {x 123}} test var-24.14 {array default and dict: compiled} { lsort -stride 2 -index 0 [apply {{} { array default set ary {x y} dict lappend ary(p) x z dict update ary(q) x y { set y z } dict with ary(r) { set x 123 } array get ary }}] } {p {x {y z}} q {x z} r {x 123}} test var-24.15 {array default set and get: two-level} { apply {{} { array set ary {a 3} array default set ary 7 apply {{} { upvar 1 ary ary ary(c) c lappend result $ary(a) $ary(b) $c lappend result [info exist ary(a)] [info exist ary(b)] [info exist c] lappend result [array default get ary] }} }} } {3 7 7 1 0 0 7} test var-24.16 {array default set: errors} -setup { unset -nocomplain ary } -body { set ary not-an-array array default set ary 7 } -returnCodes error -cleanup { unset -nocomplain ary } -result {can't array default set "ary": variable isn't array} test var-24.17 {array default set: errors} -setup { unset -nocomplain ary } -body { array default set ary } -returnCodes error -cleanup { unset -nocomplain ary } -result * -match glob test var-24.18 {array default set: errors} -setup { unset -nocomplain ary } -body { array default set ary x y } -returnCodes error -cleanup { unset -nocomplain ary } -result * -match glob test var-24.19 {array default get: errors} -setup { unset -nocomplain ary } -body { set ary not-an-array array default get ary } -returnCodes error -cleanup { unset -nocomplain ary } -result {"ary" isn't an array} test var-24.20 {array default get: errors} -setup { unset -nocomplain ary } -body { array default get ary x y } -returnCodes error -cleanup { unset -nocomplain ary } -result * -match glob test var-24.21 {array default exists: errors} -setup { unset -nocomplain ary } -body { set ary not-an-array array default exists ary } -returnCodes error -cleanup { unset -nocomplain ary } -result {"ary" isn't an array} test var-24.22 {array default exists: errors} -setup { unset -nocomplain ary } -body { array default exists ary x } -returnCodes error -cleanup { unset -nocomplain ary } -result * -match glob test var-24.23 {array default unset: errors} -setup { unset -nocomplain ary } -body { set ary not-an-array array default unset ary } -returnCodes error -cleanup { unset -nocomplain ary } -result {"ary" isn't an array} test var-24.24 {array default unset: errors} -setup { unset -nocomplain ary } -body { array default unset ary x } -returnCodes error -cleanup { unset -nocomplain ary } -result * -match glob # The const command test var-25.1 {const: no argument} -body { apply {{} { const return $X }} } -returnCodes error -result {wrong # args: should be "const varName value"} test var-25.2 {const: single argument} -body { apply {{} { const X return $X }} } -returnCodes error -result {wrong # args: should be "const varName value"} test var-25.3 {const: two arguments (basic correct usage)} { apply {{} { set res [const X gorp] return [list $res $X] }} } {{} gorp} test var-25.4 {const: three arguments} -body { apply {{} { const X gorp foo return $X }} } -returnCodes error -result {wrong # args: should be "const varName value"} test var-25.5 {const: four arguments} -body { apply {{} { const X gorp foo bar return $X }} } -returnCodes error -result {wrong # args: should be "const varName value"} test var-26.1 {const: unmodifiable by set} -body { apply {{} { const X 123 set X gorp }} } -returnCodes error -result {can't set "X": variable is a constant} test var-26.2 {const: unmodifiable by append} -body { apply {{} { const X 123 append X gorp }} } -returnCodes error -result {can't set "X": variable is a constant} test var-26.3 {const: unmodifiable by lappend} -body { apply {{} { const X 123 lappend X gorp }} } -returnCodes error -result {can't set "X": variable is a constant} test var-26.4 {const: unmodifiable by incr} -body { apply {{} { const X 123 incr X }} } -returnCodes error -result {can't incr "X": variable is a constant} test var-26.5 {const: unmodifiable by dict set} -body { apply {{} { const X {a 123} dict set X a gorp }} } -returnCodes error -result {can't set "X": variable is a constant} test var-26.6 {const: unmodifiable by regsub} -body { apply {{} { const X abcabc regsub -all {a(.)} $X {\1\1} X }} } -returnCodes error -result {can't set "X": variable is a constant} test var-26.7 {const: unmodifiable by gets} -setup { set file [makeFile foo var26.7.txt] set f [open $file] } -body { apply {f { const X abcabc gets $f X }} $f } -returnCodes error -cleanup { close $f removeFile $file } -result {can't set "X": variable is a constant} test var-26.8 {const: may not be array} -body { apply {{} { array set X {a b} const X 1 return $X }} } -returnCodes error -result {can't make constant "X": variable is array} test var-26.9.1 {const: may not be array element} -body { apply {{} { array set X {a b} const X(a) 1 return $X(a) }} } -returnCodes error -result {can't make constant "X(a)": name refers to an element in an array} test var-26.9.2 {const: may not be array element} -body { apply {{} { array set X {a b} const X(b) 1 return $X(b) }} } -returnCodes error -result {can't make constant "X(b)": name refers to an element in an array} test var-26.10.1 {const: unmodifiable by const but not an error} { apply {{} { const X 1 const X 2 return $X }} } 1 test var-26.10.2 {const: unmodifiable by const but not an error} { apply {{} { lmap x {1 2 3} { const A 2 const B 3 const C 5 expr {$A * $x**2 + $B * $x + $C} } }} } {10 19 32} test var-26.11 {const: may not be unset} -body { apply {{} { const X 1 unset X }} } -returnCodes error -result {can't unset "X": variable is a constant} test var-26.12 {const: may not be unset, but -nocomplain doesn't complain} { apply {{} { const X 1 unset -nocomplain X return $X }} } 1 test var-26.13 {const and traces: write trace causes fail} -body { apply {{} { trace add variable X write {apply {args { error "ERR: $args" }}} const X gorp return $X }} } -returnCodes error -result {can't set "X": ERR: X {} write} test var-26.14 {const and traces: write trace err causes no const} -body { apply {{} { set trace {apply {args { error "ERR: $args" }}} trace add variable X write $trace catch { const X gorp } trace remove variable X write $trace set X 123 return $X }} } -result 123 test var-26.15 {const and traces: read traces} -setup { unset -nocomplain traces set traces {} } -body { apply {{} { trace add variable X read {apply {args { lappend ::traces $args }}} const X gorp list $X $X $::traces }} } -result {gorp gorp {{X {} read} {X {} read}}} -cleanup { unset -nocomplain traces } test var-26.16 {const and traces: write traces} -setup { unset -nocomplain traces set traces {} } -body { apply {{} { trace add variable X write {apply {args { lappend ::traces $args }}} const X gorp const X foo catch {set X bar} list $X $::traces }} } -result {gorp {{X {} write}}} -cleanup { unset -nocomplain traces } test var-26.17 {const and traces: unset traces} -setup { unset -nocomplain traces set traces {} } -body { list {*}[apply {{} { trace add variable X unset {apply {args { lappend ::traces $args }}} const X gorp unset -nocomplain X list $X $::traces }}] $traces } -result {gorp {} {{X {} unset}}} -cleanup { unset -nocomplain traces } # Same [const], but definitely not compiled test var-27.1 {const: unmodifiable by set} -body { apply {const { $const X 123 set X gorp }} const } -returnCodes error -result {can't set "X": variable is a constant} test var-27.2 {const: unmodifiable by append} -body { apply {const { $const X 123 append X gorp }} const } -returnCodes error -result {can't set "X": variable is a constant} test var-27.3 {const: unmodifiable by lappend} -body { apply {const { $const X 123 lappend X gorp }} const } -returnCodes error -result {can't set "X": variable is a constant} test var-27.4 {const: unmodifiable by incr} -body { apply {const { $const X 123 incr X }} const } -returnCodes error -result {can't incr "X": variable is a constant} test var-27.5 {const: unmodifiable by dict set} -body { apply {const { $const X {a 123} dict set X a gorp }} const } -returnCodes error -result {can't set "X": variable is a constant} test var-27.6 {const: unmodifiable by regsub} -body { apply {const { $const X abcabc regsub -all {a(.)} $X {\1\1} X }} const } -returnCodes error -result {can't set "X": variable is a constant} test var-27.7 {const: unmodifiable by gets} -setup { set file [makeFile foo var27.7.txt] set f [open $file] } -body { apply {{const f} { $const X abcabc gets $f X }} const $f } -returnCodes error -cleanup { close $f removeFile $file } -result {can't set "X": variable is a constant} test var-27.8 {const: may not be array} -body { apply {const { array set X {a b} $const X 1 return $X }} const } -returnCodes error -result {can't make constant "X": variable is array} test var-27.9.1 {const: may not be array element} -body { apply {const { array set X {a b} $const X(a) 1 return $X(a) }} const } -returnCodes error -result {can't make constant "X(a)": name refers to an element in an array} test var-27.9.2 {const: may not be array element} -body { apply {const { array set X {a b} $const X(b) 1 return $X(b) }} const } -returnCodes error -result {can't make constant "X(b)": name refers to an element in an array} test var-27.10.1 {const: unmodifiable by const but not an error} { apply {const { $const X 1 $const X 2 return $X }} const } 1 test var-27.10.2 {const: unmodifiable by const but not an error} { apply {const { lmap x {1 2 3} { $const A 2 $const B 3 $const C 5 expr {$A * $x**2 + $B * $x + $C} } }} const } {10 19 32} test var-27.11 {const: may not be unset} -body { apply {const { $const X 1 unset X }} const } -returnCodes error -result {can't unset "X": variable is a constant} test var-27.12 {const: may not be unset, but -nocomplain doesn't complain} { apply {const { $const X 1 unset -nocomplain X return $X }} const } 1 test var-27.13 {const and traces: write trace causes fail} -body { apply {const { trace add variable X write {apply {args { error "ERR: $args" }}} $const X gorp return $X }} const } -returnCodes error -result {can't set "X": ERR: X {} write} test var-27.14 {const and traces: write trace err causes no const} -body { apply {const { set trace {apply {args { error "ERR: $args" }}} trace add variable X write $trace catch { $const X gorp } trace remove variable X write $trace set X 123 return $X }} const } -result 123 test var-27.15 {const and traces: read traces} -setup { unset -nocomplain traces set traces {} } -body { apply {const { trace add variable X read {apply {args { lappend ::traces $args }}} $const X gorp list $X $X $::traces }} const } -result {gorp gorp {{X {} read} {X {} read}}} -cleanup { unset -nocomplain traces } test var-27.16 {const and traces: write traces} -setup { unset -nocomplain traces set traces {} } -body { apply {const { trace add variable X write {apply {args { lappend ::traces $args }}} $const X gorp $const X foo catch {set X bar} list $X $::traces }} const } -result {gorp {{X {} write}}} -cleanup { unset -nocomplain traces } test var-27.17 {const and traces: unset traces} -setup { unset -nocomplain traces set traces {} } -body { list {*}[apply {const { trace add variable X unset {apply {args { lappend ::traces $args }}} $const X gorp unset -nocomplain X list $X $::traces }} const] $traces } -result {gorp {} {{X {} unset}}} -cleanup { unset -nocomplain traces } test var-28.1 {const: in a namespace} -setup { namespace eval var28 {} } -body { namespace eval var28 { variable X const X gorp return $X } } -cleanup { namespace delete var28 } -result gorp test var-28.2 {const: in a namespace} -setup { namespace eval var28 {} } -body { namespace eval var28 { variable X const X gorp } apply {{} { variable X set X 123 } var28} } -cleanup { namespace delete var28 } -returnCodes error -result {can't set "X": variable is a constant} test var-28.3 {const: in a namespace} -setup { namespace eval var28 {} } -body { namespace eval var28 { variable X const X gorp } apply {{} { variable X unset X } var28} } -cleanup { namespace delete var28 } -returnCodes error -result {can't unset "X": variable is a constant} test var-28.4 {const: in a namespace} -setup { namespace eval var28 {} } -body { namespace eval var28 { variable X const X gorp } namespace delete var28 namespace eval var28 { variable X abc } apply {{} { variable X return $X } var28} } -cleanup { namespace delete var28 } -result abc test var-28.5 {const: in a namespace, direct access from proc} -setup { namespace eval var28 {} } -body { set result [apply {{} { const ::var28::X abc # Constant in namespace, NOT locally! info exists X }}] apply {res { variable X list $res [catch {unset X} msg] $msg $X } var28} $result } -cleanup { namespace delete var28 } -result {0 1 {can't unset "X": variable is a constant} abc} test var-29.1 {const: globally} -setup { set int [interp create] } -body { $int eval { const X gorp apply {{} { global X return $X }} } } -cleanup { interp delete $int } -result gorp test var-29.2 {const: TclOO variable resolution} -setup { oo::class create Parent } -body { oo::class create C { superclass Parent variable X constructor {} { const X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } set c [C new] list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Parent destroy } -result {123 {1 {can't set "X": variable is a constant}} {1 {can't unset "X": variable is a constant}} 1 X} test var-29.3 {const: TclOO variable resolution} -setup { oo::class create Parent } -body { oo::class create C { superclass Parent private variable X constructor {} { const X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } set c [C new] list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Parent destroy } -result {123 {1 {can't set "X": variable is a constant}} {1 {can't unset "X": variable is a constant}} 1 X} test var-29.4 {const: TclOO variable resolution} -setup { oo::class create Parent } -body { oo::class create C { superclass Parent variable X constructor {} { set X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X set X gorp } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } set c [C new] list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Parent destroy } -result {123 {0 abc} {0 gorp} 0 {}} test var-29.5 {const: TclOO variable resolution} -setup { set c [oo::object create Instance] } -body { oo::objdefine $c { variable X method init {} { const X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } $c init list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Instance destroy } -result {123 {1 {can't set "X": variable is a constant}} {1 {can't unset "X": variable is a constant}} 1 X} test var-29.6 {const: TclOO variable resolution} -setup { set c [oo::object create Instance] } -body { oo::objdefine $c { private variable X method init {} { const X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } $c init list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Instance destroy } -result {123 {1 {can't set "X": variable is a constant}} {1 {can't unset "X": variable is a constant}} 1 X} test var-29.7 {const: TclOO variable resolution} -setup { set c [oo::object create Instance] } -body { oo::objdefine $c { variable X method init {} { set X 123 } method checkRead {} { return $X } method checkWrite {} { list [catch { set X abc } msg] $msg } method checkUnset {} { list [catch { unset X set X gorp } msg] $msg } method checkProbe {} { info constant X } method checkList {} { info consts } } $c init list [$c checkRead] [$c checkWrite] [$c checkUnset] [$c checkProbe] [$c checkList] } -cleanup { Instance destroy } -result {123 {0 abc} {0 gorp} 0 {}} # The info constant and info consts commands test var-30.1 {info constant and info consts} { apply {{} { lappend consts [lsort [info consts]] [info constant X] const X 1 lappend consts [lsort [info consts]] [info constant X] const Y 2 lappend consts [lsort [info consts]] const X 3 lappend consts [lsort [info consts]] }} } {{} 0 X 1 {X Y} {X Y}} test var-30.2 {info constant and info consts} { apply {{} { lappend consts [lsort [info consts X]] const X 1 lappend consts [lsort [info consts X]] const Y 2 lappend consts [lsort [info consts X]] const X 3 lappend consts [lsort [info consts X]] }} } {{} X X X} test var-30.3 {info constant and info consts} { apply {{} { lappend consts [lsort [info consts ?]] const X 1 lappend consts [lsort [info consts ?]] const Y 2 lappend consts [lsort [info consts ?]] const XX 3 lappend consts [lsort [info consts ?]] }} } {{} X {X Y} {X Y}} test var-30.4 {info constant and info consts} { apply {{} { lappend consts [lsort [info consts X]] set X 1 lappend consts [lsort [info consts X]] set Y 2 lappend consts [lsort [info consts X]] set X 3 lappend consts [lsort [info consts X]] }} } {{} {} {} {}} test var-30.5 {info consts: in a namespace} -setup { namespace eval var30 {} } -body { namespace eval var30 { const X gorp info consts } } -cleanup { namespace delete var30 } -result X test var-30.6 {info consts: in a namespace} -setup { namespace eval var30 {} } -body { namespace eval var30 { const X gorp variable Y foo } info consts var30::* } -cleanup { namespace delete var30 } -result ::var30::X test var-30.7 {info constant: bad constant names: array element} { apply {{} { info constant a(b) }} } 0 test var-30.8 {info constant: bad constant names: array} { apply {{} { array set a {} info constant a }} } 0 test var-30.9 {info constant: bad constant names: no var} { apply {{} { info constant a }} } 0 test var-30.10 {info constant: bad constant names: no namespace} { apply {{} { info constant ::var29::no::such::ns::a }} } 0 test var-30.11 {info constant: bad constant names: dangling upvar} { apply {{} { upvar 0 no_var a info constant a }} } 0 test var-30.12 {info constant: bad constant names: bad name} { apply {{} { info constant a(b }} } 0 test var-30.13 {info constant: bad constant names: nesting} { apply {{} { array set b {c d} upvar 0 b(c) a info constant a(d) }} } 0 test var-31.1 {info constant: syntax} -returnCodes error -body { info constant } -result {wrong # args: should be "info constant varName"} test var-31.2 {info constant: syntax} -returnCodes error -body { info constant foo bar } -result {wrong # args: should be "info constant varName"} test var-31.3 {info consts: syntax} -returnCodes error -body { info consts foo bar } -result {wrong # args: should be "info consts ?pattern?"} catch {namespace delete ns} catch {unset arr} catch {unset v} catch {rename getbytes ""} catch {rename p ""} catch {namespace delete test_ns_var} catch {namespace delete test_ns_var2} catch {unset xx} catch {unset x} catch {unset y} catch {unset i} catch {unset a} catch {unset xxxxx} catch {unset aaaaa} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/util.test0000644000175000017500000020425615104661341014600 0ustar sergeisergei# This file is a Tcl script to test the code in the file tclUtil.c. # This file is organized in the standard fashion for Tcl tests. # # Copyright © 1995-1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint controversialNaN 1 testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testdstring [llength [info commands testdstring]] testConstraint testconcatobj [llength [info commands testconcatobj]] testConstraint testdoubledigits [llength [info commands testdoubledigits]] testConstraint testprint [llength [info commands testprint]] testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}] # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) binary scan \x00\x00\x00\x00\x00\x00\xF8\xFF d \ ieeeValues(-NaN) binary scan \xEF\xCD\xAB\x89\x67\x45\xFB\xFF d \ ieeeValues(-NaN(3456789abcdef)) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) binary scan \xFF\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-NaN) binary scan \xFF\xFB\x45\x67\x89\xAB\xCD\xEF d \ ieeeValues(-NaN(3456789abcdef)) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] proc convertDouble { x } { variable ieeeValues if { $ieeeValues(littleEndian) } { binary scan [binary format w $x] d result } else { binary scan [binary format W $x] d result } return $result } proc verdonk_test {sig binexp shouldbe exp} { regexp {([-+]?)([0-9a-f]+)} $sig -> signum sig scan $sig %llx sig if {$signum eq {-}} { set signum [expr {1<<63}] } else { set signum 0 } regexp {E([-+]?[0-9]+)} $binexp -> binexp set word [expr {$signum | (($binexp + 0x3ff)<<52)|($sig & ~(1<<52))}] binary scan [binary format w $word] q double regexp {([-+])(\d+)_(\d+)\&} $shouldbe -> signum digits1 digits2 regexp {E([-+]\d+)} $exp -> decexp incr decexp [expr {[string length $digits1] - 1}] lassign [testdoubledigits $double [string length $digits1] e] \ outdigits decpt outsign if {[string index $digits2 0] >= 5} { incr digits1 } if {$outsign != $signum || $outdigits != $digits1 || $decpt != $decexp} { return -code error "result is ${outsign}0.${outdigits}E$decpt\ should be ${signum}0.${digits1}E$decexp" } } test util-1.1 {TclFindElement procedure - binary element in middle of list} { lindex {0 foo\x00help 1} 1 } "foo\x00help" test util-1.2 {TclFindElement procedure - binary element at end of list} { lindex {0 foo\x00help} 1 } "foo\x00help" test util-2.1 {TclCopyAndCollapse procedure - normal string} { lindex {0 foo} 1 } {foo} test util-2.2 {TclCopyAndCollapse procedure - string with backslashes} { lindex {0 foo\n\x00help 1} 1 } "foo\n\x00help" test util-3.1 {Tcl_ScanCountedElement procedure - don't leave unmatched braces} { # This test checks for a very tricky feature. Any list element # generated with Tcl_ScanCountedElement and Tcl_ConvertElement must # have the property that it can be enclosing in curly braces to make # an embedded sub-list. If this property doesn't hold, then # Tcl_DStringStartSublist doesn't work. set x {} lappend x "# \\\{ \\" concat $x [llength "{$x}"] } {\#\ \\\{\ \\ 1} test util-3.2 {Tcl_ConverCountedElement procedure - quote leading '#'} { list # # a } {{#} # a} test util-3.3 {Tcl_ConverCountedElement procedure - quote leading '#'} { list #\{ # a } {\#\{ # a} test util-3.4 {Tcl_ConverCountedElement procedure - quote leading '#'} { proc # {} {return #} set result [eval [list #]] rename # {} set result } {#} test util-3.4.1 {Tcl_ConverCountedElement procedure - quote leading '#'} { proc # {} {return #} set cmd [list #] append cmd "" ;# force string rep generation set result [eval $cmd] rename # {} set result } {#} test util-3.5 {Tcl_ConverCountedElement procedure - quote leading '#'} { proc #\{ {} {return #} set result [eval [list #\{]] rename #\{ {} set result } {#} test util-3.5.1 {Tcl_ConverCountedElement procedure - quote leading '#'} { proc #\{ {} {return #} set cmd [list #\{] append cmd "" ;# force string rep generation set result [eval $cmd] rename #\{ {} set result } {#} test util-3.6 {Tcl_ConvertElement, Bug 3371644} { interp create #\\ interp alias {} x #\\ concat interp target {} x ;# Crash if bug not fixed interp delete #\\ } {} test util-4.1 {Tcl_ConcatObj - backslash-space at end of argument} { concat a {b\ } c } {a b\ c} test util-4.2 {Tcl_ConcatObj - backslash-space at end of argument} { concat a {b\ } c } {a b\ c} test util-4.3 {Tcl_ConcatObj - backslash-space at end of argument} { concat a {b\\ } c } {a b\\ c} test util-4.4 {Tcl_ConcatObj - backslash-space at end of argument} { concat a {b } c } {a b c} test util-4.5 {Tcl_ConcatObj - backslash-space at end of argument} { concat a { } c } {a c} test util-4.6 {Tcl_ConcatObj - utf-8 sequence with "whitespace" char} { # Check for Bug #227512. If this violates C isspace, then it returns \xC3. concat \xE0 } \xE0 test util-4.7 {Tcl_ConcatObj - refCount safety} testconcatobj { # Check for Bug #1447328 (actually, bugs in its original "fix"). One of the # symptoms was Bug #2055782. testconcatobj } {} test util-4.8 {Tcl_ConcatObj - [Bug 26649439c7]} { concat [list foo] [list #] } {foo {#}} proc Wrapper_Tcl_StringMatch {pattern string} { # Forces use of Tcl_StringMatch, not Tcl_UniCharCaseMatch switch -glob -- $string $pattern {return 1} default {return 0} } test util-5.1 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch ab*c abc } 1 test util-5.2 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch ab**c abc } 1 test util-5.3 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch ab* abcdef } 1 test util-5.4 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch *c abc } 1 test util-5.5 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch *3*6*9 0123456789 } 1 test util-5.6 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch *3*6*9 01234567890 } 0 test util-5.7 {Tcl_StringMatch: UTF-8} { Wrapper_Tcl_StringMatch *u 乏u } 1 test util-5.8 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch a?c abc } 1 test util-5.9 {Tcl_StringMatch: UTF-8} { # skip one character in string Wrapper_Tcl_StringMatch a?c a乏c } 1 test util-5.10 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch a??c abc } 0 test util-5.11 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch ?1??4???8? 0123456789 } 1 test util-5.12 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {[abc]bc} abc } 1 test util-5.13 {Tcl_StringMatch: UTF-8} { # string += Tcl_UtfToUniChar(string, &ch); Wrapper_Tcl_StringMatch "\[乏xy\]bc" "乏bc" } 1 test util-5.14 {Tcl_StringMatch} { # if ((*pattern == ']') || (*pattern == '\x00')) # badly formed pattern Wrapper_Tcl_StringMatch {[]} {[]} } 0 test util-5.15 {Tcl_StringMatch} { # if ((*pattern == ']') || (*pattern == '\x00')) # badly formed pattern Wrapper_Tcl_StringMatch {[} {[} } 0 test util-5.16 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {a[abc]c} abc } 1 test util-5.17 {Tcl_StringMatch: UTF-8} { # pattern += Tcl_UtfToUniChar(pattern, &endChar); # get 1 UTF-8 character Wrapper_Tcl_StringMatch "a\[a乏c]c" "a乏c" } 1 test util-5.18 {Tcl_StringMatch: UTF-8} testbytestring { # pattern += Tcl_UtfToUniChar(pattern, &endChar); # proper advance: wrong answer would match on UTF trail byte of 乏 Wrapper_Tcl_StringMatch {a[a乏c]c} [testbytestring a\x8Fc] } 0 test util-5.19 {Tcl_StringMatch: UTF-8} { # pattern += Tcl_UtfToUniChar(pattern, &endChar); # proper advance. Wrapper_Tcl_StringMatch {a[a乏c]c} "acc" } 1 test util-5.20 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {a[xyz]c} abc } 0 test util-5.21 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[2-7]45} 12345 } 1 test util-5.22 {Tcl_StringMatch: UTF-8 range} { Wrapper_Tcl_StringMatch "\[一-乏]" "0" } 0 test util-5.23 {Tcl_StringMatch: UTF-8 range} { Wrapper_Tcl_StringMatch "\[一-乏]" "丳" } 1 test util-5.24 {Tcl_StringMatch: UTF-8 range} { Wrapper_Tcl_StringMatch "\[一-乏]" "(" } 0 test util-5.25 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[ab2-4cd]45} 12345 } 1 test util-5.26 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[ab2-4cd]45} 12b45 } 1 test util-5.27 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[ab2-4cd]45} 12d45 } 1 test util-5.28 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[ab2-4cd]45} 12145 } 0 test util-5.29 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {12[ab2-4cd]45} 12545 } 0 test util-5.30 {Tcl_StringMatch: forwards range} { Wrapper_Tcl_StringMatch {[k-w]} "z" } 0 test util-5.31 {Tcl_StringMatch: forwards range} { Wrapper_Tcl_StringMatch {[k-w]} "w" } 1 test util-5.32 {Tcl_StringMatch: forwards range} { Wrapper_Tcl_StringMatch {[k-w]} "r" } 1 test util-5.33 {Tcl_StringMatch: forwards range} { Wrapper_Tcl_StringMatch {[k-w]} "k" } 1 test util-5.34 {Tcl_StringMatch: forwards range} { Wrapper_Tcl_StringMatch {[k-w]} "a" } 0 test util-5.35 {Tcl_StringMatch: reverse range} { Wrapper_Tcl_StringMatch {[w-k]} "z" } 0 test util-5.36 {Tcl_StringMatch: reverse range} { Wrapper_Tcl_StringMatch {[w-k]} "w" } 1 test util-5.37 {Tcl_StringMatch: reverse range} { Wrapper_Tcl_StringMatch {[w-k]} "r" } 1 test util-5.38 {Tcl_StringMatch: reverse range} { Wrapper_Tcl_StringMatch {[w-k]} "k" } 1 test util-5.39 {Tcl_StringMatch: reverse range} { Wrapper_Tcl_StringMatch {[w-k]} "a" } 0 test util-5.40 {Tcl_StringMatch: skip correct number of ']'} { Wrapper_Tcl_StringMatch {[A-]x} Ax } 0 test util-5.41 {Tcl_StringMatch: skip correct number of ']'} { Wrapper_Tcl_StringMatch {[A-]]x} Ax } 1 test util-5.42 {Tcl_StringMatch: skip correct number of ']'} { Wrapper_Tcl_StringMatch {[A-]]x} \xE1x } 0 test util-5.43 {Tcl_StringMatch: skip correct number of ']'} { Wrapper_Tcl_StringMatch \[A-]\xE1]x \xE1x } 1 test util-5.44 {Tcl_StringMatch: skip correct number of ']'} { Wrapper_Tcl_StringMatch {[A-]h]x} hx } 1 test util-5.45 {Tcl_StringMatch} { # if (*pattern == '\x00') # badly formed pattern, still treats as a set Wrapper_Tcl_StringMatch {[a} a } 1 test util-5.46 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {a\*b} a*b } 1 test util-5.47 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {a\*b} ab } 0 test util-5.48 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch {a\*\?\[\]\\\x} "a*?\[\]\\x" } 1 test util-5.49 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch ** "" } 1 test util-5.50 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch *. "" } 0 test util-5.51 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch "" "" } 1 test util-5.52 {Tcl_StringMatch} { Wrapper_Tcl_StringMatch \[a\x00 a\x80 } 0 test util-6.5 {Tcl_PrintDouble - make sure there's a decimal point} { concat x[expr {2.0}] } {x2.0} test util-6.6 {Tcl_PrintDouble - make sure there's a decimal point} { concat x[expr {3.0e98}] } {x3e+98} # This test always succeeded in the C locale anyway... test util-8.1 {TclNeedSpace - correct utf-8 handling} { # Bug 411825 # Note that this test relies on the fact that # [interp target] calls on Tcl_AppendElement() # which calls on TclNeedSpace(). If [interp target] # is ever updated, this test will no longer test # TclNeedSpace. interp create 吠 interp create [list 吠 foo] interp alias {} fooset [list 吠 foo] set set result [interp target {} fooset] interp delete 吠 set result } "吠 foo" test util-8.2 {TclNeedSpace - correct utf-8 handling} testdstring { # Bug 411825 # This tests the same bug as the previous test, but # should be more future-proof, as the DString # operations will likely continue to call TclNeedSpace testdstring free testdstring append 吠 -1 testdstring element foo llength [testdstring get] } 2 test util-8.3 {TclNeedSpace - correct utf-8 handling} testdstring { # Bug 411825 - new variant reported by Dossy Shiobara testdstring free testdstring append \xA0 -1 testdstring element foo llength [testdstring get] } 2 test util-8.4 {TclNeedSpace - correct utf-8 handling} testdstring { # Another bug uncovered while fixing 411825 testdstring free testdstring append {\ } -1 testdstring append \{ -1 testdstring element foo llength [testdstring get] } 2 test util-8.5 {TclNeedSpace - correct utf-8 handling} testdstring { testdstring free testdstring append {\\ } -1 testdstring element foo list [llength [testdstring get]] [string length [testdstring get]] } {2 6} test util-8.6 {TclNeedSpace - correct utf-8 handling} testdstring { testdstring free testdstring append {\\ } -1 testdstring append \{ -1 testdstring element foo testdstring append \} -1 list [llength [testdstring get]] [string length [testdstring get]] } {2 8} test util-8.7 {TclNeedSpace - watch out for escaped space} testdstring { testdstring free testdstring append {\ } -1 testdstring start testdstring end # Should make {\ {}} list [llength [testdstring get]] [string index [testdstring get] 3] } {2 \{} test util-8.8 {TclNeedSpace - watch out for escaped space} testdstring { testdstring free testdstring append {\\ } -1 testdstring start testdstring end # Should make {\\ {}} list [llength [testdstring get]] [string index [testdstring get] 3] } {2 \{} test util-8.9 {TclNeedSpace - watch out for escaped space} testdstring { testdstring free testdstring append {\\\ } -1 testdstring start testdstring end # Should make {\\\ {}} list [llength [testdstring get]] [string index [testdstring get] 5] } {2 \{} test util-8.10 {TclNeedSpace - watch out for escaped space} testdstring { testdstring free testdstring append {\\\\\\\ } -1 testdstring start testdstring end # Should make {\\\\\\\ {}} list [llength [testdstring get]] [string index [testdstring get] 9] } {2 \{} test util-8.11 {TclNeedSpace - watch out for escaped space} testdstring { testdstring free testdstring append {\\\\\\\\ } -1 testdstring start testdstring end # Should make {\\\\\\\\ {}} list [llength [testdstring get]] [string index [testdstring get] 9] } {2 \{} test util-9.0.0 {Tcl_GetIntForIndex} { string index abcd 0 } a test util-9.0.1 {Tcl_GetIntForIndex} { string index abcd 0x0 } a test util-9.0.2 {Tcl_GetIntForIndex} { string index abcd -0x0 } a test util-9.0.3 {Tcl_GetIntForIndex} { string index abcd { 0 } } a test util-9.0.4 {Tcl_GetIntForIndex} { string index abcd { 0x0 } } a test util-9.0.5 {Tcl_GetIntForIndex} { string index abcd { -0x0 } } a test util-9.0.6 {Tcl_GetIntForIndex} { string index abcd 01 } b test util-9.0.7 {Tcl_GetIntForIndex} { string index abcd { 01 } } b test util-9.0.8 {Tcl_GetIntForIndex} { string index abcd { 0d0 } } a test util-9.0.9 {Tcl_GetIntForIndex} { string index abcd { -0d0 } } a test util-9.1.0 {Tcl_GetIntForIndex} { string index abcd 3 } d test util-9.1.1 {Tcl_GetIntForIndex} { string index abcd { 3 } } d test util-9.1.2 {Tcl_GetIntForIndex} { string index abcdefghijk 0xa } k test util-9.1.3 {Tcl_GetIntForIndex} { string index abcdefghijk { 0xa } } k test util-9.1.4 {Tcl_GetIntForIndex} { string index abcdefghijk 0d10 } k test util-9.1.5 {Tcl_GetIntForIndex} { string index abcdefghijk { 0d10 } } k test util-9.2.0 {Tcl_GetIntForIndex} { string index abcd end } d test util-9.2.1 {Tcl_GetIntForIndex} -body { string index abcd { end} } -returnCodes error -match glob -result * test util-9.2.2 {Tcl_GetIntForIndex} -body { string index abcd {end } } -returnCodes error -match glob -result * test util-9.3 {Tcl_GetIntForIndex} -body { # Deprecated string index abcd en } -returnCodes error -match glob -result * test util-9.4 {Tcl_GetIntForIndex} -body { # Deprecated string index abcd e } -returnCodes error -match glob -result * test util-9.5.0 {Tcl_GetIntForIndex} { string index abcd end-1 } c test util-9.5.1 {Tcl_GetIntForIndex} { string index abcd {end-1 } } c test util-9.5.2 {Tcl_GetIntForIndex} -body { string index abcd { end-1} } -returnCodes error -match glob -result * test util-9.6 {Tcl_GetIntForIndex} { string index abcd end+-1 } c test util-9.7 {Tcl_GetIntForIndex} { string index abcd end+1 } {} test util-9.8 {Tcl_GetIntForIndex} { string index abcd end--1 } {} test util-9.9.0 {Tcl_GetIntForIndex} { string index abcd 0+0 } a test util-9.9.1 {Tcl_GetIntForIndex} { string index abcd { 0+0 } } a test util-9.10 {Tcl_GetIntForIndex} { string index abcd 0-0 } a test util-9.11 {Tcl_GetIntForIndex} { string index abcd 1+0 } b test util-9.12 {Tcl_GetIntForIndex} { string index abcd 1-0 } b test util-9.13 {Tcl_GetIntForIndex} { string index abcd 1+1 } c test util-9.14 {Tcl_GetIntForIndex} { string index abcd 1-1 } a test util-9.15 {Tcl_GetIntForIndex} { string index abcd -1+2 } b test util-9.16 {Tcl_GetIntForIndex} { string index abcd -1--2 } b test util-9.17 {Tcl_GetIntForIndex} { string index abcd { -1+2 } } b test util-9.18 {Tcl_GetIntForIndex} { string index abcd { -1--2 } } b test util-9.19 {Tcl_GetIntForIndex} -body { string index a {} } -returnCodes error -match glob -result * test util-9.20 {Tcl_GetIntForIndex} -body { string index a { } } -returnCodes error -match glob -result * test util-9.21 {Tcl_GetIntForIndex} -body { string index a " \r\t\n" } -returnCodes error -match glob -result * test util-9.22 {Tcl_GetIntForIndex} -body { string index a + } -returnCodes error -match glob -result * test util-9.23 {Tcl_GetIntForIndex} -body { string index a - } -returnCodes error -match glob -result * test util-9.24 {Tcl_GetIntForIndex} -body { string index a x } -returnCodes error -match glob -result * test util-9.25 {Tcl_GetIntForIndex} -body { string index a +x } -returnCodes error -match glob -result * test util-9.26 {Tcl_GetIntForIndex} -body { string index a -x } -returnCodes error -match glob -result * test util-9.27 {Tcl_GetIntForIndex} -body { string index a 0y } -returnCodes error -match glob -result * test util-9.28 {Tcl_GetIntForIndex} -body { string index a 1* } -returnCodes error -match glob -result * test util-9.29 {Tcl_GetIntForIndex} -body { string index a 0+ } -returnCodes error -match glob -result * test util-9.30 {Tcl_GetIntForIndex} -body { string index a {0+ } } -returnCodes error -match glob -result * test util-9.31 {Tcl_GetIntForIndex} -body { string index a 0x } -returnCodes error -match glob -result * test util-9.31.1 {Tcl_GetIntForIndex} -body { string index a 0d } -returnCodes error -match glob -result * test util-9.32 {Tcl_GetIntForIndex} -body { string index a 0x1FFFFFFFF+0 } -result {} test util-9.33 {Tcl_GetIntForIndex} -body { string index a 100000000000+0 } -result {} test util-9.33.1 {Tcl_GetIntForIndex} -body { string index a 0d100000000000+0 } -result {} test util-9.34 {Tcl_GetIntForIndex} -body { string index a 1.0 } -returnCodes error -match glob -result * test util-9.35 {Tcl_GetIntForIndex} -body { string index a 1e23 } -returnCodes error -match glob -result * test util-9.36 {Tcl_GetIntForIndex} -body { string index a 1.5e2 } -returnCodes error -match glob -result * test util-9.37 {Tcl_GetIntForIndex} -body { string index a 0+x } -returnCodes error -match glob -result * test util-9.38 {Tcl_GetIntForIndex} -body { string index a 0+0x } -returnCodes error -match glob -result * test util-9.39 {Tcl_GetIntForIndex} -body { string index a 0+0xg } -returnCodes error -match glob -result * test util-9.40 {Tcl_GetIntForIndex} -body { string index a 0+0xg } -returnCodes error -match glob -result * test util-9.41 {Tcl_GetIntForIndex} -body { string index a 0+1.0 } -returnCodes error -match glob -result * test util-9.42 {Tcl_GetIntForIndex} -body { string index a 0+1e2 } -returnCodes error -match glob -result * test util-9.43 {Tcl_GetIntForIndex} -body { string index a 0+1.5e1 } -returnCodes error -match glob -result * test util-9.44 {Tcl_GetIntForIndex} -body { string index a 0+1000000000000 } -result {} test util-9.45 {Tcl_GetIntForIndex} -body { string index abcd end+2305843009213693950 } -result {} test util-9.46 {Tcl_GetIntForIndex} -body { string index abcd end+4294967294 } -result {} # TIP 502 test util-9.47 {Tcl_GetIntForIndex} -body { string index abcd 0x10000000000000000 } -result {} test util-9.48 {Tcl_GetIntForIndex} { string index abcd -0x10000000000000000 } {} test util-9.49 {Tcl_GetIntForIndex} -body { string index abcd end*1 } -returnCodes error -match glob -result * test util-9.50 {Tcl_GetIntForIndex} -body { string index abcd {end- 1} } -returnCodes error -match glob -result * test util-9.51 {Tcl_GetIntForIndex} -body { string index abcd end-end } -returnCodes error -match glob -result * test util-9.52 {Tcl_GetIntForIndex} -body { string index abcd end-x } -returnCodes error -match glob -result * test util-9.53 {Tcl_GetIntForIndex} -body { string index abcd end-0.1 } -returnCodes error -match glob -result * test util-9.54 {Tcl_GetIntForIndex} { string index abcd end-0x10000000000000000 } {} test util-9.55 {Tcl_GetIntForIndex} -body { string index abcd end+0x10000000000000000 } -result {} test util-9.56 {Tcl_GetIntForIndex} -body { string index abcd end--0x10000000000000000 } -result {} test util-9.57 {Tcl_GetIntForIndex} { string index abcd end+-0x10000000000000000 } {} test util-9.58 {Tcl_GetIntForIndex} -body { string index abcd end--0x8000000000000000 } -result {} test util-9.59 {Tcl_GetIntForIndex} { string index abcd 0-0x10000000000000000 } {} test util-10.1 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x0000000000000000 } {0.0} test util-10.2 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x8000000000000000 } {-0.0} test util-10.3 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x7ef754e31cd072da } {4e+303} test util-10.4 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xd08afcef51f0fb5f } {-1e+80} test util-10.5 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x7ed754e31cd072da } {1e+303} test util-10.6 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xfee754e31cd072da } {-2e+303} test util-10.7 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x0afe07b27dd78b14 } {1e-255} test util-10.8 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x93ae29e9c56687fe } {-7e-214} test util-10.9 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x376be03d0bf225c7 } {1e-41} test util-10.10 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xa0ca2fe76a3f9475 } {-1e-150} test util-10.11 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x7fa9a2028368022e } {9e+306} test util-10.12 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdfc317e5ef3ab327 } {-2e+153} test util-10.13 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x5fd317e5ef3ab327 } {4e+153} test util-10.14 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdfe317e5ef3ab327 } {-8e+153} test util-10.15 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x00feb8e84fa0b278 } {7e-304} test util-10.16 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x8133339131c46f8b } {-7e-303} test util-10.17 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x35dc0f92a6276c9d } {3e-49} test util-10.18 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xa445ce1f143d7ad2 } {-6e-134} test util-10.19 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x2d2c0794d9d40e96 } {4.3e-91} test util-10.20 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xad3c0794d9d40e96 } {-8.6e-91} test util-10.21 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x30ecd5bee57763e6 } {5.1e-73} test util-10.22 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x68ad1c26db7d0dae } {1.7e+196} test util-10.23 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbfa3f7ced916872b } {-0.039} test util-10.24 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x64b7d93193f78fc6 } {1.51e+177} test util-10.25 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x98ea82a1631eeb30 } {-1.19e-188} test util-10.26 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xd216c309024bab4b } {-2.83e+87} test util-10.27 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x0dfdbbac6f83a821 } {2.7869147e-241} test util-10.28 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdadc569e968e0944 } {-4.91080654e+129} test util-10.29 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x5acc569e968e0944 } {2.45540327e+129} test util-10.30 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xab5fc575867314ee } {-9.078555839e-100} test util-10.31 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdabc569e968e0944 } {-1.227701635e+129} test util-10.32 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x2b6fc575867314ee } {1.8157111678e-99} test util-10.33 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xb3b8bf7e7fa6f02a } {-1.5400733123779e-59} test util-10.34 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xcd83de005bd620df } {-2.6153245263757307e+65} test util-10.35 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x6cdf92bacb3cb40c } {2.7210404151224248e+216} test util-10.36 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xecef92bacb3cb40c } {-5.4420808302448496e+216} test util-10.37 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x49342dbf25096cf5 } {4.5e+44} test util-10.38 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xd06afcef51f0fb5f } {-2.5e+79} test util-10.39 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x49002498ea6df0c4 } {4.5e+43} test util-10.40 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xfeb754e31cd072da } {-2.5e+302} test util-10.41 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x1d22deac01e2b4f7 } {2.5e-168} test util-10.42 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xaccb1df536c13eee } {-6.5e-93} test util-10.43 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3650711fed5b19a4 } {4.5e-47} test util-10.44 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xb6848d67e8b1e00d } {-4.5e-46} test util-10.45 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4bac8c574c0c6be7 } {3.5e+56} test util-10.46 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xccd756183c147514 } {-1.5e+62} test util-10.47 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4ca2ab469676c410 } {1.5e+61} test util-10.48 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xcf5539684e774b48 } {-1.5e+74} test util-10.49 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x2e12e5f5dfa4fe9d } {9.5e-87} test util-10.50 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x8b9bdc2417bf7787 } {-9.5e-253} test util-10.51 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x00eeb8e84fa0b278 } {3.5e-304} test util-10.52 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xadde3cbc9907fdc8 } {-9.5e-88} test util-10.53 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x2bb0ad836f269a17 } {3.05e-98} test util-10.54 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x950b39ae1909c31b } {-2.65e-207} test util-10.55 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x1bfb2ab18615fcc6 } {6.865e-174} test util-10.56 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x98f3e1f90a573064 } {-1.785e-188} test util-10.57 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x5206c309024bab4b } {1.415e+87} test util-10.58 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xcc059bd3ad46e346 } {-1.6955e+58} test util-10.59 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x47bdf4170f0fdecc } {3.9815e+37} test util-10.60 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x59e7e1e0f1c7a4ac } {1.263005e+125} test util-10.61 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xda1dda592e398dd7 } {-1.263005e+126} test util-10.62 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdc4e597c0b94b7ae } {-4.4118455e+136} test util-10.63 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x5aac569e968e0944 } {6.138508175e+128} test util-10.64 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xdabc569e968e0944 } {-1.227701635e+129} test util-10.65 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x6ce7ae0c186d8709 } {4.081560622683637e+216} test util-10.66 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x44b52d02c7e14af7 } {1.0000000000000001e+23} test util-10.67 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc589d971e4fe8402 } {-1e+27} test util-10.68 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4599d971e4fe8402 } {2e+27} test util-10.69 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc5a9d971e4fe8402 } {-4e+27} test util-10.70 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3e45798ee2308c3a } {1e-8} test util-10.71 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbe55798ee2308c3a } {-2e-8} test util-10.72 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3e65798ee2308c3a } {4e-8} test util-10.73 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbabef2d0f5da7dd9 } {-1e-25} test util-10.74 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x44da784379d99db4 } {5e+23} test util-10.75 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc4fa784379d99db4 } {-2e+24} test util-10.76 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4503da329b633647 } {3e+24} test util-10.77 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc54cf389cd46047d } {-7e+25} test util-10.78 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3fc999999999999a } {0.2} test util-10.79 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbfd3333333333333 } {-0.3} test util-10.80 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3cf6849b86a12b9b } {5e-15} test util-10.81 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbd16849b86a12b9b } {-2e-14} test util-10.82 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3b87ccfc73126788 } {6.3e-22} test util-10.83 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbbbdc03b8fd7016a } {-6.3e-21} test util-10.84 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3fa3f7ced916872b } {0.039} test util-10.85 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x460b297cad9f70b6 } {2.69e+29} test util-10.86 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc61b297cad9f70b6 } {-5.38e+29} test util-10.87 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3adcdc06b20ef183 } {3.73e-25} test util-10.88 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x45fb297cad9f70b6 } {1.345e+29} test util-10.89 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc60b297cad9f70b6 } {-2.69e+29} test util-10.90 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbc050a246ecd44f3 } {-1.4257e-19} test util-10.91 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbec19b96f36ec68b } {-2.09901e-6} test util-10.92 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3dcc06d366394441 } {5.0980203373e-11} test util-10.93 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc79f58ac4db68c90 } {-1.04166211811e+37} test util-10.94 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4569d971e4fe8402 } {2.5e+26} test util-10.95 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc50dc74be914d16b } {-4.5e+24} test util-10.96 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4534adf4b7320335 } {2.5e+25} test util-10.97 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc54ae22487c1042b } {-6.5e+25} test util-10.98 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3c987fe49aab41e0 } {8.5e-17} test util-10.99 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbc2f5c05e4b23fd7 } {-8.5e-19} test util-10.100 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3d5faa7ab552a552 } {4.5e-13} test util-10.101 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbdbb7cdfd9d7bdbb } {-2.5e-11} test util-10.102 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x44f3da329b633647 } {1.5e+24} test util-10.103 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc53cf389cd46047d } {-3.5e+25} test util-10.104 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x454f04ef12cb04cf } {7.5e+25} test util-10.105 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc55f04ef12cb04cf } {-1.5e+26} test util-10.106 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3fc3333333333333 } {0.15} test util-10.107 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbdb07e1fe91b0b70 } {-1.5e-11} test util-10.108 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3de49da7e361ce4c } {1.5e-10} test util-10.109 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbe19c511dc3a41df } {-1.5e-9} test util-10.110 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc5caa83d74267822 } {-1.65e+28} test util-10.111 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x4588f1d5969453de } {9.65e+26} test util-10.112 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3b91d9bd564dcda6 } {9.45e-22} test util-10.113 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbcfa58973ecbede6 } {-5.85e-15} test util-10.114 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x45eb297cad9f70b6 } {6.725e+28} test util-10.115 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc5fb297cad9f70b6 } {-1.345e+29} test util-10.116 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3accdc06b20ef183 } {1.865e-25} test util-10.117 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xbd036071dcae4565 } {-8.605e-15} test util-10.118 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x462cb968d297dde8 } {1.137885e+30} test util-10.119 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0xc661f3e1839eeab1 } {-1.137885e+31} test util-10.120 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x474e9cec176c96f8 } {3.179033335e+35} test util-10.121 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x3dbc06d366394441 } {2.54901016865e-11} test util-10.122 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x478f58ac4db68c90 } {5.20831059055e+36} test util-11.1 {Tcl_PrintDouble - scaling} { expr {1.1e-5} } {1.1e-5} test util-11.2 {Tcl_PrintDouble - scaling} { expr {1.1e-4} } {0.00011} test util-11.3 {Tcl_PrintDouble - scaling} { expr {1.1e-3} } {0.0011} test util-11.4 {Tcl_PrintDouble - scaling} { expr {1.1e-2} } {0.011} test util-11.5 {Tcl_PrintDouble - scaling} { expr {1.1e-1} } {0.11} test util-11.6 {Tcl_PrintDouble - scaling} { expr {1.1e0} } {1.1} test util-11.7 {Tcl_PrintDouble - scaling} { expr {1.1e1} } {11.0} test util-11.8 {Tcl_PrintDouble - scaling} { expr {1.1e2} } {110.0} test util-11.9 {Tcl_PrintDouble - scaling} { expr {1.1e3} } {1100.0} test util-11.10 {Tcl_PrintDouble - scaling} { expr {1.1e4} } {11000.0} test util-11.11 {Tcl_PrintDouble - scaling} { expr {1.1e5} } {110000.0} test util-11.12 {Tcl_PrintDouble - scaling} { expr {1.1e6} } {1100000.0} test util-11.13 {Tcl_PrintDouble - scaling} { expr {1.1e7} } {11000000.0} test util-11.14 {Tcl_PrintDouble - scaling} { expr {1.1e8} } {110000000.0} test util-11.15 {Tcl_PrintDouble - scaling} { expr {1.1e9} } {1100000000.0} test util-11.16 {Tcl_PrintDouble - scaling} { expr {1.1e10} } {11000000000.0} test util-11.17 {Tcl_PrintDouble - scaling} { expr {1.1e11} } {110000000000.0} test util-11.18 {Tcl_PrintDouble - scaling} { expr {1.1e12} } {1100000000000.0} test util-11.19 {Tcl_PrintDouble - scaling} { expr {1.1e13} } {11000000000000.0} test util-11.20 {Tcl_PrintDouble - scaling} { expr {1.1e14} } {110000000000000.0} test util-11.21 {Tcl_PrintDouble - scaling} { expr {1.1e15} } {1100000000000000.0} test util-11.22 {Tcl_PrintDouble - scaling} { expr {1.1e16} } {11000000000000000.0} test util-11.23 {Tcl_PrintDouble - scaling} { expr {1.1e17} } {1.1e+17} test util-12.1 {TclDoubleDigits - Inf} {testdoubledigits ieeeFloatingPoint} { testdoubledigits Inf -1 shortest } {Infinity 9999 +} test util-12.2 {TclDoubleDigits - -Inf} {testdoubledigits ieeeFloatingPoint} { testdoubledigits -Inf -1 shortest } {Infinity 9999 -} test util-12.3 {TclDoubleDigits - NaN} {testdoubledigits ieeeFloatingPoint} { testdoubledigits $ieeeValues(NaN) -1 shortest } {NaN 9999 +} test util-12.4 {TclDoubleDigits - NaN} {*}{ -constraints {testdoubledigits ieeeFloatingPoint controversialNaN} -body { testdoubledigits -NaN -1 shortest } -result {NaN 9999 -} } test util-12.5 {TclDoubleDigits - 0} testdoubledigits { testdoubledigits 0.0 -1 shortest } {0 0 +} test util-12.6 {TclDoubleDigits - -0} testdoubledigits { testdoubledigits -0.0 -1 shortest } {0 0 -} # Verdonk test vectors test util-13.1 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1754e31cd072da E+1008 +4_000000000000000000& E+303 } -result {} } test util-13.2 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1afcef51f0fb5f E+265 -1_000000000000000000& E+80 } -result {} } test util-13.3 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1754e31cd072da E+1006 +1_000000000000000000& E+303 } -result {} } test util-13.4 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1754e31cd072da E+1007 -2_000000000000000000& E+303 } -result {} } test util-13.5 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1e07b27dd78b14 E-848 +1_00000000000000000& E-255 } -result {} } test util-13.6 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1e29e9c56687fe E-709 -7_00000000000000000& E-214 } -result {} } test util-13.7 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1be03d0bf225c7 E-137 +1_00000000000000000& E-41 } -result {} } test util-13.8 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1a2fe76a3f9475 E-499 -1_00000000000000000& E-150 } -result {} } test util-13.9 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 19a2028368022e E+1019 +8_999999999999999999& E+306 } -result {} } test util-13.10 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1317e5ef3ab327 E+509 -1_999999999999999999& E+153 } -result {} } test util-13.11 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1317e5ef3ab327 E+510 +3_99999999999999999& E+153 } -result {} } test util-13.12 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1317e5ef3ab327 E+511 -7_99999999999999999& E+153 } -result {} } test util-13.13 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1eb8e84fa0b278 E-1008 +6_999999999999999999& E-304 } -result {} } test util-13.14 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -13339131c46f8b E-1004 -6_999999999999999999& E-303 } -result {} } test util-13.15 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c0f92a6276c9d E-162 +2_999999999999999999& E-49 } -result {} } test util-13.16 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -15ce1f143d7ad2 E-443 -5_99999999999999999& E-134 } -result {} } test util-13.17 {just over exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c0794d9d40e96 E-301 +43_000000000000000000& E-92 } -result {} } test util-13.18 {just over exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1c0794d9d40e96 E-300 -86_000000000000000000& E-92 } -result {} } test util-13.19 {just over exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1cd5bee57763e6 E-241 +51_000000000000000000& E-74 } -result {} } test util-13.20 {just under exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1d1c26db7d0dae E+651 +16_999999999999999999& E+195 } -result {} } test util-13.21 {just under exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -13f7ced916872b E-5 -38_999999999999999999& E-3 } -result {} } test util-13.22 {just over exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 17d93193f78fc6 E+588 +151_0000000000000000000& E+175 } -result {} } test util-13.23 {just over exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1a82a1631eeb30 E-625 -119_000000000000000000& E-190 } -result {} } test util-13.24 {just under exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -16c309024bab4b E+290 -282_999999999999999999& E+85 } -result {} } test util-13.25 {just over exact - 8 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1dbbac6f83a821 E-800 +27869147_0000000000000000000& E-248 } -result {} } test util-13.26 {just under exact - 9 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1c569e968e0944 E+430 -491080653_9999999999999999999& E+121 } -result {} } test util-13.27 {just under exact - 9 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c569e968e0944 E+429 +245540326_9999999999999999999& E+121 } -result {} } test util-13.28 {just over exact - 10 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1fc575867314ee E-330 -9078555839_0000000000000000000& E-109 } -result {} } test util-13.29 {just under exact - 10 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1c569e968e0944 E+428 -1227701634_9999999999999999999& E+120 } -result {} } test util-13.30 {just over exact - 11 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1fc575867314ee E-329 +18157111678_0000000000000000000& E-109 } -result {} } test util-13.31 {just over exact - 14 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -18bf7e7fa6f02a E-196 -15400733123779_0000000000000000000& E-72 } -result {} } test util-13.32 {just over exact - 17 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -13de005bd620df E+217 -26153245263757307_0000000000000000000& E+49 } -result {} } test util-13.33 {just over exact - 18 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1f92bacb3cb40c E+718 +272104041512242479_0000000000000000000& E+199 } -result {} } test util-13.34 {just over exact - 18 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1f92bacb3cb40c E+719 -544208083024484958_0000000000000000000& E+199 } -result {} } test util-13.35 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 142dbf25096cf5 E+148 +4_500000000000000000& E+44 } -result {} } test util-13.36 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1afcef51f0fb5f E+263 -2_500000000000000000& E+79 } -result {} } test util-13.37 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 102498ea6df0c4 E+145 +4_500000000000000000& E+43 } -result {} } test util-13.38 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1754e31cd072da E+1004 -2_500000000000000000& E+302 } -result {} } test util-13.39 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 12deac01e2b4f7 E-557 +2_50000000000000000& E-168 } -result {} } test util-13.40 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1b1df536c13eee E-307 -6_50000000000000000& E-93 } -result {} } test util-13.41 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 10711fed5b19a4 E-154 +4_50000000000000000& E-47 } -result {} } test util-13.42 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -148d67e8b1e00d E-151 -4_50000000000000000& E-46 } -result {} } test util-13.43 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c8c574c0c6be7 E+187 +3_49999999999999999& E+56 } -result {} } test util-13.44 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1756183c147514 E+206 -1_49999999999999999& E+62 } -result {} } test util-13.45 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 12ab469676c410 E+203 +1_49999999999999999& E+61 } -result {} } test util-13.46 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1539684e774b48 E+246 -1_49999999999999999& E+74 } -result {} } test util-13.47 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 12e5f5dfa4fe9d E-286 +9_499999999999999999& E-87 } -result {} } test util-13.48 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1bdc2417bf7787 E-838 -9_499999999999999999& E-253 } -result {} } test util-13.49 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1eb8e84fa0b278 E-1009 +3_499999999999999999& E-304 } -result {} } test util-13.50 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1e3cbc9907fdc8 E-290 -9_499999999999999999& E-88 } -result {} } test util-13.51 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 10ad836f269a17 E-324 +30_500000000000000000& E-99 } -result {} } test util-13.52 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1b39ae1909c31b E-687 -26_500000000000000000& E-208 } -result {} } test util-13.53 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1b2ab18615fcc6 E-576 +686_500000000000000000& E-176 } -result {} } test util-13.54 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -13e1f90a573064 E-624 -178_500000000000000000& E-190 } -result {} } test util-13.55 {just under half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 16c309024bab4b E+289 +141_499999999999999999& E+85 } -result {} } test util-13.56 {just under half ulp - 4 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -159bd3ad46e346 E+193 -1695_499999999999999999& E+55 } -result {} } test util-13.57 {just under half ulp - 4 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1df4170f0fdecc E+124 +3981_499999999999999999& E+34 } -result {} } test util-13.58 {just over half ulp - 6 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 17e1e0f1c7a4ac E+415 +126300_5000000000000000000& E+120 } -result {} } test util-13.59 {just over half ulp - 6 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1dda592e398dd7 E+418 -126300_5000000000000000000& E+121 } -result {} } test util-13.60 {just under half ulp - 7 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1e597c0b94b7ae E+453 -4411845_499999999999999999& E+130 } -result {} } test util-13.61 {just under half ulp - 9 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c569e968e0944 E+427 +613850817_4999999999999999999& E+120 } -result {} } test util-13.62 {just under half ulp - 9 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1c569e968e0944 E+428 -122770163_49999999999999999999& E+121 } -result {} } test util-13.63 {just over half ulp - 18 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 17ae0c186d8709 E+719 +408156062268363718_5000000000000000000& E+199 } -result {} } test util-13.64 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 152d02c7e14af7 E+76 +1_0000000000000000& E+23 } -result {} } test util-13.65 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -19d971e4fe8402 E+89 -1_0000000000000000& E+27 } -result {} } test util-13.66 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 19d971e4fe8402 E+90 +2_0000000000000000& E+27 } -result {} } test util-13.67 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -19d971e4fe8402 E+91 -4_0000000000000000& E+27 } -result {} } test util-13.68 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 15798ee2308c3a E-27 +1_0000000000000000& E-8 } -result {} } test util-13.69 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -15798ee2308c3a E-26 -2_0000000000000000& E-8 } -result {} } test util-13.70 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 15798ee2308c3a E-25 +4_0000000000000000& E-8 } -result {} } test util-13.71 {just over exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1ef2d0f5da7dd9 E-84 -1_0000000000000000& E-25 } -result {} } test util-13.72 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1a784379d99db4 E+78 +4_9999999999999999& E+23 } -result {} } test util-13.73 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1a784379d99db4 E+80 -1_9999999999999999& E+24 } -result {} } test util-13.74 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 13da329b633647 E+81 +2_9999999999999999& E+24 } -result {} } test util-13.75 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1cf389cd46047d E+85 -6_9999999999999999& E+25 } -result {} } test util-13.76 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 19999999999999 E-3 +1_99999999999999999& E-1 } -result {} } test util-13.77 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -13333333333333 E-2 -2_99999999999999999& E-1 } -result {} } test util-13.78 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 16849b86a12b9b E-48 +4_99999999999999999& E-15 } -result {} } test util-13.79 {just under exact - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -16849b86a12b9b E-46 -1_99999999999999999& E-14 } -result {} } test util-13.80 {just over exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 17ccfc73126788 E-71 +63_00000000000000000& E-23 } -result {} } test util-13.81 {just over exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1dc03b8fd7016a E-68 -63_00000000000000000& E-22 } -result {} } test util-13.82 {just under exact - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 13f7ced916872b E-5 +38_999999999999999999& E-3 } -result {} } test util-13.83 {just over exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1b297cad9f70b6 E+97 +269_000000000000000000& E+27 } -result {} } test util-13.84 {just over exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1b297cad9f70b6 E+98 -538_00000000000000000& E+27 } -result {} } test util-13.85 {just over exact - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1cdc06b20ef183 E-82 +373_00000000000000000& E-27 } -result {} } test util-13.86 {just over exact - 4 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1b297cad9f70b6 E+96 +1345_00000000000000000& E+26 } -result {} } # this one is not 4 digits, it is 3, and it is covered above. test util-13.87 {just over exact - 4 digits} {*}{ -constraints {testdoubledigits knownBadTest} -body { verdonk_test -1b297cad9f70b6 E+97 -2690_00000000000000000& E+26 } -result {} } test util-13.88 {just over exact - 5 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -150a246ecd44f3 E-63 -14257_00000000000000000& E-23 } -result {} } test util-13.89 {just under exact - 6 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -119b96f36ec68b E-19 -209900_999999999999999999& E-11 } -result {} } test util-13.90 {just over exact - 11 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c06d366394441 E-35 +50980203373_000000000000000000& E-21 } -result {} } test util-13.91 {just under exact - 12 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1f58ac4db68c90 E+122 -104166211810_99999999999999999& E+26 } -result {} } test util-13.92 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 19d971e4fe8402 E+87 +2_5000000000000000& E+26 } -result {} } test util-13.93 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1dc74be914d16b E+81 -4_500000000000000& E+24 } -result {} } test util-13.94 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 14adf4b7320335 E+84 +2_500000000000000& E+25 } -result {} } test util-13.95 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1ae22487c1042b E+85 -6_5000000000000000& E+25 } -result {} } test util-13.96 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 187fe49aab41e0 E-54 +8_5000000000000000& E-17 } -result {} } test util-13.97 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1f5c05e4b23fd7 E-61 -8_5000000000000000& E-19 } -result {} } test util-13.98 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1faa7ab552a552 E-42 +4_5000000000000000& E-13 } -result {} } test util-13.99 {just over half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1b7cdfd9d7bdbb E-36 -2_5000000000000000& E-11 } -result {} } test util-13.100 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 13da329b633647 E+80 +1_4999999999999999& E+24 } -result {} } test util-13.101 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1cf389cd46047d E+84 -3_49999999999999999& E+25 } -result {} } test util-13.102 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1f04ef12cb04cf E+85 +7_4999999999999999& E+25 } -result {} } test util-13.103 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1f04ef12cb04cf E+86 -1_4999999999999999& E+26 } -result {} } test util-13.104 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 13333333333333 E-3 +1_49999999999999999& E-1 } -result {} } test util-13.105 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -107e1fe91b0b70 E-36 -1_49999999999999999& E-11 } -result {} } test util-13.106 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 149da7e361ce4c E-33 +1_49999999999999999& E-10 } -result {} } test util-13.107 {just under half ulp - 1 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -19c511dc3a41df E-30 -1_49999999999999999& E-9 } -result {} } test util-13.108 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1aa83d74267822 E+93 -16_5000000000000000& E+27 } -result {} } test util-13.109 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 18f1d5969453de E+89 +96_5000000000000000& E+25 } -result {} } test util-13.110 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 11d9bd564dcda6 E-70 +94_50000000000000000& E-23 } -result {} } test util-13.111 {just over half ulp - 2 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1a58973ecbede6 E-48 -58_50000000000000000& E-16 } -result {} } test util-13.112 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1b297cad9f70b6 E+95 +672_50000000000000000& E+26 } -result {} } test util-13.113 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -1b297cad9f70b6 E+96 -134_500000000000000000& E+27 } -result {} } test util-13.114 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1cdc06b20ef183 E-83 +186_50000000000000000& E-27 } -result {} } test util-13.115 {just over half ulp - 3 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -136071dcae4565 E-47 -860_50000000000000000& E-17 } -result {} } test util-13.116 {just over half ulp - 6 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1cb968d297dde8 E+99 +113788_50000000000000000& E+25 } -result {} } test util-13.117 {just over half ulp - 6 digits} {*}{ -constraints testdoubledigits -body { verdonk_test -11f3e1839eeab1 E+103 -113788_50000000000000000& E+26 } -result {} } test util-13.118 {just under half ulp - 9 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1e9cec176c96f8 E+117 +317903333_49999999999999999& E+27 } -result {} } test util-13.119 {just over half ulp - 11 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1c06d366394441 E-36 +25490101686_500000000000000000& E-21 } -result {} } test util-13.120 {just under half ulp - 11 digits} {*}{ -constraints testdoubledigits -body { verdonk_test 1f58ac4db68c90 E+121 +52083105905_49999999999999999& E+26 } -result {} } test util-14.1 {funky NaN} {*}{ -constraints {ieeeFloatingPoint controversialNaN} -body { set ieeeValues(-NaN) } -result -NaN } test util-14.2 {funky NaN} {*}{ -constraints {ieeeFloatingPoint controversialNaN} -body { set ieeeValues(-NaN(3456789abcdef)) } -result -NaN(3456789abcdef) } test util-15.1 {largest subnormal} {*}{ -body { binary scan [binary format w 0x000fffffffffffff] q x set x } -result 2.225073858507201e-308 -cleanup { unset x } } test util-15.2 {largest subnormal} {*}{ -body { binary scan [binary format w 0x800fffffffffffff] q x set x } -result -2.225073858507201e-308 -cleanup { unset x } } test util-15.3 {largest subnormal} {*}{ -body { binary scan [binary format q 2.225073858507201e-308] w x format %#lx $x } -result 0xfffffffffffff -cleanup { unset x } } test util-15.4 {largest subnormal} {*}{ -body { binary scan [binary format q -2.225073858507201e-308] w x format %#lx $x } -result 0x800fffffffffffff -cleanup { unset x } } test util-15.5 {smallest normal} {*}{ -body { binary scan [binary format w 0x0010000000000000] q x set x } -result 2.2250738585072014e-308 -cleanup { unset x } } test util-15.6 {smallest normal} {*}{ -body { binary scan [binary format w 0x8010000000000000] q x set x } -result -2.2250738585072014e-308 -cleanup { unset x } } test util-15.7 {smallest normal} {*}{ -body { binary scan [binary format q 2.2250738585072014e-308] w x format %#lx $x } -result 0x10000000000000 -cleanup { unset x } } test util-15.8 {smallest normal} {*}{ -body { binary scan [binary format q -2.2250738585072014e-308] w x format %#lx $x } -result 0x8010000000000000 -cleanup { unset x } } test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} { set r {} foreach {input} { 0x1ffffffffffffc000 0x1ffffffffffffc800 0x1ffffffffffffd000 0x1ffffffffffffd800 0x1ffffffffffffe000 0x1ffffffffffffe800 0x1fffffffffffff000 0x1fffffffffffff800 } { binary scan [binary format q [expr {double($input)}]] wu x lappend r [format %#llx $x] binary scan [binary format q [expr {double(-$input)}]] wu x lappend r [format %#llx $x] } set r } [list {*}{ 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffd 0xc3fffffffffffffd 0x43fffffffffffffe 0xc3fffffffffffffe 0x43fffffffffffffe 0xc3fffffffffffffe 0x43fffffffffffffe 0xc3fffffffffffffe 0x43ffffffffffffff 0xc3ffffffffffffff 0x4400000000000000 0xc400000000000000 }] test util-18.1 {Tcl_ObjPrintf} {testprint} { testprint %lld [expr {2**63-1}] } {9223372036854775807} test util-18.2 {Tcl_ObjPrintf} {testprint} { testprint %I64d [expr {2**63-1}] } {9223372036854775807} test util-18.3 {Tcl_ObjPrintf} {testprint} { testprint %qd [expr {2**63-1}] } {9223372036854775807} test util-18.4 {Tcl_ObjPrintf} {testprint} { testprint %jd [expr {2**63-1}] } {9223372036854775807} test util-18.5 {Tcl_ObjPrintf} {testprint} { testprint %lld [expr {-2**63}] } {-9223372036854775808} test util-18.6 {Tcl_ObjPrintf} {testprint} { testprint %I64d [expr {-2**63}] } {-9223372036854775808} test util-18.7 {Tcl_ObjPrintf} {testprint} { testprint %qd [expr {-2**63}] } {-9223372036854775808} test util-18.8 {Tcl_ObjPrintf} {testprint} { testprint %jd [expr {-2**63}] } {-9223372036854775808} test util-18.9 {Tcl_ObjPrintf} {testprint} { testprint "%I64d %I32d" [expr {-2**63+2}] } {-9223372036854775806 2} test util-18.10 {Tcl_ObjPrintf} {testprint} { testprint "%I64d %p" 65535 } {65535 0xffff} test util-18.11 {Tcl_ObjPrintf} {testprint} { testprint "%I64d %td" 65536 } {65536 65536} test util-18.12 {Tcl_ObjPrintf} {testprint} { testprint "%I64d %Id" 65537 } {65537 65537} test util-18.13 {Tcl_ObjPrintf} -constraints {testprint longIs64bit} -body { testprint "%llu %ju %lu" -1 } -result {18446744073709551615 18446744073709551615 18446744073709551615} test util-18.14 {Tcl_ObjPrintf} -constraints {testprint longIs64bit} -body { testprint "%llu %zu %lu" -1 } -result {18446744073709551615 18446744073709551615 18446744073709551615} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/utfext.test0000644000175000017500000003571315104661341015142 0ustar sergeisergei# This file contains a collection of tests for Tcl_UtfToExternal and # Tcl_UtfToExternal that exercise various combinations of flags, # buffer lengths and fragmentation that cannot be tested by # normal script level commands. There tests are NOT intended to check # correct encodings; those are elsewhere. # # Copyright (c) 2023 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testencoding [llength [info commands testencoding]] namespace eval utftest { # Format of table, indexed by encoding. The encodings are not exhaustive # but one of each kind of encoding transform (algorithmic, table-driven, # stateful, DBCS, MBCS). # Each element is list of lists. Nested lists have following fields # 0 comment (no spaces, might be used to generate id's as well) # The combination of comment and internal hex (2) should be unique. # 1 hex representation of internal *modified* utf-8 encoding. This is the # source string for Tcl_UtfToExternal and expected result for # Tcl_ExternalToUtf. # 2 hex representation in specified encoding. This is the source string for # Tcl_ExternalToUtf and expected result for Tcl_UtfToExternal. # 3 internal fragmentation index - where to split field 1 for fragmentation # tests. -1 to skip # 4 external fragmentation index - where to split field 2 for fragmentation # tests. -1 to skip # # THE HEX DEFINITIONS SHOULD SEPARATE EACH CHARACTER BY WHITESPACE # (assumed by the charlimit tests) lappend utfExtMap {*}{ ascii { {basic {41 42 43} {41 42 43} -1 -1} } utf-8 { {bmp {41 c3a9 42} {41 c3a9 42} 2 2} {nonbmp-frag-1 {41 f09f9880 42} {41 f09f9880 42} 2 2} {nonbmp-frag-2 {41 f09f9880 42} {41 f09f9880 42} 3 3} {nonbmp-frag-3 {41 f09f9880 42} {41 f09f9880 42} 4 4} {null {41 c080 42} {41 00 42} 2 -1} } cesu-8 { {bmp {41 c3a9 42} {41 c3a9 42} 2 2} {nonbmp-frag-surr-low {41 f09f9880 42} {41 eda0bd edb880 42} 2 2} {nonbmp-split-surr {41 f09f9880 42} {41 eda0bd edb880 42} 3 -1} {nonbmp-frag-surr-high {41 f09f9880 42} {41 eda0bd edb880 42} 4 6} {null {41 c080 42} {41 00 42} 2 -1} } utf-16le { {bmp {41 c3a9 42} {4100 e900 4200} 2 3} {nonbmp {41 f09f9880 42} {4100 3dd8 00de 4200} 4 3} {split-surrogate {41 f09f9080 42} {4100 3dd8 00dc 4200} 3 4} {null {41 c080 42} {4100 0000 4200} 2 3} } utf-16be { {bmp {41 c3a9 42} {0041 00e9 0042} 2 3} {nonbmp {41 f09f9880 42} {0041 d83d de00 0042} 4 3} {split-surrogate {41 f09f9080 42} {0041 d83d dc00 0042} 3 4} {null {41 c080 42} {0041 0000 0042} 2 3} } utf-32le { {bmp {41 c3a9 42} {41000000 e9000000 42000000} 2 3} {nonbmp {41 f09f9880 42} {41000000 00f60100 42000000} 4 6} {null {41 c080 42} {41000000 00000000 42000000} 2 3} } utf-32be { {bmp {41 c3a9 42} {00000041 000000e9 00000042} 2 3} {nonbmp {41 f09f9880 42} {00000041 0001f600 00000042} 4 3} {null {41 c080 42} {00000041 00000000 00000042} 2 3} } iso8859-1 { {basic {41 c3a9 42} {41 e9 42} 2 -1} {null {41 c080 42} {41 00 42} 2 -1} } iso8859-3 { {basic {41 c4a0 42} {41 d5 42} 2 -1} {null {41 c080 42} {41 00 42} 2 -1} } shiftjis { {basic {41 e4b98e 42} {41 8cc1 42} 3 2} } jis0208 { {basic {e4b98e e590be} {3843 3863} 1 1} } iso2022-jp { {frag-in-leadescape {58 e4b98e 5a} {58 1b2442 3843 1b2842 5a} 2 2} {frag-in-char {58 e4b98e 5a} {58 1b2442 3843 1b2842 5a} 2 5} {frag-in-trailescape {58 e4b98e 5a} {58 1b2442 3843 1b2842 5a} 2 8} } } # Return a binary string containing nul terminator for encoding proc hexnuls {enc} { return [binary encode hex [encoding convertto $enc \x00]] } # The C wrapper fills entire destination buffer with FF. # Anything beyond expected output should have FF's proc fill {bin buflen} { return [string range "$bin[string repeat \xFF $buflen]" 0 $buflen-1] } proc testutf {direction enc comment hexin hexout args} { set id $comment-[join $hexin ""] if {$direction eq "toutf"} { set cmd Tcl_ExternalToUtf } else { set cmd Tcl_UtfToExternal } set in [binary decode hex $hexin] set out [binary decode hex $hexout] set dstlen 40 ;# Should be enough for all encoding tests set status ok set flags [list start end] set constraints [list testencoding] set profiles [encoding profiles] while {[llength $args] > 1} { set opt [lpop args 0] switch $opt { -flags { set flags [lpop args 0] } -constraints { lappend constraints {*}[lpop args 0] } -profiles { set profiles [lpop args 0] } -status { set status [lpop args 0]} default { error "Unknown option \"$opt\"" } } } if {[llength $args]} { error "No value supplied for option [lindex $args 0]." } set result [list $status {} [fill $out $dstlen]] test $cmd-$enc-$id-[join $flags -] "$cmd - $enc - $hexin - $flags" -body \ [list testencoding $cmd $enc $in $flags {} $dstlen] \ -result $result -constraints $constraints foreach profile $profiles { set flags2 [linsert $flags end $profile] test $cmd-$enc-$id-[join $flags2 -] "$cmd - $enc - $hexin - $flags2" -body \ [list testencoding $cmd $enc $in $flags2 {} $dstlen] \ -result $result -constraints $constraints } } proc testfragment {direction enc comment hexin hexout fragindex args} { if {$fragindex < 0} { # Single byte encodings so no question of fragmentation return } set id $comment-[join $hexin ""]-fragment if {$direction eq "toutf"} { set cmd Tcl_ExternalToUtf } else { set cmd Tcl_UtfToExternal } set status1 multibyte; # Return status to expect after first call while {[llength $args] > 1} { set opt [lpop args 0] switch $opt { -status1 { set status1 [lpop args 0]} default { error "Unknown option \"$opt\"" } } } set in [binary decode hex $hexin] set infrag [string range $in 0 $fragindex-1] set out [binary decode hex $hexout] set dstlen 40 ;# Should be enough for all encoding tests test $cmd-$enc-$id-0 "$cmd - $enc - $hexin - frag=$fragindex" -constraints testencoding -body { set frag1Result [testencoding $cmd $enc [string range $in 0 $fragindex-1] {start} 0 $dstlen frag1Read frag1Written] lassign $frag1Result frag1Status frag1State frag1Decoded set frag2Result [testencoding $cmd $enc [string range $in $frag1Read end] {end} $frag1State $dstlen frag2Read frag2Written] lassign $frag2Result frag2Status frag2State frag2Decoded set decoded [string cat [string range $frag1Decoded 0 $frag1Written-1] [string range $frag2Decoded 0 $frag2Written-1]] list $frag1Status [expr {$frag1Read <= $fragindex}] \ $frag2Status [expr {$frag1Read+$frag2Read}] \ [expr {$frag1Written+$frag2Written}] $decoded } -result [list $status1 1 ok [string length $in] [string length $out] $out] if {$direction eq "toutf"} { # Fragmentation but with no more data. # Only check status. Content output is already checked in above test. test $cmd-$enc-$id-1 "$cmd - $enc - $hexin - frag=$fragindex - no more data" -constraints testencoding -body { set frag1Result [testencoding $cmd $enc [string range $in 0 $fragindex-1] {start end} 0 $dstlen frag1Read frag1Written] lassign $frag1Result frag1Status frag1State frag1Decoded set frag1Status } -result syntax } } proc testcharlimit {direction enc comment hexin hexout} { set id $comment-[join $hexin ""]-charlimit if {$direction eq "toutf"} { set cmd Tcl_ExternalToUtf } else { set cmd Tcl_UtfToExternal } set maxchars [llength $hexout] set in [binary decode hex $hexin] set out [binary decode hex $hexout] set dstlen 40 ;# Should be enough for all encoding tests for {set nchars 0} {$nchars <= $maxchars} {incr nchars} { set expected_bytes [binary decode hex [lrange $hexout 0 $nchars-1]] set expected_nwritten [string length $expected_bytes] test $cmd-$enc-$id-$nchars "$cmd - $enc - $hexin - nchars $nchars" -constraints testencoding -body { set charlimit $nchars lassign [testencoding $cmd $enc $in \ {start end charlimit} 0 $dstlen nread nwritten charlimit] \ status state buf list $status $nwritten [string range $buf 0 $nwritten-1] } -result [list [expr {$nchars == $maxchars ? "ok" : "nospace"}] $expected_nwritten $expected_bytes] } } proc testspacelimit {direction enc comment hexin hexout} { set id $comment-[join $hexin ""]-spacelimit # Triple the input to avoid pathological short input case where # whereby nothing is written to output. The test below # requires $nchars > 0 set hexin $hexin$hexin$hexin set hexout $hexout$hexout$hexout set flags [list start end] set constraints [list testencoding] set maxchars [llength $hexout] set in [binary decode hex $hexin] set out [binary decode hex $hexout] set dstlen [expr {[string length $out] - 1}]; # Smaller buffer than needed if {$direction eq "toutf"} { set cmd Tcl_ExternalToUtf set str [encoding convertfrom $enc $in] } else { set cmd Tcl_UtfToExternal set str [encoding convertfrom $enc $out] } # Note the tests are loose because the some encoding operations will # stop even there is actually still room in the destination. For example, # below only one char is written though there is room in the output. # % testencoding Tcl_ExternalToUtf ascii abc {start end} {} 5 nread nwritten nchars # nospace {} aÿÿÿ# # % puts $nread,$nwritten,$nchars # 1,1,1 # test $cmd-$enc-$id-[join $flags -] "$cmd - $enc - $hexin - $flags" \ -constraints $constraints \ -body { lassign [testencoding $cmd $enc $in $flags {} $dstlen nread nwritten nchars] status state buf list \ $status \ [expr {$nread < [string length $in]}] \ [expr {$nwritten <= $dstlen}] \ [expr {$nchars > 0 && $nchars < [string length $str]}] \ [expr {[string range $out 0 $nwritten-1] eq [string range $buf 0 $nwritten-1]}] } -result {nospace 1 1 1 1} } # # Basic tests foreach {enc testcases} $utfExtMap { foreach testcase $testcases { lassign $testcase {*}{comment utfhex hex internalfragindex externalfragindex} # Basic test - TCL_ENCODING_START|TCL_ENCODING_END # Note by default output should be terminated with \0 set encnuls [hexnuls $enc] testutf toutf $enc $comment $hex ${utfhex}00 testutf fromutf $enc $comment $utfhex $hex$encnuls # Test TCL_ENCODING_NO_TERMINATE testutf toutf $enc $comment $hex $utfhex -flags {start end noterminate} # noterminate is specific to ExternalToUtf, # should have no effect in other direction testutf fromutf $enc $comment $utfhex $hex$encnuls -flags {start end noterminate} # Fragments testfragment toutf $enc $comment $hex $utfhex $externalfragindex testfragment fromutf $enc $comment $utfhex $hex $internalfragindex # Char limits - note no fromutf as Tcl_UtfToExternal does not support it testcharlimit toutf $enc $comment $hex $utfhex # Space limits testspacelimit toutf $enc $comment $hex $utfhex testspacelimit fromutf $enc $comment $utfhex $hex } } # Special cases - cesu2 high and low surrogates in separate fragments # This will (correctly) return "ok", not "multibyte" after first frag testfragment toutf cesu-8 nonbmp-split-surr \ {41 eda0bd edb880 42} {41 f09f9880 42} 4 -status1 ok # Bug regression tests test Tcl_UtfToExternal-bug-183a1adcc0 {buffer overflow} -body { testencoding Tcl_UtfToExternal utf-16 A {start end} {} 1 } -result [list nospace {} \xFF] -constraints testencoding test Tcl_ExternalToUtf-bug-5be203d6ca { truncated prefix in table encoding } -body { set src \x82\x4F\x82\x50\x82 set result [list [testencoding Tcl_ExternalToUtf shiftjis $src {start tcl8} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten] lappend result {*}[list [testencoding Tcl_ExternalToUtf shiftjis [string range $src $srcRead end] {end tcl8} 0 10 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten] } -result [list [list multibyte 0 \xEF\xBC\x90\xEF\xBC\x91\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF] 4 6 2 [list ok 0 \xC2\x82\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF] 1 2 1] -constraints testencoding test Tcl_ExternalToUtf-bug-7346adc50f-strict-0 { truncated input in escape encoding (strict) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start end strict} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list syntax 2 [binary decode hex e3818ae8a9a600ffffffffffffffffff] 7 6 2] test Tcl_ExternalToUtf-bug-7346adc50f-strict-1 { truncated input in escape encoding (strict, partial) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start strict} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list multibyte 2 [binary decode hex e3818ae8a9a600ffffffffffffffffff] 7 6 2] test Tcl_ExternalToUtf-bug-7346adc50f-replace-0 { truncated input in escape encoding (replace) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start end replace} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list ok 2 [binary decode hex e3818ae8a9a6efbfbd00ffffffffffff] 8 9 3] test Tcl_ExternalToUtf-bug-7346adc50f-replace-1 { truncated input in escape encoding (replace, partial) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start replace} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list multibyte 2 [binary decode hex e3818ae8a9a600ffffffffffffffffff] 7 6 2] test Tcl_ExternalToUtf-bug-7346adc50f-tcl8-0 { truncated input in escape encoding (tcl8) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start end tcl8} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list ok 2 [binary decode hex e3818ae8a9a6efbfbd00ffffffffffff] 8 9 3] test Tcl_ExternalToUtf-bug-7346adc50f-tcl8-1 { truncated input in escape encoding (tcl8, partial) } -body { set src [binary decode hex 1b2442242a3b6e24] list {*}[testencoding Tcl_ExternalToUtf iso2022-jp $src {start tcl8} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten } -result [list multibyte 2 [binary decode hex e3818ae8a9a600ffffffffffffffffff] 7 6 2] } namespace delete utftest ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/utf.test0000644000175000017500000012220015104661341014405 0ustar sergeisergei# This file contains a collection of tests for tclUtf.c # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testfindfirst [llength [info commands testfindfirst]] testConstraint testfindlast [llength [info commands testfindlast]] testConstraint testnumutfchars [llength [info commands testnumutfchars]] testConstraint teststringobj [llength [info commands teststringobj]] testConstraint testutfnext [llength [info commands testutfnext]] testConstraint testutfprev [llength [info commands testutfprev]] testConstraint testgetunichar [llength [info commands testgetunichar]] testConstraint testuniclass [llength [info commands testuniclass]] testConstraint tip413 [expr {[string trim \x00] eq {}}] catch {unset x} test utf-1.1 {Tcl_UniCharToUtf: 1 byte sequences} testbytestring { expr {"\x01" eq [testbytestring \x01]} } 1 test utf-1.2 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { expr {"\x00" eq [testbytestring \xC0\x80]} } 1 test utf-1.3 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { expr {"\xE0" eq [testbytestring \xC3\xA0]} } 1 test utf-1.4 {Tcl_UniCharToUtf: 3 byte sequences} testbytestring { expr {"乎" eq [testbytestring \xE4\xB9\x8E]} } 1 test utf-1.5 {Tcl_UniCharToUtf: overflowed Tcl_UniChar} testbytestring { expr {[format %c 0x110000] eq [testbytestring \xEF\xBF\xBD]} } 1 test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} testbytestring { expr {[format %c -1] eq [testbytestring \xEF\xBF\xBD]} } 1 test utf-1.7 {Tcl_UniCharToUtf: 4 byte sequences} testbytestring { expr {"\U014E4E" eq [testbytestring \xF0\x94\xB9\x8E]} } 1 test utf-1.8 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { expr {"\uD842" eq [testbytestring \xED\xA1\x82]} } 1 test utf-1.9 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { expr {"\uDC42" eq [testbytestring \xED\xB1\x82]} } 1 test utf-1.10 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { expr {[format %c 0xD842] eq [testbytestring \xED\xA1\x82]} } 1 test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { expr {[format %c 0xDC42] eq [testbytestring \xED\xB1\x82]} } 1 test utf-1.12 {Tcl_UniCharToUtf: Invalid surrogate} testbytestring { expr {"\UD842" eq [testbytestring \xED\xA1\x82]} } 1 test utf-1.13 {Tcl_UniCharToUtf: Invalid surrogate} { expr {"\UD842" eq "\uD842"} } 1 test utf-1.14 {Tcl_UniCharToUtf: surrogate pairs from concat} { set lo \uDE02 return \uD83D$lo } \uD83D\uDE02 test utf-1.15 {Tcl_UniCharToUtf: surrogate pairs from concat} { set hi \uD83D return $hi\uDE02 } \uD83D\uDE02 test utf-1.16 {Tcl_UniCharToUtf: \xC0 + \x80} testbytestring { set lo [testbytestring \x80] string length [testbytestring \xC0]$lo } 2 test utf-1.17 {Tcl_UniCharToUtf: \xC0 + \x80} testbytestring { set hi [testbytestring \xC0] string length $hi[testbytestring \x80] } 2 test utf-1.18 {Tcl_UniCharToUtf: surrogate pairs from concat} { string cat \uD83D \uDE02 } \uD83D\uDE02 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { string length "abc" } 3 test utf-2.2 {Tcl_UtfToUniChar: naked trail bytes} testbytestring { string length [testbytestring \x82\x83\x84] } 3 test utf-2.3 {Tcl_UtfToUniChar: lead (2-byte) followed by non-trail} testbytestring { string length [testbytestring \xC2] } 1 test utf-2.4 {Tcl_UtfToUniChar: lead (2-byte) followed by trail} { string length \xA2 } 1 test utf-2.5 {Tcl_UtfToUniChar: lead (3-byte) followed by non-trail} testbytestring { string length [testbytestring \xE2] } 1 test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestring { string length [testbytestring \xE2\xA2] } 2 test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { string length [testbytestring \xE4\xB9\x8E] } 1 test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} { string length 𐀀 } 1 test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} { string length \U10FFFF } 1 test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring { string length [testbytestring \xF0\x8F\xBF\xBF] } 4 test utf-2.11 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, overflow} testbytestring { # Would decode to U+110000 but that is outside the Unicode range. string length [testbytestring \xF4\x90\x80\x80] } 4 test utf-2.12 {Tcl_UtfToUniChar: longer UTF sequences not supported} testbytestring { string length [testbytestring \xF8\xA2\xA2\xA2\xA2] } 5 test utf-3.1 {Tcl_UtfCharComplete} { } {} test utf-4.1 {Tcl_NumUtfChars: zero length} testnumutfchars { testnumutfchars "" } 0 test utf-4.2 {Tcl_NumUtfChars: length 1} testnumutfchars { testnumutfchars \xA2 } 1 test utf-4.3 {Tcl_NumUtfChars: long string} {testnumutfchars testbytestring} { testnumutfchars abc\xA2[testbytestring \xE4\xB9\x8E\xA2\x4E] } 7 test utf-4.4 {Tcl_NumUtfChars: #x00} testnumutfchars { testnumutfchars \x00 } 1 test utf-4.5 {Tcl_NumUtfChars: zero length, calc len} testnumutfchars { testnumutfchars "" 0 } 0 test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestring} { testnumutfchars \xA2 end } 1 test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} { testnumutfchars abc\xA2[testbytestring \xE4\xB9\x8E\xA2\x4E] end } 7 test utf-4.8 {Tcl_NumUtfChars: #x00, calc len} testnumutfchars { testnumutfchars \x00 end } 1 # Bug [2738427]: Tcl_NumUtfChars(...) no overflow check test utf-4.9 {Tcl_NumUtfChars: #u20AC, calc len, incomplete} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \xE2\x82\xAC] end-1 } 2 test utf-4.10 {Tcl_NumUtfChars: #x00, calc len, overcomplete} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \x00] end+1 } 2 test utf-4.11 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end-1 } 3 test utf-4.12 {Tcl_NumUtfChars: #4-byte UTF-8 character} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \xF0\x9F\x92\xA9] end } 1 test utf-4.13 {Tcl_NumUtfChars: end of string} {testnumutfchars testbytestring} { testnumutfchars foobar[testbytestring \xF2\xC2\xA0] end } 8 test utf-4.14 {Tcl_NumUtfChars: 3 bytes of 4-byte UTF-8 characater} {testnumutfchars testbytestring} { testnumutfchars [testbytestring \xF4\x90\x80\x80] end-1 } 3 test utf-5.1 {Tcl_UtfFindFirst} {testfindfirst testbytestring} { testfindfirst [testbytestring abcbc] 98 } bcbc test utf-5.2 {Tcl_UtfFindLast} {testfindlast testbytestring} { testfindlast [testbytestring abcbc] 98 } bc test utf-6.1 {Tcl_UtfNext} {testutfnext testbytestring} { # This takes the pointer one past the terminating NUL. # This is really an invalid call. testutfnext [testbytestring \x00] } 1 test utf-6.2 {Tcl_UtfNext} testutfnext { testutfnext A } 1 test utf-6.3 {Tcl_UtfNext} testutfnext { testutfnext AA } 1 test utf-6.4 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring A\xA0] } 1 test utf-6.5 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext A[testbytestring \xD0] } 1 test utf-6.6 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext A[testbytestring \xE8] } 1 test utf-6.7 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext A[testbytestring \xF2] } 1 test utf-6.8 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext A[testbytestring \xF8] } 1 test utf-6.9 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\x00] } 1 test utf-6.10 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0]G } 1 test utf-6.11 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xA0\x00] } 2 test utf-6.12 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xD0] } 1 test utf-6.13 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xE8] } 1 test utf-6.14 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xF2] } 1 test utf-6.15 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xF8] } 1 test utf-6.16 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\x00] } 1 test utf-6.17 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0]G } 1 test utf-6.18 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0] } 2 test utf-6.19 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xD0] } 1 test utf-6.20 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xE8] } 1 test utf-6.21 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xF2] } 1 test utf-6.22 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xF8] } 1 test utf-6.23 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\x00] } 1 test utf-6.24 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8]G } 1 test utf-6.25 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\x00] } 1 test utf-6.26 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xD0] } 1 test utf-6.27 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xE8] } 1 test utf-6.28 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xF2] } 1 test utf-6.29 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xF8] } 1 test utf-6.30 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\x00] } 1 test utf-6.31 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2]G } 1 test utf-6.32 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\x00] } 1 test utf-6.33 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xD0] } 1 test utf-6.34 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xE8] } 1 test utf-6.35 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xF2] } 1 test utf-6.36 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xF8] } 1 test utf-6.37 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8] } 1 test utf-6.38 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8]G } 1 test utf-6.39 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8\xA0] } 1 test utf-6.40 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8\xD0] } 1 test utf-6.41 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8\xE8] } 1 test utf-6.42 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8\xF2] } 1 test utf-6.43 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF8\xF8] } 1 test utf-6.44 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0]G } 2 test utf-6.45 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0\xA0] } 2 test utf-6.46 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0\xD0] } 2 test utf-6.47 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0\xE8] } 2 test utf-6.48 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0\xF2] } 2 test utf-6.49 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xD0\xA0\xF8] } 2 test utf-6.50 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0]G } 1 test utf-6.51 {Tcl_UtfNext} testutfnext { testutfnext 蠠 } 3 test utf-6.52 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\xD0] } 1 test utf-6.53 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\xE8] } 1 test utf-6.54 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\xF2] } 1 test utf-6.55 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\xF8] } 1 test utf-6.56 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0]G } 1 test utf-6.57 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\x00] } 1 test utf-6.58 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xD0] } 1 test utf-6.59 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xE8] } 1 test utf-6.60 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xF2] } 1 test utf-6.61 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xF8] } 1 test utf-6.62 {Tcl_UtfNext} testutfnext { testutfnext 蠠G } 3 test utf-6.63 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xE8\xA0\xA0\xA0] } 3 test utf-6.64 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext 蠠[testbytestring \xD0] } 3 test utf-6.65 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext 蠠[testbytestring \xE8] } 3 test utf-6.66 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext 蠠[testbytestring \xF2] } 3 test utf-6.67 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext 蠠[testbytestring \xF8] } 3 test utf-6.68 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0]G } 1 test utf-6.69 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0] } 4 test utf-6.70 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xD0] } 1 test utf-6.71 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xE8] } 1 test utf-6.72 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xF2] } 1 test utf-6.73 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xF8] } 1 test utf-6.74 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0]G } 4 test utf-6.75 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] } 4 test utf-6.76 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xD0] } 4 test utf-6.77 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xE8] } 4 test utf-6.78 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xF2] } 4 test utf-6.79 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xF2\xA0\xA0\xA0G\xF8] } 4 test utf-6.80 {Tcl_UtfNext - overlong sequences} testutfnext { testutfnext \x00 } 2 test utf-6.81 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xC0\x81] } 1 test utf-6.82 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xC1\x80] } 1 test utf-6.83 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xC2\x80] } 2 test utf-6.84 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xE0\x80\x80] } 1 test utf-6.85 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xE0\xA0\x80] } 3 test utf-6.86 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xF0\x80\x80\x80] } 1 test utf-6.87 {Tcl_UtfNext - overlong sequences} {testutfnext testbytestring} { testutfnext [testbytestring \xF0\x90\x80\x80] } 4 test utf-6.88 {Tcl_UtfNext, pointing to 2th byte of 3-byte valid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xA0\x00] } 2 test utf-6.89 {Tcl_UtfNext, pointing to 2th byte of 3-byte invalid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \x80\x80\x00] } 2 test utf-6.90 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring} { testutfnext [testbytestring \xF4\x8F\xBF\xBF] } 4 test utf-6.91 {Tcl_UtfNext, validity check [493dccc2de]} {testutfnext testbytestring} { testutfnext [testbytestring \xF4\x90\x80\x80] } 1 test utf-6.92 {Tcl_UtfNext, pointing to 2th byte of 4-byte valid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xA0\xA0] } 3 test utf-6.93 {Tcl_UtfNext, pointing to 2th byte of 4-byte invalid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \x80\x80\x80] } 3 test utf-6.94 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \xA0\xA0\xA0\xA0] } 3 test utf-6.95 {Tcl_UtfNext, pointing to 2th byte of 5-byte invalid sequence} {testutfnext testbytestring} { testutfnext [testbytestring \x80\x80\x80\x80] } 3 test utf-7.1 {Tcl_UtfPrev} testutfprev { testutfprev {} } 0 test utf-7.2 {Tcl_UtfPrev} testutfprev { testutfprev A } 0 test utf-7.3 {Tcl_UtfPrev} testutfprev { testutfprev AA } 1 test utf-7.4 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8] } 1 test utf-7.4.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 2 } 1 test utf-7.4.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xF8\xA0\xA0] 2 } 1 test utf-7.5 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2] } 1 test utf-7.5.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 2 } 1 test utf-7.5.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xF8\xA0\xA0] 2 } 1 test utf-7.6 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8] } 1 test utf-7.6.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xA0\xA0] 2 } 1 test utf-7.6.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xF8\xA0\xA0] 2 } 1 test utf-7.7 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0] } 1 test utf-7.7.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 2 } 1 test utf-7.7.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xF8\xA0\xA0] 2 } 1 test utf-7.8 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0] } 1 test utf-7.8.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0\xA0] 2 } 1 test utf-7.8.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xF8\xA0\xA0] 2 } 1 test utf-7.9 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0] } 2 test utf-7.9.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 3 } 2 test utf-7.9.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xF8\xA0] 3 } 2 test utf-7.10 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0] } 1 test utf-7.10.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 3 } 1 test utf-7.10.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xF8\xA0] 3 } 1 test utf-7.11 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0] } 1 test utf-7.11.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xA0\xA0] 3 } 1 test utf-7.11.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xF8\xA0] 3 } 1 test utf-7.11.3 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xF8] 3 } 1 test utf-7.12 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0] } 1 test utf-7.12.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 3 } 1 test utf-7.12.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xF8\xA0] 3 } 1 test utf-7.13 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0] } 2 test utf-7.13.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0\xA0] 3 } 2 test utf-7.13.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xF8\xA0] 3 } 2 test utf-7.14 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0] } 3 test utf-7.14.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0\xA0] 4 } 3 test utf-7.14.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF8\xA0\xA0\xF8] 4 } 3 test utf-7.15 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xA0] } 1 test utf-7.15.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xA0\xA0] 4 } 1 test utf-7.15.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xF2\xA0\xA0\xF8] 4 } 1 test utf-7.16 {Tcl_UtfPrev} testutfprev { testutfprev A蠠 } 1 test utf-7.16.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xA0\xA0] 4 } 1 test utf-7.16.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A蠠[testbytestring \xF8] 4 } 1 test utf-7.17 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0] } 3 test utf-7.17.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0\xA0] 4 } 3 test utf-7.17.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0\xF8] 4 } 3 test utf-7.18.0 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0] } 3 test utf-7.18.1 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0\xA0] 4 } 3 test utf-7.18.2 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0\xF8] 4 } 3 test utf-7.19 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xF8\xA0\xA0\xA0] } 4 test utf-7.20 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xF2\xA0\xA0\xA0] } 1 test utf-7.21 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xE8\xA0\xA0\xA0] } 4 test utf-7.22 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev A[testbytestring \xD0\xA0\xA0\xA0] } 4 test utf-7.23 {Tcl_UtfPrev} {testutfprev testbytestring} { testutfprev [testbytestring A\xA0\xA0\xA0\xA0] } 4 test utf-7.24 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xC0\x81] } 2 test utf-7.25 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xC0\x81] 2 } 1 test utf-7.26 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\x80\x80] } 3 test utf-7.27 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\x80] } 2 test utf-7.27.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\x80\x80] 3 } 2 test utf-7.28 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0] } 1 test utf-7.28.1 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\x80\x80] 2 } 1 test utf-7.29 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x80\x80\x80] } 4 test utf-7.30 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x80\x80\x80] 4 } 3 test utf-7.31 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x80\x80\x80] 3 } 2 test utf-7.32 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x80\x80\x80] 2 } 1 test utf-7.33 {Tcl_UtfPrev -- overlong sequence} testutfprev { testutfprev A\x00 } 1 test utf-7.34 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xC1\x80] } 2 test utf-7.35 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xC2\x80] } 1 test utf-7.36 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\xA0\x80] } 1 test utf-7.37 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\xA0\x80] 3 } 1 test utf-7.38 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xE0\xA0\x80] 2 } 1 test utf-7.39 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x90\x80\x80] } 1 test utf-7.40 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x90\x80\x80] 4 } 1 test utf-7.41 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x90\x80\x80] 3 } 1 test utf-7.42 {Tcl_UtfPrev -- overlong sequence} {testutfprev testbytestring} { testutfprev A[testbytestring \xF0\x90\x80\x80] 2 } 1 test utf-7.43 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { testutfprev [testbytestring \xA0] } 0 test utf-7.44 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { testutfprev [testbytestring \xA0\xA0] } 1 test utf-7.45 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { testutfprev [testbytestring \xA0\xA0\xA0] } 2 test utf-7.46 {Tcl_UtfPrev -- no lead byte at start} {testutfprev testbytestring} { testutfprev [testbytestring \xA0\xA0\xA0\xA0] } 3 test utf-7.47 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} {testutfprev testbytestring} { testutfprev [testbytestring \xE8\xA0] } 0 test utf-7.47.1 {Tcl_UtfPrev, pointing to 3th byte of 3-byte valid sequence} testutfprev { testutfprev 蠠 2 } 0 test utf-7.47.2 {Tcl_UtfPrev, pointing to 3th byte of 3-byte invalid sequence} {testutfprev testbytestring} { testutfprev [testbytestring \xE8\xA0\x00] 2 } 0 test utf-7.48.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x8F\xBF\xBF] } 1 test utf-7.48.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 4 } 1 test utf-7.48.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 3 } 1 test utf-7.48.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x8F\xBF\xBF] 2 } 1 test utf-7.49.0 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x90\x80\x80] } 4 test utf-7.49.1 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x90\x80\x80] 4 } 3 test utf-7.49.2 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x90\x80\x80] 3 } 2 test utf-7.49.3 {Tcl_UtfPrev, validity check [493dccc2de]} {testutfprev testbytestring} { testutfprev A[testbytestring \xF4\x90\x80\x80] 2 } 1 test utf-8.1 {Tcl_UniCharAtIndex: index = 0} { string index abcd 0 } a test utf-8.2 {Tcl_UniCharAtIndex: index = 0} { string index 乎ɚ 0 } 乎 test utf-8.3 {Tcl_UniCharAtIndex: index > 0} { string index abcd 2 } c test utf-8.4 {Tcl_UniCharAtIndex: index > 0} { string index 乎ɚÿՃ 2 } ÿ test utf-8.5 {Tcl_UniCharAtIndex: high surrogate} { string index \uD842 0 } \uD842 test utf-8.6 {Tcl_UniCharAtIndex: low surrogate} { string index \uDC42 0 } \uDC42 test utf-8.7 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 0 } 😀 test utf-8.8 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 1 } G test utf-8.9 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 2 } {} test utf-8.10 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 0 } 😀 test utf-8.11 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 1 } G test utf-8.12 {Tcl_UniCharAtIndex: Emoji} { string index 😀G 2 } {} test utf-9.1 {Tcl_UtfAtIndex: index = 0} { string range abcd 0 2 } abc test utf-9.2 {Tcl_UtfAtIndex: index > 0} { string range 乎ɚÿՃklmnop 1 5 } ɚÿՃkl test utf-9.3 {Tcl_UtfAtIndex: index = 0, Emoji} { string range 😀G 0 0 } 😀 test utf-9.4 {Tcl_UtfAtIndex: index > 0, Emoji} { string range 😀G 1 1 } G test utf-9.5 {Tcl_UtfAtIndex: index > 0, Emoji} { string range 😀G 2 2 } {} test utf-9.6 {Tcl_UtfAtIndex: index = 0, Emoji} { string range 😀G 0 0 } 😀 test utf-9.7 {Tcl_UtfAtIndex: index > 0, Emoji} { string range 😀G 1 1 } G test utf-9.8 {Tcl_UtfAtIndex: index > 0, Emoji} { string range 😀G 2 2 } {} test utf-10.1 {Tcl_UtfBackslash: dst == NULL} { set x \n } { } test utf-10.2 {Tcl_UtfBackslash: \u subst} testbytestring { expr {"\uA2" eq [testbytestring \xC2\xA2]} } 1 test utf-10.3 {Tcl_UtfBackslash: longer \u subst} testbytestring { expr {"\u4E21" eq [testbytestring \xE4\xB8\xA1]} } 1 test utf-10.4 {Tcl_UtfBackslash: stops at first non-hex} testbytestring { expr {"\u4E2k" eq "[testbytestring \xD3\xA2]k"} } 1 test utf-10.5 {Tcl_UtfBackslash: stops after 4 hex chars} testbytestring { expr {"\u4E216" eq "[testbytestring \xE4\xB8\xA1]6"} } 1 test utf-10.6 {Tcl_UtfBackslash: stops after 5 hex chars} testbytestring { expr {"\U1E2165" eq "[testbytestring \xF0\x9E\x88\x96]5"} } 1 test utf-10.7 {Tcl_UtfBackslash: stops after 6 hex chars} testbytestring { expr {"\U10E2165" eq "[testbytestring \xF4\x8E\x88\x96]5"} } 1 proc bsCheck {char num {constraints {}}} { global errNum test utf-10.$errNum {backslash substitution} $constraints { scan $char %c value set value } $num incr errNum } set errNum 8 bsCheck \b 8 bsCheck \e 101 bsCheck \f 12 bsCheck \n 10 bsCheck \r 13 bsCheck \t 9 bsCheck \v 11 bsCheck \{ 123 bsCheck \} 125 bsCheck \[ 91 bsCheck \] 93 bsCheck \$ 36 bsCheck \ 32 bsCheck \; 59 bsCheck \\ 92 bsCheck \Ca 67 bsCheck \Ma 77 bsCheck \CMa 67 # prior to 8.3, this returned 8, as \8 as accepted as an # octal value - but it isn't! [Bug: 3975] bsCheck \8a 56 bsCheck \14 12 bsCheck \141 97 bsCheck b\0 98 bsCheck \x 120 bsCheck \xa 10 bsCheck \xA 10 bsCheck \x41 65 bsCheck \x541 84 bsCheck \u 117 bsCheck \uk 117 bsCheck \u41 65 bsCheck \ua 10 bsCheck \uA 10 bsCheck \340 224 bsCheck \uA1 161 bsCheck \u4E21 20001 bsCheck \741 60 bsCheck \U 85 bsCheck \Uk 85 bsCheck \U41 65 bsCheck \Ua 10 bsCheck \UA 10 bsCheck \UA1 161 bsCheck \U4E21 20001 bsCheck \U004E21 20001 bsCheck \U00004E21 20001 bsCheck \U0000004E21 78 bsCheck \U00110000 69632 bsCheck \U01100000 69632 bsCheck \U11000000 69632 bsCheck \U0010FFFF 1114111 bsCheck \U010FFFF0 1114111 bsCheck \U10FFFF00 1114111 bsCheck \UFFFFFFFF 1048575 test utf-11.1 {Tcl_UtfToUpper} { string toupper {} } {} test utf-11.2 {Tcl_UtfToUpper} { string toupper abc } ABC test utf-11.3 {Tcl_UtfToUpper} { string toupper \xE3gh } \xC3GH test utf-11.4 {Tcl_UtfToUpper} { string toupper ǣgh } ǢGH test utf-11.5 {Tcl_UtfToUpper Georgian (new in Unicode 11)} { string toupper აᲐ } ᲐᲐ test utf-11.6 {Tcl_UtfToUpper beyond U+FFFF} { string toupper 𐐨 } 𐐀 test utf-11.7 {Tcl_UtfToUpper beyond U+FFFF} { string toupper 𐐨 } 𐐀 test utf-11.8 {Tcl_UtfToUpper low/high surrogate)} { string toupper \uDC24\uD824 } \uDC24\uD824 test utf-12.1 {Tcl_UtfToLower} { string tolower {} } {} test utf-12.2 {Tcl_UtfToLower} { string tolower ABC } abc test utf-12.3 {Tcl_UtfToLower} { string tolower ÃGH } ãgh test utf-12.4 {Tcl_UtfToLower} { string tolower ǢGH } ǣgh test utf-12.5 {Tcl_UtfToLower Georgian (new in Unicode 11)} { string tolower აᲐ } აა test utf-12.6 {Tcl_UtfToLower low/high surrogate)} { string tolower \uDC24\uD824 } \uDC24\uD824 test utf-12.7 {Tcl_UtfToLower beyond U+FFFF} { string tolower 𐐀 } 𐐨 test utf-12.8 {Tcl_UtfToLower beyond U+FFFF} { string tolower 𐐀 } 𐐨 test utf-13.1 {Tcl_UtfToTitle} { string totitle {} } {} test utf-13.2 {Tcl_UtfToTitle} { string totitle abc } Abc test utf-13.3 {Tcl_UtfToTitle} { string totitle ãGH } Ãgh test utf-13.4 {Tcl_UtfToTitle} { string totitle dzAB } Dzab test utf-13.5 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { string totitle აᲐ } აᲐ test utf-13.6 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { string totitle Აა } Აა test utf-13.7 {Tcl_UtfToTitle low/high surrogate)} { string totitle \uDC24\uD824 } \uDC24\uD824 test utf-13.8 {Tcl_UtfToTitle beyond U+FFFF} { string totitle 𐐨𐐀 } 𐐀𐐨 test utf-13.9 {Tcl_UtfToTitle beyond U+FFFF} { string totitle 𐐨𐐀 } 𐐀𐐨 test utf-14.1 {Tcl_UtfNcasecmp} { string compare -nocase a b } -1 test utf-14.2 {Tcl_UtfNcasecmp} { string compare -nocase b a } 1 test utf-14.3 {Tcl_UtfNcasecmp} { string compare -nocase B a } 1 test utf-14.4 {Tcl_UtfNcasecmp} { string compare -nocase aBcB abca } 1 test utf-15.1 {Tcl_UniCharToUpper, negative delta} { string toupper aA } AA test utf-15.2 {Tcl_UniCharToUpper, positive delta} { string toupper Ÿÿ } ŸŸ test utf-15.3 {Tcl_UniCharToUpper, no delta} { string toupper ! } ! test utf-16.1 {Tcl_UniCharToLower, negative delta} { string tolower aA } aa test utf-16.2 {Tcl_UniCharToLower, positive delta} { string tolower ŸÿꞍDž } ÿÿɥdž test utf-17.1 {Tcl_UniCharToLower, no delta} { string tolower ! } ! test utf-18.1 {Tcl_UniCharToTitle, add one for title} { string totitle DŽ } Dž test utf-18.2 {Tcl_UniCharToTitle, subtract one for title} { string totitle dž } Dž test utf-18.3 {Tcl_UniCharToTitle, subtract delta for title (positive)} { string totitle ſ } S test utf-18.4 {Tcl_UniCharToTitle, subtract delta for title (negative)} { string totitle ÿ } Ÿ test utf-18.5 {Tcl_UniCharToTitle, no delta} { string totitle ! } ! test utf-19.1 {TclUniCharLen} -body { list [regexp \\d abc456def foo] $foo } -cleanup { unset -nocomplain foo } -result {1 4} test utf-20.1 {TclUniCharNcmp} { string compare [string range [format %c 0xFFFF] 0 0] [string range [format %c 0x10000] 0 0] } -1 test utf-20.2 {[4c591fa487] Tcl_UniCharNcmp/Tcl_UtfNcmp} { set one [format %c 0xFFFF] set two [format %c 0x10000] set first [string compare $one $two] string range $one 0 0 string range $two 0 0 set second [string compare $one $two] expr {($first == $second) ? "agree" : "disagree"} } agree test utf-21.1 {Tcl_UniCharIsAlnum} { # this returns 1 with Unicode 7 compliance string is alnum ၀ȟȠ } 1 test utf-21.2 {unicode alnum char in regc_locale.c} { # this returns 1 with Unicode 7 compliance list [regexp {^[[:alnum:]]+$} ၀ȟȠ] [regexp {^\w+$} ၀ȟȠ_‿⁀⁔︳︴﹍﹎﹏_] } {1 1} test utf-21.3 {unicode print char in regc_locale.c} { # this returns 1 with Unicode 7 compliance regexp {^[[:print:]]+$} ﯁ } 1 test utf-21.4 {Tcl_UniCharIsGraph} { # [Bug 3464428] string is graph Ġ } 1 test utf-21.5 {unicode graph char in regc_locale.c} { # [Bug 3464428] regexp {^[[:graph:]]+$} Ġ } 1 test utf-21.6 {Tcl_UniCharIsGraph} { # [Bug 3464428] string is graph \xA0 } 0 test utf-21.7 {unicode graph char in regc_locale.c} { # [Bug 3464428] regexp {[[:graph:]]} \x20\xA0\u2028\u2029 } 0 test utf-21.8 {Tcl_UniCharIsPrint} { # [Bug 3464428] string is print \x09 } 0 test utf-21.9 {unicode print char in regc_locale.c} { # [Bug 3464428] regexp {[[:print:]]} \x09 } 0 test utf-21.10 {unicode print char in regc_locale.c} { # [Bug 3464428] regexp {[[:print:]]} \x09 } 0 test utf-21.11 {Tcl_UniCharIsControl} { # [Bug 3464428] string is control \x00\x1F\xAD\u0605\u061C\u180E\u2066\uFEFF } 1 test utf-21.12 {unicode control char in regc_locale.c} { # [Bug 3464428], [Bug a876646efe] regexp {^[[:cntrl:]]*$} \x00\x1F\xAD\u0605\u061C\u180E\u2066\uFEFF } 1 test utf-22.1 {Tcl_UniCharIsWordChar} { string wordend "xyz123_bar fg" 0 } 10 test utf-22.2 {Tcl_UniCharIsWordChar} { string wordend "x傀z123_bar‼ fg" 0 } 10 test utf-23.1 {Tcl_UniCharIsAlpha} { # this returns 1 with Unicode 7 compliance string is alpha ȟȠͿԯ } 1 test utf-23.2 {unicode alpha char in regc_locale.c} { # this returns 1 with Unicode 7 compliance regexp {^[[:alpha:]]+$} ȟȠͿԯ } 1 test utf-24.1 {Tcl_UniCharIsDigit} { # this returns 1 with Unicode 7 compliance string is digit ၀꯰ } 1 test utf-24.2 {unicode digit char in regc_locale.c} { # this returns 1 with Unicode 7 compliance list [regexp {^[[:digit:]]+$} ၀꯰] [regexp {^\d+$} ၀꯰] } {1 1} test utf-24.3 {Tcl_UniCharIsSpace} { # this returns 1 with Unicode 7 compliance string is space \u1680\u180E\u202F } 1 test utf-24.4 {unicode space char in regc_locale.c} { # this returns 1 with Unicode 7 compliance list [regexp {^[[:space:]]+$} \u1680\u180E\u202F] [regexp {^\s+$} \u1680\u180E\u202F] } {1 1} test utf-24.5 {Tcl_UniCharIsSpace} tip413 { # this returns 1 with Unicode 7/TIP 413 compliance string is space \x85\u1680\u180E\u200B\u202F\u2060 } 1 test utf-24.6 {unicode space char in regc_locale.c} tip413 { # this returns 1 with Unicode 7/TIP 413 compliance list [regexp {^[[:space:]]+$} \x85\u1680\u180E\u200B\u202F\u2060] [regexp {^\s+$} \x85\u1680\u180E\u200B\u202F\u2060] } {1 1} test utf-25.1 {tupper/tolower/totitle out of range values} testuniclass { list [testuniclass 0x11FFFF] \ [testuniclass 0x1FFFFF] \ [testuniclass 0x200041] \ [testuniclass 0x200061] \ [testuniclass 0x20005F] \ [testuniclass 0x200030] \ [testuniclass 0x200020] \ [testuniclass 0x200001] \ [testuniclass 0x20002C] \ [testuniclass -1] } [list {1179647 1179647 1179647} \ {2097151 2097151 2097151} \ {97 65 65 upper alnum alpha word graph print} \ {97 65 65 lower alnum alpha word graph print} \ {95 95 95 word graph print punct} \ {48 48 48 alnum digit word graph print} \ {32 32 32 space print} \ {1 1 1 control} \ {44 44 44 graph print punct} \ {2097151 2097151 2097151} ] proc UniCharCaseCmpTest {order one two {constraints {}}} { variable count test utf-25.$count {Tcl_UniCharNcasecmp} -setup { testobj freeallvars } -constraints [linsert $constraints 0 teststringobj] -cleanup { testobj freeallvars } -body { teststringobj set 1 $one teststringobj set 2 $two teststringobj maxchars 1 teststringobj maxchars 2 set result [string compare -nocase [teststringobj get 1] [teststringobj get 2]] if {$result eq [string map {< -1 = 0 > 1} $order]} { set result ok } else { set result "'$one' should be $order '$two' (no case)" } set result } -result ok incr count } variable count 1 UniCharCaseCmpTest < a b UniCharCaseCmpTest > b a UniCharCaseCmpTest > B a UniCharCaseCmpTest > aBcB abca UniCharCaseCmpTest < \uFFFF [format %c 0x10000] UniCharCaseCmpTest < \uFFFF \U10000 UniCharCaseCmpTest > [format %c 0x10000] \uFFFF UniCharCaseCmpTest > \U10000 \uFFFF test utf-26.1 {Tcl_UniCharDString} -setup { testobj freeallvars } -constraints {teststringobj testbytestring} -cleanup { testobj freeallvars } -body { teststringobj set 1 foo teststringobj maxchars 1 teststringobj append 1 [testbytestring barsoom\xF2\xC2\x80] 10 scan [string index [teststringobj get 1] 11] %c } -result 128 unset count rename UniCharCaseCmpTest {} proc GetUniCharTest {s index result} { variable count # Use quotes, not {} so test output shows exact string on error test getunichar-1.$count "Tcl_GetUniChar $s $index" \ -constraints testgetunichar \ -body "testgetunichar $s $index" \ -result $result incr count } variable count 1 set errorIndicator -1 GetUniCharTest abcd -2 $errorIndicator GetUniCharTest abcd -1 $errorIndicator GetUniCharTest abcd 0 97 ;# a -> ASCII 97 GetUniCharTest abcd 3 100 GetUniCharTest abcd 4 $errorIndicator GetUniCharTest abcd 1000 $errorIndicator GetUniCharTest \xe0bc\xe1 -2 $errorIndicator GetUniCharTest \xe0bc\xe1 -1 $errorIndicator GetUniCharTest \xe0bc\xe1 0 224 ;# \xe0 == 224 GetUniCharTest \xe0bc\xe1 3 225 GetUniCharTest \xe0bc\xe1 4 $errorIndicator GetUniCharTest \xe0bc\xe1 1000 $errorIndicator unset count rename GetUniCharTest "" # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/upvar.test0000644000175000017500000004155315104661341014757 0ustar sergeisergei# Commands covered: 'upvar', 'namespace upvar' # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testupvar [llength [info commands testupvar]] test upvar-1.1 {reading variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2} proc p2 {} {upvar a x1 b x2 c x3 d x4; set a abc; list $x1 $x2 $x3 $x4 $a} p1 foo bar } {foo bar 22 33 abc} test upvar-1.2 {reading variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2} proc p2 {} {p3} proc p3 {} {upvar 2 a x1 b x2 c x3 d x4; set a abc; list $x1 $x2 $x3 $x4 $a} p1 foo bar } {foo bar 22 33 abc} test upvar-1.3 {reading variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2} proc p2 {} {p3} proc p3 {} { upvar #1 a x1 b x2 c x3 d x4 set a abc list $x1 $x2 $x3 $x4 $a } p1 foo bar } {foo bar 22 33 abc} test upvar-1.4 {reading variables with upvar} { set x1 44 set x2 55 proc p1 {} {p2} proc p2 {} { upvar 2 x1 x1 x2 a upvar #0 x1 b set c $b incr b 3 list $x1 $a $b } p1 } {47 55 47} test upvar-1.5 {reading array elements with upvar} { proc p1 {} {set a(0) zeroth; set a(1) first; p2} proc p2 {} {upvar a(0) x; set x} p1 } {zeroth} test upvar-2.1 {writing variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2; list $a $b $c $d} proc p2 {} { upvar a x1 b x2 c x3 d x4 set x1 14 set x4 88 } p1 foo bar } {14 bar 22 88} test upvar-2.2 {writing variables with upvar} { set x1 44 set x2 55 proc p1 {x1 x2} { upvar #0 x1 a upvar x2 b set a $x1 set b $x2 } p1 newbits morebits list $x1 $x2 } {newbits morebits} test upvar-2.3 {writing variables with upvar} { catch {unset x1} catch {unset x2} proc p1 {x1 x2} { upvar #0 x1 a upvar x2 b set a $x1 set b $x2 } p1 newbits morebits list [catch {set x1} msg] $msg [catch {set x2} msg] $msg } {0 newbits 0 morebits} test upvar-2.4 {writing array elements with upvar} { proc p1 {} {set a(0) zeroth; set a(1) first; list [p2] $a(0)} proc p2 {} {upvar a(0) x; set x xyzzy} p1 } {xyzzy xyzzy} test upvar-3.1 {unsetting variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2; lsort [info vars]} proc p2 {} { upvar 1 a x1 d x2 unset x1 x2 } p1 foo bar } {b c} test upvar-3.2 {unsetting variables with upvar} { proc p1 {a b} {set c 22; set d 33; p2; lsort [info vars]} proc p2 {} { upvar 1 a x1 d x2 unset x1 x2 set x2 28 } p1 foo bar } {b c d} test upvar-3.3 {unsetting variables with upvar} { set x1 44 set x2 55 proc p1 {} {p2} proc p2 {} { upvar 2 x1 a upvar #0 x2 b unset a b } p1 list [info exists x1] [info exists x2] } {0 0} test upvar-3.4 {unsetting variables with upvar} { set x1 44 set x2 55 proc p1 {} { upvar x1 a x2 b unset a b set b 118 } p1 list [info exists x1] [catch {set x2} msg] $msg } {0 0 118} test upvar-3.5 {unsetting array elements with upvar} { proc p1 {} { set a(0) zeroth set a(1) first set a(2) second p2 array names a } proc p2 {} {upvar a(0) x; unset x} lsort [p1] } {1 2} test upvar-3.6 {unsetting then resetting array elements with upvar} { proc p1 {} { set a(0) zeroth set a(1) first set a(2) second p2 list [lsort [array names a]] [catch {set a(0)} msg] $msg } proc p2 {} {upvar a(0) x; unset x; set x 12345} p1 } {{0 1 2} 0 12345} test upvar-4.1 {nested upvars} { set x1 88 proc p1 {a b} {set c 22; set d 33; p2} proc p2 {} {global x1; upvar c x2; p3} proc p3 {} { upvar x1 a x2 b list $a $b } p1 14 15 } {88 22} test upvar-4.2 {nested upvars} { set x1 88 proc p1 {a b} {set c 22; set d 33; p2; list $a $b $c $d} proc p2 {} {global x1; upvar c x2; p3} proc p3 {} { upvar x1 a x2 b set a foo set b bar } list [p1 14 15] $x1 } {{14 15 bar 33} foo} proc tproc {args} {global x; set x [list $args [uplevel info vars]]} test upvar-5.1 {traces involving upvars} { proc p1 {a b} {set c 22; set d 33; trace add var c {read write} tproc; p2} proc p2 {} {upvar c x1; set x1 22} set x --- p1 foo bar set x } {{x1 {} write} x1} test upvar-5.2 {traces involving upvars} { proc p1 {a b} {set c 22; set d 33; trace add var c {read write} tproc; p2} proc p2 {} {upvar c x1; set x1} set x --- p1 foo bar set x } {{x1 {} read} x1} test upvar-5.3 {traces involving upvars} { proc p1 {a b} {set c 22; set d 33; trace add var c {read write unset} tproc; p2} proc p2 {} {upvar c x1; unset x1} set x --- p1 foo bar set x } {{x1 {} unset} x1} test upvar-5.4 {read trace on upvar array element} -body { proc p1 {a b} { array set foo {c 22 d 33} trace add variable foo {read write unset} tproc p2 trace remove variable foo {read write unset} tproc } proc p2 {} { upvar foo(c) x1 set x1 } set x --- p1 foo bar set x } -result {{x1 c read} x1} test upvar-5.5 {write trace on upvar array element} -body { proc p1 {a b} { array set foo {c 22 d 33} trace add variable foo {read write unset} tproc p2 trace remove variable foo {read write unset} tproc } proc p2 {} { upvar foo(c) x1 set x1 22 } set x --- p1 foo bar set x } -result {{x1 c write} x1} test upvar-5.6 {unset trace on upvar array element} -body { proc p1 {a b} { array set foo {c 22 d 33} trace add variable foo {read write unset} tproc p2 trace remove variable foo {read write unset} tproc } proc p2 {} { upvar foo(c) x1 unset x1 } set x --- p1 foo bar set x } -result {{x1 c unset} x1} test upvar-5.7 {trace on non-existent upvar array element} -body { proc p1 {a b} { array set foo {} trace add variable foo {read write unset} tproc p2 trace remove variable foo {read write unset} tproc return [array get foo] } proc p2 {} { upvar foo(hi) x1 set x1 there } set x --- lappend x [p1 foo bar] set x } -result {{x1 hi write} x1 {hi there}} test upvar-6.1 {retargeting an upvar} { proc p1 {} { set a(0) zeroth set a(1) first set a(2) second p2 } proc p2 {} { upvar a x set result {} foreach i [array names x] { upvar a($i) x lappend result $x } lsort $result } p1 } {first second zeroth} test upvar-6.2 {retargeting an upvar} { set x 44 set y abcde proc p1 {} { global x set result $x upvar y x lappend result $x } p1 } {44 abcde} test upvar-6.3 {retargeting an upvar} { set x 44 set y abcde proc p1 {} { upvar y x lappend result $x global x lappend result $x } p1 } {abcde 44} test upvar-6.4 { retargeting a variable created by upvar to itself is allowed } -body { catch { unset x } catch { unset y } set res {} set x abcde set res [catch { upvar 0 x x } cres copts] lappend res [dict get $copts -errorcode] upvar 0 x y lappend res $y upvar 0 y y lappend res $y return $res } -cleanup { upvar 0 {} y } -result {1 {TCL UPVAR SELF} abcde abcde} test upvar-7.1 {upvar to same level} { set x 44 set y 55 catch {unset uv} upvar #0 x uv set uv abc upvar 0 y uv set uv xyzzy list $x $y } {abc xyzzy} test upvar-7.2 {upvar to same level} { set x 1234 set y 4567 proc p1 {x y} { upvar 0 x uv set uv $y return "$x $y" } p1 44 89 } {89 89} test upvar-7.3 {upvar to same level} { set x 1234 set y 4567 proc p1 {x y} { upvar #1 x uv set uv $y return "$x $y" } p1 xyz abc } {abc abc} test upvar-7.4 {upvar to same level: tricky problems when deleting variable table} { proc tt {} {upvar #1 toto loc; return $loc} list [catch tt msg] $msg } {1 {can't read "loc": no such variable}} test upvar-7.5 {potential memory leak when deleting variable table} { proc leak {} { array set foo {1 2 3 4} upvar 0 foo(1) bar } leak } {} test upvar-8.1 {errors in upvar command} -returnCodes error -body { upvar } -result {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"} test upvar-8.2 {errors in upvar command} -returnCodes error -body { upvar 1 } -result {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"} test upvar-8.2.1 {upvar with numeric first argument} { apply {{} {set 0 ok; apply {{} {upvar 0 x; return $x}}}} } ok test upvar-8.3 {errors in upvar command} -returnCodes error -body { proc p1 {} {upvar a b c} p1 } -result {bad level "a"} test upvar-8.3.1 {bad level for upvar (upvar at top-level, bug [775ee88560])} -body { proc p1 {} { uplevel { upvar b b; lappend b UNEXPECTED } } uplevel #0 { p1 } } -returnCodes error -result {bad level "1"} test upvar-8.3.2 {bad level for upvar (upvar at top-level, bug [775ee88560])} -setup { interp create i } -body { i eval { upvar b b; lappend b UNEXPECTED } } -returnCodes error -result {bad level "1"} -cleanup { interp delete i } test upvar-8.4 {errors in upvar command} -returnCodes error -body { proc p1 {} {upvar 0 b b} p1 } -result {can't upvar from variable to itself} test upvar-8.5 {errors in upvar command} -returnCodes error -body { proc p1 {} {upvar 0 a b; upvar 0 b a} p1 } -result {can't upvar from variable to itself} test upvar-8.6 {errors in upvar command} -returnCodes error -body { proc p1 {} {set a 33; upvar b a} p1 } -result {variable "a" already exists} test upvar-8.7 {errors in upvar command} -returnCodes error -body { proc p1 {} {trace add variable a write foo; upvar b a} p1 } -result {variable "a" has traces: can't use for upvar} test upvar-8.8 {create nested array with upvar} -body { proc p1 {} {upvar x(a) b; set b(2) 44} catch {unset x} p1 } -returnCodes error -cleanup { unset x } -result {can't set "b(2)": variable isn't array} test upvar-8.9 {upvar won't create namespace variable that refers to procedure variable} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename MakeLink ""} namespace eval ::test_ns_1 {} } -returnCodes error -body { proc MakeLink {a} { namespace eval ::test_ns_1 { upvar a a } unset ::test_ns_1::a } MakeLink 1 } -result {bad variable name "a": can't create namespace variable that refers to procedure variable} test upvar-8.10 {upvar will create element alias for new array element} -setup { catch {unset upvarArray} } -body { array set upvarArray {} catch {upvar 0 upvarArray(elem) upvarArrayElemAlias} } -result {0} test upvar-8.11 {upvar will not create a variable that looks like an array} -setup { catch {unset upvarArray} } -body { array set upvarArray {} upvar 0 upvarArray(elem) upvarArrayElemAlias(elem) } -returnCodes 1 -match glob -result * test upvar-9.1 {Tcl_UpVar2 procedure} testupvar { list [catch {testupvar xyz a {} x global} msg] $msg } {1 {bad level "1"}} test upvar-9.1.1 {TclGetFrame, via Tcl_UpVar2} testupvar { apply {{} {testupvar xyz a {} x local; set x foo}} set a } foo test upvar-9.2 {Tcl_UpVar2 procedure} testupvar { catch {unset a} catch {unset x} set a 44 list [catch "testupvar #0 a 1 x global" msg] $msg } {1 {can't access "a(1)": variable isn't array}} test upvar-9.3 {Tcl_UpVar2 procedure} testupvar { proc foo {} { testupvar 1 a {} x local set x } catch {unset a} catch {unset x} set a 44 foo } {44} test upvar-9.4 {Tcl_UpVar2 procedure} testupvar { proc foo {} { testupvar 1 a {} _up_ global list [catch {set x} msg] $msg } catch {unset a} catch {unset _up_} set a 44 concat [foo] $_up_ } {1 {can't read "x": no such variable} 44} test upvar-9.5 {Tcl_UpVar2 procedure} testupvar { proc foo {} { testupvar 1 a b x local set x } catch {unset a} catch {unset x} set a(b) 1234 foo } {1234} test upvar-9.6 {Tcl_UpVar procedure} testupvar { proc foo {} { testupvar 1 a x local set x } catch {unset a} catch {unset x} set a xyzzy foo } {xyzzy} test upvar-9.7 {Tcl_UpVar procedure} testupvar { proc foo {} { testupvar #0 a(b) x local set x } catch {unset a} catch {unset x} set a(b) 1234 foo } {1234} catch {unset a} test upvar-10.1 {CompileWord OBOE} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { upvar 1 {*}{ } [return [incr n -[linenumber]]] x }} [linenumber] } -cleanup { rename linenumber {} } -result 1 # # Tests for 'namespace upvar'. As the implementation is essentially the same as # for 'upvar', we only test that the variables are linked correctly, i.e., we # assume that the behaviour of variables once the link is established has # already been tested above. # # Clear out any namespaces called test_ns_* catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_0 { variable x test_ns_0 } set ::x test_global test upvar-NS-1.1 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace upvar ::test_ns_0 x w set w } } -result {test_ns_0} -cleanup { namespace delete test_ns_1 } test upvar-NS-1.2 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { proc a {} { namespace upvar ::test_ns_0 x w set w } return [a] } } -result {test_ns_0} -cleanup { namespace delete test_ns_1 } test upvar-NS-1.3 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace upvar test_ns_0 x w set w } } -returnCodes error -cleanup { namespace delete test_ns_1 } -result {namespace "test_ns_0" not found in "::test_ns_1"} test upvar-NS-1.4 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { proc a {} { namespace upvar test_ns_0 x w set w } return [a] } } -returnCodes error -cleanup { namespace delete test_ns_1 } -result {namespace "test_ns_0" not found in "::test_ns_1"} test upvar-NS-1.5 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace eval test_ns_0 {} namespace upvar test_ns_0 x w set w } } -cleanup { namespace delete test_ns_1 } -result {can't read "w": no such variable} -returnCodes error test upvar-NS-1.6 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace eval test_ns_0 {} proc a {} { namespace upvar test_ns_0 x w set w } return [a] } } -cleanup { namespace delete test_ns_1 } -result {can't read "w": no such variable} -returnCodes error test upvar-NS-1.7 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace eval test_ns_0 { variable x test_ns_1::test_ns_0 } namespace upvar test_ns_0 x w set w } } -cleanup { namespace delete test_ns_1 } -result {test_ns_1::test_ns_0} test upvar-NS-1.8 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { namespace eval test_ns_0 { variable x test_ns_1::test_ns_0 } proc a {} { namespace upvar test_ns_0 x w set w } return [a] } } -cleanup { namespace delete test_ns_1 } -result {test_ns_1::test_ns_0} test upvar-NS-1.9 {nsupvar links to correct variable} -body { namespace eval test_ns_1 { variable x test_ns_1 proc a {} { namespace upvar test_ns_0 x w set w } return [a] } } -returnCodes error -cleanup { namespace delete test_ns_1 } -result {namespace "test_ns_0" not found in "::test_ns_1"} test upvar-NS-2.1 {TIP 323} -returnCodes error -body { namespace upvar } -result {wrong # args: should be "namespace upvar ns ?otherVar myVar ...?"} test upvar-NS-2.2 {TIP 323} -setup { namespace eval test_ns_1 {} } -body { namespace upvar test_ns_1 } -cleanup { namespace delete test_ns_1 } -result {} test upvar-NS-3.1 {CompileWord OBOE} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { namespace upvar {*}{ } [return [incr n -[linenumber]]] x y }} [linenumber] } -cleanup { rename linenumber {} } -result 1 test upvar-NS-3.2 {CompileWord OBOE} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { namespace upvar :: {*}{ } [return [incr n -[linenumber]]] x }} [linenumber] } -cleanup { rename linenumber {} } -result 1 test upvar-NS-3.3 {CompileWord OBOE} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { variable x {*}{ } [return [incr n -[linenumber]]] }} [linenumber] } -cleanup { rename linenumber {} } -result 1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/uplevel.test0000644000175000017500000002101315104661341015263 0ustar sergeisergei# Commands covered: uplevel # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } proc a {x y} { newset z [expr {$x + $y}] return $z } proc newset {name value} { uplevel set $name $value uplevel 1 {uplevel 1 {set xyz 22}} } test uplevel-1.1 {simple operation} { set xyz 0 a 22 33 } 55 test uplevel-1.2 {command is another uplevel command} { set xyz 0 a 22 33 set xyz } 22 proc a1 {} { b1 global a a1 set a $x set a1 $y } proc b1 {} { c1 global b b1 set b $x set b1 $y } proc c1 {} { uplevel 1 set x 111 uplevel #2 set y 222 uplevel 2 set x 333 uplevel #1 set y 444 uplevel 3 set x 555 uplevel #0 set y 666 } a1 test uplevel-2.1 {relative and absolute uplevel} {set a} 333 test uplevel-2.2 {relative and absolute uplevel} {set a1} 444 test uplevel-2.3 {relative and absolute uplevel} {set b} 111 test uplevel-2.4 {relative and absolute uplevel} {set b1} 222 test uplevel-2.5 {relative and absolute uplevel} {set x} 555 test uplevel-2.6 {relative and absolute uplevel} {set y} 666 test uplevel-3.1 {uplevel to same level} { set x 33 uplevel #0 set x 44 set x } 44 test uplevel-3.2 {uplevel to same level} { set x 33 uplevel 0 set x } 33 test uplevel-3.3 {uplevel to same level} { set y xxx proc a1 {} {set y 55; uplevel 0 set y 66; return $y} a1 } 66 test uplevel-3.4 {uplevel to same level} { set y zzz proc a1 {} {set y 55; uplevel #1 set y} a1 } 55 test uplevel-4.0.1 {error: non-existent level} -body { uplevel #0 { uplevel { set y 222 } } } -returnCodes error -result {bad level "1"} test uplevel-4.0.2 {error: non-existent level} -setup { interp create i } -body { i eval { uplevel { set y 222 } } } -returnCodes error -result {bad level "1"} -cleanup { interp delete i } test uplevel-4.1 {error: non-existent level} -returnCodes error -body { apply {{} { uplevel #2 {set y 222} }} } -result {bad level "#2"} test uplevel-4.2 {error: non-existent level} -returnCodes error -body { apply {{} { uplevel 3 {set a b} }} } -result {bad level "3"} test uplevel-4.3 {error: not enough args} -returnCodes error -body { uplevel } -result {wrong # args: should be "uplevel ?level? command ?arg ...?"} test uplevel-4.4 {error: not enough args} -returnCodes error -body { apply {{} { uplevel 1 }} } -result {wrong # args: should be "uplevel ?level? command ?arg ...?"} test uplevel-4.5 {level parsing} { apply {{} {uplevel 0 {}}} } {} test uplevel-4.6 {level parsing} { apply {{} {uplevel #0 {}}} } {} test uplevel-4.7 {level parsing} { apply {{} {uplevel [expr 0] {}}} } {} test uplevel-4.8 {level parsing} { apply {{} {uplevel #[expr 0] {}}} } {} test uplevel-4.9 {level parsing} { apply {{} {uplevel -0 {}}} } {} test uplevel-4.10 {level parsing} { apply {{} {uplevel #-0 {}}} } {} test uplevel-4.11 {level parsing} { apply {{} {uplevel [expr -0] {}}} } {} test uplevel-4.12 {level parsing} { apply {{} {uplevel #[expr -0] {}}} } {} test uplevel-4.13 {level parsing} { apply {{} {uplevel 1 {}}} } {} test uplevel-4.14 {level parsing} { apply {{} {uplevel #1 {}}} } {} test uplevel-4.15 {level parsing} { apply {{} {uplevel [expr 1] {}}} } {} test uplevel-4.16 {level parsing} { apply {{} {uplevel #[expr 1] {}}} } {} test uplevel-4.17 {level parsing} -returnCodes error -body { apply {{} {uplevel -0xffffffff {}}} } -result {bad level "-0xffffffff"} test uplevel-4.18 {level parsing} -returnCodes error -body { apply {{} {uplevel #-0xffffffff {}}} } -result {bad level "#-0xffffffff"} test uplevel-4.19 {level parsing} -returnCodes error -body { apply {{} {uplevel [expr -0xffffffff] {}}} } -result {bad level "-4294967295"} test uplevel-4.20 {level parsing} -returnCodes error -body { apply {{} {uplevel #[expr -0xffffffff] {}}} } -result {bad level "#-4294967295"} test uplevel-4.21 {level parsing} -body { apply {{} {uplevel -1 {}}} } -returnCodes error -result {bad level "-1"} test uplevel-4.22 {level parsing} -body { apply {{} {uplevel #-1 {}}} } -returnCodes error -result {bad level "#-1"} test uplevel-4.23 {level parsing} -body { apply {{} {uplevel [expr -1] {}}} } -returnCodes error -result {bad level "-1"} test uplevel-4.24 {level parsing} -body { apply {{} {uplevel #[expr -1] {}}} } -returnCodes error -result {bad level "#-1"} test uplevel-4.25 {level parsing} -body { apply {{} {uplevel 0xffffffff {}}} } -returnCodes error -result {bad level "0xffffffff"} test uplevel-4.26 {level parsing} -body { apply {{} {uplevel #0xffffffff {}}} } -returnCodes error -result {bad level "#0xffffffff"} test uplevel-4.27 {level parsing} -body { apply {{} {uplevel [expr 0xffffffff] {}}} } -returnCodes error -result {bad level "4294967295"} test uplevel-4.28 {level parsing} -body { apply {{} {uplevel #[expr 0xffffffff] {}}} } -returnCodes error -result {bad level "#4294967295"} test uplevel-4.29 {level parsing} -body { apply {{} {uplevel 0.2 {}}} } -returnCodes error -result {invalid command name "0.2"} test uplevel-4.30 {level parsing} -body { apply {{} {uplevel #0.2 {}}} } -returnCodes error -result {bad level "#0.2"} test uplevel-4.31 {level parsing} -body { apply {{} {uplevel [expr 0.2] {}}} } -returnCodes error -result {invalid command name "0.2"} test uplevel-4.32 {level parsing} -body { apply {{} {uplevel #[expr 0.2] {}}} } -returnCodes error -result {bad level "#0.2"} test uplevel-4.33 {level parsing} -body { apply {{} {uplevel .2 {}}} } -returnCodes error -result {invalid command name ".2"} test uplevel-4.34 {level parsing} -body { apply {{} {uplevel #.2 {}}} } -returnCodes error -result {bad level "#.2"} test uplevel-4.35 {level parsing} -body { apply {{} {uplevel [expr .2] {}}} } -returnCodes error -result {invalid command name "0.2"} test uplevel-4.36 {level parsing} -body { apply {{} {uplevel #[expr .2] {}}} } -returnCodes error -result {bad level "#0.2"} proc a2 {} { uplevel a3 } proc a3 {} { global x y set x [info level] set y [info level 1] } a2 test uplevel-5.1 {info level} {set x} 1 test uplevel-5.2 {info level} {set y} a3 namespace eval ns1 { proc set args {return ::ns1} } proc a2 {} { uplevel {set x ::} } test uplevel-6.1 {uplevel and shadowed cmds} { set res [namespace eval ns1 a2] lappend res [namespace eval ns2 a2] lappend res [namespace eval ns1 a2] namespace eval ns1 {rename set {}} lappend res [namespace eval ns1 a2] } {::ns1 :: ::ns1 ::} # # These tests verify that upleveled scripts run in the correct level and access # the proper variables. # test uplevel-7.1 {var access, no LVT in either level} -setup { set x 1 unset -nocomplain y z } -body { namespace eval foo { set x 2 set y 2 uplevel 1 { set x 3 set y 3 set z 3 } } list $x $y $z } -cleanup { namespace delete foo unset -nocomplain x y z } -result {3 3 3} test uplevel-7.2 {var access, no LVT in upper level} -setup { set x 1 unset -nocomplain y z } -body { proc foo {} { set x 2 set y 2 uplevel 1 { set x 3 set y 3 set z 3 } } foo list $x $y $z } -cleanup { rename foo {} unset -nocomplain x y z } -result {3 3 3} test uplevel-7.3 {var access, LVT in upper level} -setup { proc moo {} { set x 1; #var in LVT unset -nocomplain y z foo list $x $y $z } } -body { proc foo {} { set x 2 set y 2 uplevel 1 { set x 3 set y 3 set z 3 } } foo moo } -cleanup { rename foo {} rename moo {} } -result {3 3 3} test uplevel-8.0 { string representation isn't generated when there is only one argument } -body { set res {} set script [list lindex 5] lappend res [apply {script { uplevel $script }} $script] lappend res [string match {value is a list *no string representation*} [ ::tcl::unsupported::representation $script]] } -cleanup { unset script unset res } -result {5 1} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/unload.test0000644000175000017500000003171015104661341015076 0ustar sergeisergei# Commands covered: unload # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2003-2004 Georgios Petasis # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Figure out what extension is used for shared libraries on this # platform. if {![info exists ext]} { set ext [info sharedlibextension] } # Tests require the existence of one of the DLLs in the dltest directory. set testDir [file join [file dirname [info nameofexecutable]] dltest] set x [file join $testDir tcl9pkgua$ext] set dll "[file tail $x]Required" testConstraint $dll [file readable $x] # Tests also require that this DLL has not already been loaded. set loaded "[file tail $x]Loaded" set alreadyLoaded [info loaded] testConstraint $loaded [expr {![string match *pkgua* $alreadyLoaded]}] set alreadyTotalLoaded [info loaded] # Certain tests need the 'testsimplefilsystem' in tcltest testConstraint testsimplefilesystem \ [llength [info commands testsimplefilesystem]] proc loadIfNotPresent {pkg args} { global testDir ext set loaded [lmap x [info loaded {*}$args] {lindex $x 1}] if {[string totitle $pkg] ni $loaded} { load [file join $testDir tcl9$pkg$ext] } } # Basic tests: parameter testing... test unload-1.1 {basic errors} -returnCodes error -body { unload } -result {wrong # args: should be "unload ?-switch ...? fileName ?prefix? ?interp?"} test unload-1.2 {basic errors} -returnCodes error -body { unload a b c d } -result {wrong # args: should be "unload ?-switch ...? fileName ?prefix? ?interp?"} test unload-1.3 {basic errors} -returnCodes error -body { unload a b foobar } -result {could not find interpreter "foobar"} test unload-1.4 {basic errors} -returnCodes error -body { unload {} } -result {must specify either file name or prefix} test unload-1.5 {basic errors} -returnCodes error -body { unload {} {} } -result {must specify either file name or prefix} test unload-1.6 {basic errors} -returnCodes error -body { unload {} Unknown } -result {library with prefix "Unknown" is loaded statically and cannot be unloaded} test unload-1.7 {-nocomplain switch} { unload -nocomplain {} Unknown } {} set pkgua_loaded {} set pkgua_detached {} set pkgua_unloaded {} # Tests for loading/unloading in trusted (non-safe) interpreters... test unload-2.1 {basic loading of non-unloadable package, with guess for prefix} [list $dll $loaded] { loadIfNotPresent pkga list [pkga_eq abc def] [lsort [info commands pkga_*]] } {0 {pkga_eq pkga_quote}} test unload-2.2 {basic loading of unloadable package, with guess for prefix} [list $dll $loaded] { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [load [file join $testDir tcl9pkgua$ext]] \ [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded } {{} {} {} {} 0 {pkgua_eq pkgua_quote} . {} {}} test unload-2.3 {basic unloading of non-unloadable package, with guess for prefix} -setup { loadIfNotPresent pkga } -constraints [list $dll $loaded] -returnCodes error -match glob -body { unload [file join $testDir tcl9pkga$ext] } -result {file "*" cannot be unloaded under a trusted interpreter} test unload-2.4 {basic unloading of unloadable package, with guess for prefix} -setup { loadIfNotPresent pkgua } -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [unload [file join $testDir tcl9pkgua$ext]] \ [info commands pkgua_*] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded } -result {. {} {} {} {} . . .} test unload-2.5 {reloading of unloaded package, with guess for prefix} -setup { if {$pkgua_loaded eq ""} { loadIfNotPresent pkgua unload [file join $testDir tcl9pkgua$ext] } } -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [load [file join $testDir tcl9pkgua$ext]] \ [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded } -result {. . . {} 0 {pkgua_eq pkgua_quote} .. . .} test unload-2.6 {basic unloading of re-loaded package, with guess for prefix} -setup { # Establish expected state if {$pkgua_loaded eq ""} { loadIfNotPresent pkgua unload [file join $testDir tcl9pkgua$ext] load [file join $testDir tcl9pkgua$ext] } } -constraints [list $dll $loaded] -body { list $pkgua_loaded $pkgua_detached $pkgua_unloaded \ [unload [file join $testDir tcl9pkgua$ext]] \ [info commands pkgua_*] \ $pkgua_loaded $pkgua_detached $pkgua_unloaded } -result {.. . . {} {} .. .. ..} # Tests for loading/unloading in safe interpreters... interp create -safe child child eval { set pkgua_loaded {} set pkgua_detached {} set pkgua_unloaded {} } test unload-3.1 {basic loading of non-unloadable package in a safe interpreter} \ [list $dll $loaded] { catch {rename pkgb_sub {}} load [file join $testDir tcl9pkgb$ext] Pkgb child list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \ [catch {pkgb_sub 12 10} msg2] $msg2 } {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}} test unload-3.2 {basic loading of unloadable package in a safe interpreter} \ [list $dll $loaded] { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir tcl9pkgua$ext] Pkgua child] \ [child eval pkgua_eq abc def] \ [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} test unload-3.3 {unloading of a package that has never been loaded from a safe interpreter} -setup { loadIfNotPresent pkga } -constraints [list $dll $loaded] -returnCodes error -match glob -body { unload [file join $testDir tcl9pkga$ext] {} child } -result {file "*" has never been loaded in this interpreter} test unload-3.4 {basic unloading of a non-unloadable package from a safe interpreter, with guess for prefix} -setup { if {[lsearch -index 1 [info loaded child] Pkgb] < 0} { load [file join $testDir tcl9pkgb$ext] Pkgb child } } -constraints [list $dll $loaded] -returnCodes error -match glob -body { unload [file join $testDir tcl9pkgb$ext] {} child } -result {file "*" cannot be unloaded under a safe interpreter} test unload-3.5 {basic unloading of an unloadable package from a safe interpreter, with guess for prefix} -setup { if {[lsearch -index 1 [info loaded child] Pkgua] < 0} { load [file join $testDir tcl9pkgua$ext] Pkgua child } } -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir tcl9pkgua$ext] {} child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{. {} {}} {} {} {. . .}} test unload-3.6 {reloading of unloaded package in a safe interpreter, with guess for prefix} -setup { if {[child eval set pkgua_loaded] eq ""} { load [file join $testDir tcl9pkgua$ext] {} child unload [file join $testDir tcl9pkgua$ext] {} child } } -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir tcl9pkgua$ext] {} child] \ [child eval pkgua_eq abc def] \ [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{. . .} {} 0 {pkgua_eq pkgua_quote} {.. . .}} test unload-3.7 {basic unloading of re-loaded package from a safe interpreter, with prefix conversion} -setup { if {[child eval set pkgua_loaded] eq ""} { load [file join $testDir tcl9pkgua$ext] {} child unload [file join $testDir tcl9pkgua$ext] {} child load [file join $testDir tcl9pkgua$ext] {} child } } -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir tcl9pkgua$ext] Pkgua child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{.. . .} {} {} {.. .. ..}} # Tests for loading/unloading of a package among multiple interpreters... interp create child-trusted child-trusted eval { set pkgua_loaded {} set pkgua_detached {} set pkgua_unloaded {} } array set load {M 0 C 0 T 0} ## Load package in main trusted interpreter... test unload-4.1 {loading of unloadable package in trusted interpreter, with guess for prefix} -setup { set pkgua_loaded "" set pkgua_detached "" set pkgua_unloaded "" incr load(M) } -constraints [list $dll $loaded] -body { list [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] \ [load [file join $testDir tcl9pkgua$ext]] \ [pkgua_eq abc def] [lsort [info commands pkgua_*]] \ [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] } -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Load package in child-safe interpreter... test unload-4.2 {basic loading of unloadable package in a safe interpreter} -setup { child eval { set pkgua_loaded "" set pkgua_detached "" set pkgua_unloaded "" } incr load(C) } -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir tcl9pkgua$ext] Pkgua child] \ [child eval pkgua_eq abc def] \ [lsort [child eval info commands pkgua_*]] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Load package in child-trusted interpreter... test unload-4.3 {basic loading of unloadable package in a second trusted interpreter} -setup { incr load(T) } -constraints [list $dll $loaded] -body { list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [load [file join $testDir tcl9pkgua$ext] Pkgua child-trusted] \ [child-trusted eval pkgua_eq abc def] \ [lsort [child-trusted eval info commands pkgua_*]] \ [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}} ## Unload the package from the main trusted interpreter... test unload-4.4 {basic unloading of unloadable package from trusted interpreter, with guess for prefix} -setup { if {!$load(M)} { load [file join $testDir tcl9pkgua$ext] } if {!$load(C)} { load [file join $testDir tcl9pkgua$ext] {} child incr load(C) } if {!$load(T)} { load [file join $testDir tcl9pkgua$ext] {} child-trusted incr load(T) } } -constraints [list $dll $loaded] -body { list [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] \ [unload [file join $testDir tcl9pkgua$ext]] \ [info commands pkgua_*] \ [list $pkgua_loaded $pkgua_detached $pkgua_unloaded] } -result {{. {} {}} {} {} {. . {}}} ## Unload the package from the child safe interpreter... test unload-4.5 {basic unloading of unloadable package from a safe interpreter, with guess for prefix} -setup { if {!$load(C)} { load [file join $testDir tcl9pkgua$ext] {} child } if {!$load(T)} { load [file join $testDir tcl9pkgua$ext] {} child-trusted incr load(T) } } -constraints [list $dll $loaded] -body { list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir tcl9pkgua$ext] {} child] \ [child eval info commands pkgua_*] \ [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{. {} {}} {} {} {. . {}}} ## Unload the package from the child trusted interpreter... test unload-4.6 {basic unloading of unloadable package from a safe interpreter, with guess for prefix} -setup { if {!$load(T)} { load [file join $testDir tcl9pkgua$ext] {} child-trusted } } -constraints [list $dll $loaded] -body { list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \ [unload [file join $testDir tcl9pkgua$ext] {} child-trusted] \ [child-trusted eval info commands pkgua_*] \ [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] } -result {{. {} {}} {} {} {. . .}} test unload-5.1 {unload a module loaded from vfs} \ -constraints [list $dll $loaded testsimplefilesystem] \ -setup { set dir [pwd] cd $testDir testsimplefilesystem 1 load simplefs:/tcl9pkgua$ext Pkgua } \ -body { list [catch {unload simplefs:/tcl9pkgua$ext} msg] $msg } \ -result {0 {}} # cleanup interp delete child interp delete child-trusted unset ext ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/unknown.test0000644000175000017500000000352315104661341015314 0ustar sergeisergei# Commands covered: unknown # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain x catch {rename unknown unknown.old} test unknown-1.1 {non-existent "unknown" command} { list [catch {_non-existent_ foo bar} msg] $msg } {1 {invalid command name "_non-existent_"}} proc unknown {args} { global x set x $args } test unknown-2.1 {calling "unknown" command} { foobar x y z set x } {foobar x y z} test unknown-2.2 {calling "unknown" command with lots of args} { foobar 1 2 3 4 5 6 7 set x } {foobar 1 2 3 4 5 6 7} test unknown-2.3 {calling "unknown" command with lots of args} { foobar 1 2 3 4 5 6 7 8 set x } {foobar 1 2 3 4 5 6 7 8} test unknown-2.4 {calling "unknown" command with lots of args} { foobar 1 2 3 4 5 6 7 8 9 set x } {foobar 1 2 3 4 5 6 7 8 9} test unknown-3.1 {argument quoting in calls to "unknown"} { foobar \{ \} a\{b \; "\\" \$a a\[b \] set x } "foobar \\{ \\} a\\{b {;} \\\\ {\$a} {a\[b} \\]" proc unknown args { error "unknown failed" } test unknown-4.1 {errors in "unknown" procedure} { list [catch {non-existent a b} msg] $msg $errorCode } {1 {unknown failed} NONE} # cleanup catch {rename unknown {}} catch {rename unknown.old unknown} cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/unixNotfy.test0000644000175000017500000000523715104661341015624 0ustar sergeisergei# This file contains tests for tclUnixNotfy.c. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # When run in a Tk shell, these tests hang. testConstraint noTk [expr {0 != [catch {package present Tk}]}] testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # The next two tests will hang if threads are enabled because the notifier # will not necessarily wait for ever in this case, so it does not generate # an error. test unixNotfy-1.1 {Tcl_DeleteFileHandler} -constraints nonPortable -body { catch {vwait x} set f [open [makeFile "" foo] w] fileevent $f writable {set x 1} vwait x close $f list [catch {vwait x} msg] $msg } -result {1 {can't wait for variable "x": would wait forever}} -cleanup { catch { close $f } catch { removeFile foo } } test unixNotfy-1.2 {Tcl_DeleteFileHandler} -constraints nonPortable -body { catch {vwait x} set f1 [open [makeFile "" foo] w] set f2 [open [makeFile "" foo2] w] fileevent $f1 writable {set x 1} fileevent $f2 writable {set y 1} vwait x close $f1 vwait y close $f2 list [catch {vwait x} msg] $msg } -result {1 {can't wait for variable "x": would wait forever}} -cleanup { catch { close $f1 } catch { close $f2 } catch { removeFile foo } catch { removeFile foo2 } } test unixNotfy-2.1 {Tcl_DeleteFileHandler} \ -constraints {noTk unix thread} \ -body { update set f [open [makeFile "" foo] w] fileevent $f writable {set x 1} vwait x close $f thread::create "thread::send [thread::id] {set x ok}" vwait x set x } \ -result {ok} \ -cleanup { catch { close $f } catch { removeFile foo } } test unixNotfy-2.2 {Tcl_DeleteFileHandler} \ -constraints {noTk unix thread} \ -body { update set f1 [open [makeFile "" foo] w] set f2 [open [makeFile "" foo2] w] fileevent $f1 writable {set x 1} fileevent $f2 writable {set y 1} vwait x close $f1 vwait y close $f2 thread::create "thread::send [thread::id] {set x ok}" vwait x set x } \ -result {ok} \ -cleanup { catch { close $f1 } catch { close $f2 } catch { removeFile foo } catch { removeFile foo2 } } # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/unixInit.test0000644000175000017500000001346415104661341015431 0ustar sergeisergei# The file tests the functions in the tclUnixInit.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain path catch {set oldlang $env(LANG)} set env(LANG) C test unixInit-1.1 {TclpInitPlatform: ignore SIGPIPE} {unix stdio} { set x {} # Watch out for a race condition here. If tcltest is too slow to start # then we'll kill it before it has a chance to set up its signal handler. set f [open "|[list [interpreter]]" w+] puts $f "puts hi" flush $f gets $f exec kill -PIPE [pid $f] lappend x [catch {close $f}] set f [open "|[list [interpreter]]" w+] puts $f "puts hi" flush $f gets $f exec kill [pid $f] lappend x [catch {close $f}] set x } {0 1} # This test is really a test of code in tclUnixChan.c, but the channels are # set up as part of initialisation of the interpreter so the test seems to me # to fit here as well as anywhere else. test unixInit-1.2 {initialisation: standard channel type deduction} {unix stdio} { # pipe1 is a connection to a server that reports what port it starts on, # and delivers a constant string to the first client to connect to that # port before exiting. set pipe1 [open "|[list [interpreter]]" r+] puts $pipe1 { proc accept {channel host port} { puts $channel {puts [chan configure stdin -peername]; exit} close $channel exit } puts [chan configure [socket -server accept -myaddr 127.0.0.1 0] -sockname] vwait forever \ } # Note the backslash above; this is important to make sure that the whole # string is read before an [exit] can happen... flush $pipe1 set port [lindex [gets $pipe1] 2] set sock [socket localhost $port] # pipe2 is a connection to a Tcl interpreter that takes its orders from # the socket we hand it (i.e. the server we create above.) These orders # will tell it to print out the details about the socket it is taking # instructions from, hopefully identifying it as a socket. Which is what # this test is all about. set pipe2 [open "|[list [interpreter] <@$sock]" r] set result [gets $pipe2] # Clear any pending data; stops certain kinds of (non-important) errors chan configure $pipe1 -blocking 0; gets $pipe1 chan configure $pipe2 -blocking 0; gets $pipe2 # Close the pipes and the socket. close $pipe2 close $pipe1 catch {close $sock} # Can't use normal comparison, as hostname varies due to some # installations having a messed up /etc/hosts file. if { "127.0.0.1" eq [lindex $result 0] && $port == [lindex $result 2] } then { subst "OK" } else { subst "Expected: `[list 127.0.0.1 localhost $port]', Got `$result'" } } {OK} test unixInit-3.1 {TclpSetInitialEncodings} -constraints { unix stdio } -body { set env(LANG) C set f [open "|[list [interpreter]]" w+] chan configure $f -buffering none puts $f {puts [encoding system]; exit} set enc [gets $f] close $f set enc } -cleanup { unset -nocomplain env(LANG) } -match regexp -result {^(iso8859-15?|utf-8)$} # unixInit-3.2 depends on the *spawned* [interpreter] being able to locate # tcl_library without setting of TCL_LIBRARY env. This in turn depends on # Tcl's "library" directory being under the parent or grandparent of the # executable directory (the initScript search path in tclInterp.c). # Thus this constraint. On GiuHub CI, the only time this is not true # is for the XCode builds. if {[string match [zipfs root]* [info library]] || [file isfile [file normalize [file join [info nameofexecutable] .. .. library init.tcl]]] || [file isfile [file normalize [file join [info nameofexecutable] .. .. .. library init.tcl]]] } { tcltest::testConstraint enableUnixInit32 1 } else { tcltest::testConstraint enableUnixInit32 0 } test unixInit-3.2 {TclpSetInitialEncodings} -setup { catch {set oldlc_all $env(LC_ALL)} catch {set oldtcl_library $env(TCL_LIBRARY)} unset -nocomplain env(TCL_LIBRARY) } -constraints {unix stdio enableUnixInit32} -body { set env(LANG) japanese set env(LC_ALL) japanese set f [open "|[list [interpreter]]" w+] chan configure $f -buffering none puts $f {puts [encoding system]; exit} set enc [gets $f] close $f set enc } -cleanup { unset -nocomplain env(LANG) env(LC_ALL) catch {set env(LC_ALL) $oldlc_all} catch {set env(TCL_LIBRARY) $oldtcl_library} } -result {^(euc-jp|shiftjis)$} -match regexp test unixInit-4.1 {TclpSetVariables} {unix} { # just make sure they exist set a [list $tcl_library $tcl_pkgPath $tcl_platform(os)] set a [list $tcl_platform(osVersion) $tcl_platform(machine)] set tcl_platform(platform) } "unix" test unixInit-5.1 {Tcl_Init} {emptyTest unix} { # test initScript } {} test unixInit-6.1 {Tcl_SourceRCFile} {emptyTest unix} { } {} test unixInit-7.1 {closed standard channel: Bug 772288} -constraints { unix stdio } -body { set tclsh [interpreter] set crash [makeFile {puts [open /dev/null]} crash.tcl] set crashtest [makeFile " close stdin [list exec $tclsh $crash] " crashtest.tcl] exec $tclsh $crashtest } -cleanup { removeFile crash.tcl removeFile crashtest.tcl } -returnCodes 0 # cleanup unset -nocomplain env(LANG) catch {set env(LANG) $oldlang} unset -nocomplain path ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/unixForkEvent.test0000644000175000017500000000267015104661341016426 0ustar sergeisergei# This file contains a collection of tests for the procedures in the file # tclUnixNotify.c. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint testfork [llength [info commands testfork]] # Test if the notifier thread is well initialized in a forked interpreter # by Tcl_InitNotifier test unixforkevent-1.1 {fork and test writable event} \ -constraints {testfork nonPortable} \ -body { set myFolder [makeDirectory unixtestfork] set pid [testfork] if {$pid == 0} { # we are the forked process set result initialized set h [open [file join $myFolder test.txt] w] fileevent $h writable\ "set result writable;\ after cancel [after 1000 {set result timeout}]" vwait result close $h makeFile $result result.txt $myFolder exit } # we are the original process while {![file readable [file join $myFolder result.txt]]} {} viewFile result.txt $myFolder } \ -result {writable} \ -cleanup { catch { removeFolder $myFolder } } ::tcltest::cleanupTests return tcl9.0.3/tests/unixFile.test0000644000175000017500000000367015104661341015403 0ustar sergeisergei# This file contains tests for the routines in the file tclUnixFile.c # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testfindexecutable [llength [info commands testfindexecutable]] set oldpwd [pwd] cd [temporaryDirectory] catch { set oldPath $env(PATH) file attributes [makeFile "" junk] -perm 0o777 } set absPath [file join [temporaryDirectory] junk] test unixFile-1.1 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "" testfindexecutable junk } $absPath test unixFile-1.2 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "/dummy" testfindexecutable junk } {} test unixFile-1.3 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "/dummy:[pwd]" testfindexecutable junk } $absPath test unixFile-1.4 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "/dummy:" testfindexecutable junk } $absPath test unixFile-1.5 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "/dummy:/dummy" testfindexecutable junk } {} test unixFile-1.6 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) "/dummy::/dummy" testfindexecutable junk } $absPath test unixFile-1.7 {Tcl_FindExecutable} {testfindexecutable unix} { set env(PATH) ":/dummy" testfindexecutable junk } $absPath # cleanup catch {set env(PATH) $oldPath} removeFile junk cd $oldpwd ::tcltest::cleanupTests return tcl9.0.3/tests/unixFCmd.test0000644000175000017500000003360715104661341015340 0ustar sergeisergei# This file tests the tclUnixFCmd.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testchmod [llength [info commands testchmod]] # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] # These tests really need to be run from a writable directory, which # it is assumed [temporaryDirectory] is. set oldcwd [pwd] cd [temporaryDirectory] # Several tests require need to match results against the Unix username set user {} if {[testConstraint unix]} { catch {set user [exec whoami]} if {$user eq ""} { catch {regexp {^[^(]*\(([^)]*)\)} [exec id] dummy user} } if {$user eq ""} { set user "root" } } # Find a group that exists on this system, or else skip tests that require # groups testConstraint foundGroup 0 if {[testConstraint unix]} { catch { set groupList [exec groups] set group [lindex $groupList 0] testConstraint foundGroup 1 } } # check whether -readonly attribute is supported testConstraint readonlyAttr 0 if {[testConstraint unix]} { set f [makeFile "whatever" probe] catch { file attributes $f -readonly testConstraint readonlyAttr 1 } removeFile probe } proc openup {path} { testchmod 0o777 $path if {[file isdirectory $path]} { catch { foreach p [glob -directory $path *] { openup $p } } } } proc cleanup {args} { foreach p ". $args" { set x "" catch { set x [glob -directory $p tf* td*] } foreach file $x { if { [catch {file delete -force -- $file}] && [testConstraint testchmod] } then { openup $file file delete -force -- $file } } } } if {[testConstraint unix] && [testConstraint notRoot]} { testConstraint execMknod [expr {![catch {exec mknod tf1 p}]}] cleanup } test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup { cleanup } -constraints {unix notRoot notWsl} -body { file mkdir td1/td2/td3 file attributes td1/td2 -permissions 0 file rename td1/td2/td3 td2 } -returnCodes error -cleanup { file attributes td1/td2 -permissions 0o755 cleanup } -result {error renaming "td1/td2/td3": permission denied} test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir td1/td2 file mkdir td2 file rename td2 td1 } -returnCodes error -cleanup { cleanup } -result {error renaming "td2" to "td1/td2": file exists} test unixFCmd-1.3 {TclpRenameFile: EINVAL} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir td1 file rename td1 td1 } -returnCodes error -cleanup { cleanup } -result {error renaming "td1" to "td1/td1": trying to rename a volume or move a directory into itself} test unixFCmd-1.4 {TclpRenameFile: EISDIR} {emptyTest unix notRoot} { # can't make it happen } {} test unixFCmd-1.5 {TclpRenameFile: ENOENT} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir td1 file rename td2 td1 } -returnCodes error -cleanup { cleanup } -result {error renaming "td2": no such file or directory} test unixFCmd-1.6 {TclpRenameFile: ENOTDIR} {emptyTest unix notRoot} { # can't make it happen } {} test unixFCmd-1.7 {TclpRenameFile: EXDEV} -setup { cleanup } -constraints {unix notRoot notWsl} -body { file mkdir foo/bar file attr foo -perm 0o40555 file rename foo/bar /tmp } -returnCodes error -cleanup { catch {file delete /tmp/bar} catch {file attr foo -perm 0o40777} catch {file delete -force foo} } -match glob -result {*: permission denied} test unixFCmd-1.8 {Checking EINTR Bug} {unix notRoot nonPortable} { testalarm after 2000 list [testgotsig] [testgotsig] } {1 0} test unixFCmd-1.9 {Checking EINTR Bug} -constraints {unix notRoot nonPortable} -setup { cleanup set f [open tfalarm w] puts $f { after 2000 puts "hello world" exit 0 } close $f } -body { testalarm set pipe [open "|[info nameofexecutable] tfalarm" r+] set line [read $pipe 1] catch {close $pipe} list $line [testgotsig] } -cleanup { cleanup } -result {h 1} test unixFCmd-2.1 {TclpCopyFile: target exists: lstat(dst) == 0} -setup { cleanup } -constraints {unix notRoot} -body { close [open tf1 a] close [open tf2 a] file copy -force tf1 tf2 } -cleanup { cleanup } -result {} test unixFCmd-2.2.1 {TclpCopyFile: src is symlink} -setup { cleanup } -constraints {unix notRoot dontCopyLinks} -body { # copying links should end up with real files close [open tf1 a] file link -symbolic tf2 tf1 file copy tf2 tf3 file type tf3 } -cleanup { cleanup } -result file test unixFCmd-2.2.2 {TclpCopyFile: src is symlink} -setup { cleanup } -constraints {unix notRoot} -body { # copying links should end up with the links copied close [open tf1 a] file link -symbolic tf2 tf1 file copy tf2 tf3 file type tf3 } -cleanup { cleanup } -result link test unixFCmd-2.3 {TclpCopyFile: src is block} -setup { cleanup } -constraints {unix notRoot} -body { set null "/dev/null" while {[file type $null] != "characterSpecial"} { set null [file join [file dirname $null] [file readlink $null]] } # file copy $null tf1 } -result {} test unixFCmd-2.4 {TclpCopyFile: src is fifo} -setup { cleanup } -constraints {unix notRoot execMknod} -body { exec mknod tf1 p file copy tf1 tf2 list [file type tf1] [file type tf2] } -cleanup { cleanup } -result {fifo fifo} test unixFCmd-2.5 {TclpCopyFile: copy attributes} -setup { cleanup } -constraints {unix notRoot notWsl} -body { close [open tf1 a] file attributes tf1 -permissions 0o472 file copy tf1 tf2 file attributes tf2 -permissions } -cleanup { cleanup } -result 0o472 ;# i.e. perms field of [exec ls -l tf2] is -r--rwx-w- test unixFCmd-3.1 {CopyFile not done} {emptyTest unix notRoot} { } {} test unixFCmd-4.1 {TclpDeleteFile not done} {emptyTest unix notRoot} { } {} test unixFCmd-5.1 {TclpCreateDirectory not done} {emptyTest unix notRoot} { } {} test unixFCmd-6.1 {TclpCopyDirectory not done} {emptyTest unix notRoot} { } {} test unixFCmd-7.1 {TclpRemoveDirectory not done} {emptyTest unix notRoot} { } {} test unixFCmd-8.1 {TraverseUnixTree not done} {emptyTest unix notRoot} { } {} test unixFCmd-9.1 {TraversalCopy not done} {emptyTest unix notRoot} { } {} test unixFCmd-10.1 {TraversalDelete not done} {emptyTest unix notRoot} { } {} test unixFCmd-11.1 {CopyFileAttrs not done} {emptyTest unix notRoot} { } {} test unixFCmd-12.1 {GetGroupAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group } -result {could not read "foo.test": no such file or directory} test unixFCmd-12.2 {GetGroupAttribute - file found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] file attributes foo.test -group } -cleanup { file delete -force -- foo.test } -match glob -result * test unixFCmd-13.1 {GetOwnerAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group } -result {could not read "foo.test": no such file or directory} test unixFCmd-13.2 {GetOwnerAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] file attributes foo.test -owner } -cleanup { file delete -force -- foo.test } -result $user test unixFCmd-14.1 {GetPermissionsAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions } -result {could not read "foo.test": no such file or directory} test unixFCmd-14.2 {GetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] file attribute foo.test -permissions } -cleanup { file delete -force -- foo.test } -match glob -result * #groups hard to test test unixFCmd-15.1 {SetGroupAttribute - invalid group} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { file attributes foo.test -group foozzz } -returnCodes error -cleanup { file delete -force -- foo.test } -result {could not set group for file "foo.test": group "foozzz" does not exist} test unixFCmd-15.2 {SetGroupAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot foundGroup} -returnCodes error -body { file attributes foo.test -group $group } -result {could not set group for file "foo.test": no such file or directory} #changing owners hard to do test unixFCmd-16.1 {SetOwnerAttribute - current owner} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] list [file attributes foo.test -owner $user] \ [file attributes foo.test -owner] } -cleanup { file delete -force -- foo.test } -result [list {} $user] test unixFCmd-16.2 {SetOwnerAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -owner $user } -result {could not set owner for file "foo.test": no such file or directory} test unixFCmd-16.3 {SetOwnerAttribute - invalid owner} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -owner foozzz } -result {could not set owner for file "foo.test": user "foozzz" does not exist} test unixFCmd-17.1 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot notWsl} -body { close [open foo.test w] list [file attributes foo.test -permissions 0] \ [file attributes foo.test -permissions] } -cleanup { file delete -force -- foo.test } -result {{} 00000} test unixFCmd-17.2 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions 0 } -result {could not set permissions for file "foo.test": no such file or directory} test unixFCmd-17.3 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] file attributes foo.test -permissions foo } -cleanup { file delete -force -- foo.test } -returnCodes error -result {unknown permission string format "foo"} test unixFCmd-17.4 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { close [open foo.test w] file attributes foo.test -permissions ---rwx } -cleanup { file delete -force -- foo.test } -returnCodes error -result {unknown permission string format "---rwx"} close [open foo.test w] set ::i 4 proc permcheck {testnum permList expected} { test $testnum {SetPermissionsAttribute} {unix notRoot notWsl} { set result {} foreach permstr $permList { file attributes foo.test -permissions $permstr lappend result [file attributes foo.test -permissions] } set result } $expected } permcheck unixFCmd-17.5 rwxrwxrwx 0o777 permcheck unixFCmd-17.6 r--r---w- 0o442 permcheck unixFCmd-17.7 {0 u+rwx,g+r u-w o+rwx} {00000 0o740 0o540 0o547} permcheck unixFCmd-17.11 --x--x--x 0o111 permcheck unixFCmd-17.12 {0 a+rwx} {00000 0o777} file delete -force -- foo.test test unixFCmd-18.1 {Unix pwd} -constraints {unix notRoot nonPortable} -setup { set cd [pwd] } -body { # This test is non-portable because SunOS generates a weird error # message when the current directory isn't readable. set nd $cd/tstdir file mkdir $nd cd $nd file attributes $nd -permissions 0 pwd } -returnCodes error -cleanup { cd $cd file attributes $nd -permissions 0o755 file delete $nd } -match glob -result {error getting working directory name:*} test unixFCmd-19.1 {GetReadOnlyAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly } -result {could not read "foo.test": no such file or directory} test unixFCmd-19.2 {GetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -body { close [open foo.test w] file attribute foo.test -readonly } -cleanup { file delete -force -- foo.test } -result 0 test unixFCmd-20.1 {SetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -body { close [open foo.test w] list [catch {file attributes foo.test -readonly 1} msg] $msg \ [catch {file attribute foo.test -readonly} msg] $msg \ [catch {file delete -force -- foo.test}] \ [catch {file attributes foo.test -readonly 0} msg] $msg \ [catch {file attribute foo.test -readonly} msg] $msg } -cleanup { file delete -force -- foo.test } -result {0 {} 0 1 1 0 {} 0 0} test unixFCmd-20.2 {SetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly 1 } -result {could not read "foo.test": no such file or directory} # cleanup cleanup cd $oldcwd ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/twapiTlsPlus.tcl0000644000175000017500000000267015104661341016075 0ustar sergeisergei# Module twapiTlsPlus # # Temporary wrapper for package twapi, to expose the same API as package tls. # - Command twapiTlsPlus::socket, cf. tls::socket, replacement for ::socket, for # use with http::register. # - Variable twapiTlsPlus::socketCmd, cf. tls::socketCmd, holds the value of the # callback command used by twapi to open a socket. # # Intended to allow twapi TLS to use an https proxy server, and a background # thread for evaluation of ::socket. # # For twapiTlsPlus to work correctly, twapi*/tls.tcl must be edited so that #- set so [$socketcmd {*}$socket_args {*}$args] #+ set so [{*}$socketcmd {*}$socket_args {*}$args] package require http package require twapi namespace eval twapiTlsPlus { variable socketCmd [::twapi::tls_socket_command] namespace export socket } # Proc twapiTlsPlus::socket # Replacement for ::socket, use with http::register. proc twapiTlsPlus::socket {args} { variable socketCmd set targ [lsearch -exact $args -type] if {$targ != -1} { set token [lindex $args $targ+1] set args [lreplace $args $targ $targ+1 -socketcmd [list {*}$socketCmd -type $token]] } ::twapi::tls_socket {*}$args } # Variable twapi::tls::_socket_cmd does it. proc twapiTlsPlus::TraceSocketCmd {args} { variable socketCmd ::twapi::tls_socket_command $socketCmd return } trace add variable ::twapiTlsPlus::socketCmd write ::twapiTlsPlus::TraceSocketCmd package provide twapiTlsPlus 0.1 tcl9.0.3/tests/trace.test0000644000175000017500000024341615104661341014722 0ustar sergeisergei# Commands covered: trace # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testcmdtrace [llength [info commands testcmdtrace]] testConstraint testevalobjv [llength [info commands testevalobjv]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] proc getbytes {} { set lines [split [memory info] "\n"] lindex [lindex $lines 3] 3 } proc traceScalar {name1 name2 op} { global info set info [list $name1 $name2 $op [catch {uplevel 1 set $name1} msg] $msg] } proc traceScalarAppend {name1 name2 op} { global info lappend info $name1 $name2 $op [catch {uplevel 1 set $name1} msg] $msg } proc traceArray {name1 name2 op} { global info set info [list $name1 $name2 $op [catch {uplevel 1 set [set name1]($name2)} msg] $msg] } proc traceArray2 {name1 name2 op} { global info set info [list $name1 $name2 $op] } proc traceProc {name1 name2 op} { global info set info [concat $info [list $name1 $name2 $op]] } proc traceTag {tag args} { global info set info [concat $info $tag] } proc traceError {args} { error "trace returned error" } proc traceCheck {cmd args} { global info set info [list [catch $cmd msg] $msg] } proc traceCrtElement {value name1 name2 op} { uplevel 1 set ${name1}($name2) $value } proc traceCommand {oldName newName op} { global info set info [list $oldName $newName $op] } test trace-0.0 {memory corruption in trace (Tcl Bug 484339)} { # You may need Purify or Electric Fence to reliably # see this one fail. unset -nocomplain z trace add variable z array {set z(foo) 1 ;#} set res "names: [array names z]" unset -nocomplain ::z trace add variable ::z write {unset ::z; error "memory corruption";#} list [catch {set ::z 1} msg] $msg } {1 {can't set "::z": memory corruption}} # Read-tracing on variables test trace-1.1 {trace add variable reads} { unset -nocomplain x set info {} trace add variable x read traceScalar list [catch {set x} msg] $msg $info } {1 {can't read "x": no such variable} {x {} read 1 {can't read "x": no such variable}}} test trace-1.2 {trace add variable reads} { unset -nocomplain x set x 123 set info {} trace add variable x read traceScalar list [catch {set x} msg] $msg $info } {0 123 {x {} read 0 123}} test trace-1.3 {trace add variable reads} { unset -nocomplain x set info {} trace add variable x read traceScalar set x 123 set info } {} test trace-1.4 {trace array element reads} { unset -nocomplain x set info {} trace add variable x(2) read traceArray list [catch {set x(2)} msg] $msg $info } {1 {can't read "x(2)": no such element in array} {x 2 read 1 {can't read "x(2)": no such element in array}}} test trace-1.5 {trace array element reads} { unset -nocomplain x set x(2) zzz set info {} trace add variable x(2) read traceArray list [catch {set x(2)} msg] $msg $info } {0 zzz {x 2 read 0 zzz}} test trace-1.6 {trace array element reads} { unset -nocomplain x set info {} trace add variable x read traceArray2 proc p {} { global x set x(2) willi return $x(2) } list [catch {p} msg] $msg $info } {0 willi {x 2 read}} test trace-1.7 {trace array element reads, create element undefined if nonexistant} { unset -nocomplain x set info {} trace add variable x read q proc q {name1 name2 op} { global info set info [list $name1 $name2 $op] global $name1 set ${name1}($name2) wolf } proc p {} { global x set x(X) willi return $x(Y) } list [catch {p} msg] $msg $info } {0 wolf {x Y read}} test trace-1.8 {trace reads on whole arrays} { unset -nocomplain x set info {} trace add variable x read traceArray list [catch {set x(2)} msg] $msg $info } {1 {can't read "x(2)": no such variable} {}} test trace-1.9 {trace reads on whole arrays} { unset -nocomplain x set x(2) zzz set info {} trace add variable x read traceArray list [catch {set x(2)} msg] $msg $info } {0 zzz {x 2 read 0 zzz}} test trace-1.10 {trace add variable reads} { unset -nocomplain x set x 444 set info {} trace add variable x read traceScalar unset x set info } {} test trace-1.11 {read traces that modify the array structure} { unset -nocomplain x set x(bar) 0 trace add variable x read {set x(foo) 1 ;#} trace add variable x read {unset -nocomplain x(bar) ;#} array get x } {} test trace-1.12 {read traces that modify the array structure} { unset -nocomplain x set x(bar) 0 trace add variable x read {unset -nocomplain x(bar) ;#} trace add variable x read {set x(foo) 1 ;#} array get x } {} test trace-1.13 {read traces that modify the array structure} { unset -nocomplain x set x(bar) 0 trace add variable x read {set x(foo) 1 ;#} trace add variable x read {unset -nocomplain x;#} list [catch {array get x} res] $res } {1 {can't read "x(bar)": no such variable}} test trace-1.14 {read traces that modify the array structure} { unset -nocomplain x set x(bar) 0 trace add variable x read {unset -nocomplain x;#} trace add variable x read {set x(foo) 1 ;#} list [catch {array get x} res] $res } {1 {can't read "x(bar)": no such variable}} # Basic write-tracing on variables test trace-2.1 {trace add variable writes} { unset -nocomplain x set info {} trace add variable x write traceScalar set x 123 set info } {x {} write 0 123} test trace-2.2 {trace writes to array elements} { unset -nocomplain x set info {} trace add variable x(33) write traceArray set x(33) 444 set info } {x 33 write 0 444} test trace-2.3 {trace writes on whole arrays} { unset -nocomplain x set info {} trace add variable x write traceArray set x(abc) qq set info } {x abc write 0 qq} test trace-2.4 {trace add variable writes} { unset -nocomplain x set x 1234 set info {} trace add variable x write traceScalar set x set info } {} test trace-2.5 {trace add variable writes} { unset -nocomplain x set x 1234 set info {} trace add variable x write traceScalar unset x set info } {} test trace-2.6 {trace add variable writes on compiled local} { # # Check correct function of whole array traces on compiled local # arrays [Bug 1770591]. The corresponding function for read traces is # already indirectly tested in trace-1.7 # unset -nocomplain x set info {} proc p {} { trace add variable x write traceArray set x(X) willy } p set info } {x X write 0 willy} test trace-2.7 {trace add variable writes on errorInfo} -body { # # Check correct behaviour of write traces on errorInfo. # [Bug 1773040] trace add variable ::errorInfo write traceScalar catch {set dne} lrange [set info] 0 2 } -cleanup { # always remove trace on errorInfo otherwise further tests will fail unset ::errorInfo } -result {::errorInfo {} write} # append no longer triggers read traces when fetching the old values of # variables before doing the append operation. However, lappend _does_ # still trigger these read traces. Also lappend triggers only one write # trace: after appending all arguments to the list. test trace-3.1 {trace add variable read-modify-writes} { unset -nocomplain x set info {} trace add variable x read traceScalarAppend append x 123 append x 456 lappend x 789 set info } {x {} read 0 123456} test trace-3.2 {trace add variable read-modify-writes} { unset -nocomplain x set info {} trace add variable x {read write} traceScalarAppend append x 123 lappend x 456 set info } {x {} write 0 123 x {} read 0 123 x {} write 0 {123 456}} # Basic unset-tracing on variables test trace-4.1 {trace add variable unsets} { unset -nocomplain x set info {} trace add variable x unset traceScalar unset -nocomplain x set info } {x {} unset 1 {can't read "x": no such variable}} test trace-4.2 {variable mustn't exist during unset trace} { unset -nocomplain x set x 1234 set info {} trace add variable x unset traceScalar unset x set info } {x {} unset 1 {can't read "x": no such variable}} test trace-4.3 {unset traces mustn't be called during reads and writes} { unset -nocomplain x set info {} trace add variable x unset traceScalar set x 44 set x set info } {} test trace-4.4 {trace unsets on array elements} { unset -nocomplain x set x(0) 18 set info {} trace add variable x(1) unset traceArray unset -nocomplain x(1) set info } {x 1 unset 1 {can't read "x(1)": no such element in array}} test trace-4.5 {trace unsets on array elements} { unset -nocomplain x set x(1) 18 set info {} trace add variable x(1) unset traceArray unset x(1) set info } {x 1 unset 1 {can't read "x(1)": no such element in array}} test trace-4.6 {trace unsets on array elements} { unset -nocomplain x set x(1) 18 set info {} trace add variable x(1) unset traceArray unset x set info } {x 1 unset 1 {can't read "x(1)": no such variable}} test trace-4.7 {trace unsets on whole arrays} { unset -nocomplain x set x(1) 18 set info {} trace add variable x unset traceProc unset -nocomplain x(0) set info } {} test trace-4.8 {trace unsets on whole arrays} { unset -nocomplain x set x(1) 18 set x(2) 144 set x(3) 14 set info {} trace add variable x unset traceProc unset x(1) set info } {x 1 unset} test trace-4.9 {trace unsets on whole arrays} { unset -nocomplain x set x(1) 18 set x(2) 144 set x(3) 14 set info {} trace add variable x unset traceProc unset x set info } {x {} unset} # Array tracing on variables test trace-5.1 {array traces fire on accesses via [array]} { unset -nocomplain x set x(b) 2 trace add variable x array traceArray2 set ::info {} array set x {a 1} set ::info } {x {} array} test trace-5.2 {array traces do not fire on normal accesses} { unset -nocomplain x set x(b) 2 trace add variable x array traceArray2 set ::info {} set x(a) 1 set x(b) $x(a) set ::info } {} test trace-5.3 {array traces do not outlive variable} { unset -nocomplain x trace add variable x array traceArray2 set ::info {} set x(a) 1 unset x array set x {a 1} set ::info } {} test trace-5.4 {array traces properly listed in trace information} { unset -nocomplain x trace add variable x array traceArray2 set result [trace info variable x] set result } [list [list array traceArray2]] test trace-5.5 {array traces properly listed in trace information} { unset -nocomplain x trace add variable x array traceArray2 set result [trace info variable x] set result } [list [list array traceArray2]] test trace-5.6 {array traces don't fire on scalar variables} { unset -nocomplain x set x foo trace add variable x array traceArray2 set ::info {} catch {array set x {a 1}} set ::info } {} test trace-5.7 {array traces fire for undefined variables} { unset -nocomplain x trace add variable x array traceArray2 set ::info {} array set x {a 1} set ::info } {x {} array} test trace-5.8 {array traces fire for undefined variables} { unset -nocomplain x trace add variable x array {set x(foo) 1 ;#} set res "names: [array names x]" } {names: foo} # Trace multiple trace types at once. test trace-6.1 {multiple ops traced at once} { unset -nocomplain x set info {} trace add variable x {read write unset} traceProc catch {set x} set x 22 set x set x 33 unset x set info } {x {} read x {} write x {} read x {} write x {} unset} test trace-6.2 {multiple ops traced on array element} { unset -nocomplain x set info {} trace add variable x(0) {read write unset} traceProc catch {set x(0)} set x(0) 22 set x(0) set x(0) 33 unset x(0) unset x set info } {x 0 read x 0 write x 0 read x 0 write x 0 unset} test trace-6.3 {multiple ops traced on whole array} { unset -nocomplain x set info {} trace add variable x {read write unset} traceProc catch {set x(0)} set x(0) 22 set x(0) set x(0) 33 unset x(0) unset x set info } {x 0 write x 0 read x 0 write x 0 unset x {} unset} # Check order of invocation of traces test trace-7.1 {order of invocation of traces} { unset -nocomplain x set info {} trace add variable x read "traceTag 1" trace add variable x read "traceTag 2" trace add variable x read "traceTag 3" catch {set x} set x 22 set x set info } {3 2 1 3 2 1} test trace-7.2 {order of invocation of traces} { unset -nocomplain x set x(0) 44 set info {} trace add variable x(0) read "traceTag 1" trace add variable x(0) read "traceTag 2" trace add variable x(0) read "traceTag 3" set x(0) set info } {3 2 1} test trace-7.3 {order of invocation of traces} { unset -nocomplain x set x(0) 44 set info {} trace add variable x(0) read "traceTag 1" trace add variable x read "traceTag A1" trace add variable x(0) read "traceTag 2" trace add variable x read "traceTag A2" trace add variable x(0) read "traceTag 3" trace add variable x read "traceTag A3" set x(0) set info } {A3 A2 A1 3 2 1} # Check effects of errors in trace procedures test trace-8.1 {error returns from traces} { unset -nocomplain x set x 123 set info {} trace add variable x read "traceTag 1" trace add variable x read traceError list [catch {set x} msg] $msg $info } {1 {can't read "x": trace returned error} {}} test trace-8.2 {error returns from traces} { unset -nocomplain x set x 123 set info {} trace add variable x write "traceTag 1" trace add variable x write traceError list [catch {set x 44} msg] $msg $info } {1 {can't set "x": trace returned error} {}} test trace-8.3 {error returns from traces} { unset -nocomplain x set x 123 set info {} trace add variable x write traceError list [catch {append x 44} msg] $msg $info } {1 {can't set "x": trace returned error} {}} test trace-8.4 {error returns from traces} { unset -nocomplain x set x 123 set info {} trace add variable x unset "traceTag 1" trace add variable x unset traceError list [catch {unset x} msg] $msg $info } {0 {} 1} test trace-8.5 {error returns from traces} { unset -nocomplain x set x(0) 123 set info {} trace add variable x(0) read "traceTag 1" trace add variable x read "traceTag 2" trace add variable x read traceError trace add variable x read "traceTag 3" list [catch {set x(0)} msg] $msg $info } {1 {can't read "x(0)": trace returned error} 3} test trace-8.6 {error returns from traces} { unset -nocomplain x set x 123 trace add variable x unset traceError list [catch {unset x} msg] $msg } {0 {}} test trace-8.7 {error returns from traces} { # This test just makes sure that the memory for the error message # gets deallocated correctly when the trace is invoked again or # when the trace is deleted. unset -nocomplain x set x 123 trace add variable x read traceError catch {set x} catch {set x} trace remove variable x read traceError } {} test trace-8.8 {error returns from traces} { # Yet more elaborate memory corruption testing that checks nothing # bad happens when the trace deletes itself and installs something # new. Alas, there is no neat way to guarantee that this test will # fail if there is a problem, but that's life and with the new code # it should *never* fail. # # Adapted from Bug #219393 reported by Don Porter. catch {rename ::foo {}} proc foo {old args} { trace remove variable ::x write [list foo $old] trace add variable ::x write [list foo $::x] error "foo" } unset -nocomplain ::x ::y set x junk trace add variable ::x write [list foo $x] for {set y 0} {$y<100} {incr y} { catch {set x junk} } unset x } {} # Check to see that variables are expunged before trace # procedures are invoked, so trace procedure can even manipulate # a new copy of the variables. test trace-9.1 {be sure variable is unset before trace is called} { unset -nocomplain x set x 33 set info {} trace add variable x unset {traceCheck {uplevel 1 set x}} unset x set info } {1 {can't read "x": no such variable}} test trace-9.2 {be sure variable is unset before trace is called} { unset -nocomplain x set x 33 set info {} trace add variable x unset {traceCheck {uplevel 1 set x 22}} unset x concat $info [list [catch {set x} msg] $msg] } {0 22 0 22} test trace-9.3 {be sure traces are cleared before unset trace called} { unset -nocomplain x set x 33 set info {} trace add variable x unset {traceCheck {uplevel 1 trace info variable x}} unset x set info } {0 {}} test trace-9.4 {set new trace during unset trace} { unset -nocomplain x set x 33 set info {} trace add variable x unset {traceCheck {global x; trace add variable x unset traceProc}} unset x concat $info [trace info variable x] } {0 {} {unset traceProc}} test trace-10.1 {make sure array elements are unset before traces are called} { unset -nocomplain x set x(0) 33 set info {} trace add variable x(0) unset {traceCheck {uplevel 1 set x(0)}} unset x(0) set info } {1 {can't read "x(0)": no such element in array}} test trace-10.2 {make sure array elements are unset before traces are called} { unset -nocomplain x set x(0) 33 set info {} trace add variable x(0) unset {traceCheck {uplevel 1 set x(0) zzz}} unset x(0) concat $info [list [catch {set x(0)} msg] $msg] } {0 zzz 0 zzz} test trace-10.3 {array elements are unset before traces are called} { unset -nocomplain x set x(0) 33 set info {} trace add variable x(0) unset {traceCheck {global x; trace info variable x(0)}} unset x(0) set info } {0 {}} test trace-10.4 {set new array element trace during unset trace} { unset -nocomplain x set x(0) 33 set info {} trace add variable x(0) unset {traceCheck {uplevel 1 {trace add variable x(0) read {}}}} unset -nocomplain x(0) concat $info [trace info variable x(0)] } {0 {} {read {}}} test trace-11.1 {make sure arrays are unset before traces are called} { unset -nocomplain x set x(0) 33 set info {} trace add variable x unset {traceCheck {uplevel 1 set x(0)}} unset x set info } {1 {can't read "x(0)": no such variable}} test trace-11.2 {make sure arrays are unset before traces are called} { unset -nocomplain x set x(y) 33 set info {} trace add variable x unset {traceCheck {uplevel 1 set x(y) 22}} unset x concat $info [list [catch {set x(y)} msg] $msg] } {0 22 0 22} test trace-11.3 {make sure arrays are unset before traces are called} { unset -nocomplain x set x(y) 33 set info {} trace add variable x unset {traceCheck {uplevel 1 array exists x}} unset x set info } {0 0} test trace-11.4 {make sure arrays are unset before traces are called} { unset -nocomplain x set x(y) 33 set info {} set cmd {traceCheck {uplevel 1 {trace info variable x}}} trace add variable x unset $cmd unset x set info } {0 {}} test trace-11.5 {set new array trace during unset trace} { unset -nocomplain x set x(y) 33 set info {} trace add variable x unset {traceCheck {global x; trace add variable x read {}}} unset x concat $info [trace info variable x] } {0 {} {read {}}} test trace-11.6 {create scalar during array unset trace} { unset -nocomplain x set x(y) 33 set info {} trace add variable x unset {traceCheck {global x; set x 44}} unset x concat $info [list [catch {set x} msg] $msg] } {0 44 0 44} # Check special conditions (e.g. errors) in Tcl_TraceVar2. test trace-12.1 {creating array when setting variable traces} { unset -nocomplain x set info {} trace add variable x(0) write traceProc list [catch {set x 22} msg] $msg } {1 {can't set "x": variable is array}} test trace-12.2 {creating array when setting variable traces} { unset -nocomplain x set info {} trace add variable x(0) write traceProc list [catch {set x(0)} msg] $msg } {1 {can't read "x(0)": no such element in array}} test trace-12.3 {creating array when setting variable traces} { unset -nocomplain x set info {} trace add variable x(0) write traceProc set x(0) 22 set info } {x 0 write} test trace-12.4 {creating variable when setting variable traces} { unset -nocomplain x set info {} trace add variable x write traceProc list [catch {set x} msg] $msg } {1 {can't read "x": no such variable}} test trace-12.5 {creating variable when setting variable traces} { unset -nocomplain x set info {} trace add variable x write traceProc set x 22 set info } {x {} write} test trace-12.6 {creating variable when setting variable traces} { unset -nocomplain x set info {} trace add variable x write traceProc set x(0) 22 set info } {x 0 write} test trace-12.7 {create array element during read trace} { unset -nocomplain x set x(2) zzz trace add variable x read {traceCrtElement xyzzy} list [catch {set x(3)} msg] $msg } {0 xyzzy} test trace-12.8 {errors when setting variable traces} { unset -nocomplain x set x 44 list [catch {trace add variable x(0) write traceProc} msg] $msg } {1 {can't trace "x(0)": variable isn't array}} # Check trace deletion test trace-13.1 {delete one trace from another} { proc delTraces {args} { global x trace remove variable x read {traceTag 2} trace remove variable x read {traceTag 3} trace remove variable x read {traceTag 4} } unset -nocomplain x set x 44 set info {} trace add variable x read {traceTag 1} trace add variable x read {traceTag 2} trace add variable x read {traceTag 3} trace add variable x read {traceTag 4} trace add variable x read delTraces trace add variable x read {traceTag 5} set x set info } {5 1} test trace-13.2 {leak when unsetting traced variable} \ -constraints memory -body { set end [getbytes] proc f args {} for {set i 0} {$i < 5} {incr i} { trace add variable bepa write f set bepa a unset bepa set tmp $end set end [getbytes] } expr {$end - $tmp} } -cleanup { unset -nocomplain end i tmp } -result 0 test trace-13.3 {leak when removing traces} \ -constraints memory -body { set end [getbytes] proc f args {} for {set i 0} {$i < 5} {incr i} { trace add variable bepa write f set bepa a trace remove variable bepa write f set tmp $end set end [getbytes] } expr {$end - $tmp} } -cleanup { unset -nocomplain end i tmp } -result 0 test trace-13.4 {leaks in error returns from traces} \ -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {set bepa a} unset bepa set tmp $end set end [getbytes] } expr {$end - $tmp} } -cleanup { unset -nocomplain end i tmp } -result 0 # Check operation and syntax of "trace" command. # Syntax for adding/removing variable and command traces is basically the # same: # trace add variable name opList command # trace remove variable name opList command # # The following loops just get all the common "wrong # args" tests done. set i 0 set start "wrong # args:" foreach type {variable command} { foreach op {add remove} { test trace-14.0.[incr i] "trace command, wrong # args errors" { list [catch {trace $op $type} msg] $msg } [list 1 "$start should be \"trace $op $type name opList command\""] test trace-14.0.[incr i] "trace command wrong # args errors" { list [catch {trace $op $type foo} msg] $msg } [list 1 "$start should be \"trace $op $type name opList command\""] test trace-14.0.[incr i] "trace command, wrong # args errors" { list [catch {trace $op $type foo bar} msg] $msg } [list 1 "$start should be \"trace $op $type name opList command\""] test trace-14.0.[incr i] "trace command, wrong # args errors" { list [catch {trace $op $type foo bar baz boo} msg] $msg } [list 1 "$start should be \"trace $op $type name opList command\""] } test trace-14.0.[incr i] "trace command, wrong # args errors" { list [catch {trace info $type foo bar} msg] $msg } [list 1 "$start should be \"trace info $type name\""] test trace-14.0.[incr i] "trace command, wrong # args errors" { list [catch {trace info $type} msg] $msg } [list 1 "$start should be \"trace info $type name\""] } test trace-14.1 "trace command, wrong # args errors" { list [catch {trace} msg] $msg } [list 1 "wrong # args: should be \"trace option ?arg ...?\""] test trace-14.2 "trace command, wrong # args errors" { list [catch {trace add} msg] $msg } [list 1 "wrong # args: should be \"trace add type ?arg ...?\""] test trace-14.3 "trace command, wrong # args errors" { list [catch {trace remove} msg] $msg } [list 1 "wrong # args: should be \"trace remove type ?arg ...?\""] test trace-14.4 "trace command, wrong # args errors" { list [catch {trace info} msg] $msg } [list 1 "wrong # args: should be \"trace info type name\""] test trace-14.5 {trace command, invalid option} { list [catch {trace gorp} msg] $msg } [list 1 "bad option \"gorp\": must be add, info, or remove"] # Again, [trace ... command] and [trace ... variable] share syntax and # error message styles for their opList options; these loops test those # error messages. set i 0 set errs [list "array, read, unset, or write" "delete or rename" "enter, leave, enterstep, or leavestep"] set abbvs [list {a r u w} {d r} {}] proc x {} {} foreach type {variable command execution} err $errs abbvlist $abbvs { foreach op {add remove} { test trace-14.6.[incr i] "trace $op $type errors" { list [catch {trace $op $type x {y z w} a} msg] $msg } [list 1 "bad operation \"y\": must be $err"] foreach abbv $abbvlist { test trace-14.6.[incr i] "trace $op $type rejects abbreviations" { list [catch {trace $op $type x $abbv a} msg] $msg } [list 1 "bad operation \"$abbv\": must be $err"] } test trace-14.6.[incr i] "trace $op $type rejects null opList" { list [catch {trace $op $type x {} a} msg] $msg } [list 1 "bad operation list \"\": must be one or more of $err"] } } rename x {} test trace-14.12 {trace command ("remove variable" option)} { unset -nocomplain x set info {} trace add variable x write traceProc trace remove variable x write traceProc } {} test trace-14.13 {trace command ("remove variable" option)} { unset -nocomplain x set info {} trace add variable x write traceProc trace remove variable x write traceProc set x 12345 set info } {} test trace-14.14 {trace command ("remove variable" option)} { unset -nocomplain x set info {} trace add variable x write {traceTag 1} trace add variable x write traceProc trace add variable x write {traceTag 2} set x yy trace remove variable x write traceProc set x 12345 trace remove variable x write {traceTag 1} set x foo trace remove variable x write {traceTag 2} set x gorp set info } {2 x {} write 1 2 1 2} test trace-14.15 {trace command ("remove variable" option)} { unset -nocomplain x set info {} trace add variable x write {traceTag 1} trace remove variable x write non_existent set x 12345 set info } {1} test trace-14.16 {trace command ("info variable" option)} { unset -nocomplain x trace add variable x write {traceTag 1} trace add variable x write traceProc trace add variable x write {traceTag 2} trace info variable x } {{write {traceTag 2}} {write traceProc} {write {traceTag 1}}} test trace-14.17 {trace command ("info variable" option)} { unset -nocomplain x trace info variable x } {} test trace-14.18 {trace command ("info variable" option)} { unset -nocomplain x trace info variable x(0) } {} test trace-14.19 {trace command ("info variable" option)} { unset -nocomplain x set x 44 trace info variable x(0) } {} test trace-14.20 {trace command ("info variable" option)} { unset -nocomplain x set x 44 trace add variable x write {traceTag 1} proc check {} {global x; trace info variable x} check } {{write {traceTag 1}}} # Check fancy trace commands (long ones, weird arguments, etc.) test trace-15.1 {long trace command} { unset -nocomplain x set info {} trace add variable x write {traceTag {This is a very very long argument. It's \ designed to test out the facilities of TraceVarProc for dealing \ with such long arguments by malloc-ing space. One possibility \ is that space doesn't get freed properly. If this happens, then \ invoking this test over and over again will eventually leak memory.}} set x 44 set info } {This is a very very long argument. It's \ designed to test out the facilities of TraceVarProc for dealing \ with such long arguments by malloc-ing space. One possibility \ is that space doesn't get freed properly. If this happens, then \ invoking this test over and over again will eventually leak memory.} test trace-15.2 {long trace command result to ignore} { proc longResult {args} {return "quite a bit of text, designed to generate a core leak if this command file is invoked over and over again and memory isn't being recycled correctly"} unset -nocomplain x trace add variable x write longResult set x 44 set x 5 set x abcde } abcde test trace-15.3 {special list-handling in trace commands} { unset -nocomplain "x y z" set "x y z(a\n\{)" 44 set info {} trace add variable "x y z(a\n\{)" write traceProc set "x y z(a\n\{)" 33 set info } "{x y z} a\\n\\\{ write" # Check for proper handling of unsets during traces. proc traceUnset {unsetName args} { global info upvar 1 $unsetName x lappend info [catch {unset x} msg] $msg [catch {set x} msg] $msg } proc traceReset {unsetName resetName args} { global info upvar 1 $unsetName x $resetName y lappend info [catch {unset x} msg] $msg [catch {set y xyzzy} msg] $msg } proc traceReset2 {unsetName resetName args} { global info lappend info [catch {uplevel 1 unset $unsetName} msg] $msg \ [catch {uplevel 1 set $resetName xyzzy} msg] $msg } proc traceAppend {string name1 name2 op} { global info lappend info $string } test trace-16.1 {unsets during read traces} { unset -nocomplain y set y 1234 set info {} trace add variable y read {traceUnset y} trace add variable y unset {traceAppend unset} lappend info [catch {set y} msg] $msg } {unset 0 {} 1 {can't read "x": no such variable} 1 {can't read "y": no such variable}} test trace-16.2 {unsets during read traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceUnset y(0)} lappend info [catch {set y(0)} msg] $msg } {0 {} 1 {can't read "x": no such variable} 1 {can't read "y(0)": no such element in array}} test trace-16.3 {unsets during read traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceUnset y} lappend info [catch {set y(0)} msg] $msg } {0 {} 1 {can't read "x": no such variable} 1 {can't read "y(0)": no such variable}} test trace-16.4 {unsets during read traces} { unset -nocomplain y set y 1234 set info {} trace add variable y read {traceReset y y} lappend info [catch {set y} msg] $msg } {0 {} 0 xyzzy 0 xyzzy} test trace-16.5 {unsets during read traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceReset y(0) y(0)} lappend info [catch {set y(0)} msg] $msg } {0 {} 0 xyzzy 0 xyzzy} test trace-16.6 {unsets during read traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceReset y y(0)} lappend info [catch {set y(0)} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 1 {can't set "y": upvar refers to element in deleted array} 1 {can't read "y(0)": no such variable} 1 {can't read "y(0)": no such variable}} test trace-16.7 {unsets during read traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceReset2 y y(0)} lappend info [catch {set y(0)} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 0 xyzzy 1 {can't read "y(0)": no such element in array} 0 xyzzy} test trace-16.8 {unsets during write traces} { unset -nocomplain y set y 1234 set info {} trace add variable y write {traceUnset y} trace add variable y unset {traceAppend unset} lappend info [catch {set y xxx} msg] $msg } {unset 0 {} 1 {can't read "x": no such variable} 0 {}} test trace-16.9 {unsets during write traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) write {traceUnset y(0)} lappend info [catch {set y(0) xxx} msg] $msg } {0 {} 1 {can't read "x": no such variable} 0 {}} test trace-16.10 {unsets during write traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) write {traceUnset y} lappend info [catch {set y(0) xxx} msg] $msg } {0 {} 1 {can't read "x": no such variable} 0 {}} test trace-16.11 {unsets during write traces} { unset -nocomplain y set y 1234 set info {} trace add variable y write {traceReset y y} lappend info [catch {set y xxx} msg] $msg } {0 {} 0 xyzzy 0 xyzzy} test trace-16.12 {unsets during write traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) write {traceReset y(0) y(0)} lappend info [catch {set y(0) xxx} msg] $msg } {0 {} 0 xyzzy 0 xyzzy} test trace-16.13 {unsets during write traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) write {traceReset y y(0)} lappend info [catch {set y(0) xxx} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 1 {can't set "y": upvar refers to element in deleted array} 0 {} 1 {can't read "y(0)": no such variable}} test trace-16.14 {unsets during write traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) write {traceReset2 y y(0)} lappend info [catch {set y(0) xxx} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 0 xyzzy 0 {} 0 xyzzy} test trace-16.15 {unsets during unset traces} { unset -nocomplain y set y 1234 set info {} trace add variable y unset {traceUnset y} lappend info [catch {unset y} msg] $msg [catch {set y} msg] $msg } {1 {can't unset "x": no such variable} 1 {can't read "x": no such variable} 0 {} 1 {can't read "y": no such variable}} test trace-16.16 {unsets during unset traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) unset {traceUnset y(0)} lappend info [catch {unset y(0)} msg] $msg [catch {set y(0)} msg] $msg } {1 {can't unset "x": no such variable} 1 {can't read "x": no such variable} 0 {} 1 {can't read "y(0)": no such element in array}} test trace-16.17 {unsets during unset traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) unset {traceUnset y} lappend info [catch {unset y(0)} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 1 {can't read "x": no such variable} 0 {} 1 {can't read "y(0)": no such variable}} test trace-16.18 {unsets during unset traces} { unset -nocomplain y set y 1234 set info {} trace add variable y unset {traceReset2 y y} lappend info [catch {unset y} msg] $msg [catch {set y} msg] $msg } {1 {can't unset "y": no such variable} 0 xyzzy 0 {} 0 xyzzy} test trace-16.19 {unsets during unset traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) unset {traceReset2 y(0) y(0)} lappend info [catch {unset y(0)} msg] $msg [catch {set y(0)} msg] $msg } {1 {can't unset "y(0)": no such element in array} 0 xyzzy 0 {} 0 xyzzy} test trace-16.20 {unsets during unset traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) unset {traceReset2 y y(0)} lappend info [catch {unset y(0)} msg] $msg [catch {set y(0)} msg] $msg } {0 {} 0 xyzzy 0 {} 0 xyzzy} test trace-16.21 {unsets cancelling traces} { unset -nocomplain y set y 1234 set info {} trace add variable y read {traceAppend first} trace add variable y read {traceUnset y} trace add variable y read {traceAppend third} trace add variable y unset {traceAppend unset} lappend info [catch {set y} msg] $msg } {third unset 0 {} 1 {can't read "x": no such variable} 1 {can't read "y": no such variable}} test trace-16.22 {unsets cancelling traces} { unset -nocomplain y set y(0) 1234 set info {} trace add variable y(0) read {traceAppend first} trace add variable y(0) read {traceUnset y} trace add variable y(0) read {traceAppend third} trace add variable y(0) unset {traceAppend unset} lappend info [catch {set y(0)} msg] $msg } {third unset 0 {} 1 {can't read "x": no such variable} 1 {can't read "y(0)": no such variable}} # Check various non-interference between traces and other things. test trace-17.1 {trace doesn't prevent unset errors} { unset -nocomplain x set info {} trace add variable x unset {traceProc} list [catch {unset x} msg] $msg $info } {1 {can't unset "x": no such variable} {x {} unset}} test trace-17.2 {traced variables must survive procedure exits} { unset -nocomplain x proc p1 {} {global x; trace add variable x write traceProc} p1 trace info variable x } {{write traceProc}} test trace-17.3 {traced variables must survive procedure exits} { unset -nocomplain x set info {} proc p1 {} {global x; trace add variable x write traceProc} p1 set x 44 set info } {x {} write} # Be sure that procedure frames are released before unset traces # are invoked. test trace-18.1 {unset traces on procedure returns} { proc p1 {x y} {set a 44; p2 14} proc p2 {z} {trace add variable z unset {traceCheck {lsort [uplevel 1 {info vars}]}}} set info {} p1 foo bar set info } {0 {a x y}} test trace-18.2 {namespace delete / trace remove variable combo} { namespace eval ::foo { variable x 123 } proc p1 args { trace remove variable ::foo::x unset p1 } trace add variable ::foo::x unset p1 namespace delete ::foo info exists ::foo::x } 0 test trace-18.3 {namespace delete / trace remove variable combo, Bug \#1337229} { namespace eval ::ns {} trace add variable ::ns::var unset {unset ::ns::var ;#} namespace delete ::ns } {} test trace-18.4 {namespace delete / trace remove variable combo, Bug \#1338280} { namespace eval ::ref {} set ::ref::var1 AAA trace add variable ::ref::var1 unset doTrace set ::ref::var2 BBB trace add variable ::ref::var2 {unset} doTrace proc doTrace {vtraced vidx op} { global info append info [catch {set ::$vtraced}][llength [info vars ::ref::*]] } set info {} namespace delete ::ref rename doTrace {} set info } 1110 # Delete arrays when done, so they can be re-used as scalars # elsewhere. unset -nocomplain x y test trace-19.0.1 {trace add command (command existence)} { # Just in case! catch {rename nosuchname ""} list [catch {trace add command nosuchname rename traceCommand} msg] $msg } {1 {unknown command "nosuchname"}} test trace-19.0.2 {trace add command (command existence in ns)} { list [catch {trace add command nosuchns::nosuchname rename traceCommand} msg] $msg } {1 {unknown command "nosuchns::nosuchname"}} test trace-19.1 {trace add command (rename option)} { proc foo {} {} catch {rename bar {}} trace add command foo rename traceCommand rename foo bar set info } {::foo ::bar rename} test trace-19.2 {traces stick with renamed commands} { proc foo {} {} catch {rename bar {}} trace add command foo rename traceCommand rename foo bar rename bar foo set info } {::bar ::foo rename} test trace-19.2.1 {trace add command rename trace exists} { proc foo {} {} trace add command foo rename traceCommand trace info command foo } {{rename traceCommand}} test trace-19.3 {command rename traces don't fire on command deletion} { proc foo {} {} set info {} trace add command foo rename traceCommand rename foo {} set info } {} test trace-19.4 {trace add command rename doesn't trace recreated commands} { proc foo {} {} catch {rename bar {}} set info {} trace add command foo rename traceCommand proc foo {} {} rename foo bar set info } {} test trace-19.5 {trace add command deleted removes traces} { proc foo {} {} trace add command foo rename traceCommand proc foo {} {} trace info command foo } {} test trace-19.6 {trace add command rename in namespace} -setup { namespace eval tc {} proc tc::tcfoo {} {} } -body { trace add command tc::tcfoo rename traceCommand rename tc::tcfoo tc::tcbar set info } -cleanup { namespace delete tc } -result {::tc::tcfoo ::tc::tcbar rename} test trace-19.7 {trace add command rename in namespace back again} -setup { namespace eval tc {} proc tc::tcfoo {} {} } -body { trace add command tc::tcfoo rename traceCommand rename tc::tcfoo tc::tcbar rename tc::tcbar tc::tcfoo set info } -cleanup { namespace delete tc } -result {::tc::tcbar ::tc::tcfoo rename} test trace-19.8 {trace add command rename in namespace to out of namespace} -setup { namespace eval tc {} proc tc::tcfoo {} {} } -body { trace add command tc::tcfoo rename traceCommand rename tc::tcfoo tcbar set info } -cleanup { catch {rename tcbar {}} namespace delete tc } -result {::tc::tcfoo ::tcbar rename} test trace-19.9 {trace add command rename back into namespace} -setup { namespace eval tc {} proc tc::tcfoo {} {} } -body { trace add command tc::tcfoo rename traceCommand rename tc::tcfoo tcbar rename tcbar tc::tcfoo set info } -cleanup { namespace delete tc } -result {::tcbar ::tc::tcfoo rename} test trace-19.10 {trace add command failed rename doesn't trigger trace} { set info {} proc foo {} {} proc bar {} {} trace add command foo {rename delete} traceCommand catch {rename foo bar} set info } {} catch {rename foo {}} catch {rename bar {}} test trace-19.11 {trace add command qualifies when renamed in namespace} -setup { namespace eval tc {} proc tc::tcfoo {} {} } -body { set info {} trace add command tc::tcfoo {rename delete} traceCommand namespace eval tc {rename tcfoo tcbar} set info } -cleanup { namespace delete tc } -result {::tc::tcfoo ::tc::tcbar rename} # Make sure it exists again proc foo {} {} test trace-20.1 {trace add command (delete option)} { trace add command foo delete traceCommand rename foo "" set info } {::foo {} delete} test trace-20.2 {trace add command delete doesn't trace recreated commands} { set info {} proc foo {} {} rename foo "" set info } {} test trace-20.2.1 {trace add command delete trace info} { proc foo {} {} trace add command foo delete traceCommand trace info command foo } {{delete traceCommand}} test trace-20.3 {trace add command implicit delete} { proc foo {} {} trace add command foo delete traceCommand proc foo {} {} set info } {::foo {} delete} test trace-20.3.1 {trace add command delete trace info} { proc foo {} {} trace info command foo } {} test trace-20.4 {trace add command rename followed by delete} { set infotemp {} proc foo {} {} trace add command foo {rename delete} traceCommand rename foo bar lappend infotemp $info rename bar {} lappend infotemp $info set info $infotemp unset infotemp set info } {{::foo ::bar rename} {::bar {} delete}} catch {rename foo {}} catch {rename bar {}} test trace-20.5 {trace add command rename and delete} { set infotemp {} set info {} proc foo {} {} trace add command foo {rename delete} traceCommand rename foo bar lappend infotemp $info rename bar {} lappend infotemp $info set info $infotemp unset infotemp set info } {{::foo ::bar rename} {::bar {} delete}} test trace-20.6 {trace add command rename and delete in subinterp} { set tc [interp create] foreach p {traceCommand} { $tc eval [list proc $p [info args $p] [info body $p]] } $tc eval [list set infotemp {}] $tc eval [list set info {}] $tc eval [list proc foo {} {}] $tc eval [list trace add command foo {rename delete} traceCommand] $tc eval [list rename foo bar] $tc eval {lappend infotemp $info} $tc eval [list rename bar {}] $tc eval {lappend infotemp $info} $tc eval {set info $infotemp} $tc eval [list unset infotemp] set info [$tc eval [list set info]] interp delete $tc set info } {{::foo ::bar rename} {::bar {} delete}} # I'd like it if this test could give 'foo {} d' as a result, # but interp deletion means there is no interp to evaluate # the trace in. test trace-20.7 {trace add command delete in subinterp while being deleted} { set info {} set tc [interp create] interp alias $tc traceCommand {} traceCommand $tc eval [list proc foo {} {}] $tc eval [list trace add command foo {rename delete} traceCommand] interp delete $tc set info } {} proc traceDelete {cmd old new op} { trace remove command $cmd {*}[lindex [trace info command $cmd] 0] global info set info [list $old $new $op] } proc traceCmdrename {cmd old new op} { rename $old someothername } proc traceCmddelete {cmd old new op} { rename $old "" } test trace-20.8 {trace delete while trace is active} { set info {} proc foo {} {} catch {rename bar {}} trace add command foo {rename delete} [list traceDelete foo] rename foo bar list [set info] [trace info command bar] } {{::foo ::bar rename} {}} test trace-20.9 {rename trace deletes command} { set info {} proc foo {} {} catch {rename bar {}} catch {rename someothername {}} trace add command foo rename [list traceCmddelete foo] rename foo bar list [info commands foo] [info commands bar] [info commands someothername] } {{} {} {}} test trace-20.10 {rename trace renames command} { set info {} proc foo {} {} catch {rename bar {}} catch {rename someothername {}} trace add command foo rename [list traceCmdrename foo] rename foo bar set info [list [info commands foo] [info commands bar] [info commands someothername]] rename someothername {} set info } {{} {} someothername} test trace-20.11 {delete trace deletes command} { set info {} proc foo {} {} catch {rename bar {}} catch {rename someothername {}} trace add command foo delete [list traceCmddelete foo] rename foo {} list [info commands foo] [info commands bar] [info commands someothername] } {{} {} {}} test trace-20.12 {delete trace renames command} { set info {} proc foo {} {} catch {rename bar {}} catch {rename someothername {}} trace add command foo delete [list traceCmdrename foo] rename foo bar rename bar {} # None of these should exist. list [info commands foo] [info commands bar] [info commands someothername] } {{} {} {}} test trace-20.13 {rename trace discards result [Bug 1355342]} { proc foo {} {} trace add command foo rename {set w Aha!;#} list [rename foo bar] [rename bar {}] } {{} {}} test trace-20.14 {rename trace discards error result [Bug 1355342]} { proc foo {} {} trace add command foo rename {error} list [rename foo bar] [rename bar {}] } {{} {}} test trace-20.15 {delete trace discards result [Bug 1355342]} { proc foo {} {} trace add command foo delete {set w Aha!;#} rename foo {} } {} test trace-20.16 {delete trace discards error result [Bug 1355342]} { proc foo {} {} trace add command foo delete {error} rename foo {} } {} proc foo {b} { set a $b } # Delete arrays when done, so they can be re-used as scalars # elsewhere. unset -nocomplain x y # Delete procedures when done, so we don't clash with other tests # (e.g. foobar will clash with 'unknown' tests). catch {rename foobar {}} catch {rename foo {}} catch {rename bar {}} proc foo {a} { set b $a } proc traceExecute {args} { global info lappend info $args } test trace-21.1 {trace execution: enter} { set info {} trace add execution foo enter [list traceExecute foo] foo 1 trace remove execution foo enter [list traceExecute foo] set info } {{foo {foo 1} enter}} test trace-21.2 {trace exeuction: leave} { set info {} trace add execution foo leave [list traceExecute foo] foo 2 trace remove execution foo leave [list traceExecute foo] set info } {{foo {foo 2} 0 2 leave}} test trace-21.3 {trace exeuction: enter, leave} { set info {} trace add execution foo {enter leave} [list traceExecute foo] foo 3 trace remove execution foo {enter leave} [list traceExecute foo] set info } {{foo {foo 3} enter} {foo {foo 3} 0 3 leave}} test trace-21.4 {trace execution: enter, leave, enterstep} { set info {} trace add execution foo {enter leave enterstep} [list traceExecute foo] foo 3 trace remove execution foo {enter leave enterstep} [list traceExecute foo] set info } {{foo {foo 3} enter} {foo {set b 3} enterstep} {foo {foo 3} 0 3 leave}} test trace-21.5 {trace execution: enter, leave, enterstep, leavestep} { set info {} trace add execution foo {enter leave enterstep leavestep} [list traceExecute foo] foo 3 trace remove execution foo {enter leave enterstep leavestep} [list traceExecute foo] set info } {{foo {foo 3} enter} {foo {set b 3} enterstep} {foo {set b 3} 0 3 leavestep} {foo {foo 3} 0 3 leave}} test trace-21.6 {trace execution: enterstep, leavestep} { set info {} trace add execution foo {enterstep leavestep} [list traceExecute foo] foo 3 trace remove execution foo {enterstep leavestep} [list traceExecute foo] set info } {{foo {set b 3} enterstep} {foo {set b 3} 0 3 leavestep}} test trace-21.7 {trace execution: enterstep} { set info {} trace add execution foo {enterstep} [list traceExecute foo] foo 3 trace remove execution foo {enterstep} [list traceExecute foo] set info } {{foo {set b 3} enterstep}} test trace-21.8 {trace execution: leavestep} { set info {} trace add execution foo {leavestep} [list traceExecute foo] foo 3 trace remove execution foo {leavestep} [list traceExecute foo] set info } {{foo {set b 3} 0 3 leavestep}} test trace-21.9 {trace execution: TCL_EVAL_GLOBAL} testevalobjv { trace add execution foo enter soom proc ::soom args {lappend ::info SUCCESS [info level]} set ::info {} namespace eval test_ns_1 { proc soom args {lappend ::info FAIL [info level]} # [testevalobjv 1 ...] ought to produce the same # results as [uplevel #0 ...]. testevalobjv 1 foo x uplevel #0 foo x } namespace delete test_ns_1 trace remove execution foo enter soom set ::info } {SUCCESS 1 SUCCESS 1} test trace-21.10 {trace execution: TCL_EVAL_GLOBAL} testevalobjv { trace add execution foo leave soom proc ::soom args {lappend ::info SUCCESS [info level]} set ::info {} namespace eval test_ns_1 { proc soom args {lappend ::info FAIL [info level]} # [testevalobjv 1 ...] ought to produce the same # results as [uplevel #0 ...]. testevalobjv 1 foo x uplevel #0 foo x } namespace delete test_ns_1 trace remove execution foo leave soom set ::info } {SUCCESS 1 SUCCESS 1} test trace-21.11 {trace execution and alias} -setup { set res {} proc ::x {} {return ::} namespace eval a {} proc ::a::x {} {return ::a} interp alias {} y {} x } -body { lappend res [namespace eval ::a y] trace add execution ::x enter { rename ::x {} proc ::x {} {return ::} #} lappend res [namespace eval ::a y] } -cleanup { namespace delete a rename ::x {} } -result {:: ::} proc set2 args { set {*}$args } test trace-21.12 {bug 2438181} -setup { trace add execution set2 leave {puts one two three #;} } -body { set2 a hello } -returnCodes 1 -result {wrong # args: should be "puts ?-nonewline? ?channel? string"} proc factorial {n} { if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] } return 1 } test trace-22.1 {recursive(1) trace execution: enter} { set info {} trace add execution factorial {enter} [list traceExecute factorial] factorial 1 trace remove execution factorial {enter} [list traceExecute factorial] set info } {{factorial {factorial 1} enter}} test trace-22.2 {recursive(2) trace execution: enter} { set info {} trace add execution factorial {enter} [list traceExecute factorial] factorial 2 trace remove execution factorial {enter} [list traceExecute factorial] set info } {{factorial {factorial 2} enter} {factorial {factorial 1} enter}} test trace-22.3 {recursive(3) trace execution: enter} { set info {} trace add execution factorial {enter} [list traceExecute factorial] factorial 3 trace remove execution factorial {enter} [list traceExecute factorial] set info } {{factorial {factorial 3} enter} {factorial {factorial 2} enter} {factorial {factorial 1} enter}} test trace-23.1 {recursive(1) trace execution: enter, leave, enterstep, leavestep} { set info {} trace add execution factorial {enter leave enterstep leavestep} [list traceExecute] factorial 1 trace remove execution factorial {enter leave enterstep leavestep} [list traceExecute] join $info "\n" } {{factorial 1} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 0 {} leavestep {return 1} enterstep {return 1} 2 1 leavestep {factorial 1} 0 1 leave} test trace-23.2 {recursive(2) trace execution: enter, leave, enterstep, leavestep} { set info {} trace add execution factorial {enter leave enterstep leavestep} [list traceExecute] factorial 2 trace remove execution factorial {enter leave enterstep leavestep} [list traceExecute] join $info "\n" } {{factorial 2} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {expr {$n * [factorial [expr {$n -1 }]]}} enterstep {expr {$n -1 }} enterstep {expr {$n -1 }} 0 1 leavestep {factorial 1} enterstep {factorial 1} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 0 {} leavestep {return 1} enterstep {return 1} 2 1 leavestep {factorial 1} 0 1 leave {factorial 1} 0 1 leavestep {expr {$n * [factorial [expr {$n -1 }]]}} 0 2 leavestep {return 2} enterstep {return 2} 2 2 leavestep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 2 2 leavestep {factorial 2} 0 2 leave} test trace-23.3 {recursive(3) trace execution: enter, leave, enterstep, leavestep} { set info {} trace add execution factorial {enter leave enterstep leavestep} [list traceExecute] factorial 3 trace remove execution factorial {enter leave enterstep leavestep} [list traceExecute] join $info "\n" } {{factorial 3} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {expr {$n * [factorial [expr {$n -1 }]]}} enterstep {expr {$n -1 }} enterstep {expr {$n -1 }} 0 2 leavestep {factorial 2} enterstep {factorial 2} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {expr {$n * [factorial [expr {$n -1 }]]}} enterstep {expr {$n -1 }} enterstep {expr {$n -1 }} 0 1 leavestep {factorial 1} enterstep {factorial 1} enter {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} enterstep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 0 {} leavestep {return 1} enterstep {return 1} 2 1 leavestep {factorial 1} 0 1 leave {factorial 1} 0 1 leavestep {expr {$n * [factorial [expr {$n -1 }]]}} 0 2 leavestep {return 2} enterstep {return 2} 2 2 leavestep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 2 2 leavestep {factorial 2} 0 2 leave {factorial 2} 0 2 leavestep {expr {$n * [factorial [expr {$n -1 }]]}} 0 6 leavestep {return 6} enterstep {return 6} 2 6 leavestep {if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }} 2 6 leavestep {factorial 3} 0 6 leave} proc traceDelete {cmd args} { trace remove execution $cmd {*}[lindex [trace info execution $cmd] 0] global info set info $args } test trace-24.1 {delete trace during enter trace} { set info {} trace add execution foo enter [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{foo 1} enter} 0 {}} test trace-24.2 {delete trace during leave trace} { set info {} trace add execution foo leave [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{foo 1} 0 1 leave} 0 {}} test trace-24.3 {delete trace during enter-leave trace} { set info {} trace add execution foo {enter leave} [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{foo 1} enter} 0 {}} test trace-24.4 {delete trace during all exec traces} { set info {} trace add execution foo {enter leave enterstep leavestep} [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{foo 1} enter} 0 {}} test trace-24.5 {delete trace during all exec traces except enter} { set info {} trace add execution foo {leave enterstep leavestep} [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{set b 1} enterstep} 0 {}} proc traceDelete {cmd args} { rename $cmd {} global info set info $args } proc foo {a} { set b $a } test trace-25.1 {delete command during enter trace} { set info {} trace add execution foo enter [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {{invalid command name "foo"} {{foo 1} enter} 1 {unknown command "foo"}} proc foo {a} { set b $a } test trace-25.2 {delete command during leave trace} { set info {} trace add execution foo leave [list traceDelete foo] foo 1 list $info [catch {trace info execution foo} res] $res } {{{foo 1} 0 1 leave} 1 {unknown command "foo"}} proc foo {a} { set b $a } test trace-25.3 {delete command during enter then leave trace} { set info {} trace add execution foo enter [list traceDelete foo] trace add execution foo leave [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {{invalid command name "foo"} {{foo 1} enter} 1 {unknown command "foo"}} proc foo {a} { set b $a } proc traceExecute2 {args} { global info lappend info $args } # This shows the peculiar consequences of having two traces # at the same time: as well as tracing the procedure you want test trace-25.4 {order dependencies of two enter traces} { set info {} trace add execution foo enter [list traceExecute traceExecute] trace add execution foo enter [list traceExecute2 traceExecute2] catch {foo 1} err trace remove execution foo enter [list traceExecute traceExecute] trace remove execution foo enter [list traceExecute2 traceExecute2] join [list $err [join $info \n] [trace info execution foo]] "\n" } {1 traceExecute2 {foo 1} enter traceExecute {foo 1} enter } test trace-25.5 {order dependencies of two step traces} { set info {} trace add execution foo enterstep [list traceExecute traceExecute] trace add execution foo enterstep [list traceExecute2 traceExecute2] catch {foo 1} err trace remove execution foo enterstep [list traceExecute traceExecute] trace remove execution foo enterstep [list traceExecute2 traceExecute2] join [list $err [join $info \n] [trace info execution foo]] "\n" } {1 traceExecute2 {set b 1} enterstep traceExecute {set b 1} enterstep } # We don't want the result string (5th argument), or the results # will get unmanageable. proc tracePostExecute {args} { global info lappend info [concat [lrange $args 0 2] [lindex $args 4]] } proc tracePostExecute2 {args} { global info lappend info [concat [lrange $args 0 2] [lindex $args 4]] } test trace-25.6 {order dependencies of two leave traces} { set info {} trace add execution foo leave [list tracePostExecute tracePostExecute] trace add execution foo leave [list tracePostExecute2 tracePostExecute2] catch {foo 1} err trace remove execution foo leave [list tracePostExecute tracePostExecute] trace remove execution foo leave [list tracePostExecute2 tracePostExecute2] join [list $err [join $info \n] [trace info execution foo]] "\n" } {1 tracePostExecute {foo 1} 0 leave tracePostExecute2 {foo 1} 0 leave } test trace-25.7 {order dependencies of two leavestep traces} { set info {} trace add execution foo leavestep [list tracePostExecute tracePostExecute] trace add execution foo leavestep [list tracePostExecute2 tracePostExecute2] catch {foo 1} err trace remove execution foo leavestep [list tracePostExecute tracePostExecute] trace remove execution foo leavestep [list tracePostExecute2 tracePostExecute2] join [list $err [join $info \n] [trace info execution foo]] "\n" } {1 tracePostExecute {set b 1} 0 leavestep tracePostExecute2 {set b 1} 0 leavestep } proc foo {a} { set b $a } proc traceDelete {cmd args} { rename $cmd {} global info set info $args } test trace-25.8 {delete command during enter leave and enter/leave-step traces} { set info {} trace add execution foo enter [list traceDelete foo] trace add execution foo leave [list traceDelete foo] trace add execution foo enterstep [list traceDelete foo] trace add execution foo leavestep [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {{invalid command name "foo"} {{foo 1} enter} 1 {unknown command "foo"}} proc foo {a} { set b $a } test trace-25.9 {delete command during enter leave and leavestep traces} { set info {} trace add execution foo enter [list traceDelete foo] trace add execution foo leave [list traceDelete foo] trace add execution foo leavestep [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {{invalid command name "foo"} {{foo 1} enter} 1 {unknown command "foo"}} proc foo {a} { set b $a } test trace-25.10 {delete command during leave and leavestep traces} { set info {} trace add execution foo leave [list traceDelete foo] trace add execution foo leavestep [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {1 {{set b 1} 0 1 leavestep} 1 {unknown command "foo"}} proc foo {a} { set b $a } test trace-25.11 {delete command during enter and enterstep traces} { set info {} trace add execution foo enter [list traceDelete foo] trace add execution foo enterstep [list traceDelete foo] catch {foo 1} err list $err $info [catch {trace info execution foo} res] $res } {{invalid command name "foo"} {{foo 1} enter} 1 {unknown command "foo"}} test trace-26.1 {trace targetCmd when invoked through an alias} { proc foo {args} { set b $args } set info {} trace add execution foo enter [list traceExecute foo] interp alias {} bar {} foo 1 bar 2 trace remove execution foo enter [list traceExecute foo] set info } {{foo {foo 1 2} enter}} test trace-26.2 {trace targetCmd when invoked through an alias} { proc foo {args} { set b $args } set info {} trace add execution foo enter [list traceExecute foo] interp create child interp alias child bar {} foo 1 child eval bar 2 interp delete child trace remove execution foo enter [list traceExecute foo] set info } {{foo {foo 1 2} enter}} test trace-27.1 {memory leak in rename trace (604609)} { catch {rename bar {}} proc foo {} {error foo} trace add command foo rename {rename foo "" ;#} rename foo bar info commands foo } {} test trace-27.2 {command trace remove nonsense} { list [catch {trace remove command thisdoesntexist \ {delete rename} bar} res] $res } {1 {unknown command "thisdoesntexist"}} test trace-27.3 {command trace info nonsense} { list [catch {trace info command thisdoesntexist} res] $res } {1 {unknown command "thisdoesntexist"}} test trace-28.1 {enterstep and leavestep traces with update idletasks (615043)} { catch {rename foo {}} proc foo {} { set a 1 update idletasks set b 1 } set info {} trace add execution foo {enter enterstep leavestep leave} \ [list traceExecute foo] update after idle {set a "idle"} foo trace remove execution foo {enter enterstep leavestep leave} \ [list traceExecute foo] rename foo {} unset -nocomplain a join $info "\n" } {foo foo enter foo {set a 1} enterstep foo {set a 1} 0 1 leavestep foo {update idletasks} enterstep foo {set a idle} enterstep foo {set a idle} 0 idle leavestep foo {update idletasks} 0 {} leavestep foo {set b 1} enterstep foo {set b 1} 0 1 leavestep foo foo 0 1 leave} test trace-28.2 {exec traces with 'error'} { set info {} set res {} proc foo {} { if {[catch {bar}]} { return "error" } else { return "ok" } } proc bar {} { error "msg" } lappend res [foo] trace add execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] # With the trace active lappend res [foo] trace remove execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] list $res [join $info \n] } {{error error} {foo foo enter foo {if {[catch {bar}]} { return "error" } else { return "ok" }} enterstep foo {catch bar} enterstep foo bar enterstep foo {error msg} enterstep foo {error msg} 1 msg leavestep foo bar 1 msg leavestep foo {catch bar} 0 1 leavestep foo {return error} enterstep foo {return error} 2 error leavestep foo {if {[catch {bar}]} { return "error" } else { return "ok" }} 2 error leavestep foo foo 0 error leave}} test trace-28.3 {exec traces with 'return -code error'} { set info {} set res {} proc foo {} { if {[catch {bar}]} { return "error" } else { return "ok" } } proc bar {} { return -code error "msg" } lappend res [foo] trace add execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] # With the trace active lappend res [foo] trace remove execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] list $res [join $info \n] } {{error error} {foo foo enter foo {if {[catch {bar}]} { return "error" } else { return "ok" }} enterstep foo {catch bar} enterstep foo bar enterstep foo {return -code error msg} enterstep foo {return -code error msg} 2 msg leavestep foo bar 1 msg leavestep foo {catch bar} 0 1 leavestep foo {return error} enterstep foo {return error} 2 error leavestep foo {if {[catch {bar}]} { return "error" } else { return "ok" }} 2 error leavestep foo foo 0 error leave}} test trace-28.4 {exec traces in child with 'return -code error'} { interp create child interp alias child traceExecute {} traceExecute set info {} set res [interp eval child { set info {} set res {} proc foo {} { if {[catch {bar}]} { return "error" } else { return "ok" } } proc bar {} { return -code error "msg" } lappend res [foo] trace add execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] # With the trace active lappend res [foo] trace remove execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] list $res }] interp delete child lappend res [join $info \n] } {{error error} {foo foo enter foo {if {[catch {bar}]} { return "error" } else { return "ok" }} enterstep foo {catch bar} enterstep foo bar enterstep foo {return -code error msg} enterstep foo {return -code error msg} 2 msg leavestep foo bar 1 msg leavestep foo {catch bar} 0 1 leavestep foo {return error} enterstep foo {return error} 2 error leavestep foo {if {[catch {bar}]} { return "error" } else { return "ok" }} 2 error leavestep foo foo 0 error leave}} test trace-28.5 {exec traces} { set info {} proc foo {args} { set a 1 } trace add execution foo {enter enterstep leave leavestep} \ [list traceExecute foo] after idle [list foo test-28.4] update # Complicated way of removing traces set ti [lindex [eval [list trace info execution ::foo]] 0] if {[llength $ti]} { eval [concat [list trace remove execution foo] $ti] } join $info \n } {foo {foo test-28.4} enter foo {set a 1} enterstep foo {set a 1} 0 1 leavestep foo {foo test-28.4} 0 1 leave} test trace-28.6 {exec traces firing order} { set info {} proc enterStep {cmd op} {lappend ::info "enter $cmd/$op"} proc leaveStep {cmd code result op} {lappend ::info "leave $cmd/$code/$result/$op"} proc foo x { set b x=$x incr x } trace add execution foo enterstep enterStep trace add execution foo leavestep leaveStep foo 42 rename foo {} join $info \n } {enter set b x=42/enterstep leave set b x=42/0/x=42/leavestep enter incr x/enterstep leave incr x/0/43/leavestep} test trace-28.7 {exec trace information} { set info {} proc foo x { incr x } proc bar {args} {} trace add execution foo {enter leave enterstep leavestep} bar set info [trace info execution foo] trace remove execution foo {enter leave enterstep leavestep} bar } {} test trace-28.8 {exec trace remove nonsense} { list [catch {trace remove execution thisdoesntexist \ {enter leave enterstep leavestep} bar} res] $res } {1 {unknown command "thisdoesntexist"}} test trace-28.9 {exec trace info nonsense} { list [catch {trace info execution thisdoesntexist} res] $res } {1 {unknown command "thisdoesntexist"}} test trace-28.10 {exec trace info nonsense} { list [catch {trace remove execution} res] $res } {1 {wrong # args: should be "trace remove execution name opList command"}} test trace-29.1 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} { testcmdtrace tracetest {set stuff [expr {14 + 16}]} } {{expr {14 + 16}} {expr {14 + 16}} {set stuff [expr {14 + 16}]} {set stuff 30}} test trace-29.2 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} { testcmdtrace tracetest {set stuff [info tclversion]} } [concat {{info tclversion} {info tclversion} ::tcl::info::tclversion {::tcl::info::tclversion} {set stuff [info tclversion]}} [list "set stuff [info tclversion]"]] test trace-29.3 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} { testcmdtrace deletetest {set stuff [info tclversion]} } [info tclversion] test trace-29.4 {Tcl_CreateTrace, check that tracing doesn't cause memory faults} {testcmdtrace} { # Note that the proc call is the same as the variable name, and that # the call can be direct or indirect by way of another procedure proc tracer {args} {} proc tracedLoop {level} { incr level tracer foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level} } testcmdtrace tracetest {tracedLoop 0} } {{tracedLoop 0} {tracedLoop 0} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {1 2} {tracedLoop $level}} {tracedLoop $level} {tracedLoop 1} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {} {tracedLoop $level}} {tracedLoop $level} {tracedLoop 1} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {} {tracedLoop $level}}} catch {rename tracer {}} catch {rename tracedLoop {}} test trace-29.5 {Tcl_CreateObjTrace, status return TCL_ERROR} {testcmdtrace} { proc Error { args } { error "Shouldn't get here" } set x 1; list [catch {testcmdtrace resulttest {Error $x}} result] [set result] } {1 {Error $x}} test trace-29.6 {Tcl_CreateObjTrace, status return TCL_RETURN} {testcmdtrace} { proc Return { args } { error "Shouldn't get here" } set x 1; list [catch {testcmdtrace resulttest {Return $x}} result] [set result] } {2 {}} test trace-29.7 {Tcl_CreateObjTrace, status return TCL_BREAK} {testcmdtrace} { proc Break { args } { error "Shouldn't get here" } set x 1; list [catch {testcmdtrace resulttest {Break $x}} result] [set result] } {3 {}} test trace-29.8 {Tcl_CreateObjTrace, status return TCL_CONTINUE} {testcmdtrace} { proc Continue { args } { error "Shouldn't get here" } set x 1; list [catch {testcmdtrace resulttest {Continue $x}} result] [set result] } {4 {}} test trace-29.9 {Tcl_CreateObjTrace, status return unknown} {testcmdtrace} { proc OtherStatus { args } { error "Shouldn't get here" } set x 1; list [catch {testcmdtrace resulttest {OtherStatus $x}} result] [set result] } {6 {}} test trace-29.10 {Tcl_CreateTrace, correct level interpretation} {testcmdtrace} { proc foo {} {uplevel 1 bar} proc bar {} {uplevel 1 grok} proc grok {} {uplevel 1 spock} proc spock {} {uplevel 1 fascinating} proc fascinating {} {} testcmdtrace leveltest {foo} } {foo {foo} {uplevel 1 bar} {uplevel 1 bar} bar {bar} {uplevel 1 grok} {uplevel 1 grok}} test trace-29.11 {Tcl_CreateTrace, multiple traces} {testcmdtrace} { testcmdtrace doubletest {format xx} } {{format xx} {format xx}} test trace-30.1 {Tcl_DeleteTrace} {emptyTest} { # the above tests have tested Tcl_DeleteTrace } {} test trace-31.1 {command and execution traces shared struct} { # Tcl Bug 807243 proc foo {} {} trace add command foo delete foo trace add execution foo enter foo set result [trace info command foo] trace remove command foo delete foo trace remove execution foo enter foo rename foo {} set result } [list [list delete foo]] test trace-31.2 {command and execution traces shared struct} { # Tcl Bug 807243 proc foo {} {} trace add command foo delete foo trace add execution foo enter foo set result [trace info execution foo] trace remove command foo delete foo trace remove execution foo enter foo rename foo {} set result } [list [list enter foo]] test trace-32.1 { TraceCommandInfo refcount decr in TraceCommandProc w/o loss of reference } { # Tcl Bug 811483 proc foo {} {} trace add command foo delete foo trace add execution foo enter foo set result [trace info command foo] rename foo {} set result } [list [list delete foo]] test trace-33.1 {variable match with remove variable} { unset -nocomplain x trace add variable x write foo trace remove variable x write foo llength [trace info variable x] } 0 test trace-34.1 {Bug 1201035} { set ::x [list] proc foo {} {lappend ::x foo} proc bar args { lappend ::x $args trace remove execution foo leavestep bar trace remove execution foo enterstep bar trace add execution foo leavestep bar trace add execution foo enterstep bar lappend ::x done } trace add execution foo leavestep bar trace add execution foo enterstep bar foo set ::x } {{{lappend ::x foo} enterstep} done foo} test trace-34.2 {Bug 1224585} { proc foo {} {} proc bar args {trace remove execution foo leave soom} trace add execution foo leave bar trace add execution foo leave soom foo } {} test trace-34.3 {Bug 1224585} { proc foo {} {set x {}} proc bar args {trace remove execution foo enterstep soom} trace add execution foo enterstep soom trace add execution foo enterstep bar foo } {} # We test here for the half-documented and currently valid interplay between # delete traces and namespace deletion. test trace-34.4 {Bug 1047286} { variable x notrace proc callback {old - -} { variable x "$old exists: [namespace which -command $old]" } namespace eval ::foo {proc bar {} {}} trace add command ::foo::bar delete [namespace code callback] namespace delete ::foo set x } {::foo::bar exists: ::foo::bar} test trace-34.5 {Bug 1047286} { variable x notrace proc callback {old - -} { variable x "$old exists: [namespace which -command $old]" } namespace eval ::foo {proc bar {} {}} trace add command ::foo::bar delete [namespace code callback] namespace eval ::foo namespace delete ::foo set x } {::foo::bar exists: } test trace-34.6 {Bug 1458266} -setup { proc dummy {} {} proc stepTraceHandler {cmdString args} { variable log append log "[expr {[info level] - 1}]: [lindex [split $cmdString] 0]\n" dummy isTracedInside_2 } proc cmdTraceHandler {cmdString args} { # silent } proc isTracedInside_1 {} { isTracedInside_2 } proc isTracedInside_2 {} { set x 2 } } -body { variable log {} trace add execution isTracedInside_1 enterstep stepTraceHandler trace add execution isTracedInside_2 enterstep stepTraceHandler isTracedInside_1 variable first $log set log {} trace add execution dummy enter cmdTraceHandler isTracedInside_1 variable second $log expr {($first eq $second) ? "ok" : "\n$first\nand\n\n$second\ndiffer"} } -cleanup { unset -nocomplain log first second rename dummy {} rename stepTraceHandler {} rename cmdTraceHandler {} rename isTracedInside_1 {} rename isTracedInside_2 {} } -result ok test trace-35.1 {527164: Keep -errorinfo of traces} -setup { unset -nocomplain x y } -body { trace add variable x write {error foo;#} trace add variable y write {set x 2;#} list [catch {set y 1} msg opts] $msg [dict get $opts -errorinfo] } -cleanup { unset -nocomplain x y } -result {1 {can't set "y": can't set "x": foo} {foo while executing "error foo" (write trace on "x") invoked from within "set x 2" (write trace on "y") invoked from within "set y 1"}} # # Test for the correct(?) dynamics of execution traces. This test insures that # the dynamics of the original implementation remain valid; note that # these aspects are neither documented nor do they appear in TIP 62 proc traceproc {tracevar args} { append ::$tracevar * } proc untraced {type} { trace add execution untraced $type {traceproc tracevar} append ::tracevar - } proc runbase {results base} { set tt {enter leave enterstep leavestep} foreach n {1 2 3 4} t $tt r $results { eval [subst $base] } } set base { test trace-36.$n {dynamic trace creation: $t} -setup { set ::tracevar {} } -cleanup { unset ::tracevar trace remove execution untraced $t {traceproc tracevar} } -body { untraced $t set ::tracevar } -result {$r} } runbase {- - - -} $base set base { test trace-37.$n {dynamic trace addition: $t} -setup { set ::tracevar {} set ::tracevar2 {} trace add execution untraced enter {traceproc tracevar2} } -cleanup { trace remove execution untraced $t {traceproc tracevar} trace remove execution untraced enter {traceproc tracevar2} unset ::tracevar ::tracevar2 } -body { untraced $t list \$::tracevar \$::tracevar2 } -result {$r} } runbase {{- *} {-* *} {- *} {- *}} $base set base { test trace-38.$n {dynamic trace addition: $t} -setup { set ::tracevar {} set ::tracevar2 {} trace add execution untraced leave {traceproc tracevar2} } -cleanup { trace remove execution untraced $t {traceproc tracevar} trace remove execution untraced leave {traceproc tracevar2} unset ::tracevar ::tracevar2 } -body { untraced $t list \$::tracevar \$::tracevar2 } -result {$r} } runbase {{- *} {-* *} {- *} {- *}} $base test trace-39 {bug #3484621: tracing Bc'ed commands} -setup { set ::traceLog 0 set ::traceCalls 0 set ::bar [list 0 1 2 3] set res {} proc dotrace args { incr ::traceLog } proc foo {} { incr ::traceCalls # choose a BC'ed command that is 'unlikely' to interfere with tcltest's # internals lset ::bar 1 2 } } -body { foo lappend res $::traceLog trace add execution lset enter dotrace foo lappend res $::traceLog trace remove execution lset enter dotrace foo lappend res $::traceLog list $::traceCalls | {*}$res } -cleanup { unset ::traceLog ::traceCalls ::bar res rename dotrace {} rename foo {} } -result {3 | 0 1 1} test trace-39.1 {bug #3485022: tracing Bc'ed commands} -setup { set ::traceLog 0 set ::traceCalls 0 set res {} proc dotrace args { incr ::traceLog } proc foo {} { incr ::traceCalls string equal zip zap } } -body { foo lappend res $::traceLog trace add execution ::tcl::string::equal enter dotrace foo lappend res $::traceLog trace remove execution tcl::string::equal enter dotrace foo lappend res $::traceLog list $::traceCalls | {*}$res } -cleanup { unset ::traceLog ::traceCalls res rename dotrace {} rename foo {} } -result {3 | 0 1 1} test trace-40.1 {execution trace errors become command errors} { proc foo args {} trace add execution foo enter {rename foo {}; error bar;#} catch foo m return -level 0 $m[unset m] } bar # Delete procedures when done, so we don't clash with other tests # (e.g. foobar will clash with 'unknown' tests). catch {rename foobar {}} catch {rename foo {}} catch {rename bar {}} catch {rename untraced {}} catch {rename traceproc {}} catch {rename runbase {}} # Unset the variable when done unset -nocomplain info base # cleanup cleanupTests return tcl9.0.3/tests/tm.test0000644000175000017500000002033215104661341014232 0ustar sergeisergei# This file contains tests for the ::tcl::tm::* commands. # # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 2004 Donal K. Fellows. # All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test tm-1.1 {tm: path command exists} { catch { ::tcl::tm::path } info commands ::tcl::tm::path } ::tcl::tm::path test tm-1.2 {tm: path command syntax} -returnCodes error -body { ::tcl::tm::path foo } -result {unknown or ambiguous subcommand "foo": must be add, list, or remove} test tm-1.3 {tm: path command syntax} { ::tcl::tm::path add } {} test tm-1.4 {tm: path command syntax} { ::tcl::tm::path remove } {} test tm-1.5 {tm: path command syntax} -returnCodes error -body { ::tcl::tm::path list foobar } -result "wrong # args: should be \"::tcl::tm::path list\"" test tm-2.1 {tm: roots command exists} { catch { ::tcl::tm::roots } info commands ::tcl::tm::roots } ::tcl::tm::roots test tm-2.2 {tm: roots command syntax} -returnCodes error -body { ::tcl::tm::roots } -result "wrong # args: should be \"::tcl::tm::roots paths\"" test tm-2.3 {tm: roots command syntax} -returnCodes error -body { ::tcl::tm::roots foo bar } -result "wrong # args: should be \"::tcl::tm::roots paths\"" test tm-3.1 {tm: module path management, input validation} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -returnCodes error -body { ::tcl::tm::path add foo/bar ::tcl::tm::path add foo } -result {foo is ancestor of existing module path foo/bar.} test tm-3.2 {tm: module path management, input validation} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -returnCodes error -body { ::tcl::tm::path add foo ::tcl::tm::path add foo/bar } -result {foo/bar is subdirectory of existing module path foo.} test tm-3.3 {tm: module path management, add/list interaction} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::path add foo ::tcl::tm::path add bar ::tcl::tm::path list } -result {bar foo} test tm-3.4 {tm: module path management, add/list interaction} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::path add foo bar baz ::tcl::tm::path list } -result {baz bar foo} test tm-3.5 {tm: module path management, input validation/list interaction} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { catch {::tcl::tm::path add snarf foo geode foo/bar} # Nothing is added if a problem was found. ::tcl::tm::path list } -result {} test tm-3.6 {tm: module path management, input validation/list interaction} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { catch {::tcl::tm::path add snarf foo/bar geode foo} # Nothing is added if a problem was found. ::tcl::tm::path list } -result {} test tm-3.7 {tm: module path management, input validation/list interaction} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { catch { ::tcl::tm::path add foo/bar ::tcl::tm::path add snarf geode foo } # Nothing is added if a problem was found. ::tcl::tm::path list } -result {foo/bar} test tm-3.8 {tm: module path management, input validation, ignore duplicates} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { # Ignore path if present ::tcl::tm::path add foo ::tcl::tm::path add snarf geode foo ::tcl::tm::path list } -result {geode snarf foo} test tm-3.9 {tm: module path management, input validation, ignore duplicates} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { # Ignore path if present ::tcl::tm::path add foo snarf geode foo ::tcl::tm::path list } -result {geode snarf foo} test tm-3.10 {tm: module path management, remove} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::path add snarf geode foo ::tcl::tm::path remove foo ::tcl::tm::path list } -result {geode snarf} test tm-3.11 {tm: module path management, remove ignores unknown path} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::path add foo snarf geode ::tcl::tm::path remove fox ::tcl::tm::path list } -result {geode snarf foo} proc genpaths {base} { # Normalizing picks up drive letters on windows [Bug 1053568] set base [file normalize $base] regexp {^(\d+)\.(\d+)} [package provide tcl] - major minor set results {} set base [file join $base tcl$major] lappend results [file join $base site-tcl] for {set i 0} {$i <= $minor} {incr i} { lappend results [file join $base ${major}.$i] } return $results } test tm-3.12 {tm: module path management, roots} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::roots /FOO ::tcl::tm::path list } -result [genpaths /FOO] test tm-3.13 {tm: module path management, roots} -setup { # Save and clear the list set defaults [::tcl::tm::path list] foreach p $defaults {::tcl::tm::path remove $p} } -cleanup { # Restore old contents of path list. foreach p [::tcl::tm::path list] {::tcl::tm::path remove $p} foreach p $defaults {::tcl::tm::path add $p} } -body { ::tcl::tm::roots [list /FOO /BAR] ::tcl::tm::path list } -result [concat [genpaths /BAR] [genpaths /FOO]] rename genpaths {} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/timer.test0000644000175000017500000003630015104661341014734 0ustar sergeisergei# This file contains a collection of tests for the procedures in the # file tclTimer.c, which includes the "after" Tcl command. Sourcing # this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test timer-1.1 {Tcl_CreateTimerHandler procedure} -setup { foreach i [after info] { after cancel $i } } -body { set x "" foreach i {100 200 1000 50 150} { after $i lappend x $i } after 200 set done 1 vwait done return $x } -cleanup { foreach i [after info] { after cancel $i } } -result {50 100 150 200} test timer-2.1 {Tcl_DeleteTimerHandler procedure} -setup { foreach i [after info] { after cancel $i } } -body { set x "" foreach i {100 200 1000 50 150} { after $i lappend x $i } after cancel lappend x 150 after cancel lappend x 50 after 200 set done 1 vwait done return $x } -result {100 200} # No tests for Tcl_ServiceTimer or ResetTimer, since it is already tested # above. test timer-3.1 {TimerHandlerEventProc procedure: event masks} { set x start after 100 { set x fired } update idletasks set result $x after 200 update lappend result $x } {start fired} test timer-3.2 {TimerHandlerEventProc procedure: multiple timers} -setup { foreach i [after info] { after cancel $i } } -body { foreach i {200 600 1000} { after $i lappend x $i } after 200 set result "" set x "" update lappend result $x after 400 update lappend result $x after 400 update lappend result $x } -result {200 {200 600} {200 600 1000}} test timer-3.3 {TimerHandlerEventProc procedure: reentrant timer deletion} -setup { foreach i [after info] { after cancel $i } } -body { set x {} after 100 lappend x 100 set i [after 300 lappend x 300] after 200 after cancel $i after 400 update return $x } -result 100 test timer-3.4 {TimerHandlerEventProc procedure: all expired timers fire} -setup { foreach i [after info] { after cancel $i } } -body { set x {} after 100 lappend x a after 200 lappend x b after 300 lappend x c after 300 vwait x return $x } -result {a b c} test timer-3.5 {TimerHandlerEventProc procedure: reentrantly added timers don't fire} -setup { foreach i [after info] { after cancel $i } } -body { set x {} after 100 {lappend x a; after 0 lappend x b} after 100 vwait x return $x } -result a test timer-3.6 {TimerHandlerEventProc procedure: reentrantly added timers don't fire} -setup { foreach i [after info] { after cancel $i } } -body { set x {} after 100 {lappend x a; after 100 lappend x b; after 100} after 100 vwait x set result $x vwait x lappend result $x } -result {a {a b}} # No tests for Tcl_DoWhenIdle: it's already tested by other tests # below. test timer-4.1 {Tcl_CancelIdleCall procedure} -setup { foreach i [after info] { after cancel $i } } -body { set x before set y before set z before after idle set x after1 after idle set y after2 after idle set z after3 after cancel set y after2 update idletasks list $x $y $z } -result {after1 before after3} test timer-4.2 {Tcl_CancelIdleCall procedure} -setup { foreach i [after info] { after cancel $i } } -body { set x before set y before set z before after idle set x after1 after idle set y after2 after idle set z after3 after cancel set x after1 update idletasks list $x $y $z } -result {before after2 after3} test timer-5.1 {Tcl_ServiceIdle, self-rescheduling handlers} -setup { foreach i [after info] { after cancel $i } } -body { set x 1 set y 23 after idle {incr x; after idle {incr x; after idle {incr x}}} after idle {incr y} vwait x set result "$x $y" update idletasks lappend result $x } -result {2 24 4} test timer-6.1 {Tcl_AfterCmd procedure, basics} -returnCodes error -body { after } -result {wrong # args: should be "after option ?arg ...?"} test timer-6.2 {Tcl_AfterCmd procedure, basics} -returnCodes error -body { after 2x } -result {bad argument "2x": must be cancel, idle, info, or an integer} test timer-6.3 {Tcl_AfterCmd procedure, basics} -returnCodes error -body { after gorp } -result {bad argument "gorp": must be cancel, idle, info, or an integer} test timer-6.4 {Tcl_AfterCmd procedure, ms argument} { set x before after 400 {set x after} after 200 update set y $x after 400 update list $y $x } {before after} test timer-6.5 {Tcl_AfterCmd procedure, ms argument} { set x before after 400 set x after after 200 update set y $x after 400 update list $y $x } {before after} test timer-6.6 {Tcl_AfterCmd procedure, cancel option} -body { after cancel } -returnCodes error -result {wrong # args: should be "after cancel id|command"} test timer-6.7 {Tcl_AfterCmd procedure, cancel option} { after cancel after#1 } {} test timer-6.8 {Tcl_AfterCmd procedure, cancel option} { after cancel {foo bar} } {} test timer-6.9 {Tcl_AfterCmd procedure, cancel option} -setup { foreach i [after info] { after cancel $i } } -body { set x before set y [after 100 set x after] after cancel $y after 200 update return $x } -result {before} test timer-6.10 {Tcl_AfterCmd procedure, cancel option} -setup { foreach i [after info] { after cancel $i } } -body { set x before after 100 set x after after cancel {set x after} after 200 update return $x } -result {before} test timer-6.11 {Tcl_AfterCmd procedure, cancel option} -setup { foreach i [after info] { after cancel $i } } -body { set x before after 100 set x after set id [after 300 set x after] after cancel $id after 200 update set y $x set x cleared after 200 update list $y $x } -result {after cleared} test timer-6.12 {Tcl_AfterCmd procedure, cancel option} -setup { foreach i [after info] { after cancel $i } } -body { set x first after idle lappend x second after idle lappend x third set i [after idle lappend x fourth] after cancel {lappend x second} after cancel $i update idletasks return $x } -result {first third} test timer-6.13 {Tcl_AfterCmd procedure, cancel option, multiple arguments for command} -setup { foreach i [after info] { after cancel $i } } -body { set x first after idle lappend x second after idle lappend x third set i [after idle lappend x fourth] after cancel lappend x second after cancel $i update idletasks return $x } -result {first third} test timer-6.14 {Tcl_AfterCmd procedure, cancel option, cancel during handler, used to dump core} -setup { foreach i [after info] { after cancel $i } } -body { set id [ after 100 { set x done after cancel $id } ] vwait x } -result {} test timer-6.15 {Tcl_AfterCmd procedure, cancel option, multiple interps} -setup { foreach i [after info] { after cancel $i } } -body { interp create x x eval {set a before; set b before; after idle {set a a-after}; after idle {set b b-after}} set result [llength [x eval after info]] lappend result [llength [after info]] after cancel {set b b-after} set a aaa set b bbb x eval {after cancel set a a-after} update idletasks lappend result $a $b [x eval {list $a $b}] } -cleanup { interp delete x } -result {2 0 aaa bbb {before b-after}} test timer-6.16 {Tcl_AfterCmd procedure, idle option} -body { after idle } -returnCodes error -result {wrong # args: should be "after idle script ?script ...?"} test timer-6.17 {Tcl_AfterCmd procedure, idle option} { set x before after idle {set x after} set y $x update idletasks list $y $x } {before after} test timer-6.18 {Tcl_AfterCmd procedure, idle option} { set x before after idle set x after set y $x update idletasks list $y $x } {before after} set event1 [after idle event 1] set event2 [after 1000 event 2] interp create x set childEvent [x eval {after idle event in child}] test timer-6.19 {Tcl_AfterCmd, info option} { lsort [after info] } [lsort "$event1 $event2"] test timer-6.20 {Tcl_AfterCmd, info option} -returnCodes error -body { after info a b } -result {wrong # args: should be "after info ?id?"} test timer-6.21 {Tcl_AfterCmd, info option} -returnCodes error -body { after info $childEvent } -result "event \"$childEvent\" doesn't exist" test timer-6.22 {Tcl_AfterCmd, info option} { list [after info $event1] [after info $event2] } {{{event 1} idle} {{event 2} timer}} after cancel $event1 after cancel $event2 interp delete x test timer-6.23 {Tcl_AfterCmd procedure, no option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after 1 "set x ab\x00cd" after 10 update string length $x } -result {5} test timer-6.24 {Tcl_AfterCmd procedure, no option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after 1 set x ab\x00cd after 10 update string length $x } -result {5} test timer-6.25 {Tcl_AfterCmd procedure, cancel option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after 1 set x ab\x00cd after cancel "set x ab\x00ef" llength [after info] } -cleanup { foreach i [after info] { after cancel $i } } -result {1} test timer-6.26 {Tcl_AfterCmd procedure, cancel option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after 1 set x ab\x00cd after cancel set x ab\x00ef llength [after info] } -cleanup { foreach i [after info] { after cancel $i } } -result {1} test timer-6.27 {Tcl_AfterCmd procedure, idle option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after idle "set x ab\x00cd" update string length $x } -result {5} test timer-6.28 {Tcl_AfterCmd procedure, idle option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" after idle set x ab\x00cd update string length $x } -result {5} test timer-6.29 {Tcl_AfterCmd procedure, info option, script with NUL} -setup { foreach i [after info] { after cancel $i } } -body { set x "hello world" set id junk set id [after 10 set x ab\x00cd] update string length [lindex [lindex [after info $id] 0] 2] } -cleanup { foreach i [after info] { after cancel $i } } -result 5 set event [after idle foo bar] scan $event after#%d lastId test timer-7.1 {GetAfterEvent procedure} -returnCodes error -body { after info xfter#$lastId } -result "event \"xfter#$lastId\" doesn't exist" test timer-7.2 {GetAfterEvent procedure} -returnCodes error -body { after info afterx$lastId } -result "event \"afterx$lastId\" doesn't exist" test timer-7.3 {GetAfterEvent procedure} -returnCodes error -body { after info after#ab } -result {event "after#ab" doesn't exist} test timer-7.4 {GetAfterEvent procedure} -returnCodes error -body { after info after# } -result {event "after#" doesn't exist} test timer-7.5 {GetAfterEvent procedure} -returnCodes error -body { after info after#${lastId}x } -result "event \"after#${lastId}x\" doesn't exist" test timer-7.6 {GetAfterEvent procedure} -returnCodes error -body { after info afterx[expr {$lastId+1}] } -result "event \"afterx[expr {$lastId+1}]\" doesn't exist" after cancel $event test timer-8.1 {AfterProc procedure} { set x before proc foo {} { set x untouched after 100 {set x after} after 200 update return $x } list [foo] $x } {untouched after} test timer-8.2 {AfterProc procedure} -setup { variable x empty proc myHandler {msg options} { variable x [list $msg [dict get $options -errorinfo]] } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { after 100 {error "After error"} after 200 set y $x update list $y $x } -cleanup { interp bgerror {} $handler } -result {empty {{After error} {After error while executing "error "After error"" ("after" script)}}} test timer-8.3 {AfterProc procedure, deleting handler from itself} -setup { foreach i [after info] { after cancel $i } } -body { proc foo {} { global x set x {} foreach i [after info] { lappend x [after info $i] } after cancel foo } after idle foo after 1000 {error "I shouldn't ever have executed"} update idletasks return $x } -result {{{error "I shouldn't ever have executed"} timer}} test timer-8.4 {AfterProc procedure, deleting handler from itself} -setup { foreach i [after info] { after cancel $i } } -body { proc foo {} { global x set x {} foreach i [after info] { lappend x [after info $i] } after cancel foo } after 1000 {error "I shouldn't ever have executed"} after idle foo update idletasks return $x } -result {{{error "I shouldn't ever have executed"} timer}} foreach i [after info] { after cancel $i } # No test for FreeAfterPtr, since it is already tested above. test timer-9.1 {AfterCleanupProc procedure} -setup { catch {interp delete x} } -body { interp create x x eval {after 200 { lappend x after puts "part 1: this message should not appear" }} after 200 {lappend x after2} x eval {after 200 { lappend x after3 puts "part 2: this message should not appear" }} after 200 {lappend x after4} x eval {after 200 { lappend x after5 puts "part 3: this message should not appear" }} interp delete x set x before after 300 update return $x } -result {before after2 after4} test timer-10.1 {Bug 1016167: [after] overwrites imports} -setup { interp create child child eval namespace export after child eval namespace eval foo namespace import ::after } -body { child eval foo::after 1 child eval namespace origin foo::after } -cleanup { # Bug will cause crash here; would cause failure otherwise interp delete child } -result ::after test timer-11.1 {Bug 1350291: [after] overflowing 32-bit field} -body { set b ok set a [after 0x100000001 {set b "after fired early"}] after 100 set done 1 vwait done return $b } -cleanup { catch {after cancel $a} } -result ok test timer-11.2 {Bug 1350293: [after] negative argument} -body { set l {} after 100 {lappend l 100; set done 1} after -1 {lappend l -1} vwait done return $l } -result {-1 100} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/thread.test0000644000175000017500000014535115104661341015072 0ustar sergeisergei# Commands covered: (test)thread # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2006-2008 Joe Mistachkin. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # when thread::release is used, -wait is passed in order allow the thread to # be fully finalized, which avoids valgrind "still reachable" reports. package require tcltest 2.5 source [file join [file dirname [info script]] tcltests.tcl] ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Some tests require the testthread command testConstraint testthread [expr {[info commands testthread] ne {}}] set threadSuperKillScript { rename catch "" rename while "" rename unknown "" rename update "" thread::release } proc getThreadErrorFromInfo { info } { set list [split $info \n] set idx [lsearch -glob $list "*eval*unwound*"] if {$idx >= 0} then { return [lindex $list $idx] } set idx [lsearch -glob $list "*eval*canceled*"] if {$idx >= 0} then { return [lindex $list $idx] } return ""; # some other error we do not care about. } proc findThreadError { info } { foreach error [lreverse $info] { set error [getThreadErrorFromInfo $error] if {[string length $error] > 0} then { return $error } } return ""; # some other error we do not care about. } proc ThreadError {id info} { global threadSawError if {[string length [getThreadErrorFromInfo $info]] > 0} then { global threadId threadError set threadId $id lappend threadError($id) $info } set threadSawError($id) true; # signal main thread to exit [vwait]. } proc threadSuperKill id { variable threadSuperKillScript try { thread::send $id $::threadSuperKillScript } on error {tres topts} { if {$tres ne {target thread died}} { return -options $topts $tres } } } if {[testConstraint thread]} { thread::errorproc ThreadError } if {[testConstraint testthread]} { proc drainEventQueue {} { while {[set x [testthread event]]} { #puts "WARNING: drained $x event(s) on main thread" } } testthread errorproc ThreadError } # Some tests require manual draining of the event queue testConstraint drainEventQueue [expr {[info commands drainEventQueue] != {}}] test thread-1.3 {Tcl_ThreadObjCmd: initial thread list} {thread} { llength [thread::names] } 1 test thread-1.4 {Tcl_ThreadObjCmd: thread create } {thread} { set serverthread [thread::create -preserved] set numthreads [llength [thread::names]] thread::release -wait $serverthread set numthreads } 2 test thread-1.5 {Tcl_ThreadObjCmd: thread create one shot} {thread} { thread::create {set x 5} foreach try {0 1 2 4 5 6} { # Try various ways to yield update after 10 set l [llength [thread::names]] if {$l == 1} { break } } set l } 1 test thread-1.6 {Tcl_ThreadObjCmd: thread exit} {thread} { thread::create {{*}{}} update after 10 llength [thread::names] } {1} test thread-1.13 {Tcl_ThreadObjCmd: send args} {thread} { set serverthread [thread::create -preserved] set five [thread::send $serverthread {set x 5}] thread::release -wait $serverthread set five } 5 test thread-1.15 {Tcl_ThreadObjCmd: wait} {thread} { set serverthread [thread::create -preserved {set z 5 ; thread::wait}] set five [thread::send $serverthread {set z}] thread::release -wait $serverthread set five } 5 # The tests above also cover: # TclCreateThread, except when pthread_create fails # NewThread, safe and regular # ThreadErrorProc, except for printing to standard error test thread-2.1 {ListUpdateInner and ListRemove} {thread} { catch {unset tid} foreach t {0 1 2} { upvar #0 t$t tid set tid [thread::create -preserved] } foreach t {0 1 2} { upvar #0 t$t tid thread::release $tid } llength [thread::names] } 1 test thread-3.1 {TclThreadList} {thread} { catch {unset tid} set len [llength [thread::names]] set l1 {} foreach t {0 1 2} { lappend l1 [thread::create -preserved] } set l2 [thread::names] set c [string compare [lsort [concat [thread::id] $l1]] [lsort $l2]] foreach t $l1 { thread::release -wait $t } list $len $c } {1 0} test thread-4.1 {TclThreadSend to self} {thread} { catch {unset x} thread::send [thread::id] { set x 4 } set x } {4} test thread-4.2 {TclThreadSend -async} {thread} { set len [llength [thread::names]] set serverthread [thread::create -preserved] thread::send -async $serverthread { after 1 {thread::release} } set two [llength [thread::names]] after 100 {set done 1} vwait done list $len [llength [thread::names]] $two } {1 1 2} test thread-4.3 {TclThreadSend preserve errorInfo} {thread} { set len [llength [thread::names]] set serverthread [thread::create -preserved] set x [catch {thread::send $serverthread {set undef}} msg] set savedErrorInfo $::errorInfo thread::release $serverthread list $len $x $msg $savedErrorInfo } {1 1 {can't read "undef": no such variable} {can't read "undef": no such variable while executing "set undef" invoked from within "thread::send $serverthread {set undef}"}} test thread-4.4 {TclThreadSend preserve code} {thread} { set len [llength [thread::names]] set serverthread [thread::create -preserved] set ::errorInfo {} set x [catch {thread::send $serverthread {set ::errorInfo {}; break}} msg] set savedErrorInfo $::errorInfo thread::release $serverthread list $len $x $msg $savedErrorInfo } {1 3 {} {}} test thread-4.5 {TclThreadSend preserve errorCode} {thread} { set serverthread [thread::create] set x [catch {thread::send $serverthread {error ERR INFO CODE}} msg] set savedErrorCode $::errorCode thread::release $serverthread list $x $msg $savedErrorCode } {1 ERR CODE} test thread-5.0 {Joining threads} {thread} { set serverthread [thread::create -joinable -preserved] thread::send -async $serverthread {after 1000 ; thread::release} thread::join $serverthread } {0} test thread-5.1 {Joining threads after the fact} {thread} { set serverthread [thread::create -joinable -preserved] thread::send -async $serverthread {thread::release} after 2000 thread::join $serverthread } {0} test thread-5.2 {Try to join a detached thread} {thread} { set serverthread [thread::create -preserved] thread::send -async $serverthread {after 1000 ; thread::release} catch {set res [thread::join $serverthread]} msg while {[llength [thread::names]] > 1} { after 20 } lrange $msg 0 2 } {cannot join thread} test thread-6.1 {freeing very large object trees in a thread} thread { # conceptual duplicate of obj-32.1 set serverthread [thread::create -preserved] thread::send -async $serverthread { set x {} for {set i 0} {$i<100000} {incr i} { set x [list $x {}] } unset x } thread::release -wait $serverthread } 0 # TIP #285: Script cancellation support test thread-7.4 {cancel: pure bytecode loop} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.5 {cancel: pure inside-command loop} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } set while while $while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.6 {cancel: pure bytecode loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.7 {cancel: pure inside-command loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } set while while $while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.8 {cancel: pure bytecode loop custom result} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread "the eval was canceled"] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {the eval was canceled}} test thread-7.9 {cancel: pure inside-command loop custom result} -constraints { thread drainEventQueue } -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } set while while $while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread "the eval was canceled"] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {the eval was canceled}} test thread-7.10 {cancel: pure bytecode loop custom result -unwind} -constraints { thread drainEventQueue } -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread "the eval was unwound"] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {the eval was unwound}} test thread-7.11 {cancel: pure inside-command loop custom result -unwind} -constraints { thread drainEventQueue } -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } set while while $while {1} { # No bytecode at all here... } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread "the eval was unwound"] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {the eval was unwound}} test thread-7.12 {cancel: after} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } after 30000 }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.13 {cancel: after -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } after 30000 }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.14 {cancel: vwait} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } vwait forever }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.15 {cancel: vwait -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } vwait forever }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.16 {cancel: expr} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } expr {[while {1} {incr x}]} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.17 {cancel: expr -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } expr {[while {1} {incr x}]} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.18 {cancel: expr bignum} {thread drainEventQueue knownBug} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } # # BUGBUG: This will not cancel because libtommath # does not check Tcl_Canceled. # expr {2**99999} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread); # WARNING: Never returns (see above). thread::join $serverthread; drainEventQueue; # WARNING: Never returns (see above). list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 0 {}} test thread-7.19 {cancel: expr bignum -unwind} {thread drainEventQueue knownBug} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } # # BUGBUG: This will not cancel because libtommath # does not check Tcl_Canceled. # expr {2**99999} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread); # WARNING: Never returns (see above). thread::join $serverthread; drainEventQueue; # WARNING: Never returns (see above). list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 0 {}} test thread-7.20 {cancel: subst} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } subst {[while {1} {incr x}]} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.21 {cancel: subst -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } subst {[while {1} {incr x}]} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.22 {cancel: child interp} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } while {1} {} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.23 {cancel: child interp -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create] $i eval "package require -exact Thread [package present Thread]" $i eval { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } set while while; $while {1} {} } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.24 {cancel: nested catch inside pure bytecode loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::cancel $serverthread] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 0 {}} test thread-7.25 {cancel: nested catch inside pure inside-command loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::cancel $serverthread] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 0 {}} test thread-7.26 {cancel: send async cancel bad interp path} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } update } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted catch {thread::send $serverthread {interp cancel -- bad}} msg thread::send -async $serverthread {interp cancel -unwind} vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list [expr {$::threadIdStarted == $serverthread}] $msg } {1 {could not find interpreter "bad"}} test thread-7.27 {cancel: send async cancel -- switch} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { set i [interp create -- -unwind] $i eval "package require -exact Thread [package present Thread]" $i eval { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } update } } foobar } }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::send -async $serverthread {interp cancel -- -unwind}] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval canceled}} test thread-7.28 {cancel: send async cancel nested catch inside pure bytecode loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::send -async $serverthread {interp cancel}] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 1 {eval canceled}} test thread-7.29 {cancel: send async cancel nested catch pure inside-command loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::send -async $serverthread {interp cancel}] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 1 {eval canceled}} test thread-7.30 {cancel: send async thread cancel nested catch inside pure bytecode loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::send -async $serverthread {thread::cancel [thread::id]}] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 1 {eval canceled}} test thread-7.31 {cancel: send async thread cancel nested catch pure inside-command loop} {thread drainEventQueue} { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted; after 1000 set res [thread::send -async $serverthread {thread::cancel [thread::id]}] threadSuperKill $serverthread vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {[info exists ::threadIdStarted] ? \ $::threadIdStarted == $serverthread : 0}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } {{} 1 1 {eval canceled}} test thread-7.32 {cancel: nested catch inside pure bytecode loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # No bytecode at all here... } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.33 {cancel: nested catch inside pure inside-command loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # No bytecode at all here... } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::cancel -unwind $serverthread] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.34 {cancel: send async cancel nested catch inside pure bytecode loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::send -async $serverthread {interp cancel -unwind}] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.35 {cancel: send async cancel nested catch inside pure inside-command loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::send -async $serverthread {interp cancel -unwind}] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.36 {cancel: send async thread cancel nested catch inside pure bytecode loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } catch { while {1} { catch { while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::send -async $serverthread {thread::cancel -unwind [thread::id]}] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-7.37 {cancel: send async thread cancel nested catch inside pure inside-command loop -unwind} -constraints {thread drainEventQueue} -setup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -body { set serverthread [thread::create -joinable \ [string map [list %ID% [thread::id]] { proc foobar {} { set catch catch set while while $while {1} { if {![info exists foo]} then { # signal the primary thread that we are ready # to be canceled now (we are running). thread::send %ID% [list set ::threadIdStarted [thread::id]] set foo 1 } $catch { $while {1} { $catch { $while {1} { # we must call update here because otherwise # the thread cannot even be forced to exit. update } } } } } } foobar }]] # wait for other thread to signal "ready to cancel" vwait ::threadIdStarted set res [thread::send -async $serverthread {thread::cancel -unwind [thread::id]}] vwait ::threadSawError($serverthread) thread::join $serverthread; drainEventQueue list $res [expr {$::threadIdStarted == $serverthread}] \ [expr {[info exists ::threadId] ? \ $::threadId == $serverthread : 0}] \ [expr {[info exists ::threadError($serverthread)] ? \ [findThreadError $::threadError($serverthread)] : ""}] } -cleanup { unset -nocomplain ::threadSawError ::threadError ::threadId ::threadIdStarted } -result {{} 1 1 {eval unwound}} test thread-8.1 {threaded fork stress} -constraints {thread} -setup { unset -nocomplain ::threadCount ::execCount ::threads ::thread set ::threadCount 10 set ::execCount 10 } -body { set ::threads [list] for {set i 0} {$i < $::threadCount} {incr i} { lappend ::threads [thread::create -joinable [string map \ [list %execCount% $::execCount] { proc execLs {} { if {$::tcl_platform(platform) eq "windows"} then { return [exec $::env(COMSPEC) /c DIR] } else { return [exec /bin/ls] } } set j {%execCount%}; while {[incr j -1]} {execLs} }]] } foreach ::thread $::threads { thread::join $::thread } } -cleanup { unset -nocomplain ::threadCount ::execCount ::threads ::thread } -result {} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/tcltests.tcl0000644000175000017500000001026715104661341015270 0ustar sergeisergei#! /usr/bin/env tclsh # Don't overwrite tcltests facilities already present if {[package provide tcltests] ne {}} return package require tcltest 2.5 namespace import ::tcltest::* testConstraint exec [llength [info commands exec]] testConstraint deprecated [expr {![tcl::build-info no-deprecate]}] testConstraint debug [tcl::build-info debug] testConstraint purify [tcl::build-info purify] testConstraint debugpurify [ expr { ![tcl::build-info memdebug] && [testConstraint debug] && [testConstraint purify] }] testConstraint bigmem [expr {[ info exists ::env(TCL_TESTCONSTRAINT_BIGMEM)] ? !!$::env(TCL_TESTCONSTRAINT_BIGMEM) : 1 }] testConstraint fcopy [llength [info commands fcopy]] testConstraint fileevent [llength [info commands fileevent]] testConstraint thread [expr {![catch {package require Thread 2.7-}]}] testConstraint notValgrind [expr {![testConstraint valgrind]}] namespace eval ::tcltests { proc init {} { if {[namespace which ::tcl::file::tempdir] eq {}} { interp alias {} [namespace current]::tempdir {} [ namespace current]::tempdir_alternate } else { interp alias {} [namespace current]::tempdir {} ::tcl::file::tempdir } } # Stolen from dict.test proc scriptmemcheck script { set end [lindex [split [memory info] \n] 3 3] for {set i 0} {$i < 5} {incr i} { uplevel 1 $script set tmp $end set end [lindex [split [memory info] \n] 3 3] } expr {$end - $tmp} } proc tempdir_alternate {} { close [file tempfile tempfile] set tmpdir [file dirname $tempfile] set execname [info nameofexecutable] regsub -all {[^[:alpha:][:digit:]]} $execname _ execname for {set i 0} {$i < 10000} {incr i} { set time [clock milliseconds] set name $tmpdir/${execname}_${time}_$i if {![file exists $name]} { file mkdir $name return $name } } error [list {could not create temporary directory}] } # Generates test cases for 0, min and max number of arguments for a command. # Expected result is as generated by Tcl_WrongNumArgs # Only works if optional arguments come after fixed arguments # E.g. # testnumargs "zipfs mount" "" "?mountpoint? ?zipfile? ?password?" # testnumargs "lappend" "varName" "?value ...?" proc testnumargs {cmd {fixed {}} {optional {}} args} { variable count set minargs [llength $fixed] set maxargs [expr {$minargs + [llength $optional]}] if {[regexp {\.\.\.\??$} [lindex $optional end]]} { unset maxargs; # No upper limit on num of args } set message "wrong # args: should be \"$cmd" if {[llength $fixed]} { append message " $fixed" } if {[llength $optional]} { append message " $optional" } if {[llength $fixed] == 0 && [llength $optional] == 0} { append message " \"" } else { append message "\"" } set label [join $cmd -] if {$minargs > 0} { set arguments [lrepeat [expr {$minargs-1}] x] test $label-minargs-[incr count($label-minargs)] \ "$label no arguments" \ -body "$cmd" \ -result $message -returnCodes error \ {*}$args if {$minargs > 1} { test $label-minargs-[incr count($label-minargs)] \ "$label missing arguments" \ -body "$cmd $arguments" \ -result $message -returnCodes error \ {*}$args } } if {[info exists maxargs]} { set arguments [lrepeat [expr {$maxargs+1}] x] test $label-maxargs-[incr count($label-maxargs)] \ "$label extra arguments" \ -body "$cmd $arguments" \ -result $message -returnCodes error \ {*}$args } # Return Windows version as FULLVERSION MAJOR MINOR BUILD REVISION if {$::tcl_platform(platform) eq "windows"} { proc windowsversion {} { set ver [regexp -inline {(\d+).(\d+).(\d+).(\d+)} [exec {*}[auto_execok ver]]] proc windowsversion {} [list return $ver] return [windowsversion] } proc windowsbuildnumber {} { return [lindex [windowsversion] 3] } proc windowscodepage {} { # Note we cannot use result of chcp because that returns OEM code page. package require registry set cp [registry get HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage ACP] proc windowscodepage {} "return cp$cp" return [windowscodepage] } } } init package provide tcltests 0.1 } tcl9.0.3/tests/tcltest.test0000644000175000017500000014454515104661341015311 0ustar sergeisergei# This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2000 Ajuba Solutions # All rights reserved. # Note that there are several places where the value of # tcltest::currentFailure is stored/reset in the -setup/-cleanup # of a test that has a body that runs [test] that will fail. # This is a workaround of using the same tcltest code that we are # testing to run the test itself. Ditto on things like [verbose]. # # It would be better to have the -body of the tests run the tcltest # commands in a child interp so the [test] being tested would not # interfere with the [test] doing the testing. # if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] namespace eval ::tcltest::test { namespace import ::tcltest::* makeFile { package require tcltest 2.5 namespace import ::tcltest::test test a-1.0 {test a} { list 0 } {0} test b-1.0 {test b} { list 1 } {0} test c-1.0 {test c} {knownBug} { } {} test d-1.0 {test d} { error "foo" foo 9 } {} tcltest::cleanupTests exit } test.tcl cd [temporaryDirectory] testConstraint exec [llength [info commands exec]] # test -help # Child processes because -help [exit]s. test tcltest-1.1 {tcltest -help} {exec} { set result [catch {exec [interpreter] test.tcl -help} msg] list $result [regexp Usage $msg] } {1 1} test tcltest-1.2 {tcltest -help -something} {exec} { set result [catch {exec [interpreter] test.tcl -help -something} msg] list $result [regexp Usage $msg] } {1 1} test tcltest-1.3 {tcltest -h} {exec} { set result [catch {exec [interpreter] test.tcl -h} msg] list $result [regexp Usage $msg] } {1 0} # -verbose, implicit & explicit testing of [verbose] proc child {msgVar args} { upvar 1 $msgVar msg interp create [namespace current]::i # Fake the child interp into dumping output to a file i eval {namespace eval ::tcltest {}} i eval "set tcltest::outputChannel\ \[[list open [set of [makeFile {} output]] w]]" i eval "set tcltest::errorChannel\ \[[list open [set ef [makeFile {} error]] w]]" i eval [list set argv0 [lindex $args 0]] i eval [list set argv [lrange $args 1 end]] i eval [list package ifneeded tcltest [package provide tcltest] \ [package ifneeded tcltest [package provide tcltest]]] i eval {proc exit args {}} # Need to capture output in msg set code [catch {i eval {source $argv0}}] i eval {close $tcltest::outputChannel} interp delete [namespace current]::i set f [open $of] set msg [read -nonewline $f] close $f set f [open $ef] set err [read -nonewline $f] close $f removeFile output removeFile error if {[string length $err]} { set code 1 append msg \n$err } return $code } test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrWin} { set result [child msg test.tcl] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 0 0 1} test tcltest-2.1 {tcltest -verbose 'b'} {unixOrWin} { set result [child msg test.tcl -verbose 'b'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 0 0 1} test tcltest-2.2 {tcltest -verbose 'p'} {unixOrWin} { set result [child msg test.tcl -verbose 'p'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 1 0 1} test tcltest-2.3 {tcltest -verbose 's'} {unixOrWin} { set result [child msg test.tcl -verbose 's'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 0 1 1} test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrWin} { set result [child msg test.tcl -verbose 'ps'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 1 1 1} test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrWin} { set result [child msg test.tcl -verbose 'psb'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 1 1 1} test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrWin} { set result [child msg test.tcl -verbose "pass skip body"] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 1 1 1} test tcltest-2.6 {tcltest -verbose 't'} { -constraints {unixOrWin} -body { set result [child msg test.tcl -verbose 't'] list $result $msg } -result {^0 .*a-1.0 start.*b-1.0 start} -match regexp } test tcltest-2.6a {tcltest -verbose 'start'} { -constraints {unixOrWin} -body { set result [child msg test.tcl -verbose start] list $result $msg } -result {^0 .*a-1.0 start.*b-1.0 start} -match regexp } test tcltest-2.7 {tcltest::verbose} { -body { set oldVerbosity [verbose] verbose bar set currentVerbosity [verbose] verbose foo set newVerbosity [verbose] verbose $oldVerbosity list $currentVerbosity $newVerbosity } -result {body {}} } test tcltest-2.8 {tcltest -verbose 'error'} { -constraints {unixOrWin} -body { set result [child msg test.tcl -verbose error] list $result $msg } -result {errorInfo: foo.*errorCode: 9} -match regexp } # -match, [match] test tcltest-3.1 {tcltest -match 'a*'} {unixOrWin} { set result [child msg test.tcl -match a* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] } {0 1 0 0 1} test tcltest-3.2 {tcltest -match 'b*'} {unixOrWin} { set result [child msg test.tcl -match b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg] } {0 0 1 0 1} test tcltest-3.3 {tcltest -match 'c*'} {unixOrWin} { set result [child msg test.tcl -match c* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+4.+Failed.+0" $msg] } {0 0 0 1 1} test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrWin} { set result [child msg test.tcl -match {a* b*} -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg] } {0 1 1 0 1} test tcltest-3.5 {tcltest::match} { -body { set oldMatch [match] match foo set currentMatch [match] match bar set newMatch [match] match $oldMatch list $currentMatch $newMatch } -result {foo bar} } # -skip, [skip] test tcltest-4.1 {tcltest -skip 'a*'} {unixOrWin} { set result [child msg test.tcl -skip a* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+2.+Failed.+1" $msg] } {0 0 1 1 1} test tcltest-4.2 {tcltest -skip 'b*'} {unixOrWin} { set result [child msg test.tcl -skip b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg] } {0 1 0 1 1} test tcltest-4.3 {tcltest -skip 'c*'} {unixOrWin} { set result [child msg test.tcl -skip c* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 1 0 1} test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrWin} { set result [child msg test.tcl -skip {a* b*} -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg] } {0 0 0 1 1} test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrWin} { set result [child msg test.tcl -match {a* b*} -skip b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] } {0 1 0 0 1} test tcltest-4.6 {tcltest::skip} { -body { set oldSkip [skip] skip foo set currentSkip [skip] skip bar set newSkip [skip] skip $oldSkip list $currentSkip $newSkip } -result {foo bar} } # -constraints, -limitconstraints, [testConstraint], # $constraintsSpecified, [limitConstraints] test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrWin} { set result [child msg test.tcl -constraints knownBug -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+2.+Skipped.+0.+Failed.+2" $msg] } {0 1 1 1 1} test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrWin} { set result [child msg test.tcl -constraints knownBug -verbose 'p' -limitconstraints 1] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] } {0 0 0 1 1} test tcltest-5.3 {testConstraint - constraint empty (tcltest::safeFetch)} { -body { set r1 [testConstraint tcltestFakeConstraint] set r2 [testConstraint tcltestFakeConstraint 4] set r3 [testConstraint tcltestFakeConstraint] list $r1 $r2 $r3 } -result {0 4 4} -cleanup {unset ::tcltest::testConstraints(tcltestFakeConstraint)} } # Removed this test of internals of tcltest. Those internals have changed. #test tcltest-5.4 {tcltest::constraintsSpecified} { # -setup { # set constraintlist $::tcltest::constraintsSpecified # set ::tcltest::constraintsSpecified {} # } # -body { # set r1 $::tcltest::constraintsSpecified # testConstraint tcltestFakeConstraint1 1 # set r2 $::tcltest::constraintsSpecified # testConstraint tcltestFakeConstraint2 1 # set r3 $::tcltest::constraintsSpecified # list $r1 $r2 $r3 # } # -result {{} tcltestFakeConstraint1 {tcltestFakeConstraint1 tcltestFakeConstraint2}} # -cleanup { # set ::tcltest::constraintsSpecified $constraintlist # unset ::tcltest::testConstraints(tcltestFakeConstraint1) # unset ::tcltest::testConstraints(tcltestFakeConstraint2) # } #} test tcltest-5.5 {InitConstraints: list of built-in constraints} \ -constraints {!singleTestInterp notWsl} \ -setup {tcltest::InitConstraints} \ -body { lsort [array names ::tcltest::testConstraints] } \ -result [lsort { 95 98 asyncPipeClose eformat emptyTest exec hasIsoLocale interactive knownBug mac macCrash macOnly macOrPc macOrUnix macOrWin nonBlockFiles nonPortable notRoot nt pc pcCrash pcOnly root singleTestInterp socket stdio tempNotMac tempNotPc tempNotUnix tempNotWin unix unixCrash unixExecs unixOnly unixOrPc unixOrWin userInteraction win winCrash winOnly }] # Removed this broken test. Its usage of [limitConstraints] was not # in agreement with the documentation. [limitConstraints] is supposed # to take an optional boolean argument, and "knownBug" ain't no boolean! #test tcltest-5.6 {tcltest::limitConstraints} { # -setup { # set keeplc $::tcltest::limitConstraints # set keepkb [testConstraint knownBug] # } # -body { # set r1 [limitConstraints] # set r2 [limitConstraints knownBug] # set r3 [limitConstraints] # list $r1 $r2 $r3 # } # -cleanup { # limitConstraints $keeplc # testConstraint knownBug $keepkb # } # -result {false knownBug knownBug} #} # -outfile, -errfile, [outputChannel], [outputFile], [errorChannel], [errorFile] set printerror [makeFile { package require tcltest 2.5 namespace import ::tcltest::* puts [outputChannel] "a test" ::tcltest::PrintError "a really short string" ::tcltest::PrintError "a really really really really really really long \ string containing \"quotes\" and other bad bad stuff" ::tcltest::PrintError "a really really long string containing a \ \"Path/that/is/really/long/and/contains/no/spaces\"" ::tcltest::PrintError "a really really long string containing a \ \"Really/Long/Path/that/contains/no/spaces/and/is/longer/than/eighty/characters/to/see/what/happens\"" ::tcltest::PrintError "Problem renaming file: error renaming \"Z:/ws/tcl9.0/win32-ix86/tests/core\" to \"Z:/ws/tcl9.0/win32-ix86/tests/movecore-core\"" exit } printerror.tcl] test tcltest-6.1 {tcltest -outfile, -errfile defaults} { -constraints unixOrWin -body { child msg $printerror return $msg } -result {a test.*a really} -match regexp } test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrWin unixExecs} { child msg $printerror -outfile a.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" a.tmp}] list [regexp "a test" $msg] [regexp "a really" $msg] \ $result1 $result2 [file exists a.tmp] [file delete a.tmp] } {0 1 0 1 1 {}} test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrWin unixExecs} { child msg $printerror -errfile a.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" a.tmp}] list [regexp "a test" $msg] [regexp "a really" $msg] \ $result1 $result2 [file exists a.tmp] [file delete a.tmp] } {1 0 1 0 1 {}} test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrWin unixExecs} { child msg $printerror -outfile a.tmp -errfile b.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" b.tmp}] list [regexp "a test" $msg] [regexp "a really" $msg] \ $result1 $result2 \ [file exists a.tmp] [file delete a.tmp] \ [file exists b.tmp] [file delete b.tmp] } {0 0 0 0 1 {} 1 {}} test tcltest-6.5 {tcltest::errorChannel - retrieval} { -setup { set of [errorChannel] set ::tcltest::errorChannel stderr } -body { errorChannel } -result {stderr} -cleanup { set ::tcltest::errorChannel $of } } test tcltest-6.6 {tcltest::errorFile (implicit errorChannel)} { -setup { set ef [makeFile {} efile] set of [errorFile] set ::tcltest::errorChannel stderr set ::tcltest::errorFile stderr } -body { set f0 [errorChannel] set f1 [errorFile] set f2 [errorFile $ef] set f3 [errorChannel] set f4 [errorFile] subst {$f0;$f1;$f2;$f3;$f4} } -result {stderr;stderr;.*efile;file[0-9a-f]+;.*efile} -match regexp -cleanup { errorFile $of removeFile efile } } test tcltest-6.7 {tcltest::outputChannel - retrieval} { -setup { set of [outputChannel] set ::tcltest::outputChannel stdout } -body { outputChannel } -result {stdout} -cleanup { set ::tcltest::outputChannel $of } } test tcltest-6.8 {tcltest::outputFile (implicit outputFile)} { -setup { set ef [makeFile {} efile] set of [outputFile] set ::tcltest::outputChannel stdout set ::tcltest::outputFile stdout } -body { set f0 [outputChannel] set f1 [outputFile] set f2 [outputFile $ef] set f3 [outputChannel] set f4 [outputFile] subst {$f0;$f1;$f2;$f3;$f4} } -result {stdout;stdout;.*efile;file[0-9a-f]+;.*efile} -match regexp -cleanup { outputFile $of removeFile efile } } # -debug, [debug] # Must use child processes to test -debug because it always writes # messages to stdout, and we have no way to capture stdout of a # child interp test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 0} msg regexp "Flags passed into tcltest" $msg } {0} test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 1 -skip b*} msg list [regexp userSpecifiedSkip $msg] \ [regexp "Flags passed into tcltest" $msg] } {1 0} test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 1 -match b*} msg list [regexp userSpecifiedNonMatch $msg] \ [regexp "Flags passed into tcltest" $msg] } {1 0} test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 2} msg list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg] } {1 0} test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 3} msg list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg] } {1 1} test tcltest-7.6 {tcltest::debug} { -setup { set old $::tcltest::debug set ::tcltest::debug 0 } -body { set f1 [debug] set f2 [debug 1] set f3 [debug] set f4 [debug 2] set f5 [debug] list $f1 $f2 $f3 $f4 $f5 } -result {0 1 1 2 2} -cleanup { set ::tcltest::debug $old } } removeFile test.tcl # directory tests set a [makeFile { package require tcltest 2.5 tcltest::makeFile {} a.tmp puts [tcltest::outputChannel] "testdir: [tcltest::testsDirectory]" exit } a.tcl] set tdiaf [makeFile {} thisdirectoryisafile] set normaldirectory [makeDirectory normaldirectory] normalizePath normaldirectory # -tmpdir, [temporaryDirectory] test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrWin -setup { file delete -force thisdirectorydoesnotexist } -body { child msg $a -tmpdir thisdirectorydoesnotexist file exists [file join thisdirectorydoesnotexist a.tmp] } -cleanup { file delete -force thisdirectorydoesnotexist } -result 1 test tcltest-8.2 {tcltest a.tcl -tmpdir thisdirectoryisafile} { -constraints unixOrWin -body { child msg $a -tmpdir $tdiaf return $msg } -result {*not a directory*} -match glob } # Test non-writable directories, non-readable directories with directory flags set notReadableDir [file join [temporaryDirectory] notreadable] set notWritableDir [file join [temporaryDirectory] notwritable] makeDirectory notreadable makeDirectory notwritable switch -- $::tcl_platform(platform) { unix { file attributes $notReadableDir -permissions 0o333 file attributes $notWritableDir -permissions 0o555 } default { # note in FAT/NTFS we won't be able to protect directory with read-only attribute... catch {file attributes $notWritableDir -readonly 1} catch {testchmod 0o444 $notWritableDir} } } test tcltest-8.3 {tcltest a.tcl -tmpdir notReadableDir} { -constraints {unix notRoot notWsl} -body { child msg $a -tmpdir $notReadableDir return $msg } -result {*not readable*} -match glob } # This constraint doesn't go at the top of the file so that it doesn't # interfere with tcltest-5.5 testConstraint notFAT [expr { ![regexp {^(FAT\d*|NTFS)$} [lindex [file system $notWritableDir] 1]] || $::tcl_platform(platform) eq "unix" || [llength [info commands testchmod]] }] # FAT/NTFS permissions are fairly hopeless; ignore this test if that FS is used test tcltest-8.4 {tcltest a.tcl -tmpdir notWritableDir} { -constraints {unixOrWin notRoot notFAT notWsl} -body { child msg $a -tmpdir $notWritableDir return $msg } -result {*not writable*} -match glob } test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} { -constraints unixOrWin -body { child msg $a -tmpdir $normaldirectory # The join is necessary because the message can be split on multiple # lines file exists [file join $normaldirectory a.tmp] } -cleanup { catch {file delete [file join $normaldirectory a.tmp]} } -result 1 } cd [workingDirectory] test tcltest-8.6 {temporaryDirectory} { -setup { set old $::tcltest::temporaryDirectory set ::tcltest::temporaryDirectory $normaldirectory } -body { set f1 [temporaryDirectory] set f2 [temporaryDirectory [workingDirectory]] set f3 [temporaryDirectory] list $f1 $f2 $f3 } -result "[list $normaldirectory [workingDirectory] [workingDirectory]]" -cleanup { set ::tcltest::temporaryDirectory $old } } test tcltest-8.6a {temporaryDirectory - test format 2} -setup { set old $::tcltest::temporaryDirectory set ::tcltest::temporaryDirectory $normaldirectory } -body { set f1 [temporaryDirectory] set f2 [temporaryDirectory [workingDirectory]] set f3 [temporaryDirectory] list $f1 $f2 $f3 } -cleanup { set ::tcltest::temporaryDirectory $old } -result [list $normaldirectory [workingDirectory] [workingDirectory]] cd [temporaryDirectory] # -testdir, [testsDirectory] test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} { -constraints unixOrWin -setup { file delete -force thisdirectorydoesnotexist } -body { child msg $a -testdir thisdirectorydoesnotexist return $msg } -match glob -result {*does not exist*} } test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} { -constraints unixOrWin -body { child msg $a -testdir $tdiaf return $msg } -match glob -result {*not a directory*} } test tcltest-8.12 {tcltest a.tcl -testdir notReadableDir} { -constraints {unix notRoot notWsl} -body { child msg $a -testdir $notReadableDir return $msg } -match glob -result {*not readable*} } test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} { -constraints unixOrWin -body { child msg $a -testdir $normaldirectory # The join is necessary because the message can be split on multiple # lines list [string first "testdir: $normaldirectory" [join $msg]] \ [file exists [file join [temporaryDirectory] a.tmp]] } -cleanup { file delete [file join [temporaryDirectory] a.tmp] } -result {0 1} } cd [workingDirectory] set current [pwd] test tcltest-8.14 {testsDirectory} { -setup { set old $::tcltest::testsDirectory set ::tcltest::testsDirectory $normaldirectory } -body { set f1 [testsDirectory] set f2 [testsDirectory $current] set f3 [testsDirectory] list $f1 $f2 $f3 } -result "[list $normaldirectory $current $current]" -cleanup { set ::tcltest::testsDirectory $old } } # [workingDirectory] test tcltest-8.60 {::workingDirectory} { -setup { set old $::tcltest::workingDirectory set current [pwd] set ::tcltest::workingDirectory $normaldirectory cd $normaldirectory } -body { set f1 [workingDirectory] set f2 [pwd] set f3 [workingDirectory $current] set f4 [pwd] set f5 [workingDirectory] list $f1 $f2 $f3 $f4 $f5 } -result "[list $normaldirectory \ $normaldirectory \ $current \ $current \ $current]" -cleanup { set ::tcltest::workingDirectory $old cd $current } } # clean up from directory testing switch -- $::tcl_platform(platform) { unix { file attributes $notReadableDir -permissions 0o777 file attributes $notWritableDir -permissions 0o777 } default { catch {testchmod 0o777 $notWritableDir} catch {file attributes $notWritableDir -readonly 0} } } file delete -force -- $notReadableDir $notWritableDir removeFile a.tcl removeFile thisdirectoryisafile removeDirectory normaldirectory # -file, -notfile, [matchFiles], [skipFiles] test tcltest-9.1 {-file d*.tcl} -constraints {unixOrWin} -setup { set old [testsDirectory] testsDirectory [file dirname [info script]] } -body { child msg [file join [testsDirectory] all.tcl] -file d*.test return $msg } -cleanup { testsDirectory $old } -match regexp -result {dstring\.test} test tcltest-9.2 {-file d*.tcl} -constraints {unixOrWin} -setup { set old [testsDirectory] testsDirectory [file dirname [info script]] } -body { child msg [file join [testsDirectory] all.tcl] \ -file d*.test -notfile dstring* regexp {dstring\.test} $msg } -cleanup { testsDirectory $old } -result 0 test tcltest-9.3 {matchFiles} { -body { set old [matchFiles] matchFiles foo set current [matchFiles] matchFiles bar set new [matchFiles] matchFiles $old list $current $new } -result {foo bar} } test tcltest-9.4 {skipFiles} { -body { set old [skipFiles] skipFiles foo set current [skipFiles] skipFiles bar set new [skipFiles] skipFiles $old list $current $new } -result {foo bar} } test tcltest-9.5 {GetMatchingFiles: Bug 1119798} -setup { set d [makeDirectory tmp] makeDirectory foo $d makeFile {} fee $d file copy [file join [file dirname [info script]] all.tcl] $d } -body { child msg [file join [temporaryDirectory] all.tcl] -file f* regexp {exiting with errors:} $msg } -cleanup { file delete [file join $d all.tcl] removeFile fee $d removeDirectory foo $d removeDirectory tmp } -result 0 # -preservecore, [preserveCore] set mc [makeFile { package require tcltest 2.5 namespace import ::tcltest::test test makecore {make a core file} { set f [open core w] close $f } {} ::tcltest::cleanupTests return } makecore.tcl] cd [temporaryDirectory] test tcltest-10.1 {-preservecore 0} {unixOrWin} { child msg $mc -preservecore 0 file delete core regexp "Core file produced" $msg } {0} test tcltest-10.2 {-preservecore 1} {unixOrWin} { child msg $mc -preservecore 1 file delete core regexp "Core file produced" $msg } {1} test tcltest-10.3 {-preservecore 2} {unixOrWin} { child msg $mc -preservecore 2 file delete core list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \ [regexp "core-" $msg] [file delete core-makecore] } {1 1 1 {}} test tcltest-10.4 {-preservecore 3} {unixOrWin} { child msg $mc -preservecore 3 file delete core list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \ [regexp "core-" $msg] [file delete core-makecore] } {1 1 1 {}} # Removing this test. It makes no sense to test the ability of # [preserveCore] to accept an invalid value that will cause errors # in other parts of tcltest's operation. #test tcltest-10.5 {preserveCore} { # -body { # set old [preserveCore] # set result [preserveCore foo] # set result2 [preserveCore] # preserveCore $old # list $result $result2 # } # -result {foo foo} #} removeFile makecore.tcl # -load, -loadfile, [loadScript], [loadFile] set contents { package require tcltest 2.5 namespace import tcltest::* puts [outputChannel] $::tcltest::loadScript exit } set loadfile [makeFile $contents load.tcl] test tcltest-12.1 {-load xxx} {unixOrWin} { child msg $loadfile -load xxx return $msg } {xxx} # Using child process because of -debug usage. test tcltest-12.2 {-loadfile load.tcl} {unixOrWin} { catch {exec [interpreter] $loadfile -debug 2 -loadfile $loadfile} msg list \ [regexp {tcltest} [join [list $msg] [split $msg \n]]] \ [regexp {loadScript} [join [list $msg] [split $msg \n]]] } {1 1} test tcltest-12.3 {loadScript} { -setup { set old $::tcltest::loadScript set ::tcltest::loadScript {} } -body { set f1 [loadScript] set f2 [loadScript xxx] set f3 [loadScript] list $f1 $f2 $f3 } -result {{} xxx xxx} -cleanup { set ::tcltest::loadScript $old } } test tcltest-12.4 {loadFile} { -setup { set olds $::tcltest::loadScript set ::tcltest::loadScript {} set oldf $::tcltest::loadFile set ::tcltest::loadFile {} } -body { set f1 [loadScript] set f2 [loadFile] set f3 [loadFile $loadfile] set f4 [loadScript] set f5 [loadFile] list $f1 $f2 $f3 $f4 $f5 } -result "[list {} {} $loadfile $contents $loadfile]\n" -cleanup { set ::tcltest::loadScript $olds set ::tcltest::loadFile $oldf } } removeFile load.tcl # [interpreter] test tcltest-13.1 {interpreter} { -constraints notValgrind -setup { #to do: Why is $::tcltest::tcltest being saved and restored here? set old $::tcltest::tcltest set ::tcltest::tcltest tcltest } -body { set f1 [interpreter] set f2 [interpreter tclsh] set f3 [interpreter] list $f1 $f2 $f3 } -result {tcltest tclsh tclsh} -cleanup { # writing ::tcltest::tcltest triggers a trace that sets up the stdio # constraint, which involves a call to [exec] that might fail after # "fork" and before "exec", in which case the forked process will not # have a chance to clean itself up before exiting, which causes # valgrind to issue numerous "still reachable" reports. set ::tcltest::tcltest $old } } # -singleproc, [singleProcess] set spd [makeDirectory singleprocdir] makeFile { set foo 1 } single1.test $spd makeFile { unset foo } single2.test $spd set allfile [makeFile { package require tcltest 2.5 namespace import tcltest::* testsDirectory [file join [temporaryDirectory] singleprocdir] runAllTests } all-single.tcl $spd] cd [workingDirectory] test tcltest-14.1 {-singleproc - single process} { -constraints {unixOrWin} -body { child msg $allfile -singleproc 0 -tmpdir [temporaryDirectory] return $msg } -result {Test file error: can't unset .foo.: no such variable} -match regexp } test tcltest-14.2 {-singleproc - multiple process} { -constraints {unixOrWin} -body { child msg $allfile -singleproc 1 -tmpdir [temporaryDirectory] return $msg } -result {single1.test.*single2.test.*all\-single.tcl:.*Total.*0.*Passed.*0.*Skipped.*0.*Failed.*0} -match regexp } test tcltest-14.3 {singleProcess} { -setup { set old $::tcltest::singleProcess set ::tcltest::singleProcess 0 } -body { set f1 [singleProcess] set f2 [singleProcess 1] set f3 [singleProcess] list $f1 $f2 $f3 } -result {0 1 1} -cleanup { set ::tcltest::singleProcess $old } } removeFile single1.test $spd removeFile single2.test $spd removeDirectory singleprocdir # -asidefromdir, -relateddir, [matchDirectories], [skipDirectories] # Before running these tests, need to set up test subdirectories with their own # all.tcl files. set dtd [makeDirectory dirtestdir] set dtd1 [makeDirectory dirtestdir2.1 $dtd] set dtd2 [makeDirectory dirtestdir2.2 $dtd] set dtd3 [makeDirectory dirtestdir2.3 $dtd] makeFile { package require tcltest 2.5 namespace import -force tcltest::* testsDirectory [file join [temporaryDirectory] dirtestdir] runAllTests } all.tcl $dtd makeFile { package require tcltest 2.5 namespace import -force tcltest::* testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.1] runAllTests } all.tcl $dtd1 makeFile { package require tcltest 2.5 namespace import -force tcltest::* testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.2] runAllTests } all.tcl $dtd2 makeFile { package require tcltest 2.5 namespace import -force tcltest::* testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.3] runAllTests } all.tcl $dtd3 test tcltest-15.1 {basic directory walking} { -constraints {unixOrWin} -body { if {[child msg \ [file join $dtd all.tcl] \ -tmpdir [temporaryDirectory]] == 1} { error $msg } } -match regexp -returnCodes 1 -result {Tests located in:.*dirtestdir.*Tests located in:.*dirtestdir2.[123].*Tests located in:.*dirtestdir2.[123].*Tests located in:.*dirtestdir2.[123]} } test tcltest-15.2 {-asidefromdir} { -constraints {unixOrWin} -body { if {[child msg \ [file join $dtd all.tcl] \ -asidefromdir dirtestdir2.3 \ -tmpdir [temporaryDirectory]] == 1} { error $msg } } -match regexp -returnCodes 1 -result {Tests located in:.*dirtestdir.*Tests located in:.*dirtestdir2.[12].*Tests located in:.*dirtestdir2.[12].*dirtestdir2.[12] test ended at .*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: No test files remain after applying your match and skip patterns! Error: No test files remain after applying your match and skip patterns! Error: No test files remain after applying your match and skip patterns!$} } test tcltest-15.3 {-relateddir, non-existent dir} { -constraints {unixOrWin} -body { if {[child msg \ [file join $dtd all.tcl] \ -relateddir [file join [temporaryDirectory] dirtestdir0] \ -tmpdir [temporaryDirectory]] == 1} { error $msg } } -returnCodes 1 -match regexp -result {[^~]|dirtestdir[^2]} } test tcltest-15.4 {-relateddir, subdir} { -constraints {unixOrWin} -body { if {[child msg \ [file join $dtd all.tcl] \ -relateddir dirtestdir2.1 -tmpdir [temporaryDirectory]] == 1} { error $msg } } -returnCodes 1 -match regexp -result {Tests located in:.*dirtestdir2.[^23]} } test tcltest-15.5 {-relateddir, -asidefromdir} { -constraints {unixOrWin} -body { if {[child msg \ [file join $dtd all.tcl] \ -relateddir "dirtestdir2.1 dirtestdir2.2" \ -asidefromdir dirtestdir2.2 \ -tmpdir [temporaryDirectory]] == 1} { error $msg } } -match regexp -returnCodes 1 -result {Tests located in:.*dirtestdir2.[^23]} } test tcltest-15.6 {matchDirectories} { -setup { set old [matchDirectories] set ::tcltest::matchDirectories {} } -body { set r1 [matchDirectories] set r2 [matchDirectories foo] set r3 [matchDirectories] list $r1 $r2 $r3 } -cleanup { set ::tcltest::matchDirectories $old } -result {{} foo foo} } test tcltest-15.7 {skipDirectories} { -setup { set old [skipDirectories] set ::tcltest::skipDirectories {} } -body { set r1 [skipDirectories] set r2 [skipDirectories foo] set r3 [skipDirectories] list $r1 $r2 $r3 } -cleanup { set ::tcltest::skipDirectories $old } -result {{} foo foo} } removeDirectory dirtestdir2.3 $dtd removeDirectory dirtestdir2.2 $dtd removeDirectory dirtestdir2.1 $dtd removeDirectory dirtestdir # TCLTEST_OPTIONS test tcltest-19.1 {TCLTEST_OPTIONS default} -setup { if {[info exists ::env(TCLTEST_OPTIONS)]} { set oldoptions $::env(TCLTEST_OPTIONS) } else { set oldoptions none } # set this to { } instead of just {} to get around quirk in # Windows env handling that removes empty elements from env array. set ::env(TCLTEST_OPTIONS) { } interp create child1 child1 eval [list set argv {-debug 2}] child1 alias puts puts interp create child2 child2 alias puts puts } -cleanup { interp delete child2 interp delete child1 if {$oldoptions eq "none"} { unset ::env(TCLTEST_OPTIONS) } else { set ::env(TCLTEST_OPTIONS) $oldoptions } } -body { child1 eval [package ifneeded tcltest [package provide tcltest]] child1 eval tcltest::debug set ::env(TCLTEST_OPTIONS) "-debug 3" child2 eval [package ifneeded tcltest [package provide tcltest]] child2 eval tcltest::debug } -result {^3$} -match regexp -output\ {tcltest::debug\s+= 2.*tcltest::debug\s+= 3} # Begin testing of tcltest procs ... cd [temporaryDirectory] # PrintError test tcltest-20.1 {PrintError} {unixOrWin} { set result [child msg $printerror] list $result [regexp "Error: a really short string" $msg] \ [regexp " \"quotes\"" $msg] [regexp " \"Path" $msg] \ [regexp " \"Really" $msg] [regexp Problem $msg] } {1 1 1 1 1 1} cd [workingDirectory] removeFile printerror.tcl # test::test test tcltest-21.0 {name and desc but no args specified} -setup { set v [verbose] } -cleanup { verbose $v } -body { verbose {} test tcltest-21.0.0 bar } -result {} test tcltest-21.1 {expect with glob} { -body { list a b c d e } -match glob -result {[ab] b c d e} } test tcltest-21.2 {force a test command failure} { -body { test tcltest-21.2.0 { return 2 } {1} } -returnCodes 1 -result {bad option "1": must be -body, -cleanup, -constraints, -errorCode, -errorOutput, -match, -output, -result, -returnCodes, or -setup} } test tcltest-21.3 {test command with setup} { -setup { set foo 1 } -body { set foo } -cleanup {unset foo} -result {1} } test tcltest-21.4 {test command with cleanup failure} { -setup { if {[info exists foo]} { unset foo } set fail $::tcltest::currentFailure set v [verbose] } -body { verbose {} test tcltest-21.4.0 {foo-1} { -cleanup {unset foo} } } -result {^$} -match regexp -cleanup {verbose $v; set ::tcltest::currentFailure $fail} -output "Test cleanup failed:.*can't unset \"foo\": no such variable" } test tcltest-21.5 {test command with setup failure} { -setup { if {[info exists foo]} { unset foo } set fail $::tcltest::currentFailure } -body { test tcltest-21.5.0 {foo-2} { -setup {unset foo} } } -result {^$} -match regexp -cleanup {set ::tcltest::currentFailure $fail} -output "Test setup failed:.*can't unset \"foo\": no such variable" } test tcltest-21.6 {test command - setup occurs before cleanup & before script} { -setup {set v [verbose]; set fail $::tcltest::currentFailure} -body { verbose {} test tcltest-21.6.0 {foo-3} { -setup { if {[info exists foo]} { unset foo } set foo 1 set expected 2 } -body { incr foo set foo } -cleanup { if {$foo != 2} { puts [outputChannel] "foo is wrong" } else { puts [outputChannel] "foo is 2" } } -result {$expected} } } -cleanup {verbose $v; set ::tcltest::currentFailure $fail} -result {^$} -match regexp -output "foo is 2" } test tcltest-21.7 {test command - bad flag} { -setup {set fail $::tcltest::currentFailure} -cleanup {set ::tcltest::currentFailure $fail} -body { test tcltest-21.7.0 {foo-4} { -foobar {} } } -returnCodes 1 -result {bad option "-foobar": must be -body, -cleanup, -constraints, -errorCode, -errorOutput, -match, -output, -result, -returnCodes, or -setup} } # alternate test command format (these are the same as 21.1-21.6, with the # exception of being in the all-inline format) test tcltest-21.7a {expect with glob} \ -body {list a b c d e} \ -result {[ab] b c d e} \ -match glob test tcltest-21.8 {force a test command failure} \ -setup {set fail $::tcltest::currentFailure} \ -body { test tcltest-21.8.0 { return 2 } {1} } \ -returnCodes 1 \ -cleanup {set ::tcltest::currentFailure $fail} \ -result {bad option "1": must be -body, -cleanup, -constraints, -errorCode, -errorOutput, -match, -output, -result, -returnCodes, or -setup} test tcltest-21.9 {test command with setup} \ -setup {set foo 1} \ -body {set foo} \ -cleanup {unset foo} \ -result {1} test tcltest-21.10 {test command with cleanup failure} -setup { if {[info exists foo]} { unset foo } set fail $::tcltest::currentFailure set v [verbose] } -cleanup { verbose $v set ::tcltest::currentFailure $fail } -body { verbose {} test tcltest-21.10.0 {foo-1} -cleanup {unset foo} } -result {^$} -match regexp \ -output {Test cleanup failed:.*can't unset \"foo\": no such variable} test tcltest-21.11 {test command with setup failure} -setup { if {[info exists foo]} { unset foo } set fail $::tcltest::currentFailure } -cleanup {set ::tcltest::currentFailure $fail} -body { test tcltest-21.11.0 {foo-2} -setup {unset foo} } -result {^$} -output {Test setup failed:.*can't unset \"foo\": no such variable} -match regexp test tcltest-21.12 { test command - setup occurs before cleanup & before script } -setup { set fail $::tcltest::currentFailure set v [verbose] } -cleanup { verbose $v set ::tcltest::currentFailure $fail } -body { verbose {} test tcltest-21.12.0 {foo-3} -setup { if {[info exists foo]} { unset foo } set foo 1 set expected 2 } -body { incr foo set foo } -cleanup { if {$foo != 2} { puts [outputChannel] "foo is wrong" } else { puts [outputChannel] "foo is 2" } } -result {$expected} } -result {^$} -output {foo is 2} -match regexp # test all.tcl usage (runAllTests); simulate .test file failure, as well as # crashes to determine whether or not these errors are logged. set atd [makeDirectory alltestdir] makeFile { package require tcltest 2.5 namespace import -force tcltest::* testsDirectory [file join [temporaryDirectory] alltestdir] runAllTests } all.tcl $atd makeFile { exit 1 } exit.test $atd makeFile { error "throw an error" } error.test $atd makeFile { package require tcltest 2.5 namespace import -force tcltest::* test foo-1.1 {foo} { -body { return 1 } -result {1} } cleanupTests } test.test $atd # Must use a child process because stdout/stderr parsing can't be # duplicated in child interp. test tcltest-22.1 {runAllTests} { -constraints {unixOrWin} -body { exec [interpreter] \ [file join $atd all.tcl] \ -verbose t -tmpdir [temporaryDirectory] } -match regexp -result "Test files exiting with errors:.*error.test.*exit.test" } removeDirectory alltestdir # makeFile, removeFile, makeDirectory, removeDirectory, viewFile test tcltest-23.1 {makeFile} { -setup { set mfdir [file join [temporaryDirectory] mfdir] file mkdir $mfdir } -body { makeFile {} t1.tmp makeFile {} et1.tmp $mfdir list [file exists [file join [temporaryDirectory] t1.tmp]] \ [file exists [file join $mfdir et1.tmp]] } -cleanup { file delete -force $mfdir \ [file join [temporaryDirectory] t1.tmp] } -result {1 1} } test tcltest-23.2 {removeFile} { -setup { set mfdir [file join [temporaryDirectory] mfdir] file mkdir $mfdir makeFile {} t1.tmp makeFile {} et1.tmp $mfdir if {![file exists [file join [temporaryDirectory] t1.tmp]] || \ ![file exists [file join $mfdir et1.tmp]]} { error "file creation didn't work" } } -body { removeFile t1.tmp removeFile et1.tmp $mfdir list [file exists [file join [temporaryDirectory] t1.tmp]] \ [file exists [file join $mfdir et1.tmp]] } -cleanup { file delete -force $mfdir \ [file join [temporaryDirectory] t1.tmp] } -result {0 0} } test tcltest-23.3 {makeDirectory} { -body { set mfdir [file join [temporaryDirectory] mfdir] file mkdir $mfdir makeDirectory d1 makeDirectory d2 $mfdir list [file exists [file join [temporaryDirectory] d1]] \ [file exists [file join $mfdir d2]] } -cleanup { file delete -force [file join [temporaryDirectory] d1] $mfdir } -result {1 1} } test tcltest-23.4 {removeDirectory} { -setup { set mfdir [makeDirectory mfdir] makeDirectory t1 makeDirectory t2 $mfdir if {![file exists $mfdir] || \ ![file exists [file join [temporaryDirectory] $mfdir t2]]} { error "setup failed - directory not created" } } -body { removeDirectory t1 removeDirectory t2 $mfdir list [file exists [file join [temporaryDirectory] t1]] \ [file exists [file join $mfdir t2]] } -result {0 0} } test tcltest-23.5 {viewFile} { -body { set mfdir [file join [temporaryDirectory] mfdir] file mkdir $mfdir makeFile {foobar} t1.tmp makeFile {foobarbaz} t2.tmp $mfdir list [viewFile t1.tmp] [viewFile t2.tmp $mfdir] } -result {foobar foobarbaz} -cleanup { file delete -force $mfdir removeFile t1.tmp } } # customMatch proc matchNegative { expected actual } { set match 0 foreach a $actual e $expected { if { $a != $e } { set match 1 break } } return $match } test tcltest-24.0 { customMatch: syntax } -body { list [catch {customMatch} result] $result } -result [list 1 "wrong # args: should be \"customMatch mode script\""] test tcltest-24.1 { customMatch: syntax } -body { list [catch {customMatch foo} result] $result } -result [list 1 "wrong # args: should be \"customMatch mode script\""] test tcltest-24.2 { customMatch: syntax } -body { list [catch {customMatch foo bar baz} result] $result } -result [list 1 "wrong # args: should be \"customMatch mode script\""] test tcltest-24.3 { customMatch: argument checking } -body { list [catch {customMatch bad "a \{ b"} result] $result } -result [list 1 "invalid customMatch script; can't evaluate after completion"] test tcltest-24.4 { test: valid -match values } -body { list [catch { test tcltest-24.4.0 {} \ -match [namespace current]::noSuchMode } result] $result } -match glob -result {1 *bad -match value*} test tcltest-24.5 { test: valid -match values } -setup { customMatch [namespace current]::alwaysMatch "format 1 ;#" } -body { list [catch { test tcltest-24.5.0 {} \ -match [namespace current]::noSuchMode } result] $result } -match glob -result {1 *bad -match value*: must be *alwaysMatch,*} test tcltest-24.6 { customMatch: -match script that always matches } -setup { customMatch [namespace current]::alwaysMatch "format 1 ;#" set v [verbose] } -body { verbose {} test tcltest-24.6.0 {} -match [namespace current]::alwaysMatch \ -body {format 1} -result 0 } -cleanup { verbose $v } -result {} -output {} -errorOutput {} test tcltest-24.7 { customMatch: replace default -exact matching } -setup { set saveExactMatchScript $::tcltest::CustomMatch(exact) customMatch exact "format 1 ;#" set v [verbose] } -body { verbose {} test tcltest-24.7.0 {} -body {format 1} -result 0 } -cleanup { verbose $v customMatch exact $saveExactMatchScript unset saveExactMatchScript } -result {} -output {} test tcltest-24.9 { customMatch: error during match } -setup { proc errorDuringMatch args {return -code error "match returned error"} customMatch [namespace current]::errorDuringMatch \ [namespace code errorDuringMatch] set v [verbose] set fail $::tcltest::currentFailure } -body { verbose {} test tcltest-24.9.0 {} -match [namespace current]::errorDuringMatch } -cleanup { verbose $v set ::tcltest::currentFailure $fail } -match glob -result {} -output {*FAILED*match returned error*} test tcltest-24.10 { customMatch: bad return from match command } -setup { proc nonBooleanReturn args {return foo} customMatch nonBooleanReturn [namespace code nonBooleanReturn] set v [verbose] set fail $::tcltest::currentFailure } -body { verbose {} test tcltest-24.10.0 {} -match nonBooleanReturn } -cleanup { verbose $v set ::tcltest::currentFailure $fail } -match glob -result {} -output {*FAILED*expected boolean value*} test tcltest-24.11 { test: -match exact } -body { set result {A B C} } -match exact -result {A B C} test tcltest-24.12 { test: -match exact match command eval in ::, not caller namespace } -setup { set saveExactMatchScript $::tcltest::CustomMatch(exact) customMatch exact [list string equal] set v [verbose] proc string args {error {called [string] in caller namespace}} } -body { verbose {} test tcltest-24.12.0 {} -body {format 1} -result 1 } -cleanup { rename string {} verbose $v customMatch exact $saveExactMatchScript unset saveExactMatchScript } -match exact -result {} -output {} test tcltest-24.13 { test: -match exact failure } -setup { set saveExactMatchScript $::tcltest::CustomMatch(exact) customMatch exact [list string equal] set v [verbose] set fail $::tcltest::currentFailure } -body { verbose {} test tcltest-24.13.0 {} -body {format 1} -result 0 } -cleanup { set ::tcltest::currentFailure $fail verbose $v customMatch exact $saveExactMatchScript unset saveExactMatchScript } -match glob -result {} -output {*FAILED*Result was: 1*(exact matching): 0*} test tcltest-24.14 { test: -match glob } -body { set result {A B C} } -match glob -result {A B*} test tcltest-24.15 { test: -match glob failure } -setup { set v [verbose] set fail $::tcltest::currentFailure } -body { verbose {} test tcltest-24.15.0 {} -match glob -body {format {A B C}} \ -result {A B* } } -cleanup { set ::tcltest::currentFailure $fail verbose $v } -match glob -result {} -output {*FAILED*Result was: *(glob matching): *} test tcltest-24.16 { test: -match regexp } -body { set result {A B C} } -match regexp -result {A B.*} test tcltest-24.17 { test: -match regexp failure } -setup { set fail $::tcltest::currentFailure set v [verbose] } -body { verbose {} test tcltest-24.17.0 {} -match regexp -body {format {A B C}} \ -result {A B.* X} } -cleanup { set ::tcltest::currentFailure $fail verbose $v } -match glob -result {} -output {*FAILED*Result was: *(regexp matching): *} test tcltest-24.18 { test: -match custom forget namespace qualification } -setup { set fail $::tcltest::currentFailure set v [verbose] customMatch negative matchNegative } -body { verbose {} test tcltest-24.18.0 {} -match negative -body {format {A B C}} \ -result {A B X} } -cleanup { set ::tcltest::currentFailure $fail verbose $v } -match glob -result {} -output {*FAILED*Error testing result:*} test tcltest-24.19 { test: -match custom } -setup { set v [verbose] customMatch negative [namespace code matchNegative] } -body { verbose {} test tcltest-24.19.0 {} -match negative -body {format {A B C}} \ -result {A B X} } -cleanup { verbose $v } -match exact -result {} -output {} test tcltest-24.20 { test: -match custom failure } -setup { set fail $::tcltest::currentFailure set v [verbose] customMatch negative [namespace code matchNegative] } -body { verbose {} test tcltest-24.20.0 {} -match negative -body {format {A B C}} \ -result {A B C} } -cleanup { set ::tcltest::currentFailure $fail verbose $v } -match glob -result {} -output {*FAILED*Result was: *(negative matching): *} test tcltest-25.1 { constraint of setup/cleanup (Bug 589859) } -setup { set foo 0 } -body { # Buggy tcltest will generate result of 2 test tcltest-25.1.0 {} -constraints knownBug -setup { incr foo } -body { incr foo } -cleanup { incr foo } -match glob -result * set foo } -cleanup { unset foo } -result 0 test tcltest-25.2 { puts -nonewline (Bug 612786) } -body { puts -nonewline stdout bla puts -nonewline stdout bla } -output {blabla} test tcltest-25.3 { reported return code (Bug 611922) } -setup { set fail $::tcltest::currentFailure set v [verbose] } -body { verbose {} test tcltest-25.3.0 {} -body { error foo } } -cleanup { set ::tcltest::currentFailure $fail verbose $v } -match glob -output {*generated error; Return code was: 1*} test tcltest-26.1 {Bug/RFE 1017151} -setup { makeFile { package require tcltest 2.5 set ::errorInfo "Should never see this" tcltest::test tcltest-26.1.0 { no errorInfo when only return code mismatch } -body { set x 1 } -returnCodes error -result 1 tcltest::cleanupTests } test.tcl } -body { child msg [file join [temporaryDirectory] test.tcl] return $msg } -cleanup { removeFile test.tcl } -match glob -result {* ---- Return code should have been one of: 1 ==== tcltest-26.1.0 FAILED*} test tcltest-26.2 {Bug/RFE 1017151} -setup { makeFile { package require tcltest 2.5 set ::errorInfo "Should never see this" tcltest::test tcltest-26.2.0 {do not mask body errorInfo} -body { error "body error" } -cleanup { error "cleanup error" } -result 1 tcltest::cleanupTests } test.tcl } -body { child msg [file join [temporaryDirectory] test.tcl] return $msg } -cleanup { removeFile test.tcl } -match glob -result {* ---- errorInfo: body error * ---- errorInfo(cleanup): cleanup error*} cleanupTests } namespace delete ::tcltest::test return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/tailcall.test0000644000175000017500000004034715104661341015407 0ustar sergeisergei# Commands covered: tailcall # # This file contains a collection of tests for experimental commands that are # found in ::tcl::unsupported. The tests will migrate to normal test files # if/when the commands find their way into the core. # # Copyright © 2008 Miguel Sofer. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testnrelevels [llength [info commands testnrelevels]] # # The tests that risked blowing the C stack on failure have been removed: we # can now actually measure using testnrelevels. # if {[testConstraint testnrelevels]} { namespace eval testnre { # # [testnrelevels] returns a 6-list with: C-stack depth, iPtr->numlevels, # cmdFrame level, callFrame level, tosPtr and callback depth # variable last [testnrelevels] proc depthDiff {} { variable last set depth [testnrelevels] set res {} foreach t $depth l $last { lappend res [expr {$t-$l}] } set last $depth return $res } namespace export * } namespace import testnre::* } proc errorcode options { dict get [dict merge {-errorcode NONE} $options] -errorcode } test tailcall-0.1 {tailcall is constant space} -constraints testnrelevels -setup { proc a i { # # NOTE: there may be a diff in callback depth with the first call # ($i==0) due to the fact that the first is from an eval. Successive # calls should add nothing to any stack depths. # if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall a $i } } -body { a 0 } -cleanup { rename a {} } -result {0 0 0 0 0 0} test tailcall-0.2 {tailcall is constant space} -constraints testnrelevels -setup { set a { i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } upvar 1 a a tailcall apply $a $i }} } -body { apply $a 0 } -cleanup { unset a } -result {0 0 0 0 0 0} test tailcall-0.3 {tailcall is constant space} -constraints testnrelevels -setup { proc a i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall b $i } interp alias {} b {} a } -body { b 0 } -cleanup { rename a {} rename b {} } -result {0 0 0 0 0 0} test tailcall-0.4 {tailcall is constant space} -constraints testnrelevels -setup { namespace eval ::ns { namespace export * } proc ::ns::a i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } set b [uplevel 1 [list namespace which b]] tailcall $b $i } namespace import ::ns::a rename a b } -body { b 0 } -cleanup { rename b {} namespace delete ::ns } -result {0 0 0 0 0 0} test tailcall-0.5 {tailcall is constant space} -constraints testnrelevels -setup { proc b i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall a b $i } namespace ensemble create -command a -map {b b} } -body { a b 0 } -cleanup { rename a {} rename b {} } -result {0 0 0 0 0 0} test tailcall-0.5.1 {tailcall is constant space} -constraints testnrelevels -setup { # # This test is related to [bug d87cb182053fd79b3]: the fix to that bug was # to remove a call to TclSkipTailcall, which caused a violation of the # constant-space property of tailcall in that particular # configuration. This test was added to detect that, and insure that the # problem is fixed. # proc b i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall dict b $i } set map0 [namespace ensemble configure dict -map] set map $map0 dict set map b b namespace ensemble configure dict -map $map } -body { dict b 0 } -cleanup { rename b {} namespace ensemble configure dict -map $map0 unset map map0 } -result {0 0 0 0 0 0} test tailcall-0.6 {tailcall is constant space} -constraints {testnrelevels knownBug} -setup { # # This test fails because ns-unknown is not NR-enabled # proc c i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall a b $i } proc d {ens sub args} { return [list $ens c] } namespace ensemble create -command a -unknown d } -body { a b 0 } -cleanup { rename a {} rename c {} rename d {} } -result {0 0 0 0 0 0} test tailcall-0.7 {tailcall is constant space} -constraints testnrelevels -setup { catch {rename foo {}} oo::class create foo { method b i { if {$i == 1} { depthDiff } if {[incr i] > 10} { return [depthDiff] } tailcall [self] b $i } } } -body { foo create a a b 0 } -cleanup { rename a {} rename foo {} } -result {0 0 0 0 0 0} test tailcall-1 {tailcall} -body { namespace eval a { variable x *::a proc xset {} { set tmp {} set ns {[namespace current]} set level [info level] for {set i 0} {$i <= [info level]} {incr i} { uplevel #$i "set x $i$ns" lappend tmp "$i [info level $i]" } lrange $tmp 1 end } proc foo {} {tailcall xset; set x noreach} } namespace eval b { variable x *::b proc xset args {error b::xset} proc moo {} {set x 0; variable y [::a::foo]; set x} } variable x *:: proc xset args {error ::xset} list [::b::moo] | $x $a::x $b::x | $::b::y } -cleanup { unset x rename xset {} namespace delete a b } -result {1::b | 0:: *::a *::b | {{1 ::b::moo} {2 xset}}} test tailcall-2 {tailcall in non-proc} -body { namespace eval a [list tailcall set x 1] } -match glob -result *tailcall* -returnCodes error test tailcall-3 {tailcall falls off tebc} -body { unset -nocomplain x proc foo {} {tailcall set x 1} list [catch foo msg] $msg [set x] } -cleanup { rename foo {} unset x } -result {0 1 1} test tailcall-4 {tailcall falls off tebc} -body { set x 2 proc foo {} {tailcall set x 1} foo set x } -cleanup { rename foo {} unset x } -result 1 test tailcall-5 {tailcall falls off tebc} -body { set x 2 namespace eval bar { variable x 3 proc foo {} {tailcall set x 1} } bar::foo list $x $bar::x } -cleanup { unset x namespace delete bar } -result {1 3} test tailcall-6 {tailcall does remove callframes} -body { proc foo {} {info level} proc moo {} {tailcall foo} proc boo {} {expr {[moo] - [info level]}} boo } -cleanup { rename foo {} rename moo {} rename boo {} } -result 1 test tailcall-7 {tailcall does return} -setup { namespace eval ::foo { variable res {} proc a {} { variable res append res a tailcall set x 1 append res a } proc b {} { variable res append res b a append res b } proc c {} { variable res append res c b append res c } } } -body { namespace eval ::foo c } -cleanup { namespace delete ::foo } -result cbabc test tailcall-8 {tailcall tailcall} -setup { namespace eval ::foo { variable res {} proc a {} { variable res append res a tailcall tailcall set x 1 append res a } proc b {} { variable res append res b a append res b } proc c {} { variable res append res c b append res c } } } -body { namespace eval ::foo c } -cleanup { namespace delete ::foo } -result cbac test tailcall-9 {tailcall factorial} -setup { proc fact {n {b 1}} { if {$n == 1} { return $b } tailcall fact [expr {$n-1}] [expr {$n*$b}] } } -body { list [fact 1] [fact 5] [fact 10] [fact 15] } -cleanup { rename fact {} } -result {1 120 3628800 1307674368000} test tailcall-10a {tailcall and eval} -setup { set ::x 0 proc a {} { eval [list tailcall lappend ::x 2] set ::x 1 } } -body { list [a] $::x } -cleanup { unset -nocomplain ::x } -result {{0 2} {0 2}} test tailcall-10b {tailcall and eval} -setup { set ::x 0 proc a {} { eval {tailcall lappend ::x 2} set ::x 1 } } -body { list [a] $::x } -cleanup { unset -nocomplain ::x } -result {{0 2} {0 2}} test tailcall-11a {tailcall and uplevel} -setup { proc a {} { uplevel 1 [list tailcall set ::x 2] set ::x 1 } } -body { list [a] $::x } -cleanup { unset -nocomplain ::x } -match glob -result *tailcall* -returnCodes error test tailcall-11b {tailcall and uplevel} -setup { proc a {} { uplevel 1 {tailcall set ::x 2} set ::x 1 } } -body { list [a] $::x } -cleanup { unset -nocomplain ::x } -match glob -result *tailcall* -returnCodes error test tailcall-11c {tailcall and uplevel} -setup { proc a {} { uplevel 1 {tailcall lappend ::x 2} set ::x 1 } proc b {} {set ::x 0; a; lappend ::x 3} } -body { list [b] $::x } -cleanup { rename a {} rename b {} unset -nocomplain ::x } -result {{0 3 2} {0 3 2}} test tailcall-12.1 {[Bug 2649975]} -setup { proc dump {{text {}}} { set text [uplevel 1 [list subst $text]] set l [expr {[info level] -1}] if {$text eq {}} { set text [info level $l] } puts "$l: $text" } # proc dump args {} proc bravo {} { upvar 1 v w dump {inside bravo, v -> $w} set v "procedure bravo" #uplevel 1 [list delta ::betty] uplevel 1 {delta ::betty} return $::resolution } proc delta name { upvar 1 v w dump {inside delta, v -> $w} set v "procedure delta" tailcall foxtrot } proc foxtrot {} { upvar 1 v w dump {inside foxtrot, v -> $w} global resolution set ::resolution $w } set v "global level" } -body { set result [bravo] if {$result ne $v} { puts "v should have been found at $v but was found in $result" } } -cleanup { unset v rename dump {} rename bravo {} rename delta {} rename foxtrot {} } -output {1: inside bravo, v -> global level 1: inside delta, v -> global level 1: inside foxtrot, v -> global level } test tailcall-12.2 {[Bug 2649975]} -setup { proc dump {{text {}}} { set text [uplevel 1 [list subst $text]] set l [expr {[info level] -1}] if {$text eq {}} { set text [info level $l] } puts "$l: $text" } # proc dump args {} set v "global level" oo::class create foo { # like connection method alpha {} { # like connections 'tables' method dump upvar 1 v w dump {inside foo's alpha, v resolves to $w} set v "foo's method alpha" dump {foo's alpha is calling [self] bravo - v should resolve at global level} set result [uplevel 1 [list [self] bravo]] dump {exiting from foo's alpha} return $result } method bravo {} { # like connections 'foreach' method dump upvar 1 v w dump {inside foo's bravo, v resolves to $w} set v "foo's method bravo" dump {foo's bravo is calling charlie to create barney} set barney [my charlie ::barney] dump {foo's bravo is calling bravo on $barney} dump {v should resolve at global scope there} set result [uplevel 1 [list $barney bravo]] dump {exiting from foo's bravo} return $result } method charlie {name} { # like tdbc prepare dump set v "foo's method charlie" dump {tailcalling bar's constructor} tailcall ::bar create $name } } oo::class create bar { # like statement method bravo {} { # like statement foreach method dump upvar 1 v w dump {inside bar's bravo, v is resolving to $w} set v "bar's method bravo" dump {calling delta to construct betty - v should resolve global there} uplevel 1 [list [self] delta ::betty] dump {exiting from bar's bravo} return [::betty whathappened] } method delta {name} { # like statement execute method dump upvar 1 v w dump {inside bar's delta, v is resolving to $w} set v "bar's method delta" dump {tailcalling to construct $name as instance of grill} dump {v should resolve at global level in grill's constructor} dump {grill's constructor should run at level [info level]} tailcall grill create $name } } oo::class create grill { variable resolution constructor {} { dump upvar 1 v w dump "in grill's constructor, v resolves to $w" set resolution $w } method whathappened {} { return $resolution } } foo create fred } -body { set result [fred alpha] if {$result ne "global level"} { puts "v should have been found at global level but was found in $result" } } -cleanup { unset result rename fred {} rename dump {} rename foo {} rename bar {} rename grill {} } -output {1: fred alpha 1: inside foo's alpha, v resolves to global level 1: foo's alpha is calling ::fred bravo - v should resolve at global level 1: ::fred bravo 1: inside foo's bravo, v resolves to global level 1: foo's bravo is calling charlie to create barney 2: my charlie ::barney 2: tailcalling bar's constructor 1: foo's bravo is calling bravo on ::barney 1: v should resolve at global scope there 1: ::barney bravo 1: inside bar's bravo, v is resolving to global level 1: calling delta to construct betty - v should resolve global there 1: ::barney delta ::betty 1: inside bar's delta, v is resolving to global level 1: tailcalling to construct ::betty as instance of grill 1: v should resolve at global level in grill's constructor 1: grill's constructor should run at level 1 1: grill create ::betty 1: in grill's constructor, v resolves to global level 1: exiting from bar's bravo 1: exiting from foo's bravo 1: exiting from foo's alpha } test tailcall-12.3a0 {[Bug 2695587]} -body { apply {{} { catch [list tailcall foo] }} } -returnCodes 1 -result {invalid command name "foo"} test tailcall-12.3a1 {[Bug 2695587]} -body { apply {{} { catch [list tailcall foo] tailcall }} } -result {} test tailcall-12.3a2 {[Bug 2695587]} -body { apply {{} { catch [list tailcall foo] tailcall moo }} } -returnCodes 1 -result {invalid command name "moo"} test tailcall-12.3a3 {[Bug 2695587]} -body { set x 0 apply {{} { catch [list tailcall foo] tailcall lappend x 1 }} set x } -cleanup { unset x } -result {0 1} test tailcall-12.3b0 {[Bug 2695587]} -body { apply {{} { set catch catch $catch [list tailcall foo] }} } -returnCodes 1 -result {invalid command name "foo"} test tailcall-12.3b1 {[Bug 2695587]} -body { apply {{} { set catch catch $catch [list tailcall foo] tailcall }} } -result {} test tailcall-12.3b2 {[Bug 2695587]} -body { apply {{} { set catch catch $catch [list tailcall foo] tailcall moo }} } -returnCodes 1 -result {invalid command name "moo"} test tailcall-12.3b3 {[Bug 2695587]} -body { set x 0 apply {{} { set catch catch $catch [list tailcall foo] tailcall lappend x 1 }} set x } -cleanup { unset x } -result {0 1} # MORE VARIANTS MISSING: bc'ed caught script vs (bc'ed, not-bc'ed) # catch. Actually superfluous now, as tailcall just returns TCL_RETURN so that # standard catch behaviour is required. test tailcall-13.1 {directly tailcalling the tailcall command is ok} { list [catch { apply {{} { apply {{} { tailcall tailcall subst ok subst b }} subst c }} } msg opt] $msg [errorcode $opt] } {0 ok NONE} test tailcall-13.2 {indirectly tailcalling the tailcall command is ok} { list [catch { apply {{} { apply {{} { tailcall eval tailcall subst ok subst b }} subst c }} } msg opt] $msg [errorcode $opt] } {0 ok NONE} if {[testConstraint testnrelevels]} { namespace forget testnre::* namespace delete testnre } test tailcall-14.1 {in a deleted namespace} -body { namespace eval ns { proc p args { tailcall [namespace current] $args } namespace delete [namespace current] p } } -returnCodes 1 -result {namespace "::ns" not found} test tailcall-14.1-bc {{in a deleted namespace} {byte compiled}} -body { namespace eval ns { proc p args { tailcall [namespace current] {*}$args } namespace delete [namespace current] p } } -returnCodes 1 -result {namespace "::ns" not found} test tailcall-bug-784befb0ba {tailcall crash with 254 args} -body { proc tccrash args {llength $args} # Must be EXACTLY 254 for crash proc p {} [list tailcall tccrash {*}[lrepeat 254 x]] p } -result 254 # cleanup ::tcltest::cleanupTests # Local Variables: # mode: tcl # End: tcl9.0.3/tests/switch.test0000644000175000017500000005315315104661341015122 0ustar sergeisergei# Commands covered: switch # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test switch-1.1 {simple patterns} { switch a a {subst 1} b {subst 2} c {subst 3} default {subst 4} } 1 test switch-1.2 {simple patterns} { switch b a {subst 1} b {subst 2} c {subst 3} default {subst 4} } 2 test switch-1.3 {simple patterns} { switch x a {subst 1} b {subst 2} c {subst 3} default {subst 4} } 4 test switch-1.4 {simple patterns} { switch x a {subst 1} b {subst 2} c {subst 3} } {} test switch-1.5 {simple pattern matches many times} { switch b a {subst 1} b {subst 2} b {subst 3} b {subst 4} } 2 test switch-1.6 {simple patterns} { switch default a {subst 1} default {subst 2} c {subst 3} default {subst 4} } 2 test switch-1.7 {simple patterns} { switch x a {subst 1} default {subst 2} c {subst 3} default {subst 4} } 4 test switch-1.8 {simple patterns with -nocase} { switch -nocase b a {subst 1} b {subst 2} c {subst 3} default {subst 4} } 2 test switch-1.9 {simple patterns with -nocase} { switch -nocase B a {subst 1} b {subst 2} c {subst 3} default {subst 4} } 2 test switch-1.10 {simple patterns with -nocase} { switch -nocase b a {subst 1} B {subst 2} c {subst 3} default {subst 4} } 2 test switch-1.11 {simple patterns with -nocase} { switch -nocase x a {subst 1} default {subst 2} c {subst 3} default {subst 4} } 4 test switch-2.1 {single-argument form for pattern/command pairs} { switch b { a {subst 1} b {subst 2} default {subst 6} } } {2} test switch-2.2 {single-argument form for pattern/command pairs} -body { switch z {a 2 b} } -returnCodes error -result {extra switch pattern with no body} test switch-3.1 {-exact vs. -glob vs. -regexp} { switch -exact aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } exact test switch-3.2 {-exact vs. -glob vs. -regexp} { switch -regexp aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } regexp test switch-3.3 {-exact vs. -glob vs. -regexp} { switch -glob aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } glob test switch-3.4 {-exact vs. -glob vs. -regexp} { switch aaaab {^a*b$} {subst regexp} *b {subst glob} \ aaaab {subst exact} default {subst none} } exact test switch-3.5 {-exact vs. -glob vs. -regexp} { switch -- -glob { ^g.*b$ {subst regexp} -* {subst glob} -glob {subst exact} default {subst none} } } exact test switch-3.6 {-exact vs. -glob vs. -regexp} -body { switch -foo a b c } -returnCodes error -result {bad option "-foo": must be -exact, -glob, -indexvar, -matchvar, -nocase, -regexp, or --} test switch-3.7 {-exact vs. -glob vs. -regexp with -nocase} { switch -exact -nocase aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } exact test switch-3.8 {-exact vs. -glob vs. -regexp with -nocase} { switch -regexp -nocase aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } regexp test switch-3.9 {-exact vs. -glob vs. -regexp with -nocase} { switch -glob -nocase aaaab { ^a*b$ {subst regexp} *b {subst glob} aaaab {subst exact} default {subst none} } } glob test switch-3.10 {-exact vs. -glob vs. -regexp with -nocase} { switch -nocase aaaab {^a*b$} {subst regexp} *b {subst glob} \ aaaab {subst exact} default {subst none} } exact test switch-3.11 {-exact vs. -glob vs. -regexp with -nocase} { switch -nocase -- -glob { ^g.*b$ {subst regexp} -* {subst glob} -glob {subst exact} default {subst none} } } exact test switch-3.12 {-exact vs. -glob vs. -regexp} { switch -exa Foo Foo {set result OK} } OK test switch-3.13 {-exact vs. -glob vs. -regexp} { switch -gl Foo Fo? {set result OK} } OK test switch-3.14 {-exact vs. -glob vs. -regexp} { switch -re Foo Fo. {set result OK} } OK test switch-3.15 {-exact vs. -glob vs. -regexp} -body { switch -exact -exact Foo Foo {set result OK} } -returnCodes error -result {bad option "-exact": -exact option already found} test switch-3.16 {-exact vs. -glob vs. -regexp} -body { switch -exact -glob Foo Foo {set result OK} } -returnCodes error -result {bad option "-glob": -exact option already found} test switch-3.17 {-exact vs. -glob vs. -regexp} -body { switch -glob -regexp Foo Foo {set result OK} } -returnCodes error -result {bad option "-regexp": -glob option already found} test switch-3.18 {-exact vs. -glob vs. -regexp} -body { switch -regexp -glob Foo Foo {set result OK} } -returnCodes error -result {bad option "-glob": -regexp option already found} test switch-4.1 {error in executed command} { list [catch {switch a a {error "Just a test"} default {subst 1}} msg] \ $msg $::errorInfo } {1 {Just a test} {Just a test while executing "error "Just a test"" ("a" arm line 1) invoked from within "switch a a {error "Just a test"} default {subst 1}"}} test switch-4.2 {error: not enough args} -returnCodes error -body { switch } -result {wrong # args: should be "switch ?-option ...? string ?pattern body ...? ?default body?"} test switch-4.3 {error: pattern with no body} -body { switch a b } -returnCodes error -result {extra switch pattern with no body} test switch-4.4 {error: pattern with no body} -body { switch a b {subst 1} c } -returnCodes error -result {extra switch pattern with no body} test switch-4.5 {error in default command} { list [catch {switch foo a {error switch1} b {error switch 3} \ default {error switch2}} msg] $msg $::errorInfo } {1 switch2 {switch2 while executing "error switch2" ("default" arm line 1) invoked from within "switch foo a {error switch1} b {error switch 3} default {error switch2}"}} test switch-5.1 {errors in -regexp matching} -returnCodes error -body { switch -regexp aaaab { *b {subst glob} aaaab {subst exact} default {subst none} } } -result {cannot compile regular expression pattern: invalid quantifier operand} test switch-6.1 {backslashes in patterns} { switch -exact {\a\$\.\[} { \a\$\.\[ {subst first} \a\\$\.\\[ {subst second} \\a\\$\\.\\[ {subst third} {\a\\$\.\\[} {subst fourth} {\\a\\$\\.\\[} {subst fifth} default {subst none} } } third test switch-6.2 {backslashes in patterns} { switch -exact {\a\$\.\[} { \a\$\.\[ {subst first} {\a\$\.\[} {subst second} {{\a\$\.\[}} {subst third} default {subst none} } } second test switch-7.1 {"-" bodies} { switch a { a - b - c {subst 1} default {subst 2} } } 1 test switch-7.2 {"-" bodies} -body { switch a { a - b - c - } } -returnCodes error -result {no body specified for pattern "c"} test switch-7.3 {"-" bodies} -body { switch a { a - b -foo c - } } -returnCodes error -result {no body specified for pattern "c"} test switch-7.4 {"-" bodies} -body { switch a { a - b -foo c {} } } -returnCodes error -result {invalid command name "-foo"} test switch-8.1 {empty body} { set msg {} switch {2} { 1 {set msg 1} 2 {} default {set msg 2} } } {} proc test_switch_body {} { return "INVOKED" } test switch-8.2 {weird body text, variable} { set cmd {test_switch_body} switch Foo { Foo $cmd } } {INVOKED} test switch-8.3 {weird body text, variable} { set cmd {test_switch_body} switch Foo { Foo {$cmd} } } {INVOKED} test switch-9.1 {empty pattern/body list} -returnCodes error -body { switch x } -result {wrong # args: should be "switch ?-option ...? string ?pattern body ...? ?default body?"} test switch-9.2 {unpaired pattern} -returnCodes error -body { switch -- x } -result {extra switch pattern with no body} test switch-9.3 {empty pattern/body list} -body { switch x {} } -returnCodes error -result {wrong # args: should be "switch ?-option ...? string {?pattern body ...? ?default body?}"} test switch-9.4 {empty pattern/body list} -body { switch -- x {} } -returnCodes error -result {wrong # args: should be "switch ?-option ...? string {?pattern body ...? ?default body?}"} test switch-9.5 {unpaired pattern} -body { switch x a {} b } -returnCodes error -result {extra switch pattern with no body} test switch-9.6 {unpaired pattern} -body { switch x {a {} b} } -returnCodes error -result {extra switch pattern with no body} test switch-9.7 {unpaired pattern} -body { switch x a {} # comment b } -returnCodes error -result {extra switch pattern with no body} test switch-9.8 {unpaired pattern} -returnCodes error -body { switch x {a {} # comment b} } -result {extra switch pattern with no body, this may be due to a comment incorrectly placed outside of a switch body - see the "switch" documentation} test switch-9.9 {unpaired pattern} -body { switch x a {} x {} # comment b } -returnCodes error -result {extra switch pattern with no body} test switch-9.10 {unpaired pattern} -returnCodes error -body { switch x {a {} x {} # comment b} } -result {extra switch pattern with no body, this may be due to a comment incorrectly placed outside of a switch body - see the "switch" documentation} test switch-10.1 {compiled -exact switch} { if 1 {switch -exact -- a {a {subst 1} b {subst 2}}} } 1 test switch-10.1a {compiled -exact switch} { if 1 {switch -exact a {a {subst 1} b {subst 2}}} } 1 test switch-10.2 {compiled -exact switch} { if 1 {switch -exact -- b {a {subst 1} b {subst 2}}} } 2 test switch-10.2a {compiled -exact switch} { if 1 {switch -exact b {a {subst 1} b {subst 2}}} } 2 test switch-10.3 {compiled -exact switch} { if 1 {switch -exact -- c {a {subst 1} b {subst 2}}} } {} test switch-10.3a {compiled -exact switch} { if 1 {switch -exact c {a {subst 1} b {subst 2}}} } {} test switch-10.4 {compiled -exact switch} { if 1 { set x 0 switch -exact -- c {a {subst 1} b {subst 2}} } } {} test switch-10.5 {compiled -exact switch} { if 1 {switch -exact -- a {a - aa {subst 1} b {subst 2}}} } 1 test switch-10.6 {compiled -exact switch} { if 1 {switch -exact -- b {a { set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1;set x 1 } b {subst 2}}} } 2 # Command variants are: # c* are compiled switches, i* are interpreted # *-glob use glob matching, *-exact use exact matching # *2* include a default clause (different results too.) proc cswtest-glob s { set x 0; set y 0 foreach c [split $s {}] { switch -glob $c { a {incr x} b {incr y} } } set x [expr {$x*100}]; set y [expr {$y*100}] foreach c [split $s {}] { switch -glob -- $c a {incr x} b {incr y} } return $x,$y } proc iswtest-glob s { set x 0; set y 0; set switch switch foreach c [split $s {}] { $switch -glob $c { a {incr x} b {incr y} } } set x [expr {$x*100}]; set y [expr {$y*100}] foreach c [split $s {}] { $switch -glob -- $c a {incr x} b {incr y} } return $x,$y } proc cswtest-exact s { set x 0; set y 0 foreach c [split $s {}] { switch -exact $c { a {incr x} b {incr y} } } set x [expr {$x*100}]; set y [expr {$y*100}] foreach c [split $s {}] { switch -exact -- $c a {incr x} b {incr y} } return $x,$y } proc iswtest-exact s { set x 0; set y 0; set switch switch foreach c [split $s {}] { $switch -exact $c { a {incr x} b {incr y} } } set x [expr {$x*100}]; set y [expr {$y*100}] foreach c [split $s {}] { $switch -exact -- $c a {incr x} b {incr y} } return $x,$y } proc cswtest2-glob s { set x 0; set y 0; set z 0 foreach c [split $s {}] { switch -glob $c { a {incr x} b {incr y} default {incr z} } } set x [expr {$x*100}]; set y [expr {$y*100}]; set z [expr {$z*100}] foreach c [split $s {}] { switch -glob -- $c a {incr x} b {incr y} default {incr z} } return $x,$y,$z } proc iswtest2-glob s { set x 0; set y 0; set z 0; set switch switch foreach c [split $s {}] { $switch -glob $c { a {incr x} b {incr y} default {incr z} } } set x [expr {$x*100}]; set y [expr {$y*100}]; set z [expr {$z*100}] foreach c [split $s {}] { $switch -glob -- $c a {incr x} b {incr y} default {incr z} } return $x,$y,$z } proc cswtest2-exact s { set x 0; set y 0; set z 0 foreach c [split $s {}] { switch -exact $c { a {incr x} b {incr y} default {incr z} } } set x [expr {$x*100}]; set y [expr {$y*100}]; set z [expr {$z*100}] foreach c [split $s {}] { switch -exact -- $c a {incr x} b {incr y} default {incr z} } return $x,$y,$z } proc iswtest2-exact s { set x 0; set y 0; set z 0; set switch switch foreach c [split $s {}] { $switch -exact $c { a {incr x} b {incr y} default {incr z} } } set x [expr {$x*100}]; set y [expr {$y*100}]; set z [expr {$z*100}] foreach c [split $s {}] { $switch -exact -- $c a {incr x} b {incr y} default {incr z} } return $x,$y,$z } test switch-10.7 {comparison of compiled and interpreted behaviour of switch, exact matching} { cswtest-exact abcb } [iswtest-exact abcb] test switch-10.8 {comparison of compiled and interpreted behaviour of switch, glob matching} { cswtest-glob abcb } [iswtest-glob abcb] test switch-10.9 {comparison of compiled and interpreted behaviour of switch, exact matching with default} { cswtest2-exact abcb } [iswtest2-exact abcb] test switch-10.10 {comparison of compiled and interpreted behaviour of switch, glob matching with default} { cswtest2-glob abcb } [iswtest2-glob abcb] proc cswtest-default-exact {x} { switch -- $x { a* {return b} aa {return c} default {return d} } } test switch-10.11 {default to exact matching when compiled} { cswtest-default-exact a } d test switch-10.12 {default to exact matching when compiled} { cswtest-default-exact aa } c test switch-10.13 {default to exact matching when compiled} { cswtest-default-exact a* } b test switch-10.14 {default to exact matching when compiled} { cswtest-default-exact a** } d rename cswtest-default-exact {} rename cswtest-glob {} rename iswtest-glob {} rename cswtest2-glob {} rename iswtest2-glob {} rename cswtest-exact {} rename iswtest-exact {} rename cswtest2-exact {} rename iswtest2-exact {} # Bug 1891827 test switch-10.15 {(not) compiled exact nocase regression} { apply {{} { switch -nocase -- A { a {return yes} default {return no} } }} } yes # Added due to TIP#75 test switch-11.1 {regexp matching with -matchvar} { switch -regexp -matchvar x -- abc {.(.). {set x}} } {abc b} test switch-11.2 {regexp matching with -matchvar} { set x GOOD switch -regexp -matchvar x -- abc {.(.).. {list $x z}} set x } GOOD test switch-11.3 {regexp matching with -matchvar} { switch -regexp -matchvar x -- "a b c" {.(.). {set x}} } {{a b} { }} test switch-11.4 {regexp matching with -matchvar} { set x BAD switch -regexp -matchvar x -- "a b c" { bc {list $x YES} default {list $x NO} } } {{} NO} test switch-11.5 {-matchvar without -regexp} { set x {} list [catch {switch -glob -matchvar x -- abc . {set x}} msg] $x $msg } {1 {} {-matchvar option requires -regexp option}} test switch-11.6 {-matchvar unwritable} { set x {} list [catch {switch -regexp -matchvar x(x) -- abc . {set x}} msg] $x $msg } {1 {} {can't set "x(x)": variable isn't array}} test switch-12.1 {regexp matching with -indexvar} { switch -regexp -indexvar x -- abc {.(.). {set x}} } {{0 2} {1 1}} test switch-12.2 {regexp matching with -indexvar} { set x GOOD switch -regexp -indexvar x -- abc {.(.).. {list $x z}} set x } GOOD test switch-12.3 {regexp matching with -indexvar} { switch -regexp -indexvar x -- "a b c" {.(.). {set x}} } {{0 2} {1 1}} test switch-12.4 {regexp matching with -indexvar} { set x BAD switch -regexp -indexvar x -- "a b c" { bc {list $x YES} default {list $x NO} } } {{} NO} test switch-12.5 {-indexvar without -regexp} { set x {} list [catch {switch -glob -indexvar x -- abc . {set x}} msg] $x $msg } {1 {} {-indexvar option requires -regexp option}} test switch-12.6 {-indexvar unwritable} { set x {} list [catch {switch -regexp -indexvar x(x) -- abc . {set x}} msg] $x $msg } {1 {} {can't set "x(x)": variable isn't array}} test switch-12.7 {[Bug 3106532] -indexvar should be directly usable with [string range]} { set str abcdef switch -regexp -indexvar x -- $str ^... {string range $str {*}[lindex $x 0]} } abc test switch-12.8 {-indexvar and matched empty strings} { switch -regexp -indexvar x -- abcdef ^...(x?) {return $x} } {{0 2} {3 2}} test switch-12.9 {-indexvar and unmatched strings} { switch -regexp -indexvar x -- abcdef ^...(x)? {return $x} } {{0 2} {-1 -1}} test switch-13.1 {-indexvar -matchvar combinations} { switch -regexp -indexvar x -matchvar y abc { . {list $x $y} } } {{{0 0}} a} test switch-13.2 {-indexvar -matchvar combinations} { switch -regexp -indexvar x -matchvar y abc { .$ {list $x $y} } } {{{2 2}} c} test switch-13.3 {-indexvar -matchvar combinations} { switch -regexp -indexvar x -matchvar y abc { (.)(.)(.) {list $x $y} } } {{{0 2} {0 0} {1 1} {2 2}} {abc a b c}} test switch-13.4 {-indexvar -matchvar combinations} { set x - set y - switch -regexp -indexvar x -matchvar y abc { (.)(.)(.). - default {list $x $y} } } {{} {}} test switch-13.5 {-indexvar -matchvar combinations} { set x - set y - list [catch { switch -regexp -indexvar x(x) -matchvar y abc {. {list $x $y}} } msg] $x $y $msg } {1 - - {can't set "x(x)": variable isn't array}} test switch-13.6 {-indexvar -matchvar combinations} { set x - set y - list [catch { switch -regexp -indexvar x -matchvar y(y) abc {. {list $x $y}} } msg] $x $y $msg } {1 {{0 0}} - {can't set "y(y)": variable isn't array}} test switch-14.1 {-regexp -- compilation [Bug 1854399]} { switch -regexp -- 0 { {[0-9]+} {return yes} default {return no} } foo } yes test switch-14.2 {-regexp -- compilation [Bug 1854399]} { proc foo {} { switch -regexp -- 0 { {[0-9]+} {return yes} default {return no} } } foo } yes test switch-14.3 {-regexp -- compilation [Bug 1854399]} { proc foo {} { switch -regexp -- 0 { {\d+} {return yes} default {return no} } } foo } yes test switch-14.4 {-regexp -- compilation [Bug 1854399]} { proc foo {} { switch -regexp -- 0 { {0} {return yes} default {return no} } } foo } yes test switch-14.5 {switch -regexp compilation} { apply {{} { switch -regexp -- 0 { {0|1|2} {return yes} default {return no} } }} } yes test switch-14.6 {switch -regexp compilation} { apply {{} { switch -regexp -- 0 { {0|11|222} {return yes} default {return no} } }} } yes test switch-14.7 {switch -regexp compilation} { apply {{} { switch -regexp -- 0 { {[012]} {return yes} default {return no} } }} } yes test switch-14.8 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {0|1|2} {return yes} default {return no} } }} } no test switch-14.9 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {0|11|222} {return yes} default {return no} } }} } no test switch-14.10 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {[012]} {return yes} default {return no} } }} } no test switch-14.11 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {0|1|2} {return yes} .+ {return yes2} default {return no} } }} } yes2 test switch-14.12 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {0|11|222} {return yes} .+ {return yes2} default {return no} } }} } yes2 test switch-14.13 {switch -regexp compilation} { apply {{} { switch -regexp -- x { {[012]} {return yes} .+ {return yes2} default {return no} } }} } yes2 test switch-14.14 {switch -regexp compilation} { apply {{} { switch -regexp -- {} { {0|1|2} {return yes} .+ {return yes2} default {return no} } }} } no test switch-14.15 {switch -regexp compilation} { apply {{} { switch -regexp -- {} { {0|11|222} {return yes} .+ {return yes2} default {return no} } }} } no test switch-14.16 {switch -regexp compilation} { apply {{} { switch -regexp -- {} { {[012]} {return yes} .+ {return yes2} default {return no} } }} } no test switch-14.17 {switch -regexp bug [c0bc269178]} { set result {} switch -regexp -matchvar m -indexvar i ac { {(a)(b)?(c)} {set result $m} } set result } {ac a {} c} test switch-15.1 {coroutine safety of non-bytecoded switch} {*}{ -body { proc coro {} { switch -glob a { a {yield ok1} } return ok2 } list [coroutine c coro] [c] } -result {ok1 ok2} -cleanup { rename coro {} } } # cleanup catch {rename foo {}} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/subst.test0000644000175000017500000002406615104661341014762 0ustar sergeisergei# Commands covered: subst # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1994 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testbytestring [llength [info commands testbytestring]] test subst-1.1 {basics} -returnCodes error -body { subst } -result {wrong # args: should be "subst ?-nobackslashes? ?-nocommands? ?-novariables? string"} test subst-1.2 {basics} -returnCodes error -body { subst a b c } -result {bad option "a": must be -nobackslashes, -nocommands, or -novariables} test subst-2.1 {simple strings} { subst {} } {} test subst-2.2 {simple strings} { subst a } a test subst-2.3 {simple strings} { subst abcdefg } abcdefg test subst-2.4 {simple strings} testbytestring { # Tcl Bug 685106 expr {[subst [testbytestring bar\x00soom]] eq [testbytestring bar\x00soom]} } 1 test subst-3.1 {backslash substitutions} { subst {\x\$x\[foo bar]\\} } "x\$x\[foo bar]\\" test subst-3.2 {backslash substitutions with utf chars} { # 'j' is just a char that doesn't mean anything, and \344 is 'ä' # that also doesn't mean anything, but is multi-byte in UTF-8. list [subst \j] [subst \\j] [subst \\344] [subst \\\344] } "j j ä ä" test subst-4.1 {variable substitutions} { set a 44 subst {$a} } {44} test subst-4.2 {variable substitutions} { set a 44 subst {x$a.y{$a}.z} } {x44.y{44}.z} test subst-4.3 {variable substitutions} -setup { catch {unset a} } -body { set a(13) 82 set i 13 subst {x.$a($i)} } -result {x.82} catch {unset a} set long {This is a very long string, intentionally made so long that it will overflow the static character size for dstrings, so that additional memory will have to be allocated by subst. That way, if the subst procedure forgets to free up memory while returning an error, there will be memory that isn't freed (this will be detected when the tests are run under a checking memory allocator such as Purify).} test subst-4.4 {variable substitutions} -returnCodes error -body { subst {$long $a} } -result {can't read "a": no such variable} test subst-5.1 {command substitutions} { subst {[concat {}]} } {} test subst-5.2 {command substitutions} { subst {[concat A test string]} } {A test string} test subst-5.3 {command substitutions} { subst {x.[concat foo].y.[concat bar].z} } {x.foo.y.bar.z} test subst-5.4 {command substitutions} { list [catch {subst {$long [set long] [bogus_command]}} msg] $msg } {1 {invalid command name "bogus_command"}} test subst-5.5 {command substitutions} { set a 0 list [catch {subst {[set a 1}} msg] $a $msg } {1 0 {missing close-bracket}} test subst-5.6 {command substitutions} { set a 0 list [catch {subst {0[set a 1}} msg] $a $msg } {1 0 {missing close-bracket}} test subst-5.7 {command substitutions} { set a 0 list [catch {subst {0[set a 1; set a 2}} msg] $a $msg } {1 1 {missing close-bracket}} # repeat the tests above simulating cmd line input test subst-5.8 {command substitutions} { set script {[subst {[set a 1}]} list [catch {exec [info nameofexecutable] << $script} msg] $msg } {1 {missing close-bracket}} test subst-5.9 {command substitutions} { set script {[subst {0[set a 1}]} list [catch {exec [info nameofexecutable] << $script} msg] $msg } {1 {missing close-bracket}} test subst-5.10 {command substitutions} { set script {[subst {0[set a 1; set a 2}]} list [catch {exec [info nameofexecutable] << $script} msg] $msg } {1 {missing close-bracket}} test subst-6.1 {clear the result after command substitution} -body { catch {unset a} subst {[concat foo] $a} } -returnCodes error -result {can't read "a": no such variable} test subst-7.1 {switches} -returnCodes error -body { subst foo bar } -result {bad option "foo": must be -nobackslashes, -nocommands, or -novariables} test subst-7.2 {switches} -returnCodes error -body { subst -no bar } -result {ambiguous option "-no": must be -nobackslashes, -nocommands, or -novariables} test subst-7.3 {switches} -returnCodes error -body { subst -bogus bar } -result {bad option "-bogus": must be -nobackslashes, -nocommands, or -novariables} test subst-7.4 {switches} { set x 123 subst -nobackslashes {abc $x [expr {1 + 2}] \\\x41} } {abc 123 3 \\\x41} test subst-7.5 {switches} { set x 123 subst -nocommands {abc $x [expr {1 + 2}] \\\x41} } {abc 123 [expr {1 + 2}] \A} test subst-7.6 {switches} { set x 123 subst -novariables {abc $x [expr {1 + 2}] \\\x41} } {abc $x 3 \A} test subst-7.7 {switches} { set x 123 subst -nov -nob -noc {abc $x [expr {1 + 2}] \\\x41} } {abc $x [expr {1 + 2}] \\\x41} test subst-8.1 {return in a subst} { subst {foo [return {x}; bogus code] bar} } {foo x bar} test subst-8.2 {return in a subst} { subst {foo [return x ; bogus code] bar} } {foo x bar} test subst-8.3 {return in a subst} { subst {foo [if 1 { return {x}; bogus code }] bar} } {foo x bar} test subst-8.4 {return in a subst} { subst {[eval {return hi}] there} } {hi there} test subst-8.5 {return in a subst} { subst {foo [return {]}; bogus code] bar} } {foo ] bar} test subst-8.6 {return in a subst} -returnCodes error -body { subst "foo \[return {x}; bogus code bar" } -result {missing close-bracket} test subst-8.7 {return in a subst, parse error} -body { subst {foo [return {x} ; set a {}"" ; stuff] bar} } -returnCodes error -result {extra characters after close-brace} test subst-8.8 {return in a subst, parse error} -body { subst {foo [return {x} ; set bar baz ; set a {}"" ; stuff] bar} } -returnCodes error -result {extra characters after close-brace} test subst-8.9 {return in a variable subst} { subst {foo $var([return {x}]) bar} } {foo x bar} test subst-9.1 {error in a subst} -body { subst {[error foo; bogus code]bar} } -returnCodes error -result foo test subst-9.2 {error in a subst} -body { subst {[if 1 { error foo; bogus code}]bar} } -returnCodes error -result foo test subst-9.3 {error in a variable subst} -setup { catch {unset var} } -body { subst {foo $var([error foo]) bar} } -returnCodes error -result foo test subst-10.1 {break in a subst} { subst {foo [break; bogus code] bar} } {foo } test subst-10.2 {break in a subst} { subst {foo [break; return x; bogus code] bar} } {foo } test subst-10.3 {break in a subst} { subst {foo [if 1 { break; bogus code}] bar} } {foo } test subst-10.4 {break in a subst, parse error} { subst {foo [break ; set a {}{} ; stuff] bar} } {foo } test subst-10.5 {break in a subst, parse error} { subst {foo [break ;set bar baz ;set a {}{} ; stuff] bar} } {foo } test subst-10.6 {break in a variable subst} { subst {foo $var([break]) bar} } {foo } test subst-11.1 {continue in a subst} { subst {foo [continue; bogus code] bar} } {foo bar} test subst-11.2 {continue in a subst} { subst {foo [continue; return x; bogus code] bar} } {foo bar} test subst-11.3 {continue in a subst} { subst {foo [if 1 { continue; bogus code}] bar} } {foo bar} test subst-11.4 {continue in a subst, parse error} -body { subst {foo [continue ; set a {}{} ; stuff] bar} } -returnCodes error -result {extra characters after close-brace} test subst-11.5 {continue in a subst, parse error} -body { subst {foo [continue ;set bar baz ;set a {}{} ; stuff] bar} } -returnCodes error -result {extra characters after close-brace} test subst-11.6 {continue in a variable subst} { subst {foo $var([continue]) bar} } {foo bar} test subst-12.1 {nasty case, Bug 1036649} { for {set i 0} {$i < 10} {incr i} { set res [list [catch {subst "\[subst {};"} msg] $msg] if {$msg ne "missing close-bracket"} break } return $res } {1 {missing close-bracket}} test subst-12.2 {nasty case, Bug 1036649} { for {set i 0} {$i < 10} {incr i} { set res [list [catch {subst "\[subst {}; "} msg] $msg] if {$msg ne "missing close-bracket"} break } return $res } {1 {missing close-bracket}} test subst-12.3 {nasty case, Bug 1036649} { set x 0 for {set i 0} {$i < 10} {incr i} { set res [list [catch {subst "\[incr x;"} msg] $msg] if {$msg ne "missing close-bracket"} break } lappend res $x } {1 {missing close-bracket} 10} test subst-12.4 {nasty case, Bug 1036649} { set x 0 for {set i 0} {$i < 10} {incr i} { set res [list [catch {subst "\[incr x; "} msg] $msg] if {$msg ne "missing close-bracket"} break } lappend res $x } {1 {missing close-bracket} 10} test subst-12.5 {nasty case, Bug 1036649} { set x 0 for {set i 0} {$i < 10} {incr i} { set res [list [catch {subst "\[incr x"} msg] $msg] if {$msg ne "missing close-bracket"} break } lappend res $x } {1 {missing close-bracket} 0} test subst-12.6 {nasty case with compilation} { set x unset set y unset list [eval [list subst {[set x 1;break;incr x][set y $x]}]] $x $y } {{} 1 unset} test subst-12.7 {nasty case with compilation} { set x unset set y unset list [eval [list subst {[set x 1;continue;incr x][set y $x]}]] $x $y } {1 1 1} test subst-13.1 {Bug 3081065} -setup { set script [makeFile { proc demo {string} { subst $string } demo name2 } subst13.tcl] } -body { interp create child child eval [list source $script] interp delete child interp create child child eval { set count 400 while {[incr count -1]} { lappend bloat [expr {rand()}] } } child eval [list source $script] interp delete child } -cleanup { removeFile subst13.tcl } test subst-13.2 {Test for segfault} -body { subst {[} } -returnCodes error -result * -match glob # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/stringObj.test0000644000175000017500000004745015104661341015565 0ustar sergeisergei# Commands covered: none # # This file contains tests for the procedures in tclStringObj.c that implement # the Tcl type manager for the string type. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1995-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testobj [llength [info commands testobj]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testdstring [llength [info commands testdstring]] test stringObj-1.1 {string type registration} testobj { set t [testobj types] set first [string first "string" $t] set result [expr {$first >= 0}] } 1 set INT_MAX 0x7fffffff; # Assumes sizeof(int) == 4 set SIZE_MAX [expr {(1 << (8*$::tcl_platform(pointerSize) - 1)) - 1}] test stringObj-2.1 {Tcl_NewStringObj} testobj { set result "" lappend result [testobj freeallvars] lappend result [teststringobj set 1 abcd] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} abcd string 2} test stringObj-3.1 {Tcl_SetStringObj, existing "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [teststringobj set 1 xyz] ;# makes existing obj a string lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} xyz string 2} test stringObj-3.2 {Tcl_SetStringObj, existing non-"empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 512] lappend result [teststringobj set 1 foo] ;# makes existing obj a string lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 512 foo string 2} test stringObj-4.1 {Tcl_SetObjLength procedure, string gets shorter} testobj { testobj freeallvars teststringobj set 1 test teststringobj setlength 1 3 list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {3 4 tes} test stringObj-4.2 {Tcl_SetObjLength procedure, string gets longer} testobj { testobj freeallvars teststringobj set 1 abcdef teststringobj setlength 1 10 teststringobj length 1 } 10 test stringObj-4.3 {Tcl_SetObjLength procedure, string gets longer} testobj { testobj freeallvars teststringobj set 1 abcdef teststringobj append 1 xyzq -1 list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {10 15 abcdefxyzq} test stringObj-4.4 {Tcl_SetObjLength procedure, "empty string", length 0} testobj { testobj freeallvars testobj newobj 1 teststringobj setlength 1 0 list [teststringobj length2 1] [teststringobj get 1] } {0 {}} test stringObj-5.1 {Tcl_AppendToObj procedure, type conversion} testobj { testobj freeallvars testintobj set2 1 43 teststringobj append 1 xyz -1 teststringobj get 1 } {43xyz} test stringObj-5.2 {Tcl_AppendToObj procedure, length calculation} testobj { testobj freeallvars teststringobj set 1 {x y } teststringobj append 1 bbCCddEE 4 teststringobj append 1 123 -1 teststringobj get 1 } {x y bbCC123} test stringObj-5.3 {Tcl_AppendToObj procedure, reallocating space} testobj { testobj freeallvars teststringobj set 1 xyz teststringobj setlength 1 15 teststringobj setlength 1 2 set result {} teststringobj append 1 1234567890123 -1 lappend result [teststringobj length 1] [teststringobj length2 1] teststringobj setlength 1 10 teststringobj append 1 abcdef -1 lappend result [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {15 15 16 24 xy12345678abcdef} test stringObj-6.1 {Tcl_AppendStringsToObj procedure, type conversion} testobj { testobj freeallvars teststringobj set2 1 [list a b] teststringobj appendstrings 1 xyz { 1234 } foo teststringobj get 1 } {a bxyz 1234 foo} test stringObj-6.2 {Tcl_AppendStringsToObj procedure, counting space} testobj { testobj freeallvars teststringobj set 1 abc teststringobj appendstrings 1 list [teststringobj length 1] [teststringobj get 1] } {3 abc} test stringObj-6.3 {Tcl_AppendStringsToObj procedure, counting space} testobj { testobj freeallvars teststringobj set 1 abc teststringobj appendstrings 1 {} {} {} {} list [teststringobj length 1] [teststringobj get 1] } {3 abc} test stringObj-6.4 {Tcl_AppendStringsToObj procedure, counting space} testobj { testobj freeallvars teststringobj set 1 abc teststringobj appendstrings 1 { 123 } abcdefg list [teststringobj length 1] [teststringobj get 1] } {15 {abc 123 abcdefg}} test stringObj-6.5 {Tcl_AppendStringsToObj procedure, don't double space if initial string empty} testobj { testobj freeallvars testobj newobj 1 teststringobj appendstrings 1 123 abcdefg list [teststringobj length 1] [teststringobj length2 1] [teststringobj get 1] } {10 15 123abcdefg} test stringObj-6.6 {Tcl_AppendStringsToObj procedure, space reallocation} testobj { testobj freeallvars teststringobj set 1 abc teststringobj setlength 1 10 teststringobj setlength 1 2 teststringobj appendstrings 1 34567890 list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {10 10 ab34567890} test stringObj-6.7 {Tcl_AppendStringsToObj procedure, space reallocation} testobj { testobj freeallvars teststringobj set 1 abc teststringobj setlength 1 10 teststringobj setlength 1 2 teststringobj appendstrings 1 34567890x list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {11 17 ab34567890x} test stringObj-6.8 {Tcl_AppendStringsToObj procedure, object totally empty} testobj { testobj freeallvars testobj newobj 1 teststringobj appendstrings 1 {} list [teststringobj length2 1] [teststringobj get 1] } {0 {}} test stringObj-6.9 {Tcl_AppendStringsToObj, pure unicode} testobj { testobj freeallvars teststringobj set2 1 [string replace abc 1 1 d] teststringobj appendstrings 1 foo bar soom teststringobj get 1 } adcfoobarsoom test stringObj-7.1 {SetStringFromAny procedure} testobj { testobj freeallvars teststringobj set2 1 [list a b] teststringobj append 1 x -1 list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {4 6 {a bx}} test stringObj-7.2 {SetStringFromAny procedure, null object} testobj { testobj freeallvars testobj newobj 1 teststringobj appendstrings 1 {} list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj get 1] } {0 0 {}} test stringObj-7.3 {SetStringFromAny called with non-string obj} testobj { set x 2345 list [incr x] [testobj objtype $x] [string index $x end] \ [testobj objtype $x] } {2346 int 6 string} test stringObj-7.4 {SetStringFromAny called with string obj} testobj { set x "abcdef" list [string length $x] [testobj objtype $x] \ [string length $x] [testobj objtype $x] } {6 string 6 string} test stringObj-8.1 {DupStringInternalRep procedure} testobj { testobj freeallvars teststringobj set 1 {} teststringobj append 1 abcde -1 testobj duplicate 1 2 list [teststringobj length 1] [teststringobj length2 1] \ [teststringobj maxchars 1] [teststringobj get 1] \ [teststringobj length 2] [teststringobj length2 2] \ [teststringobj maxchars 2] [teststringobj get 2] } {5 8 0 abcde 5 5 0 abcde} test stringObj-8.2 {DupUnicodeInternalRep, mixed width chars} testobj { set x abc\xEF\xBF\xAEghi string length $x set y $x list [testobj objtype $x] [testobj objtype $y] [append x "\xAE\xBF\xEF"] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string string abc\xEF\xBF\xAEghi\xAE\xBF\xEF abc\xEF\xBF\xAEghi string string" test stringObj-8.3 {DupUnicodeInternalRep, mixed width chars} testobj { set x abc\xEF\xBF\xAEghi set y $x string length $x list [testobj objtype $x] [testobj objtype $y] [append x "\xAE\xBF\xEF"] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string string abc\xEF\xBF\xAEghi\xAE\xBF\xEF abc\xEF\xBF\xAEghi string string" test stringObj-8.4 {DupUnicodeInternalRep, all byte-size chars} testobj { set x abcdefghi string length $x set y $x list [testobj objtype $x] [testobj objtype $y] [append x jkl] \ [set y] [testobj objtype $x] [testobj objtype $y] } {string string abcdefghijkl abcdefghi string string} test stringObj-8.5 {DupUnicodeInternalRep, all byte-size chars} testobj { set x abcdefghi set y $x string length $x list [testobj objtype $x] [testobj objtype $y] [append x jkl] \ [set y] [testobj objtype $x] [testobj objtype $y] } {string string abcdefghijkl abcdefghi string string} test stringObj-9.1 {TclAppendObjToObj, mixed src & dest} {testobj testdstring} { set x abc\xEF\xBF\xAEghi testdstring free testdstring append \xAE\xBF\xEF -1 set y [testdstring get] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string none abc\xEF\xBF\xAEghi\xAE\xBF\xEF \xAE\xBF\xEF string none" test stringObj-9.2 {TclAppendObjToObj, mixed src & dest} testobj { set x abc\xEF\xBF\xAEghi string length $x list [testobj objtype $x] [append x $x] [testobj objtype $x] \ [append x $x] [testobj objtype $x] } "string abc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghi string\ abc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghi\ string" test stringObj-9.3 {TclAppendObjToObj, mixed src & 1-byte dest} {testobj testdstring} { set x abcdefghi testdstring free testdstring append \xAE\xBF\xEF -1 set y [testdstring get] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string none abcdefghi\xAE\xBF\xEF \xAE\xBF\xEF string none" test stringObj-9.4 {TclAppendObjToObj, 1-byte src & dest} {testobj testdstring} { set x abcdefghi testdstring free testdstring append jkl -1 set y [testdstring get] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } {string none abcdefghijkl jkl string none} test stringObj-9.5 {TclAppendObjToObj, 1-byte src & dest} testobj { set x abcdefghi string length $x list [testobj objtype $x] [append x $x] [testobj objtype $x] \ [append x $x] [testobj objtype $x] } {string abcdefghiabcdefghi string abcdefghiabcdefghiabcdefghiabcdefghi\ string} test stringObj-9.6 {TclAppendObjToObj, 1-byte src & mixed dest} {testobj testdstring} { set x abc\xEF\xBF\xAEghi testdstring free testdstring append jkl -1 set y [testdstring get] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string none abc\xEF\xBF\xAEghijkl jkl string none" test stringObj-9.7 {TclAppendObjToObj, integer src & dest} testobj { set x [expr {4 * 5}] set y [expr {4 + 5}] list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [testobj objtype $x] [append x $y] [testobj objtype $x] \ [testobj objtype $y] } {int int 209 string 2099 string int} test stringObj-9.8 {TclAppendObjToObj, integer src & dest} testobj { set x [expr {4 * 5}] list [testobj objtype $x] [append x $x] [testobj objtype $x] \ [append x $x] [testobj objtype $x] } {int 2020 string 20202020 string} test stringObj-9.9 {TclAppendObjToObj, integer src & 1-byte dest} testobj { set x abcdefghi set y [expr {4 + 5}] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } {string int abcdefghi9 9 string int} test stringObj-9.10 {TclAppendObjToObj, integer src & mixed dest} testobj { set x abc\xEF\xBF\xAEghi set y [expr {4 + 5}] string length $x list [testobj objtype $x] [testobj objtype $y] [append x $y] \ [set y] [testobj objtype $x] [testobj objtype $y] } "string int abc\xEF\xBF\xAEghi9 9 string int" test stringObj-9.11 {TclAppendObjToObj, mixed src & 1-byte dest index check} testobj { # bug 2678, in <=8.2.0, the second obj (the one to append) in # Tcl_AppendObjToObj was not correctly checked to see if it was all one # byte chars, so a Unicode string would be added as one byte chars. set x abcdef set len [string length $x] set y a\xFCb\xE5c\xEF set len [string length $y] append x $y string length $x set q {} for {set i 0} {$i < 12} {incr i} { lappend q [string index $x $i] } set q } "a b c d e f a \xFC b \xE5 c \xEF" test stringObj-10.1 {Tcl_GetRange with all byte-size chars} {testobj testdstring} { testdstring free testdstring append abcdef -1 set x [testdstring get] list [testobj objtype $x] [set y [string range $x 1 end-1]] \ [testobj objtype $x] [testobj objtype $y] } [list none bcde string string] test stringObj-10.2 {Tcl_GetRange with some mixed width chars} {testobj testdstring} { testdstring free testdstring append "abcïïdef" -1 set x [testdstring get] list [testobj objtype $x] [set y [string range $x 1 end-1]] \ [testobj objtype $x] [testobj objtype $y] } [list none "bcïïde" string string] test stringObj-10.3 {Tcl_GetRange with some mixed width chars} testobj { set x "abcïïdef" string length $x list [testobj objtype $x] [set y [string range $x 1 end-1]] \ [testobj objtype $x] [testobj objtype $y] } [list string "bcïïde" string string] test stringObj-10.4 {Tcl_GetRange with some mixed width chars} testobj { set a "ïa¿b®cï¿d®" set result [list] while {[string length $a] > 0} { set a [string range $a 1 end-1] lappend result $a } set result } [list a\xBFb\xAEc\xEF\xBFd \ \xBFb\xAEc\xEF\xBF \ b\xAEc\xEF \ \xAEc \ {}] test stringObj-11.1 {UpdateStringOfString} testobj { set x 2345 list [string index $x end] [testobj objtype $x] [incr x] \ [testobj objtype $x] } {5 string 2346 int} test stringObj-12.1 {Tcl_GetUniChar with byte-size chars} testobj { set x "abcdefghi" list [string index $x 0] [string index $x 1] } {a b} test stringObj-12.2 {Tcl_GetUniChar with byte-size chars} testobj { set x "abcdefghi" list [string index $x 3] [string index $x end] } {d i} test stringObj-12.3 {Tcl_GetUniChar with byte-size chars} testobj { set x "abcdefghi" list [string index $x end] [string index $x end-1] } {i h} test stringObj-12.4 {Tcl_GetUniChar with mixed width chars} testobj { string index "\xEFa\xBFb\xAEc\xAE\xBFd\xEF" 0 } "\xEF" test stringObj-12.5 {Tcl_GetUniChar} testobj { set x "\xEFa\xBFb\xAEc\xAE\xBFd\xEF" list [string index $x 4] [string index $x 0] } "\xAE \xEF" test stringObj-12.6 {Tcl_GetUniChar} testobj { string index "\xEFa\xBFb\xAEc\xEF\xBFd\xAE" end } "\xAE" test stringObj-13.1 {Tcl_GetCharLength with byte-size chars} testobj { set a "" list [string length $a] [string length $a] } {0 0} test stringObj-13.2 {Tcl_GetCharLength with byte-size chars} testobj { string length "a" } 1 test stringObj-13.3 {Tcl_GetCharLength with byte-size chars} testobj { set a "abcdef" list [string length $a] [string length $a] } {6 6} test stringObj-13.4 {Tcl_GetCharLength with mixed width chars} testobj { string length "\xAE" } 1 test stringObj-13.5 {Tcl_GetCharLength with mixed width chars} testobj { # string length "○○" # Use \uXXXX notation below instead of hard-coding the values, otherwise # the test will fail in multibyte locales. string length "\xEF\xBF\xAE\xEF\xBF\xAE" } 6 test stringObj-13.6 {Tcl_GetCharLength with mixed width chars} testobj { # set a "ïa¿b®cï¿d®" # Use \uXXXX notation below instead of hard-coding the values, otherwise # the test will fail in multibyte locales. set a "\xEFa\xBFb\xAEc\xEF\xBFd\xAE" list [string length $a] [string length $a] } {10 10} test stringObj-13.7 {Tcl_GetCharLength with identity nulls} {testobj testbytestring} { # SF bug #684699 string length [testbytestring \x00] } 1 test stringObj-13.8 {Tcl_GetCharLength with identity nulls} {testobj testbytestring} { string length [testbytestring \x01\x00\x02] } 3 test stringObj-14.1 {Tcl_SetObjLength on pure unicode object} testobj { teststringobj set 1 foo teststringobj maxchars 1 teststringobj append 1 bar -1 teststringobj maxchars 1 teststringobj append 1 bar -1 teststringobj setlength 1 0 teststringobj append 1 bar -1 teststringobj get 1 } {bar} test stringObj-15.1 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself 1 0 } foofoo test stringObj-15.2 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself 1 1 } foooo test stringObj-15.3 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself 1 2 } fooo test stringObj-15.4 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself 1 3 } foo test stringObj-15.5 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 0 } foofoo test stringObj-15.6 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 1 } foooo test stringObj-15.7 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 2 } fooo test stringObj-15.8 {Tcl_Append*ToObj: self appends} testobj { teststringobj set 1 foo teststringobj appendself2 1 3 } foo test stringObj-16.0 {Tcl_GetRange: normal case} testobj { teststringobj set 1 abcde teststringobj range 1 1 3 } bcd test stringObj-16.1 {Tcl_GetRange: first > end} testobj { teststringobj set 1 abcde teststringobj range 1 10 5 } {} test stringObj-16.2 {Tcl_GetRange: last > end} testobj { teststringobj set 1 abcde teststringobj range 1 3 13 } de test stringObj-16.3 {Tcl_GetRange: first = TCL_INDEX_NONE} testobj { teststringobj set 1 abcde teststringobj range 1 -1 3 } abcd test stringObj-16.4 {Tcl_GetRange: last = TCL_INDEX_NONE} testobj { teststringobj set 1 abcde teststringobj range 1 1 -1 } bcde test stringObj-16.5 {Tcl_GetRange: first = last = TCL_INDEX_NONE} testobj { teststringobj set 1 abcde teststringobj range 1 -1 -1 } abcde test stringObj-16.6 {Tcl_GetRange: old anomaly} testobj { # Older implementations could return "cde" teststringobj set 1 abcde teststringobj range 1 2 0 } {} test stringObj-16.7 {Tcl_GetRange: first = INT_MAX-1} testobj { teststringobj set 1 abcde teststringobj range 1 [expr {$INT_MAX-1}] 3 } {} test stringObj-16.8 {Tcl_GetRange: first = SIZE_MAX-1} testobj { teststringobj set 1 abcde teststringobj range 1 [expr {$SIZE_MAX - 1}] 3 } {} test stringObj-16.9 {Tcl_GetRange: last = INT_MAX-1} testobj { teststringobj set 1 abcde teststringobj range 1 1 [expr {$INT_MAX-1}] } bcde test stringObj-16.10 {Tcl_GetRange: last = SIZE_MAX-1} testobj { teststringobj set 1 abcde teststringobj range 1 1 [expr {$SIZE_MAX - 1}] } bcde test stringObj-16.11 {Tcl_GetRange: first = last = INT_MAX-1} testobj { teststringobj set 1 abcde teststringobj range 1 [expr {$INT_MAX-1}] [expr {$INT_MAX-1}] } {} test stringObj-16.12 {Tcl_GetRange: first = last = SIZE_MAX-1} testobj { teststringobj set 1 abcde set i [expr {$SIZE_MAX - 1}] teststringobj range 1 $i $i } {} if {[testConstraint testobj]} { testobj freeallvars } # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/string.test0000644000175000017500000031033715104661341015127 0ustar sergeisergei# Commands covered: string # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2001 Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] source [file join [file dirname [info script]] tcltests.tcl] # Helper commands to test various optimizations, code paths, and special cases. proc makeByteArray {s} {binary format a* $s} proc makeUnicode {s} {lindex [regexp -inline .* $s] 0} proc makeList {args} {return $args} proc makeShared {s} {uplevel 1 [list lappend copy $s]; return $s} # Some tests require the testobj command testConstraint testobj [expr {[info commands testobj] ne {}}] testConstraint testindexobj [expr {[info commands testindexobj] ne {}}] testConstraint testevalex [expr {[info commands testevalex] ne {}}] testConstraint testbytestring [llength [info commands testbytestring]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc getbytes {} { set lines [split [memory info] \n] return [lindex $lines 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } proc representationpoke s { set r [::tcl::unsupported::representation $s] list [lindex $r 3] [string match {*, string representation "*"} $r] } foreach noComp {0 1} { if {$noComp} { if {[info commands testevalex] eq {}} { test string-0.1.$noComp "show testevalex availability" {testevalex} {list} {} continue } interp alias {} run {} testevalex set constraints testevalex } else { interp alias {} run {} try set constraints {} } test string-1.1.$noComp {error conditions} -body { list [catch {run {string gorp a b}} msg] $msg } -result {1 {unknown or ambiguous subcommand "gorp": must be cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}} test string-1.2.$noComp {error conditions} { list [catch {run {string}} msg] $msg } {1 {wrong # args: should be "string subcommand ?arg ...?"}} test stringComp-1.3.$noComp {error condition - undefined method during compile} { # We don't want this to complain about 'never' because it may never # be called, or string may get redefined. This must compile OK. proc foo {str i} { if {"yes" == "no"} { string never called but complains here } string index $str $i } foo abc 0 } a test string-2.1.$noComp {string compare, not enough args} { list [catch {run {string compare a}} msg] $msg } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}} test string-2.2.$noComp {string compare, bad args} { list [catch {run {string compare a b c}} msg] $msg } {1 {bad option "a": must be -nocase or -length}} test string-2.3.$noComp {string compare, bad args} { list [catch {run {string compare -length -nocase str1 str2}} msg] $msg } {1 {expected integer but got "-nocase"}} test string-2.4.$noComp {string compare, too many args} { list [catch {run {string compare -length 10 -nocase str1 str2 str3}} msg] $msg } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}} test string-2.5.$noComp {string compare with length unspecified} { list [catch {run {string compare -length 10 10}} msg] $msg } {1 {wrong # args: should be "string compare ?-nocase? ?-length int? string1 string2"}} test string-2.6.$noComp {string compare} { run {string compare abcde abdef} } -1 test string-2.7.$noComp {string compare, shortest method name} { run {string co abcde ABCDE} } 1 test string-2.8.$noComp {string compare} { run {string compare abcde abcde} } 0 test string-2.9.$noComp {string compare with length} { run {string compare -length 2 abcde abxyz} } 0 test string-2.10.$noComp {string compare with special index} { list [catch {run {string compare -length end-3 abcde abxyz}} msg] $msg } {1 {expected integer but got "end-3"}} test string-2.11.$noComp {string compare, unicode} { run {string compare ab牦 ab牧} } -1 test string-2.11.1.$noComp {string compare, unicode} { run {string compare Ü Ü} } 0 test string-2.11.2.$noComp {string compare, unicode} { run {string compare Ü ü} } -1 test string-2.11.3.$noComp {string compare, unicode} { run {string compare ÜÜÜüü ÜÜÜÜÜ} } 1 test string-2.12.$noComp {string compare, high bit} { # This test fails if the underlying comparison # is using signed chars instead of unsigned chars. # (like SunOS's default memcmp thus the compat/memcmp.c) run {string compare "\x80" "@"} # Nb this tests works also in utf-8 space because \x80 is # translated into a 2 or more bytelength but whose first byte has # the high bit set. } 1 test string-2.13.$noComp {string compare -nocase} { run {string compare -nocase abcde abdef} } -1 test string-2.13.1.$noComp {string compare -nocase} { run {string compare -nocase abcde Abdef} } -1 test string-2.14.$noComp {string compare -nocase} { run {string compare -nocase abcde ABCDE} } 0 test string-2.15.$noComp {string compare -nocase} { run {string compare -nocase abcde abcde} } 0 test string-2.15.1.$noComp {string compare -nocase} { run {string compare -nocase Ü Ü} } 0 test string-2.15.2.$noComp {string compare -nocase} { run {string compare -nocase ÜÜÜüü ÜÜÜÜÜ} } 0 test string-2.16.$noComp {string compare -nocase with length} { run {string compare -length 2 -nocase abcde Abxyz} } 0 test string-2.17.$noComp {string compare -nocase with length} { run {string compare -nocase -length 3 abcde Abxyz} } -1 test string-2.18.$noComp {string compare -nocase with length <= 0} { run {string compare -nocase -length -1 abcde AbCdEf} } -1 test string-2.19.$noComp {string compare -nocase with excessive length} { run {string compare -nocase -length 50 AbCdEf abcde} } 1 test string-2.20.$noComp {string compare -len unicode} { # These are strings that are 6 BYTELENGTH long, but the length # shouldn't make a different because there are actually 3 CHARS long run {string compare -len 5 ÜÜÜ ÜÜü} } -1 test string-2.21.$noComp {string compare -nocase with special index} { list [catch {run {string compare -nocase -length end-3 Abcde abxyz}} msg] $msg } {1 {expected integer but got "end-3"}} test string-2.22.$noComp {string compare, null strings} { run {string compare "" ""} } 0 test string-2.23.$noComp {string compare, null strings} { run {string compare "" foo} } -1 test string-2.24.$noComp {string compare, null strings} { run {string compare foo ""} } 1 test string-2.25.$noComp {string compare -nocase, null strings} { run {string compare -nocase "" ""} } 0 test string-2.26.$noComp {string compare -nocase, null strings} { run {string compare -nocase "" foo} } -1 test string-2.27.$noComp {string compare -nocase, null strings} { run {string compare -nocase foo ""} } 1 test string-2.28.$noComp {string compare with length, unequal strings, partial first string} { run {string compare -length 2 abc abde} } 0 test string-2.29.$noComp {string compare with length, unequal strings 2, full first string} { run {string compare -length 2 ab abde} } 0 test string-2.30.$noComp {string compare with NUL character vs. other ASCII} { # Be careful here, since UTF-8 rep comparison with memcmp() of # these puts chars in the wrong order run {string compare \x00 \x01} } -1 test string-2.31.$noComp {string compare, high bit} { run {string compare "a\x80" "a@"} } 1 test string-2.32.$noComp {string compare, high bit} { run {string compare "a\x00" "a\x01"} } -1 test string-2.33.$noComp {string compare, high bit} { run {string compare "\x00\x00" "\x00\x01"} } -1 test string-2.34.$noComp {string compare, binary equal} { run {string compare [binary format a100 0] [binary format a100 0]} } 0 test string-2.35.$noComp {string compare, binary neq} { run {string compare [binary format a100a 0 1] [binary format a100a 0 0]} } 1 test string-2.36.$noComp {string compare, binary neq unequal length} { run {string compare [binary format a20a 0 1] [binary format a100a 0 0]} } 1 test string-2.37.$noComp {string compare, big -length} { run {string compare -length 0x100000000 ab abde} } -1 test string-2.38a.$noComp {string compare empty string against byte array} { # Bug edb4b065f4 run {string compare "" [binary decode hex 00]} } -1 test string-2.38b.$noComp {string compare -length empty string against byte array} { # Bug edb4b065f4 run {string compare -length 1 "" [binary decode hex 00]} } -1 test string-2.38c.$noComp {string compare -nocase empty string against byte array} { # Bug edb4b065f4 run {string compare -nocase "" [binary decode hex 00]} } -1 test string-2.38d.$noComp {string compare empty string against byte array} { # Bug edb4b065f4 run {string compare [binary decode hex 00] ""} } 1 test string-2.38e.$noComp {string compare -length empty string against byte array} { # Bug edb4b065f4 run {string compare -length 1 [binary decode hex 00] ""} } 1 test string-2.38f.$noComp {string compare -nocase empty string against byte array} { # Bug edb4b065f4 run {string compare -nocase [binary decode hex 00] ""} } 1 # only need a few tests on equal, since it uses the same code as # string compare, but just modifies the return output test string-3.1.$noComp {string equal} { run {string equal abcde abdef} } 0 test string-3.2.$noComp {string equal} { run {string e abcde ABCDE} } 0 test string-3.3.$noComp {string equal} { run {string equal abcde abcde} } 1 test string-3.4.$noComp {string equal -nocase} { run {string equal -nocase ÜÜÜÜüüüü ÜÜÜÜÜÜÜÜ} } 1 test string-3.5.$noComp {string equal -nocase} { run {string equal -nocase abcde abdef} } 0 test string-3.6.$noComp {string equal -nocase} { run {string eq -nocase abcde ABCDE} } 1 test string-3.7.$noComp {string equal -nocase} { run {string equal -nocase abcde abcde} } 1 test string-3.8.$noComp {string equal with length, unequal strings} { run {string equal -length 2 abc abde} } 1 test string-3.9.$noComp {string equal, not enough args} { list [catch {run {string equal a}} msg] $msg } {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}} test string-3.10.$noComp {string equal, bad args} { list [catch {run {string equal a b c}} msg] $msg } {1 {bad option "a": must be -nocase or -length}} test string-3.11.$noComp {string equal, bad args} { list [catch {run {string equal -length -nocase str1 str2}} msg] $msg } {1 {expected integer but got "-nocase"}} test string-3.12.$noComp {string equal, too many args} { list [catch {run {string equal -length 10 -nocase str1 str2 str3}} msg] $msg } {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}} test string-3.13.$noComp {string equal with length unspecified} { list [catch {run {string equal -length 10 10}} msg] $msg } {1 {wrong # args: should be "string equal ?-nocase? ?-length int? string1 string2"}} test string-3.14.$noComp {string equal with length} { run {string equal -length 2 abcde abxyz} } 1 test string-3.15.$noComp {string equal with special index} { list [catch {run {string equal -length end-3 abcde abxyz}} msg] $msg } {1 {expected integer but got "end-3"}} test string-3.16.$noComp {string equal, unicode} { run {string equal ab牦 ab牧} } 0 test string-3.17.$noComp {string equal, unicode} { run {string equal Ü Ü} } 1 test string-3.18.$noComp {string equal, unicode} { run {string equal Ü ü} } 0 test string-3.19.$noComp {string equal, unicode} { run {string equal ÜÜÜüü ÜÜÜÜÜ} } 0 test string-3.20.$noComp {string equal, high bit} { # This test fails if the underlying comparison # is using signed chars instead of unsigned chars. # (like SunOS's default memcmp thus the compat/memcmp.c) run {string equal "\x80" "@"} # Nb this tests works also in utf8 space because \x80 is # translated into a 2 or more bytelength but whose first byte has # the high bit set. } 0 test string-3.21.$noComp {string equal -nocase} { run {string equal -nocase abcde Abdef} } 0 test string-3.22.$noComp {string equal, -nocase unicode} { run {string equal -nocase Ü Ü} } 1 test string-3.23.$noComp {string equal, -nocase unicode} { run {string equal -nocase ÜÜÜüü ÜÜÜÜÜ} } 1 test string-3.24.$noComp {string equal -nocase with length} { run {string equal -length 2 -nocase abcde Abxyz} } 1 test string-3.25.$noComp {string equal -nocase with length} { run {string equal -nocase -length 3 abcde Abxyz} } 0 test string-3.26.$noComp {string equal -nocase with length <= 0} { run {string equal -nocase -length -1 abcde AbCdEf} } 0 test string-3.27.$noComp {string equal -nocase with excessive length} { run {string equal -nocase -length 50 AbCdEf abcde} } 0 test string-3.28.$noComp {string equal -len unicode} { # These are strings that are 6 BYTELENGTH long, but the length # shouldn't make a different because there are actually 3 CHARS long run {string equal -len 5 ÜÜÜ ÜÜü} } 0 test string-3.29.$noComp {string equal -nocase with special index} { list [catch {run {string equal -nocase -length end-3 Abcde abxyz}} msg] $msg } {1 {expected integer but got "end-3"}} test string-3.30.$noComp {string equal, null strings} { run {string equal "" ""} } 1 test string-3.31.$noComp {string equal, null strings} { run {string equal "" foo} } 0 test string-3.32.$noComp {string equal, null strings} { run {string equal foo ""} } 0 test string-3.33.$noComp {string equal -nocase, null strings} { run {string equal -nocase "" ""} } 1 test string-3.34.$noComp {string equal -nocase, null strings} { run {string equal -nocase "" foo} } 0 test string-3.35.$noComp {string equal -nocase, null strings} { run {string equal -nocase foo ""} } 0 test string-3.36.$noComp {string equal with NUL character vs. other ASCII} { # Be careful here, since UTF-8 rep comparison with memcmp() of # these puts chars in the wrong order run {string equal \x00 \x01} } 0 test string-3.37.$noComp {string equal, high bit} { run {string equal "a\x80" "a@"} } 0 test string-3.38.$noComp {string equal, high bit} { run {string equal "a\x00" "a\x01"} } 0 test string-3.39.$noComp {string equal, high bit} { run {string equal "a\x00\x00" "a\x00\x01"} } 0 test string-3.40.$noComp {string equal, binary equal} { run {string equal [binary format a100 0] [binary format a100 0]} } 1 test string-3.41.$noComp {string equal, binary neq} { run {string equal [binary format a100a 0 1] [binary format a100a 0 0]} } 0 test string-3.42.$noComp {string equal, binary neq inequal length} { run {string equal [binary format a20a 0 1] [binary format a100a 0 0]} } 0 test string-3.43.$noComp {string equal, big -length} { run {string equal -length 0x100000000 abc def} } 0 test string-3.44.$noComp {string equal, bigger -length} -body { run {string equal -length 18446744073709551616 abc def} } -returnCodes 1 -result {integer value too large to represent} test string-3.45a.$noComp {string equal empty string against byte array} { # Bug edb4b065f4 run {string equal "" [binary decode hex 00]} } 0 test string-3.45b.$noComp {string equal -length empty string against byte array} { # Bug edb4b065f4 run {string equal -length 1 "" [binary decode hex 00]} } 0 test string-3.45c.$noComp {string equal -nocase empty string against byte array} { # Bug edb4b065f4 run {string equal -nocase "" [binary decode hex 00]} } 0 test string-3.45d.$noComp {string equal empty string against byte array} { # Bug edb4b065f4 run {string equal [binary decode hex 00] ""} } 0 test string-3.45e.$noComp {string equal -length empty string against byte array} { # Bug edb4b065f4 run {string equal -length 1 [binary decode hex 00] ""} } 0 test string-3.45f.$noComp {string equal -nocase empty string against byte array} { # Bug edb4b065f4 run {string equal -nocase [binary decode hex 00] ""} } 0 test string-4.1.$noComp {string first, not enough args} { list [catch {run {string first a}} msg] $msg } {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}} test string-4.2.$noComp {string first, bad args} { list [catch {run {string first a b c}} msg] $msg } {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}} test string-4.3.$noComp {string first, too many args} { list [catch {run {string first a b 5 d}} msg] $msg } {1 {wrong # args: should be "string first needleString haystackString ?startIndex?"}} test string-4.4.$noComp {string first} { run {string first bq abcdefgbcefgbqrs} } 12 test string-4.5.$noComp {string first} { run {string fir bcd abcdefgbcefgbqrs} } 1 test string-4.6.$noComp {string first} { run {string f b abcdefgbcefgbqrs} } 1 test string-4.7.$noComp {string first} { run {string first xxx x123xx345xxx789xxx012} } 9 test string-4.8.$noComp {string first} { run {string first "" x123xx345xxx789xxx012} } -1 test string-4.9.$noComp {string first, unicode} { run {string first x abc牦x} } 4 test string-4.10.$noComp {string first, unicode} { run {string first 牦 abc牦x} } 3 test string-4.11.$noComp {string first, start index} { run {string first 牦 abc牦x 3} } 3 test string-4.12.$noComp {string first, start index} -body { run {string first 牦 abc牦x 4} } -result -1 test string-4.13.$noComp {string first, start index} -body { run {string first 牦 abc牦x end-2} } -result 3 test string-4.14.$noComp {string first, negative start index} -body { run {string first b abc -1} } -result 1 test string-4.15.$noComp {string first, ability to two-byte encoded utf-8 chars} -body { # Test for a bug in Tcl 8.3 where test for all-single-byte-encoded # strings was incorrect, leading to an index returned by [string first] # which pointed past the end of the string. set uchar վ ;# character with two-byte encoding in utf-8 run {string first % %#$uchar$uchar#$uchar$uchar#% 3} } -result 8 test string-4.16.$noComp {string first, normal string vs pure unicode string} -body { set s hello regexp ll $s m # Representation checks are canaries run {list [representationpoke $s] [representationpoke $m] \ [string first $m $s]} } -result {{string 1} {string 0} 2} test string-4.17.$noComp {string first, corner case} -body { run {string first a aaa 4294967295} } -result -1 test string-4.18.$noComp {string first, corner case} -body { run {string first a aaa -1} } -result 0 test string-4.19.$noComp {string first, corner case} -body { run {string first a aaa end-5} } -result 0 test string-4.20.$noComp {string last, corner case} -body { run {string last a aaa 4294967295} } -result 2 test string-4.21.$noComp {string last, corner case} -body { run {string last a aaa -1} } -result -1 test string-4.22.$noComp {string last, corner case} { run {string last a aaa end-5} } -1 test string-5.1.$noComp {string index} { list [catch {run {string index}} msg] $msg } {1 {wrong # args: should be "string index string charIndex"}} test string-5.2.$noComp {string index} { list [catch {run {string index a b c}} msg] $msg } {1 {wrong # args: should be "string index string charIndex"}} test string-5.3.$noComp {string index} { run {string index abcde 0} } a test string-5.4.$noComp {string index} { run {string ind abcde 4} } e test string-5.5.$noComp {string index} { run {string index abcde 5} } {} test string-5.6.$noComp {string index} { list [catch {run {string index abcde -10}} msg] $msg } {0 {}} test string-5.7.$noComp {string index} { list [catch {run {string index a xyz}} msg] $msg } {1 {bad index "xyz": must be integer?[+-]integer? or end?[+-]integer?}} test string-5.8.$noComp {string index} { run {string index abc end} } c test string-5.9.$noComp {string index} { run {string index abc end-1} } b test string-5.10.$noComp {string index, unicode} { run {string index abc牦d 4} } d test string-5.11.$noComp {string index, unicode} { run {string index abc牦d 3} } 牦 test string-5.12.$noComp {string index, unicode over char length, under byte length} -body { run {string index ÜüÜü 6} } -result {} test string-5.13.$noComp {string index, bytearray object} { run {string index [binary format a5 fuz] 0} } f test string-5.14.$noComp {string index, bytearray object} { run {string index [binary format I* {0x50515253 0x52}] 3} } S test string-5.15.$noComp {string index, bytearray object} { set b [binary format I* {0x50515253 0x52}] set i1 [run {string index $b end-6}] set i2 [run {string index $b 1}] run {string compare $i1 $i2} } 0 test string-5.16.$noComp {string index, bytearray object with string obj shimmering} { set str "0123456789\x00 abcdedfghi" binary scan $str H* dump run {string compare [run {string index $str 10}] \x00} } 0 test string-5.17.$noComp {string index, bad integer} -body { list [catch {run {string index "abc" 0o8}} msg] $msg } -match glob -result {1 {*}} test string-5.18.$noComp {string index, bad integer} -body { list [catch {run {string index "abc" end-0o0289}} msg] $msg } -match glob -result {1 {*}} test string-5.19.$noComp {string index, bytearray object out of bounds} { run {string index [binary format I* {0x50515253 0x52}] -1} } {} test string-5.20.$noComp {string index, bytearray object out of bounds} -body { run {string index [binary format I* {0x50515253 0x52}] 20} } -result {} test string-5.21.$noComp {string index, surrogates, bug [11ae2be95dac9417]} -body { run {list [string index a\U100000b 1] [string index a\U100000b 2] [string index a\U100000b 3]} } -result [list \U100000 b {}] test string-5.22.$noComp {string index} -constraints testbytestring -body { run {list [scan [string index [testbytestring \xFF] 0] %c var] $var} } -result {1 255} test string-6.1.$noComp {string is, not enough args} { list [catch {run {string is}} msg] $msg } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}} test string-6.2.$noComp {string is, not enough args} { list [catch {run {string is alpha}} msg] $msg } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}} test string-6.3.$noComp {string is, bad args} { list [catch {run {string is alpha -failin str}} msg] $msg } {1 {wrong # args: should be "string is alpha ?-strict? ?-failindex var? str"}} test string-6.4.$noComp {string is, too many args} { list [catch {run {string is alpha -failin var -strict str more}} msg] $msg } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}} test string-6.5.$noComp {string is, class check} { list [catch {run {string is bogus str}} msg] $msg } {1 {bad class "bogus": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}} test string-6.6.$noComp {string is, ambiguous class} { list [catch {run {string is al str}} msg] $msg } {1 {ambiguous class "al": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}} test string-6.7.$noComp {string is alpha, all ok} { run {string is alpha -strict -failindex var abc} } 1 test string-6.8.$noComp {string is, error in var} { list [run {string is alpha -failindex var abc5def}] $var } {0 3} test string-6.9.$noComp {string is, var shouldn't get set} { catch {unset var} list [catch {run {string is alpha -failindex var abc; set var}} msg] $msg } {1 {can't read "var": no such variable}} test string-6.10.$noComp {string is, ok on empty} { run {string is alpha {}} } 1 test string-6.11.$noComp {string is, -strict check against empty} { run {string is alpha -strict {}} } 0 test string-6.12.$noComp {string is alnum, true} { run {string is alnum abc123} } 1 test string-6.13.$noComp {string is alnum, false} { list [run {string is alnum -failindex var abc1.23}] $var } {0 4} test string-6.14.$noComp {string is alnum, unicode} "run {string is alnum abcü}" 1 test string-6.15.$noComp {string is alpha, true} { run {string is alpha abc} } 1 test string-6.16.$noComp {string is alpha, false} { list [run {string is alpha -fail var a1bcde}] $var } {0 1} test string-6.17.$noComp {string is alpha, unicode} { run {string is alpha abcü} } 1 test string-6.18.$noComp {string is ascii, true} { run {string is ascii abc\x7Fend\x00} } 1 test string-6.19.$noComp {string is ascii, false} { list [run {string is ascii -fail var abc\x00def\x80more}] $var } {0 7} test string-6.20.$noComp {string is boolean, true} { run {string is boolean true} } 1 test string-6.21.$noComp {string is boolean, true} { run {string is boolean f} } 1 test string-6.22.$noComp {string is boolean, true based on type} { run {string is bool [run {string compare a a}]} } 1 test string-6.23.$noComp {string is boolean, false} { list [run {string is bool -fail var yada}] $var } {0 0} test string-6.24.$noComp {string is digit, true} { run {string is digit 0123456789} } 1 test string-6.25.$noComp {string is digit, false} { list [run {string is digit -fail var 0123Ü567}] $var } {0 4} test string-6.26.$noComp {string is digit, false} { list [run {string is digit -fail var +123567}] $var } {0 0} test string-6.27.$noComp {string is double, true} { run {string is double 1} } 1 test string-6.28.$noComp {string is double, true} { run {string is double [expr {double(1)}]} } 1 test string-6.29.$noComp {string is double, true} { run {string is double 1.0} } 1 test string-6.30.$noComp {string is double, true} { run {string is double [run {string compare a a}]} } 1 test string-6.31.$noComp {string is double, true} { run {string is double " +1.0e-1 "} } 1 test string-6.32.$noComp {string is double, true} { run {string is double "\n1.0\v"} } 1 test string-6.33.$noComp {string is double, false} { list [run {string is double -fail var 1abc}] $var } {0 1} test string-6.34.$noComp {string is double, false} { list [run {string is double -fail var abc}] $var } {0 0} test string-6.35.$noComp {string is double, false} { list [run {string is double -fail var " 1.0e4e4 "}] $var } {0 8} test string-6.36.$noComp {string is double, false} { list [run {string is double -fail var "\n"}] $var } {0 0} test string-6.37.$noComp {string is double, false on int overflow} -setup { set var priorValue } -body { # Make it the largest int recognizable, with one more digit for overflow # Since bignums arrived in Tcl 8.5, the sense of this test changed. # Now integer values that exceed native limits become bignums, and # bignums can convert to doubles without error. list [run {string is double -fail var 9223372036854775808}] $var } -result {1 priorValue} # string-6.38 removed, underflow on input is no longer an error. test string-6.39.$noComp {string is double, false} { # This test is non-portable because IRIX thinks # that .e1 is a valid double - this is really a bug # on IRIX as .e1 should NOT be a valid double # # Portable now. Tcl 8.5 does its own double parsing. list [run {string is double -fail var .e1}] $var } {0 0} test string-6.40.$noComp {string is false, true} { run {string is false false} } 1 test string-6.41.$noComp {string is false, true} { run {string is false FaLsE} } 1 test string-6.42.$noComp {string is false, true} { run {string is false N} } 1 test string-6.43.$noComp {string is false, true} { run {string is false 0} } 1 test string-6.44.$noComp {string is false, true} { run {string is false off} } 1 test string-6.45.$noComp {string is false, false} { list [run {string is false -fail var abc}] $var } {0 0} test string-6.46.$noComp {string is false, false} { catch {unset var} list [run {string is false -fail var Y}] $var } {0 0} test string-6.47.$noComp {string is false, false} { catch {unset var} list [run {string is false -fail var offensive}] $var } {0 0} test string-6.48.$noComp {string is integer, true} { run {string is integer +1234567890} } 1 test string-6.49.$noComp {string is integer, true on type} { run {string is integer [expr {int(50.0)}]} } 1 test string-6.50.$noComp {string is integer, true} { run {string is integer [list -10]} } 1 test string-6.51.$noComp {string is integer, true as hex} { run {string is integer 0xabcdef} } 1 test string-6.52.$noComp {string is integer, true as octal} { run {string is integer 012345} } 1 test string-6.53.$noComp {string is integer, true with whitespace} { run {string is integer " \n1234\v"} } 1 test string-6.54.$noComp {string is integer, false} { list [run {string is integer -fail var 123abc}] $var } {0 3} test string-6.55.$noComp {string is integer, no overflow possible} { run {string is integer +9223372036854775808} } 1 test string-6.56.$noComp {string is integer, false} { list [run {string is integer -fail var [expr {double(1)}]}] $var } {0 1} test string-6.57.$noComp {string is integer, false} { list [run {string is integer -fail var " "}] $var } {0 0} test string-6.58.$noComp {string is integer, false on bad octal} { list [run {string is integer -fail var 0o36963}] $var } {0 4} test string-6.58.1.$noComp {string is integer, false on bad octal} { list [run {string is integer -fail var 0o36963}] $var } {0 4} test string-6.59.$noComp {string is integer, false on bad hex} { list [run {string is integer -fail var 0X345XYZ}] $var } {0 5} test string-6.60.$noComp {string is lower, true} { run {string is lower abc} } 1 test string-6.61.$noComp {string is lower, unicode true} { run {string is lower abcüue} } 1 test string-6.62.$noComp {string is lower, false} { list [run {string is lower -fail var aBc}] $var } {0 1} test string-6.63.$noComp {string is lower, false} { list [run {string is lower -fail var abc1}] $var } {0 3} test string-6.64.$noComp {string is lower, unicode false} { list [run {string is lower -fail var abÜUE}] $var } {0 2} test string-6.65.$noComp {string is space, true} { run {string is space " \t\n\v\f"} } 1 test string-6.66.$noComp {string is space, false} { list [run {string is space -fail var " \t\n\v1\f"}] $var } {0 4} test string-6.67.$noComp {string is true, true} { run {string is true true} } 1 test string-6.68.$noComp {string is true, true} { run {string is true TrU} } 1 test string-6.69.$noComp {string is true, true} { run {string is true ye} } 1 test string-6.70.$noComp {string is true, true} { run {string is true 1} } 1 test string-6.71.$noComp {string is true, true} { run {string is true on} } 1 test string-6.72.$noComp {string is true, false} { list [run {string is true -fail var onto}] $var } {0 0} test string-6.73.$noComp {string is true, false} { catch {unset var} list [run {string is true -fail var 25}] $var } {0 0} test string-6.74.$noComp {string is true, false} { catch {unset var} list [run {string is true -fail var no}] $var } {0 0} test string-6.75.$noComp {string is upper, true} { run {string is upper ABC} } 1 test string-6.76.$noComp {string is upper, unicode true} { run {string is upper ABCÜUE} } 1 test string-6.77.$noComp {string is upper, false} { list [run {string is upper -fail var AbC}] $var } {0 1} test string-6.78.$noComp {string is upper, false} { list [run {string is upper -fail var AB2C}] $var } {0 2} test string-6.79.$noComp {string is upper, unicode false} { list [run {string is upper -fail var ABCüue}] $var } {0 3} test string-6.80.$noComp {string is wordchar, true} { run {string is wordchar abc_123} } 1 test string-6.81.$noComp {string is wordchar, unicode true} { run {string is wordchar abcüabÜAB倁\U1D7CA} } 1 test string-6.82.$noComp {string is wordchar, false} { list [run {string is wordchar -fail var abcd.ef}] $var } {0 4} test string-6.83.$noComp {string is wordchar, unicode false} { list [run {string is wordchar -fail var abc\x80def}] $var } {0 3} test string-6.84.$noComp {string is control} { ## Control chars are in the ranges ## 00..1F && 7F..9F list [run {string is control -fail var \x00\x01\x10\x1F\x7F\x80\x9F\x60}] $var } {0 7} test string-6.85.$noComp {string is control} { run {string is control \u0100} } 0 test string-6.86.$noComp {string is graph} { ## graph is any print char, except space list [run {string is gra -fail var "0123abc!@#\$\u0100\UE0100\UE01EF "}] $var } {0 14} test string-6.87.$noComp {string is print} { ## basically any printable char list [run {string is print -fail var "0123abc!@#\$\u0100 \UE0100\UE01EF\x10"}] $var } {0 15} test string-6.88.$noComp {string is punct} { ## any graph char that isn't alnum list [run {string is punct -fail var "_!@#\xBEq0"}] $var } {0 4} test string-6.89.$noComp {string is xdigit} { list [run {string is xdigit -fail var 0123456789\x61bcdefABCDEFg}] $var } {0 22} test string-6.90.$noComp {string is integer, bad integers} { # SF bug #634856 set result "" set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"] foreach num $numbers { lappend result [run {string is int -strict $num}] } return $result } {1 1 0 0 0 1 0 0} test string-6.91.$noComp {string is double, bad doubles} { set result "" set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"] foreach num $numbers { lappend result [run {string is double -strict $num}] } return $result } {1 1 0 0 0 1 0 0} test string-6.92.$noComp {string is integer, no 64-bit overflow} { # Bug 718878 set x 0x10000000000000000 run {string is integer $x} } 1 test string-6.93.$noComp {string is integer, no 64-bit overflow} { # Bug 718878 set x 0x10000000000000000 append x "" run {string is integer $x} } 1 test string-6.94.$noComp {string is integer, no 64-bit overflow} { # Bug 718878 set x 0x10000000000000000 run {string is integer [expr {$x}]} } 1 test string-6.95.$noComp {string is wideinteger, true} { run {string is wideinteger +1234567890} } 1 test string-6.96.$noComp {string is wideinteger, true on type} { run {string is wideinteger [expr {wide(50.0)}]} } 1 test string-6.97.$noComp {string is wideinteger, true} { run {string is wideinteger [list -10]} } 1 test string-6.98.$noComp {string is wideinteger, true as hex} { run {string is wideinteger 0xabcdef} } 1 test string-6.99.$noComp {string is wideinteger, true as octal} { run {string is wideinteger 0123456} } 1 test string-6.100.$noComp {string is wideinteger, true with whitespace} { run {string is wideinteger " \n1234\v"} } 1 test string-6.101.$noComp {string is wideinteger, false} { list [run {string is wideinteger -fail var 123abc}] $var } {0 3} test string-6.102.$noComp {string is wideinteger, false on overflow} { list [run {string is wideinteger -fail var +9223372036854775808}] $var } {0 -1} test string-6.103.$noComp {string is wideinteger, false} { list [run {string is wideinteger -fail var [expr {double(1)}]}] $var } {0 1} test string-6.104.$noComp {string is wideinteger, false} { list [run {string is wideinteger -fail var " "}] $var } {0 0} test string-6.105.$noComp {string is wideinteger, false on bad octal} { list [run {string is wideinteger -fail var 0o36963}] $var } {0 4} test string-6.105.1.$noComp {string is wideinteger, false on bad octal} { list [run {string is wideinteger -fail var 0o36963}] $var } {0 4} test string-6.106.$noComp {string is wideinteger, false on bad hex} { list [run {string is wideinteger -fail var 0X345XYZ}] $var } {0 5} test string-6.107.$noComp {string is integer, bad integers} { # SF bug #634856 set result "" set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"] foreach num $numbers { lappend result [run {string is wideinteger -strict $num}] } return $result } {1 1 0 0 0 1 0 0} test string-6.108.$noComp {string is double, Bug 1382287} { set x 2turtledoves run {string is double $x} run {string is double $x} } 0 test string-6.109.$noComp {string is double, Bug 1360532} { run {string is double 1\xA0} } 0 test string-6.110.$noComp {string is entier, true} { run {string is entier +1234567890} } 1 test string-6.111.$noComp {string is entier, true on type} { run {string is entier [expr {wide(50.0)}]} } 1 test string-6.112.$noComp {string is entier, true} { run {string is entier [list -10]} } 1 test string-6.113.$noComp {string is entier, true as hex} { run {string is entier 0xabcdef} } 1 test string-6.114.$noComp {string is entier, true as octal} { run {string is entier 0123456} } 1 test string-6.115.$noComp {string is entier, true with whitespace} { run {string is entier " \n1234\v"} } 1 test string-6.116.$noComp {string is entier, false} { list [run {string is entier -fail var 123abc}] $var } {0 3} test string-6.117.$noComp {string is entier, false} { list [run {string is entier -fail var 123123123123123123123123123123123123123123123123123123123123123123123123123123123123abc}] $var } {0 84} test string-6.118.$noComp {string is entier, false} { list [run {string is entier -fail var [expr {double(1)}]}] $var } {0 1} test string-6.119.$noComp {string is entier, false} { list [run {string is entier -fail var " "}] $var } {0 0} test string-6.120.$noComp {string is entier, false on bad octal} { list [run {string is entier -fail var 0o36963}] $var } {0 4} test string-6.121.1.$noComp {string is entier, false on bad octal} { list [run {string is entier -fail var 0o36963}] $var } {0 4} test string-6.122.$noComp {string is entier, false on bad hex} { list [run {string is entier -fail var 0X345XYZ}] $var } {0 5} test string-6.123.$noComp {string is entier, bad integers} { # SF bug #634856 set result "" set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1"] foreach num $numbers { lappend result [run {string is entier -strict $num}] } return $result } {1 1 0 0 0 1 0 0} test string-6.124.$noComp {string is entier, true} { run {string is entier +1234567890123456789012345678901234567890} } 1 test string-6.125.$noComp {string is entier, true} { run {string is entier [list -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000]} } 1 test string-6.126.$noComp {string is entier, true as hex} { run {string is entier 0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef} } 1 test string-6.127.$noComp {string is entier, true as octal} { run {string is entier 0123456112341234561234565623456123456123456123456123456123456123456123456123456123456} } 1 test string-6.128.$noComp {string is entier, true with whitespace} { run {string is entier " \n12340000000000000000000000000000000000000000000000000000000000000000000000000000000000000\v"} } 1 test string-6.129.$noComp {string is entier, false on bad octal} { list [run {string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963}] $var } {0 87} test string-6.130.1.$noComp {string is entier, false on bad octal} { list [run {string is entier -fail var 0o1234561123412345612345656234561234561234561234561234561234561234561234561234561234536963}] $var } {0 87} test string-6.131.$noComp {string is entier, false on bad hex} { list [run {string is entier -fail var 0X12345611234123456123456562345612345612345612345612345612345612345612345612345612345345XYZ}] $var } {0 88} test string-6.139.$noComp {string is integer, bug [76ad7aeba3]} { run {string is integer 18446744073709551615} } 1 test string-6.140.$noComp {string is integer, bug [76ad7aeba3]} { run {string is integer -18446744073709551615} } 1 test string-7.1.$noComp {string last, not enough args} { list [catch {run {string last a}} msg] $msg } {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}} test string-7.2.$noComp {string last, bad args} { list [catch {run {string last a b c}} msg] $msg } {1 {bad index "c": must be integer?[+-]integer? or end?[+-]integer?}} test string-7.3.$noComp {string last, too many args} { list [catch {run {string last a b c d}} msg] $msg } {1 {wrong # args: should be "string last needleString haystackString ?lastIndex?"}} test string-7.4.$noComp {string last} { run {string la xxx xxxx123xx345x678} } 1 test string-7.5.$noComp {string last} { run {string last xx xxxx123xx345x678} } 7 test string-7.6.$noComp {string last} { run {string las x xxxx123xx345x678} } 12 test string-7.7.$noComp {string last, unicode} { run {string las x xxxx12牦xx345x678} } 12 test string-7.8.$noComp {string last, unicode} { run {string las 牦 xxxx12牦xx345x678} } 6 test string-7.9.$noComp {string last, stop index} { run {string las 牦 xxxx12牦xx345x678} } 6 test string-7.10.$noComp {string last, unicode} { run {string las 牦 xxxx12牦xx345x678} } 6 test string-7.11.$noComp {string last, start index} { run {string last 牦 abc牦x 3} } 3 test string-7.12.$noComp {string last, start index} { run {string last 牦 abc牦x 2} } -1 test string-7.13.$noComp {string last, start index} { ## Constrain to last 'a' should work run {string last ba badbad end-1} } 3 test string-7.14.$noComp {string last, start index} { ## Constrain to last 'b' should skip last 'ba' run {string last ba badbad end-2} } 0 test string-7.15.$noComp {string last, start index} { run {string last Üa ÜadÜad 0} } -1 test string-7.16.$noComp {string last, start index} { run {string last Üa ÜadÜad end-1} } 3 test string-9.1.$noComp {string length} { list [catch {run {string length}} msg] $msg } {1 {wrong # args: should be "string length string"}} test string-9.2.$noComp {string length} { list [catch {run {string length a b}} msg] $msg } {1 {wrong # args: should be "string length string"}} test string-9.3.$noComp {string length} { run {string length "a little string"} } 15 test string-9.4.$noComp {string length} { run {string le ""} } 0 test string-9.5.$noComp {string length, unicode} { run {string le "abcd牦"} } 5 test string-9.6.$noComp {string length, bytearray object} { run {string length [binary format a5 foo]} } 5 test string-9.7.$noComp {string length, bytearray object} { run {string length [binary format I* {0x50515253 0x52}]} } 8 test string-10.1.$noComp {string map, not enough args} { list [catch {run {string map}} msg] $msg } {1 {wrong # args: should be "string map ?-nocase? charMap string"}} test string-10.2.$noComp {string map, bad args} { list [catch {run {string map {a b} abba oops}} msg] $msg } {1 {bad option "a b": must be -nocase}} test string-10.3.$noComp {string map, too many args} { list [catch {run {string map -nocase {a b} str1 str2}} msg] $msg } {1 {wrong # args: should be "string map ?-nocase? charMap string"}} test string-10.4.$noComp {string map} { run {string map {a b} abba} } bbbb test string-10.5.$noComp {string map} { run {string map {a b} a} } b test string-10.6.$noComp {string map -nocase} { run {string map -nocase {a b} Abba} } bbbb test string-10.7.$noComp {string map} { run {string map {abc 321 ab * a A} aabcabaababcab} } {A321*A*321*} test string-10.8.$noComp {string map -nocase} { run {string map -nocase {aBc 321 Ab * a A} aabcabaababcab} } {A321*A*321*} test string-10.9.$noComp {string map -nocase} { run {string map -no {abc 321 Ab * a A} aAbCaBaAbAbcAb} } {A321*A*321*} test string-10.10.$noComp {string map} { list [catch {run {string map {a b c} abba}} msg] $msg } {1 {char map list unbalanced}} test string-10.11.$noComp {string map, nulls} { run {string map {\x00 NULL blah \x00nix} {qwerty}} } qwerty test string-10.12.$noComp {string map, unicode} { run {string map [list ü ue UE Ü] "aüueUE\x00EU"} } aueueÜ\x00EU test string-10.13.$noComp {string map, -nocase unicode} { run {string map -nocase [list ü ue UE Ü] "aüueUE\x00EU"} } aueÜÜ\x00EU test string-10.14.$noComp {string map, -nocase null arguments} { run {string map -nocase {{} abc} foo} } foo test string-10.15.$noComp {string map, one pair case} { run {string map -nocase {abc 32} aAbCaBaAbAbcAb} } a32aBaAb32Ab test string-10.16.$noComp {string map, one pair case} { run {string map -nocase {ab 4321} aAbCaBaAbAbcAb} } a4321C4321a43214321c4321 test string-10.17.$noComp {string map, one pair case} { run {string map {Ab 4321} aAbCaBaAbAbcAb} } a4321CaBa43214321c4321 test string-10.18.$noComp {string map, empty argument} { run {string map -nocase {{} abc} foo} } foo test string-10.19.$noComp {string map, empty arguments} { run {string map -nocase {{} abc f bar {} def} foo} } baroo test string-10.20.$noComp {string map, dictionaries don't alter map ordering} { set map {aa X a Y} list [run {string map [dict create aa X a Y] aaa}] [run {string map $map aaa}] [dict size $map] [run {string map $map aaa}] } {XY XY 2 XY} test string-10.20.1.$noComp {string map, dictionaries don't alter map ordering} { set map {a X b Y a Z} list [run {string map [dict create a X b Y a Z] aaa}] [run {string map $map aaa}] [dict size $map] [run {string map $map aaa}] } {ZZZ XXX 2 XXX} test string-10.21.$noComp {string map, ABR checks} { run {string map {longstring foob} long} } long test string-10.22.$noComp {string map, ABR checks} { run {string map {long foob} long} } foob test string-10.23.$noComp {string map, ABR checks} { run {string map {lon foob} long} } foobg test string-10.24.$noComp {string map, ABR checks} { run {string map {lon foob} longlo} } foobglo test string-10.25.$noComp {string map, ABR checks} { run {string map {lon foob} longlon} } foobgfoob test string-10.26.$noComp {string map, ABR checks} { run {string map {longstring foob longstring bar} long} } long test string-10.27.$noComp {string map, ABR checks} { run {string map {long foob longstring bar} long} } foob test string-10.28.$noComp {string map, ABR checks} { run {string map {lon foob longstring bar} long} } foobg test string-10.29.$noComp {string map, ABR checks} { run {string map {lon foob longstring bar} longlo} } foobglo test string-10.30.$noComp {string map, ABR checks} { run {string map {lon foob longstring bar} longlon} } foobgfoob test string-10.31.$noComp {string map, nasty sharing crash from [Bug 1018562]} { set a {a b} run {string map $a $a} } {b b} test string-11.1.$noComp {string match, not enough args} { list [catch {run {string match a}} msg] $msg } {1 {wrong # args: should be "string match ?-nocase? pattern string"}} test string-11.2.$noComp {string match, too many args} { list [catch {run {string match a b c d}} msg] $msg } {1 {wrong # args: should be "string match ?-nocase? pattern string"}} test string-11.3.$noComp {string match} { run {string match abc abc} } 1 test string-11.4.$noComp {string match} { run {string mat abc abd} } 0 test string-11.5.$noComp {string match} { run {string match ab*c abc} } 1 test string-11.6.$noComp {string match} { run {string match ab**c abc} } 1 test string-11.7.$noComp {string match} { run {string match ab* abcdef} } 1 test string-11.8.$noComp {string match} { run {string match *c abc} } 1 test string-11.9.$noComp {string match} { run {string match *3*6*9 0123456789} } 1 test string-11.9.1.$noComp {string match} { run {string match *3*6*89 0123456789} } 1 test string-11.9.2.$noComp {string match} { run {string match *3*456*89 0123456789} } 1 test string-11.9.3.$noComp {string match} { run {string match *3*6* 0123456789} } 1 test string-11.9.4.$noComp {string match} { run {string match *3*56* 0123456789} } 1 test string-11.9.5.$noComp {string match} { run {string match *3*456*** 0123456789} } 1 test string-11.9.6.$noComp {string match} { run {string match **3*456** 0123456789} } 1 test string-11.9.7.$noComp {string match} { run {string match *3***456* 0123456789} } 1 test string-11.9.8.$noComp {string match} { run {string match *3***\[456]* 0123456789} } 1 test string-11.9.9.$noComp {string match} { run {string match *3***\[4-6]* 0123456789} } 1 test string-11.9.10.$noComp {string match} { run {string match *3***\[4-6] 0123456789} } 0 test string-11.9.11.$noComp {string match} { run {string match *3***\[4-6] 0123456} } 1 test string-11.10.$noComp {string match} { run {string match *3*6*9 01234567890} } 0 test string-11.10.1.$noComp {string match} { run {string match *3*6*89 01234567890} } 0 test string-11.10.2.$noComp {string match} { run {string match *3*456*89 01234567890} } 0 test string-11.10.3.$noComp {string match} { run {string match **3*456*89 01234567890} } 0 test string-11.10.4.$noComp {string match} { run {string match *3*456***89 01234567890} } 0 test string-11.11.$noComp {string match} { run {string match a?c abc} } 1 test string-11.12.$noComp {string match} { run {string match a??c abc} } 0 test string-11.13.$noComp {string match} { run {string match ?1??4???8? 0123456789} } 1 test string-11.14.$noComp {string match} { run {string match {[abc]bc} abc} } 1 test string-11.15.$noComp {string match} { run {string match {a[abc]c} abc} } 1 test string-11.16.$noComp {string match} { run {string match {a[xyz]c} abc} } 0 test string-11.17.$noComp {string match} { run {string match {12[2-7]45} 12345} } 1 test string-11.18.$noComp {string match} { run {string match {12[ab2-4cd]45} 12345} } 1 test string-11.19.$noComp {string match} { run {string match {12[ab2-4cd]45} 12b45} } 1 test string-11.20.$noComp {string match} { run {string match {12[ab2-4cd]45} 12d45} } 1 test string-11.21.$noComp {string match} { run {string match {12[ab2-4cd]45} 12145} } 0 test string-11.22.$noComp {string match} { run {string match {12[ab2-4cd]45} 12545} } 0 test string-11.23.$noComp {string match} { run {string match {a\*b} a*b} } 1 test string-11.24.$noComp {string match} { run {string match {a\*b} ab} } 0 test string-11.25.$noComp {string match} { run {string match {a\*\?\[\]\\\x} "a*?\[\]\\x"} } 1 test string-11.26.$noComp {string match} { run {string match ** ""} } 1 test string-11.27.$noComp {string match} { run {string match *. ""} } 0 test string-11.28.$noComp {string match} { run {string match "" ""} } 1 test string-11.29.$noComp {string match} { run {string match \[a a} } 1 test string-11.30.$noComp {string match, bad args} { list [catch {run {string match - b c}} msg] $msg } {1 {bad option "-": must be -nocase}} test string-11.31.$noComp {string match case} { run {string match a A} } 0 test string-11.32.$noComp {string match nocase} { run {string match -n a A} } 1 test string-11.33.$noComp {string match nocase} { run {string match -nocase aÜ Aü} } 1 test string-11.34.$noComp {string match nocase} { run {string match -nocase a*f ABCDEf} } 1 test string-11.35.$noComp {string match case, false hope} { # This is true because '_' lies between the A-Z and a-z ranges run {string match {[A-z]} _} } 1 test string-11.36.$noComp {string match nocase range} { # This is false because although '_' lies between the A-Z and a-z ranges, # we lower case the end points before checking the ranges. run {string match -nocase {[A-z]} _} } 0 test string-11.37.$noComp {string match nocase} { run {string match -nocase {[A-fh-Z]} g} } 0 test string-11.38.$noComp {string match case, reverse range} { run {string match {[A-fh-Z]} g} } 1 test string-11.39.$noComp {string match, *\ case} { run {string match {*\abc} abc} } 1 test string-11.39.1.$noComp {string match, *\ case} { run {string match {*ab\c} abc} } 1 test string-11.39.2.$noComp {string match, *\ case} { run {string match {*ab\*} ab*} } 1 test string-11.39.3.$noComp {string match, *\ case} { run {string match {*ab\*} abc} } 0 test string-11.39.4.$noComp {string match, *\ case} { run {string match {*ab\\*} {ab\c}} } 1 test string-11.39.5.$noComp {string match, *\ case} { run {string match {*ab\\*} {ab\*}} } 1 test string-11.40.$noComp {string match, *special case} { run {string match {*[ab]} abc} } 0 test string-11.41.$noComp {string match, *special case} { run {string match {*[ab]*} abc} } 1 test string-11.42.$noComp {string match, *special case} { run {string match "*\\" "\\"} } 0 test string-11.43.$noComp {string match, *special case} { run {string match "*\\\\" "\\"} } 1 test string-11.44.$noComp {string match, *special case} { run {string match "*???" "12345"} } 1 test string-11.45.$noComp {string match, *special case} { run {string match "*???" "12"} } 0 test string-11.46.$noComp {string match, *special case} { run {string match "*\\*" "abc*"} } 1 test string-11.47.$noComp {string match, *special case} { run {string match "*\\*" "*"} } 1 test string-11.48.$noComp {string match, *special case} { run {string match "*\\*" "*abc"} } 0 test string-11.49.$noComp {string match, *special case} { run {string match "?\\*" "a*"} } 1 test string-11.50.$noComp {string match, *special case} { run {string match "\\" "\\"} } 0 test string-11.51.$noComp {string match; *, -nocase and UTF-8} { run {string match -nocase [binary format I 717316707] \ [binary format I 2028036707]} } 1 test string-11.52.$noComp {string match, null char in string} { set out "" set ptn "*abc*" foreach elem [list "\x00@abc" "@abc" "\x00@abc\x00" "blahabcblah"] { lappend out [run {string match $ptn $elem}] } set out } {1 1 1 1} test string-11.53.$noComp {string match, null char in pattern} { set out "" foreach {ptn elem} [list \ "*\x00abc\x00" "\x00abc\x00" \ "*\x00abc\x00" "\x00abc\x00ef" \ "*\x00abc\x00*" "\x00abc\x00ef" \ "*\x00abc\x00" "@\x00abc\x00ef" \ "*\x00abc\x00*" "@\x00abc\x00ef" \ ] { lappend out [run {string match $ptn $elem}] } set out } {1 0 1 0 1} test string-11.54.$noComp {string match, failure} { set longString "" for {set i 0} {$i < 10} {incr i} { append longString "abcdefghijklmnopqrstuvwxy\x00z01234567890123" } run {string first $longString 123} list [run {string match *cba* $longString}] \ [run {string match *a*l*\x00* $longString}] \ [run {string match *a*l*\x00*123 $longString}] \ [run {string match *a*l*\x00*123* $longString}] \ [run {string match *a*l*\x00*cba* $longString}] \ [run {string match *===* $longString}] } {0 1 1 1 0 0} test string-11.55.$noComp {string match, invalid binary optimization} { [format string] match \u0141 [binary format c 65] } 0 test stringComp-12.1.0.$noComp {Bug 3588366: end-offsets before start} { apply {s { string range $s 0 end-5 }} 12345 } {} test string-12.1.$noComp {string range} { list [catch {run {string range}} msg] $msg } {1 {wrong # args: should be "string range string first last"}} test string-12.2.$noComp {string range} { list [catch {run {string range a 1}} msg] $msg } {1 {wrong # args: should be "string range string first last"}} test string-12.3.$noComp {string range} { list [catch {run {string range a 1 2 3}} msg] $msg } {1 {wrong # args: should be "string range string first last"}} test string-12.4.$noComp {string range} { run {string range abcdefghijklmnop 2 14} } {cdefghijklmno} test string-12.5.$noComp {string range, last > length} { run {string range abcdefghijklmnop 7 1000} } {hijklmnop} test string-12.6.$noComp {string range} { run {string range abcdefghijklmnop 10 end} } {klmnop} test string-12.7.$noComp {string range, last < first} { run {string range abcdefghijklmnop 10 9} } {} test string-12.8.$noComp {string range, first < 0} { run {string range abcdefghijklmnop -3 2} } {abc} test string-12.9.$noComp {string range} { run {string range abcdefghijklmnop -3 -2} } {} test string-12.10.$noComp {string range} { run {string range abcdefghijklmnop 1000 1010} } {} test string-12.11.$noComp {string range} { run {string range abcdefghijklmnop -100 end} } {abcdefghijklmnop} test string-12.12.$noComp {string range} { list [catch {run {string range abc abc 1}} msg] $msg } {1 {bad index "abc": must be integer?[+-]integer? or end?[+-]integer?}} test string-12.13.$noComp {string range} { list [catch {run {string range abc 1 eof}} msg] $msg } {1 {bad index "eof": must be integer?[+-]integer? or end?[+-]integer?}} test string-12.14.$noComp {string range} { run {string range abcdefghijklmnop end-1 end} } {op} test string-12.15.$noComp {string range} { run {string range abcdefghijklmnop end 1000} } {p} test string-12.16.$noComp {string range} { run {string range abcdefghijklmnop end end-1} } {} test string-12.17.$noComp {string range, unicode} { run {string range ab牦cdefghijklmnop 5 5} } e test string-12.18.$noComp {string range, unicode} { run {string range ab牦cdefghijklmnop 2 3} } 牦c test string-12.19.$noComp {string range, bytearray object} { set b [binary format I* {0x50515253 0x52}] set r1 [run {string range $b 1 end-1}] set r2 [run {string range $b 1 6}] run {string equal $r1 $r2} } 1 test string-12.20.$noComp {string range, out of bounds indices} { run {string range \xFF 0 1} } \xFF # Bug 1410553 test string-12.21.$noComp {string range, regenerates correct reps, bug 1410553} { set bytes "\x00 \x03 \x41" set rxBuffer {} foreach ch $bytes { append rxBuffer $ch if {$ch eq "\x03"} { run {string length $rxBuffer} } } set rxCRC [run {string range $rxBuffer end-1 end}] binary scan [join $bytes {}] "H*" input_hex binary scan $rxBuffer "H*" rxBuffer_hex binary scan $rxCRC "H*" rxCRC_hex list $input_hex $rxBuffer_hex $rxCRC_hex } {000341 000341 0341} test string-12.22.$noComp {string range, shimmering binary/index} { set s 0000000001 binary scan $s a* x run {string range $s $s end} } 000000001 test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} { run {list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]} } [list \U100000 b {}] test string-12.24.$noComp {bignum index arithmetic} -setup { proc demo {i j} {string range fubar $i $j} } -cleanup { rename demo {} } -body { demo 2 0+0x10000000000000000 } -result bar test string-12.25.$noComp {bignum index arithmetic} -setup { proc demo {i j} {string range fubar $i $j} } -cleanup { rename demo {} } -body { demo 0x10000000000000000-0xffffffffffffffff 3 } -result uba test string-13.1.$noComp {string repeat} { list [catch {run {string repeat}} msg] $msg } {1 {wrong # args: should be "string repeat string count"}} test string-13.2.$noComp {string repeat} { list [catch {run {string repeat abc 10 oops}} msg] $msg } {1 {wrong # args: should be "string repeat string count"}} test string-13.3.$noComp {string repeat} { run {string repeat {} 100} } {} test string-13.4.$noComp {string repeat} { run {string repeat { } 5} } { } test string-13.5.$noComp {string repeat} { run {string repeat abc 3} } {abcabcabc} test string-13.6.$noComp {string repeat} { run {string repeat abc -1} } {} test string-13.7.$noComp {string repeat} { list [catch {run {string repeat abc end}} msg] $msg } {1 {expected integer but got "end"}} test string-13.8.$noComp {string repeat} { run {string repeat {} -1000} } {} test string-13.9.$noComp {string repeat} { run {string repeat {} 0} } {} test string-13.10.$noComp {string repeat} { run {string repeat def 0} } {} test string-13.11.$noComp {string repeat} { run {string repeat def 1} } def test string-13.12.$noComp {string repeat} { run {string repeat ab牦cd 3} } ab牦cdab牦cdab牦cd test string-13.13.$noComp {string repeat} { run {string repeat \x00 3} } \x00\x00\x00 test string-13.14.$noComp {string repeat} { # The string range will ensure us that string repeat gets a unicode string run {string repeat [run {string range ab牦cd 2 3}] 3} } 牦c牦c牦c test string-14.1.$noComp {string replace} { list [catch {run {string replace}} msg] $msg } {1 {wrong # args: should be "string replace string first last ?string?"}} test string-14.2.$noComp {string replace} { list [catch {run {string replace a 1}} msg] $msg } {1 {wrong # args: should be "string replace string first last ?string?"}} test string-14.3.$noComp {string replace} { list [catch {run {string replace a 1 2 3 4}} msg] $msg } {1 {wrong # args: should be "string replace string first last ?string?"}} test string-14.4.$noComp {string replace} { } {} test string-14.5.$noComp {string replace} { run {string replace abcdefghijklmnop 2 14} } {abp} test string-14.6.$noComp {string replace} -body { run {string replace abcdefghijklmnop 7 1000} } -result abcdefg test string-14.7.$noComp {string replace} { run {string replace abcdefghijklmnop 10 end} } abcdefghij test string-14.8.$noComp {string replace} { run {string replace abcdefghijklmnop 10 9} } abcdefghijklmnop test string-14.9.$noComp {string replace} { run {string replace abcdefghijklmnop -3 2} } defghijklmnop test string-14.10.$noComp {string replace} { run {string replace abcdefghijklmnop -3 -2} } abcdefghijklmnop test string-14.11.$noComp {string replace} -body { run {string replace abcdefghijklmnop 1000 1010} } -result abcdefghijklmnop test string-14.12.$noComp {string replace} { run {string replace abcdefghijklmnop -100 end} } {} test string-14.13.$noComp {string replace} { list [catch {run {string replace abc abc 1}} msg] $msg } {1 {bad index "abc": must be integer?[+-]integer? or end?[+-]integer?}} test string-14.14.$noComp {string replace} { list [catch {run {string replace abc 1 eof}} msg] $msg } {1 {bad index "eof": must be integer?[+-]integer? or end?[+-]integer?}} test string-14.15.$noComp {string replace} { run {string replace abcdefghijklmnop end-10 end-2 NEW} } {abcdeNEWop} test string-14.16.$noComp {string replace} { run {string replace abcdefghijklmnop 0 end foo} } {foo} test string-14.17.$noComp {string replace} { run {string replace abcdefghijklmnop end end-1} } {abcdefghijklmnop} test string-14.18.$noComp {string replace} { run {string replace abcdefghijklmnop 10 9 XXX} } {abcdefghijklmnop} test string-14.19.$noComp {string replace} { run {string replace {} -1 0 A} } A test string-14.20.$noComp {string replace} { run {string replace [makeByteArray abcdefghijklmnop] end-10 end-2\ [makeByteArray NEW]} } {abcdeNEWop} test string-14.21.$noComp {string replace (surrogates)} { run {string replace \uD83D? 1 end \uDE02} } \uD83D\uDE02 test string-14.22.$noComp {string replace (surrogates)} { run {string replace ?\uDE02 0 end-1 \uD83D} } \uD83D\uDE02 test string-14.23.$noComp {string replace \xC0 \x80} testbytestring { run {string length [string replace [testbytestring \xC0]? 1 end [testbytestring \x80]]} } 2 test string-14.24.$noComp {string replace \xC0 \x80} testbytestring { run {string length [string replace ?[testbytestring \x80] 0 end-1 [testbytestring \xC0]]} } 2 test stringComp-14.21.$noComp {Bug 82e7f67325} { apply {x { set a [join $x {}] lappend b [string length [string replace ___! 0 2 $a]] lappend b [string length [string replace ___! 0 2 $a[unset a]]] }} {a b} } {3 3} test stringComp-14.22.$noComp {Bug 82e7f67325} memory { # As in stringComp-14.1, but make sure we don't retain too many refs leaktest { apply {x { set a [join $x {}] lappend b [string length [string replace ___! 0 2 $a]] lappend b [string length [string replace ___! 0 2 $a[unset a]]] }} {a b} } } {0} test stringComp-14.23.$noComp {Bug 0dca3bfa8f} { apply {arg { set argCopy $arg set arg [string replace $arg 1 2 aa] # Crashes in comparison before fix expr {$arg ne $argCopy} }} abcde } 1 test stringComp-14.24.$noComp {Bug 1af8de570511} { apply {{x y} { # Generate an unshared string value set val "" for { set i 0 } { $i < $x } { incr i } { set val [format "0%s" $val] } string replace $val[unset val] 1 1 $y }} 4 x } 0x00 test stringComp-14.25.$noComp {} { string length [string replace [string repeat a\xFE 2] 3 end {}] } 3 test stringComp-14.26.$noComp {} { run {string replace abcd 0x10000000000000000-0xffffffffffffffff 2 e} } aed test string-15.1.$noComp {string tolower not enough args} { list [catch {run {string tolower}} msg] $msg } {1 {wrong # args: should be "string tolower string ?first? ?last?"}} test string-15.2.$noComp {string tolower bad args} { list [catch {run {string tolower a b}} msg] $msg } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}} test string-15.3.$noComp {string tolower too many args} { list [catch {run {string tolower ABC 1 end oops}} msg] $msg } {1 {wrong # args: should be "string tolower string ?first? ?last?"}} test string-15.4.$noComp {string tolower} { run {string tolower ABCDeF} } {abcdef} test string-15.5.$noComp {string tolower} { run {string tolower "ABC XyZ"} } {abc xyz} test string-15.6.$noComp {string tolower} { run {string tolower {123#$&*()}} } {123#$&*()} test string-15.7.$noComp {string tolower} { run {string tolower ABC 1} } AbC test string-15.8.$noComp {string tolower} { run {string tolower ABC 1 end} } Abc test string-15.9.$noComp {string tolower} { run {string tolower ABC 0 end-1} } abC test string-15.10.$noComp {string tolower, unicode} { run {string tolower ABCabc\xC7\xE7} } "abcabc\xE7\xE7" test string-15.11.$noComp {string tolower, compiled} { lindex [run {string tolower [list A B [list C]]}] 1 } b test string-16.1.$noComp {string toupper} { list [catch {run {string toupper}} msg] $msg } {1 {wrong # args: should be "string toupper string ?first? ?last?"}} test string-16.2.$noComp {string toupper} { list [catch {run {string toupper a b}} msg] $msg } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}} test string-16.3.$noComp {string toupper} { list [catch {run {string toupper a 1 end oops}} msg] $msg } {1 {wrong # args: should be "string toupper string ?first? ?last?"}} test string-16.4.$noComp {string toupper} { run {string toupper abCDEf} } {ABCDEF} test string-16.5.$noComp {string toupper} { run {string toupper "abc xYz"} } {ABC XYZ} test string-16.6.$noComp {string toupper} { run {string toupper {123#$&*()}} } {123#$&*()} test string-16.7.$noComp {string toupper} { run {string toupper abc 1} } aBc test string-16.8.$noComp {string toupper} { run {string toupper abc 1 end} } aBC test string-16.9.$noComp {string toupper} { run {string toupper abc 0 end-1} } ABc test string-16.10.$noComp {string toupper, unicode} { run {string toupper ABCabc\xC7\xE7} } "ABCABC\xC7\xC7" test string-16.11.$noComp {string toupper, compiled} { lindex [run {string toupper [list a b [list c]]}] 1 } B test string-17.1.$noComp {string totitle} { list [catch {run {string totitle}} msg] $msg } {1 {wrong # args: should be "string totitle string ?first? ?last?"}} test string-17.2.$noComp {string totitle} { list [catch {run {string totitle a b}} msg] $msg } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}} test string-17.3.$noComp {string totitle} { run {string totitle abCDEf} } {Abcdef} test string-17.4.$noComp {string totitle} { run {string totitle "abc xYz"} } {Abc xyz} test string-17.5.$noComp {string totitle} { run {string totitle {123#$&*()}} } {123#$&*()} test string-17.6.$noComp {string totitle, unicode} { run {string totitle ABCabc\xC7\xE7} } "Abcabc\xE7\xE7" test string-17.7.$noComp {string totitle, unicode} { run {string totitle \u01F3BCabc\xC7\xE7} } "\u01F2bcabc\xE7\xE7" test string-17.8.$noComp {string totitle, compiled} { lindex [run {string totitle [list aa bb [list cc]]}] 0 } Aa test string-17.9.$noComp {string totitle, surrogates, bug [11ae2be95dac9417]} { run {list [string totitle a\U118c0c 1 1] [string totitle a\U118c0c 2 2] \ [string totitle a\U118c0c 3 3]} } [list a\U118a0c a\U118c0C a\U118c0c] test string-18.1.$noComp {string trim} { list [catch {run {string trim}} msg] $msg } {1 {wrong # args: should be "string trim string ?chars?"}} test string-18.2.$noComp {string trim} { list [catch {run {string trim a b c}} msg] $msg } {1 {wrong # args: should be "string trim string ?chars?"}} test string-18.3.$noComp {string trim} { run {string trim " XYZ "} } {XYZ} test string-18.4.$noComp {string trim} { run {string trim "\t\nXYZ\t\n\r\n"} } {XYZ} test string-18.5.$noComp {string trim} { run {string trim " A XYZ A "} } {A XYZ A} test string-18.6.$noComp {string trim} { run {string trim "XXYYZZABC XXYYZZ" ZYX} } {ABC } test string-18.7.$noComp {string trim} { run {string trim " \t\r "} } {} test string-18.8.$noComp {string trim} { run {string trim {abcdefg} {}} } {abcdefg} test string-18.9.$noComp {string trim} { run {string trim {}} } {} test string-18.10.$noComp {string trim} { run {string trim ABC DEF} } {ABC} test string-18.11.$noComp {string trim, unicode} { run {string trim "\xE7\xE8 AB\xE7C \xE8\xE7" \xE7\xE8} } " AB\xE7C " test string-18.12.$noComp {string trim, unicode default} { run {string trim \uFEFF\x00\x85\xA0\u1680\u180EABC\u1361\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000} } ABC\u1361 test string-19.1.$noComp {string trimleft} { list [catch {run {string trimleft}} msg] $msg } {1 {wrong # args: should be "string trimleft string ?chars?"}} test string-19.2.$noComp {string trimleft} { run {string trimleft " XYZ "} } {XYZ } test string-19.3.$noComp {string trimleft, unicode default} { run {string trimleft \uFEFF\x85\xA0\x00\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000\u1361ABC} } \u1361ABC test string-20.1.$noComp {string trimright errors} { list [catch {run {string trimright}} msg] $msg } {1 {wrong # args: should be "string trimright string ?chars?"}} test string-20.2.$noComp {string trimright errors} -body { list [catch {run {string trimg a}} msg] $msg } -result {1 {unknown or ambiguous subcommand "trimg": must be cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}} test string-20.3.$noComp {string trimright} { run {string trimright " XYZ "} } { XYZ} test string-20.4.$noComp {string trimright} { run {string trimright " "} } {} test string-20.5.$noComp {string trimright} { run {string trimright ""} } {} test string-20.6.$noComp {string trimright, unicode default} { run {string trimright ABC\u1361\x85\x00\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000} } ABC\u1361 test string-20.7.$noComp {string trim on not valid utf-8 sequence (consider NTS as continuation char), bug [c61818e4c9]} testbytestring { set result {} set a [testbytestring \xC0\x80\xA0] set b foo$a set m [list \x00 U \xA0 V [testbytestring \xA0] W] lappend result [string map $m $b] lappend result [string map $m [run {string trimright $b x}]] lappend result [string map $m [run {string trimright $b \x00}]] lappend result [string map $m [run {string trimleft $b fox}]] lappend result [string map $m [run {string trimleft $b fo\x00}]] lappend result [string map $m [run {string trim $b fox}]] lappend result [string map $m [run {string trim $b fo\x00}]] } [list {*}[lrepeat 3 fooUV] {*}[lrepeat 2 UV V]] test string-20.8.$noComp {[c61818e4c9] [string trimright] fails when UtfPrev is ok} testbytestring { set result {} set a [testbytestring \xE8\xA0] set b foo$a set m [list \xE8 U \xA0 V [testbytestring \xE8] W [testbytestring \xA0] X]] lappend result [string map $m $b] lappend result [string map $m [run {string trimright $b x}]] lappend result [string map $m [run {string trimright $b \xE8}]] lappend result [string map $m [run {string trimright $b [testbytestring \xE8]}]] lappend result [string map $m [run {string trimright $b \xA0}]] lappend result [string map $m [run {string trimright $b [testbytestring \xA0]}]] lappend result [string map $m [run {string trimright $b \xE8\xA0}]] lappend result [string map $m [run {string trimright $b [testbytestring \xE8\xA0]}]] lappend result [string map $m [run {string trimright $b \x00}]] } [list {*}[lrepeat 4 fooUV] {*}[lrepeat 2 fooU] {*}[lrepeat 2 foo] fooUV] test string-21.1.$noComp {string wordend} -body { list [catch {run {string wordend a}} msg] $msg } -result {1 {wrong # args: should be "string wordend string index"}} test string-21.2.$noComp {string wordend} -body { list [catch {run {string wordend a b c}} msg] $msg } -result {1 {wrong # args: should be "string wordend string index"}} test string-21.3.$noComp {string wordend} -body { list [catch {run {string wordend a gorp}} msg] $msg } -result {1 {bad index "gorp": must be integer?[+-]integer? or end?[+-]integer?}} test string-21.4.$noComp {string wordend} -body { run {string wordend abc. -1} } -result 3 test string-21.5.$noComp {string wordend} -body { run {string wordend abc. 100} } -result 4 test string-21.6.$noComp {string wordend} -body { run {string wordend "word_one two three" 2} } -result 8 test string-21.7.$noComp {string wordend} -body { run {string wordend "one .&# three" 5} } -result 6 test string-21.8.$noComp {string wordend} -body { run {string worde "x.y" 0} } -result 1 test string-21.9.$noComp {string wordend} -body { run {string worde "x.y" end-1} } -result 2 test string-21.10.$noComp {string wordend, unicode} -body { run {string wordend "xyz\xC7de fg" 0} } -result 6 test string-21.11.$noComp {string wordend, unicode} -body { run {string wordend "xyz\uC700de fg" 0} } -result 6 test string-21.12.$noComp {string wordend, unicode} -body { run {string wordend "xyz\u203Fde fg" 0} } -result 6 test string-21.13.$noComp {string wordend, unicode} -body { run {string wordend "xyz\u2045de fg" 0} } -result 3 test string-21.14.$noComp {string wordend, unicode} -body { run {string wordend "\uC700\uC700 abc" 8} } -result 6 test string-21.15.$noComp {string wordend, unicode} -body { run {string wordend "\U1D7CA\U1D7CA abc" 0} } -result 2 test string-21.16.$noComp {string wordend, unicode} -body { run {string wordend "\U1D7CA\U1D7CA abc" 10} } -result 6 test string-21.17.$noComp {string trim, unicode} { run {string trim "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD83D\uDE02} } "Hello world!" test string-21.18.$noComp {string trimleft, unicode} { run {string trimleft "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD83D\uDE02} } "Hello world!\uD83D\uDE02" test string-21.19.$noComp {string trimright, unicode} { run {string trimright "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD83D\uDE02} } "\uD83D\uDE02Hello world!" test string-21.20.$noComp {string trim, unicode} { run {string trim "\uF602Hello world!\uF602" \uD83D\uDE02} } "\uF602Hello world!\uF602" test string-21.21.$noComp {string trimleft, unicode} { run {string trimleft "\uF602Hello world!\uF602" \uD83D\uDE02} } "\uF602Hello world!\uF602" test string-21.22.$noComp {string trimright, unicode} { run {string trimright "\uF602Hello world!\uF602" \uD83D\uDE02} } "\uF602Hello world!\uF602" test string-21.23.$noComp {string trim, unicode} { run {string trim "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD93D} } "\uD83D\uDE02Hello world!\uD83D\uDE02" test string-21.24.$noComp {string trimleft, unicode} { run {string trimleft "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD93D\uDE02} } "\uD83D\uDE02Hello world!\uD83D\uDE02" test string-21.25.$noComp {string trimright, unicode} { run {string trimright "\uD83D\uDE02Hello world!\uD83D\uDE02" \uD93D} } "\uD83D\uDE02Hello world!\uD83D\uDE02" test string-22.1.$noComp {string wordstart} -body { list [catch {run {string word a}} msg] $msg } -result {1 {unknown or ambiguous subcommand "word": must be cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}} test string-22.2.$noComp {string wordstart} -body { list [catch {run {string wordstart a}} msg] $msg } -result {1 {wrong # args: should be "string wordstart string index"}} test string-22.3.$noComp {string wordstart} -body { list [catch {run {string wordstart a b c}} msg] $msg } -result {1 {wrong # args: should be "string wordstart string index"}} test string-22.4.$noComp {string wordstart} -body { list [catch {run {string wordstart a gorp}} msg] $msg } -result {1 {bad index "gorp": must be integer?[+-]integer? or end?[+-]integer?}} test string-22.5.$noComp {string wordstart} -body { run {string wordstart "one two three_words" 400} } -result 8 test string-22.6.$noComp {string wordstart} -body { run {string wordstart "one two three_words" 2} } -result 0 test string-22.7.$noComp {string wordstart} -body { run {string wordstart "one two three_words" -2} } -result 0 test string-22.8.$noComp {string wordstart} -body { run {string wordstart "one .*&^ three" 6} } -result 6 test string-22.9.$noComp {string wordstart} -body { run {string wordstart "one two three" 4} } -result 4 test string-22.10.$noComp {string wordstart} -body { run {string wordstart "one two three" end-5} } -result 7 test string-22.11.$noComp {string wordstart, unicode} -body { run {string wordstart "one tw\xC7o three" 7} } -result 4 test string-22.12.$noComp {string wordstart, unicode} -body { run {string wordstart "ab\uC700\uC700 cdef ghi" 12} } -result 10 test string-22.13.$noComp {string wordstart, unicode} -body { run {string wordstart "\uC700\uC700 abc" 8} } -result 3 test string-22.14.$noComp {string wordstart, invalid UTF-8} -constraints testbytestring -body { # See Bug c61818e4c9 set demo [testbytestring "abc def\xE0\xA9ghi"] run {string index $demo [string wordstart $demo 10]} } -result g test string-22.15.$noComp {string wordstart, unicode} -body { run {string wordstart "\U1D7CA\U1D7CA abc" 0} } -result 0 test string-22.16.$noComp {string wordstart, unicode} -body { run {string wordstart "\U1D7CA\U1D7CA abc" 10} } -result 3 test string-23.0.$noComp {string is boolean, Bug 1187123} testindexobj { set x 5 catch {testindexobj $x foo bar soom} run {string is boolean $x} } 0 test string-23.1.$noComp {string is command with empty string} { set s "" list \ [run {string is alnum $s}] \ [run {string is alpha $s}] \ [run {string is ascii $s}] \ [run {string is control $s}] \ [run {string is boolean $s}] \ [run {string is digit $s}] \ [run {string is double $s}] \ [run {string is false $s}] \ [run {string is graph $s}] \ [run {string is integer $s}] \ [run {string is lower $s}] \ [run {string is print $s}] \ [run {string is punct $s}] \ [run {string is space $s}] \ [run {string is true $s}] \ [run {string is upper $s}] \ [run {string is wordchar $s}] \ [run {string is xdigit $s}] \ } {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1} test string-23.2.$noComp {string is command with empty string} { set s "" list \ [run {string is alnum -strict $s}] \ [run {string is alpha -strict $s}] \ [run {string is ascii -strict $s}] \ [run {string is control -strict $s}] \ [run {string is boolean -strict $s}] \ [run {string is digit -strict $s}] \ [run {string is double -strict $s}] \ [run {string is false -strict $s}] \ [run {string is graph -strict $s}] \ [run {string is integer -strict $s}] \ [run {string is lower -strict $s}] \ [run {string is print -strict $s}] \ [run {string is punct -strict $s}] \ [run {string is space -strict $s}] \ [run {string is true -strict $s}] \ [run {string is upper -strict $s}] \ [run {string is wordchar -strict $s}] \ [run {string is xdigit -strict $s}] \ } {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} test string-24.1.$noComp {string reverse command} -body { run {string reverse} } -returnCodes error -result "wrong # args: should be \"string reverse string\"" test string-24.2.$noComp {string reverse command} -body { run {string reverse a b} } -returnCodes error -result "wrong # args: should be \"string reverse string\"" test string-24.3.$noComp {string reverse command - shared string} { set x abcde run {string reverse $x} } edcba test string-24.4.$noComp {string reverse command - unshared string} { set x abc set y de run {string reverse $x$y} } edcba test string-24.5.$noComp {string reverse command - shared unicode string} { set x abcde\uD0AD run {string reverse $x} } \uD0ADedcba test string-24.6.$noComp {string reverse command - unshared string} { set x abc set y de\uD0AD run {string reverse $x$y} } \uD0ADedcba test string-24.7.$noComp {string reverse command - simple case} { run {string reverse a} } a test string-24.8.$noComp {string reverse command - simple case} { run {string reverse \uD0AD} } \uD0AD test string-24.9.$noComp {string reverse command - simple case} { run {string reverse {}} } {} test string-24.10.$noComp {string reverse command - corner case} { set x \uBEEF\uD0AD run {string reverse $x} } \uD0AD\uBEEF test string-24.11.$noComp {string reverse command - corner case} { set x \uBEEF set y \uD0AD run {string reverse $x$y} } \uD0AD\uBEEF test string-24.12.$noComp {string reverse command - corner case} { set x \uBEEF set y \uD0AD run {string is ascii [run {string reverse $x$y}]} } 0 test string-24.13.$noComp {string reverse command - pure Unicode string} { run {string reverse [run {string range \uBEEF\uD0AD\uBEEF\uD0AD\uBEEF\uD0AD 1 5}]} } \uD0AD\uBEEF\uD0AD\uBEEF\uD0AD test string-24.14.$noComp {string reverse command - pure bytearray} { binary scan [run {string reverse [binary format H* 010203]}] H* x set x } 030201 test string-24.15.$noComp {string reverse command - pure bytearray} { binary scan [run {tcl::string::reverse [binary format H* 010203]}] H* x set x } 030201 test string-24.16.$noComp {string reverse command - surrogates} { run {string reverse \u0444bulb\uD83D\uDE02} } \uDE02\uD83Dblub\u0444 test string-24.17.$noComp {string reverse command - surrogates} { run {string reverse \uD83D\uDE02hello\uD83D\uDE02} } \uDE02\uD83Dolleh\uDE02\uD83D test string-24.18.$noComp {string reverse command - surrogates} { set s \u0444bulb\uD83D\uDE02 # shim shimmery ... string index $s 0 run {string reverse $s} } \uDE02\uD83Dblub\u0444 test string-24.19.$noComp {string reverse command - surrogates} { set s \uD83D\uDE02hello\uD83D\uDE02 # shim shimmery ... string index $s 0 run {string reverse $s} } \uDE02\uD83Dolleh\uDE02\uD83D test string-25.1.$noComp {string is list} { run {string is list {a b c}} } 1 test string-25.2.$noComp {string is list} { run {string is list "a \{b c"} } 0 test string-25.3.$noComp {string is list} { run {string is list {a {b c}d e}} } 0 test string-25.4.$noComp {string is list} { run {string is list {}} } 1 test string-25.5.$noComp {string is list} { run {string is list -strict {a b c}} } 1 test string-25.6.$noComp {string is list} { run {string is list -strict "a \{b c"} } 0 test string-25.7.$noComp {string is list} { run {string is list -strict {a {b c}d e}} } 0 test string-25.8.$noComp {string is list} { run {string is list -strict {}} } 1 test string-25.9.$noComp {string is list} { set x {} list [run {string is list -failindex x {a b c}}] $x } {1 {}} test string-25.10.$noComp {string is list} { set x {} list [run {string is list -failindex x "a \{b c"}] $x } {0 2} test string-25.11.$noComp {string is list} { set x {} list [run {string is list -failindex x {a b {b c}d e}}] $x } {0 4} test string-25.12.$noComp {string is list} { set x {} list [run {string is list -failindex x {}}] $x } {1 {}} test string-25.13.$noComp {string is list} { set x {} list [run {string is list -failindex x { {b c}d e}}] $x } {0 2} test string-25.14.$noComp {string is list} { set x {} list [run {string is list -failindex x "\uABCD {b c}d e"}] $x } {0 2} test string-26.1.$noComp {tcl::prefix, not enough args} -body { tcl::prefix match a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix match ?options? table string"} test string-26.2.$noComp {tcl::prefix, bad args} -body { tcl::prefix match a b c } -returnCodes 1 -result {bad option "a": must be -error, -exact, or -message} test string-26.2.1.$noComp {tcl::prefix, empty table} -body { tcl::prefix match {} foo } -returnCodes 1 -result {bad option "foo": no valid options} test string-26.3.$noComp {tcl::prefix, bad args} -body { tcl::prefix match -error "{}x" -exact str1 str2 } -returnCodes 1 -result {list element in braces followed by "x" instead of space} test string-26.3.1.$noComp {tcl::prefix, bad args} -body { tcl::prefix match -error "x" -exact str1 str2 } -returnCodes 1 -result {error options must have an even number of elements} test string-26.3.2.$noComp {tcl::prefix, bad args} -body { tcl::prefix match -error str1 str2 } -returnCodes 1 -result {missing value for -error} test string-26.4.$noComp {tcl::prefix, bad args} -body { tcl::prefix match -message str1 str2 } -returnCodes 1 -result {missing value for -message} test string-26.5.$noComp {tcl::prefix} { tcl::prefix match {apa bepa cepa depa} cepa } cepa test string-26.6.$noComp {tcl::prefix} { tcl::prefix match {apa bepa cepa depa} be } bepa test string-26.7.$noComp {tcl::prefix} -body { tcl::prefix match -exact {apa bepa cepa depa} be } -returnCodes 1 -result {bad option "be": must be apa, bepa, cepa, or depa} test string-26.8.$noComp {tcl::prefix} -body { tcl::prefix match -message wombat {apa bepa bear depa} be } -returnCodes 1 -result {ambiguous wombat "be": must be apa, bepa, bear, or depa} test string-26.9.$noComp {tcl::prefix} -body { tcl::prefix match -error {} {apa bepa bear depa} be } -returnCodes 0 -result {} test string-26.10.$noComp {tcl::prefix} -body { tcl::prefix match -error {-level 1} {apa bepa bear depa} be } -returnCodes 2 -result {ambiguous option "be": must be apa, bepa, bear, or depa} test string-26.10.1.$noComp {tcl::prefix} -setup { proc _testprefix {args} { array set opts {-a x -b y -c y} foreach {opt val} $args { set opt [tcl::prefix match -error {-level 1} {-a -b -c} $opt] set opts($opt) $val } array get opts } } -body { set a [catch {_testprefix -x u} result options] dict get $options -errorinfo } -cleanup { rename _testprefix {} } -result {bad option "-x": must be -a, -b, or -c while executing "_testprefix -x u"} # Helper for memory stress tests # Repeat each body in a local space checking that memory does not increase proc MemStress {args} { set res {} foreach body $args { set end 0 for {set i 0} {$i < 5} {incr i} { proc MemStress_Body {} $body uplevel 1 MemStress_Body rename MemStress_Body {} set tmp $end set end [lindex [lindex [split [memory info] "\n"] 3] 3] } lappend res [expr {$end - $tmp}] } return $res } test string-26.11.$noComp {tcl::prefix: testing for leaks} -body { # This test is made to stress object reference management MemStress { set table {hejj miff gurk} set item [lindex $table 1] # If not careful, this can cause a circular reference # that will cause a leak. tcl::prefix match $table $item } { # A similar case with nested lists set table2 {hejj {miff maff} gurk} set item [lindex [lindex $table2 1] 0] tcl::prefix match $table2 $item } { # A similar case with dict set table3 {hejj {miff maff} gurk2} set item [lindex [dict keys [lindex $table3 1]] 0] tcl::prefix match $table3 $item } } -constraints memory -result {0 0 0} test string-26.12.$noComp {tcl::prefix: testing for leaks} -body { # This is a memory leak test in a form that might actually happen # in real code. The shared literal "miff" causes a connection # between the item and the table. MemStress { proc stress1 {item} { set table [list hejj miff gurk] tcl::prefix match $table $item } proc stress2 {} { stress1 miff } stress2 rename stress1 {} rename stress2 {} } } -constraints memory -result 0 test string-26.13.$noComp {tcl::prefix: testing for leaks} -body { # This test is made to stress object reference management MemStress { set table [list hejj miff] set item $table set error $table # Use the same objects in all places catch { tcl::prefix match -error $error $table $item } } } -constraints memory -result {0} test string-27.1.$noComp {tcl::prefix all, not enough args} -body { tcl::prefix all a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix all table string"} test string-27.2.$noComp {tcl::prefix all, bad args} -body { tcl::prefix all a b c } -returnCodes 1 -result {wrong # args: should be "tcl::prefix all table string"} test string-27.3.$noComp {tcl::prefix all, bad args} -body { tcl::prefix all "{}x" str2 } -returnCodes 1 -result {list element in braces followed by "x" instead of space} test string-27.4.$noComp {tcl::prefix all} { tcl::prefix all {apa bepa cepa depa} c } cepa test string-27.5.$noComp {tcl::prefix all} { tcl::prefix all {apa bepa cepa depa} cepa } cepa test string-27.6.$noComp {tcl::prefix all} { tcl::prefix all {apa bepa cepa depa} cepax } {} test string-27.7.$noComp {tcl::prefix all} { tcl::prefix all {apa aska appa} a } {apa aska appa} test string-27.8.$noComp {tcl::prefix all} { tcl::prefix all {apa aska appa} ap } {apa appa} test string-27.9.$noComp {tcl::prefix all} { tcl::prefix all {apa aska appa} p } {} test string-27.10.$noComp {tcl::prefix all} { tcl::prefix all {apa aska appa} {} } {apa aska appa} test string-28.1.$noComp {tcl::prefix longest, not enough args} -body { tcl::prefix longest a } -returnCodes 1 -result {wrong # args: should be "tcl::prefix longest table string"} test string-28.2.$noComp {tcl::prefix longest, bad args} -body { tcl::prefix longest a b c } -returnCodes 1 -result {wrong # args: should be "tcl::prefix longest table string"} test string-28.3.$noComp {tcl::prefix longest, bad args} -body { tcl::prefix longest "{}x" str2 } -returnCodes 1 -result {list element in braces followed by "x" instead of space} test string-28.4.$noComp {tcl::prefix longest} { tcl::prefix longest {apa bepa cepa depa} c } cepa test string-28.5.$noComp {tcl::prefix longest} { tcl::prefix longest {apa bepa cepa depa} cepa } cepa test string-28.6.$noComp {tcl::prefix longest} { tcl::prefix longest {apa bepa cepa depa} cepax } {} test string-28.7.$noComp {tcl::prefix longest} { tcl::prefix longest {apa aska appa} a } a test string-28.8.$noComp {tcl::prefix longest} { tcl::prefix longest {apa aska appa} ap } ap test string-28.9.$noComp {tcl::prefix longest} { tcl::prefix longest {apa bska appa} a } ap test string-28.10.$noComp {tcl::prefix longest} { tcl::prefix longest {apa bska appa} {} } {} test string-28.11.$noComp {tcl::prefix longest} { tcl::prefix longest {{} bska appa} {} } {} test string-28.12.$noComp {tcl::prefix longest} { tcl::prefix longest {apa {} appa} {} } {} test string-28.13.$noComp {tcl::prefix longest} { # Test utf-8 handling tcl::prefix longest {ax\x90 bep ax\x91} a } ax test string-29.1.$noComp {string cat, no arg} { run {string cat} } "" test string-29.2.$noComp {string cat, single arg} { set x FOO run {string compare $x [run {string cat $x}]} } 0 test string-29.3.$noComp {string cat, two args} { set x FOO run {string compare $x$x [run {string cat $x $x}]} } 0 test string-29.4.$noComp {string cat, many args} { set x FOO set n 260 set xx [run {string repeat $x $n}] set vv [run {string repeat {$x} $n}] set vvs [run {string repeat {$x } $n}] set r1 [run {string compare $xx [subst $vv]}] set r2 [run {string compare $xx [eval "run {string cat $vvs}"]}] list $r1 $r2 } {0 0} if {$noComp} { test string-29.5.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list x] [list]}] } -match glob -result {*no string representation} test string-29.6.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list] [list x]}] } -match glob -result {*no string representation} test string-29.7.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list x] [list] [list]}] } -match glob -result {*no string representation} test string-29.8.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list] [list x] [list]}] } -match glob -result {*no string representation} test string-29.9.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list] [list] [list x]}] } -match glob -result {*no string representation} test string-29.10.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat [list x] [list x]}] } -match glob -result {*, string representation "xx"} test string-29.11.$noComp {string cat, efficiency} -body { tcl::unsupported::representation \ [run {string cat [list x] [encoding convertto utf-8 {}]}] } -match glob -result {*no string representation} test string-29.12.$noComp {string cat, efficiency} -body { tcl::unsupported::representation \ [run {string cat [encoding convertto utf-8 {}] [list x]}] } -match glob -result {*, no string representation} test string-29.13.$noComp {string cat, efficiency} -body { tcl::unsupported::representation [run {string cat \ [encoding convertto utf-8 {}] [encoding convertto utf-8 {}] [list x]}] } -match glob -result {*, no string representation} test string-29.14.$noComp {string cat, efficiency} -setup { set e [encoding convertto utf-8 {}] } -cleanup { unset e } -body { tcl::unsupported::representation [run {string cat $e $e [list x]}] } -match glob -result {*no string representation} test string-29.15.$noComp {string cat, efficiency} -setup { set e [encoding convertto utf-8 {}] set f [encoding convertto utf-8 {}] } -cleanup { unset e f } -body { tcl::unsupported::representation [run {string cat $e $f $e $f [list x]}] } -match glob -result {*no string representation} } test string-30.1.1.$noComp {[Bug ba921a8d98]: string cat} { run {string cat [set data [binary format a* hello]] [encoding convertto $data] [unset data]} } hellohello test string-30.1.2.$noComp {[Bug ba921a8d98]: inplace cat by subst (compiled to "strcat" instruction)} { run {set x "[set data [binary format a* hello]][encoding convertto $data][unset data]"} } hellohello # Note: string-31.* tests use [tcl::string::insert] rather than [string insert] # to dodge ticket [3397978fff] which would cause all arguments to be shared, # thereby preventing the optimizations from being tested. test string-31.1.$noComp {string insert, start of string} { run {tcl::string::insert 0123 0 _} } _0123 test string-31.2.$noComp {string insert, middle of string} { run {tcl::string::insert 0123 2 _} } 01_23 test string-31.3.$noComp {string insert, end of string} { run {tcl::string::insert 0123 4 _} } 0123_ test string-31.4.$noComp {string insert, start of string, end-relative} { run {tcl::string::insert 0123 end-4 _} } _0123 test string-31.5.$noComp {string insert, middle of string, end-relative} { run {tcl::string::insert 0123 end-2 _} } 01_23 test string-31.6.$noComp {string insert, end of string, end-relative} { run {tcl::string::insert 0123 end _} } 0123_ test string-31.7.$noComp {string insert, empty target string} { run {tcl::string::insert {} 0 _} } _ test string-31.8.$noComp {string insert, empty insert string} { run {tcl::string::insert 0123 0 {}} } 0123 test string-31.9.$noComp {string insert, empty strings} { run {tcl::string::insert {} 0 {}} } {} test string-31.10.$noComp {string insert, negative index} { run {tcl::string::insert 0123 -1 _} } _0123 test string-31.11.$noComp {string insert, index beyond end} { run {tcl::string::insert 0123 5 _} } 0123_ test string-31.12.$noComp {string insert, start of string, pure byte array} { run {tcl::string::insert [makeByteArray 0123] 0 [makeByteArray _]} } _0123 test string-31.13.$noComp {string insert, middle of string, pure byte array} { run {tcl::string::insert [makeByteArray 0123] 2 [makeByteArray _]} } 01_23 test string-31.14.$noComp {string insert, end of string, pure byte array} { run {tcl::string::insert [makeByteArray 0123] 4 [makeByteArray _]} } 0123_ test string-31.15.$noComp {string insert, pure byte array, neither shared} { run {tcl::string::insert [makeByteArray 0123] 2 [makeByteArray _]} } 01_23 test string-31.16.$noComp {string insert, pure byte array, first shared} { run {tcl::string::insert [makeShared [makeByteArray 0123]] 2\ [makeByteArray _]} } 01_23 test string-31.17.$noComp {string insert, pure byte array, second shared} { run {tcl::string::insert [makeByteArray 0123] 2\ [makeShared [makeByteArray _]]} } 01_23 test string-31.18.$noComp {string insert, pure byte array, both shared} { run {tcl::string::insert [makeShared [makeByteArray 0123]] 2\ [makeShared [makeByteArray _]]} } 01_23 test string-31.19.$noComp {string insert, start of string, pure Unicode} { run {tcl::string::insert [makeUnicode 0123] 0 [makeUnicode _]} } _0123 test string-31.20.$noComp {string insert, middle of string, pure Unicode} { run {tcl::string::insert [makeUnicode 0123] 2 [makeUnicode _]} } 01_23 test string-31.21.$noComp {string insert, end of string, pure Unicode} { run {tcl::string::insert [makeUnicode 0123] 4 [makeUnicode _]} } 0123_ test string-31.22.$noComp {string insert, str start, pure Uni, first shared} { run {tcl::string::insert [makeShared [makeUnicode 0123]] 0 [makeUnicode _]} } _0123 test string-31.23.$noComp {string insert, string mid, pure Uni, 2nd shared} { run {tcl::string::insert [makeUnicode 0123] 2 [makeShared [makeUnicode _]]} } 01_23 test string-31.24.$noComp {string insert, string end, pure Uni, both shared} { run {tcl::string::insert [makeShared [makeUnicode 0123]] 4\ [makeShared [makeUnicode _]]} } 0123_ test string-31.25.$noComp {string insert, neither byte array nor Unicode} { run {tcl::string::insert [makeList a b c] 1 zzzzzz} } {azzzzzz b c} test string-31.26.$noComp {[11229bad5f] string insert, compiler} -setup { set i 2 } -body { run {tcl::string::insert abcd $i xyz} } -cleanup { unset i } -result abxyzcd test string-32.1.$noComp {string is dict} { string is dict {a b c d} } 1 test string-32.1a.$noComp {string is dict} { string is dict {a b c} } 0 test string-32.2.$noComp {string is dict} { string is dict "a \{b c" } 0 test string-32.3.$noComp {string is dict} { string is dict {a {b c}d e} } 0 test string-32.4.$noComp {string is dict} { string is dict {} } 1 test string-32.5.$noComp {string is dict} { string is dict -strict {a b c d} } 1 test string-32.5a.$noComp {string is dict} { string is dict -strict {a b c} } 0 test string-32.6.$noComp {string is dict} { string is dict -strict "a \{b c" } 0 test string-32.7.$noComp {string is dict} { string is dict -strict {a {b c}d e} } 0 test string-32.8.$noComp {string is dict} { string is dict -strict {} } 1 test string-32.9.$noComp {string is dict} { set x {} list [string is dict -failindex x {a b c d}] $x } {1 {}} test string-32.9a.$noComp {string is dict} { set x {} list [string is dict -failindex x {a b c}] $x } {0 -1} test string-32.10.$noComp {string is dict} { set x {} list [string is dict -failindex x "a \{b c d"] $x } {0 2} test string-32.10a.$noComp {string is dict} { set x {} list [string is dict -failindex x "a \{b c"] $x } {0 2} test string-32.11.$noComp {string is dict} { set x {} list [string is dict -failindex x {a b {b c}d e}] $x } {0 4} test string-32.12.$noComp {string is dict} { set x {} list [string is dict -failindex x {}] $x } {1 {}} test string-32.13.$noComp {string is dict} { set x {} list [string is dict -failindex x { {b c}d e}] $x } {0 2} test string-32.14.$noComp {string is dict} { set x {} list [string is dict -failindex x "\uABCD {b c}d e"] $x } {0 2} test string-32.15.$noComp {string is dict, valid dict} { string is dict {a b c d e f} } 1 test string-32.16.$noComp {string is dict, invalid dict} { string is dict a } 0 test string-32.17.$noComp {string is dict, valid dict packed in invalid dict} { string is dict {{a b c d e f g h}} } 0 }; # foreach noComp {0 1} # cleanup rename MemStress {} rename makeByteArray {} rename makeUnicode {} rename makeList {} rename makeShared {} catch {rename foo {}} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/stack.test0000644000175000017500000000350215104661341014717 0ustar sergeisergei# Tests that the stack size is big enough for the application. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Note that a failure in this test may result in a crash of the executable. test stack-1.1 {maxNestingDepth reached on infinite recursion} -body { # do this in a sub process in case it segfaults exec [interpreter] << { proc recurse {} { recurse } catch { recurse } rv puts $rv } } -result {too many nested evaluations (infinite loop?)} test stack-2.1 {maxNestingDepth reached on infinite recursion} -body { # do this in a sub process in case it segfaults exec [interpreter] << { interp alias {} unknown {} notaknownproc catch { unknown } msg puts $msg } } -result {too many nested evaluations (infinite loop?)} # Make sure that there is enough stack to run regexp even if we're # close to the recursion limit. [Bug 947070] [Patch 746378] test stack-3.1 {enough room for regexp near recursion limit} -body { # do this in a sub process in case it segfaults exec [interpreter] << { interp recursionlimit {} 10000 set depth 0 proc a { max } { if { [info level] < $max } { set ::depth [info level] a $max } else { regexp {^ ?} x } } catch { a 10001 } set depth2 $depth puts [list [a $depth] [expr { $depth2 - $depth }]] } } -result {1 1} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/split.test0000644000175000017500000000501415104661341014745 0ustar sergeisergei# Commands covered: split # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test split-1.1 {basic split commands} { split "a\n b\t\r c\n " } {a {} b {} {} c {} {}} test split-1.2 {basic split commands} { split "word 1xyzword 2zword 3" xyz } {{word 1} {} {} {word 2} {word 3}} test split-1.3 {basic split commands} { split "12345" {} } {1 2 3 4 5} test split-1.4 {basic split commands} { split "a\}b\[c\{\]\$" } "a\\}b\\\[c\\{\\\]\\\$" test split-1.5 {basic split commands} { split {} {} } {} test split-1.6 {basic split commands} { split {} } {} test split-1.7 {basic split commands} { split { } } {{} {} {} {}} test split-1.8 {basic split commands} { proc foo {} { set x {} foreach f [split {]\n} {}] { append x $f } return $x } foo } {]\n} test split-1.9 {basic split commands} { proc foo {} { set x ab\x00c set y [split $x {}] return $y } foo } "a b \x00 c" test split-1.10 {basic split commands} { split "a0ab1b2bbb3\x00c4" ab\x00c } {{} 0 {} 1 2 {} {} 3 {} 4} test split-1.11 {basic split commands} { split "12,3,45" {,} } {12 3 45} test split-1.12 {basic split commands} { split "\x01ab\x01cd\x01\x01ef\x01" \x01 } {{} ab cd {} ef {}} test split-1.13 {basic split commands} { split "12,34,56," {,} } {12 34 56 {}} test split-1.14 {basic split commands} { split ",12,,,34,56," {,} } {{} 12 {} {} 34 56 {}} test split-1.15 {basic split commands} -body { split "a💩b" {} } -result "a 💩 b" test split-1.16 {basic split commands} -body { split "a💩b" 💩 } -result "a b" test split-2.1 {split errors} { list [catch split msg] $msg $errorCode } {1 {wrong # args: should be "split string ?splitChars?"} {TCL WRONGARGS}} test split-2.2 {split errors} { list [catch {split a b c} msg] $msg $errorCode } {1 {wrong # args: should be "split string ?splitChars?"} {TCL WRONGARGS}} # cleanup catch {rename foo {}} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/source.test0000644000175000017500000002142315104661341015114 0ustar sergeisergei# Commands covered: source # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-2000 Scriptics Corporation. # Contributions from Don Porter, NIST, 2003. (not subject to US copyright) # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[catch {package require tcltest 2.5}]} { puts stderr "Skipping tests in [info script]. tcltest 2.5 required." return } namespace eval ::tcl::test::source { namespace import ::tcltest::* test source-1.1 {source command} -setup { set x "old x value" set y "old y value" set z "old z value" set sourcefile [makeFile { set x 22 set y 33 set z 44 } source.file] } -body { source $sourcefile list $x $y $z } -cleanup { removeFile source.file } -result {22 33 44} test source-1.2 {source command} -setup { set sourcefile [makeFile {list result} source.file] } -body { source $sourcefile } -cleanup { removeFile source.file } -result result test source-1.3 {source command} -setup { set sourcefile [makeFile {} source.file] set fd [open $sourcefile w] fconfigure $fd -translation lf puts $fd "list a b c \\" puts $fd "d e f" close $fd } -body { source $sourcefile } -cleanup { removeFile source.file } -result {a b c d e f} proc ListGlobMatch {expected actual} { if {[llength $expected] != [llength $actual]} { return 0 } foreach e $expected a $actual { if {![string match $e $a]} { return 0 } } return 1 } customMatch listGlob [namespace which ListGlobMatch] test source-2.3 {source error conditions} -setup { set sourcefile [makeFile { set x 146 error "error in sourced file" set y $x } source.file] } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo } -cleanup { removeFile source.file } -match listGlob -result [list 1 {error in sourced file} \ {error in sourced file while executing "error "error in sourced file"" (file "*source.file" line 3) invoked from within "source $sourcefile"}] test source-2.4 {source error conditions} -setup { set sourcefile [makeFile {break} source.file] } -body { source $sourcefile } -cleanup { removeFile source.file } -returnCodes break test source-2.5 {source error conditions} -setup { set sourcefile [makeFile {continue} source.file] } -body { source $sourcefile } -cleanup { removeFile source.file } -returnCodes continue test source-2.6 {source error conditions} -setup { set sourcefile [makeFile {} _non_existent_] removeFile _non_existent_ } -body { source $sourcefile } -match glob -result {couldn't read file "*_non_existent_": no such file or directory} \ -errorCode {POSIX ENOENT {no such file or directory}} test source-2.7 {utf-8 with BOM} -setup { set sourcefile [makeFile {} source.file] } -body { set out [open $sourcefile w] fconfigure $out -encoding utf-8 puts $out "\uFEFFset y new-y" close $out set y old-y source $sourcefile return $y } -cleanup { removeFile $sourcefile } -result {new-y} test source-3.1 {return in middle of source file} -setup { set sourcefile [makeFile { set x new-x return allDone set y new-y } source.file] } -body { set x old-x set y old-y set z [source $sourcefile] list $x $y $z } -cleanup { removeFile source.file } -result {new-x old-y allDone} test source-3.2 {return with special code etc.} -setup { set sourcefile [makeFile { set x new-x return -code break "Silly result" set y new-y } source.file] } -body { source $sourcefile } -cleanup { removeFile source.file } -returnCodes break -result {Silly result} test source-3.3 {return with special code etc.} -setup { set sourcefile [makeFile { set x new-x return -code error "Simulated error" set y new-y } source.file] } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo $::errorCode } -cleanup { removeFile source.file } -result {1 {Simulated error} {Simulated error while executing "source $sourcefile"} NONE} test source-3.4 {return with special code etc.} -setup { set sourcefile [makeFile { set x new-x return -code error -errorinfo "Simulated errorInfo stuff" set y new-y } source.file] } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo $::errorCode } -cleanup { removeFile source.file } -result {1 {} {Simulated errorInfo stuff invoked from within "source $sourcefile"} NONE} test source-3.5 {return with special code etc.} -setup { set sourcefile [makeFile { set x new-x return -code error -errorinfo "Simulated errorInfo stuff" \ -errorcode {a b c} set y new-y } source.file] } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo $::errorCode } -cleanup { removeFile source.file } -result {1 {} {Simulated errorInfo stuff invoked from within "source $sourcefile"} {a b c}} test source-4.1 {continuation line parsing} -setup { set sourcefile [makeFile [string map {CL \\\n} { format %s "[dict get [info frame 0] type]:CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]" }] source.file] } -body { source $sourcefile } -cleanup { removeFile source.file } -result {source: 3 4 5} test source-6.1 {source is binary ok} -setup { # Note [makeFile] writes in the system encoding. # [source] defaults to reading in the system encoding. set sourcefile [makeFile [list set x "a b\x00c"] source.file] } -body { set x {} source $sourcefile string length $x } -cleanup { removeFile source.file } -result 5 test source-6.2 {source skips everything after Ctrl-Z: Bug 2040} -setup { set sourcefile [makeFile "set x ab\x1Ac" source.file] } -body { set x {} source $sourcefile string length $x } -cleanup { removeFile source.file } -result 2 test source-7.1 {source -encoding test} -setup { set sourcefile [makeFile {} source.file] file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "set symbol(square-root) √; set x correct" close $f } -body { set x unset source $sourcefile set x } -cleanup { removeFile source.file } -result correct test source-7.2 {source -encoding test} -setup { # This tests for bad interactions between [source -encoding] # and use of the Control-Z character (\x1A) as a cross-platform # EOF character by [source]. Here we write out and the [source] a # file that contains the byte \x1A, although not the character \x1A in # the indicated encoding. set sourcefile [makeFile {} source.file] file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-16 puts $f "set symbol(square-root) √; set x correct" close $f } -body { set x unset source -encoding utf-16 $sourcefile set x } -cleanup { removeFile source.file } -result correct test source-7.3 {source -encoding: syntax} -body { # Have to spell out the -encoding option source -e utf-8 no_file } -returnCodes 1 -match glob -result {bad option*} test source-7.4 {source -encoding: syntax} -setup { set sourcefile [makeFile {} source.file] } -body { source -encoding no-such-encoding $sourcefile } -cleanup { removeFile source.file } -returnCodes 1 -match glob -result {unknown encoding*} test source-7.5 {source -encoding: correct operation} -setup { set sourcefile [makeFile {} source.file] file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "proc € {} {return foo}" close $f } -body { source $sourcefile € } -cleanup { removeFile source.file rename € {} } -result foo test source-7.6 {source -encoding: mismatch encoding error} -setup { set sourcefile [makeFile {} source.file] file delete $sourcefile set f [open $sourcefile w] fconfigure $f -encoding utf-8 puts $f "proc € {} {return foo}" close $f } -body { source -encoding iso8859-1 $sourcefile € } -cleanup { removeFile source.file } -returnCodes error -result {invalid command name "€"} test source-8.1 {source and coroutine/yield} -setup { set sourcefile [makeFile {} source.file] file delete $sourcefile } -body { makeFile {yield 1; yield 2; return 3;} $sourcefile coroutine coro apply {f {yield;source $f}} $sourcefile list [coro] [coro] [coro] [info exist coro] } -cleanup { catch {rename coro {}} removeFile source.file } -result {1 2 3 0} cleanupTests } namespace delete ::tcl::test::source return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/socket.test0000644000175000017500000023253615104661341015115 0ustar sergeisergei# Commands tested in this file: socket. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Running socket tests with a remote server: # ------------------------------------------ # # Some tests in socket.test depend on the existence of a remote server to # which they connect. The remote server must be an instance of tcltest and it # must run the script found in the file "remote.tcl" in this directory. You # can start the remote server on any machine reachable from the machine on # which you want to run the socket tests, by issuing: # # tcltest remote.tcl -port 2048 # Or choose another port number. # # If the machine you are running the remote server on has several IP # interfaces, you can choose which interface the server listens on for # connections by specifying the -address command line flag, so: # # tcltest remote.tcl -address your.machine.com # # These options can also be set by environment variables. On Unix, you can # type these commands to the shell from which the remote server is started: # # shell% setenv serverPort 2048 # shell% setenv serverAddress your.machine.com # # and subsequently you can start the remote server with: # # tcltest remote.tcl # # to have it listen on port 2048 on the interface your.machine.com. # # When the server starts, it prints out a detailed message containing its # configuration information, and it will block until killed with a Ctrl-C. # Once the remote server exists, you can run the tests in socket.test with the # server by setting two Tcl variables: # # % set remoteServerIP # % set remoteServerPort 2048 # # These variables are also settable from the environment. On Unix, you can: # # shell% setenv remoteServerIP machine.where.server.runs # shell% senetv remoteServerPort 2048 # # The preamble of the socket.test file checks to see if the variables are set # either in Tcl or in the environment; if they are, it attempts to connect to # the server. If the connection is successful, the tests using the remote # server will be performed; otherwise, it will attempt to start the remote # server (via exec) on platforms that support this, on the local host, # listening at port 2048. If all fails, a message is printed and the tests # using the remote server are not performed. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] ::tcltest::loadTestedCommands # A bad interaction between socket creation, macOS, and unattended CI # environments make this whole file impractical to run; too many weird hangs. if {[info exists ::env(MAC_CI)]} { return } testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint exec [llength [info commands exec]] testConstraint notWinCI [expr { $tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}] # Produce a random port number in the Dynamic/Private range # from 49152 through 65535. proc randport {} { # firstly try dynamic port via server-socket(0): set port 0x7fffffff catch { set port [lindex [fconfigure [set s [socket -server {} 0]] -sockname] 2] close $s } while {[catch { close [socket -server {} $port] } msg]} { if {[incr i] > 1000} {return -code error "too many iterations to get free random port: $msg"} # try random port: set port [expr {int(rand()*16383+49152)}] } return $port } # Check if testsocket testflags is available testConstraint testsocket_testflags [expr {![catch { set h [socket -async localhost [randport]] testsocket testflags $h 0 close $h }]}] # Test the latency of tcp connections over the loopback interface. Some OSes # (e.g. NetBSD) seem to use the Nagle algorithm and delayed ACKs, so it takes # up to 200ms for a packet sent to localhost to arrive. We're measuring this # here, so that OSes that don't have this problem can run the tests at full # speed. set server [socket -server {apply {{s a p} {set ::s1 $s}}} 0] set s2 [socket localhost [lindex [fconfigure $server -sockname] 2]] vwait s1; close $server fconfigure $s1 -buffering line fconfigure $s2 -buffering line set t1 [clock milliseconds] puts $s2 test1; gets $s1 puts $s2 test2; gets $s1 close $s1; close $s2 set t2 [clock milliseconds] set lat1 [expr {($t2-$t1)*2}]; # doubled as a safety margin # Test the latency of failed connection attempts over the loopback # interface. They can take more than a second under Windows and requires # additional [after]s in some tests that are not needed on systems that fail # immediately. set t1 [clock milliseconds] catch {socket 127.0.0.1 [randport]} set t2 [clock milliseconds] set lat2 [expr {($t2-$t1)*3}] # Use the maximum of the two latency calculations, but at least 200ms set latency [expr {$lat1 > $lat2 ? $lat1 : $lat2}] set latency [expr {$latency > 200 ? $latency : 200}] unset t1 t2 s1 s2 lat1 lat2 server # If remoteServerIP or remoteServerPort are not set, check in the environment # variables for externally set values. # if {![info exists remoteServerIP]} { if {[info exists env(remoteServerIP)]} { set remoteServerIP $env(remoteServerIP) } } if {![info exists remoteServerPort]} { if {[info exists env(remoteServerPort)]} { set remoteServerPort $env(remoteServerPort) } else { if {[info exists remoteServerIP]} { set remoteServerPort 2048 } } } if 0 { # activate this to time the tests proc test {args} { set name [lindex $args 0] puts "[lindex [time {uplevel [linsert $args 0 tcltest::test]}] 0] @@@ $name" } } foreach {af localhost} { inet 127.0.0.1 inet6 ::1 } { # Check if the family is supported and set the constraint accordingly testConstraint supported_$af [expr {![catch {socket -server foo -myaddr $localhost 0} sock]}] catch {close $sock} } set sock [socket -server foo -myaddr localhost 0] set sockname [fconfigure $sock -sockname] close $sock testConstraint localhost_v4 [expr {"127.0.0.1" in $sockname}] testConstraint localhost_v6 [expr {"::1" in $sockname}] foreach {af localhost} { any 127.0.0.1 inet 127.0.0.1 inet6 ::1 } { if {![testConstraint supported_$af]} { continue } set ::tcl::unsupported::socketAF $af # # Check if we're supposed to do tests against the remote server # set doTestsWithRemoteServer 1 if {![info exists remoteServerIP]} { set remoteServerIP $localhost } if {($doTestsWithRemoteServer == 1) && (![info exists remoteServerPort])} { set remoteServerPort [randport] } # Attempt to connect to a remote server if one is already running. If it is # not running or for some other reason the connect fails, attempt to start the # remote server on the local host listening on port 2048. This is only done on # platforms that support exec (i.e. not on the Mac). On platforms that do not # support exec, the remote server must be started by the user before running # the tests. set remoteProcChan "" set commandSocket "" if {$doTestsWithRemoteServer} { catch {close $commandSocket} if {![catch { set commandSocket [socket $remoteServerIP $remoteServerPort] }]} then { fconfigure $commandSocket -translation crlf -buffering line } elseif {![testConstraint exec]} { set noRemoteTestReason "can't exec" set doTestsWithRemoteServer 0 } else { set remoteServerIP $localhost # Be *extra* careful in case this file is sourced from # a directory other than the current one... set remoteFile [file join [pwd] [file dirname [info script]] \ remote.tcl] if {![catch { set remoteProcChan [open "|[list \ [interpreter] $remoteFile -serverIsSilent \ -port $remoteServerPort -address $remoteServerIP]" w+] } msg]} then { gets $remoteProcChan if {[catch { set commandSocket [socket $remoteServerIP $remoteServerPort] } msg] == 0} then { fconfigure $commandSocket -translation crlf -buffering line } else { set noRemoteTestReason $msg set doTestsWithRemoteServer 0 } } else { set noRemoteTestReason "$msg [interpreter]" set doTestsWithRemoteServer 0 } } } # Some tests are run only if we are doing testing against a remote server. testConstraint doTestsWithRemoteServer $doTestsWithRemoteServer if {!$doTestsWithRemoteServer} { if {[string first s $::tcltest::verbose] >= 0} { puts "Skipping tests with remote server. See tests/socket.test for" puts "information on how to run remote server." puts "Reason for not doing remote tests: $noRemoteTestReason" } } # # If we do the tests, define a command to send a command to the remote server. # if {[testConstraint doTestsWithRemoteServer]} { proc sendCommand {c} { global commandSocket if {[eof $commandSocket]} { error "remote server disappeared" } if {[catch {puts $commandSocket $c} msg]} { error "remote server disappaered: $msg" } if {[catch {puts $commandSocket "--Marker--Marker--Marker--"} msg]} { error "remote server disappeared: $msg" } while {1} { set line [gets $commandSocket] if {[eof $commandSocket]} { error "remote server disappaered" } if {$line eq "--Marker--Marker--Marker--"} { lassign $result code info value return -code $code -errorinfo $info $value } append result $line "\n" } } } proc getPort sock { lindex [fconfigure $sock -sockname] 2 } # Some tests in this file are known to hang *occasionally* on OSX; stop the # worst offenders. testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}] # Here "Windows" means derived platforms as Cygwin or Msys2 too. testConstraint notWindows [expr {![regexp {^(Windows|MSYS|CYGWIN)} $::tcl_platform(os)]}] # ---------------------------------------------------------------------- test socket_$af-1.1 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -server } -returnCodes error -result {no argument given for -server option} test socket_$af-1.2 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -server foo } -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"} test socket_$af-1.3 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -myaddr } -returnCodes error -result {no argument given for -myaddr option} test socket_$af-1.4 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -myaddr $localhost } -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"} test socket_$af-1.5 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -myport } -returnCodes error -result {no argument given for -myport option} test socket_$af-1.6 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -myport xxxx } -returnCodes error -result {expected integer but got "xxxx"} test socket_$af-1.7 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -myport 2522 } -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"} test socket_$af-1.8 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -froboz } -returnCodes error -result {bad option "-froboz": must be -async, -backlog, -myaddr, -myport, -reuseaddr, -reuseport, or -server} test socket_$af-1.9 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -server foo -myport 2521 3333 } -returnCodes error -result {option -myport is not valid for servers} test socket_$af-1.10 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket host 2528 -junk } -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"} test socket_$af-1.11 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -server callback 2520 -- } -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"} test socket_$af-1.12 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket foo badport } -returnCodes error -result {expected integer but got "badport"} test socket_$af-1.13 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -async -server } -returnCodes error -result {cannot set -async option for server sockets} test socket_$af-1.14 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -server foo -async } -returnCodes error -result {cannot set -async option for server sockets} test socket_$af-1.15 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseaddr yes 4242 } -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers} test socket_$af-1.16 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseaddr no 4242 } -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers} test socket_$af-1.17 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseaddr } -returnCodes error -result {no argument given for -reuseaddr option} test socket_$af-1.18 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseport yes 4242 } -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers} test socket_$af-1.19 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseport no 4242 } -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers} test socket_$af-1.20 {arg parsing for socket command} -constraints [list socket supported_$af] -body { socket -reuseport } -returnCodes error -result {no argument given for -reuseport option} set path(script) [makeFile {} script] test socket_$af-2.1 {tcp connection} -constraints [list socket supported_$af stdio] -setup { file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timed_out"] set f [socket -server accept 0] proc accept {file addr port} { global x set x done close $file } puts ready puts [lindex [fconfigure $f -sockname] 2] vwait x after cancel $timer close $f puts $x } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f x gets $f listen } -body { # $x == "ready" at this point set sock [socket $localhost $listen] lappend x [gets $f] close $sock lappend x [gets $f] } -cleanup { close $f } -result {ready done {}} test socket_$af-2.2 {tcp connection with client port specified} -setup { set port [randport] file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] set f [socket -server accept 0] proc accept {file addr port} { global x puts "[gets $file] $port" close $file set x done } puts ready puts [lindex [fconfigure $f -sockname] 2] vwait x after cancel $timer close $f } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f x gets $f listen } -constraints [list socket supported_$af stdio] -body { # $x == "ready" at this point set sock [socket -myport $port $localhost $listen] puts $sock hello flush $sock lappend x [expr {[gets $f] eq "hello $port"}] close $sock return $x } -cleanup { catch {close [socket $localhost $listen]} close $f } -result {ready 1} test socket_$af-2.3 {tcp connection with client interface specified} -setup { file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 2000 "set x done"] set f [socket -server accept 0] proc accept {file addr port} { global x puts "[gets $file] $addr" close $file set x done } puts [lindex [fconfigure $f -sockname] 2] puts ready vwait x after cancel $timer close $f } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f listen gets $f x } -constraints [list socket supported_$af stdio] -body { # $x == "ready" at this point set sock [socket -myaddr $localhost $localhost $listen] puts $sock hello flush $sock lappend x [gets $f] close $sock return $x } -cleanup { close $f } -result [list ready [list hello $localhost]] test socket_$af-2.4 {tcp connection with server interface specified} -setup { file delete $path(script) set f [open $path(script) w] puts $f [list set localhost $localhost] puts $f { set timer [after 2000 "set x done"] set f [socket -server accept -myaddr $localhost 0] proc accept {file addr port} { global x puts "[gets $file]" close $file set x done } puts ready puts [lindex [fconfigure $f -sockname] 2] vwait x after cancel $timer close $f } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f x gets $f listen } -constraints [list socket supported_$af stdio] -body { # $x == "ready" at this point set sock [socket $localhost $listen] puts $sock hello flush $sock lappend x [gets $f] close $sock return $x } -cleanup { close $f } -result {ready hello} test socket_$af-2.5 {tcp connection with redundant server port} -setup { file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] set f [socket -server accept 0] proc accept {file addr port} { global x puts "[gets $file]" close $file set x done } puts ready puts [lindex [fconfigure $f -sockname] 2] vwait x after cancel $timer close $f } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f x gets $f listen } -constraints [list socket supported_$af stdio] -body { # $x == "ready" at this point set sock [socket $localhost $listen] puts $sock hello flush $sock lappend x [gets $f] close $sock return $x } -cleanup { close $f } -result {ready hello} test socket_$af-2.6 {tcp connection} -constraints [list socket supported_$af] -body { set status ok if {![catch {set sock [socket $localhost [randport]]}]} { if {![catch {gets $sock}]} { set status broken } close $sock } set status } -result ok test socket_$af-2.7 {echo server, one line} -constraints [list socket supported_$af stdio] -setup { file delete $path(script) set f [open $path(script) w] puts $f { set timer [after 10000 "set x timeout"] set f [socket -server accept 0] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -translation lf -buffering line } proc echo {s} { set l [gets $s] if {[eof $s]} { global x close $s set x done } else { puts $s $l } } puts ready puts [lindex [fconfigure $f -sockname] 2] vwait x after cancel $timer close $f puts $x } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f gets $f listen } -body { set s [socket $localhost $listen] fconfigure $s -buffering line -translation lf puts $s "hello abcdefghijklmnop" set x [gets $s] close $s list $x [gets $f] } -cleanup { close $f } -result {{hello abcdefghijklmnop} done} removeFile script test socket_$af-2.8 {echo server, loop 50 times, single connection} -setup { set path(script) [makeFile { set f [socket -server accept 0] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line } proc echo {s} { global i set l [gets $s] if {[eof $s]} { global x close $s set x done } else { incr i puts $s $l } } set i 0 puts ready puts [lindex [fconfigure $f -sockname] 2] set timer [after 20000 "set x done"] vwait x after cancel $timer close $f puts "done $i" } script] set f [open "|[list [interpreter] $path(script)]" r] gets $f gets $f listen } -constraints [list socket supported_$af stdio] -body { set s [socket $localhost $listen] fconfigure $s -buffering line catch { for {set x 0} {$x < 50} {incr x} { puts $s "hello abcdefghijklmnop" gets $s } } close $s catch {set x [gets $f]} return $x } -cleanup { close $f removeFile script } -result {done 50} set path(script) [makeFile {} script] test socket_$af-2.9 {socket conflict} -constraints [list socket supported_$af stdio] -body { set s [socket -server accept 0] file delete $path(script) set f [open $path(script) w] puts $f [list set ::tcl::unsupported::socketAF $::tcl::unsupported::socketAF] puts $f "socket -server accept [lindex [fconfigure $s -sockname] 2]" close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f after 100 close $f } -returnCodes error -cleanup { close $s } -match glob -result {couldn't open socket: address already in use*} test socket_$af-2.10 {close on accept, accepted socket lives} -setup { set done 0 set timer [after 20000 "set done timed_out"] } -constraints [list socket supported_$af] -body { set ss [socket -server accept 0] proc accept {s a p} { global ss close $ss fileevent $s readable "readit $s" fconfigure $s -trans lf } proc readit {s} { global done gets $s close $s set done 1 } set cs [socket $localhost [lindex [fconfigure $ss -sockname] 2]] puts $cs hello close $cs vwait done return $done } -cleanup { after cancel $timer } -result 1 test socket_$af-2.11 {detecting new data} -constraints [list socket supported_$af] -setup { proc accept {s a p} { global sock set sock $s } set s [socket -server accept 0] set sock "" } -body { set s2 [socket $localhost [lindex [fconfigure $s -sockname] 2]] vwait sock puts $s2 one flush $s2 after $latency {set x 1}; # Spurious failures in Travis CI, if we do [after idle] vwait x fconfigure $sock -blocking 0 set result a:[gets $sock] lappend result b:[gets $sock] fconfigure $sock -blocking 1 puts $s2 two flush $s2 after $latency {set x 1}; # NetBSD fails here if we do [after idle] vwait x fconfigure $sock -blocking 0 lappend result c:[gets $sock] } -cleanup { fconfigure $sock -blocking 1 close $s2 close $s close $sock } -result {a:one b: c:two} test socket_$af-2.12 {} [list socket stdio supported_$af] { file delete $path(script) set f [open $path(script) w] puts $f { set server [socket -server accept_client 0] puts [lindex [chan configure $server -sockname] 2] proc accept_client { client host port } { chan configure $client -blocking 0 -buffering line write_line $client } proc write_line client { if { [catch { chan puts $client [string repeat . 720000]}] } { puts [catch {chan close $client}] } else { puts signal1 after 0 write_line $client } } chan event stdin readable {set forever now} vwait forever exit } close $f set f [open "|[list [interpreter] $path(script)]" r+] gets $f port set sock [socket $localhost $port] chan event $sock readable [list read_lines $sock $f] proc read_lines { sock pipe } { gets $pipe chan close $sock chan event $pipe readable [list readpipe $pipe] } proc readpipe {pipe} { while {![string is integer [set ::done [gets $pipe]]]} {} } vwait ::done close $f set ::done } 0 test socket_$af-2.13 {Bug 1758a0b603} {socket stdio notWine} { file delete $path(script) set f [open $path(script) w] puts $f { set server [socket -server accept 0] puts [lindex [chan configure $server -sockname] 2] proc accept { client host port } { chan configure $client -blocking 0 -buffering line -buffersize 1 puts $client [string repeat . 720000] puts ready chan event $client writable [list setup $client] } proc setup client { chan event $client writable {set forever write} after 5 {set forever timeout} } vwait forever puts $forever } close $f set pipe [open |[list [interpreter] $path(script)] r] gets $pipe port set sock [socket $localhost $port] chan configure $sock -blocking 0 -buffering line chan event $sock readable [list read_lines $sock $pipe ] proc read_lines { sock pipe } { gets $pipe gets $sock line after idle [list stop $sock $pipe] chan event $sock readable {} } proc stop {sock pipe} { variable done close $sock set done [gets $pipe] } variable done vwait [namespace which -variable done] close $pipe set done } write test socket_$af-3.1 {socket conflict} -constraints [list socket supported_$af stdio] -setup { file delete $path(script) set f [open $path(script) w] puts $f [list set localhost $localhost] puts $f { set f [socket -server accept -myaddr $localhost 0] puts ready puts [lindex [fconfigure $f -sockname] 2] gets stdin close $f } close $f set f [open "|[list [interpreter] $path(script)]" r+] gets $f gets $f listen } -body { socket -server accept -myaddr $localhost $listen } -cleanup { puts $f bye close $f } -returnCodes error -result {couldn't open socket: address already in use} test socket_$af-3.2 {server with several clients} -setup { file delete $path(script) set f [open $path(script) w] puts $f [list set localhost $localhost] puts $f { set t1 [after 30000 "set x timed_out"] set t2 [after 31000 "set x timed_out"] set t3 [after 32000 "set x timed_out"] set counter 0 set s [socket -server accept -myaddr $localhost 0] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line } proc echo {s} { global x set l [gets $s] if {[eof $s]} { close $s set x done } else { puts $s $l } } puts ready puts [lindex [fconfigure $s -sockname] 2] vwait x after cancel $t1 vwait x after cancel $t2 vwait x after cancel $t3 close $s puts $x } close $f set f [open "|[list [interpreter] $path(script)]" r+] set x [gets $f] gets $f listen } -constraints [list socket supported_$af stdio] -body { # $x == "ready" here set s1 [socket $localhost $listen] fconfigure $s1 -buffering line set s2 [socket $localhost $listen] fconfigure $s2 -buffering line set s3 [socket $localhost $listen] fconfigure $s3 -buffering line for {set i 0} {$i < 100} {incr i} { puts $s1 hello,s1 gets $s1 puts $s2 hello,s2 gets $s2 puts $s3 hello,s3 gets $s3 } close $s1 close $s2 close $s3 lappend x [gets $f] } -cleanup { close $f } -result {ready done} test socket_$af-4.1 {server with several clients} -setup { file delete $path(script) set f [open $path(script) w] puts $f [list set localhost $localhost] puts $f { set port [gets stdin] set s [socket $localhost $port] fconfigure $s -buffering line for {set i 0} {$i < 100} {incr i} { puts $s hello gets $s } close $s puts bye gets stdin } close $f set p1 [open "|[list [interpreter] $path(script)]" r+] fconfigure $p1 -buffering line set p2 [open "|[list [interpreter] $path(script)]" r+] fconfigure $p2 -buffering line set p3 [open "|[list [interpreter] $path(script)]" r+] fconfigure $p3 -buffering line } -constraints [list socket supported_$af stdio] -body { proc accept {s a p} { fconfigure $s -buffering line fileevent $s readable [list echo $s] } proc echo {s} { global x set l [gets $s] if {[eof $s]} { close $s set x done } else { puts $s $l } } set t1 [after 30000 "set x timed_out"] set t2 [after 31000 "set x timed_out"] set t3 [after 32000 "set x timed_out"] set s [socket -server accept -myaddr $localhost 0] set listen [lindex [fconfigure $s -sockname] 2] puts $p1 $listen puts $p2 $listen puts $p3 $listen vwait x vwait x vwait x after cancel $t1 after cancel $t2 after cancel $t3 close $s set l "" lappend l [list p1 [gets $p1] $x] lappend l [list p2 [gets $p2] $x] lappend l [list p3 [gets $p3] $x] } -cleanup { puts $p1 bye puts $p2 bye puts $p3 bye close $p1 close $p2 close $p3 } -result {{p1 bye done} {p2 bye done} {p3 bye done}} test socket_$af-4.2 {byte order problems, socket numbers, htons} -body { close [socket -server dodo -myaddr $localhost 0x3000] return ok } -constraints [list socket supported_$af] -result ok test socket_$af-5.1 {byte order problems, socket numbers, htons} -body { if {![catch {socket -server dodo 0x1} msg]} { close $msg return {htons problem, should be disallowed, are you running as SU?} } return {couldn't open socket: not owner} } -constraints [list socket supported_$af unix notRoot notOSX notWindows] -result {couldn't open socket: not owner} test socket_$af-5.2 {byte order problems, socket numbers, htons} -body { if {![catch {socket -server dodo 0x10000} msg]} { close $msg return {port resolution problem, should be disallowed} } return {couldn't open socket: port number too high} } -constraints [list socket supported_$af] -result {couldn't open socket: port number too high} test socket_$af-5.3 {byte order problems, socket numbers, htons} -body { if {![catch {socket -server dodo 21} msg]} { close $msg return {htons problem, should be disallowed, are you running as SU?} } return {couldn't open socket: not owner} } -constraints [list socket supported_$af unix notRoot notOSX notWindows] -result {couldn't open socket: not owner} test socket_$af-6.1 {accept callback error} -constraints [list socket supported_$af stdio] -setup { proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] file delete $path(script) } -body { set f [open $path(script) w] puts $f [list set localhost $localhost] puts $f { gets stdin port socket $localhost $port } close $f set f [open "|[list [interpreter] $path(script)]" r+] proc accept {s a p} {expr {10 / 0}} set s [socket -server accept -myaddr $localhost 0] puts $f [lindex [fconfigure $s -sockname] 2] close $f set timer [after 10000 "set x timed_out"] vwait x after cancel $timer close $s return $x } -cleanup { interp bgerror {} $handler } -result {divide by zero} test socket_$af-6.2 { readable fileevent on server socket } -setup { set sock [socket -server dummy 0] } -constraints [list socket supported_$af] -body { fileevent $sock readable dummy } -cleanup { close $sock } -returnCodes 1 -result "channel is not readable" test socket_$af-6.3 {writable fileevent on server socket} -setup { set sock [socket -server dummy 0] } -constraints [list socket supported_$af] -body { fileevent $sock writable dummy } -cleanup { close $sock } -returnCodes 1 -result "channel is not writable" test socket_$af-7.1 {testing socket specific options} -setup { file delete $path(script) set f [open $path(script) w] puts $f { set ss [socket -server accept 0] proc accept args { global x set x done } puts ready puts [lindex [fconfigure $ss -sockname] 2] set timer [after 10000 "set x timed_out"] vwait x after cancel $timer } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f gets $f listen set l "" } -constraints [list socket supported_$af stdio] -body { set s [socket $localhost $listen] set p [fconfigure $s -peername] close $s lappend l [string compare [lindex $p 0] $localhost] lappend l [string compare [lindex $p 2] $listen] lappend l [llength $p] } -cleanup { close $f } -result {0 0 3} test socket_$af-7.2 {testing socket specific options} -setup { file delete $path(script) set f [open $path(script) w] puts $f [list set ::tcl::unsupported::socketAF $::tcl::unsupported::socketAF] puts $f { set ss [socket -server accept 0] proc accept args { global x set x done } puts ready puts [lindex [fconfigure $ss -sockname] 2] set timer [after 10000 "set x timed_out"] vwait x after cancel $timer } close $f set f [open "|[list [interpreter] $path(script)]" r] gets $f gets $f listen } -constraints [list socket supported_$af stdio] -body { set s [socket $localhost $listen] set p [fconfigure $s -sockname] close $s list [llength $p] \ [regexp {^(127\.0\.0\.1|0\.0\.0\.0|::1)$} [lindex $p 0]] \ [expr {[lindex $p 2] == $listen}] } -cleanup { close $f } -result {3 1 0} test socket_$af-7.3 {testing socket specific options} -constraints [list socket supported_$af] -body { set s [socket -server accept -myaddr $localhost 0] set l [fconfigure $s] close $s update llength $l } -result 20 test socket_$af-7.4 {testing socket specific options} -constraints [list socket supported_$af] -setup { set timer [after 10000 "set x timed_out"] set l "" } -body { set s [socket -server accept -myaddr $localhost 0] proc accept {s a p} { global x set x [fconfigure $s -sockname] close $s } set listen [lindex [fconfigure $s -sockname] 2] set s1 [socket $localhost $listen] vwait x lappend l [expr {[lindex $x 2] == $listen}] [llength $x] } -cleanup { after cancel $timer close $s close $s1 } -result {1 3} test socket_$af-7.5 {testing socket specific options} -setup { set timer [after 10000 "set x timed_out"] set l "" } -constraints [list socket supported_$af unixOrWin] -body { set s [socket -server accept 0] proc accept {s a p} { global x set x [fconfigure $s -sockname] close $s } set listen [lindex [fconfigure $s -sockname] 2] set s1 [socket $localhost $listen] vwait x lappend l [lindex $x 0] [expr {[lindex $x 2] == $listen}] [llength $x] } -cleanup { after cancel $timer close $s close $s1 } -result [list $localhost 1 3] test socket_$af-7.6 {testing socket specific options - bug e589d9bdab} -setup { set timer [after 10000 "set x timed_out"] set l "" } -constraints [list socket supported_$af unixOrWin] -body { set s [socket -server accept 0] proc accept {s a p} { global x set x [fconfigure $s -sockname] close $s } set listen [lindex [fconfigure $s -sockname] 2] set s1 [socket $localhost $listen] vwait x lsort [dict keys [fconfigure $s1]] } -cleanup { after cancel $timer close $s close $s1 } -result {-blocking -buffering -buffersize -encoding -eofchar -keepalive -nodelay -peername -profile -sockname -translation} test socket_$af-8.1 {testing -async flag on sockets} -constraints [list socket supported_$af] -body { # NOTE: This test may fail on some Solaris 2.4 systems. If it does, check # that you have these patches installed (using showrev -p): # # 101907-05, 101925-02, 101945-14, 101959-03, 101969-05, 101973-03, # 101977-03, 101981-02, 101985-01, 102001-03, 102003-01, 102007-01, # 102011-02, 102024-01, 102039-01, 102044-01, 102048-01, 102062-03, # 102066-04, 102070-01, 102105-01, 102153-03, 102216-01, 102232-01, # 101878-03, 101879-01, 101880-03, 101933-01, 101950-01, 102030-01, # 102057-08, 102140-01, 101920-02, 101921-09, 101922-07, 101923-03 # # If after installing these patches you are still experiencing a problem, # please email jyl@eng.sun.com. We have not observed this failure on # Solaris 2.5, so another option (instead of installing these patches) is # to upgrade to Solaris 2.5. set s [socket -server accept -myaddr $localhost 0] proc accept {s a p} { global x puts $s bye close $s set x done } set s1 [socket -async $localhost [lindex [fconfigure $s -sockname] 2]] vwait x gets $s1 } -cleanup { close $s close $s1 } -result bye test socket_$af-9.1 {testing spurious events} -constraints [list socket supported_$af] -setup { set len 0 set spurious 0 set done 0 set timer [after 10000 "set done timed_out"] } -body { proc readlittle {s} { global spurious done len set l [read $s 1] if {[string length $l] == 0} { if {![eof $s]} { incr spurious } else { close $s set done 1 } } else { incr len [string length $l] } } proc accept {s a p} { fconfigure $s -buffering none -blocking off fileevent $s readable [list readlittle $s] } set s [socket -server accept -myaddr $localhost 0] set c [socket $localhost [lindex [fconfigure $s -sockname] 2]] puts -nonewline $c 01234567890123456789012345678901234567890123456789 close $c vwait done close $s list $spurious $len } -cleanup { after cancel $timer } -result {0 50} test socket_$af-9.2 {testing async write, fileevents, flush on close} -constraints [list socket supported_$af] -setup { set firstblock "" for {set i 0} {$i < 5} {incr i} {set firstblock "a$firstblock$firstblock"} set secondblock "" for {set i 0} {$i < 16} {incr i} { set secondblock "b$secondblock$secondblock" } set timer [after 10000 "set done timed_out"] set l [socket -server accept -myaddr $localhost 0] proc accept {s a p} { fconfigure $s -blocking 0 -translation lf -buffersize 16384 \ -buffering line fileevent $s readable "readable $s" } proc readable {s} { set l [gets $s] fileevent $s readable {} after idle respond $s } proc respond {s} { global firstblock puts -nonewline $s $firstblock after idle writedata $s } proc writedata {s} { global secondblock puts -nonewline $s $secondblock close $s } } -body { set s [socket $localhost [lindex [fconfigure $l -sockname] 2]] fconfigure $s -blocking 0 -trans lf -buffering line set count 0 puts $s hello proc readit {s} { global count done set l [read $s] incr count [string length $l] if {[eof $s]} { close $s set done 1 } } fileevent $s readable "readit $s" vwait done return $count } -cleanup { close $l after cancel $timer } -result 65566 test socket_$af-9.3 {testing EOF stickyness} -constraints [list socket supported_$af] -setup { set count 0 set done false proc write_then_close {s} { puts $s bye close $s } proc accept {s a p} { fconfigure $s -buffering line -translation lf fileevent $s writable "write_then_close $s" } set s [socket -server accept -myaddr $localhost 0] } -body { proc count_to_eof {s} { global count done set l [gets $s] if {[eof $s]} { incr count if {$count > 9} { close $s set done true set count {eof is sticky} } } } proc timerproc {s} { global done count set done true set count {timer went off, eof is not sticky} close $s } set c [socket $localhost [lindex [fconfigure $s -sockname] 2]] fconfigure $c -blocking off -buffering line -translation lf fileevent $c readable "count_to_eof $c" set timer [after 1000 timerproc $c] vwait done return $count } -cleanup { close $s after cancel $timer } -result {eof is sticky} removeFile script test socket_$af-10.1 {testing socket accept callback error handling} \ -constraints [list socket supported_$af] -setup { variable goterror 0 proc myHandler {msg options} { variable goterror 1 } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { set s [socket -server accept -myaddr $localhost 0] proc accept {s a p} {close $s; error} set c [socket $localhost [lindex [fconfigure $s -sockname] 2]] vwait goterror close $s close $c return $goterror } -cleanup { interp bgerror {} $handler } -result 1 test socket_$af-11.1 {tcp connection} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { puts $s done close $s } getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s [socket $remoteServerIP $port] gets $s } -cleanup { close $s sendCommand {close $server} } -result done test socket_$af-11.2 {client specifies its port} -setup { set lport [randport] set rport [sendCommand { set server [socket -server accept 0] proc accept {s a p} { puts $s $p close $s } getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s [socket -myport $lport $remoteServerIP $rport] set r [gets $s] expr {$r==$lport ? "ok" : "broken: $r != $port"} } -cleanup { close $s sendCommand {close $server} } -result ok test socket_$af-11.3 {trying to connect, no server} -body { set status ok if {![catch {set s [socket $remoteServerIp [randport]]}]} { if {![catch {gets $s}]} { set status broken } close $s } return $status } -constraints [list socket supported_$af doTestsWithRemoteServer] -result ok test socket_$af-11.4 {remote echo, one line} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line -translation crlf } proc echo {s} { set l [gets $s] if {[eof $s]} { close $s } else { puts $s $l } } getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set f [socket $remoteServerIP $port] fconfigure $f -translation crlf -buffering line puts $f hello gets $f } -cleanup { catch {close $f} sendCommand {close $server} } -result hello test socket_$af-11.5 {remote echo, 50 lines} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line -translation crlf } proc echo {s} { set l [gets $s] if {[eof $s]} { close $s } else { puts $s $l } } getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set f [socket $remoteServerIP $port] fconfigure $f -translation crlf -buffering line for {set cnt 0} {$cnt < 50} {incr cnt} { puts $f "hello, $cnt" if {[gets $f] != "hello, $cnt"} { break } } return $cnt } -cleanup { close $f sendCommand {close $server} } -result 50 test socket_$af-11.6 {socket conflict} -setup { set s1 [socket -server accept -myaddr $localhost 0] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s2 [socket -server accept -myaddr $localhost [getPort $s1]] list [getPort $s2] [close $s2] } -cleanup { close $s1 } -returnCodes error -result {couldn't open socket: address already in use} test socket_$af-11.7 {server with several clients} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { fconfigure $s -buffering line fileevent $s readable [list echo $s] } proc echo {s} { set l [gets $s] if {[eof $s]} { close $s } else { puts $s $l } } getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s1 [socket $remoteServerIP $port] fconfigure $s1 -buffering line set s2 [socket $remoteServerIP $port] fconfigure $s2 -buffering line set s3 [socket $remoteServerIP $port] fconfigure $s3 -buffering line for {set i 0} {$i < 100} {incr i} { puts $s1 hello,s1 gets $s1 puts $s2 hello,s2 gets $s2 puts $s3 hello,s3 gets $s3 } return $i } -cleanup { close $s1 close $s2 close $s3 sendCommand {close $server} } -result 100 test socket_$af-11.8 {client with several servers} -setup { lassign [sendCommand { set s1 [socket -server "accept server1" 0] set s2 [socket -server "accept server2" 0] set s3 [socket -server "accept server3" 0] proc accept {mp s a p} { puts $s $mp close $s } list [getPort $s1] [getPort $s2] [getPort $s3] }] p1 p2 p3 } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s1 [socket $remoteServerIP $p1] set s2 [socket $remoteServerIP $p2] set s3 [socket $remoteServerIP $p3] list [gets $s1] [gets $s1] [eof $s1] [gets $s2] [gets $s2] [eof $s2] \ [gets $s3] [gets $s3] [eof $s3] } -cleanup { close $s1 close $s2 close $s3 sendCommand { close $s1 close $s2 close $s3 } } -result {server1 {} 1 server2 {} 1 server3 {} 1} test socket_$af-11.9 {accept callback error} -constraints [list socket supported_$af doTestsWithRemoteServer] -setup { proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] set timer [after 10000 "set x timed_out"] } -body { set s [socket -server accept 0] proc accept {s a p} {expr {10 / 0}} sendCommand "set port [getPort $s]" if {[catch { sendCommand { set peername [fconfigure $callerSocket -peername] set s [socket [lindex $peername 0] $port] close $s } } msg]} then { close $s error $msg } vwait x return $x } -cleanup { close $s after cancel $timer interp bgerror {} $handler } -result {divide by zero} test socket_$af-11.10 {testing socket specific options} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} {close $s} getPort $server }] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { set s [socket $remoteServerIP $port] set p [fconfigure $s -peername] set n [fconfigure $s -sockname] list [expr {[lindex $p 2] == $port}] [llength $p] [llength $n] } -cleanup { close $s sendCommand {close $server} } -result {1 3 3} test socket_$af-11.11 {testing spurious events} -setup { set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { fconfigure $s -translation "auto lf" after idle writesome $s } proc writesome {s} { for {set i 0} {$i < 100} {incr i} { puts $s "line $i from remote server" } close $s } getPort $server }] set len 0 set spurious 0 set done 0 set timer [after 40000 "set done timed_out"] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { proc readlittle {s} { global spurious done len set l [read $s 1] if {[string length $l] == 0} { if {![eof $s]} { incr spurious } else { close $s set done 1 } } else { incr len [string length $l] } } set c [socket $remoteServerIP $port] fileevent $c readable "readlittle $c" vwait done list $spurious $len $done } -cleanup { after cancel $timer sendCommand {close $server} } -result {0 2690 1} test socket_$af-11.12 {testing EOF stickyness} -constraints [list socket supported_$af doTestsWithRemoteServer notWine] -setup { set counter 0 set done 0 set port [sendCommand { set server [socket -server accept 0] proc accept {s a p} { after idle close $s } getPort $server }] proc timed_out {} { global c done set done {timed_out, EOF is not sticky} close $c } set after_id [after 1000 timed_out] } -body { proc count_up {s} { global counter done set l [gets $s] if {[eof $s]} { incr counter if {$counter > 9} { set done {EOF is sticky} close $s } } } set c [socket $remoteServerIP $port] fileevent $c readable [list count_up $c] vwait done return $done } -cleanup { after cancel $after_id sendCommand {close $server} } -result {EOF is sticky} test socket_$af-11.13 {testing async write, async flush, async close} -setup { set port [sendCommand { set firstblock "" for {set i 0} {$i < 5} {incr i} { set firstblock "a$firstblock$firstblock" } set secondblock "" for {set i 0} {$i < 16} {incr i} { set secondblock "b$secondblock$secondblock" } set l [socket -server accept 0] proc accept {s a p} { fconfigure $s -blocking 0 -translation lf -buffersize 16384 \ -buffering line fileevent $s readable "readable $s" } proc readable {s} { set l [gets $s] fileevent $s readable {} after idle respond $s } proc respond {s} { global firstblock puts -nonewline $s $firstblock after idle writedata $s } proc writedata {s} { global secondblock puts -nonewline $s $secondblock close $s } getPort $l }] set timer [after 10000 "set done timed_out"] } -constraints [list socket supported_$af doTestsWithRemoteServer] -body { proc readit {s} { global count done set l [read $s] incr count [string length $l] if {[eof $s]} { close $s set done 1 } } set s [socket $remoteServerIP $port] fconfigure $s -blocking 0 -trans lf -buffering line set count 0 puts $s hello fileevent $s readable "readit $s" vwait done return $count } -cleanup { after cancel $timer sendCommand {close $l} } -result 65566 set path(script1) [makeFile {} script1] set path(script2) [makeFile {} script2] test socket_$af-12.1 {testing inheritance of server sockets} -setup { file delete $path(script1) file delete $path(script2) # Script1 is just a 10 second delay. If the server socket is inherited, it # will be held open for 10 seconds set f [open $path(script1) w] puts $f { fileevent stdin readable exit after 10000 exit vwait forever } close $f # Script2 creates the server socket, launches script1, and exits. # The server socket will now be closed unless script1 inherited it. set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] puts $f [list set delay $path(script1)] puts $f [list set localhost $localhost] puts $f { set f [socket -server accept -myaddr $localhost 0] proc accept { file addr port } { close $file } exec $tcltest $delay & puts [lindex [fconfigure $f -sockname] 2] close $f exit } close $f } -constraints [list socket supported_$af stdio exec] -body { # Launch script2 and wait 5 seconds ### exec [interpreter] script2 & set p [open "|[list [interpreter] $path(script2)]" r] # If we can still connect to the server, the socket got inherited. if {[catch {close [socket $localhost $listen]}]} { return {server socket was not inherited} } else { return {server socket was inherited} } } -cleanup { catch {close $p} } -result {server socket was not inherited} test socket_$af-12.2 {testing inheritance of client sockets} -setup { file delete $path(script1) file delete $path(script2) # Script1 is just a 20 second delay. If the server socket is inherited, it # will be held open for 20 seconds set f [open $path(script1) w] puts $f { fileevent stdin readable exit after 20000 exit vwait forever } close $f # Script2 opens the client socket and writes to it. It then launches # script1 and exits. If the child process inherited the client socket, the # socket will still be open. set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] puts $f [list set delay $path(script1)] puts $f [list set localhost $localhost] puts $f { gets stdin port set f [socket $localhost $port] exec $tcltest $delay & puts $f testing flush $f exit } close $f # If the socket doesn't hit end-of-file in 10 seconds, the script1 process # must have inherited the client. set timeout 0 set after [after 10000 {set x "client socket was inherited"}] } -constraints [list socket supported_$af stdio exec] -body { # Create the server socket set server [socket -server accept -myaddr $localhost 0] proc accept { file host port } { # When the client connects, establish the read handler global server close $server fileevent $file readable [list getdata $file] fconfigure $file -buffering line -blocking 0 set ::f $file } proc getdata { file } { # Read handler on the accepted socket. global x set status [catch {read $file} data] if {$status != 0} { set x "read failed, error was $data" } elseif {$data ne ""} { } elseif {[fblocked $file]} { } elseif {[eof $file]} { set x "client socket was not inherited" } else { set x "impossible case" } } # Launch the script2 process ### exec [interpreter] script2 & set p [open "|[list [interpreter] $path(script2)]" w] puts $p [lindex [fconfigure $server -sockname] 2] ; flush $p vwait x return $x } -cleanup { fconfigure $f -blocking 1 close $f after cancel $after close $p } -result {client socket was not inherited} test socket_$af-12.3 {testing inheritance of accepted sockets} -setup { file delete $path(script1) file delete $path(script2) set f [open $path(script1) w] puts $f { fileevent stdin readable exit after 10000 exit vwait forever } close $f set f [open $path(script2) w] puts $f [list set tcltest [interpreter]] puts $f [list set delay $path(script1)] puts $f [list set localhost $localhost] puts $f { set server [socket -server accept -myaddr $localhost 0] proc accept { file host port } { global tcltest delay puts $file {test data on socket} exec $tcltest $delay & after idle exit } puts stdout [lindex [fconfigure $server -sockname] 2] vwait forever } close $f } -constraints [list socket supported_$af stdio exec] -body { # Launch the script2 process and connect to it. See how long the socket # stays open ## exec [interpreter] script2 & set p [open "|[list [interpreter] $path(script2)]" r] gets $p listen set f [socket $localhost $listen] fconfigure $f -buffering full -blocking 0 fileevent $f readable [list getdata $f] # If the socket is still open after 5 seconds, the script1 process must # have inherited the accepted socket. set failed 0 set after [after 5000 [list set x "accepted socket was inherited"]] proc getdata { file } { # Read handler on the client socket. global x global failed set status [catch {read $file} data] if {$status != 0} { set x "read failed, error was $data" } elseif {[string compare {} $data]} { } elseif {[fblocked $file]} { } elseif {[eof $file]} { set x "accepted socket was not inherited" } else { set x "impossible case" } return } vwait x set x } -cleanup { fconfigure $f -blocking 1 close $f after cancel $after close $p } -result {accepted socket was not inherited} test socket_$af-13.1 {Testing use of shared socket between two threads} -body { # create a thread set serverthread [thread::create -preserved [string map [list @localhost@ $localhost] { set f [socket -server accept -myaddr @localhost@ 0] set listen [lindex [fconfigure $f -sockname] 2] proc accept {s a p} { fileevent $s readable [list echo $s] fconfigure $s -buffering line } proc echo {s} { global i set l [gets $s] if {[eof $s]} { global x close $s set x done } else { incr i puts $s $l } } set i 0 vwait x close $f }]] set port [thread::send $serverthread {set listen}] set s [socket $localhost $port] fconfigure $s -buffering line catch { puts $s "hello" gets $s result } close $s thread::release $serverthread append result " " [llength [thread::names]] } -result {hello 1} -constraints [list socket supported_$af thread] proc transf_test {{testmode transfer} {maxIter 1000} {maxTime 10000}} { try { set ::count 0 set ::testmode $testmode set port 0 set srvsock {} # if binding on port 0 is not possible (system related, blocked on ISPs etc): if {[catch {close [socket -async $::localhost $port]}]} { # simplest server on random port (immediately closing a connect): set port [randport] set srvsock [socket -server {apply {{ch args} {close $ch}}} -myaddr $::localhost $port] # socket on windows has some issues yet (e. g. bug [b6d0d8cc2c]), so we simply decrease iteration count (to 1/4): if {$::tcl_platform(platform) eq "windows" && $maxIter > 50} { set ::count [expr {$maxIter / 4 * 3 - 1}]; # bypass 3/4 iterations } } tcltest::DebugPuts 2 "== test \[$::localhost\]:$port $testmode ==" set ::parent [thread::id] # helper thread creating async connection and initiating transfer (detach) to parent: set ::helper [thread::create] thread::send -async $::helper [list \ lassign [list $::parent $::localhost $port $testmode] \ ::parent ::localhost ::port ::testmode ] thread::send -async $::helper { set ::helper [thread::id] proc iteration {args} { set fd [socket -async $::localhost $::port] if {"helper-writable" in $::testmode} {;# to test both sides during connect fileevent $fd writable [list apply {{fd} { if {[thread::id] ne $::helper} { thread::send -async $::parent {set ::count "ERROR: invalid thread, $::helper is expecting"} close $fd return } }} $fd] };# thread::detach $fd thread::send -async $::parent [list transf_parent $fd {*}$args] } iteration first } # parent proc committing transfer attempt (attach) and checking acquire was successful: proc transf_parent {fd args} { tcltest::DebugPuts 2 "** trma / $::count ** $args **" thread::attach $fd if {"parent-close" in $::testmode} {;# to test close during connect set ::count $::count close $fd return };# fileevent $fd writable [list apply {{fd} { if {[thread::id] ne $::parent} { thread::send -async $::parent {set ::count "ERROR: invalid thread, $::parent is expecting"} close $fd return } set ::count $::count close $fd }} $fd] } # repeat maxIter times (up to maxTime ms as timeout): set tout [after $maxTime {set ::count "TIMEOUT"}] while 1 { vwait ::count if {![string is integer $::count]} { # if timeout just skip (test was successful until now): if {$::count eq "TIMEOUT"} {::tcltest::Skip "timing issue"} break } if {[incr ::count] >= $maxIter} break tcltest::DebugPuts 2 "** iter / $::count **" thread::send -async $::helper [list iteration nr $::count] } update set ::count } finally { catch {after cancel $tout} if {$srvsock ne {}} {close $srvsock} if {[info exists ::helper]} {thread::release -wait $::helper} tcltest::DebugPuts 2 "== stop / $::count ==" unset -nocomplain ::count ::testmode ::parent ::helper } } test socket_$af-13.2.tr1 {Testing socket transfer between threads during async connect} -body { transf_test {transfer} 1000 } -result 1000 -constraints [list socket supported_$af thread] test socket_$af-13.2.tr2 {Testing socket transfer between threads during async connect} -body { transf_test {transfer helper-writable} 100 } -result 100 -constraints [list socket supported_$af thread] test socket_$af-13.2.cl1 {Testing socket transfer between threads during async connect} -body { transf_test {parent-close} 100 } -result 100 -constraints [list socket supported_$af thread] test socket_$af-13.2.cl2 {Testing socket transfer between threads during async connect} -body { transf_test {parent-close helper-writable} 100 } -result 100 -constraints [list socket supported_$af thread] catch {rename transf_parent {}} rename transf_test {} # ---------------------------------------------------------------------- removeFile script1 removeFile script2 # cleanup if {$remoteProcChan ne ""} { catch {sendCommand exit} } catch {close $commandSocket} catch {close $remoteProcChan} } unset ::tcl::unsupported::socketAF test socket-14.0.0 {[socket -async] when server only listens on IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { proc accept {s a p} { global x puts $s bye close $s set x ok } set server [socket -server accept -myaddr 127.0.0.1 0] set port [lindex [fconfigure $server -sockname] 2] } -body { set client [socket -async localhost $port] set after [after $latency {set x [fconfigure $client -error]}] vwait x set x } -cleanup { after cancel $after close $server close $client unset x } -result ok test socket-14.0.1 {[socket -async] when server only listens on IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { proc accept {s a p} { global x puts $s bye close $s set x ok } set server [socket -server accept -myaddr ::1 0] set port [lindex [fconfigure $server -sockname] 2] } -body { set client [socket -async localhost $port] set after [after $latency {set x [fconfigure $client -error]}] vwait x set x } -cleanup { after cancel $after close $server close $client unset x } -result ok test socket-14.1 {[socket -async] fileevent while still connecting} \ -constraints {socket} \ -setup { proc accept {s a p} { global x puts $s bye close $s lappend x ok } set server [socket -server accept -myaddr localhost 0] set port [lindex [fconfigure $server -sockname] 2] set x "" } -body { set client [socket -async localhost $port] fileevent $client writable { lappend x [fconfigure $client -error] fileevent $client writable {} } set after [after $latency {lappend x timeout}] while {[llength $x] < 2 && "timeout" ni $x} { vwait x } lsort $x; # we only want to see both events, the order doesn't matter } -cleanup { after cancel $after close $server close $client unset x } -result {{} ok} test socket-14.2 {[socket -async] fileevent connection refused} \ -constraints {socket} \ -body { set client [socket -async localhost [randport]] fileevent $client writable {set x ok} set after [after $latency {set x timeout}] vwait x after cancel $after lappend x [fconfigure $client -error] } -cleanup { after cancel $after close $client unset x after client } -result {ok {connection refused}} test socket-14.3 {[socket -async] when server only listens on IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { proc accept {s a p} { global x puts $s bye close $s set x ok } set server [socket -server accept -myaddr ::1 0] set port [lindex [fconfigure $server -sockname] 2] } -body { set client [socket -async localhost $port] set after [after $latency {set x [fconfigure $client -error]}] vwait x set x } -cleanup { after cancel $after close $server close $client unset x } -result ok test socket-14.4 {[socket -async] and both, readdable and writable fileevents} \ -constraints {socket} \ -setup { proc accept {s a p} { puts $s bye close $s } set server [socket -server accept -myaddr localhost 0] set port [lindex [fconfigure $server -sockname] 2] set x "" } -body { set client [socket -async localhost $port] fileevent $client writable { lappend x [fconfigure $client -error] fileevent $client writable {} } fileevent $client readable {lappend x [gets $client]} set after [after $latency {lappend x timeout}] while {[llength $x] < 2 && "timeout" ni $x} { vwait x } lsort $x } -cleanup { after cancel $after close $client close $server unset x } -result {{} bye} # FIXME: we should also have an IPv6 counterpart of this test socket-14.5 {[socket -async] which fails before any connect() can be made} \ -constraints {socket supported_inet notWine} \ -body { # address from rfc5737 socket -async -myaddr 192.0.2.42 127.0.0.1 [randport] } \ -returnCodes 1 \ -result {couldn't open socket: cannot assign requested address} test socket-14.6.0 {[socket -async] with no event loop and server listening on IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { proc accept {s a p} { global x puts $s bye close $s set x ok } set server [socket -server accept -myaddr 127.0.0.1 0] set port [lindex [fconfigure $server -sockname] 2] set x "" } \ -body { set client [socket -async localhost $port] for {set i 0} {$i < 50} {incr i } { update if {$x ne ""} { lappend x [gets $client] break } after 100 } set x } \ -cleanup { close $server close $client unset x } \ -result {ok bye} test socket-14.6.1 {[socket -async] with no event loop and server listening on IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { proc accept {s a p} { global x puts $s bye close $s set x ok } set server [socket -server accept -myaddr ::1 0] set port [lindex [fconfigure $server -sockname] 2] set x "" } \ -body { set client [socket -async localhost $port] for {set i 0} {$i < 50} {incr i } { update if {$x ne ""} { lappend x [gets $client] break } after 100 } set x } \ -cleanup { close $server close $client unset x } \ -result {ok bye} test socket-14.7.0 {pending [socket -async] and blocking [gets], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr 127.0.0.1 0] proc accept {s h p} {puts $s ok; close $s; set ::x 1} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] list [fconfigure $sock -error] [gets $sock] [fconfigure $sock -error] } -cleanup { close $fd close $sock removeFile script } -result {{} ok {}} test socket-14.7.1 {pending [socket -async] and blocking [gets], server is IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr ::1 0] proc accept {s h p} {puts $s ok; close $s; set ::x 1} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] list [fconfigure $sock -error] [gets $sock] [fconfigure $sock -error] } -cleanup { close $fd close $sock removeFile script } -result {{} ok {}} test socket-14.7.2 {pending [socket -async] and blocking [gets], no listener} \ -constraints {socket} \ -body { set sock [socket -async localhost [randport]] catch {gets $sock} x list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock } -match glob -result {{error reading "sock*": transport endpoint is not connected} {connection refused} {}} test socket-14.8.0 {pending [socket -async] and nonblocking [gets], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr 127.0.0.1 0] proc accept {s h p} {puts $s ok; close $s; set ::x 1} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] fconfigure $sock -blocking 0 for {set i 0} {$i < 50} {incr i } { if {[catch {gets $sock} x] || $x ne "" || ![fblocked $sock]} break after 200 } set x } -cleanup { close $fd close $sock removeFile script } -result {ok} test socket-14.8.1 {pending [socket -async] and nonblocking [gets], server is IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr ::1 0] proc accept {s h p} {puts $s ok; close $s; set ::x 1} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] fconfigure $sock -blocking 0 for {set i 0} {$i < 50} {incr i } { if {[catch {gets $sock} x] || $x ne "" || ![fblocked $sock]} break after 200 } set x } -cleanup { close $fd close $sock removeFile script } -result {ok} test socket-14.8.2 {pending [socket -async] and nonblocking [gets], no listener} \ -constraints {socket} \ -body { set sock [socket -async localhost [randport]] fconfigure $sock -blocking 0 for {set i 0} {$i < 50} {incr i } { if {[catch {gets $sock} x] || $x ne "" || ![fblocked $sock]} break after 200 } list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock } -match glob -result {{error reading "sock*": transport endpoint is not connected} {connection refused} {}} test socket-14.9.0 {pending [socket -async] and blocking [puts], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr 127.0.0.1 0] proc accept {s h p} {set ::x $s} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x puts [gets $x] } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] puts $sock ok flush $sock list [fconfigure $sock -error] [gets $fd] } -cleanup { close $fd close $sock removeFile script } -result {{} ok} test socket-14.9.1 {pending [socket -async] and blocking [puts], server is IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr ::1 0] proc accept {s h p} {set ::x $s} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x puts [gets $x] } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] puts $sock ok flush $sock list [fconfigure $sock -error] [gets $fd] } -cleanup { close $fd close $sock removeFile script } -result {{} ok} test socket-14.10.0 {pending [socket -async] and nonblocking [puts], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr 127.0.0.1 0] proc accept {s h p} {set ::x $s} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x puts [gets $x] } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] fconfigure $sock -blocking 0 puts $sock ok flush $sock fileevent $fd readable {set x 1} vwait x list [fconfigure $sock -error] [gets $fd] } -cleanup { close $fd close $sock removeFile script } -result {{} ok} test socket-14.10.1 {pending [socket -async] and nonblocking [puts], server is IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { makeFile { fileevent stdin readable exit set server [socket -server accept -myaddr ::1 0] proc accept {s h p} {set ::x $s} puts [lindex [fconfigure $server -sockname] 2] flush stdout vwait x puts [gets $x] } script set fd [open |[list [interpreter] script] RDWR] set port [gets $fd] } -body { set sock [socket -async localhost $port] fconfigure $sock -blocking 0 puts $sock ok flush $sock fileevent $fd readable {set x 1} vwait x list [fconfigure $sock -error] [gets $fd] } -cleanup { close $fd close $sock removeFile script } -result {{} ok} test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener, no flush} \ -constraints {socket notWinCI} \ -body { set sock [socket -async localhost [randport]] fconfigure $sock -blocking 0 puts $sock ok fileevent $sock writable {set x 1} vwait x close $sock } -cleanup { catch {close $sock} unset x } -result {transport endpoint is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ -constraints {socket testsocket_testflags} \ -body { set sock [socket -async localhost [randport]] # Set the socket in async test mode. # The async connect will not be continued on the following fconfigure # and puts/flush. Thus, the connect will fail after them. testsocket testflags $sock 1 fconfigure $sock -blocking 0 puts $sock ok flush $sock testsocket testflags $sock 0 fileevent $sock writable {set x 1} vwait x close $sock } -cleanup { catch {close $sock} catch {unset x} } -result {transport endpoint is not connected} -returnCodes 1 test socket-14.12 {[socket -async] background progress triggered by [fconfigure -error]} \ -constraints {socket} \ -body { set s [socket -async localhost [randport]] for {set i 0} {$i < 50} {incr i} { set x [fconfigure $s -error] if {$x ne ""} break after 200 } set x } -cleanup { close $s unset x s } -result {connection refused} test socket-14.13 {testing writable event when quick failure} \ -constraints {socket win supported_inet notWine} \ -body { # Test for bug 336441ed59 where a quick background fail was ignored # Test only for windows as socket -async 255.255.255.255 fails # directly on Unix # The following connect should fail very quickly set a1 [after 2000 {set x timeout}] set s [socket -async 255.255.255.255 43434] fileevent $s writable {set x writable} vwait x set x } -cleanup { catch {close $s} after cancel $a1 } -result writable test socket-14.14 {testing fileevent readable on failed async socket connect} \ -constraints {socket} -body { # Test for bug 581937ab1e set a1 [after 5000 {set x timeout}] # This connect should fail set s [socket -async localhost [randport]] fileevent $s readable {set x readable} vwait x set x } -cleanup { catch {close $s} after cancel $a1 } -result readable test socket-14.15 {blocking read on async socket should not trigger event handlers} \ -constraints socket -body { set s [socket -async localhost [randport]] set x ok fileevent $s writable {set x fail} catch {read $s} close $s set x } -result ok # v4 and v6 is required to prevent that the async connect does not terminate # before the fconfigure command. There is always an additional ip to try. test socket-14.16 {empty -peername while [socket -async] connecting} \ -constraints {socket localhost_v4 localhost_v6} \ -body { set client [socket -async localhost [randport]] fconfigure $client -peername } -cleanup { catch {close $client} } -result {} # v4 and v6 is required to prevent that the async connect does not terminate # before the fconfigure command. There is always an additional ip to try. test socket-14.17 {empty -sockname while [socket -async] connecting} \ -constraints {socket localhost_v4 localhost_v6} \ -body { set client [socket -async localhost [randport]] fconfigure $client -sockname } -cleanup { catch {close $client} } -result {} # test for bug c6ed4acfd8: running async socket connect with other connect # established will block tcl as it goes in an infinite loop in vwait test socket-14.18 {bug c6ed4acfd8: running async socket connect made other connect block} \ -constraints {socket} \ -body { proc accept {channel address port} {} set port [randport] set ssock [socket -server accept $port] set csock1 [socket -async localhost [randport]] set csock2 [socket localhost $port] after 1000 {set done ok} vwait done } -cleanup { catch {close $ssock} catch {close $csock1} catch {close $csock2} } -result {} test socket-14.19 {tip 456 -- introduce the -reuseport option} \ -constraints {socket notWine} \ -body { proc accept {channel address port} {} set port [randport] set ssock1 [socket -server accept -reuseport yes $port] set ssock2 [socket -server accept -reuseport yes $port] return ok } -cleanup { catch {close $ssock1} catch {close $ssock2} } -result ok set num 0 set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}} set resultok {-result "sock*" -match glob} set resulterr { -result {couldn't open socket: connection refused} -returnCodes 1 } foreach {servip sc} $x { foreach {cliip cc} $x { set constraints socket lappend constraints $sc $cc set result $resulterr switch -- [lsort -unique [list $servip $cliip]] { localhost - 127.0.0.1 - ::1 { set result $resultok } {127.0.0.1 localhost} { if {[testConstraint localhost_v4]} { set result $resultok } } {::1 localhost} { if {[testConstraint localhost_v6]} { set result $resultok } } } test socket-15.1.$num "Connect to $servip from $cliip" \ -constraints $constraints -setup { set server [socket -server accept -myaddr $servip 0] proc accept {s h p} { close $s } set port [lindex [fconfigure $server -sockname] 2] } -body { set s [socket $cliip $port] } -cleanup { close $server catch {close $s} } {*}$result incr num } } test socket-bug-31fc36fe47 "Crash listening in multiple threads" \ -constraints thread -body { close [socket -server xxx 0] set tid [thread::create] thread::send $tid {close [socket -server accept 0]} thread::release $tid } -result 0 ::tcltest::cleanupTests flush stdout return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/set.test0000644000175000017500000004271215104661341014413 0ustar sergeisergei# Commands covered: set # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testset2 [llength [info commands testset2]] catch {unset x} catch {unset i} test set-1.1 {TclCompileSetCmd: missing variable name} { list [catch {set} msg] $msg } {1 {wrong # args: should be "set varName ?newValue?"}} test set-1.2 {TclCompileSetCmd: simple variable name} { set i 10 list [set i] $i } {10 10} test set-1.3 {TclCompileSetCmd: error compiling variable name} { set i 10 catch {set "i"xxx} msg set msg } {extra characters after close-quote} test set-1.4 {TclCompileSetCmd: simple variable name in quotes} { set i 17 list [set "i"] $i } {17 17} test set-1.5 {TclCompileSetCmd: simple variable name in braces} -setup { catch {unset {a simple var}} } -body { set {a simple var} 27 list [set {a simple var}] ${a simple var} } -result {27 27} test set-1.6 {TclCompileSetCmd: simple array variable name} -setup { catch {unset a} } -body { set a(foo) 37 list [set a(foo)] $a(foo) } -result {37 37} test set-1.7 {TclCompileSetCmd: non-simple (computed) variable name} { set x "i" set i 77 list [set $x] $i } {77 77} test set-1.8 {TclCompileSetCmd: non-simple (computed) variable name} { set x "i" set i 77 list [set [set x] 2] $i } {2 2} test set-1.9 {TclCompileSetCmd: 3rd arg => assignment} { set i "abcdef" list [set i] $i } {abcdef abcdef} test set-1.10 {TclCompileSetCmd: only two args => just getting value} { set i {one two} set i } {one two} test set-1.11 {TclCompileSetCmd: simple global name} { proc p {} { global i set i 54 set i } p } {54} test set-1.12 {TclCompileSetCmd: simple local name} { proc p {bar} { set foo $bar set foo } p 999 } {999} test set-1.13 {TclCompileSetCmd: simple but new (unknown) local name} { proc p {} { set bar } catch {p} msg set msg } {can't read "bar": no such variable} test set-1.14 {TclCompileSetCmd: simple local name, >255 locals} { proc 260locals {} { # create 260 locals (the last ones with index > 255) set a0 0; set a1 0; set a2 0; set a3 0; set a4 0 set a5 0; set a6 0; set a7 0; set a8 0; set a9 0 set b0 0; set b1 0; set b2 0; set b3 0; set b4 0 set b5 0; set b6 0; set b7 0; set b8 0; set b9 0 set c0 0; set c1 0; set c2 0; set c3 0; set c4 0 set c5 0; set c6 0; set c7 0; set c8 0; set c9 0 set d0 0; set d1 0; set d2 0; set d3 0; set d4 0 set d5 0; set d6 0; set d7 0; set d8 0; set d9 0 set e0 0; set e1 0; set e2 0; set e3 0; set e4 0 set e5 0; set e6 0; set e7 0; set e8 0; set e9 0 set f0 0; set f1 0; set f2 0; set f3 0; set f4 0 set f5 0; set f6 0; set f7 0; set f8 0; set f9 0 set g0 0; set g1 0; set g2 0; set g3 0; set g4 0 set g5 0; set g6 0; set g7 0; set g8 0; set g9 0 set h0 0; set h1 0; set h2 0; set h3 0; set h4 0 set h5 0; set h6 0; set h7 0; set h8 0; set h9 0 set i0 0; set i1 0; set i2 0; set i3 0; set i4 0 set i5 0; set i6 0; set i7 0; set i8 0; set i9 0 set j0 0; set j1 0; set j2 0; set j3 0; set j4 0 set j5 0; set j6 0; set j7 0; set j8 0; set j9 0 set k0 0; set k1 0; set k2 0; set k3 0; set k4 0 set k5 0; set k6 0; set k7 0; set k8 0; set k9 0 set l0 0; set l1 0; set l2 0; set l3 0; set l4 0 set l5 0; set l6 0; set l7 0; set l8 0; set l9 0 set m0 0; set m1 0; set m2 0; set m3 0; set m4 0 set m5 0; set m6 0; set m7 0; set m8 0; set m9 0 set n0 0; set n1 0; set n2 0; set n3 0; set n4 0 set n5 0; set n6 0; set n7 0; set n8 0; set n9 0 set o0 0; set o1 0; set o2 0; set o3 0; set o4 0 set o5 0; set o6 0; set o7 0; set o8 0; set o9 0 set p0 0; set p1 0; set p2 0; set p3 0; set p4 0 set p5 0; set p6 0; set p7 0; set p8 0; set p9 0 set q0 0; set q1 0; set q2 0; set q3 0; set q4 0 set q5 0; set q6 0; set q7 0; set q8 0; set q9 0 set r0 0; set r1 0; set r2 0; set r3 0; set r4 0 set r5 0; set r6 0; set r7 0; set r8 0; set r9 0 set s0 0; set s1 0; set s2 0; set s3 0; set s4 0 set s5 0; set s6 0; set s7 0; set s8 0; set s9 0 set t0 0; set t1 0; set t2 0; set t3 0; set t4 0 set t5 0; set t6 0; set t7 0; set t8 0; set t9 0 set u0 0; set u1 0; set u2 0; set u3 0; set u4 0 set u5 0; set u6 0; set u7 0; set u8 0; set u9 0 set v0 0; set v1 0; set v2 0; set v3 0; set v4 0 set v5 0; set v6 0; set v7 0; set v8 0; set v9 0 set w0 0; set w1 0; set w2 0; set w3 0; set w4 0 set w5 0; set w6 0; set w7 0; set w8 0; set w9 0 set x0 0; set x1 0; set x2 0; set x3 0; set x4 0 set x5 0; set x6 0; set x7 0; set x8 0; set x9 0 set y0 0; set y1 0; set y2 0; set y3 0; set y4 0 set y5 0; set y6 0; set y7 0; set y8 0; set y9 0 set z0 0; set z1 0; set z2 0; set z3 0; set z4 0 set z5 0; set z6 0; set z7 0; set z8 0; set z9 1234 } 260locals } {1234} test set-1.15 {TclCompileSetCmd: variable is array} -setup { catch {unset a} } -body { set x 27 set x [set a(foo) 11] catch {unset a} set x } -result 11 test set-1.16 {TclCompileSetCmd: variable is array, elem substitutions} -setup { catch {unset a} } -body { set i 5 set x 789 set a(foo5) 27 set x [set a(foo$i)] catch {unset a} set x } -result 27 test set-1.17 {TclCompileSetCmd: doing assignment, simple int} { set i 5 set i 123 } 123 test set-1.18 {TclCompileSetCmd: doing assignment, simple int} { set i 5 set i -100 } -100 test set-1.19 {TclCompileSetCmd: doing assignment, simple but not int} { set i 5 set i 0x12MNOP set i } {0x12MNOP} test set-1.20 {TclCompileSetCmd: doing assignment, in quotes} { set i 25 set i "-100" } -100 test set-1.21 {TclCompileSetCmd: doing assignment, in braces} { set i 24 set i {126} } 126 test set-1.22 {TclCompileSetCmd: doing assignment, large int} { set i 5 set i 200000 } 200000 test set-1.23 {TclCompileSetCmd: doing assignment, formatted int != int} { set i 25 set i 0o00012345 ;# an octal literal == 5349 decimal list $i [incr i] } {0o00012345 5350} test set-1.24 {TclCompileSetCmd: too many arguments} { set i 10 catch {set i 20 30} msg set msg } {wrong # args: should be "set varName ?newValue?"} test set-1.25 {TclCompileSetCmd: var is array, braced (no subs)} { # This was a known error in 8.1a* - 8.2.1 catch {unset array} set {array($foo)} 5 } 5 test set-1.26 {TclCompileSetCmd: various array constructs} { # Test all kinds of array constructs that TclCompileSetCmd # may feel inclined to tamper with. apply {{} { set a x set be(hej) 1 ; # hej set be($a) 1 ; # x set {be($a)} 1 ; # $a set be($a,hej) 1 ; # x,hej set be($a,$a) 5 ; # x,x set be(c($a) 1 ; # c(x set be(\w\w) 1 ; # ww set be(a:$a) [set be(x,$a)] ; # a:x set be(hej,$be($a,hej),hej) 1 ; # hej,1,hej set be([string range hugge 0 2]) 1 ; # hug set be(a\ a) 1 ; # a a set be($a\ ,[string range hugge 1 3],hej) 1 ; # x ,ugg,hej set be($a,h"ej) 1 ; # x,h"ej set be([string range "a b c" 2 end]) 1 ; # b c set [string range bet 0 1](foo) 1 ; # foo set be([set be(a:$a)][set b\e($a)]) 1 ; # 51 return [lsort [array names be]] }} } [lsort {hej x $a x,hej x,x c(x ww a:x hej,1,hej hug {a a} {x ,ugg,hej} x,h"ej {b c} foo 51}]; # " just a matching end quote test set-2.1 {set command: runtime error, bad variable name} -setup { unset -nocomplain {"foo} } -body { list [catch {set {"foo}} msg] $msg $::errorInfo } -result {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable while executing "set {"foo}"}} # Stop my editor highlighter " from being confused test set-2.2 {set command: runtime error, not array variable} -setup { unset -nocomplain b } -body { set b 44 list [catch {set b(123)} msg] $msg } -result {1 {can't read "b(123)": variable isn't array}} test set-2.3 {set command: runtime error, errors in reading variables} -setup { unset -nocomplain a } -body { set a(6) 44 list [catch {set a(18)} msg] $msg } -result {1 {can't read "a(18)": no such element in array}} test set-2.4 {set command: runtime error, readonly variable} -setup { unset -nocomplain x } -body { proc readonly args {error "variable is read-only"} set x 123 trace add var x write readonly list [catch {set x 1} msg] $msg $::errorInfo } -match glob -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing * "set x 1"}} test set-2.5 {set command: runtime error, basic array operations} -setup { unset -nocomplain a } -body { array set a {} list [catch {set a(other)} msg] $msg } -result {1 {can't read "a(other)": no such element in array}} test set-2.6 {set command: runtime error, basic array operations} -setup { unset -nocomplain a } -body { array set a {} list [catch {set a} msg] $msg } -result {1 {can't read "a": variable is array}} # Test the uncompiled version of set catch {unset a} catch {unset b} catch {unset i} catch {unset x} test set-3.1 {uncompiled set command: missing variable name} { set z set list [catch {$z} msg] $msg } {1 {wrong # args: should be "set varName ?newValue?"}} test set-3.2 {uncompiled set command: simple variable name} { set z set $z i 10 list [$z i] $i } {10 10} test set-3.3 {uncompiled set command: error compiling variable name} { set z set $z i 10 catch {$z "i"xxx} msg $z msg } {extra characters after close-quote} test set-3.4 {uncompiled set command: simple variable name in quotes} { set z set $z i 17 list [$z "i"] $i } {17 17} test set-3.5 {uncompiled set command: simple variable name in braces} { set z set catch {unset {a simple var}} $z {a simple var} 27 list [$z {a simple var}] ${a simple var} } {27 27} test set-3.6 {uncompiled set command: simple array variable name} { set z set catch {unset a} $z a(foo) 37 list [$z a(foo)] $a(foo) } {37 37} test set-3.7 {uncompiled set command: non-simple (computed) variable name} { set z set $z x "i" $z i 77 list [$z $x] $i } {77 77} test set-3.8 {uncompiled set command: non-simple (computed) variable name} { set z set $z x "i" $z i 77 list [$z [$z x] 2] $i } {2 2} test set-3.9 {uncompiled set command: 3rd arg => assignment} { set z set $z i "abcdef" list [$z i] $i } {abcdef abcdef} test set-3.10 {uncompiled set command: only two args => just getting value} { set z set $z i {one two} $z i } {one two} test set-3.11 {uncompiled set command: simple global name} { proc p {} { set z set global i $z i 54 $z i } p } {54} test set-3.12 {uncompiled set command: simple local name} { proc p {bar} { set z set $z foo $bar $z foo } p 999 } {999} test set-3.13 {uncompiled set command: simple but new (unknown) local name} { set z set proc p {} { set z set $z bar } catch {p} msg $z msg } {can't read "bar": no such variable} test set-3.14 {uncompiled set command: simple local name, >255 locals} { proc 260locals {} { set z set # create 260 locals (the last ones with index > 255) $z a0 0; $z a1 0; $z a2 0; $z a3 0; $z a4 0 $z a5 0; $z a6 0; $z a7 0; $z a8 0; $z a9 0 $z b0 0; $z b1 0; $z b2 0; $z b3 0; $z b4 0 $z b5 0; $z b6 0; $z b7 0; $z b8 0; $z b9 0 $z c0 0; $z c1 0; $z c2 0; $z c3 0; $z c4 0 $z c5 0; $z c6 0; $z c7 0; $z c8 0; $z c9 0 $z d0 0; $z d1 0; $z d2 0; $z d3 0; $z d4 0 $z d5 0; $z d6 0; $z d7 0; $z d8 0; $z d9 0 $z e0 0; $z e1 0; $z e2 0; $z e3 0; $z e4 0 $z e5 0; $z e6 0; $z e7 0; $z e8 0; $z e9 0 $z f0 0; $z f1 0; $z f2 0; $z f3 0; $z f4 0 $z f5 0; $z f6 0; $z f7 0; $z f8 0; $z f9 0 $z g0 0; $z g1 0; $z g2 0; $z g3 0; $z g4 0 $z g5 0; $z g6 0; $z g7 0; $z g8 0; $z g9 0 $z h0 0; $z h1 0; $z h2 0; $z h3 0; $z h4 0 $z h5 0; $z h6 0; $z h7 0; $z h8 0; $z h9 0 $z i0 0; $z i1 0; $z i2 0; $z i3 0; $z i4 0 $z i5 0; $z i6 0; $z i7 0; $z i8 0; $z i9 0 $z j0 0; $z j1 0; $z j2 0; $z j3 0; $z j4 0 $z j5 0; $z j6 0; $z j7 0; $z j8 0; $z j9 0 $z k0 0; $z k1 0; $z k2 0; $z k3 0; $z k4 0 $z k5 0; $z k6 0; $z k7 0; $z k8 0; $z k9 0 $z l0 0; $z l1 0; $z l2 0; $z l3 0; $z l4 0 $z l5 0; $z l6 0; $z l7 0; $z l8 0; $z l9 0 $z m0 0; $z m1 0; $z m2 0; $z m3 0; $z m4 0 $z m5 0; $z m6 0; $z m7 0; $z m8 0; $z m9 0 $z n0 0; $z n1 0; $z n2 0; $z n3 0; $z n4 0 $z n5 0; $z n6 0; $z n7 0; $z n8 0; $z n9 0 $z o0 0; $z o1 0; $z o2 0; $z o3 0; $z o4 0 $z o5 0; $z o6 0; $z o7 0; $z o8 0; $z o9 0 $z p0 0; $z p1 0; $z p2 0; $z p3 0; $z p4 0 $z p5 0; $z p6 0; $z p7 0; $z p8 0; $z p9 0 $z q0 0; $z q1 0; $z q2 0; $z q3 0; $z q4 0 $z q5 0; $z q6 0; $z q7 0; $z q8 0; $z q9 0 $z r0 0; $z r1 0; $z r2 0; $z r3 0; $z r4 0 $z r5 0; $z r6 0; $z r7 0; $z r8 0; $z r9 0 $z s0 0; $z s1 0; $z s2 0; $z s3 0; $z s4 0 $z s5 0; $z s6 0; $z s7 0; $z s8 0; $z s9 0 $z t0 0; $z t1 0; $z t2 0; $z t3 0; $z t4 0 $z t5 0; $z t6 0; $z t7 0; $z t8 0; $z t9 0 $z u0 0; $z u1 0; $z u2 0; $z u3 0; $z u4 0 $z u5 0; $z u6 0; $z u7 0; $z u8 0; $z u9 0 $z v0 0; $z v1 0; $z v2 0; $z v3 0; $z v4 0 $z v5 0; $z v6 0; $z v7 0; $z v8 0; $z v9 0 $z w0 0; $z w1 0; $z w2 0; $z w3 0; $z w4 0 $z w5 0; $z w6 0; $z w7 0; $z w8 0; $z w9 0 $z x0 0; $z x1 0; $z x2 0; $z x3 0; $z x4 0 $z x5 0; $z x6 0; $z x7 0; $z x8 0; $z x9 0 $z y0 0; $z y1 0; $z y2 0; $z y3 0; $z y4 0 $z y5 0; $z y6 0; $z y7 0; $z y8 0; $z y9 0 $z z0 0; $z z1 0; $z z2 0; $z z3 0; $z z4 0 $z z5 0; $z z6 0; $z z7 0; $z z8 0; $z z9 1234 } 260locals } {1234} test set-3.15 {uncompiled set command: variable is array} { set z set catch {unset a} $z x 27 $z x [$z a(foo) 11] catch {unset a} $z x } 11 test set-3.16 {uncompiled set command: variable is array, elem substitutions} { set z set catch {unset a} $z i 5 $z x 789 $z a(foo5) 27 $z x [$z a(foo$i)] catch {unset a} $z x } 27 test set-3.17 {uncompiled set command: doing assignment, simple int} { set z set $z i 5 $z i 123 } 123 test set-3.18 {uncompiled set command: doing assignment, simple int} { set z set $z i 5 $z i -100 } -100 test set-3.19 {uncompiled set command: doing assignment, simple but not int} { set z set $z i 5 $z i 0x12MNOP $z i } {0x12MNOP} test set-3.20 {uncompiled set command: doing assignment, in quotes} { set z set $z i 25 $z i "-100" } -100 test set-3.21 {uncompiled set command: doing assignment, in braces} { set z set $z i 24 $z i {126} } 126 test set-3.22 {uncompiled set command: doing assignment, large int} { set z set $z i 5 $z i 200000 } 200000 test set-3.23 {uncompiled set command: doing assignment, formatted int != int} { set z set $z i 25 $z i 0o00012345 ;# an octal literal == 5349 decimal list $i [incr i] } {0o00012345 5350} test set-3.24 {uncompiled set command: too many arguments} { set z set $z i 10 catch {$z i 20 30} msg $z msg } {wrong # args: should be "set varName ?newValue?"} test set-4.1 {uncompiled set command: runtime error, bad variable name} -setup { unset -nocomplain {"foo} } -body { set z set list [catch {$z {"foo}} msg] $msg $::errorInfo } -result {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable while executing "$z {"foo}"}} # Stop my editor highlighter " from being confused test set-4.2 {uncompiled set command: runtime error, not array variable} -setup { catch {unset b} } -body { set z set $z b 44 list [catch {$z b(123)} msg] $msg } -result {1 {can't read "b(123)": variable isn't array}} test set-4.3 {uncompiled set command: runtime error, errors in reading variables} -setup { catch {unset a} } -body { set z set $z a(6) 44 list [catch {$z a(18)} msg] $msg } -result {1 {can't read "a(18)": no such element in array}} test set-4.4 {uncompiled set command: runtime error, readonly variable} -body { set z set proc readonly args {error "variable is read-only"} $z x 123 trace add var x write readonly list [catch {$z x 1} msg] $msg $::errorInfo } -match glob -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing * "$z x 1"}} test set-4.5 {uncompiled set command: runtime error, basic array operations} -setup { unset -nocomplain a array set a {} } -body { set z set list [catch {$z a(other)} msg] $msg } -result {1 {can't read "a(other)": no such element in array}} test set-4.6 {set command: runtime error, basic array operations} -setup { unset -nocomplain a array set a {} } -body { set z set list [catch {$z a} msg] $msg } -result {1 {can't read "a": variable is array}} test set-5.1 {error on malformed array name} -constraints testset2 -setup { unset -nocomplain z } -body { catch {testset2 z(a) b} msg catch {testset2 z(b) a} msg1 list $msg $msg1 } -result {{can't read "z(a)(b)": variable isn't array} {can't read "z(b)(a)": variable isn't array}} # In a mem-debug build, this test will crash unless Bug 3602706 is fixed. test set-5.2 {Bug 3602706} -body { testset2 ::tcl_platform not-in-there } -returnCodes error -result * -match glob # cleanup catch {unset a} catch {unset b} catch {unset i} catch {unset x} catch {unset z} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/set-old.test0000644000175000017500000007464715104661341015203 0ustar sergeisergei# Commands covered: set, unset, array # # This file includes the original set of tests for Tcl's set command. # Since the set command is now compiled, a new set of tests covering # the new implementation is in the file "set.test". Sourcing this file # into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } proc ignore args {} # Simple variable operations. catch {unset a} test set-old-1.1 {basic variable setting and unsetting} { set a 22 } 22 test set-old-1.2 {basic variable setting and unsetting} { set a 123 set a } 123 test set-old-1.3 {basic variable setting and unsetting} { set a xxx format %s $a } xxx test set-old-1.4 {basic variable setting and unsetting} { set a 44 unset a list [catch {set a} msg] $msg } {1 {can't read "a": no such variable}} # Basic array operations. catch {unset a} set a(xyz) 2 set a(44) 3 set {a(a long name)} test test set-old-2.1 {basic array operations} { lsort [array names a] } {44 {a long name} xyz} test set-old-2.2 {basic array operations} { set a(44) } 3 test set-old-2.3 {basic array operations} { set a(xyz) } 2 test set-old-2.4 {basic array operations} { set "a(a long name)" } test test set-old-2.5 {basic array operations} { list [catch {set a(other)} msg] $msg } {1 {can't read "a(other)": no such element in array}} test set-old-2.6 {basic array operations} { list [catch {set a} msg] $msg } {1 {can't read "a": variable is array}} test set-old-2.7 {basic array operations} { format %s $a(44) } 3 test set-old-2.8 {basic array operations} { format %s $a(a long name) } test unset a(44) test set-old-2.9 {basic array operations} { lsort [array names a] } {{a long name} xyz} test set-old-2.10 {basic array operations} { catch {unset b} list [catch {set b(123)} msg] $msg } {1 {can't read "b(123)": no such variable}} test set-old-2.11 {basic array operations} { catch {unset b} set b 44 list [catch {set b(123)} msg] $msg } {1 {can't read "b(123)": variable isn't array}} test set-old-2.12 {basic array operations} { list [catch {set a 14} msg] $msg } {1 {can't set "a": variable is array}} unset a test set-old-2.13 {basic array operations} { list [catch {set a(xyz)} msg] $msg } {1 {can't read "a(xyz)": no such variable}} # Test the set commands, and exercise the corner cases of the code # that parses array references into two parts. test set-old-3.1 {set command} { list [catch {set} msg] $msg } {1 {wrong # args: should be "set varName ?newValue?"}} test set-old-3.2 {set command} { list [catch {set x y z} msg] $msg } {1 {wrong # args: should be "set varName ?newValue?"}} test set-old-3.3 {set command} { catch {unset a} list [catch {set a} msg] $msg } {1 {can't read "a": no such variable}} test set-old-3.4 {set command} { catch {unset a} set a(14) 83 list [catch {set a 22} msg] $msg } {1 {can't set "a": variable is array}} # Test the corner-cases of parsing array names, using set and unset. test set-old-4.1 {parsing array names} { catch {unset a} set a(()) 44 list [catch {array names a} msg] $msg } {0 ()} test set-old-4.2 {parsing array names} { catch {unset a a(abcd} set a(abcd 33 info exists a(abcd } 1 test set-old-4.3 {parsing array names} { catch {unset a a(abcd} set a(abcd 33 list [catch {array names a} msg] $msg } {0 {}} test set-old-4.4 {parsing array names} { catch {unset a abcd)} set abcd) 33 info exists abcd) } 1 test set-old-4.5 {parsing array names} { set a(bcd yyy catch {unset a} list [catch {set a(bcd} msg] $msg } {0 yyy} test set-old-4.6 {parsing array names} { catch {unset a} set a 44 list [catch {set a(bcd test} msg] $msg } {0 test} # Errors in reading variables test set-old-5.1 {errors in reading variables} { catch {unset a} list [catch {set a} msg] $msg } {1 {can't read "a": no such variable}} test set-old-5.2 {errors in reading variables} { catch {unset a} set a 44 list [catch {set a(18)} msg] $msg } {1 {can't read "a(18)": variable isn't array}} test set-old-5.3 {errors in reading variables} { catch {unset a} set a(6) 44 list [catch {set a(18)} msg] $msg } {1 {can't read "a(18)": no such element in array}} test set-old-5.4 {errors in reading variables} { catch {unset a} set a(6) 44 list [catch {set a} msg] $msg } {1 {can't read "a": variable is array}} # Errors and other special cases in writing variables test set-old-6.1 {creating array during write} { catch {unset a} trace add var a {read write unset} ignore list [catch {set a(14) 186} msg] $msg [array names a] } {0 186 14} test set-old-6.2 {errors in writing variables} { catch {unset a} set a xxx list [catch {set a(14) 186} msg] $msg } {1 {can't set "a(14)": variable isn't array}} test set-old-6.3 {errors in writing variables} { catch {unset a} set a(100) yyy list [catch {set a 2} msg] $msg } {1 {can't set "a": variable is array}} test set-old-6.4 {expanding variable size} { catch {unset a} list [set a short] [set a "longer name"] [set a "even longer name"] \ [set a "a much much truly longer name"] } {short {longer name} {even longer name} {a much much truly longer name}} # Unset command, Tcl_UnsetVar procedures test set-old-7.1 {unset command} { catch {unset a}; catch {unset b}; catch {unset c}; catch {unset d} set a 44 set b 55 set c 66 set d 77 unset a b c list [catch {set a(0) 0}] [catch {set b(0) 0}] [catch {set c(0) 0}] \ [catch {set d(0) 0}] } {0 0 0 1} test set-old-7.2 {unset command} { list [catch {unset} msg] $msg } {0 {}} # Used to return: #{1 {wrong # args: should be "unset ?-nocomplain? ?--? ?varName ...?"}} test set-old-7.3 {unset command} { catch {unset a} list [catch {unset a} msg] $msg } {1 {can't unset "a": no such variable}} test set-old-7.4 {unset command} { catch {unset a} set a 44 list [catch {unset a(14)} msg] $msg } {1 {can't unset "a(14)": variable isn't array}} test set-old-7.5 {unset command} { catch {unset a} set a(0) xx list [catch {unset a(14)} msg] $msg } {1 {can't unset "a(14)": no such element in array}} test set-old-7.6 {unset command} { catch {unset a}; catch {unset b}; catch {unset c} set a foo set c gorp list [catch {unset a a a(14)} msg] $msg [info exists c] } {1 {can't unset "a": no such variable} 1} test set-old-7.7 {unsetting globals from within procedures} { set y 0 proc p1 {} { global y set z [p2] return [list $z [catch {set y} msg] $msg] } proc p2 {} {global y; unset y; list [catch {set y} msg] $msg} p1 } {{1 {can't read "y": no such variable}} 1 {can't read "y": no such variable}} test set-old-7.8 {unsetting globals from within procedures} { set y 0 proc p1 {} { global y p2 return [list [catch {set y 44} msg] $msg] } proc p2 {} {global y; unset y} concat [p1] [list [catch {set y} msg] $msg] } {0 44 0 44} test set-old-7.9 {unsetting globals from within procedures} { set y 0 proc p1 {} { global y unset y return [list [catch {set y 55} msg] $msg] } concat [p1] [list [catch {set y} msg] $msg] } {0 55 0 55} test set-old-7.10 {unset command} { catch {unset a} set a(14) 22 unset a(14) list [catch {set a(14)} msg] $msg [catch {array names a} msg2] $msg2 } {1 {can't read "a(14)": no such element in array} 0 {}} test set-old-7.11 {unset command} { catch {unset a} set a(14) 22 unset a list [catch {set a(14)} msg] $msg [catch {array names a} msg2] $msg2 } {1 {can't read "a(14)": no such variable} 0 {}} test set-old-7.12 {unset command, -nocomplain} { catch {unset a} list [info exists a] [catch {unset -nocomplain a}] [info exists a] } {0 0 0} test set-old-7.13 {unset command, -nocomplain} { set -nocomplain abc list [info exists -nocomplain] [catch {unset -nocomplain}] \ [info exists -nocomplain] [catch {unset -- -nocomplain}] \ [info exists -nocomplain] } {1 0 1 0 0} test set-old-7.14 {unset command, --} { set -- abc list [info exists --] [catch {unset --}] \ [info exists --] [catch {unset -- --}] \ [info exists --] } {1 0 1 0 0} test set-old-7.15 {unset command, -nocomplain} { set -nocomplain abc set -- abc list [info exists -nocomplain] [catch {unset -- -nocomplain}] \ [info exists -nocomplain] [info exists --] \ [catch {unset -- -nocomplain}] [info exists --] \ [catch {unset -- --}] [info exists --] } {1 0 0 1 1 1 0 0} test set-old-7.16 {unset command, -nocomplain} { set -nocomplain abc set var abc list [info exists bogus] [catch {unset -nocomplain bogus var bogus}] \ [info exists -nocomplain] [info exists var] \ [catch {unset -nocomplain -nocomplain}] [info exists -nocomplain] } {0 0 1 0 0 0} test set-old-7.17 {unset command, -nocomplain (no abbreviation)} { set -nocomp abc list [info exists -nocomp] [catch {unset -nocomp}] [info exists -nocomp] } {1 0 0} test set-old-7.18 {unset command, -nocomplain (no abbreviation)} { catch {unset -nocomp} list [info exists -nocomp] [catch {unset -nocomp}] } {0 1} test set-old-7.19 {unset command, both switches} { set -- val list [info exists --] [catch {unset -nocomplain --}] [info exists --]\ [catch {unset -nocomplain -- --}] [info exists --] } {1 0 1 0 0} # Array command. test set-old-8.1 {array command} { list [catch {array} msg] $msg } {1 {wrong # args: should be "array subcommand ?arg ...?"}} test set-old-8.2 {array command} { list [catch {array a} msg] $msg } {1 {wrong # args: should be "array anymore arrayName searchId"}} test set-old-8.3 {array command} { catch {unset a} list [catch {array anymore a b} msg] $msg } {1 {"a" isn't an array}} test set-old-8.4 {array command} { catch {unset a} set a 44 list [catch {array anymore a b} msg] $msg } {1 {"a" isn't an array}} test set-old-8.5 {array command} { proc foo {} { set a 44 upvar 0 a x list [catch {array anymore x b} msg] $msg } foo } {1 {"x" isn't an array}} test set-old-8.6 {array command} { catch {unset a} set a(22) 3 list [catch {array gorp a} msg] $msg } {1 {unknown or ambiguous subcommand "gorp": must be anymore, default, donesearch, exists, for, get, names, nextelement, set, size, startsearch, statistics, or unset}} test set-old-8.7 {array command, anymore option} { catch {unset a} list [catch {array anymore a x} msg] $msg } {1 {"a" isn't an array}} test set-old-8.8 {array command, anymore option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array anymore a x] } set a(x) 123 } list [catch {foo 1} msg] $msg } {1 {"a" isn't an array}} test set-old-8.9 {array command, donesearch option} { catch {unset a} list [catch {array donesearch a x} msg] $msg } {1 {"a" isn't an array}} test set-old-8.10 {array command, donesearch option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array donesearch a x] } set a(x) 123 } list [catch {foo 1} msg] $msg } {1 {"a" isn't an array}} test set-old-8.11 {array command, exists option} { list [catch {array exists a b} msg] $msg } {1 {wrong # args: should be "array exists arrayName"}} test set-old-8.12 {array command, exists option} { catch {unset a} array exists a } {0} test set-old-8.13 {array command, exists option} { catch {unset a} set a(0) 1 array exists a } {1} test set-old-8.14 {array command, exists option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array exists a] } set a(x) 123 } list [catch {foo 1} msg] $msg } {0 0} test set-old-8.15 {array command, get option} { list [catch {array get} msg] $msg } {1 {wrong # args: should be "array get arrayName ?pattern?"}} test set-old-8.16 {array command, get option} { list [catch {array get a b c} msg] $msg } {1 {wrong # args: should be "array get arrayName ?pattern?"}} test set-old-8.17 {array command, get option} { catch {unset a} array get a } {} test set-old-8.18 {array command, get option} { catch {unset a} set a(22) 3 set {a(long name)} {} lsort [array get a] } {{} 22 3 {long name}} test set-old-8.19 {array command, get option (unset variable)} { catch {unset a} set a(x) 3 trace add var a(y) write ignore array get a } {x 3} test set-old-8.20 {array command, get option, with pattern} { catch {unset a} set a(x1) 3 set a(x2) 4 set a(x3) 5 set a(b1) 24 set a(b2) 25 lsort [array get a x*] } {3 4 5 x1 x2 x3} test set-old-8.21 {array command, get option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array get a] } set a(x) 123 } list [catch {foo 1} msg] $msg } {0 {}} test set-old-8.22 {array command, names option} { catch {unset a} set a(22) 3 list [catch {array names a 4 5} msg] $msg } {1 {bad option "4": must be -exact, -glob, or -regexp}} test set-old-8.23 {array command, names option} { catch {unset a} array names a } {} test set-old-8.24 {array command, names option} { catch {unset a} set a(22) 3; set a(Textual_name) 44; set "a(name with spaces)" xxx list [catch {lsort [array names a]} msg] $msg } {0 {22 Textual_name {name with spaces}}} test set-old-8.25 {array command, names option} { catch {unset a} set a(22) 3; set a(33) 44; trace add var a(xxx) write ignore list [catch {lsort [array names a]} msg] $msg } {0 {22 33}} test set-old-8.26 {array command, names option} { catch {unset a} set a(22) 3; set a(33) 44; trace add var a(xxx) write ignore set a(xxx) value list [catch {lsort [array names a]} msg] $msg } {0 {22 33 xxx}} test set-old-8.27 {array command, names option} { catch {unset a} set a(axy) 3 set a(bxy) 44 set a(no) yes set a(xxx) value list [lsort [array names a *xy]] [lsort [array names a]] } {{axy bxy} {axy bxy no xxx}} test set-old-8.28 {array command, names option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array names a] } set a(x) 123 } list [catch {foo 1} msg] $msg } {0 {}} test set-old-8.29 {array command, nextelement option} { list [catch {array nextelement a} msg] $msg } {1 {wrong # args: should be "array nextelement arrayName searchId"}} test set-old-8.30 {array command, nextelement option} { catch {unset a} list [catch {array nextelement a b} msg] $msg } {1 {"a" isn't an array}} test set-old-8.31 {array command, nextelement option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array nextelement a b] } set a(x) 123 } list [catch {foo 1} msg] $msg } {1 {"a" isn't an array}} test set-old-8.32 {array command, set option} { list [catch {array set a} msg] $msg } {1 {wrong # args: should be "array set arrayName list"}} test set-old-8.33 {array command, set option} { list [catch {array set a 1 2} msg] $msg } {1 {wrong # args: should be "array set arrayName list"}} test set-old-8.34 {array command, set option} { list [catch {array set a "a \{ c"} msg] $msg } {1 {unmatched open brace in list}} test set-old-8.35 {array command, set option} { catch {unset a} set a 44 list [catch {array set a {a b c d}} msg] $msg } {1 {can't set "a(a)": variable isn't array}} test set-old-8.36 {array command, set option} { catch {unset a} set a(xx) yy array set a {b c d e} lsort [array get a] } {b c d e xx yy} test set-old-8.37 {array command, set option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array set a {x 0}] } set a(x) } list [catch {foo 1} msg] $msg } {0 {}} test set-old-8.38 {array command, set option} { catch {unset aVaRnAmE} array set aVaRnAmE {} list [info exists aVaRnAmE] [catch {set aVaRnAmE} msg] $msg } {1 1 {can't read "aVaRnAmE": variable is array}} test set-old-8.38.1 {array command, set scalar} { catch {unset aVaRnAmE} set aVaRnAmE 1 list [catch {array set aVaRnAmE {}} msg] $msg } {1 {can't array set "aVaRnAmE": variable isn't array}} test set-old-8.38.2 {array command, set alias} { catch {unset aVaRnAmE} upvar 0 aVaRnAmE anAliAs array set anAliAs {} list [array exists aVaRnAmE] [catch {set anAliAs} msg] $msg } {1 1 {can't read "anAliAs": variable is array}} test set-old-8.38.3 {array command, set element alias} { catch {unset aVaRnAmE} list [catch {upvar 0 aVaRnAmE(elem) elemAliAs}] \ [catch {array set elemAliAs {}} msg] $msg } {0 1 {can't array set "elemAliAs": variable isn't array}} test set-old-8.38.4 {array command, empty set with populated array} { catch {unset aVaRnAmE} array set aVaRnAmE [list e1 v1 e2 v2] array set aVaRnAmE {} array set aVaRnAmE [list e3 v3] list [lsort [array names aVaRnAmE]] [catch {set aVaRnAmE(e2)} msg] $msg } {{e1 e2 e3} 0 v2} test set-old-8.38.5 {array command, set with non-existent namespace} { list [catch {array set bogusnamespace::var {}} msg] $msg } {1 {can't set "bogusnamespace::var": parent namespace doesn't exist}} test set-old-8.38.6 {array command, set with non-existent namespace} { list [catch {array set bogusnamespace::var {a b}} msg] $msg } {1 {can't set "bogusnamespace::var": parent namespace doesn't exist}} test set-old-8.38.7 {array command, set with non-existent namespace} { list [catch {array set bogusnamespace::var(0) {a b}} msg] $msg } {1 {can't set "bogusnamespace::var(0)": parent namespace doesn't exist}} test set-old-8.39 {array command, size option} { catch {unset a} array size a } {0} test set-old-8.40 {array command, size option} { list [catch {array size a 4} msg] $msg } {1 {wrong # args: should be "array size arrayName"}} test set-old-8.41 {array command, size option} { catch {unset a} array size a } {0} test set-old-8.42 {array command, size option} { catch {unset a} set a(22) 3; set a(Textual_name) 44; set "a(name with spaces)" xxx list [catch {array size a} msg] $msg } {0 3} test set-old-8.43 {array command, size option} { catch {unset a} set a(22) 3; set a(xx) 44; set a(y) xxx unset a(22) a(y) a(xx) list [catch {array size a} msg] $msg } {0 0} test set-old-8.44 {array command, size option} { catch {unset a} set a(22) 3; trace add var a(33) {read write unset} ignore list [catch {array size a} msg] $msg } {0 1} test set-old-8.45 {array command, size option, array doesn't exist yet but has compiler-allocated procedure slot} { proc foo {x} { if {$x==1} { return [array size a] } set a(x) 123 } list [catch {foo 1} msg] $msg } {0 0} test set-old-8.46 {array command, startsearch option} { list [catch {array startsearch a b} msg] $msg } {1 {wrong # args: should be "array startsearch arrayName"}} test set-old-8.47 {array command, startsearch option} { catch {unset a} list [catch {array startsearch a} msg] $msg } {1 {"a" isn't an array}} test set-old-8.48 {array command, startsearch option, array doesn't exist yet but has compiler-allocated procedure slot} { catch {rename p ""} proc p {x} { if {$x==1} { return [array startsearch a] } set a(x) 123 } list [catch {p 1} msg] $msg } {1 {"a" isn't an array}} test set-old-8.49 {array command, statistics option} { catch {unset a} set a(abc) 1 set a(def) 2 set a(ghi) 3 set a(jkl) 4 set a(mno) 5 set a(pqr) 6 set a(stu) 7 set a(vwx) 8 set a(yz) 9 array statistics a } "9 entries in table, 4 buckets number of buckets with 0 entries: 0 number of buckets with 1 entries: 0 number of buckets with 2 entries: 3 number of buckets with 3 entries: 1 number of buckets with 4 entries: 0 number of buckets with 5 entries: 0 number of buckets with 6 entries: 0 number of buckets with 7 entries: 0 number of buckets with 8 entries: 0 number of buckets with 9 entries: 0 number of buckets with 10 or more entries: 0 average search distance for entry: 1.7" test set-old-8.50 {array command, array names -exact on glob pattern} { catch {unset a} set a(1*2) 1 list [catch {array names a -exact 1*2} msg] $msg } {0 1*2} test set-old-8.51 {array command, array names -glob on glob pattern} { catch {unset a} set a(1*2) 1 set a(12) 1 set a(11) 1 list [catch {lsort [array names a -glob 1*2]} msg] $msg } {0 {1*2 12}} test set-old-8.52 {array command, array names -regexp on regexp pattern} { catch {unset a} set a(1*2) 1 set a(12) 1 set a(11) 1 list [catch {lsort [array names a -regexp ^1]} msg] $msg } {0 {1*2 11 12}} test set-old-8.52.1 {array command, array names -regexp, backrefs} { catch {unset a} set a(1*2) 1 set a(12) 1 set a(11) 1 list [catch {lsort [array names a -regexp {^(.)\1}]} msg] $msg } {0 11} test set-old-8.53 {array command, array names -regexp} { catch {unset a} set a(-glob) 1 set a(-regexp) 1 set a(-exact) 1 list [catch {array names a -regexp} msg] $msg } {0 -regexp} test set-old-8.54 {array command, array names -exact} { catch {unset a} set a(-glob) 1 set a(-regexp) 1 set a(-exact) 1 list [catch {array names a -exact} msg] $msg } {0 -exact} test set-old-8.55 {array command, array names -glob} { catch {unset a} set a(-glob) 1 set a(-regexp) 1 set a(-exact) 1 list [catch {array names a -glob} msg] $msg } {0 -glob} test set-old-8.56 {array command, array statistics on a non-array} { catch {unset a} list [catch {array statistics a} msg] $msg } [list 1 "\"a\" isn't an array"] test set-old-8.57 {array command, array get with trivial pattern} { catch {unset a} set a(x) 1 set a(y) 2 array get a x } {x 1} test set-old-8.58 {array command, array set with LVT and odd length literal} { list [catch {apply {{} { array set a {b c d} }}} msg] $msg } {1 {list must have an even number of elements}} test set-old-9.1 {ids for array enumeration} { catch {unset a} set a(a) 1 list [array star a] [array star a] [array done a s-1-a; array star a] \ [array done a s-2-a; array do a s-3-a; array start a] } {s-1-a s-2-a s-3-a s-1-a} test set-old-9.2 {array enumeration} { catch {unset a} set a(a) 1 set a(b) 1 set a(c) 1 set x [array startsearch a] lsort [list [array nextelement a $x] [array ne a $x] [array next a $x] \ [array next a $x] [array next a $x]] } {{} {} a b c} test set-old-9.3 {array enumeration} { catch {unset a} set a(a) 1 set a(b) 1 set a(c) 1 set x [array startsearch a] set y [array startsearch a] set z [array startsearch a] lsort [list [array nextelement a $x] [array ne a $x] \ [array next a $y] [array next a $z] [array next a $y] \ [array next a $z] [array next a $y] [array next a $z] \ [array next a $y] [array next a $z] [array next a $x] \ [array next a $x]] } {{} {} {} a a a b b b c c c} test set-old-9.4 {array enumeration: stopping searches} { catch {unset a} set a(a) 1 set a(b) 1 set a(c) 1 set x [array startsearch a] set y [array startsearch a] set z [array startsearch a] lsort [list [array next a $x] [array next a $x] [array next a $y] \ [array done a $z; array next a $x] \ [array done a $x; array next a $y] [array next a $y]] } {a a b b c c} test set-old-9.5 {array enumeration: stopping searches} { catch {unset a} set a(a) 1 set x [array startsearch a] array done a $x list [catch {array next a $x} msg] $msg } {1 {couldn't find search "s-1-a"}} test set-old-9.6 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set x [array startsearch a] set y [array startsearch a] set a(b) 1 list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}} test set-old-9.7 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set x [array startsearch a] set y [array startsearch a] set a(a) 2 list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {0 a 0 a} test set-old-9.8 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set a(c) 2 set x [array startsearch a] set y [array startsearch a] catch {unset a(c)} list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}} test set-old-9.9 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set x [array startsearch a] set y [array startsearch a] catch {unset a(c)} list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {0 a 0 a} test set-old-9.10 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set x [array startsearch a] set y [array startsearch a] trace add var a(b) read {} list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {1 {couldn't find search "s-1-a"} 1 {couldn't find search "s-2-a"}} test set-old-9.11 {array enumeration: searches automatically stopped} { catch {unset a} set a(a) 1 set x [array startsearch a] set y [array startsearch a] trace add var a(a) read {} list [catch {array next a $x} msg] $msg \ [catch {array next a $y} msg2] $msg2 } {0 a 0 a} test set-old-9.12 {array enumeration with traced undefined elements} { catch {unset a} set a(a) 1 trace add var a(b) read {} set x [array startsearch a] lsort [list [array next a $x] [array next a $x]] } {{} a} test set-old-10.1 {array enumeration errors} { list [catch {array start} msg] $msg } {1 {wrong # args: should be "array startsearch arrayName"}} test set-old-10.2 {array enumeration errors} { list [catch {array start a b} msg] $msg } {1 {wrong # args: should be "array startsearch arrayName"}} test set-old-10.3 {array enumeration errors} { catch {unset a} list [catch {array start a} msg] $msg } {1 {"a" isn't an array}} test set-old-10.4 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a} msg] $msg } {1 {wrong # args: should be "array nextelement arrayName searchId"}} test set-old-10.5 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a b c} msg] $msg } {1 {wrong # args: should be "array nextelement arrayName searchId"}} test set-old-10.6 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a a-1-a} msg] $msg } {1 {illegal search identifier "a-1-a"}} test set-old-10.7 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a sx1-a} msg] $msg } {1 {illegal search identifier "sx1-a"}} test set-old-10.8 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a s--a} msg] $msg } {1 {illegal search identifier "s--a"}} test set-old-10.9 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a s-1-b} msg] $msg } {1 {search identifier "s-1-b" isn't for variable "a"}} test set-old-10.10 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a s-1ba} msg] $msg } {1 {illegal search identifier "s-1ba"}} test set-old-10.11 {array enumeration errors} { catch {unset a} set a(a) 1 set x [array startsearch a] list [catch {array next a s-2-a} msg] $msg } {1 {couldn't find search "s-2-a"}} test set-old-10.12 {array enumeration errors} { list [catch {array done a} msg] $msg } {1 {wrong # args: should be "array donesearch arrayName searchId"}} test set-old-10.13 {array enumeration errors} { list [catch {array done a b c} msg] $msg } {1 {wrong # args: should be "array donesearch arrayName searchId"}} test set-old-10.14 {array enumeration errors} { catch {unset a} set a(a) a list [catch {array done a b} msg] $msg } {1 {illegal search identifier "b"}} test set-old-10.15 {array enumeration errors} { list [catch {array anymore a} msg] $msg } {1 {wrong # args: should be "array anymore arrayName searchId"}} test set-old-10.16 {array enumeration errors} { list [catch {array any a b c} msg] $msg } {1 {wrong # args: should be "array anymore arrayName searchId"}} test set-old-10.17 {array enumeration errors} { catch {unset a} set a(0) 44 list [catch {array any a bogus} msg] $msg } {1 {illegal search identifier "bogus"}} # Array enumeration with "anymore" option test set-old-11.1 {array anymore option} { catch {unset a} set a(a) 1 set a(b) 2 set a(c) 3 array startsearch a lsort [list [array anymore a s-1-a] [array next a s-1-a] \ [array anymore a s-1-a] [array next a s-1-a] \ [array anymore a s-1-a] [array next a s-1-a] \ [array anymore a s-1-a] [array next a s-1-a]] } {{} 0 1 1 1 a b c} test set-old-11.2 {array anymore option} { catch {unset a} set a(a) 1 set a(b) 2 set a(c) 3 array startsearch a lsort [list [array next a s-1-a] [array next a s-1-a] \ [array anymore a s-1-a] [array next a s-1-a] \ [array next a s-1-a] [array anymore a s-1-a]] } {{} 0 1 a b c} # Special check to see that the value of a variable is handled correctly # if it is returned as the result of a procedure (must not free the variable # string while deleting the call frame). Errors will only be detected if # a memory consistency checker such as Purify is being used. test set-old-12.1 {cleanup on procedure return} { proc foo {} { set x 12345 } foo } 12345 test set-old-12.2 {cleanup on procedure return} { proc foo {} { set x(1) 23456 } foo } 23456 # Must delete variables when done, since these arrays get used as # scalars by other tests. catch {unset a} catch {unset b} catch {unset c} catch {unset aVaRnAmE} catch {rename foo {}} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/security.test0000644000175000017500000000157315104661341015467 0ustar sergeisergei# security.test -- # # Functionality covered: this file contains a collection of tests for the auto # loading and namespaces. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # If this proc becomes invoked, then there is a bug proc BUG {args} { set ::BUG 1 } # Check and Clear the bug flag (to do before each test) set ::BUG 0 proc CB {} { set ret $::BUG set ::BUG 0 return $ret } test security-1.1 {tcl_endOfPreviousWord} { catch {tcl_startOfPreviousWord x {[BUG]}} CB } 0 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/scan.test0000644000175000017500000007667015104661341014556 0ustar sergeisergei# Commands covered: scan # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # procedure that returns the range of integers proc int_range {} { set MAX_INT [expr {[format %u -2]/2}] set MIN_INT [expr { ~ $MAX_INT }] return [list $MIN_INT $MAX_INT] } # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] test scan-1.1 {BuildCharSet, CharInSet} { list [scan foo {%[^o]} x] $x } {1 f} test scan-1.2 {BuildCharSet, CharInSet} { list [scan \]foo {%[]f]} x] $x } {1 \]f} test scan-1.3 {BuildCharSet, CharInSet} { list [scan abc-def {%[a-c]} x] $x } {1 abc} test scan-1.4 {BuildCharSet, CharInSet} { list [scan abc-def {%[a-c]} x] $x } {1 abc} test scan-1.5 {BuildCharSet, CharInSet} { list [scan -abc-def {%[-ac]} x] $x } {1 -a} test scan-1.6 {BuildCharSet, CharInSet} { list [scan -abc-def {%[ac-]} x] $x } {1 -a} test scan-1.7 {BuildCharSet, CharInSet} { list [scan abc-def {%[c-a]} x] $x } {1 abc} test scan-1.8 {BuildCharSet, CharInSet} { list [scan def-abc {%[^c-a]} x] $x } {1 def-} test scan-1.9 {BuildCharSet, CharInSet no match} -setup { unset -nocomplain x } -body { list [scan {= f} {= %[TF]} x] [info exists x] } -result {0 0} test scan-2.1 {ReleaseCharSet} { list [scan abcde {%[abc]} x] $x } {1 abc} test scan-2.2 {ReleaseCharSet} { list [scan abcde {%[a-c]} x] $x } {1 abc} test scan-3.1 {ValidateFormat} -returnCodes error -body { scan {} {%d%1$d} x } -result {cannot mix "%" and "%n$" conversion specifiers} test scan-3.2 {ValidateFormat} -returnCodes error -body { scan {} {%d%1$d} x } -result {cannot mix "%" and "%n$" conversion specifiers} test scan-3.3 {ValidateFormat} -returnCodes error -body { scan {} {%2$d%d} x } -result {"%n$" argument index out of range} test scan-3.4 {ValidateFormat} { # degenerate case, before changed from 8.2 to 8.3 list [catch {scan {} %d} msg] $msg } {0 {}} test scan-3.5 {ValidateFormat} -returnCodes error -body { scan {} {%10c} a } -result {field width may not be specified in %c conversion} test scan-3.6 {ValidateFormat} -returnCodes error -body { scan {} {%*1$d} a } -result {bad scan conversion character "$"} test scan-3.7 {ValidateFormat} -returnCodes error -body { scan {} {%1$d%1$d} a } -result {variable is assigned by multiple "%n$" conversion specifiers} test scan-3.8 {ValidateFormat} -returnCodes error -body { scan {} a x } -result {variable is not assigned by any conversion specifiers} test scan-3.9 {ValidateFormat} -returnCodes error -body { scan {} {%2$s} x y } -result {variable is not assigned by any conversion specifiers} test scan-3.10 {ValidateFormat} -returnCodes error -body { scan {} {%[a} x } -result {unmatched [ in format string} test scan-3.11 {ValidateFormat} -returnCodes error -body { scan {} {%[^a} x } -result {unmatched [ in format string} test scan-3.12 {ValidateFormat} -returnCodes error -body { scan {} {%[]a} x } -result {unmatched [ in format string} test scan-3.13 {ValidateFormat} -returnCodes error -body { scan {} {%[^]a} x } -result {unmatched [ in format string} test scan-4.1 {Tcl_ScanObjCmd, argument checks} -returnCodes error -body { scan } -result {wrong # args: should be "scan string format ?varName ...?"} test scan-4.2 {Tcl_ScanObjCmd, argument checks} -returnCodes error -body { scan string } -result {wrong # args: should be "scan string format ?varName ...?"} test scan-4.3 {Tcl_ScanObjCmd, argument checks} { # degenerate case, before changed from 8.2 to 8.3 list [catch {scan string format} msg] $msg } {0 {}} test scan-4.4 {Tcl_ScanObjCmd, whitespace} { list [scan { abc def } {%s%s} x y] $x $y } {2 abc def} test scan-4.5 {Tcl_ScanObjCmd, whitespace} { list [scan { abc def } { %s %s } x y] $x $y } {2 abc def} test scan-4.6 {Tcl_ScanObjCmd, whitespace} { list [scan { abc def } { %s %s } x y] $x $y } {2 abc def} test scan-4.7 {Tcl_ScanObjCmd, literals} { # degenerate case, before changed from 8.2 to 8.3 scan { abc def } { abc def } } {} test scan-4.8 {Tcl_ScanObjCmd, literals} { set x {} list [scan { abcg} { abc def %1s} x] $x } {0 {}} test scan-4.9 {Tcl_ScanObjCmd, literals} { list [scan { abc%defghi} { abc %% def%n } x] $x } {1 10} test scan-4.10 {Tcl_ScanObjCmd, assignment suppression} { list [scan { abc def } { %*c%s def } x] $x } {1 bc} test scan-4.11 {Tcl_ScanObjCmd, XPG3-style} { list [scan { abc def } {%2$s %1$s} x y] $x $y } {2 def abc} test scan-4.12 {Tcl_ScanObjCmd, width specifiers} { list [scan {abc123456789012} {%3s%3d%3f%3[0-9]%s} a b c d e] $a $b $c $d $e } {5 abc 123 456.0 789 012} test scan-4.13 {Tcl_ScanObjCmd, width specifiers} { list [scan {abc123456789012} {%3s%3d%3f%3[0-9]%s} a b c d e] $a $b $c $d $e } {5 abc 123 456.0 789 012} test scan-4.14 {Tcl_ScanObjCmd, underflow} { set x {} list [scan {a} {a%d} x] $x } {-1 {}} test scan-4.15 {Tcl_ScanObjCmd, underflow} { set x {} list [scan {} {a%d} x] $x } {-1 {}} test scan-4.16 {Tcl_ScanObjCmd, underflow} { set x {} list [scan {ab} {a%d} x] $x } {0 {}} test scan-4.17 {Tcl_ScanObjCmd, underflow} { set x {} list [scan {a } {a%d} x] $x } {-1 {}} test scan-4.18 {Tcl_ScanObjCmd, skipping whitespace} { list [scan { b} {%c%s} x y] $x $y } {2 32 b} test scan-4.19 {Tcl_ScanObjCmd, skipping whitespace} { list [scan { b} {%[^b]%s} x y] $x $y } {2 { } b} test scan-4.20 {Tcl_ScanObjCmd, string scanning} { list [scan {abc def} {%s} x] $x } {1 abc} test scan-4.21 {Tcl_ScanObjCmd, string scanning} { list [scan {abc def} {%0s} x] $x } {1 abc} test scan-4.22 {Tcl_ScanObjCmd, string scanning} { list [scan {abc def} {%2s} x] $x } {1 ab} test scan-4.23 {Tcl_ScanObjCmd, string scanning} { list [scan {abc def} {%*s%n} x] $x } {1 3} test scan-4.24 {Tcl_ScanObjCmd, charset scanning} { list [scan {abcdef} {%[a-c]} x] $x } {1 abc} test scan-4.25 {Tcl_ScanObjCmd, charset scanning} { list [scan {abcdef} {%0[a-c]} x] $x } {1 abc} test scan-4.26 {Tcl_ScanObjCmd, charset scanning} { list [scan {abcdef} {%2[a-c]} x] $x } {1 ab} test scan-4.27 {Tcl_ScanObjCmd, charset scanning} { list [scan {abcdef} {%*[a-c]%n} x] $x } {1 3} test scan-4.28 {Tcl_ScanObjCmd, character scanning} { list [scan {abcdef} {%c} x] $x } {1 97} test scan-4.29 {Tcl_ScanObjCmd, character scanning} { list [scan {abcdef} {%*c%n} x] $x } {1 1} test scan-4.30 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {1234567890a} {%3d} x] $x } -result {1 123} test scan-4.31 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {1234567890a} {%d} x] $x } -result {1 1234567890} test scan-4.32 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {01234567890a} {%d} x] $x } -result {1 1234567890} test scan-4.33 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {+01234} {%d} x] $x } -result {1 1234} test scan-4.34 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {-01234} {%d} x] $x } -result {1 -1234} test scan-4.35 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {a01234} {%d} x] $x } -result {0 {}} test scan-4.36 {Tcl_ScanObjCmd, base-10 integer scanning} -setup { set x {} } -body { list [scan {0x10} {%d} x] $x } -result {1 0} test scan-4.37 {Tcl_ScanObjCmd, base-8 integer scanning} -setup { set x {} } -body { list [scan {012345678} {%o} x] $x } -result {1 342391} test scan-4.38 {Tcl_ScanObjCmd, base-8 integer scanning} -setup { set x {} } -body { list [scan {+1238 -1239 123a} {%o%*s%o%*s%o} x y z] $x $y $z } -result {3 83 -83 83} test scan-4.39 {Tcl_ScanObjCmd, base-16 integer scanning} -setup { set x {} } -body { list [scan {+1238 -123a 0123} {%x%x%x} x y z] $x $y $z } -result {3 4664 -4666 291} test scan-4.40 {Tcl_ScanObjCmd, base-16 integer scanning} -setup { set x {} } -body { # The behavior changed in 8.4a4/8.3.4cvs (6 Feb) to correctly # return '1' for 0x1 scanned via %x, to comply with 8.0 and C scanf. # Bug #495213 list [scan {aBcDeF AbCdEf 0x1} {%x%x%x} x y z] $x $y $z } -result {3 11259375 11259375 1} test scan-4.40.1 {Tcl_ScanObjCmd, base-16 integer scanning} -setup { set x {} } -body { list [scan {0xF 0x00A0B 0X0XF} {%x %x %x} x y z] $x $y $z } -result {3 15 2571 0} test scan-4.40.2 {Tcl_ScanObjCmd, base-16 integer scanning} -setup { unset -nocomplain x } -body { list [scan {xF} {%x} x] [info exists x] } -result {0 0} test scan-4.40.3 {Tcl_ScanObjCmd, base-2 integer scanning} -setup { set x {} } -body { list [scan {1001 0b101 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} {%b %b %llb} x y z] $x $y $z } -result {3 9 5 340282366920938463463374607431768211456} test scan-4.41 {Tcl_ScanObjCmd, base-unknown integer scanning} -setup { set x {} } -body { list [scan {10 010 0x10 0b10} {%i%i%i%i} x y z t] $x $y $z $t } -result {4 10 8 16 0} test scan-4.42 {Tcl_ScanObjCmd, base-unknown integer scanning} -setup { set x {} } -body { list [scan {10 010 0X10} {%i%i%i} x y z] $x $y $z } -result {3 10 8 16} test scan-4.43 {Tcl_ScanObjCmd, integer scanning, odd cases} -setup { set x {} } -body { list [scan {+ } {%i} x] $x } -result {0 {}} test scan-4.44 {Tcl_ScanObjCmd, integer scanning, odd cases} -setup { set x {} } -body { list [scan {+} {%i} x] $x } -result {-1 {}} test scan-4.45 {Tcl_ScanObjCmd, integer scanning, odd cases} -setup { set x {} } -body { list [scan {0x} {%i%s} x y] $x $y } -result {2 0 x} test scan-4.46 {Tcl_ScanObjCmd, integer scanning, odd cases} -setup { set x {} } -body { list [scan {0X} {%i%s} x y] $x $y } -result {2 0 X} test scan-4.47 {Tcl_ScanObjCmd, integer scanning, suppressed} -setup { set x {} } -body { list [scan {123def} {%*i%s} x] $x } -result {1 def} test scan-4.48 {Tcl_ScanObjCmd, float scanning} { list [scan {1 2 3} {%e %f %g} x y z] $x $y $z } {3 1.0 2.0 3.0} test scan-4.49 {Tcl_ScanObjCmd, float scanning} { list [scan {.1 0.2 3.} {%e %f %g} x y z] $x $y $z } {3 0.1 0.2 3.0} test scan-4.49-uc-1 {Tcl_ScanObjCmd, float scanning} { list [scan {0.5*0.75} {%E%c%G} x y z] $x $y $z } {3 0.5 42 0.75} test scan-4.49-uc-2 {Tcl_ScanObjCmd, float scanning} { list [scan {5e-1*75E-2} {%E%c%G} x y z] $x $y $z } {3 0.5 42 0.75} test scan-4.50 {Tcl_ScanObjCmd, float scanning} { list [scan {1234567890a} %f x] $x } {1 1234567890.0} test scan-4.51 {Tcl_ScanObjCmd, float scanning} { list [scan {+123+45} %f x] $x } {1 123.0} test scan-4.52 {Tcl_ScanObjCmd, float scanning} { list [scan {-123+45} %f x] $x } {1 -123.0} test scan-4.53 {Tcl_ScanObjCmd, float scanning} { list [scan {1.0e1} %f x] $x } {1 10.0} test scan-4.54 {Tcl_ScanObjCmd, float scanning} { list [scan {1.0e-1} %f x] $x } {1 0.1} test scan-4.55 {Tcl_ScanObjCmd, odd cases} -setup { set x {} } -body { list [scan {+} %f x] $x } -result {-1 {}} test scan-4.56 {Tcl_ScanObjCmd, odd cases} -setup { set x {} } -body { list [scan {1.0e} %f%s x y] $x $y } -result {2 1.0 e} test scan-4.57 {Tcl_ScanObjCmd, odd cases} -setup { set x {} } -body { list [scan {1.0e+} %f%s x y] $x $y } -result {2 1.0 e+} test scan-4.58 {Tcl_ScanObjCmd, odd cases} -setup { set x {} set y {} } -body { list [scan {e1} %f%s x y] $x $y } -result {0 {} {}} test scan-4.59 {Tcl_ScanObjCmd, float scanning} { list [scan {1.0e-1x} %*f%n x] $x } {1 6} test scan-4.60 {Tcl_ScanObjCmd, set errors} -setup { set x {} set y {} unset -nocomplain z } -body { array set z {} list [catch {scan {abc def ghi} {%s%s%s} x z y} msg] $msg $x $y } -cleanup { unset -nocomplain z } -result {1 {can't set "z": variable is array} abc ghi} test scan-4.61 {Tcl_ScanObjCmd, set errors} -setup { set x {} unset -nocomplain y unset -nocomplain z } -body { array set y {} array set z {} list [catch {scan {abc def ghi} {%s%s%s} x z y} msg] $msg $x } -cleanup { unset -nocomplain y unset -nocomplain z } -result {1 {can't set "z": variable is array} abc} test scan-4.62 {scanning of large and negative octal integers} { lassign [int_range] MIN_INT MAX_INT set scanstring [format {%o %o %o} -1 $MIN_INT $MAX_INT] list [scan $scanstring {%o %o %o} a b c] \ [expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }] } {3 1 1 1} test scan-4.63 {scanning of large and negative hex integers} { lassign [int_range] MIN_INT MAX_INT set scanstring [format {%x %x %x} -1 $MIN_INT $MAX_INT] list [scan $scanstring {%x %x %x} a b c] \ [expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }] } {3 1 1 1} test scan-4.64 {scanning of hex with %X} { scan "123 abc f78" %X%X%X } {291 2748 3960} test scan-5.1 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "-20 1476 \n33 0" "%d %d %d %d" a b c d] $a $b $c $d } -result {4 -20 1476 33 0} test scan-5.2 {integer scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "-45 16 7890 +10" "%2d %*d %10d %d" a b c] $a $b $c } -result {3 -4 16 7890} test scan-5.3 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "-45 16 +10 987" "%ld %d %ld %d" a b c d] $a $b $c $d } -result {4 -45 16 10 987} test scan-5.4 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "14 1ab 62 10" "%d %x %lo %x" a b c d] $a $b $c $d } -result {4 14 427 50 16} test scan-5.5 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "12345670 1234567890ab cdefg" "%o %o %x %lx" a b c d] \ $a $b $c $d } -result {4 2739128 342391 561323 52719} test scan-5.6 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "ab123-24642" "%2x %3x %3o %2o" a b c d] $a $b $c $d } -result {4 171 291 -20 52} test scan-5.7 {integer scanning} -setup { set a {}; set b {} } -body { list [scan "1234567 234 567 " "%*3x %x %*o %4o" a b] $a $b } -result {2 17767 375} test scan-5.8 {integer scanning} -setup { set a {}; set b {} } -body { list [scan "a 1234" "%d %d" a b] $a $b } -result {0 {} {}} test scan-5.9 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "12345678" "%2d %2d %2ld %2d" a b c d] $a $b $c $d } -result {4 12 34 56 78} test scan-5.10 {integer scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "1 2 " "%hd %d %d %d" a b c d] $a $b $c $d } -result {2 1 2 {} {}} # # The behavior for scanning integers larger than MAX_INT is not defined by the # ANSI spec. Some implementations wrap the input (-16) some return MAX_INT. # test scan-5.11 {integer scanning} -constraints {nonPortable} -setup { set a {}; set b {} } -body { list [scan "4294967280 4294967280" "%u %d" a b] $a \ [expr {$b == -16 || $b == 0x7fffffff}] } -result {2 4294967280 1} test scan-5.12 {integer scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "7810179016327718216,6c63546f6c6c6548,661432506755433062510" \ %ld,%lx,%lo a b c] $a $b $c } -result {3 7810179016327718216 7810179016327718216 7810179016327718216} test scan-5.13 {integer scanning and overflow} { # This test used to fail on some 64-bit systems. [Bug 1011860] scan {300000000 3000000000 30000000000} {%ld %ld %ld} } {300000000 3000000000 30000000000} test scan-5.14 {integer scanning} { scan 0xff %u } 0 test scan-5.15 {Bug be003d570f} { scan 0x40 %o } 0 test scan-5.16 {Bug be003d570f} { scan 0x40 %b } 0 test scan-5.17 {bigint scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "207698809136909011942886895,abcdef0123456789abcdef,125715736004432126361152746757" \ %lld,%llx,%llo a b c] $a $b $c } -result {3 207698809136909011942886895 207698809136909011942886895 207698809136909011942886895} test scan-5.18 {bigint scanning underflow} -setup { set a {}; } -body { list [scan "-207698809136909011942886895" \ %llu a] $a } -returnCodes 1 -result {unsigned bignum scans are invalid} test scan-5.19 {bigint scanning invalid} -setup { set a {}; } -body { list [scan "207698809136909011942886895" \ %llu a] $a } -result {1 207698809136909011942886895} test scan-5.20 {ignore digit separators} -setup { set a {}; set b {}; set c {}; } -body { list [scan "10_23_45" %d_%d_%d a b c] $a $b $c } -result {3 10 23 45} test scan-5.21 {integer scanning, %j, %q, &z, %t} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "42 43 44 45" "%jd %qd %zd %td" a b c d] $a $b $c $d } -result {4 42 43 44 45} test scan-6.1 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "2.1 -3.0e8 .99962 a" "%f%g%e%f" a b c d] $a $b $c $d } -result {3 2.1 -300000000.0 0.99962 {}} test scan-6.2 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "-1.2345 +8.2 9" "%3e %3lf %f %f" a b c d] $a $b $c $d } -result {4 -1.0 234.0 5.0 8.2} test scan-6.3 {floating-point scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "1e00004 332E-4 3e+4" "%Lf %*2e %f %f" a b c] $a $c } -result {3 10000.0 30000.0} # # Some libc implementations consider 3.e- bad input. The ANSI spec states # that digits must follow the - sign. # test scan-6.4 {floating-point scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "1. 47.6 2.e2 3.e-" "%f %*f %f %f" a b c] $a $b $c } -result {3 1.0 200.0 3.0} test scan-6.5 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d] $a $b $c $d } -result {4 4.6 99999.7 87.643 118.0} test scan-6.6 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d] $a $b $c $d } -result {4 1.2345 0.697 124.0 5e-5} test scan-6.7 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "4.6abc" "%f %f %f %f" a b c d] $a $b $c $d } -result {1 4.6 {} {} {}} test scan-6.8 {floating-point scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "4.6 5.2" "%f %f %f %f" a b c d] $a $b $c $d } -result {2 4.6 5.2 {} {}} test scan-6.9 {disallow diget separator in floating-point} -setup { set a {}; set b {}; set c {}; } -body { list [scan "3.14_2.35_98.6" %f_%f_%f a b c ] $a $b $c } -result {3 3.14 2.35 98.6} test scan-7.1 {string and character scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "abc defghijk dum " "%s %3s %20s %s" a b c d] $a $b $c $d } -result {4 abc def ghijk dum} test scan-7.2 {string and character scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "a bcdef" "%c%c%1s %s" a b c d] $a $b $c $d } -result {4 97 32 b cdef} test scan-7.3 {string and character scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "123456 test " "%*c%*s %s %s %s" a b c] $a $b $c } -result {1 test {} {}} test scan-7.4 {string and character scanning} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "ababcd01234 f 123450" {%4[abcd] %4[abcd] %[^abcdef] %[^0]} a b c d] $a $b $c $d } -result {4 abab cd {01234 } {f 12345}} test scan-7.5 {string and character scanning} -setup { set a {}; set b {}; set c {} } -body { list [scan "aaaaaabc aaabcdefg + + XYZQR" {%*4[a] %s %*4[a]%s%*4[ +]%c} a b c] $a $b $c } -result {3 aabc bcdefg 43} test scan-7.6 {string and character scanning, unicode} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "abc dÇfghijk dum " "%s %3s %20s %s" a b c d] $a $b $c $d } -result "4 abc dÇf ghijk dum" test scan-7.7 {string and character scanning, unicode} -setup { set a {}; set b {} } -body { list [scan "abÇcdef" "ab%c%c" a b] $a $b } -result "2 199 99" test scan-7.8 {string and character scanning, unicode} -setup { set a {}; set b {} } -body { list [scan "ab\uFEFFdef" "%\[ab\uFEFF\]" a] $a } -result "1 ab\uFEFF" test scan-8.1 {error conditions} -body { scan a } -returnCodes error -match glob -result * test scan-8.2 {error conditions} -returnCodes error -body { scan a } -result {wrong # args: should be "scan string format ?varName ...?"} test scan-8.3 {error conditions} -returnCodes error -body { scan a %D x } -result {bad scan conversion character "D"} test scan-8.4 {error conditions} -returnCodes error -body { scan a %O x } -result {bad scan conversion character "O"} test scan-8.5 {error conditions} -returnCodes error -body { scan a %B x } -result {bad scan conversion character "B"} test scan-8.6 {error conditions} -returnCodes error -body { scan a %F x } -result {bad scan conversion character "F"} test scan-8.7 {error conditions} -returnCodes error -body { scan a %p x } -result {bad scan conversion character "p"} test scan-8.8 {error conditions} -returnCodes error -body { scan a "%d %d" a } -result {different numbers of variable names and field specifiers} test scan-8.9 {error conditions} -returnCodes error -body { scan a "%d %d" a b c } -result {variable is not assigned by any conversion specifiers} test scan-8.10 {error conditions} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [expr {[scan " a" " a %d %d %d %d" a b c d] <= 0}] $a $b $c $d } -result {1 {} {} {} {}} test scan-8.11 {error conditions} -setup { set a {}; set b {}; set c {}; set d {} } -body { list [scan "1 2" "%d %d %d %d" a b c d] $a $b $c $d } -result {2 1 2 {} {}} test scan-8.12 {error conditions} -setup { unset -nocomplain a } -body { set a(0) 44 scan 44 %d a } -returnCodes error -cleanup { unset -nocomplain a } -result {can't set "a": variable is array} test scan-8.13 {error conditions} -setup { unset -nocomplain a } -body { set a(0) 44 scan 44 %c a } -returnCodes error -cleanup { unset -nocomplain a } -result {can't set "a": variable is array} test scan-8.14 {error conditions} -setup { unset -nocomplain a } -body { set a(0) 44 scan 44 %s a } -returnCodes error -cleanup { unset -nocomplain a } -result {can't set "a": variable is array} test scan-8.15 {error conditions} -setup { unset -nocomplain a } -body { set a(0) 44 scan 44 %f a } -returnCodes error -cleanup { unset -nocomplain a } -result {can't set "a": variable is array} test scan-8.16 {error conditions} -setup { unset -nocomplain a } -body { set a(0) 44 scan 44 %f a } -returnCodes error -cleanup { unset -nocomplain a } -result {can't set "a": variable is array} test scan-8.17 {error conditions} -returnCodes error -body { scan 44 %2c a } -result {field width may not be specified in %c conversion} test scan-8.18 {error conditions} -returnCodes error -body { scan abc {%[} x } -result {unmatched [ in format string} test scan-8.19 {error conditions} -returnCodes error -body { scan abc {%[^a} x } -result {unmatched [ in format string} test scan-8.20 {error conditions} -returnCodes error -body { scan abc {%[^]a} x } -result {unmatched [ in format string} test scan-8.21 {error conditions} -returnCodes error -body { scan abc {%[]a} x } -result {unmatched [ in format string} test scan-9.1 {lots of arguments} { scan "10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200" "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 } 20 test scan-9.2 {lots of arguments} { scan "10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200" "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 set a20 } 200 test scan-10.1 {miscellaneous tests} -setup { set a {} } -body { list [scan ab16c ab%dc a] $a } -result {1 16} test scan-10.2 {miscellaneous tests} -setup { set a {} } -body { list [scan ax16c ab%dc a] $a } -result {0 {}} test scan-10.3 {miscellaneous tests} -setup { set a {} } -body { list [catch {scan ab%c114 ab%%c%d a} msg] $msg $a } -result {0 1 114} test scan-10.4 {miscellaneous tests} -setup { set a {} } -body { list [catch {scan ab%c14 ab%%c%d a} msg] $msg $a } -result {0 1 14} test scan-10.5 {miscellaneous tests} -setup { unset -nocomplain arr } -body { set arr(2) {} list [catch {scan ab%c14 ab%%c%d arr(2)} msg] $msg $arr(2) } -result {0 1 14} test scan-10.6 {miscellaneous tests} { scan 5a {%i%[a]} } {5 a} test scan-10.7 {miscellaneous tests} { scan {5 a} {%i%[a]} } {5 {}} test scan-11.1 {alignment in results array (TCL_ALIGN)} { scan "123 13.6" "%s %f" a b set b } 13.6 test scan-11.2 {alignment in results array (TCL_ALIGN)} { scan "1234567 13.6" "%s %f" a b set b } 13.6 test scan-11.3 {alignment in results array (TCL_ALIGN)} { scan "12345678901 13.6" "%s %f" a b set b } 13.6 test scan-11.4 {alignment in results array (TCL_ALIGN)} { scan "123456789012345 13.6" "%s %f" a b set b } 13.6 test scan-11.5 {alignment in results array (TCL_ALIGN)} { scan "1234567890123456789 13.6" "%s %f" a b set b } 13.6 test scan-12.1 {Tcl_ScanObjCmd, inline case} { scan a %c } 97 test scan-12.2 {Tcl_ScanObjCmd, inline case} { scan abc %c%c%c%c } {97 98 99 {}} test scan-12.3 {Tcl_ScanObjCmd, inline case} { scan abc %s%c } {abc {}} test scan-12.4 {Tcl_ScanObjCmd, inline case, underflow} { scan abc abc%c } {} test scan-12.5 {Tcl_ScanObjCmd, inline case} { scan abc bogus%c%c%c } {{} {} {}} test scan-12.6 {Tcl_ScanObjCmd, inline case} { # degenerate case, behavior changed from 8.2 to 8.3 list [catch {scan foo foobar} msg] $msg } {0 {}} test scan-12.7 {Tcl_ScanObjCmd, inline case lots of arguments} { scan "10 20 30 40 50 60 70 80 90 100 110 120 130 140\ 150 160 170 180 190 200" \ "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" } {10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 {}} test scan-13.1 {Tcl_ScanObjCmd, inline XPG case} { scan a {%1$c} } 97 test scan-13.2 {Tcl_ScanObjCmd, inline XPG case} { scan abc {%1$c%2$c%3$c%4$c} } {97 98 99 {}} test scan-13.3 {Tcl_ScanObjCmd, inline XPG case} -returnCodes error -body { scan abc {%1$c%1$c} } -result {variable is assigned by multiple "%n$" conversion specifiers} test scan-13.4 {Tcl_ScanObjCmd, inline XPG case} { scan abc {%2$s%1$c} } {{} abc} test scan-13.5 {Tcl_ScanObjCmd, inline XPG case, underflow} { scan abc {abc%5$c} } {} test scan-13.6 {Tcl_ScanObjCmd, inline XPG case} { catch {scan abc {bogus%1$c%5$c%10$c}} msg list [llength $msg] $msg } {10 {{} {} {} {} {} {} {} {} {} {}}} test scan-13.7 {Tcl_ScanObjCmd, inline XPG case lots of arguments} { scan "10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200" {%20$d %18$d %17$d %16$d %15$d %14$d %13$d %12$d %11$d %10$d %9$d %8$d %7$d %6$d %5$d %4$d %3$d %2$d %1$d} } {190 180 170 160 150 140 130 120 110 100 90 80 70 60 50 40 30 20 {} 10} test scan-13.8 {Tcl_ScanObjCmd, inline XPG case lots of arguments} { set msg [scan "10 20 30" {%100$d %5$d %200$d}] list [llength $msg] [lindex $msg 99] [lindex $msg 4] [lindex $msg 199] } {200 10 20 30} test scan-13.9 {Tcl_ScanObjCmd, inline XPG case limit error} -body { # Note this applies to 64-bit builds as well so long as max number of # command line arguments allowed for scan command is INT_MAX scan abc {%2147483648$s} } -result {"%n$" argument index out of range} -returnCodes error # scan infinities - not working test scan-14.1 {positive infinity} { scan Inf %g d return $d } Inf test scan-14.2 {negative infinity} { scan -Inf %g d return $d } -Inf test scan-15.1 {scan %g overflow for small numbers and big mantissa bug 42d14c495a} { set result [list] # xfail: n = not expected at all, x expected when unfixed foreach {exp numdig ret xfail} { -321 190 1.1116477031428047e-321 n0 -321 191 1.1116477031428047e-321 x1 -321 300 1.1116477031428047e-321 x2 -321 1600 1.1116477031428047e-321 x3 -400 110 0 n4 -400 111 0 n5 -400 300 0 n6 -221 290 1.111111111111111e-221 n7 -221 291 1.111111111111111e-221 x8 -221 400 1.111111111111111e-221 x9 -221 1600 1.111111111111111e-221 x10 -121 390 1.1111111111111112e-121 n11 -121 391 1.1111111111111112e-121 x12 -121 500 1.1111111111111112e-121 x13 -121 1600 1.1111111111111112e-121 x14 308 202 1.1111111111111112e+308 n15 308 203 1.1111111111111112e+308 n16 308 300 1.1111111111111112e+308 n17 308 1600 1.1111111111111112e+308 x18 400 110 *inf n19 400 111 *inf n20 400 300 *inf n21 221 291 1.1111111111111112e+221 n22 221 292 1.1111111111111112e+221 n23 221 400 1.1111111111111112e+221 n24 221 1600 1.1111111111111112e+221 x25 121 391 1.1111111111111111e+121 n26 121 392 1.1111111111111111e+121 n27 121 500 1.1111111111111111e+121 n28 121 1600 1.1111111111111111e+121 x29 } { set s 1.[string repeat 1 $numdig]e$exp set d "no_scan" scan $s %g d set r [format %.17g $d] if {![string match -nocase $ret $r]} { lappend result $xfail=[format %.17g $d] } } set result } {} # TODO - also need to scan NaN's catch {rename int_range {}} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/safe.test0000644000175000017500000043270615104661341014544 0ustar sergeisergei# safe.test -- # # This file contains a collection of tests for safe Tcl, packages loading, and # using safe interpreters. Sourcing this file into tcl runs the tests and # generates output for errors. No output means no errors were found. # # The defunct package http 1.0 was convenient for testing package loading. # - Tests that used http are replaced here with tests that use example packages # provided in subdirectory auto0 of the tests directory, which are independent # of any changes made to the packages provided with Tcl itself. # - These are tests 7.1 7.2 7.4 9.11 9.13 17.1 17.2 17.4 # - Tests 5.* test the example packages themselves before they # are used to test Safe Base interpreters. # - Alternative tests using stock packages of Tcl 8.7 are in file # safe-stock.test. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] foreach i [interp children] { interp delete $i } set SaveAutoPath $::auto_path set ::auto_path [info library] set TestsDir [file normalize [file dirname [info script]]] set PathMapp [list $tcl_library TCLLIB $TestsDir TESTSDIR] proc getAutoPath {child} { set ap1 [lrange [lindex [safe::interpConfigure $child -autoPath] 1] 0 end] set ap2 [::safe::DetokPath $child [interp eval $child set ::auto_path]] list $ap1 -- $ap2 } proc mapList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } return $listOut } proc mapAndSortList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } lsort $listOut } # Force actual loading of the safe package because we use unexported (and # thus unautoindexed) APIs in this test result arguments: catch {safe::interpConfigure} # testing that nested and statics do what is advertised (we use a static # package - tcl::test - but it might be absent if we're in standard tclsh) testConstraint tcl::test [expr {![catch {package require tcl::test}]}] testConstraint AutoSyncDefined 1 ### 1. Basic help/error messages. test safe-1.1 {safe::interpConfigure syntax} -returnCodes error -body { safe::interpConfigure } -result {no value given for parameter "child" (use -help for full usage) : child name () name of the child} test safe-1.2 {safe::interpCreate syntax, Sync Mode on} -returnCodes error -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { safe::interpCreate -help } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- (-help gives this help) ?child? name () name of the child (optional) -accessPath list () access path for the child -noStatics boolflag (false) prevent loading of statically linked pkgs -statics boolean (true) loading of statically linked pkgs -nestedLoadOk boolflag (false) allow nested loading -nested boolean (false) nested loading -deleteHook script () delete hook} test safe-1.2.1 {safe::interpCreate syntax, Sync Mode off} -returnCodes error -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { safe::interpCreate -help } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- (-help gives this help) ?child? name () name of the child (optional) -accessPath list () access path for the child -noStatics boolflag (false) prevent loading of statically linked pkgs -statics boolean (true) loading of statically linked pkgs -nestedLoadOk boolflag (false) allow nested loading -nested boolean (false) nested loading -deleteHook script () delete hook -autoPath list () ::auto_path for the child} test safe-1.3 {safe::interpInit syntax} -returnCodes error -body { safe::interpInit -noStatics } -result {bad value "-noStatics" for parameter child name () name of the child} ### 2. Aliases in a new "interp create" interpreter. test safe-2.1 {creating interpreters, should have no aliases} emptyTest { # Disabled this test. It tests nothing sensible. [Bug 999612] # interp aliases } "" test safe-2.2 {creating interpreters, should have no aliases} -setup { catch {safe::interpDelete a} } -body { interp create a a aliases } -cleanup { safe::interpDelete a # This (ab)use of safe::interpDelete to delete non-Safe-Base interpreters # is regrettable and should be removed at the next major revision. } -result "" test safe-2.3 {creating safe interpreters, should have no unexpected aliases} -setup { catch {safe::interpDelete a} } -body { interp create a -safe lsort [a aliases] } -cleanup { interp delete a } -result {clock} ### 3. Simple use of interpCreate, interpInit. ### Aliases in a new "interpCreate/interpInit" interpreter. test safe-3.1 {calling safe::interpInit is safe} -setup { catch {safe::interpDelete a} interp create a -safe } -body { safe::interpInit a interp eval a exec ls } -returnCodes error -cleanup { safe::interpDelete a } -result {invalid command name "exec"} test safe-3.2 {calling safe::interpCreate on trusted interp} -setup { catch {safe::interpDelete a} } -body { safe::interpCreate a lsort [a aliases] } -cleanup { safe::interpDelete a } -result {::tcl::encoding::system ::tcl::file::dirname ::tcl::file::extension ::tcl::file::rootname ::tcl::file::tail ::tcl::info::nameofexecutable clock encoding exit file glob load source} test safe-3.3 {calling safe::interpCreate on trusted interp} -setup { catch {safe::interpDelete a} } -body { safe::interpCreate a interp eval a {source [file join $tcl_library init.tcl]} } -cleanup { safe::interpDelete a } -result "" test safe-3.4 {calling safe::interpCreate on trusted interp} -setup { catch {safe::interpDelete a} } -body { safe::interpCreate a interp eval a {source [file join $tcl_library init.tcl]} } -cleanup { safe::interpDelete a } -result {} ### 4. Testing safe::interpDelete, double interpCreate. test safe-4.1 {safe::interpDelete} -setup { catch {safe::interpDelete a} } -body { interp create a safe::interpDelete a # This (ab)use of safe::interpDelete to delete non-Safe-Base interpreters # is regrettable and should be removed at the next major revision. } -result "" test safe-4.2 {safe::interpDelete, indirectly} -setup { catch {safe::interpDelete a} } -body { interp create a a alias exit safe::interpDelete a a eval exit # This (ab)use of safe::interpDelete to delete non-Safe-Base interpreters # is regrettable and should be removed at the next major revision. } -result "" test safe-4.5 {safe::interpDelete} -setup { catch {safe::interpDelete a} } -body { safe::interpCreate a safe::interpCreate a } -returnCodes error -cleanup { safe::interpDelete a } -result {interpreter named "a" already exists, cannot create} test safe-4.6 {safe::interpDelete, indirectly} -setup { catch {safe::interpDelete a} } -body { safe::interpCreate a a eval exit } -result "" ### 5. Test the example files before using them to test safe interpreters. ### The old test "safe-5.1" has been moved to "safe-stock-9.8". ### A replacement test using example files is "safe-9.8". unset -nocomplain path test safe-5.1 {example tclIndex commands, test in parent interpreter} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0 auto1] [file join $TestsDir auto0 auto2] } -body { # Try to load the commands. set code3 [catch report1 msg3] set code4 [catch report2 msg4] list $code3 $msg3 $code4 $msg4 } -cleanup { catch {rename report1 {}} catch {rename report2 {}} set ::auto_path $tmpAutoPath auto_reset } -match glob -result {0 ok1 0 ok2} test safe-5.2 {example tclIndex commands, negative test in parent interpreter} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0] } -body { # Try to load the commands. set code3 [catch report1 msg3] set code4 [catch report2 msg4] list $code3 $msg3 $code4 $msg4 } -cleanup { catch {rename report1 {}} catch {rename report2 {}} set ::auto_path $tmpAutoPath auto_reset } -match glob -result {1 {invalid command name "report1"} 1 {invalid command name "report2"}} test safe-5.3 {example pkgIndex.tcl packages, test in parent interpreter, child directories} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0] } -body { # Try to load the packages and run a command from each one. set code3 [catch {package require SafeTestPackage1} msg3] set code4 [catch {package require SafeTestPackage2} msg4] set code5 [catch HeresPackage1 msg5] set code6 [catch HeresPackage2 msg6] list $code3 $msg3 $code4 $msg4 $code5 $msg5 $code6 $msg6 } -cleanup { set ::auto_path $tmpAutoPath catch {package forget SafeTestPackage1} catch {package forget SafeTestPackage2} catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} test safe-5.4 {example pkgIndex.tcl packages, test in parent interpreter, main directories} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2] } -body { # Try to load the packages and run a command from each one. set code3 [catch {package require SafeTestPackage1} msg3] set code4 [catch {package require SafeTestPackage2} msg4] set code5 [catch HeresPackage1 msg5] set code6 [catch HeresPackage2 msg6] list $code3 $msg3 $code4 $msg4 $code5 $msg5 $code6 $msg6 } -cleanup { set ::auto_path $tmpAutoPath catch {package forget SafeTestPackage1} catch {package forget SafeTestPackage2} catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} test safe-5.5 {example modules packages, test in parent interpreter, replace path} -setup { set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { # Try to load the modules and run a command from each one. set code0 [catch {package require test0} msg0] set code1 [catch {package require mod1::test1} msg1] set code2 [catch {package require mod2::test2} msg2] set out0 [test0::try0] set out1 [mod1::test1::try1] set out2 [mod2::test2::try2] list $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } catch {package forget test0} catch {package forget mod1::test1} catch {package forget mod2::test2} catch {namespace delete ::test0} catch {namespace delete ::mod1} } -match glob -result {0 0.5 0 1.0 0 2.0 -- res0 res1 res2} test safe-5.6 {example modules packages, test in parent interpreter, append to path} -setup { tcl::tm::path add [file join $TestsDir auto0 modules] } -body { # Try to load the modules and run a command from each one. set code0 [catch {package require test0} msg0] set code1 [catch {package require mod1::test1} msg1] set code2 [catch {package require mod2::test2} msg2] set out0 [test0::try0] set out1 [mod1::test1::try1] set out2 [mod2::test2::try2] list $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] catch {package forget test0} catch {package forget mod1::test1} catch {package forget mod2::test2} catch {namespace delete ::test0} catch {namespace delete ::mod1} } -match glob -result {0 0.5 0 1.0 0 2.0 -- res0 res1 res2} ### 6. Test safe interps 'information leak'. proc SafeEval {script} { # Helper procedure that ensures the safe interp is cleaned up even if # there is a failure in the script. set SafeInterp [interp create -safe] catch {$SafeInterp eval $script} msg opts interp delete $SafeInterp return -options $opts $msg } test safe-6.1 {test safe interpreters knowledge of the world} { lsort [SafeEval {info globals}] } {tcl_interactive tcl_patchLevel tcl_platform tcl_version} test safe-6.2 {test safe interpreters knowledge of the world} { SafeEval {info script} } {} test safe-6.3 {test safe interpreters knowledge of the world} { set r [SafeEval {array names tcl_platform}] # If running a windows-debug shell, remove the "debug" element from r. if {[testConstraint win]} { set r [lsearch -all -inline -not -exact $r "debug"] } set r [lsearch -all -inline -not -exact $r "threaded"] lsort $r } {byteOrder engine pathSeparator platform pointerSize wordSize} rename SafeEval {} # More test should be added to check that hostname, nameofexecutable, aren't # leaking infos, but they still do... ### 7. Test the use of ::auto_path for loading commands (via tclIndex files) ### and non-module packages (via pkgIndex.tcl files). ### Corresponding tests with Sync Mode off are 17.* test safe-7.1 {positive non-module package require, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set tmpAutoPath $::auto_path lappend ::auto_path [file join $TestsDir auto0] set i [safe::interpCreate] set ::auto_path $tmpAutoPath } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require SafeTestPackage1}] # no error shall occur: interp eval $i {HeresPackage1} set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 1.2.3 test safe-7.2 {negative non-module package require with specific path and interpAddToAccessPath, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $TestsDir auto0]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] # an error shall occur (SafeTestPackage1 is not in auto0 but a subdirectory) list $token1 $token2 $token3 -- \ [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg -- \ $mappA -- [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:0:)} {$p(:*:)} {$p(:*:)} --\ 1 {can't find package SafeTestPackage1} --\ {TCLLIB */dummy/unixlike/test/path TESTSDIR/auto0} -- {}} test safe-7.3 {check that safe subinterpreters work} { set g [interp children] if {$g ne {}} { append g { -- residue of an earlier test} } set h [info vars ::safe::S*] if {$h ne {}} { append h { -- residue of an earlier test} } set i [safe::interpCreate] set j [safe::interpCreate [list $i x]] list $g $h [interp eval $j {join {o k} ""}] [safe::interpDelete $i] \ [interp exists $j] [info vars ::safe::S*] } {{} {} ok {} 0 {}} test safe-7.3.1 {check that safe subinterpreters work with namespace names} -setup { } -body { set g [interp children] if {$g ne {}} { append g { -- residue of an earlier test} } set h [info vars ::safe::S*] if {$h ne {}} { append h { -- residue of an earlier test} } set i [safe::interpCreate foo::bar] set j [safe::interpCreate [list $i hello::world]] list $g $h [interp eval $j {join {o k} ""}] \ [foo::bar eval {hello::world eval {join {o k} ""}}] \ [safe::interpDelete $i] \ [interp exists $j] [info vars ::safe::S*] } -match glob -result {{} {} ok ok {} 0 {}} test safe-7.4 {positive non-module package require with specific path and interpAddToAccessPath, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join $TestsDir auto0 auto1]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] # this time, unlike test safe-7.2, SafeTestPackage1 should be found list $token1 $token2 -- \ [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg -- \ $mappA -- [safe::interpDelete $i] # Note that the glob match elides directories (those from the module path) # other than the first and last in the access path. } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:0:)} {$p(:*:)} -- 0 1.2.3 --\ {TCLLIB * TESTSDIR/auto0/auto1} -- {}} test safe-7.5 {positive and negative module package require, including ancestor directory issue, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } tcl::tm::path add [file join $TestsDir auto0 modules] set i [safe::interpCreate] tcl::tm::path remove [file join $TestsDir auto0 modules] interp eval $i { package forget mod1::test1 catch {namespace delete ::mod1} } } -body { # Should raise an error (module ancestor directory issue) set code1 [catch {interp eval $i {package require test1}} msg1] # Should not raise an error set code2 [catch {interp eval $i {package require mod1::test1}} msg2] return [list $code1 $msg1 $code2] } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {1 {can't find package test1} 0} ### 8. Test source control on file name. test safe-8.1 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} } -body { safe::interpCreate $i $i eval {source} } -returnCodes error -cleanup { safe::interpDelete $i unset i } -result {wrong # args: should be "source ?-encoding E? fileName"} test safe-8.2 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} } -body { safe::interpCreate $i $i eval {source a b c d e} } -returnCodes error -cleanup { safe::interpDelete $i unset i } -result {wrong # args: should be "source ?-encoding E? fileName"} test safe-8.3 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {lappend ::log $str} set prevlog [safe::setLogCmd] } -body { safe::interpCreate $i safe::setLogCmd safe-test-log list [catch {$i eval {source .}} msg] $msg $log } -cleanup { safe::setLogCmd $prevlog safe::interpDelete $i rename safe-test-log {} unset i log } -result {1 {permission denied} {{ERROR for child a : ".": is a directory}}} test safe-8.4 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} set prevlog [safe::setLogCmd] } -body { safe::interpCreate $i safe::setLogCmd safe-test-log list [catch {$i eval {source /abc/def}} msg] $msg $log } -cleanup { safe::setLogCmd $prevlog safe::interpDelete $i rename safe-test-log {} unset i log } -result {1 {permission denied} {{ERROR for child a : "/abc/def": not in access_path}}} test safe-8.5 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} set prevlog [safe::setLogCmd] } -body { # This tested filename == *.tcl or tclIndex, but that restriction was # removed in 8.4a4 - hobbs safe::interpCreate $i safe::setLogCmd safe-test-log list [catch { $i eval {source [file join [info lib] blah]} } msg] $msg $log } -cleanup { safe::setLogCmd $prevlog safe::interpDelete $i rename safe-test-log {} unset i log } -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah]:no such file or directory"]] test safe-8.6 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} set prevlog [safe::setLogCmd] } -body { safe::interpCreate $i safe::setLogCmd safe-test-log list [catch { $i eval {source [file join [info lib] blah.tcl]} } msg] $msg $log } -cleanup { safe::setLogCmd $prevlog safe::interpDelete $i rename safe-test-log {} unset i log } -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah.tcl]:no such file or directory"]] test safe-8.7 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} set log {} proc safe-test-log {str} {global log; lappend log $str} set prevlog [safe::setLogCmd] } -body { safe::interpCreate $i # This tested length of filename, but that restriction was removed in # 8.4a4 - hobbs safe::setLogCmd safe-test-log list [catch { $i eval {source [file join [info lib] xxxxxxxxxxx.tcl]} } msg] $msg $log } -cleanup { safe::setLogCmd $prevlog safe::interpDelete $i rename safe-test-log {} unset i log } -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] xxxxxxxxxxx.tcl]:no such file or directory"]] test safe-8.8 {safe source forbids -rsrc} emptyTest { # Disabled this test. It was only useful for long unsupported # Mac OS 9 systems. [Bug 860a9f1945] } {} test safe-8.9 {safe source and return} -setup { set i "a" set returnScript [makeFile {return "ok"} return.tcl] catch {safe::interpDelete $i} } -body { safe::interpCreate $i set token [safe::interpAddToAccessPath $i [file dirname $returnScript]] $i eval [list source $token/[file tail $returnScript]] } -cleanup { catch {safe::interpDelete $i} removeFile $returnScript unset i } -result ok test safe-8.10 {safe source and return} -setup { set i "a" set returnScript [makeFile {return -level 2 "ok"} return.tcl] catch {safe::interpDelete $i} } -body { safe::interpCreate $i set token [safe::interpAddToAccessPath $i [file dirname $returnScript]] $i eval [list apply {filename { source $filename error boom }} $token/[file tail $returnScript]] } -cleanup { catch {safe::interpDelete $i} removeFile $returnScript unset i } -result ok ### 9. Assorted options, including changes to option values. ### If Sync Mode is on, a corresponding test with Sync Mode off is 19.* test safe-9.1 {safe interps' deleteHook} -setup { set i "a" catch {safe::interpDelete $i} set res {} } -body { proc testDelHook {args} { global res # the interp still exists at that point interp eval a {set delete 1} # mark that we've been here (successfully) set res $args } safe::interpCreate $i -deleteHook "testDelHook arg1 arg2" list [interp eval $i exit] $res } -cleanup { catch {rename testDelHook {}} unset i res } -result {{} {arg1 arg2 a}} test safe-9.2 {safe interps' error in deleteHook} -setup { set i "a" catch {safe::interpDelete $i} set res {} set log {} proc safe-test-log {str} {lappend ::log $str} set prevlog [safe::setLogCmd] } -body { proc testDelHook {args} { global res # the interp still exists at that point interp eval a {set delete 1} # mark that we've been here (successfully) set res $args # create an exception error "being catched" } safe::interpCreate $i -deleteHook "testDelHook arg1 arg2" safe::setLogCmd safe-test-log list [safe::interpDelete $i] $res $log } -cleanup { safe::setLogCmd $prevlog catch {rename testDelHook {}} rename safe-test-log {} unset i log res } -result {{} {arg1 arg2 a} {{NOTICE for child a : About to delete} {ERROR for child a : Delete hook error (being catched)} {NOTICE for child a : Deleted}}} test safe-9.3 {dual specification of statics} -returnCodes error -body { safe::interpCreate -stat true -nostat } -result {conflicting values given for -statics and -noStatics} test safe-9.4 {dual specification of statics} { # no error shall occur safe::interpDelete [safe::interpCreate -stat false -nostat] } {} test safe-9.5 {dual specification of nested} -returnCodes error -body { safe::interpCreate -nested 0 -nestedload } -result {conflicting values given for -nested and -nestedLoadOk} test safe-9.6 {interpConfigure widget like behaviour} -body { # this test shall work, don't try to "fix it" unless you *really* know what # you are doing (ie you are me :p) -- dl list [set i [safe::interpCreate \ -noStatics \ -nestedLoadOk \ -deleteHook {foo bar}] safe::interpConfigure $i -accessPath /foo/bar safe::interpConfigure $i]\ [safe::interpConfigure $i -aCCess]\ [safe::interpConfigure $i -nested]\ [safe::interpConfigure $i -statics]\ [safe::interpConfigure $i -DEL]\ [safe::interpConfigure $i -accessPath /blah -statics 1 safe::interpConfigure $i]\ [safe::interpConfigure $i -deleteHook toto -nosta -nested 0 safe::interpConfigure $i] } -cleanup { safe::interpDelete $i } -match glob -result {{-accessPath * -statics 0 -nested 1 -deleteHook {foo bar} -autoPath *}\ {-accessPath *} {-nested 1} {-statics 0} {-deleteHook {foo bar}}\ {-accessPath * -statics 1 -nested 1 -deleteHook {foo bar} -autoPath *}\ {-accessPath * -statics 0 -nested 0 -deleteHook toto -autoPath *}} test safe-9.7 {interpConfigure widget like behaviour (demystified)} -body { # this test shall work, believed equivalent to 9.6 set i [safe::interpCreate \ -noStatics \ -nestedLoadOk \ -deleteHook {foo bar}] safe::interpConfigure $i -accessPath /foo/bar set a [safe::interpConfigure $i] set b [safe::interpConfigure $i -aCCess] set c [safe::interpConfigure $i -nested] set d [safe::interpConfigure $i -statics] set e [safe::interpConfigure $i -DEL] safe::interpConfigure $i -accessPath /blah -statics 1 set f [safe::interpConfigure $i] safe::interpConfigure $i -deleteHook toto -nosta -nested 0 set g [safe::interpConfigure $i] list $a $b $c $d $e $f $g } -cleanup { safe::interpDelete $i unset -nocomplain a b c d e f g i } -match glob -result {{-accessPath * -statics 0 -nested 1 -deleteHook {foo bar} -autoPath *}\ {-accessPath *} {-nested 1} {-statics 0} {-deleteHook {foo bar}}\ {-accessPath * -statics 1 -nested 1 -deleteHook {foo bar} -autoPath *}\ {-accessPath * -statics 0 -nested 0 -deleteHook toto -autoPath *}} test safe-9.8 {autoloading commands indexed in tclIndex files, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load and run the commands. set code1 [catch {interp eval $i {report1}} msg1] set code2 [catch {interp eval $i {report2}} msg2] list $path1 $path2 -- $code1 $msg1 $code2 $msg2 -- $mappA } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*}} test safe-9.9 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (dummy test of doreset), Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Load and run the commands. # This guarantees the test will pass even if the tokens are swapped. set code1 [catch {interp eval $i {report1}} msg1] set code2 [catch {interp eval $i {report2}} msg2] # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*}} test safe-9.10 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (actual test of doreset), Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Do not load the commands. With the tokens swapped, the test # will pass only if the Safe Base has called auto_reset. # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load and run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} --\ 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*}} test safe-9.11 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { # For complete correspondence to safe-9.10opt, include auto0 in access path. set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:2:)} and {$p(:3:)}. # This would have no effect because the records in Pkg of these directories # were from access as children of {$p(:1:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:2:)} {$p(:3:)} -- {$p(:3:)} {$p(:2:)} -- 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ 0 OK1 0 OK2} test safe-9.12 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement, safe-9.11 without path auto0, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- \ $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} --\ 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ 0 OK1 0 OK2} test safe-9.13 {interpConfigure change the access path; pkgIndex.tcl packages fail if directory de-listed, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Limit access path. Remove tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set code4 [catch {::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]} path4] set code5 [catch {::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]} path5] # Try to load the packages. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3] set code6 [catch {interp eval $i {package require SafeTestPackage2}} msg6] list $path1 $path2 -- $code4 $path4 -- $code5 $path5 -- $code3 $code6 -- \ $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- 1 {* not found in access path} --\ 1 {* not found in access path} -- 1 1 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} -- {TCLLIB*}} test safe-9.20 {check module loading, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} -- res0 res1 res2} # - The command safe::InterpSetConfig adds the parent's [tcl::tm::list] in # tokenized form to the child's access path, and then adds all the # descendants, discovered recursively by using glob. # - The order of the directories in the list returned by glob is system-dependent, # and therefore this is true also for (a) the order of token assignment to # descendants of the [tcl::tm::list] roots; and (b) the order of those same # directories in the access path. Both those things must be sorted before # comparing with expected results. The test is therefore not totally strict, # but will notice missing or surplus directories. test safe-9.21 {interpConfigure change the access path; check module loading, Sync Mode on; stale data case 1} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Load pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-9.22 {interpConfigure change the access path; check module loading, Sync Mode on; stale data case 0} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-9.23 {interpConfigure change the access path; check module loading, Sync Mode on; stale data case 3} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Refresh stale pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-9.24 {interpConfigure change the access path; check module loading, Sync Mode on; stale data case 2 (worst case)} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. ### 10. Test options -statics -nostatics -nested -nestedloadok catch {teststaticlibrary Safepfx1 0 0} test safe-10.1 {testing statics loading} -constraints tcl::test -setup { set i [safe::interpCreate] } -body { interp eval $i {load {} Safepfx1} } -returnCodes error -cleanup { safe::interpDelete $i } -result {load of library for prefix Safepfx1 failed: cannot use library in a safe interpreter: no Safepfx1_SafeInit procedure} test safe-10.1.1 {testing statics loading} -constraints tcl::test -setup { set i [safe::interpCreate] } -body { catch {interp eval $i {load {} Safepfx1}} m o dict get $o -errorinfo } -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {load of library for prefix Safepfx1 failed: cannot use library in a safe interpreter: no Safepfx1_SafeInit procedure invoked from within "load {} Safepfx1" invoked from within "interp eval $i {load {} Safepfx1}"} test safe-10.2 {testing statics loading / -nostatics} -constraints tcl::test -body { set i [safe::interpCreate -nostatics] interp eval $i {load {} Safepfx1} } -returnCodes error -cleanup { safe::interpDelete $i } -result {permission denied (static library)} test safe-10.3 {testing nested statics loading / no nested by default} -setup { set i [safe::interpCreate] } -constraints tcl::test -body { interp eval $i {interp create x; load {} Safepfx1 x} } -returnCodes error -cleanup { safe::interpDelete $i } -result {permission denied (nested load)} test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body { set i [safe::interpCreate -nestedloadok] interp eval $i {interp create x; load {} Safepfx1 x} } -returnCodes error -cleanup { safe::interpDelete $i } -result {load of library for prefix Safepfx1 failed: cannot use library in a safe interpreter: no Safepfx1_SafeInit procedure} test safe-10.4.1 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body { set i [safe::interpCreate -nestedloadok] catch {interp eval $i {interp create x; load {} Safepfx1 x}} m o dict get $o -errorinfo } -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {load of library for prefix Safepfx1 failed: cannot use library in a safe interpreter: no Safepfx1_SafeInit procedure invoked from within "load {} Safepfx1 x" invoked from within "interp eval $i {interp create x; load {} Safepfx1 x}"} ### 11. Safe encoding. test safe-11.1 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding } -returnCodes error -cleanup { safe::interpDelete $i } -result {wrong # args: should be "encoding subcommand ?arg ...?"} test safe-11.1a {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding foobar } -returnCodes error -cleanup { safe::interpDelete $i } -match glob -result {unknown or ambiguous subcommand "foobar": must be *} test safe-11.2 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding system cp775 } -returnCodes error -cleanup { safe::interpDelete $i } -result {wrong # args: should be "encoding system"} test safe-11.3 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding system } -cleanup { safe::interpDelete $i } -result [encoding system] test safe-11.4 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding names } -cleanup { safe::interpDelete $i } -result [encoding names] test safe-11.5 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding convertfrom cp1258 foobar } -cleanup { safe::interpDelete $i } -result foobar test safe-11.6 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding convertto cp1258 foobar } -cleanup { safe::interpDelete $i } -result foobar test safe-11.7 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding convertfrom } -returnCodes error -cleanup { safe::interpDelete $i } -result {wrong # args: should be "encoding convertfrom ?-profile profile? ?-failindex var? encoding data" or "encoding convertfrom data"} test safe-11.7.1 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { catch {interp eval $i encoding convertfrom} m o dict get $o -errorinfo } -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {wrong # args: should be "encoding convertfrom ?-profile profile? ?-failindex var? encoding data" or "encoding convertfrom data" while executing "encoding convertfrom" invoked from within "encoding convertfrom" invoked from within "interp eval $i encoding convertfrom"} test safe-11.8 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { interp eval $i encoding convertto } -returnCodes error -cleanup { safe::interpDelete $i } -result {wrong # args: should be "encoding convertto ?-profile profile? ?-failindex var? encoding data" or "encoding convertto data"} test safe-11.8.1 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { catch {interp eval $i encoding convertto} m o dict get $o -errorinfo } -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i } -result {wrong # args: should be "encoding convertto ?-profile profile? ?-failindex var? encoding data" or "encoding convertto data" while executing "encoding convertto" invoked from within "encoding convertto" invoked from within "interp eval $i encoding convertto"} ### 12. Safe glob. ### More tests of glob in sections 13, 16. test safe-12.1 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob ../* } -returnCodes error -cleanup { safe::interpDelete $i } -result "permission denied" test safe-12.2 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -directory .. * } -returnCodes error -cleanup { safe::interpDelete $i } -result "permission denied" test safe-12.3 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -join .. * } -returnCodes error -cleanup { safe::interpDelete $i } -result "permission denied" test safe-12.4 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -nocomplain ../* } -cleanup { safe::interpDelete $i } -result {} test safe-12.5 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -directory .. -nocomplain * } -cleanup { safe::interpDelete $i } -result {} test safe-12.6 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -nocomplain -join .. * } -cleanup { safe::interpDelete $i } -result {} test safe-12.7 {glob is restricted} -setup { set i [safe::interpCreate] } -body { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i } -result {permission denied} ### 13. More tests for Safe base glob, with patches @ Bug 2964715 ### More tests of glob in sections 12, 16. proc buildEnvironment {filename} { upvar 1 testdir testdir testdir2 testdir2 testfile testfile set testdir [makeDirectory deletethisdir] set testdir2 [makeDirectory deletemetoo $testdir] set testfile [makeFile {} $filename $testdir2] } proc buildEnvironment2 {filename} { upvar 1 testdir testdir testdir2 testdir2 testfile testfile upvar 1 testdir3 testdir3 testfile2 testfile2 set testdir [makeDirectory deletethisdir] set testdir2 [makeDirectory deletemetoo $testdir] set testfile [makeFile {} $filename $testdir2] set testdir3 [makeDirectory deleteme $testdir] set testfile2 [makeFile {} $filename $testdir3] } test safe-13.1 {glob is restricted [Bug 2964715]} -setup { set i [safe::interpCreate] } -body { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i } -result {permission denied} test safe-13.2 {mimic the valid glob call by ::tcl::tm::UnknownHandler [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm } -body { ::safe::interpAddToAccessPath $i $testdir2 set result [$i eval glob -nocomplain -directory $testdir2 *.tm] if {$result eq [list $testfile]} { return "glob match" } else { return "no match: $result" } } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {glob match} test safe-13.3 {cf 13.2 but test glob failure when -directory is outside access path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm } -body { $i eval glob -directory $testdir2 *.tm } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {permission denied} test safe-13.4 {another valid glob call [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm } -body { ::safe::interpAddToAccessPath $i $testdir ::safe::interpAddToAccessPath $i $testdir2 set result [$i eval \ glob -nocomplain -directory $testdir [file join deletemetoo *.tm]] if {$result eq [list $testfile]} { return "glob match" } else { return "no match: $result" } } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {glob match} test safe-13.5 {as 13.4 but test glob failure when -directory is outside access path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm } -body { ::safe::interpAddToAccessPath $i $testdir2 $i eval \ glob -directory $testdir [file join deletemetoo *.tm] } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {permission denied} test safe-13.6 {as 13.4 but test silent failure when result is outside access_path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm } -body { ::safe::interpAddToAccessPath $i $testdir $i eval \ glob -nocomplain -directory $testdir [file join deletemetoo *.tm] } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {} test safe-13.7 {mimic the glob call by tclPkgUnknown in a safe interpreter [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment pkgIndex.tcl } -body { set safeTD [::safe::interpAddToAccessPath $i $testdir] ::safe::interpAddToAccessPath $i $testdir2 mapList [list $safeTD EXPECTED] [$i eval [list \ glob -directory $safeTD -join * pkgIndex.tcl]] } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {EXPECTED/deletemetoo/pkgIndex.tcl} test safe-13.7.1 {mimic the glob call by tclPkgUnknown in a safe interpreter with multiple subdirectories} -setup { set i [safe::interpCreate] buildEnvironment2 pkgIndex.tcl } -body { set safeTD [::safe::interpAddToAccessPath $i $testdir] ::safe::interpAddToAccessPath $i $testdir2 ::safe::interpAddToAccessPath $i $testdir3 mapAndSortList [list $safeTD EXPECTED] [$i eval [list \ glob -directory $safeTD -join * pkgIndex.tcl]] } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {EXPECTED/deleteme/pkgIndex.tcl EXPECTED/deletemetoo/pkgIndex.tcl} # See comments on lsort after test safe-9.20. test safe-13.8 {mimic the glob call by tclPkgUnknown without the special treatment that is specific to pkgIndex.tcl [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment notIndex.tcl } -body { set safeTD [::safe::interpAddToAccessPath $i $testdir] ::safe::interpAddToAccessPath $i $testdir2 $i eval [list glob -directory $safeTD -join -nocomplain * notIndex.tcl] } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {} test safe-13.9 {as 13.8 but test glob failure when -directory is outside access path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment notIndex.tcl } -body { ::safe::interpAddToAccessPath $i $testdir2 set result [$i eval \ glob -directory $testdir -join -nocomplain * notIndex.tcl] if {$result eq [list $testfile]} { return {glob match} } else { return "no match: $result" } } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {no match: } test safe-13.10 {as 13.8 but test silent failure when result is outside access_path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment notIndex.tcl } -body { ::safe::interpAddToAccessPath $i $testdir $i eval glob -directory $testdir -join -nocomplain * notIndex.tcl } -cleanup { safe::interpDelete $i removeDirectory $testdir } -result {} rename buildEnvironment {} rename buildEnvironment2 {} ### 14. Sanity checks on paths - module path, access path, auto_path. test safe-14.1 {Check that module path is the same as in the parent interpreter [Bug 2964715]} -setup { set i [safe::interpCreate] } -body { set tm {} foreach token [$i eval ::tcl::tm::path list] { lappend tm [dict get [set ::safe::S${i}(access_path,map)] $token] } return $tm } -cleanup { safe::interpDelete $i } -result [::tcl::tm::path list] test safe-14.2 {Check that first element of child auto_path (and access path) is Tcl Library, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set lib1 [info library] set lib2 [file dirname $lib1] set ::auto_TMP $::auto_path set ::auto_path [list $lib1 $lib2] set i [safe::interpCreate] } -body { set autoList {} set token [lindex [$i eval set ::auto_path] 0] set auto0 [dict get [set ::safe::S${i}(access_path,map)] $token] set accessList [lindex [safe::interpConfigure $i -accessPath] 1] return [list [lindex $accessList 0] $auto0] } -cleanup { set ::auto_path $::auto_TMP safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [info library] [info library]] test safe-14.2.1 {Check that first element of child auto_path (and access path) is Tcl Library, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set lib1 [info library] set lib2 [file dirname $lib1] set ::auto_TMP $::auto_path set ::auto_path [list $lib1 $lib2] set i [safe::interpCreate] } -body { set autoList {} set token [lindex [$i eval set ::auto_path] 0] set auto0 [dict get [set ::safe::S${i}(access_path,map)] $token] set accessList [lindex [safe::interpConfigure $i -accessPath] 1] set autoList [lindex [safe::interpConfigure $i -autoPath] 1] return [list [lindex $accessList 0] [lindex $autoList 0] $auto0] } -cleanup { set ::auto_path $::auto_TMP safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [info library] [info library] [info library]] test safe-14.3 {Check that first element of child auto_path (and access path) is Tcl Library, even if not true for parent, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set lib1 [info library] set lib2 [file dirname $lib1] set ::auto_TMP $::auto_path set ::auto_path [list $lib2 $lib1] # Unexpected order, should be reversed in the child set i [safe::interpCreate] } -body { set autoList {} set token [lindex [$i eval set ::auto_path] 0] set auto0 [dict get [set ::safe::S${i}(access_path,map)] $token] set accessList [lindex [safe::interpConfigure $i -accessPath] 1] return [list [lindex $accessList 0] $auto0] } -cleanup { set ::auto_path $::auto_TMP safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [info library] [info library]] test safe-14.3.1 {Check that first element of child auto_path (and access path) is Tcl Library, even if not true for parent, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set lib1 [info library] set lib2 [file dirname $lib1] set ::auto_TMP $::auto_path set ::auto_path [list $lib2 $lib1] # Unexpected order, should be reversed in the child set i [safe::interpCreate] } -body { set autoList {} set token [lindex [$i eval set ::auto_path] 0] set auto0 [dict get [set ::safe::S${i}(access_path,map)] $token] set accessList [lindex [safe::interpConfigure $i -accessPath] 1] set autoList [lindex [safe::interpConfigure $i -autoPath] 1] return [list [lindex $accessList 0] [lindex $autoList 0] $auto0] } -cleanup { set ::auto_path $::auto_TMP safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [info library] [info library] [info library]] ### 15. Safe file ensemble. test safe-15.1 {safe file ensemble does not surprise code} -setup { set i [interp create -safe] } -body { set result [expr {"file" in [interp hidden $i]}] lappend result [interp eval $i {tcl::file::split a/b/c}] lappend result [catch {interp eval $i {tcl::file::isdirectory .}}] lappend result [interp invokehidden $i file split a/b/c] lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg lappend result [catch {interp invokehidden $i file isdirectory .}] interp expose $i file lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg lappend result [catch {interp eval $i {file isdirectory .}} msg] $msg } -cleanup { unset -nocomplain msg interp delete $i } -result {1 {a b c} 1 {a b c} 1 {invalid command name "file"} 1 0 {a b c} 1 {not allowed to invoke subcommand isdirectory of file}} test safe-15.2 {safe file ensemble does not surprise code} -setup { set i [interp create -safe] } -body { set result [expr {"file" in [interp hidden $i]}] lappend result [interp eval $i {tcl::file::split a/b/c}] lappend result [catch {interp eval $i {tcl::file::isdirectory .}}] lappend result [interp invokehidden $i file split a/b/c] lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg lappend result [catch {interp invokehidden $i file isdirectory .}] interp expose $i file lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg lappend result [catch {interp eval $i {file isdirectory .}} msg o] [dict get $o -errorinfo] } -cleanup { unset -nocomplain msg o interp delete $i } -result {1 {a b c} 1 {a b c} 1 {invalid command name "file"} 1 0 {a b c} 1 {not allowed to invoke subcommand isdirectory of file while executing "file isdirectory ." invoked from within "interp eval $i {file isdirectory .}"}} ### 16. ~ should have no special meaning in paths in safe interpreters. ### Defang it in glob. ### More tests of glob in sections 12, 13. test safe-16.1 {Bug 3529949: defang ~ in paths} -setup { set savedHOME $env(HOME) set env(HOME) /foo/bar set i [safe::interpCreate] } -body { $i eval { set d [format %c 126] list [file join [file dirname $d] [file tail $d]] } } -cleanup { safe::interpDelete $i set env(HOME) $savedHOME unset savedHOME } -result {./~} test safe-16.2 {Bug 3529949: defang ~user in paths} -setup { set i [safe::interpCreate] set user $tcl_platform(user) } -body { string map [list $user USER] [$i eval \ "file join \[file dirname ~$user\] \[file tail ~$user\]"] } -cleanup { safe::interpDelete $i unset user } -result {./~USER} test safe-16.3 {Bug 3529949: defang ~ in globs} -setup { set syntheticHOME [makeDirectory foo] makeFile {} bar $syntheticHOME set savedHOME $env(HOME) set env(HOME) $syntheticHOME set i [safe::interpCreate] } -body { ::safe::interpAddToAccessPath $i $syntheticHOME $i eval {glob -nocomplain ~/*} } -cleanup { safe::interpDelete $i set env(HOME) $savedHOME removeDirectory $syntheticHOME unset savedHOME syntheticHOME } -result {} test safe-16.4 {Bug 3529949: defang ~user in globs} -setup { set i [safe::interpCreate] } -body { ::safe::interpAddToAccessPath $i $~$tcl_platform(user) $i eval [list glob -nocomplain ~$tcl_platform(user)/*] } -cleanup { safe::interpDelete $i } -result {} test safe-16.5 {Bug 3529949: defang ~ in paths used by AliasGlob (1)} -setup { set savedHOME $env(HOME) set env(HOME) /foo/bar set i [safe::interpCreate] } -body { $i eval { set d [format %c 126] file join {$p(:0:)} $d } } -cleanup { safe::interpDelete $i set env(HOME) $savedHOME unset savedHOME } -result {$p(:0:)/~} test safe-16.6 {Bug 3529949: defang ~ in paths used by AliasGlob (2)} -setup { set savedHOME $env(HOME) set env(HOME) /foo/bar set i [safe::interpCreate] } -body { $i eval { set d [format %c 126] file join {$p(:0:)/foo/bar} $d } } -cleanup { safe::interpDelete $i set env(HOME) $savedHOME unset savedHOME } -result {$p(:0:)/foo/bar/~} test safe-16.7 {Bug 3529949: defang ~user in paths used by AliasGlob (1)} -setup { set i [safe::interpCreate] set user $tcl_platform(user) } -body { string map [list $user USER] [$i eval [list file join {$p(:0:)} ~$user]] } -cleanup { safe::interpDelete $i unset user } -result {$p(:0:)/~USER} test safe-16.8 {Bug 3529949: defang ~user in paths used by AliasGlob (2)} -setup { set i [safe::interpCreate] set user $tcl_platform(user) } -body { string map [list $user USER] [$i eval [list file join {$p(:0:)/foo/bar} ~$user]] } -cleanup { safe::interpDelete $i unset user } -result {$p(:0:)/foo/bar/~USER} ### 17. Test the use of ::auto_path for loading commands (via tclIndex files) ### and non-module packages (via pkgIndex.tcl files). ### Corresponding tests with Sync Mode on are 7.* test safe-17.1 {cf. safe-7.1 - positive non-module package require, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } # Without AutoPathSync, we need a more complete auto_path, # because the child will use the same value. set lib1 [info library] set lib2 [file join $TestsDir auto0] set ::auto_TMP $::auto_path set ::auto_path [list $lib1 $lib2] set i [safe::interpCreate] set ::auto_path $::auto_TMP } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require SafeTestPackage1}] # no error shall occur: interp eval $i HeresPackage1 set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 1.2.3 test safe-17.2 {cf. safe-7.2 - negative non-module package require with specific path and interpAddToAccessPath, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not have been set by Safe Base: set auto1 [interp eval $i {set ::auto_path}] # This does not change the value of option -autoPath: interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $TestsDir auto0]] # an error shall occur (SafeTestPackage1 is not in auto0 but a subdirectory) list $auto1 $token1 $token2 $token3 \ [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg \ [safe::interpConfigure $i]\ [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {\$p(:0:)} {\$p(:*:)} {\$p(:*:)}\ 1 {can't find package SafeTestPackage1}\ {-accessPath {[list $tcl_library \ */dummy/unixlike/test/path \ $TestsDir/auto0]}\ -statics 0 -nested 1 -deleteHook {} -autoPath {}} {}" # (not a counterpart of safe-7.3) test safe-17.3 {Check that default auto_path is the same as in the parent interpreter, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate] } -body { # This file's header sets auto_path to a single directory [info library], # which is the one required by Safe Base to be present & first in the list. set ap {} foreach token [$i eval set ::auto_path] { lappend ap [dict get [set ::safe::S${i}(access_path,map)] $token] } return [list $ap [lindex [::safe::interpConfigure $i -autoPath] 1]] } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list $::auto_path $::auto_path] test safe-17.4 {cf. safe-7.4 - positive non-module package require with specific path and interpAddToAccessPath, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not have been set by Safe Base: set auto1 [interp eval $i {set ::auto_path}] # This does not change the value of option -autoPath. interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join $TestsDir auto0]] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $TestsDir auto0 auto1]] # should not have been changed by Safe Base: set auto2 [interp eval $i {set ::auto_path}] set auto3 [interp eval $i [list set ::auto_path [list {$p(:0:)} $token2]]] # This time, unlike test safe-17.2 and the try above, SafeTestPackage1 should be found: list $auto1 $auto2 $token1 $token2 $token3 \ [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg \ [safe::interpConfigure $i]\ [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {{\$p(:0:)}} {\$p(:0:)} {\$p(:*:)} {\$p(:*:)} 0 1.2.3\ {-accessPath {[list $tcl_library *$TestsDir/auto0 $TestsDir/auto0/auto1]}\ -statics 0 -nested 1 -deleteHook {}\ -autoPath {}} {}" test safe-17.5 {cf. safe-7.5 - positive and negative module package require, including ancestor directory issue, Sync Mode off} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } tcl::tm::path add [file join $TestsDir auto0 modules] set i [safe::interpCreate] tcl::tm::path remove [file join $TestsDir auto0 modules] interp eval $i { package forget mod1::test1 catch {namespace delete ::mod1} } } -body { # Should raise an error (tests module ancestor directory rule) set code1 [catch {interp eval $i {package require test1}} msg1] # Should not raise an error set code2 [catch {interp eval $i {package require mod1::test1}} msg2] return [list $code1 $msg1 $code2] } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {1 {can't find package test1} 0} ### 18. Test tokenization of directories available to a child. test safe-18.1 {Check that each directory of the default auto_path is a valid token, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set i [safe::interpCreate] } -body { set badTokens {} foreach dir [$i eval {set ::auto_path}] { if {[regexp {^\$p\(:[0-9]+:\)$} $dir]} { # Match - OK - token has expected form } else { # No match - possibly an ordinary path has not been tokenized lappend badTokens $dir } } set badTokens } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {} test safe-18.1.1 {Check that each directory of the default auto_path is a valid token, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate] } -body { set badTokens {} foreach dir [$i eval {set ::auto_path}] { if {[regexp {^\$p\(:[0-9]+:\)$} $dir]} { # Match - OK - token has expected form } else { # No match - possibly an ordinary path has not been tokenized lappend badTokens $dir } } set badTokens } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {} test safe-18.2 {Check that each directory of the module path is a valid token, Sync Mode on} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set i [safe::interpCreate] } -body { set badTokens {} foreach dir [$i eval {::tcl::tm::path list}] { if {[regexp {^\$p\(:[0-9]+:\)$} $dir]} { # Match - OK - token has expected form } else { # No match - possibly an ordinary path has not been tokenized lappend badTokens $dir } } set badTokens } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {} test safe-18.2.1 {Check that each directory of the module path is a valid token, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate] } -body { set badTokens {} foreach dir [$i eval {::tcl::tm::path list}] { if {[regexp {^\$p\(:[0-9]+:\)$} $dir]} { # Match - OK - token has expected form } else { # No match - possibly an ordinary path has not been tokenized lappend badTokens $dir } } set badTokens } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {} ### 19. Assorted options, including changes to option values. ### Mostly these are changes to access path, auto_path, module path. ### If Sync Mode is on, a corresponding test with Sync Mode off is 9.* test safe-19.8 {autoloading commands indexed in tclIndex files, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load and run the commands. set code1 [catch {interp eval $i {report1}} msg1] set code2 [catch {interp eval $i {report2}} msg2] list $path1 $path2 -- $code1 $msg1 $code2 $msg2 -- $mappA -- $mappC -- $toksC } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {{$p(:0:)} {$p(:1:)} {$p(:2:)}}} test safe-19.9 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (dummy test of doreset), Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Load and run the commands. # This guarantees the test will pass even if the tokens are swapped. set code1 [catch {interp eval $i {report1}} msg1] set code2 [catch {interp eval $i {report2}} msg2] # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confB -autoPath]] set toksD [interp eval $i set ::auto_path] # Run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $toksC -- $toksD } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {{$p(:0:)} {$p(:1:)} {$p(:2:)}} -- {{$p(:0:)} {$p(:2:)} {$p(:1:)}}} test safe-19.10 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (actual test of doreset), Sync Mode off} -constraints {AutoSyncDefined} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Do not load the commands. With the tokens swapped, the test # will pass only if the Safe Base has called auto_reset. # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confB -autoPath]] set toksD [interp eval $i set ::auto_path] # Load and run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $toksC -- $toksD } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} --\ 0 ok1 0 ok2 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2} --\ {{$p(:0:)} {$p(:1:)} {$p(:2:)}} -- {{$p(:0:)} {$p(:2:)} {$p(:1:)}}} test safe-19.11 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement (1), Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:2:)} and {$p(:3:)}. # This would have no effect because the records in Pkg of these directories # were from access as children of {$p(:1:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confB -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $toksC -- $toksD -- \ $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:2:)} {$p(:3:)} -- {$p(:3:)} {$p(:2:)} -- 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ {TCLLIB TESTSDIR/auto0} -- {TCLLIB TESTSDIR/auto0} --\ {{$p(:0:)} {$p(:1:)}} -- {{$p(:0:)} {$p(:1:)}} --\ 0 OK1 0 OK2} test safe-19.12 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement, safe-19.11 without path auto0, Sync Mode off} -constraints {AutoSyncDefined} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { # To manage without path auto0, use an auto_path that is unusual for # package discovery. set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:2:)} and {$p(:3:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confB -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $toksC -- $toksD -- \ $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} --\ 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1} --\ {{$p(:0:)} {$p(:1:)} {$p(:2:)}} -- {{$p(:0:)} {$p(:1:)} {$p(:2:)}} --\ 0 OK1 0 OK2} test safe-19.13 {interpConfigure change the access path; pkgIndex.tcl packages fail if directory de-listed, Sync Mode off} -constraints {AutoSyncDefined} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { # Path auto0 added (cf. safe-9.3) because it is needed for auto_path. set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Limit access path. Remove tokens {$p(:2:)} and {$p(:3:)}. safe::interpConfigure $i -accessPath [list $tcl_library] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set code4 [catch {::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]} path4] set code5 [catch {::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]} path5] set mappD [mapList $PathMapp [dict get $confB -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3] set code6 [catch {interp eval $i {package require SafeTestPackage2}} msg6] list $path1 $path2 -- $code4 $path4 -- $code5 $path5 -- $code3 $code6 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $toksC -- $toksD } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:2:)} {$p(:3:)} -- 1 {* not found in access path} --\ 1 {* not found in access path} -- 1 1 --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB*} -- {TCLLIB TESTSDIR/auto0} -- {TCLLIB TESTSDIR/auto0} --\ {{$p(:0:)} {$p(:1:)}} -- {{$p(:0:)}}} # (no counterpart safe-9.14) test safe-19.14 {when interpConfigure changes the access path, ::auto_path uses -autoPath value and new tokens, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { # Test that although -autoPath is unchanged, the child's ::auto_path changes to # reflect the changes in token mappings. set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:3:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto2] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confA -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path0 $path1 $path2 -- $path5 $path3 $path4 -- $toksC -- $toksD -- \ $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} {$p(:3:)} -- {$p(:3:)} {$p(:2:)} {$p(:1:)} -- {{$p(:0:)} {$p(:1:)}} -- {{$p(:0:)} {$p(:3:)}} -- 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto2 TESTSDIR/auto0/auto1 TESTSDIR/auto0*} --\ {TCLLIB TESTSDIR/auto0} --\ {TCLLIB TESTSDIR/auto0} --\ 0 OK1 0 OK2} # (no counterpart safe-9.15) test safe-19.15 {when interpConfigure changes the access path, ::auto_path uses -autoPath value and new tokens, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { # Test that although -autoPath is unchanged, the child's ::auto_path changes to # reflect the changes in token mappings; and that it is based on the -autoPath # value, not the previously restricted child ::auto_path. set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $TestsDir auto0]] \ -autoPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Add more directories. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto2]] set mappD [mapList $PathMapp [dict get $confA -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path0 -- $path5 $path3 $path4 -- $toksC -- $toksD -- \ $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $mappC -- $mappD -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} -- {$p(:1:)} {$p(:2:)} {$p(:3:)} -- {{$p(:0:)}} -- {{$p(:0:)} {$p(:2:)} {$p(:3:)}} -- 0 1.2.3 0 2.3.4 --\ {TCLLIB TESTSDIR/auto0*} --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2*} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2} --\ 0 OK1 0 OK2} # (no counterpart safe-9.16) test safe-19.16 {default value for -accessPath and -autoPath on creation; -autoPath preserved when -accessPath changes, ::auto_path using changed tokens, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set tmpAutoPath $::auto_path set ::auto_path [list $tcl_library [file join $TestsDir auto0]] set i [safe::interpCreate] set ::auto_path $tmpAutoPath } -body { # Test that the -autoPath acquires and keeps the parent's value unless otherwise specified. # Inspect. set confA [safe::interpConfigure $i] set mappC [mapList $PathMapp [dict get $confA -autoPath]] set toksC [interp eval $i set ::auto_path] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Remove a directory. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0] \ [file join $TestsDir auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0]] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 auto1]] set mappD [mapList $PathMapp [dict get $confA -autoPath]] set toksD [interp eval $i set ::auto_path] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path5 $path3 -- [lindex $toksC 0] [llength $toksC] -- \ $toksD -- $code3 $msg3 $code4 $msg4 -- \ $mappB -- $mappC -- $mappD -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:0:)} 2 --\ {{$p(:0:)} {$p(:1:)}} -- 0 1.2.3 1 {can't find package SafeTestPackage2} --\ {TCLLIB TESTSDIR/auto0 TESTSDIR/auto0/auto1*} --\ {TCLLIB TESTSDIR/auto0} -- {TCLLIB TESTSDIR/auto0} --\ 0 OK1 1 {invalid command name "HeresPackage2"}} test safe-19.20 {check module loading, Sync Mode off} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} -- res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-19.21 {interpConfigure change the access path; check module loading, Sync Mode off; stale data case 1} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Load pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-19.22 {interpConfigure change the access path; check module loading, Sync Mode off; stale data case 0} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-19.23 {interpConfigure change the access path; check module loading, Sync Mode off; stale data case 3} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Refresh stale pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. test safe-19.24 {interpConfigure change the access path; check module loading, Sync Mode off; stale data case 2 (worst case)} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $TestsDir auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $TestsDir auto0 auto1] \ [file join $TestsDir auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $TestsDir auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- \ [lsort [list $path3 $path4 $path5]] -- $modsB -- \ $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- \ $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $TestsDir auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} --\ {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} --\ 0 0.5 0 1.0 0 2.0 --\ {TCLLIB TESTSDIR/auto0/modules TESTSDIR/auto0/modules/mod1\ TESTSDIR/auto0/modules/mod2} --\ {TCLLIB TESTSDIR/auto0/auto1 TESTSDIR/auto0/auto2 TESTSDIR/auto0/modules\ TESTSDIR/auto0/modules/mod1 TESTSDIR/auto0/modules/mod2} --\ res0 res1 res2} # See comments on lsort after test safe-9.20. ### 20. safe::interpCreate with different cases of -accessPath, -autoPath. set ::auto_path [list $tcl_library [file dirname $tcl_library] [file join $TestsDir auto0]] test safe-20.1 "create -accessPath NULL -autoPath NULL -> parent's ::auto_path" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list $::auto_path -- $::auto_path] test safe-20.2 "create -accessPath {} -autoPath NULL -> parent's ::auto_path" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath {}] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list $::auto_path -- $::auto_path] test safe-20.3 "create -accessPath path1 -autoPath NULL -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1]] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-20.4 "create -accessPath NULL -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -autoPath {}] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-20.5 "create -accessPath {} -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath {} -autoPath {}] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-20.6 "create -accessPath path1 -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath {}] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-20.7 "create -accessPath NULL -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -autoPath [lrange $::auto_path 0 0]] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 0 0] -- [lrange $::auto_path 0 0]] test safe-20.8 "create -accessPath {} -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath {} -autoPath [lrange $::auto_path 0 0]] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 0 0] -- [lrange $::auto_path 0 0]] test safe-20.9 "create -accessPath path1 -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 0 0] -- [lrange $::auto_path 0 0]] test safe-20.10 "create -accessPath NULL -autoPath pathX -> pathX" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -autoPath /not/in/access/path] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} test safe-20.11 "create -accessPath {} -autoPath pathX -> pathX" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath {} -autoPath /not/in/access/path] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} test safe-20.12 "create -accessPath path1 -autoPath pathX -> {pathX}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath /not/in/access/path] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} ### 21. safe::interpConfigure with different cases of -accessPath, -autoPath. test safe-21.1 "interpConfigure -accessPath NULL -autoPath NULL -> no change" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -deleteHook {} getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 0 0] -- [lrange $::auto_path 0 0]] test safe-21.2 "interpConfigure -accessPath {} -autoPath NULL -> parent's ::auto_path" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath {} getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list $::auto_path -- $::auto_path] test safe-21.3 "interpConfigure -accessPath path1 -autoPath NULL -> no change" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath [lrange $::auto_path 0 1] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 0 0] -- [lrange $::auto_path 0 0]] test safe-21.4 "interpConfigure -accessPath NULL -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -autoPath {} getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-21.5 "interpConfigure -accessPath {} -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath {} -autoPath {} getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-21.6 "interpConfigure -accessPath {path1} -autoPath {} -> {}" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath [lrange $::auto_path 1 1] -autoPath {} getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {{} -- {}} test safe-21.7 "interpConfigure -accessPath NULL -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -autoPath [lrange $::auto_path 1 1] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 1 1] -- [lrange $::auto_path 1 1]] test safe-21.8 "interpConfigure -accessPath {} -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath {} -autoPath [lrange $::auto_path 1 1] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 1 1] -- [lrange $::auto_path 1 1]] test safe-21.9 "interpConfigure -accessPath path1 -autoPath path2 -> path2" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath [lrange $::auto_path 0 2] -autoPath [lrange $::auto_path 1 1] getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result [list [lrange $::auto_path 1 1] -- [lrange $::auto_path 1 1]] test safe-21.10 "interpConfigure -accessPath NULL -autoPath pathX -> pathX" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -autoPath /not/in/access/path getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} test safe-21.11 "interpConfigure -accessPath {} -autoPath pathX -> pathX" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath {} -autoPath /not/in/access/path getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} test safe-21.12 "interpConfigure -accessPath path1 -autoPath pathX -> pathX" -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate -accessPath [lrange $::auto_path 0 1] -autoPath [lrange $::auto_path 0 0]] } -body { safe::interpConfigure $i -accessPath [lrange $::auto_path 0 2] -autoPath /not/in/access/path getAutoPath $i } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {/not/in/access/path -- {}} # cleanup set ::auto_path $SaveAutoPath unset SaveAutoPath TestsDir PathMapp rename getAutoPath {} unset -nocomplain path rename mapList {} rename mapAndSortList {} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/safe-zipfs.test0000644000175000017500000011637415104661341015675 0ustar sergeisergei# safe-zipfs.test -- # # This file contains tests for safe Tcl that test its compatibility with the # zipfs facilities introduced in Tcl 8.7. Test numbering is for comparison # with similar tests in safe.test that do not use the zipfs file system. # # Sourcing this file into tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. apply [list {} { global auto_path global tcl_library if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } foreach i [interp children] { interp delete $i } set SaveAutoPath $::auto_path set ::auto_path [info library] set TestsDir [file normalize [file dirname [info script]]] set ZipMountPoint [zipfs root]auto-files zipfs mount [file join $TestsDir auto-files.zip] $ZipMountPoint set PathMapp {} lappend PathMapp $tcl_library TCLLIB $TestsDir TESTSDIR $ZipMountPoint ZIPDIR proc mapList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } return $listOut } proc mapAndSortList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } lsort $listOut } # Force actual loading of the safe package because we use un-exported (and # thus un-autoindexed) APIs in this test result arguments: catch {safe::interpConfigure} testConstraint AutoSyncDefined 1 # Tests 5.* test the example files before using them to test safe interpreters. test safe-zipfs-5.1 {example tclIndex commands, test in parent interpreter; zipfs} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2] } -body { # Try to load the commands. set code3 [catch report1 msg3] set code4 [catch report2 msg4] list $code3 $msg3 $code4 $msg4 } -cleanup { catch {rename report1 {}} catch {rename report2 {}} set ::auto_path $tmpAutoPath auto_reset } -match glob -result {0 ok1 0 ok2} test safe-zipfs-5.2 {example tclIndex commands, negative test in parent interpreter; zipfs} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $ZipMountPoint auto0] } -body { # Try to load the commands. set code3 [catch report1 msg3] set code4 [catch report2 msg4] list $code3 $msg3 $code4 $msg4 } -cleanup { catch {rename report1 {}} catch {rename report2 {}} set ::auto_path $tmpAutoPath auto_reset } -match glob -result {1 {invalid command name "report1"} 1 {invalid command name "report2"}} test safe-zipfs-5.3 {example pkgIndex.tcl packages, test in parent interpreter, child directories; zipfs} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $ZipMountPoint auto0] } -body { # Try to load the packages and run a command from each one. set code3 [catch {package require SafeTestPackage1} msg3] set code4 [catch {package require SafeTestPackage2} msg4] set code5 [catch HeresPackage1 msg5] set code6 [catch HeresPackage2 msg6] list $code3 $msg3 $code4 $msg4 $code5 $msg5 $code6 $msg6 } -cleanup { set ::auto_path $tmpAutoPath catch {package forget SafeTestPackage1} catch {package forget SafeTestPackage2} catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} test safe-zipfs-5.4 {example pkgIndex.tcl packages, test in parent interpreter, main directories; zipfs} -setup { set tmpAutoPath $::auto_path lappend ::auto_path [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2] } -body { # Try to load the packages and run a command from each one. set code3 [catch {package require SafeTestPackage1} msg3] set code4 [catch {package require SafeTestPackage2} msg4] set code5 [catch HeresPackage1 msg5] set code6 [catch HeresPackage2 msg6] list $code3 $msg3 $code4 $msg4 $code5 $msg5 $code6 $msg6 } -cleanup { set ::auto_path $tmpAutoPath catch {package forget SafeTestPackage1} catch {package forget SafeTestPackage2} catch {rename HeresPackage1 {}} catch {rename HeresPackage2 {}} } -match glob -result {0 1.2.3 0 2.3.4 0 OK1 0 OK2} test safe-zipfs-5.5 {example modules packages, test in parent interpreter, replace path; zipfs} -setup { set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { # Try to load the modules and run a command from each one. set code0 [catch {package require test0} msg0] set code1 [catch {package require mod1::test1} msg1] set code2 [catch {package require mod2::test2} msg2] set out0 [test0::try0] set out1 [mod1::test1::try1] set out2 [mod2::test2::try2] list $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } catch {package forget test0} catch {package forget mod1::test1} catch {package forget mod2::test2} catch {namespace delete ::test0} catch {namespace delete ::mod1} } -match glob -result {0 0.5 0 1.0 0 2.0 -- res0 res1 res2} test safe-zipfs-5.6 {example modules packages, test in parent interpreter, append to path; zipfs} -setup { tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { # Try to load the modules and run a command from each one. set code0 [catch {package require test0} msg0] set code1 [catch {package require mod1::test1} msg1] set code2 [catch {package require mod2::test2} msg2] set out0 [test0::try0] set out1 [mod1::test1::try1] set out2 [mod2::test2::try2] list $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] catch {package forget test0} catch {package forget mod1::test1} catch {package forget mod2::test2} catch {namespace delete ::test0} catch {namespace delete ::mod1} } -match glob -result {0 0.5 0 1.0 0 2.0 -- res0 res1 res2} # high level general test # Use zipped example packages not http1.0 etc test safe-zipfs-7.1 {tests that everything works at high level with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set tmpAutoPath $::auto_path lappend ::auto_path [file join $ZipMountPoint auto0] set i [safe::interpCreate] set ::auto_path $tmpAutoPath } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require SafeTestPackage1}] # no error shall occur: interp eval $i {HeresPackage1} set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 1.2.3 test safe-zipfs-7.2 {tests specific path and interpFind/AddToAccessPath with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $ZipMountPoint auto0]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] # an error shall occur (SafeTestPackage1 is not anymore in the secure 0-level # provided deep path) list $token1 $token2 $token3 -- [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg -- $mappA -- [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:0:)} {$p(:*:)} {$p(:*:)} -- 1 {can't find package SafeTestPackage1} -- {TCLLIB */dummy/unixlike/test/path ZIPDIR/auto0} -- {}} test safe-zipfs-7.4 {tests specific path and positive search with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join $ZipMountPoint auto0 auto1]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] # this time, unlike test safe-zipfs-7.2, SafeTestPackage1 should be found list $token1 $token2 -- [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg -- $mappA -- [safe::interpDelete $i] # Note that the glob match elides directories (those from the module path) # other than the first and last in the access path. } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:0:)} {$p(:*:)} -- 0 1.2.3 -- {TCLLIB * ZIPDIR/auto0/auto1} -- {}} test safe-zipfs-9.9 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (dummy test of doreset) with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Load and run the commands. # This guarantees the test will pass even if the tokens are swapped. set code1 [catch {interp eval $i {report1}} msg1] set code2 [catch {interp eval $i {report2}} msg2] # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto2] [file join $ZipMountPoint auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 ok1 0 ok2 -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2*} -- {TCLLIB ZIPDIR/auto0/auto2 ZIPDIR/auto0/auto1*}} test safe-zipfs-9.10 {interpConfigure change the access path; tclIndex commands unaffected by token rearrangement (actual test of doreset) with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load auto_load data. interp eval $i {catch nonExistentCommand} # Do not load the commands. With the tokens swapped, the test # will pass only if the Safe Base has called auto_reset. # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto2] [file join $ZipMountPoint auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load and run the commands. set code3 [catch {interp eval $i {report1}} msg3] set code4 [catch {interp eval $i {report2}} msg4] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 ok1 0 ok2 -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2*} -- {TCLLIB ZIPDIR/auto0/auto2 ZIPDIR/auto0/auto1*}} test safe-zipfs-9.11 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { # For complete correspondence to safe-stock-9.11, include auto0 in access path. set i [safe::interpCreate -accessPath [list $tcl_library [file join $ZipMountPoint auto0] [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:2:)} and {$p(:3:)}. # This would have no effect because the records in Pkg of these directories # were from access as children of {$p(:1:)}. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0] [file join $ZipMountPoint auto0 auto2] [file join $ZipMountPoint auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:2:)} {$p(:3:)} -- {$p(:3:)} {$p(:2:)} -- 0 1.2.3 0 2.3.4 -- {TCLLIB ZIPDIR/auto0 ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2*} -- {TCLLIB ZIPDIR/auto0 ZIPDIR/auto0/auto2 ZIPDIR/auto0/auto1*} -- 0 OK1 0 OK2} test safe-zipfs-9.12 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement, 9.10 without path auto0 with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto2] [file join $ZipMountPoint auto0 auto1]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3 opts3] set code4 [catch {interp eval $i {package require SafeTestPackage2}} msg4 opts4] set code5 [catch {interp eval $i {HeresPackage1}} msg5 opts5] set code6 [catch {interp eval $i {HeresPackage2}} msg6 opts6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- $mappA -- $mappB -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 1.2.3 0 2.3.4 -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2*} -- {TCLLIB ZIPDIR/auto0/auto2 ZIPDIR/auto0/auto1*} -- 0 OK1 0 OK2} test safe-zipfs-9.13 {interpConfigure change the access path; pkgIndex.tcl packages fail if directory de-listed, with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Limit access path. Remove tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set code4 [catch {::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto1]} path4] set code5 [catch {::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 auto2]} path5] # Try to load the packages. set code3 [catch {interp eval $i {package require SafeTestPackage1}} msg3] set code6 [catch {interp eval $i {package require SafeTestPackage2}} msg6] list $path1 $path2 -- $code4 $path4 -- $code5 $path5 -- $code3 $code6 -- $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- 1 {* not found in access path} -- 1 {* not found in access path} -- 1 1 -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2*} -- {TCLLIB*}} test safe-zipfs-9.20 {check module loading, with conventional AutoPathSync; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} -- 0 0.5 0 1.0 0 2.0 -- {TCLLIB ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- res0 res1 res2} # - The command safe::InterpSetConfig adds the parent's [tcl::tm::list] in # tokenized form to the child's access path, and then adds all the # descendants, discovered recursively by using glob. # - The order of the directories in the list returned by glob is system-dependent, # and therefore this is true also for (a) the order of token assignment to # descendants of the [tcl::tm::list] roots; and (b) the order of those same # directories in the access path. Both those things must be sorted before # comparing with expected results. The test is therefore not totally strict, # but will notice missing or surplus directories. test safe-zipfs-9.21 {interpConfigure change the access path; check module loading, with conventional AutoPathSync; stale data case 1; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Load pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- [lsort [list $path3 $path4 $path5]] -- $modsB -- $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} -- {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} -- 0 0.5 0 1.0 0 2.0 -- {TCLLIB ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2 ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- res0 res1 res2} # See comments on lsort after test safe-zipfs-9.20. test safe-zipfs-9.22 {interpConfigure change the access path; check module loading, with conventional AutoPathSync; stale data case 0; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- [lsort [list $path3 $path4 $path5]] -- $modsB -- $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} -- {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} -- 0 0.5 0 1.0 0 2.0 -- {TCLLIB ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2 ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- res0 res1 res2} # See comments on lsort after test safe-zipfs-9.20. test safe-zipfs-9.23 {interpConfigure change the access path; check module loading, with conventional AutoPathSync; stale data case 3; zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Refresh stale pkg data. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- [lsort [list $path3 $path4 $path5]] -- $modsB -- $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} -- {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} -- 0 0.5 0 1.0 0 2.0 -- {TCLLIB ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2 ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- res0 res1 res2} # See comments on lsort after test safe-zipfs-9.20. test safe-zipfs-9.24 {interpConfigure change the access path; check module loading, with conventional AutoPathSync; stale data case 2 (worst case); zipfs} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set oldTm [tcl::tm::path list] foreach path $oldTm { tcl::tm::path remove $path } tcl::tm::path add [file join $ZipMountPoint auto0 modules] } -body { set i [safe::interpCreate -accessPath [list $tcl_library]] # Inspect. set confA [safe::interpConfigure $i] set sortA [mapAndSortList $PathMapp [dict get $confA -accessPath]] set modsA [interp eval $i {tcl::tm::path list}] set path0 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path1 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path2 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Force the interpreter to acquire pkg data which will soon become stale. catch {interp eval $i {package require NOEXIST}} catch {interp eval $i {package require mod1::NOEXIST}} catch {interp eval $i {package require mod2::NOEXIST}} # Add to access path. # This injects more tokens, pushing modules to higher token numbers. safe::interpConfigure $i -accessPath [list $tcl_library [file join $ZipMountPoint auto0 auto1] [file join $ZipMountPoint auto0 auto2]] # Inspect. set confB [safe::interpConfigure $i] set sortB [mapAndSortList $PathMapp [dict get $confB -accessPath]] set modsB [interp eval $i {tcl::tm::path list}] set path3 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules]] set path4 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod1]] set path5 [::safe::interpFindInAccessPath $i [file join $ZipMountPoint auto0 modules mod2]] # Try to load the packages and run a command from each one. set code0 [catch {interp eval $i {package require test0}} msg0] set code1 [catch {interp eval $i {package require mod1::test1}} msg1] set code2 [catch {interp eval $i {package require mod2::test2}} msg2] set out0 [interp eval $i {test0::try0}] set out1 [interp eval $i {mod1::test1::try1}] set out2 [interp eval $i {mod2::test2::try2}] list [lsort [list $path0 $path1 $path2]] -- $modsA -- [lsort [list $path3 $path4 $path5]] -- $modsB -- $code0 $msg0 $code1 $msg1 $code2 $msg2 -- $sortA -- $sortB -- $out0 $out1 $out2 } -cleanup { tcl::tm::path remove [file join $ZipMountPoint auto0 modules] foreach path [lreverse $oldTm] { tcl::tm::path add $path } safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{{$p(:1:)} {$p(:2:)} {$p(:3:)}} -- {{$p(:1:)}} -- {{$p(:3:)} {$p(:4:)} {$p(:5:)}} -- {{$p(:3:)}} -- 0 0.5 0 1.0 0 2.0 -- {TCLLIB ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- {TCLLIB ZIPDIR/auto0/auto1 ZIPDIR/auto0/auto2 ZIPDIR/auto0/modules ZIPDIR/auto0/modules/mod1 ZIPDIR/auto0/modules/mod2} -- res0 res1 res2} # See comments on lsort after test safe-zipfs-9.20. test safe-zipfs-18.1 {cf. safe-zipfs-7.1 - tests that everything works at high level without conventional AutoPathSync; zipfs} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } # Without AutoPathSync, we need a more complete auto_path, # because the child will use the same value. set lib1 [info library] set lib2 [file join $ZipMountPoint auto0] set ::auto_TMP $::auto_path set ::auto_path [list $lib1 $lib2] set i [safe::interpCreate] set ::auto_path $::auto_TMP } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require SafeTestPackage1}] # no error shall occur: interp eval $i HeresPackage1 set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 1.2.3 test safe-zipfs-18.2 {cf. safe-zipfs-7.2 - tests specific path and interpFind/AddToAccessPath without conventional AutoPathSync; zipfs} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] set auto1 [interp eval $i {set ::auto_path}] interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $ZipMountPoint auto0]] # an error shall occur (SafeTestPackage1 is not anymore in the secure 0-level # provided deep path) list $auto1 $token1 $token2 $token3 [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg [safe::interpConfigure $i] [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {\$p(:0:)} {\$p(:*:)} {\$p(:*:)} 1 {can't find package SafeTestPackage1} {-accessPath {[list $tcl_library */dummy/unixlike/test/path $ZipMountPoint/auto0]} -statics 0 -nested 1 -deleteHook {} -autoPath {}} {}" test safe-zipfs-18.4 {cf. safe-zipfs-7.4 - tests specific path and positive search and auto_path without conventional AutoPathSync; zipfs} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not have been set by Safe Base: set auto1 [interp eval $i {set ::auto_path}] # This will differ from the value -autoPath {} interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join $ZipMountPoint auto0]] # should add as p* (not p2 if parent has a module path) set token3 [safe::interpAddToAccessPath $i [file join $ZipMountPoint auto0 auto1]] # should not have been changed by Safe Base: set auto2 [interp eval $i {set ::auto_path}] # This will differ from the value -autoPath {} set auto3 [interp eval $i [list set ::auto_path [list {$p(:0:)} $token2]]] # This time, unlike test safe-zipfs-18.2 and the try above, SafeTestPackage1 should be found: list $auto1 $auto2 $token1 $token2 $token3 [catch {interp eval $i {package require SafeTestPackage1}} msg] $msg [safe::interpConfigure $i] [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {{\$p(:0:)}} {\$p(:0:)} {\$p(:*:)} {\$p(:*:)} 0 1.2.3 {-accessPath {[list $tcl_library *$ZipMountPoint/auto0 $ZipMountPoint/auto0/auto1]} -statics 0 -nested 1 -deleteHook {} -autoPath {}} {}" # cleanup set ::auto_path $SaveAutoPath zipfs unmount ${ZipMountPoint} unset SaveAutoPath TestsDir ZipMountPoint PathMapp rename mapList {} rename mapAndSortList {} ::tcltest::cleanupTests return } [namespace current]] # Local Variables: # mode: tcl # End: tcl9.0.3/tests/safe-stock86.test0000644000175000017500000000000015104661341016015 0ustar sergeisergeitcl9.0.3/tests/safe-stock.test0000644000175000017500000004252715104661341015663 0ustar sergeisergei# safe-stock.test -- # # This file contains tests for safe Tcl that were previously in the file # safe.test, and use files and packages of stock Tcl 8.7 to perform the tests. # These files may be changed or disappear in future revisions of Tcl, for # example package opt will eventually be removed. # # The tests are replaced in safe.tcl with tests that use files provided in the # tests directory. Test numbering is for comparison with similar tests in # safe.test. # # Sourcing this file into tcl runs the tests and generates output for errors. # No output means no errors were found. # # The defunct package http 1.0 was convenient for testing package loading. # - This file, safe-stock.test, uses packages opt and (from cookiejar) # tcl::idna to provide alternative tests based on stock Tcl packages. # - These are tests 7.1 7.2 7.4 9.11 9.13 # - Tests 7.[124], 9.1[13] use "package require opt". # - Tests 9.1[13] also use "package require tcl::idna". # - The corresponding tests in safe.test use example packages provided in # subdirectory auto0 of the tests directory, which are independent of any # changes made to the packages provided with Tcl. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } foreach i [interp children] { interp delete $i } # When using package opt for testing positive/negative package search: # - The directory location and the error message depend on whether # and how the package is installed. # Error message for test 7.2 for "package require opt". if {[string match *zipfs:/* [info library]]} { # pkgIndex.tcl is in [info library] # file to be sourced is in [info library]/opt* set pkgOptErrMsg {permission denied} } else { # pkgIndex.tcl and file to be sourced are # both in [info library]/opt* set pkgOptErrMsg {can't find package opt} } # Directory of opt for tests 7.4, 9.10, 9.12 for "package require opt". if {[file exists [file join [info library] opt0.4]]} { # Installed files in lib9.0/opt0.4 set pkgOptDir opt0.4 } elseif {[file exists [file join [info library] opt]]} { # Installed files in zipfs, or source files used by "make test" set pkgOptDir opt } else { error {cannot find opt library} } # Directory of cookiejar for tests 9.10, 9.12 for "package require tcl::idna". if {[file exists [file join [info library] cookiejar0.2]]} { # Installed files in lib8.7/cookiejar0.2 set pkgJarDir cookiejar0.2 } elseif {[file exists [file join [info library] cookiejar]]} { # Installed files in zipfs, or source files used by "make test" set pkgJarDir cookiejar } else { error {cannot find cookiejar library} } set SaveAutoPath $::auto_path set ::auto_path [info library] set TestsDir [file normalize [file dirname [info script]]] set PathMapp {} lappend PathMapp [file join [info library] $pkgOptDir] TCLLIB/OPTDIR lappend PathMapp [file join [info library] $pkgJarDir] TCLLIB/JARDIR lappend PathMapp $tcl_library TCLLIB $TestsDir TESTSDIR proc mapList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } return $listOut } proc mapAndSortList {map listIn} { set listOut {} foreach element $listIn { lappend listOut [string map $map $element] } lsort $listOut } # Force actual loading of the safe package because we use unexported (and # thus unautoindexed) APIs in this test result arguments: catch {safe::interpConfigure} testConstraint AutoSyncDefined 1 # high level general test test safe-stock-7.1 {tests that everything works at high level with conventional AutoPathSync, use pkg opt} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set i [safe::interpCreate] } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require opt}] # no error shall occur: interp eval $i {::tcl::Lempty {a list}} set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 0.4.* test safe-stock-7.2 {tests specific path and interpFind/AddToAccessPath with conventional AutoPathSync, use pkg opt} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # an error shall occur (opt is not anymore in the secure 0-level # provided deep path) set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] list $token1 $token2 -- \ [catch {interp eval $i {package require opt}} msg] $msg -- \ $mappA -- [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{\$p(:0:)} {\$p(:*:)} -- 1 {$pkgOptErrMsg} --\ {TCLLIB */dummy/unixlike/test/path} -- {}" test safe-stock-7.4 {tests specific path and positive search with conventional AutoPathSync, use pkg opt} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } else { set SyncVal_TMP 1 } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join [info library] $pkgOptDir]] set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] # this time, unlike test safe-stock-7.2, opt should be found list $token1 $token2 -- \ [catch {interp eval $i {package require opt}} msg] $msg -- \ $mappA -- [safe::interpDelete $i] # Note that the glob match elides directories (those from the module path) # other than the first and last in the access path. } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:0:)} {$p(:*:)} -- 0 0.4.* --\ {TCLLIB * TCLLIB/OPTDIR} -- {}} test safe-stock-7.5 {tests positive and negative module loading with conventional AutoPathSync} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } set i [safe::interpCreate] interp eval $i { package forget platform::shell package forget platform catch {namespace delete ::platform} } } -body { # Should raise an error (module ancestor directory issue) set code1 [catch {interp eval $i {package require shell}} msg1] # Should not raise an error set code2 [catch {interp eval $i {package require platform::shell}} msg2] return [list $code1 $msg1 $code2] } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {1 {can't find package shell} 0} # The following test checks whether the definition of tcl_endOfWord can be # obtained from auto_loading. It was previously test "safe-5.1". test safe-stock-9.8 {test auto-loading in safe interpreters, was safe-5.1} -setup { catch {safe::interpDelete a} safe::interpCreate a } -body { interp eval a {tcl_endOfWord "" 0} } -cleanup { safe::interpDelete a } -result -1 test safe-stock-9.11 {interpConfigure change the access path; pkgIndex.tcl packages unaffected by token rearrangement with conventional AutoPathSync, uses pkg opt and tcl::idna} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $tcl_library $pkgOptDir] \ [file join $tcl_library $pkgJarDir]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgOptDir]] set path2 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgJarDir]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Rearrange access path. Swap tokens {$p(:1:)} and {$p(:2:)}. # This has no effect because the records in Pkg of these directories were from access as children of {$p(:0:)}. safe::interpConfigure $i -accessPath [list $tcl_library \ [file join $tcl_library $pkgJarDir] \ [file join $tcl_library $pkgOptDir]] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set path3 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgOptDir]] set path4 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgJarDir]] # Try to load the packages and run a command from each one. set code3 [catch {interp eval $i {package require tcl::idna}} msg3] set code4 [catch {interp eval $i {package require opt}} msg4] set code5 [catch {interp eval $i {::tcl::Lempty {a list}}} msg5] set code6 [catch {interp eval $i {::tcl::idna::IDNAencode example.com}} msg6] list $path1 $path2 -- $path3 $path4 -- $code3 $msg3 $code4 $msg4 -- \ $mappA -- $mappB -- $code5 $msg5 $code6 $msg6 } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- {$p(:2:)} {$p(:1:)} -- 0 1.* 0 0.4.* --\ {TCLLIB TCLLIB/OPTDIR TCLLIB/JARDIR*} --\ {TCLLIB TCLLIB/JARDIR TCLLIB/OPTDIR*} --\ 0 0 0 example.com} test safe-stock-9.13 {interpConfigure change the access path; pkgIndex.tcl packages fail if directory de-listed with conventional AutoPathSync, uses pkg opt and tcl::idna} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 1 } } -body { set i [safe::interpCreate -accessPath [list $tcl_library \ [file join $tcl_library $pkgOptDir] \ [file join $tcl_library $pkgJarDir]]] # Inspect. set confA [safe::interpConfigure $i] set mappA [mapList $PathMapp [dict get $confA -accessPath]] set path1 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgOptDir]] set path2 [::safe::interpFindInAccessPath $i [file join $tcl_library $pkgJarDir]] # Load pkgIndex.tcl data. catch {interp eval $i {package require NOEXIST}} # Limit access path. Remove tokens {$p(:1:)} and {$p(:2:)}. safe::interpConfigure $i -accessPath [list $tcl_library] # Inspect. set confB [safe::interpConfigure $i] set mappB [mapList $PathMapp [dict get $confB -accessPath]] set code4 [catch {::safe::interpFindInAccessPath $i [file join $tcl_library $pkgOptDir]} path4] set code5 [catch {::safe::interpFindInAccessPath $i [file join $tcl_library $pkgJarDir]} path5] # Try to load the packages. set code3 [catch {interp eval $i {package require opt}} msg3] set code6 [catch {interp eval $i {package require tcl::idna}} msg6] list $path1 $path2 -- $code4 $path4 -- $code5 $path5 -- $code3 $code6 -- \ $mappA -- $mappB } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result {{$p(:1:)} {$p(:2:)} -- 1 {* not found in access path} --\ 1 {* not found in access path} -- 1 1 --\ {TCLLIB TCLLIB/OPTDIR TCLLIB/JARDIR*} -- {TCLLIB*}} test safe-stock-18.1 {cf. safe-stock-7.1opt - tests that everything works at high level without conventional AutoPathSync, use pkg opt} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } # Without AutoPathSync, we need a more complete auto_path, # because the child will use the same value. set lib1 [info library] set lib2 [file dirname $lib1] set ::auto_TMP $::auto_path set ::auto_path [list $lib1 $lib2] set i [safe::interpCreate] set ::auto_path $::auto_TMP } -body { # no error shall occur: # (because the default access_path shall include 1st level sub dirs so # package require in a child works like in the parent) set v [interp eval $i {package require opt}] # no error shall occur: interp eval $i {::tcl::Lempty {a list}} set v } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result 0.4.* test safe-stock-18.2 {cf. safe-stock-7.2opt - tests specific path and interpFind/AddToAccessPath without conventional AutoPathSync, use pkg opt} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] set auto1 [interp eval $i {set ::auto_path}] # This will differ from the value -autoPath {} interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i "/dummy/unixlike/test/path"] # an error shall occur (opt is not anymore in the secure 0-level # provided deep path) list $auto1 $token1 $token2 \ [catch {interp eval $i {package require opt}} msg] $msg \ [safe::interpConfigure $i]\ [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {\$p(:0:)} {\$p(:*:)} 1 {$pkgOptErrMsg}\ {-accessPath {[list $tcl_library */dummy/unixlike/test/path]}\ -statics 0 -nested 1 -deleteHook {} -autoPath {}} {}" test safe-stock-18.4 {cf. safe-stock-7.4opt - tests specific path and positive search and auto_path without conventional AutoPathSync, use pkg opt} -constraints AutoSyncDefined -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } } -body { set i [safe::interpCreate -nostat -nested 1 -accessPath [list [info library]]] # should not have been set by Safe Base: set auto1 [interp eval $i {set ::auto_path}] # This will differ from the value -autoPath {} interp eval $i {set ::auto_path [list {$p(:0:)}]} # should not add anything (p0) set token1 [safe::interpAddToAccessPath $i [info library]] # should add as p* (not p1 if parent has a module path) set token2 [safe::interpAddToAccessPath $i [file join [info library] $pkgOptDir]] # should not have been changed by Safe Base: set auto2 [interp eval $i {set ::auto_path}] # This time, unlike test safe-stock-18.2opt and the try above, opt should be found: list $auto1 $auto2 $token1 $token2 \ [catch {interp eval $i {package require opt}} msg] $msg \ [safe::interpConfigure $i]\ [safe::interpDelete $i] } -cleanup { if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -match glob -result "{} {{\$p(:0:)}} {\$p(:0:)} {\$p(:*:)} 0 0.4.*\ {-accessPath {[list $tcl_library *$tcl_library/$pkgOptDir]}\ -statics 0 -nested 1 -deleteHook {} -autoPath {}} {}" test safe-stock-18.5 {cf. safe-stock-7.5 - tests positive and negative module loading without conventional AutoPathSync} -setup { set SyncExists [expr {[info commands ::safe::setSyncMode] ne {}}] if {$SyncExists} { set SyncVal_TMP [safe::setSyncMode] safe::setSyncMode 0 } else { error {This test is meaningful only if the command ::safe::setSyncMode is defined} } set i [safe::interpCreate] interp eval $i { package forget platform::shell package forget platform catch {namespace delete ::platform} } } -body { # Should raise an error (tests module ancestor directory rule) set code1 [catch {interp eval $i {package require shell}} msg1] # Should not raise an error set code2 [catch {interp eval $i {package require platform::shell}} msg2] return [list $code1 $msg1 $code2] } -cleanup { safe::interpDelete $i if {$SyncExists} { safe::setSyncMode $SyncVal_TMP } } -result {1 {can't find package shell} 0} set ::auto_path $SaveAutoPath unset pkgOptErrMsg pkgOptDir pkgJarDir SaveAutoPath TestsDir PathMapp rename mapList {} rename mapAndSortList {} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/result.test0000644000175000017500000001234315104661341015133 0ustar sergeisergei# This file tests the routines in tclResult.c. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Some tests require the testsaveresult command testConstraint testsaveresult [llength [info commands testsaveresult]] testConstraint testsetobjerrorcode [llength [info commands testsetobjerrorcode]] testConstraint testseterrorcode [llength [info commands testseterrorcode]] testConstraint testreturn [llength [info commands testreturn]] test result-1.1 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult small {set x 42} 0 } {small result} test result-1.2 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult append {set x 42} 0 } {append result} test result-1.3 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult dynamic {set x 42} 0 } {dynamic result freed} test result-1.4 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult object {set x 42} 0 } {object result same} test result-1.5 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult small {set x 42} 1 } {42} test result-1.6 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult append {set x 42} 1 } {42} test result-1.7 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult dynamic {set x 42} 1 } {42 freed} test result-1.8 {Tcl_SaveInterpResult} {testsaveresult} { testsaveresult object {set x 42} 1 } {42 different} # Tcl_RestoreInterpResult is mostly tested by the previous tests except # for the following case test result-2.1 {Tcl_RestoreInterpResult} {testsaveresult} { testsaveresult append {cd _foobar} 0 } {append result} # Tcl_DiscardInterpResult is mostly tested by the previous tests except # for the following cases test result-3.1 {Tcl_DiscardInterpResult} -constraints testsaveresult -body { testsaveresult append {cd _foobar} 1 } -returnCodes error -result {couldn't change working directory to "_foobar": no such file or directory} test result-3.2 {Tcl_DiscardInterpResult} {testsaveresult} { testsaveresult free {set x 42} 1 } {42} test result-4.1 {Tcl_SetObjErrorCode - one arg} {testsetobjerrorcode} { catch {testsetobjerrorcode 1} list [set errorCode] } {1} test result-4.2 {Tcl_SetObjErrorCode - two args} {testsetobjerrorcode} { catch {testsetobjerrorcode 1 2} list [set errorCode] } {{1 2}} test result-4.3 {Tcl_SetObjErrorCode - three args} {testsetobjerrorcode} { catch {testsetobjerrorcode 1 2 3} list [set errorCode] } {{1 2 3}} test result-4.4 {Tcl_SetObjErrorCode - four args} {testsetobjerrorcode} { catch {testsetobjerrorcode 1 2 3 4} list [set errorCode] } {{1 2 3 4}} test result-4.5 {Tcl_SetObjErrorCode - five args} {testsetobjerrorcode} { catch {testsetobjerrorcode 1 2 3 4 5} list [set errorCode] } {{1 2 3 4 5}} test result-5.1 {Tcl_SetErrorCode - one arg} testseterrorcode { catch {testseterrorcode 1} set errorCode } 1 test result-5.2 {Tcl_SetErrorCode - one arg, list quoting} testseterrorcode { catch {testseterrorcode {a b}} set errorCode } {{a b}} test result-5.3 {Tcl_SetErrorCode - one arg, list quoting} testseterrorcode { catch {testseterrorcode \{} llength $errorCode } 1 test result-5.4 {Tcl_SetErrorCode - two args, list quoting} testseterrorcode { catch {testseterrorcode {a b} c} set errorCode } {{a b} c} test result-6.0 {Bug 1209759} -constraints testreturn -body { # Might panic if bug is not fixed. proc foo {} {testreturn} foo } -result {} test result-6.1 {Bug 1209759} -constraints testreturn -body { # Might panic if bug is not fixed. proc foo {} {catch {return -level 2}; testreturn} foo } -cleanup { rename foo {} } -result {} test result-6.2 {Bug 1649062} -setup { proc foo {} { if {[catch { return -code error -errorinfo custom -errorcode CUSTOM foo } err]} { return [list $err $::errorCode $::errorInfo] } } set ::errorInfo {} set ::errorCode {} } -body { foo } -cleanup { rename foo {} } -result {foo {} {}} test result-6.3 {Bug 2383005} { catch {return -code error -errorcode {{}a} eek} m set m } {bad -errorcode value: expected a list but got "{}a"} test result-6.4 {non-list -errorstack} -body { catch {return -code error -errorstack {{}a} eek} m o list $m [dict get $o -errorcode] [dict get $o -errorstack] } -match glob -result {{bad -errorstack value: expected a list but got "{}a"} {TCL RESULT NONLIST_ERRORSTACK} {INNER * UP 1}} test result-6.5 {odd-sized-list -errorstack} -body { catch {return -code error -errorstack a eek} m o list $m [dict get $o -errorcode] [dict get $o -errorstack] } -match glob -result {{forbidden odd-sized list for -errorstack: "a"} {TCL RESULT ODDSIZEDLIST_ERRORSTACK} {INNER * UP 1}} # cleanup cleanupTests return tcl9.0.3/tests/resolver.test0000644000175000017500000002040015104661341015447 0ustar sergeisergei# This test collection covers some unwanted interactions between command # literal sharing and the use of command resolvers (per-interp) which cause # command literals to be re-used with their command references being invalid # in the reusing context. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2011 Gustaf Neumann # Copyright © 2011 Stefan Sobernig # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testinterpresolver [llength [info commands testinterpresolver]] test resolver-1.1 {cmdNameObj sharing vs. cmd resolver: namespace import} -setup { testinterpresolver up namespace eval ::ns1 { proc z {} { return Z } namespace export z } proc ::y {} { return Y } proc ::x {} { z } } -constraints testinterpresolver -body { # 1) Have the proc body compiled: During compilation or, alternatively, # the first evaluation of the compiled body, the InterpCmdResolver (see # tclTest.c) maps the cmd token "z" to "::y"; this mapping is saved in the # resulting CmdName Tcl_Obj with the print string "z". The CmdName Tcl_Obj # is turned into a command literal shared for a given (here: the global) # namespace. set r0 [x]; # --> The result of [x] is "Y" # 2) After having requested cmd resolution above, we can now use the # globally shared CmdName Tcl_Obj "z", now bound to cmd ::y. This is # certainly questionable, but defensible set r1 [z]; # --> The result of [z] is "Y" # 3) We import from the namespace ns1 another z. [namespace import] takes # care "shadowed" cmd references, however, till now cmd literals have not # been touched. This is, however, necessary since the BC compiler (used in # the [namespace eval]) seems to be eager to reuse CmdName Tcl_Objs as cmd # literals for a given NS scope. We expect, that r2 is "Z", the result of # the namespace imported cmd. namespace eval :: { namespace import ::ns1::z set r2 [z] } list $r0 $r1 $::r2 } -cleanup { testinterpresolver down rename ::x "" rename ::y "" namespace delete ::ns1 } -result {Y Y Z} test resolver-1.2 {cmdNameObj sharing vs. cmd resolver: proc creation} -setup { testinterpresolver up proc ::y {} { return Y } proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] proc ::foo {} { proc ::z {} { return Z } return [z] } list $r0 $r1 [::foo] } -cleanup { testinterpresolver down rename ::x "" rename ::y "" rename ::foo "" rename ::z "" } -result {Y Y Z} test resolver-1.3 {cmdNameObj sharing vs. cmd resolver: rename} -setup { testinterpresolver up proc ::Z {} { return Z } proc ::y {} { return Y } proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] namespace eval :: { rename ::Z ::z set r2 [z] } list $r0 $r1 $r2 } -cleanup { testinterpresolver down rename ::x "" rename ::y "" rename ::z "" } -result {Y Y Z} test resolver-1.4 {cmdNameObj sharing vs. cmd resolver: interp expose} -setup { testinterpresolver up proc ::Z {} { return Z } interp hide {} Z proc ::y {} { return Y } proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] interp expose {} Z z namespace eval :: { set r2 [z] } list $r0 $r1 $r2 } -cleanup { testinterpresolver down rename ::x "" rename ::y "" rename ::z "" } -result {Y Y Z} test resolver-1.5 {cmdNameObj sharing vs. cmd resolver: other than global NS} -setup { testinterpresolver up namespace eval ::ns1 { proc z {} { return Z } namespace export z } proc ::y {} { return Y } namespace eval ::ns2 { proc x {} { z } } namespace eval :: { variable r2 "" } } -constraints testinterpresolver -body { list [namespace eval ::ns2 {x}] [namespace eval ::ns2 {z}] [namespace eval ::ns2 { namespace import ::ns1::z z }] } -cleanup { testinterpresolver down namespace delete ::ns2 namespace delete ::ns1 } -result {Y Y Z} test resolver-1.6 {cmdNameObj sharing vs. cmd resolver: interp alias} -setup { testinterpresolver up proc ::Z {} { return Z } proc ::y {} { return Y } proc ::x {} { z } } -constraints testinterpresolver -body { set r0 [x] set r1 [z] namespace eval :: { interp alias {} ::z {} ::Z set r2 [z] } list $r0 $r1 $r2 } -cleanup { testinterpresolver down rename ::x "" rename ::y "" rename ::Z "" } -result {Y Y Z} test resolver-2.1 {compiled var resolver: Bug #3383616} -setup { testinterpresolver up # The compiled var resolver fetches just variables starting with a capital # "T" and stores some test information in the resolver-specific resolver # var info. proc ::x {} { set T1 100 return $T1 } } -constraints testinterpresolver -body { # Call "x" the first time, causing a byte code compilation of the body. # During the compilation the compiled var resolver, the resolve-specific # var info is allocated, during the execution of the body, the variable is # fetched and cached. x # During later calls, the cached variable is reused. x # When the proc is freed, the resolver-specific resolver var info is # freed. This did not happen before fix #3383616. rename ::x "" } -cleanup { testinterpresolver down } -result {} # # The test resolver-3.1* test bad interactions of resolvers on the "global" # (per interp) literal pools. A resolver might resolve a cmd literal depending # on a context differently, whereas the cmd literal sharing assumed that the # namespace containing the literal solely determines the resolved cmd (and is # resolver-agnostic). # # In order to make the test cases for the per-interpreter cmd literal pool # reproducible and to minimize interactions between test cases, we use a child # interpreter per test-case. # # # Testing resolver in namespace-based context "ctx1" # test resolver-3.1a { interp command resolver, resolve literal "z" in proc "x1" in context "ctx1" } -setup { interp create i0 testinterpresolver up i0 i0 eval { proc y {} { return yy } namespace eval ::ns { proc x1 {} { z } } } } -constraints testinterpresolver -body { set r [i0 eval {namespace eval ::ctx1 { ::ns::x1 }}] return $r } -cleanup { testinterpresolver down i0 interp delete i0 } -result {yy} # # Testing resolver in namespace-based context "ctx2" # test resolver-3.1b { interp command resolver, resolve literal "z" in proc "x2" in context "ctx2" } -setup { interp create i0 testinterpresolver up i0 i0 eval { proc Y {} { return YY } namespace eval ::ns { proc x2 {} { z } } } } -constraints testinterpresolver -body { set r [i0 eval {namespace eval ::ctx2 { ::ns::x2 }}] return $r } -cleanup { testinterpresolver down i0 interp delete i0 } -result {YY} # # Testing resolver in namespace-based context "ctx1" and "ctx2" in the same # interpreter. # test resolver-3.1c { interp command resolver, resolve literal "z" in proc "x1" in context "ctx1", resolve literal "z" in proc "x2" in context "ctx2" Test, whether the shared cmd literal created by the first byte-code compilation interacts with the second one. } -setup { interp create i0 testinterpresolver up i0 i0 eval { proc y {} { return yy } proc Y {} { return YY } namespace eval ::ns { proc x1 {} { z } proc x2 {} { z } } } } -constraints testinterpresolver -body { set r1 [i0 eval {namespace eval ::ctx1 { ::ns::x1 }}] set r2 [i0 eval {namespace eval ::ctx2 { ::ns::x2 }}] set r3 [i0 eval {namespace eval ::ctx1 { ::ns::x1 }}] return [list $r1 $r2 $r3] } -cleanup { testinterpresolver down i0 interp delete i0 } -result {yy YY yy} cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/rename.test0000644000175000017500000001340415104661341015063 0ustar sergeisergei# Commands covered: rename # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testdel [llength [info commands testdel]] # Must eliminate the "unknown" command while the test is running, especially # if the test is being run in a program with its own special-purpose unknown # command. catch {rename unknown unknown.old} catch {rename r2 {}} proc r1 {} {return "procedure r1"} rename r1 r2 test rename-1.1 {simple renaming} { r2 } {procedure r1} test rename-1.2 {simple renaming} { list [catch r1 msg] $msg } {1 {invalid command name "r1"}} rename r2 {} test rename-1.3 {simple renaming} { list [catch r2 msg] $msg } {1 {invalid command name "r2"}} # The test below is tricky because it renames a built-in command. It's # possible that the test procedure uses this command, so must restore the # command before calling test again. rename list l.new set a [catch list msg1] set b [l.new a b c] rename l.new list set c [catch l.new msg2] set d [list 111 222] test rename-2.1 {renaming built-in command} { list $a $msg1 $b $c $msg2 $d } {1 {invalid command name "list"} {a b c} 1 {invalid command name "l.new"} {111 222}} test rename-3.1 {error conditions} { list [catch {rename r1} msg] $msg $errorCode } {1 {wrong # args: should be "rename oldName newName"} {TCL WRONGARGS}} test rename-3.2 {error conditions} { list [catch {rename r1 r2 r3} msg] $msg $errorCode } {1 {wrong # args: should be "rename oldName newName"} {TCL WRONGARGS}} test rename-3.3 {error conditions} -setup { proc r1 {} {} proc r2 {} {} } -returnCodes error -body { rename r1 r2 } -result {can't rename to "r2": command already exists} test rename-3.4 {error conditions} -setup { catch {rename r1 {}} catch {rename r2 {}} } -returnCodes error -body { rename r1 r2 } -result {can't rename "r1": command doesn't exist} test rename-3.5 {error conditions} -setup { catch {rename _non_existent_command {}} } -returnCodes error -body { rename _non_existent_command {} } -result {can't delete "_non_existent_command": command doesn't exist} catch {rename unknown {}} catch {rename unknown.old unknown} catch {rename bar {}} test rename-4.1 {reentrancy issues with command deletion and renaming} testdel { set x {} testdel {} foo {lappend x deleted; rename bar {}; lappend x [info command bar]} rename foo bar lappend x | rename bar {} set x } {| deleted {}} test rename-4.2 {reentrancy issues with command deletion and renaming} testdel { set x {} testdel {} foo {lappend x deleted; rename foo bar} rename foo {} set x } {deleted} test rename-4.3 {reentrancy issues with command deletion and renaming} testdel { set x {} testdel {} foo {lappend x deleted; testdel {} foo {lappend x deleted2}} rename foo {} lappend x | rename foo {} set x } {deleted | deleted2} test rename-4.4 {reentrancy issues with command deletion and renaming} testdel { set x {} testdel {} foo {lappend x deleted; rename foo bar} rename foo {} lappend x | [info command bar] } {deleted | {}} test rename-4.5 {reentrancy issues with command deletion and renaming} testdel { set env(value) before interp create foo testdel foo cmd {set env(value) deleted} interp delete foo set env(value) } {deleted} test rename-4.6 {reentrancy issues with command deletion and renaming} testdel { proc kill args { interp delete foo } set env(value) before interp create foo foo alias kill kill testdel foo cmd {set env(value) deleted; kill} list [catch {foo eval {rename cmd {}}} msg] $msg $env(value) } {0 {} deleted} test rename-4.7 {reentrancy issues with command deletion and renaming} testdel { proc kill args { interp delete foo } set env(value) before interp create foo foo alias kill kill testdel foo cmd {set env(value) deleted; kill} list [catch {interp delete foo} msg] $msg $env(value) } {0 {} deleted} if {[info exists env(value)]} { unset env(value) } test rename-4.8 {Bug a16752c252} testdel { set x broken testdel {} foo {set x ok} proc foo args {} rename foo {} return -level 0 $x[unset x] } ok # Save the unknown procedure which is modified by the following test. catch {rename unknown unknown.old} set SAVED_UNKNOWN "proc unknown " append SAVED_UNKNOWN [list [info args unknown.old] [info body unknown.old]] test rename-5.1 {repeated rename deletion and redefinition of same command} { for {set i 0} {$i < 10} {incr i} { eval $SAVED_UNKNOWN tcl_wordBreakBefore "" 0 rename tcl_wordBreakBefore {} rename unknown {} } } {} catch {rename unknown {}} catch {rename unknown.old unknown} test rename-6.1 {old code invalidated (epoch incremented) when cmd with compile proc is renamed} -body { proc x {} { set a 123 set b [incr a] } x rename incr incr.old proc incr {} {puts "new incr called!"} x } -cleanup { rename incr {} rename incr.old incr } -returnCodes error -result {wrong # args: should be "incr"} if {[info commands incr.old] != {}} { catch {rename incr {}} catch {rename incr.old incr} } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/remote.tcl0000644000175000017500000001007615104661341014714 0ustar sergeisergei# This file contains Tcl code to implement a remote server that can be # used during testing of Tcl socket code. This server is used by some # of the tests in socket.test. # # Source this file in the remote server you are using to test Tcl against. # # Copyright © 1995-1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Initialize message delimiter # Initialize command array catch {unset command} set command(0) "" set callerSocket "" # Detect whether we should print out connection messages etc. if {![info exists VERBOSE]} { set VERBOSE 0 } proc __doCommands__ {l s} { global callerSocket VERBOSE if {$VERBOSE} { puts "--- Server executing the following for socket $s:" puts $l puts "---" } set callerSocket $s set ::errorInfo "" set code [catch {uplevel "#0" $l} msg] return [list $code $::errorInfo $msg] } proc __readAndExecute__ {s} { global command VERBOSE set l [gets $s] if {[string compare $l "--Marker--Marker--Marker--"] == 0} { puts $s [__doCommands__ $command($s) $s] puts $s "--Marker--Marker--Marker--" set command($s) "" return } if {[string compare $l ""] == 0} { if {[eof $s]} { if {$VERBOSE} { puts "Server closing $s, eof from client" } close $s } return } if {[eof $s]} { if {$VERBOSE} { puts "Server closing $s, eof from client" } close $s unset command($s) return } append command($s) $l "\n" } proc __accept__ {s a p} { global command VERBOSE if {$VERBOSE} { puts "Server accepts new connection from $a:$p on $s" } set command($s) "" fconfigure $s -buffering line -translation crlf fileevent $s readable [list __readAndExecute__ $s] } set serverIsSilent 0 for {set i 0} {$i < $argc} {incr i} { if {[string compare -serverIsSilent [lindex $argv $i]] == 0} { set serverIsSilent 1 break } } if {![info exists serverPort]} { if {[info exists env(serverPort)]} { set serverPort $env(serverPort) } } if {![info exists serverPort]} { for {set i 0} {$i < $argc} {incr i} { if {[string compare -port [lindex $argv $i]] == 0} { if {$i < $argc - 1} { set serverPort [lindex $argv [expr {$i + 1}]] } break } } } if {![info exists serverPort]} { set serverPort 2048 } if {![info exists serverAddress]} { if {[info exists env(serverAddress)]} { set serverAddress $env(serverAddress) } } if {![info exists serverAddress]} { for {set i 0} {$i < $argc} {incr i} { if {[string compare -address [lindex $argv $i]] == 0} { if {$i < $argc - 1} { set serverAddress [lindex $argv [expr {$i + 1}]] } break } } } if {![info exists serverAddress]} { set serverAddress 0.0.0.0 } if {$serverIsSilent == 0} { set l "Remote server listening on port $serverPort, IP $serverAddress." puts "" puts $l for {set c [string length $l]} {$c > 0} {incr c -1} {puts -nonewline "-"} puts "" puts "" puts "You have set the Tcl variables serverAddress to $serverAddress and" puts "serverPort to $serverPort. You can set these with the -address and" puts "-port command line options, or as environment variables in your" puts "shell." puts "" puts "NOTE: The tests will not work properly if serverAddress is set to" puts "\"localhost\" or 127.0.0.1." puts "" puts "When you invoke tcltest to run the tests, set the variables" puts "remoteServerPort to $serverPort and remoteServerIP to" puts "[info hostname]. You can set these as environment variables" puts "from the shell. The tests will not work properly if you set" puts "remoteServerIP to \"localhost\" or 127.0.0.1." puts "" puts -nonewline "Type Ctrl-C to terminate--> " flush stdout } proc getPort sock { lindex [fconfigure $sock -sockname] 2 } if {[catch {set serverSocket \ [socket -myaddr $serverAddress -server __accept__ $serverPort]} msg]} { puts "Server on $serverAddress:$serverPort cannot start: $msg" } else { puts ready vwait __server_wait_variable__ } tcl9.0.3/tests/registry.test0000644000175000017500000010001515104661341015457 0ustar sergeisergei# registry.test -- # # This file contains a collection of tests for the registry command. # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # In order for these tests to run, the registry package must be on the # auto_path or the registry package must have been loaded already. # # Copyright © 1997 Sun Microsystems, Inc. All rights reserved. # Copyright © 1998-1999 Scriptics Corporation. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint reg 0 if {[testConstraint win]} { if {![catch { ::tcltest::loadTestedCommands set ::regver [package require registry 1.3.7] }]} { testConstraint reg 1 } } testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # determine the current locale testConstraint english [expr { [llength [info commands testlocale]] && [string match "English*" [testlocale all ""]] }] test registry-1.0 {check if we are testing the right dll} {win reg} { set ::regver } {1.3.7} test registry-1.1 {argument parsing for registry command} {win reg} { list [catch {registry} msg] $msg } {1 {wrong # args: should be "registry ?-32bit|-64bit? option ?arg ...?"}} test registry-1.1a {argument parsing for registry command} {win reg} { list [catch {registry -32bit} msg] $msg } {1 {wrong # args: should be "registry ?-32bit|-64bit? option ?arg ...?"}} test registry-1.1b {argument parsing for registry command} {win reg} { list [catch {registry -64bit} msg] $msg } {1 {wrong # args: should be "registry ?-32bit|-64bit? option ?arg ...?"}} test registry-1.2 {argument parsing for registry command} {win reg} { list [catch {registry foo} msg] $msg } {1 {bad option "foo": must be broadcast, delete, get, keys, set, type, or values}} test registry-1.2a {argument parsing for registry command} {win reg} { list [catch {registry -33bit foo} msg] $msg } {1 {bad mode "-33bit": must be -32bit or -64bit}} test registry-1.3 {argument parsing for registry command} {win reg} { list [catch {registry d} msg] $msg } {1 {wrong # args: should be "registry delete keyName ?valueName?"}} test registry-1.3a {argument parsing for registry command} {win reg} { list [catch {registry -32bit d} msg] $msg } {1 {wrong # args: should be "registry -32bit delete keyName ?valueName?"}} test registry-1.3b {argument parsing for registry command} {win reg} { list [catch {registry -64bit d} msg] $msg } {1 {wrong # args: should be "registry -64bit delete keyName ?valueName?"}} test registry-1.4 {argument parsing for registry command} {win reg} { list [catch {registry delete} msg] $msg } {1 {wrong # args: should be "registry delete keyName ?valueName?"}} test registry-1.5 {argument parsing for registry command} {win reg} { list [catch {registry delete foo bar baz} msg] $msg } {1 {wrong # args: should be "registry delete keyName ?valueName?"}} test registry-1.6 {argument parsing for registry command} {win reg} { list [catch {registry g} msg] $msg } {1 {wrong # args: should be "registry get keyName valueName"}} test registry-1.6a {argument parsing for registry command} {win reg} { list [catch {registry -32bit g} msg] $msg } {1 {wrong # args: should be "registry -32bit get keyName valueName"}} test registry-1.6b {argument parsing for registry command} {win reg} { list [catch {registry -64bit g} msg] $msg } {1 {wrong # args: should be "registry -64bit get keyName valueName"}} test registry-1.7 {argument parsing for registry command} {win reg} { list [catch {registry get} msg] $msg } {1 {wrong # args: should be "registry get keyName valueName"}} test registry-1.8 {argument parsing for registry command} {win reg} { list [catch {registry get foo} msg] $msg } {1 {wrong # args: should be "registry get keyName valueName"}} test registry-1.9 {argument parsing for registry command} {win reg} { list [catch {registry get foo bar baz} msg] $msg } {1 {wrong # args: should be "registry get keyName valueName"}} test registry-1.10 {argument parsing for registry command} {win reg} { list [catch {registry k} msg] $msg } {1 {wrong # args: should be "registry keys keyName ?pattern?"}} test registry-1.10a {argument parsing for registry command} {win reg} { list [catch {registry -32bit k} msg] $msg } {1 {wrong # args: should be "registry -32bit keys keyName ?pattern?"}} test registry-1.10b {argument parsing for registry command} {win reg} { list [catch {registry -64bit k} msg] $msg } {1 {wrong # args: should be "registry -64bit keys keyName ?pattern?"}} test registry-1.11 {argument parsing for registry command} {win reg} { list [catch {registry keys} msg] $msg } {1 {wrong # args: should be "registry keys keyName ?pattern?"}} test registry-1.12 {argument parsing for registry command} {win reg} { list [catch {registry keys foo bar baz} msg] $msg } {1 {wrong # args: should be "registry keys keyName ?pattern?"}} test registry-1.13 {argument parsing for registry command} {win reg} { list [catch {registry s} msg] $msg } {1 {wrong # args: should be "registry set keyName ?valueName data ?type??"}} test registry-1.13a {argument parsing for registry command} {win reg} { list [catch {registry -32bit s} msg] $msg } {1 {wrong # args: should be "registry -32bit set keyName ?valueName data ?type??"}} test registry-1.13b {argument parsing for registry command} {win reg} { list [catch {registry -64bit s} msg] $msg } {1 {wrong # args: should be "registry -64bit set keyName ?valueName data ?type??"}} test registry-1.14 {argument parsing for registry command} {win reg} { list [catch {registry set} msg] $msg } {1 {wrong # args: should be "registry set keyName ?valueName data ?type??"}} test registry-1.15 {argument parsing for registry command} {win reg} { list [catch {registry set foo bar} msg] $msg } {1 {wrong # args: should be "registry set keyName ?valueName data ?type??"}} test registry-1.16 {argument parsing for registry command} {win reg} { list [catch {registry set foo bar baz blat gorp} msg] $msg } {1 {wrong # args: should be "registry set keyName ?valueName data ?type??"}} test registry-1.17 {argument parsing for registry command} {win reg} { list [catch {registry t} msg] $msg } {1 {wrong # args: should be "registry type keyName valueName"}} test registry-1.17a {argument parsing for registry command} {win reg} { list [catch {registry -32bit t} msg] $msg } {1 {wrong # args: should be "registry -32bit type keyName valueName"}} test registry-1.17b {argument parsing for registry command} {win reg} { list [catch {registry -64bit t} msg] $msg } {1 {wrong # args: should be "registry -64bit type keyName valueName"}} test registry-1.18 {argument parsing for registry command} {win reg} { list [catch {registry type} msg] $msg } {1 {wrong # args: should be "registry type keyName valueName"}} test registry-1.19 {argument parsing for registry command} {win reg} { list [catch {registry type foo} msg] $msg } {1 {wrong # args: should be "registry type keyName valueName"}} test registry-1.20 {argument parsing for registry command} {win reg} { list [catch {registry type foo bar baz} msg] $msg } {1 {wrong # args: should be "registry type keyName valueName"}} test registry-1.21 {argument parsing for registry command} {win reg} { list [catch {registry v} msg] $msg } {1 {wrong # args: should be "registry values keyName ?pattern?"}} test registry-1.21a {argument parsing for registry command} {win reg} { list [catch {registry -32bit v} msg] $msg } {1 {wrong # args: should be "registry -32bit values keyName ?pattern?"}} test registry-1.21b {argument parsing for registry command} {win reg} { list [catch {registry -64bit v} msg] $msg } {1 {wrong # args: should be "registry -64bit values keyName ?pattern?"}} test registry-1.22 {argument parsing for registry command} {win reg} { list [catch {registry values} msg] $msg } {1 {wrong # args: should be "registry values keyName ?pattern?"}} test registry-1.23 {argument parsing for registry command} {win reg} { list [catch {registry values foo bar baz} msg] $msg } {1 {wrong # args: should be "registry values keyName ?pattern?"}} test registry-2.1 {DeleteKey: bad key} {win reg} { list [catch {registry delete foo} msg] $msg } {1 {bad root name "foo": must be HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA}} test registry-2.2 {DeleteKey: bad key} {win reg} { list [catch {registry delete HKEY_CLASSES_ROOT} msg] $msg } {1 {bad key: cannot delete root keys}} test registry-2.3 {DeleteKey: bad key} {win reg} { list [catch {registry delete HKEY_CLASSES_ROOT\\} msg] $msg } {1 {bad key: cannot delete root keys}} test registry-2.4 {DeleteKey: subkey at root level} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar registry delete HKEY_CURRENT_USER\\TclFoobar registry keys HKEY_CURRENT_USER TclFoobar } {} test registry-2.5 {DeleteKey: subkey below root level} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar\\test registry delete HKEY_CURRENT_USER\\TclFoobar\\test set result [registry keys HKEY_CURRENT_USER TclFoobar\\test] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {} test registry-2.6 {DeleteKey: recursive delete} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar\\test1 registry set HKEY_CURRENT_USER\\TclFoobar\\test2\\test3 registry delete HKEY_CURRENT_USER\\TclFoobar set result [registry keys HKEY_CURRENT_USER TclFoobar] set result } {} test registry-2.7 {DeleteKey: trailing backslashes} {win reg english} { registry set HKEY_CURRENT_USER\\TclFoobar\\baz list [catch {registry delete HKEY_CURRENT_USER\\TclFoobar\\} msg] $msg } {1 {unable to delete key: The configuration registry key is invalid.}} test registry-2.8 {DeleteKey: failure} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry delete HKEY_CURRENT_USER\\TclFoobar } {} test registry-2.9 {DeleteKey: unicode} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\test\u00c7bar\\a registry set HKEY_CURRENT_USER\\TclFoobar\\test\u00c7bar\\b registry delete HKEY_CURRENT_USER\\TclFoobar\\test\u00c7bar set result [registry keys HKEY_CURRENT_USER\\TclFoobar] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {} test registry-3.1 {DeleteValue} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz test1 blort registry set HKEY_CURRENT_USER\\TclFoobar\\baz test2 blat registry delete HKEY_CURRENT_USER\\TclFoobar\\baz test1 set result [registry values HKEY_CURRENT_USER\\TclFoobar\\baz] registry delete HKEY_CURRENT_USER\\TclFoobar set result } test2 test registry-3.2 {DeleteValue: bad key} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar list [catch {registry delete HKEY_CURRENT_USER\\TclFoobar test} msg] $msg } {1 {unable to open key: The system cannot find the file specified.}} test registry-3.3 {DeleteValue: bad value} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz test2 blort set result [list [catch {registry delete HKEY_CURRENT_USER\\TclFoobar test1} msg] $msg] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {1 {unable to delete value "test1" from key "HKEY_CURRENT_USER\TclFoobar": The system cannot find the file specified.}} test registry-3.4 {DeleteValue: Unicode} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\\u00c7baz \u00c7test1 blort registry set HKEY_CURRENT_USER\\TclFoobar\\\u00c7baz test2 blat registry delete HKEY_CURRENT_USER\\TclFoobar\\\u00c7baz \u00c7test1 set result [registry values HKEY_CURRENT_USER\\TclFoobar\\\u00c7baz] registry delete HKEY_CURRENT_USER\\TclFoobar set result } test2 test registry-4.1 {GetKeyNames: bad key} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar list [catch {registry keys HKEY_CURRENT_USER\\TclFoobar} msg] $msg } {1 {unable to open key: The system cannot find the file specified.}} test registry-4.2 {GetKeyNames} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz set result [registry keys HKEY_CURRENT_USER\\TclFoobar] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {baz} test registry-4.3 {GetKeyNames: remote key} {win reg nonPortable english} { set hostname [info hostname] registry set \\\\$hostname\\HKEY_CURRENT_USER\\TclFoobar\\baz set result [registry keys \\\\gaspode\\HKEY_CURRENT_USER\\TclFoobar] registry delete \\\\$hostname\\HKEY_CURRENT_USER\\TclFoobar set result } {baz} test registry-4.4 {GetKeyNames: empty key} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar set result [registry keys HKEY_CURRENT_USER\\TclFoobar] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {} test registry-4.5 {GetKeyNames: patterns} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz registry set HKEY_CURRENT_USER\\TclFoobar\\blat registry set HKEY_CURRENT_USER\\TclFoobar\\foo set result [lsort [registry keys HKEY_CURRENT_USER\\TclFoobar b*]] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {baz blat} test registry-4.6 {GetKeyNames: names with spaces} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz\ bar registry set HKEY_CURRENT_USER\\TclFoobar\\blat registry set HKEY_CURRENT_USER\\TclFoobar\\foo set result [lsort [registry keys HKEY_CURRENT_USER\\TclFoobar b*]] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {{baz bar} blat} test registry-4.7 {GetKeyNames: Unicode} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz\u00c7bar registry set HKEY_CURRENT_USER\\TclFoobar\\blat registry set HKEY_CURRENT_USER\\TclFoobar\\foo set result [lsort [registry keys HKEY_CURRENT_USER\\TclFoobar b*]] registry delete HKEY_CURRENT_USER\\TclFoobar set result } "baz\u00c7bar blat" test registry-4.8 {GetKeyNames: Unicode} {win reg} { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz\u30b7bar registry set HKEY_CURRENT_USER\\TclFoobar\\blat registry set HKEY_CURRENT_USER\\TclFoobar\\foo set result [lsort [registry keys HKEY_CURRENT_USER\\TclFoobar b*]] registry delete HKEY_CURRENT_USER\\TclFoobar set result } "baz\u30b7bar blat" test registry-4.9 {GetKeyNames: very long key [Bug 1682211]} {*}{ -constraints {win reg} -setup { registry set HKEY_CURRENT_USER\\TclFoobar\\a registry set HKEY_CURRENT_USER\\TclFoobar\\b[string repeat x 254] registry set HKEY_CURRENT_USER\\TclFoobar\\c } -body { lsort [registry keys HKEY_CURRENT_USER\\TclFoobar] } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar }} \ -result [list a b[string repeat x 254] c] test registry-5.1 {GetType} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar list [catch {registry type HKEY_CURRENT_USER\\TclFoobar val1} msg] $msg } {1 {unable to open key: The system cannot find the file specified.}} test registry-5.2 {GetType} {win reg english} { registry set HKEY_CURRENT_USER\\TclFoobar list [catch {registry type HKEY_CURRENT_USER\\TclFoobar val1} msg] $msg } {1 {unable to get type of value "val1" from key "HKEY_CURRENT_USER\TclFoobar": The system cannot find the file specified.}} test registry-5.3 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar none set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } none test registry-5.4 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } sz test registry-5.5 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar sz set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } sz test registry-5.6 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar expand_sz set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } expand_sz test registry-5.7 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 binary set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } binary test registry-5.8 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 dword set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } dword test registry-5.9 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 dword_big_endian set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } dword_big_endian test registry-5.10 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 link set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } link test registry-5.11 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar multi_sz set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } multi_sz test registry-5.12 {GetType} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 resource_list set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } resource_list test registry-5.13 {GetType: unknown types} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 24 set result [registry type HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 24 test registry-5.14 {GetType: Unicode} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar va\u00c7l1 1 24 set result [registry type HKEY_CURRENT_USER\\TclFoobar va\u00c7l1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 24 test registry-6.1 {GetValue} {win reg english} { registry delete HKEY_CURRENT_USER\\TclFoobar list [catch {registry get HKEY_CURRENT_USER\\TclFoobar val1} msg] $msg } {1 {unable to open key: The system cannot find the file specified.}} test registry-6.2 {GetValue} {win reg english} { registry set HKEY_CURRENT_USER\\TclFoobar list [catch {registry get HKEY_CURRENT_USER\\TclFoobar val1} msg] $msg } {1 {unable to get value "val1" from key "HKEY_CURRENT_USER\TclFoobar": The system cannot find the file specified.}} test registry-6.3 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar none set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.4 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.5 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.6 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar expand_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.7 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 binary set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 1 test registry-6.8 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 0x20 dword set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 32 test registry-6.9 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 0x20 dword_big_endian set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 32 test registry-6.10 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 link set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 1 test registry-6.11 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 foobar multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.12 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {foo\ bar baz} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {{foo bar} baz} test registry-6.13 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } {} test registry-6.14 {GetValue: truncation of multivalues with null elements} \ {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {a {} b} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } a test registry-6.15 {GetValue} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 resource_list set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 1 test registry-6.16 {GetValue: unknown types} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 1 24 set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } 1 test registry-6.17 {GetValue: Unicode value names} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val\u00c71 foobar multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val\u00c71] registry delete HKEY_CURRENT_USER\\TclFoobar set result } foobar test registry-6.18 {GetValue: values with Unicode strings} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {foo ba\u30b7r baz} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } "foo ba\u30b7r baz" test registry-6.19 {GetValue: values with Unicode strings} {win reg english} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {foo ba\u00c7r baz} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } "foo ba\u00c7r baz" test registry-6.20 {GetValue: values with Unicode strings with embedded nulls} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar val1 {foo ba\u0000r baz} multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar val1] registry delete HKEY_CURRENT_USER\\TclFoobar set result } "foo ba r baz" test registry-6.21 {GetValue: very long value names and values} {win reg} { registry set HKEY_CURRENT_USER\\TclFoobar [string repeat k 16383] [string repeat x 16383] multi_sz set result [registry get HKEY_CURRENT_USER\\TclFoobar [string repeat k 16383]] registry delete HKEY_CURRENT_USER\\TclFoobar set result } [string repeat x 16383] test registry-7.1 {GetValueNames: bad key} -constraints {win reg english} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar } -body { registry values HKEY_CURRENT_USER\\TclFoobar } -returnCodes error -result {unable to open key: The system cannot find the file specified.} test registry-7.2 {GetValueNames} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar baz foobar } -body { registry values HKEY_CURRENT_USER\\TclFoobar } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result baz test registry-7.3 {GetValueNames} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar baz foobar1 registry set HKEY_CURRENT_USER\\TclFoobar blat foobar2 registry set HKEY_CURRENT_USER\\TclFoobar {} foobar3 } -body { lsort [registry values HKEY_CURRENT_USER\\TclFoobar] } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {{} baz blat} test registry-7.4 {GetValueNames: remote key} -constraints {win reg nonPortable english} -body { set hostname [info hostname] registry set \\\\$hostname\\HKEY_CURRENT_USER\\TclFoobar baz blat set result [registry values \\\\$hostname\\HKEY_CURRENT_USER\\TclFoobar] registry delete \\\\$hostname\\HKEY_CURRENT_USER\\TclFoobar set result } -result baz test registry-7.5 {GetValueNames: empty key} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar } -body { registry values HKEY_CURRENT_USER\\TclFoobar } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {} test registry-7.6 {GetValueNames: patterns} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar baz foobar1 registry set HKEY_CURRENT_USER\\TclFoobar blat foobar2 registry set HKEY_CURRENT_USER\\TclFoobar foo foobar3 } -body { lsort [registry values HKEY_CURRENT_USER\\TclFoobar b*] } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {baz blat} test registry-7.7 {GetValueNames: names with spaces} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar baz\ bar foobar1 registry set HKEY_CURRENT_USER\\TclFoobar blat foobar2 registry set HKEY_CURRENT_USER\\TclFoobar foo foobar3 } -body { lsort [registry values HKEY_CURRENT_USER\\TclFoobar b*] } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {{baz bar} blat} test registry-8.1 {OpenSubKey} -constraints {win reg nonPortable english} \ -body { # This test will only succeed if the current user does not have # registry access on the specified machine. registry keys {\\mom\HKEY_LOCAL_MACHINE} } -returnCodes error -result "unable to open key: Access is denied." test registry-8.2 {OpenSubKey} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar } -body { registry keys HKEY_CURRENT_USER TclFoobar } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {TclFoobar} test registry-8.3 {OpenSubKey} -constraints {win reg english} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar } -body { registry keys HKEY_CURRENT_USER\\TclFoobar } -returnCodes error \ -result "unable to open key: The system cannot find the file specified." test registry-9.1 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values \\ } -returnCodes error -result "bad key \"\\\": must start with a valid root" test registry-9.2 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values \\foobar } -returnCodes error -result {bad key "\foobar": must start with a valid root} test registry-9.3 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values \\\\ } -returnCodes error -result {bad root name "": must be HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA} test registry-9.4 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values \\\\\\ } -returnCodes error -result {bad root name "": must be HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA} test registry-9.5 {ParseKeyName: bad keys} -constraints {win reg english} -body { registry values \\\\\\HKEY_CLASSES_ROOT } -returnCodes error -result {unable to open key: The network address is invalid.} test registry-9.6 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values \\\\gaspode } -returnCodes error -result {bad root name "": must be HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA} test registry-9.7 {ParseKeyName: bad keys} -constraints {win reg} -body { registry values foobar } -returnCodes error -result {bad root name "foobar": must be HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG, HKEY_PERFORMANCE_DATA, or HKEY_DYN_DATA} test registry-9.8 {ParseKeyName: null keys} -constraints {win reg} -body { registry delete HKEY_CLASSES_ROOT\\ } -returnCodes error -result {bad key: cannot delete root keys} test registry-9.9 {ParseKeyName: null keys} \ -constraints {win reg english} \ -body {registry keys HKEY_CLASSES_ROOT\\TclFoobar\\baz} \ -returnCodes error \ -result {unable to open key: The system cannot find the file specified.} test registry-10.1 {RecursiveDeleteKey} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar } -body { registry set HKEY_CURRENT_USER\\TclFoobar\\test1 registry set HKEY_CURRENT_USER\\TclFoobar\\test2\\test3 registry delete HKEY_CURRENT_USER\\TclFoobar set result [registry keys HKEY_CURRENT_USER TclFoobar] set result } -result {} test registry-10.2 {RecursiveDeleteKey} -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar registry set HKEY_CURRENT_USER\\TclFoobar\\test1 registry set HKEY_CURRENT_USER\\TclFoobar\\test2\\test3 } -body { registry delete HKEY_CURRENT_USER\\TclFoobar\\test2\\test4 } -cleanup { registry delete HKEY_CURRENT_USER\\TclFoobar } -result {} test registry-11.1 {SetValue: recursive creation} \ -constraints {win reg} -setup { registry delete HKEY_CURRENT_USER\\TclFoobar } -body { registry set HKEY_CURRENT_USER\\TclFoobar\\baz blat foobar set result [registry get HKEY_CURRENT_USER\\TclFoobar\\baz blat] } -result {foobar} test registry-11.2 {SetValue: modification} -constraints {win reg} \ -setup { registry delete HKEY_CURRENT_USER\\TclFoobar } -body { registry set HKEY_CURRENT_USER\\TclFoobar\\baz blat foobar registry set HKEY_CURRENT_USER\\TclFoobar\\baz blat frob set result [registry get HKEY_CURRENT_USER\\TclFoobar\\baz blat] } -result {frob} test registry-11.3 {SetValue: failure} \ -constraints {win reg nonPortable english} \ -body { # This test will only succeed if the current user does not have # registry access on the specified machine. registry set {\\mom\HKEY_CURRENT_USER\TclFoobar} bar foobar } -returnCodes error -result {unable to open key: Access is denied.} test registry-12.1 {BroadcastValue} -constraints {win reg} -body { registry broadcast } -returnCodes error -result "wrong # args: should be \"registry broadcast keyName ?-timeout milliseconds?\"" test registry-12.2 {BroadcastValue} -constraints {win reg} -body { registry broadcast "" -time } -returnCodes error -result "wrong # args: should be \"registry broadcast keyName ?-timeout milliseconds?\"" test registry-12.3 {BroadcastValue} -constraints {win reg} -body { registry broadcast "" - 500 } -returnCodes error -result "wrong # args: should be \"registry broadcast keyName ?-timeout milliseconds?\"" test registry-12.4 {BroadcastValue} -constraints {win reg notWine} -body { registry broadcast {Environment} } -result {1 0} test registry-12.5 {BroadcastValue} -constraints {win reg notWine} -body { registry b {} } -result {1 0} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # tcl-indent-level: 4 # fill-column: 78 # End: tcl9.0.3/tests/regexpComp.test0000644000175000017500000006517715104661341015743 0ustar sergeisergei# Commands covered: regexp, regsub # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Procedure to evaluate a script within a proc, to test compilation # functionality proc evalInProc { script } { proc testProc {} $script set status [catch { testProc } result] rename testProc {} return $result #return [list $status $result] } unset -nocomplain foo test regexpComp-1.1 {basic regexp operation} { evalInProc { regexp ab*c abbbc } } 1 test regexpComp-1.2 {basic regexp operation} { evalInProc { regexp ab*c ac } } 1 test regexpComp-1.3 {basic regexp operation} { evalInProc { regexp ab*c ab } } 0 test regexpComp-1.4 {basic regexp operation} { evalInProc { regexp -- -gorp abc-gorpxxx } } 1 test regexpComp-1.5 {basic regexp operation} { evalInProc { regexp {^([^ ]*)[ ]*([^ ]*)} "" a } } 1 test regexpComp-1.6 {basic regexp operation} { list [catch {regexp {} abc} msg] $msg } {0 1} test regexpComp-1.7 {regexp utf compliance} { # if not UTF-8 aware, result is "0 1" evalInProc { set foo "乎b q" regexp "乎b q" "a乎b qw幎N wq" bar list [string compare $foo $bar] [regexp 4 $bar] } } {0 0} test regexpComp-1.8 {regexp ***= metasyntax} { evalInProc { regexp -- "***=o" "aeiou" } } 1 test regexpComp-1.9 {regexp ***= metasyntax} { evalInProc { set string "aeiou" regexp -- "***=o" $string } } 1 test regexpComp-1.10 {regexp ***= metasyntax} { evalInProc { set string "aeiou" set re "***=o" regexp -- $re $string } } 1 test regexpComp-1.11 {regexp ***= metasyntax} { evalInProc { regexp -- "***=y" "aeiou" } } 0 test regexpComp-1.12 {regexp ***= metasyntax} { evalInProc { set string "aeiou" regexp -- "***=y" $string } } 0 test regexpComp-1.13 {regexp ***= metasyntax} { evalInProc { set string "aeiou" set re "***=y" regexp -- $re $string } } 0 test regexpComp-1.14 {regexp ***= metasyntax} { evalInProc { set string "aeiou" set re "***=e*o" regexp -- $re $string } } 0 test regexpComp-1.15 {regexp ***= metasyntax} { evalInProc { set string "ae*ou" set re "***=e*o" regexp -- $re $string } } 1 test regexpComp-1.16 {regexp ***= metasyntax} { evalInProc { set string {ae*[o]?ua} set re {***=e*[o]?u} regexp -- $re $string } } 1 test regexpComp-2.1 {getting substrings back from regexp} { evalInProc { set foo {} list [regexp ab*c abbbbc foo] $foo } } {1 abbbbc} test regexpComp-2.2 {getting substrings back from regexp} { evalInProc { set foo {} set f2 {} list [regexp a(b*)c abbbbc foo f2] $foo $f2 } } {1 abbbbc bbbb} test regexpComp-2.3 {getting substrings back from regexp} { evalInProc { set foo {} set f2 {} list [regexp a(b*)(c) abbbbc foo f2] $foo $f2 } } {1 abbbbc bbbb} test regexpComp-2.4 {getting substrings back from regexp} { evalInProc { set foo {} set f2 {} set f3 {} list [regexp a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3 } } {1 abbbbc bbbb c} test regexpComp-2.5 {getting substrings back from regexp} { evalInProc { set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {}; set f6 {}; set f7 {}; set f8 {}; set f9 {}; set fa {}; set fb {}; list [regexp (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*)(a*)(b*) \ 12223345556789999aabbb \ foo f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb] $foo $f1 $f2 $f3 $f4 $f5 \ $f6 $f7 $f8 $f9 $fa $fb } } {1 12223345556789999aabbb 1 222 33 4 555 6 7 8 9999 aa bbb} test regexpComp-2.6 {getting substrings back from regexp} { evalInProc { set foo 2; set f2 2; set f3 2; set f4 2 list [regexp (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4 } } {1 a a {} {}} test regexpComp-2.7 {getting substrings back from regexp} { evalInProc { set foo 1; set f2 1; set f3 1; set f4 1 list [regexp (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4 } } {1 ac a {} c} test regexpComp-2.8 {getting substrings back from regexp} { evalInProc { set match {} list [regexp {^a*b} aaaab match] $match } } {1 aaaab} test regexpComp-3.1 {-indices option to regexp} { evalInProc { set foo {} list [regexp -indices ab*c abbbbc foo] $foo } } {1 {0 5}} test regexpComp-3.2 {-indices option to regexp} { evalInProc { set foo {} set f2 {} list [regexp -indices a(b*)c abbbbc foo f2] $foo $f2 } } {1 {0 5} {1 4}} test regexpComp-3.3 {-indices option to regexp} { evalInProc { set foo {} set f2 {} list [regexp -indices a(b*)(c) abbbbc foo f2] $foo $f2 } } {1 {0 5} {1 4}} test regexpComp-3.4 {-indices option to regexp} { evalInProc { set foo {} set f2 {} set f3 {} list [regexp -indices a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3 } } {1 {0 5} {1 4} {5 5}} test regexpComp-3.5 {-indices option to regexp} { evalInProc { set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {}; set f6 {}; set f7 {}; set f8 {}; set f9 {} list [regexp -indices (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*) \ 12223345556789999 \ foo f1 f2 f3 f4 f5 f6 f7 f8 f9] $foo $f1 $f2 $f3 $f4 $f5 \ $f6 $f7 $f8 $f9 } } {1 {0 16} {0 0} {1 3} {4 5} {6 6} {7 9} {10 10} {11 11} {12 12} {13 16}} test regexpComp-3.6 {getting substrings back from regexp} { evalInProc { set foo 2; set f2 2; set f3 2; set f4 2 list [regexp -indices (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4 } } {1 {1 1} {1 1} {-1 -1} {-1 -1}} test regexpComp-3.7 {getting substrings back from regexp} { evalInProc { set foo 1; set f2 1; set f3 1; set f4 1 list [regexp -indices (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4 } } {1 {1 2} {1 1} {-1 -1} {2 2}} test regexpComp-4.1 {-nocase option to regexp} { evalInProc { regexp -nocase foo abcFOo } } 1 test regexpComp-4.2 {-nocase option to regexp} { evalInProc { set f1 22 set f2 33 set f3 44 list [regexp -nocase {a(b*)([xy]*)z} aBbbxYXxxZ22 f1 f2 f3] $f1 $f2 $f3 } } {1 aBbbxYXxxZ Bbb xYXxx} test regexpComp-4.3 {-nocase option to regexp} { evalInProc { regexp -nocase FOo abcFOo } } 1 set ::x abcdefghijklmnopqrstuvwxyz1234567890 set ::x $x$x$x$x$x$x$x$x$x$x$x$x test regexpComp-4.4 {case conversion in regexp} { evalInProc { list [regexp -nocase $::x $::x foo] $foo } } "1 $x" unset -nocomplain ::x test regexpComp-5.1 {exercise cache of compiled expressions} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*a bbba } } 1 test regexpComp-5.2 {exercise cache of compiled expressions} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*b xxxb } } 1 test regexpComp-5.3 {exercise cache of compiled expressions} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*c yyyc } } 1 test regexpComp-5.4 {exercise cache of compiled expressions} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*d 1d } } 1 test regexpComp-5.5 {exercise cache of compiled expressions} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*e xe } } 1 test regexpComp-6.1 {regexp errors} { evalInProc { list [catch {regexp a} msg] $msg } } {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}} test regexpComp-6.2 {regexp errors} { evalInProc { list [catch {regexp -nocase a} msg] $msg } } {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}} test regexpComp-6.3 {regexp errors} { evalInProc { list [catch {regexp -gorp a} msg] $msg } } {1 {bad option "-gorp": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}} test regexpComp-6.4 {regexp errors} { evalInProc { list [catch {regexp a( b} msg] $msg } } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexpComp-6.5 {regexp errors} { evalInProc { list [catch {regexp a( b} msg] $msg } } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexpComp-6.6 {regexp errors} { evalInProc { list [catch {regexp a a f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1} msg] $msg } } {0 1} test regexpComp-6.7 {regexp errors} { evalInProc { list [catch {regexp (x)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) xyzzy} msg] $msg } } {0 0} test regexpComp-6.8 {regexp errors} { evalInProc { unset -nocomplain f1 set f1 44 list [catch {regexp abc abc f1(f2)} msg] $msg } } {1 {can't set "f1(f2)": variable isn't array}} test regexpComp-6.9 {regexp errors, -start bad int check} { evalInProc { list [catch {regexp -start bogus {^$} {}} msg] $msg } } {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}} test regexpComp-7.1 {basic regsub operation} { evalInProc { list [regsub aa+ xaxaaaxaa 111&222 foo] $foo } } {1 xax111aaa222xaa} test regexpComp-7.2 {basic regsub operation} { evalInProc { list [regsub aa+ aaaxaa &111 foo] $foo } } {1 aaa111xaa} test regexpComp-7.3 {basic regsub operation} { evalInProc { list [regsub aa+ xaxaaa 111& foo] $foo } } {1 xax111aaa} test regexpComp-7.4 {basic regsub operation} { evalInProc { list [regsub aa+ aaa 11&2&333 foo] $foo } } {1 11aaa2aaa333} test regexpComp-7.5 {basic regsub operation} { evalInProc { list [regsub aa+ xaxaaaxaa &2&333 foo] $foo } } {1 xaxaaa2aaa333xaa} test regexpComp-7.6 {basic regsub operation} { evalInProc { list [regsub aa+ xaxaaaxaa 1&22& foo] $foo } } {1 xax1aaa22aaaxaa} test regexpComp-7.7 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {1\122\1} foo] $foo } } {1 xax1aa22aaxaa} test regexpComp-7.8 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {1\\\122\1} foo] $foo } } "1 {xax1\\aa22aaxaa}" test regexpComp-7.9 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {1\\122\1} foo] $foo } } "1 {xax1\\122aaxaa}" test regexpComp-7.10 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {1\\&\1} foo] $foo } } "1 {xax1\\aaaaaxaa}" test regexpComp-7.11 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {1\&\1} foo] $foo } } {1 xax1&aaxaa} test regexpComp-7.12 {basic regsub operation} { evalInProc { list [regsub a(a+) xaxaaaxaa {\1\1\1\1&&} foo] $foo } } {1 xaxaaaaaaaaaaaaaaxaa} test regexpComp-7.13 {basic regsub operation} { evalInProc { set foo xxx list [regsub abc xyz 111 foo] $foo } } {0 xyz} test regexpComp-7.14 {basic regsub operation} { evalInProc { set foo xxx list [regsub ^ xyz "111 " foo] $foo } } {1 {111 xyz}} test regexpComp-7.15 {basic regsub operation} { evalInProc { set foo xxx list [regsub -- -foo abc-foodef "111 " foo] $foo } } {1 {abc111 def}} test regexpComp-7.16 {basic regsub operation} { evalInProc { set foo xxx list [regsub x "" y foo] $foo } } {0 {}} test regexpComp-7.17 {regsub utf compliance} { evalInProc { # if not UTF-8 aware, result is "0 1" set foo "xyz555ijka乎bpqr" regsub a乎b xyza乎bijka乎bpqr 555 bar list [string compare $foo $bar] [regexp 4 $bar] } } {0 0} test regexpComp-8.1 {case conversion in regsub} { evalInProc { list [regsub -nocase a(a+) xaAAaAAay & foo] $foo } } {1 xaAAaAAay} test regexpComp-8.2 {case conversion in regsub} { evalInProc { list [regsub -nocase a(a+) xaAAaAAay & foo] $foo } } {1 xaAAaAAay} test regexpComp-8.3 {case conversion in regsub} { evalInProc { set foo 123 list [regsub a(a+) xaAAaAAay & foo] $foo } } {0 xaAAaAAay} test regexpComp-8.4 {case conversion in regsub} { evalInProc { set foo 123 list [regsub -nocase a CaDE b foo] $foo } } {1 CbDE} test regexpComp-8.5 {case conversion in regsub} { evalInProc { set foo 123 list [regsub -nocase XYZ CxYzD b foo] $foo } } {1 CbD} test regexpComp-8.6 {case conversion in regsub} { evalInProc { set x abcdefghijklmnopqrstuvwxyz1234567890 set x $x$x$x$x$x$x$x$x$x$x$x$x set foo 123 list [regsub -nocase $x $x b foo] $foo } } {1 b} test regexpComp-9.1 {-all option to regsub} { evalInProc { set foo 86 list [regsub -all x+ axxxbxxcxdx |&| foo] $foo } } {4 a|xxx|b|xx|c|x|d|x|} test regexpComp-9.2 {-all option to regsub} { evalInProc { set foo 86 list [regsub -nocase -all x+ aXxXbxxcXdx |&| foo] $foo } } {4 a|XxX|b|xx|c|X|d|x|} test regexpComp-9.3 {-all option to regsub} { evalInProc { set foo 86 list [regsub x+ axxxbxxcxdx |&| foo] $foo } } {1 a|xxx|bxxcxdx} test regexpComp-9.4 {-all option to regsub} { evalInProc { set foo 86 list [regsub -all bc axxxbxxcxdx |&| foo] $foo } } {0 axxxbxxcxdx} test regexpComp-9.5 {-all option to regsub} { evalInProc { set foo xxx list [regsub -all node "node node more" yy foo] $foo } } {2 {yy yy more}} test regexpComp-9.6 {-all option to regsub} { evalInProc { set foo xxx list [regsub -all ^ xxx 123 foo] $foo } } {1 123xxx} test regexpComp-9.7 {Bug 84af1192f5: -all option to regsub} { evalInProc { regsub -all {\(.*} 123(qwe) "" } } 123 test regexpComp-10.1 {expanded syntax in regsub} { evalInProc { set foo xxx list [regsub -expanded ". \#comment\n . \#comment2" abc def foo] $foo } } {1 defc} test regexpComp-10.2 {newline sensitivity in regsub} { evalInProc { set foo xxx list [regsub -line {^a.*b$} "dabc\naxyb\n" 123 foo] $foo } } "1 {dabc\n123\n}" test regexpComp-10.3 {newline sensitivity in regsub} { evalInProc { set foo xxx list [regsub -line {^a.*b$} "dabc\naxyb\nxb" 123 foo] $foo } } "1 {dabc\n123\nxb}" test regexpComp-10.4 {partial newline sensitivity in regsub} { evalInProc { set foo xxx list [regsub -lineanchor {^a.*b$} "da\naxyb\nxb" 123 foo] $foo } } "1 {da\n123}" test regexpComp-10.5 {inverse partial newline sensitivity in regsub} { evalInProc { set foo xxx list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo } } "1 {da\nb123\nxb}" test regexpComp-11.1 {regsub errors} { evalInProc { list [catch {regsub a b} msg] $msg } } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexpComp-11.2 {regsub errors} { evalInProc { list [catch {regsub -nocase a b} msg] $msg } } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexpComp-11.3 {regsub errors} { evalInProc { list [catch {regsub -nocase -all a b} msg] $msg } } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexpComp-11.4 {regsub errors} { evalInProc { list [catch {regsub a b c d e f} msg] $msg } } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexpComp-11.5 {regsub errors} { evalInProc { list [catch {regsub -gorp a b c} msg] $msg } } {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}} test regexpComp-11.6 {regsub errors} { evalInProc { list [catch {regsub -nocase a( b c d} msg] $msg } } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexpComp-11.7 {regsub errors} { evalInProc { unset -nocomplain f1 set f1 44 list [catch {regsub -nocase aaa aaa xxx f1(f2)} msg] $msg } } {1 {can't set "f1(f2)": variable isn't array}} test regexpComp-11.8 {regsub errors, -start bad int check} { evalInProc { list [catch {regsub -start bogus pattern string rep var} msg] $msg } } {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}} # This test crashes on the Mac unless you increase the Stack Space to about 1 # Meg. This is probably bigger than most users want... # 8.2.3 regexp reduced stack space requirements, but this should be # tested again test regexpComp-12.1 {Tcl_RegExpExec: large number of subexpressions} {macCrash} { evalInProc { list [regexp (.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) abcdefghijklmnopqrstuvwxyz all a b c d e f g h i j k l m n o p q r s t u v w x y z] $all $a $b $c $d $e $f $g $h $i $j $k $l $m $n $o $p $q $r $s $t $u $v $w $x $y $z } } {1 abcdefghijklmnopqrstuvwxyz a b c d e f g h i j k l m n o p q r s t u v w x y z} test regexpComp-13.1 {regsub of a very large string} { # This test is designed to stress the memory subsystem in order # to catch Bug #933. It only fails if the Tcl memory allocator # is in use. set line {BEGIN_TABLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END_TABLE} set filedata [string repeat $line 200] for {set i 1} {$i<10} {incr i} { regsub -all "BEGIN_TABLE " $filedata "" newfiledata } set x done } {done} test regexpComp-14.1 {CompileRegexp: regexp cache} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f set x . append x *a regexp $x bbba } } 1 test regexpComp-14.2 {CompileRegexp: regexp cache, different flags} { evalInProc { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f set x . append x *a regexp -nocase $x bbba } } 1 testConstraint exec [llength [info commands exec]] test regexpComp-14.3 {CompileRegexp: regexp cache, empty regexp and empty cache} -constraints { exec } -setup { set junk [makeFile {puts [regexp {} foo]} junk.tcl] } -body { exec [interpreter] $junk } -cleanup { removeFile junk.tcl } -result 1 test regexpComp-15.1 {regexp -start} -body { unset -nocomplain x list [regexp -start -10 {\d} 1abc2de3 x] $x } -result {1 1} test regexpComp-15.2 {regexp -start} -body { unset -nocomplain x list [regexp -start 2 {\d} 1abc2de3 x] $x } -result {1 2} test regexpComp-15.3 {regexp -start} -body { unset -nocomplain x list [regexp -start 4 {\d} 1abc2de3 x] $x } -result {1 2} test regexpComp-15.4 {regexp -start} -body { unset -nocomplain x list [regexp -start 5 {\d} 1abc2de3 x] $x } -result {1 3} test regexpComp-15.5 {regexp -start, over end of string} -body { unset -nocomplain x list [regexp -start [string length 1abc2de3] {\d} 1abc2de3 x] [info exists x] } -result {0 0} test regexpComp-15.6 {regexp -start, loss of ^$ behavior} -body { list [regexp -start 2 {^$} {}] } -result {0} test regexpComp-16.1 {regsub -start} -body { unset -nocomplain x list [regsub -all -start 2 {\d} a1b2c3d4e5 {/&} x] $x } -result {4 a1b/2c/3d/4e/5} test regexpComp-16.2 {regsub -start} -body { unset -nocomplain x list [regsub -all -start -25 {z} hello {/&} x] $x } -result {0 hello} test regexpComp-16.3 {regsub -start} -body { unset -nocomplain x list [regsub -all -start 3 {z} hello {/&} x] $x } -result {0 hello} test regexpComp-16.4 {regsub -start, \A behavior} -body { set out {} lappend out [regsub -start 0 -all {\A(\w)} {abcde} {/\1} x] $x lappend out [regsub -start 2 -all {\A(\w)} {abcde} {/\1} x] $x } -result {5 /a/b/c/d/e 3 ab/c/d/e} test regexpComp-17.1 {regexp -inline} -body { regexp -inline b ababa } -result {b} test regexpComp-17.2 {regexp -inline} -body { regexp -inline (b) ababa } -result {b b} test regexpComp-17.3 {regexp -inline -indices} { regexp -inline -indices (b) ababa } {{1 1} {1 1}} test regexpComp-17.4 {regexp -inline} { regexp -inline {\w(\d+)\w} " hello 23 there456def " } {e456d 456} test regexpComp-17.5 {regexp -inline no matches} { regexp -inline {\w(\d+)\w} "" } {} test regexpComp-17.6 {regexp -inline no matches} { regexp -inline hello goodbye } {} test regexpComp-17.7 {regexp -inline, no matchvars allowed} { list [catch {regexp -inline b abc match} msg] $msg } {1 {regexp match variables not allowed when using -inline}} test regexpComp-18.1 {regexp -all} { regexp -all b bbbbb } {5} test regexpComp-18.2 {regexp -all} { regexp -all b abababbabaaaaaaaaaab } {6} test regexpComp-18.3 {regexp -all -inline} { regexp -all -inline b abababbabaaaaaaaaaab } {b b b b b b} test regexpComp-18.4 {regexp -all -inline} { regexp -all -inline {\w(\w)} abcdefg } {ab b cd d ef f} test regexpComp-18.5 {regexp -all -inline} { regexp -all -inline {\w(\w)$} abcdefg } {fg g} test regexpComp-18.6 {regexp -all -inline} { regexp -all -inline {\d+} 10:20:30:40 } {10 20 30 40} test regexpComp-18.7 {regexp -all -inline} { list [catch {regexp -all -inline b abc match} msg] $msg } {1 {regexp match variables not allowed when using -inline}} test regexpComp-18.8 {regexp -all} { # This should not cause an infinite loop regexp -all -inline {a*} a } {a} test regexpComp-18.9 {regexp -all} { # Yes, the expected result is {a {}}. Here's why: # Start at index 0; a* matches the "a" there then stops. # Go to index 1; a* matches the lambda (or {}) there then stops. Recall # that a* matches zero or more "a"'s; thus it matches the string "b", as # there are zero or more "a"'s there. # Go to index 2; this is past the end of the string, so stop. regexp -all -inline {a*} ab } {a {}} test regexpComp-18.10 {regexp -all} { # Yes, the expected result is {a {} a}. Here's why: # Start at index 0; a* matches the "a" there then stops. # Go to index 1; a* matches the lambda (or {}) there then stops. Recall # that a* matches zero or more "a"'s; thus it matches the string "b", as # there are zero or more "a"'s there. # Go to index 2; a* matches the "a" there then stops. # Go to index 3; this is past the end of the string, so stop. regexp -all -inline {a*} aba } {a {} a} test regexpComp-18.11 {regexp -all} { evalInProc { regexp -all -inline {^a} aaaa } } {a} test regexpComp-18.12 {regexp -all -inline -indices} { evalInProc { regexp -all -inline -indices a(b(c)d|e(f)g)h abcdhaefgh } } {{0 4} {1 3} {2 2} {-1 -1} {5 9} {6 8} {-1 -1} {7 7}} test regexpComp-19.1 {regsub null replacement} { evalInProc { regsub -all {@} {@hel@lo@} "\0a\0" result list $result [string length $result] } } "\0a\0hel\0a\0lo\0a\0 14" test regexpComp-20.1 {regsub shared object shimmering} { evalInProc { # Bug #461322 set a abcdefghijklmnopqurstuvwxyz set b $a set c abcdefghijklmnopqurstuvwxyz0123456789 regsub $a $c $b d list $d [string length $d] } } [list abcdefghijklmnopqurstuvwxyz0123456789 37] test regexpComp-20.2 {regsub shared object shimmering with -about} { evalInProc { eval regexp -about abc } } {0 {}} test regexpComp-21.1 {regexp command compiling tests} { evalInProc { regexp foo bar } } 0 test regexpComp-21.2 {regexp command compiling tests} { evalInProc { regexp {^foo$} dogfood } } 0 test regexpComp-21.3 {regexp command compiling tests} { evalInProc { set a foo regexp {^foo$} $a } } 1 test regexpComp-21.4 {regexp command compiling tests} { evalInProc { regexp foo dogfood } } 1 test regexpComp-21.5 {regexp command compiling tests} { evalInProc { regexp -nocase FOO dogfod } } 0 test regexpComp-21.6 {regexp command compiling tests} { evalInProc { regexp -n foo dogfoOd } } 1 test regexpComp-21.7 {regexp command compiling tests} { evalInProc { regexp -no -- FoO dogfood } } 1 test regexpComp-21.8 {regexp command compiling tests} { evalInProc { regexp -- foo dogfod } } 0 test regexpComp-21.9 {regexp command compiling tests} { evalInProc { list [catch {regexp -- -nocase foo dogfod} msg] $msg } } {0 0} test regexpComp-21.10 {regexp command compiling tests} { evalInProc { list [regsub -all "" foo bar str] $str } } {3 barfbarobaro} test regexpComp-21.11 {regexp command compiling tests} { evalInProc { list [regsub -all "" "" bar str] $str } } {0 {}} test regexpComp-22.0.1 {Bug 1810038} { evalInProc { regexp ($|^X)* {} } } 1 test regexpComp-22.0.2 {regexp compile and backrefs, Bug 1857126} { evalInProc { regexp -- {([bc])\1} bb } } 1 set i 0 foreach {str exp result} { foo ^foo 1 foobar ^foobar$ 1 foobar bar$ 1 foobar ^$ 0 "" ^$ 1 anything $ 1 anything ^.*$ 1 anything ^.*a$ 0 anything ^.*a.*$ 1 anything ^.*.*$ 1 anything ^.*..*$ 1 anything ^.*b$ 0 anything ^a.*$ 1 } { test regexpComp-22.[incr i] {regexp command compiling tests} \ [subst {evalInProc {set a "$str"; regexp {$exp} \$a}}] $result } set i 0 foreach {str exp result} { foo ^foo 1 foobar ^foobar$ 1 foobar bar$ 1 foobar ^$ 0 "" ^$ 1 anything $ 1 anything ^.*$ 1 anything ^.*a$ 0 anything ^.*a.*$ 1 anything ^.*.*$ 1 anything ^.*..*$ 1 anything ^.*b$ 0 anything ^a.*$ 1 } { test regexpComp-23.[incr i] {regexp command compiling tests INST_REGEXP} \ [subst {evalInProc {set a "$str"; set re "$exp"; regexp \$re \$a}}] $result } test regexpComp-24.1 {regexp command compiling tests} { evalInProc { set re foo regexp -nocase $re bar } } 0 test regexpComp-24.2 {regexp command compiling tests} { evalInProc { set re {^foo$} regexp $re dogfood } } 0 test regexpComp-24.3 {regexp command compiling tests} { evalInProc { set a foo set re {^foo$} regexp $re $a } } 1 test regexpComp-24.4 {regexp command compiling tests} { evalInProc { set re foo regexp $re dogfood } } 1 test regexpComp-24.5 {regexp command compiling tests} { evalInProc { set re FOO regexp -nocase $re dogfod } } 0 test regexpComp-24.6 {regexp command compiling tests} { evalInProc { set re foo regexp -n $re dogfoOd } } 1 test regexpComp-24.7 {regexp command compiling tests} { evalInProc { set re FoO regexp -no -- $re dogfood } } 1 test regexpComp-24.8 {regexp command compiling tests} { evalInProc { set re foo regexp -- $re dogfod } } 0 test regexpComp-24.9 {regexp command compiling tests} { evalInProc { set re "(" list [catch {regexp -- $re dogfod} msg] $msg } } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexpComp-24.10 {regexp command compiling tests} { # Bug 1902436 - last * escaped evalInProc { set text {this is *bold* !} set re {\*bold\*} regexp -- $re $text } } 1 test regexpComp-24.11 {regexp command compiling tests} { # Bug 1902436 - last * escaped evalInProc { set text {this is *bold* !} set re {\*bold\*.*!} regexp -- $re $text } } 1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/regexp.test0000644000175000017500000012557215104661426015124 0ustar sergeisergei# Commands covered: regexp, regsub # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain foo source [file join [file dirname [info script]] tcltests.tcl] testConstraint exec [llength [info commands exec]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc memtest script { set end [lindex [split [memory info] \n] 3 3] for {set i 0} {$i < 5} {incr i} { uplevel 1 $script set tmp $end set end [lindex [split [memory info] \n] 3 3] } expr {$end - $tmp} } } test regexp-1.1 {basic regexp operation} { regexp ab*c abbbc } 1 test regexp-1.2 {basic regexp operation} { regexp ab*c ac } 1 test regexp-1.3 {basic regexp operation} { regexp ab*c ab } 0 test regexp-1.4 {basic regexp operation} { regexp -- -gorp abc-gorpxxx } 1 test regexp-1.5 {basic regexp operation} { regexp {^([^ ]*)[ ]*([^ ]*)} "" a } 1 test regexp-1.6 {basic regexp operation} { list [catch {regexp {} abc} msg] $msg } {0 1} test regexp-1.7 {regexp utf compliance} { # if not UTF-8 aware, result is "0 1" set foo "乎b q" regexp "乎b q" "a乎b qw幎N wq" bar list [string compare $foo $bar] [regexp 4 $bar] } {0 0} test regexp-1.8 {regexp ***= metasyntax} { regexp -- "***=o" "aeiou" } 1 test regexp-1.9 {regexp ***= metasyntax} { set string "aeiou" regexp -- "***=o" $string } 1 test regexp-1.10 {regexp ***= metasyntax} { set string "aeiou" set re "***=o" regexp -- $re $string } 1 test regexp-1.11 {regexp ***= metasyntax} { regexp -- "***=y" "aeiou" } 0 test regexp-1.12 {regexp ***= metasyntax} { set string "aeiou" regexp -- "***=y" $string } 0 test regexp-1.13 {regexp ***= metasyntax} { set string "aeiou" set re "***=y" regexp -- $re $string } 0 test regexp-2.1 {getting substrings back from regexp} { set foo {} list [regexp ab*c abbbbc foo] $foo } {1 abbbbc} test regexp-2.2 {getting substrings back from regexp} { set foo {} set f2 {} list [regexp a(b*)c abbbbc foo f2] $foo $f2 } {1 abbbbc bbbb} test regexp-2.3 {getting substrings back from regexp} { set foo {} set f2 {} list [regexp a(b*)(c) abbbbc foo f2] $foo $f2 } {1 abbbbc bbbb} test regexp-2.4 {getting substrings back from regexp} { set foo {} set f2 {} set f3 {} list [regexp a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3 } {1 abbbbc bbbb c} test regexp-2.5 {getting substrings back from regexp} { set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {}; set f6 {}; set f7 {}; set f8 {}; set f9 {}; set fa {}; set fb {}; list [regexp (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*)(a*)(b*) \ 12223345556789999aabbb \ foo f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb] $foo $f1 $f2 $f3 $f4 $f5 \ $f6 $f7 $f8 $f9 $fa $fb } {1 12223345556789999aabbb 1 222 33 4 555 6 7 8 9999 aa bbb} test regexp-2.6 {getting substrings back from regexp} { set foo 2; set f2 2; set f3 2; set f4 2 list [regexp (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4 } {1 a a {} {}} test regexp-2.7 {getting substrings back from regexp} { set foo 1; set f2 1; set f3 1; set f4 1 list [regexp (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4 } {1 ac a {} c} test regexp-2.8 {getting substrings back from regexp} { set match {} list [regexp {^a*b} aaaab match] $match } {1 aaaab} test regexp-2.9 {getting substrings back from regexp} { set foo {} set f2 {} list [regexp f\352te(b*)c f\352tebbbbc foo f2] $foo $f2 } [list 1 f\352tebbbbc bbbb] test regexp-2.10 {getting substrings back from regexp} { set foo {} set f2 {} list [regexp f\352te(b*)c eff\352tebbbbc foo f2] $foo $f2 } [list 1 f\352tebbbbc bbbb] test regexp-2.11 {non-capturing subgroup} { set foo {} set f2 {} list [regexp {str(?:a+)} straa foo f2] $foo $f2 } [list 1 straa {}] test regexp-2.12 {non-capturing subgroup with -inline} { regexp -inline {str(?:a+)} straa } {straa} test regexp-2.13 {non-capturing and capturing subgroups} { set foo {} set f2 {} set f3 {} list [regexp {str(?:a+)(c+)} straacc foo f2 f3] $foo $f2 $f3 } [list 1 straacc cc {}] test regexp-2.14 {non-capturing and capturing subgroups} { regexp -inline {str(?:a+)(c+)} straacc } {straacc cc} test regexp-2.15 {getting substrings back from regexp} { set foo NA set f2 NA list [regexp {str(?:a+)} straa foo f2] $foo $f2 } [list 1 straa {}] test regexp-3.1 {-indices option to regexp} { set foo {} list [regexp -indices ab*c abbbbc foo] $foo } {1 {0 5}} test regexp-3.2 {-indices option to regexp} { set foo {} set f2 {} list [regexp -indices a(b*)c abbbbc foo f2] $foo $f2 } {1 {0 5} {1 4}} test regexp-3.3 {-indices option to regexp} { set foo {} set f2 {} list [regexp -indices a(b*)(c) abbbbc foo f2] $foo $f2 } {1 {0 5} {1 4}} test regexp-3.4 {-indices option to regexp} { set foo {} set f2 {} set f3 {} list [regexp -indices a(b*)(c) abbbbc foo f2 f3] $foo $f2 $f3 } {1 {0 5} {1 4} {5 5}} test regexp-3.5 {-indices option to regexp} { set foo {}; set f1 {}; set f2 {}; set f3 {}; set f4 {}; set f5 {}; set f6 {}; set f7 {}; set f8 {}; set f9 {} list [regexp -indices (1*)(2*)(3*)(4*)(5*)(6*)(7*)(8*)(9*) \ 12223345556789999 \ foo f1 f2 f3 f4 f5 f6 f7 f8 f9] $foo $f1 $f2 $f3 $f4 $f5 \ $f6 $f7 $f8 $f9 } {1 {0 16} {0 0} {1 3} {4 5} {6 6} {7 9} {10 10} {11 11} {12 12} {13 16}} test regexp-3.6 {getting substrings back from regexp} { set foo 2; set f2 2; set f3 2; set f4 2 list [regexp -indices (a)(b)? xay foo f2 f3 f4] $foo $f2 $f3 $f4 } {1 {1 1} {1 1} {-1 -1} {-1 -1}} test regexp-3.7 {getting substrings back from regexp} { set foo 1; set f2 1; set f3 1; set f4 1 list [regexp -indices (a)(b)?(c) xacy foo f2 f3 f4] $foo $f2 $f3 $f4 } {1 {1 2} {1 1} {-1 -1} {2 2}} test regexp-3.8a {-indices by multi-byte utf-8} { regexp -inline -indices {(\w+)-(\w+)} \ "grüß-привет" } {{0 10} {0 3} {5 10}} test regexp-3.8b {-indices by multi-byte utf-8, from -start position} { list\ [regexp -inline -indices -start 3 {(\w+)-(\w+)} \ "grüß-привет"] \ [regexp -inline -indices -start 4 {(\w+)-(\w+)} \ "grüß-привет"] } {{{3 10} {3 3} {5 10}} {}} test regexp-4.1 {-nocase option to regexp} { regexp -nocase foo abcFOo } 1 test regexp-4.2 {-nocase option to regexp} { set f1 22 set f2 33 set f3 44 list [regexp -nocase {a(b*)([xy]*)z} aBbbxYXxxZ22 f1 f2 f3] $f1 $f2 $f3 } {1 aBbbxYXxxZ Bbb xYXxx} test regexp-4.3 {-nocase option to regexp} { regexp -nocase FOo abcFOo } 1 set x abcdefghijklmnopqrstuvwxyz1234567890 set x $x$x$x$x$x$x$x$x$x$x$x$x test regexp-4.4 {case conversion in regexp} { list [regexp -nocase $x $x foo] $foo } "1 $x" unset -nocomplain x test regexp-5.1 {exercise cache of compiled expressions} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*a bbba } 1 test regexp-5.2 {exercise cache of compiled expressions} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*b xxxb } 1 test regexp-5.3 {exercise cache of compiled expressions} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*c yyyc } 1 test regexp-5.4 {exercise cache of compiled expressions} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*d 1d } 1 test regexp-5.5 {exercise cache of compiled expressions} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f regexp .*e xe } 1 test regexp-6.1 {regexp errors} { list [catch {regexp a} msg] $msg } {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}} test regexp-6.2 {regexp errors} { list [catch {regexp -nocase a} msg] $msg } {1 {wrong # args: should be "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"}} test regexp-6.3 {regexp errors} { list [catch {regexp -gorp a} msg] $msg } {1 {bad option "-gorp": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}} test regexp-6.4 {regexp errors} { list [catch {regexp a( b} msg] $msg } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexp-6.5 {regexp errors} { list [catch {regexp a( b} msg] $msg } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexp-6.6 {regexp errors} { list [catch {regexp a a f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 f1} msg] $msg } {0 1} test regexp-6.7 {regexp errors} { list [catch {regexp (x)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) xyzzy} msg] $msg } {0 0} test regexp-6.8 {regexp errors} -setup { unset -nocomplain f1 } -body { set f1 44 regexp abc abc f1(f2) } -returnCodes error -result {can't set "f1(f2)": variable isn't array} test regexp-6.9 {regexp errors, -start bad int check} { list [catch {regexp -start bogus {^$} {}} msg] $msg } {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}} test regexp-6.10 {regexp errors} { list [catch {regexp {a[} b} msg] $msg } {1 {cannot compile regular expression pattern: brackets [] not balanced}} test regexp-7.1 {basic regsub operation} { list [regsub aa+ xaxaaaxaa 111&222 foo] $foo } {1 xax111aaa222xaa} test regexp-7.2 {basic regsub operation} { list [regsub aa+ aaaxaa &111 foo] $foo } {1 aaa111xaa} test regexp-7.3 {basic regsub operation} { list [regsub aa+ xaxaaa 111& foo] $foo } {1 xax111aaa} test regexp-7.4 {basic regsub operation} { list [regsub aa+ aaa 11&2&333 foo] $foo } {1 11aaa2aaa333} test regexp-7.5 {basic regsub operation} { list [regsub aa+ xaxaaaxaa &2&333 foo] $foo } {1 xaxaaa2aaa333xaa} test regexp-7.6 {basic regsub operation} { list [regsub aa+ xaxaaaxaa 1&22& foo] $foo } {1 xax1aaa22aaaxaa} test regexp-7.7 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {1\122\1} foo] $foo } {1 xax1aa22aaxaa} test regexp-7.8 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {1\\\122\1} foo] $foo } "1 {xax1\\aa22aaxaa}" test regexp-7.9 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {1\\122\1} foo] $foo } "1 {xax1\\122aaxaa}" test regexp-7.10 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {1\\&\1} foo] $foo } "1 {xax1\\aaaaaxaa}" test regexp-7.11 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {1\&\1} foo] $foo } {1 xax1&aaxaa} test regexp-7.12 {basic regsub operation} { list [regsub a(a+) xaxaaaxaa {\1\1\1\1&&} foo] $foo } {1 xaxaaaaaaaaaaaaaaxaa} test regexp-7.13 {basic regsub operation} { set foo xxx list [regsub abc xyz 111 foo] $foo } {0 xyz} test regexp-7.14 {basic regsub operation} { set foo xxx list [regsub ^ xyz "111 " foo] $foo } {1 {111 xyz}} test regexp-7.15 {basic regsub operation} { set foo xxx list [regsub -- -foo abc-foodef "111 " foo] $foo } {1 {abc111 def}} test regexp-7.16 {basic regsub operation} { set foo xxx list [regsub x "" y foo] $foo } {0 {}} test regexp-7.17 {regsub utf compliance} { # if not UTF-8 aware, result is "0 1" set foo "xyz555ijka乎bpqr" regsub a乎b xyza乎bijka乎bpqr 555 bar list [string compare $foo $bar] [regexp 4 $bar] } {0 0} test regexp-7.18 {basic regsub replacement} { list [regsub a+ aaa {&} foo] $foo } {1 aaa} test regexp-7.19 {basic regsub replacement} { list [regsub a+ aaa {\&} foo] $foo } {1 &} test regexp-7.20 {basic regsub replacement} { list [regsub a+ aaa {\\&} foo] $foo } {1 {\aaa}} test regexp-7.21 {basic regsub replacement} { list [regsub a+ aaa {\\\&} foo] $foo } {1 {\&}} test regexp-7.22 {basic regsub replacement} { list [regsub a+ aaa {\0} foo] $foo } {1 aaa} test regexp-7.23 {basic regsub replacement} { list [regsub a+ aaa {\\0} foo] $foo } {1 {\0}} test regexp-7.24 {basic regsub replacement} { list [regsub a+ aaa {\\\0} foo] $foo } {1 {\aaa}} test regexp-7.25 {basic regsub replacement} { list [regsub a+ aaa {\\\\0} foo] $foo } {1 {\\0}} test regexp-7.26 {dollar zero is not a backslash replacement} { list [regsub a+ aaa {$0} foo] $foo } {1 {$0}} test regexp-7.27 {dollar zero is not a backslash replacement} { list [regsub a+ aaa {\0$0} foo] $foo } {1 {aaa$0}} test regexp-7.28 {dollar zero is not a backslash replacement} { list [regsub a+ aaa {\$0} foo] $foo } {1 {\$0}} test regexp-7.29 {dollar zero is not a backslash replacement} { list [regsub a+ aaa {\\} foo] $foo } {1 \\} test regexp-8.1 {case conversion in regsub} { list [regsub -nocase a(a+) xaAAaAAay & foo] $foo } {1 xaAAaAAay} test regexp-8.2 {case conversion in regsub} { list [regsub -nocase a(a+) xaAAaAAay & foo] $foo } {1 xaAAaAAay} test regexp-8.3 {case conversion in regsub} { set foo 123 list [regsub a(a+) xaAAaAAay & foo] $foo } {0 xaAAaAAay} test regexp-8.4 {case conversion in regsub} { set foo 123 list [regsub -nocase a CaDE b foo] $foo } {1 CbDE} test regexp-8.5 {case conversion in regsub} { set foo 123 list [regsub -nocase XYZ CxYzD b foo] $foo } {1 CbD} test regexp-8.6 {case conversion in regsub} { set x abcdefghijklmnopqrstuvwxyz1234567890 set x $x$x$x$x$x$x$x$x$x$x$x$x set foo 123 list [regsub -nocase $x $x b foo] $foo } {1 b} test regexp-9.1 {-all option to regsub} { set foo 86 list [regsub -all x+ axxxbxxcxdx |&| foo] $foo } {4 a|xxx|b|xx|c|x|d|x|} test regexp-9.2 {-all option to regsub} { set foo 86 list [regsub -nocase -all x+ aXxXbxxcXdx |&| foo] $foo } {4 a|XxX|b|xx|c|X|d|x|} test regexp-9.3 {-all option to regsub} { set foo 86 list [regsub x+ axxxbxxcxdx |&| foo] $foo } {1 a|xxx|bxxcxdx} test regexp-9.4 {-all option to regsub} { set foo 86 list [regsub -all bc axxxbxxcxdx |&| foo] $foo } {0 axxxbxxcxdx} test regexp-9.5 {-all option to regsub} { set foo xxx list [regsub -all node "node node more" yy foo] $foo } {2 {yy yy more}} test regexp-9.6 {-all option to regsub} { set foo xxx list [regsub -all ^ xxx 123 foo] $foo } {1 123xxx} test regexp-10.1 {expanded syntax in regsub} { set foo xxx list [regsub -expanded ". \#comment\n . \#comment2" abc def foo] $foo } {1 defc} test regexp-10.2 {newline sensitivity in regsub} { set foo xxx list [regsub -line {^a.*b$} "dabc\naxyb\n" 123 foo] $foo } "1 {dabc\n123\n}" test regexp-10.3 {newline sensitivity in regsub} { set foo xxx list [regsub -line {^a.*b$} "dabc\naxyb\nxb" 123 foo] $foo } "1 {dabc\n123\nxb}" test regexp-10.4 {partial newline sensitivity in regsub} { set foo xxx list [regsub -lineanchor {^a.*b$} "da\naxyb\nxb" 123 foo] $foo } "1 {da\n123}" test regexp-10.5 {inverse partial newline sensitivity in regsub} { set foo xxx list [regsub -linestop {a.*b} "da\nbaxyb\nxb" 123 foo] $foo } "1 {da\nb123\nxb}" test regexp-11.1 {regsub errors} { list [catch {regsub a b} msg] $msg } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexp-11.2 {regsub errors} { list [catch {regsub -nocase a b} msg] $msg } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexp-11.3 {regsub errors} { list [catch {regsub -nocase -all a b} msg] $msg } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexp-11.4 {regsub errors} { list [catch {regsub a b c d e f} msg] $msg } {1 {wrong # args: should be "regsub ?-option ...? exp string subSpec ?varName?"}} test regexp-11.5 {regsub errors} { list [catch {regsub -gorp a b c} msg] $msg } {1 {bad option "-gorp": must be -all, -command, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --}} test regexp-11.6 {regsub errors} { list [catch {regsub -nocase a( b c d} msg] $msg } {1 {cannot compile regular expression pattern: parentheses () not balanced}} test regexp-11.7 {regsub errors} -setup { unset -nocomplain f1 } -body { set f1 44 regsub -nocase aaa aaa xxx f1(f2) } -returnCodes error -result {can't set "f1(f2)": variable isn't array} test regexp-11.8 {regsub errors, -start bad int check} { list [catch {regsub -start bogus pattern string rep var} msg] $msg } {1 {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?}} test regexp-11.9 {regsub without final variable name returns value} { regsub b abaca X } {aXaca} test regexp-11.10 {regsub without final variable name returns value} { regsub -all a abaca X } {XbXcX} test regexp-11.11 {regsub without final variable name returns value} { regsub b(.*?)d abcdeabcfde {,&,\1,} } {a,bcd,c,eabcfde} test regexp-11.12 {regsub without final variable name returns value} { regsub -all b(.*?)d abcdeabcfde {,&,\1,} } {a,bcd,c,ea,bcfd,cf,e} # This test crashes on the Mac unless you increase the Stack Space to about 1 # Meg. This is probably bigger than most users want... # 8.2.3 regexp reduced stack space requirements, but this should be # tested again test regexp-12.1 {Tcl_RegExpExec: large number of subexpressions} {macCrash} { list [regexp (.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) abcdefghijklmnopqrstuvwxyz all a b c d e f g h i j k l m n o p q r s t u v w x y z] $all $a $b $c $d $e $f $g $h $i $j $k $l $m $n $o $p $q $r $s $t $u $v $w $x $y $z } {1 abcdefghijklmnopqrstuvwxyz a b c d e f g h i j k l m n o p q r s t u v w x y z} test regexp-13.1 {regsub of a very large string} { # This test is designed to stress the memory subsystem in order to catch # Bug #933. It only fails if the Tcl memory allocator is in use. set line {BEGIN_TABLE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END_TABLE} set filedata [string repeat $line 200] for {set i 1} {$i<10} {incr i} { regsub -all "BEGIN_TABLE " $filedata "" newfiledata } set x done } {done} test regexp-14.1 {CompileRegexp: regexp cache} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f set x . append x *a regexp $x bbba } 1 test regexp-14.2 {CompileRegexp: regexp cache, different flags} { regexp .*a b regexp .*b c regexp .*c d regexp .*d e regexp .*e f set x . append x *a regexp -nocase $x bbba } 1 test regexp-14.3 {CompileRegexp: regexp cache, empty regexp and empty cache} -constraints { exec } -setup { set junk [makeFile {puts [regexp {} foo]} junk.tcl] } -body { exec [interpreter] $junk } -cleanup { removeFile junk.tcl } -result 1 test regexp-15.1 {regexp -start} -body { unset -nocomplain x list [regexp -start -10 {\d} 1abc2de3 x] $x } -result {1 1} test regexp-15.2 {regexp -start} -body { unset -nocomplain x list [regexp -start 2 {\d} 1abc2de3 x] $x } -result {1 2} test regexp-15.3 {regexp -start} -body { unset -nocomplain x list [regexp -start 4 {\d} 1abc2de3 x] $x } -result {1 2} test regexp-15.4 {regexp -start} -body { unset -nocomplain x list [regexp -start 5 {\d} 1abc2de3 x] $x } -result {1 3} test regexp-15.5 {regexp -start, over end of string} -body { unset -nocomplain x list [regexp -start [string length 1abc2de3] {\d} 1abc2de3 x] [info exists x] } -result {0 0} test regexp-15.6 {regexp -start, loss of ^$ behavior} -body { list [regexp -start 2 {^$} {}] } -result {0} test regexp-15.7 {regexp -start, double option} -body { regexp -start 2 -start 0 a abc } -result 1 test regexp-15.8 {regexp -start, double option} -body { regexp -start 0 -start 2 a abc } -result 0 test regexp-15.9 {regexp -start, end relative index} -body { unset -nocomplain x list [regexp -start end {\d} 1abc2de3 x] [info exists x] } -result {0 0} test regexp-15.10 {regexp -start, end relative index} -body { unset -nocomplain x list [regexp -start end-1 {\d} 1abc2de3 x] [info exists x] $x } -result {1 1 3} test regexp-15.11 {regexp -start, over end of string} -body { set x NA list [regexp -start 2 {.*} ab x] $x } -result {1 {}} test regexp-16.1 {regsub -start} -body { unset -nocomplain x list [regsub -all -start 2 {\d} a1b2c3d4e5 {/&} x] $x } -result {4 a1b/2c/3d/4e/5} test regexp-16.2 {regsub -start} -body { unset -nocomplain x list [regsub -all -start -25 {z} hello {/&} x] $x } -result {0 hello} test regexp-16.3 {regsub -start} -body { unset -nocomplain x list [regsub -all -start 3 {z} hello {/&} x] $x } -result {0 hello} test regexp-16.4 {regsub -start, \A behavior} -body { set out {} lappend out [regsub -start 0 -all {\A(\w)} {abcde} {/\1} x] $x lappend out [regsub -start 2 -all {\A(\w)} {abcde} {/\1} x] $x } -result {5 /a/b/c/d/e 3 ab/c/d/e} test regexp-16.5 {regsub -start, double option} -body { list [regsub -start 2 -start 0 a abc c x] $x } -result {1 cbc} test regexp-16.6 {regsub -start, double option} -body { list [regsub -start 0 -start 2 a abc c x] $x } -result {0 abc} test regexp-16.7 {regexp -start, end relative index} -body { list [regsub -start end a aaa b x] $x } -result {0 aaa} test regexp-16.8 {regexp -start, end relative index} -body { list [regsub -start end-1 a aaa b x] $x } -result {1 aab} test regexp-16.9 {regsub -start and -all} -body { set foo {} list [regsub -start 0 -all x+ axxxbxx |&| foo] $foo } -result {2 a|xxx|b|xx|} test regexp-16.10 {regsub -start and -all} -body { set foo {} list [regsub -start 1 -all x+ axxxbxx |&| foo] $foo } -result {2 a|xxx|b|xx|} test regexp-16.11 {regsub -start and -all} -body { set foo {} list [regsub -start 4 -all x+ axxxbxx |&| foo] $foo } -result {1 axxxb|xx|} test regexp-16.12 {regsub -start} -body { set foo {} list [regsub -start 4 x+ axxxbxx |&| foo] $foo } -result {1 axxxb|xx|} test regexp-16.13 {regsub -start and -all} -body { set foo {} list [regsub -start 1 -all a+ "" & foo] $foo } -result {0 {}} test regexp-16.14 {regsub -start} -body { set foo {} list [regsub -start 1 a+ "" & foo] $foo } -result {0 {}} test regexp-16.15 {regsub -start and -all} -body { set foo {} list [regsub -start 2 -all a+ "xy" & foo] $foo } -result {0 xy} test regexp-16.16 {regsub -start} -body { set foo {} list [regsub -start 2 a+ "xy" & foo] $foo } -result {0 xy} test regexp-16.17 {regsub -start and -all} -body { set foo {} list [regsub -start 1 -all y+ "xy" & foo] $foo } -result {1 xy} test regexp-16.18 {regsub -start} -body { set foo {} list [regsub -start 1 y+ "xy" & foo] $foo } -result {1 xy} test regexp-16.19 {regsub -start} -body { set foo {} list [regsub -start -1 a+ "" & foo] $foo } -result {0 {}} test regexp-16.20 {regsub -start, loss of ^$ behavior} -body { set foo NA list [regsub -start 1 {^$} {} & foo] $foo } -result {0 {}} test regexp-16.21 {regsub -start, loss of ^$ behavior} -body { set foo NA list [regsub -start 1 {^.*$} abc & foo] $foo } -result {0 abc} test regexp-16.22 {regsub -start, loss of ^$ behavior} -body { set foo NA list [regsub -all -start 1 {^.*$} abc & foo] $foo } -result {0 abc} test regexp-17.1 {regexp -inline} { regexp -inline b ababa } {b} test regexp-17.2 {regexp -inline} { regexp -inline (b) ababa } {b b} test regexp-17.3 {regexp -inline -indices} { regexp -inline -indices (b) ababa } {{1 1} {1 1}} test regexp-17.4 {regexp -inline} { regexp -inline {\w(\d+)\w} " hello 23 there456def " } {e456d 456} test regexp-17.5 {regexp -inline no matches} { regexp -inline {\w(\d+)\w} "" } {} test regexp-17.6 {regexp -inline no matches} { regexp -inline hello goodbye } {} test regexp-17.7 {regexp -inline, no matchvars allowed} { list [catch {regexp -inline b abc match} msg] $msg } {1 {regexp match variables not allowed when using -inline}} test regexp-18.1 {regexp -all} { regexp -all b bbbbb } {5} test regexp-18.2 {regexp -all} { regexp -all b abababbabaaaaaaaaaab } {6} test regexp-18.3 {regexp -all -inline} { regexp -all -inline b abababbabaaaaaaaaaab } {b b b b b b} test regexp-18.4 {regexp -all -inline} { regexp -all -inline {\w(\w)} abcdefg } {ab b cd d ef f} test regexp-18.5 {regexp -all -inline} { regexp -all -inline {\w(\w)$} abcdefg } {fg g} test regexp-18.6 {regexp -all -inline} { regexp -all -inline {\d+} 10:20:30:40 } {10 20 30 40} test regexp-18.7 {regexp -all -inline} { list [catch {regexp -all -inline b abc match} msg] $msg } {1 {regexp match variables not allowed when using -inline}} test regexp-18.8 {regexp -all} { # This should not cause an infinite loop regexp -all -inline {a*} a } {a} test regexp-18.9 {regexp -all} { # Yes, the expected result is {a {}}. Here's why: # Start at index 0; a* matches the "a" there then stops. # Go to index 1; a* matches the lambda (or {}) there then stops. Recall # that a* matches zero or more "a"'s; thus it matches the string "b", as # there are zero or more "a"'s there. # Go to index 2; this is past the end of the string, so stop. regexp -all -inline {a*} ab } {a {}} test regexp-18.10 {regexp -all} { # Yes, the expected result is {a {} a}. Here's why: # Start at index 0; a* matches the "a" there then stops. # Go to index 1; a* matches the lambda (or {}) there then stops. Recall # that a* matches zero or more "a"'s; thus it matches the string "b", as # there are zero or more "a"'s there. # Go to index 2; a* matches the "a" there then stops. # Go to index 3; this is past the end of the string, so stop. regexp -all -inline {a*} aba } {a {} a} test regexp-18.11 {regexp -all} { regexp -all -inline {^a} aaaa } {a} test regexp-18.12 {regexp -all -inline -indices} { regexp -all -inline -indices a(b(c)d|e(f)g)h abcdhaefgh } {{0 4} {1 3} {2 2} {-1 -1} {5 9} {6 8} {-1 -1} {7 7}} test regexp-19.1 {regsub null replacement} { regsub -all {@} {@hel@lo@} "\0a\0" result list $result [string length $result] } "\0a\0hel\0a\0lo\0a\0 14" test regexp-19.2 {regsub null replacement} { regsub -all {@} {@hel@lo@} "\0a\0" result set expected "\0a\0hel\0a\0lo\0a\0" string equal $result $expected } 1 test regexp-20.1 {regsub shared object shimmering} -body { # Bug #461322 set a abcdefghijklmnopqurstuvwxyz set b $a set c abcdefghijklmnopqurstuvwxyz0123456789 regsub $a $c $b d list $d [string length $d] } -result [list abcdefghijklmnopqurstuvwxyz0123456789 37] test regexp-20.2 {regsub shared object shimmering with -about} -body { eval regexp -about abc } -result {0 {}} test regexp-21.1 {regsub works with empty string} -body { regsub -- ^ {} foo } -result {foo} test regexp-21.2 {regsub works with empty string} -body { regsub -- \$ {} foo } -result {foo} test regexp-21.3 {regsub works with empty string offset} -body { regsub -start 0 -- ^ {} foo } -result {foo} test regexp-21.4 {regsub works with empty string offset} -body { regsub -start 0 -- \$ {} foo } -result {foo} test regexp-21.5 {regsub works with empty string offset} -body { regsub -start 3 -- \$ {123} foo } -result {123foo} test regexp-21.6 {regexp works with empty string} -body { regexp -- ^ {} } -result {1} test regexp-21.7 {regexp works with empty string} -body { regexp -start 0 -- ^ {} } -result {1} test regexp-21.8 {regexp works with empty string offset} -body { regexp -start 3 -- ^ {123} } -result {0} test regexp-21.9 {regexp works with empty string offset} -body { regexp -start 3 -- \$ {123} } -result {1} test regexp-21.10 {multiple matches handle newlines} { regsub -all -lineanchor -- {^#[^\n]*\n} "#one\n#two\n#three\n" foo\n } "foo\nfoo\nfoo\n" test regexp-21.11 {multiple matches handle newlines} { regsub -all -line -- ^ "a\nb\nc" \# } "\#a\n\#b\n\#c" test regexp-21.12 {multiple matches handle newlines} { regsub -all -line -- ^ "\n\n" \# } "\#\n\#\n\#" test regexp-21.13 {multiple matches handle newlines} { regexp -all -inline -indices -line -- ^ "a\nb\nc" } {{0 -1} {2 1} {4 3}} test regexp-21.14 {regsub works with empty string} { regsub -- ^ {} & } {} test regexp-21.15 {regsub works with empty string} { regsub -- ^ {} foo& } {foo} test regexp-21.16 {regsub works with empty string} { regsub -all -- ^ {} foo& } {foo} test regexp-21.17 {regsub works with empty string} { regsub -- ^ {} {foo\0} } {foo} test regexp-21.18 {regsub works with empty string} { regsub -- ^.* {} {foo$0} } {foo$0} test regexp-21.19 {regsub works with empty string} { regsub -- ^ {input} {} } {input} test regexp-21.20 {regsub works with empty string} { regsub -- x {} {foo} } {} test regexp-22.1 {Bug 1810038} { regexp ($|^X)* {} } 1 test regexp-22.2 {regexp compile and backrefs, Bug 1857126} { regexp -- {([bc])\1} bb } 1 test regexp-22.3 {Bug 3604074} { # This will hang in interps where the bug is not fixed regexp ((((((((a)*)*)*)*)*)*)*)* a } 1 test regexp-22.4 {Bug 3606139} -setup { interp alias {} a {} string repeat a } -body { # This crashes in interps where the bug is not fixed regexp [join [list [a 160]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 649]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 672]([a 55])[a 669]([a 55])[a 671]([a 55])[a 671]([a 55]) \ [a 672]([a 55])[a 652]([a 55])[a 672]([a 55])[a 671]([a 55]) \ [a 671]([a 55])[a 671]([a 55])[a 653]([a 55])[a 672]([a 55]) \ [a 653]([a 55])[a 672]([a 55])[a 672]([a 55])[a 652]([a 55]) \ [a 671]([a 55])[a 652]([a 55])[a 652]([a 55])[a 672]([a 55]) \ [a 672]([a 55])[a 672]([a 55])[a 653]([a 55])[a 671]([a 55]) \ [a 669]([a 55])[a 649]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 650]([a 55])[a 650]([a 55])[a 672]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 669]([a 55])[a 672]([a 55])[a 669]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 669]([a 55])[a 672]([a 55]) \ [a 670]([a 55])[a 671]([a 55])[a 672]([a 55])[a 672]([a 55]) \ [a 671]([a 55])[a 671]([a 55])[a 672]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 668]([a 55])[a 669]([a 55])[a 668]([a 55]) \ [a 669]([a 55])[a 668]([a 55])[a 669]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 668]([a 55])[a 669]([a 55])[a 668]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 669]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 669]([a 55])[a 672]([a 55])[a 669]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 669]([a 55])[a 668]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 669]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 672]([a 55])[a 669]([a 55])[a 669]([a 55])[a 710]([a 55]) \ [a 668]([a 55])[a 669]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 669]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 668]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 672]([a 55])[a 669]([a 55])[a 669]([a 55])[a 668]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 668]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 667]([a 55])[a 668]([a 55])[a 669]([a 55])[a 668]([a 55]) \ [a 671]([a 55])[a 669]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 669]([a 55])[a 669]([a 55])[a 668]([a 55])[a 669]([a 55]) \ [a 668]([a 55])[a 710]([a 55])[a 668]([a 55])[a 668]([a 55]) \ [a 668]([a 55])[a 668]([a 55])[a 668]([a 55])[a 511]] {}] a } -cleanup { rename a {} } -returnCodes 1 -match glob -result {cannot compile regular expression pattern: *} test regexp-22.5 {Bug 3610026} -setup { set e {} set cp 99 while {$cp < 32864} { append e [format %c [incr cp]] } } -body { regexp -about $e } -cleanup { unset -nocomplain e cp } -returnCodes error -match glob -result {*too many colors*} test regexp-22.6 {Bug 6585b21ca8} { expr {[regexp {(\w).*?\1} Programmer m] ? $m : ""} } rogr test regexp-23.1 {regexp -all and -line} { set string "" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1}} {{0 -1}} {{0 -1}}} test regexp-23.2 {regexp -all and -line} { set string "\n" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1}} {{0 -1}} {{0 -1}}} test regexp-23.3 {regexp -all and -line} { set string "\n\n" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {1 0}} {{0 -1} {1 0}} {{0 -1} {1 0}}} test regexp-23.4 {regexp -all and -line} { set string "a" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1}} {{0 0}} {{1 0}}} test regexp-23.5 {regexp -all and -line} {knownBug} { set string "a\n" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {2 1}} {{0 0} {2 1}} {{1 0} {2 1}}} test regexp-23.6 {regexp -all and -line} { set string "\na" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {1 0}} {{0 -1} {1 1}} {{0 -1} {2 1}}} test regexp-23.7 {regexp -all and -line} {knownBug} { set string "ab\n" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {3 2}} {{0 1} {3 2}} {{2 1} {3 2}}} test regexp-23.8 {regexp -all and -line} { set string "a\nb" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {2 1}} {{0 0} {2 2}} {{1 0} {3 2}}} test regexp-23.9 {regexp -all and -line} {knownBug} { set string "a\nb\n" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {2 1} {4 3}} {{0 0} {2 2} {4 3}} {{1 0} {3 2} {4 3}}} test regexp-23.10 {regexp -all and -line} { set string "a\nb\nc" list \ [regexp -all -inline -indices -line -- {^} $string] \ [regexp -all -inline -indices -line -- {^.*$} $string] \ [regexp -all -inline -indices -line -- {$} $string] } {{{0 -1} {2 1} {4 3}} {{0 0} {2 2} {4 4}} {{1 0} {3 2} {5 4}}} test regexp-23.11 {regexp -all and -line} { regexp -all -inline -indices -line -- {b} "abb\nb" } {{1 1} {2 2} {4 4}} test regexp-24.1 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } {1 <> 1 <> 1 <>} test regexp-24.2 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "\n" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 2 "<>\n<>" 2 "<>\n<>" 2 "<>\n<>"] test regexp-24.3 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "\n\n" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 3 "<>\n<>\n<>" 3 "<>\n<>\n<>" 3 "<>\n<>\n<>"] test regexp-24.4 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "a" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 1 "<>a" 1 "" 1 "a<>"] test regexp-24.5 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "a\n" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 2 "<>a\n<>" 2 "\n<>" 2 "a<>\n<>"] test regexp-24.6 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "\na" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 2 "<>\n<>a" 2 "<>\n" 2 "<>\na<>"] test regexp-24.7 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "ab\n" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 2 "<>ab\n<>" 2 "\n<>" 2 "ab<>\n<>"] test regexp-24.8 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "a\nb" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 2 "<>a\n<>b" 2 "\n" 2 "a<>\nb<>"] test regexp-24.9 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "a\nb\n" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 3 "<>a\n<>b\n<>" 3 "\n\n<>" 3 "a<>\nb<>\n<>"] test regexp-24.10 {regsub -all and -line} { foreach {v1 v2 v3} {{} {} {}} {} set string "a\nb\nc" list \ [regsub -line -all {^} $string {<&>} v1] $v1 \ [regsub -line -all {^.*$} $string {<&>} v2] $v2 \ [regsub -line -all {$} $string {<&>} v3] $v3 } [list 3 "<>a\n<>b\n<>c" 3 "\n\n" 3 "a<>\nb<>\nc<>"] test regexp-24.11 {regsub -all and -line} { regsub -line -all {b} "abb\nb" {<&>} } "a\n" test regexp-25.1 {regexp without -line option} { set foo "" list [regexp {a.*b} "dabc\naxyb\n" foo] $foo } [list 1 abc\naxyb] test regexp-25.2 {regexp without -line option} { set foo "" list [regexp {^a.*b$} "dabc\naxyb\n" foo] $foo } {0 {}} test regexp-25.3 {regexp with -line option} { set foo "" list [regexp -line {^a.*b$} "dabc\naxyb\n" foo] $foo } {1 axyb} test regexp-25.4 {regexp with -line option} { set foo "" list [regexp -line {^a.*b$} "dabc\naxyb\nxb" foo] $foo } {1 axyb} test regexp-25.5 {regexp without -line option} { set foo "" list [regexp {^a.*b$} "dabc\naxyb\nxb" foo] $foo } {0 {}} test regexp-25.6 {regexp without -line option} { set foo "" list [regexp {a.*b$} "dabc\naxyb\nxb" foo] $foo } "1 {abc\naxyb\nxb}" test regexp-25.7 {regexp with -lineanchor option} { set foo "" list [regexp -lineanchor {^a.*b$} "dabc\naxyb\nxb" foo] $foo } "1 {axyb\nxb}" test regexp-25.8 {regexp with -lineanchor and -linestop option} { set foo "" list [regexp -lineanchor -linestop {^a.*b$} "dabc\naxyb\nxb" foo] $foo } {1 axyb} test regexp-25.9 {regexp with -linestop option} { set foo "" list [regexp -linestop {a.*b} "ab\naxyb\nxb" foo] $foo } {1 ab} test regexp-26.1 {matches start of line 1 time} { regexp -all -inline -- {^a+} "aab\naaa" } {aa} test regexp-26.2 {matches start of line(s) 2 times} { regexp -all -inline -line -- {^a+} "aab\naaa" } {aa aaa} test regexp-26.3 {effect of -line -all and -start} -body { list \ [regexp -all -inline -line -start 0 -- {^a+} "aab\naaa"] \ [regexp -all -inline -line -start 1 -- {^a+} "aab\naaa"] \ [regexp -all -inline -line -start 3 -- {^a+} "aab\naaa"] \ [regexp -all -inline -line -start 4 -- {^a+} "aab\naaa"] \ } -result {{aa aaa} aaa aaa aaa} # No regexp-26.4 test regexp-26.5 {match length 0, match length 1} { regexp -all -inline -line -- {^b*} "a\nb" } {{} b} test regexp-26.6 {non reporting capture group} { regexp -all -inline -line -- {^(?:a+|b)} "aab\naaa" } {aa aaa} test regexp-26.7 {Tcl bug 2826551: -line sensitive regexp and -start} { set match1 {} set match2 {} list \ [regexp -start 0 -indices -line {^a} "\nab" match1] $match1 \ [regexp -start 1 -indices -line {^a} "\nab" match2] $match2 } {1 {1 1} 1 {1 1}} test regexp-26.8 {Tcl bug 2826551: diff regexp with -line option} { set data "@1\n2\n+3\n@4\n-5\n+6\n7\n@8\n9\n" regexp -all -inline -line {^@.*\n(?:[^@].*\n?)*} $data } [list "@1\n2\n+3\n" "@4\n-5\n+6\n7\n" "@8\n9\n"] test regexp-26.9 {Tcl bug 2826551: diff regexp with embedded -line option} { set data "@1\n2\n+3\n@4\n-5\n+6\n7\n@8\n9\n" regexp -all -inline {(?n)^@.*\n(?:[^@].*\n?)*} $data } [list "@1\n2\n+3\n" "@4\n-5\n+6\n7\n" "@8\n9\n"] test regexp-26.10 {regexp with -line option} { regexp -all -inline -line -- {a*} "a\n" } {a {}} test regexp-26.11 {regexp without -line option} { regexp -all -inline -- {a*} "a\n" } {a {}} test regexp-26.12 {regexp with -line option} { regexp -all -inline -line -- {a*} "b\n" } {{} {}} test regexp-26.13 {regexp without -line option} { regexp -all -inline -- {a*} "b\n" } {{} {}} test regexp-27.1 {regsub -command} { regsub -command {.x.} {abcxdef} {string length} } ab3ef test regexp-27.2 {regsub -command} { regsub -command {.x.} {abcxdefxghi} {string length} } ab3efxghi test regexp-27.3 {regsub -command} { set x 0 regsub -all -command {(?=.)} abcde {apply {args {incr ::x}}} } 1a2b3c4d5e test regexp-27.4 {regsub -command} -body { regsub -command {.x.} {abcxdef} error } -returnCodes error -result cxd test regexp-27.5 {regsub -command} { regsub -command {(.)(.)} {abcdef} {list ,} } {, ab a bcdef} test regexp-27.6 {regsub -command} { regsub -command -all {(.)(.)} {abcdef} {list ,} } {, ab a b, cd c d, ef e f} test regexp-27.7 {regsub -command representation smash} { set ::s {123=456 789} regsub -command -all {\d+} $::s {apply {n { expr {[llength $::s] + $n} }}} } {125=458 791} test regexp-27.8 {regsub -command representation smash} { set ::t {apply {n { expr {[llength [lindex $::t 1 1 1]] + $n} }}} regsub -command -all {\d+} "123=456 789" $::t } {131=464 797} test regexp-27.9 {regsub -command memory leak testing} memory { set ::s "123=456 789" set ::t {apply {n { expr {[llength [lindex $::t 1 1 1]] + [llength $::s] + $n} }}} memtest { regsub -command -all {\d+} $::s $::t } } 0 test regexp-27.10 {regsub -command error cases} -returnCodes error -body { regsub -command . abc "def \{ghi" } -result {unmatched open brace in list} test regexp-27.11 {regsub -command error cases} -returnCodes error -body { regsub -command . abc {} } -result {command prefix must be a list of at least one element} test regexp-27.12 {regsub -command representation smash} { set s {list (.+)} regsub -command $s {list list} $s } {(.+) {list list} list} test regexp-28.1 {bug cb03e57a7b} -returnCodes error -body { regexp {} $nosuchvar } -result {can't read "nosuchvar": no such variable} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/reg.test0000644000175000017500000012364015104661341014375 0ustar sergeisergei# reg.test -- # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # (Don't panic if you are seeing this as part of the reg distribution # and aren't using Tcl -- reg's own regression tester also knows how # to read this file, ignoring the Tcl-isms.) # # Copyright © 1998, 1999 Henry Spencer. All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # All tests require the testregexp command, return if this # command doesn't exist ::tcltest::testConstraint testregexp [llength [info commands testregexp]] ::tcltest::testConstraint localeRegexp 0 # This file uses some custom procedures, defined below, for regexp regression # testing. The name of the procedure indicates the general nature of the # test: # expectError compile error expected # expectNomatch match failure expected # expectMatch successful match # expectIndices successful match with -indices (used in checking things # like nonparticipating subexpressions) # expectPartial unsuccessful match with -indices (!!) (used in checking # partial-match reporting) # There is also "doing" which sets up title and major test number for each # block of tests. # The first 3 arguments are constant: a minor number (which often gets # a letter or two suffixed to it internally), some flags, and the RE # itself. For expectError, the remaining argument is the name of the # compile error expected, less the leading "REG_". For the rest, the # next argument is the string to try the match against. Remaining # arguments are the substring expected to be matched, and any # substrings expected to be matched by subexpressions. (For # expectNomatch, these arguments are optional, and if present are # ignored except that they indicate how many subexpressions should be # present in the RE.) It is an error for the number of subexpression # arguments to be wrong. Cases involving nonparticipating # subexpressions, checking where empty substrings are located, # etc. should be done using expectIndices and expectPartial. # The flag characters are complex and a bit eclectic. Generally speaking, # lowercase letters are compile options, uppercase are expected re_info # bits, and nonalphabetics are match options, controls for how the test is # run, or testing options. The one small surprise is that AREs are the # default, and you must explicitly request lesser flavors of RE. The flags # are as follows. It is admitted that some are not very mnemonic. # There are some others which are purely debugging tools and are not # useful in this file. # # - no-op (placeholder) # + provide fake xy equivalence class and ch collating element # % force small state-set cache in matcher (to test cache replace) # ^ beginning of string is not beginning of line # $ end of string is not end of line # * test is Unicode-specific, needs big character set # # & test as both ARE and BRE # b BRE # e ERE # a turn advanced-features bit on (error unless ERE already) # q literal string, no metacharacters at all # # i case-independent matching # o ("opaque") no subexpression capture # p newlines are half-magic, excluded from . and [^ only # w newlines are half-magic, significant to ^ and $ only # n newlines are fully magic, both effects # x expanded RE syntax # t incomplete-match reporting # # A backslash-_a_lphanumeric seen # B ERE/ARE literal-_b_race heuristic used # E backslash (_e_scape) seen within [] # H looka_h_ead constraint seen # I _i_mpossible to match # L _l_ocale-specific construct seen # M unportable (_m_achine-specific) construct seen # N RE can match empty (_n_ull) string # P non-_P_OSIX construct seen # Q {} _q_uantifier seen # R back _r_eference seen # S POSIX-un_s_pecified syntax seen # T prefers shortest (_t_iny) # U saw original-POSIX botch: unmatched right paren in ERE (_u_gh) # The one area we can't easily test is memory-allocation failures (which # are hard to provoke on command). Embedded NULs also are not tested at # the moment, but this is a historical accident which should be fixed. # test procedures and related namespace eval RETest { namespace export doing expect* knownBug variable regBug 0 # re_info abbreviation mapping table variable infonames array set infonames { A REG_UBSALNUM B REG_UBRACES E REG_UBBS H REG_ULOOKAHEAD I REG_UIMPOSSIBLE L REG_ULOCALE M REG_UUNPORT N REG_UEMPTYMATCH P REG_UNONPOSIX Q REG_UBOUNDS R REG_UBACKREF S REG_UUNSPEC T REG_USHORTEST U REG_UPBOTCH } variable infonameorder "RHQBAUEPSMLNIT" ;# must match bit order, lsb first # build test number (internal) proc TestNum {args} { return reg-[join [concat $args] .] } # build description, with possible modifiers (internal) proc TestDesc {args} { variable description set testid [concat $args] set d $description if {[llength $testid] > 1} { set d "$d ([lrange $testid 1 end])" } return $d } # build trailing options and flags argument from a flags string (internal) proc TestFlags {fl} { set args [list] set flags "" foreach f [split $fl ""] { switch -exact -- $f { "i" { lappend args "-nocase" } "x" { lappend args "-expanded" } "n" { lappend args "-line" } "p" { lappend args "-linestop" } "w" { lappend args "-lineanchor" } "-" { } default { append flags $f } } } if {$flags ne ""} { lappend args -xflags $flags } return $args } # build info-flags list from a flags string (internal) proc TestInfoFlags {fl} { variable infonames variable infonameorder set ret [list] foreach f [split $infonameorder ""] { if {[string match *$f* $fl]} { lappend ret $infonames($f) } } return $ret } # Share the generation of the list of test constraints so it is # done the same on all routes. proc TestConstraints {flags} { set constraints [list testregexp] variable regBug if {$regBug} { # This will trigger registration as a skipped test lappend constraints knownBug } # Tcl locale stuff doesn't do the ch/xy test fakery yet if {[string match *+* $flags]} { # This will trigger registration as a skipped test lappend constraints localeRegexp } return $constraints } # match expected, internal routine that does the work # parameters like the "real" routines except they don't have "opts", # which is a possibly-empty list of switches for the regexp match attempt # The ! flag is used to indicate expected match failure (for REG_EXPECT, # which wants argument testing even in the event of failure). proc MatchExpected {opts testid flags re target args} { # if &, test as both BRE and ARE if {[string match *&* $flags]} { set f [string map {& {}} $flags] MatchExpected $opts "$testid ARE" ${f} $re $target {*}$args MatchExpected $opts "$testid BRE" ${f}b $re $target {*}$args return } set constraints [TestConstraints $flags] set f [TestFlags $flags] set infoflags [TestInfoFlags $flags] set ccmd [list testregexp -about {*}$f $re] set ecmd [list testregexp {*}$opts {*}$f $re $target] set nsub [expr {[llength $args] - 1}] set names [list] set refs "" for {set i 0} {$i < [llength $args]} {incr i} { if {$i == 0} { set name match } else { set name sub$i } lappend names $name append refs " \$$name" set $name "" } if {[string match *o* $flags]} { ;# REG_NOSUB kludge set nsub 0 ;# unsigned value cannot be -1 } if {[string match *t* $flags]} { ;# REG_EXPECT incr nsub -1 ;# the extra does not count } set erun "list \[[concat $ecmd $names]\] $refs" set result [list [expr {![string match *!* $flags]}] {*}$args] set info [list $nsub $infoflags] ::tcltest::test [TestNum $testid compile] [TestDesc $testid compile] \ -constraints $constraints -body $ccmd -result $info ::tcltest::test [TestNum $testid execute] [TestDesc $testid execute] \ -constraints $constraints -body $erun -result $result } # set major test number and description proc doing {major desc} { variable description "RE engine $desc" } # compilation error expected proc expectError {testid flags re err} { # if &, test as both ARE and BRE if {[string match *&* $flags]} { set f [string map {& {}} $flags] expectError "$testid ARE" ${f} $re $err expectError "$testid BRE" ${f}b $re $err return } set constraints [TestConstraints $flags] set cmd [list testregexp -about {*}[TestFlags $flags] $re] ::tcltest::test [TestNum $testid error] [TestDesc $testid error] \ -constraints $constraints -result [list 1 REG_$err] -body \ "list \[catch \{$cmd\}\] \[lindex \$::errorCode 1\]" } # match failure expected proc expectNomatch {testid flags re target args} { variable regBug # if &, test as both ARE and BRE if {[string match *&* $flags]} { set f [string map {& {}} $flags] expectNomatch "$testid ARE" ${f} $re $target {*}$args expectNomatch "$testid BRE" ${f}b $re $target {*}$args return } set constraints [TestConstraints $flags] set f [TestFlags $flags] set infoflags [TestInfoFlags $flags] set ccmd [list testregexp -about {*}$f $re] set nsub [expr {[llength $args] - 1}] if {$nsub < 0} { # didn't tell us number of subexps set ccmd "lreplace \[$ccmd\] 0 0" set info [list $infoflags] } else { set info [list $nsub $infoflags] } set ecmd [list testregexp {*}$f $re $target] ::tcltest::test [TestNum $testid compile] [TestDesc $testid compile] \ -constraints $constraints -body $ccmd -result $info ::tcltest::test [TestNum $testid execute] [TestDesc $testid execute] \ -constraints $constraints -body $ecmd -result 0 } # match expected (no missing, empty, or ambiguous submatches) # expectMatch testno flags re target mat submat ... proc expectMatch {args} { MatchExpected {} {*}$args } # match expected (full fanciness) # expectIndices testno flags re target mat submat ... proc expectIndices {args} { MatchExpected -indices {*}$args } # partial match expected # expectPartial testno flags re target mat "" ... # Quirk: number of ""s must be one more than number of subREs. proc expectPartial {args} { lset args 1 ![lindex $args 1] ;# add ! flag MatchExpected -indices {*}$args } # test is a knownBug proc knownBug {args} { variable regBug 1 uplevel \#0 $args set regBug 0 } } namespace import RETest::* ######## the tests themselves ######## # support functions and preliminary misc. # This is sensitive to changes in message wording, but we really have to # test the code->message expansion at least once. ::tcltest::test reg-0.1 "regexp error reporting" { list [catch {regexp (*) ign} msg] $msg } {1 {cannot compile regular expression pattern: invalid quantifier operand}} doing 1 "basic sanity checks" expectMatch 1.1 & abc abc abc expectNomatch 1.2 & abc def expectMatch 1.3 & abc xyabxabce abc doing 2 "invalid option combinations" expectError 2.1 qe a INVARG expectError 2.2 qa a INVARG expectError 2.3 qx a INVARG expectError 2.4 qn a INVARG expectError 2.5 ba a INVARG doing 3 "basic syntax" expectIndices 3.1 &NS "" a {0 -1} expectMatch 3.2 NS a| a a expectMatch 3.3 - a|b a a expectMatch 3.4 - a|b b b expectMatch 3.5 NS a||b b b expectMatch 3.6 & ab ab ab doing 4 "parentheses" expectMatch 4.1 - (a)e ae ae a expectMatch 4.2 o (a)e ae expectMatch 4.3 b {\(a\)b} ab ab a expectMatch 4.4 - a((b)c) abc abc bc b expectMatch 4.5 - a(b)(c) abc abc b c expectError 4.6 - a(b EPAREN expectError 4.7 b {a\(b} EPAREN # sigh, we blew it on the specs here... someday this will be fixed in POSIX, # but meanwhile, it's fixed in AREs expectMatch 4.8 eU a)b a)b a)b expectError 4.9 - a)b EPAREN expectError 4.10 b {a\)b} EPAREN expectMatch 4.11 P a(?:b)c abc abc expectError 4.12 e a(?:b)c BADRPT expectIndices 4.13 S a()b ab {0 1} {1 0} expectMatch 4.14 SP a(?:)b ab ab expectIndices 4.15 S a(|b)c ac {0 1} {1 0} expectMatch 4.16 S a(b|)c abc abc b doing 5 "simple one-char matching" # general case of brackets done later expectMatch 5.1 & a.b axb axb expectNomatch 5.2 &n "a.b" "a\nb" expectMatch 5.3 & {a[bc]d} abd abd expectMatch 5.4 & {a[bc]d} acd acd expectNomatch 5.5 & {a[bc]d} aed expectNomatch 5.6 & {a[^bc]d} abd expectMatch 5.7 & {a[^bc]d} aed aed expectNomatch 5.8 &p "a\[^bc]d" "a\nd" doing 6 "context-dependent syntax" # plus odds and ends expectError 6.1 - * BADRPT expectMatch 6.2 b * * * expectMatch 6.3 b {\(*\)} * * * expectError 6.4 - (*) BADRPT expectMatch 6.5 b ^* * * expectError 6.6 - ^* BADRPT expectNomatch 6.7 & ^b ^b expectMatch 6.8 b x^ x^ x^ expectNomatch 6.9 I x^ x expectMatch 6.10 n "\n^" "x\nb" "\n" expectNomatch 6.11 bS {\(^b\)} ^b expectMatch 6.12 - (^b) b b b expectMatch 6.13 & {x$} x x expectMatch 6.14 bS {\(x$\)} x x x expectMatch 6.15 - {(x$)} x x x expectMatch 6.16 b {x$y} "x\$y" "x\$y" expectNomatch 6.17 I {x$y} xy expectMatch 6.18 n "x\$\n" "x\n" "x\n" expectError 6.19 - + BADRPT expectError 6.20 - ? BADRPT doing 7 "simple quantifiers" expectMatch 7.1 &N a* aa aa expectIndices 7.2 &N a* b {0 -1} expectMatch 7.3 - a+ aa aa expectMatch 7.4 - a?b ab ab expectMatch 7.5 - a?b b b expectError 7.6 - ** BADRPT expectMatch 7.7 bN ** *** *** expectError 7.8 & a** BADRPT expectError 7.9 & a**b BADRPT expectError 7.10 & *** BADRPT expectError 7.11 - a++ BADRPT expectError 7.12 - a?+ BADRPT expectError 7.13 - a?* BADRPT expectError 7.14 - a+* BADRPT expectError 7.15 - a*+ BADRPT doing 8 "braces" expectMatch 8.1 NQ "a{0,1}" "" "" expectMatch 8.2 NQ "a{0,1}" ac a expectError 8.3 - "a{1,0}" BADBR expectError 8.4 - "a{1,2,3}" BADBR expectError 8.5 - "a{257}" BADBR expectError 8.6 - "a{1000}" BADBR expectError 8.7 - "a{1" EBRACE expectError 8.8 - "a{1n}" BADBR expectMatch 8.9 BS "a{b" "a\{b" "a\{b" expectMatch 8.10 BS "a{" "a\{" "a\{" expectMatch 8.11 bQ "a\\{0,1\\}b" cb b expectError 8.12 b "a\\{0,1" EBRACE expectError 8.13 - "a{0,1\\" BADBR expectMatch 8.14 Q "a{0}b" ab b expectMatch 8.15 Q "a{0,0}b" ab b expectMatch 8.16 Q "a{0,1}b" ab ab expectMatch 8.17 Q "a{0,2}b" b b expectMatch 8.18 Q "a{0,2}b" aab aab expectMatch 8.19 Q "a{0,}b" aab aab expectMatch 8.20 Q "a{1,1}b" aab ab expectMatch 8.21 Q "a{1,3}b" aaaab aaab expectNomatch 8.22 Q "a{1,3}b" b expectMatch 8.23 Q "a{1,}b" aab aab expectNomatch 8.24 Q "a{2,3}b" ab expectMatch 8.25 Q "a{2,3}b" aaaab aaab expectNomatch 8.26 Q "a{2,}b" ab expectMatch 8.27 Q "a{2,}b" aaaab aaaab doing 9 "brackets" expectMatch 9.1 & {a[bc]} ac ac expectMatch 9.2 & {a[-]} a- a- expectMatch 9.3 & {a[[.-.]]} a- a- expectMatch 9.4 &L {a[[.zero.]]} a0 a0 expectMatch 9.5 &LM {a[[.zero.]-9]} a2 a2 expectMatch 9.6 &M {a[0-[.9.]]} a2 a2 expectMatch 9.7 &+L {a[[=x=]]} ax ax expectMatch 9.8 &+L {a[[=x=]]} ay ay expectNomatch 9.9 &+L {a[[=x=]]} az expectError 9.10 & {a[0-[=x=]]} ERANGE expectMatch 9.11 &L {a[[:digit:]]} a0 a0 expectError 9.12 & {a[[:woopsie:]]} ECTYPE expectNomatch 9.13 &L {a[[:digit:]]} ab expectError 9.14 & {a[0-[:digit:]]} ERANGE expectMatch 9.15 &LP {[[:<:]]a} a a expectMatch 9.16 &LP {a[[:>:]]} a a expectError 9.17 & {a[[..]]b} ECOLLATE expectError 9.18 & {a[[==]]b} ECOLLATE expectError 9.19 & {a[[::]]b} ECTYPE expectError 9.20 & {a[[.a} EBRACK expectError 9.21 & {a[[=a} EBRACK expectError 9.22 & {a[[:a} EBRACK expectError 9.23 & {a[} EBRACK expectError 9.24 & {a[b} EBRACK expectError 9.25 & {a[b-} EBRACK expectError 9.26 & {a[b-c} EBRACK expectMatch 9.27 &M {a[b-c]} ab ab expectMatch 9.28 & {a[b-b]} ab ab expectMatch 9.29 &M {a[1-2]} a2 a2 expectError 9.30 & {a[c-b]} ERANGE expectError 9.31 & {a[a-b-c]} ERANGE expectMatch 9.32 &M {a[--?]b} a?b a?b expectMatch 9.33 & {a[---]b} a-b a-b expectMatch 9.34 & {a[]b]c} a]c a]c expectMatch 9.35 EP {a[\]]b} a]b a]b expectNomatch 9.36 bE {a[\]]b} a]b expectMatch 9.37 bE {a[\]]b} "a\\]b" "a\\]b" expectMatch 9.38 eE {a[\]]b} "a\\]b" "a\\]b" expectMatch 9.39 EP {a[\\]b} "a\\b" "a\\b" expectMatch 9.40 eE {a[\\]b} "a\\b" "a\\b" expectMatch 9.41 bE {a[\\]b} "a\\b" "a\\b" expectError 9.42 - {a[\Z]b} EESCAPE expectMatch 9.43 & {a[[b]c} "a\[c" "a\[c" expectMatch 9.44 EMP* {a[\xFE-\u0507][\xFF-\u0300]b} \ "a\u0102\u02FFb" "a\u0102\u02FFb" doing 10 "anchors and newlines" expectMatch 10.1 & ^a a a expectNomatch 10.2 &^ ^a a expectIndices 10.3 &N ^ a {0 -1} expectIndices 10.4 & {a$} aba {2 2} expectNomatch 10.5 {&$} {a$} a expectIndices 10.6 &N {$} ab {2 1} expectMatch 10.7 &n ^a a a expectMatch 10.8 &n "^a" "b\na" "a" expectIndices 10.9 &w "^a" "a\na" {0 0} expectIndices 10.10 &n^ "^a" "a\na" {2 2} expectMatch 10.11 &n {a$} a a expectMatch 10.12 &n "a\$" "a\nb" "a" expectIndices 10.13 &n "a\$" "a\na" {0 0} expectIndices 10.14 N ^^ a {0 -1} expectMatch 10.15 b ^^ ^ ^ expectIndices 10.16 N {$$} a {1 0} expectMatch 10.17 b {$$} "\$" "\$" expectMatch 10.18 &N {^$} "" "" expectNomatch 10.19 &N {^$} a expectIndices 10.20 &nN "^\$" a\n\nb {2 1} expectMatch 10.21 N {$^} "" "" expectMatch 10.22 b {$^} "\$^" "\$^" expectMatch 10.23 P {\Aa} a a expectMatch 10.24 ^P {\Aa} a a expectNomatch 10.25 ^nP {\Aa} "b\na" expectMatch 10.26 P {a\Z} a a expectMatch 10.27 \$P {a\Z} a a expectNomatch 10.28 \$nP {a\Z} "a\nb" expectError 10.29 - ^* BADRPT expectError 10.30 - {$*} BADRPT expectError 10.31 - {\A*} BADRPT expectError 10.32 - {\Z*} BADRPT doing 11 "boundary constraints" expectMatch 11.1 &LP {[[:<:]]a} a a expectMatch 11.2 &LP {[[:<:]]a} -a a expectNomatch 11.3 &LP {[[:<:]]a} ba expectMatch 11.4 &LP {a[[:>:]]} a a expectMatch 11.5 &LP {a[[:>:]]} a- a expectNomatch 11.6 &LP {a[[:>:]]} ab expectMatch 11.7 bLP {\} a a expectNomatch 11.10 bLP {a\>} ab expectMatch 11.11 LP {\ya} a a expectNomatch 11.12 LP {\ya} ba expectMatch 11.13 LP {a\y} a a expectNomatch 11.14 LP {a\y} ab expectMatch 11.15 LP {a\Y} ab a expectNomatch 11.16 LP {a\Y} a- expectNomatch 11.17 LP {a\Y} a expectNomatch 11.18 LP {-\Y} -a expectMatch 11.19 LP {-\Y} -% - expectNomatch 11.20 LP {\Y-} a- expectError 11.21 - {[[:<:]]*} BADRPT expectError 11.22 - {[[:>:]]*} BADRPT expectError 11.23 b {\<*} BADRPT expectError 11.24 b {\>*} BADRPT expectError 11.25 - {\y*} BADRPT expectError 11.26 - {\Y*} BADRPT expectMatch 11.27 LP {\ma} a a expectNomatch 11.28 LP {\ma} ba expectMatch 11.29 LP {a\M} a a expectNomatch 11.30 LP {a\M} ab expectNomatch 11.31 ILP {\Ma} a expectNomatch 11.32 ILP {a\m} a doing 12 "character classes" expectMatch 12.1 LP {a\db} a0b a0b expectNomatch 12.2 LP {a\db} axb expectNomatch 12.3 LP {a\Db} a0b expectMatch 12.4 LP {a\Db} axb axb expectMatch 12.5 LP "a\\sb" "a b" "a b" expectMatch 12.6 LP "a\\sb" "a\tb" "a\tb" expectMatch 12.7 LP "a\\sb" "a\nb" "a\nb" expectNomatch 12.8 LP {a\sb} axb expectMatch 12.9 LP {a\Sb} axb axb expectNomatch 12.10 LP "a\\Sb" "a b" expectMatch 12.11 LP {a\wb} axb axb expectNomatch 12.12 LP {a\wb} a-b expectNomatch 12.13 LP {a\Wb} axb expectMatch 12.14 LP {a\Wb} a-b a-b expectMatch 12.15 LP {\y\w+z\y} adze-guz guz expectMatch 12.16 LPE {a[\d]b} a1b a1b expectMatch 12.17 LPE "a\[\\s]b" "a b" "a b" expectMatch 12.18 LPE {a[\w]b} axb axb doing 13 "escapes" expectError 13.1 & "a\\" EESCAPE expectMatch 13.2 - {a\]+)>} a } 1 test reg-33.4 {Bug 505048} { regexp {\A\s*([^b]*)b} ab } 1 test reg-33.5 {Bug 505048} { regexp {\A\s*[^b]*(b)} ab } 1 test reg-33.6 {Bug 505048} { regexp {\A(\s*)[^b]*(b)} ab } 1 test reg-33.7 {Bug 505048} { regexp {\A\s*[^b]*b} ab } 1 test reg-33.8 {Bug 505048} { regexp -inline {\A\s*[^b]*b} ab } ab test reg-33.9 {Bug 505048} { regexp -indices -inline {\A\s*[^b]*b} ab } {{0 1}} test reg-33.10 {Bug 840258} -body { regsub {(^|\n)+\.*b} \n.b {} tmp } -cleanup { unset tmp } -result 1 test reg-33.11 {Bug 840258} -body { regsub {(^|[\n\r]+)\.*\?<.*?(\n|\r)+} \ "TQ\r\n.?<5000267>Test already stopped\r\n" {} tmp } -cleanup { unset tmp } -result 1 test reg-33.12 {Bug 1810264 - bad read} { regexp {\3161573148} {\3161573148} } 0 test reg-33.13 {Bug 1810264 - infinite loop} { regexp {($|^)*} {x} } 1 # Some environments have small default stack sizes. [Bug 1905562] test reg-33.14 {Bug 1810264 - super-expensive expression} nonPortable { regexp {(x{200}){200}$y} {x} } 0 test reg-33.15.1 {Bug 3603557 - an "in the wild" RE} { lindex [regexp -expanded -about { ^TETRA_MODE_CMD # Message Type ([[:blank:]]+) # Pad (ETS_1_1|ETS_1_2|ETS_2_2) # SystemCode ([[:blank:]]+) # Pad (CONTINUOUS|CARRIER|MCCH|TRAFFIC) # SharingMode ([[:blank:]]+) # Pad ([[:digit:]]{1,2}) # ColourCode ([[:blank:]]+) # Pad (1|2|3|4|6|9|12|18) # TSReservedFrames ([[:blank:]]+) # Pad (PASS|TRUE|FAIL|FALSE) # UPlaneDTX ([[:blank:]]+) # Pad (PASS|TRUE|FAIL|FALSE) # Frame18Extension ([[:blank:]]+) # Pad ([[:digit:]]{1,4}) # MCC ([[:blank:]]+) # Pad ([[:digit:]]{1,5}) # MNC ([[:blank:]]+) # Pad (BOTH|BCAST|ENQRY|NONE) # NbrCellBcast ([[:blank:]]+) # Pad (UNKNOWN|LOW|MEDIUM|HIGH) # CellServiceLevel ([[:blank:]]+) # Pad (PASS|TRUE|FAIL|FALSE) # LateEntryInfo ([[:blank:]]+) # Pad (300|400) # FrequencyBand ([[:blank:]]+) # Pad (NORMAL|REVERSE) # ReverseOperation ([[:blank:]]+) # Pad (NONE|\+6\.25|\-6\.25|\+12\.5) # Offset ([[:blank:]]+) # Pad (10) # DuplexSpacing ([[:blank:]]+) # Pad ([[:digit:]]{1,4}) # MainCarrierNr ([[:blank:]]+) # Pad (0|1|2|3) # NrCSCCH ([[:blank:]]+) # Pad (15|20|25|30|35|40|45) # MSTxPwrMax ([[:blank:]]+) # Pad (\-125|\-120|\-115|\-110|\-105|\-100|\-95|\-90|\-85|\-80|\-75|\-70|\-65|\-60|\-55|\-50) # RxLevAccessMin ([[:blank:]]+) # Pad (\-53|\-51|\-49|\-47|\-45|\-43|\-41|\-39|\-37|\-35|\-33|\-31|\-29|\-27|\-25|\-23) # AccessParameter ([[:blank:]]+) # Pad (DISABLE|[[:digit:]]{3,4}) # RadioDLTimeout ([[:blank:]]+) # Pad (\-[[:digit:]]{2,3}) # RSSIThreshold ([[:blank:]]+) # Pad ([[:digit:]]{1,5}) # CCKIdSCKVerNr ([[:blank:]]+) # Pad ([[:digit:]]{1,5}) # LocationArea ([[:blank:]]+) # Pad ([(1|0)]{16}) # SubscriberClass ([[:blank:]]+) # Pad ([(1|0)]{12}) # BSServiceDetails ([[:blank:]]+) # Pad (RANDOMIZE|IMMEDIATE|[[:digit:]]{1,2}) # IMM ([[:blank:]]+) # Pad ([[:digit:]]{1,2}) # WT ([[:blank:]]+) # Pad ([[:digit:]]{1,2}) # Nu ([[:blank:]]+) # Pad ([0-1]) # FrameLngFctr ([[:blank:]]+) # Pad ([[:digit:]]{1,2}) # TSPtr ([[:blank:]]+) # Pad ([0-7]) # MinPriority ([[:blank:]]+) # Pad (PASS|TRUE|FAIL|FALSE) # ExtdSrvcsEnabled ([[:blank:]]+) # Pad (.*) # ConditionalFields }] 0 } 68 test reg-33.16.1 {Bug [8d2c0da36d]- another "in the wild" RE} { lindex [regexp -about "^MRK:client1: =1339 14HKelly Talisman 10011000 (\[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]*) \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 8 0 8 0 0 0 77 77 1 1 2 0 11 { 1 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 13HC6 My Creator 2 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 31HC7 Slightly offensive name, huh 3 8 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 23HE-mail:kelly@hotbox.com 4 9 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 17Hcompface must die 5 10 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 3HAir 6 12 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 14HPGP public key 7 13 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 16Hkelly@hotbox.com 8 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 12H2 text/plain 9 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 13H2 x-kom/basic 10 33 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H0 11 14 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H3 }\r?"] 0 } 1 test reg-33.15 {constraint fixes} { regexp {(^)+^} x } 1 test reg-33.16 {constraint fixes} { regexp {($^)+} x } 0 test reg-33.17 {constraint fixes} { regexp {(^$)*} x } 1 test reg-33.18 {constraint fixes} { regexp {(^(?!aa))+} {aa bb cc} } 0 test reg-33.19 {constraint fixes} { regexp {(^(?!aa)(?!bb)(?!cc))+} {aa x} } 0 test reg-33.20 {constraint fixes} { regexp {(^(?!aa)(?!bb)(?!cc))+} {bb x} } 0 test reg-33.21 {constraint fixes} { regexp {(^(?!aa)(?!bb)(?!cc))+} {cc x} } 0 test reg-33.22 {constraint fixes} { regexp {(^(?!aa)(?!bb)(?!cc))+} {dd x} } 1 test reg-33.23 {} { regexp {abcd(\m)+xyz} x } 0 test reg-33.24 {} { regexp {abcd(\m)+xyz} a } 0 test reg-33.25 {} { regexp {^abcd*(((((^(a c(e?d)a+|)+|)+|)+|)+|a)+|)} x } 0 test reg-33.26 {} { regexp {a^(^)bcd*xy(((((($a+|)+|)+|)+$|)+|)+|)^$} x } 0 test reg-33.27 {} { regexp {xyz(\Y\Y)+} x } 0 test reg-33.28 {} { regexp {x|(?:\M)+} x } 1 test reg-33.29 {} { # This is near the limits of the RE engine regexp [string repeat x*y*z* 480] x } 1 test reg-33.30 {Bug 1080042} { regexp {(\Y)+} foo } 1 test reg-33.31 {Bug 7c64aa5e1a} { regexp -inline {(?b).\{1,10\}} {abcdef} } abcdef # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/README0000644000175000017500000001047015076154267013607 0ustar sergeisergeiREADME -- Tcl test suite design document. Contents: --------- 1. Introduction 2. Running tests 3. Adding tests 4. Incompatibilities with prior Tcl versions 1. Introduction: ---------------- This directory contains a set of validation tests for the Tcl commands and C Library procedures for Tcl. Each of the files whose name ends in ".test" is intended to fully exercise the functions in the C source file that corresponds to the file prefix. The C functions and/or Tcl commands tested by a given file are listed in the first line of the file. 2. Running tests: ----------------- We recommend that you use the "test" target of Tcl's Makefile to run the test suite. From the directory in which you build Tcl, simply type "make test". This will create a special executable named tcltest in which the testing scripts will be evaluated. To create the tcltest executable without running the test suite, simple type "make tcltest". All the configuration options of the tcltest package are available during a "make test" by defining the TESTFLAGS environment variable. For example,if you wish to run only those tests in the file append.test, you can type: make test TESTFLAGS="-file append.test" For interactive testing, the Tcl Makefile provides the "runtest" target. Type "make runtest" in your build directory, and the tcltest executable will be created, if necessary, then it will run interactively. At the command prompt, you may type any Tcl commands. If you type "source ../tests/all.tcl", the test suite will run. You may use the tcltest::configure command to configure the test suite run as an alternative to command line options via TESTFLAGS. You might also wish to use the tcltest::testConstraint command to select the constraints that govern which tests are run. See the documentation for the tcltest package for details. 3. Adding tests: ---------------- Please see the tcltest man page for more information regarding how to write and run tests. Please note that the all.tcl file will source your new test file if the filename matches the tests/*.test pattern (as it should). The names of test files that contain regression (or glass-box) tests should correspond to the Tcl or C code file that they are testing. For example, the test file for the C file "tclCmdAH.c" is "cmdAH.test". Test files that contain black-box tests may not correspond to any Tcl or C code file so they should match the pattern "*_bb.test". Be sure your new test file can be run from any working directory. Be sure no temporary files are left behind by your test file. Use [tcltest::makeFile], [tcltest::removeFile], and [tcltest::cleanupTests] properly to be sure of this. Be sure your tests can run cross-platform in both a build environment as well as an installation environment. If your test file contains tests that should not be run in one or more of those cases, please use the constraints mechanism to skip those tests. 4. Incompatibilities of package tcltest 2.1 with testing machinery of very old versions of Tcl: ------------------------------------------------ 1) Global variables such as VERBOSE, TESTS, and testConfig of the old machinery correspond to the [configure -verbose], [configure -match], and [testConstraint] commands of tcltest 2.1, respectively. 2) VERBOSE values were longer numeric. [configure -verbose] values are lists of keywords. 3) When you run "make test", the working dir for the test suite is now the one from which you called "make test", rather than the "tests" directory. This change allows for both unix and windows test suites to be run simultaneously without interference with each other or with existing files. All tests must now run independently of their working directory. 4) The "all" file is now called "all.tcl" 5) The "defs" and "defs.tcl" files no longer exist. 6) Instead of creating a doAllTests file in the tests directory, to run all nonPortable tests, just use the "-constraints nonPortable" command line flag. If you are running interactively, you can run [tcltest::testConstraint nonPortable 1] (after loading the tcltest package). 7) Direct evaluation of the *.test files by the "source" command is no longer recommended. Instead, "source all.tcl" and use the "-file" and "-notfile" options of tcltest::configure to control which *.test files are evaluated. tcl9.0.3/tests/pwd.test0000644000175000017500000000164515104661341014412 0ustar sergeisergei# Commands covered: pwd # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test pwd-1.1 {simple pwd} { catch pwd } 0 test pwd-1.2 {simple pwd} { expr {[string length [pwd]]>0} } 1 test pwd-2.1 {pwd takes no args} -body { pwd foobar } -returnCodes error -result "wrong \# args: should be \"pwd\"" # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/process.test0000644000175000017500000002401715104661341015274 0ustar sergeisergei# process.test -- # # This file contains a collection of tests for the tcl::process ensemble. # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 2017 Frederic Bonnet # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Utilities file delete [set path(test-signalfile) [makeFile {} test-signalfile]] set path(test-signalfile2) [makeFile {} test-signalfile2] # $path(sleep) time ?filename? -- sleep for time (in ms) and stop if it gets signaled (file gets deleted) set path(sleep) [makeFile { after [expr {[lindex $argv 0]*1000}] {set stop 1} if {[set fn [lindex $::argv 1]] ne ""} { close [open $fn w] proc check {} { if {![file exists $::fn]} { # exit signaled after 10 {set ::stop 2} } after 10 check } after 10 check } vwait stop exit } sleep] proc wait_for_file {fn {timeout 10000}} { if {![file exists $fn]} { set toev [after $timeout {set found 0}] proc check {fn} { if {[file exists $fn]} { set ::found 1 return } after 10 [list check $fn] } after 10 [list check $fn] vwait ::found after cancel $toev unset ::found } file exists $fn } proc signal_exit {fn {wait 1}} { # wait for until file created if expected: if {!$wait || [wait_for_file $fn]} { # delete file to signal exit for child-process: while {1} { if {![catch { file delete $fn } msg opt] || [lrange [dict get $opt -errorcode] 0 1] ne {POSIX EACCES} } break } } } set path(exit) [makeFile { exit [lindex $argv 0] } exit] # Basic syntax checking test process-1.1 {tcl::process command basic syntax} -returnCodes error -body { tcl::process } -result {wrong # args: should be "tcl::process subcommand ?arg ...?"} test process-1.2 {tcl::process subcommands} -returnCodes error -body { tcl::process ? } -match glob -result {unknown or ambiguous subcommand "?": must be autopurge, list, purge, or status} # Autopurge flag # - Default state test process-2.1 {autopurge default} -body { tcl::process autopurge } -result {1} # - Enabling autopurge test process-2.2 {enable autopurge} -body { tcl::process autopurge true tcl::process autopurge } -result {1} # - Disabling autopurge test process-2.3 {disable autopurge} -body { tcl::process autopurge false tcl::process autopurge } -result {0} -cleanup {tcl::process autopurge true} # Subprocess list & status test process-3.1 {empty subprocess list} -body { llength [tcl::process list] } -result {0} test process-3.2 {empty subprocess status} -body { dict size [tcl::process status] } -result {0} # Spawn subprocesses using [exec] # - One child test process-4.1 {exec one child} -body { tcl::process autopurge 0 set pid [exec [interpreter] $path(exit) 0 &] set list [tcl::process list] set statuses [tcl::process status -wait] set status [lindex [tcl::process status $pid] 1] expr { [llength $list] eq 1 && [lindex $list 0] eq $pid && [dict size $statuses] eq 1 && [dict get $statuses $pid] eq $status && $status eq 0 } } -result {1} -cleanup { tcl::process purge tcl::process autopurge 1 } # - Two children test process-4.2 {exec two children in parallel} -body { tcl::process autopurge 0 set pid1 [exec [interpreter] $path(exit) 0 &] set pid2 [exec [interpreter] $path(exit) 0 &] set list [tcl::process list] set statuses [tcl::process status -wait] set status1 [lindex [tcl::process status $pid1] 1] set status2 [lindex [tcl::process status $pid2] 1] expr { [llength $list] eq 2 && [lsearch $list $pid1] >= 0 && [lsearch $list $pid2] >= 0 && [dict size $statuses] eq 2 && [dict get $statuses $pid1] eq $status1 && [dict get $statuses $pid2] eq $status2 && $status1 eq 0 && $status2 eq 0 } } -result {1} -cleanup { tcl::process purge tcl::process autopurge 1 } # - 3-stage pipe test process-4.3 {exec 3-stage pipe} -body { tcl::process autopurge 0 set pids [exec \ [interpreter] $path(exit) 0 \ | [interpreter] $path(exit) 0 \ | [interpreter] $path(exit) 0 \ &] lassign $pids pid1 pid2 pid3 set list [tcl::process list] set statuses [tcl::process status -wait] set status1 [lindex [tcl::process status $pid1] 1] set status2 [lindex [tcl::process status $pid2] 1] set status3 [lindex [tcl::process status $pid3] 1] expr { [llength $pids] eq 3 && [llength $list] eq 3 && [lsearch $list $pid1] >= 0 && [lsearch $list $pid2] >= 0 && [lsearch $list $pid3] >= 0 && [dict size $statuses] eq 3 && [dict get $statuses $pid1] eq $status1 && [dict get $statuses $pid2] eq $status2 && [dict get $statuses $pid3] eq $status3 && $status1 eq 0 && $status2 eq 0 && $status3 eq 0 } } -result {1} -cleanup { tcl::process purge tcl::process autopurge 1 } # Spawn subprocesses using [open "|"] # - One child test process-5.1 {exec one child} -body { tcl::process autopurge 0 set f [open "|\"[interpreter]\" \"$path(exit)\" 0"] set pid [pid $f] set list [tcl::process list] set statuses [tcl::process status -wait] set status [lindex [tcl::process status $pid] 1] expr { [llength $list] eq 1 && [lindex $list 0] eq $pid && [dict size $statuses] eq 1 && [dict get $statuses $pid] eq $status && $status eq 0 } } -result {1} -cleanup { close $f tcl::process purge tcl::process autopurge 1 } # - Two children test process-5.2 {exec two children in parallel} -body { tcl::process autopurge 0 set f1 [open "|\"[interpreter]\" \"$path(exit)\" 0"] set f2 [open "|\"[interpreter]\" \"$path(exit)\" 0"] set pid1 [pid $f1] set pid2 [pid $f2] set list [tcl::process list] set statuses [tcl::process status -wait] set status1 [lindex [tcl::process status $pid1] 1] set status2 [lindex [tcl::process status $pid2] 1] expr { [llength $list] eq 2 && [lsearch $list $pid1] >= 0 && [lsearch $list $pid2] >= 0 && [dict size $statuses] eq 2 && [dict get $statuses $pid1] eq $status1 && [dict get $statuses $pid2] eq $status2 && $status1 eq 0 && $status2 eq 0 } } -result {1} -cleanup { close $f1 close $f2 tcl::process purge tcl::process autopurge 1 } # - 3-stage pipe test process-5.3 {exec 3-stage pipe} -body { tcl::process autopurge 0 set f [open "| \"[interpreter]\" \"$path(exit)\" 0 | \"[interpreter]\" \"$path(exit)\" 0 | \"[interpreter]\" \"$path(exit)\" 0 "] set pids [pid $f] lassign $pids pid1 pid2 pid3 set list [tcl::process list] set statuses [tcl::process status -wait] set status1 [lindex [tcl::process status $pid1] 1] set status2 [lindex [tcl::process status $pid2] 1] set status3 [lindex [tcl::process status $pid3] 1] expr { [llength $pids] eq 3 && [llength $list] eq 3 && [lsearch $list $pid1] >= 0 && [lsearch $list $pid2] >= 0 && [lsearch $list $pid3] >= 0 && [dict size $statuses] eq 3 && [dict get $statuses $pid1] eq $status1 && [dict get $statuses $pid2] eq $status2 && [dict get $statuses $pid3] eq $status3 && $status1 eq 0 && $status2 eq 0 && $status3 eq 0 } } -result {1} -cleanup { close $f tcl::process purge tcl::process autopurge 1 } # Async child status test process-6.1 {async status} -setup { signal_exit $path(test-signalfile) 0; # clean signal-file } -body { tcl::process autopurge 0 set pid [exec [interpreter] $path(sleep) 1 $path(test-signalfile) &] set status1 [lindex [tcl::process status $pid] 1] signal_exit $path(test-signalfile); # signal exit (stop sleep) set status2 [lindex [tcl::process status -wait $pid] 1] expr { $status1 eq {} && $status2 eq 0 } } -result {1} -cleanup { tcl::process purge tcl::process autopurge 1 } test process-6.2 {selective wait} -setup { signal_exit $path(test-signalfile) 0; # clean signal-files signal_exit $path(test-signalfile2) 0; } -body { tcl::process autopurge 0 # Child 1 sleeps 1s set pid1 [exec [interpreter] $path(sleep) 1 $path(test-signalfile) &] # Child 2 sleeps 1s set pid2 [exec [interpreter] $path(sleep) 2 $path(test-signalfile2) &] # Initial status set status1_1 [lindex [tcl::process status $pid1] 1] set status1_2 [lindex [tcl::process status $pid2] 1] # Wait until child 1 termination signal_exit $path(test-signalfile); # signal exit for pid1 (stop sleep) set status2_1 [lindex [tcl::process status -wait $pid1] 1] set status2_2 [lindex [tcl::process status $pid2] 1] # Wait until child 2 termination signal_exit $path(test-signalfile2); # signal exit for pid2 (stop sleep) set status3_2 [lindex [tcl::process status -wait $pid2] 1] set status3_1 [lindex [tcl::process status $pid1] 1] expr { $status1_1 eq {} && $status1_2 eq {} && $status2_1 eq 0 && $status2_2 eq {} && $status3_1 eq 0 && $status3_2 eq 0 } } -result {1} -cleanup { tcl::process purge tcl::process autopurge 1 } # Error codes test process-7.1 {normal exit} -body { tcl::process autopurge 0 set pid [exec [interpreter] $path(exit) 0 &] lindex [tcl::process status -wait $pid] 1 } -result {0} -cleanup { tcl::process purge tcl::process autopurge 1 } test process-7.2 {abnormal exit} -body { tcl::process autopurge 0 set pid [exec [interpreter] $path(exit) 1 &] lindex [tcl::process status -wait $pid] 1 } -match glob -result {1 {child process exited abnormally} {CHILDSTATUS * 1}} -cleanup { tcl::process purge tcl::process autopurge 1 } test process-7.3 {child killed} -constraints {win} -body { tcl::process autopurge 0 set pid [exec [interpreter] $path(exit) -1 &] lindex [tcl::process status -wait $pid] 1 } -match glob -result {1 {child killed: unknown signal} {CHILDKILLED * {unknown signal} {unknown signal}}} -cleanup { tcl::process purge tcl::process autopurge 1 } removeFile $path(exit) removeFile $path(sleep) rename wait_for_file {} rename signal_exit {} ::tcltest::cleanupTests return tcl9.0.3/tests/proc.test0000644000175000017500000003311215104661341014555 0ustar sergeisergei# This file contains tests for the tclProc.c source file. Tests appear in the # same order as the C code that they test. The set of tests is currently # incomplete since it includes only new tests, in particular tests for code # changed for the addition of Tcl namespaces. Other procedure-related tests # appear in other test files such as proc-old.test. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands testConstraint tcl::test [expr {![catch {package require tcl::test}]}] testConstraint memory [llength [info commands memory]] catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} catch {rename {} ""} catch {unset msg} test proc-1.1 {Tcl_ProcObjCmd, put proc in namespace specified in name, if any} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { namespace eval baz {} } proc test_ns_1::baz::p {} { return "p in [namespace current]" } list [test_ns_1::baz::p] \ [namespace eval test_ns_1 {baz::p}] \ [info commands test_ns_1::baz::*] } -result {{p in ::test_ns_1::baz} {p in ::test_ns_1::baz} ::test_ns_1::baz::p} test proc-1.2 {Tcl_ProcObjCmd, namespace specified in proc name must exist} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -returnCodes error -body { proc test_ns_1::baz::p {} {} } -result {can't create procedure "test_ns_1::baz::p": unknown namespace} test proc-1.3 {Tcl_ProcObjCmd, empty proc name} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { proc :: {} { return "empty called" } list [::] \ [info body {}] } -result {{empty called} { return "empty called" }} test proc-1.4 {Tcl_ProcObjCmd, simple proc name and proc defined in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { namespace eval baz { proc p {} { return "p in [namespace current]" } } } list [test_ns_1::baz::p] \ [info commands test_ns_1::baz::*] } -result {{p in ::test_ns_1::baz} ::test_ns_1::baz::p} test proc-1.5 {Tcl_ProcObjCmd, qualified proc name and proc defined in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1::baz {} namespace eval test_ns_1 { proc baz::p {} { return "p in [namespace current]" } } list [test_ns_1::baz::p] \ [info commands test_ns_1::baz::*] \ [namespace eval test_ns_1::baz {namespace which p}] } -result {{p in ::test_ns_1::baz} ::test_ns_1::baz::p ::test_ns_1::baz::p} test proc-1.6 {Tcl_ProcObjCmd, namespace code ignores single ":"s in middle or end of command names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { proc q: {} {return "q:"} proc value:at: {} {return "value:at:"} } list [namespace eval test_ns_1 {q:}] \ [namespace eval test_ns_1 {value:at:}] \ [test_ns_1::q:] \ [test_ns_1::value:at:] \ [lsort [info commands test_ns_1::*]] \ [namespace eval test_ns_1 {namespace which q:}] \ [namespace eval test_ns_1 {namespace which value:at:}] } -result {q: value:at: q: value:at: {::test_ns_1::q: ::test_ns_1::value:at:} ::test_ns_1::q: ::test_ns_1::value:at:} test proc-1.7 {Tcl_ProcObjCmd, check that formal parameter names are not array elements} -setup { catch {rename p ""} } -returnCodes error -body { proc p {a(1) a(2)} { set z [expr {$a(1)+$a(2)}] puts "$z=z, $a(1)=$a(1)" } } -result {formal parameter "a(1)" is an array element} test proc-1.8 {Tcl_ProcObjCmd, check that formal parameter names are simple names} -setup { catch {rename p ""} } -body { proc p {b:a b::a} { } } -returnCodes error -result {formal parameter "b::a" is not a simple name} test proc-1.9 {Tcl_ProcObjCmd, arguments via canonical list (string-representation bug [631b4c45df])} -body { set v 2 binary scan AB cc a b proc p [list [list a $a] [list b $b] [list v [expr {$v + 2}]]] {expr {$a + $b + $v}} p } -result [expr {65+66+4}] -cleanup { rename p {} } test proc-2.1 {TclFindProc, simple proc name and proc not in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} } -body { proc p {} {return "p in [namespace current]"} info body p } -result {return "p in [namespace current]"} test proc-2.2 {TclFindProc, simple proc name and proc defined in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { namespace eval baz { proc p {} {return "p in [namespace current]"} } } namespace eval test_ns_1::baz {info body p} } -result {return "p in [namespace current]"} test proc-2.3 {TclFindProc, qualified proc name and proc defined in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1::baz {} namespace eval test_ns_1 { proc baz::p {} {return "p in [namespace current]"} } namespace eval test_ns_1 {info body baz::p} } -result {return "p in [namespace current]"} test proc-2.4 {TclFindProc, global proc and executing in namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} } -body { proc p {} {return "global p"} namespace eval test_ns_1::baz {info body p} } -result {return "global p"} test proc-3.1 {TclObjInterpProc, proc defined and executing in same namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { proc p {} {return "p in [namespace current]"} p } -result {p in ::} test proc-3.2 {TclObjInterpProc, proc defined and executing in same namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1::baz { proc p {} {return "p in [namespace current]"} p } } -result {p in ::test_ns_1::baz} test proc-3.3 {TclObjInterpProc, proc defined and executing in different namespaces} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} } -body { proc p {} {return "p in [namespace current]"} namespace eval test_ns_1::baz { p } } -result {p in ::} test proc-3.4 {TclObjInterpProc, procs execute in the namespace in which they were defined unless renamed into new namespace} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} } -body { namespace eval test_ns_1::baz { proc p {} {return "p in [namespace current]"} rename ::test_ns_1::baz::p ::p list [p] [namespace which p] } } -result {{p in ::} ::p} test proc-3.5 {TclObjInterpProc, any old result is reset before appending error msg about missing arguments} -body { proc p {x} {info commands 3m} p } -returnCodes error -result {wrong # args: should be "p x"} test proc-3.6 {TclObjInterpProc, proper quoting of proc name, Bug 942757} -body { proc {a b c} {x} {info commands 3m} {a b c} } -returnCodes error -result {wrong # args: should be "{a b c} x"} test proc-3.7 {TclObjInterpProc, wrong num args, Bug 3366265} { proc {} {x} {} list [catch {{}} msg] $msg } {1 {wrong # args: should be "{} x"}} catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} catch {rename {} ""} catch {rename {a b c} {}} catch {unset msg} catch {rename p ""} catch {rename t ""} # Note that the test require that procedures whose body is used to create # procbody objects must be executed before the tcl::procbodytest::proc command is # executed, so that the Proc struct is populated correctly (CompiledLocals are # added at compile time). test proc-4.1 {TclCreateProc, procbody obj} -constraints tcl::test -body { proc p x {return "$x:$x"} set rv [p P] tcl::procbodytest::proc t x p lappend rv [t T] } -cleanup { catch {rename p ""} catch {rename t ""} } -result {P:P T:T} test proc-4.2 {TclCreateProc, procbody obj, use compiled locals} -body { proc p x { set y [string tolower $x] return "$x:$y" } set rv [p P] tcl::procbodytest::proc t x p lappend rv [t T] } -constraints tcl::test -cleanup { catch {rename p ""} catch {rename t ""} } -result {P:p T:t} test proc-4.3 {TclCreateProc, procbody obj, too many args} -body { proc p x { set y [string tolower $x] return "$x:$y" } set rv [p P] tcl::procbodytest::proc t {x x1 x2} p lappend rv [t T] } -constraints tcl::test -returnCodes error -cleanup { catch {rename p ""} catch {rename t ""} } -result {procedure "t": arg list contains 3 entries, precompiled header expects 1} test proc-4.4 {TclCreateProc, procbody obj, inconsistent arg name} -body { proc p {x y z} { set v [join [list $x $y $z]] set w [string tolower $v] return "$v:$w" } set rv [p P Q R] tcl::procbodytest::proc t {x x1 z} p lappend rv [t S T U] } -constraints tcl::test -returnCodes error -cleanup { catch {rename p ""} catch {rename t ""} } -result {procedure "t": formal parameter 1 is inconsistent with precompiled body} test proc-4.5 {TclCreateProc, procbody obj, inconsistent arg default type} -body { proc p {x y {z Z}} { set v [join [list $x $y $z]] set w [string tolower $v] return "$v:$w" } set rv [p P Q R] tcl::procbodytest::proc t {x y z} p lappend rv [t S T U] } -constraints tcl::test -returnCodes error -cleanup { catch {rename p ""} catch {rename t ""} } -result {procedure "t": formal parameter 2 is inconsistent with precompiled body} test proc-4.6 {TclCreateProc, procbody obj, inconsistent arg default type} -body { proc p {x y z} { set v [join [list $x $y $z]] set w [string tolower $v] return "$v:$w" } set rv [p P Q R] tcl::procbodytest::proc t {x y {z Z}} p lappend rv [t S T U] } -returnCodes error -constraints tcl::test -cleanup { catch {rename p ""} catch {rename t ""} } -result {procedure "t": formal parameter 2 is inconsistent with precompiled body} test proc-4.7 {TclCreateProc, procbody obj, inconsistent arg default value} -body { proc p {x y {z Z}} { set v [join [list $x $y $z]] set w [string tolower $v] return "$v:$w" } set rv [p P Q R] tcl::procbodytest::proc t {x y {z ZZ}} p lappend rv [t S T U] } -constraints tcl::test -returnCodes error -cleanup { catch {rename p ""} catch {rename t ""} } -result {procedure "t": formal parameter "z" has default value inconsistent with precompiled body} test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } proc px x { set y [string tolower $x] return "$x:$y" } px x } -constraints {tcl::test memory} -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { tcl::procbodytest::proc tx x px set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i tmp leakedBytes } -result 0 test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} tcl::test { tcl::procbodytest::check } 1 test proc-4.10 { TclCreateProc, issue a8579d906a28, argument with no name } -body { catch { proc p1 [list [list [expr {1 + 2}] default]] {} } } -cleanup { catch {rename p1 {}} } -result 0 test proc-5.1 {Bytecompiling noop; test for correct argument substitution} -body { proc p args {} ; # this will be bytecompiled into t proc t {} { set res {} set a 0 set b 0 trace add variable a read {append res a ;#} trace add variable b write {append res b ;#} p $a ccccccw {bfe} {$a} [incr b] [incr a] {[incr b]} {$a} hello set res } t } -cleanup { catch {rename p ""} catch {rename t ""} } -result {aba} test proc-6.1 {ProcessProcResultCode: Bug 647307 (negative return code)} -body { proc a {} {return -code -5} proc b {} a catch b } -cleanup { rename a {} rename b {} } -result -5 test proc-7.1 {Redefining a compiled cmd: Bug 729692} { proc bar args {} proc foo {} { proc bar args {return bar} bar } foo } bar test proc-7.2 {Shadowing a compiled cmd: Bug 729692} -body { namespace eval ugly {} proc ugly::foo {} { proc set args {return bar} set x 1 } ugly::foo } -cleanup { namespace delete ugly } -result bar test proc-7.3 {Returning loop exception from redefined cmd: Bug 729692} -body { namespace eval ugly {} proc ugly::foo {} { set i 0 while { 1 } { if { [incr i] > 3 } { proc continue {} {return -code break} } continue } return $i } ugly::foo } -cleanup { namespace delete ugly } -result 4 test proc-7.4 {Proc struct outlives its interp: Bug 3532959} { set lambda x lappend lambda {set a 1} interp create child child eval [list apply $lambda foo] interp delete child unset lambda } {} test proc-7.5 {[631b4c45df] Crash in argument processing} { binary scan A c val proc foo [list [list from $val]] {} rename foo {} unset -nocomplain val } {} test proc-7.6 {[51d5f22997] Crash in argument processing} -cleanup { rename foo {} } -body { proc foo {{x {}} {y {}} args} {} foo } -result {} # cleanup catch {rename p ""} catch {rename t ""} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/proc-old.test0000644000175000017500000003514515104661341015341 0ustar sergeisergei# Commands covered: proc, return, global # # This file, proc-old.test, includes the original set of tests for Tcl's # proc, return, and global commands. There is now a new file proc.test # that contains tests for the tclProc.c source file. # # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {rename t1 ""} catch {rename foo ""} proc tproc {} {return a; return b} test proc-old-1.1 {simple procedure call and return} {tproc} a proc tproc x { set x [expr {$x + 1}] return $x } test proc-old-1.2 {simple procedure call and return} {tproc 2} 3 test proc-old-1.3 {simple procedure call and return} { proc tproc {} {return foo} } {} test proc-old-1.4 {simple procedure call and return} { proc tproc {} {return} tproc } {} proc tproc1 {a} {incr a; return $a} proc tproc2 {a b} {incr a; return $a} test proc-old-1.5 {simple procedure call and return (2 procs with same body but different parameters)} { list [tproc1 123] [tproc2 456 789] } {124 457} test proc-old-1.6 {simple procedure call and return (shared proc body string)} { set x {} proc tproc {} {} ;# body is shared with x list [tproc] [append x foo] } {{} foo} test proc-old-2.1 {local and global variables} { proc tproc x { set x [expr {$x + 1}] return $x } set x 42 list [tproc 6] $x } {7 42} test proc-old-2.2 {local and global variables} { proc tproc x { set y [expr {$x + 1}] return $y } set y 18 list [tproc 6] $y } {7 18} test proc-old-2.3 {local and global variables} { proc tproc x { global y set y [expr {$x + 1}] return $y } set y 189 list [tproc 6] $y } {7 7} test proc-old-2.4 {local and global variables} { proc tproc x { global y return [expr {$x + $y}] } set y 189 list [tproc 6] $y } {195 189} catch {unset _undefined_} test proc-old-2.5 {local and global variables} { proc tproc x { global _undefined_ return $_undefined_ } list [catch {tproc xxx} msg] $msg } {1 {can't read "_undefined_": no such variable}} test proc-old-2.6 {local and global variables} { set a 114 set b 115 global a b list $a $b } {114 115} proc do {cmd} {eval $cmd} test proc-old-3.1 {local and global arrays} { catch {unset a} set a(0) 22 list [catch {do {global a; set a(0)}} msg] $msg } {0 22} test proc-old-3.2 {local and global arrays} { catch {unset a} set a(x) 22 list [catch {do {global a; set a(x) newValue}} msg] $msg $a(x) } {0 newValue newValue} test proc-old-3.3 {local and global arrays} { catch {unset a} set a(x) 22 set a(y) 33 list [catch {do {global a; unset a(y)}; array names a} msg] $msg } {0 x} test proc-old-3.4 {local and global arrays} { catch {unset a} set a(x) 22 set a(y) 33 list [catch {do {global a; unset a; info exists a}} msg] $msg \ [info exists a] } {0 0 0} test proc-old-3.5 {local and global arrays} { catch {unset a} set a(x) 22 set a(y) 33 list [catch {do {global a; unset a(y); array names a}} msg] $msg } {0 x} catch {unset a} test proc-old-3.6 {local and global arrays} { catch {unset a} set a(x) 22 set a(y) 33 do {global a; do {global a; unset a}; set a(z) 22} list [catch {array names a} msg] $msg } {0 z} test proc-old-3.7 {local and global arrays} { proc t1 {args} {global info; set info 1} catch {unset a} set info {} do {global a; trace add var a(1) write t1} set a(1) 44 set info } 1 test proc-old-3.8 {local and global arrays} { proc t1 {args} {global info; set info 1} catch {unset a} trace add var a(1) write t1 set info {} do {global a; trace remove variable a(1) write t1} set a(1) 44 set info } {} test proc-old-3.9 {local and global arrays} { proc t1 {args} {global info; set info 1} catch {unset a} trace add var a(1) write t1 do {global a; trace info var a(1)} } {{write t1}} catch {unset a} test proc-old-30.1 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } tproc 11 12 13 } {11 12 13} test proc-old-30.2 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } list [catch {tproc 11 12} msg] $msg } {1 {wrong # args: should be "tproc x y z"}} test proc-old-30.3 {arguments and defaults} { proc tproc {x y z} { return [list $x $y $z] } list [catch {tproc 11 12 13 14} msg] $msg } {1 {wrong # args: should be "tproc x y z"}} test proc-old-30.4 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 12 13 } {11 12 13} test proc-old-30.5 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 12 } {11 12 z-default} test proc-old-30.6 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } tproc 11 } {11 y-default z-default} test proc-old-30.7 {arguments and defaults} { proc tproc {x {y y-default} {z z-default}} { return [list $x $y $z] } list [catch {tproc} msg] $msg } {1 {wrong # args: should be "tproc x ?y? ?z?"}} test proc-old-30.8 {arguments and defaults} { list [catch { proc tproc {x {y y-default} z} { return [list $x $y $z] } tproc 2 3 } msg] $msg } {1 {wrong # args: should be "tproc x ?y? z"}} test proc-old-30.9 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 3 4 5 } {2 3 {4 5}} test proc-old-30.10 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 3 } {2 3 {}} test proc-old-30.11 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } tproc 2 } {2 y-default {}} test proc-old-30.12 {arguments and defaults} { proc tproc {x {y y-default} args} { return [list $x $y $args] } list [catch {tproc} msg] $msg } {1 {wrong # args: should be "tproc x ?y? ?arg ...?"}} test proc-old-4.1 {variable numbers of arguments} { proc tproc args {return $args} tproc } {} test proc-old-4.2 {variable numbers of arguments} { proc tproc args {return $args} tproc 1 2 3 4 5 6 7 8 } {1 2 3 4 5 6 7 8} test proc-old-4.3 {variable numbers of arguments} { proc tproc args {return $args} tproc 1 {2 3} {4 {5 6} {{{7}}}} 8 } {1 {2 3} {4 {5 6} {{{7}}}} 8} test proc-old-4.4 {variable numbers of arguments} { proc tproc {x y args} {return $args} tproc 1 2 3 4 5 6 7 } {3 4 5 6 7} test proc-old-4.5 {variable numbers of arguments} { proc tproc {x y args} {return $args} tproc 1 2 } {} test proc-old-4.6 {variable numbers of arguments} { proc tproc {x missing args} {return $args} list [catch {tproc 1} msg] $msg } {1 {wrong # args: should be "tproc x missing ?arg ...?"}} test proc-old-5.1 {error conditions} { list [catch {proc} msg] $msg } {1 {wrong # args: should be "proc name args body"}} test proc-old-5.2 {error conditions} { list [catch {proc tproc b} msg] $msg } {1 {wrong # args: should be "proc name args body"}} test proc-old-5.3 {error conditions} { list [catch {proc tproc b c d e} msg] $msg } {1 {wrong # args: should be "proc name args body"}} test proc-old-5.4 {error conditions} { list [catch {proc tproc \{xyz {return foo}} msg] $msg } {1 {unmatched open brace in list}} test proc-old-5.5 {error conditions} { list [catch {proc tproc {{} y} {return foo}} msg] $msg } {1 {argument with no name}} test proc-old-5.6 {error conditions} { list [catch {proc tproc {{} y} {return foo}} msg] $msg } {1 {argument with no name}} test proc-old-5.7 {error conditions} { list [catch {proc tproc {{x 1 2} y} {return foo}} msg] $msg } {1 {too many fields in argument specifier "x 1 2"}} test proc-old-5.8 {error conditions} { catch {return} } 2 proc tproc {} { set a 22 global a } test proc-old-5.10 {error conditions} { list [catch {tproc} msg] $msg } {1 {variable "a" already exists}} test proc-old-5.11 {error conditions} { catch {rename tproc {}} catch { proc tproc {x {} z} {return foo} } list [catch {tproc 1} msg] $msg } {1 {invalid command name "tproc"}} test proc-old-5.12 {error conditions} { proc tproc {} { set a 22 error "error in procedure" return } list [catch tproc msg] $msg } {1 {error in procedure}} test proc-old-5.13 {error conditions} { proc tproc {} { set a 22 error "error in procedure" return } catch tproc msg set ::errorInfo } {error in procedure while executing "error "error in procedure"" (procedure "tproc" line 3) invoked from within "tproc"} test proc-old-5.14 {error conditions} { proc tproc {} { set a 22 break return } catch tproc msg set ::errorInfo } {invoked "break" outside of a loop (procedure "tproc" line 1) invoked from within "tproc"} test proc-old-5.15 {error conditions} { proc tproc {} { set a 22 continue return } catch tproc msg set ::errorInfo } {invoked "continue" outside of a loop (procedure "tproc" line 1) invoked from within "tproc"} test proc-old-5.16 {error conditions} { proc foo args { global fooMsg set fooMsg "foo was called: $args" } proc tproc {} { set x 44 trace add var x unset foo while {$x < 100} { error "Nested error" } } set fooMsg "foo not called" list [catch tproc msg] $msg $::errorInfo $fooMsg } {1 {Nested error} {Nested error while executing "error "Nested error"" (procedure "tproc" line 5) invoked from within "tproc"} {foo was called: x {} unset}} # The tests below will really only be useful when run under Purify or # some other system that can detect accesses to freed memory... test proc-old-6.1 {procedure that redefines itself} { proc tproc {} { proc tproc {} { return 44 } return 45 } tproc } 45 test proc-old-6.2 {procedure that deletes itself} { proc tproc {} { rename tproc {} return 45 } tproc } 45 proc tproc code { return -code $code abc } test proc-old-7.1 {return with special completion code} { list [catch {tproc ok} msg] $msg } {0 abc} test proc-old-7.2 {return with special completion code} { list [catch {tproc error} msg] $msg $::errorInfo $::errorCode } {1 abc {abc while executing "tproc error"} NONE} test proc-old-7.3 {return with special completion code} { list [catch {tproc return} msg] $msg } {2 abc} test proc-old-7.4 {return with special completion code} { list [catch {tproc break} msg] $msg } {3 abc} test proc-old-7.5 {return with special completion code} { list [catch {tproc continue} msg] $msg } {4 abc} test proc-old-7.6 {return with special completion code} { list [catch {tproc -14} msg] $msg } {-14 abc} test proc-old-7.7 {return with special completion code} -body { tproc err } -returnCodes error -match glob -result {bad completion code "err": must be ok, error, return, break, continue*, or an integer} test proc-old-7.8 {return with special completion code} -body { tproc 10b } -returnCodes error -match glob -result {bad completion code "10b": must be ok, error, return, break, continue*, or an integer} test proc-old-7.9 {return with special completion code} { proc tproc2 {} { tproc return } list [catch tproc2 msg] $msg } {0 abc} test proc-old-7.10 {return with special completion code} { proc tproc2 {} { return -code error } list [catch tproc2 msg] $msg } {1 {}} test proc-old-7.11 {return with special completion code} { proc tproc2 {} { global errorCode errorInfo catch {open _bad_file_name r} msg return -code error -errorinfo $errorInfo -errorcode $errorCode $msg } set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory while executing "open _bad_file_name r" invoked from within "tproc2"} {posix enoent {no such file or directory}}} test proc-old-7.12 {return with special completion code} { proc tproc2 {} { global errorCode errorInfo catch {open _bad_file_name r} msg return -code error -errorcode $errorCode $msg } set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory while executing "tproc2"} {posix enoent {no such file or directory}}} test proc-old-7.13 {return with special completion code} { proc tproc2 {} { global errorCode errorInfo catch {open _bad_file_name r} msg return -code error -errorinfo $errorInfo $msg } set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory while executing "open _bad_file_name r" invoked from within "tproc2"} none} test proc-old-7.14 {return with special completion code} { proc tproc2 {} { global errorCode errorInfo catch {open _bad_file_name r} msg return -code error $msg } set msg [list [catch tproc2 msg] $msg $::errorInfo $::errorCode] regsub -all [file join {} _bad_file_name] $msg "_bad_file_name" msg normalizeMsg $msg } {1 {couldn't open "_bad_file_name": no such file or directory} {couldn't open "_bad_file_name": no such file or directory while executing "tproc2"} none} test proc-old-7.15 {return with special completion code} { list [catch {return -badOption foo message} msg] $msg } {2 message} test proc-old-8.1 {unset and undefined local arrays} { proc t1 {} { foreach v {xxx, yyy} { catch {unset $v} } set yyy(foo) bar } t1 } bar test proc-old-9.1 {empty command name} { catch {rename {} ""} proc t1 {args} { return } set v [t1] catch {$v} } 1 test proc-old-10.1 {ByteCode epoch change during recursive proc execution} { proc t1 x { set y 20 rename expr expr.old rename expr.old expr if {$x} then {t1 0} ;# recursive call after foo's code is invalidated return 20 } t1 1 } 20 # cleanup catch {rename t1 ""} catch {rename foo ""} ::tcltest::cleanupTests return tcl9.0.3/tests/platform.test0000644000175000017500000001104215104661341015434 0ustar sergeisergei# The file tests the tcl_platform variable and platform package. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1999 Scriptics Corporation # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcltest 2.5 source [file join [file dirname [info script]] tcltests.tcl] namespace eval ::tcl::test::platform { namespace import ::tcltest::testConstraint namespace import ::tcltest::test namespace import ::tcltest::cleanupTests # This is not how [variable] works. See TIP 276. #variable ::tcl_platform namespace upvar :: tcl_platform tcl_platform ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testCPUID [llength [info commands testcpuid]] testConstraint testlongsize [llength [info commands testlongsize]] test platform-1.0 {tcl_platform(engine)} { set tcl_platform(engine) } {Tcl} test platform-1.1 {TclpSetVariables: tcl_platform} { interp create i set result [i eval {lsort [array names tcl_platform]}] interp delete i set result } {byteOrder engine machine os osVersion pathSeparator platform pointerSize user wordSize} test platform-2.1 {tcl_platform(wordSize) indicates size of native word} testlongsize { expr {$tcl_platform(wordSize) == [testlongsize]} } {1} # On Windows/UNIX, test that the CPU ID works test platform-3.1 {CPU ID on Windows/UNIX} \ -constraints testCPUID \ -body { set cpudata [testcpuid 0] binary format iii \ [lindex $cpudata 1] \ [lindex $cpudata 3] \ [lindex $cpudata 2] } \ -match regexp \ -result {^(?:AuthenticAMD|CentaurHauls|CyrixInstead|GenuineIntel)$} # The platform package makes very few promises, but does promise that the # format of string it produces consists of two non-empty words separated by a # hyphen. package require platform test platform-4.1 {format of platform::identify result} -constraints notValgrind -match regexp -body { # [identify] may attempt to [exec] dpkg-architecture, which may not exist, # in which case fork will not be followed by exec, and valgrind will issue # "still reachable" reports. platform::identify } -result {^([^-]+-)+[^-]+$} test platform-4.2 {format of platform::generic result} -match regexp -body { platform::generic } -result {^([^-]+-)+[^-]+$} test platform-5.0 {format of platform::generic result} -setup { set old_machine $::tcl_platform(machine) set old_os $::tcl_platform(os) set old_wordsize $::tcl_platform(wordSize) set old_version $tcl_platform(osVersion) set ::tcl_platform(machine) arm set ::tcl_platform(os) Darwin set ::tcl_platform(wordSize) 8 } -body { set res {} set l {macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl} foreach v {20.0 21.0 22.0 23.0 24.0 25.0 26.0} { set ::tcl_platform(osVersion) $v set id [platform::identify] set l [linsert $l 0 [string range $id 0 end-4]-x86_64] set l [linsert $l 0 $id] lappend res $id lappend res [expr {($l eq [platform::patterns $id]) ? 1 : [platform::patterns $id]}] } set res } -cleanup { set ::tcl_platform(machine) $old_machine set ::tcl_platform(os) $old_os set ::tcl_platform(wordSize) $old_wordsize set ::tcl_platform(osVersion) $old_version unset res l old_machine old_os old_wordsize old_version } -result {macos11-arm 1 macos12-arm 1 macos13-arm 1 macos14-arm 1 macos15-arm 1 macos26-arm 1 macos27-arm 1} test platform-5.1 {format of platform::patterns macos26-x86_64} -body { platform::patterns macos26-x86_64 } -result {macos26-x86_64 macos15-x86_64 macos14-x86_64 macos13-x86_64 macos12-x86_64 macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl} test platform-5.2 {format of platform::patterns macos26-arm} -body { platform::patterns macos26-arm } -result {macos26-arm macos26-x86_64 macos15-arm macos15-x86_64 macos14-arm macos14-x86_64 macos13-arm macos13-x86_64 macos12-arm macos12-x86_64 macos11-arm macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl} # cleanup cleanupTests } namespace delete ::tcl::test::platform return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/pkgMkIndex.test0000644000175000017500000004665515104661341015673 0ustar sergeisergei# This file contains tests for the pkg_mkIndex command. # Note that the tests are limited to Tcl scripts only, there are no shared # libraries against which to test. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } set fullPkgPath [makeDirectory pkg] namespace eval pkgtest { # Namespace for procs we can discard } # pkgtest::parseArgs -- # # Parse an argument list. # # Arguments: # (optional) arguments starting with a dash are collected as # options to pkg_mkIndex and passed to pkg_mkIndex. # dirPath the directory to index # pattern0 pattern to index # ... pattern to index # patternN pattern to index # # Results: # Returns a three element list: # 0: the options # 1: the directory to index # 2: the patterns list proc pkgtest::parseArgs { args } { set options "" set argc [llength $args] for {set iarg 0} {$iarg < $argc} {incr iarg} { set a [lindex $args $iarg] if {[regexp {^-} $a]} { lappend options $a if {$a eq "-load"} { incr iarg lappend options [lindex $args $iarg] } } else { break } } set dirPath [lindex $args $iarg] incr iarg set patternList [lrange $args $iarg end] return [list $options $dirPath $patternList] } # pkgtest::parseIndex -- # # Loads a pkgIndex.tcl file, records all the calls to "package ifneeded". # # Arguments: # filePath path to the pkgIndex.tcl file. # # Results: # Returns a list, in "array set/get" format, where the keys are the package # name and version (in the form "$name:$version"), and the values the rest # of the command line. proc pkgtest::parseIndex { filePath } { # create a child interpreter, where we override "package ifneeded" set child [interp create] if {[catch { $child eval { rename package package_original proc package { args } { if {[lindex $args 0] eq "ifneeded"} { set pkg [lindex $args 1] set ver [lindex $args 2] set ::PKGS($pkg:$ver) [lindex $args 3] } else { return [package_original {*}$args] } } array set ::PKGS {} } set dir [file dirname $filePath] $child eval {set curdir [pwd]} $child eval [list cd $dir] $child eval [list set dir $dir] $child eval [list source [file tail $filePath]] $child eval {cd $curdir} # Create the list in sorted order, so that we don't get spurious # errors because the order has changed. array set P {} foreach {k v} [$child eval {array get ::PKGS}] { set P($k) $v } set PKGS "" foreach k [lsort [array names P]] { lappend PKGS $k $P($k) } } err opts]} { set ei [dict get $opts -errorinfo] set ec [dict get $opts -errorcode] catch {interp delete $child} error $ei $ec } interp delete $child return $PKGS } # pkgtest::createIndex -- # # Runs pkg_mkIndex for the given directory and set of patterns. This # procedure deletes any pkgIndex.tcl file in the target directory, then runs # pkg_mkIndex. # # Arguments: # (optional) arguments starting with a dash are collected as # options to pkg_mkIndex and passed to pkg_mkIndex. # dirPath the directory to index # pattern0 pattern to index # ... pattern to index # patternN pattern to index # # Results: # Returns a two element list: # 0: 1 if the procedure encountered an error, 0 otherwise. # 1: the error result if element 0 was 1 proc pkgtest::createIndex { args } { set parsed [parseArgs {*}$args] set options [lindex $parsed 0] set dirPath [lindex $parsed 1] set patternList [lindex $parsed 2] file mkdir $dirPath if {[catch { file delete [file join $dirPath pkgIndex.tcl] pkg_mkIndex {*}$options $dirPath {*}$patternList } err]} { return [list 1 $err] } return [list 0 {}] } # makePkgList -- # # Takes the output of a pkgtest::parseIndex call, filters it and returns a # cleaned up list of packages and their actions. # # Arguments: # inList output from a pkgtest::parseIndex. # # Results: # Returns a list of two element lists: # 0: the name:version # 1: a list describing the package. # For tclPkgSetup packages it consists of: # 0: the keyword tclPkgSetup # 1: the first file to source, with its exported procedures # 2: the second file ... # N: the N-1st file ... proc makePkgList { inList } { set pkgList "" foreach {k v} $inList { switch [lindex $v 0] { tclPkgSetup { set l tclPkgSetup foreach s [lindex $v 4] { lappend l $s } } source { set l $v } default { error "can't handle $k $v" } } lappend pkgList [list $k $l] } return $pkgList } # pkgtest::runIndex -- # # Runs pkg_mkIndex, parses the generated index file. # # Arguments: # (optional) arguments starting with a dash are collected as # options to pkg_mkIndex and passed to pkg_mkIndex. # dirPath the directory to index # pattern0 pattern to index # ... pattern to index # patternN pattern to index # # Results: # Returns a two element list: # 0: 1 if the procedure encountered an error, 0 otherwise. # 1: if no error, this is the parsed generated index file, in the format # returned by pkgtest::parseIndex. If error, this is the error result. proc pkgtest::runCreatedIndex {rv args} { if {[lindex $rv 0] == 0} { set parsed [parseArgs {*}$args] set dirPath [lindex $parsed 1] set idxFile [file join $dirPath pkgIndex.tcl] if {[catch { set result [list 0 [makePkgList [parseIndex $idxFile]]] } err]} { set result [list 1 $err] } file delete $idxFile } else { set result $rv } return $result } proc pkgtest::runIndex { args } { set rv [createIndex {*}$args] return [runCreatedIndex $rv {*}$args] } # If there is no match to the patterns, make sure the directory hasn't changed # on us test pkgMkIndex-1.1 {nothing matches pattern - current dir is the same} { list [pkgtest::runIndex -lazy $fullPkgPath nomatch.tcl] [pwd] } [list {1 {no files matched glob pattern "nomatch.tcl"}} [pwd]] makeFile { # This is a simple package, just to check basic functionality. package provide simple 1.0 namespace eval simple { namespace export lower upper } proc simple::lower { stg } { return [string tolower $stg] } proc simple::upper { stg } { return [string toupper $stg] } } [file join pkg simple.tcl] test pkgMkIndex-2.1 {simple package} { pkgtest::runIndex -lazy $fullPkgPath simple.tcl } {0 {{simple:1.0 {tclPkgSetup {simple.tcl source {::simple::lower ::simple::upper}}}}}} test pkgMkIndex-2.2 {simple package - use -direct} { pkgtest::runIndex -direct $fullPkgPath simple.tcl } "0 {{simple:1.0 {[list source [file join $fullPkgPath simple.tcl]]}}}" test pkgMkIndex-2.3 {simple package - direct loading is default} { pkgtest::runIndex $fullPkgPath simple.tcl } "0 {{simple:1.0 {[list source [file join $fullPkgPath simple.tcl]]}}}" test pkgMkIndex-2.4 {simple package - use -verbose} -body { pkgtest::runIndex -verbose $fullPkgPath simple.tcl } -result "0 {{simple:1.0 {[list source [file join $fullPkgPath simple.tcl]]}}}" \ -errorOutput {successful sourcing of simple.tcl packages provided were {simple 1.0} processed simple.tcl } removeFile [file join pkg simple.tcl] makeFile { # Contains global symbols, used to check that they don't have a leading :: package provide global 1.0 proc global_lower { stg } { return [string tolower $stg] } proc global_upper { stg } { return [string toupper $stg] } } [file join pkg global.tcl] test pkgMkIndex-3.1 {simple package with global symbols} { pkgtest::runIndex -lazy $fullPkgPath global.tcl } {0 {{global:1.0 {tclPkgSetup {global.tcl source {global_lower global_upper}}}}}} removeFile [file join pkg global.tcl] makeFile { # This package is required by pkg1. # This package is split into two files, to test packages that are split over # multiple files. package provide pkg2 1.0 namespace eval pkg2 { namespace export p2-1 } proc pkg2::p2-1 { num } { return [expr {$num * 2}] } } [file join pkg pkg2_a.tcl] makeFile { # This package is required by pkg1. # This package is split into two files, to test packages that are split over # multiple files. package provide pkg2 1.0 namespace eval pkg2 { namespace export p2-2 } proc pkg2::p2-2 { num } { return [expr {$num * 3}] } } [file join pkg pkg2_b.tcl] test pkgMkIndex-4.1 {split package} { pkgtest::runIndex -lazy $fullPkgPath pkg2_a.tcl pkg2_b.tcl } {0 {{pkg2:1.0 {tclPkgSetup {pkg2_a.tcl source ::pkg2::p2-1} {pkg2_b.tcl source ::pkg2::p2-2}}}}} test pkgMkIndex-4.2 {split package - direct loading} { pkgtest::runIndex -direct $fullPkgPath pkg2_a.tcl pkg2_b.tcl } "0 {{pkg2:1.0 {[list source [file join $fullPkgPath pkg2_a.tcl]] [list source [file join $fullPkgPath pkg2_b.tcl]]}}}" # Add the direct1 directory to auto_path, so that the direct1 package can be # found. set direct1 [makeDirectory direct1] lappend auto_path $direct1 makeFile { # This is referenced by pkgIndex.tcl as a -direct script. package provide direct1 1.0 namespace eval direct1 { namespace export pd1 pd2 } proc direct1::pd1 { stg } { return [string tolower $stg] } proc direct1::pd2 { stg } { return [string toupper $stg] } } [file join direct1 direct1.tcl] pkg_mkIndex -direct $direct1 direct1.tcl makeFile { # Does a package require of direct1, whose pkgIndex.tcl entry is created # above with option -direct. This tests that pkg_mkIndex can handle code # that is sourced in pkgIndex.tcl files. package require direct1 package provide std 1.0 namespace eval std { namespace export p1 p2 } proc std::p1 { stg } { return [string tolower $stg] } proc std::p2 { stg } { return [string toupper $stg] } } [file join pkg std.tcl] test pkgMkIndex-5.1 {requires -direct package} { pkgtest::runIndex -lazy $fullPkgPath std.tcl } {0 {{std:1.0 {tclPkgSetup {std.tcl source {::std::p1 ::std::p2}}}}}} removeFile [file join direct1 direct1.tcl] file delete [file join $direct1 pkgIndex.tcl] removeDirectory direct1 removeFile [file join pkg std.tcl] makeFile { # This package requires pkg3, but it does not use any of pkg3's procs in the # code that is executed by the file (i.e. references to pkg3's procs are in # the proc bodies only). package require pkg3 1.0 package provide pkg1 1.0 namespace eval pkg1 { namespace export p1-1 p1-2 } proc pkg1::p1-1 { num } { return [pkg3::p3-1 $num] } proc pkg1::p1-2 { num } { return [pkg3::p3-2 $num] } } [file join pkg pkg1.tcl] makeFile { package provide pkg3 1.0 namespace eval pkg3 { namespace export p3-1 p3-2 } proc pkg3::p3-1 { num } { return {[expr {$num * 2}]} } proc pkg3::p3-2 { num } { return {[expr {$num * 3}]} } } [file join pkg pkg3.tcl] test pkgMkIndex-6.1 {pkg1 requires pkg3} { pkgtest::runIndex -lazy $fullPkgPath pkg1.tcl pkg3.tcl } {0 {{pkg1:1.0 {tclPkgSetup {pkg1.tcl source {::pkg1::p1-1 ::pkg1::p1-2}}}} {pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}}}} test pkgMkIndex-6.2 {pkg1 requires pkg3 - use -direct} { pkgtest::runIndex -direct $fullPkgPath pkg1.tcl pkg3.tcl } "0 {{pkg1:1.0 {[list source [file join $fullPkgPath pkg1.tcl]]}} {pkg3:1.0 {[list source [file join $fullPkgPath pkg3.tcl]]}}}" removeFile [file join pkg pkg1.tcl] makeFile { # This package requires pkg3, and it calls a pkg3 proc in the code that is # executed by the file package require pkg3 1.0 package provide pkg4 1.0 namespace eval pkg4 { namespace export p4-1 p4-2 variable m2 [pkg3::p3-1 10] } proc pkg4::p4-1 { num } { variable m2 return [expr {$m2 * $num}] } proc pkg4::p4-2 { num } { return [pkg3::p3-2 $num] } } [file join pkg pkg4.tcl] test pkgMkIndex-7.1 {pkg4 uses pkg3} { pkgtest::runIndex -lazy $fullPkgPath pkg4.tcl pkg3.tcl } {0 {{pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}} {pkg4:1.0 {tclPkgSetup {pkg4.tcl source {::pkg4::p4-1 ::pkg4::p4-2}}}}}} test pkgMkIndex-7.2 {pkg4 uses pkg3 - use -direct} { pkgtest::runIndex -direct $fullPkgPath pkg4.tcl pkg3.tcl } "0 {{pkg3:1.0 {[list source [file join $fullPkgPath pkg3.tcl]]}} {pkg4:1.0 {[list source [file join $fullPkgPath pkg4.tcl]]}}}" removeFile [file join pkg pkg4.tcl] removeFile [file join pkg pkg3.tcl] makeFile { # This package requires pkg2, and it calls a pkg2 proc in the code that is # executed by the file. Pkg2 is a split package. package require pkg2 1.0 package provide pkg5 1.0 namespace eval pkg5 { namespace export p5-1 p5-2 variable m2 [pkg2::p2-1 10] variable m3 [pkg2::p2-2 10] } proc pkg5::p5-1 { num } { variable m2 return [expr {$m2 * $num}] } proc pkg5::p5-2 { num } { variable m2 return [expr {$m2 * $num}] } } [file join pkg pkg5.tcl] test pkgMkIndex-8.1 {pkg5 uses pkg2} { pkgtest::runIndex -lazy $fullPkgPath pkg5.tcl pkg2_a.tcl pkg2_b.tcl } {0 {{pkg2:1.0 {tclPkgSetup {pkg2_a.tcl source ::pkg2::p2-1} {pkg2_b.tcl source ::pkg2::p2-2}}} {pkg5:1.0 {tclPkgSetup {pkg5.tcl source {::pkg5::p5-1 ::pkg5::p5-2}}}}}} test pkgMkIndex-8.2 {pkg5 uses pkg2 - use -direct} { pkgtest::runIndex -direct $fullPkgPath pkg5.tcl pkg2_a.tcl pkg2_b.tcl } "0 {{pkg2:1.0 {[list source [file join $fullPkgPath pkg2_a.tcl]] [list source [file join $fullPkgPath pkg2_b.tcl]]}} {pkg5:1.0 {[list source [file join $fullPkgPath pkg5.tcl]]}}}" removeFile [file join pkg pkg5.tcl] removeFile [file join pkg pkg2_a.tcl] removeFile [file join pkg pkg2_b.tcl] makeFile { # This package requires circ2, and circ2 requires circ3, which in turn # requires circ1. In case of circularities, pkg_mkIndex should give up when # it gets stuck. package require circ2 1.0 package provide circ1 1.0 namespace eval circ1 { namespace export c1-1 c1-2 c1-3 c1-4 } proc circ1::c1-1 { num } { return [circ2::c2-1 $num] } proc circ1::c1-2 { num } { return [circ2::c2-2 $num] } proc circ1::c1-3 {} { return 10 } proc circ1::c1-4 {} { return 20 } } [file join pkg circ1.tcl] makeFile { # This package is required by circ1, and requires circ3. Circ3, in turn, # requires circ1 to give us a circularity. package require circ3 1.0 package provide circ2 1.0 namespace eval circ2 { namespace export c2-1 c2-2 } proc circ2::c2-1 { num } { return [expr {$num * [circ3::c3-1]}] } proc circ2::c2-2 { num } { return [expr {$num * [circ3::c3-2]}] } } [file join pkg circ2.tcl] makeFile { # This package is required by circ2, and in turn requires circ1. This closes # the circularity. package require circ1 1.0 package provide circ3 1.0 namespace eval circ3 { namespace export c3-1 c3-4 } proc circ3::c3-1 {} { return [circ1::c1-3] } proc circ3::c3-2 {} { return [circ1::c1-4] } } [file join pkg circ3.tcl] test pkgMkIndex-9.1 {circular packages} { pkgtest::runIndex -lazy $fullPkgPath circ1.tcl circ2.tcl circ3.tcl } {0 {{circ1:1.0 {tclPkgSetup {circ1.tcl source {::circ1::c1-1 ::circ1::c1-2 ::circ1::c1-3 ::circ1::c1-4}}}} {circ2:1.0 {tclPkgSetup {circ2.tcl source {::circ2::c2-1 ::circ2::c2-2}}}} {circ3:1.0 {tclPkgSetup {circ3.tcl source ::circ3::c3-1}}}}} removeFile [file join pkg circ1.tcl] removeFile [file join pkg circ2.tcl] removeFile [file join pkg circ3.tcl] # Some tests require the existence of one of the DLLs in the dltest directory set x [file join [file dirname [info nameofexecutable]] dltest \ tcl9pkga[info sharedlibextension]] set dll "[file tail $x]Required" testConstraint $dll [file exists $x] if {[testConstraint $dll]} { makeFile { # This package provides pkga, which is also provided by a DLL. package provide pkga 1.0 proc pkga_neq { x } { return [expr {! [pkgq_eq $x]}] } } [file join pkg pkga.tcl] file copy -force $x $fullPkgPath } testConstraint exec [llength [info commands ::exec]] test pkgMkIndex-10.1 {package in DLL and script} [list exec $dll] { # Do all [load]ing of shared libraries in another process, so we can # delete the file and not get stuck because we're holding a reference to # it. set cmd [list pkg_mkIndex -lazy $fullPkgPath [file tail $x] pkga.tcl] exec [interpreter] << $cmd pkgtest::runCreatedIndex {0 {}} -lazy $fullPkgPath tcl9pkga[info sharedlibextension] pkga.tcl } "0 {{pkga:1.0 {tclPkgSetup {tcl9pkga[info sharedlibextension] load {pkga_eq pkga_quote}} {pkga.tcl source pkga_neq}}}}" test pkgMkIndex-10.2 {package in DLL hidden by -load} [list exec $dll] { # Do all [load]ing of shared libraries in another process, so we can # delete the file and not get stuck because we're holding a reference to # it. # # This test depends on context from prior test, so repeat it. set script \ "[list pkg_mkIndex -lazy $fullPkgPath [file tail $x] pkga.tcl]" append script \n \ "[list pkg_mkIndex -lazy -load Pkg* $fullPkgPath [file tail $x]]" exec [interpreter] << $script pkgtest::runCreatedIndex {0 {}} -lazy -load Pkg* -- $fullPkgPath pkga[info sharedlibextension] } "0 {}" if {[testConstraint $dll]} { file delete -force [file join $fullPkgPath [file tail $x]] removeFile [file join pkg pkga.tcl] } # Tolerate "namespace import" at the global scope makeFile { package provide fubar 1.0 namespace eval ::fubar:: { # # export only public functions. # namespace export {[a-z]*} } proc ::fubar::foo {bar} { puts "$bar" return true } namespace import ::fubar::foo } [file join pkg import.tcl] test pkgMkIndex-11.1 {conflicting namespace imports} { pkgtest::runIndex -lazy $fullPkgPath import.tcl } {0 {{fubar:1.0 {tclPkgSetup {import.tcl source ::fubar::foo}}}}} removeFile [file join pkg import.tcl] # Verify that the auto load list generated is correct even when there is a # proc name conflict between two namespaces (ie, ::foo::baz and ::bar::baz) makeFile { package provide football 1.0 namespace eval ::pro:: { # # export only public functions. # namespace export {[a-z]*} } namespace eval ::college:: { # # export only public functions. # namespace export {[a-z]*} } proc ::pro::team {} { puts "go packers!" return true } proc ::college::team {} { puts "go badgers!" return true } } [file join pkg samename.tcl] test pkgMkIndex-12.1 {same name procs in different namespace} { pkgtest::runIndex -lazy $fullPkgPath samename.tcl } {0 {{football:1.0 {tclPkgSetup {samename.tcl source {::college::team ::pro::team}}}}}} removeFile [file join pkg samename.tcl] # Proc names with embedded spaces are properly listed (i.e. correct number of # braces) in result makeFile { package provide spacename 1.0 proc {a b} {} {} proc {c d} {} {} } [file join pkg spacename.tcl] test pkgMkIndex-13.1 {proc names with embedded spaces} { pkgtest::runIndex -lazy $fullPkgPath spacename.tcl } {0 {{spacename:1.0 {tclPkgSetup {spacename.tcl source {{a b} {c d}}}}}}} removeFile [file join pkg spacename.tcl] # Test the tcl::Pkg::CompareExtension helper function test pkgMkIndex-14.1 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo.so .so } 1 test pkgMkIndex-14.2 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo.so.bar .so } 0 test pkgMkIndex-14.3 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo.so.1 .so } 1 test pkgMkIndex-14.4 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo.so.1.2 .so } 1 test pkgMkIndex-14.5 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo .so } 0 test pkgMkIndex-14.6 {tcl::Pkg::CompareExtension} {unix} { tcl::Pkg::CompareExtension foo.so.1.2.bar .so } 0 # cleanup removeDirectory pkg namespace delete pkgtest ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/pkgIndex.tcl0000644000175000017500000000012415104661341015163 0ustar sergeisergei#! /usr/bin/env tclsh package ifneeded tcltests 0.1 [list source $dir/tcltests.tcl]tcl9.0.3/tests/pid.test0000644000175000017500000000344315104661341014372 0ustar sergeisergei# Commands covered: pid # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1995 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint pidDefined [llength [info commands pid]] test pid-1.1 {pid command} pidDefined { regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid] } 1 test pid-1.2 {pid command} -constraints {unixOrWin unixExecs pidDefined} -setup { set path(test1) [makeFile {} test1] file delete $path(test1) } -body { set f [open |[list echo foo | cat >$path(test1)] w] set pids [pid $f] close $f list [llength $pids] [regexp {^[0-9]+$} [lindex $pids 0]] \ [regexp {^[0-9]+$} [lindex $pids 1]] \ [expr {[lindex $pids 0] == [lindex $pids 1]}] } -cleanup { removeFile test1 } -result {2 1 1 0} test pid-1.3 {pid command} -constraints pidDefined -setup { set path(test1) [makeFile {} test1] file delete $path(test1) } -body { set f [open $path(test1) w] set pids [pid $f] close $f set pids } -cleanup { removeFile test1 } -result {} test pid-1.4 {pid command} pidDefined { list [catch {pid a b} msg] $msg } {1 {wrong # args: should be "pid ?channel?"}} test pid-1.5 {pid command} pidDefined { list [catch {pid gorp} msg] $msg } {1 {can not find channel named "gorp"}} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/parseOld.test0000644000175000017500000003400215104661341015362 0ustar sergeisergei# Commands covered: set (plus basic command syntax). This set # of tests is an old one that predates the parser in Tcl 8.1. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testwordend [llength [info commands testwordend]] # Save the argv value for restoration later set savedArgv $argv proc fourArgs {a b c d} { global arg1 arg2 arg3 arg4 set arg1 $a set arg2 $b set arg3 $c set arg4 $d } proc getArgs args { global argv set argv $args } # Basic argument parsing. test parseOld-1.1 {basic argument parsing} { set arg1 {} fourArgs a b c d list $arg1 $arg2 $arg3 $arg4 } {a b c d} test parseOld-1.2 {basic argument parsing} { set arg1 {} eval "fourArgs 123\v4\f56\r7890" list $arg1 $arg2 $arg3 $arg4 } {123 4 56 7890} # Quotes. test parseOld-2.1 {quotes and variable-substitution} { getArgs "a b c" d set argv } {{a b c} d} test parseOld-2.2 {quotes and variable-substitution} { set a 101 getArgs "a$a b c" set argv } {{a101 b c}} test parseOld-2.3 {quotes and variable-substitution} { set argv "xy[format xabc]" set argv } {xyxabc} test parseOld-2.4 {quotes and variable-substitution} { set argv "xy\t" set argv } xy\t test parseOld-2.5 {quotes and variable-substitution} { set argv "a b c d e f" set argv } a\ b\tc\nd\ e\ f test parseOld-2.6 {quotes and variable-substitution} { set argv a"bcd"e set argv } {a"bcd"e} # Braces. test parseOld-3.1 {braces} { getArgs {a b c} d set argv } "{a b c} d" test parseOld-3.2 {braces} { set a 101 set argv {a$a b c} set b [string index $argv 1] set b } {$} test parseOld-3.3 {braces} { set argv {a[format xyz] b} string length $argv } 15 test parseOld-3.4 {braces} { set argv {a\nb\}} string length $argv } 6 test parseOld-3.5 {braces} { set argv {{{{}}}} set argv } "{{{}}}" test parseOld-3.6 {braces} { set argv a{{}}b set argv } "a{{}}b" test parseOld-3.7 {braces} { set a [format "last]"] set a } {last]} # Command substitution. test parseOld-4.1 {command substitution} { set a [format xyz] set a } xyz test parseOld-4.2 {command substitution} { set a a[format xyz]b[format q] set a } axyzbq test parseOld-4.3 {command substitution} { set a a[ set b 22; format %s $b ]b set a } a22b test parseOld-4.4 {command substitution} { set a 7.7 if {[catch {expr {int($a)}}]} {set a foo} set a } 7.7 # Variable substitution. test parseOld-5.1 {variable substitution} { set a 123 set b $a set b } 123 test parseOld-5.2 {variable substitution} { set a 345 set b x$a.b set b } x345.b test parseOld-5.3 {variable substitution} { set _123z xx set b $_123z^ set b } xx^ test parseOld-5.4 {variable substitution} { set a 78 set b a${a}b set b } a78b test parseOld-5.5 {variable substitution} {catch {$_non_existent_} msg} 1 test parseOld-5.6 {variable substitution} { catch {$_non_existent_} msg set msg } {can't read "_non_existent_": no such variable} test parseOld-5.7 {array variable substitution} { unset -nocomplain a set a(xyz) 123 set b $a(xyz)foo set b } 123foo test parseOld-5.8 {array variable substitution} { unset -nocomplain a set "a(x y z)" 123 set b $a(x y z)foo set b } 123foo test parseOld-5.9 {array variable substitution} { unset -nocomplain a qqq set "a(x y z)" qqq set $a([format x]\ y [format z]) foo set qqq } foo test parseOld-5.10 {array variable substitution} { unset -nocomplain a list [catch {set b $a(22)} msg] $msg } {1 {can't read "a(22)": no such variable}} test parseOld-5.11 {array variable substitution} { set b a$! set b } {a$!} test parseOld-5.12 {empty array name support} { list [catch {set b a$()} msg] $msg } {1 {can't read "()": no such variable}} unset -nocomplain a test parseOld-5.13 {array variable substitution} { unset -nocomplain a set long {This is a very long variable, long enough to cause storage \ allocation to occur in Tcl_ParseVar. If that storage isn't getting \ freed up correctly, then a core leak will occur when this test is \ run. This text is probably beginning to sound like drivel, but I've \ run out of things to say and I need more characters still.} set a($long) 777 set b $a($long) list $b [array names a] } {777 {{This is a very long variable, long enough to cause storage \ allocation to occur in Tcl_ParseVar. If that storage isn't getting \ freed up correctly, then a core leak will occur when this test is \ run. This text is probably beginning to sound like drivel, but I've \ run out of things to say and I need more characters still.}}} test parseOld-5.14 {array variable substitution} { unset -nocomplain a b a1 set a1(22) foo set a(foo) bar set b $a($a1(22)) set b } bar unset -nocomplain a a1 test parseOld-7.1 {backslash substitution} { set a "\a\c\n\]\}" string length $a } 5 test parseOld-7.2 {backslash substitution} { set a {\a\c\n\]\}} string length $a } 10 test parseOld-7.3 {backslash substitution} { set a "abc\ def" set a } {abc def} test parseOld-7.4 {backslash substitution} { set a {abc\ def} set a } {abc def} test parseOld-7.5 {backslash substitution} { set msg {} set a xxx set error [catch {if {24 < \ 35} {set a 22} {set \ a 33}} msg] list $error $msg $a } {0 22 22} test parseOld-7.6 {backslash substitution} { eval "concat abc\\" } "abc\\" test parseOld-7.7 {backslash substitution} { eval "concat \\\na" } "a" test parseOld-7.8 {backslash substitution} { eval "concat x\\\n a" } "x a" test parseOld-7.9 {backslash substitution} { eval "concat \\x" } "x" test parseOld-7.10 {backslash substitution} { eval "list a b\\\nc d" } {a b c d} test parseOld-7.11 {backslash substitution} { eval "list a \"b c\"\\\nd e" } {a {b c} d e} test parseOld-7.12 {backslash substitution} { expr {[list \uA2] eq "¢"} } 1 test parseOld-7.13 {backslash substitution} { expr {[list \u4E21] eq "両"} } 1 test parseOld-7.14 {backslash substitution} { expr {[list \u4E2k] eq "Ӣk"} } 1 # Semi-colon. test parseOld-8.1 {semi-colons} { set b 0 getArgs a;set b 2 set argv } a test parseOld-8.2 {semi-colons} { set b 0 getArgs a;set b 2 set b } 2 test parseOld-8.3 {semi-colons} { getArgs a b ; set b 1 set argv } {a b} test parseOld-8.4 {semi-colons} { getArgs a b ; set b 1 set b } 1 # The following checks are to ensure that the interpreter's result # gets re-initialized by Tcl_Eval in all the right places. set a 22 test parseOld-9.1 {result initialization} {concat abc} abc test parseOld-9.2 {result initialization} {concat abc; proc foo {} {}} {} test parseOld-9.3 {result initialization} {concat abc; proc foo {} $a} {} test parseOld-9.4 {result initialization} {proc foo {} [concat abc]} {} test parseOld-9.5 {result initialization} {concat abc; } abc test parseOld-9.6 {result initialization} { eval { concat abc }} abc test parseOld-9.7 {result initialization} {} {} test parseOld-9.8 {result initialization} {concat abc; ; ;} abc # Syntax errors. test parseOld-10.1 {syntax errors} {catch "set a \{bcd" msg} 1 test parseOld-10.2 {syntax errors} { catch "set a \{bcd" msg set msg } {missing close-brace} test parseOld-10.3 {syntax errors} {catch {set a "bcd} msg} 1 test parseOld-10.4 {syntax errors} { catch {set a "bcd} msg set msg } {missing "} #" Emacs formatting >:^( test parseOld-10.5 {syntax errors} {catch {set a "bcd"xy} msg} 1 test parseOld-10.6 {syntax errors} { catch {set a "bcd"xy} msg set msg } {extra characters after close-quote} test parseOld-10.7 {syntax errors} {catch "set a {bcd}xy" msg} 1 test parseOld-10.8 {syntax errors} { catch "set a {bcd}xy" msg set msg } {extra characters after close-brace} test parseOld-10.9 {syntax errors} {catch {set a [format abc} msg} 1 test parseOld-10.10 {syntax errors} { catch {set a [format abc} msg set msg } {missing close-bracket} test parseOld-10.11 {syntax errors} {catch gorp-a-lot msg} 1 test parseOld-10.12 {syntax errors} { catch gorp-a-lot msg set msg } {invalid command name "gorp-a-lot"} test parseOld-10.13 {syntax errors} { set a [concat {a}\ {b}] set a } {a b} # The next test will fail on the Mac, 'cause the MSL uses a fixed sized # buffer for %d conversions (LAME!). I won't leave the test out, however, # since MetroWerks may some day fix this. test parseOld-10.14 {syntax errors} { list [catch {eval \$x[format "%01000d" 0](} msg] $msg $::errorInfo } {1 {missing )} {missing ) while executing "$x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000..." ("eval" body line 1) invoked from within "eval \$x[format "%01000d" 0]("}} test parseOld-10.15 {syntax errors, missplaced braces} { catch { proc misplaced_end_brace {} { set what foo set when [expr ${what}size - [set off$what]}] } msg set msg } {extra characters after close-brace} test parseOld-10.16 {syntax errors, missplaced braces} { catch { set a { set what foo set when [expr ${what}size - [set off$what]}] } msg set msg } {extra characters after close-brace} test parseOld-10.17 {syntax errors, unusual spacing} { list [catch {return [ [1]]} msg] $msg } {1 {invalid command name "1"}} # Long values (stressing storage management) set a {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH} test parseOld-11.1 {long values} { string length $a } 214 test parseOld-11.2 {long values} { llength $a } 43 test parseOld-11.3 {long values} { set b "1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH" set b } $a test parseOld-11.4 {long values} { set b "$a" set b } $a test parseOld-11.5 {long values} { set b [set a] set b } $a test parseOld-11.6 {long values} { set b [concat 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH] string length $b } 214 test parseOld-11.7 {long values} { set b [concat 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH] llength $b } 43 # Duplicate action of previous test llength [set b [concat 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH]] test parseOld-11.8 {long values} { set b } $a test parseOld-11.9 {long values} { set a [concat 0000 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH IIII JJJJ KKKK LLLL MMMM NNNN OOOO PPPP QQQQ RRRR SSSS TTTT UUUU VVVV WWWW XXXX YYYY ZZZZ] llength $a } 62 set i 0 foreach j [concat 0000 1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH IIII JJJJ KKKK LLLL MMMM NNNN OOOO PPPP QQQQ RRRR SSSS TTTT UUUU VVVV WWWW XXXX YYYY ZZZZ] { set test [string index 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ $i] set test $test$test$test$test test parseOld-11.10-[incr i] {long values} { set j } $test } test parseOld-11.11 {test buffer overflow in backslashes in braces} { expr {"a" == {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101\101}} } 0 test parseOld-12.1 {comments} { set a old eval { # set a new} set a } {old} test parseOld-12.2 {comments} { set a old eval " # set a new\nset a new" set a } {new} test parseOld-12.3 {comments} { set a old eval " # set a new\\\nset a new" set a } {old} test parseOld-12.4 {comments} { set a old eval " # set a new\\\\\nset a new" set a } {new} test parseOld-13.1 {comments at the end of a bracketed script} { set x "[ expr {1+1} # skip this! ]" } {2} test parseOld-15.1 {TclScriptEnd procedure} { info complete {puts [ expr {1+1} #this is a comment ]} } {0} test parseOld-15.2 {TclScriptEnd procedure} { info complete "abc\\\n" } {0} test parseOld-15.3 {TclScriptEnd procedure} { info complete "abc\\\\\n" } {1} test parseOld-15.4 {TclScriptEnd procedure} { info complete "xyz \[abc \{abc\]" } {0} test parseOld-15.5 {TclScriptEnd procedure} { info complete "xyz \[abc" } {0} # cleanup set argv $savedArgv ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/parseExpr.test0000644000175000017500000020172215104661341015567 0ustar sergeisergei# This file contains a collection of tests for the procedures in the # file tclCompExpr.c. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Note that the Tcl expression parser (tclCompExpr.c) does not check # the semantic validity of the expressions it parses. It does not check, # for example, that a math function actually exists, or that the operands # of "<<" are integers. testConstraint testexprparser [llength [info commands testexprparser]] testConstraint testbytestring [llength [info commands testbytestring]] # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] ###################################################################### test parseExpr-1.1 {Tcl_ParseExpr procedure, computing string length} {testexprparser testbytestring} { testexprparser [testbytestring "1+2\x00 +3"] -1 } {- {} 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-1.2 {Tcl_ParseExpr procedure, computing string length} testexprparser { testexprparser "1 + 2" -1 } {- {} 0 subexpr {1 + 2} 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-1.3 {Tcl_ParseExpr procedure, error getting initial lexeme} testexprparser { testexprparser 12345678901234567890 -1 } {- {} 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-1.4 {Tcl_ParseExpr procedure, error in conditional expression} \ -constraints testexprparser -body { testexprparser {foo+} -1 } -match glob -returnCodes error -result * test parseExpr-1.5 {Tcl_ParseExpr procedure, lexemes after the expression} -constraints testexprparser -body { testexprparser {1+2 345} -1 } -returnCodes error -match glob -result * test parseExpr-2.1 {ParseCondExpr procedure, valid test subexpr} testexprparser { testexprparser {2>3? 1 : 0} -1 } {- {} 0 subexpr {2>3? 1 : 0} 11 operator ? 0 subexpr 2>3 5 operator > 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-2.2 {ParseCondExpr procedure, error in test subexpr} \ -constraints testexprparser -body { testexprparser {0 || foo} -1 } -match glob -returnCodes error -result * test parseExpr-2.3 {ParseCondExpr procedure, next lexeme isn't "?"} testexprparser { testexprparser {1+2} -1 } {- {} 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-2.4 {ParseCondExpr procedure, next lexeme is "?"} testexprparser { testexprparser {1+2 ? 3 : 4} -1 } {- {} 0 subexpr {1+2 ? 3 : 4} 11 operator ? 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-2.5 {ParseCondExpr procedure, bad lexeme after "?"} testexprparser { testexprparser {1+2 ? 12345678901234567890 : 0} -1 } {- {} 0 subexpr {1+2 ? 12345678901234567890 : 0} 11 operator ? 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 subexpr 0 1 text 0 0 {}} test parseExpr-2.6 {ParseCondExpr procedure, valid "then" subexpression} testexprparser { testexprparser {1? 3 : 4} -1 } {- {} 0 subexpr {1? 3 : 4} 7 operator ? 0 subexpr 1 1 text 1 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-2.7 {ParseCondExpr procedure, error in "then" subexpression} \ -constraints testexprparser -body { testexprparser {1? fred : martha} -1 } -match glob -returnCodes error -result * test parseExpr-2.8 {ParseCondExpr procedure, lexeme after "then" subexpr isn't ":"} -constraints testexprparser -body { testexprparser {1? 2 martha 3} -1 } -returnCodes error -match glob -result * test parseExpr-2.9 {ParseCondExpr procedure, valid "else" subexpression} testexprparser { testexprparser {27||3? 3 : 4&&9} -1 } {- {} 0 subexpr {27||3? 3 : 4&&9} 15 operator ? 0 subexpr 27||3 5 operator || 0 subexpr 27 1 text 27 0 subexpr 3 1 text 3 0 subexpr 3 1 text 3 0 subexpr 4&&9 5 operator && 0 subexpr 4 1 text 4 0 subexpr 9 1 text 9 0 {}} test parseExpr-2.10 {ParseCondExpr procedure, error in "else" subexpression} \ -constraints testexprparser -body { testexprparser {1? 2 : martha} -1 } -match glob -returnCodes error -result * test parseExpr-3.1 {ParseLorExpr procedure, valid logical and subexpr} testexprparser { testexprparser {1&&2 || 3} -1 } {- {} 0 subexpr {1&&2 || 3} 9 operator || 0 subexpr 1&&2 5 operator && 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-3.2 {ParseLorExpr procedure, error in logical and subexpr} \ -constraints testexprparser -body { testexprparser {1&&foo || 3} -1 } -match glob -returnCodes error -result * test parseExpr-3.3 {ParseLorExpr procedure, next lexeme isn't "||"} testexprparser { testexprparser {1&&2? 1 : 0} -1 } {- {} 0 subexpr {1&&2? 1 : 0} 11 operator ? 0 subexpr 1&&2 5 operator && 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-3.4 {ParseLorExpr procedure, next lexeme is "||"} testexprparser { testexprparser {1&&2 || 3} -1 } {- {} 0 subexpr {1&&2 || 3} 9 operator || 0 subexpr 1&&2 5 operator && 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-3.5 {ParseLorExpr procedure, bad lexeme after "||"} testexprparser { testexprparser {1&&2 || 12345678901234567890} -1 } {- {} 0 subexpr {1&&2 || 12345678901234567890} 9 operator || 0 subexpr 1&&2 5 operator && 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-3.6 {ParseLorExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1&&2 || 3 || 4} -1 } {- {} 0 subexpr {1&&2 || 3 || 4} 13 operator || 0 subexpr {1&&2 || 3} 9 operator || 0 subexpr 1&&2 5 operator && 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-3.7 {ParseLorExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1&&2 || 3 || martha} -1 } -match glob -returnCodes error -result * test parseExpr-4.1 {ParseLandExpr procedure, valid LHS "|" subexpr} testexprparser { testexprparser {1|2 && 3} -1 } {- {} 0 subexpr {1|2 && 3} 9 operator && 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-4.2 {ParseLandExpr procedure, error in LHS "|" subexpr} \ -constraints testexprparser -body { testexprparser {1&&foo && 3} -1 } -match glob -returnCodes error -result * test parseExpr-4.3 {ParseLandExpr procedure, next lexeme isn't "&&"} testexprparser { testexprparser {1|2? 1 : 0} -1 } {- {} 0 subexpr {1|2? 1 : 0} 11 operator ? 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-4.4 {ParseLandExpr procedure, next lexeme is "&&"} testexprparser { testexprparser {1|2 && 3} -1 } {- {} 0 subexpr {1|2 && 3} 9 operator && 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-4.5 {ParseLandExpr procedure, bad lexeme after "&&"} testexprparser { testexprparser {1|2 && 12345678901234567890} -1 } {- {} 0 subexpr {1|2 && 12345678901234567890} 9 operator && 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-4.6 {ParseLandExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1|2 && 3 && 4} -1 } {- {} 0 subexpr {1|2 && 3 && 4} 13 operator && 0 subexpr {1|2 && 3} 9 operator && 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-4.7 {ParseLandExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1|2 && 3 && martha} -1 } -match glob -returnCodes error -result * test parseExpr-5.1 {ParseBitOrExpr procedure, valid LHS "^" subexpr} testexprparser { testexprparser {1^2 | 3} -1 } {- {} 0 subexpr {1^2 | 3} 9 operator | 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-5.2 {ParseBitOrExpr procedure, error in LHS "^" subexpr} \ -constraints testexprparser -body { testexprparser {1|foo | 3} -1 } -match glob -returnCodes error -result * test parseExpr-5.3 {ParseBitOrExpr procedure, next lexeme isn't "|"} testexprparser { testexprparser {1^2? 1 : 0} -1 } {- {} 0 subexpr {1^2? 1 : 0} 11 operator ? 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-5.4 {ParseBitOrExpr procedure, next lexeme is "|"} testexprparser { testexprparser {1^2 | 3} -1 } {- {} 0 subexpr {1^2 | 3} 9 operator | 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-5.5 {ParseBitOrExpr procedure, bad lexeme after "|"} testexprparser { testexprparser {1^2 | 12345678901234567890} -1 } {- {} 0 subexpr {1^2 | 12345678901234567890} 9 operator | 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-5.6 {ParseBitOrExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1^2 | 3 | 4} -1 } {- {} 0 subexpr {1^2 | 3 | 4} 13 operator | 0 subexpr {1^2 | 3} 9 operator | 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-5.7 {ParseBitOrExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1^2 | 3 | martha} -1 } -match glob -returnCodes error -result * test parseExpr-6.1 {ParseBitXorExpr procedure, valid LHS "&" subexpr} testexprparser { testexprparser {1&2 ^ 3} -1 } {- {} 0 subexpr {1&2 ^ 3} 9 operator ^ 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-6.2 {ParseBitXorExpr procedure, error in LHS "&" subexpr} \ -constraints testexprparser -body { testexprparser {1^foo ^ 3} -1 } -match glob -returnCodes error -result * test parseExpr-6.3 {ParseBitXorExpr procedure, next lexeme isn't "^"} testexprparser { testexprparser {1&2? 1 : 0} -1 } {- {} 0 subexpr {1&2? 1 : 0} 11 operator ? 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-6.4 {ParseBitXorExpr procedure, next lexeme is "^"} testexprparser { testexprparser {1&2 ^ 3} -1 } {- {} 0 subexpr {1&2 ^ 3} 9 operator ^ 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-6.5 {ParseBitXorExpr procedure, bad lexeme after "^"} testexprparser { testexprparser {1&2 ^ 12345678901234567890} -1 } {- {} 0 subexpr {1&2 ^ 12345678901234567890} 9 operator ^ 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-6.6 {ParseBitXorExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1&2 ^ 3 ^ 4} -1 } {- {} 0 subexpr {1&2 ^ 3 ^ 4} 13 operator ^ 0 subexpr {1&2 ^ 3} 9 operator ^ 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-6.7 {ParseBitXorExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1&2 ^ 3 ^ martha} -1 } -match glob -returnCodes error -result * test parseExpr-7.1 {ParseBitAndExpr procedure, valid LHS equality subexpr} testexprparser { testexprparser {1==2 & 3} -1 } {- {} 0 subexpr {1==2 & 3} 9 operator & 0 subexpr 1==2 5 operator == 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-7.2 {ParseBitAndExpr procedure, error in LHS equality subexpr} \ -constraints testexprparser -body { testexprparser {1!=foo & 3} -1 } -match glob -returnCodes error -result * test parseExpr-7.3 {ParseBitAndExpr procedure, next lexeme isn't "&"} testexprparser { testexprparser {1==2? 1 : 0} -1 } {- {} 0 subexpr {1==2? 1 : 0} 11 operator ? 0 subexpr 1==2 5 operator == 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-7.4 {ParseBitAndExpr procedure, next lexeme is "&"} testexprparser { testexprparser {1>2 & 3} -1 } {- {} 0 subexpr {1>2 & 3} 9 operator & 0 subexpr 1>2 5 operator > 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-7.5 {ParseBitAndExpr procedure, bad lexeme after "&"} {testexprparser} { testexprparser {1==2 & 12345678901234567890} -1 } {- {} 0 subexpr {1==2 & 12345678901234567890} 9 operator & 0 subexpr 1==2 5 operator == 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-7.6 {ParseBitAndExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1<2 & 3 & 4} -1 } {- {} 0 subexpr {1<2 & 3 & 4} 13 operator & 0 subexpr {1<2 & 3} 9 operator & 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-7.7 {ParseBitAndExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1==2 & 3>2 & martha} -1 } -match glob -returnCodes error -result * test parseExpr-8.1 {ParseEqualityExpr procedure, valid LHS relational subexpr} testexprparser { testexprparser {1<2 == 3} -1 } {- {} 0 subexpr {1<2 == 3} 9 operator == 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-8.2 {ParseEqualityExpr procedure, error in LHS relational subexpr} \ -constraints testexprparser -body { testexprparser {1>=foo == 3} -1 } -match glob -returnCodes error -result * test parseExpr-8.3 {ParseEqualityExpr procedure, next lexeme isn't "==" or "!="} testexprparser { testexprparser {1<2? 1 : 0} -1 } {- {} 0 subexpr {1<2? 1 : 0} 11 operator ? 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-8.4 {ParseEqualityExpr procedure, next lexeme is "==" or "!="} testexprparser { testexprparser {1<2 == 3} -1 } {- {} 0 subexpr {1<2 == 3} 9 operator == 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-8.5 {ParseEqualityExpr procedure, next lexeme is "==" or "!="} testexprparser { testexprparser {1<2 != 3} -1 } {- {} 0 subexpr {1<2 != 3} 9 operator != 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-8.6 {ParseEqualityExpr procedure, bad lexeme after "==" or "!="} testexprparser { testexprparser {1<2 == 12345678901234567890} -1 } {- {} 0 subexpr {1<2 == 12345678901234567890} 9 operator == 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-8.7 {ParseEqualityExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1<2 == 3 == 4} -1 } {- {} 0 subexpr {1<2 == 3 == 4} 13 operator == 0 subexpr {1<2 == 3} 9 operator == 0 subexpr 1<2 5 operator < 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-8.8 {ParseEqualityExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1<2 == 3 != martha} -1 } -match glob -returnCodes error -result * test parseExpr-9.1 {ParseRelationalExpr procedure, valid LHS shift subexpr} testexprparser { testexprparser {1<<2 < 3} -1 } {- {} 0 subexpr {1<<2 < 3} 9 operator < 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-9.2 {ParseRelationalExpr procedure, error in LHS shift subexpr} \ -constraints testexprparser -body { testexprparser {1>=foo < 3} -1 } -match glob -returnCodes error -result * test parseExpr-9.3 {ParseRelationalExpr procedure, next lexeme isn't relational op} testexprparser { testexprparser {1<<2? 1 : 0} -1 } {- {} 0 subexpr {1<<2? 1 : 0} 11 operator ? 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-9.4 {ParseRelationalExpr procedure, next lexeme is relational op} testexprparser { testexprparser {1<<2 < 3} -1 } {- {} 0 subexpr {1<<2 < 3} 9 operator < 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-9.5 {ParseRelationalExpr procedure, next lexeme is relational op} testexprparser { testexprparser {1>>2 > 3} -1 } {- {} 0 subexpr {1>>2 > 3} 9 operator > 0 subexpr 1>>2 5 operator >> 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-9.6 {ParseRelationalExpr procedure, next lexeme is relational op} testexprparser { testexprparser {1<<2 <= 3} -1 } {- {} 0 subexpr {1<<2 <= 3} 9 operator <= 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-9.7 {ParseRelationalExpr procedure, next lexeme is relational op} testexprparser { testexprparser {1<<2 >= 3} -1 } {- {} 0 subexpr {1<<2 >= 3} 9 operator >= 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-9.8 {ParseRelationalExpr procedure, bad lexeme after relational op} testexprparser { testexprparser {1<<2 < 12345678901234567890} -1 } {- {} 0 subexpr {1<<2 < 12345678901234567890} 9 operator < 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-9.9 {ParseRelationalExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1<<2 < 3 < 4} -1 } {- {} 0 subexpr {1<<2 < 3 < 4} 13 operator < 0 subexpr {1<<2 < 3} 9 operator < 0 subexpr 1<<2 5 operator << 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-9.10 {ParseRelationalExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1<<2 < 3 > martha} -1 } -match glob -returnCodes error -result * test parseExpr-10.1 {ParseShiftExpr procedure, valid LHS add subexpr} testexprparser { testexprparser {1+2 << 3} -1 } {- {} 0 subexpr {1+2 << 3} 9 operator << 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-10.2 {ParseShiftExpr procedure, error in LHS add subexpr} \ -constraints testexprparser -body { testexprparser {1-foo << 3} -1 } -match glob -returnCodes error -result * test parseExpr-10.3 {ParseShiftExpr procedure, next lexeme isn't "<<" or ">>"} testexprparser { testexprparser {1+2? 1 : 0} -1 } {- {} 0 subexpr {1+2? 1 : 0} 11 operator ? 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-10.4 {ParseShiftExpr procedure, next lexeme is "<<" or ">>"} testexprparser { testexprparser {1+2 << 3} -1 } {- {} 0 subexpr {1+2 << 3} 9 operator << 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-10.5 {ParseShiftExpr procedure, next lexeme is "<<" or ">>"} testexprparser { testexprparser {1+2 >> 3} -1 } {- {} 0 subexpr {1+2 >> 3} 9 operator >> 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-10.6 {ParseShiftExpr procedure, bad lexeme after "<<" or ">>"} testexprparser { testexprparser {1+2 << 12345678901234567890} -1 } {- {} 0 subexpr {1+2 << 12345678901234567890} 9 operator << 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-10.7 {ParseShiftExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1+2 << 3 << 4} -1 } {- {} 0 subexpr {1+2 << 3 << 4} 13 operator << 0 subexpr {1+2 << 3} 9 operator << 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-10.8 {ParseShiftExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1+2 << 3 >> martha} -1 } -match glob -returnCodes error -result * test parseExpr-11.1 {ParseAddExpr procedure, valid LHS multiply subexpr} testexprparser { testexprparser {1*2 + 3} -1 } {- {} 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-11.2 {ParseAddExpr procedure, error in LHS multiply subexpr} \ -constraints testexprparser -body { testexprparser {1/foo + 3} -1 } -match glob -returnCodes error -result * test parseExpr-11.3 {ParseAddExpr procedure, next lexeme isn't "+" or "-"} testexprparser { testexprparser {1*2? 1 : 0} -1 } {- {} 0 subexpr {1*2? 1 : 0} 11 operator ? 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-11.4 {ParseAddExpr procedure, next lexeme is "+" or "-"} testexprparser { testexprparser {1*2 + 3} -1 } {- {} 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-11.5 {ParseAddExpr procedure, next lexeme is "+" or "-"} testexprparser { testexprparser {1*2 - 3} -1 } {- {} 0 subexpr {1*2 - 3} 9 operator - 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-11.6 {ParseAddExpr procedure, bad lexeme after "+" or "-"} testexprparser { testexprparser {1*2 + 12345678901234567890} -1 } {- {} 0 subexpr {1*2 + 12345678901234567890} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-11.7 {ParseAddExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1*2 + 3 + 4} -1 } {- {} 0 subexpr {1*2 + 3 + 4} 13 operator + 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-11.8 {ParseAddExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1*2 + 3 - martha} -1 } -match glob -returnCodes error -result * test parseExpr-12.1 {ParseAddExpr procedure, valid LHS multiply subexpr} testexprparser { testexprparser {1*2 + 3} -1 } {- {} 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-12.2 {ParseAddExpr procedure, error in LHS multiply subexpr} \ -constraints testexprparser -body { testexprparser {1/foo + 3} -1 } -match glob -returnCodes error -result * test parseExpr-12.3 {ParseAddExpr procedure, next lexeme isn't "+" or "-"} testexprparser { testexprparser {1*2? 1 : 0} -1 } {- {} 0 subexpr {1*2? 1 : 0} 11 operator ? 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-12.4 {ParseAddExpr procedure, next lexeme is "+" or "-"} testexprparser { testexprparser {1*2 + 3} -1 } {- {} 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-12.5 {ParseAddExpr procedure, next lexeme is "+" or "-"} testexprparser { testexprparser {1*2 - 3} -1 } {- {} 0 subexpr {1*2 - 3} 9 operator - 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-12.6 {ParseAddExpr procedure, bad lexeme after "+" or "-"} testexprparser { testexprparser {1*2 + 12345678901234567890} -1 } {- {} 0 subexpr {1*2 + 12345678901234567890} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-12.7 {ParseAddExpr procedure, valid RHS subexpression} testexprparser { testexprparser {1*2 + 3 + 4} -1 } {- {} 0 subexpr {1*2 + 3 + 4} 13 operator + 0 subexpr {1*2 + 3} 9 operator + 0 subexpr 1*2 5 operator * 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-12.8 {ParseAddExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {1*2 + 3 - martha} -1 } -match glob -returnCodes error -result * test parseExpr-13.1 {ParseMultiplyExpr procedure, valid LHS unary subexpr} testexprparser { testexprparser {+2 * 3} -1 } {- {} 0 subexpr {+2 * 3} 7 operator * 0 subexpr +2 3 operator + 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-13.2 {ParseMultiplyExpr procedure, error in LHS unary subexpr} testexprparser { testexprparser {-12345678901234567890 * 3} -1 } {- {} 0 subexpr {-12345678901234567890 * 3} 7 operator * 0 subexpr -12345678901234567890 3 operator - 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 subexpr 3 1 text 3 0 {}} test parseExpr-13.3 {ParseMultiplyExpr procedure, next lexeme isn't "*", "/", or "%"} testexprparser { testexprparser {+2? 1 : 0} -1 } {- {} 0 subexpr {+2? 1 : 0} 9 operator ? 0 subexpr +2 3 operator + 0 subexpr 2 1 text 2 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-13.4 {ParseMultiplyExpr procedure, next lexeme is "*", "/", or "%"} testexprparser { testexprparser {-123 * 3} -1 } {- {} 0 subexpr {-123 * 3} 7 operator * 0 subexpr -123 3 operator - 0 subexpr 123 1 text 123 0 subexpr 3 1 text 3 0 {}} test parseExpr-13.5 {ParseMultiplyExpr procedure, next lexeme is "*", "/", or "%"} testexprparser { testexprparser {+-456 / 3} -1 } {- {} 0 subexpr {+-456 / 3} 9 operator / 0 subexpr +-456 5 operator + 0 subexpr -456 3 operator - 0 subexpr 456 1 text 456 0 subexpr 3 1 text 3 0 {}} test parseExpr-13.6 {ParseMultiplyExpr procedure, next lexeme is "*", "/", or "%"} testexprparser { testexprparser {+-456 % 3} -1 } {- {} 0 subexpr {+-456 % 3} 9 operator % 0 subexpr +-456 5 operator + 0 subexpr -456 3 operator - 0 subexpr 456 1 text 456 0 subexpr 3 1 text 3 0 {}} test parseExpr-13.7 {ParseMultiplyExpr procedure, bad lexeme after "*", "/", or "%"} testexprparser { testexprparser {--++5 / 12345678901234567890} -1 } {- {} 0 subexpr {--++5 / 12345678901234567890} 13 operator / 0 subexpr --++5 9 operator - 0 subexpr -++5 7 operator - 0 subexpr ++5 5 operator + 0 subexpr +5 3 operator + 0 subexpr 5 1 text 5 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-13.8 {ParseMultiplyExpr procedure, valid RHS subexpression} testexprparser { testexprparser {-2 / 3 % 4} -1 } {- {} 0 subexpr {-2 / 3 % 4} 11 operator % 0 subexpr {-2 / 3} 7 operator / 0 subexpr -2 3 operator - 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 subexpr 4 1 text 4 0 {}} test parseExpr-13.9 {ParseMultiplyExpr procedure, error in RHS subexpression} \ -constraints testexprparser -body { testexprparser {++2 / 3 * martha} -1 } -match glob -returnCodes error -result * test parseExpr-14.1 {ParseUnaryExpr procedure, first token is unary operator} testexprparser { testexprparser {+2} -1 } {- {} 0 subexpr +2 3 operator + 0 subexpr 2 1 text 2 0 {}} test parseExpr-14.2 {ParseUnaryExpr procedure, first token is unary operator} testexprparser { testexprparser {-2} -1 } {- {} 0 subexpr -2 3 operator - 0 subexpr 2 1 text 2 0 {}} test parseExpr-14.3 {ParseUnaryExpr procedure, first token is unary operator} testexprparser { testexprparser {~2} -1 } {- {} 0 subexpr ~2 3 operator ~ 0 subexpr 2 1 text 2 0 {}} test parseExpr-14.4 {ParseUnaryExpr procedure, first token is unary operator} testexprparser { testexprparser {!2} -1 } {- {} 0 subexpr !2 3 operator ! 0 subexpr 2 1 text 2 0 {}} test parseExpr-14.5 {ParseUnaryExpr procedure, error in lexeme after unary op} testexprparser { testexprparser {-12345678901234567890} -1 } {- {} 0 subexpr -12345678901234567890 3 operator - 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-14.6 {ParseUnaryExpr procedure, simple unary expr after unary op} testexprparser { testexprparser {+"1234"} -1 } {- {} 0 subexpr +\"1234\" 3 operator + 0 subexpr {"1234"} 1 text 1234 0 {}} test parseExpr-14.7 {ParseUnaryExpr procedure, another unary expr after unary op} testexprparser { testexprparser {~!{fred}} -1 } {- {} 0 subexpr ~!{fred} 5 operator ~ 0 subexpr !{fred} 3 operator ! 0 subexpr {{fred}} 1 text fred 0 {}} test parseExpr-14.8 {ParseUnaryExpr procedure, error in unary expr after unary op} -constraints testexprparser -body { testexprparser {+-||27} -1 } -returnCodes error -match glob -result * test parseExpr-14.9 {ParseUnaryExpr procedure, error in unary expr after unary op} -constraints testexprparser -body { testexprparser {+-||27} -1 } -returnCodes error -match glob -result * test parseExpr-14.10 {ParseUnaryExpr procedure, first token is not unary op} testexprparser { testexprparser {123} -1 } {- {} 0 subexpr 123 1 text 123 0 {}} test parseExpr-14.11 {ParseUnaryExpr procedure, not unary expr, complex primary expr} testexprparser { testexprparser {(1+2)} -1 } {- {} 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-14.12 {ParseUnaryExpr procedure, not unary expr, error in primary expr} testexprparser { testexprparser {(12345678901234567890)} -1 } {- {} 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-15.1 {ParsePrimaryExpr procedure, just parenthesized subexpr} testexprparser { testexprparser {({abc}/{def})} -1 } {- {} 0 subexpr {{abc}/{def}} 5 operator / 0 subexpr {{abc}} 1 text abc 0 subexpr {{def}} 1 text def 0 {}} test parseExpr-15.2 {ParsePrimaryExpr procedure, bad lexeme after "("} {testexprparser} { testexprparser {(12345678901234567890)} -1 } {- {} 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-15.3 {ParsePrimaryExpr procedure, valid parenthesized subexpr} testexprparser { testexprparser {({abc}? 2*4 : -6)} -1 } {- {} 0 subexpr {{abc}? 2*4 : -6} 13 operator ? 0 subexpr {{abc}} 1 text abc 0 subexpr 2*4 5 operator * 0 subexpr 2 1 text 2 0 subexpr 4 1 text 4 0 subexpr -6 3 operator - 0 subexpr 6 1 text 6 0 {}} test parseExpr-15.4 {ParsePrimaryExpr procedure, error in parenthesized subexpr} -constraints testexprparser -body { testexprparser {(? 123 : 456)} -1 } -returnCodes error -match glob -result * test parseExpr-15.5 {ParsePrimaryExpr procedure, missing ")" after in parenthesized subexpr} -constraints testexprparser -body { testexprparser {({abc}/{def}} -1 } -returnCodes error -match glob -result * test parseExpr-15.6 {ParsePrimaryExpr procedure, primary is literal} testexprparser { testexprparser {12345} -1 } {- {} 0 subexpr 12345 1 text 12345 0 {}} test parseExpr-15.7 {ParsePrimaryExpr procedure, primary is literal} testexprparser { testexprparser {12345.6789} -1 } {- {} 0 subexpr 12345.6789 1 text 12345.6789 0 {}} test parseExpr-15.8 {ParsePrimaryExpr procedure, primary is var reference} testexprparser { testexprparser {$a} -1 } {- {} 0 subexpr {$a} 2 variable {$a} 1 text a 0 {}} test parseExpr-15.9 {ParsePrimaryExpr procedure, primary is var reference} testexprparser { testexprparser {$a(hello$there)} -1 } {- {} 0 subexpr {$a(hello$there)} 5 variable {$a(hello$there)} 4 text a 0 text hello 0 variable {$there} 1 text there 0 {}} test parseExpr-15.10 {ParsePrimaryExpr procedure, primary is var reference} testexprparser { testexprparser {$a()} -1 } {- {} 0 subexpr {$a()} 3 variable {$a()} 2 text a 0 text {} 0 {}} test parseExpr-15.11 {ParsePrimaryExpr procedure, error in var reference} -constraints testexprparser -body { testexprparser {$a(} -1 } -returnCodes error -match glob -result * test parseExpr-15.12 {ParsePrimaryExpr procedure, primary is quoted string} testexprparser { testexprparser {"abc $xyz def"} -1 } {- {} 0 subexpr {"abc $xyz def"} 5 word {"abc $xyz def"} 4 text {abc } 0 variable {$xyz} 1 text xyz 0 text { def} 0 {}} test parseExpr-15.13 {ParsePrimaryExpr procedure, error in quoted string} -constraints testexprparser -body { testexprparser {"$a(12"} -1 } -returnCodes error -match glob -result * test parseExpr-15.14 {ParsePrimaryExpr procedure, quoted string has multiple tokens} testexprparser { testexprparser {"abc [xyz] $def"} -1 } {- {} 0 subexpr {"abc [xyz] $def"} 6 word {"abc [xyz] $def"} 5 text {abc } 0 command {[xyz]} 0 text { } 0 variable {$def} 1 text def 0 {}} test parseExpr-15.15 {ParsePrimaryExpr procedure, primary is command} testexprparser { testexprparser {[def]} -1 } {- {} 0 subexpr {[def]} 1 command {[def]} 0 {}} test parseExpr-15.16 {ParsePrimaryExpr procedure, primary is multiple commands} testexprparser { testexprparser {[one; two; three; four;]} -1 } {- {} 0 subexpr {[one; two; three; four;]} 1 command {[one; two; three; four;]} 0 {}} test parseExpr-15.17 {ParsePrimaryExpr procedure, primary is multiple commands} testexprparser { testexprparser {[one; two; three; four;]} -1 } {- {} 0 subexpr {[one; two; three; four;]} 1 command {[one; two; three; four;]} 0 {}} test parseExpr-15.18 {ParsePrimaryExpr procedure, missing close bracket} -constraints testexprparser -body { testexprparser {[one} -1 } -returnCodes error -match glob -result * test parseExpr-15.19 {ParsePrimaryExpr procedure, primary is braced string} testexprparser { testexprparser {{hello world}} -1 } {- {} 0 subexpr {{hello world}} 1 text {hello world} 0 {}} test parseExpr-15.20 {ParsePrimaryExpr procedure, error in primary, which is braced string} -constraints testexprparser -body { testexprparser "\{abc\\\n" -1 } -returnCodes error -match glob -result * test parseExpr-15.21 {ParsePrimaryExpr procedure, primary is braced string with multiple tokens} testexprparser { testexprparser "\{ \\ +123 \}" -1 } {- {} 0 subexpr \{\ \ \\\n\ +123\ \} 4 word \{\ \ \\\n\ +123\ \} 3 text { } 0 backslash \\\n\ 0 text {+123 } 0 {}} test parseExpr-15.22 {ParsePrimaryExpr procedure, primary is function call} testexprparser { testexprparser {foo(123)} -1 } {- {} 0 subexpr foo(123) 3 operator foo 0 subexpr 123 1 text 123 0 {}} test parseExpr-15.23 {ParsePrimaryExpr procedure, bad lexeme after function name} -constraints testexprparser -body { testexprparser {foo 12345678901234567890 123)} -1 } -returnCodes error -match glob -result * test parseExpr-15.24 {ParsePrimaryExpr procedure, lexeme after function name isn't "("} \ -constraints testexprparser -body { testexprparser {foo 27.4 123)} -1 } -match glob -returnCodes error -result * test parseExpr-15.25 {ParsePrimaryExpr procedure, bad lexeme after "("} testexprparser { testexprparser {foo(12345678901234567890)} -1 } {- {} 0 subexpr foo(12345678901234567890) 3 operator foo 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-15.26 {ParsePrimaryExpr procedure, function call, one arg} testexprparser { testexprparser {foo(27*4)} -1 } {- {} 0 subexpr foo(27*4) 7 operator foo 0 subexpr 27*4 5 operator * 0 subexpr 27 1 text 27 0 subexpr 4 1 text 4 0 {}} test parseExpr-15.27 {ParsePrimaryExpr procedure, error in function arg} -constraints testexprparser -body { testexprparser {foo(*1-2)} -1 } -returnCodes error -match glob -result * test parseExpr-15.28 {ParsePrimaryExpr procedure, error in function arg} -constraints testexprparser -body { testexprparser {foo(*1-2)} -1 } -returnCodes error -match glob -result * test parseExpr-15.29 {ParsePrimaryExpr procedure, function call, comma after arg} testexprparser { testexprparser {foo(27-2, (-2*[foo]))} -1 } {- {} 0 subexpr {foo(27-2, (-2*[foo]))} 15 operator foo 0 subexpr 27-2 5 operator - 0 subexpr 27 1 text 27 0 subexpr 2 1 text 2 0 subexpr {-2*[foo]} 7 operator * 0 subexpr -2 3 operator - 0 subexpr 2 1 text 2 0 subexpr {[foo]} 1 command {[foo]} 0 {}} test parseExpr-15.30 {ParsePrimaryExpr procedure, bad lexeme after comma} testexprparser { testexprparser {foo(123, 12345678901234567890)} -1 } {- {} 0 subexpr {foo(123, 12345678901234567890)} 5 operator foo 0 subexpr 123 1 text 123 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-15.31 {ParsePrimaryExpr procedure, lexeme not "," or ")" after arg} -constraints testexprparser -body { testexprparser {foo(123 [foo])} -1 } -returnCodes error -match glob -result * test parseExpr-15.32 {ParsePrimaryExpr procedure, bad lexeme after primary} -constraints testexprparser -body { testexprparser {123 12345678901234567890} -1 } -returnCodes error -match glob -result * test parseExpr-15.33 {ParsePrimaryExpr procedure, comma-specific message} -constraints testexprparser -body { testexprparser {123+,456} -1 } -returnCodes error -match glob -result * test parseExpr-15.34 {ParsePrimaryExpr procedure, single equal-specific message} -constraints testexprparser -body { testexprparser {123+=456} -1 } -returnCodes error -match glob -result * test parseExpr-15.35 {ParsePrimaryExpr procedure, error in parenthesized subexpr} -constraints testexprparser -body { testexprparser {(: 123 : 456)} -1 } -returnCodes error -match glob -result * test parseExpr-15.36 {ParsePrimaryExpr procedure, missing close-bracket} -constraints testexprparser -body { # Test for Bug 681841 testexprparser {[set a [format bc]} -1 } -returnCodes error -match glob -result * test parseExpr-16.1 {GetLexeme procedure, whitespace before lexeme} testexprparser { testexprparser { 123} -1 } {- {} 0 subexpr 123 1 text 123 0 {}} test parseExpr-16.2 {GetLexeme procedure, whitespace before lexeme} testexprparser { testexprparser { \ 456} -1 } {- {} 0 subexpr 456 1 text 456 0 {}} test parseExpr-16.3 {GetLexeme procedure, no lexeme after whitespace} testexprparser { testexprparser { 123 \ } -1 } {- {} 0 subexpr 123 1 text 123 0 {}} test parseExpr-16.4 {GetLexeme procedure, integer lexeme} testexprparser { testexprparser {000} -1 } {- {} 0 subexpr 000 1 text 000 0 {}} test parseExpr-16.5 {GetLexeme procedure, integer lexeme too big} testexprparser { testexprparser {12345678901234567890} -1 } {- {} 0 subexpr 12345678901234567890 1 text 12345678901234567890 0 {}} test parseExpr-16.6 {GetLexeme procedure, bad integer lexeme} -constraints testexprparser -body { testexprparser {0o999} -1 } -returnCodes error -match glob -result {*invalid octal number*} test parseExpr-16.7 {GetLexeme procedure, double lexeme} testexprparser { testexprparser {0.999} -1 } {- {} 0 subexpr 0.999 1 text 0.999 0 {}} test parseExpr-16.8 {GetLexeme procedure, double lexeme} testexprparser { testexprparser {.123} -1 } {- {} 0 subexpr .123 1 text .123 0 {}} test parseExpr-16.9 {GetLexeme procedure, double lexeme} {testexprparser unix} { testexprparser {nan} -1 } {- {} 0 subexpr nan 1 text nan 0 {}} test parseExpr-16.10 {GetLexeme procedure, double lexeme} {testexprparser unix} { testexprparser {NaN} -1 } {- {} 0 subexpr NaN 1 text NaN 0 {}} test parseExpr-16.11a {GetLexeme procedure, bad double lexeme too big} {testexprparser && !ieeeFloatingPoint} { list [catch {testexprparser {123.e+99999999999999} -1} msg] $msg } {1 {floating-point value too large to represent}} test parseExpr-16.11b {GetLexeme procedure, bad double lexeme too big} {testexprparser && ieeeFloatingPoint} { list [catch {testexprparser {123.e+99999999999999} -1} msg] $msg } {0 {- {} 0 subexpr 123.e+99999999999999 1 text 123.e+99999999999999 0 {}}} test parseExpr-16.12 {GetLexeme procedure, bad double lexeme} -constraints testexprparser -body { testexprparser {123.4x56} -1 } -returnCodes error -match glob -result * test parseExpr-16.13 {GetLexeme procedure, lexeme is "["} testexprparser { testexprparser {[foo]} -1 } {- {} 0 subexpr {[foo]} 1 command {[foo]} 0 {}} test parseExpr-16.14 {GetLexeme procedure, lexeme is open brace} testexprparser { testexprparser {{bar}} -1 } {- {} 0 subexpr {{bar}} 1 text bar 0 {}} test parseExpr-16.15 {GetLexeme procedure, lexeme is "("} testexprparser { testexprparser {(123)} -1 } {- {} 0 subexpr 123 1 text 123 0 {}} test parseExpr-16.16 {GetLexeme procedure, lexeme is ")"} testexprparser { testexprparser {(2*3)} -1 } {- {} 0 subexpr 2*3 5 operator * 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.17 {GetLexeme procedure, lexeme is "$"} testexprparser { testexprparser {$wombat} -1 } {- {} 0 subexpr {$wombat} 2 variable {$wombat} 1 text wombat 0 {}} test parseExpr-16.18 "GetLexeme procedure, lexeme is '\"'" testexprparser { testexprparser {"fred"} -1 } {- {} 0 subexpr {"fred"} 1 text fred 0 {}} test parseExpr-16.19 {GetLexeme procedure, lexeme is ","} testexprparser { testexprparser {foo(1,2)} -1 } {- {} 0 subexpr foo(1,2) 5 operator foo 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.20 {GetLexeme procedure, lexeme is "*"} testexprparser { testexprparser {$a*$b} -1 } {- {} 0 subexpr {$a*$b} 7 operator * 0 subexpr {$a} 2 variable {$a} 1 text a 0 subexpr {$b} 2 variable {$b} 1 text b 0 {}} test parseExpr-16.21 {GetLexeme procedure, lexeme is "/"} testexprparser { testexprparser {5/6} -1 } {- {} 0 subexpr 5/6 5 operator / 0 subexpr 5 1 text 5 0 subexpr 6 1 text 6 0 {}} test parseExpr-16.22 {GetLexeme procedure, lexeme is "%"} testexprparser { testexprparser {5%[xxx]} -1 } {- {} 0 subexpr {5%[xxx]} 5 operator % 0 subexpr 5 1 text 5 0 subexpr {[xxx]} 1 command {[xxx]} 0 {}} test parseExpr-16.23 {GetLexeme procedure, lexeme is "+"} testexprparser { testexprparser {1+2} -1 } {- {} 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.24 {GetLexeme procedure, lexeme is "-"} testexprparser { testexprparser {.12-0e27} -1 } {- {} 0 subexpr .12-0e27 5 operator - 0 subexpr .12 1 text .12 0 subexpr 0e27 1 text 0e27 0 {}} test parseExpr-16.25 {GetLexeme procedure, lexeme is "?" or ":"} testexprparser { testexprparser {$b? 1 : 0} -1 } {- {} 0 subexpr {$b? 1 : 0} 8 operator ? 0 subexpr {$b} 2 variable {$b} 1 text b 0 subexpr 1 1 text 1 0 subexpr 0 1 text 0 0 {}} test parseExpr-16.26 {GetLexeme procedure, lexeme is "<"} testexprparser { testexprparser {2<3} -1 } {- {} 0 subexpr 2<3 5 operator < 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.27 {GetLexeme procedure, lexeme is "<<"} testexprparser { testexprparser {2<<3} -1 } {- {} 0 subexpr 2<<3 5 operator << 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.28 {GetLexeme procedure, lexeme is "<="} testexprparser { testexprparser {2<=3} -1 } {- {} 0 subexpr 2<=3 5 operator <= 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.29 {GetLexeme procedure, lexeme is ">"} testexprparser { testexprparser {2>3} -1 } {- {} 0 subexpr 2>3 5 operator > 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.30 {GetLexeme procedure, lexeme is ">>"} testexprparser { testexprparser {2>>3} -1 } {- {} 0 subexpr 2>>3 5 operator >> 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.31 {GetLexeme procedure, lexeme is ">="} testexprparser { testexprparser {2>=3} -1 } {- {} 0 subexpr 2>=3 5 operator >= 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.32 {GetLexeme procedure, lexeme is "=="} testexprparser { testexprparser {2==3} -1 } {- {} 0 subexpr 2==3 5 operator == 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.33 {GetLexeme procedure, bad lexeme starting with "="} -constraints testexprparser -body { testexprparser {2=+3} -1 } -returnCodes error -match glob -result * test parseExpr-16.34 {GetLexeme procedure, lexeme is "!="} testexprparser { testexprparser {2!=3} -1 } {- {} 0 subexpr 2!=3 5 operator != 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.35 {GetLexeme procedure, lexeme is "!"} testexprparser { testexprparser {!2} -1 } {- {} 0 subexpr !2 3 operator ! 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.36 {GetLexeme procedure, lexeme is "&&"} testexprparser { testexprparser {2&&3} -1 } {- {} 0 subexpr 2&&3 5 operator && 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.37 {GetLexeme procedure, lexeme is "&"} testexprparser { testexprparser {1&2} -1 } {- {} 0 subexpr 1&2 5 operator & 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.38 {GetLexeme procedure, lexeme is "^"} testexprparser { testexprparser {1^2} -1 } {- {} 0 subexpr 1^2 5 operator ^ 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.39 {GetLexeme procedure, lexeme is "||"} testexprparser { testexprparser {2||3} -1 } {- {} 0 subexpr 2||3 5 operator || 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.40 {GetLexeme procedure, lexeme is "|"} testexprparser { testexprparser {1|2} -1 } {- {} 0 subexpr 1|2 5 operator | 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.41 {GetLexeme procedure, lexeme is "~"} testexprparser { testexprparser {~2} -1 } {- {} 0 subexpr ~2 3 operator ~ 0 subexpr 2 1 text 2 0 {}} test parseExpr-16.42 {GetLexeme procedure, lexeme is func name} testexprparser { testexprparser {george()} -1 } {- {} 0 subexpr george() 1 operator george 0 {}} test parseExpr-16.43 {GetLexeme procedure, lexeme is func name} testexprparser { testexprparser {harmonic_ratio(2,3)} -1 } {- {} 0 subexpr harmonic_ratio(2,3) 5 operator harmonic_ratio 0 subexpr 2 1 text 2 0 subexpr 3 1 text 3 0 {}} test parseExpr-16.44 {GetLexeme procedure, unknown lexeme} -constraints testexprparser -body { testexprparser {@27} -1 } -returnCodes error -match glob -result * test parseExpr-17.1 {PrependSubExprTokens procedure, expand token array} testexprparser { testexprparser {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} -1 } {- {} 0 subexpr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} 13 operator && 0 subexpr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} 9 operator && 0 subexpr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} 5 operator && 0 subexpr {[string compare [format %c $i] [string index $a $i]]} 1 command {[string compare [format %c $i] [string index $a $i]]} 0 subexpr {[string compare [format %c $i] [string index $a $i]]} 1 command {[string compare [format %c $i] [string index $a $i]]} 0 subexpr {[string compare [format %c $i] [string index $a $i]]} 1 command {[string compare [format %c $i] [string index $a $i]]} 0 subexpr {[string compare [format %c $i] [string index $a $i]]} 1 command {[string compare [format %c $i] [string index $a $i]]} 0 {}} test parseExpr-18.1 {LogSyntaxError procedure, error in expr longer than 60 chars} -constraints testexprparser -body { testexprparser {(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)/} -1 } -returnCodes error -match glob -result * test parseExpr-19.1 {TclParseInteger: [Bug 648441]} -body { # Should see this as integer "0" followed by incomplete function "x" # Thus, syntax error. # If Bug 648441 is not fixed, "0x" will be seen as floating point 0.0 expr 0x } -returnCodes error -match glob -result * test parseExpr-20.1 {Bug 1451233} { expr 1000000000000000000042 } 1000000000000000000042 test parseExpr-20.2 {Bug 1451233} { expr 10000000000000000000420000000042 } 10000000000000000000420000000042 test parseExpr-20.3 {Bug 1451233} { expr 10000000000000000000020000000002 } 10000000000000000000020000000002 test parseExpr-21.1 {error messages} -body { expr @ } -returnCodes error -result {invalid character "@" in expression "@"} test parseExpr-21.2 {error messages} -body { expr = } -returnCodes error -result {incomplete operator "=" in expression "="} test parseExpr-21.3 {error messages} -body { expr x } -returnCodes error -result {invalid bareword "x" in expression "x"; should be "$x" or "{x}" or "x(...)" or ...} test parseExpr-21.4 {error messages} -body { expr abcdefghijklmnopqrstuvwxyz } -returnCodes error -result {invalid bareword "abcdefghijklmnopqrstuv..." in expression "abcdefghijklmnopqrstuv..."; should be "$abcdefghijklmnopqrstuv..." or "{abcdefghijklmnopqrstuv...}" or "abcdefghijklmnopqrstuv...(...)" or ...} test parseExpr-21.5 {error messages} -body { expr {[][]} } -returnCodes error -result {missing operator at _@_ in expression "[]_@_[]"} test parseExpr-21.6 {error messages} -body { expr {0 0} } -returnCodes error -result {missing operator at _@_ in expression "0 _@_0"} test parseExpr-21.7 {error messages} -body { expr {0o8} } -returnCodes error -match glob -result {*invalid octal number*} test parseExpr-21.8 {error messages} -body { expr {0o8x} } -returnCodes error -match glob -result {*invalid octal number*} test parseExpr-21.9 {error messages} -body { expr {"} } -returnCodes error -result {missing " in expression """} test parseExpr-21.10 {error messages} -body { expr \{ } -returnCodes error -result "missing close-brace in expression \"\{\"" test parseExpr-21.11 {error messages} -body { expr $ } -returnCodes error -result {invalid character "$" in expression "$"} test parseExpr-21.12 {error messages} -body { expr {$(} } -returnCodes error -result {missing ) in expression "$("} test parseExpr-21.13 {error messages} -body { expr {[""x]} } -returnCodes error -result {extra characters after close-quote in expression "[""x]"} test parseExpr-21.14 {error messages} -body { expr {[} } -returnCodes error -result {missing close-bracket in expression "["} test parseExpr-21.15 {error messages} -body { expr 0~0 } -returnCodes error -result {missing operator at _@_ in expression "0_@_~0"} test parseExpr-21.16 {error messages} -body { expr () } -returnCodes error -result {empty subexpression at _@_ in expression "(_@_)"} test parseExpr-21.17 {error messages} -body { expr ( } -returnCodes error -result {unbalanced open paren in expression "("} test parseExpr-21.18 {error messages} -body { expr a(0,) } -returnCodes error -result {missing function argument at _@_ in expression "a(0,_@_)"} test parseExpr-21.19 {error messages} -body { expr {} } -returnCodes error -result {empty expression in expression ""} test parseExpr-21.20 {error messages} -body { expr ) } -returnCodes error -result {unbalanced close paren in expression ")"} test parseExpr-21.21 {error messages} -body { expr a(,0) } -returnCodes error -result {missing function argument at _@_ in expression "a(_@_,0)"} test parseExpr-21.22 {error messages} -body { expr 0&|0 } -returnCodes error -result {missing operand at _@_ in expression "0&_@_|0"} test parseExpr-21.23 {error messages} -body { expr 0^^0 } -returnCodes error -result {missing operand at _@_ in expression "0^_@_^0"} test parseExpr-21.24 {error messages} -body { expr 0|&0 } -returnCodes error -result {missing operand at _@_ in expression "0|_@_&0"} test parseExpr-21.25 {error messages} -body { expr a(1+,0) } -returnCodes error -result {missing operand at _@_ in expression "a(1+_@_,0)"} test parseExpr-21.26 {error messages} -body { expr (0 } -returnCodes error -result {unbalanced open paren in expression "(0"} test parseExpr-21.27 {error messages} -body { expr 0?0 } -returnCodes error -result {missing operator ":" at _@_ in expression "0?0_@_"} test parseExpr-21.28 {error messages} -body { expr 0:0 } -returnCodes error -result {unexpected operator ":" without preceding "?" in expression "0:0"} test parseExpr-21.29 {error messages} -body { expr 0) } -returnCodes error -result {unbalanced close paren in expression "0)"} test parseExpr-21.30 {error messages} -body { expr 0, } -returnCodes error -result {unexpected "," outside function argument list in expression "0,"} test parseExpr-21.31 {error messages} -body { expr 0,0 } -returnCodes error -result {unexpected "," outside function argument list in expression "0,0"} test parseExpr-21.32 {error messages} -body { expr (0,0) } -returnCodes error -result {unexpected "," outside function argument list in expression "(0,0)"} test parseExpr-21.33 {error messages} -body { expr a(0:0,0) } -returnCodes error -result {unexpected operator ":" without preceding "?" in expression "a(0:0,0)"} test parseExpr-21.34 {error messages} -body { expr {"abcdefghijklmnopqrstuvwxyz"@0} } -returnCodes error -result {invalid character "@" in expression "...fghijklmnopqrstuvwxyz"@0"} test parseExpr-21.35 {error messages} -body { expr {0@"abcdefghijklmnopqrstuvwxyz"} } -returnCodes error -result {invalid character "@" in expression "0@"abcdefghijklmnopqrstu..."} test parseExpr-21.36 {error messages} -body { expr {"abcdefghijklmnopqrstuvwxyz"@"abcdefghijklmnopqrstuvwxyz"} } -returnCodes error -result {invalid character "@" in expression "...fghijklmnopqrstuvwxyz"@"abcdefghijklmnopqrstu..."} test parseExpr-21.37 {error messages} -body { expr [format {"%s" @ 0} [string repeat \xA7 25]] } -returnCodes error -result [format {invalid character "@" in expression "...%s" @ 0"} [string repeat \xA7 10]] test parseExpr-21.38 {error messages} -body { expr [format {0 @ "%s"} [string repeat \xA7 25]] } -returnCodes error -result [format {invalid character "@" in expression "0 @ "%s..."} [string repeat \xA7 10]] test parseExpr-21.39 {error messages} -body { expr [format {"%s" @ "%s"} [string repeat \xA7 25] [string repeat \xA7 25]] } -returnCodes error -result [format {invalid character "@" in expression "...%s" @ "%s..."} [string repeat \xA7 10] [string repeat \xA7 10]] test parseExpr-21.40 {error messages} -body { catch {expr {"abcdefghijklmnopqrstuvwxyz"@0}} m o dict get $o -errorinfo } -result {invalid character "@" in expression "...fghijklmnopqrstuvwxyz"@0" (parsing expression ""abcdefghijklmnopqrstu...") invoked from within "expr {"abcdefghijklmnopqrstuvwxyz"@0}"} test parseExpr-21.41 {error messages} -body { catch {expr [format {"%s" @ 0} [string repeat \xA7 25]]} m o dict get $o -errorinfo } -result [format {invalid character "@" in expression "...%s" @ 0" (parsing expression ""%s...") invoked from within "expr [format {"%%s" @ 0} [string repeat \xA7 25]]"} [string repeat \xA7 10] [string repeat \xA7 10]] test parseExpr-21.42 {error message} -body { expr {123456789012345678901234567890*"abcdefghijklmnopqrstuvwxyz} } -returnCodes error -result {missing " in expression "...012345678901234567890*"abcdefghijklmnopqrstuv..."} test parseExpr-21.43 {error message} -body { expr "123456789012345678901234567890*\"foobar\$\{abcdefghijklmnopqrstuvwxyz\"" } -returnCodes error -result "missing close-brace for variable name in expression \"...8901234567890*\"foobar\$\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.44 {error message} -body { expr {123456789012345678901234567890*"foo$bar(abcdefghijklmnopqrstuvwxyz"} } -returnCodes error -result {invalid character in array index in expression "...8901234567890*"foo$bar(abcdefghijklmnopqrstu..."} test parseExpr-21.45 {error message} -body { expr {123456789012345678901234567890*"foo$bar([{}abcdefghijklmnopqrstuvwxyz])"} } -returnCodes error -result {extra characters after close-brace in expression "...234567890*"foo$bar([{}abcdefghijklmnopqrstuv..."} test parseExpr-21.46 {error message} -body { expr {123456789012345678901234567890*"foo$bar([""abcdefghijklmnopqrstuvwxyz])"} } -returnCodes error -result {extra characters after close-quote in expression "...234567890*"foo$bar([""abcdefghijklmnopqrstuv..."} test parseExpr-21.47 {error message} -body { expr {123456789012345678901234567890*"foo$bar([abcdefghijklmnopqrstuvwxyz)"} } -returnCodes error -result {missing close-bracket in expression "...901234567890*"foo$bar([abcdefghijklmnopqrstuv..."} test parseExpr-21.48 {error message} -body { expr "123456789012345678901234567890*\"foo\$bar(\[\{abcdefghijklmnopqrstuvwxyz])\"" } -returnCodes error -result "missing close-brace in expression \"...01234567890*\"foo\$bar(\[\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.49 {error message} -body { expr "123456789012345678901234567890*\{abcdefghijklmnopqrstuvwxyz" } -returnCodes error -result "missing close-brace in expression \"...012345678901234567890*\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.50 {error message} -body { expr {123456789012345678901234567890*$foo(["abcdefghijklmnopqrstuvwxyz])} } -returnCodes error -result {missing " in expression "...678901234567890*$foo(["abcdefghijklmnopqrstuv..."} test parseExpr-21.51 {error message} -body { expr "123456789012345678901234567890*\$\{abcdefghijklmnopqrstuvwxyz" } -returnCodes error -result "missing close-brace for variable name in expression \"...12345678901234567890*\$\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.52 {error message} -body { expr {123456789012345678901234567890*$bar(abcdefghijklmnopqrstuvwxyz} } -returnCodes error -result {missing ) in expression "...45678901234567890*$bar(abcdefghijklmnopqrstuv..."} test parseExpr-21.53 {error message} -body { expr {123456789012345678901234567890*$bar([{}abcdefghijklmnopqrstuvwxyz])"} } -returnCodes error -result {extra characters after close-brace in expression "...8901234567890*$bar([{}abcdefghijklmnopqrstuv..."} test parseExpr-21.54 {error message} -body { expr {123456789012345678901234567890*$bar([""abcdefghijklmnopqrstuvwxyz])"} } -returnCodes error -result {extra characters after close-quote in expression "...8901234567890*$bar([""abcdefghijklmnopqrstuv..."} test parseExpr-21.55 {error message} -body { expr {123456789012345678901234567890*$bar([abcdefghijklmnopqrstuvwxyz)"} } -returnCodes error -result {missing close-bracket in expression "...5678901234567890*$bar([abcdefghijklmnopqrstuv..."} test parseExpr-21.56 {error message} -body { expr "123456789012345678901234567890*\$bar(\[\{abcdefghijklmnopqrstuvwxyz])" } -returnCodes error -result "missing close-brace in expression \"...678901234567890*\$bar(\[\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.57 {error message} -body { expr {123456789012345678901234567890*["abcdefghijklmnopqrstuvwxyz]} } -returnCodes error -result {missing " in expression "...12345678901234567890*["abcdefghijklmnopqrstuv..."} test parseExpr-21.58 {error message} -body { expr "123456789012345678901234567890*\[\$\{abcdefghijklmnopqrstuvwxyz]" } -returnCodes error -result "missing close-brace for variable name in expression \"...2345678901234567890*\[\$\{abcdefghijklmnopqrstuv...\"" test parseExpr-21.59 {error message} -body { expr {123456789012345678901234567890*[$bar(abcdefghijklmnopqrstuvwxyz]} } -returnCodes error -result {missing ) in expression "...5678901234567890*[$bar(abcdefghijklmnopqrstuv..."} test parseExpr-21.60 {error message} -body { expr {123456789012345678901234567890*[{}abcdefghijklmnopqrstuvwxyz]"} } -returnCodes error -result {extra characters after close-brace in expression "...345678901234567890*[{}abcdefghijklmnopqrstuv..."} test parseExpr-21.61 {error message} -body { expr {123456789012345678901234567890*[""abcdefghijklmnopqrstuvwxyz]"} } -returnCodes error -result {extra characters after close-quote in expression "...345678901234567890*[""abcdefghijklmnopqrstuv..."} test parseExpr-21.62 {error message} -body { expr {123456789012345678901234567890*[abcdefghijklmnopqrstuvwxyz"} } -returnCodes error -result {missing close-bracket in expression "...012345678901234567890*[abcdefghijklmnopqrstuv..."} test parseExpr-21.63 {error message} -body { expr "123456789012345678901234567890*\[\{abcdefghijklmnopqrstuvwxyz]" } -returnCodes error -result "missing close-brace in expression \"...12345678901234567890*\[\{abcdefghijklmnopqrstuv...\"" test parseExpr-22.1 {Bug 3401704} -constraints testexprparser -body { testexprparser 2a() 1 } -result {- {} 0 subexpr 2 1 text 2 0 {}} test parseExpr-22.2 {Bug 3401704} -constraints testexprparser -body { testexprparser nana() 3 } -result {- {} 0 subexpr nan 1 text nan 0 {}} test parseExpr-22.3 {Bug 3401704} -constraints testexprparser -body { testexprparser 2a() -1 } -result {- {} 0 subexpr 2a() 1 operator 2a 0 {}} test parseExpr-22.4 {Bug 3401704} -constraints testexprparser -body { testexprparser nana() -1 } -result {- {} 0 subexpr nana() 1 operator nana 0 {}} test parseExpr-22.5 {Bug 3401704} -constraints testexprparser -body { testexprparser nan9() -1 } -result {- {} 0 subexpr nan9() 1 operator nan9 0 {}} test parseExpr-22.6 {Bug 3401704} -constraints testexprparser -body { testexprparser 2_() -1 } -result {- {} 0 subexpr 2_() 1 operator 2_ 0 {}} test parseExpr-22.7 {Bug 3401704} -constraints testexprparser -body { testexprparser nan_() -1 } -result {- {} 0 subexpr nan_() 1 operator nan_ 0 {}} test parseExpr-22.8 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser nan!() -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR MISSING} test parseExpr-22.9 {Bug 3401704} -constraints testexprparser -body { testexprparser 1e3_() -1 } -result {- {} 0 subexpr 1e3_() 1 operator 1e3_ 0 {}} test parseExpr-22.10 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 1.3_() -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADCHAR} test parseExpr-22.11 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 1e-3`() -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADCHAR} test parseExpr-22.12 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser naneq() -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR EMPTY} test parseExpr-22.13 {Bug 3401704} -constraints testexprparser -body { testexprparser naner() -1 } -result {- {} 0 subexpr naner() 1 operator naner 0 {}} test parseExpr-22.14 {Bug 3401704} -constraints testexprparser -body { testexprparser 07 -1 } -result {- {} 0 subexpr 07 1 text 07 0 {}} test parseExpr-22.15 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 0o8 -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.16 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 0o08 -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.17 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 0b2 -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADNUMBER BINARY} test parseExpr-22.18 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 0b02 -1} m o dict get $o -errorcode } -result {TCL PARSE EXPR BADNUMBER BINARY} test parseExpr-22.19 {Bug d2ffcca163} -constraints testexprparser -body { testexprparser г -1 } -returnCodes error -match glob -result {*invalid character*} test parseExpr-22.20 {Bug d2ffcca163} -constraints testexprparser -body { testexprparser п -1 } -returnCodes error -match glob -result {*invalid character*} test parseExpr-22.21 {Bug d2ffcca163} -constraints testexprparser -body { testexprparser inг(0) -1 } -returnCodes error -match glob -result {missing operand*} test parseExpr-23.1 {TIP 582: comments} -constraints testexprparser -body { testexprparser "7 # * 8 " -1 } -result {- {} 0 subexpr 7 1 text 7 0 {}} test parseExpr-23.2 {TIP 582: comments} -constraints testexprparser -body { testexprparser "7 #\n* 8 " -1 } -result {- {} 0 subexpr {7 # *} 5 operator # 0 subexpr 7 1 text 7 0 subexpr * 1 text * 0 {}} # cleanup cleanupTests return tcl9.0.3/tests/parse.test0000644000175000017500000013745115104661341014737 0ustar sergeisergei# This file contains a collection of tests for the procedures in the # file tclParse.c. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } namespace eval ::tcl::test::parse { namespace import ::tcltest::* ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testparser [llength [info commands testparser]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testevalobjv [llength [info commands testevalobjv]] testConstraint testevalex [llength [info commands testevalex]] testConstraint testparsevarname [llength [info commands testparsevarname]] testConstraint testparsevar [llength [info commands testparsevar]] testConstraint testasync [llength [info commands testasync]] testConstraint testcmdtrace [llength [info commands testcmdtrace]] testConstraint testevent [llength [info commands testevent]] testConstraint memory [llength [info commands memory]] test parse-1.1 {Tcl_ParseCommand procedure, computing string length} {testparser testbytestring} { testparser [testbytestring "foo\x00 bar"] -1 } {- foo 1 simple foo 1 text foo 0 {}} test parse-1.2 {Tcl_ParseCommand procedure, computing string length} testparser { testparser "foo bar" -1 } {- {foo bar} 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}} test parse-1.3 {Tcl_ParseCommand procedure, leading space} testparser { testparser " \n\t foo" 0 } {- foo 1 simple foo 1 text foo 0 {}} test parse-1.4 {Tcl_ParseCommand procedure, leading space} testparser { testparser "\f\r\vfoo" 0 } {- foo 1 simple foo 1 text foo 0 {}} test parse-1.5 {Tcl_ParseCommand procedure, backslash-newline in leading space} testparser { testparser " \\\n foo" 0 } {- foo 1 simple foo 1 text foo 0 {}} test parse-1.6 {Tcl_ParseCommand procedure, backslash-newline in leading space} testparser { testparser { \a foo} 0 } {- {\a foo} 2 word {\a} 1 backslash {\a} 0 simple foo 1 text foo 0 {}} test parse-1.7 {Tcl_ParseCommand procedure, missing continuation line in leading space} testparser { testparser " \\\n" 0 } {- {} 0 {}} test parse-1.8 {Tcl_ParseCommand procedure, eof in leading space} testparser { testparser " foo" 3 } {- {} 0 { foo}} test parse-1.9 {Tcl_ParseCommand procedure, backslash newline + newline} testparser { testparser "cmd1\\\n\ncmd2" 0 } {- cmd1\\\n\n 1 simple cmd1 1 text cmd1 0 cmd2} test parse-1.10 {Tcl_ParseCommand procedure, backslash newline + newline} testparser { testparser "list \\\nA B\\\n\nlist C D" 0 } {- list\ \\\nA\ B\\\n\n 3 simple list 1 text list 0 simple A 1 text A 0 simple B 1 text B 0 {list C D}} test parse-2.1 {Tcl_ParseCommand procedure, comments} testparser { testparser "# foo bar\n foo" 0 } {{# foo bar } foo 1 simple foo 1 text foo 0 {}} test parse-2.2 {Tcl_ParseCommand procedure, several comments} testparser { testparser " # foo bar\n # another comment\n\n foo" 0 } {{# foo bar # another comment } foo 1 simple foo 1 text foo 0 {}} test parse-2.3 {Tcl_ParseCommand procedure, backslash-newline in comments} testparser { testparser " # foo bar\\\ncomment on continuation line\nfoo" 0 } {\#\ foo\ bar\\\ncomment\ on\ continuation\ line\n foo 1 simple foo 1 text foo 0 {}} test parse-2.4 {Tcl_ParseCommand procedure, missing continuation line in comment} testparser { testparser "# \\\n" 0 } {\#\ \ \ \\\n {} 0 {}} test parse-2.5 {Tcl_ParseCommand procedure, eof in comment} testparser { testparser " # foo bar\nfoo" 8 } {{# foo b} {} 0 {ar foo}} test parse-3.1 {Tcl_ParseCommand procedure, parsing words, skipping space} testparser { testparser "foo bar\t\tx" 0 } {- {foo bar x} 3 simple foo 1 text foo 0 simple bar 1 text bar 0 simple x 1 text x 0 {}} test parse-3.2 {Tcl_ParseCommand procedure, missing continuation line in leading space} testparser { testparser "abc \\\n" 0 } {- abc\ \ \\\n 1 simple abc 1 text abc 0 {}} test parse-3.3 {Tcl_ParseCommand procedure, parsing words, command ends in space} testparser { testparser "foo ; bar x" 0 } {- {foo ;} 1 simple foo 1 text foo 0 { bar x}} test parse-3.4 {Tcl_ParseCommand procedure, parsing words, command ends in space} testparser { testparser "foo " 5 } {- {foo } 1 simple foo 1 text foo 0 { }} test parse-3.5 {Tcl_ParseCommand procedure, quoted words} testparser { testparser {foo "a b c" d "efg";} 0 } {- {foo "a b c" d "efg";} 4 simple foo 1 text foo 0 simple {"a b c"} 1 text {a b c} 0 simple d 1 text d 0 simple {"efg"} 1 text efg 0 {}} test parse-3.6 {Tcl_ParseCommand procedure, words in braces} testparser { testparser {foo {a $b [concat foo]} {c d}} 0 } {- {foo {a $b [concat foo]} {c d}} 3 simple foo 1 text foo 0 simple {{a $b [concat foo]}} 1 text {a $b [concat foo]} 0 simple {{c d}} 1 text {c d} 0 {}} test parse-3.7 {Tcl_ParseCommand procedure, error in unquoted word} testparser { list [catch {testparser "foo \$\{abc" 0} msg] $msg $::errorInfo } {1 {missing close-brace for variable name} missing\ close-brace\ for\ variable\ name\n\ \ \ \ (remainder\ of\ script:\ \"\{abc\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"foo\ \\\$\\\{abc\"\ 0\"} test parse-4.1 {Tcl_ParseCommand procedure, simple words} testparser { testparser {foo} 0 } {- foo 1 simple foo 1 text foo 0 {}} test parse-4.2 {Tcl_ParseCommand procedure, simple words} testparser { testparser {{abc}} 0 } {- {{abc}} 1 simple {{abc}} 1 text abc 0 {}} test parse-4.3 {Tcl_ParseCommand procedure, simple words} testparser { testparser {"c d"} 0 } {- {"c d"} 1 simple {"c d"} 1 text {c d} 0 {}} test parse-4.4 {Tcl_ParseCommand procedure, simple words} testparser { testparser {x$d} 0 } {- {x$d} 1 word {x$d} 3 text x 0 variable {$d} 1 text d 0 {}} test parse-4.5 {Tcl_ParseCommand procedure, simple words} testparser { testparser {"a [foo] b"} 0 } {- {"a [foo] b"} 1 word {"a [foo] b"} 3 text {a } 0 command {[foo]} 0 text { b} 0 {}} test parse-4.6 {Tcl_ParseCommand procedure, simple words} testparser { testparser {$x} 0 } {- {$x} 1 word {$x} 2 variable {$x} 1 text x 0 {}} test parse-5.1 {Tcl_ParseCommand procedure, backslash-newline terminates word} testparser { testparser "{abc}\\\n" 0 } {- \{abc\}\\\n 1 simple {{abc}} 1 text abc 0 {}} test parse-5.2 {Tcl_ParseCommand procedure, backslash-newline terminates word} testparser { testparser "foo\\\nbar" 0 } {- foo\\\nbar 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}} test parse-5.3 {Tcl_ParseCommand procedure, word terminator is command terminator} testparser { testparser "foo\n bar" 0 } {- {foo } 1 simple foo 1 text foo 0 { bar}} test parse-5.4 {Tcl_ParseCommand procedure, word terminator is command terminator} testparser { testparser "foo; bar" 0 } {- {foo;} 1 simple foo 1 text foo 0 { bar}} test parse-5.5 {Tcl_ParseCommand procedure, word terminator is end of string} testparser { testparser "\"foo\" bar" 5 } {- {"foo"} 1 simple {"foo"} 1 text foo 0 { bar}} test parse-5.6 {Tcl_ParseCommand procedure, junk after close quote} testparser { list [catch {testparser {foo "bar"x} 0} msg] $msg $::errorInfo } {1 {extra characters after close-quote} {extra characters after close-quote (remainder of script: "x") invoked from within "testparser {foo "bar"x} 0"}} test parse-5.7 {Tcl_ParseCommand procedure, backslash-newline after close quote} testparser { testparser "foo \"bar\"\\\nx" 0 } {- foo\ \"bar\"\\\nx 3 simple foo 1 text foo 0 simple {"bar"} 1 text bar 0 simple x 1 text x 0 {}} test parse-5.8 {Tcl_ParseCommand procedure, junk after close brace} testparser { list [catch {testparser {foo {bar}x} 0} msg] $msg $::errorInfo } {1 {extra characters after close-brace} {extra characters after close-brace (remainder of script: "x") invoked from within "testparser {foo {bar}x} 0"}} test parse-5.9 {Tcl_ParseCommand procedure, backslash-newline after close brace} testparser { testparser "foo {bar}\\\nx" 0 } {- foo\ \{bar\}\\\nx 3 simple foo 1 text foo 0 simple {{bar}} 1 text bar 0 simple x 1 text x 0 {}} test parse-5.10 {Tcl_ParseCommand procedure, multiple deletion of non-static buffer} testparser { # This test is designed to catch bug 1681. list [catch {testparser "a \"\\1\\2\\3\\4\\5\\6\\7\\8\\9\\1\\2\\3\\4\\5\\6\\7\\8" 0} msg] $msg $::errorInfo } "1 {missing \"} {missing \" (remainder of script: \"\"\\1\\2\\3\\4\\5\\6\\7\\8\\9\\1\\2\\3\\4\\5\\6\\7\\8\") invoked from within \"testparser \"a \\\"\\\\1\\\\2\\\\3\\\\4\\\\5\\\\6\\\\7\\\\8\\\\9\\\\1\\\\2\\\\3\\\\4\\\\5\\\\6\\\\7\\\\8\" 0\"}" test parse-5.11 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{expan}} 0 } {- {{expan}} 1 simple {{expan}} 1 text expan 0 {}} test parse-5.12 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{expan}x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.13 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{**}} 0 } {- {{**}} 1 simple {{**}} 1 text ** 0 {}} test parse-5.14 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{**}x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.15 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{*}{123456}x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.16 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{123456\ }} 0 } {- {{123456 }} 1 simple {{123456 }} 1 text {123456 } 0 {}} test parse-5.17 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{123456\ }x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.18 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*\ }} 0 } {- {{* }} 1 simple {{* }} 1 text {* } 0 {}} test parse-5.19 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{*\ }x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.20 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{123456}} 0 } {- {{123456}} 1 simple {{123456}} 1 text 123456 0 {}} test parse-5.21 {Tcl_ParseCommand: {*} parsing} -constraints { testparser } -body { testparser {{123456}x} 0 } -returnCodes error -result {extra characters after close-brace} test parse-5.22 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*}} 0 } {- {{*}} 1 simple {{*}} 1 text * 0 {}} test parse-5.23 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*} } 0 } {- {{*} } 1 simple {{*}} 1 text * 0 {}} test parse-5.24 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*}x} 0 } {- {{*}x} 1 simple x 1 text x 0 {}} test parse-5.25 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*} } 0 } {- {{*} } 1 simple {{*}} 1 text * 0 {}} test parse-5.26 {Tcl_ParseCommand: {*} parsing} testparser { testparser {{*};} 0 } {- {{*};} 1 simple {{*}} 1 text * 0 {}} 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 } {- {""} 1 simple {""} 1 text {} 0 {}} test parse-6.2 {ParseTokens procedure, simple range} testparser { testparser {"abc$x.e"} 0 } {- {"abc$x.e"} 1 word {"abc$x.e"} 4 text abc 0 variable {$x} 1 text x 0 text .e 0 {}} test parse-6.3 {ParseTokens procedure, variable reference} testparser { testparser {abc$x.e $y(z)} 0 } {- {abc$x.e $y(z)} 2 word {abc$x.e} 4 text abc 0 variable {$x} 1 text x 0 text .e 0 word {$y(z)} 3 variable {$y(z)} 2 text y 0 text z 0 {}} test parse-6.4 {ParseTokens procedure, variable reference} testparser { list [catch {testparser {$x([a )} 0} msg] $msg } {1 {missing close-bracket}} test parse-6.5 {ParseTokens procedure, command substitution} testparser { testparser {[foo $x bar]z} 0 } {- {[foo $x bar]z} 1 word {[foo $x bar]z} 2 command {[foo $x bar]} 0 text z 0 {}} test parse-6.6 {ParseTokens procedure, command substitution} testparser { testparser {[foo \] [a b]]} 0 } {- {[foo \] [a b]]} 1 word {[foo \] [a b]]} 1 command {[foo \] [a b]]} 0 {}} test parse-6.7 {ParseTokens procedure, error in command substitution} testparser { list [catch {testparser {a [b {}c d] e} 0} msg] $msg $::errorInfo } {1 {extra characters after close-brace} {extra characters after close-brace (remainder of script: "c d] e") invoked from within "testparser {a [b {}c d] e} 0"}} test parse-6.8 {ParseTokens procedure, error in command substitution} { info complete {a [b {}c d]} } {1} test parse-6.9 {ParseTokens procedure, error in command substitution} { info complete {a [b "c d} } {0} test parse-6.10 {ParseTokens procedure, incomplete sub-command} { info complete {puts [ expr {1+1} #this is a comment ]} } {0} test parse-6.11 {ParseTokens procedure, memory allocation for big nested command} testparser { testparser {[$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b)]} 0 } {- {[$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b)]} 1 word {[$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b)]} 1 command {[$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b)]} 0 {}} test parse-6.12 {ParseTokens procedure, missing close bracket} testparser { list [catch {testparser {[foo $x bar} 0} msg] $msg $::errorInfo } {1 {missing close-bracket} {missing close-bracket (remainder of script: "[foo $x bar") invoked from within "testparser {[foo $x bar} 0"}} test parse-6.13 {ParseTokens procedure, backslash-newline without continuation line} testparser { list [catch {testparser "\"a b\\\n" 0} msg] $msg $::errorInfo } {1 {missing "} missing\ \"\n\ \ \ \ (remainder\ of\ script:\ \"\"a\ b\\\n\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"\\\"a\ b\\\\\\n\"\ 0\"} test parse-6.14 {ParseTokens procedure, backslash-newline} testparser { testparser "b\\\nc" 0 } {- b\\\nc 2 simple b 1 text b 0 simple c 1 text c 0 {}} test parse-6.15 {ParseTokens procedure, backslash-newline} testparser { testparser "\"b\\\nc\"" 0 } {- \"b\\\nc\" 1 word \"b\\\nc\" 3 text b 0 backslash \\\n 0 text c 0 {}} test parse-6.16 {ParseTokens procedure, backslash substitution} testparser { testparser {\n\a\x7F} 0 } {- {\n\a\x7F} 1 word {\n\a\x7F} 3 backslash {\n} 0 backslash {\a} 0 backslash {\x7F} 0 {}} test parse-6.17 {ParseTokens procedure, null characters} {testparser testbytestring} { expr {[testparser [testbytestring "foo\0zz"] 0] eq "- [testbytestring foo\0zz] 1 word [testbytestring foo\0zz] 3 text foo 0 text [testbytestring \0] 0 text zz 0 {}" } } 1 test parse-6.18 {ParseTokens procedure, seek past numBytes for close-bracket} testparser { # Test for Bug 681841 list [catch {testparser {[a]} 2} msg] $msg } {1 {missing close-bracket}} test parse-7.1 {Tcl_FreeParse and ExpandTokenArray procedures} testparser { testparser {$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) } 0 } {- {$a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) $a(b) } 16 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 word {$a(b)} 3 variable {$a(b)} 2 text a 0 text b 0 {}} test parse-8.1 {Tcl_EvalObjv procedure} testevalobjv { testevalobjv 0 concat this is a test } {this is a test} test parse-8.2 {Tcl_EvalObjv procedure, unknown commands} testevalobjv { rename ::unknown unknown.old set x [catch {testevalobjv 10 asdf poiu} msg] rename unknown.old ::unknown list $x $msg } {1 {invalid command name "asdf"}} test parse-8.3 {Tcl_EvalObjv procedure, unknown commands} testevalobjv { rename ::unknown unknown.old proc ::unknown args { return "unknown $args" } set x [catch {testevalobjv 0 asdf poiu} msg] rename ::unknown {} rename unknown.old ::unknown list $x $msg } {0 {unknown asdf poiu}} test parse-8.4 {Tcl_EvalObjv procedure, unknown commands} testevalobjv { rename ::unknown unknown.old proc ::unknown args { error "I don't like that command" } set x [catch {testevalobjv 0 asdf poiu} msg] rename ::unknown {} rename unknown.old ::unknown list $x $msg } {1 {I don't like that command}} test parse-8.5 {Tcl_EvalObjv procedure, command traces} {testevalobjv testcmdtrace} { testevalobjv 0 set x 123 testcmdtrace tracetest {testevalobjv 0 set x $x} } {{testevalobjv 0 set x $x} {testevalobjv 0 set x 123} {set x 123} {set x 123}} test parse-8.7 {Tcl_EvalObjv procedure, TCL_EVAL_GLOBAL flag} -constraints { testevalobjv } -setup { proc x {} { set y 23 set z [testevalobjv 1 set y] return [list $z $y] } set ::y 16 } -cleanup { unset ::y } -body { x } -result {16 23} test parse-8.8 {Tcl_EvalObjv procedure, async handlers} -constraints { testevalobjv testasync } -setup { variable ::aresult variable ::acode proc async1 {result code} { variable ::aresult variable ::acode set aresult $result set acode $code return "new result" } set handler1 [testasync create async1] set ::aresult xxx set ::acode yyy } -cleanup { testasync delete } -body { list [testevalobjv 0 testasync mark $handler1 original 0] $::acode $::aresult } -result {{new result} 0 original} test parse-8.9 {Tcl_EvalObjv procedure, exceptional return} testevalobjv { list [catch {testevalobjv 0 error message} msg] $msg } {1 message} test parse-8.10 {Tcl_EvalObjv procedure, TCL_EVAL_GLOBAL} testevalobjv { rename ::unknown unknown.save proc ::unknown args {lappend ::info [info level]} catch {rename ::noSuchCommand {}} set ::info {} namespace eval test_ns_1 { testevalobjv 1 noSuchCommand uplevel #0 noSuchCommand } namespace delete test_ns_1 rename ::unknown {} rename unknown.save ::unknown set ::info } {1 1} test parse-8.11 {Tcl_EvalObjv procedure, TCL_EVAL_INVOKE} testevalobjv { rename ::unknown unknown.save proc ::unknown args {lappend ::info [info level]; uplevel 1 foo} proc ::foo args {lappend ::info global} catch {rename ::noSuchCommand {}} set ::child [interp create] $::child alias bar noSuchCommand set ::info {} namespace eval test_ns_1 { proc foo args {lappend ::info namespace} $::child eval bar testevalobjv 1 [list $::child eval bar] uplevel #0 [list $::child eval bar] } namespace delete test_ns_1 rename ::foo {} rename ::unknown {} rename unknown.save ::unknown set ::info } [subst {[set level 2; incr level [info level]] global 1 global 1 global}] test parse-8.12 {Tcl_EvalObjv procedure, TCL_EVAL_INVOKE} { set ::auto_index(noSuchCommand) { proc noSuchCommand {} {lappend ::info global} } set ::auto_index(::[string trimleft [namespace current]::test_ns_1::noSuchCommand :]) [list \ proc [namespace current]::test_ns_1::noSuchCommand {} { lappend ::info ns }] catch {rename ::noSuchCommand {}} set ::child [interp create] $::child alias bar noSuchCommand set ::info {} namespace eval test_ns_1 { $::child eval bar } namespace delete test_ns_1 interp delete $::child catch {rename ::noSuchCommand {}} set ::info } global test parse-9.1 {Tcl_LogCommandInfo, line numbers} testevalex { unset -nocomplain x list [catch {testevalex {for {} 1 {} { # asdf set x }}}] $::errorInfo } {1 {can't read "x": no such variable while executing "set x" ("for" body line 5) invoked from within "for {} 1 {} { # asdf set x }" invoked from within "testevalex {for {} 1 {} { # asdf set x }}"}} test parse-9.2 {Tcl_LogCommandInfo, truncating long commands} { list [catch {set a b 111111111 222222222 333333333 444444444 555555555 666666666 777777777 888888888 999999999 000000000 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd eeeeeeeee fffffffff ggggggggg}] $::errorInfo } {1 {wrong # args: should be "set varName ?newValue?" while executing "set a b 111111111 222222222 333333333 444444444 555555555 666666666 777777777 888888888 999999999 000000000 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd ee..."}} test parse-10.1 {Tcl_EvalTokens, simple text} testevalex { testevalex {concat test} } {test} test parse-10.2 {Tcl_EvalTokens, backslash sequences} testevalex { testevalex {concat test\063\062test} } {test32test} test parse-10.3 {Tcl_EvalTokens, nested commands} testevalex { testevalex {concat [expr {2 + 6}]} } {8} test parse-10.4 {Tcl_EvalTokens, nested commands} testevalex { unset -nocomplain a list [catch {testevalex {concat xxx[expr {$a}]}} msg] $msg } {1 {can't read "a": no such variable}} test parse-10.5 {Tcl_EvalTokens, simple variables} testevalex { set a hello testevalex {concat $a} } {hello} test parse-10.6 {Tcl_EvalTokens, array variables} testevalex { unset -nocomplain a set a(12) 46 testevalex {concat $a(12)} } {46} test parse-10.7 {Tcl_EvalTokens, array variables} testevalex { unset -nocomplain a set a(12) 46 testevalex {concat $a(1[expr {3 - 1}])} } {46} test parse-10.8 {Tcl_EvalTokens, array variables} testevalex { unset -nocomplain a list [catch {testevalex {concat $x($a)}} msg] $msg } {1 {can't read "a": no such variable}} test parse-10.9 {Tcl_EvalTokens, array variables} testevalex { unset -nocomplain a list [catch {testevalex {concat xyz$a(1)}} msg] $msg } {1 {can't read "a(1)": no such variable}} test parse-10.10 {Tcl_EvalTokens, object values} testevalex { set a 123 testevalex {concat $a} } {123} test parse-10.11 {Tcl_EvalTokens, object values} testevalex { set a 123 testevalex {concat $a$a$a} } {123123123} test parse-10.12 {Tcl_EvalTokens, object values} testevalex { testevalex {concat [expr {2}][expr {4}][expr {6}]} } {246} test parse-10.13 {Tcl_EvalTokens, string values} testevalex { testevalex {concat {a" b"}} } {a" b"} test parse-10.14 {Tcl_EvalTokens, string values} testevalex { set a 111 testevalex {concat x$a.$a.$a} } {x111.111.111} test parse-11.1 {Tcl_EvalEx, TCL_EVAL_GLOBAL flag} -constraints { testevalex } -setup { proc x {} { set y 777 set z [testevalex "set y" global] return [list $z $y] } set ::y 321 } -cleanup { unset ::y } -body { x } -result {321 777} test parse-11.2 {Tcl_EvalEx, error while parsing} testevalex { list [catch {testevalex {concat "abc}} msg] $msg } {1 {missing "}} test parse-11.3 {Tcl_EvalEx, error while collecting words} testevalex { unset -nocomplain a list [catch {testevalex {concat xyz $a}} msg] $msg } {1 {can't read "a": no such variable}} test parse-11.4 {Tcl_EvalEx, error in Tcl_EvalObjv call} testevalex { unset -nocomplain a list [catch {testevalex {_bogus_ a b c d}} msg] $msg } {1 {invalid command name "_bogus_"}} test parse-11.5 {Tcl_EvalEx, exceptional return} testevalex { list [catch {testevalex {break}} msg] $msg } {3 {}} test parse-11.6 {Tcl_EvalEx, freeing memory} testevalex { testevalex {concat a b c d e f g h i j k l m n o p q r s t u v w x y z} } {a b c d e f g h i j k l m n o p q r s t u v w x y z} test parse-11.7 {Tcl_EvalEx, multiple commands in script} testevalex { list [testevalex {set a b; set c d}] $a $c } {d b d} test parse-11.8 {Tcl_EvalEx, multiple commands in script} testevalex { list [testevalex { set a b set c d }] $a $c } {d b d} test parse-11.9 {Tcl_EvalEx, freeing memory after error} testevalex { unset -nocomplain a list [catch {testevalex {concat a b c d e f g h i j k l m n o p q r s t u v w x y z $a}} msg] $msg } {1 {can't read "a": no such variable}} test parse-11.10 {Tcl_EvalTokens, empty commands} testevalex { testevalex {concat xyz; } } {xyz} test parse-11.11 {Tcl_EvalTokens, empty commands} testevalex { testevalex "concat abc; ; # this is a comment\n" } {abc} test parse-11.12 {Tcl_EvalTokens, empty commands} testevalex { testevalex {} } {} test parse-12.1 {Tcl_ParseVarName procedure, initialization} testparsevarname { list [catch {testparsevarname {$a([first second])} 8 0} msg] $msg } {1 {missing close-bracket}} test parse-12.2 {Tcl_ParseVarName procedure, initialization} testparsevarname { testparsevarname {$a([first second])} 0 0 } {- {} 0 variable {$a([first second])} 2 text a 0 command {[first second]} 0 {}} test parse-12.3 {Tcl_ParseVarName procedure, initialization} testparsevarname { list [catch {testparsevarname {$abcd} 3 0} msg] $msg } {0 {- {} 0 variable {$ab} 1 text ab 0 cd}} test parse-12.4 {Tcl_ParseVarName procedure, initialization} testparsevarname { testparsevarname {$abcd} 0 0 } {- {} 0 variable {$abcd} 1 text abcd 0 {}} test parse-12.5 {Tcl_ParseVarName procedure, just a dollar sign} testparsevarname { testparsevarname {$abcd} 1 0 } {- {} 0 text {$} 0 abcd} test parse-12.6 {Tcl_ParseVarName procedure, braced variable name} testparser { testparser {${..[]b}cd} 0 } {- {${..[]b}cd} 1 word {${..[]b}cd} 3 variable {${..[]b}} 1 text {..[]b} 0 text cd 0 {}} test parse-12.7 {Tcl_ParseVarName procedure, braced variable name} testparser { testparser "\$\{\{\\\\\}\} " 0 } {- {${{\\}} } 1 word {${{\\}}} 2 variable {${{\\}}} 1 text {{\\}} 0 {}} test parse-12.8 {Tcl_ParseVarName procedure, missing close brace} testparser { list [catch {testparser "$\{abc" 0} msg] $msg $::errorInfo } {1 {missing close-brace for variable name} missing\ close-brace\ for\ variable\ name\n\ \ \ \ (remainder\ of\ script:\ \"\{abc\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"\$\\\{abc\"\ 0\"} test parse-12.9 {Tcl_ParseVarName procedure, missing close brace} testparsevarname { list [catch {testparsevarname {${bcd}} 4 0} msg] $msg } {1 {missing close-brace for variable name}} test parse-12.10 {Tcl_ParseVarName procedure, missing close brace} testparsevarname { list [catch {testparsevarname {${bc}} 4 0} msg] $msg } {1 {missing close-brace for variable name}} test parse-12.11 {Tcl_ParseVarName procedure, simple variable name} testparser { testparser {$az_AZ.} 0 } {- {$az_AZ.} 1 word {$az_AZ.} 3 variable {$az_AZ} 1 text az_AZ 0 text . 0 {}} test parse-12.12 {Tcl_ParseVarName procedure, simple variable name} testparser { testparser {$abcdefg} 4 } {- {$abc} 1 word {$abc} 2 variable {$abc} 1 text abc 0 defg} test parse-12.13 {Tcl_ParseVarName procedure, simple variable name with ::} testparser { testparser {$xyz::ab:c} 0 } {- {$xyz::ab:c} 1 word {$xyz::ab:c} 3 variable {$xyz::ab} 1 text xyz::ab 0 text :c 0 {}} test parse-12.14 {Tcl_ParseVarName procedure, variable names with many colons} testparser { testparser {$xyz:::::c} 0 } {- {$xyz:::::c} 1 word {$xyz:::::c} 2 variable {$xyz:::::c} 1 text xyz:::::c 0 {}} test parse-12.15 {Tcl_ParseVarName procedure, : vs. ::} testparsevarname { testparsevarname {$ab:cd} 0 0 } {- {} 0 variable {$ab} 1 text ab 0 :cd} test parse-12.16 {Tcl_ParseVarName procedure, eof in ::} testparsevarname { testparsevarname {$ab::cd} 4 0 } {- {} 0 variable {$ab} 1 text ab 0 ::cd} test parse-12.17 {Tcl_ParseVarName procedure, eof in ::} testparsevarname { testparsevarname {$ab:::cd} 5 0 } {- {} 0 variable {$ab::} 1 text ab:: 0 :cd} test parse-12.18 {Tcl_ParseVarName procedure, no variable name} testparser { testparser {$$ $.} 0 } {- {$$ $.} 2 word {$$} 2 text {$} 0 text {$} 0 word {$.} 2 text {$} 0 text . 0 {}} test parse-12.19 {Tcl_ParseVarName procedure, EOF before (} testparsevarname { testparsevarname {$ab(cd)} 3 0 } {- {} 0 variable {$ab} 1 text ab 0 (cd)} test parse-12.20 {Tcl_ParseVarName procedure, array reference} testparser { testparser {$x(abc)} 0 } {- {$x(abc)} 1 word {$x(abc)} 3 variable {$x(abc)} 2 text x 0 text abc 0 {}} test parse-12.21 {Tcl_ParseVarName procedure, array reference} testparser { testparser {$x(ab$cde[foo bar])} 0 } {- {$x(ab$cde[foo bar])} 1 word {$x(ab$cde[foo bar])} 6 variable {$x(ab$cde[foo bar])} 5 text x 0 text ab 0 variable {$cde} 1 text cde 0 command {[foo bar]} 0 {}} test parse-12.22 {Tcl_ParseVarName procedure, array reference} testparser { testparser {$x([cmd arg]zz)} 0 } {- {$x([cmd arg]zz)} 1 word {$x([cmd arg]zz)} 4 variable {$x([cmd arg]zz)} 3 text x 0 command {[cmd arg]} 0 text zz 0 {}} test parse-12.23 {Tcl_ParseVarName procedure, missing close paren in array reference} testparser { list [catch {testparser {$x(poiu} 0} msg] $msg $::errorInfo } {1 {missing )} {missing ) (remainder of script: "(poiu") invoked from within "testparser {$x(poiu} 0"}} test parse-12.24 {Tcl_ParseVarName procedure, missing close paren in array reference} testparsevarname { list [catch {testparsevarname {$ab(cd)} 6 0} msg] $msg $::errorInfo } {1 {missing )} {missing ) (remainder of script: "(cd)") invoked from within "testparsevarname {$ab(cd)} 6 0"}} test parse-12.25 {Tcl_ParseVarName procedure, nested array reference} testparser { testparser {$x(a$y(b$z))} 0 } {- {$x(a$y(b$z))} 1 word {$x(a$y(b$z))} 8 variable {$x(a$y(b$z))} 7 text x 0 text a 0 variable {$y(b$z)} 4 text y 0 text b 0 variable {$z} 1 text z 0 {}} test parse-12.26 {Tcl_ParseVarName [d2ffcca163] non-ascii} testparser { testparser "$\u0433" -1 } "- {$\u0433} 1 word {$\u0433} 2 text {$} 0 text \u0433 0 {}" test parse-13.1 {Tcl_ParseVar procedure} testparsevar { set abc 24 testparsevar {$abc.fg} } {24 .fg} test parse-13.2 {Tcl_ParseVar procedure, no variable name} testparsevar { testparsevar {$} } {{$} {}} test parse-13.3 {Tcl_ParseVar procedure, no variable name} testparsevar { testparsevar {$.123} } {{$} .123} test parse-13.4 {Tcl_ParseVar procedure, error looking up variable} testparsevar { unset -nocomplain abc list [catch {testparsevar {$abc}} msg] $msg } {1 {can't read "abc": no such variable}} test parse-13.5 {Tcl_ParseVar procedure, error looking up variable} testparsevar { unset -nocomplain abc list [catch {testparsevar {$abc([bogus x y z])}} msg] $msg } {1 {invalid command name "bogus"}} test parse-13.6 {Tcl_ParseVar memory leak} -constraints {testparsevar memory} -setup { proc getbytes {} { return [lindex [split [memory info] \n] 3 3] } } -body { set a() foo set end [getbytes] for {set i 0} {$i < 5} {incr i} { set vn {} set res [testparsevar [append vn $ a([string repeat {[]} 19]) bar]] if {$res ne {foo bar}} {error "Unexpected result: $res"} set tmp $end set end [getbytes] } expr {$end - $tmp} } -cleanup { unset -nocomplain a end i vn res tmp rename getbytes {} } -result 0 test parse-14.1 {Tcl_ParseBraces procedure, computing string length} {testparser testbytestring} { testparser [testbytestring "foo\x00 bar"] -1 } {- foo 1 simple foo 1 text foo 0 {}} test parse-14.2 {Tcl_ParseBraces procedure, computing string length} testparser { testparser "foo bar" -1 } {- {foo bar} 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}} test parse-14.3 {Tcl_ParseBraces procedure, words in braces} testparser { testparser {foo {a $b [concat foo]} {c d}} 0 } {- {foo {a $b [concat foo]} {c d}} 3 simple foo 1 text foo 0 simple {{a $b [concat foo]}} 1 text {a $b [concat foo]} 0 simple {{c d}} 1 text {c d} 0 {}} test parse-14.4 {Tcl_ParseBraces procedure, empty nested braces} testparser { testparser {foo {{}}} 0 } {- {foo {{}}} 2 simple foo 1 text foo 0 simple {{{}}} 1 text {{}} 0 {}} test parse-14.5 {Tcl_ParseBraces procedure, nested braces} testparser { testparser {foo {{a {b} c} {} {d e}}} 0 } {- {foo {{a {b} c} {} {d e}}} 2 simple foo 1 text foo 0 simple {{{a {b} c} {} {d e}}} 1 text {{a {b} c} {} {d e}} 0 {}} test parse-14.6 {Tcl_ParseBraces procedure, backslashes in words in braces} testparser { testparser "foo {a \\n\\\{}" 0 } {- {foo {a \n\{}} 2 simple foo 1 text foo 0 simple {{a \n\{}} 1 text {a \n\{} 0 {}} test parse-14.7 {Tcl_ParseBraces procedure, missing continuation line in braces} testparser { list [catch {testparser "\{abc\\\n" 0} msg] $msg $::errorInfo } {1 {missing close-brace} missing\ close-brace\n\ \ \ \ (remainder\ of\ script:\ \"\{abc\\\n\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"\\\{abc\\\\\\n\"\ 0\"} test parse-14.8 {Tcl_ParseBraces procedure, backslash-newline in braces} testparser { testparser "foo {\\\nx}" 0 } {- foo\ \{\\\nx\} 2 simple foo 1 text foo 0 word \{\\\nx\} 2 backslash \\\n 0 text x 0 {}} test parse-14.9 {Tcl_ParseBraces procedure, backslash-newline in braces} testparser { testparser "foo {a \\\n b}" 0 } {- foo\ \{a\ \\\n\ \ \ b\} 2 simple foo 1 text foo 0 word \{a\ \\\n\ \ \ b\} 3 text {a } 0 backslash \\\n\ \ \ 0 text b 0 {}} test parse-14.10 {Tcl_ParseBraces procedure, backslash-newline in braces} testparser { testparser "foo {xyz\\\n }" 0 } {- foo\ \{xyz\\\n\ \} 2 simple foo 1 text foo 0 word \{xyz\\\n\ \} 2 text xyz 0 backslash \\\n\ 0 {}} test parse-14.11 {Tcl_ParseBraces procedure, empty braced string} testparser { testparser {foo {}} 0 } {- {foo {}} 2 simple foo 1 text foo 0 simple {{}} 1 text {} 0 {}} test parse-14.12 {Tcl_ParseBraces procedure, missing close brace} testparser { list [catch {testparser "foo \{xy\\\nz" 0} msg] $msg $::errorInfo } {1 {missing close-brace} missing\ close-brace\n\ \ \ \ (remainder\ of\ script:\ \"\{xy\\\nz\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"foo\ \\\{xy\\\\\\nz\"\ 0\"} test parse-15.1 {Tcl_ParseQuotedString procedure, computing string length} {testparser testbytestring} { testparser [testbytestring "foo\x00 bar"] -1 } {- foo 1 simple foo 1 text foo 0 {}} test parse-15.2 {Tcl_ParseQuotedString procedure, computing string length} testparser { testparser "foo bar" -1 } {- {foo bar} 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}} test parse-15.3 {Tcl_ParseQuotedString procedure, word is quoted string} testparser { testparser {foo "a b c" d "efg";} 0 } {- {foo "a b c" d "efg";} 4 simple foo 1 text foo 0 simple {"a b c"} 1 text {a b c} 0 simple d 1 text d 0 simple {"efg"} 1 text efg 0 {}} test parse-15.4 {Tcl_ParseQuotedString procedure, garbage after quoted string} testparser { list [catch {testparser {foo "a b c"d} 0} msg] $msg $::errorInfo } {1 {extra characters after close-quote} {extra characters after close-quote (remainder of script: "d") invoked from within "testparser {foo "a b c"d} 0"}} test parse-15.5 {CommandComplete procedure} { info complete "" } 1 test parse-15.6 {CommandComplete procedure} { info complete " \n" } 1 test parse-15.7 {CommandComplete procedure} { info complete "abc def" } 1 test parse-15.8 {CommandComplete procedure} { info complete "a b c d e f \t\n" } 1 test parse-15.9 {CommandComplete procedure} { info complete {a b c"d} } 1 test parse-15.10 {CommandComplete procedure} { info complete {a b "c d" e} } 1 test parse-15.11 {CommandComplete procedure} { info complete {a b "c d"} } 1 test parse-15.12 {CommandComplete procedure} { info complete {a b "c d"} } 1 test parse-15.13 {CommandComplete procedure} { info complete {a b "c d} } 0 test parse-15.14 {CommandComplete procedure} { info complete {a b "} } 0 test parse-15.15 {CommandComplete procedure} { info complete {a b "cd"xyz} } 1 test parse-15.16 {CommandComplete procedure} { info complete {a b "c $d() d"} } 1 test parse-15.17 {CommandComplete procedure} { info complete {a b "c $dd("} } 1 test parse-15.18 {CommandComplete procedure} { info complete {a b "c \"} } 0 test parse-15.19 {CommandComplete procedure} { info complete {a b "c [d e f]"} } 1 test parse-15.20 {CommandComplete procedure} { info complete {a b "c [d e f] g"} } 1 test parse-15.21 {CommandComplete procedure} { info complete {a b "c [d e f"} } 0 test parse-15.22 {CommandComplete procedure} { info complete {a {b c d} e} } 1 test parse-15.23 {CommandComplete procedure} { info complete {a {b c d}} } 1 test parse-15.24 {CommandComplete procedure} { info complete "a b\{c d" } 1 test parse-15.25 {CommandComplete procedure} { info complete "a b \{c" } 0 test parse-15.26 {CommandComplete procedure} { info complete "a b \{c{ }" } 0 test parse-15.27 {CommandComplete procedure} { info complete "a b {c d e}xxx" } 1 test parse-15.28 {CommandComplete procedure} { info complete "a b {c \\\{d e}xxx" } 1 test parse-15.29 {CommandComplete procedure} { info complete {a b [ab cd ef]} } 1 test parse-15.30 {CommandComplete procedure} { info complete {a b x[ab][cd][ef] gh} } 1 test parse-15.31 {CommandComplete procedure} { info complete {a b x[ab][cd[ef] gh} } 0 test parse-15.32 {CommandComplete procedure} { info complete {a b x[ gh} } 0 test parse-15.33 {CommandComplete procedure} { info complete {[]]]} } 1 test parse-15.34 {CommandComplete procedure} { info complete {abc x$yyy} } 1 test parse-15.35 {CommandComplete procedure} { info complete "abc x\${abc\[\\d} xyz" } 1 test parse-15.36 {CommandComplete procedure} { info complete "abc x\$\{ xyz" } 0 test parse-15.37 {CommandComplete procedure} { info complete {word $a(xyz)} } 1 test parse-15.38 {CommandComplete procedure} { info complete {word $a(} } 0 test parse-15.39 {CommandComplete procedure} { info complete "set a \\\n" } 0 test parse-15.40 {CommandComplete procedure} { info complete "set a \\\\\n" } 1 test parse-15.41 {CommandComplete procedure} { info complete "set a \\n " } 1 test parse-15.42 {CommandComplete procedure} { info complete "set a \\" } 1 test parse-15.43 {CommandComplete procedure} { info complete "foo \\\n\{" } 0 test parse-15.44 {CommandComplete procedure} { info complete "a\nb\n# \{\n# \{\nc\n" } 1 test parse-15.45 {CommandComplete procedure} { info complete "#Incomplete comment\\\n" } 0 test parse-15.46 {CommandComplete procedure} { info complete "#Incomplete comment\\\nBut now it's complete.\n" } 1 test parse-15.47 {CommandComplete procedure} { info complete "# Complete comment\\\\\n" } 1 test parse-15.48 {CommandComplete procedure} { info complete "abc\\\n def" } 1 test parse-15.49 {CommandComplete procedure} { info complete "abc\\\n " } 1 test parse-15.50 {CommandComplete procedure} { info complete "abc\\\n" } 0 test parse-15.51 {CommandComplete procedure} " info complete \"\\\{abc\\\}\\\{\" " 1 test parse-15.52 {CommandComplete procedure} { info complete "\"abc\"(" } 1 test parse-15.53 {CommandComplete procedure} " info complete \" # \{\" " 1 test parse-15.54 {CommandComplete procedure} " info complete \"foo bar;# \{\" " 1 test parse-15.55 {CommandComplete procedure} testbytestring { info complete "set x [testbytestring \x00]; puts hi" } 1 test parse-15.56 {CommandComplete procedure} testbytestring { info complete "set x [testbytestring \x00]; \{" } 0 test parse-15.57 {CommandComplete procedure} { info complete "# Comment should be complete command" } 1 test parse-15.58 {CommandComplete procedure, memory leaks} { info complete "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22" } 1 test parse-15.59 {CommandComplete procedure} testbytestring { # Test for Tcl Bug 684744 info complete [testbytestring "\x00;if 1 \{"] } 0 test parse-15.60 {CommandComplete procedure} { # Test for Tcl Bug 1968882 info complete \\\n } 0 test parse-16.1 {Bug 218885 (Scriptics bug 2535)} { subst {[eval {return foo}]bar} } foobar test parse-17.1 {Correct return codes from errors during substitution} { catch {eval {w[continue]}} } 4 test parse-18.1 {Tcl_SubstObj, ParseTokens flags} { subst {foo\t$::tcl_library\t[set ::tcl_library]} } "foo $::tcl_library $::tcl_library" test parse-18.2 {Tcl_SubstObj, ParseTokens flags} { subst -nocommands {foo\t$::tcl_library\t[set ::tcl_library]} } "foo $::tcl_library \[set ::tcl_library]" test parse-18.3 {Tcl_SubstObj, ParseTokens flags} { subst -novariables {foo\t$::tcl_library\t[set ::tcl_library]} } "foo \$::tcl_library $::tcl_library" test parse-18.4 {Tcl_SubstObj, ParseTokens flags} { subst -nobackslashes {foo\t$::tcl_library\t[set ::tcl_library]} } "foo\\t$::tcl_library\\t$::tcl_library" test parse-18.5 {Tcl_SubstObj, ParseTokens flags} { subst -novariables -nobackslashes {foo\t$::tcl_library\t[set ::tcl_library]} } "foo\\t\$::tcl_library\\t$::tcl_library" test parse-18.6 {Tcl_SubstObj, ParseTokens flags} { subst -nocommands -nobackslashes {foo\t$::tcl_library\t[set ::tcl_library]} } "foo\\t$::tcl_library\\t\[set ::tcl_library]" test parse-18.7 {Tcl_SubstObj, ParseTokens flags} { subst -nocommands -novariables {foo\t$::tcl_library\t[set ::tcl_library]} } "foo \$::tcl_library \[set ::tcl_library]" test parse-18.8 {Tcl_SubstObj, ParseTokens flags} { subst -nocommands -novariables -nobackslashes \ {foo\t$::tcl_library\t[set ::tcl_library]} } "foo\\t\$::tcl_library\\t\[set ::tcl_library]" test parse-18.9 {Tcl_SubstObj, parse errors} { list [catch "subst foo\$\{foo" msg] $msg } [list 1 "missing close-brace for variable name"] test parse-18.10 {Tcl_SubstObj, parse errors} { list [catch "subst foo\[set \$\{foo]" msg] $msg } [list 1 "missing close-brace for variable name"] test parse-18.11 {Tcl_SubstObj, parse errors} { list [catch "subst foo\$array(\$\{foo)" msg] $msg } [list 1 "missing close-brace for variable name"] test parse-18.12 {Tcl_SubstObj, parse errors} { list [catch "subst foo\$(\$\{foo)" msg] $msg } [list 1 "missing close-brace for variable name"] test parse-18.13 {Tcl_SubstObj, parse errors} { list [catch "subst \[" msg] $msg } [list 1 "missing close-bracket"] test parse-18.14 {Tcl_SubstObj, exception handling} { subst {abc,[break],def} } {abc,} test parse-18.15 {Tcl_SubstObj, exception handling} { subst {abc,[continue; expr {1+2}],def} } {abc,,def} test parse-18.16 {Tcl_SubstObj, exception handling} { subst {abc,[return foo; expr {1+2}],def} } {abc,foo,def} test parse-18.17 {Tcl_SubstObj, exception handling} { subst {abc,[return -code 10 foo; expr {1+2}],def} } {abc,foo,def} test parse-18.18 {Tcl_SubstObj, exception handling} { subst {abc,[break; set {} {}{}],def} } {abc,} test parse-18.19 {Tcl_SubstObj, exception handling} { list [catch {subst {abc,[continue; expr {1+2}; set {} {}{}],def}} msg] $msg } [list 1 "extra characters after close-brace"] test parse-18.20 {Tcl_SubstObj, exception handling} { list [catch {subst {abc,[return foo; expr {1+2}; set {} {}{}],def}} msg] $msg } [list 1 "extra characters after close-brace"] test parse-18.21 {Tcl_SubstObj, exception handling} { list [catch { subst {abc,[return -code 10 foo; expr {1+2}; set {} {}{}],def} } msg] $msg } [list 1 "extra characters after close-brace"] test parse-18.22 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a]bar}] $a } [list foo1bar 1] test parse-18.23 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a; incr a]bar}] $a } [list foo2bar 2] test parse-18.24 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a; break; incr a]bar}] $a } [list foo 1] test parse-18.25 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a; continue; incr a]bar}] $a } [list foobar 1] test parse-18.26 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a; return; incr a]bar}] $a } [list foobar 1] test parse-18.27 {Tcl_SubstObj, side effects} { set a 0 list [subst {foo[incr a; return -code 10; incr a]bar}] $a } [list foobar 1] test parse-18.28 {Tcl_SubstObj, side effects} { set a 0 catch {subst {foo[incr a; parse error {}{}; incr a]bar}} set a } 1 test parse-18.29 {Tcl_SubstObj, side effects} { set a 0 catch {subst {foo[incr a; incr a; parse error {}{}]bar}} set a } 2 test parse-18.30 {Tcl_SubstObj, side effects} { set a 0 catch {subst {foo[incr a; incr a parse error {}{}]bar}} set a } 1 test parse-19.1 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints { testevalex } -setup { interp create i load {} Tcltest i i eval {proc {} args {}} interp recursionlimit i 3 } -body { i eval {testevalex {[]}} } -cleanup { interp delete i } test parse-19.2 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints { testevalex } -setup { interp create i load {} Tcltest i i eval {proc {} args {}} interp recursionlimit i 2 } -body { i eval {testevalex {[[]]}} } -cleanup { interp delete i } -returnCodes error -match glob -result {too many nested*} test parse-19.3 {Bug 1115904: recursion limit in Tcl_EvalEx} emptyTest { # Test no longer valid in Tcl 8.6 } {} test parse-19.4 {Bug 1115904: recursion limit in Tcl_EvalEx} emptyTest { # Test no longer valid in Tcl 8.6 } {} test parse-20.1 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 1 } {- \\ 1 simple \\ 1 text \\ 0 u12345} test parse-20.2 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 2 } {- {\u} 1 word {\u} 1 backslash {\u} 0 12345} test parse-20.3 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 3 } {- {\u1} 1 word {\u1} 1 backslash {\u1} 0 2345} test parse-20.4 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 4 } {- {\u12} 1 word {\u12} 1 backslash {\u12} 0 345} test parse-20.5 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 5 } {- {\u123} 1 word {\u123} 1 backslash {\u123} 0 45} test parse-20.6 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 6 } {- {\u1234} 1 word {\u1234} 1 backslash {\u1234} 0 5} test parse-20.7 {TclParseBackslash: truncated escape} testparser { testparser {\u12345} 7 } {- {\u12345} 1 word {\u12345} 2 backslash {\u1234} 0 text 5 0 {}} test parse-20.8 {TclParseBackslash: truncated escape} testparser { testparser {\x12X} 1 } {- \\ 1 simple \\ 1 text \\ 0 x12X} test parse-20.9 {TclParseBackslash: truncated escape} testparser { testparser {\x12X} 2 } {- {\x} 1 word {\x} 1 backslash {\x} 0 12X} test parse-20.10 {TclParseBackslash: truncated escape} testparser { testparser {\x12X} 3 } {- {\x1} 1 word {\x1} 1 backslash {\x1} 0 2X} test parse-20.11 {TclParseBackslash: truncated escape} testparser { testparser {\x12X} 4 } {- {\x12} 1 word {\x12} 1 backslash {\x12} 0 X} test parse-20.12 {TclParseBackslash: truncated escape} testparser { testparser {\x12X} 5 } {- {\x12X} 1 word {\x12X} 2 backslash {\x12} 0 text X 0 {}} test parse-21.0 {Bug 1884496} testevent { set ::script {testevent delete a; set a [p]; set ::done $a} proc ::p {} {string first s $::script} testevent queue a head $::script vwait done } {} test parse-21.1 {TCL_EVAL_DIRECT coverage} testevent { testevent queue a head {testevent delete a; \ set ::done [dict get [info frame 0] line]} vwait done set ::done } 2 cleanupTests } namespace delete ::tcl::test::parse return tcl9.0.3/tests/package.test0000644000175000017500000013600415104661341015211 0ustar sergeisergei# This file contains tests for the package and ::pkg::* commands. # Note that the tests are limited to Tcl scripts only, there are no shared # libraries against which to test. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2011 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Do all this in a child interp to avoid garbaging the package list set i [interp create] tcltest::loadIntoChildInterpreter $i {*}$argv catch [list load {} Tcltest $i] interp eval $i { namespace import -force ::tcltest::* #package forget {*}[package names] set oldPkgUnknown [package unknown] package unknown {} set oldPath $auto_path set auto_path "" testConstraint testpreferstable [llength [info commands testpreferstable]] test package-1.1 {pkg::create gives error on insufficient args} -body { ::pkg::create } -returnCodes error -match glob -result {wrong # args: should be "*"} test package-1.2 {pkg::create gives error on bad args} -body { ::pkg::create -foo bar -bar baz -baz boo } -returnCodes error -match glob -result {unknown option "bar": *} test package-1.3 {pkg::create gives error on no value given} -body { ::pkg::create -name foo -version 1.0 -source test.tcl -load } -returnCodes error -match glob -result {value for "-load" missing: *} test package-1.4 {pkg::create gives error on no name given} -body { ::pkg::create -version 1.0 -source test.tcl -load foo.so } -returnCodes error -match glob -result {value for "-name" missing: *} test package-1.5 {pkg::create gives error on no version given} -body { ::pkg::create -name foo -source test.tcl -load foo.so } -returnCodes error -match glob -result {value for "-version" missing: *} test package-1.6 {pkg::create gives error on no source or load options} -body { ::pkg::create -name foo -version 1.0 -version 2.0 } -returnCodes error -result {at least one of -load and -source must be given} test package-1.7 {pkg::create gives correct output for 1 direct source} { ::pkg::create -name foo -version 1.0 -source test.tcl } {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]} test package-1.8 {pkg::create gives correct output for 2 direct sources} { ::pkg::create -name foo -version 1.0 -source test.tcl -source test2.tcl } {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]\n[list source [file join $dir test2.tcl]]} test package-1.9 {pkg::create gives correct output for 1 direct load} { ::pkg::create -name foo -version 1.0 -load test.so } {package ifneeded foo 1.0 [list load [file join $dir test.so]]} test package-1.10 {pkg::create gives correct output for 2 direct loads} { ::pkg::create -name foo -version 1.0 -load test.so -load test2.so } {package ifneeded foo 1.0 [list load [file join $dir test.so]]\n[list load [file join $dir test2.so]]} test package-1.11 {pkg::create gives correct output for 1 lazy source} { ::pkg::create -name foo -version 1.0 -source {test.tcl {foo bar}} } {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.tcl source {foo bar}}}]} test package-1.12 {pkg::create gives correct output for 2 lazy sources} { ::pkg::create -name foo -version 1.0 -source {test.tcl {foo bar}} \ -source {test2.tcl {baz boo}} } {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.tcl source {foo bar}} {test2.tcl source {baz boo}}}]} test package-1.13 {pkg::create gives correct output for 1 lazy load} { ::pkg::create -name foo -version 1.0 -load {test.so {foo bar}} } {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.so load {foo bar}}}]} test package-1.14 {pkg::create gives correct output for 2 lazy loads} { ::pkg::create -name foo -version 1.0 -load {test.so {foo bar}} \ -load {test2.so {baz boo}} } {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.so load {foo bar}} {test2.so load {baz boo}}}]} test package-1.15 {pkg::create gives correct output for 1 each, direct} { ::pkg::create -name foo -version 1.0 -source test.tcl -load test2.so } {package ifneeded foo 1.0 [list load [file join $dir test2.so]]\n[list source [file join $dir test.tcl]]} test package-1.16 {pkg::create gives correct output for 1 direct, 1 lazy} { ::pkg::create -name foo -version 1.0 -source test.tcl \ -source {test2.tcl {foo bar}} } {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]\n[list tclPkgSetup $dir foo 1.0 {{test2.tcl source {foo bar}}}]} test package-2.1 {Tcl_PkgProvide procedure} { package forget t package provide t 2.3 } {} test package-2.2 {Tcl_PkgProvide procedure} -returnCodes error -setup { package forget t } -body { package provide t 2.3 package provide t 2.2 } -result {conflicting versions provided for package "t": 2.3, then 2.2} test package-2.3 {Tcl_PkgProvide procedure} -returnCodes error -setup { package forget t } -body { package provide t 2.3 package provide t 2.4 } -result {conflicting versions provided for package "t": 2.3, then 2.4} test package-2.4 {Tcl_PkgProvide procedure} -returnCodes error -setup { package forget t } -body { package provide t 2.3 package provide t 3.3 } -result {conflicting versions provided for package "t": 2.3, then 3.3} test package-2.5 {Tcl_PkgProvide procedure} -setup { package forget t } -body { package provide t 2.3 package provide t 2.3 } -result {} test package-2.6 {Tcl_PkgProvide procedure} { package forget t package provide t 2.3a1 } {} set n 0 foreach v { 2.3k1 2a3a2 2ab3 2.a4 2.b4 2b.4 2a.4 2ba4 2a4b1 2b4a1 2b3b2 } { test package-2.7.$n {Tcl_PkgProvide procedure} -setup { package forget t } -returnCodes error -body " package provide t $v " -result "expected version number but got \"$v\"" incr n } test package-3.1 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t set x xxx } -body { foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } -result {3.4} test package-3.2 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t set x xxx } -body { foreach i {1.4 3.4 2.3 2.4 2.2 3.5 3.2} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } -result {3.5} test package-3.3 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t set x xxx } -body { foreach i {3.5 2.1 2.3} { package ifneeded t $i "set x $i; package provide t $i" } package require t 2.2 set x } -result {2.3} test package-3.4 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t set x xxx } -body { foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i; package provide t $i" } package require -exact t 2.3 set x } -result {2.3} test package-3.5 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t set x xxx } -body { foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i; package provide t $i" } package require t 2.1 set x } -result {2.4} test package-3.6 {Tcl_PkgRequire procedure, can't find suitable version} -setup { package forget t } -returnCodes error -body { package unknown {} foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i" } package require t 2.5 } -result {can't find package t 2.5} test package-3.7 {Tcl_PkgRequire procedure, can't find suitable version} -setup { package forget t } -returnCodes error -body { package unknown {} foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i" } package require t 4.1 } -result {can't find package t 4.1} test package-3.8 {Tcl_PkgRequire procedure, can't find suitable version} -setup { package forget t } -returnCodes error -body { package unknown {} foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i" } package require -exact t 1.3 } -result {can't find package t exactly 1.3} test package-3.9 {Tcl_PkgRequire procedure, can't find suitable version} -setup { package forget t } -returnCodes error -body { package unknown {} package require t } -result {can't find package t} test package-3.10 {Tcl_PkgRequire procedure, error in ifneeded script} -setup { package forget t } -body { package ifneeded t 2.1 {package provide t 2.1; error "ifneeded test"} list [catch {package require t 2.1} msg] $msg $::errorInfo } -match glob -result {1 {ifneeded test} {ifneeded test while executing "error "ifneeded test"" ("package ifneeded*" script) invoked from within "package require t 2.1"}} test package-3.11 {Tcl_PkgRequire procedure, ifneeded script doesn't provide package} -setup { package forget t set x xxx } -body { package ifneeded t 2.1 "set x invoked" list [catch {package require t 2.1} msg] $msg $x } -match glob -result {1 * invoked} test package-3.12 {Tcl_PkgRequire procedure, self-deleting script} -setup { package forget t set x xxx } -body { package ifneeded t 1.2 "package forget t; set x 1.2; package provide t 1.2" package require t 1.2 set x } -result {1.2} test package-3.13 {Tcl_PkgRequire procedure, "package unknown" support} -setup { package forget t set x xxx } -body { proc pkgUnknown args { # args = name requirement # requirement = v-v (for exact version) global x set x $args package provide [lindex $args 0] [lindex [split [lindex $args 1] -] 0] } foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i" } package unknown pkgUnknown package require -exact t 1.5 set x } -cleanup { package unknown {} } -result {t 1.5-1.5} test package-3.14 {Tcl_PkgRequire procedure, "package unknown" support} -setup { package forget t set x xxx } -body { proc pkgUnknown args { package ifneeded t 1.2 "set x loaded; package provide t 1.2" } package unknown pkgUnknown list [package require t] $x } -cleanup { package unknown {} } -result {1.2 loaded} test package-3.15 {Tcl_PkgRequire procedure, "package unknown" support} -setup { package forget {a b} package unknown pkgUnknown set x xxx } -body { proc pkgUnknown args { global x set x $args package provide [lindex $args 0] 2.0 } package require {a b} set x } -cleanup { package unknown {} } -result {{a b} 0-} test package-3.16 {Tcl_PkgRequire procedure, "package unknown" error} -setup { package forget t } -body { proc pkgUnknown args { error "testing package unknown" } package unknown pkgUnknown list [catch {package require t} msg] $msg $::errorInfo } -cleanup { package unknown {} } -result {1 {testing package unknown} {testing package unknown while executing "error "testing package unknown"" (procedure "pkgUnknown" line 2) invoked from within "pkgUnknown t 0-" ("package unknown" script) invoked from within "package require t"}} test package-3.17 {Tcl_PkgRequire procedure, "package unknown" doesn't load package} -setup { package forget t set x xxx } -body { proc pkgUnknown args { global x set x $args } foreach i {1.4 3.4 2.3 2.4 2.2} { package ifneeded t $i "set x $i" } package unknown pkgUnknown list [catch {package require -exact t 1.5} msg] $msg $x } -cleanup { package unknown {} } -result {1 {can't find package t exactly 1.5} {t 1.5-1.5}} test package-3.18 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -body { package provide t 2.3 package require t } -result {2.3} test package-3.19 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -body { package provide t 2.3 package require t 2.1 } -result {2.3} test package-3.20 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -body { package provide t 2.3 package require t 2.3 } -result {2.3} test package-3.21 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -returnCodes error -body { package provide t 2.3 package require t 2.4 } -result {version conflict for package "t": have 2.3, need 2.4} test package-3.22 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -returnCodes error -body { package provide t 2.3 package require t 1.2 } -result {version conflict for package "t": have 2.3, need 1.2} test package-3.23 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -body { package provide t 2.3 package require -exact t 2.3 } -result {2.3} test package-3.24 {Tcl_PkgRequire procedure, version checks} -setup { package forget t } -returnCodes error -body { package provide t 2.3 package require -exact t 2.2 } -result {version conflict for package "t": have 2.3, need exactly 2.2} test package-3.25 {Tcl_PkgRequire procedure, error in ifneeded script} -setup { package forget t } -body { package ifneeded t 2.1 {package provide t 2.1; error "ifneeded test" EI} list [catch {package require t 2.1} msg] $msg $::errorInfo } -match glob -result {1 {ifneeded test} {EI ("package ifneeded*" script) invoked from within "package require t 2.1"}} test package-3.26 {Tcl_PkgRequire procedure, error in ifneeded script} -setup { package forget t } -body { package ifneeded t 2.1 {package provide t 2.1; foreach x 1 {error "ifneeded test" EI}} list [catch {package require t 2.1} msg] $msg $::errorInfo } -match glob -result {1 {ifneeded test} {EI ("foreach" body line 1) invoked from within "foreach x 1 {error "ifneeded test" EI}" ("package ifneeded*" script) invoked from within "package require t 2.1"}} test package-3.27 {Tcl_PkgRequire: circular dependency} -setup { package forget foo } -body { package ifneeded foo 1 {package require foo 1} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {circular package dependency:*} test package-3.28 {Tcl_PkgRequire: circular dependency} -setup { package forget foo } -body { package ifneeded foo 1 {package require foo 2} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {circular package dependency:*} test package-3.29 {Tcl_PkgRequire: circular dependency} -setup { package forget foo package forget bar } -body { package ifneeded foo 1 {package require bar 1; package provide foo 1} package ifneeded bar 1 {package require foo 1; package provide bar 1} package require foo 1 } -cleanup { package forget foo package forget bar } -returnCodes error -match glob -result {circular package dependency:*} test package-3.30 {Tcl_PkgRequire: circular dependency} -setup { package forget foo package forget bar } -body { package ifneeded foo 1 {package require bar 1; package provide foo 1} package ifneeded foo 2 {package provide foo 2} package ifneeded bar 1 {package require foo 2; package provide bar 1} package require foo 1 } -cleanup { package forget foo package forget bar } -returnCodes error -match glob -result {circular package dependency:*} test package-3.31 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {package provide foo 1; error foo} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result foo test package-3.32 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {package provide foo 1; error foo} catch {package require foo 1} package provide foo } -cleanup { package forget foo } -result {} test package-3.33 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {package provide foo 2} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {attempt to provide package * failed:*} test package-3.34 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {package provide foo 1.1} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {attempt to provide package * failed:*} test package-3.34.1 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1.1 {package provide foo 1} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {attempt to provide package * failed:*} test package-3.34.2 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1.1 {package provide foo 1} package require foo 1.1 } -cleanup { package forget foo } -returnCodes error -match glob -result {attempt to provide package * failed:*} test package-3.35 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob -result {attempt to provide package * failed:*} test package-3.35.1 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {break} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob \ -result {attempt to provide package * failed: bad return code:*} test package-3.36 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {continue} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob \ -result {attempt to provide package * failed: bad return code:*} test package-3.37 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {return} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob \ -result {attempt to provide package * failed: bad return code:*} test package-3.38 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo } -body { package ifneeded foo 1 {return -level 0 -code 10} package require foo 1 } -cleanup { package forget foo } -returnCodes error -match glob \ -result {attempt to provide package * failed: bad return code:*} test package-3.39 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo set saveUnknown [package unknown] package unknown {package provide foo 2 ;#} } -body { package require foo 1 } -cleanup { package forget foo package unknown $saveUnknown } -returnCodes error -match glob -result * test package-3.40 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo set saveUnknown [package unknown] package unknown {break ;#} } -body { package require foo 1 } -cleanup { package forget foo package unknown $saveUnknown } -returnCodes error -match glob -result {bad return code:*} test package-3.41 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo set saveUnknown [package unknown] package unknown {continue ;#} } -body { package require foo 1 } -cleanup { package forget foo package unknown $saveUnknown } -returnCodes error -match glob -result {bad return code:*} test package-3.42 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo set saveUnknown [package unknown] package unknown {return ;#} } -body { package require foo 1 } -cleanup { package forget foo package unknown $saveUnknown } -returnCodes error -match glob -result {bad return code:*} test package-3.43 {Tcl_PkgRequire: consistent return values (1162286)} -setup { package forget foo set saveUnknown [package unknown] package unknown {return -level 0 -code 10 ;#} } -body { package require foo 1 } -cleanup { package forget foo package unknown $saveUnknown } -returnCodes error -match glob -result {bad return code:*} test package-3.44 {Tcl_PkgRequire: exact version matching (1578344)} -setup { package provide demo 1.2.3 } -body { package require -exact demo 1.2 } -returnCodes error -cleanup { package forget demo } -result {version conflict for package "demo": have 1.2.3, need exactly 1.2} test package-3.50 {Tcl_PkgRequire procedure, picking best stable version} -constraints testpreferstable -setup { interp create child load {} Tcltest child child eval { testpreferstable package forget t set x xxx } } -body { child eval { foreach i {1.4 3.4 4.0a1 2.3 2.4 2.2} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } } -cleanup { interp delete child } -result {3.4} test package-3.51 {Tcl_PkgRequire procedure, picking best stable version} -setup { package forget t set x xxx } -body { foreach i {1.2b1 1.2 1.3a2 1.3} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } -result {1.3} test package-3.52 {Tcl_PkgRequire procedure, picking best stable version} -setup { package forget t set x xxx } -body { foreach i {1.2b1 1.2 1.3 1.3a2} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } -result {1.3} test pkg-3.53 {Tcl_PkgRequire procedure, picking best stable version} -constraints testpreferstable -setup { testpreferstable package forget t set x xxx } -body { foreach i {1.2b1 1.1} { package ifneeded t $i "set x $i; package provide t $i" } package require t set x } -result {1.1} test package-3.54 {Tcl_PkgRequire procedure, coroutine support} -setup { package forget t } -body { coroutine coro1 apply {{} { package ifneeded t 2.1 { yield package provide t 2.1 } package require t 2.1 }} list [catch {coro1} msg] $msg } -match glob -result {0 2.1} test package-4.1 {Tcl_PackageCmd procedure} -returnCodes error -body { package } -result {wrong # args: should be "package option ?arg ...?"} test package-4.2 {Tcl_PackageCmd procedure, "forget" option} -setup { interp create child } -body { child eval { package forget {*}[package names] package names } } -cleanup { interp delete child } -result {} test package-4.3 {Tcl_PackageCmd procedure, "forget" option} -setup { interp create child } -body { child eval { package forget {*}[package names] package forget foo } } -cleanup { interp delete child } -result {} test package-4.4 {Tcl_PackageCmd procedure, "forget" option} -setup { interp create child child eval { package forget {*}[package names] set result {} } } -body { child eval { package ifneeded t 1.1 {first script} package ifneeded t 2.3 {second script} package ifneeded x 1.4 {x's script} lappend result [lsort [package names]] [package versions t] package forget t lappend result [lsort [package names]] [package versions t] } } -cleanup { interp delete child } -result {{t x} {1.1 2.3} x {}} test package-4.5 {Tcl_PackageCmd procedure, "forget" option} -setup { interp create child child eval { package forget {*}[package names] } } -body { child eval { package ifneeded a 1.1 {first script} package ifneeded b 2.3 {second script} package ifneeded c 1.4 {third script} package forget set result [list [lsort [package names]]] package forget a c lappend result [lsort [package names]] } } -cleanup { interp delete child } -result {{a b c} b} test package-4.5.1 {Tcl_PackageCmd procedure, "forget" option} -body { # Test for Bug 415273 package ifneeded a 1 "I should have been forgotten" package forget no-such-package a package ifneeded a 1 } -cleanup { package forget a } -result {} test package-4.6 {Tcl_PackageCmd procedure, "ifneeded" option} -body { package ifneeded a } -returnCodes error -result {wrong # args: should be "package ifneeded package version ?script?"} test package-4.7 {Tcl_PackageCmd procedure, "ifneeded" option} -body { package ifneeded a b c d } -returnCodes error -result {wrong # args: should be "package ifneeded package version ?script?"} test package-4.8 {Tcl_PackageCmd procedure, "ifneeded" option} -body { package ifneeded t xyz } -returnCodes error -result {expected version number but got "xyz"} test package-4.9 {Tcl_PackageCmd procedure, "ifneeded" option} -setup { interp create child } -body { child eval { package forget {*}[package names] list [package ifneeded foo 1.1] [package names] } } -cleanup { interp delete child } -result {{} {}} test package-4.10 {Tcl_PackageCmd procedure, "ifneeded" option} -setup { interp create child child eval { package forget {*}[package names] } } -body { child eval { package ifneeded t 1.4 "script for t 1.4" list [package names] [package ifneeded t 1.4] [package versions t] } } -cleanup { interp delete child } -result {t {script for t 1.4} 1.4} test package-4.11 {Tcl_PackageCmd procedure, "ifneeded" option} -setup { interp create child child eval { package forget {*}[package names] } } -body { child eval { package ifneeded t 1.4 "script for t 1.4" list [package ifneeded t 1.5] [package names] [package versions t] } } -cleanup { interp delete child } -result {{} t 1.4} test package-4.12 {Tcl_PackageCmd procedure, "ifneeded" option} -setup { interp create child child eval { package forget {*}[package names] } } -body { child eval { package ifneeded t 1.4 "script for t 1.4" package ifneeded t 1.4 "second script for t 1.4" list [package ifneeded t 1.4] [package names] [package versions t] } } -cleanup { interp delete child } -result {{second script for t 1.4} t 1.4} test package-4.13 {Tcl_PackageCmd procedure, "ifneeded" option} -setup { package forget t } -body { package ifneeded t 1.4 "script for t 1.4" package ifneeded t 1.2 "second script" package ifneeded t 3.1 "last script" list [package ifneeded t 1.2] [package versions t] } -result {{second script} {1.4 1.2 3.1}} test package-4.14 {Tcl_PackageCmd procedure, "names" option} -body { package names a } -returnCodes error -result {wrong # args: should be "package names"} test package-4.15 {Tcl_PackageCmd procedure, "names" option} -setup { interp create child } -body { child eval { package forget {*}[package names] package names } } -cleanup { interp delete child } -result {} test package-4.16 {Tcl_PackageCmd procedure, "names" option} -setup { interp create child child eval { package forget {*}[package names] } } -body { child eval { package ifneeded x 1.2 {dummy} package provide x 1.3 package provide y 2.4 catch {package require z 47.16} lsort [package names] } } -cleanup { interp delete child } -result {x y} test package-4.17 {Tcl_PackageCmd procedure, "provide" option} -body { package provide } -returnCodes error -result {wrong # args: should be "package provide package ?version?"} test package-4.18 {Tcl_PackageCmd procedure, "provide" option} -body { package provide a b c } -returnCodes error -result {wrong # args: should be "package provide package ?version?"} test package-4.19 {Tcl_PackageCmd procedure, "provide" option} -setup { package forget t } -body { package provide t } -result {} test package-4.20 {Tcl_PackageCmd procedure, "provide" option} -setup { package forget t } -body { package provide t 2.3 package provide t } -result {2.3} test package-4.21 {Tcl_PackageCmd procedure, "provide" option} -setup { package forget t } -returnCodes error -body { package provide t a.b } -result {expected version number but got "a.b"} test package-4.22 {Tcl_PackageCmd procedure, "require" option} -returnCodes error -body { package require } -result {wrong # args: should be "package require ?-exact? package ?requirement ...?"} test package-4.24 {Tcl_PackageCmd procedure, "require" option} -body { package require -exact a b c # Exact syntax: -exact name version # name ?requirement ...? } -returnCodes error -result {wrong # args: should be "package require ?-exact? package ?requirement ...?"} test package-4.26 {Tcl_PackageCmd procedure, "require" option} -body { package require x a.b } -returnCodes error -result {expected version number but got "a.b"} test package-4.27 {Tcl_PackageCmd procedure, "require" option} -body { package require -exact x a.b } -returnCodes error -result {expected version number but got "a.b"} test package-4.28 {Tcl_PackageCmd procedure, "require" option} -body { package require -exact x } -returnCodes error -result {wrong # args: should be "package require ?-exact? package ?requirement ...?"} test package-4.29 {Tcl_PackageCmd procedure, "require" option} -body { package require -exact } -returnCodes error -result {wrong # args: should be "package require ?-exact? package ?requirement ...?"} test package-4.30 {Tcl_PackageCmd procedure, "require" option} -setup { package forget t } -body { package provide t 2.3 package require t 2.1 } -result {2.3} test package-4.31 {Tcl_PackageCmd procedure, "require" option} -setup { package forget t } -body { package require t } -returnCodes error -result {can't find package t} test package-4.32 {Tcl_PackageCmd procedure, "require" option} -setup { package forget t } -body { package ifneeded t 2.3 "error {synthetic error}" package require t 2.3 } -returnCodes error -result {synthetic error} test package-4.33 {Tcl_PackageCmd procedure, "unknown" option} -body { package unknown a b } -returnCodes error -result {wrong # args: should be "package unknown ?command?"} test package-4.34 {Tcl_PackageCmd procedure, "unknown" option} { package unknown "test script" package unknown } {test script} test package-4.35 {Tcl_PackageCmd procedure, "unknown" option} { package unknown "test script" package unknown {} package unknown } {} test package-4.36 {Tcl_PackageCmd procedure, "vcompare" option} -body { package vcompare a } -returnCodes error -result {wrong # args: should be "package vcompare version1 version2"} test package-4.37 {Tcl_PackageCmd procedure, "vcompare" option} -body { package vcompare a b c } -returnCodes error -result {wrong # args: should be "package vcompare version1 version2"} test package-4.38 {Tcl_PackageCmd procedure, "vcompare" option} -body { package vcompare x.y 3.4 } -returnCodes error -result {expected version number but got "x.y"} test package-4.39 {Tcl_PackageCmd procedure, "vcompare" option} -body { package vcompare 2.1 a.b } -returnCodes error -result {expected version number but got "a.b"} test package-4.40 {Tcl_PackageCmd procedure, "vcompare" option} { package vc 2.1 2.3 } {-1} test package-4.41 {Tcl_PackageCmd procedure, "vcompare" option} { package vc 2.2.4 2.2.4 } {0} test package-4.42 {Tcl_PackageCmd procedure, "versions" option} -body { package versions } -returnCodes error -result {wrong # args: should be "package versions package"} test package-4.43 {Tcl_PackageCmd procedure, "versions" option} -body { package versions a b } -returnCodes error -result {wrong # args: should be "package versions package"} test package-4.44 {Tcl_PackageCmd procedure, "versions" option} -body { package forget t package versions t } -result {} test package-4.45 {Tcl_PackageCmd procedure, "versions" option} -setup { package forget t } -body { package provide t 2.3 package versions t } -result {} test package-4.46 {Tcl_PackageCmd procedure, "versions" option} -setup { package forget t } -body { package ifneeded t 2.3 x package ifneeded t 2.4 y package versions t } -result {2.3 2.4} test package-4.47 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vsatisfies a } -returnCodes error -result {wrong # args: should be "package vsatisfies version ?requirement ...?"} test package-4.49 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vsatisfies x.y 3.4 } -returnCodes error -result {expected version number but got "x.y"} test package-4.50 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vcompare 2.1 a.b } -returnCodes error -result {expected version number but got "a.b"} test package-4.51 {Tcl_PackageCmd procedure, "vsatisfies" option} { package vs 2.3 2.1 } {1} test package-4.52 {Tcl_PackageCmd procedure, "vsatisfies" option} { package vs 2.3 1.2 } {0} test package-4.53 {Tcl_PackageCmd procedure, "versions" option} -body { package foo } -returnCodes error -result {bad option "foo": must be files, forget, ifneeded, names, prefer, present, provide, require, unknown, vcompare, versions, or vsatisfies} test package-4.54 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vsatisfies 2.1 2.1-3.2-4.5 } -returnCodes error -result {expected versionMin-versionMax but got "2.1-3.2-4.5"} test package-4.55 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vsatisfies 2.1 3.2-x.y } -returnCodes error -result {expected version number but got "x.y"} test package-4.56 {Tcl_PackageCmd procedure, "vsatisfies" option} -body { package vsatisfies 2.1 x.y-3.2 } -returnCodes error -result {expected version number but got "x.y"} # No tests for FindPackage; can't think up anything detectable errors. test package-5.1 {TclFreePackageInfo procedure} { interp create child child eval { package ifneeded t 2.3 x package ifneeded t 2.4 y package ifneeded x 3.1 z package provide q 4.3 package unknown "will this get freed?" } interp delete child } {} test package-5.2 {TclFreePackageInfo procedure} -body { interp create foo foo eval { package ifneeded t 2.3 x package ifneeded t 2.4 y package ifneeded x 3.1 z package provide q 4.3 } foo alias z kill proc kill {} { interp delete foo } foo eval package require x 3.1 } -returnCodes error -match glob -result * test package-6.1 {CheckVersion procedure} { package vcompare 1 2.1 } -1 test package-6.2 {CheckVersion procedure} -body { package vcompare .1 2.1 } -returnCodes error -result {expected version number but got ".1"} test package-6.3 {CheckVersion procedure} -body { package vcompare 111.2a.3 2.1 } -returnCodes error -result {expected version number but got "111.2a.3"} test package-6.4 {CheckVersion procedure} -body { package vcompare 1.2.3. 2.1 } -returnCodes error -result {expected version number but got "1.2.3."} test package-6.5 {CheckVersion procedure} -body { package vcompare 1.2..3 2.1 } -returnCodes error -result {expected version number but got "1.2..3"} test package-7.1 {ComparePkgVersions procedure} { package vcompare 1.23 1.22 } {1} test package-7.2 {ComparePkgVersions procedure} { package vcompare 1.22.1.2.3 1.22.1.2.3 } {0} test package-7.3 {ComparePkgVersions procedure} { package vcompare 1.21 1.22 } {-1} test package-7.4 {ComparePkgVersions procedure} { package vcompare 1.21 1.21.2 } {-1} test package-7.5 {ComparePkgVersions procedure} { package vcompare 1.21.1 1.21 } {1} test package-7.6 {ComparePkgVersions procedure} { package vsatisfies 1.21.1 1.21 } {1} test package-7.7 {ComparePkgVersions procedure} { package vsatisfies 2.22.3 1.21 } {0} test package-7.8 {ComparePkgVersions procedure} { package vsatisfies 1 1 } {1} test package-7.9 {ComparePkgVersions procedure} { package vsatisfies 2 1 } {0} test package-8.1 {Tcl_PkgPresent procedure, any version} -setup { package forget t } -body { package provide t 2.4 package present t } -result {2.4} test package-8.2 {Tcl_PkgPresent procedure, correct version} -setup { package forget t } -body { package provide t 2.4 package present t 2.4 } -result {2.4} test package-8.3 {Tcl_PkgPresent procedure, satisfying version} -setup { package forget t } -body { package provide t 2.4 package present t 2.0 } -result {2.4} test package-8.4 {Tcl_PkgPresent procedure, not satisfying version} -setup { package forget t } -returnCodes error -body { package provide t 2.4 package present t 2.6 } -result {version conflict for package "t": have 2.4, need 2.6} test package-8.5 {Tcl_PkgPresent procedure, not satisfying version} -setup { package forget t } -returnCodes error -body { package provide t 2.4 package present t 1.0 } -result {version conflict for package "t": have 2.4, need 1.0} test package-8.6 {Tcl_PkgPresent procedure, exact version} -setup { package forget t } -body { package provide t 2.4 package present -exact t 2.4 } -result {2.4} test package-8.7 {Tcl_PkgPresent procedure, not exact version} -setup { package forget t } -returnCodes error -body { package provide t 2.4 package present -exact t 2.3 } -result {version conflict for package "t": have 2.4, need exactly 2.3} test package-8.8 {Tcl_PkgPresent procedure, unknown package} -body { package forget t package present t } -returnCodes error -result {package t is not present} test package-8.9 {Tcl_PkgPresent procedure, unknown package} -body { package forget t package present t 2.4 } -returnCodes error -result {package t 2.4 is not present} test package-8.10 {Tcl_PkgPresent procedure, unknown package} -body { package forget t package present -exact t 2.4 } -returnCodes error -result {package t 2.4 is not present} test package-8.11 {Tcl_PackageCmd procedure, "present" option} -body { package present } -returnCodes error -result {wrong # args: should be "package present ?-exact? package ?requirement ...?"} test package-8.12 {Tcl_PackageCmd procedure, "present" option} -body { package present a b c } -returnCodes error -result {expected version number but got "b"} test package-8.13 {Tcl_PackageCmd procedure, "present" option} -body { package present -exact a b c } -returnCodes error -result {wrong # args: should be "package present ?-exact? package ?requirement ...?"} test package-8.14 {Tcl_PackageCmd procedure, "present" option} -body { package present -bs a b } -returnCodes error -result {expected version number but got "a"} test package-8.15 {Tcl_PackageCmd procedure, "present" option} -body { package present x a.b } -returnCodes error -result {expected version number but got "a.b"} test package-8.16 {Tcl_PackageCmd procedure, "present" option} -body { package present -exact x a.b } -returnCodes error -result {expected version number but got "a.b"} test package-8.17 {Tcl_PackageCmd procedure, "present" option} -body { package present -exact x } -returnCodes error -result {wrong # args: should be "package present ?-exact? package ?requirement ...?"} test package-8.18 {Tcl_PackageCmd procedure, "present" option} -body { package present -exact } -returnCodes error -result {wrong # args: should be "package present ?-exact? package ?requirement ...?"} set n 0 foreach {r p vs vc} { 8.5a0 8.5a5 1 -1 8.5a0 8.5b1 1 -1 8.5a0 8.5.1 1 -1 8.5a0 8.6a0 1 -1 8.5a0 8.6b0 1 -1 8.5a0 8.6.0 1 -1 8.5a6 8.5a5 0 1 8.5a6 8.5b1 1 -1 8.5a6 8.5.1 1 -1 8.5a6 8.6a0 1 -1 8.5a6 8.6b0 1 -1 8.5a6 8.6.0 1 -1 8.5b0 8.5a5 0 1 8.5b0 8.5b1 1 -1 8.5b0 8.5.1 1 -1 8.5b0 8.6a0 1 -1 8.5b0 8.6b0 1 -1 8.5b0 8.6.0 1 -1 8.5b2 8.5a5 0 1 8.5b2 8.5b1 0 1 8.5b2 8.5.1 1 -1 8.5b2 8.6a0 1 -1 8.5b2 8.6b0 1 -1 8.5b2 8.6.0 1 -1 8.5 8.5a5 1 1 8.5 8.5b1 1 1 8.5 8.5.1 1 -1 8.5 8.6a0 1 -1 8.5 8.6b0 1 -1 8.5 8.6.0 1 -1 8.5.0 8.5a5 0 1 8.5.0 8.5b1 0 1 8.5.0 8.5.1 1 -1 8.5.0 8.6a0 1 -1 8.5.0 8.6b0 1 -1 8.5.0 8.6.0 1 -1 10 8 0 1 8 10 0 -1 0.0.1.2 0.1.2 1 -1 } { test package-9.$n {package vsatisfies} { package vsatisfies $p $r } $vs test package-10.$n {package vcompare} { package vcompare $r $p } $vc incr n } test package-11.0.0 {package vcompare at 32bit boundary} { package vcompare [expr {1<<31}] [expr {(1<<31)-1}] } 1 # Note: It is correct that the result of the very first test, i.e. "5.0 5.0a0" # is 1, i.e. that version 5.0a0 satisfies a 5.0 requirement. # The requirement "5.0" internally translates first to "5.0-6", and then to # its final form of "5.0a0-6a0". These translations are explicitly specified # by the TIP (Search for "padded/extended internally with 'a0'"). This was # done intentionally for exactly the tested case, that an alpha package can # satisfy a requirement for the regular package. An example would be a package # FOO requiring Tcl 8.X for its operation. It can be used with Tcl 8.Xa0. # Without our translation that would not be possible. set n 0 foreach {required provided satisfied} { 5.0 5.0a0 1 5.0a0 5.0 1 8.5a0- 8.5a5 1 8.5a0- 8.5b1 1 8.5a0- 8.5.1 1 8.5a0- 8.6a0 1 8.5a0- 8.6b0 1 8.5a0- 8.6.0 1 8.5a6- 8.5a5 0 8.5a6- 8.5b1 1 8.5a6- 8.5.1 1 8.5a6- 8.6a0 1 8.5a6- 8.6b0 1 8.5a6- 8.6.0 1 8.5b0- 8.5a5 0 8.5b0- 8.5b1 1 8.5b0- 8.5.1 1 8.5b0- 8.6a0 1 8.5b0- 8.6b0 1 8.5b0- 8.6.0 1 8.5b2- 8.5a5 0 8.5b2- 8.5b1 0 8.5b2- 8.5.1 1 8.5b2- 8.6a0 1 8.5b2- 8.6b0 1 8.5b2- 8.6.0 1 8.5- 8.5a5 1 8.5- 8.5b1 1 8.5- 8.5.1 1 8.5- 8.6a0 1 8.5- 8.6b0 1 8.5- 8.6.0 1 8.5.0- 8.5a5 0 8.5.0- 8.5b1 0 8.5.0- 8.5.1 1 8.5.0- 8.6a0 1 8.5.0- 8.6b0 1 8.5.0- 8.6.0 1 8.5a0-7 8.5a5 0 8.5a0-7 8.5b1 0 8.5a0-7 8.5.1 0 8.5a0-7 8.6a0 0 8.5a0-7 8.6b0 0 8.5a0-7 8.6.0 0 8.5a6-7 8.5a5 0 8.5a6-7 8.5b1 0 8.5a6-7 8.5.1 0 8.5a6-7 8.6a0 0 8.5a6-7 8.6b0 0 8.5a6-7 8.6.0 0 8.5b0-7 8.5a5 0 8.5b0-7 8.5b1 0 8.5b0-7 8.5.1 0 8.5b0-7 8.6a0 0 8.5b0-7 8.6b0 0 8.5b0-7 8.6.0 0 8.5b2-7 8.5a5 0 8.5b2-7 8.5b1 0 8.5b2-7 8.5.1 0 8.5b2-7 8.6a0 0 8.5b2-7 8.6b0 0 8.5b2-7 8.6.0 0 8.5-7 8.5a5 0 8.5-7 8.5b1 0 8.5-7 8.5.1 0 8.5-7 8.6a0 0 8.5-7 8.6b0 0 8.5-7 8.6.0 0 8.5.0-7 8.5a5 0 8.5.0-7 8.5b1 0 8.5.0-7 8.5.1 0 8.5.0-7 8.6a0 0 8.5.0-7 8.6b0 0 8.5.0-7 8.6.0 0 8.5a0-8.6.1 8.5a5 1 8.5a0-8.6.1 8.5b1 1 8.5a0-8.6.1 8.5.1 1 8.5a0-8.6.1 8.6a0 1 8.5a0-8.6.1 8.6b0 1 8.5a0-8.6.1 8.6.0 1 8.5a6-8.6.1 8.5a5 0 8.5a6-8.6.1 8.5b1 1 8.5a6-8.6.1 8.5.1 1 8.5a6-8.6.1 8.6a0 1 8.5a6-8.6.1 8.6b0 1 8.5a6-8.6.1 8.6.0 1 8.5b0-8.6.1 8.5a5 0 8.5b0-8.6.1 8.5b1 1 8.5b0-8.6.1 8.5.1 1 8.5b0-8.6.1 8.6a0 1 8.5b0-8.6.1 8.6b0 1 8.5b0-8.6.1 8.6.0 1 8.5b2-8.6.1 8.5a5 0 8.5b2-8.6.1 8.5b1 0 8.5b2-8.6.1 8.5.1 1 8.5b2-8.6.1 8.6a0 1 8.5b2-8.6.1 8.6b0 1 8.5b2-8.6.1 8.6.0 1 8.5-8.6.1 8.5a5 1 8.5-8.6.1 8.5b1 1 8.5-8.6.1 8.5.1 1 8.5-8.6.1 8.6a0 1 8.5-8.6.1 8.6b0 1 8.5-8.6.1 8.6.0 1 8.5.0-8.6.1 8.5a5 0 8.5.0-8.6.1 8.5b1 0 8.5.0-8.6.1 8.5.1 1 8.5.0-8.6.1 8.6a0 1 8.5.0-8.6.1 8.6b0 1 8.5.0-8.6.1 8.6.0 1 8.5a0-8.5a0 8.5a0 1 8.5a0-8.5a0 8.5b1 0 8.5a0-8.5a0 8.4 0 8.5b0-8.5b0 8.5a5 0 8.5b0-8.5b0 8.5b0 1 8.5b0-8.5b0 8.5.1 0 8.5-8.5 8.5a5 0 8.5-8.5 8.5b1 0 8.5-8.5 8.5 1 8.5-8.5 8.5.1 0 8.5.0-8.5.0 8.5a5 0 8.5.0-8.5.0 8.5b1 0 8.5.0-8.5.0 8.5.0 1 8.5.0-8.5.0 8.5.1 0 8.5.0-8.5.0 8.6a0 0 8.5.0-8.5.0 8.6b0 0 8.5.0-8.5.0 8.6.0 0 8.2 9 0 8.2- 9 1 8.2-8.5 9 0 8.2-9.1 9 1 8.5-8.5 8.5b1 0 8.5a0-8.5 8.5b1 0 8.5a0-8.5.1 8.5b1 1 8.5-8.5 8.5 1 8.5.0-8.5.0 8.5 1 8.5a0-8.5.0 8.5 0 } { test package-11.$n "package vsatisfies $provided $required" { package vsatisfies $provided $required } $satisfied incr n } test package-12.0 "package vsatisfies multiple" { # yes no package vsatisfies 8.4 8.4 7.3 } 1 test package-12.1 "package vsatisfies multiple" { # no yes package vsatisfies 8.4 7.3 8.4 } 1 test package-12.2 "package vsatisfies multiple" { # yes yes package vsatisfies 8.4.2 8.4 8.4.1 } 1 test package-12.3 "package vsatisfies multiple" { # no no package vsatisfies 8.4 7.3 6.1 } 0 proc prefer {args} { set ip [interp create] try { lappend res [$ip eval {package prefer}] foreach mode $args { lappend res [$ip eval [list package prefer $mode]] } return $res } finally { interp delete $ip } } test package-13.0 {package prefer defaults} -body { prefer } -result [expr {[string match {*[ab]*} [package provide tcl]] ? "latest" : "stable"}] test package-13.1 {package prefer defaults} -body { set ::env(TCL_PKG_PREFER_LATEST) stable ;# value not relevant! prefer } -cleanup { unset -nocomplain ::env(TCL_PKG_PREFER_LATEST) } -result latest test package-14.0 {wrong\#args} -returnCodes error -body { package prefer foo bar } -result {wrong # args: should be "package prefer ?latest|stable?"} test package-14.1 {bogus argument} -returnCodes error -body { package prefer foo } -result {bad preference "foo": must be latest or stable} test package-15.0 {set, keep} -constraints testpreferstable -setup { testpreferstable } -body {package prefer} -result stable test package-15.1 {set stable, keep} -constraints testpreferstable -setup { testpreferstable } -body {package prefer stable} -result stable test package-15.2 {set latest, change} -constraints testpreferstable -setup { testpreferstable } -body {package prefer latest} -result latest test package-15.3 {set latest, keep} -constraints testpreferstable -setup { testpreferstable } -body { package prefer latest package prefer latest } -result latest test package-15.4 {set stable, rejected} -constraints testpreferstable -setup { testpreferstable } -body { package prefer latest package prefer stable } -result latest rename prefer {} set auto_path $oldPath package unknown $oldPkgUnknown cleanupTests } # cleanup interp delete $i ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/opt.test0000644000175000017500000001635715104661341014430 0ustar sergeisergei# Package covered: opt1.0/optparse.tcl # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # the package we are going to test package require opt 0.4.10 # we are using implementation specifics to test the package #### functions tests ##### set n $::tcl::OptDescN test opt-1.1 {OptKeyRegister / check that auto allocation is skipping existing keys} { list [::tcl::OptKeyRegister {} $n] [::tcl::OptKeyRegister {} [expr {$n+1}]] [::tcl::OptKeyRegister {}] } "$n [expr {$n+1}] [expr {$n+2}]" test opt-2.1 {OptKeyDelete} { list [::tcl::OptKeyRegister {} testkey] \ [info exists ::tcl::OptDesc(testkey)] \ [::tcl::OptKeyDelete testkey] \ [info exists ::tcl::OptDesc(testkey)] } {testkey 1 {} 0} test opt-3.1 {OptParse / temp key is removed} { set n $::tcl::OptDescN set prev [array names ::tcl::OptDesc] ::tcl::OptKeyRegister {} $n list [info exists ::tcl::OptDesc($n)]\ [::tcl::OptKeyDelete $n]\ [::tcl::OptParse {{-foo}} {}]\ [info exists ::tcl::OptDesc($n)]\ [expr {"[lsort $prev]"=="[lsort [array names ::tcl::OptDesc]]"}] } {1 {} {} 0 1} test opt-3.2 {OptParse / temp key is removed even on errors} { set n $::tcl::OptDescN catch {::tcl::OptKeyDelete $n} list [catch {::tcl::OptParse {{-foo}} {-blah}}] \ [info exists ::tcl::OptDesc($n)] } {1 0} test opt-4.1 {OptProc} { ::tcl::OptProc optTest {} {} optTest ::tcl::OptKeyDelete optTest } {} test opt-5.1 {OptProcArgGiven} { ::tcl::OptProc optTest {{-foo}} { if {[::tcl::OptProcArgGiven "-foo"]} { return 1 } else { return 0 } } list [optTest] [optTest -f] [optTest -F] [optTest -fOO] } {0 1 1 1} test opt-6.1 {OptKeyParse} { ::tcl::OptKeyRegister {} test list [catch {::tcl::OptKeyParse test {-help}} msg] $msg } {1 {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- (-help gives this help)}} test opt-7.1 {OptCheckType} { list \ [::tcl::OptCheckType 23 int] \ [::tcl::OptCheckType 23 float] \ [::tcl::OptCheckType true boolean] \ [::tcl::OptCheckType "-blah" any] \ [::tcl::OptCheckType {a b c} list] \ [::tcl::OptCheckType maYbe choice {yes maYbe no}] \ [catch {::tcl::OptCheckType "-blah" string}] \ [catch {::tcl::OptCheckType 6 boolean}] \ [catch {::tcl::OptCheckType x float}] \ [catch {::tcl::OptCheckType "a \{ c" list}] \ [catch {::tcl::OptCheckType 2.3 int}] \ [catch {::tcl::OptCheckType foo choice {x y Foo z}}] } {23 23.0 1 -blah {a b c} maYbe 1 1 1 1 1 1} test opt-8.1 {List utilities} { ::tcl::Lempty {} } 1 test opt-8.2 {List utilities} { ::tcl::Lempty {a b c} } 0 test opt-8.3 {List utilities} { ::tcl::Lget {a {b c d} e} {1 2} } d test opt-8.4 {List utilities} { set l {a {b c d e} f} ::tcl::Lvarset l {1 2} D set l } {a {b c D e} f} test opt-8.5 {List utilities} { set l {a b c} ::tcl::Lvarset1 l 6 X set l } {a b c {} {} {} X} test opt-8.6 {List utilities} { set l {a {b c 7 e} f} ::tcl::Lvarincr l {1 2} set l } {a {b c 8 e} f} test opt-8.7 {List utilities} { set l {a {b c 7 e} f} ::tcl::Lvarincr l {1 2} -9 set l } {a {b c -2 e} f} # 8.8 and 8.9 missing? test opt-8.10 {List utilities} { set l {a {b c 7 e} f} ::tcl::Lvarpop l set l } {{b c 7 e} f} test opt-8.11 {List utilities} { catch {unset x} set l {a {b c 7 e} f} list [::tcl::Lassign $l u v w x] \ $u $v $w [info exists x] } {3 a {b c 7 e} f 0} test opt-9.1 {Misc utilities} { catch {unset v} ::tcl::SetMax v 3 ::tcl::SetMax v 7 ::tcl::SetMax v 6 set v } 7 test opt-9.2 {Misc utilities} { catch {unset v} ::tcl::SetMin v 3 ::tcl::SetMin v -7 ::tcl::SetMin v 1 set v } -7 #### behaviour tests ##### test opt-10.1 {ambigous flags} { ::tcl::OptProc optTest {{-fla} {-other} {-flag2xyz} {-flag3xyz}} {} catch {optTest -fL} msg set msg } {ambigous option "-fL", choose from: -fla boolflag (false) -flag2xyz boolflag (false) -flag3xyz boolflag (false)} test opt-10.2 {non ambigous flags} { ::tcl::OptProc optTest {{-flag1xyz} {-other} {-flag2xyz} {-flag3xyz}} { return $flag2xyz } optTest -fLaG2 } 1 test opt-10.3 {non ambigous flags because of exact match} { ::tcl::OptProc optTest {{-flag1x} {-other} {-flag1} {-flag1xy}} { return $flag1 } optTest -flAg1 } 1 test opt-10.4 {ambigous flags, not exact match} { ::tcl::OptProc optTest {{-flag1xy} {-other} {-flag1} {-flag1xyz}} { return $flag1 } catch {optTest -fLag1X} msg set msg } {ambigous option "-fLag1X", choose from: -flag1xy boolflag (false) -flag1xyz boolflag (false)} # medium size overall test example: (defined once) ::tcl::OptProc optTest { {cmd -choice {print save delete} "sub command to choose"} {-allowBoing -boolean true} {arg2 -string "this is help"} {?arg3? 7 "optional number"} {-moreflags} } { list $cmd $allowBoing $arg2 $arg3 $moreflags } test opt-10.5 {medium size overall test} { list [catch {optTest} msg] $msg } {1 {no value given for parameter "cmd" (use -help for full usage) : cmd choice (print save delete) sub command to choose}} test opt-10.6 {medium size overall test} { list [catch {optTest -help} msg] $msg } {1 {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- (-help gives this help) cmd choice (print save delete) sub command to choose -allowBoing boolean (true) arg2 string () this is help ?arg3? int (7) optional number -moreflags boolflag (false)}} test opt-10.7 {medium size overall test} { optTest save tst } {save 1 tst 7 0} test opt-10.8 {medium size overall test} { optTest save -allowBoing false -- 8 } {save 0 8 7 0} test opt-10.9 {medium size overall test} { optTest save tst -m -- } {save 1 tst 7 1} test opt-10.10 {medium size overall test} { list [catch {optTest save tst foo} msg] [lindex [split $msg "\n"] 0] } {1 {too many arguments (unexpected argument(s): foo), usage:}} test opt-11.1 {too many args test 2} { set key [::tcl::OptKeyRegister {-foo}] list [catch {::tcl::OptKeyParse $key {-foo blah}} msg] $msg\ [::tcl::OptKeyDelete $key] } {1 {too many arguments (unexpected argument(s): blah), usage: Var/FlagName Type Value Help ------------ ---- ----- ---- (-help gives this help) -foo boolflag (false)} {}} test opt-11.2 {default value for args} { set args {} set key [::tcl::OptKeyRegister {{args -list {a b c} "args..."}}] ::tcl::OptKeyParse $key {} ::tcl::OptKeyDelete $key set args } {a b c} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/ooUtil.test0000644000175000017500000003626215104661341015076 0ustar sergeisergei# This file contains a collection of tests for functionality originally # sourced from the ooutil package in Tcllib. Sourcing this file into Tcl runs # the tests and generates output for errors. No output means no errors were # found. # # Copyright © 2014-2016 Andreas Kupries # Copyright © 2018 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcl::oo 1.3.1 if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test ooUtil-1.1 {TIP 478: classmethod} -setup { oo::class create parent } -body { oo::class create ActiveRecord { superclass parent classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } Table find foo bar } -cleanup { parent destroy } -result {::Table called with arguments: foo bar} test ooUtil-1.2 {TIP 478: classmethod in namespace} -setup { namespace eval ::testns {} } -body { namespace eval ::testns { oo::class create ActiveRecord { classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } } testns::Table find foo bar } -cleanup { namespace delete ::testns } -result {::testns::Table called with arguments: foo bar} test ooUtil-1.3 {TIP 478: classmethod must not interfere with constructor signatures} -setup { oo::class create parent } -body { oo::class create TestClass { superclass oo::class parent self method create {name ignore body} { next $name $body } } TestClass create okay {} {} } -cleanup { parent destroy } -result {::okay} test ooUtil-1.4 {TIP 478: classmethod with several inheritance levels} -setup { oo::class create parent } -body { oo::class create ActiveRecord { superclass parent classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } oo::class create SubTable { superclass Table } SubTable find foo bar } -cleanup { parent destroy } -result {::SubTable called with arguments: foo bar} test ooUtil-1.5 {TIP 478: classmethod and instances} -setup { oo::class create parent } -body { oo::class create ActiveRecord { superclass parent classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } set t [Table new] $t find 1 2 3 } -cleanup { parent destroy } -result {::Table called with arguments: 1 2 3} test ooUtil-1.6 {TIP 478: classmethod and instances} -setup { oo::class create parent } -body { oo::class create ActiveRecord { superclass parent classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord unexport find } set t [Table new] $t find 1 2 3 } -returnCodes error -cleanup { parent destroy } -match glob -result {unknown method "find": must be *} test ooUtil-1.7 {} -setup { oo::class create parent } -body { oo::class create Foo { superclass parent classmethod bar {} { puts "This is in the class; self is [self]" my meee } classmethod meee {} { puts "This is meee" } } oo::class create Grill { superclass Foo classmethod meee {} { puts "This is meee 2" } } list [Foo bar] [Grill bar] [[Foo new] bar] [[Grill new] bar] } -cleanup { parent destroy } -result {{} {} {} {}} -output "This is in the class; self is ::Foo\nThis is meee\nThis is in the class; self is ::Grill\nThis is meee 2\nThis is in the class; self is ::Foo\nThis is meee\nThis is in the class; self is ::Grill\nThis is meee 2\n" # Two tests to confirm that we correctly initialise the scripted part of TclOO # in child interpreters. This is slightly tricky at the implementation level # because we cannot count on either [source] or [open] being available. test ooUtil-1.8 {TIP 478: classmethod in child interp} -setup { set childinterp [interp create] } -body { $childinterp eval { oo::class create ActiveRecord { classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } # This is confirming that this is not the parent interpreter list [Table find foo bar] [info globals childinterp] } } -cleanup { interp delete $childinterp } -result {{::Table called with arguments: foo bar} {}} test ooUtil-1.9 {TIP 478: classmethod in safe child interp} -setup { set safeinterp [interp create -safe] } -body { $safeinterp eval { oo::class create ActiveRecord { classmethod find args { return "[self] called with arguments: $args" } } oo::class create Table { superclass ActiveRecord } # This is confirming that this is a (basic) safe interpreter list [Table find foo bar] [info commands source] } } -cleanup { interp delete $safeinterp } -result {{::Table called with arguments: foo bar} {}} test ooUtil-1.10.1 {Bug 680503: classmethod shouldn't require create body} -body { oo::class create C oo::define C {classmethod cm {} {}} } -cleanup { catch {C destroy} } -result {} test ooUtil-1.10.2 {Bug 680503: case that worked} -body { oo::class create C {} oo::define C {classmethod cm {} {}} } -cleanup { catch {C destroy} } -result {} test ooUtil-2.1 {TIP 478: callback generation} -setup { oo::class create parent } -body { oo::class create c { superclass parent method CallMe {} { return ok,[self] } method makeCall {} { return [callback CallMe] } } c create ::context set cb [context makeCall] {*}$cb } -cleanup { parent destroy } -result {ok,::context} test ooUtil-2.2 {TIP 478: callback generation} -setup { oo::class create parent } -body { oo::class create c { superclass parent method CallMe {a b c} { return ok,[self],$a,$b,$c } method makeCall {b} { return [callback CallMe 123 $b] } } c create ::context set cb [context makeCall "a b c"] {*}$cb PQR } -cleanup { parent destroy } -result {ok,::context,123,a b c,PQR} test ooUtil-2.3 {TIP 478: callback generation, alternate name} -setup { oo::class create parent } -body { oo::class create c { superclass parent method CallMe {} { return ok,[self] } method makeCall {} { return [mymethod CallMe] } } c create ::context set cb [context makeCall] {*}$cb } -cleanup { parent destroy } -result {ok,::context} test ooUtil-2.4 {TIP 478: callback generation, alternate name} -setup { oo::class create parent } -body { oo::class create c { superclass parent method CallMe {a b c} { return ok,[self],$a,$b,$c } method makeCall {b} { return [mymethod CallMe 123 $b] } } c create ::context set cb [context makeCall "a b c"] {*}$cb PQR } -cleanup { parent destroy } -result {ok,::context,123,a b c,PQR} test ooUtil-2.5 {TIP 478: callbacks and method lifetime} -setup { oo::class create parent } -body { oo::class create c { superclass parent method makeCall {b} { return [callback CallMe 123 $b] } } c create ::context set cb [context makeCall "a b c"] set result [list [catch {{*}$cb PQR} msg] $msg] oo::objdefine context { method CallMe {a b c} { return ok,[self],$a,$b,$c } } lappend result [{*}$cb PQR] } -cleanup { parent destroy } -result {1 {unknown method "CallMe": must be , destroy, eval, makeCall, unknown, variable or varname} {ok,::context,123,a b c,PQR}} test ooUtil-2.6 {TIP 478: callback use case} -setup { oo::class create parent unset -nocomplain x } -body { oo::class create c { superclass parent variable count constructor {var} { set count 0 upvar 1 $var v trace add variable v write [callback TraceCallback] } method count {} {return $count} method TraceCallback {name1 name2 op} { incr count } } set o [c new x] for {set x 0} {$x < 5} {incr x} {} $o count } -cleanup { unset -nocomplain x parent destroy } -result 6 test ooUtil-3.1 {TIP 478: class initialisation} -setup { oo::class create parent catch {rename ::foobar-3.1 {}} } -body { oo::class create ::cls { superclass parent initialise { proc foobar-3.1 {} {return ok} } method calls {} { list [catch foobar-3.1 msg] $msg \ [namespace eval [info object namespace [self class]] foobar-3.1] } } [cls new] calls } -cleanup { parent destroy } -result {1 {invalid command name "foobar-3.1"} ok} test ooUtil-3.2 {TIP 478: class variables} -setup { oo::class create parent catch {rename ::foobar-3.1 {}} } -body { oo::class create ::cls { superclass parent initialise { variable x 123 } method call {} { classvariable x incr x } } cls create a cls create b cls create c list [a call] [b call] [c call] [a call] [b call] [c call] } -cleanup { parent destroy } -result {124 125 126 127 128 129} test ooUtil-3.3 {TIP 478: class initialisation} -setup { oo::class create parent catch {rename ::foobar-3.3 {}} } -body { oo::class create ::cls { superclass parent initialize { proc foobar-3.3 {} {return ok} } method calls {} { list [catch foobar-3.3 msg] $msg \ [namespace eval [info object namespace [self class]] foobar-3.3] } } [cls new] calls } -cleanup { parent destroy } -result {1 {invalid command name "foobar-3.3"} ok} test ooUtil-3.4 {TIP 478: class initialisation} -setup { oo::class create parent catch {rename ::appendToResultVar {}} proc ::appendToResultVar args { lappend ::result {*}$args } set result {} } -body { trace add execution oo::define::initialise enter appendToResultVar oo::class create ::cls { superclass parent initialise {proc xyzzy {} {}} } return $result } -cleanup { catch { trace remove execution oo::define::initialise enter appendToResultVar } rename ::appendToResultVar {} parent destroy } -result {{initialise {proc xyzzy {} {}}} enter} test ooUtil-4.1 {TIP 478: singleton} -setup { oo::class create parent } -body { oo::singleton create xyz { superclass parent } set x [xyz new] set y [xyz new] set z [xyz new] set code [catch {$x destroy} msg] set p [xyz new] lappend code [catch {rename $x ""}] set q [xyz new] string map [list $x ONE $q TWO] [list {*}$code $x $y $z $p $q [xyz new]] } -cleanup { parent destroy } -result {1 0 ONE ONE ONE ONE TWO TWO} test ooUtil-4.2 {TIP 478: singleton errors} -setup { oo::class create parent } -body { oo::singleton create xyz { superclass parent } [xyz new] destroy } -returnCodes error -cleanup { parent destroy } -result {may not destroy a singleton object} test ooUtil-4.3 {TIP 478: singleton errors} -setup { oo::class create parent } -body { oo::singleton create xyz { superclass parent } oo::copy [xyz new] } -returnCodes error -cleanup { parent destroy } -result {may not clone a singleton object} test ooUtil-5.1 {TIP 478: abstract} -setup { oo::class create parent } -body { oo::abstract create xyz { superclass parent method foo {} {return 123} } oo::class create pqr { superclass xyz method bar {} {return 456} } set codes [list [catch {xyz new}] [catch {xyz create x}] [catch {xyz createWithNamespace x y}]] set x [pqr new] set y [pqr create ::y] lappend codes [$x foo] [$x bar] $y } -cleanup { parent destroy } -result {1 1 1 123 456 ::y} test ooUtil-6.1 {TIP 478: classvariable} -setup { oo::class create parent } -body { oo::class create xyz { superclass parent initialise { variable x 1 y 2 } method a {} { classvariable x incr x } method b {} { classvariable y incr y } method c {} { classvariable x y list $x $y } } set p [xyz new] set q [xyz new] set result [list [$p c] [$q c]] $p a $q b lappend result [[xyz new] c] } -cleanup { parent destroy } -result {{1 2} {1 2} {2 3}} test ooUtil-6.2 {TIP 478: classvariable error case} -setup { oo::class create parent } -body { oo::class create xyz { superclass parent method a {} { classvariable x(1) incr x(1) } } set p [xyz new] set q [xyz new] list [$p a] [$q a] } -returnCodes error -cleanup { parent destroy } -result {bad variable name "x(1)": can't create a scalar variable that looks like an array element} test ooUtil-6.3 {TIP 478: classvariable error case} -setup { oo::class create parent } -body { oo::class create xyz { superclass parent method a {} { classvariable ::x incr x } } set p [xyz new] set q [xyz new] list [$p a] [$q a] } -returnCodes error -cleanup { parent destroy } -result {bad variable name "::x": can't create a local variable with a namespace separator in it} test ooUtil-7.1 {TIP 478: link calling pattern} -setup { oo::class create parent } -body { oo::class create cls { superclass parent method foo {} {return "in foo of [self]"} method Bar {} {return "in bar of [self]"} method Grill {} {return "in grill of [self]"} export eval constructor {} { link foo link {bar Bar} {grill Grill} } } cls create o o eval {list [foo] [bar] [grill]} } -cleanup { parent destroy } -result {{in foo of ::o} {in bar of ::o} {in grill of ::o}} test ooUtil-7.2 {TIP 478: link removed when [my] disappears} -setup { oo::class create parent } -body { oo::class create cls { superclass parent method foo {} {return "in foo of [self]"} constructor {cmd} { link [list ::$cmd foo] } } cls create o pqr list [o foo] [pqr] [rename [info object namespace o]::my {}] [catch pqr msg] $msg } -cleanup { parent destroy } -result {{in foo of ::o} {in foo of ::o} {} 1 {invalid command name "pqr"}} # Tests a very weird combination of things (with a key problem locus in # MixinClassDelegates) that TIP 567 fixes test ooUtil-8.1 {TIP 567: call oo::define twice from metaclass constructor} -setup { oo::class create parent } -body { ::oo::class create A { superclass parent } ::oo::class create B { superclass ::oo::class parent constructor {{definitionScript ""}} { next $definitionScript next {superclass ::A} } } B create C { superclass A } C create instance } -cleanup { parent destroy } -result ::instance # Tests that verify issues detected with the tcllib version of the code test ooUtil-tcllib-ticket-b3577ed586 {test scoping of delegation in oo::class.Delegate } -setup { oo::class create animal {} namespace eval ::ooutiltest { oo::class create pet { superclass animal } } } -body { namespace eval ::ooutiltest { oo::class create dog { superclass pet } } } -cleanup { namespace delete ooutiltest rename animal {} } -result {::ooutiltest::dog} test ooUtil-tcllib-ticket-fe7a0e0a3a {classmethod must not interfere with constructor signatures} -setup { oo::class create TestClass { superclass oo::class self method create {name ignore body} { next $name $body } } } -body { TestClass create okay {} {} } -cleanup { rename TestClass {} } -result {::okay} cleanupTests return # Local Variables: # fill-column: 78 # mode: tcl # End: tcl9.0.3/tests/ooProp.test0000644000175000017500000007303515104661341015100 0ustar sergeisergei# This file contains a collection of tests for Tcl's built-in object system, # specifically the parts that support configurable properties on objects. # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 2019-2020 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcl::oo 1.0.3 package require tcltest 2 if {"::tcltest" in [namespace children]} { namespace import -force ::tcltest::* } test ooProp-1.1 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::readableproperties -set a b c lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::readableproperties -set f e d lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::readableproperties -set a a a lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::readableproperties -set lappend result [info class properties c] [info class properties c -writable] } -cleanup { parent destroy } -result {{} {} {a b c} {} {d e f} {} a {} {} {}} test ooProp-1.2 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::readableproperties -set a b c lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::readableproperties -set f e d lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::readableproperties -set a a a lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::readableproperties -set lappend result [info class properties c -all] [info class properties c -writable -all] } -cleanup { parent destroy } -result {{} {} {a b c} {} {d e f} {} a {} {} {}} test ooProp-1.3 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::writableproperties -set a b c lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::writableproperties -set f e d lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::writableproperties -set a a a lappend result [info class properties c] [info class properties c -writable] oo::define c ::oo::configuresupport::writableproperties -set lappend result [info class properties c] [info class properties c -writable] } -cleanup { parent destroy } -result {{} {} {} {a b c} {} {d e f} {} a {} {}} test ooProp-1.4 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::writableproperties -set a b c lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::writableproperties -set f e d lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::writableproperties -set a a a lappend result [info class properties c -all] [info class properties c -writable -all] oo::define c ::oo::configuresupport::writableproperties -set lappend result [info class properties c -all] [info class properties c -writable -all] } -cleanup { parent destroy } -result {{} {} {} {a b c} {} {d e f} {} a {} {}} test ooProp-1.5 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} oo::class create d {superclass c} lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::readableproperties -set a b c oo::define d ::oo::configuresupport::readableproperties -set x y z lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::readableproperties -set f e d oo::define d ::oo::configuresupport::readableproperties -set r p q lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::readableproperties -set a a h oo::define d ::oo::configuresupport::readableproperties -set g h g lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::readableproperties -set lappend result [info class properties d -all] [info class properties d -writable -all] oo::define d ::oo::configuresupport::readableproperties -set lappend result [info class properties d -all] [info class properties d -writable -all] } -cleanup { parent destroy } -result {{} {} {a b c x y z} {} {d e f p q r} {} {a g h} {} {g h} {} {} {}} test ooProp-1.6 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} oo::class create d {superclass c} lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::writableproperties -set a b c oo::define d ::oo::configuresupport::writableproperties -set x y z lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::writableproperties -set f e d oo::define d ::oo::configuresupport::writableproperties -set r p q lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::writableproperties -set a a h oo::define d ::oo::configuresupport::writableproperties -set g h g lappend result [info class properties d -all] [info class properties d -writable -all] oo::define c ::oo::configuresupport::writableproperties -set lappend result [info class properties d -all] [info class properties d -writable -all] oo::define d ::oo::configuresupport::writableproperties -set lappend result [info class properties d -all] [info class properties d -writable -all] } -cleanup { parent destroy } -result {{} {} {} {a b c x y z} {} {d e f p q r} {} {a g h} {} {g h} {} {}} test ooProp-1.7 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} c create o lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objreadableproperties -set a b c lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objreadableproperties -set f e d lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objreadableproperties -set a a h lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objreadableproperties -set lappend result [info object properties o] [info object properties o -writable] } -cleanup { parent destroy } -result {{} {} {a b c} {} {d e f} {} {a h} {} {} {}} test ooProp-1.8 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} c create o lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objwritableproperties -set a b c lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objwritableproperties -set f e d lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objwritableproperties -set a a h lappend result [info object properties o] [info object properties o -writable] oo::objdefine o ::oo::configuresupport::objwritableproperties -set lappend result [info object properties o] [info object properties o -writable] } -cleanup { parent destroy } -result {{} {} {} {a b c} {} {d e f} {} {a h} {} {}} test ooProp-1.9 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} oo::class create d {superclass c} d create o lappend result [info object properties o -all] [info object properties o -writable -all] oo::define c ::oo::configuresupport::readableproperties -set a b oo::define d ::oo::configuresupport::readableproperties -set c d oo::objdefine o ::oo::configuresupport::objreadableproperties -set e f lappend result [info object properties o -all] [info object properties o -writable -all] oo::objdefine o ::oo::configuresupport::objreadableproperties -set f e d b e lappend result [info object properties o -all] [info object properties o -writable -all] } -cleanup { parent destroy } -result {{} {} {a b c d e f} {} {a b c d e f} {}} test ooProp-1.10 {TIP 558: properties: core support} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::class create c {superclass parent} oo::class create d {superclass c} d create o lappend result [info object properties o -all] [info object properties o -writable -all] oo::define c ::oo::configuresupport::writableproperties -set a b oo::define d ::oo::configuresupport::writableproperties -set c d oo::objdefine o ::oo::configuresupport::objwritableproperties -set e f lappend result [info object properties o -all] [info object properties o -writable -all] oo::objdefine o ::oo::configuresupport::objwritableproperties -set f e d b e lappend result [info object properties o -all] [info object properties o -writable -all] } -cleanup { parent destroy } -result {{} {} {} {a b c d e f} {} {a b c d e f}} test ooProp-1.11 {TIP 558: properties: core support cache} -setup { oo::class create parent unset -nocomplain result } -body { oo::class create m { superclass parent ::oo::configuresupport::readableproperties -set a ::oo::configuresupport::writableproperties -set c } oo::class create c { superclass parent ::oo::configuresupport::readableproperties -set b ::oo::configuresupport::writableproperties -set d } c create o lappend result [info object properties o -all -readable] \ [info object properties o -all -writable] oo::objdefine o mixin m lappend result [info object properties o -all -readable] \ [info object properties o -all -writable] } -cleanup { parent destroy } -result {b d {a b} {c d}} test ooProp-2.1 {TIP 558: properties: configurable class system} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } variable x y method report {} { lappend ::result "x=$x, y=$y" } } set pt [Point new -x 3] $pt report $pt configure -y 4 $pt report lappend result [$pt configure -x],[$pt configure -y] [$pt configure] } -cleanup { parent destroy } -result {{x=3, y=0} {x=3, y=4} 3,4 {-x 3 -y 4}} test ooProp-2.2 {TIP 558: properties: configurable class system} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } } oo::configurable create 3DPoint { superclass Point property z constructor args { next -z 0 {*}$args } } set pt [3DPoint new -x 3 -y 4 -z 5] list [$pt configure -x],[$pt configure -y],[$pt configure -z] \ [$pt configure] } -cleanup { parent destroy } -result {3,4,5 {-x 3 -y 4 -z 5}} test ooProp-2.3 {TIP 558: properties: configurable class system} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } } set pt [Point new -x 3 -y 4] oo::objdefine $pt property z $pt configure -z 5 list [$pt configure -x],[$pt configure -y],[$pt configure -z] \ [$pt configure] } -cleanup { parent destroy } -result {3,4,5 {-x 3 -y 4 -z 5}} test ooProp-2.4 {TIP 558: properties: configurable class system} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } } [Point new] configure gorp } -returnCodes error -cleanup { parent destroy } -result {bad property "gorp": must be -x or -y} test ooProp-2.5 {TIP 558: properties: configurable class system} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } } oo::configurable create 3DPoint { superclass Point property z constructor args { next -z 0 {*}$args } } [3DPoint new] configure gorp } -returnCodes error -cleanup { parent destroy } -result {bad property "gorp": must be -x, -y, or -z} test ooProp-2.6 {TIP 558: properties: configurable class system} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x y constructor args { my configure -x 0 -y 0 {*}$args } } [Point create p] configure -x 1 -y } -returnCodes error -cleanup { parent destroy } -result {wrong # args: should be "::p configure ?-option value ...?"} test ooProp-2.7 {TIP 558: properties: configurable class system} -setup { oo::class create parent unset -nocomplain msg } -body { oo::configurable create Point { superclass parent property x y -kind writable constructor args { my configure -x 0 -y 0 {*}$args } } Point create p list [p configure -y ok] [catch {p configure -y} msg] $msg } -cleanup { parent destroy } -result {{} 1 {property "-y" is write only}} test ooProp-2.8 {TIP 558: properties: configurable class system} -setup { oo::class create parent unset -nocomplain msg } -body { oo::configurable create Point { superclass parent property x y -kind readable constructor args { my configure -x 0 {*}$args variable y 123 } } Point create p list [p configure] [p configure -y] [catch {p configure -y foo} msg] $msg } -cleanup { parent destroy } -result {{-x 0 -y 123} 123 1 {property "-y" is read only}} test ooProp-3.1 {TIP 558: properties: declaration semantics} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::configurable create Point {superclass parent} oo::define Point { variable xyz property x -get { global result lappend result "get" return [lrepeat 3 $xyz] } -set { global result lappend result [list set $value] set xyz [expr {$value * 3}] } } Point create pt pt configure -x 5 lappend result >[pt configure -x]< } -cleanup { parent destroy } -result {{set 5} get {>15 15 15<}} test ooProp-3.2 {TIP 558: properties: declaration semantics} -setup { oo::class create parent unset -nocomplain result set result {} } -body { oo::configurable create Point {superclass parent} oo::define Point { variable xyz property x -get { global result lappend result "get" return [lrepeat 3 $xyz] } -set { global result lappend result [list set $value] set xyz [expr {$value * 3}] } y -kind readable -get {return $xyz} } Point create pt pt configure -x 5 lappend result >[pt configure -x]< [pt configure -y] } -cleanup { parent destroy } -result {{set 5} get {>15 15 15<} 15} test ooProp-3.3 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { variable xyz property -x -get {return $xyz} } } -returnCodes error -cleanup { parent destroy } -result {bad property name "-x": must not begin with -} test ooProp-3.4 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property "x y" } } -returnCodes error -cleanup { parent destroy } -result {bad property name "x y": must be a simple word} test ooProp-3.5 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property ::x } } -returnCodes error -cleanup { parent destroy } -result {bad property name "::x": must not contain namespace separators} test ooProp-3.6 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x( } } -returnCodes error -cleanup { parent destroy } -result {bad property name "x(": must not contain parentheses} test ooProp-3.7 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x) } } -returnCodes error -cleanup { parent destroy } -result {bad property name "x)": must not contain parentheses} test ooProp-3.8 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x -get } } -returnCodes error -cleanup { parent destroy } -result {missing body to go with -get option} test ooProp-3.9 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x -set } } -returnCodes error -cleanup { parent destroy } -result {missing body to go with -set option} test ooProp-3.10 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x -kind } } -returnCodes error -cleanup { parent destroy } -result {missing kind value to go with -kind option} test ooProp-3.11 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point {superclass parent} oo::define Point { property x -get {} -set } } -returnCodes error -cleanup { parent destroy } -result {missing body to go with -set option} test ooProp-3.12 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {} -get {return ok} } [Point new] configure -x } -cleanup { parent destroy } -result ok test ooProp-3.13 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -kind gorp } } -returnCodes error -cleanup { parent destroy } -result {bad kind "gorp": must be readable, readwrite, or writable} test ooProp-3.14 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -k reada -g {return ok} } [Point new] configure -x } -cleanup { parent destroy } -result ok test ooProp-3.15 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property {*}{ x -kind writable y -get {return ok} } } [Point new] configure -y } -cleanup { parent destroy } -result ok test ooProp-3.16 {TIP 558: properties: declaration semantics} -setup { oo::class create parent unset -nocomplain msg } -body { oo::configurable create Point { superclass parent variable xy property x -kind readable -get {return $xy} property x -kind writable -set {set xy $value} } Point create pt list [catch { pt configure -x ok } msg] $msg [catch { pt configure -x } msg] $msg [catch { pt configure -y 1 } msg] $msg } -cleanup { parent destroy } -result {0 {} 1 {property "-x" is write only} 1 {bad property "-y": must be -x}} test ooProp-3.17 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {return -code break} } while 1 { [Point new] configure -x break } } -returnCodes error -cleanup { parent destroy } -result {property getter for -x did a break} test ooProp-3.18 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {return -code break} } while 1 { [Point new] configure break } } -returnCodes error -cleanup { parent destroy } -result {property getter for -x did a break} test ooProp-3.19 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {error "boo"} } while 1 { [Point new] configure -x break } } -returnCodes error -cleanup { parent destroy } -result boo test ooProp-3.20 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {error "boo"} } while 1 { [Point new] configure break } } -returnCodes error -cleanup { parent destroy } -result boo test ooProp-3.21 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {return -code continue} } while 1 { [Point new] configure -x break } } -returnCodes error -cleanup { parent destroy } -result {property getter for -x did a continue} test ooProp-3.22 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {return -level 2 ok} } apply {{} { [Point new] configure return bad }} } -cleanup { parent destroy } -result ok test ooProp-3.23 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -get {return -level 2 ok} } apply {{} { [Point new] configure -x return bad }} } -cleanup { parent destroy } -result ok test ooProp-3.24 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -set {return -code break} } while 1 { [Point new] configure -x gorp break } } -returnCodes error -cleanup { parent destroy } -result {property setter for -x did a break} test ooProp-3.25 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -set {return -code continue} } while 1 { [Point new] configure -x gorp break } } -returnCodes error -cleanup { parent destroy } -result {property setter for -x did a continue} test ooProp-3.26 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -set {error "boo"} } while 1 { [Point new] configure -x gorp break } } -returnCodes error -cleanup { parent destroy } -result boo test ooProp-3.27 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent property x -set {return -level 2 ok} } apply {{} { [Point new] configure -x gorp return bad }} } -cleanup { parent destroy } -result ok test ooProp-3.28 {TIP 558: properties: declaration semantics} -setup { oo::class create parent } -body { oo::configurable create Point { superclass parent private property var } Point create pt pt configure -var ok pt configure -var } -cleanup { parent destroy } -result ok test ooProp-4.1 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property -x}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {bad property name "-x": must not begin with - while executing "property -x" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property -x}"} {TCL OO PROPERTY_FORMAT}} test ooProp-4.2 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property x -get}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {missing body to go with -get option while executing "property x -get" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property x -get}"} {TCL WRONGARGS}} test ooProp-4.3 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property x -set}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {missing body to go with -set option while executing "property x -set" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property x -set}"} {TCL WRONGARGS}} test ooProp-4.4 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property x -kind}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {missing kind value to go with -kind option while executing "property x -kind" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property x -kind}"} {TCL WRONGARGS}} test ooProp-4.5 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property x -kind gorp}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {bad kind "gorp": must be readable, readwrite, or writable while executing "property x -kind gorp" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property x -kind gorp}"} {TCL LOOKUP INDEX kind gorp}} test ooProp-4.6 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point {superclass parent} list [catch {oo::define Point {property x -gorp}} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {bad option "-gorp": must be -get, -kind, or -set while executing "property x -gorp" (in definition script for class "::Point" line 1) invoked from within "oo::define Point {property x -gorp}"} {TCL LOOKUP INDEX option -gorp}} test ooProp-4.7 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point { superclass parent property x } Point create pt list [catch {pt configure -gorp} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {bad property "-gorp": must be -x while executing "pt configure -gorp"} {TCL LOOKUP INDEX property -gorp}} test ooProp-4.8 {TIP 558: properties: error details} -setup { oo::class create parent unset -nocomplain msg opt } -body { oo::configurable create Point { superclass parent property x } Point create pt list [catch {pt configure -gorp blarg} msg opt] \ [dict get $opt -errorinfo] [dict get $opt -errorcode] } -cleanup { parent destroy } -result {1 {bad property "-gorp": must be -x while executing "pt configure -gorp blarg"} {TCL LOOKUP INDEX property -gorp}} cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/ooNext2.test0000644000175000017500000006200115104661341015147 0ustar sergeisergei# This file contains a collection of tests for Tcl's built-in object system. # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 2006-2011 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcl::oo 1.3.1 if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc getbytes {} { set lines [split [memory info] \n] return [lindex $lines 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } test oo-nextto-1.1 {basic nextto functionality} -setup { oo::class create root } -body { oo::class create A { superclass root method x args { lappend ::result ==A== $args } } oo::class create B { superclass A method x args { lappend ::result ==B== $args nextto A B -> A {*}$args } } oo::class create C { superclass A method x args { lappend ::result ==C== $args nextto A C -> A {*}$args } } oo::class create D { superclass B C method x args { lappend ::result ==D== $args next foo nextto C bar } } set ::result {} [D new] x return $::result } -cleanup { root destroy } -result {==D== {} ==B== foo ==A== {B -> A foo} ==C== bar ==A== {C -> A bar}} test oo-nextto-1.2 {basic nextto functionality} -setup { oo::class create root } -body { oo::class create A { superclass root method x args { lappend ::result ==A== $args } } oo::class create B { superclass A method x args { lappend ::result ==B== $args nextto A B -> A {*}$args } } oo::class create C { superclass A method x args { lappend ::result ==C== $args nextto A C -> A {*}$args } } oo::class create D { superclass B C method x args { lappend ::result ==D== $args nextto B foo {*}$args nextto C bar {*}$args } } set ::result {} [D new] x 123 return $::result } -cleanup { root destroy } -result {==D== 123 ==B== {foo 123} ==A== {B -> A foo 123} ==C== {bar 123} ==A== {C -> A bar 123}} test oo-nextto-1.3 {basic nextto functionality: constructors} -setup { oo::class create root } -body { oo::class create A { superclass root variable result constructor {a c} { lappend result ==A== a=$a,c=$c } } oo::class create B { superclass root variable result constructor {b} { lappend result ==B== b=$b } } oo::class create C { superclass A B variable result constructor {p q r} { lappend result ==C== p=$p,q=$q,r=$r # Route arguments to superclasses, in non-trivial pattern nextto B $q nextto A $p $r } method result {} {return $result} } [C new x y z] result } -cleanup { root destroy } -result {==C== p=x,q=y,r=z ==B== b=y ==A== a=x,c=z} test oo-nextto-1.4 {basic nextto functionality: destructors} -setup { oo::class create root {destructor return} } -body { oo::class create A { superclass root destructor { lappend ::result ==A== next } } oo::class create B { superclass root destructor { lappend ::result ==B== next } } oo::class create C { superclass A B destructor { lappend ::result ==C== lappend ::result | nextto B lappend ::result | nextto A lappend ::result | next } } set ::result "" [C new] destroy return $::result } -cleanup { root destroy } -result {==C== | ==B== | ==A== ==B== | ==A== ==B==} test oo-nextto-2.1 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {error $y} } oo::class create B { superclass A method x y {nextto A $y} } [B new] x boom } -cleanup { root destroy } -result boom -returnCodes error test oo-nextto-2.2 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {error $y} } oo::class create B { superclass root method x y {nextto A $y} } [B new] x boom } -returnCodes error -cleanup { root destroy } -result {method has no non-filter implementation by "A"} test oo-nextto-2.3 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {nextto $y} } oo::class create B { superclass A method x y {nextto A $y} } [B new] x B } -returnCodes error -cleanup { root destroy } -result {method implementation by "B" not reachable from here} test oo-nextto-2.4 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {nextto $y} } oo::class create B { superclass A method x y {nextto} } [B new] x B } -returnCodes error -cleanup { root destroy } -result {wrong # args: should be "nextto class ?arg...?"} test oo-nextto-2.5 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {nextto $y} } oo::class create B { superclass A method x y {nextto $y $y $y} } [B new] x A } -cleanup { root destroy } -result {wrong # args: should be "nextto A y"} -returnCodes error test oo-nextto-2.6 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {nextto $y} } oo::class create B { superclass A method x y {nextto $y $y $y} } [B new] x [root create notAClass] } -cleanup { root destroy } -result {"::notAClass" is not a class} -returnCodes error test oo-nextto-2.7 {errors in nextto} -setup { oo::class create root } -body { oo::class create A { superclass root method x y {nextto $y} } oo::class create B { superclass A filter Y method Y args {next {*}$args} } oo::class create C { superclass B method x y {nextto $y $y $y} } [C new] x B } -returnCodes error -cleanup { root destroy } -result {method has no non-filter implementation by "B"} test oo-call-1.1 {object call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } A create y info object call y x } -cleanup { root destroy } -result {{method x ::A method}} test oo-call-1.2 {object call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} } B create y info object call y x } -cleanup { root destroy } -result {{method x ::B method} {method x ::A method}} test oo-call-1.3 {object call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } A create y oo::objdefine y method x {} {} info object call y x } -cleanup { root destroy } -result {{method x object method} {method x ::A method}} test oo-call-1.4 {object object call introspection - unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } A create y info object call y z } -cleanup { root destroy } -result {{unknown unknown ::oo::object {core method: "unknown"}}} test oo-call-1.5 {object call introspection - filters} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method y {} {} filter y } A create y info object call y x } -cleanup { root destroy } -result {{filter y ::A method} {method x ::A method}} test oo-call-1.6 {object call introspection - filters} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method y {} {} filter y } oo::class create ::B { superclass A method x {} {} } B create y info object call y x } -cleanup { root destroy } -result {{filter y ::A method} {method x ::B method} {method x ::A method}} test oo-call-1.7 {object call introspection - filters} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method y {} {} filter y } oo::class create ::B { superclass A method x {} {} method y {} {} } B create y info object call y x } -cleanup { root destroy } -result {{filter y ::B method} {filter y ::A method} {method x ::B method} {method x ::A method}} test oo-call-1.8 {object call introspection - filters} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method y {} {} filter y } oo::class create ::B { superclass A method x {} {} method y {} {} method z {} {} filter z } B create y info object call y x } -cleanup { root destroy } -result {{filter z ::B method} {filter y ::B method} {filter y ::A method} {method x ::B method} {method x ::A method}} test oo-call-1.9 {object call introspection - filters} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method y {} {} filter y } oo::class create ::B { superclass A method x {} {} method y {} {} method z {} {} filter z } B create y info object call y y } -cleanup { root destroy } -result {{filter z ::B method} {filter y ::B method} {filter y ::A method} {method y ::B method} {method y ::A method}} test oo-call-1.10 {object call introspection - filters + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method y {} {} filter y } oo::class create ::B { superclass A method y {} {} method unknown {} {} } B create y info object call y x } -cleanup { root destroy } -result {{filter y ::B method} {filter y ::A method} {unknown unknown ::B method} {unknown unknown ::oo::object {core method: "unknown"}}} test oo-call-1.11 {object call introspection - filters + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method y {} {} filter y } A create y oo::objdefine y method unknown {} {} info object call y x } -cleanup { root destroy } -result {{filter y ::A method} {unknown unknown object method} {unknown unknown ::oo::object {core method: "unknown"}}} test oo-call-1.12 {object call introspection - filters + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method y {} {} } A create y oo::objdefine y { method unknown {} {} filter y } info object call y x } -cleanup { root destroy } -result {{filter y ::A method} {unknown unknown object method} {unknown unknown ::oo::object {core method: "unknown"}}} test oo-call-1.13 {object call introspection - filters + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method y {} {} } A create y oo::objdefine y { method unknown {} {} method x {} {} filter y } info object call y x } -cleanup { root destroy } -result {{filter y ::A method} {method x object method}} test oo-call-1.14 {object call introspection - errors} -body { info object call } -returnCodes error -result {wrong # args: should be "info object call objName methodName"} test oo-call-1.15 {object call introspection - errors} -body { info object call a } -returnCodes error -result {wrong # args: should be "info object call objName methodName"} test oo-call-1.16 {object call introspection - errors} -body { info object call a b c } -returnCodes error -result {wrong # args: should be "info object call objName methodName"} test oo-call-1.17 {object call introspection - errors} -body { info object call notanobject x } -returnCodes error -result {notanobject does not refer to an object} test oo-call-1.18 {object call introspection - memory leaks} -body { leaktest { info object call oo::object destroy } } -constraints memory -result 0 test oo-call-1.19 {object call introspection - memory leaks} -setup { oo::class create leaktester { method foo {} {dummy} } } -body { leaktest { set lt [leaktester new] oo::objdefine $lt method foobar {} {dummy} list [info object call $lt destroy] \ [info object call $lt foo] \ [info object call $lt bar] \ [info object call $lt foobar] \ [$lt destroy] } } -cleanup { leaktester destroy } -constraints memory -result 0 test oo-call-1.20 {object call introspection - complex case} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} } oo::class create ::C { superclass root method x {} {} mixin B } oo::class create ::D { superclass C method x {} {} } oo::class create ::E { superclass root method x {} {} } oo::class create ::F { superclass E method x {} {} } oo::class create ::G { superclass root method x {} {} } oo::class create ::H { superclass G method x {} {} } oo::define F mixin H F create y oo::objdefine y { method x {} {} mixin D } info object call y x } -cleanup { root destroy } -result {{method x ::D method} {method x ::B method} {method x ::A method} {method x ::C method} {method x ::H method} {method x ::G method} {method x object method} {method x ::F method} {method x ::E method}} test oo-call-1.21 {object call introspection - complex case} -setup { oo::class create root } -body { oo::class create ::A { superclass root method y {} {} filter y } oo::class create ::B { superclass A method y {} {} } oo::class create ::C { superclass root method x {} {} mixin B } oo::class create ::D { superclass C filter x } oo::class create ::E { superclass root method y {} {} method x {} {} } oo::class create ::F { superclass E method z {} {} method q {} {} } F create y oo::objdefine y { method unknown {} {} mixin D filter q } info object call y z } -cleanup { root destroy } -result {{filter x ::C method} {filter x ::E method} {filter y ::B method} {filter y ::A method} {filter y ::E method} {filter q ::F method} {method z ::F method}} test oo-call-2.1 {class call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } info class call A x } -cleanup { root destroy } -result {{method x ::A method}} test oo-call-2.2 {class call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} } list [info class call A x] [info class call B x] } -cleanup { root destroy } -result {{{method x ::A method}} {{method x ::B method} {method x ::A method}}} test oo-call-2.3 {class call introspection} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} } oo::class create ::C { superclass A method x {} {} } oo::class create ::D { superclass C B method x {} {} } info class call D x } -cleanup { root destroy } -result {{method x ::D method} {method x ::C method} {method x ::B method} {method x ::A method}} test oo-call-2.4 {class call introspection - mixin} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} } oo::class create ::C { superclass A method x {} {} } oo::class create ::D { superclass C mixin B method x {} {} } info class call D x } -cleanup { root destroy } -result {{method x ::B method} {method x ::D method} {method x ::C method} {method x ::A method}} test oo-call-2.5 {class call introspection - mixin + filter} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} method y {} {} filter y } oo::class create ::C { superclass A method x {} {} method y {} {} } oo::class create ::D { superclass C mixin B method x {} {} } info class call D x } -cleanup { root destroy } -result {{filter y ::B method} {filter y ::C method} {method x ::B method} {method x ::D method} {method x ::C method} {method x ::A method}} test oo-call-2.6 {class call introspection - mixin + filter + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} method unknown {} {} } oo::class create ::B { superclass A method x {} {} method y {} {} filter y } oo::class create ::C { superclass A method x {} {} method y {} {} } oo::class create ::D { superclass C mixin B method x {} {} method unknown {} {} } info class call D z } -cleanup { root destroy } -result {{filter y ::B method} {filter y ::C method} {unknown unknown ::D method} {unknown unknown ::A method} {unknown unknown ::oo::object {core method: "unknown"}}} test oo-call-2.7 {class call introspection - mixin + filter + unknown} -setup { oo::class create root } -body { oo::class create ::A { superclass root method x {} {} } oo::class create ::B { superclass A method x {} {} filter x } info class call B x } -cleanup { root destroy } -result {{filter x ::B method} {filter x ::A method} {method x ::B method} {method x ::A method}} test oo-call-2.8 {class call introspection - errors} -body { info class call } -returnCodes error -result {wrong # args: should be "info class call className methodName"} test oo-call-2.9 {class call introspection - errors} -body { info class call a } -returnCodes error -result {wrong # args: should be "info class call className methodName"} test oo-call-2.10 {class call introspection - errors} -body { info class call a b c } -returnCodes error -result {wrong # args: should be "info class call className methodName"} test oo-call-2.11 {class call introspection - errors} -body { info class call notaclass x } -returnCodes error -result {notaclass does not refer to an object} test oo-call-2.12 {class call introspection - errors} -setup { oo::class create root } -body { root create notaclass info class call notaclass x } -returnCodes error -cleanup { root destroy } -result {"notaclass" is not a class} test oo-call-2.13 {class call introspection - memory leaks} -body { leaktest { info class call oo::class destroy } } -constraints memory -result 0 test oo-call-2.14 {class call introspection - memory leaks} -body { leaktest { oo::class create leaktester { method foo {} {dummy} } [leaktester new] destroy list [info class call leaktester destroy] \ [info class call leaktester foo] \ [info class call leaktester bar] \ [leaktester destroy] } } -constraints memory -result 0 test oo-call-3.1 {current call introspection} -setup { oo::class create root } -body { oo::class create A { superclass root method x {} {lappend ::result [self call]} } oo::class create B { superclass A method x {} {lappend ::result [self call];next} } B create y oo::objdefine y method x {} {lappend ::result [self call];next} set ::result {} y x } -cleanup { root destroy } -result {{{{method x object method} {method x ::B method} {method x ::A method}} 0} {{{method x object method} {method x ::B method} {method x ::A method}} 1} {{{method x object method} {method x ::B method} {method x ::A method}} 2}} test oo-call-3.2 {current call introspection} -setup { oo::class create root } -constraints memory -body { oo::class create A { superclass root method x {} {self call} } oo::class create B { superclass A method x {} {self call;next} } B create y oo::objdefine y method x {} {self call;next} leaktest { y x } } -cleanup { root destroy } -result 0 test oo-call-3.3 {current call introspection: in constructors} -setup { oo::class create root } -body { oo::class create A { superclass root constructor {} {lappend ::result [self call]} } oo::class create B { superclass A constructor {} {lappend ::result [self call]; next} } set ::result {} [B new] destroy return $::result } -cleanup { root destroy } -result {{{{method ::B method} {method ::A method}} 0} {{{method ::B method} {method ::A method}} 1}} test oo-call-3.4 {current call introspection: in destructors} -setup { oo::class create root } -body { oo::class create A { superclass root destructor {lappend ::result [self call]} } oo::class create B { superclass A destructor {lappend ::result [self call]; next} } set ::result {} [B new] destroy return $::result } -cleanup { root destroy } -result {{{{method ::B method} {method ::A method}} 0} {{{method ::B method} {method ::A method}} 1}} # Contributed tests from aspect, related to [0f42ff7871] # # dkf's "Principles Leading to a Fix" # # A method ought to work "the same" whether or not it has been overridden by # a subclass. A tailcalled command ought to have as parent stack the same # thing you'd get with uplevel 1. A subclass will often expect the # superclass's result to be the result that would be returned if the # subclass was not there. # Common setup: # any invocation of bar should emit "abc\nhi\n" then return to its # caller set testopts { -setup { oo::class create Parent oo::class create Foo { superclass Parent method bar {} { puts abc tailcall puts hi puts xyz } } oo::class create Foo2 { superclass Parent } } -cleanup { Parent destroy } } # these succeed, showing that without [next] the bug doesn't fire test next-tailcall-simple-1 "trivial case with one method" {*}$testopts -body { [Foo create foo] bar } -output [join {abc hi} \n]\n test next-tailcall-simple-2 "my bar" {*}$testopts -body { oo::define Foo method baz {} { puts a my bar puts b } [Foo create foo] baz } -output [join {a abc hi b} \n]\n test next-tailcall-simple-3 "\[self\] bar" {*}$testopts -body { oo::define Foo method baz {} { puts a [self] bar puts b } [Foo create foo] baz } -output [join {a abc hi b} \n]\n test next-tailcall-simple-4 "foo bar" {*}$testopts -body { oo::define Foo method baz {} { puts a foo bar puts b } [Foo create foo] baz } -output [join {a abc hi b} \n]\n # everything from here on uses [next], and fails on 8.6.4 with compilation test next-tailcall-superclass-1 "next superclass" {*}$testopts -body { oo::define Foo2 { superclass Foo method bar {} { puts a next puts b } } [Foo2 create foo] bar } -output [join {a abc hi b} \n]\n test next-tailcall-superclass-2 "nextto superclass" {*}$testopts -body { oo::define Foo2 { superclass Foo method bar {} { puts a nextto Foo puts b } } [Foo2 create foo] bar } -output [join {a abc hi b} \n]\n test next-tailcall-mixin-1 "class mixin" {*}$testopts -body { oo::define Foo2 { method Bar {} { puts a next puts b } filter Bar } oo::define Foo mixin Foo2 Foo create foo foo bar } -output [join {a abc hi b} \n]\n test next-tailcall-objmixin-1 "object mixin" {*}$testopts -body { oo::define Foo2 { method Bar {} { puts a next puts b } filter Bar } Foo create foo oo::objdefine foo mixin Foo2 foo bar } -output [join {a abc hi b} \n]\n test next-tailcall-filter-1 "filter method" {*}$testopts -body { oo::define Foo method Filter {} { puts a next puts b } oo::define Foo filter Filter [Foo new] bar } -output [join {a abc hi b} \n]\n test next-tailcall-forward-1 "forward method" {*}$testopts -body { proc foobar {} { puts "abc" tailcall puts "hi" puts "xyz" } oo::define Foo forward foobar foobar oo::define Foo2 { superclass Foo method foobar {} { puts a next puts b } } [Foo2 new] foobar } -output [join {a abc hi b} \n]\n test next-tailcall-constructor-1 "next in constructor" -body { oo::class create Foo { constructor {} { puts abc tailcall puts hi puts xyz } } oo::class create Foo2 { superclass Foo constructor {} { puts a next puts b } } list [Foo new] [Foo2 new] return "" } -cleanup { Foo destroy } -output [join {abc hi a abc hi b} \n]\n test next-tailcall-destructor-1 "next in destructor" -body { oo::class create Foo { destructor { puts abc tailcall puts hi puts xyz } } oo::class create Foo2 { superclass Foo destructor { puts a next puts b } } Foo create foo Foo2 create foo2 foo destroy foo2 destroy } -output [join {abc hi a abc hi b} \n]\n -cleanup { Foo destroy } unset testopts cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/oo.test0000644000175000017500000050115315104661341014234 0ustar sergeisergei# This file contains a collection of tests for Tcl's built-in object system. # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 2006-2013 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcl::oo 1.3.1 if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # A helper for intercepting background errors proc ::bgerrorIntercept {varName body} { set old [interp bgerror {}] interp bgerror {} [list apply {{var msg args} { upvar #0 $var v lappend v $msg }} $varName] try { uplevel 1 $body } finally { interp bgerror {} $old } } # The foundational objects oo::object and oo::class are sensitive to reference # counting errors and are deallocated only when an interp is deleted, so in # this test suite, interp creation and interp deletion are often used in # leaktests in order to leverage this sensitivity. testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc getbytes {} { set lines [split [memory info] \n] return [lindex $lines 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } test oo-0.1 {basic test of OO's ability to clean up its initial state} { interp create t t eval { package require tcl::oo } interp delete t } {} test oo-0.2 {basic test of OO's ability to clean up its initial state} { set i [interp create] interp eval $i { package require tcl::oo namespace delete :: } interp delete $i } {} test oo-0.3 {basic test of OO's ability to clean up its initial state} -body { leaktest { [oo::object new] destroy } } -constraints memory -result 0 test oo-0.4 {basic test of OO's ability to clean up its initial state} -body { leaktest { oo::class create foo foo new foo destroy } } -constraints memory -result 0 test oo-0.5.1 {testing object foundation cleanup} memory { leaktest { interp create foo interp delete foo } } 0 test oo-0.5.2 {testing literal leak on interp delete} memory { leaktest { interp create foo foo eval {oo::object new} interp delete foo } } 0 test oo-0.6 {cleaning the core class pair; way #1} -setup { interp create t } -body { t eval { package require tcl::oo namespace path oo list [catch {class destroy} m] $m [catch {object destroy} m] $m } } -cleanup { interp delete t } -result {0 {} 1 {invalid command name "object"}} test oo-0.7 {cleaning the core class pair; way #2} -setup { interp create t } -body { t eval { package require tcl::oo namespace path oo list [catch {object destroy} m] $m [catch {class destroy} m] $m } } -cleanup { interp delete t } -result {0 {} 1 {invalid command name "class"}} test oo-0.8 {leak in variable management} -setup { oo::class create foo } -constraints memory -body { oo::define foo { constructor {} { variable v 0 } } leaktest {[foo new] destroy} } -cleanup { foo destroy } -result 0 test oo-0.9 {various types of presence of the tcl::oo package} { list [lsearch -nocase -all -inline [package names] tcl::oo] \ [package present tcl::oo] [expr {$::oo::patchlevel in [package versions tcl::oo]}] } [list tcl::oo $::oo::patchlevel 1] test oo-1.1 {basic test of OO functionality: no classes} { set result {} lappend result [oo::object create foo] lappend result [oo::objdefine foo { method bar args { global result lappend result {*}$args return [llength $args] } }] lappend result [foo bar a b c] lappend result [foo destroy] [info commands foo] } {::foo {} a b c 3 {} {}} test oo-1.2 {basic test of OO functionality: no classes} -body { oo::define oo::object method missingArgs } -returnCodes 1 -result "wrong # args: should be \"oo::define oo::object method name ?option? args body\"" test oo-1.3 {basic test of OO functionality: no classes} { catch {oo::define oo::object method missingArgs} set errorInfo } "wrong # args: should be \"oo::define oo::object method name ?option? args body\" while executing \"oo::define oo::object method missingArgs\"" test oo-1.4 {basic test of OO functionality} -body { oo::object create {} } -returnCodes 1 -result {object name must not be empty} test oo-1.4.1 {fully-qualified nested name} -body { oo::object create ::one::two::three } -result {::one::two::three} test oo-1.4.2 {automatic command name has same name as namespace} -body { set obj [oo::object new] expr {[info object namespace $obj] == $obj} } -result 1 test oo-1.5 {basic test of OO functionality} -body { oo::object doesnotexist } -returnCodes 1 -result {unknown method "doesnotexist": must be create, destroy or new} test oo-1.5.1 {basic test of OO functionality} -setup { oo::object create aninstance } -returnCodes error -body { aninstance } -cleanup { rename aninstance {} } -result {wrong # args: should be "aninstance method ?arg ...?"} test oo-1.6 {basic test of OO functionality} -setup { oo::object create aninstance } -body { oo::objdefine aninstance unexport destroy aninstance doesnotexist } -cleanup { rename aninstance {} } -returnCodes 1 -result {object "::aninstance" has no visible methods} test oo-1.7 {basic test of OO functionality} -setup { oo::object create aninstance } -body { oo::objdefine aninstance { # Do not do this in real code! Ever! This is *not* supported! ::oo::define::method ha ha ha } } -returnCodes error -cleanup { aninstance destroy } -result {attempt to misuse API} test oo-1.8 {basic test of OO functionality} -setup { oo::object create obj set result {} } -cleanup { obj destroy } -body { oo::objdefine obj method foo {} {return bar} lappend result [obj foo] oo::objdefine obj method foo {} {} lappend result [obj foo] } -result {bar {}} test oo-1.9 {basic test of OO functionality} -setup { oo::object create a oo::object create b } -cleanup { catch {a destroy} b destroy } -body { oo::objdefine a method foo {} { return A } oo::objdefine b method foo {} { return B } apply {{} { set m foo return [a $m],[a destroy],[b $m] }} } -result A,,B test oo-1.10 {basic test of OO functionality} -body { namespace eval foo { namespace eval bar { oo::object create o namespace export o } namespace import bar::o } list [info object isa object foo::bar::o] [info object isa object foo::o] } -cleanup { namespace delete foo } -result {1 1} test oo-1.11 {basic test of OO functionality: abbreviating} -setup { oo::class create c } -cleanup { c destroy } -body { oo::define c super oo::class info class super c } -result ::oo::class test oo-1.12 {basic test of OO functionality: abbreviating} -setup { oo::class create c } -cleanup { c destroy } -body { oo::define c {super oo::class} info class super c } -result ::oo::class test oo-1.13 {basic test of OO functionality: abbreviating} -setup { oo::class create c } -cleanup { c destroy } -body { oo::define c self {forw a b} info object forw c a } -result b test oo-1.14 {basic test of OO functionality: abbreviating} -setup { oo::class create c } -cleanup { c destroy } -body { oo::define c self forw a b info object forw c a } -result b test oo-1.15 {basic test of OO functionality: abbreviating} -setup { oo::object create o } -cleanup { o destroy } -body { oo::objdefine o {forw a b} info object forw o a } -result b test oo-1.16 {basic test of OO functionality: abbreviating} -setup { oo::object create o } -cleanup { o destroy } -body { oo::objdefine o forw a b info object forw o a } -result b test oo-1.17 {basic test of OO functionality: Bug 2481109} -body { namespace eval ::foo {oo::object create lreplace} } -cleanup { namespace delete ::foo } -result ::foo::lreplace # Check for Bug 2519474; problem in tclNamesp.c, but tested here... test oo-1.18 {OO: create object in NS with same name as global cmd} -setup { proc test-oo-1.18 {} return oo::class create A oo::class create B {superclass A} } -body { oo::define B constructor {} {A create test-oo-1.18} B create C } -cleanup { rename test-oo-1.18 {} A destroy } -result ::C test oo-1.18.1 {no memory leak: superclass} -setup { } -constraints memory -body { leaktest { interp create t t eval { oo::class create A { superclass oo::class } } interp delete t } } -cleanup { } -result 0 test oo-1.18.2 {Bug 75b8433707: memory leak in oo-1.18} -setup { proc test-oo-1.18 {} return } -constraints memory -body { leaktest { oo::class create A oo::class create B {superclass A} oo::define B constructor {} {A create test-oo-1.18} B create C A destroy } } -cleanup { rename test-oo-1.18 {} } -result 0 test oo-1.18.3 {Bug 21c144f0f5} -setup { interp create child } -body { child eval { oo::define [oo::class create foo] superclass oo::class oo::class destroy } } -cleanup { interp delete child } test oo-1.18.4 {correct handling of cleanup in superclass set error} -setup { interp create child } -body { child eval { oo::class create A oo::class create B { superclass oo::class constructor {} { next {superclass A} next {superclass -append A} } } [B create C] create d } } -returnCodes error -cleanup { interp delete child } -result {class should only be a direct superclass once} test oo-1.18.5 {correct handling of cleanup in superclass set error} -setup { interp create child } -body { child eval { oo::class create A oo::class create B { superclass oo::class constructor {c} { next {superclass A} next [list superclass -append {*}$c] } } [B create C {B C}] create d } } -returnCodes error -cleanup { interp delete child } -result {attempt to form circular dependency graph} test oo-1.19 {basic test of OO functionality: teardown order} -body { oo::object create o namespace delete [info object namespace o] o destroy # Crashes on error } -returnCodes error -result {invalid command name "o"} test oo-1.20 {basic test of OO functionality: my teardown post rename} -body { oo::object create obj rename [info object namespace obj]::my ::AGlobalName obj destroy info commands ::AGlobalName } -result {} test oo-1.21 {basic test of OO functionality: default relations} -setup { set fresh [interp create] } -body { lmap x [$fresh eval { set initials {::oo::object ::oo::class ::oo::Slot} foreach initial $initials { lappend x [info class instances $initial] } foreach initial $initials { lappend x [info class subclasses $initial] } foreach initial $initials { lappend x [info class mixins $initial] } foreach initial $initials { lappend x [info class superclasses $initial] } foreach initial $initials { lappend x [info object class $initial] } return $x }] {lsort [lsearch -all -not -inline $x *::delegate]} } -cleanup { interp delete $fresh } -result [list {*}{ {} {::oo::SingletonInstance ::oo::Slot ::oo::abstract ::oo::class ::oo::configurable ::oo::configuresupport::configurable ::oo::object ::oo::singleton} {::oo::configuresupport::objreadableproperties ::oo::configuresupport::objwritableproperties ::oo::configuresupport::readableproperties ::oo::configuresupport::writableproperties ::oo::define::filter ::oo::define::mixin ::oo::define::superclass ::oo::define::variable ::oo::objdefine::filter ::oo::objdefine::mixin ::oo::objdefine::variable} {::oo::SingletonInstance ::oo::Slot ::oo::class ::oo::configuresupport::configurable} {::oo::abstract ::oo::configurable ::oo::singleton} {} {} {} {} {} ::oo::object ::oo::object ::oo::class ::oo::class ::oo::class }] test oo-1.22 {basic test of OO functionality: nested ownership destruction order} -setup { oo::class create parent } -body { oo::class create abc { superclass parent variable n constructor {} {set n 0} method make {i} {set n $i; [self class] create xyz} destructor {lappend ::deathOrder $n} } apply {n { set ::deathOrder {} # Make some "nested" objects set base [abc new] for {set i 1; set obj $base} {$i < $n} {incr i} { set obj [$obj make $i] } # Kill them all in one go; should come apart in right order! $base destroy return $::deathOrder }} 5 } -cleanup { parent destroy } -result {1 2 3 4 0} test oo-1.23 {basic test of OO functionality: deep nested ownership} -setup { oo::class create parent } -constraints knownBug -body { oo::class create abc { superclass parent method make {} {[self class] create xyz} destructor {incr ::count} } apply {n { set ::count 0 # Make a lot of "nested" objects set base [abc new] for {set i 1; set obj $base} {$i < $n} {incr i} { set obj [$obj make] } # Kill them all in one go; should not crash! $base destroy return [expr {$n - $::count}] }} 10000 } -cleanup { parent destroy } -result 0 test oo-1.24 {basic test of OO functionality: deep nested ownership} -setup { oo::class create parent } -constraints knownBug -body { oo::class create abc { superclass parent self method make {} {oo::copy [self] xyz} } apply {n { # Make a lot of "nested" objects set base abc lappend lst $base [info object namespace $base] for {set i 1; set obj $base} {$i < $n} {incr i} { set obj [$obj make] lappend lst $obj [info object namespace $obj] } # Kill them all in one go; should not crash! $base destroy # How many classes still there (cnt must remain 0) set cnt 0 foreach {obj ns} $lst { if {[namespace which -command $obj] ne "" || [namespace exists $ns]} { incr cnt } } return $cnt }} 10000 } -cleanup { parent destroy } -result 0 test oo-1.25 {basic test of OO functionality: touch method after instance deletion, bug [0b809cd3fc8b6e5e]} -body { set ::result {} # test for eval and deletion of coro, in both cases the coroutine shall be deleted foreach v {"eval" "del"} { # 1st (deleted class) oo::class create A oo::define A method retard-it {} {yield} coroutine tcoro [A new] retard-it trace add command tcoro delete {apply {{args} {lappend ::result D}}} A destroy if {$v eq "eval"} { tcoro } else { rename tcoro {} } # 2nd (deleted object of class) oo::class create A oo::define A method retard-it {} {yield} set obj [A new] coroutine tcoro $obj retard-it trace add command tcoro delete {apply {{args} {lappend ::result D}}} $obj destroy if {$v eq "eval"} { tcoro } else { rename tcoro {} } A destroy # 3rd (deleted object) set obj [oo::object new] oo::objdefine $obj method retard-it {} {yield} coroutine tcoro $obj retard-it trace add command tcoro delete {apply {{args} {lappend ::result D}}} $obj destroy if {$v eq "eval"} { tcoro } else { rename tcoro {} } } set ::result } -result [lrepeat 6 D] test oo-2.1 {basic test of OO functionality: constructor} -setup { # This is a bit complex because it needs to run in a sub-interp as # we're modifying the root object class's constructor interp create subinterp subinterp eval { package require tcl::oo } } -body { subinterp eval { oo::define oo::object constructor {} { lappend ::result [info level 0] } lappend result 1 lappend result 2 [oo::object create foo] } } -cleanup { interp delete subinterp } -result {1 {oo::object create foo} 2 ::foo} test oo-2.2 {basic test of OO functionality: constructor} { oo::class create testClass { constructor {} { global result lappend result "[self]->construct" } method bar {} { global result lappend result "[self]->bar" } } set result {} [testClass create foo] bar testClass destroy return $result } {::foo->construct ::foo->bar} test oo-2.4 {OO constructor - Bug 2531577} -setup { oo::class create foo } -body { oo::define foo constructor {} return [foo new] destroy oo::define foo constructor {} {} llength [info command [foo new]] } -cleanup { foo destroy } -result 1 test oo-2.5 {OO constructor - Bug 2531577} -setup { oo::class create foo set result {} } -body { oo::define foo constructor {} {error x} lappend result [catch {foo new}] oo::define foo constructor {} {} lappend result [llength [info command [foo new]]] } -cleanup { foo destroy } -result {1 1} test oo-2.6 {OO constructor and tailcall - Bug 2414858} -setup { oo::class create foo } -body { oo::define foo { constructor {} { tailcall my bar } method bar {} { return bad } } namespace tail [foo create good] } -cleanup { foo destroy } -result good test oo-2.7 {construction, method calls and ensembles - Bug 3514761} -setup { namespace eval k {} } -body { namespace eval k { oo::class create s { constructor {j} { # nothing } } namespace export s namespace ensemble create } k s create X } -returnCodes error -cleanup { namespace delete k } -result {wrong # args: should be "k s create X j"} test oo-2.8 {construction, method calls and ensembles - Bug 3514761} -setup { namespace eval k {} } -body { namespace eval k { oo::class create s { constructor {j} { # nothing } } oo::class create t { superclass s constructor args { k next {*}$args } } interp alias {} ::k::next {} ::oo::Helpers::next namespace export t next namespace ensemble create } k t create X } -returnCodes error -cleanup { namespace delete k } -result {wrong # args: should be "k next j"} test oo-2.9 {construction failures and self creation} -setup { set ::result {} oo::class create Root } -body { oo::class create A { superclass Root constructor {} { lappend ::result "in A" error "failure in A" } destructor {lappend ::result [self]} } oo::class create B { superclass Root constructor {} { lappend ::result "in B [self]" error "failure in B" } destructor {lappend ::result [self]} } lappend ::result [catch {A create a} msg] $msg lappend ::result [catch {B create b} msg] $msg } -cleanup { Root destroy } -result {{in A} ::a 1 {failure in A} {in B ::b} ::b 1 {failure in B}} test oo-3.1 {basic test of OO functionality: destructor} -setup { # This is a bit complex because it needs to run in a sub-interp as we're # modifying the root object class's constructor interp create subinterp subinterp eval { package require tcl::oo } } -body { subinterp eval { oo::define oo::object destructor { lappend ::result died } lappend result 1 [oo::object create foo] lappend result 2 [rename foo {}] oo::define oo::object destructor {} return $result } } -cleanup { interp delete subinterp } -result {1 ::foo died 2 {}} test oo-3.2 {basic test of OO functionality: destructor} -setup { # This is a bit complex because it needs to run in a sub-interp as # we're modifying the root object class's constructor interp create subinterp subinterp eval { package require tcl::oo } } -body { subinterp eval { oo::define oo::object destructor { lappend ::result died } lappend result 1 [oo::object create foo] lappend result 2 [rename foo {}] } } -cleanup { interp delete subinterp } -result {1 ::foo died 2 {}} test oo-3.3 {basic test of OO functionality: destructor} -setup { oo::class create foo set result {} } -cleanup { foo destroy } -body { oo::define foo { constructor {} {lappend ::result made} destructor {lappend ::result died} } namespace delete [info object namespace [foo new]] return $result } -result {made died} test oo-3.4 {basic test of OO functionality: my exists in destructor} -setup { oo::class create cls set result {} } -cleanup { cls destroy } -body { oo::define cls { variable state constructor {} { proc localcmdexists {} {} set state ok } forward Report lappend ::result destructor { objmy Report [catch {set state} msg] $msg objmy Report [namespace which -var state] objmy Report [info commands localcmdexists] } } cls create obj rename [info object namespace obj]::my ::objmy obj destroy lappend result [info commands ::objmy] } -match glob -result {0 ok *::state localcmdexists {}} test oo-3.4a {basic test of OO functionality: my exists in destructor} -setup { oo::class create cls set result {} } -cleanup { cls destroy } -body { oo::define cls { variable state constructor {} { proc localcmdexists {} {} set state ok } forward Report lappend ::result destructor { objmy Report [catch {set state} msg] $msg objmy Report [namespace which -var state] objmy Report [info commands localcmdexists] } } cls create obj rename [info object namespace obj]::my ::objmy rename obj {} lappend result [info commands ::objmy] } -match glob -result {0 ok *::state localcmdexists {}} test oo-3.5 {basic test of OO functionality: destructor: evil case for Itcl} -setup { oo::class create cls set result {} } -cleanup { cls destroy } -body { oo::define cls { variable state constructor {} { proc localcmdexists {} {} set state ok } forward Report lappend ::result destructor { objmy Report [catch {set state} msg] $msg objmy Report [namespace which -var state] objmy Report [info commands localcmdexists] } } cls create obj rename [info object namespace obj]::my ::objmy namespace delete [info object namespace obj] lappend result [info commands ::objmy] } -match glob -result {0 ok *::state localcmdexists {}} test oo-3.5a {basic test of OO functionality: destructor: evil case for Itcl} -setup { oo::class create cls set result {} } -cleanup { cls destroy } -body { oo::define cls { variable state result constructor {} { proc localcmdexists {} {} set state ok my eval {upvar 0 ::result result} } method nuke {} { namespace delete [namespace current] return $result } destructor { lappend result [self] $state [info commands localcmdexists] } } cls create obj namespace delete [info object namespace obj] [cls create obj2] nuke } -match glob -result {::obj ok localcmdexists ::obj2 ok localcmdexists} test oo-3.6 {basic test of OO functionality: errors in destructor} -setup { oo::class create cls } -cleanup { cls destroy } -body { oo::define cls destructor {error foo} list [catch {[cls create obj] destroy} msg] $msg [info commands obj] } -result {1 foo {}} test oo-3.7 {basic test of OO functionality: errors in destructor} -setup { oo::class create cls } -cleanup { cls destroy } -body { oo::define cls destructor {error foo} bgerrorIntercept result { set result [cls create obj] lappend result [rename obj {}] update idletasks lappend result [info commands obj] } } -result {::obj {} foo {}} test oo-3.8 {basic test of OO functionality: errors in destructor} -setup { oo::class create cls } -cleanup { cls destroy } -body { oo::define cls destructor {error foo} bgerrorIntercept result { set result [cls create obj] lappend result [namespace delete [info object namespace obj]] update idletasks lappend result [info commands obj] } } -result {::obj {} foo {}} test oo-3.9 {Bug 2944404: deleting the object in the destructor} -setup { oo::class create cls set result {} } -body { oo::define cls { destructor { lappend ::result in destructor [self] destroy } } # This used to crash [cls new] destroy return $result } -cleanup { cls destroy } -result {in destructor} test oo-3.10 {Bug 3d96b7076e: killing the object's class in a method call} -setup { oo::class create Super } -body { # Only reliably failed in a memdebug build oo::class create Cls { superclass Super method mthd {} { [self class] destroy return ok } } [Cls new] mthd } -cleanup { Super destroy } -result ok test oo-3.11 {Bug 3d96b7076e: killing the object's class in a method call} -setup { oo::class create Super oo::class create Sub { superclass Super } } -body { # Only reliably failed in a memdebug build oo::class create Cls { superclass Super method mthd {} { oo::objdefine [self] class Sub Cls destroy return ok } } [Cls new] mthd } -cleanup { Super destroy } -result ok test oo-3.12 {Bug 3d96b7076e: killing the object's class in a method call} -setup { oo::class create Super } -body { # Only reliably failed in a memdebug build oo::class create Cls { superclass Super method mthd {} { [self class] destroy return ok } } set o [Super new] oo::objdefine $o mixin Cls $o mthd } -cleanup { Super destroy } -result ok test oo-4.1 {basic test of OO functionality: export} { set o [oo::object new] set result {} oo::objdefine $o method Foo {} {lappend ::result Foo; return} lappend result [catch {$o Foo} msg] $msg oo::objdefine $o export Foo lappend result [$o Foo] [$o destroy] } {1 {unknown method "Foo": must be destroy} Foo {} {}} test oo-4.2 {basic test of OO functionality: unexport} { set o [oo::object new] set result {} oo::objdefine $o method foo {} {lappend ::result foo; return} lappend result [$o foo] oo::objdefine $o unexport foo lappend result [catch {$o foo} msg] $msg [$o destroy] } {foo {} 1 {unknown method "foo": must be destroy} {}} test oo-4.3 {exporting and error messages, Bug 1824958} -setup { oo::class create testClass } -cleanup { testClass destroy } -body { oo::define testClass self export Bad testClass Bad } -returnCodes 1 -result {unknown method "Bad": must be create, destroy or new} test oo-4.4 {exporting a class method from an object} -setup { oo::class create testClass testClass create testObject } -cleanup { testClass destroy } -body { oo::define testClass method Good {} { return ok } oo::objdefine testObject export Good testObject Good } -result ok test oo-4.5 {export creates proper method entries} -setup { oo::class create testClass } -body { oo::define testClass { export foo method foo {} {return ok} } [testClass new] foo } -cleanup { testClass destroy } -result ok test oo-4.6 {export creates proper method entries} -setup { oo::class create testClass } -body { oo::define testClass { unexport foo method foo {} {return ok} } [testClass new] foo } -cleanup { testClass destroy } -result ok test oo-4.7 {basic test of OO functionality: method -export flag} -setup { set o [oo::object new] unset -nocomplain result } -body { oo::objdefine $o { method Foo {} { lappend ::result Foo return foo } method Bar -export {} { lappend ::result Bar return bar } } lappend result [catch {$o Foo} msg] $msg lappend result [$o Bar] } -cleanup { $o destroy } -result {1 {unknown method "Foo": must be Bar or destroy} Bar bar} test oo-4.8 {basic test of OO functionality: method -unexport flag} -setup { set o [oo::object new] unset -nocomplain result } -body { oo::objdefine $o { method foo {} { lappend ::result foo return Foo } method bar -unexport {} { lappend ::result bar return Bar } } lappend result [$o foo] lappend result [catch {$o bar} msg] $msg } -cleanup { $o destroy } -result {foo Foo 1 {unknown method "bar": must be destroy or foo}} test oo-4.9 {basic test of OO functionality: method -private flag} -setup { set o [oo::object new] unset -nocomplain result } -body { oo::objdefine $o { method foo {} { lappend ::result foo return Foo } method bar -private {} { lappend ::result bar return Bar } export eval method gorp {} { my bar } } lappend result [$o foo] lappend result [catch {$o bar} msg] $msg lappend result [catch {$o eval my bar} msg] $msg lappend result [$o gorp] } -cleanup { $o destroy } -result {foo Foo 1 {unknown method "bar": must be destroy, eval, foo or gorp} 1 {unknown method "bar": must be , destroy, eval, foo, gorp, unknown, variable or varname} bar Bar} test oo-4.10 {basic test of OO functionality: method flag parsing} -setup { set o [oo::object new] } -body { oo::objdefine $o method foo -gorp xyz {return Foo} } -returnCodes error -cleanup { $o destroy } -result {bad export flag "-gorp": must be -export, -private, or -unexport} test oo-5.1 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] } -body { oo::objdefine oo::object method foo {} { return "in object" } catch {$obj foo} result list [catch {$obj foo} result] $result [oo::object foo] } -cleanup { oo::objdefine oo::object deletemethod foo $obj destroy } -result {1 {unknown method "foo": must be destroy} {in object}} test oo-5.2 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] } -body { oo::define oo::object self method foo {} { return "in object" } catch {$obj foo} result list [catch {$obj foo} result] $result [oo::object foo] } -cleanup { oo::objdefine oo::object deletemethod foo $obj destroy } -result {1 {unknown method "foo": must be destroy} {in object}} test oo-5.3 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] } -body { oo::objdefine oo::object { method foo {} { return "in object" } } catch {$obj foo} result list [catch {$obj foo} result] $result [oo::object foo] } -cleanup { oo::objdefine oo::object deletemethod foo $obj destroy } -result {1 {unknown method "foo": must be destroy} {in object}} test oo-5.4 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] } -body { oo::define oo::object { self method foo {} { return "in object" } } catch {$obj foo} result list [catch {$obj foo} result] $result [oo::object foo] } -cleanup { oo::objdefine oo::object deletemethod foo $obj destroy } -result {1 {unknown method "foo": must be destroy} {in object}} test oo-5.5 {OO: manipulation of classes as objects} -setup { set obj [oo::object new] } -body { oo::define oo::object { self { method foo {} { return "in object" } } } catch {$obj foo} result list [catch {$obj foo} result] $result [oo::object foo] } -cleanup { oo::objdefine oo::object deletemethod foo $obj destroy } -result {1 {unknown method "foo": must be destroy} {in object}} test oo-6.1 {OO: forward} { oo::object create foo oo::objdefine foo { forward a lappend forward b lappend result } set result {} foo a result 1 foo b 2 foo destroy return $result } {1 2} test oo-6.2 {OO: forward resolution scope} -setup { oo::class create fooClass } -body { proc foo {} {return bad} oo::define fooClass { constructor {} { proc foo {} {return good} } forward bar foo } [fooClass new] bar } -cleanup { fooClass destroy rename foo {} } -result good test oo-6.3 {OO: forward resolution scope} -setup { oo::class create fooClass } -body { proc foo {} {return bad} oo::define fooClass { constructor {} { proc foo {} {return good} } } oo::define fooClass forward bar foo [fooClass new] bar } -cleanup { fooClass destroy rename foo {} } -result good test oo-6.4 {OO: forward resolution scope} -setup { oo::class create fooClass } -body { proc foo {} {return good} oo::define fooClass { constructor {} { proc foo {} {return bad} } forward bar ::foo } [fooClass new] bar } -cleanup { fooClass destroy rename foo {} } -result good test oo-6.5 {OO: forward resolution scope} -setup { oo::class create fooClass namespace eval foo {} } -body { proc foo::foo {} {return good} oo::define fooClass { constructor {} { proc foo {} {return bad} } forward bar foo::foo } [fooClass new] bar } -cleanup { fooClass destroy namespace delete foo } -result good test oo-6.6 {OO: forward resolution scope} -setup { oo::class create fooClass namespace eval foo {} } -body { proc foo::foo {} {return bad} oo::define fooClass { constructor {} { namespace eval foo { proc foo {} {return good} } } forward bar foo::foo } [fooClass new] bar } -cleanup { fooClass destroy namespace delete foo } -result good test oo-6.7 {OO: forward resolution scope is per-object} -setup { oo::class create fooClass } -body { oo::define fooClass { constructor {} { proc curns {} {namespace current} } forward ns curns } expr {[[fooClass new] ns] ne [[fooClass new] ns]} } -cleanup { fooClass destroy } -result 1 test oo-6.8 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test my handler method handler {a b c} {} } fooClass create ::foo foo test } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "foo test a b c"} test oo-6.9 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test my handler method handler {a b c} {list $a,$b,$c} } fooClass create ::foo foo test 1 2 3 } -cleanup { fooClass destroy } -result 1,2,3 test oo-6.10 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test my handler method handler {a b c} {list $a,$b,$c} } fooClass create ::foo foo test 1 2 } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "foo test a b c"} test oo-6.11 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::object create foo } -body { oo::objdefine foo { forward test my handler method handler {a b c} {} } foo test } -returnCodes error -cleanup { foo destroy } -result {wrong # args: should be "foo test a b c"} test oo-6.12 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::object create foo } -body { oo::objdefine foo { forward test my handler method handler {a b c} {list $a,$b,$c} } foo test 1 2 3 } -cleanup { foo destroy } -result 1,2,3 test oo-6.13 {Bug 3400658: forwarding and wrongargs rewriting} -setup { oo::object create foo } -body { oo::objdefine foo { forward test my handler method handler {a b c} {list $a,$b,$c} } foo test 1 2 } -returnCodes error -cleanup { foo destroy } -result {wrong # args: should be "foo test a b c"} test oo-6.14 {Bug 3400658: forwarding and wrongargs rewriting - multistep} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test my handler1 p forward handler1 my handler q method handler {a b c} {} } fooClass create ::foo foo test } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "foo test c"} test oo-6.15 {Bug 3400658: forwarding and wrongargs rewriting - multistep} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test my handler1 p forward handler1 my handler q method handler {a b c} {list $a,$b,$c} } fooClass create ::foo foo test 1 } -cleanup { fooClass destroy } -result q,p,1 test oo-6.16 {Bug 3400658: forwarding and wrongargs rewriting - via alias} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test handler1 foo bar forward handler2 my handler x method handler {a b c d} {list $a,$b,$c,$d} export eval } fooClass create ::foo foo eval { interp alias {} [namespace current]::handler1 \ {} [namespace current]::my handler2 } foo test 1 2 3 } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "foo test d"} test oo-6.17 {Bug 3400658: forwarding and wrongargs rewriting - via ensemble} -setup { oo::class create fooClass } -body { oo::define fooClass { forward test handler1 foo bar boo forward handler2 my handler method handler {a b c d} {list $a,$b,$c,$d} export eval } fooClass create ::foo foo eval { namespace ensemble create \ -command [namespace current]::handler1 -parameters {p q} \ -map [list boo [list [namespace current]::my handler2]] } foo test 1 2 3 } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "foo test c d"} test oo-6.18 {Bug 3408830: more forwarding cases} -setup { oo::class create fooClass } -body { oo::define fooClass { forward len string length } [fooClass create foo] len a b } -returnCodes error -cleanup { fooClass destroy } -result {wrong # args: should be "::foo len string"} test oo-6.19 {Bug 3610404: forwarding resolution + traces} -setup { oo::object create foo unset -nocomplain ::result set ::result {} } -body { proc ::my {method} {lappend ::result global} oo::objdefine foo { method target {} {lappend ::result instance} forward bar my target method bump {} { set ns [info object namespace ::foo] rename ${ns}::my ${ns}:: rename ${ns}:: ${ns}::my } } proc harness {} { foo target foo bar foo target } trace add execution harness enterstep {apply {{cmd args} {foo bump}}} foo target foo bar foo bump foo bar harness } -cleanup { catch {rename harness {}} catch {rename ::my {}} foo destroy } -result {instance instance instance instance instance instance} test oo-6.20 {Bug 3610404: forwarding resolution + traces} -setup { oo::class create fooClass fooClass create foo unset -nocomplain ::result set ::result {} } -body { proc ::my {method} {lappend ::result global} oo::define fooClass { method target {} {lappend ::result class} forward bar my target method bump {} { set ns [info object namespace [self]] rename ${ns}::my ${ns}:: rename ${ns}:: ${ns}::my } } proc harness {} { foo target foo bar foo target } trace add execution harness enterstep {apply {{cmd args} {foo bump}}} foo target foo bar foo bump foo bar harness } -cleanup { catch {rename harness {}} catch {rename ::my {}} fooClass destroy } -result {class class class class class class} test oo-7.1 {OO: inheritance 101} -setup { oo::class create superClass oo::class create subClass subClass create instance } -body { oo::define superClass method doit x {lappend ::result $x} oo::define subClass superclass superClass set result [list [catch {subClass doit bad} msg] $msg] instance doit ok return $result } -cleanup { subClass destroy superClass destroy } -result {1 {unknown method "doit": must be create, destroy or new} ok} test oo-7.2 {OO: inheritance 101} -setup { oo::class create superClass oo::class create subClass subClass create instance } -body { oo::define superClass method doit x { lappend ::result |$x| } oo::define subClass superclass superClass oo::objdefine instance method doit x { lappend ::result =$x= next [incr x] } set result {} instance doit 1 return $result } -cleanup { subClass destroy superClass destroy } -result {=1= |2|} test oo-7.3 {OO: inheritance 101} -setup { oo::class create superClass oo::class create subClass subClass create instance } -body { oo::define superClass method doit x { lappend ::result |$x| } oo::define subClass { superclass superClass method doit x {lappend ::result -$x-; next [incr x]} } oo::objdefine instance method doit x { lappend ::result =$x=; next [incr x] } set result {} instance doit 1 return $result } -cleanup { subClass destroy superClass destroy } -result {=1= -2- |3|} test oo-7.4 {OO: inheritance from oo::class} -body { oo::class create meta { superclass oo::class self { unexport create new method make {x {definitions {}}} { if {![string match ::* $x]} { set ns [uplevel 1 {::namespace current}] set x ${ns}::$x } set o [my create $x] lappend ::result "made $o" oo::define $o $definitions return $o } } } set result [list [catch {meta create foo} msg] $msg] lappend result [meta make classinstance { lappend ::result "in definition script in [namespace current]" }] lappend result [classinstance create instance] } -cleanup { catch {classinstance destroy} catch {meta destroy} } -result {1 {unknown method "create": must be destroy or make} {made ::classinstance} {in definition script in ::oo::define} ::classinstance ::instance} test oo-7.5 {OO: inheritance from oo::class in the secondary chain} -body { oo::class create other oo::class create meta { superclass other oo::class self { unexport create new method make {x {definitions {}}} { if {![string match ::* $x]} { set ns [uplevel 1 {::namespace current}] set x ${ns}::$x } set o [my create $x] lappend ::result "made $o" oo::define $o $definitions return $o } } } set result [list [catch {meta create foo} msg] $msg] lappend result [meta make classinstance { lappend ::result "in definition script in [namespace current]" }] lappend result [classinstance create instance] } -cleanup { catch {classinstance destroy} catch {meta destroy} catch {other destroy} } -result {1 {unknown method "create": must be destroy or make} {made ::classinstance} {in definition script in ::oo::define} ::classinstance ::instance} test oo-7.6 {OO: inheritance 101 - overridden methods should be oblivious} -setup { oo::class create Aclass oo::class create Bclass Bclass create Binstance } -body { oo::define Aclass { method incr {var step} { upvar 1 $var v ::incr v $step } } oo::define Bclass { superclass Aclass method incr {var {step 1}} { global result lappend result $var $step set r [next $var $step] lappend result returning:$r return $r } } set result {} set x 10 lappend result x=$x lappend result [Binstance incr x] lappend result x=$x } -result {x=10 x 1 returning:11 11 x=11} -cleanup { unset -nocomplain x Aclass destroy } test oo-7.7 {OO: inheritance and errorInfo} -setup { oo::class create A oo::class create B B create c } -body { oo::define A method foo {} {error foo!} oo::define B { superclass A method foo {} { next } } oo::objdefine c method foo {} { next } catch {c ?} msg set result [list $msg] catch {c foo} msg lappend result $msg $errorInfo } -cleanup { A destroy } -result {{unknown method "?": must be destroy or foo} foo! {foo! while executing "error foo!" (class "::A" method "foo" line 1) invoked from within "next " (class "::B" method "foo" line 1) invoked from within "next " (object "::c" method "foo" line 1) invoked from within "c foo"}} test oo-7.8 {OO: next at the end of the method chain} -setup { set ::result "" } -cleanup { foo destroy } -body { oo::class create foo { method bar {} {lappend ::result foo; lappend ::result [next] foo} } oo::class create foo2 { superclass foo method bar {} {lappend ::result foo2; lappend ::result [next] foo2} } lappend result [catch {[foo2 new] bar} msg] $msg } -result {foo2 foo 1 {no next method implementation}} test oo-7.9 {OO: defining inheritance in namespaces} -setup { set ::result {} oo::class create ::parent namespace eval ::foo { oo::class create mixin {superclass ::parent} } } -cleanup { ::parent destroy namespace delete ::foo } -body { namespace eval ::foo { oo::class create bar {superclass parent} oo::class create boo oo::define boo {superclass bar} oo::define boo {mixin mixin} oo::class create spong {superclass boo} return } } -result {} test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup { set ::result "" oo::class create c1 { method m1 {} { lappend ::result c1::m1 } } oo::class create c2 { superclass c1 destructor { lappend ::result c2::destructor my m1 lappend ::result /c2::destructor } method m1 {} { lappend ::result c2::m1 rename [self] {} lappend ::result no-self next lappend ::result /c2::m1 } } } -body { c2 create o lappend ::result [catch {o m1} msg] $msg } -cleanup { c1 destroy unset ::result } -result {c2::m1 c2::destructor c2::m1 no-self c1::m1 /c2::m1 /c2::destructor no-self 1 {no next method implementation}} test oo-8.1 {OO: global must work in methods} { oo::object create foo oo::objdefine foo method bar x {global result; lappend result $x} set result {} foo bar this foo bar is lappend result a foo bar test foo destroy return $result } {this is a test} test oo-9.1 {OO: multiple inheritance} -setup { oo::class create A oo::class create B oo::class create C oo::class create D D create foo } -body { oo::define A method test {} {lappend ::result A; return ok} oo::define B { superclass A method test {} {lappend ::result B; next} } oo::define C { superclass A method test {} {lappend ::result C; next} } oo::define D { superclass B C method test {} {lappend ::result D; next} } set result {} lappend result [foo test] } -cleanup { D destroy C destroy B destroy A destroy } -result {D B C A ok} test oo-9.2 {OO: multiple inheritance} -setup { oo::class create A oo::class create B oo::class create C oo::class create D D create foo } -body { oo::define A method test {} {lappend ::result A; return ok} oo::define B { superclass A method test {} {lappend ::result B; next} } oo::define C { superclass A method test {} {lappend ::result C; next} } oo::define D { superclass B C method test {} {lappend ::result D; next} } set result {} lappend result [foo test] } -cleanup { A destroy } -result {D B C A ok} test oo-10.1 {OO: recursive invoke and modify} -setup { [oo::class create C] create O } -cleanup { C destroy } -body { oo::define C method foo x { lappend ::result $x if {$x} { [self object] foo [incr x -1] } } oo::objdefine O method foo x { lappend ::result -$x- if {$x == 1} { oo::objdefine O deletemethod foo } next $x } set result {} O foo 2 return $result } -result {-2- 2 -1- 1 0} test oo-10.2 {OO: recursive invoke and modify} -setup { oo::object create O } -cleanup { O destroy } -body { oo::objdefine O method foo {} { oo::objdefine [self] method foo {} { error "not called" } return [format %s%s call ed] } O foo } -result called test oo-10.3 {OO: invoke and modify} -setup { oo::class create A { method a {} {return A.a} method b {} {return A.b} method c {} {return A.c} } oo::class create B { superclass A method a {} {return [next],B.a} method b {} {return [next],B.b} method c {} {return [next],B.c} } B create C set result {} } -cleanup { A destroy } -body { lappend result [C a] [C b] [C c] - oo::define B deletemethod b lappend result [C a] [C b] [C c] - oo::define B renamemethod a b lappend result [C a] [C b] [C c] - oo::define B deletemethod b c lappend result [C a] [C b] [C c] } -result {A.a,B.a A.b,B.b A.c,B.c - A.a,B.a A.b A.c,B.c - A.a A.b,B.a A.c,B.c - A.a A.b A.c} test oo-10.4 {OO: invoke and modify} -setup { oo::class create A { method a {} {return A.a} method b {} {return A.b} method c {} {return A.c} } A create B oo::objdefine B { method a {} {return [next],B.a} method b {} {return [next],B.b} method c {} {return [next],B.c} } set result {} } -cleanup { A destroy } -body { lappend result [B a] [B b] [B c] - oo::objdefine B deletemethod b lappend result [B a] [B b] [B c] - oo::objdefine B renamemethod a b lappend result [B a] [B b] [B c] - oo::objdefine B deletemethod b c lappend result [B a] [B b] [B c] } -result {A.a,B.a A.b,B.b A.c,B.c - A.a,B.a A.b A.c,B.c - A.a A.b,B.a A.c,B.c - A.a A.b A.c} test oo-11.1 {OO: cleanup} { oo::object create foo set result [list [catch {oo::object create foo} msg] $msg] lappend result [foo destroy] [oo::object create foo] [foo destroy] } {1 {can't create object "foo": command already exists with that name} {} ::foo {}} test oo-11.2 {OO: cleanup} { oo::class create bar bar create foo set result [list [catch {bar create foo} msg] $msg] lappend result [bar destroy] [oo::object create foo] [foo destroy] } {1 {can't create object "foo": command already exists with that name} {} ::foo {}} test oo-11.3 {OO: cleanup} { oo::class create bar0 oo::class create bar oo::define bar superclass bar0 bar create foo set result [list [catch {bar create foo} msg] $msg] lappend result [bar0 destroy] [oo::object create foo] [foo destroy] } {1 {can't create object "foo": command already exists with that name} {} ::foo {}} test oo-11.4 {OO: cleanup} { oo::class create bar0 oo::class create bar1 oo::define bar1 superclass bar0 oo::class create bar2 oo::define bar2 { superclass bar0 destructor {lappend ::result destroyed} } oo::class create bar oo::define bar superclass bar1 bar2 bar create foo set result [list [catch {bar create foo} msg] $msg] lappend result [bar0 destroy] [oo::object create foo] [foo destroy] \ [oo::object create bar2] [bar2 destroy] } {1 {can't create object "foo": command already exists with that name} destroyed {} ::foo {} ::bar2 {}} test oo-11.5 {OO: cleanup} { oo::class create obj1 trace add command obj1 delete {apply {{name1 name2 action} { set namespace [info object namespace $name1] namespace delete $namespace }}} rename obj1 {} # No segmentation fault return done } done test oo-11.6.1 {OO: cleanup of when an class is mixed into itself} -constraints memory -body { leaktest { interp create interp1 oo::class create obj1 ::oo::define obj1 {self mixin [uplevel 1 {namespace which obj1}]} rename obj1 {} interp delete interp1 } } -result 0 test oo-11.6.2 {OO: cleanup ReleaseClassContents() where class is mixed into one of its instances} -constraints memory -body { leaktest { interp create interp1 interp1 eval { oo::class create obj1 ::oo::copy obj1 obj2 rename obj2 {} rename obj1 {} } interp delete interp1 } } -result 0 test oo-11.6.3 {OO: cleanup ReleaseClassContents() where class is mixed into one of its instances} -constraints memory -body { leaktest { interp create interp1 interp1 eval { oo::class create obj1 ::oo::define obj1 {self mixin [uplevel 1 {namespace which obj1}]} ::oo::copy obj1 obj2 rename obj2 {} rename obj1 {} } interp delete interp1 } } -result 0 test oo-11.6.4 {OO: cleanup ReleaseClassContents() where class is mixed into one of its instances} -body { oo::class create obj1 ::oo::define obj1 {self mixin [self]} ::oo::copy obj1 obj2 ::oo::objdefine obj2 {mixin [self]} ::oo::copy obj2 obj3 rename obj3 {} rename obj2 {} # No segmentation fault return done } -result done -cleanup { rename obj1 {} } test oo-11.7 {Bug 154f0982f2: createWithNamespace and an existing namespace} -setup { oo::class create Aclass { self export createWithNamespace method ns {} {namespace current} } } -body { namespace eval test_oo117 {variable name [namespace current]} list [Aclass createWithNamespace aInstance $test_oo117::name] [aInstance ns] } -returnCodes error -cleanup { Aclass destroy catch {namespace delete test_oo117} } -result {can't create namespace "::test_oo117": already exists} test oo-11.8 {Bug 708422: unset traces in deletion shouldn't crash} -setup { oo::class create foo { self export createWithNamespace method dummy {} {} } set result {} } -body { oo::define foo { variable x constructor {} { trace add variable x unset [list apply {{self ns args} { global result lappend result [info object isa object $self] lappend result [namespace exists $ns] # Method dispatch fails; too much gone in this case catch {$self dummy} msg lappend result $msg }} [self] [self namespace]] } } [foo createWithNamespace bar oo-11.8] destroy return $result } -cleanup { foo destroy } -result {1 0 {impossible to invoke method "dummy": no defined method or unknown method}} test oo-12.1 {OO: filters} { oo::class create Aclass Aclass create Aobject oo::define Aclass { method concatenate args { global result lappend result {*}$args join $args {} } method logFilter args { global result lappend result "calling [self object]->[self method] $args" set r [next {*}$args] lappend result "result=$r" return $r } } oo::objdefine Aobject filter logFilter set result {} lappend result [Aobject concatenate 1 2 3 4 5] Aclass destroy return $result } {{calling ::Aobject->logFilter 1 2 3 4 5} 1 2 3 4 5 result=12345 12345} test oo-12.2 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method concatenate args { global result lappend result {*}$args join $args {} } method logFilter args { global result lappend result "calling [self object]->[self method] $args" set r [next {*}$args] lappend result "result=$r" return $r } } oo::objdefine Aobject filter logFilter set result {} lappend result [Aobject concatenate 1 2 3 4 5] [Aobject destroy] } -cleanup { Aclass destroy } -result {{calling ::Aobject->logFilter 1 2 3 4 5} 1 2 3 4 5 result=12345 {calling ::Aobject->logFilter } result= 12345 {}} test oo-12.3 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method concatenate args { global result lappend result {*}$args join $args {} } method logFilter args { global result lappend result "calling [self object]->[self method] $args" set r [next {*}$args] lappend result "result=$r" return $r } filter logFilter } set result {} lappend result [Aobject concatenate 1 2 3 4 5] [Aobject destroy] } -cleanup { Aclass destroy } -result {{calling ::Aobject->logFilter 1 2 3 4 5} 1 2 3 4 5 result=12345 {calling ::Aobject->logFilter } result= 12345 {}} test oo-12.4 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method foo {} { return foo } method Bar {} { return 1 } method boo {} { if {[my Bar]} { next } { error forbidden } } filter boo } Aobject foo } -cleanup { Aclass destroy } -result foo test oo-12.5 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method foo {} { return foo } method Bar {} { return [my Bar2] } method Bar2 {} { return 1 } method boo {} { if {[my Bar]} { next } { error forbidden } } filter boo } Aobject foo } -cleanup { Aclass destroy } -result foo test oo-12.6 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method foo {} { return foo } method Bar {} { return [my Bar2] } method Bar2 {} { return [my Bar3] } method Bar3 {} { return 1 } method boo {} { if {[my Bar]} { next } { error forbidden } } filter boo } Aobject foo } -cleanup { Aclass destroy } -result foo test oo-12.7 {OO: filters} -setup { oo::class create Aclass Aclass create Aobject } -body { oo::define Aclass { method outerfoo {} { return [my InnerFoo] } method InnerFoo {} { return foo } method Bar {} { return [my Bar2] } method Bar2 {} { return [my Bar3] } method Bar3 {} { return 1 } method boo {} { lappend ::log [self target] if {[my Bar]} { next } else { error forbidden } } filter boo } set log {} list [Aobject outerfoo] $log } -cleanup { Aclass destroy } -result {foo {{::Aclass outerfoo} {::Aclass InnerFoo}}} test oo-12.8 {OO: filters and destructors} -setup { oo::class create Aclass Aclass create Aobject set ::log {} } -body { oo::define Aclass { constructor {} { lappend ::log "in constructor" } destructor { lappend ::log "in destructor" } method bar {} { lappend ::log "in method" } method Boo args { lappend ::log [self target] next {*}$args } filter Boo } set obj [Aclass new] $obj bar $obj destroy return $::log } -cleanup { Aclass destroy } -result {{in constructor} {::Aclass bar} {in method} {::oo::object destroy} {in destructor}} test oo-13.1 {OO: changing an object's class} { oo::class create Aclass oo::define Aclass {method bar {} {lappend ::result "in A [self object]"}} oo::class create Bclass oo::define Bclass {method bar {} {lappend ::result "in B [self object]"}} set result [Aclass create foo] foo bar oo::objdefine foo class Bclass foo bar Aclass destroy lappend result [info command foo] Bclass destroy return $result } {::foo {in A ::foo} {in B ::foo} foo} test oo-13.2 {OO: changing an object's class} -body { oo::object create foo oo::objdefine foo class oo::class } -cleanup { foo destroy } -result {} test oo-13.3 {OO: changing an object's class} -body { oo::class create foo oo::objdefine foo class oo::object } -cleanup { foo destroy } -result {} test oo-13.4 {OO: changing an object's class} -body { oo::class create foo { method m {} { set result [list [self class] [info object class [self]]] oo::objdefine [self] class ::bar lappend result [self class] [info object class [self]] } } oo::class create bar [foo new] m } -cleanup { foo destroy bar destroy } -result {::foo ::foo ::foo ::bar} test oo-13.5 {OO: changing an object's class: non-class to class} -setup { oo::object create fooObj } -body { oo::objdefine fooObj { class oo::class } oo::define fooObj { method x {} {expr {1+2+3}} } [fooObj new] x } -cleanup { fooObj destroy } -result 6 test oo-13.6 {OO: changing an object's class: class to non-class} -setup { oo::class create foo unset -nocomplain ::result } -body { set result dangling oo::define foo { method x {} {expr {1+2+3}} } oo::class create boo { superclass foo destructor {set ::result "ok"} } boo new foo create bar oo::objdefine foo { class oo::object } list $result [catch {bar x} msg] $msg } -cleanup { catch {bar destroy} foo destroy } -result {ok 1 {invalid command name "bar"}} test oo-13.7 {OO: changing an object's class} -setup { oo::class create foo oo::class create bar unset -nocomplain result } -body { oo::define bar method x {} {return ok} oo::define foo { method x {} {expr {1+2+3}} self mixin foo } lappend result [foo x] oo::objdefine foo class bar lappend result [foo x] } -cleanup { foo destroy bar destroy } -result {6 ok} test oo-13.8 {OO: changing an object's class to itself} -setup { oo::class create foo } -body { oo::define foo { method x {} {expr {1+2+3}} } oo::objdefine foo class foo } -cleanup { foo destroy } -returnCodes error -result {may not change classes into an instance of themselves} test oo-13.9 {OO: changing an object's class: roots are special} -setup { set i [interp create] } -body { $i eval { oo::objdefine oo::object { class oo::class } } } -cleanup { interp delete $i } -returnCodes error -result {may not modify the class of the root object class} test oo-13.10 {OO: changing an object's class: roots are special} -setup { set i [interp create] } -body { $i eval { oo::objdefine oo::class { class oo::object } } } -cleanup { interp delete $i } -returnCodes error -result {may not modify the class of the class of classes} test oo-13.11 {OO: changing an object's class in a tricky place} -setup { oo::class create cls unset -nocomplain result } -body { set result gorp list [catch { oo::define cls { method x {} {return} self class oo::object ::set ::result ok method y {} {return}; # I'm sorry, Dave. I'm afraid I can't do that. } } msg] $msg $result } -cleanup { cls destroy } -result {1 {attempt to misuse API} ok} # todo: changing a class subtype (metaclass) to another class subtype test oo-14.1 {OO: mixins} { oo::class create Aclass oo::define Aclass method bar {} {lappend ::result "[self object] in bar"} oo::class create Bclass oo::define Bclass method boo {} {lappend ::result "[self object] in boo"} oo::objdefine [Aclass create fooTest] mixin Bclass oo::objdefine [Aclass create fooTest2] mixin Bclass set result [list [catch {fooTest ?} msg] $msg] fooTest bar fooTest boo fooTest2 bar fooTest2 boo oo::objdefine fooTest2 mixin lappend result [Bclass destroy] [info command fooTest*] [Aclass destroy] } {1 {unknown method "?": must be bar, boo or destroy} {::fooTest in bar} {::fooTest in boo} {::fooTest2 in bar} {::fooTest2 in boo} {} fooTest2 {}} test oo-14.2 {OO: mixins} { oo::class create Aclass { method bar {} {return "[self object] in bar"} } oo::class create Bclass { method boo {} {return "[self object] in boo"} } oo::define Aclass mixin Bclass Aclass create fooTest set result [list [catch {fooTest ?} msg] $msg] lappend result [catch {fooTest bar} msg] $msg lappend result [catch {fooTest boo} msg] $msg lappend result [Bclass destroy] [info commands Aclass] } {1 {unknown method "?": must be bar, boo or destroy} 0 {::fooTest in bar} 0 {::fooTest in boo} {} {}} test oo-14.3 {OO and mixins and filters - advanced case} -setup { oo::class create mix oo::class create c { mixin mix } c create i } -body { oo::define mix { method foo {} {return >>[next]<<} filter foo } oo::objdefine i method bar {} {return foobar} i bar } -cleanup { mix destroy if {[info object isa object i]} { error "mixin deletion failed to destroy dependent instance" } } -result >>foobar<< test oo-14.4 {OO: mixin error case} -setup { oo::class create c } -body { oo::define c mixin c } -returnCodes error -cleanup { c destroy } -result {may not mix a class into itself} test oo-14.5 {OO and mixins and filters - advanced case} -setup { oo::class create mix oo::class create c { mixin mix } c create i } -body { oo::define mix { method foo {} {return >>[next]<<} filter foo } oo::objdefine i method bar {} {return foobar} i bar } -cleanup { c destroy mix destroy } -result >>foobar<< test oo-14.6 {OO and mixins of mixins - Bug 1960703} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create A { superclass parent method egg {} { return chicken } } oo::class create B { superclass parent mixin A method bar {} { # mixin from A my egg } } oo::class create C { superclass parent mixin B method foo {} { # mixin from B my bar } } [C new] foo } -result chicken test oo-14.7 {OO and filters from mixins of mixins} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create A { superclass parent method egg {} { return chicken } filter f method f args { set m [lindex [self target] 1] return "($m) [next {*}$args] ($m)" } } oo::class create B { superclass parent mixin A filter f method bar {} { # mixin from A my egg } } oo::class create C { superclass parent mixin B filter f method foo {} { # mixin from B my bar } } [C new] foo } -result {(foo) (bar) (egg) chicken (egg) (bar) (foo)} test oo-14.8 {OO: class mixin order - Bug 1998221} -setup { set ::result {} oo::class create parent { method test {} {} } } -cleanup { parent destroy } -body { oo::class create mix { superclass parent method test {} {lappend ::result mix; next; return $::result} } oo::class create cls { superclass parent mixin mix method test {} {lappend ::result cls; next; return $::result} } [cls new] test } -result {mix cls} test oo-14.9 {OO: class mixins must be unique in list} -setup { oo::class create parent } -body { oo::class create A {superclass parent} oo::class create B { superclass parent mixin A } oo::define B mixin -append A } -returnCodes error -cleanup { parent destroy } -result {class should only be a direct mixin once} test oo-14.10 {OO: instance mixins must be unique in list} -setup { oo::class create parent } -body { oo::class create A {superclass parent} oo::class create B { superclass parent constructor {} {oo::objdefine [self] mixin A} } B create obj oo::objdefine obj {mixin -append A} } -returnCodes error -cleanup { parent destroy } -result {class should only be a direct mixin once} test oo-15.1 {OO: object cloning} { oo::class create Aclass oo::define Aclass method test {} {lappend ::result [self object]->test} Aclass create Ainstance set result {} Ainstance test oo::copy Ainstance Binstance Binstance test Ainstance test Ainstance destroy namespace eval foo { oo::copy Binstance Cinstance Cinstance test } Aclass destroy namespace delete foo lappend result [info commands Binstance] } {::Ainstance->test ::Binstance->test ::Ainstance->test ::foo::Cinstance->test {}} test oo-15.2 {OO: object cloning} { oo::object create foo oo::objdefine foo { method m x {lappend ::result [self object] >$x<} forward f ::lappend ::result fwd } set result {} foo m 1 foo f 2 lappend result [oo::copy foo bar] foo m 3 foo f 4 bar m 5 bar f 6 lappend result [foo destroy] bar m 7 bar f 8 lappend result [bar destroy] } {::foo >1< fwd 2 ::bar ::foo >3< fwd 4 ::bar >5< fwd 6 {} ::bar >7< fwd 8 {}} catch {foo destroy} catch {bar destroy} test oo-15.3 {OO: class cloning} { oo::class create foo { method testme {} {lappend ::result [self class]->[self object]} } set result {} foo create baseline baseline testme oo::copy foo bar baseline testme bar create tester tester testme foo destroy tester testme bar destroy return $result } {::foo->::baseline ::foo->::baseline ::bar->::tester ::bar->::tester} test oo-15.4 {OO: object cloning - Bug 3474460} -setup { oo::class create ArbitraryClass } -body { ArbitraryClass create foo oo::objdefine foo variable a b c oo::copy foo bar info object variable bar } -cleanup { ArbitraryClass destroy } -result {a b c} test oo-15.5 {OO: class cloning - Bug 3474460} -setup { oo::class create ArbitraryClass } -body { oo::class create Foo { superclass ArbitraryClass variable a b c } oo::copy Foo Bar info class variable Bar } -cleanup { ArbitraryClass destroy } -result {a b c} test oo-15.6 {OO: object cloning copies namespace contents} -setup { oo::class create ArbitraryClass {export eval} } -body { ArbitraryClass create a a eval {proc foo x { variable y return [string repeat $x [incr y]] }} set result [list [a eval {foo 2}] [a eval {foo 3}]] oo::copy a b a eval {rename foo bar} lappend result [b eval {foo 2}] [b eval {foo 3}] [a eval {bar 4}] } -cleanup { ArbitraryClass destroy } -result {2 33 222 3333 444} test oo-15.7 {OO: classes can be cloned anonymously} -setup { oo::class create ArbitraryClassA oo::class create ArbitraryClassB {superclass ArbitraryClassA} } -body { info object isa class [oo::copy ArbitraryClassB] } -cleanup { ArbitraryClassA destroy } -result 1 test oo-15.8 {OO: intercept object cloning} -setup { oo::class create Foo set result {} } -body { oo::define Foo { constructor {msg} { variable v $msg } method {from} { next $from lappend ::result cloned $from [self] } method check {} { variable v lappend ::result check [self] $v } } Foo create foo ok oo::copy foo bar foo check bar check } -cleanup { Foo destroy } -result {cloned ::foo ::bar check ::foo ok check ::bar ok} test oo-15.9 {ensemble rewriting must not bleed through oo::copy} -setup { oo::class create Foo } -body { oo::define Foo { method {a b} {} } interp alias {} Bar {} oo::copy [Foo create foo] Bar bar } -returnCodes error -cleanup { Foo destroy } -result {wrong # args: should be "::bar a b"} test oo-15.10 {variable binding must not bleed through oo::copy} -setup { oo::class create FooClass set result {} } -body { set obj1 [FooClass new] oo::objdefine $obj1 { variable var method m {} { set var foo } method get {} { return $var } export eval } $obj1 m lappend result [$obj1 get] set obj2 [oo::copy $obj1] $obj2 eval { set var bar } lappend result [$obj2 get] $obj1 eval { set var grill } lappend result [$obj1 get] [$obj2 get] } -cleanup { FooClass destroy } -result {foo bar grill bar} test oo-15.11 {OO: object cloning} -returnCodes error -body { oo::copy } -result {wrong # args: should be "oo::copy sourceName ?targetName? ?targetNamespace?"} test oo-15.12 {OO: object cloning with target NS} -setup { oo::class create Super oo::class create Cls {superclass Super} } -body { namespace eval ::existing {} oo::copy Cls {} ::existing } -returnCodes error -cleanup { Super destroy catch {namespace delete ::existing} } -result {::existing refers to an existing namespace} test oo-15.13.1 { OO: object cloning with target NS Valgrind will report a leak if the reference count of the namespace isn't properly incremented. } -setup { oo::class create Cls {} } -body { oo::copy Cls Cls2 ::dupens return done } -cleanup { Cls destroy Cls2 destroy } -result done test oo-15.13.2 {OO: object cloning with target NS} -setup { oo::class create Super oo::class create Cls {superclass Super} } -body { list [namespace exist ::dupens] [oo::copy Cls Cls2 ::dupens] [namespace exist ::dupens] } -cleanup { Super destroy } -result {0 ::Cls2 1} test oo-15.14 {OO: object cloning with target NS} -setup { oo::class create Cls {export eval} set result {} } -body { Cls create obj obj eval { proc test-15.14 {} {} } lappend result [info commands ::dupens::t*] oo::copy obj obj2 ::dupens lappend result [info commands ::dupens::t*] } -cleanup { Cls destroy } -result {{} ::dupens::test-15.14} test oo-15.15 {method cloning must ensure that there is a string representation of bodies} -setup { oo::class create cls } -body { cls create foo oo::objdefine foo { method m1 {} [string map {a b} {return hello}] } [oo::copy foo] m1 } -cleanup { cls destroy } -result hello test oo-16.1 {OO: object introspection} -body { info object } -returnCodes 1 -result "wrong \# args: should be \"info object subcommand ?arg ...?\"" test oo-16.1.1 {OO: object introspection} -body { catch {info object} m o dict get $o -errorinfo } -result "wrong \# args: should be \"info object subcommand ?arg ...?\" while executing \"info object\"" test oo-16.2 {OO: object introspection} -body { info object class NOTANOBJECT } -returnCodes 1 -result {NOTANOBJECT does not refer to an object} test oo-16.3 {OO: object introspection} -body { info object gorp oo::object } -returnCodes 1 -result {unknown or ambiguous subcommand "gorp": must be call, class, creationid, definition, filters, forward, isa, methods, methodtype, mixins, namespace, properties, variables, or vars} test oo-16.4 {OO: object introspection} -setup { oo::class create meta { superclass oo::class } [meta create instance1] create instance2 } -body { list [list [info object class oo::object] \ [info object class oo::class] \ [info object class meta] \ [info object class instance1] \ [info object class instance2]] \ [list [info object isa class oo::object] \ [info object isa class meta] \ [info object isa class instance1] \ [info object isa class instance2]] \ [list [info object isa metaclass oo::object] \ [info object isa metaclass oo::class] \ [info object isa metaclass meta] \ [info object isa metaclass instance1] \ [info object isa metaclass instance2]] \ [list [info object isa object oo::object] \ [info object isa object oo::class] \ [info object isa object meta] \ [info object isa object instance1] \ [info object isa object instance2] \ [info object isa object oo::define] \ [info object isa object NOTANOBJECT]] } -cleanup { meta destroy } -result {{::oo::class ::oo::class ::oo::class ::meta ::instance1} {1 1 1 0} {0 1 1 0 0} {1 1 1 1 1 0 0}} test oo-16.5 {OO: object introspection} {info object methods oo::object} {} test oo-16.6 {OO: object introspection} { oo::object create foo set result [list [info object methods foo]] oo::objdefine foo method bar {} {...} lappend result [info object methods foo] [foo destroy] } {{} bar {}} test oo-16.7 {OO: object introspection} -setup { oo::object create foo } -body { oo::objdefine foo method bar {a {b c} args} {the body} set result [info object methods foo] lappend result [info object methodtype foo bar] \ [info object definition foo bar] } -cleanup { foo destroy } -result {bar method {{a {b c} args} {the body}}} test oo-16.8 {OO: object introspection} { oo::object create foo oo::class create bar oo::objdefine foo mixin bar set result [list [info object mixins foo] \ [info object isa mixin foo bar] \ [info object isa mixin foo oo::class]] foo destroy bar destroy return $result } {::bar 1 0} test oo-16.9 {OO: object introspection} -body { oo::class create Ac oo::class create Bc; oo::define Bc superclass Ac oo::class create Cc; oo::define Cc superclass Bc oo::class create Dc; oo::define Dc mixin Cc Cc create E Dc create F list [info object isa typeof E oo::class] \ [info object isa typeof E Ac] \ [info object isa typeof F Bc] \ [info object isa typeof F Cc] } -cleanup { catch {Ac destroy} } -result {0 1 1 1} test oo-16.10 {OO: object introspection} -setup { oo::object create foo } -body { oo::objdefine foo export eval foo eval {variable c 3 a 1 b 2 ddd 4 e} lsort [info object vars foo ?] } -cleanup { foo destroy } -result {a b c} test oo-16.11 {OO: object introspection} -setup { oo::class create foo foo create bar } -body { oo::define foo method spong {} {...} oo::objdefine bar method boo {a {b c} args} {the body} list [lsort [info object methods bar -all]] [lsort [info object methods bar -all -private]] } -cleanup { foo destroy } -result {{boo destroy spong} { boo destroy eval spong unknown variable varname}} test oo-16.12 {OO: object introspection} -setup { oo::object create foo } -cleanup { rename foo {} } -body { oo::objdefine foo unexport {*}[info object methods foo -all] info object methods foo -all } -result {} test oo-16.13 {OO: object introspection} -setup { oo::object create foo } -cleanup { rename foo {} } -body { oo::objdefine foo method Bar {} {return "ok in foo"} [info object namespace foo]::my Bar } -result "ok in foo" test oo-16.14 {OO: object introspection: TIP #436} -setup { oo::class create meta { superclass oo::class } [meta create instance1] create instance2 } -body { list class [list [info object isa class NOTANOBJECT] \ [info object isa class list]] \ meta [list [info object isa metaclass NOTANOBJECT] \ [info object isa metaclass list] \ [info object isa metaclass oo::object]] \ type [list [info object isa typeof oo::object NOTANOBJECT] \ [info object isa typeof NOTANOBJECT oo::object] \ [info object isa typeof list NOTANOBJECT] \ [info object isa typeof NOTANOBJECT list] \ [info object isa typeof oo::object list] \ [info object isa typeof list oo::object]] \ mix [list [info object isa mixin oo::object NOTANOBJECT] \ [info object isa mixin NOTANOBJECT oo::object] \ [info object isa mixin list NOTANOBJECT] \ [info object isa mixin NOTANOBJECT list] \ [info object isa mixin oo::object list] \ [info object isa mixin list oo::object]] } -cleanup { meta destroy } -result {class {0 0} meta {0 0 0} type {0 0 0 0 0 0} mix {0 0 0 0 0 0}} test oo-16.15 {OO: object introspection: creationid #500} -setup { oo::class create cls } -body { info object creationid [cls new] } -cleanup { cls destroy } -result {^\d+$} -match regexp test oo-16.16 {OO: object introspection: creationid #500} -setup { oo::class create cls } -body { set obj [cls new] set id [info object creationid $obj] rename $obj gorp set id2 [info object creationid gorp] list $id $id2 } -cleanup { cls destroy } -result {^(\d+) \1$} -match regexp test oo-16.17 {OO: object introspection: creationid #500} -body { info object creationid nosuchobject } -returnCodes error -result {nosuchobject does not refer to an object} test oo-16.18 {OO: object introspection: creationid #500} -body { info object creationid } -returnCodes error -result {wrong # args: should be "info object creationid objName"} test oo-16.18.1 {OO: object introspection: creationid #500} -body { info object creationid oo::object gorp } -returnCodes error -result {wrong # args: should be "info object creationid objName"} test oo-16.19 {OO: object introspection: creationid #500} -setup { oo::class create cls } -body { set id1 [info object creationid [set o1 [cls new]]] set id2 [info object creationid [set o2 [cls new]]] if {$id1 == $id2} { format "objects %s and %s have same creation id: %d" $o1 $o2 $id1 } else { string cat not-equal } } -cleanup { cls destroy } -result not-equal test oo-16.20 {OO: object introspection: creationid #500} -setup { oo::class create cls } -body { set id1 [info object creationid [set o1 [cls new]]] $o1 destroy set id2 [info object creationid [set o2 [cls new]]] if {$id1 == $id2} { format "objects %s and %s have same creation id: %d" $o1 $o2 $id1 } else { string cat not-equal } } -cleanup { cls destroy } -result not-equal test oo-16.21 {OO: object introspection: creationid #500} -setup { oo::class create cls } -body { set id1 [info object creationid [set o1 [cls new]]] set id2 [info object creationid [set o2 [oo::copy $o1]]] if {$id1 == $id2} { format "objects %s and %s have same creation id: %d" $o1 $o2 $id1 } else { string cat not-equal } } -cleanup { cls destroy } -result not-equal test oo-17.1 {OO: class introspection} -body { info class } -returnCodes 1 -result "wrong \# args: should be \"info class subcommand ?arg ...?\"" test oo-17.1.1 {OO: class introspection} -body { catch {info class} m o dict get $o -errorinfo } -result "wrong \# args: should be \"info class subcommand ?arg ...?\" while executing \"info class\"" test oo-17.2 {OO: class introspection} -body { info class superclass NOTANOBJECT } -returnCodes 1 -result {NOTANOBJECT does not refer to an object} test oo-17.3 {OO: class introspection} -setup { oo::object create foo } -body { info class superclass foo } -returnCodes 1 -cleanup { foo destroy } -result {"foo" is not a class} test oo-17.4 {OO: class introspection} -body { info class gorp oo::object } -returnCodes 1 -result {unknown or ambiguous subcommand "gorp": must be call, constructor, definition, definitionnamespace, destructor, filters, forward, instances, methods, methodtype, mixins, properties, subclasses, superclasses, or variables} test oo-17.5 {OO: class introspection} -setup { oo::class create testClass } -body { testClass create foo testClass create bar testClass create spong lsort [info class instances testClass] } -cleanup { testClass destroy } -result {::bar ::foo ::spong} test oo-17.6 {OO: class introspection} -setup { oo::class create foo } -body { oo::define foo method bar {a {b c} args} {the body} set result [info class methods foo] lappend result [info class methodtype foo bar] \ [info class definition foo bar] } -cleanup { foo destroy } -result {bar method {{a {b c} args} {the body}}} test oo-17.7 {OO: class introspection} { info class superclasses oo::class } ::oo::object test oo-17.8 {OO: class introspection} -setup { oo::class create testClass oo::class create superClass1 oo::class create superClass2 } -body { oo::define testClass superclass superClass1 superClass2 list [info class superclasses testClass] \ [lsort [info class subclass oo::object ::superClass?]] } -cleanup { testClass destroy superClass1 destroy superClass2 destroy } -result {{::superClass1 ::superClass2} {::superClass1 ::superClass2}} test oo-17.9 {OO: class introspection} -setup { oo::class create foo oo::class create subfoo {superclass foo} } -body { oo::define foo { method bar {a {b c} args} {the body} self { method bad {} {...} } } oo::define subfoo method boo {a {b c} args} {the body} list [lsort [info class methods subfoo -all]] \ [lsort [info class methods subfoo -all -private]] } -cleanup { foo destroy } -result {{bar boo destroy} { bar boo destroy eval unknown variable varname}} test oo-17.10 {OO: class introspection} -setup { oo::class create foo } -cleanup { rename foo {} } -body { oo::define foo unexport {*}[info class methods foo -all] info class methods foo -all } -result {} set stdmethods { destroy eval unknown variable varname} test oo-17.11 {OO: object method unexport (bug 900cb0284bc)} -setup { oo::object create o oo::objdefine o unexport m } -body { lsort [info object methods o -all -private] } -cleanup { o destroy } -result $stdmethods test oo-17.12 {OO: instance method unexport (bug 900cb0284bc)} -setup { oo::class create c c create o oo::objdefine o unexport m } -body { lsort [info object methods o -all -private] } -cleanup { o destroy c destroy } -result $stdmethods test oo-17.13 {OO: class method unexport (bug 900cb0284bc)} -setup { oo::class create c oo::define c unexport m } -body { lsort [info class methods c -all -private] } -cleanup { c destroy } -result $stdmethods test oo-17.14 {OO: instance method unexport (bug 900cb0284bc)} -setup { oo::class create c oo::define c unexport m c create o } -body { lsort [info object methods o -all -private] } -cleanup { o destroy c destroy } -result $stdmethods test oo-17.15 {OO: class method list without -all (bug 36e5517a6850)} -setup { oo::class create c } -body { oo::define c { method foo {} {} method Bar {} {} private method gorp {} {} } list [lsort [info class methods c]] [lsort [info class methods c -private]] } -cleanup { c destroy } -result {foo {Bar foo}} test oo-17.16 {OO: instance method list without -all (bug 36e5517a6850)} -setup { oo::object create o } -body { oo::objdefine o { method foo {} {} method Bar {} {} private method gorp {} {} } list [lsort [info object methods o]] [lsort [info object methods o -private]] } -cleanup { o destroy } -result {foo {Bar foo}} test oo-18.1 {OO: define command support} { list [catch {oo::define oo::object {error foo}} msg] $msg $errorInfo } {1 foo {foo while executing "error foo" (in definition script for class "::oo::object" line 1) invoked from within "oo::define oo::object {error foo}"}} test oo-18.2 {OO: define command support} { list [catch {oo::define oo::object error foo} msg] $msg $errorInfo } {1 foo {foo while executing "oo::define oo::object error foo"}} test oo-18.3 {OO: define command support} { list [catch {oo::class create foo {error bar}} msg] $msg $errorInfo } {1 bar {bar while executing "error bar" (in definition script for class "::foo" line 1) invoked from within "oo::class create foo {error bar}"}} test oo-18.3a {OO: define command support} { list [catch {oo::class create foo { error bar }} msg] $msg $errorInfo } {1 bar {bar while executing "error bar" (in definition script for class "::foo" line 2) invoked from within "oo::class create foo { error bar }"}} test oo-18.3b {OO: define command support} { list [catch {oo::class create foo { eval eval error bar }} msg] $msg $errorInfo } {1 bar {bar while executing "error bar" ("eval" body line 1) invoked from within "eval error bar" ("eval" body line 1) invoked from within "eval eval error bar" (in definition script for class "::foo" line 2) invoked from within "oo::class create foo { eval eval error bar }"}} test oo-18.4 {OO: more error traces from the guts} -setup { oo::object create obj } -body { oo::objdefine obj method bar {} {my eval {error foo}} list [catch {obj bar} msg] $msg $errorInfo } -cleanup { obj destroy } -result {1 foo {foo while executing "error foo" (in "my eval" script line 1) invoked from within "my eval {error foo}" (object "::obj" method "bar" line 1) invoked from within "obj bar"}} test oo-18.5 {OO: more error traces from the guts} -setup { [oo::class create cls] create obj set errorInfo {} } -body { oo::define cls { method eval script {next $script} export eval } oo::objdefine obj method bar {} {my eval {error foo}} set result {} lappend result [catch {obj bar} msg] $msg $errorInfo lappend result [catch {obj eval {error bar}} msg] $msg $errorInfo } -cleanup { cls destroy } -result {1 foo {foo while executing "error foo" (in "my eval" script line 1) invoked from within "next $script" (class "::cls" method "eval" line 1) invoked from within "my eval {error foo}" (object "::obj" method "bar" line 1) invoked from within "obj bar"} 1 bar {bar while executing "error bar" (in "::obj eval" script line 1) invoked from within "next $script" (class "::cls" method "eval" line 1) invoked from within "obj eval {error bar}"}} test oo-18.6 {class construction reference management and errors} -setup { oo::class create super_abc } -body { catch { oo::class create abc { superclass super_abc ::rename abc ::def ::error foo } } msg opt dict get $opt -errorinfo } -cleanup { super_abc destroy } -result {foo while executing "::error foo" (in definition script for class "::def" line 4) invoked from within "oo::class create abc { superclass super_abc ::rename abc ::def ::error foo }"} test oo-18.7 {OO: objdefine command support} -setup { oo::object create ::inst } -body { list [catch {oo::objdefine inst {rename ::inst ::INST;error foo}} msg] $msg $errorInfo } -cleanup { catch {::inst destroy} catch {::INST destroy} } -result {1 foo {foo while executing "error foo" (in definition script for object "::INST" line 1) invoked from within "oo::objdefine inst {rename ::inst ::INST;error foo}"}} test oo-18.8 {OO: define/self command support} -setup { oo::class create parent oo::class create ::foo {superclass parent} } -body { catch {oo::define foo {rename ::foo ::bar; self {error foobar}}} msg opt dict get $opt -errorinfo } -cleanup { parent destroy } -result {foobar while executing "error foobar" (in definition script for class object "::bar" line 1) invoked from within "self {error foobar}" (in definition script for class "::bar" line 1) invoked from within "oo::define foo {rename ::foo ::bar; self {error foobar}}"} test oo-18.9 {OO: define/self command support} -setup { oo::class create parent set c [oo::class create now_this_is_a_very_very_long_class_name_indeed { superclass parent }] } -body { catch {oo::define $c {error err}} msg opt dict get $opt -errorinfo } -cleanup { parent destroy } -result {err while executing "error err" (in definition script for class "::now_this_is_a_very_very_long..." line 1) invoked from within "oo::define $c {error err}"} test oo-18.10 {OO: define/self command support} -setup { oo::class create parent oo::class create ::foo {superclass parent} } -body { catch {oo::define foo {self {rename ::foo {}; error foobar}}} msg opt dict get $opt -errorinfo } -cleanup { parent destroy } -result {foobar while executing "error foobar" (in definition script for class object "::foo" line 1) invoked from within "self {rename ::foo {}; error foobar}" (in definition script for class "::foo" line 1) invoked from within "oo::define foo {self {rename ::foo {}; error foobar}}"} test oo-18.11 {OO: define/self command support} -setup { oo::class create parent oo::class create ::foo {superclass parent} } -body { catch {oo::define foo {rename ::foo {}; self {error foobar}}} msg opt dict get $opt -errorinfo } -cleanup { parent destroy } -result {this command cannot be called when the object has been deleted while executing "self {error foobar}" (in definition script for class "::foo" line 1) invoked from within "oo::define foo {rename ::foo {}; self {error foobar}}"} test oo-18.12 {OO: self callable via eval method} -setup { oo::class create parent { export eval } parent create ::foo } -body { foo eval { self } } -cleanup { parent destroy } -result ::foo test oo-19.1 {OO: varname method} -setup { oo::object create inst oo::objdefine inst export eval set result {} inst eval { variable x } } -body { inst eval {trace add variable x write foo} set ns [inst eval namespace current] proc foo args { global ns result set context [uplevel 1 namespace current] lappend result $args [expr { $ns eq $context ? "ok" : [list $ns ne $context] }] [expr { "${ns}::x" eq [uplevel 1 my varname x] ? "ok" : [list ${ns}::x ne [uplevel 1 my varname x]] }] } lappend result [inst eval set x 0] } -cleanup { inst destroy rename foo {} } -result {{x {} write} ok ok 0} test oo-19.2 {OO: varname method: Bug 2883857} -setup { oo::class create SpecialClass oo::objdefine SpecialClass export createWithNamespace SpecialClass createWithNamespace inst ::oo_test oo::objdefine inst export varname eval } -body { inst eval { variable x; array set x {y z} } inst varname x(y) } -cleanup { SpecialClass destroy } -result ::oo_test::x(y) test oo-19.3 {OO: varname method and variable decl: Bug 3603695} -setup { oo::class create testClass { variable foo export varname constructor {} { variable foo x } method bar {obj} { my varname foo $obj varname foo } } } -body { testClass create A testClass create B lsearch [list [A varname foo] [B varname foo]] [B bar A] } -cleanup { testClass destroy } -result 0 test oo-19.4 {OO: varname ghosts [Bug 74b6110204]} -setup { oo::class create testClass { export varname self export createWithNamespace } set obj [testClass createWithNamespace testoo19_4 testoo19_4] set ns [info object namespace $obj] } -body { set v [$obj varname foo] list [namespace which -variable $v] \ [info exists $v] [namespace which -variable $v] } -cleanup { testClass destroy } -result {::testoo19_4::foo 0 ::testoo19_4::foo} test oo-19.5 {OO: varname array elements [Bug 2da1cb0c80]} -setup { set obj [oo::object new] oo::objdefine $obj export eval varname } -body { $obj eval { namespace upvar :: tcl_platform(platform) foo } $obj varname foo } -cleanup { $obj destroy } -result ::tcl_platform(platform) # Test oo-19.5.1 is no longer relevant test oo-20.1 {OO: variable method} -body { oo::class create testClass { constructor {} { my variable ok set ok {} } } lsort [info object vars [testClass new]] } -cleanup { catch {testClass destroy} } -result ok test oo-20.2 {OO: variable method} -body { oo::class create testClass { constructor {} { my variable a b c set a [set b [set c {}]] } } lsort [info object vars [testClass new]] } -cleanup { catch {testClass destroy} } -result {a b c} test oo-20.3 {OO: variable method} -body { oo::class create testClass { export varname method bar {} { my variable a(b) } } testClass create foo array set [foo varname a] {b c} foo bar } -returnCodes 1 -cleanup { catch {testClass destroy} } -result {can't define "a(b)": name refers to an element in an array} test oo-20.4 {OO: variable method} -body { oo::class create testClass { export varname method bar {} { my variable a(b) } } testClass create foo set [foo varname a] b foo bar } -returnCodes 1 -cleanup { catch {testClass destroy} } -result {can't define "a(b)": name refers to an element in an array} test oo-20.5 {OO: variable method} -body { oo::class create testClass { method bar {} { my variable a::b } } testClass create foo foo bar } -returnCodes 1 -cleanup { catch {testClass destroy} } -result {variable name "a::b" illegal: must not contain namespace separator} test oo-20.6 {OO: variable method} -setup { oo::class create testClass { export varname self export eval } } -body { testClass eval variable a 0 oo::objdefine [testClass create foo] method bar {other} { $other variable a set a 3 } oo::objdefine [testClass create boo] export variable set [foo varname a] 1 set [boo varname a] 2 foo bar boo list [testClass eval set a] [set [foo varname a]] [set [boo varname a]] } -cleanup { testClass destroy } -result {0 1 3} test oo-20.7 {OO: variable method} -setup { oo::class create cls } -body { oo::define cls { method a {} { my variable d b lappend b $d } method e {} { my variable b d return [list $b $d] } method f {x y} { my variable b d set b $x set d $y } } cls create obj obj f p q obj a obj a obj e } -cleanup { cls destroy } -result {{p q q} q} # oo-20.8 tested explicitly for functionality removed due to [Bug 1959457] test oo-20.9 {OO: variable method} -setup { oo::object create obj } -body { oo::objdefine obj { method a {} { my variable ::b } } obj a } -returnCodes 1 -cleanup { obj destroy } -result {variable name "::b" illegal: must not contain namespace separator} test oo-20.10 {OO: variable and varname methods refer to same things} -setup { oo::object create obj } -body { oo::objdefine obj { method a {} { my variable b set b [self] return [my varname b] } } list [set [obj a]] [namespace tail [obj a]] } -cleanup { obj destroy } -result {::obj b} test oo-20.11 {OO: variable mustn't crash when recursing} -body { oo::class create A { constructor {name} { my variable np_name set np_name $name } method copy {nm} { set cpy [[info object class [self]] new $nm] foreach var [info object vars [self]] { my variable $var set val [set $var] if {[string match o_* $var]} { set objs {} foreach ref $val { # call to "copy" crashes lappend objs [$ref copy {}] } $cpy prop $var $objs } else { $cpy prop $var $val } } return $cpy } method prop {name val} { my variable $name set $name $val } } set o1 [A new {}] set o2 [A new {}] $o1 prop o_object $o2 $o1 copy aa } -cleanup { catch {A destroy} } -match glob -result * test oo-20.12 {OO: variable method accept zero args (TIP 323)} -setup { oo::object create foo } -cleanup { foo destroy } -body { oo::objdefine foo method demo {} { my variable } foo demo } -result {} test oo-20.13 {OO: variable method use in non-methods [Bug 2903811]} -setup { oo::object create fooObj oo::objdefine fooObj export variable } -cleanup { fooObj destroy } -body { apply {{} {fooObj variable x; set x ok; return}} apply {{} {fooObj variable x; return $x}} } -result ok test oo-20.14 {OO: variable method use in non-methods [Bug 2903811]} -setup { oo::object create fooObj oo::objdefine fooObj export variable namespace eval ns1 {} namespace eval ns2 {} set x bad } -cleanup { fooObj destroy namespace delete ns1 ns2 unset x } -body { namespace eval ns1 {fooObj variable x; set x ok; subst ""} set x bad namespace eval ns2 {fooObj variable x; return $x} } -result ok test oo-20.15 {OO: variable method use in non-methods [Bug 2903811]} -setup { oo::object create fooObj oo::objdefine fooObj export variable varname } -cleanup { fooObj destroy } -body { apply {{} {fooObj variable x; set x ok; return}} return [set [fooObj varname x]] } -result ok test oo-20.16 {variable method: leak per instance} -setup { oo::class create foo } -constraints memory -body { oo::define foo { constructor {} { set [my variable v] 0 } } leaktest {[foo new] destroy} } -cleanup { foo destroy } -result 0 test oo-21.1 {OO: inheritance ordering} -setup { oo::class create A } -body { oo::define A method m {} {lappend ::result A} oo::class create B { superclass A method m {} {lappend ::result B;next} } oo::class create C { superclass A method m {} {lappend ::result C;next} } oo::class create D { superclass B C method m {} {lappend ::result D;next} } D create o oo::objdefine o method m {} {lappend ::result o;next} set result {} o m return $result } -cleanup { A destroy } -result {o D B C A} test oo-21.2 {OO: inheritance ordering} -setup { oo::class create A } -body { oo::define A method m {} {lappend ::result A} oo::class create B { superclass A method m {} {lappend ::result B;next} } oo::class create C { superclass A method m {} {lappend ::result C;next} } oo::class create D { superclass B C method m {} {lappend ::result D;next} } oo::class create Emix { superclass C method m {} {lappend ::result Emix;next} } oo::class create Fmix { superclass Emix method m {} {lappend ::result Fmix;next} } D create o oo::objdefine o { method m {} {lappend ::result o;next} mixin Fmix } set result {} o m return $result } -cleanup { A destroy } -result {Fmix Emix o D B C A} test oo-21.3 {OO: inheritance ordering} -setup { oo::class create A } -body { oo::define A method m {} {lappend ::result A} oo::class create B { superclass A method m {} {lappend ::result B;next} method f {} {lappend ::result B-filt;next} } oo::class create C { superclass A method m {} {lappend ::result C;next} } oo::class create D { superclass B C method m {} {lappend ::result D;next} } oo::class create Emix { superclass C method m {} {lappend ::result Emix;next} method f {} {lappend ::result Emix-filt;next} } oo::class create Fmix { superclass Emix method m {} {lappend ::result Fmix;next} } D create o oo::objdefine o { method m {} {lappend ::result o;next} mixin Fmix filter f } set result {} o m return $result } -cleanup { A destroy } -result {Emix-filt B-filt Fmix Emix o D B C A} test oo-21.4 {OO: inheritance ordering} -setup { oo::class create A } -body { oo::define A method m {} {lappend ::result A} oo::class create B { superclass A method m {} {lappend ::result B;next} method f {} {lappend ::result B-filt;next} method g {} {lappend ::result B-cfilt;next} } oo::class create C { superclass A method m {} {lappend ::result C;next} } oo::class create D { superclass B C method m {} {lappend ::result D;next} method g {} {lappend ::result D-cfilt;next} filter g } oo::class create Emix { superclass C method m {} {lappend ::result Emix;next} method f {} {lappend ::result Emix-filt;next} } oo::class create Fmix { superclass Emix method m {} {lappend ::result Fmix;next} } D create o oo::objdefine o { method m {} {lappend ::result o;next} mixin Fmix filter f } set result {} o m return $result } -cleanup { A destroy } -result {Emix-filt B-filt D-cfilt B-cfilt Fmix Emix o D B C A} test oo-22.1 {OO and info frame} -setup { oo::class create c c create i } -match glob -body { oo::define c self method frame {} { info frame 0 } oo::define c { method frames {} { info frame 0 } method level {} { info frame } } oo::objdefine i { method frames {} { list [next] [info frame 0] } method level {} { expr {[next] - [info frame]} } } list [i level] [i frames] [dict get [c frame] object] } -cleanup { c destroy } -result {1 {{* cmd {info frame 0} method frames class ::c level 0} {* cmd {info frame 0} method frames object ::i level 0}} ::c} test oo-22.2 {OO and info frame: Bug 3001438} -setup { oo::class create c } -body { oo::define c method test {{x 1}} { if {$x} {my test 0} lsort {q w e r t y u i o p}; # Overwrite the Tcl stack info frame 0 } [c new] test } -match glob -cleanup { c destroy } -result {* cmd {info frame 0} method test class ::c level 0} # Common code for oo-22.{3,4,5,6} oo::class create WorkerBase oo::class create WorkerSupport { superclass oo::class WorkerBase variable result stop method WithWorkers {nworkers args script} { set workers {} try { for {set n 1} {$n <= $nworkers} {incr n} { lappend workers [set worker [[self] new]] $worker schedule {*}$args } return [uplevel 1 $script] } finally { foreach worker $workers {$worker destroy} } } method run {nworkers} { set result {} set stopvar [my varname stop] set stop false my WithWorkers $nworkers [list my Work [my varname result]] { after idle [namespace code {set stop true}] vwait $stopvar } return $result } } oo::class create Worker { superclass WorkerBase method schedule {args} { set coro [namespace current]::coro if {![llength [info commands $coro]]} { coroutine $coro {*}$args } } method Work args {error unimplemented} method dump {} { info frame [expr {[info frame] - 1}] } } test oo-22.3 {OO and coroutines and info frame: Bug 87271f7cd6} -body { # Triggers a crash with incorrectly restored pmPtr->procPtr->cmdPtr WorkerSupport create A { superclass Worker method Work {var} { after 0 [info coroutine] yield lappend $var [my dump] } } A run 2 } -cleanup { catch {rename dump {}} catch {A destroy} } -match glob -result {{* method Work class ::A *} {* method Work class ::A *}} test oo-22.4 {OO and coroutines and info frame: Bug 87271f7cd6} -body { # Triggers a crash with incorrectly cloned pmPtr->procPtr->cmdPtr WorkerSupport create A { superclass Worker method Work {var} { after 0 [info coroutine] yield lappend $var [my dump] } } # Copies the methods, changing the declarer # Test it works with the source class still around oo::copy A B B run 2 } -cleanup { catch {rename dump {}} catch {A destroy} catch {B destroy} } -match glob -result {{* method Work class ::B *} {* method Work class ::B *}} test oo-22.5 {OO and coroutines and info frame: Bug 87271f7cd6} -body { # Triggers a crash with incorrectly cloned pmPtr->procPtr->cmdPtr WorkerSupport create A { superclass Worker method Work {var} { after 0 [info coroutine] yield lappend $var [my dump] } } # Copies the methods, changing the declarer # Test it works with the source class deleted oo::copy A B catch {A destroy} B run 2 } -cleanup { catch {rename dump {}} catch {B destroy} } -match glob -result {{* method Work class ::B *} {* method Work class ::B *}} test oo-22.6 {OO and coroutines and info frame: Bug 87271f7cd6} -body { # Triggers a crash with incorrectly cloned pmPtr->procPtr->cmdPtr WorkerSupport create A { superclass Worker method Work {var} { after 0 [info coroutine] yield lappend $var [my dump] } } # Copies the methods, changing the declarer # Test it works in the original source class with the copy around oo::copy A B B run 2 A run 2 } -cleanup { catch {rename dump {}} catch {A destroy} catch {B destroy} } -match glob -result {{* method Work class ::A *} {* method Work class ::A *}} WorkerBase destroy test oo-22.7 {oo::define and info frame: correct argument line} -setup { oo::class create C { variable base constructor {info} {set base [dict get $info line]} method Relative {} { set info [next] if {![dict exists $info file]} { error "no file-relative line info: $info" } expr {[dict get $info line] - $base} } filter Relative } } -body { C create o [info frame 0] oo::define C { method line1 {} {info frame 0} method line2 { } {info frame 0} method line3 { } { info frame 0 } } oo::define C method line4 {} {info frame 0} oo::define C method line5 { } {info frame 0} oo::define C method line6 { } { info frame 0 } list [o line1] [o line2] [o line3] [o line4] [o line5] [o line6] } -cleanup { C destroy } -result {2 4 7 10 12 15} test oo-22.8 {oo::objdefine and info frame: correct argument line} -setup { oo::class create C { variable base constructor {info} {set base [dict get $info line]} method Relative {} { set info [next] if {![dict exists $info file]} { error "no file-relative line info: $info" } expr {[dict get $info line] - $base} } filter Relative } } -body { C create o [info frame 0] oo::objdefine o { method line1 {} {info frame 0} method line2 { } {info frame 0} method line3 { } { info frame 0 } } oo::objdefine o method line4 {} {info frame 0} oo::objdefine o method line5 { } {info frame 0} oo::objdefine o method line6 { } { info frame 0 } list [o line1] [o line2] [o line3] [o line4] [o line5] [o line6] } -cleanup { C destroy } -result {2 4 7 10 12 15} # Prove that the issue in [Bug 1865054] isn't an issue any more test oo-23.1 {Self-like derivation; complex case!} -setup { oo::class create SELF { superclass oo::class unexport create new # Next is just a convenience method method args {oo::define [self] method {*}$args} method derive {name} { set o [my new [list superclass [self]]] oo::objdefine $o mixin $o uplevel 1 [list rename $o $name]\;[list namespace which $name] } self mixin SELF } set result {} } -body { [SELF derive foo1] method bar1 {} {return 1} lappend result [foo1 bar1] [foo1 derive foo2] method bar2 {} {return [my bar1],2} lappend result [foo2 bar2] [foo2 derive foo3] method bar3 {} {return [my bar2],3} lappend result [foo3 bar3] [foo3 derive foo4] method bar4 {} {return [my bar3],4} lappend result [foo4 bar4] foo2 method bar2 {} {return [my bar1],x} lappend result [foo4 bar4] } -cleanup { SELF destroy } -result {1 1,2 1,2,3 1,2,3,4 1,x,3,4} test oo-24.1 {unknown method method - Bug 1965063} -setup { oo::class create cls } -cleanup { cls destroy } -returnCodes error -body { oo::define cls { method dummy {} {} method unknown args {next {*}$args} } [cls new] foo bar } -result {unknown method "foo": must be destroy, dummy or unknown} test oo-24.2 {unknown method method - Bug 1965063} -setup { oo::class create cls } -cleanup { cls destroy } -returnCodes error -body { oo::define cls { method dummy {} {} method unknown args {next {*}$args} } cls create obj oo::objdefine obj { method dummy2 {} {} method unknown args {next {*}$args} } obj foo bar } -result {unknown method "foo": must be destroy, dummy, dummy2 or unknown} test oo-24.3 {unknown method method - absent method name} -setup { set o [oo::object new] } -cleanup { $o destroy } -body { oo::objdefine $o method unknown args { return "unknown: >>$args<<" } list [$o] [$o foobar] [$o foo bar] } -result {{unknown: >><<} {unknown: >>foobar<<} {unknown: >>foo bar<<}} # Probably need a better set of tests, but this is quite difficult to devise test oo-25.1 {call chain caching} -setup { oo::class create cls { method ab {} {return ok} } set result {} } -cleanup { cls destroy } -body { cls create foo cls create bar set m1 ab set m2 a; append m2 b ;# different object! lappend result [foo $m1] [foo $m1] [bar $m1] [foo $m1] lappend result [foo $m2] [bar $m2] oo::objdefine foo method ab {} {return good} lappend result [foo $m1] [bar $m2] } -result {ok ok ok ok ok ok good ok} test oo-25.2 {call chain caching - Bug #2120903} -setup { set c [oo::class create MyClass] set o [$c new] } -body { oo::define MyClass { method name {} {return ok} method isa o {MyClass name $o} self method name o {$o name} } list [$o name] [$c name $o] [$o isa $o] } -cleanup { $c destroy } -result {ok ok ok} test oo-26.1 {Bug 2037727} -setup { proc succeed args {} oo::object create example } -body { oo::objdefine example method foo {} {succeed} example foo proc succeed {} {return succeed} example foo } -cleanup { example destroy rename succeed {} } -result succeed test oo-26.2 {Bug 2037727} -setup { oo::class create example { method localProc {args body} {proc called $args $body} method run {} { called } } example create i1 example create i2 } -body { i1 localProc args {} i2 localProc args {return nonempty} list [i1 run] [i2 run] } -cleanup { example destroy } -result {{} nonempty} test oo-26.3 {Bug 2037727} -setup { oo::class create example { method subProc {args body} { namespace eval subns [list proc called $args $body] } method run {} { subns::called } } example create i1 example create i2 } -body { i1 subProc args {} i2 subProc args {return nonempty} list [i1 run] [i2 run] } -cleanup { example destroy } -result {{} nonempty} test oo-27.1 {variables declaration - class introspection} -setup { oo::class create foo } -cleanup { foo destroy } -body { oo::define foo variable a b c info class variables foo } -result {a b c} test oo-27.2 {variables declaration - object introspection} -setup { oo::object create foo } -cleanup { foo destroy } -body { oo::objdefine foo variable a b c info object variables foo } -result {a b c} test oo-27.3 {variables declaration - basic behaviour} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x! constructor {} {set x! 1} method y {} {incr x!} } foo create bar bar y bar y } -result 3 test oo-27.4 {variables declaration - destructors too} -setup { oo::class create parent set result bad! } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x! constructor {} {set x! 1} method y {} {incr x!} destructor {set ::result ${x!}} } foo create bar bar y bar y bar destroy return $result } -result 3 test oo-27.5 {variables declaration - object-bound variables} -setup { oo::object create foo } -cleanup { foo destroy } -body { oo::objdefine foo { variable x! method y {} {incr x!} } foo y foo y } -result 2 test oo-27.6 {variables declaration - non-interference of levels} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x! constructor {} {set x! 1} method y {} {incr x!} } foo create bar oo::objdefine bar { variable y! method y {} {list [next] [incr y!] [info var] [info locals]} export eval } bar y list [bar y] [lsort [info object vars bar]] [bar eval {info vars *!}] } -result {{3 2 y! {}} {x! y!} {x! y!}} test oo-27.7 {variables declaration - one underlying variable space} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x! constructor {} {set x! 1} method y {} {incr x!} } oo::class create foo2 { superclass foo variable y! constructor {} {set y! 42; next} method x {} {incr y! -1} } foo2 create bar oo::objdefine bar { variable x! y! method z {} {list ${x!} ${y!}} } bar y bar x list [bar y] [bar x] [bar z] } -result {3 40 {3 40}} test oo-27.8 {variables declaration - error cases - ns separators} -body { oo::define oo::object variable bad::var } -returnCodes error -result {invalid declared variable name "bad::var": must not contain namespace separators} test oo-27.9 {variables declaration - error cases - arrays} -body { oo::define oo::object variable bad(var) } -returnCodes error -result {invalid declared variable name "bad(var)": must not refer to an array element} test oo-27.10 {variables declaration - no instance var leaks with class resolvers} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable clsvar constructor {} { set clsvar 0 } method step {} { incr clsvar return } method value {} { return $clsvar } } foo create inst1 inst1 step foo create inst2 inst2 step inst1 step inst2 step inst1 step list [inst1 value] [inst2 value] } -result {3 2} test oo-27.11 {variables declaration - no instance var leaks with class resolvers} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable clsvar constructor {} { set clsvar 0 } method step {} { incr clsvar return } method value {} { return $clsvar } } foo create inst1 oo::objdefine inst1 { variable clsvar method reinit {} { set clsvar 0 } } foo create inst2 oo::objdefine inst2 { variable clsvar method reinit {} { set clsvar 0 } } inst1 step inst2 step inst1 reinit inst2 reinit inst1 step inst2 step inst1 step inst2 step inst1 step list [inst1 value] [inst2 value] } -result {3 2} test oo-27.12 {variables declaration: leak per instance} -setup { oo::class create foo } -constraints memory -body { oo::define foo { variable v constructor {} { set v 0 } } leaktest {[foo new] destroy} } -cleanup { foo destroy } -result 0 # This test will actually (normally) crash if it fails! test oo-27.13 {variables declaration: Bug 3185009: require refcount management} -setup { oo::object create foo } -body { oo::objdefine foo { variable x method set v {set x $v} method unset {} {unset x} method exists {} {info exists x} method get {} {return $x} } list [foo exists] [foo set 7] [foo exists] [foo get] [foo unset] \ [foo exists] [catch {foo get} msg] $msg } -cleanup { foo destroy } -result {0 7 1 7 {} 0 1 {can't read "x": no such variable}} test oo-27.14 {variables declaration - multiple use} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x variable y method boo {} { return [incr x],[incr y] } } foo create bar list [bar boo] [bar boo] } -result {1,1 2,2} test oo-27.15 {variables declaration - multiple use} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable variable x y method boo {} { return [incr x],[incr y] } } foo create bar list [bar boo] [bar boo] } -result {1,1 2,2} test oo-27.16 {variables declaration - multiple use} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x variable -clear variable y method boo {} { return [incr x],[incr y] } } foo create bar list [bar boo] [bar boo] } -result {1,1 1,2} test oo-27.17 {variables declaration - multiple use} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x variable -set y method boo {} { return [incr x],[incr y] } } foo create bar list [bar boo] [bar boo] } -result {1,1 1,2} test oo-27.18 {variables declaration - multiple use} -setup { oo::class create parent } -cleanup { parent destroy } -body { oo::class create foo { superclass parent variable x variable -? y method boo {} { return [incr x],[incr y] } } foo create bar list [bar boo] [bar boo] } -returnCodes error -match glob -result {unknown method "-?": must be *} test oo-27.19 {variables declaration and [info vars]: Bug 2712377} -setup { oo::class create Foo set result {} } -body { # This is really a test of problems to do with Tcl's introspection when a # variable resolver is present... oo::define Foo { variable foo bar method setvars {f b} { set foo $f set bar $b } method dump1 {} { lappend ::result <1> foreach v [lsort [info vars *]] { lappend ::result $v=[set $v] } lappend ::result [info locals] [info locals *] } method dump2 {} { lappend ::result <2> foreach v [lsort [info vars *]] { lappend ::result $v=[set $v] } lappend ::result | foo=$foo [info locals] [info locals *] } } Foo create stuff stuff setvars what ever stuff dump1 stuff dump2 return $result } -cleanup { Foo destroy } -result {<1> bar=ever foo=what v v <2> bar=ever foo=what | foo=what v v} test oo-27.20 {variables declaration and [info vars]: Bug 2712377} -setup { oo::class create Foo set result {} } -body { # This is really a test of problems to do with Tcl's introspection when a # variable resolver is present... oo::define Foo { variable foo bar method setvars {f b} { set foo $f set bar $b } method dump1 {} { lappend ::result <1> foreach v [lsort [info vars *o]] { lappend ::result $v=[set $v] } lappend ::result [info locals] [info locals *] } method dump2 {} { lappend ::result <2> foreach v [lsort [info vars *o]] { lappend ::result $v=[set $v] } lappend ::result | foo=$foo [info locals] [info locals *] } } Foo create stuff stuff setvars what ever stuff dump1 stuff dump2 return $result } -cleanup { Foo destroy } -result {<1> foo=what v v <2> foo=what | foo=what v v} test oo-27.21 {variables declaration uniqueifies: Bug 3396896} -setup { oo::class create Foo } -body { oo::define Foo variable v v v t t v t info class variable Foo } -cleanup { Foo destroy } -result {v t} test oo-27.22 {variables declaration uniqueifies: Bug 3396896} -setup { oo::object create foo } -body { oo::objdefine foo variable v v v t t v t info object variable foo } -cleanup { foo destroy } -result {v t} test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup { oo::class create Super oo::class create Parent { superclass Super variable member1 member2 constructor {} { set member1 parent1 set member2 parent2 } method getChild {} { Child new [self] } } oo::class create Child { superclass Super variable member1 result constructor {m} { set [namespace current]::member1 child1 set ns [info object namespace $m] namespace upvar $ns member1 l1 member2 l2 upvar 1 member1 l3 member2 l4 [format namespace] upvar $ns member1 l5 member2 l6 [format upvar] 1 member1 l7 member2 l8 set result [list $l1 $l2 $l3 $l4 $l5 $l6 $l7 $l8] } method result {} {return $result} } } -body { [[Parent new] getChild] result } -cleanup { Super destroy } -result {parent1 parent2 parent1 parent2 parent1 parent2 parent1 parent2} # A feature that's not supported because the mechanism may change without # warning, but is supposed to work... test oo-28.1 {scripted extensions to oo::define} -setup { interp create foo foo eval {oo::class create cls {export eval}} } -cleanup { interp delete foo } -body { foo eval { proc oo::define::privateMethod {name arguments body} { uplevel 1 [list method $name $arguments $body] uplevel 1 [list unexport $name] } oo::define cls privateMethod m {x y} {return $x,$y} cls create obj list [catch {obj m 1 2}] [obj eval my m 3 4] } } -result {1 3,4} test oo-29.1 {self class with object-defined methods} -setup { oo::object create obj } -body { oo::objdefine obj method demo {} { self class } obj demo } -returnCodes error -cleanup { obj destroy } -result {method not defined by a class} test oo-30.1 {Bug 2903011: deleting an object in a constructor} -setup { oo::class create cls } -body { oo::define cls {constructor {} {[self] destroy}} cls new } -returnCodes error -cleanup { cls destroy } -result {object deleted in constructor} test oo-30.2 {Bug 2903011: deleting an object in a constructor} -setup { oo::class create cls } -body { oo::define cls {constructor {} {my destroy}} cls new } -returnCodes error -cleanup { cls destroy } -result {object deleted in constructor} test oo-31.1 {Bug 3111059: when objects and coroutines entangle} -setup { oo::class create cls } -constraints memory -body { oo::define cls { method justyield {} { yield } constructor {} { coroutine coro my justyield } } list [leaktest {[cls new] destroy}] [info class instances cls] } -cleanup { cls destroy } -result {0 {}} test oo-31.2 {Bug 3111059: when objects and coroutines entangle} -setup { oo::class create cls } -constraints memory -body { oo::define cls { method justyield {} { yield } constructor {} { coroutine coro my justyield } destructor { rename coro {} } } list [leaktest {[cls new] destroy}] [info class instances cls] } -cleanup { cls destroy } -result {0 {}} proc SampleSlotSetup script { set script0 { oo::class create SampleSlot { superclass oo::Slot constructor {} { variable contents {a b c} ops {} } method contents {} {variable contents; return $contents} method ops {} {variable ops; return $ops} method Get {} { variable contents variable ops lappend ops [info level] Get return $contents } method Set {lst} { variable contents $lst variable ops lappend ops [info level] Set $lst return } method Resolve {lst} { variable ops lappend ops [info level] Resolve $lst return $lst } } } append script0 \n$script } proc SampleSlotCleanup script { set script0 { SampleSlot destroy } append script \n$script0 } test oo-32.1 {TIP 380: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {a b c} {}} test oo-32.2 {TIP 380: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -clear] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} {} {1 Set {}}} test oo-32.3 {TIP 380: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -append g h i] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} {a b c g h i} {1 Resolve g 1 Resolve h 1 Resolve i 1 Get 1 Set {a b c g h i}}} test oo-32.4 {TIP 380: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -set d e f] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} {d e f} {1 Resolve d 1 Resolve e 1 Resolve f 1 Set {d e f}}} test oo-32.5 {TIP 380: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -set d e f] [sampleSlot -append g h i] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} {} {d e f g h i} {1 Resolve d 1 Resolve e 1 Resolve f 1 Set {d e f} 1 Resolve g 1 Resolve h 1 Resolve i 1 Get 1 Set {d e f g h i}}} test oo-32.6 {TIP 516: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -prepend g h i] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} {g h i a b c} {1 Resolve g 1 Resolve h 1 Resolve i 1 Get 1 Set {g h i a b c}}} test oo-32.7 {TIP 516: slots - class test} -setup [SampleSlotSetup { SampleSlot create sampleSlot }] -body { list [info level] [sampleSlot -remove c a] \ [sampleSlot contents] [sampleSlot ops] } -cleanup [SampleSlotCleanup { rename sampleSlot {} }] -result {0 {} b {1 Resolve c 1 Resolve a 1 Get 1 Set b}} test oo-33.1 {TIP 380: slots - defaulting} -setup [SampleSlotSetup { set s [SampleSlot new] }] -body { list [$s x y] [$s contents] } -cleanup [SampleSlotCleanup { rename $s {} }] -result {{} {a b c x y}} test oo-33.2 {TIP 380: slots - defaulting} -setup [SampleSlotSetup { set s [SampleSlot new] }] -body { list [$s destroy; $s unknown] [$s contents] } -cleanup [SampleSlotCleanup { rename $s {} }] -result {{} {a b c destroy unknown}} test oo-33.3 {TIP 380: slots - defaulting} -setup [SampleSlotSetup { set s [SampleSlot new] }] -body { oo::objdefine $s forward --default-operation my -set list [$s destroy; $s unknown] [$s contents] [$s ops] } -cleanup [SampleSlotCleanup { rename $s {} }] -result {{} unknown {1 Resolve destroy 1 Set destroy 1 Resolve unknown 1 Set unknown}} test oo-33.4 {TIP 380: slots - errors} -setup [SampleSlotSetup { set s [SampleSlot new] }] -body { # Method names beginning with "-" are special to slots $s -grill q } -returnCodes error -cleanup [SampleSlotCleanup { rename $s {} }] -result \ {unknown method "-grill": must be -append, -appendifnew, -clear, -prepend, -remove, -set, contents or ops} test oo-33.5 {TIP 567: slots -appendifnew} -setup [SampleSlotSetup { set s [SampleSlot new] }] -body { list \ [$s -clear $s contents] \ [$s -append p q r $s contents] \ [$s -appendifnew q s r t p $s contents] } -cleanup [SampleSlotCleanup { rename $s {} }] -result {{} {p q r} {p q r s t}} test oo-34.1 {TIP 380: slots - presence} -setup { set obj [oo::object new] set result {} } -body { oo::define oo::object { ::lappend ::result [::info object class filter] ::lappend ::result [::info object class mixin] ::lappend ::result [::info object class superclass] ::lappend ::result [::info object class variable] } oo::objdefine $obj { ::lappend ::result [::info object class filter] ::lappend ::result [::info object class mixin] ::lappend ::result [::info object class variable] } return $result } -cleanup { $obj destroy } -result {::oo::Slot ::oo::Slot ::oo::Slot ::oo::Slot ::oo::Slot ::oo::Slot ::oo::Slot} test oo-34.2 {TIP 380: slots - presence} { lsort [info class instances oo::Slot] } {::oo::configuresupport::objreadableproperties ::oo::configuresupport::objwritableproperties ::oo::configuresupport::readableproperties ::oo::configuresupport::writableproperties ::oo::define::filter ::oo::define::mixin ::oo::define::superclass ::oo::define::variable ::oo::objdefine::filter ::oo::objdefine::mixin ::oo::objdefine::variable} proc getMethods obj { list [lsort [info object methods $obj -all]] \ [lsort [info object methods $obj -private]] } test oo-34.3 {TIP 380: slots - presence} { getMethods oo::define::filter } {{-append -appendifnew -clear -prepend -remove -set} {Get Set}} test oo-34.4 {TIP 380: slots - presence} { getMethods oo::define::mixin } {{-append -appendifnew -clear -prepend -remove -set} {--default-operation Get Resolve Set}} test oo-34.5 {TIP 380: slots - presence} { getMethods oo::define::superclass } {{-append -appendifnew -clear -prepend -remove -set} {--default-operation Get Resolve Set}} test oo-34.6 {TIP 380: slots - presence} { getMethods oo::define::variable } {{-append -appendifnew -clear -prepend -remove -set} {Get Set}} test oo-34.7 {TIP 380: slots - presence} { getMethods oo::objdefine::filter } {{-append -appendifnew -clear -prepend -remove -set} {Get Set}} test oo-34.8 {TIP 380: slots - presence} { getMethods oo::objdefine::mixin } {{-append -appendifnew -clear -prepend -remove -set} {--default-operation Get Resolve Set}} test oo-34.9 {TIP 380: slots - presence} { getMethods oo::objdefine::variable } {{-append -appendifnew -clear -prepend -remove -set} {Get Set}} test oo-34.10 {TIP 516: slots - resolution} -setup { oo::class create parent set result {} oo::class create 516a { superclass parent } oo::class create 516b { superclass parent } oo::class create 516c { superclass parent } namespace eval 516test { oo::class create 516a { superclass parent } oo::class create 516b { superclass parent } oo::class create 516c { superclass parent } } } -body { # Must find the right classes when making the mixin namespace eval 516test { oo::define 516a { mixin 516b 516c } } lappend result [info class mixin 516test::516a] # Must not remove class with just simple name match oo::define 516test::516a { mixin -remove 516b } lappend result [info class mixin 516test::516a] # Must remove class with resolved name match oo::define 516test::516a { mixin -remove 516test::516c } lappend result [info class mixin 516test::516a] # Must remove class with resolved name match even after renaming, but only # with the renamed name; it is a slot of classes, not strings! rename 516test::516b 516test::516d oo::define 516test::516a { mixin -remove 516test::516b } lappend result [info class mixin 516test::516a] oo::define 516test::516a { mixin -remove 516test::516d } lappend result [info class mixin 516test::516a] } -cleanup { parent destroy } -result {{::516test::516b ::516test::516c} {::516test::516b ::516test::516c} ::516test::516b ::516test::516d {}} test oo-35.1 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup { oo::class create fruit { method eat {} {} } set result {} } -body { lappend result [fruit create ::apple] [info class superclasses fruit] oo::define fruit superclass lappend result [info class superclasses fruit] \ [info object class apple oo::object] \ [info class call fruit destroy] \ [catch { apple }] } -cleanup { unset -nocomplain result fruit destroy } -result {::apple ::oo::object ::oo::object 1 {{method destroy ::oo::object {core method: "destroy"}}} 1} test oo-35.2 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup { oo::class create fruitMetaclass { superclass oo::class method eat {} {} } set result {} } -body { lappend result [fruitMetaclass create ::appleClass] \ [appleClass create orange] \ [info class superclasses fruitMetaclass] oo::define fruitMetaclass superclass lappend result [info class superclasses fruitMetaclass] \ [info object class appleClass oo::class] \ [catch { orange }] [info object class orange] \ [appleClass create pear] } -cleanup { unset -nocomplain result fruitMetaclass destroy } -result {::appleClass ::orange ::oo::class ::oo::class 1 1 ::appleClass ::pear} test oo-35.3 {Bug 593baa032c: superclass list teardown} { # Bug makes this crash, especially with mem-debugging on oo::class create B {} oo::class create D {superclass B} namespace eval [info object namespace D] [list [namespace which B] destroy] } {} test oo-35.4 {Bug 593baa032c: mixins list teardown} { # Bug makes this crash, especially with mem-debugging on oo::class create B {} oo::class create D {mixin B} namespace eval [info object namespace D] [list [namespace which B] destroy] } {} test oo-35.5 {Bug 1a56550e96: introspectors must traverse mixin links correctly} -setup { oo::class create base { unexport destroy } } -body { oo::class create C { superclass base method c {} {} } oo::class create D { superclass base mixin C method d {} {} } oo::class create E { superclass D method e {} {} } E create e1 list [lsort [info class methods E -all]] [lsort [info object methods e1 -all]] } -cleanup { base destroy } -result {{c d e} {c d e}} test oo-35.6 { Bug : teardown of an object that is a class that is an instance of itself } -setup { oo::class create obj oo::copy obj obj1 obj1 oo::objdefine obj1 { mixin obj1 obj } oo::copy obj1 obj2 oo::objdefine obj2 { mixin obj2 obj1 } } -body { rename obj2 {} rename obj1 {} # doesn't crash return done } -cleanup { rename obj {} } -result done test oo-35.7.1 {Bug 7842f33a5c: destructor cascading in stereotypes} -setup { oo::class create base oo::class create RpcClient { superclass base method write name { lappend ::result "RpcClient -> $name" } method create_bug {} { MkObjectRpc create cfg [self] 111 } } oo::class create MkObjectRpc { superclass base variable hdl constructor {rpcHdl mqHdl} { set hdl $mqHdl oo::objdefine [self] forward rpc $rpcHdl } destructor { my rpc write otto-$hdl } } set ::result {} } -body { # In this case, sub-objects are deleted during major object NS cleanup and # are trying to call back into the major object (which is mostky gone at # this point). Things are messy; error is reported via bgerror as the # avenue most likely to reach a user. bgerrorIntercept ::result { set FH [RpcClient new] $FH create_bug $FH destroy update } join $result \n } -cleanup { base destroy } -result {impossible to invoke method "write": no defined method or unknown method} test oo-35.7.2 {Bug 7842f33a5c: destructor cascading in stereotypes} -setup { oo::class create base oo::class create RpcClient { superclass base method write name { lappend ::result "RpcClient -> $name" } method create_bug {} { MkObjectRpc create cfg [self] 111 } destructor { lappend ::result "Destroyed" } } oo::class create MkObjectRpc { superclass base variable hdl constructor {rpcHdl mqHdl} { set hdl $mqHdl oo::objdefine [self] forward rpc $rpcHdl } destructor { my rpc write otto-$hdl } } set ::result {} } -body { # In this case, sub-objects are deleted during major object NS cleanup, and # we've a destructor on the major class to monitor when it happens. Things # are still messy, but the order is clear; error is reported via bgerror as # the avenue most likely to reach a user. bgerrorIntercept ::result { set FH [RpcClient new] $FH create_bug $FH destroy update } join $result \n } -cleanup { base destroy } -result {Destroyed impossible to invoke method "write": no defined method or unknown method} test oo-35.7.3 {Bug 7842f33a5c: destructor cascading in stereotypes} -setup { oo::class create base oo::class create RpcClient { superclass base variable interiorObjects method write name { lappend ::result "RpcClient -> $name" } method create_bug {} { set obj [MkObjectRpc create cfg [self] 111] lappend interiorObjects $obj return $obj } destructor { lappend ::result "Destroyed" # Explicit destroy of interior objects foreach obj $interiorObjects { $obj destroy } } } oo::class create MkObjectRpc { superclass base variable hdl constructor {rpcHdl mqHdl} { set hdl $mqHdl oo::objdefine [self] forward rpc $rpcHdl } destructor { my rpc write otto-$hdl } } set ::result {} } -body { # In this case, sub-objects are deleted while the destructor is running and # the destroy is neat, so things work sanely. Error follows standard Tcl # error flow route; bgerror is not used. bgerrorIntercept ::result { set FH [RpcClient new] $FH create_bug $FH destroy update } join $result \n } -cleanup { base destroy } -result "Destroyed\nRpcClient -> otto-111" test oo-36.1 {TIP #470: introspection within oo::define} { oo::define oo::object self } ::oo::object test oo-36.2 {TIP #470: introspection within oo::define} -setup { oo::class create Cls } -body { oo::define Cls self } -cleanup { Cls destroy } -result ::Cls test oo-36.3 {TIP #470: introspection within oo::define} -setup { oo::class create Super set result uncalled } -body { oo::class create Sub { superclass Super ::set ::result [self] } return $result } -cleanup { Super destroy } -result ::Sub test oo-36.4 {TIP #470: introspection within oo::define} -setup { oo::class create Super set result uncalled } -body { oo::class create Sub { superclass Super ::set ::result [self {}] } return $result } -cleanup { Super destroy } -result {} test oo-36.5 {TIP #470: introspection within oo::define} -setup { oo::class create Super set result uncalled } -body { oo::class create Sub { superclass Super ::set ::result [self self] } } -cleanup { Super destroy } -result ::Sub test oo-36.6 {TIP #470: introspection within oo::objdefine} -setup { oo::class create Cls set result uncalled } -body { Cls create obj oo::objdefine obj { ::set ::result [self] } } -cleanup { Cls destroy } -result ::obj test oo-36.7 {TIP #470: introspection within oo::objdefine} -setup { oo::class create Cls } -body { Cls create obj oo::objdefine obj { self } } -cleanup { Cls destroy } -result ::obj test oo-36.8 {TIP #470: introspection within oo::objdefine} -setup { oo::class create Cls } -body { Cls create obj oo::objdefine obj { self anything } } -returnCodes error -cleanup { Cls destroy } -result {wrong # args: should be "self"} test oo-36.9 {TIP #470: introspection within oo::define} -setup { oo::class create Cls set result uncalled } -body { proc oo::define::testself {} { global result set result [list [catch {self} msg] $msg \ [catch {uplevel 1 self} msg] $msg] return } list [oo::define Cls testself] $result } -cleanup { Cls destroy catch {rename oo::define::testself {}} } -result {{} {1 {this command may only be called from within the context of an ::oo::define or ::oo::objdefine command} 0 ::Cls}} test oo-36.10 {TIP #470: introspection within oo::define} -setup { oo::class create Cls set result uncalled } -body { proc oo::objdefine::testself {} { global result set result [list [catch {self} msg] $msg \ [catch {uplevel 1 self} msg] $msg] return } Cls create obj list [oo::objdefine obj testself] $result } -cleanup { Cls destroy catch {rename oo::objdefine::testself {}} } -result {{} {1 {this command may only be called from within the context of an ::oo::define or ::oo::objdefine command} 0 ::obj}} test oo-37.1 {TIP 500: private command propagates errors} -setup { oo::class create cls } -body { oo::define cls { private ::error "this is an error" } } -cleanup { cls destroy } -returnCodes error -result {this is an error} test oo-37.2 {TIP 500: private command propagates errors} -setup { oo::class create cls } -body { oo::define cls { private { ::error "this is an error" } } } -cleanup { cls destroy } -returnCodes error -result {this is an error} test oo-37.3 {TIP 500: private command propagates errors} -setup { oo::object create obj } -body { oo::objdefine obj { private ::error "this is an error" } } -cleanup { obj destroy } -returnCodes error -result {this is an error} test oo-37.4 {TIP 500: private command propagates errors} -setup { oo::object create obj } -body { oo::objdefine obj { private { ::error "this is an error" } } } -cleanup { obj destroy } -returnCodes error -result {this is an error} test oo-37.5 {TIP 500: private command can't be used outside definitions} -body { oo::define::private error "xyz" } -returnCodes error -result {this command may only be called from within the context of an ::oo::define or ::oo::objdefine command} test oo-37.6 {TIP 500: private command can't be used outside definitions} -body { oo::objdefine::private error "xyz" } -returnCodes error -result {this command may only be called from within the context of an ::oo::define or ::oo::objdefine command} test oo-38.1 {TIP 500: private variables don't cross-interfere with each other or normal ones} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent private variable x constructor {} { set x 1 } method getA {} { return $x } } oo::class create clsB { superclass clsA private { variable x } constructor {} { set x 2 next } method getB {} { return $x } } oo::class create clsC { superclass clsB variable x constructor {} { set x 3 next } method getC {} { return $x } } clsC create obj oo::objdefine obj { private { variable x } method setup {} { set x 4 } method getO {} { return $x } } obj setup list [obj getA] [obj getB] [obj getC] [obj getO] \ [lsort [string map [list [info object creationid clsA] CLASS-A \ [info object creationid clsB] CLASS-B \ [info object creationid obj] OBJ] \ [info object vars obj]]] } -cleanup { parent destroy } -result {1 2 3 4 {{CLASS-A : x} {CLASS-B : x} {OBJ : x} x}} test oo-38.2 {TIP 500: private variables introspection} -setup { oo::class create parent } -body { oo::class create cls { superclass parent private { variable x1 variable x2 } variable y1 y2 } cls create obj oo::objdefine obj { private variable a1 a2 variable b1 b2 } list [lsort [info class variables cls]] \ [lsort [info class variables cls -private]] \ [lsort [info object variables obj]] \ [lsort [info object variables obj -private]] } -cleanup { parent destroy } -result {{y1 y2} {x1 x2} {b1 b2} {a1 a2}} test oo-38.3 {TIP 500: private variables and oo::object·varname} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent private { variable x } method getx {} { set x 1 my varname x } method readx {} { return $x } } oo::class create clsB { superclass clsA variable x method gety {} { set x 1 my varname x } method ready {} { return $x } } clsB create obj set [obj getx] 2 set [obj gety] 3 list [obj readx] [obj ready] } -cleanup { parent destroy } -result {2 3} test oo-38.4 {TIP 500: private variables introspection} -setup { oo::class create parent } -body { oo::class create cls { superclass parent private { variable x1 x2 } variable y1 y2 constructor {} { variable z boo set x1 a set y1 c } method list {} { variable z set ok 1 list [info locals] [lsort [info vars]] [info exist x2] } } cls create obj oo::objdefine obj { private variable a1 a2 variable b1 b2 method init {} { # Because we don't have a constructor to do this setup for us set a1 p set b1 r } method list {} { variable z set yes 1 list {*}[next] [info locals] [lsort [info vars]] [info exist a2] } } obj init obj list } -cleanup { parent destroy } -result {ok {ok x1 x2 y1 y2 z} 0 yes {a1 a2 b1 b2 yes z} 0} test oo-38.5 {TIP 500: private variables and oo::object·variable} -setup { oo::class create parent } -body { oo::class create cls1 { superclass parent private variable x method abc val { my variable x set x $val } method def val { my variable y set y $val } method get1 {} { my variable x y return [list $x $y] } } oo::class create cls2 { superclass cls1 private variable x method x-exists {} { return [info exists x],[uplevel 1 {info exists x}] } method ghi x { # Additional instrumentation to show that we're not using the # resolved variable until we ask for it; the argument nixed that # happening by default. set val $x set before [my x-exists] unset x set x $val set mid [my x-exists] unset x set mid2 [my x-exists] my variable x set x $val set after [my x-exists] return "$before;$mid;$mid2;$after" } method jkl val { my variable y set y $val } method get2 {} { my variable x y return [list $x $y] } } cls2 create a a abc 123 a def 234 set tmp [a ghi 345] a jkl 456 list $tmp [a get1] [a get2] } -cleanup { parent destroy } -result {{0,1;0,1;0,0;1,1} {123 456} {345 456}} test oo-39.1 {TIP 500: private methods internal call; class private} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent variable x constructor {} { set x 1 } method act {} { my step my step my step return } private { method step {} { incr x 2 } } method x {} { return $x } } clsA create obj obj act list [obj x] [catch {obj step} msg] $msg } -cleanup { parent destroy } -result {7 1 {unknown method "step": must be act, destroy or x}} test oo-39.2 {TIP 500: private methods internal call; class private} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent variable x constructor {} { set x 1 } method act {} { my step my step my step return } private { method step {} { incr x 2 } } method x {} { return $x } } oo::class create clsB { superclass clsA variable x method step {} { incr x 5 } } clsB create obj obj act list [obj x] [obj step] } -cleanup { parent destroy } -result {7 12} test oo-39.3 {TIP 500: private methods internal call; class private} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent variable x constructor {} { set x 1 } method act {} { my Step my Step my Step return } method x {} { return $x } } oo::class create clsB { superclass clsA variable x method Step {} { incr x 5 } } clsB create obj obj act set result [obj x] oo::define clsA { private { method Step {} { incr x 2 } } } obj act lappend result [obj x] } -cleanup { parent destroy } -result {16 22} test oo-39.4 {TIP 500: private methods internal call; instance private} -setup { oo::class create parent } -body { oo::class create clsA { superclass parent variable x constructor {} { set x 1 } method act {} { my step return } method step {} { incr x } method x {} { return $x } } clsA create obj obj act set result [obj x] oo::objdefine obj { variable x private { method step {} { incr x 2 } } } obj act lappend result [obj x] oo::objdefine obj { method act {} { my step next } } obj act lappend result [obj x] } -cleanup { parent destroy } -result {2 3 6} test oo-39.5 {TIP 500: private methods internal call; cross object} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } method equal {other} { expr {$x == [$other x]} } } cls create a 1 cls create b 2 cls create c 1 list [a equal b] [b equal c] [c equal a] [catch {a x} msg] $msg } -cleanup { parent destroy } -result {0 0 1 1 {unknown method "x": must be destroy or equal}} test oo-39.6 {TIP 500: private methods internal call; error reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } method equal {other} { expr {$x == [$other y]} } } cls create a 1 cls create b 2 a equal b } -returnCodes error -cleanup { parent destroy } -result {unknown method "y": must be destroy, equal or x} test oo-39.7 {TIP 500: private methods internal call; error reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } method equal {other} { expr {[[self] y] == [$other x]} } } cls create a 1 cls create b 2 a equal b } -returnCodes error -cleanup { parent destroy } -result {unknown method "y": must be destroy, equal or x} test oo-39.8 {TIP 500: private methods internal call; error reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } method equal {other} { expr {[my y] == [$other x]} } } cls create a 1 cls create b 2 a equal b } -returnCodes error -cleanup { parent destroy } -result {unknown method "y": must be , destroy, equal, eval, unknown, variable, varname or x} test oo-39.9 {TIP 500: private methods internal call; error reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } } oo::class create cls2 { superclass cls method equal {other} { expr {[my y] == [$other x]} } } cls2 create a 1 cls2 create b 2 a equal b } -returnCodes error -cleanup { parent destroy } -result {unknown method "y": must be , destroy, equal, eval, unknown, variable or varname} test oo-39.10 {TIP 500: private methods internal call; error reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent variable x constructor {val} { set x $val } private method x {} { return $x } } oo::class create cls2 { superclass cls method equal {other} { expr {[my x] == [$other x]} } } cls2 create a 1 cls2 create b 2 a equal b } -returnCodes error -cleanup { parent destroy } -result {unknown method "x": must be , destroy, equal, eval, unknown, variable or varname} test oo-39.11 {TIP 500: private methods; call chain caching and reporting} -setup { oo::class create parent } -body { oo::class create cls { superclass parent method chain {} { return [self call] } } oo::class create cls2 { superclass cls private method chain {} { next } method chain2 {} { my chain } method chain3 {} { [self] chain } } cls create a cls2 create b list [a chain] [b chain] [b chain2] [b chain3] } -cleanup { parent destroy } -result {{{{method chain ::cls method}} 0} {{{method chain ::cls method}} 0} {{{private chain ::cls2 method} {method chain ::cls method}} 1} {{{private chain ::cls2 method} {method chain ::cls method}} 1}} test oo-39.12 {TIP 500: private methods; introspection} -setup { oo::class create parent } -body { oo::class create cls { superclass parent method chain {} { return [self call] } private method abc {} {} } oo::class create cls2 { superclass cls method chain2 {} { my chain } method chain3 {} { [self] chain } private method def {} {} unexport chain3 } cls create a cls2 create b oo::objdefine b { private method ghi {} {} method ABC {} {} method foo {} {} } set scopes {public unexported private} list a: [lmap s $scopes {info object methods a -scope $s}] \ b: [lmap s $scopes {info object methods b -scope $s}] \ cls: [lmap s $scopes {info class methods cls -scope $s}] \ cls2: [lmap s $scopes {info class methods cls2 -scope $s}] \ } -cleanup { parent destroy } -result {a: {{} {} {}} b: {foo ABC ghi} cls: {chain {} abc} cls2: {chain2 chain3 def}} test oo-40.1 {TIP 500: private and self} -setup { oo::class create cls } -body { oo::define cls { self { private { variable a } variable b } private { self { variable c } variable d } variable e } list \ [lsort [info class variables cls]] \ [lsort [info class variables cls -private]] \ [lsort [info object variables cls]] \ [lsort [info object variables cls -private]] } -cleanup { cls destroy } -result {e d b {a c}} test oo-40.2 {TIP 500: private and export} -setup { oo::class create cls } -body { oo::define cls { private method foo {} {} } set result [lmap s {public unexported private} { info class methods cls -scope $s}] oo::define cls { export foo } lappend result {*}[lmap s {public unexported private} { info class methods cls -scope $s}] } -cleanup { cls destroy } -result {{} {} foo foo {} {}} test oo-40.3 {TIP 500: private and unexport} -setup { oo::class create cls } -body { oo::define cls { private method foo {} {} } set result [lmap s {public unexported private} { info class methods cls -scope $s}] oo::define cls { unexport foo } lappend result {*}[lmap s {public unexported private} { info class methods cls -scope $s}] } -cleanup { cls destroy } -result {{} {} foo {} foo {}} test oo-41.1 {TIP 478: myclass command, including class morphing} -setup { oo::class create parent set result {} } -body { oo::class create cls1 { superclass parent self method count {} { my variable c incr c } method act {} { myclass count } } cls1 create x lappend result [x act] [x act] cls1 create y lappend result [y act] [y act] [x act] oo::class create cls2 { superclass cls1 self method count {} { my variable d expr {1.0 * [incr d]} } } oo::objdefine x {class cls2} lappend result [x act] [y act] [x act] [y act] } -cleanup { parent destroy } -result {1 2 3 4 5 1.0 6 2.0 7} test oo-41.2 {TIP 478: myclass command cleanup} -setup { oo::class create parent set result {} } -body { oo::class create cls1 { superclass parent self method hi {} { return "this is [self]" } method hi {} { return "this is [self]" } } cls1 create x rename [info object namespace x]::my foo rename [info object namespace x]::myclass bar lappend result [cls1 hi] [x hi] [foo hi] [bar hi] x destroy lappend result [catch {foo hi}] [catch {bar hi}] } -cleanup { parent destroy } -result {{this is ::cls1} {this is ::x} {this is ::x} {this is ::cls1} 1 1} test oo-41.3 {TIP 478: myclass command calls unexported methods, via forward} -setup { oo::class create parent set result {} } -body { oo::class create cls1 { superclass parent self method Hi {} { return "this is [self]" } forward poke myclass Hi } cls1 create x lappend result [catch {cls1 Hi}] [x poke] } -cleanup { parent destroy } -result {1 {this is ::cls1}} test oo-42.1 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::object } {} test oo-42.2 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::object -class } {} test oo-42.3 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::object -instance } ::oo::objdefine test oo-42.4 {TIP 524: definition namespace control: introspection} -body { info class definitionnamespace oo::object -gorp } -returnCodes error -result {bad kind "-gorp": must be -class or -instance} test oo-42.5 {TIP 524: definition namespace control: introspection} -body { info class definitionnamespace oo::object -class x } -returnCodes error -result {wrong # args: should be "info class definitionnamespace className ?kind?"} test oo-42.6 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::class } ::oo::define test oo-42.7 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::class -class } ::oo::define test oo-42.8 {TIP 524: definition namespace control: introspection} { info class definitionnamespace oo::class -instance } {} test oo-43.1 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef { proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace foodef } oo::class create foo { superclass parent self class foocls } oo::define foo { sparkle } } -cleanup { parent destroy namespace delete foodef } -result ok test oo-43.2 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} unset -nocomplain ::result } -body { namespace eval foodef { namespace path ::oo::define proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace foodef } foocls create foo { superclass parent lappend ::result [sparkle] } return $result } -cleanup { parent destroy namespace delete foodef } -result ok test oo-43.3 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} unset -nocomplain ::result } -body { namespace eval foodef { namespace path ::oo::define proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace -class foodef } foocls create foo { superclass parent lappend ::result [sparkle] } return $result } -cleanup { parent destroy namespace delete foodef } -result ok test oo-43.4 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef { namespace path ::oo::objdefine proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace -instance foodef } foocls create foo { sparkle } } -returnCodes error -cleanup { parent destroy namespace delete foodef } -result {invalid command name "sparkle"} test oo-43.5 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef { namespace path ::oo::objdefine proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace foodef } namespace delete foodef foocls create foo { sparkle } } -returnCodes error -cleanup { parent destroy catch {namespace delete foodef} } -result {invalid command name "sparkle"} test oo-43.6 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} unset -nocomplain result } -body { namespace eval foodef { namespace path ::oo::objdefine proc sparkle {} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace foodef } foocls create foo lappend result [catch {oo::define foo sparkle} msg] $msg namespace delete foodef lappend result [catch {oo::define foo sparkle} msg] $msg namespace eval foodef { namespace path ::oo::objdefine proc sparkle {} {return ok} } lappend result [catch {oo::define foo sparkle} msg] $msg } -cleanup { parent destroy catch {namespace delete foodef} } -result {0 ok 1 {invalid command name "sparkle"} 0 ok} test oo-43.7 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef { namespace path ::oo::define proc sparkle {x} {return ok} } oo::class create foocls { superclass oo::class parent definitionnamespace foodef } foocls create foo { superclass parent } oo::define foo spar gorp } -cleanup { parent destroy namespace delete foodef } -result ok test oo-43.8 {TIP 524: definition namespace control: semantics} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef { namespace path ::oo::objdefine proc sparkle {} {return ok} } oo::class create foo { superclass parent definitionnamespace -instance foodef } oo::objdefine [foo new] { method x y z sparkle } } -cleanup { parent destroy namespace delete foodef } -result ok test oo-43.9 {TIP 524: definition namespace control: syntax} -body { oo::class create foo { definitionnamespace -gorp foodef } } -returnCodes error -result {bad kind "-gorp": must be -class or -instance} test oo-43.10 {TIP 524: definition namespace control: syntax} -body { oo::class create foo { definitionnamespace -class foodef x } } -returnCodes error -result {wrong # args: should be "definitionnamespace ?kind? namespace"} test oo-43.11 {TIP 524: definition namespace control: syntax} -setup { catch {namespace delete ::no_such_ns} } -body { oo::class create foo { definitionnamespace -class ::no_such_ns } } -returnCodes error -result {namespace "::no_such_ns" not found} test oo-43.12 {TIP 524: definition namespace control: user-level introspection} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef {} oo::class create foo { superclass oo::class parent } list [info class definitionnamespace foo] \ [oo::define foo definitionnamespace foodef] \ [info class definitionnamespace foo] \ [oo::define foo definitionnamespace {}] \ [info class definitionnamespace foo] } -cleanup { parent destroy namespace delete foodef } -result {{} {} ::foodef {} {}} test oo-43.13 {TIP 524: definition namespace control: user-level introspection} -setup { oo::class create parent namespace eval foodef {} } -body { namespace eval foodef {} oo::class create foo { superclass parent } list [info class definitionnamespace foo -instance] \ [oo::define foo definitionnamespace -instance foodef] \ [info class definitionnamespace foo -instance] \ [oo::define foo definitionnamespace -instance {}] \ [info class definitionnamespace foo -instance] } -cleanup { parent destroy namespace delete foodef } -result {{} {} ::foodef {} {}} rename bgerrorIntercept {} cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/obj.test0000644000175000017500000005401715104661341014373 0ustar sergeisergei# Functionality covered: this file contains a collection of tests for the # procedures in tclObj.c that implement Tcl's basic type support and the # type managers for the types boolean, double, and integer. # # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testobj [llength [info commands testobj]] testConstraint wideIs64bit [expr {wide(0x8000000000000000) < 0}] test obj-1.1 {Tcl_AppendAllObjTypes, and InitTypeTable, Tcl_RegisterObjType} testobj { set r 1 foreach {t} { bytecode cmdName dict regexp string } { set first [string first $t [testobj types]] set r [expr {$r && ($first >= 0)}] } set result $r } {1} test obj-2.1 {Tcl_GetObjType error} testobj { list [testintobj set 1 0] [catch {testobj convert 1 foo} msg] $msg } {0 1 {no type foo found}} test obj-2.2 {Tcl_GetObjType and Tcl_ConvertToType} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 12] lappend result [testobj convert 1 string] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 12 12 string 3} test obj-4.1 {Tcl_NewObj and AllocateFreeObjects} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} string 2} test obj-5.1 {Tcl_FreeObj} testobj { set result "" lappend result [testintobj set 1 12345] lappend result [testobj freeallvars] lappend result [catch {testintobj get 1} msg] lappend result $msg } {12345 {} 1 {variable 1 is unset (NULL)}} test obj-6.1 {Tcl_DuplicateObj, object has internal rep} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 47] lappend result [testobj duplicate 1 2] lappend result [testintobj get 2] lappend result [testobj refcount 1] lappend result [testobj refcount 2] } {{} 47 47 47 2 3} test obj-6.2 {Tcl_DuplicateObj, "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testobj duplicate 1 2] lappend result [testintobj get 2] lappend result [testobj refcount 1] lappend result [testobj refcount 2] } {{} {} {} {} 2 3} # We assume that testobj is an indicator for test*obj as well test obj-7.1 {Tcl_GetString, return existing string rep} testobj { set result "" lappend result [testintobj set 1 47] lappend result [testintobj get2 1] } {47 47} test obj-7.2 {Tcl_GetString, "empty string" object} testobj { set result "" lappend result [testobj newobj 1] lappend result [teststringobj append 1 abc -1] lappend result [teststringobj get2 1] } {{} abc abc} test obj-7.3 {Tcl_GetString, returns string internal rep (DString)} testobj { set result "" lappend result [teststringobj set 1 xyz] lappend result [teststringobj append 1 abc -1] lappend result [teststringobj get2 1] } {xyz xyzabc xyzabc} test obj-7.4 {Tcl_GetString, recompute string rep from internal rep} testobj { set result "" lappend result [testintobj set 1 77] lappend result [testintobj mult10 1] lappend result [teststringobj get2 1] } {77 770 770} test obj-8.1 {Tcl_GetStringFromObj, return existing string rep} testobj { set result "" lappend result [testintobj set 1 47] lappend result [testintobj get 1] } {47 47} test obj-8.2 {Tcl_GetStringFromObj, "empty string" object} testobj { set result "" lappend result [testobj newobj 1] lappend result [teststringobj append 1 abc -1] lappend result [teststringobj get 1] } {{} abc abc} test obj-8.3 {Tcl_GetStringFromObj, returns string internal rep (DString)} testobj { set result "" lappend result [teststringobj set 1 xyz] lappend result [teststringobj append 1 abc -1] lappend result [teststringobj get 1] } {xyz xyzabc xyzabc} test obj-8.4 {Tcl_GetStringFromObj, recompute string rep from internal rep} testobj { set result "" lappend result [testintobj set 1 77] lappend result [testintobj mult10 1] lappend result [teststringobj get 1] } {77 770 770} test obj-9.1 {Tcl_NewBooleanObj} testobj { set result "" lappend result [testobj freeallvars] lappend result [testbooleanobj set 1 0] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 0 int 2} test obj-10.1 {Tcl_SetBooleanObj, existing "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testbooleanobj set 1 0] ;# makes existing obj boolean lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} 0 int 2} test obj-10.2 {Tcl_SetBooleanObj, existing non-"empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 98765] lappend result [testbooleanobj set 1 1] ;# makes existing obj boolean lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 98765 1 int 2} test obj-11.1 {Tcl_GetBooleanFromObj, existing boolean object} testobj { set result "" lappend result [testbooleanobj set 1 1] lappend result [testbooleanobj not 1] ;# gets existing boolean rep } {1 0} test obj-11.2 {Tcl_GetBooleanFromObj, convert to boolean} testobj { set result "" lappend result [testintobj set 1 47] lappend result [testbooleanobj not 1] ;# must convert to bool lappend result [testobj type 1] } {47 0 int} test obj-11.3 {Tcl_GetBooleanFromObj, error converting to boolean} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } {abc 1 {expected boolean value but got "abc"}} test obj-11.4 {Tcl_GetBooleanFromObj, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } {{} 1 {expected boolean value but got ""}} test obj-11.5 {Tcl_GetBooleanFromObj, convert hex to boolean} testobj { set result "" lappend result [teststringobj set 1 0xac] lappend result [testbooleanobj not 1] lappend result [testobj type 1] } {0xac 0 int} test obj-11.6 {Tcl_GetBooleanFromObj, convert float to boolean} testobj { set result "" lappend result [teststringobj set 1 5.42] lappend result [testbooleanobj not 1] lappend result [testobj type 1] } {5.42 0 int} test obj-12.1 {DupBooleanInternalRep} testobj { set result "" lappend result [testbooleanobj set 1 1] lappend result [testobj duplicate 1 2] ;# uses DupBooleanInternalRep lappend result [testbooleanobj get 2] } {1 1 1} test obj-13.1 {SetBooleanFromAny, int to boolean special case} testobj { set result "" lappend result [testintobj set 1 1234] lappend result [testbooleanobj not 1] ;# converts with SetBooleanFromAny lappend result [testobj type 1] } {1234 0 int} test obj-13.2 {SetBooleanFromAny, double to boolean special case} testobj { set result "" lappend result [testdoubleobj set 1 3.14159] lappend result [testbooleanobj not 1] ;# converts with SetBooleanFromAny lappend result [testobj type 1] } {3.14159 0 int} test obj-13.3 {SetBooleanFromAny, special case strings representing booleans} testobj { set result "" foreach s {yes no true false on off} { teststringobj set 1 $s lappend result [testbooleanobj not 1] } lappend result [testobj type 1] } {0 1 0 1 0 1 int} test obj-13.4 {SetBooleanFromAny, recompute string rep then parse it} testobj { set result "" lappend result [testintobj set 1 456] lappend result [testintobj div10 1] lappend result [testbooleanobj not 1] ;# converts with SetBooleanFromAny lappend result [testobj type 1] } {456 45 0 int} test obj-13.5 {SetBooleanFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } {abc 1 {expected boolean value but got "abc"}} test obj-13.6 {SetBooleanFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 x1.0] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } {x1.0 1 {expected boolean value but got "x1.0"}} test obj-13.7 {SetBooleanFromAny, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } {{} 1 {expected boolean value but got ""}} test obj-13.8 {SetBooleanFromAny, unicode strings} testobj { set result "" lappend result [teststringobj set 1 1睷] lappend result [catch {testbooleanobj not 1} msg] lappend result $msg } "1睷 1 {expected boolean value but got \"1睷\"}" test obj-14.1 {UpdateStringOfBoolean} testobj { set result "" lappend result [testbooleanobj set 1 0] lappend result [testbooleanobj not 1] lappend result [testbooleanobj get 1] ;# must update string rep } {0 1 1} test obj-15.1 {Tcl_NewDoubleObj} testobj { set result "" lappend result [testobj freeallvars] lappend result [testdoubleobj set 1 3.1459] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 3.1459 double 2} test obj-16.1 {Tcl_SetDoubleObj, existing "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testdoubleobj set 1 0.123] ;# makes existing obj boolean lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} 0.123 double 2} test obj-16.2 {Tcl_SetDoubleObj, existing non-"empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 98765] lappend result [testdoubleobj set 1 27.56] ;# makes existing obj double lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 98765 27.56 double 2} test obj-17.1 {Tcl_GetDoubleFromObj, existing double object} testobj { set result "" lappend result [testdoubleobj set 1 16.1] lappend result [testdoubleobj mult10 1] ;# gets existing double rep } {16.1 161.0} test obj-17.2 {Tcl_GetDoubleFromObj, convert to double} testobj { set result "" lappend result [testintobj set 1 477] lappend result [testdoubleobj div10 1] ;# must convert to bool lappend result [testobj type 1] } {477 47.7 double} test obj-17.3 {Tcl_GetDoubleFromObj, error converting to double} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testdoubleobj mult10 1} msg] lappend result $msg } {abc 1 {expected floating-point number but got "abc"}} test obj-17.4 {Tcl_GetDoubleFromObj, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testdoubleobj div10 1} msg] lappend result $msg } {{} 1 {expected floating-point number but got ""}} test obj-18.1 {DupDoubleInternalRep} testobj { set result "" lappend result [testdoubleobj set 1 17.1] lappend result [testobj duplicate 1 2] ;# uses DupDoubleInternalRep lappend result [testdoubleobj get 2] } {17.1 17.1 17.1} test obj-19.1 {SetDoubleFromAny, int to double special case} testobj { set result "" lappend result [testintobj set 1 1234] lappend result [testdoubleobj mult10 1] ;# converts with SetDoubleFromAny lappend result [testobj type 1] } {1234 12340.0 double} test obj-19.2 {SetDoubleFromAny, boolean to double special case} testobj { set result "" lappend result [testbooleanobj set 1 1] lappend result [testdoubleobj mult10 1] ;# converts with SetDoubleFromAny lappend result [testobj type 1] } {1 10.0 double} test obj-19.3 {SetDoubleFromAny, recompute string rep then parse it} testobj { set result "" lappend result [testintobj set 1 456] lappend result [testintobj div10 1] lappend result [testdoubleobj mult10 1] ;# converts with SetDoubleFromAny lappend result [testobj type 1] } {456 45 450.0 double} test obj-19.4 {SetDoubleFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testdoubleobj mult10 1} msg] lappend result $msg } {abc 1 {expected floating-point number but got "abc"}} test obj-19.5 {SetDoubleFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 x1.0] lappend result [catch {testdoubleobj mult10 1} msg] lappend result $msg } {x1.0 1 {expected floating-point number but got "x1.0"}} test obj-19.6 {SetDoubleFromAny, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testdoubleobj div10 1} msg] lappend result $msg } {{} 1 {expected floating-point number but got ""}} test obj-20.1 {UpdateStringOfDouble} testobj { set result "" lappend result [testdoubleobj set 1 3.14159] lappend result [testdoubleobj mult10 1] lappend result [testdoubleobj get 1] ;# must update string rep } {3.14159 31.4159 31.4159} test obj-21.1 {Tcl_NewIntObj} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 55] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 55 int 2} test obj-22.1 {Tcl_SetIntObj, existing "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testintobj set 1 77] ;# makes existing obj int lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} 77 int 2} test obj-22.2 {Tcl_SetIntObj, existing non-"empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testdoubleobj set 1 12.34] lappend result [testintobj set 1 77] ;# makes existing obj int lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 12.34 77 int 2} test obj-23.1 {Tcl_GetIntFromObj, existing int object} testobj { set result "" lappend result [testintobj set 1 22] lappend result [testintobj mult10 1] ;# gets existing int rep } {22 220} test obj-23.2 {Tcl_GetIntFromObj, convert to int} testobj { set result "" lappend result [testintobj set 1 477] lappend result [testintobj div10 1] ;# must convert to bool lappend result [testobj type 1] } {477 47 int} test obj-23.3 {Tcl_GetIntFromObj, error converting to int} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testintobj mult10 1} msg] lappend result $msg } {abc 1 {expected integer but got "abc"}} test obj-23.4 {Tcl_GetIntFromObj, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testintobj div10 1} msg] lappend result $msg } {{} 1 {expected integer but got ""}} test obj-23.5 {Tcl_GetIntFromObj, integer too large to represent as non-long error} {testobj} { set result "" lappend result [testobj newobj 1] lappend result [testintobj inttoobigtest 1] } {{} 1} test obj-24.1 {DupIntInternalRep} testobj { set result "" lappend result [testintobj set 1 23] lappend result [testobj duplicate 1 2] ;# uses DupIntInternalRep lappend result [testintobj get 2] } {23 23 23} test obj-25.1 {SetIntFromAny, int to int special case} testobj { set result "" lappend result [testintobj set 1 1234] lappend result [testintobj mult10 1] ;# converts with SetIntFromAny lappend result [testobj type 1] } {1234 12340 int} test obj-25.2 {SetIntFromAny, boolean to int special case} testobj { set result "" lappend result [testbooleanobj set 1 1] lappend result [testintobj mult10 1] ;# converts with SetIntFromAny lappend result [testobj type 1] } {1 10 int} test obj-25.3 {SetIntFromAny, recompute string rep then parse it} testobj { set result "" lappend result [testintobj set 1 456] lappend result [testintobj div10 1] lappend result [testintobj mult10 1] ;# converts with SetIntFromAny lappend result [testobj type 1] } {456 45 450 int} test obj-25.4 {SetIntFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testintobj mult10 1} msg] lappend result $msg } {abc 1 {expected integer but got "abc"}} test obj-25.5 {SetIntFromAny, error parsing string} testobj { set result "" lappend result [teststringobj set 1 x17] lappend result [catch {testintobj mult10 1} msg] lappend result $msg } {x17 1 {expected integer but got "x17"}} test obj-25.6 {SetIntFromAny, integer too large} {testobj} { set result "" lappend result [teststringobj set 1 123456789012345678901] lappend result [catch {testintobj mult10 1} msg] lappend result $msg } {123456789012345678901 1 {integer value too large to represent}} test obj-25.7 {SetIntFromAny, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testintobj div10 1} msg] lappend result $msg } {{} 1 {expected integer but got ""}} test obj-26.1 {UpdateStringOfInt} testobj { set result "" lappend result [testintobj set 1 512] lappend result [testintobj mult10 1] lappend result [testintobj get 1] ;# must update string rep } {512 5120 5120} test obj-27.1 {Tcl_NewWideObj} testobj { set result "" lappend result [testobj freeallvars] testintobj setmax 1 lappend result [testintobj ismax 1] lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 1 int 1} test obj-28.1 {Tcl_SetLongObj, existing "empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testobj newobj 1] lappend result [testintobj setint 1 77] ;# makes existing obj int lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} {} 77 int 2} test obj-28.2 {Tcl_SetLongObj, existing non-"empty string" object} testobj { set result "" lappend result [testobj freeallvars] lappend result [testdoubleobj set 1 12.34] lappend result [testintobj setint 1 77] ;# makes existing obj int lappend result [testobj type 1] lappend result [testobj refcount 1] } {{} 12.34 77 int 2} test obj-29.1 {Tcl_GetWideIntFromObj, existing int object} testobj { set result "" lappend result [testintobj setint 1 22] lappend result [testintobj mult10 1] ;# gets existingint rep } {22 220} test obj-29.2 {Tcl_GetWideIntFromObj, convert to int} testobj { set result "" lappend result [testintobj setint 1 477] lappend result [testintobj div10 1] ;# must convert to bool lappend result [testobj type 1] } {477 47 int} test obj-29.3 {Tcl_GetWideIntFromObj, error converting to int} testobj { set result "" lappend result [teststringobj set 1 abc] lappend result [catch {testintobj ismax 1} msg] ;# cvts to long int lappend result $msg } {abc 1 {expected integer but got "abc"}} test obj-29.4 {Tcl_GetWideIntFromObj, error converting from "empty string"} testobj { set result "" lappend result [testobj newobj 1] lappend result [catch {testintobj ismax 1} msg] ;# cvts to long int lappend result $msg } {{} 1 {expected integer but got ""}} test obj-30.1 {Ref counting and object deletion, simple types} testobj { set result "" lappend result [testobj freeallvars] lappend result [testintobj set 1 1024] lappend result [testobj assign 1 2] ;# vars 1 and 2 share the int obj lappend result [testobj type 2] lappend result [testobj refcount 1] lappend result [testobj refcount 2] lappend result [testbooleanobj set 2 0] ;# must copy on write, now 2 objs lappend result [testobj type 2] lappend result [testobj refcount 1] lappend result [testobj refcount 2] } {{} 1024 1024 int 4 4 0 int 3 2} test obj-32.1 {freeing very large object trees} { set x {} for {set i 0} {$i<100000} {incr i} { set x [list $x {}] } unset x } {} test obj-33.1 {integer overflow on input} {wideIs64bit} { set x 0x8000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 2147483648} test obj-33.2 {integer overflow on input} {wideIs64bit} { set x 0xffff; append x ffff list [string is integer $x] [expr { wide($x) }] } {1 4294967295} test obj-33.3 {integer overflow on input} { set x 0x10000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 4294967296} test obj-33.4 {integer overflow on input} {wideIs64bit} { set x -0x8000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 -2147483648} test obj-33.5 {integer overflow on input} {wideIs64bit} { set x -0x8000; append x 0001 list [string is integer $x] [expr { wide($x) }] } {1 -2147483649} test obj-33.6 {integer overflow on input} {wideIs64bit} { set x -0xffff; append x ffff list [string is integer $x] [expr { wide($x) }] } {1 -4294967295} test obj-33.7 {integer overflow on input} { set x -0x10000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 -4294967296} test obj-34.1 {mp_iseven} testobj { set result "" lappend result [testbignumobj set 1 0] lappend result [testbignumobj iseven 1] ; lappend result [testobj type 1] } {0 1 int} test obj-34.2 {mp_radix_size} testobj { set result "" lappend result [testbignumobj set 1 9] lappend result [testbignumobj radixsize 1] ; lappend result [testobj type 1] } {9 2 int} if {[testConstraint testobj]} { testobj freeallvars } # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/nre.test0000644000175000017500000002371215104661341014403 0ustar sergeisergei# Commands covered: proc, apply, [interp alias], [namespace import] # # This file contains a collection of tests for the non-recursive executor that # avoids recursive calls to TEBC. Only the NRE behaviour is tested here, the # actual command functionality is tested in the specific test file. # # Copyright © 2008 Miguel Sofer. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testnrelevels [llength [info commands testnrelevels]] # # The tests that risked blowing the C stack on failure have been removed: we # can now actually measure using testnrelevels. # if {[testConstraint testnrelevels]} { namespace eval testnre { namespace path ::tcl::mathop # # [testnrelevels] returns a 6-list with: C-stack depth, iPtr->numlevels, # cmdFrame level, callFrame level, tosPtr and callback depth # variable last [testnrelevels] proc depthDiff {} { variable last set depth [testnrelevels] set res {} foreach t $depth l $last { lappend res [expr {$t-$l}] } set last $depth return $res } proc setabs {} { variable abs [- [lindex [testnrelevels] 0]] } variable body0 { set x [depthDiff] if {[incr i] > 10} { namespace upvar [namespace qualifiers \ [namespace origin depthDiff]] abs abs incr abs [lindex [testnrelevels] 0] return [list [lrange $x 0 3] $abs] } } proc makebody txt { variable body0 return "$body0; $txt" } namespace export * } namespace import testnre::* } test nre-0.1 {levels while unwinding} -body { testnreunwind } -constraints { testnrelevels } -result {0 0 0} test nre-1.1 {self-recursive procs} -setup { proc a i [makebody {a $i}] } -body { setabs a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-1.2 {self-recursive lambdas} -setup { set a [list i [makebody {apply $::a $i}]] } -body { setabs apply $a 0 } -cleanup { unset a } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-1.3 {mutually recursive procs and lambdas} -setup { proc a i { apply $::b [incr i] } set b [list i [makebody {a $i}]] } -body { setabs a 0 } -cleanup { rename a {} unset b } -constraints { testnrelevels } -result {{0 2 2 2} 0} # # Test that aliases are non-recursive # test nre-2.1 {alias is not recursive} -setup { proc a i [makebody {b $i}] interp alias {} b {} a } -body { setabs a 0 } -cleanup { rename a {} rename b {} } -constraints { testnrelevels } -result {{0 2 1 1} 0} # # Test that imports are non-recursive # test nre-3.1 {imports are not recursive} -setup { namespace eval foo { setabs namespace export a } proc foo::a i [makebody {::a $i}] namespace import foo::a } -body { a 0 } -cleanup { rename a {} namespace delete ::foo } -constraints { testnrelevels } -result {{0 2 1 1} 0} test nre-4.1 {ensembles are not recursive} -setup { proc a i [makebody {b foo $i}] namespace ensemble create \ -command b \ -map [list foo a] } -body { setabs a 0 } -cleanup { rename a {} rename b {} } -constraints { testnrelevels } -result {{0 2 1 1} 0} test nre-4.2 {(compiled) ensembles do not break tailcall} -setup { # Fix Bug d87cb18205 proc b {} { tailcall append result first } set map [namespace ensemble configure ::dict -map] dict set map a b namespace ensemble configure ::dict -map $map proc demo {} { dict a append result second } } -body { demo } -cleanup { rename demo {} namespace ensemble configure ::dict -map [dict remove $map a] unset map rename b {} } -result firstsecond test nre-5.1 {[namespace eval] is not recursive} -setup { namespace eval ::foo { setabs } proc foo::a i [makebody {namespace eval ::foo [list a $i]}] } -body { ::foo::a 0 } -cleanup { namespace delete ::foo } -constraints { testnrelevels } -result {{0 2 2 2} 0} test nre-5.2 {[namespace eval] is not recursive} -setup { namespace eval ::foo { setabs } proc foo::a i [makebody {namespace eval ::foo "set x $i; a $i"}] } -body { foo::a 0 } -cleanup { namespace delete ::foo } -constraints { testnrelevels } -result {{0 2 2 2} 0} test nre-6.1 {[uplevel] is not recursive} -setup { proc a i [makebody {uplevel 1 [list a $i]}] } -body { setabs a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 0} 0} test nre-6.2 {[uplevel] is not recursive} -setup { setabs proc a i [makebody {uplevel 1 "set x $i; a $i"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 0} 0} test nre-7.1 {[catch] is not recursive} -setup { setabs proc a i [makebody {uplevel 1 "catch {a $i} msg; set msg"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 3 3 0} 0} test nre-7.2 {[if] is not recursive} -setup { setabs proc a i [makebody {uplevel 1 "if 1 {a $i}"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 0} 0} test nre-7.3 {[while] is not recursive} -setup { setabs proc a i [makebody {uplevel 1 "while 1 {set res \[a $i\]; break}; set res"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 0} 0} test nre-7.4 {[for] is not recursive} -setup { setabs proc a i [makebody {uplevel 1 "for {set j 0} {\$j < 10} {incr j} {set res \[a $i\]; break}; set res"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 0} 0} test nre-7.5 {[foreach] is not recursive} -setup { # # Enable once [foreach] is NR-enabled # setabs proc a i [makebody {uplevel 1 "foreach j {1 2 3 4 5 6} {set res \[a $i\]; break}; set res"}] } -body { a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 3 3 0} 0} test nre-7.6 {[eval] is not recursive} -setup { proc a i [makebody {eval [list a $i]}] } -body { setabs a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 1} 0} test nre-7.7 {[eval] is not recursive} -setup { proc a i [makebody {eval "a $i"}] } -body { setabs a 0 } -cleanup { rename a {} } -constraints { testnrelevels } -result {{0 2 2 1} 0} test nre-7.8 {bug #2910748: switch out of stale BC is not nre-aware} -setup { proc foo args {} foo coroutine bar apply {{} { yield proc foo args {return ok} while 1 { yield [incr i] foo } }} } -body { # if switching to plain eval is not nre aware, this will cause a "cannot # yield" error list [bar] [bar] [bar] } -cleanup { rename bar {} rename foo {} } -result {1 2 3} test nre-8.1 {nre and {*}} -body { # force an expansion that grows the evaluation stack, check that nre # adapts the TEBCdataPtr. This crashes on failure. proc inner {} { set long [lrepeat 1000000 1] list {*}$long } proc outer {} inner lrange [outer] 0 2 } -cleanup { rename inner {} rename outer {} } -result {1 1 1} test nre-8.2 {nre and {*}, [Bug 2415422]} -body { # force an expansion that grows the evaluation stack, check that nre # adapts the bcFramePtr. This causes an NRE assertion to fail if it is not # done properly. proc nop {} {} proc crash {} { foreach val [list {*}[lrepeat 100000 x]] { nop } } crash } -cleanup { rename nop {} rename crash {} } # # Basic TclOO tests # test nre-oo.1 {really deep calls in oo - direct} -setup { oo::object create foo oo::objdefine foo method bar i [makebody {foo bar $i}] } -body { setabs foo bar 0 } -cleanup { foo destroy } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-oo.2 {really deep calls in oo - call via [self]} -setup { oo::object create foo oo::objdefine foo method bar i [makebody {[self] bar $i}] } -body { setabs foo bar 0 } -cleanup { foo destroy } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-oo.3 {really deep calls in oo - private calls} -setup { oo::object create foo oo::objdefine foo method bar i [makebody {my bar $i}] } -body { setabs foo bar 0 } -cleanup { foo destroy } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-oo.4 {really deep calls in oo - overriding} -setup { oo::class create foo { method bar i [makebody {my bar $i}] } oo::class create boo { superclass foo method bar i [makebody {next $i}] } } -body { setabs [boo new] bar 0 } -cleanup { foo destroy } -constraints { testnrelevels } -result {{0 1 1 1} 0} test nre-oo.5 {really deep calls in oo - forwards} -setup { oo::object create foo set body [makebody {my boo $i}] oo::objdefine foo " method bar i {$body} forward boo ::foo bar " } -body { setabs foo bar 0 } -cleanup { foo destroy } -constraints { testnrelevels } -result {{0 2 1 1} 0} # # NASTY BUG found by tcllib's interp package # test nre-X.1 {eval in wrong interp} -setup { set i [interp create] $i eval {proc filter lst {lsearch -all -inline -not $lst "::tcl"}} } -body { $i eval { set x {namespace children ::} set y [list namespace children ::] namespace delete {*}[filter [{*}$y]] set j [interp create] $j alias filter filter $j eval {namespace delete {*}[filter [namespace children ::]]} namespace eval foo {} list [filter [eval $x]] [filter [eval $y]] [filter [$j eval $x]] [filter [$j eval $y]] } } -cleanup { interp delete $i } -result {::foo ::foo {} {}} # cleanup ::tcltest::cleanupTests if {[testConstraint testnrelevels]} { namespace forget testnre::* namespace delete testnre } return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/notify.test0000644000175000017500000002117215104661341015125 0ustar sergeisergei# -*- tcl -*- # # notify.test -- # # This file tests several functions in the file, 'generic/tclNotify.c'. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2003 Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testevent [llength [info commands testevent]] test notify-1.1 {Tcl_QueueEvent and delivery of a single event} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} vwait done set delivered } \ -result {one} test notify-1.2 {Tcl_QueueEvent and delivery of events in order} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent queue three tail {lappend delivered three; expr 1} vwait done set delivered } \ -result {one two three} test notify-1.3 {Tcl_QueueEvent at head} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one head {lappend delivered one; expr 1} vwait done set delivered } \ -result one test notify-1.4 {Tcl_QueueEvent multiple events at head} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one head {lappend delivered one; expr 1} testevent queue two head {lappend delivered two; expr 1} testevent queue three head {lappend delivered three; expr 1} vwait done set delivered } \ -result {three two one} test notify-1.5 {Tcl_QueueEvent marker event into an empty queue} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} vwait done set delivered } \ -result one test notify-1.6 {Tcl_QueueEvent first marker event in a nonempty queue} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent queue three head {lappend delivered three; expr 1} vwait done set delivered } \ -result {three two one} test notify-1.7 {Tcl_QueueEvent second marker event} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} vwait done set delivered } \ -result {one two} test notify-1.8 {Tcl_QueueEvent preexisting event following second marker} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent queue three mark {lappend delivered three; expr 1} vwait done set delivered } \ -result {one three two} test notify-2.1 {remove sole element, don't replace } \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent delete one vwait done set delivered } \ -result {} test notify-2.2 {remove and replace sole element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent delete one testevent queue two tail {lappend delivered two; expr 1} vwait done set delivered } \ -result two test notify-2.3 {remove first element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent delete one vwait done set delivered } \ -result {two} test notify-2.4 {remove and replace first element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent delete one testevent queue three head {lappend delivered three; expr 1}; vwait done set delivered } \ -result {three two} test notify-2.5 {remove last element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent delete two vwait done set delivered } \ -result {one} test notify-2.6 {remove and replace last element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent delete two testevent queue three tail {lappend delivered three; expr 1}; vwait done set delivered } \ -result {one three} test notify-2.7 {remove a middle element} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one tail {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent queue three tail {lappend delivered three; expr 1} testevent delete two vwait done set delivered } \ -result {one three} test notify-2.8 {remove a marker event that's the sole event in the queue} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent delete one vwait done set delivered } \ -result {} test notify-2.9 {remove and replace a marker event that's the sole event} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent delete one testevent queue two mark {lappend delivered two; expr 1} vwait done set delivered } \ -result two test notify-2.10 {remove marker event from head} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent delete one vwait done set delivered } \ -result two test notify-2.11 {remove and replace marker event at head} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two tail {lappend delivered two; expr 1} testevent delete one testevent queue three mark {lappend delivered three; expr 1} vwait done set delivered } \ -result {three two} test notify-2.12 {remove marker event at tail} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent delete two vwait done set delivered } \ -result {one} test notify-2.13 {remove and replace marker event at tail} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent delete two testevent queue three mark {lappend delivered three; expr 1} vwait done set delivered } \ -result {one three} test notify-2.14 {remove marker event from middle} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent queue three mark {lappend delivered three; expr 1} testevent delete two vwait done set delivered } \ -result {one three} test notify-2.15 {remove and replace marker event at middle} \ -constraints {testevent} \ -body { set delivered {} after 10 set done 1 testevent queue one mark {lappend delivered one; expr 1} testevent queue two mark {lappend delivered two; expr 1} testevent queue three tail {lappend delivered three; expr 1} testevent delete two testevent queue four mark {lappend delivered four; expr 1}; vwait done set delivered } \ -result {one four three} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/namespace.test0000644000175000017500000034075715104661341015566 0ustar sergeisergei# Functionality covered: this file contains a collection of tests for the # procedures in tclNamesp.c and tclEnsemble.c that implement Tcl's basic # support for namespaces. Other namespace-related tests appear in # variable.test. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-2000 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint memory [llength [info commands memory]] ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # # REMARK: the tests for 'namespace upvar' are not done here. They are to be # found in the file 'upvar.test'. # # 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_* } {} catch {unset l} test namespace-2.1 {Tcl_GetCurrentNamespace} { list [namespace current] [namespace eval {} {namespace current}] \ [namespace eval {} {namespace current}] } {:: :: ::} test namespace-2.2 {Tcl_GetCurrentNamespace} { set l {} lappend l [namespace current] namespace eval test_ns_1 { lappend ::l [namespace current] namespace eval foo { lappend ::l [namespace current] } } lappend l [namespace current] } {:: ::test_ns_1 ::test_ns_1::foo ::} test namespace-3.1 {Tcl_GetGlobalNamespace} { namespace eval test_ns_1 {namespace eval foo {namespace eval bar {} } } # namespace children uses Tcl_GetGlobalNamespace namespace eval test_ns_1 {namespace children foo b*} } {::test_ns_1::foo::bar} test namespace-4.1 {Tcl_PushCallFrame with isProcCallFrame=1} { namespace eval test_ns_1 { variable v 123 proc p {} { variable v return $v } } test_ns_1::p ;# does Tcl_PushCallFrame to push p's namespace } {123} test namespace-4.2 {Tcl_PushCallFrame with isProcCallFrame=0} { namespace eval test_ns_1::baz {} ;# does Tcl_PushCallFrame to create baz proc test_ns_1::baz::p {} { variable v set v 789 set v} test_ns_1::baz::p } {789} test namespace-5.1 {Tcl_PopCallFrame, no vars} { namespace eval test_ns_1::blodge {} ;# pushes then pops frame } {} test namespace-5.2 {Tcl_PopCallFrame, local vars must be deleted} -setup { namespace eval test_ns_1 {} } -body { proc test_ns_1::r {} { set a 123 } test_ns_1::r ;# pushes then pop's r's frame } -result {123} test namespace-6.1 {Tcl_CreateNamespace} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [lsort [namespace children :: test_ns_*]] \ [namespace eval test_ns_1 {namespace current}] \ [namespace eval test_ns_2 {namespace current}] \ [namespace eval ::test_ns_3 {namespace current}] \ [namespace eval ::test_ns_4 \ {namespace eval foo {namespace current}}] \ [namespace eval ::test_ns_5 \ {namespace eval ::test_ns_6 {namespace current}}] \ [lsort [namespace children :: test_ns_*]] } {{} ::test_ns_1 ::test_ns_2 ::test_ns_3 ::test_ns_4::foo ::test_ns_6 {::test_ns_1 ::test_ns_2 ::test_ns_3 ::test_ns_4 ::test_ns_5 ::test_ns_6}} test namespace-6.2 {Tcl_CreateNamespace, odd number of :'s in name is okay} { list [namespace eval :::test_ns_1::::foo {namespace current}] \ [namespace eval test_ns_2:::::foo {namespace current}] } {::test_ns_1::foo ::test_ns_2::foo} test namespace-6.3 {Tcl_CreateNamespace, trailing ::s in ns name are ignored} { list [catch {namespace eval test_ns_7::: {namespace current}} msg] $msg } {0 ::test_ns_7} test namespace-6.4 {Tcl_CreateNamespace, trailing ::s in ns name are ignored} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1:: { namespace eval test_ns_2:: {} namespace eval test_ns_3:: {} } lsort [namespace children ::test_ns_1] } [lsort {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_3}] test namespace-6.5 {Tcl_CreateNamespace, relative ns names now only looked up in current ns} { set trigger { namespace eval test_ns_2 {namespace current} } set l {} lappend l [namespace eval test_ns_1 $trigger] namespace eval test_ns_1::test_ns_2 {} lappend l [namespace eval test_ns_1 $trigger] } {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_2} test namespace-7.1 {Tcl_DeleteNamespace, active call frames in ns} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1 { proc p {} { namespace delete [namespace current] return [namespace current] } } list [test_ns_1::p] [catch {test_ns_1::p} msg] $msg } {::test_ns_1 1 {invalid command name "test_ns_1::p"}} test namespace-7.2 {Tcl_DeleteNamespace, no active call frames in ns} { namespace eval test_ns_2 { proc p {} { return [namespace current] } } list [test_ns_2::p] [namespace delete test_ns_2] } {::test_ns_2 {}} test namespace-7.3 {recursive Tcl_DeleteNamespace, active call frames in ns} { # [Bug 1355942] namespace eval test_ns_2 { set x 1 trace add variable x unset "namespace delete [namespace current];#" namespace delete [namespace current] } } {} test namespace-7.4 {recursive Tcl_DeleteNamespace, active call frames in ns} { # [Bug 1355942] namespace eval test_ns_2 { proc x {} {} trace add command x delete "namespace delete [namespace current];#" namespace delete [namespace current] } } {} test namespace-7.5 {recursive Tcl_DeleteNamespace, no active call frames in ns} { # [Bug 1355942] namespace eval test_ns_2 { set x 1 trace add variable x unset "namespace delete [namespace current];#" } namespace delete test_ns_2 } {} test namespace-7.6 {recursive Tcl_DeleteNamespace, no active call frames in ns} { # [Bug 1355942] namespace eval test_ns_2 { proc x {} {} trace add command x delete "namespace delete [namespace current];#" } namespace delete test_ns_2 } {} test namespace-7.7 {Bug 1655305} -setup { interp create child # Can't invoke through the ensemble, since deleting ::tcl # (indirectly, via deleting the global namespace) deletes the ensemble. child eval {rename ::tcl::info::commands ::infocommands} child hide infocommands child eval { proc foo {} { namespace delete :: } } } -body { child eval foo child invokehidden infocommands } -cleanup { interp delete child } -result {} test namespace-7.8 {Bug ba1419303b4c} -setup { namespace eval ns1 { namespace ensemble create } trace add command ns1 delete { namespace delete ns1 } } -body { # No segmentation fault given --enable-symbols. namespace delete ns1 } -result {} test namespace-7.9 { Bug e39cb3f462631a99 A namespace being deleted should not be removed from other namespace paths until the contents of the namespace are entirely removed. } -setup { } -body { variable res {} namespace eval ns1 { proc p1 caller { lappend [namespace parent]::res $caller } } namespace eval ns1a { namespace path [namespace parent]::ns1 proc t1 {old new op} { $old t1 } } namespace eval ns2 { proc p1 caller { lappend [namespace parent]::res $caller } } namespace eval ns2a { namespace path [namespace parent]::ns2 proc t1 {old new op} { [namespace tail $old] t2 } } trace add command ns1::p1 delete ns1a::t1 namespace delete ns1 trace add command ns2::p1 delete ns2a::t1 namespace delete ns2 return $res } -cleanup { namespace delete ns1a namespace delete ns2a unset res } -result {t1 t2} test namespace-8.1 {TclTeardownNamespace, delete global namespace} { catch {interp delete test_interp} interp create test_interp interp eval test_interp { namespace eval test_ns_1 { namespace export p proc p {} { return [namespace current] } } namespace eval test_ns_2 { namespace import ::test_ns_1::p variable v 27 proc q {} { variable v return "[p] $v" } } set x [test_ns_2::q] catch {set xxxx} } list [interp eval test_interp {test_ns_2::q}] \ [interp eval test_interp {namespace delete ::}] \ [catch {interp eval test_interp {set a 123}} msg] $msg \ [interp delete test_interp] } {{::test_ns_1 27} {} 1 {invalid command name "set"} {}} test namespace-8.2 {TclTeardownNamespace, remove deleted ns from parent} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2::test_ns_3a {proc p {} {}} namespace eval test_ns_1::test_ns_2::test_ns_3b {proc q {} {}} list [namespace children test_ns_1] \ [namespace delete test_ns_1::test_ns_2] \ [namespace children test_ns_1] } {::test_ns_1::test_ns_2 {} {}} test namespace-8.3 {TclTeardownNamespace, delete child namespaces} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2::test_ns_3a {proc p {} {}} namespace eval test_ns_1::test_ns_2::test_ns_3b {proc q {} {}} list [namespace children test_ns_1] \ [namespace delete test_ns_1::test_ns_2] \ [namespace children test_ns_1] \ [catch {namespace children test_ns_1::test_ns_2} msg] $msg \ [info commands test_ns_1::test_ns_2::test_ns_3a::*] } {::test_ns_1::test_ns_2 {} {} 1 {namespace "test_ns_1::test_ns_2" not found in "::"} {}} test namespace-8.4 {TclTeardownNamespace, cmds imported from deleted ns go away} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 cmd2 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_import { namespace import ::test_ns_export::* proc p {} {return foo} } list [lsort [info commands test_ns_import::*]] \ [namespace delete test_ns_export] \ [info commands test_ns_import::*] } [list [lsort {::test_ns_import::p ::test_ns_import::cmd1 ::test_ns_import::cmd2}] {} ::test_ns_import::p] test namespace-8.5 {TclTeardownNamespace: preserve errorInfo; errorCode values} { interp create child child eval {trace add execution error leave {namespace delete :: ;#}} catch {child eval error foo bar baz} interp delete child set ::errorInfo } {bar invoked from within "child eval error foo bar baz"} test namespace-8.6 {TclTeardownNamespace: preserve errorInfo; errorCode values} { interp create child child eval {trace add variable errorCode write {namespace delete :: ;#}} catch {child eval error foo bar baz} interp delete child set ::errorInfo } {bar invoked from within "child eval error foo bar baz"} test namespace-8.7 {TclTeardownNamespace: preserve errorInfo; errorCode values} { interp create child child eval {trace add execution error leave {namespace delete :: ;#}} catch {child eval error foo bar baz} interp delete child set ::errorCode } baz test namespace-9.1 {Tcl_Import, empty import pattern} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace eval test_ns_import {namespace import {}}} msg] $msg } {1 {empty import pattern}} test namespace-9.2 {Tcl_Import, unknown namespace in import pattern} { list [catch {namespace eval test_ns_import {namespace import fred::x}} msg] $msg } {1 {unknown namespace in import pattern "fred::x"}} test namespace-9.3 {Tcl_Import, import ns == export ns} { list [catch {namespace eval test_ns_import {namespace import ::test_ns_import::puts}} msg] $msg } {1 {import pattern "::test_ns_import::puts" tries to import from namespace "test_ns_import" into itself}} test namespace-9.4 {Tcl_Import, simple import} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_import { namespace import ::test_ns_export::* proc p {} {return [cmd1 123]} } test_ns_import::p } {cmd1: 123} test namespace-9.5 {Tcl_Import, RFE 1230597} -setup { namespace eval test_ns_import {} namespace eval test_ns_export {} } -body { list [catch {namespace eval test_ns_import {namespace import ::test_ns_export::*}} msg] $msg } -result {0 {}} test namespace-9.6 {Tcl_Import, cmd redefinition ok if allowOverwrite!=0} -setup { namespace eval test_ns_import {} namespace eval ::test_ns_export { proc cmd1 {args} {return "cmd1: $args"} namespace export cmd1 } } -body { namespace eval test_ns_import { namespace import -force ::test_ns_export::* cmd1 555 } } -result {cmd1: 555} test namespace-9.7 {Tcl_Import, links are preserved if cmd is redefined} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} } namespace eval test_ns_import { namespace import -force ::test_ns_export::* } list [test_ns_import::cmd1 a b c] \ [test_ns_export::cmd1 d e f] \ [proc test_ns_export::cmd1 {args} {return "new1: $args"}] \ [namespace origin test_ns_import::cmd1] \ [namespace origin test_ns_export::cmd1] \ [test_ns_import::cmd1 g h i] \ [test_ns_export::cmd1 j k l] } {{cmd1: a b c} {cmd1: d e f} {} ::test_ns_export::cmd1 ::test_ns_export::cmd1 {new1: g h i} {new1: j k l}} test namespace-9.8 {Tcl_Import: Bug 1017299} -setup { namespace eval one { namespace export cmd proc cmd {} {} } namespace eval two { namespace export cmd proc other args {} } namespace eval two \ [list namespace import [namespace current]::one::cmd] namespace eval three \ [list namespace import [namespace current]::two::cmd] namespace eval three { rename cmd other namespace export other } } -body { namespace eval two [list namespace import -force \ [namespace current]::three::other] namespace origin two::other } -cleanup { namespace delete one two three } -match glob -result *::one::cmd test namespace-9.9 {Tcl_Import: Bug 1017299} -setup { namespace eval one { namespace export cmd proc cmd {} {} } namespace eval two namespace export cmd namespace eval two \ [list namespace import [namespace current]::one::cmd] namespace eval three namespace export cmd namespace eval three \ [list namespace import [namespace current]::two::cmd] } -body { namespace eval two [list namespace import -force \ [namespace current]::three::cmd] namespace origin two::cmd } -cleanup { namespace delete one two three } -returnCodes error -match glob -result {import pattern * would create a loop*} test namespace-10.1 {Tcl_ForgetImport, check for valid namespaces} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace forget xyzzy::*} msg] $msg } {1 {unknown namespace in namespace forget pattern "xyzzy::*"}} test namespace-10.2 {Tcl_ForgetImport, ignores patterns that don't match} { namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_import { namespace forget ::test_ns_export::wombat } } {} test namespace-10.3 {Tcl_ForgetImport, deletes matching imported cmds} -setup { namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } } -body { namespace eval test_ns_import { namespace import ::test_ns_export::* proc p {} {return [cmd1 123]} set l {} lappend l [lsort [info commands ::test_ns_import::*]] namespace forget ::test_ns_export::cmd1 lappend l [info commands ::test_ns_import::*] lappend l [catch {cmd1 777} msg] $msg } } -result [list [lsort {::test_ns_import::p ::test_ns_import::cmd1}] ::test_ns_import::p 1 {invalid command name "cmd1"}] test namespace-10.4 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval unrelated { proc cmd {} {} } namespace eval my \ [list namespace import [namespace current]::origin::cmd] } -body { namespace eval my \ [list namespace forget [namespace current]::unrelated::cmd] my::cmd } -cleanup { namespace delete origin unrelated my } test namespace-10.5 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval my \ [list namespace import [namespace current]::origin::cmd] namespace eval my rename cmd newname } -body { namespace eval my \ [list namespace forget [namespace current]::origin::cmd] my::newname } -cleanup { namespace delete origin my } -returnCodes error -match glob -result * test namespace-10.6 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval my \ [list namespace import [namespace current]::origin::cmd] namespace eval your {} namespace eval my \ [list rename cmd [namespace current]::your::newname] } -body { namespace eval your namespace forget newname your::newname } -cleanup { namespace delete origin my your } -returnCodes error -match glob -result * test namespace-10.7 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval link namespace export cmd namespace eval link \ [list namespace import [namespace current]::origin::cmd] namespace eval link2 namespace export cmd namespace eval link2 \ [list namespace import [namespace current]::link::cmd] namespace eval my \ [list namespace import [namespace current]::link2::cmd] } -body { namespace eval my \ [list namespace forget [namespace current]::origin::cmd] my::cmd } -cleanup { namespace delete origin link link2 my } -returnCodes error -match glob -result * test namespace-10.8 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval link namespace export cmd namespace eval link \ [list namespace import [namespace current]::origin::cmd] namespace eval link2 namespace export cmd namespace eval link2 \ [list namespace import [namespace current]::link::cmd] namespace eval my \ [list namespace import [namespace current]::link2::cmd] } -body { namespace eval my \ [list namespace forget [namespace current]::link::cmd] my::cmd } -cleanup { namespace delete origin link link2 my } test namespace-10.9 {Tcl_ForgetImport: Bug 560297} -setup { namespace eval origin { namespace export cmd proc cmd {} {} } namespace eval link namespace export cmd namespace eval link \ [list namespace import [namespace current]::origin::cmd] namespace eval link2 namespace export cmd namespace eval link2 \ [list namespace import [namespace current]::link::cmd] namespace eval my \ [list namespace import [namespace current]::link2::cmd] } -body { namespace eval my \ [list namespace forget [namespace current]::link2::cmd] my::cmd } -cleanup { namespace delete origin link link2 my } -returnCodes error -match glob -result * test namespace-11.1 {TclGetOriginalCommand, check if not imported cmd} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} } list [namespace origin set] [namespace origin test_ns_export::cmd1] } -result {::set ::test_ns_export::cmd1} test namespace-11.2 {TclGetOriginalCommand, directly imported cmd} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} } } -body { namespace eval test_ns_import1 { namespace import ::test_ns_export::* namespace export * proc p {} {namespace origin cmd1} } list [test_ns_import1::p] [namespace origin test_ns_import1::cmd1] } -result {::test_ns_export::cmd1 ::test_ns_export::cmd1} test namespace-11.3 {TclGetOriginalCommand, indirectly imported cmd} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} } namespace eval test_ns_import1 { namespace import ::test_ns_export::* namespace export * proc p {} {namespace origin cmd1} } } -body { namespace eval test_ns_import2 { namespace import ::test_ns_import1::* proc q {} {return [cmd1 123]} } list [test_ns_import2::q] [namespace origin test_ns_import2::cmd1] } -result {{cmd1: 123} ::test_ns_export::cmd1} test namespace-12.1 {InvokeImportedCmd} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {namespace current} } namespace eval test_ns_import { namespace import ::test_ns_export::* } list [test_ns_import::cmd1] } {::test_ns_export} test namespace-13.1 {DeleteImportedCmd, deletes imported cmds} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_export { namespace export cmd1 proc cmd1 {args} {namespace current} } namespace eval test_ns_import { namespace import ::test_ns_export::* } } -body { namespace eval test_ns_import { set l {} lappend l [info commands ::test_ns_import::*] namespace forget ::test_ns_export::cmd1 lappend l [info commands ::test_ns_import::*] } } -result {::test_ns_import::cmd1 {}} test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} { # Will panic if still buggy namespace eval src {namespace export foo; proc foo {} {}} namespace eval dst {namespace import [namespace parent]::src::foo} trace add command src::foo delete \ "[list namespace delete [namespace current]::dst] ;#" proc src::foo {} {} namespace delete src } {} test namespace-14.1 {TclGetNamespaceForQualName, absolute names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} variable v 10 namespace eval test_ns_1::test_ns_2 { variable v 20 } namespace eval test_ns_2 { variable v 30 } } -body { namespace eval test_ns_1 { list $::v $::test_ns_2::v $::test_ns_1::test_ns_2::v \ [lsort [namespace children :: test_ns_*]] } } -result [list 10 30 20 [lsort {::test_ns_1 ::test_ns_2}]] test namespace-14.2 {TclGetNamespaceForQualName, invalid absolute names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} variable v 10 namespace eval test_ns_1::test_ns_2 { variable v 20 } namespace eval test_ns_2 { variable v 30 } } -body { namespace eval test_ns_1 { list [catch {set ::test_ns_777::v} msg] $msg \ [catch {namespace children test_ns_777} msg] $msg } } -result {1 {can't read "::test_ns_777::v": no such variable} 1 {namespace "test_ns_777" not found in "::test_ns_1"}} # TIP 278: secondary lookup disabled, results changed from {10 20} test namespace-14.3 {TclGetNamespaceForQualName, relative names} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} variable v 10 namespace eval test_ns_1::test_ns_2 { variable v 20 } namespace eval test_ns_2 { variable v 30 } } -body { namespace eval test_ns_1 { # list $v $test_ns_2::v list [catch {set v} msg] $msg [catch {set test_ns_2::v} msg] $msg } } -result {1 {can't read "v": no such variable} 0 20} test namespace-14.4 {TclGetNamespaceForQualName, relative ns names looked up only in current ns} { namespace eval test_ns_1::test_ns_2 { namespace eval foo {} } namespace eval test_ns_1 { list [namespace children test_ns_2] \ [catch {namespace children test_ns_1} msg] $msg } } {::test_ns_1::test_ns_2::foo 1 {namespace "test_ns_1" not found in "::test_ns_1"}} test namespace-14.5 {TclGetNamespaceForQualName, relative ns names looked up only in current ns} { namespace eval ::test_ns_2 { namespace eval bar {} } namespace eval test_ns_1 { list [catch {namespace delete test_ns_2::bar} msg] $msg } } {1 {unknown namespace "test_ns_2::bar" in namespace delete command}} test namespace-14.6 {TclGetNamespaceForQualName, relative ns names looked up only in current ns} { namespace eval test_ns_1::test_ns_2 { namespace eval foo {} } namespace eval test_ns_1 { list [namespace children test_ns_2] \ [catch {namespace children test_ns_1} msg] $msg } } {::test_ns_1::test_ns_2::foo 1 {namespace "test_ns_1" not found in "::test_ns_1"}} test namespace-14.7 {TclGetNamespaceForQualName, ignore extra :s if ns} -setup { namespace eval test_ns_1::test_ns_2::foo {} } -body { namespace children test_ns_1::: } -result {::test_ns_1::test_ns_2} test namespace-14.8 {TclGetNamespaceForQualName, ignore extra :s if ns} -setup { namespace eval test_ns_1::test_ns_2::foo {} } -body { namespace children :::test_ns_1:::::test_ns_2::: } -result {::test_ns_1::test_ns_2::foo} test namespace-14.9 {TclGetNamespaceForQualName, extra ::s are significant for vars} { set l {} lappend l [catch {set test_ns_1::test_ns_2::} msg] $msg namespace eval test_ns_1::test_ns_2 {variable {} 2525} lappend l [set test_ns_1::test_ns_2::] } {1 {can't read "test_ns_1::test_ns_2::": no such variable} 2525} test namespace-14.10 {TclGetNamespaceForQualName, extra ::s are significant for vars} -setup { namespace eval test_ns_1::test_ns_2::foo {} unset -nocomplain test_ns_1::test_ns_2:: set l {} } -body { lappend l [catch {set test_ns_1::test_ns_2::} msg] $msg set test_ns_1::test_ns_2:: 314159 lappend l [set test_ns_1::test_ns_2::] } -result {1 {can't read "test_ns_1::test_ns_2::": no such variable} 314159} test namespace-14.11 {TclGetNamespaceForQualName, extra ::s are significant for commands} -setup { namespace eval test_ns_1::test_ns_2::foo {} catch {rename test_ns_1::test_ns_2:: {}} set l {} } -body { lappend l [catch {test_ns_1::test_ns_2:: hello} msg] $msg proc test_ns_1::test_ns_2:: {args} {return "\{\}: $args"} lappend l [test_ns_1::test_ns_2:: hello] } -result {1 {invalid command name "test_ns_1::test_ns_2::"} {{}: hello}} # TIP 278: secondary lookup disabled, added catch, result changed from y test namespace-14.12 {TclGetNamespaceForQualName, extra ::s are significant for vars} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { variable {} catch {set test_ns_1::(x) y} ::msg } list $::msg [catch {set test_ns_1::(x)} msg] $msg } -result {{can't set "test_ns_1::(x)": parent namespace doesn't exist} 1 {can't read "test_ns_1::(x)": no such variable}} test namespace-14.13 {TclGetNamespaceForQualName, namespace other than global ns can't have empty name} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -returnCodes error -body { namespace eval test_ns_1 { proc {} {} {} namespace eval {} {} {} } } -result {can't create namespace "": only global namespace can have empty name} test namespace-15.1 {Tcl_FindNamespace, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_delete { namespace eval test_ns_delete2 {} proc cmd {args} {namespace current} } list [namespace delete ::test_ns_delete::test_ns_delete2] \ [namespace children ::test_ns_delete] } -result {{} {}} test namespace-15.2 {Tcl_FindNamespace, absolute name not found} -body { namespace delete ::test_ns_delete::test_ns_delete2 } -returnCodes error -result {unknown namespace "::test_ns_delete::test_ns_delete2" in namespace delete command} test namespace-15.3 {Tcl_FindNamespace, relative name found} { namespace eval test_ns_delete { namespace eval test_ns_delete2 {} namespace eval test_ns_delete3 {} list [namespace delete test_ns_delete2] \ [namespace children [namespace current]] } } {{} ::test_ns_delete::test_ns_delete3} test namespace-15.4 {Tcl_FindNamespace, relative name not found} { namespace eval test_ns_delete2 {} namespace eval test_ns_delete { list [catch {namespace delete test_ns_delete2} msg] $msg } } {1 {unknown namespace "test_ns_delete2" in namespace delete command}} test namespace-16.1 {Tcl_FindCommand, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { proc cmd {args} {return "[namespace current]::cmd: $args"} variable v "::test_ns_1::cmd" eval $v one } } -result {::test_ns_1::cmd: one} test namespace-16.2 {Tcl_FindCommand, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1 { proc cmd {args} {return "[namespace current]::cmd: $args"} variable v "::test_ns_1::cmd" } } -body { eval $test_ns_1::v two } -result {::test_ns_1::cmd: two} test namespace-16.3 {Tcl_FindCommand, absolute name not found} { namespace eval test_ns_1 { variable v2 "::test_ns_1::ladidah" list [catch {eval $v2} msg] $msg } } {1 {invalid command name "::test_ns_1::ladidah"}} # save the "unknown" proc, which is redefined by the following two tests catch {rename unknown unknown.old} proc unknown {args} { return "unknown: $args" } test namespace-16.4 {Tcl_FindCommand, absolute name and TCL_GLOBAL_ONLY} { ::test_ns_1::foobar x y z } {unknown: ::test_ns_1::foobar x y z} test namespace-16.5 {Tcl_FindCommand, absolute name and TCL_GLOBAL_ONLY} { ::foobar 1 2 3 4 5 } {unknown: ::foobar 1 2 3 4 5} test namespace-16.6 {Tcl_FindCommand, relative name and TCL_GLOBAL_ONLY} { test_ns_1::foobar x y z } {unknown: test_ns_1::foobar x y z} test namespace-16.7 {Tcl_FindCommand, relative name and TCL_GLOBAL_ONLY} { foobar 1 2 3 4 5 } {unknown: foobar 1 2 3 4 5} # restore the "unknown" proc saved previously catch {rename unknown {}} catch {rename unknown.old unknown} test namespace-16.8 {Tcl_FindCommand, relative name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1 { proc cmd {args} {return "[namespace current]::cmd: $args"} } } -body { namespace eval test_ns_1 { cmd a b c } } -result {::test_ns_1::cmd: a b c} test namespace-16.9 {Tcl_FindCommand, relative name found} -body { proc cmd2 {args} {return "[namespace current]::cmd2: $args"} namespace eval test_ns_1 { cmd2 a b c } } -cleanup { catch {rename cmd2 {}} } -result {::::cmd2: a b c} test namespace-16.10 {Tcl_FindCommand, relative name found, only look in current then global ns} -body { proc cmd2 {args} {return "[namespace current]::cmd2: $args"} namespace eval test_ns_1 { proc cmd2 {args} { return "[namespace current]::cmd2 in test_ns_1: $args" } namespace eval test_ns_12 { cmd2 a b c } } } -cleanup { catch {rename cmd2 {}} } -result {::::cmd2: a b c} test namespace-16.11 {Tcl_FindCommand, relative name not found} -body { namespace eval test_ns_1 { cmd3 a b c } } -returnCodes error -result {invalid command name "cmd3"} unset -nocomplain x test namespace-17.1 {Tcl_FindNamespaceVar, absolute name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { set x 314159 namespace eval test_ns_1 { set ::x } } -result {314159} variable ::x 314159 test namespace-17.2 {Tcl_FindNamespaceVar, absolute name found} { namespace eval test_ns_1 { variable x 777 set ::test_ns_1::x } } {777} test namespace-17.3 {Tcl_FindNamespaceVar, absolute name found} { namespace eval test_ns_1 { namespace eval test_ns_2 { variable x 1111 } set ::test_ns_1::test_ns_2::x } } {1111} test namespace-17.4 {Tcl_FindNamespaceVar, absolute name not found} -body { namespace eval test_ns_1 { namespace eval test_ns_2 { variable x 1111 } set ::test_ns_1::test_ns_2::y } } -returnCodes error -result {can't read "::test_ns_1::test_ns_2::y": no such variable} test namespace-17.5 {Tcl_FindNamespaceVar, absolute name and TCL_GLOBAL_ONLY} -setup { namespace eval ::test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1 { namespace eval test_ns_3 { variable ::test_ns_1::test_ns_2::x 2222 } } set ::test_ns_1::test_ns_2::x } -result {2222} test namespace-17.6 {Tcl_FindNamespaceVar, relative name found} -setup { namespace eval test_ns_1 { variable x 777 } } -body { namespace eval test_ns_1 { set x } } -result {777} # TIP 278: secondary lookup disabled, catch added, result changed from 314159 test namespace-17.7 {Tcl_FindNamespaceVar, relative name found} { namespace eval test_ns_1 { variable x 777 unset x list [catch {set x} msg] $msg ;# must not be global x now } } {1 {can't read "x": no such variable}} test namespace-17.8 {Tcl_FindNamespaceVar, relative name not found} -body { namespace eval test_ns_1 { set wuzzat } } -returnCodes error -result {can't read "wuzzat": no such variable} test namespace-17.9 {Tcl_FindNamespaceVar, relative name and TCL_GLOBAL_ONLY} { namespace eval test_ns_1 { variable a hello } set test_ns_1::a } {hello} # TIP 278: secondary lookup disabled, result changed from 1 test namespace-17.10 {Tcl_FindNamespaceVar, interference with cached varNames} -setup { namespace eval test_ns_1 {} } -body { proc test_ns {} { set ::test_ns_1::a 0 } test_ns rename test_ns {} namespace eval test_ns_1 unset a set a 0 namespace eval test_ns_1 set a 1 namespace delete test_ns_1 return $a } -result 0 catch {unset a} catch {unset x} catch {unset l} catch {rename foo {}} test namespace-18.1 {TclResetShadowedCmdRefs, one-level check for command shadowing} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { proc foo {} {return "global foo"} namespace eval test_ns_1 { proc trigger {} { return [foo] } } set l "" lappend l [test_ns_1::trigger] namespace eval test_ns_1 { # force invalidation of cached ref to "foo" in proc trigger proc foo {} {return "foo in test_ns_1"} } lappend l [test_ns_1::trigger] } -result {{global foo} {foo in test_ns_1}} test namespace-18.2 {TclResetShadowedCmdRefs, multilevel check for command shadowing} { namespace eval test_ns_2 { proc foo {} {return "foo in ::test_ns_2"} } namespace eval test_ns_1 { namespace eval test_ns_2 {} proc trigger {} { return [test_ns_2::foo] } } set l "" lappend l [test_ns_1::trigger] namespace eval test_ns_1 { namespace eval test_ns_2 { # force invalidation of cached ref to "foo" in proc trigger proc foo {} {return "foo in ::test_ns_1::test_ns_2"} } } lappend l [test_ns_1::trigger] } {{foo in ::test_ns_2} {foo in ::test_ns_1::test_ns_2}} catch {unset l} catch {rename foo {}} test namespace-19.1 {GetNamespaceFromObj, global name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1::test_ns_2 {} namespace children ::test_ns_1 } -result {::test_ns_1::test_ns_2} test namespace-19.2 {GetNamespaceFromObj, relative name found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1 { namespace children test_ns_2 } } -result {} test namespace-19.3 {GetNamespaceFromObj, name not found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { namespace children test_ns_99 } } -returnCodes error -result {namespace "test_ns_99" not found in "::test_ns_1"} test namespace-19.4 {GetNamespaceFromObj, invalidation of cached ns refs} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1 { proc foo {} { return [namespace children test_ns_2] } list [catch {namespace children test_ns_99} msg] $msg } set l {} lappend l [test_ns_1::foo] namespace delete test_ns_1::test_ns_2 namespace eval test_ns_1::test_ns_2::test_ns_3 {} lappend l [test_ns_1::foo] } -result {{} ::test_ns_1::test_ns_2::test_ns_3} test namespace-20.1 {Tcl_NamespaceObjCmd, bad subcommand} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace} msg] $msg } {1 {wrong # args: should be "namespace subcommand ?arg ...?"}} test namespace-20.2 {Tcl_NamespaceObjCmd, bad subcommand} -body { namespace wombat {} } -returnCodes error -match glob -result {unknown or ambiguous subcommand "wombat": must be *} test namespace-20.3 {Tcl_NamespaceObjCmd, abbreviations are okay} { namespace ch :: test_ns_* } {} test namespace-21.1 {NamespaceChildrenCmd, no args} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1::test_ns_2 {} expr {"::test_ns_1" in [namespace children]} } -result {1} test namespace-21.2 {NamespaceChildrenCmd, no args} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1 { namespace children } } -result {::test_ns_1::test_ns_2} test namespace-21.3 {NamespaceChildrenCmd, ns name given} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace children ::test_ns_1 } -result {::test_ns_1::test_ns_2} test namespace-21.4 {NamespaceChildrenCmd, ns name given} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1 { namespace children test_ns_2 } } -result {} test namespace-21.5 {NamespaceChildrenCmd, too many args} { namespace eval test_ns_1 { list [catch {namespace children test_ns_2 xxx yyy} msg] $msg } } {1 {wrong # args: should be "namespace children ?name? ?pattern?"}} test namespace-21.6 {NamespaceChildrenCmd, glob-style pattern given} { namespace eval test_ns_1::test_ns_foo {} namespace children test_ns_1 *f* } {::test_ns_1::test_ns_foo} test namespace-21.7 {NamespaceChildrenCmd, glob-style pattern given} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} } -body { namespace eval test_ns_1::test_ns_foo {} lsort [namespace children test_ns_1 test*] } -result {::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] [fq test_ns_1] } [fq test_ns_1] test namespace-22.1 {NamespaceCodeCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace code} msg] $msg \ [catch {namespace code xxx yyy} msg] $msg } {1 {wrong # args: should be "namespace code arg"} 1 {wrong # args: should be "namespace code arg"}} 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} test namespace-22.3 {NamespaceCodeCmd, arg is already scoped value} { namespace code {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} test namespace-22.5 {NamespaceCodeCmd, in other namespace} { namespace eval test_ns_1 { namespace code cmd } } {::namespace inscope ::test_ns_1 cmd} test namespace-22.6 {NamespaceCodeCmd, in other namespace} { namespace eval test_ns_1 { variable v 42 } namespace eval test_ns_2 { proc namespace args {} } namespace eval test_ns_2 [namespace eval test_ns_1 { 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_*]} list [catch {namespace current xxx} msg] $msg \ [catch {namespace current xxx yyy} msg] $msg } {1 {wrong # args: should be "namespace current"} 1 {wrong # args: should be "namespace current"}} test namespace-23.2 {NamespaceCurrentCmd, at global level} { namespace current } {::} test namespace-23.3 {NamespaceCurrentCmd, in nested ns} { namespace eval test_ns_1::test_ns_2 { namespace current } } {::test_ns_1::test_ns_2} test namespace-24.1 {NamespaceDeleteCmd, no args} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace delete } {} test namespace-24.2 {NamespaceDeleteCmd, one arg} { namespace eval test_ns_1::test_ns_2 {} namespace delete ::test_ns_1 } {} test namespace-24.3 {NamespaceDeleteCmd, two args} { namespace eval test_ns_1::test_ns_2 {} list [namespace delete ::test_ns_1::test_ns_2] [namespace delete ::test_ns_1] } {{} {}} test namespace-24.4 {NamespaceDeleteCmd, unknown ns} { list [catch {namespace delete ::test_ns_foo} msg] $msg } {1 {unknown namespace "::test_ns_foo" in namespace delete command}} test namespace-25.1 {NamespaceEvalCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace eval} msg] $msg } {1 {wrong # args: should be "namespace eval name arg ?arg...?"}} test namespace-25.2 {NamespaceEvalCmd, bad args} -body { namespace test_ns_1 } -returnCodes error -match glob -result {unknown or ambiguous subcommand "test_ns_1": must be *} catch {unset v} test namespace-25.3 {NamespaceEvalCmd, new namespace} { set v 123 namespace eval test_ns_1 { variable v 314159 proc p {} { variable v return $v } } test_ns_1::p } {314159} test namespace-25.4 {NamespaceEvalCmd, existing namespace} -setup { namespace eval test_ns_1 { variable v 314159 proc p {} { variable v return $v } } } -body { namespace eval test_ns_1 { proc q {} {return [expr {[p]+1}]} } test_ns_1::q } -result {314160} test namespace-25.5 {NamespaceEvalCmd, multiple args} -setup { namespace eval test_ns_1 {variable v 314159} } -body { namespace eval test_ns_1 "set" "v" } -result {314159} test namespace-25.6 {NamespaceEvalCmd, error in eval'd script} { list [catch {namespace eval test_ns_1 {xxxx}} msg] $msg $::errorInfo } {1 {invalid command name "xxxx"} {invalid command name "xxxx" while executing "xxxx" (in namespace eval "::test_ns_1" script line 1) invoked from within "namespace eval test_ns_1 {xxxx}"}} test namespace-25.7 {NamespaceEvalCmd, error in eval'd script} { list [catch {namespace eval test_ns_1 {error foo bar baz}} msg] $msg $::errorInfo } {1 foo {bar (in namespace eval "::test_ns_1" script line 1) invoked from within "namespace eval test_ns_1 {error foo bar baz}"}} test namespace-25.8 {NamespaceEvalCmd, error in eval'd script} { list [catch {namespace eval test_ns_1 error foo bar baz} msg] $msg $::errorInfo } {1 foo {bar (in namespace eval "::test_ns_1" script line 1) invoked from within "namespace eval test_ns_1 error foo bar baz"}} catch {unset v} test namespace-25.9 {NamespaceEvalCmd, 545325} { namespace eval test_ns_1 info level 0 } {namespace eval test_ns_1 info level 0} test namespace-26.1 {NamespaceExportCmd, no args and new ns} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace export } {} test namespace-26.2 {NamespaceExportCmd, just -clear arg} { namespace export -clear } {} test namespace-26.3 {NamespaceExportCmd, pattern can't specify a namespace} { namespace eval test_ns_1 { list [catch {namespace export ::zzz} msg] $msg } } {1 {invalid export pattern "::zzz": pattern can't specify a namespace}} test namespace-26.4 {NamespaceExportCmd, one pattern} { namespace eval test_ns_1 { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} } namespace eval test_ns_2 { namespace import ::test_ns_1::* } list [info commands test_ns_2::*] [test_ns_2::cmd1 hello] } {::test_ns_2::cmd1 {cmd1: hello}} test namespace-26.5 {NamespaceExportCmd, sequence of patterns, patterns accumulate} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} namespace export cmd1 cmd3 } } -body { namespace eval test_ns_2 { namespace import -force ::test_ns_1::* } list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd3 hello] } -result {{::test_ns_2::cmd1 ::test_ns_2::cmd3} {cmd3: hello}} test namespace-26.6 {NamespaceExportCmd, no patterns means return uniq'ed export list} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} namespace export cmd1 cmd3 } } -body { namespace eval test_ns_1 { namespace export } } -result {cmd1 cmd3} test namespace-26.7 {NamespaceExportCmd, -clear resets export list} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} } } -body { namespace eval test_ns_1 { namespace export cmd1 cmd3 } namespace eval test_ns_2 { namespace import ::test_ns_1::* } namespace eval test_ns_1 { namespace export -clear cmd4 } namespace eval test_ns_2 { namespace import ::test_ns_1::* } list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd4 hello] } -result [list [lsort {::test_ns_2::cmd4 ::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd4: hello}] test namespace-26.8 {NamespaceExportCmd, -clear resets export list} { catch {namespace delete foo} namespace eval foo { namespace export x namespace export -clear } list [namespace eval foo namespace export] [namespace delete foo] } {{} {}} test namespace-27.1 {NamespaceForgetCmd, no args} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace forget } {} test namespace-27.2 {NamespaceForgetCmd, args must be valid namespaces} { list [catch {namespace forget ::test_ns_1::xxx} msg] $msg } {1 {unknown namespace in namespace forget pattern "::test_ns_1::xxx"}} test namespace-27.3 {NamespaceForgetCmd, arg is forgotten} { namespace eval test_ns_1 { namespace export cmd* proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace import ::test_ns_1::* namespace forget ::test_ns_1::cmd1 } info commands ::test_ns_2::* } {::test_ns_2::cmd2} test namespace-28.1 {NamespaceImportCmd, no args} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval ::test_ns_1 { proc foo {} {} proc bar {} {} proc boo {} {} proc glorp {} {} namespace export foo b* } namespace eval ::test_ns_2 { namespace import ::test_ns_1::* lsort [namespace import] } } -cleanup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -result {bar boo foo} test namespace-28.2 {NamespaceImportCmd, no args and just "-force"} { namespace import -force } {} test namespace-28.3 {NamespaceImportCmd, arg is imported} { namespace eval test_ns_1 { namespace export cmd2 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace import ::test_ns_1::* namespace forget ::test_ns_1::cmd1 } info commands test_ns_2::* } {::test_ns_2::cmd2} test namespace-29.1 {NamespaceInscopeCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace inscope} msg] $msg } {1 {wrong # args: should be "namespace inscope name arg ?arg...?"}} test namespace-29.2 {NamespaceInscopeCmd, bad args} { list [catch {namespace inscope ::} msg] $msg } {1 {wrong # args: should be "namespace inscope name arg ?arg...?"}} test namespace-29.3 {NamespaceInscopeCmd, specified ns must exist} -body { namespace inscope test_ns_1 {set v} } -returnCodes error -result {namespace "test_ns_1" not found in "::"} test namespace-29.4 {NamespaceInscopeCmd, simple case} { namespace eval test_ns_1 { variable v 747 proc cmd {args} { variable v return "[namespace current]::cmd: v=$v, args=$args" } } namespace inscope test_ns_1 cmd } {::test_ns_1::cmd: v=747, args=} test namespace-29.5 {NamespaceInscopeCmd, has lappend semantics} -setup { namespace eval test_ns_1 { variable v 747 proc cmd {args} { variable v return "[namespace current]::cmd: v=$v, args=$args" } } } -body { list [namespace inscope test_ns_1 cmd x y z] \ [namespace eval test_ns_1 [concat cmd [list x y z]]] } -result {{::test_ns_1::cmd: v=747, args=x y z} {::test_ns_1::cmd: v=747, args=x y z}} test namespace-29.6 {NamespaceInscopeCmd, 1400572} -setup { namespace eval test_ns_1 {} } -body { namespace inscope test_ns_1 {info level 0} } -result {namespace inscope test_ns_1 {info level 0}} test namespace-30.1 {NamespaceOriginCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace origin} msg] $msg } {1 {wrong # args: should be "namespace origin name"}} test namespace-30.2 {NamespaceOriginCmd, bad args} { list [catch {namespace origin x y} msg] $msg } {1 {wrong # args: should be "namespace origin name"}} test namespace-30.3 {NamespaceOriginCmd, command not found} { list [catch {namespace origin fred} msg] $msg } {1 {invalid command name "fred"}} test namespace-30.4 {NamespaceOriginCmd, command isn't imported} { namespace origin set } {::set} test namespace-30.5 {NamespaceOriginCmd, imported command} { namespace eval test_ns_1 { namespace export cmd* proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace export * namespace import ::test_ns_1::* proc p {} {} } namespace eval test_ns_3 { namespace import ::test_ns_2::* list [namespace origin foreach] \ [namespace origin p] \ [namespace origin cmd1] \ [namespace origin ::test_ns_2::cmd2] } } {::foreach ::test_ns_2::p ::test_ns_1::cmd1 ::test_ns_1::cmd2} test namespace-31.1 {NamespaceParentCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace parent a b} msg] $msg } {1 {wrong # args: should be "namespace parent ?name?"}} test namespace-31.2 {NamespaceParentCmd, no args} { namespace parent } {} test namespace-31.3 {NamespaceParentCmd, namespace specified} { namespace eval test_ns_1 { namespace eval test_ns_2 { namespace eval test_ns_3 {} } } list [namespace parent ::] \ [namespace parent test_ns_1::test_ns_2] \ [namespace eval test_ns_1::test_ns_2::test_ns_3 {namespace parent ::test_ns_1::test_ns_2}] } {{} ::test_ns_1 ::test_ns_1} test namespace-31.4 {NamespaceParentCmd, bad namespace specified} -body { namespace parent test_ns_1::test_ns_foo } -returnCodes error -result {namespace "test_ns_1::test_ns_foo" not found in "::"} test namespace-32.1 {NamespaceQualifiersCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace qualifiers} msg] $msg } {1 {wrong # args: should be "namespace qualifiers string"}} test namespace-32.2 {NamespaceQualifiersCmd, bad args} { list [catch {namespace qualifiers x y} msg] $msg } {1 {wrong # args: should be "namespace qualifiers string"}} test namespace-32.3 {NamespaceQualifiersCmd, simple name} { namespace qualifiers foo } {} test namespace-32.4 {NamespaceQualifiersCmd, leading ::} { namespace qualifiers ::x::y::z } {::x::y} test namespace-32.5 {NamespaceQualifiersCmd, no leading ::} { namespace qualifiers a::b } {a} test namespace-32.6 {NamespaceQualifiersCmd, :: argument} { namespace qualifiers :: } {} test namespace-32.7 {NamespaceQualifiersCmd, odd number of :s} { namespace qualifiers ::::: } {} test namespace-32.8 {NamespaceQualifiersCmd, odd number of :s} { namespace qualifiers foo::: } {foo} test namespace-33.1 {NamespaceTailCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace tail} msg] $msg } {1 {wrong # args: should be "namespace tail string"}} test namespace-33.2 {NamespaceTailCmd, bad args} { list [catch {namespace tail x y} msg] $msg } {1 {wrong # args: should be "namespace tail string"}} test namespace-33.3 {NamespaceTailCmd, simple name} { namespace tail foo } {foo} test namespace-33.4 {NamespaceTailCmd, leading ::} { namespace tail ::x::y::z } {z} test namespace-33.5 {NamespaceTailCmd, no leading ::} { namespace tail a::b } {b} test namespace-33.6 {NamespaceTailCmd, :: argument} { namespace tail :: } {} test namespace-33.7 {NamespaceTailCmd, odd number of :s} { namespace tail ::::: } {} test namespace-33.8 {NamespaceTailCmd, odd number of :s} { namespace tail foo::: } {} test namespace-34.1 {NamespaceWhichCmd, bad args} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {namespace which} msg] $msg } {1 {wrong # args: should be "namespace which ?-command? ?-variable? name"}} test namespace-34.2 {NamespaceWhichCmd, bad args} { list [catch {namespace which -fred x} msg] $msg } {1 {wrong # args: should be "namespace which ?-command? ?-variable? name"}} test namespace-34.3 {NamespaceWhichCmd, single arg is always command name} { namespace which -command } {} test namespace-34.4 {NamespaceWhichCmd, bad args} { list [catch {namespace which a b} msg] $msg } {1 {wrong # args: should be "namespace which ?-command? ?-variable? name"}} test namespace-34.5 {NamespaceWhichCmd, command lookup} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { namespace export cmd* variable v1 111 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace export * namespace import ::test_ns_1::* variable v2 222 proc p {} {} } } -body { namespace eval test_ns_3 { namespace import ::test_ns_2::* variable v3 333 list [namespace which -command foreach] \ [namespace which -command p] \ [namespace which -command cmd1] \ [namespace which -command ::test_ns_2::cmd2] \ [catch {namespace which -command ::test_ns_2::noSuchCmd} msg] $msg } } -result {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2 0 {}} test namespace-34.6 {NamespaceWhichCmd, -command is default} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { namespace export cmd* proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace export * namespace import ::test_ns_1::* proc p {} {} } namespace eval test_ns_3 { namespace import ::test_ns_2::* } } -body { namespace eval test_ns_3 { list [namespace which foreach] \ [namespace which p] \ [namespace which cmd1] \ [namespace which ::test_ns_2::cmd2] } } -result {::foreach ::test_ns_3::p ::test_ns_3::cmd1 ::test_ns_2::cmd2} # TIP 278: secondary lookup disabled, catch added, result changed test namespace-34.7 {NamespaceWhichCmd, variable lookup} -setup { catch {namespace delete {*}[namespace children test_ns_*]} namespace eval test_ns_1 { namespace export cmd* proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_2 { namespace export * namespace import ::test_ns_1::* variable v2 222 proc p {} {} } namespace eval test_ns_3 { variable v3 333 namespace import ::test_ns_2::* } } -body { namespace eval test_ns_3 { list [catch {namespace which -variable env } msg] $msg \ [namespace which -variable v3] \ [namespace which -variable ::test_ns_2::v2] \ [catch {namespace which -variable ::test_ns_2::noSuchVar} msg] $msg } } -result {0 {} ::test_ns_3::v3 ::test_ns_2::v2 0 {}} test namespace-35.1 {FreeNsNameInternalRep, resulting ref count > 0} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} } -body { namespace eval test_ns_1 { proc p {} { namespace delete [namespace current] return [namespace current] } } test_ns_1::p } -result {::test_ns_1} test namespace-35.2 {FreeNsNameInternalRep, resulting ref count == 0} { namespace eval test_ns_1 { proc q {} { return [namespace current] } } list [test_ns_1::q] \ [namespace delete test_ns_1] \ [catch {test_ns_1::q} msg] $msg } {::test_ns_1 {} 1 {invalid command name "test_ns_1::q"}} catch {unset x} catch {unset y} test namespace-36.1 {DupNsNameInternalRep} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1 {} set x "::test_ns_1" list [namespace parent $x] [set y $x] [namespace parent $y] } {:: ::test_ns_1 ::} catch {unset x} catch {unset y} test namespace-37.1 {SetNsNameFromAny, ns name found} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_1::test_ns_2 {} namespace eval test_ns_1 { namespace children ::test_ns_1 } } {::test_ns_1::test_ns_2} test namespace-37.2 {SetNsNameFromAny, ns name not found} -body { namespace eval test_ns_1 { namespace children ::test_ns_1::test_ns_foo } } -returnCodes error -result {namespace "::test_ns_1::test_ns_foo" not found} test namespace-38.1 {UpdateStringOfNsName} { catch {namespace delete {*}[namespace children :: test_ns_*]} ;# Tcl_NamespaceObjCmd calls UpdateStringOfNsName to get subcmd name list [namespace eval {} {namespace current}] \ [namespace eval {} {namespace current}] } {:: ::} test namespace-39.1 {NamespaceExistsCmd} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval ::test_ns_z::test_me { variable foo } list [namespace exists ::] \ [namespace exists ::bogus_namespace] \ [namespace exists ::test_ns_z] \ [namespace exists test_ns_z] \ [namespace exists ::test_ns_z::foo] \ [namespace exists ::test_ns_z::test_me] \ [namespace eval ::test_ns_z { namespace exists ::test_me }] \ [namespace eval ::test_ns_z { namespace exists test_me }] \ [namespace exists :::::test_ns_z] } {1 0 1 1 0 1 0 1 1} test namespace-39.2 {NamespaceExistsCmd error} { list [catch {namespace exists} msg] $msg } {1 {wrong # args: should be "namespace exists name"}} test namespace-39.3 {NamespaceExistsCmd error} { list [catch {namespace exists a b} msg] $msg } {1 {wrong # args: should be "namespace exists name"}} test namespace-40.1 {Ignoring namespace proc "unknown"} -setup { rename unknown _unknown } -body { proc unknown args {return global} namespace eval ns {proc unknown args {return local}} list [namespace eval ns aaa bbb] [namespace eval ns aaa] } -cleanup { rename unknown {} rename _unknown unknown namespace delete ns } -result {global global} test namespace-41.1 {Shadowing byte-compiled commands, Bug: 231259} { set res {} namespace eval ns { set res {} proc test {} { set ::g 0 } lappend ::res [test] proc set {a b} { ::set a [incr b] } lappend ::res [test] } namespace delete ns set res } {0 1} test namespace-41.2 {Shadowing byte-compiled commands, Bug: 231259} { set res {} namespace eval ns {} proc ns::a {i} { variable b proc set args {return "New proc is called"} return [set b $i] } ns::a 1 set res [ns::a 2] namespace delete ns set res } {New proc is called} test namespace-41.3 {Shadowing byte-compiled commands, Bugs: 231259, 729692} { set res {} namespace eval ns { variable b 0 } proc ns::a {i} { variable b proc set args {return "New proc is called"} return [set b $i] } set res [list [ns::a 1] $ns::b] namespace delete ns set res } {{New proc is called} 0} # Ensembles (TIP#112) test namespace-42.1 {ensembles: basic} { namespace eval ns { namespace export x proc x {} {format 1} namespace ensemble create } list [info command ns] [ns x] [namespace delete ns] [info command ns] } {ns 1 {} {}} test namespace-42.2 {ensembles: basic} { namespace eval ns { namespace export x proc x {} {format 1} namespace ensemble create } rename ns foo list [info command foo] [foo x] [namespace delete ns] [info command foo] } {foo 1 {} {}} test namespace-42.3 {ensembles: basic} { namespace eval ns { namespace export x* proc x1 {} {format 1} proc x2 {} {format 2} namespace ensemble create } set result [list [ns x1] [ns x2]] lappend result [catch {ns x} msg] $msg rename ns {} lappend result [info command ns::x1] namespace delete ns lappend result [info command ns::x1] } {1 2 1 {unknown or ambiguous subcommand "x": must be x1, or x2} ::ns::x1 {}} test namespace-42.4 {ensembles: basic} -body { namespace eval ns { namespace export y* proc x1 {} {format 1} proc x2 {} {format 2} namespace ensemble create } list [catch {ns x} msg] $msg } -cleanup { namespace delete ns } -result {1 {unknown subcommand "x": namespace ::ns does not export any commands}} test namespace-42.5 {ensembles: basic} -body { namespace eval ns { namespace export x* proc x1 {} {format 1} proc x2 {} {format 2} proc x3 {} {format 3} namespace ensemble create } list [catch {ns x} msg] $msg } -cleanup { namespace delete ns } -result {1 {unknown or ambiguous subcommand "x": must be x1, x2, or x3}} test namespace-42.6 {ensembles: nested} -body { namespace eval ns { namespace export x* namespace eval x0 { proc z {} {format 0} namespace export z namespace ensemble create } proc x1 {} {format 1} proc x2 {} {format 2} proc x3 {} {format 3} namespace ensemble create } list [ns x0 z] [ns x1] [ns x2] [ns x3] } -cleanup { namespace delete ns } -result {0 1 2 3} test namespace-42.7 {ensembles: nested} -body { namespace eval ns { namespace export x* namespace eval x0 { proc z {} {list [info level] [info level 1]} namespace export z namespace ensemble create } proc x1 {} {format 1} proc x2 {} {format 2} proc x3 {} {format 3} namespace ensemble create } list [ns x0 z] [ns x1] [ns x2] [ns x3] } -cleanup { namespace delete ns } -result {{1 ::ns::x0::z} 1 2 3} test namespace-42.8 { ensembles: [Bug 1670091], panic due to pointer to a deallocated List struct. } -setup { proc demo args {} variable target [list [namespace which demo] x] proc trial args {variable target; string length $target} trace add execution demo enter [namespace code trial] namespace ensemble create -command foo -map [list bar $target] } -body { foo bar } -cleanup { unset target rename demo {} rename trial {} rename foo {} } -result {} test namespace-42.9 { ensembles: [Bug 4f6a1ebd64], segmentation fault due to pointer to a deallocated List struct. } -setup { namespace eval n {namespace ensemble create} set lst [dict create one ::two] namespace ensemble configure n -subcommands $lst -map $lst } -body { n one } -cleanup { namespace delete n unset -nocomplain lst } -returnCodes error -match glob -result {invalid command name*} test namespace-42.10 { ensembles: [Bug 4f6a1ebd64] segmentation fault due to pointer to a deallocated List struct (this time with duplicate of one in "dict"). } -setup { namespace eval n {namespace ensemble create} set lst [list one ::two one ::three] namespace ensemble configure n -subcommands $lst -map $lst } -body { n one } -cleanup { namespace delete n unset -nocomplain lst } -returnCodes error -match glob -result {invalid command name *three*} test namespace-42.11 { ensembles: prefix matching segmentation fault issue ccc448a6bfd59cbd } -body { namespace eval n1 { namespace ensemble create namespace export * proc p1 args {error success} } # segmentation fault only occurs in the non-byte-compiled path, so avoid # byte compilation set cmd {namespace eva n1 {[namespace parent]::n1 p1}} {*}$cmd } -returnCodes error -result success test namespace-43.1 {ensembles: dict-driven} { namespace eval ns { namespace export x* proc x1 {} {format 1} proc x2 {} {format 2} namespace ensemble create -map {a x1 b x2} } set result [list [catch {ns c} msg] $msg [namespace ensemble exists ns]] rename ns {} lappend result [namespace ensemble exists ns] } {1 {unknown or ambiguous subcommand "c": must be a, or b} 1 0} test namespace-43.2 {ensembles: dict-driven} -body { namespace eval ns { namespace export x* proc x1 {args} {list 1 $args} proc x2 {args} {list 2 [llength $args]} namespace ensemble create -map { a ::ns::x1 b ::ns::x2 c {::ns::x1 .} d {::ns::x2 .} } } list [ns a] [ns b] [ns c] [ns c foo] [ns d] [ns d foo] } -cleanup { namespace delete ns } -result {{1 {}} {2 0} {1 .} {1 {. foo}} {2 1} {2 2}} set SETUP { namespace eval ns { namespace export a b proc a args {format 1,[llength $args]} proc b args {format 2,[llength $args]} proc c args {format 3,[llength $args]} proc d args {format 4,[llength $args]} namespace ensemble create -subcommands {b c} } } test namespace-43.3 {ensembles: list-driven} -setup $SETUP -body { namespace delete ns } -result {} test namespace-43.4 {ensembles: list-driven} -setup $SETUP -body { ns a foo bar boo spong wibble } -cleanup {namespace delete ns} -returnCodes error -result {unknown or ambiguous subcommand "a": must be b, or c} test namespace-43.5 {ensembles: list-driven} -setup $SETUP -body { ns b foo bar boo spong wibble } -cleanup {namespace delete ns} -result 2,5 test namespace-43.6 {ensembles: list-driven} -setup $SETUP -body { ns c foo bar boo spong wibble } -cleanup {namespace delete ns} -result 3,5 test namespace-43.7 {ensembles: list-driven} -setup $SETUP -body { ns d foo bar boo spong wibble } -cleanup {namespace delete ns} -returnCodes error -result {unknown or ambiguous subcommand "d": must be b, or c} set SETUP { namespace eval ns { namespace export a b proc a args {format 1,[llength $args]} proc b args {format 2,[llength $args]} proc c args {format 3,[llength $args]} proc d args {format 4,[llength $args]} namespace ensemble create -subcommands {b c} -map {c ::ns::d} } } test namespace-43.8 {ensembles: list-and-map-driven} -setup $SETUP -body { namespace delete ns } -result {} test namespace-43.9 {ensembles: list-and-map-driven} -setup $SETUP -body { ns a foo bar boo spong wibble } -cleanup {namespace delete ns} -returnCodes error -result {unknown or ambiguous subcommand "a": must be b, or c} test namespace-43.10 {ensembles: list-and-map-driven} -setup $SETUP -body { ns b foo bar boo spong wibble } -cleanup {namespace delete ns} -result 2,5 test namespace-43.11 {ensembles: list-and-map-driven} -setup $SETUP -body { ns c foo bar boo spong wibble } -cleanup {namespace delete ns} -result 4,5 test namespace-43.12 {ensembles: list-and-map-driven} -setup $SETUP -body { ns d foo bar boo spong wibble } -cleanup {namespace delete ns} -returnCodes error -result {unknown or ambiguous subcommand "d": must be b, or c} set SETUP { namespace eval ns { namespace export * proc foo args {format bar} proc spong args {format wibble} namespace ensemble create -prefixes off } } test namespace-43.13 {ensembles: turn off prefixes} -setup $SETUP -body { namespace delete ns } -result {} test namespace-43.14 {ensembles: turn off prefixes} -setup $SETUP -body { ns fo } -cleanup {namespace delete ns} -returnCodes error -result {unknown subcommand "fo": must be foo, or spong} test namespace-43.15 {ensembles: turn off prefixes} -setup $SETUP -body { ns foo } -cleanup {namespace delete ns} -result bar test namespace-43.16 {ensembles: turn off prefixes} -setup $SETUP -body { ns s } -cleanup {namespace delete ns} -returnCodes error -result {unknown subcommand "s": must be foo, or spong} test namespace-43.17 {ensembles: turn off prefixes} -setup $SETUP -body { ns spong } -cleanup {namespace delete ns} -result wibble test namespace-44.1 {ensemble: errors} { list [catch {namespace ensemble} msg] $msg } {1 {wrong # args: should be "namespace ensemble subcommand ?arg ...?"}} test namespace-44.2 {ensemble: errors} { list [catch {namespace ensemble ?} msg] $msg } {1 {bad subcommand "?": must be configure, create, or exists}} test namespace-44.3 {ensemble: errors} { namespace eval ns { list [catch {namespace ensemble create -map x} msg] $msg } } {1 {missing value to go with key}} test namespace-44.4 {ensemble: errors} { namespace eval ns { list [catch {namespace ensemble create -map {x {}}} msg] $msg } } {1 {ensemble subcommand implementations must be non-empty lists}} test namespace-44.5 {ensemble: errors} -setup { namespace ensemble create -command foobar -subcommands {foobarcget foobarconfigure} } -body { foobar foobarcon } -cleanup { rename foobar {} } -returnCodes error -result {invalid command name "foobarconfigure"} test namespace-44.6 {ensemble: errors} -returnCodes error -body { namespace ensemble create gorp } -result {wrong # args: should be "namespace ensemble create ?option value ...?"} test namespace-45.1 {ensemble: introspection} { namespace eval ns { namespace export x proc x {} {} namespace ensemble create set ::result [namespace ensemble configure ::ns] } namespace delete ns set result } {-map {} -namespace ::ns -parameters {} -prefixes 1 -subcommands {} -unknown {}} test namespace-45.2 {ensemble: introspection} { namespace eval ns { namespace export x proc x {} {} namespace ensemble create -map {A x} set ::result [namespace ensemble configure ::ns -map] } namespace delete ns set result } {A ::ns::x} test namespace-46.1 {ensemble: modification} { namespace eval ns { namespace export x proc x {} {format 123} # Ensemble maps A->x namespace ensemble create -command ns -map {A ::ns::x} set ::result [list [namespace ensemble configure ns -map] [ns A]] # Ensemble maps B->x namespace ensemble configure ns -map {B ::ns::x} lappend ::result [namespace ensemble configure ns -map] [ns B] # Ensemble maps x->x namespace ensemble configure ns -map {} lappend ::result [namespace ensemble configure ns -map] [ns x] } namespace delete ns set result } {{A ::ns::x} 123 {B ::ns::x} 123 {} 123} test namespace-46.2 {ensemble: ensembles really use current export list} { namespace eval ns { namespace export x1 proc x1 {} {format 1} proc x2 {} {format 1} namespace ensemble create } catch {ns ?} msg; set result [list $msg] namespace eval ns {namespace export x*} catch {ns ?} msg; lappend result $msg rename ns::x1 {} catch {ns ?} msg; lappend result $msg namespace delete ns set result } {{unknown or ambiguous subcommand "?": must be x1} {unknown or ambiguous subcommand "?": must be x1, or x2} {unknown or ambiguous subcommand "?": must be x2}} test namespace-46.3 {ensemble: implementation errors} { namespace eval ns { variable count 0 namespace ensemble create -map { a {::lappend ::result} b {::incr ::ns::count} } } set result {} lappend result [catch { ns } msg] $msg ns a [ns b 10] catch {rename p {}} rename ns p p a [p b 3000] lappend result $ns::count namespace delete ns lappend result [info command p] } {1 {wrong # args: should be "ns subcommand ?arg ...?"} 10 3010 3010 {}} test namespace-46.4 {ensemble: implementation errors} { namespace eval ns { namespace ensemble create } set result [info command ns] lappend result [catch {ns ?} msg] $msg namespace delete ns set result } {ns 1 {unknown subcommand "?": namespace ::ns does not export any commands}} test namespace-46.5 {ensemble: implementation errors} { namespace eval ns { namespace ensemble create -map {makeError ::error} } list [catch {ns makeError "an error happened"} msg] $msg $::errorInfo [namespace delete ns] } {1 {an error happened} {an error happened while executing "ns makeError "an error happened""} {}} test namespace-46.6 {ensemble: implementation renames/deletes itself} { namespace eval ns { namespace ensemble create -map {to ::rename} } ns to ns foo foo to foo bar bar to bar spong spong to spong {} namespace delete ns } {} test namespace-46.7 {ensemble: implementation deletes its namespace} { namespace eval ns { namespace ensemble create -map {kill {::namespace delete}} } ns kill ns } {} test namespace-46.8 {ensemble: implementation deletes its namespace} { namespace eval ns { namespace export * proc foo {} { variable x 1 bar # Tricky; what is the correct return value anyway? info exist x } proc bar {} { namespace delete [namespace current] } namespace ensemble create } list [ns foo] [info exist ns::x] } {1 0} test namespace-46.9 {ensemble: configuring really configures things} { namespace eval ns { namespace ensemble create -map {a a} -prefixes 0 } set result [list [catch {ns x} msg] $msg] namespace ensemble configure ns -map {b b} lappend result [catch {ns x} msg] $msg namespace delete ns set result } {1 {unknown subcommand "x": must be a} 1 {unknown subcommand "x": must be b}} test namespace-47.1 {ensemble: unknown handler} { set log {} namespace eval ns { namespace export {[a-z]*} proc Magic {ensemble subcmd args} { global log if {[string match {[a-z]*} $subcmd]} { lappend log "making $subcmd" proc $subcmd args { global log lappend log "running [info level 0]" llength $args } } else { lappend log "unknown $subcmd - args = $args" return -code error \ "unknown or protected subcommand \"$subcmd\"" } } namespace ensemble create -unknown ::ns::Magic } set result {} lappend result [catch {ns a b c} msg] $msg lappend result [catch {ns a b c} msg] $msg lappend result [catch {ns b c d} msg] $msg lappend result [catch {ns c d e} msg] $msg lappend result [catch {ns Magic foo bar spong wibble} msg] $msg list $result [lsort [info commands ::ns::*]] $log [namespace delete ns] } {{0 2 0 2 0 2 0 2 1 {unknown or protected subcommand "Magic"}} {::ns::Magic ::ns::a ::ns::b ::ns::c} {{making a} {running ::ns::a b c} {running ::ns::a b c} {making b} {running ::ns::b c d} {making c} {running ::ns::c d e} {unknown Magic - args = foo bar spong wibble}} {}} test namespace-47.2 {ensemble: unknown handler} { namespace eval ns { namespace export {[a-z]*} proc Magic {ensemble subcmd args} { error foobar } namespace ensemble create -unknown ::ns::Magic } list [catch {ns spong} msg] $msg $::errorInfo [namespace delete ns] } {1 foobar {foobar while executing "error foobar" (procedure "::ns::Magic" line 2) invoked from within "::ns::Magic ::ns spong" (ensemble unknown subcommand handler) invoked from within "ns spong"} {}} test namespace-47.3 {ensemble: unknown handler} { namespace eval ns { variable count 0 namespace export {[a-z]*} proc a {} {} proc c {} {} proc Magic {ensemble subcmd args} { variable count incr count proc b {} {} } namespace ensemble create -unknown ::ns::Magic } list [catch {ns spong} msg] $msg $ns::count [namespace delete ns] } {1 {unknown or ambiguous subcommand "spong": must be a, b, or c} 1 {}} test namespace-47.4 {ensemble: unknown handler} { namespace eval ns { namespace export {[a-z]*} proc Magic {ensemble subcmd args} { return -code break } namespace ensemble create -unknown ::ns::Magic } list [catch {ns spong} msg] $msg $::errorInfo [namespace delete ns] } {1 {unknown subcommand handler returned bad code: break} {unknown subcommand handler returned bad code: break result of ensemble unknown subcommand handler: ::ns::Magic ::ns spong invoked from within "ns spong"} {}} test namespace-47.5 {ensemble: unknown handler} { namespace ensemble create -command foo -unknown bar proc bar {args} { global result target lappend result "LOG $args" return $target } set result {} set target {} lappend result [catch {foo bar} msg] $msg set target {lappend result boo hoo} lappend result [catch {foo bar} msg] $msg [namespace ensemble config foo] rename foo {} set result } {{LOG ::foo bar} 1 {unknown subcommand "bar": namespace :: does not export any commands} {LOG ::foo bar} boo hoo 0 {{LOG ::foo bar} 1 {unknown subcommand "bar": namespace :: does not export any commands} {LOG ::foo bar} boo hoo} {-map {} -namespace :: -parameters {} -prefixes 1 -subcommands {} -unknown bar}} test namespace-47.6 {ensemble: unknown handler} { namespace ensemble create -command foo -unknown bar proc bar {args} { return "\{" } set result [list [catch {foo bar} msg] $msg $::errorInfo] rename foo {} set result } {1 {unmatched open brace in list} {unmatched open brace in list while parsing result of ensemble unknown subcommand handler invoked from within "foo bar"}} test namespace-47.7 {ensemble: unknown handler, commands with spaces} { namespace ensemble create -command foo -unknown bar proc bar {args} { list ::set ::x [join $args |] } set result [foo {one two three}] rename foo {} set result } {::foo|one two three} test namespace-47.8 {ensemble: unknown handler, commands with spaces} { namespace ensemble create -command foo -unknown {bar boo} proc bar {args} { list ::set ::x [join $args |] } set result [foo {one two three}] rename foo {} set result } {boo|::foo|one two three} test namespace-48.1 {ensembles and namespace import: unknown handler} { namespace eval foo { namespace export bar namespace ensemble create -command bar -unknown ::foo::u -subcomm x proc u {ens args} { global result lappend result $ens $args namespace ensemble config $ens -subcommand {x y} } proc u2 {ens args} { global result lappend result $ens $args namespace ensemble config ::bar -subcommand {x y z} } proc x args { global result lappend result XXX $args } proc y args { global result lappend result YYY $args } proc z args { global result lappend result ZZZ $args } } namespace import -force foo::bar set result [list [namespace ensemble config bar]] bar x 123 bar y 456 namespace ensemble config bar -unknown ::foo::u2 bar z 789 namespace delete foo set result } {{-map {} -namespace ::foo -parameters {} -prefixes 1 -subcommands x -unknown ::foo::u} XXX 123 ::foo::bar {y 456} YYY 456 ::foo::bar {z 789} ZZZ 789} test namespace-48.2 {ensembles and namespace import: exists} { namespace eval foo { namespace ensemble create -command ::foo::bar namespace export bar } set result [namespace ensemble exist foo::bar] lappend result [namespace ensemble exist bar] namespace import foo::bar lappend result [namespace ensemble exist bar] rename foo::bar foo::bar2 lappend result [namespace ensemble exist bar] \ [namespace ensemble exist spong] rename bar spong lappend result [namespace ensemble exist bar] \ [namespace ensemble exist spong] rename foo::bar2 {} lappend result [namespace ensemble exist spong] namespace delete foo set result } {1 0 1 1 0 0 1 0} test namespace-48.3 {ensembles and namespace import: config} { catch {rename spong {}} namespace eval foo { namespace ensemble create -command ::foo::bar namespace export bar boo proc boo {} {} } namespace import foo::bar foo::boo set result [namespace ensemble config bar -namespace] lappend result [catch {namespace ensemble config boo} msg] $msg lappend result [catch {namespace ensemble config spong} msg] $msg namespace delete foo set result } {::foo 1 {"boo" is not an ensemble command} 1 {unknown command "spong"}} test namespace-49.1 {ensemble subcommand caching} -body { namespace ens cre -command a -map {b {lappend result 1}} namespace ens cre -command c -map {b {lappend result 2}} proc x {} {a b; c b; a b; c b} x } -result {1 2 1 2} -cleanup { rename a {} rename c {} rename x {} } test namespace-49.2 {strange delete crash} -body { namespace eval foo {namespace ensemble create -command ::bar} trace add command ::bar delete DeleteTrace proc DeleteTrace {old new op} { trace remove command ::bar delete DeleteTrace rename $old "" # This next line caused a bus error in [Bug 1220058] namespace delete foo } rename ::bar "" } -result "" -cleanup { rename DeleteTrace "" } test namespace-50.1 {ensembles affect proc arguments error messages} -body { namespace ens cre -command a -map {b {bb foo}} proc bb {c d {e f} args} {list $c $args} a b } -returnCodes error -result "wrong # args: should be \"a b d ?e? ?arg ...?\"" -cleanup { rename a {} rename bb {} } test namespace-50.2 {ensembles affect WrongNumArgs error messages} -body { namespace ens cre -command a -map {b {string is}} a b boolean } -returnCodes error -result "wrong # args: should be \"a b class ?-strict? ?-failindex var? str\"" -cleanup { rename a {} } test namespace-50.3 {chained ensembles affect error messages} -body { namespace ens cre -command a -map {b c} namespace ens cre -command c -map {d e} proc e f {} a b d } -returnCodes error -result "wrong # args: should be \"a b d f\"" -cleanup { rename a {} rename c {} } test namespace-50.4 {chained ensembles affect error messages} -body { namespace ens cre -command a -map {b {c d}} namespace ens cre -command c -map {d {e f}} proc e f {} a b d } -returnCodes error -result "wrong # args: should be \"a b\"" -cleanup { rename a {} rename c {} } test namespace-50.5 {[4402cfa58c]} -setup { proc bar {ev} {} proc bingo {xx} {} namespace ensemble create -command launch -map {foo bar event bingo} set result {} } -body { catch {launch foo} m; lappend result $m catch {launch ev} m; lappend result $m catch {launch foo} m; lappend result $m } -cleanup { rename launch {} rename bingo {} rename bar {} } -result {{wrong # args: should be "launch foo ev"} {wrong # args: should be "launch event xx"} {wrong # args: should be "launch foo ev"}} test namespace-50.6 {[4402cfa58c]} -setup { proc target {x y} {} namespace ensemble create -command e2 -map {s2 target} namespace ensemble create -command e1 -map {s1 e2} set result {} } -body { set s s catch {e1 s1 s2 a} m; lappend result $m catch {e1 $s s2 a} m; lappend result $m catch {e1 s1 $s a} m; lappend result $m catch {e1 $s $s a} m; lappend result $m } -cleanup { rename e1 {} rename e2 {} rename target {} } -result {{wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"} {wrong # args: should be "e1 s1 s2 x y"}} test namespace-50.7 {[4402cfa58c]} -setup { proc target {x y} {} namespace ensemble create -command e2 -map {s2 target} namespace ensemble create -command e1 -map {s1 e2} -parameters foo set result {} } -body { set s s catch {e1 s2 s1 a} m; lappend result $m catch {e1 $s s1 a} m; lappend result $m catch {e1 s2 $s a} m; lappend result $m catch {e1 $s $s a} m; lappend result $m } -cleanup { rename e1 {} rename e2 {} rename target {} } -result {{wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"} {wrong # args: should be "e1 s2 s1 x y"}} test namespace-50.8 {[f961d7d1dd]} -setup { proc target {} {} namespace ensemble create -command e -map {s target} -parameters {{a b}} } -body { e } -returnCodes error -result {wrong # args: should be "e {a b} subcommand ?arg ...?"} -cleanup { rename e {} rename target {} } test namespace-50.9 {[cea0344a51]} -body { namespace eval foo { namespace eval bar { namespace delete foo } } } -returnCodes error -result {unknown namespace "foo" in namespace delete command} test namespace-51.1 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } namespace path ::test_ns_1 } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } test_ns_1::test_ns_2::pathtestA } -result "global,2,global," -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} } test namespace-51.2 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { namespace path ::test_ns_1 proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } ::test_ns_1::test_ns_2::pathtestA } -result "1,2,global,::test_ns_1" -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} } test namespace-51.3 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } set result [::test_ns_1::test_ns_2::pathtestA] namespace eval ::test_ns_1::test_ns_2 { namespace path ::test_ns_1 } lappend result [::test_ns_1::test_ns_2::pathtestA] rename ::test_ns_1::pathtestB {} lappend result [::test_ns_1::test_ns_2::pathtestA] } -result "global,2,global, 1,2,global,::test_ns_1 global,2,global,::test_ns_1" -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} } test namespace-51.4 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } set result [::test_ns_1::test_ns_2::pathtestA] namespace eval ::test_ns_1::test_ns_2 { namespace path ::test_ns_1 } lappend result [::test_ns_1::test_ns_2::pathtestA] namespace eval ::test_ns_1::test_ns_2 { namespace path {} } lappend result [::test_ns_1::test_ns_2::pathtestA] } -result "global,2,global, 1,2,global,::test_ns_1 global,2,global," -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} } test namespace-51.5 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } namespace path ::test_ns_1 } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } proc pathtestD {} { return 1 } } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } set result [::test_ns_1::test_ns_2::pathtestA] namespace eval ::test_ns_1::test_ns_2 { namespace path {:: ::test_ns_1} } lappend result [::test_ns_1::test_ns_2::pathtestA] rename ::test_ns_1::test_ns_2::pathtestC {} lappend result [::test_ns_1::test_ns_2::pathtestA] } -result "1,2,1,::test_ns_1 {global,2,global,:: ::test_ns_1} {global,1,global,:: ::test_ns_1}" -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} } test namespace-51.6 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc pathtestA {} { ::return [pathtestB],[pathtestC],[pathtestD],[namespace path] } proc pathtestC {} { ::return 2 } namespace path ::test_ns_1 } proc pathtestB {} { return 1 } proc pathtestC {} { return 1 } proc pathtestD {} { return 1 } } proc ::pathtestB {} { return global } proc ::pathtestD {} { return global } set result [::test_ns_1::test_ns_2::pathtestA] namespace eval ::test_ns_1::test_ns_2 { namespace path {:: ::test_ns_1} } lappend result [::test_ns_1::test_ns_2::pathtestA] rename ::test_ns_1::test_ns_2::pathtestC {} lappend result [::test_ns_1::test_ns_2::pathtestA] proc ::pathtestC {} { return global } lappend result [::test_ns_1::test_ns_2::pathtestA] } -result "1,2,1,::test_ns_1 {global,2,global,:: ::test_ns_1} {global,1,global,:: ::test_ns_1} {global,global,global,:: ::test_ns_1}" -cleanup { namespace delete ::test_ns_1 catch {rename ::pathtestB {}} catch {rename ::pathtestD {}} catch {rename ::pathtestC {}} } test namespace-51.7 {name resolution path control} -body { namespace eval ::test_ns_1 { } namespace eval ::test_ns_2 { namespace path ::test_ns_1 proc getpath {} {namespace path} } list [::test_ns_2::getpath] [namespace delete ::test_ns_1] [::test_ns_2::getpath] } -result {::test_ns_1 {} {}} -cleanup { catch {namespace delete ::test_ns_1} namespace delete ::test_ns_2 } test namespace-51.8 {name resolution path control} -body { namespace eval ::test_ns_1 { } namespace eval ::test_ns_2 { } namespace eval ::test_ns_3 { } namespace eval ::test_ns_4 { namespace path {::test_ns_1 ::test_ns_2 ::test_ns_3} proc getpath {} {namespace path} } list [::test_ns_4::getpath] [namespace delete ::test_ns_2] [::test_ns_4::getpath] } -result {{::test_ns_1 ::test_ns_2 ::test_ns_3} {} {::test_ns_1 ::test_ns_3}} -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} catch {namespace delete ::test_ns_4} } test namespace-51.9 {name resolution path control} -body { namespace eval ::test_ns_1 { } namespace eval ::test_ns_2 { } namespace eval ::test_ns_3 { } namespace eval ::test_ns_4 { namespace path {::test_ns_1 ::test_ns_2 ::test_ns_3} proc getpath {} {namespace path} } list [::test_ns_4::getpath] [namespace delete ::test_ns_2] [namespace eval ::test_ns_2 {}] [::test_ns_4::getpath] } -result {{::test_ns_1 ::test_ns_2 ::test_ns_3} {} {} {::test_ns_1 ::test_ns_3}} -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} catch {namespace delete ::test_ns_4} } test namespace-51.10 {name resolution path control} -body { namespace eval ::test_ns_1 { namespace path does::not::exist } } -returnCodes error -result {namespace "does::not::exist" not found in "::test_ns_1"} -cleanup { catch {namespace delete ::test_ns_1} } test namespace-51.11 {name resolution path control} -body { namespace eval ::test_ns_1 { proc foo {} {return 1} } namespace eval ::test_ns_2 { proc foo {} {return 2} } namespace eval ::test_ns_3 { namespace path ::test_ns_1 } namespace eval ::test_ns_4 { namespace path {::test_ns_3 ::test_ns_2} foo } } -result 2 -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} catch {namespace delete ::test_ns_4} } test namespace-51.12 {name resolution path control} -body { namespace eval ::test_ns_1 { proc foo {} {return 1} } namespace eval ::test_ns_2 { proc foo {} {return 2} } namespace eval ::test_ns_3 { namespace path ::test_ns_1 } namespace eval ::test_ns_4 { namespace path {::test_ns_3 ::test_ns_2} list [foo] [namespace delete ::test_ns_3] [foo] } } -result {2 {} 2} -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} catch {namespace delete ::test_ns_4} } test namespace-51.13 { name resolution path control when the trace fires, ns_2 is being deleted but isn't gone yet, and is still visible for the trace } -body { set ::result {} namespace eval ::test_ns_1 { proc foo {} {lappend ::result 1} } namespace eval ::test_ns_2 { proc foo {} {lappend ::result 2} trace add command foo delete "namespace eval ::test_ns_3 foo;#" } namespace eval ::test_ns_3 { proc foo {} { lappend ::result 3 namespace delete [namespace current] ::test_ns_4::bar } } namespace eval ::test_ns_4 { namespace path {::test_ns_2 ::test_ns_3 ::test_ns_1} proc bar {} { list [foo] [namespace delete ::test_ns_2] [foo] } bar } } -result {2 {} {2 3 2 1}} -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} catch {namespace delete ::test_ns_4} } test namespace-51.14 {name resolution path control} -setup { foreach cmd [info commands foo*] { rename $cmd {} } namespace eval ::test_ns_1 {} namespace eval ::test_ns_2 {} namespace eval ::test_ns_3 {} } -body { proc foo0 {} {} proc ::test_ns_1::foo1 {} {} proc ::test_ns_2::foo2 {} {} namespace eval ::test_ns_3 { variable result {} lappend result [info commands foo*] namespace path {::test_ns_1 ::test_ns_2} lappend result [info commands foo*] proc foo2 {} {} lappend result [info commands foo*] rename foo2 {} lappend result [info commands foo*] namespace delete ::test_ns_1 lappend result [info commands foo*] } } -cleanup { catch {namespace delete ::test_ns_1} catch {namespace delete ::test_ns_2} catch {namespace delete ::test_ns_3} } -result {foo0 {foo1 foo2 foo0} {foo2 foo1 foo0} {foo1 foo2 foo0} {foo2 foo0}} test namespace-51.15 {namespace resolution path control} -body { namespace eval ::test_ns_2 { proc foo {} {return 2} } namespace eval ::test_ns_1 { namespace eval test_ns_2 { proc foo {} {return 1_2} } namespace eval test_ns_3 { namespace path ::test_ns_1 test_ns_2::foo } } } -result 1_2 -cleanup { namespace delete ::test_ns_1 namespace delete ::test_ns_2 } test namespace-51.16 {Bug 1566526} { interp create child child eval namespace eval demo namespace path :: interp delete child } {} test namespace-51.17 {resolution epoch handling: Bug 2898722} -setup { set result {} catch {namespace delete ::a} } -body { namespace eval ::a { proc c {} {lappend ::result A} c namespace eval b { variable d c lappend ::result [catch { $d }] } lappend ::result . namespace eval b { namespace path [namespace parent] $d;[format %c 99] } lappend ::result . namespace eval b { proc c {} {lappend ::result B} $d;[format %c 99] } lappend ::result . } namespace eval ::a::b { $d;[format %c 99] lappend ::result . proc ::c {} {lappend ::result G} $d;[format %c 99] lappend ::result . rename ::a::c {} $d;[format %c 99] lappend ::result . rename ::a::b::c {} $d;[format %c 99] } } -cleanup { namespace delete ::a catch {rename ::c {}} unset result } -result {A 1 . A A . B B . B B . B B . B B . G G} test namespace-51.18 {Bug 3185407} -setup { namespace eval ::test_ns_1 {} } -body { namespace eval ::test_ns_1 { variable result {} namespace eval ns {proc foo {} {}} namespace eval ns2 {proc foo {} {}} namespace path {ns ns2} variable x foo lappend result [namespace which $x] proc foo {} {} lappend result [namespace which $x] } } -cleanup { namespace delete ::test_ns_1 } -result {::test_ns_1::ns::foo ::test_ns_1::foo} # TIP 181 - namespace unknown tests test namespace-52.1 {unknown: default handler ::unknown} { set result [list [namespace eval foobar { namespace unknown }]] lappend result [namespace eval :: { namespace unknown }] namespace delete foobar set result } {{} ::unknown} test namespace-52.2 {unknown: default resolution global} { proc ::foo {} { return "GLOBAL" } namespace eval ::bar { proc foo {} { return "NAMESPACE" } } namespace eval ::bar::jim { proc test {} { foo } } set result [::bar::jim::test] namespace delete ::bar rename ::foo {} set result } {GLOBAL} test namespace-52.3 {unknown: default resolution local} { proc ::foo {} { return "GLOBAL" } namespace eval ::bar { proc foo {} { return "NAMESPACE" } proc test {} { foo } } set result [::bar::test] namespace delete ::bar rename ::foo {} set result } {NAMESPACE} test namespace-52.4 {unknown: set handler} { namespace eval foo { namespace unknown [list dispatch] proc dispatch {args} { return $args } proc test {} { UnknownCmd a b c } } set result [foo::test] namespace delete foo set result } {UnknownCmd a b c} test namespace-52.5 {unknown: search path before unknown is unaltered} { proc ::test2 {args} { return "TEST2: $args" } namespace eval foo { namespace unknown [list dispatch] proc dispatch {args} { return "UNKNOWN: $args" } proc test1 {args} { return "TEST1: $args" } proc test {} { set result [list [test1 a b c]] lappend result [test2 a b c] lappend result [test3 a b c] return $result } } set result [foo::test] namespace delete foo rename ::test2 {} set result } {{TEST1: a b c} {TEST2: a b c} {UNKNOWN: test3 a b c}} test namespace-52.6 {unknown: deleting handler restores default} { rename ::unknown ::_unknown_orig proc ::unknown {args} { return "DEFAULT: $args" } namespace eval foo { namespace unknown dummy namespace unknown {} } set result [namespace eval foo { dummy a b c }] rename ::unknown {} rename ::_unknown_orig ::unknown namespace delete foo set result } {DEFAULT: dummy a b c} test namespace-52.7 {unknown: setting global unknown handler} { proc ::myunknown {args} { return "MYUNKNOWN: $args" } namespace eval :: { namespace unknown ::myunknown } set result [namespace eval foo { dummy a b c }] namespace eval :: { namespace unknown {} } rename ::myunknown {} namespace delete foo set result } {MYUNKNOWN: dummy a b c} test namespace-52.8 {unknown: destroying and redefining global namespace} { set i [interp create] $i hide proc $i hide namespace $i hide return $i invokehidden namespace delete :: $i expose return $i invokehidden proc unknown args { return "FINE" } $i eval { foo bar bob } } {FINE} test namespace-52.9 {unknown: refcounting} -setup { proc this args { unset args ;# stop sharing set copy [namespace unknown] string length $copy ;# shimmer away list rep info level 0 } set handler [namespace unknown] namespace unknown {this is a test} catch {rename noSuchCommand {}} } -body { noSuchCommand } -cleanup { namespace unknown $handler rename this {} } -result {this is a test noSuchCommand} testConstraint testevalobjv [llength [info commands testevalobjv]] test namespace-52.10 {unknown: with TCL_EVAL_GLOBAL} -constraints { testevalobjv } -setup { rename ::unknown unknown.save proc ::unknown args { set caller [uplevel 1 {namespace current}] namespace eval $caller { variable foo return $foo } } catch {rename ::noSuchCommand {}} } -body { namespace eval :: { variable foo SUCCESS } namespace eval test_ns_1 { variable foo FAIL testevalobjv 1 noSuchCommand } } -cleanup { unset -nocomplain ::foo namespace delete test_ns_1 rename ::unknown {} rename unknown.save ::unknown } -result SUCCESS test namespace-52.11 {unknown: with TCL_EVAL_INVOKE} -setup { set handler [namespace eval :: {namespace unknown}] namespace eval :: {namespace unknown unknown} rename ::unknown unknown.save namespace eval :: { proc unknown args { return SUCCESS } } catch {rename ::noSuchCommand {}} set ::child [interp create] } -body { $::child alias bar noSuchCommand namespace eval test_ns_1 { namespace unknown unknown proc unknown args { return FAIL } $::child eval bar } } -cleanup { interp delete $::child unset ::child namespace delete test_ns_1 rename ::unknown {} rename unknown.save ::unknown namespace eval :: [list namespace unknown $handler] } -result SUCCESS test namespace-52.12 {unknown: error case must not reset handler} -body { namespace eval foo { namespace unknown ok catch {namespace unknown {{}{}{}}} namespace unknown } } -cleanup { namespace delete foo } -result ok # TIP 314 - ensembles with parameters test namespace-53.1 {ensembles: parameters} { namespace eval ns { namespace export x proc x {para} {list 1 $para} namespace ensemble create -parameters {para1} } list [info command ns] [ns bar x] [namespace delete ns] [info command ns] } {ns {1 bar} {} {}} test namespace-53.2 {ensembles: parameters} -setup { namespace eval ns { namespace export x proc x {para} {list 1 $para} namespace ensemble create } } -body { namespace ensemble configure ns -parameters {para1} rename ns foo list [info command foo] [foo bar x] [namespace delete ns] [info command foo] } -result {foo {1 bar} {} {}} test namespace-53.3 {ensembles: parameters} -setup { namespace eval ns { namespace export x* proc x1 {para} {list 1 $para} proc x2 {para} {list 2 $para} namespace ensemble create -parameters param1 } } -body { set result [list [ns x2 x1] [ns x1 x2]] lappend result [catch {ns x} msg] $msg lappend result [catch {ns x x} msg] $msg rename ns {} lappend result [info command ns::x1] namespace delete ns lappend result [info command ns::x1] } -result\ {{1 x2} {2 x1}\ 1 {wrong # args: should be "ns param1 subcommand ?arg ...?"}\ 1 {unknown or ambiguous subcommand "x": must be x1, or x2}\ ::ns::x1 {}} test namespace-53.4 {ensembles: parameters} -setup { namespace eval ns { namespace export x* proc x1 {a1 a2} {list 1 $a1 $a2} proc x2 {a1 a2} {list 2 $a1 $a2} proc x3 {a1 a2} {list 3 $a1 $a2} namespace ensemble create } } -body { set result {} lappend result [ns x1 x2 x3] namespace ensemble configure ns -parameters p1 lappend result [ns x1 x2 x3] namespace ensemble configure ns -parameters {p1 p2} lappend result [ns x1 x2 x3] } -cleanup { namespace delete ns } -result {{1 x2 x3} {2 x1 x3} {3 x1 x2}} test namespace-53.5 {ensembles: parameters} -setup { namespace eval ns { namespace export x* proc x1 {para} {list 1 $para} proc x2 {para} {list 2 $para} proc x3 {para} {list 3 $para} namespace ensemble create } } -body { set result [list [catch {ns x x1} msg] $msg] lappend result [catch {ns x1 x} msg] $msg namespace ensemble configure ns -parameters p1 lappend result [catch {ns x1 x} msg] $msg lappend result [catch {ns x x1} msg] $msg } -cleanup { namespace delete ns } -result\ {1 {unknown or ambiguous subcommand "x": must be x1, x2, or x3}\ 0 {1 x}\ 1 {unknown or ambiguous subcommand "x": must be x1, x2, or x3}\ 0 {1 x}} test namespace-53.6 {ensembles: nested} -setup { namespace eval ns { namespace export x* namespace eval x0 { proc z {args} {list 0 $args} namespace export z namespace ensemble create } proc x1 {args} {list 1 $args} proc x2 {args} {list 2 $args} proc x3 {args} {list 3 $args} namespace ensemble create -parameters p } } -body { list [ns z x0] [ns z x1] [ns z x2] [ns z x3] } -cleanup { namespace delete ns } -result {{0 {}} {1 z} {2 z} {3 z}} test namespace-53.7 {ensembles: parameters & wrong # args} -setup { namespace eval ns { namespace export x* proc x1 {a1 a2 a3 a4} {list x1 $a1 $a2 $a3 $a4} namespace ensemble create -parameters p1 } } -body { set result {} lappend result [catch {ns} msg] $msg lappend result [catch {ns x1} msg] $msg lappend result [catch {ns x1 x1} msg] $msg lappend result [catch {ns x1 x1 x1} msg] $msg lappend result [catch {ns x1 x1 x1 x1} msg] $msg lappend result [catch {ns x1 x1 x1 x1 x1} msg] $msg } -cleanup { namespace delete ns } -result\ {1 {wrong # args: should be "ns p1 subcommand ?arg ...?"}\ 1 {wrong # args: should be "ns p1 subcommand ?arg ...?"}\ 1 {wrong # args: should be "ns x1 x1 a2 a3 a4"}\ 1 {wrong # args: should be "ns x1 x1 a2 a3 a4"}\ 1 {wrong # args: should be "ns x1 x1 a2 a3 a4"}\ 0 {x1 x1 x1 x1 x1}} test namespace-53.8 {ensemble: unknown handler changing -parameters} -setup { namespace eval ns { namespace export x* proc x1 {a1} {list 1 $a1} proc Magic {ensemble subcmd args} { namespace ensemble configure $ensemble\ -parameters [lrange p1 [llength [ namespace ensemble configure $ensemble -parameters ]] 0] list } namespace ensemble create -unknown ::ns::Magic } } -body { set result {} lappend result [catch {ns x1 x2} msg] $msg [namespace ensemble configure ns -parameters] lappend result [catch {ns x2 x1} msg] $msg [namespace ensemble configure ns -parameters] lappend result [catch {ns x2 x3} msg] $msg [namespace ensemble configure ns -parameters] } -cleanup { namespace delete ns } -result\ {0 {1 x2} {}\ 0 {1 x2} p1\ 1 {unknown or ambiguous subcommand "x2": must be x1} {}} test namespace-53.9 {ensemble: unknown handler changing -parameters,\ thereby eating all args} -setup { namespace eval ns { namespace export x* proc x1 {args} {list 1 $args} proc Magic {ensemble subcmd args} { namespace ensemble configure $ensemble\ -parameters {p1 p2 p3 p4 p5} list } namespace ensemble create -unknown ::ns::Magic } } -body { set result {} lappend result [catch {ns x1 x2} msg] $msg [namespace ensemble configure ns -parameters] lappend result [catch {ns x2 x1} msg] $msg [namespace ensemble configure ns -parameters] lappend result [catch {ns a1 a2 a3 a4 a5 x1} msg] $msg [namespace ensemble configure ns -parameters] } -cleanup { namespace delete ns } -result\ {0 {1 x2} {}\ 1 {wrong # args: should be "ns p1 p2 p3 p4 p5 subcommand ?arg ...?"} {p1 p2 p3 p4 p5}\ 0 {1 {a1 a2 a3 a4 a5}} {p1 p2 p3 p4 p5}} test namespace-53.10 {ensembles: nested rewrite} -setup { namespace eval ns { namespace export x namespace eval x { proc z0 {} {list 0} proc z1 {a1} {list 1 $a1} proc z2 {a1 a2} {list 2 $a1 $a2} proc z3 {a1 a2 a3} {list 3 $a1 $a2 $a3} namespace export z* namespace ensemble create } namespace ensemble create -parameters p } } -body { set result {} # In these cases, parsing the subensemble does not grab a new word. lappend result [catch {ns z0 x} msg] $msg lappend result [catch {ns z1 x} msg] $msg lappend result [catch {ns z2 x} msg] $msg lappend result [catch {ns z2 x v} msg] $msg namespace ensemble configure ns::x -parameters q1 # In these cases, parsing the subensemble grabs a new word. lappend result [catch {ns v x z0} msg] $msg lappend result [catch {ns v x z1} msg] $msg lappend result [catch {ns v x z2} msg] $msg lappend result [catch {ns v x z2 v2} msg] $msg } -cleanup { namespace delete ns } -result\ {0 0\ 1 {wrong # args: should be "ns z1 x a1"}\ 1 {wrong # args: should be "ns z2 x a1 a2"}\ 1 {wrong # args: should be "ns z2 x a1 a2"}\ 1 {wrong # args: should be "::ns::x::z0"}\ 0 {1 v}\ 1 {wrong # args: should be "ns v x z2 a2"}\ 0 {2 v v2}} test namespace-53.11 {ensembles: nested rewrite} -setup { namespace eval ns { namespace export x namespace eval x { proc z2 {a1 a2} {list 2 $a1 $a2} namespace export z* namespace ensemble create -parameter p } namespace ensemble create } } -body { list [catch {ns x 1 z2} msg] $msg } -cleanup { namespace delete ns unset -nocomplain msg } -result {1 {wrong # args: should be "ns x 1 z2 a2"}} test namespace-54.1 {leak on namespace deletion} -constraints {memory} \ -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { set ns ::y$i namespace eval $ns {} namespace delete $ns set start $end set end [getbytes] } set leakedBytes [expr {$end - $start}] } -cleanup { rename getbytes {} unset i ns start end } -result 0 test namespace-55.1 {compiled ensembles inside compiled ensembles: Bug 6d2f249a01} { info class [format %s constructor] oo::object } "" test namespace-55.2 {compiled ensembles inside safe interpreters (for safe sub-commands), bug [1095bf7f756f9aed]} -setup { interp create -safe si set code { proc test_comp_dict d { dict for {k v} $d {expr $v} } regexp -inline {Command 1:(?:[^\n]*\n){1,5}} [::tcl::unsupported::disassemble proc test_comp_dict] } } -body { set a [ eval $code] set b [si eval $code] list [expr {$a eq $b}] [regexp { dictFirst } $a] [regexp { dictFirst } $b] $a $b } -cleanup { rename test_comp_dict {} unset -nocomplain code a b interp delete si } -match glob -result {1 1 1 *} test namespace-56.1 {bug f97d4ee020: mutually-entangled deletion} { namespace eval ::testing { proc abc {} {} proc def {} {} trace add command abc delete "rename ::testing::def {}; #" trace add command def delete "rename ::testing::abc {}; #" } namespace delete ::testing } {} test namespace-56.2 {bug f97d4ee020: mutually-entangled deletion} { namespace eval ::testing { namespace eval abc {proc xyz {} {}} namespace eval def {proc xyz {} {}} trace add command abc::xyz delete "namespace delete ::testing::def {}; #" trace add command def::xyz delete "namespace delete ::testing::abc {}; #" } namespace delete ::testing } {} test namespace-56.3 {bug f97d4ee020: mutually-entangled deletion} { namespace eval ::testing { variable gone {} oo::class create CB { variable cmd constructor other {set cmd $other} destructor {rename $cmd {}; lappend ::testing::gone $cmd} } namespace eval abc { ::testing::CB create def ::testing::abc::ghi ::testing::CB create ghi ::testing::abc::def } namespace delete abc try { return [lsort $gone] } finally { namespace delete ::testing } } } {::testing::abc::def ::testing::abc::ghi} test namespace-56.4 {bug 16fe1b5807: names starting with ":"} knownBug { namespace eval : { namespace ensemble create namespace export * proc p1 {} { return 16fe1b5807 } } : p1 } 16fe1b5807 test namespace-56.5 {Bug 8b9854c3d8} -setup { namespace eval namespace-56.5 { proc cmd {} {string match ::* [lindex [[string cat info] level 0] 0]} namespace export * namespace ensemble create } } -body { namespace-56.5 cmd } -cleanup { namespace delete namespace-56.5 } -result 1 test namespace-56.6 { Namespace deletion traces on both the original routine and the imported routine should run without any memory error under a debug build. } -body { variable res {} proc ondelete {old new op} { variable res set tail [namespace tail $old] set up [namespace tail [namespace qualifiers $old]] lappend res [list $up $tail] } namespace eval ns1 {} { namespace export * proc p1 {} { namespace upvar [namespace parent] res res incr res } trace add command p1 delete ondelete } namespace eval ns2 {} { namespace import [namespace parent]::ns1::p1 trace add command p1 delete ondelete } namespace delete ns1 namespace delete ns2 after 1 return $res } -cleanup { unset res rename ondelete {} } -result {{ns1 p1} {ns2 p1}} test namespace-57.0 { an imported alias should be usable in the deletion trace for the alias see 29e8848eb976 } -body { variable res {} namespace eval ns2 { namespace export * proc p1 {oldname newname op} { return success } interp alias {} [namespace current]::p2 {} [namespace which p1] } namespace eval ns3 { namespace import ::ns2::p2 } set ondelete [list apply [list {oldname newname op} { variable res catch { ns3::p2 $oldname $newname $op } cres lappend res $cres } [namespace current]]] trace add command ::ns2::p2 delete $ondelete rename ns2::p2 {} return $res } -cleanup { unset res namespace delete ns2 namespace delete ns3 } -result success # cleanup catch {rename cmd1 {}} catch {unset l} catch {unset msg} catch {unset trigger} namespace delete {*}[namespace children :: test_ns_*] ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/namespace-old.test0000644000175000017500000010560315104661341016327 0ustar sergeisergei# Functionality covered: this file contains slightly modified versions of # the original tests written by Mike McLennan of Lucent Technologies for # the procedures in tclNamesp.c that implement Tcl's basic support for # namespaces. Other namespace-related tests appear in namespace.test # and variable.test. # # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1997 Lucent Technologies # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Clear out any namespaces called test_ns_* catch {namespace delete {*}[namespace children :: test_ns_*]} test namespace-old-1.1 {usage for "namespace" command} { list [catch {namespace} msg] $msg } {1 {wrong # args: should be "namespace subcommand ?arg ...?"}} test namespace-old-1.2 {global namespace's name is "::" or {}} { list [namespace current] [namespace eval {} {namespace current}] } {:: ::} test namespace-old-1.3 {usage for "namespace eval"} { list [catch {namespace eval} msg] $msg } {1 {wrong # args: should be "namespace eval name arg ?arg...?"}} test namespace-old-1.4 {create new namespaces} { list [lsort [namespace children :: test_ns_simple*]] \ [namespace eval test_ns_simple {}] \ [namespace eval test_ns_simple2 {}] \ [lsort [namespace children :: test_ns_simple*]] } {{} {} {} {::test_ns_simple ::test_ns_simple2}} test namespace-old-1.5 {access a new namespace} { namespace eval test_ns_simple { namespace current } } {::test_ns_simple} test namespace-old-1.6 {usage for "namespace eval"} { list [catch {namespace eval} msg] $msg } {1 {wrong # args: should be "namespace eval name arg ?arg...?"}} test namespace-old-1.7 {usage for "namespace eval"} { list [catch {namespace eval test_ns_xyzzy} msg] $msg } {1 {wrong # args: should be "namespace eval name arg ?arg...?"}} test namespace-old-1.8 {command "namespace eval" concatenates args} { namespace eval test_ns_simple namespace current } {::test_ns_simple} test namespace-old-1.9 {add elements to a namespace} { namespace eval test_ns_simple { variable test_ns_x 0 proc test {test_ns_x} { return "test: $test_ns_x" } } } {} namespace eval test_ns_simple { variable test_ns_x 0 proc test {test_ns_x} { return "test: $test_ns_x" } } test namespace-old-1.10 {commands in a namespace} { namespace eval test_ns_simple { info commands [namespace current]::*} } {::test_ns_simple::test} test namespace-old-1.11 {variables in a namespace} { namespace eval test_ns_simple { info vars [namespace current]::* } } {::test_ns_simple::test_ns_x} test namespace-old-1.12 {global vars are separate from locals vars} { list [test_ns_simple::test 123] [set test_ns_simple::test_ns_x] } {{test: 123} 0} test namespace-old-1.13 {add to an existing namespace} { namespace eval test_ns_simple { variable test_ns_y 123 proc _backdoor {cmd} { eval $cmd } } } "" namespace eval test_ns_simple { variable test_ns_y 123 proc _backdoor {cmd} { eval $cmd } } test namespace-old-1.14 {commands in a namespace} { lsort [namespace eval test_ns_simple {info commands [namespace current]::*}] } {::test_ns_simple::_backdoor ::test_ns_simple::test} test namespace-old-1.15 {variables in a namespace} { lsort [namespace eval test_ns_simple {info vars [namespace current]::*}] } {::test_ns_simple::test_ns_x ::test_ns_simple::test_ns_y} test namespace-old-1.16 {variables in a namespace} { lsort [info vars test_ns_simple::*] } {::test_ns_simple::test_ns_x ::test_ns_simple::test_ns_y} test namespace-old-1.17 {commands in a namespace are hidden} { list [catch "_backdoor {return yes!}" msg] $msg } {1 {invalid command name "_backdoor"}} test namespace-old-1.18 {using namespace qualifiers} { list [catch "test_ns_simple::_backdoor {return yes!}" msg] $msg } {0 yes!} test namespace-old-1.19 {using absolute namespace qualifiers} { list [catch "::test_ns_simple::_backdoor {return yes!}" msg] $msg } {0 yes!} test namespace-old-1.20 {variables in a namespace are hidden} { list [catch "set test_ns_x" msg] $msg [catch "set test_ns_y" msg] $msg } {1 {can't read "test_ns_x": no such variable} 1 {can't read "test_ns_y": no such variable}} test namespace-old-1.21 {using namespace qualifiers} { list [catch "set test_ns_simple::test_ns_x" msg] $msg \ [catch "set test_ns_simple::test_ns_y" msg] $msg } {0 0 0 123} test namespace-old-1.22 {using absolute namespace qualifiers} { list [catch "set ::test_ns_simple::test_ns_x" msg] $msg \ [catch "set ::test_ns_simple::test_ns_y" msg] $msg } {0 0 0 123} test namespace-old-1.23 {variables can be accessed within a namespace} { test_ns_simple::_backdoor { variable test_ns_x variable test_ns_y return "$test_ns_x $test_ns_y" } } {0 123} test namespace-old-1.24 {setting global variables} { test_ns_simple::_backdoor {variable test_ns_x; set test_ns_x "new val"} namespace eval test_ns_simple {set test_ns_x} } {new val} test namespace-old-1.25 {qualified variables don't need a global declaration} { namespace eval test_ns_another { variable test_ns_x 456 } set cmd {set ::test_ns_another::test_ns_x} list [catch {test_ns_simple::_backdoor "$cmd some-value"} msg] $msg \ [eval $cmd] } {0 some-value some-value} test namespace-old-1.26 {namespace qualifiers are okay after $'s} { namespace eval test_ns_simple { set test_ns_x 12; set test_ns_y 34 } set cmd {list $::test_ns_simple::test_ns_x $::test_ns_simple::test_ns_y} list [test_ns_simple::_backdoor $cmd] [eval $cmd] } {{12 34} {12 34}} test namespace-old-1.27 {can create commands with null names} { proc test_ns_simple:: {args} {return $args} } {} # Redeclare; later tests depend on it proc test_ns_simple:: {args} {return $args} # ----------------------------------------------------------------------- # TEST: using "info" in namespace contexts # ----------------------------------------------------------------------- test namespace-old-2.1 {querying: info commands} { lsort [test_ns_simple::_backdoor {info commands [namespace current]::*}] } {::test_ns_simple:: ::test_ns_simple::_backdoor ::test_ns_simple::test} test namespace-old-2.2 {querying: info procs} { lsort [test_ns_simple::_backdoor {info procs}] } {{} _backdoor test} test namespace-old-2.3 {querying: info vars} { lsort [info vars test_ns_simple::*] } {::test_ns_simple::test_ns_x ::test_ns_simple::test_ns_y} test namespace-old-2.4 {querying: info vars} { lsort [test_ns_simple::_backdoor {info vars [namespace current]::*}] } {::test_ns_simple::test_ns_x ::test_ns_simple::test_ns_y} test namespace-old-2.5 {querying: info locals} { lsort [test_ns_simple::_backdoor {info locals}] } {cmd} test namespace-old-2.6 {querying: info exists} { test_ns_simple::_backdoor {info exists test_ns_x} } {0} test namespace-old-2.7 {querying: info exists} { test_ns_simple::_backdoor {info exists cmd} } {1} test namespace-old-2.8 {querying: info args} { info args test_ns_simple::_backdoor } {cmd} test namespace-old-2.9 {querying: info body} { string trim [info body test_ns_simple::test] } {return "test: $test_ns_x"} # ----------------------------------------------------------------------- # TEST: namespace qualifiers, namespace tail # ----------------------------------------------------------------------- test namespace-old-3.1 {usage for "namespace qualifiers"} { list [catch "namespace qualifiers" msg] $msg } {1 {wrong # args: should be "namespace qualifiers string"}} test namespace-old-3.2 {querying: namespace qualifiers} { list [namespace qualifiers ""] \ [namespace qualifiers ::] \ [namespace qualifiers x] \ [namespace qualifiers ::x] \ [namespace qualifiers foo::x] \ [namespace qualifiers ::foo::bar::xyz] } {{} {} {} {} foo ::foo::bar} test namespace-old-3.3 {usage for "namespace tail"} { list [catch "namespace tail" msg] $msg } {1 {wrong # args: should be "namespace tail string"}} test namespace-old-3.4 {querying: namespace tail} { list [namespace tail ""] \ [namespace tail ::] \ [namespace tail x] \ [namespace tail ::x] \ [namespace tail foo::x] \ [namespace tail ::foo::bar::xyz] } {{} {} x x x xyz} # ----------------------------------------------------------------------- # TEST: delete commands and namespaces # ----------------------------------------------------------------------- test namespace-old-4.1 {define test namespaces} { namespace eval test_ns_delete { namespace eval ns1 { variable var1 1 proc cmd1 {} {return "cmd1"} } namespace eval ns2 { variable var2 2 proc cmd2 {} {return "cmd2"} } namespace eval another {} lsort [namespace children] } } {::test_ns_delete::another ::test_ns_delete::ns1 ::test_ns_delete::ns2} test namespace-old-4.2 {it's okay to invoke "namespace delete" with no args} { list [catch {namespace delete} msg] $msg } {0 {}} test namespace-old-4.3 {command "namespace delete" doesn't support patterns} { set cmd { namespace eval test_ns_delete {namespace delete ns*} } list [catch $cmd msg] $msg } {1 {unknown namespace "ns*" in namespace delete command}} namespace eval test_ns_delete { namespace eval ns1 {} namespace eval ns2 {} namespace eval another {} } test namespace-old-4.4 {command "namespace delete" handles multiple args} { set cmd { namespace eval test_ns_delete { namespace delete \ {*}[namespace children [namespace current] ns?] } } list [catch $cmd msg] $msg [namespace children test_ns_delete] } {0 {} ::test_ns_delete::another} # ----------------------------------------------------------------------- # TEST: namespace hierarchy # ----------------------------------------------------------------------- test namespace-old-5.1 {define nested namespaces} { set test_ns_var_global "var in ::" proc test_ns_cmd_global {} {return "cmd in ::"} namespace eval test_ns_hier1 { set test_ns_var_hier1 "particular to hier1" proc test_ns_cmd_hier1 {} {return "particular to hier1"} set test_ns_level 1 proc test_ns_show {} {return "[namespace current]: 1"} namespace eval test_ns_hier2 { set test_ns_var_hier2 "particular to hier2" proc test_ns_cmd_hier2 {} {return "particular to hier2"} set test_ns_level 2 proc test_ns_show {} {return "[namespace current]: 2"} namespace eval test_ns_hier3a {} namespace eval test_ns_hier3b {} } namespace eval test_ns_hier2a {} namespace eval test_ns_hier2b {} } } {} test namespace-old-5.2 {namespaces can be nested} { list [namespace eval test_ns_hier1 {namespace current}] \ [namespace eval test_ns_hier1 { namespace eval test_ns_hier2 {namespace current} }] } {::test_ns_hier1 ::test_ns_hier1::test_ns_hier2} test namespace-old-5.3 {namespace qualifiers work in namespace command} { list [namespace eval ::test_ns_hier1 {namespace current}] \ [namespace eval test_ns_hier1::test_ns_hier2 {namespace current}] \ [namespace eval ::test_ns_hier1::test_ns_hier2 {namespace current}] } {::test_ns_hier1 ::test_ns_hier1::test_ns_hier2 ::test_ns_hier1::test_ns_hier2} set ::test_ns_var_global "var in ::" proc test_ns_cmd_global {} {return "cmd in ::"} namespace eval test_ns_hier1 { variable test_ns_var_hier1 "particular to hier1" proc test_ns_cmd_hier1 {} {return "particular to hier1"} variable test_ns_level 1 proc test_ns_show {} {return "[namespace current]: 1"} namespace eval test_ns_hier2 { variable test_ns_var_hier2 "particular to hier2" proc test_ns_cmd_hier2 {} {return "particular to hier2"} variable test_ns_level 2 proc test_ns_show {} {return "[namespace current]: 2"} namespace eval test_ns_hier3a {} namespace eval test_ns_hier3b {} } namespace eval test_ns_hier2a {} namespace eval test_ns_hier2b {} } # TIP 278: secondary lookup disabled for vars, tests disabled with # test namespace-old-5.4 {nested namespaces can access global namespace} { list [namespace eval test_ns_hier1 {#set test_ns_var_global}] \ [namespace eval test_ns_hier1 {test_ns_cmd_global}] \ [namespace eval test_ns_hier1::test_ns_hier2 {#set test_ns_var_global}] \ [namespace eval test_ns_hier1::test_ns_hier2 {test_ns_cmd_global}] } {{} {cmd in ::} {} {cmd in ::}} test namespace-old-5.5 {variables in different namespaces don't conflict} { list [set test_ns_hier1::test_ns_level] \ [set test_ns_hier1::test_ns_hier2::test_ns_level] } {1 2} test namespace-old-5.6 {commands in different namespaces don't conflict} { list [test_ns_hier1::test_ns_show] \ [test_ns_hier1::test_ns_hier2::test_ns_show] } {{::test_ns_hier1: 1} {::test_ns_hier1::test_ns_hier2: 2}} test namespace-old-5.7 {nested namespaces don't see variables in parent} { set cmd { namespace eval test_ns_hier1::test_ns_hier2 {set test_ns_var_hier1} } list [catch $cmd msg] $msg } {1 {can't read "test_ns_var_hier1": no such variable}} test namespace-old-5.8 {nested namespaces don't see commands in parent} { set cmd { namespace eval test_ns_hier1::test_ns_hier2 {test_ns_cmd_hier1} } list [catch $cmd msg] $msg } {1 {invalid command name "test_ns_cmd_hier1"}} test namespace-old-5.9 {usage for "namespace children"} { list [catch {namespace children test_ns_hier1 y z} msg] $msg } {1 {wrong # args: should be "namespace children ?name? ?pattern?"}} test namespace-old-5.10 {command "namespace children" must get valid namespace} -body { namespace children xyzzy } -returnCodes error -result {namespace "xyzzy" not found in "::"} test namespace-old-5.11 {querying namespace children} { lsort [namespace children :: test_ns_hier*] } {::test_ns_hier1} test namespace-old-5.12 {querying namespace children} { lsort [namespace children test_ns_hier1] } {::test_ns_hier1::test_ns_hier2 ::test_ns_hier1::test_ns_hier2a ::test_ns_hier1::test_ns_hier2b} test namespace-old-5.13 {querying namespace children} { lsort [namespace eval test_ns_hier1 {namespace children}] } {::test_ns_hier1::test_ns_hier2 ::test_ns_hier1::test_ns_hier2a ::test_ns_hier1::test_ns_hier2b} test namespace-old-5.14 {querying namespace children} { lsort [namespace children test_ns_hier1::test_ns_hier2] } {::test_ns_hier1::test_ns_hier2::test_ns_hier3a ::test_ns_hier1::test_ns_hier2::test_ns_hier3b} test namespace-old-5.15 {querying namespace children} { lsort [namespace eval test_ns_hier1::test_ns_hier2 {namespace children}] } {::test_ns_hier1::test_ns_hier2::test_ns_hier3a ::test_ns_hier1::test_ns_hier2::test_ns_hier3b} test namespace-old-5.16 {querying namespace children with patterns} { lsort [namespace children test_ns_hier1::test_ns_hier2 test_ns_*] } {::test_ns_hier1::test_ns_hier2::test_ns_hier3a ::test_ns_hier1::test_ns_hier2::test_ns_hier3b} test namespace-old-5.17 {querying namespace children with patterns} { lsort [namespace children test_ns_hier1::test_ns_hier2 *b] } {::test_ns_hier1::test_ns_hier2::test_ns_hier3b} test namespace-old-5.18 {usage for "namespace parent"} { list [catch {namespace parent x y} msg] $msg } {1 {wrong # args: should be "namespace parent ?name?"}} test namespace-old-5.19 {command "namespace parent" must get valid namespace} -body { namespace parent xyzzy } -returnCodes error -result {namespace "xyzzy" not found in "::"} test namespace-old-5.20 {querying namespace parent} { list [namespace eval :: {namespace parent}] \ [namespace eval test_ns_hier1 {namespace parent}] \ [namespace eval test_ns_hier1::test_ns_hier2 {namespace parent}] \ [namespace eval test_ns_hier1::test_ns_hier2::test_ns_hier3a {namespace parent}] \ } {{} :: ::test_ns_hier1 ::test_ns_hier1::test_ns_hier2} test namespace-old-5.21 {querying namespace parent for explicit namespace} { list [namespace parent ::] \ [namespace parent test_ns_hier1] \ [namespace parent test_ns_hier1::test_ns_hier2] \ [namespace parent test_ns_hier1::test_ns_hier2::test_ns_hier3a] } {{} :: ::test_ns_hier1 ::test_ns_hier1::test_ns_hier2} # ----------------------------------------------------------------------- # TEST: name resolution and caching # ----------------------------------------------------------------------- set trigger {namespace eval test_ns_cache2 {namespace current}} set trigger2 {namespace eval test_ns_cache2::test_ns_cache3 {namespace current}} test namespace-old-6.1 {relative ns names only looked up in current ns} { namespace eval test_ns_cache1 {} namespace eval test_ns_cache2 {} namespace eval test_ns_cache2::test_ns_cache3 {} list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} test namespace-old-6.2 {relative ns names only looked up in current ns} { namespace eval test_ns_cache1::test_ns_cache2 {} list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} test namespace-old-6.3 {relative ns names only looked up in current ns} { namespace eval test_ns_cache1::test_ns_cache2::test_ns_cache3 {} list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} namespace eval test_ns_cache1::test_ns_cache2 {} test namespace-old-6.4 {relative ns names only looked up in current ns} { namespace delete test_ns_cache1::test_ns_cache2 list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 $trigger2] } {::test_ns_cache1::test_ns_cache2 ::test_ns_cache1::test_ns_cache2::test_ns_cache3} namespace eval test_ns_cache1 { proc trigger {} {test_ns_cache_cmd} } test namespace-old-6.5 {define test commands} { proc test_ns_cache_cmd {} { return "global version" } test_ns_cache1::trigger } {global version} test namespace-old-6.6 {one-level check for command shadowing} { proc test_ns_cache1::test_ns_cache_cmd {} { return "cache1 version" } test_ns_cache1::trigger } {cache1 version} proc test_ns_cache_cmd {} { return "global version" } test namespace-old-6.7 {renaming commands changes command epoch} -setup { proc test_ns_cache1::test_ns_cache_cmd {} { return "cache1 version" } } -body { list [test_ns_cache1::trigger] \ [namespace eval test_ns_cache1 {rename test_ns_cache_cmd test_ns_new}]\ [test_ns_cache1::trigger] } -result {{cache1 version} {} {global version}} test namespace-old-6.8 {renaming back handles shadowing} -setup { proc test_ns_cache1::test_ns_new {} { return "cache1 version" } } -body { list [test_ns_cache1::trigger] \ [namespace eval test_ns_cache1 {rename test_ns_new test_ns_cache_cmd}]\ [test_ns_cache1::trigger] } -result {{global version} {} {cache1 version}} test namespace-old-6.9 {deleting commands changes command epoch} -setup { proc test_ns_cache1::test_ns_cache_cmd {} { return "cache1 version" } } -body { list [test_ns_cache1::trigger] \ [namespace eval test_ns_cache1 {rename test_ns_cache_cmd ""}] \ [test_ns_cache1::trigger] } -result {{cache1 version} {} {global version}} test namespace-old-6.10 {define test namespaces} { namespace eval test_ns_cache2 { proc test_ns_cache_cmd {} { return "global cache2 version" } } namespace eval test_ns_cache1 { proc trigger {} { test_ns_cache2::test_ns_cache_cmd } } namespace eval test_ns_cache1::test_ns_cache2 { proc trigger {} { test_ns_cache_cmd } } list [test_ns_cache1::trigger] [test_ns_cache1::test_ns_cache2::trigger] } {{global cache2 version} {global version}} namespace eval test_ns_cache1 { proc trigger {} { test_ns_cache2::test_ns_cache_cmd } namespace eval test_ns_cache2 { proc trigger {} { test_ns_cache_cmd } } } test namespace-old-6.11 {commands affect all parent namespaces} { proc test_ns_cache1::test_ns_cache2::test_ns_cache_cmd {} { return "cache2 version" } list [test_ns_cache1::trigger] [test_ns_cache1::test_ns_cache2::trigger] } {{cache2 version} {cache2 version}} # TIP 278: secondary lookup disabled, catch added, result changed from {global version} test namespace-old-6.12 {define test variables} { variable test_ns_cache_var "global version" set trigger {set test_ns_cache_var} list [catch {namespace eval test_ns_cache1 $trigger} msg] $msg } {1 {can't read "test_ns_cache_var": no such variable}} set trigger {set test_ns_cache_var} test namespace-old-6.13 {one-level check for variable shadowing} { namespace eval test_ns_cache1 { variable test_ns_cache_var "cache1 version" } namespace eval test_ns_cache1 $trigger } {cache1 version} variable ::test_ns_cache_var "global version" # TIP 278: secondary lookup disabled, catch added, result changed from {global version} test namespace-old-6.14 {deleting variables changes variable epoch} { namespace eval test_ns_cache1 { variable test_ns_cache_var "cache1 version" } list [namespace eval test_ns_cache1 $trigger] \ [namespace eval test_ns_cache1 {unset test_ns_cache_var}] \ [catch {namespace eval test_ns_cache1 $trigger}] } {{cache1 version} {} 1} # TIP 278: secondary lookup disabled, catch added, result changed test namespace-old-6.15 {define test namespaces} { namespace eval test_ns_cache2 { variable test_ns_cache_var "global cache2 version" } set trigger2 {set test_ns_cache2::test_ns_cache_var} catch {list [namespace eval test_ns_cache1 $trigger2] \ [namespace eval test_ns_cache1::test_ns_cache2 $trigger]} } 1 set trigger2 {set test_ns_cache2::test_ns_cache_var} test namespace-old-6.16 {public variables affect all parent namespaces} { variable test_ns_cache1::test_ns_cache2::test_ns_cache_var "cache2 version" list [namespace eval test_ns_cache1 $trigger2] \ [namespace eval test_ns_cache1::test_ns_cache2 $trigger] } {{cache2 version} {cache2 version}} test namespace-old-6.17 {usage for "namespace which"} { list [catch "namespace which -baz x" msg] $msg } {1 {wrong # args: should be "namespace which ?-command? ?-variable? name"}} test namespace-old-6.18 {usage for "namespace which"} { # Presume no imported command called -command ;^) namespace which -command } {} test namespace-old-6.19 {querying: namespace which -command} { proc test_ns_cache1::test_ns_cache_cmd {} { return "cache1 version" } list [namespace eval :: {namespace which test_ns_cache_cmd}] \ [namespace eval test_ns_cache1 {namespace which test_ns_cache_cmd}] \ [namespace eval :: {namespace which -command test_ns_cache_cmd}] \ [namespace eval test_ns_cache1 {namespace which -command test_ns_cache_cmd}] } {::test_ns_cache_cmd ::test_ns_cache1::test_ns_cache_cmd ::test_ns_cache_cmd ::test_ns_cache1::test_ns_cache_cmd} test namespace-old-6.20 {command "namespace which" may not find commands} { namespace eval test_ns_cache1 {namespace which -command xyzzy} } {} variable test_ns_cache1::test_ns_cache2::test_ns_cache_var "cache2 version" test namespace-old-6.21 {querying: namespace which -variable} { namespace eval test_ns_cache1::test_ns_cache2 { namespace which -variable test_ns_cache_var } } {::test_ns_cache1::test_ns_cache2::test_ns_cache_var} test namespace-old-6.22 {command "namespace which" may not find variables} { namespace eval test_ns_cache1 {namespace which -variable xyzzy} } {} # ----------------------------------------------------------------------- # TEST: uplevel/upvar across namespace boundaries # ----------------------------------------------------------------------- test namespace-old-7.1 {define test namespace} { namespace eval test_ns_uplevel { variable x 0 variable y 1 proc show_vars {num} { return [uplevel $num {info vars}] } proc test_uplevel {num} { set a 0 set b 1 namespace eval ::test_ns_uplevel " return \[show_vars $num\] " } } } {} namespace eval test_ns_uplevel { variable x 0 variable y 1 proc show_vars {num} { return [uplevel $num {info vars}] } proc test_uplevel {num} { set a 0 set b 1 namespace eval ::test_ns_uplevel " return \[show_vars $num\] " } } test namespace-old-7.2 {uplevel can access namespace call frame} { list [expr {"x" in [test_ns_uplevel::test_uplevel 1]}] \ [expr {"y" in [test_ns_uplevel::test_uplevel 1]}] } {1 1} test namespace-old-7.3 {uplevel can go beyond namespace call frame} { lsort [test_ns_uplevel::test_uplevel 2] } {a b num} test namespace-old-7.4 {uplevel can go up to global context} { expr {[test_ns_uplevel::test_uplevel 3] == [info globals]} } {1} test namespace-old-7.5 {absolute call frame references work too} { list [expr {"x" in [test_ns_uplevel::test_uplevel #2]}] \ [expr {"y" in [test_ns_uplevel::test_uplevel #2]}] } {1 1} test namespace-old-7.6 {absolute call frame references work too} { lsort [test_ns_uplevel::test_uplevel #1] } {a b num} test namespace-old-7.7 {absolute call frame references work too} { expr {[test_ns_uplevel::test_uplevel #0] == [info globals]} } {1} test namespace-old-7.8 {namespaces are included in the call stack} { namespace eval test_ns_upvar { variable scope "test_ns_upvar" proc show_val {var num} { upvar $num $var x return $x } proc test_upvar {num} { set scope "test_ns_upvar::test_upvar" namespace eval ::test_ns_upvar " return \[show_val scope $num\] " } } } {} namespace eval test_ns_upvar { variable scope "test_ns_upvar" proc show_val {var num} { upvar $num $var x return $x } proc test_upvar {num} { set scope "test_ns_upvar::test_upvar" namespace eval ::test_ns_upvar " return \[show_val scope $num\] " } } test namespace-old-7.9 {upvar can access namespace call frame} { test_ns_upvar::test_upvar 1 } {test_ns_upvar} test namespace-old-7.10 {upvar can go beyond namespace call frame} { test_ns_upvar::test_upvar 2 } {test_ns_upvar::test_upvar} test namespace-old-7.11 {absolute call frame references work too} { test_ns_upvar::test_upvar #2 } {test_ns_upvar} test namespace-old-7.12 {absolute call frame references work too} { test_ns_upvar::test_upvar #1 } {test_ns_upvar::test_upvar} # ----------------------------------------------------------------------- # TEST: variable traces across namespace boundaries # ----------------------------------------------------------------------- test namespace-old-8.1 {traces work across namespace boundaries} { namespace eval test_ns_trace { namespace eval foo { variable x "" } variable status "" proc monitor {name1 name2 op} { variable status lappend status "$op: $name1" } trace add variable foo::x {read write unset} [namespace code monitor] } set test_ns_trace::foo::x "yes!" set test_ns_trace::foo::x unset test_ns_trace::foo::x namespace eval test_ns_trace { set status } } {{write: test_ns_trace::foo::x} {read: test_ns_trace::foo::x} {unset: test_ns_trace::foo::x}} # ----------------------------------------------------------------------- # TEST: imported commands # ----------------------------------------------------------------------- test namespace-old-9.1 {empty "namespace export" list} { list [catch "namespace export" msg] $msg } {0 {}} test namespace-old-9.2 {usage for "namespace export" command} { list [catch "namespace export test_ns_trace::zzz" msg] $msg } {1 {invalid export pattern "test_ns_trace::zzz": pattern can't specify a namespace}} test namespace-old-9.3 {define test namespaces for import} { namespace eval test_ns_export { namespace export cmd1 cmd2 cmd3 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} proc cmd5 {args} {return "cmd5: $args"} proc cmd6 {args} {return "cmd6: $args"} } lsort [info commands test_ns_export::*] } {::test_ns_export::cmd1 ::test_ns_export::cmd2 ::test_ns_export::cmd3 ::test_ns_export::cmd4 ::test_ns_export::cmd5 ::test_ns_export::cmd6} namespace eval test_ns_export { namespace export cmd1 cmd2 cmd3 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} proc cmd3 {args} {return "cmd3: $args"} proc cmd4 {args} {return "cmd4: $args"} proc cmd5 {args} {return "cmd5: $args"} proc cmd6 {args} {return "cmd6: $args"} } test namespace-old-9.4 {check export status} { set x "" namespace eval test_ns_import { namespace export cmd1 cmd2 namespace import ::test_ns_export::* } foreach cmd [lsort [info commands test_ns_import::*]] { lappend x $cmd } set x } {::test_ns_import::cmd1 ::test_ns_import::cmd2 ::test_ns_import::cmd3} namespace eval test_ns_import { namespace export cmd1 cmd2 namespace import ::test_ns_export::* } test namespace-old-9.5 {empty import list in "namespace import" command} { namespace eval test_ns_import_empty { namespace import ::test_ns_export::* try { lsort [namespace import] } finally { namespace delete [namespace current] } } } {cmd1 cmd2 cmd3} # there is no namespace-old-9.6 test namespace-old-9.7 {empty forget list for "namespace forget" command} { namespace forget } {} catch {rename cmd1 {}} catch {rename cmd2 {}} catch {rename ncmd {}} catch {rename ncmd1 {}} catch {rename ncmd2 {}} test namespace-old-9.8 {only exported commands are imported} { namespace import test_ns_import::cmd* set x [lsort [info commands cmd*]] } {cmd1 cmd2} namespace import test_ns_import::cmd* test namespace-old-9.9 {imported commands work just the same as original} { list [cmd1 test 1 2 3] [test_ns_import::cmd1 test 4 5 6] } {{cmd1: test 1 2 3} {cmd1: test 4 5 6}} test namespace-old-9.10 {commands can be imported from many namespaces} { namespace eval test_ns_import2 { namespace export ncmd ncmd1 ncmd2 proc ncmd {args} {return "ncmd: $args"} proc ncmd1 {args} {return "ncmd1: $args"} proc ncmd2 {args} {return "ncmd2: $args"} proc ncmd3 {args} {return "ncmd3: $args"} } namespace import test_ns_import2::* lsort [concat [info commands cmd*] [info commands ncmd*]] } {cmd1 cmd2 ncmd ncmd1 ncmd2} namespace eval test_ns_import2 { namespace export ncmd ncmd1 ncmd2 proc ncmd {args} {return "ncmd: $args"} proc ncmd1 {args} {return "ncmd1: $args"} proc ncmd2 {args} {return "ncmd2: $args"} proc ncmd3 {args} {return "ncmd3: $args"} } namespace import test_ns_import2::* test namespace-old-9.11 {imported commands can be removed by deleting them} { rename cmd1 "" lsort [concat [info commands cmd*] [info commands ncmd*]] } {cmd2 ncmd ncmd1 ncmd2} catch { rename cmd1 "" } test namespace-old-9.12 {command "namespace forget" checks for valid namespaces} { list [catch {namespace forget xyzzy::*} msg] $msg } {1 {unknown namespace in namespace forget pattern "xyzzy::*"}} test namespace-old-9.13 {command "namespace forget" ignores patterns that don't match} { list [catch {namespace forget test_ns_import::xy*zzy} msg] $msg \ [lsort [info commands cmd?]] } {0 {} cmd2} test namespace-old-9.14 {imported commands can be removed} { namespace forget test_ns_import::cmd? list [lsort [info commands cmd?]] \ [catch {cmd1 another test} msg] $msg } {{} 1 {invalid command name "cmd1"}} test namespace-old-9.15 {existing commands can't be overwritten} { proc cmd1 {x y} { return [expr {$x+$y}] } list [catch {namespace import test_ns_import::cmd?} msg] $msg \ [cmd1 3 5] } {1 {can't import command "cmd1": already exists} 8} test namespace-old-9.16 {use "-force" option to override existing commands} { proc cmd1 {x y} { return [expr {$x+$y}] } list [cmd1 3 5] \ [namespace import -force test_ns_import::cmd?] \ [cmd1 3 5] } {8 {} {cmd1: 3 5}} test namespace-old-9.17 {commands can be imported into many namespaces} { namespace eval test_ns_import_use { namespace import ::test_ns_import::* ::test_ns_import2::ncmd? lsort [concat [info commands ::test_ns_import_use::cmd*] \ [info commands ::test_ns_import_use::ncmd*]] } } {::test_ns_import_use::cmd1 ::test_ns_import_use::cmd2 ::test_ns_import_use::ncmd1 ::test_ns_import_use::ncmd2} test namespace-old-9.18 {when command is deleted, imported commands go away} { namespace eval test_ns_import { rename cmd1 "" } list [info commands cmd1] \ [namespace eval test_ns_import_use {info commands cmd1}] } {{} {}} test namespace-old-9.19 {when namesp is deleted, all imported commands go away} { namespace delete test_ns_import test_ns_import2 list [info commands cmd*] \ [info commands ncmd*] \ [namespace eval test_ns_import_use {info commands cmd*}] \ [namespace eval test_ns_import_use {info commands ncmd*}] \ } {{} {} {} {}} # ----------------------------------------------------------------------- # TEST: scoped values # ----------------------------------------------------------------------- test namespace-old-10.1 {define namespace for scope test} { namespace eval test_ns_inscope { variable x "x-value" proc show {args} { return "show: $args" } proc do {args} { return [eval $args] } list [set x] [show test] } } {x-value {show: test}} test namespace-old-10.2 {command "namespace code" requires one argument} { list [catch {namespace code} msg] $msg } {1 {wrong # args: should be "namespace code arg"}} test namespace-old-10.3 {command "namespace code" requires one argument} { list [catch {namespace code first "second arg" third} msg] $msg } {1 {wrong # args: should be "namespace code arg"}} test namespace-old-10.4 {command "namespace code" gets current namesp context} { namespace eval test_ns_inscope { namespace code {"1 2 3" "4 5" 6} } } {::namespace inscope ::test_ns_inscope {"1 2 3" "4 5" 6}} test namespace-old-10.5 {with one arg, first "scope" sticks} { set sval [namespace eval test_ns_inscope {namespace code {one two}}] namespace code $sval } {::namespace inscope ::test_ns_inscope {one two}} test namespace-old-10.6 {with many args, each "scope" adds new args} { set sval [namespace eval test_ns_inscope {namespace code {one two}}] namespace code "$sval three" } {::namespace inscope ::test_ns_inscope {one two} three} namespace eval test_ns_inscope { proc show {args} { return "show: $args" } } test namespace-old-10.7 {scoped commands work with eval} { set cref [namespace eval test_ns_inscope {namespace code show}] list [eval $cref "a" "b c" "d e f"] } {{show: a b c d e f}} namespace eval test_ns_inscope { variable x "x-value" } test namespace-old-10.8 {scoped commands execute in namespace context} { set cref [namespace eval test_ns_inscope { namespace code {set x "some new value"} }] list [set test_ns_inscope::x] [eval $cref] [set test_ns_inscope::x] } {x-value {some new value} {some new value}} foreach cmd [info commands test_ns_*] { rename $cmd "" } catch {rename cmd {}} catch {rename cmd1 {}} catch {rename cmd2 {}} catch {rename ncmd {}} catch {rename ncmd1 {}} catch {rename ncmd2 {}} catch {unset cref} catch {unset trigger} catch {unset trigger2} catch {unset sval} catch {unset msg} catch {unset x} catch {unset test_ns_var_global} catch {unset cmd} eval namespace delete [namespace children :: test_ns_*] # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/mutex.test0000644000175000017500000000565715104661341014771 0ustar sergeisergei# Commands covered: (test)mutex # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2025 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] testConstraint testmutex [expr {[info commands testmutex] ne {}}] namespace eval testmutex { namespace import ::tcltest::test proc testlock {id nthreads recursion iters yield} { test $id "mutex lock $nthreads/$recursion/$iters/$yield" \ -constraints testmutex \ -body "testmutex lock $nthreads $recursion $iters $yield" \ -result [expr {$nthreads*$iters}] } # threads recursions iterations yield testlock mutex-lock-1 2 1 1000000 0 testlock mutex-lock-2 2 1 1000000 1 testlock mutex-lock-3 10 1 200000 0 testlock mutex-lock-4 10 1 200000 1 testlock mutex-lock-5 4 5 400000 0 testlock mutex-lock-6 4 5 400000 1 proc fairness {totalOps perThreadOps} { set errors {} set threadTotal [tcl::mathop::+ {*}$perThreadOps] if {$threadTotal ne $totalOps} { append errors "Thread total $threadTotal != expected $totalOps\n" } # Each thread should get at least half of fair share set fairShare [expr {$totalOps / [llength $perThreadOps]}] foreach share $perThreadOps { if {$fairShare > 4*$share} { append errors "Thread share $share < 0.25 fair share $fairShare" } } return $errors } proc testcondition {id nthreads recursion iters yield} { set totalOps [expr {$nthreads*$iters}] test $id "mutex condition $nthreads/$recursion/$iters/$yield" \ -constraints testmutex \ -body { lassign \ [testmutex condition $nthreads $recursion $iters $yield] \ enqTotal enqPerThread enqTimeouts \ deqTotal deqPerThread deqTimeouts list \ $enqTotal [fairness $totalOps $enqPerThread] $enqTimeouts \ $deqTotal [fairness $totalOps $deqPerThread] $deqTimeouts } -result [list $totalOps {} 0 $totalOps {} 0] } testcondition mutex-condition-1 2 1 100000 0 testcondition mutex-condition-2 2 1 100000 1 testcondition mutex-condition-3 10 1 20000 0 testcondition mutex-condition-4 10 1 20000 1 testcondition mutex-condition-5 4 5 40000 0 testcondition mutex-condition-6 4 5 40000 1 } # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/msgcat.test0000644000175000017500000011114215104661341015070 0ustar sergeisergei# This file contains a collection of tests for the msgcat package. # Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1998 Mark Harrison. # Copyright © 1998-1999 Scriptics Corporation. # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Note that after running these tests, entries will be left behind in the # message catalogs for locales foo, foo_BAR, and foo_BAR_baz. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } if {[catch {package require msgcat 1.6}]} { puts stderr "Skipping tests in [info script]. No msgcat 1.6 found to test." return } namespace eval ::msgcat::test { namespace import ::msgcat::* namespace import ::tcltest::test namespace import ::tcltest::cleanupTests namespace import ::tcltest::temporaryDirectory namespace import ::tcltest::make* namespace import ::tcltest::remove* # Tests msgcat-0.*: locale initialization # Calculate set of all permutations of a list # PowerSet {1 2 3} -> {1 2 3} {2 3} {1 3} 3 {1 2} 2 1 {} proc PowerSet {l} { if {[llength $l] == 0} {return [list [list]]} set element [lindex $l 0] set rest [lrange $l 1 end] set result [list] foreach x [PowerSet $rest] { lappend result [linsert $x 0 $element] lappend result $x } return $result } variable envVars {LC_ALL LC_MESSAGES LANG} variable count 0 variable body variable result variable setVars foreach setVars [PowerSet $envVars] { set result [string tolower [lindex $setVars 0]] if {[string length $result] == 0} { if {[info exists ::tcl::mac::locale]} { if {[package vsatisfies [package provide msgcat] 1.7]} { set result [string tolower \ [msgcat::mcutil::ConvertLocale $::tcl::mac::locale]] } else { set result [string tolower \ [msgcat::ConvertLocale $::tcl::mac::locale]] } } else { if {([info sharedlibextension] eq ".dll") && ![catch {package require registry}]} { # Windows and Cygwin have other ways to determine the # locale when the environment variables are missing # and the registry package is present continue } set result c } } test msgcat-0.$count [list \ locale initialization from environment variables $setVars \ ] -setup { variable var foreach var $envVars { catch {variable $var $::env($var)} unset -nocomplain ::env($var) } foreach var $setVars { set ::env($var) $var } interp create [namespace current]::i i eval [list package ifneeded msgcat [package provide msgcat] \ [package ifneeded msgcat [package provide msgcat]]] i eval package require msgcat } -cleanup { interp delete [namespace current]::i foreach var $envVars { unset -nocomplain ::env($var) catch {set ::env($var) [set [namespace current]::$var]} } } -body {i eval msgcat::mclocale} -result $result incr count } unset -nocomplain result # Could add tests of initialization from Windows registry here. # Use a fake registry package. # Tests msgcat-1.*: [mclocale], [mcpreferences] test msgcat-1.3 {mclocale set, single element} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale en } -result en test msgcat-1.4 {mclocale get, single element} -setup { variable locale [mclocale] mclocale en } -cleanup { mclocale $locale } -body { mclocale } -result en test msgcat-1.5 {mcpreferences, single element} -setup { variable locale [mclocale] mclocale en } -cleanup { mclocale $locale } -body { mcpreferences } -result {en {}} test msgcat-1.6 {mclocale set, two elements} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale en_US } -result en_us test msgcat-1.7 {mclocale get, two elements} -setup { variable locale [mclocale] mclocale en_US } -cleanup { mclocale $locale } -body { mclocale } -result en_us test msgcat-1.8 {mcpreferences, two elements} -setup { variable locale [mclocale] mclocale en_US } -cleanup { mclocale $locale } -body { mcpreferences } -result {en_us en {}} test msgcat-1.9 {mclocale set, three elements} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale en_US_funky } -result en_us_funky test msgcat-1.10 {mclocale get, three elements} -setup { variable locale [mclocale] mclocale en_US_funky } -cleanup { mclocale $locale } -body { mclocale } -result en_us_funky test msgcat-1.11 {mcpreferences, three elements} -setup { variable locale [mclocale] mclocale en_US_funky } -cleanup { mclocale $locale } -body { mcpreferences } -result {en_us_funky en_us en {}} test msgcat-1.12 {mclocale set, reject evil input} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale /path/to/evil/code } -returnCodes error -match glob -result {invalid newLocale value *} test msgcat-1.13 {mclocale set, reject evil input} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale looks/ok/../../../../but/is/path/to/evil/code } -returnCodes error -match glob -result {invalid newLocale value *} test msgcat-1.14 {mcpreferences, custom locale preferences} -setup { variable locale [mclocale] mclocale en mcpreferences fr en {} } -cleanup { mclocale $locale } -body { mcpreferences } -result {fr en {}} test msgcat-1.15 {mcpreferences, overwrite custom locale preferences}\ -setup { variable locale [mclocale] mcpreferences fr en {} mclocale en } -cleanup { mclocale $locale } -body { mcpreferences } -result {en {}} # Tests msgcat-2.*: [mcset], [mcmset], namespace partitioning test msgcat-2.1 {mcset, global scope} { namespace eval :: ::msgcat::mcset foo_BAR text1 text2 } {text2} test msgcat-2.2 {mcset, global scope, default} { namespace eval :: ::msgcat::mcset foo_BAR text3 } {text3} test msgcat-2.2.1 {mcset, namespace overlap} { namespace eval baz {::msgcat::mcset foo_BAR con1 con1baz} } {con1baz} test msgcat-2.3 {mcset, namespace overlap} -setup { namespace eval bar {::msgcat::mcset foo_BAR con1 con1bar} namespace eval baz {::msgcat::mcset foo_BAR con1 con1baz} variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { namespace eval bar {::msgcat::mc con1} } -result con1bar test msgcat-2.4 {mcset, namespace overlap} -setup { namespace eval bar {::msgcat::mcset foo_BAR con1 con1bar} namespace eval baz {::msgcat::mcset foo_BAR con1 con1baz} variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { namespace eval baz {::msgcat::mc con1} } -result con1baz test msgcat-2.5 {mcmset, global scope} -setup { namespace eval :: { ::msgcat::mcmset foo_BAR { src1 trans1 src2 trans2 } } variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { namespace eval :: { ::msgcat::mc src1 } } -result trans1 test msgcat-2.6 {mcmset, namespace overlap} -setup { namespace eval bar {::msgcat::mcmset foo_BAR {con2 con2bar}} namespace eval baz {::msgcat::mcmset foo_BAR {con2 con2baz}} variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { namespace eval bar {::msgcat::mc con2} } -result con2bar test msgcat-2.7 {mcmset, namespace overlap} -setup { namespace eval bar {::msgcat::mcmset foo_BAR {con2 con2bar}} namespace eval baz {::msgcat::mcmset foo_BAR {con2 con2baz}} variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { namespace eval baz {::msgcat::mc con2} } -result con2baz # Tests msgcat-3.*: [mcset], [mc], catalog "inheritance" # # Test mcset and mc, ensuring that more specific locales # (e.g. en_UK) will search less specific locales # (e.g. en) for translation strings. # # Do this for the 15 permutations of # locales: {foo foo_BAR foo_BAR_baz} # strings: {ov0 ov1 ov2 ov3 ov4} # locale ROOT defines ov0, ov1, ov2, ov3 # locale foo defines ov1, ov2, ov3 # locale foo_BAR defines ov2, ov3 # locale foo_BAR_BAZ defines ov3 # (ov4 is defined in none) # So, # ov3 should be resolved in foo, foo_BAR, foo_BAR_baz # ov2 should be resolved in foo, foo_BAR # ov2 should resolve to foo_BAR in foo_BAR_baz # ov1 should be resolved in foo # ov1 should resolve to foo in foo_BAR, foo_BAR_baz # ov4 should be resolved in none, and call mcunknown # variable count 2 variable result array set result { foo,ov0 ov0_ROOT foo,ov1 ov1_foo foo,ov2 ov2_foo foo,ov3 ov3_foo foo,ov4 ov4 foo_BAR,ov0 ov0_ROOT foo_BAR,ov1 ov1_foo foo_BAR,ov2 ov2_foo_BAR foo_BAR,ov3 ov3_foo_BAR foo_BAR,ov4 ov4 foo_BAR_baz,ov0 ov0_ROOT foo_BAR_baz,ov1 ov1_foo foo_BAR_baz,ov2 ov2_foo_BAR foo_BAR_baz,ov3 ov3_foo_BAR_baz foo_BAR_baz,ov4 ov4 } variable loc variable string foreach loc {foo foo_BAR foo_BAR_baz} { foreach string {ov0 ov1 ov2 ov3 ov4} { test msgcat-3.$count {mcset, overlap} -setup { mcset {} ov0 ov0_ROOT mcset {} ov1 ov1_ROOT mcset {} ov2 ov2_ROOT mcset {} ov3 ov3_ROOT mcset foo ov1 ov1_foo mcset foo ov2 ov2_foo mcset foo ov3 ov3_foo mcset foo_BAR ov2 ov2_foo_BAR mcset foo_BAR ov3 ov3_foo_BAR mcset foo_BAR_baz ov3 ov3_foo_BAR_baz variable locale [mclocale] mclocale $loc } -cleanup { mclocale $locale } -body { mc $string } -result $result($loc,$string) incr count } } unset -nocomplain result # Tests msgcat-4.*: [mcunknown] test msgcat-4.2 {mcunknown, default} -setup { mcset foo unk1 "unknown 1" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { mc unk1 } -result {unknown 1} test msgcat-4.3 {mcunknown, default} -setup { mcset foo unk1 "unknown 1" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { mc unk2 } -result unk2 test msgcat-4.4 {mcunknown, overridden} -setup { rename ::msgcat::mcunknown SavedMcunknown proc ::msgcat::mcunknown {dom s} { return unknown:$dom:$s } mcset foo unk1 "unknown 1" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale rename ::msgcat::mcunknown {} rename SavedMcunknown ::msgcat::mcunknown } -body { mc unk1 } -result {unknown 1} test msgcat-4.5 {mcunknown, overridden} -setup { rename ::msgcat::mcunknown SavedMcunknown proc ::msgcat::mcunknown {dom s} { return unknown:$dom:$s } mcset foo unk1 "unknown 1" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale rename ::msgcat::mcunknown {} rename SavedMcunknown ::msgcat::mcunknown } -body { mc unk2 } -result {unknown:foo:unk2} test msgcat-4.6 {mcunknown, uplevel context} -setup { rename ::msgcat::mcunknown SavedMcunknown proc ::msgcat::mcunknown {dom s} { return "unknown:$dom:$s:[expr {[info level] - 1}]" } mcset foo unk1 "unknown 1" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale rename ::msgcat::mcunknown {} rename SavedMcunknown ::msgcat::mcunknown } -body { mc unk2 } -result unknown:foo:unk2:[info level] # Tests msgcat-5.*: [mcload] variable locales {{} foo foo_BAR foo_BAR_baz} set msgdir [makeDirectory msgdir] foreach loc $locales { if { $loc eq {} } { set msg ROOT } else { set msg [string tolower $loc] } makeFile [list ::msgcat::mcset $loc abc abc-$loc] $msg.msg $msgdir } variable count 1 foreach loc {foo foo_BAR foo_BAR_baz} { test msgcat-5.$count {mcload} -setup { variable locale [mclocale] ::msgcat::mclocale "" ::msgcat::mcloadedlocales clear ::msgcat::mcpackageconfig unset mcfolder mclocale $loc } -cleanup { mclocale $locale ::msgcat::mcloadedlocales clear ::msgcat::mcpackageconfig unset mcfolder } -body { mcload $msgdir } -result [expr { $count+1 }] incr count } # Even though foo_BAR_notexist does not exist, # foo_BAR, foo and the root should be loaded. test msgcat-5.4 {mcload} -setup { variable locale [mclocale] mclocale foo_BAR_notexist } -cleanup { mclocale $locale mcloadedlocales clear mcpackageconfig unset mcfolder } -body { mcload $msgdir } -result 3 test msgcat-5.5 {mcload} -setup { variable locale [mclocale] mclocale no_FI_notexist } -cleanup { mclocale $locale mcloadedlocales clear mcpackageconfig unset mcfolder } -body { mcload $msgdir } -result 1 test msgcat-5.6 {mcload} -setup { variable locale [mclocale] mclocale foo mcload $msgdir } -cleanup { mclocale $locale } -body { mc abc } -result abc-foo test msgcat-5.7 {mcload} -setup { variable locale [mclocale] mclocale foo_BAR mcload $msgdir } -cleanup { mclocale $locale } -body { mc abc } -result abc-foo_BAR test msgcat-5.8 {mcload} -setup { variable locale [mclocale] mclocale foo_BAR_baz mcload $msgdir } -cleanup { mclocale $locale } -body { mc abc } -result abc-foo_BAR_baz test msgcat-5.9 {mcload} -setup { variable locale [mclocale] mclocale no_FI_notexist mcload $msgdir } -cleanup { mclocale $locale } -body { mc abc } -result abc- test msgcat-5.10 {mcload} -setup { rename ::msgcat::mcunknown SavedMcunknown proc ::msgcat::mcunknown {dom s} { return unknown:$dom:$s } variable locale [mclocale] mclocale no_FI_notexist mcload $msgdir } -cleanup { mclocale $locale rename ::msgcat::mcunknown {} rename SavedMcunknown ::msgcat::mcunknown } -body { mc def } -result unknown:no_fi_notexist:def test msgcat-5.11 {mcpackageconfig mcfolder} -setup { variable locale [mclocale] mclocale "" mcloadedlocales clear mcpackageconfig unset mcfolder } -cleanup { mclocale $locale mcloadedlocales clear mcpackageconfig unset mcfolder } -body { mclocale foo mcpackageconfig set mcfolder $msgdir } -result 2 foreach loc $locales { if { $loc eq {} } { set msg ROOT } else { set msg [string tolower $loc] } removeFile $msg.msg $msgdir } removeDirectory msgdir # Tests msgcat-6.*: [mcset], [mc] namespace inheritance # # Test mcset and mc, ensuring that resolution for messages # proceeds from the current ns to its parent and so on to the # global ns. # # Do this for the 12 permutations of # locales: foo # namespaces: foo foo::bar foo::bar::baz # strings: {ov1 ov2 ov3 ov4} # namespace ::foo defines ov1, ov2, ov3 # namespace ::foo::bar defines ov2, ov3 # namespace ::foo::bar::baz defines ov3 # # ov4 is not defined in any namespace. # # So, # ov3 should be resolved in ::foo::bar::baz, ::foo::bar, ::foo; # ov2 should be resolved in ::foo, ::foo::bar # ov1 should be resolved in ::foo # ov4 should be resolved in none, and call mcunknown # variable result array set result { foo,ov1 ov1_foo foo,ov2 ov2_foo foo,ov3 ov3_foo foo,ov4 ov4 foo::bar,ov1 ov1_foo foo::bar,ov2 ov2_foo_bar foo::bar,ov3 ov3_foo_bar foo::bar,ov4 ov4 foo::bar::baz,ov1 ov1_foo foo::bar::baz,ov2 ov2_foo_bar foo::bar::baz,ov3 ov3_foo_bar_baz foo::bar::baz,ov4 ov4 } variable count 1 variable ns foreach ns {foo foo::bar foo::bar::baz} { foreach string {ov1 ov2 ov3 ov4} { test msgcat-6.$count {mcset, overlap} -setup { namespace eval foo { ::msgcat::mcset foo ov1 ov1_foo ::msgcat::mcset foo ov2 ov2_foo ::msgcat::mcset foo ov3 ov3_foo namespace eval bar { ::msgcat::mcset foo ov2 ov2_foo_bar ::msgcat::mcset foo ov3 ov3_foo_bar namespace eval baz { ::msgcat::mcset foo ov3 "ov3_foo_bar_baz" } } } variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale namespace delete foo } -body { namespace eval $ns [list ::msgcat::mc $string] } -result $result($ns,$string) incr count } } # Tests msgcat-7.*: [mc] extra args processed by [format] test msgcat-7.1 {mc extra args go through to format} -setup { mcset foo format1 "this is a test" mcset foo format2 "this is a %s" mcset foo format3 "this is a %s %s" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { mc format1 "good test" } -result "this is a test" test msgcat-7.2 {mc extra args go through to format} -setup { mcset foo format1 "this is a test" mcset foo format2 "this is a %s" mcset foo format3 "this is a %s %s" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { mc format2 "good test" } -result "this is a good test" test msgcat-7.3 {mc errors from format are propagated} -setup { mcset foo format1 "this is a test" mcset foo format2 "this is a %s" mcset foo format3 "this is a %s %s" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { catch {mc format3 "good test"} } -result 1 test msgcat-7.4 {mc, extra args are given to unknown} -setup { mcset foo format1 "this is a test" mcset foo format2 "this is a %s" mcset foo format3 "this is a %s %s" variable locale [mclocale] mclocale foo } -cleanup { mclocale $locale } -body { mc "this is a %s" "good test" } -result "this is a good test" # Tests msgcat-8.*: [mcflset] set msgdir1 [makeDirectory msgdir1] makeFile {::msgcat::mcflset k1 v1} l1.msg $msgdir1 test msgcat-8.1 {mcflset} -setup { variable locale [mclocale] mclocale l1 mcload $msgdir1 } -cleanup { mclocale $locale } -body { mc k1 } -result v1 removeFile l1.msg $msgdir1 removeDirectory msgdir1 set msgdir2 [makeDirectory msgdir2] set msgdir3 [makeDirectory msgdir3] makeFile "::msgcat::mcflset k2 v2 ; ::msgcat::mcload [list $msgdir3]"\ l2.msg $msgdir2 makeFile {::msgcat::mcflset k3 v3 ; ::msgcat::mcflmset {k4 v4 k5 v5}} l2.msg $msgdir3 # chained mcload test msgcat-8.2 {mcflset/mcflmset} -setup { variable locale [mclocale] mclocale l2 mcload $msgdir2 } -cleanup { mclocale $locale } -body { return [mc k2][mc k3]--[mc k4][mc k5] } -result v2v3--v4v5 removeFile l2.msg $msgdir2 removeDirectory msgdir2 removeDirectory msgdir3 # Tests msgcat-9.*: [mcexists] test msgcat-9.1 {mcexists no parameter} -body { mcexists } -returnCodes 1\ -result {wrong # args: should be "mcexists ?-exactnamespace? ?-exactlocale? ?-namespace ns? src"} test msgcat-9.2 {mcexists unknown option} -body { mcexists -unknown src } -returnCodes 1\ -result {unknown option "-unknown"} test msgcat-9.3 {mcexists} -setup { mcforgetpackage variable locale [mclocale] mclocale foo mcset foo k1 v1 } -cleanup { mclocale $locale } -body { list [mcexists k1] [mcexists k2] } -result {1 0} test msgcat-9.4 {mcexists descendent preference} -setup { mcforgetpackage variable locale [mclocale] mclocale foo_bar mcset foo k1 v1 } -cleanup { mclocale $locale } -body { list [mcexists k1] [mcexists -exactlocale k1] } -result {1 0} test msgcat-9.5 {mcexists parent namespace} -setup { mcforgetpackage variable locale [mclocale] mclocale foo_bar mcset foo k1 v1 } -cleanup { mclocale $locale namespace delete ::foo } -body { namespace eval ::foo { list [::msgcat::mcexists k1]\ [::msgcat::mcexists -namespace ::msgcat::test k1] } } -result {0 1} test msgcat-9.6 {mcexists -namespace ns parameter} -setup { mcforgetpackage variable locale [mclocale] mclocale foo_bar mcset foo k1 v1 } -cleanup { mclocale $locale namespace delete ::foo } -body { namespace eval ::foo { list [::msgcat::mcexists k1]\ [::msgcat::mcexists -namespace ::msgcat::test k1] } } -result {0 1} test msgcat-9.7 {mcexists -namespace - ns argument missing} -body { mcexists -namespace src } -returnCodes 1\ -result {Argument missing for switch "-namespace"} # Tests msgcat-10.*: [mcloadedlocales] test msgcat-10.1 {mcloadedlocales no arg} -body { mcloadedlocales } -returnCodes 1\ -result {wrong # args: should be "mcloadedlocales subcommand"} test msgcat-10.2 {mcloadedlocales wrong subcommand} -body { mcloadedlocales junk } -returnCodes 1\ -result {unknown subcommand "junk": must be clear, or loaded} test msgcat-10.3 {mcloadedlocales loaded} -setup { mcforgetpackage variable locale [mclocale] mclocale {} mcloadedlocales clear } -cleanup { mclocale $locale } -body { mclocale foo_bar # The result is position independent so sort set resultlist [lsort [mcloadedlocales loaded]] } -result {{} foo foo_bar} test msgcat-10.4 {mcloadedlocales clear} -setup { mcforgetpackage variable locale [mclocale] mclocale {} mcloadedlocales clear } -cleanup { mclocale $locale } -body { mclocale foo mcset foo k1 v1 set res [mcexists k1] mclocale "" mcloadedlocales clear mclocale foo lappend res [mcexists k1] } -result {1 0} # Tests msgcat-11.*: [mcforgetpackage] test msgcat-11.1 {mcforgetpackage translation} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale foo mcset foo k1 v1 set res [mcexists k1] mcforgetpackage lappend res [mcexists k1] } -result {1 0} test msgcat-11.2 {mcforgetpackage locale} -setup { variable locale [mclocale] } -cleanup { mclocale $locale } -body { mclocale foo mcpackagelocale set bar set res [mcpackagelocale get] mcforgetpackage lappend res [mcpackagelocale get] } -result {bar foo} test msgcat-11.3 {mcforgetpackage options} -body { mcpackageconfig set loadcmd "" set res [mcpackageconfig isset loadcmd] mcforgetpackage lappend res [mcpackageconfig isset loadcmd] } -result {1 0} # Tests msgcat-12.*: [mcpackagelocale] test msgcat-12.1 {mcpackagelocale no subcommand} -body { mcpackagelocale } -returnCodes 1\ -result {wrong # args: should be "mcpackagelocale subcommand ?arg ...?"} test msgcat-12.2 {mclpackagelocale wrong subcommand} -body { mcpackagelocale junk } -returnCodes 1\ -result {unknown subcommand "junk": must be clear, get, isset, loaded, present, set, or unset} test msgcat-12.2.1 {mclpackagelocale set multiple args} -body { mcpackagelocale set a b } -returnCodes 1\ -result {wrong # args: should be "mcpackagelocale set ?locale?"} test msgcat-12.3 {mcpackagelocale set} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo mcpackagelocale set bar list [mcpackagelocale get] [mclocale] } -result {bar foo} test msgcat-12.4 {mcpackagelocale get} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo set res [mcpackagelocale get] mcpackagelocale set bar lappend res [mcpackagelocale get] } -result {foo bar} test msgcat-12.5 {mcpackagelocale preferences} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo set res [list [mcpackagelocale preferences]] mcpackagelocale set bar lappend res [mcpackagelocale preferences] } -result {{foo {}} {bar {}}} test msgcat-12.6 {mcpackagelocale loaded} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale "" mcloadedlocales clear mclocale foo # The result is position independent so sort set res [list [lsort [mcpackagelocale loaded]]] mcpackagelocale set bar lappend res [lsort [mcpackagelocale loaded]] } -result {{{} foo} {{} bar foo}} test msgcat-12.7 {mcpackagelocale isset} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo set res [mcpackagelocale isset] mcpackagelocale set bar lappend res [mcpackagelocale isset] } -result {0 1} test msgcat-12.8 {mcpackagelocale unset} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mcpackagelocale set bar set res [mcpackagelocale isset] mcpackagelocale unset lappend res [mcpackagelocale isset] } -result {1 0} test msgcat-12.9 {mcpackagelocale present} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale "" mcloadedlocales clear mclocale foo set res [mcpackagelocale present foo] lappend res [mcpackagelocale present bar] mcpackagelocale set bar lappend res [mcpackagelocale present foo]\ [mcpackagelocale present bar] } -result {1 0 1 1} test msgcat-12.10 {mcpackagelocale clear} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale "" mcloadedlocales clear mclocale foo mcpackagelocale set bar mcpackagelocale clear list [mcpackagelocale present foo] [mcpackagelocale present bar] } -result {0 1} test msgcat-12.11 {mcpackagelocale custom preferences} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo set res [list [mcpackagelocale preferences]] mcpackagelocale preferences bar {} lappend res [mcpackagelocale preferences] } -result {{foo {}} {bar {}}} test msgcat-12.12 {mcpackagelocale preferences -> no isset} -setup { variable locale [mclocale] } -cleanup { mclocale $locale mcforgetpackage } -body { mclocale foo mcpackagelocale preferences mcpackagelocale isset } -result {0} # Tests msgcat-13.*: [mcpackageconfig subcmds] test msgcat-13.1 {mcpackageconfig no subcommand} -body { mcpackageconfig } -returnCodes 1\ -result {wrong # args: should be "mcpackageconfig subcommand option ?value?"} test msgcat-13.2 {mclpackageconfig wrong subcommand} -body { mcpackageconfig junk mcfolder } -returnCodes 1\ -result {unknown subcommand "junk": must be get, isset, set, or unset} test msgcat-13.3 {mclpackageconfig wrong option} -body { mcpackageconfig get junk } -returnCodes 1\ -result {bad option "junk": must be mcfolder, loadcmd, changecmd, or unknowncmd} test msgcat-13.4 {mcpackageconfig get} -setup { mcforgetpackage } -cleanup { mcforgetpackage } -body { mcpackageconfig set loadcmd "" mcpackageconfig get loadcmd } -result {} test msgcat-13.5 {mcpackageconfig (is/un)set} -setup { mcforgetpackage } -cleanup { mcforgetpackage } -body { set res [mcpackageconfig isset loadcmd] lappend res [mcpackageconfig set loadcmd ""] lappend res [mcpackageconfig isset loadcmd] mcpackageconfig unset loadcmd lappend res [mcpackageconfig isset loadcmd] } -result {0 0 1 0} # option mcfolder is already tested with 5.11 # Tests msgcat-14.*: callbacks: loadcmd, changecmd, unknowncmd # This routine is used as bgerror and by direct callback invocation proc callbackproc args { variable resultvariable set resultvariable $args } proc callbackfailproc args { return -code error fail } set bgerrorsaved [interp bgerror {}] interp bgerror {} [namespace code callbackproc] variable locale if {![info exist locale]} { set locale [mclocale] } test msgcat-14.1 {invocation loadcmd} -setup { mcforgetpackage mclocale $locale mclocale "" mcloadedlocales clear set resultvariable "" } -cleanup { mcforgetpackage } -body { mcpackageconfig set loadcmd [namespace code callbackproc] mclocale foo_bar lsort $resultvariable } -result {foo foo_bar} test msgcat-14.2 {invocation failed in loadcmd} -setup { mcforgetpackage mclocale $locale mclocale "" mcloadedlocales clear } -cleanup { mcforgetpackage after cancel set [namespace current]::resultvariable timeout } -body { mcpackageconfig set loadcmd [namespace code callbackfailproc] mclocale foo_bar # let the bgerror run after 100 set [namespace current]::resultvariable timeout vwait [namespace current]::resultvariable lassign $resultvariable err errdict list $err [dict get $errdict -code] } -result {fail 1} test msgcat-14.3 {invocation changecmd} -setup { mcforgetpackage mclocale $locale mclocale "" set resultvariable "" } -cleanup { mcforgetpackage } -body { mcpackageconfig set changecmd [namespace code callbackproc] mclocale foo_bar set resultvariable } -result {foo_bar foo {}} test msgcat-14.4 {invocation unknowncmd} -setup { mcforgetpackage mclocale $locale mclocale "" mcloadedlocales clear set resultvariable "" } -cleanup { mcforgetpackage } -body { mcpackageconfig set unknowncmd [namespace code callbackproc] mclocale foo_bar mc k1 p1 set resultvariable } -result {foo_bar k1 p1} test msgcat-14.5 {disable global unknowncmd} -setup { mcforgetpackage mclocale $locale mclocale "" mcloadedlocales clear set resultvariable "" rename ::msgcat::mcunknown SavedMcunknown proc ::msgcat::mcunknown {dom s} { return unknown:$dom:$s } } -cleanup { mcforgetpackage rename ::msgcat::mcunknown {} rename SavedMcunknown ::msgcat::mcunknown } -body { mcpackageconfig set unknowncmd "" mclocale foo_bar mc k1%s p1 } -result {k1p1} test msgcat-14.6 {unknowncmd failing} -setup { mcforgetpackage mclocale $locale mclocale "" mcloadedlocales clear set resultvariable "" } -cleanup { mcforgetpackage } -body { mcpackageconfig set unknowncmd [namespace code callbackfailproc] mclocale foo_bar mc k1 } -returnCodes 1\ -result {fail} # Tests msgcat-15.*: tcloo coverage # There are 4 use-cases, where 3 must be tested now: # - namespace defined, in class definition, class defined oo, classless test msgcat-15.1 {mc in class setup} -setup { # full namespace is ::msgcat::test:bar namespace eval bar { ::msgcat::mcset foo_BAR con2 con2bar oo::class create ClassCur } variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale namespace eval bar {::msgcat::mcforgetpackage} namespace delete bar } -body { oo::define bar::ClassCur msgcat::mc con2 } -result con2bar test msgcat-15.2 {mc in class} -setup { # full namespace is ::msgcat::test:bar namespace eval bar { ::msgcat::mcset foo_BAR con2 con2bar oo::class create ClassCur oo::define ClassCur method method1 {} {::msgcat::mc con2} } # full namespace is ::msgcat::test:baz namespace eval baz { set ObjCur [::msgcat::test::bar::ClassCur new] } variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale namespace eval bar {::msgcat::mcforgetpackage} namespace delete bar baz } -body { $baz::ObjCur method1 } -result con2bar test msgcat-15.3 {mc in classless object} -setup { # full namespace is ::msgcat::test:bar namespace eval bar { ::msgcat::mcset foo_BAR con2 con2bar oo::object create ObjCur oo::objdefine ObjCur method method1 {} {::msgcat::mc con2} } variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale namespace eval bar {::msgcat::mcforgetpackage} namespace delete bar } -body { bar::ObjCur method1 } -result con2bar test msgcat-15.4 {mc in classless object with explicite namespace eval}\ -setup { # full namespace is ::msgcat::test:bar namespace eval bar { ::msgcat::mcset foo_BAR con2 con2bar oo::object create ObjCur oo::objdefine ObjCur method method1 {} { namespace eval ::msgcat::test::baz { ::msgcat::mc con2 } } } namespace eval baz { ::msgcat::mcset foo_BAR con2 con2baz } variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale namespace eval bar {::msgcat::mcforgetpackage} namespace eval baz {::msgcat::mcforgetpackage} namespace delete bar baz } -body { bar::ObjCur method1 } -result con2baz # HaO 2024-07-15 fix me # Ticket 91b3a5bb: I have no idea what the following case should do. # But currently, it raises an error and that should not happen. # The background is the tklib tooltip package. # This package captures the caller namespace to later invoke msgcat with current data. # If the caller namespace is a method, it currently fails. test msgcat-15.5 {ticket 91b3a5bb: method namespace recorded and evaluated gives error}\ -setup { oo::class create App {} oo::define App { constructor {} { my add_one } method add_one {} { recordMsgcat } } proc ::recordMsgcat {} { set ::nscaller [uplevel 1 {namespace current}] } set application [App new] } -cleanup { $application destroy App destroy unset -nocomplain ::nscaller rename ::recordMsgcat "" } -body { namespace eval $::nscaller [list ::msgcat::mc "Test"] } -returnCodes ok -result Test # Test msgcat-16.*: command mcpackagenamespaceget test msgcat-16.1 {mcpackagenamespaceget in namespace procedure} -body { namespace eval baz {msgcat::mcpackagenamespaceget} } -result ::msgcat::test::baz test msgcat-16.2 {mcpackagenamespaceget in class setup} -setup { namespace eval bar { oo::class create ClassCur oo::define ClassCur variable a } } -cleanup { namespace delete bar } -body { oo::define bar::ClassCur msgcat::mcpackagenamespaceget } -result ::msgcat::test::bar test msgcat-16.3 {mcpackagenamespaceget in class} -setup { namespace eval bar { oo::class create ClassCur oo::define ClassCur method method1 {} {msgcat::mcpackagenamespaceget} } namespace eval baz { set ObjCur [::msgcat::test::bar::ClassCur new] } } -cleanup { namespace delete bar baz } -body { $baz::ObjCur method1 } -result ::msgcat::test::bar test msgcat-16.4 {mcpackagenamespaceget in classless object} -setup { namespace eval bar { oo::object create ObjCur oo::objdefine ObjCur method method1 {} {msgcat::mcpackagenamespaceget} } } -cleanup { namespace delete bar } -body { bar::ObjCur method1 } -result ::msgcat::test::bar test msgcat-16.5\ {mcpackagenamespaceget in classless object with explicite namespace eval}\ -setup { namespace eval bar { oo::object create ObjCur oo::objdefine ObjCur method method1 {} { namespace eval ::msgcat::test::baz { msgcat::mcpackagenamespaceget } } } } -cleanup { namespace delete bar baz } -body { bar::ObjCur method1 } -result ::msgcat::test::baz # Test msgcat-17.*: mcn command test msgcat-17.1 {mcn no parameters} -body { mcn } -returnCodes 1\ -result {wrong # args: should be "mcn ns src ?arg ...?"} test msgcat-17.2 {mcn} -setup { namespace eval bar {::msgcat::mcset foo_BAR con1 con1bar} variable locale [mclocale] mclocale foo_BAR } -cleanup { mclocale $locale } -body { ::msgcat::mcn [namespace current]::bar con1 } -result con1bar interp bgerror {} $bgerrorsaved # Tests msgcat-18.*: [mcutil] test msgcat-18.1 {mcutil - no argument} -body { mcutil } -returnCodes 1\ -result {wrong # args: should be "mcutil subcommand ?arg ...?"} test msgcat-18.2 {mcutil - wrong argument} -body { mcutil junk } -returnCodes 1\ -result {unknown subcommand "junk": must be getpreferences, or getsystemlocale} test msgcat-18.3 {mcutil - partial argument} -body { mcutil getsystem } -returnCodes 1\ -result {unknown subcommand "getsystem": must be getpreferences, or getsystemlocale} test msgcat-18.4 {mcutil getpreferences - no argument} -body { mcutil getpreferences } -returnCodes 1\ -result {wrong # args: should be "mcutil getpreferences locale"} test msgcat-18.5 {mcutil getpreferences - DE_de} -body { mcutil getpreferences DE_de } -result {de_de de {}} test msgcat-18.6 {mcutil getsystemlocale - wrong argument} -body { mcutil getsystemlocale DE_de } -returnCodes 1\ -result {wrong # args: should be "mcutil getsystemlocale"} # The result is system dependent # So just test if it runs # The environment variable version was test with test 0.x test msgcat-18.7 {mcutil getsystemlocale} -body { mcutil getsystemlocale set ok ok } -result {ok} cleanupTests } namespace delete ::msgcat::test return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/misc.test0000644000175000017500000000411615104661341014547 0ustar sergeisergei# Commands covered: various # # This file contains a collection of miscellaneous Tcl tests that # don't fit naturally in any of the other test files. Many of these # tests are pathological cases that caused bugs in earlier Tcl # releases. # # Copyright © 1992-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testhashsystemhash [llength [info commands testhashsystemhash]] test misc-1.1 {error in variable ref. in command in array reference} { proc tstProc {} { global a set tst $a([winfo name $zz]) # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment } set msg {} list [catch tstProc msg] $msg } {1 {can't read "zz": no such variable}} test misc-1.2 {error in variable ref. in command in array reference} { proc tstProc {} " global a set tst \$a(\[winfo name \$\{zz) # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment # this is a bogus comment " set msg {} join [list [catch tstProc msg] $msg $::errorInfo] \n } [subst -novariables -nocommands {1 missing close-brace for variable name missing close-brace for variable name while executing "set tst $a([winfo name $\{" (procedure "tstProc" line 4) invoked from within "tstProc"}] for {set i 1} {$i<300} {incr i} { test misc-2.$i {hash table with sys-alloc} testhashsystemhash \ "testhashsystemhash $i" OK } # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/mathop.test0000644000175000017500000016050215104661341015106 0ustar sergeisergei# Commands covered: ::tcl::mathop::... # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 2006 Donal K. Fellows # Copyright © 2006 Peter Spjuth # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # A namespace to test that operators are exported and that they # work when imported namespace eval ::testmathop2 { namespace import ::tcl::mathop::* } # Helper to test math ops. # Test different invocation variants and see that they do the same thing. # Byte compiled / non byte compiled version # Shared / unshared arguments # Original / imported proc TestOp {op args} { set results {} # Non byte compiled version, shared args if {[catch {::tcl::mathop::$op {*}$args} res]} { append res " $::errorCode" } lappend results $res # Non byte compiled version, unshared args set cmd ::tcl::mathop::\$op foreach arg $args { append cmd " \[format %s [list $arg]\]" } if {[catch $cmd res]} { append res " $::errorCode" } lappend results $res # Non byte compiled imported if {[catch {::testmathop2::$op {*}$args} res]} { append res " $::errorCode" } lappend results [string map {testmathop2 tcl::mathop} $res] # BC version set argList1 {} set argList2 {} set argList3 {} for {set t 0} {$t < [llength $args]} {incr t} { lappend argList1 a$t lappend argList2 \$a$t lappend argList3 "\[format %s \$a$t\]" } # Shared args proc _TestOp $argList1 "::tcl::mathop::$op [join $argList2]" # Unshared args proc _TestOp2 $argList1 "::tcl::mathop::$op [join $argList3]" # Imported proc _TestOp3 $argList1 "::testmathop2::$op [join $argList2]" set ::tcl_traceCompile 0 ;# Set to 2 to help with debug if {[catch {_TestOp {*}$args} res]} { append res " $::errorCode" } set ::tcl_traceCompile 0 lappend results $res if {[catch {_TestOp2 {*}$args} res]} { append res " $::errorCode" } lappend results $res if {[catch {_TestOp3 {*}$args} res]} { append res " $::errorCode" } lappend results [string map {testmathop2 tcl::mathop} $res] # Check that they do the same set len [llength $results] for {set i 0} {$i < ($len - 1)} {incr i} { set res1 [lindex $results $i] set res2 [lindex $results $i+1] if {$res1 ne $res2} { return "$i:($res1 != $res2)" } } return [lindex $results 0] } # start of tests namespace eval ::testmathop { namespace path ::tcl::mathop variable op ;# stop surprises! test mathop-1.1 {compiled +} { + } 0 test mathop-1.2 {compiled +} { + 1 } 1 test mathop-1.3 {compiled +} { + 1 2 } 3 test mathop-1.4 {compiled +} { + 1 2 3 } 6 test mathop-1.5 {compiled +} { + 1.0 2 3 } 6.0 test mathop-1.6 {compiled +} { + 1 2 3.0 } 6.0 test mathop-1.7 {compiled +} { + 100000000000 2 3 } 100000000005 test mathop-1.8 {compiled +} { + 1 2 300000000000 } 300000000003 test mathop-1.9 {compiled +} { + 1000000000000000000000 2 3 } 1000000000000000000005 test mathop-1.10 {compiled +} { + 1 2 3000000000000000000000 } 3000000000000000000003 test mathop-1.11 {compiled +: errors} -returnCodes error -body { + x 0 } -result {cannot use non-numeric string "x" as left operand of "+"} test mathop-1.12 {compiled +: errors} -returnCodes error -body { + nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "+"} test mathop-1.13 {compiled +: errors} -returnCodes error -body { + 0 x } -result {cannot use non-numeric string "x" as right operand of "+"} test mathop-1.14 {compiled +: errors} -returnCodes error -body { + 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "+"} test mathop-1.15 {compiled +: errors} -returnCodes error -body { + 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "+"} test mathop-1.16 {compiled +: errors} -returnCodes error -body { + 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "+"} test mathop-1.17 {compiled +: errors} -returnCodes error -body { + 0 [error expectedError] } -result expectedError test mathop-1.18 {compiled +: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { + [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} set op + test mathop-1.19 {interpreted +} { $op } 0 test mathop-1.20 {interpreted +} { $op 1 } 1 test mathop-1.21 {interpreted +} { $op 1 2 } 3 test mathop-1.22 {interpreted +} { $op 1 2 3 } 6 test mathop-1.23 {interpreted +} { $op 1.0 2 3 } 6.0 test mathop-1.24 {interpreted +} { $op 1 2 3.0 } 6.0 test mathop-1.25 {interpreted +} { $op 100000000000 2 3 } 100000000005 test mathop-1.26 {interpreted +} { $op 1 2 300000000000 } 300000000003 test mathop-1.27 {interpreted +} { $op 1000000000000000000000 2 3 } 1000000000000000000005 test mathop-1.28 {interpreted +} { $op 1 2 3000000000000000000000 } 3000000000000000000003 test mathop-1.29 {interpreted +: errors} -returnCodes error -body { $op x 0 } -result {cannot use non-numeric string "x" as left operand of "+"} test mathop-1.30 {interpreted +: errors} -returnCodes error -body { $op nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "+"} test mathop-1.31 {interpreted +: errors} -returnCodes error -body { $op 0 x } -result {cannot use non-numeric string "x" as right operand of "+"} test mathop-1.32 {interpreted +: errors} -returnCodes error -body { $op 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "+"} test mathop-1.33 {interpreted +: errors} -returnCodes error -body { $op 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "+"} test mathop-1.34 {interpreted +: errors} -returnCodes error -body { $op 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "+"} test mathop-1.35 {interpreted +: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError test mathop-1.36 {interpreted +: argument processing order} -body { list [catch { $op [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-2.1 {compiled *} { * } 1 test mathop-2.2 {compiled *} { * 2 } 2 test mathop-2.3 {compiled *} { * 2 3 } 6 test mathop-2.4 {compiled *} { * 2 3 4 } 24 test mathop-2.5 {compiled *} { * 1.0 2 3 } 6.0 test mathop-2.6 {compiled *} { * 1 2 3.0 } 6.0 test mathop-2.7 {compiled *} { * 100000000000 2 3 } 600000000000 test mathop-2.8 {compiled *} { * 1 2 300000000000 } 600000000000 test mathop-2.9 {compiled *} { * 1000000000000000000000 2 3 } 6000000000000000000000 test mathop-2.10 {compiled *} { * 1 2 3000000000000000000000 } 6000000000000000000000 test mathop-2.11 {compiled *: errors} -returnCodes error -body { * x 0 } -result {cannot use non-numeric string "x" as left operand of "*"} test mathop-2.12 {compiled *: errors} -returnCodes error -body { * nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "*"} test mathop-2.13 {compiled *: errors} -returnCodes error -body { * 0 x } -result {cannot use non-numeric string "x" as right operand of "*"} test mathop-2.14 {compiled *: errors} -returnCodes error -body { * 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "*"} test mathop-2.15 {compiled *: errors} -returnCodes error -body { * 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "*"} test mathop-2.16 {compiled *: errors} -returnCodes error -body { * 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "*"} test mathop-2.17 {compiled *: errors} -returnCodes error -body { * 0 [error expectedError] } -result expectedError test mathop-2.18 {compiled *: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { * [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} set op * test mathop-2.19 {interpreted *} { $op } 1 test mathop-2.20 {interpreted *} { $op 2 } 2 test mathop-2.21 {interpreted *} { $op 2 3 } 6 test mathop-2.22 {interpreted *} { $op 2 3 4 } 24 test mathop-2.23 {interpreted *} { $op 1.0 2 3 } 6.0 test mathop-2.24 {interpreted *} { $op 1 2 3.0 } 6.0 test mathop-2.25 {interpreted *} { $op 100000000000 2 3 } 600000000000 test mathop-2.26 {interpreted *} { $op 1 2 300000000000 } 600000000000 test mathop-2.27 {interpreted *} { $op 1000000000000000000000 2 3 } 6000000000000000000000 test mathop-2.28 {interpreted *} { $op 1 2 3000000000000000000000 } 6000000000000000000000 test mathop-2.29 {interpreted *: errors} -returnCodes error -body { $op x 0 } -result {cannot use non-numeric string "x" as left operand of "*"} test mathop-2.30 {interpreted *: errors} -returnCodes error -body { $op nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "*"} test mathop-2.31 {interpreted *: errors} -returnCodes error -body { $op 0 x } -result {cannot use non-numeric string "x" as right operand of "*"} test mathop-2.32 {interpreted *: errors} -returnCodes error -body { $op 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "*"} test mathop-2.33 {interpreted *: errors} -returnCodes error -body { $op 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "*"} test mathop-2.34 {interpreted *: errors} -returnCodes error -body { $op 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "*"} test mathop-2.35 {interpreted *: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError test mathop-2.36 {interpreted *: argument processing order} -body { list [catch { $op [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-3.1 {compiled !} {! 0} 1 test mathop-3.2 {compiled !} {! 1} 0 test mathop-3.3 {compiled !} {! false} 1 test mathop-3.4 {compiled !} {! true} 0 test mathop-3.5 {compiled !} {! 0.0} 1 test mathop-3.6 {compiled !} {! 10000000000} 0 test mathop-3.7 {compiled !} {! 10000000000000000000000000} 0 test mathop-3.8 {compiled !: errors} -body { ! foobar } -returnCodes error -result {cannot use non-numeric string "foobar" as operand of "!"} test mathop-3.9 {compiled !: errors} -body { ! 0 0 } -returnCodes error -result "wrong # args: should be \"! boolean\"" test mathop-3.10 {compiled !: errors} -body { ! } -returnCodes error -result "wrong # args: should be \"! boolean\"" set op ! test mathop-3.11 {interpreted !} {$op 0} 1 test mathop-3.12 {interpreted !} {$op 1} 0 test mathop-3.13 {interpreted !} {$op false} 1 test mathop-3.14 {interpreted !} {$op true} 0 test mathop-3.15 {interpreted !} {$op 0.0} 1 test mathop-3.16 {interpreted !} {$op 10000000000} 0 test mathop-3.17 {interpreted !} {$op 10000000000000000000000000} 0 test mathop-3.18 {interpreted !: errors} -body { $op foobar } -returnCodes error -result {cannot use non-numeric string "foobar" as operand of "!"} test mathop-3.19 {interpreted !: errors} -body { $op 0 0 } -returnCodes error -result "wrong # args: should be \"! boolean\"" test mathop-3.20 {interpreted !: errors} -body { $op } -returnCodes error -result "wrong # args: should be \"! boolean\"" test mathop-3.21 {compiled !: error} -returnCodes error -body { ! NaN } -result {cannot use non-numeric floating-point value "NaN" as operand of "!"} test mathop-3.22 {interpreted !: error} -returnCodes error -body { $op NaN } -result {cannot use non-numeric floating-point value "NaN" as operand of "!"} test mathop-4.1 {compiled ~} {~ 0} -1 test mathop-4.2 {compiled ~} {~ 1} -2 test mathop-4.3 {compiled ~} {~ 31} -32 test mathop-4.4 {compiled ~} {~ -127} 126 test mathop-4.5 {compiled ~} {~ -0} -1 test mathop-4.6 {compiled ~} {~ 10000000000} -10000000001 test mathop-4.7 {compiled ~} {~ 10000000000000000000000000} -10000000000000000000000001 test mathop-4.8 {compiled ~: errors} -body { ~ foobar } -returnCodes error -result {cannot use non-numeric string "foobar" as operand of "~"} test mathop-4.9 {compiled ~: errors} -body { ~ 0 0 } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.10 {compiled ~: errors} -body { ~ } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.11 {compiled ~: errors} -returnCodes error -body { ~ 0.0 } -result {cannot use floating-point value "0.0" as operand of "~"} test mathop-4.12 {compiled ~: errors} -returnCodes error -body { ~ NaN } -result {cannot use non-numeric floating-point value "NaN" as operand of "~"} set op ~ test mathop-4.13 {interpreted ~} {$op 0} -1 test mathop-4.14 {interpreted ~} {$op 1} -2 test mathop-4.15 {interpreted ~} {$op 31} -32 test mathop-4.16 {interpreted ~} {$op -127} 126 test mathop-4.17 {interpreted ~} {$op -0} -1 test mathop-4.18 {interpreted ~} {$op 10000000000} -10000000001 test mathop-4.19 {interpreted ~} {$op 10000000000000000000000000} -10000000000000000000000001 test mathop-4.20 {interpreted ~: errors} -body { $op foobar } -returnCodes error -result {cannot use non-numeric string "foobar" as operand of "~"} test mathop-4.21 {interpreted ~: errors} -body { $op 0 0 } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.22 {interpreted ~: errors} -body { $op } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.23 {interpreted ~: errors} -returnCodes error -body { $op 0.0 } -result {cannot use floating-point value "0.0" as operand of "~"} test mathop-4.24 {interpreted ~: errors} -returnCodes error -body { $op NaN } -result {cannot use non-numeric floating-point value "NaN" as operand of "~"} test mathop-5.1 {compiled eq} {eq {} a} 0 test mathop-5.2 {compiled eq} {eq a a} 1 test mathop-5.3 {compiled eq} {eq a {}} 0 test mathop-5.4 {compiled eq} {eq a b} 0 test mathop-5.5 {compiled eq} { eq } 1 test mathop-5.6 {compiled eq} {eq a} 1 test mathop-5.7 {compiled eq} {eq a a a} 1 test mathop-5.8 {compiled eq} {eq a a b} 0 test mathop-5.9 {compiled eq} -body { eq a b [error foobar] } -returnCodes error -result foobar test mathop-5.10 {compiled eq} {eq NaN Na NaN} 0 set op eq test mathop-5.11 {interpreted eq} {$op {} a} 0 test mathop-5.12 {interpreted eq} {$op a a} 1 test mathop-5.13 {interpreted eq} {$op a {}} 0 test mathop-5.14 {interpreted eq} {$op a b} 0 test mathop-5.15 {interpreted eq} { $op } 1 test mathop-5.16 {interpreted eq} {$op a} 1 test mathop-5.17 {interpreted eq} {$op a a a} 1 test mathop-5.18 {interpreted eq} {$op a a b} 0 test mathop-5.19 {interpreted eq} -body { $op a b [error foobar] } -returnCodes error -result foobar test mathop-5.20 {interpreted eq} {$op NaN Na NaN} 0 variable big1 12135435435354435435342423948763867876 variable big2 2746237174783836746262564892918327847 variable wide1 12345678912345 variable wide2 87321847232215 variable small1 87345 variable small2 16753 test mathop-6.1 {compiled &} { & } -1 test mathop-6.2 {compiled &} { & 1 } 1 test mathop-6.3 {compiled &} { & 1 2 } 0 test mathop-6.4 {compiled &} { & 3 7 6 } 2 test mathop-6.5 {compiled &} -returnCodes error -body { & 1.0 2 3 } -result {cannot use floating-point value "1.0" as right operand of "&"} test mathop-6.6 {compiled &} -returnCodes error -body { & 1 2 3.0 } -result {cannot use floating-point value "3.0" as left operand of "&"} test mathop-6.7 {compiled &} { & 100000000002 18 -126 } 2 test mathop-6.8 {compiled &} { & 0xff 0o377 333333333333 } 85 test mathop-6.9 {compiled &} { & 1000000000000000000002 18 -126 } 2 test mathop-6.10 {compiled &} { & 0xff 0o377 3333333333333333333333 } 85 test mathop-6.11 {compiled &: errors} -returnCodes error -body { & x 0 } -result {cannot use non-numeric string "x" as left operand of "&"} test mathop-6.12 {compiled &: errors} -returnCodes error -body { & nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "&"} test mathop-6.13 {compiled &: errors} -returnCodes error -body { & 0 x } -result {cannot use non-numeric string "x" as right operand of "&"} test mathop-6.14 {compiled &: errors} -returnCodes error -body { & 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "&"} test mathop-6.15 {compiled &: errors} -returnCodes error -body { & 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "&"} test mathop-6.16 {compiled &: errors} -returnCodes error -body { & 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "&"} test mathop-6.17 {compiled &: errors} -returnCodes error -body { & 0 [error expectedError] } -result expectedError test mathop-6.18 {compiled &: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { & [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} set op & test mathop-6.19 {interpreted &} { $op } -1 test mathop-6.20 {interpreted &} { $op 1 } 1 test mathop-6.21 {interpreted &} { $op 1 2 } 0 test mathop-6.22 {interpreted &} { $op 3 7 6 } 2 test mathop-6.23 {interpreted &} -returnCodes error -body { $op 1.0 2 3 } -result {cannot use floating-point value "1.0" as left operand of "&"} test mathop-6.24 {interpreted &} -returnCodes error -body { $op 1 2 3.0 } -result {cannot use floating-point value "3.0" as right operand of "&"} test mathop-6.25 {interpreted &} { $op 100000000002 18 -126 } 2 test mathop-6.26 {interpreted &} { $op 0xff 0o377 333333333333 } 85 test mathop-6.27 {interpreted &} { $op 1000000000000000000002 18 -126 } 2 test mathop-6.28 {interpreted &} { $op 0xff 0o377 3333333333333333333333 } 85 test mathop-6.29 {interpreted &: errors} -returnCodes error -body { $op x 0 } -result {cannot use non-numeric string "x" as left operand of "&"} test mathop-6.30 {interpreted &: errors} -returnCodes error -body { $op nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "&"} test mathop-6.31 {interpreted &: errors} -returnCodes error -body { $op 0 x } -result {cannot use non-numeric string "x" as right operand of "&"} test mathop-6.32 {interpreted &: errors} -returnCodes error -body { $op 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "&"} test mathop-6.33 {interpreted &: errors} -returnCodes error -body { $op 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "&"} test mathop-6.34 {interpreted &: errors} -returnCodes error -body { $op 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "&"} test mathop-6.35 {interpreted &: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError test mathop-6.36 {interpreted &: argument processing order} -body { list [catch { $op [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-6.37 {& and bignums} { list [& $big1 $big2] [$op $big1 $big2] } {712439449294653815890598856501796 712439449294653815890598856501796} test mathop-6.38 {& and bignums} { list [& $big1 $wide2] [$op $big1 $wide2] } {78521450111684 78521450111684} test mathop-6.39 {& and bignums} { list [& $big1 $small2] [$op $big1 $small2] } {96 96} test mathop-6.40 {& and bignums} { list [& $wide1 $big2] [$op $wide1 $big2] } {2371422390785 2371422390785} test mathop-6.41 {& and bignums} { list [& $wide1 $wide2] [$op $wide1 $wide2] } {12275881497169 12275881497169} test mathop-6.42 {& and bignums} { list [& $wide1 $small2] [$op $wide1 $small2] } {16721 16721} test mathop-6.43 {& and bignums} { list [& $small1 $big2] [$op $small1 $big2] } {33 33} test mathop-6.44 {& and bignums} { list [& $small1 $wide2] [$op $small1 $wide2] } {87057 87057} test mathop-6.45 {& and bignums} { list [& $small1 $small2] [$op $small1 $small2] } {16689 16689} test mathop-7.1 {compiled |} { | } 0 test mathop-7.2 {compiled |} { | 1 } 1 test mathop-7.3 {compiled |} { | 1 2 } 3 test mathop-7.4 {compiled |} { | 3 7 6 } 7 test mathop-7.5 {compiled |} -returnCodes error -body { | 1.0 2 3 } -result {cannot use floating-point value "1.0" as right operand of "|"} test mathop-7.6 {compiled |} -returnCodes error -body { | 1 2 3.0 } -result {cannot use floating-point value "3.0" as left operand of "|"} test mathop-7.7 {compiled |} { | 100000000002 18 -126 } -110 test mathop-7.8 {compiled |} { | 0xff 0o377 333333333333 } 333333333503 test mathop-7.9 {compiled |} { | 1000000000000000000002 18 -126 } -110 test mathop-7.10 {compiled |} { | 0xff 0o377 3333333333333333333333 } 3333333333333333333503 test mathop-7.11 {compiled |: errors} -returnCodes error -body { | x 0 } -result {cannot use non-numeric string "x" as left operand of "|"} test mathop-7.12 {compiled |: errors} -returnCodes error -body { | nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "|"} test mathop-7.13 {compiled |: errors} -returnCodes error -body { | 0 x } -result {cannot use non-numeric string "x" as right operand of "|"} test mathop-7.14 {compiled |: errors} -returnCodes error -body { | 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "|"} test mathop-7.15 {compiled |: errors} -returnCodes error -body { | 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "|"} test mathop-7.16 {compiled |: errors} -returnCodes error -body { | 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "|"} test mathop-7.17 {compiled |: errors} -returnCodes error -body { | 0 [error expectedError] } -result expectedError test mathop-7.18 {compiled |: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { | [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} set op | test mathop-7.19 {interpreted |} { $op } 0 test mathop-7.20 {interpreted |} { $op 1 } 1 test mathop-7.21 {interpreted |} { $op 1 2 } 3 test mathop-7.22 {interpreted |} { $op 3 7 6 } 7 test mathop-7.23 {interpreted |} -returnCodes error -body { $op 1.0 2 3 } -result {cannot use floating-point value "1.0" as left operand of "|"} test mathop-7.24 {interpreted |} -returnCodes error -body { $op 1 2 3.0 } -result {cannot use floating-point value "3.0" as right operand of "|"} test mathop-7.25 {interpreted |} { $op 100000000002 18 -126 } -110 test mathop-7.26 {interpreted |} { $op 0xff 0o377 333333333333 } 333333333503 test mathop-7.27 {interpreted |} { $op 1000000000000000000002 18 -126 } -110 test mathop-7.28 {interpreted |} { $op 0xff 0o377 3333333333333333333333 } 3333333333333333333503 test mathop-7.29 {interpreted |: errors} -returnCodes error -body { $op x 0 } -result {cannot use non-numeric string "x" as left operand of "|"} test mathop-7.30 {interpreted |: errors} -returnCodes error -body { $op nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "|"} test mathop-7.31 {interpreted |: errors} -returnCodes error -body { $op 0 x } -result {cannot use non-numeric string "x" as right operand of "|"} test mathop-7.32 {interpreted |: errors} -returnCodes error -body { $op 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "|"} test mathop-7.33 {interpreted |: errors} -returnCodes error -body { $op 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "|"} test mathop-7.34 {interpreted |: errors} -returnCodes error -body { $op 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "|"} test mathop-7.35 {interpreted |: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError test mathop-7.36 {interpreted |: argument processing order} -body { list [catch { $op [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-7.37 {| and bignums} { list [| $big1 $big2] [$op $big1 $big2] } {14880960170688977527789098242825693927 14880960170688977527789098242825693927} test mathop-7.38 {| and bignums} { list [| $big1 $wide2] [$op $big1 $wide2] } {12135435435354435435342432749160988407 12135435435354435435342432749160988407} test mathop-7.39 {| and bignums} { list [| $big1 $small2] [$op $big1 $small2] } {12135435435354435435342423948763884533 12135435435354435435342423948763884533} test mathop-7.40 {| and bignums} { list [| $wide1 $big2] [$op $wide1 $big2] } {2746237174783836746262574867174849407 2746237174783836746262574867174849407} test mathop-7.41 {| and bignums} { list [| $wide1 $wide2] [$op $wide1 $wide2] } {87391644647391 87391644647391} test mathop-7.42 {| and bignums} { list [| $wide1 $small2] [$op $wide1 $small2] } {12345678912377 12345678912377} test mathop-7.43 {| and bignums} { list [| $small1 $big2] [$op $small1 $big2] } {2746237174783836746262564892918415159 2746237174783836746262564892918415159} test mathop-7.44 {| and bignums} { list [| $small1 $wide2] [$op $small1 $wide2] } {87321847232503 87321847232503} test mathop-7.45 {| and bignums} { list [| $small1 $small2] [$op $small1 $small2] } {87409 87409} test mathop-8.1 {compiled ^} { ^ } 0 test mathop-8.2 {compiled ^} { ^ 1 } 1 test mathop-8.3 {compiled ^} { ^ 1 2 } 3 test mathop-8.4 {compiled ^} { ^ 3 7 6 } 2 test mathop-8.5 {compiled ^} -returnCodes error -body { ^ 1.0 2 3 } -result {cannot use floating-point value "1.0" as right operand of "^"} test mathop-8.6 {compiled ^} -returnCodes error -body { ^ 1 2 3.0 } -result {cannot use floating-point value "3.0" as left operand of "^"} test mathop-8.7 {compiled ^} { ^ 100000000002 18 -126 } -100000000110 test mathop-8.8 {compiled ^} { ^ 0xff 0o377 333333333333 } 333333333333 test mathop-8.9 {compiled ^} { ^ 1000000000000000000002 18 -126 } -1000000000000000000110 test mathop-8.10 {compiled ^} { ^ 0xff 0o377 3333333333333333333333 } 3333333333333333333333 test mathop-8.11 {compiled ^: errors} -returnCodes error -body { ^ x 0 } -result {cannot use non-numeric string "x" as left operand of "^"} test mathop-8.12 {compiled ^: errors} -returnCodes error -body { ^ nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "^"} test mathop-8.13 {compiled ^: errors} -returnCodes error -body { ^ 0 x } -result {cannot use non-numeric string "x" as right operand of "^"} test mathop-8.14 {compiled ^: errors} -returnCodes error -body { ^ 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "^"} test mathop-8.15 {compiled ^: errors} -returnCodes error -body { ^ 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "^"} test mathop-8.16 {compiled ^: errors} -returnCodes error -body { ^ 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "^"} test mathop-8.17 {compiled ^: errors} -returnCodes error -body { ^ 0 [error expectedError] } -result expectedError test mathop-8.18 {compiled ^: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { ^ [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} set op ^ test mathop-8.19 {interpreted ^} { $op } 0 test mathop-8.20 {interpreted ^} { $op 1 } 1 test mathop-8.21 {interpreted ^} { $op 1 2 } 3 test mathop-8.22 {interpreted ^} { $op 3 7 6 } 2 test mathop-8.23 {interpreted ^} -returnCodes error -body { $op 1.0 2 3 } -result {cannot use floating-point value "1.0" as left operand of "^"} test mathop-8.24 {interpreted ^} -returnCodes error -body { $op 1 2 3.0 } -result {cannot use floating-point value "3.0" as right operand of "^"} test mathop-8.25 {interpreted ^} { $op 100000000002 18 -126 } -100000000110 test mathop-8.26 {interpreted ^} { $op 0xff 0o377 333333333333 } 333333333333 test mathop-8.27 {interpreted ^} { $op 1000000000000000000002 18 -126 } -1000000000000000000110 test mathop-8.28 {interpreted ^} { $op 0xff 0o377 3333333333333333333333 } 3333333333333333333333 test mathop-8.29 {interpreted ^: errors} -returnCodes error -body { $op x 0 } -result {cannot use non-numeric string "x" as left operand of "^"} test mathop-8.30 {interpreted ^: errors} -returnCodes error -body { $op nan 0 } -result {cannot use non-numeric floating-point value "nan" as left operand of "^"} test mathop-8.31 {interpreted ^: errors} -returnCodes error -body { $op 0 x } -result {cannot use non-numeric string "x" as right operand of "^"} test mathop-8.32 {interpreted ^: errors} -returnCodes error -body { $op 0 nan } -result {cannot use non-numeric floating-point value "nan" as right operand of "^"} test mathop-8.33 {interpreted ^: errors} -returnCodes error -body { $op 0o8 0 } -result {cannot use non-numeric string "0o8" as left operand of "^"} test mathop-8.34 {interpreted ^: errors} -returnCodes error -body { $op 0 0o8 } -result {cannot use non-numeric string "0o8" as right operand of "^"} test mathop-8.35 {interpreted ^: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError test mathop-8.36 {interpreted ^: argument processing order} -body { list [catch { $op [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-8.37 {^ and bignums} { list [^ $big1 $big2] [$op $big1 $big2] } {14880247731239682873973207643969192131 14880247731239682873973207643969192131} test mathop-8.38 {^ and bignums} { list [^ $big1 $wide2] [$op $big1 $wide2] } {12135435435354435435342354227710876723 12135435435354435435342354227710876723} test mathop-8.39 {^ and bignums} { list [^ $big1 $small2] [$op $big1 $small2] } {12135435435354435435342423948763884437 12135435435354435435342423948763884437} test mathop-8.40 {^ and bignums} { list [^ $wide1 $big2] [$op $wide1 $big2] } {2746237174783836746262572495752458622 2746237174783836746262572495752458622} test mathop-8.41 {^ and bignums} { list [^ $wide1 $wide2] [$op $wide1 $wide2] } {75115763150222 75115763150222} test mathop-8.42 {^ and bignums} { list [^ $wide1 $small2] [$op $wide1 $small2] } {12345678895656 12345678895656} test mathop-8.43 {^ and bignums} { list [^ $small1 $big2] [$op $small1 $big2] } {2746237174783836746262564892918415126 2746237174783836746262564892918415126} test mathop-8.44 {^ and bignums} { list [^ $small1 $wide2] [$op $small1 $wide2] } {87321847145446 87321847145446} test mathop-8.45 {^ and bignums} { list [^ $small1 $small2] [$op $small1 $small2] } {70720 70720} # TODO: % ** << >> - / == != < <= > >= ne in ni test mathop-13.100 {compiled -: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { - [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} test mathop-14.100 {compiled /: argument processing order} -body { # Bytecode compilation known hard for 3+ arguments list [catch { / [set x 0] [incr x] NaN [incr x] [error expected] [incr x] } msg] $msg $x } -result {1 expected 2} } test mathop-20.1 { zero args, return unit } { set res {} foreach op {+ * & ^ | ** < <= > >= == eq} { lappend res [TestOp $op] } set res } {0 1 -1 0 0 1 1 1 1 1 1 1} test mathop-20.2 { zero args, not allowed } { set exp {} foreach op {~ ! << >> % != ne in ni - /} { set res [TestOp $op] if {[string match "wrong # args: should be * TCL WRONGARGS" $res]} { lappend exp 0 } else { lappend exp $res } } set exp } {0 0 0 0 0 0 0 0 0 0 0} test mathop-20.3 { one arg } { set res {} foreach val {7 8.3} { foreach op {+ ** - * / < <= > >= == eq !} { lappend res [TestOp $op $val] } } set res } [list 7 7 -7 7 [expr {1.0/7.0}] 1 1 1 1 1 1 0 \ 8.3 8.3 -8.3 8.3 [expr {1.0/8.3}] 1 1 1 1 1 1 0] test mathop-20.4 { one arg, integer only ops } { set res {} foreach val {23} { foreach op {& | ^ ~} { lappend res [TestOp $op $val] } } set res } [list 23 23 23 -24] test mathop-20.5 { one arg, not allowed } { set exp {} foreach op {% != ne in ni << >>} { set res [TestOp $op 1] if {[string match "wrong # args: should be * TCL WRONGARGS" $res]} { lappend exp 0 } else { lappend exp $res } } set exp } {0 0 0 0 0 0 0} test mathop-20.6 { one arg, error } { set res {} set exp {} foreach vals {x {1 x} {1 1 x} {1 x 1}} { # skipping - for now, knownbug... foreach op {+ * / & | ^ **} { #lappend res [TestOp $op {*}$vals] #lappend exp "cannot use non-numeric string \"x\" as right operand of \"$op\"\ #ARITH DOMAIN {non-numeric string}" } } foreach op {+ * / & | ^ **} { lappend res [TestOp $op NaN 1] lappend exp "cannot use non-numeric floating-point value \"NaN\" as left operand of \"$op\"\ ARITH DOMAIN {non-numeric floating-point value}" } expr {$res eq $exp ? 0 : "$res\n$exp"} } 0 test mathop-20.7 { multi arg } { set res {} foreach vals {{1 2} {3 4 5} {4 3 2 1}} { foreach op {+ - * /} { lappend res [TestOp $op {*}$vals] } } set res } [list 3 -1 2 0 12 -6 60 0 10 -2 24 0] test mathop-20.8 { multi arg, double } { set res {} foreach vals {{1.0 2} {3.0 4 5} {4 3.0 2 1} {1.0 -1.0 1e-18} {1.0 1.0 1e-18}} { foreach op {+ - * /} { lappend res [TestOp $op {*}$vals] } } set res } [list 3.0 -1.0 2.0 0.5 12.0 -6.0 60.0 0.15 10.0 -2.0 24.0 [expr {2.0/3}] 1e-18 2.0 -1e-18 [expr {-1.0/1e-18}] 2.0 -1e-18 1e-18 [expr {1.0/1e-18}]] test mathop-21.1 { unary ops, bitnot } { set res {} lappend res [TestOp ~ 7] lappend res [TestOp ~ -5] lappend res [TestOp ~ 354657483923456] lappend res [TestOp ~ 123456789123456789123456789] set res } [list -8 4 -354657483923457 -123456789123456789123456790] test mathop-21.2 { unary ops, logical not } { set res {} lappend res [TestOp ! 0] lappend res [TestOp ! 1] lappend res [TestOp ! true] lappend res [TestOp ! false] lappend res [TestOp ! 37] lappend res [TestOp ! 8.5] set res } [list 1 0 0 1 0 0] test mathop-21.3 { unary ops, negation } { set res {} lappend res [TestOp - 7.2] lappend res [TestOp - -5] lappend res [TestOp - -2147483648] ;# -2**31 lappend res [TestOp - -9223372036854775808] ;# -2**63 lappend res [TestOp - 354657483923456] ;# wide lappend res [TestOp - 123456789123456789123456789] ;# big set res } [list -7.2 5 2147483648 9223372036854775808 -354657483923456 \ -123456789123456789123456789] test mathop-21.4 { unary ops, inversion } { set res {} lappend res [TestOp / 1] lappend res [TestOp / 5] lappend res [TestOp / 5.6] lappend res [TestOp / -8] lappend res [TestOp / 354657483923456] ;# wide lappend res [TestOp / 123456789123456789123456789] ;# big set res } [list 1.0 0.2 0.17857142857142858 -0.125 \ 2.8196218755553604e-15 8.10000006561e-27] test mathop-21.5 { unary ops, bad values } { set res {} set exp {} lappend res [TestOp / x] lappend exp "cannot use non-numeric string \"x\" as right operand of \"/\" ARITH DOMAIN {non-numeric string}" #lappend res [TestOp - x] #lappend exp "cannot use non-numeric string \"x\" as operand of \"-\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ~ x] lappend exp "cannot use non-numeric string \"x\" as operand of \"~\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ! x] lappend exp "cannot use non-numeric string \"x\" as operand of \"!\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ~ 5.0] lappend exp "cannot use floating-point value \"5.0\" as operand of \"~\" ARITH DOMAIN {floating-point value}" expr {$res eq $exp ? 0 : "$res\n$exp"} } 0 test mathop-21.6 { unary ops, too many } { set exp {} foreach op {~ !} { set res [TestOp $op 7 8] if {[string match "wrong # args: should be * TCL WRONGARGS" $res]} { lappend exp 0 } else { lappend exp $res } } set exp } {0 0} test mathop-22.1 { bitwise ops } { set res {} foreach vals {5 {1 6} {1 2 3} {1 2 3 4}} { foreach op {& | ^} { lappend res [TestOp $op {*}$vals] } } set res } [list 5 5 5 0 7 7 0 3 0 0 7 4] test mathop-22.2 { bitwise ops on bignums } { set dig 50 set a 0x[string repeat 5 $dig] set b 0x[string repeat 7 $dig] set c 0x[string repeat 9 $dig] set bn [expr {~$b}] set cn [expr {~$c}] set res {} foreach vals [list [list $a $b] [list $a $c] [list $b $c] \ [list $a $bn] [list $bn $c] [list $bn $cn]] { foreach op {& | ^} { lappend res [TestOp $op {*}$vals] } } set exp {} foreach d {5 7 2 1 D C 1 F E 0 -D -D 8 -9 -1 -0 -E E} { if {[string match "-*" $d]} { set d [format %X [expr {15-"0x[string range $d 1 end]"}]] set val [expr {-"0x[string repeat $d $dig]"-1}] } else { set val [expr {"0x[string repeat $d $dig]"}] } lappend exp $val } expr {$exp eq $res ? 1 : "($res != $exp"} } 1 test mathop-22.3 { bitwise ops } { set big1 12135435435354435435342423948763867876 set big2 2746237174783836746262564892918327847 set wide1 12345678912345 set wide2 87321847232215 set small1 87345 set small2 16753 set res {} foreach op {& | ^} { lappend res [TestOp $op $big1 $big2] lappend res [TestOp $op $big1 $wide2] lappend res [TestOp $op $big1 $small2] lappend res [TestOp $op $wide1 $big2] lappend res [TestOp $op $wide1 $wide2] lappend res [TestOp $op $wide1 $small2] lappend res [TestOp $op $small1 $big2] lappend res [TestOp $op $small1 $wide2] lappend res [TestOp $op $small1 $small2] } set res } [list \ 712439449294653815890598856501796 \ 78521450111684 \ 96 \ 2371422390785 \ 12275881497169 \ 16721 \ 33 \ 87057 \ 16689 \ 14880960170688977527789098242825693927 \ 12135435435354435435342432749160988407 \ 12135435435354435435342423948763884533 \ 2746237174783836746262574867174849407 \ 87391644647391 \ 12345678912377 \ 2746237174783836746262564892918415159 \ 87321847232503 \ 87409 \ 14880247731239682873973207643969192131 \ 12135435435354435435342354227710876723 \ 12135435435354435435342423948763884437 \ 2746237174783836746262572495752458622 \ 75115763150222 \ 12345678895656 \ 2746237174783836746262564892918415126 \ 87321847145446 \ 70720 \ ] test mathop-22.4 { unary ops, bad values } { set res {} set exp {} foreach op {& | ^} { lappend res [TestOp $op x 5] lappend exp "cannot use non-numeric string \"x\" as left operand of \"$op\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp $op 5 x] lappend exp "cannot use non-numeric string \"x\" as right operand of \"$op\" ARITH DOMAIN {non-numeric string}" } expr {$res eq $exp ? 0 : "$res\n$exp"} } 0 test mathop-23.1 { comparison ops, numerical } { set res {} set todo {5 {1 6} {1 2 2 3} {4 3 2 1} {5.0 5.0} {6 3 3 1} {5.0 5}} lappend todo [list 2342476234762482734623842342 234827463876473 3434] lappend todo [list 2653 453735910264536 453735910264537 2384762472634982746239847637] lappend todo [list 2653 2384762472634982746239847637] lappend todo [list 2653 -2384762472634982746239847637] lappend todo [list 3789253678212653 -2384762472634982746239847637] lappend todo [list 5.0 6 7.0 8 1e13 1945628567352654 1.1e20 \ 6734253647589123456784564378 2.3e50] set a 7 lappend todo [list $a $a] ;# Same object foreach vals $todo { foreach op {< <= > >= == eq} { lappend res [TestOp $op {*}$vals] } } set res } [list 1 1 1 1 1 1 \ 1 1 0 0 0 0 \ 0 1 0 0 0 0 \ 0 0 1 1 0 0 \ 0 1 0 1 1 1 \ 0 0 0 1 0 0 \ 0 1 0 1 1 0 \ 0 0 1 1 0 0 \ 1 1 0 0 0 0 \ 1 1 0 0 0 0 \ 0 0 1 1 0 0 \ 0 0 1 1 0 0 \ 1 1 0 0 0 0 \ 0 1 0 1 1 1 \ ] test mathop-23.2 { comparison ops, string } { set res {} set todo {a {a b} {5 b b c} {d c b a} {xy xy} {gy ef ef ab}} set a x lappend todo [list $a $a] foreach vals $todo { foreach op {< <= > >= == eq} { lappend res [TestOp $op {*}$vals] } } set res } [list 1 1 1 1 1 1 \ 1 1 0 0 0 0 \ 0 1 0 0 0 0 \ 0 0 1 1 0 0 \ 0 1 0 1 1 1 \ 0 0 0 1 0 0 \ 0 1 0 1 1 1 \ ] test mathop-23.3 { comparison ops, nonequal} { set res {} foreach vals {{a b} {17.0 0x11} {foo foo} {10 10}} { foreach op {!= ne} { lappend res [TestOp $op {*}$vals] } } set res } [list 1 1 0 1 0 0 0 0 ] test mathop-24.1 { binary ops } { set res {} foreach vals {{3 5} {17 7} {199 5} {293234675763434238476239486 17} \ {5 1} {0 7}} { foreach op {% << >> in ni} { lappend res [TestOp $op {*}$vals] } } set res } [list 3 96 0 0 1 3 2176 0 0 1 4 6368 6 0 1 \ 14 38434855421664852505557661908992 2237203031642412097749 0 1 \ 0 10 2 0 1 0 0 0 0 1] test mathop-24.2 { binary ops, modulo } { # Test different combinations to get all code paths set res {} set bigbig 14372423674564535234543545248972634923869 set big 12135435435354435435342423948763867876 set wide 12345678912345 set negwide -12345678912345 set small 5 set neg -5 lappend res [TestOp % $bigbig $big] lappend res [TestOp % $wide $big] lappend res [TestOp % $negwide $big] lappend res [TestOp % $small $big] lappend res [TestOp % $neg $big] lappend res [TestOp % $small $wide] lappend res [TestOp % $neg $wide] lappend res [TestOp % $wide $small] set res } [list 4068119104883679098115293636215358685 \ 12345678912345 \ 12135435435354435435342411603084955531 \ 5 \ 12135435435354435435342423948763867871 \ 5 \ 12345678912340 \ 0 \ ] test mathop-24.3 { binary ops, bad values } { set res {} set exp {} foreach op {% << >>} { lappend res [TestOp $op x 1] lappend exp "cannot use non-numeric string \"x\" as left operand of \"$op\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp $op 1 x] lappend exp "cannot use non-numeric string \"x\" as right operand of \"$op\" ARITH DOMAIN {non-numeric string}" } foreach op {% << >>} { lappend res [TestOp $op 5.0 1] lappend exp "cannot use floating-point value \"5.0\" as left operand of \"$op\" ARITH DOMAIN {floating-point value}" lappend res [TestOp $op 1 5.0] lappend exp "cannot use floating-point value \"5.0\" as right operand of \"$op\" ARITH DOMAIN {floating-point value}" } foreach op {in ni} { lappend res [TestOp $op 5 "a b \{ c"] lappend exp "unmatched open brace in list TCL VALUE LIST BRACE" } lappend res [TestOp % 5 0] lappend exp "divide by zero ARITH DIVZERO {divide by zero}" lappend res [TestOp % 9838923468297346238478737647637375 0] lappend exp "divide by zero ARITH DIVZERO {divide by zero}" lappend res [TestOp / 5 0] lappend exp "divide by zero ARITH DIVZERO {divide by zero}" lappend res [TestOp / 9838923468297346238478737647637375 0] lappend exp "divide by zero ARITH DIVZERO {divide by zero}" expr {$res eq $exp ? 0 : "$res\n$exp"} } 0 test mathop-24.4 { binary ops, negative shift } { set res {} set big -12135435435354435435342423948763867876 set wide -12345678912345 set small -1 lappend res [TestOp << 10 $big] lappend res [TestOp << 10 $wide] lappend res [TestOp << 10 $small] lappend res [TestOp >> 10 $big] lappend res [TestOp >> 10 $wide] lappend res [TestOp >> 10 $small] set exp [lrepeat 6 "negative shift argument NONE"] expr {$res eq $exp ? 0 : $res} } 0 test mathop-24.5 { binary ops, large shift } { set res {} set exp {} set big 12135435435354435435342423948763867876 set wide 12345678912345 set small 1 lappend res [TestOp << 1 2147483648] lappend exp "integer value too large to represent NONE" lappend res [TestOp << 1 4294967296] lappend exp "integer value too large to represent NONE" lappend res [TestOp << $small $wide] lappend exp "integer value too large to represent NONE" lappend res [TestOp << $small $big] lappend exp "integer value too large to represent NONE" lappend res [TestOp >> $big $wide] lappend exp 0 lappend res [TestOp >> $big $big] lappend exp 0 lappend res [TestOp >> $small 70] lappend exp 0 lappend res [TestOp >> $wide 70] lappend exp 0 lappend res [TestOp >> -$big $wide] lappend exp -1 lappend res [TestOp >> -$wide $wide] lappend exp -1 lappend res [TestOp >> -$small $wide] lappend exp -1 lappend res [TestOp >> -$small 70] lappend exp -1 lappend res [TestOp >> -$wide 70] lappend exp -1 expr {$res eq $exp ? 0 : $res} } 0 test mathop-24.6 { binary ops, shift } { # Test different combinations to get all code paths set res {} set bigbig 14372423674564535234543545248972634923869 set big 12135435435354435435342423948763867876 set wide 12345678912345 set negwide -12345678912345 set small 5 set neg -5 lappend res [TestOp << $wide $small] lappend res [TestOp >> $wide $small] set res } [list 395061725195040 \ 385802466010 \ ] test mathop-24.7 { binary ops, list search } { set res {} foreach op {in ni} { lappend res [TestOp $op 5 {7 5 8}] lappend res [TestOp $op hej {foo bar hej}] lappend res [TestOp $op 5 {7 0x5 8}] } set res } [list 1 1 0 0 0 1] test mathop-24.8 { binary ops, too many } { set exp {} foreach op {<< >> % != ne in ni ~ !} { set res [TestOp $op 7 8 9] if {[string match "wrong # args: should be * TCL WRONGARGS" $res]} { lappend exp 0 } else { lappend exp $res } } set exp } {0 0 0 0 0 0 0 0 0} test mathop-25.1 { exp operator } {TestOp ** } 1 test mathop-25.2 { exp operator } {TestOp ** 0 } 0 test mathop-25.3 { exp operator } {TestOp ** 0 5} 0 test mathop-25.4 { exp operator } {TestOp ** 7.5 } 7.5 test mathop-25.5 { exp operator } {TestOp ** 1 5} 1 test mathop-25.6 { exp operator } {TestOp ** 5 1} 5 test mathop-25.7 { exp operator } {TestOp ** 4 3 2 1} 262144 test mathop-25.8 { exp operator } {TestOp ** 5.5 4} 915.0625 test mathop-25.8a { exp operator } {TestOp ** 4.0 -1} 0.25 test mathop-25.8b { exp operator } {TestOp ** 2.0 -2} 0.25 test mathop-25.9 { exp operator } {TestOp ** 16 3.5} 16384.0 test mathop-25.10 { exp operator } {TestOp ** 3.5 0} 1.0 test mathop-25.11 { exp operator } {TestOp ** 378 0} 1 test mathop-25.12 { exp operator } {TestOp ** 7.8 1} 7.8 test mathop-25.13 { exp operator } {TestOp ** 748 1} 748 test mathop-25.14 { exp operator } {TestOp ** 1.6 -1} 0.625 test mathop-25.15 { exp operator } {TestOp ** 683 -1} 0 test mathop-25.16 { exp operator } {TestOp ** 1 -1} 1 test mathop-25.17 { exp operator } {TestOp ** -1 -1} -1 test mathop-25.18 { exp operator } {TestOp ** -1 -2} 1 test mathop-25.19 { exp operator } {TestOp ** -1 3} -1 test mathop-25.20 { exp operator } {TestOp ** -1 4} 1 test mathop-25.21 { exp operator } {TestOp ** 2 63} 9223372036854775808 test mathop-25.22 { exp operator } {TestOp ** 2 256} 115792089237316195423570985008687907853269984665640564039457584007913129639936 set big 83756485763458746358734658473567847567473 test mathop-25.23 { exp operator } {TestOp ** $big 2} 7015148907444467657897585474493757781161998914521537835809623408157343003287605729 test mathop-25.24 { exp operator } {TestOp ** $big 0} 1 test mathop-25.25 { exp operator } {TestOp ** $big 1} $big test mathop-25.26 { exp operator } {TestOp ** $big -1} 0 test mathop-25.27 { exp operator } {TestOp ** $big -2} 0 test mathop-25.28 { exp operator } {TestOp ** $big -$big} 0 test mathop-25.29 { exp operator } {expr {[set res [TestOp ** $big -1.0]] > 0 && $res < 1.2e-41}} 1 test mathop-25.30 { exp operator } {expr {[set res [TestOp ** $big -1e-18]] > 0 && $res < 1}} 1 test mathop-25.31 { exp operator } {expr {[set res [TestOp ** -$big -1.0]] > -1 && $res < 0}} 1 test mathop-25.32 { exp operator } {expr {[set res [TestOp ** -$big -2.0]] > 0 && $res < 1}} 1 test mathop-25.33 { exp operator } {expr {[set res [TestOp ** -$big -3.0]] > -1 && $res < 0}} 1 test mathop-25.34 { exp operator } {TestOp ** $big -1e-30} 1.0 test mathop-25.35 { exp operator } {TestOp ** $big -1e+30} 0.0 test mathop-25.36 { exp operator } {TestOp ** 0 $big} 0 test mathop-25.37 { exp operator } {TestOp ** 1 $big} 1 test mathop-25.38 { exp operator } {TestOp ** -1 $big} -1 test mathop-25.39 { exp operator } {TestOp ** -1 [expr {$big+1}]} 1 test mathop-25.40 { exp operator (small exponent power helper and its boundaries) } { set pwr 0 set res 1 while {[incr pwr] <= 17 && [set i [TestOp ** 15 $pwr]] == [set res [expr {$res * 15}]]} {} list [incr pwr -1] $res } {17 98526125335693359375} test mathop-25.41 { exp operator errors } { set res {} set exp {} set huge [string repeat 145782 1000] set big 12135435435354435435342423948763867876 set wide 12345678912345 set small 2 lappend res [TestOp ** 0 -5] lappend exp "exponentiation of zero by negative power ARITH DOMAIN {exponentiation of zero by negative power}" lappend res [TestOp ** 0.0 -5.0] lappend exp "exponentiation of zero by negative power ARITH DOMAIN {exponentiation of zero by negative power}" lappend res [TestOp ** $small $wide] lappend exp "exponent too large NONE" lappend res [TestOp ** 2 $big] lappend exp "exponent too large NONE" lappend res [TestOp ** $huge 2.1] lappend exp "Inf" lappend res [TestOp ** 2 foo] lappend exp "cannot use non-numeric string \"foo\" as right operand of \"**\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ** foo 2] lappend exp "cannot use non-numeric string \"foo\" as left operand of \"**\" ARITH DOMAIN {non-numeric string}" expr {$res eq $exp ? 0 : "$res\n$exp"} } 0 test mathop-26.1 { misc ops, size combinations } { set big1 12135435435354435435342423948763867876 set big2 2746237174783836746262564892918327847 set wide1 87321847232215 set wide2 12345678912345 set small1 87345 set small2 16753 set res {} foreach op {+ * - /} { lappend res [TestOp $op $big1 $big2] lappend res [TestOp $op $big1 $wide2] lappend res [TestOp $op $big1 $small2] lappend res [TestOp $op $wide1 $big2] lappend res [TestOp $op $wide1 $wide2] lappend res [TestOp $op $wide1 $small2] lappend res [TestOp $op $small1 $big2] lappend res [TestOp $op $small1 $wide2] lappend res [TestOp $op $small1 $small2] } set res } [list \ 14881672610138272181604988841682195723 \ 12135435435354435435342436294442780221 \ 12135435435354435435342423948763884629 \ 2746237174783836746262652214765560062 \ 99667526144560 \ 87321847248968 \ 2746237174783836746262564892918415192 \ 12345678999690 \ 104098 \ 33326783924759424684447891401270222910405366244661685890993770489959542972 \ 149820189346379518024969783068410988366610965329220 \ 203304949848492856848291628413641078526628 \ 239806503039903915972546163440347114360602909991105 \ 1078047487961768329845194175 \ 1462902906681297895 \ 239870086031494220602303730571951345796215 \ 1078333324598774025 \ 1463290785 \ 9389198260570598689079859055845540029 \ 12135435435354435435342411603084955531 \ 12135435435354435435342423948763851123 \ -2746237174783836746262477571071095632 \ 74976168319870 \ 87321847215462 \ -2746237174783836746262564892918240502 \ -12345678825000 \ 70592 \ 4 \ 982970278225822587257201 \ 724373869477373332259441529801460 \ 0 \ 7 \ 5212311062 \ 0 \ 0 \ 5 \ ] test mathop-26.2 { misc ops, corner cases } { set res {} lappend res [TestOp - 0 -2147483648] ;# -2**31 lappend res [TestOp - 0 -9223372036854775808] ;# -2**63 lappend res [TestOp / -9223372036854775808 -1] lappend res [TestOp * 2147483648 2] lappend res [TestOp * 9223372036854775808 2] set res } [list 2147483648 9223372036854775808 9223372036854775808 4294967296 18446744073709551616] test mathop-27.1 {lt operator} {::tcl::mathop::lt} 1 test mathop-27.2 {lt operator} {::tcl::mathop::lt a} 1 test mathop-27.3 {lt operator} {::tcl::mathop::lt a b} 1 test mathop-27.4 {lt operator} {::tcl::mathop::lt b a} 0 test mathop-27.5 {lt operator} {::tcl::mathop::lt a a} 0 test mathop-27.6 {lt operator} {::tcl::mathop::lt a b c} 1 test mathop-27.7 {lt operator} {::tcl::mathop::lt b a c} 0 test mathop-27.8 {lt operator} {::tcl::mathop::lt a c b} 0 test mathop-27.9 {lt operator} {::tcl::mathop::lt 012 0x0} 1 test mathop-28.1 {le operator} {::tcl::mathop::le} 1 test mathop-28.2 {le operator} {::tcl::mathop::le a} 1 test mathop-28.3 {le operator} {::tcl::mathop::le a b} 1 test mathop-28.4 {le operator} {::tcl::mathop::le b a} 0 test mathop-28.5 {le operator} {::tcl::mathop::le a a} 1 test mathop-28.6 {le operator} {::tcl::mathop::le a b c} 1 test mathop-28.7 {le operator} {::tcl::mathop::le b a c} 0 test mathop-28.8 {le operator} {::tcl::mathop::le a c b} 0 test mathop-28.9 {le operator} {::tcl::mathop::le 012 0x0} 1 test mathop-29.1 {gt operator} {::tcl::mathop::gt} 1 test mathop-29.2 {gt operator} {::tcl::mathop::gt a} 1 test mathop-29.3 {gt operator} {::tcl::mathop::gt a b} 0 test mathop-29.4 {gt operator} {::tcl::mathop::gt b a} 1 test mathop-29.5 {gt operator} {::tcl::mathop::gt a a} 0 test mathop-29.6 {gt operator} {::tcl::mathop::gt c b a} 1 test mathop-29.7 {gt operator} {::tcl::mathop::gt b a c} 0 test mathop-29.8 {gt operator} {::tcl::mathop::gt a c b} 0 test mathop-29.9 {gt operator} {::tcl::mathop::gt 0x0 012} 1 test mathop-30.1 {ge operator} {::tcl::mathop::ge} 1 test mathop-30.2 {ge operator} {::tcl::mathop::ge a} 1 test mathop-30.3 {ge operator} {::tcl::mathop::ge a b} 0 test mathop-30.4 {ge operator} {::tcl::mathop::ge b a} 1 test mathop-30.5 {ge operator} {::tcl::mathop::ge a a} 1 test mathop-30.6 {ge operator} {::tcl::mathop::ge c b a} 1 test mathop-30.7 {ge operator} {::tcl::mathop::ge b a c} 0 test mathop-30.8 {ge operator} {::tcl::mathop::ge a c b} 0 test mathop-30.9 {ge operator} {::tcl::mathop::ge 0x0 012} 1 if 0 { # Compare ops to expr bytecodes namespace import ::tcl::mathop::* proc _X {a b c} { set x [+ $a [- $b $c]] set y [expr {$a + ($b - $c)}] set z [< $a $b $c] } set ::tcl_traceCompile 2 _X 3 4 5 set ::tcl_traceCompile 0 } # cleanup namespace delete ::testmathop namespace delete ::testmathop2 ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/main.test0000644000175000017500000006752315104661341014553 0ustar sergeisergei# This file contains a collection of tests for generic/tclMain.c. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } namespace eval ::tcl::test::main { namespace import ::tcltest::* # Is [exec] defined? testConstraint exec [llength [info commands exec]] # Is the tcl::test package loaded? testConstraint tcl::test [expr { [llength [package provide tcl::test]] && [package vsatisfies [package provide tcl::test] 8.5-]}] testConstraint noappverifier [expr { [llength [info commands testappverifierpresent]] == 0 || ![testappverifierpresent]}] # Procedure to simulate interactive typing of commands, line by line proc type {chan script} { foreach line [split $script \n] { if {[catch { puts $chan $line flush $chan }]} { return } # Grrr... Behavior depends on this value. after 1000 } } cd [temporaryDirectory] # Tests Tcl_Main-1.*: variable initializations test Tcl_Main-1.1 { Tcl_Main: startup script - normal } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} script catch {set f [open "|[list [interpreter] script]" r]} } -body { read $f } -cleanup { close $f removeFile script } -result [list script {} 0]\n test Tcl_Main-1.2 { Tcl_Main: startup script - can't begin with '-' } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} -script catch {set f [open "|[list [interpreter] -script]" w+]} } -body { puts $f {puts [list $argv0 $argv $tcl_interactive]; exit} flush $f read $f } -cleanup { close $f removeFile -script } -result [list [interpreter] -script 0]\n test Tcl_Main-1.3 { } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} script catch {set f [open "|[list [interpreter] script À]" r]} } -body { read $f } -cleanup { close $f removeFile script } -result [list script [list [encoding convertfrom [encoding system] \ [encoding convertto [encoding system] À]]] 0]\n test Tcl_Main-1.4 { } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} script catch {set f [open "|[list [interpreter] script €]" r]} } -body { read $f } -cleanup { close $f removeFile script } -result [list script [list [encoding convertfrom [encoding system] \ [encoding convertto [encoding system] €]]] 0]\n test Tcl_Main-1.5 { } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} À catch {set f [open "|[list [interpreter] À]" r]} } -body { read $f } -cleanup { close $f removeFile À } -result [list [list [encoding convertfrom [encoding system] \ [encoding convertto [encoding system] À]]] {} 0]\n test Tcl_Main-1.6 { } -constraints { stdio } -setup { makeFile {puts [list $argv0 $argv $tcl_interactive]} € catch {set f [open "|[list [interpreter] €]" r]} } -body { read $f } -cleanup { close $f removeFile € } -result [list [list [encoding convertfrom [encoding system] \ [encoding convertto [encoding system] €]]] {} 0]\n test Tcl_Main-1.7 { Tcl_Main: startup script - -encoding option } -constraints { stdio } -setup { set script [makeFile {} script] file delete $script set f [open $script w] chan configure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} puts -nonewline $f {puts [string equal € } puts $f "€]" close $f catch {set f [open "|[list [interpreter] -encoding utf-8 script]" r]} } -body { read $f } -cleanup { close $f removeFile script } -result [list script {} 0]\n1\n test Tcl_Main-1.8 { Tcl_Main: startup script - -encoding option - mismatched encodings } -constraints { stdio } -setup { set script [makeFile {} script] file delete $script set f [open $script w] chan configure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} puts -nonewline $f {puts [string equal \u20ac } puts $f "€]" close $f catch {set f [open "|[list [interpreter] -encoding iso8859-1 script]" r]} } -body { read $f } -cleanup { close $f removeFile script } -result [list script {} 0]\n0\n test Tcl_Main-1.9 { Tcl_Main: startup script - -encoding option - no abbrevation } -constraints { stdio } -setup { set script [makeFile {} script] file delete $script set f [open $script w] chan configure $f -encoding utf-8 puts $f {puts [list $argv0 $argv $tcl_interactive]} puts -nonewline $f {puts [string equal \u20ac } puts $f "€]" close $f catch {set f [open "|[list [interpreter] -enc utf-8 script]" r+]} } -body { type $f { puts $argv } list [catch {gets $f} line] $line } -cleanup { close $f removeFile script } -result {0 {-enc utf-8 script}} # Tests Tcl_Main-2.*: application-initialization procedure test Tcl_Main-2.1 { Tcl_Main: appInitProc returns error } -constraints { exec tcl::test } -setup { makeFile {puts "In script"} script } -body { exec [interpreter] script -appinitprocerror >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "application-specific initialization failed: \nIn script\n" test Tcl_Main-2.2 { Tcl_Main: appInitProc returns error } -constraints { exec tcl::test } -body { exec [interpreter] << {puts "In script"} -appinitprocerror >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "application-specific initialization failed: \nIn script\n" test Tcl_Main-2.3 { Tcl_Main: appInitProc deletes interp } -constraints { exec tcl::test } -setup { makeFile {puts "In script"} script } -body { exec [interpreter] script -appinitprocdeleteinterp >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "application-specific initialization failed: \n" test Tcl_Main-2.4 { Tcl_Main: appInitProc deletes interp } -constraints { exec tcl::test } -body { exec [interpreter] << {puts "In script"} \ -appinitprocdeleteinterp >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "application-specific initialization failed: \n" test Tcl_Main-2.5 { Tcl_Main: appInitProc closes stderr } -constraints { exec tcl::test } -body { exec [interpreter] << {puts "In script"} \ -appinitprocclosestderr >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "In script\n" # Tests Tcl_Main-3.*: startup script evaluation test Tcl_Main-3.1 { Tcl_Main: startup script does not exist } -constraints { exec } -setup { if {[file exists no-such-file]} { error "Can't run test Tcl_Main-3.1\ where a file named \"no-such-file\" exists" } } -body { set code [catch {exec [interpreter] no-such-file >& result} result] set f [open result] list $code $result [read $f] } -cleanup { close $f file delete result } -match glob -result [list 1 {child process exited abnormally} \ {couldn't read file "no-such-file":*}] test Tcl_Main-3.2 { Tcl_Main: startup script raises error } -constraints { exec } -setup { makeFile {error ERROR} script } -body { set code [catch {exec [interpreter] script >& result} result] set f [open result] list $code $result [read $f] } -cleanup { close $f file delete result removeFile script } -match glob -result [list 1 {child process exited abnormally} \ "ERROR\n while executing*"] test Tcl_Main-3.3 { Tcl_Main: startup script closes stderr } -constraints { exec } -setup { makeFile {close stderr; error ERROR} script } -body { set code [catch {exec [interpreter] script >& result} result] set f [open result] list $code $result [read $f] } -cleanup { close $f file delete result removeFile script } -result [list 1 {child process exited abnormally} {}] test Tcl_Main-3.4 { Tcl_Main: startup script holds incomplete script } -constraints { exec } -setup { makeFile "if 1 \{" script } -body { set code [catch {exec [interpreter] script >& result} result] set f [open result] join [list $code $result [read $f]] \n } -cleanup { close $f file delete result removeFile script } -match glob -result [join [list 1 {child process exited abnormally}\ "missing close-brace\n while executing*"] \n] test Tcl_Main-3.5 { Tcl_Main: startup script sets main loop } -constraints { exec tcl::test } -setup { makeFile { rename exit _exit proc exit {code} { puts "In exit" _exit $code } after 0 { puts event testexitmainloop } testexithandler create 0 testsetmainloop } script } -body { exec [interpreter] script >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "event\nExit MainLoop\nIn exit\neven 0\n" test Tcl_Main-3.6 { Tcl_Main: startup script sets main loop and closes stdin } -constraints { exec tcl::test } -setup { makeFile { close stdin testsetmainloop rename exit _exit proc exit {code} { puts "In exit" _exit $code } after 0 { puts event testexitmainloop } testexithandler create 0 } script } -body { exec [interpreter] script >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "event\nExit MainLoop\nIn exit\neven 0\n" test Tcl_Main-3.7 { Tcl_Main: startup script deletes interp } -constraints { exec tcl::test } -setup { makeFile { rename exit _exit proc exit {code} { puts "In exit" _exit $code } testexithandler create 0 testinterpdelete {} } script } -body { exec [interpreter] script >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "even 0\n" test Tcl_Main-3.8 { Tcl_Main: startup script deletes interp and sets mainloop } -constraints { exec tcl::test } -setup { makeFile { testsetmainloop rename exit _exit proc exit {code} { puts "In exit" _exit $code } testexitmainloop testexithandler create 0 testinterpdelete {} } script } -body { exec [interpreter] script >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result "Exit MainLoop\neven 0\n" test Tcl_Main-3.9 { Tcl_Main: startup script can set tcl_interactive without limit } -constraints { exec } -setup { makeFile {set tcl_interactive foo} script } -body { exec [interpreter] script >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile script } -result {} # Tests Tcl_Main-4.*: rc file evaluation test Tcl_Main-4.1 { Tcl_Main: rcFile evaluation deletes interp } -constraints { exec tcl::test } -setup { set rc [makeFile {testinterpdelete {}} rc] } -body { exec [interpreter] << {puts "In script"} \ -appinitprocsetrcfile $rc >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile rc } -result "application-specific initialization failed: \n" test Tcl_Main-4.2 { Tcl_Main: rcFile evaluation closes stdin } -constraints { exec tcl::test } -setup { set rc [makeFile {close stdin} rc] } -body { exec [interpreter] << {puts "In script"} \ -appinitprocsetrcfile $rc >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile rc } -result "application-specific initialization failed: \n" test Tcl_Main-4.3 { Tcl_Main: rcFile evaluation closes stdin and sets main loop } -constraints { exec tcl::test } -setup { set rc [makeFile { close stdin testsetmainloop after 0 testexitmainloop testexithandler create 0 rename exit _exit proc exit code { puts "In exit" _exit $code } } rc] } -body { exec [interpreter] << {puts "In script"} \ -appinitprocsetrcfile $rc >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile rc } -result "application-specific initialization failed:\ \nExit MainLoop\nIn exit\neven 0\n" test Tcl_Main-4.4 { Tcl_Main: rcFile evaluation sets main loop } -constraints { exec tcl::test } -setup { set rc [makeFile { testsetmainloop after 0 testexitmainloop testexithandler create 0 rename exit _exit proc exit code { puts "In exit" _exit $code } } rc] } -body { exec [interpreter] << {} \ -appinitprocsetrcfile $rc >& result set f [open result] read $f } -cleanup { close $f file delete result removeFile rc } -result "application-specific initialization failed:\ \nExit MainLoop\nIn exit\neven 0\n" test Tcl_Main-4.5 { Tcl_Main: Bug 1481986 } -constraints { exec tcl::test noappverifier } -setup { set rc [makeFile { testsetmainloop after 0 {puts "Event callback"} } rc] } -body { set f [open "|[list [interpreter] -appinitprocsetrcfile $rc]" w+] after 1000 type $f {puts {Interactive output} exit } read $f } -cleanup { catch {close $f} removeFile rc } -result "Event callback\nInteractive output\n" # Tests Tcl_Main-5.*: interactive operations test Tcl_Main-5.1 { Tcl_Main: tcl_interactive must be boolean } -constraints { exec } -body { exec [interpreter] << {set tcl_interactive foo} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "can't set \"tcl_interactive\":\ variable must have boolean value\n" test Tcl_Main-5.2 { Tcl_Main able to handle non-blocking stdin } -constraints { exec } -setup { catch {set f [open "|[list [interpreter]]" w+]} } -body { type $f { chan configure stdin -blocking 0 puts SUCCESS } list [catch {gets $f} line] $line } -cleanup { close $f } -result [list 0 SUCCESS] test Tcl_Main-5.3 { Tcl_Main handles stdin EOF in mid-command } -constraints { exec } -setup { catch {set f [open "|[list [interpreter]]" w+]} catch {chan configure $f -blocking 0} } -body { type $f "chan configure stdin -eofchar \\x1A if 1 \{\n\x1A" variable wait chan event $f readable \ [list set [namespace which -variable wait] "child exit"] set id [after 5000 [list set [namespace which -variable wait] timeout]] vwait [namespace which -variable wait] after cancel $id set wait } -cleanup { if {$wait eq "timeout" && [testConstraint unix]} { exec kill [pid $f] } close $f } -result {child exit} test Tcl_Main-5.4 { Tcl_Main handles stdin EOF in mid-command } -constraints { exec } -setup { set cmd {makeFile "if 1 \{" script} catch {set f [open "|[list [interpreter]] < [list [eval $cmd]]" r]} catch {chan configure $f -blocking 0} } -body { variable wait chan event $f readable \ [list set [namespace which -variable wait] "child exit"] set id [after 5000 [list set [namespace which -variable wait] timeout]] vwait [namespace which -variable wait] after cancel $id set wait } -cleanup { if {$wait eq "timeout" && [testConstraint unix]} { exec kill [pid $f] } close $f removeFile script } -result {child exit} test Tcl_Main-5.5 { Tcl_Main: error raised in interactive mode } -constraints { exec } -body { exec [interpreter] << {error foo} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "foo\n" test Tcl_Main-5.6 { Tcl_Main: interactive mode: errors don't stop command loop } -constraints { exec } -body { exec [interpreter] << { error foo puts bar } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "foo\nbar\n" test Tcl_Main-5.7 { Tcl_Main: interactive mode: closed stderr } -constraints { exec } -body { exec [interpreter] << { close stderr error foo puts bar } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "bar\n" test Tcl_Main-5.8 { Tcl_Main: interactive mode: close stdin -> main loop & [exit] & exit handlers } -constraints { exec tcl::test } -body { exec [interpreter] << { rename exit _exit proc exit code { puts "In exit" _exit $code } testsetmainloop testexitmainloop testexithandler create 0 close stdin } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\nIn exit\neven 0\n" test Tcl_Main-5.9 { Tcl_Main: interactive mode: delete interp -> main loop & exit handlers, but no [exit] } -constraints { exec tcl::test } -body { exec [interpreter] << { rename exit _exit proc exit code { puts "In exit" _exit $code } testsetmainloop testexitmainloop testexithandler create 0 testinterpdelete {} } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\neven 0\n" test Tcl_Main-5.10 { Tcl_Main: exit main loop in mid-interactive command } -constraints { exec tcl::test } -setup { catch {set f [open "|[list [interpreter]]" w+]} catch {chan configure $f -blocking 0} } -body { type $f "testsetmainloop after 2000 testexitmainloop puts \{1 2" after 4000 type $f "3 4\}" set code1 [catch {gets $f} line1] set code2 [catch {gets $f} line2] set code3 [catch {gets $f} line3] list $code1 $line1 $code2 $line2 $code3 $line3 } -cleanup { close $f } -result [list 0 {Exit MainLoop} 0 {1 2} 0 {3 4}] test Tcl_Main-5.11 { Tcl_Main: EOF in interactive main loop } -constraints { exec tcl::test } -body { exec [interpreter] << { rename exit _exit proc exit code { puts "In exit" _exit $code } testexithandler create 0 after 0 testexitmainloop testsetmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\nIn exit\neven 0\n" test Tcl_Main-5.12 { Tcl_Main: close stdin in interactive main loop } -constraints { exec tcl::test } -body { exec [interpreter] << { rename exit _exit proc exit code { puts "In exit" _exit $code } testexithandler create 0 after 100 testexitmainloop testsetmainloop close stdin puts "don't reach this" } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\nIn exit\neven 0\n" test Tcl_Main-5.13 { Bug 1775878 } -constraints { exec } -setup { catch {set f [open "|[list [interpreter]]" w+]} } -body { type $f "puts \\" type $f return list [catch {gets $f} line] $line } -cleanup { close $f } -result [list 0 return] # Tests Tcl_Main-6.*: interactive operations with prompts test Tcl_Main-6.1 { Tcl_Main: enable prompts with tcl_interactive } -constraints { exec } -body { exec [interpreter] << {set tcl_interactive 1} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% " test Tcl_Main-6.2 { Tcl_Main: prompt deletes interp } -constraints { exec tcl::test } -body { exec [interpreter] << { set tcl_prompt1 {testinterpdelete {}} set tcl_interactive 1 puts "not reached" } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n" test Tcl_Main-6.3 { Tcl_Main: prompt closes stdin } -constraints { exec } -body { exec [interpreter] << { set tcl_prompt1 {close stdin} set tcl_interactive 1 puts "not reached" } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n" test Tcl_Main-6.4 { Tcl_Main: interactive output, closed stdout } -constraints { exec } -body { exec [interpreter] << { set tcl_interactive 1 close stdout set a NO puts stderr YES } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% YES\n" test Tcl_Main-6.5 { Tcl_Main: interactive entry to main loop } -constraints { exec tcl::test } -body { exec [interpreter] << { set tcl_interactive 1 testsetmainloop testexitmainloop} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% % % Exit MainLoop\n" test Tcl_Main-6.6 { Tcl_Main: number of prompts during stdin close exit } -constraints { exec } -body { exec [interpreter] << { set tcl_interactive 1 close stdin} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% " test Tcl_Main-6.7 { [unknown]: interactive auto-completion. } -constraints { exec } -body { exec [interpreter] << { proc foo\{ x {} set ::auto_noexec xxx set tcl_interactive 1 foo y} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% % " # Tests Tcl_Main-7.*: exiting test Tcl_Main-7.1 { Tcl_Main: [exit] defined as no-op -> still have exithandlers } -constraints { exec tcl::test } -body { exec [interpreter] << { proc exit args {} testexithandler create 0 } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "even 0\n" test Tcl_Main-7.2 { Tcl_Main: [exit] defined as no-op -> still have exithandlers } -constraints { exec tcl::test } -body { exec [interpreter] << { proc exit args {} testexithandler create 0 after 0 testexitmainloop testsetmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\neven 0\n" # Tests Tcl_Main-8.*: StdinProc operations test Tcl_Main-8.1 { StdinProc: handles non-blocking stdin } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop chan configure stdin -blocking 0 testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\n" test Tcl_Main-8.2 { StdinProc: handles stdin EOF } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop testexithandler create 0 rename exit _exit proc exit code { puts "In exit" _exit $code } after 100 testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\nIn exit\neven 0\n" test Tcl_Main-8.3 { StdinProc: handles interactive stdin EOF } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop testexithandler create 0 rename exit _exit proc exit code { puts "In exit" _exit $code } set tcl_interactive 1} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% even 0\n" test Tcl_Main-8.4 { StdinProc: handles stdin close } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop rename exit _exit proc exit code { puts "In exit" _exit $code } after 100 testexitmainloop after 0 puts 1 close stdin } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\nExit MainLoop\nIn exit\n" test Tcl_Main-8.5 { StdinProc: handles interactive stdin close } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop set tcl_interactive 1 rename exit _exit proc exit code { puts "In exit" _exit $code } after 100 testexitmainloop after 0 puts 1 close stdin } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% % % after#0\n% after#1\n% 1\nExit MainLoop\nIn exit\n" test Tcl_Main-8.6 { StdinProc: handles event loop re-entry } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop after 100 {puts 1; set delay 1} vwait delay puts 2 testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n2\nExit MainLoop\n" test Tcl_Main-8.7 { StdinProc: handling of errors } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop error foo testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "foo\nExit MainLoop\n" test Tcl_Main-8.8 { StdinProc: handling of errors, closed stderr } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop close stderr error foo testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "Exit MainLoop\n" test Tcl_Main-8.9 { StdinProc: interactive output } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop set tcl_interactive 1 testexitmainloop} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% % Exit MainLoop\n" test Tcl_Main-8.10 { StdinProc: interactive output, closed stdout } -constraints { exec tcl::test noappverifier } -body { exec [interpreter] << { testsetmainloop close stdout set tcl_interactive 1 testexitmainloop } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result {} test Tcl_Main-8.11 { StdinProc: prompt deletes interp } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop set tcl_prompt1 {testinterpdelete {}} set tcl_interactive 1} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n" test Tcl_Main-8.12 { StdinProc: prompt closes stdin } -constraints { exec tcl::test } -body { exec [interpreter] << { testsetmainloop set tcl_prompt1 {close stdin} after 100 testexitmainloop set tcl_interactive 1 puts "not reached" } >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\nExit MainLoop\n" test Tcl_Main-8.13 { Bug 1775878 } -constraints { exec tcl::test } -body { exec [interpreter] << "testsetmainloop\nputs \\\npwd\ntestexitmainloop" >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "pwd\nExit MainLoop\n" # Tests Tcl_Main-9.*: Prompt operations test Tcl_Main-9.1 { Prompt: custom prompt variables } -constraints { exec } -body { exec [interpreter] << { set tcl_prompt1 {puts -nonewline stdout "one "} set tcl_prompt2 {puts -nonewline stdout "two "} set tcl_interactive 1 puts {This is a test}} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\none two This is\n\t\ta test\none " test Tcl_Main-9.2 { Prompt: error in custom prompt variables } -constraints { exec } -body { exec [interpreter] << { set tcl_prompt1 {error foo} set tcl_interactive 1 set errorInfo} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\nfoo\n% foo\n while executing\n\"error foo\"\n (script\ that generates prompt)\nfoo\n% " test Tcl_Main-9.3 { Prompt: error in custom prompt variables, closed stderr } -constraints { exec } -body { exec [interpreter] << { set tcl_prompt1 {close stderr; error foo} set tcl_interactive 1} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\n% " test Tcl_Main-9.4 { Prompt: error in custom prompt variables, closed stdout } -constraints { exec } -body { exec [interpreter] << { set tcl_prompt1 {close stdout; error foo} set tcl_interactive 1} >& result set f [open result] read $f } -cleanup { close $f file delete result } -result "1\nfoo\n" cd [workingDirectory] cleanupTests } namespace delete ::tcl::test::main return tcl9.0.3/tests/macOSXLoad.test0000644000175000017500000000212415104661341015543 0ustar sergeisergei# Commands covered: load unload # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } set oldTSF $::tcltest::testSingleFile set ::tcltest::testSingleFile false if {[testConstraint unix] && $tcl_platform(os) eq "Darwin" && ![string match *pkga* [info loaded]]} { # On Darwin, test .bundle (un)loading in addition to .dylib set ext .bundle source [file join [file dirname [info script]] load.test] set ext .bundle source [file join [file dirname [info script]] unload.test] unset -nocomplain ext } set ::tcltest::testSingleFile $oldTSF unset oldTSF ::tcltest::cleanupTests return tcl9.0.3/tests/macOSXFCmd.test0000644000175000017500000001622015104661341015477 0ustar sergeisergei# This file tests the tclMacOSXFCmd.c file. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2003 Tcl Core Team. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # These tests really need to be run from a writable directory, which # it is assumed [temporaryDirectory] is. set oldcwd [pwd] cd [temporaryDirectory] # check whether macosx file attributes are supported testConstraint macosxFileAttr 0 if {[testConstraint unix] && $tcl_platform(os) eq "Darwin"} { catch {file delete -force -- foo.test} close [open foo.test w] catch { file attributes foo.test -creator testConstraint macosxFileAttr 1 } file delete -force -- foo.test } test macOSXFCmd-1.1 {MacOSXGetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator} msg] $msg } {1 {could not read "foo.test": no such file or directory}} test macOSXFCmd-1.2 {MacOSXGetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -creator} msg] $msg \ [file delete -force -- foo.test] } {0 {} {}} test macOSXFCmd-1.3 {MacOSXGetFileAttribute - type} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -type} msg] $msg \ [file delete -force -- foo.test] } {0 {} {}} test macOSXFCmd-1.4 {MacOSXGetFileAttribute - hidden} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -hidden} msg] $msg \ [file delete -force -- foo.test] } {0 0 {}} test macOSXFCmd-1.5 {MacOSXGetFileAttribute - rsrclength} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -rsrclength} msg] $msg \ [file delete -force -- foo.test] } {0 0 {}} test macOSXFCmd-2.1 {MacOSXSetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator FOOC} msg] $msg } {1 {could not read "foo.test": no such file or directory}} test macOSXFCmd-2.2 {MacOSXSetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -creator FOOC} msg] $msg \ [catch {file attributes foo.test -creator} msg] $msg \ [file delete -force -- foo.test] } {0 {} 0 FOOC {}} test macOSXFCmd-2.3 {MacOSXSetFileAttribute - empty creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -creator {}} msg] $msg \ [catch {file attributes foo.test -creator} msg] $msg \ [file delete -force -- foo.test] } {0 {} 0 {} {}} test macOSXFCmd-2.4 {MacOSXSetFileAttribute - type} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -type FOOT} msg] $msg \ [catch {file attributes foo.test -type} msg] $msg \ [file delete -force -- foo.test] } {0 {} 0 FOOT {}} test macOSXFCmd-2.5 {MacOSXSetFileAttribute - empty type} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -type {}} msg] $msg \ [catch {file attributes foo.test -type} msg] $msg \ [file delete -force -- foo.test] } {0 {} 0 {} {}} test macOSXFCmd-2.6 {MacOSXSetFileAttribute - hidden} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] list [catch {file attributes foo.test -hidden 1} msg] $msg \ [catch {file attributes foo.test -hidden} msg] $msg \ [file delete -force -- foo.test] } {0 {} 0 1 {}} test macOSXFCmd-2.7 {MacOSXSetFileAttribute - rsrclength} {macosxFileAttr notRoot nonPortable} { catch {file delete -force -- foo.test} close [open foo.test w] catch { set f [open foo.test/..namedfork/rsrc w] fconfigure $f -translation lf puts -nonewline $f "foo" close $f } list [catch {file attributes foo.test -rsrclength} msg] $msg \ [catch {file attributes foo.test -rsrclength 0} msg] $msg \ [catch {file attributes foo.test -rsrclength} msg] $msg \ [file delete -force -- foo.test] } {0 3 0 {} 0 0 {}} test macOSXFCmd-3.1 {MacOSXCopyFileAttributes} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} catch {file delete -force -- bar.test} close [open foo.test w] catch { file attributes foo.test -creator FOOC -type FOOT -hidden 1 set f [open foo.test/..namedfork/rsrc w] fconfigure $f -translation lf puts -nonewline $f "foo" close $f file copy foo.test bar.test } list [catch {file attributes bar.test -creator} msg] $msg \ [catch {file attributes bar.test -type} msg] $msg \ [catch {file attributes bar.test -hidden} msg] $msg \ [catch {file attributes bar.test -rsrclength} msg] $msg \ [file delete -force -- foo.test bar.test] } {0 FOOC 0 FOOT 0 1 0 3 {}} test macOSXFCmd-4.1 {TclMacOSXMatchType} {macosxFileAttr notRoot} { file mkdir globtest cd globtest foreach f {bar baz foo inv inw .nv reg} { catch {file delete -force -- $f.test} close [open $f.test w] } catch {file delete -force -- dir.test} file mkdir dir.test catch { file attributes bar.test -type FOOT file attributes baz.test -creator FOOC -type FOOT file attributes foo.test -creator FOOC file attributes inv.test -hidden 1 file attributes inw.test -hidden 1 -type FOOT file attributes dir.test -hidden 1 } set res [list \ [catch {lsort [glob *.test]} msg] $msg \ [catch {lsort [glob -types FOOT *.test]} msg] $msg \ [catch {lsort [glob -types {{macintosh type FOOT}} *.test]} msg] $msg \ [catch {lsort [glob -types FOOTT *.test]} msg] $msg \ [catch {lsort [glob -types {{macintosh type FOOTT}} *.test]} msg] $msg \ [catch {lsort [glob -types {{macintosh type {}}} *.test]} msg] $msg \ [catch {lsort [glob -types {{macintosh creator FOOC}} *.test]} msg] $msg \ [catch {lsort [glob -types {{macintosh creator FOOC} {macintosh type FOOT}} *.test]} msg] $msg \ [catch {lsort [glob -types hidden *.test]} msg] $msg \ [catch {lsort [glob -types {hidden FOOT} *.test]} msg] $msg \ ] cd .. file delete -force globtest set res } [list \ 0 {bar.test baz.test dir.test foo.test inv.test inw.test reg.test} \ 0 {bar.test baz.test inw.test} 0 {bar.test baz.test inw.test} \ 1 {bad argument to "-types": FOOTT} \ 1 {expected Macintosh OS type but got "FOOTT": } \ 0 {foo.test inv.test reg.test} 0 {baz.test foo.test} \ 0 baz.test 0 {.nv.test dir.test inv.test inw.test} \ 0 inw.test ] # cleanup cd $oldcwd ::tcltest::cleanupTests return tcl9.0.3/tests/lsetComp.test0000644000175000017500000003750115104661341015406 0ustar sergeisergei# This file is a -*- tcl -*- test script # Commands covered: lset # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2001 Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Procedure to evaluate a script within a proc, to test compilation # functionality proc evalInProc { script } { proc testProc {} $script set status [catch { testProc } result] rename testProc {} return [list $status $result] } # Tests for the bytecode compilation of the 'lset' command test lsetComp-1.1 {lset, compiled, wrong \# args} { evalInProc { lset } } "1 {wrong \# args: should be \"lset listVar ?index? ?index ...? value\"}" test lsetComp-2.1 {lset, compiled, list of args, not a simple var name} { evalInProc { set y x set x {{1 2} {3 4}} lset $y {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.2 {lset, compiled, list of args, scalar on stack} { evalInProc { set ::x {{1 2} {3 4}} lset ::x {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.3 {lset, compiled, list of args, scalar, one-byte offset} { evalInProc { set x {{1 2} {3 4}} lset x {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.4 {lset, compiled, list of args, scalar, four-byte offset} { evalInProc { set x0 0; set x1 0; set x2 0; set x3 0; set x4 0; set x5 0; set x6 0; set x7 0; set x8 0; set x9 0; set x10 0; set x11 0; set x12 0; set x13 0; set x14 0; set x15 0; set x16 0; set x17 0; set x18 0; set x19 0; set x20 0; set x21 0; set x22 0; set x23 0; set x24 0; set x25 0; set x26 0; set x27 0; set x28 0; set x29 0; set x30 0; set x31 0; set x32 0; set x33 0; set x34 0; set x35 0; set x36 0; set x37 0; set x38 0; set x39 0; set x40 0; set x41 0; set x42 0; set x43 0; set x44 0; set x45 0; set x46 0; set x47 0; set x48 0; set x49 0; set x50 0; set x51 0; set x52 0; set x53 0; set x54 0; set x55 0; set x56 0; set x57 0; set x58 0; set x59 0; set x60 0; set x61 0; set x62 0; set x63 0; set x64 0; set x65 0; set x66 0; set x67 0; set x68 0; set x69 0; set x70 0; set x71 0; set x72 0; set x73 0; set x74 0; set x75 0; set x76 0; set x77 0; set x78 0; set x79 0; set x80 0; set x81 0; set x82 0; set x83 0; set x84 0; set x85 0; set x86 0; set x87 0; set x88 0; set x89 0; set x90 0; set x91 0; set x92 0; set x93 0; set x94 0; set x95 0; set x96 0; set x97 0; set x98 0; set x99 0; set x100 0; set x101 0; set x102 0; set x103 0; set x104 0; set x105 0; set x106 0; set x107 0; set x108 0; set x109 0; set x110 0; set x111 0; set x112 0; set x113 0; set x114 0; set x115 0; set x116 0; set x117 0; set x118 0; set x119 0; set x120 0; set x121 0; set x122 0; set x123 0; set x124 0; set x125 0; set x126 0; set x127 0; set x128 0; set x129 0; set x130 0; set x131 0; set x132 0; set x133 0; set x134 0; set x135 0; set x136 0; set x137 0; set x138 0; set x139 0; set x140 0; set x141 0; set x142 0; set x143 0; set x144 0; set x145 0; set x146 0; set x147 0; set x148 0; set x149 0; set x150 0; set x151 0; set x152 0; set x153 0; set x154 0; set x155 0; set x156 0; set x157 0; set x158 0; set x159 0; set x160 0; set x161 0; set x162 0; set x163 0; set x164 0; set x165 0; set x166 0; set x167 0; set x168 0; set x169 0; set x170 0; set x171 0; set x172 0; set x173 0; set x174 0; set x175 0; set x176 0; set x177 0; set x178 0; set x179 0; set x180 0; set x181 0; set x182 0; set x183 0; set x184 0; set x185 0; set x186 0; set x187 0; set x188 0; set x189 0; set x190 0; set x191 0; set x192 0; set x193 0; set x194 0; set x195 0; set x196 0; set x197 0; set x198 0; set x199 0; set x200 0; set x201 0; set x202 0; set x203 0; set x204 0; set x205 0; set x206 0; set x207 0; set x208 0; set x209 0; set x210 0; set x211 0; set x212 0; set x213 0; set x214 0; set x215 0; set x216 0; set x217 0; set x218 0; set x219 0; set x220 0; set x221 0; set x222 0; set x223 0; set x224 0; set x225 0; set x226 0; set x227 0; set x228 0; set x229 0; set x230 0; set x231 0; set x232 0; set x233 0; set x234 0; set x235 0; set x236 0; set x237 0; set x238 0; set x239 0; set x240 0; set x241 0; set x242 0; set x243 0; set x244 0; set x245 0; set x246 0; set x247 0; set x248 0; set x249 0; set x250 0; set x251 0; set x252 0; set x253 0; set x254 0; set x255 0; set x {{1 2} {3 4}} lset x {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.5 {lset, compiled, list of args, array on stack} { evalInProc { set ::y(0) {{1 2} {3 4}} lset ::y(0) {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.6 {lset, compiled, list of args, array, one-byte offset} { evalInProc { set y(0) {{1 2} {3 4}} lset y(0) {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.7 {lset, compiled, list of args, array, four-byte offset} { evalInProc { set x0 0; set x1 0; set x2 0; set x3 0; set x4 0; set x5 0; set x6 0; set x7 0; set x8 0; set x9 0; set x10 0; set x11 0; set x12 0; set x13 0; set x14 0; set x15 0; set x16 0; set x17 0; set x18 0; set x19 0; set x20 0; set x21 0; set x22 0; set x23 0; set x24 0; set x25 0; set x26 0; set x27 0; set x28 0; set x29 0; set x30 0; set x31 0; set x32 0; set x33 0; set x34 0; set x35 0; set x36 0; set x37 0; set x38 0; set x39 0; set x40 0; set x41 0; set x42 0; set x43 0; set x44 0; set x45 0; set x46 0; set x47 0; set x48 0; set x49 0; set x50 0; set x51 0; set x52 0; set x53 0; set x54 0; set x55 0; set x56 0; set x57 0; set x58 0; set x59 0; set x60 0; set x61 0; set x62 0; set x63 0; set x64 0; set x65 0; set x66 0; set x67 0; set x68 0; set x69 0; set x70 0; set x71 0; set x72 0; set x73 0; set x74 0; set x75 0; set x76 0; set x77 0; set x78 0; set x79 0; set x80 0; set x81 0; set x82 0; set x83 0; set x84 0; set x85 0; set x86 0; set x87 0; set x88 0; set x89 0; set x90 0; set x91 0; set x92 0; set x93 0; set x94 0; set x95 0; set x96 0; set x97 0; set x98 0; set x99 0; set x100 0; set x101 0; set x102 0; set x103 0; set x104 0; set x105 0; set x106 0; set x107 0; set x108 0; set x109 0; set x110 0; set x111 0; set x112 0; set x113 0; set x114 0; set x115 0; set x116 0; set x117 0; set x118 0; set x119 0; set x120 0; set x121 0; set x122 0; set x123 0; set x124 0; set x125 0; set x126 0; set x127 0; set x128 0; set x129 0; set x130 0; set x131 0; set x132 0; set x133 0; set x134 0; set x135 0; set x136 0; set x137 0; set x138 0; set x139 0; set x140 0; set x141 0; set x142 0; set x143 0; set x144 0; set x145 0; set x146 0; set x147 0; set x148 0; set x149 0; set x150 0; set x151 0; set x152 0; set x153 0; set x154 0; set x155 0; set x156 0; set x157 0; set x158 0; set x159 0; set x160 0; set x161 0; set x162 0; set x163 0; set x164 0; set x165 0; set x166 0; set x167 0; set x168 0; set x169 0; set x170 0; set x171 0; set x172 0; set x173 0; set x174 0; set x175 0; set x176 0; set x177 0; set x178 0; set x179 0; set x180 0; set x181 0; set x182 0; set x183 0; set x184 0; set x185 0; set x186 0; set x187 0; set x188 0; set x189 0; set x190 0; set x191 0; set x192 0; set x193 0; set x194 0; set x195 0; set x196 0; set x197 0; set x198 0; set x199 0; set x200 0; set x201 0; set x202 0; set x203 0; set x204 0; set x205 0; set x206 0; set x207 0; set x208 0; set x209 0; set x210 0; set x211 0; set x212 0; set x213 0; set x214 0; set x215 0; set x216 0; set x217 0; set x218 0; set x219 0; set x220 0; set x221 0; set x222 0; set x223 0; set x224 0; set x225 0; set x226 0; set x227 0; set x228 0; set x229 0; set x230 0; set x231 0; set x232 0; set x233 0; set x234 0; set x235 0; set x236 0; set x237 0; set x238 0; set x239 0; set x240 0; set x241 0; set x242 0; set x243 0; set x244 0; set x245 0; set x246 0; set x247 0; set x248 0; set x249 0; set x250 0; set x251 0; set x252 0; set x253 0; set x254 0; set x255 0; set y(0) {{1 2} {3 4}} lset y(0) {1 1} 5 } } "0 {{1 2} {3 5}}" test lsetComp-2.8 {lset, compiled, list of args, error } { evalInProc { set x { {1 2} {3 4} } lset x {1 5} 5 } } {1 {index "5" out of range}} test lsetComp-2.9 {lset, compiled, list of args, error - is string preserved} { set ::x { { 1 2 } { 3 4 } } evalInProc { lset ::x { 1 5 } 5 } list $::x [lindex $::x 1] } "{ { 1 2 } { 3 4 } } { 3 4 }" test lsetComp-3.1 {lset, compiled, flat args, not a simple var name} { evalInProc { set y x set x {{1 2} {3 4}} lset $y 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.2 {lset, compiled, flat args, scalar on stack} { evalInProc { set ::x {{1 2} {3 4}} lset ::x 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.3 {lset, compiled, flat args, scalar, one-byte offset} { evalInProc { set x {{1 2} {3 4}} lset x 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.4 {lset, compiled, scalar, four-byte offset} { evalInProc { set x0 0; set x1 0; set x2 0; set x3 0; set x4 0; set x5 0; set x6 0; set x7 0; set x8 0; set x9 0; set x10 0; set x11 0; set x12 0; set x13 0; set x14 0; set x15 0; set x16 0; set x17 0; set x18 0; set x19 0; set x20 0; set x21 0; set x22 0; set x23 0; set x24 0; set x25 0; set x26 0; set x27 0; set x28 0; set x29 0; set x30 0; set x31 0; set x32 0; set x33 0; set x34 0; set x35 0; set x36 0; set x37 0; set x38 0; set x39 0; set x40 0; set x41 0; set x42 0; set x43 0; set x44 0; set x45 0; set x46 0; set x47 0; set x48 0; set x49 0; set x50 0; set x51 0; set x52 0; set x53 0; set x54 0; set x55 0; set x56 0; set x57 0; set x58 0; set x59 0; set x60 0; set x61 0; set x62 0; set x63 0; set x64 0; set x65 0; set x66 0; set x67 0; set x68 0; set x69 0; set x70 0; set x71 0; set x72 0; set x73 0; set x74 0; set x75 0; set x76 0; set x77 0; set x78 0; set x79 0; set x80 0; set x81 0; set x82 0; set x83 0; set x84 0; set x85 0; set x86 0; set x87 0; set x88 0; set x89 0; set x90 0; set x91 0; set x92 0; set x93 0; set x94 0; set x95 0; set x96 0; set x97 0; set x98 0; set x99 0; set x100 0; set x101 0; set x102 0; set x103 0; set x104 0; set x105 0; set x106 0; set x107 0; set x108 0; set x109 0; set x110 0; set x111 0; set x112 0; set x113 0; set x114 0; set x115 0; set x116 0; set x117 0; set x118 0; set x119 0; set x120 0; set x121 0; set x122 0; set x123 0; set x124 0; set x125 0; set x126 0; set x127 0; set x128 0; set x129 0; set x130 0; set x131 0; set x132 0; set x133 0; set x134 0; set x135 0; set x136 0; set x137 0; set x138 0; set x139 0; set x140 0; set x141 0; set x142 0; set x143 0; set x144 0; set x145 0; set x146 0; set x147 0; set x148 0; set x149 0; set x150 0; set x151 0; set x152 0; set x153 0; set x154 0; set x155 0; set x156 0; set x157 0; set x158 0; set x159 0; set x160 0; set x161 0; set x162 0; set x163 0; set x164 0; set x165 0; set x166 0; set x167 0; set x168 0; set x169 0; set x170 0; set x171 0; set x172 0; set x173 0; set x174 0; set x175 0; set x176 0; set x177 0; set x178 0; set x179 0; set x180 0; set x181 0; set x182 0; set x183 0; set x184 0; set x185 0; set x186 0; set x187 0; set x188 0; set x189 0; set x190 0; set x191 0; set x192 0; set x193 0; set x194 0; set x195 0; set x196 0; set x197 0; set x198 0; set x199 0; set x200 0; set x201 0; set x202 0; set x203 0; set x204 0; set x205 0; set x206 0; set x207 0; set x208 0; set x209 0; set x210 0; set x211 0; set x212 0; set x213 0; set x214 0; set x215 0; set x216 0; set x217 0; set x218 0; set x219 0; set x220 0; set x221 0; set x222 0; set x223 0; set x224 0; set x225 0; set x226 0; set x227 0; set x228 0; set x229 0; set x230 0; set x231 0; set x232 0; set x233 0; set x234 0; set x235 0; set x236 0; set x237 0; set x238 0; set x239 0; set x240 0; set x241 0; set x242 0; set x243 0; set x244 0; set x245 0; set x246 0; set x247 0; set x248 0; set x249 0; set x250 0; set x251 0; set x252 0; set x253 0; set x254 0; set x255 0; set x {{1 2} {3 4}} lset x 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.5 {lset, compiled, flat args, array on stack} { evalInProc { set ::y(0) {{1 2} {3 4}} lset ::y(0) 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.6 {lset, compiled, flat args, array, one-byte offset} { evalInProc { set y(0) {{1 2} {3 4}} lset y(0) 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.7 {lset, compiled, flat args, array, four-byte offset} { evalInProc { set x0 0; set x1 0; set x2 0; set x3 0; set x4 0; set x5 0; set x6 0; set x7 0; set x8 0; set x9 0; set x10 0; set x11 0; set x12 0; set x13 0; set x14 0; set x15 0; set x16 0; set x17 0; set x18 0; set x19 0; set x20 0; set x21 0; set x22 0; set x23 0; set x24 0; set x25 0; set x26 0; set x27 0; set x28 0; set x29 0; set x30 0; set x31 0; set x32 0; set x33 0; set x34 0; set x35 0; set x36 0; set x37 0; set x38 0; set x39 0; set x40 0; set x41 0; set x42 0; set x43 0; set x44 0; set x45 0; set x46 0; set x47 0; set x48 0; set x49 0; set x50 0; set x51 0; set x52 0; set x53 0; set x54 0; set x55 0; set x56 0; set x57 0; set x58 0; set x59 0; set x60 0; set x61 0; set x62 0; set x63 0; set x64 0; set x65 0; set x66 0; set x67 0; set x68 0; set x69 0; set x70 0; set x71 0; set x72 0; set x73 0; set x74 0; set x75 0; set x76 0; set x77 0; set x78 0; set x79 0; set x80 0; set x81 0; set x82 0; set x83 0; set x84 0; set x85 0; set x86 0; set x87 0; set x88 0; set x89 0; set x90 0; set x91 0; set x92 0; set x93 0; set x94 0; set x95 0; set x96 0; set x97 0; set x98 0; set x99 0; set x100 0; set x101 0; set x102 0; set x103 0; set x104 0; set x105 0; set x106 0; set x107 0; set x108 0; set x109 0; set x110 0; set x111 0; set x112 0; set x113 0; set x114 0; set x115 0; set x116 0; set x117 0; set x118 0; set x119 0; set x120 0; set x121 0; set x122 0; set x123 0; set x124 0; set x125 0; set x126 0; set x127 0; set x128 0; set x129 0; set x130 0; set x131 0; set x132 0; set x133 0; set x134 0; set x135 0; set x136 0; set x137 0; set x138 0; set x139 0; set x140 0; set x141 0; set x142 0; set x143 0; set x144 0; set x145 0; set x146 0; set x147 0; set x148 0; set x149 0; set x150 0; set x151 0; set x152 0; set x153 0; set x154 0; set x155 0; set x156 0; set x157 0; set x158 0; set x159 0; set x160 0; set x161 0; set x162 0; set x163 0; set x164 0; set x165 0; set x166 0; set x167 0; set x168 0; set x169 0; set x170 0; set x171 0; set x172 0; set x173 0; set x174 0; set x175 0; set x176 0; set x177 0; set x178 0; set x179 0; set x180 0; set x181 0; set x182 0; set x183 0; set x184 0; set x185 0; set x186 0; set x187 0; set x188 0; set x189 0; set x190 0; set x191 0; set x192 0; set x193 0; set x194 0; set x195 0; set x196 0; set x197 0; set x198 0; set x199 0; set x200 0; set x201 0; set x202 0; set x203 0; set x204 0; set x205 0; set x206 0; set x207 0; set x208 0; set x209 0; set x210 0; set x211 0; set x212 0; set x213 0; set x214 0; set x215 0; set x216 0; set x217 0; set x218 0; set x219 0; set x220 0; set x221 0; set x222 0; set x223 0; set x224 0; set x225 0; set x226 0; set x227 0; set x228 0; set x229 0; set x230 0; set x231 0; set x232 0; set x233 0; set x234 0; set x235 0; set x236 0; set x237 0; set x238 0; set x239 0; set x240 0; set x241 0; set x242 0; set x243 0; set x244 0; set x245 0; set x246 0; set x247 0; set x248 0; set x249 0; set x250 0; set x251 0; set x252 0; set x253 0; set x254 0; set x255 0; set y(0) {{1 2} {3 4}} lset y(0) 1 1 5 } } "0 {{1 2} {3 5}}" test lsetComp-3.8 {lset, compiled, flat args, error } { evalInProc { set x { {1 2} {3 4} } lset x 1 5 5 } } {1 {index "5" out of range}} test lsetComp-3.9 {lset, compiled, flat args, error - is string preserved} { set ::x { { 1 2 } { 3 4 } } evalInProc { lset ::x 1 5 5 } list $::x [lindex $::x 1] } "{ { 1 2 } { 3 4 } } { 3 4 }" catch { rename evalInProc {} } catch { unset ::x } catch { unset ::y } # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/lset.test0000644000175000017500000004120115104661341014557 0ustar sergeisergei# This file is a -*- tcl -*- test script # Commands covered: lset # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2001 Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] proc failTrace {name1 name2 op} { error "trace failed" } testConstraint testevalex [llength [info commands testevalex]] set noRead {} trace add variable noRead read failTrace set noWrite {a b c} trace add variable noWrite write failTrace test lset-1.1 {lset, not compiled, arg count} testevalex { list [catch {testevalex lset} msg] $msg } "1 {wrong \# args: should be \"lset listVar ?index? ?index ...? value\"}" test lset-1.2 {lset, not compiled, no such var} testevalex { list [catch {testevalex {lset noSuchVar 0 {}}} msg] $msg } "1 {can't read \"noSuchVar\": no such variable}" test lset-1.3 {lset, not compiled, var not readable} testevalex { list [catch {testevalex {lset noRead 0 {}}} msg] $msg } "1 {can't read \"noRead\": trace failed}" test lset-2.1 {lset, not compiled, 3 args, second arg a plain index} testevalex { set x {0 1 2} list [testevalex {lset x 0 3}] $x } {{3 1 2} {3 1 2}} test lset-2.2 {lset, not compiled, 3 args, second arg neither index nor list} testevalex { set x {0 1 2} list [catch { testevalex {lset x {{bad}1} 3} } msg] $msg } {1 {bad index "{bad}1": must be integer?[+-]integer? or end?[+-]integer?}} test lset-3.1 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1 2} list [testevalex {lset x 0 $x}] $x } {{{0 1 2} 1 2} {{0 1 2} 1 2}} test lset-3.2 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1} set y $x list [testevalex {lset x 0 2}] $x $y } {{2 1} {2 1} {0 1}} test lset-3.3 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1} set y $x list [testevalex {lset x 0 $x}] $x $y } {{{0 1} 1} {{0 1} 1} {0 1}} test lset-3.4 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1 2} list [testevalex {lset x [list 0] $x}] $x } {{{0 1 2} 1 2} {{0 1 2} 1 2}} test lset-3.5 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1} set y $x list [testevalex {lset x [list 0] 2}] $x $y } {{2 1} {2 1} {0 1}} test lset-3.6 {lset, not compiled, 3 args, data duplicated} testevalex { set x {0 1} set y $x list [testevalex {lset x [list 0] $x}] $x $y } {{{0 1} 1} {{0 1} 1} {0 1}} test lset-4.1 {lset, not compiled, 3 args, not a list} testevalex { set a "x \{" list [catch { testevalex {lset a [list 0] y} } msg] $msg } {1 {unmatched open brace in list}} test lset-4.2 {lset, not compiled, 3 args, bad index} testevalex { set a {x y z} list [catch { testevalex {lset a [list 2a2] w} } msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-4.3 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list -1] w} } msg] $msg } {1 {index "-1" out of range}} test lset-4.4 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list 4] w} } msg] $msg } {1 {index "4" out of range}} test lset-4.5a {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list end--2] w} } msg] $msg } {1 {index "end--2" out of range}} test lset-4.5b {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list end+2] w} } msg] $msg } {1 {index "end+2" out of range}} test lset-4.6 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a [list end-3] w} } msg] $msg } {1 {index "end-3" out of range}} test lset-4.7 {lset, not compiled, 3 args, not a list} testevalex { set a "x \{" list [catch { testevalex {lset a 0 y} } msg] $msg } {1 {unmatched open brace in list}} test lset-4.8 {lset, not compiled, 3 args, bad index} testevalex { set a {x y z} list [catch { testevalex {lset a 2a2 w} } msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-4.9 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a -1 w} } msg] $msg } {1 {index "-1" out of range}} test lset-4.10 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a 4 w} } msg] $msg } {1 {index "4" out of range}} test lset-4.11a {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a end--2 w} } msg] $msg } {1 {index "end--2" out of range}} test lset-4.11 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a end+2 w} } msg] $msg } {1 {index "end+2" out of range}} test lset-4.12 {lset, not compiled, 3 args, index out of range} testevalex { set a {x y z} list [catch { testevalex {lset a end-3 w} } msg] $msg } {1 {index "end-3" out of range}} test lset-5.1 {lset, not compiled, 3 args, can't set variable} testevalex { list [catch { testevalex {lset noWrite 0 d} } msg] $msg $noWrite } {1 {can't set "noWrite": trace failed} {d b c}} test lset-5.2 {lset, not compiled, 3 args, can't set variable} testevalex { list [catch { testevalex {lset noWrite [list 0] d} } msg] $msg $noWrite } {1 {can't set "noWrite": trace failed} {d b c}} test lset-6.1 {lset, not compiled, 3 args, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a 0 a}] $a } {{a y z} {a y z}} test lset-6.2 {lset, not compiled, 3 args, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a [list 0] a}] $a } {{a y z} {a y z}} test lset-6.3 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a 2 a}] $a } {{x y a} {x y a}} test lset-6.4 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a [list 2] a}] $a } {{x y a} {x y a}} test lset-6.5 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a end a}] $a } {{x y a} {x y a}} test lset-6.6 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a [list end] a}] $a } {{x y a} {x y a}} test lset-6.7 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a end-0 a}] $a } {{x y a} {x y a}} test lset-6.8 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a [list end-0] a}] $a } {{x y a} {x y a}} test lset-6.9 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a end-2 a}] $a } {{a y z} {a y z}} test lset-6.10 {lset, not compiled, 1-d list basics} testevalex { set a {x y z} list [testevalex {lset a [list end-2] a}] $a } {{a y z} {a y z}} test lset-7.1 {lset, not compiled, data sharing} testevalex { set a 0 list [testevalex {lset a $a {gag me}}] $a } {{{gag me}} {{gag me}}} test lset-7.2 {lset, not compiled, data sharing} testevalex { set a [list 0] list [testevalex {lset a $a {gag me}}] $a } {{{gag me}} {{gag me}}} test lset-7.3 {lset, not compiled, data sharing} testevalex { set a {x y} list [testevalex {lset a 0 $a}] $a } {{{x y} y} {{x y} y}} test lset-7.4 {lset, not compiled, data sharing} testevalex { set a {x y} list [testevalex {lset a [list 0] $a}] $a } {{{x y} y} {{x y} y}} test lset-7.5 {lset, not compiled, data sharing} testevalex { set n 0 set a {x y} list [testevalex {lset a $n $n}] $a $n } {{0 y} {0 y} 0} test lset-7.6 {lset, not compiled, data sharing} testevalex { set n [list 0] set a {x y} list [testevalex {lset a $n $n}] $a $n } {{0 y} {0 y} 0} test lset-7.7 {lset, not compiled, data sharing} testevalex { set n 0 set a [list $n $n] list [testevalex {lset a $n 1}] $a $n } {{1 0} {1 0} 0} test lset-7.8 {lset, not compiled, data sharing} testevalex { set n [list 0] set a [list $n $n] list [testevalex {lset a $n 1}] $a $n } {{1 0} {1 0} 0} test lset-7.9 {lset, not compiled, data sharing} testevalex { set a 0 list [testevalex {lset a $a $a}] $a } {0 0} test lset-7.10 {lset, not compiled, data sharing} testevalex { set a [list 0] list [testevalex {lset a $a $a}] $a } {0 0} test lset-8.1 {lset, not compiled, malformed sublist} testevalex { set a [list "a \{" b] list [catch {testevalex {lset a 0 1 c}} msg] $msg } {1 {unmatched open brace in list}} test lset-8.2 {lset, not compiled, malformed sublist} testevalex { set a [list "a \{" b] list [catch {testevalex {lset a {0 1} c}} msg] $msg } {1 {unmatched open brace in list}} test lset-8.3 {lset, not compiled, bad second index} testevalex { set a {{b c} {d e}} list [catch {testevalex {lset a 0 2a2 f}} msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-8.4 {lset, not compiled, bad second index} testevalex { set a {{b c} {d e}} list [catch {testevalex {lset a {0 2a2} f}} msg] $msg } {1 {bad index "2a2": must be integer?[+-]integer? or end?[+-]integer?}} test lset-8.5 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 -1 h}} msg] $msg } {1 {index "-1" out of range}} test lset-8.6 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a {2 -1} h}} msg] $msg } {1 {index "-1" out of range}} test lset-8.7 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 3 h}} msg] $msg } {1 {index "3" out of range}} test lset-8.8 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a {2 3} h}} msg] $msg } {1 {index "3" out of range}} test lset-8.9a {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 end--2 h}} msg] $msg } {1 {index "end--2" out of range}} test lset-8.9b {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 end+2 h}} msg] $msg } {1 {index "end+2" out of range}} test lset-8.10a {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a {2 end--2} h}} msg] $msg } {1 {index "end--2" out of range}} test lset-8.10b {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a {2 end+2} h}} msg] $msg } {1 {index "end+2" out of range}} test lset-8.11 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a 2 end-2 h}} msg] $msg } {1 {index "end-2" out of range}} test lset-8.12 {lset, not compiled, second index out of range} testevalex { set a {{b c} {d e} {f g}} list [catch {testevalex {lset a {2 end-2} h}} msg] $msg } {1 {index "end-2" out of range}} test lset-9.1 {lset, not compiled, entire variable} testevalex { set a x list [testevalex {lset a y}] $a } {y y} test lset-9.2 {lset, not compiled, entire variable} testevalex { set a x list [testevalex {lset a {} y}] $a } {y y} test lset-10.1 {lset, not compiled, shared data} testevalex { set row {p q} set a [list $row $row] list [testevalex {lset a 0 0 x}] $a } {{{x q} {p q}} {{x q} {p q}}} test lset-10.2 {lset, not compiled, shared data} testevalex { set row {p q} set a [list $row $row] list [testevalex {lset a {0 0} x}] $a } {{{x q} {p q}} {{x q} {p q}}} test lset-10.3 {lset, not compiled, shared data, [Bug 1333036]} testevalex { set a [list [list p q] [list r s]] set b $a list [testevalex {lset b {0 0} x}] $a } {{{x q} {r s}} {{p q} {r s}}} test lset-11.1 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a 0 0 f}] $a } {{{f c} {d e}} {{f c} {d e}}} test lset-11.2 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a {0 0} f}] $a } {{{f c} {d e}} {{f c} {d e}}} test lset-11.3 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a 0 1 f}] $a } {{{b f} {d e}} {{b f} {d e}}} test lset-11.4 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a {0 1} f}] $a } {{{b f} {d e}} {{b f} {d e}}} test lset-11.5 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a 1 0 f}] $a } {{{b c} {f e}} {{b c} {f e}}} test lset-11.6 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a {1 0} f}] $a } {{{b c} {f e}} {{b c} {f e}}} test lset-11.7 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a 1 1 f}] $a } {{{b c} {d f}} {{b c} {d f}}} test lset-11.8 {lset, not compiled, 2-d basics} testevalex { set a {{b c} {d e}} list [testevalex {lset a {1 1} f}] $a } {{{b c} {d f}} {{b c} {d f}}} test lset-12.0 {lset, not compiled, typical sharing pattern} testevalex { set zero 0 set row [list $zero $zero $zero $zero] set ident [list $row $row $row $row] for { set i 0 } { $i < 4 } { incr i } { testevalex {lset ident $i $i 1} } set ident } {{1 0 0 0} {0 1 0 0} {0 0 1 0} {0 0 0 1}} test lset-13.0 {lset, not compiled, shimmering hell} testevalex { set a 0 list [testevalex {lset a $a $a $a $a {gag me}}] $a } {{{{{{gag me}}}}} {{{{{gag me}}}}}} test lset-13.1 {lset, not compiled, shimmering hell} testevalex { set a [list 0] list [testevalex {lset a $a $a $a $a {gag me}}] $a } {{{{{{gag me}}}}} {{{{{gag me}}}}}} test lset-13.2 {lset, not compiled, shimmering hell} testevalex { set a [list 0 0 0 0] list [testevalex {lset a $a {gag me}}] $a } {{{{{{gag me}}}} 0 0 0} {{{{{gag me}}}} 0 0 0}} test lset-14.1 {lset, not compiled, list args, is string rep preserved?} testevalex { set a { { 1 2 } { 3 4 } } catch { testevalex {lset a {1 5} 5} } list $a [lindex $a 1] } "{ { 1 2 } { 3 4 } } { 3 4 }" test lset-14.2 {lset, not compiled, flat args, is string rep preserved?} testevalex { set a { { 1 2 } { 3 4 } } catch { testevalex {lset a 1 5 5} } list $a [lindex $a 1] } "{ { 1 2 } { 3 4 } } { 3 4 }" testConstraint testobj [llength [info commands testobj]] test lset-15.1 {lset: shared internalrep [Bug 1677512]} -setup { teststringobj set 1 {{1 2} 3} testobj convert 1 list testobj duplicate 1 2 variable x [teststringobj get 1] variable y [teststringobj get 2] testobj freeallvars set l [list $y z] unset y } -constraints testobj -body { lset l 0 0 0 5 lindex $x 0 0 } -cleanup { unset -nocomplain x l } -result 1 test lset-16.1 {lset - grow a variable} testevalex { set x {} testevalex {lset x 0 {test 1}} testevalex {lset x 1 {test 2}} set x } {{test 1} {test 2}} test lset-16.2 {lset - multiple created sublists} testevalex { set x {} testevalex {lset x 0 0 {test 1}} } {{{test 1}}} test lset-16.3 {lset - sublists 3 deep} testevalex { set x {} testevalex {lset x 0 0 0 {test 1}} } {{{{test 1}}}} test lset-16.4 {lset - append to inner list} testevalex { set x {test 1} testevalex {lset x 1 1 2} testevalex {lset x 1 2 3} testevalex {lset x 1 2 1 4} } {test {1 2 {3 4}}} test lset-16.5 {lset - grow a variable} testevalex { set x {} testevalex {lset x end+1 {test 1}} testevalex {lset x end+1 {test 2}} set x } {{test 1} {test 2}} test lset-16.6 {lset - multiple created sublists} testevalex { set x {} testevalex {lset x end+1 end+1 {test 1}} } {{{test 1}}} test lset-16.7 {lset - sublists 3 deep} testevalex { set x {} testevalex {lset x end+1 end+1 end+1 {test 1}} } {{{{test 1}}}} test lset-16.8 {lset - append to inner list} testevalex { set x {test 1} testevalex {lset x end end+1 2} testevalex {lset x end end+1 3} testevalex {lset x end end end+1 4} } {test {1 2 {3 4}}} catch {unset noRead} catch {unset noWrite} catch {rename failTrace {}} catch {unset ::x} catch {unset ::y} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/lseq.test0000644000175000017500000012103215104661341014555 0ustar sergeisergei# Commands covered: lseq # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2003 Simon Geard. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint arithSeriesDouble 1 testConstraint arithSeriesShimmer 1 testConstraint arithSeriesShimmerOk 1 testConstraint has64BitLengths [expr {$tcl_platform(pointerSize) == 8}] testConstraint has32BitLengths [expr {$tcl_platform(pointerSize) == 4}] proc memusage {} { set fd [open /proc/[pid]/statm] set line [gets $fd] if {[llength $line] != 7} { error "Unexpected /proc/pid/statm format" } close $fd return [lindex $line 5] } testConstraint hasMemUsage [expr {![catch {memusage}]}] # Arg errors test lseq-1.1 {error cases} -body { lseq } \ -returnCodes 1 \ -result {wrong # args: should be "lseq n ??op? n ??by? n??"} test lseq-1.2 {step magnitude} { lseq 10 .. 1 by -2 ;# or this could be an error - or not } {10 8 6 4 2} test lseq-1.3 {synergy between int and double} -body { set rl [lseq 25. to 5. by -5] set il [lseq 25 to 5 by -5] lmap r $rl i $il { if {$r ne "" && $i ne ""} {expr {int($r) == $i}} else {list $r $i} } } -cleanup { unset rl il } -result {1 1 1 1 1} test lseq-1.4 {integer decreasing} { lseq 10 .. 1 } {10 9 8 7 6 5 4 3 2 1} test lseq-1.5 {integer increasing} { lseq 1 .. 10 } {1 2 3 4 5 6 7 8 9 10} test lseq-1.6 {integer decreasing with step} { lseq 10 .. 1 by -2 } {10 8 6 4 2} test lseq-1.7 {real increasing lseq} arithSeriesDouble { lseq 5.0 to 15. } {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} test lseq-1.8 {real increasing lseq with step} arithSeriesDouble { lseq 5.0 to 25. by 5 } {5.0 10.0 15.0 20.0 25.0} test lseq-1.9 {real decreasing with step} arithSeriesDouble { lseq 25. to 5. by -5 } {25.0 20.0 15.0 10.0 5.0} # note, 10 cannot be in such a list, but allowed test lseq-1.10 {integer lseq with step} { lseq 1 to 10 by 2 } {1 3 5 7 9} test lseq-1.11 {error case: increasing wrong step direction} { lseq 1 to 10 by -2 } {} test lseq-1.12 {decreasing lseq with step} arithSeriesDouble { lseq 25. to -25. by -5 } {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} test lseq-1.13 {count operation} { -body { lseq 5 count 5 } -result {5 6 7 8 9} } test lseq-1.14 {count with step} { -body { lseq 5 count 5 by 2 } -result {5 7 9 11 13} } test lseq-1.15 {count with decreasing step} { -body { lseq 5 count 5 by -2 } -result {5 3 1 -1 -3} } test lseq-1.16 {large doubles} { -body { lseq [expr {int(1e6)}] [expr {int(2e6)}] [expr {int(1e5)}] } -result {1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000} } test lseq-1.16.2 {large numbers (bigints are not supported yet)} -body { lseq 0xfffffffffffffffe 0xffffffffffffffff } -returnCodes 1 -result {integer value too large to represent} test lseq-1.17 {too many arguments} -body { lseq 12 to 24 by 2 with feeling } -returnCodes 1 -result {wrong # args: should be "lseq n ??op? n ??by? n??"} test lseq-1.18 {too many arguments extra valid keyword} -body { lseq 12 to 24 by 2 count } -returnCodes 1 -result {wrong # args: should be "lseq n ??op? n ??by? n??"} test lseq-1.19 {too many arguments extra numeric value} -body { lseq 12 to 24 by 2 7 } -returnCodes 1 -result {wrong # args: should be "lseq n ??op? n ??by? n??"} test lseq-1.20 {bug: wrong length computed} { lseq 1 to 10 -1 } {} test lseq-1.21 {n n by n} { lseq 66 84 by 3 } {66 69 72 75 78 81 84} test lseq-1.22 {n n by -n} { lseq 84 66 by -3 } {84 81 78 75 72 69 66} test lseq-1.23 {consistence, accept double count representable as integer (but use double in series when arguments other than count value are of type double)} { list [lseq 0.0 2.0] [lseq 3.0] [lseq 0 count 3.0] \ [lseq 0.0 count 3.0] [lseq 0 count 3.0 by 1.0] } {{0.0 1.0 2.0} {0 1 2} {0 1 2} {0.0 1.0 2.0} {0.0 1.0 2.0}} test lseq-1.24 {consistence, use double (even if representable as integer) in all variants, if contains a double somewhere} { list [lseq 0.0 2] [lseq 0 2.0] [lseq 0.0 count 3] \ [lseq 0 count 3 by 1.0] [lseq 0 .. 2.0] [lseq 0 to 2 by 1.0] } [lrepeat 6 {0.0 1.0 2.0}] test lseq-1.25 {consistence, use double (even if representable as integer) in all variants, if contains a double somewhere} { list [lseq double(0) 2] [lseq 0 double(2)] [lseq double(0) count 3] \ [lseq 0 count 3 by double(1)] [lseq 0 .. double(2)] [lseq 0 to 2 by double(1)] } [lrepeat 6 {0.0 1.0 2.0}] test lseq-1.26 {consistence, double always remains double} { list [lseq 1 3.0 ] \ [lseq 1 [expr {3.0+0}] ] \ [lseq 1 {3.0+0} ] \ [lseq 1.0 3.0 1] \ [lseq [expr {1.0+0}] [expr {3.0+0}] 1] \ [lseq {1.0+0} {3.0+0} 1] } [lrepeat 6 {1.0 2.0 3.0}] test lseq-1.27 {consistence, double always remains double} { list [lseq 1e50 [expr {1e50+1}] ] \ [lseq 1e50 {1e50+1} ] \ [lseq [expr {1e50+0}] [expr {1e50+1}] 1] \ [lseq {1e50+0} {1e50+1} 1] \ [lseq [expr {1e50+0}] count 1 1] \ [lseq {1e50+0} count 1 1] } [lrepeat 6 [expr {1e50}]] # # Short-hand use cases # test lseq-2.2 {step magnitude} { lseq 10 1 2 ;# this is an empty case since step has wrong sign } {} test lseq-2.3 {step wrong sign} arithSeriesDouble { lseq 25. 5. 5 ;# ditto - empty list } {} test lseq-2.4 {integer decreasing} { lseq 10 1 } {10 9 8 7 6 5 4 3 2 1} test lseq-2.5 {integer increasing} { lseq 1 10 } {1 2 3 4 5 6 7 8 9 10} test lseq-2.6 {integer decreasing with step} { lseq 10 1 by -2 } {10 8 6 4 2} test lseq-2.7 {real increasing lseq} arithSeriesDouble { lseq 5.0 15. } {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} test lseq-2.8 {real increasing lseq with step} arithSeriesDouble { lseq 5.0 25. 5 } {5.0 10.0 15.0 20.0 25.0} test lseq-2.9 {real decreasing with step} arithSeriesDouble { lseq 25. 5. -5 } {25.0 20.0 15.0 10.0 5.0} test lseq-2.10 {integer lseq with step} { lseq 1 10 2 } {1 3 5 7 9} test lseq-2.11 {error case: increasing wrong step direction} { lseq 1 10 -2 } {} test lseq-2.12 {decreasing lseq with step} arithSeriesDouble { lseq 25. -25. -5 } {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} test lseq-2.13 {count only operation} { lseq 5 } {0 1 2 3 4} test lseq-2.14 {count with step} { lseq 5 count 5 2 } {5 7 9 11 13} test lseq-2.15 {count with decreasing step} { lseq 5 count 5 -2 } {5 3 1 -1 -3} test lseq-2.16 {large numbers} { lseq 1e6 2e6 1e5 } {1000000.0 1100000.0 1200000.0 1300000.0 1400000.0 1500000.0 1600000.0 1700000.0 1800000.0 1900000.0 2000000.0} test lseq-2.17 {large numbers} arithSeriesDouble { lseq 1e6 2e6 1e5 } {1000000.0 1100000.0 1200000.0 1300000.0 1400000.0 1500000.0 1600000.0 1700000.0 1800000.0 1900000.0 2000000.0} # Covered: {10 1 2 } {1 10 2} {1 10 -2} {1 1 1} {1 1 1} {-5 17 3} # Missing: {- - +} {- - -} {- + -} {+ - -} {- - +} {+ + -} test lseq-2.18 {signs} { list [lseq -10 -1 2] \ [lseq -10 -1 -1] \ [lseq -10 1 -3] \ [lseq 10 -1 -4] \ [lseq -10 -1 3] \ [lseq 10 1 -5] } {{-10 -8 -6 -4 -2} {} {} {10 6 2} {-10 -7 -4 -1} {10 5}} test lseq-2.19 {expressions as indices} { list [lseq {1+1}] \ [lseq {1+1} {2+2}] \ [lseq {1+1} count {2+2}] \ [lseq {1+1} {5+5} {2+2}] \ [lseq {1+1} count {2+2} by {2+2}] } {{0 1} {2 3 4} {2 3 4 5} {2 6 10} {2 6 10 14}} test lseq-2.20 {expressions as indices, no duplicative eval of expr} { set i 1 list [lseq {[incr i]}] $i [lseq {0 + [incr i]}] $i [lseq {0.0 + [incr i]}] $i } {{0 1} 2 {0 1 2} 3 {0 1 2 3} 4} test lseq-3.0 {expr error: don't swalow expr error (here: divide by zero)} -body { set i 0; lseq {3/$i} } -returnCodes [catch {expr {3/0}} res] -result $res test lseq-3.1 {experiement} -body { set ans {} foreach factor [lseq 2.0 10.0] { set start 1 set end 10 for {set step 1} {$step < 1e8} {} { set l [lseq $start to $end by $step] if {[llength $l] != 10} { lappend ans $factor $step [llength $l] $l } set step [expr {$step * $factor}] set end [expr {$end * $factor}] } } if {$ans eq {}} { set ans OK } set ans } -cleanup { unset ans step end start factor l } -result {OK} test lseq-3.2 {error case} -body { lseq foo } -returnCodes 1 -match glob -result {invalid bareword "foo"*} test lseq-3.3 {error case} -body { lseq 10 foo } -returnCodes 1 -match glob -result {invalid bareword "foo"*} test lseq-3.4 {error case} -body { lseq 25 or 6 } -returnCodes 1 -match glob -result {invalid bareword "or"*} test lseq-3.5 {simple count and step arguments} -body { set s [lseq 25 by 6] list $s length=[llength $s] } -cleanup { unset s } -result {{0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96 102 108 114 120 126 132 138 144} length=25} test lseq-3.6 {error case} -body { lseq 1 7 or 3 } -returnCodes 1 -result {bad operation "or": must be .., to, count, or by} test lseq-3.6b {error case} -body { lseq 1 to 7 or 3 } -returnCodes 1 -result {bad operation "or": must be .., to, count, or by} test lseq-3.7 {lmap lseq} -body { lmap x [lseq 5] { expr {$x * $x} } } -cleanup {unset x} -result {0 1 4 9 16} test lseq-3.8 {lrange lseq} -body { set r [lrange [lseq 1 100] 10 20] set empty [lrange [lseq 1 100] 20 10] list $r $empty [lindex [tcl::unsupported::representation $r] 3] } -cleanup { unset r empty } -result {{11 12 13 14 15 16 17 18 19 20 21} {} arithseries} test lseq-3.9 {lassign lseq} -constraints arithSeriesShimmer -body { set r [lseq 15] set r2 [lassign $r a b] list [lindex [tcl::unsupported::representation $r] 3] $a $b \ [lindex [tcl::unsupported::representation $r2] 3] } -cleanup {unset r r2 a b} -result {arithseries 0 1 arithseries} test lseq-3.10 {lsearch lseq must shimmer?} -constraints arithSeriesShimmer -body { set r [lseq 15 0] set a [lsearch $r 9] list [lindex [tcl::unsupported::representation $r] 3] $a } -cleanup {unset r a} -result {arithseries 6} test lseq-3.11 {lreverse lseq} -body { set r [lseq 15 0] set a [lreverse $r] join [list \ [lindex [tcl::unsupported::representation $r] 3] \ $r \ [lindex [tcl::unsupported::representation $a] 3] \ $a] \n } -cleanup {unset r a} -result {arithseries 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 arithseries 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15} test lseq-3.12 {in operator} -body { set r [lseq 9] set i [expr {7 in $r}] set j [expr {10 ni $r}] set k [expr {-1 in $r}] set l [expr {4 ni $r}] list $i $j $k $l [lindex [tcl::unsupported::representation $r] 3] } -cleanup { unset r i j k l } -result {1 1 0 0 arithseries} test lseq-3.13 {lmap lseq shimmer} -constraints arithSeriesShimmer -body { set r [lseq 15] set rep-before [lindex [tcl::unsupported::representation $r] 3] set m [lmap i $r { expr {$i * 7} }] set rep-after [lindex [tcl::unsupported::representation $r] 3] set rep-m [lindex [tcl::unsupported::representation $m] 3] list $r ${rep-before} ${rep-after} ${rep-m} $m } -cleanup { unset r rep-before m rep-after rep-m } -result {{0 1 2 3 4 5 6 7 8 9 10 11 12 13 14} arithseries arithseries list {0 7 14 21 28 35 42 49 56 63 70 77 84 91 98}} test lseq-3.14 {array for shimmer} -constraints arithSeriesShimmerOk -body { array set testarray {a Test for This great Function} set vars [lseq 2] set vars-rep [lindex [tcl::unsupported::representation $vars] 3] array for $vars testarray { lappend keys $0 lappend vals $1 } # Since hash order is not guaranteed, have to validate content ignoring order set valk [lmap k $keys {expr {$k in {a for great}}}] set valv [lmap v $vals {expr {$v in {Test This Function}}}] set vars-after [lindex [tcl::unsupported::representation $vars] 3] list ${vars-rep} $valk $valv ${vars-after} } -cleanup { unset testarray vars vars-rep 0 valk k valv v vars-after } -result {arithseries {1 1 1} {1 1 1} arithseries} test lseq-3.15 {join for shimmer} -constraints arithSeriesShimmer -body { set r [lseq 3] set rep-before [lindex [tcl::unsupported::representation $r] 3] set str [join $r :] set rep-after [lindex [tcl::unsupported::representation $r] 3] list ${rep-before} $str ${rep-after} } -cleanup { unset r rep-before str rep-after } -result {arithseries 0:1:2 arithseries} test lseq-3.16 {error case} -body { lseq 16 to } -returnCodes 1 -result {missing "to" value.} test lseq-3.17 {error case} -body { lseq 17 to 13 by } -returnCodes 1 -result {missing "by" value.} test lseq-3.18 {error case} -body { lseq 18 count } -returnCodes 1 -result {missing "count" value.} test lseq-3.19 {edge case} -body { lseq 1 count 5 by 0 } -result {} # 1 1 1 1 1 # My thought is that this is likely a user error, since they can always use lrepeat for this. test lseq-3.20 {edge case} -body { lseq 1 to 1 by 0 } -result {} # hmmm, I guess this is right, in a way, so... test lseq-3.21 {edge case} { lseq 1 to 1 by 1 } {1} test lseq-3.22 {edge case} { lseq 1 1 1 } {1} test lseq-3.23 {edge case} { llength [lseq 1 1 1] } {1} test lseq-3.24 {edge case} { llength [lseq 1 to 1 1] } {1} test lseq-3.25 {edge case} { llength [lseq 1 to 1 by 1] } {1} test lseq-3.26 {lsort shimmer} -constraints arithSeriesShimmer -body { set r [lseq 15 0] set rep-before [lindex [tcl::unsupported::representation $r] 3] set lexical_sort [lsort $r] set rep-after [lindex [tcl::unsupported::representation $r] 3] list ${rep-before} $lexical_sort ${rep-after} } -cleanup { unset r rep-before lexical_sort rep-after } -result {arithseries {0 1 10 11 12 13 14 15 2 3 4 5 6 7 8 9} arithseries} test lseq-3.27 {lreplace shimmer} -constraints arithSeriesShimmer -body { set r [lseq 15 0] set rep-before [lindex [tcl::unsupported::representation $r] 3] set lexical_sort [lreplace $r 3 5 A B C] set rep-after [lindex [tcl::unsupported::representation $r] 3] list ${rep-before} $lexical_sort ${rep-after} } -cleanup { unset r unset rep-before unset lexical_sort unset rep-after } -result {arithseries {15 14 13 A B C 9 8 7 6 5 4 3 2 1 0} arithseries} test lseq-3.28 {lreverse bug in ArithSeries} -body { set r [lseq -5 17 3] set rr [lreverse $r] list $r $rr [string equal $r [lreverse $rr]] } -cleanup { unset r rr } -result {{-5 -2 1 4 7 10 13 16} {16 13 10 7 4 1 -2 -5} 1} test lseq-3.29 {edge case: negative count} { lseq -15 } {} test lseq-3.30 {lreverse with double values} -constraints arithSeriesDouble -body { set r [lseq 3.5 18.5 1.5] set a [lreverse $r] join [list \ [lindex [tcl::unsupported::representation $r] 3] \ $r \ [lindex [tcl::unsupported::representation $a] 3] \ $a] \n } -cleanup { unset r a } -result {arithseries 3.5 5.0 6.5 8.0 9.5 11.0 12.5 14.0 15.5 17.0 18.5 arithseries 18.5 17.0 15.5 14.0 12.5 11.0 9.5 8.0 6.5 5.0 3.5} test lseq-3.31 {lreverse inplace with doubles} {arithSeriesDouble} { lreverse [lseq 1.1 29.9 0.3] } {29.9 29.6 29.3 29.0 28.7 28.4 28.1 27.8 27.5 27.2 26.9 26.6 26.3 26.0 25.7 25.4 25.1 24.8 24.5 24.2 23.9 23.6 23.3 23.0 22.7 22.4 22.1 21.8 21.5 21.2 20.9 20.6 20.3 20.0 19.7 19.4 19.1 18.8 18.5 18.2 17.9 17.6 17.3 17.0 16.7 16.4 16.1 15.8 15.5 15.2 14.9 14.6 14.3 14.0 13.7 13.4 13.1 12.8 12.5 12.2 11.9 11.6 11.3 11.0 10.7 10.4 10.1 9.8 9.5 9.2 8.9 8.6 8.3 8.0 7.7 7.4 7.1 6.8 6.5 6.2 5.9 5.6 5.3 5.0 4.7 4.4 4.1 3.8 3.5 3.2 2.9 2.6 2.3 2.0 1.7 1.4 1.1} # lsearch - # -- should not shimmer lseq list # -- should not leak lseq elements test lseq-3.32 {lsearch nested lists of lseq} -constraints arithSeriesShimmer -body { set srchlist {} for {set i 5} {$i < 25} {incr i} { lappend srchlist [lseq $i count 7 by 3] } set a [lsearch -all -inline -index 1 $srchlist 23] set b [lmap i $a {lindex [tcl::unsupported::representation $i] 3}] list [lindex [tcl::unsupported::representation $a] 3] $a $b \ [lindex [tcl::unsupported::representation [lindex $srchlist 15]] 3] } -cleanup { unset a b srchlist i } -result {list {{20 23 26 29 32 35 38}} arithseries arithseries} # lsearch - # -- should not shimmer lseq list # -- should not leak lseq elements test lseq-3.33 {lsearch nested lists of lseq} -constraints arithSeriesShimmer -body { set srchlist {} for {set i 5} {$i < 25} {incr i} { lappend srchlist [lseq $i count 7 by 3] } set a [lsearch -all -inline -index 1 $srchlist 23] set b [lmap i $a {lindex [tcl::unsupported::representation $i] 3}] list [lindex [tcl::unsupported::representation $a] 3] $a $b \ [lindex [tcl::unsupported::representation [lindex $srchlist 15]] 3] } -cleanup { unset srchlist i a b } -result {list {{20 23 26 29 32 35 38}} arithseries arithseries} test lseq-3.34 {"in" operator} -body { set seq [lseq 0.3 15e4 0.1] set inlist {} set nilist {} foreach y [lseq 3012.0 3013.0 0.03] { if {$y in $seq} { lappend inlist $y } else { lappend nilist $y } } list $inlist $nilist } -cleanup { unset seq inlist nilist y } -result {{3012.0 3012.3 3012.6 3012.9} {3012.03 3012.06 3012.09 3012.12 3012.15 3012.18 3012.21 3012.24 3012.27 3012.33 3012.36 3012.39 3012.42 3012.45 3012.48 3012.51 3012.54 3012.57 3012.63 3012.66 3012.69 3012.72 3012.75 3012.78 3012.81 3012.84 3012.87 3012.93 3012.96 3012.99}} test lseq-3.35 {"in" operator integer} -body { set seq [lseq 3 int(15e4) 5] set inlist {} set nilist {} foreach y [lseq 3012 3213 3] { if {$y in $seq} { lappend inlist $y } else { lappend nilist $y } } list $inlist $nilist } -cleanup { unset seq inlist nilist y } -result {{3018 3033 3048 3063 3078 3093 3108 3123 3138 3153 3168 3183 3198 3213} {3012 3015 3021 3024 3027 3030 3036 3039 3042 3045 3051 3054 3057 3060 3066 3069 3072 3075 3081 3084 3087 3090 3096 3099 3102 3105 3111 3114 3117 3120 3126 3129 3132 3135 3141 3144 3147 3150 3156 3159 3162 3165 3171 3174 3177 3180 3186 3189 3192 3195 3201 3204 3207 3210}} test lseq-3.36 {"in" non-numeric case} -body { if {"barney" in [lseq 15]} { set res found } else { set res not-found } set res } -cleanup { unset res } -result {not-found} test lseq-4.1 {end expressions} -body { set start 7 lseq $start $start+11 } -cleanup {unset start} -result {7 8 9 10 11 12 13 14 15 16 17 18} test lseq-4.2 {start expressions} -body { set base [clock seconds] set tl [lseq $base-60 $base 10] lmap t $tl {expr {$t - $base + 60}} } -cleanup {unset base tl t} -result {0 10 20 30 40 50 60} ## lseq 1 to 10 by -2 ## # -> lseq: invalid step = -2 with a = 1 and b = 10 test lseq-4.3 {TIP examples} -body { set examples {# Examples from TIP-629 # --- Begin --- lseq 10 .. 1 # -> 10 9 8 7 6 5 4 3 2 1 lseq 1 .. 10 # -> 1 2 3 4 5 6 7 8 9 10 lseq 10 .. 1 by 2 # -> lseq 10 .. 1 by -2 # -> 10 8 6 4 2 lseq 5.0 to 15. # -> 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 lseq 5.0 to 25. by 5 # -> 5.0 10.0 15.0 20.0 25.0 lseq 25. to 5. by 5 # -> lseq 25. to 5. by -5 # -> 25.0 20.0 15.0 10.0 5.0 lseq 1 to 10 by 2 # -> 1 3 5 7 9 lseq 25. to -25. by -5 # -> 25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0 lseq 5 5 # -> 5 lseq 5 5 2 # -> 5 lseq 5 5 -2 # -> 5 } set res {} foreach {cmd expect} [split $examples \n] { if {[string trim $cmd] ne ""} { set cmd [string trimleft $cmd] if {[string match {\#*} $cmd]} continue set status [catch $cmd ans] lappend res $ans if {[regexp {\# -> (.*)$} $expect -> expected]} { if {$expected ne $ans} { lappend res [list Mismatch: $cmd -> $ans ne $expected] } } } } set res } -cleanup { unset res cmd status ans expect expected examples } -result {{10 9 8 7 6 5 4 3 2 1} {1 2 3 4 5 6 7 8 9 10} {} {10 8 6 4 2} {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} {5.0 10.0 15.0 20.0 25.0} {} {25.0 20.0 15.0 10.0 5.0} {1 3 5 7 9} {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} 5 5 5} # # Ticket 9933cc4d88697f05976accebd31c1e3ba6efe9c6 - lseq corner case test lseq-4.4 {lseq corner case} -constraints has64BitLengths -body { set tcmd { set res {} set s [catch {lindex [lseq 10 100] 0} e] lappend res $s $e set s [catch {lindex [lseq 10 9223372036854775000] 0} e] lappend res $s $e set s [catch {llength [lseq 10 9223372036854775000]} e] lappend res $s $e set s [catch {lindex [lseq 10 2147483647] 0} e] lappend res $s $e set s [catch {llength [lseq 10 2147483647]} e] lappend res $s $e } eval $tcmd } -cleanup { unset res s e tcmd } -result {0 10 0 10 0 9223372036854774991 0 10 0 2147483638} test lseq-4.4.32 {lseq corner case} -constraints has32BitLengths -body { set tcmd { set res {} set s [catch {lindex [lseq 10 100] 0} e] lappend res $s $e set s [catch {lindex [lseq 10 9223372036854775000] 0} e] lappend res $s $e set s [catch {llength [lseq 10 9223372036854775000]} e] lappend res $s $e set s [catch {lindex [lseq 10 2147483647] 0} e] lappend res $s $e set s [catch {llength [lseq 10 2147483647]} e] lappend res $s $e } eval $tcmd } -cleanup { unset res s e tcmd } -result {0 10 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 0 10 0 2147483638} # Ticket 99e834bf33 - lseq, lindex end off by one test lseq-4.5 {lindex off by one} -body { lappend res [eval {lindex [lseq 1 4] end}] lappend res [eval {lindex [lseq 1 4] end-1}] } -cleanup { unset res } -result {4 3} # Bad refcount on ResultObj test lseq-4.6 {lindex flat} -body { set l [lseq 2 10] set cmd lindex set i 4 set c [lindex $l $i] set d [$cmd $l $i] set e [lindex [lseq 2 10] $i] set f [$cmd [lseq 2 10] $i] list $c $d $e $f } -cleanup { unset l cmd i c d e f } -result [lrepeat 4 6] test lseq-4.7 {empty list} { list [lseq 0] [join [lseq 0] {}] [join [lseq 1] {}] } {{} {} 0} test lseq-4.8 {error case lrange} -body { lrange [lseq 1 5] fred ginger } -cleanup { unset -nocomplain fred ginger } -returnCodes 1 -result {bad index "fred": must be integer?[+-]integer? or end?[+-]integer?} test lseq-4.9 {lrange empty/partial sets} -body { set res {} foreach {fred ginger} {7 8 4 9 0 15 9 9 4 2} { lappend res [lrange [lseq 1 5] $fred $ginger] } set res } -cleanup {unset res fred ginger} -result {{} 5 {1 2 3 4 5} {} {}} # Panic when using variable value? test lseq-4.10 {panic using variable index} -body { set i 0 lindex [lseq 10] $i } -cleanup {unset i} -result {0} test lseq-4.11 {bug lseq / lindex discrepancies} -body { lindex [lseq 0x7fffffff] 0x80000000 } -result {} test lseq-4.12 {bug lseq} -constraints has64BitLengths -body { llength [lseq 0x100000000] } -result {4294967296} test lseq-4.12.32 {bug lseq} -constraints has32BitLengths -body { llength [lseq 0x100000000] } -returnCodes 1 -result {max length of a Tcl list exceeded} test lseq-4.13 {bug lseq} -constraints has64BitLengths -body { set l [lseq 0x7fffffffffffffff] list \ [llength $l] \ [lindex $l end] \ [lindex $l 9223372036854775800] } -cleanup {unset l} -result {9223372036854775807 9223372036854775806 9223372036854775800} test lseq-4.14 {bug lseq - inconsistent rounding} { # using a non-integer increment, [lseq] rounding seems to be not consistent: lseq 4 40 0.1 } {4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11.0 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12.0 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13.0 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14.0 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8 14.9 15.0 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 16.0 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 17.0 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 18.0 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 19.0 19.1 19.2 19.3 19.4 19.5 19.6 19.7 19.8 19.9 20.0 20.1 20.2 20.3 20.4 20.5 20.6 20.7 20.8 20.9 21.0 21.1 21.2 21.3 21.4 21.5 21.6 21.7 21.8 21.9 22.0 22.1 22.2 22.3 22.4 22.5 22.6 22.7 22.8 22.9 23.0 23.1 23.2 23.3 23.4 23.5 23.6 23.7 23.8 23.9 24.0 24.1 24.2 24.3 24.4 24.5 24.6 24.7 24.8 24.9 25.0 25.1 25.2 25.3 25.4 25.5 25.6 25.7 25.8 25.9 26.0 26.1 26.2 26.3 26.4 26.5 26.6 26.7 26.8 26.9 27.0 27.1 27.2 27.3 27.4 27.5 27.6 27.7 27.8 27.9 28.0 28.1 28.2 28.3 28.4 28.5 28.6 28.7 28.8 28.9 29.0 29.1 29.2 29.3 29.4 29.5 29.6 29.7 29.8 29.9 30.0 30.1 30.2 30.3 30.4 30.5 30.6 30.7 30.8 30.9 31.0 31.1 31.2 31.3 31.4 31.5 31.6 31.7 31.8 31.9 32.0 32.1 32.2 32.3 32.4 32.5 32.6 32.7 32.8 32.9 33.0 33.1 33.2 33.3 33.4 33.5 33.6 33.7 33.8 33.9 34.0 34.1 34.2 34.3 34.4 34.5 34.6 34.7 34.8 34.9 35.0 35.1 35.2 35.3 35.4 35.5 35.6 35.7 35.8 35.9 36.0 36.1 36.2 36.3 36.4 36.5 36.6 36.7 36.8 36.9 37.0 37.1 37.2 37.3 37.4 37.5 37.6 37.7 37.8 37.9 38.0 38.1 38.2 38.3 38.4 38.5 38.6 38.7 38.8 38.9 39.0 39.1 39.2 39.3 39.4 39.5 39.6 39.7 39.8 39.9 40.0} test lseq-4.15 {bug lseq - inconsistent rounding} { # using a non-integer increment, [lseq] rounding seems to be not consistent: lseq 6 40 0.1 } {6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11.0 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12.0 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13.0 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14.0 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8 14.9 15.0 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 16.0 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 17.0 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 18.0 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 19.0 19.1 19.2 19.3 19.4 19.5 19.6 19.7 19.8 19.9 20.0 20.1 20.2 20.3 20.4 20.5 20.6 20.7 20.8 20.9 21.0 21.1 21.2 21.3 21.4 21.5 21.6 21.7 21.8 21.9 22.0 22.1 22.2 22.3 22.4 22.5 22.6 22.7 22.8 22.9 23.0 23.1 23.2 23.3 23.4 23.5 23.6 23.7 23.8 23.9 24.0 24.1 24.2 24.3 24.4 24.5 24.6 24.7 24.8 24.9 25.0 25.1 25.2 25.3 25.4 25.5 25.6 25.7 25.8 25.9 26.0 26.1 26.2 26.3 26.4 26.5 26.6 26.7 26.8 26.9 27.0 27.1 27.2 27.3 27.4 27.5 27.6 27.7 27.8 27.9 28.0 28.1 28.2 28.3 28.4 28.5 28.6 28.7 28.8 28.9 29.0 29.1 29.2 29.3 29.4 29.5 29.6 29.7 29.8 29.9 30.0 30.1 30.2 30.3 30.4 30.5 30.6 30.7 30.8 30.9 31.0 31.1 31.2 31.3 31.4 31.5 31.6 31.7 31.8 31.9 32.0 32.1 32.2 32.3 32.4 32.5 32.6 32.7 32.8 32.9 33.0 33.1 33.2 33.3 33.4 33.5 33.6 33.7 33.8 33.9 34.0 34.1 34.2 34.3 34.4 34.5 34.6 34.7 34.8 34.9 35.0 35.1 35.2 35.3 35.4 35.5 35.6 35.7 35.8 35.9 36.0 36.1 36.2 36.3 36.4 36.5 36.6 36.7 36.8 36.9 37.0 37.1 37.2 37.3 37.4 37.5 37.6 37.7 37.8 37.9 38.0 38.1 38.2 38.3 38.4 38.5 38.6 38.7 38.8 38.9 39.0 39.1 39.2 39.3 39.4 39.5 39.6 39.7 39.8 39.9 40.0} test lseq-4.16 {bug lseq - inconsistent rounding} { # using a non-integer increment, [lseq] rounding seems to be not consistent: set res {} lappend res [lseq 4.07 6 0.1] lappend res [lseq 4.03 4.208 0.013] } {{4.07 4.17 4.27 4.37 4.47 4.57 4.67 4.77 4.87 4.97 5.07 5.17 5.27 5.37 5.47 5.57 5.67 5.77 5.87 5.97} {4.03 4.043 4.056 4.069 4.082 4.095 4.108 4.121 4.134 4.147 4.16 4.173 4.186 4.199}} # Test abstract list in a concat # -- lseq list should not shimmer # -- lseq elements should not leak test lseq-4.17 {concat shimmer} -body { set rng [lseq 8 15 2] set pre [list A b C] set pst [list x Y z] list [concat $pre $rng $pst] \ [lindex [tcl::unsupported::representation $pre] 3] \ [lindex [tcl::unsupported::representation $rng] 3] \ [lindex [tcl::unsupported::representation $pst] 3] } -cleanup {unset rng pre pst} -result {{A b C 8 10 12 14 x Y z} list arithseries list} test lseq-4.18 {concat shimmer} -body { set rng [lseq 8 15 2] set pre [list A b C] set pst [list x Y z] list [concat $rng $pre $pst] \ [lindex [tcl::unsupported::representation $rng] 3] \ [lindex [tcl::unsupported::representation $pre] 3] \ [lindex [tcl::unsupported::representation $pst] 3] } -cleanup {unset rng pre pst} -result {{8 10 12 14 A b C x Y z} arithseries list list} # Test lseq elements as var names test lseq-4.19 {varnames} -body { set plist {} foreach v {auto_execok auto_load auto_qualify} { lappend plist proc $v [info args $v] [info body $v] } set res {} set varlist [lseq 1 to 4] foreach $varlist $plist { lappend res $2 [llength $3] } lappend res [lindex [tcl::unsupported::representation $varlist] 3] } -cleanup { unset {*}$varlist res varlist v plist } -result {auto_execok 1 auto_load 2 auto_qualify 2 arithseries} test lseq-4.20 {lindex on lseq without index args, bug a9625d1f53554f9d} -body { set res [lindex [lseq 1000]] list [llength $res] [lindex $res 0] [lindex $res end] } -cleanup { unset -nocomplain res } -result {1000 0 999} test lseq-4.21.1 {Corner cases: overflows by Inf} -body { set res {} lappend res [catch {lseq -1e5555} msg] $msg lappend res [catch {lseq 1e5555} msg] $msg lappend res [catch {lseq -Inf} msg] $msg lappend res [catch {lseq Inf} msg] $msg lappend res [catch {lseq -1e5555 0} msg] $msg lappend res [catch {lseq 0 1e5555} msg] $msg lappend res [catch {lseq -1e5555 1e5555} msg] $msg lappend res [catch {lseq -Inf -Inf} msg] $msg lappend res [catch {lseq Inf Inf} msg] $msg lappend res [catch {lseq 0 .. Inf} msg] $msg lappend res [catch {lseq -Inf .. 0} msg] $msg lappend res [catch {lseq 0 .. -Inf} msg] $msg lappend res [catch {lseq -Inf .. Inf} msg] $msg lappend res [catch {lseq Inf .. -Inf} msg] $msg } -cleanup { unset -nocomplain res } -result [list {*}{ 1 {expected integer but got "-1e5555"} 1 {expected integer but got "1e5555"} 1 {expected integer but got "-Inf"} 1 {expected integer but got "Inf"} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} }] test lseq-4.21.2 {Corner cases: expected Inf} -body { set res {} lappend res [lseq {1e5555+0} count 5] lappend res [lseq Inf count 5] lappend res [lseq Inf count 5 by 100] lappend res [lseq Inf count 5 by Inf] lappend res [lseq 5 by Inf] lappend res [lseq 0 count 5 by Inf] lappend res [lseq 5 by 1e308] lappend res [lseq 0 count 5 by 1e308] lappend res [lseq 5 by 5e307] lappend res [lseq 0 count 5 by 5e307] } -cleanup { unset -nocomplain res } -result [list {*}{ {Inf Inf Inf Inf Inf} {Inf Inf Inf Inf Inf} {Inf Inf Inf Inf Inf} {Inf Inf Inf Inf Inf} {0.0 Inf Inf Inf Inf} {0.0 Inf Inf Inf Inf} {0.0 1e+308 Inf Inf Inf} {0.0 1e+308 Inf Inf Inf} {0.0 5e+307 1e+308 1.5e+308 Inf} {0.0 5e+307 1e+308 1.5e+308 Inf} }] test lseq-4.21.3 {Corner cases: expected -Inf} -body { set res {} lappend res [lseq {-1e5555+0} count 5] lappend res [lseq -Inf count 5] lappend res [lseq -Inf count 5 by 100] lappend res [lseq -Inf count 5 by -Inf] lappend res [lseq 5 by -Inf] lappend res [lseq 0 count 5 by -Inf] lappend res [lseq 5 by -1e308] lappend res [lseq 0 count 5 by -1e308] lappend res [lseq 5 by -5e307] lappend res [lseq 0 count 5 by -5e307] } -cleanup { unset -nocomplain res } -result [list {*}{ {-Inf -Inf -Inf -Inf -Inf} {-Inf -Inf -Inf -Inf -Inf} {-Inf -Inf -Inf -Inf -Inf} {-Inf -Inf -Inf -Inf -Inf} {0.0 -Inf -Inf -Inf -Inf} {0.0 -Inf -Inf -Inf -Inf} {0.0 -1e+308 -Inf -Inf -Inf} {0.0 -1e+308 -Inf -Inf -Inf} {0.0 -5e+307 -1e+308 -1.5e+308 -Inf} {0.0 -5e+307 -1e+308 -1.5e+308 -Inf} }] test lseq-4.21.4 {Corner cases: unexpected Inf - Inf, result to +/-NaN, unexpected NaN} -body { set res {} lappend res [list [catch {lseq Inf count 5 by -Inf} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq -Inf count 5 by Inf} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq {Inf - Inf} count 5} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq NaN count 5} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq NaN count 5 by 100} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq NaN count 5 by NaN} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq 5 by NaN} msg opt] $msg [dict getd $opt -errorcode ""]] lappend res [list [catch {lseq 0 count 5 by NaN} msg opt] $msg [dict getd $opt -errorcode ""]] join $res \n } -cleanup { unset -nocomplain res msg opt } -result [join [lrepeat 8 {1 {domain error: argument not in valid range} {ARITH DOMAIN {domain error: argument not in valid range}}}] \n] test lseq-4.21.5 {Corner cases: unexpected NaN} -body { set res {} lappend res [catch {lseq NaN} msg] $msg lappend res [catch {lseq 0 .. NaN} msg] $msg } -cleanup { unset -nocomplain res msg } -result {1 {expected integer but got "NaN"} 1 {cannot use non-numeric floating-point value "NaN" to estimate length of arith-series}} test lseq-4.21.6 {Corner cases: empty list, reversed step} -body { set res {} lappend res [lseq -5 .. 0 by -1] lappend res [lseq 5 .. 0 by 1] lappend res [lseq 0 .. 5 by -1] lappend res [lseq 0 .. -5 by 1] } -cleanup { unset -nocomplain res } -result {{} {} {} {}} test lseq-4.21.6-lran {Corner cases: lrange empty list, reversed step} -body { set res {} # not shared: lappend res [lrange [lseq -5 .. 0 by -1] 1 end-1] lappend res [lrange [lseq 5 .. 0 by 1] 1 end-1] lappend res [lrange [lseq 0 .. 5 by -1] 1 end-1] lappend res [lrange [lseq 0 .. -5 by 1] 1 end-1] # shared: lappend res [lrange [set l [lseq -5 .. 0 by -1]] 1 end-1] lappend res [lrange [set l [lseq 5 .. 0 by 1]] 1 end-1] lappend res [lrange [set l [lseq 0 .. 5 by -1]] 1 end-1] lappend res [lrange [set l [lseq 0 .. -5 by 1]] 1 end-1] } -cleanup { unset -nocomplain res l } -result {{} {} {} {} {} {} {} {}} test lseq-4.21.6-lrev {Corner cases: lreverse empty list, reversed step} -body { set res {} # not shared: lappend res [lreverse [lseq -5 .. 0 by -1]] lappend res [lreverse [lseq 5 .. 0 by 1]] lappend res [lreverse [lseq 0 .. 5 by -1]] lappend res [lreverse [lseq 0 .. -5 by 1]] # shared: lappend res [lreverse [set l [lseq -5 .. 0 by -1]]] lappend res [lreverse [set l [lseq 5 .. 0 by 1]]] lappend res [lreverse [set l [lseq 0 .. 5 by -1]]] lappend res [lreverse [set l [lseq 0 .. -5 by 1]]] } -cleanup { unset -nocomplain res l } -result {{} {} {} {} {} {} {} {}} test lseq-4.21.7 {Corner cases: non-empty list, normal step} -body { set res {} lappend res [lseq -5 .. 0 ] lappend res [lseq 5 .. 0 by -1] lappend res [lseq 0 .. 5 ] lappend res [lseq 0 .. -5 by -1] } -cleanup { unset -nocomplain res } -result [list {*}{ {-5 -4 -3 -2 -1 0} {5 4 3 2 1 0} {0 1 2 3 4 5} {0 -1 -2 -3 -4 -5} }] test lseq-4.21.7-lran {Corner cases: lrange non-empty list, normal step} -body { set res {} # not shared: lappend res [lrange [lseq -5 .. 0 ] 1 end-1] lappend res [lrange [lseq 5 .. 0 by -1] 1 end-1] lappend res [lrange [lseq 0 .. 5 ] 1 end-1] lappend res [lrange [lseq 0 .. -5 by -1] 1 end-1] # shared: lappend res [lrange [set l [lseq -5 .. 0 ]] 1 end-1] lappend res [lrange [set l [lseq 5 .. 0 by -1]] 1 end-1] lappend res [lrange [set l [lseq 0 .. 5 ]] 1 end-1] lappend res [lrange [set l [lseq 0 .. -5 by -1]] 1 end-1] } -cleanup { unset -nocomplain res l } -result [lrepeat 2 {*}{ {-4 -3 -2 -1} {4 3 2 1} {1 2 3 4} {-1 -2 -3 -4} }] test lseq-4.21.7-lrev {Corner cases: lreverse non-empty list, normal step} -body { set res {} # not shared: lappend res [lreverse [lseq -5 .. 0 ]] lappend res [lreverse [lseq 5 .. 0 by -1]] lappend res [lreverse [lseq 0 .. 5 ]] lappend res [lreverse [lseq 0 .. -5 by -1]] # shared: lappend res [lreverse [set l [lseq -5 .. 0 ]]] lappend res [lreverse [set l [lseq 5 .. 0 by -1]]] lappend res [lreverse [set l [lseq 0 .. 5 ]]] lappend res [lreverse [set l [lseq 0 .. -5 by -1]]] } -cleanup { unset -nocomplain res l } -result [lrepeat 2 {*}{ {0 -1 -2 -3 -4 -5} {0 1 2 3 4 5} {5 4 3 2 1 0} {-5 -4 -3 -2 -1 0} }] test lseq-convertToList {does not result in a memory error} -body { trace add variable var1 write [list ::apply [list args { error {this is an error} } [namespace current]]] list [catch {set var1 [lindex [lreplace [lseq 1 2] 1 1 hello] 0]} cres] $cres } -cleanup {unset var1 cres} -result {1 {can't set "var1": this is an error}} test lseq-bug-54329e39c7 {does not cause memory bloat} -constraints { hasMemUsage } -body { set l [lseq 1000000] proc p l {foreach x $l {}} set premem [memusage] p $l set postmem [memusage] expr {[tcl::build-info purify] || ($postmem - $premem < 10) ? 1 : ($postmem - $premem)} } -result 1 test lseq-bug-578b7e273c03-1 {Arithmetic Series Objects get wrong precision when end value is not specified} -body { set bl [expr {2.8 in [lseq 0 count 100 by .1]}] lappend bl [expr {2.8 in [lseq 0 count 200 by .1]}] lappend bl [expr {0.28 in [lseq 0 count 100 by .01]}] lappend bl [expr {0.28 in [lseq 0 count 200 by .01]}] lappend bl [expr {0.286 in [lseq 0 count 100 by .011]}] lappend bl [expr {0.286 in [lseq 0 count 200 by .011]}] } -result {1 1 1 1 1 1} test lseq-bug-578b7e273c03-2 {Arithmetic Series Objects get wrong precision when end value is not specified} -body { set ll [llength [lseq 0 count 100 by .1]] lappend ll [llength [lseq 0 count 200 by .1]] lappend ll [llength [lseq 0 count 100 by .01]] lappend ll [llength [lseq 0 count 200 by .01]] lappend ll [llength [lseq 0 count 100 by .011]] lappend ll [llength [lseq 0 count 200 by .011]] } -result {100 200 100 200 100 200} test lseq-bug-f4a4bd7f1070-1 {} -body { set result {} lappend result [catch {lseq 3.1} msg] lappend result $msg lappend result [catch {lseq 5 count 3.0} msg] lappend result $msg lappend result [lseq 3] lappend result [lseq 3.0] lappend result [lseq 5.1e1] lappend result [string compare [lseq 3] [lseq 3.0]] set result } -result {1 {expected integer but got "3.1"} 0 {5 6 7} {0 1 2} {0 1 2} {0 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} 0} test lseq-bug-7d3101bf28-0 {Bug 7d3101bf28 - crash on negative index} -body { list \ [try [list lindex [lseq 10] -1]] \ [eval [list lindex [lseq 10] -1]] } -result {{} {}} test lseq-bug-7d3101bf28-1 {Bug 7d3101bf28 - crash on out of bounds index} -body { list \ [try [list lindex [lseq 10] 10]] \ [eval [list lindex [lseq 10] 10]] } -result {{} {}} test lseq-bug-7d3101bf28-2 {Bug 7d3101bf28 - crash on error in index syntax} -body { list \ [try [list lindex [lseq 10] foo]] \ [eval [list lindex [lseq 10] foo]] } -result {bad index "foo": must be integer?[+-]integer? or end?[+-]integer?} -returnCodes error test lseq-bug-452b103a74-0 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] 0 1 } -result {} test lseq-bug-452b103a74-1 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] 0 end } -result 0 test lseq-bug-452b103a74-2 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] {0 1} } -result {} test lseq-bug-452b103a74-3 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] {0 end} } -result 0 test lseq-bug-452b103a74-4 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] 1 0 } -result 1 test lseq-bug-452b103a74-5 {Bug 452b103a74 - crash on nested indices} -body { lindex [lseq 10] {end 0} } -result 9 test lseq-bug-0ee626dfb2-0 {Bug 0ee626dfb2 - integer overflow} -body { lseq 0x7fffffffffffffff count 2 } -result {invalid arithmetic series parameter values} -returnCodes error test lseq-bug-0ee626dfb2-1 {Bug 0ee626dfb2 - integer overflow} -body { lseq 0x7fffffffffffffff count 3 by -0x8000000000000000 } -result {invalid arithmetic series parameter values} -returnCodes error # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/lsearch.test0000644000175000017500000006356415104661341015251 0ustar sergeisergei# Commands covered: lsearch # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } set x {abcd bbcd 123 234 345} test lsearch-1.1 {lsearch command} { lsearch $x 123 } 2 test lsearch-1.2 {lsearch command} { lsearch $x 3456 } -1 test lsearch-1.3 {lsearch command} { lsearch $x *5 } 4 test lsearch-1.4 {lsearch command} { lsearch $x *bc* } 0 test lsearch-2.1 {search modes} { lsearch -exact {xyz bbcc *bc*} *bc* } 2 test lsearch-2.2 {search modes} { lsearch -exact {b.x ^bc xy bcx} ^bc } 1 test lsearch-2.3 {search modes} { lsearch -exact {foo bar cat} ba } -1 test lsearch-2.4 {search modes} { lsearch -exact {foo bar cat} bart } -1 test lsearch-2.5 {search modes} { lsearch -exact {foo bar cat} bar } 1 test lsearch-2.6 {search modes} -returnCodes error -body { lsearch -regexp {xyz bbcc *bc*} *bc* } -result {cannot compile regular expression pattern: invalid quantifier operand} test lsearch-2.7 {search modes} { lsearch -regexp {b.x ^bc xy bcx} ^bc } 3 test lsearch-2.8 {search modes} { lsearch -glob {xyz bbcc *bc*} *bc* } 1 test lsearch-2.9 {search modes} { lsearch -glob {b.x ^bc xy bcx} ^bc } 1 test lsearch-2.10 {search modes} -returnCodes error -body { lsearch -glib {b.x bx xy bcx} b.x } -result {bad option "-glib": must be -all, -ascii, -bisect, -decreasing, -dictionary, -exact, -glob, -increasing, -index, -inline, -integer, -nocase, -not, -real, -regexp, -sorted, -start, -stride, or -subindices} test lsearch-2.11 {search modes with -nocase} { lsearch -exact -nocase {a b c A B C} A } 0 test lsearch-2.12 {search modes with -nocase} { lsearch -glob -nocase {a b c A B C} A* } 0 test lsearch-2.13 {search modes with -nocase} { lsearch -regexp -nocase {a b c A B C} ^A\$ } 0 test lsearch-2.14 {search modes without -nocase} { lsearch -exact {a b c A B C} A } 3 test lsearch-2.15 {search modes without -nocase} { lsearch -glob {a b c A B C} A* } 3 test lsearch-2.16 {search modes without -nocase} { lsearch -regexp {a b c A B C} ^A\$ } 3 test lsearch-3.1 {lsearch errors} -returnCodes error -body { lsearch } -result {wrong # args: should be "lsearch ?-option value ...? list pattern"} test lsearch-3.2 {lsearch errors} -returnCodes error -body { lsearch a } -result {wrong # args: should be "lsearch ?-option value ...? list pattern"} test lsearch-3.3 {lsearch errors} -returnCodes error -body { lsearch a b c } -result {bad option "a": must be -all, -ascii, -bisect, -decreasing, -dictionary, -exact, -glob, -increasing, -index, -inline, -integer, -nocase, -not, -real, -regexp, -sorted, -start, -stride, or -subindices} test lsearch-3.4 {lsearch errors} -returnCodes error -body { lsearch a b c d } -result {bad option "a": must be -all, -ascii, -bisect, -decreasing, -dictionary, -exact, -glob, -increasing, -index, -inline, -integer, -nocase, -not, -real, -regexp, -sorted, -start, -stride, or -subindices} test lsearch-3.5 {lsearch errors} -returnCodes error -body { lsearch "\{" b } -result {unmatched open brace in list} test lsearch-3.6 {lsearch errors} -returnCodes error -body { lsearch -index a b } -result {"-index" option must be followed by list index} test lsearch-3.7 {lsearch errors} -returnCodes error -body { lsearch -subindices -exact a b } -result {-subindices cannot be used without -index option} test lsearch-4.1 {binary data} { lsearch -exact [list foo one\x00two bar] bar } 2 test lsearch-4.2 {binary data} { set x one append x \x00 append x two lsearch -exact [list foo one\x00two bar] $x } 1 # Make a sorted list set l {} set l2 {} for {set i 0} {$i < 100} {incr i} { lappend l $i lappend l2 [expr {double($i)/2}] } set increasingIntegers [lsort -integer $l] set decreasingIntegers [lsort -decreasing -integer $l] set increasingDoubles [lsort -real $l2] set decreasingDoubles [lsort -decreasing -real $l2] set increasingStrings [lsort {48 6a 18b 22a 21aa 35 36}] set decreasingStrings [lsort -decreasing {48 6a 18b 22a 21aa 35 36}] set increasingDictionary [lsort -dictionary {48 6a 18b 22a 21aa 35 36}] set decreasingDictionary [lsort -dictionary -decreasing $increasingDictionary] set l {} for {set i 0} {$i < 10} {incr i} { lappend l $i $i $i $i $i } set repeatingIncreasingIntegers [lsort -integer $l] set repeatingDecreasingIntegers [lsort -integer -decreasing $l] test lsearch-5.1 {binary search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -integer -sorted $increasingIntegers $i] } set res } $increasingIntegers test lsearch-5.2 {binary search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -integer -decreasing -sorted \ $decreasingIntegers $i] } set res } $decreasingIntegers test lsearch-5.3 {binary search finds leftmost occurrences} { set res {} for {set i 0} {$i < 10} {incr i} { lappend res [lsearch -integer -sorted $repeatingIncreasingIntegers $i] } set res } [list 0 5 10 15 20 25 30 35 40 45] test lsearch-5.4 {binary search -decreasing finds leftmost occurrences} { set res {} for {set i 9} {$i >= 0} {incr i -1} { lappend res [lsearch -sorted -integer -decreasing \ $repeatingDecreasingIntegers $i] } set res } [list 0 5 10 15 20 25 30 35 40 45] test lsearch-6.1 {integer search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -exact -integer $increasingIntegers $i] } set res } [lrange $increasingIntegers 0 99] test lsearch-6.2 {decreasing integer search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -exact -integer -decreasing \ $decreasingIntegers $i] } set res } [lrange $decreasingIntegers 0 99] test lsearch-6.3 {sorted integer search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -sorted -integer $increasingIntegers $i] } set res } [lrange $increasingIntegers 0 99] test lsearch-6.4 {sorted decreasing integer search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -integer -sorted -decreasing \ $decreasingIntegers $i] } set res } [lrange $decreasingIntegers 0 99] test lsearch-7.1 {double search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -exact -real $increasingDoubles \ [expr {double($i)/2}]] } set res } [lrange $increasingIntegers 0 99] test lsearch-7.2 {decreasing double search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -exact -real -decreasing \ $decreasingDoubles [expr {double($i)/2}]] } set res } [lrange $decreasingIntegers 0 99] test lsearch-7.3 {sorted double search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -sorted -real \ $increasingDoubles [expr {double($i)/2}]] } set res } [lrange $increasingIntegers 0 99] test lsearch-7.4 {sorted decreasing double search} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -sorted -real -decreasing \ $decreasingDoubles [expr {double($i)/2}]] } set res } [lrange $decreasingIntegers 0 99] test lsearch-8.1 {dictionary search} { set res {} foreach val {6a 18b 21aa 22a 35 36 48} { lappend res [lsearch -exact -dictionary $increasingDictionary $val] } set res } [list 0 1 2 3 4 5 6] test lsearch-8.2 {decreasing dictionary search} { set res {} foreach val {6a 18b 21aa 22a 35 36 48} { lappend res [lsearch -exact -dictionary $decreasingDictionary $val] } set res } [list 6 5 4 3 2 1 0] test lsearch-8.3 {sorted dictionary search} { set res {} foreach val {6a 18b 21aa 22a 35 36 48} { lappend res [lsearch -sorted -dictionary $increasingDictionary $val] } set res } [list 0 1 2 3 4 5 6] test lsearch-8.4 {decreasing sorted dictionary search} { set res {} foreach val {6a 18b 21aa 22a 35 36 48} { lappend res [lsearch -decreasing -sorted -dictionary \ $decreasingDictionary $val] } set res } [list 6 5 4 3 2 1 0] test lsearch-9.1 {ascii search} { set res {} foreach val {18b 21aa 22a 35 36 48 6a} { lappend res [lsearch -exact -ascii $increasingStrings $val] } set res } [list 0 1 2 3 4 5 6] test lsearch-9.2 {decreasing ascii search} { set res {} foreach val {18b 21aa 22a 35 36 48 6a} { lappend res [lsearch -exact -ascii $decreasingStrings $val] } set res } [list 6 5 4 3 2 1 0] test lsearch-9.3 {sorted ascii search} { set res {} foreach val {18b 21aa 22a 35 36 48 6a} { lappend res [lsearch -sorted -ascii $increasingStrings $val] } set res } [list 0 1 2 3 4 5 6] test lsearch-9.4 {decreasing sorted ascii search} { set res {} foreach val {18b 21aa 22a 35 36 48 6a} { lappend res [lsearch -decreasing -sorted -ascii \ $decreasingStrings $val] } set res } [list 6 5 4 3 2 1 0] test lsearch-10.1 {offset searching} { lsearch -start 2 {a b c a b c} a } 3 test lsearch-10.2 {offset searching} { lsearch -start 2 {a b c d e f} a } -1 test lsearch-10.3 {offset searching} { lsearch -start end-4 {a b c a b c} a } 3 test lsearch-10.4 {offset searching} -returnCodes error -body { lsearch -start foobar {a b c a b c} a } -result {bad index "foobar": must be integer?[+-]integer? or end?[+-]integer?} test lsearch-10.5 {offset searching} -returnCodes error -body { lsearch -start 1 2 } -result {missing starting index} test lsearch-10.6 {binary search with offset} { set res {} for {set i 0} {$i < 100} {incr i} { lappend res [lsearch -integer -start 2 -sorted $increasingIntegers $i] } set res } [concat -1 -1 [lrange $increasingIntegers 2 end]] test lsearch-10.7 {offset searching with an empty list} { # Stop bug #694232 from reocurring lsearch -start 0 {} x } -1 test lsearch-10.8 {offset searching past the end of the list} { # Stop [Bug 1374778] from reoccurring lsearch -start 10 {a b c} c } -1 test lsearch-10.9 {offset searching past the end of the list} { # Stop [Bug 1374778] from reoccurring lsearch -start 10 -all {a b c} c } {} test lsearch-10.10 {offset searching past the end of the list} { # Stop [Bug 1374778] from reoccurring lsearch -start 10 -inline {a b c} c } {} test lsearch-11.1 {negated searches} { lsearch -not {a a a b a a a} a } 3 test lsearch-11.2 {negated searches} { lsearch -not {a a a a a a a} a } -1 test lsearch-12.1 {return values instead of indices} { lsearch -glob -inline {a1 b2 c3 d4} c* } c3 test lsearch-12.2 {return values instead of indices} { lsearch -glob -inline {a1 b2 c3 d4} e* } {} test lsearch-13.1 {search for all matches} { lsearch -all {a b a c a d} 1 } {} test lsearch-13.2 {search for all matches} { lsearch -all {a b a c a d} a } {0 2 4} test lsearch-13.3 {search for all matches with -nocase} { lsearch -all -exact -nocase {a b c A B C} A } {0 3} test lsearch-13.4 {search for all matches with -nocase} { lsearch -all -glob -nocase {a b c A B C} A* } {0 3} test lsearch-13.5 {search for all matches with -nocase} { lsearch -all -regexp -nocase {a b c A B C} ^A\$ } {0 3} test lsearch-14.1 {combinations: -all and -inline} { lsearch -all -inline -glob {a1 b2 a3 c4 a5 d6} a* } {a1 a3 a5} test lsearch-14.2 {combinations: -all, -inline and -not} { lsearch -all -inline -not -glob {a1 b2 a3 c4 a5 d6} a* } {b2 c4 d6} test lsearch-14.3 {combinations: -all and -not} { lsearch -all -not -glob {a1 b2 a3 c4 a5 d6} a* } {1 3 5} test lsearch-14.4 {combinations: -inline and -not} { lsearch -inline -not -glob {a1 b2 a3 c4 a5 d6} a* } {b2} test lsearch-14.5 {combinations: -start, -all and -inline} { lsearch -start 2 -all -inline -glob {a1 b2 a3 c4 a5 d6} a* } {a3 a5} test lsearch-14.6 {combinations: -start, -all, -inline and -not} { lsearch -start 2 -all -inline -not -glob {a1 b2 a3 c4 a5 d6} a* } {c4 d6} test lsearch-14.7 {combinations: -start, -all and -not} { lsearch -start 2 -all -not -glob {a1 b2 a3 c4 a5 d6} a* } {3 5} test lsearch-14.8 {combinations: -start, -inline and -not} { lsearch -start 2 -inline -not -glob {a1 b2 a3 c4 a5 d6} a* } {c4} test lsearch-15.1 {make sure no shimmering occurs} { set x [expr {int(sin(0))}] lsearch -start $x $x $x } 0 test lsearch-16.1 {lsearch -regexp shared object} { set str a lsearch -regexp $str $str } 0 # Bug 1366683 test lsearch-16.2 {lsearch -regexp allows internal backrefs} { lsearch -regexp {a aa b} {(.)\1} } 1 test lsearch-17.1 {lsearch -index option, basic functionality} { lsearch -index 1 {{a c} {a b} {a a}} a } 2 test lsearch-17.2 {lsearch -index option, basic functionality} { lsearch -index 1 -exact {{a c} {a b} {a a}} a } 2 test lsearch-17.3 {lsearch -index option, basic functionality} { lsearch -index 1 -glob {{ab cb} {ab bb} {ab ab}} b* } 1 test lsearch-17.4 {lsearch -index option, basic functionality} { lsearch -index 1 -regexp {{ab cb} {ab bb} {ab ab}} {[cb]b} } 0 test lsearch-17.5 {lsearch -index option, basic functionality} { lsearch -all -index 0 -exact {{a c} {a b} {d a}} a } {0 1} test lsearch-17.6 {lsearch -index option, basic functionality} { lsearch -all -index 1 -glob {{ab cb} {ab bb} {db bx}} b* } {1 2} test lsearch-17.7 {lsearch -index option, basic functionality} { lsearch -all -index 1 -regexp {{ab cb} {ab bb} {ab ab}} {[cb]b} } {0 1} test lsearch-17.8 {lsearch -index option, empty argument} { lsearch -index {} a a } 0 test lsearch-17.9 {lsearch -index option, empty argument} { lsearch -index {} a a } [lsearch a a] test lsearch-17.10 {lsearch -index option, empty argument} { lsearch -index {} [list \{] \{ } 0 test lsearch-17.11 {lsearch -index option, empty argument} { lsearch -index {} [list \{] \{ } [lsearch [list \{] \{] test lsearch-17.12 {lsearch -index option, encoding aliasing} -body { lsearch -index -2 a a } -returnCodes error -result {index "-2" out of range} test lsearch-17.13 {lsearch -index option, encoding aliasing} -body { lsearch -index -1-1 a a } -returnCodes error -result {index "-1-1" out of range} test lsearch-17.14 {lsearch -index option, encoding aliasing} -body { lsearch -index end--1 a a } -returnCodes error -result {index "end--1" out of range} test lsearch-17.15 {lsearch -index option, encoding aliasing} -body { lsearch -index end+1 a a } -returnCodes error -result {index "end+1" out of range} test lsearch-17.16 {lsearch -index option, encoding aliasing} -body { lsearch -index end+2 a a } -returnCodes error -result {index "end+2" out of range} test lsearch-18.1 {lsearch -index option, list as index basic functionality} { lsearch -index {0 0} {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } 1 test lsearch-18.2 {lsearch -index option, list as index basic functionality} { lsearch -index {2 0} -exact {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } 0 test lsearch-18.3 {lsearch -index option, list as index basic functionality} { lsearch -index {1 1} -glob {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} b* } 0 test lsearch-18.4 {lsearch -index option, list as index basic functionality} { lsearch -index {0 1} -regexp {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} {[cb]b} } 0 test lsearch-18.5 {lsearch -index option, list as index basic functionality} { lsearch -all -index {0 0} -exact {{{a c} {a b} {d a}} {{a c} {a b} {d a}}} a } {0 1} test lsearch-19.1 {lsearch -subindices option} { lsearch -subindices -index {0 0} {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } {1 0 0} test lsearch-19.2 {lsearch -subindices option} { lsearch -subindices -index {2 0} -exact {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } {0 2 0} test lsearch-19.3 {lsearch -subindices option} { lsearch -subindices -index {1 1} -glob {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} b* } {0 1 1} test lsearch-19.4 {lsearch -subindices option} { lsearch -subindices -index {0 1} -regexp {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} {[cb]b} } {0 0 1} test lsearch-19.5 {lsearch -subindices option} { lsearch -subindices -all -index {0 0} -exact {{{a c} {a b} {d a}} {{a c} {a b} {d a}}} a } {{0 0 0} {1 0 0}} test lsearch-19.6 {lsearch -subindices option} { lsearch -subindices -all -index {1 0} -exact {{{a c} {a b} {d a}} {{a c} {a b} {d a}}} a } {{0 1 0} {1 1 0}} test lsearch-19.7 {lsearch -subindices option} { lsearch -subindices -index end {{1 a}} a } {0 1} test lsearch-19.8 {lsearch -subindices option} { lsearch -subindices -all -index end {{1 a}} a } {{0 1}} test lsearch-20.1 {lsearch -index option, index larger than sublists} -body { lsearch -index 2 {{a c} {a b} {a a}} a } -returnCodes error -result {element 2 missing from sublist "a c"} test lsearch-20.2 {lsearch -index option, malformed index} -body { lsearch -index foo {{a c} {a b} {a a}} a } -returnCodes error -result {bad index "foo": must be integer?[+-]integer? or end?[+-]integer?} test lsearch-20.3 {lsearch -index option, malformed index} -body { lsearch -index \{ {{a c} {a b} {a a}} a } -returnCodes error -result {unmatched open brace in list} test lsearch-21.1 {lsearch shimmering crash} { set x 0 lsearch -exact -integer $x $x } 0 test lsearch-21.2 {lsearch shimmering crash} { set x 0.5 lsearch -exact -real $x $x } 0 test lsearch-22.1 {lsearch -bisect} -setup { set res {} } -body { foreach i {0 1 5 6 7 8 15 16} { lappend res [lsearch -bisect -integer {1 4 5 7 9 15} $i] } return $res } -result {-1 0 2 2 3 3 5 5} test lsearch-22.2 {lsearch -bisect, last of equals} -setup { set res {} } -body { foreach i {0 1 2 3} { lappend res [lsearch -bisect -integer {0 0 1 1 1 2 2 2 3 3 3} $i] } return $res } -result {1 4 7 10} test lsearch-22.3 {lsearch -bisect decreasing order} -setup { set res {} } -body { foreach i {0 1 5 6 7 8 15 16} { lappend res [lsearch -bisect -integer -decreasing {15 9 7 5 4 1} $i] } return $res } -result {5 5 3 2 2 1 0 -1} test lsearch-22.4 {lsearch -bisect, last of equals, decreasing} -setup { set res {} } -body { foreach i {0 1 2 3} { lappend res [lsearch -bisect -integer -decreasing \ {3 3 3 2 2 2 1 1 1 0 0} $i] } return $res } -result {10 8 5 2} test lsearch-22.5 {lsearch -bisect, all equal} { lsearch -bisect -integer {5 5 5 5} 5 } {3} test lsearch-22.6 {lsearch -sorted, all equal} { lsearch -sorted -integer {5 5 5 5} 5 } {0} test lsearch-23.1 {lsearch -stride option, errors} -body { lsearch -stride {a b} a } -returnCodes error -result {"-stride" option must be followed by stride length} test lsearch-23.2 {lsearch -stride option, errors} -body { lsearch -stride 0 {a b} a } -returnCodes error -result {stride length must be at least 1} test lsearch-23.3 {lsearch -stride option, errors} -body { lsearch -stride 2 {a b c} a } -returnCodes error -result {list size must be a multiple of the stride length} test lsearch-23.4 {lsearch -stride option, errors} -body { lsearch -stride 5 {a b c} a } -returnCodes error -result {list size must be a multiple of the stride length} test lsearch-23.5 {lsearch -stride option, errors} -body { # Stride equal to length is ok lsearch -stride 3 {a b c} a } -result 0 test lsearch-24.1 {lsearch -stride option} -body { lsearch -stride 2 {a b c d e f g h} d } -result -1 test lsearch-24.2 {lsearch -stride option} -body { lsearch -stride 2 {a b c d e f g h} e } -result 4 test lsearch-24.3 {lsearch -stride option} -body { lsearch -stride 3 {a b c d e f g h i} e } -result -1 test lsearch-24.4 {lsearch -stride option} -body { # Result points first in group lsearch -stride 3 -index 1 {a b c d e f g h i} e } -result 3 test lsearch-24.5 {lsearch -stride option} -body { lsearch -inline -stride 2 {a b c d e f g h} d } -result {} test lsearch-24.6 {lsearch -stride option} -body { # Inline result is a "single element" strided list lsearch -inline -stride 2 {a b c d e f g h} e } -result "e f" test lsearch-24.7 {lsearch -stride option} -body { lsearch -inline -stride 3 {a b c d e f g h i} e } -result {} test lsearch-24.8 {lsearch -stride option} -body { lsearch -inline -stride 3 -index 1 {a b c d e f g h i} e } -result "d e f" test lsearch-24.9 {lsearch -stride option} -body { lsearch -all -inline -stride 3 -index 1 {a b c d e f g e i} e } -result "d e f g e i" test lsearch-24.10 {lsearch -stride option} -body { lsearch -all -inline -stride 3 -index 0 {a b c d e f a e i} a } -result "a b c a e i" test lsearch-24.11 {lsearch -stride option} -body { # Stride 1 is same as no stride lsearch -stride 1 {a b c d e f g h} d } -result 3 # 25* mimics 19* but with -inline added to -subindices test lsearch-25.1 {lsearch -subindices option} { lsearch -inline -subindices -index {0 0} {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } {a} test lsearch-25.2 {lsearch -subindices option} { lsearch -inline -subindices -index {2 0} -exact {{{x x} {x b} {a d}} {{a c} {a b} {a a}}} a } {a} test lsearch-25.3 {lsearch -subindices option} { lsearch -inline -subindices -index {1 1} -glob {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} b* } {bb} test lsearch-25.4 {lsearch -subindices option} { lsearch -inline -subindices -index {0 1} -regexp {{{ab cb} {ab bb} {ab ab}} {{ab cb} {ab bb} {ab ab}}} {[cb]b} } {cb} test lsearch-25.5 {lsearch -subindices option} { lsearch -inline -subindices -all -index {0 0} -exact {{{a c} {a b} {d a}} {{a c} {a b} {d a}}} a } {a a} test lsearch-25.6 {lsearch -subindices option} { lsearch -inline -subindices -all -index {1 0} -exact {{{a c} {a b} {d a}} {{a c} {a b} {d a}}} a } {a a} # 26* mimics 19* but with -stride added test lsearch-26.1 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -index {0 0} {{x x} {x b} {a d} {a c} {a b} {a a}} a } {3 0} test lsearch-26.2 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -index {2 0} -exact {{x x} {x b} {a d} {a c} {a b} {a a}} a } {2 0} test lsearch-26.3 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -index {1 1} -glob {{ab cb} {ab bb} {ab ab} {ab cb} {ab bb} {ab ab}} b* } {1 1} test lsearch-26.4 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -index {0 1} -regexp {{ab cb} {ab bb} {ab ab} {ab cb} {ab bb} {ab ab}} {[cb]b} } {0 1} test lsearch-26.5 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -all -index {0 0} -exact {{a c} {a b} {d a} {a c} {a b} {d a}} a } {{0 0} {3 0}} test lsearch-26.6 {lsearch -stride + -subindices option} { lsearch -stride 3 -subindices -all -index {1 0} -exact {{a c} {a b} {d a} {x c} {a b} {d a}} a } {{1 0} {4 0}} # 27* mimics 25* but with -stride added test lsearch-27.1 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -index {0 0} {{x x} {x b} {a d} {a c} {a b} {a a}} a } {a} test lsearch-27.2 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -index {2 0} -exact {{x x} {x b} {a d} {a c} {a b} {a a}} a } {a} test lsearch-27.3 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -index {1 1} -glob {{ab cb} {ab bb} {ab ab} {ab cb} {ab bb} {ab ab}} b* } {bb} test lsearch-27.4 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -index {0 1} -regexp {{ab cb} {ab bb} {ab ab} {ab cb} {ab bb} {ab ab}} {[cb]b} } {cb} test lsearch-27.5 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -all -index {0 0} -exact {{a c} {a b} {d a} {a c} {a b} {d a}} a } {a a} test lsearch-27.6 {lsearch -stride + -subindices option} { lsearch -inline -stride 3 -subindices -all -index {1 0} -exact {{a c} {a b} {d a} {x c} {a b} {d a}} a } {a a} test lsearch-27.7 {lsearch -stride + -subindices option single index} { lsearch -inline -stride 3 -subindices -all -index 1 {{x a} {y b} {x c} {xx a} {xx b} {xx c} {xxx a} {y b} {xxx c}} {y b} } {{y b} {y b}} test lsearch-27.8 {lsearch -stride + -subindices option single index} { lsearch -inline -stride 3 -subindices -all -index end {{x a} {y b} {xc} {xx a} {xx b} {xx c} {xxx a} {y b} {}} * } {xc {xx c} {}} test lsearch-28.1 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 5 } -result 0 test lsearch-28.2 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 3 } -result -1 test lsearch-28.3 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 7 } -result 2 test lsearch-28.4 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 8 } -result -1 test lsearch-28.5 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 9 } -result 4 test lsearch-28.6 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 {5 3 7 8 9 2} 2 } -result -1 test lsearch-28.7 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 -index 0 -subindices {5 3 7 8 9 2} 9 } -result 4 test lsearch-28.8 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 -index 1 -subindices {3 5 8 7 2 9} 9 } -result 5 test lsearch-28.9 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 2 -index 1 -subindices -inline {3 5 8 7 2 9} 9 } -result 9 test lsearch-28.10 {lsearch -sorted with -stride} -body { lsearch -sorted -stride 4294967296 -index 1 -subindices -inline {3 5 8 7 2 9} 9 } -returnCodes 1 -result {list size must be a multiple of the stride length} # cleanup catch {unset res} catch {unset increasingIntegers} catch {unset decreasingIntegers} catch {unset increasingDoubles} catch {unset decreasingDoubles} catch {unset increasingStrings} catch {unset decreasingStrings} catch {unset increasingDictionary} catch {unset decreasingDictionary} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/lreplace.test0000644000175000017500000004033515104661341015406 0ustar sergeisergei# Commands covered: lreplace # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test lreplace-1.1 {lreplace command} { lreplace {1 2 3 4 5} 0 0 a } {a 2 3 4 5} test lreplace-1.2 {lreplace command} { lreplace {1 2 3 4 5} 1 1 a } {1 a 3 4 5} test lreplace-1.3 {lreplace command} { lreplace {1 2 3 4 5} 2 2 a } {1 2 a 4 5} test lreplace-1.4 {lreplace command} { lreplace {1 2 3 4 5} 3 3 a } {1 2 3 a 5} test lreplace-1.5 {lreplace command} { lreplace {1 2 3 4 5} 4 4 a } {1 2 3 4 a} test lreplace-1.6 {lreplace command} { lreplace {1 2 3 4 5} 4 5 a } {1 2 3 4 a} test lreplace-1.7 {lreplace command} { lreplace {1 2 3 4 5} -1 -1 a } {a 1 2 3 4 5} test lreplace-1.8 {lreplace command} { lreplace {1 2 3 4 5} 2 end a b c d } {1 2 a b c d} test lreplace-1.9 {lreplace command} { lreplace {1 2 3 4 5} 0 3 } {5} test lreplace-1.10 {lreplace command} { lreplace {1 2 3 4 5} 0 4 } {} test lreplace-1.11 {lreplace command} { lreplace {1 2 3 4 5} 0 1 } {3 4 5} test lreplace-1.12 {lreplace command} { lreplace {1 2 3 4 5} 2 3 } {1 2 5} test lreplace-1.13 {lreplace command} { lreplace {1 2 3 4 5} 3 end } {1 2 3} test lreplace-1.14 {lreplace command} { lreplace {1 2 3 4 5} -1 4 a b c } {a b c} test lreplace-1.15 {lreplace command} { lreplace {a b "c c" d e f} 3 3 } {a b {c c} e f} test lreplace-1.16 {lreplace command} { lreplace { 1 2 3 4 5} 0 0 a } {a 2 3 4 5} test lreplace-1.17 {lreplace command} { lreplace {1 2 3 4 "5 6"} 4 4 a } {1 2 3 4 a} test lreplace-1.18 {lreplace command} { lreplace {1 2 3 4 {5 6}} 4 4 a } {1 2 3 4 a} test lreplace-1.19 {lreplace command} { lreplace {1 2 3 4} 2 end x y z } {1 2 x y z} test lreplace-1.20 {lreplace command} { lreplace {1 2 3 4} end end a } {1 2 3 a} test lreplace-1.21 {lreplace command} { lreplace {1 2 3 4} end 3 a } {1 2 3 a} test lreplace-1.22 {lreplace command} { lreplace {1 2 3 4} end end } {1 2 3} test lreplace-1.23 {lreplace command} { lreplace {1 2 3 4} 2 -1 xy } {1 2 xy 3 4} test lreplace-1.24 {lreplace command} { lreplace {1 2 3 4} end -1 z } {1 2 3 z 4} test lreplace-1.25 {lreplace command} { concat \"[lreplace {\}\ hello} end end]\" } {"\}\ "} test lreplace-1.26 {lreplace command} { catch {unset foo} set foo {a b} list [set foo [lreplace $foo end end]] \ [set foo [lreplace $foo end end]] \ [set foo [lreplace $foo end end]] } {a {} {}} test lreplace-1.27 {lreplace command} -body { lreplace x 1 1 } -result x test lreplace-1.28 {lreplace command} -body { lreplace x 1 1 y } -result {x y} test lreplace-1.29 {lreplace command} -body { lreplace x 1 1 [error foo] } -returnCodes 1 -result {foo} test lreplace-1.30 {lreplace command} -body { lreplace {not {}alist} 0 0 [error foo] } -returnCodes 1 -result {foo} test lreplace-2.1 {lreplace errors} -body { list [catch lreplace msg] $msg } -result {1 {wrong # args: should be "lreplace list first last ?element ...?"}} test lreplace-2.2 {lreplace errors} -body { list [catch {lreplace a b} msg] $msg } -result {1 {wrong # args: should be "lreplace list first last ?element ...?"}} test lreplace-2.3 {lreplace errors} -body { list [catch {lreplace x a 10} msg] $msg } -result {1 {bad index "a": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.4 {lreplace errors} -body { list [catch {lreplace x 10 x} msg] $msg } -result {1 {bad index "x": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.5 {lreplace errors} -body { list [catch {lreplace x 10 1x} msg] $msg } -result {1 {bad index "1x": must be integer?[+-]integer? or end?[+-]integer?}} test lreplace-2.6 {lreplace errors} -body { list [catch {lreplace x 3 2} msg] $msg } -result {0 x} test lreplace-2.7 {lreplace errors} -body { list [catch {lreplace x 2 2} msg] $msg } -result {0 x} test lreplace-3.1 {lreplace won't modify shared argument objects} { proc p {} { lreplace "a b c" 1 1 "x y" return "a b c" } p } "a b c" test lreplace-4.1 {Bug ccc2c2cc98: lreplace edge case} { lreplace {} 1 1 } {} test lreplace-4.2 {Bug ccc2c2cc98: lreplace edge case} { lreplace { } 1 1 } {} test lreplace-4.3 {lreplace edge case} { lreplace {1 2 3} 2 0 } {1 2 3} test lreplace-4.4 {lreplace edge case} { lreplace {1 2 3 4 5} 3 1 } {1 2 3 4 5} test lreplace-4.5 {lreplace edge case} { lreplace {1 2 3 4 5} 3 0 _ } {1 2 3 _ 4 5} test lreplace-4.6 {lreplace end-x: bug a4cb3f06c4} { lreplace {0 1 2 3 4} 0 end-2 } {3 4} test lreplace-4.6.1 {lreplace end-x: bug a4cb3f06c4} { lreplace {0 1 2 3 4} 0 end-2 a b c } {a b c 3 4} test lreplace-4.7 {lreplace with two end-indexes: increasing} { lreplace {0 1 2 3 4} end-2 end-1 } {0 1 4} test lreplace-4.7.1 {lreplace with two end-indexes: increasing} { lreplace {0 1 2 3 4} end-2 end-1 a b c } {0 1 a b c 4} test lreplace-4.8 {lreplace with two end-indexes: equal} { lreplace {0 1 2 3 4} end-2 end-2 } {0 1 3 4} test lreplace-4.8.1 {lreplace with two end-indexes: equal} { lreplace {0 1 2 3 4} end-2 end-2 a b c } {0 1 a b c 3 4} test lreplace-4.9 {lreplace with two end-indexes: decreasing} { lreplace {0 1 2 3 4} end-2 end-3 } {0 1 2 3 4} test lreplace-4.9.1 {lreplace with two end-indexes: decreasing} { lreplace {0 1 2 3 4} end-2 end-3 a b c } {0 1 a b c 2 3 4} test lreplace-4.10 {lreplace with two equal indexes} { lreplace {0 1 2 3 4} 2 2 } {0 1 3 4} test lreplace-4.10.1 {lreplace with two equal indexes} { lreplace {0 1 2 3 4} 2 2 a b c } {0 1 a b c 3 4} test lreplace-4.11 {lreplace end index first} { lreplace {0 1 2 3 4} end-2 1 a b c } {0 1 a b c 2 3 4} test lreplace-4.12 {lreplace end index first} { lreplace {0 1 2 3 4} end-2 2 a b c } {0 1 a b c 3 4} test lreplace-4.13 {lreplace empty list} { lreplace {} 1 1 1 } 1 test lreplace-4.14 {lreplace empty list} { lreplace {} 2 2 2 } 2 test lreplace-5.1 {compiled lreplace: Bug 47ac84309b} { apply {x { lreplace $x end 0 }} {a b c} } {a b c} test lreplace-5.2 {compiled lreplace: Bug 47ac84309b} { apply {x { lreplace $x end 0 A }} {a b c} } {a b A c} # Testing for compiled behaviour. Far too many variations to check with # spelt-out tests. Note that this *just* checks whether the compiled version # and the interpreted version are the same, not whether the interpreted # version is correct. apply {{} { set lss {{} {a} {a b c} {a b c d}} set ins {{} A {A B}} set idxs {-2 -1 0 1 2 3 end-3 end-2 end-1 end end+1 end+2} set lreplace lreplace foreach ls $lss { foreach a $idxs { foreach b $idxs { foreach i $ins { set expected [list [catch {$lreplace $ls $a $b {*}$i} m] $m] set tester [list lreplace $ls $a $b {*}$i] set script [list catch $tester m] set script "list \[$script\] \$m" test lreplace-6.[incr n] {lreplace battery} -body \ [list apply [list {} $script]] -result $expected } } } } }} # Essentially same tests as above but for ledit test ledit-1.1 {ledit command} { set l {1 2 3 4 5} list [ledit l 0 0 a] $l } {{a 2 3 4 5} {a 2 3 4 5}} test ledit-1.2 {ledit command} { set l {1 2 3 4 5} list [ledit l 1 1 a] $l } {{1 a 3 4 5} {1 a 3 4 5}} test ledit-1.3 {ledit command} { set l {1 2 3 4 5} list [ledit l 2 2 a] $l } {{1 2 a 4 5} {1 2 a 4 5}} test ledit-1.4 {ledit command} { set l {1 2 3 4 5} list [ledit l 3 3 a] $l } {{1 2 3 a 5} {1 2 3 a 5}} test ledit-1.5 {ledit command} { set l {1 2 3 4 5} list [ledit l 4 4 a] $l } {{1 2 3 4 a} {1 2 3 4 a}} test ledit-1.6 {ledit command} { set l {1 2 3 4 5} list [ledit l 4 5 a] $l } {{1 2 3 4 a} {1 2 3 4 a}} test ledit-1.7 {ledit command} { set l {1 2 3 4 5} list [ledit l -1 -1 a] $l } {{a 1 2 3 4 5} {a 1 2 3 4 5}} test ledit-1.8 {ledit command} { set l {1 2 3 4 5} list [ledit l 2 end a b c d] $l } {{1 2 a b c d} {1 2 a b c d}} test ledit-1.9 {ledit command} { set l {1 2 3 4 5} list [ledit l 0 3] $l } {5 5} test ledit-1.10 {ledit command} { set l {1 2 3 4 5} list [ledit l 0 4] $l } {{} {}} test ledit-1.11 {ledit command} { set l {1 2 3 4 5} list [ledit l 0 1] $l } {{3 4 5} {3 4 5}} test ledit-1.12 {ledit command} { set l {1 2 3 4 5} list [ledit l 2 3] $l } {{1 2 5} {1 2 5}} test ledit-1.13 {ledit command} { set l {1 2 3 4 5} list [ledit l 3 end] $l } {{1 2 3} {1 2 3}} test ledit-1.14 {ledit command} { set l {1 2 3 4 5} list [ledit l -1 4 a b c] $l } {{a b c} {a b c}} test ledit-1.15 {ledit command} { set l {a b "c c" d e f} list [ledit l 3 3] $l } {{a b {c c} e f} {a b {c c} e f}} test ledit-1.16 {ledit command} { set l { 1 2 3 4 5} list [ledit l 0 0 a] $l } {{a 2 3 4 5} {a 2 3 4 5}} test ledit-1.17 {ledit command} { set l {1 2 3 4 "5 6"} list [ledit l 4 4 a] $l } {{1 2 3 4 a} {1 2 3 4 a}} test ledit-1.18 {ledit command} { set l {1 2 3 4 {5 6}} list [ledit l 4 4 a] $l } {{1 2 3 4 a} {1 2 3 4 a}} test ledit-1.19 {ledit command} { set l {1 2 3 4} list [ledit l 2 end x y z] $l } {{1 2 x y z} {1 2 x y z}} test ledit-1.20 {ledit command} { set l {1 2 3 4} list [ledit l end end a] $l } {{1 2 3 a} {1 2 3 a}} test ledit-1.21 {ledit command} { set l {1 2 3 4} list [ledit l end 3 a] $l } {{1 2 3 a} {1 2 3 a}} test ledit-1.22 {ledit command} { set l {1 2 3 4} list [ledit l end end] $l } {{1 2 3} {1 2 3}} test ledit-1.23 {ledit command} { set l {1 2 3 4} list [ledit l 2 -1 xy] $l } {{1 2 xy 3 4} {1 2 xy 3 4}} test ledit-1.24 {ledit command} { set l {1 2 3 4} list [ledit l end -1 z] $l } {{1 2 3 z 4} {1 2 3 z 4}} test ledit-1.25 {ledit command} { set l {\}\ hello} concat \"[ledit l end end]\" $l } {"\}\ " \}\ } test ledit-1.26 {ledit command} { catch {unset foo} set foo {a b} list [ledit foo end end] $foo \ [ledit foo end end] $foo \ [ledit foo end end] $foo } {a a {} {} {} {}} test ledit-1.27 {lsubset command} -body { set l x list [ledit l 1 1] $l } -result {x x} test ledit-1.28 {ledit command} -body { set l x list [ledit l 1 1 y] $l } -result {{x y} {x y}} test ledit-1.29 {ledit command} -body { set l x ledit l 1 1 [error foo] } -returnCodes 1 -result {foo} test ledit-1.30 {ledit command} -body { set l {not {}alist} ledit l 0 0 [error foo] } -returnCodes 1 -result {foo} test ledit-1.31 {ledit command} -body { unset -nocomplain arr set arr(x) {a b} list [ledit arr(x) 0 0 c] $arr(x) } -result {{c b} {c b}} test ledit-2.1 {ledit errors} -body { list [catch ledit msg] $msg } -result {1 {wrong # args: should be "ledit listVar first last ?element ...?"}} test ledit-2.2 {ledit errors} -body { unset -nocomplain x list [catch {ledit l b} msg] $msg } -result {1 {wrong # args: should be "ledit listVar first last ?element ...?"}} test ledit-2.3 {ledit errors} -body { set x {} list [catch {ledit x a 10} msg] $msg } -result {1 {bad index "a": must be integer?[+-]integer? or end?[+-]integer?}} test ledit-2.4 {ledit errors} -body { set l {} list [catch {ledit l 10 x} msg] $msg } -result {1 {bad index "x": must be integer?[+-]integer? or end?[+-]integer?}} test ledit-2.5 {ledit errors} -body { set l {} list [catch {ledit l 10 1x} msg] $msg } -result {1 {bad index "1x": must be integer?[+-]integer? or end?[+-]integer?}} test ledit-2.6 {ledit errors} -body { set l x list [catch {ledit l 3 2} msg] $msg } -result {0 x} test ledit-2.7 {ledit errors} -body { set l x list [catch {ledit l 2 2} msg] $msg } -result {0 x} test ledit-2.8 {ledit errors} -body { unset -nocomplain l ledit l 0 0 x } -returnCodes error -result {can't read "l": no such variable} test ledit-2.9 {ledit errors} -body { unset -nocomplain arr ledit arr(x) 0 0 x } -returnCodes error -result {can't read "arr(x)": no such variable} test ledit-2.10 {ledit errors} -body { unset -nocomplain arr set arr(y) y ledit arr(x) 0 0 x } -returnCodes error -result {can't read "arr(x)": no such element in array} test ledit-3.1 {ledit won't modify shared argument objects} { proc p {} { set l "a b c" ledit l 1 1 "x y" # The literal in locals table should be unmodified return [list "a b c" $l] } p } {{a b c} {a {x y} c}} # Following bugs were in lreplace. Make sure ledit does not have them test ledit-4.1 {Bug ccc2c2cc98: lreplace edge case} { set l {} list [ledit l 1 1] $l } {{} {}} test ledit-4.2 {Bug ccc2c2cc98: lreplace edge case} { set l { } list [ledit l 1 1] $l } {{} {}} test ledit-4.3 {lreplace edge case} { set l {1 2 3} ledit l 2 0 } {1 2 3} test ledit-4.4 {ledit edge case} { set l {1 2 3 4 5} list [ledit l 3 1] $l } {{1 2 3 4 5} {1 2 3 4 5}} test ledit-4.5 {ledit edge case} { lreplace {1 2 3 4 5} 3 0 _ } {1 2 3 _ 4 5} test ledit-4.6 {ledit end-x: bug a4cb3f06c4} { set l {0 1 2 3 4} list [ledit l 0 end-2] $l } {{3 4} {3 4}} test ledit-4.6.1 {ledit end-x: bug a4cb3f06c4} { set l {0 1 2 3 4} list [ledit l 0 end-2 a b c] $l } {{a b c 3 4} {a b c 3 4}} test ledit-4.7 {ledit with two end-indexes: increasing} { set l {0 1 2 3 4} list [ledit l end-2 end-1] $l } {{0 1 4} {0 1 4}} test ledit-4.7.1 {ledit with two end-indexes: increasing} { set l {0 1 2 3 4} list [ledit l end-2 end-1 a b c] $l } {{0 1 a b c 4} {0 1 a b c 4}} test ledit-4.8 {ledit with two end-indexes: equal} { set l {0 1 2 3 4} list [ledit l end-2 end-2] $l } {{0 1 3 4} {0 1 3 4}} test ledit-4.8.1 {ledit with two end-indexes: equal} { set l {0 1 2 3 4} list [ledit l end-2 end-2 a b c] $l } {{0 1 a b c 3 4} {0 1 a b c 3 4}} test ledit-4.9 {ledit with two end-indexes: decreasing} { set l {0 1 2 3 4} list [ledit l end-2 end-3] $l } {{0 1 2 3 4} {0 1 2 3 4}} test ledit-4.9.1 {ledit with two end-indexes: decreasing} { set l {0 1 2 3 4} list [ledit l end-2 end-3 a b c] $l } {{0 1 a b c 2 3 4} {0 1 a b c 2 3 4}} test ledit-4.10 {ledit with two equal indexes} { set l {0 1 2 3 4} list [ledit l 2 2] $l } {{0 1 3 4} {0 1 3 4}} test ledit-4.10.1 {ledit with two equal indexes} { set l {0 1 2 3 4} list [ledit l 2 2 a b c] $l } {{0 1 a b c 3 4} {0 1 a b c 3 4}} test ledit-4.11 {ledit end index first} { set l {0 1 2 3 4} list [ledit l end-2 1 a b c] $l } {{0 1 a b c 2 3 4} {0 1 a b c 2 3 4}} test ledit-4.12 {ledit end index first} { set l {0 1 2 3 4} list [ledit l end-2 2 a b c] $l } {{0 1 a b c 3 4} {0 1 a b c 3 4}} test ledit-4.13 {ledit empty list} { set l {} list [ledit l 1 1 1] $l } {1 1} test ledit-4.14 {ledit empty list} { set l {} list [ledit l 2 2 2] $l } {2 2} test ledit-5.1 {compiled lreplace: Bug 47ac84309b} { apply {x { ledit x end 0 }} {a b c} } {a b c} test ledit-5.2 {compiled lreplace: Bug 47ac84309b} { apply {x { ledit x end 0 A }} {a b c} } {a b A c} test ledit-bug-a366c6efee {Bug [a366c6efee]} -body { apply {{} { set l { } string length [ledit l 1 1]; # Force string generation set result foo append result " " bar }} } -result "foo bar" # Testing for compiled behaviour. Far too many variations to check with # spelt-out tests. Note that this *just* checks whether the compiled version # and the interpreted version are the same, not whether the interpreted # version is correct. apply {{} { set lss {{} {a} {a b c} {a b c d}} set ins {{} A {A B}} set idxs {-2 -1 0 1 2 3 end-3 end-2 end-1 end end+1 end+2} set lreplace lreplace foreach ls $lss { foreach a $idxs { foreach b $idxs { foreach i $ins { set expected [list [catch {$lreplace $ls $a $b {*}$i} m] $m] set tester [list ledit ls $a $b {*}$i] set script [list catch $tester m] set script "list \[$script\] \$m" test ledit-6.[incr n] {ledit battery} -body \ [list apply [list {ls} $script] $ls] -result $expected } } } } }} # cleanup catch {unset foo} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/lrepeat.test0000644000175000017500000000364515104661341015256 0ustar sergeisergei# Commands covered: lrepeat # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2003 Simon Geard. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ## Arg errors test lrepeat-1.1 {error cases} { -body { lrepeat } -returnCodes 1 -result {wrong # args: should be "lrepeat count ?value ...?"} } test lrepeat-1.2 {Accept zero elements(TIP 323)} { -body { lrepeat 1 } -result {} } test lrepeat-1.3 {error cases} { -body { lrepeat a 1 } -returnCodes 1 -result {expected integer but got "a"} } test lrepeat-1.4 {error cases} { -body { lrepeat -3 1 } -returnCodes 1 -result {bad count "-3": must be integer >= 0} } test lrepeat-1.5 {Accept zero repetitions (TIP 323)} { -body { lrepeat 0 } -result {} } test lrepeat-1.6 {error cases} { -body { lrepeat 3.5 1 } -returnCodes 1 -result {expected integer but got "3.5"} } test lrepeat-1.7 {Accept zero repetitions (TIP 323)} { -body { lrepeat 0 a b c } -result {} } test lrepeat-1.8 {Do not build enormous lists - Bug 2130992} -constraints knownBug -body { lrepeat 0x10000000 a b c d e f g h } -returnCodes error -match glob -result * ## Okay test lrepeat-2.1 {normal cases} { lrepeat 10 a } {a a a a a a a a a a} test lrepeat-2.2 {normal cases} { lrepeat 3 [lrepeat 3 0] } {{0 0 0} {0 0 0} {0 0 0}} test lrepeat-2.3 {normal cases} { lrepeat 3 a b c } {a b c a b c a b c} test lrepeat-2.4 {normal cases} { lrepeat 3 [lrepeat 2 a] b c } {{a a} b c {a a} b c {a a} b c} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/lrange.test0000644000175000017500000002433515104661341015071 0ustar sergeisergei# Commands covered: lrange # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testpurebytesobj [llength [info commands testpurebytesobj]] test lrange-1.1 {range of list elements} { lrange {a b c d} 1 2 } {b c} test lrange-1.2 {range of list elements} { lrange {a {bcd e {f g {}}} l14 l15 d} 1 1 } {{bcd e {f g {}}}} test lrange-1.3 {range of list elements} { lrange {a {bcd e {f g {}}} l14 l15 d} 3 end } {l15 d} test lrange-1.4 {range of list elements} { lrange {a {bcd e {f g {}}} l14 l15 d} 4 10000 } {d} test lrange-1.5 {range of list elements} { lrange {a {bcd e {f g {}}} l14 l15 d} 4 3 } {} test lrange-1.6 {range of list elements} { lrange {a {bcd e {f g {}}} l14 l15 d} 10 11 } {} test lrange-1.7 {range of list elements} { lrange {a b c d e} -1 2 } {a b c} test lrange-1.8 {range of list elements} { lrange {a b c d e} -2 -1 } {} test lrange-1.9 {range of list elements} { lrange {a b c d e} -2 end } {a b c d e} test lrange-1.10 {range of list elements} { lrange "a b\{c d" 1 2 } "b\\{c d" test lrange-1.11 {range of list elements} { lrange "a b c d" end end } d test lrange-1.12 {range of list elements} { lrange "a b c d" end 100000 } d test lrange-1.13 {range of list elements} { lrange "a b c d" end 3 } d test lrange-1.14 {range of list elements} { lrange "a b c d" end 2 } {} test lrange-1.15 {range of list elements} { concat \"[lrange {a b \{\ } 0 2]" } {"a b \{\ "} # emacs highlighting bug workaround --> " test lrange-1.16 {list element quoting} { lrange {[append a .b]} 0 end } {{[append} a .b\]} test lrange-2.1 {error conditions} { list [catch {lrange a b} msg] $msg } {1 {wrong # args: should be "lrange list first last"}} test lrange-2.2 {error conditions} { list [catch {lrange a b 6 7} msg] $msg } {1 {wrong # args: should be "lrange list first last"}} test lrange-2.3 {error conditions} { list [catch {lrange a b 6} msg] $msg } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}} test lrange-2.4 {error conditions} { list [catch {lrange a 0 enigma} msg] $msg } {1 {bad index "enigma": must be integer?[+-]integer? or end?[+-]integer?}} test lrange-2.5 {error conditions} { list [catch {lrange "a \{b c" 3 4} msg] $msg } {1 {unmatched open brace in list}} test lrange-2.6 {error conditions} { list [catch {lrange "a b c \{ d e" 1 4} msg] $msg } {1 {unmatched open brace in list}} test lrange-3.1 {Bug 3588366: end-offsets before start} { apply {l { lrange $l 0 end-5 }} {1 2 3 4 5} } {} test lrange-3.2 {compiled with static indices out of range, negative} { list [lrange {a b c} -1 -2] [lrange {a b c} -2 -1] [lrange {a b c} -3 -2] [lrange {a b c} -2 -3] } [lrepeat 4 {}] test lrange-3.3 {compiled with calculated indices out of range, negative constant} { list [lrange {a b c} 0-1 -1-1] [lrange {a b c} -2+0 0-1] [lrange {a b c} -2-1 -2+1] [lrange {a b c} -2+1 -2-1] } [lrepeat 4 {}] test lrange-3.4 {compiled with calculated indices out of range, after end} -body { list [lrange {a b c} end+1 end+2] [lrange {a b c} end+2 end+1] [lrange {a b c} end+2 end+3] [lrange {a b c} end+3 end+2] } -result [lrepeat 4 {}] test lrange-3.5 {compiled with calculated indices, start out of range (negative)} { list [lrange {a b c} -1 1] [lrange {a b c} -1+0 end-1] [lrange {a b c} -2 1] [lrange {a b c} -2+0 0+1] } [lrepeat 4 {a b}] test lrange-3.6 {compiled with calculated indices, end out of range (after end)} { list [lrange {a b c} 1 end+1] [lrange {a b c} 1+0 2+1] [lrange {a b c} 1 end+1] [lrange {a b c} end-1 3+1] } [lrepeat 4 {b c}] test lrange-3.7a {compiled on empty not canonical list (with static and dynamic indices), regression test, bug [cc1e91552c]} { list [lrange { } 0 1] [lrange [format %c 32] 0 1] [lrange [set a { }] 0 1] \ [lrange { } 0-1 end+1] [lrange [format %c 32] 0-1 end+1] [lrange $a 0-1 end+1] } [lrepeat 6 {}] test lrange-3.7b {not compiled on empty not canonical list (with static and dynamic indices), regression test, bug [cc1e91552c]} -body { set cmd lrange list [$cmd { } 0 1] [$cmd [format %c 32] 0 1] [$cmd [set a { }] 0 1] \ [$cmd { } 0-1 end+1] [$cmd [format %c 32] 0-1 end+1] [$cmd $a 0-1 end+1] } -result [lrepeat 6 {}] # following 4 tests could cause a segfault on empty non-lists with tclEmptyStringRep # (as before the fix [58c46e74b931d3a1]): test lrange-3.7a.2 {compiled on empty not list object, 2nd regression test, bug [cc1e91552c]} { list [lrange {} 0 1] [lrange [lindex a -1] 0 1] [lrange [set a {}] 0 1] \ [lrange {} 0-1 end+1] [lrange [lindex a -1] 0-1 end+1] [lrange $a 0-1 end+1] } [lrepeat 6 {}] test lrange-3.7b.2 {not compiled on empty not list object, 2nd regression test, bug [cc1e91552c]} -body { set cmd lrange list [$cmd {} 0 1] [$cmd [lindex a -1] 0 1] [$cmd [set a {}] 0 1] \ [$cmd {} 0-1 end+1] [$cmd [lindex a -1] 0-1 end+1] [$cmd $a 0-1 end+1] } -result [lrepeat 6 {}] test lrange-3.7c.2 {compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} -constraints { testpurebytesobj } -body { list [lrange [testpurebytesobj] 0 1] [lrange [testpurebytesobj { }] 0 1] [lrange [set a [testpurebytesobj {}]] 0 1] \ [lrange [testpurebytesobj] 0-1 end+1] [lrange [testpurebytesobj { }] 0-1 end+1] [lrange $a 0-1 end+1] } -result [lrepeat 6 {}] test lrange-3.7d.2 {not compiled on empty pure bytes object, 2nd regression test, bug [cc1e91552c]} -constraints { testpurebytesobj } -body { set cmd lrange list [$cmd [testpurebytesobj] 0 1] [$cmd [testpurebytesobj { }] 0 1] [$cmd [set a [testpurebytesobj {}]] 0 1] \ [$cmd [testpurebytesobj] 0-1 end+1] [$cmd [testpurebytesobj { }] 0-1 end+1] [$cmd $a 0-1 end+1] } -result [lrepeat 6 {}] test lrange-4.1 {lrange pure promise} -body { set ll1 [list $tcl_version 2 3 4] # Shared set ll2 $ll1 # With string rep string length $ll1 set rep1 [tcl::unsupported::representation $ll1] # Get new pure object set x [lrange $ll1 0 end] set rep2 [tcl::unsupported::representation $x] regexp {object pointer at (\S+)} $rep1 -> obj1 regexp {object pointer at (\S+)} $rep2 -> obj2 list $rep1 $rep2 [string equal $obj1 $obj2] # Check for a new clean object } -match glob -result {*value is *refcount of 3,*, string rep*value is*refcount of 2,* no string rep* 0} test lrange-4.2 {lrange pure promise} -body { set ll1 [list $tcl_version 2 3 4] # Shared set ll2 $ll1 # With string rep string length $ll1 set rep1 [tcl::unsupported::representation $ll1] # Get new pure object, not compiled set x [[string cat l range] $ll1 0 end] set rep2 [tcl::unsupported::representation $x] regexp {object pointer at (\S+)} $rep1 -> obj1 regexp {object pointer at (\S+)} $rep2 -> obj2 list $rep1 $rep2 [string equal $obj1 $obj2] # Check for a new clean object } -match glob -result {*value is *refcount of 3,*, string rep*value is*refcount of 2,* no string rep* 0} test lrange-4.3 {lrange pure promise} -body { set ll1 [list $tcl_version 2 3 4] # With string rep string length $ll1 set rep1 [tcl::unsupported::representation $ll1] # Get pure object, unshared set ll2 [lrange $ll1[set ll1 {}] 0 end] set rep2 [tcl::unsupported::representation $ll2] regexp {object pointer at (\S+)} $rep1 -> obj1 regexp {object pointer at (\S+)} $rep2 -> obj2 list $rep1 $rep2 [string equal $obj1 $obj2] # Internal optimisations should keep the same object } -match glob -result {*value is *refcount of 2,*, string rep*value is*refcount of 2,* no string rep* 1} test lrange-4.4 {lrange pure promise} -body { set ll1 [list $tcl_version 2 3 4] # With string rep string length $ll1 set rep1 [tcl::unsupported::representation $ll1] # Get pure object, unshared, not compiled set ll2 [[string cat l range] $ll1[set ll1 {}] 0 end] set rep2 [tcl::unsupported::representation $ll2] regexp {object pointer at (\S+)} $rep1 -> obj1 regexp {object pointer at (\S+)} $rep2 -> obj2 list $rep1 $rep2 [string equal $obj1 $obj2] # Internal optimisations should keep the same object } -match glob -result {*value is *refcount of 2,*, string rep*value is*refcount of 2,* no string rep* 1} # Testing for compiled vs non-compiled behaviour, and shared vs non-shared. # Far too many variations to check with spelt-out tests. # Note that this *just* checks whether the different versions are the same # not whether any of them is correct. apply {{} { set lss {{} {a} {a b c} {a b c d}} set idxs {-2 -1 0 1 2 3 end-3 end-2 end-1 end end+1 end+2} set lrange lrange foreach ls $lss { foreach a $idxs { foreach b $idxs { # Shared, uncompiled set ls2 $ls set expected [list [catch {$lrange $ls $a $b} m] $m] # Shared, compiled set tester [list lrange $ls $a $b] set script [list catch $tester m] set script "list \[$script\] \$m" test lrange-5.[incr n].1 {lrange shared compiled} -body \ [list apply [list {} $script]] -result $expected # Unshared, uncompiled set tester [string map [list %l [list $ls] %a $a %b $b] { [string cat l range] [lrange %l 0 end] %a %b }] set script [list catch $tester m] set script "list \[$script\] \$m" test lrange-5.$n.2 {lrange unshared uncompiled} -body \ [list apply [list {} $script]] -result $expected # Unshared, compiled set tester [string map [list %l [list $ls] %a $a %b $b] { lrange [lrange %l 0 end] %a %b }] set script [list catch $tester m] set script "list \[$script\] \$m" test lrange-5.$n.3 {lrange unshared compiled} -body \ [list apply [list {} $script]] -result $expected } } } }} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/lpop.test0000644000175000017500000000761215104661341014572 0ustar sergeisergei# Commands covered: lpop # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain no; # following tests expecting var "no" does not exists test lpop-1.1 {error conditions} -returnCodes error -body { lpop no } -result {can't read "no": no such variable} test lpop-1.2 {error conditions} -returnCodes error -body { lpop no 0 } -result {can't read "no": no such variable} test lpop-1.3 {error conditions} -returnCodes error -body { set l "x {}x" lpop l } -result {list element in braces followed by "x" instead of space} test lpop-1.4 {error conditions} -returnCodes error -body { set l "x y" lpop l -1 } -result {index "-1" out of range} test lpop-1.4b {error conditions (also check SF on empty list variable, bug [234d6c811d])} -body { set l "x y" list [lpop l] [lpop l] [catch {lpop l} v] $v [catch {lpop l 0} v] $v $l } -result {y x 1 {index "end" out of range} 1 {index "0" out of range} {}} test lpop-1.5 {error conditions} -returnCodes error -body { set l "x y z" lpop l 3 } -result {index "3" out of range} ;#-errorCode {TCL OPERATION LPOP BADINDEX} test lpop-1.6 {error conditions} -returnCodes error -body { set l "x y" lpop l end+1 } -result {index "end+1" out of range} test lpop-1.7 {error conditions} -returnCodes error -body { set l "x y" lpop l {} } -match glob -result {bad index *} test lpop-1.8 {error conditions} -returnCodes error -body { set l "x y" lpop l 0 0 0 0 1 } -result {index "1" out of range} test lpop-1.9 {error conditions} -returnCodes error -body { set l "x y" lpop l {1 0} } -match glob -result {bad index *} test lpop-2.1 {basic functionality} -body { set l "x y z" list [lpop l 0] $l } -result {x {y z}} test lpop-2.2 {basic functionality} -body { set l "x y z" list [lpop l 1] $l } -result {y {x z}} test lpop-2.3 {basic functionality} -body { set l "x y z" list [lpop l] $l } -result {z {x y}} test lpop-2.4 {basic functionality} -body { set l "x y z" set l2 $l list [lpop l] $l $l2 } -result {z {x y} {x y z}} test lpop-3.1 {nested} -body { set l "x y" set l2 $l list [lpop l 0 0 0 0] $l $l2 } -result {x {{{{}}} y} {x y}} test lpop-3.2 {nested} -body { set l "{x y} {a b}" list [lpop l 0 1] $l } -result {y {x {a b}}} test lpop-3.3 {nested} -body { set l "{x y} {a b}" list [lpop l 1 0] $l } -result {a {{x y} b}} test lpop-99.1 {performance} -constraints perf -body { set l [lrepeat 10000 x] set l2 $l set t1 [time { while {[llength $l] >= 2} { lpop l end } }] set l [lrepeat 30000 x] set l2 $l set t2 [time { while {[llength $l] >= 2} { lpop l end } }] regexp {\d+} $t1 ms1 regexp {\d+} $t2 ms2 set ratio [expr {double($ms2)/$ms1}] # Deleting from end should have linear performance expr {$ratio > 4 ? $ratio : 4} } -result {4} test lpop-99.2 {performance} -constraints perf -body { set l [lrepeat 10000 x] set l2 $l set t1 [time { while {[llength $l] >= 2} { lpop l 1 } }] set l [lrepeat 30000 x] set l2 $l set t2 [time { while {[llength $l] >= 2} { lpop l 1 } }] regexp {\d+} $t1 ms1 regexp {\d+} $t2 ms2 set ratio [expr {double($ms2)/$ms1}] expr {$ratio > 10 ? $ratio : 10} } -result {10} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/load.test0000644000175000017500000002417215104661341014537 0ustar sergeisergei# Commands covered: load # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Figure out what extension is used for shared libraries on this # platform. if {![info exists ext]} { set ext [info sharedlibextension] } # Tests require the existence of one of the DLLs in the dltest directory. set testDir [file join [file dirname [info nameofexecutable]] dltest] set x [file join $testDir tcl9pkga$ext] set dll "[file tail $x]Required" testConstraint $dll [file readable $x] # Tests also require that this DLL has not already been loaded. set loaded "[file tail $x]Loaded" set alreadyLoaded [info loaded {}] testConstraint $loaded [expr {![string match *pkga* $alreadyLoaded]}] set alreadyTotalLoaded [info loaded] # Certain tests require the 'teststaticlibrary' command from tcltest testConstraint teststaticlibrary [llength [info commands teststaticlibrary]] # Test load-10.1 requires the 'testsimplefilesystem' command from tcltest testConstraint testsimplefilesystem \ [llength [info commands testsimplefilesystem]] test load-1.1 {basic errors} -returnCodes error -body { load } -result {wrong # args: should be "load ?-global? ?-lazy? ?--? fileName ?prefix? ?interp?"} test load-1.2 {basic errors} -returnCodes error -body { load a b c d } -result {wrong # args: should be "load ?-global? ?-lazy? ?--? fileName ?prefix? ?interp?"} test load-1.3 {basic errors} -returnCodes error -body { load a b foobar } -result {could not find interpreter "foobar"} test load-1.4 {basic errors} -returnCodes error -body { load -global {} } -result {must specify either file name or prefix} test load-1.5 {basic errors} -returnCodes error -body { load -lazy {} {} } -result {must specify either file name or prefix} test load-1.6 {basic errors} -returnCodes error -body { load {} Unknown } -result {no library with prefix "Unknown" is loaded statically} test load-1.7 {basic errors} -returnCodes error -body { load -abc foo } -result {bad option "-abc": must be -global, -lazy, or --} test load-1.8 {basic errors} -returnCodes error -body { load -global } -result {cannot figure out prefix for -global} test load-2.1 {basic loading, with guess for package name} \ [list $dll $loaded] { load -global [file join $testDir tcl9pkga$ext] list [pkga_eq abc def] [lsort [info commands pkga_*]] } {0 {pkga_eq pkga_quote}} interp create -safe child test load-2.2 {loading into a safe interpreter, with package name conversion} \ [list $dll $loaded] { load -lazy [file join $testDir tcl9pkgb$ext] Pkgb child list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \ [catch {pkgb_sub 12 10} msg2] $msg2 } {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}} test load-2.3 {loading with no _Init procedure} -constraints [list $dll $loaded] \ -body { list [catch {load [file join $testDir tcl9pkgc$ext] Foo} msg] $msg $errorCode } -match glob \ -result [list 1 {cannot find symbol "Foo_Init"*} \ {TCL LOOKUP LOAD_SYMBOL *Foo_Init}] test load-2.4 {loading with no _SafeInit procedure} [list $dll $loaded] { list [catch {load [file join $testDir tcl9pkga$ext] {} child} msg] $msg } {1 {cannot use library in a safe interpreter: no Pkga_SafeInit procedure}} test load-3.1 {error in _Init procedure, same interpreter} \ [list $dll $loaded] { list [catch {load [file join $testDir tcl9pkge$ext] Pkge} msg] \ $msg $::errorInfo $::errorCode } {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within "load [file join $testDir tcl9pkge$ext] Pkge"} {POSIX ENOENT {no such file or directory}}} test load-3.2 {error in _Init procedure, child interpreter} \ [list $dll $loaded] { catch {interp delete x} interp create x set ::errorCode foo set ::errorInfo bar set result [list [catch {load [file join $testDir tcl9pkge$ext] Pkge x} msg] \ $msg $::errorInfo $::errorCode] interp delete x set result } {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within "load [file join $testDir tcl9pkge$ext] Pkge x"} {POSIX ENOENT {no such file or directory}}} test load-4.1 {reloading package into same interpreter} [list $dll $loaded] { list [catch {load [file join $testDir tcl9pkga$ext] Pkga} msg] $msg } {0 {}} test load-4.2 {reloading package into same interpreter} -setup { catch {load [file join $testDir tcl9pkga$ext] Pkga} } -constraints [list $dll $loaded] -returnCodes error -body { load [file join $testDir tcl9pkga$ext] Pkgb } -result "file \"[file join $testDir tcl9pkga$ext]\" is already loaded for prefix \"Pkga\"" test load-5.1 {file name not specified and no static package: pick default} -setup { catch {interp delete x} interp create x } -constraints [list $dll $loaded] -body { load -global [file join $testDir tcl9pkga$ext] Pkga load {} Pkga x info loaded x } -cleanup { interp delete x } -result [list [list [file join $testDir tcl9pkga$ext] Pkga]] test load-6.1 {errors loading file} [list $dll $loaded] { catch {load foo foo} } {1} test load-7.1 {Tcl_StaticLibrary procedure} [list teststaticlibrary] { set x "not loaded" teststaticlibrary Test 1 0 load {} Test load {} Test child list [set x] [child eval set x] } {loaded loaded} test load-7.2 {Tcl_StaticLibrary procedure} [list teststaticlibrary] { set x "not loaded" teststaticlibrary Another 0 0 load {} Another child eval {set x "not loaded"} list [catch {load {} Another child} msg] $msg \ [child eval set x] [set x] } {1 {cannot use library in a safe interpreter: no Another_SafeInit procedure} {not loaded} loaded} test load-7.3 {Tcl_StaticLibrary procedure} [list teststaticlibrary] { set x "not loaded" teststaticlibrary More 0 1 load {} More set x } {not loaded} catch {load [file join $testDir tcl9pkga$ext] Pkga} catch {load [file join $testDir tcl9pkgb$ext] Pkgb} catch {load [file join $testDir tcl9pkge$ext] Pkge} set currentRealLibraries [list [list [file join $testDir tcl9pkge$ext] Pkge] [list [file join $testDir tcl9pkgb$ext] Pkgb] [list [file join $testDir tcl9pkga$ext] Pkga]] test load-7.4 {Tcl_StaticLibrary procedure, redundant calls} -setup { teststaticlibrary Test 1 0 teststaticlibrary Another 0 0 teststaticlibrary More 0 1 } -constraints [list teststaticlibrary $dll $loaded] -body { teststaticlibrary Double 0 1 teststaticlibrary Double 0 1 info loaded } -result [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealLibraries {*}$alreadyTotalLoaded] testConstraint teststaticlibrary_8.x 0 if {[testConstraint teststaticlibrary]} { catch { teststaticlibrary Test 1 1 teststaticlibrary Another 0 1 teststaticlibrary More 0 1 teststaticlibrary Double 0 1 testConstraint teststaticlibrary_8.x 1 } } test load-8.1 {TclGetLoadedLibraries procedure} [list teststaticlibrary_8.x $dll $loaded] { lsort -index 1 [info loaded] } [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealLibraries {*}$alreadyTotalLoaded]] test load-8.2 {TclGetLoadedLibraries procedure} -constraints {teststaticlibrary_8.x} -body { info loaded gorp } -returnCodes error -result {could not find interpreter "gorp"} test load-8.3a {TclGetLoadedLibraries procedure} [list teststaticlibrary_8.x $dll $loaded] { lsort -index 1 [info loaded {}] } [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir tcl9pkga$ext] Pkga] [list [file join $testDir tcl9pkgb$ext] Pkgb] {*}$alreadyLoaded]] test load-8.3b {TclGetLoadedLibraries procedure} [list teststaticlibrary_8.x $dll $loaded] { lsort -index 1 [info loaded child] } [lsort -index 1 [list {{} Test} [list [file join $testDir tcl9pkgb$ext] Pkgb]]] test load-8.4 {TclGetLoadedLibraries procedure} [list teststaticlibrary_8.x $dll $loaded] { load [file join $testDir tcl9pkgb$ext] Pkgb list [lsort -index 1 [info loaded {}]] [lsort [info commands pkgb_*]] } [list [lsort -index 1 [concat [list [list [file join $testDir tcl9pkgb$ext] Pkgb] {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir tcl9pkga$ext] Pkga]] $alreadyLoaded]] {pkgb_demo pkgb_sub pkgb_unsafe}] interp delete child test load-9.1 {Tcl_StaticLibrary, load already-loaded package into another interp} -setup { interp create child1 interp create child2 load {} Tcltest child1 load {} Tcltest child2 } -constraints {teststaticlibrary} -body { child1 eval { teststaticlibrary Loadninepointone 0 1 } child2 eval { teststaticlibrary Loadninepointone 0 1 } list [child1 eval { info loaded {} }] \ [child2 eval { info loaded {} }] } -match glob -cleanup { interp delete child1 interp delete child2 } -result {{{{} Loadninepointone} {* Tcltest}} {{{} Loadninepointone} {* Tcltest}}} test load-10.1 {load from vfs} -setup { set dir [pwd] cd $testDir testsimplefilesystem 1 } -constraints [list $dll $loaded testsimplefilesystem] -body { list [catch {load simplefs:/tcl9pkgd$ext Pkgd} msg] $msg } -result {0 {}} -cleanup { testsimplefilesystem 0 cd $dir unset dir } test load-11.1 {Load TclOO extension using Stubs (Bug [f51efe99a7])} \ [list $dll $loaded] { load [file join $testDir tcl9pkgooa$ext] list [pkgooa_stubsok] [lsort [info commands pkgooa_*]] } {1 pkgooa_stubsok} # cleanup unset ext ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/lmap.test0000644000175000017500000003102015104661341014537 0ustar sergeisergei# Commands covered: lmap, continue, break # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 2011 Trevor Davel # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: $ if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain a b i x # ----- Non-compiled operation ----------------------------------------------- # Basic "lmap" operation (non-compiled) test lmap-1.1 {basic lmap tests} { set a {} lmap i {a b c d} { set a [concat $a $i] } } {a {a b} {a b c} {a b c d}} test lmap-1.2 {basic lmap tests} { lmap i {a b {{c d} e} {123 {{x}}}} { set i } } {a b {{c d} e} {123 {{x}}}} test lmap-1.2a {basic lmap tests} { lmap i {a b {{c d} e} {123 {{x}}}} { return -level 0 $i } } {a b {{c d} e} {123 {{x}}}} test lmap-1.4 {basic lmap tests} -returnCodes error -body { lmap } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-1.6 {basic lmap tests} -returnCodes error -body { lmap i } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-1.8 {basic lmap tests} -returnCodes error -body { lmap i j } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-1.10 {basic lmap tests} -returnCodes error -body { lmap i j k l } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-1.11 {basic lmap tests} { lmap i {} { set i } } {} test lmap-1.12 {basic lmap tests} { lmap i {} { return -level 0 x } } {} test lmap-1.13 {lmap errors} -returnCodes error -body { lmap {{a}{b}} {1 2 3} {} } -result {list element in braces followed by "{b}" instead of space} test lmap-1.14 {lmap errors} -returnCodes error -body { lmap a {{1 2}3} {} } -result {list element in braces followed by "3" instead of space} unset -nocomplain a test lmap-1.15 {lmap errors} -setup { unset -nocomplain a } -body { set a(0) 44 list [catch {lmap a {1 2 3} {}} msg o] $msg $::errorInfo } -result {1 {can't set "a": variable is array} {can't set "a": variable is array (setting lmap loop variable "a") invoked from within "lmap a {1 2 3} {}"}} test lmap-1.16 {lmap errors} -returnCodes error -body { lmap {} {} {} } -result {lmap varlist is empty} unset -nocomplain a # Parallel "lmap" operation (non-compiled) test lmap-2.1 {parallel lmap tests} { lmap {a b} {1 2 3 4} { list $b $a } } {{2 1} {4 3}} test lmap-2.2 {parallel lmap tests} { lmap {a b} {1 2 3 4 5} { list $b $a } } {{2 1} {4 3} {{} 5}} test lmap-2.3 {parallel lmap tests} { lmap a {1 2 3} b {4 5 6} { list $b $a } } {{4 1} {5 2} {6 3}} test lmap-2.4 {parallel lmap tests} { lmap a {1 2 3} b {4 5 6 7 8} { list $b $a } } {{4 1} {5 2} {6 3} {7 {}} {8 {}}} test lmap-2.5 {parallel lmap tests} { lmap {a b} {a b A B aa bb} c {c C cc CC} { list $a $b $c } } {{a b c} {A B C} {aa bb cc} {{} {} CC}} test lmap-2.6 {parallel lmap tests} { lmap a {1 2 3} b {1 2 3} c {1 2 3} d {1 2 3} e {1 2 3} { list $a$b$c$d$e } } {11111 22222 33333} test lmap-2.7 {parallel lmap tests} { lmap a {} b {1 2 3} c {1 2} d {1 2 3 4} e {{1 2}} { set x $a$b$c$d$e } } {{1111 2} 222 33 4} test lmap-2.8 {parallel lmap tests} { lmap a {} b {1 2 3} c {1 2} d {1 2 3 4} e {{1 2}} { join [list $a $b $c $d $e] . } } {{.1.1.1.1 2} .2.2.2. .3..3. ...4.} test lmap-2.9 {lmap only sets vars if repeating loop} { namespace eval ::lmap_test { set rgb {65535 0 0} lmap {r g b} [set rgb] {} set ::x "r=$r, g=$g, b=$b" } namespace delete ::lmap_test set x } {r=65535, g=0, b=0} test lmap-2.10 {lmap only supports local scalar variables} -setup { unset -nocomplain a } -body { lmap {a(3)} {1 2 3 4} {set {a(3)}} } -result {1 2 3 4} unset -nocomplain a # "lmap" with "continue" and "break" (non-compiled) test lmap-3.1 {continue tests} { lmap i {a b c d} { if {[string compare $i "b"] == 0} continue set i } } {a c d} test lmap-3.2 {continue tests} { set x 0 list [lmap i {a b c d} { incr x if {[string compare $i "b"] != 0} continue set i }] $x } {b 4} test lmap-3.3 {break tests} { set x 0 list [lmap i {a b c d} { incr x if {[string compare $i "c"] == 0} break set i }] $x } {{a b} 3} # Check for bug similar to #406709 test lmap-3.4 {break tests} { set a 1 lmap b b {list [concat a; break]; incr a} incr a } {2} # ----- Compiled operation --------------------------------------------------- # Basic "lmap" operation (compiled) test lmap-4.1 {basic lmap tests} { apply {{} { set a {} lmap i {a b c d} { set a [concat $a $i] } }} } {a {a b} {a b c} {a b c d}} test lmap-4.2 {basic lmap tests} { apply {{} { lmap i {a b {{c d} e} {123 {{x}}}} { set i } }} } {a b {{c d} e} {123 {{x}}}} test lmap-4.2a {basic lmap tests} { apply {{} { lmap i {a b {{c d} e} {123 {{x}}}} { return -level 0 $i } }} } {a b {{c d} e} {123 {{x}}}} test lmap-4.4 {basic lmap tests} -returnCodes error -body { apply {{} { lmap }} } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-4.6 {basic lmap tests} -returnCodes error -body { apply {{} { lmap i }} } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-4.8 {basic lmap tests} -returnCodes error -body { apply {{} { lmap i j }} } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-4.10 {basic lmap tests} -returnCodes error -body { apply {{} { lmap i j k l }} } -result {wrong # args: should be "lmap varList list ?varList list ...? command"} test lmap-4.11 {basic lmap tests} { apply {{} { lmap i {} { set i } }} } {} test lmap-4.12 {basic lmap tests} { apply {{} { lmap i {} { return -level 0 x } }} } {} test lmap-4.13 {lmap errors} -returnCodes error -body { apply {{} { lmap {{a}{b}} {1 2 3} {} }} } -result {list element in braces followed by "{b}" instead of space} test lmap-4.14 {lmap errors} -returnCodes error -body { apply {{} { lmap a {{1 2}3} {} }} } -result {list element in braces followed by "3" instead of space} unset -nocomplain a test lmap-4.15 {lmap errors} { apply {{} { set a(0) 44 list [catch {lmap a {1 2 3} {}} msg o] $msg $::errorInfo }} } {1 {can't set "a": variable is array} {can't set "a": variable is array while executing "lmap a {1 2 3} {}"}} test lmap-4.16 {lmap errors} -returnCodes error -body { apply {{} { lmap {} {} {} }} } -result {lmap varlist is empty} unset -nocomplain a # Parallel "lmap" operation (compiled) test lmap-5.1 {parallel lmap tests} { apply {{} { lmap {a b} {1 2 3 4} { list $b $a } }} } {{2 1} {4 3}} test lmap-5.2 {parallel lmap tests} { apply {{} { lmap {a b} {1 2 3 4 5} { list $b $a } }} } {{2 1} {4 3} {{} 5}} test lmap-5.3 {parallel lmap tests} { apply {{} { lmap a {1 2 3} b {4 5 6} { list $b $a } }} } {{4 1} {5 2} {6 3}} test lmap-5.4 {parallel lmap tests} { apply {{} { lmap a {1 2 3} b {4 5 6 7 8} { list $b $a } }} } {{4 1} {5 2} {6 3} {7 {}} {8 {}}} test lmap-5.5 {parallel lmap tests} { apply {{} { lmap {a b} {a b A B aa bb} c {c C cc CC} { list $a $b $c } }} } {{a b c} {A B C} {aa bb cc} {{} {} CC}} test lmap-5.6 {parallel lmap tests} { apply {{} { lmap a {1 2 3} b {1 2 3} c {1 2 3} d {1 2 3} e {1 2 3} { list $a$b$c$d$e } }} } {11111 22222 33333} test lmap-5.7 {parallel lmap tests} { apply {{} { lmap a {} b {1 2 3} c {1 2} d {1 2 3 4} e {{1 2}} { set x $a$b$c$d$e } }} } {{1111 2} 222 33 4} test lmap-5.8 {parallel lmap tests} { apply {{} { lmap a {} b {1 2 3} c {1 2} d {1 2 3 4} e {{1 2}} { join [list $a $b $c $d $e] . } }} } {{.1.1.1.1 2} .2.2.2. .3..3. ...4.} test lmap-5.9 {lmap only sets vars if repeating loop} { apply {{} { set rgb {65535 0 0} lmap {r g b} [set rgb] {} return "r=$r, g=$g, b=$b" }} } {r=65535, g=0, b=0} test lmap-5.10 {lmap only supports local scalar variables} { apply {{} { lmap {a(3)} {1 2 3 4} {set {a(3)}} }} } {1 2 3 4} # "lmap" with "continue" and "break" (compiled) test lmap-6.1 {continue tests} { apply {{} { lmap i {a b c d} { if {[string compare $i "b"] == 0} continue set i } }} } {a c d} test lmap-6.2 {continue tests} { apply {{} { list [lmap i {a b c d} { incr x if {[string compare $i "b"] != 0} continue set i }] $x }} } {b 4} test lmap-6.3 {break tests} { apply {{} { list [lmap i {a b c d} { incr x if {[string compare $i "c"] == 0} break set i }] $x }} } {{a b} 3} # Check for bug similar to #406709 test lmap-6.4 {break tests} { apply {{} { set a 1 lmap b b {list [concat a; break]; incr a} incr a }} } {2} # ----- Special cases and bugs ----------------------------------------------- test lmap-7.1 {compiled lmap backward jump works correctly} -setup { unset -nocomplain x } -body { array set x {0 zero 1 one 2 two 3 three} lsort [apply {{arrayName} { upvar 1 $arrayName a lmap member [array names a] { list $member [set a($member)] } }} x] } -result [lsort {{0 zero} {1 one} {2 two} {3 three}}] test lmap-7.2 {noncompiled lmap and shared variable or value list objects that are converted to another type} -setup { unset -nocomplain x } -body { lmap {12.0} {a b c} { set x 12.0 set x [expr {$x + 1}] } } -result {13.0 13.0 13.0} # Test for incorrect "double evaluation" semantics test lmap-7.3 {delayed substitution of body} { apply {{} { set a 0 lmap a [list 1 2 3] " set x $a " return $x }} } {0} # Related to "foreach" test for [Bug 1189274]; crash on failure test lmap-7.4 {empty list handling} { proc crash {} { rename crash {} set a "x y z" set b "" lmap aa $a bb $b { set x "aa = $aa bb = $bb" } } crash } {{aa = x bb = } {aa = y bb = } {aa = z bb = }} # Related to [Bug 1671138]; infinite loop with empty var list in bytecompiled # version. test lmap-7.5 {compiled empty var list} -returnCodes error -body { proc foo {} { lmap {} x { error "reached body" } } foo } -cleanup { catch {rename foo ""} } -result {lmap varlist is empty} test lmap-7.6 {lmap: related to "foreach" [Bug 1671087]} -setup { proc demo {} { set vals {1 2 3 4} trace add variable x write {string length $vals ;# } lmap {x y} $vals {format $y} } } -body { demo } -cleanup { rename demo {} } -result {2 4} # Huge lists must not overflow the bytecode interpreter (development bug) test lmap-7.7 {huge list non-compiled} -setup { unset -nocomplain a b x } -body { set x [lmap a [lrepeat 1000000 x] { set b y$a }] list $b [llength $x] [string length $x] } -result {yx 1000000 2999999} test lmap-7.8 {huge list compiled} -setup { unset -nocomplain a b x } -body { set x [apply {{times} { global b lmap a [lrepeat $times x] { set b Y$a } }} 1000000] list $b [llength $x] [string length $x] } -result {Yx 1000000 2999999} test lmap-7.9 {error then dereference loop var (dev bug)} { catch { lmap a 0 b {1 2 3} { error x } } set a } 0 test lmap-7.9a {error then dereference loop var (dev bug)} { catch { lmap a 0 b {1 2 3} { incr a $b; error x } } set a } 1 # ----- Coroutines ----------------------------------------------------------- test lmap-8.1 {lmap non-compiled with coroutines} -body { coroutine coro apply {{} { set values [yield [info coroutine]] eval lmap i [list $values] {{ yield $i }} }} ;# returns 'coro' coro {a b c d e f} ;# -> a coro 1 ;# -> b coro 2 ;# -> c coro 3 ;# -> d coro 4 ;# -> e coro 5 ;# -> f list [coro 6] [info commands coro] } -cleanup { catch {rename coro ""} } -result {{1 2 3 4 5 6} {}} test lmap-8.2 {lmap compiled with coroutines} -body { coroutine coro apply {{} { set values [yield [info coroutine]] lmap i $values { yield $i } }} ;# returns 'coro' coro {a b c d e f} ;# -> a coro 1 ;# -> b coro 2 ;# -> c coro 3 ;# -> d coro 4 ;# -> e coro 5 ;# -> f list [coro 6] [info commands coro] } -cleanup { catch {rename coro ""} } -result {{1 2 3 4 5 6} {}} # cleanup unset -nocomplain a x catch {rename foo {}} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/llength.test0000644000175000017500000000235415104661341015253 0ustar sergeisergei# Commands covered: llength # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test llength-1.1 {length of list} { llength {a b c d} } 4 test llength-1.2 {length of list} { llength {a b c {a b {c d}} d} } 5 test llength-1.3 {length of list} { llength {} } 0 test llength-2.1 {error conditions} { list [catch {llength} msg] $msg } {1 {wrong # args: should be "llength list"}} test llength-2.2 {error conditions} { list [catch {llength 123 2} msg] $msg } {1 {wrong # args: should be "llength list"}} test llength-2.3 {error conditions} { list [catch {llength "a b c \{"} msg] $msg } {1 {unmatched open brace in list}} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/listRep.test0000644000175000017500000030242215104661341015237 0ustar sergeisergei# This file contains tests that specifically exercise the internal representation # of a list. # # Copyright © 2022 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Unlike the other files related to list commands which for the most part do # black box testing focusing on functionality, this file does more of white box # testing to exercise code paths that implement different list representations # (with spans, leading free space etc., shared/unshared etc.) In addition to # functional correctness, the tests also check for the expected internal # representation as that pertains to performance heuristics. Generally speaking, # combinations of the following need to be tested, # - free space in front, back, neither, both of list representation # - shared Tcl_Objs # - shared internal reps (independent of shared Tcl_Objs) # - byte-compiled vs non-compiled # # Being white box tests, they are sensitive to changes to further optimizations # and changes in heuristics. That cannot be helped. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testlistrep [llength [info commands testlistrep]] proc describe {l args} {dict get [testlistrep describe $l] {*}$args} proc irange {first last} { set l {} while {$first <= $last} { lappend l $first incr first } return $l } proc leadSpace {l} { # Returns the leading space in a list store return [dict get [describe $l] store firstUsed] } proc tailSpace {l} { # Returns the trailing space in a list store array set rep [describe $l] dict with rep(store) { return [expr {$numAllocated - ($firstUsed + $numUsed)}] } } proc allocated {l} { # Returns the allocated space in a list store return [dict get [describe $l] store numAllocated] } proc repStoreRefCount {l} { # Returns the ref count for the list store return [dict get [describe $l] store refCount] } proc validate {l} { # Panics if internal listrep structures are not valid testlistrep validate $l } proc leadSpaceMore {l} { set leadSpace [leadSpace $l] expr {$leadSpace > 0 && $leadSpace >= 2*[tailSpace $l]} } proc tailSpaceMore {l} { set tailSpace [tailSpace $l] expr {$tailSpace > 0 && $tailSpace >= 2*[leadSpace $l]} } proc spaceEqual {l} { # 1 if lead and tail space shared (diff of 1 at most) and more than 0 set leadSpace [leadSpace $l] set tailSpace [tailSpace $l] if {$leadSpace == 0 && $tailSpace == 0} { # At least one must be positive return 0 } set diff [expr {$leadSpace - $tailSpace}] return [expr {$diff >= -1 && $diff <= 1}] } proc storeAddress {l} { return [describe $l store memoryAddress] } proc sameStore {l1 l2} { expr {[storeAddress $l1] == [storeAddress $l2]} } proc hasSpan {l args} { # Returns 1 if list has a span. If args are specified, they are checked with # span values (start and length) array set rep [describe $l] if {![info exists rep(span)]} { return 0 } if {[llength $args] == 0} { return 1; # No need to check values } lassign $args start len if {[dict get $rep(span) spanStart] == $start && [dict get $rep(span) spanLength] == $len} { return 1 } return 0 } proc checkListrep {l listLen numAllocated leadSpace tailSpace {refCount 0}} { # Checks if the internal representation of $l match # passed arguments. Return "" if yes, else error messages. array set rep [testlistrep describe $l] set rep(leadSpace) [dict get $rep(store) firstUsed] set rep(numAllocated) [dict get $rep(store) numAllocated] set rep(tailSpace) [expr { $rep(numAllocated) - ($rep(leadSpace) + [dict get $rep(store) numUsed]) }] set rep(refCount) [dict get $rep(store) refCount] if {[info exists rep(span)]} { set rep(listLen) [dict get $rep(span) spanLength] } else { set rep(listLen) [dict get $rep(store) numUsed] } set errors [list] foreach arg {listLen numAllocated leadSpace tailSpace} { if {$rep($arg) != [set $arg]} { lappend errors "$arg in list representation ($rep($arg)) is not expected value ([set $arg])." } } # Check refCount only if caller has specified it as non-0 if {$refCount && $refCount != $rep(refCount)} { lappend errors "refCount in list representation ($rep(refCount)) is not expected value ($refCount)." } return $errors } proc assertListrep {l listLen numAllocated leadSpace tailSpace {refCount 0}} { # Like check_listrep but raises error set errors [checkListrep $l $listLen $numAllocated $leadSpace $tailSpace $refCount] if {[llength $errors]} { error [join $errors \n] } return } # The default length should be large enough that doubling the allocation will # clearly distinguish free space allocation difference between front and back. # (difference in the two should at least be 2 else we cannot tell if front # or back was favored appropriately) proc freeSpaceNone {{len 8}} {return [testlistrep new $len 0 0]} proc freeSpaceLead {{len 8} {lead 3}} {return [testlistrep new $len $lead 0]} proc freeSpaceTail {{len 8} {tail 3}} {return [testlistrep new $len 0 $tail]} proc freeSpaceBoth {{len 8} {lead 3} {tail 3}} { return [testlistrep new $len $lead $tail] } proc zombieSample {{len 1000} {leadzombies 100} {tailzombies 100}} { # returns an unshared listrep with zombies in front and back # don't combine freespacenone and lrange else zombies are freed set l [freeSpaceNone [expr {$len+$leadzombies+$tailzombies}]] return [lrange $l $leadzombies [expr {$leadzombies+$len-1}]] } # Just ensure above stubs return what's expected if {[testConstraint testlistrep]} { assertListrep [freeSpaceNone] 8 8 0 0 1 assertListrep [freeSpaceLead] 8 11 3 0 1 assertListrep [freeSpaceTail] 8 11 0 3 1 assertListrep [freeSpaceBoth] 8 14 3 3 1 assertListrep [zombieSample] 1000 1200 0 0 1 if {![hasSpan [zombieSample]] || [dict get [testlistrep describe [zombieSample]] span spanStart] == 0} { error "zombieSample span missing or span start is at 0." } } # Define some variables for some indices because the Tcl compiler will do some # operations completely in byte code if indices are literals set zero 0 set one 1 set two 2 set four 4 set end end # # Test sets: # 1.* - unshared internal rep, no spans, with no free space # 2.* - shared internal rep, no spans, with no free space # 3.* - unshared internal rep, spanned # 4.* - shared internal rep, spanned # 5.* - shared Tcl_Obj # 6.* - lists with zombie Tcl_Obj's # # listrep-1.* tests all operate on unshared listreps with no free space test listrep-1.1 { Inserts in front of unshared list with no free space should reallocate with equal free space at front and back -- linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceNone] $zero 99] validate $l list $l [spaceEqual $l] } -result [list {99 0 1 2 3 4 5 6 7} 1] test listrep-1.1.1 { Inserts in front of unshared list with no free space should reallocate with equal free space at front and back -- lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $zero -1 99] validate $l list $l [spaceEqual $l] } -result [list {99 0 1 2 3 4 5 6 7} 1] test listrep-1.2 { Inserts at back of unshared list with no free space should allocate all space at back -- linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceNone] $end 99] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 6 7 99} 0 4] test listrep-1.2.1 { Inserts at back of unshared list with no free space should allocate all space at back -- lset version } -constraints testlistrep -body { set l [freeSpaceNone] lset l $end+1 99 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 6 7 99} 0 4] test listrep-1.2.2 { Inserts at back of unshared list with no free space should allocate all space at back -- lappend version } -constraints testlistrep -body { set l [freeSpaceNone] lappend l 99 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 6 7 99} 0 4] test listrep-1.3 { Inserts in middle of unshared list with no free space should reallocate with equal free space at front and back - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceNone] $four 99] validate $l list $l [spaceEqual $l] } -result [list {0 1 2 3 99 4 5 6 7} 1] test listrep-1.3.1 { Inserts in middle of unshared list with no free space should reallocate with equal free space at front and back - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $four $four-1 99] validate $l list $l [spaceEqual $l] } -result [list {0 1 2 3 99 4 5 6 7} 1] test listrep-1.4 { Deletes from front of small unshared list with no free space should just shift up leaving room at back - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $zero $zero] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {1 2 3 4 5 6 7} 0 1] test listrep-1.4.1 { Deletes from front of small unshared list with no free space should just shift up leaving room at back - lassign version } -constraints testlistrep -body { set l [lassign [freeSpaceNone] e] validate $l list $e $l [leadSpace $l] [tailSpace $l] } -result [list 0 {1 2 3 4 5 6 7} 0 1] test listrep-1.4.2 { Deletes from front of small unshared list with no free space should just shift up leaving room at back - lpop version } -constraints testlistrep -body { set l [freeSpaceNone] set e [lpop l $zero] validate $l list $e $l [leadSpace $l] [tailSpace $l] } -result [list 0 {1 2 3 4 5 6 7} 0 1] test listrep-1.4.3 { Deletes from front of small unshared list with no free space should just shift up leaving room at back - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceNone] $one $end] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {1 2 3 4 5 6 7} 0 1] test listrep-1.4.4 { Deletes from front of small unshared list with no free space should just shift up leaving room at back - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceNone] $zero] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {1 2 3 4 5 6 7} 0 1] test listrep-1.5 { Deletes from front of large unshared list with no free space should create a span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone 1000] $zero $one] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 2 998] } -result [list [irange 2 999] 2 0 1] test listrep-1.5.1 { Deletes from front of large unshared list with no free space should create a span - lassign version } -constraints testlistrep -body { set l [lassign [freeSpaceNone 1000] e] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 1 999] } -result [list 0 [irange 1 999] 1 0 1] test listrep-1.5.2 { Deletes from front of large unshared list with no free space should create a span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceNone 1000] $two end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 2 998] } -result [list [irange 2 999] 2 0 1] test listrep-1.5.3 { Deletes from front of large unshared list with no free space should create a span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceNone 1000] $zero] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 1 999] } -result [list [irange 1 999] 1 0 1] test listrep-1.5.4 { Deletes from front of large unshared list with no free space should create a span - lpop version } -constraints testlistrep -body { set l [freeSpaceNone 1000] set e [lpop l 0] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 1 999] } -result [list 0 [irange 1 999] 1 0 1] test listrep-1.6 { Deletes closer to front of large list should move (smaller) front segment -- lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone 1000] $four $four] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 1 999] } -result [list [concat [irange 0 3] [irange 5 999]] 1 0 1] test listrep-1.6.1 { Deletes closer to front of large list should move (smaller) front segment -- lpop version } -constraints testlistrep -body { set l [freeSpaceNone 1000] set e [lpop l $four] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 1 999] } -result [list 4 [concat [irange 0 3] [irange 5 999]] 1 0 1] test listrep-1.7 { Deletes closer to back of large list should move (smaller) back segment and will not need a span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone 1000] end-$four end-$four] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list [concat [irange 0 994] [irange 996 999]] 0 1 0] test listrep-1.7.1 { Deletes closer to back of large list should move (smaller) back segment and will not need a span - lpop version } -constraints testlistrep -body { set l [freeSpaceNone 1000] set e [lpop l $end-4] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list 995 [concat [irange 0 994] [irange 996 999]] 0 1 0] test listrep-1.8 { Deletes at back of small unshared list should not need a span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] end-$one end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5} 0 2 0] test listrep-1.8.1 { Deletes at back of small unshared list should not need a span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceNone] $zero end-$two] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5} 0 2 0] test listrep-1.8.2 { Deletes at back of small unshared list should not need a span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceNone] $end-1 $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5} 0 2 0] test listrep-1.8.3 { Deletes at back of small unshared list should not need a span - lpop version } -constraints testlistrep -body { set l [freeSpaceNone] set e [lpop l $end] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list 7 {0 1 2 3 4 5 6} 0 1 0] test listrep-1.9 { Deletes at back of large unshared list should not need a span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone 1000] end-$four end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list [irange 0 994] 0 5 0] test listrep-1.9.1 { Deletes at back of large unshared list should not need a span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceNone 1000] 0 $end-5] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list [irange 0 994] 0 5 0] test listrep-1.9.2 { Deletes at back of large unshared list should not need a span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceNone 1000] end-$four $end-3 end-$two $end-1 $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list [irange 0 994] 0 5 0] test listrep-1.9.3 { Deletes at back of large unshared list should not need a span - lpop version } -constraints testlistrep -body { set l [freeSpaceNone 1000] set e [lpop l $end] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list 999 [irange 0 998] 0 1 0] test listrep-1.10 { no-op on unshared list should force a canonical list string - lreplace version } -body { lreplace { 1 2 3 4 } $zero -1 } -result {1 2 3 4} test listrep-1.10.1 { no-op on unshared list should force a canonical list string - lrange version } -body { lrange { 1 2 3 4 } $zero $end } -result {1 2 3 4} test listrep-1.11 { Append elements to large unshared list is optimized as lappend so no free space in front - lreplace version } -constraints testlistrep -body { # Note $end, not end else byte code compiler short-cuts set l [lreplace [freeSpaceNone 1000] $end+1 $end+1 1000] validate $l list $l [leadSpace $l] [expr {[tailSpace $l] > 0}] [hasSpan $l] } -result [list [irange 0 1000] 0 1 0] test listrep-1.11.1 { Append elements to large unshared list is optimized as lappend so no free space in front - linsert version } -constraints testlistrep -body { # Note $end, not end else byte code compiler short-cuts set l [linsert [freeSpaceNone 1000] $end+1 1000] validate $l list $l [leadSpace $l] [expr {[tailSpace $l] > 0}] [hasSpan $l] } -result [list [irange 0 1000] 0 1 0] test listrep-1.11.2 { Append elements to large unshared list leaves no free space in front - lappend version } -constraints testlistrep -body { # Note $end, not end else byte code compiler short-cuts set l [freeSpaceNone 1000] lappend l 1000 1001 validate $l list $l [leadSpace $l] [expr {[tailSpace $l] > 0}] [hasSpan $l] } -result [list [irange 0 1001] 0 1 0] test listrep-1.12 { Replacement of elements at front with same number elements in unshared list is in-place - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $zero $one 10 11] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {10 11 2 3 4 5 6 7} 0 0] test listrep-1.12.1 { Replacement of elements at front with same number elements in unshared list is in-place - lset version } -constraints testlistrep -body { set l [freeSpaceNone] lset l 0 -1 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {-1 1 2 3 4 5 6 7} 0 0] test listrep-1.13 { Replacement of elements at front with fewer elements in unshared list results in a spanned list with space only in front } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $zero $four 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {10 5 6 7} 4 0] test listrep-1.14 { Replacement of elements at front with more elements in unshared list results in a reallocated spanned list with space at front and back } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $zero $one 10 11 12] validate $l list $l [spaceEqual $l] } -result [list {10 11 12 2 3 4 5 6 7} 1] test listrep-1.15 { Replacement of elements in middle with same number elements in unshared list is in-place - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $one $two 10 11] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 10 11 3 4 5 6 7} 0 0] test listrep-1.15.1 { Replacement of elements in middle with same number elements in unshared list is in-place - lset version } -constraints testlistrep -body { set l [freeSpaceNone] lset l $two -1 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 -1 3 4 5 6 7} 0 0] test listrep-1.16 { Replacement of elements in front half with fewer elements in unshared list results in a spanned list with space only in front since smaller segment moved } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $one $four 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 10 5 6 7} 3 0] test listrep-1.17 { Replacement of elements in back half with fewer elements in unshared list results in a spanned list with space only at back } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] end-$four end-$one 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 10 7} 0 3] test listrep-1.18 { Replacement of elements in middle more elements in unshared list results in a reallocated spanned list with space at front and back } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $one $two 10 11 12] validate $l list $l [spaceEqual $l] } -result [list {0 10 11 12 3 4 5 6 7} 1] test listrep-1.19 { Replacement of elements at back with same number elements in unshared list is in-place - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $end-1 $end 10 11] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 10 11} 0 0] test listrep-1.19.1 { Replacement of elements at back with same number elements in unshared list is in-place - lset version } -constraints testlistrep -body { set l [freeSpaceNone] lset l $end 10 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 6 10} 0 0] test listrep-1.20 { Replacement of elements at back with fewer elements in unshared list is in-place with space only at the back } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $end-2 $end 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 10} 0 2] test listrep-1.21 { Replacement of elements at back with more elements in unshared list allocates new representation with equal space at front and back } -constraints testlistrep -body { set l [lreplace [freeSpaceNone] $end-1 $end 10 11 12] validate $l list $l [spaceEqual $l] } -result [list {0 1 2 3 4 5 10 11 12} 1] # # listrep-2.* tests all operate on shared list reps with no free space. Note the # *list internal rep* must be shared, not only the Tcl_Obj so just assigning to # another variable does not suffice. The lrange construct on an variable's value # will do the needful. test listrep-2.1 { Inserts in front of shared list with no free space should reallocate with more leading space in front - linsert version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [linsert $b $zero 99] validate $l list [repStoreRefCount $b] $l [leadSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {99 0 1 2 3 4 5 6 7} 1 1] test listrep-2.1.1 { Inserts in front of shared list with no free space should reallocate with more leading space in front - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero -1 99] validate $l list [repStoreRefCount $b] $l [leadSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {99 0 1 2 3 4 5 6 7} 1 1] test listrep-2.2 { Inserts at back of shared list with no free space should reallocate with more leading space in back - linsert version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [linsert $b $end 99] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5 6 7 99} 1 1] test listrep-2.2.1 { Inserts at back of shared list with no free space should reallocate with more leading space in back - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $end+1 end+$one 99] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5 6 7 99} 1 1] test listrep-2.2.2 { Inserts at back of shared list with no free space should reallocate with more leading space in back - lappend version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lappend b 99] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 1 {0 1 2 3 4 5 6 7 99} 1 1] test listrep-2.2.3 { Inserts at back of shared list with no free space should reallocate with more leading space in back - lset version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lset b $end+1 99] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 1 {0 1 2 3 4 5 6 7 99} 1 1] test listrep-2.3 { Inserts in middle of shared list with no free space should reallocate with equal spacing - linsert version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [linsert $b $four 99] validate $l list [repStoreRefCount $b] $l [spaceEqual $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 99 4 5 6 7} 1 1] test listrep-2.3.1 { Inserts in middle of shared list with no free space should reallocate with equal spacing - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $four $four-1 99] validate $l list [repStoreRefCount $b] $l [spaceEqual $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 99 4 5 6 7} 1 1] test listrep-2.4 { Deletes from front of small shared list with no free space should allocate new list of exact size - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero $zero] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {1 2 3 4 5 6 7} 0 0 1] test listrep-2.4.1 { Deletes from front of small shared list with no free space should allocate new list of exact size - lremove version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lremove $b $zero $one] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {2 3 4 5 6 7} 0 0 1] test listrep-2.4.2 { Deletes from front of small shared list with no free space should allocate new list of exact size - lrange version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lrange $b $one $end] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {1 2 3 4 5 6 7} 0 0 1] test listrep-2.4.3 { Deletes from front of small shared list with no free space should allocate new list of exact size - lassign version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lassign $b e] validate $l list $e [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 0 2 {1 2 3 4 5 6 7} 0 0 1] test listrep-2.4.4 { Deletes from front of small shared list with no free space should allocate new list of exact size - lpop version } -constraints testlistrep -body { set a [freeSpaceNone] set l [lrange $a $zero end]; # Ensure shared listrep set e [lpop l $zero] validate $l list $e $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 0 {1 2 3 4 5 6 7} 0 0 1] test listrep-2.5 { Deletes from front of large shared list with no free space should create span - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero $zero] validate $l # The listrep store should be shared among a, b, l (3 refs) list [sameStore $b $l] [repStoreRefCount $b] $l [hasSpan $l] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 1 3 [irange 1 999] 1 0 0 3] test listrep-2.5.1 { Deletes from front of large shared list with no free space should create span - lremove version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lremove $b $zero $one] validate $l # The listrep store should be shared among a, b, l (3 refs) list [sameStore $b $l] [repStoreRefCount $b] $l [hasSpan $l] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 1 3 [irange 2 999] 1 0 0 3] test listrep-2.5.2 { Deletes from front of large shared list with no free space should create span - lrange version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lrange $b $two $end] validate $l # The listrep store should be shared among a, b, l (3 refs) list [sameStore $b $l] [repStoreRefCount $b] $l [hasSpan $l] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 1 3 [irange 2 999] 1 0 0 3] test listrep-2.5.3 { Deletes from front of large shared list with no free space should create span - lassign version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lassign $b e] validate $l # The listrep store should be shared among a, b, l (3 refs) list $e [sameStore $b $l] [repStoreRefCount $b] $l [hasSpan $l] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 0 1 3 [irange 1 999] 1 0 0 3] test listrep-2.5.4 { Deletes from front of large shared list with no free space should create span - lpop version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set l [lrange $a $zero end]; # Ensure shared listrep set e [lpop l $zero] validate $l # The listrep store should be shared among a, b, l (3 refs) list $e $l [hasSpan $l] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 0 [irange 1 999] 1 0 0 2] test listrep-2.6 { Deletes from back of small shared list with no free space should allocate new list of exact size - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $end $end] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5 6} 0 0 1] test listrep-2.6.1 { Deletes from back of small shared list with no free space should allocate new list of exact size - lremove version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lremove $b $end $end-1] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5} 0 0 1] test listrep-2.6.2 { Deletes from back of small shared list with no free space should allocate new list of exact size - lrange version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lrange $b $zero $end-1] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5 6} 0 0 1] test listrep-2.6.3 { Deletes from back of small shared list with no free space should allocate new list of exact size - lpop version } -constraints testlistrep -body { set a [freeSpaceNone] set l [lrange $a $zero end]; # Ensure shared listrep set e [lpop l] validate $l list $e $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 7 {0 1 2 3 4 5 6} 0 0 1] test listrep-2.7 { Deletes from back of large shared list with no free space should use a span - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $end $end] validate $l # Note lead and tail space is 0 because original list store in a,b is used list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 3 [irange 0 998] 0 0 3] test listrep-2.7.1 { Deletes from back of large shared list with no free space should use a span - lremove version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lremove $b $end-1 $end] validate $l # Note lead and tail space is 0 because original list store in a,b is used list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 3 [irange 0 997] 0 0 3] test listrep-2.7.2 { Deletes from back of large shared list with no free space should use a span - lrange version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lrange $b $zero $end-1] validate $l # Note lead and tail space is 0 because original list store in a,b is used list [repStoreRefCount $b] $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 3 [irange 0 998] 0 0 3] test listrep-2.7.3 { Deletes from back of large shared list with no free space should use a span - lpop version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set l [lrange $a $zero end]; # Ensure shared listrep set e [lpop l] validate $l # Note lead and tail space is 0 because original list store in a,b is used list $e $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 999 [irange 0 998] 0 0 2] test listrep-2.8 { no-op on shared list should force a canonical list representation with original unchanged - lreplace version } -body { set l { 1 2 3 4 } list [lreplace $l $zero -1] $l } -result [list {1 2 3 4} { 1 2 3 4 }] test listrep-2.8.1 { no-op on shared list should force a canonical list representation with original unchanged - lrange version } -body { set l { 1 2 3 4 } list [lrange $l $zero end] $l } -result [list {1 2 3 4} { 1 2 3 4 }] test listrep-2.9 { Appends to back of large shared list with no free space allocates new list with space only at the back - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $end+1 $end+1 1000] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [expr {[tailSpace $l]>0}] [repStoreRefCount $l] } -result [list 2 [irange 0 1000] 0 1 1] test listrep-2.9.1 { Appends to back of large shared list with no free space allocates new list with space only at the back - linsert version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set b [lrange $a $zero end]; # Ensure shared listrep set l [linsert $b $end+1 1000 1001] validate $l list [repStoreRefCount $b] $l [leadSpace $l] [expr {[tailSpace $l]>0}] [repStoreRefCount $l] } -result [list 2 [irange 0 1001] 0 1 1] test listrep-2.9.2 { Appends to back of large shared list with no free space allocates new list with space only at the back - lappend version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set l [lrange $a $zero end]; # Ensure shared listrep lappend l 1000 validate $l list $l [leadSpace $l] [expr {[tailSpace $l]>0}] [repStoreRefCount $l] } -result [list [irange 0 1000] 0 1 1] test listrep-2.9.3 { Appends to back of large shared list with no free space allocates new list with space only at the back - lset version } -constraints testlistrep -body { set a [freeSpaceNone 1000] set l [lrange $a $zero end]; # Ensure shared listrep lset l $end+1 1000 validate $l list $l [leadSpace $l] [expr {[tailSpace $l]>0}] [repStoreRefCount $l] } -result [list [irange 0 1000] 0 1 1] test listrep-2.10 { Replacement of elements at front with same number in shared list results in a new list store with more space in front than back - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero $one 10 11] validate $l list [repStoreRefCount $b] $l [leadSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {10 11 2 3 4 5 6 7} 1 1] test listrep-2.10.1 { Replacement of elements at front with same number in shared list results in a new list store with no extra space - lset version } -constraints testlistrep -body { set a [freeSpaceNone] set l [lrange $a $zero end]; # Ensure shared listrep lset l $zero 10 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {10 1 2 3 4 5 6 7} 0 0 1] test listrep-2.11 { Replacement of elements at front with fewer elements in shared list results in a new list store with more space in front than back } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero $four 10] validate $l list [repStoreRefCount $b] $l [leadSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {10 5 6 7} 1 1] test listrep-2.12 { Replacement of elements at front with more elements in shared list results in a new spanned list with more space in front } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $zero $one 10 11 12] validate $l list [repStoreRefCount $b] $l [leadSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {10 11 12 2 3 4 5 6 7} 1 1] test listrep-2.13 { Replacement of elements in middle with same number in shared list results in a new list store with equal space in front and back - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $one $two 10 11] validate $l list [repStoreRefCount $b] $l [spaceEqual $l] [repStoreRefCount $l] } -result [list 2 {0 10 11 3 4 5 6 7} 1 1] test listrep-2.13.1 { Replacement of elements in middle with same number in shared list results in a new list store with exact allocation - lset version } -constraints testlistrep -body { set a [freeSpaceNone] set l [lrange $a $zero end]; # Ensure shared listrep lset l $one 10 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 10 2 3 4 5 6 7} 0 0 1] test listrep-2.14 { Replacement of elements in middle with fewer elements in shared list results in a new list store with equal space } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $one 5 10] validate $l list [repStoreRefCount $b] $l [spaceEqual $l] [repStoreRefCount $l] } -result [list 2 {0 10 6 7} 1 1] test listrep-2.15 { Replacement of elements in middle with more elements in shared list results in a new spanned list with space in front and back } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b $one $two 10 11 12] validate $l list [repStoreRefCount $b] $l [spaceEqual $l] [repStoreRefCount $l] } -result [list 2 {0 10 11 12 3 4 5 6 7} 1 1] test listrep-2.16 { Replacement of elements at back with same number in shared list results in a new list store with more space in back than front - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b end-$one $end 10 11] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 3 4 5 10 11} 1 1] test listrep-2.16.1 { Replacement of elements at back with same number in shared list results in a new list store with no extra - lreplace version } -constraints testlistrep -body { set a [freeSpaceNone] set l [lrange $a $zero end]; # Ensure shared listrep lset l $end 10 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 10} 0 0 1] test listrep-2.17 { Replacement of elements at back with fewer elements in shared list results in a new list store with more space in back than front } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b end-$four $end 10] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 10} 1 1] test listrep-2.18 { Replacement of elements at back with more elements in shared list results in a new list store with more space in back than front } -constraints testlistrep -body { set a [freeSpaceNone] set b [lrange $a $zero end]; # Ensure shared listrep set l [lreplace $b end-$four $end 10] validate $l list [repStoreRefCount $b] $l [tailSpaceMore $l] [repStoreRefCount $l] } -result [list 2 {0 1 2 10} 1 1] # # listrep-3.* - tests on unshared spanned listreps test listrep-3.1 { Inserts in front of unshared spanned list with room in front should just shrink the lead space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth] $zero -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -2 7] 1 3 1] test listrep-3.1.1 { Inserts in front of unshared spanned list with room in front should just shrink the lead space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $zero -1 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -2 7] 1 3 1] test listrep-3.2 { Inserts in front of unshared spanned list with insufficient room in front but enough total freespace should redistribute free space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 10] $zero -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -2 7] 5 4 1] test listrep-3.2.1 { Inserts in front of unshared spanned list with insufficient room in front but enough total freespace should redistribute free space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 10] $zero -1 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -2 7] 5 4 1] test listrep-3.3 { Inserts in front of unshared spanned list with insufficient total freespace should reallocate with equal free space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 1] $zero -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -3 7] 3 2 1] test listrep-3.3.1 { Inserts in front of unshared spanned list with insufficient total freespace should reallocate with equal free space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $zero -1 -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange -3 7] 3 2 1] test listrep-3.4 { Inserts at back of unshared spanned list with room at back should not reallocate - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth] $end 8] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 8] 3 2 1] test listrep-3.4.1 { Inserts at back of unshared spanned list with room at back should not reallocate - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end+1 $end+1 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 9] 3 1 1] test listrep-3.4.2 { Inserts at back of unshared spanned list with room at back should not reallocate - lappend version } -constraints testlistrep -body { set l [freeSpaceBoth] lappend l 8 9 10 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 10] 3 0 1] test listrep-3.4.3 { Inserts at back of unshared spanned list with room at back should not reallocate - lset version } -constraints testlistrep -body { set l [freeSpaceBoth] lset l $end+1 8 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 8] 3 2 1] test listrep-3.5 { Inserts at back of unshared spanned list with insufficient room in back but enough total freespace should redistribute free space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 10 1] $end 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 9] 5 4 1] test listrep-3.5.1 { Inserts at back of unshared spanned list with insufficient room in back but enough total freespace should redistribute free space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 10 1] $end+1 $end+1 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 9] 5 4 1] test listrep-3.5.2 { Inserts at back of unshared spanned list with insufficient room in back but enough total freespace should redistribute free space - lappend version } -constraints testlistrep -body { set l [freeSpaceBoth 8 10 1] lappend l 8 9 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 9] 5 4 1] test listrep-3.5.3 { Inserts at back of unshared spanned list with insufficient room in back but enough total freespace should redistribute free space - lset version } -constraints testlistrep -body { set l [freeSpaceBoth 8 10 0] lset l $end+1 8 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 8] 5 4 1] test listrep-3.6 { Inserts in back of unshared spanned list with insufficient total freespace should reallocate with all *additional* space at back. Note this differs from the insert in front case because here we realloc(). - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 1] $end 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 10] 1 4 1] test listrep-3.6.1 { Inserts in back of unshared spanned list with insufficient total freespace should reallocate with all *additional* space at back. Note this differs from the insert in front case because here we realloc() - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $end+1 $end+1 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 10] 1 4 1] test listrep-3.6.2 { Inserts in back of unshared spanned list with insufficient total freespace should reallocate with all *additional* space at back. Note this differs from the insert in front case because here we realloc() - lappend version } -constraints testlistrep -body { set l [freeSpaceBoth 8 1 1] lappend l 8 9 10 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 10] 1 4 1] test listrep-3.6.3 { Inserts in back of unshared spanned list with insufficient total freespace should reallocate with all *additional* space at back. Note this differs from the insert in front case because here we realloc() - lset version } -constraints testlistrep -body { set l [freeSpaceNone] lset l $end+1 8 validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 0 8] 0 4 1] test listrep-3.7 { Inserts in front half of unshared spanned list with room in front should not reallocate and should move front segment } -constraints testlistrep -body { set l [linsert [freeSpaceBoth] $one -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -2 -1 1 2 3 4 5 6 7} 1 3 1] test listrep-3.8 { Inserts in front half of unshared spanned list with insufficient leading space but with enough tail space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 5] $one -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -2 -1 1 2 3 4 5 6 7} 1 3 1] test listrep-3.8.1 { Inserts in front half of unshared spanned list with insufficient leading space but with enough tail space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 5] $one -1 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -2 -1 1 2 3 4 5 6 7} 1 3 1] test listrep-3.9 { Inserts in front half of unshared spanned list with sufficient total free space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 2 2] $one -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -3 -2 -1 1 2 3 4 5 6 7} 0 1 1] test listrep-3.9.1 { Inserts in front half of unshared spanned list with sufficient total free space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 2 2] $one -1 -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -3 -2 -1 1 2 3 4 5 6 7} 0 1 1] test listrep-3.10 { Inserts in front half of unshared spanned list with insufficient total space. Note use of realloc() means new space will be at the back - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 1] $one -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -3 -2 -1 1 2 3 4 5 6 7} 1 4 1] test listrep-3.10.1 { Inserts in front half of unshared spanned list with insufficient total space. Note use of realloc() means new space will be at the back - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $one -1 -3 -2 -1] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 -3 -2 -1 1 2 3 4 5 6 7} 1 4 1] test listrep-3.11 { Inserts in back half of unshared spanned list with room in back should not reallocate and should move back segment - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth] $end-$one 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 7} 3 1 1] test listrep-3.11.1 { Inserts in back half of unshared spanned list with room in back should not reallocate and should move back segment - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end -1 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 7} 3 1 1] test listrep-3.12 { Inserts in back half of unshared spanned list with insufficient tail space but with enough leading space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 5 1] $end-$one 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 7} 3 1 1] test listrep-3.12.1 { Inserts in back half of unshared spanned list with insufficient tail space but with enough leading space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 5 1] $end -1 8 9] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 7} 3 1 1] test listrep-3.13 { Inserts in back half of unshared spanned list with sufficient total free space - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 2 2] $end-$one 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 10 7} 0 1 1] test listrep-3.13.1 { Inserts in back half of unshared spanned list with sufficient total free space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 2 2] $end -1 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 10 7} 0 1 1] test listrep-3.14 { Inserts in back half of unshared spanned list with insufficient total space. Note use of realloc() means new space will be at the back - linsert version } -constraints testlistrep -body { set l [linsert [freeSpaceBoth 8 1 1] $end-$one 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 10 7} 1 4 1] test listrep-3.14.1 { Inserts in back half of unshared spanned list with insufficient total space. Note use of realloc() means new space will be at the back - lrepalce version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $end -1 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {0 1 2 3 4 5 6 8 9 10 7} 1 4 1] test listrep-3.15 { Deletes from front of small unshared span list results in elements moved up front and span removal - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $zero $zero] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {1 2 3 4 5 6 7} 0 7 0] test listrep-3.15.1 { Deletes from front of small unshared span list results in elements moved up front and span removal - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth] $zero $one] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {2 3 4 5 6 7} 0 8 0] test listrep-3.15.2 { Deletes from front of small unshared span list results in elements moved up front and span removal - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceBoth] $one $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {1 2 3 4 5 6 7} 0 7 0] test listrep-3.15.3 { Deletes from front of small unshared span list results in elements moved up front and span removal - lassign version } -constraints testlistrep -body { set l [lassign [freeSpaceBoth] e] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list 0 {1 2 3 4 5 6 7} 0 7 0] test listrep-3.15.4 { Deletes from front of small unshared span list results in elements moved up front and span removal - lpop version } -constraints testlistrep -body { set l [freeSpaceBoth] set e [lpop l $zero] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {1 2 3 4 5 6 7} 0 7 0] test listrep-3.16 { Deletes from front of large unshared span list results in another span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 1000 10 10] $zero $one] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 12 998] } -result [list [irange 2 999] 12 10 1] test listrep-3.16.1 { Deletes from front of large unshared span list results in another span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth 1000 10 10] $zero $one] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 12 998] } -result [list [irange 2 999] 12 10 1] test listrep-3.16.2 { Deletes from front of large unshared span list results in another span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceBoth 1000 10 10] $two $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 12 998] } -result [list [irange 2 999] 12 10 1] test listrep-3.16.3 { Deletes from front of large unshared span list results in another span - lassign version } -constraints testlistrep -body { set l [lassign [freeSpaceBoth 1000 10 10] e] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 11 999] } -result [list 0 [irange 1 999] 11 10 1] test listrep-3.16.4 { Deletes from front of large unshared span list results in another span - lpop version } -constraints testlistrep -body { set l [freeSpaceBoth 1000 10 10] set e [lpop l $zero] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 11 999] } -result [list 0 [irange 1 999] 11 10 1] test listrep-3.17 { Deletes from back of small unshared span list results in new store without span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5 6} 0 7 0] test listrep-3.17.1 { Deletes from back of small unshared span list results in new store without span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth] $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5 6} 0 7 0] test listrep-3.17.2 { Deletes from back of small unshared span list results in new store without span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceBoth] $zero $end-1] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list {0 1 2 3 4 5 6} 0 7 0] test listrep-3.17.3 { Deletes from back of small unshared span list results in new store without span - lpop version } -constraints testlistrep -body { set l [freeSpaceBoth] set e [lpop l] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l] } -result [list 7 {0 1 2 3 4 5 6} 0 7 0] test listrep-3.18 { Deletes from back of large unshared span list results in another span - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 1000 10 10] $end-1 $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 998] } -result [list [irange 0 997] 10 12 1] test listrep-3.18.1 { Deletes from back of large unshared span list results in another span - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth 1000 10 10] $end-1 $end] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 998] } -result [list [irange 0 997] 10 12 1] test listrep-3.18.2 { Deletes from back of large unshared span list results in another span - lrange version } -constraints testlistrep -body { set l [lrange [freeSpaceBoth 1000 10 10] $zero $end-2] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 998] } -result [list [irange 0 997] 10 12 1] test listrep-3.18.3 { Deletes from back of large unshared span list results in another span - lpop version } -constraints testlistrep -body { set l [freeSpaceBoth 1000 10 10] set e [lpop l] validate $l list $e $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 999] } -result [list 999 [irange 0 998] 10 11 1] test listrep-3.19 { Deletes from front half of small unshared span list results in movement of smaller front segment - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $one $two] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 5 6] } -result [list {0 3 4 5 6 7} 5 3 1] test listrep-3.19.1 { Deletes from front half of small unshared span list results in movement of smaller front segment - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth] $one $two] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 5 6] } -result [list {0 3 4 5 6 7} 5 3 1] test listrep-3.20 { Deletes from front half of large unshared span list results in movement of smaller front segment - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 1000 10 10] $one $two] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 12 998] } -result [list [list 0 {*}[irange 3 999]] 12 10 1] test listrep-3.20.1 { Deletes from front half of large unshared span list results in movement of smaller front segment - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth 1000 10 10] $one $two] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 12 998] } -result [list [list 0 {*}[irange 3 999]] 12 10 1] test listrep-3.21 { Deletes from back half of small unshared span list results in movement of smaller back segment - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-2 $end-1] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 3 6] } -result [list {0 1 2 3 4 7} 3 5 1] test listrep-3.21.1 { Deletes from back half of small unshared span list results in movement of smaller back segment - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth] $end-2 $end-1] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 3 6] } -result [list {0 1 2 3 4 7} 3 5 1] test listrep-3.22 { Deletes from back half of large unshared span list results in movement of smaller back segment - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 1000 10 10] $end-2 $end-1] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 998] } -result [list [list {*}[irange 0 996] 999] 10 12 1] test listrep-3.22.1 { Deletes from back half of large unshared span list results in movement of smaller back segment - lremove version } -constraints testlistrep -body { set l [lremove [freeSpaceBoth 1000 10 10] $end-2 $end-1] validate $l list $l [leadSpace $l] [tailSpace $l] [hasSpan $l 10 998] } -result [list [list {*}[irange 0 996] 999] 10 12 1] test listrep-3.23 { Replacement of elements at front with same number elements in unshared spanned list is in-place - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $zero $one 10 11] list $l [leadSpace $l] [tailSpace $l] } -result [list {10 11 2 3 4 5 6 7} 3 3] test listrep-3.23.1 { Replacement of elements at front with same number elements in unshared spanned list is in-place - lset version } -constraints testlistrep -body { set l [freeSpaceBoth] lset l $zero 10 list $l [leadSpace $l] [tailSpace $l] } -result [list {10 1 2 3 4 5 6 7} 3 3] test listrep-3.24 { Replacement of elements at front with fewer elements in unshared spanned list expands leading space - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $zero $four 10] list $l [leadSpace $l] [tailSpace $l] } -result [list {10 5 6 7} 7 3] test listrep-3.25 { Replacement of elements at front with more elements in unshared spanned list with sufficient leading space shrinks leading space } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $zero $one 10 11 12] list $l [leadSpace $l] [tailSpace $l] } -result [list {10 11 12 2 3 4 5 6 7} 2 3] test listrep-3.26 { Replacement of elements at front with more elements in unshared spanned list with insufficient leading space but sufficient total free space } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 10] $zero $one 10 11 12 13] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {10 11 12 13 2 3 4 5 6 7} 5 4 1] test listrep-3.27 { Replacement of elements at front in unshared spanned list with insufficient total freespace should reallocate with equal free space } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $zero $one 10 11 12 13 14] validate $l list $l [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list {10 11 12 13 14 2 3 4 5 6 7} 3 2 1] test listrep-3.28 { Replacement of elements at back with same number of elements in unshared spanned list is in-place - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-1 $end 10 11] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 10 11} 3 3] test listrep-3.28.1 { Replacement of elements at back with same number of elements in unshared spanned list is in-place - lset version } -constraints testlistrep -body { set l [freeSpaceBoth] lset l $end 10 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 6 10} 3 3] test listrep-3.29 { Replacement of elements at back with fewer elements in unshared spanned list expands tail space } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-2 $end 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 10} 3 5] test listrep-3.30 { Replacement of elements at back with more elements in unshared spanned list with sufficient tail space shrinks tailspace } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-1 $end 10 11 12] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 10 11 12} 3 2] test listrep-3.31 { Replacement of elements at back with more elements in unshared spanned list with insufficient tail space but enough total free space moves up the span } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 2 2] $end-1 $end 10 11 12 13 14] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 10 11 12 13 14} 0 1] test listrep-3.32 { Replacement of elements at back with more elements in unshared spanned list with insufficient total space reallocates with more room in the tail because of realloc() } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $end-1 $end 10 11 12 13 14] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 10 11 12 13 14} 1 4] test listrep-3.33 { Replacement of elements in the middle in an unshared spanned list with the same number of elements - lreplace version } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $two $four 10 11 12] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 10 11 12 5 6 7} 3 3] test listrep-3.33.1 { Replacement of elements in the middle in an unshared spanned list with the same number of elements - lset version } -constraints testlistrep -body { set l [freeSpaceBoth] lset l $two 10 validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 10 3 4 5 6 7} 3 3] test listrep-3.34 { Replacement of elements in an unshared spanned list with fewer elements in the front half moves the front (smaller) segment } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $two $four 10 11] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 10 11 5 6 7} 4 3] test listrep-3.35 { Replacement of elements in an unshared spanned list with fewer elements in the back half moves the tail (smaller) segment } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-2 $end-1 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 10 7} 3 4] test listrep-3.36 { Replacement of elements in an unshared spanned list with more elements when both front and back have room should move the smaller segment (front case) } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $one $two 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 8 9 10 3 4 5 6 7} 2 3] test listrep-3.37 { Replacement of elements in an unshared spanned list with more elements when both front and back have room should move the smaller segment (back case) } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $end-2 $end-1 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 8 9 10 7} 3 2] test listrep-3.38 { Replacement of elements in an unshared spanned list with more elements when only front has room } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 3 1] $end-1 $end-1 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 1 2 3 4 5 8 9 10 7} 1 1] test listrep-3.39 { Replacement of elements in an unshared spanned list with more elements when only back has room } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 3] $one $one 8 9 10] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 8 9 10 2 3 4 5 6 7} 1 1] test listrep-3.40 { Replacement of elements in an unshared spanned list with more elements when neither send has enough room by itself } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth] $one $one 8 9 10 11 12] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 8 9 10 11 12 2 3 4 5 6 7} 1 1] test listrep-3.41 { Replacement of elements in an unshared spanned list with more elements when there is not enough free space results in new allocation. The back end has more space because of realloc() } -constraints testlistrep -body { set l [lreplace [freeSpaceBoth 8 1 1] $one $one 8 9 10 11 12] validate $l list $l [leadSpace $l] [tailSpace $l] } -result [list {0 8 9 10 11 12 2 3 4 5 6 7} 1 5] # # 4.* - tests on shared spanned lists test listrep-4.1 { Inserts in front of shared spanned list with used elements in lead space creates new list rep with more lead than tail space - linsert version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [linsert $spanl $zero -1] validate $l list $master $spanl $l [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $master] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 999] [irange 2 997] [list -1 {*}[irange 2 997]] 1 1 2 2 1] test listrep-4.1.1 { Inserts in front of shared spanned list with used elements in lead space creates new list rep with more lead than tail space - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $zero -1 -2] validate $l list $master $spanl $l [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $master] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 999] [irange 2 997] [list -2 {*}[irange 2 997]] 1 1 2 2 1] test listrep-4.2 { Inserts in front of shared spanned list with orphaned leading elements allocate a new list rep with more lead than tail space - linsert version TODO - ideally this should garbage collect the orphans and reuse the lead space but that needs a "lprepend" command else the listrep operand is shared and hence orphans cannot be freed } -constraints testlistrep -body { set master [freeSpaceLead 1000 100] set spanl [lrange $master $two $end-2] unset master; # So elements at 0, 1 are not used set l [linsert $spanl $zero -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [list -1 {*}[irange 2 997]] 0 1 1 1 1] test listrep-4.2.1 { Inserts in front of shared spanned list with orphaned leading elements allocate a new list rep with more lead than tail space - lreplace version TODO - ideally this should garbage collect the orphans and reuse the lead space but that needs a "lprepend" command else the listrep operand is shared and hence orphans cannot be freed } -constraints testlistrep -body { set master [freeSpaceLead 1000 100] set spanl [lrange $master $two $end-2] unset master; # So elements at 0, 1 are not used set l [lreplace $spanl $zero -1 -2] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [list -2 {*}[irange 2 997]] 0 1 1 1 1] test listrep-4.3 { Inserts in front of shared spanned list where span is at front of used space reuses the same list store - linsert version } -constraints testlistrep -body { set master [freeSpaceLead 1000 100] set spanl [lrange $master $zero $end-2] set l [linsert $spanl $zero -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpace $l] [tailSpace $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 997] [irange -1 997] 1 99 0 1 3 3] test listrep-4.3.1 { Inserts in front of shared spanned list where span is at front of used space reuses the same list store - lreplace version } -constraints testlistrep -body { set master [freeSpaceLead 1000 100] set spanl [lrange $master $zero $end-2] set l [lreplace $spanl $zero -1 -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpace $l] [tailSpace $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 997] [irange -1 997] 1 99 0 1 3 3] test listrep-4.4 { Inserts in front of shared spanned list where span is at front of used space allocates new listrep if lead space insufficient even if total free space is sufficient. New listrep should have more lead space than tail space. - linsert version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $zero $end-2] set l [linsert $spanl $zero -3 -2 -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 997] [irange -3 997] 0 1 1 2 1] test listrep-4.4.1 { Inserts in front of shared spanned list where span is at front of used space allocates new listrep if lead space insufficient even if total free space is sufficient. New listrep should have more lead space than tail space. - lreplace version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $zero $end-2] set l [lreplace $spanl $zero -1 -3 -2 -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 0 997] [irange -3 997] 0 1 1 2 1] test listrep-4.5 { Inserts in back of shared spanned list where span is at end of used space still allocates a new listrep and trailing space is more than leading space - linsert version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $two $end] set l [linsert $spanl $end 1000] validate $l list $spanl $l [sameStore $spanl $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 999] [irange 2 1000] 0 1 1 2 1] test listrep-4.5.1 { Inserts in back of shared spanned list where span is at end of used space still allocates a new listrep and trailing space is more than leading space - lreplace version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $two $end] set l [lreplace $spanl $end+1 $end+1 1000] validate $l list $spanl $l [sameStore $spanl $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 999] [irange 2 1000] 0 1 1 2 1] test listrep-4.5.2 { Inserts in back of shared spanned list where span is at end of used space still allocates a new listrep and trailing space is more than leading space - lappend version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set l [lrange $master $two $end] lappend l 1000 validate $l list $l [sameStore $master $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $l] } -result [list [irange 2 1000] 0 1 1 1] test listrep-4.5.3 { Inserts in back of shared spanned list where span is at end of used space still allocates a new listrep and trailing space is more than leading space - lset version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set l [lrange $master $two $end] lset l $end+1 1000 validate $l list $l [sameStore $master $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $l] } -result [list [irange 2 1000] 0 1 1 1] test listrep-4.6 { Inserts in middle of shared spanned list allocates a new listrep with equal lead and tail space - linsert version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $two $end-2] set i 200 set l [linsert $spanl $i 1000] validate $l list $spanl $l [sameStore $spanl $l] [spaceEqual $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 201] 1000 [irange 202 997]] 0 1 1 2 1] test listrep-4.6.1 { Inserts in middle of shared spanned list allocates a new listrep with equal lead and tail space - lreplace version } -constraints testlistrep -body { set master [freeSpaceBoth 1000 2] set spanl [lrange $master $two $end-2] set i 200 set l [lreplace $spanl $i -1 1000] validate $l list $spanl $l [sameStore $spanl $l] [spaceEqual $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 201] 1000 [irange 202 997]] 0 1 1 2 1] test listrep-4.7 { Deletes from front of shared spanned list do not create a new allocation - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $zero $one] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 4 997] 1 1 3 3] test listrep-4.7.1 { Deletes from front of shared spanned list do not create a new allocation - lremove version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lremove $spanl $zero $one] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 4 997] 1 1 3 3] test listrep-4.7.2 { Deletes from front of shared spanned list do not create a new allocation - lrange version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lrange $spanl $two $end] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 4 997] 1 1 3 3] test listrep-4.7.3 { Deletes from front of shared spanned list do not create a new allocation - lassign version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lassign $spanl e] validate $l list $e $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list 2 [irange 2 997] [irange 3 997] 1 1 3 3] test listrep-4.7.4 { Deletes from front of shared spanned list do not create a new allocation - lpop version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] set e [lpop l $zero] validate $l list $e $l [sameStore $master $l] [hasSpan $l] [repStoreRefCount $l] } -result [list 2 [irange 3 997] 1 1 2] test listrep-4.8 { Deletes from end of shared spanned list do not create a new allocation - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-1 $end] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 2 995] 1 1 3 3] test listrep-4.8.1 { Deletes from end of shared spanned list do not create a new allocation - lremove version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lremove $spanl $end-1 $end] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 2 995] 1 1 3 3] test listrep-4.8.2 { Deletes from end of shared spanned list do not create a new allocation - lrange version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lrange $spanl 0 $end-2] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [irange 2 995] 1 1 3 3] test listrep-4.8.3 { Deletes from end of shared spanned list do not create a new allocation - lpop version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] set e [lpop l] validate $l list $e $l [sameStore $master $l] [hasSpan $l] [repStoreRefCount $l] } -result [list 997 [irange 2 996] 1 1 2] test listrep-4.9 { Deletes from middle of shared spanned list creates a new allocation with equal free space at front and back - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set i 500 set l [lreplace $spanl $i $i] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [spaceEqual $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 501] [irange 503 997]] 0 1 1 2 1] test listrep-4.9.1 { Deletes from middle of shared spanned list creates a new allocation with equal free space at front and back - lremove version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set i 500 set l [lremove $spanl $i $i] validate $l list $spanl $l [sameStore $spanl $l] [hasSpan $l] [spaceEqual $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 501] [irange 503 997]] 0 1 1 2 1] test listrep-4.9.2 { Deletes from middle of shared spanned list creates a new allocation with equal free space at front and back - lpop version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] set i 500 set e [lpop l $i] validate $l list $e $l [sameStore $master $l] [hasSpan $l] [spaceEqual $l] [repStoreRefCount $l] } -result [list 502 [concat [irange 2 501] [irange 503 997]] 0 1 1 1] test listrep-4.10 { Replacements with same number of elements at front of shared spanned list create a new allocation with more space in front - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $zero $one -2 -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat {-2 -1} [irange 4 997]] 0 1 1 2 1] test listrep-4.10.1 { Replacements with same number of elements at front of shared spanned list create a new allocation with exact size } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] lset l $zero -1 validate $l list $l [sameStore $master $l] [hasSpan $l] [repStoreRefCount $l] } -result [list [concat {-1} [irange 3 997]] 0 0 1] test listrep-4.11 { Replacements with fewer elements at front of shared spanned list create a new allocation with more space in front } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $zero $one -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat {-1} [irange 4 997]] 0 1 1 2 1] test listrep-4.12 { Replacements with more elements at front of shared spanned list create a new allocation with more space in front } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $zero $one -3 -2 -1] validate $l list $spanl $l [sameStore $spanl $l] [leadSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat {-3 -2 -1} [irange 4 997]] 0 1 1 2 1] test listrep-4.13 { Replacements with same number of elements at back of shared spanned list create a new allocation with more space in back - lreplace version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-1 $end 1000 1001] validate $l list $spanl $l [sameStore $spanl $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 995] {1000 1001}] 0 1 1 2 1] test listrep-4.13.1 { Replacements with same number of elements at back of shared spanned list create a new exact allocation with no span - lset version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] lset l $end 1000 validate $l list $l [sameStore $master $l] [tailSpace $l] [hasSpan $l] [repStoreRefCount $l] } -result [list [concat [irange 2 996] {1000}] 0 0 0 1] test listrep-4.14 { Replacements with fewer elements at back of shared spanned list create a new allocation with more space in back } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-1 $end 1000] validate $l list $spanl $l [sameStore $spanl $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 995] {1000}] 0 1 1 2 1] test listrep-4.15 { Replacements with more elements at back of shared spanned list create a new allocation with more space in back } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-1 $end 1000 1001 1002] validate $l list $spanl $l [sameStore $spanl $l] [tailSpaceMore $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 995] {1000 1001 1002}] 0 1 1 2 1] test listrep-4.16 { Replacements with same number of elements in middle of shared spanned list create a new allocation with equal lead and tail sapce } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $one $two -2 -1] validate $l list $spanl $l [sameStore $spanl $l] [spaceEqual $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat {2 -2 -1} [irange 5 997]] 0 1 1 2 1] test listrep-4.16.1 { Replacements with same number of elements in middle of shared spanned list create a new exact allocation - lset version } -constraints testlistrep -body { set master [freeSpaceNone 1000] set l [lrange $master $two $end-2] lset l $one -2 validate $l list $l [sameStore $master $l] [hasSpan $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [concat {2 -2} [irange 4 997]] 0 0 0 1] test listrep-4.17 { Replacements with fewer elements in middle of shared spanned list create a new allocation with equal lead and tail sapce } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-2 $end-1 1000] validate $l list $spanl $l [sameStore $spanl $l] [spaceEqual $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 994] {1000 997}] 0 1 1 2 1] test listrep-4.18 { Replacements with more elements in middle of shared spanned list create a new allocation with equal lead and tail sapce } -constraints testlistrep -body { set master [freeSpaceNone 1000] set spanl [lrange $master $two $end-2] set l [lreplace $spanl $end-2 $end-1 1000 1001 1002] validate $l list $spanl $l [sameStore $spanl $l] [spaceEqual $l] [hasSpan $l] [repStoreRefCount $spanl] [repStoreRefCount $l] } -result [list [irange 2 997] [concat [irange 2 994] {1000 1001 1002 997}] 0 1 1 2 1] # 5.* - tests on shared Tcl_Obj # Tests when Tcl_Obj is shared but listrep is not. This is to ensure that # checks for shared values check the Tcl_Obj reference counts in addition to # the list internal representation reference counts. Probably some or all # cases are already covered elsewhere but easier to just test than look. test listrep-5.1 { Verify that operation on a shared Tcl_Obj with a single-ref, spanless list representation only modifies the target object - lappend version } -constraints testlistrep -body { set l [freeSpaceNone] set l2 $l set same [sameStore $l $l2] lappend l 8 list $same $l $l2 [sameStore $l $l2] } -result [list 1 [irange 0 8] [irange 0 7] 0] test listrep-5.1.1 { Verify that operation on a shared Tcl_Obj with a single-ref, spanless list representation only modifies the target object - lset version } -constraints testlistrep -body { set l [freeSpaceNone] set l2 $l set same [sameStore $l $l2] lset l $end+1 8 list $same $l $l2 [sameStore $l $l2] } -result [list 1 [irange 0 8] [irange 0 7] 0] test listrep-5.1.2 { Verify that operation on a shared Tcl_Obj with a single-ref, spanless list representation only modifies the target object - lpop version } -constraints testlistrep -body { set l [freeSpaceNone] set l2 $l set same [sameStore $l $l2] lpop l list $same $l $l2 [sameStore $l $l2] [hasSpan $l] } -result [list 1 [irange 0 6] [irange 0 7] 0 0] test listrep-5.2 { Verify that operation on a shared Tcl_Obj with a single-ref, spanned list representation only modifies the target object - lappend version } -constraints testlistrep -body { set l [freeSpaceBoth 1000 10 10] set l2 $l set same [sameStore $l $l2] lappend l 1000 list $same $l $l2 [sameStore $l $l2] [hasSpan $l] [hasSpan $l2] } -result [list 1 [irange 0 1000] [irange 0 999] 0 1 1] test listrep-5.2.1 { Verify that operation on a shared Tcl_Obj with a single-ref, spanned list representation only modifies the target object - lset version } -constraints testlistrep -body { set l [freeSpaceBoth 1000 10 10] set l2 $l set same [sameStore $l $l2] lset l $end+1 1000 list $same $l $l2 [sameStore $l $l2] [hasSpan $l] [hasSpan $l2] } -result [list 1 [irange 0 1000] [irange 0 999] 0 1 1] test listrep-5.2.2 { Verify that operation on a shared Tcl_Obj with a single-ref, spanned list representation only modifies the target object - lpop version } -constraints testlistrep -body { set l [freeSpaceNone 1000] set l2 $l set same [sameStore $l $l2] lpop l list $same $l $l2 [sameStore $l $l2] [hasSpan $l] [hasSpan $l2] } -result [list 1 [irange 0 998] [irange 0 999] 1 1 0] # # 6.* - tests when lists contain zombies. # The list implementation does lazy freeing in some cases so the list store # contain Tcl_Obj's that are not actually referenced by any list (zombies). # These are to be freed next time the list store is modified by a list # operation as long as it is no longer shared. test listrep-6.1 { Verify that zombies are freed up - linsert at front } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [linsert $l[set l {}] $zero -1] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [list -1 {*}[irange 10 209]] 1 9 10 1] test listrep-6.1.1 { Verify that zombies are freed up - linsert in middle } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [linsert $l[set l {}] $one -1] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [list 10 -1 {*}[irange 11 209]] 1 9 10 1] test listrep-6.1.2 { Verify that zombies are freed up - linsert at end } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [linsert $l[set l {}] $end 210] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 10 210] 1 10 9 1] test listrep-6.2 { Verify that zombies are freed up - lrange version (whole) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lrange $l[set l {}] $zero $end] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 10 209] 1 10 10 1] test listrep-6.2.1 { Verify that zombies are freed up - lrange version (subrange) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lrange $l[set l {}] $one $end-1] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 11 208] 1 11 11 1] test listrep-6.3 { Verify that zombies are freed up - lassign version } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lassign $l[set l {}] e] list $e $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 10 [irange 11 209] 1 11 10 1] test listrep-6.4 { Verify that zombies are freed up - lremove version (front) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lremove $l[set l {}] $zero] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 11 209] 1 11 10 1] test listrep-6.4.1 { Verify that zombies are freed up - lremove version (back) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lremove $l[set l {}] $end] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 10 208] 1 10 11 1] test listrep-6.5 { Verify that zombies are freed up - lreplace at front } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lreplace $l[set l {}] $zero $one -3 -2 -1] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [list -3 -2 -1 {*}[irange 12 209]] 1 9 10 1] test listrep-6.5.1 { Verify that zombies are freed up - lreplace at back } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] # set l {} is for reference counts to drop to 1 set l [lreplace $l[set l {}] $end-1 $end -1 -2 -3] list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [list {*}[irange 10 207] -1 -2 -3] 1 10 9 1] test listrep-6.6 { Verify that zombies are freed up - lappend } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] lappend l 210 list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 10 210] 1 10 9 1] test listrep-6.7 { Verify that zombies are freed up - lpop version (front) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] set e [lpop l $zero] list $e $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 10 [irange 11 209] 1 11 10 1] test listrep-6.7.1 { Verify that zombies are freed up - lpop version (back) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] set e [lpop l] list $e $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list 209 [irange 10 208] 1 10 11 1] test listrep-6.8 { Verify that zombies are freed up - lset version } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] lset l $zero -1 list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [list -1 {*}[irange 11 209]] 1 10 10 1] test listrep-6.8.1 { Verify that zombies are freed up - lset version (back) } -constraints testlistrep -body { set l [zombieSample 200 10 10] set addr [storeAddress $l] lset l $end+1 210 list $l [expr {$addr == [storeAddress $l]}] [leadSpace $l] [tailSpace $l] [repStoreRefCount $l] } -result [list [irange 10 210] 1 10 9 1] # All done ::tcltest::cleanupTests return tcl9.0.3/tests/listObj.test0000644000175000017500000002624115104661341015225 0ustar sergeisergei# Functionality covered: operation of the procedures in tclListObj.c that # implement the Tcl type manager for the list object type. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testobj [llength [info commands testobj]] testConstraint memory [llength [info commands memory]] set INT_MAX 0x7fffffff; # Assumes sizeof(int) == 4 set SIZE_MAX [expr {(1 << (8*$::tcl_platform(pointerSize) - 1)) - 1}] catch {unset x} test listobj-1.1 {Tcl_GetListObjType} emptyTest { # Test removed; tested an internal detail # that's no longer correct, and duplicated test obj-1.1 } {} test listobj-2.1 {Tcl_SetListObj, use in lappend} { catch {unset x} list [lappend x 1 abc def] [lappend x 1 ghi jkl] $x } {{1 abc def} {1 abc def 1 ghi jkl} {1 abc def 1 ghi jkl}} test listobj-2.2 {Tcl_SetListObj, use in ObjInterpProc} { proc return_args {args} { return $args } list [return_args] [return_args x] [return_args x y] } {{} x {x y}} test listobj-2.3 {Tcl_SetListObj, zero element count} { list } {} test listobj-3.1 {Tcl_ListObjAppend, list conversion} { catch {unset x} list [lappend x 1 2 abc "long string"] $x } {{1 2 abc {long string}} {1 2 abc {long string}}} test listobj-3.2 {Tcl_ListObjAppend, list conversion} { set x "" list [lappend x first second] [lappend x third fourth] $x } {{first second} {first second third fourth} {first second third fourth}} test listobj-3.3 {Tcl_ListObjAppend, list conversion} { set x "abc def" list [lappend x first second] $x } {{abc def first second} {abc def first second}} test listobj-3.4 {Tcl_ListObjAppend, error in conversion} { set x " \{" list [catch {lappend x abc def} msg] $msg } {1 {unmatched open brace in list}} test listobj-3.5 {Tcl_ListObjAppend, force internal rep array to grow} { set x "" list [lappend x 1 1] [lappend x 2 2] [lappend x 3 3] [lappend x 4 4] \ [lappend x 5 5] [lappend x 6 6] [lappend x 7 7] [lappend x 8 8] $x } {{1 1} {1 1 2 2} {1 1 2 2 3 3} {1 1 2 2 3 3 4 4} {1 1 2 2 3 3 4 4 5 5} {1 1 2 2 3 3 4 4 5 5 6 6} {1 1 2 2 3 3 4 4 5 5 6 6 7 7} {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8} {1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8}} test listobj-4.1 {Tcl_ListObjAppendElement, list conversion} { catch {unset x} list [lappend x 1] $x } {1 1} test listobj-4.2 {Tcl_ListObjAppendElement, list conversion} { set x "" list [lappend x first] [lappend x second] $x } {first {first second} {first second}} test listobj-4.3 {Tcl_ListObjAppendElement, list conversion} { set x "abc def" list [lappend x first] $x } {{abc def first} {abc def first}} test listobj-4.4 {Tcl_ListObjAppendElement, error in conversion} { set x " \{" list [catch {lappend x abc} msg] $msg } {1 {unmatched open brace in list}} test listobj-4.5 {Tcl_ListObjAppendElement, force internal rep array to grow} { set x "" list [lappend x 1] [lappend x 2] [lappend x 3] [lappend x 4] \ [lappend x 5] [lappend x 6] [lappend x 7] [lappend x 8] $x } {1 {1 2} {1 2 3} {1 2 3 4} {1 2 3 4 5} {1 2 3 4 5 6} {1 2 3 4 5 6 7} {1 2 3 4 5 6 7 8} {1 2 3 4 5 6 7 8}} test listobj-5.1 {Tcl_ListObjIndex, basic tests} { lindex {a b c} 0 } a test listobj-5.2 {Tcl_ListObjIndex, basic tests} { lindex a 0 } a test listobj-5.3 {Tcl_ListObjIndex, basic tests} { lindex {a {b c d} x} 1 } {b c d} test listobj-5.4 {Tcl_ListObjIndex, basic tests} { lindex {a b c} 3 } {} test listobj-5.5 {Tcl_ListObjIndex, basic tests} { lindex {a b c} 100 } {} test listobj-5.6 {Tcl_ListObjIndex, basic tests} { lindex a 100 } {} test listobj-5.7 {Tcl_ListObjIndex, basic tests} { lindex {} -1 } {} test listobj-5.8 {Tcl_ListObjIndex, error in conversion} { set x " \{" list [catch {lindex $x 0} msg] $msg } {1 {unmatched open brace in list}} test listobj-6.1 {Tcl_ListObjLength} { llength {a b c d} } 4 test listobj-6.2 {Tcl_ListObjLength} { llength {a b c {a b {c d}} d} } 5 test listobj-6.3 {Tcl_ListObjLength} { llength {} } 0 test listobj-6.4 {Tcl_ListObjLength, convert from non-list} { llength 123 } 1 test listobj-6.5 {Tcl_ListObjLength, error converting from non-list} { list [catch {llength "a b c \{"} msg] $msg } {1 {unmatched open brace in list}} test listobj-6.6 {Tcl_ListObjLength, error converting from non-list} { list [catch {llength "a {b}c"} msg] $msg } {1 {list element in braces followed by "c" instead of space}} test listobj-7.1 {Tcl_ListObjReplace, conversion from non-list} { lreplace 123 0 0 x } {x} test listobj-7.2 {Tcl_ListObjReplace, error converting from non-list} { list [catch {lreplace "a b c \{" 1 1 x} msg] $msg } {1 {unmatched open brace in list}} test listobj-7.3 {Tcl_ListObjReplace, error converting from non-list} { list [catch {lreplace "a {b}c" 1 2 x} msg] $msg } {1 {list element in braces followed by "c" instead of space}} test listobj-7.4 {Tcl_ListObjReplace, negative first element index} { lreplace {1 2 3 4 5} -1 1 a } {a 3 4 5} test listobj-7.5 {Tcl_ListObjReplace, last element index >= num elems} { lreplace {1 2 3 4 5} 3 7 a b c } {1 2 3 a b c} test listobj-7.6 {Tcl_ListObjReplace, first element index > last index} { lreplace {1 2 3 4 5} 3 1 a b c } {1 2 3 a b c 4 5} test listobj-7.7 {Tcl_ListObjReplace, no new elements} { lreplace {1 2 3 4 5} 1 1 } {1 3 4 5} test listobj-7.8 {Tcl_ListObjReplace, shrink array in place} { lreplace {1 2 3 4 5 6 7} 4 5 } {1 2 3 4 7} test listobj-7.9 {Tcl_ListObjReplace, grow array in place} { lreplace {1 2 3 4 5 6 7} 1 3 a b c d e } {1 a b c d e 5 6 7} test listobj-7.10 {Tcl_ListObjReplace, replace tail of array} { lreplace {1 2 3 4 5 6 7} 3 6 a } {1 2 3 a} test listobj-7.11 {Tcl_ListObjReplace, must grow internal array} { lreplace {1 2 3 4 5} 2 3 a b c d e f g h i j k l } {1 2 a b c d e f g h i j k l 5} test listobj-7.12 {Tcl_ListObjReplace, grow array, insert at start} { lreplace {1 2 3 4 5} -1 -1 a b c d e f g h i j k l } {a b c d e f g h i j k l 1 2 3 4 5} test listobj-7.13 {Tcl_ListObjReplace, grow array, insert at end} { lreplace {1 2 3 4 5} 4 1 a b c d e f g h i j k l } {1 2 3 4 a b c d e f g h i j k l 5} test listobj-8.1 {SetListFromAny} { lindex {0 foo\x00help 2} 1 } "foo\x00help" test listobj-9.1 {UpdateStringOfList} { string length [list foo\x00help] } 8 test listobj-10.1 {Bug [2971669]} {*}{ -constraints testobj -setup { testobj freeallvars } -body { set result {} lappend result \ [testlistobj set 1 a b c d e] \ [testlistobj replace 1 0x7fffffff 0x7fffffff f] \ [testlistobj get 1] } -cleanup { testobj freeallvars } -result {{a b c d e} {} {a b c d e f}} } test listobj-10.2 {Tcl_ListObjReplace with negative start value} testobj { testlistobj set 1 a b c d e testlistobj replace 1 -1 2 f testlistobj get 1 } {f c d e} test listobj-10.3 {Tcl_ListObjReplace with negative count value} testobj { testlistobj set 1 a b c d e testlistobj replace 1 1 -1 f testlistobj get 1 } {a f b c d e} test listobj-10.4 {Tcl_ListObjReplace with $SIZE_MAX count value} testobj { testlistobj set 1 a b c d e testlistobj replace 1 1 $SIZE_MAX f testlistobj get 1 } {a f} test listobj-10.5 {Tcl_ListObjReplace with SIZE_MAX-1 count value} testobj { testlistobj set 1 a b c d e testlistobj replace 1 1 [expr {$SIZE_MAX -1}] f testlistobj get 1 } {a f} test listobj-11.1 {Bug 3598580: Tcl_ListObjReplace refcount management} testobj { testobj bug3598580 } 123 test listobj-11.2 {Bug e58d7e19e9: Upwards compatibility of TclObjTypeHasProc()} testobj { set l [testobj buge58d7e19e9 "a x c"] # Since $l is a V1 objType, it's lengthProc will be accessed, but not its indexProc. list [llength $l] [lindex $l 2] } {100 c} # Stolen from dict.test proc listobjmemcheck script { set end [lindex [split [memory info] \n] 3 3] for {set i 0} {$i < 5} {incr i} { uplevel 1 $script set tmp $end set end [lindex [split [memory info] \n] 3 3] } expr {$end - $tmp} } test listobj-12.1 {Tcl_ListObjIndex memory leaks for native lists} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [lrepeat 1000 x] set errorMessage [testlistobj indexmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} test listobj-12.2 {Tcl_ListObjIndex memory leaks for native lists with spans} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [testlistrep new 1000 100 100] set errorMessage [testlistobj indexmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} test listobj-12.3 {Tcl_ListObjIndex memory leaks for lseq} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [lseq 1000] set errorMessage [testlistobj indexmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} test listobj-13.1 {Tcl_ListObjGetElements memory leaks for native lists} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [lrepeat 1000 x] set errorMessage [testlistobj getelementsmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} test listobj-13.2 {Tcl_ListObjElements memory leaks for native lists with spans} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [testlistrep new 1000 100 100] set errorMessage [testlistobj getelementsmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} test listobj-13.3 {Tcl_ListObjElements memory leaks for lseq} -constraints { testobj memory } -body { list [listobjmemcheck { testobj set 1 [lseq 1000] set errorMessage [testlistobj getelementsmemcheck 1] testobj freeallvars }] $errorMessage } -result {0 {}} # Tests for Tcl_ListObjIndex as sematics are different from lindex for # out of bounds indices. Out of bounds should return a null pointer and # not empty string. test listobj-14.1 {Tcl_ListObjIndex out-of-bounds index for native lists} -constraints { testobj } -setup { testobj set 1 [list a b c] } -cleanup { testobj freeallvars } -body { list [testlistobj index 1 -1] [testlistobj index 1 3] } -result {null null} test listobj-14.2 {Tcl_ListObjIndex out-of-bounds index for native lists with spans} -constraints { testobj } -setup { testobj set 1 [testlistrep new 1000 100 100] } -cleanup { testobj freeallvars } -body { list [testlistobj index 1 -1] [testlistobj index 1 1000] } -result {null null} test listobj-14.3 {Tcl_ListObjIndex out-of-bounds index for lseq} -constraints {bug_30e4e9102f testobj} -setup { testobj set 1 [lseq 3] } -cleanup { testobj freeallvars } -body { list [testlistobj index 1 -1] [testlistobj index 1 3] } -result {null null} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/list.test0000644000175000017500000001256215104661341014573 0ustar sergeisergei# Commands covered: list # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # First, a bunch of individual tests test list-1.1 {basic tests} {list a b c} {a b c} test list-1.2 {basic tests} {list {a b} c} {{a b} c} test list-1.3 {basic tests} {list \{a b c} {\{a b c} test list-1.4 {basic tests} "list a{}} b{} c}" "a\\{\\}\\} b{} c\\}" test list-1.5 {basic tests} {list a\[ b\] } "{a\[} b\\]" test list-1.6 {basic tests} {list c\ d\t } "{c } {d\t}" test list-1.7 {basic tests} {list e\n f\$ } "{e\n} {f\$}" test list-1.8 {basic tests} {list g\; h\\} {{g;} h\\} test list-1.9 {basic tests} "list a\\\[} b\\\]} " "a\\\[\\\} b\\\]\\\}" test list-1.10 {basic tests} "list c\\\} d\\t} " "c\\} d\\t\\}" test list-1.11 {basic tests} "list e\\n} f\\$} " "e\\n\\} f\\$\\}" test list-1.12 {basic tests} "list g\\;} h\\\\} " "g\\;\\} {h\\}}" test list-1.13 {basic tests} {list a {{}} b} {a {{}} b} test list-1.14 {basic tests} {list a b xy\\} "a b xy\\\\" test list-1.15 {basic tests} "list a b\} e\\" "a b\\} e\\\\" test list-1.16 {basic tests} "list a b\}\\\$ e\\\$\\" "a b\\}\\\$ e\\\$\\\\" test list-1.17 {basic tests} {list a\f \{\f} "{a\f} \\\{\\f" test list-1.18 {basic tests} {list a\r \{\r} "{a\r} \\\{\\r" test list-1.19 {basic tests} {list a\v \{\v} "{a\v} \\\{\\v" test list-1.20 {basic tests} {list \"\}\{} "\\\"\\}\\{" test list-1.21 {basic tests} {list a b c\\\nd} "a b c\\\\\\nd" test list-1.22 {basic tests} {list "{ab}\\"} \\{ab\\}\\\\ test list-1.23 {basic tests} {list \{} "\\{" test list-1.24 {basic tests} {list} {} test list-1.25 {basic tests} {list # #} {{#} #} test list-1.26 {basic tests} {list #\{ #\{} {\#\{ #\{} test list-1.27 {basic null treatment} { set l [list "" "\x00" "\x00\x00"] set e "{} \x00 \x00\x00" string equal $l $e } 1 test list-1.28 {basic null treatment} { set result "\x00a\x00b" list $result [string length $result] } "\x00a\x00b 4" test list-1.29 {basic null treatment} { set result "\x00a\x00b" set srep "$result 4" set lrep [list $result [string length $result]] string equal $srep $lrep } 1 test list-1.30 {basic null treatment} { set l [list "\x00abc" "xyz"] set e "\x00abc xyz" string equal $l $e } 1 test list-1.31 {bug [e38dce74e2]} { set l #foo set e {} list {*}$l {*}$e } {{#foo}} test list-1.32 {bug [e38dce74e2]} { set l " #foo" set e {} list {*}$l {*}$e } {{#foo}} # For the next round of tests create a list and then pick it apart # with "index" to make sure that we get back exactly what went in. set num 0 proc lcheck {testid a b c} { global num d set d [list $a $b $c] test ${testid}-0 {what goes in must come out} {lindex $d 0} $a test ${testid}-1 {what goes in must come out} {lindex $d 1} $b test ${testid}-2 {what goes in must come out} {lindex $d 2} $c } lcheck list-2.1 a b c lcheck list-2.2 "a b" c\td e\nf lcheck list-2.3 {{a b}} {} { } lcheck list-2.4 \$ \$ab ab\$ lcheck list-2.5 \; \;ab ab\; lcheck list-2.6 \[ \[ab ab\[ lcheck list-2.7 \\ \\ab ab\\ lcheck list-2.8 {"} {"ab} {ab"} ;#" Stupid emacs highlighting! lcheck list-2.9 {a b} { ab} {ab } lcheck list-2.10 a{ a{b \{ab lcheck list-2.11 a} a}b }ab lcheck list-2.12 a\\} {a \}b} {a \{c} lcheck list-2.13 xyz \\ 1\\\n2 lcheck list-2.14 "{ab}\\" "{ab}xy" abc concat {} # Check that tclListObj.c's SetListFromAny handles possible overlarge # string rep lengths in the source object. proc slowsort list { set result {} set last [expr {[llength $list] - 1}] while {$last > 0} { set minIndex [expr {[llength $list] - 1}] set min [lindex $list $last] set i [expr {$minIndex - 1}] while {$i >= 0} { if {[string compare [lindex $list $i] $min] < 0} { set minIndex $i set min [lindex $list $i] } incr i -1 } set result [concat $result [list $min]] if {$minIndex == 0} { set list [lrange $list 1 end] } else { set list [concat [lrange $list 0 [expr {$minIndex - 1}]] \ [lrange $list [expr {$minIndex + 1}] end]] } set last [expr {$last - 1}] } return [concat $result $list] } test list-3.1 {SetListFromAny and lrange/concat results} { slowsort {fred julie alex carol bill annie} } {alex annie bill carol fred julie} test list-4.1 {Bug 3173086} { string is list "{[list \\\\\}]}" } 1 test list-4.2 {Bug 35a8f1c04a, check correct str-rep} { set result {} foreach i { {#"} {#"""} {#"""""""""""""""} "#\"{" "#\"\"\"{" "#\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\{" "#\"}" "#\"\"\"}" "#\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\}" } { set list [list $i] set list [string trim " $list "] if {[llength $list] > 1 || $i ne [lindex $list 0]} { lappend result "wrong string-representation of list by '$i', length: [llength $list], list: '$list'" } } set result [join $result \n] } {} test list-4.3 {Bug 35a8f1c04a, check correct string length} { string length [list #""] } 5 # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/linsert.test0000644000175000017500000000702715104661341015300 0ustar sergeisergei# Commands covered: linsert # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {unset lis} catch {rename p ""} test linsert-1.1 {linsert command} { linsert {1 2 3 4 5} 0 a } {a 1 2 3 4 5} test linsert-1.2 {linsert command} { linsert {1 2 3 4 5} 1 a } {1 a 2 3 4 5} test linsert-1.3 {linsert command} { linsert {1 2 3 4 5} 2 a } {1 2 a 3 4 5} test linsert-1.4 {linsert command} { linsert {1 2 3 4 5} 3 a } {1 2 3 a 4 5} test linsert-1.5 {linsert command} { linsert {1 2 3 4 5} 4 a } {1 2 3 4 a 5} test linsert-1.6 {linsert command} { linsert {1 2 3 4 5} 5 a } {1 2 3 4 5 a} test linsert-1.7 {linsert command} { linsert {1 2 3 4 5} 2 one two \{three \$four } {1 2 one two \{three {$four} 3 4 5} test linsert-1.8 {linsert command} { linsert {\{one \$two \{three \ four \ five} 2 a b c } {\{one {$two} a b c \{three { four} { five}} test linsert-1.9 {linsert command} { linsert {{1 2} {3 4} {5 6} {7 8}} 2 {x y} {a b} } {{1 2} {3 4} {x y} {a b} {5 6} {7 8}} test linsert-1.10 {linsert command} { linsert {} 2 a b c } {a b c} test linsert-1.11 {linsert command} { linsert {} 2 {} } {{}} test linsert-1.12 {linsert command} { linsert {a b "c c" d e} 3 1 } {a b {c c} 1 d e} test linsert-1.13 {linsert command} { linsert { a b c d} 0 1 2 } {1 2 a b c d} test linsert-1.14 {linsert command} { linsert {a b c {d e f}} 4 1 2 } {a b c {d e f} 1 2} test linsert-1.15 {linsert command} { linsert {a b c \{\ abc} 4 q r } {a b c \{\ q r abc} test linsert-1.16 {linsert command} { linsert {a b c \{ abc} 4 q r } {a b c \{ q r abc} test linsert-1.17 {linsert command} { linsert {a b c} end q r } {a b c q r} test linsert-1.18 {linsert command} { linsert {a} end q r } {a q r} test linsert-1.19 {linsert command} { linsert {} end q r } {q r} test linsert-1.20 {linsert command, use of end-int index} { linsert {a b c d} end-2 e f } {a b e f c d} test linsert-2.1 {linsert errors} { list [catch linsert msg] $msg } {1 {wrong # args: should be "linsert list index ?element ...?"}} test linsert-2.2 {linsert errors} { list [catch {linsert a b} msg] $msg } {1 {bad index "b": must be integer?[+-]integer? or end?[+-]integer?}} test linsert-2.3 {linsert errors} { list [catch {linsert a 12x 2} msg] $msg } {1 {bad index "12x": must be integer?[+-]integer? or end?[+-]integer?}} test linsert-2.4 {linsert errors} { list [catch {linsert \{ 12 2} msg] $msg } {1 {unmatched open brace in list}} test linsert-2.5 {syntax (TIP 323)} { linsert {a b c} 0 } [list a b c] test linsert-2.6 {syntax (TIP 323)} { linsert "a\nb\nc" 0 } [list a b c] test linsert-3.1 {linsert won't modify shared argument objects} { proc p {} { linsert "a b c" 1 "x y" return "a b c" } p } "a b c" test linsert-3.2 {linsert won't modify shared argument objects} { catch {unset lis} set lis [format "a \"%s\" c" "b"] linsert $lis 0 [string length $lis] } "7 a b c" # cleanup catch {unset lis} catch {rename p ""} ::tcltest::cleanupTests return tcl9.0.3/tests/link.test0000644000175000017500000010057115104661341014553 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for Tcl_LinkVar and related library # procedures. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testlink [llength [info commands testlink]] testConstraint testlinkarray [llength [info commands testlinkarray]] foreach i {int real bool string} { unset -nocomplain $i } test link-0.1 {leak test} {testlink} { interp create i load {} Tcltest i i eval { testlink create 1 0 0 0 0 0 0 0 0 0 0 0 0 0 namespace delete :: } interp delete i } {} test link-1.1 {reading C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.23 4 - 12341234 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 list $int $real $bool $string $wide } -result {43 1.23 1 NULL 12341234} test link-1.2 {reading C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set -3 2 0 "A long string with spaces" 43214321 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 list $int $real $bool $string $wide $int $real $bool $string $wide } -result {-3 2.0 0 {A long string with spaces} 43214321 -3 2.0 0 {A long string with spaces} 43214321} test link-2.1 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int "0o0721" set real -10.5 set bool true set string abcdef set wide 135135 set char 79 set uchar 161 set short 8000 set ushort 40000 set uint 0xc001babe set long 34543 set ulong 567890 set float 1.0987654321 set uwide 12345678901234567890 concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {465 -10.5 1 abcdef 135135 79 161 8000 40000 -1073628482 34543 567890 1.0987653732299805 12345678901234567890 | 0o0721 -10.5 true abcdef 135135 79 161 8000 40000 0xc001babe 34543 567890 1.0987654321 12345678901234567890} test link-2.2 {writing bad values into variables} -setup { testlink delete } -constraints {testlink} -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 list [catch {set int 09a} msg] $msg $int } -result {1 {can't set "int": variable must have integer value} 43} test link-2.3 {writing bad values into variables} -setup { testlink delete } -constraints {testlink} -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 list [catch {set real 1.x3} msg] $msg $real } -result {1 {can't set "real": variable must have real value} 1.23} test link-2.4 {writing bad values into variables} -setup { testlink delete } -constraints {testlink} -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 list [catch {set bool gorp} msg] $msg $bool } -result {1 {can't set "bool": variable must have boolean value} 1} test link-2.5 {writing bad values into variables} -setup { testlink delete } -constraints {testlink} -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 list [catch {set wide gorp} msg] $msg $bool } -result {1 {can't set "wide": variable must have wide integer value} 1} test link-2.6 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int "+" set real "+" set bool 1 set string "+" set wide "+" set char "+" set uchar "+" set short "+" set ushort "+" set uint "+" set long "+" set ulong "+" set float "+" set uwide "+" concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {1 1.0 1 + 1 1 1 1 1 1 1 1 1.0 1 | + + 1 + + + + + + + + + + +} test link-2.7 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int "-" set real "-" set bool 0 set string "-" set wide "-" set char "-" set uchar "-" set short "-" set ushort "-" set uint "-" set long "-" set ulong "-" set float "-" set uwide "-" concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {0 0.0 0 - 0 0 0 0 0 0 0 0 0.0 0 | - - 0 - - - - - - - - - - -} test link-2.8 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int "0x" set real "0b" set bool 0 set string "0" set wide "0O" set char "0X" set uchar "0B" set short "0O" set ushort "0x" set uint "0b" set long "0o" set ulong "0X" set float "0B" set uwide "0O" concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {0 0.0 0 0 0 0 0 0 0 0 0 0 0.0 0 | 0x 0b 0 0 0O 0X 0B 0O 0x 0b 0o 0X 0B 0O} test link-2.9 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int 0 set real 5000e set bool 0 set string 0 set wide 0 set char 0 set uchar 0 set short 0 set ushort 0 set uint 0 set long 0 set ulong 0 set float -60.00e+ set uwide 0 concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {0 5000.0 0 0 0 0 0 0 0 0 0 0 -60.0 0 | 0 5000e 0 0 0 0 0 0 0 0 0 0 -60.00e+ 0} test link-2.10 {writing C variables from Tcl} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 set int "0x" set real "0b" set bool 0 set string "0" set wide "0D" set char "0X" set uchar "0B" set short "0D" set ushort "0x" set uint "0b" set long "0d" set ulong "0X" set float "0B" set uwide "0D" concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {0 0.0 0 0 0 0 0 0 0 0 0 0 0.0 0 | 0x 0b 0 0 0D 0X 0B 0D 0x 0b 0d 0X 0B 0D} test link-3.1 {read-only variables} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 0 1 1 0 0 0 0 0 0 0 0 0 0 0 list [catch {set int 4} msg] $msg $int \ [catch {set real 10.6} msg] $msg $real \ [catch {set bool no} msg] $msg $bool \ [catch {set string "new value"} msg] $msg $string \ [catch {set wide 12341234} msg] $msg $wide } -result {1 {can't set "int": linked variable is read-only} 43 0 10.6 10.6 0 no no 1 {can't set "string": linked variable is read-only} NULL 1 {can't set "wide": linked variable is read-only} 56785678} test link-3.2 {read-only variables} -constraints {testlink} -setup { testlink delete } -body { testlink set 43 1.23 4 - 56785678 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 0 0 1 1 0 0 0 0 0 0 0 0 0 list [catch {set int 4} msg] $msg $int \ [catch {set real 10.6} msg] $msg $real \ [catch {set bool no} msg] $msg $bool \ [catch {set string "new value"} msg] $msg $string\ [catch {set wide 12341234} msg] $msg $wide } -result {0 4 4 1 {can't set "real": linked variable is read-only} 1.23 1 {can't set "bool": linked variable is read-only} 1 0 {new value} {new value} 0 12341234 12341234} test link-4.1 {unsetting linked variables} -constraints {testlink} -setup { testlink delete } -body { testlink set -6 -2.5 0 stringValue 13579 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 unset int real bool string wide list [catch {set int} msg] $msg [catch {set real} msg] $msg \ [catch {set bool} msg] $msg [catch {set string} msg] $msg \ [catch {set wide} msg] $msg } -result {0 -6 0 -2.5 0 0 0 stringValue 0 13579} test link-4.2 {unsetting linked variables} -constraints {testlink} -setup { testlink delete } -body { testlink set -6 -2.1 0 stringValue 97531 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 unset int real bool string wide set int 102 set real 16 set bool true set string newValue set wide 333555 lrange [testlink get] 0 4 } -result {102 16.0 1 newValue 333555} test link-5.1 {unlinking variables} -constraints {testlink} -setup { testlink delete } -body { testlink set -6 -2.25 0 stringValue 13579 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink delete set int xx1 set real qrst set bool bogus set string 12345 set wide 875421 set char skjdf set uchar dslfjk set short slkf set ushort skrh set uint sfdkfkh set long srkjh set ulong sjkg set float dskjfbjfd set uwide isdfsngs testlink get } -result {-6 -2.25 0 stringValue 13579 64 250 30000 60000 -1091585346 12321 32123 3.25 1231231234} test link-5.2 {unlinking variables} -constraints {testlink} -setup { testlink delete } -body { testlink set -6 -2.25 0 stringValue 97531 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink delete testlink set 25 14.7 7 - 999999 65 251 30001 60001 0xbabebeef 12322 32124 3.125 12312312340 list $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {-6 -2.25 0 stringValue 97531 64 250 30000 60000 3203381950 12321 32123 3.25 1231231234} test link-6.1 {errors in setting up link} -setup { testlink delete unset -nocomplain int } -constraints {testlink} -body { set int(44) 1 testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 } -cleanup { unset -nocomplain int } -returnCodes error -result {can't set "int": variable is array} test link-7.1 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar int y unset y } testlink create 1 0 0 0 0 0 0 0 0 0 0 0 0 0 testlink set 14 {} {} {} {} {} {} {} {} {} {} {} {} {} x list [catch {set int} msg] $msg } -result {0 14} test link-7.2 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar int y return [set y] } testlink create 1 0 0 0 0 0 0 0 0 0 0 0 0 0 testlink set 0 {} {} {} {} {} {} {} {} {} {} {} {} {} set int testlink set 23 {} {} {} {} {} {} {} {} {} {} {} {} {} x list [x] $int } -result {23 23} test link-7.3 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar int y set y 44 } testlink create 0 0 0 0 0 0 0 0 0 0 0 0 0 0 testlink set 11 {} {} {} {} {} {} {} {} {} {} {} {} {} list [catch x msg] $msg $int } -result {1 {can't set "y": linked variable is read-only} 11} test link-7.4 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar int y set y abc } testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set -4 {} {} {} {} {} {} {} {} {} {} {} {} {} list [catch x msg] $msg $int } -result {1 {can't set "y": variable must have integer value} -4} test link-7.5 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar real y set y abc } testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set -4 16.75 {} {} {} {} {} {} {} {} {} {} {} {} list [catch x msg] $msg $real } -result {1 {can't set "y": variable must have real value} 16.75} test link-7.6 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar bool y set y abc } testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set -4 16.3 1 {} {} {} {} {} {} {} {} {} {} {} list [catch x msg] $msg $bool } -result {1 {can't set "y": variable must have boolean value} 1} test link-7.7 {access to linked variables via upvar} -setup { testlink delete } -constraints {testlink} -body { proc x {} { upvar wide y set y abc } testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set -4 16.3 1 {} 778899 {} {} {} {} {} {} {} {} {} list [catch x msg] $msg $wide } -result {1 {can't set "y": variable must have wide integer value} 778899} test link-8.1 {Tcl_UpdateLinkedVar procedure} {testlink} { proc x args { global x int real bool string wide lappend x $args $int $real $bool $string $wide } set x {} testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set 14 -2.0 0 xyzzy 995511 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 trace add var int write x testlink update 32 4.0 3 abcd 113355 65 251 30001 60001 0xbabebeef 12322 32124 3.125 12312312340 trace remove variable int write x return $x } {{int {} write} 32 -2.0 0 xyzzy 995511} test link-8.2 {Tcl_UpdateLinkedVar procedure} {testlink} { proc x args { global x int real bool string wide lappend x $args $int $real $bool $string $wide } set x {} testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1 testlink set 14 -2.0 0 xyzzy 995511 64 250 30000 60000 0xbeefbabe 12321 32123 3.25 1231231234 testlink delete trace add var int write x testlink update 32 4.0 6 abcd 113355 65 251 30001 60001 0xbabebeef 12322 32124 3.125 12312312340 trace remove variable int write x return $x } {} test link-8.3 {Tcl_UpdateLinkedVar procedure, read-only variable} {testlink} { testlink create 0 0 0 0 0 0 0 0 0 0 0 0 0 0 list [catch { testlink update 47 {} {} {} {} {} {} {} {} {} {} {} {} {} } msg] $msg $int } {0 {} 47} test link-9.1 {linkarray usage messages} -returnCodes error -constraints testlinkarray -body { testlinkarray } -result {wrong # args: should be "testlinkarray option args"} test link-9.2 {linkarray usage messages} -returnCodes error -constraints testlinkarray -body { testlinkarray x } -result {bad option "x": must be update, remove, or create} test link-9.3 {linkarray usage messages} -constraints testlinkarray -body { testlinkarray update } -result {} test link-9.4 {linkarray usage messages} -constraints testlinkarray -body { testlinkarray remove } -result {} test link-9.5 {linkarray usage messages} -returnCodes error -constraints testlinkarray -body { testlinkarray create } -result {wrong # args: should be "testlinkarray create ?-readonly? type size name ?address?"} test link-9.6 {linkarray usage messages} -returnCodes error -constraints testlinkarray -body { testlinkarray create xx 1 my } -result {bad type "xx": must be char, uchar, short, ushort, int, uint, long, ulong, wide, uwide, float, double, string, char*, or binary} test link-9.7 {linkarray usage messages} -returnCodes error -constraints testlinkarray -body { testlinkarray create char* 0 my } -result {wrong array size given} test link-10.1 {linkarray char*} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create char* 1 ::my(var) lappend mylist [set ::my(var) ""] catch {set ::my(var) x} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{} {can't set "::my(var)": wrong size of char* value}} test link-10.2 {linkarray char*} -constraints testlinkarray -body { testlinkarray create char* 4 ::my(var) set ::my(var) x catch {set ::my(var) xyzz} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": wrong size of char* value} test link-10.3 {linkarray char*} -constraints testlinkarray -body { testlinkarray create -r char* 4 ::my(var) catch {set ::my(var) x} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-11.1 {linkarray char} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create char 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1234} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have char value} 120 {can't set "::my(var)": variable must have char value}} test link-11.2 {linkarray char} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create char 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-11.3 {linkarray char} -constraints testlinkarray -body { testlinkarray create -r char 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-12.1 {linkarray unsigned char} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uchar 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1234} msg lappend mylist $msg catch {set ::my(var) -1} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have unsigned char value} 120 {can't set "::my(var)": variable must have unsigned char value} {can't set "::my(var)": variable must have unsigned char value}} test link-12.2 {linkarray unsigned char} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uchar 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-12.3 {linkarray unsigned char} -constraints testlinkarray -body { testlinkarray create -r uchar 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-13.1 {linkarray short} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create short 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 123456} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have short value} 120 {can't set "::my(var)": variable must have short value}} test link-13.2 {linkarray short} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create short 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-13.3 {linkarray short} -constraints testlinkarray -body { testlinkarray create -r short 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-14.1 {linkarray unsigned short} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create ushort 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 123456} msg lappend mylist $msg catch {set ::my(var) -1} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have unsigned short value} 120 {can't set "::my(var)": variable must have unsigned short value} {can't set "::my(var)": variable must have unsigned short value}} test link-14.2 {linkarray unsigned short} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create ushort 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-14.3 {linkarray unsigned short} -constraints testlinkarray -body { testlinkarray create -r ushort 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-15.1 {linkarray int} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create int 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e3} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have integer value} 120 {can't set "::my(var)": variable must have integer value}} test link-15.2 {linkarray int} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create int 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-15.3 {linkarray int} -constraints testlinkarray -body { testlinkarray create -r int 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-16.1 {linkarray unsigned int} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uint 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e33} msg lappend mylist $msg catch {set ::my(var) -1} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain ::my } -result {{can't set "::my(var)": variable must have unsigned int value} 120 {can't set "::my(var)": variable must have unsigned int value} {can't set "::my(var)": variable must have unsigned int value}} test link-16.2 {linkarray unsigned int} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uint 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain ::my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-16.3 {linkarray unsigned int} -constraints testlinkarray -body { testlinkarray create -r uint 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-17.1 {linkarray long} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create long 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e33} msg lappend mylist $msg } -match glob -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have * value} 120 {can't set "::my(var)": variable must have * value}} test link-17.2 {linkarray long} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create long 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-17.3 {linkarray long} -constraints testlinkarray -body { testlinkarray create -r long 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-18.1 {linkarray unsigned long} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create ulong 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e33} msg lappend mylist $msg } -match glob -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have unsigned * value} 120 {can't set "::my(var)": variable must have unsigned * value}} test link-18.2 {linkarray unsigned long} -constraints testlinkarray -body { testlinkarray create ulong 1 ::my(var) set ::my(var) 120 catch {set ::my(var) -1} msg return $msg } -match glob -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": variable must have unsigned * value} test link-18.3 {linkarray unsigned long} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create ulong 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-18.4 {linkarray unsigned long} -constraints testlinkarray -body { testlinkarray create -r ulong 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-19.1 {linkarray wide} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create wide 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e33} msg lappend mylist $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have wide integer value} 120 {can't set "::my(var)": variable must have wide integer value}} test link-19.2 {linkarray wide} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create wide 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-19.3 {linkarray wide} -constraints testlinkarray -body { testlinkarray create -r wide 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-20.1 {linkarray unsigned wide} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uwide 1 ::my(var) catch {set ::my(var) x} msg lappend mylist $msg lappend mylist [set ::my(var) 120] catch {set ::my(var) 1e33} msg lappend mylist $msg lappend mylist [set ::my(var) 0xbabed00dbabed00d] } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": variable must have unsigned wide int value} 120 {can't set "::my(var)": variable must have unsigned wide int value} 0xbabed00dbabed00d} test link-20.2 {linkarray unsigned wide} -constraints testlinkarray -body { testlinkarray create uwide 1 ::my(var) set ::my(var) 120 catch {set ::my(var) -1} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": variable must have unsigned wide int value} test link-20.3 {linkarray unsigned wide} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create uwide 4 ::my(var) catch {set ::my(var) {1 2 3}} msg lappend mylist $msg set ::my(var) {1 2 3 4} lappend mylist $my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong dimension} {1 2 3 4}} test link-20.4 {linkarray unsigned wide} -constraints testlinkarray -body { testlinkarray create -r uwide 2 ::my(var) catch {set ::my(var) {1 2}} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-21.1 {linkarray string} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create string 1 ::my(var) lappend mylist [set ::my(var) ""] lappend mylist [set ::my(var) "xyz"] lappend mylist $::my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{} xyz xyz} test link-21.2 {linkarray string} -constraints testlinkarray -body { testlinkarray create -r string 4 ::my(var) catch {set ::my(var) x} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} test link-22.1 {linkarray binary} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create binary 1 ::my(var) set ::my(var) x catch {set ::my(var) xy} msg lappend mylist $msg lappend mylist $::my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong size of binary value} x} test link-22.2 {linkarray binary} -constraints testlinkarray -setup { set mylist [list] } -body { testlinkarray create binary 4 ::my(var) catch {set ::my(var) abc} msg lappend mylist $msg catch {set ::my(var) abcde} msg lappend mylist $msg set ::my(var) abcd lappend mylist $::my(var) } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {{can't set "::my(var)": wrong size of binary value} {can't set "::my(var)": wrong size of binary value} abcd} test link-22.3 {linkarray binary} -constraints testlinkarray -body { testlinkarray create -r binary 4 ::my(var) catch {set ::my(var) xyzv} msg return $msg } -cleanup { testlinkarray remove ::my(var) unset -nocomplain my } -result {can't set "::my(var)": linked variable is read-only} catch {testlink set 0 0 0 - 0 0 0 0 0 0 0 0 0 0} catch {testlink delete} foreach i {int real bool string wide} { unset -nocomplain $i } # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/lindex.test0000644000175000017500000003311415104661341015077 0ustar sergeisergei# Commands covered: lindex # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2001 Kevin B. Kenny. All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] set minus - testConstraint testevalex [llength [info commands testevalex]] # Tests of Tcl_LindexObjCmd, NOT COMPILED test lindex-1.1 {wrong # args} testevalex { list [catch {testevalex lindex} result] $result } "1 {wrong # args: should be \"lindex list ?index ...?\"}" # Indices that are lists or convertible to lists test lindex-2.1 {empty index list} testevalex { set x {} list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {{a b c} {a b c}} test lindex-2.2 {singleton index list} testevalex { set x { 1 } list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {b b} test lindex-2.3 {multiple indices in list} testevalex { set x {1 2} list [testevalex {lindex {{a b c} {d e f}} $x}] \ [testevalex {lindex {{a b c} {d e f}} $x}] } {f f} test lindex-2.4 {malformed index list} testevalex { set x \{ list [catch { testevalex {lindex {a b c} $x} } result] $result } {1 bad\ index\ \"\{\":\ must\ be\ integer?\[+-\]integer?\ or\ end?\[+-\]integer?} # Indices that are integers or convertible to integers test lindex-3.1 {integer -1} -constraints testevalex -body { set x ${minus}1 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } -result {{} {}} test lindex-3.2 {integer 0} -constraints testevalex -body { set x [string range 00 0 0] list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } -result {a a} test lindex-3.3 {integer 2} -constraints testevalex -body { set x [string range 22 0 0] list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } -result {c c} test lindex-3.4 {integer 3} -constraints testevalex -body { set x [string range 33 0 0] list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } -result {{} {}} test lindex-3.5 {bad octal} -constraints testevalex -body { set x 0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result } -match glob -result {1 {*}} test lindex-3.6 {bad octal} -constraints testevalex -body { set x -0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result } -match glob -result {1 {*}} test lindex-3.7 {indexes don't shimmer wide ints} -body { set x [expr {(wide(1)<<31) - 2}] list $x [lindex {1 2 3} $x] [incr x] [incr x] } -result {2147483646 {} 2147483647 2147483648} test lindex-3.8 {compiled with static indices out of range, negative} -body { list [lindex {a b c} -1] [lindex {a b c} -2] [lindex {a b c} -3] } -result [lrepeat 3 {}] test lindex-3.9 {compiled with calculated indices out of range, negative constant} -body { list [lindex {a b c} -1-1] [lindex {a b c} -2+0] [lindex {a b c} -2+1] } -result [lrepeat 3 {}] test lindex-3.10 {compiled with calculated indices out of range, after end} -body { list [lindex {a b c} end+1] [lindex {a b c} end+2] [lindex {a b c} end+3] } -result [lrepeat 3 {}] # Indices relative to end test lindex-4.1 {index = end} testevalex { set x end list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {c c} test lindex-4.2 {index = end--1} testevalex { set x end--1 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {{} {}} test lindex-4.3 {index = end-0} testevalex { set x end-0 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {c c} test lindex-4.4 {index = end-2} testevalex { set x end-2 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {a a} test lindex-4.5 {index = end-3} testevalex { set x end-3 list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {{} {}} test lindex-4.6 {bad octal} -constraints testevalex -body { set x end-0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result } -match glob -result {1 {*}} test lindex-4.7 {bad octal} -constraints testevalex -body { set x end--0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result } -match glob -result {1 {*}} test lindex-4.8 {bad integer, not octal} testevalex { set x end-0a2 list [catch { testevalex {lindex {a b c} $x} } result] $result } {1 {bad index "end-0a2": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-4.9 {obsolete test} testevalex { set x end list [testevalex {lindex {a b c} $x}] [testevalex {lindex {a b c} $x}] } {c c} test lindex-4.10 {incomplete end-} testevalex { set x end- list [catch { testevalex {lindex {a b c} $x} } result] $result } {1 {bad index "end-": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-5.1 {bad second index} testevalex { list [catch { testevalex {lindex {a b c} 0 0a2} } result] $result } {1 {bad index "0a2": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-5.2 {good second index} testevalex { testevalex {lindex {{a b c} {d e f} {g h i}} 1 2} } f test lindex-5.3 {three indices} testevalex { testevalex {lindex {{{a b} {c d}} {{e f} {g h}}} 1 0 1} } f test lindex-6.1 {error conditions in parsing list} testevalex { list [catch {testevalex {lindex "a \{" 2}} msg] $msg } {1 {unmatched open brace in list}} test lindex-6.2 {error conditions in parsing list} testevalex { list [catch {testevalex {lindex {a {b c}d e} 2}} msg] $msg } {1 {list element in braces followed by "d" instead of space}} test lindex-6.3 {error conditions in parsing list} testevalex { list [catch {testevalex {lindex {a "b c"def ghi} 2}} msg] $msg } {1 {list element in quotes followed by "def" instead of space}} test lindex-7.1 {quoted elements} testevalex { testevalex {lindex {a "b c" d} 1} } {b c} test lindex-7.2 {quoted elements} testevalex { testevalex {lindex {"{}" b c} 0} } {{}} test lindex-7.3 {quoted elements} testevalex { testevalex {lindex {ab "c d \" x" y} 1} } {c d " x} test lindex-7.4 {quoted elements} { lindex {a b {c d "e} {f g"}} 2 } {c d "e} test lindex-8.1 {data reuse} -constraints testevalex -body { set x 0 testevalex {lindex $x $x} } -result 0 test lindex-8.2 {data reuse} -constraints testevalex -body { set a 0 testevalex {lindex $a $a $a} } -result 0 test lindex-8.3 {data reuse} -constraints { testevalex } -body { set a 1 testevalex {lindex $a $a $a} } -result {} test lindex-8.4 {data reuse} -constraints testevalex -body { set x [list 0 0] testevalex {lindex $x $x} } -result 0 test lindex-8.5 {data reuse} -constraints testevalex -body { set x 0 testevalex {lindex $x [list $x $x]} } -result 0 test lindex-8.6 {data reuse} -constraints testevalex -body { set x [list 1 1] testevalex {lindex $x $x} } -result {} test lindex-8.7 {data reuse} -constraints { testevalex } -body { set x 1 testevalex {lindex $x [list $x $x]} } -result {} #---------------------------------------------------------------------- # Compilation tests for lindex test lindex-9.1 {wrong # args} { list [catch {lindex} result] $result } "1 {wrong # args: should be \"lindex list ?index ...?\"}" test lindex-9.2 {ensure that compilation works in the right order} { proc foo {} { rename foo {} lindex 1 0 } foo } 1 # Indices that are lists or convertible to lists test lindex-10.1 {empty index list} { set x {} catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {{a b c} {a b c}} test lindex-10.2 {singleton index list} { set x { 1 } catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {b b} test lindex-10.3 {multiple indices in list} { set x {1 2} catch { list [lindex {{a b c} {d e f}} $x] [lindex {{a b c} {d e f}} $x] } result set result } {f f} test lindex-10.4 {malformed index list} { set x \{ list [catch { lindex {a b c} $x } result] $result } {1 bad\ index\ \"\{\":\ must\ be\ integer?\[+-\]integer?\ or\ end?\[+-\]integer?} # Indices that are integers or convertible to integers test lindex-11.1 {integer -1} { set x ${minus}1 catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {{} {}} test lindex-11.2 {integer 0} { set x [string range 00 0 0] catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {a a} test lindex-11.3 {integer 2} { set x [string range 22 0 0] catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {c c} test lindex-11.4 {integer 3} { set x [string range 33 0 0] catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {{} {}} test lindex-11.5 {bad octal} -body { set x 0o8 list [catch { lindex {a b c} $x } result] $result } -match glob -result {1 {*}} test lindex-11.6 {bad octal} -body { set x -0o9 list [catch { lindex {a b c} $x } result] $result } -match glob -result {1 {*}} # Indices relative to end test lindex-12.1 {index = end} { set x end catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {c c} test lindex-12.2 {index = end--1} { set x end--1 catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {{} {}} test lindex-12.3 {index = end-0} { set x end-0 catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {c c} test lindex-12.4 {index = end-2} { set x end-2 catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {a a} test lindex-12.5 {index = end-3} { set x end-3 catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {{} {}} test lindex-12.6 {bad octal} -body { set x end-0o8 list [catch { lindex {a b c} $x } result] $result } -match glob -result {1 {*}} test lindex-12.7 {bad octal} -body { set x end--0o9 list [catch { lindex {a b c} $x } result] $result } -match glob -result {1 {*}} test lindex-12.8 {bad integer, not octal} { set x end-0a2 list [catch { lindex {a b c} $x } result] $result } {1 {bad index "end-0a2": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-12.9 {obsolete test} { set x end catch { list [lindex {a b c} $x] [lindex {a b c} $x] } result set result } {c c} test lindex-12.10 {incomplete end-} { set x end- list [catch { lindex {a b c} $x } result] $result } {1 {bad index "end-": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-13.1 {bad second index} { list [catch { lindex {a b c} 0 0a2 } result] $result } {1 {bad index "0a2": must be integer?[+-]integer? or end?[+-]integer?}} test lindex-13.2 {good second index} { catch { lindex {{a b c} {d e f} {g h i}} 1 2 } result set result } f test lindex-13.3 {three indices} { catch { lindex {{{a b} {c d}} {{e f} {g h}}} 1 0 1 } result set result } f test lindex-14.1 {error conditions in parsing list} { list [catch { lindex "a \{" 2 } msg] $msg } {1 {unmatched open brace in list}} test lindex-14.2 {error conditions in parsing list} { list [catch { lindex {a {b c}d e} 2 } msg] $msg } {1 {list element in braces followed by "d" instead of space}} test lindex-14.3 {error conditions in parsing list} { list [catch { lindex {a "b c"def ghi} 2 } msg] $msg } {1 {list element in quotes followed by "def" instead of space}} test lindex-15.1 {quoted elements} { catch { lindex {a "b c" d} 1 } result set result } {b c} test lindex-15.2 {quoted elements} { catch { lindex {"{}" b c} 0 } result set result } {{}} test lindex-15.3 {quoted elements} { catch { lindex {ab "c d \" x" y} 1 } result set result } {c d " x} test lindex-15.4 {quoted elements} -body { catch { lindex {a b {c d "e} {f g"}} 2 } result set result } -result {c d "e} test lindex-16.1 {data reuse} -body { set x 0 catch { lindex $x $x } result set result } -result {0} test lindex-16.2 {data reuse} -body { set a 0 catch { lindex $a $a $a } result set result } -result 0 test lindex-16.3 {data reuse} -body { set a 1 catch { lindex $a $a $a } result set result } -result {} test lindex-16.4 {data reuse} -body { set x [list 0 0] catch { lindex $x $x } result set result } -result {0} test lindex-16.5 {data reuse} -body { set x 0 catch { lindex $x [list $x $x] } result set result } -result {0} test lindex-16.6 {data reuse} -body { set x [list 1 1] catch { lindex $x $x } result set result } -result {} test lindex-16.7 {data reuse} -body { set x 1 catch { lindex $x [list $x $x] } result set result } -result {} test lindex-17.0 {Bug 1718580} -body { lindex {} end foo } -match glob -result {bad index "foo"*} -returnCodes 1 test lindex-17.1 {Bug 1718580} -body { lindex a end foo } -match glob -result {bad index "foo"*} -returnCodes 1 test lindex-18.0 {nested bytecode execution} -setup { proc demo {i} {lindex {a b c} $i} } -body { demo 0+0x10000000000000000 } -cleanup { rename demo {} } catch { unset minus } # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/license.terms0000644000175000017500000000431715076154263015424 0ustar sergeisergeiThis software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. tcl9.0.3/tests/join.test0000644000175000017500000000324315104661341014553 0ustar sergeisergei# Commands covered: join # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test join-1.1 {basic join commands} { join {a b c} xyz } axyzbxyzc test join-1.2 {basic join commands} { join {a b c} {} } abc test join-1.3 {basic join commands} { join {} xyz } {} test join-1.4 {basic join commands} { join {12 34 56} } {12 34 56} test join-2.1 {join errors} { list [catch join msg] $msg $errorCode } {1 {wrong # args: should be "join list ?joinString?"} {TCL WRONGARGS}} test join-2.2 {join errors} { list [catch {join a b c} msg] $msg $errorCode } {1 {wrong # args: should be "join list ?joinString?"} {TCL WRONGARGS}} test join-2.3 {join errors} { list [catch {join "a \{ c" 111} msg] $msg $errorCode } {1 {unmatched open brace in list} {TCL VALUE LIST BRACE}} test join-3.1 {joinString is binary ok} { string length [join {a b c} a\0b] } 9 test join-3.2 {join is binary ok} { string length [join "a\0b a\0b a\0b"] } 11 test join-4.1 {shimmer segfault prevention} { set l {0 0} join $l $l } {00 00} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/ioTrans.test0000644000175000017500000016664315104661341015251 0ustar sergeisergei# -*- tcl -*- # Functionality covered: operation of the reflected transformation # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2007 Andreas Kupries # # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Custom constraints used in this file testConstraint testchannel [llength [info commands testchannel]] testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # testchannel cut|splice Both needed to test the reflection in threads. # thread::send #---------------------------------------------------------------------- # ### ### ### ######### ######### ######### ## Testing the reflected transformation. # Helper commands to record the arguments to handler methods. Stored in a # script so that the tests needing this code do not need their own copy but # can access this variable. set helperscript { if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # This forces the return options to be in the order that the test expects! variable optorder { -code !?! -level !?! -errorcode !?! -errorline !?! -errorinfo !?! -errorstack !?! } proc noteOpts opts { variable optorder lappend ::res [dict merge $optorder $opts] } # Helper command, canned result for 'initialize' method. Gets the # optional methods as arguments. Use return features to post the result # higher up. proc handle.initialize {args} { upvar args hargs if {[lindex $hargs 0] eq "initialize"} { return -code return [list {*}$args initialize finalize read write] } } proc handle.finalize {} { upvar args hargs if {[lindex $hargs 0] eq "finalize"} { return -code return "" } } proc handle.read {} { upvar args hargs if {[lindex $hargs 0] eq "read"} { return -code return "@" } } proc handle.drain {} { upvar args hargs if {[lindex $hargs 0] eq "drain"} { return -code return "<>" } } proc handle.clear {} { upvar args hargs if {[lindex $hargs 0] eq "clear"} { return -code return "" } } proc tempchan {{mode r+}} { global tempchan return [set tempchan [open [makeFile {test data} tempchanfile] $mode]] } proc tempdone {} { global tempchan catch {close $tempchan} removeFile tempchanfile return } proc tempview {} { viewFile tempchanfile } } # Set everything up in the main thread. eval $helperscript #puts <<[file channels]>> # ### ### ### ######### ######### ######### test iortrans-1.0 {chan, wrong#args} -returnCodes error -body { chan } -result {wrong # args: should be "chan subcommand ?arg ...?"} test iortrans-1.1 {chan, unknown method} -returnCodes error -body { chan foo } -match glob -result {unknown or ambiguous subcommand "foo": must be*} # --- --- --- --------- --------- --------- # chan push, and method "initialize" test iortrans-2.0 {chan push, wrong#args, not enough} -returnCodes error -body { chan push } -result {wrong # args: should be "chan push channel cmdprefix"} test iortrans-2.1 {chan push, wrong#args, too many} -returnCodes error -body { chan push a b c } -result {wrong # args: should be "chan push channel cmdprefix"} test iortrans-2.2 {chan push, invalid channel} -setup { proc foo {} {} } -returnCodes error -body { chan push {} foo } -cleanup { rename foo {} } -result {can not find channel named ""} test iortrans-2.3 {chan push, bad handler, not a list} -body { chan push [tempchan] "foo \{" } -returnCodes error -cleanup { tempdone } -result {unmatched open brace in list} test iortrans-2.4 {chan push, bad handler, not a command} -body { chan push [tempchan] foo } -returnCodes error -cleanup { tempdone } -result {invalid command name "foo"} test iortrans-2.5 {chan push, initialize failed, bad signature} -body { proc foo {} {} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -result {wrong # args: should be "foo"} test iortrans-2.6 {chan push, initialize failed, bad signature} -body { proc foo {} {} chan push [tempchan] ::foo } -returnCodes error -cleanup { tempdone rename foo {} } -result {wrong # args: should be "::foo"} test iortrans-2.7 {chan push, initialize failed, bad result, not a list} -body { proc foo {args} {return "\{"} catch {chan push [tempchan] foo} return $::errorInfo } -cleanup { tempdone rename foo {} } -match glob -result {chan handler "foo initialize" returned non-list: *} test iortrans-2.8 {chan push, initialize failed, bad result, not a list} -body { proc foo {args} {return \{\{\}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {chan handler "foo initialize" returned non-list: *} test iortrans-2.9 {chan push, initialize failed, bad result, empty list} -body { proc foo {args} {} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*all required methods*} test iortrans-2.10 {chan push, initialize failed, bad result, bogus method name} -body { proc foo {args} {return 1} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*bad method "1": must be *} test iortrans-2.11 {chan push, initialize failed, bad result, bogus method name} -body { proc foo {args} {return {a b c}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*bad method "c": must be *} test iortrans-2.12 {chan push, initialize failed, bad result, required methods missing} -body { # Required: initialize, and finalize. proc foo {args} {return {initialize}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*all required methods*} test iortrans-2.13 {chan push, initialize failed, bad result, illegal method name} -body { proc foo {args} {return {initialize finalize BOGUS}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*returned bad method "BOGUS": must be clear, drain, finalize, flush, initialize, limit?, read, or write} test iortrans-2.14 {chan push, initialize failed, bad result, mode/handler mismatch} -body { proc foo {args} {return {initialize finalize}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*makes the channel inaccessible} # iortrans-2.15 event/watch methods elimimated, removed these tests. # iortrans-2.16 test iortrans-2.17 {chan push, initialize failed, bad result, drain/read mismatch} -body { proc foo {args} {return {initialize finalize drain write}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*supports "drain" but not "read"} test iortrans-2.18 {chan push, initialize failed, bad result, flush/write mismatch} -body { proc foo {args} {return {initialize finalize flush read}} chan push [tempchan] foo } -returnCodes error -cleanup { tempdone rename foo {} } -match glob -result {*supports "flush" but not "write"} test iortrans-2.19 {chan push, initialize ok, creates channel} -setup { set res {} } -match glob -body { proc foo {args} { global res lappend res $args if {[lindex $args 0] ne "initialize"} {return} return {initialize finalize drain flush read write} } lappend res [file channel rt*] lappend res [chan push [tempchan] foo] lappend res [close [lindex $res end]] lappend res [file channel rt*] } -cleanup { tempdone rename foo {} } -result {{} {initialize rt* {read write}} file* {drain rt*} {flush rt*} {finalize rt*} {} {}} test iortrans-2.20 {chan push, init failure -> no channel, no finalize} -setup { set res {} } -match glob -body { proc foo {args} { global res lappend res $args return } lappend res [file channel rt*] lappend res [catch {chan push [tempchan] foo} msg] $msg lappend res [file channel rt*] } -cleanup { tempdone rename foo {} } -result {{} {initialize rt* {read write}} 1 {*all required methods*} {}} # --- --- --- --------- --------- --------- # method finalize (via close) # General note: file channels rt* finds the transform channel, however the # name reported will be that of the underlying base driver, fileXX here. This # actually allows us to see if the whole channel is gone, or only the # transformation, but not the base. test iortrans-3.1 {chan finalize, handler destruction has no effect on channel} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return } lappend res [set c [chan push [tempchan] foo]] rename foo {} lappend res [file channels file*] lappend res [file channels rt*] lappend res [catch {close $c} msg] $msg lappend res [file channels file*] lappend res [file channels rt*] } -cleanup { tempdone } -result {{initialize rt* {read write}} file* file* {} 1 {invalid command name "foo"} {} {}} test iortrans-3.2 {chan finalize, for close} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return } lappend res [set c [chan push [tempchan] foo]] close $c # Close deleted the channel. lappend res [file channels rt*] # Channel destruction does not kill handler command! lappend res [info command foo] } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} {} foo} test iortrans-3.3 {chan finalize, for close, error, close error} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code error 5 } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg # Channel is gone despite error. lappend res [file channels rt*] } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 5 {}} test iortrans-3.4 {chan finalize, for close, error, close error} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize error FOO } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg $::errorInfo } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 FOO {FOO *"close $c"}} test iortrans-3.5 {chan finalize, for close, arbitrary result, ignored} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return SOMETHING } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 0 {}} test iortrans-3.6 {chan finalize, for close, break, close error} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 3 } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.7 {chan finalize, for close, continue, close error} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 4 } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.8 {chan finalize, for close, custom code, close error} -setup { set res {} } -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 777 BANG } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg] $msg } -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans-3.9 {chan finalize, for close, ignore level, close error} -setup { set res {} } -body { proc foo {args} { lappend ::res $args handle.initialize return -level 5 -code 777 BANG } lappend res [set c [chan push [tempchan] foo]] lappend res [catch {close $c} msg opt] $msg noteOpts $opt } -match glob -cleanup { rename foo {} tempdone } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "finalize"*}} # --- === *** ########################### # method read (via read) test iortrans-4.1 {chan read, transform call and return} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return snarf } set c [chan push [tempchan] foo] lappend res [read $c 10] } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} snarf} test iortrans-4.2 {chan read, for non-readable channel} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args MUST_NOT_HAPPEN } set c [chan push [tempchan w] foo] lappend res [catch {read $c 2} msg] $msg } -cleanup { tempdone rename foo {} } -result {1 {channel "file*" wasn't opened for reading}} test iortrans-4.3 {chan read, error return} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error BOOM! } set c [chan push [tempchan] foo] lappend res [catch {read $c 2} msg] $msg } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} 1 BOOM!} test iortrans-4.4 {chan read, break return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code break BOOM! } set c [chan push [tempchan] foo] lappend res [catch {read $c 2} msg] $msg } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} 1 *bad code*} test iortrans-4.5 {chan read, continue return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code continue BOOM! } set c [chan push [tempchan] foo] lappend res [catch {read $c 2} msg] $msg } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} 1 *bad code*} test iortrans-4.6 {chan read, custom return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res [catch {read $c 2} msg] $msg } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} 1 *bad code*} test iortrans-4.7 {chan read, level is squashed} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -level 55 -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res [catch {read $c 2} msg opt] $msg noteOpts $opt } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} test iortrans-4.8 {chan read, read, bug 2921116} -setup { set res {} } -match glob -body { proc foo {fd args} { handle.initialize handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] lappend res [read $c] #lappend res [gets $c] } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} {}} test iortrans-4.8.1 {chan read, bug 721ec69271} -setup { set res {} } -match glob -body { proc foo {fd args} { handle.initialize handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] chan configure $c -buffersize 2 lappend res [read $c] } -cleanup { tempdone rename foo {} } -result {{read rt* te} {read rt* st} {read rt* { d}} {read rt* at} {read rt* {a }} {}} test iortrans-4.8.2 {chan read, bug 721ec69271} -setup { set res {} } -match glob -body { proc foo {fd args} { handle.initialize handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] return x } set c [chan push [set c [tempchan]] [list foo $c]] chan configure $c -buffersize 1 lappend res [read $c] } -cleanup { tempdone rename foo {} } -result {{read rt* t} {read rt* e} {read rt* s} {read rt* t} {read rt* { }} {read rt* d} {read rt* a} {read rt* t} {read rt* a} {read rt* { }} {}} test iortrans-4.9 {chan read, gets, bug 2921116} -setup { set res {} } -match glob -body { proc foo {fd args} { handle.initialize handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] lappend res [gets $c] } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} {}} # Driver for a base channel that emits several short "files" # with each terminated by a fleeting EOF proc driver {cmd args} { variable ::tcl::buffer variable ::tcl::index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) ..... return {initialize finalize watch read} } finalize { if {![info exists index($chan)]} {return} unset index($chan) buffer($chan) array unset index array unset buffer return } watch {} read { set n [lindex $args 1] if {![info exists index($chan)]} { driver initialize $chan } set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new if {[string length $result] == 0} { driver finalize $chan } return $result } } } namespace eval reflector { proc initialize {_ chan mode} { return {initialize finalize watch read} } proc finalize {_ chan} { foreach id [after info] { after cancel $id } namespace delete $_ } proc read {_ chan count} { namespace upvar $_ source source set res [string range $source 0 $count-1] set source [string range $source $count end] return $res } proc watch {_ chan events} { after 0 [list chan postevent $chan read] return read } namespace ensemble create -parameters _ namespace export * } namespace eval inputfilter { proc initialize {chan mode} { return {initialize finalize read} } proc read {chan buffer} { return $buffer } proc finalize chan { namespace delete $chan } namespace ensemble create namespace export * } # Channel read transform that is just the identity - pass all through proc idxform {cmd handle args} { switch -- $cmd { initialize { return {initialize finalize read} } finalize { return } read { lassign $args buffer return $buffer } } } # Test that all EOFs pass through full xform stack. Proper data boundaries. # Check robustness against buffer sizes. test iortrans-4.10 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] idxform] list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} test iortrans-4.10.1 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] idxform] chan configure $chan -buffersize 3 list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} test iortrans-4.10.2 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] idxform] chan configure $chan -buffersize 5 list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} rename idxform {} # Channel read transform that delays the data and always returns something proc delayxform {cmd handle args} { variable store switch -- $cmd { initialize { set store($handle) {} return {initialize finalize read drain} } finalize { unset store($handle) return } read { lassign $args buffer if {$store($handle) eq {}} { set reply [string index $buffer 0] set store($handle) [string range $buffer 1 end] } else { set reply $store($handle) set store($handle) $buffer } return $reply } drain { delayxform read $handle {} } } } # Test that all EOFs pass through full xform stack. Proper data boundaries. # Check robustness against buffer sizes. test iortrans-4.11 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] delayxform] list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} test iortrans-4.11.1 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] delayxform] chan configure $chan -buffersize 3 list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} test iortrans-4.11.2 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] delayxform] chan configure $chan -buffersize 5 list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} rename delayxform {} # Channel read transform that delays the data and may return {} proc delay2xform {cmd handle args} { variable store switch -- $cmd { initialize { set store($handle) {} return {initialize finalize read drain} } finalize { unset store($handle) return } read { lassign $args buffer set reply $store($handle) set store($handle) $buffer return $reply } drain { delay2xform read $handle {} } } } test iortrans-4.12 {[5adbc350683] chan read, handle fleeting EOF} -body { set chan [chan push [chan create read driver] delay2xform] list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} rename delay2xform {} rename driver {} # --- === *** ########################### # method write (via puts) test iortrans-5.1 {chan write, regular write} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return transformresult } set c [chan push [tempchan] foo] puts -nonewline $c snarf flush $c close $c lappend res [tempview] } -cleanup { tempdone rename foo {} } -result {{write rt* snarf} transformresult} test iortrans-5.2 {chan write, no write is ok, no change to file} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return } set c [chan push [tempchan] foo] puts -nonewline $c snarfsnarfsnarf flush $c close $c lappend res [tempview]; # This has to show the original data, as nothing was written } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} {test data}} test iortrans-5.3 {chan write, failed write} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error FAIL! } set c [chan push [tempchan] foo] puts -nonewline $c snarfsnarfsnarf lappend res [catch {flush $c} msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 FAIL!} test iortrans-5.4 {chan write, non-writable channel} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args MUST_NOT_HAPPEN return } set c [chan push [tempchan r] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { close $c tempdone rename foo {} } -result {1 {channel "file*" wasn't opened for writing}} test iortrans-5.5 {chan write, failed write, error return} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error BOOM! } set c [chan push [tempchan] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 BOOM!} test iortrans-5.6 {chan write, failed write, error return} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args error BOOM! } set c [chan push [tempchan] foo] lappend res {*}[catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 BOOM!} test iortrans-5.7 {chan write, failed write, break return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code break BOOM! } set c [chan push [tempchan] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans-5.8 {chan write, failed write, continue return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code continue BOOM! } set c [chan push [tempchan] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans-5.9 {chan write, failed write, custom return is error} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans-5.10 {chan write, failed write, level is ignored} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -level 55 -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg opt] $msg noteOpts $opt } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline * -errorinfo *bad code*subcommand "write"*}} test iortrans-5.11 {chan write, bug 2921116} -match glob -setup { set res {} set level 0 } -body { proc foo {fd args} { handle.initialize handle.finalize lappend ::res $args # pop - invokes flush - invokes 'foo write' - infinite recursion - stop it global level if {$level} { return } incr level # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] lappend res [puts -nonewline $c abcdef] lappend res [flush $c] } -cleanup { tempdone rename foo {} } -result {{} {write rt* abcdef} {write rt* abcdef} {}} # --- === *** ########################### # method limit?, drain (via read) test iortrans-6.1 {chan read, read limits} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize limit? handle.finalize lappend ::res $args handle.read return 6 } set c [chan push [tempchan] foo] lappend res [read $c 10] } -cleanup { tempdone rename foo {} } -result {{limit? rt*} {read rt* {test d}} {limit? rt*} {read rt* {ata }} {limit? rt*} @@} test iortrans-6.2 {chan read, read transform drain on eof} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize drain handle.finalize lappend ::res $args handle.read handle.drain return } set c [chan push [tempchan] foo] lappend res [read $c] lappend res [close $c] } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} {drain rt*} @<> {}} # --- === *** ########################### # method clear (via puts, seek) test iortrans-7.1 {chan write, write clears read buffers} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args handle.clear return transformresult } set c [chan push [tempchan] foo] puts -nonewline $c snarf flush $c return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*} {write rt* snarf}} test iortrans-7.2 {seek clears read buffers} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args return } set c [chan push [tempchan] foo] seek $c 2 return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*}} test iortrans-7.3 {clear, any result is ignored} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args return -code error "X" } set c [chan push [tempchan] foo] seek $c 2 return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*}} test iortrans-7.4 {chan clear, bug 2921116} -match glob -setup { set res {} } -body { proc foo {fd args} { handle.initialize clear handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] seek $c 2 return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*}} # --- === *** ########################### # method flush (via seek, close) test iortrans-8.1 {seek flushes write buffers, ignores data} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize flush handle.finalize lappend ::res $args return X } set c [chan push [tempchan] foo] # Flush, no writing seek $c 2 # The close flushes again, this modifies the file! lappend res | lappend res [close $c] | [tempview] } -cleanup { tempdone rename foo {} } -result {{flush rt*} | {flush rt*} {} | {teXt data}} test iortrans-8.2 {close flushes write buffers, writes data} -setup { set res {} } -match glob -body { proc foo {args} { handle.initialize flush lappend ::res $args handle.finalize return .flushed. } set c [chan push [tempchan] foo] close $c lappend res [tempview] } -cleanup { tempdone rename foo {} } -result {{flush rt*} {finalize rt*} .flushed.} test iortrans-8.3 {chan flush, bug 2921116} -match glob -setup { set res {} } -body { proc foo {fd args} { handle.initialize flush handle.finalize lappend ::res $args # Kill and recreate transform while it is operating chan pop $fd chan push $fd [list foo $fd] } set c [chan push [set c [tempchan]] [list foo $c]] seek $c 2 set res } -cleanup { tempdone rename foo {} } -result {{flush rt*}} # --- === *** ########################### # method watch - removed from TIP (rev 1.12+) # --- === *** ########################### # method event - removed from TIP (rev 1.12+) # --- === *** ########################### # 'Pull the rug' tests. Create channel in a interpreter A, move to other # interpreter B, destroy the origin interpreter (A) before or during access # from B. Must not crash, must return proper errors. test iortrans-11.0 {origin interpreter of moved transform gone} -setup { set ida [interp create]; #puts <<$ida>> set idb [interp create]; #puts <<$idb>> # Magic to get the test* commands in the children load {} Tcltest $ida load {} Tcltest $idb } -constraints {testchannel} -match glob -body { # Set up channel and transform in interpreter interp eval $ida $helperscript interp eval $ida [list ::variable tempchan [tempchan]] interp transfer {} $::tempchan $ida set chan [interp eval $ida { variable tempchan proc foo {args} { handle.initialize clear drain flush limit? read write handle.finalize lappend ::res $args return } set chan [chan push $tempchan foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd interpreter, transform goes with it. interp eval $ida [list testchannel cut $chan] interp eval $idb [list testchannel splice $chan] # Kill origin interpreter, then access channel from 2nd interpreter. interp delete $ida set res {} lappend res \ [catch {interp eval $idb [list puts $chan shoo]} msg] $msg \ [catch {interp eval $idb [list tell $chan]} msg] $msg \ [catch {interp eval $idb [list seek $chan 1]} msg] $msg \ [catch {interp eval $idb [list gets $chan]} msg] $msg \ [catch {interp eval $idb [list close $chan]} msg] $msg #lappend res [interp eval $ida {set res}] # actions: clear|write|clear|write|clear|flush|limit?|drain|flush # The 'tell' is ok, as it passed through the transform to the base channel # without invoking the transform handler. } -cleanup { tempdone interp delete $idb } -result {1 {Owner lost} 0 0 1 {Owner lost} 1 {Owner lost} 1 {Owner lost}} test iortrans-11.1 {origin interpreter of moved transform destroyed during access} -setup { set ida [interp create]; #puts <<$ida>> set idb [interp create]; #puts <<$idb>> # Magic to get the test* commands in the children load {} Tcltest $ida load {} Tcltest $idb } -constraints {testchannel} -match glob -body { # Set up channel in thread set chan [interp eval $ida $helperscript] interp eval $ida [list ::variable tempchan [tempchan]] interp transfer {} $::tempchan $ida set chan [interp eval $ida { proc foo {args} { handle.initialize clear drain flush limit? read write handle.finalize lappend ::res $args # Destroy interpreter during channel access. suicide } set chan [chan push $tempchan foo] fconfigure $chan -buffering none set chan }] interp alias $ida suicide {} interp delete $ida # Move channel to 2nd thread, transform goes with it. interp eval $ida [list testchannel cut $chan] interp eval $idb [list testchannel splice $chan] # Run access from interpreter B, this will give us a synchronous response. interp eval $idb [list set chan $chan] interp eval $idb [list set mid $tcltest::mainThread] set res [interp eval $idb { # Wait a bit, give the main thread the time to start its event loop to # wait for the response from B after 50 catch { puts $chan shoo } res set res }] } -cleanup { interp delete $idb tempdone } -result {Owner lost} test iortrans-11.2 {delete interp of reflected transform} -setup { interp create child # Magic to get the test* commands into the child load {} Tcltest child } -constraints {testchannel} -body { # Get base channel into the child set c [tempchan] testchannel cut $c interp eval child [list testchannel splice $c] interp eval child [list set c $c] child eval { proc no-op args {} proc driver {c sub args} { return {initialize finalize read write} } set t [chan push $c [list driver $c]] chan event $c readable no-op } interp delete child } -cleanup { tempdone } -result {} # ### ### ### ######### ######### ######### ## Same tests as above, but exercising the code forwarding and receiving ## driver operations to the originator thread. # ### ### ### ######### ######### ######### ## Testing the reflected channel (Thread forwarding). # ## The id numbers refer to the original test without thread forwarding, and ## gaps due to tests not applicable to forwarding are left to keep this ## association. # ### ### ### ######### ######### ######### ## Helper command. Runs a script in a separate thread and returns the result. ## A channel is transferred into the thread as well, and a list of configuration ## variables proc inthread {chan script args} { # Test thread. set tid [thread::create -preserved] thread::send $tid {load {} Tcltest} # Init thread configuration. # - Listed variables # - Id of main thread # - A number of helper commands foreach v $args { upvar 1 $v x thread::send $tid [list set $v $x] } thread::send $tid [list set mid [thread::id]] thread::send $tid { proc notes {} { return $::notes } proc noteOpts opts { lappend ::notes [dict merge { -code !?! -level !?! -errorcode !?! -errorline !?! -errorinfo !?! -errorstack !?! } $opts] } } thread::send $tid [list proc s {} [list uplevel 1 $script]]; # (*) # Transfer channel (cut/splice aka detach/attach) testchannel cut $chan thread::send $tid [list testchannel splice $chan] # Run test script, also run local event loop! The local event loop waits # for the result to come back. It is also necessary for the execution of # forwarded channel operations. set ::tres "" thread::send -async $tid { after 50 catch {s} res; # This runs the script, 's' was defined at (*) thread::send -async $mid [list set ::tres $res] } vwait ::tres # Remove test thread, and return the captured result. thread::release $tid return $::tres } # ### ### ### ######### ######### ######### test iortrans.tf-3.2 {chan finalize, for close} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return {} } lappend res [set c [chan push [tempchan] foo]] lappend res [inthread $c { close $c # Close the deleted the channel. file channels rt* } c] # Channel destruction does not kill handler command! lappend res [info command foo] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} {} foo} test iortrans.tf-3.3 {chan finalize, for close, error, close error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code error 5 } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg # Channel is gone despite error. lappend notes [file channels rt*] notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 5 {}} test iortrans.tf-3.4 {chan finalize, for close, error, close errror} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { lappend ::res $args handle.initialize error FOO } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg notes } c] } -match glob -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 FOO} test iortrans.tf-3.5 {chan finalize, for close, arbitrary result} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return SOMETHING } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 0 {}} test iortrans.tf-3.6 {chan finalize, for close, break, close error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 3 } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans.tf-3.7 {chan finalize, for close, continue, close error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 4 } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans.tf-3.8 {chan finalize, for close, custom code, close error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -code 777 BANG } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg] $msg notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code*} test iortrans.tf-3.9 {chan finalize, for close, ignore level, close error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { lappend ::res $args handle.initialize return -level 5 -code 777 BANG } lappend res [set c [chan push [tempchan] foo]] lappend res {*}[inthread $c { lappend notes [catch {close $c} msg opt] $msg noteOpts $opt notes } c] } -cleanup { rename foo {} } -result {{initialize rt* {read write}} file* {finalize rt*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "finalize"*}} # --- === *** ########################### # method read test iortrans.tf-4.1 {chan read, transform call and return} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return snarf } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [read $c 10] close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} snarf} test iortrans.tf-4.2 {chan read, for non-readable channel} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args MUST_NOT_HAPPEN } set c [chan push [tempchan w] foo] lappend res {*}[inthread $c { lappend notes [catch {[read $c 2]} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {1 {channel "file*" wasn't opened for reading}} test iortrans.tf-4.3 {chan read, error return} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch {read $c 2} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} 1 BOOM!} test iortrans.tf-4.4 {chan read, break return is error} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code break BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch {read $c 2} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} 1 *bad code*} test iortrans.tf-4.5 {chan read, continue return is error} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code continue BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch {read $c 2} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} 1 *bad code*} test iortrans.tf-4.6 {chan read, custom return is error} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch {read $c 2} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} 1 *bad code*} test iortrans.tf-4.7 {chan read, level is squashed} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -level 55 -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch {read $c 2} msg opt] $msg noteOpts $opt close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{read rt* {test data }} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} # --- === *** ########################### # method write test iortrans.tf-5.1 {chan write, regular write} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return transformresult } set c [chan push [tempchan] foo] inthread $c { puts -nonewline $c snarf flush $c close $c } c lappend res [tempview] } -cleanup { tempdone rename foo {} } -result {{write rt* snarf} transformresult} test iortrans.tf-5.2 {chan write, no write is ok, no change to file} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return } set c [chan push [tempchan] foo] inthread $c { puts -nonewline $c snarfsnarfsnarf flush $c close $c } c lappend res [tempview]; # This has to show the original data, as nothing was written } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} {test data}} test iortrans.tf-5.3 {chan write, failed write} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error FAIL! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { puts -nonewline $c snarfsnarfsnarf lappend notes [catch {flush $c} msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 FAIL!} test iortrans.tf-5.4 {chan write, non-writable channel} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args MUST_NOT_HAPPEN return } set c [chan push [tempchan r] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -result {1 {channel "file*" wasn't opened for writing}} test iortrans.tf-5.5 {chan write, failed write, error return} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code error BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 BOOM!} test iortrans.tf-5.6 {chan write, failed write, error return} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args error BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 BOOM!} test iortrans.tf-5.7 {chan write, failed write, break return is error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code break BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans.tf-5.8 {chan write, failed write, continue return is error} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code continue BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans.tf-5.9 {chan write, failed write, custom return is error} -setup { set res {} } -constraints {testchannel thread} -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg] $msg close $c notes } c] } -cleanup { tempdone rename foo {} } -match glob -result {{write rt* snarfsnarfsnarf} 1 *bad code*} test iortrans.tf-5.10 {chan write, failed write, level is ignored} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize handle.finalize lappend ::res $args return -level 55 -code 777 BOOM! } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [catch { puts -nonewline $c snarfsnarfsnarf flush $c } msg opt] $msg noteOpts $opt close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{write rt* snarfsnarfsnarf} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline * -errorinfo *bad code*subcommand "write"*}} # --- === *** ########################### # method limit?, drain (via read) test iortrans.tf-6.1 {chan read, read limits} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize limit? handle.finalize lappend ::res $args handle.read return 6 } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [read $c 10] close $c notes } c] } -cleanup { tempdone rename foo {} } -result {{limit? rt*} {read rt* {test d}} {limit? rt*} {read rt* {ata }} {limit? rt*} @@} test iortrans.tf-6.2 {chan read, read transform drain on eof} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize drain handle.finalize lappend ::res $args handle.read handle.drain return } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { lappend notes [read $c] lappend notes [close $c] } c] } -cleanup { tempdone rename foo {} } -result {{read rt* {test data }} {drain rt*} @<> {}} # --- === *** ########################### # method clear (via puts, seek) test iortrans.tf-7.1 {chan write, write clears read buffers} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args handle.clear return transformresult } set c [chan push [tempchan] foo] inthread $c { puts -nonewline $c snarf flush $c close $c } c return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*} {write rt* snarf}} test iortrans.tf-7.2 {seek clears read buffers} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args return } set c [chan push [tempchan] foo] inthread $c { seek $c 2 close $c } c return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*}} test iortrans.tf-7.3 {clear, any result is ignored} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize clear handle.finalize lappend ::res $args return -code error "X" } set c [chan push [tempchan] foo] inthread $c { seek $c 2 close $c } c return $res } -cleanup { tempdone rename foo {} } -result {{clear rt*}} # --- === *** ########################### # method flush (via seek, close) test iortrans.tf-8.1 {seek flushes write buffers, ignores data} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize flush handle.finalize lappend ::res $args return X } set c [chan push [tempchan] foo] lappend res {*}[inthread $c { # Flush, no writing seek $c 2 # The close flushes again, this modifies the file! lappend notes | [close $c] | # NOTE: The flush generated by the close is recorded immediately, the # other note's here are deferred until after the thread is done. This # changes the order of the result a bit from the non-threaded case # (The first | moves one to the right). This is an artifact of the # 'inthread' framework, not of the transformation itself. notes } c] lappend res [tempview] } -cleanup { tempdone rename foo {} } -result {{flush rt*} {flush rt*} | {} | {teXt data}} test iortrans.tf-8.2 {close flushes write buffers, writes data} -setup { set res {} } -constraints {testchannel thread} -match glob -body { proc foo {args} { handle.initialize flush lappend ::res $args handle.finalize return .flushed. } set c [chan push [tempchan] foo] inthread $c { close $c } c lappend res [tempview] } -cleanup { tempdone rename foo {} } -result {{flush rt*} {finalize rt*} .flushed.} # --- === *** ########################### # method watch - removed from TIP (rev 1.12+) # --- === *** ########################### # method event - removed from TIP (rev 1.12+) # --- === *** ########################### # 'Pull the rug' tests. Create channel in a thread A, move to other thread B, # destroy the origin thread (A) before or during access from B. Must not # crash, must return proper errors. test iortrans.tf-11.0 {origin thread of moved transform gone} -setup { #puts <<$tcltest::mainThread>>main set tida [thread::create -preserved]; #puts <<$tida>> thread::send $tida {load {} Tcltest} set tidb [thread::create -preserved]; #puts <<$tida>> thread::send $tidb {load {} Tcltest} } -constraints {testchannel thread} -match glob -body { # Set up channel in thread thread::send $tida $helperscript thread::send $tidb $helperscript set chan [thread::send $tida { proc foo {args} { handle.initialize clear drain flush limit? read write handle.finalize lappend ::res $args return } set chan [chan push [tempchan] foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd thread, transform goes with it. thread::send $tida [list testchannel cut $chan] thread::send $tidb [list testchannel splice $chan] # Kill origin thread, then access channel from 2nd thread. thread::release -wait $tida set res {} lappend res [catch {thread::send $tidb [list puts $chan shoo]} msg] $msg lappend res [catch {thread::send $tidb [list tell $chan]} msg] $msg lappend res [catch {thread::send $tidb [list seek $chan 1]} msg] $msg lappend res [catch {thread::send $tidb [list gets $chan]} msg] $msg lappend res [catch {thread::send $tidb [list close $chan]} msg] $msg # The 'tell' is ok, as it passed through the transform to the base # channel without invoking the transform handler. } -cleanup { thread::send $tidb tempdone thread::release $tidb } -result {1 {Owner lost} 0 0 1 {Owner lost} 1 {Owner lost} 1 {Owner lost}} test iortrans.tf-11.1 {origin thread of moved transform destroyed during access} -setup { #puts <<$tcltest::mainThread>>main set tida [thread::create -preserved]; #puts <<$tida>> thread::send $tida {load {} Tcltest} set tidb [thread::create -preserved]; #puts <<$tidb>> thread::send $tidb {load {} Tcltest} } -constraints {testchannel thread notValgrind} -match glob -body { # Set up channel in thread thread::send $tida $helperscript thread::send $tidb $helperscript set chan [thread::send $tida { proc foo {args} { handle.initialize clear drain flush limit? read write handle.finalize lappend ::res $args # destroy thread during channel access thread::exit } set chan [chan push [tempchan] foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd thread, transform goes with it. thread::send $tida [list testchannel cut $chan] thread::send $tidb [list testchannel splice $chan] # Run access from thread B, wait for response from A (A is not using event # loop at this point, so the event pile up in the queue. thread::send $tidb [list set chan $chan] thread::send $tidb [list set mid [thread::id]] thread::send -async $tidb { # Wait a bit, give the main thread the time to start its event loop to # wait for the response from B after 50 catch { puts $chan shoo } res catch { close $chan } thread::send -async $mid [list set ::res $res] } vwait ::res set res } -cleanup { thread::send $tidb tempdone thread::release $tidb } -result {Owner lost} test iortrans-ea69b0258a9833cb { Crash when using a channel transformation on TCP client socket "line two" does not make it into result. This issue should probably be addressed, but it is outside the scope of this test. } -setup { set res {} set read 0 } -body { namespace eval reflector1 { variable source "line one\nline two" interp alias {} [namespace current]::dispatch {} [ namespace parent]::reflector [namespace current] } set chan [chan create read [namespace which reflector1::dispatch]] chan configure $chan -blocking 0 chan push $chan inputfilter chan event $chan read [list ::apply [list chan { variable res variable read set gets [gets $chan] append res $gets incr read } [namespace current]] $chan] vwait [namespace current]::read chan pop $chan vwait [namespace current]::read return $res } -cleanup { catch {unset read} close $chan } -result {line one} cleanupTests return tcl9.0.3/tests/iogt.test0000644000175000017500000006017215104661341014562 0ustar sergeisergei# -*- tcl -*- # Commands covered: transform, and stacking in general # # This file contains a collection of tests for Giot # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright © 2000 Ajuba Solutions. # Copyright © 2000 Andreas Kupries. # All rights reserved. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] namespace eval ::tcl::test::iogt { namespace import ::tcltest::* testConstraint testchannel [llength [info commands testchannel]] set path(dummy) [makeFile {abcdefghijklmnopqrstuvwxyz0123456789,./?><;'\|":[]\}\{`~!@#$%^&*()_+-= } dummy] # " capture coloring of quotes set path(dummyout) [makeFile {} dummyout] set path(__echo_srv__.tcl) [makeFile { #!/usr/local/bin/tclsh # -*- tcl -*- # echo server # # arguments, options: port to listen on for connections. # delay till echo of first block # delay between blocks # blocksize ... set port [lindex $argv 0] set fdelay [lindex $argv 1] set idelay [lindex $argv 2] set bsizes [lrange $argv 3 end] set c 0 proc newconn {sock rhost rport} { variable fdelay variable c incr c namespace upvar [namespace current] c$c conn #puts stdout "C $sock $rhost $rport / $fdelay" ; flush stdout set conn(after) {} set conn(state) 0 set conn(size) 0 set conn(data) "" set conn(delay) $fdelay fileevent $sock readable [list echoGet $c $sock] fconfigure $sock -translation binary -buffering none -blocking 0 } proc echoGet {c sock} { variable fdelay namespace upvar [namespace current] c$c conn if {[eof $sock]} { # one-shot echo exit } append conn(data) [read $sock] #puts stdout "G $c $sock $conn(data) <<$conn(data)>>" ; flush stdout if {$conn(after) == {}} { set conn(after) [after $conn(delay) [list echoPut $c $sock]] } } proc echoPut {c sock} { variable idelay variable fdelay variable bsizes namespace upvar [namespace current] c$c conn if {[string length $conn(data)] == 0} { #puts stdout "C $c $sock" ; flush stdout # auto terminate close $sock exit #set conn(delay) $fdelay return } set conn(delay) $idelay set n [lindex $bsizes $conn(size)] #puts stdout "P $c $sock $n >>" ; flush stdout #puts __________________________________________ #parray conn #puts n=<$n> if {[string length $conn(data)] >= $n} { puts -nonewline $sock [string range $conn(data) 0 $n] set conn(data) [string range $conn(data) [incr n] end] } incr conn(size) if {$conn(size) >= [llength $bsizes]} { set conn(size) [expr {[llength $bsizes]-1}] } set conn(after) [after $conn(delay) [list echoPut $c $sock]] } #fileevent stdin readable {exit ;#cut} # main socket -server newconn -myaddr 127.0.0.1 $port vwait forever } __echo_srv__.tcl] ######################################################################## proc fevent {fdelay idelay blocks script data} { # Start and initialize an echo server, prepare data transmission, then # hand over to the test script. This has to start real transmission via # 'flush'. The server is stopped after completion of the test. upvar 1 sock sk # Fixed port, not so good. Lets hope for the best, for now. set port 4000 exec tclsh __echo_srv__.tcl $port $fdelay $idelay {*}$blocks >@stdout & after 500 #puts stdout "> $port"; flush stdout set sk [socket localhost $port] fconfigure $sk -blocking 0 -buffering full \ -buffersize [expr {10+[llength $data]}] puts -nonewline $sk $data # The channel is prepared to go off. #puts stdout ">>>>>"; flush stdout set res [uplevel 1 $script] catch {close $sk} return $res } # -------------------------------------------------------------- # utility transformations ... proc id {op data} { switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { #ignore } flush/write - flush/read - write - read { return $data } query/maxRead { return -1 } } } proc id_optrail {var op data} { variable $var upvar 0 $var trail lappend trail $op switch -- $op { create/write - create/read - delete/write - delete/read - flush/read - clear/read { #ignore } flush/write - write - read { return $data } query/maxRead { return -1 } default { lappend trail "error $op" error $op } } } proc id_fulltrail {var op data} { namespace upvar [namespace current] $var trail #puts stdout ">> $var $op $data" ; flush stdout switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { set res *ignored* } flush/write - flush/read - write - read { set res $data } query/maxRead { set res -1 } } #catch {puts stdout "\t>* $res" ; flush stdout} #catch {puts stdout "x$res"} msg lappend trail [list $op $data $res] return $res } proc id_torture {chan op data} { switch -- $op { create/write - create/read - delete/write - delete/read - clear_read {;#ignore} flush/write - flush/read {} write { global level if {$level} { return } incr level testchannel unstack $chan testchannel transform $chan \ -command [namespace code [list id_torture $chan]] return $data } read { testchannel unstack $chan testchannel transform $chan \ -command [namespace code [list id_torture $chan]] return $data } query/maxRead {return -1} } } proc counter {var op data} { namespace upvar [namespace current] $var n switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { #ignore } flush/write - flush/read { return {} } write { return $data } read { if {$n > 0} { incr n -[string length $data] if {$n < 0} { set n 0 } } return $data } query/maxRead { return $n } } } proc counter_audit {var vtrail op data} { namespace upvar [namespace current] $var n $vtrail trail switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { set res {} } flush/write - flush/read { set res {} } write { set res $data } read { if {$n > 0} { incr n -[string length $data] if {$n < 0} { set n 0 } } set res $data } query/maxRead { set res $n } } lappend trail [list counter:$op $data $res] return $res } proc rblocks {var vtrail n op data} { namespace upvar [namespace current] $var buf $vtrail trail set res {} switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { set buf {} } flush/write { } flush/read { set res $buf set buf {} } write { set data } read { append buf $data set b [expr {$n * ([string length $buf] / $n)}] append op " $n [string length $buf] :- $b" set res [string range $buf 0 [incr b -1]] set buf [string range $buf [incr b] end] #return $res } query/maxRead { set res -1 } } lappend trail [list rblock | $op $data $res | $buf] return $res } # -------------------------------------------------------------- # ... and convenience procedures to stack them proc identity {-attach channel} { testchannel transform $channel -command [namespace code id] } proc audit_ops {var -attach channel} { testchannel transform $channel -command [namespace code [list id_optrail $var]] } proc audit_flow {var -attach channel} { testchannel transform $channel -command [namespace code [list id_fulltrail $var]] } proc torture {-attach channel} { testchannel transform $channel -command [namespace code [list id_torture $channel]] } proc stopafter {var n -attach channel} { namespace upvar [namespace current] $var vn set vn $n testchannel transform $channel -command [namespace code [list counter $var]] } proc stopafter_audit {var trail n -attach channel} { namespace upvar [namespace current] $var vn set vn $n testchannel transform $channel -command [namespace code [list counter_audit $var $trail]] } proc rblocks_t {var trail n -attach channel} { testchannel transform $channel -command [namespace code [list rblocks $var $trail $n]] } # -------------------------------------------------------------- # serialize an array, with keys in sorted order. proc array_sget {v} { upvar $v a set res [list] foreach n [lsort [array names a]] { lappend res $n $a($n) } set res } proc asort {alist} { # sort a list of key/value pairs by key, removes duplicates too. array set a $alist array_sget a } ######################################################################## test iogt-1.1 {stack/unstack} testchannel { set fh [open $path(dummy) r] identity -attach $fh testchannel unstack $fh close $fh } {} test iogt-1.2 {stack/close} testchannel { set fh [open $path(dummy) r] identity -attach $fh close $fh } {} test iogt-1.3 {stack/unstack, configuration, options} testchannel { set fh [open $path(dummy) r] set ca [asort [fconfigure $fh]] identity -attach $fh set cb [asort [fconfigure $fh]] testchannel unstack $fh set cc [asort [fconfigure $fh]] close $fh # With this system none of the buffering, translation and encoding option # may change their values with channels stacked upon each other or not. # cb == ca == cc list [string equal $ca $cb] [string equal $cb $cc] [string equal $ca $cc] } {1 1 1} test iogt-1.4 {stack/unstack, configuration} -setup { set fh [open $path(dummy) r] } -constraints testchannel -body { set ca [asort [fconfigure $fh]] identity -attach $fh fconfigure $fh -buffering line -translation cr -encoding shiftjis testchannel unstack $fh set cc [asort [fconfigure $fh]] list [string equal $ca $cc] [fconfigure $fh -buffering] \ [fconfigure $fh -translation] [fconfigure $fh -encoding] } -cleanup { close $fh } -result {0 line cr shiftjis} test iogt-2.0 {basic I/O going through transform} -setup { set fin [open $path(dummy) r] set fout [open $path(dummyout) w] } -constraints testchannel -body { identity -attach $fin identity -attach $fout fcopy $fin $fout close $fin close $fout set fin [open $path(dummy) r] set fout [open $path(dummyout) r] list [string equal [set in [read $fin]] [set out [read $fout]]] \ [string length $in] [string length $out] } -cleanup { close $fin close $fout } -result {1 71 71} test iogt-2.1 {basic I/O, operation trail} {testchannel unix} { set fin [open $path(dummy) r] set fout [open $path(dummyout) w] set ain [list]; set aout [list] audit_ops ain -attach $fin audit_ops aout -attach $fout fconfigure $fin -buffersize 10 fconfigure $fout -buffersize 10 fcopy $fin $fout close $fin close $fout set res "[join $ain \n]\n--------\n[join $aout \n]" } {create/read query/maxRead read query/maxRead read query/maxRead read query/maxRead read query/maxRead read query/maxRead read query/maxRead read query/maxRead read query/maxRead flush/read query/maxRead delete/read -------- create/write write write write write write write write write flush/write delete/write} test iogt-2.2 {basic I/O, data trail} {testchannel unix} { set fin [open $path(dummy) r] set fout [open $path(dummyout) w] set ain [list]; set aout [list] audit_flow ain -attach $fin audit_flow aout -attach $fout fconfigure $fin -buffersize 10 fconfigure $fout -buffersize 10 fcopy $fin $fout close $fin close $fout set res "[join $ain \n]\n--------\n[join $aout \n]" } {create/read {} *ignored* query/maxRead {} -1 read abcdefghij abcdefghij query/maxRead {} -1 read klmnopqrst klmnopqrst query/maxRead {} -1 read uvwxyz0123 uvwxyz0123 query/maxRead {} -1 read 456789,./? 456789,./? query/maxRead {} -1 read {><;'\|":[]} {><;'\|":[]} query/maxRead {} -1 read {\}\{`~!@#$} {\}\{`~!@#$} query/maxRead {} -1 read %^&*()_+-= %^&*()_+-= query/maxRead {} -1 read { } { } query/maxRead {} -1 flush/read {} {} query/maxRead {} -1 delete/read {} *ignored* -------- create/write {} *ignored* write abcdefghij abcdefghij write klmnopqrst klmnopqrst write uvwxyz0123 uvwxyz0123 write 456789,./? 456789,./? write {><;'\|":[]} {><;'\|":[]} write {\}\{`~!@#$} {\}\{`~!@#$} write %^&*()_+-= %^&*()_+-= write { } { } flush/write {} {} delete/write {} *ignored*} test iogt-2.3 {basic I/O, mixed trail} {testchannel unix} { set fin [open $path(dummy) r] set fout [open $path(dummyout) w] set trail [list] audit_flow trail -attach $fin audit_flow trail -attach $fout fconfigure $fin -buffersize 20 -profile tcl8 fconfigure $fout -buffersize 10 -profile tcl8 fcopy $fin $fout close $fin close $fout join $trail \n } {create/read {} *ignored* create/write {} *ignored* query/maxRead {} -1 read abcdefghijklmnopqrst abcdefghijklmnopqrst write abcdefghij abcdefghij write klmnopqrst klmnopqrst query/maxRead {} -1 read uvwxyz0123456789,./? uvwxyz0123456789,./? write uvwxyz0123 uvwxyz0123 write 456789,./? 456789,./? query/maxRead {} -1 read {><;'\|":[]\}\{`~!@#$} {><;'\|":[]\}\{`~!@#$} write {><;'\|":[]} {><;'\|":[]} write {\}\{`~!@#$} {\}\{`~!@#$} query/maxRead {} -1 read {%^&*()_+-= } {%^&*()_+-= } query/maxRead {} -1 flush/read {} {} write %^&*()_+-= %^&*()_+-= write { } { } query/maxRead {} -1 delete/read {} *ignored* flush/write {} {} delete/write {} *ignored*} test iogt-2.4 {basic I/O, mixed trail} {testchannel} { set fh [open $path(dummy) r] torture -attach $fh chan configure $fh -buffersize 2 set x [read $fh] testchannel unstack $fh close $fh set x } {} test iogt-2.5 {basic I/O, mixed trail} {testchannel} { set ::level 0 set fh [open $path(dummyout) w] torture -attach $fh puts -nonewline $fh abcdef flush $fh testchannel unstack $fh close $fh } {} test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} -setup { proc DoneCopy {n {err {}}} { variable copy 1 } } -constraints {testchannel knownBug} -body { # This test to check the validity of acquired Tcl_Channel references is not # possible because even a backgrounded fcopy will immediately start to # copy data, without waiting for the event loop. This is done only in case # of an underflow on the read size!. So stacking transforms after the # fcopy will miss information, or are not used at all. # # I was able to circumvent this by using the echo.tcl server with a big # delay, causing the fcopy to underflow immediately. set fin [open $path(dummy) r] fevent 1000 500 {20 20 20 10 1 1} { variable copy close $fin set fout [open dummyout w] flush $sock; # now, or fcopy will error us out # But the 1 second delay should be enough to initialize everything # else here. fcopy $sock $fout -command [namespace code DoneCopy] # Transform after fcopy got its handles! They should be still valid # for fcopy. set trail [list] audit_ops trail -attach $fout vwait [namespace which -variable copy] } [read $fin]; # {} close $fout # Check result of copy. set fin [open $path(dummy) r] set fout [open $path(dummyout) r] set res [string equal [read $fin] [read $fout]] close $fin close $fout list $res $trail } -cleanup { rename DoneCopy {} } -result {1 {create/write create/read write flush/write flush/read delete/write delete/read}} test iogt-4.0 {fileevent readable, after transform} -setup { set fin [open $path(dummy) r] set data [read $fin] close $fin set trail [list] set got [list] proc Done {args} { variable stop 1 } proc Get {sock} { variable trail variable got if {[eof $sock]} { Done lappend trail "xxxxxxxxxxxxx" close $sock return } lappend trail "vvvvvvvvvvvvv" lappend trail "\tgot: [lappend got "\[\[[read $sock]\]\]"]" lappend trail "=============" #puts stdout $__ ; flush stdout #read $sock } } -constraints {testchannel knownBug} -body { fevent 1000 500 {20 20 20 10 1} { variable stop audit_flow trail -attach $sock rblocks_t rbuf trail 23 -attach $sock fileevent $sock readable [namespace code [list Get $sock]] flush $sock; # Now, or fcopy will error us out # But the 1 second delay should be enough to initialize everything # else here. vwait [namespace which -variable stop] } $data join [list [join $got \n] ~~~~~~~~ [join $trail \n]] \n } -cleanup { rename Done {} rename Get {} } -result {[[]] [[abcdefghijklmnopqrstuvw]] [[xyz0123456789,./?><;'\|]] [[]] [[]] [[":[]\}\{`~!@#$%^&*()]] [[]] ~~~~~~~~ create/write {} *ignored* create/read {} *ignored* rblock | create/write {} {} | {} rblock | create/read {} {} | {} vvvvvvvvvvvvv rblock | query/maxRead {} -1 | {} query/maxRead {} -1 read abcdefghijklmnopqrstu abcdefghijklmnopqrstu query/maxRead {} -1 rblock | {read 23 21 :- 0} abcdefghijklmnopqrstu {} | abcdefghijklmnopqrstu rblock | query/maxRead {} -1 | abcdefghijklmnopqrstu query/maxRead {} -1 got: {[[]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | abcdefghijklmnopqrstu query/maxRead {} -1 read vwxyz0123456789,./?>< vwxyz0123456789,./?>< query/maxRead {} -1 rblock | {read 23 42 :- 23} vwxyz0123456789,./?>< abcdefghijklmnopqrstuvw | xyz0123456789,./?>< rblock | query/maxRead {} -1 | xyz0123456789,./?>< query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | xyz0123456789,./?>< query/maxRead {} -1 read {;'\|":[]\}\{`~!@#$%^&} {;'\|":[]\}\{`~!@#$%^&} query/maxRead {} -1 rblock | {read 23 40 :- 23} {;'\|":[]\}\{`~!@#$%^&} {xyz0123456789,./?><;'\|} | {":[]\}\{`~!@#$%^&} rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&} query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} {[[xyz0123456789,./?><;'\|]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&} query/maxRead {} -1 read *( *( query/maxRead {} -1 rblock | {read 23 19 :- 0} *( {} | {":[]\}\{`~!@#$%^&*(} rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&*(} query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} {[[xyz0123456789,./?><;'\|]]} {[[]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&*(} query/maxRead {} -1 read ) ) query/maxRead {} -1 rblock | {read 23 20 :- 0} ) {} | {":[]\}\{`~!@#$%^&*()} rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&*()} query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} {[[xyz0123456789,./?><;'\|]]} {[[]]} {[[]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | {":[]\}\{`~!@#$%^&*()} query/maxRead {} -1 flush/read {} {} rblock | flush/read {} {":[]\}\{`~!@#$%^&*()} | {} rblock | query/maxRead {} -1 | {} query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} {[[xyz0123456789,./?><;'\|]]} {[[]]} {[[]]} {[[":[]\}\{`~!@#$%^&*()]]} ============= vvvvvvvvvvvvv rblock | query/maxRead {} -1 | {} query/maxRead {} -1 got: {[[]]} {[[abcdefghijklmnopqrstuvw]]} {[[xyz0123456789,./?><;'\|]]} {[[]]} {[[]]} {[[":[]\}\{`~!@#$%^&*()]]} {[[]]} xxxxxxxxxxxxx rblock | flush/write {} {} | {} rblock | delete/write {} {} | {} rblock | delete/read {} {} | {} flush/write {} {} delete/write {} *ignored* delete/read {} *ignored*}; # catch unescaped quote " test iogt-5.0 {EOF simulation} -setup { set fin [open $path(dummy) r] set fout [open $path(dummyout) w] set trail [list] } -constraints {testchannel knownBug} -result { audit_flow trail -attach $fin stopafter_audit d trail 20 -attach $fin audit_flow trail -attach $fout fconfigure $fin -buffersize 20 fconfigure $fout -buffersize 10 fcopy $fin $fout testchannel unstack $fin # now copy the rest in the channel lappend trail {**after unstack**} fcopy $fin $fout close $fin close $fout join $trail \n } -result {create/read {} *ignored* counter:create/read {} {} create/write {} *ignored* counter:query/maxRead {} 20 query/maxRead {} -1 read {abcdefghijklmnopqrstuvwxyz0123456789,./?><;'\|":[]\}\{`~!@#$%^&*()_+-= } {abcdefghijklmnopqrstuvwxyz0123456789,./?><;'\|":[]\}\{`~!@#$%^&*()_+-= } query/maxRead {} -1 flush/read {} {} counter:read abcdefghijklmnopqrst abcdefghijklmnopqrst write abcdefghij abcdefghij write klmnopqrst klmnopqrst counter:query/maxRead {} 0 counter:flush/read {} {} counter:delete/read {} {} **after unstack** query/maxRead {} -1 write uvwxyz0123 uvwxyz0123 write 456789,./? 456789,./? write {><;'\|":[]} {><;'\|":[]} write {\}\{`~!@#$} {\}\{`~!@#$} write %^&*()_+-= %^&*()_+-= write { } { } query/maxRead {} -1 delete/read {} *ignored* flush/write {} {} delete/write {} *ignored*} proc constX {op data} { # replace anything coming in with a same-length string of x'es. switch -- $op { create/write - create/read - delete/write - delete/read - clear_read { #ignore } flush/write - flush/read - write - read { return [string repeat x [string length $data]] } query/maxRead { return -1 } } } proc constx {-attach channel} { testchannel transform $channel -command [namespace code constX] } test iogt-6.0 {Push back} -constraints testchannel -body { set f [open $path(dummy) r] # contents of dummy = "abcdefghi..." read $f 3; # skip behind "abc" constx -attach $f # expect to get "xxx" from the transform because of unread "def" input to # transform which returns "xxx". # # Actually the IO layer preread the whole file and will read "def" # directly from the buffer without bothering to consult the newly stacked # transformation. This is wrong. read $f 3 } -cleanup { close $f } -result {xxx} test iogt-6.1 {Push back and up} -constraints {testchannel knownBug} -body { # This test demonstrates the bug/misfeature in the stacked # channel implementation that data can be discarded if it is # read into the buffers of one channel in the stack, and then # that channel is popped before anything above it reads. # # This bug can be worked around by always setting -buffersize # to 1, but who wants to do that? set f [open $path(dummy) r] # contents of dummy = "abcdefghi..." read $f 3; # skip behind "abc" constx -attach $f set res [read $f 3] testchannel unstack $f append res [read $f 3] } -cleanup { close $f } -result {xxxghi} # Driver for a base channel that emits several short "files" # with each terminated by a fleeting EOF proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) ..... return {initialize finalize watch read} } finalize { if {![info exists index($chan)]} {return} unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] if {![info exists index($chan)]} { driver initialize $chan } set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new if {[string length $result] == 0} { driver finalize $chan } return $result } } } test iogt-7.0 {Handle fleeting EOF} -constraints {testchannel} -body { set chan [chan create read [namespace which driver]] identity -attach $chan list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} proc delay {op data} { variable store switch -- $op { create/write - create/read - delete/write - delete/read - flush/write - write - clear_read {;#ignore} flush/read - read { if {![info exists store]} {set store {}} set reply $store set store $data return $reply } query/maxRead {return -1} } } test iogt-7.1 {Handle fleeting EOF} -constraints {testchannel} -body { set chan [chan create read [namespace which driver]] testchannel transform $chan -command [namespace code delay] list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \ [read $chan] [eof $chan] } -cleanup { close $chan } -result {0 ..... 1 {} 0 ..... 1} rename delay {} rename driver {} # cleanup foreach file [list dummy dummyout __echo_srv__.tcl] { removeFile $file } cleanupTests } namespace delete ::tcl::test::iogt return tcl9.0.3/tests/ioCmd.test0000644000175000017500000041160215104661341014651 0ustar sergeisergei# -*- tcl -*- # Commands covered: open, close, gets, read, puts, seek, tell, eof, flush, # fblocked, fconfigure, open, channel, fcopy, # readFile, writeFile, foreachLine # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Custom constraints used in this file testConstraint testchannel [llength [info commands testchannel]] #---------------------------------------------------------------------- test iocmd-1.1 {puts command} { list [catch {puts} msg] $msg } {1 {wrong # args: should be "puts ?-nonewline? ?channel? string"}} test iocmd-1.2 {puts command} { list [catch {puts a b c d e f g} msg] $msg } {1 {wrong # args: should be "puts ?-nonewline? ?channel? string"}} test iocmd-1.3 {puts command} { list [catch {puts froboz -nonewline kablooie} msg] $msg } {1 {wrong # args: should be "puts ?-nonewline? ?channel? string"}} test iocmd-1.4 {puts command} { list [catch {puts froboz hello} msg] $msg } {1 {can not find channel named "froboz"}} test iocmd-1.5 {puts command} { list [catch {puts stdin hello} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} set path(test1) [makeFile {} test1] test iocmd-1.6 {puts command} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f foobar close $f file size $path(test1) } 6 test iocmd-1.7 {puts command} { set f [open $path(test1) w] fconfigure $f -translation lf puts $f foobar close $f file size $path(test1) } 7 test iocmd-1.8 {puts command} { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [binary format a4a5 foo bar] close $f file size $path(test1) } 9 test iocmd-2.1 {flush command} { list [catch {flush} msg] $msg } {1 {wrong # args: should be "flush channel"}} test iocmd-2.2 {flush command} { list [catch {flush a b c d e} msg] $msg } {1 {wrong # args: should be "flush channel"}} test iocmd-2.3 {flush command} { list [catch {flush foo} msg] $msg } {1 {can not find channel named "foo"}} test iocmd-2.4 {flush command} { list [catch {flush stdin} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} test iocmd-3.1 {gets command} { list [catch {gets} msg] $msg } {1 {wrong # args: should be "gets channel ?varName?"}} test iocmd-3.2 {gets command} { list [catch {gets a b c d e f g} msg] $msg } {1 {wrong # args: should be "gets channel ?varName?"}} test iocmd-3.3 {gets command} { list [catch {gets aaa} msg] $msg } {1 {can not find channel named "aaa"}} test iocmd-3.4 {gets command} { list [catch {gets stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test iocmd-3.5 {gets command} { set f [open $path(test1) w] puts $f [binary format a4a5 foo bar] close $f set f [open $path(test1) r] set result [gets $f] close $f set x foo\x00 set x "${x}bar\x00\x00" string compare $x $result } 0 test iocmd-4.1 {read command} { list [catch {read} msg] $msg } {1 {wrong # args: should be "read channel ?numChars?" or "read ?-nonewline? channel"}} test iocmd-4.2 {read command} { list [catch {read a b c d e f g h} msg] $msg } {1 {wrong # args: should be "read channel ?numChars?" or "read ?-nonewline? channel"}} test iocmd-4.3 {read command} { list [catch {read aaa} msg] $msg } {1 {can not find channel named "aaa"}} test iocmd-4.4 {read command} { list [catch {read -nonewline} msg] $msg } {1 {wrong # args: should be "read channel ?numChars?" or "read ?-nonewline? channel"}} test iocmd-4.5 {read command} { list [catch {read -nonew file4} msg] $msg $::errorCode } {1 {can not find channel named "-nonew"} {TCL LOOKUP CHANNEL -nonew}} test iocmd-4.6 {read command} { list [catch {read stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test iocmd-4.7 {read command} { list [catch {read -nonewline stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test iocmd-4.8 {read command with incorrect combination of arguments} { file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" close $f set f [open $path(test1)] set x [list [catch {read -nonewline $f 20 z} msg] $msg $::errorCode] close $f set x } {1 {wrong # args: should be "read channel ?numChars?" or "read ?-nonewline? channel"} {TCL WRONGARGS}} test iocmd-4.9 {read command} { list [catch {read stdin foo} msg] $msg $::errorCode } {1 {expected non-negative integer but got "foo"} {TCL VALUE NUMBER}} test iocmd-4.10 {read command} { list [catch {read file107} msg] $msg $::errorCode } {1 {can not find channel named "file107"} {TCL LOOKUP CHANNEL file107}} set path(test3) [makeFile {} test3] test iocmd-4.11 {read command} { set f [open $path(test3) w] set x [list [catch {read $f} msg] $msg $::errorCode] close $f string compare [string tolower $x] \ [list 1 [format "channel \"%s\" wasn't opened for reading" $f] none] } 0 test iocmd-4.12 {read command} -setup { set f [open $path(test1)] } -body { read $f 12z } -cleanup { close $f } -result {expected non-negative integer but got "12z"} -errorCode {TCL VALUE NUMBER} test iocmd-5.1 {seek command} -returnCodes error -body { seek } -result {wrong # args: should be "seek channel offset ?origin?"} test iocmd-5.2 {seek command} -returnCodes error -body { seek a b c d e f g } -result {wrong # args: should be "seek channel offset ?origin?"} test iocmd-5.3 {seek command} -returnCodes error -body { seek stdin gugu } -result {expected integer but got "gugu"} test iocmd-5.4 {seek command} -returnCodes error -body { seek stdin 100 gugu } -result {bad origin "gugu": must be start, current, or end} test iocmd-6.1 {tell command} { list [catch {tell} msg] $msg } {1 {wrong # args: should be "tell channel"}} test iocmd-6.2 {tell command} { list [catch {tell a b c d e} msg] $msg } {1 {wrong # args: should be "tell channel"}} test iocmd-6.3 {tell command} { list [catch {tell aaa} msg] $msg } {1 {can not find channel named "aaa"}} test iocmd-7.1 {close command} { list [catch {close} msg] $msg } {1 {wrong # args: should be "close channel ?direction?"}} test iocmd-7.2 {close command} { list [catch {close a b c d e} msg] $msg } {1 {wrong # args: should be "close channel ?direction?"}} test iocmd-7.3 {close command} { list [catch {close aaa} msg] $msg } {1 {can not find channel named "aaa"}} test iocmd-7.4 {close command} -setup { set chan [open [info script] r] } -body { chan close $chan bar } -cleanup { close $chan } -returnCodes error -result "bad direction \"bar\": must be read or write" test iocmd-7.5 {close command} -setup { set chan [open [info script] r] } -body { chan close $chan write } -cleanup { close $chan } -returnCodes error -result "Half-close of write-side not possible, side not opened or already closed" proc expectedOpts {got extra} { set basicOpts { -blocking -buffering -buffersize -encoding -eofchar -profile -translation } set opts [list {*}$basicOpts {*}$extra] lset opts end [string cat "or " [lindex $opts end]] return [format {bad option "%s": should be one of %s} $got [join $opts ", "]] } test iocmd-8.1 {fconfigure command} -returnCodes error -body { fconfigure } -result {wrong # args: should be "fconfigure channel ?-option value ...?"} test iocmd-8.2 {fconfigure command} -returnCodes error -body { fconfigure a b c d e f } -result {wrong # args: should be "fconfigure channel ?-option value ...?"} test iocmd-8.3 {fconfigure command} -returnCodes error -body { fconfigure a b } -result {can not find channel named "a"} test iocmd-8.4 {fconfigure command} -setup { file delete $path(test1) set f1 [open $path(test1) w] } -body { fconfigure $f1 froboz } -returnCodes error -cleanup { close $f1 } -result [expectedOpts "froboz" -stat] test iocmd-8.5 {fconfigure command} -returnCodes error -body { fconfigure stdin -buffering froboz } -result {bad value for -buffering: must be one of full, line, or none} test iocmd-8.6 {fconfigure command} -returnCodes error -body { fconfigure stdin -translation froboz } -result {bad value for -translation: must be one of auto, binary, cr, lf, crlf, or platform} test iocmd-8.7 {fconfigure command} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] fconfigure $f1 -translation lf -encoding utf-16 fconfigure $f1 } -cleanup { catch {close $f1} } -result {-blocking 1 -buffering full -buffersize 4096 -encoding utf-16 -eofchar {} -profile strict -translation lf} test iocmd-8.8 {fconfigure command} -setup { file delete $path(test1) set x {} } -body { set f1 [open $path(test1) w] fconfigure $f1 -translation lf -buffering line -buffersize 3030 \ -encoding utf-16 -profile tcl8 lappend x [fconfigure $f1 -buffering] lappend x [fconfigure $f1] } -cleanup { catch {close $f1} } -result {line {-blocking 1 -buffering line -buffersize 3030 -encoding utf-16 -eofchar {} -profile tcl8 -translation lf}} test iocmd-8.9 {fconfigure command} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] fconfigure $f1 -translation binary -buffering none -buffersize 4040 fconfigure $f1 } -cleanup { catch {close $f1} } -result {-blocking 1 -buffering none -buffersize 4040 -encoding iso8859-1 -eofchar {} -profile strict -translation lf} test iocmd-8.10 {fconfigure command} -returnCodes error -body { fconfigure a b } -result {can not find channel named "a"} set path(fconfigure.dummy) [makeFile {} fconfigure.dummy] test iocmd-8.11 {fconfigure command} -body { set chan [open $path(fconfigure.dummy) r] fconfigure $chan -froboz blarfo } -returnCodes error -cleanup { catch {close $chan} } -result [expectedOpts "-froboz" {}] test iocmd-8.12 {fconfigure command} -body { set chan [open $path(fconfigure.dummy) r] fconfigure $chan -b blarfo } -returnCodes error -cleanup { catch {close $chan} } -result [expectedOpts "-b" {}] test iocmd-8.13 {fconfigure command} -body { set chan [open $path(fconfigure.dummy) r] fconfigure $chan -buffer blarfo } -returnCodes error -cleanup { catch {close $chan} } -result [expectedOpts "-buffer" {}] removeFile fconfigure.dummy test iocmd-8.14 {fconfigure command} { fconfigure stdin -buffers } 4096 test iocmd-8.15 {fconfigure command / tcp channel} -constraints {socket unixOrWin} -setup { set srv [socket -server iocmdSRV -myaddr 127.0.0.1 0] set port [lindex [fconfigure $srv -sockname] 2] proc iocmdSRV {sock ip port} {close $sock} set cli [socket 127.0.0.1 $port] } -body { fconfigure $cli -blah } -cleanup { close $cli close $srv unset cli srv port rename iocmdSRV {} } -returnCodes error -result [expectedOpts "-blah" {-connecting -keepalive -nodelay -peername -sockname}] test iocmd-8.16 {fconfigure command / tcp channel} -constraints socket -setup { set srv [socket -server iocmdSRV -myaddr 127.0.0.1 0] set port [lindex [fconfigure $srv -sockname] 2] proc iocmdSRV {sock ip port} {close $sock} set cli [socket 127.0.0.1 $port] } -body { expr {[lindex [fconfigure $cli -peername] 2] == $port} } -cleanup { close $cli close $srv unset cli srv port rename iocmdSRV {} } -result 1 test iocmd-8.17 {fconfigure command / tcp channel} -constraints nonPortable -setup { set srv [socket -server iocmdSRV -myaddr 127.0.0.1 0] set port [lindex [fconfigure $srv -sockname] 2] proc iocmdSRV {sock ip port} {close $sock} set cli [socket 127.0.0.1 $port] } -body { # It is possible that you don't get the connection reset by peer # error but rather a valid answer. Depends on the tcp implementation update puts $cli "blah" flush $cli; # that flush could/should fail too update regsub -all {can([^:])+: } [catch {fconfigure $cli -peername} msg] {} } -cleanup { close $cli close $srv unset cli srv port rename iocmdSRV {} } -result 1 test iocmd-8.18 {fconfigure command / unix tty channel} -constraints {nonPortable unix} -setup { set tty "" } -body { # might fail if /dev/ttya is unavailable set tty [open /dev/ttya] fconfigure $tty -blah blih } -cleanup { if {$tty ne ""} { close $tty } } -returnCodes error -result [expectedOpts "-blah" {-closemode -inputmode -mode -queue -ttystatus -xchar}] test iocmd-8.19 {fconfigure command / win tty channel} -constraints {nonPortable win} -setup { set tty "" } -body { # might fail early if com1 is unavailable set tty [open com1] fconfigure $tty -blah blih } -cleanup { if {$tty ne ""} { close $tty } } -returnCodes error -result [expectedOpts "-blah" {-closemode -mode -handshake -pollinterval -sysbuffer -timeout -ttycontrol -xchar}] test iocmd-8.20 {fconfigure command / win console channel} -constraints {nonPortable win} -setup { # I don't know how else to open the console, but this is non-portable set console stdin } -body { fconfigure $console -blah blih } -returnCodes error -result [expectedOpts "-blah" {-inputmode}] # TODO: Test parsing of serial channel options (nonPortable, since requires an # open channel to work with). test iocmd-8.23 {fconfigure -profile badprofile} -body { fconfigure stdin -profile froboz } -returnCodes error -result {bad profile name "froboz": must be replace, strict, or tcl8} test iocmd-9.1 {eof command} { list [catch {eof} msg] $msg $::errorCode } {1 {wrong # args: should be "eof channel"} {TCL WRONGARGS}} test iocmd-9.2 {eof command} { list [catch {eof a b} msg] $msg $::errorCode } {1 {wrong # args: should be "eof channel"} {TCL WRONGARGS}} test iocmd-9.3 {eof command} { catch {close file100} list [catch {eof file100} msg] $msg $::errorCode } {1 {can not find channel named "file100"} {TCL LOOKUP CHANNEL file100}} # The tests for Tcl_ExecObjCmd are in exec.test test iocmd-10.1 {fblocked command} { list [catch {fblocked} msg] $msg } {1 {wrong # args: should be "fblocked channel"}} test iocmd-10.2 {fblocked command} { list [catch {fblocked a b c d e f g} msg] $msg } {1 {wrong # args: should be "fblocked channel"}} test iocmd-10.3 {fblocked command} { list [catch {fblocked file1000} msg] $msg } {1 {can not find channel named "file1000"}} test iocmd-10.4 {fblocked command} { list [catch {fblocked stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test iocmd-10.5 {fblocked command} { fblocked stdin } 0 set path(test4) [makeFile {} test4] set path(test5) [makeFile {} test5] test iocmd-11.1 {I/O to command pipelines} {unixOrWin unixExecs} { set f [open $path(test4) w] close $f list [catch {open "| cat < \"$path(test4)\" > \"$path(test5)\"" w} msg] $msg $::errorCode } {1 {can't write input to command: standard input was redirected} {TCL OPERATION EXEC BADREDIRECT}} test iocmd-11.2 {I/O to command pipelines} {unixOrWin unixExecs} { list [catch {open "| echo > \"$path(test5)\"" r} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} test iocmd-11.3 {I/O to command pipelines} {unixOrWin unixExecs} { list [catch {open "| echo > \"$path(test5)\"" r+} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrWin} { list [catch {open "| no_such_command_exists" rb} msg] $msg $::errorCode } {1 {couldn't execute "no_such_command_exists": no such file or directory} {POSIX ENOENT {no such file or directory}}} test iocmd-12.1 {POSIX open access modes: RDONLY} { file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" close $f set f [open $path(test1) RDONLY] set x [list [gets $f] [catch {puts $f Test} msg] $msg] close $f string compare $x \ "{Two lines: this one} 1 [list [format "channel \"%s\" wasn't opened for writing" $f]]" } 0 test iocmd-12.2 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.3 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} # # Test 13.4 relies on assigning the same channel name twice. # test iocmd-12.4 {POSIX open access modes: WRONLY} {unix} { file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f set f [open $path(test3) WRONLY] puts -nonewline $f "ab" seek $f 0 current set x [list [catch {gets $f} msg] $msg] close $f set f [open $path(test3) r] lappend x [gets $f] close $f set y [list 1 [format "channel \"%s\" wasn't opened for reading" $f] abzzy] string compare $x $y } 0 test iocmd-12.5 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.6 {POSIX open access modes: errors} { concat [catch {open $path(test3) "FOO \{BAR BAZ"} msg] $msg\n$::errorInfo } "1 unmatched open brace in list unmatched open brace in list while processing open access modes \"FOO {BAR BAZ\" invoked from within \"open \$path(test3) \"FOO \\{BAR BAZ\"\"" test iocmd-12.7 {POSIX open access modes: errors} { list [catch {open $path(test3) {FOO BAR BAZ}} msg] $msg } {1 {invalid access mode "FOO": must be APPEND, BINARY, CREAT, EXCL, NOCTTY, NONBLOCK, RDONLY, RDWR, TRUNC, or WRONLY}} test iocmd-12.8 {POSIX open access modes: errors} { list [catch {open $path(test3) {TRUNC CREAT}} msg] $msg } {1 {access mode must include either RDONLY, RDWR, or WRONLY}} close [open $path(test3) w] test iocmd-12.9 {POSIX open access modes: BINARY} { list [catch {open $path(test1) BINARY} msg] $msg } {1 {access mode must include either RDONLY, RDWR, or WRONLY}} test iocmd-12.10 {POSIX open access modes: BINARY} { set f [open $path(test1) {WRONLY BINARY TRUNC}] puts $f a puts $f b puts -nonewline $f c ;# contents are now 5 bytes: a\nb\nc close $f set f [open $path(test1) r] fconfigure $f -translation binary set result [string length [read $f]] close $f set result } 5 test iocmd-12.10.1 {POSIX open access modes: BINARY} -body { after 100 set f [open $path(test1) {WRONLY BINARY TRUNC}] puts $f Ɉ ;# throws an exception } -cleanup { close $f } -returnCodes 1 -match glob -result {error writing "*": invalid or incomplete multibyte or wide character} test iocmd-12.11 {POSIX open access modes: BINARY} { set f [open $path(test1) {WRONLY BINARY TRUNC}] puts $f H close $f set f [open $path(test1) r] fconfigure $f -translation binary set result [read -nonewline $f] close $f set result } H test iocmd-12.12 {POSIX open access modes: errors} { list [catch {open $path(test3) {RDWR WRONLY}} msg] $msg } {1 {invalid access mode "WRONLY": modes RDONLY, RDWR, and WRONLY cannot be combined}} test iocmd-12.13 {POSIX open access modes: errors} { list [catch {open $path(test3) {BINARY BINARY}} msg] $msg } {1 {access mode "BINARY" repeated}} test iocmd-12.14 {POSIX open access modes: errors} { list [catch {open $path(test3) {TRUNC}} msg] $msg } {1 {access mode must include either RDONLY, RDWR, or WRONLY}} test iocmd-13.1 {errors in open command} { list [catch {open} msg] $msg } {1 {wrong # args: should be "open fileName ?access? ?permissions?"}} test iocmd-13.2 {errors in open command} { list [catch {open a b c d} msg] $msg } {1 {wrong # args: should be "open fileName ?access? ?permissions?"}} test iocmd-13.3 {errors in open command} { list [catch {open $path(test1) x} msg] $msg } {1 {illegal access mode "x"}} test iocmd-13.4 {errors in open command} { list [catch {open $path(test1) rw} msg] $msg } {1 {illegal access mode "rw"}} test iocmd-13.5 {errors in open command} { list [catch {open $path(test1) r+1} msg] $msg } {1 {illegal access mode "r+1"}} test iocmd-13.6 {errors in open command} { set msg [list [catch {open _non_existent_} msg] $msg $::errorCode] regsub [file join {} _non_existent_] $msg "_non_existent_" msg string tolower $msg } {1 {couldn't open "_non_existent_": no such file or directory} {posix enoent {no such file or directory}}} test iocmd-13.7 {errors in open command} { list [catch {open $path(test1) b} msg] $msg } {1 {illegal access mode "b"}} test iocmd-13.8 {errors in open command} { list [catch {open $path(test1) rbb} msg] $msg } {1 {illegal access mode "rbb"}} test iocmd-13.9 {errors in open command} { list [catch {open $path(test1) r++} msg] $msg } {1 {illegal access mode "r++"}} test iocmd-13.10.1 {open for append, a mode} -setup { set log [makeFile {} out] set chans {} } -body { foreach i { 0 1 2 3 4 5 6 7 8 9 } { puts [set ch [open $log a]] $i lappend chans $ch } foreach ch $chans {catch {close $ch}} lsort [split [string trim [viewFile out]] \n] } -cleanup { removeFile out # Ensure that channels are gone, even if body failed to do so foreach ch $chans {catch {close $ch}} } -result {0 1 2 3 4 5 6 7 8 9} test iocmd-13.10.2 {open for append, O_APPEND} -setup { set log [makeFile {} out] set chans {} } -body { foreach i { 0 1 2 3 4 5 6 7 8 9 } { puts [set ch [open $log {WRONLY CREAT APPEND}]] $i lappend chans $ch } foreach ch $chans {catch {close $ch}} lsort [split [string trim [viewFile out]] \n] } -cleanup { removeFile out # Ensure that channels are gone, even if body failed to do so foreach ch $chans {catch {close $ch}} } -result {0 1 2 3 4 5 6 7 8 9} test ioCmd-13.11 {open ... a+ must not use O_APPEND: Bug 1773127} -setup { set f [makeFile {} ioutil41.tmp] set fid [open $f wb] puts -nonewline $fid 123 close $fid } -body { set fid [open $f ab+] puts -nonewline $fid 456 seek $fid 2 set d [read $fid 2] seek $fid 4 puts -nonewline $fid x close $fid set fid [open $f rb] append d [read $fid] close $fid return $d } -cleanup { removeFile $f } -result 341234x6 test ioCmd-13.12 {open file produces something that has fconfigure -stat} -setup { set f [makeFile {} iocmd13_12] set result {} } -body { set fd [open $f wb] set result [dict get [fconfigure $fd -stat] type] fconfigure $fd -buffering none puts -nonewline $fd abc # Three ways of getting the size; all should agree! lappend result [tell $fd] [file size $f] \ [dict get [fconfigure $fd -stat] size] puts -nonewline $fd def lappend result [tell $fd] [file size $f] \ [dict get [fconfigure $fd -stat] size] puts -nonewline $fd ghi lappend result [tell $fd] [file size $f] \ [dict get [fconfigure $fd -stat] size] close $fd return $result } -cleanup { removeFile $f } -result {file 3 3 3 6 6 6 9 9 9} test iocmd-14.1 {file id parsing errors} { list [catch {eof gorp} msg] $msg $::errorCode } {1 {can not find channel named "gorp"} {TCL LOOKUP CHANNEL gorp}} test iocmd-14.2 {file id parsing errors} { list [catch {eof filex} msg] $msg } {1 {can not find channel named "filex"}} test iocmd-14.3 {file id parsing errors} { list [catch {eof file12a} msg] $msg } {1 {can not find channel named "file12a"}} test iocmd-14.4 {file id parsing errors} { list [catch {eof file123} msg] $msg } {1 {can not find channel named "file123"}} test iocmd-14.5 {file id parsing errors} { list [catch {eof stdout} msg] $msg } {0 0} test iocmd-14.6 {file id parsing errors} { list [catch {eof stdin} msg] $msg } {0 0} test iocmd-14.7 {file id parsing errors} { list [catch {eof stdout} msg] $msg } {0 0} test iocmd-14.8 {file id parsing errors} { list [catch {eof stderr} msg] $msg } {0 0} test iocmd-14.9 {file id parsing errors} { list [catch {eof stderr1} msg] $msg } {1 {can not find channel named "stderr1"}} set f [open $path(test1) w] close $f set expect "1 {can not find channel named \"$f\"}" test iocmd-14.10 {file id parsing errors} { list [catch {eof $f} msg] $msg } $expect test iocmd-15.1 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy} msg] $msg } {1 {wrong # args: should be "fcopy input output ?-size size? ?-command callback?"}} test iocmd-15.2 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy 1} msg] $msg } {1 {wrong # args: should be "fcopy input output ?-size size? ?-command callback?"}} test iocmd-15.3 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy 1 2 3 4 5 6 7} msg] $msg } {1 {wrong # args: should be "fcopy input output ?-size size? ?-command callback?"}} test iocmd-15.4 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy 1 2 3} msg] $msg } {1 {wrong # args: should be "fcopy input output ?-size size? ?-command callback?"}} test iocmd-15.5 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy 1 2 3 4 5} msg] $msg } {1 {wrong # args: should be "fcopy input output ?-size size? ?-command callback?"}} set path(test2) [makeFile {} test2] set f [open $path(test1) w] close $f set rfile [open $path(test1) r] set wfile [open $path(test2) w] test iocmd-15.6 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy foo $wfile} msg] $msg } {1 {can not find channel named "foo"}} test iocmd-15.7 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile foo} msg] $msg } {1 {can not find channel named "foo"}} test iocmd-15.8 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $wfile $wfile} msg] $msg } "1 {channel \"$wfile\" wasn't opened for reading}" test iocmd-15.9 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile $rfile} msg] $msg } "1 {channel \"$rfile\" wasn't opened for writing}" test iocmd-15.10 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile $wfile foo bar} msg] $msg } {1 {bad option "foo": must be -size or -command}} test iocmd-15.11 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile $wfile -size foo} msg] $msg } {1 {expected integer but got "foo"}} test iocmd-15.12 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile $wfile -command bar -size foo} msg] $msg } {1 {expected integer but got "foo"}} close $rfile close $wfile # ### ### ### ######### ######### ######### ## Testing the reflected channel. test iocmd-20.0 {chan, wrong#args} { catch {chan} msg set msg } {wrong # args: should be "chan subcommand ?arg ...?"} test iocmd-20.1 {chan, unknown method} -body { chan foo } -returnCodes error -match glob -result {unknown or ambiguous subcommand "foo": must be *} # --- --- --- --------- --------- --------- # chan create, and method "initialize" test iocmd-21.0 {chan create, wrong#args, not enough} { catch {chan create} msg set msg } {wrong # args: should be "chan create mode cmdprefix"} test iocmd-21.1 {chan create, wrong#args, too many} { catch {chan create a b c} msg set msg } {wrong # args: should be "chan create mode cmdprefix"} test iocmd-21.2 {chan create, r/w mode empty} { proc foo {cmd args} { return {initialize finalize watch} } set chan [chan create {} foo] close $chan rename foo {} } {} test iocmd-21.3 {chan create, invalid r/w mode, bad string} { proc foo {} {} catch {chan create {c} foo} msg rename foo {} set msg } {bad mode "c": must be read or write} test iocmd-21.4 {chan create, bad handler, not a list} { catch {chan create {r w} "foo \{"} msg set msg } {unmatched open brace in list} test iocmd-21.5 {chan create, bad handler, not a command} { catch {chan create {r w} foo} msg set msg } {invalid command name "foo"} test iocmd-21.6 {chan create, initialize failed, bad signature} { proc foo {} {} catch {chan create {r w} foo} msg rename foo {} set msg } {wrong # args: should be "foo"} test iocmd-21.7 {chan create, initialize failed, bad signature} { proc foo {} {} catch {chan create {r w} ::foo} msg rename foo {} set msg } {wrong # args: should be "::foo"} test iocmd-21.8 {chan create, initialize failed, bad result, not a list} -body { proc foo {args} {return "\{"} catch {chan create {r w} foo} msg rename foo {} set ::errorInfo } -match glob -result {chan handler "foo initialize" returned non-list: *} test iocmd-21.9 {chan create, initialize failed, bad result, not a list} -body { proc foo {args} {return \{\{\}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {chan handler "foo initialize" returned non-list: *} test iocmd-21.10 {chan create, initialize failed, bad result, empty list} -body { proc foo {args} {} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*all required methods*} test iocmd-21.11 {chan create, initialize failed, bad result, bogus method name} -body { proc foo {args} {return 1} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*bad method "1": must be *} test iocmd-21.12 {chan create, initialize failed, bad result, bogus method name} -body { proc foo {args} {return {a b c}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*bad method "c": must be *} test iocmd-21.13 {chan create, initialize failed, bad result, required methods missing} -body { proc foo {args} {return {initialize finalize}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*all required methods*} test iocmd-21.14 {chan create, initialize failed, bad result, mode/handler mismatch} -body { proc foo {args} {return {initialize finalize watch read}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*lacks a "write" method} test iocmd-21.15 {chan create, initialize failed, bad result, mode/handler mismatch} -body { proc foo {args} {return {initialize finalize watch write}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*lacks a "read" method} test iocmd-21.16 {chan create, initialize failed, bad result, cget(all) mismatch} -body { proc foo {args} {return {initialize finalize watch cget write read}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*supports "cget" but not "cgetall"} test iocmd-21.17 {chan create, initialize failed, bad result, cget(all) mismatch} -body { proc foo {args} {return {initialize finalize watch cgetall read write}} catch {chan create {r w} foo} msg rename foo {} set msg } -match glob -result {*supports "cgetall" but not "cget"} test iocmd-21.18 {chan create, initialize ok, creates channel} -match glob -body { proc foo {args} { global res lappend res $args if {[lindex $args 0] ne "initialize"} {return} return {initialize finalize watch read write} } set res {} lappend res [file channel rc*] lappend res [chan create {r w} foo] lappend res [close [lindex $res end]] lappend res [file channel rc*] rename foo {} set res } -result {{} {initialize rc* {read write}} rc* {finalize rc*} {} {}} test iocmd-21.19 {chan create, init failure -> no channel, no finalize} -match glob -body { proc foo {args} { global res lappend res $args return {} } set res {} lappend res [file channel rc*] lappend res [catch {chan create {r w} foo} msg] lappend res $msg lappend res [file channel rc*] rename foo {} set res } -result {{} {initialize rc* {read write}} 1 {*all required methods*} {}} test iocmd-21.20 {Bug 88aef05cda} -setup { proc foo {method chan args} { switch -- $method blocking { chan configure $chan -blocking [lindex $args 0] return } initialize { return {initialize finalize watch blocking read write configure cget cgetall} } finalize { return } } set ch [chan create {read write} foo] } -body { chan configure $ch -blocking 0 } -cleanup { close $ch rename foo {} } -match glob -returnCodes 1 -result {*(infinite loop?)*} test iocmd-21.21 {[close] in [read] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { return {initialize finalize watch read} } finalize {} watch {} read { close $chan return a } } set ch [chan create read foo] } -body { read $ch 0 } -cleanup { close $ch rename foo {} } -result {} test iocmd-21.22 {[close] in [read] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { return {initialize finalize watch read} } finalize {} watch {} read { catch {close $chan} return a } } set ch [chan create read foo] } -body { read $ch 1 } -returnCodes error -cleanup { catch {close $ch} rename foo {} } -match glob -result {*invalid argument*} test iocmd-21.23 {[close] in [gets] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { return {initialize finalize watch read} } finalize {} watch {} read { catch {close $chan} return \n } } set ch [chan create read foo] } -body { gets $ch } -cleanup { catch {close $ch} rename foo {} } -result {} test iocmd-21.24 {[close] in binary [gets] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { return {initialize finalize watch read} } finalize {} watch {} read { catch {close $chan} return \n } } set ch [chan create read foo] } -body { chan configure $ch -translation binary gets $ch } -cleanup { catch {close $ch} rename foo {} } -result {} # --- --- --- --------- --------- --------- # Helper commands to record the arguments to handler methods. # Stored in a script so that the threads and interpreters needing this # code do not need their own copy but can access this variable. set helperscript { proc note {item} {global res; lappend res $item; return} proc track {} {upvar args item; note $item; return} proc notes {items} {foreach i $items {note $i}} # This forces the return options to be in the order that the test expects! proc noteOpts opts {global res; lappend res [dict merge { -code !?! -level !?! -errorcode !?! -errorline !?! -errorinfo !?! } $opts]; return} # Helper command, canned result for 'initialize' method. # Gets the optional methods as arguments. Use return features # to post the result higher up. proc init {args} { lappend args initialize finalize watch read write return -code return $args } proc oninit {args} { upvar args hargs if {[lindex $hargs 0] ne "initialize"} {return} lappend args initialize finalize watch read write return -code return $args } proc onfinal {} { upvar args hargs if {[lindex $hargs 0] ne "finalize"} {return} return -code return "" } } # Set everything up in the main thread. eval $helperscript # --- --- --- --------- --------- --------- # method finalize test iocmd-22.1 {chan finalize, handler destruction has no effect on channel} -match glob -body { set res {} proc foo {args} {track; oninit; return} note [set c [chan create {r w} foo]] rename foo {} note [file channels rc*] note [catch {close $c} msg]; note $msg note [file channels rc*] set res } -result {{initialize rc* {read write}} rc* rc* 1 {invalid command name "foo"} {}} test iocmd-22.2 {chan finalize, for close} -match glob -body { set res {} proc foo {args} {track; oninit; return {}} note [set c [chan create {r w} foo]] close $c # Close deleted the channel. note [file channels rc*] # Channel destruction does not kill handler command! note [info command foo] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} {} foo} test iocmd-22.3 {chan finalize, for close, error, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code error 5} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg # Channel is gone despite error. note [file channels rc*] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 5 {}} test iocmd-22.4 {chan finalize, for close, error, close error} -match glob -body { set res {} proc foo {args} {track; oninit; error FOO} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg; note $::errorInfo rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 FOO {FOO *"close $c"}} test iocmd-22.5 {chan finalize, for close, arbitrary result, ignored} -match glob -body { set res {} proc foo {args} {track; oninit; return SOMETHING} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 0 {}} test iocmd-22.6 {chan finalize, for close, break, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 3} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} test iocmd-22.7 {chan finalize, for close, continue, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 4} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} test iocmd-22.8 {chan finalize, for close, custom code, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 777 BANG} note [set c [chan create {r w} foo]] note [catch {close $c} msg]; note $msg rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} test iocmd-22.9 {chan finalize, for close, ignore level, close error} -match glob -setup { set res {} } -body { proc foo {args} {track; oninit; return -level 5 -code 777 BANG} note [set c [chan create {r w} foo]] note [catch {close $c} msg opt]; note $msg; noteOpts $opt return $res } -cleanup { rename foo {} } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "finalize"*}} # --- === *** ########################### # method read test iocmd-23.1 {chan read, regular data return} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return snarf } set c [chan create {r w} foo] note [read $c 10] close $c rename foo {} set res } -result {{read rc* 4096} {read rc* 4096} snarfsnarf} test iocmd-23.2 {chan read, bad data return, too much} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return [string repeat snarf 1000] } set c [chan create {r w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {{read rc* 4096} 1 {read delivered more than requested}} test iocmd-23.3 {chan read, for non-readable channel} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track; note MUST_NOT_HAPPEN } set c [chan create {w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {1 {channel "rc*" wasn't opened for reading}} test iocmd-23.4 {chan read, error return} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {{read rc* 4096} 1 BOOM!} test iocmd-23.5 {chan read, break return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} test iocmd-23.6 {chan read, continue return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} test iocmd-23.7 {chan read, custom return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code 777 BOOM! } set c [chan create {r w} foo] note [catch {read $c 2} msg]; note $msg close $c rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} test iocmd-23.8 {chan read, level is squashed} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -level 55 -code 777 BOOM! } set c [chan create {r w} foo] note [catch {read $c 2} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{read rc* 4096} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} test iocmd-23.9 {chan read, no data means eof} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track return "" } set c [chan create {r w} foo] } -body { note [read $c 2] note [eof $c] set res } -cleanup { close $c rename foo {} unset res } -result {{read rc* 4096} {} 1} test iocmd-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track error EAGAIN } set c [chan create {r w} foo] } -body { note [read $c 2] note [eof $c] set res } -cleanup { close $c rename foo {} unset res } -result {{read rc* 4096} {} 0} test iocmd-23.11 {chan read, close pulls the rug out} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track set args [lassign $args sub id] if {$sub ne "read"} {return} close $id return {} } set c [chan create {r} foo] note [read $c] rename foo {} set res } -result {{read rc* 4096} {}} # --- === *** ########################### # method write test iocmd-24.1 {chan write, regular write} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track set written [string length [lindex $args 2]] note $written return $written } set c [chan create {r w} foo] puts -nonewline $c snarf; flush $c close $c rename foo {} set res } -result {{write rc* snarf} 5} test iocmd-24.2 {chan write, partial write is ok} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track set written [string length [lindex $args 2]] if {$written > 10} {set written [expr {$written / 2}]} note $written return $written } set c [chan create {r w} foo] puts -nonewline $c snarfsnarfsnarf; flush $c close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 7 {write rc* arfsnarf} 8} test iocmd-24.3 {chan write, failed write} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note -1; return -1} set c [chan create {r w} foo] puts -nonewline $c snarfsnarfsnarf; flush $c close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} -1} test iocmd-24.4 {chan write, non-writable channel} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg]; note $msg close $c rename foo {} set res } -result {1 {channel "rc*" wasn't opened for writing}} test iocmd-24.5 {chan write, bad result, more written than data} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return 10000} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarf; flush $c} msg]; note $msg close $c rename foo {} set res } -result {{write rc* snarf} 1 {write wrote more than requested}} test iocmd-24.6 {chan write, bad result, zero-length write} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return 0} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarf; flush $c} msg]; note $msg close $c rename foo {} set res } -result {{write rc* snarf} 1 {write wrote nothing}} test iocmd-24.7 {chan write, failed write, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 BOOM!} test iocmd-24.8 {chan write, failed write, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; error BOOM!} set c [chan create {r w} foo] notes [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 BOOM!} test iocmd-24.9 {chan write, failed write, break return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} test iocmd-24.10 {chan write, failed write, continue return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} test iocmd-24.11 {chan write, failed write, custom return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code 777 BOOM!} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} test iocmd-24.12 {chan write, failed write, non-numeric return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return BANG} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 {expected integer but got "BANG"}} test iocmd-24.13 {chan write, failed write, level is ignored} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -level 55 -code 777 BOOM!} set c [chan create {r w} foo] note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg opt] note $msg noteOpts $opt close $c rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "write"*}} test iocmd-24.14 {chan write, no EAGAIN means that writing is allowed at this time, bug 2936225} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track return 3 } set c [chan create {r w} foo] } -body { note [puts -nonewline $c ABC ; flush $c] set res } -cleanup { close $c rename foo {} unset res } -result {{write rc* ABC} {}} test iocmd-24.15 {chan write, EAGAIN means that writing is not allowed at this time, bug 2936225} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track # Note: The EAGAIN signals that the channel cannot accept # write requests right now, this in turn causes the IO core to # request the generation of writable events (see expected # result below, and compare to case 24.14 above). error EAGAIN } set c [chan create {r w} foo] } -body { note [puts -nonewline $c ABC ; flush $c] set res } -cleanup { close $c rename foo {} unset res } -result {{write rc* ABC} {watch rc* write} {}} # --- === *** ########################### # method cgetall test iocmd-25.1 {chan configure, cgetall, standard options} -match glob -body { set res {} proc foo args {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [fconfigure $c] close $c rename foo {} set res } -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *}}} test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body { set res {} proc foo args {oninit cget cgetall; onfinal; track; return ""} set c [chan create {r w} foo] note [fconfigure $c] close $c rename foo {} set res } -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *}}} test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body { set res {} proc foo args { oninit cget cgetall; onfinal; track return {-bar foo -snarf x} } set c [chan create {r w} foo] note [fconfigure $c] close $c rename foo {} set res } -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -profile * -translation {auto *} -bar foo -snarf x}} test iocmd-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return "-bar" } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 {Expected list with even number of elements, got 1 element instead}} test iocmd-25.5 {chan configure, cgetall, bad result, not a list} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return "\{" } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 {unmatched open brace in list}} test iocmd-25.6 {chan configure, cgetall, error return} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 BOOM!} test iocmd-25.7 {chan configure, cgetall, break return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} test iocmd-25.8 {chan configure, cgetall, continue return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} test iocmd-25.9 {chan configure, cgetall, custom return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code 777 BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c} msg]; note $msg close $c rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} test iocmd-25.10 {chan configure, cgetall, level is ignored} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -level 55 -code 777 BANG } set c [chan create {r w} foo] note [catch {fconfigure $c} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{cgetall rc*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "cgetall"*}} # --- === *** ########################### # method configure test iocmd-26.1 {chan configure, set standard option} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track; note MUST_NOT_HAPPEN; return } set c [chan create {r w} foo] note [fconfigure $c -translation lf] close $c rename foo {} set res } -result {{}} test iocmd-26.2 {chan configure, set option, error return} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo bar} msg]; note $msg close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 BOOM!} test iocmd-26.3 {chan configure, set option, ok return} -match glob -body { set res {} proc foo {args} {oninit configure; onfinal; track; return} set c [chan create {r w} foo] note [fconfigure $c -rc-foo bar] close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} {}} test iocmd-26.4 {chan configure, set option, break return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo bar} msg]; note $msg close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} test iocmd-26.5 {chan configure, set option, continue return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo bar} msg]; note $msg close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} test iocmd-26.6 {chan configure, set option, custom return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code 444 BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo bar} msg]; note $msg close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} test iocmd-26.7 {chan configure, set option, level is ignored} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -level 55 -code 444 BANG } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo bar} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "configure"*}} # --- === *** ########################### # method cget test iocmd-27.1 {chan configure, get option, ok return} -match glob -body { set res {} proc foo {args} {oninit cget cgetall; onfinal; track; return foo} set c [chan create {r w} foo] note [fconfigure $c -rc-foo] close $c rename foo {} set res } -result {{cget rc* -rc-foo} foo} test iocmd-27.2 {chan configure, get option, error return} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo} msg]; note $msg close $c rename foo {} set res } -result {{cget rc* -rc-foo} 1 BOOM!} test iocmd-27.3 {chan configure, get option, break return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo} msg]; note $msg close $c rename foo {} set res } -result {{cget rc* -rc-foo} 1 BOOM!} test iocmd-27.4 {chan configure, get option, continue return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo} msg]; note $msg close $c rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code*} test iocmd-27.5 {chan configure, get option, custom return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code 333 BOOM! } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo} msg]; note $msg close $c rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code*} test iocmd-27.6 {chan configure, get option, level is ignored} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -level 77 -code 333 BANG } set c [chan create {r w} foo] note [catch {fconfigure $c -rc-foo} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "cget"*}} # --- === *** ########################### # method seek test iocmd-28.1 {chan tell, not supported by handler} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [tell $c] close $c rename foo {} set res } -result {-1} test iocmd-28.2 {chan tell, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 BOOM!} test iocmd-28.3 {chan tell, break return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} test iocmd-28.4 {chan tell, continue return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} test iocmd-28.5 {chan tell, custom return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code 222 BOOM!} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} test iocmd-28.6 {chan tell, level is ignored} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -level 11 -code 222 BANG} set c [chan create {r w} foo] note [catch {tell $c} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "seek"*}} test iocmd-28.7 {chan tell, regular return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 88} set c [chan create {r w} foo] note [tell $c] close $c rename foo {} set res } -result {{seek rc* 0 current} 88} test iocmd-28.8 {chan tell, negative return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -1} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 {Tried to seek before origin}} test iocmd-28.9 {chan tell, string return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return BOGUS} set c [chan create {r w} foo] note [catch {tell $c} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 current} 1 {expected integer but got "BOGUS"}} test iocmd-28.10 {chan seek, not supported by handler} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {1 {error during seek on "rc*": invalid argument}} test iocmd-28.11 {chan seek, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 BOOM!} test iocmd-28.12 {chan seek, break return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} test iocmd-28.13 {chan seek, continue return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} test iocmd-28.14 {chan seek, custom return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code 99 BOOM!} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} test iocmd-28.15 {chan seek, level is ignored} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -level 33 -code 99 BANG} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg opt]; note $msg; noteOpts $opt close $c rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "seek"*}} test iocmd-28.16 {chan seek, bogus return, negative location} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -45} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 {Tried to seek before origin}} test iocmd-28.17 {chan seek, bogus return, string return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return BOGUS} set c [chan create {r w} foo] note [catch {seek $c 0 start} msg]; note $msg close $c rename foo {} set res } -result {{seek rc* 0 start} 1 {expected integer but got "BOGUS"}} test iocmd-28.18 {chan seek, ok result} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 23} set c [chan create {r w} foo] note [seek $c 0 current] close $c rename foo {} set res } -result {{seek rc* 0 current} {}} foreach {testname code} { iocmd-28.19.0 start iocmd-28.19.1 current iocmd-28.19.2 end } { test $testname "chan seek, base conversion, $code" -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 0} set c [chan create {r w} foo] note [seek $c 0 $code] close $c rename foo {} set res } -result [list [list seek rc* 0 $code] {}] } # --- === *** ########################### # method blocking test iocmd-29.1 {chan blocking, no handler support} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [fconfigure $c -blocking] close $c rename foo {} set res } -result {1} test iocmd-29.2 {chan blocking, no handler support} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [fconfigure $c -blocking 0] note [fconfigure $c -blocking] close $c rename foo {} set res } -result {{} 0} test iocmd-29.3 {chan blocking, retrieval, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] note [fconfigure $c -blocking] close $c rename foo {} set res } -result {1} test iocmd-29.4 {chan blocking, resetting, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return} set c [chan create {r w} foo] note [fconfigure $c -blocking 0] note [fconfigure $c -blocking] close $c rename foo {} set res } -result {{blocking rc* 0} {} 0} test iocmd-29.5 {chan blocking, setting, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return} set c [chan create {r w} foo] note [fconfigure $c -blocking 1] note [fconfigure $c -blocking] close $c rename foo {} set res } -result {{blocking rc* 1} {} 1} test iocmd-29.6 {chan blocking, error return} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; error BOOM!} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg]; note $msg # Catch the close. It changes blocking mode internally, and runs into the error result. catch {close $c} rename foo {} set res } -result {{blocking rc* 0} 1 BOOM!} test iocmd-29.7 {chan blocking, break return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg]; note $msg catch {close $c} rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} test iocmd-29.8 {chan blocking, continue return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg]; note $msg catch {close $c} rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} test iocmd-29.9 {chan blocking, custom return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code 44 BOOM!} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg]; note $msg catch {close $c} rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} test iocmd-29.10 {chan blocking, level is ignored} -match glob -setup { set res {} } -body { proc foo {args} {oninit blocking; onfinal; track; return -level 99 -code 44 BANG} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg opt]; note $msg; noteOpts $opt catch {close $c} return $res } -cleanup { rename foo {} } -result {{blocking rc* 0} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "blocking"*}} test iocmd-29.11 {chan blocking, regular return ok, value ignored} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return BOGUS} set c [chan create {r w} foo] note [catch {fconfigure $c -blocking 0} msg]; note $msg catch {close $c} rename foo {} set res } -result {{blocking rc* 0} 0 {}} # --- === *** ########################### # method watch test iocmd-30.1 {chan watch, read interest, some return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return IGNORED} set c [chan create {r w} foo] note [fileevent $c readable {set tick $tick}] close $c ;# 2nd watch, interest zero. rename foo {} set res } -result {{watch rc* read} {} {watch rc* {}}} test iocmd-30.2 {chan watch, write interest, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code error BOOM!_IGNORED} set c [chan create {r w} foo] note [fileevent $c writable {set tick $tick}] note [fileevent $c writable {}] close $c rename foo {} set res } -result {{watch rc* write} {} {watch rc* {}} {}} test iocmd-30.3 {chan watch, accumulated interests} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] note [fileevent $c writable {set tick $tick}] note [fileevent $c readable {set tick $tick}] note [fileevent $c writable {}] note [fileevent $c readable {}] close $c rename foo {} set res } -result {{watch rc* write} {} {watch rc* {read write}} {} {watch rc* read} {} {watch rc* {}} {}} test iocmd-30.4 {chan watch, unchanged interest not forwarded} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] note [fileevent $c writable {set tick $tick}] note [fileevent $c readable {set tick $tick}] ;# Script is changing, note [fileevent $c readable {set tock $tock}] ;# interest does not. close $c ;# 3rd and 4th watch, removing the event handlers. rename foo {} set res } -result {{watch rc* write} {} {watch rc* {read write}} {} {} {watch rc* write} {watch rc* {}}} # --- === *** ########################### # chan postevent test iocmd-31.1 {chan postevent, restricted to reflected channels} -match glob -body { set c [open [makeFile {} goo] r] catch {chan postevent $c {r w}} msg close $c removeFile goo set msg } -result {can not find reflected channel named "file*"} test iocmd-31.2 {chan postevent, unwanted events} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] catch {chan postevent $c {r w}} msg; note $msg close $c rename foo {} set res } -result {{tried to post events channel "rc*" is not interested in}} test iocmd-31.3 {chan postevent, bad input, empty list} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] catch {chan postevent $c {}} msg; note $msg close $c rename foo {} set res } -result {{bad event list: is empty}} test iocmd-31.4 {chan postevent, bad input, illlegal keyword} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] catch {chan postevent $c goo} msg; note $msg close $c rename foo {} set res } -result {{bad event "goo": must be read or write}} test iocmd-31.5 {chan postevent, bad input, not a list} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] catch {chan postevent $c "\{"} msg; note $msg close $c rename foo {} set res } -result {{unmatched open brace in list}} test iocmd-31.6 {chan postevent, posted events do happen} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] set tock {} note [fileevent $c readable {lappend res TOCK; set tock 1}] set stop [after 15000 {lappend res TIMEOUT; set tock 1}] after 1000 {note [chan postevent $c r]} vwait ::tock catch {after cancel $stop} close $c rename foo {} set res } -result {{watch rc* read} {} TOCK {} {watch rc* {}}} test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] note [fileevent $c writable {lappend res TOCK; set tock 1}] set stop [after 15000 {lappend res TIMEOUT; set tock 1}] after 1000 {note [chan postevent $c w]} vwait ::tock catch {after cancel $stop} close $c rename foo {} set res } -result {{watch rc* write} {} TOCK {} {watch rc* {}}} test iocmd-31.8 {chan postevent after close throws error} -match glob -setup { proc foo {args} {oninit; onfinal; track; return} proc dummy args { return } set c [chan create {r w} foo] fileevent $c readable dummy } -body { close $c chan postevent $c read } -cleanup { rename foo {} rename dummy {} } -returnCodes error -result {can not find reflected channel named "rc*"} # --- === *** ########################### # 'Pull the rug' tests. Create channel in a interpreter A, move to # other interpreter B, destroy the origin interpreter (A) before or # during access from B. Must not crash, must return proper errors. test iocmd-32.0 {origin interpreter of moved channel gone} -match glob -body { set ida [interp create];#puts <<$ida>> set idb [interp create];#puts <<$idb>> # Magic to get the test* commands in the children load {} Tcltest $ida load {} Tcltest $idb # Set up channel in interpreter interp eval $ida $helperscript set chan [interp eval $ida { proc foo {args} {oninit seek; onfinal; track; return} set chan [chan create {r w} foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd interpreter. interp eval $ida [list testchannel cut $chan] interp eval $idb [list testchannel splice $chan] # Kill origin interpreter, then access channel from 2nd interpreter. interp delete $ida set res {} lappend res [catch {interp eval $idb [list puts $chan shoo]} msg] $msg lappend res [catch {interp eval $idb [list tell $chan]} msg] $msg lappend res [catch {interp eval $idb [list seek $chan 1]} msg] $msg lappend res [catch {interp eval $idb [list gets $chan]} msg] $msg lappend res [catch {interp eval $idb [list close $chan]} msg] $msg set res } -cleanup { interp delete $idb } -constraints {testchannel} \ -result {1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost}} test iocmd-32.1 {origin interpreter of moved channel destroyed during access} -match glob -body { set ida [interp create];#puts <<$ida>> set idb [interp create];#puts <<$idb>> # Magic to get the test* commands in the children load {} Tcltest $ida load {} Tcltest $idb # Set up channel in thread set chan [interp eval $ida $helperscript] set chan [interp eval $ida { proc foo {args} { oninit; onfinal; track; # destroy interpreter during channel access suicide } set chan [chan create {r w} foo] fconfigure $chan -buffering none set chan }] interp alias $ida suicide {} interp delete $ida # Move channel to 2nd thread. interp eval $ida [list testchannel cut $chan] interp eval $idb [list testchannel splice $chan] # Run access from interpreter B, this will give us a synchronous # response. interp eval $idb [list set chan $chan] set res [interp eval $idb { # wait a bit, give the main thread the time to start its event # loop to wait for the response from B after 2000 catch { puts $chan shoo } res set res }] set res } -cleanup { interp delete $idb } -constraints {testchannel} -result {Owner lost} test iocmd-32.2 {delete interp of reflected chan} { # Bug 3034840 # Run this test in an interp with memory debugging to panic # on the double free interp create child child eval { proc no-op args {} proc driver {sub args} {return {initialize finalize watch read}} chan event [chan create read driver] readable no-op } interp delete child } {} # 1st attempt without error in write, another with error in write: foreach ::writeErr {0 1} { test iocmd-32.3.$::writeErr {prevent copy-state against segfault by finalize, bug [79474c58800cdf94]} -setup { proc test_chan {args} { set rest [lassign $args mode chan] lappend ::ret $mode switch -exact $mode { read {puts $chan "Test" ; close $chan} write {if {$::writeErr} {return "boom"}; set data [lindex $rest 0]; string length $data} finalize {after 20 {set ::done done}} initialize {return "initialize watch finalize read write"} } } set clchlst {} set toev [after 5000 {set ::done tout}] } -body { set ::ret {} set ch [chan create "read write" test_chan] lappend clchlst $ch lassign [chan pipe] in1 out1 lappend clchlst $in1 $out1 lassign [chan pipe] in2 out2 lappend clchlst $in2 $out2 lassign [chan pipe] in3 out3 lappend clchlst $in3 $out3 # simulate exec: echo test >@ $out2 2>@ $out3 <@ $in1 &: fileevent $out2 writable [list apply {{cho che} { puts $cho test; close $cho; close $che }} $out2 $out3] # recopy to given chans in handler fileevent $in2 readable [list apply {{in out} { if {[catch { chan copy $in $out } msg]} { #puts err:$msg fileevent $in readable {} } }} $in2 $ch] fileevent $in3 readable [list apply {{in out} { if {[catch { chan copy $in $out } msg]} { #puts err:$msg fileevent $in readable {} } }} $in3 $ch] fileevent $out1 writable [list apply {{in out} { if {[catch { chan copy $in $out } msg]} { #puts err:$msg fileevent $out writable {} } }} $ch $out1] vwait ::done lappend ::ret $::done } -cleanup { foreach ch $clchlst { catch {close $ch} } after cancel $toev unset -nocomplain ::done ::ret ch in1 in2 in3 out1 out2 out3 toev clchlst } -result {initialize read write finalize done} }; unset ::writeErr # ### ### ### ######### ######### ######### ## Same tests as above, but exercising the code forwarding and ## receiving driver operations to the originator thread. # -*- tcl -*- # ### ### ### ######### ######### ######### ## Testing the reflected channel (Thread forwarding). # ## The id numbers refer to the original test without thread ## forwarding, and gaps due to tests not applicable to forwarding are ## left to keep this asociation. # ### ### ### ######### ######### ######### ## Helper command. Runs a script in a separate thread and returns the ## result. A channel is transfered into the thread as well, and list of ## configuation variables proc inthread {chan script args} { # Test thread. set tid [thread::create -preserved] thread::send $tid {load {} Tcltest} # Init thread configuration. # - Listed variables # - Id of main thread # - A number of helper commands foreach v $args { upvar 1 $v x thread::send $tid [list set $v $x] } thread::send $tid [list set mid [thread::id]] thread::send $tid { proc note {item} {global notes; lappend notes $item} proc notes {} {global notes; return $notes} proc noteOpts opts {global notes; lappend notes [dict merge { -code !?! -level !?! -errorcode !?! -errorline !?! -errorinfo !?! } $opts]} } thread::send $tid [list proc s {} [list uplevel 1 $script]]; # (*) # Transfer channel (cut/splice aka detach/attach) testchannel cut $chan thread::send $tid [list testchannel splice $chan] # Run test script, also run local event loop! # The local event loop waits for the result to come back. # It is also necessary for the execution of forwarded channel # operations. set ::tres "" thread::send -async $tid { after 500 catch {s} res; # This runs the script, 's' was defined at (*) thread::send -async $mid [list set ::tres $res] } vwait ::tres # Remove test thread, and return the captured result. thread::release $tid return $::tres } # ### ### ### ######### ######### ######### # ### ### ### ######### ######### ######### test iocmd.tf-22.2 {chan finalize, for close} -match glob -body { set res {} proc foo {args} {track; oninit; return {}} note [set c [chan create {r w} foo]] note [inthread $c { close $c # Close the deleted the channel. file channels rc* } c] # Channel destruction does not kill handler command! note [info command foo] rename foo {} set res } -constraints {testchannel thread} -result {{initialize rc* {read write}} rc* {finalize rc*} {} foo} test iocmd.tf-22.3 {chan finalize, for close, error, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code error 5} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg # Channel is gone despite error. note [file channels rc*] notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{initialize rc* {read write}} rc* {finalize rc*} 1 5 {}} test iocmd.tf-22.4 {chan finalize, for close, error, close errror} -match glob -body { set res {} proc foo {args} {track; oninit; error FOO} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{initialize rc* {read write}} rc* {finalize rc*} 1 FOO} test iocmd.tf-22.5 {chan finalize, for close, arbitrary result} -match glob -body { set res {} proc foo {args} {track; oninit; return SOMETHING} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{initialize rc* {read write}} rc* {finalize rc*} 0 {}} test iocmd.tf-22.6 {chan finalize, for close, break, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 3} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg notes } c] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-22.7 {chan finalize, for close, continue, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 4} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg notes } c] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-22.8 {chan finalize, for close, custom code, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -code 777 BANG} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg]; note $msg notes } c] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-22.9 {chan finalize, for close, ignore level, close error} -match glob -body { set res {} proc foo {args} {track; oninit; return -level 5 -code 777 BANG} note [set c [chan create {r w} foo]] notes [inthread $c { note [catch {close $c} msg opt]; note $msg; noteOpts $opt notes } c] rename foo {} set res } -result {{initialize rc* {read write}} rc* {finalize rc*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "finalize"*}} \ -constraints {testchannel thread} # --- === *** ########################### # method read test iocmd.tf-23.1 {chan read, regular data return} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return snarf } set c [chan create {r w} foo] notes [inthread $c { note [read $c 10] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{read rc* 4096} {read rc* 4096} snarfsnarf} test iocmd.tf-23.2 {chan read, bad data return, too much} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return [string repeat snarf 1000] } set c [chan create {r w} foo] notes [inthread $c { note [catch {[read $c 2]} msg]; note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{read rc* 4096} 1 {read delivered more than requested}} test iocmd.tf-23.3 {chan read, for non-readable channel} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track; note MUST_NOT_HAPPEN } set c [chan create {w} foo] notes [inthread $c { note [catch {[read $c 2]} msg]; note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {1 {channel "rc*" wasn't opened for reading}} test iocmd.tf-23.4 {chan read, error return} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {read $c 2} msg]; note $msg close $c notes } c] rename foo {} set res } -result {{read rc* 4096} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-23.5 {chan read, break return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {read $c 2} msg]; note $msg close $c notes } c] rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-23.6 {chan read, continue return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {read $c 2} msg]; note $msg close $c notes } c] rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-23.7 {chan read, custom return is error} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -code 777 BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {read $c 2} msg]; note $msg close $c notes } c] rename foo {} set res } -result {{read rc* 4096} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-23.8 {chan read, level is squashed} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track return -level 55 -code 777 BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {read $c 2} msg opt]; note $msg; noteOpts $opt close $c notes } c] rename foo {} set res } -result {{read rc* 4096} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "read"*}} \ -constraints {testchannel thread} test iocmd.tf-23.9 {chan read, no data means eof} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track return "" } set c [chan create {r w} foo] } -body { notes [inthread $c { note [read $c 2] note [eof $c] close $c notes } c] set res } -cleanup { rename foo {} unset res } -result {{read rc* 4096} {} 1} \ -constraints {testchannel thread} test iocmd.tf-23.10 {chan read, EAGAIN means no data, yet no eof either} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track error EAGAIN } set c [chan create {r w} foo] } -body { notes [inthread $c { note [read $c 2] note [eof $c] close $c notes } c] set res } -cleanup { rename foo {} unset res } -result {{read rc* 4096} {} 0} \ -constraints {testchannel thread} # --- === *** ########################### # method write test iocmd.tf-24.1 {chan write, regular write} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track set written [string length [lindex $args 2]] note $written return $written } set c [chan create {r w} foo] inthread $c { puts -nonewline $c snarf; flush $c close $c } c rename foo {} set res } -constraints {testchannel thread} -result {{write rc* snarf} 5} test iocmd.tf-24.2 {chan write, ack partial writes} -match glob -body { set res {} proc foo {args} { oninit; onfinal; track set written [string length [lindex $args 2]] if {$written > 10} {set written [expr {$written / 2}]} note $written return $written } set c [chan create {r w} foo] inthread $c { puts -nonewline $c snarfsnarfsnarf; flush $c close $c } c rename foo {} set res } -constraints {testchannel thread} -result {{write rc* snarfsnarfsnarf} 7 {write rc* arfsnarf} 8} test iocmd.tf-24.3 {chan write, failed write} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note -1; return -1} set c [chan create {r w} foo] inthread $c { puts -nonewline $c snarfsnarfsnarf; flush $c close $c } c rename foo {} set res } -constraints {testchannel thread} -result {{write rc* snarfsnarfsnarf} -1} test iocmd.tf-24.4 {chan write, non-writable channel} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {1 {channel "rc*" wasn't opened for writing}} test iocmd.tf-24.5 {chan write, bad result, more written than data} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return 10000} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{write rc* snarf} 1 {write wrote more than requested}} test iocmd.tf-24.6 {chan write, zero writes} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return 0} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{write rc* snarf} 1 {write wrote more than requested}} test iocmd.tf-24.7 {chan write, failed write, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-24.8 {chan write, failed write, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; error BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-24.9 {chan write, failed write, break return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-24.10 {chan write, failed write, continue return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-24.11 {chan write, failed write, custom return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code 777 BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-24.12 {chan write, failed write, non-numeric return is error} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return BANG} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 {expected integer but got "BANG"}} \ -constraints {testchannel thread} test iocmd.tf-24.13 {chan write, failed write, level is ignored} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -level 55 -code 777 BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {puts -nonewline $c snarfsnarfsnarf; flush $c} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{write rc* snarfsnarfsnarf} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "write"*}} \ -constraints {testchannel thread} test iocmd.tf-24.14 {chan write, no EAGAIN means that writing is allowed at this time, bug 2936225} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track return 3 } set c [chan create {r w} foo] } -body { notes [inthread $c { note [puts -nonewline $c ABC ; flush $c] close $c notes } c] set res } -cleanup { rename foo {} unset res } -result {{write rc* ABC} {}} \ -constraints {testchannel thread} test iocmd.tf-24.15 {chan write, EAGAIN means that writing is not allowed at this time, bug 2936225} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track # Note: The EAGAIN signals that the channel cannot accept # write requests right now, this in turn causes the IO core to # request the generation of writable events (see expected # result below, and compare to case 24.14 above). error EAGAIN } set c [chan create {r w} foo] } -body { notes [inthread $c { note [puts -nonewline $c ABC ; flush $c] close $c notes } c] set res } -cleanup { proc foo {args} {onfinal; set ::done-24.15 1; return 3} after 1000 {set ::done-24.15 2} vwait done-24.15 rename foo {} unset res } -result {{write rc* ABC} {watch rc* write} {}} \ -constraints {testchannel thread} test iocmd.tf-24.16 {chan write, note the background flush setup by close due to the EAGAIN leaving data in buffers.} -match glob -setup { set res {} proc foo {args} { oninit; onfinal; track # Note: The EAGAIN signals that the channel cannot accept # write requests right now, this in turn causes the IO core to # request the generation of writable events (see expected # result below, and compare to case 24.14 above). error EAGAIN } set c [chan create {r w} foo] } -body { notes [inthread $c { note [puts -nonewline $c ABC ; flush $c] close $c notes } c] # Replace handler with all-tracking one which doesn't error. # This will tell us if a write-due-flush is there. proc foo {args} { onfinal; note BG ; track ; set ::endbody-24.16 1} # Flush (sic!) the event-queue to capture the write from a # BG-flush. after 1000 {set ::endbody-24.16 2} vwait endbody-24.16 set res } -cleanup { proc foo {args} {onfinal; set ::done-24.16 1; return 3} after 1000 {set ::done-24.16 2} vwait done-24.16 rename foo {} unset res } -result {{write rc* ABC} {watch rc* write} {} BG {write rc* ABC}} \ -constraints {testchannel thread} test iocmd.tf-24.17.bug3522560 {postevent for transfered channel} \ -constraints {testchannel thread} -setup { # This test exposes how the execution of postevent in the handler thread causes # a crash if we are not properly injecting the events into the owning thread instead. # With the injection the test will simply complete without crash. set beat 10000 set drive 999 set data ...---... proc LOG {text} { #puts stderr "[thread::id]: $text" return } proc POST {hi} { LOG "-> [info level 0]" chan postevent $hi read LOG "<- [info level 0]" set ::timer [after $::drive [info level 0]] return } proc HANDLER {op ch args} { lappend ::res [lrange [info level 0] 1 end] LOG "-> [info level 0]" set ret {} switch -glob -- $op { init* {set ret {initialize finalize watch read}} watch { set l [lindex $args 0] catch {after cancel $::timer} if {[llength $l]} { set ::timer [after $::drive [list POST $ch]] } } finalize { catch { after cancel $::timer } after 500 {set ::forever now} } read { set ret $::data set ::data {} ; # Next is EOF. } } LOG "<- [info level 0] : $ret" return $ret } } -body { LOG BEGIN set ch [chan create {read} HANDLER] set tid [thread::create { proc LOG {text} { #puts stderr "\t\t\t\t\t\t[thread::id]: $text" return } LOG THREAD-STARTED load {} Tcltest proc bgerror s { LOG BGERROR:$s } vwait forever LOG THREAD-DONE }] testchannel cut $ch thread::send $tid [list set thech $ch] thread::send $tid [list set beat $beat] thread::send -async $tid { LOG SPLICE-BEG testchannel splice $thech LOG SPLICE-END proc PROCESS {ch} { LOG "-> [info level 0]" if {[eof $ch]} { close $ch set ::done 1 set c <> } else { set c [read $ch 1] } LOG "GOTCHAR: $c" LOG "<- [info level 0]" } LOG THREAD-FILEEVENT fconfigure $thech -translation binary -blocking 0 fileevent $thech readable [list PROCESS $thech] LOG THREAD-NOEVENT-LOOP set done 0 while {!$done} { after $beat LOG THREAD-HEARTBEAT update } LOG THREAD-LOOP-DONE #thread::exit # Thread exits cause leaks; Use clean thread shutdown set forever yourGirl } LOG MAIN_WAITING vwait forever LOG MAIN_DONE set res } -cleanup { after cancel $::timer rename LOG {} rename POST {} rename HANDLER {} unset beat drive data forever res tid ch timer } -match glob \ -result {{initialize rc* read} {watch rc* read} {read rc* 4096} {watch rc* {}} {watch rc* read} {read rc* 4096} {watch rc* {}} {finalize rc*}} # --- === *** ########################### # method cgetall test iocmd.tf-25.1 {chan configure, cgetall, standard options} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *}}} test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body { set res {} proc foo {args} {oninit cget cgetall; onfinal; track; return ""} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *}}} test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return "-bar foo -snarf x" } set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * * -translation {auto *} -bar foo -snarf x}} test iocmd.tf-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return "-bar" } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{cgetall rc*} 1 {Expected list with even number of elements, got 1 element instead}} test iocmd.tf-25.5 {chan configure, cgetall, bad result, not a list} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return "\{" } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{cgetall rc*} 1 {unmatched open brace in list}} test iocmd.tf-25.6 {chan configure, cgetall, error return} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{cgetall rc*} 1 BOOM!} test iocmd.tf-25.7 {chan configure, cgetall, break return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-25.8 {chan configure, cgetall, continue return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-25.9 {chan configure, cgetall, custom return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code 777 BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cgetall rc*} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-25.10 {chan configure, cgetall, level is ignored} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -level 55 -code 777 BANG } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{cgetall rc*} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "cgetall"*}} \ -constraints {testchannel thread} # --- === *** ########################### # method configure test iocmd.tf-26.1 {chan configure, set standard option} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track; note MUST_NOT_HAPPEN; return } set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -translation lf] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{}} test iocmd.tf-26.2 {chan configure, set option, error return} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo bar} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{configure rc* -rc-foo bar} 1 BOOM!} test iocmd.tf-26.3 {chan configure, set option, ok return} -match glob -body { set res {} proc foo {args} {oninit configure; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -rc-foo bar] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{configure rc* -rc-foo bar} {}} test iocmd.tf-26.4 {chan configure, set option, break return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code break BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo bar} msg] note $msg close $c notes } c] rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-26.5 {chan configure, set option, continue return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo bar} msg] note $msg close $c notes } c] rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-26.6 {chan configure, set option, custom return is error} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -code 444 BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo bar} msg] note $msg close $c notes } c] rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-26.7 {chan configure, set option, level is ignored} -match glob -body { set res {} proc foo {args} { oninit configure; onfinal; track return -level 55 -code 444 BANG } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo bar} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{configure rc* -rc-foo bar} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "configure"*}} \ -constraints {testchannel thread} # --- === *** ########################### # method cget test iocmd.tf-27.1 {chan configure, get option, ok return} -match glob -body { set res {} proc foo {args} {oninit cget cgetall; onfinal; track; return foo} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -rc-foo] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{cget rc* -rc-foo} foo} test iocmd.tf-27.2 {chan configure, get option, error return} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo} msg] note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{cget rc* -rc-foo} 1 BOOM!} test iocmd.tf-27.3 {chan configure, get option, break return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code error BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cget rc* -rc-foo} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-27.4 {chan configure, get option, continue return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code continue BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-27.5 {chan configure, get option, custom return is error} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -code 333 BOOM! } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo} msg] note $msg close $c notes } c] rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-27.6 {chan configure, get option, level is ignored} -match glob -body { set res {} proc foo {args} { oninit cget cgetall; onfinal; track return -level 77 -code 333 BANG } set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -rc-foo} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{cget rc* -rc-foo} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "cget"*}} \ -constraints {testchannel thread} # --- === *** ########################### # method seek test iocmd.tf-28.1 {chan tell, not supported by handler} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [tell $c] close $c notes } c] rename foo {} set res } -result {-1} \ -constraints {testchannel thread} test iocmd.tf-28.2 {chan tell, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-28.3 {chan tell, break return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.4 {chan tell, continue return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.5 {chan tell, custom return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code 222 BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.6 {chan tell, level is ignored} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -level 11 -code 222 BANG} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "seek"*}} \ -constraints {testchannel thread} test iocmd.tf-28.7 {chan tell, regular return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 88} set c [chan create {r w} foo] notes [inthread $c { note [tell $c] close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 88} \ -constraints {testchannel thread} test iocmd.tf-28.8 {chan tell, negative return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -1} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 {Tried to seek before origin}} \ -constraints {testchannel thread} test iocmd.tf-28.9 {chan tell, string return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return BOGUS} set c [chan create {r w} foo] notes [inthread $c { note [catch {tell $c} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} 1 {expected integer but got "BOGUS"}} \ -constraints {testchannel thread} test iocmd.tf-28.10 {chan seek, not supported by handler} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {1 {error during seek on "rc*": invalid argument}} \ -constraints {testchannel thread} test iocmd.tf-28.11 {chan seek, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-28.12 {chan seek, break return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.13 {chan seek, continue return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.14 {chan seek, custom return is error} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code 99 BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-28.15 {chan seek, level is ignored} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -level 33 -code 99 BANG} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg opt] note $msg noteOpts $opt close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "seek"*}} \ -constraints {testchannel thread} test iocmd.tf-28.16 {chan seek, bogus return, negative location} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -45} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 {Tried to seek before origin}} \ -constraints {testchannel thread} test iocmd.tf-28.17 {chan seek, bogus return, string return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return BOGUS} set c [chan create {r w} foo] notes [inthread $c { note [catch {seek $c 0 start} msg] note $msg close $c notes } c] rename foo {} set res } -result {{seek rc* 0 start} 1 {expected integer but got "BOGUS"}} \ -constraints {testchannel thread} test iocmd.tf-28.18 {chan seek, ok result} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 23} set c [chan create {r w} foo] notes [inthread $c { note [seek $c 0 current] close $c notes } c] rename foo {} set res } -result {{seek rc* 0 current} {}} \ -constraints {testchannel thread} foreach {testname code} { iocmd.tf-28.19.0 start iocmd.tf-28.19.1 current iocmd.tf-28.19.2 end } { test $testname "chan seek, base conversion, $code" -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return 0} set c [chan create {r w} foo] notes [inthread $c { note [seek $c 0 $code] close $c notes } c code] rename foo {} set res } -result [list [list seek rc* 0 $code] {}] \ -constraints {testchannel thread} } # --- === *** ########################### # method blocking test iocmd.tf-29.1 {chan blocking, no handler support} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -blocking] close $c notes } c] rename foo {} set res } -result {1} \ -constraints {testchannel thread} test iocmd.tf-29.2 {chan blocking, no handler support} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -blocking 0] note [fconfigure $c -blocking] close $c notes } c] rename foo {} set res } -result {{} 0} \ -constraints {testchannel thread} test iocmd.tf-29.3 {chan blocking, retrieval, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; note MUST_NOT_HAPPEN; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -blocking] close $c notes } c] rename foo {} set res } -result {1} \ -constraints {testchannel thread} test iocmd.tf-29.4 {chan blocking, resetting, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -blocking 0] note [fconfigure $c -blocking] close $c notes } c] rename foo {} set res } -result {{blocking rc* 0} {} 0} \ -constraints {testchannel thread} test iocmd.tf-29.5 {chan blocking, setting, handler support} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { note [fconfigure $c -blocking 1] note [fconfigure $c -blocking] close $c notes } c] rename foo {} set res } -result {{blocking rc* 1} {} 1} \ -constraints {testchannel thread} test iocmd.tf-29.6 {chan blocking, error return} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; error BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg] note $msg # Catch the close. It changes blocking mode internally, and runs into the error result. catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 1 BOOM!} \ -constraints {testchannel thread} test iocmd.tf-29.7 {chan blocking, break return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code break BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg] note $msg catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-29.8 {chan blocking, continue return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code continue BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg] note $msg catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-29.9 {chan blocking, custom return is error} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -code 44 BOOM!} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg] note $msg catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 1 *bad code*} \ -constraints {testchannel thread} test iocmd.tf-29.10 {chan blocking, level is ignored} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return -level 99 -code 44 BANG} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg opt] note $msg noteOpts $opt catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 1 *bad code* {-code 1 -level 0 -errorcode NONE -errorline 1 -errorinfo *bad code*subcommand "blocking"*}} \ -constraints {testchannel thread} test iocmd.tf-29.11 {chan blocking, regular return ok, value ignored} -match glob -body { set res {} proc foo {args} {oninit blocking; onfinal; track; return BOGUS} set c [chan create {r w} foo] notes [inthread $c { note [catch {fconfigure $c -blocking 0} msg] note $msg catch {close $c} notes } c] rename foo {} set res } -result {{blocking rc* 0} 0 {}} \ -constraints {testchannel thread} # --- === *** ########################### # method watch test iocmd.tf-30.1 {chan watch, read interest, some return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return IGNORED} set c [chan create {r w} foo] notes [inthread $c { note [fileevent $c readable {set tick $tick}] close $c ;# 2nd watch, interest zero. notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{watch rc* read} {watch rc* {}} {}} test iocmd.tf-30.2 {chan watch, write interest, error return} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return -code error BOOM!_IGNORED} set c [chan create {r w} foo] notes [inthread $c { note [fileevent $c writable {set tick $tick}] note [fileevent $c writable {}] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} -result {{watch rc* write} {watch rc* {}} {} {}} test iocmd.tf-30.3 {chan watch, accumulated interests} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { note [fileevent $c writable {set tick $tick}] note [fileevent $c readable {set tick $tick}] note [fileevent $c writable {}] note [fileevent $c readable {}] close $c notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{watch rc* write} {watch rc* {read write}} {watch rc* read} {watch rc* {}} {} {} {} {}} test iocmd.tf-30.4 {chan watch, unchanged interest not forwarded} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { note [fileevent $c writable {set tick $tick}] note [fileevent $c readable {set tick $tick}] ;# Script is changing, note [fileevent $c readable {set tock $tock}] ;# interest does not. close $c ;# 3rd and 4th watch, removing the event handlers. notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{watch rc* write} {watch rc* {read write}} {watch rc* write} {watch rc* {}} {} {} {}} # --- === *** ########################### # postevent # Not possible from a thread not containing the command handler. # Check that this is rejected. test iocmd.tf-31.8 {chan postevent, bad input} -match glob -body { set res {} proc foo {args} {oninit; onfinal; track; return} set c [chan create {r w} foo] notes [inthread $c { catch {chan postevent $c r} msg note $msg close $c notes } c] rename foo {} set res } -constraints {testchannel thread} \ -result {{can not find reflected channel named "rc*"}} # --- === *** ########################### # 'Pull the rug' tests. Create channel in a thread A, move to other # thread B, destroy the origin thread (A) before or during access from # B. Must not crash, must return proper errors. test iocmd.tf-32.0 {origin thread of moved channel gone} -match glob -body { #puts <<$tcltest::mainThread>>main set tida [thread::create -preserved];#puts <<$tida>> thread::send $tida {load {} Tcltest} set tidb [thread::create -preserved];#puts <<$tidb>> thread::send $tidb {load {} Tcltest} # Set up channel in thread thread::send $tida $helperscript set chan [thread::send $tida { proc foo {args} {oninit seek; onfinal; track; return} set chan [chan create {r w} foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd thread. thread::send $tida [list testchannel cut $chan] thread::send $tidb [list testchannel splice $chan] # Kill origin thread, then access channel from 2nd thread. thread::release $tida set res {} lappend res [catch {thread::send $tidb [list puts $chan shoo]} msg] $msg lappend res [catch {thread::send $tidb [list tell $chan]} msg] $msg lappend res [catch {thread::send $tidb [list seek $chan 1]} msg] $msg lappend res [catch {thread::send $tidb [list gets $chan]} msg] $msg lappend res [catch {thread::send $tidb [list close $chan]} msg] $msg thread::release $tidb set res } -constraints {testchannel thread} \ -result {1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost}} # The test iocmd.tf-32.1 unavoidably exhibits a memory leak. We are testing # the ability of the reflected channel system to react to the situation where # the thread in which the driver routines runs exits during driver operations. # In this case, thread exit handlers signal back to the owner thread so that the # channel operation does not hang. There's no way to test this without actually # exiting a thread in mid-operation, and that action is unavoidably leaky (which # is why [thread::exit] is advised against). # # Use constraints to skip this test while valgrinding so this expected leak # doesn't prevent a finding of "leak-free". # test iocmd.tf-32.1 {origin thread of moved channel destroyed during access} -match glob -body { #puts <<$tcltest::mainThread>>main set tida [thread::create -preserved];#puts <<$tida>> thread::send $tida {load {} Tcltest} set tidb [thread::create -preserved];#puts <<$tidb>> thread::send $tidb {load {} Tcltest} # Set up channel in thread thread::send $tida $helperscript set chan [thread::send $tida { proc foo {args} { oninit; onfinal; track; # destroy thread during channel access thread::exit } set chan [chan create {r w} foo] fconfigure $chan -buffering none set chan }] # Move channel to 2nd thread. thread::send $tida [list testchannel cut $chan] thread::send $tidb [list testchannel splice $chan] # Run access from thread B, wait for response from A (A is not # using event loop at this point, so the event pile up in the # queue. thread::send $tidb [list set chan $chan] thread::send $tidb [list set mid [thread::id]] thread::send -async $tidb { # wait a bit, give the main thread the time to start its event # loop to wait for the response from B after 2000 catch { puts $chan shoo } res thread::send -async $mid [list set ::res $res] } vwait ::res catch {thread::release $tida} thread::release $tidb set res } -constraints {testchannel thread notValgrind} \ -result {Owner lost} # Tests of readFile set BIN_DATA "\u0000\u0001\u0002\u0003\u0004\u001a\u001b\u000d\u000a\u0000" test iocmd.readFile-1.1 "readFile procedure: syntax" -body { readFile } -returnCodes error -result {wrong # args: should be "readFile filename ?mode?"} test iocmd.readFile-1.2 "readFile procedure: syntax" -body { readFile a b c } -returnCodes error -result {wrong # args: should be "readFile filename ?mode?"} test iocmd.readFile-1.3 "readFile procedure: syntax" -body { readFile gorp gorp2 } -returnCodes error -result {bad mode "gorp2": must be binary or text} test iocmd.readFile-2.1 "readFile procedure: behaviour" -setup { set f [makeFile "File\nContents" readFile21.txt] } -body { readFile $f } -cleanup { removeFile $f } -result "File\nContents\n" test iocmd.readFile-2.2 "readFile procedure: behaviour" -setup { set f [makeFile "File\nContents" readFile22.txt] } -body { readFile $f text } -cleanup { removeFile $f } -result "File\nContents\n" test iocmd.readFile-2.3 "readFile procedure: behaviour" -setup { set f [makeFile "" readFile23.bindata] apply {filename { global BIN_DATA set ff [open $filename wb] puts -nonewline $ff $BIN_DATA close $ff }} $f } -body { list [binary scan [readFile $f binary] c* x] $x } -cleanup { removeFile $f } -result {1 {0 1 2 3 4 26 27 13 10 0}} # Need to set up ahead of the test set f [makeFile "" readFile24.txt] removeFile $f test iocmd.readFile-2.4 "readFile procedure: behaviour" -body { readFile $f } -returnCodes error -result "couldn't open \"$f\": no such file or directory" # Tests of writeFile test iocmd.writeFile-1.1 "writeFile procedure: syntax" -body { writeFile } -returnCodes error -result {wrong # args: should be "writeFile filename ?mode? data"} test iocmd.writeFile-1.2 "writeFile procedure: syntax" -body { writeFile a b c d } -returnCodes error -result {wrong # args: should be "writeFile filename ?mode? data"} test iocmd.writeFile-1.3 "writeFile procedure: syntax" -body { writeFile gorp gorp2 gorp3 } -returnCodes error -result {bad mode "gorp2": must be binary or text} test iocmd.writeFile-2.1 "readFile procedure: behaviour" -setup { set f [makeFile "" writeFile21.txt] removeFile $f } -body { list [writeFile $f "File\nContents\n"] [apply {filename { set f [open $filename] set text [read $f] close $f return $text }} $f] } -cleanup { file delete $f } -result [list {} "File\nContents\n"] test iocmd.writeFile-2.2 "readFile procedure: behaviour" -setup { set f [makeFile "" writeFile22.txt] removeFile $f } -body { writeFile $f text "File\nContents\n" apply {filename { set f [open $filename] set text [read $f] close $f return $text }} $f } -cleanup { file delete $f } -result "File\nContents\n" test iocmd.writeFile-2.3 "readFile procedure: behaviour" -setup { set f [makeFile "" writeFile23.txt] removeFile $f } -body { writeFile $f binary $BIN_DATA apply {filename { set f [open $filename rb] set bytes [read $f] close $f binary scan $bytes c* x return $x }} $f } -cleanup { file delete $f } -result {0 1 2 3 4 26 27 13 10 0} # Tests of foreachLine test iocmd.foreachLine-1.1 "foreachLine procedure: syntax" -returnCodes error -body { foreachLine } -result {wrong # args: should be "foreachLine varName filename body"} test iocmd.foreachLine-1.2 "foreachLine procedure: syntax" -returnCodes error -body { foreachLine a b c d } -result {wrong # args: should be "foreachLine varName filename body"} test iocmd.foreachLine-1.3 "foreachLine procedure: basic errors" -setup { set f [makeFile "" foreachLine13.txt] } -body { apply {filename { array set b {1 1} foreachLine b $filename {} }} $f } -cleanup { removeFile $f } -returnCodes error -result {can't set "line": variable is array} set f [makeFile "" foreachLine14.txt] removeFile $f test iocmd.foreachLine-1.4 "foreachLine procedure: basic errors" -body { apply {filename { foreachLine var $filename {} }} $f } -returnCodes error -result "couldn't open \"$f\": no such file or directory" test iocmd.foreachLine-2.1 "foreachLine procedure: behaviour" -setup { set f [makeFile "a\nb\nc" foreachLine21.txt] } -body { apply {filename { set lines {} foreachLine var $filename { lappend lines $var } return $lines }} $f } -cleanup { removeFile $f } -result {a b c} test iocmd.foreachLine-2.2 "foreachLine procedure: behaviour" -setup { set f [makeFile "a\nbb\nc\ndd" foreachLine22.txt] } -body { apply {filename { set lines {} foreachLine var $filename { if {[string length $var] == 1} continue lappend lines $var } return $lines }} $f } -cleanup { removeFile $f } -result {bb dd} test iocmd.foreachLine-2.3 "foreachLine procedure: behaviour" -setup { set f [makeFile "a\nbb\nccc\ndd\ne" foreachLine23.txt] } -body { apply {filename { set lines {} foreachLine var $filename { if {[string length $var] > 2} break lappend lines $var } return $lines }} $f } -cleanup { removeFile $f } -result {a bb} test iocmd.foreachLine-2.4 "foreachLine procedure: behaviour" -setup { set f [makeFile "a\nbb\nccc\ndd\ne" foreachLine24.txt] } -body { apply {filename { set lines {} foreachLine var $filename { if {[string length $var] > 2} { return $var } lappend lines $var } return $lines }} $f } -cleanup { removeFile $f } -result {ccc} test iocmd.foreachLine-2.5 "foreachLine procedure: behaviour" -setup { set f [makeFile "a\nbb\nccc\ndd\ne" foreachLine25.txt] } -body { apply {filename { set lines {} foreachLine var $filename { if {[string length $var] > 2} { error "line too long" } lappend lines $var } return $lines }} $f } -cleanup { removeFile $f } -returnCodes error -result {line too long} # ### ### ### ######### ######### ######### # ### ### ### ######### ######### ######### rename track {} # cleanup # Eliminate valgrind "still reachable" reports on outstanding "Detached" # structures in the detached list which stem from PipeClose2Proc not waiting # around for background processes to complete, meaning that previous calls to # Tcl_ReapDetachedProcs might not have had a chance to reap all processes. after 10 exec [info nameofexecutable] << {} foreach file [list test1 test2 test3 test4] { removeFile $file } # delay long enough for background processes to finish after 500 removeFile test5 cleanupTests return tcl9.0.3/tests/io.test0000644000175000017500000111045315104661341014226 0ustar sergeisergei# -*- tcl -*- # Functionality covered: operation of all IO commands, and all procedures # defined in generic/tclIO.c. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 } namespace eval ::tcl::test::io { namespace import ::tcltest::* variable umaskValue variable path variable f variable i variable n variable v variable msg variable expected set ::tcltestlib {} catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] set ::tcltestlib [info loaded {} Tcltest] } source [file join [file dirname [info script]] tcltests.tcl] testConstraint pointerIs64bit [expr {$::tcl_platform(pointerSize) >= 8}] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testchannel [llength [info commands testchannel]] testConstraint testfevent [llength [info commands testfevent]] testConstraint testchannelevent [llength [info commands testchannelevent]] testConstraint testmainthread [llength [info commands testmainthread]] testConstraint testobj [llength [info commands testobj]] testConstraint testservicemode [llength [info commands testservicemode]] # Some things fail under Windows in Continuous Integration systems for subtle # reasons such as CI often running with elevated privileges in a container. testConstraint notWinCI [expr { $::tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}] testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}] # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] # You need a *very* special environment to do some tests. In # particular, many file systems do not support large-files... testConstraint largefileSupport [expr {$::tcl_platform(os) ne "Darwin"}] # some tests can only be run is umask is 2 # if "umask" cannot be run, the tests will be skipped. set umaskValue 0 testConstraint umask [expr {![catch {set umaskValue [scan [exec /bin/sh -c umask] %o]}]}] testConstraint makeFileInHome [expr {![file exists ~/_test_] && [file writable ~]}] # set up a long data file for some of the following tests set path(longfile) [makeFile {} longfile] set f [open $path(longfile) w] fconfigure $f -translation lf for { set i 0 } { $i < 100 } { incr i} { puts $f "#123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \#123456789abcdef01 \#" } close $f set path(cat) [makeFile { set f stdin if {$argv ne ""} { set f [open [lindex $argv 0]] } fconfigure $f -translation binary -blocking 0 -eofchar \x1A fconfigure stdout -translation binary -buffering none fileevent $f readable "foo $f" proc foo {f} { set x [read $f] catch {puts -nonewline $x} if {[eof $f]} { close $f exit 0 } } vwait forever } cat] set thisScript [file join [pwd] [info script]] proc contents {file} { set f [open $file] fconfigure $f -translation binary set a [read $f] close $f return $a } test io-1.5 {Tcl_WriteChars: CheckChannelErrors} {emptyTest} { # no test, need to cause an async error. } {} set path(test1) [makeFile {} test1] test io-1.6 {Tcl_WriteChars: WriteBytes} { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f "a\x4D\x00" close $f contents $path(test1) } "a\x4D\x00" test io-1.7 {Tcl_WriteChars: WriteChars} { set f [open $path(test1) w] fconfigure $f -encoding shiftjis puts -nonewline $f "a乍\x00" close $f contents $path(test1) } "a\x93\xE1\x00" set path(test2) [makeFile {} test2] test io-1.8 {Tcl_WriteChars: WriteChars} { # This test written for SF bug #506297. # # Executing this test without the fix for the referenced bug # applied to tcl will cause tcl, more specifically WriteChars, to # go into an infinite loop. set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp puts -nonewline $f [format %s%c [string repeat " " 4] 12399] close $f contents $path(test2) } " \x1B\$B\$O\x1B(B" test io-1.9 {Tcl_WriteChars: WriteChars} { # When closing a channel with an encoding that appends # escape bytes, check for the case where the escape # bytes overflow the current IO buffer. The bytes # should be moved into a new buffer. set data "1234567890 [format %c 12399]" set sizes [list] # With default buffer size set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp puts -nonewline $f $data close $f lappend sizes [file size $path(test2)] # With buffer size equal to the length # of the data, the escape bytes would # go into the next buffer. set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp -buffersize 16 puts -nonewline $f $data close $f lappend sizes [file size $path(test2)] # With buffer size that is large enough # to hold 1 byte of escaped data, but # not all 3. This should not write # the escape bytes to the first buffer # and then again to the second buffer. set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp -buffersize 17 puts -nonewline $f $data close $f lappend sizes [file size $path(test2)] # With buffer size that can hold 2 out of # 3 bytes of escaped data. set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp -buffersize 18 puts -nonewline $f $data close $f lappend sizes [file size $path(test2)] # With buffer size that can hold all the # data and escape bytes. set f [open $path(test2) w] fconfigure $f -encoding iso2022-jp -buffersize 19 puts -nonewline $f $data close $f lappend sizes [file size $path(test2)] set sizes } {19 19 19 19 19} proc testreadwrite {size {mode ""} args} { set tmpfile [file join [temporaryDirectory] io-1.10.tmp] set w [string repeat A $size] try { set fd [open $tmpfile w$mode] try { if {[llength $args]} { fconfigure $fd {*}$args } puts -nonewline $fd $w } finally { close $fd } set fd [open $tmpfile r$mode] try { if {[llength $args]} { fconfigure $fd {*}$args } set r [read $fd] } finally { close $fd } } finally { file delete $tmpfile } string equal $w $r } test io-1.10 {WriteChars: large file (> INT_MAX). Bug 3d01d51bc4} -constraints { pointerIs64bit perf } -body { testreadwrite 0x80000000 } -result 1 test io-1.11 {WriteChars: large file (> UINT_MAX). Bug 3d01d51bc4} -constraints { pointerIs64bit perf } -body { testreadwrite 0x100000000 "" -buffersize 1000000 } -result 1 test io-1.12 {WriteChars: large file (== UINT_MAX). Bug 90ff9b7f73} -constraints { pointerIs64bit perf } -body { # *Exactly* UINT_MAX - separate bug from the general large file tests testreadwrite 0xffffffff } -result 1 test io-2.1 {WriteBytes} { # loop until all bytes are written set f [open $path(test1) w] fconfigure $f -translation binary -buffersize 16 -translation crlf puts $f "abcdefghijklmnopqrstuvwxyz" close $f contents $path(test1) } "abcdefghijklmnopqrstuvwxyz\r\n" test io-2.2 {WriteBytes: savedLF > 0} { # After flushing buffer, there was a \n left over from the last # \n -> \r\n expansion. It gets stuck at beginning of this buffer. set f [open $path(test1) w] fconfigure $f -translation binary -buffersize 16 -translation crlf puts -nonewline $f "123456789012345\n12" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "123456789012345\r" "123456789012345\r\n12"] test io-2.3 {WriteBytes: flush on line} { # Tcl "line" buffering has weird behavior: if current buffer contains # a \n, entire buffer gets flushed. Logical behavior would be to flush # only up to the \n. set f [open $path(test1) w] fconfigure $f -translation binary -buffering line -translation crlf puts -nonewline $f "\n12" set x [contents $path(test1)] close $f set x } "\r\n12" test io-2.4 {WriteBytes: reset sawLF after each buffer} { set f [open $path(test1) w] fconfigure $f -translation binary -buffering line -buffersize 16 puts -nonewline $f "abcdefg\nhijklmnopqrstuvwxyz" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] test io-2.5 {WriteBytes: large file (> INT_MAX). Bug 3d01d51bc4} -constraints { pointerIs64bit perf } -body { # Binary mode testreadwrite 0x80000000 b } -result 1 test io-2.6 {WriteBytes: large file (> UINT_MAX). Bug 3d01d51bc4} -constraints { pointerIs64bit perf } -body { # Binary mode testreadwrite 0x100000000 b -buffersize 1000000 } -result 1 test io-2.7 {WriteBytes: large file (== UINT_MAX). Bug 90ff9b7f73} -constraints { pointerIs64bit perf } -body { # *Exactly* UINT_MAX - separate bug from the general large file tests testreadwrite 0xffffffff b } -result 1 test io-3.1 {WriteChars: compatibility with WriteBytes} { # loop until all bytes are written set f [open $path(test1) w] fconfigure $f -encoding ascii -buffersize 16 -translation crlf puts $f "abcdefghijklmnopqrstuvwxyz" close $f contents $path(test1) } "abcdefghijklmnopqrstuvwxyz\r\n" test io-3.2 {WriteChars: compatibility with WriteBytes: savedLF > 0} { # After flushing buffer, there was a \n left over from the last # \n -> \r\n expansion. It gets stuck at beginning of this buffer. set f [open $path(test1) w] fconfigure $f -encoding ascii -buffersize 16 -translation crlf puts -nonewline $f "123456789012345\n12" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "123456789012345\r" "123456789012345\r\n12"] test io-3.3 {WriteChars: compatibility with WriteBytes: flush on line} { # Tcl "line" buffering has weird behavior: if current buffer contains # a \n, entire buffer gets flushed. Logical behavior would be to flush # only up to the \n. set f [open $path(test1) w] fconfigure $f -encoding ascii -buffering line -translation crlf puts -nonewline $f "\n12" set x [contents $path(test1)] close $f set x } "\r\n12" test io-3.4 {WriteChars: loop over stage buffer} -body { # stage buffer maps to more than can be queued at once. set f [open $path(test1) w] fconfigure $f -encoding jis0208 -buffersize 16 -profile tcl8 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } -cleanup { catch {close $f} } -result [list "!)!)!)!)!)!)!)!)" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test io-3.5 {WriteChars: saved != 0} -body { # Bytes produced by UtfToExternal from end of last channel buffer # had to be moved to beginning of next channel buffer to preserve # requested buffersize. set f [open $path(test1) w] fconfigure $f -encoding jis0208 -buffersize 17 -profile tcl8 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } -cleanup { catch {close $f} } -result [list "!)!)!)!)!)!)!)!)!" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test io-3.6 {WriteChars: (stageRead + dstWrote == 0)} { # One incomplete UTF-8 character at end of staging buffer. Backup # in src to the beginning of that UTF-8 character and try again. # # Translate the first 16 bytes, produce 14 bytes of output, 2 left over # (first two bytes of A in UTF-8). Given those two bytes try # translating them again, find that no bytes are read produced, and break # to outer loop where those two bytes will have the remaining 4 bytes # (the last byte of A plus the all of B) appended. set f [open $path(test1) w] fconfigure $f -encoding shiftjis -buffersize 16 puts -nonewline $f "12345678901234AB" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "12345678901234\x82\x60" "12345678901234\x82\x60\x82\x61"] test io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} -body { # When translating UTF-8 to external, the produced bytes went past end # of the channel buffer. This is done purpose -- we then truncate the # bytes at the end of the partial character to preserve the requested # blocksize on flush. The truncated bytes are moved to the beginning # of the next channel buffer. set f [open $path(test1) w] fconfigure $f -encoding jis0208 -buffersize 17 -profile tcl8 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } -cleanup { catch {close $f} } -result [list "!)!)!)!)!)!)!)!)!" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test io-3.8 {WriteChars: reset sawLF after each buffer} { set f [open $path(test1) w] fconfigure $f -encoding ascii -buffering line -translation lf \ -buffersize 16 puts -nonewline $f "abcdefg\nhijklmnopqrstuvwxyz" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] test io-3.9 {Write: flush line-buffered channels when crlf is split over two buffers} -body { # https://core.tcl-lang.org/tcllib/tktedit?name=c9d8a52fe set f [open $path(test1) w] fconfigure $f -buffering line -translation crlf -buffersize 8 puts $f "1234567" string map {"\r" "" "\n" ""} [contents $path(test1)] } -cleanup { close $f } -result "1234567" test io-4.1 {TranslateOutputEOL: lf} { # search for \n set f [open $path(test1) w] fconfigure $f -buffering line -translation lf puts $f "abcde" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "abcde\n" "abcde\n"] test io-4.2 {TranslateOutputEOL: cr} { # search for \n, replace with \r set f [open $path(test1) w] fconfigure $f -buffering line -translation cr puts $f "abcde" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "abcde\r" "abcde\r"] test io-4.3 {TranslateOutputEOL: crlf} { # simple case: search for \n, replace with \r set f [open $path(test1) w] fconfigure $f -buffering line -translation crlf puts $f "abcde" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "abcde\r\n" "abcde\r\n"] test io-4.4 {TranslateOutputEOL: crlf} { # keep storing more bytes in output buffer until output buffer is full. # We have 13 bytes initially that would turn into 18 bytes. Fill # dest buffer while (dstEnd < dstMax). set f [open $path(test1) w] fconfigure $f -translation crlf -buffersize 16 puts -nonewline $f "1234567\n\n\n\n\nA" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "1234567\r\n\r\n\r\n\r\n\r" "1234567\r\n\r\n\r\n\r\n\r\nA"] test io-4.5 {TranslateOutputEOL: crlf} { # Check for overflow of the destination buffer set f [open $path(test1) w] fconfigure $f -translation crlf -buffersize 12 puts -nonewline $f "12345678901\n456789012345678901234" close $f set x [contents $path(test1)] } "12345678901\r\n456789012345678901234" test io-5.1 {CheckFlush: not full} { set f [open $path(test1) w] puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "" "12345678901234567890"] test io-5.2 {CheckFlush: full} { set f [open $path(test1) w] fconfigure $f -buffersize 16 puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "1234567890123456" "12345678901234567890"] test io-5.3 {CheckFlush: not line} { set f [open $path(test1) w] fconfigure $f -buffering line puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "" "12345678901234567890"] test io-5.4 {CheckFlush: line} { set f [open $path(test1) w] fconfigure $f -buffering line -translation lf -encoding ascii puts -nonewline $f "1234567890\n1234567890" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "1234567890\n1234567890" "1234567890\n1234567890"] test io-5.5 {CheckFlush: none} { set f [open $path(test1) w] fconfigure $f -buffering none puts -nonewline $f "1234567890" set x [list [contents $path(test1)]] close $f lappend x [contents $path(test1)] } [list "1234567890" "1234567890"] test io-6.1 {Tcl_GetsObj: working} { set f [open $path(test1) w] puts $f "foo\nboo" close $f set f [open $path(test1)] set x [gets $f] close $f set x } {foo} test io-6.2 {Tcl_GetsObj: CheckChannelErrors() != 0} emptyTest { # no test, need to cause an async error. } {} test io-6.3 {Tcl_GetsObj: how many have we used?} { # if (bufPtr != NULL) {oldRemoved = bufPtr->nextRemoved} set f [open $path(test1) w] fconfigure $f -translation crlf puts $f "abc\ndefg" close $f set f [open $path(test1)] set x [list [tell $f] [gets $f line] [tell $f] [gets $f line] $line] close $f set x } {0 3 5 4 defg} test io-6.4 {Tcl_GetsObj: encoding == NULL} { set f [open $path(test1) w] fconfigure $f -translation binary puts $f "\x81\x34\x00" close $f set f [open $path(test1)] fconfigure $f -translation binary set x [list [gets $f line] $line] close $f set x } [list 3 "\x81\x34\x00"] test io-6.5 {Tcl_GetsObj: encoding != NULL} { set f [open $path(test1) w] fconfigure $f -translation binary puts $f "\x88\xEA\x92\x9A" close $f set f [open $path(test1)] fconfigure $f -encoding shiftjis set x [list [gets $f line] $line] close $f set x } [list 2 "一丁"] set a "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" append a $a append a $a test io-6.6 {Tcl_GetsObj: loop test} { # if (dst >= dstEnd) set f [open $path(test1) w] puts $f $a puts $f hi close $f set f [open $path(test1)] set x [list [gets $f line] $line] close $f set x } [list 256 $a] test io-6.7 {Tcl_GetsObj: error in input} stdio { # if (FilterInputBytes(chanPtr, &gs) != 0) set f [open "|[list [interpreter] $path(cat)]" w+] puts -nonewline $f "hi\nwould" flush $f gets $f fconfigure $f -blocking 0 set x [gets $f line] close $f set x } {-1} test io-6.8 {Tcl_GetsObj: remember if EOF is seen} { set f [open $path(test1) w] puts $f "abcdef\x1Aghijk\nwombat" close $f set f [open $path(test1)] fconfigure $f -eofchar \x1A set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {6 abcdef -1 {}} test io-6.9 {Tcl_GetsObj: remember if EOF is seen} { set f [open $path(test1) w] puts $f "abcdefghijk\nwom\x1Abat" close $f set f [open $path(test1)] fconfigure $f -eofchar \x1A set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {11 abcdefghijk 3 wom} # Comprehensive tests test io-6.10 {Tcl_GetsObj: lf mode: no chars} { set f [open $path(test1) w] close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line] close $f set x } {-1 {}} test io-6.11 {Tcl_GetsObj: lf mode: lone \n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\n" close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {0 {} -1 {}} test io-6.12 {Tcl_GetsObj: lf mode: lone \r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r" close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 1 "\r" -1 ""] test io-6.13 {Tcl_GetsObj: lf mode: 1 char} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f a close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.14 {Tcl_GetsObj: lf mode: 1 char followed by EOL} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\n" close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.15 {Tcl_GetsObj: lf mode: several chars} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" close $f set f [open $path(test1)] fconfigure $f -translation lf set x [list [gets $f line] $line [gets $f line] $line [gets $f line] $line [gets $f line] $line] close $f set x } [list 4 "abcd" 10 "efgh\rijkl\r" 4 "mnop" -1 ""] test io-6.16 {Tcl_GetsObj: cr mode: no chars} { set f [open $path(test1) w] close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line] close $f set x } {-1 {}} test io-6.17 {Tcl_GetsObj: cr mode: lone \n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\n" close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 1 "\n" -1 ""] test io-6.18 {Tcl_GetsObj: cr mode: lone \r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r" close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {0 {} -1 {}} test io-6.19 {Tcl_GetsObj: cr mode: 1 char} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f a close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.20 {Tcl_GetsObj: cr mode: 1 char followed by EOL} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\r" close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.21 {Tcl_GetsObj: cr mode: several chars} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" close $f set f [open $path(test1)] fconfigure $f -translation cr set x [list [gets $f line] $line [gets $f line] $line [gets $f line] $line [gets $f line] $line] close $f set x } [list 9 "abcd\nefgh" 4 "ijkl" 5 "\nmnop" -1 ""] test io-6.22 {Tcl_GetsObj: crlf mode: no chars} { set f [open $path(test1) w] close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line] close $f set x } {-1 {}} test io-6.23 {Tcl_GetsObj: crlf mode: lone \n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\n" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 1 "\n" -1 ""] test io-6.24 {Tcl_GetsObj: crlf mode: lone \r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 1 "\r" -1 ""] test io-6.25 {Tcl_GetsObj: crlf mode: \r\r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r\r" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 2 "\r\r" -1 ""] test io-6.26 {Tcl_GetsObj: crlf mode: \r\n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r\n" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 0 "" -1 ""] test io-6.27 {Tcl_GetsObj: crlf mode: 1 char} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f a close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.28 {Tcl_GetsObj: crlf mode: 1 char followed by EOL} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\r\n" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.29 {Tcl_GetsObj: crlf mode: several chars} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [list [gets $f line] $line [gets $f line] $line [gets $f line] $line] close $f set x } [list 14 "abcd\nefgh\rijkl" 4 "mnop" -1 ""] test io-6.30 {Tcl_GetsObj: crlf mode: buffer exhausted} {testchannel} { # if (eol >= dstEnd) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r\nabcdefghijklmnoprstuvwxyz" close $f set f [open $path(test1)] fconfigure $f -translation crlf -buffersize 16 set x [list [gets $f line] $line [testchannel inputbuffered $f]] close $f set x } [list 15 "123456789012345" 15] test io-6.31 {Tcl_GetsObj: crlf mode: buffer exhausted, blocked} {stdio testchannel fileevent} { # (FilterInputBytes() != 0) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {crlf lf} -buffering none puts -nonewline $f "bbbbbbbbbbbbbb\r\n123456789012345\r" fconfigure $f -buffersize 16 set x [gets $f] fconfigure $f -blocking 0 lappend x [gets $f line] $line [fblocked $f] [testchannel inputbuffered $f] close $f set x } [list "bbbbbbbbbbbbbb" -1 "" 1 16] test io-6.32 {Tcl_GetsObj: crlf mode: buffer exhausted, more data} {testchannel} { # not (FilterInputBytes() != 0) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r\n123" close $f set f [open $path(test1)] fconfigure $f -translation crlf -buffersize 16 set x [list [gets $f line] $line [tell $f] [testchannel inputbuffered $f]] close $f set x } [list 15 "123456789012345" 17 3] test io-6.33 {Tcl_GetsObj: crlf mode: buffer exhausted, at eof} { # eol still equals dstEnd set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r" close $f set f [open $path(test1)] fconfigure $f -translation crlf -buffersize 16 set x [list [gets $f line] $line [eof $f]] close $f set x } [list 16 "123456789012345\r" 1] test io-6.34 {Tcl_GetsObj: crlf mode: buffer exhausted, not followed by \n} { # not (*eol == '\n') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\rabcd\r\nefg" close $f set f [open $path(test1)] fconfigure $f -translation crlf -buffersize 16 set x [list [gets $f line] $line [tell $f]] close $f set x } [list 20 "123456789012345\rabcd" 22] test io-6.35 {Tcl_GetsObj: auto mode: no chars} { set f [open $path(test1) w] close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line] close $f set x } {-1 {}} test io-6.36 {Tcl_GetsObj: auto mode: lone \n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\n" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 0 "" -1 ""] test io-6.37 {Tcl_GetsObj: auto mode: lone \r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 0 "" -1 ""] test io-6.38 {Tcl_GetsObj: auto mode: \r\r} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r\r" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line [gets $f line] $line] close $f set x } [list 0 "" 0 "" -1 ""] test io-6.39 {Tcl_GetsObj: auto mode: \r\n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r\n" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] close $f set x } [list 0 "" -1 ""] test io-6.40 {Tcl_GetsObj: auto mode: 1 char} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f a close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.41 {Tcl_GetsObj: auto mode: 1 char followed by EOL} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\r\n" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] close $f set x } {1 a -1 {}} test io-6.42 {Tcl_GetsObj: auto mode: several chars} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [gets $f line] $line [gets $f line] $line] lappend x [gets $f line] $line [gets $f line] $line [gets $f line] $line close $f set x } [list 4 "abcd" 4 "efgh" 4 "ijkl" 4 "mnop" -1 ""] test io-6.43 {Tcl_GetsObj: input saw cr} {stdio testchannel fileevent} { # if (chanPtr->flags & INPUT_SAW_CR) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto lf} -buffering none puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" fconfigure $f -buffersize 16 set x [list [gets $f]] fconfigure $f -blocking 0 lappend x [gets $f line] $line [testchannel queuedcr $f] fconfigure $f -blocking 1 puts -nonewline $f "\nabcd\refg\x1A" lappend x [gets $f line] $line [testchannel queuedcr $f] lappend x [gets $f line] $line close $f set x } [list "bbbbbbbbbbbbbbb" 15 "123456789abcdef" 1 4 "abcd" 0 3 "efg"] test io-6.44 {Tcl_GetsObj: input saw cr, not followed by cr} {stdio testchannel fileevent} { # not (*eol == '\n') set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto lf} -buffering none puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" fconfigure $f -buffersize 16 set x [list [gets $f]] fconfigure $f -blocking 0 lappend x [gets $f line] $line [testchannel queuedcr $f] fconfigure $f -blocking 1 puts -nonewline $f "abcd\refg\x1A" lappend x [gets $f line] $line [testchannel queuedcr $f] lappend x [gets $f line] $line close $f set x } [list "bbbbbbbbbbbbbbb" 15 "123456789abcdef" 1 4 "abcd" 0 3 "efg"] test io-6.45 {Tcl_GetsObj: input saw cr, skip right number of bytes} {stdio testchannel fileevent} { # Tcl_ExternalToUtf() set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto lf} -buffering none fconfigure $f -encoding utf-16 puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" fconfigure $f -buffersize 16 gets $f fconfigure $f -blocking 0 set x [list [gets $f line] $line [testchannel queuedcr $f]] fconfigure $f -blocking 1 puts -nonewline $f "\nabcd\refg" lappend x [gets $f line] $line [testchannel queuedcr $f] close $f set x } [list 15 "123456789abcdef" 1 4 "abcd" 0] test io-6.46 {Tcl_GetsObj: input saw cr, followed by just \n should give eof} {stdio testchannel fileevent} { # memmove() set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto lf} -buffering none puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" fconfigure $f -buffersize 16 gets $f fconfigure $f -blocking 0 set x [list [gets $f line] $line [testchannel queuedcr $f]] fconfigure $f -blocking 1 puts -nonewline $f "\n\x1A" lappend x [gets $f line] $line [testchannel queuedcr $f] close $f set x } [list 15 "123456789abcdef" 1 -1 "" 0] test io-6.47 {Tcl_GetsObj: auto mode: \r at end of buffer, peek for \n} {testchannel} { # (eol == dstEnd) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r\nabcdefghijklmnopq" close $f set f [open $path(test1)] fconfigure $f -translation auto -buffersize 16 set x [list [gets $f] [testchannel inputbuffered $f]] close $f set x } [list "123456789012345" 15] test io-6.48 {Tcl_GetsObj: auto mode: \r at end of buffer, no more avail} {testchannel} { # PeekAhead() did not get any, so (eol >= dstEnd) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r" close $f set f [open $path(test1)] fconfigure $f -translation auto -buffersize 16 set x [list [gets $f] [testchannel queuedcr $f]] close $f set x } [list "123456789012345" 1] test io-6.49 {Tcl_GetsObj: auto mode: \r followed by \n} {testchannel} { # if (*eol == '\n') {skip++} set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\r\n78901" close $f set f [open $path(test1)] set x [list [gets $f] [testchannel queuedcr $f] [tell $f] [gets $f]] close $f set x } [list "123456" 0 8 "78901"] test io-6.50 {Tcl_GetsObj: auto mode: \r not followed by \n} {testchannel} { # not (*eol == '\n') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\r78901" close $f set f [open $path(test1)] set x [list [gets $f] [testchannel queuedcr $f] [tell $f] [gets $f]] close $f set x } [list "123456" 0 7 "78901"] test io-6.51 {Tcl_GetsObj: auto mode: \n} { # else if (*eol == '\n') {goto gotoeol;} set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\n78901" close $f set f [open $path(test1)] set x [list [gets $f] [tell $f] [gets $f]] close $f set x } [list "123456" 7 "78901"] test io-6.52 {Tcl_GetsObj: saw EOF character} {testchannel} { # if (eof != NULL) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\x1Ak9012345\r" close $f set f [open $path(test1)] fconfigure $f -eofchar \x1A set x [list [gets $f] [testchannel queuedcr $f] [tell $f] [gets $f]] close $f set x } [list "123456" 0 6 ""] test io-6.53 {Tcl_GetsObj: device EOF} { # didn't produce any bytes set f [open $path(test1) w] close $f set f [open $path(test1)] set x [list [gets $f line] $line [eof $f]] close $f set x } {-1 {} 1} test io-6.54 {Tcl_GetsObj: device EOF} { # got some bytes before EOF. set f [open $path(test1) w] puts -nonewline $f abc close $f set f [open $path(test1)] set x [list [gets $f line] $line [eof $f]] close $f set x } {3 abc 1} test io-6.55 {Tcl_GetsObj: overconverted} { # Tcl_ExternalToUtf(), make sure state updated set f [open $path(test1) w] fconfigure $f -encoding iso2022-jp puts $f "there一ok\n丁more bytes\nhere" close $f set f [open $path(test1)] fconfigure $f -encoding iso2022-jp set x [list [gets $f line] $line [gets $f line] $line [gets $f line] $line] close $f set x } [list 8 "there一ok" 11 "丁more bytes" 4 "here"] test io-6.56 {Tcl_GetsObj: incomplete lines should disable file events} {stdio fileevent} { update set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -buffering none puts -nonewline $f "foobar" fconfigure $f -blocking 0 variable x {} after 500 [namespace code { lappend x timeout }] fileevent $f readable [namespace code { lappend x [gets $f] }] vwait [namespace which -variable x] vwait [namespace which -variable x] fconfigure $f -blocking 1 puts -nonewline $f "baz\n" after 500 [namespace code { lappend x timeout }] fconfigure $f -blocking 0 vwait [namespace which -variable x] vwait [namespace which -variable x] close $f set x } {{} timeout foobarbaz timeout} test io-7.1 {FilterInputBytes: split up character at end of buffer} { # (result == TCL_CONVERT_MULTIBYTE) set f [open $path(test1) w] fconfigure $f -encoding shiftjis puts $f "123456789012301234\nend" close $f set f [open $path(test1)] fconfigure $f -encoding shiftjis -buffersize 16 set x [gets $f] close $f set x } "123456789012301234" test io-7.2 {FilterInputBytes: split up character in middle of buffer} { # (bufPtr->nextAdded < bufPtr->bufLength) set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f "1234567890\n123\x82\x4F\x82\x50\x82" close $f set f [open $path(test1)] fconfigure $f -encoding shiftjis -profile tcl8 set x [list [gets $f line] $line [eof $f]] close $f set x } [list 10 "1234567890" 0] test io-7.3 {FilterInputBytes: split up character at EOF} {testchannel} { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" close $f set f [open $path(test1)] fconfigure $f -encoding shiftjis -profile tcl8 set x [list [gets $f line] $line] lappend x [tell $f] [testchannel inputbuffered $f] [eof $f] lappend x [gets $f line] $line close $f set x } [list 16 "123456789012301\x82" 18 0 1 -1 ""] test io-7.4 {FilterInputBytes: recover from split up character} {stdio fileevent} { set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation binary -buffering none puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" fconfigure $f -encoding shiftjis -blocking 0 fileevent $f read [namespace code "ready $f"] variable x {} proc ready {f} { variable x lappend x [gets $f line] $line [fblocked $f] } vwait [namespace which -variable x] fconfigure $f -translation binary -blocking 1 puts $f "\x51\x82\x52" fconfigure $f -encoding shiftjis vwait [namespace which -variable x] close $f set x } [list -1 "" 1 17 "12345678901230123" 0] test io-8.1 {PeekAhead: only go to device if no more cached data} {testchannel} { # (bufPtr->nextPtr == NULL) set f [open $path(test1) w] fconfigure $f -encoding ascii -translation lf puts -nonewline $f "123456789012345\r\n2345678" close $f set f [open $path(test1)] fconfigure $f -encoding ascii -translation auto -buffersize 16 # here gets $f set x [testchannel inputbuffered $f] close $f set x } "7" test io-8.2 {PeekAhead: only go to device if no more cached data} {stdio testchannel fileevent} { # not (bufPtr->nextPtr == NULL) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation lf -encoding ascii -buffering none puts -nonewline $f "123456789012345\r\nbcdefghijklmnopqrstuvwxyz" variable x {} fileevent $f read [namespace code "ready $f"] proc ready {f} { variable x lappend x [gets $f line] $line [testchannel inputbuffered $f] } fconfigure $f -encoding utf-16 -buffersize 16 -blocking 0 vwait [namespace which -variable x] fconfigure $f -translation auto -encoding ascii -blocking 1 # here vwait [namespace which -variable x] close $f set x } [list -1 "" 42 15 "123456789012345" 25] test io-8.3 {PeekAhead: no cached data available} {stdio testchannel fileevent} { # (bytesLeft == 0) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto binary} puts -nonewline $f "abcdefghijklmno\r" flush $f set x [list [gets $f line] $line [testchannel queuedcr $f]] close $f set x } [list 15 "abcdefghijklmno" 1] set a "123456789012345678901234567890" append a "123456789012345678901234567890" append a "1234567890123456789012345678901" test io-8.4 {PeekAhead: cached data available in this buffer} { # not (bytesLeft == 0) set f [open $path(test1) w+] fconfigure $f -translation binary puts $f "${a}\r\nabcdef" close $f set f [open $path(test1)] fconfigure $f -translation binary -translation auto # "${a}\r" was converted in one operation (because ENCODING_LINESIZE # is 30). To check if "\n" follows, calls PeekAhead and determines # that cached data is available in buffer w/o having to call driver. set x [gets $f] close $f set x } $a unset a test io-8.5 {PeekAhead: don't peek if last read was short} {stdio testchannel fileevent} { # (bufPtr->nextAdded < bufPtr->length) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto binary} puts -nonewline $f "abcdefghijklmno\r" flush $f # here set x [list [gets $f line] $line [testchannel queuedcr $f]] close $f set x } {15 abcdefghijklmno 1} test io-8.6 {PeekAhead: change to non-blocking mode} {stdio testchannel fileevent} { # ((chanPtr->flags & CHANNEL_NONBLOCKING) == 0) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto binary} -buffersize 16 puts -nonewline $f "abcdefghijklmno\r" flush $f # here set x [list [gets $f line] $line [testchannel queuedcr $f]] close $f set x } {15 abcdefghijklmno 1} test io-8.7 {PeekAhead: cleanup} {stdio testchannel fileevent} { # Make sure bytes are removed from buffer. set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto binary} -buffering none puts -nonewline $f "abcdefghijklmno\r" # here set x [list [gets $f line] $line [testchannel queuedcr $f]] puts -nonewline $f "\x1A" lappend x [gets $f line] $line close $f set x } {15 abcdefghijklmno 1 -1 {}} test io-9.1 {CommonGetsCleanup} emptyTest { } {} test io-10.1 {Tcl_ReadChars: CheckChannelErrors} emptyTest { # no test, need to cause an async error. } {} test io-10.2 {Tcl_ReadChars: loop until enough copied} { # one time # for (copied = 0; (unsigned) toRead > 0; ) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f set f [open $path(test1)] set x [read $f 5] close $f set x } {abcde} test io-10.3 {Tcl_ReadChars: loop until enough copied} { # multiple times # for (copied = 0; (unsigned) toRead > 0; ) set f [open $path(test1) w] puts $f abcdefghijklmnopqrstuvwxyz close $f set f [open $path(test1)] fconfigure $f -buffersize 16 # here set x [read $f 19] close $f set x } {abcdefghijklmnopqrs} test io-10.4 {Tcl_ReadChars: no more in channel buffer} { # (copiedNow < 0) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] # here set x [read $f 1000] close $f set x } {abcdefghijkl} test io-10.5 {Tcl_ReadChars: stop on EOF} { # (chanPtr->flags & CHANNEL_EOF) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] # here set x [read $f 1000] close $f set x } {abcdefghijkl} test io-11.1 {ReadBytes: want to read a lot} { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] fconfigure $f -translation binary # here set x [read $f 1000] close $f set x } {abcdefghijkl} test io-11.2 {ReadBytes: want to read all} { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] fconfigure $f -translation binary # here set x [read $f] close $f set x } {abcdefghijkl} test io-11.3 {ReadBytes: allocate more space} { # (toRead > length - offset - 1) set f [open $path(test1) w] puts -nonewline $f abcdefghijklmnopqrstuvwxyz close $f set f [open $path(test1)] fconfigure $f -buffersize 16 -translation binary # here set x [read $f] close $f set x } {abcdefghijklmnopqrstuvwxyz} test io-11.4 {ReadBytes: EOF char found} { # (TranslateInputEOL() != 0) set f [open $path(test1) w] puts $f abcdefghijklmnopqrstuvwxyz close $f set f [open $path(test1)] fconfigure $f -translation binary -eofchar m # here set x [list [read $f] [eof $f] [read $f] [eof $f]] close $f set x } [list "abcdefghijkl" 1 "" 1] test io-12.1 {ReadChars: want to read a lot} { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] # here set x [read $f 1000] close $f set x } {abcdefghijkl} test io-12.2 {ReadChars: want to read all} { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] puts -nonewline $f abcdefghijkl close $f set f [open $path(test1)] # here set x [read $f] close $f set x } {abcdefghijkl} test io-12.3 {ReadChars: allocate more space} { # (toRead > length - offset - 1) set f [open $path(test1) w] puts -nonewline $f abcdefghijklmnopqrstuvwxyz close $f set f [open $path(test1)] fconfigure $f -buffersize 16 # here set x [read $f] close $f set x } {abcdefghijklmnopqrstuvwxyz} test io-12.4 {ReadChars: split-up char} {stdio testchannel fileevent} { # (srcRead == 0) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation binary -buffering none -buffersize 16 puts -nonewline $f "123456789012345\x96" fconfigure $f -encoding shiftjis -blocking 0 fileevent $f read [namespace code "ready $f"] proc ready {f} { variable x lappend x [read $f] [testchannel inputbuffered $f] } variable x {} fconfigure $f -encoding shiftjis vwait [namespace which -variable x] fconfigure $f -translation binary -blocking 1 puts -nonewline $f "\x7B" after 500 ;# Give the cat process time to catch up fconfigure $f -encoding shiftjis -blocking 0 vwait [namespace which -variable x] close $f set x } [list "123456789012345" 1 "本" 0] test io-12.5 {ReadChars: fileevents on partial characters} {stdio fileevent} { set path(test1) [makeFile { fconfigure stdout -translation binary -buffering none gets stdin; puts -nonewline "\xE7" gets stdin; puts -nonewline "\x89" gets stdin; puts -nonewline "\xA6" } test1] set f [open "|[list [interpreter] $path(test1)]" r+] fileevent $f readable [namespace code { lappend x [read $f] if {[eof $f]} { lappend x eof } }] puts $f "go1" flush $f fconfigure $f -blocking 0 -encoding utf-8 variable x {} vwait [namespace which -variable x] after 500 [namespace code { lappend x timeout }] vwait [namespace which -variable x] puts $f "go2" flush $f vwait [namespace which -variable x] after 500 [namespace code { lappend x timeout }] vwait [namespace which -variable x] puts $f "go3" flush $f vwait [namespace which -variable x] vwait [namespace which -variable x] lappend x [catch {close $f} msg] $msg set x } "{} timeout {} timeout 牦 {} eof 0 {}" test io-12.6 {ReadChars: too many chars read} { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ [string repeat 뻯 20][string repeat . 20]] return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 while {![eof $c]} { read $c 15 } close $c } {} test io-12.7 {ReadChars: too many chars read [bc5b790099]} { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ [string repeat 뻯 10]....뻯] return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 while {![eof $c]} { read $c 7 } close $c } {} test io-12.8 {ReadChars: multibyte chars split} { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2\xA0 close $f set f [open $path(test1)] fconfigure $f -encoding utf-8 -buffersize 10 set in [read $f] close $f scan [string index $in end] %c } 160 test io-12.9 {ReadChars: multibyte chars split} -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 close $f set f [open $path(test1)] fconfigure $f -encoding utf-8 -profile tcl8 -buffersize 10 set in [read $f] read $f scan [string index $in end] %c } -cleanup { catch {close $f} } -result 194 test io-12.10 {ReadChars: multibyte chars split} -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 close $f set f [open $path(test1)] fconfigure $f -encoding utf-8 -profile strict -buffersize 10 set in [read $f] close $f scan [string index $in end] %c } -cleanup { catch {close $f} } -returnCodes 1 -match glob -result {error reading "file*":\ invalid or incomplete multibyte or wide character} test io-12.11 {ReadChars: multibyte chars split} -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 close $f set f [open $path(test1)] fconfigure $f -encoding utf-8 -profile tcl8 -buffersize 10 set in [read $f] close $f scan [string index $in end] %c } -cleanup { catch {close $f} } -result 194 test io-13.1 {TranslateInputEOL: cr mode} {} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\rdef\r" close $f set f [open $path(test1)] fconfigure $f -translation cr set x [read $f] close $f set x } "abcd\ndef\n" test io-13.2 {TranslateInputEOL: crlf mode} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef\r\n" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [read $f] close $f set x } "abcd\ndef\n" test io-13.3 {TranslateInputEOL: crlf mode: naked cr} { # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef\r" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [read $f] close $f set x } "abcd\ndef\r" test io-13.4 {TranslateInputEOL: crlf mode: cr followed by not \n} { # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef\rfgh" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [read $f] close $f set x } "abcd\ndef\rfgh" test io-13.5 {TranslateInputEOL: crlf mode: naked lf} { # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef\nfgh" close $f set f [open $path(test1)] fconfigure $f -translation crlf set x [read $f] close $f set x } "abcd\ndef\nfgh" test io-13.6 {TranslateInputEOL: auto mode: saw cr in last segment} {stdio testchannel fileevent} { # (chanPtr->flags & INPUT_SAW_CR) # This test may fail on slower machines. set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -blocking 0 -buffering none -translation {auto lf} fileevent $f read [namespace code "ready $f"] proc ready {f} { variable x lappend x [read $f] [testchannel queuedcr $f] } variable x {} variable y {} puts -nonewline $f "abcdefghj\r" after 500 [namespace code {set y ok}] vwait [namespace which -variable y] puts -nonewline $f "\n01234" after 500 [namespace code {set y ok}] vwait [namespace which -variable y] close $f set x } [list "abcdefghj\n" 1 "01234" 0] test io-13.7 {TranslateInputEOL: auto mode: naked \r} testchannel { # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [list [read $f] [testchannel queuedcr $f]] close $f set x } [list "abcd\n" 1] test io-13.8 {TranslateInputEOL: auto mode: \r\n} { # (*src == '\n') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [read $f] close $f set x } "abcd\ndef" test io-13.8.1 {TranslateInputEOL: auto mode: \r\n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef" close $f set f [open $path(test1)] fconfigure $f -translation auto set x {} lappend x [read $f 5] lappend x [read $f] close $f set x } [list "abcd\n" "def"] test io-13.8.2 {TranslateInputEOL: auto mode: \r\n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\ndef" close $f set f [open $path(test1)] fconfigure $f -translation auto -buffersize 6 set x {} lappend x [read $f 5] lappend x [read $f] close $f set x } [list "abcd\n" "def"] test io-13.8.3 {TranslateInputEOL: auto mode: \r\n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\r\n\r\ndef" close $f set f [open $path(test1)] fconfigure $f -translation auto -buffersize 7 set x {} lappend x [read $f 5] lappend x [read $f] close $f set x } [list "abcd\n" "\ndef"] test io-13.9 {TranslateInputEOL: auto mode: \r followed by not \n} { set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\rdef" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [read $f] close $f set x } "abcd\ndef" test io-13.10 {TranslateInputEOL: auto mode: \n} { # not (*src == '\r') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\ndef" close $f set f [open $path(test1)] fconfigure $f -translation auto set x [read $f] close $f set x } "abcd\ndef" test io-13.11 {TranslateInputEOL: EOF char} { # (*chanPtr->inEofChar != '\x00') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "abcd\ndefgh" close $f set f [open $path(test1)] fconfigure $f -translation auto -eofchar e set x [read $f] close $f set x } "abcd\nd" test io-13.12 {TranslateInputEOL: find EOF char in src} { # (*chanPtr->inEofChar != '\x00') set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "\r\n\r\n\r\nab\r\n\r\ndef\r\n\r\n\r\n" close $f set f [open $path(test1)] fconfigure $f -translation auto -eofchar e set x [read $f] close $f set x } "\n\n\nab\n\nd" test io-13.13 {Translation crlf: \r followed by encoding error before buffer boundary - TCL bug 73bb42fb}\ -setup { set buffersize 8 writeFile $path(test1) binary\ [string repeat x [expr $buffersize-1]]\r\xe9XXXXXXXXXXXXXXXXXXXXXXXX } -body { set fd [open $path(test1)] fconfigure $fd -encoding utf-8 -buffersize [expr {$buffersize+1}] -translation crlf catch {read $fd $buffersize} e d list [dict get $d -data] [dict get $d -code] [dict get $d -errorcode] } -cleanup { close $fd } -result {xxxxxxx 1 {POSIX EILSEQ {invalid or incomplete multibyte or wide character}}} test io-13.14 {Translation crlf: \r followed by encoding error after buffer boundary - TCL bug 73bb42fb (crash)}\ -setup { set buffersize 8 writeFile $path(test1) binary\ [string repeat x [expr $buffersize-1]]\r\xe9XXXXXXXXXXXXXXXXXXXXXXXX } -body { set fd [open $path(test1)] fconfigure $fd -encoding utf-8 -buffersize $buffersize -translation crlf catch {read $fd $buffersize} e d list [dict get $d -data] [dict get $d -code] [dict get $d -errorcode] } -cleanup { close $fd } -result {xxxxxxx 1 {POSIX EILSEQ {invalid or incomplete multibyte or wide character}}} # Test standard handle management. The functions tested are # Tcl_SetStdChannel and Tcl_GetStdChannel. Incidentally we are # also testing channel table management. if {[info commands testchannel] ne ""} { set consoleFileNames [lsort [testchannel open]] } else { # just to avoid an error set consoleFileNames [list] } test io-14.1 {Tcl_SetStdChannel and Tcl_GetStdChannel} {testchannel} { set l "" lappend l [fconfigure stdin -buffering] lappend l [fconfigure stdout -buffering] lappend l [fconfigure stderr -buffering] lappend l [lsort [testchannel open]] set l } [list line line none $consoleFileNames] test io-14.2 {Tcl_SetStdChannel and Tcl_GetStdChannel} { interp create x set l "" lappend l [x eval {fconfigure stdin -buffering}] lappend l [x eval {fconfigure stdout -buffering}] lappend l [x eval {fconfigure stderr -buffering}] interp delete x set l } {line line none} set path(test3) [makeFile {} test3] test io-14.3 {Tcl_SetStdChannel & Tcl_GetStdChannel} exec { set f [open $path(test1) w] puts -nonewline $f { close stdin close stdout close stderr set f [} puts $f [list open $path(test1) r]] puts $f "set f2 \[[list open $path(test2) w]]" puts $f "set f3 \[[list open $path(test3) w]]" puts $f { puts stdout [gets stdin] puts stdout out puts stderr err close $f close $f2 close $f3 } close $f set result [exec [interpreter] $path(test1)] set f [open $path(test2) r] set f2 [open $path(test3) r] lappend result [read $f] [read $f2] close $f close $f2 set result } {{ out } {err }} # This test relies on the fact that stdout is used before stderr test io-14.4 {Tcl_SetStdChannel & Tcl_GetStdChannel} {exec} { set f [open $path(test1) w] puts -nonewline $f { close stdin close stdout close stderr set f [} puts $f [list open $path(test1) r]] puts $f "set f2 \[[list open $path(test2) w]]" puts $f "set f3 \[[list open $path(test3) w]]" puts $f { puts stdout [gets stdin] puts stdout $f2 puts stderr $f3 close $f close $f2 close $f3 } close $f set result [exec [interpreter] $path(test1)] set f [open $path(test2) r] set f2 [open $path(test3) r] lappend result [read $f] [read $f2] close $f close $f2 set result } {{ close stdin stdout } {stderr }} catch {interp delete z} test io-14.5 {Tcl_GetChannel: stdio name translation} { interp create z eof stdin catch {z eval flush stdin} msg1 catch {z eval close stdin} msg2 catch {z eval flush stdin} msg3 set result [list $msg1 $msg2 $msg3] interp delete z set result } {{channel "stdin" wasn't opened for writing} {} {can not find channel named "stdin"}} test io-14.6 {Tcl_GetChannel: stdio name translation} { interp create z eof stdout catch {z eval flush stdout} msg1 catch {z eval close stdout} msg2 catch {z eval flush stdout} msg3 set result [list $msg1 $msg2 $msg3] interp delete z set result } {{} {} {can not find channel named "stdout"}} test io-14.7 {Tcl_GetChannel: stdio name translation} { interp create z eof stderr catch {z eval flush stderr} msg1 catch {z eval close stderr} msg2 catch {z eval flush stderr} msg3 set result [list $msg1 $msg2 $msg3] interp delete z set result } {{} {} {can not find channel named "stderr"}} set path(script) [makeFile {} script] test io-14.8 {reuse of stdio special channels} stdio { file delete $path(script) file delete $path(test1) set f [open $path(script) w] puts -nonewline $f { close stderr set f [} puts $f [list open $path(test1) w]] puts -nonewline $f { puts stderr hello close $f set f [} puts $f [list open $path(test1) r]] puts $f { puts [gets $f] } close $f set f [open "|[list [interpreter] $path(script)]" r] set c [gets $f] close $f set c } hello test io-14.9 {reuse of stdio special channels} {stdio fileevent} { file delete $path(script) file delete $path(test1) set f [open $path(script) w] puts $f { array set path [lindex $argv 0] set f [open $path(test1) w] puts $f hello close $f close stderr set f [open "|[list [info nameofexecutable] $path(cat) $path(test1)]" r] puts [gets $f] } close $f set f [open "|[list [interpreter] $path(script) [array get path]]" r] set c [gets $f] close $f # Added delay to give Windows time to stop the spawned process and clean # up its grip on the file test1. Added delete as proper test cleanup. # The failing tests were 18.1 and 18.2 as first re-users of file "test1". after 10000 file delete $path(script) file delete $path(test1) set c } hello test io-15.1 {Tcl_CreateCloseHandler} emptyTest { } {} test io-16.1 {Tcl_DeleteCloseHandler} emptyTest { } {} # Test channel table management. The functions tested are # GetChannelTable, DeleteChannelTable, Tcl_RegisterChannel, # Tcl_UnregisterChannel, Tcl_GetChannel and Tcl_CreateChannel. # # These functions use "eof stdin" to ensure that the standard # channels are added to the channel table of the interpreter. test io-17.1 {GetChannelTable, DeleteChannelTable on std handles} {testchannel} { set l1 [testchannel refcount stdin] eof stdin interp create x set l "" lappend l [expr {[testchannel refcount stdin] - $l1}] x eval {eof stdin} lappend l [expr {[testchannel refcount stdin] - $l1}] interp delete x lappend l [expr {[testchannel refcount stdin] - $l1}] set l } {0 1 0} test io-17.2 {GetChannelTable, DeleteChannelTable on std handles} {testchannel} { set l1 [testchannel refcount stdout] eof stdin interp create x set l "" lappend l [expr {[testchannel refcount stdout] - $l1}] x eval {eof stdout} lappend l [expr {[testchannel refcount stdout] - $l1}] interp delete x lappend l [expr {[testchannel refcount stdout] - $l1}] set l } {0 1 0} test io-17.3 {GetChannelTable, DeleteChannelTable on std handles} {testchannel} { set l1 [testchannel refcount stderr] eof stdin interp create x set l "" lappend l [expr {[testchannel refcount stderr] - $l1}] x eval {eof stderr} lappend l [expr {[testchannel refcount stderr] - $l1}] interp delete x lappend l [expr {[testchannel refcount stderr] - $l1}] set l } {0 1 0} test io-18.1 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { file delete -force $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being closed" } string compare [string tolower $l] \ [list 1 [format "can not find channel named \"%s\"" $f]] } 0 test io-18.2 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { file delete -force $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] interp create x interp share "" $f x lappend l [lindex [testchannel info $f] 15] x eval close $f lappend l [lindex [testchannel info $f] 15] interp delete x lappend l [lindex [testchannel info $f] 15] close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being closed" } string compare [string tolower $l] \ [list 1 2 1 1 [format "can not find channel named \"%s\"" $f]] } 0 test io-18.3 {Tcl_RegisterChannel, Tcl_UnregisterChannel} {testchannel} { file delete $path(test1) set l "" set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] interp create x interp share "" $f x lappend l [lindex [testchannel info $f] 15] interp delete x lappend l [lindex [testchannel info $f] 15] close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being closed" } string compare [string tolower $l] \ [list 1 2 1 [format "can not find channel named \"%s\"" $f]] } 0 test io-19.1 {Tcl_GetChannel->Tcl_GetStdChannel, standard handles} { eof stdin } 0 test io-19.2 {testing Tcl_GetChannel, user opened handle} { file delete $path(test1) set f [open $path(test1) w] set x [eof $f] close $f set x } 0 test io-19.3 {Tcl_GetChannel, channel not found} { list [catch {eof file34} msg] $msg } {1 {can not find channel named "file34"}} test io-19.4 {Tcl_CreateChannel, insertion into channel table} {testchannel} { file delete $path(test1) set f [open $path(test1) w] set l "" lappend l [eof $f] close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being closed" } string compare [string tolower $l] \ [list 0 [format "can not find channel named \"%s\"" $f]] } 0 test io-20.1 {Tcl_CreateChannel: initial settings} { set a [open $path(test2) w] set old [encoding system] encoding system ascii set f [open $path(test1) w] set x [fconfigure $f -encoding] close $f encoding system $old close $a set x } {ascii} test io-20.2 {Tcl_CreateChannel: initial settings} {win} { set f [open $path(test1) w+] set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] close $f set x } {{} {auto crlf}} test io-20.3 {Tcl_CreateChannel: initial settings} {unix} { set f [open $path(test1) w+] set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] close $f set x } {{} {auto lf}} set path(stdout) [makeFile {} stdout] test io-20.5 {Tcl_CreateChannel: install channel in empty slot} stdio { set f [open $path(script) w] puts -nonewline $f { close stdout set f1 [} puts $f [list open $path(stdout) w]] puts $f { fconfigure $f1 -buffersize 777 puts stderr [fconfigure stdout -buffersize] } close $f set f [open "|[list [interpreter] $path(script)]"] catch {close $f} msg set msg } {777} test io-21.1 {CloseChannelsOnExit} emptyTest { } {} # Test management of attributes associated with a channel, such as # its default translation, its name and type, etc. The functions # tested in this group are Tcl_GetChannelName, # Tcl_GetChannelType and Tcl_GetChannelFile. Tcl_GetChannelInstanceData # not tested because files do not use the instance data. test io-22.1 {Tcl_GetChannelMode} emptyTest { # Not used anywhere in Tcl. } {} test io-23.1 {Tcl_GetChannelName} {testchannel} { file delete $path(test1) set f [open $path(test1) w] set n [testchannel name $f] close $f string compare $n $f } 0 test io-24.1 {Tcl_GetChannelType} {testchannel} { file delete $path(test1) set f [open $path(test1) w] set t [testchannel type $f] close $f string compare $t file } 0 test io-25.1 {Tcl_GetChannelHandle, input} {testchannel} { set f [open $path(test1) w] fconfigure $f -translation lf puts $f "1234567890\n098765432" close $f set f [open $path(test1) r] gets $f set l "" lappend l [testchannel inputbuffered $f] lappend l [tell $f] close $f set l } {10 11} test io-25.2 {Tcl_GetChannelHandle, output} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [tell $f] flush $f lappend l [testchannel outputbuffered $f] lappend l [tell $f] close $f file delete $path(test1) set l } {6 6 0 6} test io-26.1 {Tcl_GetChannelInstanceData} stdio { # "pid" command uses Tcl_GetChannelInstanceData # Don't care what pid is (but must be a number), just want to exercise it. set f [open "|[list [interpreter] << exit]"] expr {[pid $f]} close $f } {} # Test flushing. The functions tested here are FlushChannel. test io-27.1 {FlushChannel, no output buffered} { file delete $path(test1) set f [open $path(test1) w] flush $f set s [file size $path(test1)] close $f set s } 0 test io-27.2 {FlushChannel, some output buffered} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set l "" puts $f hello lappend l [file size $path(test1)] flush $f lappend l [file size $path(test1)] close $f lappend l [file size $path(test1)] set l } {0 6 6} test io-27.3 {FlushChannel, implicit flush on close} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set l "" puts $f hello lappend l [file size $path(test1)] close $f lappend l [file size $path(test1)] set l } {0 6} test io-27.4 {FlushChannel, implicit flush when buffer fills} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf fconfigure $f -buffersize 60 set l "" lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { puts $f hello } lappend l [file size $path(test1)] flush $f lappend l [file size $path(test1)] close $f set l } {0 60 72} test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \ {unixOrWin} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffersize 60 set l "" lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { puts $f hello } lappend l [file size $path(test1)] close $f lappend l [file size $path(test1)] set l } {0 60 72} set path(pipe) [makeFile {} pipe] set path(output) [makeFile {} output] test io-27.6 {FlushChannel, async flushing, async close} \ {stdio asyncPipeClose notWinCI} { # This test may fail on old Unix systems (seen on IRIX64 6.5) with # obsolete gettimeofday() calls. See Tcl Bugs 3530533, 1942197. file delete $path(pipe) file delete $path(output) set f [open $path(pipe) w] puts $f "set f \[[list open $path(output) w]]" puts $f { fconfigure $f -translation lf -buffering none while {![eof stdin]} { after 20 puts -nonewline $f [read stdin 1024] } close $f } close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] close $f set f [open "|[list [interpreter] $path(pipe)]" w] fconfigure $f -blocking off puts -nonewline $f $x close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } } ok # Tests closing a channel. The functions tested are CloseChannel and Tcl_Close. test io-28.1 {CloseChannel called when all references are dropped} {testchannel} { file delete $path(test1) set f [open $path(test1) w] interp create x interp share "" $f x set l "" lappend l [testchannel refcount $f] x eval close $f interp delete x lappend l [testchannel refcount $f] close $f set l } {2 1} test io-28.2 {CloseChannel called when all references are dropped} { file delete $path(test1) set f [open $path(test1) w] interp create x interp share "" $f x puts -nonewline $f abc close $f x eval puts $f def x eval close $f interp delete x set f [open $path(test1) r] set l [gets $f] close $f set l } abcdef test io-28.3 {CloseChannel, not called before output queue is empty} \ {stdio asyncPipeClose nonPortable} { file delete $path(pipe) file delete $path(output) set f [open $path(pipe) w] puts $f { set f [open $path(output) w] fconfigure $f -translation lf -buffering none for {set x 0} {$x < 20} {incr x} { after 20 puts -nonewline $f [read stdin 1024] } close $f } close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] close $f set f [open "|[list [interpreter] pipe]" r+] fconfigure $f -blocking off puts -nonewline $f $x close $f set counter 0 while {([file size $path(output)] < 20480) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result probably_broken } else { set result ok } } ok test io-28.4 Tcl_Close testchannel { file delete $path(test1) set l {} lappend l [lsort [testchannel open]] set f [open $path(test1) w] lappend l [lsort [testchannel open]] close $f lappend l [lsort [testchannel open]] set x [list $consoleFileNames \ [lsort [list {*}$consoleFileNames $f]] \ $consoleFileNames] string compare $l $x } 0 test io-28.5 {Tcl_Close vs standard handles} {stdio unix testchannel} { file delete $path(script) set f [open $path(script) w] puts $f { close stdin puts [testchannel open] } close $f set f [open "|[list [interpreter] $path(script)]" r] set l [gets $f] close $f lsort $l } {file1 file2} test io-28.6 { close channel in write event handler Should not produce a segmentation fault in a Tcl built with --enable-symbols and -DPURIFY } -body { variable done variable res # Not a complete / correct channel implementation. Just enough # to exercise the crash - closing from a write handler after 0 [list coroutine c1 apply [list {} { variable done set chan [chan create w {apply {{cmd chan args} { switch $cmd { blocking - finalize { } watch { lappend ::timers286 [after 0 chan postevent $chan write] } initialize { list initialize finalize watch read write configure blocking } default { error [list {unexpected command} $cmd] } } }}}] chan configure $chan -blocking 0 while 1 { chan event $chan writable [list [info coroutine]] yield close $chan set done 1 return } } [namespace current]]] vwait [namespace current]::done return success } -cleanup { foreach timer $::timers286 {after cancel $timer} } -result success test io-28.7 { close channel in read event handler Should not produce a segmentation fault in a Tcl built with --enable-symbols and -DPURIFY } -body { variable done variable res after 0 [list coroutine c1 apply [list {} { variable done # Not a complete / correct channel implementation. Just enough # to exercise the crash - closing from a read handler set chan [chan create r {apply {{cmd chan args} { switch $cmd { blocking - finalize { } watch { lappend ::timers287 [after 0 chan postevent $chan read] } initialize { list initialize finalize watch read write configure blocking } default { error [list {unexpected command} $cmd] } } }}}] chan configure $chan -blocking 0 while 1 { chan event $chan readable [list [info coroutine]] yield close $chan set done 1 return } } [namespace current]]] vwait [namespace current]::done return success } -cleanup { foreach timer $::timers287 {after cancel $timer} } -result success test io-29.1 {Tcl_WriteChars, channel not writable} { list [catch {puts stdin hello} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} test io-29.2 {Tcl_WriteChars, empty string} { file delete $path(test1) set f [open $path(test1) w] puts -nonewline $f "" close $f file size $path(test1) } 0 test io-29.3 {Tcl_WriteChars, nonempty string} { file delete $path(test1) set f [open $path(test1) w] puts -nonewline $f hello close $f file size $path(test1) } 5 test io-29.4 {Tcl_WriteChars, buffering in full buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering full puts $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] close $f set l } {6 0 0 6} test io-29.5 {Tcl_WriteChars, buffering in line buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering line puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] close $f set l } {5 0 0 11} test io-29.6 {Tcl_WriteChars, buffering in no buffering mode} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering none puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] close $f set l } {0 5 0 11} test io-29.7 {Tcl_Flush, full buffering} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering full puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] close $f set l } {5 0 11 0 0 11} test io-29.8 {Tcl_Flush, full buffering} {testchannel} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffering line puts -nonewline $f hello set l "" lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] close $f set l } {5 0 0 5 0 11 0 11} test io-29.9 {Tcl_Flush, channel not writable} { list [catch {flush stdin} msg] $msg } {1 {channel "stdin" wasn't opened for writing}} test io-29.10 {Tcl_WriteChars, looping and buffering} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { puts $f1 [gets $f2] } close $f2 close $f1 file size $path(test1) } 387 test io-29.11 {Tcl_WriteChars, no newline, implicit flush} { file delete $path(test1) set f1 [open $path(test1) w] set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { puts -nonewline $f1 [gets $f2] } close $f1 close $f2 file size $path(test1) } 377 test io-29.12 {Tcl_WriteChars on a pipe} stdio { file delete $path(test1) file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 "set f1 \[[list open $path(longfile) r]]" puts $f1 { for {set x 0} {$x < 10} {incr x} { puts [gets $f1] } } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r] set f2 [open $path(longfile) r] set y ok for {set x 0} {$x < 10} {incr x} { set l1 [gets $f1] set l2 [gets $f2] if {"$l1" != "$l2"} { set y broken } } close $f1 close $f2 set y } ok test io-29.13 {Tcl_WriteChars to a pipe, line buffered} stdio { file delete $path(test1) file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts [gets stdin] puts [gets stdin] } close $f1 set y ok set f1 [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f1 -buffering line set f2 [open $path(longfile) r] set line [gets $f2] puts $f1 $line set backline [gets $f1] if {"$line" != "$backline"} { set y broken } set line [gets $f2] puts $f1 $line set backline [gets $f1] if {"$line" != "$backline"} { set y broken } close $f1 close $f2 set y } ok test io-29.14 {Tcl_WriteChars, buffering and implicit flush at close} { file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "Text1" puts -nonewline $f " Text 2" puts $f " Text 3" close $f set f [open $path(test3) r] set x [gets $f] close $f set x } {Text1 Text 2 Text 3} test io-29.15 {Tcl_Flush, channel not open for writing} { file delete $path(test1) set fd [open $path(test1) w] close $fd set fd [open $path(test1) r] set x [list [catch {flush $fd} msg] $msg] close $fd string compare $x \ [list 1 "channel \"$fd\" wasn't opened for writing"] } 0 test io-29.16 {Tcl_Flush on pipe opened only for reading} stdio { set fd [open "|[list [interpreter] cat longfile]" r] set x [list [catch {flush $fd} msg] $msg] catch {close $fd} string compare $x \ [list 1 "channel \"$fd\" wasn't opened for writing"] } 0 test io-29.17 {Tcl_WriteChars buffers, then Tcl_Flush flushes} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 hello puts $f1 hello puts $f1 hello flush $f1 set x [file size $path(test1)] close $f1 set x } 18 test io-29.18 {Tcl_WriteChars and Tcl_Flush intermixed} { file delete $path(test1) set x "" set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 hello puts $f1 hello puts $f1 hello flush $f1 lappend x [file size $path(test1)] puts $f1 hello flush $f1 lappend x [file size $path(test1)] puts $f1 hello flush $f1 lappend x [file size $path(test1)] close $f1 set x } {18 24 30} test io-29.19 {Explicit and implicit flushes} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf set x "" puts $f1 hello puts $f1 hello puts $f1 hello flush $f1 lappend x [file size $path(test1)] puts $f1 hello flush $f1 lappend x [file size $path(test1)] puts $f1 hello close $f1 lappend x [file size $path(test1)] set x } {18 24 30} test io-29.20 {Implicit flush when buffer is full} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf set line "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" for {set x 0} {$x < 100} {incr x} { puts $f1 $line } set z "" lappend z [file size $path(test1)] for {set x 0} {$x < 100} {incr x} { puts $f1 $line } lappend z [file size $path(test1)] close $f1 lappend z [file size $path(test1)] set z } {4096 12288 12600} test io-29.21 {Tcl_Flush to pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {set x [read stdin 6]} puts $f1 {set cnt [string length $x]} puts $f1 {puts "read $cnt characters"} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x [gets $f1] catch {close $f1} set x } "read 6 characters" test io-29.22 {Tcl_Flush called at other end of pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { fconfigure stdout -buffering full puts hello puts hello flush stdout gets stdin puts bye flush stdout } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] set x "" lappend x [gets $f1] lappend x [gets $f1] puts $f1 hello flush $f1 lappend x [gets $f1] close $f1 set x } {hello hello bye} test io-29.23 {Tcl_Flush and line buffering at end of pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts hello puts hello gets stdin puts bye } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] set x "" lappend x [gets $f1] lappend x [gets $f1] puts $f1 hello flush $f1 lappend x [gets $f1] close $f1 set x } {hello hello bye} test io-29.24 {Tcl_WriteChars and Tcl_Flush move end of file} { set f [open $path(test3) w] puts $f "Line 1" puts $f "Line 2" set f2 [open $path(test3)] set x {} lappend x [read -nonewline $f2] close $f2 flush $f set f2 [open $path(test3)] lappend x [read -nonewline $f2] close $f2 close $f set x } "{} {Line 1\nLine 2}" test io-29.25 {Implicit flush with Tcl_Flush to command pipelines} {stdio fileevent} { file delete $path(test3) set f [open "|[list [interpreter] $path(cat) | [interpreter] $path(cat) > $path(test3)]" w] puts $f "Line 1" puts $f "Line 2" close $f after 100 set f [open $path(test3) r] set x [read $f] close $f set x } "Line 1\nLine 2\n" test io-29.26 {Tcl_Flush, Tcl_Write on bidirectional pipelines} {stdio unixExecs} { set f [open "|[list cat -u]" r+] puts $f "Line1" flush $f set x [gets $f] close $f set x } {Line1} test io-29.27 {Tcl_Flush on closed pipeline} stdio { file delete $path(pipe) set f [open $path(pipe) w] puts $f {exit} close $f set f [open "|[list [interpreter] $path(pipe)]" r+] gets $f puts $f output after 50 # # The flush below will get a SIGPIPE. This is an expected part of # test and indicates that the test operates correctly. If you run # this test under a debugger, the signal will by intercepted unless # you disable the debugger's signal interception. # if {[catch {flush $f} msg]} { set x [list 1 $msg $::errorCode] catch {close $f} } else { if {[catch {close $f} msg]} { set x [list 1 $msg $::errorCode] } else { set x {this was supposed to fail and did not} } } regsub {".*":} $x {"":} x string tolower $x } {1 {error flushing "": broken pipe} {posix epipe {broken pipe}}} test io-29.28 {Tcl_WriteChars, lf mode} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere flush $f set s [file size $path(test1)] close $f set s } 21 test io-29.29 {Tcl_WriteChars, cr mode} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f file size $path(test1) } 21 test io-29.30 {Tcl_WriteChars, crlf mode} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f file size $path(test1) } 25 test io-29.31 {Tcl_WriteChars, background flush} stdio { # This test may fail on old Unix systems (seen on IRIX64 6.5) with # obsolete gettimeofday() calls. See Tcl Bugs 3530533, 1942197. file delete $path(pipe) file delete $path(output) set f [open $path(pipe) w] puts $f "set f \[[list open $path(output) w]]" puts $f {fconfigure $f -translation lf} set x [list while {![eof stdin]}] set x "$x {" puts $f $x puts $f { puts -nonewline $f [read stdin 4096]} puts $f { flush $f} puts $f "}" puts $f {close $f} close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] close $f set f [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f -blocking off puts -nonewline $f $x close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 10 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } # allow a little time for the background process to close. # otherwise, the following test fails on the [file delete $path(output)] # on Windows because a process still has the file open. after 100 set v 1; vwait v set result } ok test io-29.32 {Tcl_WriteChars, background flush to slow reader} \ {stdio asyncPipeClose notWinCI} { # This test may fail on old Unix systems (seen on IRIX64 6.5) with # obsolete gettimeofday() calls. See Tcl Bugs 3530533, 1942197. file delete $path(pipe) file delete $path(output) set f [open $path(pipe) w] puts $f "set f \[[list open $path(output) w]]" puts $f {fconfigure $f -translation lf} set x [list while {![eof stdin]}] set x "$x \{" puts $f $x puts $f { after 20} puts $f { puts -nonewline $f [read stdin 1024]} puts $f { flush $f} puts $f "\}" puts $f {close $f} close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] close $f set f [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f -blocking off puts -nonewline $f $x close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } } ok test io-29.33 {Tcl_Flush, implicit flush on exit} {exec} { set f [open $path(script) w] puts $f "set f \[[list open $path(test1) w]]" puts $f {fconfigure $f -translation lf puts $f hello puts $f bye puts $f strange } close $f exec [interpreter] $path(script) set f [open $path(test1) r] set r [read $f] close $f set r } "hello\nbye\nstrange\n" set path(script2) [makeFile {} script2] test io-29.33b {TIP#398, no implicit flush of nonblocking on exit} {exec} { set f [open $path(script) w] puts $f { fconfigure stdout -blocking 0 puts -nonewline stdout [string repeat A 655360] flush stdout } close $f set f [open $path(script2) w] puts $f {after 2000} close $f set t1 [clock milliseconds] set ff [open "|[list [interpreter] $path(script2)]" w] catch {unset ::env(TCL_FLUSH_NONBLOCKING_ON_EXIT)} exec [interpreter] $path(script) >@ $ff set t2 [clock milliseconds] close $ff expr {($t2-$t1)/2000 ? $t2-$t1 : 0} } 0 test io-29.34 {Tcl_Close, async flush on close, using sockets} {socket tempNotMac fileevent} { variable c 0 variable x running set l abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz proc writelots {s l} { for {set i 0} {$i < 9000} {incr i} { puts $s $l } } proc accept {s a p} { variable x fileevent $s readable [namespace code [list readit $s]] fconfigure $s -blocking off set x accepted } proc readit {s} { variable c variable x set l [gets $s] if {[eof $s]} { close $s set x done } elseif {([string length $l] > 0) || ![fblocked $s]} { incr c } } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set cs [socket 127.0.0.1 [lindex [fconfigure $ss -sockname] 2]] vwait [namespace which -variable x] fconfigure $cs -blocking off writelots $cs $l close $cs close $ss vwait [namespace which -variable x] set c } 9000 test io-29.35 {Tcl_Close vs fileevent vs multiple interpreters} {socket tempNotMac fileevent} { # On Mac, this test screws up sockets such that subsequent tests using port 2828 # either cause errors or panic(). catch {interp delete x} catch {interp delete y} interp create x interp create y set s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] proc accept {s a p} { puts $s hello close $s } set c [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]] interp share {} $c x interp share {} $c y close $c x eval { proc readit {s} { gets $s if {[eof $s]} { close $s } } } y eval { proc readit {s} { gets $s if {[eof $s]} { close $s } } } x eval "fileevent $c readable \{readit $c\}" y eval "fileevent $c readable \{readit $c\}" y eval [list close $c] update close $s interp delete x interp delete y } "" test io-29.36.1 {gets on translation auto with "\r" in QA communication mode, possible regression, bug [b3977d199b]} -constraints { socket tempNotMac fileevent } -setup { set s [open "|[list [interpreter] << { proc accept {so args} { fconfigure $so -translation binary puts -nonewline $so "who are you?\r"; flush $so set a [gets $so] puts -nonewline $so "really $a?\r"; flush $so set a [gets $so] close $so set ::done $a } set s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] puts [lindex [fconfigure $s -sockname] 2] foreach c {1 2} { vwait ::done puts $::done } }]" r] set c {} set result {} } -body { set port [gets $s] foreach t {{cr lf} {auto lf}} { set c [socket 127.0.0.1 $port] fconfigure $c -buffering line -translation $t lappend result $t while {1} { set q [gets $c] switch -- $q { "who are you?" {puts $c "client"} "really client?" {puts $c "yes"; lappend result $q; break} default {puts $c "wrong"; lappend result "unexpected input \"$q\""; break} } } lappend result [gets $s] close $c; set c {} } set result } -cleanup { close $s if {$c ne {}} { close $c } unset -nocomplain s c port t q } -result [list {cr lf} "really client?" yes {auto lf} "really client?" yes] test io-29.36.2 {gets on translation auto with "\r\n" in different buffers, bug [b3977d199b]} -constraints { socket tempNotMac fileevent } -setup { set s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set c {} } -body { set ::cnt 0 proc accept {so args} { fconfigure $so -translation binary puts -nonewline $so "1 line\r" puts -nonewline $so "\n2 li" flush $so # now force separate packets puts -nonewline $so "ne\r" flush $so if {$::cnt & 1} { vwait ::cli; # simulate short delay (so client can process events, just wait for it) } else { # we don't have a delay, so client would get the lines as single chunk } # we'll try with "\r" and without "\r" (to cover both branches, where "\r" and "eof" causes exit from [gets] by 3rd line) puts -nonewline $so "\n3 line" if {!($::cnt % 3)} { puts -nonewline $so "\r" } flush $so close $so } while {$::cnt < 6} { incr ::cnt set c [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]] fconfigure $c -blocking 0 -buffering line -translation auto fileevent $c readable [list apply {c { if {[gets $c line] >= 0} { lappend ::cli <$line> } elseif {[eof $c]} { set ::done 1 } }} $c] vwait ::done close $c; set c {} } set ::cli } -cleanup { close $s if {$c ne {}} { close $c } unset -nocomplain ::done ::cli ::cnt s c } -result [lrepeat 6 {<1 line>} {<2 line>} {<3 line>}] # Test end of line translations. Procedures tested are Tcl_Write, Tcl_Read. test io-30.1 {Tcl_Write lf, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set x [read $f] close $f set x } "hello\nthere\nand\nhere\n" test io-30.2 {Tcl_Write lf, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set x [read $f] close $f set x } "hello\nthere\nand\nhere\n" test io-30.3 {Tcl_Write lf, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set x [read $f] close $f set x } "hello\nthere\nand\nhere\n" test io-30.4 {Tcl_Write cr, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set x [read $f] close $f set x } "hello\nthere\nand\nhere\n" test io-30.5 {Tcl_Write cr, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set x [read $f] close $f set x } "hello\rthere\rand\rhere\r" test io-30.6 {Tcl_Write cr, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set x [read $f] close $f set x } "hello\rthere\rand\rhere\r" test io-30.7 {Tcl_Write crlf, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set x [read $f] close $f set x } "hello\nthere\nand\nhere\n" test io-30.8 {Tcl_Write crlf, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set x [read $f] close $f set x } "hello\r\nthere\r\nand\r\nhere\r\n" test io-30.9 {Tcl_Write crlf, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set x [read $f] close $f set x } "hello\n\nthere\n\nand\n\nhere\n\n" test io-30.10 {Tcl_Write lf, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set c [read $f] set x [fconfigure $f -translation] close $f list $c $x } {{hello there and here } auto} test io-30.11 {Tcl_Write cr, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set c [read $f] set x [fconfigure $f -translation] close $f list $c $x } {{hello there and here } auto} test io-30.12 {Tcl_Write crlf, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set c [read $f] set x [fconfigure $f -translation] close $f list $c $x } {{hello there and here } auto} test io-30.13 {Tcl_Write crlf on block boundary, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { puts $f $line } close $f set f [open $path(test1) r] fconfigure $f -translation auto set c [read $f] close $f string length $c } [expr {700*15+1}] test io-30.14 {Tcl_Write crlf on block boundary, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { puts $f $line } close $f set f [open $path(test1) r] fconfigure $f -translation crlf set c [read $f] close $f string length $c } [expr {700*15+1}] test io-30.15 {Tcl_Write mixed, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\rhere close $f set f [open $path(test1) r] fconfigure $f -translation auto set c [read $f] close $f set c } {hello there and here } test io-30.16 {Tcl_Write ^Z at end, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\nand\rhere\n\x1A close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set c [read $f] close $f set c } {hello there and here } test io-30.17 {Tcl_Write, implicit ^Z at end, Tcl_Read auto} {win} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1A puts $f hello\nthere\nand\rhere close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set c [read $f] close $f set c } {hello there and here } test io-30.18 {Tcl_Write, ^Z in middle, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1 {} 1} test io-30.19 {Tcl_Write, ^Z no newline in middle, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1 {} 1} test io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation lf set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } "abc def 0 \x1Aghi 0 qrs 0 {} 1" test io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation cr set l "" set x [gets $f] lappend l [string compare $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {0 1 {} 1} test io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation crlf set l "" set x [gets $f] lappend l [string compare $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {0 1 {} 1} test io-30.23 {Tcl_Write lf, ^Z in middle, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} test io-30.24 {Tcl_Write lf, ^Z in middle, Tcl_Read lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} test io-30.25 {Tcl_Write cr, ^Z in middle, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} test io-30.26 {Tcl_Write cr, ^Z in middle, Tcl_Read cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} test io-30.27 {Tcl_Write crlf, ^Z in middle, Tcl_Read auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} test io-30.28 {Tcl_Write crlf, ^Z in middle, Tcl_Read crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] puts $f $c close $f set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set c [string length [read $f]] set e [eof $f] close $f list $c $e } {8 1} # Test end of line translations. Functions tested are Tcl_Write and Tcl_Gets. test io-31.1 {Tcl_Write lf, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] close $f set l } {hello 6 auto there 12 auto} test io-31.2 {Tcl_Write cr, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] close $f set l } {hello 6 auto there 12 auto} test io-31.3 {Tcl_Write crlf, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] close $f set l } {hello 7 auto there 14 auto} test io-31.4 {Tcl_Write lf, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] close $f set l } {hello 6 lf there 12 lf} test io-31.5 {Tcl_Write lf, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set l "" lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {21 21 cr 1 {} 21 cr 1} test io-31.6 {Tcl_Write lf, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set l "" lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {21 21 crlf 1 {} 21 crlf 1} test io-31.7 {Tcl_Write cr, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {hello 6 cr 0 there 12 cr 0} test io-31.8 {Tcl_Write cr, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set l "" lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {21 21 lf 1 {} 21 lf 1} test io-31.9 {Tcl_Write cr, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set l "" lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {21 21 crlf 1 {} 21 crlf 1} test io-31.10 {Tcl_Write crlf, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation crlf set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {hello 7 crlf 0 there 14 crlf 0} test io-31.11 {Tcl_Write crlf, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation cr set l "" lappend l [gets $f] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {hello 6 cr 0 6 13 cr 0} test io-31.12 {Tcl_Write crlf, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf puts $f hello\nthere\nand\nhere close $f set f [open $path(test1) r] fconfigure $f -translation lf set l "" lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] lappend l [string length [gets $f]] lappend l [tell $f] lappend l [fconfigure $f -translation] lappend l [eof $f] close $f set l } {6 7 lf 0 6 14 lf 0} test io-31.13 {binary mode is synonym of lf mode} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation binary set x [fconfigure $f -translation] close $f set x } lf # # Test io-9.14 has been removed because "auto" output translation mode is # not supported. # test io-31.14 {Tcl_Write mixed, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts $f hello\nthere\rand\r\nhere close $f set f [open $path(test1) r] fconfigure $f -translation auto set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.15 {Tcl_Write mixed, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\r close $f set f [open $path(test1) r] fconfigure $f -translation auto set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.16 {Tcl_Write mixed, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\n close $f set f [open $path(test1) r] set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.17 {Tcl_Write mixed, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f hello\nthere\rand\r\nhere\r\n close $f set f [open $path(test1) r] fconfigure $f -translation auto set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.18 {Tcl_Write ^Z at end, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "hello\nthere\nand\rhere\n\%c" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.19 {Tcl_Write, implicit ^Z at end, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1A puts $f hello\nthere\nand\rhere close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {hello there and here 0 {} 1} test io-31.20 {Tcl_Write, ^Z in middle, Tcl_Gets auto, eofChar} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.21 {Tcl_Write, no newline ^Z in middle, Tcl_Gets auto, eofChar} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation lf set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation cr set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation crlf set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test io-31.25 {Tcl_Write lf, ^Z in middle, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.26 {Tcl_Write lf, ^Z in middle, Tcl_Gets lf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set s [format "abc\ndef\n%cqrs\ntuv" 26] puts $f $s close $f set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l "" lappend l [gets $f] lappend l [gets $f] lappend l [eof $f] lappend l [gets $f] lappend l [eof $f] close $f set l } {abc def 0 {} 1} test io-31.31 {Tcl_Write crlf on block boundary, Tcl_Gets crlf} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { puts $f $line } close $f set f [open $path(test1) r] fconfigure $f -translation crlf set c "" while {[gets $f line] >= 0} { append c $line\n } close $f string length $c } [expr {700*15+1}] test io-31.32 {Tcl_Write crlf on block boundary, Tcl_Gets auto} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { puts $f $line } close $f set f [open $path(test1) r] fconfigure $f -translation auto set c "" while {[gets $f line] >= 0} { append c $line\n } close $f string length $c } [expr {700*15+1}] # Test Tcl_Read and buffering. test io-32.1 {Tcl_Read, channel not readable} { list [catch {read stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test io-32.2 {Tcl_Read, zero byte count} { read stdin 0 } "" test io-32.3 {Tcl_Read, negative byte count} { set f [open $path(longfile) r] set l [list [catch {read $f -1} msg] $msg] close $f set l } {1 {expected non-negative integer but got "-1"}} test io-32.4 {Tcl_Read, positive byte count} { set f [open $path(longfile) r] set x [read $f 1024] set s [string length $x] unset x close $f set s } 1024 test io-32.5 {Tcl_Read, multiple buffers} { set f [open $path(longfile) r] fconfigure $f -buffersize 100 set x [read $f 1024] set s [string length $x] unset x close $f set s } 1024 test io-32.6 {Tcl_Read, very large read} { set f1 [open $path(longfile) r] set z [read $f1 1000000] close $f1 set l [string length $z] set x ok set z [file size $path(longfile)] if {$z != $l} { set x broken } set x } ok test io-32.7 {Tcl_Read, nonblocking, file} {nonBlockFiles} { set f1 [open $path(longfile) r] fconfigure $f1 -blocking off set z [read $f1 20] close $f1 set l [string length $z] set x ok if {$l != 20} { set x broken } set x } ok test io-32.8 {Tcl_Read, nonblocking, file} {nonBlockFiles} { set f1 [open $path(longfile) r] fconfigure $f1 -blocking off set z [read $f1 1000000] close $f1 set x ok set l [string length $z] set z [file size $path(longfile)] if {$z != $l} { set x broken } set x } ok test io-32.9 {Tcl_Read, read to end of file} { set f1 [open $path(longfile) r] set z [read $f1] close $f1 set l [string length $z] set x ok set z [file size $path(longfile)] if {$z != $l} { set x broken } set x } ok test io-32.10 {Tcl_Read from a pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x [read $f1] close $f1 set x } "hello\n" test io-32.11 {Tcl_Read from a pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} puts $f1 {puts [gets stdin]} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x "" lappend x [read $f1 6] puts $f1 hello flush $f1 lappend x [read $f1] close $f1 set x } {{hello } {hello }} test io-32.11.1 {Tcl_Read from a pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {chan configure stdout -translation crlf} puts $f1 {puts [gets stdin]} puts $f1 {puts [gets stdin]} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x "" lappend x [read $f1 6] puts $f1 hello flush $f1 lappend x [read $f1] close $f1 set x } {{hello } {hello }} test io-32.11.2 {Tcl_Read from a pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {chan configure stdout -translation crlf} puts $f1 {puts [gets stdin]} puts $f1 {puts [gets stdin]} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x "" lappend x [read $f1 6] puts $f1 hello flush $f1 lappend x [read $f1] close $f1 set x } {{hello } {hello }} test io-32.12 {Tcl_Read, -nonewline} { file delete $path(test1) set f1 [open $path(test1) w] puts $f1 hello puts $f1 bye close $f1 set f1 [open $path(test1) r] set c [read -nonewline $f1] close $f1 set c } {hello bye} test io-32.13 {Tcl_Read, -nonewline} { file delete $path(test1) set f1 [open $path(test1) w] puts $f1 hello puts $f1 bye close $f1 set f1 [open $path(test1) r] set c [read -nonewline $f1] close $f1 list [string length $c] $c } {9 {hello bye}} test io-32.14 {Tcl_Read, reading in small chunks} { file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" close $f set f [open $path(test1)] set x [list [read $f 1] [read $f 2] [read $f]] close $f set x } {T wo { lines: this one and this one }} test io-32.15 {Tcl_Read, asking for more input than available} { file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" close $f set f [open $path(test1)] set x [read $f 100] close $f set x } {Two lines: this one and this one } test io-32.16 {Tcl_Read, read to end of file with -nonewline} { file delete $path(test1) set f [open $path(test1) w] puts $f "Two lines: this one" puts $f "and this one" close $f set f [open $path(test1)] set x [read -nonewline $f] close $f set x } {Two lines: this one and this one} # Test Tcl_Gets. test io-33.1 {Tcl_Gets, reading what was written} { file delete $path(test1) set f1 [open $path(test1) w] set y "first line" puts $f1 $y close $f1 set f1 [open $path(test1) r] set x [gets $f1] set z ok if {"$x" != "$y"} { set z broken } close $f1 set z } ok test io-33.2 {Tcl_Gets into variable} { set f1 [open $path(longfile) r] set c [gets $f1 x] set l [string length x] set z ok if {$l != $l} { set z broken } close $f1 set z } ok test io-33.3 {Tcl_Gets from pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {puts [gets stdin]} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello flush $f1 set x [gets $f1] close $f1 set z ok if {"$x" != "hello"} { set z broken } set z } ok test io-33.4 {Tcl_Gets with long line} { file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" close $f set f [open $path(test3)] set x [gets $f] close $f set x } {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} set f [open $path(test3) w] puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" close $f test io-33.5 {Tcl_Gets with long line} { set f [open $path(test3)] set x [gets $f y] close $f list $x $y } {260 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} test io-33.6 {Tcl_Gets and end of file} { file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "Test1\nTest2" close $f set f [open $path(test3)] set x {} set y {} lappend x [gets $f y] $y set y {} lappend x [gets $f y] $y set y {} lappend x [gets $f y] $y close $f set x } {5 Test1 5 Test2 -1 {}} test io-33.7 {Tcl_Gets and bad variable} { set f [open $path(test3) w] puts $f "Line 1" puts $f "Line 2" close $f catch {unset x} set x 24 set f [open $path(test3) r] set result [list [catch {gets $f x(0)} msg] $msg] close $f set result } {1 {can't set "x(0)": variable isn't array}} test io-33.8 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 100} {incr y} {puts $f $x} close $f set f [open $path(test3) r] fconfigure $f -translation lf for {set y 0} {$y < 100} {incr y} {gets $f} close $f set y } 100 test io-33.9 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 200} {incr y} {puts $f $x} close $f set f [open $path(test3) r] fconfigure $f -translation lf for {set y 0} {$y < 200} {incr y} {gets $f} close $f set y } 200 test io-33.10 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] fconfigure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 300} {incr y} {puts $f $x} close $f set f [open $path(test3) r] fconfigure $f -translation lf for {set y 0} {$y < 300} {incr y} {gets $f} close $f set y } 300 test io-33.11 {TclGetsObjBinary, [10dc6daa37]} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) ....... return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] if {$n > 3} {set n 3} set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } } -body { set c [chan create read [namespace which driver]] chan configure $c -translation binary -blocking 0 list [gets $c] [gets $c] [gets $c] [gets $c] } -cleanup { close $c rename driver {} } -result {{} {} {} .......} test io-33.12 {Tcl_GetsObj, [10dc6daa37]} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) ....... return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] if {$n > 3} {set n 3} set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } } -body { set c [chan create read [namespace which driver]] chan configure $c -blocking 0 list [gets $c] [gets $c] [gets $c] [gets $c] } -cleanup { close $c rename driver {} } -result {{} {} {} .......} test io-33.13 {Tcl_GetsObj, [10dc6daa37]} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [string repeat \ [string repeat . 64]\n[string repeat . 25] 2] return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] if {$n > 65} {set n 65} set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } } -body { set c [chan create read [namespace which driver]] chan configure $c -blocking 0 list [gets $c] [gets $c] [gets $c] [gets $c] [gets $c] } -cleanup { close $c rename driver {} } -result [list [string repeat . 64] {} [string repeat . 89] \ [string repeat . 25] {}] # Test Tcl_Seek and Tcl_Tell. test io-34.1 {Tcl_Seek to current position at start of file} { set f1 [open $path(longfile) r] seek $f1 0 current set c [tell $f1] close $f1 set c } 0 test io-34.2 {Tcl_Seek to offset from start} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 10 start set c [tell $f1] close $f1 set c } 10 test io-34.3 {Tcl_Seek to end of file} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 0 end set c [tell $f1] close $f1 set c } 54 test io-34.4 {Tcl_Seek to offset from end of file} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 -10 end set c [tell $f1] close $f1 set c } 44 test io-34.5 {Tcl_Seek to offset from current position} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 10 current seek $f1 10 current set c [tell $f1] close $f1 set c } 20 test io-34.6 {Tcl_Seek to offset from end of file} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 -10 end set c [tell $f1] set r [read $f1] close $f1 list $c $r } {44 {rstuvwxyz }} test io-34.7 {Tcl_Seek to offset from end of file, then to current position} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 -10 end set c1 [tell $f1] set r1 [read $f1 5] seek $f1 0 current set c2 [tell $f1] close $f1 list $c1 $r1 $c2 } {44 rstuv 49} test io-34.8 {Tcl_Seek on pipes: not supported} stdio { set f1 [open "|[list [interpreter]]" r+] set x [list [catch {seek $f1 0 current} msg] $msg] close $f1 regsub {".*":} $x {"":} x string tolower $x } {1 {error during seek on "": invalid argument}} test io-34.9 {Tcl_Seek, testing buffered input flushing} { file delete $path(test3) set f [open $path(test3) w] puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" close $f set f [open $path(test3) RDWR] set x [read $f 1] seek $f 3 lappend x [read $f 1] seek $f 0 start lappend x [read $f 1] seek $f 10 current lappend x [read $f 1] seek $f -2 end lappend x [read $f 1] seek $f 50 end lappend x [read $f 1] seek $f 1 lappend x [read $f 1] close $f set x } {a d a l Y {} b} set path(test3) [makeFile {} test3] test io-34.10 {Tcl_Seek testing flushing of buffered input} { set f [open $path(test3) w] fconfigure $f -translation lf puts $f xyz\n123 close $f set f [open $path(test3) r+] fconfigure $f -translation lf set x [gets $f] seek $f 0 current puts $f 456 close $f list $x [viewFile test3] } "xyz {xyz 456}" test io-34.11 {Tcl_Seek testing flushing of buffered output} { set f [open $path(test3) w] puts $f xyz\n123 close $f set f [open $path(test3) w+] puts $f xyzzy seek $f 2 set x [gets $f] close $f list $x [viewFile test3] } "zzy xyzzy" test io-34.12 {Tcl_Seek testing combination of write, seek back and read} { set f [open $path(test3) w] fconfigure $f -translation lf puts $f xyz\n123 close $f set f [open $path(test3) a+] fconfigure $f -translation lf puts $f xyzzy flush $f set x [tell $f] seek $f -4 cur set y [gets $f] close $f list $x [viewFile test3] $y } {14 {xyz 123 xyzzy} zzy} test io-34.13 {Tcl_Tell at start of file} { file delete $path(test1) set f1 [open $path(test1) w] set p [tell $f1] close $f1 set p } 0 test io-34.14 {Tcl_Tell after seek to end of file} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 0 end set c1 [tell $f1] close $f1 set c1 } 54 test io-34.15 {Tcl_Tell combined with seeking} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 "abcdefghijklmnopqrstuvwxyz" puts $f1 "abcdefghijklmnopqrstuvwxyz" close $f1 set f1 [open $path(test1) r] seek $f1 10 start set c1 [tell $f1] seek $f1 10 current set c2 [tell $f1] close $f1 list $c1 $c2 } {10 20} test io-34.16 {Tcl_Tell on pipe: always -1} stdio { set f1 [open "|[list [interpreter]]" r+] set c [tell $f1] close $f1 set c } -1 test io-34.17 {Tcl_Tell on pipe: always -1} stdio { set f1 [open "|[list [interpreter]]" r+] puts $f1 {puts hello} flush $f1 set c [tell $f1] gets $f1 close $f1 set c } -1 test io-34.18 {Tcl_Tell combined with seeking and reading} { file delete $path(test2) set f [open $path(test2) w] fconfigure $f -translation lf puts -nonewline $f "line1\nline2\nline3\nline4\nline5\n" close $f set f [open $path(test2)] fconfigure $f -translation lf set x [tell $f] read $f 3 lappend x [tell $f] seek $f 2 lappend x [tell $f] seek $f 10 current lappend x [tell $f] seek $f 0 end lappend x [tell $f] close $f set x } {0 3 2 12 30} test io-34.19 {Tcl_Tell combined with opening in append mode} { set f [open $path(test3) w] fconfigure $f -translation lf puts $f "abcdefghijklmnopqrstuvwxyz" puts $f "abcdefghijklmnopqrstuvwxyz" close $f set f [open $path(test3) a] set c [tell $f] close $f set c } 54 test io-34.20 {Tcl_Tell combined with writing} { set f [open $path(test3) w] set l "" seek $f 29 start lappend l [tell $f] puts -nonewline $f a seek $f 39 start lappend l [tell $f] puts -nonewline $f a lappend l [tell $f] seek $f 407 end lappend l [tell $f] close $f set l } {29 39 40 447} test io-34.21 {Tcl_Seek and Tcl_Tell on large files} {largefileSupport extensive} { file delete $path(test3) set f [open $path(test3) w] fconfigure $f -translation binary set l "" lappend l [tell $f] puts -nonewline $f abcdef lappend l [tell $f] flush $f lappend l [tell $f] # 4GB offset! seek $f 0x100000000 lappend l [tell $f] puts -nonewline $f abcdef lappend l [tell $f] close $f lappend l [file size $path(test3)] # truncate... close [open $path(test3) w] lappend l [file size $path(test3)] set l } {0 6 6 4294967296 4294967302 4294967302 0} # Test Tcl_Eof test io-35.1 {Tcl_Eof} { file delete $path(test1) set f [open $path(test1) w] puts $f hello puts $f hello close $f set f [open $path(test1)] set x [eof $f] lappend x [eof $f] gets $f lappend x [eof $f] gets $f lappend x [eof $f] gets $f lappend x [eof $f] lappend x [eof $f] close $f set x } {0 0 0 0 1 1} test io-35.2 {Tcl_Eof with pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {gets stdin} puts $f1 {puts hello} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello set x [eof $f1] flush $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] close $f1 set x } {0 0 0 1} test io-35.3 {Tcl_Eof with pipe} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 {gets stdin} puts $f1 {puts hello} close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] puts $f1 hello set x [eof $f1] flush $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] gets $f1 lappend x [eof $f1] close $f1 set x } {0 0 0 1 1 1} test io-35.4 {Tcl_Eof, eof detection on nonblocking file} {nonBlockFiles} { file delete $path(test1) set f [open $path(test1) w] close $f set f [open $path(test1) r] fconfigure $f -blocking off set l "" lappend l [gets $f] lappend l [eof $f] close $f set l } {{} 1} test io-35.5 {Tcl_Eof, eof detection on nonblocking pipe} stdio { file delete $path(pipe) set f [open $path(pipe) w] puts $f { exit } close $f set f [open "|[list [interpreter] $path(pipe)]" r] set l "" lappend l [gets $f] lappend l [eof $f] close $f set l } {{} 1} test io-35.6 {Tcl_Eof, eof char, lf write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {8 8 1} test io-35.7 {Tcl_Eof, eof char, lf write, lf read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {8 8 1} test io-35.8 {Tcl_Eof, eof char, cr write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {8 8 1} test io-35.9 {Tcl_Eof, eof char, cr write, cr read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {8 8 1} test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {10 8 1} test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $s $l $e } {10 8 1} test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {17 8 1} test io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {17 8 1} test io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {17 8 1} test io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {17 8 1} test io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {21 8 1} test io-35.17 {Tcl_Eof, eof char in middle, crlf write, crlf read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [read $f]] set e [eof $f] close $f list $c $l $e } {21 8 1} test io-35.18 {Tcl_Eof, eof char, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf set l [string length [set in [read $f]]] set e [eof $f] close $f list $s $l $e [scan [string index $in end] %c] } -result {8 8 1 13} test io-35.18a {Tcl_Eof, eof char, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1A puts $f abc\ndef close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [set in [read $f]]] set e [eof $f] close $f list $s $l $e [scan [string index $in end] %c] } -result {8 8 1 13} test io-35.18b {Tcl_Eof, eof char, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr -eofchar \x1A puts $f {} close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [set in [read $f]]] set e [eof $f] close $f list $s $l $e [scan [string index $in end] %c] } -result {1 1 1 13} test io-35.18c {Tcl_Eof, eof char, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr puts $f {} close $f set s [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf set l [string length [set in [read $f]]] set e [eof $f] close $f list $s $l $e [scan [string index $in end] %c] } -result {1 1 1 13} test io-35.19 {Tcl_Eof, eof char in middle, cr write, crlf read} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set i [format abc\ndef\n%cqrs\nuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [set in [read $f]]] set e [eof $f] close $f list $c $l $e [scan [string index $in end] %c] } -result {17 8 1 13} test io-35.20 {Tcl_Eof, eof char in middle, cr write, crlf read} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set i [format \n%cqrsuvw 26] puts $f $i close $f set c [file size $path(test1)] set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A set l [string length [set in [read $f]]] set e [eof $f] close $f list $c $l $e [scan [string index $in end] %c] } {9 1 1 13} # Test Tcl_InputBlocked test io-36.1 {Tcl_InputBlocked on nonblocking pipe} stdio { set f1 [open "|[list [interpreter]]" r+] puts $f1 {puts hello_from_pipe} flush $f1 gets $f1 fconfigure $f1 -blocking off -buffering full puts $f1 {puts hello} set x "" lappend x [gets $f1] lappend x [fblocked $f1] flush $f1 after 200 lappend x [gets $f1] lappend x [fblocked $f1] lappend x [gets $f1] lappend x [fblocked $f1] close $f1 set x } {{} 1 hello 0 {} 1} test io-36.1.1 {Tcl_InputBlocked on nonblocking binary pipe} stdio { set f1 [open "|[list [interpreter]]" r+] chan configure $f1 -translation binary puts $f1 { chan configure stdout -translation binary puts hello_from_pipe } flush $f1 gets $f1 fconfigure $f1 -blocking off -buffering full puts $f1 {puts hello} set x "" lappend x [gets $f1] lappend x [fblocked $f1] flush $f1 after 200 lappend x [gets $f1] lappend x [fblocked $f1] lappend x [gets $f1] lappend x [fblocked $f1] close $f1 set x } {{} 1 hello 0 {} 1} test io-36.2 {Tcl_InputBlocked on blocking pipe} stdio { set f1 [open "|[list [interpreter]]" r+] fconfigure $f1 -buffering line puts $f1 {puts hello_from_pipe} set x "" lappend x [gets $f1] lappend x [fblocked $f1] puts $f1 {exit} lappend x [gets $f1] lappend x [fblocked $f1] lappend x [eof $f1] close $f1 set x } {hello_from_pipe 0 {} 0 1} test io-36.3 {Tcl_InputBlocked vs files, short read} { file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f set f [open $path(test1) r] set l "" lappend l [fblocked $f] lappend l [read $f 3] lappend l [fblocked $f] lappend l [read -nonewline $f] lappend l [fblocked $f] lappend l [eof $f] close $f set l } {0 abc 0 defghijklmnop 0 1} test io-36.4 {Tcl_InputBlocked vs files, event driven read} {fileevent} { proc in {f} { variable l variable x lappend l [read $f 3] if {[eof $f]} {lappend l eof; close $f; set x done} } file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f set f [open $path(test1) r] set l "" fileevent $f readable [namespace code [list in $f]] variable x vwait [namespace which -variable x] set l } {abc def ghi jkl mno {p } eof} test io-36.5 {Tcl_InputBlocked vs files, short read, nonblocking} {nonBlockFiles} { file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f set f [open $path(test1) r] fconfigure $f -blocking off set l "" lappend l [fblocked $f] lappend l [read $f 3] lappend l [fblocked $f] lappend l [read -nonewline $f] lappend l [fblocked $f] lappend l [eof $f] close $f set l } {0 abc 0 defghijklmnop 0 1} test io-36.6 {Tcl_InputBlocked vs files, event driven read} {nonBlockFiles fileevent} { proc in {f} { variable l variable x lappend l [read $f 3] if {[eof $f]} {lappend l eof; close $f; set x done} } file delete $path(test1) set f [open $path(test1) w] puts $f abcdefghijklmnop close $f set f [open $path(test1) r] fconfigure $f -blocking off set l "" fileevent $f readable [namespace code [list in $f]] variable x vwait [namespace which -variable x] set l } {abc def ghi jkl mno {p } eof} # Test Tcl_InputBuffered test io-37.1 {Tcl_InputBuffered} {testchannel} { set f [open $path(longfile) r] fconfigure $f -buffersize 4096 read $f 3 set l "" lappend l [testchannel inputbuffered $f] lappend l [tell $f] close $f set l } {4093 3} test io-37.2 {Tcl_InputBuffered, test input flushing on seek} {testchannel} { set f [open $path(longfile) r] fconfigure $f -buffersize 4096 read $f 3 set l "" lappend l [testchannel inputbuffered $f] lappend l [tell $f] seek $f 0 current lappend l [testchannel inputbuffered $f] lappend l [tell $f] close $f set l } {4093 3 0 3} # Test Tcl_SetChannelBufferSize, Tcl_GetChannelBufferSize test io-38.1 {Tcl_GetChannelBufferSize, default buffer size} { set f [open $path(longfile) r] set s [fconfigure $f -buffersize] close $f set s } 4096 test io-38.2 {Tcl_SetChannelBufferSize, Tcl_GetChannelBufferSize} { set f [open $path(longfile) r] set l "" lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize 10000 lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize 1 lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize -1 lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize 0 lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize 100000 lappend l [fconfigure $f -buffersize] fconfigure $f -buffersize 10000000 lappend l [fconfigure $f -buffersize] close $f set l } {4096 10000 1 1 1 100000 1048576} test io-38.3 {Tcl_SetChannelBufferSize, changing buffersize between reads} { # This test crashes the interp if Bug #427196 is not fixed set chan [open [info script] r] fconfigure $chan -buffersize 10 -encoding utf-8 set var [read $chan 2] fconfigure $chan -buffersize 32 append var [read $chan] close $chan } {} # Test Tcl_SetChannelOption, Tcl_GetChannelOption test io-39.1 {Tcl_GetChannelOption} { file delete $path(test1) set f1 [open $path(test1) w] set x [fconfigure $f1 -blocking] close $f1 set x } 1 test io-39.2 {Tcl_GetChannelOption} { file delete $path(test1) set f1 [open $path(test1) w] set x [fconfigure $f1 -buffering] close $f1 set x } full test io-39.3 {Tcl_GetChannelOption} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -buffering line set x [fconfigure $f1 -buffering] close $f1 set x } line test io-39.4 {Tcl_GetChannelOption, Tcl_SetChannelOption} { file delete $path(test1) set f1 [open $path(test1) w] set l "" lappend l [fconfigure $f1 -buffering] fconfigure $f1 -buffering line lappend l [fconfigure $f1 -buffering] fconfigure $f1 -buffering none lappend l [fconfigure $f1 -buffering] fconfigure $f1 -buffering line lappend l [fconfigure $f1 -buffering] fconfigure $f1 -buffering full lappend l [fconfigure $f1 -buffering] close $f1 set l } {full line none line full} test io-39.5 {Tcl_GetChannelOption, invariance} { file delete $path(test1) set f1 [open $path(test1) w] set l "" lappend l [fconfigure $f1 -buffering] lappend l [list [catch {fconfigure $f1 -buffering green} msg] $msg] lappend l [fconfigure $f1 -buffering] close $f1 set l } {full {1 {bad value for -buffering: must be one of full, line, or none}} full} test io-39.6 {Tcl_SetChannelOption, multiple options} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf -buffering line puts $f1 hello puts $f1 bye set x [file size $path(test1)] close $f1 set x } 10 test io-39.7 {Tcl_SetChannelOption, buffering, translation} { file delete $path(test1) set f1 [open $path(test1) w] fconfigure $f1 -translation lf puts $f1 hello puts $f1 bye set x "" fconfigure $f1 -buffering line lappend x [file size $path(test1)] puts $f1 really_bye lappend x [file size $path(test1)] close $f1 set x } {0 21} test io-39.8 {Tcl_SetChannelOption, different buffering options} { file delete $path(test1) set f1 [open $path(test1) w] set l "" fconfigure $f1 -translation lf -buffering none puts -nonewline $f1 hello lappend l [file size $path(test1)] puts -nonewline $f1 hello lappend l [file size $path(test1)] fconfigure $f1 -buffering full puts -nonewline $f1 hello lappend l [file size $path(test1)] fconfigure $f1 -buffering none lappend l [file size $path(test1)] puts -nonewline $f1 hello lappend l [file size $path(test1)] close $f1 lappend l [file size $path(test1)] set l } {5 10 10 10 20 20} test io-39.9 {Tcl_SetChannelOption, blocking mode} {nonBlockFiles} { file delete $path(test1) set f1 [open $path(test1) w] close $f1 set f1 [open $path(test1) r] set x "" lappend x [fconfigure $f1 -blocking] fconfigure $f1 -blocking off lappend x [fconfigure $f1 -blocking] lappend x [gets $f1] lappend x [read $f1 1000] lappend x [fblocked $f1] lappend x [eof $f1] close $f1 set x } {1 0 {} {} 0 1} test io-39.10 {Tcl_SetChannelOption, blocking mode} stdio { file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { gets stdin after 100 puts hi gets stdin } close $f1 set x "" set f1 [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f1 -blocking off -buffering line lappend x [fconfigure $f1 -blocking] lappend x [gets $f1] lappend x [fblocked $f1] fconfigure $f1 -blocking on puts $f1 hello fconfigure $f1 -blocking off lappend x [gets $f1] lappend x [fblocked $f1] fconfigure $f1 -blocking on puts $f1 bye fconfigure $f1 -blocking off lappend x [gets $f1] lappend x [fblocked $f1] fconfigure $f1 -blocking on lappend x [fconfigure $f1 -blocking] lappend x [gets $f1] lappend x [fblocked $f1] lappend x [eof $f1] lappend x [gets $f1] lappend x [eof $f1] close $f1 set x } {0 {} 1 {} 1 {} 1 1 hi 0 0 {} 1} test io-39.11 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size clipped to lower bound} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize -10 set x [fconfigure $f -buffersize] close $f set x } 1 test io-39.12 {Tcl_SetChannelOption, Tcl_GetChannelOption buffer size clipped to upper bound} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize 10000000 set x [fconfigure $f -buffersize] close $f set x } 1048576 test io-39.13 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -buffersize 40000 set x [fconfigure $f -buffersize] close $f set x } 40000 test io-39.14 {Tcl_SetChannelOption: -encoding, binary & utf-8} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f \xE7\x89\xA6 close $f set f [open $path(test1) r] fconfigure $f -encoding utf-8 set x [read $f] close $f set x } 牦 test io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f \xE7\x89\xA6 close $f set f [open $path(test1) r] fconfigure $f -encoding utf-8 set x [read $f] close $f set x } 牦 test io-39.16 {Tcl_SetChannelOption: -encoding (shortened to "-en"), errors} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -en foobar } -cleanup { close $f } -returnCodes 1 -result {unknown encoding "foobar"} test io-39.16a {Tcl_SetChannelOption: -encoding (invalid shortening to "-e"), errors} -body { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -e foobar } -cleanup { close $f } -returnCodes 1 -match glob -result {bad option "-e": should be one of *} test io-39.17 {Tcl_SetChannelOption: -encoding, clearing CHANNEL_NEED_MORE_DATA} {stdio fileevent} { set f [open "|[list [interpreter] $path(cat)]" r+] fconfigure $f -encoding iso8859-1 puts -nonewline $f "\xE7" flush $f fconfigure $f -encoding utf-8 -blocking 0 variable x {} fileevent $f readable [namespace code { lappend x [read $f] }] vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] fconfigure $f -encoding utf-8 vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] fconfigure $f -translation binary vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] close $f set x } "{} timeout {} timeout \xE7 timeout" test io-39.18 {Tcl_SetChannelOption, setting read mode independently} \ {socket} { proc accept {s a p} {close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [fconfigure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto lf} set modes [fconfigure $s2 -translation] close $s1 close $s2 set modes } {auto lf} test io-39.19 {Tcl_SetChannelOption, setting read mode independently} \ {socket} { proc accept {s a p} {close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [fconfigure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto crlf} set modes [fconfigure $s2 -translation] close $s1 close $s2 set modes } {auto crlf} test io-39.20 {Tcl_SetChannelOption, setting read mode independently} \ {socket} { proc accept {s a p} {close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [fconfigure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto cr} set modes [fconfigure $s2 -translation] close $s1 close $s2 set modes } {auto cr} test io-39.21 {Tcl_SetChannelOption, setting read mode independently} \ {socket} { proc accept {s a p} {close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [fconfigure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto auto} set modes [fconfigure $s2 -translation] close $s1 close $s2 set modes } {auto crlf} test io-39.22 {Tcl_SetChannelOption, invariance} -constraints {unix deprecated} -body { file delete $path(test1) set f1 [open $path(test1) w+] set l "" lappend l [fconfigure $f1 -eofchar] fconfigure $f1 -eofchar {O {}} lappend l [fconfigure $f1 -eofchar] fconfigure $f1 -eofchar D lappend l [fconfigure $f1 -eofchar] close $f1 set l } -result {{} O D} test io-39.22a {Tcl_SetChannelOption, invariance} -constraints deprecated -body { file delete $path(test1) set f1 [open $path(test1) w+] set l [list] fconfigure $f1 -eofchar {O {}} lappend l [fconfigure $f1 -eofchar] fconfigure $f1 -eofchar D lappend l [fconfigure $f1 -eofchar] lappend l [list [catch {fconfigure $f1 -eofchar {1 2 3}} msg] $msg] close $f1 set l } -result {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}} test io-39.23 {Tcl_GetChannelOption, server socket is not readable or writable, it should still have valid -eofchar and -translation options } { set l [list] set sock [socket -server [namespace code accept] -myaddr 127.0.0.1 0] lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation] close $sock set l } {{} auto} test io-39.24 {Tcl_SetChannelOption, server socket is not readable or writable so we can't change -eofchar or -translation } { set l [list] set sock [socket -server [namespace code accept] -myaddr 127.0.0.1 0] fconfigure $sock -eofchar D -translation lf lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation] close $sock set l } {{} auto} test io-40.1 {POSIX open access modes: RDWR} { file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f set f [open $path(test3) RDWR] puts -nonewline $f "ab" seek $f 0 current set x [gets $f] close $f set f [open $path(test3) r] lappend x [gets $f] close $f set x } {zzy abzzy} test io-40.2 {POSIX open access modes: CREAT} {unix notWsl} { file delete $path(test3) set f [open $path(test3) {WRONLY CREAT} 0o600] file stat $path(test3) stats set x [format "%#o" [expr {$stats(mode)&0o777}]] puts $f "line 1" close $f set f [open $path(test3) r] lappend x [gets $f] close $f set x } {0o600 {line 1}} test io-40.3 {POSIX open access modes: CREAT} {unix umask notWsl} { # This test only works if your umask is 2, like ouster's. file delete $path(test3) set f [open $path(test3) {WRONLY CREAT}] close $f file stat $path(test3) stats format 0o%03o [expr {$stats(mode)&0o777}] } [format 0o%03o [expr {0o666 & ~ $umaskValue}]] test io-40.4 {POSIX open access modes: CREAT} { file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f set f [open $path(test3) {WRONLY CREAT}] puts -nonewline $f "ab" close $f set f [open $path(test3) r] set x [gets $f] close $f set x } abzzy test io-40.5 {POSIX open access modes: APPEND} { file delete $path(test3) set f [open $path(test3) w] fconfigure $f -translation lf puts $f xyzzy close $f set f [open $path(test3) {WRONLY APPEND}] fconfigure $f -translation lf puts $f "new line" seek $f 0 puts $f "abc" close $f set f [open $path(test3) r] fconfigure $f -translation lf set x "" seek $f 6 current lappend x [gets $f] lappend x [gets $f] close $f set x } {{new line} abc} test io-40.6 {POSIX open access modes: EXCL} -match regexp -body { file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f open $path(test3) {WRONLY CREAT EXCL} } -returnCodes error -result {(?i)couldn't open ".*test3": file (already )?exists} test io-40.7 {POSIX open access modes: EXCL} { file delete $path(test3) set f [open $path(test3) {WRONLY CREAT EXCL}] puts $f "A test line" close $f viewFile test3 } {A test line} test io-40.8 {POSIX open access modes: TRUNC} { file delete $path(test3) set f [open $path(test3) w] puts $f xyzzy close $f set f [open $path(test3) {WRONLY TRUNC}] puts $f abc close $f set f [open $path(test3) r] set x [gets $f] close $f set x } abc test io-40.9 {POSIX open access modes: NONBLOCK} {nonPortable unix} { file delete $path(test3) set f [open $path(test3) {WRONLY NONBLOCK CREAT}] puts $f "NONBLOCK test" close $f set f [open $path(test3) r] set x [gets $f] close $f set x } {NONBLOCK test} test io-40.10 {POSIX open access modes: RDONLY} { set f [open $path(test1) w] puts $f "two lines: this one" puts $f "and this" close $f set f [open $path(test1) RDONLY] set x [list [gets $f] [catch {puts $f Test} msg] $msg] close $f string compare [string tolower $x] \ [list {two lines: this one} 1 \ [format "channel \"%s\" wasn't opened for writing" $f]] } 0 test io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.13 {POSIX open access modes: WRONLY} { makeFile xyzzy test3 set f [open $path(test3) WRONLY] puts -nonewline $f "ab" seek $f 0 current set x [list [catch {gets $f} msg] $msg] close $f lappend x [viewFile test3] string compare [string tolower $x] \ [list 1 "channel \"$f\" wasn't opened for reading" abzzy] } 0 test io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] puts -nonewline $f "ab" seek $f 0 current set x [gets $f] close $f lappend x [viewFile test3] } {zzy abzzy} test io-40.16 {tilde substitution in open} -constraints makeFileInHome -setup { makeFile {Some text} _test_ ~ } -body { file exists [file join $::env(HOME) _test_] } -cleanup { removeFile _test_ ~ } -result 1 test io-40.17 {tilde substitution in open} { set home $::env(HOME) unset ::env(HOME) set x [list [catch {open ~/foo} msg] $msg] set ::env(HOME) $home set x } {1 {couldn't open "~/foo": no such file or directory}} test io-41.1 {Tcl_FileeventCmd: errors} {fileevent} { list [catch {fileevent foo} msg] $msg } {1 {wrong # args: should be "fileevent channel event ?script?"}} test io-41.2 {Tcl_FileeventCmd: errors} {fileevent} { list [catch {fileevent foo bar baz q} msg] $msg } {1 {wrong # args: should be "fileevent channel event ?script?"}} test io-41.3 {Tcl_FileeventCmd: errors} {fileevent} { list [catch {fileevent gorp readable} msg] $msg } {1 {can not find channel named "gorp"}} test io-41.4 {Tcl_FileeventCmd: errors} {fileevent} { list [catch {fileevent gorp writable} msg] $msg } {1 {can not find channel named "gorp"}} test io-41.5 {Tcl_FileeventCmd: errors} {fileevent} { list [catch {fileevent gorp who-knows} msg] $msg } {1 {bad event name "who-knows": must be readable or writable}} # # Test fileevent on a file # set path(foo) [makeFile {} foo] set f [open $path(foo) w+] test io-42.1 {Tcl_FileeventCmd: creating, deleting, querying} {fileevent} { list [fileevent $f readable] [fileevent $f writable] } {{} {}} test io-42.2 {Tcl_FileeventCmd: replacing} {fileevent} { set result {} fileevent $f r "first script" lappend result [fileevent $f readable] fileevent $f r "new script" lappend result [fileevent $f readable] fileevent $f r "yet another" lappend result [fileevent $f readable] fileevent $f r "" lappend result [fileevent $f readable] } {{first script} {new script} {yet another} {}} test io-42.3 {Tcl_FileeventCmd: replacing, with NULL chars in script} {fileevent} { set result {} fileevent $f r "first scr\x00ipt" lappend result [string length [fileevent $f readable]] fileevent $f r "new scr\x00ipt" lappend result [string length [fileevent $f readable]] fileevent $f r "yet ano\x00ther" lappend result [string length [fileevent $f readable]] fileevent $f r "" lappend result [fileevent $f readable] } {13 11 12 {}} test io-43.1 {Tcl_FileeventCmd: creating, deleting, querying} {stdio unixExecs fileevent} { set result {} fileevent $f readable "script 1" lappend result [fileevent $f readable] [fileevent $f writable] fileevent $f writable "write script" lappend result [fileevent $f readable] [fileevent $f writable] fileevent $f readable {} lappend result [fileevent $f readable] [fileevent $f writable] fileevent $f writable {} lappend result [fileevent $f readable] [fileevent $f writable] } {{script 1} {} {script 1} {write script} {} {write script} {} {}} test io-43.2 {Tcl_FileeventCmd: deleting when many present} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] } -constraints {stdio unixExecs fileevent} -body { set result {} lappend result [fileevent $f r] [fileevent $f2 r] [fileevent $f3 r] fileevent $f r "read f" fileevent $f2 r "read f2" fileevent $f3 r "read f3" lappend result [fileevent $f r] [fileevent $f2 r] [fileevent $f3 r] fileevent $f2 r {} lappend result [fileevent $f r] [fileevent $f2 r] [fileevent $f3 r] fileevent $f3 r {} lappend result [fileevent $f r] [fileevent $f2 r] [fileevent $f3 r] fileevent $f r {} lappend result [fileevent $f r] [fileevent $f2 r] [fileevent $f3 r] } -cleanup { catch {close $f2} catch {close $f3} } -result {{} {} {} {read f} {read f2} {read f3} {read f} {} {read f3} {read f} {} {} {} {} {}} test io-44.1 {FileEventProc procedure: normal read event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] } -constraints {stdio unixExecs fileevent} -body { fileevent $f2 readable [namespace code { set x [gets $f2]; fileevent $f2 readable {} }] puts $f2 text; flush $f2 variable x initial vwait [namespace which -variable x] set x } -cleanup { catch {close $f2} catch {close $f3} } -result {text} test io-44.2 {FileEventProc procedure: error in read event} -constraints { stdio unixExecs fileevent } -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { fileevent $f2 readable {error bogus} puts $f2 text; flush $f2 variable x initial vwait [namespace which -variable x] list $x [fileevent $f2 readable] } -cleanup { interp bgerror {} $handler catch {close $f2} catch {close $f3} } -result {bogus {}} test io-44.3 {FileEventProc procedure: normal write event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] } -constraints {stdio unixExecs fileevent} -body { fileevent $f2 writable [namespace code { lappend x "triggered" incr count -1 if {$count <= 0} { fileevent $f2 writable {} } }] variable x initial set count 3 vwait [namespace which -variable x] vwait [namespace which -variable x] vwait [namespace which -variable x] set x } -cleanup { catch {close $f2} catch {close $f3} } -result {initial triggered triggered triggered} test io-44.4 {FileEventProc procedure: eror in write event} -constraints { stdio unixExecs fileevent } -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { fileevent $f2 writable {error bad-write} variable x initial vwait [namespace which -variable x] list $x [fileevent $f2 writable] } -cleanup { interp bgerror {} $handler catch {close $f2} catch {close $f3} } -result {bad-write {}} test io-44.5 {FileEventProc procedure: end of file} -constraints { stdio unixExecs fileevent } -body { set f4 [open "|[list [interpreter] $path(cat) << foo]" r] fileevent $f4 readable [namespace code { if {[gets $f4 line] < 0} { lappend x eof fileevent $f4 readable {} } else { lappend x $line } }] variable x initial vwait [namespace which -variable x] vwait [namespace which -variable x] set x } -cleanup { close $f4 } -result {initial foo eof} close $f # Bug https://core.tcl-lang.org/tcl/info/de232b49f26da1c1 with a corrected # refchan implementation. refchans should be responsible for their own # event generation and the one in the bug report was not doing so. test io-44.6 {FileEventProc procedure: write-only non-blocking channel} -setup { } -constraints {stdio fileevent} -body { namespace eval refchan { namespace ensemble create namespace export * # Change to taste depending on how much CPU you want to hog variable delay 0 proc finalize {chan args} { namespace upvar c_$chan timer timer catch {after cancel $timer} namespace delete c_$chan } proc initialize {chan args} { namespace eval c_$chan {} namespace upvar c_$chan watching watching timer timer set watching {} list finalize initialize seek watch write } proc watch {chan args} { namespace upvar c_$chan watching watching foreach arg $args { switch $arg { write { if {$arg ni $watching} { lappend watching $arg } } } } update $chan } proc write {chan args} { return 1 } # paraphrased from tcllib proc update {chan} { namespace upvar c_$chan watching watching timer timer variable delay catch {after cancel $timer} if {"write" in $watching} { set timer [after idle after $delay \ [namespace code [list post $chan]]] } } # paraphrased from tcllib proc post {chan} { variable delay namespace upvar c_$chan watching watching timer timer if {"write" in $watching} { set timer [after idle after $delay \ [namespace code [list post $chan]]] chan postevent $chan write } } } set f [chan create w [namespace which refchan]] chan configure $f -blocking 0 set data "some data" set x 0 chan event $f writable [namespace code { puts $f $data incr count [string length $data] if {$count > 262144} { chan event $f writable {} set x done } }] # Note: timeout needs to be very long under valgrind set token [after 240000 [namespace code { set x timeout }]] vwait [namespace which -variable x] return $x } -cleanup { after cancel $token catch {chan close $f} } -result done # Bug https://core.tcl-lang.org/tcl/info/67a5eabbd3d1 with a corrected # refchan implementation. refchans that are not reentrant should use # event loop to post events and the script in the bug report was not # doing so. test io-44.7 {refchan + coroutine yield error } -setup { set bghandler [interp bgerror {}] namespace eval schan { namespace ensemble create namespace export * proc open {} { set chan [chan create read [namespace current]] } proc initialize {chan mode} { return [list initialize finalize read watch] } proc finalize args {} proc read {chan count} {} proc watch {chan eventspec} { foreach event $eventspec { after idle after 0 chan postevent $chan $event } } } } -cleanup { interp bgerror {} $bghandler unset -nocomplain ::io-44.7-result namespace delete schan } -body { interp bgerror {} [list apply {{res opts} { set ::io-44.7-result [dict get $opts -errorinfo] }}] coroutine c1 apply [list {} { set chan [schan::open] chan event $chan readable [list [info coroutine]] yield close $chan set ::io-44.7-result success } [namespace current]] vwait ::io-44.7-result set ::io-44.7-result } -result success makeFile "foo bar" foo test io-45.1 {DeleteFileEvent, cleanup on close} {fileevent} { set f [open $path(foo) r] fileevent $f readable [namespace code { lappend x "binding triggered: \"[gets $f]\"" fileevent $f readable {} }] close $f set x initial after 100 [namespace code { set y done }] variable y vwait [namespace which -variable y] set x } {initial} test io-45.2 {DeleteFileEvent, cleanup on close} {fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] fileevent $f readable [namespace code { lappend x "f triggered: \"[gets $f]\"" fileevent $f readable {} }] fileevent $f2 readable [namespace code { lappend x "f2 triggered: \"[gets $f2]\"" fileevent $f2 readable {} }] close $f variable x initial vwait [namespace which -variable x] close $f2 set x } {initial {f2 triggered: "foo bar"}} test io-45.3 {DeleteFileEvent, cleanup on close} {fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] fileevent $f readable {f script} fileevent $f2 readable {f2 script} fileevent $f3 readable {f3 script} set x {} close $f2 lappend x [catch {fileevent $f readable} msg] $msg \ [catch {fileevent $f2 readable}] \ [catch {fileevent $f3 readable} msg] $msg close $f3 lappend x [catch {fileevent $f readable} msg] $msg \ [catch {fileevent $f2 readable}] \ [catch {fileevent $f3 readable}] close $f lappend x [catch {fileevent $f readable}] \ [catch {fileevent $f2 readable}] \ [catch {fileevent $f3 readable}] } {0 {f script} 1 0 {f3 script} 0 {f script} 1 1 1 1 1} # Execute these tests only if the "testfevent" command is present. test io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileevent notOSX} { testfevent create set script "set f \[[list open $path(foo) r]]\n" append script { set x "no event" fileevent $f readable [namespace code { set x "f triggered: [gets $f]" fileevent $f readable {} }] } set timer [after 10 lappend x timeout] testfevent cmd $script vwait x after cancel $timer testfevent cmd {close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} test io-46.2 {Tcl event loop vs multiple interpreters} testfevent { testfevent create testfevent cmd { variable x 0 after 100 {set x triggered} vwait [namespace which -variable x] set x } } {triggered} test io-46.3 {Tcl event loop vs multiple interpreters} testfevent { testfevent create testfevent cmd { set x 0 after 10 {lappend x timer} after 30 set result $x update idletasks lappend result $x update lappend result $x } } {0 0 {0 timer}} test io-47.1 {fileevent vs multiple interpreters} {testfevent fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] fileevent $f readable {script 1} testfevent create testfevent share $f2 testfevent cmd "fileevent $f2 readable {script 2}" fileevent $f3 readable {sript 3} set x {} lappend x [fileevent $f2 readable] testfevent delete lappend x [fileevent $f readable] [fileevent $f2 readable] \ [fileevent $f3 readable] close $f close $f2 close $f3 set x } {{} {script 1} {} {sript 3}} test io-47.2 {deleting fileevent on interpreter delete} {testfevent fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] set f4 [open $path(foo) r] fileevent $f readable {script 1} testfevent create testfevent share $f2 testfevent share $f3 testfevent cmd "fileevent $f2 readable {script 2} fileevent $f3 readable {script 3}" fileevent $f4 readable {script 4} testfevent delete set x [list [fileevent $f readable] [fileevent $f2 readable] \ [fileevent $f3 readable] [fileevent $f4 readable]] close $f close $f2 close $f3 close $f4 set x } {{script 1} {} {} {script 4}} test io-47.3 {deleting fileevent on interpreter delete} {testfevent fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] set f4 [open $path(foo) r] testfevent create testfevent share $f3 testfevent share $f4 fileevent $f readable {script 1} fileevent $f2 readable {script 2} testfevent cmd "fileevent $f3 readable {script 3} fileevent $f4 readable {script 4}" testfevent delete set x [list [fileevent $f readable] [fileevent $f2 readable] \ [fileevent $f3 readable] [fileevent $f4 readable]] close $f close $f2 close $f3 close $f4 set x } {{script 1} {script 2} {} {}} test io-47.4 {file events on shared files and multiple interpreters} {testfevent fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] testfevent create testfevent share $f testfevent cmd "fileevent $f readable {script 1}" fileevent $f readable {script 2} fileevent $f2 readable {script 3} set x [list [fileevent $f2 readable] \ [testfevent cmd "fileevent $f readable"] \ [fileevent $f readable]] testfevent delete close $f close $f2 set x } {{script 3} {script 1} {script 2}} test io-47.5 {file events on shared files, deleting file events} {testfevent fileevent} { set f [open $path(foo) r] testfevent create testfevent share $f testfevent cmd "fileevent $f readable {script 1}" fileevent $f readable {script 2} testfevent cmd "fileevent $f readable {}" set x [list [testfevent cmd "fileevent $f readable"] \ [fileevent $f readable]] testfevent delete close $f set x } {{} {script 2}} test io-47.6 {file events on shared files, deleting file events} {testfevent fileevent} { set f [open $path(foo) r] testfevent create testfevent share $f testfevent cmd "fileevent $f readable {script 1}" fileevent $f readable {script 2} fileevent $f readable {} set x [list [testfevent cmd "fileevent $f readable"] \ [fileevent $f readable]] testfevent delete close $f set x } {{script 1} {}} unset path(foo) removeFile foo set path(bar) [makeFile {} bar] test io-48.1 {testing readability conditions} {fileevent} { set f [open $path(bar) w] puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg close $f set f [open $path(bar) r] fileevent $f readable [namespace code [list consume $f]] proc consume {f} { variable l variable x lappend l called if {[eof $f]} { close $f set x done } else { gets $f } } set l "" variable x not_done vwait [namespace which -variable x] list $x $l } {done {called called called called called called called}} test io-48.2 {testing readability conditions} {nonBlockFiles fileevent} { set f [open $path(bar) w] puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg close $f set f [open $path(bar) r] fileevent $f readable [namespace code [list consume $f]] fconfigure $f -blocking off proc consume {f} { variable x variable l lappend l called if {[eof $f]} { close $f set x done } else { gets $f } } set l "" variable x not_done vwait [namespace which -variable x] list $x $l } {done {called called called called called called called}} set path(my_script) [makeFile {} my_script] test io-48.3 {testing readability conditions} {stdio unix nonBlockFiles fileevent} { set f [open $path(bar) w] puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg puts $f abcdefg close $f set f [open $path(my_script) w] puts $f { proc copy_slowly {f} { while {![eof $f]} { puts [gets $f] after 200 } close $f } } close $f set f [open "|[list [interpreter]]" r+] fileevent $f readable [namespace code [list consume $f]] fconfigure $f -buffering line fconfigure $f -blocking off proc consume {f} { variable l variable x if {[eof $f]} { set x done } else { gets $f lappend l [fblocked $f] gets $f lappend l [fblocked $f] } } set l "" variable x not_done puts $f [list source $path(my_script)] puts $f "set f \[[list open $path(bar) r]]" puts $f {copy_slowly $f} puts $f {exit} vwait [namespace which -variable x] close $f list $x $l } {done {0 1 0 1 0 1 0 1 0 1 0 1 0 0}} unset path(bar) removeFile bar test io-48.4 {lf write, testing readability, ^Z termination, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf variable c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable c variable x if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.5 {lf write, testing readability, ^Z in middle, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable x variable c if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.6 {cr write, testing readability, ^Z termination, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable x variable c if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.7 {cr write, testing readability, ^Z in middle, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable c variable x if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.8 {crlf write, testing readability, ^Z termination, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable x variable c if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.9 {crlf write, testing readability, ^Z in middle, auto read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable c variable x if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation auto -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.10 {lf write, testing readability, ^Z in middle, lf read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable c variable x if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.11 {lf write, testing readability, ^Z termination, lf read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf set c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable x variable c if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation lf -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.12 {cr write, testing readability, ^Z in middle, cr read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable l variable x variable c if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.13 {cr write, testing readability, ^Z termination, cr read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation cr set c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable c variable x variable l if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation cr -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.14 {crlf write, testing readability, ^Z in middle, crlf read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%cfoo\nbar\n" 26] puts -nonewline $f $c close $f proc consume {f} { variable c variable x variable l if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-48.15 {crlf write, testing readability, ^Z termi, crlf read mode} {fileevent} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation crlf set c [format "abc\ndef\n%c" 26] puts -nonewline $f $c close $f proc consume {f} { variable c variable x variable l if {[eof $f]} { set x done close $f } else { lappend l [gets $f] incr c } } set c 0 set l "" set f [open $path(test1) r] fconfigure $f -translation crlf -eofchar \x1A fileevent $f readable [namespace code [list consume $f]] variable x vwait [namespace which -variable x] list $c $l } {3 {abc def {}}} test io-49.1 {testing crlf reading, leftover cr disgorgment} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" close $f set f [open $path(test1) r] set l "" lappend l [file size $path(test1)] fconfigure $f -translation crlf lappend l [read $f 1] lappend l [tell $f] lappend l [read $f 1] lappend l [tell $f] lappend l [read $f 1] lappend l [tell $f] lappend l [read $f 1] lappend l [tell $f] lappend l [read $f 1] lappend l [tell $f] lappend l [read $f 1] lappend l [tell $f] lappend l [eof $f] lappend l [read $f 1] lappend l [eof $f] close $f set l } "7 a 1 [list \r] 2 b 3 [list \r] 4 c 5 { } 7 0 {} 1" test io-49.2 {testing crlf reading, leftover cr disgorgment} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" close $f set f [open $path(test1) r] set l "" lappend l [file size $path(test1)] fconfigure $f -translation crlf lappend l [read $f 2] lappend l [tell $f] lappend l [read $f 2] lappend l [tell $f] lappend l [read $f 2] lappend l [tell $f] lappend l [eof $f] lappend l [read $f 2] lappend l [tell $f] lappend l [eof $f] close $f set l } "7 [list a\r] 2 [list b\r] 4 [list c\n] 7 0 {} 7 1" test io-49.3 {testing crlf reading, leftover cr disgorgment} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" close $f set f [open $path(test1) r] set l "" lappend l [file size $path(test1)] fconfigure $f -translation crlf lappend l [read $f 3] lappend l [tell $f] lappend l [read $f 3] lappend l [tell $f] lappend l [eof $f] lappend l [read $f 3] lappend l [tell $f] lappend l [eof $f] close $f set l } "7 [list a\rb] 3 [list \rc\n] 7 0 {} 7 1" test io-49.4 {testing crlf reading, leftover cr disgorgment} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" close $f set f [open $path(test1) r] set l "" lappend l [file size $path(test1)] fconfigure $f -translation crlf lappend l [read $f 3] lappend l [tell $f] lappend l [gets $f] lappend l [tell $f] lappend l [eof $f] lappend l [gets $f] lappend l [tell $f] lappend l [eof $f] close $f set l } "7 [list a\rb] 3 [list \rc] 7 0 {} 7 1" test io-49.5 {testing crlf reading, leftover cr disgorgment} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "a\rb\rc\r\n" close $f set f [open $path(test1) r] set l "" lappend l [file size $path(test1)] fconfigure $f -translation crlf lappend l [set x [gets $f]] lappend l [tell $f] lappend l [gets $f] lappend l [tell $f] lappend l [eof $f] close $f set l } [list 7 a\rb\rc 7 {} 7 1] test io-50.1 {testing handler deletion} -constraints {testchannelevent testservicemode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f update proc delhandler {f} { variable z set z called testchannelevent $f delete 0 } set z not_called set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f]] testservicemode 1 vwait z after cancel $timer set z } -cleanup { close $f } -result called test io-50.2 {testing handler deletion with multiple handlers} -constraints {testchannelevent testservicemode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f proc delhandler {f i} { variable z lappend z "called delhandler $i" testchannelevent $f delete 0 } set z "" testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 set timer [after 50 lappend z timeout] vwait z after cancel $timer set z } -cleanup { close $f } -result {{called delhandler 0} {called delhandler 1}} test io-50.3 {testing handler deletion with multiple handlers} -constraints {testchannelevent testservicemode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f set z "" proc notcalled {f i} { variable z lappend z "notcalled was called!! $f $i" } proc delhandler {f i} { variable z testchannelevent $f delete 1 lappend z "delhandler $i called" testchannelevent $f delete 0 lappend z "delhandler $i deleted myself" } set z "" testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 set timer [after 50 lappend z timeout] vwait z after cancel $timer set z } -cleanup { close $f } -result {{delhandler 0 called} {delhandler 0 deleted myself}} test io-50.4 {testing handler deletion vs reentrant calls} -constraints {testchannelevent testservicemode} -setup { file delete $path(test1) update } -body { set f [open $path(test1) w] close $f update proc delrecursive {f} { variable z variable u if {"$u" == "recursive"} { testchannelevent $f delete 0 lappend z "delrecursive deleting recursive" } else { lappend z "delrecursive calling recursive" set u recursive update } } variable u toplevel variable z "" testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delrecursive $f]] testservicemode 1 set timer [after 50 lappend z timeout] vwait z after cancel $timer set z } -cleanup { close $f } -result {{delrecursive calling recursive} {delrecursive deleting recursive}} test io-50.5 {testing handler deletion vs reentrant calls} -constraints {testchannelevent testservicemode notOSX} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f proc notcalled {f} { variable z lappend z "notcalled was called!! $f" } proc del {f} { variable u variable z if {"$u" == "recursive"} { testchannelevent $f delete 1 lappend z "del deleted notcalled" testchannelevent $f delete 0 lappend z "del deleted myself" } else { set u recursive lappend z "del calling recursive" set timer [after 50 lappend z timeout] vwait z after cancel $timer lappend z "del after recursive" } } set z "" set u toplevel testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f]] testchannelevent $f add readable [namespace code [list del $f]] testservicemode 1 set timer [after 50 set z timeout] vwait z after cancel $timer set z } -cleanup { close $f } -result [list {del calling recursive} {del deleted notcalled} \ {del deleted myself} {del after recursive}] test io-50.6 {testing handler deletion vs reentrant calls} -constraints {testchannelevent testservicemode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f proc first {f} { variable u variable z variable done if {"$u" == "toplevel"} { lappend z "first called" set u first set timer [after 50 lappend z timeout] vwait z after cancel $timer lappend z "first after toplevel" set done 1 } else { lappend z "first called not toplevel" } } proc second {f} { variable u variable z if {"$u" == "first"} { lappend z "second called, first time" set u second testchannelevent $f delete 0 } elseif {"$u" == "second"} { lappend z "second called, second time" testchannelevent $f delete 0 } else { lappend z "second called, cannot happen!" testchannelevent $f removeall } } set z "" set u toplevel set done 0 testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list second $f]] testchannelevent $f add readable [namespace code [list first $f]] testservicemode 1 update if {!$done} { set timer2 [after 200 set done 1] vwait done after cancel $timer2 } set z } -cleanup { close $f } -result [list {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ {first after toplevel}] test io-51.1 {Test old socket deletion on Macintosh} {socket} { set x 0 set result "" proc accept {s a p} { variable x variable wait fconfigure $s -blocking off puts $s "sock[incr x]" close $s set wait done } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [fconfigure $ss -sockname] 2] variable wait "" set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [gets $cs] close $cs set wait "" set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [gets $cs] close $cs set wait "" set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [gets $cs] close $cs set wait "" set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [gets $cs] close $cs close $ss set result } {sock1 sock2 sock3 sock4} test io-52.1 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fcopy $f1 $f2 -command { # } catch { fcopy $f1 $f2 } msg close $f1 close $f2 string compare $msg "channel \"$f1\" is busy" } {0} test io-52.2 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] set f3 [open $thisScript] fcopy $f1 $f2 -command { # } catch { fcopy $f3 $f2 } msg close $f1 close $f2 close $f3 string compare $msg "channel \"$f2\" is busy" } {0} test io-52.3 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation cr -encoding iso8859-1 -blocking 0 set s0 [fcopy $f1 $f2] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {("$s1" == "$s2") && ($s0 == $s1)} { lappend result ok } set result } {0 0 ok} test io-52.4 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 fconfigure $f2 -translation cr -blocking 0 fcopy $f1 $f2 -size 40 set result [list [fblocked $f1] [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 lappend result [file size $path(test1)] } {0 0 0 40} test io-52.4.1 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 -buffersize 10000000 fconfigure $f2 -translation cr -blocking 0 fcopy $f1 $f2 -size 40 set result [list [fblocked $f1] [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 lappend result [file size $path(test1)] } {0 0 0 40} test io-52.5 {TclCopyChannel, all} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 -size -1 ;# -1 means 'copy all', same as if no -size specified. set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {"$s1" == "$s2"} { lappend result ok } set result } {0 0 ok} test io-52.5a {TclCopyChannel, all, other negative value} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 -size -2 ;# < 0 behaves like -1, copy all set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {"$s1" == "$s2"} { lappend result ok } set result } {0 0 ok} test io-52.5b {TclCopyChannel, all, wrap to negative value} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 -size 3221176172 ;# Wrapped to < 0, behaves like -1, copy all set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {"$s1" == "$s2"} { lappend result ok } set result } {0 0 ok} test io-52.6 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 set s0 [fcopy $f1 $f2 -size [expr {[file size $thisScript] + 5}]] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {("$s1" == "$s2") && ($s0 == $s1)} { lappend result ok } set result } {0 0 ok} test io-52.7 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] set s1 [file size $thisScript] set s2 [file size $path(test1)] close $f1 close $f2 if {"$s1" == "$s2"} { lappend result ok } set result } {0 0 ok} test io-52.8 {TclCopyChannel} {stdio fcopy} { file delete $path(test1) file delete $path(pipe) set f1 [open $path(pipe) w] fconfigure $f1 -translation lf puts $f1 " puts ready gets stdin set f1 \[open [list $thisScript] r\] fconfigure \$f1 -translation lf puts \[read \$f1 100\] close \$f1 " close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f1 -translation lf gets $f1 puts $f1 ready flush $f1 set f2 [open $path(test1) w] fconfigure $f2 -translation lf set s0 [fcopy $f1 $f2 -size 40] catch {close $f1} close $f2 list $s0 [file size $path(test1)] } {40 40} # Empty files, to register them with the test facility set path(kyrillic.txt) [makeFile {} kyrillic.txt] set path(utf8-fcopy.txt) [makeFile {} utf8-fcopy.txt] set path(utf8-rp.txt) [makeFile {} utf8-rp.txt] # Create kyrillic file, use lf translation to avoid os eol issues set out [open $path(kyrillic.txt) w] fconfigure $out -encoding koi8-r -translation lf puts $out "АА" close $out test io-52.9 {TclCopyChannel & encodings} {fcopy} { # Copy kyrillic to UTF-8, using fcopy. set in [open $path(kyrillic.txt) r] set out [open $path(utf8-fcopy.txt) w] fconfigure $in -encoding koi8-r -translation lf fconfigure $out -encoding utf-8 -translation lf fcopy $in $out close $in close $out # Do the same again, but differently (read/puts). set in [open $path(kyrillic.txt) r] set out [open $path(utf8-rp.txt) w] fconfigure $in -encoding koi8-r -translation lf fconfigure $out -encoding utf-8 -translation lf puts -nonewline $out [read $in] close $in close $out list [file size $path(kyrillic.txt)] \ [file size $path(utf8-fcopy.txt)] \ [file size $path(utf8-rp.txt)] } {3 5 5} test io-52.10 {TclCopyChannel & encodings} -constraints fcopy -body { set in [open $path(kyrillic.txt) r] set out [open $path(utf8-fcopy.txt) w] fconfigure $in -encoding koi8-r -translation lf fconfigure $out -translation binary fcopy $in $out file size $path(utf8-fcopy.txt) } -cleanup { close $in close $out } -returnCodes 1 -match glob -result {error writing "*":\ invalid or incomplete multibyte or wide character} test io-52.11 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf -profile strict puts $out АА close $out } -constraints {fcopy} -body { set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] fconfigure $in -translation binary fconfigure $out -encoding koi8-r -translation lf -profile strict catch {fcopy $in $out} cres copts return $cres } -cleanup { if {$in in [chan names]} { close $in } if {$out in [chan names]} { close $out } catch {unset cres} } -match glob -result {error writing "*": invalid or incomplete\ multibyte or wide character} test io-52.12 {coverage of -translation auto} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 set out [open $path(test2) w] chan configure $out -translation lf fcopy $in $out close $in close $out file size $path(test2) } 29 test io-52.13 {coverage of -translation cr} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation cr set out [open $path(test2) w] chan configure $out -translation lf fcopy $in $out close $in close $out file size $path(test2) } 30 test io-52.14 {coverage of -translation crlf} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation crlf set out [open $path(test2) w] chan configure $out -translation lf fcopy $in $out close $in close $out file size $path(test2) } 29 test io-52.14.1 {coverage of -translation crlf} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation crlf set out [open $path(test2) w] fcopy $in $out -size 2 close $in close $out file size $path(test2) } 2 test io-52.14.2 {coverage of -translation crlf} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -translation crlf set out [open $path(test2) w] fcopy $in $out -size 9 close $in close $out file size $path(test2) } 9 test io-52.15 {coverage of -translation crlf} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\r close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation crlf set out [open $path(test2) w] fcopy $in $out close $in close $out file size $path(test2) } 8 test io-52.16 {coverage of eofChar handling} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation lf -eofchar a set out [open $path(test2) w] fcopy $in $out close $in close $out file size $path(test2) } 0 test io-52.17 {coverage of eofChar handling} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation lf -eofchar d set out [open $path(test2) w] fcopy $in $out close $in close $out file size $path(test2) } 3 test io-52.18 {coverage of eofChar handling} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 8 -translation crlf -eofchar h set out [open $path(test2) w] fcopy $in $out close $in close $out file size $path(test2) } 8 test io-52.19 {coverage of eofChar handling} { file delete $path(test1) $path(test2) set out [open $path(test1) wb] chan configure $out -translation lf puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz close $out set in [open $path(test1)] chan configure $in -buffersize 10 -translation crlf -eofchar h set out [open $path(test2) w] fcopy $in $out close $in close $out file size $path(test2) } 8 test io-52.20 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "Á" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means reading the "Á" gives an error fconfigure $in -encoding ascii -profile strict fconfigure $out -encoding koi8-r -translation lf fcopy $in $out } -cleanup { close $in close $out } -returnCodes 1 -match glob -result {error reading "file*": invalid or incomplete multibyte or wide character} test io-52.20.2 {TclCopyChannel & encoding error on same encoding} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "AÁ" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means reading the "Á" gives an error fconfigure $in -encoding ascii -profile strict fconfigure $out -encoding ascii -translation lf fcopy $in $out } -cleanup { close $in close $out } -returnCodes 1 -match glob -result {error reading "file*": invalid or incomplete multibyte or wide character} test io-52.21 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "Á" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means writing the "Á" gives an error fconfigure $in -encoding utf-8 fconfigure $out -encoding ascii -translation lf -profile strict fcopy $in $out } -cleanup { close $in close $out } -returnCodes 1 -match glob -result {error writing "file*": invalid or incomplete multibyte or wide character} test io-52.22 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "Á" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means reading the "Á" gives an error fconfigure $in -encoding ascii -profile strict fconfigure $out -encoding koi8-r -translation lf proc ::xxx args { set ::s0 $args } fcopy $in $out -command ::xxx vwait ::s0 set ::s0 } -cleanup { close $in close $out unset ::s0 } -match glob -result {0 {error reading "file*": invalid or incomplete multibyte or wide character}} test io-52.22.1 {TclCopyChannel & encodings & tell position} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "AÁ" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means reading the "Á" gives an error fconfigure $in -encoding ascii -profile strict fconfigure $out -encoding koi8-r -translation lf proc ::xxx args { set ::s0 $args } fcopy $in $out -command ::xxx vwait ::s0 list [tell $in] [tell $out] {*}[set ::s0] } -cleanup { close $in close $out unset ::s0 } -match glob -result {1 1 1 {error reading "file*": invalid or incomplete multibyte or wide character}} test io-52.23 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf puts $out "Á" close $out } -constraints {fcopy} -body { # binary to encoding => the input has to be # in utf-8 to make sense to the encoder set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] # Using "-encoding ascii" means writing the "Á" gives an error fconfigure $in -encoding utf-8 fconfigure $out -encoding ascii -translation lf -profile strict proc ::xxx args { set ::s0 $args } fcopy $in $out -command ::xxx vwait ::s0 set ::s0 } -cleanup { close $in close $out unset ::s0 } -match glob -result {0 {error writing "file*": invalid or incomplete multibyte or wide character}} test io-52.24 {fcopy -size should always be characters} -setup { set out [open utf8-fcopy-52.24.txt w] fconfigure $out -encoding utf-8 -translation lf puts $out "Á" close $out } -constraints {fcopy} -body { set in [open utf8-fcopy-52.24.txt r] set out [open utf8-fcopy-52.24.out.txt w+] fconfigure $in -encoding utf-8 -profile tcl8 fconfigure $out -encoding utf-8 -profile tcl8 fcopy $in $out -size 1 seek $out 0 # a result of \xc3 means that only the first byte of the utf-8 encoding of # Á made it into to the output file. read $out } -cleanup { close $in close $out catch {file delete utf8-fcopy-52.24.txt} catch {file delete utf8-fcopy-52.24.out.txt} } -result Á test io-53.1 {CopyData} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -blocking 0 fconfigure $f2 -translation cr -blocking 0 fcopy $f1 $f2 -size 0 set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 close $f2 lappend result [file size $path(test1)] } {0 0 0} test io-53.2 {CopyData} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 fconfigure $f2 -translation cr -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 -command [namespace code {set s0}] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] variable s0 vwait [namespace which -variable s0] close $f1 close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {("$s1" == "$s2") && ($s0 == $s1)} { lappend result ok } set result } {0 0 ok} test io-53.3 {CopyData: background read underflow} {stdio unix fcopy} { file delete $path(test1) file delete $path(pipe) set f1 [open $path(pipe) w] puts -nonewline $f1 { puts ready flush stdout ;# Don't assume line buffered! fcopy stdin stdout -command { set x } vwait x set f [} puts $f1 [list open $path(test1) w]] puts $f1 { fconfigure $f -translation lf puts $f "done" close $f } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] set result [gets $f1] puts $f1 line1 flush $f1 lappend result [gets $f1] puts $f1 line2 flush $f1 lappend result [gets $f1] close $f1 after 500 set f [open $path(test1)] lappend result [read $f] close $f set result } "ready line1 line2 {done\n}" test io-53.4 {CopyData: background write overflow} {stdio fileevent fcopy} { set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n variable x for {set x 0} {$x < 12} {incr x} { append big $big } file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 { puts ready fcopy stdin stdout -command { set x } vwait x } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] set result [gets $f1] fconfigure $f1 -blocking 0 puts $f1 $big flush $f1 set result "" fileevent $f1 read [namespace code { append result [read $f1 1024] if {[string length $result] >= [string length $big]+1} { set x done } }] vwait [namespace which -variable x] close $f1 set big {} set x } done test io-53.4.1 {Bug 894da183c8} {stdio fcopy} { set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n variable x for {set x 0} {$x < 12} {incr x} { append big $big } file delete $path(pipe) set f1 [open $path(pipe) w] puts $f1 [list file delete $path(test1)] puts $f1 { puts ready set f [open io-53.4.1 w] chan configure $f -translation lf fcopy stdin $f -command { set x } vwait x close $f } puts $f1 "close \[[list open $path(test1) w]]" close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] set result [gets $f1] fconfigure $f1 -blocking 0 -buffersize 125000 -translation lf puts $f1 $big fconfigure $f1 -blocking 1 close $f1 set big {} while {[catch {glob $path(test1)}]} {after 50} file delete $path(test1) set check [file size io-53.4.1] file delete io-53.4.1 set check } 266241 set result {} proc FcopyTestAccept {sock args} { after 1000 "close $sock" } proc FcopyTestDone {bytes {error {}}} { variable fcopyTestDone if {[string length $error]} { set fcopyTestDone 1 } else { set fcopyTestDone 0 } } test io-53.5 {CopyData: error during fcopy} {socket fcopy} { variable fcopyTestDone set listen [socket -server [namespace code FcopyTestAccept] -myaddr 127.0.0.1 0] set in [open $thisScript] ;# 126 K set out [socket 127.0.0.1 [lindex [fconfigure $listen -sockname] 2]] catch {unset fcopyTestDone} close $listen ;# This means the socket open never really succeeds fconfigure $in -encoding utf-8 fconfigure $out -encoding utf-8 fcopy $in $out -command [namespace code FcopyTestDone] variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] ;# The error occurs here in the b.g. } close $in close $out set fcopyTestDone ;# 1 for error condition } 1 test io-53.6 {CopyData: error during fcopy} {stdio fcopy} { variable fcopyTestDone file delete $path(pipe) file delete $path(test1) catch {unset fcopyTestDone} set f1 [open $path(pipe) w] puts $f1 "exit 1" close $f1 set in [open "|[list [interpreter] $path(pipe)]" r+] set out [open $path(test1) w] fcopy $in $out -command [namespace code FcopyTestDone] variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] } catch {close $in} close $out set fcopyTestDone ;# 0 for plain end of file } {0} proc doFcopy {in out {bytes 0} {error {}}} { variable fcopyTestDone variable fcopyTestCount incr fcopyTestCount $bytes if {[string length $error]} { set fcopyTestDone 1 } elseif {[eof $in]} { set fcopyTestDone 0 } else { # Delay next fcopy to wait for size>0 input bytes after 100 [list fcopy $in $out -size 1000 \ -command [namespace code [list doFcopy $in $out]]] } } test io-53.7 {CopyData: Flooding fcopy from pipe} {stdio fcopy} { variable fcopyTestDone file delete $path(pipe) catch {unset fcopyTestDone} set fcopyTestCount 0 set f1 [open $path(pipe) w] puts $f1 { # Write 10 bytes / 10 msec proc Write {count} { puts -nonewline "1234567890" if {[incr count -1]} { after 10 [list Write $count] } else { set ::ready 1 } } fconfigure stdout -buffering none Write 345 ;# 3450 bytes ~3.45 sec vwait ready exit 0 } close $f1 set in [open "|[list [interpreter] $path(pipe) &]" r+] set out [open $path(test1) w] doFcopy $in $out variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] } catch {close $in} close $out # -1=error 0=script error N=number of bytes expr {($fcopyTestDone == 0) ? $fcopyTestCount : -1} } {3450} test io-53.8 {CopyData: async callback and error handling, Bug 1932639} -setup { # copy progress callback. errors out intentionally proc ::cmd args { lappend ::RES "CMD $args" error !STOP } # capture callback error here proc ::bgerror args { lappend ::RES "bgerror/OK $args" set ::forever has-been-reached return } # Files we use for our channels set foo [makeFile ashgdfashdgfasdhgfasdhgf foo] set bar [makeFile {} bar] # Channels to copy between set f [open $foo r] ; fconfigure $f -translation binary set g [open $bar w] ; fconfigure $g -translation binary -buffering none } -constraints {stdio fcopy} -body { # Record input size, so that result is always defined lappend ::RES [file size $bar] # Run the copy. Should not invoke -command now. fcopy $f $g -size 2 -command ::cmd # Check that -command was not called synchronously set sbs [file size $bar] lappend ::RES [expr {($sbs > 0) ? "sync/FAIL" : "sync/OK"}] $sbs # Now let the async part happen. Should capture the error in cmd # via bgerror. If not break the event loop via timer. set token [after 1000 { lappend ::RES {bgerror/FAIL timeout} set ::forever has-been-reached }] vwait ::forever catch {after cancel $token} # Report set ::RES } -cleanup { close $f close $g catch {unset ::RES} catch {unset ::forever} rename ::cmd {} rename ::bgerror {} removeFile foo removeFile bar } -result {0 sync/OK 0 {CMD 2} {bgerror/OK !STOP}} test io-53.8a {CopyData: async callback and error handling, Bug 1932639, at eof} -setup { # copy progress callback. errors out intentionally proc ::cmd args { lappend ::RES "CMD $args" set ::forever has-been-reached return } # Files we use for our channels set foo [makeFile ashgdfashdgfasdhgfasdhgf foo] set bar [makeFile {} bar] # Channels to copy between set f [open $foo r] ; fconfigure $f -translation binary set g [open $bar w] ; fconfigure $g -translation binary -buffering none } -constraints {stdio fcopy} -body { # Initialize and force eof on the input. seek $f 0 end ; read $f 1 set ::RES [eof $f] # Run the copy. Should not invoke -command now. fcopy $f $g -size 2 -command ::cmd # Check that -command was not called synchronously lappend ::RES [expr {([llength $::RES] > 1) ? "sync/FAIL" : "sync/OK"}] # Now let the async part happen. Should capture the eof in cmd # If not break the event loop via timer. set token [after 1000 { lappend ::RES {cmd/FAIL timeout} set ::forever has-been-reached }] vwait ::forever catch {after cancel $token} # Report set ::RES } -cleanup { close $f close $g catch {unset ::RES} catch {unset ::forever} rename ::cmd {} removeFile foo removeFile bar } -result {1 sync/OK {CMD 0}} test io-53.8b {CopyData: async callback and -size 0} -setup { # copy progress callback. errors out intentionally proc ::cmd args { lappend ::RES "CMD $args" set ::forever has-been-reached return } # Files we use for our channels set foo [makeFile ashgdfashdgfasdhgfasdhgf foo] set bar [makeFile {} bar] # Channels to copy between set f [open $foo r] ; fconfigure $f -translation binary set g [open $bar w] ; fconfigure $g -translation binary -buffering none } -constraints {stdio fcopy} -body { set ::RES {} # Run the copy. Should not invoke -command now. fcopy $f $g -size 0 -command ::cmd # Check that -command was not called synchronously lappend ::RES [expr {([llength $::RES] > 1) ? "sync/FAIL" : "sync/OK"}] # Now let the async part happen. Should capture the eof in cmd # If not break the event loop via timer. set token [after 1000 { lappend ::RES {cmd/FAIL timeout} set ::forever has-been-reached }] vwait ::forever catch {after cancel $token} # Report set ::RES } -cleanup { close $f close $g catch {unset ::RES} catch {unset ::forever} rename ::cmd {} removeFile foo removeFile bar } -result {sync/OK {CMD 0}} test io-53.9 {CopyData: -size and event interaction, Bug 780533} -setup { set out [makeFile {} out] set err [makeFile {} err] set pipe [open "|[list [info nameofexecutable] 2> $err]" r+] fconfigure $pipe -translation binary -buffering line puts $pipe { fconfigure stdout -translation binary -buffering line puts stderr Waiting... after 1000 foreach x {a b c} { puts stderr Looping... puts $x after 500 } proc bye args { if {[gets stdin line]<0} { puts stderr "CHILD: EOF detected, exiting" exit } else { puts stderr "CHILD: ignoring line: $line" } } puts stderr Now-sleeping-forever fileevent stdin readable bye vwait forever } proc ::done args { set ::forever OK return } set ::forever {} set out [open $out w] } -constraints {stdio fcopy} -body { fcopy $pipe $out -size 6 -command ::done set token [after 5000 { set ::forever {fcopy hangs} }] vwait ::forever catch {after cancel $token} set ::forever } -cleanup { close $pipe rename ::done {} after 1000; # Give Windows time to kill the process catch {close $out} catch {removeFile out} catch {removeFile err} catch {unset ::forever} } -result OK test io-53.10 {Bug 1350564, multi-directional fcopy} -setup { set err [makeFile {} err] set pipe [open "|[list [info nameofexecutable] 2> $err]" r+] fconfigure $pipe -translation binary -buffering line puts $pipe { fconfigure stderr -buffering line # Kill server when pipe closed by invoker. proc bye args { if {![eof stdin]} { gets stdin ; return } puts stderr BYE exit } # Server code. Bi-directional copy between 2 sockets. proc geof {sok} { puts stderr DONE/$sok close $sok } proc new {sok args} { puts stderr NEW/$sok global l srv fconfigure $sok -translation binary -buffering none lappend l $sok if {[llength $l]==2} { close $srv foreach {a b} $l break fcopy $a $b -command [list geof $a] fcopy $b $a -command [list geof $b] puts stderr 2COPY } puts stderr ... } puts stderr SRV set l {} set srv [socket -server new -myaddr 127.0.0.1 0] set port [lindex [fconfigure $srv -sockname] 2] puts stderr WAITING fileevent stdin readable bye puts "OK $port" vwait forever } # wait for OK from server. lassign [gets $pipe] ok port # Now the two clients. proc ::done {sock} { if {[eof $sock]} { close $sock ; return } lappend ::forever [gets $sock] return } set a [socket 127.0.0.1 $port] set b [socket 127.0.0.1 $port] fconfigure $a -translation binary -buffering none fconfigure $b -translation binary -buffering none fileevent $a readable [list ::done $a] fileevent $b readable [list ::done $b] } -constraints {stdio fcopy} -body { # Now pass data through the server in both directions. set ::forever {} puts $a AB vwait ::forever puts $b BA vwait ::forever set ::forever } -cleanup { catch {close $a} catch {close $b} close $pipe rename ::done {} after 1000 ;# Give Windows time to kill the process removeFile err catch {unset ::forever} } -result {AB BA} test io-53.11 {Bug 2895565} -setup { set in [makeFile {} in] set f [open $in w] fconfigure $f -encoding utf-8 -translation binary puts -nonewline $f [string repeat "Ho hum\n" 11] close $f set inChan [open $in r] fconfigure $inChan -translation binary set out [makeFile {} out] set outChan [open $out w] fconfigure $outChan -encoding cp1252 -translation crlf proc CopyDone {bytes args} { variable done if {[llength $args]} { set done "Error: '[lindex $args 0]' after $bytes bytes copied" } else { set done "$bytes bytes copied" } } } -body { variable done after 2000 [list set [namespace which -variable done] timeout] fcopy $inChan $outChan -size 40 -command [namespace which CopyDone] vwait [namespace which -variable done] set done } -cleanup { close $outChan close $inChan removeFile out removeFile in } -result {40 bytes copied} test io-53.12.0 {CopyData: foreground short reads, aka bug 3096275} {stdio unix fcopy} { file delete $path(pipe) set f1 [open $path(pipe) w] puts -nonewline $f1 { fconfigure stdin -translation binary -blocking 0 fconfigure stdout -buffering none -translation binary fcopy stdin stdout } close $f1 set f1 [open "|[list [interpreter] $path(pipe)]" r+] fconfigure $f1 -translation binary -buffering none puts -nonewline $f1 A after 2000 {set ::done timeout} fileevent $f1 readable {set ::done ok} vwait ::done set ch [read $f1 1] close $f1 list $::done $ch } {ok A} test io-53.12.1 { Issue 9ca87e6286262a62. CopyData: foreground short reads via ReadChars(). Related to report 3096275 for ReadBytes(). Prior to the fix this test waited forever for read() to return. } {stdio unix fcopy} { file delete $path(output) set f1 [open $path(output) w] puts -nonewline $f1 { chan configure stdin -encoding iso8859-1 -translation lf -buffering none fcopy stdin stdout } close $f1 set f1 [open "|[list [info nameofexecutable] $path(output)]" r+] try { chan configure $f1 -encoding utf-8 -buffering none puts -nonewline $f1 A set ch [read $f1 1] } finally { if {$f1 in [chan names]} { close $f1 } } lindex $ch } A test io-53.13 {TclCopyChannel: read error reporting} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { return {initialize finalize watch read} } finalize { return } watch {} read { error FAIL } } } set outFile [makeFile {} out] } -body { set in [chan create read [namespace which driver]] chan configure $in -translation binary set out [open $outFile wb] chan copy $in $out } -cleanup { catch {close $in} catch {close $out} removeFile out rename driver {} } -result {error reading "rc*": *} -returnCodes error -match glob test io-53.14 {TclCopyChannel: write error reporting} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { return {initialize finalize watch write} } finalize { return } watch {} write { error FAIL } } } set inFile [makeFile {aaa} in] } -body { set in [open $inFile rb] set out [chan create write [namespace which driver]] chan configure $out -translation binary chan copy $in $out } -cleanup { catch {close $in} catch {close $out} removeFile in rename driver {} } -result {error writing "*": *} -returnCodes error -match glob test io-53.15 {[ed29c4da21] DoRead: fblocked seen as error} -setup { proc driver {cmd args} { variable buffer variable index variable blocked set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ [string repeat a 100]] set blocked($chan) 1 return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) blocked($chan) return } watch {} read { if {$blocked($chan)} { set blocked($chan) [expr {!$blocked($chan)}] return -code error EAGAIN } set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 set out [makeFile {} out] set outChan [open $out w] chan configure $outChan -encoding utf-8 } -body { chan copy $c $outChan } -cleanup { close $outChan close $c removeFile out } -result 100 test io-53.16 {[ed29c4da21] MBRead: fblocked seen as error} -setup { proc driver {cmd args} { variable buffer variable index variable blocked set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ [string repeat a 100]] set blocked($chan) 1 return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) blocked($chan) return } watch {} read { if {$blocked($chan)} { set blocked($chan) [expr {!$blocked($chan)}] return -code error EAGAIN } set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 -translation lf set out [makeFile {} out] set outChan [open $out w] chan configure $outChan -encoding utf-8 -translation lf } -body { chan copy $c $outChan } -cleanup { close $outChan close $c removeFile out } -result 100 test io-53.17 {[7c187a3773] MBWrite: proper inQueueTail handling} -setup { proc driver {cmd args} { variable buffer variable index set chan [lindex $args 0] switch -- $cmd { initialize { set index($chan) 0 set buffer($chan) [encoding convertto utf-8 \ line\n[string repeat a 100]line\n] return {initialize finalize watch read} } finalize { unset index($chan) buffer($chan) return } watch {} read { set n [lindex $args 1] set new [expr {$index($chan) + $n}] set result [string range $buffer($chan) $index($chan) $new-1] set index($chan) $new return $result } } } set c [chan create read [namespace which driver]] chan configure $c -encoding utf-8 -translation lf -buffersize 107 set out [makeFile {} out] set outChan [open $out w] chan configure $outChan -encoding utf-8 -translation lf } -body { list [gets $c] [chan copy $c $outChan -size 100] [gets $c] } -cleanup { close $outChan close $c removeFile out } -result {line 100 line} test io-54.1 {Recursive channel events} {socket fileevent notWinCI} { # This test checks to see if file events are delivered during recursive # event loops when there is buffered data on the channel. proc accept {s a p} { variable as fconfigure $s -translation lf puts $s "line 1\nline2\nline3" flush $s set as $s } proc readit {s next} { variable x variable result lappend result $next if {$next == 1} { fileevent $s readable [namespace code [list readit $s 2]] vwait [namespace which -variable x] } incr x } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] # We need to delay on some systems until the creation of the # server socket completes. set done 0 for {set i 0} {$i < 10} {incr i} { if {![catch {set cs [socket 127.0.0.1 [lindex [fconfigure $ss -sockname] 2]]}]} { set done 1 break } after 100 } if {$done == 0} { close $ss error "failed to connect to server" } variable result {} variable x 0 variable as vwait [namespace which -variable as] fconfigure $cs -translation lf lappend result [gets $cs] fconfigure $cs -blocking off fileevent $cs readable [namespace code [list readit $cs 1]] set a [after 2000 [namespace code { set x failure }]] vwait [namespace which -variable x] after cancel $a close $as close $ss close $cs list $result $x } {{{line 1} 1 2} 2} test io-54.2 {Testing for busy-wait in recursive channel events} {socket fileevent} { set accept {} set after {} variable s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] proc accept {s a p} { variable counter variable accept set accept $s set counter 0 fconfigure $s -blocking off -buffering line -translation lf fileevent $s readable [namespace code "doit $s"] } proc doit {s} { variable counter variable after incr counter set l [gets $s] if {"$l" eq ""} { fileevent $s readable [namespace code "doit1 $s"] set after [after 1000 [namespace code newline]] } } proc doit1 {s} { variable counter variable accept incr counter set l [gets $s] close $s set accept {} } proc producer {} { variable s variable writer set writer [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]] fconfigure $writer -buffering line puts -nonewline $writer hello flush $writer } proc newline {} { variable done variable writer puts $writer hello flush $writer set done 1 } producer variable done vwait [namespace which -variable done] close $writer close $s after cancel $after if {$accept != {}} {close $accept} set counter } 1 set path(fooBar) [makeFile {} fooBar] test io-55.1 {ChannelEventScriptInvoker: deletion} -constraints { fileevent } -setup { variable x proc eventScript {fd} { variable x close $fd error "planned error" set x whoops } proc myHandler args { variable x got_error } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { set f [open $path(fooBar) w] fileevent $f writable [namespace code [list eventScript $f]] variable x not_done vwait [namespace which -variable x] set x } -cleanup { interp bgerror {} $handler } -result {got_error} test io-56.1 {ChannelTimerProc} {testchannelevent} { set f [open $path(fooBar) w] puts $f "this is a test" close $f set f [open $path(fooBar) r] testchannelevent $f add readable [namespace code { read $f 1 incr x }] variable x 0 vwait [namespace which -variable x] vwait [namespace which -variable x] set result $x testchannelevent $f set 0 none after idle [namespace code {set y done}] variable y vwait [namespace which -variable y] close $f lappend result $y } {2 done} test io-57.1 {buffered data and file events, gets} {fileevent} { proc accept {sock args} { variable s2 set s2 $sock } set server [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set s [socket 127.0.0.1 [lindex [fconfigure $server -sockname] 2]] variable s2 vwait [namespace which -variable s2] update fileevent $s2 readable [namespace code {lappend result readable}] puts $s "12\n34567890" flush $s variable result [gets $s2] after 1000 [namespace code {lappend result timer}] vwait [namespace which -variable result] lappend result [gets $s2] vwait [namespace which -variable result] close $s close $s2 close $server set result } {12 readable 34567890 timer} test io-57.2 {buffered data and file events, read} {fileevent} { proc accept {sock args} { variable s2 set s2 $sock } set server [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set s [socket 127.0.0.1 [lindex [fconfigure $server -sockname] 2]] variable s2 vwait [namespace which -variable s2] update fileevent $s2 readable [namespace code {lappend result readable}] puts -nonewline $s "1234567890" flush $s variable result [read $s2 1] after 1000 [namespace code {lappend result timer}] vwait [namespace which -variable result] lappend result [read $s2 9] vwait [namespace which -variable result] close $s close $s2 close $server set result } {1 readable 234567890 timer} test io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin fileevent} { set out [open $path(script) w] puts $out { puts "normal message from pipe" puts stderr "error message from pipe" exit 1 } proc readit {pipe} { variable x variable result if {[eof $pipe]} { set x [catch {close $pipe} line] lappend result catch $line } else { gets $pipe line lappend result gets $line } } close $out set pipe [open "|[list [interpreter] $path(script)]" r] fileevent $pipe readable [namespace code [list readit $pipe]] variable x "" set result "" vwait [namespace which -variable x] list $x $result } {1 {gets {normal message from pipe} gets {} catch {error message from pipe}}} test io-59.1 {Thread reference of channels} {testmainthread testchannel} { # TIP #10 # More complicated tests (like that the reference changes as a # channel is moved from thread to thread) can be done only in the # extension which fully implements the moving of channels between # threads, i.e. 'Threads'. set f [open $path(longfile) r] set result [testchannel mthread $f] close $f string equal $result [testmainthread] } {1} test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # This test will hang in older revisions of the core. set out [open $path(script) w] puts $out "catch {load $::tcltestlib Tcltest}" puts $out { puts ABC[testbytestring \xE2] exit 1 } proc readit {pipe} { variable x variable result if {[eof $pipe]} { set x [catch {close $pipe} line] lappend result catch $line } else { gets $pipe line lappend result gets $line } } close $out set pipe [open "|[list [interpreter] $path(script)]" r] fileevent $pipe readable [namespace code [list readit $pipe]] variable x "" set result "" vwait [namespace which -variable x] # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result } {1 {gets ABC catch {error writing "stdout": invalid or incomplete multibyte or wide character}}} test io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] set f [open $datafile w] fconfigure $f -translation binary puts -nonewline $f [string repeat "Ho hum\n" 11] puts $f = set line [string repeat "Ge gla " 4] puts -nonewline $f [string repeat [string trimright $line]\n 834] close $f } -body { set f [open $datafile r] fconfigure $f -eofchar = set res {} lappend res [read $f; tell $f] fconfigure $f -eofchar {} lappend res [read $f 1] lappend res [read $f; tell $f] # Any seek zaps the internals into a good state. #seek $f 0 start #seek $f 0 current #lappend res [read $f; tell $f] close $f set res } -cleanup { removeFile eofchar } -result {77 = 23431} # Test the cutting and splicing of channels, this is incidentally the # attach/detach facility of package Thread, but __without any # safeguards__. It can also be used to emulate transfer of channels # between threads, and is used for that here. test io-70.0 {Cutting & Splicing channels} {testchannel} { set f [makeFile {... dummy ...} cutsplice] set c [open $f r] set res {} lappend res [catch {seek $c 0 start}] testchannel cut $c lappend res [catch {seek $c 0 start}] testchannel splice $c lappend res [catch {seek $c 0 start}] close $c removeFile cutsplice set res } {0 1 0} test io-70.1 {Transfer channel} {testchannel thread} { set f [makeFile {... dummy ...} cutsplice] set c [open $f r] set res {} lappend res [catch {seek $c 0 start}] testchannel cut $c lappend res [catch {seek $c 0 start}] set tid [thread::create -preserved] thread::send $tid [list set c $c] thread::send $tid {load {} Tcltest} lappend res [thread::send $tid { testchannel splice $c set res [catch {seek $c 0 start}] close $c set res }] thread::release $tid removeFile cutsplice set res } {0 1 0} # ### ### ### ######### ######### ######### foreach {n msg expected} { 0 {} {} 1 {{message only}} {{message only}} 2 {-options x} {-options x} 3 {-options {x y} {the message}} {-options {x y} {the message}} 4 {-code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 5 {-code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 6 {-code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 7 {-code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 8 {-code error -level 0 -f ba snarf} {-code error -level 0 -f ba snarf} 9 {-code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 10 {-code error -level 5 -f ba snarf} {-code error -level 0 -f ba snarf} 11 {-code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 12 {-code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 13 {-code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 14 {-code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} 15 {-code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 16 {-code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} 17 {-code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 18 {-code error -level 0 -f ba} {-code error -level 0 -f ba} 19 {-code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 20 {-code error -level 5 -f ba} {-code error -level 0 -f ba} 21 {-code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 22 {-code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 23 {-code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 24 {-code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 25 {-code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 26 {-code error -level X -f ba snarf} {-code error -level 0 -f ba snarf} 27 {-code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 28 {-code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 29 {-code 1 -level X -f ba} {-code 1 -level 0 -f ba} 30 {-code 0 -level X -f ba} {-code 1 -level 0 -f ba} 31 {-code error -level X -f ba} {-code error -level 0 -f ba} 32 {-code ok -level X -f ba} {-code 1 -level 0 -f ba} 33 {-code boss -level X -f ba} {-code 1 -level 0 -f ba} 34 {-code 1 -code 1 -level 0 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 35 {-code 1 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 36 {-code 1 -code 1 -level 5 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 37 {-code 1 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 38 {-code 1 -code error -level 0 -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 39 {-code 1 -code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 40 {-code 1 -code error -level 5 -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 41 {-code 1 -code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 42 {-code 1 -code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 43 {-code 1 -code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 44 {-code 1 -code 1 -level 0 -f ba} {-code 1 -code 1 -level 0 -f ba} 45 {-code 1 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 46 {-code 1 -code 1 -level 5 -f ba} {-code 1 -code 1 -level 0 -f ba} 47 {-code 1 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 48 {-code 1 -code error -level 0 -f ba} {-code 1 -code error -level 0 -f ba} 49 {-code 1 -code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 50 {-code 1 -code error -level 5 -f ba} {-code 1 -code error -level 0 -f ba} 51 {-code 1 -code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 52 {-code 1 -code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 53 {-code 1 -code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 54 {-code 1 -code 1 -level X -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 55 {-code 1 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 56 {-code 1 -code error -level X -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 57 {-code 1 -code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 58 {-code 1 -code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 59 {-code 1 -code 1 -level X -f ba} {-code 1 -code 1 -level 0 -f ba} 60 {-code 1 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} 61 {-code 1 -code error -level X -f ba} {-code 1 -code error -level 0 -f ba} 62 {-code 1 -code ok -level X -f ba} {-code 1 -level 0 -f ba} 63 {-code 1 -code boss -level X -f ba} {-code 1 -level 0 -f ba} 64 {-code 0 -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 65 {-code 0 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 66 {-code 0 -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 67 {-code 0 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 68 {-code 0 -code error -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 69 {-code 0 -code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 70 {-code 0 -code error -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 71 {-code 0 -code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 72 {-code 0 -code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 73 {-code 0 -code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 74 {-code 0 -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} 75 {-code 0 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 76 {-code 0 -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} 77 {-code 0 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 78 {-code 0 -code error -level 0 -f ba} {-code 1 -level 0 -f ba} 79 {-code 0 -code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 80 {-code 0 -code error -level 5 -f ba} {-code 1 -level 0 -f ba} 81 {-code 0 -code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 82 {-code 0 -code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 83 {-code 0 -code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 84 {-code 0 -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 85 {-code 0 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 86 {-code 0 -code error -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 87 {-code 0 -code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 88 {-code 0 -code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 89 {-code 0 -code 1 -level X -f ba} {-code 1 -level 0 -f ba} 90 {-code 0 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} 91 {-code 0 -code error -level X -f ba} {-code 1 -level 0 -f ba} 92 {-code 0 -code ok -level X -f ba} {-code 1 -level 0 -f ba} 93 {-code 0 -code boss -level X -f ba} {-code 1 -level 0 -f ba} 94 {-code 1 -code 1 -level 0 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 95 {-code 0 -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 96 {-code 1 -code 1 -level 5 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 97 {-code 0 -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 98 {-code error -code 1 -level 0 -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} 99 {-code ok -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} a0 {-code error -code 1 -level 5 -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} a1 {-code ok -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} a2 {-code boss -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} a3 {-code boss -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} a4 {-code 1 -code 1 -level 0 -f ba} {-code 1 -code 1 -level 0 -f ba} a5 {-code 0 -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} a6 {-code 1 -code 1 -level 5 -f ba} {-code 1 -code 1 -level 0 -f ba} a7 {-code 0 -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} a8 {-code error -code 1 -level 0 -f ba} {-code error -code 1 -level 0 -f ba} a9 {-code ok -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} b0 {-code error -code 1 -level 5 -f ba} {-code error -code 1 -level 0 -f ba} b1 {-code ok -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} b2 {-code boss -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} b3 {-code boss -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} b4 {-code 1 -code 1 -level X -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} b5 {-code 0 -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b6 {-code error -code 1 -level X -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} b7 {-code ok -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b8 {-code boss -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b9 {-code 1 -code 1 -level X -f ba} {-code 1 -code 1 -level 0 -f ba} c0 {-code 0 -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c1 {-code error -code 1 -level X -f ba} {-code error -code 1 -level 0 -f ba} c2 {-code ok -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c3 {-code boss -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c4 {-code 1 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c5 {-code 0 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c6 {-code 1 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} c7 {-code 0 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} c8 {-code error -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c9 {-code ok -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} d0 {-code error -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d1 {-code ok -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d2 {-code boss -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} d3 {-code boss -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d4 {-code 1 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d5 {-code 0 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d6 {-code 1 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} d7 {-code 0 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} d8 {-code error -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d9 {-code ok -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} e0 {-code error -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e1 {-code ok -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e2 {-code boss -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} e3 {-code boss -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e4 {-code 1 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e5 {-code 0 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e6 {-code error -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e7 {-code ok -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e8 {-code boss -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e9 {-code 1 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f0 {-code 0 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f1 {-code error -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f2 {-code ok -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f3 {-code boss -code 0 -level X -f ba} {-code 1 -level 0 -f ba} } { test io-71.$n {Tcl_SetChannelError} {testchannel} { set f [makeFile {... dummy ...} cutsplice] set c [open $f r] set res [testchannel setchannelerror $c [lrange $msg 0 end]] close $c removeFile cutsplice set res } [lrange $expected 0 end] test io-72.$n {Tcl_SetChannelErrorInterp} {testchannel} { set f [makeFile {... dummy ...} cutsplice] set c [open $f r] set res [testchannel setchannelerrorinterp $c [lrange $msg 0 end]] close $c removeFile cutsplice set res } [lrange $expected 0 end] } test io-73.1 {channel Tcl_Obj SetChannelFromAny} {} { # Test for Bug 1847044 - don't spoil type unless we have a valid channel catch {close [lreplace [list a] 0 end]} } {1} test io-73.2 {channel Tcl_Obj SetChannelFromAny, bug 2407783} -setup { # Invalidate internalrep of 'channel' Tcl_Obj when transiting between interpreters. set f [open [info script] r] } -body { interp create foo seek $f 0 set code [catch {interp eval foo [list seek $f 0]} msg] # The string map converts the changing channel handle to a fixed string list $code [string map [list $f @@] $msg] } -cleanup { close $f } -result {1 {can not find channel named "@@"}} test io-73.3 {[5adc350683] [gets] after EOF} -setup { set fn [makeFile {} io-73.3] set rfd [open $fn r] set wfd [open $fn a] chan configure $wfd -buffering line read $rfd } -body { set result [eof $rfd] puts $wfd "more data" lappend result [eof $rfd] lappend result [gets $rfd] lappend result [eof $rfd] lappend result [gets $rfd] lappend result [eof $rfd] } -cleanup { close $wfd close $rfd removeFile io-73.3 } -result {1 1 {more data} 0 {} 1} test io-73.4 {[5adc350683] [read] after EOF} -setup { set fn [makeFile {} io-73.4] set rfd [open $fn r] set wfd [open $fn a] chan configure $wfd -buffering line read $rfd } -body { set result [eof $rfd] puts $wfd "more data" lappend result [eof $rfd] lappend result [read $rfd] lappend result [eof $rfd] } -cleanup { close $wfd close $rfd removeFile io-73.4 } -result {1 1 {more data } 1} test io-73.5 {effect of eof on encoding end flags} -setup { set fn [makeFile {} io-73.5] set rfd [open $fn r] set wfd [open $fn a] chan configure $wfd -buffering none -translation binary chan configure $rfd -buffersize 5 -encoding utf-8 read $rfd } -body { set result [eof $rfd] puts -nonewline $wfd more\xC2\xA0data lappend result [eof $rfd] lappend result [read $rfd] lappend result [eof $rfd] } -cleanup { close $wfd close $rfd removeFile io-73.5 } -result [list 1 1 more\xA0data 1] test io-74.1 {[104f2885bb] improper cache validity check} -setup { set fn [makeFile {} io-74.1] set rfd [open $fn r] testobj freeallvars interp create child } -constraints testobj -body { teststringobj set 1 [string range $rfd 0 end] read [teststringobj get 1] testobj duplicate 1 2 interp transfer {} $rfd child catch {read [teststringobj get 1]} read [teststringobj get 2] } -cleanup { interp delete child testobj freeallvars removeFile io-74.1 } -returnCodes error -match glob -result {can not find channel named "*"} test io-75.1 {multibyte encoding error read results in raw bytes (-profile tcl8)} -setup { set fn [makeFile {} io-75.1] set f [open $fn w+] fconfigure $f -translation binary # In UTF-8, a byte 0xCx starts a multibyte sequence and must be followed # by a byte > 0x7F. This is violated to get an invalid sequence. puts -nonewline $f A\xC0\x40 flush $f seek $f 0 fconfigure $f -encoding utf-8 -profile tcl8 -buffering none } -body { set d [read $f] binary scan $d H* hd set hd } -cleanup { close $f removeFile io-75.1 } -result 41c040 test io-75.2 {unrepresentable character write passes and is replaced by ? (-profile tcl8)} -setup { set fn [makeFile {} io-75.2] set f [open $fn w+] fconfigure $f -encoding iso8859-1 -profile tcl8 } -body { puts -nonewline $f A\u2022 flush $f seek $f 0 read $f } -cleanup { close $f removeFile io-75.2 } -result A? # Incomplete sequence test. # This error may IMHO only be detected with the close. # But the read already returns the incomplete sequence. test io-75.3 {incomplete multibyte encoding read is ignored (-profile tcl8)} -setup { set fn [makeFile {} io-75.3] set f [open $fn w+] fconfigure $f -translation binary puts -nonewline $f "A\xC0" flush $f seek $f 0 fconfigure $f -encoding utf-8 -buffering none -profile tcl8 } -body { set d [read $f] binary scan $d H* hd set hd } -cleanup { close $f removeFile io-75.3 } -result 41c0 # As utf-8 has a special treatment in multi-byte decoding, also test another # one. test io-75.4 {shiftjis encoding error read results in raw bytes (-profile tcl8)} -setup { set fn [makeFile {} io-75.4] set f [open $fn w+] fconfigure $f -translation binary # In shiftjis, \x81 starts a two-byte sequence. # But 2nd byte \xFF is not allowed puts -nonewline $f A\x81\xFFA flush $f seek $f 0 fconfigure $f -encoding shiftjis -buffering none -eofchar "" -translation lf -profile tcl8 } -body { set d [read $f] binary scan $d H* hd set hd } -cleanup { close $f removeFile io-75.4 } -result 4181ff41 test io-75.5 {invalid utf-8 encoding read is ignored (-profile tcl8)} -setup { set fn [makeFile {} io-75.5] set f [open $fn w+] fconfigure $f -translation binary puts -nonewline $f A\x81 flush $f seek $f 0 fconfigure $f -encoding utf-8 -buffering none -eofchar "" -translation lf -profile tcl8 } -body { set d [read $f] binary scan $d H* hd set hd } -cleanup { close $f removeFile io-75.5 } -result 4181 test io-75.6 {incomplete utf-8 encoding, blocking gets is not ignored (-profile strict)} -setup { set fn [makeFile {} io-75.6] set f [open $fn w+] fconfigure $f -translation binary # \x81 is an incomplete byte sequence in utf-8 puts -nonewline $f A\x81 flush $f seek $f 0 fconfigure $f -encoding utf-8 -buffering none \ -translation lf -profile strict } -body { gets $f } -cleanup { close $f removeFile io-75.6 } -match glob -returnCodes 1 -result {error reading "file*":\ invalid or incomplete multibyte or wide character} test io-75.6.1 {invalid utf-8 encoding, blocking gets is not ignored (-profile strict)} -setup { set fn [makeFile {} io-75.6.1] set f [open $fn w+] fconfigure $f -translation binary # utf-8: \xC3 requires a 2nd byte > x80, but x80, but x80, but 1} {set l [lindex $args 1]} try { while {[string length $e] < $l} { append e [read {*}$args] after 10; update } set e } finally { after cancel $timer unset -nocomplain e } } test io-bug-73bb42fb-1 { Non-blocking+buffer size+encoding error panic - TCL bug 73bb42fb. Verify error at offset 0. } -setup { writeFile $path(test1) binary \xD6[string repeat _ 20] } -body { set fd [open $path(test1)] fconfigure $fd -encoding utf-8 -profile strict -blocking 0 -buffersize 10 -translation lf -eofchar {} list [catch {read_blocked $fd 1} e d] $e [dict getd $d -code ""] [dict getd $d -errorcode ""] [tell $fd] } -cleanup { close $fd } -match glob -result {1 {error reading *} 1 {POSIX EILSEQ {invalid or incomplete multibyte or wide character}} 0} test io-bug-73bb43fb-2 { Non-blocking+buffer size+encoding error panic - TCL bug 73bb42fb. Verify valid data returned before error generated. } -setup { writeFile $path(test1) binary X\xD6[string repeat _ 20] } -body { set fd [open $path(test1)] fconfigure $fd -encoding utf-8 -profile strict -blocking 0 -buffersize 10 -translation lf -eofchar {} set result {} lappend result [read_blocked $fd] lappend result [tell $fd] lappend result [catch {read_blocked $fd} e d] $e [dict getd $d -code ""] [dict getd $d -errorcode ""] [tell $fd] } -cleanup { close $fd } -match glob -result {X 1 1 {error reading *} 1 {POSIX EILSEQ {invalid or incomplete multibyte or wide character}} 1} test io-bug-73bb43fb-3 { Non-blocking+buffer size+encoding error panic - TCL bug 73bb42fb. Modified Sergey's repro script from ticket. Check no crash / error. } -setup { set f "" } -body { set f [open [list | [info nameofexecutable] << {fconfigure stdout -translation binary; puts \xD6[string repeat _ 20]}]] fconfigure $f -encoding utf-8 -profile strict -blocking 0 -buffersize 10 -translation lf -eofchar {} list [catch { read_blocked $f } e d] $e [dict getd $d -code ""] [dict getd $d -errorcode ""] } -cleanup { if {$f ne ""} {close $f} } -match glob -result {1 {error reading *} 1 {POSIX EILSEQ {invalid or incomplete multibyte or wide character}}} test io-bug-73bb43fb-4 { Non-blocking+buffer size+encoding error panic - TCL bug 73bb42fb. (PoC) Delay between bytes of single utf-8 char doesn't cause encoding error with profile strict. } -setup { set f "" } -body { set f [open [list | [info nameofexecutable] << { fconfigure stdout -translation binary puts -nonewline "START-"; flush stdout foreach {ch} [split [encoding convertto utf-8 \u30B3] ""] {; # 3 bytes E3 82 B3 puts -nonewline $ch; flush stdout; if {$ch ne "\xB3"} {after 100} } puts -nonewline "-DONE"; flush stdout }]] fconfigure $f -encoding utf-8 -profile strict -blocking 0 -buffersize 10 -translation lf -eofchar {} list [catch { read_blocked $f 12 } e d] $e [dict getd $d -code ""] [dict getd $d -errorcode ""] } -cleanup { if {$f ne ""} {close $f} } -result "0 START-\u30B3-DONE 0 {}" rename read_blocked {} # cleanup foreach file [list fooBar longfile script2 output test1 pipe my_script \ test2 test3 cat stdout kyrillic.txt utf8-fcopy.txt utf8-rp.txt] { removeFile $file } cleanupTests } namespace delete ::tcl::test::io return tcl9.0.3/tests/interp.test0000644000175000017500000031744615104661341015132 0ustar sergeisergei# This file tests the multiple interpreter facility of Tcl # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testinterpdelete [llength [info commands testinterpdelete]] set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source tcl:encoding:dirs tcl:encoding:system tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:home tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempdir tcl:file:tempfile tcl:file:tildeexpand tcl:file:type tcl:file:volumes tcl:file:writable tcl:info:cmdtype tcl:info:nameofexecutable tcl:process:autopurge tcl:process:list tcl:process:purge tcl:process:status tcl:zipfs:canonical tcl:zipfs:exists tcl:zipfs:info tcl:zipfs:list tcl:zipfs:lmkimg tcl:zipfs:lmkzip tcl:zipfs:mkimg tcl:zipfs:mkkey tcl:zipfs:mkzip tcl:zipfs:mount tcl:zipfs:mountdata tcl:zipfs:root tcl:zipfs:unmount unload zipfs} proc _ms_limit_args {ms {t0 {}}} { if {$t0 eq {}} { set t0 [clock milliseconds] } incr t0 $ms list -seconds [expr {$t0 / 1000}] -milliseconds [expr {$t0 % 1000}] } foreach i [interp children] { interp delete $i } # Part 0: Check out options for interp command test interp-1.1 {options for interp command} -returnCodes error -body { interp } -result {wrong # args: should be "interp cmd ?arg ...?"} test interp-1.2 {options for interp command} -returnCodes error -body { interp frobox } -result {bad option "frobox": must be alias, aliases, bgerror, cancel, children, create, debug, delete, eval, exists, expose, hide, hidden, issafe, invokehidden, limit, marktrusted, recursionlimit, share, target, or transfer} test interp-1.3 {options for interp command} { interp delete } "" test interp-1.4 {options for interp command} -returnCodes error -body { interp delete foo bar } -result {could not find interpreter "foo"} test interp-1.5 {options for interp command} -returnCodes error -body { interp exists foo bar } -result {wrong # args: should be "interp exists ?path?"} # # test interp-0.6 was removed # test interp-1.6 {options for interp command} -returnCodes error -body { interp children foo bar zop } -result {wrong # args: should be "interp children ?path?"} test interp-1.7 {options for interp command} -returnCodes error -body { interp hello } -result {bad option "hello": must be alias, aliases, bgerror, cancel, children, create, debug, delete, eval, exists, expose, hide, hidden, issafe, invokehidden, limit, marktrusted, recursionlimit, share, target, or transfer} test interp-1.8 {options for interp command} -returnCodes error -body { interp -froboz } -result {bad option "-froboz": must be alias, aliases, bgerror, cancel, children, create, debug, delete, eval, exists, expose, hide, hidden, issafe, invokehidden, limit, marktrusted, recursionlimit, share, target, or transfer} test interp-1.9 {options for interp command} -returnCodes error -body { interp -froboz -safe } -result {bad option "-froboz": must be alias, aliases, bgerror, cancel, children, create, debug, delete, eval, exists, expose, hide, hidden, issafe, invokehidden, limit, marktrusted, recursionlimit, share, target, or transfer} test interp-1.10 {options for interp command} -returnCodes error -body { interp target } -result {wrong # args: should be "interp target path alias"} # Part 1: Basic interpreter creation tests: test interp-2.1 {basic interpreter creation} { interp create a } a test interp-2.2 {basic interpreter creation} { catch {interp create} } 0 test interp-2.3 {basic interpreter creation} { catch {interp create -safe} } 0 test interp-2.4 {basic interpreter creation} -setup { catch {interp create a} } -returnCodes error -body { interp create a } -result {interpreter named "a" already exists, cannot create} test interp-2.5 {basic interpreter creation} { interp create b -safe } b test interp-2.6 {basic interpreter creation} { interp create d -safe } d test interp-2.7 {basic interpreter creation} { list [catch {interp create -froboz} msg] $msg } {1 {bad option "-froboz": must be -safe or --}} test interp-2.8 {basic interpreter creation} { interp create -- -froboz } -froboz test interp-2.9 {basic interpreter creation} { interp create -safe -- -froboz1 } -froboz1 test interp-2.10 {basic interpreter creation} -setup { catch {interp create a} } -body { interp create {a x1} interp create {a x2} interp create {a x3} -safe } -result {a x3} test interp-2.11 {anonymous interps vs existing procs} { set x [interp create] regexp "interp(\[0-9]+)" $x dummy thenum interp delete $x proc interp$thenum {} {} set x [interp create] regexp "interp(\[0-9]+)" $x dummy anothernum expr {$anothernum > $thenum} } 1 test interp-2.12 {anonymous interps vs existing procs} { set x [interp create -safe] regexp "interp(\[0-9]+)" $x dummy thenum interp delete $x proc interp$thenum {} {} set x [interp create -safe] regexp "interp(\[0-9]+)" $x dummy anothernum expr {$anothernum - $thenum} } 1 test interp-2.13 {correct default when no $path arg is given} -body { interp create -- } -match regexp -result {interp[0-9]+} foreach i [interp children] { interp delete $i } # Part 2: Testing "interp children" and "interp exists" test interp-3.1 {testing interp exists and interp children} { interp children } "" test interp-3.2 {testing interp exists and interp children} { interp create a interp exists a } 1 test interp-3.3 {testing interp exists and interp children} { interp exists nonexistent } 0 test interp-3.4 {testing interp exists and interp children} -body { interp children a b c } -returnCodes error -result {wrong # args: should be "interp children ?path?"} test interp-3.5 {testing interp exists and interp children} -body { interp exists a b c } -returnCodes error -result {wrong # args: should be "interp exists ?path?"} test interp-3.6 {testing interp exists and interp children} { interp exists } 1 test interp-3.7 {testing interp exists and interp children} -setup { catch {interp create a} } -body { interp children } -result a test interp-3.8 {testing interp exists and interp children} -body { interp children a b c } -returnCodes error -result {wrong # args: should be "interp children ?path?"} test interp-3.9 {testing interp exists and interp children} -setup { catch {interp create a} } -body { interp create {a a2} -safe expr {"a2" in [interp children a]} } -result 1 test interp-3.10 {testing interp exists and interp children} -setup { catch {interp create a} catch {interp create {a a2}} } -body { interp exists {a a2} } -result 1 # Part 3: Testing "interp delete" test interp-3.11 {testing interp delete} { interp delete } "" test interp-4.1 {testing interp delete} { catch {interp create a} interp delete a } "" test interp-4.2 {testing interp delete} -returnCodes error -body { interp delete nonexistent } -result {could not find interpreter "nonexistent"} test interp-4.3 {testing interp delete} -returnCodes error -body { interp delete x y z } -result {could not find interpreter "x"} test interp-4.4 {testing interp delete} { interp delete } "" test interp-4.5 {testing interp delete} { interp create a interp create {a x1} interp delete {a x1} expr {"x1" in [interp children a]} } 0 test interp-4.6 {testing interp delete} { interp create c1 interp create c2 interp create c3 interp delete c1 c2 c3 } "" test interp-4.7 {testing interp delete} -returnCodes error -body { interp create c1 interp create c2 interp delete c1 c2 c3 } -result {could not find interpreter "c3"} test interp-4.8 {testing interp delete} -returnCodes error -body { interp delete {} } -result {cannot delete the current interpreter} foreach i [interp children] { interp delete $i } # Part 4: Consistency checking - all nondeleted interpreters should be # there: test interp-5.1 {testing consistency} { interp children } "" test interp-5.2 {testing consistency} { interp exists a } 0 test interp-5.3 {testing consistency} { interp exists nonexistent } 0 # Recreate interpreter "a" interp create a # Part 5: Testing eval in interpreter object command and with interp command test interp-6.1 {testing eval} { a eval expr {{3 + 5}} } 8 test interp-6.2 {testing eval} -returnCodes error -body { a eval foo } -result {invalid command name "foo"} test interp-6.3 {testing eval} { a eval {proc foo {} {expr {3 + 5}}} a eval foo } 8 catch {a eval {proc foo {} {expr {3 + 5}}}} test interp-6.4 {testing eval} { interp eval a foo } 8 test interp-6.5 {testing eval} { interp create {a x2} interp eval {a x2} {proc frob {} {expr {4 * 9}}} interp eval {a x2} frob } 36 catch {interp create {a x2}} test interp-6.6 {testing eval} -returnCodes error -body { interp eval {a x2} foo } -result {invalid command name "foo"} # UTILITY PROCEDURE RUNNING IN PARENT INTERPRETER: proc in_parent {args} { return [list seen in parent: $args] } # Part 6: Testing basic alias creation test interp-7.1 {testing basic alias creation} { a alias foo in_parent } foo catch {a alias foo in_parent} test interp-7.2 {testing basic alias creation} { a alias bar in_parent a1 a2 a3 } bar catch {a alias bar in_parent a1 a2 a3} # Test 6.3 has been deleted. test interp-7.3 {testing basic alias creation} { a alias foo } in_parent test interp-7.4 {testing basic alias creation} { a alias bar } {in_parent a1 a2 a3} test interp-7.5 {testing basic alias creation} { lsort [a aliases] } {bar foo} test interp-7.6 {testing basic aliases arg checking} -returnCodes error -body { a aliases too many args } -result {wrong # args: should be "a aliases"} # Part 7: testing basic alias invocation test interp-8.1 {testing basic alias invocation} { catch {interp create a} a alias foo in_parent a eval foo s1 s2 s3 } {seen in parent: {s1 s2 s3}} test interp-8.2 {testing basic alias invocation} { catch {interp create a} a alias bar in_parent a1 a2 a3 a eval bar s1 s2 s3 } {seen in parent: {a1 a2 a3 s1 s2 s3}} test interp-8.3 {testing basic alias invocation} -returnCodes error -body { catch {interp create a} a alias } -result {wrong # args: should be "a alias aliasName ?targetName? ?arg ...?"} # Part 8: Testing aliases for non-existent or hidden targets test interp-9.1 {testing aliases for non-existent targets} { catch {interp create a} a alias zop nonexistent-command-in-parent list [catch {a eval zop} msg] $msg } {1 {invalid command name "nonexistent-command-in-parent"}} test interp-9.2 {testing aliases for non-existent targets} { catch {interp create a} a alias zop nonexistent-command-in-parent proc nonexistent-command-in-parent {} {return i_exist!} a eval zop } i_exist! test interp-9.3 {testing aliases for hidden commands} { catch {interp create a} a eval {proc p {} {return ENTER_A}} interp alias {} p a p set res {} lappend res [list [catch p msg] $msg] interp hide a p lappend res [list [catch p msg] $msg] rename p {} interp delete a set res } {{0 ENTER_A} {1 {invalid command name "p"}}} test interp-9.4 {testing aliases and namespace commands} { proc p {} {return GLOBAL} namespace eval tst { proc p {} {return NAMESPACE} } interp alias {} a {} p set res [a] lappend res [namespace eval tst a] rename p {} rename a {} namespace delete tst set res } {GLOBAL GLOBAL} if {[info command nonexistent-command-in-parent] ne ""} { rename nonexistent-command-in-parent {} } # Part 9: Aliasing between interpreters test interp-10.1 {testing aliasing between interpreters} { catch {interp delete a} catch {interp delete b} interp create a interp create b interp alias a a_alias b b_alias 1 2 3 } a_alias test interp-10.2 {testing aliasing between interpreters} { catch {interp delete a} catch {interp delete b} interp create a interp create b b eval {proc b_alias {args} {return [list got $args]}} interp alias a a_alias b b_alias 1 2 3 a eval a_alias a b c } {got {1 2 3 a b c}} test interp-10.3 {testing aliasing between interpreters} { catch {interp delete a} catch {interp delete b} interp create a interp create b interp alias a a_alias b b_alias 1 2 3 list [catch {a eval a_alias a b c} msg] $msg } {1 {invalid command name "b_alias"}} test interp-10.4 {testing aliasing between interpreters} { catch {interp delete a} interp create a a alias a_alias puts a aliases } a_alias test interp-10.5 {testing aliasing between interpreters} { catch {interp delete a} catch {interp delete b} interp create a interp create b a alias a_alias puts interp alias a a_del b b_del interp delete b a aliases } a_alias test interp-10.6 {testing aliasing between interpreters} { catch {interp delete a} catch {interp delete b} interp create a interp create b interp alias a a_command b b_command a1 a2 a3 b alias b_command in_parent b1 b2 b3 a eval a_command m1 m2 m3 } {seen in parent: {b1 b2 b3 a1 a2 a3 m1 m2 m3}} test interp-10.7 {testing aliases between interpreters} { catch {interp delete a} interp create a interp alias "" foo a zoppo a eval {proc zoppo {x} {list $x $x $x}} set x [foo 33] a eval {rename zoppo {}} interp alias "" foo a {} return $x } {33 33 33} # Part 10: Testing "interp target" test interp-11.1 {testing interp target} { list [catch {interp target} msg] $msg } {1 {wrong # args: should be "interp target path alias"}} test interp-11.2 {testing interp target} { list [catch {interp target nosuchinterpreter foo} msg] $msg } {1 {could not find interpreter "nosuchinterpreter"}} test interp-11.3 {testing interp target} { catch {interp delete a} interp create a a alias boo no_command interp target a boo } "" test interp-11.4 {testing interp target} { catch {interp delete x1} interp create x1 x1 eval interp create x2 x1 eval x2 eval interp create x3 catch {interp delete y1} interp create y1 y1 eval interp create y2 y1 eval y2 eval interp create y3 interp alias {x1 x2 x3} xcommand {y1 y2 y3} ycommand interp target {x1 x2 x3} xcommand } {y1 y2 y3} test interp-11.5 {testing interp target} { catch {interp delete x1} interp create x1 interp create {x1 x2} interp create {x1 x2 x3} catch {interp delete y1} interp create y1 interp create {y1 y2} interp create {y1 y2 y3} interp alias {x1 x2 x3} xcommand {y1 y2 y3} ycommand list [catch {x1 eval {interp target {x2 x3} xcommand}} msg] $msg } {1 {target interpreter for alias "xcommand" in path "x2 x3" is not my descendant}} test interp-11.6 {testing interp target} { foreach a [interp aliases] { rename $a {} } list [catch {interp target {} foo} msg] $msg } {1 {alias "foo" in path "" not found}} test interp-11.7 {testing interp target} { catch {interp delete a} interp create a list [catch {interp target a foo} msg] $msg } {1 {alias "foo" in path "a" not found}} # Part 11: testing "interp issafe" test interp-12.1 {testing interp issafe} { interp issafe } 0 test interp-12.2 {testing interp issafe} { catch {interp delete a} interp create a interp issafe a } 0 test interp-12.3 {testing interp issafe} { catch {interp delete a} interp create a interp create {a x3} -safe interp issafe {a x3} } 1 test interp-12.4 {testing interp issafe} { catch {interp delete a} interp create a interp create {a x3} -safe interp create {a x3 foo} interp issafe {a x3 foo} } 1 # Part 12: testing interpreter object command "issafe" sub-command test interp-13.1 {testing foo issafe} { catch {interp delete a} interp create a a issafe } 0 test interp-13.2 {testing foo issafe} { catch {interp delete a} interp create a interp create {a x3} -safe a eval x3 issafe } 1 test interp-13.3 {testing foo issafe} { catch {interp delete a} interp create a interp create {a x3} -safe interp create {a x3 foo} a eval x3 eval foo issafe } 1 test interp-13.4 {testing issafe arg checking} { catch {interp create a} list [catch {a issafe too many args} msg] $msg } {1 {wrong # args: should be "a issafe"}} # part 14: testing interp aliases test interp-14.1 {testing interp aliases} -setup { interp create abc } -body { interp eval abc {interp aliases} } -cleanup { interp delete abc } -result "" test interp-14.2 {testing interp aliases} { catch {interp delete a} interp create a a alias a1 puts a alias a2 puts a alias a3 puts lsort [interp aliases a] } {a1 a2 a3} test interp-14.3 {testing interp aliases} { catch {interp delete a} interp create a interp create {a x3} interp alias {a x3} froboz "" puts interp aliases {a x3} } froboz test interp-14.4 {testing interp alias - alias over parent} { # SF Bug 641195 catch {interp delete a} interp create a list [catch {interp alias "" a a eval} msg] $msg [info commands a] } {1 {cannot define or rename alias "a": interpreter deleted} {}} test interp-14.5 {testing interp-alias: wrong # args} -body { proc setx x {set x} interp alias {} a {} setx catch {a 1 2} set ::errorInfo } -cleanup { rename setx {} rename a {} } -result {wrong # args: should be "a x" while executing "a 1 2"} test interp-14.6 {testing interp-alias: wrong # args} -setup { proc setx x {set x} catch {interp delete a} interp create a } -body { interp alias a a {} setx catch {a eval a 1 2} set ::errorInfo } -cleanup { rename setx {} interp delete a } -result {wrong # args: should be "a x" invoked from within "a 1 2" invoked from within "a eval a 1 2"} test interp-14.7 {testing interp-alias: wrong # args} -setup { proc setx x {set x} catch {interp delete a} interp create a } -body { interp alias a a {} setx a eval { catch {a 1 2} set ::errorInfo } } -cleanup { rename setx {} interp delete a } -result {wrong # args: should be "a x" invoked from within "a 1 2"} test interp-14.8 {testing interp-alias: error messages} -body { proc setx x {return -code error x} interp alias {} a {} setx catch {a 1} set ::errorInfo } -cleanup { rename setx {} rename a {} } -result {x while executing "a 1"} test interp-14.9 {testing interp-alias: error messages} -setup { proc setx x {return -code error x} catch {interp delete a} interp create a } -body { interp alias a a {} setx catch {a eval a 1} set ::errorInfo } -cleanup { rename setx {} interp delete a } -result {x invoked from within "a 1" invoked from within "a eval a 1"} test interp-14.10 {testing interp-alias: error messages} -setup { proc setx x {return -code error x} catch {interp delete a} interp create a } -body { interp alias a a {} setx a eval { catch {a 1} set ::errorInfo } } -cleanup { rename setx {} interp delete a } -result {x invoked from within "a 1"} test interp-14.11 {{interp alias} {target named the empty string} {bug 2bf56185}} -setup { set interp [interp create [info cmdcount]] interp eval $interp { proc {} args {return $args} } } -body { interp alias {} p1 $interp {} p1 one two three } -cleanup { interp delete $interp } -result {one two three} # part 15: testing file sharing test interp-15.1 {testing file sharing} { catch {interp delete z} interp create z z eval close stdout list [catch {z eval puts hello} msg] $msg } {1 {can not find channel named "stdout"}} test interp-15.2 {testing file sharing} -body { catch {interp delete z} interp create z set f [open [makeFile {} file-15.2] w] interp share "" $f z z eval puts $f hello z eval close $f close $f } -cleanup { removeFile file-15.2 } -result "" test interp-15.3 {testing file sharing} { catch {interp delete xsafe} interp create xsafe -safe list [catch {xsafe eval puts hello} msg] $msg } {1 {can not find channel named "stdout"}} test interp-15.4 {testing file sharing} -body { catch {interp delete xsafe} interp create xsafe -safe set f [open [makeFile {} file-15.4] w] interp share "" $f xsafe xsafe eval puts $f hello xsafe eval close $f close $f } -cleanup { removeFile file-15.4 } -result "" test interp-15.5 {testing file sharing} { catch {interp delete xsafe} interp create xsafe -safe interp share "" stdout xsafe list [catch {xsafe eval gets stdout} msg] $msg } {1 {channel "stdout" wasn't opened for reading}} test interp-15.6 {testing file sharing} -body { catch {interp delete xsafe} interp create xsafe -safe set f [open [makeFile {} file-15.6] w] interp share "" $f xsafe set x [list [catch [list xsafe eval gets $f] msg] $msg] xsafe eval close $f close $f string compare [string tolower $x] \ [list 1 [format "channel \"%s\" wasn't opened for reading" $f]] } -cleanup { removeFile file-15.6 } -result 0 test interp-15.7 {testing file transferring} -body { catch {interp delete xsafe} interp create xsafe -safe set f [open [makeFile {} file-15.7] w] interp transfer "" $f xsafe xsafe eval puts $f hello xsafe eval close $f } -cleanup { removeFile file-15.7 } -result "" test interp-15.8 {testing file transferring} -body { catch {interp delete xsafe} interp create xsafe -safe set f [open [makeFile {} file-15.8] w] interp transfer "" $f xsafe xsafe eval close $f set x [list [catch {close $f} msg] $msg] string compare [string tolower $x] \ [list 1 [format "can not find channel named \"%s\"" $f]] } -cleanup { removeFile file-15.8 } -result 0 # # Torture tests for interpreter deletion order # proc kill {} {interp delete xxx} test interp-16.0 {testing deletion order} { catch {interp delete xxx} interp create xxx xxx alias kill kill list [catch {xxx eval kill} msg] $msg } {0 {}} test interp-16.1 {testing deletion order} { catch {interp delete xxx} interp create xxx interp create {xxx yyy} interp alias {xxx yyy} kill "" kill list [catch {interp eval {xxx yyy} kill} msg] $msg } {0 {}} test interp-16.2 {testing deletion order} { catch {interp delete xxx} interp create xxx interp create {xxx yyy} interp alias {xxx yyy} kill "" kill list [catch {xxx eval yyy eval kill} msg] $msg } {0 {}} test interp-16.3 {testing deletion order} { catch {interp delete xxx} interp create xxx interp create ddd xxx alias kill kill interp alias ddd kill xxx kill set x [ddd eval kill] interp delete ddd set x } "" test interp-16.4 {testing deletion order} { catch {interp delete xxx} interp create xxx interp create {xxx yyy} interp alias {xxx yyy} kill "" kill interp create ddd interp alias ddd kill {xxx yyy} kill set x [ddd eval kill] interp delete ddd set x } "" test interp-16.5 {testing deletion order, bgerror} { catch {interp delete xxx} interp create xxx xxx eval {proc bgerror {args} {exit}} xxx alias exit kill xxx proc kill {i} {interp delete $i} xxx eval after 100 expr {a + b} after 200 update interp exists xxx } 0 # # Alias loop prevention testing. # test interp-17.1 {alias loop prevention} { list [catch {interp alias {} a {} a} msg] $msg } {1 {cannot define or rename alias "a": would create a loop}} test interp-17.2 {alias loop prevention} { catch {interp delete x} interp create x x alias a loop list [catch {interp alias {} loop x a} msg] $msg } {1 {cannot define or rename alias "loop": would create a loop}} test interp-17.3 {alias loop prevention} { catch {interp delete x} interp create x interp alias x a x b list [catch {interp alias x b x a} msg] $msg } {1 {cannot define or rename alias "b": would create a loop}} test interp-17.4 {alias loop prevention} { catch {interp delete x} interp create x interp alias x b x a list [catch {x eval rename b a} msg] $msg } {1 {cannot define or rename alias "a": would create a loop}} test interp-17.5 {alias loop prevention} { catch {interp delete x} interp create x x alias z l1 interp alias {} l2 x z list [catch {rename l2 l1} msg] $msg } {1 {cannot define or rename alias "l1": would create a loop}} test interp-17.6 {alias loop prevention} { catch {interp delete x} interp create x interp alias x a x b x eval rename a c list [catch {x eval rename c b} msg] $msg } {1 {cannot define or rename alias "b": would create a loop}} # # Test robustness of Tcl_DeleteInterp when applied to a child interpreter. # If there are bugs in the implementation these tests are likely to expose # the bugs as a core dump. # test interp-18.1 {testing Tcl_DeleteInterp vs children} testinterpdelete { list [catch {testinterpdelete} msg] $msg } {1 {wrong # args: should be "testinterpdelete path"}} test interp-18.2 {testing Tcl_DeleteInterp vs children} testinterpdelete { catch {interp delete a} interp create a testinterpdelete a } "" test interp-18.3 {testing Tcl_DeleteInterp vs children} testinterpdelete { catch {interp delete a} interp create a interp create {a b} testinterpdelete {a b} } "" test interp-18.4 {testing Tcl_DeleteInterp vs children} testinterpdelete { catch {interp delete a} interp create a interp create {a b} testinterpdelete a } "" test interp-18.5 {testing Tcl_DeleteInterp vs children} testinterpdelete { catch {interp delete a} interp create a interp create {a b} interp alias {a b} dodel {} dodel proc dodel {x} {testinterpdelete $x} list [catch {interp eval {a b} {dodel {a b}}} msg] $msg } {0 {}} test interp-18.6 {testing Tcl_DeleteInterp vs children} testinterpdelete { catch {interp delete a} interp create a interp create {a b} interp alias {a b} dodel {} dodel proc dodel {x} {testinterpdelete $x} list [catch {interp eval {a b} {dodel a}} msg] $msg } {0 {}} test interp-18.7 {eval in deleted interp} { catch {interp delete a} interp create a a eval { proc dodel {} { delme dosomething else } proc dosomething args { puts "I should not have been called!!" } } a alias delme dela proc dela {} {interp delete a} list [catch {a eval dodel} msg] $msg } {1 {attempt to call eval in deleted interpreter}} test interp-18.8 {eval in deleted interp} { catch {interp delete a} interp create a a eval { interp create b b eval { proc dodel {} { dela } } proc foo {} { b eval dela dosomething else } proc dosomething args { puts "I should not have been called!!" } } interp alias {a b} dela {} dela proc dela {} {interp delete a} list [catch {a eval foo} msg] $msg } {1 {attempt to call eval in deleted interpreter}} test interp-18.9 {eval in deleted interp, bug 495830} { interp create tst interp alias tst suicide {} interp delete tst list [catch {tst eval {suicide; set a 5}} msg] $msg } {1 {attempt to call eval in deleted interpreter}} test interp-18.10 {eval in deleted interp, bug 495830} { interp create tst interp alias tst suicide {} interp delete tst list [catch {tst eval {set set set; suicide; $set a 5}} msg] $msg } {1 {attempt to call eval in deleted interpreter}} # Test alias deletion test interp-19.1 {alias deletion} { catch {interp delete a} interp create a interp alias a foo a bar set s [interp alias a foo {}] interp delete a set s } {} test interp-19.2 {alias deletion} { catch {interp delete a} interp create a catch {interp alias a foo {}} msg interp delete a set msg } {alias "foo" not found} test interp-19.3 {alias deletion} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a {rename foo zop} interp alias a foo a zop catch {interp eval a foo} msg interp delete a set msg } {invalid command name "bar"} test interp-19.4 {alias deletion} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a {rename foo zop} catch {interp eval a foo} msg interp delete a set msg } {invalid command name "foo"} test interp-19.5 {alias deletion} { catch {interp delete a} interp create a interp eval a {proc bar {} {return 1}} interp alias a foo a bar interp eval a {rename foo zop} catch {interp eval a zop} msg interp delete a set msg } 1 test interp-19.6 {alias deletion} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a {rename foo zop} interp alias a foo a zop set s [interp aliases a] interp delete a set s } {::foo foo} test interp-19.7 {alias deletion, renaming} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a rename foo blotz interp alias a foo {} set s [interp aliases a] interp delete a set s } {} test interp-19.8 {alias deletion, renaming} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a rename foo blotz set l "" lappend l [interp aliases a] interp alias a foo {} lappend l [interp aliases a] interp delete a set l } {foo {}} test interp-19.9 {alias deletion, renaming} { catch {interp delete a} interp create a interp alias a foo a bar interp eval a rename foo blotz interp eval a {proc foo {} {expr {34 * 34}}} interp alias a foo {} set l [interp eval a foo] interp delete a set l } 1156 test interp-20.1 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a eval {proc foo {} {}} $a hide foo catch {$a eval foo something} msg interp delete $a set msg } {invalid command name "foo"} test interp-20.2 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a hide list set l "" lappend l [catch {$a eval {list 1 2 3}} msg] $msg $a expose list lappend l [catch {$a eval {list 1 2 3}} msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {1 2 3}} test interp-20.3 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a hide list set l "" lappend l [catch { $a eval {list 1 2 3} } msg] $msg lappend l [catch { $a invokehidden list 1 2 3 } msg] $msg $a expose list lappend l [catch { $a eval {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {1 2 3} 0 {1 2 3}} test interp-20.4 {interp hide, interp expose and interp invokehidden -- passing {}} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a hide list set l "" lappend l [catch { $a eval {list 1 2 3} } msg] $msg lappend l [catch { $a invokehidden list {"" 1 2 3} } msg] $msg $a expose list lappend l [catch { $a eval {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {{"" 1 2 3}} 0 {1 2 3}} test interp-20.5 {interp hide, interp expose and interp invokehidden -- passing {}} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a hide list set l "" lappend l [catch { $a eval {list 1 2 3} } msg] $msg lappend l [catch { $a invokehidden list {{} 1 2 3} } msg] $msg $a expose list lappend l [catch { $a eval {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {{{} 1 2 3}} 0 {1 2 3}} test interp-20.6 {interp invokehidden -- eval args} { set a [interp create] $a hide list set l "" set z 45 lappend l [catch { $a invokehidden list $z 1 2 3 } msg] $msg $a expose list lappend l [catch { $a eval list $z 1 2 3 } msg] $msg interp delete $a set l } {0 {45 1 2 3} 0 {45 1 2 3}} test interp-20.7 {interp invokehidden vs variable eval} { set a [interp create] $a hide list set z 45 set l [list [catch {$a invokehidden list {$z a b c}} msg] $msg] interp delete $a set l } {0 {{$z a b c}}} test interp-20.8 {interp invokehidden vs variable eval} { set a [interp create] $a hide list $a eval set z 89 set z 45 set l [list [catch {$a invokehidden list {$z a b c}} msg] $msg] interp delete $a set l } {0 {{$z a b c}}} test interp-20.9 {interp invokehidden vs variable eval} { set a [interp create] $a hide list $a eval set z 89 set z 45 set l "" lappend l [catch {$a invokehidden list $z {$z a b c}} msg] $msg interp delete $a set l } {0 {45 {$z a b c}}} test interp-20.10 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} $a eval {proc foo {} {}} interp hide $a foo catch {interp eval $a foo something} msg interp delete $a set msg } {invalid command name "foo"} test interp-20.11 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} interp hide $a list set l "" lappend l [catch {interp eval $a {list 1 2 3}} msg] $msg interp expose $a list lappend l [catch {interp eval $a {list 1 2 3}} msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {1 2 3}} test interp-20.12 {interp hide, interp expose and interp invokehidden} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} interp hide $a list set l "" lappend l [catch {interp eval $a {list 1 2 3} } msg] $msg lappend l [catch {interp invokehidden $a list 1 2 3} msg] $msg interp expose $a list lappend l [catch {interp eval $a {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {1 2 3} 0 {1 2 3}} test interp-20.13 {interp hide, interp expose, interp invokehidden -- passing {}} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} interp hide $a list set l "" lappend l [catch {interp eval $a {list 1 2 3} } msg] $msg lappend l [catch {interp invokehidden $a list {"" 1 2 3}} msg] $msg interp expose $a list lappend l [catch {interp eval $a {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {{"" 1 2 3}} 0 {1 2 3}} test interp-20.14 {interp hide, interp expose, interp invokehidden -- passing {}} { set a [interp create] $a eval {proc unknown {x args} {error "invalid command name \"$x\""}} interp hide $a list set l "" lappend l [catch {interp eval $a {list 1 2 3} } msg] $msg lappend l [catch {interp invokehidden $a list {{} 1 2 3}} msg] $msg interp expose $a list lappend l [catch {$a eval {list 1 2 3} } msg] $msg interp delete $a set l } {1 {invalid command name "list"} 0 {{{} 1 2 3}} 0 {1 2 3}} test interp-20.15 {interp invokehidden -- eval args} { catch {interp delete a} interp create a interp hide a list set l "" set z 45 lappend l [catch {interp invokehidden a list $z 1 2 3} msg] lappend l $msg a expose list lappend l [catch {interp eval a list $z 1 2 3} msg] lappend l $msg interp delete a set l } {0 {45 1 2 3} 0 {45 1 2 3}} test interp-20.16 {interp invokehidden vs variable eval} { catch {interp delete a} interp create a interp hide a list set z 45 set l "" lappend l [catch {interp invokehidden a list {$z a b c}} msg] lappend l $msg interp delete a set l } {0 {{$z a b c}}} test interp-20.17 {interp invokehidden vs variable eval} { catch {interp delete a} interp create a interp hide a list a eval set z 89 set z 45 set l "" lappend l [catch {interp invokehidden a list {$z a b c}} msg] lappend l $msg interp delete a set l } {0 {{$z a b c}}} test interp-20.18 {interp invokehidden vs variable eval} { catch {interp delete a} interp create a interp hide a list a eval set z 89 set z 45 set l "" lappend l [catch {interp invokehidden a list $z {$z a b c}} msg] lappend l $msg interp delete a set l } {0 {45 {$z a b c}}} test interp-20.19 {interp invokehidden vs nested commands} { catch {interp delete a} interp create a a hide list set l [a invokehidden list {[list x y z] f g h} z] interp delete a set l } {{[list x y z] f g h} z} test interp-20.20 {interp invokehidden vs nested commands} { catch {interp delete a} interp create a a hide list set l [interp invokehidden a list {[list x y z] f g h} z] interp delete a set l } {{[list x y z] f g h} z} test interp-20.21 {interp hide vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {a hide list} msg] lappend l $msg interp delete a set l } {0 {}} test interp-20.22 {interp hide vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {interp hide a list} msg] lappend l $msg interp delete a set l } {0 {}} test interp-20.23 {interp hide vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {a eval {interp hide {} list}} msg] lappend l $msg interp delete a set l } {1 {permission denied: safe interpreter cannot hide commands}} test interp-20.24 {interp hide vs safety} { catch {interp delete a} interp create a -safe interp create {a b} set l "" lappend l [catch {a eval {interp hide b list}} msg] lappend l $msg interp delete a set l } {1 {permission denied: safe interpreter cannot hide commands}} test interp-20.25 {interp hide vs safety} { catch {interp delete a} interp create a -safe interp create {a b} set l "" lappend l [catch {interp hide {a b} list} msg] lappend l $msg interp delete a set l } {0 {}} test interp-20.26 {interp expoose vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {a hide list} msg] lappend l $msg lappend l [catch {a expose list} msg] lappend l $msg interp delete a set l } {0 {} 0 {}} test interp-20.27 {interp expose vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {interp hide a list} msg] lappend l $msg lappend l [catch {interp expose a list} msg] lappend l $msg interp delete a set l } {0 {} 0 {}} test interp-20.28 {interp expose vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {a hide list} msg] lappend l $msg lappend l [catch {a eval {interp expose {} list}} msg] lappend l $msg interp delete a set l } {0 {} 1 {permission denied: safe interpreter cannot expose commands}} test interp-20.29 {interp expose vs safety} { catch {interp delete a} interp create a -safe set l "" lappend l [catch {interp hide a list} msg] lappend l $msg lappend l [catch {a eval {interp expose {} list}} msg] lappend l $msg interp delete a set l } {0 {} 1 {permission denied: safe interpreter cannot expose commands}} test interp-20.30 {interp expose vs safety} { catch {interp delete a} interp create a -safe interp create {a b} set l "" lappend l [catch {interp hide {a b} list} msg] lappend l $msg lappend l [catch {a eval {interp expose b list}} msg] lappend l $msg interp delete a set l } {0 {} 1 {permission denied: safe interpreter cannot expose commands}} test interp-20.31 {interp expose vs safety} { catch {interp delete a} interp create a -safe interp create {a b} set l "" lappend l [catch {interp hide {a b} list} msg] lappend l $msg lappend l [catch {interp expose {a b} list} msg] lappend l $msg interp delete a set l } {0 {} 0 {}} test interp-20.32 {interp invokehidden vs safety} { catch {interp delete a} interp create a -safe interp hide a list set l "" lappend l [catch {a eval {interp invokehidden {} list a b c}} msg] lappend l $msg interp delete a set l } {1 {not allowed to invoke hidden commands from safe interpreter}} test interp-20.33 {interp invokehidden vs safety} { catch {interp delete a} interp create a -safe interp hide a list set l "" lappend l [catch {a eval {interp invokehidden {} list a b c}} msg] lappend l $msg lappend l [catch {a invokehidden list a b c} msg] lappend l $msg interp delete a set l } {1 {not allowed to invoke hidden commands from safe interpreter}\ 0 {a b c}} test interp-20.34 {interp invokehidden vs safety} { catch {interp delete a} interp create a -safe interp create {a b} interp hide {a b} list set l "" lappend l [catch {a eval {interp invokehidden b list a b c}} msg] lappend l $msg lappend l [catch {interp invokehidden {a b} list a b c} msg] lappend l $msg interp delete a set l } {1 {not allowed to invoke hidden commands from safe interpreter}\ 0 {a b c}} test interp-20.35 {invokehidden at local level} { catch {interp delete a} interp create a a eval { proc p1 {} { set z 90 a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.36 {invokehidden at local level} { catch {interp delete a} interp create a a eval { set z 90 proc p1 {} { global z a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.37 {invokehidden at local level} { catch {interp delete a} interp create a a eval { proc p1 {} { a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.38 {invokehidden at global level} { catch {interp delete a} interp create a a eval { proc p1 {} { a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a -global h1 } set r [catch {interp eval a p1} msg] interp delete a list $r $msg } {1 {can't read "z": no such variable}} test interp-20.39 {invokehidden at global level} { catch {interp delete a} interp create a a eval { proc p1 {} { global z a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a -global h1 } set r [catch {interp eval a p1} msg] interp delete a list $r $msg } {0 91} test interp-20.40 {safe, invokehidden at local level} { catch {interp delete a} interp create a -safe a eval { proc p1 {} { set z 90 a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.41 {safe, invokehidden at local level} { catch {interp delete a} interp create a -safe a eval { set z 90 proc p1 {} { global z a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.42 {safe, invokehidden at local level} { catch {interp delete a} interp create a -safe a eval { proc p1 {} { a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a h1 } set r [interp eval a p1] interp delete a set r } 91 test interp-20.43 {invokehidden at global level} { catch {interp delete a} interp create a a eval { proc p1 {} { a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a -global h1 } set r [catch {interp eval a p1} msg] interp delete a list $r $msg } {1 {can't read "z": no such variable}} test interp-20.44 {invokehidden at global level} { catch {interp delete a} interp create a a eval { proc p1 {} { global z a1 set z } proc h1 {} { upvar z z set z 91 } } a hide h1 a alias a1 a1 proc a1 {} { interp invokehidden a -global h1 } set r [catch {interp eval a p1} msg] interp delete a list $r $msg } {0 91} test interp-20.45 {interp hide vs namespaces} { catch {interp delete a} interp create a a eval { namespace eval foo {} proc foo::x {} {} } set l [list [catch {interp hide a foo::x} msg] $msg] interp delete a set l } {1 {cannot use namespace qualifiers in hidden command token (rename)}} test interp-20.46 {interp hide vs namespaces} { catch {interp delete a} interp create a a eval { namespace eval foo {} proc foo::x {} {} } set l [list [catch {interp hide a foo::x x} msg] $msg] interp delete a set l } {1 {can only hide global namespace commands (use rename then hide)}} test interp-20.47 {interp hide vs namespaces} { catch {interp delete a} interp create a a eval { proc x {} {} } set l [list [catch {interp hide a x foo::x} msg] $msg] interp delete a set l } {1 {cannot use namespace qualifiers in hidden command token (rename)}} test interp-20.48 {interp hide vs namespaces} { catch {interp delete a} interp create a a eval { namespace eval foo {} proc foo::x {} {} } set l [list [catch {interp hide a foo::x bar::x} msg] $msg] interp delete a set l } {1 {cannot use namespace qualifiers in hidden command token (rename)}} test interp-20.49 {interp invokehidden -namespace} -setup { set script [makeFile { set x [namespace current] } script] interp create -safe child } -body { child invokehidden -namespace ::foo source $script child eval {set ::foo::x} } -cleanup { interp delete child removeFile script } -result ::foo test interp-20.50 {Bug 2486550} -setup { interp create child } -body { child hide coroutine child invokehidden coroutine } -cleanup { interp delete child } -returnCodes error -match glob -result * test interp-20.50.1 {Bug 2486550} -setup { interp create child } -body { child hide coroutine catch {child invokehidden coroutine} m o dict get $o -errorinfo } -cleanup { unset -nocomplain m 0 interp delete child } -result {wrong # args: should be "coroutine name cmd ?arg ...?" while executing "coroutine" invoked from within "child invokehidden coroutine"} test interp-21.1 {interp hidden} { interp hidden {} } "" test interp-21.2 {interp hidden} { interp hidden } "" test interp-21.3 {interp hidden vs interp hide, interp expose} -setup { set l "" } -body { lappend l [interp hidden] interp hide {} pwd lappend l [interp hidden] interp expose {} pwd lappend l [interp hidden] } -result {{} pwd {}} test interp-21.4 {interp hidden} -setup { catch {interp delete a} } -body { interp create a interp hidden a } -cleanup { interp delete a } -result "" test interp-21.5 {interp hidden} -setup { catch {interp delete a} } -body { interp create -safe a lsort [interp hidden a] } -cleanup { interp delete a } -result $hidden_cmds test interp-21.6 {interp hidden vs interp hide, interp expose} -setup { catch {interp delete a} set l "" } -body { interp create a lappend l [interp hidden a] interp hide a pwd lappend l [interp hidden a] interp expose a pwd lappend l [interp hidden a] } -cleanup { interp delete a } -result {{} pwd {}} test interp-21.7 {interp hidden} -setup { catch {interp delete a} } -body { interp create a a hidden } -cleanup { interp delete a } -result "" test interp-21.8 {interp hidden} -setup { catch {interp delete a} } -body { interp create a -safe lsort [a hidden] } -cleanup { interp delete a } -result $hidden_cmds test interp-21.9 {interp hidden vs interp hide, interp expose} -setup { catch {interp delete a} set l "" } -body { interp create a lappend l [a hidden] a hide pwd lappend l [a hidden] a expose pwd lappend l [a hidden] } -cleanup { interp delete a } -result {{} pwd {}} test interp-22.1 {testing interp marktrusted} { catch {interp delete a} interp create a set l "" lappend l [a issafe] lappend l [a marktrusted] lappend l [a issafe] interp delete a set l } {0 {} 0} test interp-22.2 {testing interp marktrusted} { catch {interp delete a} interp create a set l "" lappend l [interp issafe a] lappend l [interp marktrusted a] lappend l [interp issafe a] interp delete a set l } {0 {} 0} test interp-22.3 {testing interp marktrusted} { catch {interp delete a} interp create a -safe set l "" lappend l [a issafe] lappend l [a marktrusted] lappend l [a issafe] interp delete a set l } {1 {} 0} test interp-22.4 {testing interp marktrusted} { catch {interp delete a} interp create a -safe set l "" lappend l [interp issafe a] lappend l [interp marktrusted a] lappend l [interp issafe a] interp delete a set l } {1 {} 0} test interp-22.5 {testing interp marktrusted} { catch {interp delete a} interp create a -safe interp create {a b} catch {a eval {interp marktrusted b}} msg interp delete a set msg } {permission denied: safe interpreter cannot mark trusted} test interp-22.6 {testing interp marktrusted} { catch {interp delete a} interp create a -safe interp create {a b} catch {a eval {b marktrusted}} msg interp delete a set msg } {permission denied: safe interpreter cannot mark trusted} test interp-22.7 {testing interp marktrusted} { catch {interp delete a} interp create a -safe set l "" lappend l [interp issafe a] interp marktrusted a interp create {a b} lappend l [interp issafe a] lappend l [interp issafe {a b}] interp delete a set l } {1 0 0} test interp-22.8 {testing interp marktrusted} { catch {interp delete a} interp create a -safe set l "" lappend l [interp issafe a] interp create {a b} lappend l [interp issafe {a b}] interp marktrusted a interp create {a c} lappend l [interp issafe a] lappend l [interp issafe {a c}] interp delete a set l } {1 1 0 0} test interp-22.9 {testing interp marktrusted} { catch {interp delete a} interp create a -safe set l "" lappend l [interp issafe a] interp create {a b} lappend l [interp issafe {a b}] interp marktrusted {a b} lappend l [interp issafe a] lappend l [interp issafe {a b}] interp create {a b c} lappend l [interp issafe {a b c}] interp delete a set l } {1 1 1 0 0} test interp-23.1 {testing hiding vs aliases: unsafe interp} -setup { catch {interp delete a} set l "" } -body { interp create a lappend l [interp hidden a] a alias bar bar lappend l [interp aliases a] [interp hidden a] a hide bar lappend l [interp aliases a] [interp hidden a] a alias bar {} lappend l [interp aliases a] [interp hidden a] } -cleanup { interp delete a } -result {{} bar {} bar bar {} {}} test interp-23.2 {testing hiding vs aliases: safe interp} -setup { catch {interp delete a} set l "" } -constraints {unixOrWin} -body { interp create a -safe lappend l [lsort [interp hidden a]] a alias bar bar lappend l [lsort [interp aliases a]] [lsort [interp hidden a]] a hide bar lappend l [lsort [interp aliases a]] [lsort [interp hidden a]] a alias bar {} lappend l [lsort [interp aliases a]] [lsort [interp hidden a]] } -cleanup { interp delete a } -result [list $hidden_cmds {bar clock} $hidden_cmds {bar clock} [lsort [concat $hidden_cmds bar]] {clock} $hidden_cmds] test interp-24.1 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a interp alias a foo {} apply {args {error $args}} interp eval a { lappend l [catch {foo 1 2 3} msg] $msg lappend l [catch {foo 3 4 5} msg] $msg } } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.2 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a -safe interp alias a foo {} apply {args {error $args}} interp eval a { lappend l [catch {foo 1 2 3} msg] $msg lappend l [catch {foo 3 4 5} msg] $msg } } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.3 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a interp create {a b} interp eval a { proc foo args {error $args} } interp alias {a b} foo a foo interp eval {a b} { lappend l [catch {foo 1 2 3} msg] $msg lappend l [catch {foo 3 4 5} msg] $msg } } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.4 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a -safe interp create {a b} interp eval a { proc foo args {error $args} } interp alias {a b} foo a foo interp eval {a b} { lappend l [catch {foo 1 2 3} msg] lappend l $msg lappend l [catch {foo 3 4 5} msg] lappend l $msg } } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.5 {result resetting on error} -setup { catch {interp delete a} catch {interp delete b} } -body { interp create a interp create b interp eval a { proc foo args {error $args} } interp alias b foo a foo interp eval b { lappend l [catch {foo 1 2 3} msg] $msg lappend l [catch {foo 3 4 5} msg] $msg } } -cleanup { interp delete a interp delete b } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.6 {result resetting on error} -setup { catch {interp delete a} catch {interp delete b} } -body { interp create a -safe interp create b -safe interp eval a { proc foo args {error $args} } interp alias b foo a foo interp eval b { lappend l [catch {foo 1 2 3} msg] $msg lappend l [catch {foo 3 4 5} msg] $msg } } -cleanup { interp delete a interp delete b } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.7 {result resetting on error} -setup { catch {interp delete a} set l {} } -body { interp create a interp eval a { proc foo args {error $args} } lappend l [catch {interp eval a foo 1 2 3} msg] $msg lappend l [catch {interp eval a foo 3 4 5} msg] $msg } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.8 {result resetting on error} -setup { catch {interp delete a} set l {} } -body { interp create a -safe interp eval a { proc foo args {error $args} } lappend l [catch {interp eval a foo 1 2 3} msg] $msg lappend l [catch {interp eval a foo 3 4 5} msg] $msg } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.9 {result resetting on error} -setup { catch {interp delete a} set l {} } -body { interp create a interp create {a b} interp eval {a b} { proc foo args {error $args} } interp eval a { proc foo args { eval interp eval b foo $args } } lappend l [catch {interp eval a foo 1 2 3} msg] $msg lappend l [catch {interp eval a foo 3 4 5} msg] $msg } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.10 {result resetting on error} -setup { catch {interp delete a} set l {} } -body { interp create a -safe interp create {a b} interp eval {a b} { proc foo args {error $args} } interp eval a { proc foo args { eval interp eval b foo $args } } lappend l [catch {interp eval a foo 1 2 3} msg] $msg lappend l [catch {interp eval a foo 3 4 5} msg] $msg } -cleanup { interp delete a } -result {1 {1 2 3} 1 {3 4 5}} test interp-24.11 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a interp create {a b} interp eval {a b} { proc foo args {error $args} } interp eval a { proc foo args { lappend l [catch {eval interp eval b foo $args} msg] $msg lappend l [catch {eval interp eval b foo $args} msg] $msg } } interp eval a foo 1 2 3 } -cleanup { interp delete a } -result {1 {1 2 3} 1 {1 2 3}} test interp-24.12 {result resetting on error} -setup { catch {interp delete a} } -body { interp create a -safe interp create {a b} interp eval {a b} { proc foo args {error $args} } interp eval a { proc foo args { lappend l [catch {eval interp eval b foo $args} msg] $msg lappend l [catch {eval interp eval b foo $args} msg] $msg } } interp eval a foo 1 2 3 } -cleanup { interp delete a } -result {1 {1 2 3} 1 {1 2 3}} test interp-25.1 {testing aliasing of string commands} -setup { catch {interp delete a} } -body { interp create a a alias exec foo ;# Relies on exec being a string command! interp delete a } -result "" test interp-25.2 {lambda on different interpreters, bug [67d5f75c36cbada6]} -setup { catch {interp delete a} interp create a } -body { set res {} set lambda {{} { list OK from lambda }} lappend res [apply $lambda] lappend res [a eval [list apply $lambda]] set lambda [list apply {{} { list OK from lambda }}] lappend res [eval $lambda] lappend res [a eval $lambda] # cover also epoch change (command list is replaced): a eval {proc list args {return {NO LIST}}} lappend res [a eval $lambda] lappend res [eval $lambda] set res } -cleanup { interp delete a unset -nocomplain res lambda } -result [list {*}[lrepeat 4 {OK from lambda}] {NO LIST} {OK from lambda}] # # Interps result transmission # test interp-26.1 {result code transmission : interp eval direct} { # Test that all the possibles error codes from Tcl get passed up # from the child interp's context to the parent, even though the # child nominally thinks the command is running at the root level. catch {interp delete a} interp create a set res {} # use a for so if a return -code break 'escapes' we would notice for {set code -1} {$code<=5} {incr code} { lappend res [catch {interp eval a return -code $code} msg] } interp delete a set res } {-1 0 1 2 3 4 5} test interp-26.2 {result code transmission : interp eval indirect} { # retcode == 2 == return is special catch {interp delete a} interp create a interp eval a {proc retcode {code} {return -code $code ret$code}} set res {} # use a for so if a return -code break 'escapes' we would notice for {set code -1} {$code<=5} {incr code} { lappend res [catch {interp eval a retcode $code} msg] $msg } interp delete a set res } {-1 ret-1 0 ret0 1 ret1 0 ret2 3 ret3 4 ret4 5 ret5} test interp-26.3 {result code transmission : aliases} { # Test that all the possibles error codes from Tcl get passed up from the # child interp's context to the parent, even though the child nominally # thinks the command is running at the root level. catch {interp delete a} interp create a set res {} proc MyTestAlias {code} { return -code $code ret$code } interp alias a Test {} MyTestAlias for {set code -1} {$code<=5} {incr code} { lappend res [interp eval a [list catch [list Test $code] msg]] } interp delete a set res } {-1 0 1 2 3 4 5} test interp-26.4 {result code transmission: invoke hidden direct--bug 1637} \ {knownBug} { # The known bug is that code 2 is returned, not the -code argument catch {interp delete a} interp create a set res {} interp hide a return for {set code -1} {$code<=5} {incr code} { lappend res [catch {interp invokehidden a return -code $code ret$code}] } interp delete a set res } {-1 0 1 2 3 4 5} test interp-26.5 {result code transmission: invoke hidden indirect--bug 1637} -setup { catch {interp delete a} interp create a } -body { # The known bug is that the break and continue should raise errors that # they are used outside a loop. set res {} interp eval a {proc retcode {code} {return -code $code ret$code}} interp hide a retcode for {set code -1} {$code<=5} {incr code} { lappend res [catch {interp invokehidden a retcode $code} msg] $msg } return $res } -cleanup { interp delete a } -result {-1 ret-1 0 ret0 1 ret1 2 ret2 3 ret3 4 ret4 5 ret5} test interp-26.6 {result code transmission: all combined--bug 1637} -setup { set interp [interp create] } -constraints knownBug -body { # Test that all the possibles error codes from Tcl get passed in both # directions. This doesn't work. proc MyTestAlias {interp args} { global aliasTrace lappend aliasTrace $args interp invokehidden $interp {*}$args } foreach c {return} { interp hide $interp $c interp alias $interp $c {} MyTestAlias $interp $c } interp eval $interp {proc ret {code} {return -code $code ret$code}} set res {} set aliasTrace {} for {set code -1} {$code<=5} {incr code} { lappend res [catch {interp eval $interp ret $code} msg] $msg } return $res } -cleanup { interp delete $interp } -result {-1 ret-1 0 ret0 1 ret1 0 ret2 3 ret3 4 ret4 5 ret5} # Some tests might need to be added to check for difference between toplevel # and non-toplevel evals. # End of return code transmission section test interp-26.7 {errorInfo transmission: regular interps} -setup { set interp [interp create] } -body { proc MyError {secret} { return -code error "msg" } proc MyTestAlias {interp args} { MyError "some secret" } interp alias $interp test {} MyTestAlias $interp interp eval $interp {catch test;set ::errorInfo} } -cleanup { interp delete $interp } -result {msg while executing "MyError "some secret"" (procedure "MyTestAlias" line 2) invoked from within "test"} test interp-26.8 {errorInfo transmission: safe interps--bug 1637} -setup { set interp [interp create -safe] } -constraints knownBug -body { # this test fails because the errorInfo is fully transmitted whether the # interp is safe or not. The errorInfo should never report data from the # parent interpreter because it could contain sensitive information. proc MyError {secret} { return -code error "msg" } proc MyTestAlias {interp args} { MyError "some secret" } interp alias $interp test {} MyTestAlias $interp interp eval $interp {catch test;set ::errorInfo} } -cleanup { interp delete $interp } -result {msg while executing "test"} test interp-26.9 {error transmission: body line number in info similar to eval-cmd, bug [ba68d1e9484a3a92]} -setup { set interp [interp create] } -body { # eval body with multiline code (error in line 3): catch { $interp eval "#1st line\n#2nd line\nexpr {1/0}" } msg res dict get $res -errorinfo } -cleanup { interp delete $interp } -result {divide by zero invoked from within "expr {1/0}" ("interp eval" body line 3) invoked from within "$interp eval "#1st line\n#2nd line\nexpr {1/0}""} # Interps & Namespaces test interp-27.1 {interp aliases & namespaces} -setup { set i [interp create] } -body { set aliasTrace {} proc tstAlias {args} { global aliasTrace lappend aliasTrace [list [namespace current] $args] } $i alias foo::bar tstAlias foo::bar $i eval foo::bar test return $aliasTrace } -cleanup { interp delete $i } -result {{:: {foo::bar test}}} test interp-27.2 {interp aliases & namespaces} -setup { set i [interp create] } -body { set aliasTrace {} proc tstAlias {args} { global aliasTrace lappend aliasTrace [list [namespace current] $args] } $i alias foo::bar tstAlias foo::bar $i eval namespace eval foo {bar test} return $aliasTrace } -cleanup { interp delete $i } -result {{:: {foo::bar test}}} test interp-27.3 {interp aliases & namespaces} -setup { set i [interp create] } -body { set aliasTrace {} proc tstAlias {args} { global aliasTrace lappend aliasTrace [list [namespace current] $args] } interp eval $i {namespace eval foo {proc bar {} {error "bar called"}}} interp alias $i foo::bar {} tstAlias foo::bar interp eval $i {namespace eval foo {bar test}} return $aliasTrace } -cleanup { interp delete $i } -result {{:: {foo::bar test}}} test interp-27.4 {interp aliases & namespaces} -setup { set i [interp create] } -body { namespace eval foo2 { variable aliasTrace {} proc bar {args} { variable aliasTrace lappend aliasTrace [list [namespace current] $args] } } $i alias foo::bar foo2::bar foo::bar $i eval namespace eval foo {bar test} return $foo2::aliasTrace } -cleanup { namespace delete foo2 interp delete $i } -result {{::foo2 {foo::bar test}}} test interp-27.5 {interp hidden & namespaces} -setup { set i [interp create] } -constraints knownBug -body { interp eval $i { namespace eval foo { proc bar {args} { return "bar called ([namespace current]) ($args)" } } } set res [list [interp eval $i {namespace eval foo {bar test1}}]] interp hide $i foo::bar lappend res [list [catch {interp eval $i {namespace eval foo {bar test2}}} msg] $msg] } -cleanup { interp delete $i } -result {{bar called (::foo) (test1)} {1 {invalid command name "bar"}}} test interp-27.6 {interp hidden & aliases & namespaces} -setup { set i [interp create] } -constraints knownBug -body { set v root-parent namespace eval foo { variable v foo-parent proc bar {interp args} { variable v list "parent bar called ($v) ([namespace current]) ($args)"\ [interp invokehidden $interp foo::bar $args] } } interp eval $i { namespace eval foo { namespace export * variable v foo-child proc bar {args} { variable v return "child bar called ($v) ([namespace current]) ($args)" } } } set res [list [interp eval $i {namespace eval foo {bar test1}}]] $i hide foo::bar $i alias foo::bar foo::bar $i set res [concat $res [interp eval $i { set v root-child namespace eval test { variable v foo-test namespace import ::foo::* bar test2 } }]] } -cleanup { namespace delete foo interp delete $i } -result {{child bar called (foo-child) (::foo) (test1)} {parent bar called (foo-parent) (::foo) (test2)} {child bar called (foo-child) (::foo) (test2)}} test interp-27.7 {interp hidden & aliases & imports & namespaces} -setup { set i [interp create] } -constraints knownBug -body { set v root-parent namespace eval mfoo { variable v foo-parent proc bar {interp args} { variable v list "parent bar called ($v) ([namespace current]) ($args)"\ [interp invokehidden $interp test::bar $args] } } interp eval $i { namespace eval foo { namespace export * variable v foo-child proc bar {args} { variable v return "child bar called ($v) ([info level 0]) ([uplevel namespace current]) ([namespace current]) ($args)" } } set v root-child namespace eval test { variable v foo-test namespace import ::foo::* } } set res [list [interp eval $i {namespace eval test {bar test1}}]] $i hide test::bar $i alias test::bar mfoo::bar $i set res [concat $res [interp eval $i {test::bar test2}]] } -cleanup { namespace delete mfoo interp delete $i } -result {{child bar called (foo-child) (bar test1) (::tcltest) (::foo) (test1)} {parent bar called (foo-parent) (::mfoo) (test2)} {child bar called (foo-child) (test::bar test2) (::) (::foo) (test2)}} test interp-27.8 {hiding, namespaces and integrity} knownBug { namespace eval foo { variable v 3 proc bar {} {variable v; set v} # next command would currently generate an unknown command "bar" error. interp hide {} bar } namespace delete foo list [catch {interp invokehidden {} foo::bar} msg] $msg } {1 {invalid hidden command name "foo"}} test interp-28.1 {getting fooled by child's namespace ?} -setup { set i [interp create -safe] proc parent {interp args} {interp hide $interp list} } -body { $i alias parent parent $i set r [interp eval $i { namespace eval foo { proc list {args} { return "dummy foo::list" } parent } info commands list }] } -cleanup { rename parent {} interp delete $i } -result {} test interp-28.2 {parent's nsName cache should not cross} -setup { set i [interp create] $i eval {proc filter lst {lsearch -all -inline -not $lst "::tcl"}} } -body { $i eval { set x {namespace children ::} set y [list namespace children ::] namespace delete {*}[filter [{*}$y]] set j [interp create] $j alias filter filter $j eval {namespace delete {*}[filter [namespace children ::]]} namespace eval foo {} list [filter [eval $x]] [filter [eval $y]] [filter [$j eval $x]] [filter [$j eval $y]] } } -cleanup { interp delete $i } -result {::foo ::foo {} {}} # Part 29: recursion limit # 29.1.* Argument checking # 29.2.* Reading and setting the recursion limit # 29.3.* Does the recursion limit work? # 29.4.* Recursion limit inheritance by sub-interpreters # 29.5.* Confirming the recursionlimit command does not affect the parent # 29.6.* Safe interpreter restriction test interp-29.1.1 {interp recursionlimit argument checking} { list [catch {interp recursionlimit} msg] $msg } {1 {wrong # args: should be "interp recursionlimit path ?newlimit?"}} test interp-29.1.2 {interp recursionlimit argument checking} { list [catch {interp recursionlimit foo bar} msg] $msg } {1 {could not find interpreter "foo"}} test interp-29.1.3 {interp recursionlimit argument checking} { list [catch {interp recursionlimit foo bar baz} msg] $msg } {1 {wrong # args: should be "interp recursionlimit path ?newlimit?"}} test interp-29.1.4 {interp recursionlimit argument checking} { interp create moo set result [catch {interp recursionlimit moo bar} msg] interp delete moo list $result $msg } {1 {expected integer but got "bar"}} test interp-29.1.5 {interp recursionlimit argument checking} -body { interp create moo set result [catch {interp recursionlimit moo 0} msg] interp delete moo list $result $msg } -match glob -result {1 {recursion limit must be > 0}} test interp-29.1.6 {interp recursionlimit argument checking} -body { interp create moo set result [catch {interp recursionlimit moo -1} msg] interp delete moo list $result $msg } -match glob -result {1 {recursion limit must be > 0}} test interp-29.1.7 {interp recursionlimit argument checking} { interp create moo set result [catch {interp recursionlimit moo [expr {wide(1)<<64}]} msg] interp delete moo list $result [string range $msg 0 35] } {1 {integer value too large to represent}} test interp-29.1.8 {child recursionlimit argument checking} { interp create moo set result [catch {moo recursionlimit foo bar} msg] interp delete moo list $result $msg } {1 {wrong # args: should be "moo recursionlimit ?newlimit?"}} test interp-29.1.9 {child recursionlimit argument checking} { interp create moo set result [catch {moo recursionlimit foo} msg] interp delete moo list $result $msg } {1 {expected integer but got "foo"}} test interp-29.1.10 {child recursionlimit argument checking} -body { interp create moo set result [catch {moo recursionlimit 0} msg] interp delete moo list $result $msg } -match glob -result {1 {recursion limit must be > 0}} test interp-29.1.11 {child recursionlimit argument checking} -body { interp create moo set result [catch {moo recursionlimit -1} msg] interp delete moo list $result $msg } -match glob -result {1 {recursion limit must be > 0}} test interp-29.1.12 {child recursionlimit argument checking} { interp create moo set result [catch {moo recursionlimit [expr {wide(1)<<64}]} msg] interp delete moo list $result [string range $msg 0 35] } {1 {integer value too large to represent}} test interp-29.2.1 {query recursion limit} { interp recursionlimit {} } 1000 test interp-29.2.2 {query recursion limit} { set i [interp create] set n [interp recursionlimit $i] interp delete $i set n } 1000 test interp-29.2.3 {query recursion limit} { set i [interp create] set n [$i recursionlimit] interp delete $i set n } 1000 test interp-29.2.4 {query recursion limit} { set i [interp create] set r [$i eval { set n1 [interp recursionlimit {} 42] set n2 [interp recursionlimit {}] list $n1 $n2 }] interp delete $i set r } {42 42} test interp-29.2.5 {query recursion limit} { set i [interp create] set n1 [interp recursionlimit $i 42] set n2 [interp recursionlimit $i] interp delete $i list $n1 $n2 } {42 42} test interp-29.2.6 {query recursion limit} { set i [interp create] set n1 [interp recursionlimit $i 42] set n2 [$i recursionlimit] interp delete $i list $n1 $n2 } {42 42} test interp-29.2.7 {query recursion limit} { set i [interp create] set n1 [$i recursionlimit 42] set n2 [interp recursionlimit $i] interp delete $i list $n1 $n2 } {42 42} test interp-29.2.8 {query recursion limit} { set i [interp create] set n1 [$i recursionlimit 42] set n2 [$i recursionlimit] interp delete $i list $n1 $n2 } {42 42} test interp-29.3.1 {recursion limit} { set i [interp create] set r [interp eval $i { interp recursionlimit {} 50 proc p {} {incr ::i; p} set i 0 list [catch p msg] $msg $i }] interp delete $i set r } {1 {too many nested evaluations (infinite loop?)} 49} test interp-29.3.2 {recursion limit} { set i [interp create] interp recursionlimit $i 50 set r [interp eval $i { proc p {} {incr ::i; p} set i 0 list [catch p msg] $msg $i }] interp delete $i set r } {1 {too many nested evaluations (infinite loop?)} 49} test interp-29.3.3 {recursion limit} { set i [interp create] $i recursionlimit 50 set r [interp eval $i { proc p {} {incr ::i; p} set i 0 list [catch p msg] $msg $i }] interp delete $i set r } {1 {too many nested evaluations (infinite loop?)} 49} test interp-29.3.4 {recursion limit error reporting} { interp create child set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 interp recursionlimit {} 5 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {falling back due to new recursion limit}} test interp-29.3.5 {recursion limit error reporting} { interp create child set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 interp recursionlimit {} 4 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {falling back due to new recursion limit}} test interp-29.3.6 {recursion limit error reporting} { interp create child set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 interp recursionlimit {} 6 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} # # Note that TEBC does not verify the interp's nesting level itself; the nesting # level will only be verified when it invokes a non-bcc'd command. # test interp-29.3.7a {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 5} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.7b {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 5} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 update eval { # 5 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.7c {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 5} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set set set $set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {too many nested evaluations (infinite loop?)}} test interp-29.3.8a {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 4} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.8b {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 4} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 update eval { # 5 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {too many nested evaluations (infinite loop?)}} test interp-29.3.9a {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 6} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.9b {recursion limit error reporting} { interp create child after 0 {interp recursionlimit child 6} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 set set set $set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.10a {recursion limit error reporting} { interp create child after 0 {child recursionlimit 4} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.10b {recursion limit error reporting} { interp create child after 0 {child recursionlimit 4} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 update eval { # 5 set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {too many nested evaluations (infinite loop?)}} test interp-29.3.11a {recursion limit error reporting} { interp create child after 0 {child recursionlimit 5} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.11b {recursion limit error reporting} { interp create child after 0 {child recursionlimit 5} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set set set $set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {1 {too many nested evaluations (infinite loop?)}} test interp-29.3.12a {recursion limit error reporting} { interp create child after 0 {child recursionlimit 6} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.3.12b {recursion limit error reporting} { interp create child after 0 {child recursionlimit 6} set r1 [child eval { catch { # nesting level 1 eval { # 2 eval { # 3 eval { # 4 eval { # 5 update set set set $set x ok } } } } } msg }] set r2 [child eval { set msg }] interp delete child list $r1 $r2 } {0 ok} test interp-29.4.1 {recursion limit inheritance} { set i [interp create] set ii [interp eval $i { interp recursionlimit {} 50 interp create }] set r [interp eval [list $i $ii] { proc p {} {incr ::i; p} set i 0 catch p set i }] interp delete $i set r } 50 test interp-29.4.2 {recursion limit inheritance} { set i [interp create] $i recursionlimit 50 set ii [interp eval $i {interp create}] set r [interp eval [list $i $ii] { proc p {} {incr ::i; p} set i 0 catch p set i }] interp delete $i set r } 50 test interp-29.5.1 {does child recursion limit affect parent?} { set before [interp recursionlimit {}] set i [interp create] interp recursionlimit $i 20000 set after [interp recursionlimit {}] set childlimit [interp recursionlimit $i] interp delete $i list [expr {$before == $after}] $childlimit } {1 20000} test interp-29.5.2 {does child recursion limit affect parent?} { set before [interp recursionlimit {}] set i [interp create] interp recursionlimit $i 20000 set after [interp recursionlimit {}] set childlimit [$i recursionlimit] interp delete $i list [expr {$before == $after}] $childlimit } {1 20000} test interp-29.5.3 {does child recursion limit affect parent?} { set before [interp recursionlimit {}] set i [interp create] $i recursionlimit 20000 set after [interp recursionlimit {}] set childlimit [interp recursionlimit $i] interp delete $i list [expr {$before == $after}] $childlimit } {1 20000} test interp-29.5.4 {does child recursion limit affect parent?} { set before [interp recursionlimit {}] set i [interp create] $i recursionlimit 20000 set after [interp recursionlimit {}] set childlimit [$i recursionlimit] interp delete $i list [expr {$before == $after}] $childlimit } {1 20000} test interp-29.6.1 {safe interpreter recursion limit} { interp create child -safe set n [interp recursionlimit child] interp delete child set n } 1000 test interp-29.6.2 {safe interpreter recursion limit} { interp create child -safe set n [child recursionlimit] interp delete child set n } 1000 test interp-29.6.3 {safe interpreter recursion limit} { interp create child -safe set n1 [interp recursionlimit child 42] set n2 [interp recursionlimit child] interp delete child list $n1 $n2 } {42 42} test interp-29.6.4 {safe interpreter recursion limit} { interp create child -safe set n1 [child recursionlimit 42] set n2 [interp recursionlimit child] interp delete child list $n1 $n2 } {42 42} test interp-29.6.5 {safe interpreter recursion limit} { interp create child -safe set n1 [interp recursionlimit child 42] set n2 [child recursionlimit] interp delete child list $n1 $n2 } {42 42} test interp-29.6.6 {safe interpreter recursion limit} { interp create child -safe set n1 [child recursionlimit 42] set n2 [child recursionlimit] interp delete child list $n1 $n2 } {42 42} test interp-29.6.7 {safe interpreter recursion limit} { interp create child -safe set n1 [child recursionlimit 42] set n2 [child recursionlimit] interp delete child list $n1 $n2 } {42 42} test interp-29.6.8 {safe interpreter recursion limit} { interp create child -safe set n [catch {child eval {interp recursionlimit {} 42}} msg] interp delete child list $n $msg } {1 {permission denied: safe interpreters cannot change recursion limit}} test interp-29.6.9 {safe interpreter recursion limit} { interp create child -safe set result [ child eval { interp create child2 -safe set n [catch { interp recursionlimit child2 42 } msg] list $n $msg } ] interp delete child set result } {1 {permission denied: safe interpreters cannot change recursion limit}} test interp-29.6.10 {safe interpreter recursion limit} { interp create child -safe set result [ child eval { interp create child2 -safe set n [catch { child2 recursionlimit 42 } msg] list $n $msg } ] interp delete child set result } {1 {permission denied: safe interpreters cannot change recursion limit}} # # Deep recursion (into interps when the regular one fails): # # still crashes... # proc p {} { # if {[catch p ret]} { # catch { # set i [interp create] # interp eval $i [list proc p {} [info body p]] # interp eval $i p # } # interp delete $i # return ok # } # return $ret # } # p # more tests needed... # Interp & stack #test interp-29.1 {interp and stack (info level)} { #} {} # End of stack-recursion tests # This test dumps core in Tcl 8.0.3! test interp-30.1 {deletion of aliases inside namespaces} { set i [interp create] $i alias ns::cmd list $i alias ns::cmd {} } {} test interp-31.1 {alias invocation scope} { proc mySet {varName value} { upvar 1 $varName localVar set localVar $value } interp alias {} myNewSet {} mySet proc testMyNewSet {value} { myNewSet a $value return $a } unset -nocomplain a set result [testMyNewSet "ok"] rename testMyNewSet {} rename mySet {} rename myNewSet {} set result } ok test interp-32.1 {parent's working directory should be inherited by a child interp} -setup { cd [temporaryDirectory] } -body { set parent [pwd] set i [interp create] set child [$i eval pwd] interp delete $i file mkdir cwd_test cd cwd_test lappend parent [pwd] set i [interp create] lappend child [$i eval pwd] cd .. file delete cwd_test interp delete $i expr {[string equal $parent $child] ? 1 : "\{$parent\} != \{$child\}"} } -cleanup { cd [workingDirectory] } -result 1 test interp-33.1 {refCounting for target words of alias [Bug 730244]} { # This test will panic if Bug 730244 is not fixed. set i [interp create] proc testHelper args {rename testHelper {}; return $args} # Note: interp names are simple words by default trace add execution testHelper enter "interp alias $i alias {} ;#" interp alias $i alias {} testHelper this $i eval alias } this test interp-34.1 {basic test of limits - calling commands} -body { set i [interp create] $i eval { proc foobar {} { for {set x 0} {$x<1000000} {incr x} { # Calls to this are not bytecoded away pid } } } $i limit command -value 1000 $i eval foobar } -returnCodes error -result {command count limit exceeded} -cleanup { interp delete $i } test interp-34.2 {basic test of limits - bytecoded commands} -body { set i [interp create] $i eval { proc foobar {} { for {set x 0} {$x<1000000} {incr x} { # Calls to this *are* bytecoded away expr {1+2+3} } } } $i limit command -value 1000 $i eval foobar } -returnCodes error -result {command count limit exceeded} -cleanup { interp delete $i } test interp-34.3 {basic test of limits - pure bytecode loop} -body { set i [interp create] $i eval { proc foobar {} { while {1} { # No bytecode at all here... } } } # We use a time limit here; command limits don't trap this case $i limit time {*}[_ms_limit_args 50] $i eval foobar } -returnCodes error -result {time limit exceeded} -cleanup { interp delete $i } test interp-34.3.1 {basic test of limits - pure inside-command loop} -body { set i [interp create] $i eval { proc foobar {} { set while while $while {1} { # No bytecode at all here... } } } # We use a time limit here; command limits don't trap this case $i limit time {*}[_ms_limit_args 50] $i eval foobar } -returnCodes error -result {time limit exceeded} -cleanup { interp delete $i } test interp-34.4 {limits with callbacks: extending limits} -setup { set i [interp create] set a 0 set b 0 set c a proc cb1 {} { global c incr ::$c } proc cb2 {newlimit args} { global c i set c b $i limit command -value $newlimit } } -body { interp alias $i foo {} cb1 set curlim [$i eval info cmdcount] $i limit command -command "cb2 [expr {$curlim + 100}]" \ -value [expr {$curlim + 10}] $i eval {for {set i 0} {$i<10} {incr i} {foo}} list $a $b $c } -result {6 4 b} -cleanup { interp delete $i rename cb1 {} rename cb2 {} } # The next three tests exercise all the three ways that limit handlers # can be deleted. Fully verifying this requires additional source # code instrumentation. test interp-34.5 {limits with callbacks: removing limits} -setup { set i [interp create] set a 0 set b 0 set c a proc cb1 {} { global c incr ::$c } proc cb2 {newlimit args} { global c i set c b $i limit command -value $newlimit } } -body { interp alias $i foo {} cb1 set curlim [$i eval info cmdcount] $i limit command -command "cb2 {}" -value [expr {$curlim + 10}] $i eval {for {set i 0} {$i<10} {incr i} {foo}} list $a $b $c } -result {6 4 b} -cleanup { interp delete $i rename cb1 {} rename cb2 {} } test interp-34.6 {limits with callbacks: removing limits and handlers} -setup { set i [interp create] set a 0 set b 0 set c a proc cb1 {} { global c incr ::$c } proc cb2 {args} { global c i set c b $i limit command -value {} -command {} } } -body { interp alias $i foo {} cb1 set curlim [$i eval info cmdcount] $i limit command -command cb2 -value [expr {$curlim + 10}] $i eval {for {set i 0} {$i<10} {incr i} {foo}} list $a $b $c } -result {6 4 b} -cleanup { interp delete $i rename cb1 {} rename cb2 {} } test interp-34.7 {limits with callbacks: deleting the handler interp} -setup { set i [interp create] $i eval { set i [interp create] proc cb1 {} { global c incr ::$c } proc cb2 {args} { global c i curlim set c b $i limit command -value [expr {$curlim + 1000}] trapToParent } } proc cb3 {} { global i subi interp alias [list $i $subi] foo {} cb4 interp delete $i } proc cb4 {} { global n incr n } } -body { set subi [$i eval set i] interp alias $i trapToParent {} cb3 set n 0 $i eval { set a 0 set b 0 set c a interp alias $i foo {} cb1 set curlim [$i eval info cmdcount] $i limit command -command cb2 -value [expr {$curlim + 10}] } $i eval { $i eval { for {set i 0} {$i<10} {incr i} {foo} } } list $n [interp exists $i] } -result {4 0} -cleanup { rename cb3 {} rename cb4 {} } # Bug 1085023 test interp-34.8 {time limits trigger in vwaits} -body { set i [interp create] interp limit $i time {*}[_ms_limit_args 50] -granularity 1 $i eval { set x {} vwait x } } -cleanup { interp delete $i } -returnCodes error -result {limit exceeded} test interp-34.9 {time limits trigger in blocking after} { set i [interp create] set t0 [clock milliseconds] interp limit $i time {*}[_ms_limit_args 50 $t0] -granularity 1 set code [catch { $i eval {after 10000} } msg] set t1 [clock milliseconds] interp delete $i list $code $msg [expr {($t1-$t0) < 1000 ? "OK" : $t1-$t0}] } {1 {time limit exceeded} OK} test interp-34.10 {time limits trigger in vwaits: Bug 1221395} -body { set i [interp create] interp alias $i log {} lappend result set result {} $i limit time {*}[_ms_limit_args 50] -granularity 4 catch { $i eval { log 1 after 100 log 2 } } msg interp delete $i lappend result $msg } -result {1 {time limit exceeded}} test interp-34.11 {time limit extension in callbacks} -constraints knownBug -setup { proc cb1 {i args} { global result lappend result cb1 $i limit time {*}[_ms_limit_args {*}$args] -command cb2 } proc cb2 {} { global result lappend result cb2 } } -body { set i [interp create] set t0 [clock milliseconds] $i limit time {*}[_ms_limit_args 50 $t0] \ -command "cb1 $i 100 $t0" set ::result {} lappend ::result [catch { $i eval { for {set i 0} {$i<30} {incr i} { after 100 } } } msg] $msg set t1 [clock milliseconds] lappend ::result [expr {$t1-$t0>=100 ? "ok" : "$t0,$t1"}] interp delete $i return $::result } -result {cb1 cb2 1 {time limit exceeded} ok} -cleanup { rename cb1 {} rename cb2 {} } test interp-34.12 {time limit extension in callbacks} -setup { proc cb1 {i t0} { global result times lappend result cb1 set times [lassign $times t] $i limit time {*}[_ms_limit_args $t $t0] } } -body { set i [interp create] set t0 [clock milliseconds] set ::times {100 10000} $i limit time {*}[_ms_limit_args 50] -granularity 1 -command "cb1 $i $t0" set ::result {} lappend ::result [catch { $i eval { for {set i 0} {$i<5} {incr i} { after 50 } } } msg] $msg set t1 [clock milliseconds] lappend ::result [expr {$t1-$t0>=100 ? "ok" : "$t0,$t1"}] interp delete $i return $::result } -result {cb1 cb1 0 {} ok} -cleanup { rename cb1 {} } test interp-34.13 {time limit granularity and vwait: Bug 2891362} -setup { set i [interp create -safe] } -body { $i limit time {*}[_ms_limit_args 50] $i eval { after 2000 set x timeout vwait x return $x } } -cleanup { interp delete $i } -returnCodes error -result {limit exceeded} test interp-34.14 {[Bug e3f4a8b78d]: interp limit and interp eval} -setup { set i [interp create] set result {} } -body { $i limit command -value [$i eval {info cmdcount}] -granularity 1 lappend result [catch {$i eval [list expr 1+3]} msg] $msg lappend result [catch {$i eval [list expr 1+3]} msg] $msg lappend result [catch {$i eval {set cmd expr; $cmd 1+3}} msg] $msg lappend result [catch {$i eval {expr 1+3}} msg] $msg lappend result [catch {$i eval expr 1+3} msg] $msg lappend result [catch {interp eval $i [list expr 1+3]} msg] $msg } -cleanup { interp delete $i } -result [lrepeat 6 1 {command count limit exceeded}] test interp-35.1 {interp limit syntax} -body { interp limit } -returnCodes error -result {wrong # args: should be "interp limit path limitType ?-option value ...?"} test interp-35.2 {interp limit syntax} -body { interp limit {} } -returnCodes error -result {wrong # args: should be "interp limit path limitType ?-option value ...?"} test interp-35.3 {interp limit syntax} -body { interp limit {} foo } -returnCodes error -result {bad limit type "foo": must be commands or time} test interp-35.4 {interp limit syntax} -body { set i [interp create] set dict [interp limit $i commands] set result {} foreach key [lsort [dict keys $dict]] { lappend result $key [dict get $dict $key] } set result } -cleanup { interp delete $i } -result {-command {} -granularity 1 -value {}} test interp-35.5 {interp limit syntax} -body { set i [interp create] interp limit $i commands -granularity } -cleanup { interp delete $i } -result 1 test interp-35.6 {interp limit syntax} -body { set i [interp create] interp limit $i commands -granularity 2 } -cleanup { interp delete $i } -result {} test interp-35.7 {interp limit syntax} -body { set i [interp create] interp limit $i commands -foobar } -cleanup { interp delete $i } -returnCodes error -result {bad option "-foobar": must be -command, -granularity, or -value} test interp-35.8 {interp limit syntax} -body { set i [interp create] interp limit $i commands -granularity foobar } -cleanup { interp delete $i } -returnCodes error -result {expected integer but got "foobar"} test interp-35.9 {interp limit syntax} -body { set i [interp create] interp limit $i commands -granularity 0 } -cleanup { interp delete $i } -returnCodes error -result {granularity must be at least 1} test interp-35.10 {interp limit syntax} -body { set i [interp create] interp limit $i commands -value foobar } -cleanup { interp delete $i } -returnCodes error -result {expected integer but got "foobar"} test interp-35.11 {interp limit syntax} -body { set i [interp create] interp limit $i commands -value -1 } -cleanup { interp delete $i } -returnCodes error -result {command limit value must be at least 0} test interp-35.12 {interp limit syntax} -body { set i [interp create] set dict [interp limit $i time] set result {} foreach key [lsort [dict keys $dict]] { lappend result $key [dict get $dict $key] } set result } -cleanup { interp delete $i } -result {-command {} -granularity 10 -milliseconds {} -seconds {}} test interp-35.13 {interp limit syntax} -body { set i [interp create] interp limit $i time -granularity } -cleanup { interp delete $i } -result 10 test interp-35.14 {interp limit syntax} -body { set i [interp create] interp limit $i time -granularity 2 } -cleanup { interp delete $i } -result {} test interp-35.15 {interp limit syntax} -body { set i [interp create] interp limit $i time -foobar } -cleanup { interp delete $i } -returnCodes error -result {bad option "-foobar": must be -command, -granularity, -milliseconds, or -seconds} test interp-35.16 {interp limit syntax} -body { set i [interp create] interp limit $i time -granularity foobar } -cleanup { interp delete $i } -returnCodes error -result {expected integer but got "foobar"} test interp-35.17 {interp limit syntax} -body { set i [interp create] interp limit $i time -granularity 0 } -cleanup { interp delete $i } -returnCodes error -result {granularity must be at least 1} test interp-35.18 {interp limit syntax} -body { set i [interp create] interp limit $i time -seconds foobar } -cleanup { interp delete $i } -returnCodes error -result {expected integer but got "foobar"} test interp-35.19 {interp limit syntax} -body { set i [interp create] interp limit $i time -seconds -1 } -cleanup { interp delete $i } -returnCodes error -result {seconds must be non-negative} test interp-35.20 {interp limit syntax} -body { set i [interp create] interp limit $i time -millis foobar } -cleanup { interp delete $i } -returnCodes error -result {expected integer but got "foobar"} test interp-35.21 {interp limit syntax} -body { set i [interp create] interp limit $i time -millis -1 } -cleanup { interp delete $i } -returnCodes error -result {milliseconds must be non-negative} test interp-35.22 {interp time limits normalize milliseconds} -body { set i [interp create] interp limit $i time -seconds 1 -millis 1500 list [$i limit time -seconds] [$i limit time -millis] } -cleanup { interp delete $i } -result {2 500} # Bug 3398794 test interp-35.23 {interp command limits can't touch current interp} -body { interp limit {} commands -value 10 } -returnCodes error -result {limits on current interpreter inaccessible} test interp-35.24 {interp time limits can't touch current interp} -body { interp limit {} time -seconds 2 } -returnCodes error -result {limits on current interpreter inaccessible} test interp-36.1 {interp bgerror syntax} -body { interp bgerror } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} test interp-36.2 {interp bgerror syntax} -body { interp bgerror x y z } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} test interp-36.3 {interp bgerror syntax} -setup { interp create child } -body { child bgerror x y } -cleanup { interp delete child } -returnCodes error -result {wrong # args: should be "child bgerror ?cmdPrefix?"} test interp-36.4 {ChildBgerror syntax} -setup { interp create child } -body { child bgerror \{ } -cleanup { interp delete child } -returnCodes error -result {cmdPrefix must be list of length >= 1} test interp-36.5 {ChildBgerror syntax} -setup { interp create child } -body { child bgerror {} } -cleanup { interp delete child } -returnCodes error -result {cmdPrefix must be list of length >= 1} test interp-36.6 {ChildBgerror returns handler} -setup { interp create child } -body { child bgerror {foo bar soom} } -cleanup { interp delete child } -result {foo bar soom} test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup { interp create child child alias handler handler child bgerror handler variable result {untouched} proc handler {args} { variable result set result [lindex $args 0] } } -body { child eval { variable done {} after 0 error foo after 10 [list ::set [namespace which -variable done] {}] vwait [namespace which -variable done] } set result } -cleanup { variable result {} unset -nocomplain result interp delete child } -result foo test interp-37.1 {safe interps and min() and max(): Bug 2895741} -setup { catch {interp delete a} interp create a set result {} } -body { interp create {a b} -safe lappend result [interp eval a {expr {min(5,2,3)*max(7,13,11)}}] lappend result [interp eval {a b} {expr {min(5,2,3)*max(7,13,11)}}] } -cleanup { unset -nocomplain result interp delete a } -result {26 26} test interp-38.1 {interp debug one-way switch} -setup { catch {interp delete a} interp create a interp debug a -frame 1 } -body { # TIP #3xx interp debug frame is a one-way switch interp debug a -frame 0 } -cleanup { interp delete a } -result {1} test interp-38.2 {interp debug env var} -setup { catch {interp delete a} set ::env(TCL_INTERP_DEBUG_FRAME) 1 interp create a } -body { interp debug a } -cleanup { unset -nocomplain ::env(TCL_INTERP_DEBUG_FRAME) interp delete a } -result {-frame 1} test interp-38.3 {interp debug wrong args} -body { interp debug } -returnCodes { error } -result {wrong # args: should be "interp debug path ?-frame ?bool??"} test interp-38.4 {interp debug basic setup} -constraints {!singleTestInterp} -body { interp debug {} } -result {-frame 0} test interp-38.5 {interp debug basic setup} -constraints {!singleTestInterp} -body { interp debug {} -f } -result {0} test interp-38.6 {interp debug basic setup} -body { interp debug -frames } -returnCodes error -result {could not find interpreter "-frames"} test interp-38.7 {interp debug basic setup} -body { interp debug {} -frames } -returnCodes error -result {bad debug option "-frames": must be -frame} test interp-38.8 {interp debug basic setup} -body { interp debug {} -frame 0 bogus } -returnCodes { error } -result {wrong # args: should be "interp debug path ?-frame ?bool??"} # cleanup unset -nocomplain hidden_cmds foreach i [interp children] { interp delete $i } rename _ms_limit_args {} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/internals.tcl0000644000175000017500000000603115104661341015414 0ustar sergeisergei# This file contains internal facilities for Tcl tests. # # Source this file in the related tests to include from tcl-tests: # # source [file join [file dirname [info script]] internals.tcl] # # Copyright © 2020 Sergey G. Brester (sebres). # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[namespace which -command ::tcltest::internals::scriptpath] eq ""} {namespace eval ::tcltest::internals { namespace path ::tcltest ::tcltest::ConstraintInitializer testWithLimit { expr {[testConstraint macOrUnix] && ![catch { exec prlimit --version }]} } # test-with-limit -- # # Usage: test-with-limit ?-addmem bytes? ?-maxmem bytes? command # Options: # -addmem - set additional memory limit (in bytes) as difference (extra memory needed to run a test) # -maxmem - set absolute maximum address space limit (in bytes) # proc testWithLimit args { set body [lindex $args end] array set in [lrange $args 0 end-1] # test in child process (with limits): set pipe {} if {[catch { # start new process: set pipe [open |[list [interpreter]] r+] set ppid [pid $pipe] # create prlimit args: set args {} # with limited address space: if {[info exists in(-addmem)] || [info exists in(-maxmem)]} { if {[info exists in(-addmem)]} { # as difference to normal usage, so try to retrieve current memory usage: if {[catch { # using ps (vsz is in KB): incr in(-addmem) [expr {[lindex [exec ps -hq $ppid -o vsz] end] * 1024}] }]} { # ps failed, use default size 20MB: incr in(-addmem) 20000000 # + size of locale-archive (may be up to 100MB): incr in(-addmem) [expr { [file exists /usr/lib/locale/locale-archive] ? [file size /usr/lib/locale/locale-archive] : 0 }] } if {![info exists in(-maxmem)]} { set in(-maxmem) $in(-addmem) } set in(-maxmem) [expr { max($in(-addmem), $in(-maxmem)) }] } append args --as=$in(-maxmem) } # apply limits: exec prlimit -p $ppid {*}$args } msg opt]} { catch {close $pipe} tcltest::Warn "testWithLimit: error - [regsub {^\s*([^\n]*).*$} $msg {\1}]" tcltest::Skip testWithLimit } # execute body, close process and return: set ret [catch { chan configure $pipe -buffering line puts $pipe "puts \[$body\]" puts $pipe exit set result [read $pipe] close $pipe set pipe {} set result } result opt] if {$pipe ne ""} { catch { close $pipe } } if {$ret && [dict get $opt -errorcode] eq "BYPASS-SKIPPED-TEST"} { return {*}$opt $result } if { ( [info exists in(-warn-on-code)] && $ret in $in(-warn-on-code) ) || ( $ret && [info exists in(-warn-on-alloc-error)] && $in(-warn-on-alloc-error) && [regexp {\munable to (?:re)?alloc\M} $result] ) } { tcltest::Warn "testWithLimit: wrong limit, result: $result" tcltest::Skip testWithLimit } return {*}$opt $result } # export all routines starting with test namespace export test* # for script path & as mark for loaded proc scriptpath {} [list return [info script]] }}; # end of internals.tcl9.0.3/tests/init.test0000644000175000017500000001750215104661341014562 0ustar sergeisergei# Functionality covered: this file contains a collection of tests for the auto # loading and namespaces. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Clear out any namespaces called test_ns_* catch {namespace delete {*}[namespace children :: test_ns_*]} test init-0.1 {no error on initialization phase (init.tcl)} -setup { interp create child } -body { child eval { list [set v [info exists ::errorInfo]] \ [if {$v} {set ::errorInfo}] \ [set v [info exists ::errorCode]] \ [if {$v} {set ::errorCode}] } } -cleanup { interp delete child } -result {0 {} 0 {}} test init-0.2 {no init.tcl from empty tcl_library, bug [43c94f95988f3057]} -setup { cd [makeDirectory tmp] makeFile {set ::TEST_INIT 1} init.tcl [pwd] unset -nocomplain org_tcl_lib if {[info exists ::env(TCL_LIBRARY)]} { set org_tcl_lib $::env(TCL_LIBRARY) } set res [file exists [file join [pwd] init.tcl]] } -body { # first without tcl_library set: interp create child lappend res [child eval {info exists ::TEST_INIT}]; # must be 0 interp delete child # then with current directory as tcl_library: set ::env(TCL_LIBRARY) . interp create child lappend res [child eval {info exists ::TEST_INIT}]; # must be 1 interp delete child set res } -cleanup { if {[info exists org_tcl_lib]} { set ::env(TCL_LIBRARY) $org_tcl_lib unset org_tcl_lib } else { unset -nocomplain ::env(TCL_LIBRARY) } removeFile init.tcl [pwd] cd [workingDirectory] removeDirectory tmp unset -nocomplain res catch { interp delete child } } -result {1 0 1} # Six cases - white box testing test init-1.1 {auto_qualify - absolute cmd - namespace} { auto_qualify ::foo::bar ::blue } ::foo::bar test init-1.2 {auto_qualify - absolute cmd - global} { auto_qualify ::global ::sub } global test init-1.3 {auto_qualify - no colons cmd - global} { auto_qualify nocolons :: } nocolons test init-1.4 {auto_qualify - no colons cmd - namespace} { auto_qualify nocolons ::sub } {::sub::nocolons nocolons} test init-1.5 {auto_qualify - colons in cmd - global} { auto_qualify foo::bar :: } ::foo::bar test init-1.6 {auto_qualify - colons in cmd - namespace} { auto_qualify foo::bar ::sub } {::sub::foo::bar ::foo::bar} # Some additional tests test init-1.7 {auto_qualify - multiples colons 1} { auto_qualify :::foo::::bar ::blue } ::foo::bar test init-1.8 {auto_qualify - multiple colons 2} { auto_qualify :::foo ::bar } foo # We use a child interp and auto_reset and double the tests because there is 2 # places where auto_loading occur (before loading the indexes files and after) set testInterp [interp create] tcltest::loadIntoChildInterpreter $testInterp {*}$argv interp eval $testInterp { namespace import -force ::tcltest::* customMatch pairwise {apply {{mode pair} { if {[llength $pair] != 2} {error "need a pair of values to check"} string $mode [lindex $pair 0] [lindex $pair 1] }}} auto_reset catch {rename parray {}} test init-2.0 {load parray - stage 1} -body { parray } -returnCodes error -cleanup { rename parray {} ;# remove it, for the next test - that should not fail. } -result {wrong # args: should be "parray a ?pattern?"} test init-2.1 {load parray - stage 2} -body { parray } -returnCodes error -result {wrong # args: should be "parray a ?pattern?"} auto_reset catch {rename ::safe::setLogCmd {}} #unset -nocomplain auto_index(::safe::setLogCmd) auto_oldpath test init-2.2 {load ::safe::setLogCmd - stage 1} { ::safe::setLogCmd rename ::safe::setLogCmd {} ;# should not fail } {} test init-2.3 {load ::safe::setLogCmd - stage 2} { ::safe::setLogCmd rename ::safe::setLogCmd {} ;# should not fail } {} auto_reset catch {rename ::safe::setLogCmd {}} test init-2.4 {load safe:::setLogCmd - stage 1} { safe:::setLogCmd ;# intentionally 3 : rename ::safe::setLogCmd {} ;# should not fail } {} test init-2.5 {load safe:::setLogCmd - stage 2} { safe:::setLogCmd ;# intentionally 3 : rename ::safe::setLogCmd {} ;# should not fail } {} auto_reset catch {rename ::safe::setLogCmd {}} test init-2.6 {load setLogCmd from safe:: - stage 1} { namespace eval safe setLogCmd rename ::safe::setLogCmd {} ;# should not fail } {} test init-2.7 {oad setLogCmd from safe:: - stage 2} { namespace eval safe setLogCmd rename ::safe::setLogCmd {} ;# should not fail } {} test init-2.8 {load tcl::HistAdd} -setup { auto_reset catch {rename ::tcl::HistAdd {}} } -body { # 3 ':' on purpose tcl:::HistAdd } -returnCodes error -cleanup { rename ::tcl::HistAdd {} } -result {wrong # args: should be "tcl:::HistAdd event ?exec?"} test init-3.0 {random stuff in the auto_index, should still work} { set auto_index(foo:::bar::blah) { namespace eval foo {namespace eval bar {proc blah {} {return 1}}} } foo:::bar::blah } 1 # Tests that compare the error stack trace generated when autoloading with # that generated when no autoloading is necessary. Ideally they should be the # same. set count 0 foreach arg [subst -nocommands -novariables { c {argument which spans multiple lines} {argument which is all on one line but which is of such great length that the Tcl C library will truncate it when appending it onto the global error stack} {argument which spans multiple lines and is long enough to be truncated and " <- includes a false lead in the prune point search and must be longer still to force truncation} {contrived example: rare circumstance where the point at which to prune the error stack cannot be uniquely determined. foo bar foo "} {contrived example: rare circumstance where the point at which to prune the error stack cannot be uniquely determined. foo bar "} {argument that contains non-ASCII character, €, and which is of such great length that it will be longer than 150 bytes so it will be truncated by the Tcl C library} }] { ;# emacs needs -> " test init-4.$count.0 {::errorInfo produced by [unknown]} -setup { auto_reset } -body { catch {parray a b $arg} set first $::errorInfo catch {parray a b $arg} list $first $::errorInfo } -match pairwise -result equal test init-4.$count.1 {::errorInfo produced by [unknown]} -setup { auto_reset } -body { namespace eval junk [list array set $arg [list 1 2 3 4]] trace add variable ::junk::$arg read \ "[list error [subst {Variable \"$arg\" is write-only}]] ;# " catch {parray ::junk::$arg} set first $::errorInfo catch {parray ::junk::$arg} list $first $::errorInfo } -match pairwise -result equal incr count } test init-4.$count {[Bug 46f801ed5a]} -setup { auto_reset array set auto_index {demo {proc demo {} {tailcall error foo}}} } -body { demo } -cleanup { array unset auto_index demo rename demo {} } -returnCodes error -result foo test init-5.0 {return options passed through ::unknown} -setup { catch {rename xxx {}} set ::auto_index(::xxx) {proc ::xxx {} { return -code error -level 2 xxx }} } -body { set code [catch {::xxx} foo bar] set code2 [catch {::xxx} foo2 bar2] list $code $foo $bar $code2 $foo2 $bar2 } -cleanup { unset ::auto_index(::xxx) } -match glob -result {2 xxx {-errorcode NONE -code 1 -level 1} 2 xxx {-code 1 -level 1 -errorcode NONE}} cleanupTests } ;# End of [interp eval $testInterp] # cleanup interp delete $testInterp ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/info.test0000644000175000017500000023777515104661341014572 0ustar sergeisergei# -*- tcl -*- # Commands covered: info # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2006 ActiveState # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # DO NOT DELETE THIS LINE if {{::tcltest} ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint zlib [llength [info commands zlib]] # Set up namespaces needed to test operation of "info args", "info body", # "info default", and "info procs" with imported procedures. catch {namespace delete test_ns_info1 test_ns_info2} namespace eval test_ns_info1 { namespace export * proc p {x} {return "x=$x"} proc q {{y 27} {z {}}} {return "y=$y"} } test info-1.1 {info args option} { proc t1 {a bbb c} {return foo} info args t1 } {a bbb c} test info-1.2 {info args option} { proc t1 {{a default1} {bbb default2} {c default3} args} {return foo} info a t1 } {a bbb c args} test info-1.3 {info args option} { proc t1 "" {return foo} info args t1 } {} test info-1.4 {info args option} -body { catch {rename t1 {}} info args t1 } -returnCodes error -result {"t1" isn't a procedure} test info-1.5 {info args option} -body { info args set } -returnCodes error -result {"set" isn't a procedure} test info-1.6 {info args option} { proc t1 {a b} {set c 123; set d $c} t1 1 2 info args t1 } {a b} test info-1.7 {info args option} { catch {namespace delete test_ns_info2} namespace eval test_ns_info2 { namespace import ::test_ns_info1::* list [info args p] [info args q] } } {x {y z}} test info-2.1 {info body option} { proc t1 {} {body of t1} info body t1 } {body of t1} test info-2.2 {info body option} -body { info body set } -returnCodes error -result {"set" isn't a procedure} test info-2.3 {info body option} -body { info args set 1 } -returnCodes error -result {wrong # args: should be "info args procname"} test info-2.4 {info body option} { catch {namespace delete test_ns_info2} namespace eval test_ns_info2 { namespace import ::test_ns_info1::* list [info body p] [info body q] } } {{return "x=$x"} {return "y=$y"}} # Prior to 8.3.0 this would cause a crash because [info body] # would return the bytecompiled version of foo, which the catch # would then try and eval out of the foo context, accessing # compiled local indices test info-2.5 {info body option, returning bytecompiled bodies} -body { catch {unset args} proc foo {args} { foreach v $args { upvar $v var return "variable $v existence: [info exists var]" } } foo a eval [info body foo] } -returnCodes error -result {can't read "args": no such variable} # Fix for problem tested for in info-2.5 caused problems when # procedure body had no string rep (i.e. was not yet bytecode) # causing an empty string to be returned [Bug #545644] test info-2.6 {info body option, returning list bodies} { proc foo args [list subst bar] list [string length [info body foo]] \ [foo; string length [info body foo]] } {9 9} proc testinfocmdcount {} { set x [info cmdcount] set y 12345 set z [info cmdc] expr {$z-$x} } test info-3.1 {info cmdcount compiled} { testinfocmdcount } 4 test info-3.2 {info cmdcount evaled} -body { set x [info cmdcount] set y 12345 set z [info cmdc] expr {$z-$x} } -cleanup {unset x y z} -result 4 test info-3.3 {info cmdcount evaled} -body [info body testinfocmdcount] -cleanup {unset x y z} -result 4 test info-3.4 {info cmdcount option} -body { info cmdcount 1 } -returnCodes error -result {wrong # args: should be "info cmdcount"} test info-4.1 {info commands option} -body { proc t1 {} {} proc t2 {} {} set x " [info commands] " list [string match {* t1 *} $x] [string match {* t2 *} $x] \ [string match {* set *} $x] [string match {* list *} $x] } -cleanup {unset x} -result {1 1 1 1} test info-4.2 {info commands option} -body { proc t1 {} {} rename t1 {} string match {* t1 *} \ [info comm] } -result 0 test info-4.3 {info commands option} { proc _t1_ {} {} proc _t2_ {} {} info commands _t1_ } _t1_ test info-4.4 {info commands option} { proc _t1_ {} {} proc _t2_ {} {} lsort [info commands _t*] } {_t1_ _t2_} catch {rename _t1_ {}} catch {rename _t2_ {}} test info-4.5 {info commands option} -returnCodes error -body { info commands a b } -result {wrong # args: should be "info commands ?pattern?"} # Also some tests in namespace.test test info-5.1 {info complete option} -body { info complete } -returnCodes error -result {wrong # args: should be "info complete command"} test info-5.2 {info complete option} { info complete abc } 1 test info-5.3 {info complete option} { info complete "\{abcd " } 0 test info-5.4 {info complete option} { info complete {# Comment should be complete command} } 1 test info-5.5 {info complete option} { info complete {[a [b] } } 0 test info-5.6 {info complete option} { info complete {[a [b]} } 0 test info-6.1 {info default option} { proc t1 {a b {c d} {e "long default value"}} {} info default t1 a value } 0 test info-6.2 {info default option} -body { proc t1 {a b {c d} {e "long default value"}} {} set value 12345 info d t1 a value return $value } -cleanup {unset value} -result {} test info-6.3 {info default option} -body { proc t1 {a b {c d} {e "long default value"}} {} info default t1 c value } -cleanup {unset value} -result 1 test info-6.4 {info default option} -body { proc t1 {a b {c d} {e "long default value"}} {} set value 12345 info default t1 c value return $value } -cleanup {unset value} -result d test info-6.5 {info default option} -body { proc t1 {a b {c d} {e "long default value"}} {} set value 12345 set x [info default t1 e value] list $x $value } -cleanup {unset x value} -result {1 {long default value}} test info-6.6 {info default option} -returnCodes error -body { info default a b } -result {wrong # args: should be "info default procname arg varname"} test info-6.7 {info default option} -returnCodes error -body { info default _nonexistent_ a b } -result {"_nonexistent_" isn't a procedure} test info-6.8 {info default option} -returnCodes error -body { proc t1 {a b} {} info default t1 x value } -result {procedure "t1" doesn't have an argument "x"} test info-6.9 {info default option} -returnCodes error -setup { catch {unset a} } -cleanup {unset a} -body { set a(0) 88 proc t1 {a b} {} info default t1 a a } -returnCodes error -result {can't set "a": variable is array} test info-6.10 {info default option} -setup { catch {unset a} } -cleanup {unset a} -body { set a(0) 88 proc t1 {{a 18} b} {} info default t1 a a } -returnCodes error -result {can't set "a": variable is array} test info-6.11 {info default option} { catch {namespace delete test_ns_info2} namespace eval test_ns_info2 { namespace import ::test_ns_info1::* list [info default p x foo] $foo [info default q y bar] $bar } } {0 {} 1 27} test info-7.1 {info exists option} -body { set value foo info exists value } -cleanup {unset value} -result 1 test info-7.2 {info exists option} -setup {catch {unset _nonexistent_}} -body { info exists _nonexistent_ } -result 0 test info-7.3 {info exists option} { proc t1 {x} {return [info exists x]} t1 2 } 1 test info-7.4 {info exists option} -body { proc t1 {x} { global _nonexistent_ return [info exists _nonexistent_] } t1 2 } -setup {unset -nocomplain _nonexistent_} -result 0 test info-7.5 {info exists option} { proc t1 {x} { set y 47 return [info exists y] } t1 2 } 1 test info-7.6 {info exists option} { proc t1 {x} {return [info exists value]} t1 2 } 0 test info-7.7 {info exists option} -setup { catch {unset x} } -body { set x(2) 44 list [info exists x] [info exists x(1)] [info exists x(2)] } -result {1 0 1} catch {unset x} test info-7.8 {info exists option} -body { info exists } -returnCodes error -result {wrong # args: should be "info exists varName"} test info-7.9 {info exists option} -body { info exists 1 2 } -returnCodes error -result {wrong # args: should be "info exists varName"} test info-8.1 {info globals option} -body { set x 1 set y 2 set value 23 set a " [info globals] " list [string match {* x *} $a] [string match {* y *} $a] \ [string match {* value *} $a] [string match {* _foobar_ *} $a] } -cleanup {unset x y value a} -result {1 1 1 0} test info-8.2 {info globals option} -body { set _xxx1 1 set _xxx2 2 lsort [info g _xxx*] } -cleanup {unset _xxx1 _xxx2} -result {_xxx1 _xxx2} test info-8.3 {info globals option} -returnCodes error -body { info globals 1 2 } -result {wrong # args: should be "info globals ?pattern?"} test info-8.4 {info globals option: may have leading namespace qualifiers} -body { set x 0 list [info globals x] [info globals :x] [info globals ::x] [info globals :::x] [info globals ::::x] } -cleanup {unset x} -result {x {} x x x} test info-8.5 {info globals option: only return existing global variables} { -setup { unset -nocomplain ::NO_SUCH_VAR proc evalInProc script {eval $script} } -body { evalInProc {global NO_SUCH_VAR; info globals NO_SUCH_VAR} } -cleanup { rename evalInProc {} } -result {} } test info-9.1 {info level option} { info level } 0 test info-9.2 {info level option} { proc t1 {a b} { set x [info le] set y [info level 1] list $x $y } t1 146 testString } {1 {t1 146 testString}} test info-9.3 {info level option} { proc t1 {a b} { t2 [expr {$a*2}] $b } proc t2 {x y} { list [info level] [info level 1] [info level 2] [info level -1] \ [info level 0] } t1 146 {a {b c} {{{c}}}} } {2 {t1 146 {a {b c} {{{c}}}}} {t2 292 {a {b c} {{{c}}}}} {t1 146 {a {b c} {{{c}}}}} {t2 292 {a {b c} {{{c}}}}}} test info-9.4 {info level option} { proc t1 {} { set x [info level] set y [info level 1] list $x $y } t1 } {1 t1} test info-9.5 {info level option} -body { info level 1 2 } -returnCodes error -result {wrong # args: should be "info level ?number?"} test info-9.6 {info level option} -body { info level 123a } -returnCodes error -result {expected integer but got "123a"} test info-9.7 {info level option} -body { info level 0 } -returnCodes error -result {bad level "0"} test info-9.8 {info level option} -body { proc t1 {} {info level -1} t1 } -returnCodes error -result {bad level "-1"} test info-9.9 {info level option} -body { proc t1 {x} {info level $x} t1 -3 } -returnCodes error -result {bad level "-3"} test info-9.10 {info level option, namespaces} -body { namespace eval t {info level 0} } -cleanup { namespace delete t } -result {namespace eval t {info level 0}} test info-9.11 {info level option, aliases} -constraints knownBug -setup { proc w {x y z} {info level 0} interp alias {} a {} w a b } -body { a c } -cleanup { rename a {} rename w {} } -result {a c} test info-9.12 {info level option, ensembles} -constraints knownBug -setup { proc w {x y z} {info level 0} namespace ensemble create -command a -map {foo ::w} } -body { a foo 1 2 3 } -cleanup { rename a {} rename w {} } -result {a foo 1 2 3} set savedLibrary $tcl_library test info-10.1 {info library option} -body { info library x } -returnCodes error -result {wrong # args: should be "info library"} test info-10.2 {info library option} { set tcl_library 12345 info library } {12345} test info-10.3 {info library option} -body { unset tcl_library info library } -returnCodes error -result {no library has been specified for Tcl} set tcl_library $savedLibrary; unset savedLibrary test info-11.1 {info loaded option} -body { info loaded a b c } -returnCodes error -result {wrong # args: should be "info loaded ?interp? ?prefix?"} test info-11.2 {info loaded option} -body { info loaded {}; info loaded gorp } -returnCodes error -result {could not find interpreter "gorp"} test info-12.1 {info locals option} -body { set a 22 proc t1 {x y} { set b 13 set c testing global a global aa set aa 23 return [info locals] } lsort [t1 23 24] } -cleanup {unset a aa} -result {b c x y} test info-12.2 {info locals option} { proc t1 {x y} { set xx1 2 set xx2 3 set y 4 return [info locals x*] } lsort [t1 2 3] } {x xx1 xx2} test info-12.3 {info locals option} -body { info locals 1 2 } -returnCodes error -result {wrong # args: should be "info locals ?pattern?"} test info-12.4 {info locals option} { info locals } {} test info-12.5 {info locals option} { proc t1 {} {return [info locals]} t1 } {} test info-12.6 {info locals vs unset compiled locals} { proc t1 {lst} { foreach $lst $lst {} unset lst return [info locals] } lsort [t1 {a b c c d e f}] } {a b c d e f} test info-12.7 {info locals with temporary variables} { proc t1 {} { foreach a {b c} {} info locals } t1 } {a} test info-13.1 {info nameofexecutable option} -returnCodes error -body { info nameofexecutable foo } -result {wrong # args: should be "info nameofexecutable"} test info-14.1 {info patchlevel option} -body { set a [info patchlevel] regexp {[0-9]+\.[0-9]+([p[0-9]+)?} $a } -cleanup {unset a} -result 1 test info-14.2 {info patchlevel option} -returnCodes error -body { info patchlevel a } -result {wrong # args: should be "info patchlevel"} test info-14.3 {info patchlevel option} -setup { set t $tcl_patchLevel } -body { unset tcl_patchLevel info patchlevel } -cleanup { set tcl_patchLevel $t; unset t } -returnCodes error -result {can't read "tcl_patchLevel": no such variable} test info-15.1 {info procs option} -body { proc t1 {} {} proc t2 {} {} set x " [info procs] " list [string match {* t1 *} $x] [string match {* t2 *} $x] \ [string match {* _undefined_ *} $x] } -cleanup {unset x} -result {1 1 0} test info-15.2 {info procs option} { proc _tt1 {} {} proc _tt2 {} {} lsort [info pr _tt*] } {_tt1 _tt2} catch {rename _tt1 {}} catch {rename _tt2 {}} test info-15.3 {info procs option} -body { info procs 2 3 } -returnCodes error -result {wrong # args: should be "info procs ?pattern?"} test info-15.4 {info procs option} -setup { catch {namespace delete test_ns_info2} } -body { namespace eval test_ns_info2 { namespace import ::test_ns_info1::* proc r {} {} list [lsort [info procs]] [info procs p*] } } -result {{p q r} p} test info-15.5 {info procs option with a proc in a namespace} -setup { catch {namespace delete test_ns_info2} } -body { namespace eval test_ns_info2 { proc p1 { arg } { puts cmd } proc p2 { arg } { puts cmd } } info procs ::test_ns_info2::p1 } -result {::test_ns_info2::p1} test info-15.6 {info procs option with a pattern in a namespace} -setup { catch {namespace delete test_ns_info2} } -body { namespace eval test_ns_info2 { proc p1 { arg } { puts cmd } proc p2 { arg } { puts cmd } } lsort [info procs ::test_ns_info2::p*] } -result [lsort [list ::test_ns_info2::p1 ::test_ns_info2::p2]] test info-15.7 {info procs option with a global shadowing proc} -setup { catch {namespace delete test_ns_info2} } -body { proc string_cmd { arg } { puts cmd } namespace eval test_ns_info2 { proc string_cmd { arg } { puts cmd } } info procs test_ns_info2::string* } -result {::test_ns_info2::string_cmd} # This regression test is currently commented out because it requires # that the implementation of "info procs" looks into the global namespace, # which it does not (in contrast to "info commands") test info-15.8 {info procs option with a global shadowing proc} -setup { catch {namespace delete test_ns_info2} } -constraints knownBug -body { proc string_cmd { arg } { puts cmd } proc string_cmd2 { arg } { puts cmd } namespace eval test_ns_info2 { proc string_cmd { arg } { puts cmd } } namespace eval test_ns_info2 { lsort [info procs string*] } } -result [lsort [list string_cmd string_cmd2]] test info-16.1 {info script option} -returnCodes error -body { info script x x } -result {wrong # args: should be "info script ?filename?"} test info-16.2 {info script option} { file tail [info sc] } "info.test" set gorpfile [makeFile "info script\n" gorp.info] test info-16.3 {info script option} { list [source $gorpfile] [file tail [info script]] } [list $gorpfile info.test] test info-16.4 {resetting "info script" after errors} { catch {source ~_nobody_/foo} file tail [info script] } "info.test" test info-16.5 {resetting "info script" after errors} { catch {source _nonexistent_} file tail [info script] } "info.test" test info-16.6 {info script option} -body { set script [info script] list [file tail [info script]] \ [info script newname.txt] \ [file tail [info script $script]] } -result [list info.test newname.txt info.test] -cleanup {unset script} test info-16.7 {info script option} -body { set script [info script] info script newname.txt list [source $gorpfile] [file tail [info script]] \ [file tail [info script $script]] } -result [list $gorpfile newname.txt info.test] -cleanup {unset script} removeFile gorp.info set gorpfile [makeFile {list [info script] [info script foo.bar]} gorp.info] test info-16.8 {info script option} { list [source $gorpfile] [file tail [info script]] } [list [list $gorpfile foo.bar] info.test] removeFile gorp.info; unset gorpfile test info-17.1 {info sharedlibextension option} -returnCodes error -body { info sharedlibextension foo } -result {wrong # args: should be "info sharedlibextension"} test info-18.1 {info tclversion option} -body { scan [info tclversion] "%d.%d%c" a b c } -cleanup {unset -nocomplain a b c} -result 2 test info-18.2 {info tclversion option} -body { info tclv 2 } -returnCodes error -result {wrong # args: should be "info tclversion"} test info-18.3 {info tclversion option} -body { unset tcl_version info tclversion } -returnCodes error -setup { set t $tcl_version } -cleanup { set tcl_version $t; unset t } -result {can't read "tcl_version": no such variable} test info-19.1 {info vars option} -body { set a 1 set b 2 proc t1 {x y} { global a b set c 33 return [info vars] } lsort [t1 18 19] } -cleanup {unset a b} -result {a b c x y} test info-19.2 {info vars option} -body { set xxx1 1 set xxx2 2 proc t1 {xxa y} { global xxx1 xxx2 set c 33 return [info vars x*] } lsort [t1 18 19] } -cleanup {unset xxx1 xxx2} -result {xxa xxx1 xxx2} test info-19.3 {info vars option} { lsort [info vars] } [lsort [info globals]] test info-19.4 {info vars option} -returnCodes error -body { info vars a b } -result {wrong # args: should be "info vars ?pattern?"} test info-19.5 {info vars with temporary variables} { proc t1 {} { foreach a {b c} {} info vars } t1 } {a} test info-19.6 {info vars: Bug 1072654} -setup { namespace eval :: unset -nocomplain foo catch {namespace delete x} } -body { namespace eval x info vars foo } -cleanup { namespace delete x } -result {} set functions {abs acos asin atan atan2 bool ceil cos cosh double entier exp floor fmod hypot int isfinite isinf isnan isnormal isqrt issubnormal isunordered log log10 max min pow rand round sin sinh sqrt srand tan tanh wide} # Check whether the extra testing functions are defined... if {!([catch {expr {T1()}} msg] && ($msg eq {invalid command name "tcl::mathfunc::T1"}))} { set functions "T1 T2 T3 $functions" ;# A lazy way of prepending! } test info-20.1 {info functions option} {info functions sin} sin test info-20.2 {info functions option} {lsort [info functions]} $functions test info-20.3 {info functions option} { lsort [info functions a*] } {abs acos asin atan atan2} test info-20.4 {info functions option} { lsort [info functions *tan*] } {atan atan2 tan tanh} test info-20.5 {info functions option} -returnCodes error -body { info functions raise an error } -result {wrong # args: should be "info functions ?pattern?"} unset functions msg test info-21.1 {miscellaneous error conditions} -returnCodes error -body { info } -result {wrong # args: should be "info subcommand ?arg ...?"} test info-21.2 {miscellaneous error conditions} -returnCodes error -body { info gorp } -result {unknown or ambiguous subcommand "gorp": must be args, body, class, cmdcount, cmdtype, commands, complete, constant, consts, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars} test info-21.3 {miscellaneous error conditions} -returnCodes error -body { info c } -result {unknown or ambiguous subcommand "c": must be args, body, class, cmdcount, cmdtype, commands, complete, constant, consts, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars} test info-21.4 {miscellaneous error conditions} -returnCodes error -body { info l } -result {unknown or ambiguous subcommand "l": must be args, body, class, cmdcount, cmdtype, commands, complete, constant, consts, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars} test info-21.5 {miscellaneous error conditions} -returnCodes error -body { info s } -result {unknown or ambiguous subcommand "s": must be args, body, class, cmdcount, cmdtype, commands, complete, constant, consts, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars} ## # ### ### ### ######### ######### ######### ## info frame ## Helper # For the more complex results we cut the file name down to remove path # dependencies, and we use only part of the first line of the reported # command. The latter is required because otherwise the whole test case may # appear in some results, but the result is part of the testcase. An infinite # string would be required to describe that. The cutting-down breaks this. proc reduce {frame} { set cmd [dict get $frame cmd] if {[regexp \n $cmd]} { dict set frame cmd \ [string range [lindex [split $cmd \n] 0] 0 end-4] } if {[dict exists $frame file]} { dict set frame file \ [file tail [dict get $frame file]] } return $frame } proc subinterp {} { interp create sub ; interp debug sub -frame 1; interp eval sub [list proc reduce [info args reduce] [info body reduce]] } ## Helper # Generate a stacktrace from the current location to top. This code # not only depends on the exact location of things, but also on the # implementation of tcltest. Any changes and these tests will have to # be updated. proc etrace {} { set res {} set level [info frame] while {$level} { lappend res [list $level [reduce [info frame $level]]] incr level -1 } return $res } test info-22.0 {info frame, levels} {!singleTestInterp} { info frame } 7 test info-22.1 {info frame, bad level relative} {!singleTestInterp} { # catch is another level!, i.e. we have 8, not 7 catch {info frame -8} msg set msg } {bad level "-8"} test info-22.2 {info frame, bad level absolute} {!singleTestInterp} { # catch is another level!, i.e. we have 8, not 7 catch {info frame 9} msg set msg } {bad level "9"} test info-22.3 {info frame, current, relative} -match glob -body { info frame 0 } -result {type source line 750 file */info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-22.4 {info frame, current, relative, nested} -match glob -body { set res [info frame 0] } -result {type source line 753 file */info.test cmd {info frame 0} proc ::tcltest::RunTest} -cleanup {unset res} test info-22.5 {info frame, current, absolute} -constraints {!singleTestInterp} -match glob -body { reduce [info frame 7] } -result {type source line 756 file info.test cmd {info frame 7} proc ::tcltest::RunTest} test info-22.6 {info frame, global, relative} {!singleTestInterp} { reduce [info frame -6] } {type source line 758 file info.test cmd test\ info-22.6\ \{info\ frame,\ global,\ relative\}\ \{!singleTestInter level 0} test info-22.7 {info frame, global, absolute} {!singleTestInterp} { reduce [info frame 1] } {type source line 761 file info.test cmd test\ info-22.7\ \{info\ frame,\ global,\ absolute\}\ \{!singleTestInter level 0} test info-22.8 {info frame, basic trace} -match glob -body { join [lrange [etrace] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type source line 765 file info.test cmd etrace proc ::tcltest::RunTest} * {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::RunTest}} unset -nocomplain msg ## The line 1967 is off by 5 from the true value of 1972. This is a knownBug, see testcase 30.0 test info-23.0 {eval'd info frame} -constraints {!singleTestInterp} -body { list [i eval {info frame}] [i eval {eval {info frame}}] } -setup {interp create i} -cleanup {interp delete i} -result {1 2} test info-23.1 {eval'd info frame, semi-dynamic} -constraints {!singleTestInterp} -body { i eval {eval info frame} } -setup {interp create i} -cleanup {interp delete i} -result 2 test info-23.2 {eval'd info frame, dynamic} -constraints {!singleTestInterp} -body { i eval { set script {info frame} eval $script} } -setup {interp create i} -cleanup {interp delete i} -result 2 test info-23.3 {eval'd info frame, literal} -match glob -body { eval { info frame 0 } } -result {type source line 793 file * cmd {info frame 0} proc ::tcltest::RunTest} test info-23.4 {eval'd info frame, semi-dynamic} { eval info frame 0 } {type eval line 1 cmd {info frame 0} proc ::tcltest::RunTest} test info-23.5 {eval'd info frame, dynamic} -cleanup {unset script} -body { set script {info frame 0} eval $script } -result {type eval line 1 cmd {info frame 0} proc ::tcltest::RunTest} test info-23.6 {eval'd info frame, trace} -match glob -cleanup {unset script} -body { set script {etrace} join [lrange [eval $script] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 1 cmd etrace proc ::tcltest::RunTest} * {type source line 805 file info.test cmd {eval $script} proc ::tcltest::RunTest}} # ------------------------------------------------------------------------- # Procedures defined in scripts which are arguments to control # structures (like 'namespace eval', 'interp eval', 'if', 'while', # 'switch', 'catch', 'for', 'foreach', etc.) have no absolute # location. The command implementations execute such scripts through # Tcl_EvalObjEx. Flag 0 causes it to use the bytecode compiler. This # causes the connection to the context to be lost. Currently only # procedure bodies are able to remember their context. # NOTE THAT THESE DO NOT USE THE -setup OPTION TO [test] # ------------------------------------------------------------------------- namespace eval foo { proc bar {} {info frame 0} } test info-24.0 {info frame, interaction, namespace eval} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 825 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- set flag 1 if {$flag} { namespace eval foo {} proc ::foo::bar {} {info frame 0} } test info-24.1 {info frame, interaction, if} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 839 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- set flag 1 while {$flag} { namespace eval foo {} proc ::foo::bar {} {info frame 0} set flag 0 };unset flag test info-24.2 {info frame, interaction, while} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 853 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- catch { namespace eval foo {} proc ::foo::bar {} {info frame 0} } test info-24.3 {info frame, interaction, catch} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 867 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- foreach var val { namespace eval foo {} proc ::foo::bar {} {info frame 0} break }; unset var test info-24.4 {info frame, interaction, foreach} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 880 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- for {} {1} {} { namespace eval foo {} proc ::foo::bar {} {info frame 0} break } test info-24.5 {info frame, interaction, for} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 894 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} set x foo switch -exact -- $x { foo { proc ::foo::bar {} {info frame 0} } } test info-24.6.0 {info frame, interaction, switch, list body} -body { reduce [foo::bar] } -cleanup { namespace delete foo unset x } -result {type source line 910 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} set x foo switch -exact -- $x foo { proc ::foo::bar {} {info frame 0} } test info-24.6.1 {info frame, interaction, switch, multi-body} -body { reduce [foo::bar] } -cleanup { namespace delete foo unset x } -result {type source line 926 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} set x foo switch -exact -- $x [list foo { proc ::foo::bar {} {info frame 0} }] test info-24.6.2 {info frame, interaction, switch, list body, dynamic} -body { reduce [foo::bar] } -cleanup { namespace delete foo unset x } -result {type proc line 1 cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} dict for {k v} {foo bar} { proc ::foo::bar {} {info frame 0} } test info-24.7 {info frame, interaction, dict for} { reduce [foo::bar] } {type source line 955 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo; unset k v # ------------------------------------------------------------------------- namespace eval foo {} set thedict {foo bar} dict with thedict { proc ::foo::bar {} {info frame 0} } test info-24.8 {info frame, interaction, dict with} { reduce [foo::bar] } {type source line 969 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo unset thedict foo # ------------------------------------------------------------------------- namespace eval foo {} dict filter {foo bar} script {k v} { proc ::foo::bar {} {info frame 0} set x 1 }; unset k v x test info-24.9 {info frame, interaction, dict filter} { reduce [foo::bar] } {type source line 983 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo #unset x # ------------------------------------------------------------------------- eval { proc bar {} {info frame 0} } test info-25.0 {info frame, proc in eval} { reduce [bar] } {type source line 997 file info.test cmd {info frame 0} proc ::bar level 0} # Don't need to clean up yet... proc bar {} {info frame 0} test info-25.1 {info frame, regular proc} { reduce [bar] } {type source line 1005 file info.test cmd {info frame 0} proc ::bar level 0} rename bar {} # ------------------------------------------------------------------------- # More info-30.x test cases at the end of the file. test info-30.0 {bs+nl in literal words} -cleanup {unset res} -body { if {1} { set res \ [reduce [info frame 0]];#1018 } return $res # This was reporting line 3 instead of the correct 4 because the # bs+nl combination is subst by the parser before the 'if' # command, and the bcc, see the word. Fixed by recording the # offsets of all bs+nl sequences in literal words, then using the # information in the bcc and other places to bump line numbers when # parsing over the location. Also affected: testcases 22.8 and 23.6. } -result {type source line 1018 file info.test cmd {info frame 0} proc ::tcltest::RunTest} # ------------------------------------------------------------------------- # See 24.0 - 24.5 for similar situations, using literal scripts. set body {set flag 0 set a c set res [info frame 0]} ;# line 3! test info-31.0 {ns eval, script in variable} -body {namespace eval foo {variable res {}} namespace eval foo $body return $foo::res } -result {type eval line 3 cmd {info frame 0} level 0} -cleanup { catch {namespace delete foo} } test info-31.1 {if, script in variable} -cleanup {unset res a flag} -body { if 1 $body return $res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} test info-31.1a {if, script in variable} -cleanup {unset res a flag} -body { if 1 then $body return $res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} test info-31.2 {while, script in variable} -cleanup {unset flag res a} -body { set flag 1 while {$flag} $body return $res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} # .3 - proc - scoping prevent return of result ... test info-31.4 {foreach, script in variable} -cleanup {unset var res a flag} -body { foreach var val $body set res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} test info-31.5 {for, script in variable} -cleanup {unset flag res a} -body { set flag 1 for {} {$flag} {} $body return $res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} test info-31.6 {eval, script in variable} -cleanup {unset res a flag} -body { eval $body return $res } -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} # ------------------------------------------------------------------------- set body { foo { proc ::foo::bar {} {info frame 0} } } namespace eval foo {} set x foo switch -exact -- $x $body; unset body test info-31.7 {info frame, interaction, switch, dynamic} -body { reduce [foo::bar] } -cleanup { namespace delete foo unset x } -result {type proc line 1 cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- set body { proc ::foo::bar {} {info frame 0} } namespace eval foo {} eval $body test info-32.0 {info frame, dynamic procedure} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type proc line 1 cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace {*}{ eval foo {proc bar {} {info frame 0}} } test info-33.0 {{*}, literal, direct} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 1115 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set flag 1 if {*}{ {$flag} {info frame 0} } } test info-33.1 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 1130 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace {*}" eval foo {proc bar {} {info frame 0}} " test info-33.2 {{*}, literal, direct} { reduce [foo::bar] } {type source line 1144 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- namespace {*}"eval\nfoo\n{proc bar {} {info frame 0}}\n" test info-33.2a {{*}, literal, not simple, direct} { reduce [foo::bar] } {type proc line 1 cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set flag 1 if {*}" {1} {info frame 0} " } test info-33.3 {{*}, literal, simple, bytecompiled} { reduce [foo::bar] } {type source line 1169 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set flag 1 if {*}"\n{1}\n{info frame 0}" } test info-33.3a {{*}, literal, not simple, bytecompiled} { reduce [foo::bar] } {type eval line 1 cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- set body { eval foo {proc bar {} { info frame 0 }} } namespace {*}$body test info-34.0 {{*}, dynamic, direct} { reduce [foo::bar] } {type proc line 2 cmd {info frame 0} proc ::foo::bar level 0} unset body namespace delete foo # ------------------------------------------------------------------------- namespace eval foo {} set body { {$flag} {info frame 0} } proc foo::bar {} { global body ; set flag 1 if {*}$body } test info-34.1 {{*}, literal, bytecompiled} { reduce [foo::bar] } {type eval line 1 cmd {info frame 0} proc ::foo::bar level 0} unset body namespace delete foo # ------------------------------------------------------------------------- proc foo {} { apply { {x y} {info frame 0} } 0 0 } test info-35.0 {apply, literal} { reduce [foo] } {type source line 1231 file info.test cmd {info frame 0} lambda { {x y} {info frame 0} } level 0} rename foo {} set lambda { {x y} {info frame 0} } test info-35.1 {apply, dynamic} { reduce [apply $lambda 0 0] } {type proc line 1 cmd {info frame 0} lambda { {x y} {info frame 0} } level 0} unset lambda # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { dict for {k v} {foo bar} { set x [info frame 0] } set x } test info-36.0 {info frame, dict for, bcc} -body { reduce [foo::bar] } -result {type source line 1259 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set x foo switch -exact -- $x { foo {set y [info frame 0]} } set y } test info-36.1.0 {switch, list literal, bcc} -body { reduce [foo::bar] } -result {type source line 1275 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set x foo switch -exact -- $x foo {set y [info frame 0]} set y } test info-36.1.1 {switch, multi-body literals, bcc} -body { reduce [foo::bar] } -result {type source line 1291 file info.test cmd {info frame 0} proc ::foo::bar level 0} namespace delete foo # ------------------------------------------------------------------------- test info-37.0 {eval pure list, single line} -match glob -body { # Basically, counting the newline in the word seen through $foo # doesn't really make sense. It makes a bit of sense if the word # would have been a string literal in the command list. # # Problem: At the point where we see the list elements we cannot # distinguish the two cases, thus we cannot switch between # count/not-count, it is has to be one or the other for all # cases. Of the two possibilities miguel convinced me that 'not # counting' is the more proper. set foo {b c} set cmd [list foreach $foo {x y} { set res [join [lrange [etrace] 0 2] \n] break }] eval $cmd return $res } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 2 cmd etrace proc ::tcltest::RunTest} * {type eval line 1 cmd foreac proc ::tcltest::RunTest}} -cleanup {unset foo cmd res b c} # ------------------------------------------------------------------------- # 6 cases. ## DV. direct-var - unchanged ## DPV direct-proc-var - ditto ## PPV proc-proc-var - ditto ## DL. direct-literal - now tracking absolute location ## DPL direct-proc-literal - ditto ## PPL proc-proc-literal - ditto ## ### ### ### ######### ######### #########" proc control {vv script} { upvar 1 $vv var return [uplevel 1 $script] } proc datal {} { control y { set y PPL etrace } } proc datav {} { set script { set y PPV etrace } control y $script } test info-38.1 {location information for uplevel, dv, direct-var} -match glob -body { set script { set y DV. etrace } join [lrange [uplevel \#0 $script] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 3 cmd etrace proc ::tcltest::RunTest} * {type source line 1361 file info.test cmd {uplevel \\#0 $script} proc ::tcltest::RunTest}} -cleanup {unset script y} # 38.2 moved to bottom to not disturb other tests with the necessary changes to this one. test info-38.3 {location information for uplevel, dpv, direct-proc-var} -match glob -body { set script { set y DPV etrace } join [lrange [control y $script] 0 3] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 3 cmd etrace proc ::control} * {type source line 1338 file info.test cmd {uplevel 1 $script} proc ::control} * {type source line 1380 file info.test cmd {control y $script} proc ::tcltest::RunTest}} -cleanup {unset script y} # 38.4 moved to bottom to not disturb other tests with the necessary changes to this one. test info-38.5 {location information for uplevel, ppv, proc-proc-var} -match glob -body { join [lrange [datav] 0 4] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 3 cmd etrace proc ::control} * {type source line 1338 file info.test cmd {uplevel 1 $script} proc ::control} * {type source line 1353 file info.test cmd {control y $script} proc ::datav level 1} * {type source line 1397 file info.test cmd datav proc ::tcltest::RunTest}} # 38.6 moved to bottom to not disturb other tests with the necessary changes to this one. testConstraint testevalex [llength [info commands testevalex]] test info-38.7 {location information for arg substitution} -constraints testevalex -match glob -body { join [lrange [testevalex {return -level 0 [etrace]}] 0 3] \n } -result {* {type source line 730 file info.test cmd {info frame \$level} proc ::etrace level 0} * {type eval line 1 cmd etrace proc ::tcltest::RunTest} * {type source line 1414 file info.test cmd {testevalex {return -level 0 \[etrace]}} proc ::tcltest::RunTest} * {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::RunTest}} # ------------------------------------------------------------------------- # literal sharing test info-39.0 {location information not confused by literal sharing} -body { namespace eval ::foo {} proc ::foo::bar {} { lappend res {} lappend res [reduce [eval {info frame 0}]] lappend res [reduce [eval {info frame 0}]] return $res } set res [::foo::bar] namespace delete ::foo join $res \n } -cleanup {unset res} -result { type source line 1427 file info.test cmd {info frame 0} proc ::foo::bar level 0 type source line 1428 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- # Additional tests for info-30.*, handling of continuation lines (bs+nl sequences). test info-30.1 {bs+nl in literal words, procedure body, compiled} -body { proc abra {} { if {1} \ { return \ [reduce [info frame 0]];# line 1446 } } abra } -cleanup { rename abra {} } -result {type source line 1446 file info.test cmd {info frame 0} proc ::abra level 0} test info-30.2 {bs+nl in literal words, namespace script} { namespace eval xxx { variable res \ [info frame 0];# line 1457 } return [reduce $xxx::res] } {type source line 1457 file info.test cmd {info frame 0} level 0} test info-30.3 {bs+nl in literal words, namespace multi-word script} { namespace eval xxx variable res \ [list [reduce [info frame 0]]];# line 1464 return $xxx::res } {type source line 1464 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.4 {bs+nl in literal words, eval script} -cleanup {unset res} -body { eval { set ::res \ [reduce [info frame 0]];# line 1471 } return $res } -result {type source line 1471 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.5 {bs+nl in literal words, eval script, with nested words} -body { eval { if {1} \ { set ::res \ [reduce [info frame 0]];# line 1481 } } return $res } -cleanup {unset res} -result {type source line 1481 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.6 {bs+nl in computed word} -cleanup {unset res} -body { set res "\ [reduce [info frame 0]]";# line 1489 } -result { type source line 1489 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.7 {bs+nl in computed word, in proc} -body { proc abra {} { return "\ [reduce [info frame 0]]";# line 1495 } abra } -cleanup { rename abra {} } -result { type source line 1495 file info.test cmd {info frame 0} proc ::abra level 0} test info-30.8 {bs+nl in computed word, nested eval} -body { eval { set \ res "\ [reduce [info frame 0]]";# line 1506 } } -cleanup {unset res} -result { type source line 1506 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.9 {bs+nl in computed word, nested eval} -body { eval { set \ res "\ [reduce \ [info frame 0]]";# line 1515 } } -cleanup {unset res} -result { type source line 1515 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.10 {bs+nl in computed word, key to array} -body { set tmp([set \ res "\ [reduce \ [info frame 0]]"]) x ; #1523 unset tmp set res } -cleanup {unset res} -result { type source line 1523 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.11 {bs+nl in subst arguments} -body { subst {[set \ res "\ [reduce \ [info frame 0]]"]} ; #1532 } -cleanup {unset res} -result { type source line 1532 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.12 {bs+nl in computed word, nested eval} -body { eval { set \ res "\ [set x {}] \ [reduce \ [info frame 0]]";# line 1541 } } -cleanup {unset res x} -result { type source line 1541 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.13 {bs+nl in literal words, uplevel script, with nested words} -body { subinterp ; set res [interp eval sub { uplevel #0 { if {1} \ { set ::res \ [reduce [info frame 0]];# line 1550 } } set res }] ; interp delete sub ; set res } -cleanup {unset res} -result {type source line 1550 file info.test cmd {info frame 0} level 0} test info-30.14 {bs+nl, literal word, uplevel through proc} { subinterp ; set res [interp eval sub { proc abra {script} { uplevel 1 $script } set res [abra { return "\ [reduce [info frame 0]]";# line 1562 }] rename abra {} set res }] ; interp delete sub ; set res } { type source line 1562 file info.test cmd {info frame 0} proc ::abra} test info-30.15 {bs+nl in literal words, nested proc body, compiled} { proc a {} { proc b {} { if {1} \ { return \ [reduce [info frame 0]];# line 1574 } } } a ; set res [b] rename a {} rename b {} set res } {type source line 1574 file info.test cmd {info frame 0} proc ::b level 0} test info-30.16 {bs+nl in multi-body switch, compiled} { proc a {value} { switch -regexp -- $value \ ^key { info frame 0; # 1587 } \ \t### { info frame 0; # 1588 } \ {[0-9]*} { info frame 0; # 1589 } } set res {} lappend res [reduce [a {key }]] lappend res [reduce [a {1alpha}]] set res "\n[join $res \n]" } { type source line 1587 file info.test cmd {info frame 0} proc ::a level 0 type source line 1589 file info.test cmd {info frame 0} proc ::a level 0} test info-30.17 {bs+nl in multi-body switch, direct} { switch -regexp -- {key } \ ^key { reduce [info frame 0] ;# 1601 } \ \t### { } \ {[0-9]*} { } } {type source line 1601 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.18 {bs+nl, literal word, uplevel through proc, appended, loss of primary tracking data} { proc abra {script} { append script "\n# end of script" uplevel 1 $script } set res [abra { return "\ [reduce [info frame 0]]";# line 1613, still line of 3 appended script }] rename abra {} set res } { type eval line 3 cmd {info frame 0} proc ::abra} # { type source line 1606 file info.test cmd {info frame 0} proc ::abra} test info-30.19 {bs+nl in single-body switch, compiled} { proc a {value} { switch -regexp -- $value { ^key { reduce \ [info frame 0] } \t { reduce \ [info frame 0] } {[0-9]*} { reduce \ [info frame 0] } } } set res {} lappend res [a {key }] lappend res [a {1alpha}] set res "\n[join $res \n]" } { type source line 1624 file info.test cmd {info frame 0} proc ::a level 0 type source line 1628 file info.test cmd {info frame 0} proc ::a level 0} test info-30.20 {bs+nl in single-body switch, direct} { switch -regexp -- {key } { \ ^key { reduce \ [info frame 0] } \t### { } {[0-9]*} { } } } {type source line 1643 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.21 {bs+nl in if, full compiled} { proc a {value} { if {$value} \ {info frame 0} \ {info frame 0} ; # 1653 } set res {} lappend res [reduce [a 1]] lappend res [reduce [a 0]] set res "\n[join $res \n]" } { type source line 1652 file info.test cmd {info frame 0} proc ::a level 0 type source line 1653 file info.test cmd {info frame 0} proc ::a level 0} test info-30.22 {bs+nl in computed word, key to array, compiled} { proc a {} { set tmp([set \ res "\ [reduce \ [info frame 0]]"]) x ; #1668 unset tmp set res } set res [a] rename a {} set res } { type source line 1668 file info.test cmd {info frame 0} proc ::a level 0} test info-30.23 {bs+nl in multi-body switch, full compiled} { proc a {value} { switch -exact -- $value \ key { info frame 0; # 1680 } \ xxx { info frame 0; # 1681 } \ 000 { info frame 0; # 1682 } } set res {} lappend res [reduce [a key]] lappend res [reduce [a 000]] set res "\n[join $res \n]" } { type source line 1680 file info.test cmd {info frame 0} proc ::a level 0 type source line 1682 file info.test cmd {info frame 0} proc ::a level 0} test info-30.24 {bs+nl in single-body switch, full compiled} { proc a {value} { switch -exact -- $value { key { reduce \ [info frame 0] } xxx { reduce \ [info frame 0] } 000 { reduce \ [info frame 0] } } } set res {} lappend res [a key] lappend res [a 000] set res "\n[join $res \n]" } { type source line 1696 file info.test cmd {info frame 0} proc ::a level 0 type source line 1700 file info.test cmd {info frame 0} proc ::a level 0} test info-30.25 {TIP 280 for compiled [subst]} { subst {[reduce [info frame 0]]} ; # 1712 } {type source line 1712 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.26 {TIP 280 for compiled [subst]} { subst \ {[reduce [info frame 0]]} ; # 1716 } {type source line 1716 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.27 {TIP 280 for compiled [subst]} { subst { [reduce [info frame 0]]} ; # 1720 } { type source line 1720 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.28 {TIP 280 for compiled [subst]} { subst {\ [reduce [info frame 0]]} ; # 1725 } { type source line 1725 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.29 {TIP 280 for compiled [subst]} { subst {foo\ [reduce [info frame 0]]} ; # 1729 } {foo type source line 1729 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.30 {TIP 280 for compiled [subst]} { subst {foo [reduce [info frame 0]]} ; # 1733 } {foo type source line 1733 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.31 {TIP 280 for compiled [subst]} { subst {[][reduce [info frame 0]]} ; # 1737 } {type source line 1737 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.32 {TIP 280 for compiled [subst]} { subst {[\ ][reduce [info frame 0]]} ; # 1741 } {type source line 1741 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.33 {TIP 280 for compiled [subst]} { subst {[ ][reduce [info frame 0]]} ; # 1745 } {type source line 1745 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.34 {TIP 280 for compiled [subst]} { subst {[format %s {} ][reduce [info frame 0]]} ; # 1749 } {type source line 1749 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.35 {TIP 280 for compiled [subst]} { subst {[format %s {} ] [reduce [info frame 0]]} ; # 1754 } { type source line 1754 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.36 {TIP 280 for compiled [subst]} { subst { [format %s {}][reduce [info frame 0]]} ; # 1759 } { type source line 1759 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.37 {TIP 280 for compiled [subst]} { subst { [format %s {}] [reduce [info frame 0]]} ; # 1765 } { type source line 1765 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.38 {TIP 280 for compiled [subst]} { subst {\ [format %s {}][reduce [info frame 0]]} ; # 1771 } { type source line 1771 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.39 {TIP 280 for compiled [subst]} { subst {\ [format %s {}]\ [reduce [info frame 0]]} ; # 1776 } { type source line 1776 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.40 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { set empty {} subst {$empty[reduce [info frame 0]]} ; # 1782 } -cleanup { unset empty } -result {type source line 1782 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.41 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { set empty {} subst {$empty [reduce [info frame 0]]} ; # 1791 } -cleanup { unset empty } -result { type source line 1791 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.42 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { set empty {}; subst {$empty\ [reduce [info frame 0]]} ; # 1800 } -cleanup { unset empty } -result { type source line 1800 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.43 {TIP 280 for compiled [subst]} -body { unset -nocomplain a\nb set a\nb {} subst {${a b}[reduce [info frame 0]]} ; # 1808 } -cleanup {unset a\nb} -result {type source line 1808 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.44 {TIP 280 for compiled [subst]} { unset -nocomplain a set a(\n) {} subst {$a( )[reduce [info frame 0]]} ; # 1814 } {type source line 1814 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.45 {TIP 280 for compiled [subst]} { unset -nocomplain a set a() {} subst {$a([ return -level 0])[reduce [info frame 0]]} ; # 1820 } {type source line 1820 file info.test cmd {info frame 0} proc ::tcltest::RunTest} test info-30.46 {TIP 280 for compiled [subst]} { unset -nocomplain a set a(1825) YES; set a(1824) 1824; set a(1826) 1826 subst {$a([dict get [info frame 0] line])} ; # 1825 } YES test info-30.47 {TIP 280 for compiled [subst]} { unset -nocomplain a set a(\n1831) YES; set a(\n1830) 1830; set a(\n1832) 1832 subst {$a( [dict get [info frame 0] line])} ; # 1831 } YES unset -nocomplain a test info-30.48 {Bug 2850901} testevalex { testevalex {return -level 0 [format %s {} ][reduce [info frame 0]]} ; # line 2 of the eval } {type eval line 2 cmd {info frame 0} proc ::tcltest::RunTest} # ------------------------------------------------------------------------- # literal sharing 2, bug 2933089 test info-39.1 {location information not confused by literal sharing, bug 2933089} -setup { set result {} proc print_one {} {} proc test_info_frame {} { set x 1 set y x if "$x != 1" { } else { print_one } ;#line 1854^ if "$$y != 1" { } else { print_one } ;#line 1859^ # Do not put the comments listing the line numbers into the # branches. We need shared literals, and the comments would # make them different, thus unshared. } proc get_frame_info { cmd_str op } { lappend ::result [reduce [eval {info frame -3}]] } trace add execution print_one enter get_frame_info } -body { test_info_frame; join $result \n } -cleanup { trace remove execution print_one enter get_frame_info rename get_frame_info {} rename test_info_frame {} rename print_one {} } -result {type source line 1854 file info.test cmd print_one proc ::test_info_frame level 1 type source line 1859 file info.test cmd print_one proc ::test_info_frame level 1} # ------------------------------------------------------------------------- # Tests moved to the end to not disturb other tests and their locations. test info-38.6 {location information for uplevel, ppl, proc-proc-literal} -match glob -setup {subinterp} -body { interp eval sub { proc etrace {} { set res {} set level [info frame] while {$level} { lappend res [list $level [reduce [info frame $level]]] incr level -1 } return $res } proc control {vv script} { upvar 1 $vv var return [uplevel 1 $script] } proc datal {} { control y { set y PPL etrace } } join [lrange [datal] 0 4] \n } } -result {* {type source line 1890 file info.test cmd {info frame $level} proc ::etrace level 0} * {type source line 1902 file info.test cmd etrace proc ::control} * {type source line 1897 file info.test cmd {uplevel 1 $script} proc ::control} * {type source line 1900 file info.test cmd control proc ::datal level 1} * {type source line 1905 file info.test cmd datal level 2}} -cleanup {interp delete sub} test info-38.4 {location information for uplevel, dpv, direct-proc-literal} -match glob -setup {subinterp} -body { interp eval sub { proc etrace {} { set res {} set level [info frame] while {$level} { lappend res [list $level [reduce [info frame $level]]] incr level -1 } return $res } proc control {vv script} { upvar 1 $vv var return [uplevel 1 $script] } join [lrange [control y { set y DPL etrace }] 0 3] \n } } -result {* {type source line 1919 file info.test cmd {info frame $level} proc ::etrace level 0} * {type source line 1930 file info.test cmd etrace proc ::control} * {type source line 1926 file info.test cmd {uplevel 1 $script} proc ::control} * {type source line 1928 file info.test cmd control level 1}} -cleanup {interp delete sub} test info-38.2 {location information for uplevel, dl, direct-literal} -match glob -setup {subinterp} -body { interp eval sub { proc etrace {} { set res {} set level [info frame] while {$level} { lappend res [list $level [reduce [info frame $level]]] incr level -1 } return $res } join [lrange [uplevel \#0 { set y DL. etrace }] 0 2] \n } } -result {* {type source line 1944 file info.test cmd {info frame $level} proc ::etrace level 0} * {type source line 1951 file info.test cmd etrace level 1} * {type source line 1949 file info.test cmd uplevel\\ \\\\ level 1}} -cleanup {interp delete sub} # This test at the end of this file _only_ to avoid disturbing above line # numbers. It _belongs_ after info-9.12 test info-9.13 {info level option, value in global context} -body { uplevel #0 {info level 2} } -returnCodes error -result {bad level "2"} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { catch {*}{ {info frame 0} res } return $res } test info-33.4 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 1968 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { dict for {a b} {c d} {*}{ {set res [info frame 0]} } return $res } test info-33.5 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 1983 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set d {a b} dict update d x y {*}{ {set res [info frame 0]} } return $res } test info-33.6 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 1998 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set d {} dict with d {*}{ {set res [info frame 0]} } return $res } test info-33.7 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2013 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { for {*}{ {set res [info frame 0]} {1} {} {break} } return $res } test info-33.8 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2027 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { for {*}{ {} {1} {} {set res [info frame 0]; break} } return $res } test info-33.9 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2043 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { for {*}{ {} {1} {return [info frame 0]} {} } } test info-33.10 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2058 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { for {*}{ {} {[return [info frame 0]]} {} {} } } test info-33.11 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2073 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { foreach {*}{ x } [return [info frame 0]] {} } test info-33.12 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2088 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { foreach {*}{ x y {set res [info frame 0]} } return $res } test info-33.13 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2101 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { if {*}{ {[return [info frame 0]]} {} } } test info-33.14 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2115 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { if 0 {*}{ {} else {return [info frame 0]} } } test info-33.15 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2130 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { incr {*}{ x } [return [info frame 0]] } test info-33.16 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2144 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { info level {*}{ } [return [info frame 0]] } test info-33.17 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2156 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { string match {*}{ } [return [info frame 0]] {} } test info-33.18 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2168 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { string match {*}{ {} } [return [info frame 0]] } test info-33.19 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2181 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { string length {*}{ } [return [info frame 0]] } test info-33.20 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2193 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { while {*}{ {[return [info frame 0]]} } {} } test info-33.21 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2205 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { switch -- {*}{ } [return [info frame 0]] {*}{ } x y } test info-33.22 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2218 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {*}{ {set res [info frame 0]} } return $res } test info-33.23 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2231 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {*}{ {set res [info frame 0]} } finally {} return $res } test info-33.24 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2245 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {*}{ {set res [info frame 0]} } on ok {} {} return $res } test info-33.25 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2259 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {*}{ {set res [info frame 0]} } on ok {} {} finally {} return $res } test info-33.26 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2273 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { while 1 {*}{ {return [info frame 0]} } } test info-33.27 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2287 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {} finally {*}{ {return [info frame 0]} } } test info-33.28 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2300 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {} on ok {} {} finally {*}{ {return [info frame 0]} } } test info-33.29 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2313 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {} on ok {} {*}{ {return [info frame 0]} } } test info-33.30 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2326 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { try {} on ok {} {*}{ {return [info frame 0]} } finally {} } test info-33.31 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2339 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { binary format {*}{ } [return [info frame 0]] } test info-33.32 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2352 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { set format format binary $format {*}{ } [return [info frame 0]] } test info-33.33 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2365 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { append x {*}{ } [return [info frame 0]] } test info-33.34 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2377 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval foo {} proc foo::bar {} { append {*}{ } x([return [info frame 0]]) {*}{ } a } test info-33.35 {{*}, literal, simple, bytecompiled} -body { reduce [foo::bar] } -cleanup { namespace delete foo } -result {type source line 2389 file info.test cmd {info frame 0} proc ::foo::bar level 0} # ------------------------------------------------------------------------- namespace eval ::testinfocmdtype { apply {cmds { foreach c $cmds {rename $c {}} } ::testinfocmdtype} [info commands ::testinfocmdtype::*] } test info-40.1 {info cmdtype: syntax} -body { info cmdtype } -returnCodes error -result {wrong # args: should be "info cmdtype commandName"} test info-40.2 {info cmdtype: syntax} -body { info cmdtype foo bar } -returnCodes error -result {wrong # args: should be "info cmdtype commandName"} test info-40.3 {info cmdtype: no such command} -body { info cmdtype ::testinfocmdtype::foo } -returnCodes error -result {unknown command "::testinfocmdtype::foo"} test info-40.4 {info cmdtype: native commands} -body { info cmdtype ::if } -result native test info-40.5 {info cmdtype: native commands} -body { info cmdtype ::puts } -result native test info-40.6 {info cmdtype: native commands} -body { info cmdtype ::yield } -result native test info-40.7 {info cmdtype: procedures} -setup { proc ::testinfocmdtype::someproc {} {} } -body { info cmdtype ::testinfocmdtype::someproc } -cleanup { rename ::testinfocmdtype::someproc {} } -result proc test info-40.8 {info cmdtype: aliases} -setup { interp alias {} ::testinfocmdtype::somealias {} ::puts } -body { info cmdtype ::testinfocmdtype::somealias } -cleanup { rename ::testinfocmdtype::somealias {} } -result alias test info-40.9 {info cmdtype: imports} -setup { namespace eval ::testinfocmdtype { namespace eval foo { proc bar {} {} namespace export bar } namespace import foo::bar } } -body { info cmdtype ::testinfocmdtype::bar } -cleanup { rename ::testinfocmdtype::bar {} namespace delete ::testinfocmdtype::foo } -result import test info-40.10 {info cmdtype: interps} -setup { apply {i { rename $i ::testinfocmdtype::child variable ::testinfocmdtype::child $i }} [interp create] } -body { info cmdtype ::testinfocmdtype::child } -cleanup { interp delete $::testinfocmdtype::child } -result interp test info-40.11 {info cmdtype: objects} -setup { apply {{} { oo::object create obj } ::testinfocmdtype} } -body { info cmdtype ::testinfocmdtype::obj } -cleanup { ::testinfocmdtype::obj destroy } -result object test info-40.12 {info cmdtype: objects} -setup { apply {{} { oo::object create obj } ::testinfocmdtype} } -body { info cmdtype [info object namespace ::testinfocmdtype::obj]::my } -cleanup { ::testinfocmdtype::obj destroy } -result privateObject test info-40.13 {info cmdtype: ensembles} -setup { namespace eval ::testinfocmdtype { namespace eval ensmbl { proc bar {} {} namespace export * namespace ensemble create } } } -body { info cmdtype ::testinfocmdtype::ensmbl } -cleanup { namespace delete ::testinfocmdtype::ensmbl } -result ensemble test info-40.14 {info cmdtype: zlib streams} -constraints zlib -setup { namespace eval ::testinfocmdtype { rename [zlib stream gzip] zstream } } -body { info cmdtype ::testinfocmdtype::zstream } -cleanup { ::testinfocmdtype::zstream close } -result zlibStream test info-40.15 {info cmdtype: coroutines} -setup { coroutine ::testinfocmdtype::coro eval yield } -body { info cmdtype ::testinfocmdtype::coro } -cleanup { ::testinfocmdtype::coro } -result coroutine test info-40.16 {info cmdtype: dynamic behavior} -setup { proc ::testinfocmdtype::foo {} {} } -body { namespace eval ::testinfocmdtype { list [catch {info cmdtype foo}] [catch {info cmdtype bar}] \ [namespace which foo] [rename foo bar] [namespace which bar] \ [catch {info cmdtype foo}] [catch {info cmdtype bar}] } } -cleanup { namespace eval ::testinfocmdtype { catch {rename foo {}} catch {rename bar {}} } } -result {0 1 ::testinfocmdtype::foo {} ::testinfocmdtype::bar 1 0} test info-40.17 {info cmdtype: aliases in child interpreters} -setup { set i [interp create] } -body { $i alias foo gorp $i eval { info cmdtype foo } } -cleanup { interp delete $i } -result alias test info-40.18 {info cmdtype: aliases in child interpreters} -setup { set safe [interp create -safe] } -body { $safe alias foo gorp $safe eval { info cmdtype foo } } -returnCodes error -cleanup { interp delete $safe } -result {not allowed to invoke subcommand cmdtype of info} test info-40.19 {info cmdtype: aliases in child interpreters} -setup { set safe [interp create -safe] } -body { set inner [interp create [list $safe bar]] interp alias $inner foo $safe gorp $safe eval { bar eval { info cmdtype foo } } } -returnCodes error -cleanup { interp delete $safe } -result {not allowed to invoke subcommand cmdtype of info} test info-40.20 {info cmdtype: aliases in child interpreters} -setup { set safe [interp create -safe] } -body { $safe eval { interp alias {} foo {} gorp info cmdtype foo } } -returnCodes error -cleanup { interp delete $safe } -result {not allowed to invoke subcommand cmdtype of info} namespace delete ::testinfocmdtype # ------------------------------------------------------------------------- unset -nocomplain res test info-19.7 {info vars: bug [0e4b7fce57], TIP #278 - no global vars resolve} -setup { catch {namespace delete x} } -body { namespace eval x {info vars} } -cleanup { namespace delete x } -result {} test info-19.8 {info vars: bug [0e4b7fce57], TIP #278 - no global vars resolve} -setup { catch {namespace delete x} } -body { namespace eval x {info vars tcl_platform} } -cleanup { namespace delete x } -result {} test info-19.9 {info vars: global vars resolved by pattern} -setup { catch {namespace delete x} } -body { namespace eval x {info vars ::tcl_platform} } -cleanup { namespace delete x } -result {::tcl_platform} test info-39.2 {Bug 4b61afd660} -setup { proc probe {} { return [dict get [info frame -1] line] } set body { set cmd probe $cmd } proc demo {} $body } -body { demo } -cleanup { unset -nocomplain body rename demo {} rename probe {} } -result 3 test info-41.0 {Bug 0de6c1d79c crash} -setup { interp create child child hide info } -body { list [child invokehidden info frame] \ [child invokehidden info frame 0] \ [child invokehidden info frame 1] \ [catch {child invokehidden info frame -1} msg] $msg \ [catch {child invokehidden info frame 2} msg] $msg } -cleanup { interp delete child unset -nocomplain msg } -result {1 {type precompiled} {type precompiled} 1 {bad level "-1"} 1 {bad level "2"}} test info-41.1 {Bug 0de6c1d79c crash} -setup { interp create child child hide info } -cleanup { interp delete child } -body { child invokehidden info frame } -result 1 # cleanup catch {namespace delete test_ns_info1 test_ns_info2} ::tcltest::cleanupTests return tcl9.0.3/tests/indexObj.test0000644000175000017500000002455615104661341015370 0ustar sergeisergei# This file is a Tcl script to test out the procedures in file # tkIndexObj.c, which implement indexed table lookups. The tests here are # organized in the standard fashion for Tcl tests. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testindexobj [llength [info commands testindexobj]] testConstraint testgetintforindex [llength [info commands testgetintforindex]] testConstraint testparseargs [llength [info commands testparseargs]] testConstraint has64BitLengths [expr {$tcl_platform(pointerSize) == 8}] test indexObj-1.1 {exact match} testindexobj { testindexobj 1 1 xyz abc def xyz alm } {2} test indexObj-1.2 {exact match} testindexobj { testindexobj 1 1 abc abc def xyz alm } {0} test indexObj-1.3 {exact match} testindexobj { testindexobj 1 1 alm abc def xyz alm } {3} test indexObj-1.4 {unique abbreviation} testindexobj { testindexobj 1 1 xy abc def xalb xyz alm } {3} test indexObj-1.5 {multiple abbreviations and exact match} testindexobj { testindexobj 1 1 x abc def xalb xyz alm x } {5} test indexObj-1.6 {forced exact match} testindexobj { testindexobj 1 0 xy abc def xalb xy alm } {3} test indexObj-1.7 {forced exact match} testindexobj { testindexobj 1 0 x abc def xalb xyz alm x } {5} test indexObj-1.8 {exact match of empty values} testindexobj { testindexobj 1 1 {} a aa aaa {} b bb bbb } 3 test indexObj-1.9 {exact match of empty values} testindexobj { testindexobj 1 0 {} a aa aaa {} b bb bbb } 3 test indexObj-2.1 {no match} testindexobj { list [catch {testindexobj 1 1 dddd abc def xalb xyz alm x} msg] $msg } {1 {bad token "dddd": must be abc, def, xalb, xyz, alm, or x}} test indexObj-2.2 {no match} testindexobj { list [catch {testindexobj 1 1 dddd abc} msg] $msg } {1 {bad token "dddd": must be abc}} test indexObj-2.3 {no match: no abbreviations} testindexobj { list [catch {testindexobj 1 0 xy abc def xalb xyz alm} msg] $msg } {1 {bad token "xy": must be abc, def, xalb, xyz, or alm}} test indexObj-2.4 {ambiguous value} testindexobj { list [catch {testindexobj 1 1 d dumb daughter a c} msg] $msg } {1 {ambiguous token "d": must be dumb, daughter, a, or c}} test indexObj-2.5 {omit error message} testindexobj { list [catch {testindexobj 0 1 d x} msg] $msg } {1 {}} test indexObj-2.6 {TCL_EXACT => no "ambiguous" error message} testindexobj { list [catch {testindexobj 1 0 d dumb daughter a c} msg] $msg } {1 {bad token "d": must be dumb, daughter, a, or c}} test indexObj-2.7 {exact match of empty values} testindexobj { list [catch {testindexobj 1 1 {} a b c} msg] $msg } {1 {ambiguous token "": must be a, b, or c}} test indexObj-2.8 {exact match of empty values: singleton case} testindexobj { list [catch {testindexobj 1 0 {} a} msg] $msg } {1 {bad token "": must be a}} test indexObj-2.9 {non-exact match of empty values: singleton case} testindexobj { # NOTE this is a special case. Although the empty string is a # unique prefix, we have an established history of rejecting # empty lookup keys, requiring any unique prefix match to have # at least one character. list [catch {testindexobj 1 1 {} a} msg] $msg } {1 {bad token "": must be a}} test indexObj-3.1 {cache result to skip next lookup} testindexobj { testindexobj check 42 } {42} test indexObj-4.1 {free old internal representation} testindexobj { set x {a b} lindex $x 1 testindexobj 1 1 $x abc def {a b} zzz } {2} test indexObj-5.1 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 1 "?-switch?" mycmd } {wrong # args: should be "mycmd ?-switch?"} test indexObj-5.2 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 2 "bar" mycmd foo } {wrong # args: should be "mycmd foo bar"} test indexObj-5.3 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 0 "bar" mycmd foo } {wrong # args: should be "bar"} test indexObj-5.4 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 0 "" mycmd foo } {wrong # args: should be ""} test indexObj-5.5 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 1 "" mycmd foo } {wrong # args: should be "mycmd"} test indexObj-5.6 {Tcl_WrongNumArgs} testindexobj { testwrongnumargs 2 "" mycmd foo } {wrong # args: should be "mycmd foo"} # Contrast this with test proc-3.6; they have to be like this because # of [Bug 1066837] so Itcl won't break. test indexObj-5.7 {Tcl_WrongNumArgs} {testindexobj obsolete} { testwrongnumargs 2 "fee fi" "fo fum" foo bar } {wrong # args: should be "fo fum foo fee fi"} test indexObj-6.1 {Tcl_GetIndexFromObjStruct} testindexobj { set x a testgetindexfromobjstruct $x 0 } {wrong # args: should be "testgetindexfromobjstruct a 0"} test indexObj-6.2 {Tcl_GetIndexFromObjStruct} testindexobj { set x a testgetindexfromobjstruct $x 0 testgetindexfromobjstruct $x 0 } {wrong # args: should be "testgetindexfromobjstruct a 0"} test indexObj-6.3 {Tcl_GetIndexFromObjStruct} testindexobj { set x c testgetindexfromobjstruct $x 1 } {wrong # args: should be "testgetindexfromobjstruct c 1"} test indexObj-6.4 {Tcl_GetIndexFromObjStruct} testindexobj { set x c testgetindexfromobjstruct $x 1 testgetindexfromobjstruct $x 1 } {wrong # args: should be "testgetindexfromobjstruct c 1"} test indexObj-6.5 {Tcl_GetIndexFromObjStruct with TCL_EXACT flag} -constraints testindexobj -body { set x e testgetindexfromobjstruct $x 0 1 } -returnCodes error -result {bad dummy "e": must be a, c, or ee} test indexObj-6.6 {Tcl_GetIndexFromObjStruct with NULL input} -constraints testindexobj -body { set x "" testgetindexfromobjstruct $x 0 } -returnCodes error -result {ambiguous dummy "": must be a, c, or ee} test indexObj-6.7 {Tcl_GetIndexFromObjStruct} testindexobj { set x "" testgetindexfromobjstruct $x -1 32 } "wrong # args: should be \"testgetindexfromobjstruct {} -1 32\"" test indexObj-7.1 {Tcl_ParseArgsObjv} testparseargs { testparseargs } {0 1 testparseargs NULL NULL} test indexObj-7.2 {Tcl_ParseArgsObjv} testparseargs { testparseargs -bool } {1 1 testparseargs NULL NULL} test indexObj-7.3 {Tcl_ParseArgsObjv} testparseargs { testparseargs -bool bar } {1 2 {testparseargs bar} NULL NULL} test indexObj-7.4 {Tcl_ParseArgsObjv} testparseargs { testparseargs bar } {0 2 {testparseargs bar} NULL NULL} test indexObj-7.5 {Tcl_ParseArgsObjv} -constraints testparseargs -body { testparseargs -help } -returnCodes error -result {Command-specific options: -bool: booltest -colormode: color mode -media: media page size --: Marks the end of the options -help: Print summary of command-line options and abort} test indexObj-7.6 {Tcl_ParseArgsObjv} testparseargs { testparseargs -- -bool -help } {0 3 {testparseargs -bool -help} NULL NULL} test indexObj-7.7 {Tcl_ParseArgsObjv memory management} testparseargs { testparseargs 1 2 3 4 5 6 7 8 9 0 -bool 1 2 3 4 5 6 7 8 9 0 } {1 21 {testparseargs 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0} NULL NULL} test indexObj-7.8 {Tcl_ParseArgsObjv} testparseargs { testparseargs -color Nothing } {0 1 testparseargs Nothing NULL} test indexObj-7.9 {Tcl_ParseArgsObjv} testparseargs { testparseargs -media A4 } {0 1 testparseargs NULL {Paper size is ISO A4}} test indexObj-7.10 {Tcl_ParseArgsObjv} testparseargs { testparseargs -media A4 -color Somecolor } {0 1 testparseargs Somecolor {Paper size is ISO A4}} test indexObj-7.11 {Tcl_ParseArgsObjv} testparseargs { testparseargs -color othercolor -media Letter } {0 1 testparseargs othercolor {Paper size is US Letter}} test indexObj-7.12 {Tcl_ParseArgsObjv} -constraints testparseargs -body { testparseargs -color othercolor -media Nosuchmedia } -returnCodes error -result {bad media "Nosuchmedia": must be A4, Legal, or Letter} test indexObj-8.1 {Tcl_GetIntForIndex integer} testgetintforindex { testgetintforindex 0 0 } 0 test indexObj-8.2 {Tcl_GetIntForIndex integer} testgetintforindex { testgetintforindex -1 0 } -1 test indexObj-8.3 {Tcl_GetIntForIndex integer} testgetintforindex { testgetintforindex -2 0 } -1 test indexObj-8.4 {Tcl_GetIntForIndex INT_MAX} testgetintforindex { testgetintforindex 2147483647 0 } 2147483647 test indexObj-8.5 {Tcl_GetIntForIndex INT_MAX+1} testgetintforindex { testgetintforindex 2147483648 0 } [expr {[testConstraint has64BitLengths] ? 2147483648 : 2147483647}] test indexObj-8.6 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 2147483646 } 2147483645 test indexObj-8.7 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 2147483647 } 2147483646 test indexObj-8.8 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end 2147483646 } 2147483646 test indexObj-8.9 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end 2147483647 } 2147483647 test indexObj-8.10 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 -1 } -2 test indexObj-8.11 {Tcl_GetIntForIndex end-1} testgetintforindex { testgetintforindex end-1 -2 } -3 test indexObj-8.12 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end -1 } -1 test indexObj-8.13 {Tcl_GetIntForIndex end} testgetintforindex { testgetintforindex end -2 } -2 test indexObj-8.14 {Tcl_GetIntForIndex end+1} testgetintforindex { testgetintforindex end+1 -1 } [expr {[testConstraint has64BitLengths] ? 9223372036854775807 : 2147483647}] test indexObj-8.15 {Tcl_GetIntForIndex end+1} testgetintforindex { testgetintforindex end+1 -2 } -1 test indexObj-8.16 {Tcl_GetIntForIndex integer} testgetintforindex { testgetintforindex -1 -1 } [expr {[testConstraint has64BitLengths] ? -9223372036854775808 : -2147483648}] test indexObj-8.17 {Tcl_GetIntForIndex integer} testgetintforindex { testgetintforindex -2 -1 } [expr {[testConstraint has64BitLengths] ? -9223372036854775808 : -2147483648}] test indexObj-8.18 {Tcl_GetIntForIndex n-m} testgetintforindex { testgetintforindex 2-3 -1 } [expr {[testConstraint has64BitLengths] ? -9223372036854775808 : -2147483648}] test indexObj-8.19 {Tcl_GetIntForIndex n-m} testgetintforindex { testgetintforindex 2-3 0 } -1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/incr.test0000644000175000017500000004757615104661341014570 0ustar sergeisergei# Commands covered: incr # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } unset -nocomplain x i proc readonly varName { upvar 1 $varName var trace add variable var write \ {apply {{args} {error "variable is read-only"}}} } # Basic "incr" operation. test incr-1.1 {TclCompileIncrCmd: missing variable name} -returnCodes error -body { incr } -result {wrong # args: should be "incr varName ?increment?"} test incr-1.2 {TclCompileIncrCmd: simple variable name} { set i 10 list [incr i] $i } {11 11} test incr-1.3 {TclCompileIncrCmd: error compiling variable name} -body { set i 10 incr "i"xxx } -returnCodes error -result {extra characters after close-quote} test incr-1.4 {TclCompileIncrCmd: simple variable name in quotes} { set i 17 list [incr "i"] $i } {18 18} test incr-1.5 {TclCompileIncrCmd: simple variable name in braces} -setup { unset -nocomplain {a simple var} } -body { set {a simple var} 27 list [incr {a simple var}] ${a simple var} } -result {28 28} test incr-1.6 {TclCompileIncrCmd: simple array variable name} -setup { unset -nocomplain a } -body { set a(foo) 37 list [incr a(foo)] $a(foo) } -result {38 38} test incr-1.7 {TclCompileIncrCmd: non-simple (computed) variable name} { set x "i" set i 77 list [incr $x 2] $i } {79 79} test incr-1.8 {TclCompileIncrCmd: non-simple (computed) variable name} { set x "i" set i 77 list [incr [set x] +2] $i } {79 79} test incr-1.9 {TclCompileIncrCmd: increment given} { set i 10 list [incr i +07] $i } {17 17} test incr-1.10 {TclCompileIncrCmd: no increment given} { set i 10 list [incr i] $i } {11 11} test incr-1.11 {TclCompileIncrCmd: simple global name} { proc p {} { global i set i 54 incr i } p } {55} test incr-1.12 {TclCompileIncrCmd: simple local name} { proc p {} { set foo 100 incr foo } p } {101} test incr-1.13 {TclCompileIncrCmd: simple but new (unknown) local name} { proc p {} { incr bar } p } 1 test incr-1.14 {TclCompileIncrCmd: simple local name, >255 locals} { proc 260locals {} { # create 260 locals set a0 0; set a1 0; set a2 0; set a3 0; set a4 0 set a5 0; set a6 0; set a7 0; set a8 0; set a9 0 set b0 0; set b1 0; set b2 0; set b3 0; set b4 0 set b5 0; set b6 0; set b7 0; set b8 0; set b9 0 set c0 0; set c1 0; set c2 0; set c3 0; set c4 0 set c5 0; set c6 0; set c7 0; set c8 0; set c9 0 set d0 0; set d1 0; set d2 0; set d3 0; set d4 0 set d5 0; set d6 0; set d7 0; set d8 0; set d9 0 set e0 0; set e1 0; set e2 0; set e3 0; set e4 0 set e5 0; set e6 0; set e7 0; set e8 0; set e9 0 set f0 0; set f1 0; set f2 0; set f3 0; set f4 0 set f5 0; set f6 0; set f7 0; set f8 0; set f9 0 set g0 0; set g1 0; set g2 0; set g3 0; set g4 0 set g5 0; set g6 0; set g7 0; set g8 0; set g9 0 set h0 0; set h1 0; set h2 0; set h3 0; set h4 0 set h5 0; set h6 0; set h7 0; set h8 0; set h9 0 set i0 0; set i1 0; set i2 0; set i3 0; set i4 0 set i5 0; set i6 0; set i7 0; set i8 0; set i9 0 set j0 0; set j1 0; set j2 0; set j3 0; set j4 0 set j5 0; set j6 0; set j7 0; set j8 0; set j9 0 set k0 0; set k1 0; set k2 0; set k3 0; set k4 0 set k5 0; set k6 0; set k7 0; set k8 0; set k9 0 set l0 0; set l1 0; set l2 0; set l3 0; set l4 0 set l5 0; set l6 0; set l7 0; set l8 0; set l9 0 set m0 0; set m1 0; set m2 0; set m3 0; set m4 0 set m5 0; set m6 0; set m7 0; set m8 0; set m9 0 set n0 0; set n1 0; set n2 0; set n3 0; set n4 0 set n5 0; set n6 0; set n7 0; set n8 0; set n9 0 set o0 0; set o1 0; set o2 0; set o3 0; set o4 0 set o5 0; set o6 0; set o7 0; set o8 0; set o9 0 set p0 0; set p1 0; set p2 0; set p3 0; set p4 0 set p5 0; set p6 0; set p7 0; set p8 0; set p9 0 set q0 0; set q1 0; set q2 0; set q3 0; set q4 0 set q5 0; set q6 0; set q7 0; set q8 0; set q9 0 set r0 0; set r1 0; set r2 0; set r3 0; set r4 0 set r5 0; set r6 0; set r7 0; set r8 0; set r9 0 set s0 0; set s1 0; set s2 0; set s3 0; set s4 0 set s5 0; set s6 0; set s7 0; set s8 0; set s9 0 set t0 0; set t1 0; set t2 0; set t3 0; set t4 0 set t5 0; set t6 0; set t7 0; set t8 0; set t9 0 set u0 0; set u1 0; set u2 0; set u3 0; set u4 0 set u5 0; set u6 0; set u7 0; set u8 0; set u9 0 set v0 0; set v1 0; set v2 0; set v3 0; set v4 0 set v5 0; set v6 0; set v7 0; set v8 0; set v9 0 set w0 0; set w1 0; set w2 0; set w3 0; set w4 0 set w5 0; set w6 0; set w7 0; set w8 0; set w9 0 set x0 0; set x1 0; set x2 0; set x3 0; set x4 0 set x5 0; set x6 0; set x7 0; set x8 0; set x9 0 set y0 0; set y1 0; set y2 0; set y3 0; set y4 0 set y5 0; set y6 0; set y7 0; set y8 0; set y9 0 set z0 0; set z1 0; set z2 0; set z3 0; set z4 0 set z5 0; set z6 0; set z7 0; set z8 0; set z9 0 # now increment the last one (local var index > 255) incr z9 } 260locals } {1} test incr-1.15 {TclCompileIncrCmd: variable is array} -setup { unset -nocomplain a } -body { set a(foo) 27 incr a(foo) 11 } -cleanup { unset -nocomplain a } -result 38 test incr-1.16 {TclCompileIncrCmd: variable is array, elem substitutions} -setup { unset -nocomplain a } -body { set i 5 set a(foo5) 27 incr a(foo$i) 11 } -cleanup { unset -nocomplain a } -result 38 test incr-1.17 {TclCompileIncrCmd: increment given, simple int} { set i 5 incr i 123 } 128 test incr-1.18 {TclCompileIncrCmd: increment given, simple int} { set i 5 incr i -100 } -95 test incr-1.19 {TclCompileIncrCmd: increment given, but erroneous} -body { set i 5 catch {incr i [set]} -> opts dict get $opts -errorinfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test incr-1.20 {TclCompileIncrCmd: increment given, in quotes} { set i 25 incr i "-100" } -75 test incr-1.21 {TclCompileIncrCmd: increment given, in braces} { set i 24 incr i {126} } 150 test incr-1.22 {TclCompileIncrCmd: increment given, large int} { set i 5 incr i 200000 } 200005 test incr-1.23 {TclCompileIncrCmd: increment given, formatted int != int} { set i 25 incr i 0o00012345 ;# an octal literal } 5374 test incr-1.24 {TclCompileIncrCmd: increment given, formatted int != int} -body { set i 25 incr i 1a } -returnCodes error -result {expected integer but got "1a"} test incr-1.25 {TclCompileIncrCmd: too many arguments} -body { set i 10 incr i 10 20 } -returnCodes error -result {wrong # args: should be "incr varName ?increment?"} test incr-1.26 {TclCompileIncrCmd: runtime error, bad variable name} { unset -nocomplain {"foo} incr {"foo} } 1 test incr-1.27 {TclCompileIncrCmd: runtime error, bad variable name} -body { list [catch {incr [set]} msg] $msg $::errorInfo } -match glob -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?" while *ing "set"*}} test incr-1.28 {TclCompileIncrCmd: runtime error, readonly variable} -body { set x 123 readonly x list [catch {incr x 1} msg] $msg $::errorInfo } -match glob -cleanup { unset -nocomplain x } -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing * "incr x 1"}} test incr-1.29 {TclCompileIncrCmd: runtime error, bad variable value} -body { set x " - " incr x 1 } -returnCodes error -result {expected integer but got " - "} test incr-1.30 {TclCompileIncrCmd: array var, braced (no subs)} -setup { catch {unset array} } -body { set array(\$foo) 4 incr {array($foo)} } -result 5 test incr-1.31 {TclCompileIncrCmd: runtime error, bad variable value [2a14c349a8]} -body { set x " " lindex $x 0; #convert to non-canonical string incr x } -returnCodes error -result {expected integer but got " "} test incr-1.32 {no overflow in TclCompileIncrCmd and Tcl_IncrObjCmd, bug [7179c6724cd38271]} { set res [list] # TclCompileIncrCmd: compiled incr TEBC with immutable constant offs (INST_INCR_*_IMM instructions): lappend res [set i 0; incr i 0x7FFFFFFF] lappend res [set i 0; incr i 0xFFFFFF80] lappend res [set i 0; incr i 0xFFFFFF81] lappend res [set i 0; incr i 0xFFFFFFFF] lappend res [set i 0; incr i 0x10000007F] lappend res [set i 0; incr i 0x100000080] lappend res [set i 0; incr i 0x7FFFFFFFFFFFFFFF] lappend res [set i 0; incr i 0xFFFFFFFFFFFFFF80] lappend res [set i 0; incr i 0xFFFFFFFFFFFFFF81] lappend res [set i 0; incr i 0xFFFFFFFFFFFFFFFF] lappend res [set i 0; incr i 0x1000000000000007F] lappend res [set i 0; incr i 0x10000000000000080] # TclCompileIncrCmd: compiled incr TEBC with dynamic offs (INST_INCR_* instructions without _IMM): lappend res [set i 0; incr i [set x 0x7FFFFFFF]] lappend res [set i 0; incr i [set x 0xFFFFFF80]] lappend res [set i 0; incr i [set x 0xFFFFFF81]] lappend res [set i 0; incr i [set x 0xFFFFFFFF]] lappend res [set i 0; incr i [set x 0x10000007F]] lappend res [set i 0; incr i [set x 0x100000080]] lappend res [set i 0; incr i [set x 0x7FFFFFFFFFFFFFFF]] lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFF80]] lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFF81]] lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFFFF]] lappend res [set i 0; incr i [set x 0x1000000000000007F]] lappend res [set i 0; incr i [set x 0x10000000000000080]] # Tcl_IncrObjCmd: non-compiled incr command (or NRE): set cmd incr lappend res [set i 0; $cmd i 0x7FFFFFFF] lappend res [set i 0; $cmd i 0xFFFFFF80] lappend res [set i 0; $cmd i 0xFFFFFF81] lappend res [set i 0; $cmd i 0xFFFFFFFF] lappend res [set i 0; $cmd i 0x10000007F] lappend res [set i 0; $cmd i 0x100000080] lappend res [set i 0; $cmd i 0x7FFFFFFFFFFFFFFF] lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFF80] lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFF81] lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFFFF] lappend res [set i 0; $cmd i 0x1000000000000007F] lappend res [set i 0; $cmd i 0x10000000000000080] } [lrepeat 3 \ [expr 0x7FFFFFFF] \ [expr 0xFFFFFF80] \ [expr 0xFFFFFF81] \ [expr 0xFFFFFFFF] \ [expr 0x10000007F] \ [expr 0x100000080] \ [expr 0x7FFFFFFFFFFFFFFF] \ [expr 0xFFFFFFFFFFFFFF80] \ [expr 0xFFFFFFFFFFFFFF81] \ [expr 0xFFFFFFFFFFFFFFFF] \ [expr 0x1000000000000007F] \ [expr 0x10000000000000080] \ ] # Check "incr" and computed command names. unset -nocomplain x i test incr-2.0 {incr and computed command names} { set i 5 set z incr $z i -1 return $i } 4 test incr-2.1 {incr command (not compiled): missing variable name} -body { set z incr $z } -returnCodes error -result {wrong # args: should be "incr varName ?increment?"} test incr-2.2 {incr command (not compiled): simple variable name} { set z incr set i 10 list [$z i] $i } {11 11} test incr-2.3 {incr command (not compiled): error compiling variable name} -body { set z incr set i 10 $z "i"xxx } -returnCodes error -result {extra characters after close-quote} test incr-2.4 {incr command (not compiled): simple variable name in quotes} { set z incr set i 17 list [$z "i"] $i } {18 18} test incr-2.5 {incr command (not compiled): simple variable name in braces} -setup { unset -nocomplain {a simple var} } -body { set z incr set {a simple var} 27 list [$z {a simple var}] ${a simple var} } -result {28 28} test incr-2.6 {incr command (not compiled): simple array variable name} -setup { unset -nocomplain a } -body { set z incr set a(foo) 37 list [$z a(foo)] $a(foo) } -result {38 38} test incr-2.7 {incr command (not compiled): non-simple (computed) variable name} { set z incr set x "i" set i 77 list [$z $x 2] $i } {79 79} test incr-2.8 {incr command (not compiled): non-simple (computed) variable name} { set z incr set x "i" set i 77 list [$z [set x] +2] $i } {79 79} test incr-2.9 {incr command (not compiled): increment given} { set z incr set i 10 list [$z i +07] $i } {17 17} test incr-2.10 {incr command (not compiled): no increment given} { set z incr set i 10 list [$z i] $i } {11 11} test incr-2.11 {incr command (not compiled): simple global name} { proc p {} { set z incr global i set i 54 $z i } p } {55} test incr-2.12 {incr command (not compiled): simple local name} { proc p {} { set z incr set foo 100 $z foo } p } {101} test incr-2.13 {incr command (not compiled): simple but new (unknown) local name} { proc p {} { set z incr $z bar } p } 1 test incr-2.14 {incr command (not compiled): simple local name, >255 locals} { proc 260locals {} { set z incr # create 260 locals set a0 0; set a1 0; set a2 0; set a3 0; set a4 0 set a5 0; set a6 0; set a7 0; set a8 0; set a9 0 set b0 0; set b1 0; set b2 0; set b3 0; set b4 0 set b5 0; set b6 0; set b7 0; set b8 0; set b9 0 set c0 0; set c1 0; set c2 0; set c3 0; set c4 0 set c5 0; set c6 0; set c7 0; set c8 0; set c9 0 set d0 0; set d1 0; set d2 0; set d3 0; set d4 0 set d5 0; set d6 0; set d7 0; set d8 0; set d9 0 set e0 0; set e1 0; set e2 0; set e3 0; set e4 0 set e5 0; set e6 0; set e7 0; set e8 0; set e9 0 set f0 0; set f1 0; set f2 0; set f3 0; set f4 0 set f5 0; set f6 0; set f7 0; set f8 0; set f9 0 set g0 0; set g1 0; set g2 0; set g3 0; set g4 0 set g5 0; set g6 0; set g7 0; set g8 0; set g9 0 set h0 0; set h1 0; set h2 0; set h3 0; set h4 0 set h5 0; set h6 0; set h7 0; set h8 0; set h9 0 set i0 0; set i1 0; set i2 0; set i3 0; set i4 0 set i5 0; set i6 0; set i7 0; set i8 0; set i9 0 set j0 0; set j1 0; set j2 0; set j3 0; set j4 0 set j5 0; set j6 0; set j7 0; set j8 0; set j9 0 set k0 0; set k1 0; set k2 0; set k3 0; set k4 0 set k5 0; set k6 0; set k7 0; set k8 0; set k9 0 set l0 0; set l1 0; set l2 0; set l3 0; set l4 0 set l5 0; set l6 0; set l7 0; set l8 0; set l9 0 set m0 0; set m1 0; set m2 0; set m3 0; set m4 0 set m5 0; set m6 0; set m7 0; set m8 0; set m9 0 set n0 0; set n1 0; set n2 0; set n3 0; set n4 0 set n5 0; set n6 0; set n7 0; set n8 0; set n9 0 set o0 0; set o1 0; set o2 0; set o3 0; set o4 0 set o5 0; set o6 0; set o7 0; set o8 0; set o9 0 set p0 0; set p1 0; set p2 0; set p3 0; set p4 0 set p5 0; set p6 0; set p7 0; set p8 0; set p9 0 set q0 0; set q1 0; set q2 0; set q3 0; set q4 0 set q5 0; set q6 0; set q7 0; set q8 0; set q9 0 set r0 0; set r1 0; set r2 0; set r3 0; set r4 0 set r5 0; set r6 0; set r7 0; set r8 0; set r9 0 set s0 0; set s1 0; set s2 0; set s3 0; set s4 0 set s5 0; set s6 0; set s7 0; set s8 0; set s9 0 set t0 0; set t1 0; set t2 0; set t3 0; set t4 0 set t5 0; set t6 0; set t7 0; set t8 0; set t9 0 set u0 0; set u1 0; set u2 0; set u3 0; set u4 0 set u5 0; set u6 0; set u7 0; set u8 0; set u9 0 set v0 0; set v1 0; set v2 0; set v3 0; set v4 0 set v5 0; set v6 0; set v7 0; set v8 0; set v9 0 set w0 0; set w1 0; set w2 0; set w3 0; set w4 0 set w5 0; set w6 0; set w7 0; set w8 0; set w9 0 set x0 0; set x1 0; set x2 0; set x3 0; set x4 0 set x5 0; set x6 0; set x7 0; set x8 0; set x9 0 set y0 0; set y1 0; set y2 0; set y3 0; set y4 0 set y5 0; set y6 0; set y7 0; set y8 0; set y9 0 set z0 0; set z1 0; set z2 0; set z3 0; set z4 0 set z5 0; set z6 0; set z7 0; set z8 0; set z9 0 # now increment the last one (local var index > 255) $z z9 } 260locals } {1} test incr-2.15 {incr command (not compiled): variable is array} -setup { unset -nocomplain a } -body { set z incr set a(foo) 27 $z a(foo) 11 } -cleanup { unset -nocomplain a } -result 38 test incr-2.16 {incr command (not compiled): variable is array, elem substitutions} -setup { unset -nocomplain a } -body { set z incr set i 5 set a(foo5) 27 $z a(foo$i) 11 } -cleanup { unset -nocomplain a } -result 38 test incr-2.17 {incr command (not compiled): increment given, simple int} { set z incr set i 5 $z i 123 } 128 test incr-2.18 {incr command (not compiled): increment given, simple int} { set z incr set i 5 $z i -100 } -95 test incr-2.19 {incr command (not compiled): increment given, but erroneous} -body { set z incr set i 5 catch {$z i [set]} -> opts dict get $opts -errorinfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test incr-2.20 {incr command (not compiled): increment given, in quotes} { set z incr set i 25 $z i "-100" } -75 test incr-2.21 {incr command (not compiled): increment given, in braces} { set z incr set i 24 $z i {126} } 150 test incr-2.22 {incr command (not compiled): increment given, large int} { set z incr set i 5 $z i 200000 } 200005 test incr-2.23 {incr command (not compiled): increment given, formatted int != int} { set z incr set i 25 $z i 0o00012345 ;# an octal literal } 5374 test incr-2.24 {incr command (not compiled): increment given, formatted int != int} -body { set z incr set i 25 $z i 1a } -returnCodes error -result {expected integer but got "1a"} test incr-2.25 {incr command (not compiled): too many arguments} -body { set z incr set i 10 $z i 10 20 } -returnCodes error -result {wrong # args: should be "incr varName ?increment?"} test incr-2.26 {incr command (not compiled): runtime error, bad variable name} -setup { unset -nocomplain {"foo} } -body { set z incr $z {"foo} } -result 1 test incr-2.27 {incr command (not compiled): runtime error, bad variable name} -body { set z incr list [catch {$z [set]} msg] $msg $::errorInfo } -match glob -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?" while *ing "set"*}} test incr-2.28 {incr command (not compiled): runtime error, readonly variable} -body { set z incr set x 123 readonly x list [catch {$z x 1} msg] $msg $::errorInfo } -match glob -cleanup { unset -nocomplain x } -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing * "$z x 1"}} test incr-2.29 {incr command (not compiled): runtime error, bad variable value} -body { set z incr set x " - " $z x 1 } -returnCodes error -result {expected integer but got " - "} test incr-2.30 {incr command (not compiled): bad increment} { set z incr set x 0 list [catch {$z x 1a} msg] $msg $::errorInfo } {1 {expected integer but got "1a"} {expected integer but got "1a" (reading increment) invoked from within "$z x 1a"}} test incr-2.31 {incr command (compiled): bad increment} { list [catch {incr x 1a} msg] $msg $::errorInfo } {1 {expected integer but got "1a"} {expected integer but got "1a" (reading increment) invoked from within "incr x 1a"}} test incr-2.32 {incr command (compiled): bad pure list increment} { list [catch {incr x [list 1 2]} msg] $msg $::errorInfo } {1 {expected integer but got a list} {expected integer but got a list (reading increment) invoked from within "incr x [list 1 2]"}} test incr-2.33 {incr command (compiled): bad pure dict increment} { list [catch {incr x [dict create 1 2]} msg] $msg $::errorInfo } {1 {expected integer but got a list} {expected integer but got a list (reading increment) invoked from within "incr x [dict create 1 2]"}} test incr-3.1 {increment by wide amount: bytecode route} { set x 0 incr x 123123123123 } 123123123123 test incr-3.2 {increment by wide amount: command route} { set z incr set x 0 $z x 123123123123 } 123123123123 test incr-4.1 {increment non-existing array element [Bug 1445454]} -body { proc x {} {incr a(1)} x } -cleanup { rename x {} } -result 1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/incr-old.test0000644000175000017500000000533415104661341015326 0ustar sergeisergei# Commands covered: incr # # This file contains the original set of tests for Tcl's incr command. # Since the incr command is now compiled, a new set of tests covering # the new implementation is in the file "incr.test". Sourcing this file # into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {unset x} test incr-old-1.1 {basic incr operation} { set x 23 list [incr x] $x } {24 24} test incr-old-1.2 {basic incr operation} { set x 106 list [incr x -5] $x } {101 101} test incr-old-1.3 {basic incr operation} { set x " -106" list [incr x 1] $x } {-105 -105} test incr-old-1.4 {basic incr operation} { set x " +106" list [incr x 1] $x } {107 107} test incr-old-2.1 {incr errors} { list [catch incr msg] $msg } {1 {wrong # args: should be "incr varName ?increment?"}} test incr-old-2.2 {incr errors} { list [catch {incr a b c} msg] $msg } {1 {wrong # args: should be "incr varName ?increment?"}} test incr-old-2.3 {incr errors} { catch {unset x} incr x } 1 test incr-old-2.4 {incr errors} { set x abc list [catch {incr x} msg] $msg $::errorInfo } {1 {expected integer but got "abc"} {expected integer but got "abc" while executing "incr x"}} test incr-old-2.5 {incr errors} { set x 123 list [catch {incr x 1a} msg] $msg $::errorInfo } {1 {expected integer but got "1a"} {expected integer but got "1a" (reading increment) invoked from within "incr x 1a"}} test incr-old-2.6 {incr errors} -body { proc readonly args {error "variable is read-only"} set x 123 trace add var x write readonly list [catch {incr x 1} msg] $msg $::errorInfo } -match glob -result {1 {can't set "x": variable is read-only} {*variable is read-only while executing * "incr x 1"}} catch {unset x} test incr-old-2.7 {incr errors} { set x - list [catch {incr x 1} msg] $msg } {1 {expected integer but got "-"}} test incr-old-2.8 {incr errors} { set x { - } list [catch {incr x 1} msg] $msg } {1 {expected integer but got " - "}} test incr-old-2.9 {incr errors} { set x + list [catch {incr x 1} msg] $msg } {1 {expected integer but got "+"}} test incr-old-2.10 {incr errors} { set x {20 x} list [catch {incr x 1} msg] $msg } {1 {expected integer but got a list}} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/if.test0000644000175000017500000007276015104661341014224 0ustar sergeisergei# Commands covered: if # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Basic "if" operation. catch {unset a} test if-1.1 {TclCompileIfCmd: missing if/elseif test} -body { if } -returnCodes error -result {wrong # args: no expression after "if" argument} test if-1.2 {TclCompileIfCmd: error in if/elseif test} -body { if {[error "error in condition"]} foo } -returnCodes error -result {error in condition} test if-1.3 {TclCompileIfCmd: error in if/elseif test} -body { list [catch {if {1+}} msg] $msg $::errorInfo } -match glob -cleanup { unset msg } -result {1 * {*"if {1+}"}} test if-1.4 {TclCompileIfCmd: if/elseif test in braces} -body { set a {} if {1<2} {set a 1} return $a } -cleanup { unset a } -result {1} test if-1.5 {TclCompileIfCmd: if/elseif test not in braces} -body { set a {} if 1<2 {set a 1} return $a } -cleanup { unset a } -result {1} test if-1.6 {TclCompileIfCmd: multiline test expr} -setup { set a {} } -body { if {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} {set a 3} else {set a 4} return $a } -cleanup { unset a } -result 3 test if-1.7 {TclCompileIfCmd: "then" after if/elseif test} -body { set a {} if 4>3 then {set a 1} return $a } -cleanup { unset a } -result {1} test if-1.8 {TclCompileIfCmd: keyword other than "then" after if/elseif test} -setup { set a {} } -body { if 1<2 therefore {set a 1} } -cleanup { unset a } -returnCodes error -result {invalid command name "therefore"} test if-1.9 {TclCompileIfCmd: missing "then" body} -setup { set a {} } -body { if 1<2 then } -cleanup { unset a } -returnCodes error -result {wrong # args: no script following "then" argument} test if-1.10 {TclCompileIfCmd: error in "then" body} -body { set a {} list [catch {if {$a!="xxx"} then {set}} msg] $msg $::errorInfo } -match glob -cleanup { unset a msg } -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?" while *ing "set"*}} test if-1.11 {TclCompileIfCmd: error in "then" body} -body { if 2 then {[error "error in then clause"]} } -returnCodes error -result {error in then clause} test if-1.12 {TclCompileIfCmd: "then" body in quotes} -body { set a {} if 27>17 "append a x" return $a } -cleanup { unset a } -result {x} test if-1.13 {TclCompileIfCmd: computed "then" body} -setup { catch {unset x1} catch {unset x2} } -body { set x1 {append a x1} set x2 {; append a x2} set a {} if 1 $x1$x2 return $a } -cleanup { unset a x1 x2 } -result {x1x2} test if-1.14 {TclCompileIfCmd: taking proper branch} -body { set a {} if 1<2 {set a 1} return $a } -cleanup { unset a } -result 1 test if-1.15 {TclCompileIfCmd: taking proper branch} -body { set a {} if 1>2 {set a 1} return $a } -cleanup { unset a } -result {} test if-1.16 {TclCompileIfCmd: test jumpFalse instruction replacement after long "then" body} -setup { catch {unset i} set a {} } -body { if 1<2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } return $a } -cleanup { unset a unset -nocomplain i } -result 3 test if-1.17 {TclCompileIfCmd: if/elseif test in quotes} -setup { set a {} } -body { if {"0 < 3"} {set a 1} } -returnCodes error -cleanup { unset a } -result {expected boolean value but got a list} test if-2.1 {TclCompileIfCmd: "elseif" after if/elseif test} -setup { set a {} } -body { if 3>4 {set a 1} elseif 1 {set a 2} return $a } -cleanup { unset a } -result {2} # Since "else" is optional, the "elwood" below is treated as a command. # But then there shouldn't be any additional argument words for the "if". test if-2.2 {TclCompileIfCmd: keyword other than "elseif"} -setup { set a {} } -body { if 1<2 {set a 1} elwood {set a 2} } -returnCodes error -cleanup { unset a } -result {wrong # args: extra words after "else" clause in "if" command} test if-2.3 {TclCompileIfCmd: missing expression after "elseif"} -setup { set a {} } -body { if 1<2 {set a 1} elseif } -returnCodes error -cleanup { unset a } -result {wrong # args: no expression after "elseif" argument} test if-2.4 {TclCompileIfCmd: error in expression after "elseif"} -setup { set a {} } -body { list [catch {if 3>4 {set a 1} elseif {1>}} msg] $msg $::errorInfo } -match glob -cleanup { unset a msg } -result {1 * {*"if 3>4 {set a 1} elseif {1>}"}} test if-2.5 {TclCompileIfCmd: test jumpFalse instruction replacement after long "elseif" body} -setup { catch {unset i} set a {} } -body { if 1>2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } elseif 1<2 then { #; this if arm should be taken set a 4 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 5 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 6 } return $a } -cleanup { unset a unset -nocomplain i } -result 6 test if-3.1 {TclCompileIfCmd: "else" clause} -body { set a {} if 3>4 {set a 1} elseif {$a == "foo"} {set a 2} else {set a 3} return $a } -cleanup { unset a } -result 3 # Since "else" is optional, the "elsex" below is treated as a command. # But then there shouldn't be any additional argument words for the "if". test if-3.2 {TclCompileIfCmd: keyword other than "else"} -setup { set a {} } -body { if 1<2 then {set a 1} elsex {set a 2} } -returnCodes error -cleanup { unset a } -result {wrong # args: extra words after "else" clause in "if" command} test if-3.3 {TclCompileIfCmd: missing body after "else"} -setup { set a {} } -body { if 2<1 {set a 1} else } -returnCodes error -cleanup { unset a } -result {wrong # args: no script following "else" argument} test if-3.4 {TclCompileIfCmd: error compiling body after "else"} -setup { set a {} } -body { catch {if 2<1 {set a 1} else {set}} set ::errorInfo } -match glob -cleanup { unset a } -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test if-3.5 {TclCompileIfCmd: extra arguments after "else" argument} -setup { set a {} } -body { if 2<1 {set a 1} else {set a 2} or something } -returnCodes error -cleanup { unset a } -result {wrong # args: extra words after "else" clause in "if" command} # The following test also checks whether contained loops and other # commands are properly relocated because a short jump must be replaced # by a "long distance" one. test if-3.6 {TclCompileIfCmd: test jumpFalse instruction replacement after long "else" clause} -setup { catch {unset i} set a {} } -body { if 1>2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } elseif 1==2 then { #; this if arm should be taken set a 4 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 5 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 6 } else { set a 7 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 8 while {$a != "xxx"} { break; while {$i >= 0} { if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } if {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 9 } return $a } -cleanup { unset a unset -nocomplain i } -result 9 test if-4.1 {TclCompileIfCmd: "if" command result} -setup { set a {} } -body { set a [if 3<4 {set i 27}] return $a } -cleanup { unset a unset -nocomplain i } -result 27 test if-4.2 {TclCompileIfCmd: "if" command result} -setup { set a {} } -body { set a [if 3>4 {set i 27}] return $a } -cleanup { unset a unset -nocomplain i } -result {} test if-4.3 {TclCompileIfCmd: "if" command result} -setup { set a {} } -body { set a [if 0 {set i 1} elseif 1 {set i 2}] return $a } -cleanup { unset a unset -nocomplain i } -result 2 test if-4.4 {TclCompileIfCmd: "if" command result} -setup { set a {} } -body { set a [if 0 {set i 1} elseif 0 {set i 2} elseif 2>5 {set i 3} else {set i 4}] return $a } -cleanup { unset a i } -result 4 test if-4.5 {TclCompileIfCmd: return value} -body { if 0 then {set a 22; concat abc} elseif 1 {concat def} {concat ghi} } -cleanup { unset -nocomplain a } -result def # Check "if" and computed command names. test if-5.1 {if cmd with computed command names: missing if/elseif test} -body { set z if $z } -returnCodes error -cleanup { unset z } -result {wrong # args: no expression after "if" argument} test if-5.2 {if cmd with computed command names: error in if/elseif test} -body { set z if $z {[error "error in condition"]} foo } -returnCodes error -cleanup { unset z } -result {error in condition} test if-5.3 {if cmd with computed command names: error in if/elseif test} -body { set z if list [catch {$z {1+}}] $::errorInfo } -match glob -cleanup { unset z } -result {1 {*"$z {1+}"}} test if-5.4 {if cmd with computed command names: if/elseif test in braces} -setup { set a {} } -body { set z if $z {1<2} {set a 1} return $a } -cleanup { unset a z } -result {1} test if-5.5 {if cmd with computed command names: if/elseif test not in braces} -setup { set a {} } -body { set z if $z 1<2 {set a 1} return $a } -cleanup { unset a z } -result {1} test if-5.6 {if cmd with computed command names: multiline test expr} -body { set z if $z {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} {set a 3} else {set a 4} return $a } -cleanup { unset a z } -result 3 test if-5.7 {if cmd with computed command names: "then" after if/elseif test} -setup { set a {} } -body { set z if $z 4>3 then {set a 1} return $a } -cleanup { unset a z } -result {1} test if-5.8 {if cmd with computed command names: keyword other than "then" after if/elseif test} -setup { set a {} } -body { set z if $z 1<2 therefore {set a 1} } -returnCodes error -cleanup { unset a z } -result {invalid command name "therefore"} test if-5.9 {if cmd with computed command names: missing "then" body} -setup { set a {} } -body { set z if $z 1<2 then } -returnCodes error -cleanup { unset a z } -result {wrong # args: no script following "then" argument} test if-5.10 {if cmd with computed command names: error in "then" body} -body { set z if set a {} list [catch {$z {$a!="xxx"} then {set}} msg] $msg $::errorInfo } -match glob -cleanup { unset a z msg } -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?" while *ing "set" invoked from within "$z {$a!="xxx"} then {set}"}} test if-5.11 {if cmd with computed command names: error in "then" body} -body { set z if $z 2 then {[error "error in then clause"]} } -returnCodes error -cleanup { unset z } -result {error in then clause} test if-5.12 {if cmd with computed command names: "then" body in quotes} -setup { set a {} } -body { set z if $z 27>17 "append a x" return $a } -cleanup { unset a z } -result {x} test if-5.13 {if cmd with computed command names: computed "then" body} -setup { catch {unset x1} catch {unset x2} } -body { set z if set x1 {append a x1} set x2 {; append a x2} set a {} $z 1 $x1$x2 return $a } -cleanup { unset a z x1 x2 } -result {x1x2} test if-5.14 {if cmd with computed command names: taking proper branch} -setup { set a {} } -body { set z if $z 1<2 {set a 1} return $a } -cleanup { unset a z } -result 1 test if-5.15 {if cmd with computed command names: taking proper branch} -body { set a {} set z if $z 1>2 {set a 1} return $a } -cleanup { unset a z } -result {} test if-5.16 {if cmd with computed command names: test jumpFalse instruction replacement after long "then" body} -setup { catch {unset i} set a {} } -body { set z if $z 1<2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } return $a } -cleanup { unset a z unset -nocomplain i } -result 3 test if-5.17 {if cmd with computed command names: if/elseif test in quotes} -setup { set a {} } -body { set z if $z {"0 < 3"} {set a 1} } -returnCodes error -cleanup { unset a z } -result {expected boolean value but got a list} test if-6.1 {if cmd with computed command names: "elseif" after if/elseif test} -setup { set a {} } -body { set z if $z 3>4 {set a 1} elseif 1 {set a 2} return $a } -cleanup { unset a z } -result {2} # Since "else" is optional, the "elwood" below is treated as a command. # But then there shouldn't be any additional argument words for the "if". test if-6.2 {if cmd with computed command names: keyword other than "elseif"} -setup { set a {} } -body { set z if $z 1<2 {set a 1} elwood {set a 2} } -returnCodes error -cleanup { unset a z } -result {wrong # args: extra words after "else" clause in "if" command} test if-6.3 {if cmd with computed command names: missing expression after "elseif"} -setup { set a {} } -body { set z if $z 1<2 {set a 1} elseif } -returnCodes error -cleanup { unset a z } -result {wrong # args: no expression after "elseif" argument} test if-6.4 {if cmd with computed command names: error in expression after "elseif"} -setup { set a {} } -body { set z if list [catch {$z 3>4 {set a 1} elseif {1>}}] $::errorInfo } -match glob -cleanup { unset a z } -result {1 {*"$z 3>4 {set a 1} elseif {1>}"}} test if-6.5 {if cmd with computed command names: test jumpFalse instruction replacement after long "elseif" body} -setup { catch {unset i} set a {} } -body { set z if $z 1>2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } elseif 1<2 then { #; this if arm should be taken set a 4 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 5 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 6 } return $a } -cleanup { unset a z unset -nocomplain i } -result 6 test if-7.1 {if cmd with computed command names: "else" clause} -setup { set a {} } -body { set z if $z 3>4 {set a 1} elseif {$a == "foo"} {set a 2} else {set a 3} return $a } -cleanup { unset a z } -result 3 # Since "else" is optional, the "elsex" below is treated as a command. # But then there shouldn't be any additional argument words for the "if". test if-7.2 {if cmd with computed command names: keyword other than "else"} -setup { set a {} } -body { set z if $z 1<2 then {set a 1} elsex {set a 2} } -returnCodes error -cleanup { unset a z } -result {wrong # args: extra words after "else" clause in "if" command} test if-7.3 {if cmd with computed command names: missing body after "else"} -setup { set a {} } -body { set z if $z 2<1 {set a 1} else } -returnCodes error -cleanup { unset a z } -result {wrong # args: no script following "else" argument} test if-7.4 {if cmd with computed command names: error compiling body after "else"} -setup { set a {} } -body { set z if catch {$z 2<1 {set a 1} else {set}} return $::errorInfo } -match glob -cleanup { unset a z } -result {wrong # args: should be "set varName ?newValue?" while *ing "set" invoked from within "$z 2<1 {set a 1} else {set}"} test if-7.5 {if cmd with computed command names: extra arguments after "else" argument} -setup { set a {} } -body { set z if $z 2<1 {set a 1} else {set a 2} or something } -returnCodes error -cleanup { unset a z } -result {wrong # args: extra words after "else" clause in "if" command} # The following test also checks whether contained loops and other # commands are properly relocated because a short jump must be replaced # by a "long distance" one. test if-7.6 {if cmd with computed command names: test jumpFalse instruction replacement after long "else" clause} -setup { catch {unset i} set a {} } -body { set z if $z 1>2 { set a 1 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 2 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 3 } elseif 1==2 then { #; this if arm should be taken set a 4 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 5 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 6 } else { set a 7 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 8 while {$a != "xxx"} { break; while {$i >= 0} { $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } $z {[string compare $a "bar"] < 0} { set i $i set i [lindex $s $i] } incr i -1 } } set a 9 } return $a } -cleanup { unset a z unset -nocomplain i } -result 9 test if-8.1 {if cmd with computed command names: "if" command result} -setup { set a {} } -body { set z if set a [$z 3<4 {set i 27}] return $a } -cleanup { unset a z unset -nocomplain i } -result 27 test if-8.2 {if cmd with computed command names: "if" command result} -setup { set a {} } -body { set z if set a [$z 3>4 {set i 27}] return $a } -cleanup { unset a z unset -nocomplain i } -result {} test if-8.3 {if cmd with computed command names: "if" command result} -setup { set a {} } -body { set z if set a [$z 0 {set i 1} elseif 1 {set i 2}] return $a } -cleanup { unset a z unset -nocomplain i } -result 2 test if-8.4 {if cmd with computed command names: "if" command result} -setup { set a {} } -body { set z if set a [$z 0 {set i 1} elseif 0 {set i 2} elseif 2>5 {set i 3} else {set i 4}] return $a } -cleanup { unset a z unset -nocomplain i } -result 4 test if-8.5 {if cmd with computed command names: return value} -body { set z if $z 0 then {set a 22; concat abc} elseif 1 {concat def} {concat ghi} } -cleanup { unset z unset -nocomplain a } -result def test if-9.1 {if cmd with namespace qualifiers} -body { ::if {1} {set x 4} } -cleanup { unset x } -result 4 # Test for incorrect "double evaluation semantics" test if-10.1 {delayed substitution of then body} -body { set j 0 set if if # this is not compiled $if {[incr j] == 1} " set result $j " # this will be compiled proc p {} { set j 0 if {[incr j]} " set result $j " set result } append result [p] } -cleanup { unset j if result rename p {} } -result {00} test if-10.2 {delayed substitution of elseif expression} -body { set j 0 set if if # this is not compiled $if {[incr j] == 0} { set result badthen } elseif "$j == 1" { set result badelseif } else { set result 0 } # this will be compiled proc p {} { set j 0 if {[incr j] == 0} { set result badthen } elseif "$j == 1" { set result badelseif } else { set result 0 } set result } append result [p] } -cleanup { unset j if result rename p {} } -result {00} test if-10.3 {delayed substitution of elseif body} -body { set j 0 set if if # this is not compiled $if {[incr j] == 0} { set result badthen } elseif {1} " set result $j " # this will be compiled proc p {} { set j 0 if {[incr j] == 0} { set result badthen } elseif {1} " set result $j " } append result [p] } -cleanup { unset j if result rename p {} } -result {00} test if-10.4 {delayed substitution of else body} -body { set j 0 if {[incr j] == 0} { set result badthen } else " set result $j " return $result } -cleanup { unset j result } -result {0} test if-10.5 {substituted control words} -body { set then then; proc then {} {return badthen} set else else; proc else {} {return badelse} set elseif elseif; proc elseif {} {return badelseif} list [catch {if 1 $then {if 0 {} $elseif 1 {if 0 {} $else {list ok}}}} a] $a } -cleanup { unset then else elseif a } -result {0 ok} test if-10.6 {double invocation of variable traces} -body { set iftracecounter 0 proc iftraceproc {args} { upvar #0 iftracecounter counter set argc [llength $args] set extraargs [lrange $args 0 [expr {$argc - 4}]] set name [lindex $args [expr {$argc - 3}]] upvar 1 $name var if {[incr counter] % 2 == 1} { set var "$counter oops [concat $extraargs]" } else { set var "$counter + [concat $extraargs]" } } trace add variable iftracevar read [list iftraceproc 10] list [catch {if "$iftracevar + 20" {}} a] $a \ [catch {if "$iftracevar + 20" {}} b] $b } -cleanup { unset iftracevar iftracecounter a b } -match glob -result {1 {*} 0 {}} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/if-old.test0000644000175000017500000001122415104661341014764 0ustar sergeisergei# Commands covered: if # # This file contains the original set of tests for Tcl's if command. # Since the if command is now compiled, a new set of tests covering # the new implementation is in the file "if.test". Sourcing this file # into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test if-old-1.1 {taking proper branch} { set a {} if 0 {set a 1} else {set a 2} set a } 2 test if-old-1.2 {taking proper branch} { set a {} if 1 {set a 1} else {set a 2} set a } 1 test if-old-1.3 {taking proper branch} { set a {} if 1<2 {set a 1} set a } 1 test if-old-1.4 {taking proper branch} { set a {} if 1>2 {set a 1} set a } {} test if-old-1.5 {taking proper branch} { set a {} if 0 {set a 1} else {} set a } {} test if-old-1.6 {taking proper branch} { set a {} if 0 {set a 1} elseif 1 {set a 2} elseif 1 {set a 3} else {set a 4} set a } {2} test if-old-1.7 {taking proper branch} { set a {} if 0 {set a 1} elseif 0 {set a 2} elseif 1 {set a 3} else {set a 4} set a } {3} test if-old-1.8 {taking proper branch} { set a {} if 0 {set a 1} elseif 0 {set a 2} elseif 0 {set a 3} else {set a 4} set a } {4} test if-old-1.9 {taking proper branch, multiline test expr} { set a {} if {($tcl_platform(platform) != "foobar1") && \ ($tcl_platform(platform) != "foobar2")} {set a 3} else {set a 4} set a } {3} test if-old-2.1 {optional then-else args} { set a 44 if 0 then {set a 1} elseif 0 then {set a 3} else {set a 2} set a } 2 test if-old-2.2 {optional then-else args} { set a 44 if 1 then {set a 1} else {set a 2} set a } 1 test if-old-2.3 {optional then-else args} { set a 44 if 0 {set a 1} else {set a 2} set a } 2 test if-old-2.4 {optional then-else args} { set a 44 if 1 {set a 1} else {set a 2} set a } 1 test if-old-2.5 {optional then-else args} { set a 44 if 0 then {set a 1} {set a 2} set a } 2 test if-old-2.6 {optional then-else args} { set a 44 if 1 then {set a 1} {set a 2} set a } 1 test if-old-2.7 {optional then-else args} { set a 44 if 0 then {set a 1} else {set a 2} set a } 2 test if-old-2.8 {optional then-else args} { set a 44 if 0 then {set a 1} elseif 0 {set a 2} elseif 0 {set a 3} {set a 4} set a } 4 test if-old-3.1 {return value} { if 1 then {set a 22; concat abc} } abc test if-old-3.2 {return value} { if 0 then {set a 22; concat abc} elseif 1 {concat def} {concat ghi} } def test if-old-3.3 {return value} { if 0 then {set a 22; concat abc} else {concat def} } def test if-old-3.4 {return value} { if 0 then {set a 22; concat abc} } {} test if-old-3.5 {return value} { if 0 then {set a 22; concat abc} elseif 0 {concat def} } {} test if-old-4.1 {error conditions} { list [catch {if} msg] $msg } {1 {wrong # args: no expression after "if" argument}} test if-old-4.2 {error conditions} { list [catch {if {[error "error in condition"]} foo} msg] $msg } {1 {error in condition}} test if-old-4.3 {error conditions} { list [catch {if 2} msg] $msg } {1 {wrong # args: no script following "2" argument}} test if-old-4.4 {error conditions} { list [catch {if 2 then} msg] $msg } {1 {wrong # args: no script following "then" argument}} test if-old-4.5 {error conditions} { list [catch {if 2 the} msg] $msg } {1 {invalid command name "the"}} test if-old-4.6 {error conditions} { list [catch {if 2 then {[error "error in then clause"]}} msg] $msg } {1 {error in then clause}} test if-old-4.7 {error conditions} { list [catch {if 0 then foo elseif} msg] $msg } {1 {wrong # args: no expression after "elseif" argument}} test if-old-4.8 {error conditions} { list [catch {if 0 then foo elsei} msg] $msg } {1 {invalid command name "elsei"}} test if-old-4.9 {error conditions} { list [catch {if 0 then foo elseif 0 bar else} msg] $msg } {1 {wrong # args: no script following "else" argument}} test if-old-4.10 {error conditions} { list [catch {if 0 then foo elseif 0 bar els} msg] $msg } {1 {invalid command name "els"}} test if-old-4.11 {error conditions} { list [catch {if 0 then foo elseif 0 bar else {[error "error in else clause"]}} msg] $msg } {1 {error in else clause}} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/icuUcmTests.tcl0000644000175000017500000051604515104661341015700 0ustar sergeisergei # This file is automatically generated by ucm2tests.tcl. # Edits will be overwritten on next generation. # # Tests comparing Tcl encodings to ICU. # This file is NOT standalone. It should be sourced into a test script. proc ucmConvertfromMismatches {enc map} { set mismatches {} foreach {unihex hex} $map { set unihex [string range 00000000$unihex end-7 end]; # Make 8 digits set unich [subst "\\U$unihex"] if {[encoding convertfrom -profile strict $enc [binary decode hex $hex]] ne $unich} { lappend mismatches "<[printable $unich],$hex>" } } return $mismatches } proc ucmConverttoMismatches {enc map} { set mismatches {} foreach {unihex hex} $map { set unihex [string range 00000000$unihex end-7 end]; # Make 8 digits set unich [subst "\\U$unihex"] if {[encoding convertto -profile strict $enc $unich] ne [binary decode hex $hex]} { lappend mismatches "<[printable $unich],$hex>" } } return $mismatches } if {[info commands printable] eq ""} { proc printable {s} { set print "" foreach c [split $s ""] { set i [scan $c %c] if {[string is print $c] && ($i <= 127)} { append print $c } elseif {$i <= 0xff} { append print \\x[format %02X $i] } elseif {$i <= 0xffff} { append print \\u[format %04X $i] } else { append print \\U[format %08X $i] } } return $print } } # # cp1250 (generated from glibc-CP1250-2.1.2) test encoding-convertfrom-ucmCompare-cp1250 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1250 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A4 A4 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00BB BB 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C9 C9 00CB CB 00CD CD 00CE CE 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00DA DA 00DC DC 00DD DD 00DF DF 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E9 E9 00EB EB 00ED ED 00EE EE 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00FA FA 00FC FC 00FD FD 0102 C3 0103 E3 0104 A5 0105 B9 0106 C6 0107 E6 010C C8 010D E8 010E CF 010F EF 0110 D0 0111 F0 0118 CA 0119 EA 011A CC 011B EC 0139 C5 013A E5 013D BC 013E BE 0141 A3 0142 B3 0143 D1 0144 F1 0147 D2 0148 F2 0150 D5 0151 F5 0154 C0 0155 E0 0158 D8 0159 F8 015A 8C 015B 9C 015E AA 015F BA 0160 8A 0161 9A 0162 DE 0163 FE 0164 8D 0165 9D 016E D9 016F F9 0170 DB 0171 FB 0179 8F 017A 9F 017B AF 017C BF 017D 8E 017E 9E 02C7 A1 02D8 A2 02D9 FF 02DB B2 02DD BD 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1250 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1250 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A4 A4 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00BB BB 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C9 C9 00CB CB 00CD CD 00CE CE 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00DA DA 00DC DC 00DD DD 00DF DF 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E9 E9 00EB EB 00ED ED 00EE EE 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00FA FA 00FC FC 00FD FD 0102 C3 0103 E3 0104 A5 0105 B9 0106 C6 0107 E6 010C C8 010D E8 010E CF 010F EF 0110 D0 0111 F0 0118 CA 0119 EA 011A CC 011B EC 0139 C5 013A E5 013D BC 013E BE 0141 A3 0142 B3 0143 D1 0144 F1 0147 D2 0148 F2 0150 D5 0151 F5 0154 C0 0155 E0 0158 D8 0159 F8 015A 8C 015B 9C 015E AA 015F BA 0160 8A 0161 9A 0162 DE 0163 FE 0164 8D 0165 9D 016E D9 016F F9 0170 DB 0171 FB 0179 8F 017A 9F 017B AF 017C BF 017D 8E 017E 9E 02C7 A1 02D8 A2 02D9 FF 02DB B2 02DD BD 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1250 - invalid byte sequences lappend encInvalidBytes {*}{ cp1250 81 tcl8 \U00000081 -1 {} {} cp1250 81 replace \uFFFD -1 {} {} cp1250 81 strict {} 0 {} {} cp1250 83 tcl8 \U00000083 -1 {} {} cp1250 83 replace \uFFFD -1 {} {} cp1250 83 strict {} 0 {} {} cp1250 88 tcl8 \U00000088 -1 {} {} cp1250 88 replace \uFFFD -1 {} {} cp1250 88 strict {} 0 {} {} cp1250 90 tcl8 \U00000090 -1 {} {} cp1250 90 replace \uFFFD -1 {} {} cp1250 90 strict {} 0 {} {} cp1250 98 tcl8 \U00000098 -1 {} {} cp1250 98 replace \uFFFD -1 {} {} cp1250 98 strict {} 0 {} {} }; # cp1250 # cp1250 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1250 \U00000080 tcl8 1A -1 {} {} cp1250 \U00000080 replace 1A -1 {} {} cp1250 \U00000080 strict {} 0 {} {} cp1250 \U00000400 tcl8 1A -1 {} {} cp1250 \U00000400 replace 1A -1 {} {} cp1250 \U00000400 strict {} 0 {} {} cp1250 \U0000D800 tcl8 1A -1 {} {} cp1250 \U0000D800 replace 1A -1 {} {} cp1250 \U0000D800 strict {} 0 {} {} cp1250 \U0000DC00 tcl8 1A -1 {} {} cp1250 \U0000DC00 replace 1A -1 {} {} cp1250 \U0000DC00 strict {} 0 {} {} cp1250 \U00010000 tcl8 1A -1 {} {} cp1250 \U00010000 replace 1A -1 {} {} cp1250 \U00010000 strict {} 0 {} {} cp1250 \U0010FFFF tcl8 1A -1 {} {} cp1250 \U0010FFFF replace 1A -1 {} {} cp1250 \U0010FFFF strict {} 0 {} {} }; # cp1250 # # cp1251 (generated from glibc-CP1251-2.1.2) test encoding-convertfrom-ucmCompare-cp1251 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1251 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A4 A4 00A6 A6 00A7 A7 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B5 B5 00B6 B6 00B7 B7 00BB BB 0401 A8 0402 80 0403 81 0404 AA 0405 BD 0406 B2 0407 AF 0408 A3 0409 8A 040A 8C 040B 8E 040C 8D 040E A1 040F 8F 0410 C0 0411 C1 0412 C2 0413 C3 0414 C4 0415 C5 0416 C6 0417 C7 0418 C8 0419 C9 041A CA 041B CB 041C CC 041D CD 041E CE 041F CF 0420 D0 0421 D1 0422 D2 0423 D3 0424 D4 0425 D5 0426 D6 0427 D7 0428 D8 0429 D9 042A DA 042B DB 042C DC 042D DD 042E DE 042F DF 0430 E0 0431 E1 0432 E2 0433 E3 0434 E4 0435 E5 0436 E6 0437 E7 0438 E8 0439 E9 043A EA 043B EB 043C EC 043D ED 043E EE 043F EF 0440 F0 0441 F1 0442 F2 0443 F3 0444 F4 0445 F5 0446 F6 0447 F7 0448 F8 0449 F9 044A FA 044B FB 044C FC 044D FD 044E FE 044F FF 0451 B8 0452 90 0453 83 0454 BA 0455 BE 0456 B3 0457 BF 0458 BC 0459 9A 045A 9C 045B 9E 045C 9D 045E A2 045F 9F 0490 A5 0491 B4 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 88 2116 B9 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1251 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1251 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A4 A4 00A6 A6 00A7 A7 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B5 B5 00B6 B6 00B7 B7 00BB BB 0401 A8 0402 80 0403 81 0404 AA 0405 BD 0406 B2 0407 AF 0408 A3 0409 8A 040A 8C 040B 8E 040C 8D 040E A1 040F 8F 0410 C0 0411 C1 0412 C2 0413 C3 0414 C4 0415 C5 0416 C6 0417 C7 0418 C8 0419 C9 041A CA 041B CB 041C CC 041D CD 041E CE 041F CF 0420 D0 0421 D1 0422 D2 0423 D3 0424 D4 0425 D5 0426 D6 0427 D7 0428 D8 0429 D9 042A DA 042B DB 042C DC 042D DD 042E DE 042F DF 0430 E0 0431 E1 0432 E2 0433 E3 0434 E4 0435 E5 0436 E6 0437 E7 0438 E8 0439 E9 043A EA 043B EB 043C EC 043D ED 043E EE 043F EF 0440 F0 0441 F1 0442 F2 0443 F3 0444 F4 0445 F5 0446 F6 0447 F7 0448 F8 0449 F9 044A FA 044B FB 044C FC 044D FD 044E FE 044F FF 0451 B8 0452 90 0453 83 0454 BA 0455 BE 0456 B3 0457 BF 0458 BC 0459 9A 045A 9C 045B 9E 045C 9D 045E A2 045F 9F 0490 A5 0491 B4 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 88 2116 B9 2122 99} } -result {} # cp1251 - invalid byte sequences lappend encInvalidBytes {*}{ cp1251 98 tcl8 \U00000098 -1 {} {} cp1251 98 replace \uFFFD -1 {} {} cp1251 98 strict {} 0 {} {} }; # cp1251 # cp1251 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1251 \U00000080 tcl8 1A -1 {} {} cp1251 \U00000080 replace 1A -1 {} {} cp1251 \U00000080 strict {} 0 {} {} cp1251 \U00000400 tcl8 1A -1 {} {} cp1251 \U00000400 replace 1A -1 {} {} cp1251 \U00000400 strict {} 0 {} {} cp1251 \U0000D800 tcl8 1A -1 {} {} cp1251 \U0000D800 replace 1A -1 {} {} cp1251 \U0000D800 strict {} 0 {} {} cp1251 \U0000DC00 tcl8 1A -1 {} {} cp1251 \U0000DC00 replace 1A -1 {} {} cp1251 \U0000DC00 strict {} 0 {} {} cp1251 \U00010000 tcl8 1A -1 {} {} cp1251 \U00010000 replace 1A -1 {} {} cp1251 \U00010000 strict {} 0 {} {} cp1251 \U0010FFFF tcl8 1A -1 {} {} cp1251 \U0010FFFF replace 1A -1 {} {} cp1251 \U0010FFFF strict {} 0 {} {} }; # cp1251 # # cp1252 (generated from glibc-CP1252-2.1.2) test encoding-convertfrom-ucmCompare-cp1252 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1252 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF 0152 8C 0153 9C 0160 8A 0161 9A 0178 9F 017D 8E 017E 9E 0192 83 02C6 88 02DC 98 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1252 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1252 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF 0152 8C 0153 9C 0160 8A 0161 9A 0178 9F 017D 8E 017E 9E 0192 83 02C6 88 02DC 98 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1252 - invalid byte sequences lappend encInvalidBytes {*}{ cp1252 81 tcl8 \U00000081 -1 {} {} cp1252 81 replace \uFFFD -1 {} {} cp1252 81 strict {} 0 {} {} cp1252 8D tcl8 \U0000008D -1 {} {} cp1252 8D replace \uFFFD -1 {} {} cp1252 8D strict {} 0 {} {} cp1252 8F tcl8 \U0000008F -1 {} {} cp1252 8F replace \uFFFD -1 {} {} cp1252 8F strict {} 0 {} {} cp1252 90 tcl8 \U00000090 -1 {} {} cp1252 90 replace \uFFFD -1 {} {} cp1252 90 strict {} 0 {} {} cp1252 9D tcl8 \U0000009D -1 {} {} cp1252 9D replace \uFFFD -1 {} {} cp1252 9D strict {} 0 {} {} }; # cp1252 # cp1252 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1252 \U00000080 tcl8 1A -1 {} {} cp1252 \U00000080 replace 1A -1 {} {} cp1252 \U00000080 strict {} 0 {} {} cp1252 \U00000400 tcl8 1A -1 {} {} cp1252 \U00000400 replace 1A -1 {} {} cp1252 \U00000400 strict {} 0 {} {} cp1252 \U0000D800 tcl8 1A -1 {} {} cp1252 \U0000D800 replace 1A -1 {} {} cp1252 \U0000D800 strict {} 0 {} {} cp1252 \U0000DC00 tcl8 1A -1 {} {} cp1252 \U0000DC00 replace 1A -1 {} {} cp1252 \U0000DC00 strict {} 0 {} {} cp1252 \U00010000 tcl8 1A -1 {} {} cp1252 \U00010000 replace 1A -1 {} {} cp1252 \U00010000 strict {} 0 {} {} cp1252 \U0010FFFF tcl8 1A -1 {} {} cp1252 \U0010FFFF replace 1A -1 {} {} cp1252 \U0010FFFF strict {} 0 {} {} }; # cp1252 # # cp1253 (generated from glibc-CP1253-2.1.2) test encoding-convertfrom-ucmCompare-cp1253 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1253 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00BB BB 00BD BD 0192 83 0384 B4 0385 A1 0386 A2 0388 B8 0389 B9 038A BA 038C BC 038E BE 038F BF 0390 C0 0391 C1 0392 C2 0393 C3 0394 C4 0395 C5 0396 C6 0397 C7 0398 C8 0399 C9 039A CA 039B CB 039C CC 039D CD 039E CE 039F CF 03A0 D0 03A1 D1 03A3 D3 03A4 D4 03A5 D5 03A6 D6 03A7 D7 03A8 D8 03A9 D9 03AA DA 03AB DB 03AC DC 03AD DD 03AE DE 03AF DF 03B0 E0 03B1 E1 03B2 E2 03B3 E3 03B4 E4 03B5 E5 03B6 E6 03B7 E7 03B8 E8 03B9 E9 03BA EA 03BB EB 03BC EC 03BD ED 03BE EE 03BF EF 03C0 F0 03C1 F1 03C2 F2 03C3 F3 03C4 F4 03C5 F5 03C6 F6 03C7 F7 03C8 F8 03C9 F9 03CA FA 03CB FB 03CC FC 03CD FD 03CE FE 2013 96 2014 97 2015 AF 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1253 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1253 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00BB BB 00BD BD 0192 83 0384 B4 0385 A1 0386 A2 0388 B8 0389 B9 038A BA 038C BC 038E BE 038F BF 0390 C0 0391 C1 0392 C2 0393 C3 0394 C4 0395 C5 0396 C6 0397 C7 0398 C8 0399 C9 039A CA 039B CB 039C CC 039D CD 039E CE 039F CF 03A0 D0 03A1 D1 03A3 D3 03A4 D4 03A5 D5 03A6 D6 03A7 D7 03A8 D8 03A9 D9 03AA DA 03AB DB 03AC DC 03AD DD 03AE DE 03AF DF 03B0 E0 03B1 E1 03B2 E2 03B3 E3 03B4 E4 03B5 E5 03B6 E6 03B7 E7 03B8 E8 03B9 E9 03BA EA 03BB EB 03BC EC 03BD ED 03BE EE 03BF EF 03C0 F0 03C1 F1 03C2 F2 03C3 F3 03C4 F4 03C5 F5 03C6 F6 03C7 F7 03C8 F8 03C9 F9 03CA FA 03CB FB 03CC FC 03CD FD 03CE FE 2013 96 2014 97 2015 AF 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1253 - invalid byte sequences lappend encInvalidBytes {*}{ cp1253 81 tcl8 \U00000081 -1 {} {} cp1253 81 replace \uFFFD -1 {} {} cp1253 81 strict {} 0 {} {} cp1253 88 tcl8 \U00000088 -1 {} {} cp1253 88 replace \uFFFD -1 {} {} cp1253 88 strict {} 0 {} {} cp1253 8A tcl8 \U0000008A -1 {} {} cp1253 8A replace \uFFFD -1 {} {} cp1253 8A strict {} 0 {} {} cp1253 8C tcl8 \U0000008C -1 {} {} cp1253 8C replace \uFFFD -1 {} {} cp1253 8C strict {} 0 {} {} cp1253 8D tcl8 \U0000008D -1 {} {} cp1253 8D replace \uFFFD -1 {} {} cp1253 8D strict {} 0 {} {} cp1253 8E tcl8 \U0000008E -1 {} {} cp1253 8E replace \uFFFD -1 {} {} cp1253 8E strict {} 0 {} {} cp1253 8F tcl8 \U0000008F -1 {} {} cp1253 8F replace \uFFFD -1 {} {} cp1253 8F strict {} 0 {} {} cp1253 90 tcl8 \U00000090 -1 {} {} cp1253 90 replace \uFFFD -1 {} {} cp1253 90 strict {} 0 {} {} cp1253 98 tcl8 \U00000098 -1 {} {} cp1253 98 replace \uFFFD -1 {} {} cp1253 98 strict {} 0 {} {} cp1253 9A tcl8 \U0000009A -1 {} {} cp1253 9A replace \uFFFD -1 {} {} cp1253 9A strict {} 0 {} {} cp1253 9C tcl8 \U0000009C -1 {} {} cp1253 9C replace \uFFFD -1 {} {} cp1253 9C strict {} 0 {} {} cp1253 9D tcl8 \U0000009D -1 {} {} cp1253 9D replace \uFFFD -1 {} {} cp1253 9D strict {} 0 {} {} cp1253 9E tcl8 \U0000009E -1 {} {} cp1253 9E replace \uFFFD -1 {} {} cp1253 9E strict {} 0 {} {} cp1253 9F tcl8 \U0000009F -1 {} {} cp1253 9F replace \uFFFD -1 {} {} cp1253 9F strict {} 0 {} {} cp1253 AA tcl8 \U000000AA -1 {} {} cp1253 AA replace \uFFFD -1 {} {} cp1253 AA strict {} 0 {} {} cp1253 D2 tcl8 \U000000D2 -1 {} {} cp1253 D2 replace \uFFFD -1 {} {} cp1253 D2 strict {} 0 {} {} cp1253 FF tcl8 \U000000FF -1 {} {} cp1253 FF replace \uFFFD -1 {} {} cp1253 FF strict {} 0 {} {} }; # cp1253 # cp1253 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1253 \U00000080 tcl8 1A -1 {} {} cp1253 \U00000080 replace 1A -1 {} {} cp1253 \U00000080 strict {} 0 {} {} cp1253 \U00000400 tcl8 1A -1 {} {} cp1253 \U00000400 replace 1A -1 {} {} cp1253 \U00000400 strict {} 0 {} {} cp1253 \U0000D800 tcl8 1A -1 {} {} cp1253 \U0000D800 replace 1A -1 {} {} cp1253 \U0000D800 strict {} 0 {} {} cp1253 \U0000DC00 tcl8 1A -1 {} {} cp1253 \U0000DC00 replace 1A -1 {} {} cp1253 \U0000DC00 strict {} 0 {} {} cp1253 \U00010000 tcl8 1A -1 {} {} cp1253 \U00010000 replace 1A -1 {} {} cp1253 \U00010000 strict {} 0 {} {} cp1253 \U0010FFFF tcl8 1A -1 {} {} cp1253 \U0010FFFF replace 1A -1 {} {} cp1253 \U0010FFFF strict {} 0 {} {} }; # cp1253 # # cp1254 (generated from glibc-CP1254-2.1.2) test encoding-convertfrom-ucmCompare-cp1254 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1254 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 011E D0 011F F0 0130 DD 0131 FD 0152 8C 0153 9C 015E DE 015F FE 0160 8A 0161 9A 0178 9F 0192 83 02C6 88 02DC 98 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1254 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1254 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 011E D0 011F F0 0130 DD 0131 FD 0152 8C 0153 9C 015E DE 015F FE 0160 8A 0161 9A 0178 9F 0192 83 02C6 88 02DC 98 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1254 - invalid byte sequences lappend encInvalidBytes {*}{ cp1254 81 tcl8 \U00000081 -1 {} {} cp1254 81 replace \uFFFD -1 {} {} cp1254 81 strict {} 0 {} {} cp1254 8D tcl8 \U0000008D -1 {} {} cp1254 8D replace \uFFFD -1 {} {} cp1254 8D strict {} 0 {} {} cp1254 8E tcl8 \U0000008E -1 {} {} cp1254 8E replace \uFFFD -1 {} {} cp1254 8E strict {} 0 {} {} cp1254 8F tcl8 \U0000008F -1 {} {} cp1254 8F replace \uFFFD -1 {} {} cp1254 8F strict {} 0 {} {} cp1254 90 tcl8 \U00000090 -1 {} {} cp1254 90 replace \uFFFD -1 {} {} cp1254 90 strict {} 0 {} {} cp1254 9D tcl8 \U0000009D -1 {} {} cp1254 9D replace \uFFFD -1 {} {} cp1254 9D strict {} 0 {} {} cp1254 9E tcl8 \U0000009E -1 {} {} cp1254 9E replace \uFFFD -1 {} {} cp1254 9E strict {} 0 {} {} }; # cp1254 # cp1254 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1254 \U00000080 tcl8 1A -1 {} {} cp1254 \U00000080 replace 1A -1 {} {} cp1254 \U00000080 strict {} 0 {} {} cp1254 \U00000400 tcl8 1A -1 {} {} cp1254 \U00000400 replace 1A -1 {} {} cp1254 \U00000400 strict {} 0 {} {} cp1254 \U0000D800 tcl8 1A -1 {} {} cp1254 \U0000D800 replace 1A -1 {} {} cp1254 \U0000D800 strict {} 0 {} {} cp1254 \U0000DC00 tcl8 1A -1 {} {} cp1254 \U0000DC00 replace 1A -1 {} {} cp1254 \U0000DC00 strict {} 0 {} {} cp1254 \U00010000 tcl8 1A -1 {} {} cp1254 \U00010000 replace 1A -1 {} {} cp1254 \U00010000 strict {} 0 {} {} cp1254 \U0010FFFF tcl8 1A -1 {} {} cp1254 \U0010FFFF replace 1A -1 {} {} cp1254 \U0010FFFF strict {} 0 {} {} }; # cp1254 # # cp1255 (generated from glibc-CP1255-2.1.2) test encoding-convertfrom-ucmCompare-cp1255 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1255 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00D7 AA 00F7 BA 0192 83 02C6 88 02DC 98 05B0 C0 05B1 C1 05B2 C2 05B3 C3 05B4 C4 05B5 C5 05B6 C6 05B7 C7 05B8 C8 05B9 C9 05BB CB 05BC CC 05BD CD 05BE CE 05BF CF 05C0 D0 05C1 D1 05C2 D2 05C3 D3 05D0 E0 05D1 E1 05D2 E2 05D3 E3 05D4 E4 05D5 E5 05D6 E6 05D7 E7 05D8 E8 05D9 E9 05DA EA 05DB EB 05DC EC 05DD ED 05DE EE 05DF EF 05E0 F0 05E1 F1 05E2 F2 05E3 F3 05E4 F4 05E5 F5 05E6 F6 05E7 F7 05E8 F8 05E9 F9 05EA FA 05F0 D4 05F1 D5 05F2 D6 05F3 D7 05F4 D8 200E FD 200F FE 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AA A4 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1255 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1255 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00D7 AA 00F7 BA 0192 83 02C6 88 02DC 98 05B0 C0 05B1 C1 05B2 C2 05B3 C3 05B4 C4 05B5 C5 05B6 C6 05B7 C7 05B8 C8 05B9 C9 05BB CB 05BC CC 05BD CD 05BE CE 05BF CF 05C0 D0 05C1 D1 05C2 D2 05C3 D3 05D0 E0 05D1 E1 05D2 E2 05D3 E3 05D4 E4 05D5 E5 05D6 E6 05D7 E7 05D8 E8 05D9 E9 05DA EA 05DB EB 05DC EC 05DD ED 05DE EE 05DF EF 05E0 F0 05E1 F1 05E2 F2 05E3 F3 05E4 F4 05E5 F5 05E6 F6 05E7 F7 05E8 F8 05E9 F9 05EA FA 05F0 D4 05F1 D5 05F2 D6 05F3 D7 05F4 D8 200E FD 200F FE 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AA A4 20AC 80 2122 99} } -result {} # cp1255 - invalid byte sequences lappend encInvalidBytes {*}{ cp1255 81 tcl8 \U00000081 -1 {} {} cp1255 81 replace \uFFFD -1 {} {} cp1255 81 strict {} 0 {} {} cp1255 8A tcl8 \U0000008A -1 {} {} cp1255 8A replace \uFFFD -1 {} {} cp1255 8A strict {} 0 {} {} cp1255 8C tcl8 \U0000008C -1 {} {} cp1255 8C replace \uFFFD -1 {} {} cp1255 8C strict {} 0 {} {} cp1255 8D tcl8 \U0000008D -1 {} {} cp1255 8D replace \uFFFD -1 {} {} cp1255 8D strict {} 0 {} {} cp1255 8E tcl8 \U0000008E -1 {} {} cp1255 8E replace \uFFFD -1 {} {} cp1255 8E strict {} 0 {} {} cp1255 8F tcl8 \U0000008F -1 {} {} cp1255 8F replace \uFFFD -1 {} {} cp1255 8F strict {} 0 {} {} cp1255 90 tcl8 \U00000090 -1 {} {} cp1255 90 replace \uFFFD -1 {} {} cp1255 90 strict {} 0 {} {} cp1255 9A tcl8 \U0000009A -1 {} {} cp1255 9A replace \uFFFD -1 {} {} cp1255 9A strict {} 0 {} {} cp1255 9C tcl8 \U0000009C -1 {} {} cp1255 9C replace \uFFFD -1 {} {} cp1255 9C strict {} 0 {} {} cp1255 9D tcl8 \U0000009D -1 {} {} cp1255 9D replace \uFFFD -1 {} {} cp1255 9D strict {} 0 {} {} cp1255 9E tcl8 \U0000009E -1 {} {} cp1255 9E replace \uFFFD -1 {} {} cp1255 9E strict {} 0 {} {} cp1255 9F tcl8 \U0000009F -1 {} {} cp1255 9F replace \uFFFD -1 {} {} cp1255 9F strict {} 0 {} {} cp1255 CA tcl8 \U000000CA -1 {} {} cp1255 CA replace \uFFFD -1 {} {} cp1255 CA strict {} 0 {} {} cp1255 D9 tcl8 \U000000D9 -1 {} {} cp1255 D9 replace \uFFFD -1 {} {} cp1255 D9 strict {} 0 {} {} cp1255 DA tcl8 \U000000DA -1 {} {} cp1255 DA replace \uFFFD -1 {} {} cp1255 DA strict {} 0 {} {} cp1255 DB tcl8 \U000000DB -1 {} {} cp1255 DB replace \uFFFD -1 {} {} cp1255 DB strict {} 0 {} {} cp1255 DC tcl8 \U000000DC -1 {} {} cp1255 DC replace \uFFFD -1 {} {} cp1255 DC strict {} 0 {} {} cp1255 DD tcl8 \U000000DD -1 {} {} cp1255 DD replace \uFFFD -1 {} {} cp1255 DD strict {} 0 {} {} cp1255 DE tcl8 \U000000DE -1 {} {} cp1255 DE replace \uFFFD -1 {} {} cp1255 DE strict {} 0 {} {} cp1255 DF tcl8 \U000000DF -1 {} {} cp1255 DF replace \uFFFD -1 {} {} cp1255 DF strict {} 0 {} {} cp1255 FB tcl8 \U000000FB -1 {} {} cp1255 FB replace \uFFFD -1 {} {} cp1255 FB strict {} 0 {} {} cp1255 FC tcl8 \U000000FC -1 {} {} cp1255 FC replace \uFFFD -1 {} {} cp1255 FC strict {} 0 {} {} cp1255 FF tcl8 \U000000FF -1 {} {} cp1255 FF replace \uFFFD -1 {} {} cp1255 FF strict {} 0 {} {} }; # cp1255 # cp1255 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1255 \U00000080 tcl8 1A -1 {} {} cp1255 \U00000080 replace 1A -1 {} {} cp1255 \U00000080 strict {} 0 {} {} cp1255 \U00000400 tcl8 1A -1 {} {} cp1255 \U00000400 replace 1A -1 {} {} cp1255 \U00000400 strict {} 0 {} {} cp1255 \U0000D800 tcl8 1A -1 {} {} cp1255 \U0000D800 replace 1A -1 {} {} cp1255 \U0000D800 strict {} 0 {} {} cp1255 \U0000DC00 tcl8 1A -1 {} {} cp1255 \U0000DC00 replace 1A -1 {} {} cp1255 \U0000DC00 strict {} 0 {} {} cp1255 \U00010000 tcl8 1A -1 {} {} cp1255 \U00010000 replace 1A -1 {} {} cp1255 \U00010000 strict {} 0 {} {} cp1255 \U0010FFFF tcl8 1A -1 {} {} cp1255 \U0010FFFF replace 1A -1 {} {} cp1255 \U0010FFFF strict {} 0 {} {} }; # cp1255 # # cp1256 (generated from glibc-CP1256-2.1.2) test encoding-convertfrom-ucmCompare-cp1256 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1256 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00D7 D7 00E0 E0 00E2 E2 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EE EE 00EF EF 00F4 F4 00F7 F7 00F9 F9 00FB FB 00FC FC 0152 8C 0153 9C 0192 83 02C6 88 060C A1 061B BA 061F BF 0621 C1 0622 C2 0623 C3 0624 C4 0625 C5 0626 C6 0627 C7 0628 C8 0629 C9 062A CA 062B CB 062C CC 062D CD 062E CE 062F CF 0630 D0 0631 D1 0632 D2 0633 D3 0634 D4 0635 D5 0636 D6 0637 D8 0638 D9 0639 DA 063A DB 0640 DC 0641 DD 0642 DE 0643 DF 0644 E1 0645 E3 0646 E4 0647 E5 0648 E6 0649 EC 064A ED 064B F0 064C F1 064D F2 064E F3 064F F5 0650 F6 0651 F8 0652 FA 0679 8A 067E 81 0686 8D 0688 8F 0691 9A 0698 8E 06A9 98 06AF 90 06BA 9F 06BE AA 06C1 C0 06D2 FF 200C 9D 200D 9E 200E FD 200F FE 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1256 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1256 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00D7 D7 00E0 E0 00E2 E2 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EE EE 00EF EF 00F4 F4 00F7 F7 00F9 F9 00FB FB 00FC FC 0152 8C 0153 9C 0192 83 02C6 88 060C A1 061B BA 061F BF 0621 C1 0622 C2 0623 C3 0624 C4 0625 C5 0626 C6 0627 C7 0628 C8 0629 C9 062A CA 062B CB 062C CC 062D CD 062E CE 062F CF 0630 D0 0631 D1 0632 D2 0633 D3 0634 D4 0635 D5 0636 D6 0637 D8 0638 D9 0639 DA 063A DB 0640 DC 0641 DD 0642 DE 0643 DF 0644 E1 0645 E3 0646 E4 0647 E5 0648 E6 0649 EC 064A ED 064B F0 064C F1 064D F2 064E F3 064F F5 0650 F6 0651 F8 0652 FA 0679 8A 067E 81 0686 8D 0688 8F 0691 9A 0698 8E 06A9 98 06AF 90 06BA 9F 06BE AA 06C1 C0 06D2 FF 200C 9D 200D 9E 200E FD 200F FE 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1256 - invalid byte sequences lappend encInvalidBytes {*}{ }; # cp1256 # cp1256 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1256 \U00000080 tcl8 1A -1 {} {} cp1256 \U00000080 replace 1A -1 {} {} cp1256 \U00000080 strict {} 0 {} {} cp1256 \U00000400 tcl8 1A -1 {} {} cp1256 \U00000400 replace 1A -1 {} {} cp1256 \U00000400 strict {} 0 {} {} cp1256 \U0000D800 tcl8 1A -1 {} {} cp1256 \U0000D800 replace 1A -1 {} {} cp1256 \U0000D800 strict {} 0 {} {} cp1256 \U0000DC00 tcl8 1A -1 {} {} cp1256 \U0000DC00 replace 1A -1 {} {} cp1256 \U0000DC00 strict {} 0 {} {} cp1256 \U00010000 tcl8 1A -1 {} {} cp1256 \U00010000 replace 1A -1 {} {} cp1256 \U00010000 strict {} 0 {} {} cp1256 \U0010FFFF tcl8 1A -1 {} {} cp1256 \U0010FFFF replace 1A -1 {} {} cp1256 \U0010FFFF strict {} 0 {} {} }; # cp1256 # # cp1257 (generated from glibc-CP1257-2.1.2) test encoding-convertfrom-ucmCompare-cp1257 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1257 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A6 A6 00A7 A7 00A8 8D 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF 9D 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 8F 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00C4 C4 00C5 C5 00C6 AF 00C9 C9 00D3 D3 00D5 D5 00D6 D6 00D7 D7 00D8 A8 00DC DC 00DF DF 00E4 E4 00E5 E5 00E6 BF 00E9 E9 00F3 F3 00F5 F5 00F6 F6 00F7 F7 00F8 B8 00FC FC 0100 C2 0101 E2 0104 C0 0105 E0 0106 C3 0107 E3 010C C8 010D E8 0112 C7 0113 E7 0116 CB 0117 EB 0118 C6 0119 E6 0122 CC 0123 EC 012A CE 012B EE 012E C1 012F E1 0136 CD 0137 ED 013B CF 013C EF 0141 D9 0142 F9 0143 D1 0144 F1 0145 D2 0146 F2 014C D4 014D F4 0156 AA 0157 BA 015A DA 015B FA 0160 D0 0161 F0 016A DB 016B FB 0172 D8 0173 F8 0179 CA 017A EA 017B DD 017C FD 017D DE 017E FE 02C7 8E 02D9 FF 02DB 9E 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1257 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1257 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A6 A6 00A7 A7 00A8 8D 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF 9D 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 8F 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00C4 C4 00C5 C5 00C6 AF 00C9 C9 00D3 D3 00D5 D5 00D6 D6 00D7 D7 00D8 A8 00DC DC 00DF DF 00E4 E4 00E5 E5 00E6 BF 00E9 E9 00F3 F3 00F5 F5 00F6 F6 00F7 F7 00F8 B8 00FC FC 0100 C2 0101 E2 0104 C0 0105 E0 0106 C3 0107 E3 010C C8 010D E8 0112 C7 0113 E7 0116 CB 0117 EB 0118 C6 0119 E6 0122 CC 0123 EC 012A CE 012B EE 012E C1 012F E1 0136 CD 0137 ED 013B CF 013C EF 0141 D9 0142 F9 0143 D1 0144 F1 0145 D2 0146 F2 014C D4 014D F4 0156 AA 0157 BA 015A DA 015B FA 0160 D0 0161 F0 016A DB 016B FB 0172 D8 0173 F8 0179 CA 017A EA 017B DD 017C FD 017D DE 017E FE 02C7 8E 02D9 FF 02DB 9E 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AC 80 2122 99} } -result {} # cp1257 - invalid byte sequences lappend encInvalidBytes {*}{ cp1257 81 tcl8 \U00000081 -1 {} {} cp1257 81 replace \uFFFD -1 {} {} cp1257 81 strict {} 0 {} {} cp1257 83 tcl8 \U00000083 -1 {} {} cp1257 83 replace \uFFFD -1 {} {} cp1257 83 strict {} 0 {} {} cp1257 88 tcl8 \U00000088 -1 {} {} cp1257 88 replace \uFFFD -1 {} {} cp1257 88 strict {} 0 {} {} cp1257 8A tcl8 \U0000008A -1 {} {} cp1257 8A replace \uFFFD -1 {} {} cp1257 8A strict {} 0 {} {} cp1257 8C tcl8 \U0000008C -1 {} {} cp1257 8C replace \uFFFD -1 {} {} cp1257 8C strict {} 0 {} {} cp1257 90 tcl8 \U00000090 -1 {} {} cp1257 90 replace \uFFFD -1 {} {} cp1257 90 strict {} 0 {} {} cp1257 98 tcl8 \U00000098 -1 {} {} cp1257 98 replace \uFFFD -1 {} {} cp1257 98 strict {} 0 {} {} cp1257 9A tcl8 \U0000009A -1 {} {} cp1257 9A replace \uFFFD -1 {} {} cp1257 9A strict {} 0 {} {} cp1257 9C tcl8 \U0000009C -1 {} {} cp1257 9C replace \uFFFD -1 {} {} cp1257 9C strict {} 0 {} {} cp1257 9F tcl8 \U0000009F -1 {} {} cp1257 9F replace \uFFFD -1 {} {} cp1257 9F strict {} 0 {} {} cp1257 A1 tcl8 \U000000A1 -1 {} {} cp1257 A1 replace \uFFFD -1 {} {} cp1257 A1 strict {} 0 {} {} cp1257 A5 tcl8 \U000000A5 -1 {} {} cp1257 A5 replace \uFFFD -1 {} {} cp1257 A5 strict {} 0 {} {} }; # cp1257 # cp1257 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1257 \U00000080 tcl8 1A -1 {} {} cp1257 \U00000080 replace 1A -1 {} {} cp1257 \U00000080 strict {} 0 {} {} cp1257 \U00000400 tcl8 1A -1 {} {} cp1257 \U00000400 replace 1A -1 {} {} cp1257 \U00000400 strict {} 0 {} {} cp1257 \U0000D800 tcl8 1A -1 {} {} cp1257 \U0000D800 replace 1A -1 {} {} cp1257 \U0000D800 strict {} 0 {} {} cp1257 \U0000DC00 tcl8 1A -1 {} {} cp1257 \U0000DC00 replace 1A -1 {} {} cp1257 \U0000DC00 strict {} 0 {} {} cp1257 \U00010000 tcl8 1A -1 {} {} cp1257 \U00010000 replace 1A -1 {} {} cp1257 \U00010000 strict {} 0 {} {} cp1257 \U0010FFFF tcl8 1A -1 {} {} cp1257 \U0010FFFF replace 1A -1 {} {} cp1257 \U0010FFFF strict {} 0 {} {} }; # cp1257 # # cp1258 (generated from glibc-CP1258-2.1.2) test encoding-convertfrom-ucmCompare-cp1258 {Compare against ICU UCM} -body { ucmConvertfromMismatches cp1258 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CD CD 00CE CE 00CF CF 00D1 D1 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00ED ED 00EE EE 00EF EF 00F1 F1 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 0102 C3 0103 E3 0110 D0 0111 F0 0152 8C 0153 9C 0178 9F 0192 83 01A0 D5 01A1 F5 01AF DD 01B0 FD 02C6 88 02DC 98 0300 CC 0303 DE 0309 D2 0323 F2 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AB FE 20AC 80 2122 99} } -result {} test encoding-convertto-ucmCompare-cp1258 {Compare against ICU UCM} -body { ucmConverttoMismatches cp1258 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CD CD 00CE CE 00CF CF 00D1 D1 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00ED ED 00EE EE 00EF EF 00F1 F1 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 0102 C3 0103 E3 0110 D0 0111 F0 0152 8C 0153 9C 0178 9F 0192 83 01A0 D5 01A1 F5 01AF DD 01B0 FD 02C6 88 02DC 98 0300 CC 0303 DE 0309 D2 0323 F2 2013 96 2014 97 2018 91 2019 92 201A 82 201C 93 201D 94 201E 84 2020 86 2021 87 2022 95 2026 85 2030 89 2039 8B 203A 9B 20AB FE 20AC 80 2122 99} } -result {} # cp1258 - invalid byte sequences lappend encInvalidBytes {*}{ cp1258 81 tcl8 \U00000081 -1 {} {} cp1258 81 replace \uFFFD -1 {} {} cp1258 81 strict {} 0 {} {} cp1258 8A tcl8 \U0000008A -1 {} {} cp1258 8A replace \uFFFD -1 {} {} cp1258 8A strict {} 0 {} {} cp1258 8D tcl8 \U0000008D -1 {} {} cp1258 8D replace \uFFFD -1 {} {} cp1258 8D strict {} 0 {} {} cp1258 8E tcl8 \U0000008E -1 {} {} cp1258 8E replace \uFFFD -1 {} {} cp1258 8E strict {} 0 {} {} cp1258 8F tcl8 \U0000008F -1 {} {} cp1258 8F replace \uFFFD -1 {} {} cp1258 8F strict {} 0 {} {} cp1258 90 tcl8 \U00000090 -1 {} {} cp1258 90 replace \uFFFD -1 {} {} cp1258 90 strict {} 0 {} {} cp1258 9A tcl8 \U0000009A -1 {} {} cp1258 9A replace \uFFFD -1 {} {} cp1258 9A strict {} 0 {} {} cp1258 9D tcl8 \U0000009D -1 {} {} cp1258 9D replace \uFFFD -1 {} {} cp1258 9D strict {} 0 {} {} cp1258 9E tcl8 \U0000009E -1 {} {} cp1258 9E replace \uFFFD -1 {} {} cp1258 9E strict {} 0 {} {} cp1258 EC tcl8 \U000000EC -1 {} {} cp1258 EC replace \uFFFD -1 {} {} cp1258 EC strict {} 0 {} {} }; # cp1258 # cp1258 - invalid byte sequences lappend encUnencodableStrings {*}{ cp1258 \U00000080 tcl8 1A -1 {} {} cp1258 \U00000080 replace 1A -1 {} {} cp1258 \U00000080 strict {} 0 {} {} cp1258 \U00000400 tcl8 1A -1 {} {} cp1258 \U00000400 replace 1A -1 {} {} cp1258 \U00000400 strict {} 0 {} {} cp1258 \U0000D800 tcl8 1A -1 {} {} cp1258 \U0000D800 replace 1A -1 {} {} cp1258 \U0000D800 strict {} 0 {} {} cp1258 \U0000DC00 tcl8 1A -1 {} {} cp1258 \U0000DC00 replace 1A -1 {} {} cp1258 \U0000DC00 strict {} 0 {} {} cp1258 \U00010000 tcl8 1A -1 {} {} cp1258 \U00010000 replace 1A -1 {} {} cp1258 \U00010000 strict {} 0 {} {} cp1258 \U0010FFFF tcl8 1A -1 {} {} cp1258 \U0010FFFF replace 1A -1 {} {} cp1258 \U0010FFFF strict {} 0 {} {} }; # cp1258 # # gb1988 (generated from glibc-GB_1988_80-2.3.3) test encoding-convertfrom-ucmCompare-gb1988 {Compare against ICU UCM} -body { ucmConvertfromMismatches gb1988 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007F 7F 00A5 24 203E 7E} } -result {} test encoding-convertto-ucmCompare-gb1988 {Compare against ICU UCM} -body { ucmConverttoMismatches gb1988 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007F 7F 00A5 24 203E 7E} } -result {} # gb1988 - invalid byte sequences lappend encInvalidBytes {*}{ gb1988 80 tcl8 \U00000080 -1 {} {} gb1988 80 replace \uFFFD -1 {} {} gb1988 80 strict {} 0 {} {} gb1988 81 tcl8 \U00000081 -1 {} {} gb1988 81 replace \uFFFD -1 {} {} gb1988 81 strict {} 0 {} {} gb1988 82 tcl8 \U00000082 -1 {} {} gb1988 82 replace \uFFFD -1 {} {} gb1988 82 strict {} 0 {} {} gb1988 83 tcl8 \U00000083 -1 {} {} gb1988 83 replace \uFFFD -1 {} {} gb1988 83 strict {} 0 {} {} gb1988 84 tcl8 \U00000084 -1 {} {} gb1988 84 replace \uFFFD -1 {} {} gb1988 84 strict {} 0 {} {} gb1988 85 tcl8 \U00000085 -1 {} {} gb1988 85 replace \uFFFD -1 {} {} gb1988 85 strict {} 0 {} {} gb1988 86 tcl8 \U00000086 -1 {} {} gb1988 86 replace \uFFFD -1 {} {} gb1988 86 strict {} 0 {} {} gb1988 87 tcl8 \U00000087 -1 {} {} gb1988 87 replace \uFFFD -1 {} {} gb1988 87 strict {} 0 {} {} gb1988 88 tcl8 \U00000088 -1 {} {} gb1988 88 replace \uFFFD -1 {} {} gb1988 88 strict {} 0 {} {} gb1988 89 tcl8 \U00000089 -1 {} {} gb1988 89 replace \uFFFD -1 {} {} gb1988 89 strict {} 0 {} {} gb1988 8A tcl8 \U0000008A -1 {} {} gb1988 8A replace \uFFFD -1 {} {} gb1988 8A strict {} 0 {} {} gb1988 8B tcl8 \U0000008B -1 {} {} gb1988 8B replace \uFFFD -1 {} {} gb1988 8B strict {} 0 {} {} gb1988 8C tcl8 \U0000008C -1 {} {} gb1988 8C replace \uFFFD -1 {} {} gb1988 8C strict {} 0 {} {} gb1988 8D tcl8 \U0000008D -1 {} {} gb1988 8D replace \uFFFD -1 {} {} gb1988 8D strict {} 0 {} {} gb1988 8E tcl8 \U0000008E -1 {} {} gb1988 8E replace \uFFFD -1 {} {} gb1988 8E strict {} 0 {} {} gb1988 8F tcl8 \U0000008F -1 {} {} gb1988 8F replace \uFFFD -1 {} {} gb1988 8F strict {} 0 {} {} gb1988 90 tcl8 \U00000090 -1 {} {} gb1988 90 replace \uFFFD -1 {} {} gb1988 90 strict {} 0 {} {} gb1988 91 tcl8 \U00000091 -1 {} {} gb1988 91 replace \uFFFD -1 {} {} gb1988 91 strict {} 0 {} {} gb1988 92 tcl8 \U00000092 -1 {} {} gb1988 92 replace \uFFFD -1 {} {} gb1988 92 strict {} 0 {} {} gb1988 93 tcl8 \U00000093 -1 {} {} gb1988 93 replace \uFFFD -1 {} {} gb1988 93 strict {} 0 {} {} gb1988 94 tcl8 \U00000094 -1 {} {} gb1988 94 replace \uFFFD -1 {} {} gb1988 94 strict {} 0 {} {} gb1988 95 tcl8 \U00000095 -1 {} {} gb1988 95 replace \uFFFD -1 {} {} gb1988 95 strict {} 0 {} {} gb1988 96 tcl8 \U00000096 -1 {} {} gb1988 96 replace \uFFFD -1 {} {} gb1988 96 strict {} 0 {} {} gb1988 97 tcl8 \U00000097 -1 {} {} gb1988 97 replace \uFFFD -1 {} {} gb1988 97 strict {} 0 {} {} gb1988 98 tcl8 \U00000098 -1 {} {} gb1988 98 replace \uFFFD -1 {} {} gb1988 98 strict {} 0 {} {} gb1988 99 tcl8 \U00000099 -1 {} {} gb1988 99 replace \uFFFD -1 {} {} gb1988 99 strict {} 0 {} {} gb1988 9A tcl8 \U0000009A -1 {} {} gb1988 9A replace \uFFFD -1 {} {} gb1988 9A strict {} 0 {} {} gb1988 9B tcl8 \U0000009B -1 {} {} gb1988 9B replace \uFFFD -1 {} {} gb1988 9B strict {} 0 {} {} gb1988 9C tcl8 \U0000009C -1 {} {} gb1988 9C replace \uFFFD -1 {} {} gb1988 9C strict {} 0 {} {} gb1988 9D tcl8 \U0000009D -1 {} {} gb1988 9D replace \uFFFD -1 {} {} gb1988 9D strict {} 0 {} {} gb1988 9E tcl8 \U0000009E -1 {} {} gb1988 9E replace \uFFFD -1 {} {} gb1988 9E strict {} 0 {} {} gb1988 9F tcl8 \U0000009F -1 {} {} gb1988 9F replace \uFFFD -1 {} {} gb1988 9F strict {} 0 {} {} gb1988 A0 tcl8 \U000000A0 -1 {} {} gb1988 A0 replace \uFFFD -1 {} {} gb1988 A0 strict {} 0 {} {} gb1988 A1 tcl8 \U000000A1 -1 {} {} gb1988 A1 replace \uFFFD -1 {} {} gb1988 A1 strict {} 0 {} {} gb1988 A2 tcl8 \U000000A2 -1 {} {} gb1988 A2 replace \uFFFD -1 {} {} gb1988 A2 strict {} 0 {} {} gb1988 A3 tcl8 \U000000A3 -1 {} {} gb1988 A3 replace \uFFFD -1 {} {} gb1988 A3 strict {} 0 {} {} gb1988 A4 tcl8 \U000000A4 -1 {} {} gb1988 A4 replace \uFFFD -1 {} {} gb1988 A4 strict {} 0 {} {} gb1988 A5 tcl8 \U000000A5 -1 {} {} gb1988 A5 replace \uFFFD -1 {} {} gb1988 A5 strict {} 0 {} {} gb1988 A6 tcl8 \U000000A6 -1 {} {} gb1988 A6 replace \uFFFD -1 {} {} gb1988 A6 strict {} 0 {} {} gb1988 A7 tcl8 \U000000A7 -1 {} {} gb1988 A7 replace \uFFFD -1 {} {} gb1988 A7 strict {} 0 {} {} gb1988 A8 tcl8 \U000000A8 -1 {} {} gb1988 A8 replace \uFFFD -1 {} {} gb1988 A8 strict {} 0 {} {} gb1988 A9 tcl8 \U000000A9 -1 {} {} gb1988 A9 replace \uFFFD -1 {} {} gb1988 A9 strict {} 0 {} {} gb1988 AA tcl8 \U000000AA -1 {} {} gb1988 AA replace \uFFFD -1 {} {} gb1988 AA strict {} 0 {} {} gb1988 AB tcl8 \U000000AB -1 {} {} gb1988 AB replace \uFFFD -1 {} {} gb1988 AB strict {} 0 {} {} gb1988 AC tcl8 \U000000AC -1 {} {} gb1988 AC replace \uFFFD -1 {} {} gb1988 AC strict {} 0 {} {} gb1988 AD tcl8 \U000000AD -1 {} {} gb1988 AD replace \uFFFD -1 {} {} gb1988 AD strict {} 0 {} {} gb1988 AE tcl8 \U000000AE -1 {} {} gb1988 AE replace \uFFFD -1 {} {} gb1988 AE strict {} 0 {} {} gb1988 AF tcl8 \U000000AF -1 {} {} gb1988 AF replace \uFFFD -1 {} {} gb1988 AF strict {} 0 {} {} gb1988 B0 tcl8 \U000000B0 -1 {} {} gb1988 B0 replace \uFFFD -1 {} {} gb1988 B0 strict {} 0 {} {} gb1988 B1 tcl8 \U000000B1 -1 {} {} gb1988 B1 replace \uFFFD -1 {} {} gb1988 B1 strict {} 0 {} {} gb1988 B2 tcl8 \U000000B2 -1 {} {} gb1988 B2 replace \uFFFD -1 {} {} gb1988 B2 strict {} 0 {} {} gb1988 B3 tcl8 \U000000B3 -1 {} {} gb1988 B3 replace \uFFFD -1 {} {} gb1988 B3 strict {} 0 {} {} gb1988 B4 tcl8 \U000000B4 -1 {} {} gb1988 B4 replace \uFFFD -1 {} {} gb1988 B4 strict {} 0 {} {} gb1988 B5 tcl8 \U000000B5 -1 {} {} gb1988 B5 replace \uFFFD -1 {} {} gb1988 B5 strict {} 0 {} {} gb1988 B6 tcl8 \U000000B6 -1 {} {} gb1988 B6 replace \uFFFD -1 {} {} gb1988 B6 strict {} 0 {} {} gb1988 B7 tcl8 \U000000B7 -1 {} {} gb1988 B7 replace \uFFFD -1 {} {} gb1988 B7 strict {} 0 {} {} gb1988 B8 tcl8 \U000000B8 -1 {} {} gb1988 B8 replace \uFFFD -1 {} {} gb1988 B8 strict {} 0 {} {} gb1988 B9 tcl8 \U000000B9 -1 {} {} gb1988 B9 replace \uFFFD -1 {} {} gb1988 B9 strict {} 0 {} {} gb1988 BA tcl8 \U000000BA -1 {} {} gb1988 BA replace \uFFFD -1 {} {} gb1988 BA strict {} 0 {} {} gb1988 BB tcl8 \U000000BB -1 {} {} gb1988 BB replace \uFFFD -1 {} {} gb1988 BB strict {} 0 {} {} gb1988 BC tcl8 \U000000BC -1 {} {} gb1988 BC replace \uFFFD -1 {} {} gb1988 BC strict {} 0 {} {} gb1988 BD tcl8 \U000000BD -1 {} {} gb1988 BD replace \uFFFD -1 {} {} gb1988 BD strict {} 0 {} {} gb1988 BE tcl8 \U000000BE -1 {} {} gb1988 BE replace \uFFFD -1 {} {} gb1988 BE strict {} 0 {} {} gb1988 BF tcl8 \U000000BF -1 {} {} gb1988 BF replace \uFFFD -1 {} {} gb1988 BF strict {} 0 {} {} gb1988 C0 tcl8 \U000000C0 -1 {} {} gb1988 C0 replace \uFFFD -1 {} {} gb1988 C0 strict {} 0 {} {} gb1988 C1 tcl8 \U000000C1 -1 {} {} gb1988 C1 replace \uFFFD -1 {} {} gb1988 C1 strict {} 0 {} {} gb1988 C2 tcl8 \U000000C2 -1 {} {} gb1988 C2 replace \uFFFD -1 {} {} gb1988 C2 strict {} 0 {} {} gb1988 C3 tcl8 \U000000C3 -1 {} {} gb1988 C3 replace \uFFFD -1 {} {} gb1988 C3 strict {} 0 {} {} gb1988 C4 tcl8 \U000000C4 -1 {} {} gb1988 C4 replace \uFFFD -1 {} {} gb1988 C4 strict {} 0 {} {} gb1988 C5 tcl8 \U000000C5 -1 {} {} gb1988 C5 replace \uFFFD -1 {} {} gb1988 C5 strict {} 0 {} {} gb1988 C6 tcl8 \U000000C6 -1 {} {} gb1988 C6 replace \uFFFD -1 {} {} gb1988 C6 strict {} 0 {} {} gb1988 C7 tcl8 \U000000C7 -1 {} {} gb1988 C7 replace \uFFFD -1 {} {} gb1988 C7 strict {} 0 {} {} gb1988 C8 tcl8 \U000000C8 -1 {} {} gb1988 C8 replace \uFFFD -1 {} {} gb1988 C8 strict {} 0 {} {} gb1988 C9 tcl8 \U000000C9 -1 {} {} gb1988 C9 replace \uFFFD -1 {} {} gb1988 C9 strict {} 0 {} {} gb1988 CA tcl8 \U000000CA -1 {} {} gb1988 CA replace \uFFFD -1 {} {} gb1988 CA strict {} 0 {} {} gb1988 CB tcl8 \U000000CB -1 {} {} gb1988 CB replace \uFFFD -1 {} {} gb1988 CB strict {} 0 {} {} gb1988 CC tcl8 \U000000CC -1 {} {} gb1988 CC replace \uFFFD -1 {} {} gb1988 CC strict {} 0 {} {} gb1988 CD tcl8 \U000000CD -1 {} {} gb1988 CD replace \uFFFD -1 {} {} gb1988 CD strict {} 0 {} {} gb1988 CE tcl8 \U000000CE -1 {} {} gb1988 CE replace \uFFFD -1 {} {} gb1988 CE strict {} 0 {} {} gb1988 CF tcl8 \U000000CF -1 {} {} gb1988 CF replace \uFFFD -1 {} {} gb1988 CF strict {} 0 {} {} gb1988 D0 tcl8 \U000000D0 -1 {} {} gb1988 D0 replace \uFFFD -1 {} {} gb1988 D0 strict {} 0 {} {} gb1988 D1 tcl8 \U000000D1 -1 {} {} gb1988 D1 replace \uFFFD -1 {} {} gb1988 D1 strict {} 0 {} {} gb1988 D2 tcl8 \U000000D2 -1 {} {} gb1988 D2 replace \uFFFD -1 {} {} gb1988 D2 strict {} 0 {} {} gb1988 D3 tcl8 \U000000D3 -1 {} {} gb1988 D3 replace \uFFFD -1 {} {} gb1988 D3 strict {} 0 {} {} gb1988 D4 tcl8 \U000000D4 -1 {} {} gb1988 D4 replace \uFFFD -1 {} {} gb1988 D4 strict {} 0 {} {} gb1988 D5 tcl8 \U000000D5 -1 {} {} gb1988 D5 replace \uFFFD -1 {} {} gb1988 D5 strict {} 0 {} {} gb1988 D6 tcl8 \U000000D6 -1 {} {} gb1988 D6 replace \uFFFD -1 {} {} gb1988 D6 strict {} 0 {} {} gb1988 D7 tcl8 \U000000D7 -1 {} {} gb1988 D7 replace \uFFFD -1 {} {} gb1988 D7 strict {} 0 {} {} gb1988 D8 tcl8 \U000000D8 -1 {} {} gb1988 D8 replace \uFFFD -1 {} {} gb1988 D8 strict {} 0 {} {} gb1988 D9 tcl8 \U000000D9 -1 {} {} gb1988 D9 replace \uFFFD -1 {} {} gb1988 D9 strict {} 0 {} {} gb1988 DA tcl8 \U000000DA -1 {} {} gb1988 DA replace \uFFFD -1 {} {} gb1988 DA strict {} 0 {} {} gb1988 DB tcl8 \U000000DB -1 {} {} gb1988 DB replace \uFFFD -1 {} {} gb1988 DB strict {} 0 {} {} gb1988 DC tcl8 \U000000DC -1 {} {} gb1988 DC replace \uFFFD -1 {} {} gb1988 DC strict {} 0 {} {} gb1988 DD tcl8 \U000000DD -1 {} {} gb1988 DD replace \uFFFD -1 {} {} gb1988 DD strict {} 0 {} {} gb1988 DE tcl8 \U000000DE -1 {} {} gb1988 DE replace \uFFFD -1 {} {} gb1988 DE strict {} 0 {} {} gb1988 DF tcl8 \U000000DF -1 {} {} gb1988 DF replace \uFFFD -1 {} {} gb1988 DF strict {} 0 {} {} gb1988 E0 tcl8 \U000000E0 -1 {} {} gb1988 E0 replace \uFFFD -1 {} {} gb1988 E0 strict {} 0 {} {} gb1988 E1 tcl8 \U000000E1 -1 {} {} gb1988 E1 replace \uFFFD -1 {} {} gb1988 E1 strict {} 0 {} {} gb1988 E2 tcl8 \U000000E2 -1 {} {} gb1988 E2 replace \uFFFD -1 {} {} gb1988 E2 strict {} 0 {} {} gb1988 E3 tcl8 \U000000E3 -1 {} {} gb1988 E3 replace \uFFFD -1 {} {} gb1988 E3 strict {} 0 {} {} gb1988 E4 tcl8 \U000000E4 -1 {} {} gb1988 E4 replace \uFFFD -1 {} {} gb1988 E4 strict {} 0 {} {} gb1988 E5 tcl8 \U000000E5 -1 {} {} gb1988 E5 replace \uFFFD -1 {} {} gb1988 E5 strict {} 0 {} {} gb1988 E6 tcl8 \U000000E6 -1 {} {} gb1988 E6 replace \uFFFD -1 {} {} gb1988 E6 strict {} 0 {} {} gb1988 E7 tcl8 \U000000E7 -1 {} {} gb1988 E7 replace \uFFFD -1 {} {} gb1988 E7 strict {} 0 {} {} gb1988 E8 tcl8 \U000000E8 -1 {} {} gb1988 E8 replace \uFFFD -1 {} {} gb1988 E8 strict {} 0 {} {} gb1988 E9 tcl8 \U000000E9 -1 {} {} gb1988 E9 replace \uFFFD -1 {} {} gb1988 E9 strict {} 0 {} {} gb1988 EA tcl8 \U000000EA -1 {} {} gb1988 EA replace \uFFFD -1 {} {} gb1988 EA strict {} 0 {} {} gb1988 EB tcl8 \U000000EB -1 {} {} gb1988 EB replace \uFFFD -1 {} {} gb1988 EB strict {} 0 {} {} gb1988 EC tcl8 \U000000EC -1 {} {} gb1988 EC replace \uFFFD -1 {} {} gb1988 EC strict {} 0 {} {} gb1988 ED tcl8 \U000000ED -1 {} {} gb1988 ED replace \uFFFD -1 {} {} gb1988 ED strict {} 0 {} {} gb1988 EE tcl8 \U000000EE -1 {} {} gb1988 EE replace \uFFFD -1 {} {} gb1988 EE strict {} 0 {} {} gb1988 EF tcl8 \U000000EF -1 {} {} gb1988 EF replace \uFFFD -1 {} {} gb1988 EF strict {} 0 {} {} gb1988 F0 tcl8 \U000000F0 -1 {} {} gb1988 F0 replace \uFFFD -1 {} {} gb1988 F0 strict {} 0 {} {} gb1988 F1 tcl8 \U000000F1 -1 {} {} gb1988 F1 replace \uFFFD -1 {} {} gb1988 F1 strict {} 0 {} {} gb1988 F2 tcl8 \U000000F2 -1 {} {} gb1988 F2 replace \uFFFD -1 {} {} gb1988 F2 strict {} 0 {} {} gb1988 F3 tcl8 \U000000F3 -1 {} {} gb1988 F3 replace \uFFFD -1 {} {} gb1988 F3 strict {} 0 {} {} gb1988 F4 tcl8 \U000000F4 -1 {} {} gb1988 F4 replace \uFFFD -1 {} {} gb1988 F4 strict {} 0 {} {} gb1988 F5 tcl8 \U000000F5 -1 {} {} gb1988 F5 replace \uFFFD -1 {} {} gb1988 F5 strict {} 0 {} {} gb1988 F6 tcl8 \U000000F6 -1 {} {} gb1988 F6 replace \uFFFD -1 {} {} gb1988 F6 strict {} 0 {} {} gb1988 F7 tcl8 \U000000F7 -1 {} {} gb1988 F7 replace \uFFFD -1 {} {} gb1988 F7 strict {} 0 {} {} gb1988 F8 tcl8 \U000000F8 -1 {} {} gb1988 F8 replace \uFFFD -1 {} {} gb1988 F8 strict {} 0 {} {} gb1988 F9 tcl8 \U000000F9 -1 {} {} gb1988 F9 replace \uFFFD -1 {} {} gb1988 F9 strict {} 0 {} {} gb1988 FA tcl8 \U000000FA -1 {} {} gb1988 FA replace \uFFFD -1 {} {} gb1988 FA strict {} 0 {} {} gb1988 FB tcl8 \U000000FB -1 {} {} gb1988 FB replace \uFFFD -1 {} {} gb1988 FB strict {} 0 {} {} gb1988 FC tcl8 \U000000FC -1 {} {} gb1988 FC replace \uFFFD -1 {} {} gb1988 FC strict {} 0 {} {} gb1988 FD tcl8 \U000000FD -1 {} {} gb1988 FD replace \uFFFD -1 {} {} gb1988 FD strict {} 0 {} {} gb1988 FE tcl8 \U000000FE -1 {} {} gb1988 FE replace \uFFFD -1 {} {} gb1988 FE strict {} 0 {} {} gb1988 FF tcl8 \U000000FF -1 {} {} gb1988 FF replace \uFFFD -1 {} {} gb1988 FF strict {} 0 {} {} }; # gb1988 # gb1988 - invalid byte sequences lappend encUnencodableStrings {*}{ gb1988 \U00000024 tcl8 1A -1 {} {} gb1988 \U00000024 replace 1A -1 {} {} gb1988 \U00000024 strict {} 0 {} {} gb1988 \U00000400 tcl8 1A -1 {} {} gb1988 \U00000400 replace 1A -1 {} {} gb1988 \U00000400 strict {} 0 {} {} gb1988 \U0000D800 tcl8 1A -1 {} {} gb1988 \U0000D800 replace 1A -1 {} {} gb1988 \U0000D800 strict {} 0 {} {} gb1988 \U0000DC00 tcl8 1A -1 {} {} gb1988 \U0000DC00 replace 1A -1 {} {} gb1988 \U0000DC00 strict {} 0 {} {} gb1988 \U00010000 tcl8 1A -1 {} {} gb1988 \U00010000 replace 1A -1 {} {} gb1988 \U00010000 strict {} 0 {} {} gb1988 \U0010FFFF tcl8 1A -1 {} {} gb1988 \U0010FFFF replace 1A -1 {} {} gb1988 \U0010FFFF strict {} 0 {} {} }; # gb1988 # # iso8859-1 (generated from glibc-ISO_8859_1-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-1 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-1 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF} } -result {} test encoding-convertto-ucmCompare-iso8859-1 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-1 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF} } -result {} # iso8859-1 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-1 # iso8859-1 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-1 \U00000400 tcl8 1A -1 {} {} iso8859-1 \U00000400 replace 1A -1 {} {} iso8859-1 \U00000400 strict {} 0 {} {} iso8859-1 \U0000D800 tcl8 1A -1 {} {} iso8859-1 \U0000D800 replace 1A -1 {} {} iso8859-1 \U0000D800 strict {} 0 {} {} iso8859-1 \U0000DC00 tcl8 1A -1 {} {} iso8859-1 \U0000DC00 replace 1A -1 {} {} iso8859-1 \U0000DC00 strict {} 0 {} {} iso8859-1 \U00010000 tcl8 1A -1 {} {} iso8859-1 \U00010000 replace 1A -1 {} {} iso8859-1 \U00010000 strict {} 0 {} {} iso8859-1 \U0010FFFF tcl8 1A -1 {} {} iso8859-1 \U0010FFFF replace 1A -1 {} {} iso8859-1 \U0010FFFF strict {} 0 {} {} }; # iso8859-1 # # iso8859-2 (generated from glibc-ISO_8859_2-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-2 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-2 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00A7 A7 00A8 A8 00AD AD 00B0 B0 00B4 B4 00B8 B8 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C9 C9 00CB CB 00CD CD 00CE CE 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00DA DA 00DC DC 00DD DD 00DF DF 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E9 E9 00EB EB 00ED ED 00EE EE 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00FA FA 00FC FC 00FD FD 0102 C3 0103 E3 0104 A1 0105 B1 0106 C6 0107 E6 010C C8 010D E8 010E CF 010F EF 0110 D0 0111 F0 0118 CA 0119 EA 011A CC 011B EC 0139 C5 013A E5 013D A5 013E B5 0141 A3 0142 B3 0143 D1 0144 F1 0147 D2 0148 F2 0150 D5 0151 F5 0154 C0 0155 E0 0158 D8 0159 F8 015A A6 015B B6 015E AA 015F BA 0160 A9 0161 B9 0162 DE 0163 FE 0164 AB 0165 BB 016E D9 016F F9 0170 DB 0171 FB 0179 AC 017A BC 017B AF 017C BF 017D AE 017E BE 02C7 B7 02D8 A2 02D9 FF 02DB B2 02DD BD} } -result {} test encoding-convertto-ucmCompare-iso8859-2 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-2 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00A7 A7 00A8 A8 00AD AD 00B0 B0 00B4 B4 00B8 B8 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C9 C9 00CB CB 00CD CD 00CE CE 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00DA DA 00DC DC 00DD DD 00DF DF 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E9 E9 00EB EB 00ED ED 00EE EE 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00FA FA 00FC FC 00FD FD 0102 C3 0103 E3 0104 A1 0105 B1 0106 C6 0107 E6 010C C8 010D E8 010E CF 010F EF 0110 D0 0111 F0 0118 CA 0119 EA 011A CC 011B EC 0139 C5 013A E5 013D A5 013E B5 0141 A3 0142 B3 0143 D1 0144 F1 0147 D2 0148 F2 0150 D5 0151 F5 0154 C0 0155 E0 0158 D8 0159 F8 015A A6 015B B6 015E AA 015F BA 0160 A9 0161 B9 0162 DE 0163 FE 0164 AB 0165 BB 016E D9 016F F9 0170 DB 0171 FB 0179 AC 017A BC 017B AF 017C BF 017D AE 017E BE 02C7 B7 02D8 A2 02D9 FF 02DB B2 02DD BD} } -result {} # iso8859-2 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-2 # iso8859-2 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-2 \U000000A1 tcl8 1A -1 {} {} iso8859-2 \U000000A1 replace 1A -1 {} {} iso8859-2 \U000000A1 strict {} 0 {} {} iso8859-2 \U00000400 tcl8 1A -1 {} {} iso8859-2 \U00000400 replace 1A -1 {} {} iso8859-2 \U00000400 strict {} 0 {} {} iso8859-2 \U0000D800 tcl8 1A -1 {} {} iso8859-2 \U0000D800 replace 1A -1 {} {} iso8859-2 \U0000D800 strict {} 0 {} {} iso8859-2 \U0000DC00 tcl8 1A -1 {} {} iso8859-2 \U0000DC00 replace 1A -1 {} {} iso8859-2 \U0000DC00 strict {} 0 {} {} iso8859-2 \U00010000 tcl8 1A -1 {} {} iso8859-2 \U00010000 replace 1A -1 {} {} iso8859-2 \U00010000 strict {} 0 {} {} iso8859-2 \U0010FFFF tcl8 1A -1 {} {} iso8859-2 \U0010FFFF replace 1A -1 {} {} iso8859-2 \U0010FFFF strict {} 0 {} {} }; # iso8859-2 # # iso8859-3 (generated from glibc-ISO_8859_3-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-3 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-3 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A4 A4 00A7 A7 00A8 A8 00AD AD 00B0 B0 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B7 B7 00B8 B8 00BD BD 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00F9 F9 00FA FA 00FB FB 00FC FC 0108 C6 0109 E6 010A C5 010B E5 011C D8 011D F8 011E AB 011F BB 0120 D5 0121 F5 0124 A6 0125 B6 0126 A1 0127 B1 0130 A9 0131 B9 0134 AC 0135 BC 015C DE 015D FE 015E AA 015F BA 016C DD 016D FD 017B AF 017C BF 02D8 A2 02D9 FF} } -result {} test encoding-convertto-ucmCompare-iso8859-3 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-3 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A4 A4 00A7 A7 00A8 A8 00AD AD 00B0 B0 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B7 B7 00B8 B8 00BD BD 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D6 D6 00D7 D7 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F6 F6 00F7 F7 00F9 F9 00FA FA 00FB FB 00FC FC 0108 C6 0109 E6 010A C5 010B E5 011C D8 011D F8 011E AB 011F BB 0120 D5 0121 F5 0124 A6 0125 B6 0126 A1 0127 B1 0130 A9 0131 B9 0134 AC 0135 BC 015C DE 015D FE 015E AA 015F BA 016C DD 016D FD 017B AF 017C BF 02D8 A2 02D9 FF} } -result {} # iso8859-3 - invalid byte sequences lappend encInvalidBytes {*}{ iso8859-3 A5 tcl8 \U000000A5 -1 {} {} iso8859-3 A5 replace \uFFFD -1 {} {} iso8859-3 A5 strict {} 0 {} {} iso8859-3 AE tcl8 \U000000AE -1 {} {} iso8859-3 AE replace \uFFFD -1 {} {} iso8859-3 AE strict {} 0 {} {} iso8859-3 BE tcl8 \U000000BE -1 {} {} iso8859-3 BE replace \uFFFD -1 {} {} iso8859-3 BE strict {} 0 {} {} iso8859-3 C3 tcl8 \U000000C3 -1 {} {} iso8859-3 C3 replace \uFFFD -1 {} {} iso8859-3 C3 strict {} 0 {} {} iso8859-3 D0 tcl8 \U000000D0 -1 {} {} iso8859-3 D0 replace \uFFFD -1 {} {} iso8859-3 D0 strict {} 0 {} {} iso8859-3 E3 tcl8 \U000000E3 -1 {} {} iso8859-3 E3 replace \uFFFD -1 {} {} iso8859-3 E3 strict {} 0 {} {} iso8859-3 F0 tcl8 \U000000F0 -1 {} {} iso8859-3 F0 replace \uFFFD -1 {} {} iso8859-3 F0 strict {} 0 {} {} }; # iso8859-3 # iso8859-3 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-3 \U000000A1 tcl8 1A -1 {} {} iso8859-3 \U000000A1 replace 1A -1 {} {} iso8859-3 \U000000A1 strict {} 0 {} {} iso8859-3 \U00000400 tcl8 1A -1 {} {} iso8859-3 \U00000400 replace 1A -1 {} {} iso8859-3 \U00000400 strict {} 0 {} {} iso8859-3 \U0000D800 tcl8 1A -1 {} {} iso8859-3 \U0000D800 replace 1A -1 {} {} iso8859-3 \U0000D800 strict {} 0 {} {} iso8859-3 \U0000DC00 tcl8 1A -1 {} {} iso8859-3 \U0000DC00 replace 1A -1 {} {} iso8859-3 \U0000DC00 strict {} 0 {} {} iso8859-3 \U00010000 tcl8 1A -1 {} {} iso8859-3 \U00010000 replace 1A -1 {} {} iso8859-3 \U00010000 strict {} 0 {} {} iso8859-3 \U0010FFFF tcl8 1A -1 {} {} iso8859-3 \U0010FFFF replace 1A -1 {} {} iso8859-3 \U0010FFFF strict {} 0 {} {} }; # iso8859-3 # # iso8859-4 (generated from glibc-ISO_8859_4-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-4 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-4 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00A7 A7 00A8 A8 00AD AD 00AF AF 00B0 B0 00B4 B4 00B8 B8 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C9 C9 00CB CB 00CD CD 00CE CE 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00DA DA 00DB DB 00DC DC 00DF DF 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E9 E9 00EB EB 00ED ED 00EE EE 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00FA FA 00FB FB 00FC FC 0100 C0 0101 E0 0104 A1 0105 B1 010C C8 010D E8 0110 D0 0111 F0 0112 AA 0113 BA 0116 CC 0117 EC 0118 CA 0119 EA 0122 AB 0123 BB 0128 A5 0129 B5 012A CF 012B EF 012E C7 012F E7 0136 D3 0137 F3 0138 A2 013B A6 013C B6 0145 D1 0146 F1 014A BD 014B BF 014C D2 014D F2 0156 A3 0157 B3 0160 A9 0161 B9 0166 AC 0167 BC 0168 DD 0169 FD 016A DE 016B FE 0172 D9 0173 F9 017D AE 017E BE 02C7 B7 02D9 FF 02DB B2} } -result {} test encoding-convertto-ucmCompare-iso8859-4 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-4 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00A7 A7 00A8 A8 00AD AD 00AF AF 00B0 B0 00B4 B4 00B8 B8 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C9 C9 00CB CB 00CD CD 00CE CE 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00DA DA 00DB DB 00DC DC 00DF DF 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E9 E9 00EB EB 00ED ED 00EE EE 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00FA FA 00FB FB 00FC FC 0100 C0 0101 E0 0104 A1 0105 B1 010C C8 010D E8 0110 D0 0111 F0 0112 AA 0113 BA 0116 CC 0117 EC 0118 CA 0119 EA 0122 AB 0123 BB 0128 A5 0129 B5 012A CF 012B EF 012E C7 012F E7 0136 D3 0137 F3 0138 A2 013B A6 013C B6 0145 D1 0146 F1 014A BD 014B BF 014C D2 014D F2 0156 A3 0157 B3 0160 A9 0161 B9 0166 AC 0167 BC 0168 DD 0169 FD 016A DE 016B FE 0172 D9 0173 F9 017D AE 017E BE 02C7 B7 02D9 FF 02DB B2} } -result {} # iso8859-4 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-4 # iso8859-4 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-4 \U000000A1 tcl8 1A -1 {} {} iso8859-4 \U000000A1 replace 1A -1 {} {} iso8859-4 \U000000A1 strict {} 0 {} {} iso8859-4 \U00000400 tcl8 1A -1 {} {} iso8859-4 \U00000400 replace 1A -1 {} {} iso8859-4 \U00000400 strict {} 0 {} {} iso8859-4 \U0000D800 tcl8 1A -1 {} {} iso8859-4 \U0000D800 replace 1A -1 {} {} iso8859-4 \U0000D800 strict {} 0 {} {} iso8859-4 \U0000DC00 tcl8 1A -1 {} {} iso8859-4 \U0000DC00 replace 1A -1 {} {} iso8859-4 \U0000DC00 strict {} 0 {} {} iso8859-4 \U00010000 tcl8 1A -1 {} {} iso8859-4 \U00010000 replace 1A -1 {} {} iso8859-4 \U00010000 strict {} 0 {} {} iso8859-4 \U0010FFFF tcl8 1A -1 {} {} iso8859-4 \U0010FFFF replace 1A -1 {} {} iso8859-4 \U0010FFFF strict {} 0 {} {} }; # iso8859-4 # # iso8859-5 (generated from glibc-ISO_8859_5-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-5 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-5 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 FD 00AD AD 0401 A1 0402 A2 0403 A3 0404 A4 0405 A5 0406 A6 0407 A7 0408 A8 0409 A9 040A AA 040B AB 040C AC 040E AE 040F AF 0410 B0 0411 B1 0412 B2 0413 B3 0414 B4 0415 B5 0416 B6 0417 B7 0418 B8 0419 B9 041A BA 041B BB 041C BC 041D BD 041E BE 041F BF 0420 C0 0421 C1 0422 C2 0423 C3 0424 C4 0425 C5 0426 C6 0427 C7 0428 C8 0429 C9 042A CA 042B CB 042C CC 042D CD 042E CE 042F CF 0430 D0 0431 D1 0432 D2 0433 D3 0434 D4 0435 D5 0436 D6 0437 D7 0438 D8 0439 D9 043A DA 043B DB 043C DC 043D DD 043E DE 043F DF 0440 E0 0441 E1 0442 E2 0443 E3 0444 E4 0445 E5 0446 E6 0447 E7 0448 E8 0449 E9 044A EA 044B EB 044C EC 044D ED 044E EE 044F EF 0451 F1 0452 F2 0453 F3 0454 F4 0455 F5 0456 F6 0457 F7 0458 F8 0459 F9 045A FA 045B FB 045C FC 045E FE 045F FF 2116 F0} } -result {} test encoding-convertto-ucmCompare-iso8859-5 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-5 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 FD 00AD AD 0401 A1 0402 A2 0403 A3 0404 A4 0405 A5 0406 A6 0407 A7 0408 A8 0409 A9 040A AA 040B AB 040C AC 040E AE 040F AF 0410 B0 0411 B1 0412 B2 0413 B3 0414 B4 0415 B5 0416 B6 0417 B7 0418 B8 0419 B9 041A BA 041B BB 041C BC 041D BD 041E BE 041F BF 0420 C0 0421 C1 0422 C2 0423 C3 0424 C4 0425 C5 0426 C6 0427 C7 0428 C8 0429 C9 042A CA 042B CB 042C CC 042D CD 042E CE 042F CF 0430 D0 0431 D1 0432 D2 0433 D3 0434 D4 0435 D5 0436 D6 0437 D7 0438 D8 0439 D9 043A DA 043B DB 043C DC 043D DD 043E DE 043F DF 0440 E0 0441 E1 0442 E2 0443 E3 0444 E4 0445 E5 0446 E6 0447 E7 0448 E8 0449 E9 044A EA 044B EB 044C EC 044D ED 044E EE 044F EF 0451 F1 0452 F2 0453 F3 0454 F4 0455 F5 0456 F6 0457 F7 0458 F8 0459 F9 045A FA 045B FB 045C FC 045E FE 045F FF 2116 F0} } -result {} # iso8859-5 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-5 # iso8859-5 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-5 \U000000A1 tcl8 1A -1 {} {} iso8859-5 \U000000A1 replace 1A -1 {} {} iso8859-5 \U000000A1 strict {} 0 {} {} iso8859-5 \U00000400 tcl8 1A -1 {} {} iso8859-5 \U00000400 replace 1A -1 {} {} iso8859-5 \U00000400 strict {} 0 {} {} iso8859-5 \U0000D800 tcl8 1A -1 {} {} iso8859-5 \U0000D800 replace 1A -1 {} {} iso8859-5 \U0000D800 strict {} 0 {} {} iso8859-5 \U0000DC00 tcl8 1A -1 {} {} iso8859-5 \U0000DC00 replace 1A -1 {} {} iso8859-5 \U0000DC00 strict {} 0 {} {} iso8859-5 \U00010000 tcl8 1A -1 {} {} iso8859-5 \U00010000 replace 1A -1 {} {} iso8859-5 \U00010000 strict {} 0 {} {} iso8859-5 \U0010FFFF tcl8 1A -1 {} {} iso8859-5 \U0010FFFF replace 1A -1 {} {} iso8859-5 \U0010FFFF strict {} 0 {} {} }; # iso8859-5 # # iso8859-6 (generated from glibc-ISO_8859_6-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-6 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-6 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00AD AD 060C AC 061B BB 061F BF 0621 C1 0622 C2 0623 C3 0624 C4 0625 C5 0626 C6 0627 C7 0628 C8 0629 C9 062A CA 062B CB 062C CC 062D CD 062E CE 062F CF 0630 D0 0631 D1 0632 D2 0633 D3 0634 D4 0635 D5 0636 D6 0637 D7 0638 D8 0639 D9 063A DA 0640 E0 0641 E1 0642 E2 0643 E3 0644 E4 0645 E5 0646 E6 0647 E7 0648 E8 0649 E9 064A EA 064B EB 064C EC 064D ED 064E EE 064F EF 0650 F0 0651 F1 0652 F2} } -result {} test encoding-convertto-ucmCompare-iso8859-6 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-6 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A4 A4 00AD AD 060C AC 061B BB 061F BF 0621 C1 0622 C2 0623 C3 0624 C4 0625 C5 0626 C6 0627 C7 0628 C8 0629 C9 062A CA 062B CB 062C CC 062D CD 062E CE 062F CF 0630 D0 0631 D1 0632 D2 0633 D3 0634 D4 0635 D5 0636 D6 0637 D7 0638 D8 0639 D9 063A DA 0640 E0 0641 E1 0642 E2 0643 E3 0644 E4 0645 E5 0646 E6 0647 E7 0648 E8 0649 E9 064A EA 064B EB 064C EC 064D ED 064E EE 064F EF 0650 F0 0651 F1 0652 F2} } -result {} # iso8859-6 - invalid byte sequences lappend encInvalidBytes {*}{ iso8859-6 A1 tcl8 \U000000A1 -1 {} {} iso8859-6 A1 replace \uFFFD -1 {} {} iso8859-6 A1 strict {} 0 {} {} iso8859-6 A2 tcl8 \U000000A2 -1 {} {} iso8859-6 A2 replace \uFFFD -1 {} {} iso8859-6 A2 strict {} 0 {} {} iso8859-6 A3 tcl8 \U000000A3 -1 {} {} iso8859-6 A3 replace \uFFFD -1 {} {} iso8859-6 A3 strict {} 0 {} {} iso8859-6 A5 tcl8 \U000000A5 -1 {} {} iso8859-6 A5 replace \uFFFD -1 {} {} iso8859-6 A5 strict {} 0 {} {} iso8859-6 A6 tcl8 \U000000A6 -1 {} {} iso8859-6 A6 replace \uFFFD -1 {} {} iso8859-6 A6 strict {} 0 {} {} iso8859-6 A7 tcl8 \U000000A7 -1 {} {} iso8859-6 A7 replace \uFFFD -1 {} {} iso8859-6 A7 strict {} 0 {} {} iso8859-6 A8 tcl8 \U000000A8 -1 {} {} iso8859-6 A8 replace \uFFFD -1 {} {} iso8859-6 A8 strict {} 0 {} {} iso8859-6 A9 tcl8 \U000000A9 -1 {} {} iso8859-6 A9 replace \uFFFD -1 {} {} iso8859-6 A9 strict {} 0 {} {} iso8859-6 AA tcl8 \U000000AA -1 {} {} iso8859-6 AA replace \uFFFD -1 {} {} iso8859-6 AA strict {} 0 {} {} iso8859-6 AB tcl8 \U000000AB -1 {} {} iso8859-6 AB replace \uFFFD -1 {} {} iso8859-6 AB strict {} 0 {} {} iso8859-6 AE tcl8 \U000000AE -1 {} {} iso8859-6 AE replace \uFFFD -1 {} {} iso8859-6 AE strict {} 0 {} {} iso8859-6 AF tcl8 \U000000AF -1 {} {} iso8859-6 AF replace \uFFFD -1 {} {} iso8859-6 AF strict {} 0 {} {} iso8859-6 B0 tcl8 \U000000B0 -1 {} {} iso8859-6 B0 replace \uFFFD -1 {} {} iso8859-6 B0 strict {} 0 {} {} iso8859-6 B1 tcl8 \U000000B1 -1 {} {} iso8859-6 B1 replace \uFFFD -1 {} {} iso8859-6 B1 strict {} 0 {} {} iso8859-6 B2 tcl8 \U000000B2 -1 {} {} iso8859-6 B2 replace \uFFFD -1 {} {} iso8859-6 B2 strict {} 0 {} {} iso8859-6 B3 tcl8 \U000000B3 -1 {} {} iso8859-6 B3 replace \uFFFD -1 {} {} iso8859-6 B3 strict {} 0 {} {} iso8859-6 B4 tcl8 \U000000B4 -1 {} {} iso8859-6 B4 replace \uFFFD -1 {} {} iso8859-6 B4 strict {} 0 {} {} iso8859-6 B5 tcl8 \U000000B5 -1 {} {} iso8859-6 B5 replace \uFFFD -1 {} {} iso8859-6 B5 strict {} 0 {} {} iso8859-6 B6 tcl8 \U000000B6 -1 {} {} iso8859-6 B6 replace \uFFFD -1 {} {} iso8859-6 B6 strict {} 0 {} {} iso8859-6 B7 tcl8 \U000000B7 -1 {} {} iso8859-6 B7 replace \uFFFD -1 {} {} iso8859-6 B7 strict {} 0 {} {} iso8859-6 B8 tcl8 \U000000B8 -1 {} {} iso8859-6 B8 replace \uFFFD -1 {} {} iso8859-6 B8 strict {} 0 {} {} iso8859-6 B9 tcl8 \U000000B9 -1 {} {} iso8859-6 B9 replace \uFFFD -1 {} {} iso8859-6 B9 strict {} 0 {} {} iso8859-6 BA tcl8 \U000000BA -1 {} {} iso8859-6 BA replace \uFFFD -1 {} {} iso8859-6 BA strict {} 0 {} {} iso8859-6 BC tcl8 \U000000BC -1 {} {} iso8859-6 BC replace \uFFFD -1 {} {} iso8859-6 BC strict {} 0 {} {} iso8859-6 BD tcl8 \U000000BD -1 {} {} iso8859-6 BD replace \uFFFD -1 {} {} iso8859-6 BD strict {} 0 {} {} iso8859-6 BE tcl8 \U000000BE -1 {} {} iso8859-6 BE replace \uFFFD -1 {} {} iso8859-6 BE strict {} 0 {} {} iso8859-6 C0 tcl8 \U000000C0 -1 {} {} iso8859-6 C0 replace \uFFFD -1 {} {} iso8859-6 C0 strict {} 0 {} {} iso8859-6 DB tcl8 \U000000DB -1 {} {} iso8859-6 DB replace \uFFFD -1 {} {} iso8859-6 DB strict {} 0 {} {} iso8859-6 DC tcl8 \U000000DC -1 {} {} iso8859-6 DC replace \uFFFD -1 {} {} iso8859-6 DC strict {} 0 {} {} iso8859-6 DD tcl8 \U000000DD -1 {} {} iso8859-6 DD replace \uFFFD -1 {} {} iso8859-6 DD strict {} 0 {} {} iso8859-6 DE tcl8 \U000000DE -1 {} {} iso8859-6 DE replace \uFFFD -1 {} {} iso8859-6 DE strict {} 0 {} {} iso8859-6 DF tcl8 \U000000DF -1 {} {} iso8859-6 DF replace \uFFFD -1 {} {} iso8859-6 DF strict {} 0 {} {} iso8859-6 F3 tcl8 \U000000F3 -1 {} {} iso8859-6 F3 replace \uFFFD -1 {} {} iso8859-6 F3 strict {} 0 {} {} iso8859-6 F4 tcl8 \U000000F4 -1 {} {} iso8859-6 F4 replace \uFFFD -1 {} {} iso8859-6 F4 strict {} 0 {} {} iso8859-6 F5 tcl8 \U000000F5 -1 {} {} iso8859-6 F5 replace \uFFFD -1 {} {} iso8859-6 F5 strict {} 0 {} {} iso8859-6 F6 tcl8 \U000000F6 -1 {} {} iso8859-6 F6 replace \uFFFD -1 {} {} iso8859-6 F6 strict {} 0 {} {} iso8859-6 F7 tcl8 \U000000F7 -1 {} {} iso8859-6 F7 replace \uFFFD -1 {} {} iso8859-6 F7 strict {} 0 {} {} iso8859-6 F8 tcl8 \U000000F8 -1 {} {} iso8859-6 F8 replace \uFFFD -1 {} {} iso8859-6 F8 strict {} 0 {} {} iso8859-6 F9 tcl8 \U000000F9 -1 {} {} iso8859-6 F9 replace \uFFFD -1 {} {} iso8859-6 F9 strict {} 0 {} {} iso8859-6 FA tcl8 \U000000FA -1 {} {} iso8859-6 FA replace \uFFFD -1 {} {} iso8859-6 FA strict {} 0 {} {} iso8859-6 FB tcl8 \U000000FB -1 {} {} iso8859-6 FB replace \uFFFD -1 {} {} iso8859-6 FB strict {} 0 {} {} iso8859-6 FC tcl8 \U000000FC -1 {} {} iso8859-6 FC replace \uFFFD -1 {} {} iso8859-6 FC strict {} 0 {} {} iso8859-6 FD tcl8 \U000000FD -1 {} {} iso8859-6 FD replace \uFFFD -1 {} {} iso8859-6 FD strict {} 0 {} {} iso8859-6 FE tcl8 \U000000FE -1 {} {} iso8859-6 FE replace \uFFFD -1 {} {} iso8859-6 FE strict {} 0 {} {} iso8859-6 FF tcl8 \U000000FF -1 {} {} iso8859-6 FF replace \uFFFD -1 {} {} iso8859-6 FF strict {} 0 {} {} }; # iso8859-6 # iso8859-6 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-6 \U000000A1 tcl8 1A -1 {} {} iso8859-6 \U000000A1 replace 1A -1 {} {} iso8859-6 \U000000A1 strict {} 0 {} {} iso8859-6 \U00000400 tcl8 1A -1 {} {} iso8859-6 \U00000400 replace 1A -1 {} {} iso8859-6 \U00000400 strict {} 0 {} {} iso8859-6 \U0000D800 tcl8 1A -1 {} {} iso8859-6 \U0000D800 replace 1A -1 {} {} iso8859-6 \U0000D800 strict {} 0 {} {} iso8859-6 \U0000DC00 tcl8 1A -1 {} {} iso8859-6 \U0000DC00 replace 1A -1 {} {} iso8859-6 \U0000DC00 strict {} 0 {} {} iso8859-6 \U00010000 tcl8 1A -1 {} {} iso8859-6 \U00010000 replace 1A -1 {} {} iso8859-6 \U00010000 strict {} 0 {} {} iso8859-6 \U0010FFFF tcl8 1A -1 {} {} iso8859-6 \U0010FFFF replace 1A -1 {} {} iso8859-6 \U0010FFFF strict {} 0 {} {} }; # iso8859-6 # # iso8859-7 (generated from glibc-ISO_8859_7-2.3.3) test encoding-convertfrom-ucmCompare-iso8859-7 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-7 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B7 B7 00BB BB 00BD BD 037A AA 0384 B4 0385 B5 0386 B6 0388 B8 0389 B9 038A BA 038C BC 038E BE 038F BF 0390 C0 0391 C1 0392 C2 0393 C3 0394 C4 0395 C5 0396 C6 0397 C7 0398 C8 0399 C9 039A CA 039B CB 039C CC 039D CD 039E CE 039F CF 03A0 D0 03A1 D1 03A3 D3 03A4 D4 03A5 D5 03A6 D6 03A7 D7 03A8 D8 03A9 D9 03AA DA 03AB DB 03AC DC 03AD DD 03AE DE 03AF DF 03B0 E0 03B1 E1 03B2 E2 03B3 E3 03B4 E4 03B5 E5 03B6 E6 03B7 E7 03B8 E8 03B9 E9 03BA EA 03BB EB 03BC EC 03BD ED 03BE EE 03BF EF 03C0 F0 03C1 F1 03C2 F2 03C3 F3 03C4 F4 03C5 F5 03C6 F6 03C7 F7 03C8 F8 03C9 F9 03CA FA 03CB FB 03CC FC 03CD FD 03CE FE 2015 AF 2018 A1 2019 A2 20AC A4 20AF A5} } -result {} test encoding-convertto-ucmCompare-iso8859-7 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-7 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B7 B7 00BB BB 00BD BD 037A AA 0384 B4 0385 B5 0386 B6 0388 B8 0389 B9 038A BA 038C BC 038E BE 038F BF 0390 C0 0391 C1 0392 C2 0393 C3 0394 C4 0395 C5 0396 C6 0397 C7 0398 C8 0399 C9 039A CA 039B CB 039C CC 039D CD 039E CE 039F CF 03A0 D0 03A1 D1 03A3 D3 03A4 D4 03A5 D5 03A6 D6 03A7 D7 03A8 D8 03A9 D9 03AA DA 03AB DB 03AC DC 03AD DD 03AE DE 03AF DF 03B0 E0 03B1 E1 03B2 E2 03B3 E3 03B4 E4 03B5 E5 03B6 E6 03B7 E7 03B8 E8 03B9 E9 03BA EA 03BB EB 03BC EC 03BD ED 03BE EE 03BF EF 03C0 F0 03C1 F1 03C2 F2 03C3 F3 03C4 F4 03C5 F5 03C6 F6 03C7 F7 03C8 F8 03C9 F9 03CA FA 03CB FB 03CC FC 03CD FD 03CE FE 2015 AF 2018 A1 2019 A2 20AC A4 20AF A5} } -result {} # iso8859-7 - invalid byte sequences lappend encInvalidBytes {*}{ iso8859-7 AE tcl8 \U000000AE -1 {} {} iso8859-7 AE replace \uFFFD -1 {} {} iso8859-7 AE strict {} 0 {} {} iso8859-7 D2 tcl8 \U000000D2 -1 {} {} iso8859-7 D2 replace \uFFFD -1 {} {} iso8859-7 D2 strict {} 0 {} {} iso8859-7 FF tcl8 \U000000FF -1 {} {} iso8859-7 FF replace \uFFFD -1 {} {} iso8859-7 FF strict {} 0 {} {} }; # iso8859-7 # iso8859-7 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-7 \U000000A1 tcl8 1A -1 {} {} iso8859-7 \U000000A1 replace 1A -1 {} {} iso8859-7 \U000000A1 strict {} 0 {} {} iso8859-7 \U00000400 tcl8 1A -1 {} {} iso8859-7 \U00000400 replace 1A -1 {} {} iso8859-7 \U00000400 strict {} 0 {} {} iso8859-7 \U0000D800 tcl8 1A -1 {} {} iso8859-7 \U0000D800 replace 1A -1 {} {} iso8859-7 \U0000D800 strict {} 0 {} {} iso8859-7 \U0000DC00 tcl8 1A -1 {} {} iso8859-7 \U0000DC00 replace 1A -1 {} {} iso8859-7 \U0000DC00 strict {} 0 {} {} iso8859-7 \U00010000 tcl8 1A -1 {} {} iso8859-7 \U00010000 replace 1A -1 {} {} iso8859-7 \U00010000 strict {} 0 {} {} iso8859-7 \U0010FFFF tcl8 1A -1 {} {} iso8859-7 \U0010FFFF replace 1A -1 {} {} iso8859-7 \U0010FFFF strict {} 0 {} {} }; # iso8859-7 # # iso8859-8 (generated from glibc-ISO_8859_8-2.3.3) test encoding-convertfrom-ucmCompare-iso8859-8 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-8 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00D7 AA 00F7 BA 05D0 E0 05D1 E1 05D2 E2 05D3 E3 05D4 E4 05D5 E5 05D6 E6 05D7 E7 05D8 E8 05D9 E9 05DA EA 05DB EB 05DC EC 05DD ED 05DE EE 05DF EF 05E0 F0 05E1 F1 05E2 F2 05E3 F3 05E4 F4 05E5 F5 05E6 F6 05E7 F7 05E8 F8 05E9 F9 05EA FA 200E FD 200F FE 2017 DF} } -result {} test encoding-convertto-ucmCompare-iso8859-8 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-8 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00D7 AA 00F7 BA 05D0 E0 05D1 E1 05D2 E2 05D3 E3 05D4 E4 05D5 E5 05D6 E6 05D7 E7 05D8 E8 05D9 E9 05DA EA 05DB EB 05DC EC 05DD ED 05DE EE 05DF EF 05E0 F0 05E1 F1 05E2 F2 05E3 F3 05E4 F4 05E5 F5 05E6 F6 05E7 F7 05E8 F8 05E9 F9 05EA FA 200E FD 200F FE 2017 DF} } -result {} # iso8859-8 - invalid byte sequences lappend encInvalidBytes {*}{ iso8859-8 A1 tcl8 \U000000A1 -1 {} {} iso8859-8 A1 replace \uFFFD -1 {} {} iso8859-8 A1 strict {} 0 {} {} iso8859-8 BF tcl8 \U000000BF -1 {} {} iso8859-8 BF replace \uFFFD -1 {} {} iso8859-8 BF strict {} 0 {} {} iso8859-8 C0 tcl8 \U000000C0 -1 {} {} iso8859-8 C0 replace \uFFFD -1 {} {} iso8859-8 C0 strict {} 0 {} {} iso8859-8 C1 tcl8 \U000000C1 -1 {} {} iso8859-8 C1 replace \uFFFD -1 {} {} iso8859-8 C1 strict {} 0 {} {} iso8859-8 C2 tcl8 \U000000C2 -1 {} {} iso8859-8 C2 replace \uFFFD -1 {} {} iso8859-8 C2 strict {} 0 {} {} iso8859-8 C3 tcl8 \U000000C3 -1 {} {} iso8859-8 C3 replace \uFFFD -1 {} {} iso8859-8 C3 strict {} 0 {} {} iso8859-8 C4 tcl8 \U000000C4 -1 {} {} iso8859-8 C4 replace \uFFFD -1 {} {} iso8859-8 C4 strict {} 0 {} {} iso8859-8 C5 tcl8 \U000000C5 -1 {} {} iso8859-8 C5 replace \uFFFD -1 {} {} iso8859-8 C5 strict {} 0 {} {} iso8859-8 C6 tcl8 \U000000C6 -1 {} {} iso8859-8 C6 replace \uFFFD -1 {} {} iso8859-8 C6 strict {} 0 {} {} iso8859-8 C7 tcl8 \U000000C7 -1 {} {} iso8859-8 C7 replace \uFFFD -1 {} {} iso8859-8 C7 strict {} 0 {} {} iso8859-8 C8 tcl8 \U000000C8 -1 {} {} iso8859-8 C8 replace \uFFFD -1 {} {} iso8859-8 C8 strict {} 0 {} {} iso8859-8 C9 tcl8 \U000000C9 -1 {} {} iso8859-8 C9 replace \uFFFD -1 {} {} iso8859-8 C9 strict {} 0 {} {} iso8859-8 CA tcl8 \U000000CA -1 {} {} iso8859-8 CA replace \uFFFD -1 {} {} iso8859-8 CA strict {} 0 {} {} iso8859-8 CB tcl8 \U000000CB -1 {} {} iso8859-8 CB replace \uFFFD -1 {} {} iso8859-8 CB strict {} 0 {} {} iso8859-8 CC tcl8 \U000000CC -1 {} {} iso8859-8 CC replace \uFFFD -1 {} {} iso8859-8 CC strict {} 0 {} {} iso8859-8 CD tcl8 \U000000CD -1 {} {} iso8859-8 CD replace \uFFFD -1 {} {} iso8859-8 CD strict {} 0 {} {} iso8859-8 CE tcl8 \U000000CE -1 {} {} iso8859-8 CE replace \uFFFD -1 {} {} iso8859-8 CE strict {} 0 {} {} iso8859-8 CF tcl8 \U000000CF -1 {} {} iso8859-8 CF replace \uFFFD -1 {} {} iso8859-8 CF strict {} 0 {} {} iso8859-8 D0 tcl8 \U000000D0 -1 {} {} iso8859-8 D0 replace \uFFFD -1 {} {} iso8859-8 D0 strict {} 0 {} {} iso8859-8 D1 tcl8 \U000000D1 -1 {} {} iso8859-8 D1 replace \uFFFD -1 {} {} iso8859-8 D1 strict {} 0 {} {} iso8859-8 D2 tcl8 \U000000D2 -1 {} {} iso8859-8 D2 replace \uFFFD -1 {} {} iso8859-8 D2 strict {} 0 {} {} iso8859-8 D3 tcl8 \U000000D3 -1 {} {} iso8859-8 D3 replace \uFFFD -1 {} {} iso8859-8 D3 strict {} 0 {} {} iso8859-8 D4 tcl8 \U000000D4 -1 {} {} iso8859-8 D4 replace \uFFFD -1 {} {} iso8859-8 D4 strict {} 0 {} {} iso8859-8 D5 tcl8 \U000000D5 -1 {} {} iso8859-8 D5 replace \uFFFD -1 {} {} iso8859-8 D5 strict {} 0 {} {} iso8859-8 D6 tcl8 \U000000D6 -1 {} {} iso8859-8 D6 replace \uFFFD -1 {} {} iso8859-8 D6 strict {} 0 {} {} iso8859-8 D7 tcl8 \U000000D7 -1 {} {} iso8859-8 D7 replace \uFFFD -1 {} {} iso8859-8 D7 strict {} 0 {} {} iso8859-8 D8 tcl8 \U000000D8 -1 {} {} iso8859-8 D8 replace \uFFFD -1 {} {} iso8859-8 D8 strict {} 0 {} {} iso8859-8 D9 tcl8 \U000000D9 -1 {} {} iso8859-8 D9 replace \uFFFD -1 {} {} iso8859-8 D9 strict {} 0 {} {} iso8859-8 DA tcl8 \U000000DA -1 {} {} iso8859-8 DA replace \uFFFD -1 {} {} iso8859-8 DA strict {} 0 {} {} iso8859-8 DB tcl8 \U000000DB -1 {} {} iso8859-8 DB replace \uFFFD -1 {} {} iso8859-8 DB strict {} 0 {} {} iso8859-8 DC tcl8 \U000000DC -1 {} {} iso8859-8 DC replace \uFFFD -1 {} {} iso8859-8 DC strict {} 0 {} {} iso8859-8 DD tcl8 \U000000DD -1 {} {} iso8859-8 DD replace \uFFFD -1 {} {} iso8859-8 DD strict {} 0 {} {} iso8859-8 DE tcl8 \U000000DE -1 {} {} iso8859-8 DE replace \uFFFD -1 {} {} iso8859-8 DE strict {} 0 {} {} iso8859-8 FB tcl8 \U000000FB -1 {} {} iso8859-8 FB replace \uFFFD -1 {} {} iso8859-8 FB strict {} 0 {} {} iso8859-8 FC tcl8 \U000000FC -1 {} {} iso8859-8 FC replace \uFFFD -1 {} {} iso8859-8 FC strict {} 0 {} {} iso8859-8 FF tcl8 \U000000FF -1 {} {} iso8859-8 FF replace \uFFFD -1 {} {} iso8859-8 FF strict {} 0 {} {} }; # iso8859-8 # iso8859-8 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-8 \U000000A1 tcl8 1A -1 {} {} iso8859-8 \U000000A1 replace 1A -1 {} {} iso8859-8 \U000000A1 strict {} 0 {} {} iso8859-8 \U00000400 tcl8 1A -1 {} {} iso8859-8 \U00000400 replace 1A -1 {} {} iso8859-8 \U00000400 strict {} 0 {} {} iso8859-8 \U0000D800 tcl8 1A -1 {} {} iso8859-8 \U0000D800 replace 1A -1 {} {} iso8859-8 \U0000D800 strict {} 0 {} {} iso8859-8 \U0000DC00 tcl8 1A -1 {} {} iso8859-8 \U0000DC00 replace 1A -1 {} {} iso8859-8 \U0000DC00 strict {} 0 {} {} iso8859-8 \U00010000 tcl8 1A -1 {} {} iso8859-8 \U00010000 replace 1A -1 {} {} iso8859-8 \U00010000 strict {} 0 {} {} iso8859-8 \U0010FFFF tcl8 1A -1 {} {} iso8859-8 \U0010FFFF replace 1A -1 {} {} iso8859-8 \U0010FFFF strict {} 0 {} {} }; # iso8859-8 # # iso8859-9 (generated from glibc-ISO_8859_9-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-9 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-9 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 011E D0 011F F0 0130 DD 0131 FD 015E DE 015F FE} } -result {} test encoding-convertto-ucmCompare-iso8859-9 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-9 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A4 A4 00A5 A5 00A6 A6 00A7 A7 00A8 A8 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B4 B4 00B5 B5 00B6 B6 00B7 B7 00B8 B8 00B9 B9 00BA BA 00BB BB 00BC BC 00BD BD 00BE BE 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 011E D0 011F F0 0130 DD 0131 FD 015E DE 015F FE} } -result {} # iso8859-9 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-9 # iso8859-9 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-9 \U000000D0 tcl8 1A -1 {} {} iso8859-9 \U000000D0 replace 1A -1 {} {} iso8859-9 \U000000D0 strict {} 0 {} {} iso8859-9 \U00000400 tcl8 1A -1 {} {} iso8859-9 \U00000400 replace 1A -1 {} {} iso8859-9 \U00000400 strict {} 0 {} {} iso8859-9 \U0000D800 tcl8 1A -1 {} {} iso8859-9 \U0000D800 replace 1A -1 {} {} iso8859-9 \U0000D800 strict {} 0 {} {} iso8859-9 \U0000DC00 tcl8 1A -1 {} {} iso8859-9 \U0000DC00 replace 1A -1 {} {} iso8859-9 \U0000DC00 strict {} 0 {} {} iso8859-9 \U00010000 tcl8 1A -1 {} {} iso8859-9 \U00010000 replace 1A -1 {} {} iso8859-9 \U00010000 strict {} 0 {} {} iso8859-9 \U0010FFFF tcl8 1A -1 {} {} iso8859-9 \U0010FFFF replace 1A -1 {} {} iso8859-9 \U0010FFFF strict {} 0 {} {} }; # iso8859-9 # # iso8859-10 (generated from glibc-ISO_8859_10-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-10 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-10 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 A7 00AD AD 00B0 B0 00B7 B7 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C9 C9 00CB CB 00CD CD 00CE CE 00CF CF 00D0 D0 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D8 D8 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E9 E9 00EB EB 00ED ED 00EE EE 00EF EF 00F0 F0 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F8 F8 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 0100 C0 0101 E0 0104 A1 0105 B1 010C C8 010D E8 0110 A9 0111 B9 0112 A2 0113 B2 0116 CC 0117 EC 0118 CA 0119 EA 0122 A3 0123 B3 0128 A5 0129 B5 012A A4 012B B4 012E C7 012F E7 0136 A6 0137 B6 0138 FF 013B A8 013C B8 0145 D1 0146 F1 014A AF 014B BF 014C D2 014D F2 0160 AA 0161 BA 0166 AB 0167 BB 0168 D7 0169 F7 016A AE 016B BE 0172 D9 0173 F9 017D AC 017E BC 2015 BD} } -result {} test encoding-convertto-ucmCompare-iso8859-10 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-10 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 A7 00AD AD 00B0 B0 00B7 B7 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C9 C9 00CB CB 00CD CD 00CE CE 00CF CF 00D0 D0 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D8 D8 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E9 E9 00EB EB 00ED ED 00EE EE 00EF EF 00F0 F0 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F8 F8 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 0100 C0 0101 E0 0104 A1 0105 B1 010C C8 010D E8 0110 A9 0111 B9 0112 A2 0113 B2 0116 CC 0117 EC 0118 CA 0119 EA 0122 A3 0123 B3 0128 A5 0129 B5 012A A4 012B B4 012E C7 012F E7 0136 A6 0137 B6 0138 FF 013B A8 013C B8 0145 D1 0146 F1 014A AF 014B BF 014C D2 014D F2 0160 AA 0161 BA 0166 AB 0167 BB 0168 D7 0169 F7 016A AE 016B BE 0172 D9 0173 F9 017D AC 017E BC 2015 BD} } -result {} # iso8859-10 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-10 # iso8859-10 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-10 \U000000A1 tcl8 1A -1 {} {} iso8859-10 \U000000A1 replace 1A -1 {} {} iso8859-10 \U000000A1 strict {} 0 {} {} iso8859-10 \U00000400 tcl8 1A -1 {} {} iso8859-10 \U00000400 replace 1A -1 {} {} iso8859-10 \U00000400 strict {} 0 {} {} iso8859-10 \U0000D800 tcl8 1A -1 {} {} iso8859-10 \U0000D800 replace 1A -1 {} {} iso8859-10 \U0000D800 strict {} 0 {} {} iso8859-10 \U0000DC00 tcl8 1A -1 {} {} iso8859-10 \U0000DC00 replace 1A -1 {} {} iso8859-10 \U0000DC00 strict {} 0 {} {} iso8859-10 \U00010000 tcl8 1A -1 {} {} iso8859-10 \U00010000 replace 1A -1 {} {} iso8859-10 \U00010000 strict {} 0 {} {} iso8859-10 \U0010FFFF tcl8 1A -1 {} {} iso8859-10 \U0010FFFF replace 1A -1 {} {} iso8859-10 \U0010FFFF strict {} 0 {} {} }; # iso8859-10 # # iso8859-11 (generated from glibc-ISO_8859_11-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-11 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-11 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 0E01 A1 0E02 A2 0E03 A3 0E04 A4 0E05 A5 0E06 A6 0E07 A7 0E08 A8 0E09 A9 0E0A AA 0E0B AB 0E0C AC 0E0D AD 0E0E AE 0E0F AF 0E10 B0 0E11 B1 0E12 B2 0E13 B3 0E14 B4 0E15 B5 0E16 B6 0E17 B7 0E18 B8 0E19 B9 0E1A BA 0E1B BB 0E1C BC 0E1D BD 0E1E BE 0E1F BF 0E20 C0 0E21 C1 0E22 C2 0E23 C3 0E24 C4 0E25 C5 0E26 C6 0E27 C7 0E28 C8 0E29 C9 0E2A CA 0E2B CB 0E2C CC 0E2D CD 0E2E CE 0E2F CF 0E30 D0 0E31 D1 0E32 D2 0E33 D3 0E34 D4 0E35 D5 0E36 D6 0E37 D7 0E38 D8 0E39 D9 0E3A DA 0E3F DF 0E40 E0 0E41 E1 0E42 E2 0E43 E3 0E44 E4 0E45 E5 0E46 E6 0E47 E7 0E48 E8 0E49 E9 0E4A EA 0E4B EB 0E4C EC 0E4D ED 0E4E EE 0E4F EF 0E50 F0 0E51 F1 0E52 F2 0E53 F3 0E54 F4 0E55 F5 0E56 F6 0E57 F7 0E58 F8 0E59 F9 0E5A FA 0E5B FB} } -result {} test encoding-convertto-ucmCompare-iso8859-11 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-11 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 0E01 A1 0E02 A2 0E03 A3 0E04 A4 0E05 A5 0E06 A6 0E07 A7 0E08 A8 0E09 A9 0E0A AA 0E0B AB 0E0C AC 0E0D AD 0E0E AE 0E0F AF 0E10 B0 0E11 B1 0E12 B2 0E13 B3 0E14 B4 0E15 B5 0E16 B6 0E17 B7 0E18 B8 0E19 B9 0E1A BA 0E1B BB 0E1C BC 0E1D BD 0E1E BE 0E1F BF 0E20 C0 0E21 C1 0E22 C2 0E23 C3 0E24 C4 0E25 C5 0E26 C6 0E27 C7 0E28 C8 0E29 C9 0E2A CA 0E2B CB 0E2C CC 0E2D CD 0E2E CE 0E2F CF 0E30 D0 0E31 D1 0E32 D2 0E33 D3 0E34 D4 0E35 D5 0E36 D6 0E37 D7 0E38 D8 0E39 D9 0E3A DA 0E3F DF 0E40 E0 0E41 E1 0E42 E2 0E43 E3 0E44 E4 0E45 E5 0E46 E6 0E47 E7 0E48 E8 0E49 E9 0E4A EA 0E4B EB 0E4C EC 0E4D ED 0E4E EE 0E4F EF 0E50 F0 0E51 F1 0E52 F2 0E53 F3 0E54 F4 0E55 F5 0E56 F6 0E57 F7 0E58 F8 0E59 F9 0E5A FA 0E5B FB} } -result {} # iso8859-11 - invalid byte sequences lappend encInvalidBytes {*}{ iso8859-11 DB tcl8 \U000000DB -1 {} {} iso8859-11 DB replace \uFFFD -1 {} {} iso8859-11 DB strict {} 0 {} {} iso8859-11 DC tcl8 \U000000DC -1 {} {} iso8859-11 DC replace \uFFFD -1 {} {} iso8859-11 DC strict {} 0 {} {} iso8859-11 DD tcl8 \U000000DD -1 {} {} iso8859-11 DD replace \uFFFD -1 {} {} iso8859-11 DD strict {} 0 {} {} iso8859-11 DE tcl8 \U000000DE -1 {} {} iso8859-11 DE replace \uFFFD -1 {} {} iso8859-11 DE strict {} 0 {} {} iso8859-11 FC tcl8 \U000000FC -1 {} {} iso8859-11 FC replace \uFFFD -1 {} {} iso8859-11 FC strict {} 0 {} {} iso8859-11 FD tcl8 \U000000FD -1 {} {} iso8859-11 FD replace \uFFFD -1 {} {} iso8859-11 FD strict {} 0 {} {} iso8859-11 FE tcl8 \U000000FE -1 {} {} iso8859-11 FE replace \uFFFD -1 {} {} iso8859-11 FE strict {} 0 {} {} iso8859-11 FF tcl8 \U000000FF -1 {} {} iso8859-11 FF replace \uFFFD -1 {} {} iso8859-11 FF strict {} 0 {} {} }; # iso8859-11 # iso8859-11 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-11 \U000000A1 tcl8 1A -1 {} {} iso8859-11 \U000000A1 replace 1A -1 {} {} iso8859-11 \U000000A1 strict {} 0 {} {} iso8859-11 \U00000400 tcl8 1A -1 {} {} iso8859-11 \U00000400 replace 1A -1 {} {} iso8859-11 \U00000400 strict {} 0 {} {} iso8859-11 \U0000D800 tcl8 1A -1 {} {} iso8859-11 \U0000D800 replace 1A -1 {} {} iso8859-11 \U0000D800 strict {} 0 {} {} iso8859-11 \U0000DC00 tcl8 1A -1 {} {} iso8859-11 \U0000DC00 replace 1A -1 {} {} iso8859-11 \U0000DC00 strict {} 0 {} {} iso8859-11 \U00010000 tcl8 1A -1 {} {} iso8859-11 \U00010000 replace 1A -1 {} {} iso8859-11 \U00010000 strict {} 0 {} {} iso8859-11 \U0010FFFF tcl8 1A -1 {} {} iso8859-11 \U0010FFFF replace 1A -1 {} {} iso8859-11 \U0010FFFF strict {} 0 {} {} }; # iso8859-11 # # iso8859-13 (generated from glibc-ISO_8859_13-2.3.3) test encoding-convertfrom-ucmCompare-iso8859-13 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-13 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A6 A6 00A7 A7 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00C4 C4 00C5 C5 00C6 AF 00C9 C9 00D3 D3 00D5 D5 00D6 D6 00D7 D7 00D8 A8 00DC DC 00DF DF 00E4 E4 00E5 E5 00E6 BF 00E9 E9 00F3 F3 00F5 F5 00F6 F6 00F7 F7 00F8 B8 00FC FC 0100 C2 0101 E2 0104 C0 0105 E0 0106 C3 0107 E3 010C C8 010D E8 0112 C7 0113 E7 0116 CB 0117 EB 0118 C6 0119 E6 0122 CC 0123 EC 012A CE 012B EE 012E C1 012F E1 0136 CD 0137 ED 013B CF 013C EF 0141 D9 0142 F9 0143 D1 0144 F1 0145 D2 0146 F2 014C D4 014D F4 0156 AA 0157 BA 015A DA 015B FA 0160 D0 0161 F0 016A DB 016B FB 0172 D8 0173 F8 0179 CA 017A EA 017B DD 017C FD 017D DE 017E FE 2019 FF 201C B4 201D A1 201E A5} } -result {} test encoding-convertto-ucmCompare-iso8859-13 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-13 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A2 A2 00A3 A3 00A4 A4 00A6 A6 00A7 A7 00A9 A9 00AB AB 00AC AC 00AD AD 00AE AE 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00B9 B9 00BB BB 00BC BC 00BD BD 00BE BE 00C4 C4 00C5 C5 00C6 AF 00C9 C9 00D3 D3 00D5 D5 00D6 D6 00D7 D7 00D8 A8 00DC DC 00DF DF 00E4 E4 00E5 E5 00E6 BF 00E9 E9 00F3 F3 00F5 F5 00F6 F6 00F7 F7 00F8 B8 00FC FC 0100 C2 0101 E2 0104 C0 0105 E0 0106 C3 0107 E3 010C C8 010D E8 0112 C7 0113 E7 0116 CB 0117 EB 0118 C6 0119 E6 0122 CC 0123 EC 012A CE 012B EE 012E C1 012F E1 0136 CD 0137 ED 013B CF 013C EF 0141 D9 0142 F9 0143 D1 0144 F1 0145 D2 0146 F2 014C D4 014D F4 0156 AA 0157 BA 015A DA 015B FA 0160 D0 0161 F0 016A DB 016B FB 0172 D8 0173 F8 0179 CA 017A EA 017B DD 017C FD 017D DE 017E FE 2019 FF 201C B4 201D A1 201E A5} } -result {} # iso8859-13 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-13 # iso8859-13 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-13 \U000000A1 tcl8 1A -1 {} {} iso8859-13 \U000000A1 replace 1A -1 {} {} iso8859-13 \U000000A1 strict {} 0 {} {} iso8859-13 \U00000400 tcl8 1A -1 {} {} iso8859-13 \U00000400 replace 1A -1 {} {} iso8859-13 \U00000400 strict {} 0 {} {} iso8859-13 \U0000D800 tcl8 1A -1 {} {} iso8859-13 \U0000D800 replace 1A -1 {} {} iso8859-13 \U0000D800 strict {} 0 {} {} iso8859-13 \U0000DC00 tcl8 1A -1 {} {} iso8859-13 \U0000DC00 replace 1A -1 {} {} iso8859-13 \U0000DC00 strict {} 0 {} {} iso8859-13 \U00010000 tcl8 1A -1 {} {} iso8859-13 \U00010000 replace 1A -1 {} {} iso8859-13 \U00010000 strict {} 0 {} {} iso8859-13 \U0010FFFF tcl8 1A -1 {} {} iso8859-13 \U0010FFFF replace 1A -1 {} {} iso8859-13 \U0010FFFF strict {} 0 {} {} }; # iso8859-13 # # iso8859-14 (generated from glibc-ISO_8859_14-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-14 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-14 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A7 A7 00A9 A9 00AD AD 00AE AE 00B6 B6 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FF FF 010A A4 010B A5 0120 B2 0121 B3 0174 D0 0175 F0 0176 DE 0177 FE 0178 AF 1E02 A1 1E03 A2 1E0A A6 1E0B AB 1E1E B0 1E1F B1 1E40 B4 1E41 B5 1E56 B7 1E57 B9 1E60 BB 1E61 BF 1E6A D7 1E6B F7 1E80 A8 1E81 B8 1E82 AA 1E83 BA 1E84 BD 1E85 BE 1EF2 AC 1EF3 BC} } -result {} test encoding-convertto-ucmCompare-iso8859-14 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-14 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A3 A3 00A7 A7 00A9 A9 00AD AD 00AE AE 00B6 B6 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FF FF 010A A4 010B A5 0120 B2 0121 B3 0174 D0 0175 F0 0176 DE 0177 FE 0178 AF 1E02 A1 1E03 A2 1E0A A6 1E0B AB 1E1E B0 1E1F B1 1E40 B4 1E41 B5 1E56 B7 1E57 B9 1E60 BB 1E61 BF 1E6A D7 1E6B F7 1E80 A8 1E81 B8 1E82 AA 1E83 BA 1E84 BD 1E85 BE 1EF2 AC 1EF3 BC} } -result {} # iso8859-14 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-14 # iso8859-14 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-14 \U000000A1 tcl8 1A -1 {} {} iso8859-14 \U000000A1 replace 1A -1 {} {} iso8859-14 \U000000A1 strict {} 0 {} {} iso8859-14 \U00000400 tcl8 1A -1 {} {} iso8859-14 \U00000400 replace 1A -1 {} {} iso8859-14 \U00000400 strict {} 0 {} {} iso8859-14 \U0000D800 tcl8 1A -1 {} {} iso8859-14 \U0000D800 replace 1A -1 {} {} iso8859-14 \U0000D800 strict {} 0 {} {} iso8859-14 \U0000DC00 tcl8 1A -1 {} {} iso8859-14 \U0000DC00 replace 1A -1 {} {} iso8859-14 \U0000DC00 strict {} 0 {} {} iso8859-14 \U00010000 tcl8 1A -1 {} {} iso8859-14 \U00010000 replace 1A -1 {} {} iso8859-14 \U00010000 strict {} 0 {} {} iso8859-14 \U0010FFFF tcl8 1A -1 {} {} iso8859-14 \U0010FFFF replace 1A -1 {} {} iso8859-14 \U0010FFFF strict {} 0 {} {} }; # iso8859-14 # # iso8859-15 (generated from glibc-ISO_8859_15-2.1.2) test encoding-convertfrom-ucmCompare-iso8859-15 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-15 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A5 A5 00A7 A7 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00B9 B9 00BA BA 00BB BB 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF 0152 BC 0153 BD 0160 A6 0161 A8 0178 BE 017D B4 017E B8 20AC A4} } -result {} test encoding-convertto-ucmCompare-iso8859-15 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-15 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A1 A1 00A2 A2 00A3 A3 00A5 A5 00A7 A7 00A9 A9 00AA AA 00AB AB 00AC AC 00AD AD 00AE AE 00AF AF 00B0 B0 00B1 B1 00B2 B2 00B3 B3 00B5 B5 00B6 B6 00B7 B7 00B9 B9 00BA BA 00BB BB 00BF BF 00C0 C0 00C1 C1 00C2 C2 00C3 C3 00C4 C4 00C5 C5 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D0 D0 00D1 D1 00D2 D2 00D3 D3 00D4 D4 00D5 D5 00D6 D6 00D7 D7 00D8 D8 00D9 D9 00DA DA 00DB DB 00DC DC 00DD DD 00DE DE 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E3 E3 00E4 E4 00E5 E5 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F0 F0 00F1 F1 00F2 F2 00F3 F3 00F4 F4 00F5 F5 00F6 F6 00F7 F7 00F8 F8 00F9 F9 00FA FA 00FB FB 00FC FC 00FD FD 00FE FE 00FF FF 0152 BC 0153 BD 0160 A6 0161 A8 0178 BE 017D B4 017E B8 20AC A4} } -result {} # iso8859-15 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-15 # iso8859-15 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-15 \U000000A4 tcl8 1A -1 {} {} iso8859-15 \U000000A4 replace 1A -1 {} {} iso8859-15 \U000000A4 strict {} 0 {} {} iso8859-15 \U00000400 tcl8 1A -1 {} {} iso8859-15 \U00000400 replace 1A -1 {} {} iso8859-15 \U00000400 strict {} 0 {} {} iso8859-15 \U0000D800 tcl8 1A -1 {} {} iso8859-15 \U0000D800 replace 1A -1 {} {} iso8859-15 \U0000D800 strict {} 0 {} {} iso8859-15 \U0000DC00 tcl8 1A -1 {} {} iso8859-15 \U0000DC00 replace 1A -1 {} {} iso8859-15 \U0000DC00 strict {} 0 {} {} iso8859-15 \U00010000 tcl8 1A -1 {} {} iso8859-15 \U00010000 replace 1A -1 {} {} iso8859-15 \U00010000 strict {} 0 {} {} iso8859-15 \U0010FFFF tcl8 1A -1 {} {} iso8859-15 \U0010FFFF replace 1A -1 {} {} iso8859-15 \U0010FFFF strict {} 0 {} {} }; # iso8859-15 # # iso8859-16 (generated from glibc-ISO_8859_16-2.3.3) test encoding-convertfrom-ucmCompare-iso8859-16 {Compare against ICU UCM} -body { ucmConvertfromMismatches iso8859-16 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 A7 00A9 A9 00AB AB 00AD AD 00B0 B0 00B1 B1 00B6 B6 00B7 B7 00BB BB 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D2 D2 00D3 D3 00D4 D4 00D6 D6 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F2 F2 00F3 F3 00F4 F4 00F6 F6 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 0102 C3 0103 E3 0104 A1 0105 A2 0106 C5 0107 E5 010C B2 010D B9 0110 D0 0111 F0 0118 DD 0119 FD 0141 A3 0142 B3 0143 D1 0144 F1 0150 D5 0151 F5 0152 BC 0153 BD 015A D7 015B F7 0160 A6 0161 A8 0170 D8 0171 F8 0178 BE 0179 AC 017A AE 017B AF 017C BF 017D B4 017E B8 0218 AA 0219 BA 021A DE 021B FE 201D B5 201E A5 20AC A4} } -result {} test encoding-convertto-ucmCompare-iso8859-16 {Compare against ICU UCM} -body { ucmConverttoMismatches iso8859-16 {0000 00 0001 01 0002 02 0003 03 0004 04 0005 05 0006 06 0007 07 0008 08 0009 09 000A 0A 000B 0B 000C 0C 000D 0D 000E 0E 000F 0F 0010 10 0011 11 0012 12 0013 13 0014 14 0015 15 0016 16 0017 17 0018 18 0019 19 001A 1A 001B 1B 001C 1C 001D 1D 001E 1E 001F 1F 0020 20 0021 21 0022 22 0023 23 0024 24 0025 25 0026 26 0027 27 0028 28 0029 29 002A 2A 002B 2B 002C 2C 002D 2D 002E 2E 002F 2F 0030 30 0031 31 0032 32 0033 33 0034 34 0035 35 0036 36 0037 37 0038 38 0039 39 003A 3A 003B 3B 003C 3C 003D 3D 003E 3E 003F 3F 0040 40 0041 41 0042 42 0043 43 0044 44 0045 45 0046 46 0047 47 0048 48 0049 49 004A 4A 004B 4B 004C 4C 004D 4D 004E 4E 004F 4F 0050 50 0051 51 0052 52 0053 53 0054 54 0055 55 0056 56 0057 57 0058 58 0059 59 005A 5A 005B 5B 005C 5C 005D 5D 005E 5E 005F 5F 0060 60 0061 61 0062 62 0063 63 0064 64 0065 65 0066 66 0067 67 0068 68 0069 69 006A 6A 006B 6B 006C 6C 006D 6D 006E 6E 006F 6F 0070 70 0071 71 0072 72 0073 73 0074 74 0075 75 0076 76 0077 77 0078 78 0079 79 007A 7A 007B 7B 007C 7C 007D 7D 007E 7E 007F 7F 0080 80 0081 81 0082 82 0083 83 0084 84 0085 85 0086 86 0087 87 0088 88 0089 89 008A 8A 008B 8B 008C 8C 008D 8D 008E 8E 008F 8F 0090 90 0091 91 0092 92 0093 93 0094 94 0095 95 0096 96 0097 97 0098 98 0099 99 009A 9A 009B 9B 009C 9C 009D 9D 009E 9E 009F 9F 00A0 A0 00A7 A7 00A9 A9 00AB AB 00AD AD 00B0 B0 00B1 B1 00B6 B6 00B7 B7 00BB BB 00C0 C0 00C1 C1 00C2 C2 00C4 C4 00C6 C6 00C7 C7 00C8 C8 00C9 C9 00CA CA 00CB CB 00CC CC 00CD CD 00CE CE 00CF CF 00D2 D2 00D3 D3 00D4 D4 00D6 D6 00D9 D9 00DA DA 00DB DB 00DC DC 00DF DF 00E0 E0 00E1 E1 00E2 E2 00E4 E4 00E6 E6 00E7 E7 00E8 E8 00E9 E9 00EA EA 00EB EB 00EC EC 00ED ED 00EE EE 00EF EF 00F2 F2 00F3 F3 00F4 F4 00F6 F6 00F9 F9 00FA FA 00FB FB 00FC FC 00FF FF 0102 C3 0103 E3 0104 A1 0105 A2 0106 C5 0107 E5 010C B2 010D B9 0110 D0 0111 F0 0118 DD 0119 FD 0141 A3 0142 B3 0143 D1 0144 F1 0150 D5 0151 F5 0152 BC 0153 BD 015A D7 015B F7 0160 A6 0161 A8 0170 D8 0171 F8 0178 BE 0179 AC 017A AE 017B AF 017C BF 017D B4 017E B8 0218 AA 0219 BA 021A DE 021B FE 201D B5 201E A5 20AC A4} } -result {} # iso8859-16 - invalid byte sequences lappend encInvalidBytes {*}{ }; # iso8859-16 # iso8859-16 - invalid byte sequences lappend encUnencodableStrings {*}{ iso8859-16 \U000000A1 tcl8 1A -1 {} {} iso8859-16 \U000000A1 replace 1A -1 {} {} iso8859-16 \U000000A1 strict {} 0 {} {} iso8859-16 \U00000400 tcl8 1A -1 {} {} iso8859-16 \U00000400 replace 1A -1 {} {} iso8859-16 \U00000400 strict {} 0 {} {} iso8859-16 \U0000D800 tcl8 1A -1 {} {} iso8859-16 \U0000D800 replace 1A -1 {} {} iso8859-16 \U0000D800 strict {} 0 {} {} iso8859-16 \U0000DC00 tcl8 1A -1 {} {} iso8859-16 \U0000DC00 replace 1A -1 {} {} iso8859-16 \U0000DC00 strict {} 0 {} {} iso8859-16 \U00010000 tcl8 1A -1 {} {} iso8859-16 \U00010000 replace 1A -1 {} {} iso8859-16 \U00010000 strict {} 0 {} {} iso8859-16 \U0010FFFF tcl8 1A -1 {} {} iso8859-16 \U0010FFFF replace 1A -1 {} {} iso8859-16 \U0010FFFF strict {} 0 {} {} }; # iso8859-16 tcl9.0.3/tests/icu.test0000644000175000017500000002466015104661341014402 0ustar sergeisergei# Tests for tcl::unsupported::icu # Contains basic sanity checks only! Commands are not intended for # production use. if {"::tcltest" ni [namespace children]} { package require tcltest namespace import -force ::tcltest::* } # Disable ICU tests in the presence of valgrind since the dl_load # allocations interfere with valgrind output and icu is anyways an # unsupported component. if {![testConstraint valgrind]} { # Force late loading of ICU if present catch {::tcl::unsupported::icu} testConstraint icu [llength [info commands ::tcl::unsupported::icu::detect]] } namespace eval icu { namespace path {::tcl::unsupported ::tcl::mathop} test icu-detect-0 {Return list of ICU encodings} -constraints icu -body { set encoders [icu detect] list [in UTF-8 $encoders] [in ISO-8859-1 $encoders] } -result {1 1} test icu-detect-1 {Guess encoding} -constraints icu -body { icu detect [readFile [info script]] } -result ISO-8859-1 test icu-detect-2 {Get all possible encodings} -constraints icu -body { set encodings [icu detect [readFile [info script]] -all] list [in UTF-8 $encodings] [in ISO-8859-1 $encodings] } -result {1 1} test icu-detect-3 {error case} -constraints icu -returnCodes error -body { icu detect gorp gorp gorp } -result {wrong # args: should be "icu detect ?bytes ?-all??"} test icu-tclToIcu-0 {Map Tcl encoding} -constraints icu -body { # tis-620 because it is ambiguous in ICU on some platforms # but should return the preferred encoding lmap enc {utf-8 tis-620 shiftjis} { icu tclToIcu $enc } } -result {UTF-8 TIS-620 ibm-943_P15A-2003} test icu-tclToIcu-1 {Map Tcl encoding - no map} -constraints icu -body { # Should not raise an error icu tclToIcu dummy } -result {} test icu-tclToIcu-2 {error case} -constraints icu -returnCodes error -body { icu tclToIcu gorp gorp } -result {wrong # args: should be "icu tclToIcu tclName"} test icu-icuToTcl-0 {Map ICU encoding} -constraints icu -body { lmap enc {UTF-8 TIS-620 ibm-943_P15A-2003} { icu icuToTcl $enc } } -result {utf-8 tis-620 cp932} test icu-icuToTcl-1 {Map ICU encoding - no map} -constraints icu -body { # Should not raise an error icu icuToTcl dummy } -result {} test icu-icuToTcl-2 {error case} -constraints icu -returnCodes error -body { icu icuToTcl gorp gorp } -result {wrong # args: should be "icu icuToTcl icuName"} ### # icu convertfrom syntax and arg checks # These tests are NOT for testing encodings, that's elsewhere. test icu-convertfrom-error-0 {no args} -constraints icu -body { icu convertfrom } -result {wrong # args: should be "icu convertfrom ?-profile PROFILE? ICUENCNAME STRING"} -returnCodes error test icu-convertfrom-error-1 {one arg} -constraints icu -body { icu convertfrom ASCII } -result {wrong # args: should be "icu convertfrom ?-profile PROFILE? ICUENCNAME STRING"} -returnCodes error test icu-convertfrom-error-2 {missing option value} -constraints icu -body { icu convertfrom -profile strict ASCII } -result {Missing value for option -profile.} -returnCodes error test icu-convertfrom-error-3 {-failindex} -constraints icu -body { icu convertfrom -failindex failindex ASCII abc } -result {Option -failindex not implemented.} -returnCodes error test icu-convertfrom-error-4 {extra arg} -constraints icu -body { icu convertfrom -profile strict extra ASCII abc } -result {bad option "extra": must be -profile or -failindex} -returnCodes error test icu-convertfrom-error-5 {invalid profile} -constraints icu -body { icu convertfrom -profile tcl8 ASCII abc } -result {Invalid value "tcl8" supplied for option "-profile". Must be "strict" or "replace".} -returnCodes error test icu-convertfrom-error-6 {invalid encoding} -constraints icu -body { icu convertfrom nosuchencoding abc } -result {Could not get encoding converter.*} -match glob -returnCodes error test icu-convertfrom-0 {default success} -constraints icu -body { icu convertfrom UTF-8 \xf0\x9f\x98\x80 } -result \U1F600 test icu-convertfrom-1 {-profile strict success} -constraints icu -body { icu convertfrom -profile strict UTF-8 \xf0\x9f\x98\x80 } -result \U1F600 test icu-convertfrom-2 {-profile replace success} -constraints icu -body { icu convertfrom -profile replace UTF-8 \xf0\x9f\x98\x80 } -result \U1F600 test icu-convertfrom-3 {default invalid encoding} -constraints icu -body { icu convertfrom UTF-8 \xC0\x80 } -result {ICU error while decoding. ICU error (12): U_ILLEGAL_CHAR_FOUND} -returnCodes error test icu-convertfrom-4 {-profile strict invalid encoding} -constraints icu -body { icu convertfrom -profile strict UTF-8 \xC0\x80 } -result {ICU error while decoding. ICU error (12): U_ILLEGAL_CHAR_FOUND} -returnCodes error test icu-convertfrom-5 {-profile replace invalid encoding} -constraints icu -body { icu convertfrom -profile replace UTF-8 \xC0\x80 } -result \UFFFD\uFFFD ### # icu convertto syntax and arg checks # These tests are NOT for testing encodings, that's elsewhere. test icu-convertto-error-0 {no args} -constraints icu -body { icu convertto } -result {wrong # args: should be "icu convertto ?-profile PROFILE? ICUENCNAME STRING"} -returnCodes error test icu-convertto-error-1 {one arg} -constraints icu -body { icu convertto ASCII } -result {wrong # args: should be "icu convertto ?-profile PROFILE? ICUENCNAME STRING"} -returnCodes error test icu-convertto-error-2 {missing option value} -constraints icu -body { icu convertto -profile strict ASCII } -result {Missing value for option -profile.} -returnCodes error test icu-convertto-error-3 {-failindex} -constraints icu -body { icu convertto -failindex failindex ASCII abc } -result {Option -failindex not implemented.} -returnCodes error test icu-convertto-error-4 {extra arg} -constraints icu -body { icu convertto -profile strict extra ASCII abc } -result {bad option "extra": must be -profile or -failindex} -returnCodes error test icu-convertto-error-5 {invalid profile} -constraints icu -body { icu convertto -profile tcl8 ASCII abc } -result {Invalid value "tcl8" supplied for option "-profile". Must be "strict" or "replace".} -returnCodes error test icu-convertto-error-6 {invalid encoding} -constraints icu -body { icu convertto nosuchencoding abc } -result {Could not get encoding converter.*} -match glob -returnCodes error test icu-convertto-0 {default success} -constraints icu -body { icu convertto UTF-8 \U1F600 } -result \xf0\x9f\x98\x80 test icu-convertto-1 {-profile strict success} -constraints icu -body { icu convertto -profile strict UTF-8 \U1F600 } -result \xf0\x9f\x98\x80 test icu-convertto-2 {-profile replace success} -constraints icu -body { icu convertto -profile replace UTF-8 \U1F600 } -result \xf0\x9f\x98\x80 test icu-convertto-3 {default unencodable character} -constraints icu -body { icu convertto ISO-8859-2 \U1F600 } -result {ICU error while encoding. ICU error (10): U_INVALID_CHAR_FOUND} -returnCodes error test icu-convertto-4 {-profile strict unencodable character} -constraints icu -body { icu convertto -profile strict ISO-8859-2 \U1F600 } -result {ICU error while encoding. ICU error (10): U_INVALID_CHAR_FOUND} -returnCodes error test icu-convertto-5 {-profile replace unencodable character} -constraints icu -body { icu convertto -profile replace ISO-8859-2 \U1F600 } -result \x1A ### # Basic tests for normalization test icu-normalize-error-0 {no args} -constraints icu -body { icu normalize } -result {wrong # args: should be "icu normalize ?-profile PROFILE? ?-mode MODE? STRING"} -returnCodes error test icu-normalize-error-1 {missing -profile arg} -constraints icu -body { icu normalize -profile STRING } -result {Missing value for option -profile.} -returnCodes error test icu-normalize-error-2 {missing -mode arg} -constraints icu -body { icu normalize -mode STRING } -result {Missing value for option -mode.} -returnCodes error test icu-normalize-error-3 {extra arg} -constraints icu -body { icu normalize -profile strict STRING arg } -result {bad option "STRING": must be -profile or -mode} -returnCodes error test icu-normalize-error-4 {invalid profile} -constraints icu -body { icu normalize -profile tcl8 ASCII abc } -result {Invalid value "tcl8" supplied for option "-profile". Must be "strict" or "replace".} -returnCodes error test icu-normalize-error-6 {invalid mode} -constraints icu -body { icu normalize -mode xxx ASCII abc } -result {bad normalization mode "xxx": must be nfc, nfd, nfkc, or nfkd} -returnCodes error # Source is composed set s \uFB01anc\u00e9 test icu-normalize-0 {Default normalization} -constraints icu -body { icu normalize $s } -result \uFB01anc\u00e9 test icu-normalize-nfc-0 {NFC normalization} -constraints icu -body { icu normalize -mode nfc $s } -result \uFB01anc\u00e9 test icu-normalize-nfd-0 {NFD normalization} -constraints icu -body { icu normalize -mode nfd $s } -result \uFB01ance\u0301 test icu-normalize-nfkc-0 {NFKC normalization} -constraints icu -body { icu normalize -mode nfkc $s } -result fianc\u00e9 test icu-normalize-nfkd-0 {NFKD normalization} -constraints icu -body { icu normalize -mode nfkd $s } -result fiance\u0301 # Source is decomposed set s \uFB01ance\u0301 test icu-normalize-1 {Default normalization} -constraints icu -body { icu normalize $s } -result \uFB01anc\u00e9 test icu-normalize-nfc-1 {NFC normalization} -constraints icu -body { icu normalize -mode nfc $s } -result \uFB01anc\u00e9 test icu-normalize-nfd-1 {NFD normalization} -constraints icu -body { icu normalize -mode nfd $s } -result \uFB01ance\u0301 test icu-normalize-nfkc-1 {NFKC normalization} -constraints icu -body { icu normalize -mode nfkc $s } -result fianc\u00e9 test icu-normalize-nfkd-1 {NFKD normalization} -constraints icu -body { icu normalize -mode nfkd $s } -result fiance\u0301 # Source has multiple diacritics with different canonical ordering foreach s [list \u1EC7 e\u0302\u0323 e\u0323\u0302] { test icu-normalize-nfc-2-$s {fully composed} -constraints icu -body { icu normalize -mode nfc $s } -result \u1EC7 test icu-normalize-nfc-3-$s {fully decomposed} -constraints icu -body { icu normalize -mode nfd $s } -result e\u0323\u0302 } } namespace delete icu ::tcltest::cleanupTests tcl9.0.3/tests/httpTestScript.tcl0000644000175000017500000003166215104661341016431 0ustar sergeisergei# httpTestScript.tcl # # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # # Copyright © 2018 Keith Nash # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ------------------------------------------------------------------------------ # "Package" httpTestScript for executing test scripts written in a convenient # shorthand. # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ # Documentation for "package" httpTestScript. # ------------------------------------------------------------------------------ # To use the package: # (a) define URLs as the values of elements in the array ::httpTestScript # (b) define a script in terms of the commands # START STOP DELAY KEEPALIVE WAIT PIPELINE GET HEAD POST # referring to URLs by the name of the corresponding array element. The # script can include any other Tcl commands, and evaluates in the # httpTestScript namespace. # (c) Use the command httpTestScript::runHttpTestScript to evaluate the script. # (d) For tcltest tests, wrap the runHttpTestScript call in a suitable "test" # command. # ------------------------------------------------------------------------------ # START # Must be the first command of the script. # # STOP # Must be present in the script to avoid waiting for client timeout. # Usually the last command, but can be elsewhere to end a script prematurely. # Subsequent httpTestScript commands will have no effect. # # DELAY ms # If there are no WAIT commands, this sets the delay in ms between subsequent # calls to http::geturl. Default 500ms. # # KEEPALIVE # Set the value passed to http::geturl for the -keepalive option. The command # applies to subsequent requests in the script. Default 1. # # WAIT ms # Pause for a time in ms before sending subsequent requests. # # PIPELINE boolean # Set the value of -pipeline using http::config. The last PIPELINE command # in the script applies to every request. Default 1. # # POSTFRESH boolean # Set the value of -postfresh using http::config. The last POSTFRESH command # in the script applies to every request. Default 0. # # REPOST boolean # Set the value of -repost using http::config. The last REPOST command # in the script applies to every request. Default 1 for httpTestScript. # (Default value in http is 0). # # GET uriCode ?arg ...? # Send a HTTP request using the GET method. # Arguments: # uriCode - the code for the base URI - the value must be stored in # ::httpTestScript::URL($uriCode). # args - strings that will be joined by "&" and appended to the query # string with a preceding "&". # # HEAD uriCode ?arg ...? # Send a HTTP request using the HEAD method. # Arguments: as for GET # # POST uriCode ?arg ...? # Send a HTTP request using the POST method. # Arguments: # uriCode - the code for the base URI - the value must be stored in # ::httpTestScript::URL($uriCode). # args - strings that will be joined by "&" and used as the request body. # ------------------------------------------------------------------------------ namespace eval ::httpTestScript { namespace export runHttpTestScript cleanupHttpTestScript } # httpTestScript::START -- # Initialise, and create a long-stop timeout. proc httpTestScript::START {} { variable CountRequestedSoFar variable RequestsWhenStopped variable KeepAlive variable Delay variable TimeOutCode variable TimeOutDone variable StartDone variable StopDone variable CountFinishedSoFar variable RequestList variable RequestsMade variable ExtraTime variable ActualKeepAlive if {[info exists StartDone] && ($StartDone == 1)} { set msg {START has been called twice without an intervening STOP} return -code error $msg } set StartDone 1 set StopDone 0 set TimeOutDone 0 set CountFinishedSoFar 0 set CountRequestedSoFar 0 set RequestList {} set RequestsMade {} set ExtraTime 0 set ActualKeepAlive 1 # Undefined until a STOP command: unset -nocomplain RequestsWhenStopped # Default values: set KeepAlive 1 set Delay 500 # Default values for tests: KEEPALIVE 1 PIPELINE 1 POSTFRESH 0 REPOST 1 set TimeOutCode [after 30000 httpTestScript::TimeOutNow] # set TimeOutCode [after 4000 httpTestScript::TimeOutNow] return } # httpTestScript::STOP -- # Do not process any more commands. The commands will be executed but will # silently do nothing. proc httpTestScript::STOP {} { variable CountRequestedSoFar variable CountFinishedSoFar variable RequestsWhenStopped variable TimeOutCode variable StartDone variable StopDone variable RequestsMade if {$StopDone} { # Don't do anything on a second call. return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } set StopDone 1 set StartDone 0 set RequestsWhenStopped $CountRequestedSoFar unset -nocomplain StartDone if {$CountFinishedSoFar == $RequestsWhenStopped} { if {[info exists TimeOutCode]} { after cancel $TimeOutCode } set ::httpTestScript::FOREVER 0 } return } # httpTestScript::DELAY -- # If there are no WAIT commands, this sets the delay in ms between subsequent # calls to http::geturl. Default 500ms. proc httpTestScript::DELAY {t} { variable StartDone variable StopDone if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } variable Delay set Delay $t return } # httpTestScript::KEEPALIVE -- # Set the value passed to http::geturl for the -keepalive option. Default 1. proc httpTestScript::KEEPALIVE {b} { variable StartDone variable StopDone if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } variable KeepAlive set KeepAlive $b return } # httpTestScript::WAIT -- # Pause for a time in ms before processing any more commands. proc httpTestScript::WAIT {t} { variable StartDone variable StopDone variable ExtraTime if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } if {(![string is integer -strict $t]) || $t < 0} { return -code error {argument to WAIT must be a non-negative integer} } incr ExtraTime $t return } # httpTestScript::PIPELINE -- # Pass a value to http::config -pipeline. proc httpTestScript::PIPELINE {b} { variable StartDone variable StopDone if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } ::http::config -pipeline $b ##::http::Log http(-pipeline) is now [::http::config -pipeline] return } # httpTestScript::POSTFRESH -- # Pass a value to http::config -postfresh. proc httpTestScript::POSTFRESH {b} { variable StartDone variable StopDone if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } ::http::config -postfresh $b ##::http::Log http(-postfresh) is now [::http::config -postfresh] return } # httpTestScript::REPOST -- # Pass a value to http::config -repost. proc httpTestScript::REPOST {b} { variable StartDone variable StopDone if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } ::http::config -repost $b ##::http::Log http(-repost) is now [::http::config -repost] return } # httpTestScript::GET -- # Send a HTTP request using the GET method. # Arguments: # uriCode - the code for the base URI - the value must be stored in # ::httpTestScript::URL($uriCode). # args - strings that will each be preceded by "&" and appended to the query # string. proc httpTestScript::GET {uriCode args} { variable RequestList lappend RequestList GET RequestAfter $uriCode 0 {} {*}$args return } # httpTestScript::HEAD -- # Send a HTTP request using the HEAD method. # Arguments: as for GET proc httpTestScript::HEAD {uriCode args} { variable RequestList lappend RequestList HEAD RequestAfter $uriCode 1 {} {*}$args return } # httpTestScript::POST -- # Send a HTTP request using the POST method. # Arguments: # uriCode - the code for the base URI - the value must be stored in # ::httpTestScript::URL($uriCode). # args - strings that will be joined by "&" and used as the request body. proc httpTestScript::POST {uriCode args} { variable RequestList lappend RequestList POST RequestAfter $uriCode 0 {use} {*}$args return } proc httpTestScript::RequestAfter {uriCode validate query args} { variable CountRequestedSoFar variable Delay variable ExtraTime variable StartDone variable StopDone variable KeepAlive if {$StopDone} { return } if {![info exists StartDone]} { return -code error {initialise the script by calling command START} } incr CountRequestedSoFar set idelay [expr {($CountRequestedSoFar - 1) * $Delay + 10 + $ExtraTime}] # Could pass values of -pipeline, -postfresh, -repost if it were # useful to change these mid-script. after $idelay [list httpTestScript::Requester $uriCode $KeepAlive $validate $query {*}$args] return } proc httpTestScript::Requester {uriCode keepAlive validate query args} { variable URL ::http::config -accept {*/*} set absUrl $URL($uriCode) if {$query eq {}} { if {$args ne {}} { append absUrl & [join $args &] } set queryArgs {} } elseif {$validate} { return -code error {cannot have both -validate (HEAD) and -query (POST)} } else { set queryArgs [list -query [join $args &]] } if {[catch { ::http::geturl $absUrl \ -validate $validate \ -timeout 10000 \ {*}$queryArgs \ -keepalive $keepAlive \ -command ::httpTestScript::WhenFinished } token]} { set msg $token catch {puts stdout "Error: $msg"} return } else { # Request will begin. } return } proc httpTestScript::TimeOutNow {} { variable TimeOutDone set TimeOutDone 1 set ::httpTestScript::FOREVER 0 return } proc httpTestScript::WhenFinished {hToken} { variable CountFinishedSoFar variable RequestsWhenStopped variable TimeOutCode variable StopDone variable RequestList variable RequestsMade variable ActualKeepAlive upvar #0 $hToken state if {[catch { if { [info exists state(transfer)] && ($state(transfer) eq "chunked") } { set Trans chunked } else { set Trans unchunked } if { [info exists ::httpTest::testOptions(-verbose)] && ($::httpTest::testOptions(-verbose) > 0) } { puts "Token $hToken Response $state(http) Status $state(status) Method $state(method) Transfer $Trans Size $state(currentsize) URL $state(url) " } if {!$state(-keepalive)} { set ActualKeepAlive 0 } if {[info exists state(method)]} { lappend RequestsMade $state(method) } else { lappend RequestsMade UNKNOWN } set tk [namespace tail $hToken] if { ($state(http) != {HTTP/1.1 200 OK}) || ($state(status) != {ok}) || (($state(currentsize) == 0) && ($state(method) ne "HEAD")) } { ::http::Log ^X$tk unexpected result Response $state(http) Status $state(status) Size $state(currentsize) - token $hToken } } err]} { ::http::Log ^X$tk httpTestScript::WhenFinished failed with error status: $err - token $hToken } incr CountFinishedSoFar if {$StopDone && ($CountFinishedSoFar == $RequestsWhenStopped)} { if {[info exists TimeOutCode]} { after cancel $TimeOutCode } if {$RequestsMade ne $RequestList && $ActualKeepAlive} { ::http::Log ^X$tk unexpected result - Script asked for "{$RequestList}" but got "{$RequestsMade}" - token $hToken } set ::httpTestScript::FOREVER 0 } return } proc httpTestScript::runHttpTestScript {scr} { variable TimeOutDone variable RequestsWhenStopped after idle [list namespace eval ::httpTestScript $scr] vwait ::httpTestScript::FOREVER # N.B. does not automatically execute in this namespace, unlike some other events. # Release when all requests have been served or have timed out. if {$TimeOutDone} { return -code error {test script timed out} } return $RequestsWhenStopped } proc httpTestScript::cleanupHttpTestScript {} { variable TimeOutDone variable RequestsWhenStopped if {![info exists RequestsWhenStopped]} { return -code error {Cleanup Failed: RequestsWhenStopped is undefined} } for {set i 1} {$i <= $RequestsWhenStopped} {incr i} { http::cleanup ::http::$i } return } tcl9.0.3/tests/httpTest.tcl0000644000175000017500000004174515104661341015247 0ustar sergeisergei# httpTest.tcl # # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # # Copyright © 2018 Keith Nash # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ------------------------------------------------------------------------------ # "Package" httpTest for analysis of Log output of http requests. # ------------------------------------------------------------------------------ # This is a specialised test kit for examining the presence, ordering, and # overlap of multiple HTTP transactions over a persistent ("Keep-Alive") # connection; and also for testing reconnection in accordance with RFC 7230 when # the connection is lost. # # This kit is probably not useful for other purposes. It depends on the # presence of specific Log commands in the http library, and it interprets the # logs that these commands create. # ------------------------------------------------------------------------------ package require http namespace eval ::http { variable TestStartTimeInMs [clock milliseconds] # catch {puts stdout "Start time (zero ms) is $TestStartTimeInMs"} } namespace eval ::httpTest { variable testResults {} variable testOptions array set testOptions { -verbose 0 -dotted 1 } # -verbose - 0 quiet 1 write to stdout 2 write more # -dotted - (boolean) use dots for absences in lists of transactions } proc httpTest::Puts {txt} { variable testOptions if {$testOptions(-verbose) > 0} { puts stdout $txt flush stdout } return } # http::Log # # A special-purpose logger used for running tests. # - Processes Log calls that have "^" in their arguments, and records them in # variable ::httpTest::testResults. # - Also writes them to stdout (using Puts) if ($testOptions(-verbose) > 0). # - Also writes Log calls that do not have "^", if ($testOptions(-verbose) > 1). proc http::Log {args} { variable TestStartTimeInMs set time [expr {[clock milliseconds] - $TestStartTimeInMs}] set txt [list $time {*}$args] if {[string first ^ $txt] >= 0} { ::httpTest::LogRecord $txt ::httpTest::Puts $txt } elseif {$::httpTest::testOptions(-verbose) > 1} { ::httpTest::Puts $txt } return } # The http::Log routine above needs the variable ::httpTest::testOptions # Set up to destroy it when that variable goes away. trace add variable ::httpTest::testOptions unset {apply {args { proc ::http::Log args {} }}} # Called by http::Log (the "testing" version) to record logs for later analysis. proc httpTest::LogRecord {txt} { variable testResults set pos [string first ^ $txt] set len [string length $txt] if {$pos > $len - 3} { puts stdout "Logging Error: $txt" puts stdout "Fix this call to Log in http-*.tm so it has ^ then\ a letter then a numeral." flush stdout } elseif {$pos < 0} { # Called by mistake. } else { set letter [string index $txt [incr pos]] set number [string index $txt [incr pos]] # Max 9 requests! lappend testResults [list $letter $number] } return } # ------------------------------------------------------------------------------ # Commands for analysing the logs recorded when calling http::geturl. # ------------------------------------------------------------------------------ # httpTest::TestOverlaps -- # # The main test for correct behaviour of pipelined and sequential # (non-pipelined) transactions. Other tests should be run first to detect # any inconsistencies in the data (e.g. absence of the elements that are # examined here). # # Examine the sequence $someResults for each transaction from 1 to $n, # ignoring any that are listed in $badTrans. # Determine whether the elements "B" to $term for one transaction overlap # elements "B" to $term for the previous and following transactions. # # Transactions in the list $badTrans are not included in "clean" or # "dirty", but their possible overlap with other transactions is noted. # Transactions in the list $notPiped are a subset of $badTrans, and # their possible overlap with other transactions is NOT noted. # # Arguments: # someResults - list of results, each of the form {letter numeral} # n - number of HTTP transactions # term - letter that indicated end of search range. "E" for testing # overlaps from start of request to end of response headers. # "F" to extend to the end of the response body. # msg - the cumulative message from sanity checks. Append to it only # to report a test failure. # badTrans - list of transaction numbers not to be assessed as "clean" or # "dirty" # notPiped - subset of badTrans. List of transaction numbers that cannot # taint another transaction by overlapping with it, because it # used a different socket. # # Return value: [list $msg $clean $dirty] # msg - warning messages: nothing will be appended to argument $msg if there # is an error with the test. # clean - list of transactions that have no overlap with other transactions # dirty - list of transactions that have YES overlap with other transactions proc httpTest::TestOverlaps {someResults n term msg badTrans notPiped} { variable testOptions # Check whether transactions overlap: set clean {} set dirty {} for {set i 1} {$i <= $n} {incr i} { if {$i in $badTrans} { continue } set myStart [lsearch -exact $someResults [list B $i]] set myEnd [lsearch -exact $someResults [list $term $i]] if {($myStart < 0 || $myEnd < 0)} { set res "Cannot find positions of transaction $i" append msg $res \n Puts $res } set overlaps {} for {set j $myStart} {$j <= $myEnd} {incr j} { lassign [lindex $someResults $j] letter number if {$number != $i && $letter ne "A" && $number ni $notPiped} { lappend overlaps $number } } if {[llength $overlaps] == 0} { set res "Transaction $i has no overlaps" Puts $res lappend clean $i if {$testOptions(-dotted)} { # N.B. results from different segments are concatenated. lappend dirty . } else { } } else { set res "Transaction $i overlaps with [join $overlaps { }]" Puts $res lappend dirty $i if {$testOptions(-dotted)} { # N.B. results from different segments are concatenated. lappend clean . } else { } } } return [list $msg $clean $dirty] } # httpTest::PipelineNext -- # # Test whether prevPair, pair are valid as consecutive elements of a pipelined # sequence (Start 1), (End 1), (Start 2), (End 2) ... # Numbers are integers increasing (by 1 if argument "any" is false), and need # not begin with 1. # The first element of the sequence has prevPair {} and is always passed as # valid. # # Arguments; # Start - string that labels the start of a segment # End - string that labels the end of a segment # prevPair - previous "pair" (list of string and number) element of a # sequence, or {} if argument "pair" is the first in the # sequence. # pair - current "pair" (list of string and number) element of a # sequence # any - (boolean) iff true, accept any increasing sequence of integers. # If false, integers must increase by 1. # # Return value - boolean, true iff the two pairs are valid consecutive elements. proc httpTest::PipelineNext {Start End prevPair pair any} { if {$prevPair eq {}} { return 1 } lassign $prevPair letter number lassign $pair newLetter newNumber if {$letter eq $Start} { return [expr {($newLetter eq $End) && ($newNumber == $number)}] } elseif {$any} { set nxt [list $Start [expr {$number + 1}]] return [expr {($newLetter eq $Start) && ($newNumber > $number)}] } else { set nxt [list $Start [expr {$number + 1}]] return [expr {($newLetter eq $Start) && ($newNumber == $number + 1)}] } } # httpTest::TestPipeline -- # # Given a sequence of "pair" elements, check that the elements whose string is # $Start or $End form a valid pipeline. Ignore other elements. # # Return value: {} if valid pipeline, otherwise a non-empty error message. proc httpTest::TestPipeline {someResults n Start End msg desc badTrans} { set sequence {} set prevPair {} set ok 1 set any [llength $badTrans] foreach pair $someResults { lassign $pair letter number if {($letter in [list $Start $End]) && ($number ni $badTrans)} { lappend sequence $pair if {![PipelineNext $Start $End $prevPair $pair $any]} { set ok 0 break } set prevPair $pair } } if {!$ok} { set res "$desc are not pipelined: {$sequence}" append msg $res \n Puts $res } return $msg } # httpTest::TestSequence -- # # Examine each transaction from 1 to $n, ignoring any that are listed # in $badTrans. # Check that each transaction has elements A to F, in alphabetical order. proc httpTest::TestSequence {someResults n msg badTrans} { variable testOptions for {set i 1} {$i <= $n} {incr i} { if {$i in $badTrans} { continue } set sequence {} foreach pair $someResults { lassign $pair letter number if {$number == $i} { lappend sequence $letter } } if {$sequence eq {A B C D E F}} { } else { set res "Wrong sequence for token ::http::$i - {$sequence}" append msg $res \n Puts $res if {"X" in $sequence} { set res "- and error(s) X" append msg $res \n Puts $res } if {"Y" in $sequence} { set res "- and warnings(s) Y" append msg $res \n Puts $res } } } return $msg } # # Arguments: # someResults - list of elements, each a list of a letter and a number # n - (positive integer) the number of HTTP requests # msg - accumulated warning messages # skipOverlaps - (boolean) whether to skip testing of transaction overlaps # badTrans - list of transaction numbers not to be assessed as "clean" or # "dirty" by their overlaps # for 1/2 includes all transactions # for 3/4 includes an increasing (with recursion) set that will not be included in the list because they are already handled. # notPiped - subset of badTrans. List of transaction numbers that cannot # taint another transaction by overlapping with it, because it # used a different socket. # # Return value: [list $msg $cleanE $cleanF $dirtyE $dirtyF] # msg - warning messages: nothing will be appended to argument $msg if there # is no error with the test. # cleanE - list of transactions that have no overlap with other transactions # (not considering response body) # dirtyE - list of transactions that have YES overlap with other transactions # (not considering response body) # cleanF - list of transactions that have no overlap with other transactions # (including response body) # dirtyF - list of transactions that have YES overlap with other transactions # (including response body) proc httpTest::MostAnalysis {someResults n msg skipOverlaps badTrans notPiped} { variable testOptions # Check that stages for "good" transactions are all present and correct: set msg [TestSequence $someResults $n $msg $badTrans] # Check that requests are pipelined: set msg [TestPipeline $someResults $n B C $msg Requests $notPiped] # Check that responses are pipelined: set msg [TestPipeline $someResults $n D F $msg Responses $notPiped] if {$skipOverlaps} { set cleanE {} set dirtyE {} set cleanF {} set dirtyF {} } else { Puts "Overlaps including response body (test for non-pipelined case)" lassign [TestOverlaps $someResults $n F $msg $badTrans $notPiped] msg cleanF dirtyF Puts "Overlaps without response body (test for pipelined case)" lassign [TestOverlaps $someResults $n E $msg $badTrans $notPiped] msg cleanE dirtyE } return [list $msg $cleanE $cleanF $dirtyE $dirtyF] } # httpTest::ProcessRetries -- # # Command to examine results for socket-changing records [PQR], # divide the results into segments for each connection, and analyse each segment # individually. # (Could add $sock to the logging to simplify this, but never mind.) # # In each segment, identify any transactions that are not included, and # any that are aborted, to assist subsequent testing. # # Prepend A records (socket-independent) to each segment for transactions that # were scheduled (by A) but not completed (by F). Pass each segment to # MostAnalysis for processing. proc httpTest::ProcessRetries {someResults n msg skipOverlaps notIncluded notPiped} { variable testOptions set nextRetry [lsearch -glob -index 0 $someResults {[PQR]}] if {$nextRetry < 0} { return [MostAnalysis $someResults $n $msg $skipOverlaps $notIncluded $notPiped] } set badTrans $notIncluded set tryCount 0 set try $nextRetry incr tryCount lassign [lindex $someResults $try] letter number Puts "Processing retry [lindex $someResults $try]" set beforeTry [lrange $someResults 0 $try-1] Puts [join $beforeTry \n] set afterTry [lrange $someResults $try+1 end] set dummyTry {} for {set i 1} {$i <= $n} {incr i} { set first [lsearch -exact $beforeTry [list A $i]] set last [lsearch -exact $beforeTry [list F $i]] if {$first < 0} { set res "Transaction $i was not started in connection number $tryCount" # So lappend it to badTrans and don't include it in the call below of MostAnalysis. # append msg $res \n Puts $res if {$i ni $badTrans} { lappend badTrans $i } else { } } elseif {$last < 0} { set res "Transaction $i was started but unfinished in connection number $tryCount" # So lappend it to badTrans and don't include it in the call below of MostAnalysis. # append msg $res \n Puts $res lappend badTrans $i lappend dummyTry [list A $i] } else { set res "Transaction $i was started and finished in connection number $tryCount" # So include it in the call below of MostAnalysis. # So lappend it to notIncluded and don't include it in the recursive call of # ProcessRetries which handles the later connections. # append msg $res \n Puts $res lappend notIncluded $i } } # Analyse the part of the results before the first replay: set HeadResults [MostAnalysis $beforeTry $n $msg $skipOverlaps $badTrans $notPiped] lassign $HeadResults msg cleanE1 cleanF1 dirtyE1 dirtyF1 # Pass the rest of the results to be processed recursively. set afterTry [concat $dummyTry $afterTry] set TailResults [ProcessRetries $afterTry $n $msg $skipOverlaps $notIncluded $notPiped] lassign $TailResults msg cleanE2 cleanF2 dirtyE2 dirtyF2 set cleanE [concat $cleanE1 $cleanE2] set cleanF [concat $cleanF1 $cleanF2] set dirtyE [concat $dirtyE1 $dirtyE2] set dirtyF [concat $dirtyF1 $dirtyF2] return [list $msg $cleanE $cleanF $dirtyE $dirtyF] } # httpTest::logAnalyse -- # # The main command called to analyse logs for a single test. # # Arguments: # n - (positive integer) the number of HTTP requests # skipOverlaps - (boolean) whether to skip testing of transaction overlaps # notIncluded - list of transaction numbers not to be assessed as "clean" or # "dirty" by their overlaps # notPiped - subset of notIncluded. List of transaction numbers that cannot # taint another transaction by overlapping with it, because it # used a different socket. # # Return value: [list $msg $cleanE $cleanF $dirtyE $dirtyF] # msg - warning messages: {} if there is no error with the test. # cleanE - list of transactions that have no overlap with other transactions # (not considering response body) # dirtyE - list of transactions that have YES overlap with other transactions # (not considering response body) # cleanF - list of transactions that have no overlap with other transactions # (including response body) # dirtyF - list of transactions that have YES overlap with other transactions # (including response body) proc httpTest::logAnalyse {n skipOverlaps notIncluded notPiped} { variable testResults variable testOptions # Check that each data item has the correct form {letter numeral}. set ii 0 set ok 1 foreach pair $testResults { lassign $pair letter number if { [string match {[A-Z]} $letter] && [string match {[0-9]} $number] } { # OK } else { set ok 0 set res "Error: testResults has bad element {$pair} at position $ii" append msg $res \n Puts $res } incr ii } if {!$ok} { return $msg } set msg {} Puts [join $testResults \n] ProcessRetries $testResults $n $msg $skipOverlaps $notIncluded $notPiped # N.B. Implicit Return. } proc httpTest::cleanupHttpTest {} { variable testResults set testResults {} return } proc httpTest::setHttpTestOptions {key args} { variable testOptions if {$key ni {-dotted -verbose}} { return -code error {valid options are -dotted, -verbose} } set testOptions($key) {*}$args } namespace eval httpTest { namespace export cleanupHttpTest logAnalyse setHttpTestOptions } tcl9.0.3/tests/httpProxySquidConfigForWindowsDiladele.zip0000644000175000017500000000525515104661341023267 0ustar sergeisergeiPK ɫWu:XX squid.passalice:$apr1$4a520VKa$b877PpPS2srrrR5l3NidM1 bob:$apr1$iBYDFkGN$CR/O9wyrOVCgSZ2W3BBhW0 PKsW )/+B squid1.confU{@è1D-#FsA&x8cӲvnI=Pco~y<{1E" .xQKRp)FwB'XQ/rE,QkH,`++YF+ݲ +  9ƣqaP ?okfFRrɂ%kY vv18H! Z6(,B)+6X;F0ZaQѿrY'#Ih9g]vKů xnB\5=٣+M2 Px:͋tYJe4ov;s`4(1qyZyzKqdI%rʄl?AQ:=UBaFEI8 hY sйutzg> <ǂ] c0XTQd| LG{U';7[TךTD=1:p_]k <>-+TBe6CPb[KD vDĨ nFSJvwr>a{:G*0k&@c\)E|nx@QRd9yY'RYO^dS(t!c:L\+˜.ƨV] gumUuMno֒EHҥw9,o8]nVT!_C&?7 7b1_‡ٻ9_th^Mt:{dO_O..mU 1CmfѱMr{X]邥ZJ kӿ]Ԍ'OZTesBa8p9n}_%G3vo]]nrZR ZCKrĦ %3kHsƖf;f 0l?M} :!YR4; aHX UueDr Z@ʔvk*9ImbЂ!P[QlJ420uP :bϧA.b2Xk"`)_9ƆcHH7t, qn.5ѴbIxBxO)r,!NscPD8̉ 2#"R13 CRNKpP4,$5E|Vc')zYbQM EgHS lOӹ0H,!W8F97>sGW5 <"IA V❜a{]`rVA_~ yy-‡Ż%,_|`^̖3x|.jϗW:]]Uqb MMf Q&9]#U\c7B ]D 6DФ91OBn6~W}+XԵ5Y%R:{D$µ@aozo2xXBsٛw/gM@h}\ OF**fI%^ۖP΍Q -ʍ=?Չ=:`hI%'3|g]LSܙX]x]crb}W;LM!'8MixijŨlܐ|XaPX9*3z?bpstN5ũ{rU5V̤ҥ1}BX#k"/SE@0"v=(vgc,2M?ݵdsh-)/K`j -F^"| tÄ7wz,i~/̥"֜dԍ_}A:a'oYQJkh$~PK? ɫWu:XX $ squid.pass SDg(PK?sW )/+B $ squid1.conf 0,P(PK?Waj^M $squid2.conf (PK tcl9.0.3/tests/httpProxySquidConfigForEL8.tar.gz0000644000175000017500000000433215104661341021177 0ustar sergeisergeiOc[mS:W+T`gC$vȝp\H.s(bKdC=0 ҎOI,=ϫԒ,O9g5l2n0{n8^8~{d?BVQ.3,z#8Ͼŧ zYڲPQf<&_7+fYuT^+>)6*~)ϙ 09N3\쩒Llқ$&RV|c$W ŔqFc@pnspMy4{7猈J ~jkmCn r"aB"2LG 5 Oo˶f(l$]<5vb @?C!("I&/j;24cݠ O@K:`Kd&8J(ȃ{͙@ʰT lQxtCFiLC-c 15`[L94 .ΈAvj;_ dsMDa/ȁZbƇ 9}tE.q~IttփN|,n%AYWh _hj;c mcWaŠLxiay.W8S!E`Ӄ9Ƣe踁 {Z-#4zb3}ÔA"*="07[ЂDk,j2<6Y |'_Eu$35Sαiy_ Fa C08Sʃ`_Ya"I`}CLjml8ۀ%7e.zZOWZ8e/.ҼˌՍ 3dW%-YQU#2kS:}P>ԁB8+TeWeW+[ߨ^Qvt+VS,skl90?W?9imT8upۣfgW !ԱF|Tpw]>z{7dO{nzYV?ݳ{\7huK *//[ }oSwAǷ Mhtڎ5}{QG2îL-tgV3 0av&x_CyӪ. Tɺq= =2<*l{!QepG}sqE&8Cۧ]ؐ4޼9j1%V2nܬCf2|ڿ3ؾ(%ǵ>Š#(qu:5ŵg Qj]y򡀶FAw!\Bi/@[oB[!mn2CyE_SVK=fd`t3POHhGwRI j-Hc)_p -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.2.$ThreadLevel {https no-proxy with-auth valid-creds-provided} -constraints {needsTls knownTwapiFullBugThreadUsed} -setup { http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.3.$ThreadLevel {http with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- HttpProxy 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.4.$ThreadLevel {https with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- SecureProxy 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.5.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- HttpProxy 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.6.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- SecureProxy 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.7.$ThreadLevel {http with-proxy ipv4 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.7x.$ThreadLevel {http with-proxy ipv4 with-auth 1st request no-creds-provided; check that 2nd request with creds is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] http::config -proxyauth $aliceCreds } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.8.$ThreadLevel {https with-proxy ipv4 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- SecureProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.8x.$ThreadLevel {https with-proxy ipv4 with-auth 1st request no-creds-provided; check that 2nd request with creds is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] http::config -proxyauth $aliceCreds } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- SecureProxy 0 0 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.9.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.9p.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works, pipelining requested and possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] after idle { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.9x.$ThreadLevel {http with-proxy ipv6 with-auth 1st request no-creds-provided; check that 2nd request with creds is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] http::config -proxyauth $aliceCreds } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.10.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- SecureProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.10p.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided; check that 2nd valid request with creds is possible, and keep-alive works, pipelining requested and possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $aliceCreds } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] after idle { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token0; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- SecureProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-3.10x.$ThreadLevel {https with-proxy ipv6 with-auth 1st request no-creds-provided; check that 2nd request with creds is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] http::config -proxyauth $aliceCreds } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 200 -- SecureProxy 0 0 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.1.$ThreadLevel {http no-proxy with-auth no-creds-provided} -constraints {} -setup { http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.2.$ThreadLevel {https no-proxy with-auth no-creds-provided} -constraints {needsTls knownTwapiFullBugThreadUsed} -setup { http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.3.$ThreadLevel {http with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- HttpProxy 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.4.$ThreadLevel {https with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.5.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- HttpProxy 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.6.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.7.$ThreadLevel {http with-proxy ipv4 with-auth no-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.8.$ThreadLevel {https with-proxy ipv4 with-auth no-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.9.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.9p.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided; check that 2nd request is possible, pipelining requested and possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] after idle { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token0; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 0 0 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.10.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-4.10p.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided; check that 2nd request is possible, pipelining requested but not possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth {} } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] after idle { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 0 0 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.1.$ThreadLevel {http no-proxy with-auth bad-creds-provided} -constraints {} -setup { http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.2.$ThreadLevel {https no-proxy with-auth bad-creds-provided} -constraints {needsTls knownTwapiFullBugThreadUsed} -setup { http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 200 -- none 0 0 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.3.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- HttpProxy 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.4.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.5.$ThreadLevel {http with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquidAuth} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl http://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- HttpProxy 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.6.$ThreadLevel {https with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds } -body { after $fetchPause set token [http::geturl https://www.google.com/] set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*]" } -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1} -cleanup { catch {http::cleanup $token} unset -nocomplain token ri res pos1 pos2 http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.7.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.7p.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provided; check that 2nd request is possible, pipelining requested and possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] # Use the same caution as for the corresponding https test. after idle { after $fetchPause set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.8.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.8p.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provided; check that 2nd request is possible, pipelining requested but not possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds } -body { after $fetchPause set can0 [after 6000 {http::reset $token0; set ${token0}(z) timeout}] set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. after idle { after $fetchPause set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can } vwait ${token0}(z) after cancel $can0 set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can0 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.9.$ThreadLevel {http with-proxy ipv6 with-auth bad-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds after $fetchPause set token0 [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # Use the same caution as for the corresponding https test. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl http://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- HttpProxy 1 1 -- -1 done 1} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } test httpProxy-5.10.$ThreadLevel {https with-proxy ipv6 with-auth bad-creds-provided; check that 2nd request is possible} -constraints {needsSquidAuth needsTls knownTwapiFullBugThreadlevelAny} -setup { array unset ::http::socketMapping http::config -proxyhost $a6host -proxyport $a6port -proxynot {::1 localhost} -proxyauth $badCreds after $fetchPause set token0 [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000] } -body { after $fetchPause # If a bug passes the socket of a failed CONNECT to the main request, an infinite # wait can occur despite -timeout. Fix this with http::reset; to do this the call # to http::geturl must be async so we have $token for use as argument of reset. set can [after 6000 {http::reset $token; set ${token}(z) timeout}] set token [http::geturl https://www.google.com/ -keepalive 1 -timeout 5000 -command stopMe] vwait ${token}(z) after cancel $can set ri [http::responseInfo $token] set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization] set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds] set same [string equal [set ${token0}(sock)] [set ${token}(sock)]] set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] --\ [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}] --\ [lsearch -glob [array get ::http::socketMapping] HTTP_PLACEHOLDER_*] [set ${token}(z)] $same" } -result {complete ok 407 -- SecureProxyFailed 1 1 -- -1 done 0} -cleanup { catch {http::cleanup $token0} catch {http::cleanup $token} unset -nocomplain token0 token ri res pos1 pos2 can same array unset ::http::socketMapping http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {} } # cleanup unset -nocomplain n4host n6host n4port n6port a4host a6host a4port a6port aliceCreds badCreds fetchPause rename bgerror {} rename stopMe {} if {[testConstraint ThreadLevelSummary]} { putsBlurb ::tcltest::cleanupTests rename putsBlurb {} } # Local variables: # mode: tcl # End: tcl9.0.3/tests/httpPipeline.test0000644000175000017500000006021215104661341016260 0ustar sergeisergei# httpPipeline.test # # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # # Copyright © 2018 Keith Nash # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } package require http 2.10 # ------------------------------------------------------------------------------ # (0) Socket Creation in Thread, which triples the number of tests. # ------------------------------------------------------------------------------ # To write a separate summary for each value of ThreadLevel, set constraint ThreadLevelSummary. #testConstraint ThreadLevelSummary 0 if 0 { # For debugging: run with a single value of ThreadLevel: 0|1|2 set ThreadLevel 0 testConstraint ThreadLevelSummary 1 } if {![info exists ThreadLevel]} { if {[catch {package require Thread}] == 0} { set ValueRange {0 1 2} } else { set ValueRange {0 1} } # For each value of ThreadLevel, source this file recursively in the # same interpreter. foreach ThreadLevel $ValueRange { source [info script] } catch {unset ThreadLevel} catch {unset ValueRange} if {![testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } return } catch {puts "==== Test with ThreadLevel $ThreadLevel ===="} http::config -threadlevel $ThreadLevel set sourcedir [file normalize [file dirname [info script]]] source [file join $sourcedir httpTest.tcl] source [file join $sourcedir httpTestScript.tcl] # ------------------------------------------------------------------------------ # (1) Define the test scripts that will be used to generate logs for analysis - # and also define the "correct" results. # ------------------------------------------------------------------------------ proc ReturnTestScriptAndResult {ca cb delay te} { switch -- $ca { 1 {set start { START KEEPALIVE 0 PIPELINE 0 }} 2 {set start { START KEEPALIVE 0 PIPELINE 1 }} 3 {set start { START KEEPALIVE 1 PIPELINE 0 }} 4 {set start { START KEEPALIVE 1 PIPELINE 1 }} default { return -code error {no matching script} } } set middle " [list DELAY $delay] " switch -- $cb { 1 {set end { GET a GET b GET c GET a STOP } set resShort {1 ? ? ?} set resLong {1 2 3 4} } 2 {set end { GET a HEAD b GET c HEAD a HEAD c STOP } set resShort {1 ? ? ? ?} set resLong {1 2 3 4 5} } 3 {set end { HEAD a GET b HEAD c HEAD b GET a GET b STOP } set resShort {1 ? ? ? ? ?} set resLong {1 2 3 4 5 6} } 4 {set end { GET a GET b GET c GET a POST b address=home code=brief paid=yes GET c GET a GET b GET c STOP } set resShort {1 ? ? ? 5 ? ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 5 {set end { POST a address=home code=brief paid=yes POST b address=home code=brief paid=yes POST c address=home code=brief paid=yes POST a address=home code=brief paid=yes POST b address=home code=brief paid=yes POST c address=home code=brief paid=yes POST a address=home code=brief paid=yes POST b address=home code=brief paid=yes POST c address=home code=brief paid=yes STOP } set resShort {1 2 3 4 5 6 7 8 9} set resLong {1 2 3 4 5 6 7 8 9} } 6 {set end { POST a address=home code=brief paid=yes GET b address=home code=brief paid=yes POST c address=home code=brief paid=yes GET a address=home code=brief paid=yes GET b address=home code=brief paid=yes POST c address=home code=brief paid=yes POST a address=home code=brief paid=yes HEAD b address=home code=brief paid=yes GET c address=home code=brief paid=yes STOP } set resShort {1 ? 3 ? ? 6 7 ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 7 {set end { GET b address=home code=brief paid=yes POST a address=home code=brief paid=yes GET a address=home code=brief paid=yes POST c address=home code=brief paid=yes GET b address=home code=brief paid=yes HEAD b address=home code=brief paid=yes POST c address=home code=brief paid=yes POST a address=home code=brief paid=yes GET c address=home code=brief paid=yes STOP } set resShort {1 2 ? 4 ? ? 7 8 ?} set resLong {1 2 3 4 5 6 7 8 9} } 8 {set end { # Telling the server to close the connection. GET a GET b close=y GET c GET a GET b GET c GET a GET b GET c STOP } set resShort {1 ? 3 ? ? ? ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 9 {set end { # Telling the server to close the connection. GET a POST b close=y address=home code=brief paid=yes GET c GET a GET b GET c GET a GET b GET c STOP } set resShort {1 2 3 ? ? ? ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 10 {set end { # Telling the server to close the connection. GET a GET b close=y POST c address=home code=brief paid=yes GET a GET b GET c GET a GET b GET c STOP } set resShort {1 ? 3 ? ? ? ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 11 {set end { # Telling the server to close the connection twice. GET a GET b close=y GET c GET a GET b close=y GET c GET a GET b GET c STOP } set resShort {1 ? 3 ? ? 6 ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 12 {set end { # Telling the server to delay before sending the response. GET a GET b delay=1 GET c GET a GET b STOP } set resShort {1 ? ? ? ?} set resLong {1 2 3 4 5} } 13 {set end { # Making the server close the connection (time out). GET a WAIT 2000 GET b GET c GET a GET b STOP } set resShort {1 2 ? ? ?} set resLong {1 2 3 4 5} } 14 {set end { # Making the server close the connection (time out) twice. GET a WAIT 2000 GET b GET c GET a WAIT 2000 GET b GET c GET a GET b GET c STOP } set resShort {1 2 ? ? 5 ? ? ? ?} set resLong {1 2 3 4 5 6 7 8 9} } 15 {set end { POST a address=home code=brief paid=yes POST b address=home code=brief paid=yes close=y delay=1 POST c address=home code=brief paid=yes delay=1 POST a address=home code=brief paid=yes close=y WAIT 2000 POST b address=home code=brief paid=yes delay=1 POST c address=home code=brief paid=yes close=y POST a address=home code=brief paid=yes POST b address=home code=brief paid=yes close=y POST c address=home code=brief paid=yes STOP } set resShort {1 2 3 4 5 6 7 8 9} set resLong {1 2 3 4 5 6 7 8 9} } 16 {set end { POST a address=home code=brief paid=yes GET b address=home code=brief paid=yes POST c address=home code=brief paid=yes close=y GET a address=home code=brief paid=yes GET b address=home code=brief paid=yes close=y POST c address=home code=brief paid=yes WAIT 2000 POST a address=home code=brief paid=yes HEAD b address=home code=brief paid=yes close=y GET c address=home code=brief paid=yes STOP } set resShort {1 ? 3 4 ? 6 7 ? 9} set resLong {1 2 3 4 5 6 7 8 9} } 17 {set end { GET b address=home code=brief paid=yes POST a address=home code=brief paid=yes GET a address=home code=brief paid=yes POST c address=home code=brief paid=yes close=y GET b address=home code=brief paid=yes HEAD b address=home code=brief paid=yes close=y POST c address=home code=brief paid=yes WAIT 2000 POST a address=home code=brief paid=yes WAIT 2000 GET c address=home code=brief paid=yes STOP } set resShort {1 2 3 4 5 ? 7 8 9} set resLong {1 2 3 4 5 6 7 8 9} } 18 {set end { REPOST 0 GET a WAIT 2000 POST b address=home code=brief paid=yes GET c GET a STOP } set resShort {1 2 ? ?} set resLong {1 2 3 4} # resShort is overwritten below for the case ($te == 1). } 19 {set end { REPOST 0 GET a WAIT 2000 GET b address=home code=brief paid=yes GET c GET a STOP } set resShort {1 2 ? ?} set resLong {1 2 3 4} } 20 {set end { POSTFRESH 1 GET a WAIT 2000 POST b address=home code=brief paid=yes GET c GET a STOP } set resShort {1 3 ?} set resLong {1 3 4} } 21 {set end { POSTFRESH 1 GET a WAIT 2000 GET b address=home code=brief paid=yes GET c GET a STOP } set resShort {1 2 ? ?} set resLong {1 2 3 4} } 22 {set end { GET a WAIT 2000 KEEPALIVE 0 POST b address=home code=brief paid=yes KEEPALIVE 1 GET c GET a STOP } set resShort {1 3 ?} set resLong {1 3 4} } 23 {set end { GET a WAIT 2000 KEEPALIVE 0 GET b address=home code=brief paid=yes KEEPALIVE 1 GET c GET a STOP } set resShort {1 3 ?} set resLong {1 3 4} } 24 {set end { GET a KEEPALIVE 0 POST b address=home code=brief paid=yes KEEPALIVE 1 GET c GET a STOP } set resShort {1 ? ?} set resLong {1 3 4} } 25 {set end { GET a KEEPALIVE 0 GET b address=home code=brief paid=yes KEEPALIVE 1 GET c GET a STOP } set resShort {1 ? ?} set resLong {1 3 4} } default { return -code error {no matching script} } } if {$ca < 3} { # Not Keep-Alive. set result "Passed all sanity checks." } elseif {$ca == 3} { # Keep-Alive, not pipelined. set result {} append result "Passed all sanity checks.\n" append result "Have overlaps including response body:\n" } else { # Keep-Alive, pipelined: ($ca == 4) set result {} append result "Passed all sanity checks.\n" append result "Overlap-free without response body:\n" append result "$resShort" } # - The special case of test *.18*-testEof needs test results to be # individually written. # - These test -repost 0 when there is a POST to apply it to, and the server # timeout has not been detected. if {($cb == 18) && ($te == 1)} { if {$ca < 3} { # Not Keep-Alive. set result "Passed all sanity checks." } elseif {$ca == 3 && $delay == 0} { # Keep-Alive, not pipelined. set result [MakeMessage { |Problems with sanity checks: |Wrong sequence for token ::http::2 - {A B C D X X X} |- and error(s) X |Wrong sequence for token ::http::3 - {A X X} |- and error(s) X |Wrong sequence for token ::http::4 - {A X X X} |- and error(s) X | |Have overlaps including response body: | }] } elseif {$ca == 3} { # Keep-Alive, not pipelined. set result [MakeMessage { |Problems with sanity checks: |Wrong sequence for token ::http::2 - {A B C D X X X} |- and error(s) X | |Have overlaps including response body: | }] } elseif {$delay == 0} { # Keep-Alive, pipelined: ($ca == 4) set result [MakeMessage { |Problems with sanity checks: |Wrong sequence for token ::http::2 - {A B C D X X X} |- and error(s) X |Wrong sequence for token ::http::3 - {A X X} |- and error(s) X |Wrong sequence for token ::http::4 - {A X X X} |- and error(s) X | |Overlap-free without response body: | }] } else { set result [MakeMessage { |Problems with sanity checks: |Wrong sequence for token ::http::2 - {A B C D X X X} |- and error(s) X | |Overlap-free without response body: | }] } } return [list "$start$middle$end" $result] } # ------------------------------------------------------------------------------ # Proc MakeMessage # ------------------------------------------------------------------------------ # WHD's one-line command to generate multi-line strings from readable code. # # Example: # set blurb [MakeMessage { # |This command allows multi-line strings to be created with readable # |code, and without breaking the rules for indentation. # | # |The command shifts the entire block of text to the left, omitting # |the pipe character and the spaces to its left. # }] # ------------------------------------------------------------------------------ proc MakeMessage {in} { regsub -all -line {^\s*\|} [string trim $in] {} # N.B. Implicit Return. } proc ReturnTestScript {ca cb delay te} { lassign [ReturnTestScriptAndResult $ca $cb $delay $te] script result return $script } proc ReturnTestResult {ca cb delay te} { lassign [ReturnTestScriptAndResult $ca $cb $delay $te] script result return $result } # ------------------------------------------------------------------------------ # (2) Command to run a test script and use httpTest to analyse the logs. # ------------------------------------------------------------------------------ namespace import httpTestScript::runHttpTestScript namespace import httpTestScript::cleanupHttpTestScript namespace import httpTest::cleanupHttpTest namespace import httpTest::logAnalyse namespace import httpTest::setHttpTestOptions proc RunTest {header footer delay te} { set num [runHttpTestScript [ReturnTestScript $header $footer $delay $te]] set skipOverlaps 0 set notPiped {} set notIncluded {} # -------------------------------------------------------------------------- # Custom code for specific tests # -------------------------------------------------------------------------- if {$header < 3} { set skipOverlaps 1 for {set i 1} {$i <= $num} {incr i} { lappend notPiped $i } } elseif {$header > 2 && $footer == 18 && $te == 1} { set skipOverlaps 1 if {$delay == 0} { # Transaction 1 is conventional. # Check that transactions 2,3,4 are cancelled. set notPiped {1} set notIncluded $notPiped } else { # Transaction 1 is conventional. # Check that transaction 2 is cancelled. # The timing of transactions 3 and 4 is uncertain. set notPiped {1 3 4} set notIncluded $notPiped } } elseif {$footer in {20 22 23 24 25}} { # Transaction 2 uses its own socket. set notPiped 2 set notIncluded $notPiped } else { } # -------------------------------------------------------------------------- # End of custom code for specific tests # -------------------------------------------------------------------------- set Results [logAnalyse $num $skipOverlaps $notIncluded $notPiped] lassign $Results msg cleanE cleanF dirtyE dirtyF if {$msg eq {}} { set msg "Passed all sanity checks." } else { set msg "Problems with sanity checks:\n$msg" } if 0 { puts $msg puts "Overlap-free including response body:\n$cleanF" puts "Have overlaps including response body:\n$dirtyF" puts "Overlap-free without response body:\n$cleanE" puts "Have overlaps without response body:\n$dirtyE" } if {$header < 3} { # No ordering, just check that transactions all finish set result $msg } elseif {$header == 3} { # Not pipelined - check overlaps with response body. set result "$msg\nHave overlaps including response body:\n$dirtyF" } else { # Pipelined - check overlaps without response body. Check that the # first request, the first requests after replay, and POSTs are clean. set result "$msg\nOverlap-free without response body:\n$cleanE" } set ::nTokens $num return $result } # ------------------------------------------------------------------------------ # (3) VERBOSITY CONTROL # ------------------------------------------------------------------------------ # If tests fail, run an individual test with -verbose 1 or 2 for diagnosis. # If still obscure, uncomment #Log and ##Log lines in the http package. # ------------------------------------------------------------------------------ setHttpTestOptions -verbose 0 # ------------------------------------------------------------------------------ # (4) Define the base URLs used for testing. Each must have a query string. # ------------------------------------------------------------------------------ # - A HTTP/1.1 server is required. It should be configured to provide # persistent connections when requested to do so, and to close these # connections if they are idle for one second. # - The resource must be served with status 200 in response to a valid GET or # POST. # - The value of "page" is always specified in the query-string. Different # resources for the three values of "page" allow testing of both chunked and # unchunked transfer encoding. # - The variables "close" and "delay" may be specified in the query-string (for # a GET) or the request body (for a POST). # - "delay" is a numerical value in seconds, and causes the server to delay # the response, including headers. # - "close", if it has the value "y", instructs the server to close the # connection ater the current request. # - Any other variables should be ignored. # ------------------------------------------------------------------------------ namespace eval ::httpTestScript { variable URL array set URL { a http://test-tcl-http.kerlin.org/index.html?page=privacy b http://test-tcl-http.kerlin.org/index.html?page=conditions c http://test-tcl-http.kerlin.org/index.html?page=welcome } } # ------------------------------------------------------------------------------ # (5) Define the tests # ------------------------------------------------------------------------------ # Constraints: # - serverNeeded - the URLs defined at (4) must be available, and must have the # properties specified there. # - duplicate - the value of -pipeline does not matter if -keepalive 0 # - timeout1s - tests that work correctly only if the server closes # persistent connections after one second. # # Server timeout of persistent connections should be 1s. Delays of 2s are # intended to cause timeout. # Servers are usually configured to use a longer timeout: this will cause the # tests to fail. The "2000" could be replaced with a larger number, but the # tests will then be inconveniently slow. # ------------------------------------------------------------------------------ #testConstraint serverNeeded 1 #testConstraint timeout1s 1 #testConstraint duplicate 1 # ------------------------------------------------------------------------------ # Proc SetTestEof - to edit the command ::http::KeepSocket # ------------------------------------------------------------------------------ # The usual line in command ::http::KeepSocket is " set TEST_EOF 0". # Whether the value set in the file is 0 or 1, change it here to the value # specified by the argument. # # It is worth doing all tests for both values of the argument. # # test 0 - ::http::KeepSocket is unchanged, detects server eof where possible # and closes the connection. # test 1 - ::http::KeepSocket is edited, does not detect server eof, so the # reaction to finding server eof can be tested without the difficulty # of testing in the few milliseconds of an asynchronous close event. # ------------------------------------------------------------------------------ proc SetTestEof {test} { set body [info body ::http::KeepSocket] set subs " set TEST_EOF $test" set count [regsub -line -all -- {^\s*set TEST_EOF .*$} $body $subs newBody] if {$count != 1} { return -code error {proc ::http::KeepSocket has unexpected form} } proc ::http::KeepSocket {token} $newBody return } for {set header 1} {$header <= 4} {incr header} { if {$header == 4} { setHttpTestOptions -dotted 1 set match glob } else { setHttpTestOptions -dotted 0 set match exact } if {$header == 2} { set cons0 {serverNeeded duplicate} } else { set cons0 serverNeeded } for {set footer 1} {$footer <= 25} {incr footer} { foreach {delay label} { 0 a 1 b 2 c 3 d 5 e 8 f 12 g 100 h 500 i 2000 j } { foreach te {0 1} { if {$te} { set tag testEof } else { set tag normal } set suffix {} set cons $cons0 # ------------------------------------------------------------------ # Custom code for individual tests # ------------------------------------------------------------------ if {$footer in {18}} { # Custom code: if {($label eq "j") && ($te == 1)} { continue } if {$te == 1} { # The test (of REPOST 0) is useful if tag is "testEof" # (server timeout without client reaction). The same test # has a different result if tag is "normal". set suffix " - extra test for -repost 0 - ::http::2 must be" append suffix " cancelled" if {($delay == 0)} { append suffix ", along with ::http::3 ::http::4 if" append suffix " the test creates these before ::http::2" append suffix " is cancelled" } } else { } } elseif {$footer in {19}} { set suffix " - extra test for -repost 0" } elseif {$footer in {20 21}} { set suffix " - extra test for -postfresh 1" if {($footer == 20)} { append suffix " - ::http::2 uses a separate socket" append suffix ", other requests use a persistent connection" } } elseif {$footer in {22 23 24 25}} { append suffix " - ::http::2 uses a separate socket" append suffix ", other requests use a persistent connection" } else { } if {($footer >= 13 && $footer <= 23)} { # Test use WAIT and depend on server timeout before this time. lappend cons timeout1s } # ------------------------------------------------------------------ # End of custom code. # ------------------------------------------------------------------ set name "pipeline test header $header footer $footer delay $delay $tag$suffix" # Here's the test: test httpPipeline-${header}.${footer}${label}-${tag}-$ThreadLevel $name \ -constraints $cons \ -setup [string map [list TE $te] { # Restore default values for tests: http::config -pipeline 1 -postfresh 0 -repost 1 http::init set http::http(uid) 0 SetTestEof {TE} }] -body [list RunTest $header $footer $delay $te] -cleanup { # Restore default values for tests: http::config -pipeline 1 -postfresh 0 -repost 1 cleanupHttpTestScript SetTestEof 0 cleanupHttpTest after 2000 # Wait for persistent sockets on the server to time out. } -result [ReturnTestResult $header $footer $delay $te] -match $match } } } } # ------------------------------------------------------------------------------ # (*) Notes on tests *.18*-testEof, *.19*-testEof - these test -repost 0 # ------------------------------------------------------------------------------ # These tests are a bit awkward because the main test kit analyses whether all # requests are satisfied, with retries if necessary, and it has result analysis # for processing retry logs. # - *.18*-testEof tests that certain requests are NOT satisfied, so the analysis # is a one-off. # - Tests *.18a-testEof depend on client/server timing - the test needs to call # http::geturl for all requests before the POST (request 2) is cancelled. # We test that requests 2, 3, 4 are all cancelled. # - Other tests *.18*-testEof may not request 3 and 4 in time for the to be # added to the write queue before request 2 is completed. We simply check that # request 2 is cancelled. # - The behaviour is different if all connections are allowed to time out # (label "j"). This case is not needed to test -repost 0, and is omitted. # - Tests *.18*-normal and *.19* are conventional (-repost 0 should have no # effect). # ------------------------------------------------------------------------------ unset header footer delay label suffix match cons name te namespace delete ::httpTest namespace delete ::httpTestScript if {[testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } tcl9.0.3/tests/httpd11.tcl0000644000175000017500000002015015104661341014700 0ustar sergeisergei# httpd11.tcl -- -*- tcl -*- # # A simple httpd for testing HTTP/1.1 client features. # Not suitable for use on a internet connected port. # # Copyright © 2009 Pat Thoyts # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package require Tcl proc ::tcl::dict::get? {dict key} { if {[dict exists $dict $key]} { return [dict get $dict $key] } return } namespace ensemble configure dict \ -map [linsert [namespace ensemble configure dict -map] end get? ::tcl::dict::get?] proc make-chunk-generator {data {size 4096}} { variable _chunk_gen_uid if {![info exists _chunk_gen_uid]} {set _chunk_gen_uid 0} set lambda {{data size} { set pos 0 yield while {1} { set payload [string range $data $pos [expr {$pos + $size - 1}]] incr pos $size set chunk [format %x [string length $payload]]\r\n$payload\r\n yield $chunk if {![string length $payload]} {return} } }} set name chunker[incr _chunk_gen_uid] coroutine $name ::apply $lambda $data $size return $name } proc get-chunks {data {compression gzip}} { switch -exact -- $compression { gzip { set data [zlib gzip $data] } deflate { set data [zlib deflate $data] } compress { set data [zlib compress $data] } } set data "" set chunker [make-chunk-generator $data 671] while {[string length [set chunk [$chunker]]]} { append data $chunk } return $data } proc blow-chunks {data {ochan stdout} {compression gzip}} { switch -exact -- $compression { gzip { set data [zlib gzip $data] } deflate { set data [zlib deflate $data] } compress { set data [zlib compress $data] } } set chunker [make-chunk-generator $data 671] while {[string length [set chunk [$chunker]]]} { puts -nonewline $ochan $chunk } return } proc mime-type {filename} { switch -exact -- [file extension $filename] { .htm - .html { return {text text/html}} .png { return {binary image/png} } .jpg { return {binary image/jpeg} } .gif { return {binary image/gif} } .css { return {text text/css} } .xml { return {text text/xml} } .xhtml {return {text application/xml+html} } .svg { return {text image/svg+xml} } .txt - .tcl - .c - .h { return {text text/plain}} } return {binary text/plain} } proc Puts {chan s} {puts $chan $s; puts $s} proc Service {chan addr port} { chan event $chan readable [info coroutine] while {1} { set meta {} chan configure $chan -buffering line -encoding iso8859-1 -translation crlf chan configure $chan -blocking 0 yield while {[gets $chan line] < 0} { if {[eof $chan]} {chan event $chan readable {}; close $chan; return} yield } if {[eof $chan]} {chan event $chan readable {}; close $chan; return} foreach {req url protocol} {GET {} HTTP/1.1} break regexp {^(\S+)\s+(.*)\s(\S+)?$} $line -> req url protocol puts $line while {[gets $chan line] > 0} { if {[regexp {^([^:]+):(.*)$} $line -> key val]} { puts [list $key [string trim $val]] lappend meta [string tolower $key] [string trim $val] } yield } set encoding identity set transfer "" set close 1 set type text/html set code "404 Not Found" set data "Error 404" append data "

    Not Found

    Try again.

    " if {[scan $url {%[^?]?%s} path query] < 2} { set query "" } switch -exact -- $req { GET - HEAD { } POST { # Read the query. set qlen [dict get? $meta content-length] if {[string is integer -strict $qlen]} { chan configure $chan -buffering none -translation binary while {[string length $query] < $qlen} { append query [read $chan $qlen] if {[string length $query] < $qlen} {yield} } # Check for excess query bytes [Bug 2715421] if {[dict get? $meta x-check-query] eq "yes"} { chan configure $chan -blocking 0 append query [read $chan] } } } default { # invalid request error 5?? } } if {$query ne ""} {puts $query} set path [string trimleft $path /] set path [file join [pwd] $path] if {[file exists $path] && [file isfile $path]} { foreach {what type} [mime-type $path] break set f [open $path r] if {$what eq "binary"} { chan configure $f -translation binary } else { chan configure $f -encoding utf-8 } set data [read $f] close $f set code "200 OK" set close [expr {[dict get? $meta connection] eq "close"}] } if {$protocol eq "HTTP/1.1"} { foreach enc [split [dict get? $meta accept-encoding] ,] { set enc [string trim $enc] # The current implementation of "compress" appears to be # incorrect (bug [a13b9d0ce1]). Keep it here for # experimentation only. The tests that use it have the # constraint "badCompress". The client code in http has # been removed, but can be restored from comments if # experimentation is desired. if {$enc in {deflate gzip compress}} { set encoding $enc break } } set transfer chunked } else { set close 1 } set nosendclose 0 set msdeflate 0 foreach pair [split $query &] { if {[scan $pair {%[^=]=%s} key val] != 2} {set val ""} switch -exact -- $key { nosendclose {set nosendclose 1} close {set close 1 ; set transfer 0} transfer {set transfer $val} content-type {set type $val} msdeflate {set msdeflate $val} } } if {$protocol eq "HTTP/1.1"} { set nosendclose 0 } chan configure $chan -buffering line -encoding iso8859-1 -translation crlf Puts $chan "$protocol $code" Puts $chan "content-type: $type" Puts $chan [format "x-crc32: %08x" [zlib crc32 $data]] if {$req eq "POST"} { Puts $chan [format "x-query-length: %d" [string length $query]] } if {$close && (!$nosendclose)} { Puts $chan "connection: close" } Puts $chan "x-requested-encodings: [dict get? $meta accept-encoding]" if {$encoding eq "identity" && (!$nosendclose)} { Puts $chan "content-length: [string length $data]" } elseif {$encoding eq "identity"} { # This is a blatant attempt to confuse the client by sending neither # "Connection: close" nor "Content-Length" when in non-chunked mode. # See test http11-3.4. } else { Puts $chan "content-encoding: $encoding" } if {$transfer eq "chunked"} { Puts $chan "transfer-encoding: chunked" } puts $chan "" flush $chan chan configure $chan -buffering full -translation binary if {$encoding eq {deflate}} { # When http.tcl uses the correct decoder (bug [a13b9d0ce1]) for # "accept-encoding deflate", i.e. "zlib decompress", this choice of # encoding2 allows the tests to pass. It appears to do "deflate" # correctly, but this has not been verified with a non-Tcl client. set encoding2 compress } else { set encoding2 $encoding } if {$transfer eq "chunked"} { blow-chunks $data $chan $encoding2 } elseif {$encoding2 ne "identity" && $msdeflate eq {1}} { puts -nonewline $chan [string range [zlib $encoding2 $data] 2 end-4] # Used in some tests of "deflate" to produce the non-RFC-compliant # Microsoft version of "deflate". } elseif {$encoding2 ne "identity"} { puts -nonewline $chan [zlib $encoding2 $data] } else { puts -nonewline $chan $data } if {$close} { chan event $chan readable {} close $chan puts "close $chan" return } else { flush $chan } puts "pipeline $chan" } } proc Accept {chan addr port} { coroutine client$chan Service $chan $addr $port return } proc Control {chan} { if {[gets $chan line] >= 0} { if {[string trim $line] eq "quit"} { set ::forever 1 } } if {[eof $chan]} { chan event $chan readable {} } } proc Main {{port 0}} { set server [socket -server Accept -myaddr localhost $port] puts [chan configure $server -sockname] flush stdout chan event stdin readable [list Control stdin] vwait ::forever close $server return "done" } if {!$tcl_interactive} { set r [catch [linsert $argv 0 Main] err] if {$r} {puts stderr $errorInfo} elseif {[string length $err]} {puts $err} exit $r } tcl9.0.3/tests/httpd0000644000175000017500000001451615104661341013766 0ustar sergeisergei# -*- tcl -*- # # The httpd_ procedures implement a stub http server. # # Copyright © 1997-1998 Sun Microsystems, Inc. # Copyright © 1999-2000 Scriptics Corporation # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #set httpLog 1 # Do not use [info hostname]. # Name resolution is often a problem on OSX; not focus of HTTP package anyway. # Also a problem on other platforms for http-4.14 (test with bad port number). set HOST localhost proc httpd_init {{port 8015}} { set s [socket -server httpdAccept $port] # Save the actual port number in a global variable. # This is important when we're called with port 0 # for picking an unused port at random. set ::port [lindex [chan configure $s -sockname] 2] return $s } proc httpd_log {args} { global httpLog if {[info exists httpLog] && $httpLog} { puts stderr "httpd: [join $args { }]" } } array set httpdErrors { 204 {No Content} 400 {Bad Request} 401 {Authorization Required} 404 {Not Found} 503 {Service Unavailable} 504 {Service Temporarily Unavailable} } proc httpdError {sock code args} { global httpdErrors puts $sock "$code $httpdErrors($code)" httpd_log "error: [join $args { }]" } proc httpdAccept {newsock ipaddr port} { global httpd upvar #0 httpd$newsock data fconfigure $newsock -blocking 0 -translation {auto crlf} httpd_log $newsock Connect $ipaddr $port set data(ipaddr) $ipaddr fileevent $newsock readable [list httpdRead $newsock] } # read data from a client request proc httpdRead { sock } { upvar #0 httpd$sock data if {[eof $sock]} { set readCount -1 } elseif {![info exists data(state)]} { # Read the protocol line and parse out the URL and query set readCount [gets $sock line] if {[regexp {(POST|GET|HEAD) ([^?]+)\??([^ ]*) HTTP/(1.[01])} $line \ -> data(proto) data(url) data(query) data(httpversion)]} { set data(state) mime httpd_log $sock Query $line if {[regexp {(?:^|[\?&])delay=([^&]+)} $data(query) {} val]} { fileevent $sock readable {} after $val [list fileevent $sock readable [list httpdRead $sock]] } } else { httpdError $sock 400 httpd_log $sock Error "bad first line:$line" httpdSockDone $sock } return } elseif {$data(state) == "mime"} { # Read the HTTP headers set readCount [gets $sock line] if {[regexp {^([^:]+):(.*)$} $line -> key val]} { lappend data(meta) $key [string trim $val] } } elseif {$data(state) == "query"} { # Read the query data if {![info exists data(length_orig)]} { set data(length_orig) $data(length) } set line [read $sock $data(length)] set readCount [string length $line] incr data(length) -$readCount } # string compare $readCount 0 maps -1 to -1, 0 to 0, and > 0 to 1 set state [string compare $readCount 0],$data(state),$data(proto) httpd_log $sock $state switch -- $state { -1,mime,HEAD - -1,mime,GET - -1,mime,POST { # gets would block return } 0,mime,HEAD - 0,mime,GET - 0,query,POST { # Empty line at end of headers, # or eof after query data httpdRespond $sock } 0,mime,POST { # Empty line between headers and query data if {![info exists data(mime,content-length)]} { httpd_log $sock Error "No Content-Length for POST" httpdError $sock 400 httpdSockDone $sock } else { set data(state) query set data(length) $data(mime,content-length) # Special case to simulate servers that respond # without reading the post data. if {[string match *droppost* $data(url)]} { fileevent $sock readable {} httpdRespond $sock } } } 1,mime,HEAD - 1,mime,POST - 1,mime,GET { # A line of HTTP headers if {[regexp {([^:]+):[ ]*(.*)} $line dummy key value]} { set data(mime,[string tolower $key]) $value } } -1,query,POST { httpd_log $sock Error "unexpected eof on <$data(url)> request" httpdError $sock 400 httpdSockDone $sock } 1,query,POST { append data(query) $line if {$data(length) <= 0} { set data(length) $data(length_orig) httpdRespond $sock } } default { if {[eof $sock]} { httpd_log $sock Error "unexpected eof on <$data(url)> request" } else { httpd_log $sock Error "unhandled state <$state> fetching <$data(url)>" } httpdError $sock 404 httpdSockDone $sock } } } proc httpdSockDone { sock } { upvar #0 httpd$sock data unset data catch {close $sock} } # Respond to the query. proc httpdRespond { sock } { global httpd bindata port upvar #0 httpd$sock data switch -glob -- $data(url) { *binary* { set html "$bindata${::HOST}:$port$data(url)" set type application/octet-stream } *xml* { set html [encoding convertto utf-8 "\u1234"] set type "application/xml;charset=UTF-8" } *post* { set html "Got [string length $data(query)] bytes" set type text/plain } *headers* { set html "" set type text/plain foreach {key value} $data(meta) { append html [list $key $value] "\n" } set html [string trim $html] } default { set type text/html set html "HTTP/1.0 TEST

    Hello, World!

    $data(proto) $data(url)

    " if {[info exists data(query)] && [string length $data(query)]} { append html "

    Query

    \n
    \n" foreach {key value} [split $data(query) &=] { append html "
    $key
    $value\n" if {$key == "timeout"} { after $value ;# pause } } append html
    \n } append html } } # Catch errors from premature client closes catch { if {$data(proto) == "HEAD"} { puts $sock "HTTP/1.0 200 OK" } else { # Split the response to test for [Bug 26245326] puts -nonewline $sock "HT" flush $sock puts $sock "TP/1.0 200 Data follows" } puts $sock "Date: [clock format [clock seconds] \ -format {%a, %d %b %Y %H:%M:%S %Z}]" puts $sock "Content-Type: $type" puts $sock "Content-Length: [string length $html]" foreach {key val} $data(meta) { if {[string match "X-*" $key]} { puts $sock "$key: $val" } } puts $sock "" flush $sock if {$data(proto) != "HEAD"} { fconfigure $sock -translation binary puts -nonewline $sock $html } } httpd_log $sock Done "" httpdSockDone $sock } tcl9.0.3/tests/httpcookie.test0000644000175000017500000006177415104661341016002 0ustar sergeisergei# Commands covered: http::cookiejar # # This file contains a collection of tests for the cookiejar package. # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 2014 Donal K. Fellows. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands testConstraint notMacCI [expr {![info exists ::env(MAC_CI)]}] testConstraint sqlite3 [expr {[testConstraint notMacCI] && ![catch { package require sqlite3 }]}] testConstraint cookiejar [expr {[testConstraint sqlite3] && ![catch { package require cookiejar }]}] set COOKIEJAR_VERSION 0.2.0 test http-cookiejar-1.1 "cookie storage: packaging" {cookiejar} { package require cookiejar } $COOKIEJAR_VERSION test http-cookiejar-1.2 "cookie storage: packaging" {cookiejar} { package require cookiejar package require cookiejar } $COOKIEJAR_VERSION test http-cookiejar-2.1 "cookie storage: basics" -constraints { cookiejar } -returnCodes error -body { http::cookiejar } -result {wrong # args: should be "http::cookiejar method ?arg ...?"} test http-cookiejar-2.2 "cookie storage: basics" -constraints { cookiejar } -returnCodes error -body { http::cookiejar ? } -result {unknown method "?": must be configure, create, destroy or new} test http-cookiejar-2.3 "cookie storage: basics" -constraints { cookiejar } -body { http::cookiejar configure } -result {-domainfile -domainlist -domainrefresh -loglevel -offline -purgeold -retain -vacuumtrigger} test http-cookiejar-2.4 "cookie storage: basics" -constraints { cookiejar } -returnCodes error -body { http::cookiejar configure a b c d e } -result {wrong # args: should be "http::cookiejar configure ?optionName? ?optionValue?"} test http-cookiejar-2.5 "cookie storage: basics" -constraints { cookiejar } -returnCodes error -body { http::cookiejar configure a } -result {bad option "a": must be -domainfile, -domainlist, -domainrefresh, -loglevel, -offline, -purgeold, -retain, or -vacuumtrigger} test http-cookiejar-2.6 "cookie storage: basics" -constraints { cookiejar } -returnCodes error -body { http::cookiejar configure -d } -result {ambiguous option "-d": must be -domainfile, -domainlist, -domainrefresh, -loglevel, -offline, -purgeold, -retain, or -vacuumtrigger} test http-cookiejar-2.7 "cookie storage: basics" -setup { set old [http::cookiejar configure -loglevel] } -constraints {cookiejar} -body { list [http::cookiejar configure -loglevel] \ [http::cookiejar configure -loglevel debug] \ [http::cookiejar configure -loglevel] \ [http::cookiejar configure -loglevel error] \ [http::cookiejar configure -loglevel] } -cleanup { http::cookiejar configure -loglevel $old } -result {info debug debug error error} test http-cookiejar-2.8 "cookie storage: basics" -setup { set old [http::cookiejar configure -loglevel] } -constraints {cookiejar} -body { list [http::cookiejar configure -loglevel] \ [http::cookiejar configure -loglevel d] \ [http::cookiejar configure -loglevel i] \ [http::cookiejar configure -loglevel w] \ [http::cookiejar configure -loglevel e] } -cleanup { http::cookiejar configure -loglevel $old } -result {info debug info warn error} test http-cookiejar-2.9 "cookie storage: basics" -body { http::cookiejar configure -off } -constraints {cookiejar} -match glob -result * test http-cookiejar-2.10 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -offline] } -constraints {cookiejar} -body { http::cookiejar configure -offline true } -cleanup { catch {http::cookiejar configure -offline $oldval} } -result 1 test http-cookiejar-2.11 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -offline] } -constraints {cookiejar} -body { http::cookiejar configure -offline nonbool } -cleanup { catch {http::cookiejar configure -offline $oldval} } -returnCodes error -result {expected boolean value but got "nonbool"} test http-cookiejar-2.12 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -purgeold] } -constraints {cookiejar} -body { http::cookiejar configure -purge nonint } -cleanup { catch {http::cookiejar configure -purgeold $oldval} } -returnCodes error -result {expected positive integer but got "nonint"} test http-cookiejar-2.13 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] } -constraints {cookiejar} -body { http::cookiejar configure -domainref nonint } -cleanup { catch {http::cookiejar configure -domainrefresh $oldval} } -returnCodes error -result {expected positive integer but got "nonint"} test http-cookiejar-2.14 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] } -constraints {cookiejar} -body { http::cookiejar configure -domainref -42 } -cleanup { catch {http::cookiejar configure -domainrefresh $oldval} } -returnCodes error -result {expected positive integer but got "-42"} test http-cookiejar-2.15 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] set result unset set tracer [http::cookiejar create tracer] } -constraints {cookiejar} -body { oo::objdefine $tracer method PostponeRefresh {} { set ::result set next } http::cookiejar configure -domainref 12345 return $result } -cleanup { $tracer destroy catch {http::cookiejar configure -domainrefresh $oldval} } -result set test http-cookiejar-3.1 "cookie storage: class" {cookiejar} { info object isa object http::cookiejar } 1 test http-cookiejar-3.2 "cookie storage: class" {cookiejar} { info object isa class http::cookiejar } 1 test http-cookiejar-3.3 "cookie storage: class" {cookiejar} { lsort [info object methods http::cookiejar] } {configure} test http-cookiejar-3.4 "cookie storage: class" {cookiejar} { lsort [info object methods http::cookiejar -all] } {configure create destroy new} test http-cookiejar-3.5 "cookie storage: class" -setup { catch {rename ::cookiejar ""} } -constraints {cookiejar} -body { namespace eval :: {http::cookiejar create cookiejar} } -cleanup { catch {rename ::cookiejar ""} } -result ::cookiejar test http-cookiejar-3.6 "cookie storage: class" -setup { catch {rename ::cookiejar ""} } -constraints {cookiejar} -body { list [http::cookiejar create ::cookiejar] [info commands ::cookiejar] \ [::cookiejar destroy] [info commands ::cookiejar] } -cleanup { catch {rename ::cookiejar ""} } -result {::cookiejar ::cookiejar {} {}} test http-cookiejar-3.7 "cookie storage: class" -setup { catch {rename ::cookiejar ""} } -constraints {cookiejar} -body { http::cookiejar create ::cookiejar foo bar } -returnCodes error -cleanup { catch {rename ::cookiejar ""} } -result {wrong # args: should be "http::cookiejar create ::cookiejar ?path?"} test http-cookiejar-3.8 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set f [makeFile "" cookiejar] file delete $f } -constraints {cookiejar} -body { list [file exists $f] [http::cookiejar create ::cookiejar $f] \ [file exists $f] } -cleanup { catch {rename ::cookiejar ""} removeFile $f } -result {0 ::cookiejar 1} test http-cookiejar-3.9 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set f [makeFile "bogus content for a database" cookiejar] } -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f } -returnCodes error -cleanup { catch {rename ::cookiejar ""} removeFile $f } -match glob -result * test http-cookiejar-3.10 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set dir [makeDirectory cookiejar] } -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $dir } -returnCodes error -cleanup { catch {rename ::cookiejar ""} removeDirectory $dir } -match glob -result * test http-cookiejar-4.1 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar method ?arg ...?"} test http-cookiejar-4.2 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar ? } -returnCodes error -cleanup { ::cookiejar destroy } -result {unknown method "?": must be destroy, forceLoadDomainData, getCookies, lookup, policyAllow or storeCookie} test http-cookiejar-4.3 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { lsort [info object methods cookiejar -all] } -cleanup { ::cookiejar destroy } -result {destroy forceLoadDomainData getCookies lookup policyAllow storeCookie} test http-cookiejar-4.4 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar getCookies } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar getCookies proto host path"} test http-cookiejar-4.5 "cookie storage" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar getCookies http www.example.com / } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.6 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar storeCookie } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar storeCookie options"} test http-cookiejar-4.7 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.8 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } # Poke inside implementation! cookiejar Database eval {SELECT count(*) FROM sessionCookies} } -cleanup { ::cookiejar destroy } -result 1 test http-cookiejar-4.9 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } # Poke inside implementation! cookiejar Database eval {SELECT count(*) FROM persistentCookies} } -cleanup { ::cookiejar destroy } -result 0 test http-cookiejar-4.10 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.11 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database } -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] # Poke inside implementation! cookiejar Database eval {SELECT count(*) FROM sessionCookies} } -cleanup { ::cookiejar destroy } -result 0 test http-cookiejar-4.12 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database } -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] # Poke inside implementation! cookiejar Database eval {SELECT count(*) FROM persistentCookies} } -cleanup { ::cookiejar destroy } -result 1 test http-cookiejar-4.13 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } lappend result [cookiejar getCookies http www.example.com /] } -cleanup { ::cookiejar destroy } -result {{} {foo bar}} test http-cookiejar-4.14 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie [dict replace { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] lappend result [cookiejar getCookies http www.example.com /] } -cleanup { ::cookiejar destroy } -result {{} {foo bar}} test http-cookiejar-4.15 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie [dict replace { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] lappend result [cookiejar getCookies http www.example.com /] } -cleanup { ::cookiejar destroy } -result {{} {foo bar}} test http-cookiejar-4.16 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo1 value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie [dict replace { key foo2 value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] lappend result [lsort -stride 2 [cookiejar getCookies http www.example.com /]] } -cleanup { ::cookiejar destroy } -result {{} {foo1 bar foo2 bar}} test http-cookiejar-4.17 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar } -constraints {cookiejar} -body { cookiejar lookup a b c d } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar lookup ?host? ?key?"} test http-cookiejar-4.18 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { lappend result [cookiejar lookup] lappend result [cookiejar lookup www.example.com] lappend result [catch {cookiejar lookup www.example.com foo} value] $value cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } lappend result [cookiejar lookup] lappend result [cookiejar lookup www.example.com] lappend result [cookiejar lookup www.example.com foo] } -cleanup { ::cookiejar destroy } -result {{} {} 1 {no such key for that host} www.example.com foo bar} test http-cookiejar-4.19 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key bar value foo secure 0 domain www.example.org origin www.example.org path / hostonly 1 } lappend result [lsort [cookiejar lookup]] lappend result [cookiejar lookup www.example.com] lappend result [cookiejar lookup www.example.com foo] lappend result [cookiejar lookup www.example.org] lappend result [cookiejar lookup www.example.org bar] } -cleanup { ::cookiejar destroy } -result {{www.example.com www.example.org} foo bar bar foo} test http-cookiejar-4.20 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar1 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie [dict replace { key foo2 value bar2 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+5}]] lappend result [cookiejar lookup] lappend result [lsort [cookiejar lookup www.example.com]] lappend result [cookiejar lookup www.example.com foo1] lappend result [cookiejar lookup www.example.com foo2] } -cleanup { ::cookiejar destroy } -result {www.example.com {foo1 foo2} bar1 bar2} test http-cookiejar-4.21 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar1 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo2 value bar2 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } lappend result [cookiejar lookup] lappend result [lsort [cookiejar lookup www.example.com]] lappend result [cookiejar lookup www.example.com foo1] lappend result [cookiejar lookup www.example.com foo2] } -cleanup { ::cookiejar destroy } -result {www.example.com {foo1 foo2} bar1 bar2} test http-cookiejar-4.22 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { cookiejar forceLoadDomainData x y z } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar forceLoadDomainData"} test http-cookiejar-4.23 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} } -constraints {cookiejar} -body { cookiejar forceLoadDomainData } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.23.a {cookie storage: instance} -setup { set off [http::cookiejar configure -offline] } -constraints {cookiejar} -body { http::cookiejar configure -offline 1 [http::cookiejar create ::cookiejar] destroy } -cleanup { catch {::cookiejar destroy} http::cookiejar configure -offline $off } -result {} test http-cookiejar-4.23.b {cookie storage: instance} -setup { set off [http::cookiejar configure -offline] } -constraints {cookiejar} -body { http::cookiejar configure -offline 0 [http::cookiejar create ::cookiejar] destroy } -cleanup { catch {::cookiejar destroy} http::cookiejar configure -offline $off } -result {} test http-cookiejar-5.1 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain com origin com path / hostonly 1 } cookiejar lookup } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-5.2 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar secure 0 domain foo.example.com origin bar.example.org path / hostonly 1 } cookiejar lookup } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-5.3 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData } -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar secure 0 domain com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo2 value bar secure 0 domain example.com origin www.example.com path / hostonly 1 } cookiejar lookup } -cleanup { ::cookiejar destroy } -result {example.com} test http-cookiejar-5.4 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData } -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar1 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo value bar2 secure 0 domain example.com origin www.example.com path / hostonly 1 } lsort [cookiejar lookup] } -cleanup { ::cookiejar destroy } -result {example.com www.example.com} test http-cookiejar-5.5 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData } -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value 1 secure 0 domain com origin www.example.com path / hostonly 0 } cookiejar storeCookie { key foo2 value 2 secure 0 domain com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo3 value 3 secure 0 domain example.com origin www.example.com path / hostonly 0 } cookiejar storeCookie { key foo4 value 4 secure 0 domain example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo5 value 5 secure 0 domain www.example.com origin www.example.com path / hostonly 0 } cookiejar storeCookie { key foo6 value 6 secure 0 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo7 value 7 secure 1 domain www.example.com origin www.example.com path / hostonly 0 } cookiejar storeCookie { key foo8 value 8 secure 1 domain www.example.com origin www.example.com path / hostonly 1 } cookiejar storeCookie { key foo9 value 9 secure 0 domain sub.www.example.com origin www.example.com path / hostonly 1 } list [cookiejar getCookies http www.example.com /] \ [cookiejar getCookies http www2.example.com /] \ [cookiejar getCookies https www.example.com /] \ [cookiejar getCookies http sub.www.example.com /] } -cleanup { ::cookiejar destroy } -result {{foo3 3 foo6 6} {foo3 3} {foo3 3 foo6 6 foo8 8} {foo3 3 foo5 5}} test http-cookiejar-6.1 "cookie storage: expiry and lookup" -setup { http::cookiejar create ::cookiejar oo::objdefine cookiejar export PurgeCookies set result {} proc values cookies { global result lappend result [lsort [lmap {k v} $cookies {set v}]] } } -constraints {cookiejar} -body { values [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo value session secure 0 domain www.example.com origin www.example.com path / hostonly 1 } values [cookiejar getCookies http www.example.com /] cookiejar storeCookie [dict replace { key foo value cookie secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+1}]] values [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo value session-global secure 0 domain example.com origin www.example.com path / hostonly 0 } values [cookiejar getCookies http www.example.com /] after 2500 update values [cookiejar getCookies http www.example.com /] cookiejar PurgeCookies values [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo value go-away secure 0 domain example.com origin www.example.com path / hostonly 0 expires 0 } values [cookiejar getCookies http www.example.com /] } -cleanup { ::cookiejar destroy } -result {{} session cookie {cookie session-global} {cookie session-global} session-global {}} test http-cookiejar-7.1 "cookie storage: persistence of persistent cookies" -setup { catch {rename ::cookiejar ""} set f [makeFile "" cookiejar] file delete $f } -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f ::cookiejar destroy http::cookiejar create ::cookiejar $f } -cleanup { catch {rename ::cookiejar ""} removeFile $f } -result ::cookiejar test http-cookiejar-7.2 "cookie storage: persistence of persistent cookies" -setup { catch {rename ::cookiejar ""} set f [makeFile "" cookiejar] file delete $f set result {} } -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f cookiejar storeCookie [dict replace { key foo value cookie secure 0 domain www.example.com origin www.example.com path / hostonly 1 } expires [expr {[clock seconds]+1}]] lappend result [::cookiejar getCookies http www.example.com /] ::cookiejar destroy http::cookiejar create ::cookiejar lappend result [::cookiejar getCookies http www.example.com /] ::cookiejar destroy http::cookiejar create ::cookiejar $f lappend result [::cookiejar getCookies http www.example.com /] } -cleanup { catch {rename ::cookiejar ""} removeFile $f } -result {{foo cookie} {} {foo cookie}} ::tcltest::cleanupTests # Local variables: # mode: tcl # End: tcl9.0.3/tests/http11.test0000644000175000017500000011633715104661341014746 0ustar sergeisergei# http11.test -- -*- tcl-*- # # Test HTTP/1.1 features. # # Copyright © 2009 Pat Thoyts # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } package require http 2.10 #http::register http 80 ::socket # start the server variable httpd_output proc create_httpd {} { proc httpd_read {chan} { variable httpd_output if {[gets $chan line] >= 0} { #puts stderr "read '$line'" set httpd_output $line } if {[eof $chan]} { puts stderr "eof from httpd" fileevent $chan readable {} close $chan } } variable httpd_output set httpd_script [file join [pwd] [file dirname [info script]] httpd11.tcl] set httpd [open "|[list [interpreter] -encoding utf-8 $httpd_script]" r+] fconfigure $httpd -buffering line -blocking 0 fileevent $httpd readable [list httpd_read $httpd] vwait httpd_output variable httpd_port [lindex $httpd_output 2] return $httpd } proc halt_httpd {} { variable httpd_output variable httpd if {[info exists httpd]} { puts $httpd "quit" vwait httpd_output close $httpd } unset -nocomplain httpd_output httpd } proc meta {tok {key ""}} { if {$key eq ""} { return [http::meta $tok] } else { return [http::metaValue $tok $key] } } proc state {tok {key ""}} { upvar 1 $tok state if {$key ne ""} { if {[array names state -exact $key] ne {}} { return $state($key) } else { return "" } } set res [array get state] dict set res body return $res } proc check_crc {tok args} { set crc [meta $tok x-crc32] set data [expr {[llength $args] ? [lindex $args 0] : [http::data $tok]}] set chk [format %x [zlib crc32 $data]] if {$crc ne $chk} { return "crc32 mismatch: $crc ne $chk" } return "ok" } makeFile "test

    this is a test

    \n[string repeat {

    This is a tcl test file.

    } 4192]\n" testdoc.html makeFile "test

    this is a test

    \n[string repeat {

    This is a tcl test file.

    } 5000]\n" largedoc.html # To write a separate summary for each value of ThreadLevel, set constraint ThreadLevelSummary. #testConstraint ThreadLevelSummary 0 if 0 { # For debugging: run with a single value of ThreadLevel: 0|1|2 set ThreadLevel 0 testConstraint ThreadLevelSummary 1 } if {![info exists ThreadLevel]} { if {[catch {package require Thread}] == 0} { set ValueRange {0 1 2} } else { set ValueRange {0 1} } # For each value of ThreadLevel, source this file recursively in the # same interpreter. foreach ThreadLevel $ValueRange { source [info script] } catch {unset ThreadLevel} catch {unset ValueRange} if {![testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } return } catch {puts "==== Test with ThreadLevel $ThreadLevel ===="} http::config -threadlevel $ThreadLevel # ------------------------------------------------------------------------- test http11-1.0.$ThreadLevel "normal request for document " -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html -timeout 10000] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] [meta $tok connection] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close} test http11-1.1.$ThreadLevel "normal,gzip,non-chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -headers {accept-encoding gzip}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] \ [http::meta $tok content-encoding] [http::meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok gzip {} {content-encoding gzip} {}} test http11-1.2.$ThreadLevel "normal,deflated,non-chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -headers {accept-encoding deflate}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok deflate {}} test http11-1.2.1.$ThreadLevel "normal,deflated,non-chunked,msdeflate" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1&msdeflate=1 \ -timeout 10000 -headers {accept-encoding deflate}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok deflate {}} test http11-1.3.$ThreadLevel "normal,compressed,non-chunked" -constraints badCompress -setup { # The Tcl "compress" algorithm appears to be incorrect and has been removed. # Bug [a13b9d0ce1]. variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -headers {accept-encoding compress}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok compress {}} test http11-1.4.$ThreadLevel "normal,identity,non-chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -headers {accept-encoding identity}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} {}} test http11-1.5.$ThreadLevel "normal request for document, unsupported coding" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -headers {accept-encoding unsupported}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {}} test http11-1.6.$ThreadLevel "normal, specify 1.1 " -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -protocol 1.1 -timeout 10000] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok connection] [meta $tok transfer-encoding] \ [http::meta $tok connection] [http::meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close chunked {connection close} {transfer-encoding chunked}} test http11-1.7.$ThreadLevel "normal, 1.1 and keepalive " -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -protocol 1.1 -keepalive 1 -timeout 10000] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok connection] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} chunked} test http11-1.8.$ThreadLevel "normal, 1.1 and keepalive, server close" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -protocol 1.1 -keepalive 1 -timeout 10000] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok connection] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {}} test http11-1.9.$ThreadLevel "normal,gzip,chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -headers {accept-encoding gzip}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok gzip chunked} test http11-1.10.$ThreadLevel "normal,deflate,chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -headers {accept-encoding deflate}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok deflate chunked} test http11-1.10.1.$ThreadLevel "normal,deflate,chunked,msdeflate" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 \ -timeout 10000 -headers {accept-encoding deflate}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok deflate chunked} test http11-1.11.$ThreadLevel "normal,compress,chunked" -constraints badCompress -setup { # The Tcl "compress" algorithm appears to be incorrect and has been removed. # Bug [a13b9d0ce1]. variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -headers {accept-encoding compress}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok compress chunked} test http11-1.12.$ThreadLevel "normal,identity,chunked" -setup { variable httpd [create_httpd] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -headers {accept-encoding identity}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok content-encoding] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} chunked} test http11-1.13.$ThreadLevel "normal, 1.1 and keepalive as server default, no zip" -setup { variable httpd [create_httpd] set zipTmp [http::config -zip] http::config -zip 0 } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?transfer= \ -protocol 1.1 -keepalive 1 -timeout 10000] http::wait $tok set res1 [list [http::status $tok] [http::code $tok] [check_crc $tok] \ [meta $tok connection] [meta $tok transfer-encoding] [state $tok reusing] [state $tok connection]] set toj [http::geturl http://localhost:$httpd_port/testdoc.html?transfer= \ -protocol 1.1 -keepalive 1 -timeout 10000] http::wait $toj set res2 [list [http::status $toj] [http::code $toj] [check_crc $toj] \ [meta $toj connection] [meta $toj transfer-encoding] [state $toj reusing] [state $toj connection]] concat $res1 -- $res2 } -cleanup { catch {http::cleanup $tok} catch {http::cleanup $toj} halt_httpd http::config -zip $zipTmp } -result {ok {HTTP/1.1 200 OK} ok {} {} 0 keep-alive -- ok {HTTP/1.1 200 OK} ok {} {} 1 keep-alive} # ------------------------------------------------------------------------- proc progress {var token total current} { upvar #0 $var log set log [list $current $total] return } proc progressPause {var token total current} { upvar #0 $var log set log [list $current $total] after 100 set ::WaitHere 0 vwait ::WaitHere return } test http11-2.0.$ThreadLevel "-channel" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close chunked} test http11-2.1.$ThreadLevel "-channel, encoding gzip" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan -headers {accept-encoding gzip}] http::wait $tok seek $chan 0 set data [read $chan] set diff [expr {[file size testdoc.html] - [file size testfile.tmp]}] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] -- $diff bytes lost } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close gzip chunked -- 0 bytes lost} # Cf. Bug [3610253] "CopyChunk does not drain decompressor(s)" # This test failed before the bugfix. # The pass/fail depended on file size. test http11-2.1.1.$ThreadLevel "-channel, encoding gzip" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] set fileName largedoc.html } -body { set tok [http::geturl http://localhost:$httpd_port/$fileName \ -timeout 5000 -channel $chan -headers {accept-encoding gzip}] http::wait $tok seek $chan 0 set data [read $chan] set diff [expr {[file size $fileName] - [file size testfile.tmp]}] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] -- $diff bytes lost } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close gzip chunked -- 0 bytes lost} test http11-2.2.$ThreadLevel "-channel, encoding deflate" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close deflate chunked} test http11-2.2.1.$ThreadLevel "-channel, encoding deflate,msdeflate" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 \ -timeout 5000 -channel $chan -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close deflate chunked} test http11-2.3.$ThreadLevel "-channel,encoding compress" -constraints badCompress -setup { # The Tcl "compress" algorithm appears to be incorrect and has been removed. # Bug [a13b9d0ce1]. variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan \ -headers {accept-encoding compress}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close compress chunked} test http11-2.4.$ThreadLevel "-channel,encoding identity" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan \ -headers {accept-encoding identity}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {} chunked} test http11-2.4.1.$ThreadLevel "-channel,encoding identity with -progress" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan \ -headers {accept-encoding identity} \ -progress [namespace code [list progress logdata]]] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length $data]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd unset -nocomplain logdata data } -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0} test http11-2.4.2.$ThreadLevel "-channel,encoding identity with -progress progressPause enters event loop" -constraints knownBug -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan \ -headers {accept-encoding identity} \ -progress [namespace code [list progressPause logdata]]] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length $data]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd unset -nocomplain logdata data ::WaitHere } -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0} test http11-2.5.$ThreadLevel "-channel,encoding unsupported" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan \ -headers {accept-encoding unsupported}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {} chunked} test http11-2.6.$ThreadLevel "-channel,encoding gzip,non-chunked" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 5000 -channel $chan -headers {accept-encoding gzip}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close gzip {} 0} test http11-2.7.$ThreadLevel "-channel,encoding deflate,non-chunked" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 5000 -channel $chan -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0} test http11-2.7.1.$ThreadLevel "-channel,encoding deflate,non-chunked,msdeflate" -constraints knownBug -setup { # Test fails because a -channel can only try one un-deflate algorithm, and the # compliant "decompress" is tried, not the non-compliant "inflate" of # the MS browser implementation. variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1&msdeflate=1 \ -timeout 5000 -channel $chan -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0} test http11-2.8.$ThreadLevel "-channel,encoding compress,non-chunked" -constraints badCompress -setup { # The Tcl "compress" algorithm appears to be incorrect and has been removed. # Bug [a13b9d0ce1]. variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 5000 -channel $chan -headers {accept-encoding compress}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close compress {} 0} test http11-2.9.$ThreadLevel "-channel,encoding identity,non-chunked" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 5000 -channel $chan -headers {accept-encoding identity}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {} {} 0} test http11-2.10.$ThreadLevel "-channel,deflate,keepalive" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan -keepalive 1 \ -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0} test http11-2.10.1.$ThreadLevel "-channel,deflate,keepalive,msdeflate" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 \ -timeout 5000 -channel $chan -keepalive 1 \ -headers {accept-encoding deflate}] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0} test http11-2.11.$ThreadLevel "-channel,identity,keepalive" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -headers {accept-encoding identity} \ -timeout 5000 -channel $chan -keepalive 1] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} {} chunked} test http11-2.12.$ThreadLevel "-channel,negotiate,keepalive" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 5000 -channel $chan -keepalive 1] http::wait $tok seek $chan 0 set data [read $chan] list [http::status $tok] [http::code $tok] [check_crc $tok $data]\ [meta $tok connection] [meta $tok content-encoding]\ [meta $tok transfer-encoding] [meta $tok x-requested-encodings]\ [expr {[file size testdoc.html]-[file size testfile.tmp]}] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {ok {HTTP/1.1 200 OK} ok {} gzip chunked gzip,deflate 0} # ------------------------------------------------------------------------- # # The following tests for the -handler option will require changes in # the future. At the moment we cannot handler chunked data with this # option. Therefore we currently force HTTP/1.0 protocol version. # # Once this is solved, these tests should be fixed to assume chunked # returns in 3.2 and 3.3 and HTTP/1.1 in all but test 3.1 proc handler {var sock token} { upvar #0 $var data set chunk [read $sock] append data $chunk #::http::Log "handler read [string length $chunk] ([chan configure $sock -buffersize])" return [string length $chunk] } proc handlerPause {var sock token} { upvar #0 $var data set chunk [read $sock] append data $chunk #::http::Log "handler read [string length $chunk] ([chan configure $sock -buffersize])" after 100 set ::WaitHere 0 vwait ::WaitHere return [string length $chunk] } test http11-3.0.$ThreadLevel "-handler,close,identity" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -handler [namespace code [list handler testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0} test http11-3.1.$ThreadLevel "-handler,protocol1.0" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -protocol 1.0 \ -handler [namespace code [list handler testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0} test http11-3.2.$ThreadLevel "-handler,close,chunked" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -keepalive 0 -binary 1\ -handler [namespace code [list handler testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0} test http11-3.3.$ThreadLevel "-handler,keepalive,chunked" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -timeout 10000 -keepalive 1 -binary 1\ -handler [namespace code [list handler testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0} # http11-3.4 # This test is a blatant attempt to confuse the client by instructing the server # to send neither "Connection: close" nor "Content-Length" when in non-chunked # mode. # The client has no way to know the response-body is complete unless the # server signals this by closing the connection. # In an HTTP/1.1 response the absence of "Connection: close" means # "Connection: keep-alive", i.e. the server will keep the connection # open. In HTTP/1.0 this is not the case, and this is a test that # the Tcl client assumes "Connection: close" by default in HTTP/1.0. test http11-3.4.$ThreadLevel "-handler,close,identity; HTTP/1.0 server does not send Connection: close header or Content-Length" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1&nosendclose=any \ -timeout 10000 -handler [namespace code [list handler testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata halt_httpd } -result {ok {HTTP/1.0 200 OK} ok {} {} {} 0} # It is not forbidden for a handler to enter the event loop. test http11-3.5.$ThreadLevel "-handler,close,identity as http11-3.0 but handlerPause enters event loop" -setup { variable httpd [create_httpd] set testdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -handler [namespace code [list handlerPause testdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata ::WaitHere halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0} test http11-3.6.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress" -setup { variable httpd [create_httpd] set testdata "" set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -handler [namespace code [list handler testdata]] \ -progress [namespace code [list progress logdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata logdata ::WaitHere halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0} test http11-3.7.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress progressPause enters event loop" -setup { variable httpd [create_httpd] set testdata "" set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 -handler [namespace code [list handler testdata]] \ -progress [namespace code [list progressPause logdata]]] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok $testdata]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length $testdata]}] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length $testdata]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain testdata logdata ::WaitHere halt_httpd } -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0} test http11-3.8.$ThreadLevel "close,identity no -handler but with -progress" -setup { variable httpd [create_httpd] set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 \ -progress [namespace code [list progress logdata]] \ -headers {accept-encoding {}}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length [http::data $tok]]}] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length [http::data $tok]]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain logdata ::WaitHere halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0} test http11-3.9.$ThreadLevel "close,identity no -handler but with -progress progressPause enters event loop" -setup { variable httpd [create_httpd] set logdata "" } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \ -timeout 10000 \ -progress [namespace code [list progressPause logdata]] \ -headers {accept-encoding {}}] http::wait $tok list [http::status $tok] [http::code $tok] [check_crc $tok]\ [meta $tok connection] [meta $tok content-encoding] \ [meta $tok transfer-encoding] \ [expr {[file size testdoc.html]-[string length [http::data $tok]]}] \ [expr {[lindex $logdata 0] - [lindex $logdata 1]}] \ [expr {[lindex $logdata 0] - [string length [http::data $tok]]}] } -cleanup { catch {http::cleanup $tok} unset -nocomplain logdata ::WaitHere halt_httpd } -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0} test http11-4.0.$ThreadLevel "normal post request" -setup { variable httpd [create_httpd] } -body { set query [http::formatQuery q 1 z 2] set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -query $query -timeout 10000] http::wait $tok list status [http::status $tok] code [http::code $tok]\ crc [check_crc $tok]\ connection [meta $tok connection]\ query-length [meta $tok x-query-length] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7} test http11-4.1.$ThreadLevel "normal post request, check query length" -setup { variable httpd [create_httpd] } -body { set query [http::formatQuery q 1 z 2] set tok [http::geturl http://localhost:$httpd_port/testdoc.html \ -headers [list x-check-query yes] \ -query $query -timeout 10000] http::wait $tok list status [http::status $tok] code [http::code $tok]\ crc [check_crc $tok]\ connection [meta $tok connection]\ query-length [meta $tok x-query-length] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7} test http11-4.2.$ThreadLevel "normal post request, check long query length" -setup { variable httpd [create_httpd] } -body { set query [string repeat a 24576] set tok [http::geturl http://localhost:$httpd_port/testdoc.html\ -headers [list x-check-query yes]\ -query $query -timeout 10000] http::wait $tok list status [http::status $tok] code [http::code $tok]\ crc [check_crc $tok]\ connection [meta $tok connection]\ query-length [meta $tok x-query-length] } -cleanup { catch {http::cleanup $tok} halt_httpd } -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 24576} test http11-4.3.$ThreadLevel "normal post request, check channel query length" -setup { variable httpd [create_httpd] set chan [open [makeFile {} testfile.tmp] wb+] puts -nonewline $chan [string repeat [encoding convertto utf-8 "This is a test\n"] 8192] flush $chan seek $chan 0 } -body { set tok [http::geturl http://localhost:$httpd_port/testdoc.html\ -headers [list x-check-query yes]\ -querychannel $chan -timeout 10000] http::wait $tok list status [http::status $tok] code [http::code $tok]\ crc [check_crc $tok]\ connection [meta $tok connection]\ query-length [meta $tok x-query-length] } -cleanup { catch {http::cleanup $tok} close $chan removeFile testfile.tmp halt_httpd } -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 122880} # ------------------------------------------------------------------------- # Eliminate valgrind "still reachable" reports on outstanding "Detached" # structures in the detached list which stem from PipeClose2Proc not waiting # around for background processes to complete, meaning that previous calls to # Tcl_ReapDetachedProcs might not have had a chance to reap all processes. after 10 exec [info nameofexecutable] << {} foreach p {create_httpd httpd_read halt_httpd meta check_crc} { if {[llength [info proc $p]]} {rename $p {}} } removeFile testdoc.html removeFile largedoc.html unset -nocomplain httpd_port httpd p if {[testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } tcl9.0.3/tests/http.test0000644000175000017500000013523115104661341014576 0ustar sergeisergei# Commands covered: http::config, http::geturl, http::wait, http::reset # # This file contains a collection of tests for the http script library. # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } package require http 2.10 #http::register http 80 ::socket # To write a separate summary for each value of ThreadLevel, set constraint ThreadLevelSummary. #testConstraint ThreadLevelSummary 0 proc bgerror {args} { global errorInfo puts stderr "http.test bgerror" puts stderr [join $args] puts stderr $errorInfo } # Do not use [info hostname]. # Name resolution is often a problem on OSX; not focus of HTTP package anyway. # Also a problem on other platforms for http-4.14 (test with bad port number). set HOST localhost set bindata "This is binary data\x0D\x0Amore\x0Dmore\x0Amore\x00null" catch {unset data} # Ensure httpd file exists set origFile [file join [pwd] [file dirname [info script]] httpd] set httpdFile [file join [temporaryDirectory] httpd_[pid]] if {![file exists $httpdFile]} { makeFile "" $httpdFile file delete $httpdFile file copy $origFile $httpdFile set removeHttpd 1 } catch {package require Thread 2.7-} if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} { set httpthread [thread::create -preserved] lappend threadStack [list thread::release $httpthread] thread::send $httpthread [list source $httpdFile] thread::send $httpthread [list set bindata $bindata] thread::send $httpthread {httpd_init 0; set port} port puts "Running httpd in thread $httpthread" } else { if {![file exists $httpdFile]} { puts "Cannot read $httpdFile script, http test skipped" unset port return } source $httpdFile # Let the OS pick the port; that's much more flexible if {[catch {httpd_init 0} listen]} { puts "Cannot start http server, http test skipped" catch {unset port} return } set threadStack {} } if 0 { # For debugging: run with a single value of ThreadLevel: 0|1|2 set ThreadLevel 0 testConstraint ThreadLevelSummary 1 } if {![info exists ThreadLevel]} { if {[catch {package require Thread}] == 0} { set ValueRange {0 1 2} } else { set ValueRange {0 1} } # For each value of ThreadLevel, source this file recursively in the # same interpreter. foreach ThreadLevel $ValueRange { source [info script] } if {[llength $threadStack]} { eval [lpop threadStack] } catch {unset ThreadLevel} catch {unset ValueRange} if {![testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } return } catch {puts "==== Test with ThreadLevel $ThreadLevel ===="} http::config -threadlevel $ThreadLevel test http-1.1.$ThreadLevel {http::config} { http::config -useragent UserAgent http::config } [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter http::ProxyRequired -proxyhost {} -proxynot {} -proxyport {} -repost 0 -threadlevel $ThreadLevel -urlencoding utf-8 -useragent UserAgent -zip 1] test http-1.2.$ThreadLevel {http::config} { http::config -proxyfilter } http::ProxyRequired test http-1.3.$ThreadLevel {http::config} { catch {http::config -junk} } 1 test http-1.4.$ThreadLevel {http::config} { set savedconf [http::config] http::config -proxyhost nowhere.come -proxyport 8080 \ -proxyfilter myFilter -useragent "Tcl Test Suite" \ -urlencoding iso8859-1 set x [http::config] http::config {*}$savedconf set x } [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter myFilter -proxyhost nowhere.come -proxynot {} -proxyport 8080 -repost 0 -threadlevel $ThreadLevel -urlencoding iso8859-1 -useragent {Tcl Test Suite} -zip 1] test http-1.5.$ThreadLevel {http::config} -returnCodes error -body { http::config -proxyhost {} -junk 8080 } -result {Unknown option -junk, must be: -accept, -cookiejar, -pipeline, -postfresh, -proxyauth, -proxyfilter, -proxyhost, -proxynot, -proxyport, -repost, -threadlevel, -urlencoding, -useragent, -zip} test http-1.6.$ThreadLevel {http::config} -setup { set oldenc [http::config -urlencoding] } -body { set enc [list [http::config -urlencoding]] http::config -urlencoding iso8859-1 lappend enc [http::config -urlencoding] } -cleanup { http::config -urlencoding $oldenc } -result {utf-8 iso8859-1} test http-2.1.$ThreadLevel {http::reset} { catch {http::reset http#1} } 0 test http-2.2.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding iso-8859-11 } iso8859-11 test http-2.3.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding iso-2022-kr } iso2022-kr test http-2.4.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding shift-jis } shiftjis test http-2.5.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding windows-437 } cp437 test http-2.6.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding latin5 } iso8859-9 test http-2.7.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding latin1 } iso8859-1 test http-2.8.$ThreadLevel {http::CharsetToEncoding} { http::CharsetToEncoding latin4 } binary test http-3.1.$ThreadLevel {http::geturl} -returnCodes error -body { http::geturl -bogus flag } -result {Unknown option flag, can be: -binary, -blocksize, -channel, -command, -guesstype, -handler, -headers, -keepalive, -method, -myaddr, -progress, -protocol, -query, -queryblocksize, -querychannel, -queryprogress, -strict, -timeout, -type, -validate} test http-3.2.$ThreadLevel {http::geturl} -returnCodes error -body { http::geturl http:junk } -result {Unsupported URL: http:junk} set url //${::HOST}:$port set badurl //${::HOST}:[expr {$port+1}] test http-3.3.$ThreadLevel {http::geturl} -body { set token [http::geturl $url] http::data $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET /

    " set tail /a/b/c set url //${::HOST}:$port/a/b/c set fullurl HTTP://user:pass@${::HOST}:$port/a/b/c set binurl //${::HOST}:$port/binary set xmlurl //${::HOST}:$port/xml set posturl //${::HOST}:$port/post set badposturl //${::HOST}:$port/droppost set authorityurl //${::HOST}:$port set ipv6url http://\[::1\]:$port/ test http-3.4.$ThreadLevel {http::geturl} -body { set token [http::geturl $url] http::data $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET $tail

    " proc selfproxy {host} { global port return [list ${::HOST} $port] } test http-3.5.$ThreadLevel {http::geturl} -body { http::config -proxyfilter selfproxy set token [http::geturl $url] http::data $token } -cleanup { http::config -proxyfilter http::ProxyRequired catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET http:$url

    " test http-3.6.$ThreadLevel {http::geturl} -body { http::config -proxyfilter bogus set token [http::geturl $url] http::data $token } -cleanup { http::config -proxyfilter http::ProxyRequired catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET $tail

    " test http-3.7.$ThreadLevel {http::geturl} -body { set token [http::geturl $url -headers {Pragma no-cache}] http::data $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET $tail

    " test http-3.8.$ThreadLevel {http::geturl} -body { set token [http::geturl $url -query Name=Value&Foo=Bar -timeout 3000] http::data $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    POST $tail

    Query

    Name
    Value
    Foo
    Bar
    " test http-3.9.$ThreadLevel {http::geturl} -body { set token [http::geturl $url -validate 1] http::code $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 200 OK" test http-3.10.$ThreadLevel {http::geturl queryprogress} -setup { set query foo=bar set sep "" set i 0 # Create about 120K of query data while {$i < 14} { incr i append query $sep$query set sep & } } -body { proc postProgress {tok x y} { global postProgress lappend postProgress $y } set postProgress {} set token [http::geturl $posturl -keepalive 0 -query $query \ -queryprogress postProgress -queryblocksize 16384] http::wait $token list [http::status $token] [string length $query] $postProgress [http::data $token] } -cleanup { catch {http::cleanup $token} } -result {ok 122879 {16384 32768 49152 65536 81920 98304 114688 122879} {Got 122879 bytes}} test http-3.11.$ThreadLevel {http::geturl querychannel with -command} -setup { set query foo=bar set sep "" set i 0 # Create about 120K of query data while {$i < 14} { incr i append query $sep$query set sep & } set file [makeFile $query outdata] } -body { set fp [open $file] proc asyncCB {tok} { global postResult lappend postResult [http::data $tok] } set postResult [list ] set token [http::geturl $posturl -querychannel $fp] http::wait $token set testRes [list [http::status $token] [string length $query] [http::data $token]] # Now do async http::cleanup $token close $fp set fp [open $file] set token [http::geturl $posturl -querychannel $fp -command asyncCB] set postResult [list PostStart] http::wait $token close $fp lappend testRes [http::status $token] $postResult } -cleanup { removeFile outdata catch {http::cleanup $token} } -result {ok 122879 {Got 122880 bytes} ok {PostStart {Got 122880 bytes}}} # On Linux platforms when the client and server are on the same host, the # client is unable to read the server's response one it hits the write error. # The status is "eof". # On Windows, the http::wait procedure gets a "connection reset by peer" error # while reading the reply. test http-3.12.$ThreadLevel {http::geturl querychannel with aborted request} -setup { set query foo=bar set sep "" set i 0 # Create about 120K of query data while {$i < 14} { incr i append query $sep$query set sep & } set file [makeFile $query outdata] } -constraints {nonPortable} -body { set fp [open $file] proc asyncCB {tok} { global postResult lappend postResult [http::data $tok] } proc postProgress {tok x y} { global postProgress lappend postProgress $y } set postProgress {} # Now do async set postResult [list PostStart] if {[catch { set token [http::geturl $badposturl -querychannel $fp -command asyncCB \ -queryprogress postProgress] http::wait $token upvar #0 $token state } err]} { puts $::errorInfo error $err } list [http::status $token] [http::code $token] } -cleanup { removeFile outdata catch {http::cleanup $token} } -result {ok {HTTP/1.0 200 Data follows}} test http-3.13.$ThreadLevel {http::geturl socket leak test} { set chanCount [llength [file channels]] for {set i 0} {$i < 3} {incr i} { catch {http::geturl $badurl -timeout 5000} } # No extra channels should be taken expr {[llength [file channels]] == $chanCount} } 1 test http-3.14.$ThreadLevel "http::geturl $fullurl" -body { set token [http::geturl $fullurl -validate 1] http::code $token } -cleanup { catch {http::cleanup $token} } -result "HTTP/1.0 200 OK" test http-3.15.$ThreadLevel {http::geturl parse failures} -body { http::geturl "{invalid}:url" } -returnCodes error -result {Unsupported URL: {invalid}:url} test http-3.16.$ThreadLevel {http::geturl parse failures} -body { http::geturl http:relative/url } -returnCodes error -result {Unsupported URL: http:relative/url} test http-3.17.$ThreadLevel {http::geturl parse failures} -body { http::geturl /absolute/url } -returnCodes error -result {Missing host part: /absolute/url} test http-3.18.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://somewhere:123456789/ } -returnCodes error -result {Invalid port number: 123456789} test http-3.19.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://{user}@somewhere } -returnCodes error -result {Illegal characters in URL user} test http-3.20.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://%user@somewhere } -returnCodes error -result {Illegal encoding character usage "%us" in URL user} test http-3.21.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://somewhere/{path} } -returnCodes error -result {Illegal characters in URL path} test http-3.22.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://somewhere/%path } -returnCodes error -result {Illegal encoding character usage "%pa" in URL path} test http-3.23.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://somewhere/path?{query}? } -returnCodes error -result {Illegal characters in URL path} test http-3.24.$ThreadLevel {http::geturl parse failures} -body { http::geturl http://somewhere/path?%query } -returnCodes error -result {Illegal encoding character usage "%qu" in URL path} test http-3.25.$ThreadLevel {http::meta} -setup { unset -nocomplain m token } -body { set token [http::geturl $url -timeout 3000] array set m [http::meta $token] lsort [array names m] } -cleanup { catch {http::cleanup $token} unset -nocomplain m token } -result {content-length content-type date} test http-3.26.$ThreadLevel {http::meta} -setup { unset -nocomplain m token } -body { set token [http::geturl $url -headers {X-Check 1} -timeout 3000] array set m [http::meta $token] lsort [array names m] } -cleanup { catch {http::cleanup $token} unset -nocomplain m token } -result {content-length content-type date x-check} test http-3.27.$ThreadLevel {http::geturl: -headers override -type} -body { set token [http::geturl $url/headers -type "text/plain" -query dummy \ -headers [list "Content-Type" "text/plain;charset=utf-8"]] http::data $token } -cleanup { catch {http::cleanup $token} } -match regexp -result {(?n)Host .* User-Agent .* Content-Type {text/plain;charset=utf-8} Accept \*/\* Accept-Encoding .* Connection close Content-Length 5} test http-3.28.$ThreadLevel {http::geturl: -headers override -type default} -body { set token [http::geturl $url/headers -query dummy \ -headers [list "Content-Type" "text/plain;charset=utf-8"]] http::data $token } -cleanup { catch {http::cleanup $token} } -match regexp -result {(?n)Host .* User-Agent .* Content-Type {text/plain;charset=utf-8} Accept \*/\* Accept-Encoding .* Connection close Content-Length 5} test http-3.29.$ThreadLevel {http::geturl IPv6 address} -body { # We only want to see if the URL gets parsed correctly. This is # the case if http::geturl succeeds or returns a socket related # error. If the parsing is wrong, we'll get a parse error. # It'd be better to separate the URL parser from http::geturl, so # that it can be tested without also trying to make a connection. set error [catch {http::geturl $ipv6url -validate 1} token] if {$error && [string match "couldn't open socket: *" $token]} { set error 0 } set error } -cleanup { catch {http::cleanup $token} } -result 0 test http-3.30.$ThreadLevel {http::geturl query without path} -body { set token [http::geturl $authorityurl?var=val] http::ncode $token } -cleanup { catch {http::cleanup $token} } -result 200 test http-3.31.$ThreadLevel {http::geturl fragment without path} -body { set token [http::geturl "$authorityurl#fragment42"] http::ncode $token } -cleanup { catch {http::cleanup $token} } -result 200 # Bug c11a51c482 test http-3.32.$ThreadLevel {http::geturl: -headers override -accept default} -body { set token [http::geturl $url/headers -query dummy \ -headers [list "Accept" "text/plain,application/tcl-test-value"]] http::data $token } -cleanup { catch {http::cleanup $token} } -match regexp -result {(?n)Host .* User-Agent .* Accept text/plain,application/tcl-test-value Accept-Encoding .* Connection close Content-Type application/x-www-form-urlencoded Content-Length 5} # Bug 838e99a76d test http-3.33.$ThreadLevel {http::geturl application/xml is text} -body { set token [http::geturl "$xmlurl"] scan [http::data $token] "<%\[^>]>%c<%\[^>]>" } -cleanup { catch {http::cleanup $token} } -result {test 4660 /test} test http-3.34.$ThreadLevel {http::geturl -headers not a list} -returnCodes error -body { http::geturl http://test/t -headers \" } -result "Bad value for -headers (\"), must be list" test http-3.35.$ThreadLevel {http::geturl -headers not even number of elements} -returnCodes error -body { http::geturl http://test/t -headers {List Length 3} } -result {Bad value for -headers (List Length 3), number of list elements must be even} test http-4.1.$ThreadLevel {http::Event} -body { set token [http::geturl $url -keepalive 0] upvar #0 $token data array set meta $data(meta) expr {($data(totalsize) == $meta(content-length))} } -cleanup { catch {http::cleanup $token} } -result 1 test http-4.2.$ThreadLevel {http::Event} -body { set token [http::geturl $url] upvar #0 $token data array set meta $data(meta) string compare $data(type) [string trim $meta(content-type)] } -cleanup { catch {http::cleanup $token} } -result 0 test http-4.3.$ThreadLevel {http::Event} -body { set token [http::geturl $url] http::code $token } -cleanup { catch {http::cleanup $token} } -result {HTTP/1.0 200 Data follows} test http-4.4.$ThreadLevel {http::Event} -setup { set testfile [makeFile "" testfile] } -body { set out [open $testfile w] set token [http::geturl $url -channel $out] close $out set in [open $testfile] set x [read $in] } -cleanup { catch {close $in} catch {close $out} removeFile $testfile catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET $tail

    " test http-4.5.$ThreadLevel {http::Event} -setup { set testfile [makeFile "" testfile] } -body { set out [open $testfile w] fconfigure $out -translation lf set token [http::geturl $url -channel $out] close $out upvar #0 $token data expr {$data(currentsize) == $data(totalsize)} } -cleanup { removeFile $testfile catch {http::cleanup $token} } -result 1 test http-4.6.$ThreadLevel {http::Event} -setup { set testfile [makeFile "" testfile] } -body { set out [open $testfile w] set token [http::geturl $binurl -channel $out] close $out set in [open $testfile] fconfigure $in -translation binary read $in } -cleanup { catch {close $in} catch {close $out} removeFile $testfile catch {http::cleanup $token} } -result "$bindata[string trimleft $binurl /]" proc myProgress {token total current} { global progress httpLog if {[info exists httpLog] && $httpLog} { puts "progress $total $current" } set progress [list $total $current] } test http-4.6.1.$ThreadLevel {http::Event} knownBug { set token [http::geturl $url -blocksize 50 -progress myProgress] return $progress } {111 111} test http-4.7.$ThreadLevel {http::Event} -body { set token [http::geturl $url -keepalive 0 -progress myProgress] return $progress } -cleanup { catch {http::cleanup $token} } -result {111 111} test http-4.8.$ThreadLevel {http::Event} -body { set token [http::geturl $url] http::status $token } -cleanup { catch {http::cleanup $token} } -result {ok} test http-4.9.$ThreadLevel {http::Event} -body { set token [http::geturl $url -progress myProgress] http::code $token } -cleanup { catch {http::cleanup $token} } -result {HTTP/1.0 200 Data follows} test http-4.10.$ThreadLevel {http::Event} -body { set token [http::geturl $url -progress myProgress] http::size $token } -cleanup { catch {http::cleanup $token} } -result {111} # Timeout cases # Short timeout to working server (the test server). This lets us try a # reset during the connection. test http-4.11.$ThreadLevel {http::Event} -body { set token [http::geturl $url -timeout 1 -keepalive 0 -command \#] http::reset $token http::status $token } -cleanup { catch {http::cleanup $token} } -result {reset} # Longer timeout with reset. test http-4.12.$ThreadLevel {http::Event} -body { set token [http::geturl $url/?timeout=10 -keepalive 0 -command \#] http::reset $token http::status $token } -cleanup { catch {http::cleanup $token} } -result {reset} # Medium timeout to working server that waits even longer. The timeout # hits while waiting for a reply. test http-4.13.$ThreadLevel {http::Event} -body { set token [http::geturl $url?timeout=30 -keepalive 0 -timeout 10 -command \#] http::wait $token http::status $token } -cleanup { catch {http::cleanup $token} } -result {timeout} # Longer timeout to good host, bad port, gets an error after the # connection "completes" but the socket is bad. test http-4.14.$ThreadLevel {http::Event} -body { set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command \#] if {$token eq ""} { error "bogus return from http::geturl" } http::wait $token lindex [http::error $token] 0 } -cleanup { catch {http::cleanup $token} } -result {connect failed: connection refused} # Bogus host test http-4.15.$ThreadLevel {http::Event} -body { # 1. The test assumes that http is not using a proxy server. # If http is using a proxy server, the latter is responsible for the DNS # lookup of the non-existent host. Squid responds with # "503 Service Unavailable" and an explanatory response body; but other # proxies may respond differently. # 2. The [socket] command blocks during the DNS lookup. # - When [socket] runs in the main thread (i.e. when -threadlevel is 0 or # (if Thread package not available) 1), the script cannot time out # during a prolonged DNS lookup. # - When [socket] runs in a separate thread (i.e. when the Thread package # is available and [http::config -threadlevel] is 1 or 2), the main # thread enters the event loop and has the opportunity to time out # during the DNS lookup. This causes the test to fail. # - The test uses a long -timeout so that it is not confounded by a slow # DNS lookup. # - If the error result is "timeout", this suggests a problem with # negative DNS lookups on the test host. Compare the timings for # different values of threadLevel. # set t0 [clock milliseconds] set token [http::geturl //not-a-host.nodns. -timeout 30000 -command \#] http::wait $token # set t1 [clock milliseconds] # puts "Test http-4.15.$ThreadLevel - time taken: [expr {$t1 - $t0}] ms" set result "[http::status $token] -- [lindex [http::error $token] 0]" # error codes vary among platforms. } -cleanup { catch {http::cleanup $token} } -match glob -result "error -- couldn't open socket*" test http-4.16.$ThreadLevel {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup { proc list-difference {l1 l2} { lmap item $l2 {if {$item in $l1} continue; set item} } } -body { set before [chan names] set token [http::geturl $url -headers {X-Connection keep-alive}] http::cleanup $token update # Compute what channels have been unexpectedly leaked past cleanup list-difference $before [chan names] } -cleanup { rename list-difference {} } -result {} test http-5.1.$ThreadLevel {http::formatQuery} { http::formatQuery name1 value1 name2 "value two" } {name1=value1&name2=value%20two} # test http-5.2 obsoleted by 5.4 and 5.5 with http 2.5 test http-5.3.$ThreadLevel {http::formatQuery} { http::formatQuery lines "line1\nline2\nline3" } {lines=line1%0D%0Aline2%0D%0Aline3} test http-5.4.$ThreadLevel {http::formatQuery} { http::formatQuery name1 ~bwelch name2 ¡¢¢ } {name1=~bwelch&name2=%C2%A1%C2%A2%C2%A2} test http-5.5.$ThreadLevel {http::formatQuery} { set enc [http::config -urlencoding] http::config -urlencoding iso8859-1 set res [http::formatQuery name1 ~bwelch name2 ¡¢¢] http::config -urlencoding $enc set res } {name1=~bwelch&name2=%A1%A2%A2} test http-6.1.$ThreadLevel {http::ProxyRequired} -body { http::config -proxyhost ${::HOST} -proxyport $port set token [http::geturl $url] http::wait $token upvar #0 $token data set data(body) } -cleanup { http::config -proxyhost {} -proxyport {} catch {http::cleanup $token} } -result "HTTP/1.0 TEST

    Hello, World!

    GET http:$url

    " test http-7.1.$ThreadLevel {http::mapReply} { http::mapReply "abc\$\[\]\"\\()\}\{" } {abc%24%5B%5D%22%5C%28%29%7D%7B} test http-7.2.$ThreadLevel {http::mapReply} { # RFC 2718 specifies that we pass urlencoding on utf-8 chars by default, # so make sure this gets converted to utf-8 then urlencoded. http::mapReply "∈" } {%E2%88%88} test http-7.3.$ThreadLevel {http::formatQuery} -setup { set enc [http::config -urlencoding] } -returnCodes error -body { # -urlencoding "" no longer supported. Use "iso8859-1". http::config -urlencoding "" http::mapReply "∈" } -cleanup { http::config -urlencoding $enc } -result {unknown encoding ""} test http-7.4.$ThreadLevel {http::formatQuery} -setup { set enc [http::config -urlencoding] } -constraints { knownProfileBug } -body { # this would be reverting to http <=2.4 behavior w/o errors # with Tcl 8.x (unknown chars become '?'), generating a # proper exception with Tcl 9.0 http::config -urlencoding "iso8859-1" http::mapReply "∈" } -cleanup { http::config -urlencoding $enc } -errorCode {TCL ENCODING ILLEGALSEQUENCE 0} -result {unexpected character at index 0: 'U+002208'} package require tcl::idna 1.0 test http-idna-1.1.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna } -result {wrong # args: should be "::tcl::idna subcommand ?arg ...?"} test http-idna-1.2.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna ? } -result {unknown or ambiguous subcommand "?": must be decode, encode, puny, or version} test http-idna-1.3.$ThreadLevel {IDNA package: basics} -body { ::tcl::idna version } -result 1.0.1 test http-idna-1.4.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna version what } -result {wrong # args: should be "::tcl::idna version"} test http-idna-1.5.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny } -result {wrong # args: should be "::tcl::idna puny subcommand ?arg ...?"} test http-idna-1.6.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny ? } -result {unknown or ambiguous subcommand "?": must be decode, or encode} test http-idna-1.7.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny encode } -result {wrong # args: should be "::tcl::idna puny encode string ?case?"} test http-idna-1.8.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny encode a b c } -result {wrong # args: should be "::tcl::idna puny encode string ?case?"} test http-idna-1.9.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny decode } -result {wrong # args: should be "::tcl::idna puny decode string ?case?"} test http-idna-1.10.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna puny decode a b c } -result {wrong # args: should be "::tcl::idna puny decode string ?case?"} test http-idna-1.11.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna decode } -result {wrong # args: should be "::tcl::idna decode hostname"} test http-idna-1.12.$ThreadLevel {IDNA package: basics} -returnCodes error -body { ::tcl::idna encode } -result {wrong # args: should be "::tcl::idna encode hostname"} test http-idna-2.1.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode abc } abc- test http-idna-2.2.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode a€b€c } abc-k50ab test http-idna-2.3.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode ABC } ABC- test http-idna-2.4.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode A€B€C } ABC-k50ab test http-idna-2.5.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode ABC 0 } abc- test http-idna-2.6.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode A€B€C 0 } abc-k50ab test http-idna-2.7.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode ABC 1 } ABC- test http-idna-2.8.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode A€B€C 1 } ABC-k50ab test http-idna-2.9.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode abc 0 } abc- test http-idna-2.10.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode a€b€c 0 } abc-k50ab test http-idna-2.11.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode abc 1 } ABC- test http-idna-2.12.$ThreadLevel {puny encode: functional test} { ::tcl::idna puny encode a€b€c 1 } ABC-k50ab test http-idna-2.13.$ThreadLevel {puny encode: edge cases} { ::tcl::idna puny encode "" } "" test http-idna-2.14-A.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644 u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F }]] ""] } egbpdaj6bu4bxfgehfvwxn test http-idna-2.14-B.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587 }]] ""] } ihqwcrb4cv8a8dqg056pqjye test http-idna-2.14-C.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587 }]] ""] } ihqwctvzc91f659drss3x8bo0yb test http-idna-2.14-D.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074 u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D u+0065 u+0073 u+006B u+0079 }]] ""] } Proprostnemluvesky-uyb24dma41a test http-idna-2.14-E.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8 u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2 u+05D1 u+05E8 u+05D9 u+05EA }]] ""] } 4dbcagdahymbxekheh6e0a7fei0b test http-idna-2.14-F.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939 u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947 u+0939 u+0948 u+0902 }]] ""] } i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd test http-idna-2.14-G.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092 u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B }]] ""] } n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa test http-idna-2.14-H.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }]] ""] } 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c test http-idna-2.14-I.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440 u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A u+0438 }]] ""] } b1abfaaepdrnnbgefbadotcwatmq2g4l test http-idna-2.14-J.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070 u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070 u+006C u+0065 u+006D u+0065 u+006E u+0074 u+0065 u+0068 u+0061 u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070 u+0061 u+00F1 u+006F u+006C }]] ""] } PorqunopuedensimplementehablarenEspaol-fmd56a test http-idna-2.14-K.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068 u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067 u+0056 u+0069 u+1EC7 u+0074 }]] ""] } TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g test http-idna-2.14-L.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F }]] ""] } 3B-ww4c5e180e575a65lsy2b test http-idna-2.14-M.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074 u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D u+004F u+004E u+004B u+0045 u+0059 u+0053 }]] ""] } -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n test http-idna-2.14-N.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D u+305D u+308C u+305E u+308C u+306E u+5834 u+6240 }]] ""] } Hello-Another-Way--fc4qua05auwb3674vfr0b test http-idna-2.14-O.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032 }]] ""] } 2-u9tlzr9756bt3uc0v test http-idna-2.14-P.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059 u+308B u+0035 u+79D2 u+524D }]] ""] } MajiKoi5-783gue6qz075azm5e test http-idna-2.14-Q.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0 }]] ""] } de-jg4avhby1noc0d test http-idna-2.14-R.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode [join [subst [string map {u+ \\u} { u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067 }]] ""] } d9juau41awczczp test http-idna-2.14-S.$ThreadLevel {puny encode: examples from RFC 3492} { ::tcl::idna puny encode {-> $1.00 <-} } {-> $1.00 <--} test http-idna-3.1.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc- } abc test http-idna-3.2.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc-k50ab } a€b€c test http-idna-3.3.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC- } ABC test http-idna-3.4.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC-k50ab } A€B€C test http-idna-3.5.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC-K50AB } A€B€C test http-idna-3.6.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc-K50AB } a€b€c test http-idna-3.7.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC- 0 } abc test http-idna-3.8.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC-K50AB 0 } a€b€c test http-idna-3.9.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC- 1 } ABC test http-idna-3.10.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode ABC-K50AB 1 } A€B€C test http-idna-3.11.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc- 0 } abc test http-idna-3.12.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc-k50ab 0 } a€b€c test http-idna-3.13.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc- 1 } ABC test http-idna-3.14.$ThreadLevel {puny decode: functional test} { ::tcl::idna puny decode abc-k50ab 1 } A€B€C test http-idna-3.15.$ThreadLevel {puny decode: edge cases and errors} { # Is this case actually correct? binary encode hex [encoding convertto utf-8 [::tcl::idna puny decode abc]] } c282c281c280 test http-idna-3.16.$ThreadLevel {puny decode: edge cases and errors} -returnCodes error -body { ::tcl::idna puny decode abc! } -result {bad decode character "!"} test http-idna-3.17.$ThreadLevel {puny decode: edge cases and errors} { catch {::tcl::idna puny decode abc!} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT CHAR} test http-idna-3.18.$ThreadLevel {puny decode: edge cases and errors} { ::tcl::idna puny decode "" } {} # A helper so we don't get lots of crap in failures proc hexify s {lmap c [split $s ""] {format u+%04X [scan $c %c]}} test http-idna-3.19-A.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode egbpdaj6bu4bxfgehfvwxn] } [list {*}{ u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644 u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F }] test http-idna-3.19-B.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode ihqwcrb4cv8a8dqg056pqjye] } {u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587} test http-idna-3.19-C.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode ihqwctvzc91f659drss3x8bo0yb] } {u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587} test http-idna-3.19-D.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode Proprostnemluvesky-uyb24dma41a] } [list {*}{ u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074 u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D u+0065 u+0073 u+006B u+0079 }] test http-idna-3.19-E.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode 4dbcagdahymbxekheh6e0a7fei0b] } [list {*}{ u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8 u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2 u+05D1 u+05E8 u+05D9 u+05EA }] test http-idna-3.19-F.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode \ i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd] } [list {*}{ u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939 u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947 u+0939 u+0948 u+0902 }] test http-idna-3.19-G.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa] } [list {*}{ u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092 u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B }] test http-idna-3.19-H.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode \ 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c] } [list {*}{ u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }] test http-idna-3.19-I.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode b1abfaaepdrnnbgefbadotcwatmq2g4l] } [list {*}{ u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440 u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A u+0438 }] test http-idna-3.19-J.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode \ PorqunopuedensimplementehablarenEspaol-fmd56a] } [list {*}{ u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070 u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070 u+006C u+0065 u+006D u+0065 u+006E u+0074 u+0065 u+0068 u+0061 u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070 u+0061 u+00F1 u+006F u+006C }] test http-idna-3.19-K.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode \ TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g] } [list {*}{ u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068 u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067 u+0056 u+0069 u+1EC7 u+0074 }] test http-idna-3.19-L.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode 3B-ww4c5e180e575a65lsy2b] } {u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F} test http-idna-3.19-M.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n] } [list {*}{ u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074 u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D u+004F u+004E u+004B u+0045 u+0059 u+0053 }] test http-idna-3.19-N.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode Hello-Another-Way--fc4qua05auwb3674vfr0b] } [list {*}{ u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D u+305D u+308C u+305E u+308C u+306E u+5834 u+6240 }] test http-idna-3.19-O.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode 2-u9tlzr9756bt3uc0v] } {u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032} test http-idna-3.19-P.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode MajiKoi5-783gue6qz075azm5e] } [list {*}{ u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059 u+308B u+0035 u+79D2 u+524D }] test http-idna-3.19-Q.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode de-jg4avhby1noc0d] } {u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0} test http-idna-3.19-R.$ThreadLevel {puny decode: examples from RFC 3492} { hexify [::tcl::idna puny decode d9juau41awczczp] } {u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067} test http-idna-3.19-S.$ThreadLevel {puny decode: examples from RFC 3492} { ::tcl::idna puny decode {-> $1.00 <--} } {-> $1.00 <-} rename hexify "" test http-idna-4.1.$ThreadLevel {IDNA encoding} { ::tcl::idna encode abc.def } abc.def test http-idna-4.2.$ThreadLevel {IDNA encoding} { ::tcl::idna encode a€b€c.def } xn--abc-k50ab.def test http-idna-4.3.$ThreadLevel {IDNA encoding} { ::tcl::idna encode def.a€b€c } def.xn--abc-k50ab test http-idna-4.4.$ThreadLevel {IDNA encoding} { ::tcl::idna encode ABC.DEF } ABC.DEF test http-idna-4.5.$ThreadLevel {IDNA encoding} { ::tcl::idna encode A€B€C.def } xn--ABC-k50ab.def test http-idna-4.6.$ThreadLevel {IDNA encoding: invalid edge case} { # Should this be an error? ::tcl::idna encode abc..def } abc..def test http-idna-4.7.$ThreadLevel {IDNA encoding: invalid char} -returnCodes error -body { ::tcl::idna encode abc.$.def } -result {bad character "$" in DNS name} test http-idna-4.7.1.$ThreadLevel {IDNA encoding: invalid char} { catch {::tcl::idna encode abc.$.def} -> opt dict get $opt -errorcode } {IDNA INVALID_NAME_CHARACTER {$}} test http-idna-4.8.$ThreadLevel {IDNA encoding: empty} { ::tcl::idna encode "" } {} set overlong www.[join [subst [string map {u+ \\u} { u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774 u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74 u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C }]] ""].com test http-idna-4.9.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} -body { ::tcl::idna encode $overlong } -returnCodes error -result "hostname part too long" test http-idna-4.9.1.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} { catch {::tcl::idna encode $overlong} -> opt dict get $opt -errorcode } {IDNA OVERLONG_PART xn--989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c} unset overlong test http-idna-4.10.$ThreadLevel {IDNA encoding: edge cases} { ::tcl::idna encode passé.example.com } xn--pass-epa.example.com test http-idna-5.1.$ThreadLevel {IDNA decoding} { ::tcl::idna decode abc.def } abc.def test http-idna-5.2.$ThreadLevel {IDNA decoding} { # Invalid entry that's just a wrapper ::tcl::idna decode xn--abc-.def } abc.def test http-idna-5.3.$ThreadLevel {IDNA decoding} { # Invalid entry that's just a wrapper ::tcl::idna decode xn--abc-.xn--def- } abc.def test http-idna-5.4.$ThreadLevel {IDNA decoding} { # Invalid entry that's just a wrapper ::tcl::idna decode XN--abc-.XN--def- } abc.def test http-idna-5.5.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body { ::tcl::idna decode xn--$$$.example.com } -result {bad decode character "$"} test http-idna-5.5.1.$ThreadLevel {IDNA decoding: error cases} { catch {::tcl::idna decode xn--$$$.example.com} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT CHAR} test http-idna-5.6.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body { ::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def } -result {exceeded input data} test http-idna-5.6.1.$ThreadLevel {IDNA decoding: error cases} { catch {::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def} -> opt dict get $opt -errorcode } {PUNYCODE BAD_INPUT LENGTH} # cleanup catch {unset url} catch {unset badurl} catch {unset port} catch {unset data} if {[llength $threadStack]} { eval [lpop threadStack] } else { close $listen } if {[info exists removeHttpd]} { removeFile $httpdFile } rename bgerror {} if {[testConstraint ThreadLevelSummary]} { ::tcltest::cleanupTests } # Local variables: # mode: tcl # End: tcl9.0.3/tests/history.test0000644000175000017500000002331715104661341015321 0ustar sergeisergei# Commands covered: history # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # The history command might be autoloaded... if {[catch {history}]} { testConstraint history 0 } else { testConstraint history 1 } if {[testConstraint history]} { set num [history nextid] history keep 3 history add {set a 12345} history add {set b [format {A test %s} string]} history add {Another test} } else { # Dummy value, must be numeric set num 0 } # "history event" test history-1.1 {event option} history {history event -1} \ {set b [format {A test %s} string]} test history-1.2 {event option} history {history event $num} \ {set a 12345} test history-1.3 {event option} history {history event [expr {$num+2}]} \ {Another test} test history-1.4 {event option} history {history event set} \ {set b [format {A test %s} string]} test history-1.5 {event option} history {history e "* a*"} \ {set a 12345} test history-1.6 {event option} history {catch {history event *gorp} msg} 1 test history-1.7 {event option} history { catch {history event *gorp} msg set msg } {no event matches "*gorp"} test history-1.8 {event option} history {history event} \ {set b [format {A test %s} string]} test history-1.9 {event option} history {catch {history event 123 456} msg} 1 test history-1.10 {event option} -constraints history -body { catch {history event 123 456} msg set msg } -match glob -result {wrong # args: should be "*history event \?event\?"} # "history redo" if {[testConstraint history]} { set a 0 history redo -2 } test history-2.1 {redo option} history {set a} 12345 if {[testConstraint history]} { set b 0 history redo } test history-2.2 {redo option} history {set b} {A test string} test history-2.3 {redo option} history {catch {history redo -3 -4}} 1 test history-2.4 {redo option} -constraints history -body { catch {history redo -3 -4} msg set msg } -match glob -result {wrong # args: should be "*history redo \?event\?"} # "history add" if {[testConstraint history]} { history add "set a 444" exec } test history-3.1 {add option} history {set a} 444 test history-3.2 {add option} history {catch {history add "set a 444" execGorp}} 1 test history-3.3 {add option} history { catch {history add "set a 444" execGorp} msg set msg } {bad argument "execGorp": should be "exec"} test history-3.4 {add option} history {catch {history add "set a 444" a} msg} 1 test history-3.5 {add option} history { catch {history add "set a 444" a} msg set msg } {bad argument "a": should be "exec"} if {[testConstraint history]} { history add "set a 555" e } test history-3.6 {add option} history {set a} 555 if {[testConstraint history]} { history add "set a 666" } test history-3.7 {add option} history {set a} 555 test history-3.8 {add option} history {catch {history add "set a 666" e f} msg} 1 test history-3.9 {add option} -constraints history -body { catch {history add "set a 666" e f} msg set msg } -match glob -result {wrong # args: should be "*history add event \?exec\?"} # "history change" if {[testConstraint history]} { history change "A test value" } test history-4.1 {change option} history {history event [expr {[history n]-1}]} \ "A test value" if {[testConstraint history]} { history ch "Another test" -1 } test history-4.2 {change option} history {history e} "Another test" test history-4.3 {change option} history {history event [expr {[history n]-1}]} \ "A test value" test history-4.4 {change option} history {catch {history change Foo 4 10}} 1 test history-4.5 {change option} -constraints history -body { catch {history change Foo 4 10} msg set msg } -match glob -result {wrong # args: should be "*history change newValue \?event\?"} test history-4.6 {change option} history { catch {history change Foo [expr {[history n]-4}]} } 1 if {[testConstraint history]} { set num [expr {[history n]-4}] } test history-4.7 {change option} history { catch {history change Foo $num} msg set msg } "event \"$num\" is too far in the past" # "history info" if {[testConstraint history]} { set num [history n] history add set\ a\ {b\nc\ d\ e} history add {set b 1234} history add set\ c\ {a\nb\nc} } test history-5.1 {info option} history {history info} [format {%6d set a {b c d e} %6d set b 1234 %6d set c {a b c}} $num [expr {$num+1}] [expr {$num+2}]] test history-5.2 {info option} history {history i 2} [format {%6d set b 1234 %6d set c {a b c}} [expr {$num+1}] [expr {$num+2}]] test history-5.3 {info option} history {catch {history i 2 3}} 1 test history-5.4 {info option} -constraints history -body { catch {history i 2 3} msg set msg } -match glob -result {wrong # args: should be "*history info \?count\?"} test history-5.5 {info option} history {history} [format {%6d set a {b c d e} %6d set b 1234 %6d set c {a b c}} $num [expr {$num+1}] [expr {$num+2}]] # "history keep" if {[testConstraint history]} { history add "foo1" history add "foo2" history add "foo3" history keep 2 } test history-6.1 {keep option} history { history event [expr {[history n]-1}] } foo3 test history-6.2 {keep option} history {history event -1} foo2 test history-6.3 {keep option} history {catch {history event -3}} 1 test history-6.4 {keep option} history { catch {history event -3} msg set msg } {event "-3" is too far in the past} if {[testConstraint history]} { history k 5 } test history-6.5 {keep option} history {history event -1} foo2 test history-6.6 {keep option} history {history event -2} {} test history-6.7 {keep option} history {history event -3} {} test history-6.8 {keep option} history {history event -4} {} test history-6.9 {keep option} history {catch {history event -5}} 1 test history-6.10 {keep option} history {catch {history keep 4 6}} 1 test history-6.11 {keep option} -constraints history -body { catch {history keep 4 6} msg set msg } -match glob -result {wrong # args: should be "*history keep \?count\?"} test history-6.12 {keep option} history {catch {history keep}} 0 test history-6.13 {keep option} history { history keep } {5} test history-6.14 {keep option} history {catch {history keep -3}} 1 test history-6.15 {keep option} history { catch {history keep -3} msg set msg } {illegal keep count "-3"} test history-6.16 {keep option} history { catch {history keep butter} msg set msg } {illegal keep count "butter"} # "history nextid" if {[testConstraint history]} { set num [history n] history add "Testing" history add "Testing2" } test history-7.1 {nextid option} history {history event} "Testing" test history-7.2 {nextid option} history {history next} [expr {$num+2}] test history-7.3 {nextid option} history {catch {history nextid garbage}} 1 test history-7.4 {nextid option} -constraints history -body { catch {history nextid garbage} msg set msg } -match glob -result {wrong # args: should be "*history nextid"} # "history clear" if {[testConstraint history]} { set num [history n] history add "Testing" history add "Testing2" } test history-8.1 {clear option} history {catch {history clear junk}} 1 test history-8.2 {clear option} history {history clear} {} if {[testConstraint history]} { history clear history add "Testing" } test history-8.3 {clear option} history {history} { 1 Testing} # miscellaneous test history-9.1 {miscellaneous} history {catch {history gorp} msg} 1 test history-9.2 {miscellaneous} history { catch {history gorp} msg set msg } {unknown or ambiguous subcommand "gorp": must be add, change, clear, event, info, keep, nextid, or redo} # History retains references; Bug 1ae12987cb test history-10.1 {references kept by history} -constraints history -setup { interp create histtest histtest eval { # Trigger any autoloading that might be present catch {history} proc refcount {x} { set rep [::tcl::unsupported::representation $x] regexp {with a refcount of (\d+)} $rep -> rc # Ignore the references due to calling this procedure return [expr {$rc - 3}] } } } -body { histtest eval { # A fresh object, refcount 1 from the variable we write it to set obj [expr {rand()}] set baseline [refcount $obj] lappend result [refcount $obj] history add [list list $obj] lappend result [refcount $obj] history clear lappend result [refcount $obj] } } -cleanup { interp delete histtest } -result {1 2 1} test history-10.2 {references kept by history} -constraints history -setup { interp create histtest histtest eval { # Trigger any autoloading that might be present catch {history} proc refcount {x} { set rep [::tcl::unsupported::representation $x] regexp {with a refcount of (\d+)} $rep -> rc # Ignore the references due to calling this procedure return [expr {$rc - 3}] } } } -body { histtest eval { # A fresh object, refcount 1 from the variable we write it to set obj [expr {rand()}] set baseline [refcount $obj] lappend result [refcount $obj] history add [list list $obj] lappend result [refcount $obj] rename history {} lappend result [refcount $obj] } } -cleanup { interp delete histtest } -result {1 2 1} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/get.test0000644000175000017500000001424215104661341014374 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for the procedures in the # file tclGet.c. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] source [file join [file dirname [info script]] tcltests.tcl] testConstraint testgetint [llength [info commands testgetint]] testConstraint testdoubleobj [llength [info commands testdoubleobj]] testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}] test get-1.1 {Tcl_GetInt procedure} testgetint { testgetint 44 { 22} } {66} test get-1.2 {Tcl_GetInt procedure} testgetint { testgetint 44 -3 } {41} test get-1.3 {Tcl_GetInt procedure} testgetint { testgetint 44 +8 } {52} test get-1.4 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 foo} msg] $msg } {1 {expected integer but got "foo"}} test get-1.5 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 {16 }} msg] $msg } {0 60} test get-1.6 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 {16 x}} msg] $msg } {1 {expected integer but got a list}} test get-1.7 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 18446744073709551616} msg] $msg $errorCode } {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}} test get-1.8 {Tcl_GetInt procedure} {testgetint longIs64bit} { testgetint 18446744073709551614 } {-2} test get-1.9 {Tcl_GetInt procedure} {testgetint longIs64bit} { testgetint +18446744073709551614 } {-2} test get-1.10 {Tcl_GetInt procedure} testgetint { list [catch {testgetint -18446744073709551614} msg] $msg $errorCode } {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}} test get-1.11 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 44 4294967296} msg] $msg $errorCode } {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}} test get-1.12 {Tcl_GetInt procedure} testgetint { list [catch {testgetint 4294967294} msg] $msg } {0 -2} test get-1.13 {Tcl_GetInt procedure} testgetint { list [catch {testgetint +4294967294} msg] $msg } {0 -2} test get-1.14 {Tcl_GetInt procedure} testgetint { list [catch {testgetint -4294967294} msg] $msg } {1 {integer value too large to represent}} test get-2.1 {Tcl_GetInt procedure} { format %g 1.23 } {1.23} test get-2.2 {Tcl_GetInt procedure} { format %g { 1.23 } } {1.23} test get-2.3 {Tcl_GetInt procedure} { list [catch {format %g clip} msg] $msg } {1 {expected floating-point number but got "clip"}} test get-2.4 {Tcl_GetInt procedure} { format %g .000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 } 0 test get-3.1 {Tcl_GetInt(FromObj), bad numbers} { # SF bug #634856 set result "" set numbers [list 1 +1 ++1 +-1 -+1 -1 --1 "- +1" "+12345678987654321" "++12345678987654321"] foreach num $numbers { lappend result [catch {format %ld $num} msg] $msg } set result } {0 1 0 1 1 {expected integer but got "++1"} 1 {expected integer but got "+-1"} 1 {expected integer but got "-+1"} 0 -1 1 {expected integer but got "--1"} 1 {expected integer but got a list} 0 12345678987654321 1 {expected integer but got "++12345678987654321"}} test get-3.2 {Tcl_GetDouble(FromObj), bad numbers} { set result "" set numbers [list 1.0 +1.0 ++1.0 +-1.0 -+1.0 -1.0 --1.0 "- +1.0"] foreach num $numbers { lappend result [catch {format %g $num} msg] $msg } set result } {0 1 0 1 1 {expected floating-point number but got "++1.0"} 1 {expected floating-point number but got "+-1.0"} 1 {expected floating-point number but got "-+1.0"} 0 -1 1 {expected floating-point number but got "--1.0"} 1 {expected floating-point number but got a list}} # Bug 7114ac6141 test get-3.3 {tcl_GetInt with iffy numbers} testgetint { lmap x {0 " 0" "0 " " 0 " " 0xa " " 010 " " 0o10 " " 0b10 "} { catch {testgetint 44 $x} x set x } } {44 44 44 44 54 54 52 46} test get-3.4 {Tcl_GetDouble with iffy numbers} testdoubleobj { lmap x {0 0.0 " .0" ".0 " " 0e0 " "09" "- 0" "-0" "0o12" "0b10" "2_0.3_4e+1_5" _1.0e+2 1_.0e+2 1._0e+2 1.0_e+2 1.0e_+2 1.0e+_2 1.0e+2_ 1_1.0e+0_2 2__2.0e+2__2 54321________} { catch {testdoubleobj set 1 $x} x set x } } {0.0 0.0 0.0 0.0 0.0 9.0 {expected floating-point number but got a list} 0.0 10.0 2.0 20340000000000000.0 {expected floating-point number but got "_1.0e+2"} {expected floating-point number but got "1_.0e+2"} {expected floating-point number but got "1._0e+2"} {expected floating-point number but got "1.0_e+2"} {expected floating-point number but got "1.0e_+2"} {expected floating-point number but got "1.0e+_2"} {expected floating-point number but got "1.0e+2_"} 1100.0 2.2e+23 {expected floating-point number but got "54321________"}} test get-3.5 {tcl_GetInt with numeric whitespace (i.e. '_')} testgetint { lmap x {0_0 " 1_0" "0_2 " " 3_3 " 14__23__32___4 " 0x0_a " 0b1111_1111 " 0_07 " " 0o1_0 " " 0b_1_0 " " 0_b1_0 " _33 42_ 0_x15 0_o17 0_d19 0x_b 0o_2_0 0o2__3_4} { catch {testgetint $x} x set x } } {0 10 2 33 1423324 10 255 7 8 {expected integer but got " 0b_1_0 "} {expected integer but got " 0_b1_0 "} {expected integer but got "_33"} {expected integer but got "42_"} {expected integer but got "0_x15"} {expected integer but got "0_o17"} {expected integer but got "0_d19"} {expected integer but got "0x_b"} {expected integer but got "0o_2_0"} 156} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/format.test0000644000175000017500000005442515104661341015114 0ustar sergeisergei# Commands covered: format # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1998 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # %z/%t/%p output depends on pointerSize, so some tests are not portable. testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}] # MSVC uses a broken libc that gets sprintf("%g") wrong. This is a pain # particularly in Continuous Integration, and there isn't anything much we can # do about it. testConstraint knownMsvcBug [expr {[tcl::build-info msvc] eq 0}] test format-1.1 {integer formatting} { format "%*d %d %d %d" 6 34 16923 -12 -1 } { 34 16923 -12 -1} test format-1.2 {integer formatting} { format "%4d %4d %4d %4d %d %#x %#X" 6 34 16923 -12 -1 14 12 } { 6 34 16923 -12 -1 0xe 0xC} test format-1.3 {integer formatting} { format "%4u %4u %4u %4u %d %#o" 6 34 16923 -12 -1 0 } { 6 34 16923 4294967284 -1 0} test format-1.4 {integer formatting} { format "%-4d %-4i %-4d %-4ld" 6 34 16923 -12 -1 } {6 34 16923 -12 } test format-1.5 {integer formatting} { format "%04d %04d %04d %04i" 6 34 16923 -12 -1 } {0006 0034 16923 -012} test format-1.6 {integer formatting} { format "%00*d" 6 34 } {000034} # Printing negative numbers in hex or octal format depends on word # length, so these tests are not portable. test format-1.7 {integer formatting} { format "%4x %4x %4x %4x" 6 34 16923 -12 -1 } { 6 22 421b fffffff4} test format-1.8 {integer formatting} { format "%#x %#x %#X %#X %#x" 0 6 34 16923 -12 -1 } {0 0x6 0x22 0x421B 0xfffffff4} test format-1.9 {integer formatting} { format "%#5x %#20x %#20x %#20x %#20x" 0 6 34 16923 -12 -1 } { 0 0x6 0x22 0x421b 0xfffffff4} test format-1.10 {integer formatting} { format "%-#5x %-#20x %-#20x %-#20x %-#20x" 0 6 34 16923 -12 -1 } {0 0x6 0x22 0x421b 0xfffffff4 } test format-1.11 {integer formatting} { format "%-#5o %-#20o %#-20o %#-20o %#-20o" 0 6 34 16923 -12 -1 } {0 0o6 0o42 0o41033 0o37777777764 } test format-1.12 {integer formatting} { format "%b %#b %#b %llb" 5 0 5 [expr {2**100}] } {101 0 0b101 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} test format-1.13 {integer formatting} { format "%#0d %#0d %#0d %#0d %#0d" 0 6 34 16923 -12 -1 } {0 0d6 0d34 0d16923 -0d12} test format-1.14 {integer formatting} { format "%#05d %#020d %#020d %#020d %#020d" 0 6 34 16923 -12 -1 } {00000 0d000000000000000006 0d000000000000000034 0d000000000000016923 -0d00000000000000012} test format-1.15 {integer formatting} { format "%-#05d %-#020d %-#020d %-#020d %-#020d" 0 6 34 16923 -12 -1 } {00000 0d000000000000000006 0d000000000000000034 0d000000000000016923 -0d00000000000000012} test format-2.1 {string formatting} { format "%s %s %c %s" abcd {This is a very long test string.} 120 x } {abcd This is a very long test string. x x} test format-2.2 {string formatting} { format "%20s %20s %20c %20s" abcd {This is a very long test string.} 120 x } { abcd This is a very long test string. x x} test format-2.3 {string formatting} { format "%.10s %.10s %c %.10s" abcd {This is a very long test string.} 120 x } {abcd This is a x x} test format-2.4 {string formatting} { format "%s %s %% %c %s" abcd {This is a very long test string.} 120 x } {abcd This is a very long test string. % x x} test format-2.5 {string formatting, embedded nulls} { format "%10s" abc\x00def } " abc\x00def" test format-2.6 {string formatting, international chars} { format "%10s" abc\uFEFFdef } " abc\uFEFFdef" test format-2.7 {string formatting, international chars} { format "%.5s" abc\uFEFFdef } "abc\uFEFFd" test format-2.8 {string formatting, international chars} { format "foo\uFEFFbar%s" baz } "foo\uFEFFbarbaz" test format-2.9 {string formatting, width} { format "a%5sa" f } "a fa" test format-2.10 {string formatting, width} { format "a%-5sa" f } "af a" test format-2.11 {string formatting, width} { format "a%2sa" foo } "afooa" test format-2.12 {string formatting, width} { format "a%0sa" foo } "afooa" test format-2.13 {string formatting, precision} { format "a%.2sa" foobarbaz } "afoa" test format-2.14 {string formatting, precision} { format "a%.sa" foobarbaz } "aa" test format-2.15 {string formatting, precision} { list [catch {format "a%.-2sa" foobarbaz} msg] $msg } {1 {bad field specifier "-"}} test format-2.16 {string formatting, width and precision} { format "a%5.2sa" foobarbaz } "a foa" test format-2.17 {string formatting, width and precision} { format "a%5.7sa" foobarbaz } "afoobarba" test format-2.18 {string formatting, surrogates} { format "\uD83D%s" \uDE02 } \uD83D\uDE02 test format-2.19 {string formatting, surrogates} { format "%s\uDE02" \uD83D } \uD83D\uDE02 test format-3.1 {Tcl_FormatObjCmd: character formatting} { format "|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|" 65 65 65 65 65 65 3 65 -4 65 } "|A|A|A|A|A | A| A|A |" test format-3.2 {Tcl_FormatObjCmd: international character formatting} { format "|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|" 0xA2 0x4E4E 0x25A 0xC3 0xFF08 0 3 0x6575 -4 0x4E4F } "|¢|乎|ɚ|Ã|( | \x00| 敵|乏 |" test format-4.1 {e and f formats} {eformat} { format "%e %e %e %e" 34.2e12 68.514 -.125 -16000. .000053 } {3.420000e+13 6.851400e+01 -1.250000e-01 -1.600000e+04} test format-4.2 {e and f formats} {eformat} { format "%20e %20e %20e %20e" 34.2e12 68.514 -.125 -16000. .000053 } { 3.420000e+13 6.851400e+01 -1.250000e-01 -1.600000e+04} test format-4.3 {e and f formats} {eformat} { format "%.1e %.1e %.1e %.1e" 34.2e12 68.514 -.126 -16000. .000053 } {3.4e+13 6.9e+01 -1.3e-01 -1.6e+04} test format-4.4 {e and f formats} {eformat} { format "%020e %020e %020e %020e" 34.2e12 68.514 -.126 -16000. .000053 } {000000003.420000e+13 000000006.851400e+01 -00000001.260000e-01 -00000001.600000e+04} test format-4.5 {e and f formats} {eformat} { format "%7.1e %7.1e %7.1e %7.1e" 34.2e12 68.514 -.126 -16000. .000053 } {3.4e+13 6.9e+01 -1.3e-01 -1.6e+04} test format-4.6 {e and f formats} { format "%f %f %f %f" 34.2e12 68.514 -.125 -16000. .000053 } {34200000000000.000000 68.514000 -0.125000 -16000.000000} test format-4.7 {e and f formats} { format "%.4f %.4f %.4f %.4f %.4f" 34.2e12 68.514 -.125 -16000. .000053 } {34200000000000.0000 68.5140 -0.1250 -16000.0000 0.0001} test format-4.8 {e and f formats} {eformat} { format "%.4e %.5e %.6e" -9.99996 -9.99996 9.99996 } {-1.0000e+01 -9.99996e+00 9.999960e+00} test format-4.9 {e and f formats} { format "%.4f %.5f %.6f" -9.99996 -9.99996 9.99996 } {-10.0000 -9.99996 9.999960} test format-4.10 {e and f formats} { format "%20f %-20f %020f" -9.99996 -9.99996 9.99996 } { -9.999960 -9.999960 0000000000009.999960} test format-4.11 {e and f formats} { format "%-020f %020f" -9.99996 -9.99996 9.99996 } {-9.999960 -000000000009.999960} test format-4.12 {e and f formats} {eformat} { format "%.0e %#.0e" -9.99996 -9.99996 9.99996 } {-1e+01 -1.e+01} test format-4.13 {e and f formats} { format "%.0f %#.0f" -9.99996 -9.99996 9.99996 } {-10 -10.} test format-4.14 {e and f formats} { format "%.4f %.5f %.6f" -9.99996 -9.99996 9.99996 } {-10.0000 -9.99996 9.999960} test format-4.15 {e and f formats} { format "%3.0f %3.0f %3.0f %3.0f" 1.0 1.1 1.01 1.001 } { 1 1 1 1} test format-4.16 {e and f formats} { format "%3.1f %3.1f %3.1f %3.1f" 0.0 0.1 0.01 0.001 } {0.0 0.1 0.0 0.0} test format-5.1 {g-format} {eformat} { format "%.3g" 12341.0 } {1.23e+04} test format-5.2 {g-format} {eformat} { format "%.3G" 1234.12345 } {1.23E+03} test format-5.3 {g-format} { format "%.3g" 123.412345 } {123} test format-5.4 {g-format} { format "%.3g" 12.3412345 } {12.3} test format-5.5 {g-format} { format "%.3g" 1.23412345 } {1.23} test format-5.6 {g-format} { format "%.3g" 1.23412345 } {1.23} test format-5.7 {g-format} { format "%.3g" .123412345 } {0.123} test format-5.8 {g-format} { format "%.3g" .012341 } {0.0123} test format-5.9 {g-format} { format "%.3g" .0012341 } {0.00123} test format-5.10 {g-format} { format "%.3g" .00012341 } {0.000123} test format-5.11 {g-format} {eformat} { format "%.3g" .00001234 } {1.23e-05} test format-5.12 {g-format} {eformat} { format "%.4g" 9999.6 } {1e+04} test format-5.13 {g-format} { format "%.4g" 999.96 } {1000} test format-5.14 {g-format} { format "%.3g" 1.0 } {1} test format-5.15 {g-format} { format "%.3g" .1 } {0.1} test format-5.16 {g-format} { format "%.3g" .01 } {0.01} test format-5.17 {g-format} { format "%.3g" .001 } {0.001} test format-5.18 {g-format} {eformat} { format "%.3g" .00001 } {1e-05} test format-5.19 {g-format} {eformat} { format "%#.3g" 1234.0 } {1.23e+03} test format-5.20 {g-format} {eformat} { format "%#.3G" 9999.5 } {1.00E+04} test format-6.1 {floating-point zeroes} {eformat} { format "%e %f %g" 0.0 0.0 0.0 0.0 } {0.000000e+00 0.000000 0} test format-6.2 {floating-point zeroes} {eformat} { format "%.4e %.4f %.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0} test format-6.3 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.4e %#.4f %#.4g" 0.0 0.0 0.0 0.0 } {0.0000e+00 0.0000 0.000} test format-6.4 {floating-point zeroes} {eformat} { format "%.0e %.0f %.0g" 0.0 0.0 0.0 0.0 } {0e+00 0 0} test format-6.5 {floating-point zeroes} {eformat knownMsvcBug} { format "%#.0e %#.0f %#.0g" 0.0 0.0 0.0 0.0 } {0.e+00 0. 0.} test format-6.6 {floating-point zeroes} { format "%3.0f %3.0f %3.0f %3.0f" 0.0 0.0 0.0 0.0 } { 0 0 0 0} test format-6.7 {floating-point zeroes} { format "%3.0f %3.0f %3.0f %3.0f" 1.0 1.1 1.01 1.001 } { 1 1 1 1} test format-6.8 {floating-point zeroes} { format "%3.1f %3.1f %3.1f %3.1f" 0.0 0.1 0.01 0.001 } {0.0 0.1 0.0 0.0} test format-7.1 {various syntax features} { format "%*.*f" 12 3 12.345678901 } { 12.346} test format-7.2 {various syntax features} { format "%0*.*f" 12 3 12.345678901 } {00000012.346} test format-7.3 {various syntax features} { format "\*\t\\n" } {* \n} test format-8.1 {error conditions} { catch format } 1 test format-8.2 {error conditions} { catch format msg set msg } {wrong # args: should be "format formatString ?arg ...?"} test format-8.3 {error conditions} { catch {format %*d} } 1 test format-8.4 {error conditions} { catch {format %*d} msg set msg } {not enough arguments for all format specifiers} test format-8.5 {error conditions} { catch {format %*.*f 12} } 1 test format-8.6 {error conditions} { catch {format %*.*f 12} msg set msg } {not enough arguments for all format specifiers} test format-8.7 {error conditions} { catch {format %*.*f 12 3} } 1 test format-8.8 {error conditions} { catch {format %*.*f 12 3} msg set msg } {not enough arguments for all format specifiers} test format-8.9 {error conditions} { list [catch {format %*d x 3} msg] $msg } {1 {expected integer but got "x"}} test format-8.10 {error conditions} { list [catch {format %*.*f 2 xyz 3} msg] $msg } {1 {expected integer but got "xyz"}} test format-8.11 {error conditions} { catch {format %d 2a} } 1 test format-8.12 {error conditions} { catch {format %d 2a} msg set msg } {expected integer but got "2a"} test format-8.13 {error conditions} { catch {format %c 2x} } 1 test format-8.14 {error conditions} { catch {format %c 2x} msg set msg } {expected integer but got "2x"} test format-8.15 {error conditions} { catch {format %f 2.1z} } 1 test format-8.16 {error conditions} { catch {format %f 2.1z} msg set msg } {expected floating-point number but got "2.1z"} test format-8.17 {error conditions} { catch {format ab%} } 1 test format-8.18 {error conditions} { catch {format ab% 12} msg set msg } {format string ended in middle of field specifier} test format-8.19 {error conditions} { catch {format %q x} } 1 test format-8.20 {error conditions} { catch {format %r x} msg set msg } {bad field specifier "r"} test format-8.21 {error conditions} { catch {format %d} } 1 test format-8.22 {error conditions} { catch {format %d} msg set msg } {not enough arguments for all format specifiers} test format-8.23 {error conditions} { catch {format "%d %d" 24 xyz} msg set msg } {expected integer but got "xyz"} test format-8.24 {Other formats} -body { format "%zd %td %d" [expr {2**30}] [expr {2**30}] [expr {2**30}] } -result {1073741824 1073741824 1073741824} test format-8.25 {Other formats} -constraints pointerIs64bit -body { format "%zd %td %lld" [expr {2**33}] [expr {2**33}] [expr {2**33}] } -result {8589934592 8589934592 8589934592} test format-8.26 {Other formats} -body { format "%p %#x" [expr {2**31}] [expr {2**31}] } -result {0x80000000 0x80000000} test format-8.27 {Other formats} -constraints pointerIs64bit -body { format "%p %#llx" [expr {2**33}] [expr {2**33}] } -result {0x200000000 0x200000000} test format-8.28 {Internal use of TCL_COMBINE flag should not be visible at script level} { format %c 0x10000041 } \uFFFD test format-9.1 {long result} { set a {1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} format {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG %s %s} $a $a } {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} test format-10.1 {"h" format specifier} { format %hd 0xffff } -1 test format-10.2 {"h" format specifier} { format %hx 0x10fff } fff test format-10.3 {"h" format specifier} { format %hd 0x10000 } 0 test format-10.4 {"h" format specifier} { # Bug 1154163: This is minimal behaviour for %hx specifier! format %hx 1 } 1 test format-10.5 {"h" format specifier} { # Bug 1284178: Highly out-of-range values shouldn't cause errors format %hu 0x100000000 } 0 test format-11.1 {XPG3 %$n specifiers} { format {%2$d %1$d} 4 5 } {5 4} test format-11.2 {XPG3 %$n specifiers} { format {%2$d %1$d %1$d %3$d} 4 5 6 } {5 4 4 6} test format-11.3 {XPG3 %$n specifiers} { list [catch {format {%2$d %3$d} 4 5} msg] $msg } {1 {"%n$" argument index out of range}} test format-11.4 {XPG3 %$n specifiers} { list [catch {format {%2$d %0$d} 4 5 6} msg] $msg } {1 {"%n$" argument index out of range}} test format-11.5 {XPG3 %$n specifiers} { list [catch {format {%d %1$d} 4 5 6} msg] $msg } {1 {cannot mix "%" and "%n$" conversion specifiers}} test format-11.6 {XPG3 %$n specifiers} { list [catch {format {%2$d %d} 4 5 6} msg] $msg } {1 {cannot mix "%" and "%n$" conversion specifiers}} test format-11.7 {XPG3 %$n specifiers} { list [catch {format {%2$d %3d} 4 5 6} msg] $msg } {1 {cannot mix "%" and "%n$" conversion specifiers}} test format-11.8 {XPG3 %$n specifiers} { format {%2$*d %3$d} 1 10 4 } { 4 4} test format-11.9 {XPG3 %$n specifiers} { format {%2$.*s %4$d} 1 5 abcdefghijklmnop 44 } {abcde 44} test format-11.10 {XPG3 %$n specifiers} { list [catch {format {%2$*d} 4} msg] $msg } {1 {"%n$" argument index out of range}} test format-11.11 {XPG3 %$n specifiers} { list [catch {format {%2$*d} 4 5} msg] $msg } {1 {"%n$" argument index out of range}} test format-11.12 {XPG3 %$n specifiers} { list [catch {format {%2$*d} 4 5 6} msg] $msg } {0 { 6}} test format-11.13 {XPG3 %$n specifiers} { format {%2$.*s %4$d} 1 -4294967298 abcdefghijklmnop 44 } { 44} test format-11.14 {XPG3 %$n specifiers} { format {%2$.*s %4$d} 1 4294967298 abcdefghijklmnop 44 } {abcdefghijklmnop 44} test format-12.1 {negative width specifiers} { format "%*d" -47 25 } {25 } test format-13.1 {tcl_precision fuzzy comparison} { catch {unset a} catch {unset b} catch {unset c} catch {unset d} set a 0.0000000000001 set b 0.00000000000001 set c 0.00000000000000001 set d [expr {$a + $b + $c}] format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d } {0.0000000000 0.000000000000 0.000000000000110 0.00000000000011001} test format-13.2 {tcl_precision fuzzy comparison} { catch {unset a} catch {unset b} catch {unset c} catch {unset d} set a 0.000000000001 set b 0.000000000000005 set c 0.0000000000000008 set d [expr {$a + $b + $c}] format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d } {0.0000000000 0.000000000001 0.000000000001006 0.00000000000100580} test format-13.3 {tcl_precision fuzzy comparison} { catch {unset a} catch {unset b} catch {unset c} set a 0.00000000000099 set b 0.000000000000011 set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f %0.17f} $c $c $c $c } {0.0000000000 0.000000000001 0.000000000001001 0.00000000000100100} test format-13.4 {tcl_precision fuzzy comparison} { catch {unset a} catch {unset b} catch {unset c} set a 0.444444444444 set b 0.33333333333333 set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f %0.16f} $c $c $c $c } {0.7777777778 0.777777777777 0.777777777777330 0.7777777777773300} test format-13.5 {tcl_precision fuzzy comparison} { catch {unset a} catch {unset b} catch {unset c} set a 0.444444444444 set b 0.99999999999999 set c [expr {$a + $b}] format {%0.10f %0.12f %0.15f} $c $c $c } {1.4444444444 1.444444444444 1.444444444443990} test format-14.1 {testing MAX_FLOAT_SIZE for 0 and 1} { format {%s} "" } {} test format-14.2 {testing MAX_FLOAT_SIZE for 0 and 1} { format {%s} "a" } {a} test format-15.1 {testing %0..s 0 padding for chars/strings} { format %05s a } {0000a} test format-15.2 {testing %0..s 0 padding for chars/strings} { format "% 5s" a } { a} test format-15.3 {testing %0..s 0 padding for chars/strings} { format %5s a } { a} test format-15.4 {testing %0..s 0 padding for chars/strings} { format %05c 61 } {0000=} test format-15.5 {testing %d space padding for integers} { format "(% 1d) (% 1d)" 10 -10 } {( 10) (-10)} test format-15.6 {testing %d plus padding for integers} { format "(%+1d) (%+1d)" 10 -10 } {(+10) (-10)} set a "0123456789" set b "" for {set i 0} {$i < 290} {incr i} { append b $a } for {set i 290} {$i < 400} {incr i} { test format-16.[expr {$i -289}] {testing MAX_FLOAT_SIZE} { format {%s} $b } $b append b "x" } test format-17.1 {testing %d with wide} { format %d 7810179016327718216 } 1819043144 test format-17.2 {testing %ld with wide} { format %ld 7810179016327718216 } 7810179016327718216 test format-17.3 {testing %ld with non-wide} { format %ld 42 } 42 test format-17.4 {testing %l with non-integer} { format %lf 1 } 1.000000 test format-17.5 {testing %llu with positive bignum} -body { format %llu 0xabcdef0123456789abcdef } -result 207698809136909011942886895 test format-17.6 {testing %llu with negative number} -body { format %llu -1 } -returnCodes 1 -result {unsigned bignum format is invalid} test format-18.1 {do not demote existing numeric values} { set a 0xaaaaaaaa # Ensure $a and $b are separate objects set b 0xaaaa append b aaaa set result [expr {$a == $b}] format %08lx $b lappend result [expr {$a == $b}] set b 0xaaaa append b aaaa lappend result [expr {$a == $b}] format %08x $b lappend result [expr {$a == $b}] } {1 1 1 1} test format-18.2 {do not demote existing numeric values} { set a [expr {0xaaaaaaaaaa + 1}] set b 0xaaaaaaaaab list [format %08x $a] [expr {$a == $b}] } {aaaaaaab 1} test format-19.1 {regression test - tcl-core message by Brian Griffin on 26 0ctober 2004} -body { set x 0x8fedc654 list [expr { ~ $x }] [format %08x [expr { ~$x }]] } -match regexp -result {-2414724693 f*701239ab} test format-19.2 {Bug 1867855} { format %llx 0 } 0 test format-19.3 {Bug 2830354} { string length [format %340f 0] } 340 test format-19.4.1 {Bug d498578df4: width overflow should cause limit exceeded} -body { # in case of overflow into negative, it produces width -2 (and limit exceeded), # in case of width will be unsigned, it will be outside limit (2GB for 32bit)... # and it don't throw an error in case the bug is not fixed (and probably no segfault). format %[expr {0xffffffff - 1}]g 0 } -returnCodes error -result "max size for a Tcl value exceeded" test format-19.4.2 {Bug d498578df4: width overflow should cause limit exceeded} -body { # limit should exceeds in any case, # and it don't throw an error in case the bug is not fixed (and probably no segfault). format %[expr {0xffffffffffffffff - 1}]g 0 } -returnCodes error -result "max size for a Tcl value exceeded" # Note that this test may fail in future versions test format-20.1 {Bug 2932421: plain %s caused internalrep change of args} -body { set x [dict create a b c d] format %s $x # After this, obj in $x should be a dict # We are testing to make sure it has not been shimmered to a # different internalrep when that is not necessary. # Whether or not there is a string rep - we should not care! tcl::unsupported::representation $x } -match glob -result {value is a dict *} # cleanup catch {unset a} catch {unset b} catch {unset c} catch {unset d} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/foreach.test0000644000175000017500000001647215104661341015233 0ustar sergeisergei# Commands covered: foreach, continue, break # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-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. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {unset a} catch {unset x} # Basic "foreach" operation. test foreach-1.1 {basic foreach tests} { set a {} foreach i {a b c d} { set a [concat $a $i] } set a } {a b c d} test foreach-1.2 {basic foreach tests} { set a {} foreach i {a b {{c d} e} {123 {{x}}}} { set a [concat $a $i] } set a } {a b {c d} e 123 {{x}}} test foreach-1.3 {basic foreach tests} {catch {foreach} msg} 1 test foreach-1.4 {basic foreach tests} { catch {foreach} msg set msg } {wrong # args: should be "foreach varList list ?varList list ...? command"} test foreach-1.5 {basic foreach tests} {catch {foreach i} msg} 1 test foreach-1.6 {basic foreach tests} { catch {foreach i} msg set msg } {wrong # args: should be "foreach varList list ?varList list ...? command"} test foreach-1.7 {basic foreach tests} {catch {foreach i j} msg} 1 test foreach-1.8 {basic foreach tests} { catch {foreach i j} msg set msg } {wrong # args: should be "foreach varList list ?varList list ...? command"} test foreach-1.9 {basic foreach tests} {catch {foreach i j k l} msg} 1 test foreach-1.10 {basic foreach tests} { catch {foreach i j k l} msg set msg } {wrong # args: should be "foreach varList list ?varList list ...? command"} test foreach-1.11 {basic foreach tests} { set a {} foreach i {} { set a [concat $a $i] } set a } {} test foreach-1.12 {foreach errors} { list [catch {foreach {{a}{b}} {1 2 3} {}} msg] $msg } {1 {list element in braces followed by "{b}" instead of space}} test foreach-1.13 {foreach errors} { list [catch {foreach a {{1 2}3} {}} msg] $msg } {1 {list element in braces followed by "3" instead of space}} catch {unset a} test foreach-1.14 {foreach errors} { catch {unset a} set a(0) 44 list [catch {foreach a {1 2 3} {}} msg o] $msg $::errorInfo } {1 {can't set "a": variable is array} {can't set "a": variable is array (setting foreach loop variable "a") invoked from within "foreach a {1 2 3} {}"}} test foreach-1.15 {foreach errors} { list [catch {foreach {} {} {}} msg] $msg } {1 {foreach varlist is empty}} catch {unset a} test foreach-2.1 {parallel foreach tests} { set x {} foreach {a b} {1 2 3 4} { append x $b $a } set x } {2143} test foreach-2.2 {parallel foreach tests} { set x {} foreach {a b} {1 2 3 4 5} { append x $b $a } set x } {21435} test foreach-2.3 {parallel foreach tests} { set x {} foreach a {1 2 3} b {4 5 6} { append x $b $a } set x } {415263} test foreach-2.4 {parallel foreach tests} { set x {} foreach a {1 2 3} b {4 5 6 7 8} { append x $b $a } set x } {41526378} test foreach-2.5 {parallel foreach tests} { set x {} foreach {a b} {a b A B aa bb} c {c C cc CC} { append x $a $b $c } set x } {abcABCaabbccCC} test foreach-2.6 {parallel foreach tests} { set x {} foreach a {1 2 3} b {1 2 3} c {1 2 3} d {1 2 3} e {1 2 3} { append x $a $b $c $d $e } set x } {111112222233333} test foreach-2.7 {parallel foreach tests} { set x {} foreach a {} b {1 2 3} c {1 2} d {1 2 3 4} e {{1 2}} { append x $a $b $c $d $e } set x } {1111 2222334} test foreach-2.8 {foreach only sets vars if repeating loop} { proc foo {} { set rgb {65535 0 0} foreach {r g b} [set rgb] {} return "r=$r, g=$g, b=$b" } foo } {r=65535, g=0, b=0} test foreach-2.9 {foreach only supports local scalar variables} { proc foo {} { set x {} foreach {a(3)} {1 2 3 4} {lappend x [set {a(3)}]} set x } foo } {1 2 3 4} test foreach-3.1 {compiled foreach backward jump works correctly} { catch {unset x} proc foo {arrayName} { upvar 1 $arrayName a set l {} foreach member [array names a] { lappend l [list $member [set a($member)]] } return $l } array set x {0 zero 1 one 2 two 3 three} lsort [foo x] } [lsort {{0 zero} {1 one} {2 two} {3 three}}] test foreach-4.1 {noncompiled foreach and shared variable or value list objects that are converted to another type} { catch {unset x} foreach {12.0} {a b c} { set x 12.0 set x [expr {$x + 1}] } set x } 13.0 # Check "continue". test foreach-5.1 {continue tests} {catch continue} 4 test foreach-5.2 {continue tests} { set a {} foreach i {a b c d} { if {[string compare $i "b"] == 0} continue set a [concat $a $i] } set a } {a c d} test foreach-5.3 {continue tests} { set a {} foreach i {a b c d} { if {[string compare $i "b"] != 0} continue set a [concat $a $i] } set a } {b} test foreach-5.4 {continue tests} {catch {continue foo} msg} 1 test foreach-5.5 {continue tests} { catch {continue foo} msg set msg } {wrong # args: should be "continue"} # Check "break". test foreach-6.1 {break tests} {catch break} 3 test foreach-6.2 {break tests} { set a {} foreach i {a b c d} { if {[string compare $i "c"] == 0} break set a [concat $a $i] } set a } {a b} test foreach-6.3 {break tests} {catch {break foo} msg} 1 test foreach-6.4 {break tests} { catch {break foo} msg set msg } {wrong # args: should be "break"} # Check for bug #406709 test foreach-6.5 {break tests} -body { proc a {} { set a 1 foreach b b {list [concat a; break]; incr a} incr a } a } -cleanup { rename a {} } -result {2} # Test for incorrect "double evaluation" semantics test foreach-7.1 {delayed substitution of body} { proc foo {} { set a 0 foreach a [list 1 2 3] " set x $a " set x } foo } {0} # Test for [Bug 1189274]; crash on failure test foreach-8.1 {empty list handling} { proc crash {} { rename crash {} set a "x y z" set b "" foreach aa $a bb $b { set x "aa = $aa bb = $bb" } } crash } {} # [Bug 1671138]; infinite loop with empty var list in bytecompiled version test foreach-9.1 {compiled empty var list} { proc foo {} { foreach {} x { error "reached body" } } list [catch { foo } msg] $msg } {1 {foreach varlist is empty}} test foreach-9.2 {line numbers} -setup { proc linenumber {} {dict get [info frame -1] line} } -body { apply {n { foreach x y {*}{ } {return [incr n -[linenumber]]} }} [linenumber] } -cleanup { rename linenumber {} } -result 1 test foreach-10.1 {foreach: [Bug 1671087]} -setup { proc demo {} { set vals {1 2 3 4} trace add variable x write {string length $vals ;# } foreach {x y} $vals {format $y} } } -body { demo } -cleanup { rename demo {} } -result {} test foreach-11.1 {error then dereference loop var (dev bug)} { catch { foreach a 0 b {1 2 3} { error x } } set a } 0 test foreach-11.2 {error then dereference loop var (dev bug)} { catch { foreach a 0 b {1 2 3} { incr a $b; error x } } set a } 1 # cleanup catch {unset a} catch {unset x} catch {rename foo {}} ::tcltest::cleanupTests return tcl9.0.3/tests/for.test0000644000175000017500000011345215104661341014406 0ustar sergeisergei# Commands covered: for, continue, break # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc meminfo {} {lindex [split [memory info] "\n"] 3 3} } # Basic "for" operation. test for-1.1 {TclCompileForCmd: missing initial command} { list [catch {for} msg] $msg } {1 {wrong # args: should be "for start test next command"}} test for-1.2 {TclCompileForCmd: error in initial command} -body { list [catch {for {set}} msg] $msg $::errorInfo } -match glob -result {1 {wrong # args: should be "for start test next command"} {wrong # args: should be "for start test next command" while *ing "for {set}"}} catch {unset i} test for-1.3 {TclCompileForCmd: missing test expression} { catch {for {set i 0}} msg set msg } {wrong # args: should be "for start test next command"} test for-1.4 {TclCompileForCmd: error in test expression} -body { catch {for {set i 0} {$i<}} msg set ::errorInfo } -match glob -result {wrong # args: should be "for start test next command" while *ing "for {set i 0} {$i<}"} test for-1.5 {TclCompileForCmd: test expression is enclosed in quotes} { set i 0 for {} "$i > 5" {incr i} {} } {} test for-1.6 {TclCompileForCmd: missing "next" command} { catch {for {set i 0} {$i < 5}} msg set msg } {wrong # args: should be "for start test next command"} test for-1.7 {TclCompileForCmd: missing command body} { catch {for {set i 0} {$i < 5} {incr i}} msg set msg } {wrong # args: should be "for start test next command"} test for-1.8 {TclCompileForCmd: error compiling command body} -body { catch {for {set i 0} {$i < 5} {incr i} {set}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} catch {unset a} test for-1.9 {TclCompileForCmd: simple command body} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==4} break set a [concat $a $i] } set a } {1 2 3} test for-1.10 {TclCompileForCmd: command body in quotes} { set a {} for {set i 1} {$i<6} {incr i} "append a x" set a } {xxxxx} test for-1.11 {TclCompileForCmd: computed command body} { catch {unset x1} catch {unset bb} catch {unset x2} set x1 {append a x1; } set bb {break} set x2 {; append a x2} set a {} for {set i 1} {$i<6} {incr i} $x1$bb$x2 set a } {x1} test for-1.12 {TclCompileForCmd: error in "next" command} -body { catch {for {set i 0} {$i < 5} {set} {format $i}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test for-1.13 {TclCompileForCmd: long command body} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] } set a } {1 2 3} test for-1.14 {TclCompileForCmd: for command result} { set a [for {set i 0} {$i < 5} {incr i} {}] set a } {} test for-1.15 {TclCompileForCmd: for command result} { set a [for {set i 0} {$i < 5} {incr i} {if {$i==3} break}] set a } {} # Check "for" and "continue". test for-2.1 {TclCompileContinueCmd: arguments after "continue"} { catch {continue foo} msg set msg } {wrong # args: should be "continue"} test for-2.2 {TclCompileContinueCmd: continue result} { catch continue } 4 test for-2.3 {continue tests} { set a {} for {set i 1} {$i <= 4} {incr i} { if {$i == 2} continue set a [concat $a $i] } set a } {1 3 4} test for-2.4 {continue tests} { set a {} for {set i 1} {$i <= 4} {incr i} { if {$i != 2} continue set a [concat $a $i] } set a } {2} test for-2.5 {continue tests, nested loops} { set msg {} for {set i 1} {$i <= 4} {incr i} { for {set a 1} {$a <= 2} {incr a} { if {$i>=2 && $a>=2} continue set msg [concat $msg "$i.$a"] } } set msg } {1.1 1.2 2.1 3.1 4.1} test for-2.6 {continue tests, long command body} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==2} continue if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] } set a } {1 3} test for-2.7 {continue tests, uncompiled [for]} -body { set file [makeFile { set guard 0 for {set i 20} {$i > 0} {incr i -1} { if {[incr guard]>30} {return BAD} continue } return GOOD } source.file] source $file } -cleanup { removeFile source.file } -result GOOD # Check "for" and "break". test for-3.1 {TclCompileBreakCmd: arguments after "break"} { catch {break foo} msg set msg } {wrong # args: should be "break"} test for-3.2 {TclCompileBreakCmd: break result} { catch break } 3 test for-3.3 {break tests} { set a {} for {set i 1} {$i <= 4} {incr i} { if {$i == 3} break set a [concat $a $i] } set a } {1 2} test for-3.4 {break tests, nested loops} { set msg {} for {set i 1} {$i <= 4} {incr i} { for {set a 1} {$a <= 2} {incr a} { if {$i>=2 && $a>=2} break set msg [concat $msg "$i.$a"] } } set msg } {1.1 1.2 2.1 3.1 4.1} test for-3.5 {break tests, long command body} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==2} continue if {$i==5} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i==4} break if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] } set a } {1 3} # A simplified version of exmh's mail formatting routine to stress "for", # "break", "while", and "if". proc formatMail {} { array set lines { 0 {Return-path: george@tcl} \ 1 {Return-path: } \ 2 {Received: from tcl by tcl.Somewhere.COM (SMI-8.6/SMI-SVR4)} \ 3 { id LAA10027; Wed, 11 Sep 1996 11:14:53 -0700} \ 4 {Message-id: <199609111814.LAA10027@tcl.Somewhere.COM>} \ 5 {X-mailer: exmh version 1.6.9 8/22/96} \ 6 {Mime-version: 1.0} \ 7 {Content-type: text/plain; charset=iso-8859-1} \ 8 {Content-transfer-encoding: quoted-printable} \ 9 {Content-length: 2162} \ 10 {To: fred} \ 11 {Subject: tcl7.6} \ 12 {Date: Wed, 11 Sep 1996 11:14:53 -0700} \ 13 {From: George } \ 14 {The Tcl 7.6 and Tk 4.2 releases} \ 15 {} \ 16 {This page contains information about Tcl 7.6 and Tk4.2, which are the most recent} \ 17 {releases of the Tcl scripting language and the Tk toolkit. The first beta versions of these} \ 18 {releases were released on August 30, 1996. These releases contain only minor changes,} \ 19 {so we hope to have only a single beta release and to go final in early October, 1996.} \ 20 {} \ 21 {} \ 22 {What's new} \ 23 {} \ 24 {The most important changes in the releases are summarized below. See the README} \ 25 {and changes files in the distributions for more complete information on what has} \ 26 {changed, including both feature changes and bug fixes.} \ 27 {} \ 28 { There are new options to the file command for copying files (file copy),} \ 29 { deleting files and directories (file delete), creating directories (file} \ 30 { mkdir), and renaming files (file rename).} \ 31 { The implementation of exec has been improved greatly for Windows 95 and} \ 32 { Windows NT.} \ 33 { There is a new memory allocator for the Macintosh version, which should be} \ 34 { more efficient than the old one.} \ 35 { Tk's grid geometry manager has been completely rewritten. The layout} \ 36 { algorithm produces much better layouts than before, especially where rows or} \ 37 { columns were stretchable.} \ 38 { There are new commands for creating common dialog boxes:} \ 39 { tk_chooseColor, tk_getOpenFile, tk_getSaveFile and} \ 40 { tk_messageBox. These use native dialog boxes if they are available.} \ 41 { There is a new virtual event mechanism for handling events in a more portable} \ 42 { way. See the new command event. It also allows events (both physical and} \ 43 { virtual) to be generated dynamically.} \ 44 {} \ 45 {Tcl 7.6 and Tk 4.2 are backwards-compatible with Tcl 7.5 and Tk 4.1 except for} \ 46 {changes in the C APIs for custom channel drivers. Scripts written for earlier releases} \ 47 {should work on these new releases as well.} \ 48 {} \ 49 {Obtaining The Releases} \ 50 {} \ 51 {Binary Releases} \ 52 {} \ 53 {Precompiled releases are available for the following platforms: } \ 54 {} \ 55 { Windows 3.1, Windows 95, and Windows NT: Fetch} \ 56 { ftp://ftp.sunlabs.com/pub/tcl/win42b1.exe, then execute it. The file is a} \ 57 { self-extracting executable. It will install the Tcl and Tk libraries, the wish and} \ 58 { tclsh programs, and documentation.} \ 59 { Macintosh (both 68K and PowerPC): Fetch} \ 60 { ftp://ftp.sunlabs.com/pub/tcl/mactk4.2b1.sea.hqx. The file is in binhex format,} \ 61 { which is understood by Fetch, StuffIt, and many other Mac utilities. The} \ 62 { unpacked file is a self-installing executable: double-click on it and it will create a} \ 63 { folder containing all that you need to run Tcl and Tk. } \ 64 { UNIX (Solaris 2.* and SunOS, other systems soon to follow). Easy to install} \ 65 { binary packages are now for sale at the Sun Labs Tcl/Tk Shop. Check it out!} \ } set result "" set NL " " set tag {level= type=text/plain part=0 sel Charset} set ix [lsearch -regexp $tag text/enriched] if {$ix < 0} { set ranges {} set quote 0 } set breakrange {6.42 78.0} set F1 [lindex $breakrange 0] set F2 [lindex $breakrange 1] set breakrange [lrange $breakrange 2 end] if {[string length $F1] == 0} { set F1 -1 set break 0 } else { set break 1 } set xmailer 0 set inheaders 1 set last [array size lines] set plen 2 for {set L 1} {$L < $last} {incr L} { set line $lines($L) if {$inheaders} { # Blank or empty line terminates headers # Leading --- terminates headers if {[regexp {^[ ]*$} $line] || [regexp {^--+} $line]} { set inheaders 0 } if {[regexp -nocase {^x-mailer:} $line]} { continue } } if {$inheaders} { set limit 55 } else { set limit 55 # Decide whether or not to break the body line if {$plen > 0} { if {[string first {> } $line] == 0} { # This is quoted text from previous message, don't reformat append result $line $NL if {$quote && !$inheaders} { # Fix from to handle text/enriched if {$L > $L1 && $L < $L2 && $line != {}} { # enriched requires two newlines for each one. append result $NL } elseif {$L > $L2} { set L1 [lindex $ranges 0] set L2 [lindex $ranges 1] set ranges [lrange $ranges 2 end] set quote [llength $L1] } } continue } } if {$F1 < 0} { # Nothing left to format append result $line $NL continue } elseif {$L < $F1} { # Not yet to formatted block append result $line $NL continue } elseif {$L > $F2} { # Past formatted block set F1 [lindex $breakrange 0] set F2 [lindex $breakrange 1] set breakrange [lrange $breakrange 2 end] append result $line $NL if {[string length $F1] == 0} { set F1 -1 } continue } } set climit [expr {$limit-1}] set cutoff 50 set continuation 0 while {[string length $line] > $limit} { for {set c [expr {$limit-1}]} {$c >= $cutoff} {incr c -1} { set char [string index $line $c] if {$char == " " || $char == "\t"} { break } if {$char == ">"} { ;# Hack for enriched formatting break } } if {$c < $cutoff} { if {! $inheaders} { set c [expr {$limit-1}] } else { set c [string length $line] } } set newline [string trimright [string range $line 0 $c]] if {! $continuation} { append result $newline $NL } else { append result \ $newline $NL } incr c set line [string trimright [string range $line $c end]] if {$inheaders} { set continuation 1 set limit $climit } } if {$continuation} { if {[string length $line] != 0} { append result \ $line $NL } } else { append result $line $NL if {$quote && !$inheaders} { if {$L > $L1 && $L < $L2 && $line != {}} { # enriched requires two newlines for each one. append result "" $NL } elseif {$L > $L2} { set L1 [lindex $ranges 0] set L2 [lindex $ranges 1] set ranges [lrange $ranges 2 end] set quote [llength $L1] } } } } return $result } test for-3.6 {break tests} { formatMail } {Return-path: Received: from tcl by tcl.Somewhere.COM (SMI-8.6/SMI-SVR4) id LAA10027; Wed, 11 Sep 1996 11:14:53 -0700 Message-id: <199609111814.LAA10027@tcl.Somewhere.COM> Mime-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Content-length: 2162 To: fred Subject: tcl7.6 Date: Wed, 11 Sep 1996 11:14:53 -0700 From: George The Tcl 7.6 and Tk 4.2 releases This page contains information about Tcl 7.6 and Tk4.2, which are the most recent releases of the Tcl scripting language and the Tk toolk it. The first beta versions of these releases were released on August 30, 1996. These releas es contain only minor changes, so we hope to have only a single beta release and to go final in early October, 1996. What's new The most important changes in the releases are summariz ed below. See the README and changes files in the distributions for more complet e information on what has changed, including both feature changes and bug fixes. There are new options to the file command for copying files (file copy), deleting files and directories (file delete), creating directories (file mkdir), and renaming files (file rename). The implementation of exec has been improved great ly for Windows 95 and Windows NT. There is a new memory allocator for the Macintosh version, which should be more efficient than the old one. Tk's grid geometry manager has been completely rewritten. The layout algorithm produces much better layouts than before , especially where rows or columns were stretchable. There are new commands for creating common dialog boxes: tk_chooseColor, tk_getOpenFile, tk_getSaveFile and tk_messageBox. These use native dialog boxes if they are available. There is a new virtual event mechanism for handlin g events in a more portable way. See the new command event. It also allows events (both physical and virtual) to be generated dynamically. Tcl 7.6 and Tk 4.2 are backwards-compatible with Tcl 7.5 and Tk 4.1 except for changes in the C APIs for custom channel drivers. Scrip ts written for earlier releases should work on these new releases as well. Obtaining The Releases Binary Releases Precompiled releases are available for the following platforms: Windows 3.1, Windows 95, and Windows NT: Fetch ftp://ftp.sunlabs.com/pub/tcl/win42b1.exe, then execute it. The file is a self-extracting executable. It will install the Tcl and Tk libraries, the wish and tclsh programs, and documentation. Macintosh (both 68K and PowerPC): Fetch ftp://ftp.sunlabs.com/pub/tcl/mactk4.2b1.sea.hqx. The file is in binhex format, which is understood by Fetch, StuffIt, and many other Mac utilities. The unpacked file is a self-installing executable: double-click on it and it will create a folder containing all that you need to run Tcl and Tk. UNIX (Solaris 2.* and SunOS, other systems soon to follow). Easy to install binary packages are now for sale at the Sun Labs Tcl/Tk Shop. Check it out! } # Check that "break" resets the interpreter's result test for-4.1 {break must reset the interp result} { catch { set z GLOBTESTDIR/dir2/file2.c if {[string match GLOBTESTDIR/dir2/* $z]} { break } } j set j } {} # Test for incorrect "double evaluation" semantics test for-5.1 {possible delayed substitution of increment command} { # Increment should be 5, and lappend should always append $a catch {unset a} catch {unset i} set a 5 set i {} for {set a 1} {$a < 12} "incr a $a" {lappend i $a} set i } {1 6 11} test for-5.2 {possible delayed substitution of increment command} { # Increment should be 5, and lappend should always append $a catch {rename p ""} proc p {} { set a 5 set i {} for {set a 1} {$a < 12} "incr a $a" {lappend i $a} set i } p } {1 6 11} test for-5.3 {possible delayed substitution of body command} { # Increment should be $a, and lappend should always append 5 set a 5 set i {} for {set a 1} {$a < 12} {incr a $a} "lappend i $a" set i } {5 5 5 5} test for-5.4 {possible delayed substitution of body command} { # Increment should be $a, and lappend should always append 5 catch {rename p ""} proc p {} { set a 5 set i {} for {set a 1} {$a < 12} {incr a $a} "lappend i $a" set i } p } {5 5 5 5} # In the following tests we need to bypass the bytecode compiler by # substituting the command from a variable. This ensures that command # procedure is invoked directly. test for-6.1 {Tcl_ForObjCmd: number of args} { set z for catch {$z} msg set msg } {wrong # args: should be "for start test next command"} test for-6.2 {Tcl_ForObjCmd: number of args} { set z for catch {$z {set i 0}} msg set msg } {wrong # args: should be "for start test next command"} test for-6.3 {Tcl_ForObjCmd: number of args} { set z for catch {$z {set i 0} {$i < 5}} msg set msg } {wrong # args: should be "for start test next command"} test for-6.4 {Tcl_ForObjCmd: number of args} { set z for catch {$z {set i 0} {$i < 5} {incr i}} msg set msg } {wrong # args: should be "for start test next command"} test for-6.5 {Tcl_ForObjCmd: number of args} { set z for catch {$z {set i 0} {$i < 5} {incr i} {body} extra} msg set msg } {wrong # args: should be "for start test next command"} test for-6.6 {Tcl_ForObjCmd: error in initial command} -body { set z for list [catch {$z {set} {$i < 5} {incr i} {body}} msg] $msg $::errorInfo } -match glob -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?" while *ing "set" ("for" initial command) invoked from within "$z {set} {$i < 5} {incr i} {body}"}} test for-6.7 {Tcl_ForObjCmd: error in test expression} -body { set z for catch {$z {set i 0} {i < 5} {incr i} {body}} set ::errorInfo } -match glob -result {*"$z {set i 0} {i < 5} {incr i} {body}"} test for-6.8 {Tcl_ForObjCmd: test expression is enclosed in quotes} { set z for set i 0 $z {set i 6} "$i > 5" {incr i} {set y $i} set i } 6 test for-6.9 {Tcl_ForObjCmd: error executing command body} -body { set z for catch {$z {set i 0} {$i < 5} {incr i} {set}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set" ("for" body line 1) invoked from within "$z {set i 0} {$i < 5} {incr i} {set}"} test for-6.10 {Tcl_ForObjCmd: simple command body} { set z for set a {} $z {set i 1} {$i<6} {incr i} { if {$i==4} break set a [concat $a $i] } set a } {1 2 3} test for-6.11 {Tcl_ForObjCmd: command body in quotes} { set z for set a {} $z {set i 1} {$i<6} {incr i} "append a x" set a } {xxxxx} test for-6.12 {Tcl_ForObjCmd: computed command body} { set z for catch {unset x1} catch {unset bb} catch {unset x2} set x1 {append a x1; } set bb {break} set x2 {; append a x2} set a {} $z {set i 1} {$i<6} {incr i} $x1$bb$x2 set a } {x1} test for-6.13 {Tcl_ForObjCmd: error in "next" command} -body { set z for catch {$z {set i 0} {$i < 5} {set} {set j 4}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set" ("for" loop-end command) invoked from within "$z {set i 0} {$i < 5} {set} {set j 4}"} test for-6.14 {Tcl_ForObjCmd: long command body} { set z for set a {} $z {set i 1} {$i<6} {incr i} { if {$i==4} break if {$i>5} continue if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } if {$i>6 && $tcl_platform(machine)=="xxx"} { catch {set a $a} msg catch {incr i 5} msg catch {incr i -5} msg } set a [concat $a $i] } set a } {1 2 3} test for-6.15 {Tcl_ForObjCmd: for command result} { set z for set a [$z {set i 0} {$i < 5} {incr i} {}] set a } {} test for-6.16 {Tcl_ForObjCmd: for command result} { set z for set a [$z {set i 0} {$i < 5} {incr i} {if $i==3 break}] set a } {} test for-6.17 {Tcl_ForObjCmd: for command result} { list \ [catch {for {break} {1} {} {}} err] $err \ [catch {for {continue} {1} {} {}} err] $err \ [catch {for {} {[break]} {} {}} err] $err \ [catch {for {} {[continue]} {} {}} err] $err \ [catch {for {} {1} {break} {}} err] $err \ [catch {for {} {1} {continue} {}} err] $err \ } [list \ 3 {} \ 4 {} \ 3 {} \ 4 {} \ 0 {} \ 4 {} \ ] test for-6.18 {Tcl_ForObjCmd: for command result} { proc p6181 {} { for {break} {1} {} {} } proc p6182 {} { for {continue} {1} {} {} } proc p6183 {} { for {} {[break]} {} {} } proc p6184 {} { for {} {[continue]} {} {} } proc p6185 {} { for {} {1} {break} {} } proc p6186 {} { for {} {1} {continue} {} } list \ [catch {p6181} err] $err \ [catch {p6182} err] $err \ [catch {p6183} err] $err \ [catch {p6184} err] $err \ [catch {p6185} err] $err \ [catch {p6186} err] $err } [list \ 1 {invoked "break" outside of a loop} \ 1 {invoked "continue" outside of a loop} \ 1 {invoked "break" outside of a loop} \ 1 {invoked "continue" outside of a loop} \ 0 {} \ 1 {invoked "continue" outside of a loop} \ ] test for-7.1 {Bug 3614226: ensure that break cleans up the stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [break] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.2 {Bug 3614226: ensure that continue cleans up the stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [continue] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.3 {Bug 3614226: ensure that break cleans up the expansion stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[break] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.4 {Bug 3614226: ensure that continue cleans up the expansion stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[continue] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.5 {Bug 3614226: ensure that break cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[break] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.6 {Bug 3614226: ensure that continue cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[continue] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.7 {Bug 3614226: ensure that break only cleans up the right amount} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[break] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.8 {Bug 3614226: ensure that continue only cleans up the right amount} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[continue] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.9 {Bug 3614226: ensure that break from invoked command cleans up the stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [apply {{} {return -code break}}] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.10 {Bug 3614226: ensure that continue from invoked command cleans up the stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [apply {{} {return -code continue}}] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.11 {Bug 3614226: ensure that break from invoked command cleans up the expansion stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[apply {{} {return -code break}}] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.12 {Bug 3614226: ensure that continue from invoked command cleans up the expansion stack} memory { apply {{} { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[apply {{} { return -code continue }}] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.13 {Bug 3614226: ensure that break from invoked command cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[apply {{} { return -code break }}] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.14 {Bug 3614226: ensure that continue from invoked command cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[apply {{} { return -code continue }}] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.15 {Bug 3614226: ensure that break from invoked command only cleans up the right amount} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[apply {{} { return -code break }}] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.16 {Bug 3614226: ensure that continue from invoked command only cleans up the right amount} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[apply {{} { return -code continue }}] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} } 0 test for-7.17 {Bug 3614226: ensure that break from expanded command cleans up the stack} memory { apply {op { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [{*}$op] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code break} } 0 test for-7.18 {Bug 3614226: ensure that continue from expanded command cleans up the stack} memory { apply {op { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {$x < 5} {incr x} { list a b c [{*}$op] d e f } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code continue} } 0 test for-7.19 {Bug 3614226: ensure that break from expanded command cleans up the expansion stack} memory { apply {op { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[{*}$op] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code break} } 0 test for-7.20 {Bug 3614226: ensure that continue from expanded command cleans up the expansion stack} memory { apply {op { # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts {*}[puts a b c {*}[{*}$op] d e f] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code continue} } 0 test for-7.21 {Bug 3614226: ensure that break from expanded command cleans up the combination of main and expansion stack} memory { apply {op { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[{*}$op] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code break} } 0 test for-7.22 {Bug 3614226: ensure that continue from expanded command cleans up the combination of main and expansion stack} memory { apply {op { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[{*}$op] d e f]] } set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code continue} } 0 test for-7.23 {Bug 3614226: ensure that break from expanded command only cleans up the right amount} memory { apply {op { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[{*}$op] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code break} } 0 test for-7.24 {Bug 3614226: ensure that continue from expanded command only cleans up the right amount} memory { apply {op { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames set end [meminfo] for {set i 0} {$i < 5} {incr i} { unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { puts [puts {*}$l {*}[puts a b c {*}$l {*}[{*}$op] d e f]] }] set tmp $end set end [meminfo] } expr {$end - $tmp} }} {return -level 0 -code continue} } 0 test for-8.0 {Coverity CID 1251203: break vs continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i; list a [eval {}]} { incr j }] incr i } list $i $j $k }} } {6 5 3} test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i;list a [eval break]} { incr j }] incr i } list $i $j $k }} } {2 1 3} test for-8.2 {Coverity CID 1251203: break vs continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i;list a [eval continue]} { incr j }] incr i } list $i $j $k }} } {1 1 3} test for-8.3 {break in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i; break} { incr j }] incr i } list $i $j $k }} } {2 1 3} test for-8.4 {continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i; continue} { incr j }] incr i } list $i $j $k }} } {1 1 3} test for-8.5 {break in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i; list a [break]} { incr j }] incr i } list $i $j $k }} } {2 1 3} test for-8.6 {continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i; list a [continue]} { incr j }] incr i } list $i $j $k }} } {1 1 3} test for-8.7 {break in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i;eval break} { incr j }] incr i } list $i $j $k }} } {2 1 3} test for-8.8 {continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 list a [\ for {set i 0} {$i < 5} {incr i;eval continue} { incr j }] incr i } list $i $j $k }} } {1 1 3} test for-8.9 {break in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 for {set i 0} {$i < 5} {incr i;eval break} { incr j } incr i } list $i $j $k }} } {2 1 3} test for-8.10 {continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 for {set i 0} {$i < 5} {incr i;eval continue} { incr j } incr i } list $i $j $k }} } {1 1 3} test for-8.11 {break in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 for {set i 0} {$i < 5} {incr i;break} { incr j } incr i } list $i $j $k }} } {2 1 3} test for-8.12 {continue in for-step clause} { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 for {set i 0} {$i < 5} {incr i;continue} { incr j } incr i } list $i $j $k }} } {1 1 3} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/for-old.test0000644000175000017500000000353315104661341015160 0ustar sergeisergei# Commands covered: for, continue, break # # This file contains the original set of tests for Tcl's for command. # Since the for command is now compiled, a new set of tests covering # the new implementation is in the file "for.test". Sourcing this file # into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } # Check "for" and its use of continue and break. catch {unset a i} test for-old-1.1 {for tests} { set a {} for {set i 1} {$i<6} {incr i} { set a [concat $a $i] } set a } {1 2 3 4 5} test for-old-1.2 {for tests} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==4} continue set a [concat $a $i] } set a } {1 2 3 5} test for-old-1.3 {for tests} { set a {} for {set i 1} {$i<6} {incr i} { if {$i==4} break set a [concat $a $i] } set a } {1 2 3} test for-old-1.4 {for tests} {catch {for 1 2 3} msg} 1 test for-old-1.5 {for tests} { catch {for 1 2 3} msg set msg } {wrong # args: should be "for start test next command"} test for-old-1.6 {for tests} {catch {for 1 2 3 4 5} msg} 1 test for-old-1.7 {for tests} { catch {for 1 2 3 4 5} msg set msg } {wrong # args: should be "for start test next command"} test for-old-1.8 {for tests} { set a {xyz} for {set i 1} {$i<6} {incr i} {} set a } xyz test for-old-1.9 {for tests} { set a {} for {set i 1} {$i<6} {incr i; if {$i==4} break} { set a [concat $a $i] } set a } {1 2 3} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/fileSystemEncoding.test0000644000175000017500000000167615104661341017417 0ustar sergeisergei#! /usr/bin/env tclsh # Copyright © 2019 Poor Yorick if {[string equal $::tcl_platform(os) "Windows NT"]} { return } namespace eval ::tcl::test::fileSystemEncoding { if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } variable fname1 登鸛鵲樓 source [file join [file dirname [info script]] tcltests.tcl] test filesystemEncoding-1.0 { issue bcd100410465 } -body { set dir [tcltests::tempdir] set saved [encoding system] encoding system iso8859-1 set fname1a $dir/$fname1 set utf8name [encoding convertto utf-8 $fname1a] makeFile {} $utf8name set globbed [lindex [glob -directory $dir *] 0] encoding system utf-8 set res [file exists $globbed] encoding system iso8859-1 lappend res [file exists $globbed] return $res } -cleanup { removeFile $utf8name file delete -force $dir encoding system $saved } -result {0 1} cleanupTests } tcl9.0.3/tests/fileSystem.test0000644000175000017500000010675315104661341015752 0ustar sergeisergei# This file tests the filesystem and vfs internals. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 2002 Vincent Darley. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. namespace eval ::tcl::test::fileSystem { if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch { file delete -force link.file file delete -force dir.link file delete -force [file join dir.dir linkinside.file] } testConstraint loaddll 0 catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] set ::ddever [package require dde] set ::ddelib [info loaded {} Dde] set ::regver [package require registry] set ::reglib [info loaded {} Registry] testConstraint loaddll [expr {$::ddelib ne "" && $::reglib ne ""}] } # Test for commands defined in tcl::test package testConstraint testfilesystem [llength [info commands ::testfilesystem]] testConstraint testsetplatform [llength [info commands ::testsetplatform]] testConstraint testsimplefilesystem [llength [info commands ::testsimplefilesystem]] # Some things fail under all Continuous Integration systems for subtle reasons # such as CI often running with elevated privileges in a container. testConstraint notInCIenv [expr {![info exists ::env(CI)]}] cd [tcltest::temporaryDirectory] makeFile "test file" gorp.file makeDirectory dir.dir makeDirectory [file join dir.dir dirinside.dir] makeFile "test file in directory" [file join dir.dir inside.file] testConstraint unusedDrive 0 testConstraint moreThanOneDrive 0 apply {{} { # The variables 'drive' and 'drives' will be used below. variable drive {} drives {} if {[testConstraint win]} { set vols [string map [list :/ {}] [file volumes]] for {set i 0} {$i < 26} {incr i} { set drive [format %c [expr {$i + 65}]] if {$drive ni $vols} { testConstraint unusedDrive 1 break } } set dir [pwd] try { set drives [lmap vol [file volumes] { if {$vol eq [zipfs root] || [catch {cd $vol}]} { continue } set vol }] testConstraint moreThanOneDrive [expr {[llength $drives] > 1}] } finally { cd $dir } } } ::tcl::test::fileSystem} proc testPathEqual {one two} { if {$one eq $two} { return "ok" } return "not equal: $one $two" } testConstraint hasLinks [expr {![catch { file link link.file gorp.file cd dir.dir file link \ [file join linkinside.file] \ [file join inside.file] cd .. file link dir.link dir.dir cd dir.dir file link [file join dirinside.link] \ [file join dirinside.dir] cd .. }]}] if {[testConstraint testsetplatform]} { set platform [testgetplatform] } # ---------------------------------------------------------------------- test filesystem-1.0 {link normalisation} {hasLinks} { string equal [file normalize gorp.file] [file normalize link.file] } {0} test filesystem-1.1 {link normalisation} {hasLinks} { string equal [file normalize dir.dir] [file normalize dir.link] } {0} test filesystem-1.2 {link normalisation} {hasLinks unix} { testPathEqual [file normalize [file join gorp.file foo]] \ [file normalize [file join link.file foo]] } ok test filesystem-1.3 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir foo]] \ [file normalize [file join dir.link foo]] } ok test filesystem-1.4 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir inside.file]] \ [file normalize [file join dir.link inside.file]] } ok test filesystem-1.5 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir linkinside.file]] \ [file normalize [file join dir.dir linkinside.file]] } ok test filesystem-1.6 {link normalisation} {hasLinks} { string equal [file normalize [file join dir.dir linkinside.file]] \ [file normalize [file join dir.link inside.file]] } {0} test filesystem-1.7 {link normalisation} {hasLinks unix} { testPathEqual [file normalize [file join dir.link linkinside.file foo]] \ [file normalize [file join dir.dir inside.file foo]] } ok test filesystem-1.8 {link normalisation} {hasLinks} { string equal [file normalize [file join dir.dir linkinside.filefoo]] \ [file normalize [file join dir.link inside.filefoo]] } {0} test filesystem-1.9 {link normalisation} -setup { file delete -force dir.link } -constraints {unix hasLinks} -body { file link dir.link [file nativename dir.dir] testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ [file normalize [file join dir.link inside.file foo]] } -result ok test filesystem-1.10 {link normalisation: double link} -constraints { unix hasLinks } -body { file link dir2.link dir.link testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ [file normalize [file join dir2.link inside.file foo]] } -cleanup { file delete dir2.link } -result ok makeDirectory dir2.file test filesystem-1.11 {link normalisation: double link, back in tree} {unix hasLinks} { file link dir2.link dir.link file link [file join dir2.file dir2.link] [file join .. dir2.link] testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ [file normalize [file join dir2.file dir2.link inside.file foo]] } ok test filesystem-1.12 {file new native path} {} { for {set i 0} {$i < 10} {incr i} { foreach f [lsort [glob -nocomplain -type l *]] { catch {file readlink $f} } } # If we reach here we've succeeded. We used to crash above. expr {1} } {1} test filesystem-1.13 {file normalisation} {win} { # This used to be broken file normalize C:/thislongnamedoesntexist } {C:/thislongnamedoesntexist} test filesystem-1.14 {file normalisation} {win} { # This used to be broken file normalize c:/ } {C:/} test filesystem-1.15 {file normalisation} {win} { file normalize c:/../ } {C:/} test filesystem-1.16 {file normalisation} {win} { file normalize c:/. } {C:/} test filesystem-1.17 {file normalisation} {win} { file normalize c:/.. } {C:/} test filesystem-1.17.1 {file normalisation} {win} { file normalize c:\\.. } {C:/} test filesystem-1.18 {file normalisation} {win} { file normalize c:/./ } {C:/} test filesystem-1.19 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./../../.. } "${drive}:/" test filesystem-1.20 {file normalisation} {win} { file normalize //name/foo/../ } {//name/foo} test filesystem-1.21 {file normalisation} {win} { file normalize C:///foo/./ } {C:/foo} test filesystem-1.22 {file normalisation} {win} { file normalize //name/foo/. } {//name/foo} test filesystem-1.23 {file normalisation} {win} { file normalize c:/./foo } {C:/foo} test filesystem-1.24 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./../../../a } "${drive}:/a" test filesystem-1.25 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./.././../../a } "${drive}:/a" test filesystem-1.25.1 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./.././..\\..\\a\\bb } "${drive}:/a/bb" test filesystem-1.26 {link normalisation: link and ..} -setup { file delete -force dir2.link } -constraints {hasLinks} -body { set dir [file join dir2 foo bar] file mkdir $dir file link dir2.link [file join dir2 foo bar] testPathEqual [file normalize [file join dir2 foo x]] \ [file normalize [file join dir2.link .. x]] } -result ok test filesystem-1.27 {file normalisation: up and down with ..} { set dir [file join dir2 foo bar] file mkdir $dir set dir2 [file join dir2 .. dir2 foo .. foo bar] list [testPathEqual [file normalize $dir] [file normalize $dir2]] \ [file exists $dir] [file exists $dir2] } {ok 1 1} test filesystem-1.28 {link normalisation: link with .. and ..} -setup { file delete -force dir2.link } -constraints {hasLinks} -body { set dir [file join dir2 foo bar] file mkdir $dir set to [file join dir2 .. dir2 foo .. foo bar] file link dir2.link $to testPathEqual [file normalize [file join dir2 foo x]] \ [file normalize [file join dir2.link .. x]] } -result ok test filesystem-1.29 {link normalisation: link with ..} -setup { file delete -force dir2.link } -constraints {hasLinks} -body { set dir [file join dir2 foo bar] file mkdir $dir set to [file join dir2 .. dir2 foo .. foo bar] file link dir2.link $to set res [file normalize [file join dir2.link x yyy z]] if {[string match *..* $res]} { return "$res must not contain '..'" } return "ok" } -result {ok} test filesystem-1.29.1 {link normalisation with two consecutive links} {hasLinks} { testPathEqual [file normalize [file join dir.link dirinside.link abc]] \ [file normalize [file join dir.dir dirinside.dir abc]] } ok file delete -force dir2.file file delete -force dir2.link file delete -force link.file dir.link file delete -force dir2 file delete -force [file join dir.dir dirinside.link] removeFile [file join dir.dir inside.file] removeDirectory [file join dir.dir dirinside.dir] removeDirectory dir.dir test filesystem-1.30 { normalisation of nonexistent user - verify no tilde expansion } -body { file normalize ~noonewiththisname } -result [file join [pwd] ~noonewiththisname] test filesystem-1.30.1 {normalisation of existing user} -body { file normalize ~$::tcl_platform(user) } -result [file join [pwd] ~$::tcl_platform(user)] test filesystem-1.30.3 {file normalization should distinguish between ~ and ~user} -setup { set oldhome $::env(HOME) set olduserhome [file normalize [file home $::tcl_platform(user)]] set ::env(HOME) [file join $oldhome temp] } -cleanup { set ::env(HOME) $oldhome } -body { list [string equal [file normalize [file home]] [file normalize $::env(HOME)]] \ [string equal $olduserhome [file normalize [file home $::tcl_platform(user)]]] } -result {1 1} test filesystem-1.31 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform unix file normalize /foo/../bar } {/bar} test filesystem-1.32 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform unix file normalize /../bar } {/bar} test filesystem-1.33 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform windows set res [file normalize C:/../bar] if {[testConstraint unix]} { # Some Unices go further in normalizing this -- not really a problem # since this is a Windows test. regexp {C:/bar$} $res res } set res } {C:/bar} if {[testConstraint testsetplatform]} { testsetplatform $platform } test filesystem-1.34 {file normalisation with '/./'} -body { file normalize /foo/bar/anc/./.tml } -match regexp -result {^(?:(?!/\./).)*$} test filesystem-1.35a {file normalisation with '/./'} -body { file normalize /ffo/bar/anc/./foo/.tml } -match regexp -result {^(?:(?!/\./).)*$} test filesystem-1.35b {file normalisation with '/./'} { llength [regexp -all foo [file normalize /ffo/bar/anc/./foo/.tml]] } 1 test filesystem-1.36a {file normalisation with '/./'} -body { file normalize /foo/bar/anc/././asdasd/.tml } -match regexp -result {^(?:(?!/\./).)*$} test filesystem-1.36b {file normalisation with '/./'} { llength [regexp -all asdasd [file normalize /foo/bar/anc/././asdasd/.tml]] } 1 test filesystem-1.37 {file normalisation with '/./'} -body { set fname "/abc/./def/./ghi/./asda/.././.././asd/x/../../../../....." file norm $fname } -match regexp -result {^(?:[^/]|/(?:[^/]|$))+$} test filesystem-1.38 {file normalisation with volume relative} -setup { set dir [pwd] } -constraints {win moreThanOneDrive notInCIenv} -body { set path "[string range [lindex $drives 0] 0 1]foo" cd [lindex $drives 1] file norm $path } -cleanup { cd $dir unset -nocomplain path } -result "[lindex $drives 0]foo" test filesystem-1.39 {file normalisation with volume relative} -setup { set old [pwd] } -constraints {win} -body { set drv C:/ cd [lindex [glob -type d -dir $drv *] 0] file norm [string range $drv 0 1] } -cleanup { cd $old } -match regexp -result {.*[^/]} test filesystem-1.40 {file normalisation with repeated separators} { testPathEqual [file norm foo////bar] [file norm foo/bar] } ok test filesystem-1.41 {file normalisation with repeated separators} {win} { testPathEqual [file norm foo\\\\\\bar] [file norm foo/bar] } ok test filesystem-1.42 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/..] [file norm /] } ok test filesystem-1.42.1 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/../] [file norm /] } ok test filesystem-1.43 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/foo/../..] [file norm /] } ok test filesystem-1.43.1 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/foo/../../] [file norm /] } ok test filesystem-1.44 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/foo/../../bar] [file norm /bar] } ok test filesystem-1.45 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/../../bar] [file norm /bar] } ok test filesystem-1.46 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /xxx/../bar] [file norm /bar] } ok test filesystem-1.47 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /..] [file norm /] } ok test filesystem-1.48 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /../] [file norm /] } ok test filesystem-1.49 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /.] [file norm /] } ok test filesystem-1.50 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /./] [file norm /] } ok test filesystem-1.51 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /../..] [file norm /] } ok test filesystem-1.51.1 {file normalisation .. beyond root (Bug 1379287)} { testPathEqual [file norm /../../] [file norm /] } ok test filesystem-1.52 {bug f9f390d0fa: file join where strep is not canonical} -body { set x ///foo file normalize $x file join $x bar } -result /foo/bar test filesystem-1.52.1 {bug f9f390d0fa: file join where strep is not canonical} -body { set x ///foo file normalize $x file join $x } -result /foo test filesystem-1.53 {[Bug 3559678] - normalize when tail is empty} { string match */ [file normalize [lindex [glob -dir [pwd] {{}}] 0]] } 0 test filesystem-1.54 {[Bug ce3a211dcb] - normalize when tail is empty} -setup { set save [pwd] cd [set home [makeDirectory ce3a211dcb]] makeDirectory A $home cd [lindex [glob */] 0] } -body { string match */A [pwd] } -cleanup { cd $home removeDirectory A $home cd $save removeDirectory ce3a211dcb } -result 1 test filesystem-2.0 {new native path} {unix} { foreach f [lsort [glob -nocomplain /usr/bin/c*]] { catch {file readlink $f} } # If we reach here we've succeeded. We used to crash above. return ok } ok # Make sure the testfilesystem hasn't been registered. if {[testConstraint testfilesystem]} { proc resetfs {} { while {![catch {testfilesystem 0}]} {} } } test filesystem-3.1 {Tcl_FSRegister & Tcl_FSUnregister} testfilesystem { set result {} lappend result [testfilesystem 1] lappend result [testfilesystem 0] lappend result [catch {testfilesystem 0} msg] $msg } {registered unregistered 1 failed} test filesystem-3.3 {Tcl_FSRegister} testfilesystem { testfilesystem 1 testfilesystem 1 testfilesystem 0 testfilesystem 0 } {unregistered} test filesystem-3.4 {Tcl_FSRegister} -constraints testfilesystem -body { testfilesystem 1 file system bar } -cleanup { testfilesystem 0 } -result {reporting} test filesystem-3.5 {Tcl_FSUnregister} testfilesystem { resetfs lindex [file system bar] 0 } {native} test filesystem-4.0 {testfilesystem} -constraints testfilesystem -body { testfilesystem 1 set filesystemReport {} file exists foo testfilesystem 0 return $filesystemReport } -match glob -result {*{access foo}} test filesystem-4.1 {testfilesystem} -constraints testfilesystem -body { testfilesystem 1 set filesystemReport {} catch {file stat foo bar} testfilesystem 0 return $filesystemReport } -match glob -result {*{stat foo}} test filesystem-4.2 {testfilesystem} -constraints testfilesystem -body { testfilesystem 1 set filesystemReport {} catch {file lstat foo bar} testfilesystem 0 return $filesystemReport } -match glob -result {*{lstat foo}} test filesystem-4.3 {testfilesystem} -constraints testfilesystem -body { testfilesystem 1 set filesystemReport {} catch {glob *} testfilesystem 0 return $filesystemReport } -match glob -result {*{matchindirectory *}*} # This test is meaningless if there is no tilde expansion test filesystem-5.1 {cache and ~} -constraints { testfilesystem tildeexpansion } -setup { set orig $::env(HOME) } -body { set ::env(HOME) /foo/bar/blah set testdir ~ set res1 "Parent of ~ (/foo/bar/blah) is [file dirname $testdir]" set ::env(HOME) /a/b/c set res2 "Parent of ~ (/a/b/c) is [file dirname $testdir]" list $res1 $res2 } -cleanup { set ::env(HOME) $orig } -match regexp -result {{Parent of ~ \(/foo/bar/blah\) is ([a-zA-Z]:)?(/cygwin)?(/foo/bar|foo:bar)} {Parent of ~ \(/a/b/c\) is ([a-zA-Z]:)?(/cygwin)?(/a/b|a:b)}} test filesystem-6.1 {empty file name} -returnCodes error -body { open "" } -result {couldn't open "": no such file or directory} test filesystem-6.2 {empty file name} -returnCodes error -body { file stat "" arr } -result {could not read "": no such file or directory} test filesystem-6.3 {empty file name} -returnCodes error -body { file atime "" } -result {could not read "": no such file or directory} test filesystem-6.4 {empty file name} -returnCodes error -body { file attributes "" } -result {could not read "": no such file or directory} test filesystem-6.5 {empty file name} -returnCodes error -body { file copy "" "" } -result {error copying "": no such file or directory} test filesystem-6.6 {empty file name} {file delete ""} {} test filesystem-6.7 {empty file name} {file dirname ""} . test filesystem-6.8 {empty file name} {file executable ""} 0 test filesystem-6.9 {empty file name} {file exists ""} 0 test filesystem-6.10 {empty file name} {file extension ""} {} test filesystem-6.11 {empty file name} {file isdirectory ""} 0 test filesystem-6.12 {empty file name} {file isfile ""} 0 test filesystem-6.13 {empty file name} {file join ""} {} test filesystem-6.14 {empty file name} -returnCodes error -body { file link "" } -result {could not read link "": no such file or directory} test filesystem-6.15 {empty file name} -returnCodes error -body { file lstat "" arr } -result {could not read "": no such file or directory} test filesystem-6.16 {empty file name} -returnCodes error -body { file mtime "" } -result {could not read "": no such file or directory} test filesystem-6.17 {empty file name} -returnCodes error -body { file mtime "" 0 } -result {could not read "": no such file or directory} test filesystem-6.18 {empty file name} -returnCodes error -body { file mkdir "" } -result {can't create directory "": no such file or directory} test filesystem-6.19 {empty file name} {file nativename ""} {} test filesystem-6.20 {empty file name} {file normalize ""} {} test filesystem-6.21 {empty file name} {file owned ""} 0 test filesystem-6.22 {empty file name} {file pathtype ""} relative test filesystem-6.23 {empty file name} {file readable ""} 0 test filesystem-6.24 {empty file name} -returnCodes error -body { file readlink "" } -result {could not read link "": no such file or directory} test filesystem-6.25 {empty file name} -returnCodes error -body { file rename "" "" } -result {error renaming "": no such file or directory} test filesystem-6.26 {empty file name} {file rootname ""} {} test filesystem-6.27 {empty file name} -returnCodes error -body { file separator "" } -result {unrecognised path} test filesystem-6.28 {empty file name} -returnCodes error -body { file size "" } -result {could not read "": no such file or directory} test filesystem-6.29 {empty file name} {file split ""} {} test filesystem-6.30 {empty file name} -returnCodes error -body { file system "" } -result {unrecognised path} test filesystem-6.31 {empty file name} {file tail ""} {} test filesystem-6.32 {empty file name} -returnCodes error -body { file type "" } -result {could not read "": no such file or directory} test filesystem-6.33 {empty file name} {file writable ""} 0 test filesystem-6.34 {file name with (invalid) nul character} { list [catch "open foo\x00" msg] $msg } [list 1 "couldn't open \"foo\x00\": filename is invalid on this platform"] # Make sure the testfilesystem hasn't been registered. if {[testConstraint testfilesystem]} { while {![catch {testfilesystem 0}]} {} } test filesystem-7.1.1 {load from vfs} -setup { set dir [pwd] } -constraints {win testsimplefilesystem loaddll} -body { # This may cause a crash on exit if {[file dirname $::ddelib] ne "."} { cd [file dirname $::ddelib] } else { cd [file dirname [info nameofexecutable]] } if {![file exists [file tail $::ddelib]]} { ::tcltest::Skip "no-ddelib" } testsimplefilesystem 1 # This loads dde via a complex copy-to-temp operation load simplefs:/[file tail $::ddelib] Dde testsimplefilesystem 0 return ok # The real result of this test is what happens when Tcl exits. } -cleanup { cd $dir } -result ok test filesystem-7.1.2 {load from vfs, and then unload again} -setup { set dir [pwd] } -constraints {win testsimplefilesystem loaddll} -body { # This may cause a crash on exit if {[file dirname $::reglib] ne "."} { cd [file dirname $::reglib] } else { cd [file dirname [info nameofexecutable]] } if {![file exists [file tail $::reglib]]} { ::tcltest::Skip "no-reglib" } testsimplefilesystem 1 # This loads reg via a complex copy-to-temp operation load simplefs:/[file tail $::reglib] Registry unload simplefs:/[file tail $::reglib] testsimplefilesystem 0 return ok # The real result of this test is what happens when Tcl exits. } -cleanup { cd $dir } -result ok test filesystem-7.2 {cross-filesystem copy from vfs maintains mtime} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -constraints testsimplefilesystem -body { # We created this file several tests ago. set origtime [file mtime gorp.file] set res [file exists gorp.file] testsimplefilesystem 1 file delete -force theCopy file copy simplefs:/gorp.file theCopy testsimplefilesystem 0 set newtime [file mtime theCopy] lappend res [expr {$origtime == $newtime ? 1 : "$origtime != $newtime"}] } -cleanup { catch {file delete theCopy} cd $dir } -result {1 1} test filesystem-7.3 {glob in simplefs} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -constraints testsimplefilesystem -body { file mkdir simpledir close [open [file join simpledir simplefile] w] testsimplefilesystem 1 glob -nocomplain -dir simplefs:/simpledir * } -cleanup { catch {testsimplefilesystem 0} file delete -force simpledir cd $dir } -result {simplefs:/simpledir/simplefile} test filesystem-7.3.1 {glob in simplefs: no path/dir} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -constraints testsimplefilesystem -body { file mkdir simpledir close [open [file join simpledir simplefile] w] testsimplefilesystem 1 set res [glob -nocomplain simplefs:/simpledir/*] lappend res {*}[glob -nocomplain simplefs:/simpledir] } -cleanup { catch {testsimplefilesystem 0} file delete -force simpledir cd $dir } -result {simplefs:/simpledir/simplefile simplefs:/simpledir} test filesystem-7.3.2 {glob in simplefs: no path/dir, no subdirectory} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -constraints testsimplefilesystem -body { file mkdir simpledir close [open [file join simpledir simplefile] w] testsimplefilesystem 1 glob -nocomplain simplefs:/s* } -cleanup { catch {testsimplefilesystem 0} file delete -force simpledir cd $dir } -match glob -result ?* test filesystem-7.3.3 {glob in simplefs: pattern is a volume} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -constraints testsimplefilesystem -body { file mkdir simpledir close [open [file join simpledir simplefile] w] testsimplefilesystem 1 glob -nocomplain simplefs:/* } -cleanup { testsimplefilesystem 0 file delete -force simpledir cd $dir } -match glob -result ?* test filesystem-7.4 {cross-filesystem file copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] set fout [open [file join simplefile] w] puts -nonewline $fout "1234567890" close $fout testsimplefilesystem 1 } -constraints testsimplefilesystem -body { # First copy should succeed set res [catch {file copy simplefs:/simplefile file2} err] lappend res $err # Second copy should fail (no -force) lappend res [catch {file copy simplefs:/simplefile file2} err] lappend res $err # Third copy should succeed (-force) lappend res [catch {file copy -force simplefs:/simplefile file2} err] lappend res $err lappend res [file exists file2] } -cleanup { catch {testsimplefilesystem 0} file delete -force simplefile file delete -force file2 cd $dir } -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file exists} 0 {} 1} test filesystem-7.5 {cross-filesystem file copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] set fout [open [file join simplefile] w] puts -nonewline $fout "1234567890" close $fout testsimplefilesystem 1 } -constraints {testsimplefilesystem unix} -body { # First copy should succeed set res [catch {file copy simplefs:/simplefile file2} err] lappend res $err file attributes file2 -permissions 0 # Second copy should fail (no -force) lappend res [catch {file copy simplefs:/simplefile file2} err] lappend res $err # Third copy should succeed (-force) lappend res [catch {file copy -force simplefs:/simplefile file2} err] lappend res $err lappend res [file exists file2] } -cleanup { testsimplefilesystem 0 file delete -force simplefile file delete -force file2 cd $dir } -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file exists} 0 {} 1} test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] file delete -force simpledir file mkdir simpledir file mkdir dir2 set fout [open [file join simpledir simplefile] w] puts -nonewline $fout "1234567890" close $fout testsimplefilesystem 1 } -constraints testsimplefilesystem -body { # First copy should succeed set res [catch {file copy simplefs:/simpledir dir2} err] lappend res $err # Second copy should fail (no -force) lappend res [catch {file copy simplefs:/simpledir dir2} err] lappend res $err # Third copy should succeed (-force) lappend res [catch {file copy -force simplefs:/simpledir dir2} err] lappend res $err lappend res [file exists [file join dir2 simpledir]] \ [file exists [file join dir2 simpledir simplefile]] } -cleanup { testsimplefilesystem 0 file delete -force simpledir file delete -force dir2 cd $dir } -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file exists} 0 {} 1 1} test filesystem-7.7 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] file delete -force simpledir file mkdir simpledir file mkdir dir2 set fout [open [file join simpledir simplefile] w] puts -nonewline $fout "1234567890" close $fout testsimplefilesystem 1 } -constraints {testsimplefilesystem unix} -body { # First copy should succeed set res [catch {file copy simplefs:/simpledir dir2} err] lappend res $err # Second copy should fail (no -force) lappend res [catch {file copy simplefs:/simpledir dir2} err] lappend res $err # Third copy should succeed (-force) # I've noticed on some Unices that this only succeeds intermittently (some # runs work, some fail). This needs examining further. lappend res [catch {file copy -force simplefs:/simpledir dir2} err] lappend res $err lappend res [file exists [file join dir2 simpledir]] \ [file exists [file join dir2 simpledir simplefile]] } -cleanup { testsimplefilesystem 0 file delete -force simpledir file delete -force dir2 cd $dir } -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file exists} 0 {} 1 1} removeFile gorp.file test filesystem-7.8 {vfs cd} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] file delete -force simpledir file mkdir simpledir testsimplefilesystem 1 } -constraints testsimplefilesystem -body { # This can variously cause an infinite loop or simply have no effect at # all (before certain bugs were fixed, of course). cd simplefs:/simpledir pwd } -cleanup { cd [tcltest::temporaryDirectory] testsimplefilesystem 0 file delete -force simpledir cd $dir } -result {simplefs:/simpledir} test filesystem-8.1 {relative path objects and caching of pwd} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] } -body { makeDirectory abc makeDirectory def makeFile "contents" [file join abc foo] cd abc set f "foo" set res {} lappend res [file exists $f] lappend res [file exists $f] cd .. cd def # If we haven't cleared the object's cwd cache, Tcl will think it still # exists. lappend res [file exists $f] lappend res [file exists $f] } -cleanup { removeFile [file join abc foo] removeDirectory abc removeDirectory def cd $dir } -result {1 1 0 0} test filesystem-8.2 {relative path objects and use of pwd} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { set dir "abc" makeDirectory $dir makeFile "contents" [file join abc foo] cd $dir file exists [lindex [glob *] 0] } -cleanup { cd [tcltest::temporaryDirectory] removeFile [file join abc foo] removeDirectory abc cd $origdir } -result 1 test filesystem-8.3 {path objects and empty string} { set anchor "" set dst foo set res $dst set yyy [file split $anchor] set dst [file join $anchor $dst] lappend res $dst $yyy } {foo foo {}} proc TestFind1 {d f} { set r1 [file exists [file join $d $f]] lappend res "[file join $d $f] found: $r1" lappend res "is dir a dir? [file isdirectory $d]" set r2 [file exists [file join $d $f]] lappend res "[file join $d $f] found: $r2" return $res } proc TestFind2 {d f} { set r1 [file exists [file join $d $f]] lappend res "[file join $d $f] found: $r1" lappend res "is dir a dir? [file isdirectory [file join $d]]" set r2 [file exists [file join $d $f]] lappend res "[file join $d $f] found: $r2" return $res } test filesystem-9.1 {path objects and join and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir [file join a b c] TestFind1 a [file join b . c] } -cleanup { file delete -force a cd $origdir } -result {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}} test filesystem-9.2 {path objects and join and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir [file join a b c] TestFind2 a [file join b . c] } -cleanup { file delete -force a cd $origdir } -result {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}} test filesystem-9.2.1 {path objects and join and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir [file join a b c] TestFind2 a [file join b .] } -cleanup { file delete -force a cd $origdir } -result {{a/b/. found: 1} {is dir a dir? 1} {a/b/. found: 1}} test filesystem-9.3 {path objects and join and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir [file join a b c] TestFind1 a [file join b .. b c] } -cleanup { file delete -force a cd $origdir } -result {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}} test filesystem-9.4 {path objects and join and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir [file join a b c] TestFind2 a [file join b .. b c] } -cleanup { file delete -force a cd $origdir } -result {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}} test filesystem-9.5 {path objects and file tail and object rep} -setup { set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir dgp close [open dgp/test w] foreach relative [glob -nocomplain [file join * test]] { set absolute [file join [pwd] $relative] set res [list [file tail $absolute] "test"] } return $res } -cleanup { file delete -force dgp cd $origdir } -result {test test} test filesystem-9.6 {path objects and file tail and object rep} win { set res {} set p "C:\\toto" lappend res [file join $p toto] file isdirectory $p lappend res [file join $p toto] } {C:/toto/toto C:/toto/toto} test filesystem-9.7 {path objects and glob and file tail and tilde} -setup { set res {} set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir tilde close [open tilde/~testNotExist w] cd tilde set file [lindex [glob *test*] 0] lappend res [file exists $file] [catch {file tail $file} r] $r lappend res $file lappend res [file exists $file] [catch {file tail $file} r] $r lappend res [catch {file tail $file} r] $r } -cleanup { cd [tcltest::temporaryDirectory] file delete -force tilde cd $origdir } -result {1 0 ~testNotExist ~testNotExist 1 0 ~testNotExist 0 ~testNotExist} test filesystem-9.8 {path objects and glob and file tail and tilde} -setup { set res {} set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir tilde close [open tilde/~testNotExist w] cd tilde set file1 [lindex [glob *test*] 0] set file2 "~testNotExist" lappend res $file1 $file2 lappend res [catch {file tail $file1} r] $r lappend res [catch {file tail $file2} r] $r } -cleanup { cd [tcltest::temporaryDirectory] file delete -force tilde cd $origdir } -result {~testNotExist ~testNotExist 0 ~testNotExist 0 ~testNotExist} test filesystem-9.9 {path objects and glob and file tail and tilde} -setup { set res {} set origdir [pwd] cd [tcltest::temporaryDirectory] } -body { file mkdir tilde close [open tilde/~testNotExist w] cd tilde set file1 [lindex [glob *test*] 0] set file2 "~testNotExist" lappend res [catch {file exists $file1} r] $r lappend res [catch {file exists $file2} r] $r lappend res [string equal $file1 $file2] } -cleanup { cd [tcltest::temporaryDirectory] file delete -force tilde cd $origdir } -result {0 1 0 1 1} # ---------------------------------------------------------------------- test filesystem-10.1 {Bug 3414754} { string match */ [file join [pwd] foo/] } 0 cleanupTests unset -nocomplain drive drives } namespace delete ::tcl::test::fileSystem return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/fileName.test0000644000175000017500000016162715104661341015347 0ustar sergeisergei# This file tests the filename manipulation routines. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1995-1996 Sun Microsystems, Inc. # Copyright © 1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } set existingGlobals [info globals] ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] source [file join [file dirname [info script]] tcltests.tcl] testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testtranslatefilename [llength [info commands testtranslatefilename]] testConstraint linkDirectory 1 testConstraint symbolicLinkFile 1 if {[testConstraint win]} { if {$::tcl_platform(osVersion) < 5.0 \ || [lindex [file system [temporaryDirectory]] 1] ne "NTFS"} { testConstraint linkDirectory 0 } testConstraint symbolicLinkFile 0 testConstraint sharedCdrive [expr {![catch {cd //[info hostname]/c}]}] } testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # This match compares the first two words of the result. If the wanted result # is "equal", then this is successful if the words are equal. If the wanted # result is "not equal", then this is successful if the words are different. customMatch compareWords {apply {{a b} { lassign $b w1 w2 expr {$a eq "equal" ? $w1 eq $w2 : $w1 ne $w2} }}} proc touch filename {catch {close [open $filename w]}} global env if {[testConstraint testsetplatform]} { set platform [testgetplatform] } # Caution: when using 'testsetplatform' to test different file name platform # descriptions in this file, one must be very careful not to combine such # platform manipulation with commands like 'cd', 'pwd'. That is because the # latter commands operate on the real filesystem but will potentially have # their logic routed through the wrong generic code paths if we've used # 'testsetplatform'. This can lead to serious problems, even crashes. test filename-1.1 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype / } absolute test filename-1.2 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype /foo } absolute test filename-1.3 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype foo } relative test filename-1.4 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype c:/foo } relative test filename-1.5 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ~ } relative test filename-1.6 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ~/foo } relative test filename-1.7 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ~foo } relative test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ./~foo } relative test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype / } volumerelative test filename-3.2 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype \\ } volumerelative test filename-3.3 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype /foo } volumerelative test filename-3.4 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype \\foo } volumerelative test filename-3.5 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c:/ } absolute test filename-3.6 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c:\\ } absolute test filename-3.7 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c:/foo } absolute test filename-3.8 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c:\\foo } absolute test filename-3.9 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c: } volumerelative test filename-3.10 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype c:foo } volumerelative test filename-3.11 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype foo } relative test filename-3.12 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype //foo/bar } absolute test filename-3.13 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype ~foo } relative test filename-3.14 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype ~ } relative test filename-3.15 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype ~/foo } relative test filename-3.16 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype ./~foo } relative test filename-4.1 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split / } {/} test filename-4.2 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split /foo } {/ foo} test filename-4.3 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split /foo/bar } {/ foo bar} test filename-4.4 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split /foo/bar/baz } {/ foo bar baz} test filename-4.5 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo/bar } {foo bar} test filename-4.6 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ./foo/bar } {. foo bar} test filename-4.7 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split /foo/../././foo/bar } {/ foo .. . . foo bar} test filename-4.8 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ../foo/bar } {.. foo bar} test filename-4.9 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split {} } {} test filename-4.10 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split . } {.} test filename-4.11 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ../ } {..} test filename-4.12 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ../.. } {.. ..} test filename-4.13 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split //foo } "//foo" test filename-4.14 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo//bar } {foo bar} test filename-4.15 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ~foo } {~foo} test filename-4.16 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ~foo/~bar } {~foo ~bar} test filename-4.17 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split ~foo/~bar/~baz } {~foo ~bar ~baz} test filename-4.18 {Tcl_SplitPath: unix} {testsetplatform} { testsetplatform unix file split foo/bar~/baz } {foo bar~ baz} if {[testConstraint testsetplatform]} { testsetplatform $platform } test filename-4.19 {Tcl_SplitPath} -setup { set oldDir [pwd] cd [temporaryDirectory] } -body { file mkdir tildetmp set nastydir [file join tildetmp ./~tilde] file mkdir $nastydir set norm [file normalize $nastydir] cd tildetmp cd ./~tilde glob -nocomplain * set idx [string first tildetmp $norm] set norm [string range $norm $idx end] # fix path away so all platforms are the same regsub {(.*):$} $norm {\1} norm regsub -all ":" $norm "/" norm # make sure we can delete the directory we created cd $oldDir file delete -force $nastydir return $norm } -cleanup { cd $oldDir catch {file delete -force [file join [temporaryDirectory] tildetmp]} } -result {tildetmp/~tilde} test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split / } {/} test filename-6.2 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /foo } {/ foo} test filename-6.3 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /foo/bar } {/ foo bar} test filename-6.4 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /foo/bar/baz } {/ foo bar baz} test filename-6.5 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split foo/bar } {foo bar} test filename-6.6 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ./foo/bar } {. foo bar} test filename-6.7 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /foo/../././foo/bar } {/ foo .. . . foo bar} test filename-6.8 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ../foo/bar } {.. foo bar} test filename-6.9 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split {} } {} test filename-6.10 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split . } {.} test filename-6.11 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ../ } {..} test filename-6.12 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ../.. } {.. ..} test filename-6.13 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split //foo } {/ foo} test filename-6.14 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split foo//bar } {foo bar} test filename-6.15 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /\\/foo//bar } {//foo/bar} test filename-6.16 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /\\/foo//bar } {//foo/bar} test filename-6.17 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /\\/foo//bar } {//foo/bar} test filename-6.18 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split \\\\foo\\bar } {//foo/bar} test filename-6.19 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split \\\\foo\\bar/baz } {//foo/bar baz} test filename-6.20 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:/foo } {c:/ foo} test filename-6.21 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:foo } {c: foo} test filename-6.22 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c: } {c:} test filename-6.23 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:\\ } {c:/} test filename-6.24 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:/ } {c:/} test filename-6.25 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:/./.. } {c:/ . ..} test filename-6.26 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ~foo } {~foo} test filename-6.27 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ~foo/~bar } {~foo ~bar} test filename-6.28 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split ~foo/~bar/~baz } {~foo ~bar ~baz} test filename-6.29 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split foo/bar~/baz } {foo bar~ baz} test filename-6.30 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split c:~foo } {c: ~foo} test filename-7.1 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join / a } {/a} test filename-7.2 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join a b } {a/b} test filename-7.3 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /a c /b d } {/b/d} test filename-7.4 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join / } {/} test filename-7.5 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join a } {a} test filename-7.6 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join {} } {} test filename-7.7 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /a/ b } {/a/b} test filename-7.8 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /a// b } {/a/b} test filename-7.9 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /a/./../. b } {/a/./.././b} test filename-7.10 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join ~ a } {~/a} test filename-7.11 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join ~a ~b } {~a/~b} test filename-7.12 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join ./~a b } {./~a/b} test filename-7.13 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join ./~a ~b } {./~a/~b} test filename-7.14 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join ./~a ./~b } {./~a/./~b} test filename-7.15 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join a . b } {a/./b} test filename-7.16 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join a . ./~b } {a/././~b} test filename-7.17 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join //a b } "//a/b" test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /// a b } "/a/b" test filename-7.19 {[Bug f34cf83dd0]} { file join foo //bar } //bar test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join a b } {a/b} test filename-9.2 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join /a b } {/a/b} test filename-9.3 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join /a /b } {/b} test filename-9.4 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join c: foo } {c:foo} test filename-9.5 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join c:/ foo } {c:/foo} test filename-9.6 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join c:\\bar foo } {c:/bar/foo} test filename-9.7 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join /foo c:bar } {c:bar} test filename-9.8 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ///host//share dir } {//host/share/dir} test filename-9.9 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ~ foo } {~/foo} test filename-9.10 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ~/~foo } {~/~foo} test filename-9.11 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ~ ./~foo } {~/./~foo} test filename-9.12 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join / ~foo } {/~foo} test filename-9.13 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ./a/ b c } {./a/b/c} test filename-9.14 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join ./~a/ b c } {./~a/b/c} test filename-9.15 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join // host share path } {/host/share/path} test filename-9.16 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join foo . bar } {foo/./bar} test filename-9.17 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join foo .. bar } {foo/../bar} test filename-9.18 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join foo/./bar } {foo/./bar} test filename-9.19 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} lappend res \ [file join {C:\foo\bar}] \ [file join C:/blah {C:\foo\bar}] \ [file join C:/blah C:/blah {C:\foo\bar}] } {C:/foo/bar C:/foo/bar C:/foo/bar} test filename-9.19.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} lappend res \ [file join {foo\bar}] \ [file join C:/blah {foo\bar}] \ [file join C:/blah C:/blah {foo\bar}] } {foo/bar C:/blah/foo/bar C:/blah/foo/bar} test filename-9.19.2 {Tcl_JoinPath: win} {testsetplatform win} { testsetplatform win set res {} lappend res \ [file join {foo\bar}] \ [file join [pwd] {foo\bar}] \ [file join [pwd] [pwd] {foo\bar}] set nres {} foreach elt $res { lappend nres [string map [list [pwd] pwd] $elt] } set nres } {foo/bar pwd/foo/bar pwd/foo/bar} test filename-9.20 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix set res {} lappend res \ [file join {/foo/bar}] \ [file join /x {/foo/bar}] \ [file join /x /x {/foo/bar}] } {/foo/bar /foo/bar /foo/bar} test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} lappend res \ [file join {foo\bar}] \ [file join C:/blah {foo\bar}] \ [file join C:/blah C:/blah {foo\bar}] string map [list C:/blah ""] $res } {foo/bar /foo/bar /foo/bar} test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix set res {} lappend res \ [file join {foo/bar}] \ [file join /x {foo/bar}] \ [file join /x /x {foo/bar}] string map [list /x ""] $res } {foo/bar /foo/bar /foo/bar} test filename-10.1 {Tcl_TranslateFileName} -body { testsetplatform unix testtranslatefilename foo } -result {foo} -constraints {testsetplatform testtranslatefilename} test filename-10.2 {Tcl_TranslateFileName} -body { testsetplatform windows testtranslatefilename {c:/foo} } -result {c:\foo} -constraints {testsetplatform testtranslatefilename} test filename-10.3 {Tcl_TranslateFileName} -body { testsetplatform windows testtranslatefilename {c:/\\foo/} } -result {c:\foo} -constraints {testsetplatform testtranslatefilename} test filename-10.3.1 {Tcl_TranslateFileName} -body { testsetplatform windows testtranslatefilename {c://///} } -result c:\\ -constraints {testsetplatform testtranslatefilename} test filename-10.6 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "/home/test" testsetplatform unix testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~/foo} test filename-10.7 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { unset env(HOME) testsetplatform unix testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~/foo} test filename-10.8 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "/home/test" testsetplatform unix testtranslatefilename ~ } -cleanup { set env(HOME) $temp } -result {~} test filename-10.9 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "/home/test/" testsetplatform unix testtranslatefilename ~ } -cleanup { set env(HOME) $temp } -result {~} test filename-10.10 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "/home/test/" testsetplatform unix testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~/foo} test filename-10.17 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "\\home\\" testsetplatform windows testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~\foo} test filename-10.18 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "\\home\\" testsetplatform windows testtranslatefilename ~/foo\\bar } -cleanup { set env(HOME) $temp } -result {~\foo\bar} test filename-10.19 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "c:" testsetplatform windows testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~\foo} test filename-10.20 {Tcl_TranslateFileName} -body { testtranslatefilename ~blorp/foo } -constraints {testtranslatefilename testtranslatefilename} \ -result {~blorp\foo} test filename-10.21 {Tcl_TranslateFileName} -setup { global env set temp $env(HOME) } -constraints {testsetplatform testtranslatefilename} -body { set env(HOME) "c:\\" testsetplatform windows testtranslatefilename ~/foo } -cleanup { set env(HOME) $temp } -result {~\foo} test filename-10.22 {Tcl_TranslateFileName} -body { testsetplatform windows testtranslatefilename foo//bar } -constraints {testsetplatform testtranslatefilename} -result {foo\bar} if {[testConstraint testsetplatform]} { testsetplatform $platform } test filename-10.23 {Tcl_TranslateFileName} -body { # this test fails if ~ouster is not /home/ouster testtranslatefilename ~ouster } -constraints {nonPortable testtranslatefilename} -result {/home/ouster} test filename-10.24 {Tcl_TranslateFileName} -body { # this test fails if ~ouster is not /home/ouster testtranslatefilename ~ouster/foo } -result {/home/ouster/foo} -constraints {nonPortable testtranslatefilename} test filename-11.1 {Tcl_GlobCmd} -body { glob } -result {} test filename-11.2 {Tcl_GlobCmd} -returnCodes error -body { glob -gorp } -result {bad option "-gorp": must be -directory, -join, -nocomplain, -path, -tails, -types, or --} test filename-11.3 {Tcl_GlobCmd} -body { glob -nocomplai } -result {} test filename-11.4 {Tcl_GlobCmd} -body { glob -nocomplain } -result {} test filename-11.5 {Tcl_GlobCmd} -body { # Should not error out because of ~ catch {glob -nocomplain * ~xyqrszzz} } -result 0 test filename-11.6 {Tcl_GlobCmd} -body { glob ~xyqrszzz } -result {} test filename-11.7 {Tcl_GlobCmd} -body { glob -- -nocomplain } -result {} test filename-11.8 {Tcl_GlobCmd} -body { glob -nocomplain -- -nocomplain } -result {} test filename-11.9 {Tcl_GlobCmd} -constraints {testsetplatform} -body { testsetplatform unix glob ~\\xyqrszzz/bar } -result {} test filename-11.10 {Tcl_GlobCmd} -constraints {testsetplatform} -body { testsetplatform unix glob -nocomplain ~\\xyqrszzz/bar } -result {} test filename-11.11 {Tcl_GlobCmd} -constraints {testsetplatform} -body { testsetplatform unix glob ~xyqrszzz\\/\\bar } -result {} test filename-11.12 {Tcl_GlobCmd} -constraints {testsetplatform} -setup { testsetplatform unix set home $env(HOME) } -body { unset env(HOME) glob ~/* } -cleanup { set env(HOME) $home } -result {} if {[testConstraint testsetplatform]} { testsetplatform $platform } test filename-11.13 {Tcl_GlobCmd} -body { file join [lindex [glob ~] 0] } -result {} set oldpwd [pwd] set oldhome $env(HOME) catch {cd [makeDirectory tcl[pid]]} set env(HOME) [pwd] file delete -force globTest file mkdir globTest/a1/b1 file mkdir globTest/a1/b2 file mkdir globTest/a2/b3 file mkdir globTest/a3 touch globTest/x1.c touch globTest/y1.c touch globTest/z1.c touch "globTest/weird name.c" touch globTest/a1/b1/x2.c touch globTest/a1/b2/y2.c touch globTest/.1 touch globTest/x,z1.c test filename-11.14 {Tcl_GlobCmd} -body { glob ~/globTest } -result {} test filename-11.15 {Tcl_GlobCmd} -body { glob ~\\/globTest } -result {} test filename-11.16 {Tcl_GlobCmd} { glob globTest } {globTest} set globname "globTest" set horribleglobname "glob\[\{Test" set tildeglobname "./~test.txt" test filename-11.17 {Tcl_GlobCmd} {unix} { lsort [glob -directory $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.17.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -directory $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.17.2 {Tcl_GlobCmd} -setup { set dir [pwd] } -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir lsort [glob -directory $globname -join * b1] } -cleanup { cd $dir file delete [file join $globname link] } -result [list [file join $globname a1 b1] \ [file join $globname link b1]] # Simpler version of the above test to illustrate a given bug. test filename-11.17.3 {Tcl_GlobCmd} -setup { set dir [pwd] } -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir lsort [glob -directory $globname -type d *] } -cleanup { cd $dir file delete [file join $globname link] } -result [list [file join $globname a1] \ [file join $globname a2] \ [file join $globname a3] \ [file join $globname link]] # Make sure the bugfix isn't too simple. We don't want to break 'glob -type l' test filename-11.17.4 {Tcl_GlobCmd} -setup { set dir [pwd] } -constraints {notRoot linkDirectory notWine} -body { cd $globname file link -symbolic link a1 cd $dir lsort [glob -directory $globname -type l *] } -cleanup { cd $dir file delete [file join $globname link] } -result [list [file join $globname link]] test filename-11.17.5 {Tcl_GlobCmd} { lsort [glob -directory $globname -tails *.c] } [lsort [list "weird name.c" x,z1.c x1.c y1.c z1.c]] test filename-11.17.6 {Tcl_GlobCmd} { lsort [glob -directory $globname -tails *.c *.c] } [lsort [concat [list "weird name.c" x,z1.c x1.c y1.c z1.c] \ [list "weird name.c" x,z1.c x1.c y1.c z1.c]]] test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} -setup { set dir [pwd] } -constraints {linkDirectory notWine} -body { cd $globname file mkdir nonexistent file link -symbolic link nonexistent file delete nonexistent cd $dir lsort [glob -nocomplain -directory $globname -type l *] } -cleanup { cd $dir file delete [file join $globname link] } -result [list [file join $globname link]] test filename-11.17.8 {Tcl_GlobCmd: broken link and glob -l} -setup { set dir [pwd] } -constraints {symbolicLinkFile} -body { cd $globname touch "nonexistent" file link -symbolic link nonexistent file delete nonexistent cd $dir lsort [glob -nocomplain -directory $globname -type l *] } -cleanup { cd $dir file delete [file join $globname link] } -result [list [file join $globname link]] test filename-11.18 {Tcl_GlobCmd} {unix} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.18.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.19 {Tcl_GlobCmd} {unix} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.19.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.20 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] test filename-11.21 {Tcl_GlobCmd} { lsort [glob -type d -path $globname *] } [list $globname] test filename-11.21.1 {Tcl_GlobCmd} -body { touch {[tcl].testremains} lsort [glob -path {[tcl]} *] } -cleanup { file delete -force {[tcl].testremains} } -result {{[tcl].testremains}} # Get rid of file/dir if it exists, since it will have been left behind by a # previous failed run. file delete -force $horribleglobname file rename globTest $horribleglobname set globname $horribleglobname file delete -force $tildeglobname close [open $tildeglobname w] test filename-11.22 {Tcl_GlobCmd} {unix} { lsort [glob -dir $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.22.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -dir $globname *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.23 {Tcl_GlobCmd} {unix} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.23.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -path $globname/ *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.24 {Tcl_GlobCmd} {unix} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.24.1 {Tcl_GlobCmd} {win notWine} { lsort [glob -join -path [string range $globname 0 5] * *] } [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-11.25 {Tcl_GlobCmd} notWine { lsort [glob -type d -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] test filename-11.25.1 {Tcl_GlobCmd} notWine { lsort [glob -type {d r} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] test filename-11.25.2 {Tcl_GlobCmd} notWine { lsort [glob -type {d r w} -dir $globname *] } [lsort [list [file join $globname a1]\ [file join $globname a2]\ [file join $globname a3]]] test filename-11.26 {Tcl_GlobCmd} { glob -type d -path $globname * } [list $globname] test filename-11.27 {Tcl_GlobCmd} -returnCodes error -body { glob -types abcde * } -result {bad argument to "-types": abcde} test filename-11.28 {Tcl_GlobCmd} -returnCodes error -body { glob -types z * } -result {bad argument to "-types": z} test filename-11.29 {Tcl_GlobCmd} -returnCodes error -body { glob -types {abcd efgh} * } -result {only one MacOS type or creator argument to "-types" allowed} test filename-11.30 {Tcl_GlobCmd} -returnCodes error -body { glob -types {{macintosh type TEXT} {macintosh creator ALFA} efgh} * } -result {only one MacOS type or creator argument to "-types" allowed} test filename-11.31 {Tcl_GlobCmd} -returnCodes error -body { glob -types } -result {missing argument to "-types"} test filename-11.32 {Tcl_GlobCmd} -returnCodes error -body { glob -path hello -dir hello * } -result {"-directory" cannot be used with "-path"} test filename-11.33 {Tcl_GlobCmd} -returnCodes error -body { glob -path } -result {missing argument to "-path"} test filename-11.34 {Tcl_GlobCmd} -returnCodes error -body { glob -direct } -result {missing argument to "-directory"} test filename-11.35 {Tcl_GlobCmd} -returnCodes error -body { glob -paths * } -result {bad option "-paths": must be -directory, -join, -nocomplain, -path, -tails, -types, or --} # Test '-tails' flag to glob. test filename-11.36 {Tcl_GlobCmd} -returnCodes error -body { glob -tails * } -result {"-tails" must be used with either "-directory" or "-path"} test filename-11.37 {Tcl_GlobCmd} { glob -type d -tails -path $globname * } [list $globname] test filename-11.38 {Tcl_GlobCmd} { glob -tails -path $globname * } [list $globname] test filename-11.39 {Tcl_GlobCmd} { glob -tails -join -path $globname * } [list $globname] test filename-11.40 {Tcl_GlobCmd} -body { list [glob -dir [pwd] -tails *] [glob *] } -match compareWords -result equal test filename-11.41 {Tcl_GlobCmd} -body { list [glob -dir [pwd] -tails *] [glob -dir [pwd] *] } -match compareWords -result "not equal" test filename-11.42 {Tcl_GlobCmd} -body { set res [list] foreach f [glob -dir [pwd] *] { set f [file tail $f] regsub {^./} $f {} f; # until glob bug [2511011fff] don't fixed (tilde expansion prevention). lappend res $f } list $res [glob *] } -match compareWords -result equal test filename-11.43 {Tcl_GlobCmd} -returnCodes error -body { glob -t * } -result {ambiguous option "-t": must be -directory, -join, -nocomplain, -path, -tails, -types, or --} test filename-11.44 {Tcl_GlobCmd} -returnCodes error -body { glob -tails -path hello -directory hello * } -result {"-directory" cannot be used with "-path"} test filename-11.45 {Tcl_GlobCmd on root volume} -setup { set res1 "" set res2 "" set tmpd [pwd] } -body { catch { set res1 [glob -dir [lindex [file volumes] end] -tails *] } catch { cd [lindex [file volumes] end] set res2 [glob *] } list $res1 $res2 } -cleanup { cd $tmpd } -match compareWords -result equal test filename-11.46 {Tcl_GlobCmd} -returnCodes error -body { glob -types abcde -dir foo * } -result {bad argument to "-types": abcde} test filename-11.47 {Tcl_GlobCmd} -returnCodes error -body { glob -types abcde -path foo * } -result {bad argument to "-types": abcde} test filename-11.48 {Tcl_GlobCmd} -returnCodes error -body { glob -types abcde -dir foo -join * * } -result {bad argument to "-types": abcde} test filename-11.49 {Tcl_GlobCmd} -returnCodes error -body { glob -types abcde -path foo -join * * } -result {bad argument to "-types": abcde} test filename-11.50 {Tcl_GlobCmd} -returnCodes error -body { glob -path hello -path salut * } -result {"-path" may only be used once} test filename-11.51 {Tcl_GlobCmd} -returnCodes error -body { glob -dir hello -dir salut * } -result {"-directory" may only be used once} file rename $horribleglobname globTest file delete -force $tildeglobname set globname globTest unset horribleglobname tildeglobname test filename-12.1 {simple globbing} -constraints {unixOrWin} -body { glob {} } -result {.} test filename-12.1.1 {simple globbing} -constraints {unixOrWin} -body { glob -types f {} } -result {} test filename-12.1.2 {simple globbing} -constraints {unixOrWin} -body { glob -types d {} } -result {.} test filename-12.1.3 {simple globbing} -constraints {unix} -body { glob -types hidden {} } -result {.} test filename-12.1.4 {simple globbing} -constraints {win} -body { glob -types hidden {} } -result {} test filename-12.1.5 {simple globbing} -constraints {win} -body { glob -types hidden c:/ } -result {} test filename-12.1.6 {simple globbing} -constraints {win} -body { glob c:/ } -result {c:/} test filename-12.3 {simple globbing} -body { glob -nocomplain \{a1,a2\} } -result {} set globPreResult globTest/ set x1 x1.c set y1 y1.c test filename-12.4 {simple globbing} -constraints {unixOrWin} -body { lsort [glob globTest/x1.c globTest/y1.c globTest/foo] } -result "$globPreResult$x1 $globPreResult$y1" test filename-12.5 {simple globbing} -body { glob globTest\\/x1.c } -result "$globPreResult$x1" test filename-12.6 {simple globbing} -body { glob globTest\\/\\x1.c } -result "$globPreResult$x1" test filename-12.7 {globbing at filesystem root} -constraints {unix} -body { list [glob -nocomplain /*] [glob -path / *] } -match compareWords -result equal test filename-12.8 {globbing at filesystem root} -constraints {unix} -body { set first [string range [lindex [glob -type d /*] 0] 0 1] list [glob -nocomplain ${first}*] [glob -path $first *] } -match compareWords -result equal test filename-12.9 {globbing at filesystem root} -constraints {win} -body { # Can't grab just anything from 'file volumes' because we need a dir that # has subdirs - assume that C:/ exists across Windows machines. set first [string range [lindex [glob -type d C:/*] 0] 0 3] list [glob -nocomplain ${first}*] [glob -path $first *] } -match compareWords -result equal test filename-12.10 {globbing with volume relative paths} -setup { set pwd [pwd] } -body { set dir [lindex [glob -type d C:/*] 0] cd C:/ list [glob -nocomplain [string range $dir 2 end]] [list $dir] } -cleanup { cd $pwd } -constraints {win} -match compareWords -result equal test filename-13.1 {globbing with brace substitution} { glob globTest/\{\} } "$globPreResult" test filename-13.2 {globbing with brace substitution} -body { glob globTest/\{ } -returnCodes error -result {unmatched open-brace in file name} test filename-13.3 {globbing with brace substitution} -body { glob globTest/\{\\\} } -returnCodes error -result {unmatched open-brace in file name} test filename-13.4 {globbing with brace substitution} -body { glob globTest/\{\\ } -returnCodes error -result {unmatched open-brace in file name} test filename-13.5 {globbing with brace substitution} -body { glob globTest/\} } -returnCodes error -result {unmatched close-brace in file name} test filename-13.6 {globbing with brace substitution} { glob globTest/\{\}x1.c } "$globPreResult$x1" test filename-13.7 {globbing with brace substitution} { glob globTest/\{x\}1.c } "$globPreResult$x1" test filename-13.8 {globbing with brace substitution} { glob globTest/\{x\{\}\}1.c } "$globPreResult$x1" test filename-13.9 {globbing with brace substitution} { lsort [glob globTest/\{x,y\}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.10 {globbing with brace substitution} { lsort [glob globTest/\{x,,y\}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.11 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/\{x,x\\,z,z\}1.c] } [lsort {globTest/x1.c globTest/x,z1.c globTest/z1.c}] test filename-13.13 {globbing with brace substitution} { lsort [glob globTest/{a,b,x,y}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.14 {globbing with brace substitution} {unixOrWin} { lsort [glob {globTest/{x1,y2,weird name}.c}] } {{globTest/weird name.c} globTest/x1.c} test filename-13.16 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{x1.c,a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} test filename-13.18 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{x1.c,{a},a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} test filename-13.20 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{a,x}1/*/{x,y}*] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} test filename-13.22 {globbing with brace substitution} -body { glob globTest/\{a,x\}1/*/\{ } -returnCodes error -result {unmatched open-brace in file name} test filename-14.1 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.3 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/?1.c] } {globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.5 {asterisks, question marks, and brackets} -setup { # The current directory could be anywhere; do this to stop spurious # matches file mkdir globTestContext file rename globTest [file join globTestContext globTest] set savepwd [pwd] cd globTestContext } -constraints {unixOrWin} -body { lsort [glob */*/*/*.c] } -cleanup { # Reset to where we were cd $savepwd file rename [file join globTestContext globTest] globTest file delete globTestContext } -result {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} test filename-14.7 {asterisks, question marks, and brackets} {unix} { lsort [glob globTest/*] } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.7.1 {asterisks, question marks, and brackets} {win notWine} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/*/*] } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} test filename-14.13 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin notWine} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} test filename-14.17 {asterisks, question marks, and brackets} -setup { global env set temp $env(HOME) } -body { set env(HOME) [file join $env(HOME) globTest] glob [file home]/z* } -cleanup { set env(HOME) $temp } -result [list [file join $env(HOME) globTest z1.c]] test filename-14.18 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/*.c goo/*] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.20 {asterisks, question marks, and brackets} { glob -nocomplain goo/* } {} test filename-14.21 {asterisks, question marks, and brackets} -body { glob globTest/*/gorp } -result {} test filename-14.22 {asterisks, question marks, and brackets} -body { glob goo/* x*z foo?q } -result {} test filename-14.23 {slash globbing} {unix} { glob / } / # NOTE: [The string index x/ 1] construction is a workaround for the # testsetplatform calls above interacting with normalized path caching # in -singleproc 1 runs. See ticket [8c63606802]. test filename-14.23.2 {slash globbing} {win} { glob / } [file normalize [string index x/ 1]] test filename-14.24 {slash globbing} {win} { glob {\\} } [file normalize [string index x/ 1]] test filename-14.25 {type specific globbing} {unix} { lsort [glob -dir globTest -types f *] } [lsort [list \ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-14.25.1 {type specific globbing} {win notWine} { lsort [glob -dir globTest -types f *] } [lsort [list \ [file join $globname .1]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]] test filename-14.26 {type specific globbing} { glob -nocomplain -dir globTest -types {readonly} * } {} test filename-14.27 {Bug 2710920} {unixOrWin} { file tail [lindex [lsort [glob globTest/*/]] 0] } a1 test filename-14.28 {Bug 2710920} {unixOrWin} { file dirname [lindex [lsort [glob globTest/*/]] 0] } globTest test filename-14.29 {Bug 2710920} {unixOrWin} { file extension [lindex [lsort [glob globTest/*/]] 0] } {} test filename-14.30 {Bug 2710920} {unixOrWin} { file rootname [lindex [lsort [glob globTest/*/]] 0] } globTest/a1/ test filename-14.31 {Bug 2918610} -setup { set d [makeDirectory foo] makeFile {} bar.soom $d } -body { foreach fn [glob $d/bar.soom] { set root [file rootname $fn] close [open $root {WRONLY CREAT}] } llength [glob -directory $d *] } -cleanup { file delete -force $d/bar removeFile bar.soom $d removeDirectory foo } -result 2 unset globname # The following tests are only valid for Unix systems. On some systems, like # AFS, "000" protection doesn't prevent access by owner, so the following test # is not portable. catch {file attributes globTest/a1 -permissions 0} test filename-15.1 {unix specific globbing} {unix nonPortable} { string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode] } {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}} test filename-15.2 {unix specific no complain: no errors} {unix nonPortable} { glob -nocomplain globTest/a1/* } {} test filename-15.3 {unix specific no complain: no errors, good result} \ {unix nonPortable} { # test fails because if an error occurs, the interp's result is reset... glob -nocomplain globTest/a2 globTest/a1/* globTest/a3 } {globTest/a2 globTest/a3} catch {file attributes globTest/a1 -permissions 0o755} test filename-15.4 {unix specific no complain: no errors, good result} \ {unix nonPortable} { # test fails because if an error occurs, the interp's result is reset... # or you don't run at scriptics where the ouster and welch users exists glob -nocomplain ~ouster ~foo ~welch } {/home/ouster /home/welch} test filename-15.4.1 {no complain: errors, sequencing} { # ~xxx no longer expanded so errors about unknown users should not occur list [catch {glob -nocomplain ~wontexist ~blahxyz ~} res1] $res1 \ [catch {glob -nocomplain ~ ~blahxyz ~wontexist} res2] $res2 } {0 {} 0 {}} test filename-15.4.2 {no complain: errors, sequencing} -body { # test used to fail because if an error occurs, the interp's result is # reset... list [list [catch {glob -nocomplain ~wontexist *} res1] $res1] \ [list [catch {glob -nocomplain * ~wontexist} res2] $res2] } -match compareWords -result equal test filename-15.5 {unix specific globbing} {unix nonPortable} { glob ~ouster/.csh* } "/home/ouster/.cshrc" # 15.6 removed. It checked if glob ~ returned valid information if # home directory contained glob chars. Since ~ expansion is no longer # supported, the test was meaningless test filename-15.7 {glob tilde} -body { glob ~ } -result {} test filename-15.8 {win and unix specific globbing} -constraints {unixOrWin} -setup { global env set temp $env(HOME) } -body { touch $env(HOME)/globTest/anyname set env(HOME) $env(HOME)/globTest/anyname glob ~ } -cleanup { set env(HOME) $temp catch {file delete -force $env(HOME)/globTest/anyname} } -result {} # The following tests are only valid for Windows systems. set oldDir [pwd] if {[testConstraint win]} { cd c:/ file delete -force globTest file mkdir globTest touch globTest/x1.BAT touch globTest/y1.Bat touch globTest/z1.bat } test filename-16.1 {windows specific globbing} {win} { lsort [glob globTest/*.bat] } {globTest/x1.BAT globTest/y1.Bat globTest/z1.bat} test filename-16.2 {windows specific globbing} {win} { glob c: } c: test filename-16.2.1 {windows specific globbing} -constraints {win} -setup { set dir [pwd] } -body { cd C:/ glob c: } -cleanup { cd $dir } -result c: test filename-16.3 {windows specific globbing} {win} { glob -nocomplain c:\\\\ } c:/ test filename-16.4 {windows specific globbing} {win} { glob -nocomplain c:/ } c:/ test filename-16.5 {windows specific globbing} {win} { glob -nocomplain c:*bTest } c:globTest test filename-16.6 {windows specific globbing} {win} { glob -nocomplain c:\\\\*bTest } c:/globTest test filename-16.7 {windows specific globbing} {win} { glob -nocomplain c:/*bTest } c:/globTest test filename-16.8 {windows specific globbing} {win} { lsort [glob -nocomplain c:globTest/*.bat] } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} test filename-16.9 {windows specific globbing} {win} { lsort [glob -nocomplain c:/globTest/*.bat] } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} test filename-16.10 {windows specific globbing} {win} { lsort [glob -nocomplain c:globTest\\\\*.bat] } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} test filename-16.11 {windows specific globbing} {win} { lsort [glob -nocomplain c:\\\\globTest\\\\*.bat] } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} # some tests require a shared C drive test filename-16.12 {windows specific globbing} {win sharedCdrive} { cd //[info hostname]/c glob //[info hostname]/c/*Test } //[info hostname]/c/globTest test filename-16.13 {windows specific globbing} {win sharedCdrive} { cd //[info hostname]/c glob "\\\\\\\\[info hostname]\\\\c\\\\*Test" } //[info hostname]/c/globTest test filename-16.14 {windows specific globbing} {win sharedCdrive} { cd [lindex [glob -types d -dir C:/ *] 0] expr {".." in [glob {{.,*}*}]} } {1} test filename-16.15 {windows specific globbing} {win} { cd [lindex [glob -types d -dir C:/ *] 0] glob .. } {..} test filename-16.16 {windows specific globbing} {win} { file tail [lindex [glob -nocomplain "[lindex [glob -types d -dir C:/ *] 0]/.."] 0] } {..} test filename-16.17 {windows specific globbing} -constraints {win} -body { cd C:/ # Ensure correct trimming of tails with absolute and volume relative # globbing. list [glob -nocomplain -tails -dir C:/ *] \ [glob -nocomplain -tails -dir C: *] } -match compareWords -result equal # Put the working directory back now that we're done with globbing in C:/ if {[testConstraint win]} { cd $oldDir } test filename-17.1 {windows specific special files} {testsetplatform} { testsetplatform win list [file pathtype com1] [file pathtype con] [file pathtype lpt3] \ [file pathtype prn] [file pathtype nul] [file pathtype aux] \ [file pathtype foo] } {absolute absolute absolute absolute absolute absolute relative} if {[testConstraint testsetplatform]} { testsetplatform $platform } test filename-17.2 {windows specific glob with executable} -body { makeDirectory execglob foreach ext {exe com cmd bat notexecutable} { makeFile contents execglob/abc.$ext } lsort [glob -nocomplain -dir [temporaryDirectory]/execglob -tails -types x *] } -constraints {win} -cleanup { foreach ext {exe com cmd bat ps1 notexecutable} { removeFile execglob/abc.$ext } removeDirectory execglob } -result {abc.bat abc.cmd abc.com abc.exe} test filename-17.3 {Bug 2571597} win { set p /a file pathtype $p file normalize $p file pathtype $p } volumerelative test fileName-18.1 {windows - split ADS name correctly} {win} { # bug 1194458 set x [file split c:/c:d] list $x [file join {*}$x] } {{c:/ ./c:d} c:/c:d} test fileName-19.1 {ensure that [Bug 1325099] stays fixed} { # Any non-crashing result is OK list [file exists ~//.nonexistant_file] [file exists ~///.nonexistant_file] } {0 0} test fileName-20.1 {Bug 1750300} -setup { set d [makeDirectory foo] makeFile {} TAGS $d } -body { llength [glob -nocomplain -directory $d -- TAGS one two] } -cleanup { removeFile TAGS $d removeDirectory foo } -result 1 test fileName-20.2 {Bug 1750300} -setup { set d [makeDirectory foo] makeFile {} TAGS $d } -body { llength [glob -nocomplain -directory $d -types {} -- TAGS one two] } -cleanup { removeFile TAGS $d removeDirectory foo } -result 1 test fileName-20.3 {Bug 1750300} -setup { set d [makeDirectory foo] makeFile {} TAGS $d } -body { llength [glob -nocomplain -directory $d -types {} -- *U*] } -cleanup { removeFile TAGS $d removeDirectory foo } -result 0 test fileName-20.4 {Bug 1750300} -setup { set d [makeDirectory foo] makeFile {} TAGS $d } -body { llength [glob -nocomplain -directory $d -types {} -- URGENT Urkle] } -cleanup { removeFile TAGS $d removeDirectory foo } -result 0 test fileName-20.5 {Bug 2837800} -setup { set dd [makeDirectory isolate] set d [makeDirectory ./~foo $dd] makeFile {} test $d set savewd [pwd] cd $dd } -body { glob -nocomplain */test } -cleanup { cd $savewd removeFile test $d removeDirectory ./~foo $dd removeDirectory isolate } -result ~foo/test test fileName-20.6 {Bug 2837800} -setup { # Recall that we have $env(HOME) set so that references # to ~ point to [temporaryDirectory] makeFile {} test [file home] set dd [makeDirectory isolate] set d [makeDirectory ./~ $dd] set savewd [pwd] cd $dd } -body { glob -nocomplain */test } -cleanup { cd $savewd removeDirectory ./~ $dd removeDirectory isolate removeFile test [file home] } -result {} test fileName-20.7 {Bug 2806250} -setup { set savewd [pwd] cd [temporaryDirectory] set d [makeDirectory isolate] makeFile {} ./~test $d } -body { file exists [lindex [glob -nocomplain isolate/*] 0] } -cleanup { removeFile ./~test $d removeDirectory isolate cd $savewd } -result 1 test fileName-20.8 {Bug 2806250} -setup { set savewd [pwd] cd [temporaryDirectory] set d [makeDirectory isolate] makeFile {} ./~test $d } -body { file tail [lindex [glob -nocomplain isolate/*] 0] } -cleanup { removeFile ./~test $d removeDirectory isolate cd $savewd } -result ~test test fileName-20.10 {globbing for special chars} -setup { set s [makeDirectory sub [file home]] makeFile {} fileName-20.10 $s set d [makeDirectory isolate] set savewd [pwd] cd $d } -body { glob -nocomplain -directory [file home] -join * fileName-20.10 } -cleanup { cd $savewd removeDirectory isolate removeFile fileName-20.10 $s removeDirectory sub [file home] } -result [file home]/sub/fileName-20.10 test fileName-20.11 {glob dir with undecodable file names} -setup { # Specifically use /tmp as on WSL [temporaryDirectory] # on NTFS prevents creation of arbitrary byte sequences in names. set prevDir [pwd] set testDir /tmp/tcltest/fileName-20.11 file delete -force $testDir; # Clear it file mkdir $testDir cd $testDir set prevEnc [encoding system] # Create a file name that is invalid if interpreted as utf-8 encoding system iso8859-1 close [open \xe9 w] } -cleanup { encoding system $prevEnc cd $prevDir file delete -force $testDir } -constraints {unix knownBug} -body { set result [file exists [lindex [glob *] 0]] encoding system utf-8 lappend result [file exists [lindex [glob *] 0]] } -result {1 1} apply [list {} { test fileName-6d4e9d1af5bf5b7d { memory leak in SetFsPathFromAny Runs under both a TCL_DEBUG_MEM build and a -DPURIFY build for valgrind, which is useful since Valgrind provides information about the error location, but [memory] doesn't. } -setup { if {[namespace which ::memory] eq {}} { set memcheckcmd [list ::apply [list script { uplevel 1 $script return 0 } [namespace current]]] } else { set memcheckcmd ::tcltests::scriptmemcheck } } -body { {*}$memcheckcmd { set interp [interp create] interp eval $interp { apply [list {} { upvar 1 f f # A unique name so that no internal representation of this # literal value has been picked up from any other script # that has alredy been sourced into this interpreter. set variableUniqueInTheEntireTclCodebase a set name variableUniqueInTheEntireTclCodebase # give the Tcl_Obj for "var1" an internal representation of # type 'localVarNameType'. set $name set f [open variableUniqueInTheEntireTclCodebase w] try { puts $f {some data} } finally { close $f } set f [open variableUniqueInTheEntireTclCodebase] try { read $f } finally { catch {file delete variableUniqueInTheEntireTclCodebase} close $f } } [namespace current]] } interp delete $interp } } -result 0 } [namespace current]] # cleanup catch {file delete -force C:/globTest} cd [temporaryDirectory] file delete -force globTest cd $oldpwd catch {removeDirectory tcl[pid]} set env(HOME) $oldhome if {[testConstraint testsetplatform]} { testsetplatform $platform catch {unset platform} } unset -nocomplain {*}[lmap x [info globals] { if {$x in $existingGlobals} {continue} set x }] ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/fCmd.test0000644000175000017500000031021015104661341014460 0ustar sergeisergei# This file tests the tclFCmd.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996-1997 Sun Microsystems, Inc. # Copyright © 1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] cd [temporaryDirectory] testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testchmod [llength [info commands testchmod]] testConstraint winLessThan10 0 # Don't know how to determine this constraint correctly testConstraint notNetworkFilesystem 0 testConstraint reg 0 if {[testConstraint win]} { if {[catch { # Is the registry extension already static to this shell? try { load {} Registry set ::reglib {} } on error {} { # try the location given to use on the commandline to tcltest ::tcltest::loadTestedCommands load $::reglib Registry } testConstraint reg 1 } regError]} { catch {package require registry; testConstraint reg 1} } } testConstraint notInCIenv [expr {![info exists ::env(CI)] || !$::env(CI)}] # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] set tmpspace /tmp;# default value # Find a group that exists on this Unix system, or else skip tests that # require Unix groups. testConstraint foundGroup [expr {![testConstraint unix]}] if {[testConstraint unix]} { catch { set groupList [exec groups] set group [lindex $groupList 0] testConstraint foundGroup 1 } proc dev dir { file stat $dir stat return $stat(dev) } if {[catch {makeDirectory tcl[pid] /tmp} tmpspace] == 0} { testConstraint xdev [expr {([dev .] != [dev $tmpspace])}] } } # Also used in winFCmd... if {[testConstraint win] && $::tcl_platform(osVersion) < 10.0} { testConstraint winLessThan10 1 } testConstraint darwin9 [expr { [testConstraint unix] && $tcl_platform(os) eq "Darwin" && [package vsatisfies 1.$::tcl_platform(osVersion) 1.9] }] testConstraint notDarwin9 [expr {![testConstraint darwin9]}] testConstraint notContinuousIntegration [expr {![info exists ::env(CI)]}] testConstraint fileSharing 0 testConstraint notFileSharing 1 testConstraint linkFile 1 testConstraint linkDirectory 1 testConstraint testfstildeexpand [llength [info commands testfstildeexpand]] # Several tests require need to match results against the Unix username set user {} if {[testConstraint unix]} { catch { set user [exec whoami] } if {$user eq ""} { catch { regexp {^[^(]*\(([^)]*)\)} [exec id] -> user } } if {$user eq ""} { set user "root" } } if {[testConstraint win]} { catch { set user $::env(USERNAME) } if {$user eq ""} { set user Administrator } } # Try getting a lower case glob pattern that will match the home directory of # a given user to test ~user and [file tildeexpand ~user]. Note this may not # be the same as ~ even when "user" is current user. For example, on Unix # platforms ~ will return HOME envvar, but ~user will lookup password file # bypassing HOME. If home directory not found, returns *$user* so caller can # succeed by using glob matching under the hope that the path contains # the user name. proc gethomedirglob {user} { if {[testConstraint unix]} { if {![catch { exec {*}[auto_execok sh] -c "echo ~$user" } home]} { set home [string trim $home] if {$home ne ""} { # Expect exact match (except case), no glob * added return [string tolower $home] } } } elseif {[testConstraint reg]} { # Windows with registry extension loaded if {![catch { set sid [exec {*}[auto_execok powershell] -Command "(Get-LocalUser -Name '$user')\[0\].sid.Value"] set sid [string trim $sid] # Get path from the Windows registry set home [registry get "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\$sid" ProfileImagePath] set home [string trim [string tolower $home]] } result]} { if {$home ne ""} { # file join for \ -> / return [file join [string tolower $home]] } } } # Caller will need to use glob matching and hope user # name is in the home directory path return *[string tolower $user]* } proc createfile {file {string a}} { set f [open $file w] puts -nonewline $f $string close $f return $string } # # checkcontent -- # # Ensures that file "file" contains only the string "matchString" returns 0 # if the file does not exist, or has a different content # proc checkcontent {file matchString} { try { set f [open $file] set fileString [read $f] close $f } on error {} { return 0 } return [string match $matchString $fileString] } proc openup {path} { # Double check for inadvertent ~ -> home directory mapping if {[string match ~* $path]} { set file ./$path } testchmod 0o777 $path if {[file isdirectory $path]} { catch { foreach p [glob -directory $path *] { openup $p } } } } proc cleanup {args} { set wd [list .] foreach p [concat $wd $args] { set x "" catch { set x [glob -directory $p tf* td* ~*] } foreach file $x { # Double check for inadvertent ~ -> home directory mapping if {[string match ~* $file]} { set file ./$file } if { [catch {file delete -force -- $file}] && [testConstraint testchmod] } then { catch {openup $file} catch {file delete -force -- $file} } } } } proc contents {file} { set f [open $file] set r [read $f] close $f return $r } set root [lindex [file split [pwd]] 0] # A really long file name. # Length of long is 1216 chars, which should be greater than any static buffer # or allowable filename. set long "abcdefghihjllmnopqrstuvwxyz01234567890" append long $long append long $long append long $long append long $long append long $long test fCmd-1.1 {TclFileRenameCmd} -constraints {notRoot} -setup { cleanup } -body { createfile tf1 file rename tf1 tf2 glob tf* } -result {tf2} test fCmd-1.2 {TclFileRenameCmd when target is ~} -setup { cleanup createfile tf1 } -cleanup { file delete ./~ } -body { file rename tf1 ~ file isfile ~ } -result 1 test fCmd-1.3 {TclFileRenameCmd when target is ~user} -setup { cleanup createfile tf1 } -cleanup { file delete ./~$user } -body { file rename tf1 ~$user file isfile ~$user } -result 1 test fCmd-1.4 {TclFileRenameCmd when source is ~} -setup { cleanup createfile ./~ } -cleanup { file delete ./~ } -body { file rename ~ tf1 list [file exists ~] [file exists tf1] } -result {0 1} test fCmd-1.5 {TclFileRenameCmd when source is ~user} -setup { cleanup createfile ./~$user } -cleanup { file delete ./~$user } -body { file rename ~$user tf1 list [file exists ~$user] [file exists tf1] } -result {0 1} test fCmd-2.1 {TclFileCopyCmd} -constraints {notRoot} -setup { cleanup } -body { createfile tf1 file copy tf1 tf2 lsort [glob tf*] } -result {tf1 tf2} test fCmd-2.2 {TclFileCopyCmd when target is ~} -setup { cleanup createfile tf1 } -cleanup { file delete ./~ } -body { file copy tf1 ~ list [file exists tf1] [file exists ~] } -result {1 1} test fCmd-2.3 {TclFileCopyCmd when target is ~user} -setup { cleanup createfile tf1 } -cleanup { file delete ./~$user } -body { file copy tf1 ~$user list [file exists tf1] [file exists ~$user] } -result {1 1} test fCmd-2.4 {TclFileCopyCmd when source is ~} -setup { cleanup createfile ./~ } -cleanup { file delete ./~ } -body { file copy ~ tf1 list [file exists ~] [file exists tf1] } -result {1 1} test fCmd-2.5 {TclFileCopyCmd when source is ~user} -setup { cleanup createfile ./~$user } -cleanup { file delete ./~$user } -body { file copy ~$user tf1 list [file exists ~$user] [file exists tf1] } -result {1 1} test fCmd-3.1 {FileCopyRename: FileForceOption fails} -constraints {notRoot} -body { file rename -xyz } -returnCodes error -result {bad option "-xyz": must be -force or --} test fCmd-3.2 {FileCopyRename: not enough args} -constraints {notRoot} -body { file rename xyz } -returnCodes error -result {wrong # args: should be "file rename ?-option value ...? source ?source ...? target"} test fCmd-3.3 {FileCopyRename: Tcl_TranslateFileName fails} -constraints {notRoot} -body { file rename xyz ~_totally_bogus_user } -returnCodes error -result {error renaming "xyz": no such file or directory} test fCmd-3.4 {FileCopyRename: Tcl_TranslateFileName passes} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 ~ } -result {error copying "tf1": no such file or directory} test fCmd-3.5 {FileCopyRename: target doesn't exist: stat(target) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 tf3 } -result {error renaming: target "tf3" is not a directory} test fCmd-3.6 {FileCopyRename: target tf3 is not a dir: !S_ISDIR(target)} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf3 file rename tf1 tf2 tf3 } -result {error renaming: target "tf3" is not a directory} test fCmd-3.7 {FileCopyRename: target exists & is directory} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 createfile tf1 tf1 file rename tf1 td1 contents [file join td1 tf1] } -result {tf1} test fCmd-3.8 {FileCopyRename: too many arguments: argc - i > 2} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 tf3 } -result {error renaming: target "tf3" is not a directory} test fCmd-3.9 {FileCopyRename: too many arguments: argc - i > 2} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy -force -- tf1 tf2 tf3 } -result {error copying: target "tf3" is not a directory} test fCmd-3.10 {FileCopyRename: just 2 arguments} -constraints notRoot -setup { cleanup } -body { createfile tf1 tf1 file rename tf1 tf2 contents tf2 } -result {tf1} test fCmd-3.11 {FileCopyRename: just 2 arguments} -constraints notRoot -setup { cleanup } -body { createfile tf1 tf1 file rename -force -force -- tf1 tf2 contents tf2 } -result {tf1} test fCmd-3.12 {FileCopyRename: move each source: 1 source} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 tf1 file mkdir td1 file rename tf1 td1 contents [file join td1 tf1] } -result {tf1} test fCmd-3.13 {FileCopyRename: move each source: multiple sources} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 tf1 createfile tf2 tf2 createfile tf3 tf3 createfile tf4 tf4 file mkdir td1 file rename tf1 tf2 tf3 tf4 td1 list [contents [file join td1 tf1]] [contents [file join td1 tf2]] \ [contents [file join td1 tf3]] [contents [file join td1 tf4]] } -result {tf1 tf2 tf3 tf4} test fCmd-3.14 {FileCopyRename: FileBasename fails} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir td1 file rename ~_totally_bogus_user td1 } -result {error renaming "~_totally_bogus_user": no such file or directory} test fCmd-3.15 {FileCopyRename: source[0] == '\x00'} -setup { cleanup } -constraints {notRoot unixOrWin} -returnCodes error -body { file mkdir td1 file rename / td1 } -result {error renaming "/" to "td1": file exists} test fCmd-3.16 {FileCopyRename: break on first error} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 createfile tf2 createfile tf3 createfile tf4 file mkdir td1 createfile [file join td1 tf3] file rename tf1 tf2 tf3 tf4 td1 } -result [subst {error renaming "tf3" to "[file join td1 tf3]": file exists}] test fCmd-4.1 {TclFileMakeDirsCmd: make each dir: 1 dir} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 glob td* } -result {td1} test fCmd-4.2 {TclFileMakeDirsCmd: make each dir: multiple dirs} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 td2 td3 lsort [glob td*] } -result {td1 td2 td3} test fCmd-4.3 {TclFileMakeDirsCmd: stops on first error} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 catch {file mkdir td1 td2 tf1 td3 td4} glob td1 td2 tf1 td3 td4 } -result {td1 td2 tf1} test fCmd-4.4 {TclFileMakeDirsCmd: Tcl_TranslateFileName treats ~ as normal char} -setup { cleanup } -constraints {notRoot} -body { list [file isdir ~] [file mkdir ~] [file isdir ~] } -result {0 {} 1} test fCmd-4.4.1 {TclFileMakeDirsCmd: Tcl_TranslateFileName treats ~ as normal char} -setup { cleanup } -constraints {notRoot} -body { file mkdir ~_totally_bogus_user file isdir ~_totally_bogus_user } -result 1 test fCmd-4.5 {TclFileMakeDirsCmd: Tcl_SplitPath returns 0: *name == '\x00'} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir "" } -result {can't create directory "": no such file or directory} test fCmd-4.6 {TclFileMakeDirsCmd: one level deep} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 glob td1 } -result {td1} test fCmd-4.7 {TclFileMakeDirsCmd: multi levels deep} -setup { cleanup } -constraints {notRoot} -body { file mkdir [file join td1 td2 td3 td4] glob td1 [file join td1 td2] } -result "td1 [file join td1 td2]" test fCmd-4.8 {TclFileMakeDirsCmd: already exist: lstat(target) == 0} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 set x [file exists td1] file mkdir td1 list $x [file exists td1] } -result {1 1} test fCmd-4.9 {TclFileMakeDirsCmd: exists, not dir} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 file mkdir tf1 } -result [subst {can't create directory "[file join tf1]": file exists}] test fCmd-4.10 {TclFileMakeDirsCmd: exists, is dir} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 set x [file exists td1] file mkdir td1 list $x [file exists td1] } -result {1 1} test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} -setup { cleanup } -constraints {unix notRoot testchmod notWsl} -returnCodes error -body { file mkdir td1/td2/td3 testchmod 0 td1/td2 file mkdir td1/td2/td3/td4 } -cleanup { testchmod 0o755 td1/td2 cleanup } -result {can't create directory "td1/td2/td3": permission denied} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} -setup { cleanup } -constraints {notRoot} -body { set x [file exists td1] file mkdir td1 list $x [file exists td1] } -result {0 1} test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} -setup { cleanup file delete -force foo } -constraints {unix notRoot notWsl} -body { file mkdir foo file attr foo -perm 0o40000 file mkdir foo/tf1 } -returnCodes error -cleanup { file delete -force foo } -result {can't create directory "foo/tf1": permission denied} test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} -setup { cleanup } -constraints {notRoot} -body { file mkdir tf1 file exists tf1 } -result 1 test fCmd-5.1 {TclFileDeleteCmd: FileForceOption fails} -constraints {notRoot} -body { file delete -xyz } -returnCodes error -result {bad option "-xyz": must be -force or --} test fCmd-5.2 {TclFileDeleteCmd: accept 0 files (TIP 323)} -body { file delete -force -force } -result {} test fCmd-5.3 {TclFileDeleteCmd: 1 file} -constraints {notRoot} -setup { cleanup } -body { createfile tf1 createfile tf2 file mkdir td1 file delete tf2 glob tf* td* } -result {tf1 td1} test fCmd-5.4 {TclFileDeleteCmd: multiple files} -constraints notRoot -setup { cleanup } -body { createfile tf1 createfile tf2 file mkdir td1 set x [list [file exists tf1] [file exists tf2] [file exists td1]] file delete tf1 td1 tf2 lappend x [file exists tf1] [file exists tf2] [file exists tf3] } -cleanup {cleanup} -result {1 1 1 0 0 0} test fCmd-5.5 {TclFileDeleteCmd: stop at first error} -setup { cleanup } -constraints {notRoot unixOrWin notWine} -body { createfile tf1 createfile tf2 file mkdir td1 catch {file delete tf1 td1 $root tf2} list [file exists tf1] [file exists tf2] [file exists td1] } -cleanup {cleanup} -result {0 1 0} test fCmd-5.6 { TclFileDeleteCmd: Tcl_TranslateFileName treats ~user as normal char } -constraints {notRoot} -body { file delete ~_totally_bogus_user } -result {} test fCmd-5.7 { TclFileDeleteCmd: Tcl_TranslateFileName treats ~ as normal char } -constraints {notRoot} -body { createfile ~/tf1 } -returnCodes error -result {couldn't open "~/tf1": no such file or directory} test fCmd-5.8 {TclFileDeleteCmd: file doesn't exist: lstat(name) != 0} -setup { cleanup } -constraints {notRoot} -body { set x [file exists tf1] file delete tf1 list $x [file exists tf1] } -result {0 0} test fCmd-5.9 {TclFileDeleteCmd: is directory} -constraints {notRoot} -setup { cleanup } -body { file mkdir td1 file delete td1 file exists td1 } -result {0} test fCmd-5.10 {TclFileDeleteCmd: TclpRemoveDirectory fails} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir [file join td1 td2] file delete td1 } -result {error deleting "td1": directory not empty} test fCmd-5.11 {TclFileDeleteCmd: TclpRemoveDirectory with cwd inside} -setup { cleanup set dir [pwd] } -constraints {notRoot} -body { file mkdir [file join td1 td2] cd [file join td1 td2] set res [list [catch {file delete -force [file dirname [pwd]]} msg]] cd $dir lappend res [file exists td1] $msg } -cleanup { cd $dir } -result {0 0 {}} test fCmd-5.12 {TclFileDeleteCmd: TclpRemoveDirectory with bad perms} -setup { cleanup } -constraints {unix} -body { file mkdir [file join td1 td2] file attributes [file join td1 td2] -permissions u+rwx set res [list [catch {file delete -force td1} msg]] lappend res [file exists td1] $msg } -result {0 0 {}} test fCmd-6.1 {CopyRenameOneFile: bad source} {notRoot emptyTest} { # can't test this, because it's caught by FileCopyRename } {} test fCmd-6.2 {CopyRenameOneFile: bad target} {notRoot emptyTest} { # can't test this, because it's caught by FileCopyRename } {} test fCmd-6.3 {CopyRenameOneFile: lstat(source) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 } -result {error renaming "tf1": no such file or directory} test fCmd-6.4 {CopyRenameOneFile: lstat(source) == 0} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 file rename tf1 tf2 glob tf* } -result {tf2} test fCmd-6.5 {CopyRenameOneFile: lstat(target) != 0} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 file rename tf1 tf2 glob tf* } -result {tf2} test fCmd-6.6 {CopyRenameOneFile: errno != ENOENT} -setup { cleanup } -constraints {unix notRoot testchmod notWsl} -body { file mkdir td1 testchmod 0 td1 createfile tf1 file rename tf1 td1 } -returnCodes error -cleanup { testchmod 0o755 td1 } -result {error renaming "tf1" to "td1/tf1": permission denied} test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} -setup { cleanup } -constraints {unix notRoot} -body { createfile tf1 file rename tf1 tf2 glob tf* } -result {tf2} test fCmd-6.10 {CopyRenameOneFile: lstat(target) == 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 createfile tf2 file rename tf1 tf2 } -result {error renaming "tf1" to "tf2": file exists} test fCmd-6.11 {CopyRenameOneFile: force == 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 createfile tf2 file rename tf1 tf2 } -result {error renaming "tf1" to "tf2": file exists} test fCmd-6.12 {CopyRenameOneFile: force != 0} -setup { cleanup } -constraints {notRoot} -body { createfile tf1 createfile tf2 file rename -force tf1 tf2 glob tf* } -result {tf2} test fCmd-6.13 {CopyRenameOneFile: source is dir, target is file} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir td1 file mkdir td2 createfile [file join td2 td1] file rename -force td1 td2 } -result [subst {can't overwrite file "[file join td2 td1]" with directory "td1"}] test fCmd-6.14 {CopyRenameOneFile: source is file, target is dir} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 file mkdir [file join td1 tf1] file rename -force tf1 td1 } -result [subst {can't overwrite directory "[file join td1 tf1]" with file "tf1"}] test fCmd-6.15 {CopyRenameOneFile: TclpRenameFile succeeds} -setup { cleanup } -constraints {notRoot notNetworkFilesystem} -body { file mkdir [file join td1 td2] file mkdir td2 createfile [file join td2 tf1] file rename -force td2 td1 file exists [file join td1 td2 tf1] } -result 1 test fCmd-6.16 {CopyRenameOneFile: TclpCopyRenameOneFile fails} -setup { cleanup } -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 file rename -force td2 td1 } -returnCodes error -match glob -result \ [subst {error renaming "td2" to "[file join td1 td2]": file *}] test fCmd-6.17 {CopyRenameOneFile: errno == EINVAL} -setup { cleanup } -constraints {notRoot notWine} -returnCodes error -body { file rename -force $root tf1 } -result [subst {error renaming "$root" to "tf1": trying to rename a volume or move a directory into itself}] test fCmd-6.18 {CopyRenameOneFile: errno != EXDEV} -setup { cleanup } -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] createfile [file join td1 td2 tf1] file mkdir td2 file rename -force td2 td1 } -returnCodes error -match glob -result \ [subst {error renaming "td2" to "[file join td1 td2]": file *}] test fCmd-6.19 {CopyRenameOneFile: errno == EXDEV} -setup { cleanup $tmpspace } -constraints {unix notRoot} -body { createfile tf1 file rename tf1 $tmpspace glob -nocomplain tf* [file join $tmpspace tf1] } -result [file join $tmpspace tf1] test fCmd-6.20 {CopyRenameOneFile: errno == EXDEV} -constraints {win} -setup { catch {file delete -force c:/tcl8975@ d:/tcl8975@} } -body { file mkdir c:/tcl8975@ if {[catch {file rename c:/tcl8975@ d:/}]} { return d:/tcl8975@ } glob c:/tcl8975@ d:/tcl8975@ } -cleanup { file delete -force c:/tcl8975@ catch {file delete -force d:/tcl8975@} } -result {d:/tcl8975@} test fCmd-6.21 {CopyRenameOneFile: copy/rename: S_ISDIR(source)} -setup { cleanup $tmpspace } -constraints {unix notRoot} -body { file mkdir td1 file rename td1 $tmpspace glob -nocomplain td* [file join $tmpspace td*] } -result [file join $tmpspace td1] test fCmd-6.22 {CopyRenameOneFile: copy/rename: !S_ISDIR(source)} -setup { cleanup $tmpspace } -constraints {unix notRoot} -body { createfile tf1 file rename tf1 $tmpspace glob -nocomplain tf* [file join $tmpspace tf*] } -result [file join $tmpspace tf1] test fCmd-6.23 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {xdev notRoot notWsl} -body { file mkdir td1/td2/td3 file attributes td1 -permissions 0 file rename td1 $tmpspace } -returnCodes error -cleanup { file attributes td1 -permissions 0o755 cleanup } -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: permission denied$} test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir [file home]/td1/td2 set td1name [file join [file dirname [file home]] [file tail [file home]] td1] file attributes $td1name -permissions 0 file copy [file home]/td1 td1 } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force [file home]/td1 } -result "error copying \"[file home]/td1\": permission denied" test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir td2 file mkdir [file home]/td1 set td1name [file join [file dirname [file home]] [file tail [file home]] td1] file attributes $td1name -permissions 0 file copy td2 [file home]/td1 } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force [file home]/td1 } -result "error copying \"td2\" to \"[file home]/td1/td2\": permission denied" test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup { cleanup } -constraints {unix notRoot} -body { file mkdir [file home]/td1/td2 set td2name [file join [file dirname [file home]] [file tail [file home]] td1 td2] file attributes $td2name -permissions 0 file copy [file home]/td1 td1 } -returnCodes error -cleanup { file attributes $td2name -permissions 0o755 file delete -force [file home]/td1 } -result "error copying \"[file home]/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": permission denied" test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -returnCodes error -body { file mkdir td1/td2/td3 file mkdir [file join $tmpspace td1] createfile [file join $tmpspace td1 tf1] file rename -force td1 $tmpspace } -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": file exists} test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev notWsl} -body { file mkdir td1/td2/td3 file attributes td1/td2/td3 -permissions 0 file rename td1 $tmpspace } -returnCodes error -cleanup { file attributes td1/td2/td3 -permissions 0o755 cleanup $tmpspace } -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": permission denied} test fCmd-6.29 {CopyRenameOneFile: TclpCopyDirectory passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { file mkdir td1/td2/td3 file rename td1 $tmpspace glob td* [file join $tmpspace td1 t*] } -result [file join $tmpspace td1 td2] test fCmd-6.30 {CopyRenameOneFile: TclpRemoveDirectory failed} -setup { cleanup $tmpspace } -constraints {unix notRoot notWsl} -body { file mkdir foo/bar file attr foo -perm 0o40555 file rename foo/bar $tmpspace } -returnCodes error -cleanup { catch {file delete [file join $tmpspace bar]} catch {file attr foo -perm 0o40777} catch {file delete -force foo} } -match glob -result {*: permission denied} test fCmd-6.31 {CopyRenameOneFile: TclpDeleteFile passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { file mkdir [file join $tmpspace td1] createfile [file join $tmpspace td1 tf1] file rename [file join $tmpspace td1 tf1] tf1 list [file exists [file join $tmpspace td1 tf1]] [file exists tf1] } -result {0 1} test fCmd-6.32 {CopyRenameOneFile: copy} -constraints {notRoot} -setup { cleanup } -returnCodes error -body { file copy tf1 tf2 } -result {error copying "tf1": no such file or directory} test fCmd-7.1 {FileForceOption: none} -constraints {notRoot} -setup { cleanup } -returnCodes error -body { file mkdir [file join tf1 tf2] file delete tf1 } -result {error deleting "tf1": directory not empty} test fCmd-7.2 {FileForceOption: -force} -constraints {notRoot} -setup { cleanup } -body { file mkdir [file join tf1 tf2] file delete -force tf1 } -result {} test fCmd-7.3 {FileForceOption: --} -constraints {notRoot} -body { createfile -tf1 file delete -- -tf1 } -result {} test fCmd-7.4 {FileForceOption: bad option} -constraints {notRoot} -setup { createfile -tf1 } -body { file delete -tf1 } -returnCodes error -cleanup { file delete -- -tf1 } -result {bad option "-tf1": must be -force or --} test fCmd-7.5 {FileForceOption: multiple times through loop} -setup { cleanup } -constraints {notRoot} -body { createfile -- createfile -force file delete -force -force -- -- -force glob -- -- -force } -result {} test fCmd-8.1 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ -constraints {unix notRoot knownBug tildeexpansion} -body { # Labeled knownBug because it is dangerous [Bug: 3881] file mkdir td1 file attr td1 -perm 0o40000 file rename ~$user td1 } -returnCodes error -cleanup { file delete -force td1 } -result "error renaming \"~$user\" to \"td1/[file tail ~$user]\": permission denied" test fCmd-8.2 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ -constraints {unix notRoot} -body { string equal [file tail ~$user] ~$user } -result 1 test fCmd-8.3 {file copy and path translation: ensure correct error} -body { file copy [file home] [file join this file doesnt exist] } -returnCodes error -result [subst \ {error copying "[file home]" to "[file join this file doesnt exist]": no such file or directory}] test fCmd-9.1 {file rename: comprehensive: EACCES} -setup { cleanup } -constraints {unix notRoot notWsl} -body { file mkdir td1 file mkdir td2 file attr td2 -perm 0o40000 file rename td1 td2/ } -returnCodes error -cleanup { file delete -force td2 file delete -force td1 } -result {error renaming "td1" to "td2/td1": permission denied} test fCmd-9.2 {file rename: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 } -result {error renaming "tf1": no such file or directory} test fCmd-9.3 {file rename: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { createfile tf1 createfile tf2 testchmod 0o444 tf2 file rename tf1 tf3 file rename tf2 tf4 list [lsort [glob tf*]] [file writable tf3] [file writable tf4] } -result {{tf3 tf4} 1 0} test fCmd-9.4 {file rename: comprehensive: dir to new name} -setup { cleanup } -constraints {unix notRoot testchmod notDarwin9 notWsl} -body { file mkdir td1 td2 testchmod 0o555 td2 file rename td1 td3 file rename td2 td4 list [lsort [glob td*]] [file writable td3] [file writable td4] } -cleanup { cleanup } -result {{td3 td4} 1 0} test fCmd-9.5 {file rename: comprehensive: file to self} -setup { cleanup } -constraints {notRoot testchmod notWine} -body { createfile tf1 tf1 createfile tf2 tf2 testchmod 0o444 tf2 file rename -force tf1 tf1 file rename -force tf2 tf2 list [contents tf1] [contents tf2] [file writable tf1] [file writable tf2] } -result {tf1 tf2 1 0} test fCmd-9.6 {file rename: comprehensive: dir to self} -setup { cleanup } -constraints {unix notRoot testchmod notWsl} -body { file mkdir td1 file mkdir td2 testchmod 0o555 td2 file rename -force td1 . file rename -force td2 . list [lsort [glob td*]] [file writable td1] [file writable td2] } -result {{td1 td2} 1 0} test fCmd-9.7 {file rename: comprehensive: file to existing file} -setup { cleanup } -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 createfile tfs2 createfile tfs3 createfile tfs4 createfile tfd1 createfile tfd2 createfile tfd3 createfile tfd4 testchmod 0o444 tfs3 testchmod 0o444 tfs4 testchmod 0o444 tfd2 testchmod 0o444 tfd4 set msg [list [catch {file rename tf1 tf2} msg] $msg] file rename -force tfs1 tfd1 file rename -force tfs2 tfd2 file rename -force tfs3 tfd3 file rename -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] } -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4} {1 {error renaming "tf1" to "tf2": file exists}} 1 1 0 0} test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod notNetworkFilesystem} -body { # Under Unix you can rename a read-only directory, but you can't move it # into another directory. file mkdir td1 file mkdir [file join td2 td1] file mkdir tds1 file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] if {![testConstraint unix]} { testchmod 0o555 tds3 testchmod 0o555 tds4 } testchmod 0o555 [file join tdd2 tds2] testchmod 0o555 [file join tdd4 tds4] set msg [list [catch {file rename td1 td2} msg] $msg] file rename -force tds1 tdd1 file rename -force tds2 tdd2 file rename -force tds3 tdd3 file rename -force tds4 tdd4 if {[testConstraint unix]} { set w3 0 set w4 0 } else { set w3 [file writable [file join tdd3 tds3]] set w4 [file writable [file join tdd4 tds4]] } list [lsort [glob td*]] $msg [file writable [file join tdd1 tds1]] \ [file writable [file join tdd2 tds2]] $w3 $w4 } -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": file exists}} 1 1 0 0}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup { cleanup } -constraints {notRoot testchmod notWine} -body { file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg] set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg] set w2 0 list [lsort [glob td*]] $a1 $a2 [file writable tds1] $w2 } -match glob -result \ [subst {{tdd1 tdd2 tds1 tds2} {1 {error renaming "tds1" to "[file join tdd1 tds1]": file *}} {1 {error renaming "tds2" to "[file join tdd2 tds2]": file *}} 1 0}] test fCmd-9.10 {file rename: comprehensive: file to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { createfile tf1 createfile tf2 file mkdir td1 testchmod 0o444 tf2 file rename tf1 [file join td1 tf3] file rename tf2 [file join td1 tf4] list [glob tf*] [lsort [glob -directory td1 t*]] \ [file writable [file join td1 tf3]] [file writable [file join td1 tf4]] } -result [subst {{} {[file join td1 tf3] [file join td1 tf4]} 1 0}] test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { file mkdir td1 file mkdir td2 file mkdir td3 file rename td1 [file join td3 td3] file rename td2 [file join td3 td4] set w4 0 list [lsort [glob td*]] [lsort [glob -directory td3 t*]] \ [file writable [file join td3 td3]] $w4 } -result [subst {td3 {[file join td3 td3] [file join td3 td4]} 1 0}] test fCmd-9.12 {file rename: comprehensive: target exists} -setup { cleanup } -constraints {notRoot testchmod notNetworkFilesystem} -body { file mkdir [file join td1 td2] [file join td2 td1] testchmod 0o555 [file join td2 td1] file mkdir [file join td3 td4] [file join td4 td3] file rename -force td3 td4 list [file exists td3] [file exists [file join td4 td3 td4]] \ [catch {file rename td1 td2} msg] $msg } -cleanup { testchmod 0o755 [file join td2 td1] } -result [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file exists}}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.13 {file rename: comprehensive: can't overwrite target} -setup { cleanup } -constraints {notRoot notWine} -body { file mkdir [file join td1 td2] [file join td2 td1 td4] file rename -force td1 td2 } -returnCodes error -match glob -result \ [subst {error renaming "td1" to "[file join td2 td1]": file *}] test fCmd-9.14 {file rename: comprehensive: dir into self} -setup { cleanup } -constraints {notRoot notWine} -body { file mkdir td1 list [glob td*] [list [catch {file rename td1 td1} msg] $msg] } -result [subst {td1 {1 {error renaming "td1" to "[file join td1 td1]": trying to rename a volume or move a directory into itself}}}] test fCmd-9.14.1 {file rename: comprehensive: dir into self} -setup { cleanup } -constraints {notRoot} -body { file mkdir td1 file rename td1 td1x file rename td1x td1 set msg "ok" } -result {ok} test fCmd-9.14.2 {file rename: comprehensive: dir into self} -setup { cleanup set dir [pwd] } -constraints {nonPortable notRoot} -body { file mkdir td1 cd td1 file rename [file join .. td1] [file join .. td1x] } -returnCodes error -cleanup { cd $dir } -result [subst {error renaming "[file join .. td1]" to "[file join .. td1x]": permission denied}] test fCmd-9.14.3 {file rename: comprehensive: dir into self} -setup { cleanup set dir [pwd] } -constraints {notRoot} -body { file mkdir td1 cd td1 file rename [file join .. td1] [file join .. td1 foo] } -returnCodes error -cleanup { cd $dir } -result [subst {error renaming "[file join .. td1]" to "[file join .. td1 foo]": trying to rename a volume or move a directory into itself}] test fCmd-9.15 {file rename: comprehensive: source and target incompatible} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir td1 createfile tf1 file rename -force td1 tf1 } -cleanup { cleanup } -result {can't overwrite file "tf1" with directory "td1"} test fCmd-9.16 {file rename: comprehensive: source and target incompatible} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir td1/tf1 createfile tf1 file rename -force tf1 td1 } -result [subst {can't overwrite directory "[file join td1 tf1]" with file "tf1"}] test fCmd-10.1 {file copy: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 tf2 } -result {error copying "tf1": no such file or directory} test fCmd-10.2 {file copy: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { createfile tf1 tf1 createfile tf2 tf2 testchmod 0o444 tf2 file copy tf1 tf3 file copy tf2 tf4 list [lsort [glob tf*]] [contents tf3] [contents tf4] [file writable tf3] [file writable tf4] } -result {{tf1 tf2 tf3 tf4} tf1 tf2 1 0} test fCmd-10.3 {file copy: comprehensive: dir to new name} -setup { cleanup } -constraints {unix notRoot testchmod notWsl} -body { file mkdir [file join td1 tdx] file mkdir [file join td2 tdy] testchmod 0o555 td2 file copy td1 td3 file copy td2 td4 list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4] } -cleanup { testchmod 0o755 td2 testchmod 0o755 td4 } -result [list {td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 0] test fCmd-10.3.1 {file copy: comprehensive: dir to new name} -setup { cleanup } -constraints {win notRoot testchmod} -body { # On Windows with ACLs, copying a directory is defined like this file mkdir [file join td1 tdx] file mkdir [file join td2 tdy] testchmod 0o555 td2 testchmod 0o555 td2/tdy; # Above line removes inherited perms. So restore. file copy td1 td3 file copy td2 td4 list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4] } -cleanup { testchmod 0o755 td2 testchmod 0o755 td4 } -result [list {td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 1] test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup { cleanup } -constraints {notRoot testchmod notWine} -body { createfile tf1 createfile tf2 createfile tfs1 createfile tfs2 createfile tfs3 createfile tfs4 createfile tfd1 createfile tfd2 createfile tfd3 createfile tfd4 if {$::tcl_platform(platform) eq "windows"} { # On Windows testchmode will attach an ACL which file copy cannot handle # so use good old attributes which file copy does understand file attribute tfs3 -readonly 1 file attribute tfs4 -readonly 1 file attribute tfd2 -readonly 1 file attribute tfd4 -readonly 1 } else { testchmod 0o444 tfs3 testchmod 0o444 tfs4 testchmod 0o444 tfd2 testchmod 0o444 tfd4 } set msg [list [catch {file copy tf1 tf2} msg] $msg] file copy -force tfs1 tfd1 file copy -force tfs2 tfd2 file copy -force tfs3 tfd3 file copy -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] } -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4 tfs1 tfs2 tfs3 tfs4} {1 {error copying "tf1" to "tf2": file exists}} 1 1 0 0} test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod} -body { file mkdir td1 file mkdir [file join td2 td1] file mkdir tds1 file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] testchmod 0o555 tds3 testchmod 0o555 tds4 testchmod 0o555 [file join tdd2 tds2] testchmod 0o555 [file join tdd4 tds4] set a1 [list [catch {file copy td1 td2} msg] $msg] set a2 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a3 [catch {file copy -force tds2 tdd2}] set a4 [catch {file copy -force tds3 tdd3}] set a5 [catch {file copy -force tds4 tdd4}] list [lsort [glob td*]] $a1 $a2 $a3 $a4 $a5 } -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file exists}} 1 1 1}] test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { cleanup } -constraints {notRoot unixOrWin testchmod notWsl} -body { file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] testchmod 0o555 tds2 set a1 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a2 [list [catch {file copy -force tds2 tdd2} msg] $msg] list [lsort [glob td*]] $a1 $a2 [file writable tds1] [file writable tds2] } -result [subst {{tdd1 tdd2 tds1 tds2} {1 {error copying "tds1" to "[file join tdd1 tds1]": file exists}} {1 {error copying "tds2" to "[file join tdd2 tds2]": file exists}} 1 0}] test fCmd-10.7 {file rename: comprehensive: file to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { createfile tf1 createfile tf2 file mkdir td1 testchmod 0o444 tf2 file copy tf1 [file join td1 tf3] file copy tf2 [file join td1 tf4] list [lsort [glob tf*]] [lsort [glob -directory td1 t*]] \ [file writable [file join td1 tf3]] [file writable [file join td1 tf4]] } -result [subst {{tf1 tf2} {[file join td1 tf3] [file join td1 tf4]} 1 0}] test fCmd-10.8 {file rename: comprehensive: dir to new name and dir} -setup { cleanup } -constraints {unix notRoot testchmod notWsl} -body { file mkdir td1 file mkdir td2 file mkdir td3 testchmod 0o555 td2 file copy td1 [file join td3 td3] file copy td2 [file join td3 td4] list [lsort [glob td*]] [lsort [glob -directory td3 t*]] \ [file writable [file join td3 td3]] [file writable [file join td3 td4]] } -result [subst {{td1 td2 td3} {[file join td3 td3] [file join td3 td4]} 1 0}] test fCmd-10.8.1 {file rename: comprehensive: dir to new name and dir} -setup { cleanup } -constraints {win notRoot testchmod} -body { # On Windows with ACLs, copying a directory is defined like this file mkdir td1 file mkdir td2 file mkdir td3 testchmod 0o555 td2 file copy td1 [file join td3 td3] file copy td2 [file join td3 td4] list [lsort [glob td*]] [lsort [glob -directory td3 t*]] \ [file writable [file join td3 td3]] [file writable [file join td3 td4]] } -result [subst {{td1 td2 td3} {[file join td3 td3] [file join td3 td4]} 1 1}] test fCmd-10.9 {file copy: comprehensive: source and target incompatible} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir td1 createfile tf1 file copy -force td1 tf1 } -result {can't overwrite file "tf1" with directory "td1"} test fCmd-10.10 {file copy: comprehensive: source and target incompatible} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir [file join td1 tf1] createfile tf1 file copy -force tf1 td1 } -result [subst {can't overwrite directory "[file join td1 tf1]" with file "tf1"}] test fCmd-10.11 {file copy: copy to empty file name} -setup { cleanup } -returnCodes error -body { createfile tf1 file copy tf1 "" } -result {error copying "tf1" to "": no such file or directory} test fCmd-10.12 {file rename: rename to empty file name} -setup { cleanup } -returnCodes error -body { createfile tf1 file rename tf1 "" } -result {error renaming "tf1" to "": no such file or directory} cleanup # old tests test fCmd-11.1 {TclFileRenameCmd: -- option} -constraints notRoot -setup { catch {file delete -force -- -tfa1} } -body { set s [createfile -tfa1] file rename -- -tfa1 tfa2 list [checkcontent tfa2 $s] [file exists -tfa1] } -cleanup { file delete tfa2 } -result {1 0} test fCmd-11.2 {TclFileRenameCmd: bad option} -constraints notRoot -setup { catch {file delete -force -- tfa1} } -body { set s [createfile tfa1] list [catch {file rename -x tfa1 tfa2}] \ [checkcontent tfa1 $s] [file exists tfa2] } -cleanup { file delete tfa1 } -result {1 1 0} test fCmd-11.3 {TclFileRenameCmd: bad \# args} -returnCodes error -body { file rename -- } -match glob -result * test fCmd-11.4 {TclFileRenameCmd: target filename translation failing} -setup { set temp $::env(HOME) } -constraints notRoot -body { global env unset env(HOME) catch { file rename tfa ~/foobar } } -cleanup { set ::env(HOME) $temp } -result 1 test fCmd-11.5 {TclFileRenameCmd: > 1 source & target is not a dir} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {notRoot} -body { createfile tfa1 createfile tfa2 createfile tfa3 catch {file rename tfa1 tfa2 tfa3} } -cleanup { file delete tfa1 tfa2 tfa3 } -result 1 test fCmd-11.6 {TclFileRenameCmd: : single file into directory} -setup { catch {file delete -force -- tfa1 tfad} } -constraints {notRoot} -body { set s [createfile tfa1] file mkdir tfad file rename tfa1 tfad list [checkcontent tfad/tfa1 $s] [file exists tfa1] } -cleanup { file delete -force tfad } -result {1 0} test fCmd-11.7 {TclFileRenameCmd: : multiple files into directory} -setup { catch {file delete -force -- tfa1 tfa2 tfad} } -constraints {notRoot} -body { set s1 [createfile tfa1] set s2 [createfile tfa2] file mkdir tfad file rename tfa1 tfa2 tfad list [checkcontent tfad/tfa1 $s1] [checkcontent tfad/tfa2 $s2] \ [file exists tfa1] [file exists tfa2] } -cleanup { file delete -force tfad } -result {1 1 0 0} test fCmd-11.8 {TclFileRenameCmd: error renaming file to directory} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s [createfile tfa] file mkdir tfad file mkdir tfad/tfa list [catch {file rename tfa tfad}] [checkcontent tfa $s] [file isdir tfad] } -cleanup { file delete -force tfa tfad } -result {1 1 1} # # Coverage tests for renamefile() ; # test fCmd-12.1 {renamefile: source filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot} -body { global env unset env(HOME) catch {file rename ~/tfa1 tfa2} } -cleanup { set ::env(HOME) $temp } -result 1 test fCmd-12.2 {renamefile: src filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot} -body { global env unset env(HOME) set s [createfile tfa1] file mkdir tfad catch {file rename tfa1 ~/tfa2 tfad} } -cleanup { set ::env(HOME) $temp file delete -force tfad } -result 1 test fCmd-12.3 {renamefile: stat failing on source} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { list [catch {file rename tfa1 tfa2}] [file exists tfa1] [file exists tfa2] } -result {1 0 0} test fCmd-12.4 {renamefile: error renaming file to directory} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s1 [createfile tfa] file mkdir tfad file mkdir tfad/tfa list [catch {file rename tfa tfad}] [checkcontent tfa $s1] \ [file isdir tfad/tfa] } -cleanup { file delete -force tfa tfad } -result {1 1 1} test fCmd-12.5 {renamefile: error renaming directory to file} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa file mkdir tfad set s [createfile tfad/tfa] list [catch {file rename tfa tfad}] [checkcontent tfad/tfa $s] \ [file isdir tfad] [file isdir tfa] } -cleanup { file delete -force tfa tfad } -result {1 1 1 1} test fCmd-12.6 {renamefile: TclRenameFile succeeding} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { set s [createfile tfa1] file rename tfa1 tfa2 list [checkcontent tfa2 $s] [file exists tfa1] } -cleanup { file delete tfa2 } -result {1 0} test fCmd-12.7 {renamefile: renaming directory into offspring} -setup { catch {file delete -force -- tfad} } -constraints {notRoot} -body { file mkdir tfad file mkdir tfad/dir catch {file rename tfad tfad/dir} } -cleanup { file delete -force tfad } -result 1 test fCmd-12.8 {renamefile: generic error} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot notWsl} -body { file mkdir tfa file mkdir tfa/dir file attributes tfa -permissions 0o555 catch {file rename tfa/dir tfa2} } -cleanup { catch {file attributes tfa -permissions 0o777} file delete -force tfa } -result 1 test fCmd-12.9 {renamefile: moving a file across volumes} -setup { cleanup $tmpspace } -constraints {unix notRoot} -body { set s [createfile tfa] file rename tfa $tmpspace list [checkcontent [file join $tmpspace tfa] $s] [file exists tfa] } -cleanup { cleanup $tmpspace } -result {1 0} test fCmd-12.10 {renamefile: moving a directory across volumes} -setup { cleanup $tmpspace } -constraints {xdev notRoot} -body { file mkdir tfad set s [createfile tfad/a] file rename tfad $tmpspace list [checkcontent [file join $tmpspace tfad a] $s] [file exists tfad] } -cleanup { cleanup $tmpspace } -result {1 0} # # Coverage tests for TclCopyFilesCmd() # test fCmd-13.1 {TclCopyFilesCmd: -force option} -constraints notRoot -setup { catch {file delete -force -- tfa1} } -body { set s [createfile tfa1] file copy -force tfa1 tfa2 list [checkcontent tfa2 $s] [checkcontent tfa1 $s] } -cleanup { file delete tfa1 tfa2 } -result {1 1} test fCmd-13.2 {TclCopyFilesCmd: -- option} -constraints {notRoot} -setup { catch {file delete -force -- tfa1} } -body { set s [createfile -tfa1] file copy -- -tfa1 tfa2 list [checkcontent tfa2 $s] [checkcontent -tfa1 $s] } -cleanup { file delete -- -tfa1 tfa2 } -result {1 1} test fCmd-13.3 {TclCopyFilesCmd: bad option} -constraints {notRoot} -setup { catch {file delete -force -- tfa1} } -body { set s [createfile tfa1] list [catch {file copy -x tfa1 tfa2}] \ [checkcontent tfa1 $s] [file exists tfa2] } -cleanup { file delete tfa1 } -result {1 1 0} test fCmd-13.4 {TclCopyFilesCmd: bad \# args} -constraints {notRoot} -body { file copy -- } -returnCodes error -match glob -result * test fCmd-13.5 {TclCopyFilesCmd: target filename translation failing} -setup { set temp $::env(HOME) } -body { global env unset env(HOME) catch { file copy tfa ~/foobar } } -cleanup { set ::env(HOME) $temp } -result 1 test fCmd-13.6 {TclCopyFilesCmd: > 1 source & target is not a dir} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {notRoot} -body { createfile tfa1 createfile tfa2 createfile tfa3 catch {file copy tfa1 tfa2 tfa3} } -cleanup { file delete tfa1 tfa2 tfa3 } -result 1 test fCmd-13.7 {TclCopyFilesCmd: single file into directory} -setup { catch {file delete -force -- tfa1 tfad} } -constraints {notRoot} -body { set s [createfile tfa1] file mkdir tfad file copy tfa1 tfad list [checkcontent tfad/tfa1 $s] [checkcontent tfa1 $s] } -cleanup { file delete -force tfad tfa1 } -result {1 1} test fCmd-13.8 {TclCopyFilesCmd: multiple files into directory} -setup { catch {file delete -force -- tfa1 tfa2 tfad} } -constraints {notRoot} -body { set s1 [createfile tfa1] set s2 [createfile tfa2] file mkdir tfad file copy tfa1 tfa2 tfad list [checkcontent tfad/tfa1 $s1] [checkcontent tfad/tfa2 $s2] \ [checkcontent tfa1 $s1] [checkcontent tfa2 $s2] } -cleanup { file delete -force tfad tfa1 tfa2 } -result {1 1 1 1} test fCmd-13.9 {TclCopyFilesCmd: error copying file to directory} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s [createfile tfa] file mkdir tfad file mkdir tfad/tfa list [catch {file copy tfa tfad}] [checkcontent tfa $s] \ [file isdir tfad/tfa] [file isdir tfad] } -cleanup { file delete -force tfa tfad } -result {1 1 1 1} # # Coverage tests for copyfile() # test fCmd-14.1 {copyfile: source filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot} -body { global env unset env(HOME) catch {file copy ~/tfa1 tfa2} } -cleanup { set ::env(HOME) $temp } -result 1 test fCmd-14.2 {copyfile: dst filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot} -body { global env unset env(HOME) set s [createfile tfa1] file mkdir tfad list [catch {file copy tfa1 ~/tfa2 tfad}] [checkcontent tfad/tfa1 $s] } -cleanup { set ::env(HOME) $temp file delete -force tfa1 tfad } -result {1 1} test fCmd-14.3 {copyfile: stat failing on source} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints notRoot -body { list [catch {file copy tfa1 tfa2}] [file exists tfa1] [file exists tfa2] } -result {1 0 0} test fCmd-14.4 {copyfile: error copying file to directory} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s1 [createfile tfa] file mkdir tfad file mkdir tfad/tfa list [catch {file copy tfa tfad}] [checkcontent tfa $s1] \ [file isdir tfad] [file isdir tfad/tfa] } -cleanup { file delete -force tfa tfad } -result {1 1 1 1} test fCmd-14.5 {copyfile: error copying directory to file} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa file mkdir tfad set s [createfile tfad/tfa] list [catch {file copy tfa tfad}] [checkcontent tfad/tfa $s] \ [file isdir tfad] [file isdir tfa] } -cleanup { file delete -force tfa tfad } -result {1 1 1 1} test fCmd-14.6 {copyfile: copy file succeeding} -constraints notRoot -setup { catch {file delete -force -- tfa tfa2} } -body { set s [createfile tfa] file copy tfa tfa2 list [checkcontent tfa $s] [checkcontent tfa2 $s] } -cleanup { file delete tfa tfa2 } -result {1 1} test fCmd-14.7 {copyfile: copy directory succeeding} -setup { catch {file delete -force -- tfa tfa2} } -constraints {notRoot} -body { file mkdir tfa set s [createfile tfa/file] file copy tfa tfa2 list [checkcontent tfa/file $s] [checkcontent tfa2/file $s] } -cleanup { file delete -force tfa tfa2 } -result {1 1} test fCmd-14.8 {copyfile: copy directory failing} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot notWsl} -body { file mkdir tfa/dir/a/b/c file attributes tfa/dir -permissions 0 catch {file copy tfa tfa2} } -cleanup { file attributes tfa/dir -permissions 0o777 file delete -force tfa tfa2 } -result 1 # # Coverage tests for TclMkdirCmd() # # ~ is no longer a special char. Need a test case where translation fails. test fCmd-15.1 {TclMakeDirsCmd: target filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot TODO} -body { global env unset env(HOME) catch {file mkdir ~/tfa} } -cleanup { set ::env(HOME) $temp } -result 1 # # Can Tcl_SplitPath return argc == 0? If so them we need a test for that code. # test fCmd-15.2 {TclMakeDirsCmd - one directory} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { file mkdir tfa file isdirectory tfa } -cleanup { file delete tfa } -result 1 test fCmd-15.3 {TclMakeDirsCmd: - two directories} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { file mkdir tfa1 tfa2 list [file isdirectory tfa1] [file isdirectory tfa2] } -cleanup { file delete tfa1 tfa2 } -result {1 1} test fCmd-15.4 {TclMakeDirsCmd - stat failing} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot} -body { file mkdir tfa createfile tfa/file file attributes tfa -permissions 0 catch {file mkdir tfa/file} } -cleanup { file attributes tfa -permissions 0o777 file delete -force tfa } -result 1 test fCmd-15.5 {TclMakeDirsCmd: - making a directory several levels deep} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { file mkdir tfa/a/b/c file isdir tfa/a/b/c } -cleanup { file delete -force tfa } -result 1 test fCmd-15.6 {TclMakeDirsCmd: - trying to overwrite a file} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { set s [createfile tfa] list [catch {file mkdir tfa}] [file isdir tfa] [file exists tfa] \ [checkcontent tfa $s] } -cleanup { file delete tfa } -result {1 0 1 1} test fCmd-15.7 {TclMakeDirsCmd - making several directories} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { file mkdir tfa1 tfa2/a/b/c list [file isdir tfa1] [file isdir tfa2/a/b/c] } -cleanup { file delete -force tfa1 tfa2 } -result {1 1} test fCmd-15.8 {TclFileMakeDirsCmd: trying to create an existing dir} -body { file mkdir tfa file mkdir tfa file isdir tfa } -constraints {notRoot} -cleanup { file delete tfa } -result 1 # Coverage tests for TclDeleteFilesCommand() test fCmd-16.1 {test the -- argument} -constraints {notRoot} -setup { catch {file delete -force -- tfa} } -body { createfile tfa file delete -- tfa file exists tfa } -result 0 test fCmd-16.2 {test the -force and -- arguments} -constraints notRoot -setup { catch {file delete -force -- tfa} } -body { createfile tfa file delete -force -- tfa file exists tfa } -result 0 test fCmd-16.3 {test bad option} -constraints {notRoot} -setup { catch {file delete -force -- tfa} } -body { createfile tfa catch {file delete -dog tfa} } -cleanup { file delete tfa } -result 1 test fCmd-16.4 {accept zero files (TIP 323)} -body { file delete } -result {} test fCmd-16.5 {accept zero files (TIP 323)} -body { file delete -- } -result {} # ~ is no longer a special char. Need a test case where translation fails. test fCmd-16.6 {delete: source filename translation failing} -setup { set temp $::env(HOME) } -constraints {notRoot TODO} -body { global env unset env(HOME) catch {file delete ~/tfa} } -cleanup { set ::env(HOME) $temp } -result 1 test fCmd-16.7 {remove a non-empty directory without -force} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { file mkdir tfa createfile tfa/a catch {file delete tfa} } -cleanup { file delete -force tfa } -result 1 test fCmd-16.8 {remove a normal file} -constraints {notRoot} -setup { catch {file delete -force -- tfa} } -body { file mkdir tfa createfile tfa/a catch {file delete tfa} } -cleanup { file delete -force tfa } -result 1 test fCmd-16.9 {error while deleting file} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot notWsl} -body { file mkdir tfa createfile tfa/a file attributes tfa -permissions 0o555 catch {file delete tfa/a} ####### ####### If any directory in a tree that is being removed does not have ####### write permission, the process will fail! This is also the case ####### with "rm -rf" ####### } -cleanup { file attributes tfa -permissions 0o777 file delete -force tfa } -result 1 test fCmd-16.10 {deleting multiple files} -constraints {notRoot} -setup { catch {file delete -force -- tfa1 tfa2} } -body { createfile tfa1 createfile tfa2 file delete tfa1 tfa2 list [file exists tfa1] [file exists tfa2] } -result {0 0} test fCmd-16.11 {TclFileDeleteCmd: removing a nonexistant file} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { file delete tfa } -result {} # More coverage tests for mkpath() test fCmd-17.1 {mkdir stat failing on target but not ENOENT} -setup { catch {file delete -force -- tfa1} } -constraints {unix notRoot notWsl} -body { file mkdir tfa1 file attributes tfa1 -permissions 0o555 catch {file mkdir tfa1/tfa2} } -cleanup { file attributes tfa1 -permissions 0o777 file delete -force tfa1 } -result 1 test fCmd-17.2 {mkdir several levels deep - relative} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { file mkdir tfa/a/b file isdir tfa/a/b } -cleanup { file delete tfa/a/b tfa/a tfa } -result 1 test fCmd-17.3 {mkdir several levels deep - absolute} -setup { catch {file delete -force -- tfa} } -constraints {notRoot} -body { set f [file join [pwd] tfa a] file mkdir $f file isdir $f } -cleanup { file delete $f [file join [pwd] tfa] } -result 1 # # Functionality tests for TclFileRenameCmd() # test fCmd-18.1 {TclFileRenameCmd: rename (first form) in the same directory} \ -setup { catch {file delete -force -- tfad} set savedDir [pwd] } -constraints {notRoot} -body { file mkdir tfad/dir cd tfad/dir set s [createfile foo] file rename foo bar file rename bar ./foo file rename ./foo bar file rename ./bar ./foo file rename foo ../dir/bar file rename ../dir/bar ./foo file rename ../../tfad/dir/foo ../../tfad/dir/bar file rename [file join [pwd] bar] foo file rename foo [file join [pwd] bar] list [checkcontent bar $s] [file exists foo] } -cleanup { cd $savedDir file delete -force tfad } -result {1 0} test fCmd-18.2 {TclFileRenameCmd: single dir to nonexistant} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { file mkdir tfa1 file rename tfa1 tfa2 list [file exists tfa2] [file exists tfa1] } -cleanup { file delete tfa2 } -result {1 0} test fCmd-18.3 {TclFileRenameCmd: mixed dirs and files into directory} -setup { catch {file delete -force -- tfa1 tfad1 tfad2} } -constraints {notRoot} -body { set s [createfile tfa1] file mkdir tfad1 tfad2 file rename tfa1 tfad1 tfad2 list [checkcontent tfad2/tfa1 $s] [file isdir tfad2/tfad1] \ [file exists tfa1] [file exists tfad1] } -cleanup { file delete tfad2/tfa1 file delete -force tfad2 } -result {1 1 0 0} test fCmd-18.4 {TclFileRenameCmd: attempt to replace non-dir with dir} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s [createfile tfa] file mkdir tfad list [catch {file rename tfad tfa}] [checkcontent tfa $s] [file isdir tfad] } -cleanup { file delete tfa tfad } -result {1 1 1} test fCmd-18.5 {TclFileRenameCmd: attempt to replace dir with non-dir} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { set s [createfile tfa] file mkdir tfad/tfa list [catch {file rename tfa tfad}] [checkcontent tfa $s] \ [file isdir tfad/tfa] } -cleanup { file delete -force tfa tfad } -result {1 1 1} # # On Windows there is no easy way to determine if two files are the same # test fCmd-18.6 {TclFileRenameCmd: rename a file to itself} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot} -body { set s [createfile tfa] list [catch {file rename tfa tfa}] [checkcontent tfa $s] } -cleanup { file delete tfa } -result {1 1} test fCmd-18.7 {TclFileRenameCmd: rename dir on top of another empty dir w/o -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa tfad/tfa list [catch {file rename tfa tfad}] [file isdir tfa] } -cleanup { file delete -force tfa tfad } -result {1 1} test fCmd-18.8 {TclFileRenameCmd: rename dir on top of another empty dir w/ -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot notNetworkFilesystem} -body { file mkdir tfa tfad/tfa file rename -force tfa tfad file isdir tfa } -cleanup { file delete -force tfad } -result 0 test fCmd-18.9 {TclFileRenameCmd: rename dir on top of a non-empty dir w/o -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa tfad/tfa/file list [catch {file rename tfa tfad}] [file isdir tfa] \ [file isdir tfad/tfa/file] } -cleanup { file delete -force tfa tfad } -result {1 1 1} test fCmd-18.10 {TclFileRenameCmd: rename dir on top of a non-empty dir w/ -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot notNetworkFilesystem} -body { file mkdir tfa tfad/tfa/file list [catch {file rename -force tfa tfad}] [file isdir tfa] \ [file isdir tfad/tfa/file] } -cleanup { file delete -force tfa tfad } -result {1 1 1} test fCmd-18.11 {TclFileRenameCmd: rename a non-existant file} -setup { catch {file delete -force -- tfa1} } -constraints {notRoot} -body { list [catch {file rename tfa1 tfa2}] [file exists tfa1] [file exists tfa2] } -result {1 0 0} test fCmd-18.12 {TclFileRenameCmd : rename a symbolic link to file} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {unix notRoot} -body { set s [createfile tfa1] file link -symbolic tfa2 tfa1 file rename tfa2 tfa3 file type tfa3 } -cleanup { file delete tfa1 tfa3 } -result link test fCmd-18.13 {TclFileRenameCmd : rename a symbolic link to dir} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {unix notRoot} -body { file mkdir tfa1 file link -symbolic tfa2 tfa1 file rename tfa2 tfa3 file type tfa3 } -cleanup { file delete tfa1 tfa3 } -result link test fCmd-18.14 {TclFileRenameCmd : rename a path with sym link} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {unix notRoot} -body { file mkdir tfa1/a/b/c/d file mkdir tfa2 set f [file join [pwd] tfa1/a/b] set f2 [file join [pwd] {tfa2/b alias}] file link -symbolic $f2 $f file rename {tfa2/b alias/c} tfa3 list [file isdir tfa3] [file exists tfa1/a/b/c] } -cleanup { file delete -force tfa1 tfa2 tfa3 } -result {1 0} test fCmd-18.15 {TclFileRenameCmd : rename a file to a symlink dir} -setup { catch {file delete -force -- tfa1 tfa2 tfalink} } -constraints {unix notRoot} -body { file mkdir tfa1 set s [createfile tfa2] file link -symbolic tfalink tfa1 file rename tfa2 tfalink checkcontent tfa1/tfa2 $s } -cleanup { file delete -force tfa1 tfalink } -result 1 test fCmd-18.16 {TclFileRenameCmd: rename a dangling symlink} -setup { catch {file delete -force -- tfa1 tfalink} } -constraints {unix notRoot} -body { file mkdir tfa1 file link -symbolic tfalink tfa1 file delete tfa1 file rename tfalink tfa2 file type tfa2 } -cleanup { file delete tfa2 } -result link # # Coverage tests for TclUnixRmdir # test fCmd-19.1 {remove empty directory} -constraints {notRoot} -setup { catch {file delete -force -- tfa} } -body { file mkdir tfa file delete tfa file exists tfa } -result {0} test fCmd-19.2 {rmdir error besides EEXIST} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot notWsl} -body { file mkdir tfa file mkdir tfa/a file attributes tfa -permissions 0o555 catch {file delete tfa/a} } -cleanup { file attributes tfa -permissions 0o777 file delete -force tfa } -result 1 test fCmd-19.3 {recursive remove} -constraints {notRoot} -setup { catch {file delete -force -- tfa} } -body { file mkdir tfa file mkdir tfa/a file delete -force tfa file exists tfa } -result {0} # # TclUnixDeleteFile and TraversalDelete are covered by tests from the # TclDeleteFilesCmd suite # # # Coverage tests for TraverseUnixTree(), called from TclDeleteFilesCmd # test fCmd-20.1 {TraverseUnixTree : failure opening a subdirectory directory} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot notWsl} -body { file mkdir tfa file mkdir tfa/a file attributes tfa/a -permissions 00000 catch {file delete -force tfa} } -cleanup { file attributes tfa/a -permissions 0o777 file delete -force tfa } -result 1 test fCmd-20.2 {TraverseUnixTree : recursive delete of large directory: Bug 1034337} -setup { catch {file delete -force -- tfa} } -constraints {unix notRoot} -body { file mkdir tfa for {set i 1} {$i <= 300} {incr i} { createfile tfa/testfile_$i } file delete -force tfa } -cleanup { while {[catch {file delete -force tfa}]} {} } -result {} # # Feature testing for TclCopyFilesCmd # test fCmd-21.1 {copy : single file to nonexistant} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { set s [createfile tfa1] file copy tfa1 tfa2 list [checkcontent tfa2 $s] [checkcontent tfa1 $s] } -cleanup { file delete tfa1 tfa2 } -result {1 1} test fCmd-21.2 {copy : single dir to nonexistant} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { file mkdir tfa1 file copy tfa1 tfa2 list [file isdir tfa2] [file isdir tfa1] } -cleanup { file delete tfa1 tfa2 } -result {1 1} test fCmd-21.3 {copy : single file into directory} -setup { catch {file delete -force -- tfa1 tfad} } -constraints {notRoot} -body { set s [createfile tfa1] file mkdir tfad file copy tfa1 tfad list [checkcontent tfad/tfa1 $s] [checkcontent tfa1 $s] } -cleanup { file delete -force tfa1 tfad } -result {1 1} test fCmd-21.4 {copy : more than one source and target is not a directory} -setup { catch {file delete -force -- tfa1 tfa2 tfa3} } -constraints {notRoot} -body { createfile tfa1 createfile tfa2 createfile tfa3 catch {file copy tfa1 tfa2 tfa3} } -cleanup { file delete tfa1 tfa2 tfa3 } -result 1 test fCmd-21.5 {copy : multiple files into directory} -constraints {notRoot} -setup { catch {file delete -force -- tfa1 tfa2 tfad} } -body { set s1 [createfile tfa1] set s2 [createfile tfa2] file mkdir tfad file copy tfa1 tfa2 tfad list [checkcontent tfad/tfa1 $s1] [checkcontent tfad/tfa2 $s2] \ [checkcontent tfa1 $s1] [checkcontent tfa2 $s2] } -cleanup { file delete -force tfa1 tfa2 tfad } -result {1 1 1 1} test fCmd-21.6 {copy: mixed dirs and files into directory} -setup { catch {file delete -force -- tfa1 tfad1 tfad2} } -constraints {notRoot notFileSharing} -body { set s [createfile tfa1] file mkdir tfad1 tfad2 file copy tfa1 tfad1 tfad2 list [checkcontent [file join tfad2 tfa1] $s] \ [file isdir [file join tfad2 tfad1]] \ [checkcontent tfa1 $s] [file isdir tfad1] } -cleanup { file delete -force tfa1 tfad1 tfad2 } -result {1 1 1 1} test fCmd-21.7.1 {TclCopyFilesCmd: copy a dangling link} -setup { catch {file delete -force tfad1 tfalink tfalink2} } -constraints {unix notRoot dontCopyLinks} -body { file mkdir tfad1 file link -symbolic tfalink tfad1 file delete tfad1 file copy tfalink tfalink2 } -returnCodes error -cleanup { file delete -force tfalink tfalink2 } -result {error copying "tfalink": the target of this link doesn't exist} test fCmd-21.7.2 {TclCopyFilesCmd: copy a dangling link} -setup { catch {file delete -force tfad1 tfalink tfalink2} } -constraints {unix notRoot} -body { file mkdir tfad1 file link -symbolic tfalink tfad1 file delete tfad1 file copy tfalink tfalink2 file type tfalink2 } -cleanup { file delete tfalink tfalink2 } -result link test fCmd-21.8.1 {TclCopyFilesCmd: copy a link} -setup { catch {file delete -force tfad1 tfalink tfalink2} } -constraints {unix notRoot dontCopyLinks} -body { file mkdir tfad1 file link -symbolic tfalink tfad1 file copy tfalink tfalink2 list [file type tfalink] [file type tfalink2] [file isdir tfad1] } -cleanup { file delete -force tfad1 tfalink tfalink2 } -result {link directory 1} test fCmd-21.8.2 {TclCopyFilesCmd: copy a link} -setup { catch {file delete -force tfad1 tfalink tfalink2} } -constraints {unix notRoot} -body { file mkdir tfad1 file link -symbolic tfalink tfad1 file copy tfalink tfalink2 list [file type tfalink] [file type tfalink2] [file isdir tfad1] } -cleanup { file delete -force tfad1 tfalink tfalink2 } -result {link link 1} test fCmd-21.9 {TclCopyFilesCmd: copy dir with a link in it} -setup { catch {file delete -force tfad1 tfad2} } -constraints {unix notRoot} -body { file mkdir tfad1 file link -symbolic tfad1/tfalink "[pwd]/tfad1" file copy tfad1 tfad2 file type tfad2/tfalink } -cleanup { file delete -force tfad1 tfad2 } -result link test fCmd-21.10 {TclFileCopyCmd: copy dir on top of another empty dir w/o -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa [file join tfad tfa] list [catch {file copy tfa tfad}] [file isdir tfa] } -cleanup { file delete -force tfa tfad } -result {1 1} test fCmd-21.11 {TclFileCopyCmd: copy dir on top of a dir w/o -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa [file join tfad tfa file] list [catch {file copy tfa tfad}] [file isdir tfa] \ [file isdir [file join tfad tfa file]] } -cleanup { file delete -force tfa tfad } -result {1 1 1} test fCmd-21.12 {TclFileCopyCmd: copy dir on top of a non-empty dir w/ -force} -setup { catch {file delete -force -- tfa tfad} } -constraints {notRoot} -body { file mkdir tfa [file join tfad tfa file] list [catch {file copy -force tfa tfad}] [file isdir tfa] \ [file isdir [file join tfad tfa file]] } -cleanup { file delete -force tfa tfad } -result {1 1 1} # # Coverage testing for TclpRenameFile # test fCmd-22.1 {TclpRenameFile: rename and overwrite in a single dir} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { set s [createfile tfa1] set s2 [createfile tfa2 q] set result [catch {file rename tfa1 tfa2}] file rename -force tfa1 tfa2 lappend result [checkcontent tfa2 $s] } -cleanup { file delete [glob tfa1 tfa2] } -result {1 1} test fCmd-22.2 {TclpRenameFile: attempt to overwrite itself} -setup { catch {file delete -force -- tfa1} } -constraints {unix notRoot} -body { set s [createfile tfa1] file rename -force tfa1 tfa1 checkcontent tfa1 $s } -cleanup { file delete tfa1 } -result 1 test fCmd-22.3 {TclpRenameFile: rename dir to existing dir} -setup { catch {file delete -force -- d1 tfad} } -constraints {notRoot} -body { file mkdir d1 [file join tfad d1] list [catch {file rename d1 tfad}] [file isdir d1] \ [file isdir [file join tfad d1]] } -cleanup { file delete -force d1 tfad } -result {1 1 1} test fCmd-22.4 {TclpRenameFile: rename dir to dir several levels deep} -setup { catch {file delete -force -- d1 tfad} } -constraints {notRoot} -body { file mkdir d1 [file join tfad a b c] file rename d1 [file join tfad a b c d1] list [file isdir d1] [file isdir [file join tfad a b c d1]] } -cleanup { file delete -force [glob d1 tfad] } -result {0 1} # # TclMacCopyFile needs to be redone. # test fCmd-22.5 {TclMacCopyFile: copy and overwrite in a single dir} -setup { catch {file delete -force -- tfa1 tfa2} } -constraints {notRoot} -body { set s [createfile tfa1] set s2 [createfile tfa2 q] set result [catch {file copy tfa1 tfa2}] file copy -force tfa1 tfa2 lappend result [checkcontent tfa2 $s] [checkcontent tfa1 $s] } -cleanup { file delete tfa1 tfa2 } -result {1 1 1} # # TclMacMkdir - basic cases are covered elsewhere. # Error cases are not covered. # # # TclMacRmdir # Error cases are not covered. # test fCmd-23.1 {TclMacRmdir: trying to remove a nonempty directory} -setup { catch {file delete -force -- tfad} } -constraints {notRoot} -body { file mkdir [file join tfad dir] list [catch {file delete tfad}] [file delete -force tfad] } -cleanup { catch {file delete -force tfad} } -result {1 {}} # # TclMacDeleteFile # Error cases are not covered. # test fCmd-24.1 {TclMacDeleteFile: deleting a normal file} -setup { catch {file delete -force -- tfa1} } -constraints {notRoot} -body { createfile tfa1 file delete tfa1 file exists tfa1 } -cleanup { catch {file delete -force tfa1} } -result {0} # # TclMacCopyDirectory # Error cases are not covered. # test fCmd-25.1 {TclMacCopyDirectory: copying a normal directory} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {notRoot notFileSharing} -body { file mkdir [file join tfad1 a b c] file copy tfad1 tfad2 list [file isdir [file join tfad1 a b c]] \ [file isdir [file join tfad2 a b c]] } -cleanup { file delete -force tfad1 tfad2 } -result {1 1} test fCmd-25.2 {TclMacCopyDirectory: copying a short path normal directory} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {notRoot notFileSharing} -body { file mkdir tfad1 file copy tfad1 tfad2 list [file isdir tfad1] [file isdir tfad2] } -cleanup { file delete tfad1 tfad2 } -result {1 1} test fCmd-25.3 {TclMacCopyDirectory: copying dirs between different dirs} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {notRoot notFileSharing} -body { file mkdir [file join tfad1 x y z] file mkdir [file join tfad2 dir] file copy tfad1 [file join tfad2 dir] list [file isdir [file join tfad1 x y z]] \ [file isdir [file join tfad2 dir tfad1 x y z]] } -cleanup { file delete -force tfad1 tfad2 } -result {1 1} # # Functionality tests for TclDeleteFilesCmd # test fCmd-26.1 {TclDeleteFilesCmd: delete symlink} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {unix notRoot} -body { file mkdir tfad1 file link -symbolic tfalink tfad1 file delete tfalink list [file isdir tfad1] [file exists tfalink] } -cleanup { file delete tfad1 catch {file delete tfalink} } -result {1 0} test fCmd-26.2 {TclDeleteFilesCmd: delete dir with symlink} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {unix notRoot} -body { file mkdir tfad1 file mkdir tfad2 file link -symbolic [file join tfad2 link] [file join .. tfad1] file delete -force tfad2 list [file isdir tfad1] [file exists tfad2] } -cleanup { file delete tfad1 } -result {1 0} test fCmd-26.3 {TclDeleteFilesCmd: delete dangling symlink} -setup { catch {file delete -force -- tfad1 tfad2} } -constraints {unix notRoot} -body { file mkdir tfad1 file link -symbolic tfad2 tfad1 file delete tfad1 file delete tfad2 list [file exists tfad1] [file exists tfad2] } -result {0 0} # There is no fCmd-27.1 test fCmd-27.2 {TclFileAttrsCmd - Tcl_TranslateFileName fails} -setup { set platform [testgetplatform] } -constraints {testsetplatform} -body { testsetplatform unix file attributes ~_totally_bogus_user } -returnCodes error -cleanup { testsetplatform $platform } -result {could not read "~_totally_bogus_user": no such file or directory} test fCmd-27.3 {TclFileAttrsCmd - all attributes} -setup { catch {file delete -force -- foo.tmp} } -body { createfile foo.tmp file attributes foo.tmp # Must be non-empty result } -cleanup { file delete -force -- foo.tmp } -match glob -result {?*} test fCmd-27.4 {TclFileAttrsCmd - getting one option} -setup { catch {file delete -force -- foo.tmp} } -body { createfile foo.tmp set attrs [file attributes foo.tmp] file attributes foo.tmp {*}[lindex $attrs 0] # Any successful result will do } -cleanup { file delete -force -- foo.tmp } -match glob -result * test fCmd-27.5 {TclFileAttrsCmd - setting one option} -setup { catch {file delete -force -- foo.tmp} } -constraints {foundGroup} -body { createfile foo.tmp set attrs [file attributes foo.tmp] file attributes foo.tmp {*}[lrange $attrs 0 1] } -cleanup { file delete -force -- foo.tmp } -result {} test fCmd-27.6 {TclFileAttrsCmd - setting more than one option} -setup { catch {file delete -force -- foo.tmp} } -constraints {foundGroup} -body { createfile foo.tmp set attrs [file attributes foo.tmp] file attributes foo.tmp {*}[lrange $attrs 0 3] } -cleanup { file delete -force -- foo.tmp } -result {} if { [testConstraint win] && ($::tcl_platform(osVersion) < 5.0 || [lindex [file system [temporaryDirectory]] 1] ne "NTFS") } then { testConstraint linkDirectory 0 testConstraint linkFile 0 } test fCmd-28.1 {file link} -returnCodes error -body { file link } -result {wrong # args: should be "file link ?-linktype? linkname ?target?"} test fCmd-28.2 {file link} -returnCodes error -body { file link a b c d } -result {wrong # args: should be "file link ?-linktype? linkname ?target?"} test fCmd-28.3 {file link} -returnCodes error -body { file link abc b c } -result {bad option "abc": must be -symbolic or -hard} test fCmd-28.4 {file link} -returnCodes error -body { file link -abc b c } -result {bad option "-abc": must be -symbolic or -hard} cd [workingDirectory] makeDirectory abc.dir makeDirectory abc2.dir makeFile contents abc.file makeFile contents abc2.file cd [temporaryDirectory] test fCmd-28.5 {file link: source already exists} -setup { cd [temporaryDirectory] } -constraints {linkDirectory} -body { file link abc.dir abc2.dir } -returnCodes error -cleanup { cd [workingDirectory] } -result {could not create new link "abc.dir": that path already exists} test fCmd-28.6 {file link: unsupported operation} -setup { cd [temporaryDirectory] } -constraints {linkDirectory win} -body { file link -hard abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] } -result {could not create new link "abc.link" pointing to "abc.dir": is a directory} test fCmd-28.7 {file link: source already exists} -setup { cd [temporaryDirectory] } -constraints {linkFile} -body { file link abc.file abc2.file } -returnCodes error -cleanup { cd [workingDirectory] } -result {could not create new link "abc.file": that path already exists} # In Windows 10 developer mode, we _can_ create symbolic links to files! test fCmd-28.8 {file link} -constraints {linkFile winLessThan10} -setup { cd [temporaryDirectory] } -body { file link -symbolic abc.link abc.file } -cleanup { file delete -force abc.link cd [workingDirectory] } -returnCodes error -result {could not create new link "abc.link" pointing to "abc.file": invalid argument} test fCmd-28.9 {file link: success with file} -constraints {linkFile} -setup { cd [temporaryDirectory] file delete -force abc.link } -body { file link abc.link abc.file } -cleanup { cd [workingDirectory] } -result abc.file test fCmd-28.9.1 {file link: success with file} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkFile win} -body { file stat abc.file arr set res $arr(nlink) lappend res [catch {file link abc.link abc.file} msg] $msg file stat abc.file arr lappend res $arr(nlink) } -cleanup { cd [workingDirectory] } -result {1 0 abc.file 2} cd [temporaryDirectory] catch {file delete -force abc.link} cd [workingDirectory] test fCmd-28.10 {file link: linking to nonexistent path} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory} -body { file link abc.link abc2.doesnt } -returnCodes error -cleanup { cd [workingDirectory] } -result {could not create new link "abc.link": target "abc2.doesnt" doesn't exist} test fCmd-28.10.1 {file link: linking to nonexistent path} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory} -body { file link doesnt/abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] } -result {could not create new link "doesnt/abc.link": no such file or directory} test fCmd-28.11 {file link: success with directory} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory notWine} -body { file link abc.link abc.dir } -cleanup { cd [workingDirectory] } -result abc.dir test fCmd-28.12 {file link: cd into a link} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory notWine} -body { file link abc.link abc.dir set orig [pwd] cd abc.link set dir [pwd] cd .. set up [pwd] cd $orig # Now '$up' should be either $orig or [file dirname abc.dir], depending on # whether 'cd' actually moves to the destination of a link, or simply # treats the link as a directory. (On windows the former, on Unix the # latter, I believe) if { ([file normalize $up] ne [file normalize $orig]) && ([file normalize $up] ne [file normalize [file dirname abc.dir]]) } then { return "wrong directory with 'cd abc.link ; cd ..': \ \"[file normalize $up]\" should be \"[file normalize $orig]\"\ or \"[file normalize [file dirname abc.dir]]\"" } else { return "ok" } } -cleanup { file delete -force abc.link cd [workingDirectory] } -result ok test fCmd-28.13 {file link} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { # duplicate link throws error file link abc.link abc.dir } -returnCodes error -cleanup { file delete -force abc.link cd [workingDirectory] } -result {could not create new link "abc.link": that path already exists} test fCmd-28.14 {file link: deletes link not dir} -setup { cd [temporaryDirectory] } -constraints {linkDirectory} -body { file delete -force abc.link list [file exists abc.link] [file exists abc.dir] } -cleanup { cd [workingDirectory] } -result {0 1} test fCmd-28.15.1 {file link: copies link not dir} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory dontCopyLinks} -body { file link abc.link abc.dir file copy abc.link abc2.link # abc2.linkdir was a copy of a link to a dir, so it should end up as a # directory, not a link (links trace to endpoint). list [file type abc2.link] [file tail [file link abc.link]] } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {directory abc.dir} test fCmd-28.15.2 {file link: copies link not dir} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory notWine} -body { file link abc.link abc.dir file copy abc.link abc2.link list [file type abc2.link] [file tail [file link abc2.link]] } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {link abc.dir} cd [temporaryDirectory] file delete -force abc.link file delete -force abc2.link cd abc.dir file delete -force abc.file file delete -force abc2.file cd .. file copy abc.file abc.dir file copy abc2.file abc.dir cd [workingDirectory] test fCmd-28.16 {file link: glob inside link} -setup { cd [temporaryDirectory] file delete -force abc.link } -constraints {linkDirectory notWine} -body { file link abc.link abc.dir lsort [glob -dir abc.link -tails *] } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {abc.file abc2.file} test fCmd-28.17 {file link: glob -type l} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -constraints {linkDirectory notWine} -body { glob -dir [pwd] -type l -tails abc* } -cleanup { file delete -force abc.link cd [workingDirectory] } -result {abc.link} test fCmd-28.18 {file link: glob -type d} -constraints {linkDirectory notWine} -setup { cd [temporaryDirectory] file link abc.link abc.dir } -body { lsort [glob -dir [pwd] -type d -tails abc*] } -cleanup { file delete -force abc.link cd [workingDirectory] } -result [lsort [list abc.link abc.dir abc2.dir]] test fCmd-28.19 {file link: relative paths} -setup { cd [temporaryDirectory] } -constraints {win linkDirectory notWine} -body { file mkdir d1/d2/d3 file link d1/l2 d1/d2 } -cleanup { catch {file delete -force d1} cd [workingDirectory] } -result d1/d2 test fCmd-28.20 {file link: relative paths} -setup { cd [temporaryDirectory] } -constraints {unix linkDirectory} -body { file mkdir d1/d2/d3 file link d1/l2 d1/d2 } -returnCodes error -cleanup { catch {file delete -force d1} cd [workingDirectory] } -result {could not create new link "d1/l2": target "d1/d2" doesn't exist} test fCmd-28.21 {file link: relative paths} -setup { cd [temporaryDirectory] } -constraints {unix linkDirectory} -body { file mkdir d1/d2/d3 file link d1/l2 d2 } -cleanup { catch {file delete -force d1} cd [workingDirectory] } -result d2 test fCmd-28.22 {file link: relative paths} -setup { cd [temporaryDirectory] } -constraints {unix linkDirectory} -body { file mkdir d1/d2/d3 catch {file delete -force d1/l2} file link d1/l2 d2/d3 } -cleanup { catch {file delete -force d1} cd [workingDirectory] } -result d2/d3 try { cd [temporaryDirectory] file delete -force abc.link file delete -force d1/d2 file delete -force d1 } finally { cd [workingDirectory] } removeFile abc2.file removeFile abc.file removeDirectory abc2.dir removeDirectory abc.dir test fCmd-29.1 {weird memory corruption fault} -body { open [file join ~a_totally_bogus_user_id/foo bar] } -returnCodes error -match glob -result * test fCmd-30.1 {file writable on 'My Documents'} -setup { # Get the localized version of the folder name by looking in the registry. set mydocsname [registry get {HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders} Personal] } -constraints {win reg} -body { file writable $mydocsname } -result 1 test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win notWine} -body { expr {[info exists env(USERPROFILE)] && [file exists $env(USERPROFILE)/NTUSER.DAT] && [file readable $env(USERPROFILE)/NTUSER.DAT]} } -result 1 # At least one CI environment (GitHub Actions) is set up with the page file in # an unusual location; skip the test if that is so. test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win notInCIenv} -body { set r {} if {[info exists env(SystemDrive)]} { set path $env(SystemDrive)/pagefile.sys lappend r exists [file exists $path] lappend r readable [file readable $path] lappend r stat [catch {file stat $path a} e] $e unset -nocomplain path } return $r } -result {exists 1 readable 0 stat 0 {}} test fCmd-31.1 {file home} -body { file home } -result [file join $::env(HOME)] test fCmd-31.2 {file home - obeys env} -setup { set temp $::env(HOME) set ::env(HOME) $::env(HOME)/xxx } -cleanup { set ::env(HOME) $temp unset temp } -body { file home } -result [file join $::env(HOME) xxx] test fCmd-31.3 {file home - \ -> /} -constraints win -setup { set temp $::env(HOME) set ::env(HOME) C:\\backslash\\path } -cleanup { set ::env(HOME) $temp unset temp } -body { file home } -result C:/backslash/path test fCmd-31.4 {file home - error} -setup { set saved $::env(HOME) unset ::env(HOME) } -cleanup { set ::env(HOME) $saved unset saved } -body { file home } -returnCodes error -result {couldn't find HOME environment variable to expand path} test fCmd-31.5 { file home - relative path. Following 8.x ~ expansion behavior, relative paths are not made absolute } -setup { set saved $::env(HOME) set ::env(HOME) relative/path } -cleanup { set ::env(HOME) $saved unset saved } -body { file home } -result relative/path test fCmd-31.6 {file home USER} -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [file home $::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] test fCmd-31.7 {file home UNKNOWNUSER} -body { file home nosuchuser } -returnCodes error -result {user "nosuchuser" doesn't exist} test fCmd-31.8 {file home extra arg} -body { file home $::tcl_platform(user) arg } -returnCodes error -result {wrong # args: should be "file home ?user?"} test fCmd-31.9 {file home USER does not follow env(HOME)} -setup { set saved $::env(HOME) set ::env(HOME) [file join $::env(HOME) foo] } -cleanup { set ::env(HOME) $saved unset saved } -body { string tolower [file home $::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] # file tildeexpand and testfstildexpand are identical in behavior # but tested separately as the former is a script wrapper that does some # sanitization/optimization while the latter is a raw call to Tcl_FSTildeExpand. test fCmd-32.1 {file tildeexpand ~} -body { file tildeexpand ~ } -result [file join $::env(HOME)] test fCmd-32.1.1 {Tcl_FSTildeExpand ~} -constraints testfstildeexpand -body { testfstildeexpand ~ } -result [file join $::env(HOME)] test fCmd-32.2 {file tildeexpand ~ - obeys env} -setup { set saved $::env(HOME) set ::env(HOME) $::env(HOME)/xxx } -cleanup { set ::env(HOME) $saved unset saved } -body { file tildeexpand ~ } -result [file join $::env(HOME) xxx] test fCmd-32.2.1 {Tcl_FSTildeExpand ~ - obeys env} -setup { set saved $::env(HOME) set ::env(HOME) $::env(HOME)/xxx } -cleanup { set ::env(HOME) $saved unset saved } -constraints testfstildeexpand -body { testfstildeexpand ~ } -result [file join $::env(HOME) xxx] test fCmd-32.3 {file tildeexpand ~ - error} -setup { set saved $::env(HOME) unset ::env(HOME) } -cleanup { set ::env(HOME) $saved } -body { file tildeexpand ~ } -returnCodes error -result {couldn't find HOME environment variable to expand path} test fCmd-32.3.1 {Tcl_FSTildeExpand ~ - error} -setup { set saved $::env(HOME) unset ::env(HOME) } -cleanup { set ::env(HOME) $saved } -constraints testfstildeexpand -body { testfstildeexpand ~ } -returnCodes error -result {couldn't find HOME environment variable to expand path} test fCmd-32.4 { file tildeexpand ~ - relative path. Following 8.x ~ expansion behavior, relative paths are not made absolute } -setup { set saved $::env(HOME) set ::env(HOME) relative/path } -cleanup { set ::env(HOME) $saved } -body { file tildeexpand ~ } -result relative/path test fCmd-32.4.1 { Tcl_FSTildeExpand ~ - relative path. Following 8.x ~ expansion behavior, relative paths are not made absolute } -setup { set saved $::env(HOME) set ::env(HOME) relative/path } -cleanup { set ::env(HOME) $saved } -constraints testfstildeexpand -body { testfstildeexpand ~ } -result relative/path test fCmd-32.5 {file tildeexpand ~USER} -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [file tildeexpand ~$::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] test fCmd-32.5.1 {Tcl_FSTildeExpand ~USER} -constraints testfstildeexpand -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [testfstildeexpand ~$::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] test fCmd-32.6 {file tildeexpand ~UNKNOWNUSER} -body { file tildeexpand ~nosuchuser } -returnCodes error -result {user "nosuchuser" doesn't exist} test fCmd-32.6.1 {Tcl_FSTildeExpand ~UNKNOWNUSER} -constraints testfstildeexpand -body { testfstildeexpand ~nosuchuser } -returnCodes error -result {user "nosuchuser" doesn't exist} test fCmd-32.7 {file tildeexpand ~extra arg} -body { file tildeexpand ~ arg } -returnCodes error -result {wrong # args: should be "file tildeexpand path"} test fCmd-32.7.1 {Tcl_FSTildeExpand ~extra arg} -constraints testfstildeexpand -body { testfstildeexpand ~ arg } -returnCodes error -result {wrong # args: should be "testfstildeexpand PATH"} test fCmd-32.8 {file tildeexpand ~/path} -body { file tildeexpand ~/foo } -result [file join $::env(HOME)/foo] test fCmd-32.8.1 {Tcl_FSTildeExpand ~/path} -constraints testfstildeexpand -body { testfstildeexpand ~/foo } -result [file join $::env(HOME)/foo] test fCmd-32.9 {file tildeexpand ~USER/bar} -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [file tildeexpand ~$::tcl_platform(user)/bar] } -match glob -result [file join [gethomedirglob $::tcl_platform(user)] bar] test fCmd-32.9.1 {Tcl_FSTildeExpand ~USER/bar} -constraints testfstildeexpand -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [testfstildeexpand ~$::tcl_platform(user)/bar] } -match glob -result [file join [gethomedirglob $::tcl_platform(user)] bar] test fCmd-32.10 {file tildeexpand ~UNKNOWNUSER} -body { file tildeexpand ~nosuchuser/foo } -returnCodes error -result {user "nosuchuser" doesn't exist} test fCmd-32.10.1 {Tcl_FSTildeExpand ~UNKNOWNUSER} -constraints testfstildeexpand -body { testfstildeexpand ~nosuchuser/foo } -returnCodes error -result {user "nosuchuser" doesn't exist} test fCmd-32.11 {file tildeexpand /~/path} -body { file tildeexpand /~/foo } -result /~/foo test fCmd-32.11.1 {Tcl_FSTildeExpand /~/path} -constraints testfstildeexpand -body { testfstildeexpand /~/foo } -result /~/foo test fCmd-32.12 {file tildeexpand /~user/path} -body { file tildeexpand /~$::tcl_platform(user)/foo } -result /~$::tcl_platform(user)/foo test fCmd-32.12.1 {Tcl_FSTildeExpand /~user/path} -constraints testfstildeexpand -body { testfstildeexpand /~$::tcl_platform(user)/foo } -result /~$::tcl_platform(user)/foo test fCmd-32.13 {file tildeexpand ./~} -body { file tildeexpand ./~ } -result ./~ test fCmd-32.13.1 {Tcl_FSTildeExpand ./~} -constraints testfstildeexpand -body { testfstildeexpand ./~ } -result ./~ test fCmd-32.14 {file tildeexpand relative/path} -body { file tildeexpand relative/path } -result relative/path test fCmd-32.14.1 {Tcl_FSTildeExpand relative/path} -constraints testfstildeexpand -body { testfstildeexpand relative/path } -result relative/path test fCmd-32.15 {file tildeexpand ~\\path} -body { file tildeexpand ~\\foo } -constraints win -result [file join $::env(HOME)/foo] test fCmd-32.15.1 {Tcl_FSTildeExpand ~\\path} -constraints testfstildeexpand -body { testfstildeexpand ~\\foo } -constraints win -result [file join $::env(HOME)/foo] test fCmd-32.16 {file tildeexpand ~USER\\bar} -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [file tildeexpand ~$::tcl_platform(user)\\bar] } -constraints win -match glob -result [file join [gethomedirglob $::tcl_platform(user)] bar] test fCmd-32.16.1 {Tcl_FSTildeExpand ~USER\\bar} -constraints testfstildeexpand -body { # Note - as in 8.x this form does NOT necessarily give same result as # env(HOME) even when user is current user. Assume result contains user # name, else not sure how to check string tolower [testfstildeexpand ~$::tcl_platform(user)\\bar] } -constraints win -match glob -result [file join [gethomedirglob $::tcl_platform(user)] bar] test fCmd-32.17 {file tildeexpand ~USER does not mirror HOME} -setup { set oldHome $::env(HOME) set ::env(HOME) [file join $::env(HOME) foo] } -cleanup { set ::env(HOME) $oldHome } -body { string tolower [file tildeexpand ~$::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] test fCmd-32.17.1 {Tcl_FSTildeExpand ~USER does not mirror HOME} -setup { set oldHome $::env(HOME) set ::env(HOME) [file join $::env(HOME) foo] } -cleanup { set ::env(HOME) $oldHome } -constraints testfstildeexpand -body { string tolower [testfstildeexpand ~$::tcl_platform(user)] } -match glob -result [gethomedirglob $::tcl_platform(user)] # cleanup cleanup if {[testConstraint unix]} { removeDirectory tcl[pid] /tmp } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/expr.test0000644000175000017500000125675315104661341014613 0ustar sergeisergei# Commands covered: expr # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1996-1997 Sun Microsystems, Inc. # Copyright © 1998-2000 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands # Determine if "long int" type is a 32 bit number and if the wide # type is a 64 bit number on this machine. testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}] testConstraint wideIs64bit [expr {wide(0x8000000000000000) < 0}] # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) binary scan \x00\x00\x00\x00\x00\x00\xF8\xFF d \ ieeeValues(-NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) binary scan \xFF\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] # procedures used below proc put_hello_char {c} { global a append a [format %c $c] return $c } proc hello_world {} { global a set a "" set L1 [set l0 [set h_1 [set q 0]]] for {put_hello_char [expr [put_hello_char [expr [set h 7]*10+2]]+29]} {$l0?[put_hello_char $l0] :!$h_1} {put_hello_char $ll;expr {$L1==2?[set ll [expr 32+0-0+[set bar 0]]]:0}} {expr {[incr L1]==[expr 1+([string length "abc"]-[string length "abc"])] ?[set ll [set l0 [expr 54<<1]]]:$ll==108&&$L1<3? [incr ll [expr 1|1<<1]; set ll $ll; set ll $ll; set ll $ll; set ll $ll; set l0 [expr ([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])]; set l0; set l0 $l0; set l0; set l0]:$L1==4&&$ll==32?[set ll [expr 19+$h1+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+[set foo [expr ([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])]]]] :[set q [expr $q-$h1+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])]]};expr {$L1==5?[incr ll -8; set ll $ll; set ll]:$q&&$h1&&1};expr {$L1==4+2 ?[incr ll 3]:[expr ([string length "abc"]-[string length "abc"])+1]};expr {$ll==($h<<4)+2+0&&$L1!=6?[incr ll -6]:[set h1 [expr 100+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])]]} expr {$L1!=1<<3?[incr q [expr ([string length "abc"]-[string length "abc"])-1]]:[set h_1 [set ll $h1]]} } set a } proc 12days {a b c} { global xxx expr {1<$a?[expr {$a<3?[12days -79 -13 [string range $c [12days -87 \ [expr 1-$b] [string range $c [12days -86 0 [string range $c 1 end]] \ end]] end]]:1};expr {$a<$b?[12days [expr $a+1] $b $c]:3};expr {[12days \ -94 [expr $a-27] $c]&&$a==2?$b<13?[12days 2 [expr $b+1] "%s %d %d\n"]:9 :16}]:$a<0?$a<-72?[12days $b $a "@n'+,#'/*\{\}w+/w#cdnr/+,\{\}r/*de\}+,/*\{*+,/w\{%+,/w#q#n+,/#\{l+,/n\{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,\}\{w+K w'K:'+\}e#';dq#'l q#'+d'K#!/+k#;q#'r\}eKK#\}w'r\}eKK\{nl\]'/#;#q#n')\{)#\}w')\{)\{nl\]'/+#n';d\}rw' i;# )\{nl\]!/n\{n#'; r\{#w'r nc\{nl\]'/#\{l,+'K \{rw' iK\{;\[\{nl\]'/w#q#n'wk nw' iwk\{KK\{nl\]!/w\{%'l##w#' i; :\{nl\]'/*\{q#'ld;r'\}\{nlwb!/*de\}'c ;;\{nl'-\{\}rw\]'/+,\}##'*\}#nc,',#nw\]'/+kd'+e\}+;#'rdq#w! nr'/ ') \}+\}\{rl#'\{n' ')# \}'+\}##(!!/"] :$a<-50?[string compare [format %c $b] [string index $c 0]]==0?[append \ xxx [string index $c 31];scan [string index $c 31] %c x;set x] :[12days -65 $b [string range $c 1 end]]:[12days [expr ([string compare \ [string index $c 0] "/"]==0)+$a] $b [string range $c 1 end]]:0<$a ?[12days 2 2 "%s"]:[string compare [string index $c 0] "/"]==0|| [12days 0 [12days -61 [scan [string index $c 0] %c x; set x] \ "!ek;dc i@bK'(q)-\[w\]*%n+r3#l,\{\}:\nuwloca-O;m .vpbks,fxntdCeghiry"] \ [string range $c 1 end]]} } proc do_twelve_days {} { global xxx set xxx "" 12days 1 1 1 set result [string length $xxx] unset xxx return $result } # start of tests catch {unset a b i x} test expr-1.1 {TclCompileExprCmd: no expression} -body { expr } -returnCodes error -result {wrong # args: should be "expr arg ?arg ...?"} test expr-1.2 {TclCompileExprCmd: one expression word} { expr -25 } -25 test expr-1.3 {TclCompileExprCmd: two expression words} { expr -8.2 -6 } -14.2 test expr-1.4 {TclCompileExprCmd: five expression words} { expr 20 - 5 +10 -7 } 18 test expr-1.5 {TclCompileExprCmd: quoted expression word} { expr "0005" } 5 test expr-1.6 {TclCompileExprCmd: quoted expression word} { catch {expr "0005"zxy} msg set msg } {extra characters after close-quote} test expr-1.7 {TclCompileExprCmd: expression word in braces} { expr {-0005} } -5 test expr-1.8 {TclCompileExprCmd: expression word in braces} { expr {{-0x1234}} } -4660 test expr-1.9 {TclCompileExprCmd: expression word in braces} { catch {expr {-0005}foo} msg set msg } {extra characters after close-brace} test expr-1.10 {TclCompileExprCmd: other expression word in braces} { expr 4*[llength "6 2"] } 8 test expr-1.11 {TclCompileExprCmd: expression word terminated by ;} { expr 4*[llength "6 2"]; } 8 test expr-1.12 {TclCompileExprCmd: inlined expr (in "catch") inside other catch} { set a xxx catch { # Might not be a number set a [expr 10*$a] } } 1 test expr-1.13 {TclCompileExprCmd: second level of substitutions in expr not in braces with single var reference} { set a xxx set x 27; set bool {$x}; if $bool {set a foo} set a } foo test expr-1.14 {TclCompileExprCmd: second level of substitutions in expr with comparison as top-level operator} { set a xxx set x 2; set b {$x}; set a [expr $b==2] set a } 1 test expr-1.15 {TclCompileExprCmd: second level of substitutions in expr with comparison as top-level operator} { set a xxx set x 2; set b {$x}; set a [expr "$b eq 2"] set a } 1 test expr-2.1 {TclCompileExpr: are builtin functions registered?} { expr double(5*[llength "6 2"]) } 10.0 test expr-2.2 {TclCompileExpr: error in expr} -body { expr 2***3 } -returnCodes error -match glob -result * test expr-2.3 {TclCompileExpr: junk after legal expr} -body { expr 7*[llength "a b"]foo } -returnCodes error -match glob -result * test expr-2.4 {TclCompileExpr: numeric expr string rep == formatted int rep} { expr {0001} } 1 test expr-3.1 {CompileCondExpr: just lor expr} {expr 3||0} 1 test expr-3.2 {CompileCondExpr: error in lor expr} -body { expr x||3 } -returnCodes error -match glob -result * test expr-3.3 {CompileCondExpr: test true arm} {expr 3>2?44:66} 44 test expr-3.4 {CompileCondExpr: error compiling true arm} -body { expr 3>2?2***3:66 } -returnCodes error -match glob -result * test expr-3.5 {CompileCondExpr: test false arm} {expr 2>3?44:66} 66 test expr-3.6 {CompileCondExpr: error compiling false arm} -body { expr 2>3?44:2***3 } -returnCodes error -match glob -result * test expr-3.7 {CompileCondExpr: long arms & nested cond exprs} { hello_world } {Hello world} test expr-3.8 {CompileCondExpr: long arms & nested cond exprs} unix { # Fails with a stack overflow on threaded Windows builds do_twelve_days } 2358 test expr-4.1 {CompileLorExpr: just land expr} {expr 1.3&&3.3} 1 test expr-4.2 {CompileLorExpr: error in land expr} -body { expr x&&3 } -returnCodes error -match glob -result * test expr-4.3 {CompileLorExpr: simple lor exprs} {expr 0||1.0} 1 test expr-4.4 {CompileLorExpr: simple lor exprs} {expr 3.0||0.0} 1 test expr-4.5 {CompileLorExpr: simple lor exprs} {expr 0||0||1} 1 test expr-4.6 {CompileLorExpr: error compiling lor arm} -body { expr 2***3||4.0 } -returnCodes error -match glob -result * test expr-4.7 {CompileLorExpr: error compiling lor arm} -body { expr 1.3||2***3 } -returnCodes error -match glob -result * test expr-4.8 {CompileLorExpr: error compiling lor arms} { list [catch {expr {"a"||"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-4.9 {CompileLorExpr: long lor arm} { set a "abcdefghijkl" set i 7 expr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} } 1 test expr-4.10 {CompileLorExpr: error compiling ! operand} { list [catch {expr {!"a"}} msg] $msg } {1 {cannot use non-numeric string "a" as operand of "!"}} test expr-4.11 {CompileLorExpr: error compiling land arms} { list [catch {expr {"a"||0}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-4.12 {CompileLorExpr: error compiling land arms} { list [catch {expr {0||"a"}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-5.1 {CompileLandExpr: just bitor expr} {expr 7|0x13} 23 test expr-5.2 {CompileLandExpr: error in bitor expr} -body { expr x|3 } -returnCodes error -match glob -result * test expr-5.3 {CompileLandExpr: simple land exprs} {expr 0&&1.0} 0 test expr-5.4 {CompileLandExpr: simple land exprs} {expr 0&&0} 0 test expr-5.5 {CompileLandExpr: simple land exprs} {expr 3.0&&1.2} 1 test expr-5.6 {CompileLandExpr: simple land exprs} {expr 1&&1&&2} 1 test expr-5.7 {CompileLandExpr: error compiling land arm} -body { expr 2***3&&4.0 } -returnCodes error -match glob -result * test expr-5.8 {CompileLandExpr: error compiling land arm} -body { expr 1.3&&2***3 } -returnCodes error -match glob -result * test expr-5.9 {CompileLandExpr: error compiling land arm} { list [catch {expr {"a"&&"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-5.10 {CompileLandExpr: long land arms} { set a "abcdefghijkl" set i 7 expr {[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]} } 1 test expr-6.1 {CompileBitXorExpr: just bitand expr} {expr 7&0x13} 3 test expr-6.2 {CompileBitXorExpr: error in bitand expr} -body { expr x|3 } -returnCodes error -match glob -result * test expr-6.3 {CompileBitXorExpr: simple bitxor exprs} {expr 7^0x13} 20 test expr-6.4 {CompileBitXorExpr: simple bitxor exprs} {expr 3^0x10} 19 test expr-6.5 {CompileBitXorExpr: simple bitxor exprs} {expr 0^7} 7 test expr-6.6 {CompileBitXorExpr: simple bitxor exprs} {expr -1^7} -8 test expr-6.7 {CompileBitXorExpr: error compiling bitxor arm} -body { expr 2***3|6 } -returnCodes error -match glob -result * test expr-6.8 {CompileBitXorExpr: error compiling bitxor arm} -body { expr 2^x } -returnCodes error -match glob -result * test expr-6.9 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {24.0^3}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "^"}} test expr-6.10 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {"a"^"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "^"}} test expr-7.1 {CompileBitAndExpr: just equality expr} {expr 3==2} 0 test expr-7.2 {CompileBitAndExpr: just equality expr} {expr 2.0==2} 1 test expr-7.3 {CompileBitAndExpr: just equality expr} {expr 3.2!=2.2} 1 test expr-7.4 {CompileBitAndExpr: just equality expr} {expr {"abc" == "abd"}} 0 test expr-7.5 {CompileBitAndExpr: error in equality expr} -body { expr x==3 } -returnCodes error -match glob -result * test expr-7.6 {CompileBitAndExpr: simple bitand exprs} {expr 7&0x13} 3 test expr-7.7 {CompileBitAndExpr: simple bitand exprs} {expr 0xf2&0x53} 82 test expr-7.8 {CompileBitAndExpr: simple bitand exprs} {expr 3&6} 2 test expr-7.9 {CompileBitAndExpr: simple bitand exprs} {expr -1&-7} -7 test expr-7.10 {CompileBitAndExpr: error compiling bitand arm} -body { expr 2***3&6 } -returnCodes error -match glob -result * test expr-7.11 {CompileBitAndExpr: error compiling bitand arm} -body { expr 2&x } -returnCodes error -match glob -result * test expr-7.12 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {24.0&3}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "&"}} test expr-7.13 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {"a"&"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "&"}} test expr-7.14 {CompileBitAndExpr: equality expr} {expr 3eq2} 0 test expr-7.18 {CompileBitAndExpr: equality expr} {expr {"abc" eq "abd"}} 0 test expr-7.20 {CompileBitAndExpr: error in equality expr} -body { expr xne3 } -returnCodes error -match glob -result * test expr-8.1 {CompileEqualityExpr: just relational expr} {expr 3>=2} 1 test expr-8.2 {CompileEqualityExpr: just relational expr} {expr 2<=2.1} 1 test expr-8.3 {CompileEqualityExpr: just relational expr} {expr 3.2>"2.2"} 1 test expr-8.4 {CompileEqualityExpr: just relational expr} {expr {"0y"<"0x12"}} 0 test expr-8.5 {CompileEqualityExpr: error in relational expr} -body { expr x>3 } -returnCodes error -match glob -result * test expr-8.6 {CompileEqualityExpr: simple equality exprs} {expr 7==0x13} 0 test expr-8.7 {CompileEqualityExpr: simple equality exprs} {expr -0xf2!=0x53} 1 test expr-8.8 {CompileEqualityExpr: simple equality exprs} {expr {"12398712938788234-1298379" != ""}} 1 test expr-8.9 {CompileEqualityExpr: simple equality exprs} {expr -1!="abc"} 1 test expr-8.10 {CompileEqualityExpr: error compiling equality arm} -body { expr 2***3==6 } -returnCodes error -match glob -result * test expr-8.11 {CompileEqualityExpr: error compiling equality arm} -body { expr 2!=x } -returnCodes error -match glob -result * test expr-8.12 {CompileBitAndExpr: equality expr} {expr {"a"eq"a"}} 1 test expr-8.13 {CompileBitAndExpr: equality expr} {expr {"\374" eq [set s \xFC]}} 1 test expr-8.14 {CompileBitAndExpr: equality expr} {expr 3eq2} 0 test expr-8.15 {CompileBitAndExpr: equality expr} {expr 2.0eq2} 0 test expr-8.16 {CompileBitAndExpr: equality expr} {expr 3.2ne2.2} 1 test expr-8.17 {CompileBitAndExpr: equality expr} {expr 01eq1} 0 test expr-8.18 {CompileBitAndExpr: equality expr} {expr {"abc" eq "abd"}} 0 test expr-8.19 {CompileBitAndExpr: equality expr} {expr {"abc" ne "abd"}} 1 test expr-8.20 {CompileBitAndExpr: error in equality expr} -body { expr x ne3 } -returnCodes error -match glob -result * test expr-8.21 {CompileBitAndExpr: error in equality expr} -body { # These should be ""ed to avoid the error expr a eq b } -returnCodes error -match glob -result * test expr-8.22 {CompileBitAndExpr: error in equality expr} -body { expr {false eqfalse} } -returnCodes error -match glob -result * test expr-8.23 {CompileBitAndExpr: error in equality expr} -body { expr {false nefalse} } -returnCodes error -match glob -result * test expr-8.24 {CompileEqualityExpr: simple equality exprs} { set x 12398712938788234 expr {$x == 100} } 0 test expr-8.25 {CompileEqualityExpr: simple equality exprs} { expr {"0x12 " == "0x12"} } 1 test expr-8.26 {CompileEqualityExpr: simple equality exprs} { expr {"0x12 " eq "0x12"} } 0 test expr-8.27 {CompileEqualityExpr: simple equality exprs} { expr {"1.0e100000000" == "0.0"} } 0 test expr-8.28 {CompileEqualityExpr: just relational expr} { expr {"0y" == "0x0"} } 0 test expr-8.29 {CompileEqualityExpr: just relational expr} { # Compare original strings from variables. set v1 "0y" set v2 "0x12" expr {$v1 < $v2} } 0 test expr-8.30 {CompileEqualityExpr: simple equality exprs} { expr {"fake" != "bob"} } 1 test expr-8.31 {expr edge cases} -body { expr {1e} } -returnCodes error -match glob -result * test expr-8.32 {expr edge cases} -body { expr {1E} } -returnCodes error -match glob -result * test expr-8.33 {expr edge cases} -body { expr {1e+} } -returnCodes error -match glob -result * test expr-8.34 {expr edge cases} -body { expr {1E+} } -returnCodes error -match glob -result * test expr-8.35 {expr edge cases} -body { expr {1ea} } -returnCodes error -match glob -result * test expr-8.36 {CompileEqualtyExpr: string comparison ops} { set x 012 set y 0x0 list [expr {$x < $y}] [expr {$x lt $y}] [expr {$x lt $x}] } {0 1 0} test expr-8.37 {CompileEqualtyExpr: string comparison ops} { set x 012 set y 0x0 list [expr {$x <= $y}] [expr {$x le $y}] [expr {$x le $x}] } {0 1 1} test expr-8.38 {CompileEqualtyExpr: string comparison ops} { set x 012 set y 0x0 list [expr {$x > $y}] [expr {$x gt $y}] [expr {$x gt $x}] } {1 0 0} test expr-8.39 {CompileEqualtyExpr: string comparison ops} { set x 012 set y 0x0 list [expr {$x >= $y}] [expr {$x ge $y}] [expr {$x ge $x}] } {1 0 1} test expr-9.1 {CompileRelationalExpr: just shift expr} {expr 3<<2} 12 test expr-9.2 {CompileRelationalExpr: just shift expr} {expr 0xff>>2} 63 test expr-9.3 {CompileRelationalExpr: just shift expr} {expr -1>>2} -1 test expr-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8 test expr-9.5 {CompileRelationalExpr: shift expr producing LONG_MIN} { expr {int(1<<63)} } 9223372036854775808 test expr-9.6 {CompileRelationalExpr: error in shift expr} -body { expr x>>3 } -returnCodes error -match glob -result * test expr-9.7 {CompileRelationalExpr: simple relational exprs} {expr 0xff>=+0x3} 1 test expr-9.8 {CompileRelationalExpr: simple relational exprs} {expr -0xf2<0x3} 1 test expr-9.9 {CompileRelationalExpr: error compiling relational arm} -body { expr 2***3>6 } -returnCodes error -match glob -result * test expr-9.10 {CompileRelationalExpr: error compiling relational arm} -body { expr 2>0x3} 31 test expr-10.7 {CompileShiftExpr: simple shift exprs} {expr -0xf2<<0x3} -1936 test expr-10.8 {CompileShiftExpr: error compiling shift arm} -body { expr 2***3>>6 } -returnCodes error -match glob -result * test expr-10.9 {CompileShiftExpr: error compiling shift arm} -body { expr 2<>43}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of ">>"}} test expr-10.11 {CompileShiftExpr: runtime error} { list [catch {expr {"a"<<"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "<<"}} test expr-11.1 {CompileAddExpr: just multiply expr} {expr 4*-2} -8 test expr-11.2 {CompileAddExpr: just multiply expr} {expr 0xff%2} 1 test expr-11.3 {CompileAddExpr: just multiply expr} {expr -1/2} -1 test expr-11.4 {CompileAddExpr: just multiply expr} {expr 7891%0o123} 6 test expr-11.5 {CompileAddExpr: error in multiply expr} -body { expr x*3 } -returnCodes error -match glob -result * test expr-11.6 {CompileAddExpr: simple add exprs} {expr 0xff++0x3} 258 test expr-11.7 {CompileAddExpr: simple add exprs} {expr -0xf2--0x3} -239 test expr-11.8 {CompileAddExpr: error compiling add arm} -body { expr 2***3+6 } -returnCodes error -match glob -result * test expr-11.9 {CompileAddExpr: error compiling add arm} -body { expr 2-x } -returnCodes error -match glob -result * test expr-11.10 {CompileAddExpr: runtime error} { list [catch {expr {24.0+"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "+"}} test expr-11.11 {CompileAddExpr: runtime error} { list [catch {expr {"a"-"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "-"}} test expr-11.12 {CompileAddExpr: runtime error} { list [catch {expr {3/0}} msg] $msg } {1 {divide by zero}} test expr-11.13a {CompileAddExpr: runtime error} !ieeeFloatingPoint { list [catch {expr {2.3/0.0}} msg] $msg } {1 {divide by zero}} test expr-11.13b {CompileAddExpr: runtime error} ieeeFloatingPoint { list [catch {expr {2.3/0.0}} msg] $msg } {0 Inf} test expr-11.14 {CompileAddExpr: runtime error} { list [catch {expr {24.0+[lseq 2 4]}} msg] $msg } {1 {cannot use a list as right operand of "+"}} test expr-11.15 {CompileAddExpr: runtime error} { list [catch {expr {{1 2 "}+24.0}} msg] $msg } {1 {cannot use non-numeric string "1 2 "" as left operand of "+"}} test expr-11.16 {CompileAddExpr: runtime error} { list [catch {expr {~[dict create foo bar]}} msg] $msg } {1 {cannot use a list as operand of "~"}} test expr-12.1 {CompileMultiplyExpr: just unary expr} {expr ~4} -5 test expr-12.2 {CompileMultiplyExpr: just unary expr} {expr --5} 5 test expr-12.3 {CompileMultiplyExpr: just unary expr} {expr !27} 0 test expr-12.4 {CompileMultiplyExpr: just unary expr} {expr ~0xff00ff} -16711936 test expr-12.5 {CompileMultiplyExpr: error in unary expr} -body { expr ~x } -returnCodes error -match glob -result * test expr-12.6 {CompileMultiplyExpr: simple multiply exprs} {expr 0xff*0x3} 765 test expr-12.7 {CompileMultiplyExpr: simple multiply exprs} {expr -0xf2%-0x3} -2 test expr-12.8 {CompileMultiplyExpr: error compiling multiply arm} -body { expr 2*3%%6 } -returnCodes error -match glob -result * test expr-12.9 {CompileMultiplyExpr: error compiling multiply arm} -body { expr 2*x } -returnCodes error -match glob -result * test expr-12.10 {CompileMultiplyExpr: runtime error} { list [catch {expr {24.0*"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "*"}} test expr-12.11 {CompileMultiplyExpr: runtime error} { list [catch {expr {"a"/"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "/"}} test expr-13.1 {CompileUnaryExpr: unary exprs} {expr -0xff} -255 test expr-13.2 {CompileUnaryExpr: unary exprs} {expr +0o00123} 83 test expr-13.3 {CompileUnaryExpr: unary exprs} {expr +--++36} 36 test expr-13.4 {CompileUnaryExpr: unary exprs} {expr !2} 0 test expr-13.5 {CompileUnaryExpr: unary exprs} {expr +--+-62.0} -62.0 test expr-13.6 {CompileUnaryExpr: unary exprs} {expr !0.0} 1 test expr-13.7 {CompileUnaryExpr: unary exprs} {expr !0xef} 0 test expr-13.8 {CompileUnaryExpr: error compiling unary expr} -body { expr ~x } -returnCodes error -match glob -result * test expr-13.9 {CompileUnaryExpr: error compiling unary expr} -body { expr !1.x } -returnCodes error -match glob -result * test expr-13.10 {CompileUnaryExpr: runtime error} { list [catch {expr {~"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as operand of "~"}} test expr-13.11 {CompileUnaryExpr: runtime error} { list [catch {expr ~4.0} msg] $msg } {1 {cannot use floating-point value "4.0" as operand of "~"}} test expr-13.12 {CompileUnaryExpr: just primary expr} {expr 0x123} 291 test expr-13.13 {CompileUnaryExpr: just primary expr} { set a 27 expr $a } 27 test expr-13.14 {CompileUnaryExpr: just primary expr} { expr double(27) } 27.0 test expr-13.15 {CompileUnaryExpr: just primary expr} {expr "123"} 123 test expr-13.16 {CompileUnaryExpr: error in primary expr} { catch {expr [set]} msg set msg } {wrong # args: should be "set varName ?newValue?"} test expr-13.17 {CompileUnaryExpr: negating non-numeric boolean literals} { set a1 yes; set a0 no; set b1 true; set b0 false list [expr {!$a1}] [expr {!$a0}] [expr {!$b1}] [expr {!$b0}] } {0 1 0 1} test expr-14.1 {CompilePrimaryExpr: literal primary} {expr 1} 1 test expr-14.2 {CompilePrimaryExpr: literal primary} {expr 123} 123 test expr-14.3 {CompilePrimaryExpr: literal primary} {expr 0xff} 255 test expr-14.4 {CompilePrimaryExpr: literal primary} {expr 0o0010} 8 test expr-14.5 {CompilePrimaryExpr: literal primary} {expr 62.0} 62.0 test expr-14.6 {CompilePrimaryExpr: literal primary} { expr 3.1400000 } 3.14 test expr-14.7 {CompilePrimaryExpr: literal primary} {expr {{abcde}<{abcdef}}} 1 test expr-14.8 {CompilePrimaryExpr: literal primary} {expr {{abc\ def} < {abcdef}}} 1 test expr-14.9 {CompilePrimaryExpr: literal primary} {expr {{abc\tde} > {abc\tdef}}} 0 test expr-14.10 {CompilePrimaryExpr: literal primary} {expr {{123}}} 123 test expr-14.11 {CompilePrimaryExpr: var reference primary} { set i 789 list [expr {$i}] [expr $i] } {789 789} test expr-14.12 {CompilePrimaryExpr: var reference primary} { set i {789} ;# test expr's aggressive conversion to numeric semantics list [expr {$i}] [expr $i] } {789 789} test expr-14.13 {CompilePrimaryExpr: var reference primary} { catch {unset a} set a(foo) foo set a(bar) bar set a(123) 123 set result "" lappend result [expr $a(123)] [expr {$a(bar)<$a(foo)}] catch {unset a} set result } {123 1} test expr-14.14 {CompilePrimaryExpr: var reference primary} { set i 123 ;# test "$var.0" floating point conversion hack list [expr $i] [expr $i.0] [expr $i.0/12.0] } {123 123.0 10.25} test expr-14.15 {CompilePrimaryExpr: var reference primary} { set i 123 catch {expr $i.2} msg set msg } 123.2 test expr-14.16 {CompilePrimaryExpr: error compiling var reference primary} -body { expr {$a(foo} } -returnCodes error -match glob -result * test expr-14.17 {CompilePrimaryExpr: string primary that looks like var ref} -body { expr $ } -returnCodes error -match glob -result * test expr-14.18 {CompilePrimaryExpr: quoted string primary} { expr "21" } 21 test expr-14.19 {CompilePrimaryExpr: quoted string primary} { set i 123 set x 456 expr "$i+$x" } 579 test expr-14.20 {CompilePrimaryExpr: quoted string primary} { set i 3 set x 6 expr 2+"$i.$x" } 5.6 test expr-14.21 {CompilePrimaryExpr: error in quoted string primary} { catch {expr "[set]"} msg set msg } {wrong # args: should be "set varName ?newValue?"} test expr-14.22 {CompilePrimaryExpr: subcommand primary} { expr {[set i 123; set i]} } 123 test expr-14.23 {CompilePrimaryExpr: error in subcommand primary} -body { catch {expr {[set]}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test expr-14.24 {CompilePrimaryExpr: error in subcommand primary} -body { expr {[set i} } -returnCodes error -match glob -result * test expr-14.25 {CompilePrimaryExpr: math function primary} { format %.6g [expr exp(1.0)] } 2.71828 test expr-14.26 {CompilePrimaryExpr: math function primary} { format %.6g [expr pow(2.0+0.1,3.0+0.1)] } 9.97424 test expr-14.27 {CompilePrimaryExpr: error in math function primary} -body { expr sinh::(2.0) } -returnCodes error -match glob -result * test expr-14.28 {CompilePrimaryExpr: subexpression primary} { expr 2+(3*4) } 14 test expr-14.29 {CompilePrimaryExpr: error in subexpression primary} -body { catch {expr 2+(3*[set])} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test expr-14.30 {CompilePrimaryExpr: missing paren in subexpression primary} -body { expr 2+(3*(4+5) } -returnCodes error -match glob -result * test expr-14.31 {CompilePrimaryExpr: just var ref in subexpression primary} { set i "5+10" list "[expr $i] == 15" "[expr ($i)] == 15" "[eval expr ($i)] == 15" } {{15 == 15} {15 == 15} {15 == 15}} test expr-14.32 {CompilePrimaryExpr: unexpected token} -body { expr @ } -returnCodes error -match glob -result * test expr-15.1 {CompileMathFuncCall: missing parenthesis} -body { expr sinh2.0) } -returnCodes error -match glob -result * test expr-15.2 {CompileMathFuncCall: unknown math function} -body { catch {expr whazzathuh(1)} msg set ::errorInfo } -match glob -result {* "*whazzathuh" while *ing "expr whazzathuh(1)"} test expr-15.3 {CompileMathFuncCall: too many arguments} -body { catch {expr sin(1,2,3)} msg set ::errorInfo } -match glob -result {too many arguments for math function* while *ing "expr sin(1,2,3)"} test expr-15.4 {CompileMathFuncCall: ')' found before last required arg} -body { catch {expr sin()} msg set ::errorInfo } -match glob -result {not enough arguments for math function* while *ing "expr sin()"} test expr-15.5 {CompileMathFuncCall: not enough arguments} -body { catch {expr pow(1)} msg set ::errorInfo } -match glob -result {not enough arguments for math function* while *ing "expr pow(1)"} test expr-15.6 {CompileMathFuncCall: missing ')'} -body { expr sin(1 } -returnCodes error -match glob -result * test expr-16.1 {GetToken: checks whether integer token starting with "0x" (e.g., "0x$") is invalid} { catch {unset a} set a(VALUE) ff15 set i 123 if {[expr 0x$a(VALUE)] & 16} { set i {} } set i } {} test expr-16.2 {GetToken: check for string literal in braces} { expr {{1}} } {1} # Check "expr" and computed command names. test expr-17.1 {expr and computed command names} { set i 0 set z expr $z 1+2 } 3 # Check correct conversion of operands to numbers: If the string looks like # an integer, convert to integer. Otherwise, if the string looks like a # double, convert to double. test expr-18.1 {expr and conversion of operands to numbers} { set x [lindex 11 0] catch {expr int($x)} expr {$x} } 11 test expr-18.2 {whitespace strings should not be == 0 (buggy strtol/strtoul)} { expr {" "} } { } # Check "expr" and interpreter result object resetting before appending # an error msg during evaluation of exprs not in {}s test expr-19.1 {expr and interpreter result object resetting} { proc p {} { set t 10.0 set x 2.0 set dx 0.2 set f {$dx-$x/10} set g {-$x/5} set center 1.0 set x [expr $x-$center] set dx [expr $dx+$g] set x [expr $x+$f+$center] set x [expr $x+$f+$center] set y [expr round($x)] } p } 3 # Test for incorrect "double evaluation" semantics test expr-20.1 {wrong brace matching} { catch {unset l} catch {unset r} catch {unset q} catch {unset cmd} catch {unset a} set l "\{"; set r "\}"; set q "\"" set cmd "expr $l$q|$q == $q$r$q$r" list [catch $cmd a] $a } {1 {extra characters after close-brace}} test expr-20.2 {double invocation of variable traces} -body { set exprtracecounter 0 proc exprtraceproc {args} { upvar #0 exprtracecounter counter set argc [llength $args] set extraargs [lrange $args 0 [expr {$argc - 4}]] set name [lindex $args [expr {$argc - 3}]] upvar 1 $name var if {[incr counter] % 2 == 1} { set var "$counter oops [concat $extraargs]" } else { set var "$counter + [concat $extraargs]" } } trace add variable exprtracevar read [list exprtraceproc 10] list [catch {expr "$exprtracevar + 20"} a] $a \ [catch {expr "$exprtracevar + 20"} b] $b \ [unset exprtracevar exprtracecounter] } -match glob -result {1 * 0 32 {}} test expr-20.3 {broken substitution of integer digits} { # fails with 8.0.x, but not 8.1b2 list [set a 000; expr 0x1$a] [set a 1; expr ${a}000] } {4096 1000} test expr-20.4 {proper double evaluation compilation, error case} { catch {unset a}; # make sure $a doesn't exist list [catch {expr 1?{$a}:0} msg] $msg } {1 {can't read "a": no such variable}} test expr-20.5 {proper double evaluation compilation, working case} { set a yellow expr 1?{$a}:0 } yellow test expr-20.6 {handling of compile error in trial compile} { list [catch {expr + {[incr]}} msg] $msg } {1 {wrong # args: should be "incr varName ?increment?"}} test expr-20.7 {handling of compile error in runtime case} { list [catch {expr + {[error foo]}} msg] $msg } {1 foo} # Test for non-numeric boolean literal handling test expr-21.1 {non-numeric boolean literals} {expr false } false test expr-21.2 {non-numeric boolean literals} {expr true } true test expr-21.3 {non-numeric boolean literals} {expr off } off test expr-21.4 {non-numeric boolean literals} {expr on } on test expr-21.5 {non-numeric boolean literals} {expr no } no test expr-21.6 {non-numeric boolean literals} {expr yes } yes test expr-21.7 {non-numeric boolean literals} {expr !false} 1 test expr-21.8 {non-numeric boolean literals} {expr !true } 0 test expr-21.9 {non-numeric boolean literals} {expr !off } 1 test expr-21.10 {non-numeric boolean literals} {expr !on } 0 test expr-21.11 {non-numeric boolean literals} {expr !no } 1 test expr-21.12 {non-numeric boolean literals} {expr !yes } 0 test expr-21.13 {non-numeric boolean literals} -body { expr !truef } -returnCodes error -match glob -result * test expr-21.14 {non-numeric boolean literals} { list [catch {expr !"truef"} err] $err } {1 {cannot use non-numeric string "truef" as operand of "!"}} test expr-21.15 {non-numeric boolean variables} { set v truef list [catch {expr {!$v}} err] $err } {1 {cannot use non-numeric string "truef" as operand of "!"}} test expr-21.16 {non-numeric boolean variables} { set v "true " list [catch {expr {!$v}} err] $err } {1 {cannot use non-numeric string "true " as operand of "!"}} test expr-21.17 {non-numeric boolean variables} { set v "tru" list [catch {expr {!$v}} err] $err } {0 0} test expr-21.18 {non-numeric boolean variables} { set v "fal" list [catch {expr {!$v}} err] $err } {0 1} test expr-21.19 {non-numeric boolean variables} { set v "y" list [catch {expr {!$v}} err] $err } {0 0} test expr-21.20 {non-numeric boolean variables} { set v "of" list [catch {expr {!$v}} err] $err } {0 1} test expr-21.21 {non-numeric boolean variables} { set v "o" list [catch {expr {!$v}} err] $err } {1 {cannot use non-numeric string "o" as operand of "!"}} test expr-21.22 {non-numeric boolean variables} { set v "" list [catch {expr {!$v}} err] $err } {1 {cannot use non-numeric string "" as operand of "!"}} # Test for non-numeric float handling. test expr-22.1 {non-numeric floats} { list [catch {expr {NaN + 1}} msg] $msg } {1 {cannot use non-numeric floating-point value "NaN" as left operand of "+"}} test expr-22.2 {non-numeric floats} !ieeeFloatingPoint { list [catch {expr {Inf + 1}} msg] $msg } {1 {can't use infinite floating-point value as operand of "+"}} test expr-22.3 {non-numeric floats} { set nan NaN list [catch {expr {$nan + 1}} msg] $msg } {1 {cannot use non-numeric floating-point value "NaN" as left operand of "+"}} test expr-22.4 {non-numeric floats} !ieeeFloatingPoint { set inf Inf list [catch {expr {$inf + 1}} msg] $msg } {1 {can't use infinite floating-point value as operand of "+"}} test expr-22.5 {non-numeric floats} { list [catch {expr NaN} msg] $msg } {1 {domain error: argument not in valid range}} test expr-22.6 {non-numeric floats} !ieeeFloatingPoint { list [catch {expr Inf} msg] $msg } {1 {floating-point value too large to represent}} test expr-22.7 {non-numeric floats} { list [catch {expr {1 / NaN}} msg] $msg } {1 {cannot use non-numeric floating-point value "NaN" as right operand of "/"}} test expr-22.8 {non-numeric floats} !ieeeFloatingPoint { list [catch {expr {1 / Inf}} msg] $msg } {1 {can't use infinite floating-point value as operand of "/"}} # Make sure [Bug 761471] stays fixed. test expr-22.9 {non-numeric floats: shared object equality and NaN} { set x NaN expr {$x == $x} } 0 # Make sure [Bug d0f7ba56f0] stays fixed. test expr-22.10 {non-numeric arguments: equality and NaN} { set x NaN expr {$x > "Gran"} } 1 test expr-22.11 {non-numeric arguments: equality and NaN} { set x NaN expr {"Gran" < $x} } 1 # Tests for exponentiation handling test expr-23.1 {CompileExponentialExpr: just exponential expr} {expr 4**2} 16 test expr-23.2 {CompileExponentialExpr: just exponential expr} {expr 0xff**2} 65025 test expr-23.3 {CompileExponentialExpr: just exponential expr} {expr -1**2} 1 test expr-23.4 {CompileExponentialExpr: just exponential expr} {expr 18**07} 612220032 test expr-23.5 {CompileExponentialExpr: error in exponential expr} -body { expr x**3 } -returnCodes error -match glob -result * test expr-23.6 {CompileExponentialExpr: simple expo exprs} {expr 0xff**0x3} 16581375 test expr-23.7 {CompileExponentialExpr: error compiling expo arm} -body { expr (-3-)**6 } -returnCodes error -match glob -result * test expr-23.8 {CompileExponentialExpr: error compiling expo arm} -body { expr 2**x } -returnCodes error -match glob -result * test expr-23.9 {CompileExponentialExpr: runtime error} { list [catch {expr {24.0**"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "**"}} test expr-23.10 {CompileExponentialExpr: runtime error} { list [catch {expr {"a"**2}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "**"}} test expr-23.11 {CompileExponentialExpr: runtime error} { list [catch {expr {0**-1}} msg] $msg } {1 {exponentiation of zero by negative power}} test expr-23.12 {CompileExponentialExpr: runtime error} { list [catch {expr {0.0**-1.0}} msg] $msg } {1 {exponentiation of zero by negative power}} test expr-23.13 {CompileExponentialExpr: runtime error} { list [catch {expr {wide(0)**wide(-1)}} msg] $msg } {1 {exponentiation of zero by negative power}} test expr-23.14 {INST_EXPON: special cases} {expr {0**1}} 0 test expr-23.15 {INST_EXPON: special cases} {expr {0**0}} 1 test expr-23.16 {INST_EXPON: special cases} {expr {-2**-1}} 0 test expr-23.17 {INST_EXPON: special cases} {expr {-2**0}} 1 test expr-23.18 {INST_EXPON: special cases} {expr {-1**1}} -1 test expr-23.19 {INST_EXPON: special cases} {expr {-1**0}} 1 test expr-23.20 {INST_EXPON: special cases} {expr {-1**2}} 1 test expr-23.21 {INST_EXPON: special cases} {expr {-1**-1}} -1 test expr-23.22 {INST_EXPON: special cases} {expr {1**1234567}} 1 test expr-23.23 {INST_EXPON: special cases} {expr {2**-2}} 0 test expr-23.24 {INST_EXPON: special cases} {expr {wide(0)**wide(1)}} 0 test expr-23.25 {INST_EXPON: special cases} {expr {wide(0)**wide(0)}} 1 test expr-23.26 {INST_EXPON: special cases} {expr {wide(-2)**wide(-1)}} 0 test expr-23.27 {INST_EXPON: special cases} {expr {wide(-2)**wide(0)}} 1 test expr-23.28 {INST_EXPON: special cases} {expr {wide(-1)**wide(1)}} -1 test expr-23.29 {INST_EXPON: special cases} {expr {wide(-1)**wide(0)}} 1 test expr-23.30 {INST_EXPON: special cases} {expr {wide(-1)**wide(2)}} 1 test expr-23.31 {INST_EXPON: special cases} {expr {wide(-1)**wide(-1)}} -1 test expr-23.32 {INST_EXPON: special cases} {expr {wide(1)**wide(1234567)}} 1 test expr-23.33 {INST_EXPON: special cases} {expr {wide(2)**wide(-2)}} 0 test expr-23.34 {INST_EXPON: special cases} {expr {2**0}} 1 test expr-23.35 {INST_EXPON: special cases} {expr {wide(2)**0}} 1 test expr-23.36 {INST_EXPON: big integer} {expr {10**17}} 1[string repeat 0 17] test expr-23.37 {INST_EXPON: big integer} {expr {10**18}} 1[string repeat 0 18] test expr-23.38 {INST_EXPON: big integer} {expr {10**19}} 1[string repeat 0 19] test expr-23.39 {INST_EXPON: big integer} { expr 1[string repeat 0 30]**2 } 1[string repeat 0 60] test expr-23.40 {INST_EXPON: overflow to big integer} {expr {(-10)**3}} -1000 test expr-23.41 {INST_EXPON: overflow to big integer} {expr 2**64} [expr 1<<64] test expr-23.42 {INST_EXPON: overflow to big integer} {expr 4**32} [expr 1<<64] test expr-23.43 {INST_EXPON: overflow to big integer} {expr 16**16} [expr 1<<64] test expr-23.44 {INST_EXPON: overflow to big integer} {expr 256**8} [expr 1<<64] test expr-23.45 {INST_EXPON: Bug 1555371} {expr 2**1} 2 test expr-23.46 {INST_EXPON: Bug 1561260} -body { expr 5**28 } -match glob -result *5 test expr-23.47 {INST_EXPON: Bug 1561260} { expr 2**32*5**32 } 1[string repeat 0 32] test expr-23.48 {INST_EXPON: TIP 274: right assoc} { expr 2**3**4 } 2417851639229258349412352 test expr-23.49 {INST_EXPON: optimize powers of 2} { set trouble {test powers of 2} for {set tval 0} {$tval <= 66} {incr tval} { set is [expr {2 ** $tval}] set sb [expr {1 << $tval}] if {$is != $sb} { append trouble \n "2**" $tval " is " $is " should be " $sb } if {$tval >= 1} { set is [expr {-2 ** $tval}] set sb [expr {1 << $tval}] if {$tval & 1} { set sb [expr {-$sb}] } if {$is != $sb} { append trouble \n "-2**" $tval " is " $is " should be " $sb } } } set trouble } {test powers of 2} test expr-23.50 {INST_EXPON: small powers of 32-bit integers} { set trouble {test small powers of 32-bit ints} for {set base 3} {$base <= 45} {incr base} { set sb $base set sbm [expr {-$base}] for {set expt 2} {$expt <= 8} {incr expt} { set sb [expr {$sb * $base}] set is [expr {$base ** $expt}] if {$sb != $is} { append trouble \n $base ** $expt " is " $is " should be " $sb } set sbm [expr {-$sbm * $base}] set ism [expr {(-$base) ** $expt}] if {$sbm != $ism} { append trouble \n - $base ** $expt " is " $ism \ " should be " $sbm } } } set trouble } {test small powers of 32-bit ints} test expr-23.51 {INST_EXPON: intermediate powers of 32-bit integers} { set trouble {test intermediate powers of 32-bit ints} for {set base 3} {$base <= 11} {incr base} { set sb [expr {$base ** 8}] set sbm $sb for {set expt 9} {$expt <= 21} {incr expt} { set sb [expr {$sb * $base}] set sbm [expr {$sbm * -$base}] set is [expr {$base ** $expt}] set ism [expr {-$base ** $expt}] if {$sb != $is} { append trouble \n $base ** $expt " is " $is " should be " $sb } if {$sbm != $ism} { append trouble \n - $base ** $expt " is " $ism \ " should be " $sbm } } } set trouble } {test intermediate powers of 32-bit ints} test expr-23.52 {INST_EXPON: small integer powers with 64-bit results} { set trouble {test small int powers with 64-bit results} for {set exp 2} {$exp <= 16} {incr exp} { set base [expr {entier(pow(double(0x7fffffffffffffff),(1.0/$exp)))}] set sb 1 set sbm 1 for {set i 0} {$i < $exp} {incr i} { set sb [expr {$sb * $base}] set sbm [expr {$sbm * -$base}] } set is [expr {$base ** $exp}] set ism [expr {-$base ** $exp}] if {$sb != $is} { append trouble \n $base ** $exp " is " $is " should be " $sb } if {$sbm != $ism} { append trouble \n - $base ** $exp " is " $ism " should be " $sbm } incr base set sb 1 set sbm 1 for {set i 0} {$i < $exp} {incr i} { set sb [expr {$sb * $base}] set sbm [expr {$sbm * -$base}] } set is [expr {$base ** $exp}] set ism [expr {-$base ** $exp}] if {$sb != $is} { append trouble \n $base ** $exp " is " $is " should be " $sb } if {$sbm != $ism} { append trouble \n - $base ** $exp " is " $ism " should be " $sbm } } set trouble } {test small int powers with 64-bit results} test expr-23.53 {INST_EXPON: intermediate powers of 64-bit integers} { set trouble {test intermediate powers of 64-bit ints} for {set base 3} {$base <= 13} {incr base} { set sb [expr {$base ** 15}] set sbm [expr {-$sb}] for {set expt 16} {$expt <= 39} {incr expt} { set sb [expr {$sb * $base}] set sbm [expr {$sbm * -$base}] set is [expr {$base ** $expt}] set ism [expr {-$base ** $expt}] if {$sb != $is} { append trouble \n $base ** $expt " is " $is " should be " $sb } if {$sbm != $ism} { append trouble \n - $base ** $expt " is " $ism \ " should be " $sbm } } } set trouble } {test intermediate powers of 64-bit ints} test expr-23.54.0 {INST_EXPON: Bug 2798543} { expr {3**9 == 3**65545} } 0 test expr-23.54.1 {INST_EXPON: Bug 2798543} { expr {3**10 == 3**65546} } 0 test expr-23.54.2 {INST_EXPON: Bug 2798543} { expr {3**11 == 3**65547} } 0 test expr-23.54.3 {INST_EXPON: Bug 2798543} { expr {3**12 == 3**65548} } 0 test expr-23.54.4 {INST_EXPON: Bug 2798543} { expr {3**13 == 3**65549} } 0 test expr-23.54.5 {INST_EXPON: Bug 2798543} { expr {3**14 == 3**65550} } 0 test expr-23.54.6 {INST_EXPON: Bug 2798543} { expr {3**15 == 3**65551} } 0 test expr-23.54.7 {INST_EXPON: Bug 2798543} { expr {3**16 == 3**65552} } 0 test expr-23.54.8 {INST_EXPON: Bug 2798543} { expr {3**17 == 3**65553} } 0 test expr-23.54.9 {INST_EXPON: Bug 2798543} { expr {3**18 == 3**65554} } 0 test expr-23.54.10 {INST_EXPON: Bug 2798543} { expr {3**19 == 3**65555} } 0 test expr-23.54.11 {INST_EXPON: Bug 2798543} { expr {3**9 == 3**131081} } 0 test expr-23.54.12 {INST_EXPON: Bug 2798543} -body { expr {3**268435456} } -returnCodes error -result {exponent too large} test expr-23.54.13 {INST_EXPON: Bug 2798543} { expr {(-3)**9 == (-3)**65545} } 0 test expr-23.55.0 {INST_EXPON: Bug 2798543} { expr {4**9 == 4**65545} } 0 test expr-23.55.1 {INST_EXPON: Bug 2798543} { expr {4**15 == 4**65551} } 0 test expr-23.55.2 {INST_EXPON: Bug 2798543} { expr {4**9 == 4**131081} } 0 test expr-23.55.3 {INST_EXPON: Bug 2798543} -body { expr {4**268435456} } -returnCodes error -result {exponent too large} test expr-23.55.4 {INST_EXPON: Bug 2798543} { expr {(-4)**9 == (-4)**65545} } 0 test expr-23.56.0 {INST_EXPON: Bug 2798543} { expr {5**9 == 5**65545} } 0 test expr-23.56.1 {INST_EXPON: Bug 2798543} { expr {5**13 == 5**65549} } 0 test expr-23.56.2 {INST_EXPON: Bug 2798543} { expr {5**9 == 5**131081} } 0 test expr-23.56.3 {INST_EXPON: Bug 2798543} -body { expr {5**268435456} } -returnCodes error -result {exponent too large} test expr-23.56.4 {INST_EXPON: Bug 2798543} { expr {(-5)**9 == (-5)**65545} } 0 test expr-23.57.0 {INST_EXPON: Bug 2798543} { expr {6**9 == 6**65545} } 0 test expr-23.57.1 {INST_EXPON: Bug 2798543} { expr {6**11 == 6**65547} } 0 test expr-23.57.2 {INST_EXPON: Bug 2798543} { expr {6**9 == 6**131081} } 0 test expr-23.57.3 {INST_EXPON: Bug 2798543} -body { expr {6**268435456} } -returnCodes error -result {exponent too large} test expr-23.57.4 {INST_EXPON: Bug 2798543} { expr {(-6)**9 == (-6)**65545} } 0 test expr-23.58.0 {INST_EXPON: Bug 2798543} { expr {7**9 == 7**65545} } 0 test expr-23.58.1 {INST_EXPON: Bug 2798543} { expr {7**11 == 7**65547} } 0 test expr-23.58.2 {INST_EXPON: Bug 2798543} { expr {7**9 == 7**131081} } 0 test expr-23.58.3 {INST_EXPON: Bug 2798543} -body { expr {7**268435456} } -returnCodes error -result {exponent too large} test expr-23.58.4 {INST_EXPON: Bug 2798543} { expr {(-7)**9 == (-7)**65545} } 0 test expr-23.59.0 {INST_EXPON: Bug 2798543} { expr {8**9 == 8**65545} } 0 test expr-23.59.1 {INST_EXPON: Bug 2798543} { expr {8**10 == 8**65546} } 0 test expr-23.59.2 {INST_EXPON: Bug 2798543} { expr {8**9 == 8**131081} } 0 test expr-23.59.3 {INST_EXPON: Bug 2798543} -body { expr {8**268435456} } -returnCodes error -result {exponent too large} test expr-23.59.4 {INST_EXPON: Bug 2798543} { expr {(-8)**9 == (-8)**65545} } 0 test expr-23.60.0 {INST_EXPON: Bug 2798543} { expr {9**9 == 9**65545} } 0 test expr-23.60.1 {INST_EXPON: Bug 2798543} { expr {9**9 == 9**131081} } 0 test expr-23.60.2 {INST_EXPON: Bug 2798543} -body { expr {9**268435456} } -returnCodes error -result {exponent too large} test expr-23.60.3 {INST_EXPON: Bug 2798543} { expr {(-9)**9 == (-9)**65545} } 0 test expr-23.61.0 {INST_EXPON: Bug 2798543} { expr {10**9 == 10**65545} } 0 test expr-23.61.1 {INST_EXPON: Bug 2798543} { expr {10**9 == 10**131081} } 0 test expr-23.61.2 {INST_EXPON: Bug 2798543} -body { expr {10**268435456} } -returnCodes error -result {exponent too large} test expr-23.61.3 {INST_EXPON: Bug 2798543} { expr {(-10)**9 == (-10)**65545} } 0 test expr-23.62.0 {INST_EXPON: Bug 2798543} { expr {11**9 == 11**65545} } 0 test expr-23.62.1 {INST_EXPON: Bug 2798543} { expr {11**9 == 11**131081} } 0 test expr-23.62.2 {INST_EXPON: Bug 2798543} -body { expr {11**268435456} } -returnCodes error -result {exponent too large} test expr-23.62.3 {INST_EXPON: Bug 2798543} { expr {(-11)**9 == (-11)**65545} } 0 test expr-23.63.0 {INST_EXPON: Bug 2798543} { expr {3**20 == 3**65556} } 0 test expr-23.63.1 {INST_EXPON: Bug 2798543} { expr {3**39 == 3**65575} } 0 test expr-23.63.2 {INST_EXPON: Bug 2798543} { expr {3**20 == 3**131092} } 0 test expr-23.63.3 {INST_EXPON: Bug 2798543} -body { expr {3**268435456} } -returnCodes error -result {exponent too large} test expr-23.63.4 {INST_EXPON: Bug 2798543} { expr {(-3)**20 == (-3)**65556} } 0 test expr-23.64.0 {INST_EXPON: Bug 2798543} { expr {4**17 == 4**65553} } 0 test expr-23.64.1 {INST_EXPON: Bug 2798543} { expr {4**31 == 4**65567} } 0 test expr-23.64.2 {INST_EXPON: Bug 2798543} { expr {4**17 == 4**131089} } 0 test expr-23.64.3 {INST_EXPON: Bug 2798543} -body { expr {4**268435456} } -returnCodes error -result {exponent too large} test expr-23.64.4 {INST_EXPON: Bug 2798543} { expr {(-4)**17 == (-4)**65553} } 0 test expr-23.65.0 {INST_EXPON: Bug 2798543} { expr {5**17 == 5**65553} } 0 test expr-23.65.1 {INST_EXPON: Bug 2798543} { expr {5**27 == 5**65563} } 0 test expr-23.65.2 {INST_EXPON: Bug 2798543} { expr {5**17 == 5**131089} } 0 test expr-23.65.3 {INST_EXPON: Bug 2798543} -body { expr {5**268435456} } -returnCodes error -result {exponent too large} test expr-23.65.4 {INST_EXPON: Bug 2798543} { expr {(-5)**17 == (-5)**65553} } 0 test expr-23.66.0 {INST_EXPON: Bug 2798543} { expr {6**17 == 6**65553} } 0 test expr-23.66.1 {INST_EXPON: Bug 2798543} { expr {6**24 == 6**65560} } 0 test expr-23.66.2 {INST_EXPON: Bug 2798543} { expr {6**17 == 6**131089} } 0 test expr-23.66.3 {INST_EXPON: Bug 2798543} -body { expr {6**268435456} } -returnCodes error -result {exponent too large} test expr-23.66.4 {INST_EXPON: Bug 2798543} { expr {(-6)**17 == (-6)**65553} } 0 test expr-23.67.0 {INST_EXPON: Bug 2798543} { expr {7**17 == 7**65553} } 0 test expr-23.67.1 {INST_EXPON: Bug 2798543} { expr {7**22 == 7**65558} } 0 test expr-23.67.2 {INST_EXPON: Bug 2798543} { expr {7**17 == 7**131089} } 0 test expr-23.67.3 {INST_EXPON: Bug 2798543} -body { expr {7**268435456} } -returnCodes error -result {exponent too large} test expr-23.67.4 {INST_EXPON: Bug 2798543} { expr {(-7)**17 == (-7)**65553} } 0 test expr-23.68.0 {INST_EXPON: Bug 2798543} { expr {8**17 == 8**65553} } 0 test expr-23.68.1 {INST_EXPON: Bug 2798543} { expr {8**20 == 8**65556} } 0 test expr-23.68.2 {INST_EXPON: Bug 2798543} { expr {8**17 == 8**131089} } 0 test expr-23.68.3 {INST_EXPON: Bug 2798543} -body { expr {8**268435456} } -returnCodes error -result {exponent too large} test expr-23.68.4 {INST_EXPON: Bug 2798543} { expr {(-8)**17 == (-8)**65553} } 0 test expr-23.69.0 {INST_EXPON: Bug 2798543} { expr {9**17 == 9**65553} } 0 test expr-23.69.1 {INST_EXPON: Bug 2798543} { expr {9**19 == 9**65555} } 0 test expr-23.69.2 {INST_EXPON: Bug 2798543} { expr {9**17 == 9**131089} } 0 test expr-23.69.3 {INST_EXPON: Bug 2798543} -body { expr {9**268435456} } -returnCodes error -result {exponent too large} test expr-23.69.4 {INST_EXPON: Bug 2798543} { expr {(-9)**17 == (-9)**65553} } 0 test expr-23.70.0 {INST_EXPON: Bug 2798543} { expr {10**17 == 10**65553} } 0 test expr-23.70.1 {INST_EXPON: Bug 2798543} { expr {10**18 == 10**65554} } 0 test expr-23.70.2 {INST_EXPON: Bug 2798543} { expr {10**17 == 10**131089} } 0 test expr-23.70.3 {INST_EXPON: Bug 2798543} -body { expr {10**268435456} } -returnCodes error -result {exponent too large} test expr-23.70.4 {INST_EXPON: Bug 2798543} { expr {(-10)**17 == (-10)**65553} } 0 test expr-23.71.0 {INST_EXPON: Bug 2798543} { expr {11**17 == 11**65553} } 0 test expr-23.71.1 {INST_EXPON: Bug 2798543} { expr {11**18 == 11**65554} } 0 test expr-23.71.2 {INST_EXPON: Bug 2798543} { expr {11**17 == 11**131089} } 0 test expr-23.71.3 {INST_EXPON: Bug 2798543} -body { expr {11**268435456} } -returnCodes error -result {exponent too large} test expr-23.71.4 {INST_EXPON: Bug 2798543} { expr {(-11)**17 == (-11)**65553} } 0 test expr-23.72.0 {INST_EXPON: Bug 2798543} { expr {12**17 == 12**65553} } 0 test expr-23.72.1 {INST_EXPON: Bug 2798543} { expr {12**17 == 12**131089} } 0 test expr-23.72.2 {INST_EXPON: Bug 2798543} -body { expr {12**268435456} } -returnCodes error -result {exponent too large} test expr-23.72.3 {INST_EXPON: Bug 2798543} { expr {(-12)**17 == (-12)**65553} } 0 test expr-23.73.0 {INST_EXPON: Bug 2798543} { expr {13**17 == 13**65553} } 0 test expr-23.73.1 {INST_EXPON: Bug 2798543} { expr {13**17 == 13**131089} } 0 test expr-23.73.2 {INST_EXPON: Bug 2798543} -body { expr {13**268435456} } -returnCodes error -result {exponent too large} test expr-23.73.3 {INST_EXPON: Bug 2798543} { expr {(-13)**17 == (-13)**65553} } 0 test expr-23.74.0 {INST_EXPON: Bug 2798543} { expr {14**17 == 14**65553} } 0 test expr-23.74.1 {INST_EXPON: Bug 2798543} { expr {14**17 == 14**131089} } 0 test expr-23.74.2 {INST_EXPON: Bug 2798543} -body { expr {14**268435456} } -returnCodes error -result {exponent too large} test expr-23.74.3 {INST_EXPON: Bug 2798543} { expr {(-14)**17 == (-14)**65553} } 0 # Some compilers get this wrong; ensure that we work around it correctly test expr-24.1 {expr edge cases; shifting} {expr int(5)>>32} 0 test expr-24.2 {expr edge cases; shifting} {expr int(5)>>63} 0 test expr-24.3 {expr edge cases; shifting} {expr wide(5)>>32} 0 test expr-24.4 {expr edge cases; shifting} {expr wide(5)>>63} 0 test expr-24.5 {expr edge cases; shifting} {expr int(5<<32)} 21474836480 test expr-24.6 {expr edge cases; shifting} {expr int(5<<63)} 46116860184273879040 test expr-24.7 {expr edge cases; shifting} {expr wide(5)<<32} 21474836480 test expr-24.8 {expr edge cases; shifting} {expr wide(10<<63)} 0 test expr-24.9 {expr edge cases; shifting} {expr 5>>32} 0 test expr-24.10 {INST_LSHIFT: Bug 1567222} {expr 500000000000000<<28} 134217728000000000000000 test expr-24.11 {INST_LSHIFT: Bug 84a5355235} {expr -549755813888>>32} -128 test expr-24.12 {INST_LSHIFT: Bug 920e393634} {expr 7244019458077122840<<1} 14488038916154245680 # List membership tests test expr-25.1 {'in' operator} {expr {"a" in "a b c"}} 1 test expr-25.2 {'in' operator} {expr {"a" in "b a c"}} 1 test expr-25.3 {'in' operator} {expr {"a" in "b c a"}} 1 test expr-25.4 {'in' operator} {expr {"a" in ""}} 0 test expr-25.5 {'in' operator} {expr {"" in {a b c ""}}} 1 test expr-25.6 {'in' operator} {expr {"" in "a b c"}} 0 test expr-25.7 {'in' operator} {expr {"" in ""}} 0 test expr-26.1 {'ni' operator} {expr {"a" ni "a b c"}} 0 test expr-26.2 {'ni' operator} {expr {"a" ni "b a c"}} 0 test expr-26.3 {'ni' operator} {expr {"a" ni "b c a"}} 0 test expr-26.4 {'ni' operator} {expr {"a" ni ""}} 1 test expr-26.5 {'ni' operator} {expr {"" ni {a b c ""}}} 0 test expr-26.6 {'ni' operator} {expr {"" ni "a b c"}} 1 test expr-26.7 {'ni' operator} {expr {"" ni ""}} 1 foreach op {< <= == != > >=} { proc test$op {a b} [list expr "\$a $op \$b"] } test expr-27.1 {expr - correct ordering - not compiled} ieeeFloatingPoint { set problems {} # Ordering should be: -Infinity < -Normal < Subnormal < -0 # < +0 < +Subnormal < +Normal < +Infinity # with equality within each class. set names { -Infinity -Normal -Subnormal -0 +0 +Subnormal +Normal +Infinity } set weights { -3 -2 -1 0 0 1 2 3 } foreach name1 $names weight1 $weights { foreach name2 $names weight2 $weights { foreach op {< <= == != >= >} { set shouldBe [expr "$weight1 $op $weight2"] set is [expr "\$ieeeValues($name1) $op \$ieeeValues($name2)"] if { $is != $shouldBe } { append problems $name1 { } $op { } $name2 \ ":result is " $is ", should be $shouldBe" \n } } } } set problems } {} test expr-27.2 {expr - correct ordering - compiled} ieeeFloatingPoint { set problems {} # Ordering should be: -Infinity < -Normal < Subnormal < -0 # < +0 < +Subnormal < +Normal < +Infinity # with equality within each class. set names { -Infinity -Normal -Subnormal -0 +0 +Subnormal +Normal +Infinity } set weights { -3 -2 -1 0 0 1 2 3 } foreach name1 $names weight1 $weights { foreach name2 $names weight2 $weights { foreach op {< <= == != >= >} { set shouldBe [expr "$weight1 $op $weight2"] set is [test$op $ieeeValues($name1) $ieeeValues($name2)] if { $is != $shouldBe } { append problems $name1 { } $op { } $name2 \ ":result is " $is ", should be $shouldBe" \n } } } } set problems } {} test expr-27.3 {expr - NaN is unordered - not compiled} { set problems {} set names { -Infinity -Normal -Subnormal -0 +0 +Subnormal +Normal +Infinity NaN } foreach name1 $names { foreach op {< <= == != >= >} sb {0 0 0 1 0 0} { if "(\$ieeeValues($name1) $op \$ieeeValues(NaN)) != $sb " { append problems $name1 { } $op { } NaN \ ": result is 1, should be $sb" \n } if "(\$ieeeValues(NaN) $op \$ieeeValues($name1)) != $sb" { append problems NaN { } $op { } $name1 \ ": result is 1, should be $sb" \n } } } set problems } {} test expr-27.4 {expr - NaN is unordered - compiled} { set problems {} set names { -Infinity -Normal -Subnormal -0 +0 +Subnormal +Normal +Infinity NaN } foreach name1 $names { foreach op {< <= == != >= >} sb {0 0 0 1 0 0} { if { [test$op $ieeeValues($name1) $ieeeValues(NaN)] != $sb } { append problems $ieeeValues($name1) { } $op { } $ieeeValues(NaN) \ ": result is 1, should be $sb" \n } if { [test$op $ieeeValues(NaN) $ieeeValues($name1)] != $sb } { append problems NaN { } $op { } $ieeeValues($name1) \ ": result is 1, should be $sb" \n } } } set problems } {} proc convertToDouble { x } { variable ieeeValues binary scan [binary format d $x] c* bytes set result 0x if { $ieeeValues(littleEndian) } { for { set i 7 } { $i >= 0 } { incr i -1 } { append result [format %02x [expr { [lindex $bytes $i] & 0xff }]] } } else { foreach byte $bytes { append result [format %02x [expr { $byte & 0xff }]] } } return $result } test expr-28.1 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 0 E0 OK 00000000000000 E-1023 convertToDouble 0E0 } 0x0000000000000000 test expr-28.2 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL -0 E0 OK -0000000000000 E-1023 convertToDouble -0E0 } 0x8000000000000000 test expr-28.3 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 1 E0 OK 10000000000000 E0 convertToDouble 1E0 } 0x3ff0000000000000 test expr-28.4 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 15 E-1 OK 18000000000000 E0 convertToDouble 15E-1 } 0x3ff8000000000000 test expr-28.5 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 125 E-2 OK 14000000000000 E0 convertToDouble 125E-2 } 0x3ff4000000000000 test expr-28.6 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 1125 E-3 OK 12000000000000 E0 convertToDouble 1125E-3 } 0x3ff2000000000000 test expr-28.7 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 10625 E-4 OK 11000000000000 E0 convertToDouble 10625E-4 } 0x3ff1000000000000 test expr-28.8 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 103125 E-5 OK 10800000000000 E0 convertToDouble 103125E-5 } 0x3ff0800000000000 test expr-28.9 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 1015625 E-6 OK 10400000000000 E0 convertToDouble 1015625E-6 } 0x3ff0400000000000 test expr-28.10 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 10078125 E-7 OK 10200000000000 E0 convertToDouble 10078125E-7 } 0x3ff0200000000000 test expr-28.11 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d ALL 100390625 E-8 OK 10100000000000 E0 convertToDouble 100390625E-8 } 0x3ff0100000000000 test expr-28.12 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 1001953125 E-9 OK 10080000000000 E0 convertToDouble 1001953125E-9 } 0x3ff0080000000000 test expr-28.13 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 10009765625 E-10 OK 10040000000000 E0 convertToDouble 10009765625E-10 } 0x3ff0040000000000 test expr-28.14 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 100048828125 E-11 OK 10020000000000 E0 convertToDouble 100048828125E-11 } 0x3ff0020000000000 test expr-28.15 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 1000244140625 E-12 OK 10010000000000 E0 convertToDouble 1000244140625E-12 } 0x3ff0010000000000 test expr-28.16 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 10001220703125 E-13 OK 10008000000000 E0 convertToDouble 10001220703125E-13 } 0x3ff0008000000000 test expr-28.17 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 100006103515625 E-14 OK 10004000000000 E0 convertToDouble 100006103515625E-14 } 0x3ff0004000000000 test expr-28.18 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 1000030517578125 E-15 OK 10002000000000 E0 convertToDouble 1000030517578125E-15 } 0x3ff0002000000000 test expr-28.19 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee ALL 10000152587890625 E-16 OK 10001000000000 E0 convertToDouble 10000152587890625E-16 } 0x3ff0001000000000 test expr-28.20 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8 E153 x 1317e5ef3ab327_0000000001& E511 convertToDouble +8E153 } 0x5fe317e5ef3ab327 test expr-28.21 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1 E153 x -1317e5ef3ab327_0000000001& E508 convertToDouble -1E153 } 0xdfb317e5ef3ab327 test expr-28.22 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9 E306 x 19a2028368022e_00000000001& E1019 convertToDouble +9E306 } 0x7fa9a2028368022e test expr-28.23 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2 E153 x -1317e5ef3ab327_0000000001& E509 convertToDouble -2E153 } 0xdfc317e5ef3ab327 test expr-28.24 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7 E-304 x 1eb8e84fa0b278_00000000001& E-1008 convertToDouble +7E-304 } 0x00feb8e84fa0b278 test expr-28.25 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3 E-49 x -1c0f92a6276c9d_000000001& E-162 convertToDouble -3E-49 } 0xb5dc0f92a6276c9d test expr-28.26 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7 E-303 x 13339131c46f8b_00000000001& E-1004 convertToDouble +7E-303 } 0x0133339131c46f8b test expr-28.27 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6 E-49 x -1c0f92a6276c9d_000000001& E-161 convertToDouble -6E-49 } 0xb5ec0f92a6276c9d test expr-28.28 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9 E43 x 102498ea6df0c3_11111111110& E146 convertToDouble +9E43 } 0x49102498ea6df0c4 test expr-28.29 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9 E44 x -142dbf25096cf4_1111111110& E149 convertToDouble -9E44 } 0xc9442dbf25096cf5 test expr-28.30 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8 E303 x 1754e31cd072d9_1111111110& E1009 convertToDouble +8E303 } 0x7f0754e31cd072da test expr-28.31 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1 E303 x -1754e31cd072d9_1111111110& E1006 convertToDouble -1E303 } 0xfed754e31cd072da test expr-28.32 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7 E-287 x 1551603777f798_111111110& E-951 convertToDouble +7E-287 } 0x048551603777f799 test expr-28.33 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2 E-204 x -1410d9f9b2f7f2_11111110& E-677 convertToDouble -2E-204 } 0x95a410d9f9b2f7f3 test expr-28.34 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2 E-205 x 100d7b2e28c65b_11111110& E-680 convertToDouble +2E-205 } 0x15700d7b2e28c65c test expr-28.35 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9 E-47 x -10711fed5b19a3_11111110& E-153 convertToDouble -9E-47 } 0xb660711fed5b19a4 test expr-28.36 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +34 E195 x 1d1c26db7d0dae_000000000001& E652 convertToDouble +34E195 } 0x68bd1c26db7d0dae test expr-28.37 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -68 E195 x -1d1c26db7d0dae_000000000001& E653 convertToDouble -68E195 } 0xe8cd1c26db7d0dae test expr-28.38 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +85 E194 x 1d1c26db7d0dae_000000000001& E650 convertToDouble +85E194 } 0x689d1c26db7d0dae test expr-28.39 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -67 E97 x -139ac1ce2cc95f_000000000001& E328 convertToDouble -67E97 } 0xd4739ac1ce2cc95f test expr-28.40 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +93 E-234 x 127b2e4f210075_0000000000000001& E-771 convertToDouble +93E-234 } 0x0fc27b2e4f210075 test expr-28.41 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -19 E-87 x -12e5f5dfa4fe9d_00000000000001& E-285 convertToDouble -19E-87 } 0xae22e5f5dfa4fe9d test expr-28.42 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +38 E-87 x 12e5f5dfa4fe9d_00000000000001& E-284 convertToDouble +38E-87 } 0x2e32e5f5dfa4fe9d test expr-28.43 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -38 E-88 x -1e3cbc9907fdc8_00000000000001& E-288 convertToDouble -38E-88 } 0xadfe3cbc9907fdc8 test expr-28.44 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -69 E220 x -1e8aa8823a5db3_11111111110& E736 convertToDouble -69E220 } 0xedfe8aa8823a5db4 test expr-28.45 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +18 E43 x 102498ea6df0c3_11111111110& E147 convertToDouble +18E43 } 0x49202498ea6df0c4 test expr-28.46 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -36 E43 x -102498ea6df0c3_11111111110& E148 convertToDouble -36E43 } 0xc9302498ea6df0c4 test expr-28.47 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +61 E-99 x 10ad836f269a16_11111111111110& E-323 convertToDouble +61E-99 } 0x2bc0ad836f269a17 test expr-28.48 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -43 E-92 x -1c0794d9d40e95_111111111111110& E-301 convertToDouble -43E-92 } 0xad2c0794d9d40e96 test expr-28.49 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +86 E-92 x 1c0794d9d40e95_111111111111110& E-300 convertToDouble +86E-92 } 0x2d3c0794d9d40e96 test expr-28.50 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -51 E-74 x -1cd5bee57763e5_1111111111111110& E-241 convertToDouble -51E-74 } 0xb0ecd5bee57763e6 test expr-28.51 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +283 E85 x 16c309024bab4b_00000000000000001& E290 convertToDouble +283E85 } 0x5216c309024bab4b test expr-28.52 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -566 E85 x -16c309024bab4b_00000000000000001& E291 convertToDouble -566E85 } 0xd226c309024bab4b test expr-28.53 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +589 E187 x 1526be9c22eb17_00000000000000001& E630 convertToDouble +589E187 } 0x675526be9c22eb17 test expr-28.54 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -839 E143 x -1ae03f245703e2_000000000000001& E484 convertToDouble -839E143 } 0xde3ae03f245703e2 test expr-28.55 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -744 E-234 x -127b2e4f210075_0000000000000001& E-768 convertToDouble -744E-234 } 0x8ff27b2e4f210075 test expr-28.56 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +930 E-235 x 127b2e4f210075_0000000000000001& E-771 convertToDouble +930E-235 } 0x0fc27b2e4f210075 test expr-28.57 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -186 E-234 x -127b2e4f210075_0000000000000001& E-770 convertToDouble -186E-234 } 0x8fd27b2e4f210075 test expr-28.58 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +604 E175 x 17d93193f78fc5_1111111111111111110& E590 convertToDouble +604E175 } 0x64d7d93193f78fc6 test expr-28.59 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -302 E175 x -17d93193f78fc5_1111111111111111110& E589 convertToDouble -302E175 } 0xe4c7d93193f78fc6 test expr-28.60 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +755 E174 x 17d93193f78fc5_1111111111111111110& E587 convertToDouble +755E174 } 0x64a7d93193f78fc6 test expr-28.61 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -151 E175 x -17d93193f78fc5_1111111111111111110& E588 convertToDouble -151E175 } 0xe4b7d93193f78fc6 test expr-28.62 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +662 E-213 x 1bdb90e62a8cbc_1111111111111110& E-699 convertToDouble +662E-213 } 0x144bdb90e62a8cbd test expr-28.63 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -408 E-74 x -1cd5bee57763e5_1111111111111110& E-238 convertToDouble -408E-74 } 0xb11cd5bee57763e6 test expr-28.64 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +510 E-75 x 1cd5bee57763e5_1111111111111110& E-241 convertToDouble +510E-75 } 0x30ecd5bee57763e6 test expr-28.65 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6782 E55 x 159bd3ad46e346_0000000000000000001& E195 convertToDouble +6782E55 } 0x4c259bd3ad46e346 test expr-28.66 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2309 E92 x -1bac6f7d64d119_000000000000000001& E316 convertToDouble -2309E92 } 0xd3bbac6f7d64d119 test expr-28.67 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7963 E34 x 1df4170f0fdecc_00000000000000000001& E125 convertToDouble +7963E34 } 0x47cdf4170f0fdecc test expr-28.68 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3391 E55 x -159bd3ad46e346_0000000000000000001& E194 convertToDouble -3391E55 } 0xcc159bd3ad46e346 test expr-28.69 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7903 E-96 x 107c2d27a5b989_0000000000000000001& E-306 convertToDouble +7903E-96 } 0x2cd07c2d27a5b989 test expr-28.70 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7611 E-226 x -119b8744033457_0000000000000000001& E-738 convertToDouble -7611E-226 } 0x91d19b8744033457 test expr-28.71 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4907 E-196 x 11e90a8711440f_000000000000000001& E-639 convertToDouble +4907E-196 } 0x1801e90a8711440f test expr-28.72 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5547 E-311 x -13f190452a29f4_000000000000000001& E-1021 convertToDouble -5547E-311 } 0x8023f190452a29f4 test expr-28.73 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5311 E241 x 1f1ce3c887c25f_11111111111111111110& E812 convertToDouble +5311E241 } 0x72bf1ce3c887c260 test expr-28.74 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5311 E243 x -184e91f4aa0fda_11111111111111111110& E819 convertToDouble -5311E243 } 0xf3284e91f4aa0fdb test expr-28.75 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5311 E242 x 13720e5d54d97b_11111111111111111110& E816 convertToDouble +5311E242 } 0x72f3720e5d54d97c test expr-28.76 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9269 E-45 x 19d69455a53bd8_111111111111111111110& E-137 convertToDouble +9269E-45 } 0x3769d69455a53bd9 test expr-28.77 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8559 E-289 x -104a81d35952fe_11111111111111111110& E-947 convertToDouble -8559E-289 } 0x84c04a81d35952ff test expr-28.78 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8699 E-276 x 12d2df246ecd2c_1111111111111111111110& E-904 convertToDouble +8699E-276 } 0x0772d2df246ecd2d test expr-28.79 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8085 E-64 x -14c98fce16152d_1111111111111111110& E-200 convertToDouble -8085E-64 } 0xb374c98fce16152e test expr-28.80 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +74819 E201 x 1dd455061eb3f1_0000000000000000000001& E683 convertToDouble +74819E201 } 0x6aadd455061eb3f1 test expr-28.81 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -82081 E41 x -170105df3d47cb_000000000000000000000000001& E152 convertToDouble -82081E41 } 0xc9770105df3d47cb test expr-28.82 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +51881 E37 x 17d2950dc76da4_000000000000000000001& E138 convertToDouble +51881E37 } 0x4897d2950dc76da4 test expr-28.83 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -55061 E157 x -1394fc0f33536c_000000000000000000001& E537 convertToDouble -55061E157 } 0xe18394fc0f33536c test expr-28.84 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +77402 E-215 x 10492a4a8a37fd_0000000000000000000000001& E-698 convertToDouble +77402E-215 } 0x1450492a4a8a37fd test expr-28.85 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -33891 E-92 x -1592f9932c06bd_00000000000000000000001& E-291 convertToDouble -33891E-92 } 0xadc592f9932c06bd test expr-28.86 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +38701 E-215 x 10492a4a8a37fd_0000000000000000000000001& E-699 convertToDouble +38701E-215 } 0x1440492a4a8a37fd test expr-28.87 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -82139 E-76 x -1d0681489839d5_00000000000000000000001& E-237 convertToDouble -82139E-76 } 0xb12d0681489839d5 test expr-28.88 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +75859 E25 x 132645e1ba93ef_11111111111111111111110& E99 convertToDouble +75859E25 } 0x46232645e1ba93f0 test expr-28.89 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +89509 E140 x 16f02bee68670c_1111111111111111111110& E481 convertToDouble +89509E140 } 0x5e06f02bee68670d test expr-28.90 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -57533 E287 x -1272ed2307f569_1111111111111111111110& E969 convertToDouble -57533E287 } 0xfc8272ed2307f56a test expr-28.91 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +46073 E-32 x 12405b773fbdf2_11111111111111111111110& E-91 convertToDouble +46073E-32 } 0x3a42405b773fbdf3 test expr-28.92 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -92146 E-32 x -12405b773fbdf2_11111111111111111111110& E-90 convertToDouble -92146E-32 } 0xba52405b773fbdf3 test expr-28.93 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +83771 E-74 x 17206bfc4ccabd_11111111111111111111110& E-230 convertToDouble +83771E-74 } 0x3197206bfc4ccabe test expr-28.94 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -34796 E-276 x -12d2df246ecd2c_1111111111111111111110& E-902 convertToDouble -34796E-276 } 0x8792d2df246ecd2d test expr-28.95 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +584169 E229 x 1d657059dc79aa_00000000000000000000000000001& E779 convertToDouble +584169E229 } 0x70ad657059dc79aa test expr-28.96 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +164162 E41 x 170105df3d47cb_000000000000000000000000001& E153 convertToDouble +164162E41 } 0x49870105df3d47cb test expr-28.97 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -328324 E41 x -170105df3d47cb_000000000000000000000000001& E154 convertToDouble -328324E41 } 0xc9970105df3d47cb test expr-28.98 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +209901 E-11 x 119b96f36ec68b_00000000000000000000000001& E-19 convertToDouble +209901E-11 } 0x3ec19b96f36ec68b test expr-28.99 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -419802 E-11 x -119b96f36ec68b_00000000000000000000000001& E-18 convertToDouble -419802E-11 } 0xbed19b96f36ec68b test expr-28.100 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +940189 E-112 x 1b99d6240c1a28_00000000000000000000000001& E-353 convertToDouble +940189E-112 } 0x29eb99d6240c1a28 test expr-28.101 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -892771 E-213 x -125818c7294f27_0000000000000000000000000001& E-688 convertToDouble -892771E-213 } 0x94f25818c7294f27 test expr-28.102 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +757803 E120 x 11e968b555bb80_11111111111111111111111111110& E418 convertToDouble +757803E120 } 0x5a11e968b555bb81 test expr-28.103 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -252601 E120 x -17e1e0f1c7a4ab_11111111111111111111111111110& E416 convertToDouble -252601E120 } 0xd9f7e1e0f1c7a4ac test expr-28.104 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +252601 E121 x 1dda592e398dd6_1111111111111111111111111110& E419 convertToDouble +252601E121 } 0x5a2dda592e398dd7 test expr-28.105 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -505202 E120 x -17e1e0f1c7a4ab_11111111111111111111111111110& E417 convertToDouble -505202E120 } 0xda07e1e0f1c7a4ac test expr-28.106 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +970811 E-264 x 1dda6b965c9629_11111111111111111111111110& E-858 convertToDouble +970811E-264 } 0x0a5dda6b965c962a test expr-28.107 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -654839 E-60 x -100e7db3b3f241_111111111111111111111111110& E-180 convertToDouble -654839E-60 } 0xb4b00e7db3b3f242 test expr-28.108 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +289767 E-178 x 1caad28f23a100_11111111111111111111111110& E-574 convertToDouble +289767E-178 } 0x1c1caad28f23a101 test expr-28.109 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -579534 E-178 x -1caad28f23a100_11111111111111111111111110& E-573 convertToDouble -579534E-178 } 0x9c2caad28f23a101 test expr-28.110 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8823691 E130 x -1e597c0b94b7ae_00000000000000000000000000000001& E454 convertToDouble -8823691E130 } 0xdc5e597c0b94b7ae test expr-28.111 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9346704 E229 x 1d657059dc79aa_00000000000000000000000000001& E783 convertToDouble +9346704E229 } 0x70ed657059dc79aa test expr-28.112 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1168338 E229 x -1d657059dc79aa_00000000000000000000000000001& E780 convertToDouble -1168338E229 } 0xf0bd657059dc79aa test expr-28.113 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6063369 E-136 x -1ae6148e3902b3_000000000000000000000000000001& E-430 convertToDouble -6063369E-136 } 0xa51ae6148e3902b3 test expr-28.114 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3865421 E-225 x 15d4fe53afec65_00000000000000000000000000001& E-726 convertToDouble +3865421E-225 } 0x1295d4fe53afec65 test expr-28.115 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5783893 E-127 x -17e5902ce0e151_000000000000000000000000000000001& E-400 convertToDouble -5783893E-127 } 0xa6f7e5902ce0e151 test expr-28.116 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2572231 E223 x 10f73be1dff9ac_111111111111111111111111111110& E762 convertToDouble +2572231E223 } 0x6f90f73be1dff9ad test expr-28.117 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5144462 E223 x -10f73be1dff9ac_111111111111111111111111111110& E763 convertToDouble -5144462E223 } 0xefa0f73be1dff9ad test expr-28.118 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1817623 E109 x 1d85f96f3fe659_11111111111111111111111111110& E382 convertToDouble +1817623E109 } 0x57dd85f96f3fe65a test expr-28.119 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6431543 E-97 x 14f6493f34a0bc_11111111111111111111111111110& E-300 convertToDouble +6431543E-97 } 0x2d34f6493f34a0bd test expr-28.120 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5444097 E-21 x -18849dd33c95ae_11111111111111111111111111110& E-48 convertToDouble -5444097E-21 } 0xbcf8849dd33c95af test expr-28.121 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8076999 E-121 x 1fd332f7e2e3b2_11111111111111111111111111110& E-380 convertToDouble +8076999E-121 } 0x283fd332f7e2e3b3 test expr-28.122 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9997649 E-270 x -1425e9d29e558d_1111111111111111111111111110& E-874 convertToDouble -9997649E-270 } 0x895425e9d29e558e test expr-28.123 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +50609263 E157 x 1193aff1f1c8e3_000000000000000000000000000000001& E547 convertToDouble +50609263E157 } 0x622193aff1f1c8e3 test expr-28.124 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +70589528 E130 x 1e597c0b94b7ae_00000000000000000000000000000001& E457 convertToDouble +70589528E130 } 0x5c8e597c0b94b7ae test expr-28.125 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -88236910 E129 x -1e597c0b94b7ae_00000000000000000000000000000001& E454 convertToDouble -88236910E129 } 0xdc5e597c0b94b7ae test expr-28.126 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +87575437 E-310 x 1805c19e680456_0000000000000000000000000000000000001& E-1004 convertToDouble +87575437E-310 } 0x013805c19e680456 test expr-28.127 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -23135572 E-127 x -17e5902ce0e151_000000000000000000000000000000001& E-398 convertToDouble -23135572E-127 } 0xa717e5902ce0e151 test expr-28.128 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +85900881 E177 x 14375b2214e1b4_111111111111111111111111111111110& E614 convertToDouble +85900881E177 } 0x6654375b2214e1b5 test expr-28.129 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -84863171 E113 x -1a4a8e56474b8b_111111111111111111111111111111110& E401 convertToDouble -84863171E113 } 0xd90a4a8e56474b8c test expr-28.130 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +68761586 E232 x 1a662c350f37f2_1111111111111111111111111111110& E796 convertToDouble +68761586E232 } 0x71ba662c350f37f3 test expr-28.131 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -50464069 E286 x -1948dd06de561e_1111111111111111111111111111110& E975 convertToDouble -50464069E286 } 0xfce948dd06de561f test expr-28.132 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +27869147 E-248 x 1dbbac6f83a820_111111111111111111111111111111111110& E-800 convertToDouble +27869147E-248 } 0x0dfdbbac6f83a821 test expr-28.133 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -55738294 E-248 x -1dbbac6f83a820_111111111111111111111111111111111110& E-799 convertToDouble -55738294E-248 } 0x8e0dbbac6f83a821 test expr-28.134 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +70176353 E-53 x 100683a21de854_1111111111111111111111111111111110& E-150 convertToDouble +70176353E-53 } 0x36900683a21de855 test expr-28.135 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -80555086 E-32 x -1f29ca0ff893b0_111111111111111111111111111111110& E-81 convertToDouble -80555086E-32 } 0xbaef29ca0ff893b1 test expr-28.136 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -491080654 E121 x -1c569e968e0944_00000000000000000000000000000000000000001& E430 convertToDouble -491080654E121 } 0xdadc569e968e0944 test expr-28.137 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +526250918 E287 x 14997a298b2f2e_0000000000000000000000000000000000001& E982 convertToDouble +526250918E287 } 0x7d54997a298b2f2e test expr-28.138 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -245540327 E121 x -1c569e968e0944_00000000000000000000000000000000000000001& E429 convertToDouble -245540327E121 } 0xdacc569e968e0944 test expr-28.139 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -175150874 E-310 x -1805c19e680456_0000000000000000000000000000000000001& E-1003 convertToDouble -175150874E-310 } 0x814805c19e680456 test expr-28.140 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +350301748 E-310 x 1805c19e680456_0000000000000000000000000000000000001& E-1002 convertToDouble +350301748E-310 } 0x015805c19e680456 test expr-28.141 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -437877185 E-311 x -1805c19e680456_0000000000000000000000000000000000001& E-1005 convertToDouble -437877185E-311 } 0x812805c19e680456 test expr-28.142 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +458117166 E52 x 16ce94febdc7a4_1111111111111111111111111111111111110& E201 convertToDouble +458117166E52 } 0x4c86ce94febdc7a5 test expr-28.143 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -916234332 E52 x -16ce94febdc7a4_1111111111111111111111111111111111110& E202 convertToDouble -916234332E52 } 0xcc96ce94febdc7a5 test expr-28.144 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +229058583 E52 x 16ce94febdc7a4_1111111111111111111111111111111111110& E200 convertToDouble +229058583E52 } 0x4c76ce94febdc7a5 test expr-28.145 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -525789935 E98 x -16ecdc2a58fc64_11111111111111111111111111111111110& E354 convertToDouble -525789935E98 } 0xd616ecdc2a58fc65 test expr-28.146 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +282926897 E-227 x 1ff5a70d3d2fee_1111111111111111111111111111111111110& E-727 convertToDouble +282926897E-227 } 0x128ff5a70d3d2fef test expr-28.147 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -565853794 E-227 x -1ff5a70d3d2fee_1111111111111111111111111111111111110& E-726 convertToDouble -565853794E-227 } 0x929ff5a70d3d2fef test expr-28.148 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +667284113 E-240 x 109355f8050c01_111111111111111111111111111111111110& E-768 convertToDouble +667284113E-240 } 0x0ff09355f8050c02 test expr-28.149 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -971212611 E-126 x -1397d3c9745d2e_111111111111111111111111111111111111110& E-389 convertToDouble -971212611E-126 } 0xa7a397d3c9745d2f test expr-28.150 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9981396317 E-182 x 18afe10a2a66aa_0000000000000000000000000000000000000001& E-572 convertToDouble +9981396317E-182 } 0x1c38afe10a2a66aa test expr-28.151 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5035231965 E-156 x -101891fc4717fd_00000000000000000000000000000000000001& E-486 convertToDouble -5035231965E-156 } 0xa1901891fc4717fd test expr-28.152 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8336960483 E-153 x 1a06a1024b95e1_000000000000000000000000000000000000001& E-476 convertToDouble +8336960483E-153 } 0x223a06a1024b95e1 test expr-28.153 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8056371144 E-155 x -101891fc4717fd_00000000000000000000000000000000000001& E-482 convertToDouble -8056371144E-155 } 0xa1d01891fc4717fd test expr-28.154 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6418488827 E79 x 1021f14ed7b3f9_11111111111111111111111111111111111111110& E295 convertToDouble +6418488827E79 } 0x526021f14ed7b3fa test expr-28.155 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3981006983 E252 x -102ebaf189d5f1_1111111111111111111111111111111111111110& E869 convertToDouble -3981006983E252 } 0xf6402ebaf189d5f2 test expr-28.156 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7962013966 E252 x 102ebaf189d5f1_1111111111111111111111111111111111111110& E870 convertToDouble +7962013966E252 } 0x76502ebaf189d5f2 test expr-28.157 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -4713898551 E261 x -11d8813536e0df_11111111111111111111111111111111111110& E899 convertToDouble -4713898551E261 } 0xf821d8813536e0e0 test expr-28.158 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8715380633 E-58 x 14614c3219891e_11111111111111111111111111111111111111110& E-160 convertToDouble +8715380633E-58 } 0x35f4614c3219891f test expr-28.159 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9078555839 E-109 x -1fc575867314ed_111111111111111111111111111111111111111111110& E-330 convertToDouble -9078555839E-109 } 0xab5fc575867314ee test expr-28.160 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9712126110 E-127 x 1397d3c9745d2e_111111111111111111111111111111111111110& E-389 convertToDouble +9712126110E-127 } 0x27a397d3c9745d2f test expr-28.161 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +42333842451 E201 x 10189a26df575f_000000000000000000000000000000000000000000001& E703 convertToDouble +42333842451E201 } 0x6be0189a26df575f test expr-28.162 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -84667684902 E201 x -10189a26df575f_000000000000000000000000000000000000000000001& E704 convertToDouble -84667684902E201 } 0xebf0189a26df575f test expr-28.163 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +23792120709 E-315 x 10b517dc5d3212_00000000000000000000000000000000000000001& E-1012 convertToDouble +23792120709E-315 } 0x00b0b517dc5d3212 test expr-28.164 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -78564021519 E-227 x -1155515fd37265_00000000000000000000000000000000000000000001& E-718 convertToDouble -78564021519E-227 } 0x931155515fd37265 test expr-28.165 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +71812054883 E-188 x 1747b46d78c6fe_00000000000000000000000000000000000000001& E-589 convertToDouble +71812054883E-188 } 0x1b2747b46d78c6fe test expr-28.166 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -30311163631 E-116 x -163ef6f560afe7_00000000000000000000000000000000000000001& E-351 convertToDouble -30311163631E-116 } 0xaa063ef6f560afe7 test expr-28.167 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +71803914657 E292 x 10c0c44cdc2c05_11111111111111111111111111111111111111111110& E1006 convertToDouble +71803914657E292 } 0x7ed0c0c44cdc2c06 test expr-28.168 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +36314223356 E-109 x 1fc575867314ed_111111111111111111111111111111111111111111110& E-328 convertToDouble +36314223356E-109 } 0x2b7fc575867314ee test expr-28.169 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +18157111678 E-109 x 1fc575867314ed_111111111111111111111111111111111111111111110& E-329 convertToDouble +18157111678E-109 } 0x2b6fc575867314ee test expr-28.170 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -45392779195 E-110 x -1fc575867314ed_111111111111111111111111111111111111111111110& E-331 convertToDouble -45392779195E-110 } 0xab4fc575867314ee test expr-28.171 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +778380362293 E218 x 19ab8261990292_0000000000000000000000000000000000000000000000000001& E763 convertToDouble +778380362293E218 } 0x6fa9ab8261990292 test expr-28.172 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -685763015669 E280 x -15fd7aa44d9477_000000000000000000000000000000000000000000000001& E969 convertToDouble -685763015669E280 } 0xfc85fd7aa44d9477 test expr-28.173 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +952918668151 E70 x 14177a9915fbf8_00000000000000000000000000000000000000000000001& E272 convertToDouble +952918668151E70 } 0x50f4177a9915fbf8 test expr-28.174 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -548357443505 E32 x -13abde2775e9b5_0000000000000000000000000000000000000000000001& E145 convertToDouble -548357443505E32 } 0xc903abde2775e9b5 test expr-28.175 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +384865004907 E-285 x 1aa65b58639e69_00000000000000000000000000000000000000000000001& E-909 convertToDouble +384865004907E-285 } 0x072aa65b58639e69 test expr-28.176 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -769730009814 E-285 x -1aa65b58639e69_00000000000000000000000000000000000000000000001& E-908 convertToDouble -769730009814E-285 } 0x873aa65b58639e69 test expr-28.177 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +697015418417 E-93 x 152847dad80453_0000000000000000000000000000000000000000000001& E-270 convertToDouble +697015418417E-93 } 0x2f152847dad80453 test expr-28.178 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -915654049301 E-28 x -1a645598d05989_0000000000000000000000000000000000000000000001& E-54 convertToDouble -915654049301E-28 } 0xbc9a645598d05989 test expr-28.179 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +178548656339 E169 x 1b89d67c5b6d24_111111111111111111111111111111111111111111110& E598 convertToDouble +178548656339E169 } 0x655b89d67c5b6d25 test expr-28.180 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -742522891517 E259 x -1c1c352fc3c308_11111111111111111111111111111111111111111111110& E899 convertToDouble -742522891517E259 } 0xf82c1c352fc3c309 test expr-28.181 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +742522891517 E258 x 167cf7596968d3_11111111111111111111111111111111111111111111110& E896 convertToDouble +742522891517E258 } 0x77f67cf7596968d4 test expr-28.182 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -357097312678 E169 x -1b89d67c5b6d24_111111111111111111111111111111111111111111110& E599 convertToDouble -357097312678E169 } 0xe56b89d67c5b6d25 test expr-28.183 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3113521449172 E218 x -19ab8261990292_0000000000000000000000000000000000000000000000000001& E765 convertToDouble -3113521449172E218 } 0xefc9ab8261990292 test expr-28.184 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3891901811465 E217 x 19ab8261990292_0000000000000000000000000000000000000000000000000001& E762 convertToDouble +3891901811465E217 } 0x6f99ab8261990292 test expr-28.185 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1556760724586 E218 x -19ab8261990292_0000000000000000000000000000000000000000000000000001& E764 convertToDouble -1556760724586E218 } 0xefb9ab8261990292 test expr-28.186 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9997878507563 E-195 x 153db2fea1ea31_0000000000000000000000000000000000000000000000001& E-605 convertToDouble +9997878507563E-195 } 0x1a253db2fea1ea31 test expr-28.187 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7247563029154 E-319 x -10493f056e9ef3_0000000000000000000000000000000000000000000000001& E-1017 convertToDouble -7247563029154E-319 } 0x8060493f056e9ef3 test expr-28.188 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3623781514577 E-319 x 10493f056e9ef3_0000000000000000000000000000000000000000000000001& E-1018 convertToDouble +3623781514577E-319 } 0x0050493f056e9ef3 test expr-28.189 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3092446298323 E-200 x -113918353bbc47_0000000000000000000000000000000000000000000000001& E-623 convertToDouble -3092446298323E-200 } 0x99013918353bbc47 test expr-28.190 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6363857920591 E145 x 128a61cf9483b6_1111111111111111111111111111111111111111111111111110& E524 convertToDouble +6363857920591E145 } 0x60b28a61cf9483b7 test expr-28.191 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8233559360849 E94 x -11f324d11d4861_1111111111111111111111111111111111111111111111110& E355 convertToDouble -8233559360849E94 } 0xd621f324d11d4862 test expr-28.192 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2689845954547 E49 x 10bd2bfd34f98a_1111111111111111111111111111111111111111111111110& E204 convertToDouble +2689845954547E49 } 0x4cb0bd2bfd34f98b test expr-28.193 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5379691909094 E49 x -10bd2bfd34f98a_1111111111111111111111111111111111111111111111110& E205 convertToDouble -5379691909094E49 } 0xccc0bd2bfd34f98b test expr-28.194 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5560322501926 E-301 x 15acc2053064c1_11111111111111111111111111111111111111111111111110& E-958 convertToDouble +5560322501926E-301 } 0x0415acc2053064c2 test expr-28.195 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7812878489261 E-179 x -126dae7bbeda74_11111111111111111111111111111111111111111111111111110& E-552 convertToDouble -7812878489261E-179 } 0x9d726dae7bbeda75 test expr-28.196 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8439398533053 E-256 x 170cc285f2d209_1111111111111111111111111111111111111111111111110& E-808 convertToDouble +8439398533053E-256 } 0x0d770cc285f2d20a test expr-28.197 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2780161250963 E-301 x -15acc2053064c1_11111111111111111111111111111111111111111111111110& E-959 convertToDouble -2780161250963E-301 } 0x8405acc2053064c2 test expr-28.198 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -87605699161665 E155 x -12920f96e7f9ef_00000000000000000000000000000000000000000000000000001& E561 convertToDouble -87605699161665E155 } 0xe302920f96e7f9ef test expr-28.199 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -17521139832333 E156 x -12920f96e7f9ef_00000000000000000000000000000000000000000000000000001& E562 convertToDouble -17521139832333E156 } 0xe312920f96e7f9ef test expr-28.200 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -88218101363513 E-170 x -18395688592faf_0000000000000000000000000000000000000000000000000001& E-519 convertToDouble -88218101363513E-170 } 0x9f88395688592faf test expr-28.201 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +38639244311627 E-115 x 114ef3e205c817_0000000000000000000000000000000000000000000000000001& E-337 convertToDouble +38639244311627E-115 } 0x2ae14ef3e205c817 test expr-28.202 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +35593959807306 E261 x 1072f3819c1320_11111111111111111111111111111111111111111111111111110& E912 convertToDouble +35593959807306E261 } 0x78f072f3819c1321 test expr-28.203 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -53390939710959 E260 x -13bd243521b08d_11111111111111111111111111111111111111111111111111110& E909 convertToDouble -53390939710959E260 } 0xf8c3bd243521b08e test expr-28.204 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +71187919614612 E261 x 1072f3819c1320_11111111111111111111111111111111111111111111111111110& E913 convertToDouble +71187919614612E261 } 0x790072f3819c1321 test expr-28.205 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -88984899518265 E260 x -1072f3819c1320_11111111111111111111111111111111111111111111111111110& E910 convertToDouble -88984899518265E260 } 0xf8d072f3819c1321 test expr-28.206 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +77003665618895 E-73 x 18bf7e7fa6f029_111111111111111111111111111111111111111111111111111111110& E-197 convertToDouble +77003665618895E-73 } 0x33a8bf7e7fa6f02a test expr-28.207 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -15400733123779 E-72 x -18bf7e7fa6f029_111111111111111111111111111111111111111111111111111111110& E-196 convertToDouble -15400733123779E-72 } 0xb3b8bf7e7fa6f02a test expr-28.208 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +61602932495116 E-72 x 18bf7e7fa6f029_111111111111111111111111111111111111111111111111111111110& E-194 convertToDouble +61602932495116E-72 } 0x33d8bf7e7fa6f02a test expr-28.209 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -30801466247558 E-72 x -18bf7e7fa6f029_111111111111111111111111111111111111111111111111111111110& E-195 convertToDouble -30801466247558E-72 } 0xb3c8bf7e7fa6f02a test expr-28.210 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +834735494917063 E-300 x 1fc6c26f899dd1_0000000000000000000000000000000000000000000000000000000001& E-948 convertToDouble +834735494917063E-300 } 0x04bfc6c26f899dd1 test expr-28.211 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -589795149206434 E-151 x -15f2df5e675a0f_0000000000000000000000000000000000000000000000000000000001& E-453 convertToDouble -589795149206434E-151 } 0xa3a5f2df5e675a0f test expr-28.212 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +475603213226859 E-42 x 12d73088f4050a_000000000000000000000000000000000000000000000000000000001& E-91 convertToDouble +475603213226859E-42 } 0x3a42d73088f4050a test expr-28.213 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -294897574603217 E-151 x -15f2df5e675a0f_0000000000000000000000000000000000000000000000000000000001& E-454 convertToDouble -294897574603217E-151 } 0xa395f2df5e675a0f test expr-28.214 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +850813008001913 E93 x 172f7a1831ad70_11111111111111111111111111111111111111111111111111111110& E358 convertToDouble +850813008001913E93 } 0x56572f7a1831ad71 test expr-28.215 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -203449172043339 E185 x -1102b47e4af987_11111111111111111111111111111111111111111111111111111110& E662 convertToDouble -203449172043339E185 } 0xe95102b47e4af988 test expr-28.216 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +406898344086678 E185 x 1102b47e4af987_11111111111111111111111111111111111111111111111111111110& E663 convertToDouble +406898344086678E185 } 0x696102b47e4af988 test expr-28.217 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -813796688173356 E185 x -1102b47e4af987_11111111111111111111111111111111111111111111111111111110& E664 convertToDouble -813796688173356E185 } 0xe97102b47e4af988 test expr-28.218 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6045338514609393 E244 x 1f746182e6cd5d_00000000000000000000000000000000000000000000000000000000001& E862 convertToDouble +6045338514609393E244 } 0x75df746182e6cd5d test expr-28.219 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5145963778954906 E142 x -1dfc11fbf46087_00000000000000000000000000000000000000000000000000000000001& E523 convertToDouble -5145963778954906E142 } 0xe0adfc11fbf46087 test expr-28.220 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2572981889477453 E142 x 1dfc11fbf46087_00000000000000000000000000000000000000000000000000000000001& E522 convertToDouble +2572981889477453E142 } 0x609dfc11fbf46087 test expr-28.221 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6965949469487146 E74 x -15e2c10ad970b0_0000000000000000000000000000000000000000000000000000000001& E298 convertToDouble -6965949469487146E74 } 0xd295e2c10ad970b0 test expr-28.222 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6182410494241627 E-119 x 11b96458445d07_0000000000000000000000000000000000000000000000000000000000001& E-343 convertToDouble +6182410494241627E-119 } 0x2a81b96458445d07 test expr-28.223 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8510309498186985 E-277 x -1acc46749dccfe_000000000000000000000000000000000000000000000000000000000001& E-868 convertToDouble -8510309498186985E-277 } 0x89bacc46749dccfe test expr-28.224 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6647704637273331 E-212 x 13e07d2c0cb1e9_0000000000000000000000000000000000000000000000000000000000001& E-652 convertToDouble +6647704637273331E-212 } 0x1733e07d2c0cb1e9 test expr-28.225 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2215901545757777 E-212 x -1a80a6e566428c_000000000000000000000000000000000000000000000000000000000001& E-654 convertToDouble -2215901545757777E-212 } 0x971a80a6e566428c test expr-28.226 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3771476185376383 E276 x 183010aba78a53_111111111111111111111111111111111111111111111111111111111110& E968 convertToDouble +3771476185376383E276 } 0x7c783010aba78a54 test expr-28.227 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3729901848043846 E212 x -1f7d6721f7f143_111111111111111111111111111111111111111111111111111111111110& E755 convertToDouble -3729901848043846E212 } 0xef2f7d6721f7f144 test expr-28.228 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3771476185376383 E277 x 1e3c14d6916ce8_111111111111111111111111111111111111111111111111111111111110& E971 convertToDouble +3771476185376383E277 } 0x7cae3c14d6916ce9 test expr-28.229 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9977830465649166 E119 x -15f6de9d5d6b5a_111111111111111111111111111111111111111111111111111111111110& E448 convertToDouble -9977830465649166E119 } 0xdbf5f6de9d5d6b5b test expr-28.230 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8439928496349319 E-142 x 12483a0f125699_111111111111111111111111111111111111111111111111111111111110& E-419 convertToDouble +8439928496349319E-142 } 0x25c2483a0f12569a test expr-28.231 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8204230082070882 E-59 x -1d460f4fca1d36_1111111111111111111111111111111111111111111111111111111110& E-144 convertToDouble -8204230082070882E-59 } 0xb6fd460f4fca1d37 test expr-28.232 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8853686434843997 E-244 x 157a340eb5d4f0_11111111111111111111111111111111111111111111111111111111110& E-758 convertToDouble +8853686434843997E-244 } 0x10957a340eb5d4f1 test expr-28.233 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5553274272288559 E-104 x -1c47d20a19d1ed_1111111111111111111111111111111111111111111111111111111110& E-294 convertToDouble -5553274272288559E-104 } 0xad9c47d20a19d1ee test expr-28.234 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +36149023611096162 E144 x 1491daad0ba280_0000000000000000000000000000000000000000000000000000000000000001& E533 convertToDouble +36149023611096162E144 } 0x614491daad0ba280 test expr-28.235 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -36149023611096162 E147 x -14166f8cfd5cb1_0000000000000000000000000000000000000000000000000000000000000001& E543 convertToDouble -36149023611096162E147 } 0xe1e4166f8cfd5cb1 test expr-28.236 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +18074511805548081 E146 x 1011f2d73116f4_0000000000000000000000000000000000000000000000000000000000000001& E539 convertToDouble +18074511805548081E146 } 0x61a011f2d73116f4 test expr-28.237 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -18074511805548081 E147 x -14166f8cfd5cb1_0000000000000000000000000000000000000000000000000000000000000001& E542 convertToDouble -18074511805548081E147 } 0xe1d4166f8cfd5cb1 test expr-28.238 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +97338774138954421 E-290 x 10d9b828199006_0000000000000000000000000000000000000000000000000000000000000001& E-907 convertToDouble +97338774138954421E-290 } 0x0740d9b828199006 test expr-28.239 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -88133809804950961 E-308 x -119710dc581911_000000000000000000000000000000000000000000000000000000000000001& E-967 convertToDouble -88133809804950961E-308 } 0x83819710dc581911 test expr-28.240 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +94080055902682397 E-243 x 11d467e94b856e_0000000000000000000000000000000000000000000000000000000000000001& E-751 convertToDouble +94080055902682397E-243 } 0x1101d467e94b856e test expr-28.241 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -24691002732654881 E-115 x -159a2783ce70ab_000000000000000000000000000000000000000000000000000000000000001& E-328 convertToDouble -24691002732654881E-115 } 0xab759a2783ce70ab test expr-28.242 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +52306490527514614 E49 x 13de005bd620de_111111111111111111111111111111111111111111111111111111111111111110& E218 convertToDouble +52306490527514614E49 } 0x4d93de005bd620df test expr-28.243 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -26153245263757307 E49 x -13de005bd620de_111111111111111111111111111111111111111111111111111111111111111110& E217 convertToDouble -26153245263757307E49 } 0xcd83de005bd620df test expr-28.244 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +55188692254193604 E165 x 1a999ddec72ac9_11111111111111111111111111111111111111111111111111111111111110& E603 convertToDouble +55188692254193604E165 } 0x65aa999ddec72aca test expr-28.245 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -68985865317742005 E164 x -1a999ddec72ac9_11111111111111111111111111111111111111111111111111111111111110& E600 convertToDouble -68985865317742005E164 } 0xe57a999ddec72aca test expr-28.246 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +27176258005319167 E-261 x 17c0747bd76fa0_11111111111111111111111111111111111111111111111111111111111111110& E-813 convertToDouble +27176258005319167E-261 } 0x0d27c0747bd76fa1 test expr-28.247 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -73169230107256116 E-248 x -122cea327fa99c_1111111111111111111111111111111111111111111111111111111111110& E-768 convertToDouble -73169230107256116E-248 } 0x8ff22cea327fa99d test expr-28.248 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +91461537634070145 E-249 x 122cea327fa99c_1111111111111111111111111111111111111111111111111111111111110& E-771 convertToDouble +91461537634070145E-249 } 0x0fc22cea327fa99d test expr-28.249 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -54352516010638334 E-261 x -17c0747bd76fa0_11111111111111111111111111111111111111111111111111111111111111110& E-812 convertToDouble -54352516010638334E-261 } 0x8d37c0747bd76fa1 test expr-28.250 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +586144289638535878 E280 x 11eccbd6f62709_0000000000000000000000000000000000000000000000000000000000000000001& E989 convertToDouble +586144289638535878E280 } 0x7dc1eccbd6f62709 test expr-28.251 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -601117006785295431 E245 x -1e8b3525b3737e_000000000000000000000000000000000000000000000000000000000000000001& E872 convertToDouble -601117006785295431E245 } 0xf67e8b3525b3737e test expr-28.252 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +293072144819267939 E280 x 11eccbd6f62709_0000000000000000000000000000000000000000000000000000000000000000001& E988 convertToDouble +293072144819267939E280 } 0x7db1eccbd6f62709 test expr-28.253 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -953184713238516652 E272 x -138fd93f1f5342_00000000000000000000000000000000000000000000000000000000000000001& E963 convertToDouble -953184713238516652E272 } 0xfc238fd93f1f5342 test expr-28.254 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +902042358290366539 E-281 x 122dc01ca1cb8c_0000000000000000000000000000000000000000000000000000000000000000001& E-874 convertToDouble +902042358290366539E-281 } 0x09522dc01ca1cb8c test expr-28.255 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -557035730189854663 E-294 x -13bfac6bc4767b_00000000000000000000000000000000000000000000000000000000000000000001& E-918 convertToDouble -557035730189854663E-294 } 0x8693bfac6bc4767b test expr-28.256 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +902042358290366539 E-280 x 16b93023ca3e6f_0000000000000000000000000000000000000000000000000000000000000000001& E-871 convertToDouble +902042358290366539E-280 } 0x0986b93023ca3e6f test expr-28.257 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -354944100507554393 E-238 x -19a91cece6ad07_000000000000000000000000000000000000000000000000000000000000000001& E-733 convertToDouble -354944100507554393E-238 } 0x9229a91cece6ad07 test expr-28.258 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +272104041512242479 E199 x 1f92bacb3cb40b_11111111111111111111111111111111111111111111111111111111111111111111110& E718 convertToDouble +272104041512242479E199 } 0x6cdf92bacb3cb40c test expr-28.259 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -816312124536727437 E199 x -17ae0c186d8708_11111111111111111111111111111111111111111111111111111111111111111111110& E720 convertToDouble -816312124536727437E199 } 0xecf7ae0c186d8709 test expr-28.260 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +544208083024484958 E199 x 1f92bacb3cb40b_11111111111111111111111111111111111111111111111111111111111111111111110& E719 convertToDouble +544208083024484958E199 } 0x6cef92bacb3cb40c test expr-28.261 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -792644927852378159 E78 x -17bff336d8ff05_111111111111111111111111111111111111111111111111111111111111111111110& E318 convertToDouble -792644927852378159E78 } 0xd3d7bff336d8ff06 test expr-28.262 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -679406450132979175 E-263 x -17c0747bd76fa0_11111111111111111111111111111111111111111111111111111111111111110& E-815 convertToDouble -679406450132979175E-263 } 0x8d07c0747bd76fa1 test expr-28.263 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +543525160106383340 E-262 x 17c0747bd76fa0_11111111111111111111111111111111111111111111111111111111111111110& E-812 convertToDouble +543525160106383340E-262 } 0x0d37c0747bd76fa1 test expr-28.264 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7400253695682920196 E215 x 1dca94e3990085_00000000000000000000000000000000000000000000000000000000000000000000001& E776 convertToDouble +7400253695682920196E215 } 0x707dca94e3990085 test expr-28.265 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1850063423920730049 E215 x -1dca94e3990085_00000000000000000000000000000000000000000000000000000000000000000000001& E774 convertToDouble -1850063423920730049E215 } 0xf05dca94e3990085 test expr-28.266 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3700126847841460098 E215 x 1dca94e3990085_00000000000000000000000000000000000000000000000000000000000000000000001& E775 convertToDouble +3700126847841460098E215 } 0x706dca94e3990085 test expr-28.267 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9250317119603650245 E214 x -1dca94e3990085_00000000000000000000000000000000000000000000000000000000000000000000001& E773 convertToDouble -9250317119603650245E214 } 0xf04dca94e3990085 test expr-28.268 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8396094300569779681 E-252 x 1ab223efcee35a_0000000000000000000000000000000000000000000000000000000000000000000000001& E-775 convertToDouble +8396094300569779681E-252 } 0x0f8ab223efcee35a test expr-28.269 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3507665085003296281 E-75 x -160499b881ea50_00000000000000000000000000000000000000000000000000000000000000000000001& E-188 convertToDouble -3507665085003296281E-75 } 0xb4360499b881ea50 test expr-28.270 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7015330170006592562 E-75 x 160499b881ea50_00000000000000000000000000000000000000000000000000000000000000000000001& E-187 convertToDouble +7015330170006592562E-75 } 0x34460499b881ea50 test expr-28.271 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7015330170006592562 E-74 x -1b85c026a264e4_00000000000000000000000000000000000000000000000000000000000000000000001& E-184 convertToDouble -7015330170006592562E-74 } 0xb47b85c026a264e4 test expr-28.272 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7185620434951919351 E205 x 18d92d2bcc7a80_1111111111111111111111111111111111111111111111111111111111111111111111110& E743 convertToDouble +7185620434951919351E205 } 0x6e68d92d2bcc7a81 test expr-28.273 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1360520207561212395 E198 x -1f92bacb3cb40b_11111111111111111111111111111111111111111111111111111111111111111111110& E717 convertToDouble -1360520207561212395E198 } 0xeccf92bacb3cb40c test expr-28.274 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2178999185345151731 E-184 x 19b2c4d2a82335_1111111111111111111111111111111111111111111111111111111111111111111110& E-551 convertToDouble +2178999185345151731E-184 } 0x1d89b2c4d2a82336 test expr-28.275 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8691089486201567102 E-218 x -1a9c42e5b6d89e_1111111111111111111111111111111111111111111111111111111111111111111110& E-662 convertToDouble -8691089486201567102E-218 } 0x969a9c42e5b6d89f test expr-28.276 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4345544743100783551 E-218 x 1a9c42e5b6d89e_1111111111111111111111111111111111111111111111111111111111111111111110& E-663 convertToDouble +4345544743100783551E-218 } 0x168a9c42e5b6d89f test expr-28.277 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -4357998370690303462 E-184 x -19b2c4d2a82335_1111111111111111111111111111111111111111111111111111111111111111111110& E-550 convertToDouble -4357998370690303462E-184 } 0x9d99b2c4d2a82336 test expr-28.278 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +59825267349106892461 E177 x 199c476d7868df_000000000000000000000000000000000000000000000000000000000000000000000001& E653 convertToDouble +59825267349106892461E177 } 0x68c99c476d7868df test expr-28.279 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -62259110684423957791 E47 x -1d8f2cfc20d6e8_0000000000000000000000000000000000000000000000000000000000000000000000001& E221 convertToDouble -62259110684423957791E47 } 0xcdcd8f2cfc20d6e8 test expr-28.280 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +58380168477038565599 E265 x 1f686e9efbe48d_00000000000000000000000000000000000000000000000000000000000000000000000001& E945 convertToDouble +58380168477038565599E265 } 0x7b0f686e9efbe48d test expr-28.281 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -62259110684423957791 E48 x -12797c1d948651_0000000000000000000000000000000000000000000000000000000000000000000000001& E225 convertToDouble -62259110684423957791E48 } 0xce02797c1d948651 test expr-28.282 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -33584377202279118724 E-252 x -1ab223efcee35a_0000000000000000000000000000000000000000000000000000000000000000000000001& E-773 convertToDouble -33584377202279118724E-252 } 0x8faab223efcee35a test expr-28.283 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -57484963479615354808 E205 x -18d92d2bcc7a80_1111111111111111111111111111111111111111111111111111111111111111111111110& E746 convertToDouble -57484963479615354808E205 } 0xee98d92d2bcc7a81 test expr-28.284 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +71856204349519193510 E204 x 18d92d2bcc7a80_1111111111111111111111111111111111111111111111111111111111111111111111110& E743 convertToDouble +71856204349519193510E204 } 0x6e68d92d2bcc7a81 test expr-28.285 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -14371240869903838702 E205 x -18d92d2bcc7a80_1111111111111111111111111111111111111111111111111111111111111111111111110& E744 convertToDouble -14371240869903838702E205 } 0xee78d92d2bcc7a81 test expr-28.286 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +36992084760177624177 E-318 x 18c5f9551c2f99_111111111111111111111111111111111111111111111111111111111111111111111110& E-992 convertToDouble +36992084760177624177E-318 } 0x01f8c5f9551c2f9a test expr-28.287 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -73984169520355248354 E-318 x -18c5f9551c2f99_111111111111111111111111111111111111111111111111111111111111111111111110& E-991 convertToDouble -73984169520355248354E-318 } 0x8208c5f9551c2f9a test expr-28.288 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +99257763227713890244 E-115 x 15338a554b9ce0_11111111111111111111111111111111111111111111111111111111111111111111110& E-316 convertToDouble +99257763227713890244E-115 } 0x2c35338a554b9ce1 test expr-28.289 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -87336362425182547697 E-280 x -1130304e7d9c32_11111111111111111111111111111111111111111111111111111111111111111111110& E-864 convertToDouble -87336362425182547697E-280 } 0x89f130304e7d9c33 test expr-28.290 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7 E289 x 1cbb547777a284_10000000001& E962 convertToDouble +7E289 } 0x7c1cbb547777a285 test expr-28.291 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3 E153 x -1ca3d8e6d80cba_100000001& E509 convertToDouble -3E153 } 0xdfcca3d8e6d80cbb test expr-28.292 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6 E153 x 1ca3d8e6d80cba_100000001& E510 convertToDouble +6E153 } 0x5fdca3d8e6d80cbb test expr-28.293 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5 E243 x -176ec98994f488_10000001& E809 convertToDouble -5E243 } 0xf2876ec98994f489 test expr-28.294 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7 E-161 x 1f7e0db3799aa2_10000000001& E-533 convertToDouble +7E-161 } 0x1eaf7e0db3799aa3 test expr-28.295 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7 E-172 x -15a4337446ef2a_1000000001& E-569 convertToDouble -7E-172 } 0x9c65a4337446ef2b test expr-28.296 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8 E-63 x 1a53fc9631d10c_10000001& E-207 convertToDouble +8E-63 } 0x330a53fc9631d10d test expr-28.297 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7 E-113 x -158c47e6eea282_10000001& E-373 convertToDouble -7E-113 } 0xa8a58c47e6eea283 test expr-28.298 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8 E126 x 17a2ecc414a03f_0111111111110& E421 convertToDouble +8E126 } 0x5a47a2ecc414a03f test expr-28.299 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -4 E126 x -17a2ecc414a03f_0111111111110& E420 convertToDouble -4E126 } 0xda37a2ecc414a03f test expr-28.300 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5 E125 x 17a2ecc414a03f_0111111111110& E417 convertToDouble +5E125 } 0x5a07a2ecc414a03f test expr-28.301 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1 E126 x -17a2ecc414a03f_0111111111110& E418 convertToDouble -1E126 } 0xda17a2ecc414a03f test expr-28.302 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8 E-163 x 1708d0f84d3de7_011111110& E-539 convertToDouble +8E-163 } 0x1e4708d0f84d3de7 test expr-28.303 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1 E-163 x -1708d0f84d3de7_011111110& E-542 convertToDouble -1E-163 } 0x9e1708d0f84d3de7 test expr-28.304 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2 E-163 x 1708d0f84d3de7_011111110& E-541 convertToDouble +2E-163 } 0x1e2708d0f84d3de7 test expr-28.305 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -4 E-163 x -1708d0f84d3de7_011111110& E-540 convertToDouble -4E-163 } 0x9e3708d0f84d3de7 test expr-28.306 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +51 E195 x 15d51d249dca42_1000000000001& E653 convertToDouble +51E195 } 0x68c5d51d249dca43 test expr-28.307 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -37 E46 x -1033d7eca0adee_100000000000001& E158 convertToDouble -37E46 } 0xc9d033d7eca0adef test expr-28.308 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +74 E46 x 1033d7eca0adee_100000000000001& E159 convertToDouble +74E46 } 0x49e033d7eca0adef test expr-28.309 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -56 E289 x -1cbb547777a284_10000000001& E965 convertToDouble -56E289 } 0xfc4cbb547777a285 test expr-28.310 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +69 E-145 x 158a41b31c9a9a_100000000001& E-476 convertToDouble +69E-145 } 0x22358a41b31c9a9b test expr-28.311 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -70 E-162 x -1f7e0db3799aa2_10000000001& E-533 convertToDouble -70E-162 } 0x9eaf7e0db3799aa3 test expr-28.312 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +56 E-161 x 1f7e0db3799aa2_10000000001& E-530 convertToDouble +56E-161 } 0x1edf7e0db3799aa3 test expr-28.313 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -21 E-303 x -1ccd59caa6a750_10000000001& E-1003 convertToDouble -21E-303 } 0x814ccd59caa6a751 test expr-28.314 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +34 E-276 x 12d5a4350d30ff_011111111110& E-912 convertToDouble +34E-276 } 0x06f2d5a4350d30ff test expr-28.315 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -68 E-276 x -12d5a4350d30ff_011111111110& E-911 convertToDouble -68E-276 } 0x8702d5a4350d30ff test expr-28.316 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +85 E-277 x 12d5a4350d30ff_011111111110& E-914 convertToDouble +85E-277 } 0x06d2d5a4350d30ff test expr-28.317 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -87 E-274 x -12d36cf48e7abd_011111111111110& E-904 convertToDouble -87E-274 } 0x8772d36cf48e7abd test expr-28.318 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +829 E102 x 17221a79cdd1d8_1000000000000001& E348 convertToDouble +829E102 } 0x55b7221a79cdd1d9 test expr-28.319 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -623 E100 x -1640a62f3a83de_10000000000000000001& E341 convertToDouble -623E100 } 0xd54640a62f3a83df test expr-28.320 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +723 E-162 x 145457ee24abd2_1000000000000001& E-529 convertToDouble +723E-162 } 0x1ee45457ee24abd3 test expr-28.321 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -457 E-102 x -1ffc81bc29f02a_100000000000000001& E-331 convertToDouble -457E-102 } 0xab4ffc81bc29f02b test expr-28.322 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +914 E-102 x 1ffc81bc29f02a_100000000000000001& E-330 convertToDouble +914E-102 } 0x2b5ffc81bc29f02b test expr-28.323 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -323 E-135 x -1d589ae4d70218_10000000000001& E-441 convertToDouble -323E-135 } 0xa46d589ae4d70219 test expr-28.324 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +151 E176 x 1dcf7df8f573b7_0111111111111111110& E591 convertToDouble +151E176 } 0x64edcf7df8f573b7 test expr-28.325 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -302 E176 x -1dcf7df8f573b7_0111111111111111110& E592 convertToDouble -302E176 } 0xe4fdcf7df8f573b7 test expr-28.326 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +921 E90 x 1c420a45fd70ff_0111111111111110& E308 convertToDouble +921E90 } 0x533c420a45fd70ff test expr-28.327 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -604 E176 x -1dcf7df8f573b7_0111111111111111110& E593 convertToDouble -604E176 } 0xe50dcf7df8f573b7 test expr-28.328 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +823 E-206 x 14a48933c208ad_0111111111111110& E-675 convertToDouble +823E-206 } 0x15c4a48933c208ad test expr-28.329 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -463 E-114 x -11d0c83f6378a5_011111111111110& E-370 convertToDouble -463E-114 } 0xa8d1d0c83f6378a5 test expr-28.330 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +348 E-274 x 12d36cf48e7abd_011111111111110& E-902 convertToDouble +348E-274 } 0x0792d36cf48e7abd test expr-28.331 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9968 E100 x 1640a62f3a83de_10000000000000000001& E345 convertToDouble +9968E100 } 0x558640a62f3a83df test expr-28.332 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6230 E99 x -1640a62f3a83de_10000000000000000001& E341 convertToDouble -6230E99 } 0xd54640a62f3a83df test expr-28.333 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1246 E100 x 1640a62f3a83de_10000000000000000001& E342 convertToDouble +1246E100 } 0x555640a62f3a83df test expr-28.334 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6676 E-296 x 15519ac5142aaa_1000000000000000000001& E-971 convertToDouble +6676E-296 } 0x0345519ac5142aab test expr-28.335 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8345 E-297 x -15519ac5142aaa_1000000000000000000001& E-974 convertToDouble -8345E-297 } 0x8315519ac5142aab test expr-28.336 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1669 E-296 x 15519ac5142aaa_1000000000000000000001& E-973 convertToDouble +1669E-296 } 0x0325519ac5142aab test expr-28.337 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3338 E-296 x -15519ac5142aaa_1000000000000000000001& E-972 convertToDouble -3338E-296 } 0x8335519ac5142aab test expr-28.338 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3257 E58 x 1444b34a6fb3eb_01111111111111111110& E204 convertToDouble +3257E58 } 0x4cb444b34a6fb3eb test expr-28.339 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6514 E58 x -1444b34a6fb3eb_01111111111111111110& E205 convertToDouble -6514E58 } 0xccc444b34a6fb3eb test expr-28.340 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2416 E176 x 1dcf7df8f573b7_0111111111111111110& E595 convertToDouble +2416E176 } 0x652dcf7df8f573b7 test expr-28.341 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8085 E-63 x 19fbf3c19b9a79_0111111111111111110& E-197 convertToDouble +8085E-63 } 0x33a9fbf3c19b9a79 test expr-28.342 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3234 E-62 x -19fbf3c19b9a79_0111111111111111110& E-195 convertToDouble -3234E-62 } 0xb3c9fbf3c19b9a79 test expr-28.343 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1617 E-62 x 19fbf3c19b9a79_0111111111111111110& E-196 convertToDouble +1617E-62 } 0x33b9fbf3c19b9a79 test expr-28.344 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6468 E-62 x -19fbf3c19b9a79_0111111111111111110& E-194 convertToDouble -6468E-62 } 0xb3d9fbf3c19b9a79 test expr-28.345 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +53418 E111 x 15b1051df943a8_1000000000000000000001& E384 convertToDouble +53418E111 } 0x57f5b1051df943a9 test expr-28.346 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -60513 E160 x -15043b64e56c72_1000000000000000000001& E547 convertToDouble -60513E160 } 0xe225043b64e56c73 test expr-28.347 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +26709 E111 x 15b1051df943a8_1000000000000000000001& E383 convertToDouble +26709E111 } 0x57e5b1051df943a9 test expr-28.348 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -99447 E166 x -10782189b336ae_1000000000000000000001& E568 convertToDouble -99447E166 } 0xe370782189b336af test expr-28.349 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +12549 E48 x 10c52fe6dc6a1b_011111111111111111111110& E173 convertToDouble +12549E48 } 0x4ac0c52fe6dc6a1b test expr-28.350 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -25098 E48 x -10c52fe6dc6a1b_011111111111111111111110& E174 convertToDouble -25098E48 } 0xcad0c52fe6dc6a1b test expr-28.351 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +50196 E48 x 10c52fe6dc6a1b_011111111111111111111110& E175 convertToDouble +50196E48 } 0x4ae0c52fe6dc6a1b test expr-28.352 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -62745 E47 x -10c52fe6dc6a1b_011111111111111111111110& E172 convertToDouble -62745E47 } 0xcab0c52fe6dc6a1b test expr-28.353 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +83771 E-73 x 1ce886fb5ffd6d_0111111111111111111110& E-227 convertToDouble +83771E-73 } 0x31cce886fb5ffd6d test expr-28.354 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -97451 E-167 x -1c0f220fb1c70d_01111111111111111111110& E-539 convertToDouble -97451E-167 } 0x9e4c0f220fb1c70d test expr-28.355 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +86637 E-203 x 10943edb4e81db_0111111111111111111110& E-658 convertToDouble +86637E-203 } 0x16d0943edb4e81db test expr-28.356 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -75569 E-254 x -15a462d91c6ab3_0111111111111111111111111110& E-828 convertToDouble -75569E-254 } 0x8c35a462d91c6ab3 test expr-28.357 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +473806 E83 x 17d15bf3186080_1000000000000000000000001& E294 convertToDouble +473806E83 } 0x5257d15bf3186081 test expr-28.358 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -947612 E83 x -17d15bf3186080_1000000000000000000000001& E295 convertToDouble -947612E83 } 0xd267d15bf3186081 test expr-28.359 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +292369 E76 x 18a85eb277e644_100000000000000000000000001& E270 convertToDouble +292369E76 } 0x50d8a85eb277e645 test expr-28.360 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -584738 E76 x -18a85eb277e644_100000000000000000000000001& E271 convertToDouble -584738E76 } 0xd0e8a85eb277e645 test expr-28.361 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +933587 E-140 x 1b248728b9c116_100000000000000000000000001& E-446 convertToDouble +933587E-140 } 0x241b248728b9c117 test expr-28.362 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -720919 E-14 x -1ef696965cbf04_10000000000000000000000001& E-28 convertToDouble -720919E-14 } 0xbe3ef696965cbf05 test expr-28.363 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +535001 E-149 x 10b38e07c745ae_1000000000000000000000001& E-476 convertToDouble +535001E-149 } 0x2230b38e07c745af test expr-28.364 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -890521 E-235 x -114828ee39c852_1000000000000000000000001& E-761 convertToDouble -890521E-235 } 0x90614828ee39c853 test expr-28.365 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +548057 E81 x 11a1d9135cca53_0111111111111111111111110& E288 convertToDouble +548057E81 } 0x51f1a1d9135cca53 test expr-28.366 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -706181 E88 x -1b156ac4c2d1e5_0111111111111111111111110& E311 convertToDouble -706181E88 } 0xd36b156ac4c2d1e5 test expr-28.367 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +820997 E106 x 1b4f8b64fa125d_0111111111111111111111110& E371 convertToDouble +820997E106 } 0x572b4f8b64fa125d test expr-28.368 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -320681 E63 x -17ca18a876c5ef_0111111111111111111111110& E227 convertToDouble -320681E63 } 0xce27ca18a876c5ef test expr-28.369 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +928609 E-261 x 1be2dd66200bef_011111111111111111111111111110& E-848 convertToDouble +928609E-261 } 0x0afbe2dd66200bef test expr-28.370 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -302276 E-254 x -15a462d91c6ab3_0111111111111111111111111110& E-826 convertToDouble -302276E-254 } 0x8c55a462d91c6ab3 test expr-28.371 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +151138 E-254 x 15a462d91c6ab3_0111111111111111111111111110& E-827 convertToDouble +151138E-254 } 0x0c45a462d91c6ab3 test expr-28.372 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4691773 E45 x 19147b9330eaae_1000000000000000000000000001& E171 convertToDouble +4691773E45 } 0x4aa9147b9330eaaf test expr-28.373 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9383546 E45 x -19147b9330eaae_1000000000000000000000000001& E172 convertToDouble -9383546E45 } 0xcab9147b9330eaaf test expr-28.374 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3059949 E-243 x 13ecf22ea07862_10000000000000000000000000001& E-786 convertToDouble +3059949E-243 } 0x0ed3ecf22ea07863 test expr-28.375 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6119898 E-243 x -13ecf22ea07862_10000000000000000000000000001& E-785 convertToDouble -6119898E-243 } 0x8ee3ecf22ea07863 test expr-28.376 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5356626 E-213 x 1b84252abdf6ba_100000000000000000000000001& E-686 convertToDouble +5356626E-213 } 0x151b84252abdf6bb test expr-28.377 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -4877378 E-199 x -11cd5cd90cb200_100000000000000000000000001& E-639 convertToDouble -4877378E-199 } 0x9801cd5cd90cb201 test expr-28.378 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7716693 E223 x 1972d9d2cff683_01111111111111111111111111110& E763 convertToDouble +7716693E223 } 0x6fa972d9d2cff683 test expr-28.379 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5452869 E109 x -16247b136fecc3_01111111111111111111111111110& E384 convertToDouble -5452869E109 } 0xd7f6247b136fecc3 test expr-28.380 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4590831 E156 x 14689b4a5fa201_011111111111111111111111111110& E540 convertToDouble +4590831E156 } 0x61b4689b4a5fa201 test expr-28.381 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9181662 E156 x -14689b4a5fa201_011111111111111111111111111110& E541 convertToDouble -9181662E156 } 0xe1c4689b4a5fa201 test expr-28.382 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3714436 E-261 x -1be2dd66200bef_011111111111111111111111111110& E-846 convertToDouble -3714436E-261 } 0x8b1be2dd66200bef test expr-28.383 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4643045 E-262 x 1be2dd66200bef_011111111111111111111111111110& E-849 convertToDouble +4643045E-262 } 0x0aebe2dd66200bef test expr-28.384 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7428872 E-261 x -1be2dd66200bef_011111111111111111111111111110& E-845 convertToDouble -7428872E-261 } 0x8b2be2dd66200bef test expr-28.385 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +52942146 E130 x 16c31d08af89c2_10000000000000000000000000000001& E457 convertToDouble +52942146E130 } 0x5c86c31d08af89c3 test expr-28.386 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -27966061 E145 x -155bcf72fd10f8_1000000000000000000000000000000001& E506 convertToDouble -27966061E145 } 0xdf955bcf72fd10f9 test expr-28.387 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +26471073 E130 x 16c31d08af89c2_10000000000000000000000000000001& E456 convertToDouble +26471073E130 } 0x5c76c31d08af89c3 test expr-28.388 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -55932122 E145 x -155bcf72fd10f8_1000000000000000000000000000000001& E507 convertToDouble -55932122E145 } 0xdfa55bcf72fd10f9 test expr-28.389 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +95412548 E-99 x 18e0bfb98864c8_100000000000000000000000000000001& E-303 convertToDouble +95412548E-99 } 0x2d08e0bfb98864c9 test expr-28.390 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -47706274 E-99 x -18e0bfb98864c8_100000000000000000000000000000001& E-304 convertToDouble -47706274E-99 } 0xacf8e0bfb98864c9 test expr-28.391 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +23853137 E-99 x 18e0bfb98864c8_100000000000000000000000000000001& E-305 convertToDouble +23853137E-99 } 0x2ce8e0bfb98864c9 test expr-28.392 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -78493654 E-301 x -140d76077b648e_10000000000000000000000000000001& E-974 convertToDouble -78493654E-301 } 0x83140d76077b648f test expr-28.393 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +65346417 E29 x 13aa1ad778f23b_0111111111111111111111111111110& E122 convertToDouble +65346417E29 } 0x4793aa1ad778f23b test expr-28.394 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -51083099 E167 x -14a75eb58df47b_0111111111111111111111111111110& E580 convertToDouble -51083099E167 } 0xe434a75eb58df47b test expr-28.395 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +89396333 E264 x 1526f061ca9053_0111111111111111111111111111111110& E903 convertToDouble +89396333E264 } 0x786526f061ca9053 test expr-28.396 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -84863171 E114 x -106e98f5ec8f37_0111111111111111111111111111111110& E405 convertToDouble -84863171E114 } 0xd9406e98f5ec8f37 test expr-28.397 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +59540836 E-251 x 10430c2d075c07_011111111111111111111111111111110& E-808 convertToDouble +59540836E-251 } 0x0d70430c2d075c07 test expr-28.398 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -74426045 E-252 x -10430c2d075c07_011111111111111111111111111111110& E-811 convertToDouble -74426045E-252 } 0x8d40430c2d075c07 test expr-28.399 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +14885209 E-251 x 10430c2d075c07_011111111111111111111111111111110& E-810 convertToDouble +14885209E-251 } 0x0d50430c2d075c07 test expr-28.400 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -29770418 E-251 x -10430c2d075c07_011111111111111111111111111111110& E-809 convertToDouble -29770418E-251 } 0x8d60430c2d075c07 test expr-28.401 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +982161308 E122 x 11b6231e18c5ca_100000000000000000000000000000000000000001& E435 convertToDouble +982161308E122 } 0x5b21b6231e18c5cb test expr-28.402 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -245540327 E122 x -11b6231e18c5ca_100000000000000000000000000000000000000001& E433 convertToDouble -245540327E122 } 0xdb01b6231e18c5cb test expr-28.403 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +491080654 E122 x 11b6231e18c5ca_100000000000000000000000000000000000000001& E434 convertToDouble +491080654E122 } 0x5b11b6231e18c5cb test expr-28.404 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +525452622 E-310 x 12045136ce0340_1000000000000000000000000000000000001& E-1001 convertToDouble +525452622E-310 } 0x0162045136ce0341 test expr-28.405 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -771837113 E-134 x -14e61f991c4ed0_100000000000000000000000000000000001& E-416 convertToDouble -771837113E-134 } 0xa5f4e61f991c4ed1 test expr-28.406 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +820858081 E-150 x 14050669985a86_10000000000000000000000000000000001& E-469 convertToDouble +820858081E-150 } 0x22a4050669985a87 test expr-28.407 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -262726311 E-310 x -12045136ce0340_1000000000000000000000000000000000001& E-1002 convertToDouble -262726311E-310 } 0x8152045136ce0341 test expr-28.408 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +923091487 E209 x 10bc60e6896717_011111111111111111111111111111111110& E724 convertToDouble +923091487E209 } 0x6d30bc60e6896717 test expr-28.409 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -653777767 E273 x -120223f2b3a881_0111111111111111111111111111111111111110& E936 convertToDouble -653777767E273 } 0xfa720223f2b3a881 test expr-28.410 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +842116236 E-53 x 1809c5732cdc7f_0111111111111111111111111111111110& E-147 convertToDouble +842116236E-53 } 0x36c809c5732cdc7f test expr-28.411 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -741111169 E-202 x -15a3e1d1b73099_01111111111111111111111111111111110& E-642 convertToDouble -741111169E-202 } 0x97d5a3e1d1b73099 test expr-28.412 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +839507247 E-284 x 129a1effc50859_0111111111111111111111111111111110& E-914 convertToDouble +839507247E-284 } 0x06d29a1effc50859 test expr-28.413 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -951487269 E-264 x -1c92befccb5f59_0111111111111111111111111111111110& E-848 convertToDouble -951487269E-264 } 0x8afc92befccb5f59 test expr-28.414 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9821613080 E121 x -11b6231e18c5ca_100000000000000000000000000000000000000001& E435 convertToDouble -9821613080E121 } 0xdb21b6231e18c5cb test expr-28.415 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6677856011 E-31 x 193a6d11077292_100000000000000000000000000000000000001& E-71 convertToDouble +6677856011E-31 } 0x3b893a6d11077293 test expr-28.416 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3573796826 E-266 x -112be2041a79fc_100000000000000000000000000000000000001& E-852 convertToDouble -3573796826E-266 } 0x8ab12be2041a79fd test expr-28.417 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7147593652 E-266 x 112be2041a79fc_100000000000000000000000000000000000001& E-851 convertToDouble +7147593652E-266 } 0x0ac12be2041a79fd test expr-28.418 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9981396317 E-181 x -1edbd94cb50054_100000000000000000000000000000000000001& E-569 convertToDouble -9981396317E-181 } 0x9c6edbd94cb50055 test expr-28.419 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3268888835 E272 x 120223f2b3a881_0111111111111111111111111111111111111110& E935 convertToDouble +3268888835E272 } 0x7a620223f2b3a881 test expr-28.420 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -2615111068 E273 x -120223f2b3a881_0111111111111111111111111111111111111110& E938 convertToDouble -2615111068E273 } 0xfa920223f2b3a881 test expr-28.421 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1307555534 E273 x 120223f2b3a881_0111111111111111111111111111111111111110& E937 convertToDouble +1307555534E273 } 0x7a820223f2b3a881 test expr-28.422 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2990671154 E-190 x 13db11ac608107_01111111111111111111111111111111111111110& E-600 convertToDouble +2990671154E-190 } 0x1a73db11ac608107 test expr-28.423 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1495335577 E-190 x -13db11ac608107_01111111111111111111111111111111111111110& E-601 convertToDouble -1495335577E-190 } 0x9a63db11ac608107 test expr-28.424 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +5981342308 E-190 x 13db11ac608107_01111111111111111111111111111111111111110& E-599 convertToDouble +5981342308E-190 } 0x1a83db11ac608107 test expr-28.425 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7476677885 E-191 x -13db11ac608107_01111111111111111111111111111111111111110& E-602 convertToDouble -7476677885E-191 } 0x9a53db11ac608107 test expr-28.426 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +82259684194 E-202 x 12c3e72d179606_1000000000000000000000000000000000000000001& E-635 convertToDouble +82259684194E-202 } 0x1842c3e72d179607 test expr-28.427 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -93227267727 E-49 x -1960fe08d5847e_100000000000000000000000000000000000000001& E-127 convertToDouble -93227267727E-49 } 0xb80960fe08d5847f test expr-28.428 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +41129842097 E-202 x 12c3e72d179606_1000000000000000000000000000000000000000001& E-636 convertToDouble +41129842097E-202 } 0x1832c3e72d179607 test expr-28.429 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -47584241418 E-314 x -14e25dd3747e96_10000000000000000000000000000000000000001& E-1008 convertToDouble -47584241418E-314 } 0x80f4e25dd3747e97 test expr-28.430 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -79360293406 E92 x -1c58a00bb31863_01111111111111111111111111111111111111110& E341 convertToDouble -79360293406E92 } 0xd54c58a00bb31863 test expr-28.431 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +57332259349 E225 x 120811f528378b_01111111111111111111111111111111111111110& E783 convertToDouble +57332259349E225 } 0x70e20811f528378b test expr-28.432 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -57202326162 E111 x -1626f1c480545b_01111111111111111111111111111111111111110& E404 convertToDouble -57202326162E111 } 0xd93626f1c480545b test expr-28.433 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +86860597053 E-206 x 103b77d2b969d9_0111111111111111111111111111111111111111110& E-648 convertToDouble +86860597053E-206 } 0x17703b77d2b969d9 test expr-28.434 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -53827010643 E-200 x -132fa69a69bd6d_0111111111111111111111111111111111111111110& E-629 convertToDouble -53827010643E-200 } 0x98a32fa69a69bd6d test expr-28.435 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +53587107423 E-61 x 100a19a3ffd981_011111111111111111111111111111111111111111110& E-167 convertToDouble +53587107423E-61 } 0x35800a19a3ffd981 test expr-28.436 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +635007636765 E200 x 1824e73a4f030e_100000000000000000000000000000000000000000001& E703 convertToDouble +635007636765E200 } 0x6be824e73a4f030f test expr-28.437 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +508006109412 E201 x 1824e73a4f030e_100000000000000000000000000000000000000000001& E706 convertToDouble +508006109412E201 } 0x6c1824e73a4f030f test expr-28.438 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -254003054706 E201 x -1824e73a4f030e_100000000000000000000000000000000000000000001& E705 convertToDouble -254003054706E201 } 0xec0824e73a4f030f test expr-28.439 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +561029718715 E-72 x 1cd96a6972a14a_100000000000000000000000000000000000000000001& E-201 convertToDouble +561029718715E-72 } 0x336cd96a6972a14b test expr-28.440 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -897647549944 E-71 x -1cd96a6972a14a_100000000000000000000000000000000000000000001& E-197 convertToDouble -897647549944E-71 } 0xb3acd96a6972a14b test expr-28.441 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +112205943743 E-71 x 1cd96a6972a14a_100000000000000000000000000000000000000000001& E-200 convertToDouble +112205943743E-71 } 0x337cd96a6972a14b test expr-28.442 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -873947086081 E-236 x -19e117541d04e6_1000000000000000000000000000000000000000000001& E-745 convertToDouble -873947086081E-236 } 0x9169e117541d04e7 test expr-28.443 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +809184709177 E116 x 1de27e59fb0679_011111111111111111111111111111111111111111110& E424 convertToDouble +809184709177E116 } 0x5a7de27e59fb0679 test expr-28.444 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -573112917422 E81 x -11958b36c5102b_01111111111111111111111111111111111111111111110& E308 convertToDouble -573112917422E81 } 0xd331958b36c5102b test expr-28.445 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +286556458711 E81 x 11958b36c5102b_01111111111111111111111111111111111111111111110& E307 convertToDouble +286556458711E81 } 0x5321958b36c5102b test expr-28.446 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +952805821491 E-259 x 1551767ef8a9a3_011111111111111111111111111111111111111111110& E-821 convertToDouble +952805821491E-259 } 0x0ca551767ef8a9a3 test expr-28.447 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -132189992873 E-44 x -1b746cf242410b_011111111111111111111111111111111111111111110& E-110 convertToDouble -132189992873E-44 } 0xb91b746cf242410b test expr-28.448 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -173696038493 E-144 x -1f8fefbb3249d3_011111111111111111111111111111111111111111110& E-442 convertToDouble -173696038493E-144 } 0xa45f8fefbb3249d3 test expr-28.449 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +1831132757599 E-107 x 138e6edd48f2a2_1000000000000000000000000000000000000000000000001& E-315 convertToDouble +1831132757599E-107 } 0x2c438e6edd48f2a3 test expr-28.450 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9155663787995 E-108 x -138e6edd48f2a2_1000000000000000000000000000000000000000000000001& E-316 convertToDouble -9155663787995E-108 } 0xac338e6edd48f2a3 test expr-28.451 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7324531030396 E-107 x 138e6edd48f2a2_1000000000000000000000000000000000000000000000001& E-313 convertToDouble +7324531030396E-107 } 0x2c638e6edd48f2a3 test expr-28.452 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9277338894969 E-200 x -19d5a44fd99a6a_1000000000000000000000000000000000000000000000001& E-622 convertToDouble -9277338894969E-200 } 0x9919d5a44fd99a6b test expr-28.453 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8188292423973 E287 x 1390273bf8f983_0111111111111111111111111111111111111111111111110& E996 convertToDouble +8188292423973E287 } 0x7e3390273bf8f983 test expr-28.454 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5672557437938 E59 x -148c2bd60a1523_011111111111111111111111111111111111111111111110& E238 convertToDouble -5672557437938E59 } 0xced48c2bd60a1523 test expr-28.455 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2836278718969 E59 x 148c2bd60a1523_011111111111111111111111111111111111111111111110& E237 convertToDouble +2836278718969E59 } 0x4ec48c2bd60a1523 test expr-28.456 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -9995153153494 E54 x -17ba37c4fbe993_01111111111111111111111111111111111111111111110& E222 convertToDouble -9995153153494E54 } 0xcdd7ba37c4fbe993 test expr-28.457 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9224786422069 E-291 x 14ee5d56b32957_011111111111111111111111111111111111111111111111110& E-924 convertToDouble +9224786422069E-291 } 0x0634ee5d56b32957 test expr-28.458 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3142213164987 E-294 x -1d3409dfbca26f_011111111111111111111111111111111111111111111111110& E-936 convertToDouble -3142213164987E-294 } 0x857d3409dfbca26f test expr-28.459 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +6284426329974 E-294 x 1d3409dfbca26f_011111111111111111111111111111111111111111111111110& E-935 convertToDouble +6284426329974E-294 } 0x058d3409dfbca26f test expr-28.460 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8340483752889 E-301 x -10419183e44b91_01111111111111111111111111111111111111111111111110& E-957 convertToDouble -8340483752889E-301 } 0x8420419183e44b91 test expr-28.461 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +67039371486466 E89 x 17f203339c9628_10000000000000000000000000000000000000000000000000001& E341 convertToDouble +67039371486466E89 } 0x5547f203339c9629 test expr-28.462 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -62150786615239 E197 x -12e79a035b9714_1000000000000000000000000000000000000000000000000001& E700 convertToDouble -62150786615239E197 } 0xebb2e79a035b9715 test expr-28.463 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +33519685743233 E89 x 17f203339c9628_10000000000000000000000000000000000000000000000000001& E340 convertToDouble +33519685743233E89 } 0x5537f203339c9629 test expr-28.464 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -52563419496999 E156 x -1bdb17625bf6e6_1000000000000000000000000000000000000000000000000001& E563 convertToDouble -52563419496999E156 } 0xe32bdb17625bf6e7 test expr-28.465 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +32599460466991 E-65 x 1f395d4c779d8e_1000000000000000000000000000000000000000000000000001& E-172 convertToDouble +32599460466991E-65 } 0x353f395d4c779d8f test expr-28.466 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -41010988798007 E-133 x -152e1c9e04ee06_100000000000000000000000000000000000000000000000001& E-397 convertToDouble -41010988798007E-133 } 0xa7252e1c9e04ee07 test expr-28.467 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +65198920933982 E-65 x 1f395d4c779d8e_1000000000000000000000000000000000000000000000000001& E-171 convertToDouble +65198920933982E-65 } 0x354f395d4c779d8f test expr-28.468 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -82021977596014 E-133 x -152e1c9e04ee06_100000000000000000000000000000000000000000000000001& E-396 convertToDouble -82021977596014E-133 } 0xa7352e1c9e04ee07 test expr-28.469 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +80527976643809 E61 x 1c7c5aea080a49_0111111111111111111111111111111111111111111111111110& E248 convertToDouble +80527976643809E61 } 0x4f7c7c5aea080a49 test expr-28.470 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -74712611505209 E158 x -1eeebe9ea010f3_011111111111111111111111111111111111111111111111110& E570 convertToDouble -74712611505209E158 } 0xe39eeebe9ea010f3 test expr-28.471 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +53390939710959 E261 x 18ac6d426a1cb1_0111111111111111111111111111111111111111111111111110& E912 convertToDouble +53390939710959E261 } 0x78f8ac6d426a1cb1 test expr-28.472 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -69277302659155 E225 x -1547166a3a2b0f_011111111111111111111111111111111111111111111111110& E793 convertToDouble -69277302659155E225 } 0xf18547166a3a2b0f test expr-28.473 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +46202199371337 E-72 x 128f9edfbd341f_0111111111111111111111111111111111111111111111111111111110& E-194 convertToDouble +46202199371337E-72 } 0x33d28f9edfbd341f test expr-28.474 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -23438635467783 E-179 x -1ba485b99e47af_0111111111111111111111111111111111111111111111111110& E-551 convertToDouble -23438635467783E-179 } 0x9d8ba485b99e47af test expr-28.475 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +41921560615349 E-67 x 19b2a5c4041e4b_0111111111111111111111111111111111111111111111111110& E-178 convertToDouble +41921560615349E-67 } 0x34d9b2a5c4041e4b test expr-28.476 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -92404398742674 E-72 x -128f9edfbd341f_0111111111111111111111111111111111111111111111111111111110& E-193 convertToDouble -92404398742674E-72 } 0xb3e28f9edfbd341f test expr-28.477 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +738545606647197 E124 x 13d8886a766a20_100000000000000000000000000000000000000000000000000001& E461 convertToDouble +738545606647197E124 } 0x5cc3d8886a766a21 test expr-28.478 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -972708181182949 E117 x -15ed1f039cebfe_1000000000000000000000000000000000000000000000000000001& E438 convertToDouble -972708181182949E117 } 0xdb55ed1f039cebff test expr-28.479 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -837992143580825 E87 x -17f203339c9628_10000000000000000000000000000000000000000000000000001& E338 convertToDouble -837992143580825E87 } 0xd517f203339c9629 test expr-28.480 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +609610927149051 E-255 x 104273b18918b0_100000000000000000000000000000000000000000000000000000001& E-798 convertToDouble +609610927149051E-255 } 0x0e104273b18918b1 test expr-28.481 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -475603213226859 E-41 x -178cfcab31064c_10000000000000000000000000000000000000000000000000000001& E-88 convertToDouble -475603213226859E-41 } 0xba778cfcab31064d test expr-28.482 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +563002800671023 E-177 x 1035e7b5183922_10000000000000000000000000000000000000000000000000000001& E-539 convertToDouble +563002800671023E-177 } 0x1e4035e7b5183923 test expr-28.483 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -951206426453718 E-41 x -178cfcab31064c_10000000000000000000000000000000000000000000000000000001& E-87 convertToDouble -951206426453718E-41 } 0xba878cfcab31064d test expr-28.484 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +805416432656519 E202 x 175d226331d039_01111111111111111111111111111111111111111111111111111110& E720 convertToDouble +805416432656519E202 } 0x6cf75d226331d039 test expr-28.485 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -530658674694337 E159 x -112a13daa46fe3_0111111111111111111111111111111111111111111111111111110& E577 convertToDouble -530658674694337E159 } 0xe4012a13daa46fe3 test expr-28.486 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +946574173863918 E208 x 1a2fbffdb7580b_011111111111111111111111111111111111111111111111111110& E740 convertToDouble +946574173863918E208 } 0x6e3a2fbffdb7580b test expr-28.487 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -318329953318553 E113 x -178358811cbc95_011111111111111111111111111111111111111111111111111110& E423 convertToDouble -318329953318553E113 } 0xda678358811cbc95 test expr-28.488 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -462021993713370 E-73 x -128f9edfbd341f_0111111111111111111111111111111111111111111111111111111110& E-194 convertToDouble -462021993713370E-73 } 0xb3d28f9edfbd341f test expr-28.489 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +369617594970696 E-72 x 128f9edfbd341f_0111111111111111111111111111111111111111111111111111111110& E-191 convertToDouble +369617594970696E-72 } 0x34028f9edfbd341f test expr-28.490 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3666156212014994 E233 x 1a37935f3b71c8_100000000000000000000000000000000000000000000000000000001& E825 convertToDouble +3666156212014994E233 } 0x738a37935f3b71c9 test expr-28.491 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1833078106007497 E233 x -1a37935f3b71c8_100000000000000000000000000000000000000000000000000000001& E824 convertToDouble -1833078106007497E233 } 0xf37a37935f3b71c9 test expr-28.492 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +8301790508624232 E174 x 1dcfee6690ffc6_100000000000000000000000000000000000000000000000000000001& E630 convertToDouble +8301790508624232E174 } 0x675dcfee6690ffc7 test expr-28.493 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1037723813578029 E174 x -1dcfee6690ffc6_100000000000000000000000000000000000000000000000000000001& E627 convertToDouble -1037723813578029E174 } 0xe72dcfee6690ffc7 test expr-28.494 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7297662880581139 E-286 x 18ac8c79e1ff18_1000000000000000000000000000000000000000000000000000000000001& E-898 convertToDouble +7297662880581139E-286 } 0x07d8ac8c79e1ff19 test expr-28.495 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -5106185698912191 E-276 x -141934d77659be_1000000000000000000000000000000000000000000000000000000000001& E-865 convertToDouble -5106185698912191E-276 } 0x89e41934d77659bf test expr-28.496 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7487252720986826 E-165 x 18823a57adbef8_100000000000000000000000000000000000000000000000000000000000001& E-496 convertToDouble +7487252720986826E-165 } 0x20f8823a57adbef9 test expr-28.497 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3743626360493413 E-165 x -18823a57adbef8_100000000000000000000000000000000000000000000000000000000000001& E-497 convertToDouble -3743626360493413E-165 } 0xa0e8823a57adbef9 test expr-28.498 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3773057430100257 E230 x 1ba10d818fdafd_0111111111111111111111111111111111111111111111111111111110& E815 convertToDouble +3773057430100257E230 } 0x72eba10d818fdafd test expr-28.499 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7546114860200514 E230 x -1ba10d818fdafd_0111111111111111111111111111111111111111111111111111111110& E816 convertToDouble -7546114860200514E230 } 0xf2fba10d818fdafd test expr-28.500 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4321222892463822 E58 x 18750ea732fdad_011111111111111111111111111111111111111111111111111111110& E244 convertToDouble +4321222892463822E58 } 0x4f38750ea732fdad test expr-28.501 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7793560217139653 E51 x -1280461b856ec5_0111111111111111111111111111111111111111111111111111111110& E222 convertToDouble -7793560217139653E51 } 0xcdd280461b856ec5 test expr-28.502 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +26525993941010681 E112 x 187dcbf6ad5cf8_10000000000000000000000000000000000000000000000000000000000001& E426 convertToDouble +26525993941010681E112 } 0x5a987dcbf6ad5cf9 test expr-28.503 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -53051987882021362 E112 x -187dcbf6ad5cf8_10000000000000000000000000000000000000000000000000000000000001& E427 convertToDouble -53051987882021362E112 } 0xdaa87dcbf6ad5cf9 test expr-28.504 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +72844871414247907 E77 x 1bf00baf60b70c_100000000000000000000000000000000000000000000000000000000001& E311 convertToDouble +72844871414247907E77 } 0x536bf00baf60b70d test expr-28.505 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -88839359596763261 E105 x -1133b1a33a1108_100000000000000000000000000000000000000000000000000000000001& E405 convertToDouble -88839359596763261E105 } 0xd94133b1a33a1109 test expr-28.506 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +18718131802467065 E-166 x 18823a57adbef8_100000000000000000000000000000000000000000000000000000000000001& E-498 convertToDouble +18718131802467065E-166 } 0x20d8823a57adbef9 test expr-28.507 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -14974505441973652 E-165 x -18823a57adbef8_100000000000000000000000000000000000000000000000000000000000001& E-495 convertToDouble -14974505441973652E-165 } 0xa108823a57adbef9 test expr-28.508 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +73429396004640239 E106 x 11c5cb19ef3451_01111111111111111111111111111111111111111111111111111111111110& E408 convertToDouble +73429396004640239E106 } 0x5971c5cb19ef3451 test expr-28.509 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -58483921078398283 E57 x -108ce499519ce3_0111111111111111111111111111111111111111111111111111111111111110& E245 convertToDouble -58483921078398283E57 } 0xcf408ce499519ce3 test expr-28.510 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +41391519190645203 E165 x 13f33667156017_011111111111111111111111111111111111111111111111111111111111110& E603 convertToDouble +41391519190645203E165 } 0x65a3f33667156017 test expr-28.511 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -82783038381290406 E165 x -13f33667156017_011111111111111111111111111111111111111111111111111111111111110& E604 convertToDouble -82783038381290406E165 } 0xe5b3f33667156017 test expr-28.512 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +58767043776702677 E-163 x 12c92fee3a3867_0111111111111111111111111111111111111111111111111111111111110& E-486 convertToDouble +58767043776702677E-163 } 0x2192c92fee3a3867 test expr-28.513 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -90506231831231999 E-129 x -1bdc4114397ff3_01111111111111111111111111111111111111111111111111111111111110& E-373 convertToDouble -90506231831231999E-129 } 0xa8abdc4114397ff3 test expr-28.514 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +64409240769861689 E-159 x 192238f7987779_011111111111111111111111111111111111111111111111111111111111110& E-473 convertToDouble +64409240769861689E-159 } 0x22692238f7987779 test expr-28.515 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -77305427432277771 E-190 x -1e978b7780b613_0111111111111111111111111111111111111111111111111111111111110& E-576 convertToDouble -77305427432277771E-190 } 0x9bfe978b7780b613 test expr-28.516 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +476592356619258326 E273 x 1873cf8ee72812_10000000000000000000000000000000000000000000000000000000000000001& E965 convertToDouble +476592356619258326E273 } 0x7c4873cf8ee72813 test expr-28.517 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -953184713238516652 E273 x -1873cf8ee72812_10000000000000000000000000000000000000000000000000000000000000001& E966 convertToDouble -953184713238516652E273 } 0xfc5873cf8ee72813 test expr-28.518 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +899810892172646163 E283 x 1adf51fa055e02_100000000000000000000000000000000000000000000000000000000000000000001& E999 convertToDouble +899810892172646163E283 } 0x7e6adf51fa055e03 test expr-28.519 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -929167076892018333 E187 x -1da2c42fce2bc4_10000000000000000000000000000000000000000000000000000000000000000001& E680 convertToDouble -929167076892018333E187 } 0xea7da2c42fce2bc5 test expr-28.520 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +647761278967534239 E-312 x 1a7a2476ec0b3e_10000000000000000000000000000000000000000000000000000000000000001& E-978 convertToDouble +647761278967534239E-312 } 0x02da7a2476ec0b3f test expr-28.521 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -644290479820542942 E-180 x -128d1407dfa832_10000000000000000000000000000000000000000000000000000000000000001& E-539 convertToDouble -644290479820542942E-180 } 0x9e428d1407dfa833 test expr-28.522 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +926145344610700019 E-225 x 1307a67f1f69fe_10000000000000000000000000000000000000000000000000000000000000000001& E-688 convertToDouble +926145344610700019E-225 } 0x14f307a67f1f69ff test expr-28.523 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -958507931896511964 E-246 x -17406753df2f0c_10000000000000000000000000000000000000000000000000000000000000001& E-758 convertToDouble -958507931896511964E-246 } 0x9097406753df2f0d test expr-28.524 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +272104041512242479 E200 x 13bbb4bf05f087_011111111111111111111111111111111111111111111111111111111111111111111110& E722 convertToDouble +272104041512242479E200 } 0x6d13bbb4bf05f087 test expr-28.525 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -792644927852378159 E79 x -1daff0048f3ec7_011111111111111111111111111111111111111111111111111111111111111111110& E321 convertToDouble -792644927852378159E79 } 0xd40daff0048f3ec7 test expr-28.526 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +544208083024484958 E200 x 13bbb4bf05f087_011111111111111111111111111111111111111111111111111111111111111111111110& E723 convertToDouble +544208083024484958E200 } 0x6d23bbb4bf05f087 test expr-28.527 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -929963218616126365 E290 x -108dcc0c505461_01111111111111111111111111111111111111111111111111111111111111110& E1023 convertToDouble -929963218616126365E290 } 0xffe08dcc0c505461 test expr-28.528 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +305574339166810102 E-219 x 17f399fe02c4b9_011111111111111111111111111111111111111111111111111111111111111110& E-670 convertToDouble +305574339166810102E-219 } 0x1617f399fe02c4b9 test expr-28.529 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -152787169583405051 E-219 x -17f399fe02c4b9_011111111111111111111111111111111111111111111111111111111111111110& E-671 convertToDouble -152787169583405051E-219 } 0x9607f399fe02c4b9 test expr-28.530 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +611148678333620204 E-219 x 17f399fe02c4b9_011111111111111111111111111111111111111111111111111111111111111110& E-669 convertToDouble +611148678333620204E-219 } 0x1627f399fe02c4b9 test expr-28.531 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -763935847917025255 E-220 x -17f399fe02c4b9_011111111111111111111111111111111111111111111111111111111111111110& E-672 convertToDouble -763935847917025255E-220 } 0x95f7f399fe02c4b9 test expr-28.532 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +7439550220920798612 E158 x 177fe14f40159a_10000000000000000000000000000000000000000000000000000000000000000000001& E587 convertToDouble +7439550220920798612E158 } 0x64a77fe14f40159b test expr-28.533 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -3719775110460399306 E158 x -177fe14f40159a_10000000000000000000000000000000000000000000000000000000000000000000001& E586 convertToDouble -3719775110460399306E158 } 0xe4977fe14f40159b test expr-28.534 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +9299437776150998265 E157 x 177fe14f40159a_10000000000000000000000000000000000000000000000000000000000000000000001& E584 convertToDouble +9299437776150998265E157 } 0x64777fe14f40159b test expr-28.535 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7120190517612959703 E120 x -13220dcd5899fc_1000000000000000000000000000000000000000000000000000000000000000000000001& E461 convertToDouble -7120190517612959703E120 } 0xdcc3220dcd5899fd test expr-28.536 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +3507665085003296281 E-73 x 11339818257f0e_100000000000000000000000000000000000000000000000000000000000000000000001& E-181 convertToDouble +3507665085003296281E-73 } 0x34a1339818257f0f test expr-28.537 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -7015330170006592562 E-73 x -11339818257f0e_100000000000000000000000000000000000000000000000000000000000000000000001& E-180 convertToDouble -7015330170006592562E-73 } 0xb4b1339818257f0f test expr-28.538 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -6684428762278255956 E-294 x -1d9f82a1a6b1b8_10000000000000000000000000000000000000000000000000000000000000000001& E-915 convertToDouble -6684428762278255956E-294 } 0x86cd9f82a1a6b1b9 test expr-28.539 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -1088416166048969916 E200 x -13bbb4bf05f087_011111111111111111111111111111111111111111111111111111111111111111111110& E724 convertToDouble -1088416166048969916E200 } 0xed33bbb4bf05f087 test expr-28.540 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8707329328391759328 E200 x -13bbb4bf05f087_011111111111111111111111111111111111111111111111111111111111111111111110& E727 convertToDouble -8707329328391759328E200 } 0xed63bbb4bf05f087 test expr-28.541 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +4439021781608558002 E-65 x 1038168b71e2c9_01111111111111111111111111111111111111111111111111111111111111111110& E-154 convertToDouble +4439021781608558002E-65 } 0x365038168b71e2c9 test expr-28.542 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -8878043563217116004 E-65 x -1038168b71e2c9_01111111111111111111111111111111111111111111111111111111111111111110& E-153 convertToDouble -8878043563217116004E-65 } 0xb66038168b71e2c9 test expr-28.543 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +2219510890804279001 E-65 x 1038168b71e2c9_01111111111111111111111111111111111111111111111111111111111111111110& E-155 convertToDouble +2219510890804279001E-65 } 0x364038168b71e2c9 test expr-28.544 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +33051223951904955802 E55 x 1762068a24fd54_1000000000000000000000000000000000000000000000000000000000000000000000001& E247 convertToDouble +33051223951904955802E55 } 0x4f6762068a24fd55 test expr-28.545 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -56961524140903677624 E120 x -13220dcd5899fc_1000000000000000000000000000000000000000000000000000000000000000000000001& E464 convertToDouble -56961524140903677624E120 } 0xdcf3220dcd5899fd test expr-28.546 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +71201905176129597030 E119 x 13220dcd5899fc_1000000000000000000000000000000000000000000000000000000000000000000000001& E461 convertToDouble +71201905176129597030E119 } 0x5cc3220dcd5899fd test expr-28.547 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +14030660340013185124 E-73 x 11339818257f0e_100000000000000000000000000000000000000000000000000000000000000000000001& E-179 convertToDouble +14030660340013185124E-73 } 0x34c1339818257f0f test expr-28.548 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -17538325425016481405 E-74 x -11339818257f0e_100000000000000000000000000000000000000000000000000000000000000000000001& E-182 convertToDouble -17538325425016481405E-74 } 0xb491339818257f0f test expr-28.549 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +67536228609141569109 E-133 x 10a1b35cf2a635_01111111111111111111111111111111111111111111111111111111111111111111110& E-376 convertToDouble +67536228609141569109E-133 } 0x2870a1b35cf2a635 test expr-28.550 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -35620497849450218807 E-306 x -15b22082529425_0111111111111111111111111111111111111111111111111111111111111111111111110& E-952 convertToDouble -35620497849450218807E-306 } 0x8475b22082529425 test expr-28.551 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN +66550376797582521751 E-126 x 13897c0ede6c69_01111111111111111111111111111111111111111111111111111111111111111111110& E-353 convertToDouble +66550376797582521751E-126 } 0x29e3897c0ede6c69 test expr-28.552 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b d UN -71240995698900437614 E-306 x -15b22082529425_0111111111111111111111111111111111111111111111111111111111111111111111110& E-951 convertToDouble -71240995698900437614E-306 } 0x8485b22082529425 test expr-28.553 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3 E24 x 13da329b633647_0001& E81 convertToDouble +3E24 } 0x4503da329b633647 test expr-28.554 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6 E24 x -13da329b633647_0001& E82 convertToDouble -6E24 } 0xc513da329b633647 test expr-28.555 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6 E26 x 1f04ef12cb04cf_0001& E88 convertToDouble +6E26 } 0x457f04ef12cb04cf test expr-28.556 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7 E25 x -1cf389cd46047d_0000001& E85 convertToDouble -7E25 } 0xc54cf389cd46047d test expr-28.557 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1 E-14 x 16849b86a12b9b_00000001& E-47 convertToDouble +1E-14 } 0x3d06849b86a12b9b test expr-28.558 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2 E-14 x -16849b86a12b9b_00000001& E-46 convertToDouble -2E-14 } 0xbd16849b86a12b9b test expr-28.559 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4 E-14 x 16849b86a12b9b_00000001& E-45 convertToDouble +4E-14 } 0x3d26849b86a12b9b test expr-28.560 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8 E-14 x -16849b86a12b9b_00000001& E-44 convertToDouble -8E-14 } 0xbd36849b86a12b9b test expr-28.561 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5 E26 x 19d971e4fe8401_1110& E88 convertToDouble +5E26 } 0x4579d971e4fe8402 test expr-28.562 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8 E27 x -19d971e4fe8401_1110& E92 convertToDouble -8E27 } 0xc5b9d971e4fe8402 test expr-28.563 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1 E27 x 19d971e4fe8401_1110& E89 convertToDouble +1E27 } 0x4589d971e4fe8402 test expr-28.564 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4 E27 x -19d971e4fe8401_1110& E91 convertToDouble -4E27 } 0xc5a9d971e4fe8402 test expr-28.565 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9 E-13 x 1faa7ab552a551_111110& E-41 convertToDouble +9E-13 } 0x3d6faa7ab552a552 test expr-28.566 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7 E-20 x -14a90ceafff9de_11110& E-64 convertToDouble -7E-20 } 0xbbf4a90ceafff9df test expr-28.567 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +56 E25 x 1cf389cd46047d_0000001& E88 convertToDouble +56E25 } 0x457cf389cd46047d test expr-28.568 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -70 E24 x -1cf389cd46047d_0000001& E85 convertToDouble -70E24 } 0xc54cf389cd46047d test expr-28.569 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +51 E26 x 107a9f01fbda8e_0000001& E92 convertToDouble +51E26 } 0x45b07a9f01fbda8e test expr-28.570 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +71 E-17 x 19949819f693d7_00000000001& E-51 convertToDouble +71E-17 } 0x3cc9949819f693d7 test expr-28.571 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -31 E-5 x -1450efdc9c4da9_00000000001& E-12 convertToDouble -31E-5 } 0xbf3450efdc9c4da9 test expr-28.572 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +62 E-5 x 1450efdc9c4da9_00000000001& E-11 convertToDouble +62E-5 } 0x3f4450efdc9c4da9 test expr-28.573 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -94 E-8 x -1f8a89dc374df5_0000000001& E-21 convertToDouble -94E-8 } 0xbeaf8a89dc374df5 test expr-28.574 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +67 E27 x 1b0fa33bba7231_11111110& E95 convertToDouble +67E27 } 0x45eb0fa33bba7232 test expr-28.575 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -81 E24 x -10c01ab31bb5cb_1111110& E86 convertToDouble -81E24 } 0xc550c01ab31bb5cc test expr-28.576 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +54 E23 x 11ddfa58a6173f_111110& E82 convertToDouble +54E23 } 0x4511ddfa58a61740 test expr-28.577 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -54 E25 x -1bead72a838453_111110& E88 convertToDouble -54E25 } 0xc57bead72a838454 test expr-28.578 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +63 E-22 x 1dc03b8fd70169_11111111110& E-68 convertToDouble +63E-22 } 0x3bbdc03b8fd7016a test expr-28.579 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -63 E-23 x -17ccfc73126787_11111111110& E-71 convertToDouble -63E-23 } 0xbb87ccfc73126788 test expr-28.580 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +43 E-4 x 119ce075f6fd21_111111110& E-8 convertToDouble +43E-4 } 0x3f719ce075f6fd22 test expr-28.581 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -86 E-4 x -119ce075f6fd21_111111110& E-7 convertToDouble -86E-4 } 0xbf819ce075f6fd22 test expr-28.582 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +942 E26 x 1306069e8681f3_00000000001& E96 convertToDouble +942E26 } 0x45f306069e8681f3 test expr-28.583 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -471 E25 x -1e700a973d9cb8_0000000001& E91 convertToDouble -471E25 } 0xc5ae700a973d9cb8 test expr-28.584 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +803 E24 x 14c1cee9cd666b_000000000001& E89 convertToDouble +803E24 } 0x4584c1cee9cd666b test expr-28.585 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -471 E26 x -1306069e8681f3_00000000001& E95 convertToDouble -471E26 } 0xc5e306069e8681f3 test expr-28.586 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -409 E-21 x -1e2dcaa4115622_000000000001& E-62 convertToDouble -409E-21 } 0xbc1e2dcaa4115622 test expr-28.587 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +818 E-21 x 1e2dcaa4115622_000000000001& E-61 convertToDouble +818E-21 } 0x3c2e2dcaa4115622 test expr-28.588 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -867 E-8 x -122eabba029aba_000000000001& E-17 convertToDouble -867E-8 } 0xbee22eabba029aba test expr-28.589 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +538 E27 x 1b297cad9f70b5_1111111111111110& E98 convertToDouble +538E27 } 0x461b297cad9f70b6 test expr-28.590 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -857 E24 x -16272678ba603b_11111111110& E89 convertToDouble -857E24 } 0xc586272678ba603c test expr-28.591 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +269 E27 x 1b297cad9f70b5_1111111111111110& E97 convertToDouble +269E27 } 0x460b297cad9f70b6 test expr-28.592 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -403 E26 x -1046ec1e31dd85_1111111110& E95 convertToDouble -403E26 } 0xc5e046ec1e31dd86 test expr-28.593 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +959 E-7 x 1923bd746a3527_11111111111110& E-14 convertToDouble +959E-7 } 0x3f1923bd746a3528 test expr-28.594 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -959 E-6 x -1f6cacd184c271_1111111111110& E-11 convertToDouble -959E-6 } 0xbf4f6cacd184c272 test expr-28.595 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +373 E-27 x 1cdc06b20ef182_1111111111110& E-82 convertToDouble +373E-27 } 0x3adcdc06b20ef183 test expr-28.596 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -746 E-27 x -1cdc06b20ef182_1111111111110& E-81 convertToDouble -746E-27 } 0xbaecdc06b20ef183 test expr-28.597 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4069 E24 x 1a4b9887fbfe7a_0000000000001& E91 convertToDouble +4069E24 } 0x45aa4b9887fbfe7a test expr-28.598 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4069 E23 x -150946d32ffec8_0000000000001& E88 convertToDouble -4069E23 } 0xc5750946d32ffec8 test expr-28.599 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8138 E24 x -1a4b9887fbfe7a_0000000000001& E92 convertToDouble -8138E24 } 0xc5ba4b9887fbfe7a test expr-28.600 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8294 E-15 x 123d1b5eb1d778_000000000000000001& E-37 convertToDouble +8294E-15 } 0x3da23d1b5eb1d778 test expr-28.601 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4147 E-14 x -16cc62365e4d56_00000000000000001& E-35 convertToDouble -4147E-14 } 0xbdc6cc62365e4d56 test expr-28.602 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4147 E-15 x 123d1b5eb1d778_000000000000000001& E-38 convertToDouble +4147E-15 } 0x3d923d1b5eb1d778 test expr-28.603 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8294 E-14 x -16cc62365e4d56_00000000000000001& E-34 convertToDouble -8294E-14 } 0xbdd6cc62365e4d56 test expr-28.604 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +538 E27 x 1b297cad9f70b5_1111111111111110& E98 convertToDouble +538E27 } 0x461b297cad9f70b6 test expr-28.605 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2690 E26 x -1b297cad9f70b5_1111111111111110& E97 convertToDouble -2690E26 } 0xc60b297cad9f70b6 test expr-28.606 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +269 E27 x 1b297cad9f70b5_1111111111111110& E97 convertToDouble +269E27 } 0x460b297cad9f70b6 test expr-28.607 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2152 E27 x -1b297cad9f70b5_1111111111111110& E100 convertToDouble -2152E27 } 0xc63b297cad9f70b6 test expr-28.608 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1721 E-17 x 136071dcae4564_111111111111110& E-46 convertToDouble +1721E-17 } 0x3d136071dcae4565 test expr-28.609 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7979 E-27 x -134ac304747faf_111111111111110& E-77 convertToDouble -7979E-27 } 0xbb234ac304747fb0 test expr-28.610 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6884 E-17 x 136071dcae4564_111111111111110& E-44 convertToDouble +6884E-17 } 0x3d336071dcae4565 test expr-28.611 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8605 E-18 x -136071dcae4564_111111111111110& E-47 convertToDouble -8605E-18 } 0xbd036071dcae4565 test expr-28.612 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +82854 E27 x 10570ed9e3cecc_00000000000000001& E106 convertToDouble +82854E27 } 0x4690570ed9e3cecc test expr-28.613 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -55684 E24 x -167d9735144ae3_00000000000000001& E95 convertToDouble -55684E24 } 0xc5e67d9735144ae3 test expr-28.614 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +27842 E24 x 167d9735144ae3_00000000000000001& E94 convertToDouble +27842E24 } 0x45d67d9735144ae3 test expr-28.615 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -48959 E25 x -18b7cd6ca56f85_00000000000000001& E98 convertToDouble -48959E25 } 0xc618b7cd6ca56f85 test expr-28.616 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +81921 E-17 x 1cd2c9a6cdd003_000000000000000000001& E-41 convertToDouble +81921E-17 } 0x3d6cd2c9a6cdd003 test expr-28.617 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -76207 E-8 x -18f8b4dd16f1df_0000000000000000001& E-11 convertToDouble -76207E-8 } 0xbf48f8b4dd16f1df test expr-28.618 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4147 E-15 x 123d1b5eb1d778_000000000000000001& E-38 convertToDouble +4147E-15 } 0x3d923d1b5eb1d778 test expr-28.619 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -41470 E-16 x -123d1b5eb1d778_000000000000000001& E-38 convertToDouble -41470E-16 } 0xbd923d1b5eb1d778 test expr-28.620 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +89309 E24 x 12092ac5f2019e_1111111111111111110& E96 convertToDouble +89309E24 } 0x45f2092ac5f2019f test expr-28.621 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +75859 E26 x 17efd75a2938eb_1111111111111111111110& E102 convertToDouble +75859E26 } 0x4657efd75a2938ec test expr-28.622 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -75859 E25 x -132645e1ba93ef_1111111111111111111110& E99 convertToDouble -75859E25 } 0xc6232645e1ba93f0 test expr-28.623 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +14257 E-23 x 150a246ecd44f2_1111111111111111110& E-63 convertToDouble +14257E-23 } 0x3c050a246ecd44f3 test expr-28.624 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -28514 E-23 x -150a246ecd44f2_1111111111111111110& E-62 convertToDouble -28514E-23 } 0xbc150a246ecd44f3 test expr-28.625 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +57028 E-23 x 150a246ecd44f2_1111111111111111110& E-61 convertToDouble +57028E-23 } 0x3c250a246ecd44f3 test expr-28.626 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -71285 E-24 x -150a246ecd44f2_1111111111111111110& E-64 convertToDouble -71285E-24 } 0xbbf50a246ecd44f3 test expr-28.627 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +344863 E27 x 1100c873963d6d_00000000000000000001& E108 convertToDouble +344863E27 } 0x46b100c873963d6d test expr-28.628 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -951735 E27 x -17764ad224e24a_000000000000000000001& E109 convertToDouble -951735E27 } 0xc6c7764ad224e24a test expr-28.629 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +200677 E23 x 1035e73135b834_0000000000000000001& E94 convertToDouble +200677E23 } 0x45d035e73135b834 test expr-28.630 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -401354 E24 x -144360fd832641_0000000000000000001& E98 convertToDouble -401354E24 } 0xc6144360fd832641 test expr-28.631 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +839604 E-11 x 119b96f36ec68b_00000000000000000000000001& E-17 convertToDouble +839604E-11 } 0x3ee19b96f36ec68b test expr-28.632 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -209901 E-11 x -119b96f36ec68b_00000000000000000000000001& E-19 convertToDouble -209901E-11 } 0xbec19b96f36ec68b test expr-28.633 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +419802 E-11 x 119b96f36ec68b_00000000000000000000000001& E-18 convertToDouble +419802E-11 } 0x3ed19b96f36ec68b test expr-28.634 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -537734 E-24 x -13d6c1088ae40e_0000000000000000000001& E-61 convertToDouble -537734E-24 } 0xbc23d6c1088ae40e test expr-28.635 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +910308 E26 x 11f3e1839eeab0_11111111111111111111110& E106 convertToDouble +910308E26 } 0x4691f3e1839eeab1 test expr-28.636 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -227577 E26 x -11f3e1839eeab0_11111111111111111111110& E104 convertToDouble -227577E26 } 0xc671f3e1839eeab1 test expr-28.637 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +455154 E26 x 11f3e1839eeab0_11111111111111111111110& E105 convertToDouble +455154E26 } 0x4681f3e1839eeab1 test expr-28.638 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -531013 E25 x -10c17d25834171_11111111111111111111110& E102 convertToDouble -531013E25 } 0xc650c17d25834172 test expr-28.639 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +963019 E-21 x 11592429784914_11111111111111111111110& E-50 convertToDouble +963019E-21 } 0x3cd1592429784915 test expr-28.640 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -519827 E-13 x -1be872a8b30d7c_11111111111111111111110& E-25 convertToDouble -519827E-13 } 0xbe6be872a8b30d7d test expr-28.641 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +623402 E-27 x 178d2c97bde2a0_11111111111111111111110& E-71 convertToDouble +623402E-27 } 0x3b878d2c97bde2a1 test expr-28.642 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -311701 E-27 x -178d2c97bde2a0_11111111111111111111110& E-72 convertToDouble -311701E-27 } 0xbb778d2c97bde2a1 test expr-28.643 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9613651 E26 x 17b31116270d9b_000000000000000000000001& E109 convertToDouble +9613651E26 } 0x46c7b31116270d9b test expr-28.644 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9191316 E23 x -1733bfae0801fd_0000000000000000000001& E99 convertToDouble -9191316E23 } 0xc62733bfae0801fd test expr-28.645 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4595658 E23 x 1733bfae0801fd_0000000000000000000001& E98 convertToDouble +4595658E23 } 0x461733bfae0801fd test expr-28.646 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2297829 E23 x -1733bfae0801fd_0000000000000000000001& E97 convertToDouble -2297829E23 } 0xc60733bfae0801fd test expr-28.647 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1679208 E-11 x -119b96f36ec68b_00000000000000000000000001& E-16 convertToDouble -1679208E-11 } 0xbef19b96f36ec68b test expr-28.648 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3379223 E27 x 14d3794ce2fc25_1111111111111111111111110& E111 convertToDouble +3379223E27 } 0x46e4d3794ce2fc26 test expr-28.649 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6758446 E27 x -14d3794ce2fc25_1111111111111111111111110& E112 convertToDouble -6758446E27 } 0xc6f4d3794ce2fc26 test expr-28.650 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5444097 E-21 x 18849dd33c95ae_11111111111111111111111111110& E-48 convertToDouble +5444097E-21 } 0x3cf8849dd33c95af test expr-28.651 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8399969 E-27 x -13d5783e85fcf7_1111111111111111111111110& E-67 convertToDouble -8399969E-27 } 0xbbc3d5783e85fcf8 test expr-28.652 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8366487 E-16 x 1cbf3d630403af_1111111111111111111111110& E-31 convertToDouble +8366487E-16 } 0x3e0cbf3d630403b0 test expr-28.653 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8366487 E-15 x -11f7865de2824d_11111111111111111111111110& E-27 convertToDouble -8366487E-15 } 0xbe41f7865de2824e test expr-28.654 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +65060671 E25 x 1009e7d474572a_0000000000000000000000000001& E109 convertToDouble +65060671E25 } 0x46c009e7d474572a test expr-28.655 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +65212389 E23 x 1493d098d37657_000000000000000000000000001& E102 convertToDouble +65212389E23 } 0x465493d098d37657 test expr-28.656 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +55544957 E-13 x 174c1826f3010c_00000000000000000000000000001& E-18 convertToDouble +55544957E-13 } 0x3ed74c1826f3010c test expr-28.657 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -51040905 E-20 x -11f55b23c8bf2d_0000000000000000000000000001& E-41 convertToDouble -51040905E-20 } 0xbd61f55b23c8bf2d test expr-28.658 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +99585767 E-22 x 166cba8699f0f2_0000000000000000000000000001& E-47 convertToDouble +99585767E-22 } 0x3d066cba8699f0f2 test expr-28.659 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -99585767 E-23 x -11f095387b2728_0000000000000000000000000001& E-50 convertToDouble -99585767E-23 } 0xbcd1f095387b2728 test expr-28.660 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +40978393 E26 x 1941401cca2bfd_1111111111111111111111111110& E111 convertToDouble +40978393E26 } 0x46e941401cca2bfe test expr-28.661 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -67488159 E24 x -1a9e90059d12db_11111111111111111111111111110& E105 convertToDouble -67488159E24 } 0xc68a9e90059d12dc test expr-28.662 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +69005339 E23 x 15c634f6ef1f95_111111111111111111111111110& E102 convertToDouble +69005339E23 } 0x4655c634f6ef1f96 test expr-28.663 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -81956786 E26 x -1941401cca2bfd_1111111111111111111111111110& E112 convertToDouble -81956786E26 } 0xc6f941401cca2bfe test expr-28.664 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -87105552 E-21 x -18849dd33c95ae_11111111111111111111111111110& E-44 convertToDouble -87105552E-21 } 0xbd38849dd33c95af test expr-28.665 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +10888194 E-21 x 18849dd33c95ae_11111111111111111111111111110& E-47 convertToDouble +10888194E-21 } 0x3d08849dd33c95af test expr-28.666 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -21776388 E-21 x -18849dd33c95ae_11111111111111111111111111110& E-46 convertToDouble -21776388E-21 } 0xbd18849dd33c95af test expr-28.667 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +635806667 E27 x 1e9cec176c96f8_000000000000000000000000000000001& E118 convertToDouble +635806667E27 } 0x475e9cec176c96f8 test expr-28.668 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -670026614 E25 x -14a593f89f4194_00000000000000000000000000000001& E112 convertToDouble -670026614E25 } 0xc6f4a593f89f4194 test expr-28.669 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +335013307 E26 x 19cef8f6c711f9_0000000000000000000000000000001& E114 convertToDouble +335013307E26 } 0x4719cef8f6c711f9 test expr-28.670 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -335013307 E25 x -14a593f89f4194_00000000000000000000000000000001& E111 convertToDouble -335013307E25 } 0xc6e4a593f89f4194 test expr-28.671 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +371790617 E-24 x 1aca538c61ba9c_000000000000000000000000000000001& E-52 convertToDouble +371790617E-24 } 0x3cbaca538c61ba9c test expr-28.672 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -371790617 E-25 x -156ea93d1afbb0_0000000000000000000000000000000001& E-55 convertToDouble -371790617E-25 } 0xbc856ea93d1afbb0 test expr-28.673 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +743581234 E-24 x 1aca538c61ba9c_000000000000000000000000000000001& E-51 convertToDouble +743581234E-24 } 0x3ccaca538c61ba9c test expr-28.674 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -743581234 E-25 x -156ea93d1afbb0_0000000000000000000000000000000001& E-54 convertToDouble -743581234E-25 } 0xbc956ea93d1afbb0 test expr-28.675 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +202464477 E24 x 13f6ec0435ce24_111111111111111111111111111110& E107 convertToDouble +202464477E24 } 0x46a3f6ec0435ce25 test expr-28.676 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -404928954 E24 x -13f6ec0435ce24_111111111111111111111111111110& E108 convertToDouble -404928954E24 } 0xc6b3f6ec0435ce25 test expr-28.677 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +997853758 E27 x 1805bfa33b98fa_111111111111111111111111111110& E119 convertToDouble +997853758E27 } 0x476805bfa33b98fb test expr-28.678 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -997853758 E26 x -1337cc829613fb_111111111111111111111111111110& E116 convertToDouble -997853758E26 } 0xc73337cc829613fc test expr-28.679 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +405498418 E-17 x 116a8093df66a6_111111111111111111111111111111110& E-28 convertToDouble +405498418E-17 } 0x3e316a8093df66a7 test expr-28.680 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -582579084 E-14 x -186f653140a658_111111111111111111111111111111110& E-18 convertToDouble -582579084E-14 } 0xbed86f653140a659 test expr-28.681 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +608247627 E-18 x 14e633e4a5ae61_111111111111111111111111111111110& E-31 convertToDouble +608247627E-18 } 0x3e04e633e4a5ae62 test expr-28.682 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -291289542 E-14 x -186f653140a658_111111111111111111111111111111110& E-19 convertToDouble -291289542E-14 } 0xbec86f653140a659 test expr-28.683 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9537100005 E26 x -16f5b11191713a_000000000000000000000000000000001& E119 convertToDouble -9537100005E26 } 0xc766f5b11191713a test expr-28.684 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6358066670 E27 x 1322138ea3de5b_000000000000000000000000000000001& E122 convertToDouble +6358066670E27 } 0x479322138ea3de5b test expr-28.685 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1271613334 E27 x -1e9cec176c96f8_000000000000000000000000000000001& E119 convertToDouble -1271613334E27 } 0xc76e9cec176c96f8 test expr-28.686 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5229646999 E-16 x 118c3b89731f3d_000000000000000000000000000000000001& E-21 convertToDouble +5229646999E-16 } 0x3ea18c3b89731f3d test expr-28.687 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5229646999 E-17 x 1c13927584fec8_00000000000000000000000000000000001& E-25 convertToDouble +5229646999E-17 } 0x3e6c13927584fec8 test expr-28.688 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4429943614 E24 x 1b4d37fa06864a_1111111111111111111111111111111110& E111 convertToDouble +4429943614E24 } 0x46eb4d37fa06864b test expr-28.689 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8859887228 E24 x -1b4d37fa06864a_1111111111111111111111111111111110& E112 convertToDouble -8859887228E24 } 0xc6fb4d37fa06864b test expr-28.690 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +2214971807 E24 x 1b4d37fa06864a_1111111111111111111111111111111110& E110 convertToDouble +2214971807E24 } 0x46db4d37fa06864b test expr-28.691 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4176887093 E26 x -141c692c5bd07a_111111111111111111111111111111110& E118 convertToDouble -4176887093E26 } 0xc7541c692c5bd07b test expr-28.692 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4003495257 E-20 x 16026b2e07ec06_111111111111111111111111111111111110& E-35 convertToDouble +4003495257E-20 } 0x3dc6026b2e07ec07 test expr-28.693 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4361901637 E-23 x -188e29a9d7c5b8_11111111111111111111111111111111110& E-45 convertToDouble -4361901637E-23 } 0xbd288e29a9d7c5b9 test expr-28.694 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8723803274 E-23 x 188e29a9d7c5b8_11111111111111111111111111111111110& E-44 convertToDouble +8723803274E-23 } 0x3d388e29a9d7c5b9 test expr-28.695 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8006990514 E-20 x -16026b2e07ec06_111111111111111111111111111111111110& E-34 convertToDouble -8006990514E-20 } 0xbdd6026b2e07ec07 test expr-28.696 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +72835110098 E27 x 1b65c41711fb6d_0000000000000000000000000000000000001& E125 convertToDouble +72835110098E27 } 0x47cb65c41711fb6d test expr-28.697 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -36417555049 E27 x -1b65c41711fb6d_0000000000000000000000000000000000001& E124 convertToDouble -36417555049E27 } 0xc7bb65c41711fb6d test expr-28.698 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +84279630104 E25 x 144a221b1cf62e_000000000000000000000000000000000001& E119 convertToDouble +84279630104E25 } 0x47644a221b1cf62e test expr-28.699 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -84279630104 E24 x -103b4e7c172b58_000000000000000000000000000000000001& E116 convertToDouble -84279630104E24 } 0xc7303b4e7c172b58 test expr-28.700 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +21206176437 E-27 x 1872f563ae0cc9_0000000000000000000000000000000000001& E-56 convertToDouble +21206176437E-27 } 0x3c7872f563ae0cc9 test expr-28.701 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -66461566917 E-22 x -1d3ae83e4322b3_00000000000000000000000000000000000001& E-38 convertToDouble -66461566917E-22 } 0xbd9d3ae83e4322b3 test expr-28.702 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +64808355539 E-16 x 1b2ebe83265fbf_00000000000000000000000000000000000001& E-18 convertToDouble +64808355539E-16 } 0x3edb2ebe83265fbf test expr-28.703 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -84932679673 E-19 x -123d39339f1bf6_00000000000000000000000000000000000001& E-27 convertToDouble -84932679673E-19 } 0xbe423d39339f1bf6 test expr-28.704 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +65205430094 E26 x 139f3e5d7fd76a_1111111111111111111111111111111111110& E122 convertToDouble +65205430094E26 } 0x47939f3e5d7fd76b test expr-28.705 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -68384463429 E25 x -107684982f634e_1111111111111111111111111111111111111110& E119 convertToDouble -68384463429E25 } 0xc7607684982f634f test expr-28.706 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +32602715047 E26 x 139f3e5d7fd76a_1111111111111111111111111111111111110& E121 convertToDouble +32602715047E26 } 0x47839f3e5d7fd76b test expr-28.707 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -62662203426 E27 x -1792269424688d_111111111111111111111111111111111110& E125 convertToDouble -62662203426E27 } 0xc7c792269424688e test expr-28.708 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +58784444678 E-18 x 1f8f45c64b4682_111111111111111111111111111111111111110& E-25 convertToDouble +58784444678E-18 } 0x3e6f8f45c64b4683 test expr-28.709 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -50980203373 E-21 x -1c06d366394440_11111111111111111111111111111111111111111110& E-35 convertToDouble -50980203373E-21 } 0xbdcc06d366394441 test expr-28.710 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +29392222339 E-18 x 1f8f45c64b4682_111111111111111111111111111111111111110& E-26 convertToDouble +29392222339E-18 } 0x3e5f8f45c64b4683 test expr-28.711 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -75529940323 E-27 x -15c5203c0aad52_1111111111111111111111111111111111111110& E-54 convertToDouble -75529940323E-27 } 0xbc95c5203c0aad53 test expr-28.712 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -937495906299 E26 x -11a1e0ebb6af11_000000000000000000000000000000000000000001& E126 convertToDouble -937495906299E26 } 0xc7d1a1e0ebb6af11 test expr-28.713 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +842642485799 E-20 x 121879decdd7cb_000000000000000000000000000000000000000001& E-27 convertToDouble +842642485799E-20 } 0x3e421879decdd7cb test expr-28.714 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -387824150699 E-23 x -110e8302245571_00000000000000000000000000000000000000001& E-38 convertToDouble -387824150699E-23 } 0xbd910e8302245571 test expr-28.715 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +924948814726 E-27 x 10a992d1fc6ded_00000000000000000000000000000000000000001& E-50 convertToDouble +924948814726E-27 } 0x3cd0a992d1fc6ded test expr-28.716 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -775648301398 E-23 x -110e8302245571_00000000000000000000000000000000000000001& E-37 convertToDouble -775648301398E-23 } 0xbda10e8302245571 test expr-28.717 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +547075707432 E25 x 107684982f634e_1111111111111111111111111111111111111110& E122 convertToDouble +547075707432E25 } 0x47907684982f634f test expr-28.718 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +683844634290 E24 x 107684982f634e_1111111111111111111111111111111111111110& E119 convertToDouble +683844634290E24 } 0x47607684982f634f test expr-28.719 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -136768926858 E25 x -107684982f634e_1111111111111111111111111111111111111110& E120 convertToDouble -136768926858E25 } 0xc7707684982f634f test expr-28.720 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +509802033730 E-22 x 1c06d366394440_11111111111111111111111111111111111111111110& E-35 convertToDouble +509802033730E-22 } 0x3dcc06d366394441 test expr-28.721 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +101960406746 E-21 x 1c06d366394440_11111111111111111111111111111111111111111110& E-34 convertToDouble +101960406746E-21 } 0x3ddc06d366394441 test expr-28.722 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -815683253968 E-21 x -1c06d366394440_11111111111111111111111111111111111111111110& E-31 convertToDouble -815683253968E-21 } 0xbe0c06d366394441 test expr-28.723 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +7344124123524 E24 x 1619b519dd6833_00000000000000000000000000000000000000000001& E122 convertToDouble +7344124123524E24 } 0x479619b519dd6833 test expr-28.724 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9180155154405 E23 x -1619b519dd6833_00000000000000000000000000000000000000000001& E119 convertToDouble -9180155154405E23 } 0xc76619b519dd6833 test expr-28.725 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6479463327323 E27 x 130a9b3e9bd05e_00000000000000000000000000000000000000000001& E132 convertToDouble +6479463327323E27 } 0x48330a9b3e9bd05e test expr-28.726 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1836031030881 E24 x -1619b519dd6833_00000000000000000000000000000000000000000001& E120 convertToDouble -1836031030881E24 } 0xc77619b519dd6833 test expr-28.727 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4337269293039 E-19 x 1d1b5f354c63d6_00000000000000000000000000000000000000000001& E-22 convertToDouble +4337269293039E-19 } 0x3e9d1b5f354c63d6 test expr-28.728 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4599163554373 E-23 x -1948bf4d34088d_00000000000000000000000000000000000000000001& E-35 convertToDouble -4599163554373E-23 } 0xbdc948bf4d34088d test expr-28.729 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9198327108746 E-23 x 1948bf4d34088d_00000000000000000000000000000000000000000001& E-34 convertToDouble +9198327108746E-23 } 0x3dd948bf4d34088d test expr-28.730 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4812803938347 E27 x 1c4980a4ee94ce_111111111111111111111111111111111111111111110& E131 convertToDouble +4812803938347E27 } 0x482c4980a4ee94cf test expr-28.731 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8412030890011 E23 x -14405075e52db9_11111111111111111111111111111111111111111110& E119 convertToDouble -8412030890011E23 } 0xc764405075e52dba test expr-28.732 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9625607876694 E27 x 1c4980a4ee94ce_111111111111111111111111111111111111111111110& E132 convertToDouble +9625607876694E27 } 0x483c4980a4ee94cf test expr-28.733 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4739968828249 E24 x -1c87140cdf8a1d_1111111111111111111111111111111111111111110& E121 convertToDouble -4739968828249E24 } 0xc78c87140cdf8a1e test expr-28.734 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9697183891673 E-23 x 1aa7c959b6a666_11111111111111111111111111111111111111111111110& E-34 convertToDouble +9697183891673E-23 } 0x3ddaa7c959b6a667 test expr-28.735 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7368108517543 E-20 x -13c7535bbd85a1_1111111111111111111111111111111111111111111110& E-24 convertToDouble -7368108517543E-20 } 0xbe73c7535bbd85a2 test expr-28.736 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +51461358161422 E25 x 18326f87d4cae0_0000000000000000000000000000000000000000000000001& E128 convertToDouble +51461358161422E25 } 0x47f8326f87d4cae0 test expr-28.737 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -77192037242133 E26 x -16af488f577e32_0000000000000000000000000000000000000000000000001& E132 convertToDouble -77192037242133E26 } 0xc836af488f577e32 test expr-28.738 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +77192037242133 E25 x 1225d3a5df9828_0000000000000000000000000000000000000000000000001& E129 convertToDouble +77192037242133E25 } 0x480225d3a5df9828 test expr-28.739 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -51461358161422 E27 x -12e767221e3e7f_0000000000000000000000000000000000000000000000001& E135 convertToDouble -51461358161422E27 } 0xc862e767221e3e7f test expr-28.740 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +43999661561541 E-21 x 179f4476d372a3_0000000000000000000000000000000000000000000000001& E-25 convertToDouble +43999661561541E-21 } 0x3e679f4476d372a3 test expr-28.741 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -87999323123082 E-21 x -179f4476d372a3_0000000000000000000000000000000000000000000000001& E-24 convertToDouble -87999323123082E-21 } 0xbe779f4476d372a3 test expr-28.742 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +48374886826137 E-26 x 110538f23350d5_00000000000000000000000000000000000000000000001& E-41 convertToDouble +48374886826137E-26 } 0x3d610538f23350d5 test expr-28.743 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -57684246567111 E-23 x -13d1f5c1b8a912_00000000000000000000000000000000000000000000001& E-31 convertToDouble -57684246567111E-23 } 0xbe03d1f5c1b8a912 test expr-28.744 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +87192805957686 E23 x 1a3d16e55a9664_1111111111111111111111111111111111111111111110& E122 convertToDouble +87192805957686E23 } 0x479a3d16e55a9665 test expr-28.745 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -75108713005913 E24 x -1c40b4baa79655_11111111111111111111111111111111111111111111110& E125 convertToDouble -75108713005913E24 } 0xc7cc40b4baa79656 test expr-28.746 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +64233110587487 E27 x 179873e38669a6_1111111111111111111111111111111111111111111110& E135 convertToDouble +64233110587487E27 } 0x48679873e38669a7 test expr-28.747 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -77577471133384 E-23 x -1aa7c959b6a666_11111111111111111111111111111111111111111111110& E-31 convertToDouble -77577471133384E-23 } 0xbe0aa7c959b6a667 test expr-28.748 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +48485919458365 E-24 x 1aa7c959b6a666_11111111111111111111111111111111111111111111110& E-35 convertToDouble +48485919458365E-24 } 0x3dcaa7c959b6a667 test expr-28.749 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -56908598265713 E-26 x -1405deef4bdef5_111111111111111111111111111111111111111111111110& E-41 convertToDouble -56908598265713E-26 } 0xbd6405deef4bdef6 test expr-28.750 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +589722294620133 E23 x 162ed1b287caef_00000000000000000000000000000000000000000000000001& E125 convertToDouble +589722294620133E23 } 0x47c62ed1b287caef test expr-28.751 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +652835804449289 E-22 x 118640e490b087_0000000000000000000000000000000000000000000000000001& E-24 convertToDouble +652835804449289E-22 } 0x3e718640e490b087 test expr-28.752 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -656415363936202 E-23 x -1c315cfe25d201_00000000000000000000000000000000000000000000000001& E-28 convertToDouble -656415363936202E-23 } 0xbe3c315cfe25d201 test expr-28.753 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +579336749585745 E-25 x 1fd9709d9aeb19_00000000000000000000000000000000000000000000000001& E-35 convertToDouble +579336749585745E-25 } 0x3dcfd9709d9aeb19 test expr-28.754 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -381292764980839 E-26 x -10c4f9921c3f8f_00000000000000000000000000000000000000000000000001& E-38 convertToDouble -381292764980839E-26 } 0xbd90c4f9921c3f8f test expr-28.755 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +965265859649698 E23 x 12279607edcb0c_1111111111111111111111111111111111111111111111110& E126 convertToDouble +965265859649698E23 } 0x47d2279607edcb0d test expr-28.756 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -848925235434882 E27 x -137d88ba4b43e3_1111111111111111111111111111111111111111111111111110& E139 convertToDouble -848925235434882E27 } 0xc8a37d88ba4b43e4 test expr-28.757 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +536177612222491 E23 x 142b33dd3acafd_11111111111111111111111111111111111111111111111110& E125 convertToDouble +536177612222491E23 } 0x47c42b33dd3acafe test expr-28.758 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -424462617717441 E27 x -137d88ba4b43e3_1111111111111111111111111111111111111111111111111110& E138 convertToDouble -424462617717441E27 } 0xc8937d88ba4b43e4 test expr-28.759 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +276009279888989 E-27 x 136c242313c288_111111111111111111111111111111111111111111111111110& E-42 convertToDouble +276009279888989E-27 } 0x3d536c242313c289 test expr-28.760 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -608927158043691 E-26 x -1ac7e909c22f09_11111111111111111111111111111111111111111111111110& E-38 convertToDouble -608927158043691E-26 } 0xbd9ac7e909c22f0a test expr-28.761 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +552018559777978 E-27 x 136c242313c288_111111111111111111111111111111111111111111111111110& E-41 convertToDouble +552018559777978E-27 } 0x3d636c242313c289 test expr-28.762 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -425678377667758 E-22 x -16da7aa49bdcd5_1111111111111111111111111111111111111111111111110& E-25 convertToDouble -425678377667758E-22 } 0xbe66da7aa49bdcd6 test expr-28.763 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8013702726927119 E26 x 126607f8f1b29e_00000000000000000000000000000000000000000000000000001& E139 convertToDouble +8013702726927119E26 } 0x48a26607f8f1b29e test expr-28.764 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8862627962362001 E27 x 196f3b0e7787c2_00000000000000000000000000000000000000000000000000001& E142 convertToDouble +8862627962362001E27 } 0x48d96f3b0e7787c2 test expr-28.765 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5068007907757162 E26 x -17456a27848397_00000000000000000000000000000000000000000000000000001& E138 convertToDouble -5068007907757162E26 } 0xc897456a27848397 test expr-28.766 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7379714799828406 E-23 x -13cf4d2839e036_00000000000000000000000000000000000000000000000000001& E-24 convertToDouble -7379714799828406E-23 } 0xbe73cf4d2839e036 test expr-28.767 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4114538064016107 E-27 x 12188eda98010c_0000000000000000000000000000000000000000000000000001& E-38 convertToDouble +4114538064016107E-27 } 0x3d92188eda98010c test expr-28.768 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3689857399914203 E-23 x -13cf4d2839e036_00000000000000000000000000000000000000000000000000001& E-25 convertToDouble -3689857399914203E-23 } 0xbe63cf4d2839e036 test expr-28.769 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5575954851815478 E23 x 1a37cfbf2ffdb5_1111111111111111111111111111111111111111111111111110& E128 convertToDouble +5575954851815478E23 } 0x47fa37cfbf2ffdb6 test expr-28.770 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3395700941739528 E27 x 137d88ba4b43e3_1111111111111111111111111111111111111111111111111110& E141 convertToDouble +3395700941739528E27 } 0x48c37d88ba4b43e4 test expr-28.771 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4115535777581961 E-23 x 1618596be30fe4_111111111111111111111111111111111111111111111111111110& E-25 convertToDouble +4115535777581961E-23 } 0x3e6618596be30fe5 test expr-28.772 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8231071555163922 E-23 x -1618596be30fe4_111111111111111111111111111111111111111111111111111110& E-24 convertToDouble -8231071555163922E-23 } 0xbe7618596be30fe5 test expr-28.773 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6550246696190871 E-26 x 1201538b0f8c69_111111111111111111111111111111111111111111111111111110& E-34 convertToDouble +6550246696190871E-26 } 0x3dd201538b0f8c6a test expr-28.774 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -68083046403986701 E27 x -186c70ba8ba28d_000000000000000000000000000000000000000000000000000000001& E145 convertToDouble -68083046403986701E27 } 0xc9086c70ba8ba28d test expr-28.775 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +43566388595783643 E27 x 1f41e1bf48b03f_111111111111111111111111111111111111111111111111111111110& E144 convertToDouble +43566388595783643E27 } 0x48ff41e1bf48b040 test expr-28.776 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -87132777191567286 E27 x -1f41e1bf48b03f_111111111111111111111111111111111111111111111111111111110& E145 convertToDouble -87132777191567286E27 } 0xc90f41e1bf48b040 test expr-28.777 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +59644881059342141 E25 x 1b6338d9d8ae38_11111111111111111111111111111111111111111111111111111110& E138 convertToDouble +59644881059342141E25 } 0x489b6338d9d8ae39 test expr-28.778 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -83852770718576667 E23 x -18a4619ed6f442_111111111111111111111111111111111111111111111111111111110& E132 convertToDouble -83852770718576667E23 } 0xc838a4619ed6f443 test expr-28.779 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +99482967418206961 E-25 x 155d224bfed7ac_11111111111111111111111111111111111111111111111111111111110& E-27 convertToDouble +99482967418206961E-25 } 0x3e455d224bfed7ad test expr-28.780 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -99482967418206961 E-26 x -11174ea3324623_11111111111111111111111111111111111111111111111111111111110& E-30 convertToDouble -99482967418206961E-26 } 0xbe11174ea3324624 test expr-28.781 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +87446669969994614 E-27 x 1809832942376d_11111111111111111111111111111111111111111111111111111110& E-34 convertToDouble +87446669969994614E-27 } 0x3dd809832942376e test expr-28.782 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -43723334984997307 E-27 x -1809832942376d_11111111111111111111111111111111111111111111111111111110& E-35 convertToDouble -43723334984997307E-27 } 0xbdc809832942376e test expr-28.783 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5 E24 x 108b2a2c280290_1001& E82 convertToDouble +5E24 } 0x45108b2a2c280291 test expr-28.784 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8 E25 x -108b2a2c280290_1001& E86 convertToDouble -8E25 } 0xc5508b2a2c280291 test expr-28.785 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1 E25 x 108b2a2c280290_1001& E83 convertToDouble +1E25 } 0x45208b2a2c280291 test expr-28.786 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4 E25 x -108b2a2c280290_1001& E85 convertToDouble -4E25 } 0xc5408b2a2c280291 test expr-28.787 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +2 E-5 x 14f8b588e368f0_100001& E-16 convertToDouble +2E-5 } 0x3ef4f8b588e368f1 test expr-28.788 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5 E-6 x -14f8b588e368f0_100001& E-18 convertToDouble -5E-6 } 0xbed4f8b588e368f1 test expr-28.789 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4 E-5 x 14f8b588e368f0_100001& E-15 convertToDouble +4E-5 } 0x3f04f8b588e368f1 test expr-28.790 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3 E-20 x -11b578c96db19a_100001& E-65 convertToDouble -3E-20 } 0xbbe1b578c96db19b test expr-28.791 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3 E27 x 1363156bbee301_0110& E91 convertToDouble +3E27 } 0x45a363156bbee301 test expr-28.792 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9 E26 x -1743b34e18439b_010& E89 convertToDouble -9E26 } 0xc58743b34e18439b test expr-28.793 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +7 E25 x 1cf389cd46047d_00& E85 convertToDouble +7E25 } 0x454cf389cd46047d test expr-28.794 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6 E27 x -1363156bbee301_0110& E92 convertToDouble -6E27 } 0xc5b363156bbee301 test expr-28.795 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +2 E-21 x 12e3b40a0e9b4f_0111110& E-69 convertToDouble +2E-21 } 0x3ba2e3b40a0e9b4f test expr-28.796 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5 E-22 x -12e3b40a0e9b4f_0111110& E-71 convertToDouble -5E-22 } 0xbb82e3b40a0e9b4f test expr-28.797 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4 E-21 x -12e3b40a0e9b4f_0111110& E-68 convertToDouble -4E-21 } 0xbbb2e3b40a0e9b4f test expr-28.798 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +87 E25 x 167d2d5406637c_10001& E89 convertToDouble +87E25 } 0x45867d2d5406637d test expr-28.799 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -97 E24 x -140f232256e982_1000000001& E86 convertToDouble -97E24 } 0xc5540f232256e983 test expr-28.800 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +82 E-24 x 18c87154dff6c6_1000000001& E-74 convertToDouble +82E-24 } 0x3b58c87154dff6c7 test expr-28.801 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -41 E-24 x -18c87154dff6c6_1000000001& E-75 convertToDouble -41E-24 } 0xbb48c87154dff6c7 test expr-28.802 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +76 E-23 x 1cb644dc1633c0_10000001& E-71 convertToDouble +76E-23 } 0x3b8cb644dc1633c1 test expr-28.803 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +83 E25 x 15747ab143e353_011111111110& E89 convertToDouble +83E25 } 0x4585747ab143e353 test expr-28.804 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -50 E27 x -1431e0fae6d721_0111110& E95 convertToDouble -50E27 } 0xc5e431e0fae6d721 test expr-28.805 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +25 E27 x 1431e0fae6d721_0111110& E94 convertToDouble +25E27 } 0x45d431e0fae6d721 test expr-28.806 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -99 E27 x -13fe2e171cda19_011110& E96 convertToDouble -99E27 } 0xc5f3fe2e171cda19 test expr-28.807 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +97 E-10 x 14d4a1a3157dc7_011111110& E-27 convertToDouble +97E-10 } 0x3e44d4a1a3157dc7 test expr-28.808 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -57 E-20 x -15077f6f3242e7_011111110& E-61 convertToDouble -57E-20 } 0xbc25077f6f3242e7 test expr-28.809 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +997 E23 x 149e12f51c1a3c_10000000001& E86 convertToDouble +997E23 } 0x45549e12f51c1a3d test expr-28.810 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +776 E24 x 140f232256e982_1000000001& E89 convertToDouble +776E24 } 0x45840f232256e983 test expr-28.811 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -388 E24 x -140f232256e982_1000000001& E88 convertToDouble -388E24 } 0xc5740f232256e983 test expr-28.812 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +521 E-10 x 1bf891c92c0890_100000000001& E-25 convertToDouble +521E-10 } 0x3e6bf891c92c0891 test expr-28.813 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -506 E-26 x -1877fa0260beb2_10000000001& E-78 convertToDouble -506E-26 } 0xbb1877fa0260beb3 test expr-28.814 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +739 E-10 x 13d65e8c76722c_10000000001& E-24 convertToDouble +739E-10 } 0x3e73d65e8c76722d test expr-28.815 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -867 E-7 x -16ba56a8834168_100000000001& E-14 convertToDouble -867E-7 } 0xbf16ba56a8834169 test expr-28.816 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -415 E24 x -15747ab143e353_011111111110& E88 convertToDouble -415E24 } 0xc575747ab143e353 test expr-28.817 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +332 E25 x 15747ab143e353_011111111110& E91 convertToDouble +332E25 } 0x45a5747ab143e353 test expr-28.818 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -664 E25 x -15747ab143e353_011111111110& E92 convertToDouble -664E25 } 0xc5b5747ab143e353 test expr-28.819 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +291 E-13 x 1ffeebfc8b81b5_01111111111110& E-36 convertToDouble +291E-13 } 0x3dbffeebfc8b81b5 test expr-28.820 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -982 E-8 x -14981285e98e79_0111111111110& E-17 convertToDouble -982E-8 } 0xbee4981285e98e79 test expr-28.821 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +582 E-13 x 1ffeebfc8b81b5_01111111111110& E-35 convertToDouble +582E-13 } 0x3dcffeebfc8b81b5 test expr-28.822 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -491 E-8 x -14981285e98e79_0111111111110& E-18 convertToDouble -491E-8 } 0xbed4981285e98e79 test expr-28.823 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4574 E26 x 1717c1a612f954_100000000001& E98 convertToDouble +4574E26 } 0x461717c1a612f955 test expr-28.824 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8609 E26 x -15bb6f942546ee_1000000000001& E99 convertToDouble -8609E26 } 0xc625bb6f942546ef test expr-28.825 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +2287 E26 x 1717c1a612f954_100000000001& E97 convertToDouble +2287E26 } 0x460717c1a612f955 test expr-28.826 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4818 E24 x -1f22b65eb419a0_10000000001& E91 convertToDouble -4818E24 } 0xc5af22b65eb419a1 test expr-28.827 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6529 E-8 x 111d89a8b5c142_100000000000001& E-14 convertToDouble +6529E-8 } 0x3f111d89a8b5c143 test expr-28.828 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8151 E-21 x -12cb804b61b898_1000000000000001& E-57 convertToDouble -8151E-21 } 0xbc62cb804b61b899 test expr-28.829 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1557 E-12 x 1abfc227ab1026_10000000000001& E-30 convertToDouble +1557E-12 } 0x3e1abfc227ab1027 test expr-28.830 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2573 E-18 x -172cef1ebbca44_10000000000001& E-49 convertToDouble -2573E-18 } 0xbce72cef1ebbca45 test expr-28.831 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4929 E-16 x 1157a604ed019f_0111111111111110& E-41 convertToDouble +4929E-16 } 0x3d6157a604ed019f test expr-28.832 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3053 E-22 x -1686f435fe6b6b_011111111111110& E-62 convertToDouble -3053E-22 } 0xbc1686f435fe6b6b test expr-28.833 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9858 E-16 x 1157a604ed019f_0111111111111110& E-40 convertToDouble +9858E-16 } 0x3d7157a604ed019f test expr-28.834 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7767 E-11 x -14d971170ed055_011111111111110& E-24 convertToDouble -7767E-11 } 0xbe74d971170ed055 test expr-28.835 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +54339 E26 x 1125782ec15cbe_100000000000000001& E102 convertToDouble +54339E26 } 0x465125782ec15cbf test expr-28.836 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -62409 E25 x -1f822c980d4bb2_100000000000000001& E98 convertToDouble -62409E25 } 0xc61f822c980d4bb3 test expr-28.837 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +32819 E27 x 19e3be885fc16a_100000000000001& E104 convertToDouble +32819E27 } 0x4679e3be885fc16b test expr-28.838 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -89849 E27 x -11b8371b6dda04_1000000000000001& E106 convertToDouble -89849E27 } 0xc691b8371b6dda05 test expr-28.839 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +63876 E-20 x 1703856844bdbe_1000000000000000000001& E-51 convertToDouble +63876E-20 } 0x3cc703856844bdbf test expr-28.840 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -15969 E-20 x -1703856844bdbe_1000000000000000000001& E-53 convertToDouble -15969E-20 } 0xbca703856844bdbf test expr-28.841 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +31938 E-20 x 1703856844bdbe_1000000000000000000001& E-52 convertToDouble +31938E-20 } 0x3cb703856844bdbf test expr-28.842 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -79845 E-21 x -1703856844bdbe_1000000000000000000001& E-54 convertToDouble -79845E-21 } 0xbc9703856844bdbf test expr-28.843 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +89306 E27 x 119cccff237e17_011111111111110& E106 convertToDouble +89306E27 } 0x46919cccff237e17 test expr-28.844 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -25487 E24 x -1496968ba07117_01111111111110& E94 convertToDouble -25487E24 } 0xc5d496968ba07117 test expr-28.845 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +79889 E24 x 10222a1c7e27d3_01111111111110& E96 convertToDouble +79889E24 } 0x45f0222a1c7e27d3 test expr-28.846 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -97379 E26 x -1eba3685911519_011111111111111110& E102 convertToDouble -97379E26 } 0xc65eba3685911519 test expr-28.847 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +81002 E-8 x 1a8af0b45d9531_0111111111111111110& E-11 convertToDouble +81002E-8 } 0x3f4a8af0b45d9531 test expr-28.848 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -43149 E-25 x -146064de6ecbed_011111111111111110& E-68 convertToDouble -43149E-25 } 0xbbb46064de6ecbed test expr-28.849 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +40501 E-8 x 1a8af0b45d9531_0111111111111111110& E-12 convertToDouble +40501E-8 } 0x3f3a8af0b45d9531 test expr-28.850 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -60318 E-10 x -194c988f217e51_011111111111111110& E-18 convertToDouble -60318E-10 } 0xbed94c988f217e51 test expr-28.851 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -648299 E27 x -1ff6af0bf00100_10000000000000000001& E108 convertToDouble -648299E27 } 0xc6bff6af0bf00101 test expr-28.852 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +780649 E24 x 13b4d36f9edd18_10000000000000000001& E99 convertToDouble +780649E24 } 0x4623b4d36f9edd19 test expr-28.853 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +720919 E-14 x 1ef696965cbf04_10000000000000000000000001& E-28 convertToDouble +720919E-14 } 0x3e3ef696965cbf05 test expr-28.854 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -629703 E-11 x -1a69626d2629d0_1000000000000000000000001& E-18 convertToDouble -629703E-11 } 0xbeda69626d2629d1 test expr-28.855 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +557913 E24 x 1c2adb44b394bf_01111111111111111110& E98 convertToDouble +557913E24 } 0x461c2adb44b394bf test expr-28.856 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -847899 E23 x -111f88fb93dce9_011111111111111111110& E96 convertToDouble -847899E23 } 0xc5f11f88fb93dce9 test expr-28.857 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +565445 E27 x 1be0eb55770d4d_0111111111111111110& E108 convertToDouble +565445E27 } 0x46bbe0eb55770d4d test expr-28.858 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -736531 E24 x -1297b853d64ac7_01111111111111111110& E99 convertToDouble -736531E24 } 0xc62297b853d64ac7 test expr-28.859 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +680013 E-19 x 13240293e95c3b_01111111111111111111110& E-44 convertToDouble +680013E-19 } 0x3d33240293e95c3b test expr-28.860 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -529981 E-10 x -1bc948d999ac11_011111111111111111110& E-15 convertToDouble -529981E-10 } 0xbf0bc948d999ac11 test expr-28.861 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +382923 E-23 x 11a8c1c10a1fc5_011111111111111111110& E-58 convertToDouble +382923E-23 } 0x3c51a8c1c10a1fc5 test expr-28.862 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -633614 E-18 x -164b166995a9b7_011111111111111111110& E-41 convertToDouble -633614E-18 } 0xbd664b166995a9b7 test expr-28.863 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +2165479 E27 x 1ab10c016c34b8_100000000000000000000001& E110 convertToDouble +2165479E27 } 0x46dab10c016c34b9 test expr-28.864 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8661916 E27 x -1ab10c016c34b8_100000000000000000000001& E112 convertToDouble -8661916E27 } 0xc6fab10c016c34b9 test expr-28.865 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4330958 E27 x 1ab10c016c34b8_100000000000000000000001& E111 convertToDouble +4330958E27 } 0x46eab10c016c34b9 test expr-28.866 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9391993 E22 x -12f78bec748c98_1000000000000000000001& E96 convertToDouble -9391993E22 } 0xc5f2f78bec748c99 test expr-28.867 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5767352 E-14 x -1ef696965cbf04_10000000000000000000000001& E-25 convertToDouble -5767352E-14 } 0xbe6ef696965cbf05 test expr-28.868 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +7209190 E-15 x 1ef696965cbf04_10000000000000000000000001& E-28 convertToDouble +7209190E-15 } 0x3e3ef696965cbf05 test expr-28.869 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1441838 E-14 x -1ef696965cbf04_10000000000000000000000001& E-27 convertToDouble -1441838E-14 } 0xbe4ef696965cbf05 test expr-28.870 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8478990 E22 x 111f88fb93dce9_011111111111111111110& E96 convertToDouble +8478990E22 } 0x45f11f88fb93dce9 test expr-28.871 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +1473062 E24 x 1297b853d64ac7_01111111111111111110& E100 convertToDouble +1473062E24 } 0x463297b853d64ac7 test expr-28.872 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8366487 E-14 x 167567f55b22e1_0111111111111111111111110& E-24 convertToDouble +8366487E-14 } 0x3e767567f55b22e1 test expr-28.873 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8399969 E-25 x -1efd8be1b15b43_011111111111111111111110& E-61 convertToDouble -8399969E-25 } 0xbc2efd8be1b15b43 test expr-28.874 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9366737 E-12 x 13a4ba87ddc13f_011111111111111111111110& E-17 convertToDouble +9366737E-12 } 0x3ee3a4ba87ddc13f test expr-28.875 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9406141 E-13 x -1f8fd047c84d49_0111111111111111111111110& E-21 convertToDouble -9406141E-13 } 0xbeaf8fd047c84d49 test expr-28.876 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +65970979 E24 x 1a055dd68f3e3c_1000000000000000000000000001& E105 convertToDouble +65970979E24 } 0x468a055dd68f3e3d test expr-28.877 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -65060671 E26 x -140c61c9916cf4_100000000000000000000000001& E112 convertToDouble -65060671E26 } 0xc6f40c61c9916cf5 test expr-28.878 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +54923002 E27 x 1527d37d8b38ea_10000000000000000000000001& E115 convertToDouble +54923002E27 } 0x472527d37d8b38eb test expr-28.879 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -63846927 E25 x -1f7a9d79dad9b4_10000000000000000000000001& E108 convertToDouble -63846927E25 } 0xc6bf7a9d79dad9b5 test expr-28.880 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +99585767 E-21 x 1c07e928406d2e_100000000000000000000000001& E-44 convertToDouble +99585767E-21 } 0x3d3c07e928406d2f test expr-28.881 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +67488159 E25 x 10a31a03822bc9_011111111111111111111111111110& E109 convertToDouble +67488159E25 } 0x46c0a31a03822bc9 test expr-28.882 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -69005339 E24 x -1b37c234aae77b_011111111111111111111111110& E105 convertToDouble -69005339E24 } 0xc68b37c234aae77b test expr-28.883 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +81956786 E27 x 1f919023fcb6fd_0111111111111111111111111110& E115 convertToDouble +81956786E27 } 0x472f919023fcb6fd test expr-28.884 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -40978393 E27 x -1f919023fcb6fd_0111111111111111111111111110& E114 convertToDouble -40978393E27 } 0xc71f919023fcb6fd test expr-28.885 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +77505754 E-12 x 145152b6f85e09_0111111111111111111111111110& E-14 convertToDouble +77505754E-12 } 0x3f145152b6f85e09 test expr-28.886 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -38752877 E-12 x -145152b6f85e09_0111111111111111111111111110& E-15 convertToDouble -38752877E-12 } 0xbf045152b6f85e09 test expr-28.887 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +82772981 E-15 x 16381dae63505f_0111111111111111111111111111110& E-24 convertToDouble +82772981E-15 } 0x3e76381dae63505f test expr-28.888 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -95593517 E-25 x -160ad862d8537d_0111111111111111111111111110& E-57 convertToDouble -95593517E-25 } 0xbc660ad862d8537d test expr-28.889 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +200036989 E25 x 18a80dedbc575e_10000000000000000000000000001& E110 convertToDouble +200036989E25 } 0x46d8a80dedbc575f test expr-28.890 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -772686455 E27 x -129a0c45ceca7a_1000000000000000000000000000001& E119 convertToDouble -772686455E27 } 0xc7629a0c45ceca7b test expr-28.891 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +859139907 E23 x 10f18c4dd0ffe2_10000000000000000000000000001& E106 convertToDouble +859139907E23 } 0x4690f18c4dd0ffe3 test expr-28.892 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -400073978 E25 x -18a80dedbc575e_10000000000000000000000000001& E111 convertToDouble -400073978E25 } 0xc6e8a80dedbc575f test expr-28.893 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +569014327 E-14 x 17ddbeac19d3b2_100000000000000000000000000001& E-18 convertToDouble +569014327E-14 } 0x3ed7ddbeac19d3b3 test expr-28.894 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -794263862 E-15 x -1aa6acb41dfc52_1000000000000000000000000000001& E-21 convertToDouble -794263862E-15 } 0xbeaaa6acb41dfc53 test expr-28.895 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +397131931 E-15 x 1aa6acb41dfc52_1000000000000000000000000000001& E-22 convertToDouble +397131931E-15 } 0x3e9aa6acb41dfc53 test expr-28.896 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -380398957 E-16 x -146c29d8331024_100000000000000000000000000001& E-25 convertToDouble -380398957E-16 } 0xbe646c29d8331025 test expr-28.897 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +567366773 E27 x 1b5155dd5417f9_0111111111111111111111111111110& E118 convertToDouble +567366773E27 } 0x475b5155dd5417f9 test expr-28.898 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -337440795 E24 x -10a31a03822bc9_011111111111111111111111111110& E108 convertToDouble -337440795E24 } 0xc6b0a31a03822bc9 test expr-28.899 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +134976318 E25 x 10a31a03822bc9_011111111111111111111111111110& E110 convertToDouble +134976318E25 } 0x46d0a31a03822bc9 test expr-28.900 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -269952636 E25 x -10a31a03822bc9_011111111111111111111111111110& E111 convertToDouble -269952636E25 } 0xc6e0a31a03822bc9 test expr-28.901 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +932080597 E-20 x 147f25b4941e5b_0111111111111111111111111111110& E-37 convertToDouble +932080597E-20 } 0x3da47f25b4941e5b test expr-28.902 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -331091924 E-15 x -16381dae63505f_0111111111111111111111111111110& E-22 convertToDouble -331091924E-15 } 0xbe96381dae63505f test expr-28.903 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -413864905 E-16 x -16381dae63505f_0111111111111111111111111111110& E-25 convertToDouble -413864905E-16 } 0xbe66381dae63505f test expr-28.904 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8539246247 E26 x 148eb7813eaeba_10000000000000000000000000000001& E119 convertToDouble +8539246247E26 } 0x47648eb7813eaebb test expr-28.905 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -5859139791 E26 x -1c35f28719d478_10000000000000000000000000000001& E118 convertToDouble -5859139791E26 } 0xc75c35f28719d479 test expr-28.906 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6105010149 E24 x 12d000fb2b138a_1000000000000000000000000000000001& E112 convertToDouble +6105010149E24 } 0x46f2d000fb2b138b test expr-28.907 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3090745820 E27 x -129a0c45ceca7a_1000000000000000000000000000001& E121 convertToDouble -3090745820E27 } 0xc7829a0c45ceca7b test expr-28.908 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3470877773 E-20 x 1314d381f2c31e_1000000000000000000000000000000001& E-35 convertToDouble +3470877773E-20 } 0x3dc314d381f2c31f test expr-28.909 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6136309089 E-27 x -1c4c799fab4328_1000000000000000000000000000000001& E-58 convertToDouble -6136309089E-27 } 0xbc5c4c799fab4329 test expr-28.910 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8917758713 E-19 x 1ea424bda7d7f4_100000000000000000000000000000001& E-31 convertToDouble +8917758713E-19 } 0x3e0ea424bda7d7f5 test expr-28.911 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6941755546 E-20 x -1314d381f2c31e_1000000000000000000000000000000001& E-34 convertToDouble -6941755546E-20 } 0xbdd314d381f2c31f test expr-28.912 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9194900535 E25 x 11b56f9c090dfb_011111111111111111111111111111111110& E116 convertToDouble +9194900535E25 } 0x4731b56f9c090dfb test expr-28.913 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1838980107 E26 x -11b56f9c090dfb_011111111111111111111111111111111110& E117 convertToDouble -1838980107E26 } 0xc741b56f9c090dfb test expr-28.914 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +7355920428 E26 x 11b56f9c090dfb_011111111111111111111111111111111110& E119 convertToDouble +7355920428E26 } 0x4761b56f9c090dfb test expr-28.915 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3677960214 E26 x -11b56f9c090dfb_011111111111111111111111111111111110& E118 convertToDouble -3677960214E26 } 0xc751b56f9c090dfb test expr-28.916 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8473634343 E-17 x 16bf0984b232b7_0111111111111111111111111111111110& E-24 convertToDouble +8473634343E-17 } 0x3e76bf0984b232b7 test expr-28.917 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8870766274 E-16 x -1dc3ee22137269_0111111111111111111111111111111110& E-21 convertToDouble -8870766274E-16 } 0xbeadc3ee22137269 test expr-28.918 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +4435383137 E-16 x 1dc3ee22137269_0111111111111111111111111111111110& E-22 convertToDouble +4435383137E-16 } 0x3e9dc3ee22137269 test expr-28.919 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9598990129 E-15 x -14216b286031e7_01111111111111111111111111111111110& E-17 convertToDouble -9598990129E-15 } 0xbee4216b286031e7 test expr-28.920 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +71563496764 E26 x 15890d1ef6a0da_10000000000000000000000000000000000001& E122 convertToDouble +71563496764E26 } 0x4795890d1ef6a0db test expr-28.921 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -89454370955 E25 x -15890d1ef6a0da_10000000000000000000000000000000000001& E119 convertToDouble -89454370955E25 } 0xc765890d1ef6a0db test expr-28.922 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +17890874191 E26 x 15890d1ef6a0da_10000000000000000000000000000000000001& E120 convertToDouble +17890874191E26 } 0x4775890d1ef6a0db test expr-28.923 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -35781748382 E26 x -15890d1ef6a0da_10000000000000000000000000000000000001& E121 convertToDouble -35781748382E26 } 0xc785890d1ef6a0db test expr-28.924 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +57973447842 E-19 x 18e63f7cf5313c_1000000000000000000000000000000000000001& E-28 convertToDouble +57973447842E-19 } 0x3e38e63f7cf5313d test expr-28.925 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -28986723921 E-19 x -18e63f7cf5313c_1000000000000000000000000000000000000001& E-29 convertToDouble -28986723921E-19 } 0xbe28e63f7cf5313d test expr-28.926 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +76822711313 E-19 x 107f5f8b3bf818_100000000000000000000000000000000001& E-27 convertToDouble +76822711313E-19 } 0x3e407f5f8b3bf819 test expr-28.927 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -97699466874 E-20 x -10c8de34de806e_10000000000000000000000000000000001& E-30 convertToDouble -97699466874E-20 } 0xbe10c8de34de806f test expr-28.928 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +67748656762 E27 x 197bf5559b31fd_01111111111111111111111111111111111110& E125 convertToDouble +67748656762E27 } 0x47c97bf5559b31fd test expr-28.929 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -19394840991 E24 x -1de1ea791a6e7d_0111111111111111111111111111111111110& E113 convertToDouble -19394840991E24 } 0xc70de1ea791a6e7d test expr-28.930 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +38789681982 E24 x 1de1ea791a6e7d_0111111111111111111111111111111111110& E114 convertToDouble +38789681982E24 } 0x471de1ea791a6e7d test expr-28.931 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -33874328381 E27 x -197bf5559b31fd_01111111111111111111111111111111111110& E124 convertToDouble -33874328381E27 } 0xc7b97bf5559b31fd test expr-28.932 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +54323763886 E-27 x 1f50c5c63e5441_0111111111111111111111111111111111110& E-55 convertToDouble +54323763886E-27 } 0x3c8f50c5c63e5441 test expr-28.933 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -58987193887 E-20 x -14449185a4c829_011111111111111111111111111111111111110& E-31 convertToDouble -58987193887E-20 } 0xbe04449185a4c829 test expr-28.934 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +27161881943 E-27 x 1f50c5c63e5441_0111111111111111111111111111111111110& E-56 convertToDouble +27161881943E-27 } 0x3c7f50c5c63e5441 test expr-28.935 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -93042648033 E-19 x -13fb12dc023fd3_0111111111111111111111111111111111110& E-27 convertToDouble -93042648033E-19 } 0xbe43fb12dc023fd3 test expr-28.936 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +520831059055 E27 x 187d469cb69dd0_10000000000000000000000000000000000000001& E128 convertToDouble +520831059055E27 } 0x47f87d469cb69dd1 test expr-28.937 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -768124264394 E25 x -171d6a019edae8_1000000000000000000000000000000000000001& E122 convertToDouble -768124264394E25 } 0xc7971d6a019edae9 test expr-28.938 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +384062132197 E25 x 171d6a019edae8_1000000000000000000000000000000000000001& E121 convertToDouble +384062132197E25 } 0x47871d6a019edae9 test expr-28.939 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +765337749889 E-25 x 158ad6f5d0a854_100000000000000000000000000000000000000001& E-44 convertToDouble +765337749889E-25 } 0x3d358ad6f5d0a855 test expr-28.940 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +794368912771 E25 x 17e79872f2f7ef_01111111111111111111111111111111111111110& E122 convertToDouble +794368912771E25 } 0x4797e79872f2f7ef test expr-28.941 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -994162090146 E23 x -132598f85e658b_011111111111111111111111111111111111110& E116 convertToDouble -994162090146E23 } 0xc7332598f85e658b test expr-28.942 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +781652779431 E26 x 1d670adf52038f_01111111111111111111111111111111111110& E125 convertToDouble +781652779431E26 } 0x47cd670adf52038f test expr-28.943 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +910077190046 E-26 x 147e3ce1871d79_01111111111111111111111111111111111111110& E-47 convertToDouble +910077190046E-26 } 0x3d047e3ce1871d79 test expr-28.944 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -455038595023 E-26 x -147e3ce1871d79_01111111111111111111111111111111111111110& E-48 convertToDouble -455038595023E-26 } 0xbcf47e3ce1871d79 test expr-28.945 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +471897551096 E-20 x 14449185a4c829_011111111111111111111111111111111111110& E-28 convertToDouble +471897551096E-20 } 0x3e34449185a4c829 test expr-28.946 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -906698409911 E-21 x -1f27674f7d5745_0111111111111111111111111111111111111110& E-31 convertToDouble -906698409911E-21 } 0xbe0f27674f7d5745 test expr-28.947 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8854128003935 E25 x 10a71b8948faac_100000000000000000000000000000000000000001& E126 convertToDouble +8854128003935E25 } 0x47d0a71b8948faad test expr-28.948 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8146122716299 E27 x -17f0762ac05654_1000000000000000000000000000000000000000001& E132 convertToDouble -8146122716299E27 } 0xc837f0762ac05655 test expr-28.949 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +7083302403148 E26 x 10a71b8948faac_100000000000000000000000000000000000000001& E129 convertToDouble +7083302403148E26 } 0x4800a71b8948faad test expr-28.950 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -3541651201574 E26 x -10a71b8948faac_100000000000000000000000000000000000000001& E128 convertToDouble -3541651201574E26 } 0xc7f0a71b8948faad test expr-28.951 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8394920649291 E-25 x 1d8978e8c1cc78_100000000000000000000000000000000000000000001& E-41 convertToDouble +8394920649291E-25 } 0x3d6d8978e8c1cc79 test expr-28.952 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -7657975756753 E-22 x -1a5006d695fef0_1000000000000000000000000000000000000000000001& E-31 convertToDouble -7657975756753E-22 } 0xbe0a5006d695fef1 test expr-28.953 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5473834002228 E-20 x 1d632e1f745624_100000000000000000000000000000000000000000001& E-25 convertToDouble +5473834002228E-20 } 0x3e6d632e1f745625 test expr-28.954 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -6842292502785 E-21 x -1d632e1f745624_100000000000000000000000000000000000000000001& E-28 convertToDouble -6842292502785E-21 } 0xbe3d632e1f745625 test expr-28.955 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2109568884597 E25 x -1fbdc386609b13_011111111111111111111111111111111111111110& E123 convertToDouble -2109568884597E25 } 0xc7afbdc386609b13 test expr-28.956 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +8438275538388 E25 x 1fbdc386609b13_011111111111111111111111111111111111111110& E125 convertToDouble +8438275538388E25 } 0x47cfbdc386609b13 test expr-28.957 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -4219137769194 E25 x -1fbdc386609b13_011111111111111111111111111111111111111110& E124 convertToDouble -4219137769194E25 } 0xc7bfbdc386609b13 test expr-28.958 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +3200141789841 E-25 x 1684dcea3829f7_0111111111111111111111111111111111111111110& E-42 convertToDouble +3200141789841E-25 } 0x3d5684dcea3829f7 test expr-28.959 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8655689322607 E-22 x -1dbd9ff5dc8991_011111111111111111111111111111111111111110& E-31 convertToDouble -8655689322607E-22 } 0xbe0dbd9ff5dc8991 test expr-28.960 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6400283579682 E-25 x 1684dcea3829f7_0111111111111111111111111111111111111111110& E-41 convertToDouble +6400283579682E-25 } 0x3d6684dcea3829f7 test expr-28.961 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -8837719634493 E-21 x -12fa9676d2585b_011111111111111111111111111111111111111110& E-27 convertToDouble -8837719634493E-21 } 0xbe42fa9676d2585b test expr-28.962 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +19428217075297 E24 x 1d3b7a1d154aba_10000000000000000000000000000000000000000000001& E123 convertToDouble +19428217075297E24 } 0x47ad3b7a1d154abb test expr-28.963 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -38856434150594 E24 x -1d3b7a1d154aba_10000000000000000000000000000000000000000000001& E124 convertToDouble -38856434150594E24 } 0xc7bd3b7a1d154abb test expr-28.964 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +77712868301188 E24 x 1d3b7a1d154aba_10000000000000000000000000000000000000000000001& E125 convertToDouble +77712868301188E24 } 0x47cd3b7a1d154abb test expr-28.965 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -77192037242133 E27 x -1c5b1ab32d5dbe_1000000000000000000000000000000000000000000000001& E135 convertToDouble -77192037242133E27 } 0xc86c5b1ab32d5dbf test expr-28.966 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +76579757567530 E-23 x 1a5006d695fef0_1000000000000000000000000000000000000000000001& E-31 convertToDouble +76579757567530E-23 } 0x3e0a5006d695fef1 test expr-28.967 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +15315951513506 E-22 x 1a5006d695fef0_1000000000000000000000000000000000000000000001& E-30 convertToDouble +15315951513506E-22 } 0x3e1a5006d695fef1 test expr-28.968 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -38289878783765 E-23 x -1a5006d695fef0_1000000000000000000000000000000000000000000001& E-32 convertToDouble -38289878783765E-23 } 0xbdfa5006d695fef1 test expr-28.969 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +49378033925202 E25 x 1737aa2567167b_0111111111111111111111111111111111111111111110& E128 convertToDouble +49378033925202E25 } 0x47f737aa2567167b test expr-28.970 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -50940527102367 E24 x -132964f2944b05_0111111111111111111111111111111111111111111111110& E125 convertToDouble -50940527102367E24 } 0xc7c32964f2944b05 test expr-28.971 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +98756067850404 E25 x 1737aa2567167b_0111111111111111111111111111111111111111111110& E129 convertToDouble +98756067850404E25 } 0x480737aa2567167b test expr-28.972 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -99589397544892 E26 x -1d4446075c4933_0111111111111111111111111111111111111111111110& E132 convertToDouble -99589397544892E26 } 0xc83d4446075c4933 test expr-28.973 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -56908598265713 E-25 x -190756ab1ed6b3_011111111111111111111111111111111111111111111110& E-38 convertToDouble -56908598265713E-25 } 0xbd990756ab1ed6b3 test expr-28.974 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +97470695699657 E-22 x 14ee821710e655_01111111111111111111111111111111111111111111110& E-27 convertToDouble +97470695699657E-22 } 0x3e44ee821710e655 test expr-28.975 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -35851901247343 E-25 x -1f8921657e1581_0111111111111111111111111111111111111111111110& E-39 convertToDouble -35851901247343E-25 } 0xbd8f8921657e1581 test expr-28.976 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +154384074484266 E27 x 1c5b1ab32d5dbe_1000000000000000000000000000000000000000000000001& E136 convertToDouble +154384074484266E27 } 0x487c5b1ab32d5dbf test expr-28.977 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -308768148968532 E27 x -1c5b1ab32d5dbe_1000000000000000000000000000000000000000000000001& E137 convertToDouble -308768148968532E27 } 0xc88c5b1ab32d5dbf test expr-28.978 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +910990389005985 E23 x 112242592ae54a_100000000000000000000000000000000000000000000001& E126 convertToDouble +910990389005985E23 } 0x47d12242592ae54b test expr-28.979 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +271742424169201 E-27 x 131f46bcf7b452_10000000000000000000000000000000000000000000000001& E-42 convertToDouble +271742424169201E-27 } 0x3d531f46bcf7b453 test expr-28.980 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -543484848338402 E-27 x -131f46bcf7b452_10000000000000000000000000000000000000000000000001& E-41 convertToDouble -543484848338402E-27 } 0xbd631f46bcf7b453 test expr-28.981 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +162192083357563 E-26 x 1c887b68658760_1000000000000000000000000000000000000000000000001& E-40 convertToDouble +162192083357563E-26 } 0x3d7c887b68658761 test expr-28.982 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -869254552770081 E-23 x -12aac70665485e_1000000000000000000000000000000000000000000000000001& E-27 convertToDouble -869254552770081E-23 } 0xbe42aac70665485f test expr-28.983 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +664831007626046 E24 x 1f429cb67eb075_011111111111111111111111111111111111111111111111110& E128 convertToDouble +664831007626046E24 } 0x47ff429cb67eb075 test expr-28.984 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -332415503813023 E24 x -1f429cb67eb075_011111111111111111111111111111111111111111111111110& E127 convertToDouble -332415503813023E24 } 0xc7ef429cb67eb075 test expr-28.985 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +943701829041427 E24 x 162fb2e38ee461_01111111111111111111111111111111111111111111111110& E129 convertToDouble +943701829041427E24 } 0x48062fb2e38ee461 test expr-28.986 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -101881054204734 E24 x -132964f2944b05_0111111111111111111111111111111111111111111111110& E126 convertToDouble -101881054204734E24 } 0xc7d32964f2944b05 test expr-28.987 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +828027839666967 E-27 x 1d2236349da3cd_011111111111111111111111111111111111111111111111110& E-41 convertToDouble +828027839666967E-27 } 0x3d6d2236349da3cd test expr-28.988 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -280276135608777 E-27 x -13b901892fd0bf_0111111111111111111111111111111111111111111111110& E-42 convertToDouble -280276135608777E-27 } 0xbd53b901892fd0bf test expr-28.989 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +212839188833879 E-21 x 1c91194dc2d40b_0111111111111111111111111111111111111111111111110& E-23 convertToDouble +212839188833879E-21 } 0x3e8c91194dc2d40b test expr-28.990 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -113817196531426 E-25 x -190756ab1ed6b3_011111111111111111111111111111111111111111111110& E-37 convertToDouble -113817196531426E-25 } 0xbda90756ab1ed6b3 test expr-28.991 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +9711553197796883 E27 x 1bdeec25c0f03e_10000000000000000000000000000000000000000000000000001& E142 convertToDouble +9711553197796883E27 } 0x48dbdeec25c0f03f test expr-28.992 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2739849386524269 E26 x -19295ade212370_1000000000000000000000000000000000000000000000000001& E137 convertToDouble -2739849386524269E26 } 0xc889295ade212371 test expr-28.993 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +5479698773048538 E26 x 19295ade212370_1000000000000000000000000000000000000000000000000001& E138 convertToDouble +5479698773048538E26 } 0x4899295ade212371 test expr-28.994 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6124568318523113 E-25 x 150b3a2e0aff14_1000000000000000000000000000000000000000000000000000001& E-31 convertToDouble +6124568318523113E-25 } 0x3e050b3a2e0aff15 test expr-28.995 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1139777988171071 E-24 x -1394cbee428ea4_10000000000000000000000000000000000000000000000000001& E-30 convertToDouble -1139777988171071E-24 } 0xbe1394cbee428ea5 test expr-28.996 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +6322612303128019 E-27 x 1bcea0ec21e250_1000000000000000000000000000000000000000000000000000001& E-38 convertToDouble +6322612303128019E-27 } 0x3d9bcea0ec21e251 test expr-28.997 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2955864564844617 E-25 x -1450030e26c6dc_10000000000000000000000000000000000000000000000000001& E-32 convertToDouble -2955864564844617E-25 } 0xbdf450030e26c6dd test expr-28.998 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -9994029144998961 E25 x -125b2b7fed4a61_0111111111111111111111111111111111111111111111111110& E136 convertToDouble -9994029144998961E25 } 0xc8725b2b7fed4a61 test expr-28.999 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -2971238324022087 E27 x -110dd7a301db67_0111111111111111111111111111111111111111111111111110& E141 convertToDouble -2971238324022087E27 } 0xc8c10dd7a301db67 test expr-28.1000 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1656055679333934 E-27 x -1d2236349da3cd_011111111111111111111111111111111111111111111111110& E-40 convertToDouble -1656055679333934E-27 } 0xbd7d2236349da3cd test expr-28.1001 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -1445488709150234 E-26 x -1fc960c59526c7_0111111111111111111111111111111111111111111111110& E-37 convertToDouble -1445488709150234E-26 } 0xbdafc960c59526c7 test expr-28.1002 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +55824717499885172 E27 x 1406b0cd17fd56_1000000000000000000000000000000000000000000000000000000001& E145 convertToDouble +55824717499885172E27 } 0x490406b0cd17fd57 test expr-28.1003 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -69780896874856465 E26 x -1406b0cd17fd56_1000000000000000000000000000000000000000000000000000000001& E142 convertToDouble -69780896874856465E26 } 0xc8d406b0cd17fd57 test expr-28.1004 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +84161538867545199 E25 x 13529217bdce6c_10000000000000000000000000000000000000000000000000000000001& E139 convertToDouble +84161538867545199E25 } 0x48a3529217bdce6d test expr-28.1005 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -27912358749942586 E27 x -1406b0cd17fd56_1000000000000000000000000000000000000000000000000000000001& E144 convertToDouble -27912358749942586E27 } 0xc8f406b0cd17fd57 test expr-28.1006 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +24711112462926331 E-25 x 153a07f6040d22_100000000000000000000000000000000000000000000000000000001& E-29 convertToDouble +24711112462926331E-25 } 0x3e253a07f6040d23 test expr-28.1007 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -12645224606256038 E-27 x -1bcea0ec21e250_1000000000000000000000000000000000000000000000000000001& E-37 convertToDouble -12645224606256038E-27 } 0xbdabcea0ec21e251 test expr-28.1008 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -12249136637046226 E-25 x -150b3a2e0aff14_1000000000000000000000000000000000000000000000000000001& E-30 convertToDouble -12249136637046226E-25 } 0xbe150b3a2e0aff15 test expr-28.1009 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +74874448287465757 E27 x 1adc21d1d50b09_01111111111111111111111111111111111111111111111111111110& E145 convertToDouble +74874448287465757E27 } 0x490adc21d1d50b09 test expr-28.1010 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -35642836832753303 E24 x -1a2fac2b421f53_0111111111111111111111111111111111111111111111111111110& E134 convertToDouble -35642836832753303E24 } 0xc85a2fac2b421f53 test expr-28.1011 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -71285673665506606 E24 x -1a2fac2b421f53_0111111111111111111111111111111111111111111111111111110& E135 convertToDouble -71285673665506606E24 } 0xc86a2fac2b421f53 test expr-28.1012 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +43723334984997307 E-26 x 1e0be3f392c549_01111111111111111111111111111111111111111111111111111110& E-32 convertToDouble +43723334984997307E-26 } 0x3dfe0be3f392c549 test expr-28.1013 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN +10182419849537963 E-24 x 15ddd831ebbe53_011111111111111111111111111111111111111111111111111110& E-27 convertToDouble +10182419849537963E-24 } 0x3e45ddd831ebbe53 test expr-28.1014 {input floating-point conversion} {ieeeFloatingPoint} { # Ad2b dieee UN -93501703572661982 E-26 x -10103f97ea6e13_0111111111111111111111111111111111111111111111111110& E-30 convertToDouble -93501703572661982E-26 } 0xbe10103f97ea6e13 test expr-29.1 {smallest representible number} {ieeeFloatingPoint} { list [catch {convertToDouble 4.9406564584124654e-324} result] \ $result \ [catch {convertToDouble 2.4703282292062327e-324} result] \ $result \ [catch {convertToDouble 2.47032822920623e-324} result] \ $result } {0 0x0000000000000001 0 0x0000000000000001 0 0x0000000000000000} test expr-29.2 {smallest representible number} {ieeeFloatingPoint} { list [catch {convertToDouble -4.9406564584124654e-324} result] \ $result \ [catch {convertToDouble -2.4703282292062327e-324} result] \ $result \ [catch {convertToDouble -2.47032822920623e-324} result] \ $result } {0 0x8000000000000001 0 0x8000000000000001 0 0x8000000000000000} test expr-29.3 {silent underflow on input conversion} {ieeeFloatingPoint} { set v ? list [scan 2.47032822920623e-324 %g v] $v } {1 0.0} test expr-29.4 {silent underflow on input conversion} {ieeeFloatingPoint} { set v ? list [scan -2.47032822920623e-324 %g v] $v } {1 -0.0} test expr-30.1 {largest representible number} {ieeeFloatingPoint} { list [catch {convertToDouble 1.7976931348623155e+308} result] \ $result \ [catch {convertToDouble 1.7976931348623157e+308} result] \ $result \ [catch {convertToDouble 1.7976931348623159e+308} result] \ $result } {0 0x7feffffffffffffe 0 0x7fefffffffffffff 0 0x7ff0000000000000} test expr-30.2 {largest representible number} {ieeeFloatingPoint} { list [catch {convertToDouble -1.7976931348623155e+308} result] \ $result \ [catch {convertToDouble -1.7976931348623157e+308} result] \ $result \ [catch {convertToDouble -1.7976931348623159e+308} result] \ $result } {0 0xffeffffffffffffe 0 0xffefffffffffffff 0 0xfff0000000000000} test expr-30.3 {silent overflow on input conversion} {ieeeFloatingPoint} { set v ? list [scan 1.7976931348623159e+308 %f v] $v } {1 Inf} test expr-30.4 {silent overflow on input conversion} {ieeeFloatingPoint} { set v ? list [scan -1.7976931348623159e+308 %f v] $v } {1 -Inf} # bool() tests (TIP #182) set i 0 foreach s {yes true on} { test expr-31.$i.0 {boolean conversion} {expr bool($s)} 1 test expr-31.$i.1 {boolean conversion} {expr bool(!$s)} 0 test expr-31.$i.2 {boolean conversion} {expr bool("$s")} 1 test expr-31.$i.3 {boolean conversion} {expr bool(!"$s")} 0 set j 1 while {$j < [string length $s]-1} { test expr-31.$i.4.$j {boolean conversion} { expr bool([string range $s 0 $j]) } 1 test expr-31.$i.5.$j {boolean conversion} { expr bool("[string range $s 0 $j]") } 1 incr j } incr i } test expr-31.0.4.0 {boolean conversion} {expr bool(y)} 1 test expr-31.0.5.0 {boolean conversion} {expr bool("y")} 1 test expr-31.1.4.0 {boolean conversion} {expr bool(t)} 1 test expr-31.1.5.0 {boolean conversion} {expr bool("t")} 1 test expr-31.2.4.0 {boolean conversion} -body { expr bool(o) } -returnCodes error -match glob -result * test expr-31.2.5.0 {boolean conversion} -body { expr bool("o") } -returnCodes error -match glob -result * foreach s {no false off} { test expr-31.$i.0 {boolean conversion} {expr bool($s)} 0 test expr-31.$i.1 {boolean conversion} {expr bool(!$s)} 1 test expr-31.$i.2 {boolean conversion} {expr bool("$s")} 0 test expr-31.$i.3 {boolean conversion} {expr bool(!"$s")} 1 set j 1 while {$j < [string length $s]-1} { test expr-31.$i.4.$j {boolean conversion} { expr bool([string range $s 0 $j]) } 0 test expr-31.$i.5.$j {boolean conversion} { expr bool("[string range $s 0 $j]") } 0 incr j } incr i } test expr-31.3.4.0 {boolean conversion} {expr bool(n)} 0 test expr-31.3.5.0 {boolean conversion} {expr bool("n")} 0 test expr-31.4.4.0 {boolean conversion} {expr bool(f)} 0 test expr-31.4.5.0 {boolean conversion} {expr bool("f")} 0 test expr-31.6 {boolean conversion} {expr bool(-1 + 1)} 0 test expr-31.7 {boolean conversion} {expr bool(0 + 1)} 1 test expr-31.8 {boolean conversion} {expr bool(0.0)} 0 test expr-31.9 {boolean conversion} {expr bool(0x0)} 0 test expr-31.10 {boolean conversion} {expr bool(wide(0))} 0 test expr-31.11 {boolean conversion} {expr bool(5.0)} 1 test expr-31.12 {boolean conversion} {expr bool(5)} 1 test expr-31.13 {boolean conversion} {expr bool(0x5)} 1 test expr-31.14 {boolean conversion} {expr bool(wide(5))} 1 test expr-31.15 {boolean conversion} -body { expr bool("fred") } -returnCodes error -match glob -result * test expr-32.1 {expr mod basics} { set mod_nums [list \ {-3 1} {-3 2} {-3 3} {-3 4} {-3 5} \ {-3 -1} {-3 -2} {-3 -3} {-3 -4} {-3 -5} \ {-2 1} {-2 2} {-2 3} {-2 4} {-2 5} \ {-2 -1} {-2 -2} {-2 -3} {-2 -4} {-2 -5} \ {-1 1} {-1 2} {-1 3} {-1 4} {-1 5} \ {-1 -1} {-1 -2} {-1 -3} {-1 -4} {-1 -5} \ {0 -100} {0 -1} {0 1} {0 100} \ {1 1} {1 2} {1 3} {1 4} {1 5} \ {1 -1} {1 -2} {1 -3} {1 -4} {1 -5} \ {2 1} {2 2} {2 3} {2 4} {2 5} \ {2 -1} {2 -2} {2 -3} {2 -4} {2 -5} \ {3 1} {3 2} {3 3} {3 4} {3 5} \ {3 -1} {3 -2} {3 -3} {3 -4} {3 -5} \ ] set results [list] foreach pair $mod_nums { set dividend [lindex $pair 0] set divisor [lindex $pair 1] lappend results [expr {$dividend % $divisor}] } set results } [list \ 0 1 0 1 2 \ 0 -1 0 -3 -3 \ 0 0 1 2 3 \ 0 0 -2 -2 -2 \ 0 1 2 3 4 \ 0 -1 -1 -1 -1 \ 0 0 0 0 \ 0 1 1 1 1 \ 0 -1 -2 -3 -4 \ 0 0 2 2 2 \ 0 0 -1 -2 -3 \ 0 1 0 3 3 \ 0 -1 0 -1 -2 \ ] test expr-32.2 {expr div basics} { set mod_nums [list \ {-3 1} {-3 2} {-3 3} {-3 4} {-3 5} \ {-3 -1} {-3 -2} {-3 -3} {-3 -4} {-3 -5} \ {-2 1} {-2 2} {-2 3} {-2 4} {-2 5} \ {-2 -1} {-2 -2} {-2 -3} {-2 -4} {-2 -5} \ {-1 1} {-1 2} {-1 3} {-1 4} {-1 5} \ {-1 -1} {-1 -2} {-1 -3} {-1 -4} {-1 -5} \ {0 -100} {0 -1} {0 1} {0 100} \ {1 1} {1 2} {1 3} {1 4} {1 5} \ {1 -1} {1 -2} {1 -3} {1 -4} {1 -5} \ {2 1} {2 2} {2 3} {2 4} {2 5} \ {2 -1} {2 -2} {2 -3} {2 -4} {2 -5} \ {3 1} {3 2} {3 3} {3 4} {3 5} \ {3 -1} {3 -2} {3 -3} {3 -4} {3 -5} \ ] set results [list] foreach pair $mod_nums { set dividend [lindex $pair 0] set divisor [lindex $pair 1] lappend results [expr {$dividend / $divisor}] } set results } [list \ -3 -2 -1 -1 -1 \ 3 1 1 0 0 \ -2 -1 -1 -1 -1 \ 2 1 0 0 0 \ -1 -1 -1 -1 -1 \ 1 0 0 0 0 \ 0 0 0 0 \ 1 0 0 0 0 \ -1 -1 -1 -1 -1 \ 2 1 0 0 0 \ -2 -1 -1 -1 -1 \ 3 1 1 0 0 \ -3 -2 -1 -1 -1 \ ] test expr-32.3 {Bug 1585704} { expr 1%(1<<63) } 1 test expr-32.4 {Bug 1585704} { expr -1%(1<<63) } [expr (1<<63)-1] test expr-32.5 {Bug 1585704} { expr (1<<32)%(1<<63) } [expr 1<<32] test expr-32.6 {Bug 1585704} { expr -(1<<32)%(1<<63) } [expr (1<<63)-(1<<32)] test expr-32.7 {bignum regression} { expr {0%(1<<63)} } 0 test expr-32.8 {bignum regression} { expr {0%-(1<<63)} } 0 test expr-32.9 {bignum regression} { expr {0%-(1+(1<<63))} } 0 test expr-33.1 {parse largest long value} { set max_long_str 2147483647 set max_long_hex "0x7FFFFFFF " # Convert to integer (long, not wide) internal rep set max_long 2147483647 string is integer $max_long list \ [expr {" $max_long_str "}] \ [expr {$max_long_str + 0}] \ [expr {$max_long + 0}] \ [expr {2147483647 + 0}] \ [expr {$max_long == $max_long_hex}] \ [expr {int(2147483647 + 1) > 0}] \ } {2147483647 2147483647 2147483647 2147483647 1 1} test expr-33.2 {parse smallest long value} { set min_long_str -2147483648 set min_long_hex "-0x80000000 " set min_long -2147483648 # This will convert to integer (not wide) internal rep string is integer $min_long # Note: If the final expression returns 0 then the # expression literal is being promoted to a wide type # when it should be parsed as a long type. list \ [expr {" $min_long_str "}] \ [expr {$min_long_str + 0}] \ [expr {$min_long + 0}] \ [expr {-2147483648 + 0}] \ [expr {$min_long == $min_long_hex}] \ [expr {int(-2147483648 - 1) == -0x80000001}] \ } {-2147483648 -2147483648 -2147483648 -2147483648 1 1} test expr-33.3 {parse largest wide value} wideIs64bit { set max_wide_str 9223372036854775807 set max_wide_hex "0x7FFFFFFFFFFFFFFF " # Convert to wide integer set max_wide 9223372036854775807 string is integer $max_wide list \ [expr {" $max_wide_str "}] \ [expr {$max_wide_str + 0}] \ [expr {$max_wide + 0}] \ [expr {9223372036854775807 + 0}] \ [expr {$max_wide == $max_wide_hex}] \ [expr {wide(9223372036854775807 + 1) < 0}] \ } {9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 1 1} test expr-33.4 {parse smallest wide value} wideIs64bit { set min_wide_str -9223372036854775808 set min_wide_hex "-0x8000000000000000 " set min_wide -9223372036854775808 # Convert to wide integer string is integer $min_wide # Note: If the final expression returns 0 then the # wide integer is not being parsed correctly with # the leading - sign. list \ [expr {" $min_wide_str "}] \ [expr {$min_wide_str + 0}] \ [expr {$min_wide + 0}] \ [expr {-9223372036854775808 + 0}] \ [expr {$min_wide == $min_wide_hex}] \ [expr {wide(-9223372036854775808 - 1) == 0x7FFFFFFFFFFFFFFF}] \ } {-9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 1 1} set min -2147483648 set max 2147483647 test expr-34.1 {expr edge cases} { expr {$min / $min} } {1} test expr-34.2 {expr edge cases} { expr {$min % $min} } {0} test expr-34.3 {expr edge cases} { expr {$min / ($min + 1)} } {1} test expr-34.4 {expr edge cases} { expr {$min % ($min + 1)} } {-1} test expr-34.5 {expr edge cases} { expr {$min / ($min + 2)} } {1} test expr-34.6 {expr edge cases} { expr {$min % ($min + 2)} } {-2} test expr-34.7 {expr edge cases} { expr {$min / ($min + 3)} } {1} test expr-34.8 {expr edge cases} { expr {$min % ($min + 3)} } {-3} test expr-34.9 {expr edge cases} { expr {$min / -3} } {715827882} test expr-34.10 {expr edge cases} { expr {$min % -3} } {-2} test expr-34.11 {expr edge cases} { expr {$min / -2} } {1073741824} test expr-34.12 {expr edge cases} { expr {$min % -2} } {0} test expr-34.13 {expr edge cases} { expr {int($min / -1)} } {2147483648} test expr-34.14 {expr edge cases} { expr {$min % -1} } {0} test expr-34.15 {expr edge cases} { expr {-int($min * -1)} } $min test expr-34.16 {expr edge cases} { expr {-int(-$min)} } $min test expr-34.17 {expr edge cases} { expr {$min / 1} } $min test expr-34.18 {expr edge cases} { expr {$min % 1} } {0} test expr-34.19 {expr edge cases} { expr {$min / 2} } {-1073741824} test expr-34.20 {expr edge cases} { expr {$min % 2} } {0} test expr-34.21 {expr edge cases} { expr {$min / 3} } {-715827883} test expr-34.22 {expr edge cases} { expr {$min % 3} } {1} test expr-34.23 {expr edge cases} { expr {$min / ($max - 3)} } {-2} test expr-34.24 {expr edge cases} { expr {$min % ($max - 3)} } {2147483640} test expr-34.25 {expr edge cases} { expr {$min / ($max - 2)} } {-2} test expr-34.26 {expr edge cases} { expr {$min % ($max - 2)} } {2147483642} test expr-34.27 {expr edge cases} { expr {$min / ($max - 1)} } {-2} test expr-34.28 {expr edge cases} { expr {$min % ($max - 1)} } {2147483644} test expr-34.29 {expr edge cases} { expr {$min / $max} } {-2} test expr-34.30 {expr edge cases} { expr {$min % $max} } {2147483646} test expr-34.31 {expr edge cases} { expr {$max / $max} } {1} test expr-34.32 {expr edge cases} { expr {$max % $max} } {0} test expr-34.33 {expr edge cases} { expr {$max / ($max - 1)} } {1} test expr-34.34 {expr edge cases} { expr {$max % ($max - 1)} } {1} test expr-34.35 {expr edge cases} { expr {$max / ($max - 2)} } {1} test expr-34.36 {expr edge cases} { expr {$max % ($max - 2)} } {2} test expr-34.37 {expr edge cases} { expr {$max / ($max - 3)} } {1} test expr-34.38 {expr edge cases} { expr {$max % ($max - 3)} } {3} test expr-34.39 {expr edge cases} { expr {$max / 3} } {715827882} test expr-34.40 {expr edge cases} { expr {$max % 3} } {1} test expr-34.41 {expr edge cases} { expr {$max / 2} } {1073741823} test expr-34.42 {expr edge cases} { expr {$max % 2} } {1} test expr-34.43 {expr edge cases} { expr {$max / 1} } $max test expr-34.44 {expr edge cases} { expr {$max % 1} } {0} test expr-34.45 {expr edge cases} { expr {$max / -1} } "-$max" test expr-34.46 {expr edge cases} { expr {$max % -1} } {0} test expr-34.47 {expr edge cases} { expr {$max / -2} } {-1073741824} test expr-34.48 {expr edge cases} { expr {$max % -2} } {-1} test expr-34.49 {expr edge cases} { expr {$max / -3} } {-715827883} test expr-34.50 {expr edge cases} { expr {$max % -3} } {-2} test expr-34.51 {expr edge cases} { expr {$max / ($min + 3)} } {-2} test expr-34.52 {expr edge cases} { expr {$max % ($min + 3)} } {-2147483643} test expr-34.53 {expr edge cases} { expr {$max / ($min + 2)} } {-2} test expr-34.54 {expr edge cases} { expr {$max % ($min + 2)} } {-2147483645} test expr-34.55 {expr edge cases} { expr {$max / ($min + 1)} } {-1} test expr-34.56 {expr edge cases} { expr {$max % ($min + 1)} } {0} test expr-34.57 {expr edge cases} { expr {$max / $min} } {-1} test expr-34.58 {expr edge cases} { expr {$max % $min} } {-1} test expr-34.59 {expr edge cases} { expr {($min + 1) / ($max - 1)} } {-2} test expr-34.60 {expr edge cases} { expr {($min + 1) % ($max - 1)} } {2147483645} test expr-34.61 {expr edge cases} { expr {($max - 1) / ($min + 1)} } {-1} test expr-34.62 {expr edge cases} { expr {($max - 1) % ($min + 1)} } {-1} test expr-34.63 {expr edge cases} { expr {($max - 1) / $min} } {-1} test expr-34.64 {expr edge cases} { expr {($max - 1) % $min} } {-2} test expr-34.65 {expr edge cases} { expr {($max - 2) / $min} } {-1} test expr-34.66 {expr edge cases} { expr {($max - 2) % $min} } {-3} test expr-34.67 {expr edge cases} { expr {($max - 3) / $min} } {-1} test expr-34.68 {expr edge cases} { expr {($max - 3) % $min} } {-4} test expr-34.69 {expr edge cases} { expr {-3 / $min} } {0} test expr-34.70 {expr edge cases} { expr {-3 % $min} } {-3} test expr-34.71 {expr edge cases} { expr {-2 / $min} } {0} test expr-34.72 {expr edge cases} { expr {-2 % $min} } {-2} test expr-34.73 {expr edge cases} { expr {-1 / $min} } {0} test expr-34.74 {expr edge cases} { expr {-1 % $min} } {-1} test expr-34.75 {expr edge cases} { expr {0 / $min} } {0} test expr-34.76 {expr edge cases} { expr {0 % $min} } {0} test expr-34.77 {expr edge cases} { expr {0 / ($min + 1)} } {0} test expr-34.78 {expr edge cases} { expr {0 % ($min + 1)} } {0} test expr-34.79 {expr edge cases} { expr {1 / $min} } {-1} test expr-34.80 {expr edge cases} { expr {1 % $min} } {-2147483647} test expr-34.81 {expr edge cases} { expr {1 / ($min + 1)} } {-1} test expr-34.82 {expr edge cases} { expr {1 % ($min + 1)} } {-2147483646} test expr-34.83 {expr edge cases} { expr {2 / $min} } {-1} test expr-34.84 {expr edge cases} { expr {2 % $min} } {-2147483646} test expr-34.85 {expr edge cases} { expr {2 / ($min + 1)} } {-1} test expr-34.86 {expr edge cases} { expr {2 % ($min + 1)} } {-2147483645} test expr-34.87 {expr edge cases} { expr {3 / $min} } {-1} test expr-34.88 {expr edge cases} { expr {3 % $min} } {-2147483645} test expr-34.89 {expr edge cases} { expr {3 / ($min + 1)} } {-1} test expr-34.90 {expr edge cases} { expr {3 % ($min + 1)} } {-2147483644} # Euclidean property: # quotient * divisor + remainder = dividend test expr-35.1 {expr edge cases} { set dividend $max set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($divisor * $q) + $r}] } {1073741823 * 2 + 1 = 2147483647} test expr-35.2 {expr edge cases} { set dividend [expr {$max - 1}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1073741823 * 2 + 0 = 2147483646} test expr-35.3 {expr edge cases} { set dividend [expr {$max - 2}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1073741822 * 2 + 1 = 2147483645} test expr-35.4 {expr edge cases} { set dividend $max set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {715827882 * 3 + 1 = 2147483647} test expr-35.5 {expr edge cases} { set dividend [expr {$max - 1}] set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {715827882 * 3 + 0 = 2147483646} test expr-35.6 {expr edge cases} { set dividend [expr {$max - 2}] set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {715827881 * 3 + 2 = 2147483645} test expr-35.7 {expr edge cases} { set dividend $min set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-1073741824 * 2 + 0 = -2147483648} test expr-35.8 {expr edge cases} { set dividend [expr {$min + 1}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-1073741824 * 2 + 1 = -2147483647} test expr-35.9 {expr edge cases} { set dividend [expr {$min + 2}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-1073741823 * 2 + 0 = -2147483646} test expr-35.10 {expr edge cases} { # Two things could happen here. The multiplication # could overflow a 32 bit type, so that when # 1 is added it overflows again back to min. # The multiplication could also use a wide type # to hold ($min - 1) until 1 is added and # the number becomes $min again. set dividend $min set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-715827883 * 3 + 1 = -2147483648} test expr-35.11 {expr edge cases} { set dividend $min set divisor -3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {715827882 * -3 + -2 = -2147483648} test expr-35.12 {expr edge cases} { set dividend $min set divisor $min set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -2147483648 + 0 = -2147483648} test expr-35.13 {expr edge cases} { set dividend $min set divisor [expr {$min + 1}] set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -2147483647 + -1 = -2147483648} test expr-35.14 {expr edge cases} { set dividend $min set divisor [expr {$min + 2}] set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -2147483646 + -2 = -2147483648} # 64bit wide integer checks set min -9223372036854775808 set max 9223372036854775807 test expr-36.1 {expr edge cases} {wideIs64bit} { expr {$min / $min} } {1} test expr-36.2 {expr edge cases} {wideIs64bit} { expr {$min % $min} } {0} test expr-36.3 {expr edge cases} {wideIs64bit} { expr {$min / ($min + 1)} } {1} test expr-36.4 {expr edge cases} {wideIs64bit} { expr {$min % ($min + 1)} } {-1} test expr-36.5 {expr edge cases} {wideIs64bit} { expr {$min / ($min + 2)} } {1} test expr-36.6 {expr edge cases} {wideIs64bit} { expr {$min % ($min + 2)} } {-2} test expr-36.7 {expr edge cases} {wideIs64bit} { expr {$min / ($min + 3)} } {1} test expr-36.8 {expr edge cases} {wideIs64bit} { expr {$min % ($min + 3)} } {-3} test expr-36.9 {expr edge cases} {wideIs64bit} { expr {$min / -3} } {3074457345618258602} test expr-36.10 {expr edge cases} {wideIs64bit} { expr {$min % -3} } {-2} test expr-36.11 {expr edge cases} {wideIs64bit} { expr {$min / -2} } {4611686018427387904} test expr-36.12 {expr edge cases} {wideIs64bit} { expr {$min % -2} } {0} test expr-36.13 {expr edge cases} wideIs64bit { expr {wide($min / -1)} } $min test expr-36.14 {expr edge cases} {wideIs64bit} { expr {$min % -1} } {0} test expr-36.15 {expr edge cases} wideIs64bit { expr {wide($min * -1)} } $min test expr-36.16 {expr edge cases} wideIs64bit { expr {wide(-$min)} } $min test expr-36.17 {expr edge cases} {wideIs64bit} { expr {$min / 1} } $min test expr-36.18 {expr edge cases} {wideIs64bit} { expr {$min % 1} } {0} test expr-36.19 {expr edge cases} {wideIs64bit} { expr {$min / 2} } {-4611686018427387904} test expr-36.20 {expr edge cases} {wideIs64bit} { expr {$min % 2} } {0} test expr-36.21 {expr edge cases} {wideIs64bit} { expr {$min / 3} } {-3074457345618258603} test expr-36.22 {expr edge cases} {wideIs64bit} { expr {$min % 3} } {1} test expr-36.23 {expr edge cases} {wideIs64bit} { expr {$min / ($max - 3)} } {-2} test expr-36.24 {expr edge cases} {wideIs64bit} { expr {$min % ($max - 3)} } {9223372036854775800} test expr-36.25 {expr edge cases} {wideIs64bit} { expr {$min / ($max - 2)} } {-2} test expr-36.26 {expr edge cases} {wideIs64bit} { expr {$min % ($max - 2)} } {9223372036854775802} test expr-36.27 {expr edge cases} {wideIs64bit} { expr {$min / ($max - 1)} } {-2} test expr-36.28 {expr edge cases} {wideIs64bit} { expr {$min % ($max - 1)} } {9223372036854775804} test expr-36.29 {expr edge cases} {wideIs64bit} { expr {$min / $max} } {-2} test expr-36.30 {expr edge cases} {wideIs64bit} { expr {$min % $max} } {9223372036854775806} test expr-36.31 {expr edge cases} {wideIs64bit} { expr {$max / $max} } {1} test expr-36.32 {expr edge cases} {wideIs64bit} { expr {$max % $max} } {0} test expr-36.33 {expr edge cases} {wideIs64bit} { expr {$max / ($max - 1)} } {1} test expr-36.34 {expr edge cases} {wideIs64bit} { expr {$max % ($max - 1)} } {1} test expr-36.35 {expr edge cases} {wideIs64bit} { expr {$max / ($max - 2)} } {1} test expr-36.36 {expr edge cases} {wideIs64bit} { expr {$max % ($max - 2)} } {2} test expr-36.37 {expr edge cases} {wideIs64bit} { expr {$max / ($max - 3)} } {1} test expr-36.38 {expr edge cases} {wideIs64bit} { expr {$max % ($max - 3)} } {3} test expr-36.39 {expr edge cases} {wideIs64bit} { expr {$max / 3} } {3074457345618258602} test expr-36.40 {expr edge cases} {wideIs64bit} { expr {$max % 3} } {1} test expr-36.41 {expr edge cases} {wideIs64bit} { expr {$max / 2} } {4611686018427387903} test expr-36.42 {expr edge cases} {wideIs64bit} { expr {$max % 2} } {1} test expr-36.43 {expr edge cases} {wideIs64bit} { expr {$max / 1} } $max test expr-36.44 {expr edge cases} {wideIs64bit} { expr {$max % 1} } {0} test expr-36.45 {expr edge cases} {wideIs64bit} { expr {$max / -1} } "-$max" test expr-36.46 {expr edge cases} {wideIs64bit} { expr {$max % -1} } {0} test expr-36.47 {expr edge cases} {wideIs64bit} { expr {$max / -2} } {-4611686018427387904} test expr-36.48 {expr edge cases} {wideIs64bit} { expr {$max % -2} } {-1} test expr-36.49 {expr edge cases} {wideIs64bit} { expr {$max / -3} } {-3074457345618258603} test expr-36.50 {expr edge cases} {wideIs64bit} { expr {$max % -3} } {-2} test expr-36.51 {expr edge cases} {wideIs64bit} { expr {$max / ($min + 3)} } {-2} test expr-36.52 {expr edge cases} {wideIs64bit} { expr {$max % ($min + 3)} } {-9223372036854775803} test expr-36.53 {expr edge cases} {wideIs64bit} { expr {$max / ($min + 2)} } {-2} test expr-36.54 {expr edge cases} {wideIs64bit} { expr {$max % ($min + 2)} } {-9223372036854775805} test expr-36.55 {expr edge cases} {wideIs64bit} { expr {$max / ($min + 1)} } {-1} test expr-36.56 {expr edge cases} {wideIs64bit} { expr {$max % ($min + 1)} } {0} test expr-36.57 {expr edge cases} {wideIs64bit} { expr {$max / $min} } {-1} test expr-36.58 {expr edge cases} {wideIs64bit} { expr {$max % $min} } {-1} test expr-36.59 {expr edge cases} {wideIs64bit} { expr {($min + 1) / ($max - 1)} } {-2} test expr-36.60 {expr edge cases} {wideIs64bit} { expr {($min + 1) % ($max - 1)} } {9223372036854775805} test expr-36.61 {expr edge cases} {wideIs64bit} { expr {($max - 1) / ($min + 1)} } {-1} test expr-36.62 {expr edge cases} {wideIs64bit} { expr {($max - 1) % ($min + 1)} } {-1} test expr-36.63 {expr edge cases} {wideIs64bit} { expr {($max - 1) / $min} } {-1} test expr-36.64 {expr edge cases} {wideIs64bit} { expr {($max - 1) % $min} } {-2} test expr-36.65 {expr edge cases} {wideIs64bit} { expr {($max - 2) / $min} } {-1} test expr-36.66 {expr edge cases} {wideIs64bit} { expr {($max - 2) % $min} } {-3} test expr-36.67 {expr edge cases} {wideIs64bit} { expr {($max - 3) / $min} } {-1} test expr-36.68 {expr edge cases} {wideIs64bit} { expr {($max - 3) % $min} } {-4} test expr-36.69 {expr edge cases} {wideIs64bit} { expr {-3 / $min} } {0} test expr-36.70 {expr edge cases} {wideIs64bit} { expr {-3 % $min} } {-3} test expr-36.71 {expr edge cases} {wideIs64bit} { expr {-2 / $min} } {0} test expr-36.72 {expr edge cases} {wideIs64bit} { expr {-2 % $min} } {-2} test expr-36.73 {expr edge cases} {wideIs64bit} { expr {-1 / $min} } {0} test expr-36.74 {expr edge cases} {wideIs64bit} { expr {-1 % $min} } {-1} test expr-36.75 {expr edge cases} {wideIs64bit} { expr {0 / $min} } {0} test expr-36.76 {expr edge cases} {wideIs64bit} { expr {0 % $min} } {0} test expr-36.77 {expr edge cases} {wideIs64bit} { expr {0 / ($min + 1)} } {0} test expr-36.78 {expr edge cases} {wideIs64bit} { expr {0 % ($min + 1)} } {0} test expr-36.79 {expr edge cases} {wideIs64bit} { expr {1 / $min} } {-1} test expr-36.80 {expr edge cases} {wideIs64bit} { expr {1 % $min} } {-9223372036854775807} test expr-36.81 {expr edge cases} {wideIs64bit} { expr {1 / ($min + 1)} } {-1} test expr-36.82 {expr edge cases} {wideIs64bit} { expr {1 % ($min + 1)} } {-9223372036854775806} test expr-36.83 {expr edge cases} {wideIs64bit} { expr {2 / $min} } {-1} test expr-36.84 {expr edge cases} {wideIs64bit} { expr {2 % $min} } {-9223372036854775806} test expr-36.85 {expr edge cases} {wideIs64bit} { expr {2 / ($min + 1)} } {-1} test expr-36.86 {expr edge cases} {wideIs64bit} { expr {2 % ($min + 1)} } {-9223372036854775805} test expr-36.87 {expr edge cases} {wideIs64bit} { expr {3 / $min} } {-1} test expr-36.88 {expr edge cases} {wideIs64bit} { expr {3 % $min} } {-9223372036854775805} test expr-36.89 {expr edge cases} {wideIs64bit} { expr {3 / ($min + 1)} } {-1} test expr-36.90 {expr edge cases} {wideIs64bit} { expr {3 % ($min + 1)} } {-9223372036854775804} test expr-37.1 {expr edge cases} {wideIs64bit} { set dividend $max set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($divisor * $q) + $r}] } {4611686018427387903 * 2 + 1 = 9223372036854775807} test expr-37.2 {expr edge cases} {wideIs64bit} { set dividend [expr {$max - 1}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {4611686018427387903 * 2 + 0 = 9223372036854775806} test expr-37.3 {expr edge cases} {wideIs64bit} { set dividend [expr {$max - 2}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {4611686018427387902 * 2 + 1 = 9223372036854775805} test expr-37.4 {expr edge cases} {wideIs64bit} { set dividend $max set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {3074457345618258602 * 3 + 1 = 9223372036854775807} test expr-37.5 {expr edge cases} {wideIs64bit} { set dividend [expr {$max - 1}] set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {3074457345618258602 * 3 + 0 = 9223372036854775806} test expr-37.6 {expr edge cases} {wideIs64bit} { set dividend [expr {$max - 2}] set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {3074457345618258601 * 3 + 2 = 9223372036854775805} test expr-37.7 {expr edge cases} {wideIs64bit} { set dividend $min set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-4611686018427387904 * 2 + 0 = -9223372036854775808} test expr-37.8 {expr edge cases} {wideIs64bit} { set dividend [expr {$min + 1}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-4611686018427387904 * 2 + 1 = -9223372036854775807} test expr-37.9 {expr edge cases} {wideIs64bit} { set dividend [expr {$min + 2}] set divisor 2 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-4611686018427387903 * 2 + 0 = -9223372036854775806} test expr-37.10 {expr edge cases} {wideIs64bit} { # Multiplication overflows 64 bit type here, # so when the 1 is added it overflows # again and we end up back at min. set dividend $min set divisor 3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {-3074457345618258603 * 3 + 1 = -9223372036854775808} test expr-37.11 {expr edge cases} {wideIs64bit} { set dividend $min set divisor -3 set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {3074457345618258602 * -3 + -2 = -9223372036854775808} test expr-37.12 {expr edge cases} {wideIs64bit} { set dividend $min set divisor $min set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -9223372036854775808 + 0 = -9223372036854775808} test expr-37.13 {expr edge cases} {wideIs64bit} { set dividend $min set divisor [expr {$min + 1}] set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -9223372036854775807 + -1 = -9223372036854775808} test expr-37.14 {expr edge cases} {wideIs64bit} { set dividend $min set divisor [expr {$min + 2}] set q [expr {$dividend / $divisor}] set r [expr {$dividend % $divisor}] list $q * $divisor + $r = [expr {($q * $divisor) + $r}] } {1 * -9223372036854775806 + -2 = -9223372036854775808} test expr-38.1 {abs of smallest 32-bit integer [Bug 1241572]} {wideIs64bit} { expr {abs(-2147483648)} } 2147483648 test expr-38.2 {abs and -0 [Bug 1893815]} { expr {abs(-0)} } 0 test expr-38.3 {abs and -0 [Bug 1893815]} { expr {abs(-0.0)} } 0.0 test expr-38.4 {abs and -0 [Bug 1893815]} { expr {abs(-1e-324)} } 0.0 test expr-38.5 {abs and -0 [Bug 1893815]} { ::tcl::mathfunc::abs -0 } 0 test expr-38.6 {abs and -0 [Bug 1893815]} { ::tcl::mathfunc::abs -0.0 } 0.0 test expr-38.7 {abs and -0 [Bug 1893815]} { ::tcl::mathfunc::abs -1e-324 } 0.0 test expr-38.8 {abs and 0.0 [Bug 2954959]} { ::tcl::mathfunc::abs 0.0 } 0.0 test expr-38.9 {abs and 0.0 [Bug 2954959]} { expr {abs(0.0)} } 0.0 test expr-38.10 {abs and -0x0 [Bug 2954959]} { expr {abs(-0x0)} } 0 test expr-38.11 {abs and 0x0 [Bug 2954959]} { ::tcl::mathfunc::abs { 0x0} } { 0x0} test expr-38.12 {abs and -0x0 [Bug 2954959]} { ::tcl::mathfunc::abs { -0x0} } 0 test expr-38.13 {abs and 0.0 [Bug 2954959]} { ::tcl::mathfunc::abs 1e-324 } 1e-324 test expr-38.14 {abs and INT64_MIN special-case} { ::tcl::mathfunc::abs -9223372036854775808 } 9223372036854775808 test expr-38.15 {abs and INT128_MIN special-case} { ::tcl::mathfunc::abs -170141183460469231731687303715884105728 } 170141183460469231731687303715884105728 testConstraint testexprlongobj [llength [info commands testexprlongobj]] testConstraint testexprdoubleobj [llength [info commands testexprdoubleobj]] test expr-39.1 {Check that Tcl_ExprLongObj doesn't modify interpreter result if no error} testexprlongobj { testexprlongobj 4+1 } {This is a result: 5} #Check for [Bug 1109484] test expr-39.2 {Tcl_ExprLongObj handles wide ints gracefully} testexprlongobj { testexprlongobj wide(1)+2 } {This is a result: 3} test expr-39.3 {Tcl_ExprLongObj on the empty string} \ -constraints {testexprlongobj}\ -body {testexprlongobj ""} \ -match glob \ -returnCodes error -result * test expr-39.4 {Tcl_ExprLongObj coerces doubles} testexprlongobj { testexprlongobj 3+.14159 } {This is a result: 3} test expr-39.5 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj 0x80000000 } {This is a result: -2147483648} test expr-39.6 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj 0xffffffff } {This is a result: -1} test expr-39.7 {Tcl_ExprLongObj handles overflows} \ -constraints {testexprlongobj longIs32bit} \ -match glob \ -body { list [catch {testexprlongobj 0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.8 {Tcl_ExprLongObj handles overflows} testexprlongobj { testexprlongobj -0x80000000 } {This is a result: -2147483648} test expr-39.9 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj -0x7fffffff } {This is a result: -2147483647} test expr-39.10 {Tcl_ExprLongObj handles overflows} \ -constraints {testexprlongobj longIs32bit} \ -match glob \ -body { list [catch {testexprlongobj -0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.11 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj 2147483648. } {This is a result: -2147483648} test expr-39.12 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj 4294967295. } {This is a result: -1} test expr-39.13 {Tcl_ExprLongObj handles overflows} \ -constraints {testexprlongobj longIs32bit} \ -match glob \ -body { list [catch {testexprlongobj 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.14 {Tcl_ExprLongObj handles overflows} testexprlongobj { testexprlongobj -2147483648. } {This is a result: -2147483648} test expr-39.15 {Tcl_ExprLongObj handles overflows} {testexprlongobj longIs32bit} { testexprlongobj -2147483648. } {This is a result: -2147483648} test expr-39.16 {Tcl_ExprLongObj handles overflows} \ -constraints {testexprlongobj longIs32bit} \ -match glob \ -body { list [catch {testexprlongobj 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-39.17 {Check that Tcl_ExprDoubleObj doesn't modify interpreter result if no error} testexprdoubleobj { testexprdoubleobj 4.+1. } {This is a result: 5.0} #Check for [Bug 1109484] test expr-39.18 {Tcl_ExprDoubleObj on the empty string} \ -constraints {testexprdoubleobj} \ -match glob \ -body {testexprdoubleobj ""} \ -returnCodes error -result * test expr-39.19 {Tcl_ExprDoubleObj coerces wides} testexprdoubleobj { testexprdoubleobj 1[string repeat 0 17] } {This is a result: 1e+17} test expr-39.20 {Tcl_ExprDoubleObj coerces bignums} testexprdoubleobj { testexprdoubleobj 1[string repeat 0 38] } {This is a result: 1e+38} test expr-39.21 {Tcl_ExprDoubleObj handles overflows} \ testexprdoubleobj&&ieeeFloatingPoint { testexprdoubleobj 17976931348623157[string repeat 0 292]. } {This is a result: 1.7976931348623157e+308} test expr-39.22 {Tcl_ExprDoubleObj handles overflows that look like int} \ testexprdoubleobj&&ieeeFloatingPoint { testexprdoubleobj 17976931348623157[string repeat 0 292] } {This is a result: 1.7976931348623157e+308} test expr-39.23 {Tcl_ExprDoubleObj handles overflows} \ testexprdoubleobj&&ieeeFloatingPoint { testexprdoubleobj 17976931348623165[string repeat 0 292]. } {This is a result: Inf} test expr-39.24 {Tcl_ExprDoubleObj handles overflows that look like int} \ testexprdoubleobj&&ieeeFloatingPoint { testexprdoubleobj 17976931348623165[string repeat 0 292] } {This is a result: Inf} test expr-39.25 {Tcl_ExprDoubleObj and NaN} \ {testexprdoubleobj ieeeFloatingPoint} { list [catch {testexprdoubleobj 0.0/0.0} result] $result } {1 {domain error: argument not in valid range}} test expr-40.1 {large octal shift} { expr 0o100000000000000000000000000000000 } [expr 0x1000000000000000000000000] test expr-40.2 {large octal shift} { expr 0o100000000000000000000000000000001 } [expr 0x1000000000000000000000001] test expr-41.1 {exponent overflow} { expr 1.0e2147483630 } Inf test expr-41.2 {exponent underflow} { expr 1.0e-2147483630 } 0.0 test expr-41.3 {exponent overflow} { expr 1e2147483647 } Inf test expr-41.4 {exponent overflow} { expr 1e2147483648 } Inf test expr-41.5 {exponent overflow} { expr 100e2147483645 } Inf test expr-41.6 {exponent overflow} { expr 100e2147483646 } Inf test expr-41.7 {exponent overflow} { expr 1.0e2147483647 } Inf test expr-41.8 {exponent overflow} { expr 1.0e2147483648 } Inf test expr-41.9 {exponent overflow} { expr 1.2e2147483647 } Inf test expr-41.10 {exponent overflow} { expr 1.2e2147483648 } Inf test expr-41.11 {exponent overflow} { expr 1e-2147483648 } 0.0 test expr-41.12 {exponent overflow} { expr 1e-2147483649 } 0.0 test expr-41.13 {exponent overflow} { expr 100e-2147483650 } 0.0 test expr-41.14 {exponent overflow} { expr 100e-2147483651 } 0.0 test expr-41.15 {exponent overflow} { expr 1.0e-2147483648 } 0.0 test expr-41.16 {exponent overflow} { expr 1.0e-2147483649 } 0.0 test expr-41.17 {exponent overflow} { expr 1.23e-2147483646 } 0.0 test expr-41.18 {exponent overflow} { expr 1.23e-2147483647 } 0.0 test expr-41.19 {numSigDigs == 0} { expr 0e309 } 0.0 test expr-41.20 {numSigDigs == 0} { expr 0e310 } 0.0 test expr-41.21 {negative zero, large exponent} { expr -0e309 } -0.0 test expr-41.22 {negative zero, large exponent} { expr -0e310 } -0.0 test expr-41.23 {floating point overflow on significand (Bug 1de6b0629e)} { expr 123[string repeat 0 309]1e-310 } 123.0 test expr-42.1 {denormals} ieeeFloatingPoint { expr 7e-324 } 5e-324 # TIP 114 test expr-43.1 {0b notation} { expr 0b0 } 0 test expr-43.2 {0b notation} { expr 0b1 } 1 test expr-43.3 {0b notation} { expr 0b10 } 2 test expr-43.4 {0b notation} { expr 0b11 } 3 test expr-43.5 {0b notation} { expr 0b100 } 4 test expr-43.6 {0b notation} { expr 0b101 } 5 test expr-43.7 {0b notation} { expr 0b1000 } 8 test expr-43.8 {0b notation} { expr 0b1001 } 9 test expr-43.9 {0b notation} { expr 0b1[string repeat 0 31] } 2147483648 test expr-43.10 {0b notation} { expr 0b1[string repeat 0 30]1 } 2147483649 test expr-43.11 {0b notation} { expr 0b[string repeat 1 64] } 18446744073709551615 test expr-43.12 {0b notation} { expr 0b1[string repeat 0 64] } 18446744073709551616 test expr-43.13 {0b notation} { expr 0b1[string repeat 0 63]1 } 18446744073709551617 test expr-44.1 {0o notation} { expr 0o0 } 0 test expr-44.2 {0o notation} { expr 0o1 } 1 test expr-44.3 {0o notation} { expr 0o7 } 7 test expr-44.4 {0o notation} { expr 0o10 } 8 test expr-44.5 {0o notation} { expr 0o11 } 9 test expr-44.6 {0o notation} { expr 0o100 } 64 test expr-44.7 {0o notation} { expr 0o101 } 65 test expr-44.8 {0o notation} { expr 0o1000 } 512 test expr-44.9 {0o notation} { expr 0o1001 } 513 test expr-44.10 {0o notation} { expr 0o1[string repeat 7 21] } 18446744073709551615 test expr-44.11 {0o notation} { expr 0o2[string repeat 0 21] } 18446744073709551616 test expr-44.12 {0o notation} { expr 0o2[string repeat 0 20]1 } 18446744073709551617 # TIP 237 again test expr-45.1 {entier} { expr entier(0) } 0 test expr-45.2 {entier} { expr entier(0.5) } 0 test expr-45.3 {entier} { expr entier(1.0) } 1 test expr-45.4 {entier} { expr entier(1.5) } 1 test expr-45.5 {entier} { expr entier(2.0) } 2 test expr-45.6 {entier} { expr entier(1e+22) } 10000000000000000000000 test expr-45.7 {entier} { list [catch {expr entier(Inf)} result] $result } {1 {integer value too large to represent}} test expr-45.8 {entier} ieeeFloatingPoint { list [catch {expr {entier($ieeeValues(NaN))}} result] $result } {1 {floating point value is Not a Number}} test expr-45.9 {entier} ieeeFloatingPoint { list [catch {expr {entier($ieeeValues(-NaN))}} result] $result } {1 {floating point value is Not a Number}} test expr-46.1 {round() rounds to +-infinity} { expr round(0.5) } 1 test expr-46.2 {round() rounds to +-infinity} { expr round(1.5) } 2 test expr-46.3 {round() rounds to +-infinity} { expr round(-0.5) } -1 test expr-46.4 {round() rounds to +-infinity} { expr round(-1.5) } -2 test expr-46.5 {round() overflow} { expr round(9.2233720368547758e+018) } 9223372036854775808 test expr-46.6 {round() overflow} { expr round(-9.2233720368547758e+018) } -9223372036854775808 test expr-46.7 {round() bad value} -body { set x trash expr {round($x)} } -returnCodes error -match glob -result * test expr-46.8 {round() already an integer} { set x 123456789012 incr x expr round($x) } 123456789013 test expr-46.9 {round() boundary case - 1/2 - 1 ulp} { set x 0.25 set bit 0.125 while 1 { set newx [expr {$x + $bit}] if { $newx == $x || $newx == 0.5 } break set x $newx set bit [expr { $bit / 2.0 }] } expr {round($x)} } 0 test expr-46.10 {round() boundary case - 1/2 + 1 ulp} { set x 0.75 set bit 0.125 while 1 { set newx [expr {$x - $bit}] if { $newx == $x || $newx == 0.5 } break set x $newx set bit [expr { $bit / 2.0 }] } expr {round($x)} } 1 test expr-46.11 {round() boundary case - -1/2 - 1 ulp} { set x -0.75 set bit 0.125 while 1 { set newx [expr {$x + $bit}] if { $newx == $x || $newx == -0.5 } break set x $newx set bit [expr { $bit / 2.0 }] } expr {round($x)} } -1 test expr-46.12 {round() boundary case - -1/2 + 1 ulp} { set x -0.25 set bit 0.125 while 1 { set newx [expr {$x - $bit}] if { $newx == $x || $newx == -0.5 } break set x $newx set bit [expr { $bit / 2.0 }] } expr {round($x)} } 0 test expr-46.13 {round() boundary case - round down} { expr {round(2147483647 - 0.51)} } 2147483646 test expr-46.14 {round() boundary case - round up} { expr {round(2147483647 - 0.50)} } 2147483647 test expr-46.15 {round() boundary case - round up to wide} { expr {round(2147483647 + 0.50)} } [expr {wide(2147483647) + 1}] test expr-46.16 {round() boundary case - round up} { expr {round(-2147483648 + 0.51)} } -2147483647 test expr-46.17 {round() boundary case - round down} { expr {round(-2147483648 + 0.50)} } -2147483648 test expr-46.18 {round() boundary case - round down to wide} { expr {round(-2147483648 - 0.50)} } [expr {wide(-2147483648) - 1}] test expr-46.19 {round() handling of long/bignum boundary} { expr {round(double(0x7fffffffffffffff))} } 9223372036854775808 test expr-47.1 {isqrt() - arg count} { list [catch {expr {isqrt(1,2)}} result] $result } {1 {too many arguments for math function "isqrt"}} test expr-47.2 {isqrt() - non-number} { list [catch {expr {isqrt({rubbish})}} result] $result } {1 {expected number but got "rubbish"}} test expr-47.3 {isqrt() - NaN} ieeeFloatingPoint { list [catch {expr {isqrt(NaN)}} result] $result } {1 {floating point value is Not a Number}} test expr-47.4 {isqrt() of negative floating point number} { list [catch {expr {isqrt(-1.0)}} result] $result } {1 {square root of negative argument}} test expr-47.5 {isqrt() of floating point zero} { expr isqrt(0.0) } 0 test expr-47.6 {isqrt() of exact floating point numbers} { set trouble {} for {set i 0} {$i < 16} {incr i} { set root [expr {1 << $i}] set rm1 [expr {$root - 1}] set arg [expr {pow(2., (2 * $i))}] if {isqrt($arg-1) != $rm1} { append trouble "i = " $i ": isqrt( " $arg "-1) != " $rm1 "\n" } if {isqrt($arg) != $root} { append trouble "i = " $i ": isqrt( " $arg ") != " $root "\n" } if {isqrt($arg+1) != $root} { append trouble "i = " $i ": isqrt( " $arg "+1) != " $root "\n" } } set trouble } {} test expr-47.7 {isqrt() of exact floating point numbers} ieeeFloatingPoint { set trouble {} for {set i 17} {$i < 27} {incr i} { set root [expr {1 << $i}] set rm1 [expr {$root - 1}] set arg [expr {pow(2., (2 * $i))}] if {isqrt($arg-1.0) != $rm1} { append trouble "i = " $i ": isqrt( " $arg "-1) != " $rm1 "\n" } if {isqrt($arg) != $root} { append trouble "i = " $i ": isqrt( " $arg ") != " $root "\n" } if {isqrt($arg+1.0) != $root} { append trouble "i = " $i ": isqrt( " $arg "+1) != " $root "\n" } } set trouble } {} test expr-47.8 {isqrt of inexact floating point number} ieeeFloatingPoint { expr isqrt(2[string repeat 0 34]) } 141421356237309504 test expr-47.9 {isqrt of negative int} { list [catch {expr isqrt(-1)} result] $result } {1 {square root of negative argument}} test expr-47.10 {isqrt of negative bignum} { list [catch {expr isqrt(-1[string repeat 0 1000])} result] $result } {1 {square root of negative argument}} test expr-47.11 {isqrt of zero} { expr {isqrt(0)} } 0 test expr-47.12 {isqrt of various sizes of integer} { set faults 0 set trouble {} for {set i 0} {$faults < 10 && $i <= 1024} {incr i} { set root [expr {1 << $i}] set rm1 [expr {$root - 1}] set arg [expr {1 << (2 * $i)}] set tval [expr {isqrt($arg-1)}] if {$tval != $rm1} { append trouble "i = " $i ": isqrt(" $arg "-1) == " $tval \ " != " $rm1 "\n" incr faults } set tval [expr {isqrt($arg)}] if {$tval != $root} { append trouble "i = " $i ": isqrt(" $arg ") == " $tval \ " != " $root "\n" incr faults } set tval [expr {isqrt($arg+1)}] if {$tval != $root} { append trouble "i = " $i ": isqrt(" $arg "+1) == " $tval \ " != " $root "\n" incr faults } } set trouble } {} test expr-47.13 {isqrt and floating point rounding (Bug 2143288)} { set trouble {} set faults 0 for {set i 0} {$i < 29 && $faults < 10} {incr i} { for {set j 0} {$j <= $i} {incr j} { set k [expr {isqrt((1<<56)+(1<<$i)+(1<<$j))}] if {$k != (1<<28)} { append trouble "i = $i, j = $j, k = $k\n" incr faults } } set k [expr {isqrt((1<<56)+(1<<29)+(1<<$i))}] if {$k != (1<<28)+1} { append trouble "i = $i, k = $k\n" incr faults } } set trouble } {} test expr-47.14 {isqrt() - lseq} { list [catch {expr {isqrt([lseq 1 3])}} result] $result } {1 {expected number but got a list}} test expr-47.15 {isqrt() - lseq} { list [catch {expr {isqrt({1 2 "})}} result] $result } {1 {expected number but got "1 2 ""}} test expr-47.16 {isqrt() - lseq} { list [catch {expr {isqrt([dict create foo bar])}} result] $result } {1 {expected number but got a list}} test expr-48.1 {Bug 1770224} { expr {-0x8000000000000001 >> 0x8000000000000000} } -1 test expr-49.1 {Bug 2823282} { coroutine foo apply {{} {set expr expr; $expr {[yield]}}} foo 1 } 1 test expr-50.1 {test sqrt() of bignums with non-Inf answer} { expr {sqrt("1[string repeat 0 616]") == 1e308} } 1 test expr-51.1 {test round-to-even on input} { expr 6.9294956446009195e15 } 6929495644600920.0 test expr-52.1 { comparison with empty string does not generate string representation } { set a [list one two three] list [expr {$a eq {}}] [expr {$a < {}}] [expr {$a > {}}] [ string match {*no string representation*} [ ::tcl::unsupported::representation $a]] } {0 0 1 1} foreach func {isfinite isinf isnan isnormal issubnormal} { test expr-53.1.$func {float classification: basic arg handling} -body { expr ${func}() } -returnCodes error -result "not enough arguments for math function \"$func\"" test expr-53.2.$func {float classification: basic arg handling} -body { expr ${func}(1,2) } -returnCodes error -result "too many arguments for math function \"$func\"" test expr-53.3.$func {float classification: basic arg handling} -body { expr ${func}(true) } -returnCodes error -result {expected number but got "true"} test expr-53.4.$func {float classification: basic arg handling} -body { expr ${func}("gorp") } -returnCodes error -result {expected number but got "gorp"} test expr-53.5.$func {float classification: basic arg handling} -body { expr ${func}(1.0) } -match glob -result * test expr-53.6.$func {float classification: basic arg handling} -body { expr ${func}(0x123) } -match glob -result * } foreach {v r} { 1 normal -1 normal 0x7fffffffffffffff normal -0x7fffffffffffffff normal 0xffffffffffffffffff normal -0xffffffffffffffffff normal 1.0 normal -1.0 normal 0 zero -0 zero 0.0 zero -0.0 zero 1/Inf zero -1/Inf zero 1e-314 subnormal -1e-314 subnormal .0999999**319 subnormal -.0999999**319 subnormal 1e-320/.9 subnormal -1e-320/.9 subnormal 1e5555 infinite 1e308**1e10 infinite Inf infinite -1e5555 infinite -1e308**(1e10+1) infinite -Inf infinite NaN nan } { set changed 0 if {[regexp {[/\*]} $v]} { set v [expr $v]; set changed 1 } test expr-58.1($v)=$r-$changed "float classification: fpclassify($v) eq $r" { fpclassify $v } $r test expr-58.2($v)-$changed "float classification: isfinite($v)" { expr {isfinite($v)} } [expr {$r ni {"infinite" "nan"}}] test expr-58.3($v)-$changed "float classification: isinf($v)" { expr {isinf($v)} } [expr {$r eq "infinite"}] test expr-58.4($v)-$changed "float classification: isnan($v)" { expr {isnan($v)} } [expr {$r eq "nan"}] test expr-58.5($v)-$changed "float classification: isnormal($v)" { expr {isnormal($v)} } [expr {$r eq "normal"}] test expr-58.6($v)-$changed "float classification: issubnormal($v)" { expr {issubnormal($v)} } [expr {$r eq "subnormal"}] test expr-58.7($v)-$changed "float classification: isunordered(0 and $v)" { expr {isunordered(0,$v) + isunordered($v,0)} } [expr {$r eq "nan" ? 2 : 0}] test expr-58.8($v)-$changed "float classification: isunordered(NaN and $v)" { expr {isunordered(NaN,$v) + isunordered($v,NaN)} } 2 } unset -nocomplain v r test expr-59.10 {float classification: fpclassify} -returnCodes error -body { fpclassify } -result {wrong # args: should be "fpclassify floatValue"} test expr-59.11 {float classification: fpclassify} -returnCodes error -body { fpclassify a b } -result {wrong # args: should be "fpclassify floatValue"} test expr-59.12 {float classification: fpclassify} -returnCodes error -body { fpclassify gorp } -result {expected number but got "gorp"} test expr-60.1 {float classification: basic arg handling} -body { expr isunordered() } -returnCodes error -result {not enough arguments for math function "isunordered"} test expr-60.2 {float classification: basic arg handling} -body { expr isunordered(1) } -returnCodes error -result {not enough arguments for math function "isunordered"} test expr-60.3 {float classification: basic arg handling} -body { expr {isunordered(1, 2, 3)} } -returnCodes error -result {too many arguments for math function "isunordered"} test expr-60.4 {float classification: basic arg handling} -body { expr {isunordered(true, 1.0)} } -returnCodes error -result {expected number but got "true"} test expr-60.5 {float classification: basic arg handling} -body { expr {isunordered("gorp", 1.0)} } -returnCodes error -result {expected number but got "gorp"} test expr-60.6a {float classification: basic arg handling, large bigint -> double and wide} -body { expr "isunordered(0x[string repeat f 100], 0x7fffffffffffffff)" } -result 0 test expr-60.6b {float classification: basic arg handling, large bigint -> double Inf and wide} -body { expr "isunordered(0x[string repeat f 1000], 0x7fffffffffffffff)" } -result 0 test expr-60.7 {float classification: basic arg handling} -body { expr {isunordered(1.0, true)} } -returnCodes error -result {expected number but got "true"} test expr-60.8 {float classification: basic arg handling} -body { expr {isunordered(1.0, "gorp")} } -returnCodes error -result {expected number but got "gorp"} test expr-60.9a {float classification: basic arg handling, wide and large bigint -> double} -body { expr "isunordered(0x7fffffffffffffff, 0x[string repeat f 100])" } -result 0 test expr-60.9b {float classification: basic arg handling, wide and large bigint -> double Inf} -body { expr "isunordered(0x7fffffffffffffff, 0x[string repeat f 1000])" } -result 0 test expr-62.1 {TIP 582: comments} -body { expr {1 # + 2} } -result 1 test expr-62.2 {TIP 582: comments} -body { expr "1 #\n+ 2" } -result 3 test expr-62.3 {TIP 582: comments} -setup { set ctr 0 } -body { expr { # This is a demonstration of a comment 1 + 2 + 3 # and another comment + 4 + 5 # + [incr ctr] + [incr ctr] } } -result 16 # Buggy because line breaks aren't tracked inside expressions at all test expr-62.4 {TIP 582: comments don't hide line breaks} -setup { proc getline {} { dict get [info frame -1] line } set base [getline] } -constraints knownBug -body { expr { 0 # a comment + [getline] - $base } } -cleanup { rename getline "" } -result 5 test expr-62.5 {TIP 582: comments don't splice tokens} { set a False expr {$a#don't splice ne#don't splice false} } 1 test expr-62.6 {TIP 582: comments don't splice tokens} { expr {0x2#don't splice ne#don't splice 2} } 1 test expr-62.7 {TIP 582: comments can go inside function calls} { expr {max(1,# comment 2)} } 2 test expr-62.8 {TIP 582: comments can go inside function calls} { expr {max(1# comment ,2)} } 2 test expr-62.9 {TIP 582: comments can go inside function calls} { expr {max(# comment 1,2)} } 2 test expr-62.10 {TIP 582: comments can go inside function calls} { expr {max# comment (1,2)} } 2 test expr-bug-8dd2807066 {Bug 8dd2807066} { expr {max(abs(-668336881543038127783364011867))} } 668336881543038127783364011867 test expr-bug-8dd2807066-1 {Bug 8dd2807066, more elaborate} { expr {max(abs(-668336881543038127783364011867),0)} } 668336881543038127783364011867 # Bug e3dcab1d14 TODO: Need to work out a test case that fails # without tcl_precision, which has been eliminated in 9.0 # proc do-one-test-expr-63 {e p float athreshold} { # # e - power of 2 to test # # p - tcl_precision to test wuth # # float - floating point value 2**-$p # # athreshold - tolerable absolute error (1/2 decimal digit in # # least significant place plus 1/2 least significant bit) # set trouble {} # set ::tcl_precision $p # set xfmt x[expr $float] # set ::tcl_precision 0 # set fmt [string range $xfmt 1 end] # set aerror [expr {abs($fmt - $float)}] # if {$aerror > $athreshold} { # return "Result $fmt is more than $athreshold away from $float" # } else { # return {} # } # } # proc run-test-expr-63 {} { # for {set e 0} {$e <= 1023} {incr e} { # set pt [expr {floor($e*log(2)/log(10))}] # for {set p 6} {$p <= 17} {incr p} { # set athreshold [expr {0.5*10.0**-($pt+$p) + 2.0**-($e+53)}] # set numer [expr {5**$e}] # set xfloat x[expr {2.**-$e}] # set float [string range $xfloat 1 end] # test expr-63.$p.$e "convert 2**-$e to decimal at precision $p" { # do-one-test-expr-63 $e $p $float $athreshold # } {} # } # } # rename do-one-test-expr-63 {} # rename run-test-expr-63 {} # } # run-test-expr-63 # cleanup unset -nocomplain a unset -nocomplain min unset -nocomplain max ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/expr-old.test0000644000175000017500000013525315104661341015355 0ustar sergeisergei# Commands covered: expr # # This file contains the original set of tests for Tcl's expr command. # Since the expr command is now compiled, a new set of tests covering # the new implementation are in the files "parseExpr.test" and # "compExpr.test". Sourcing this file into Tcl runs the tests and generates # output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-2000 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testexprlong [llength [info commands testexprlong]] testConstraint testexprdouble [llength [info commands testexprdouble]] testConstraint testexprstring [llength [info commands testexprstring]] testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}] # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] # First, test all of the integer operators individually. test expr-old-1.1 {integer operators} {expr -4} -4 test expr-old-1.2 {integer operators} {expr -(1+4)} -5 test expr-old-1.3 {integer operators} {expr ~3} -4 test expr-old-1.4 {integer operators} {expr !2} 0 test expr-old-1.5 {integer operators} {expr !0} 1 test expr-old-1.6 {integer operators} {expr 4*6} 24 test expr-old-1.7 {integer operators} {expr 36/12} 3 test expr-old-1.8 {integer operators} {expr 27/4} 6 test expr-old-1.9 {integer operators} {expr 27%4} 3 test expr-old-1.10 {integer operators} {expr 2+2} 4 test expr-old-1.11 {integer operators} {expr 2-6} -4 test expr-old-1.12 {integer operators} {expr 1<<3} 8 test expr-old-1.13 {integer operators} {expr 0xff>>2} 63 test expr-old-1.14 {integer operators} {expr -1>>2} -1 test expr-old-1.15 {integer operators} {expr 3>2} 1 test expr-old-1.16 {integer operators} {expr 2>2} 0 test expr-old-1.17 {integer operators} {expr 1>2} 0 test expr-old-1.18 {integer operators} {expr 3<2} 0 test expr-old-1.19 {integer operators} {expr 2<2} 0 test expr-old-1.20 {integer operators} {expr 1<2} 1 test expr-old-1.21 {integer operators} {expr 3>=2} 1 test expr-old-1.22 {integer operators} {expr 2>=2} 1 test expr-old-1.23 {integer operators} {expr 1>=2} 0 test expr-old-1.24 {integer operators} {expr 3<=2} 0 test expr-old-1.25 {integer operators} {expr 2<=2} 1 test expr-old-1.26 {integer operators} {expr 1<=2} 1 test expr-old-1.27 {integer operators} {expr 3==2} 0 test expr-old-1.28 {integer operators} {expr 2==2} 1 test expr-old-1.29 {integer operators} {expr 3!=2} 1 test expr-old-1.30 {integer operators} {expr 2!=2} 0 test expr-old-1.31 {integer operators} {expr 7&0x13} 3 test expr-old-1.32 {integer operators} {expr 7^0x13} 20 test expr-old-1.33 {integer operators} {expr 7|0x13} 23 test expr-old-1.34 {integer operators} {expr 0&&1} 0 test expr-old-1.35 {integer operators} {expr 0&&0} 0 test expr-old-1.36 {integer operators} {expr 1&&3} 1 test expr-old-1.37 {integer operators} {expr 0||1} 1 test expr-old-1.38 {integer operators} {expr 3||0} 1 test expr-old-1.39 {integer operators} {expr 0||0} 0 test expr-old-1.40 {integer operators} {expr 3>2?44:66} 44 test expr-old-1.41 {integer operators} {expr 2>3?44:66} 66 test expr-old-1.42 {integer operators} {expr 36/5} 7 test expr-old-1.43 {integer operators} {expr 36%5} 1 test expr-old-1.44 {integer operators} {expr -36/5} -8 test expr-old-1.45 {integer operators} {expr -36%5} 4 test expr-old-1.46 {integer operators} {expr 36/-5} -8 test expr-old-1.47 {integer operators} {expr 36%-5} -4 test expr-old-1.48 {integer operators} {expr -36/-5} 7 test expr-old-1.49 {integer operators} {expr -36%-5} -1 test expr-old-1.50 {integer operators} {expr +36} 36 test expr-old-1.51 {integer operators} {expr +--++36} 36 test expr-old-1.52 {integer operators} {expr +36%+5} 1 test expr-old-1.53 {integer operators} { unset -nocomplain x set x yes list [expr {1 && $x}] [expr {$x && 1}] \ [expr {0 || $x}] [expr {$x || 0}] } {1 1 1 1} # Check the floating-point operators individually, along with # automatic conversion to integers where needed. test expr-old-2.1 {floating-point operators} {expr -4.2} -4.2 test expr-old-2.2 {floating-point operators} {expr -(1.125+4.25)} -5.375 test expr-old-2.3 {floating-point operators} {expr +5.7} 5.7 test expr-old-2.4 {floating-point operators} {expr +--+-62.0} -62.0 test expr-old-2.5 {floating-point operators} {expr !2.1} 0 test expr-old-2.6 {floating-point operators} {expr !0.0} 1 test expr-old-2.7 {floating-point operators} {expr 4.2*6.3} 26.46 test expr-old-2.8 {floating-point operators} {expr 36.0/12.0} 3.0 test expr-old-2.9 {floating-point operators} {expr 27/4.0} 6.75 test expr-old-2.10 {floating-point operators} {expr 2.3+2.1} 4.4 test expr-old-2.11 {floating-point operators} {expr 2.3-6.5} -4.2 test expr-old-2.12 {floating-point operators} {expr 3.1>2.1} 1 test expr-old-2.13 {floating-point operators} {expr {2.1 > 2.1}} 0 test expr-old-2.14 {floating-point operators} {expr 1.23>2.34e+1} 0 test expr-old-2.15 {floating-point operators} {expr 3.45<2.34} 0 test expr-old-2.16 {floating-point operators} {expr 0.002e3<--200e-2} 0 test expr-old-2.17 {floating-point operators} {expr 1.1<2.1} 1 test expr-old-2.18 {floating-point operators} {expr 3.1>=2.2} 1 test expr-old-2.19 {floating-point operators} {expr 2.345>=2.345} 1 test expr-old-2.20 {floating-point operators} {expr 1.1>=2.2} 0 test expr-old-2.21 {floating-point operators} {expr 3.0<=2.0} 0 test expr-old-2.22 {floating-point operators} {expr 2.2<=2.2} 1 test expr-old-2.23 {floating-point operators} {expr 2.2<=2.2001} 1 test expr-old-2.24 {floating-point operators} {expr 3.2==2.2} 0 test expr-old-2.25 {floating-point operators} {expr 2.2==2.2} 1 test expr-old-2.26 {floating-point operators} {expr 3.2!=2.2} 1 test expr-old-2.27 {floating-point operators} {expr 2.2!=2.2} 0 test expr-old-2.28 {floating-point operators} {expr 0.0&&0.0} 0 test expr-old-2.29 {floating-point operators} {expr 0.0&&1.3} 0 test expr-old-2.30 {floating-point operators} {expr 1.3&&0.0} 0 test expr-old-2.31 {floating-point operators} {expr 1.3&&3.3} 1 test expr-old-2.32 {floating-point operators} {expr 0.0||0.0} 0 test expr-old-2.33 {floating-point operators} {expr 0.0||1.3} 1 test expr-old-2.34 {floating-point operators} {expr 1.3||0.0} 1 test expr-old-2.35 {floating-point operators} {expr 3.3||0.0} 1 test expr-old-2.36 {floating-point operators} {expr 3.3>2.3?44.3:66.3} 44.3 test expr-old-2.37 {floating-point operators} {expr 2.3>3.3?44.3:66.3} 66.3 test expr-old-2.38 {floating-point operators} { list [catch {expr 028.1 + 09.2} msg] $msg } {0 37.3} # Operators that aren't legal on floating-point numbers test expr-old-3.1 {illegal floating-point operations} { list [catch {expr ~4.0} msg] $msg } {1 {cannot use floating-point value "4.0" as operand of "~"}} test expr-old-3.2 {illegal floating-point operations} { list [catch {expr 27%4.0} msg] $msg } {1 {cannot use floating-point value "4.0" as right operand of "%"}} test expr-old-3.3 {illegal floating-point operations} { list [catch {expr 27.0%4} msg] $msg } {1 {cannot use floating-point value "27.0" as left operand of "%"}} test expr-old-3.4 {illegal floating-point operations} { list [catch {expr 1.0<<3} msg] $msg } {1 {cannot use floating-point value "1.0" as left operand of "<<"}} test expr-old-3.5 {illegal floating-point operations} { list [catch {expr 3<<1.0} msg] $msg } {1 {cannot use floating-point value "1.0" as right operand of "<<"}} test expr-old-3.6 {illegal floating-point operations} { list [catch {expr 24.0>>3} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of ">>"}} test expr-old-3.7 {illegal floating-point operations} { list [catch {expr 24>>3.0} msg] $msg } {1 {cannot use floating-point value "3.0" as right operand of ">>"}} test expr-old-3.8 {illegal floating-point operations} { list [catch {expr 24&3.0} msg] $msg } {1 {cannot use floating-point value "3.0" as right operand of "&"}} test expr-old-3.9 {illegal floating-point operations} { list [catch {expr 24.0|3} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "|"}} test expr-old-3.10 {illegal floating-point operations} { list [catch {expr 24.0^3} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "^"}} # Check the string operators individually. test expr-old-4.1 {string operators} {expr {"abc" > "def"}} 0 test expr-old-4.2 {string operators} {expr {"def" > "def"}} 0 test expr-old-4.3 {string operators} {expr {"g" > "def"}} 1 test expr-old-4.4 {string operators} {expr {"abc" < "abd"}} 1 test expr-old-4.5 {string operators} {expr {"abd" < "abd"}} 0 test expr-old-4.6 {string operators} {expr {"abe" < "abd"}} 0 test expr-old-4.7 {string operators} {expr {"abc" >= "def"}} 0 test expr-old-4.8 {string operators} {expr {"def" >= "def"}} 1 test expr-old-4.9 {string operators} {expr {"g" >= "def"}} 1 test expr-old-4.10 {string operators} {expr {"abc" <= "abd"}} 1 test expr-old-4.11 {string operators} {expr {"abd" <= "abd"}} 1 test expr-old-4.12 {string operators} {expr {"abe" <= "abd"}} 0 test expr-old-4.13 {string operators} {expr {"abc" == "abd"}} 0 test expr-old-4.14 {string operators} {expr {"abd" == "abd"}} 1 test expr-old-4.15 {string operators} {expr {"abc" != "abd"}} 1 test expr-old-4.16 {string operators} {expr {"abd" != "abd"}} 0 test expr-old-4.17 {string operators} {expr {"0y" < "0x12"}} 0 test expr-old-4.18 {string operators} {expr {"." < " "}} 0 test expr-old-4.19 {string operators} {expr {"abc" eq "abd"}} 0 test expr-old-4.20 {string operators} {expr {"abd" eq "abd"}} 1 test expr-old-4.21 {string operators} {expr {"abc" ne "abd"}} 1 test expr-old-4.22 {string operators} {expr {"abd" ne "abd"}} 0 test expr-old-4.23 {string operators} {expr {"" eq "abd"}} 0 test expr-old-4.24 {string operators} {expr {"" eq ""}} 1 test expr-old-4.25 {string operators} {expr {"abd" ne ""}} 1 test expr-old-4.26 {string operators} {expr {"" ne ""}} 0 test expr-old-4.27 {string operators} {expr {"longerstring" eq "shorter"}} 0 test expr-old-4.28 {string operators} {expr {"longerstring" ne "shorter"}} 1 test expr-old-4.29 {string operators} {expr {"0" == "+"}} 0 test expr-old-4.30 {string operators} {expr {"0" == "-"}} 0 test expr-old-4.31 {string operators} {expr {1?"foo":"bar"}} foo test expr-old-4.32 {string operators} {expr {0?"foo":"bar"}} bar # Operators that aren't legal on string operands. test expr-old-5.1 {illegal string operations} { list [catch {expr {-"a"}} msg] $msg } {1 {cannot use non-numeric string "a" as operand of "-"}} test expr-old-5.2 {illegal string operations} { list [catch {expr {+"a"}} msg] $msg } {1 {cannot use non-numeric string "a" as operand of "+"}} test expr-old-5.3 {illegal string operations} { list [catch {expr {~"a"}} msg] $msg } {1 {cannot use non-numeric string "a" as operand of "~"}} test expr-old-5.4 {illegal string operations} { list [catch {expr {!"a"}} msg] $msg } {1 {cannot use non-numeric string "a" as operand of "!"}} test expr-old-5.5 {illegal string operations} { list [catch {expr {"a"*"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "*"}} test expr-old-5.6 {illegal string operations} { list [catch {expr {"a"/"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "/"}} test expr-old-5.7 {illegal string operations} { list [catch {expr {"a"%"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "%"}} test expr-old-5.8 {illegal string operations} { list [catch {expr {"a"+"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "+"}} test expr-old-5.9 {illegal string operations} { list [catch {expr {"a"-"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "-"}} test expr-old-5.10 {illegal string operations} { list [catch {expr {"a"<<"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "<<"}} test expr-old-5.11 {illegal string operations} { list [catch {expr {"a">>"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of ">>"}} test expr-old-5.12 {illegal string operations} { list [catch {expr {"a"&"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "&"}} test expr-old-5.13 {illegal string operations} { list [catch {expr {"a"^"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "^"}} test expr-old-5.14 {illegal string operations} { list [catch {expr {"a"|"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "|"}} test expr-old-5.15 {illegal string operations} { list [catch {expr {"a"&&"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-old-5.16 {illegal string operations} { list [catch {expr {"a"||"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test expr-old-5.17 {illegal string operations} { list [catch {expr {"a"?4:2}} msg] $msg } {1 {expected boolean value but got "a"}} # Check precedence pairwise. test expr-old-6.1 {precedence checks} {expr -~3} 4 test expr-old-6.2 {precedence checks} {expr -!3} 0 test expr-old-6.3 {precedence checks} {expr -~0} 1 test expr-old-7.1 {precedence checks} {expr 2*4/6} 1 test expr-old-7.2 {precedence checks} {expr 24/6*3} 12 test expr-old-7.3 {precedence checks} {expr 24/6/2} 2 test expr-old-8.1 {precedence checks} {expr -2+4} 2 test expr-old-8.2 {precedence checks} {expr -2-4} -6 test expr-old-8.3 {precedence checks} {expr +2-4} -2 test expr-old-9.1 {precedence checks} {expr 2*3+4} 10 test expr-old-9.2 {precedence checks} {expr 8/2+4} 8 test expr-old-9.3 {precedence checks} {expr 8%3+4} 6 test expr-old-9.4 {precedence checks} {expr 2*3-1} 5 test expr-old-9.5 {precedence checks} {expr 8/2-1} 3 test expr-old-9.6 {precedence checks} {expr 8%3-1} 1 test expr-old-10.1 {precedence checks} {expr 6-3-2} 1 test expr-old-11.1 {precedence checks} {expr 7+1>>2} 2 test expr-old-11.2 {precedence checks} {expr 7+1<<2} 32 test expr-old-11.3 {precedence checks} {expr 7>>3-2} 3 test expr-old-11.4 {precedence checks} {expr 7<<3-2} 14 test expr-old-12.1 {precedence checks} {expr 6>>1>4} 0 test expr-old-12.2 {precedence checks} {expr 6>>1<2} 0 test expr-old-12.3 {precedence checks} {expr 6>>1>=3} 1 test expr-old-12.4 {precedence checks} {expr 6>>1<=2} 0 test expr-old-12.5 {precedence checks} {expr 6<<1>5} 1 test expr-old-12.6 {precedence checks} {expr 6<<1<5} 0 test expr-old-12.7 {precedence checks} {expr 5<=6<<1} 1 test expr-old-12.8 {precedence checks} {expr 5>=6<<1} 0 test expr-old-13.1 {precedence checks} {expr 2<3<4} 1 test expr-old-13.2 {precedence checks} {expr 0<4>2} 0 test expr-old-13.3 {precedence checks} {expr 4>2<1} 0 test expr-old-13.4 {precedence checks} {expr 4>3>2} 0 test expr-old-13.5 {precedence checks} {expr 4>3>=2} 0 test expr-old-13.6 {precedence checks} {expr 4>=3>2} 0 test expr-old-13.7 {precedence checks} {expr 4>=3>=2} 0 test expr-old-13.8 {precedence checks} {expr 0<=4>=2} 0 test expr-old-13.9 {precedence checks} {expr 4>=2<=0} 0 test expr-old-13.10 {precedence checks} {expr 2<=3<=4} 1 test expr-old-14.1 {precedence checks} {expr 1==4>3} 1 test expr-old-14.2 {precedence checks} {expr 0!=4>3} 1 test expr-old-14.3 {precedence checks} {expr 1==3<4} 1 test expr-old-14.4 {precedence checks} {expr 0!=3<4} 1 test expr-old-14.5 {precedence checks} {expr 1==4>=3} 1 test expr-old-14.6 {precedence checks} {expr 0!=4>=3} 1 test expr-old-14.7 {precedence checks} {expr 1==3<=4} 1 test expr-old-14.8 {precedence checks} {expr 0!=3<=4} 1 test expr-old-14.9 {precedence checks} {expr 1eq4>3} 1 test expr-old-14.10 {precedence checks} {expr 0ne4>3} 1 test expr-old-14.11 {precedence checks} {expr 1eq3<4} 1 test expr-old-14.12 {precedence checks} {expr 0ne3<4} 1 test expr-old-14.13 {precedence checks} {expr 1eq4>=3} 1 test expr-old-14.14 {precedence checks} {expr 0ne4>=3} 1 test expr-old-14.15 {precedence checks} {expr 1eq3<=4} 1 test expr-old-14.16 {precedence checks} {expr 0ne3<=4} 1 test expr-old-15.1 {precedence checks} {expr 1==3==3} 0 test expr-old-15.2 {precedence checks} {expr 3==3!=2} 1 test expr-old-15.3 {precedence checks} {expr 2!=3==3} 0 test expr-old-15.4 {precedence checks} {expr 2!=1!=1} 0 test expr-old-15.5 {precedence checks} {expr 1eq3eq3} 0 test expr-old-15.6 {precedence checks} {expr 3eq3ne2} 1 test expr-old-15.7 {precedence checks} {expr 2ne3eq3} 0 test expr-old-15.8 {precedence checks} {expr 2ne1ne1} 0 test expr-old-16.1 {precedence checks} {expr 2&3eq2} 0 test expr-old-16.2 {precedence checks} {expr 1&3ne3} 0 test expr-old-16.3 {precedence checks} {expr 2&3eq2} 0 test expr-old-16.4 {precedence checks} {expr 1&3ne3} 0 test expr-old-17.1 {precedence checks} {expr 7&3^0x10} 19 test expr-old-17.2 {precedence checks} {expr 7^0x10&3} 7 test expr-old-18.1 {precedence checks} {expr 7^0x10|3} 23 test expr-old-18.2 {precedence checks} {expr 7|0x10^3} 23 test expr-old-19.1 {precedence checks} {expr 7|3&&1} 1 test expr-old-19.2 {precedence checks} {expr 1&&3|7} 1 test expr-old-19.3 {precedence checks} {expr 0&&1||1} 1 test expr-old-19.4 {precedence checks} {expr 1||1&&0} 1 test expr-old-20.1 {precedence checks} {expr 1||0?3:4} 3 test expr-old-20.2 {precedence checks} {expr 1?0:4||1} 0 test expr-old-20.3 {precedence checks} {expr 1?2:0?3:4} 2 test expr-old-20.4 {precedence checks} {expr 0?2:0?3:4} 4 test expr-old-20.5 {precedence checks} {expr 1?2?3:4:0} 3 test expr-old-20.6 {precedence checks} {expr 0?2?3:4:0} 0 # Parentheses. test expr-old-21.1 {parenthesization} {expr (2+4)*6} 36 test expr-old-21.2 {parenthesization} {expr (1?0:4)||1} 1 test expr-old-21.3 {parenthesization} {expr +(3-4)} -1 # Embedded commands and variable names. set a 16 test expr-old-22.1 {embedded variables} {expr {2*$a}} 32 test expr-old-22.2 {embedded variables} { set x -5 set y 10 expr {$x + $y} } {5} test expr-old-22.3 {embedded variables} { set x " -5" set y " +10" expr {$x + $y} } {5} test expr-old-22.4 {embedded commands and variables} {expr {[set a] - 14}} 2 test expr-old-22.5 {embedded commands and variables} { list [catch {expr {12 - [bad_command_name]}} msg] $msg } {1 {invalid command name "bad_command_name"}} # Double-quotes and things inside them. test expr-old-23.1 {double quotes} {expr {"abc"}} abc test expr-old-23.2 {double quotes} { set a 189 expr {"$a.bc"} } 189.bc test expr-old-23.3 {double quotes} { set b2 xyx expr {"$b2$b2$b2.[set b2].[set b2]"} } xyxxyxxyx.xyx.xyx test expr-old-23.4 {double quotes} {expr {"11\}\}22"}} 11}}22 test expr-old-23.5 {double quotes} {expr {"\*bc"}} {*bc} test expr-old-23.6 {double quotes} { unset -nocomplain bogus__ list [catch {expr {"$bogus__"}} msg] $msg } {1 {can't read "bogus__": no such variable}} test expr-old-23.7 {double quotes} { list [catch {expr {"a[error Testing]bc"}} msg] $msg } {1 Testing} test expr-old-23.8 {double quotes} { list [catch {expr {"12398712938788234-1298379" != ""}} msg] $msg } {0 1} # Numbers in various bases. test expr-old-24.1 {numbers in different bases} {expr 0x20} 32 test expr-old-24.2 {numbers in different bases} {expr 0o15} 13 # Conversions between various data types. test expr-old-25.1 {type conversions} {expr 2+2.5} 4.5 test expr-old-25.2 {type conversions} {expr 2.5+2} 4.5 test expr-old-25.3 {type conversions} {expr 2-2.5} -0.5 test expr-old-25.4 {type conversions} {expr 2/2.5} 0.8 test expr-old-25.5 {type conversions} {expr 2>2.5} 0 test expr-old-25.6 {type conversions} {expr 2.5>2} 1 test expr-old-25.7 {type conversions} {expr 2<2.5} 1 test expr-old-25.8 {type conversions} {expr 2>=2.5} 0 test expr-old-25.9 {type conversions} {expr 2<=2.5} 1 test expr-old-25.10 {type conversions} {expr 2==2.5} 0 test expr-old-25.11 {type conversions} {expr 2!=2.5} 1 test expr-old-25.12 {type conversions} {expr 2>"ab"} 0 test expr-old-25.13 {type conversions} {expr {2>" "}} 1 test expr-old-25.14 {type conversions} {expr {"24.1a" > 24.1}} 1 test expr-old-25.15 {type conversions} {expr {24.1 > "24.1a"}} 0 test expr-old-25.16 {type conversions} {expr 2+2.5} 4.5 test expr-old-25.17 {type conversions} {expr 2+2.5} 4.5 test expr-old-25.18 {type conversions} {expr 2.0e2} 200.0 test expr-old-25.19 {type conversions} {expr 2.0e15} 2000000000000000.0 test expr-old-25.20 {type conversions} {expr 10.0} 10.0 # Various error conditions. test expr-old-26.1 {error conditions} { list [catch {expr 2+"a"} msg] $msg } {1 {cannot use non-numeric string "a" as right operand of "+"}} test expr-old-26.2 {error conditions} -body { expr 2+4* } -returnCodes error -match glob -result * test expr-old-26.3 {error conditions} -body { expr 2+4*( } -returnCodes error -match glob -result * unset -nocomplain _non_existent_ test expr-old-26.4 {error conditions} { list [catch {expr 2+$_non_existent_} msg] $msg } {1 {can't read "_non_existent_": no such variable}} set a xx test expr-old-26.5 {error conditions} { list [catch {expr {2+$a}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "+"}} test expr-old-26.6 {error conditions} { list [catch {expr {2+[set a]}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "+"}} test expr-old-26.7 {error conditions} -body { expr {2+(4} } -returnCodes error -match glob -result * test expr-old-26.8 {error conditions} { list [catch {expr 2/0} msg] $msg $errorCode } {1 {divide by zero} {ARITH DIVZERO {divide by zero}}} test expr-old-26.9 {error conditions} { list [catch {expr 2%0} msg] $msg $errorCode } {1 {divide by zero} {ARITH DIVZERO {divide by zero}}} test expr-old-26.10a {error conditions} !ieeeFloatingPoint { list [catch {expr 2.0/0.0} msg] $msg $errorCode } {1 {divide by zero} {ARITH DIVZERO {divide by zero}}} test expr-old-26.10b {error conditions} ieeeFloatingPoint { list [catch {expr 2.0/0.0} msg] $msg } {0 Inf} test expr-old-26.11 {error conditions} -body { expr 2` } -returnCodes error -match glob -result * test expr-old-26.12 {error conditions} -body { expr a.b } -returnCodes error -match glob -result * test expr-old-26.13 {error conditions} { list [catch {expr {"a"/"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "/"}} test expr-old-26.14 {error conditions} -body { expr 2:3 } -returnCodes error -match glob -result * test expr-old-26.15 {error conditions} -body { expr a@b } -returnCodes error -match glob -result * test expr-old-26.16 {error conditions} { list [catch {expr a[b} msg] $msg } {1 {missing close-bracket}} test expr-old-26.17 {error conditions} -body { expr a`b } -returnCodes error -match glob -result * test expr-old-26.18 {error conditions} -body { expr \"a\"\{b } -returnCodes error -match glob -result * test expr-old-26.19 {error conditions} -body { expr a } -returnCodes error -match glob -result * test expr-old-26.20 {error conditions} { list [catch expr msg] $msg } {1 {wrong # args: should be "expr arg ?arg ...?"}} # Cancelled evaluation. test expr-old-27.1 {cancelled evaluation} { set a 1 expr {0&&[set a 2]} set a } 1 test expr-old-27.2 {cancelled evaluation} { set a 1 expr {1||[set a 2]} set a } 1 test expr-old-27.3 {cancelled evaluation} { set a 1 expr {0?[set a 2]:1} set a } 1 test expr-old-27.4 {cancelled evaluation} { set a 1 expr {1?2:[set a 2]} set a } 1 unset -nocomplain x test expr-old-27.5 {cancelled evaluation} { list [catch {expr {[info exists x] && $x}} msg] $msg } {0 0} test expr-old-27.6 {cancelled evaluation} { list [catch {expr {0 && [concat $x]}} msg] $msg } {0 0} test expr-old-27.7 {cancelled evaluation} { set one 1 list [catch {expr {1 || 1/$one}} msg] $msg } {0 1} test expr-old-27.8 {cancelled evaluation} { list [catch {expr {1 || -"string"}} msg] $msg } {0 1} test expr-old-27.9 {cancelled evaluation} { list [catch {expr {1 || ("string" * ("x" && "y"))}} msg] $msg } {0 1} test expr-old-27.10 {cancelled evaluation} { set x -1.0 list [catch {expr {($x > 0) ? round(log($x)) : 0}} msg] $msg } {0 0} test expr-old-27.11 {cancelled evaluation} -body { expr {0 && foo} } -returnCodes error -match glob -result * test expr-old-27.12 {cancelled evaluation} -body { expr {0 ? 1 : foo} } -returnCodes error -match glob -result * # Tcl_ExprBool as used in "if" statements test expr-old-28.1 {Tcl_ExprBoolean usage} { set a 1 if {2} {set a 2} set a } 2 test expr-old-28.2 {Tcl_ExprBoolean usage} { set a 1 if {0} {set a 2} set a } 1 test expr-old-28.3 {Tcl_ExprBoolean usage} { set a 1 if {1.2} {set a 2} set a } 2 test expr-old-28.4 {Tcl_ExprBoolean usage} { set a 1 if {-1.1} {set a 2} set a } 2 test expr-old-28.5 {Tcl_ExprBoolean usage} { set a 1 if {0.0} {set a 2} set a } 1 test expr-old-28.6 {Tcl_ExprBoolean usage} { set a 1 if {"YES"} {set a 2} set a } 2 test expr-old-28.7 {Tcl_ExprBoolean usage} { set a 1 if {"no"} {set a 2} set a } 1 test expr-old-28.8 {Tcl_ExprBoolean usage} { set a 1 if {"true"} {set a 2} set a } 2 test expr-old-28.9 {Tcl_ExprBoolean usage} { set a 1 if {"fAlse"} {set a 2} set a } 1 test expr-old-28.10 {Tcl_ExprBoolean usage} { set a 1 if {"on"} {set a 2} set a } 2 test expr-old-28.11 {Tcl_ExprBoolean usage} { set a 1 if {"Off"} {set a 2} set a } 1 test expr-old-28.12 {Tcl_ExprBool usage} { list [catch {if {"abc"} {}} msg] $msg } {1 {expected boolean value but got "abc"}} test expr-old-28.13 {Tcl_ExprBool usage} { list [catch {if {"ogle"} {}} msg] $msg } {1 {expected boolean value but got "ogle"}} test expr-old-28.14 {Tcl_ExprBool usage} { list [catch {if {"o"} {}} msg] $msg } {1 {expected boolean value but got "o"}} # Operands enclosed in braces test expr-old-29.1 {braces} {expr {{abc}}} abc test expr-old-29.2 {braces} {expr {{0o0010}}} 8 test expr-old-29.3 {braces} {expr {{3.1200000}}} 3.12 test expr-old-29.4 {braces} {expr {{a{b}{1 {2 3}}c}}} "a{b}{1 {2 3}}c" test expr-old-29.5 {braces} -body { expr "\{abc" } -returnCodes error -match glob -result * # Very long values test expr-old-30.1 {long values} { set a "0000 1111 2222 3333 4444" set a "$a | $a | $a | $a | $a" set a "$a || $a || $a || $a || $a" expr {$a} } {0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 || 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 || 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 || 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 || 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444 | 0000 1111 2222 3333 4444} test expr-old-30.2 {long values} { set a "000000000000000000000000000000" set a "$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a${a}5" expr $a } 5 # Expressions spanning multiple arguments test expr-old-31.1 {multiple arguments to expr command} { expr 4 + ( 6 *12) -3 } 73 test expr-old-31.2 {multiple arguments to expr command} -body { expr 2 + (3 + 4 } -returnCodes error -match glob -result * test expr-old-31.3 {multiple arguments to expr command} -body { expr 2 + 3 + } -returnCodes error -match glob -result * test expr-old-31.4 {multiple arguments to expr command} -body { expr 2 + 3 ) } -returnCodes error -match glob -result * # Math functions test expr-old-32.1 {math functions in expressions} { format %.6g [expr acos(0.5)] } {1.0472} test expr-old-32.2 {math functions in expressions} { format %.6g [expr asin(0.5)] } {0.523599} test expr-old-32.3 {math functions in expressions} { format %.6g [expr atan(1.0)] } {0.785398} test expr-old-32.4 {math functions in expressions} { format %.6g [expr atan2(2.0, 2.0)] } {0.785398} test expr-old-32.5 {math functions in expressions} { format %.6g [expr ceil(1.999)] } {2} test expr-old-32.6 {math functions in expressions} { format %.6g [expr cos(.1)] } {0.995004} test expr-old-32.7 {math functions in expressions} { format %.6g [expr cosh(.1)] } {1.005} test expr-old-32.8 {math functions in expressions} { format %.6g [expr exp(1.0)] } {2.71828} test expr-old-32.9 {math functions in expressions} { format %.6g [expr floor(2.000)] } {2} test expr-old-32.10 {math functions in expressions} { format %.6g [expr floor(2.001)] } {2} test expr-old-32.11 {math functions in expressions} { format %.6g [expr fmod(7.3, 3.2)] } {0.9} test expr-old-32.12 {math functions in expressions} { format %.6g [expr hypot(3.0, 4.0)] } {5} test expr-old-32.13 {math functions in expressions} { format %.6g [expr log(2.8)] } {1.02962} test expr-old-32.14 {math functions in expressions} { format %.6g [expr log10(2.8)] } {0.447158} test expr-old-32.15 {math functions in expressions} { format %.6g [expr pow(2.1, 3.1)] } {9.97424} test expr-old-32.16 {math functions in expressions} { format %.6g [expr sin(.1)] } {0.0998334} test expr-old-32.17 {math functions in expressions} { format %.6g [expr sinh(.1)] } {0.100167} test expr-old-32.18 {math functions in expressions} { format %.6g [expr sqrt(2.0)] } {1.41421} test expr-old-32.19 {math functions in expressions} { format %.6g [expr tan(0.8)] } {1.02964} test expr-old-32.20 {math functions in expressions} { format %.6g [expr tanh(0.8)] } {0.664037} test expr-old-32.21 {math functions in expressions} { format %.6g [expr abs(-1.8)] } {1.8} test expr-old-32.22 {math functions in expressions} { expr abs(10.0) } {10.0} test expr-old-32.23 {math functions in expressions} { format %.6g [expr abs(-4)] } {4} test expr-old-32.24 {math functions in expressions} { format %.6g [expr abs(66)] } {66} test expr-old-32.25a {math functions in expressions} { expr abs(0x8000000000000000) } [expr 1<<63] test expr-old-32.25b {math functions in expressions} { expr abs(0x80000000) } 2147483648 test expr-old-32.26 {math functions in expressions} { expr double(1) } {1.0} test expr-old-32.27 {math functions in expressions} { expr double(1.1) } {1.1} test expr-old-32.28 {math functions in expressions} { expr int(1) } {1} test expr-old-32.29 {math functions in expressions} { expr int(1.4) } {1} test expr-old-32.30 {math functions in expressions} { expr int(1.6) } {1} test expr-old-32.31 {math functions in expressions} { expr int(-1.4) } {-1} test expr-old-32.32 {math functions in expressions} { expr int(-1.6) } {-1} test expr-old-32.33 {math functions in expressions} { expr int(1e60) } 999999999999999949387135297074018866963645011013410073083904 test expr-old-32.34 {math functions in expressions} { expr int(-1e60) } -999999999999999949387135297074018866963645011013410073083904 test expr-old-32.35 {math functions in expressions} { expr round(1.49) } {1} test expr-old-32.36 {math functions in expressions} { expr round(1.51) } {2} test expr-old-32.37 {math functions in expressions} { expr round(-1.49) } {-1} test expr-old-32.38 {math functions in expressions} { expr round(-1.51) } {-2} test expr-old-32.39 {math functions in expressions} { expr round(1e60) } 999999999999999949387135297074018866963645011013410073083904 test expr-old-32.40 {math functions in expressions} { expr round(-1e60) } -999999999999999949387135297074018866963645011013410073083904 test expr-old-32.41 {math functions in expressions} { list [catch {expr pow(1.0 + 3.0 - 2, .8 * 5)} msg] $msg } {0 16.0} test expr-old-32.42 {math functions in expressions} { list [catch {expr hypot(5*.8,3)} msg] $msg } {0 5.0} test expr-old-32.45 {math functions in expressions} { expr (0 <= rand()) && (rand() < 1) } {1} test expr-old-32.46 {math functions in expressions} -body { list [catch {expr rand(24)} msg] $msg } -match glob -result {1 {too many arguments for math function*}} test expr-old-32.47 {math functions in expressions} -body { list [catch {expr srand()} msg] $msg } -match glob -result {1 {not enough arguments for math function*}} test expr-old-32.48 {math functions in expressions} -body { expr srand(3.79) } -returnCodes error -match glob -result * test expr-old-32.49 {math functions in expressions} -body { expr srand("") } -returnCodes error -match glob -result * test expr-old-32.50 {math functions in expressions} { set result [expr round(srand(12345) * 1000)] for {set i 0} {$i < 10} {incr i} { lappend result [expr round(rand() * 1000)] } set result } {97 834 948 36 12 51 766 585 914 784 333} test expr-old-32.51 {math functions in expressions} -body { expr {srand([lindex "6ty" 0])} } -returnCodes error -match glob -result * test expr-old-32.52 {math functions in expressions} { expr {srand(int(1<<37)) < 1} } {1} test expr-old-32.53 {math functions in expressions} { expr {srand((1<<31) - 1) > 0} } {1} test expr-old-33.1 {conversions and fancy args to math functions} { expr hypot ( 3 , 4 ) } 5.0 test expr-old-33.2 {conversions and fancy args to math functions} { expr hypot ( (2.0+1.0) , 4 ) } 5.0 test expr-old-33.3 {conversions and fancy args to math functions} { expr hypot ( 3 , (3.0 + 1.0) ) } 5.0 test expr-old-33.4 {conversions and fancy args to math functions} { format %.6g [expr cos(acos(0.1))] } 0.1 test expr-old-34.1 {errors in math functions} -body { list [catch {expr func_2(1.0)} msg] $msg } -match glob -result {1 {* "*func_2"}} test expr-old-34.2 {errors in math functions} -body { expr func|(1.0) } -returnCodes error -match glob -result * test expr-old-34.3 {errors in math functions} { list [catch {expr {hypot("a b", 2.0)}} msg] $msg } {1 {expected floating-point number but got a list}} test expr-old-34.4 {errors in math functions} -body { expr hypot(1.0 2.0) } -returnCodes error -match glob -result * test expr-old-34.5 {errors in math functions} -body { expr hypot(1.0, 2.0 } -returnCodes error -match glob -result * test expr-old-34.6 {errors in math functions} -body { expr hypot(1.0 , } -returnCodes error -match glob -result * test expr-old-34.7 {errors in math functions} -body { list [catch {expr hypot(1.0)} msg] $msg } -match glob -result {1 {not enough arguments for math function*}} test expr-old-34.8 {errors in math functions} -body { list [catch {expr hypot(1.0, 2.0, 3.0)} msg] $msg } -match glob -result {1 {too many arguments for math function*}} test expr-old-34.9 {errors in math functions} { list [catch {expr acos(-2.0)} msg] $msg $errorCode } {1 {domain error: argument not in valid range} {ARITH DOMAIN {domain error: argument not in valid range}}} test expr-old-34.10 {errors in math functions} { list [catch {expr pow(-3, 1000001)} msg] $msg } {0 -Inf} test expr-old-34.11a {errors in math functions} !ieeeFloatingPoint { list [catch {expr pow(3, 1000001)} msg] $msg $errorCode } {1 {floating-point value too large to represent} {ARITH OVERFLOW {floating-point value too large to represent}}} test expr-old-34.11b {errors in math functions} ieeeFloatingPoint { list [catch {expr pow(3, 1000001)} msg] $msg } {0 Inf} test expr-old-34.12a {errors in math functions} !ieeeFloatingPoint { list [catch {expr -14.0*exp(100000)} msg] $msg $errorCode } {1 {floating-point value too large to represent} {ARITH OVERFLOW {floating-point value too large to represent}}} test expr-old-34.12b {errors in math functions} ieeeFloatingPoint { list [catch {expr -14.0*exp(100000)} msg] $msg } {0 -Inf} test expr-old-34.13 {errors in math functions} { expr wide(1.0e30) } 5076964154930102272 test expr-old-34.14 {errors in math functions} { expr wide(-1.0e30) } -5076964154930102272 test expr-old-34.15 {errors in math functions} { expr round(1.0e30) } 1000000000000000019884624838656 test expr-old-34.16 {errors in math functions} { expr round(-1.0e30) } -1000000000000000019884624838656 test expr-old-36.1 {ExprLooksLikeInt procedure} -body { expr 0o289 } -returnCodes error -match glob -result {*invalid octal number*} test expr-old-36.2 {ExprLooksLikeInt procedure} { set x 0o289 list [catch {expr {$x+1}} msg] $msg } {1 {cannot use non-numeric string "0o289" as left operand of "+"}} test expr-old-36.3 {ExprLooksLikeInt procedure} { list [catch {expr 0289.1} msg] $msg } {0 289.1} test expr-old-36.4 {ExprLooksLikeInt procedure} { set x 0289.1 list [catch {expr {$x+1}} msg] $msg } {0 290.1} test expr-old-36.5 {ExprLooksLikeInt procedure} { set x { +22} list [catch {expr {$x+1}} msg] $msg } {0 23} test expr-old-36.6 {ExprLooksLikeInt procedure} { set x { -22} list [catch {expr {$x+1}} msg] $msg } {0 -21} test expr-old-36.7 {ExprLooksLikeInt procedure} { list [catch {expr nan} msg] $msg } {1 {domain error: argument not in valid range}} test expr-old-36.8 {ExprLooksLikeInt procedure} { list [catch {expr 78e1} msg] $msg } {0 780.0} test expr-old-36.9 {ExprLooksLikeInt procedure} { list [catch {expr 24E1} msg] $msg } {0 240.0} test expr-old-36.10 {ExprLooksLikeInt procedure} -body { expr 78e } -returnCodes error -match glob -result * # test for [Bug #542588] test expr-old-36.11 {ExprLooksLikeInt procedure} { # define a "too large integer"; this one works also for 64bit arith set x 665802003400000000000000 expr {$x+1} } 665802003400000000000001 # tests for [Bug #587140] test expr-old-36.12 {ExprLooksLikeInt procedure} { set x "10;" list [catch {expr {$x+1}} msg] $msg } {1 {cannot use non-numeric string "10;" as left operand of "+"}} test expr-old-36.13 {ExprLooksLikeInt procedure} { set x " +" list [catch {expr {$x+1}} msg] $msg } {1 {cannot use non-numeric string " +" as left operand of "+"}} test expr-old-36.14 {ExprLooksLikeInt procedure} { set x "123456789012345678901234567890 " expr {$x+1} } 123456789012345678901234567891 test expr-old-36.15 {ExprLooksLikeInt procedure} { set x "0o99 " list [catch {expr {$x+1}} msg] $msg } {1 {cannot use non-numeric string "0o99 " as left operand of "+"}} test expr-old-36.16 {ExprLooksLikeInt procedure} { set x " 0xffffffffffffffffffffffffffffffffffffff " expr {$x+1} } [expr 0x100000000000000000000000000000000000000] test expr-old-37.1 {Check that Tcl_ExprLong doesn't modify interpreter result if no error} testexprlong { testexprlong 4+1 } {This is a result: 5} #Check for [Bug 1109484] test expr-old-37.2 {Tcl_ExprLong handles wide ints gracefully} testexprlong { testexprlong wide(1)+2 } {This is a result: 3} test expr-old-37.3 {Tcl_ExprLong on the empty string} testexprlong { testexprlong "" } {This is a result: 0} test expr-old-37.4 {Tcl_ExprLong coerces doubles} testexprlong { testexprlong 3+.14159 } {This is a result: 3} test expr-old-37.5 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { testexprlong 0x80000000 } {This is a result: -2147483648} test expr-old-37.6 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { testexprlong 0xffffffff } {This is a result: -1} test expr-old-37.7 {Tcl_ExprLong handles overflows} \ -constraints {testexprlong longIs32bit} \ -match glob \ -body { list [catch {testexprlong 0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.8 {Tcl_ExprLong handles overflows} testexprlong { testexprlong -0x80000000 } {This is a result: -2147483648} test expr-old-37.9 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { testexprlong -0x7fffffff } {This is a result: -2147483647} test expr-old-37.10 {Tcl_ExprLong handles overflows} \ -constraints {testexprlong longIs32bit} \ -match glob \ -body { list [catch {testexprlong -0x100000000} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.11 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { testexprlong 2147483648. } {This is a result: -2147483648} test expr-old-37.12 {Tcl_ExprLong handles overflows} {testexprlong longIs32bit} { testexprlong 4294967295. } {This is a result: -1} test expr-old-37.13 {Tcl_ExprLong handles overflows} \ -constraints {testexprlong longIs32bit} \ -match glob \ -body { list [catch {testexprlong 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.14 {Tcl_ExprLong handles overflows} testexprlong { testexprlong -2147483648. } {This is a result: -2147483648} test expr-old-37.15 {Tcl_ExprLong handles overflows} \ -constraints {testexprlong longIs32bit} \ -match glob \ -body { list [catch {testexprlong -2147483649.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.16 {Tcl_ExprLong handles overflows} \ -constraints {testexprlong longIs32bit} \ -match glob \ -body { list [catch {testexprlong 4294967296.} result] $result } \ -result {1 {integer value too large to represent*}} test expr-old-37.17 {Check that Tcl_ExprDouble doesn't modify interpreter result if no error} testexprdouble { testexprdouble 4.+1. } {This is a result: 5.0} #Check for [Bug 1109484] test expr-old-37.18 {Tcl_ExprDouble on the empty string} testexprdouble { testexprdouble "" } {This is a result: 0.0} test expr-old-37.19 {Tcl_ExprDouble coerces wides} testexprdouble { testexprdouble 1[string repeat 0 17] } {This is a result: 1e+17} test expr-old-37.20 {Tcl_ExprDouble coerces bignums} testexprdouble { testexprdouble 1[string repeat 0 38] } {This is a result: 1e+38} test expr-old-37.21 {Tcl_ExprDouble handles overflows} testexprdouble { testexprdouble 17976931348623157[string repeat 0 292]. } {This is a result: 1.7976931348623157e+308} test expr-old-37.22 {Tcl_ExprDouble handles overflows that look like int} \ testexprdouble { testexprdouble 17976931348623157[string repeat 0 292] } {This is a result: 1.7976931348623157e+308} test expr-old-37.23 {Tcl_ExprDouble handles overflows} \ ieeeFloatingPoint&&testexprdouble { testexprdouble 17976931348623165[string repeat 0 292]. } {This is a result: Inf} test expr-old-37.24 {Tcl_ExprDouble handles overflows that look like int} \ ieeeFloatingPoint&&testexprdouble { testexprdouble 17976931348623165[string repeat 0 292] } {This is a result: Inf} test expr-old-37.25 {Tcl_ExprDouble and NaN} \ {ieeeFloatingPoint testexprdouble} { list [catch {testexprdouble 0.0/0.0} result] $result } {1 {domain error: argument not in valid range}} test expr-old-38.1 {Verify Tcl_ExprString's basic operation} -constraints {testexprstring} -body { list [testexprstring "1+4"] [testexprstring "2*3+4.2"] \ [catch {testexprstring "1+"} msg] $msg } -match glob -result {5 10.2 1 *} test expr-old-38.2 {Tcl_ExprString} testexprstring { # This one is "magical" testexprstring {} } 0 test expr-old-38.3 {Tcl_ExprString} -constraints testexprstring -body { testexprstring { } } -returnCodes error -match glob -result * # # Test for bug #908375: rounding numbers that do not fit in a # long but do fit in a wide # test expr-old-39.1 {Rounding with wide result} { set x 1.0e10 set y [expr $x + 0.1] catch { set x [list [expr {$x == round($y)}] [expr $x == -round(-$y)]] } set x } {1 1} unset -nocomplain x y # # TIP #255 min and max math functions # test expr-old-40.1 {min math function} -body { expr {min(0)} } -result 0 test expr-old-40.2 {min math function} -body { expr {min(0.0)} } -result 0.0 test expr-old-40.3 {min math function} -body { expr {min()} } -returnCodes error -result {not enough arguments for math function "min"} test expr-old-40.4 {min math function} -body { expr {min(wide(-1) << 30, 4.5, -10)} } -result [expr {wide(-1) << 30}] test expr-old-40.5 {min math function} -body { expr {min("a", 0)} } -returnCodes error -match glob -result * test expr-old-40.6 {min math function} -body { expr {min(300, "0xFF")} } -result 255 test expr-old-40.7 {min math function} -body { expr min(1[string repeat 0 10000], 1e300) } -result 1e+300 test expr-old-40.8 {min math function} -body { expr {min(0, "a")} } -returnCodes error -match glob -result * test expr-old-41.1 {max math function} -body { expr {max(0)} } -result 0 test expr-old-41.2 {max math function} -body { expr {max(0.0)} } -result 0.0 test expr-old-41.3 {max math function} -body { expr {max()} } -returnCodes error -result {not enough arguments for math function "max"} test expr-old-41.4 {max math function} -body { expr {max(wide(1) << 30, 4.5, -10)} } -result [expr {wide(1) << 30}] test expr-old-41.5 {max math function} -body { expr {max("a", 0)} } -returnCodes error -match glob -result * test expr-old-41.6 {max math function} -body { expr {max(200, "0xFF")} } -result 255 test expr-old-41.7 {max math function} -body { expr max(1[string repeat 0 10000], 1e300) } -result 1[string repeat 0 10000] test expr-old-41.8 {max math function} -body { expr {max(0, "a")} } -returnCodes error -match glob -result * # Special test for Pentium arithmetic bug of 1994: if {(4195835.0 - (4195835.0/3145727.0)*3145727.0) == 256.0} { puts "Warning: this machine contains a defective Pentium processor" puts "that performs arithmetic incorrectly. I recommend that you" puts "call Intel customer service immediately at 1-800-628-8686" puts "to request a replacement processor." } # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/execute.test0000644000175000017500000010736315104661341015266 0ustar sergeisergei# This file contains tests for the tclExecute.c source file. Tests appear in # the same order as the C code that they test. The set of tests is currently # incomplete since it currently includes only new tests for code changed for # the addition of Tcl namespaces. Other execution-related tests appear in # several other test files including namespace.test, basic.test, eval.test, # for.test, etc. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename foo ""} catch {unset x} catch {unset y} catch {unset msg} testConstraint testobj [expr { [llength [info commands testobj]] && [llength [info commands testdoubleobj]] && [llength [info commands teststringobj]] }] testConstraint testexprlongobj [llength [info commands testexprlongobj]] if {[namespace which -command testbumpinterpepoch] eq ""} { proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set } } # Tests for the omnibus TclExecuteByteCode function: # INST_DONE not tested # INST_PUSH1 not tested # INST_PUSH4 not tested # INST_POP not tested # INST_DUP not tested # INST_INVOKE_STK4 not tested # INST_INVOKE_STK1 not tested # INST_EVAL_STK not tested # INST_EXPR_STK not tested # INST_LOAD_SCALAR1 test execute-1.1 {TclExecuteByteCode, INST_LOAD_SCALAR1, small opnd} { proc foo {} { set x 1 return $x } foo } 1 test execute-1.2 {TclExecuteByteCode, INST_LOAD_SCALAR1, large opnd} { # Bug: 2243 set body {} for {set i 0} {$i < 129} {incr i} { append body "set x$i x\n" } append body { set y 1 return $y } proc foo {} $body foo } 1 test execute-1.3 {TclExecuteByteCode, INST_LOAD_SCALAR1, error} { proc foo {} { set x 1 unset x return $x } list [catch {foo} msg] $msg } {1 {can't read "x": no such variable}} # INST_LOAD_SCALAR4 test execute-2.1 {TclExecuteByteCode, INST_LOAD_SCALAR4, simple case} { set body {} for {set i 0} {$i < 256} {incr i} { append body "set x$i x\n" } append body { set y 1 return $y } proc foo {} $body foo } 1 test execute-2.2 {TclExecuteByteCode, INST_LOAD_SCALAR4, error} { set body {} for {set i 0} {$i < 256} {incr i} { append body "set x$i x\n" } append body { set y 1 unset y return $y } proc foo {} $body list [catch {foo} msg] $msg } {1 {can't read "y": no such variable}} # INST_LOAD_SCALAR_STK not tested # INST_LOAD_ARRAY4 not tested # INST_LOAD_ARRAY1 not tested # INST_LOAD_ARRAY_STK not tested # INST_LOAD_STK not tested # INST_STORE_SCALAR4 not tested # INST_STORE_SCALAR1 not tested # INST_STORE_SCALAR_STK not tested # INST_STORE_ARRAY4 not tested # INST_STORE_ARRAY1 not tested # INST_STORE_ARRAY_STK not tested # INST_STORE_STK not tested # INST_INCR_SCALAR1 not tested # INST_INCR_SCALAR_STK not tested # INST_INCR_STK not tested # INST_INCR_ARRAY1 not tested # INST_INCR_ARRAY_STK not tested # INST_INCR_SCALAR1_IMM not tested # INST_INCR_SCALAR_STK_IMM not tested # INST_INCR_STK_IMM not tested # INST_INCR_ARRAY1_IMM not tested # INST_INCR_ARRAY_STK_IMM not tested # INST_JUMP1 not tested # INST_JUMP4 not tested # INST_JUMP_TRUE4 not tested # INST_JUMP_TRUE1 not tested # INST_JUMP_FALSE4 not tested # INST_JUMP_FALSE1 not tested # INST_LOR not tested # INST_LAND not tested # INST_EQ not tested # INST_NEQ not tested # INST_LT not tested # INST_GT not tested # INST_LE not tested # INST_GE not tested # INST_MOD not tested # INST_LSHIFT not tested # INST_RSHIFT not tested # INST_BITOR not tested # INST_BITXOR not tested # INST_BITAND not tested # INST_ADD is partially tested: test execute-3.1 {TclExecuteByteCode, INST_ADD, op1 is int} {testobj} { set x [testintobj set 0 1] expr {$x + 1} } 2 test execute-3.2 {TclExecuteByteCode, INST_ADD, op1 is double} {testobj} { set x [testdoubleobj set 0 1] expr {$x + 1} } 2.0 test execute-3.3 {TclExecuteByteCode, INST_ADD, op1 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {$x + 1} } 2 test execute-3.4 {TclExecuteByteCode, INST_ADD, op1 is string int} {testobj} { set x [teststringobj set 0 1] expr {$x + 1} } 2 test execute-3.5 {TclExecuteByteCode, INST_ADD, op1 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {$x + 1} } 2.0 test execute-3.6 {TclExecuteByteCode, INST_ADD, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x + 1}} msg] $msg } {1 {cannot use non-numeric string "foo" as left operand of "+"}} test execute-3.7 {TclExecuteByteCode, INST_ADD, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 + $x} } 2 test execute-3.8 {TclExecuteByteCode, INST_ADD, op2 is double} {testobj} { set x [testdoubleobj set 0 1] expr {1 + $x} } 2.0 test execute-3.9 {TclExecuteByteCode, INST_ADD, op2 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {1 + $x} } 2 test execute-3.10 {TclExecuteByteCode, INST_ADD, op2 is string int} {testobj} { set x [teststringobj set 0 1] expr {1 + $x} } 2 test execute-3.11 {TclExecuteByteCode, INST_ADD, op2 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {1 + $x} } 2.0 test execute-3.12 {TclExecuteByteCode, INST_ADD, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 + $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as right operand of "+"}} # INST_SUB is partially tested: test execute-3.13 {TclExecuteByteCode, INST_SUB, op1 is int} {testobj} { set x [testintobj set 0 1] expr {$x - 1} } 0 test execute-3.14 {TclExecuteByteCode, INST_SUB, op1 is double} {testobj} { set x [testdoubleobj set 0 1] expr {$x - 1} } 0.0 test execute-3.15 {TclExecuteByteCode, INST_SUB, op1 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {$x - 1} } 0 test execute-3.16 {TclExecuteByteCode, INST_SUB, op1 is string int} {testobj} { set x [teststringobj set 0 1] expr {$x - 1} } 0 test execute-3.17 {TclExecuteByteCode, INST_SUB, op1 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {$x - 1} } 0.0 test execute-3.18 {TclExecuteByteCode, INST_SUB, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x - 1}} msg] $msg } {1 {cannot use non-numeric string "foo" as left operand of "-"}} test execute-3.19 {TclExecuteByteCode, INST_SUB, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 - $x} } 0 test execute-3.20 {TclExecuteByteCode, INST_SUB, op2 is double} {testobj} { set x [testdoubleobj set 0 1] expr {1 - $x} } 0.0 test execute-3.21 {TclExecuteByteCode, INST_SUB, op2 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {1 - $x} } 0 test execute-3.22 {TclExecuteByteCode, INST_SUB, op2 is string int} {testobj} { set x [teststringobj set 0 1] expr {1 - $x} } 0 test execute-3.23 {TclExecuteByteCode, INST_SUB, op2 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {1 - $x} } 0.0 test execute-3.24 {TclExecuteByteCode, INST_SUB, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 - $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as right operand of "-"}} # INST_MULT is partially tested: test execute-3.25 {TclExecuteByteCode, INST_MULT, op1 is int} {testobj} { set x [testintobj set 1 1] expr {$x * 1} } 1 test execute-3.26 {TclExecuteByteCode, INST_MULT, op1 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {$x * 1} } 2.0 test execute-3.27 {TclExecuteByteCode, INST_MULT, op1 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {$x * 1} } 2 test execute-3.28 {TclExecuteByteCode, INST_MULT, op1 is string int} {testobj} { set x [teststringobj set 1 1] expr {$x * 1} } 1 test execute-3.29 {TclExecuteByteCode, INST_MULT, op1 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x * 1} } 1.0 test execute-3.30 {TclExecuteByteCode, INST_MULT, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x * 1}} msg] $msg } {1 {cannot use non-numeric string "foo" as left operand of "*"}} test execute-3.31 {TclExecuteByteCode, INST_MULT, op2 is int} {testobj} { set x [testintobj set 1 1] expr {1 * $x} } 1 test execute-3.32 {TclExecuteByteCode, INST_MULT, op2 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {1 * $x} } 2.0 test execute-3.33 {TclExecuteByteCode, INST_MULT, op2 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {1 * $x} } 2 test execute-3.34 {TclExecuteByteCode, INST_MULT, op2 is string int} {testobj} { set x [teststringobj set 1 1] expr {1 * $x} } 1 test execute-3.35 {TclExecuteByteCode, INST_MULT, op2 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {1 * $x} } 1.0 test execute-3.36 {TclExecuteByteCode, INST_MULT, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 * $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as right operand of "*"}} # INST_DIV is partially tested: test execute-3.37 {TclExecuteByteCode, INST_DIV, op1 is int} {testobj} { set x [testintobj set 1 1] expr {$x / 1} } 1 test execute-3.38 {TclExecuteByteCode, INST_DIV, op1 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {$x / 1} } 2.0 test execute-3.39 {TclExecuteByteCode, INST_DIV, op1 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {$x / 1} } 2 test execute-3.40 {TclExecuteByteCode, INST_DIV, op1 is string int} {testobj} { set x [teststringobj set 1 1] expr {$x / 1} } 1 test execute-3.41 {TclExecuteByteCode, INST_DIV, op1 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x / 1} } 1.0 test execute-3.42 {TclExecuteByteCode, INST_DIV, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x / 1}} msg] $msg } {1 {cannot use non-numeric string "foo" as left operand of "/"}} test execute-3.43 {TclExecuteByteCode, INST_DIV, op2 is int} {testobj} { set x [testintobj set 1 1] expr {2 / $x} } 2 test execute-3.44 {TclExecuteByteCode, INST_DIV, op2 is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {2 / $x} } 2.0 test execute-3.45 {TclExecuteByteCode, INST_DIV, op2 is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {2 / $x} } 2 test execute-3.46 {TclExecuteByteCode, INST_DIV, op2 is string int} {testobj} { set x [teststringobj set 1 1] expr {2 / $x} } 2 test execute-3.47 {TclExecuteByteCode, INST_DIV, op2 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {2 / $x} } 2.0 test execute-3.48 {TclExecuteByteCode, INST_DIV, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 / $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as right operand of "/"}} # INST_UPLUS is partially tested: test execute-3.49 {TclExecuteByteCode, INST_UPLUS, op is int} {testobj} { set x [testintobj set 1 1] expr {+ $x} } 1 test execute-3.50 {TclExecuteByteCode, INST_UPLUS, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {+ $x} } 1.0 test execute-3.51 {TclExecuteByteCode, INST_UPLUS, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {+ $x} } 1 test execute-3.52 {TclExecuteByteCode, INST_UPLUS, op is string int} {testobj} { set x [teststringobj set 1 1] expr {+ $x} } 1 test execute-3.53 {TclExecuteByteCode, INST_UPLUS, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {+ $x} } 1.0 test execute-3.54 {TclExecuteByteCode, INST_UPLUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {+ $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as operand of "+"}} # INST_UMINUS is partially tested: test execute-3.55 {TclExecuteByteCode, INST_UMINUS, op is int} {testobj} { set x [testintobj set 1 1] expr {- $x} } -1 test execute-3.56 {TclExecuteByteCode, INST_UMINUS, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {- $x} } -1.0 test execute-3.57 {TclExecuteByteCode, INST_UMINUS, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {- $x} } -1 test execute-3.58 {TclExecuteByteCode, INST_UMINUS, op is string int} {testobj} { set x [teststringobj set 1 1] expr {- $x} } -1 test execute-3.59 {TclExecuteByteCode, INST_UMINUS, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {- $x} } -1.0 test execute-3.60 {TclExecuteByteCode, INST_UMINUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {- $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as operand of "-"}} # INST_LNOT is partially tested: test execute-3.61 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { set x [testintobj set 1 2] expr {! $x} } 0 test execute-3.62 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { set x [testintobj set 1 0] expr {! $x} } 1 test execute-3.63 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {! $x} } 0 test execute-3.64 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { set x [testdoubleobj set 1 0.0] expr {! $x} } 1 test execute-3.65 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {! $x} } 0 test execute-3.66 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { set x [testintobj set 1 0] testobj convert 1 double expr {! $x} } 1 test execute-3.67 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { set x [teststringobj set 1 1] expr {! $x} } 0 test execute-3.68 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { set x [teststringobj set 1 0] expr {! $x} } 1 test execute-3.69 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {! $x} } 0 test execute-3.70 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { set x [teststringobj set 1 0.0] expr {! $x} } 1 test execute-3.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {! $x}} msg] $msg } {1 {cannot use non-numeric string "foo" as operand of "!"}} # INST_TRY_CVT_TO_NUMERIC is partially tested: test execute-3.72 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is int} {testobj} { set x [testintobj set 1 1] expr {$x} } 1 test execute-3.73 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {$x} } 1.0 test execute-3.74 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {$x} } 1 test execute-3.75 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string int} {testobj} { set x [teststringobj set 1 1] expr {$x} } 1 test execute-3.76 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x} } 1.0 test execute-3.77 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] expr {$x} } foo # INST_BREAK not tested # INST_CONTINUE not tested # INST_FOREACH_START4 not tested # INST_FOREACH_STEP4 not tested # INST_BEGIN_CATCH4 not tested # INST_END_CATCH not tested # INST_PUSH_RESULT not tested # INST_PUSH_RETURN_CODE not tested test execute-4.1 {Tcl_GetCommandFromObj, convert to tclCmdNameType} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} unset -nocomplain x unset -nocomplain y } -body { namespace eval test_ns_1 { namespace export cmd1 proc cmd1 {args} {return "cmd1: $args"} proc cmd2 {args} {return "cmd2: $args"} } namespace eval test_ns_1::test_ns_2 { namespace import ::test_ns_1::* } set x "test_ns_1::" set y "test_ns_2::" list [namespace which -command ${x}${y}cmd1] \ [catch {namespace which -command ${x}${y}cmd2} msg] $msg \ [catch {namespace which -command ${x}${y}:cmd2} msg] $msg } -result {::test_ns_1::test_ns_2::cmd1 0 {} 0 {}} test execute-4.2 {Tcl_GetCommandFromObj, check if cached tclCmdNameType is invalid} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename foo ""} unset -nocomplain l } -body { proc foo {} { return "global foo" } namespace eval test_ns_1 { proc whichFoo {} { return [namespace which -command foo] } } set l "" lappend l [test_ns_1::whichFoo] namespace eval test_ns_1 { proc foo {} { return "namespace foo" } } lappend l [test_ns_1::whichFoo] } -result {::foo ::test_ns_1::foo} test execute-4.3 {Tcl_GetCommandFromObj, command never found} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename foo ""} } -body { namespace eval test_ns_1 { proc foo {} { return "namespace foo" } } namespace eval test_ns_1 { proc foo {} { return "namespace foo" } } list [namespace eval test_ns_1 {namespace which -command foo}] \ [rename test_ns_1::foo ""] \ [catch {namespace eval test_ns_1 {namespace which -command foo}} msg] $msg } -result {::test_ns_1::foo {} 0 {}} test execute-5.1 {SetCmdNameFromAny, set cmd name to empty heap string if NULL} -setup { catch {namespace delete {*}[namespace children :: test_ns_*]} unset -nocomplain l } -body { proc {} {} {return {}} {} set l {} lindex {} 0 {} } -result {} test execute-6.1 {UpdateStringOfCmdName: called for duplicate of empty cmdName object} { proc {} {} {} proc { } {} {} proc p {} { set x {} $x append x { } $x } p } {} test execute-6.2 {Evaluate an expression in a variable; compile the first time, do not the second} { set w {3*5} proc a {obj} {expr $obj} set res "[a $w]:[a $w]" } {15:15} test execute-6.3 {Tcl_ExprObj: don't use cached script bytecode [Bug 1899164]} -setup { proc 0+0 {} {return SCRIPT} } -body { set e { 0+0 } if 1 $e if 1 {expr $e} } -cleanup { rename 0+0 {} } -result 0 test execute-6.4 {TclCompEvalObj: don't use cached expr bytecode [Bug 1899164]} -setup { proc 0+0 {} {return SCRIPT} } -body { set e { 0+0 } if 1 {expr $e} if 1 $e } -cleanup { rename 0+0 {} } -result SCRIPT test execute-6.5 {TclCompEvalObj: bytecode epoch validation} -body { set script { llength {} } set result {} lappend result [if 1 $script] set origName [namespace which llength] rename $origName llength.orig proc $origName {args} {return AHA!} lappend result [if 1 $script] } -cleanup { rename $origName {} rename llength.orig $origName } -result {0 AHA!} test execute-6.6 {TclCompEvalObj: proc-body bytecode invalid for script} -body { proc foo {} {set a 1} set a untouched set result {} lappend result [foo] $a lappend result [if 1 [info body foo]] $a } -cleanup { rename foo {} } -result {1 untouched 1 1} test execute-6.7 {TclCompEvalObj: bytecode context validation} -setup { namespace eval foo {} } -body { set script { llength {} } namespace eval foo { proc llength {args} {return AHA!} } set result {} lappend result [if 1 $script] lappend result [namespace eval foo $script] } -cleanup { namespace delete foo } -result {0 AHA!} test execute-6.8 {TclCompEvalObj: bytecode name resolution epoch validation} -setup { namespace eval foo {} } -body { set script { llength {} } set result {} lappend result [namespace eval foo $script] namespace eval foo { proc llength {args} {return AHA!} } lappend result [namespace eval foo $script] } -cleanup { namespace delete foo } -result {0 AHA!} test execute-6.9 {TclCompEvalObj: bytecode interp validation} -setup { interp create child } -body { set script { llength {} } child eval {proc llength args {return AHA!}} set result {} lappend result [if 1 $script] lappend result [child eval $script] } -cleanup { interp delete child } -result {0 AHA!} test execute-6.10 {TclCompEvalObj: bytecode interp validation} -body { set script { llength {} } interp create child set result {} lappend result [child eval $script] interp delete child interp create child lappend result [child eval $script] } -cleanup { catch {interp delete child} } -result {0 0} test execute-6.11 {Tcl_ExprObj: exprcode interp validation} -setup { interp create child } -constraints testexprlongobj -body { set e { [llength {}]+1 } set result {} load {} Tcltest child interp alias {} e child testexprlongobj lappend result [e $e] interp delete child interp create child load {} Tcltest child interp alias {} e child testexprlongobj lappend result [e $e] } -cleanup { interp delete child } -result {{This is a result: 1} {This is a result: 1}} test execute-6.12 {Tcl_ExprObj: exprcode interp validation} -setup { interp create child } -body { set e { [llength {}]+1 } set result {} interp alias {} e child expr lappend result [e $e] interp delete child interp create child interp alias {} e child expr lappend result [e $e] } -cleanup { interp delete child } -result {1 1} test execute-6.13 {Tcl_ExprObj: exprcode epoch validation} -body { set e { [llength {}]+1 } set result {} lappend result [expr $e] set origName [namespace which llength] rename $origName llength.orig proc $origName {args} {return 1} lappend result [expr $e] } -cleanup { rename $origName {} rename llength.orig $origName } -result {1 2} test execute-6.14 {Tcl_ExprObj: exprcode context validation} -setup { namespace eval foo {} } -body { set e { [llength {}]+1 } namespace eval foo { proc llength {args} {return 1} } set result {} lappend result [expr $e] lappend result [namespace eval foo [list expr $e]] } -cleanup { namespace delete foo } -result {1 2} test execute-6.15 {Tcl_ExprObj: exprcode name resolution epoch validation} -setup { namespace eval foo {} } -body { set e { [llength {}]+1 } set result {} lappend result [namespace eval foo [list expr $e]] namespace eval foo { proc llength {args} {return 1} } lappend result [namespace eval foo [list expr $e]] } -cleanup { namespace delete foo } -result {1 2} test execute-6.16 {Tcl_ExprObj: exprcode interp validation} -setup { interp create child } -body { set e { [llength {}]+1 } interp alias {} e child expr child eval {proc llength args {return 1}} set result {} lappend result [expr $e] lappend result [e $e] } -cleanup { interp delete child } -result {1 2} test execute-6.17 {Tcl_ExprObj: exprcode context validation} -body { proc foo e {set v 0; expr $e} proc bar e {set v 1; expr $e} set e { $v } set result {} lappend result [foo $e] lappend result [bar $e] } -cleanup { rename foo {} rename bar {} } -result {0 1} test execute-6.18 {Tcl_ExprObj: exprcode context validation} -body { proc foo e {set v {}; expr $e} proc bar e {set v v; expr $e} set e { [llength $v] } set result {} lappend result [foo $e] lappend result [bar $e] } -cleanup { rename foo {} rename bar {} } -result {0 1} test execute-7.0 {Wide int handling in INST_JUMP_FALSE/LAND} { set x 0x100000000 expr {$x && 1} } 1 test execute-7.1 {Wide int handling in INST_JUMP_FALSE/LAND} { expr {0x100000000 && 1} } 1 test execute-7.2 {Wide int handling in INST_JUMP_FALSE/LAND} { expr {1 && 0x100000000} } 1 test execute-7.3 {Wide int handling in INST_JUMP_FALSE/LAND} { expr {wide(0x100000000) && 1} } 1 test execute-7.4 {Wide int handling in INST_JUMP_FALSE/LAND} { expr {1 && wide(0x100000000)} } 1 test execute-7.5 {Wide int handling in INST_EQ} { expr {4 == (wide(1)+wide(3))} } 1 test execute-7.6 {Wide int handling in INST_EQ and [incr]} { set x 399999999999 expr {400000000000 == [incr x]} } 1 # wide ints have more bits of precision than doubles, but we convert anyway test execute-7.7 {Wide int handling in INST_EQ and [incr]} { set x [expr {wide(1)<<62}] set y [expr {$x+1}] expr {double($x) == double($y)} } 1 test execute-7.8 {Wide int conversions can change sign} { set x 0x8000000000000000 expr {wide($x) < 0} } 1 test execute-7.9 {Wide int handling in INST_MOD} { expr {(wide(1)<<60) % ((wide(47)<<45)-1)} } 316659348800185 test execute-7.10 {Wide int handling in INST_MOD} { expr {((wide(1)<<60)-1) % 0x400000000} } 17179869183 test execute-7.11 {Wide int handling in INST_LSHIFT} { expr {wide(42) << 30} } 45097156608 test execute-7.12 {Wide int handling in INST_LSHIFT} { expr {12345678901 << 3} } 98765431208 test execute-7.13 {Wide int handling in INST_RSHIFT} { expr {0x543210febcda9876 >> 7} } 47397893236700464 test execute-7.14 {Wide int handling in INST_RSHIFT} { expr {wide(0x9876543210febcda) >> 7} } -58286587177206407 test execute-7.15 {Wide int handling in INST_BITOR} { expr {wide(0x9876543210febcda) | 0x543210febcda9876} } -2560765885044310786 test execute-7.16 {Wide int handling in INST_BITXOR} { expr {wide(0x9876543210febcda) ^ 0x543210febcda9876} } -3727778945703861076 test execute-7.17 {Wide int handling in INST_BITAND} { expr {wide(0x9876543210febcda) & 0x543210febcda9876} } 1167013060659550290 test execute-7.18 {Wide int handling in INST_ADD} { expr {wide(0x7fffffff) + wide(0x7fffffff)} } 4294967294 test execute-7.19 {Wide int handling in INST_ADD} { expr {0x7fffffff + wide(0x7fffffff)} } 4294967294 test execute-7.20 {Wide int handling in INST_ADD} { expr {wide(0x7fffffff) + 0x7fffffff} } 4294967294 test execute-7.21 {Wide int handling in INST_ADD} { expr {double(0x7fffffff) + wide(0x7fffffff)} } 4294967294.0 test execute-7.22 {Wide int handling in INST_ADD} { expr {wide(0x7fffffff) + double(0x7fffffff)} } 4294967294.0 test execute-7.23 {Wide int handling in INST_SUB} { expr {0x123456789a - 0x20406080a} } 69530054800 test execute-7.24 {Wide int handling in INST_MULT} { expr {0x123456789a * 193} } 15090186251290 test execute-7.25 {Wide int handling in INST_DIV} { expr {0x123456789a / 193} } 405116546 test execute-7.26 {Wide int handling in INST_UPLUS} { set x 0x123456871234568 expr {+ $x} } 81985533099853160 test execute-7.27 {Wide int handling in INST_UMINUS} { set x 0x123456871234568 expr {- $x} } -81985533099853160 test execute-7.28 {Wide int handling in INST_LNOT} { set x 0x123456871234568 expr {! $x} } 0 test execute-7.29 {Wide int handling in INST_BITNOT} { set x 0x123456871234568 expr {~ $x} } -81985533099853161 test execute-7.30 {Wide int handling in function call} { set x 0x12345687123456 incr x expr {log($x) == log(double($x))} } 1 test execute-7.31 {Wide int handling in abs()} { set x 0xa23456871234568 incr x set y 0x123456871234568 concat [expr {abs($x)}] [expr {abs($y)}] } {730503879441204585 81985533099853160} test execute-7.32 {Wide int handling} { expr {int(1024 * 1024 * 1024 * 1024)} } 1099511627776 test execute-7.33 {Wide int handling} { expr {int(0x1 * 1024 * 1024 * 1024 * 1024)} } 1099511627776 test execute-7.34 {Wide int handling} { expr {wide(0x1) * 1024 * 1024 * 1024 * 1024} } 1099511627776 test execute-8.1 {Stack protection} -setup { # If [Bug #804681] has not been properly taken care of, this should # segfault proc whatever args {llength $args} trace add variable ::errorInfo {write unset} whatever } -body { expr {1+9/0} } -cleanup { trace remove variable ::errorInfo {write unset} whatever rename whatever {} } -returnCodes error -match glob -result * test execute-8.2 {Stack restoration} -setup { # Avoid crashes when system stack size is limited (thread-enabled!) set limit [interp recursionlimit {}] interp recursionlimit {} 100 } -body { # Test for [Bug #816641], correct restoration of the stack top after the # stack is grown proc f {args} { f bee bop } catch f msg set msg } -cleanup { interp recursionlimit {} $limit } -result {too many nested evaluations (infinite loop?)} test execute-8.3 {Stack restoration} -setup { # Avoid crashes when system stack size is limited (thread-enabled!) set limit [interp recursionlimit {}] interp recursionlimit {} 100 } -body { # Test for [Bug #1055676], correct restoration of the stack top after the # epoch is bumped and the stack is grown in a call from a nested # evaluation set arglst [string repeat "a " 1000] proc f {args} "f $arglst" proc run {} { # bump the interp's epoch testbumpinterpepoch catch f msg set msg } run } -cleanup { interp recursionlimit {} $limit } -result {too many nested evaluations (infinite loop?)} test execute-8.4 {Compile epoch bump effect on stack trace} -setup { proc foo {} { error bar } proc FOO {} { catch {error bar} m o testbumpinterpepoch return -options $o $m } } -body { catch foo m o set stack1 [dict get $o -errorinfo] catch FOO m o set stack2 [string map {FOO foo} [dict get $o -errorinfo]] expr {$stack1 eq $stack2 ? {} : "These differ:\n$stack1\n$stack2"} } -cleanup { rename foo {} rename FOO {} unset -nocomplain m o stack1 stack2 } -result {} test execute-8.5 {Bug 2038069} -setup { proc demo {} { catch [list error FOO] m o return $o } } -body { demo } -cleanup { rename demo {} } -match glob -result {-code 1 -level 0 -errorstack * -errorcode NONE -errorinfo {FOO while executing "error FOO" invoked from within "catch \[list error FOO\] m o"} -errorline 2} test execute-8.6 {Compile epoch bump in global level (bug [fa6bf38d07])} -setup { interp create child child eval { package require tcltest 2.5 catch [list package require -exact tcl::test [info patchlevel]] ::tcltest::loadTestedCommands if {[namespace which -command testbumpinterpepoch] eq ""} { proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set } } } } -body { child eval { lappend res A; testbumpinterpepoch; lappend res B; return; lappend res C; } child eval { set i 0; while {[incr i] < 3} { lappend res A; testbumpinterpepoch; lappend res B; return; lappend res C; } } child eval { set i 0; while {[incr i] < 3} { lappend res A; testbumpinterpepoch; lappend res B; break; lappend res C; } } child eval { catch { lappend res A; testbumpinterpepoch; lappend res B; error test; lappend res C; } } child eval {set res} } -cleanup { interp delete child } -result [lrepeat 4 A B] test execute-8.7 {Compile epoch bump in global level (bug [fa6bf38d07]), exception case} -setup { interp create child child eval { package require tcltest 2.5 catch [list package require -exact tcl::test [info patchlevel]] ::tcltest::loadTestedCommands if {[namespace which -command testbumpinterpepoch] eq ""} { proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set } } } } -body { set res {} lappend res [catch { child eval { lappend res A; testbumpinterpepoch; lappend res B; return -code error test; lappend res C; } } e] $e lappend res [catch { child eval { lappend res A; testbumpinterpepoch; lappend res B; error test; lappend res C; } } e] $e lappend res [catch { child eval { lappend res A; testbumpinterpepoch; lappend res B; return -code return test; lappend res C; } } e] $e lappend res [catch { child eval { lappend res A; testbumpinterpepoch; lappend res B; break; lappend res C; } } e] $e list $res [child eval {set res}] } -cleanup { interp delete child } -result [list {1 test 1 test 2 test 3 {}} [lrepeat 4 A B]] test execute-9.1 {Interp result resetting [Bug 1522803]} { set c 0 catch { catch {error foo} expr {1/$c} } if {[string match *foo* $::errorInfo]} { set result "Bad errorInfo: $::errorInfo" } else { set result SUCCESS } set result } SUCCESS test execute-10.1 {TclExecuteByteCode, INST_CONCAT1, bytearrays} { apply {s {binary scan [binary format a $s] c x; list $x [scan $s$s %c%c]}} İ } {48 {304 304}} test execute-10.2 {Bug 2802881} -setup { interp create child } -body { # If [Bug 2802881] is not fixed, this will segfault child eval { trace add variable ::errorInfo write {expr {$foo} ;#} proc demo {} {a {}{}} demo } } -cleanup { interp delete child } -returnCodes error -match glob -result * test execute-10.3 {Bug 3072640} -setup { proc generate {n} { for {set i 0} {$i < $n} {incr i} { yield $i } } proc t {args} { incr ::foo } set ::foo 0 trace add execution ::generate enterstep ::t } -body { coroutine coro generate 5 trace remove execution ::generate enterstep ::t set ::foo } -cleanup { unset ::foo rename generate {} rename t {} rename coro {} } -result 4 test execute-11.1 {Bug 3142026: GrowEvaluationStack off-by-one} -setup { interp create child } -body { child eval { set x [lrepeat 1320 199] for {set i 0} {$i < 20} {incr i} { lappend x $i lsort -integer $x } # Crashes on failure return ok } } -cleanup { interp delete child } -result ok test execute-11.2 {Bug 268b23df11} -setup { proc zero {} {return 0} proc crash {} {expr {abs([zero])}} proc noop args {} trace add execution crash enterstep noop } -body { crash } -cleanup { trace remove execution crash enterstep noop rename noop {} rename crash {} rename zero {} } -result 0 test execute-11.3 {Bug a0ece9d6d4} -setup { proc crash {} {expr {rand()}} trace add execution crash enterstep {apply {args {info frame -2}}} } -body { string is double [crash] } -cleanup { trace remove execution crash enterstep {apply {args {info frame -2}}} rename crash {} } -result 1 test execute-12.1 {failing multi-lappend to unshared} -setup { unset -nocomplain x y } -body { set x 1 lappend x 2 3 trace add variable x write {apply {args {error boo}}} lappend x 4 5 } -cleanup { unset -nocomplain x y } -returnCodes error -result {can't set "x": boo} test execute-12.2 {failing multi-lappend to shared} -setup { unset -nocomplain x y } -body { set x 1 lappend x 2 3 set y $x trace add variable x write {apply {args {error boo}}} lappend x 4 5 } -cleanup { unset -nocomplain x y } -returnCodes error -result {can't set "x": boo} test execute-12.3 {failing multi-lappend to unshared: LVT} -body { apply {{} { set x 1 lappend x 2 3 trace add variable x write {apply {args {error boo}}} lappend x 4 5 }} } -returnCodes error -result {can't set "x": boo} test execute-12.4 {failing multi-lappend to shared: LVT} -body { apply {{} { set x 1 lappend x 2 3 set y $x trace add variable x write {apply {args {error boo}}} lappend x 4 5 }} } -returnCodes error -result {can't set "x": boo} # cleanup if {[info commands testobj] != {}} { testobj freeallvars } catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename foo ""} catch {rename p ""} catch {rename {} ""} catch {rename { } ""} catch {unset x} catch {unset y} catch {unset msg} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/exec.test0000644000175000017500000010075615104661341014547 0ustar sergeisergei# Commands covered: exec # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # There is no point in running Valgrind on cases where [exec] forks but then # fails and the child process doesn't go through full cleanup. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] # Some skips when running in a macOS CI environment testConstraint noosxCI [expr {![info exists ::env(MAC_CI)]}] # Need a App Exec Alias for testing exec of reparse points, # according to MS, winget can only be used on servers with an installed desktop interface, # no idea how to check it in GHA programmatically, so simply disable it (todo: rewrite with better check later) if {[testConstraint win] && ![info exists ::env(CI)] && [info exists ::env(LOCALAPPDATA)] && [auto_execok winget] ne {}} { testConstraint haveWinget 1 } testConstraint testhandlecount [expr {[llength [info commands testhandlecount]] != 0}] unset -nocomplain path # Utilities that are like Bourne shell stalwarts, but cross-platform. set path(echo) [makeFile { puts -nonewline [lindex $argv 0] foreach str [lrange $argv 1 end] { puts -nonewline " $str" } puts {} exit } echo] set path(echo2) [makeFile { puts stdout [join $argv] puts stderr [lindex $argv 1] exit } echo2] set path(echobin) [makeFile { fconfigure stdout -translation binary puts -nonewline [binary decode hex [join $argv ""]] exit } echobin] set path(cat) [makeFile { if {$argv eq ""} { set argv - } fconfigure stdout -translation binary foreach name $argv { if {$name eq "-"} { set f stdin } elseif {[catch {open $name r} f] != 0} { puts stderr $f continue } fconfigure $f -translation binary while {[eof $f] == 0} { puts -nonewline [read $f] } if {$f ne "stdin"} { close $f } } exit } cat] set path(wc) [makeFile { set data [read stdin] set lines [regsub -all "\n" $data {} dummy] set words [regsub -all "\[^ \t\n]+" $data {} dummy] set chars [string length $data] puts [format "%8.d%8.d%8.d" $lines $words $chars] exit } wc] set path(sh) [makeFile { if {[lindex $argv 0] ne "-c"} { error "sh: unexpected arguments $argv" } set cmd [lindex $argv 1] lappend cmd ";" set newcmd {} foreach arg $cmd { if {$arg eq ";"} { exec >@stdout 2>@stderr [info nameofexecutable] {*}$newcmd set newcmd {} continue } if {$arg eq "1>&2"} { set arg >@stderr } lappend newcmd $arg } exit } sh] set path(sh2) [makeFile { if {[lindex $argv 0] ne "-c"} { error "sh: unexpected arguments $argv" } set cmd [lindex $argv 1] lappend cmd ";" set newcmd {} foreach arg $cmd { if {$arg eq ";"} { exec -ignorestderr >@stdout [info nameofexecutable] {*}$newcmd set newcmd {} continue } lappend newcmd $arg } exit } sh2] set path(sleep) [makeFile { after [expr {$argv*1000}] exit } sleep] set path(exit) [makeFile { exit $argv } exit] proc readfile filename { set f [open $filename] set d [read $f] close $f return [string trimright $d \n] } # ---------------------------------------------------------------------- # Basic operations. test exec-1.1 {basic exec operation} {exec} { exec [interpreter] $path(echo) a b c } "a b c" test exec-1.2 {pipelining} {exec stdio} { exec [interpreter] $path(echo) a b c d | [interpreter] $path(cat) | [interpreter] $path(cat) } "a b c d" test exec-1.3 {pipelining} {exec stdio} { set a [exec [interpreter] $path(echo) a b c d | [interpreter] $path(cat) | [interpreter] $path(wc)] list [scan $a "%d %d %d" b c d] $b $c } {3 1 4} set arg {12345678901234567890123456789012345678901234567890} set arg "$arg$arg$arg$arg$arg$arg" test exec-1.4 {long command lines} {exec} { exec [interpreter] $path(echo) $arg } $arg set arg {} test exec-1.5 {pipelining - handle leaks} -constraints {exec stdio testhandlecount} -body { set numHandles [testhandlecount] set a [exec [interpreter] $path(echo) a b c d | [interpreter] $path(cat) | [interpreter] $path(wc)] list [scan $a "%d %d %d" b c d] $b $c [expr {[testhandlecount] - $numHandles}] } -result {3 1 4 0} # I/O redirection: input from Tcl command. test exec-2.1 {redirecting input from immediate source} {exec stdio} { exec [interpreter] $path(cat) << "Sample text" } {Sample text} test exec-2.2 {redirecting input from immediate source} {exec stdio} { exec << "Sample text" [interpreter] $path(cat) | [interpreter] $path(cat) } {Sample text} test exec-2.3 {redirecting input from immediate source} {exec stdio} { exec [interpreter] $path(cat) << "Sample text" | [interpreter] $path(cat) } {Sample text} test exec-2.4 {redirecting input from immediate source} {exec stdio} { exec [interpreter] $path(cat) | [interpreter] $path(cat) << "Sample text" } {Sample text} test exec-2.5 {redirecting input from immediate source} {exec} { exec [interpreter] $path(cat) "< external conversion did not occur # before writing out the temp file. quotenonascii [exec [interpreter] $path(cat) << "\xE9\xE0\xFC\xF1"] } -cleanup { encoding system $sysenc rename quotenonascii {} } -result {\xE9\xE0\xFC\xF1} test exec-2.7 {handle count redirecting input from immediate source} -constraints { exec stdio testhandlecount } -body { set numHandles [testhandlecount] list [exec [interpreter] $path(cat) | [interpreter] $path(cat) << "Sample text"] \ [expr {[testhandlecount] - $numHandles}] } -result [list {Sample text} 0] # I/O redirection: output to file. set path(gorp.file) [makeFile {} gorp.file] file delete $path(gorp.file) test exec-3.1 {redirecting output to file} {exec} { exec [interpreter] $path(echo) "Some simple words" > $path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file) } "Some simple words" test exec-3.2 {redirecting output to file} {exec stdio} { exec [interpreter] $path(echo) "More simple words" | >$path(gorp.file) [interpreter] $path(cat) | [interpreter] $path(cat) exec [interpreter] $path(cat) $path(gorp.file) } "More simple words" test exec-3.3 {redirecting output to file} {exec stdio} { exec > $path(gorp.file) [interpreter] $path(echo) "Different simple words" | [interpreter] $path(cat) | [interpreter] $path(cat) exec [interpreter] $path(cat) $path(gorp.file) } "Different simple words" test exec-3.4 {redirecting output to file} {exec} { exec [interpreter] $path(echo) "Some simple words" >$path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file) } "Some simple words" test exec-3.5 {redirecting output to file} {exec} { exec [interpreter] $path(echo) "First line" >$path(gorp.file) exec [interpreter] $path(echo) "Second line" >> $path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file) } "First line\nSecond line" test exec-3.6 {redirecting output to file} {exec} { exec [interpreter] $path(echo) "First line" >$path(gorp.file) exec [interpreter] $path(echo) "Second line" >>$path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file) } "First line\nSecond line" test exec-3.7 {redirecting output to file} {exec} { set f [open $path(gorp.file) w] puts $f "Line 1" flush $f exec [interpreter] $path(echo) "More text" >@ $f exec [interpreter] $path(echo) >@$f "Even more" puts $f "Line 3" close $f exec [interpreter] $path(cat) $path(gorp.file) } "Line 1\nMore text\nEven more\nLine 3" test exec-3.8 {handle count redirecting output to file} -constraints { exec stdio testhandlecount } -body { set numHandles [testhandlecount] exec > $path(gorp.file) [interpreter] $path(echo) "Different simple words" | [interpreter] $path(cat) | [interpreter] $path(cat) list [exec [interpreter] $path(cat) $path(gorp.file)] \ [expr {[testhandlecount] - $numHandles}] } -result [list "Different simple words" 0] # I/O redirection: output and stderr to file. file delete $path(gorp.file) test exec-4.1 {redirecting output and stderr to file} {exec} { exec [interpreter] $path(echo) "test output" >& $path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file) } "test output" test exec-4.2 {redirecting output and stderr to file} {exec} { list [exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" >&$path(gorp.file)] \ [exec [interpreter] $path(cat) $path(gorp.file)] } {{} {foo bar}} test exec-4.3 {redirecting output and stderr to file} {exec} { exec [interpreter] $path(echo) "first line" > $path(gorp.file) list [exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" >>&$path(gorp.file)] \ [exec [interpreter] $path(cat) $path(gorp.file)] } "{} {first line\nfoo bar}" test exec-4.4 {redirecting output and stderr to file} {exec} { set f [open $path(gorp.file) w] puts $f "Line 1" flush $f exec [interpreter] $path(echo) "More text" >&@ $f exec [interpreter] $path(echo) >&@$f "Even more" puts $f "Line 3" close $f exec [interpreter] $path(cat) $path(gorp.file) } "Line 1\nMore text\nEven more\nLine 3" test exec-4.5 {redirecting output and stderr to file} {exec} { set f [open $path(gorp.file) w] puts $f "Line 1" flush $f exec >&@ $f [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" exec >&@$f [interpreter] $path(sh) -c "\"$path(echo)\" xyzzy 1>&2" puts $f "Line 3" close $f exec [interpreter] $path(cat) $path(gorp.file) } "Line 1\nfoo bar\nxyzzy\nLine 3" # I/O redirection: input from file. if {[testConstraint exec]} { exec [interpreter] $path(echo) "Just a few thoughts" > $path(gorp.file) } test exec-5.1 {redirecting input from file} {exec} { exec [interpreter] $path(cat) < $path(gorp.file) } {Just a few thoughts} test exec-5.2 {redirecting input from file} {exec stdio} { exec [interpreter] $path(cat) | [interpreter] $path(cat) < $path(gorp.file) } {Just a few thoughts} test exec-5.3 {redirecting input from file} {exec stdio} { exec [interpreter] $path(cat) < $path(gorp.file) | [interpreter] $path(cat) } {Just a few thoughts} test exec-5.4 {redirecting input from file} {exec stdio} { exec < $path(gorp.file) [interpreter] $path(cat) | [interpreter] $path(cat) } {Just a few thoughts} test exec-5.5 {redirecting input from file} {exec} { exec [interpreter] $path(cat) <$path(gorp.file) } {Just a few thoughts} test exec-5.6 {redirecting input from file} -constraints {exec} -body { set f [open $path(gorp.file) r] exec [interpreter] $path(cat) <@ $f } -cleanup { close $f } -result {Just a few thoughts} test exec-5.7 {redirecting input from file} -constraints {exec} -body { set f [open $path(gorp.file) r] exec <@$f [interpreter] $path(cat) } -cleanup { close $f } -result {Just a few thoughts} test exec-5.8 {handle count redirecting input from file} -constraints { exec stdio testhandlecount } -body { set numHandles [testhandlecount] list [exec [interpreter] $path(cat) | [interpreter] $path(cat) < $path(gorp.file)] \ [expr {[testhandlecount] - $numHandles}] } -result [list {Just a few thoughts} 0] # I/O redirection: standard error through a pipeline. test exec-6.1 {redirecting stderr through a pipeline} {exec stdio} { exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar" |& [interpreter] $path(cat) } "foo bar" test exec-6.2 {redirecting stderr through a pipeline} {exec stdio} { exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" |& [interpreter] $path(cat) } "foo bar" test exec-6.3 {redirecting stderr through a pipeline} {exec stdio} { exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" \ |& [interpreter] $path(sh) -c "\"$path(echo)\" second msg 1>&2 ; \"$path(cat)\"" |& [interpreter] $path(cat) } "second msg\nfoo bar" # I/O redirection: combinations. set path(gorp.file2) [makeFile {} gorp.file2] test exec-7.1 {multiple I/O redirections} {exec} { exec << "command input" > $path(gorp.file2) [interpreter] $path(cat) < $path(gorp.file) exec [interpreter] $path(cat) $path(gorp.file2) } {Just a few thoughts} test exec-7.2 {multiple I/O redirections} {exec} { exec < $path(gorp.file) << "command input" [interpreter] $path(cat) } {command input} # Long input to command and output from command. set a "0123456789 xxxxxxxxx abcdefghi ABCDEFGHIJK\n" set a [concat $a $a $a $a] set a [concat $a $a $a $a] set a [concat $a $a $a $a] set a [concat $a $a $a $a] test exec-8.1 {long input and output} {exec} { exec [interpreter] $path(cat) << $a } $a # More than 20 arguments to exec. test exec-8.2 {long input and output} {exec} { exec [interpreter] $path(echo) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} # Commands that return errors. test exec-9.1 {commands returning errors} {exec notValgrind} { set x [catch {exec gorp456} msg] list $x [string tolower $msg] [string tolower $errorCode] } {1 {couldn't execute "gorp456": no such file or directory} {posix enoent {no such file or directory}}} test exec-9.2 {commands returning errors} {exec notValgrind} { string tolower [list [catch {exec [interpreter] echo foo | foo123} msg] $msg $errorCode] } {1 {couldn't execute "foo123": no such file or directory} {posix enoent {no such file or directory}}} test exec-9.3 {commands returning errors} -constraints {exec stdio} -body { exec [interpreter] $path(sleep) 1 | [interpreter] $path(exit) 43 | [interpreter] $path(sleep) 1 } -returnCodes error -result {child process exited abnormally} test exec-9.4 {commands returning errors} -constraints {exec stdio} -body { exec [interpreter] $path(exit) 43 | [interpreter] $path(echo) "foo bar" } -returnCodes error -result {foo bar child process exited abnormally} test exec-9.5 {commands returning errors} -constraints {exec stdio notValgrind} -body { exec gorp456 | [interpreter] echo a b c } -returnCodes error -result {couldn't execute "gorp456": no such file or directory} test exec-9.6 {commands returning errors} -constraints {exec} -body { exec [interpreter] $path(sh) -c "\"$path(echo)\" error msg 1>&2" } -returnCodes error -result {error msg} test exec-9.7 {commands returning errors} -constraints {exec stdio nonPortable} -body { # This test can fail easily on multiprocessor machines exec [interpreter] $path(sh) -c "\"$path(echo)\" error msg 1>&2 ; \"$path(sleep)\" 1" \ | [interpreter] $path(sh) -c "\"$path(echo)\" error msg 1>&2 ; \"$path(sleep)\" 1" } -returnCodes error -result {error msg error msg} set path(err) [makeFile {} err] test exec-9.8 {commands returning errors} -constraints {exec} -setup { set f [open $path(err) w] puts $f { puts stdout out puts stderr err } close $f } -body { exec [interpreter] $path(err) } -returnCodes error -result {out err} # Errors in executing the Tcl command, as opposed to errors in the processes # that are invoked. test exec-10.1 {errors in exec invocation} -constraints {exec} -body { exec } -returnCodes error -result {wrong # args: should be "exec ?-option ...? arg ?arg ...?"} test exec-10.2 {errors in exec invocation} -constraints {exec} -body { exec | cat } -returnCodes error -result {illegal use of | or |& in command} test exec-10.3 {errors in exec invocation} -constraints {exec} -body { exec cat | } -returnCodes error -result {illegal use of | or |& in command} test exec-10.4 {errors in exec invocation} -constraints {exec} -body { exec cat | | cat } -returnCodes error -result {illegal use of | or |& in command} test exec-10.5 {errors in exec invocation} -constraints {exec} -body { exec cat | |& cat } -returnCodes error -result {illegal use of | or |& in command} test exec-10.6 {errors in exec invocation} -constraints {exec} -body { exec cat |& } -returnCodes error -result {illegal use of | or |& in command} test exec-10.7 {errors in exec invocation} -constraints {exec} -body { exec cat < } -returnCodes error -result {can't specify "<" as last word in command} test exec-10.8 {errors in exec invocation} -constraints {exec} -body { exec cat > } -returnCodes error -result {can't specify ">" as last word in command} test exec-10.9 {errors in exec invocation} -constraints {exec} -body { exec cat << } -returnCodes error -result {can't specify "<<" as last word in command} test exec-10.10 {errors in exec invocation} -constraints {exec} -body { exec cat >> } -returnCodes error -result {can't specify ">>" as last word in command} test exec-10.11 {errors in exec invocation} -constraints {exec} -body { exec cat >& } -returnCodes error -result {can't specify ">&" as last word in command} test exec-10.12 {errors in exec invocation} -constraints {exec} -body { exec cat >>& } -returnCodes error -result {can't specify ">>&" as last word in command} test exec-10.13 {errors in exec invocation} -constraints {exec} -body { exec cat >@ } -returnCodes error -result {can't specify ">@" as last word in command} test exec-10.14 {errors in exec invocation} -constraints {exec} -body { exec cat <@ } -returnCodes error -result {can't specify "<@" as last word in command} test exec-10.15 {errors in exec invocation} -constraints {exec} -body { exec cat < a/b/c } -returnCodes error -result {couldn't read file "a/b/c": no such file or directory} test exec-10.16 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c } -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} test exec-10.17 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c } -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} set f [open $path(gorp.file) w] test exec-10.18 {errors in exec invocation} -constraints {exec} -body { exec cat <@ $f } -returnCodes error -result "channel \"$f\" wasn't opened for reading" close $f set f [open $path(gorp.file) r] test exec-10.19 {errors in exec invocation} -constraints {exec} -body { exec cat >@ $f } -returnCodes error -result "channel \"$f\" wasn't opened for writing" close $f test exec-10.20.1 {errors in exec invocation} -constraints {unix exec notValgrind} -body { exec ~non_existent_user/foo/bar } -returnCodes error -result {couldn't execute "~non_existent_user/foo/bar": no such file or directory} test exec-10.20.2 {errors in exec invocation} -constraints {win exec notValgrind} -body { exec ~non_existent_user/foo/bar } -returnCodes error -result {couldn't execute "~non_existent_user\foo\bar": no such file or directory} test exec-10.21.1 {errors in exec invocation} -constraints {unix exec notValgrind} -body { exec [interpreter] true | ~xyzzy_bad_user/x | false } -returnCodes error -result {couldn't execute "~xyzzy_bad_user/x": no such file or directory} test exec-10.21.2 {errors in exec invocation} -constraints {win exec notValgrind} -body { exec [interpreter] true | ~xyzzy_bad_user/x | false } -returnCodes error -result {couldn't execute "~xyzzy_bad_user\x": no such file or directory} test exec-10.22 {errors in exec invocation} -constraints {exec notValgrind} -body { exec echo test > ~non_existent_user/foo/bar } -returnCodes error -result {couldn't write file "~non_existent_user/foo/bar": no such file or directory} # Commands in background. test exec-11.1 {commands in background} {exec} { set time [time {exec [interpreter] $path(sleep) 2 &}] expr {[lindex $time 0] < 1000000} } 1 test exec-11.2 {commands in background} -constraints {exec} -body { exec [interpreter] $path(echo) a &b } -result {a &b} test exec-11.3 {commands in background} {exec} { llength [exec [interpreter] $path(sleep) 1 &] } 1 test exec-11.4 {commands in background} {exec stdio} { llength [exec [interpreter] $path(sleep) 1 | [interpreter] $path(sleep) 1 | [interpreter] $path(sleep) 1 &] } 3 test exec-11.5 {commands in background} {exec} { set f [open $path(gorp.file) w] puts $f [list catch [list exec [info nameofexecutable] $path(echo) foo &]] close $f exec [interpreter] $path(gorp.file) } foo test exec-11.6 {commands in background} -constraints { exec stdio testhandlecount } -body { set numHandles [testhandlecount] set n [llength [exec [interpreter] $path(sleep) 1 | [interpreter] $path(sleep) 1 | [interpreter] $path(sleep) 1 &]] after 1100 tcl::process::purge list $n [expr {([testhandlecount] - $numHandles) <= 0}]; # Could be < 0 if prior processes were reaped } -result {3 1} # Make sure that background commands are properly reaped when they # eventually die. if {[testConstraint exec] && [testConstraint nonPortable]} { after 1300 exec [interpreter] $path(sleep) 1 } test exec-12.1 {reaping background processes} {exec unix nonPortable} { for {set i 0} {$i < 20} {incr i} { exec echo foo > /dev/null & } after 1000 catch {exec ps | fgrep "echo foo" | fgrep -v fgrep | wc} msg lindex $msg 0 } 0 test exec-12.2 {reaping background processes} {exec unix nonPortable} { exec sleep 2 | sleep 2 | sleep 2 & catch {exec ps | fgrep -i "sleep" | fgrep -i -v fgrep | wc} msg set x [lindex $msg 0] after 3000 catch {exec ps | fgrep -i "sleep" | fgrep -i -v fgrep | wc} msg list $x [lindex $msg 0] } {3 0} test exec-12.3 {reaping background processes} {exec unix nonPortable} { exec sleep 1000 & exec sleep 1000 & set x [exec ps | fgrep "sleep" | fgrep -v fgrep] set pids {} foreach i [split $x \n] { lappend pids [lindex $i 0] } foreach i $pids { catch {exec kill -STOP $i} } catch {exec ps | fgrep "sleep" | fgrep -v fgrep | wc} msg set x [lindex $msg 0] foreach i $pids { catch {exec kill -KILL $i} } catch {exec ps | fgrep "sleep" | fgrep -v fgrep | wc} msg list $x [lindex $msg 0] } {2 0} # Make sure "errorCode" is set correctly. test exec-13.1 {setting errorCode variable} {exec} { list [catch {exec [interpreter] $path(cat) < a/b/c} msg] [string tolower $errorCode] } {1 {posix enoent {no such file or directory}}} test exec-13.2 {setting errorCode variable} {exec} { list [catch {exec [interpreter] $path(cat) > a/b/c} msg] [string tolower $errorCode] } {1 {posix enoent {no such file or directory}}} test exec-13.3 {setting errorCode variable} {exec notValgrind} { set x [catch {exec _weird_cmd_} msg] list $x [string tolower $msg] [lindex $errorCode 0] \ [string tolower [lrange $errorCode 2 end]] } {1 {couldn't execute "_weird_cmd_": no such file or directory} POSIX {{no such file or directory}}} test exec-13.4 {extended exit result codes} -setup { set tmp [makeFile {exit 0x00000101} tmpfile.exec-13.4] } -constraints {win} -body { list [catch {exec [interpreter] $tmp} err] [lreplace $::errorCode 1 1 {}] } -cleanup { removeFile $tmp } -result {1 {CHILDSTATUS {} 257}} test exec-13.5 {extended exit result codes: max value} -setup { set tmp [makeFile {exit 0x3fffffff} tmpfile.exec-13.5] } -constraints {win} -body { list [catch {exec [interpreter] $tmp} err] [lreplace $::errorCode 1 1 {}] } -cleanup { removeFile $tmp } -result {1 {CHILDSTATUS {} 1073741823}} test exec-13.6 {extended exit result codes: signalled} -setup { set tmp [makeFile {exit 0xC0000016} tmpfile.exec-13.6] } -constraints {win} -body { list [catch {exec [interpreter] $tmp} err] [lreplace $::errorCode 1 1 {}] } -cleanup { removeFile $tmp } -result {1 {CHILDKILLED {} SIGABRT SIGABRT}} # Switches before the first argument test exec-14.1 {-keepnewline switch} {exec} { exec -keepnewline [interpreter] $path(echo) foo } "foo\n" test exec-14.2 {-keepnewline switch} -constraints {exec} -body { exec -keepnewline } -returnCodes error -result {wrong # args: should be "exec ?-option ...? arg ?arg ...?"} test exec-14.3 {unknown switch} -constraints {exec} -body { exec -gorp } -returnCodes error -result {bad option "-gorp": must be -ignorestderr, -keepnewline, -encoding, or --} test exec-14.4 {-- switch} -constraints {exec notValgrind} -body { exec -- -gorp } -returnCodes error -result {couldn't execute "-gorp": no such file or directory} test exec-14.5 {-ignorestderr switch} {exec} { # Alas, the use of -ignorestderr is buried here :-( exec [interpreter] $path(sh2) -c [list $path(echo2) foo bar] 2>@1 } "foo bar\nbar" # Redirecting standard error separately from standard output test exec-15.1 {standard error redirection} {exec} { exec [interpreter] $path(echo) "First line" > $path(gorp.file) list [exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" 2> $path(gorp.file)] \ [exec [interpreter] $path(cat) $path(gorp.file)] } {{} {foo bar}} test exec-15.2 {standard error redirection} {exec stdio} { list [exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" \ | [interpreter] $path(echo) biz baz >$path(gorp.file) 2> $path(gorp.file2)] \ [exec [interpreter] $path(cat) $path(gorp.file)] \ [exec [interpreter] $path(cat) $path(gorp.file2)] } {{} {biz baz} {foo bar}} test exec-15.3 {standard error redirection} {exec stdio} { list [exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" \ | [interpreter] $path(echo) biz baz 2>$path(gorp.file) > $path(gorp.file2)] \ [exec [interpreter] $path(cat) $path(gorp.file)] \ [exec [interpreter] $path(cat) $path(gorp.file2)] } {{} {foo bar} {biz baz}} test exec-15.4 {standard error redirection} {exec} { set f [open $path(gorp.file) w] puts $f "Line 1" flush $f exec [interpreter] $path(sh) -c "\"$path(echo)\" foo bar 1>&2" 2>@ $f puts $f "Line 3" close $f readfile $path(gorp.file) } {Line 1 foo bar Line 3} test exec-15.5 {standard error redirection} {exec} { exec [interpreter] $path(echo) "First line" > "$path(gorp.file)" exec [interpreter] "$path(sh)" -c "\"$path(echo)\" foo bar 1>&2" 2>> "$path(gorp.file)" readfile $path(gorp.file) } {First line foo bar} test exec-15.6 {standard error redirection} {exec stdio} { exec [interpreter] "$path(sh)" -c "\"$path(echo)\" foo bar 1>&2" > "$path(gorp.file2)" 2> "$path(gorp.file)" \ >& "$path(gorp.file)" 2> "$path(gorp.file2)" | [interpreter] $path(echo) biz baz list [readfile $path(gorp.file)] [readfile $path(gorp.file2)] } {{biz baz} {foo bar}} test exec-15.7 {standard error redirection 2>@1} {exec stdio} { # This redirects stderr output into normal result output from exec exec [interpreter] "$path(sh)" -c "\"$path(echo)\" foo bar 1>&2" 2>@1 } {foo bar} test exec-16.1 {flush output before exec} {exec} { set f [open $path(gorp.file) w] puts $f "First line" exec [interpreter] $path(echo) "Second line" >@ $f puts $f "Third line" close $f readfile $path(gorp.file) } {First line Second line Third line} test exec-16.2 {flush output before exec} {exec} { set f [open $path(gorp.file) w] puts $f "First line" exec [interpreter] << {puts stderr {Second line}} >&@ $f > $path(gorp.file2) puts $f "Third line" close $f readfile $path(gorp.file) } {First line Second line Third line} test exec-17.1 {inheriting standard I/O} -constraints {exec} -setup { set path(script) [makeFile {} script] set f [open $path(script) w] puts $f [list lassign [list \ [info nameofexecutable] $path(gorp.file) $path(echo) $path(sleep) \ ] exe file echo sleep] puts $f { close stdout set f [open $file w] catch {exec $exe $echo foobar &} exec $exe $sleep 2 close $f } close $f } -body { catch {exec [interpreter] $path(script)} result list $result [readfile $path(gorp.file)] } -cleanup { removeFile $path(script) } -result {{} foobar} test exec-18.1 {exec deals with weird file names} -body { set path(fooblah) [makeFile {contents} "foo\[\{blah"] exec [interpreter] $path(cat) $path(fooblah) } -constraints {exec} -cleanup { removeFile $path(fooblah) } -result contents test exec-18.2 {exec cat deals with weird file names} -body { # This is cross-platform, but the cat isn't predictably correct on # Windows. set path(fooblah) [makeFile {contents} "foo\[\{blah"] exec cat $path(fooblah) } -constraints {exec tempNotWin} -cleanup { removeFile $path(fooblah) } -result contents # Note that this test cannot be adapted to work on Windows; that platform has # no kernel support for an analog of O_APPEND. OTOH, that means we can assume # that there is a POSIX shell... # # This test also fails in some cases when building with macOS test exec-19.1 {exec >> uses O_APPEND} -constraints {exec unix notValgrind noosxCI} -setup { set tmpfile [makeFile {0} tmpfile.exec-19.1] } -body { # Note that we have to allow for the current contents of the temporary # file, which is why the result is 14 and not 12 exec /bin/sh -c \ {for a in 1 2 3; do sleep 1; echo $a; done} >>$tmpfile & exec /bin/sh -c \ {for a in 4 5 6; do sleep 1; echo $a >&2; done} 2>>$tmpfile & exec /bin/sh -c \ {for a in a b c; do sleep 1; echo $a; done} >>$tmpfile & exec /bin/sh -c \ {for a in d e f; do sleep 1; echo $a >&2; done} 2>>$tmpfile & # The above four shell invocations take about 3 seconds to finish, so allow # 5s (in case the machine is busy) after 5000 # Check that no bytes have got lost through mixups with overlapping # appends, which is only guaranteed to work when we set O_APPEND on the # file descriptor in the [exec >>...] file size $tmpfile } -cleanup { removeFile $tmpfile } -result 26 # Tests to ensure batch files and .CMD (Bug 9ece99d58b) # can be executed on Windows test exec-20.0 {exec .bat file} -constraints {win} -body { set log [makeFile {} exec20.log] exec [makeFile "echo %1> $log" exec20.bat] "Testing exec-20.0" viewFile $log } -result "\"Testing exec-20.0\"" test exec-20.1 {exec .CMD file} -constraints {win} -body { set log [makeFile {} exec201.log] exec [makeFile "echo %1> $log" exec201.CMD] "Testing exec-20.1" viewFile $log } -result "\"Testing exec-20.1\"" # Test with encoding mismatches (Bug 0f1ddc0df7fb7) test exec-21.1 {exec encoding mismatch on stdout} -setup { set path(script) [makeFile { fconfigure stdout -translation binary puts a\xe9b } script] set enc [encoding system] encoding system utf-8 } -cleanup { removeFile $path(script) encoding system $enc } -body { exec [info nameofexecutable] $path(script) } -result a\uFFFDb test exec-21.2 {exec encoding mismatch on stderr} -setup { set path(script) [makeFile { fconfigure stderr -translation binary puts stderr a\xe9b } script] set enc [encoding system] encoding system utf-8 } -cleanup { removeFile $path(script) encoding system $enc } -body { list [catch {exec [info nameofexecutable] $path(script)} r] $r } -result [list 1 a\uFFFDb] # TIP 716 -encoding option test exec-22.0 {exec -encoding} -body { set enc [expr {[encoding system] eq "utf-8" ? "iso2022-jp" : "utf-8"}] exec -encoding $enc -- [interpreter] $path(echobin) [binary encode hex [encoding convertto $enc \u4e4e\u68d9]] } -result \u4e4e\u68d9 test exec-22.1 {exec -encoding invalid encoding} -body { exec -encoding nosuchencoding -- [interpreter] $path(echobin) abc } -result {unknown encoding "nosuchencoding"} -returnCodes error test exec-bug-4f0b5767ac {exec App Execution Alias} -constraints haveWinget -body { exec winget --info } -result "Windows*" -match glob foreach cmdBuiltin { assoc call cd cls color copy date del dir echo erase exit ftype for if md mkdir mklink move path pause prompt rd ren rename rmdir set start time title type ver vol } { test auto_execok-$cmdBuiltin-1.0 "auto_execok $cmdBuiltin" \ -constraints win \ -body { string equal [auto_execok $cmdBuiltin] \ "[file normalize $::env(COMSPEC)] /c $cmdBuiltin" } -result 1 } unset cmdBuiltin # ---------------------------------------------------------------------- # cleanup foreach file {gorp.file gorp.file2 echo echo2 echobin cat wc sh sh2 sleep exit err} { removeFile $file } unset -nocomplain path tmp ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/event.test0000644000175000017500000006762015104661341014746 0ustar sergeisergei# This file contains a collection of tests for the procedures in the file # tclEvent.c, which includes the "update", and "vwait" Tcl commands. Sourcing # this file into Tcl runs the tests and generates output for errors. No # output means no errors were found. # # Copyright © 1995-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcltest 2.5 namespace import -force ::tcltest::* catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] set ::tcltestlib [info loaded {} Tcltest] } testConstraint testfilehandler [llength [info commands testfilehandler]] testConstraint testexithandler [llength [info commands testexithandler]] testConstraint testfilewait [llength [info commands testfilewait]] testConstraint exec [llength [info commands exec]] testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}] test event-1.1 {Tcl_CreateFileHandler, reading} -setup { testfilehandler close set result "" } -constraints {testfilehandler notOSX} -body { testfilehandler create 0 readable off testfilehandler clear 0 testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler fillpartial 0 update idletasks testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler oneevent lappend result [testfilehandler counts 0] } -cleanup { testfilehandler close } -result {{0 0} {1 0} {2 0}} test event-1.2 {Tcl_CreateFileHandler, writing} -setup { testfilehandler close set result "" } -constraints {testfilehandler nonPortable} -body { # This test is non-portable because on some systems (e.g., SunOS 4.1.3) # pipes seem to be writable always. testfilehandler create 0 off writable testfilehandler clear 0 testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler fillpartial 0 testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler fill 0 testfilehandler oneevent lappend result [testfilehandler counts 0] } -cleanup { testfilehandler close } -result {{0 1} {0 2} {0 2}} test event-1.3 {Tcl_DeleteFileHandler} -setup { testfilehandler close set result "" } -constraints {testfilehandler nonPortable} -body { testfilehandler create 2 disabled disabled testfilehandler create 1 readable writable testfilehandler create 0 disabled disabled testfilehandler fillpartial 1 testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler create 1 off off testfilehandler oneevent lappend result [testfilehandler counts 1] } -cleanup { testfilehandler close } -result {{0 1} {1 1} {1 2} {0 0}} test event-2.1 {Tcl_DeleteFileHandler} -setup { testfilehandler close set result "" } -constraints {testfilehandler nonPortable} -body { testfilehandler create 2 disabled disabled testfilehandler create 1 readable writable testfilehandler fillpartial 1 testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler create 1 off off testfilehandler oneevent lappend result [testfilehandler counts 1] } -cleanup { testfilehandler close } -result {{0 1} {1 1} {1 2} {0 0}} test event-2.2 {Tcl_DeleteFileHandler, fd reused & events still pending} -setup { testfilehandler close set result "" } -constraints {testfilehandler nonPortable} -body { testfilehandler create 0 readable writable testfilehandler fillpartial 0 testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler close testfilehandler create 0 readable writable testfilehandler oneevent lappend result [testfilehandler counts 0] } -cleanup { testfilehandler close } -result {{0 1} {0 0}} test event-3.1 {FileHandlerCheckProc, TCL_FILE_EVENTS off} -setup { testfilehandler close } -constraints {testfilehandler} -body { testfilehandler create 1 readable writable testfilehandler fillpartial 1 testfilehandler windowevent testfilehandler counts 1 } -cleanup { testfilehandler close } -result {0 0} test event-4.1 {FileHandlerEventProc, race between event and disabling} -setup { update testfilehandler close set result "" } -constraints {testfilehandler nonPortable} -body { testfilehandler create 2 disabled disabled testfilehandler create 1 readable writable testfilehandler fillpartial 1 testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler oneevent lappend result [testfilehandler counts 1] testfilehandler create 1 disabled disabled testfilehandler oneevent lappend result [testfilehandler counts 1] } -cleanup { testfilehandler close } -result {{0 1} {1 1} {1 2} {0 0}} test event-4.2 {FileHandlerEventProc, TCL_FILE_EVENTS off} -setup { update testfilehandler close } -constraints {testfilehandler nonPortable} -body { testfilehandler create 1 readable writable testfilehandler create 2 readable writable testfilehandler fillpartial 1 testfilehandler fillpartial 2 testfilehandler oneevent set result "" lappend result [testfilehandler counts 1] [testfilehandler counts 2] testfilehandler windowevent lappend result [testfilehandler counts 1] [testfilehandler counts 2] } -cleanup { testfilehandler close } -result {{0 0} {0 1} {0 0} {0 1}} update test event-5.1 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { catch {rename bgerror {}} } -body { proc bgerror msg { global errorInfo errorCode x lappend x [list $msg $errorInfo $errorCode] } after idle {error "a simple error"} after idle {open non_existent} after idle {set errorInfo foobar; set errorCode xyzzy} set x {} update idletasks regsub -all [file join {} non_existent] $x "non_existent" } -cleanup { rename bgerror {} } -result {{{a simple error} {a simple error while executing "error "a simple error"" ("after" script)} NONE} {{couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" ("after" script)} {POSIX ENOENT {no such file or directory}}}} test event-5.2 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { catch {rename bgerror {}} } -body { proc bgerror msg { global x lappend x $msg return -code break } after idle {error "a simple error"} after idle {open non_existent} set x {} update idletasks return $x } -cleanup { rename bgerror {} } -result {{a simple error}} test event-5.3 {HandleBgErrors: [Bug 1670155]} -setup { variable x proc demo args {variable x done} variable target [list [namespace which demo] x] proc trial args {variable target; string length $target} trace add execution demo enter [namespace code trial] variable save [interp bgerror {}] interp bgerror {} $target } -body { after 0 {error bar} vwait [namespace which -variable x] } -cleanup { interp bgerror {} $save unset x target save rename demo {} rename trial {} } -result {} test event-5.3.1 {Default [interp bgerror] handler} -body { ::tcl::Bgerror } -returnCodes error -match glob -result {*msg options*} test event-5.4 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} } -returnCodes error -match glob -result {*msg options*} test event-5.5 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} {} {} } -returnCodes error -match glob -result {*msg options*} test event-5.6 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} {} } -returnCodes error -match glob -result {*-level*} test event-5.7 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} {-level foo} } -returnCodes error -match glob -result {*expected integer*} test event-5.8 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} {-level 0} } -returnCodes error -match glob -result {*-code*} test event-5.9 {Default [interp bgerror] handler} -body { ::tcl::Bgerror {} {-level 0 -code ok} } -returnCodes error -match glob -result {*expected integer*} test event-5.10 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror {} {-level 0 -code 0} return $::res } -cleanup { rename bgerror {} } -result {} test event-5.11 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror msg {-level 0 -code 1} return $::res } -cleanup { rename bgerror {} } -result {msg} test event-5.12 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror msg {-level 0 -code 2} return $::res } -cleanup { rename bgerror {} } -result {command returned bad code: 2} test event-5.13 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror msg {-level 0 -code 3} return $::res } -cleanup { rename bgerror {} } -result {invoked "break" outside of a loop} test event-5.14 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror msg {-level 0 -code 4} return $::res } -cleanup { rename bgerror {} } -result {invoked "continue" outside of a loop} test event-5.15 {Default [interp bgerror] handler} -body { proc bgerror {m} {append ::res $m} set ::res {} ::tcl::Bgerror msg {-level 0 -code 5} return $::res } -cleanup { rename bgerror {} } -result {command returned bad code: 5} test event-6.1 {BgErrorDeleteProc procedure} -setup { catch {interp delete foo} interp create foo set erroutfile [makeFile Unmodified err.out] } -body { foo eval [list set erroutfile $erroutfile] foo eval { proc bgerror args { global errorInfo erroutfile set f [open $erroutfile r+] seek $f 0 end puts $f "$args $errorInfo" close $f } after 100 {error "first error"} after 100 {error "second error"} } after 100 {interp delete foo} after 200 update set f [open $erroutfile r] set result [read $f] close $f return $result } -cleanup { removeFile $erroutfile } -result {Unmodified } test event-7.1 {bgerror / regular} { set errRes {} proc bgerror {err} { global errRes set errRes $err } after 0 {error err1} vwait errRes return $errRes } err1 test event-7.2 {bgerror / accumulation} { set errRes {} proc bgerror {err} { global errRes lappend errRes $err } after 0 {error err1} after 0 {error err2} after 0 {error err3} update return $errRes } {err1 err2 err3} test event-7.3 {bgerror / accumulation / break} { set errRes {} proc bgerror {err} { global errRes lappend errRes $err return -code break "skip!" } after 0 {error err1} after 0 {error err2} after 0 {error err3} update return $errRes } err1 test event-7.4 {tkerror is nothing special anymore to tcl} -body { set errRes {} # we don't just rename bgerror to empty because it could then # be autoloaded... proc bgerror {err} { global errRes lappend errRes "bg:$err" } proc tkerror {err} { global errRes lappend errRes "tk:$err" } after 0 {error err1} update return $errRes } -cleanup { rename tkerror {} } -result bg:err1 test event-7.5 {correct behaviour when there is no bgerror [Bug 219142]} -body { exec [interpreter] << { after 1000 error hello after 2000 set a 0 vwait a } } -constraints {exec} -returnCodes error -result {hello while executing "error hello" ("after" script)} test event-7.6 {safe hidden bgerror fallback} -setup { variable result {} interp create -safe safe } -body { safe alias puts puts safe alias result ::append [namespace which -variable result] safe eval {proc bgerror m {result $m\n$::errorCode\n$::errorInfo\n}} safe hide bgerror safe eval after 0 error foo update return $result } -cleanup { interp delete safe } -result {foo NONE foo while executing "error foo" ("after" script) } test event-7.7 {safe hidden bgerror fallback} -setup { variable result {} interp create -safe safe } -body { safe alias puts puts safe alias result ::append [namespace which -variable result] safe eval {proc bgerror m {result $m\n$::errorCode\n$::errorInfo\n}} safe hide bgerror safe eval {proc bgerror m {error bar soom baz}} safe eval after 0 error foo update return $result } -cleanup { interp delete safe } -result {foo NONE foo while executing "error foo" ("after" script) } # someday : add a test checking that when there is no bgerror, an error msg # goes to stderr ideally one would use sub interp and transfer a fake stderr # to it, unfortunately the current interp tcl API does not allow that. The # other option would be to use fork a test but it then becomes more a # file/exec test than a bgerror test. # end of bgerror tests catch {rename bgerror {}} test event-8.1 {Tcl_CreateExitHandler procedure} {stdio testexithandler} { set child [open |[list [interpreter]] r+] puts $child "catch {load $::tcltestlib Tcltest}" puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; exit" flush $child set result [read $child] close $child return $result } {even 6 even 4 odd 41 } test event-9.1 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { set child [open |[list [interpreter]] r+] puts $child "catch {load $::tcltestlib Tcltest}" puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 41" puts $child "testexithandler create 16; exit" flush $child set result [read $child] close $child return $result } {even 16 even 6 even 4 } test event-9.2 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { set child [open |[list [interpreter]] r+] puts $child "catch {load $::tcltestlib Tcltest}" puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 4" puts $child "testexithandler create 16; exit" flush $child set result [read $child] close $child return $result } {even 16 even 6 odd 41 } test event-9.3 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { set child [open |[list [interpreter]] r+] puts $child "catch {load $::tcltestlib Tcltest}" puts $child "testexithandler create 41; testexithandler create 4" puts $child "testexithandler create 6; testexithandler delete 6" puts $child "testexithandler create 16; exit" flush $child set result [read $child] close $child return $result } {even 16 even 4 odd 41 } test event-9.4 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} { set child [open |[list [interpreter]] r+] puts $child "catch {load $::tcltestlib Tcltest}" puts $child "testexithandler create 41; testexithandler delete 41" puts $child "testexithandler create 16; exit" flush $child set result [read $child] close $child return $result } {even 16 } test event-10.1 {Tcl_Exit procedure} {stdio} { set child [open |[list [interpreter]] r+] puts $child "exit 3" list [catch {close $child} msg] $msg [lindex $::errorCode 0] \ [lindex $::errorCode 2] } {1 {child process exited abnormally} CHILDSTATUS 3} test event-11.1 {Tcl_VwaitCmd procedure} -body { vwait } -result {} test event-11.3 {Tcl_VwaitCmd procedure} -setup { catch {unset x} } -body { set x 1 vwait x(1) } -returnCodes error -result {can't trace "x(1)": variable isn't array} test event-11.4 {Tcl_VwaitCmd procedure} -setup { foreach i [after info] { after cancel $i } after 10; update; # On Mac make sure update won't take long } -body { after 100 {set x x-done} after 200 {set y y-done} after 400 {set z z-done} after idle {set q q-done} set x before set y before set z before set q before list [vwait y] $x $y $z $q } -cleanup { foreach i [after info] { after cancel $i } } -result {{} x-done y-done before q-done} test event-11.5 {Tcl_VwaitCmd procedure: round robin scheduling, 2 sources} -setup { set test1file [makeFile "" test1] } -constraints {socket} -body { set f1 [open $test1file w] proc accept {s args} { puts $s foobar close $s } set s1 [socket -server accept -myaddr 127.0.0.1 0] after 1000 set s2 [socket 127.0.0.1 [lindex [fconfigure $s1 -sockname] 2]] close $s1 set x 0 set y 0 set z 0 fileevent $s2 readable {incr z} vwait z fileevent $f1 writable {incr x; if {$y == 3} {set z done}} fileevent $s2 readable {incr y; if {$x == 3} {set z done}} vwait z close $f1 close $s2 list $x $y $z } -cleanup { removeFile $test1file } -result {3 3 done} test event-11.6 {Tcl_VwaitCmd procedure: round robin scheduling, same source} { set test1file [makeFile "" test1] set test2file [makeFile "" test2] set f1 [open $test1file w] set f2 [open $test2file w] set x 0 set y 0 set z 0 update fileevent $f1 writable {incr x; if {$y == 3} {set z done}} fileevent $f2 writable {incr y; if {$x == 3} {set z done}} vwait z close $f1 close $f2 removeFile $test1file removeFile $test2file list $x $y $z } {3 3 done} test event-11.7 {Bug 16828b3744} { after idle { set ::t::v 1 namespace delete ::t } namespace eval ::t { vwait ::t::v } } {} test event-11.8 {Bug 16828b3744} -setup { oo::class create A { variable continue method start {} { after idle [self] destroy set continue 0 vwait [namespace current]::continue } destructor { set continue 1 } } } -body { [A new] start } -cleanup { A destroy } -result {} test event-12.1 {Tcl_UpdateCmd procedure} -returnCodes error -body { update a b } -result {wrong # args: should be "update ?idletasks?"} test event-12.2 {Tcl_UpdateCmd procedure} -returnCodes error -body { update bogus } -result {bad option "bogus": must be idletasks} test event-12.3 {Tcl_UpdateCmd procedure} -setup { foreach i [after info] { after cancel $i } } -body { after 500 {set x after} after idle {set y after} after idle {set z "after, y = $y"} set x before set y before set z before update idletasks list $x $y $z } -cleanup { foreach i [after info] { after cancel $i } } -result {before after {after, y = after}} test event-12.4 {Tcl_UpdateCmd procedure} -setup { foreach i [after info] { after cancel $i } } -body { after 10; update; # On Mac make sure update won't take long after 200 {set x x-done} after 600 {set y y-done} after idle {set z z-done} set x before set y before set z before after 300 update list $x $y $z } -cleanup { foreach i [after info] { after cancel $i } } -result {x-done before z-done} test event-13.1 {Tcl_WaitForFile procedure, readable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints {testfilehandler} -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 readable 0] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {{} {no timeout}} test event-13.2 {Tcl_WaitForFile procedure, readable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints testfilehandler -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 readable 100] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {{} timeout} test event-13.3 {Tcl_WaitForFile procedure, readable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints testfilehandler -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fillpartial 1 set x "no timeout" set result [testfilehandler wait 1 readable 100] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {readable {no timeout}} test event-13.4 {Tcl_WaitForFile procedure, writable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints {testfilehandler nonPortable} -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fill 1 set x "no timeout" set result [testfilehandler wait 1 writable 0] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {{} {no timeout}} test event-13.5 {Tcl_WaitForFile procedure, writable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints {testfilehandler nonPortable} -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fill 1 set x "no timeout" set result [testfilehandler wait 1 writable 100] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {{} timeout} test event-13.6 {Tcl_WaitForFile procedure, writable} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints testfilehandler -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 writable 100] update list $result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {writable {no timeout}} test event-13.7 {Tcl_WaitForFile procedure, don't call other event handlers} -setup { foreach i [after info] { after cancel $i } testfilehandler close } -constraints testfilehandler -body { after 100 lappend x timeout after idle lappend x idle testfilehandler create 1 off off set x "" set result [list [testfilehandler wait 1 readable 200] $x] update lappend result $x } -cleanup { testfilehandler close foreach i [after info] { after cancel $i } } -result {{} {} {timeout idle}} test event-13.8 {Tcl_WaitForFile procedure, waiting indefinitely} testfilewait { set f [open "|sleep 2" r] set result "" lappend result [testfilewait $f readable 100] lappend result [testfilewait $f readable -1] close $f return $result } {{} readable} test event-14.1 {Tcl_WaitForFile procedure, readable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix} -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 readable 0] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {{} {no timeout}} test event-14.2 {Tcl_WaitForFile procedure, readable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix} -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 readable 100] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {{} timeout} test event-14.3 {Tcl_WaitForFile procedure, readable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix} -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fillpartial 1 set x "no timeout" set result [testfilehandler wait 1 readable 100] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {readable {no timeout}} test event-14.4 {Tcl_WaitForFile procedure, writable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix nonPortable} -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fill 1 set x "no timeout" set result [testfilehandler wait 1 writable 0] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {{} {no timeout}} test event-14.5 {Tcl_WaitForFile procedure, writable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix nonPortable} -body { after 100 set x timeout testfilehandler create 1 off off testfilehandler fill 1 set x "no timeout" set result [testfilehandler wait 1 writable 100] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {{} timeout} test event-14.6 {Tcl_WaitForFile procedure, writable, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix} -body { after 100 set x timeout testfilehandler create 1 off off set x "no timeout" set result [testfilehandler wait 1 writable 100] update list $result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {writable {no timeout}} test event-14.7 {Tcl_WaitForFile, don't call other event handlers, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } foreach i [after info] {after cancel $i} testfilehandler close } -constraints {testfilehandler unix} -body { after 100 lappend x timeout after idle lappend x idle testfilehandler create 1 off off set x "" set result [list [testfilehandler wait 1 readable 200] $x] update lappend result $x } -cleanup { testfilehandler close foreach chan $chanList {close $chan} foreach i [after info] {after cancel $i} } -result {{} {} {timeout idle}} test event-14.8 {Tcl_WaitForFile procedure, waiting indefinitely, big fd} -setup { set chanList {} for {set i 0} {$i < 32} {incr i} { lappend chanList [open /dev/null r] } } -constraints {testfilewait unix} -body { set f [open "|sleep 2" r] set result "" lappend result [testfilewait $f readable 100] lappend result [testfilewait $f readable -1] close $f return $result } -cleanup { foreach chan $chanList {close $chan} } -result {{} readable} # cleanup foreach i [after info] { after cancel $i } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/eval.test0000644000175000017500000000436315104661341014547 0ustar sergeisergei# Commands covered: eval # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test eval-1.1 {single argument} { eval {format 22} } 22 test eval-1.2 {multiple arguments} { set a {$b} set b xyzzy eval format $a } xyzzy test eval-1.3 {single argument} { eval concat a b c d e f g } {a b c d e f g} test eval-2.1 {error: not enough arguments} {catch eval} 1 test eval-2.2 {error: not enough arguments} { catch eval msg set msg } {wrong # args: should be "eval arg ?arg ...?"} test eval-2.3 {error in eval'ed command} { catch {eval {error "test error"}} } 1 test eval-2.4 {error in eval'ed command} { catch {eval {error "test error"}} msg set msg } {test error} test eval-2.5 {error in eval'ed command: setting errorInfo} { catch {eval { set a 1 error "test error" }} msg set ::errorInfo } "test error while executing \"error \"test error\"\" (\"eval\" body line 3) invoked from within \"eval { set a 1 error \"test error\" }\"" test eval-3.1 {eval and pure lists} { eval [list list 1 2 3 4 5] } {1 2 3 4 5} test eval-3.2 {concatenating eval and pure lists} { eval [list list 1] [list 2 3 4 5] } {1 2 3 4 5} test eval-3.3 {eval and canonical lists} { set cmd [list list 1 2 3 4 5] # Force existence of utf-8 rep set dummy($cmd) $cmd unset dummy eval $cmd } {1 2 3 4 5} test eval-3.4 {concatenating eval and canonical lists} { set cmd [list list 1] set cmd2 [list 2 3 4 5] # Force existence of utf-8 rep set dummy($cmd) $cmd set dummy($cmd2) $cmd2 unset dummy eval $cmd $cmd2 } {1 2 3 4 5} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/error.test0000644000175000017500000011152115104661341014744 0ustar sergeisergei# Commands covered: error, catch, throw, try # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint memory [llength [info commands memory]] customMatch pairwise {apply {{a b} { string equal [lindex $b 0] [lindex $b 1] }}} namespace eval ::tcl::test::error { if {[testConstraint memory]} { proc getbytes {} { set lines [split [memory info] \n] return [lindex $lines 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } proc foo {} { global errorInfo set a [catch {format [error glorp2]} b] error {Human-generated} } proc foo2 {} { global errorInfo set a [catch {format [error glorp2]} b] error {Human-generated} $errorInfo } # Catch errors occurring in commands and errors from "error" command test error-1.1 {simple errors from commands} { catch {format [string index]} b } 1 test error-1.2 {simple errors from commands} { catch {format [string index]} b set b } {wrong # args: should be "string index string charIndex"} test error-1.3 {simple errors from commands} { catch {format [string index]} b set ::errorInfo # This used to return '... while executing ...', but string index is fully # compiled as of 8.4a3 } {wrong # args: should be "string index string charIndex" while executing "string index"} test error-1.4 {simple errors from commands} { catch {error glorp} b } 1 test error-1.5 {simple errors from commands} { catch {error glorp} b set b } glorp test error-1.6 {simple errors from commands} { catch {catch a b c d} b } 1 test error-1.7 {simple errors from commands} { catch {catch a b c d} b set b } {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"} test error-1.8 {simple errors from commands} { # This test is non-portable: it generates a memory fault on machines like # DEC Alphas (infinite recursion overflows stack?) # # That claims sounds like a bug to be fixed rather than a portability # problem. Anyhow, I believe it's out of date (bug's been fixed) so this # test is re-enabled. proc p {} { uplevel 1 catch p error } p } 0 # Check errors nested in procedures. Also check the optional argument to # "error" to generate a new error trace. test error-2.1 {errors in nested procedures} { catch foo b } 1 test error-2.2 {errors in nested procedures} { catch foo b set b } {Human-generated} test error-2.3 {errors in nested procedures} { catch foo b set ::errorInfo } {Human-generated while executing "error {Human-generated}" (procedure "foo" line 4) invoked from within "foo"} test error-2.4 {errors in nested procedures} { catch foo2 b } 1 test error-2.5 {errors in nested procedures} { catch foo2 b set b } {Human-generated} test error-2.6 {errors in nested procedures} { catch foo2 b set ::errorInfo } {glorp2 while executing "error glorp2" (procedure "foo2" line 3) invoked from within "foo2"} # Error conditions related to "catch". test error-3.1 {errors in catch command} { list [catch {catch} msg] $msg } {1 {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"}} test error-3.2 {errors in catch command} { list [catch {catch a b c} msg] $msg } {0 1} test error-3.3 {errors in catch command} { catch {unset a} set a(0) 22 list [catch {catch {format 44} a} msg] $msg } {1 {can't set "a": variable is array}} catch {unset a} # More tests related to errorInfo and errorCode test error-4.1 {errorInfo and errorCode variables} { list [catch {error msg1 msg2 msg3} msg] $msg $::errorInfo $::errorCode } {1 msg1 msg2 msg3} test error-4.2 {errorInfo and errorCode variables} { list [catch {error msg1 {} msg3} msg] $msg $::errorInfo $::errorCode } {1 msg1 {msg1 while executing "error msg1 {} msg3"} msg3} test error-4.3 {errorInfo and errorCode variables} { list [catch {error msg1 {}} msg] $msg $::errorInfo $::errorCode } {1 msg1 {msg1 while executing "error msg1 {}"} NONE} test error-4.4 {errorInfo and errorCode variables} { set ::errorCode bogus list [catch {error msg1} msg] $msg $::errorInfo $::errorCode } {1 msg1 {msg1 while executing "error msg1"} NONE} test error-4.5 {errorInfo and errorCode variables} { set ::errorCode bogus list [catch {error msg1 msg2 {}} msg] $msg $::errorInfo $::errorCode } {1 msg1 msg2 {}} test error-4.6 {errorstack via info } -body { proc f x {g $x$x} proc g x {error G:$x} catch {f 12} info errorstack } -match glob -result {INNER * CALL {g 1212} CALL {f 12} UP 1} test error-4.7 {errorstack via options dict } -body { proc f x {g $x$x} proc g x {error G:$x} catch {f 12} m d dict get $d -errorstack } -match glob -result {INNER * CALL {g 1212} CALL {f 12} UP 1} test error-4.8 {errorstack from exec traces} -body { proc foo args {} proc goo {} foo trace add execution foo enter {error bar;#} catch goo m d dict get $d -errorstack } -cleanup { rename goo {}; rename foo {} unset -nocomplain m d } -result {INNER {error bar} CALL goo UP 1} # Errors in error command itself test error-5.1 {errors in error command} { list [catch {error} msg] $msg } {1 {wrong # args: should be "error message ?errorInfo? ?errorCode?"}} test error-5.2 {errors in error command} { list [catch {error a b c d} msg] $msg } {1 {wrong # args: should be "error message ?errorInfo? ?errorCode?"}} # Make sure that catch resets error information test error-6.1 {catch must reset error state} { catch {error outer [catch {error inner inner.errorInfo inner.errorCode}]} list $::errorCode $::errorInfo } {NONE 1} test error-6.2 {catch must reset error state} { catch {error outer [catch {return -level 0 -code error -errorcode BUG}]} list $::errorCode $::errorInfo } {NONE 1} test error-6.3 {catch must reset error state} { set ::errorCode BUG catch {error outer [catch set]} list $::errorCode $::errorInfo } {NONE 1} test error-6.4 {catch must reset error state} { catch {error [catch {error foo bar baz}] 1} list $::errorCode $::errorInfo } {NONE 1} test error-6.5 {catch must reset error state} { catch {error [catch {return -level 0 -code error -errorcode BUG}] 1} list $::errorCode $::errorInfo } {NONE 1} test error-6.6 {catch must reset error state} { catch {return -level 0 -code error -errorinfo [catch {error foo bar baz}]} list $::errorCode $::errorInfo } {NONE 1} test error-6.7 {catch must reset error state} { proc foo {} { return -code error -errorinfo [catch {error foo bar baz}] } catch foo list $::errorCode } {NONE} test error-6.8 {catch must reset error state} { catch {return -level 0 -code error [catch {error foo bar baz}]} list $::errorCode } {NONE} test error-6.9 {catch must reset error state} { proc foo {} { return -code error [catch {error foo bar baz}] } catch foo list $::errorCode } {NONE} test error-6.10 {catch must reset errorstack} -body { proc f x {g $x$x} proc g x {error G:$x} catch {f 12} set e1 [info errorstack] catch {f 13} set e2 [info errorstack] list $e1 $e2 } -match glob -result {{INNER * CALL {g 1212} CALL {f 12} UP 1} {INNER * CALL {g 1313} CALL {f 13} UP 1}} test error-7.1 {Bug 1397843} -body { variable cmds proc EIWrite args { variable cmds lappend cmds [lindex [info level -2] 0] } proc BadProc {} { set i a incr i } trace add variable ::errorInfo write [namespace code EIWrite] catch BadProc trace remove variable ::errorInfo write [namespace code EIWrite] set cmds } -match glob -result {*BadProc*} # throw tests test error-8.1 {throw produces error 1 at level 0} { catch { throw FOO bar } } {1} test error-8.2 {throw behaves as error does at level 0} { catch { throw FOO bar } em1 opts1 catch { error bar {} FOO } em2 opts2 dict set opts1 -result $em1 dict set opts2 -result $em2 foreach key {-code -level -result -errorcode} { if { [dict get $opts1 $key] ne [dict get $opts2 $key] } { error "error/throw outcome differs on '$key'" } } } {} test error-8.3 {throw produces error 1 at level > 0} { proc throw_foo {} { throw FOO bar } catch { throw_foo } } {1} test error-8.4 {throw behaves as error does at level > 0} { proc throw_foo {} { throw FOO bar } proc error_foo {} { error bar {} FOO } catch { throw_foo } em1 opts1 catch { error_foo } em2 opts2 dict set opts1 -result $em1 dict set opts2 -result $em2 foreach key {-code -level -result -errorcode} { if { [dict get $opts1 $key] ne [dict get $opts2 $key] } { error "error/throw outcome differs on '$key'" } } } {} test error-8.5 {throw syntax checks} -returnCodes error -body { throw } -result {wrong # args: should be "throw type message"} test error-8.6 {throw syntax checks} -returnCodes error -body { throw a } -result {wrong # args: should be "throw type message"} test error-8.7 {throw syntax checks} -returnCodes error -body { throw a b c } -result {wrong # args: should be "throw type message"} test error-8.8 {throw syntax checks} -returnCodes error -body { throw "not a \{ list" foo } -result {unmatched open brace in list} test error-8.9 {throw syntax checks} -returnCodes error -body { throw {} foo } -result {type must be non-empty list} test error-8.10 {Bug 33b7abb8a2: throw stack usage} -returnCodes error -body { apply {code {throw $code foo}} {} } -result {type must be non-empty list} test error-8.11 {Bug 7174354ecb: throw error message} -returnCodes error -body { throw {not {}a list} x[]y } -result {list element in braces followed by "a" instead of space} # simple try tests: body completes with code ok test error-9.1 {try (ok, empty result) with no handlers} { try list } {} test error-9.2 {try (ok, non-empty result) with no handlers} { try { list a b c } } {a b c} test error-9.3 {try (ok, non-empty result) with trap handler} { try { list a b c } trap {} {} { list d e f } } {a b c} test error-9.4 {try (ok, non-empty result) with on handler} { try { list a b c } on break {} { list d e f } } {a b c} test error-9.5 {try (ok, non-empty result) with on ok handler} { try { list a b c } on ok {} { list d e f } } {d e f} test error-9.6 {try (compilation of simple finaly token only, bug [27520c9b17])} -body { set b {}; set l {} try {lappend l error} finally [lappend l set b] list $l $b } -cleanup { unset -nocomplain b l } -result {{set b error} {}} # simple try tests - "on" handler matching test error-10.1 {try with on ok} { try { list a b c } on ok {} { list d e f } } {d e f} test error-10.2 {try with on 0} { try { list a b c } on 0 {} { list d e f } } {d e f} test error-10.3 {try with on error (using error)} { try { error a b c } on error {} { list d e f } } {d e f} test error-10.4 {try with on error (using return -code)} { try { return -level 0 -code 1 a } on error {} { list d e f } } {d e f} test error-10.5 {try with on error (using throw)} { try { throw c a } on error {} { list d e f } } {d e f} test error-10.6 {try with on 1 (using error)} { try { error a b c } on 1 {} { list d e f } } {d e f} test error-10.7 {try with on return} { try { return [list a b c] } on return {} { list d e f } } {d e f} test error-10.8 {try with on break} { try { break } on break {} { list d e f } } {d e f} test error-10.9 {try with on continue} { try { continue } on continue {} { list d e f } } {d e f} test error-10.10 {try with on for arbitrary (decimal) return code} { try { return -level 0 -code 123456 } on 123456 {} { list d e f } } {d e f} test error-10.11 {try with on for arbitrary (hex) return code} { try { return -level 0 -code 0x123456 } on 0x123456 {} { list d e f } } {d e f} test error-10.12 {try with on for arbitrary return code (mixed number representations)} { try { return -level 0 -code 0x10 } on 16 {} { list d e f } } {d e f} # simple try tests - "trap" handler matching test error-11.1 {try with trap all} { try { throw FOO bar } trap {} {} { list d e f } } {d e f} test error-11.2 {try with trap (exact)} { try { throw FOO bar } trap {FOO} {} { list d e f } } {d e f} test error-11.3 {try with trap (prefix 1)} { try { throw [list FOO A B C D] bar } trap {FOO} {} { list d e f } } {d e f} test error-11.4 {try with trap (prefix 2)} { try { throw [list FOO A B C D] bar } trap {FOO A} {} { list d e f } } {d e f} test error-11.5 {try with trap (prefix 3)} { try { throw [list FOO A B C D] bar } trap {FOO A B} {} { list d e f } } {d e f} test error-11.6 {try with trap (prefix 4)} { try { throw [list FOO A B C D] bar } trap {FOO A B C} {} { list d e f } } {d e f} test error-11.7 {try with trap (exact, 5 elements)} { try { throw [list FOO A B C D] bar } trap {FOO A B C D} {} { list d e f } } {d e f} # simple try tests - variable assignment and result handling test error-12.1 {try with no variable assignment in on handler} { try { throw FOO bar } on error {} { list d e f } } {d e f} test error-12.2 {try with result variable assignment in on handler} { try { throw FOO bar } on error {res} { set res } } {bar} test error-12.3 {try with result variable assignment in on handler, var remains in scope} { try { throw FOO bar } on error {res} { list d e f } set res } {bar} test error-12.4 {try with result/opts variable assignment in on handler} { try { throw FOO bar } on error {res opts} { set r "$res,[dict get $opts -errorcode]" } } {bar,FOO} test error-12.5 {try with result/opts variable assignment in on handler, vars remain in scope} { try { throw FOO bar } on error {res opts} { list d e f } set r "$res,[dict get $opts -errorcode]" } {bar,FOO} test error-12.6 {try result is propagated if no matching handler} { try { list a b c } on error {} { list d e f } } {a b c} test error-12.7 {handler result is propagated if handler executes} { try { throw FOO bar } on error {} { list d e f } } {d e f} # negative case try tests - bad args to try test error-13.1 {try with no arguments} -body { # warning: error message may change try } -returnCodes error -match glob -result {wrong # args: *} test error-13.2 {try with body only (ok)} { try list } {} test error-13.3 {try with missing finally body} -body { # warning: error message may change try list finally } -returnCodes error -match glob -result {wrong # args to finally clause: *} test error-13.4 {try with bad handler keyword} -body { # warning: error message may change try list then a b c } -returnCodes error -match glob -result {bad handler *} test error-13.5 {try with partial handler #1} -body { # warning: error message may change try list on } -returnCodes error -match glob -result {wrong # args to on clause: *} test error-13.6 {try with partial handler #2} -body { # warning: error message may change try list on error } -returnCodes error -match glob -result {wrong # args to on clause: *} test error-13.7 {try with partial handler #3} -body { # warning: error message may change try list on error {em opts} } -returnCodes error -match glob -result {wrong # args to on clause: *} test error-13.8 {try with multiple handlers and finally (ok)} { try list on error {} {} trap {} {} {} finally {} } {} test error-13.9 {last handler body can't be a fallthrough #1} -body { try list on error {} {} on break {} - } -returnCodes error -result {last non-finally clause must not have a body of "-"} test error-13.10 {last handler body can't be a fallthrough #2} -body { try list on error {} {} on break {} - finally { list d e f } } -returnCodes error -result {last non-finally clause must not have a body of "-"} # try tests - multiple handlers (left-to-right matching, only one runs) test error-14.1 {try with multiple handlers (only one matches) #1} { try { throw FOO bar } on ok {} { list a b c } trap FOO {} { list d e f } } {d e f} test error-14.2 {try with multiple handlers (only one matches) #2} { try { throw FOO bar } trap FOO {} { list d e f } on ok {} { list a b c } } {d e f} test error-14.3 {try with multiple handlers (only one matches) #3} { try { throw FOO bar } on break {} { list x y z } trap FOO {} { list d e f } on ok {} { list a b c } } {d e f} test error-14.4 {try with multiple matching handlers (only the first in left-to-right order runs) #1} { try { throw FOO bar } on error {} { list a b c } trap FOO {} { list d e f } } {a b c} test error-14.5 {try with multiple matching handlers (only the first in left-to-right order runs) #2} { try { throw FOO bar } trap FOO {} { list d e f } on error {} { list a b c } } {d e f} test error-14.6 {try with multiple matching handlers (only the first in left-to-right order runs) #3} { try { throw FOO bar } trap {} {} { list d e f } on 1 {} { list a b c } } {d e f} test error-14.7 {try with multiple matching handlers (only the first in left-to-right order runs) #4} { try { throw FOO bar } on 1 {} { list a b c } trap {} {} { list d e f } } {a b c} test error-14.8 {try with handler-of-last-resort "trap {}"} { try { throw FOO bar } trap FOX {} { list a b c } trap {} {} { list d e f } } {d e f} test error-14.9 {try with handler-of-last-resort "on error"} { try { foo } trap FOX {} { list a b c } on error {} { list d e f } } {d e f} # try tests - propagation (no matching handlers) test error-15.1 {try with no handler (ok result propagates)} { try { list a b c } } {a b c} test error-15.2 {try with no matching handler (ok result propagates)} { try { list a b c } on error {} { list d e f } } {a b c} test error-15.3 {try with no handler (error result propagates)} -body { try { throw FOO bar } } -returnCodes error -result {bar} test error-15.4 {try with no matching handler (error result propagates)} -body { try { throw FOO bar } trap FOX {} { list a b c } } -returnCodes error -result {bar} test error-15.5 {try with no handler (return result propagates)} -body { try { return bar } } -returnCodes 2 -result {bar} test error-15.6 {try with no matching handler (break result propagates)} -body { try { if {1} break } on error {} { list a b c } } -returnCodes 3 -result {} test error-15.7 {try with no matching handler (unknown integer result propagates)} -body { try { return -level 0 -code 123456 } trap {} {} { list a b c } } -returnCodes 123456 -result {} foreach level {0 1 2 3} { foreach code {0 1 2 3 4 5} { # Following cases have different -errorinfo; avoid false alarms # TODO: examine whether these difference are as they ought to be. if {$level == 0 && $code == 1} continue foreach extras {{} {-bar soom}} { test error-15.8.$level.$code.[llength $extras] {[try] coverage} { set script {return -level $level -code $code {*}$extras foo} catch $script m1 o1 catch {try $script} m2 o2 set o1 [lsort -stride 2 $o1] set o2 [lsort -stride 2 $o2] expr {$o1 eq $o2 ? "ok" : "$o1\n\tis not equal to\n$o2"} } ok test error-15.9.$level.$code.[llength $extras] {[try] coverage} { set script {return -level $level -code $code {*}$extras foo} catch $script m1 o1 catch {try $script finally {}} m2 o2 set o1 [lsort -stride 2 $o1] set o2 [lsort -stride 2 $o2] expr {$o1 eq $o2 ? "ok" : "$o1\n\tis not equal to\n$o2"} } ok test error-15.10.$level.$code.[llength $extras] {[try] coverage} { set script {return -level $level -code $code {*}$extras foo} catch $script m1 o1 catch {try $script on $code {x y} {return -options $y $x}} m2 o2 set o1 [lsort -stride 2 $o1] set o2 [lsort -stride 2 $o2] expr {$o1 eq $o2 ? "ok" : "$o1\n\tis not equal to\n$o2"} } ok } } } # try tests - propagation (exceptions in handlers, exception chaining) test error-16.1 {try with successfully executed handler} { try { throw FOO bar } trap FOO {} { list a b c } } {a b c} test error-16.2 {try with exception (error) in handler} -body { try { throw FOO bar } trap FOO {} { throw BAR foo } } -returnCodes error -result {foo} test error-16.3 {try with exception (return) in handler} -body { try { throw FOO bar } trap FOO {} { return BAR } } -returnCodes 2 -result {BAR} test error-16.4 {try with exception (break) in handler #1} -body { try { throw FOO bar } trap FOO {} { break } } -returnCodes 3 -result {} test error-16.5 {try with exception (break) in handler #2} { for { set i 5 } { $i < 10 } { incr i } { try { throw FOO bar } trap FOO {} { break } } set i } {5} test error-16.6 {try with variable assignment and propagation #1} { # Ensure that the handler variables preserve the exception off the # try-body, and are not modified by the exception off the handler catch { try { throw FOO bar } trap FOO {em} { throw BAR baz } } set em } {bar} test error-16.7 {try with variable assignment and propagation #2} { catch { try { throw FOO bar } trap FOO {em opts} { throw BAR baz } } list $em [dict get $opts -errorcode] } {bar FOO} test error-16.8 {exception chaining (try=ok, handler=error)} -body { #FIXME is the intent of this test correct? catch { try { list a b c } on ok {em opts} { throw BAR baz } } tryem tryopts list $opts [dict get $tryopts -during] } -match pairwise -result equal test error-16.9 {exception chaining (try=error, handler=error)} -body { # The exception off the handler should chain to the exception off the # try-body (using the -during option) catch { try { throw FOO bar } trap {} {em opts} { throw BAR baz } } tryem tryopts list $opts [dict get $tryopts -during] } -match pairwise -result equal test error-16.10 {no exception chaining when handler is successful} { catch { try { throw FOO bar } trap {} {em opts} { list d e f } } tryem tryopts dict exists $tryopts -during } {0} test error-16.11 {no exception chaining when handler is a non-error exception} { catch { try { throw FOO bar } trap {} {em opts} { break } } tryem tryopts dict exists $tryopts -during } {0} test error-16.12 {compiled try with successfully executed handler} { apply {{} { try { throw FOO bar } trap FOO {} { list a b c } }} } {a b c} test error-16.13 {compiled try with exception (error) in handler} -body { apply {{} { try { throw FOO bar } trap FOO {} { throw BAR foo } }} } -returnCodes error -result {foo} test error-16.14 {compiled try with exception (return) in handler} -body { apply {{} { list [catch { try { throw FOO bar } trap FOO {} { return BAR } } msg] $msg }} } -result {2 BAR} test error-16.15 {compiled try with exception (break) in handler} { apply {{} { for { set i 5 } { $i < 10 } { incr i } { try { throw FOO bar } trap FOO {} { break } } return $i }} } {5} test error-16.16 {compiled try with exception (continue) in handler} { apply {{} { for { set i 5 } { $i < 10 } { incr i } { try { throw FOO bar } trap FOO {} { continue } incr i 20 } return $i }} } {10} test error-16.17 {compiled try with variable assignment and propagation #1} { # Ensure that the handler variables preserve the exception off the # try-body, and are not modified by the exception off the handler apply {{} { catch { try { throw FOO bar } trap FOO {em} { throw BAR baz } } return $em }} } {bar} test error-16.18 {compiled try with variable assignment and propagation #2} { apply {{} { catch { try { throw FOO bar } trap FOO {em opts} { throw BAR baz } } list $em [dict get $opts -errorcode] }} } {bar FOO} test error-16.19 {compiled try exception chaining (try=ok, handler=error)} -body { #FIXME is the intent of this test correct? apply {{} { catch { try { list a b c } on ok {em opts} { throw BAR baz } } tryem tryopts list $opts [dict get $tryopts -during] }} } -match pairwise -result equal test error-16.20 {compiled try exception chaining (try=error, handler=error)} -body { # The exception off the handler should chain to the exception off the # try-body (using the -during option) apply {{} { catch { try { throw FOO bar } trap {} {em opts} { throw BAR baz } } tryem tryopts list $opts [dict get $tryopts -during] }} } -match pairwise -result equal test error-16.21 {compiled try exception chaining (try=error, finally=error)} { # The exception off the handler should chain to the exception off the # try-body (using the -during option) apply {{} { catch { try { throw FOO bar } finally { throw BAR baz } } tryem tryopts dict get $tryopts -during -errorcode }} } FOO test error-16.22 {compiled try: no exception chaining when handler is successful} { apply {{} { catch { try { throw FOO bar } trap {} {em opts} { list d e f } } tryem tryopts dict exists $tryopts -during }} } {0} test error-16.23 {compiled try: no exception chaining when handler is a non-error exception} { apply {{} { catch { try { throw FOO bar } trap {} {em opts} { break } } tryem tryopts dict exists $tryopts -during }} } {0} test error-16.24 {compiled try exception chaining (try=ok, handler=error, finally=error)} -body { apply {{} { catch { try { list a b c } on ok {em opts} { throw BAR baz } finally { throw DING dong } } tryem tryopts list $opts [dict get $tryopts -during -during] }} } -match pairwise -result equal test error-16.25 {compiled try exception chaining (all errors)} -body { apply {{} { catch { try { throw FOO bar } on error {em opts} { throw BAR baz } finally { throw DING dong } } tryem tryopts list $opts [dict get $tryopts -during -during] }} } -match pairwise -result equal # try tests - finally test error-17.1 {finally always runs (try with ok result)} { set RES {} try { list a b c } finally { set RES done } set RES } {done} test error-17.2 {finally always runs (try with error result)} { set RES {} catch { try { throw FOO bar } finally { set RES done } } set RES } {done} test error-17.3 {finally always runs (try with matching handler)} { set RES {} try { throw FOO bar } trap FOO {} { list a b c } finally { set RES done } set RES } {done} test error-17.4 {finally always runs (try with exception in handler)} { set RES {} catch { try { throw FOO bar } trap FOO {} { throw BAR baz } finally { set RES done } } set RES } {done} test error-17.5 {successful finally doesn't modify try outcome (try=ok)} { try { list a b c } finally { list d e f } } {a b c} test error-17.6 {successful finally doesn't modify try outcome (try=return)} -body { try { return c } finally { list d e f } } -returnCodes 2 -result {c} test error-17.7 {successful finally doesn't modify try outcome (try=error)} -body { try { error bar } finally { list d e f } } -returnCodes 1 -result {bar} test error-17.8 {successful finally doesn't modify handler outcome (handler=ok)} { try { throw FOO bar } trap FOO {} { list a b c } finally { list d e f } } {a b c} test error-17.9 {successful finally doesn't modify handler outcome (handler=error)} -body { try { throw FOO bar } trap FOO {} { throw BAR baz } finally { list d e f } } -returnCodes error -result {baz} test error-17.10 {successful finally doesn't affect variable assignment} { catch { try { throw FOO bar } trap FOO {em opts} { list d e f } finally { list d e f } } result list $em $result } {bar {d e f}} test error-17.11 {successful finally doesn't affect variable assignment or propagation} { catch { try { throw FOO bar } trap FOO {em opts} { throw BAR baz } finally { list d e f } } list $em [dict get $opts -errorcode] } {bar FOO} # try tests - propagation (exceptions in finally, exception chaining) test error-18.1 {try (ok) with exception in finally (error)} -body { try { list a b c } finally { throw BAR foo } } -returnCodes error -result {foo} test error-18.2 {try (error) with exception in finally (break)} -body { try { throw FOO bar } finally { break } } -returnCodes 3 -result {} test error-18.3 {try (ok) with handler (ok) and exception in finally (error)} -body { try { list a b c } on ok {} { list d e f } finally { throw BAR foo } } -returnCodes error -result {foo} test error-18.4 {try (error) with exception in handler (error) and in finally (arb code)} -body { try { throw FOO bar } on error {} { throw BAR baz } finally { return -level 0 -code 99 zing } } -returnCodes 99 -result {zing} test error-18.5 {exception in finally doesn't affect variable assignment} { catch { try { throw FOO bar } trap FOO {em opts} { throw BAR baz } finally { throw BAZ zing } } list $em [dict get $opts -errorcode] } {bar FOO} test error-18.6 {exception chaining in finally (try=ok)} -body { catch { list a b c } em expopts catch { try { list a b c } finally { throw BAR foo } } em opts list $expopts [dict get $opts -during] } -match pairwise -result equal test error-18.7 {exception chaining in finally (try=error)} { catch { try { throw FOO bar } finally { throw BAR baz } } em opts dict get $opts -during -errorcode } {FOO} test error-18.8 {exception chaining in finally (try=ok, handler=ok)} { catch { try { list a b c } on ok {} { list d e f } finally { throw BAR baz } } em opts list [dict get $opts -during -code] [dict exists $opts -during -during] } {0 0} test error-18.9 {exception chaining in finally (try=error, handler=ok)} { catch { try { throw FOO bar } on error {} { list d e f } finally { throw BAR baz } } em opts list [dict get $opts -during -code] [dict exists $opts -during -during] } {0 0} test error-18.10 {exception chaining in finally (try=error, handler=error)} { catch { try { throw FOO bar } on error {} { throw BAR baz } finally { throw BAR baz } } em opts list [dict get $opts -during -errorcode] [dict get $opts -during -during -errorcode] } {BAR FOO} test error-18.11 {no exception chaining if finally produces a non-error exception} { catch { try { throw FOO bar } on error {} { throw BAR baz } finally { break } } em opts dict exists $opts -during } {0} test error-18.12 {variable assignment unaffected by exception in finally} { catch { try { throw FOO bar } on error {em opts} { list a b c } finally { throw BAR baz } } list $em [dict get $opts -errorcode] } {bar FOO} # try tests - fall-through body cases test error-19.1 {try with fallthrough body #1} { set RES {} try { list a b c } on ok { set RES 0 } - on error {} { set RES 1 } set RES } {1} test error-19.2 {try with fallthrough body #2} { set RES {} try { throw FOO bar } trap BAR {} { } trap FOO {} - trap {} {} { set RES foo } on error {} { set RES err } set RES } {foo} test error-19.3 {try with cascade fallthrough} { set RES {} try { throw FOO bar } trap FOO {} - trap BAR {} - trap {} {} { set RES trap } on error {} { set RES err } set RES } {trap} test error-19.4 {multiple unrelated fallthroughs #1} { set RES {} try { throw FOO bar } trap FOO {} - trap BAR {} { set RES foo } trap {} {} - on error {} { set RES err } set RES } {foo} test error-19.5 {multiple unrelated fallthroughs #2} { set RES {} try { throw BAZ zing } trap FOO {} - trap BAR {} { set RES foo } trap {} {} - on error {} { set RES err } set RES } {err} proc addmsg msg { variable RES lappend RES $msg } test error-19.6 {compiled try executes all clauses} -setup { set RES {} } -body { apply {{} { try { addmsg a throw bar hello } trap bar {res opt} { addmsg b } finally { addmsg c } addmsg d } ::tcl::test::error} } -cleanup { unset RES } -result {a b c d} test error-19.7 {compiled try executes all clauses} -setup { set RES {} } -body { apply {{} { try { addmsg a } on error {res opt} { addmsg b } on ok {} { addmsg c } finally { addmsg d } addmsg e } ::tcl::test::error} } -cleanup { unset RES } -result {a c d e} test error-19.8 {compiled try executes all clauses} -setup { set RES {} } -body { apply {{} { try { addmsg a throw bar hello } trap bar {res opt} { addmsg b } addmsg c } ::tcl::test::error} } -cleanup { unset RES } -result {a b c} test error-19.9 {compiled try executes all clauses} -setup { set RES {} } -body { apply {{} { try { addmsg a } on error {res opt} { addmsg b } on ok {} { addmsg c } addmsg d } ::tcl::test::error} } -cleanup { unset RES } -result {a c d} test error-19.10 {compiled try with chained clauses} -setup { set RES {} } -body { list [apply {{} { try { return good } on return {res} - on ok {res} { addmsg ok addmsg $res return handler } finally { addmsg finally } } ::tcl::test::error}] $RES } -cleanup { unset RES } -result {handler {ok good finally}} test error-19.11 {compiled try and errors on variable write} -setup { set RES {} } -body { apply {{} { array set foo {bar boo} set bar unset catch { try { addmsg body return a } on return {bar foo} { addmsg handler return b } finally { addmsg finally,$bar } } msg addmsg $msg } ::tcl::test::error} } -cleanup { unset RES } -result {body finally,a {can't set "foo": variable is array}} test error-19.12 {interpreted try and errors on variable write} -setup { set RES {} } -body { apply {try { array set foo {bar boo} set bar unset catch { $try { addmsg body return a } on return {bar foo} { addmsg handler return b } finally { addmsg finally,$bar } } msg addmsg $msg } ::tcl::test::error} try } -cleanup { unset RES } -result {body finally,a {can't set "foo": variable is array}} test error-19.13 {compiled try and errors on variable write} -setup { set RES {} } -body { apply {{} { array set foo {bar boo} set bar unset catch { try { addmsg body return a } on return {bar foo} - on error {bar foo} { addmsg handler return b } finally { addmsg finally,$bar } } msg addmsg $msg } ::tcl::test::error} } -cleanup { unset RES } -result {body finally,a {can't set "foo": variable is array}} rename addmsg {} # FIXME test what vars get set on fallthough ... what is the correct behavior? # It would seem appropriate to set at least those for the matching handler and # the executed body; possibly for each handler we fall through as well? # negative case try tests - bad "on" handler test error-20.1 {bad code name in on handler} -body { try { list a b c } on err {} {} } -returnCodes error -match glob -result {bad completion code "err": must be ok, error, return, break, continue*, or an integer} test error-20.2 {bad code value in on handler} -body { try { list a b c } on 34985723094872345 {} {} } -returnCodes error -match glob -result {bad completion code "34985723094872345": must be ok, error, return, break, continue*, or an integer} test error-21.1 {memory leaks in try: Bug 2910044} memory { leaktest { try {string repeat x 10} on ok {} {} } } 0 test error-21.2 {memory leaks in try: Bug 2910044} memory { leaktest { try {error [string repeat x 10]} on error {} {} } } 0 test error-21.3 {memory leaks in try: Bug 2910044} memory { leaktest { try {throw FOO [string repeat x 10]} trap FOO {} {} } } 0 test error-21.4 {memory leaks in try: Bug 2910044} memory { leaktest { try {string repeat x 10} } } 0 test error-21.5 {memory leaks in try: Bug 2910044} memory { leaktest { try {string repeat x 10} on ok {} {} finally {string repeat y 10} } } 0 test error-21.6 {memory leaks in try: Bug 2910044} memory { leaktest { try { error [string repeat x 10] } on error {} {} finally { string repeat y 10 } } } 0 test error-21.7 {memory leaks in try: Bug 2910044} memory { leaktest { try { throw FOO [string repeat x 10] } trap FOO {} {} finally { string repeat y 10 } } } 0 test error-21.8 {memory leaks in try: Bug 2910044} memory { leaktest { try {string repeat x 10} finally {string repeat y 10} } } 0 test error-21.9 {Bug cee90e4e88} { # Just don't panic. apply {{} {try {} on ok {} - on return {} {}}} } {} # negative case try tests - bad "trap" handler # what is the effect if we attempt to trap an errorcode that is not a list? # nested try # catch inside try # no tests for bad varslist? # -errorcode but code!=1 doesn't trap # throw negative case tests (no args, too many args, etc) } namespace delete ::tcl::test::error # cleanup catch {rename p ""} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/env.test0000644000175000017500000003251415104661341014407 0ustar sergeisergei# Commands covered: none (tests environment variable implementation) # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] testConstraint utf8system [string equal [encoding system] utf-8] if {[llength [auto_execok bash]]} { testConstraint haveBash 1 } # [exec] is required here to see the actual environment received by child # processes. proc getenv {} { global printenvScript catch {exec [interpreter] $printenvScript} out if {$out eq "child process exited abnormally"} { set out {} } return $out } proc envrestore {} { # Restore the environment variables at the end of the test. global env variable env2 foreach name [array names env] { unset env($name) } array set env $env2 return } proc envprep {} { # Save the current environment variables at the start of the test. global env variable keep variable env2 set env2 [array get env] foreach name [array names env] { # Keep some environment variables that support operation of the tcltest # package. if {[string toupper $name] ni [string toupper $keep]} { unset env($name) } } return } proc encodingrestore {} { variable sysenc encoding system $sysenc return } proc encodingswitch encoding { variable sysenc # Need to run [getenv] in known encoding, so save the current one here... set sysenc [encoding system] encoding system $encoding return } proc setup1 {} { global env envprep encodingswitch iso8859-1 } proc setup2 {} { global env setup1 set env(NAME1) {test string} set env(NAME2) {new value} set env(XYZZY) {garbage} } proc cleanup1 {} { encodingrestore envrestore } # OANOCACHE comes from Application Verifier variable keep { TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH PURE_PROG_NAME DISPLAY SHLIB_PATH SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING MSYSTEM __CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM CommonProgramFiles CommonProgramFiles(x86) OANOCACHE ProgramFiles ProgramFiles(x86) CommonProgramW6432 ProgramW6432 PROCESSOR_ARCHITECTURE PROCESSOR_ARCHITEW6432 USERPROFILE WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR WINELOADER WINEUSERLOCALE WINEUSERNAME } variable printenvScript [makeFile [string map [list @keep@ [list $keep]] { encoding system iso8859-1 proc lrem {listname name} { upvar $listname list set i [lsearch -nocase $list $name] if {$i >= 0} { set list [lreplace $list $i $i] } return $list } proc mangle s { regsub -all {\[|\\|\]} $s {\\&} s regsub -all "\[\u0000-\u001f\u007f-\uffff\]" $s {[manglechar {&}]} s return [subst -novariables $s] } proc manglechar c { return [format {\u%04x} [scan $c %c]] } set names [lsort [array names env]] if {$tcl_platform(platform) eq "windows"} { lrem names HOME lrem names COMSPEC lrem names ComSpec lrem names "" } foreach name @keep@ { lrem names $name } foreach p $names { puts [mangle $p]=[mangle $env($p)] } exit }] printenv] test env-1.1 {propagation of env values to child interpreters} -setup { catch {interp delete child} catch {unset env(test)} } -body { interp create child set env(test) garbage child eval {set env(test)} } -cleanup { interp delete child unset env(test) } -result {garbage} # This one crashed on Solaris under Tcl8.0, so we only want to make sure it # runs. test env-1.2 {lappend to env value} -setup { catch {unset env(test)} } -body { set env(test) aaaaaaaaaaaaaaaa append env(test) bbbbbbbbbbbbbb unset env(test) } test env-1.3 {reflection of env by "array names"} -setup { catch {interp delete child} catch {unset env(test)} } -body { interp create child child eval {set env(test) garbage} expr {"test" in [array names env]} } -cleanup { interp delete child catch {unset env(test)} } -result 1 test env-2.1 { adding environment variables } -constraints exec -setup setup1 -body { getenv } -cleanup cleanup1 -result {} test env-2.2 { adding environment variables } -constraints exec -setup setup1 -body { set env(NAME1) "test string" getenv } -cleanup cleanup1 -result {NAME1=test string} test env-2.3 {adding environment variables} -constraints exec -setup { setup1 set env(NAME1) "test string" } -body { set env(NAME2) "more" getenv } -cleanup cleanup1 -result {NAME1=test string NAME2=more} test env-2.4 { adding environment variables } -constraints exec -setup { setup1 set env(NAME1) "test string" set env(NAME2) "more" } -body { set env(XYZZY) "garbage" getenv } -cleanup { cleanup1 } -result {NAME1=test string NAME2=more XYZZY=garbage} test env-2.5 {different encoding (wide chars)} -constraints {win exec} -setup { # be sure set of (Unicode) environment occurs if single-byte encoding is used: encodingswitch cp1252 # German (cp1252) and Russian (cp1251) characters together encoded as utf-8: set val 2d2dc3a4c3b6c3bcc39f2dd182d0b5d181d1822d2d set env(XYZZY) [encoding convertfrom utf-8 [binary decode hex $val]] # now switch to utf-8 (to see correct values from test): encoding system utf-8 } -body { exec [interpreter] << [string map [list \$val $val] { encoding system utf-8; fconfigure stdout -encoding utf-8 set test [encoding convertfrom utf-8 [binary decode hex $val]] puts "[expr {$env(XYZZY) eq $test}] \ngot:\t\ $env(XYZZY) ([binary encode hex [encoding convertto $env(XYZZY)]]) \nexp:\t\ $test ([binary encode hex [encoding convertto $test]])" }] } -cleanup { encodingrestore unset -nocomplain val f env(XYZZY) } -match glob -result {1 *} test env-3.1 { changing environment variables } -constraints exec -setup setup2 -body { set result [getenv] unset env(NAME2) set result } -cleanup { cleanup1 } -result {NAME1=test string NAME2=new value XYZZY=garbage} test env-4.1 { unsetting environment variables } -constraints exec -setup setup2 -body { unset -nocomplain env(NAME2) getenv } -cleanup cleanup1 -result {NAME1=test string XYZZY=garbage} # env-4.2 is deleted test env-4.3 { setting international environment variables } -constraints exec -setup setup1 -body { set env(\ua7) \ub6 getenv } -cleanup cleanup1 -result {\u00a7=\u00b6} test env-4.4 { changing international environment variables } -constraints exec -setup setup1 -body { set env(\ua7) \ua7 getenv } -cleanup cleanup1 -result {\u00a7=\u00a7} test env-4.5 { unsetting international environment variables } -constraints exec -setup { setup1 set env(\ua7) \ua7 } -body { set env(\ub6) \ua7 unset env(\ua7) getenv } -cleanup cleanup1 -result {\u00b6=\u00a7} test env-5.0 { corner cases - set a value, it should exist } -setup setup1 -body { set env(temp) a set env(temp) } -cleanup cleanup1 -result a test env-5.1 { corner cases - remove one elem at a time } -setup setup1 -body { # When no environment variables exist, the env var will contain no # entries. The "array names" call syncs up the C-level environ array with # the Tcl level env array. Make sure an empty Tcl array is created. foreach e [array names env] { unset env($e) } array size env } -cleanup cleanup1 -result 0 test env-5.2 {corner cases - unset the env array} -setup { interp create i } -body { # Unsetting a variable in an interp detaches the C-level traces from the # Tcl "env" variable. i eval { unset env set env(THIS_SHOULDNT_EXIST) a } info exists env(THIS_SHOULDNT_EXIST) } -cleanup { interp delete i } -result {0} test env-5.3 {corner cases: unset the env in parent should unset child} -setup { setup1 interp create i } -body { # Variables deleted in a parent interp should be deleted in child interp # too. i eval {set env(THIS_SHOULD_EXIST) a} set result [set env(THIS_SHOULD_EXIST)] unset env(THIS_SHOULD_EXIST) lappend result [i eval {catch {set env(THIS_SHOULD_EXIST)}}] } -cleanup { cleanup1 interp delete i } -result {a 1} test env-5.4 {corner cases - unset the env array} -setup { setup1 interp create i } -body { # The info exists command should be in sync with the env array. # Know Bug: 1737 i eval {set env(THIS_SHOULD_EXIST) a} set result [info exists env(THIS_SHOULD_EXIST)] lappend result [set env(THIS_SHOULD_EXIST)] lappend result [info exists env(THIS_SHOULD_EXIST)] } -cleanup { cleanup1 interp delete i } -result {1 a 1} test env-5.5 { corner cases - cannot have null entries on Windows } -constraints win -body { set env() a catch {set env()} } -cleanup cleanup1 -result 1 test env-6.1 {corner cases - add lots of env variables} -setup setup1 -body { set size [array size env] for {set i 0} {$i < 100} {incr i} { set env(BOGUS$i) $i } expr {[array size env] - $size} } -cleanup cleanup1 -result 100 test env-7.1 {[219226]: whole env array should not be unset by read} -body { set n [array size env] set s [array startsearch env] while {[array anymore env $s]} { array nextelement env $s incr n -1 } array donesearch env $s return $n } -result 0 test env-7.2 { [219226]: links to env elements should not be removed by read } -setup setup1 -body { apply {{} { set ::env(test7_2) ok upvar env(test7_2) elem set ::env(PATH) return $elem }} } -cleanup cleanup1 -result ok test env-7.3 { [9b4702]: testing existence of env(some_thing) should not destroy trace } -setup setup1 -body { apply {{} { catch {unset ::env(test7_3)} proc foo args { set ::env(test7_3) ok } trace add variable ::env(not_yet_existent) write foo info exists ::env(not_yet_existent) set ::env(not_yet_existent) "Now I'm here"; return [info exists ::env(test7_3)] }} } -cleanup cleanup1 -result 1 test env-7.4 { get env variable through upvar } -setup setup1 -body { apply {{} { set ::env(test7_4) origvalue upvar #0 env(test7_4) var return $var }} } -cleanup cleanup1 -result origvalue test env-7.5 { set env variable through upvar } -setup setup1 -body { apply {{} { set ::env(test7_5) origvalue upvar #0 env(test7_5) var set var newvalue return $::env(test7_5) }} } -cleanup cleanup1 -result newvalue test env-7.6 { unset env variable through upvar } -setup setup1 -body { apply {{} { set ::env(test7_6) origvalue upvar #0 env(test7_6) var unset var return [array get env test7_6] }} } -cleanup cleanup1 -result {} test env-7.7 { create new (unset) env variable through upvar } -setup setup1 -body { apply {{} { unset -nocomplain ::env(test7_7) upvar #0 env(test7_7) var interp create interp1 set var newvalue set result [interp1 eval {info exists ::env(test7_7)}] if {$result} { lappend result [interp1 eval {set ::env(test7_7)}] } interp delete interp1 return $result }} } -cleanup cleanup1 -result {1 newvalue} test env-8.0 { memory usage - valgrind does not report reachable memory } -body { set res [set env(__DUMMY__) {i'm with dummy}] unset env(__DUMMY__) return $res } -result {i'm with dummy} test env-9.0 { Initialization of HOME from HOMEDRIVE and HOMEPATH } -constraints win -setup { setup1 unset -nocomplain ::env(HOME) set ::env(HOMEDRIVE) X: set ::env(HOMEPATH) \\home\\path } -cleanup { cleanup1 } -body { set pipe [open |[list [interpreter]] r+] puts $pipe {puts $::env(HOME); flush stdout; exit} flush $pipe set result [gets $pipe] close $pipe set result } -result {X:\home\path} test env-9.1 { Initialization of HOME from USERPROFILE } -constraints win -setup { setup1 unset -nocomplain ::env(HOME) unset -nocomplain ::env(HOMEDRIVE) unset -nocomplain ::env(HOMEPATH) } -cleanup { cleanup1 } -body { set pipe [open |[list [interpreter]] r+] puts $pipe {puts $::env(HOME); flush stdout; exit} flush $pipe set result [gets $pipe] close $pipe if {$result ne $::env(USERPROFILE)} { list ERROR $result ne $::env(USERPROFILE) } } -result {} test env-10.0 { Unequal environment strings test should test unequal } -constraints {unix haveBash utf8system knownBug} -setup { set tclScript [makeFile { puts [string equal $env(XX) $env(YY)] } tclScript] set shellCode { export XX=$'\351' export YY=$'\303\251' } append shellCode "[info nameofexecutable] $tclScript\n" set shScript [makeFile $shellCode shScript] } -body { exec {*}[auto_execok bash] $shScript } -result 0 # cleanup rename getenv {} rename envrestore {} rename envprep {} rename encodingrestore {} rename encodingswitch {} removeFile $printenvScript ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/encodingVectors.tcl0000644000175000017500000012141715104661341016557 0ustar sergeisergei# This file contains test vectors for verifying various encodings. They are # stored in a common file so that they can be sourced into the various test # modules that are dependent on encodings. This file contains statically defined # test vectors. In addition, it sources the ICU-generated test vectors from # icuUcmTests.tcl. # # Note that sourcing the file will reinitialize any existing encoding test # vectors. # # List of defined encoding profiles set encProfiles {tcl8 strict replace} set encDefaultProfile strict; # Should reflect the default from implementation # encValidStrings - Table of valid strings. # # Each row is # The pair should be unique for generated test ids to be unique. # STR is a string that can be encoded in the encoding ENCODING resulting # in the byte sequence BYTES. The CTRL field is a list that controls test # generation. It may contain zero or more of `solo`, `lead`, `tail` and # `middle` indicating that the generated tests should include the string # by itself, as the lead of a longer string, as the tail of a longer string # and in the middle of a longer string. If CTRL is empty, it is treated as # containing all four of the above. The CTRL field may also contain the # words knownBug or knownW3C which will cause the test generation for that # vector to be skipped. # # utf-16, utf-32 missing because they are automatically # generated based on le/be versions. set encValidStrings {}; # Reset the table lappend encValidStrings {*}{ ascii \u0000 00 {} {Lowest ASCII} ascii \u007F 7F {} {Highest ASCII} ascii \u007D 7D {} {Brace - just to verify test scripts are escaped correctly} ascii \u007B 7B {} {Terminating brace - just to verify test scripts are escaped correctly} utf-8 \u0000 00 {} {Unicode Table 3.7 Row 1} utf-8 \u007F 7F {} {Unicode Table 3.7 Row 1} utf-8 \u0080 C280 {} {Unicode Table 3.7 Row 2} utf-8 \u07FF DFBF {} {Unicode Table 3.7 Row 2} utf-8 \u0800 E0A080 {} {Unicode Table 3.7 Row 3} utf-8 \u0FFF E0BFBF {} {Unicode Table 3.7 Row 3} utf-8 \u1000 E18080 {} {Unicode Table 3.7 Row 4} utf-8 \uCFFF ECBFBF {} {Unicode Table 3.7 Row 4} utf-8 \uD000 ED8080 {} {Unicode Table 3.7 Row 5} utf-8 \uD7FF ED9FBF {} {Unicode Table 3.7 Row 5} utf-8 \uE000 EE8080 {} {Unicode Table 3.7 Row 6} utf-8 \uFFFF EFBFBF {} {Unicode Table 3.7 Row 6} utf-8 \U10000 F0908080 {} {Unicode Table 3.7 Row 7} utf-8 \U3FFFF F0BFBFBF {} {Unicode Table 3.7 Row 7} utf-8 \U40000 F1808080 {} {Unicode Table 3.7 Row 8} utf-8 \UFFFFF F3BFBFBF {} {Unicode Table 3.7 Row 8} utf-8 \U100000 F4808080 {} {Unicode Table 3.7 Row 9} utf-8 \U10FFFF F48FBFBF {} {Unicode Table 3.7 Row 9} utf-8 A\u03A9\u8A9E\U00010384 41CEA9E8AA9EF0908E84 {} {Unicode 2.5} utf-16le \u0000 0000 {} {Lowest code unit} utf-16le \uD7FF FFD7 {} {Below high surrogate range} utf-16le \uE000 00E0 {} {Above low surrogate range} utf-16le \uFFFF FFFF {} {Highest code unit} utf-16le \U010000 00D800DC {} {First surrogate pair} utf-16le \U10FFFF FFDBFFDF {} {First surrogate pair} utf-16le A\u03A9\u8A9E\U00010384 4100A9039E8A00D884DF {} {Unicode 2.5} utf-16be \u0000 0000 {} {Lowest code unit} utf-16be \uD7FF D7FF {} {Below high surrogate range} utf-16be \uE000 E000 {} {Above low surrogate range} utf-16be \uFFFF FFFF {} {Highest code unit} utf-16be \U010000 D800DC00 {} {First surrogate pair} utf-16be \U10FFFF DBFFDFFF {} {First surrogate pair} utf-16be A\u03A9\u8A9E\U00010384 004103A98A9ED800DF84 {} {Unicode 2.5} utf-32le \u0000 00000000 {} {Lowest code unit} utf-32le \uFFFF FFFF0000 {} {Highest BMP} utf-32le \U010000 00000100 {} {First supplementary} utf-32le \U10FFFF ffff1000 {} {Last supplementary} utf-32le A\u03A9\u8A9E\U00010384 41000000A90300009E8A000084030100 {} {Unicode 2.5} utf-32be \u0000 00000000 {} {Lowest code unit} utf-32be \uFFFF 0000FFFF {} {Highest BMP} utf-32be \U010000 00010000 {} {First supplementary} utf-32be \U10FFFF 0010FFFF {} {Last supplementary} utf-32be A\u03A9\u8A9E\U00010384 00000041000003A900008A9E00010384 {} {Unicode 2.5} } # encInvalidBytes - Table of invalid byte sequences # These are byte sequences that should appear for an encoding. Each row is # of the form # # The triple should be unique for test ids to be # unique. BYTES is a byte sequence that is invalid. EXPECTEDRESULT is the # expected string when the bytes are decoded using the PROFILE profile. # FAILINDEX gives the expected index of the invalid byte under that profile. The # CTRL field is a list that controls test generation. It may contain zero or # more of `solo`, `lead`, `tail` and `middle` indicating that the generated the # tail of a longer and in the middle of a longer string. If empty, it is treated # as containing all four of the above. The CTRL field may also contain the words # knownBug or knownW3C which will cause the test generation for that vector to # be skipped. # # utf-32 missing because they are automatically generated based on le/be # versions. set encInvalidBytes {}; # Reset the table # ascii - Any byte above 127 is invalid and is mapped # to the same numeric code point except for the range # 80-9F which is treated as cp1252. # This tests the TableToUtfProc code path. lappend encInvalidBytes {*}{ ascii 80 tcl8 \u20AC -1 {} {map to cp1252} ascii 80 replace \uFFFD -1 {} {Smallest invalid byte} ascii 80 strict {} 0 {} {Smallest invalid byte} ascii 81 tcl8 \u0081 -1 {} {map to cp1252} ascii 82 tcl8 \u201A -1 {} {map to cp1252} ascii 83 tcl8 \u0192 -1 {} {map to cp1252} ascii 84 tcl8 \u201E -1 {} {map to cp1252} ascii 85 tcl8 \u2026 -1 {} {map to cp1252} ascii 86 tcl8 \u2020 -1 {} {map to cp1252} ascii 87 tcl8 \u2021 -1 {} {map to cp1252} ascii 88 tcl8 \u02C6 -1 {} {map to cp1252} ascii 89 tcl8 \u2030 -1 {} {map to cp1252} ascii 8A tcl8 \u0160 -1 {} {map to cp1252} ascii 8B tcl8 \u2039 -1 {} {map to cp1252} ascii 8C tcl8 \u0152 -1 {} {map to cp1252} ascii 8D tcl8 \u008D -1 {} {map to cp1252} ascii 8E tcl8 \u017D -1 {} {map to cp1252} ascii 8F tcl8 \u008F -1 {} {map to cp1252} ascii 90 tcl8 \u0090 -1 {} {map to cp1252} ascii 91 tcl8 \u2018 -1 {} {map to cp1252} ascii 92 tcl8 \u2019 -1 {} {map to cp1252} ascii 93 tcl8 \u201C -1 {} {map to cp1252} ascii 94 tcl8 \u201D -1 {} {map to cp1252} ascii 95 tcl8 \u2022 -1 {} {map to cp1252} ascii 96 tcl8 \u2013 -1 {} {map to cp1252} ascii 97 tcl8 \u2014 -1 {} {map to cp1252} ascii 98 tcl8 \u02DC -1 {} {map to cp1252} ascii 99 tcl8 \u2122 -1 {} {map to cp1252} ascii 9A tcl8 \u0161 -1 {} {map to cp1252} ascii 9B tcl8 \u203A -1 {} {map to cp1252} ascii 9C tcl8 \u0153 -1 {} {map to cp1252} ascii 9D tcl8 \u009D -1 {} {map to cp1252} ascii 9E tcl8 \u017E -1 {} {map to cp1252} ascii 9F tcl8 \u0178 -1 {} {map to cp1252} ascii FF tcl8 \u00FF -1 {} {Largest invalid byte} ascii FF replace \uFFFD -1 {} {Largest invalid byte} ascii FF strict {} 0 {} {Largest invalid byte} } # utf-8 - valid sequences based on Table 3.7 in the Unicode # standard. # # Code Points First Second Third Fourth Byte # U+0000..U+007F 00..7F # U+0080..U+07FF C2..DF 80..BF # U+0800..U+0FFF E0 A0..BF 80..BF # U+1000..U+CFFF E1..EC 80..BF 80..BF # U+D000..U+D7FF ED 80..9F 80..BF # U+E000..U+FFFF EE..EF 80..BF 80..BF # U+10000..U+3FFFF F0 90..BF 80..BF 80..BF # U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF # U+100000..U+10FFFF F4 80..8F 80..BF 80..BF # # Tests below are based on the "gaps" in the above table. Note ascii test # values are repeated because internally a different code path is used # (UtfToUtfProc). # Note C0, C1, F5:FF are invalid bytes ANYWHERE. Exception is C080 lappend encInvalidBytes {*}{ utf-8 80 tcl8 \u20AC -1 {} {map to cp1252} utf-8 80 replace \uFFFD -1 {} {Smallest invalid byte} utf-8 80 strict {} 0 {} {Smallest invalid byte} utf-8 81 tcl8 \u0081 -1 {} {map to cp1252} utf-8 82 tcl8 \u201A -1 {} {map to cp1252} utf-8 83 tcl8 \u0192 -1 {} {map to cp1252} utf-8 84 tcl8 \u201E -1 {} {map to cp1252} utf-8 85 tcl8 \u2026 -1 {} {map to cp1252} utf-8 86 tcl8 \u2020 -1 {} {map to cp1252} utf-8 87 tcl8 \u2021 -1 {} {map to cp1252} utf-8 88 tcl8 \u02C6 -1 {} {map to cp1252} utf-8 89 tcl8 \u2030 -1 {} {map to cp1252} utf-8 8A tcl8 \u0160 -1 {} {map to cp1252} utf-8 8B tcl8 \u2039 -1 {} {map to cp1252} utf-8 8C tcl8 \u0152 -1 {} {map to cp1252} utf-8 8D tcl8 \u008D -1 {} {map to cp1252} utf-8 8E tcl8 \u017D -1 {} {map to cp1252} utf-8 8F tcl8 \u008F -1 {} {map to cp1252} utf-8 90 tcl8 \u0090 -1 {} {map to cp1252} utf-8 91 tcl8 \u2018 -1 {} {map to cp1252} utf-8 92 tcl8 \u2019 -1 {} {map to cp1252} utf-8 93 tcl8 \u201C -1 {} {map to cp1252} utf-8 94 tcl8 \u201D -1 {} {map to cp1252} utf-8 95 tcl8 \u2022 -1 {} {map to cp1252} utf-8 96 tcl8 \u2013 -1 {} {map to cp1252} utf-8 97 tcl8 \u2014 -1 {} {map to cp1252} utf-8 98 tcl8 \u02DC -1 {} {map to cp1252} utf-8 99 tcl8 \u2122 -1 {} {map to cp1252} utf-8 9A tcl8 \u0161 -1 {} {map to cp1252} utf-8 9B tcl8 \u203A -1 {} {map to cp1252} utf-8 9C tcl8 \u0153 -1 {} {map to cp1252} utf-8 9D tcl8 \u009D -1 {} {map to cp1252} utf-8 9E tcl8 \u017E -1 {} {map to cp1252} utf-8 9F tcl8 \u0178 -1 {} {map to cp1252} utf-8 C0 tcl8 \u00C0 -1 {} {C0 is invalid anywhere} utf-8 C0 strict {} 0 {} {C0 is invalid anywhere} utf-8 C0 replace \uFFFD -1 {} {C0 is invalid anywhere} utf-8 C080 tcl8 \u0000 -1 {} {C080 -> U+0 in Tcl's internal modified UTF8} utf-8 C080 strict {} 0 {} {C080 -> invalid} utf-8 C080 replace \uFFFD -1 {} {C080 -> single replacement char} utf-8 C0A2 tcl8 \u00C0\u00A2 -1 {} {websec.github.io - A} utf-8 C0A2 replace \uFFFD\uFFFD -1 {} {websec.github.io - A} utf-8 C0A2 strict {} 0 {} {websec.github.io - A} utf-8 C0A7 tcl8 \u00C0\u00A7 -1 {} {websec.github.io - double quote} utf-8 C0A7 replace \uFFFD\uFFFD -1 {} {websec.github.io - double quote} utf-8 C0A7 strict {} 0 {} {websec.github.io - double quote} utf-8 C0AE tcl8 \u00C0\u00AE -1 {} {websec.github.io - full stop} utf-8 C0AE replace \uFFFD\uFFFD -1 {} {websec.github.io - full stop} utf-8 C0AE strict {} 0 {} {websec.github.io - full stop} utf-8 C0AF tcl8 \u00C0\u00AF -1 {} {websec.github.io - solidus} utf-8 C0AF replace \uFFFD\uFFFD -1 {} {websec.github.io - solidus} utf-8 C0AF strict {} 0 {} {websec.github.io - solidus} utf-8 C1 tcl8 \u00C1 -1 {} {C1 is invalid everywhere} utf-8 C1 replace \uFFFD -1 {} {C1 is invalid everywhere} utf-8 C1 strict {} 0 {} {C1 is invalid everywhere} utf-8 C181 tcl8 \u00C1\u0081 -1 {} {websec.github.io - base test (A)} utf-8 C181 replace \uFFFD\uFFFD -1 {} {websec.github.io - base test (A)} utf-8 C181 strict {} 0 {} {websec.github.io - base test (A)} utf-8 C19C tcl8 \u00C1\u0153 -1 {} {websec.github.io - reverse solidus} utf-8 C19C replace \uFFFD\uFFFD -1 {} {websec.github.io - reverse solidus} utf-8 C19C strict {} 0 {} {websec.github.io - reverse solidus} utf-8 C2 tcl8 \u00C2 -1 {} {Missing trail byte} utf-8 C2 replace \uFFFD -1 {} {Missing trail byte} utf-8 C2 strict {} 0 {} {Missing trail byte} utf-8 C27F tcl8 \u00C2\x7F -1 {} {Trail byte must be 80:BF} utf-8 C27F replace \uFFFD\x7F -1 {} {Trail byte must be 80:BF} utf-8 C27F strict {} 0 {} {Trail byte must be 80:BF} utf-8 DF tcl8 \u00DF -1 {} {Missing trail byte} utf-8 DF replace \uFFFD -1 {} {Missing trail byte} utf-8 DF strict {} 0 {} {Missing trail byte} utf-8 DF7F tcl8 \u00DF\x7F -1 {} {Trail byte must be 80:BF} utf-8 DF7F replace \uFFFD\x7F -1 {} {Trail byte must be 80:BF} utf-8 DF7F strict {} 0 {} {Trail byte must be 80:BF} utf-8 DFE0A080 tcl8 \u00DF\u0800 -1 {} {Invalid trail byte is start of valid sequence} utf-8 DFE0A080 replace \uFFFD\u0800 -1 {} {Invalid trail byte is start of valid sequence} utf-8 DFE0A080 strict {} 0 {} {Invalid trail byte is start of valid sequence} utf-8 E0 tcl8 \u00E0 -1 {} {Missing trail byte} utf-8 E0 replace \uFFFD -1 {} {Missing trail byte} utf-8 E0 strict {} 0 {} {Missing trail byte} utf-8 E080 tcl8 \u00E0\u20AC -1 {} {First trail byte must be A0:BF} utf-8 E080 replace \uFFFD\uFFFD -1 {} {First trail byte must be A0:BF} utf-8 E080 strict {} 0 {} {First trail byte must be A0:BF} utf-8 E0819C tcl8 \u00E0\u0081\u0153 -1 {} {websec.github.io - reverse solidus} utf-8 E0819C replace \uFFFD\uFFFD\uFFFD -1 {} {websec.github.io - reverse solidus} utf-8 E0819C strict {} 0 {} {websec.github.io - reverse solidus} utf-8 E09F tcl8 \u00E0\u0178 -1 {} {First trail byte must be A0:BF} utf-8 E09F replace \uFFFD\uFFFD -1 {} {First trail byte must be A0:BF} utf-8 E09F strict {} 0 {} {First trail byte must be A0:BF} utf-8 E0A0 tcl8 \u00E0\u00A0 -1 {} {Missing second trail byte} utf-8 E0A0 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 E0A0 strict {} 0 {} {Missing second trail byte} utf-8 E0BF tcl8 \u00E0\u00BF -1 {} {Missing second trail byte} utf-8 E0BF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 E0BF strict {} 0 {} {Missing second trail byte} utf-8 E0A07F tcl8 \u00E0\u00A0\x7F -1 {} {Second trail byte must be 80:BF} utf-8 E0A07F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 E0A07F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 E0BF7F tcl8 \u00E0\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 E0BF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 E0BF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 E1 tcl8 \u00E1 -1 {} {Missing trail byte} utf-8 E1 replace \uFFFD -1 {} {Missing trail byte} utf-8 E1 strict {} 0 {} {Missing trail byte} utf-8 E17F tcl8 \u00E1\x7F -1 {} {Trail byte must be 80:BF} utf-8 E17F replace \uFFFD\x7F -1 {} {Trail byte must be 80:BF} utf-8 E17F strict {} 0 {} {Trail byte must be 80:BF} utf-8 E181 tcl8 \u00E1\u0081 -1 {} {Missing second trail byte} utf-8 E181 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 E181 strict {} 0 {} {Missing second trail byte} utf-8 E1BF tcl8 \u00E1\u00BF -1 {} {Missing second trail byte} utf-8 E1BF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 E1BF strict {} 0 {} {Missing second trail byte} utf-8 E1807F tcl8 \u00E1\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 E1807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 E1807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 E1BF7F tcl8 \u00E1\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 E1BF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 E1BF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 EC tcl8 \u00EC -1 {} {Missing trail byte} utf-8 EC replace \uFFFD -1 {} {Missing trail byte} utf-8 EC strict {} 0 {} {Missing trail byte} utf-8 EC7F tcl8 \u00EC\x7F -1 {} {Trail byte must be 80:BF} utf-8 EC7F replace \uFFFD\x7F -1 {} {Trail byte must be 80:BF} utf-8 EC7F strict {} 0 {} {Trail byte must be 80:BF} utf-8 EC81 tcl8 \u00EC\u0081 -1 {} {Missing second trail byte} utf-8 EC81 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EC81 strict {} 0 {} {Missing second trail byte} utf-8 ECBF tcl8 \u00EC\u00BF -1 {} {Missing second trail byte} utf-8 ECBF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 ECBF strict {} 0 {} {Missing second trail byte} utf-8 EC807F tcl8 \u00EC\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 EC807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 EC807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 ECBF7F tcl8 \u00EC\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 ECBF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 ECBF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 ED tcl8 \u00ED -1 {} {Missing trail byte} utf-8 ED replace \uFFFD -1 {} {Missing trail byte} utf-8 ED strict {} 0 {} {Missing trail byte} utf-8 ED7F tcl8 \u00ED\u7F -1 {} {First trail byte must be 80:9F} utf-8 ED7F replace \uFFFD\u7F -1 {} {First trail byte must be 80:9F} utf-8 ED7F strict {} 0 {} {First trail byte must be 80:9F} utf-8 EDA0 tcl8 \u00ED\u00A0 -1 {} {First trail byte must be 80:9F} utf-8 EDA0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:9F} utf-8 EDA0 strict {} 0 {} {First trail byte must be 80:9F} utf-8 ED81 tcl8 \u00ED\u0081 -1 {} {Missing second trail byte} utf-8 ED81 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 ED81 strict {} 0 {} {Missing second trail byte} utf-8 EDBF tcl8 \u00ED\u00BF -1 {} {Missing second trail byte} utf-8 EDBF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EDBF strict {} 0 {} {Missing second trail byte} utf-8 ED807F tcl8 \u00ED\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 ED807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 ED807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 ED9F7F tcl8 \u00ED\u0178\x7F -1 {} {Second trail byte must be 80:BF} utf-8 ED9F7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 ED9F7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 EDA080 tcl8 \uD800 -1 {} {High surrogate} utf-8 EDA080 replace \uFFFD -1 {} {High surrogate} utf-8 EDA080 strict {} 0 {} {High surrogate} utf-8 EDAFBF tcl8 \uDBFF -1 {} {High surrogate} utf-8 EDAFBF replace \uFFFD -1 {} {High surrogate} utf-8 EDAFBF strict {} 0 {} {High surrogate} utf-8 EDB080 tcl8 \uDC00 -1 {} {Low surrogate} utf-8 EDB080 replace \uFFFD -1 {} {Low surrogate} utf-8 EDB080 strict {} 0 {} {Low surrogate} utf-8 EDBFBF tcl8 \uDFFF -1 {} {Low surrogate} utf-8 EDBFBF replace \uFFFD -1 {} {Low surrogate} utf-8 EDBFBF strict {} 0 {} {Low surrogate} utf-8 EDA080EDB080 tcl8 \uD800\uDC00 -1 {} {High low surrogate pair} utf-8 EDA080EDB080 replace \uFFFD\uFFFD -1 {} {High low surrogate pair} utf-8 EDA080EDB080 strict {} 0 {} {High low surrogate pair} utf-8 EDAFBFEDBFBF tcl8 \uDBFF\uDFFF -1 {} {High low surrogate pair} utf-8 EDAFBFEDBFBF replace \uFFFD\uFFFD -1 {} {High low surrogate pair} utf-8 EDAFBFEDBFBF strict {} 0 {} {High low surrogate pair} utf-8 EE tcl8 \u00EE -1 {} {Missing trail byte} utf-8 EE replace \uFFFD -1 {} {Missing trail byte} utf-8 EE strict {} 0 {} {Missing trail byte} utf-8 EE7F tcl8 \u00EE\u7F -1 {} {First trail byte must be 80:BF} utf-8 EE7F replace \uFFFD\u7F -1 {} {First trail byte must be 80:BF} utf-8 EE7F strict {} 0 {} {First trail byte must be 80:BF} utf-8 EED0 tcl8 \u00EE\u00D0 -1 {} {First trail byte must be 80:BF} utf-8 EED0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:BF} utf-8 EED0 strict {} 0 {} {First trail byte must be 80:BF} utf-8 EE81 tcl8 \u00EE\u0081 -1 {} {Missing second trail byte} utf-8 EE81 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EE81 strict {} 0 {} {Missing second trail byte} utf-8 EEBF tcl8 \u00EE\u00BF -1 {} {Missing second trail byte} utf-8 EEBF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EEBF strict {} 0 {} {Missing second trail byte} utf-8 EE807F tcl8 \u00EE\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 EE807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 EE807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 EEBF7F tcl8 \u00EE\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 EEBF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 EEBF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 EF tcl8 \u00EF -1 {} {Missing trail byte} utf-8 EF replace \uFFFD -1 {} {Missing trail byte} utf-8 EF strict {} 0 {} {Missing trail byte} utf-8 EF7F tcl8 \u00EF\u7F -1 {} {First trail byte must be 80:BF} utf-8 EF7F replace \uFFFD\u7F -1 {} {First trail byte must be 80:BF} utf-8 EF7F strict {} 0 {} {First trail byte must be 80:BF} utf-8 EFD0 tcl8 \u00EF\u00D0 -1 {} {First trail byte must be 80:BF} utf-8 EFD0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:BF} utf-8 EFD0 strict {} 0 {} {First trail byte must be 80:BF} utf-8 EF81 tcl8 \u00EF\u0081 -1 {} {Missing second trail byte} utf-8 EF81 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EF81 strict {} 0 {} {Missing second trail byte} utf-8 EFBF tcl8 \u00EF\u00BF -1 {} {Missing second trail byte} utf-8 EFBF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 EFBF strict {} 0 {} {Missing second trail byte} utf-8 EF807F tcl8 \u00EF\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 EF807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 EF807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 EFBF7F tcl8 \u00EF\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 EFBF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 EFBF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F0 tcl8 \u00F0 -1 {} {Missing trail byte} utf-8 F0 replace \uFFFD -1 {} {Missing trail byte} utf-8 F0 strict {} 0 {} {Missing trail byte} utf-8 F080 tcl8 \u00F0\u20AC -1 {} {First trail byte must be 90:BF} utf-8 F080 replace \uFFFD -1 {knownW3C} {First trail byte must be 90:BF} utf-8 F080 strict {} 0 {} {First trail byte must be 90:BF} utf-8 F08F tcl8 \u00F0\u8F -1 {} {First trail byte must be 90:BF} utf-8 F08F replace \uFFFD -1 {knownW3C} {First trail byte must be 90:BF} utf-8 F08F strict {} 0 {} {First trail byte must be 90:BF} utf-8 F0D0 tcl8 \u00F0\u00D0 -1 {} {First trail byte must be 90:BF} utf-8 F0D0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 90:BF} utf-8 F0D0 strict {} 0 {} {First trail byte must be 90:BF} utf-8 F090 tcl8 \u00F0\u0090 -1 {} {Missing second trail byte} utf-8 F090 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F090 strict {} 0 {} {Missing second trail byte} utf-8 F0BF tcl8 \u00F0\u00BF -1 {} {Missing second trail byte} utf-8 F0BF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F0BF strict {} 0 {} {Missing second trail byte} utf-8 F0907F tcl8 \u00F0\u0090\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F0907F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F0907F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F0BF7F tcl8 \u00F0\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F0BF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F0BF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F090BF tcl8 \u00F0\u0090\u00BF -1 {} {Missing third trail byte} utf-8 F090BF replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F090BF strict {} 0 {} {Missing third trail byte} utf-8 F0BF81 tcl8 \u00F0\u00BF\u0081 -1 {} {Missing third trail byte} utf-8 F0BF81 replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F0BF81 strict {} 0 {} {Missing third trail byte} utf-8 F0BF807F tcl8 \u00F0\u00BF\u20AC\x7F -1 {} {Third trail byte must be 80:BF} utf-8 F0BF817F replace \uFFFD\x7F -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F0BF817F strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F090BFD0 tcl8 \u00F0\u0090\u00BF\u00D0 -1 {} {Third trail byte must be 80:BF} utf-8 F090BFD0 replace \uFFFD -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F090BFD0 strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F1 tcl8 \u00F1 -1 {} {Missing trail byte} utf-8 F1 replace \uFFFD -1 {} {Missing trail byte} utf-8 F1 strict {} 0 {} {Missing trail byte} utf-8 F17F tcl8 \u00F1\u7F -1 {} {First trail byte must be 80:BF} utf-8 F17F replace \uFFFD -1 {knownW3C} {First trail byte must be 80:BF} utf-8 F17F strict {} 0 {} {First trail byte must be 80:BF} utf-8 F1D0 tcl8 \u00F1\u00D0 -1 {} {First trail byte must be 80:BF} utf-8 F1D0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:BF} utf-8 F1D0 strict {} 0 {} {First trail byte must be 80:BF} utf-8 F180 tcl8 \u00F1\u20AC -1 {} {Missing second trail byte} utf-8 F180 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F180 strict {} 0 {} {Missing second trail byte} utf-8 F1BF tcl8 \u00F1\u00BF -1 {} {Missing second trail byte} utf-8 F1BF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F1BF strict {} 0 {} {Missing second trail byte} utf-8 F1807F tcl8 \u00F1\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F1807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F1807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F1BF7F tcl8 \u00F1\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F1BF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F1BF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F180BF tcl8 \u00F1\u20AC\u00BF -1 {} {Missing third trail byte} utf-8 F180BF replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F180BF strict {} 0 {} {Missing third trail byte} utf-8 F1BF81 tcl8 \u00F1\u00BF\u0081 -1 {} {Missing third trail byte} utf-8 F1BF81 replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F1BF81 strict {} 0 {} {Missing third trail byte} utf-8 F1BF807F tcl8 \u00F1\u00BF\u20AC\x7F -1 {} {Third trail byte must be 80:BF} utf-8 F1BF817F replace \uFFFD\x7F -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F1BF817F strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F180BFD0 tcl8 \u00F1\u20AC\u00BF\u00D0 -1 {} {Third trail byte must be 80:BF} utf-8 F180BFD0 replace \uFFFD -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F180BFD0 strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F3 tcl8 \u00F3 -1 {} {Missing trail byte} utf-8 F3 replace \uFFFD -1 {} {Missing trail byte} utf-8 F3 strict {} 0 {} {Missing trail byte} utf-8 F37F tcl8 \u00F3\x7F -1 {} {First trail byte must be 80:BF} utf-8 F37F replace \uFFFD -1 {knownW3C} {First trail byte must be 80:BF} utf-8 F37F strict {} 0 {} {First trail byte must be 80:BF} utf-8 F3D0 tcl8 \u00F3\u00D0 -1 {} {First trail byte must be 80:BF} utf-8 F3D0 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:BF} utf-8 F3D0 strict {} 0 {} {First trail byte must be 80:BF} utf-8 F380 tcl8 \u00F3\u20AC -1 {} {Missing second trail byte} utf-8 F380 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F380 strict {} 0 {} {Missing second trail byte} utf-8 F3BF tcl8 \u00F3\u00BF -1 {} {Missing second trail byte} utf-8 F3BF replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F3BF strict {} 0 {} {Missing second trail byte} utf-8 F3807F tcl8 \u00F3\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F3807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F3807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F3BF7F tcl8 \u00F3\u00BF\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F3BF7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F3BF7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F380BF tcl8 \u00F3\u20AC\u00BF -1 {} {Missing third trail byte} utf-8 F380BF replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F380BF strict {} 0 {} {Missing third trail byte} utf-8 F3BF81 tcl8 \u00F3\u00BF\u0081 -1 {} {Missing third trail byte} utf-8 F3BF81 replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F3BF81 strict {} 0 {} {Missing third trail byte} utf-8 F3BF807F tcl8 \u00F3\u00BF\u20AC\x7F -1 {} {Third trail byte must be 80:BF} utf-8 F3BF817F replace \uFFFD\x7F -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F3BF817F strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F380BFD0 tcl8 \u00F3\u20AC\u00BF\u00D0 -1 {} {Third trail byte must be 80:BF} utf-8 F380BFD0 replace \uFFFD -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F380BFD0 strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F4 tcl8 \u00F4 -1 {} {Missing trail byte} utf-8 F4 replace \uFFFD -1 {} {Missing trail byte} utf-8 F4 strict {} 0 {} {Missing trail byte} utf-8 F47F tcl8 \u00F4\u7F -1 {} {First trail byte must be 80:8F} utf-8 F47F replace \uFFFD\u7F -1 {knownW3C} {First trail byte must be 80:8F} utf-8 F47F strict {} 0 {} {First trail byte must be 80:8F} utf-8 F490 tcl8 \u00F4\u0090 -1 {} {First trail byte must be 80:8F} utf-8 F490 replace \uFFFD\uFFFD -1 {} {First trail byte must be 80:8F} utf-8 F490 strict {} 0 {} {First trail byte must be 80:8F} utf-8 F480 tcl8 \u00F4\u20AC -1 {} {Missing second trail byte} utf-8 F480 replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F480 strict {} 0 {} {Missing second trail byte} utf-8 F48F tcl8 \u00F4\u008F -1 {} {Missing second trail byte} utf-8 F48F replace \uFFFD -1 {knownW3C} {Missing second trail byte} utf-8 F48F strict {} 0 {} {Missing second trail byte} utf-8 F4807F tcl8 \u00F4\u20AC\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F4807F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F4807F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F48F7F tcl8 \u00F4\u008F\x7F -1 {} {Second trail byte must be 80:BF} utf-8 F48F7F replace \uFFFD\u7F -1 {knownW3C} {Second trail byte must be 80:BF} utf-8 F48F7F strict {} 0 {} {Second trail byte must be 80:BF} utf-8 F48081 tcl8 \u00F4\u20AC\u0081 -1 {} {Missing third trail byte} utf-8 F48081 replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F48081 strict {} 0 {} {Missing third trail byte} utf-8 F48F81 tcl8 \u00F4\u008F\u0081 -1 {} {Missing third trail byte} utf-8 F48F81 replace \uFFFD -1 {knownW3C} {Missing third trail byte} utf-8 F48F81 strict {} 0 {} {Missing third trail byte} utf-8 F481817F tcl8 \u00F4\u0081\u0081\x7F -1 {} {Third trail byte must be 80:BF} utf-8 F480817F replace \uFFFD\x7F -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F480817F strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F48FBFD0 tcl8 \u00F4\u008F\u00BF\u00D0 -1 {} {Third trail byte must be 80:BF} utf-8 F48FBFD0 replace \uFFFD -1 {knownW3C} {Third trail byte must be 80:BF} utf-8 F48FBFD0 strict {} 0 {} {Third trail byte must be 80:BF} utf-8 F5 tcl8 \u00F5 -1 {} {F5:FF are invalid everywhere} utf-8 F5 replace \uFFFD -1 {} {F5:FF are invalid everywhere} utf-8 F5 strict {} 0 {} {F5:FF are invalid everywhere} utf-8 FF tcl8 \u00FF -1 {} {F5:FF are invalid everywhere} utf-8 FF replace \uFFFD -1 {} {F5:FF are invalid everywhere} utf-8 FF strict {} 0 {} {F5:FF are invalid everywhere} utf-8 C0AFE080BFF0818130 replace \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\x30 -1 {} {Unicode Table 3-8} utf-8 EDA080EDBFBFEDAF30 replace \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\x30 -1 {knownW3C} {Unicode Table 3-9} utf-8 F4919293FF4180BF30 replace \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0041\uFFFD\uFFFD\x30 -1 {} {Unicode Table 3-10} utf-8 E180E2F09192F1BF30 replace \uFFFD\uFFFD\uFFFD\uFFFD\x30 -1 {knownW3C} {Unicode Table 3.11} } # utf16-le and utf16-be test cases. Note utf16 cases are automatically generated # based on these depending on platform endianness. Note truncated tests can only # happen when the sequence is at the end (including by itself) Thus {solo tail} # in some cases. lappend encInvalidBytes {*}{ utf-16le 41 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-16le 41 replace \uFFFD -1 {solo tail} {Truncated} utf-16le 41 strict {} 0 {solo tail} {Truncated} utf-16le 00D8 tcl8 \uD800 -1 {} {Missing low surrogate} utf-16le 00D8 replace \uFFFD -1 {} {Missing low surrogate} utf-16le 00D8 strict {} 0 {} {Missing low surrogate} utf-16le 00DC tcl8 \uDC00 -1 {} {Missing high surrogate} utf-16le 00DC replace \uFFFD -1 {} {Missing high surrogate} utf-16le 00DC strict {} 0 {} {Missing high surrogate} utf-16be 41 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-16be 41 replace \uFFFD -1 {solo tail} {Truncated} utf-16be 41 strict {} 0 {solo tail} {Truncated} utf-16be D800 tcl8 \uD800 -1 {} {Missing low surrogate} utf-16be D800 replace \uFFFD -1 {} {Missing low surrogate} utf-16be D800 strict {} 0 {} {Missing low surrogate} utf-16be DC00 tcl8 \uDC00 -1 {} {Missing high surrogate} utf-16be DC00 replace \uFFFD -1 {} {Missing high surrogate} utf-16be DC00 strict {} 0 {} {Missing high surrogate} } # utf32-le and utf32-be test cases. Note utf32 cases are automatically generated # based on these depending on platform endianness. Note truncated tests can only # happen when the sequence is at the end (including by itself) Thus {solo tail} # in some cases. lappend encInvalidBytes {*}{ utf-32le 41 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32le 41 replace \uFFFD -1 {solo} {Truncated} utf-32le 41 strict {} 0 {solo tail} {Truncated} utf-32le 4100 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32le 4100 replace \uFFFD -1 {solo} {Truncated} utf-32le 4100 strict {} 0 {solo tail} {Truncated} utf-32le 410000 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32le 410000 replace \uFFFD -1 {solo} {Truncated} utf-32le 410000 strict {} 0 {solo tail} {Truncated} utf-32le 00D80000 tcl8 \uD800 -1 {} {High-surrogate} utf-32le 00D80000 replace \uFFFD -1 {} {High-surrogate} utf-32le 00D80000 strict {} 0 {} {High-surrogate} utf-32le 00DC0000 tcl8 \uDC00 -1 {} {Low-surrogate} utf-32le 00DC0000 replace \uFFFD -1 {} {Low-surrogate} utf-32le 00DC0000 strict {} 0 {} {Low-surrogate} utf-32le 00D8000000DC0000 tcl8 \uD800\uDC00 -1 {} {High-low-surrogate-pair} utf-32le 00D8000000DC0000 replace \uFFFD\uFFFD -1 {} {High-low-surrogate-pair} utf-32le 00D8000000DC0000 strict {} 0 {} {High-low-surrogate-pair} utf-32le 00001100 tcl8 \uFFFD -1 {} {Out of range} utf-32le 00001100 replace \uFFFD -1 {} {Out of range} utf-32le 00001100 strict {} 0 {} {Out of range} utf-32le FFFFFFFF tcl8 \uFFFD -1 {} {Out of range} utf-32le FFFFFFFF replace \uFFFD -1 {} {Out of range} utf-32le FFFFFFFF strict {} 0 {} {Out of range} utf-32be 41 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32be 41 replace \uFFFD -1 {solo tail} {Truncated} utf-32be 41 strict {} 0 {solo tail} {Truncated} utf-32be 0041 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32be 0041 replace \uFFFD -1 {solo} {Truncated} utf-32be 0041 strict {} 0 {solo tail} {Truncated} utf-32be 000041 tcl8 \uFFFD -1 {solo tail} {Truncated} utf-32be 000041 replace \uFFFD -1 {solo} {Truncated} utf-32be 000041 strict {} 0 {solo tail} {Truncated} utf-32be 0000D800 tcl8 \uD800 -1 {} {High-surrogate} utf-32be 0000D800 replace \uFFFD -1 {} {High-surrogate} utf-32be 0000D800 strict {} 0 {} {High-surrogate} utf-32be 0000DC00 tcl8 \uDC00 -1 {} {Low-surrogate} utf-32be 0000DC00 replace \uFFFD -1 {} {Low-surrogate} utf-32be 0000DC00 strict {} 0 {} {Low-surrogate} utf-32be 0000D8000000DC00 tcl8 \uD800\uDC00 -1 {} {High-low-surrogate-pair} utf-32be 0000D8000000DC00 replace \uFFFD\uFFFD -1 {} {High-low-surrogate-pair} utf-32be 0000D8000000DC00 strict {} 0 {} {High-low-surrogate-pair} utf-32be 00110000 tcl8 \uFFFD -1 {} {Out of range} utf-32be 00110000 replace \uFFFD -1 {} {Out of range} utf-32be 00110000 strict {} 0 {} {Out of range} utf-32be FFFFFFFF tcl8 \uFFFD -1 {} {Out of range} utf-32be FFFFFFFF replace \uFFFD -1 {} {Out of range} utf-32be FFFFFFFF strict {} 0 {} {Out of range} } # Strings that cannot be encoded for specific encoding / profiles # # should be unique for test ids to be unique. # See earlier comments about CTRL field. # # Note utf-16, utf-32 missing because they are automatically # generated based on le/be versions. # TODO - out of range code point (note cannot be generated by \U notation) lappend encUnencodableStrings {*}{ ascii \u00e0 tcl8 3f -1 {} {unencodable} ascii \u00e0 strict {} 0 {} {unencodable} iso8859-1 \u0141 tcl8 3f -1 {} unencodable iso8859-1 \u0141 strict {} 0 {} unencodable utf-8 \uD800 tcl8 eda080 -1 {} Low-surrogate utf-8 \uD800 replace efbfbd -1 {} Low-surrogate utf-8 \uD800 strict {} 0 {} Low-surrogate utf-8 \uDC00 tcl8 edb080 -1 {} High-surrogate utf-8 \uDC00 strict {} 0 {} High-surrogate utf-8 \uDC00 replace efbfbd -1 {} High-surrogate } # The icuUcmTests.tcl is generated by the tools/ucm2tests.tcl script # and generates test vectors for the above tables for various encodings # based on ICU UCM files. # TODO - commented out for now as generating a lot of mismatches. # source [file join [file dirname [info script]] icuUcmTests.tcl] tcl9.0.3/tests/encoding.test0000644000175000017500000013737615104661341015421 0ustar sergeisergei# This file contains a collection of tests for tclEncoding.c # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] namespace eval ::tcl::test::encoding { variable x catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] } proc toutf {args} { variable x lappend x "toutf $args" } proc fromutf {args} { variable x lappend x "fromutf $args" } proc runtests {} { variable x # Some tests require the testencoding command testConstraint testencoding [llength [info commands testencoding]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint teststringbytes [llength [info commands teststringbytes]] testConstraint exec [llength [info commands exec]] # TclInitEncodingSubsystem is tested by the rest of this file # TclFinalizeEncodingSubsystem is not currently tested test encoding-1.1 {Tcl_GetEncoding: system encoding} -setup { set old [encoding system] } -constraints {testencoding} -body { testencoding create foo [namespace origin toutf] [namespace origin fromutf] encoding system foo set x {} encoding convertto abcd return $x } -cleanup { encoding system $old testencoding delete foo } -result {{fromutf }} test encoding-1.2 {Tcl_GetEncoding: existing encoding} {testencoding} { testencoding create foo [namespace origin toutf] [namespace origin fromutf] set x {} encoding convertto foo abcd testencoding delete foo return $x } {{fromutf }} test encoding-1.3 {Tcl_GetEncoding: load encoding} { list [encoding convertto jis0208 乎] \ [encoding convertfrom jis0208 8C] } "8C 乎" test encoding-2.1 {Tcl_FreeEncoding: refcount == 0} { encoding convertto jis0208 乎 } {8C} test encoding-2.2 {Tcl_FreeEncoding: refcount != 0} -setup { set system [encoding system] set path [encoding dirs] } -constraints {testencoding} -body { encoding system shiftjis ;# incr ref count encoding dirs [list [pwd]] set x [encoding convertto shiftjis 乎] ;# old one found encoding system iso8859-1 llength shiftjis ;# Shimmer away any cache of Tcl_Encoding lappend x [catch {encoding convertto shiftjis 乎} msg] $msg } -cleanup { encoding system iso8859-1 encoding dirs $path encoding system $system unset -nocomplain path } -result "\x8C\xC1 1 {unknown encoding \"shiftjis\"}" test encoding-3.1 {Tcl_GetEncodingName, NULL} -setup { set old [encoding system] } -body { encoding system shiftjis encoding system } -cleanup { encoding system $old } -result {shiftjis} test encoding-3.2 {Tcl_GetEncodingName, non-null} -setup { set old [fconfigure stdout -encoding] } -body { fconfigure stdout -encoding jis0208 fconfigure stdout -encoding } -cleanup { fconfigure stdout -encoding $old } -result {jis0208} test encoding-3.3 {fconfigure -profile} -setup { set old [fconfigure stdout -profile] } -body { fconfigure stdout -profile replace fconfigure stdout -profile } -cleanup { fconfigure stdout -profile $old } -result replace test encoding-4.1 {Tcl_GetEncodingNames} -constraints {testencoding} -setup { cd [makeDirectory tmp] makeDirectory [file join tmp encoding] set path [encoding dirs] encoding dirs {} catch {unset encodings} catch {unset x} } -body { foreach encoding [encoding names] { set encodings($encoding) 1 } makeFile {} [file join tmp encoding junk.enc] makeFile {} [file join tmp encoding junk2.enc] encoding dirs [list [file join [pwd] encoding]] foreach encoding [encoding names] { if {![info exists encodings($encoding)]} { lappend x $encoding } } lsort $x } -cleanup { encoding dirs $path cd [workingDirectory] removeFile [file join tmp encoding junk2.enc] removeFile [file join tmp encoding junk.enc] removeDirectory [file join tmp encoding] removeDirectory tmp unset -nocomplain path } -result {junk junk2} test encoding-5.1 {Tcl_SetSystemEncoding} -setup { set old [encoding system] } -body { encoding system jis0208 encoding convertto 乎 } -cleanup { encoding system iso8859-1 encoding system $old } -result {8C} test encoding-5.2 {Tcl_SetSystemEncoding: test ref count} { set old [encoding system] encoding system $old string compare $old [encoding system] } {0} test encoding-6.1 {Tcl_CreateEncoding: new} {testencoding} { testencoding create foo [namespace code {toutf 1}] \ [namespace code {fromutf 2}] set x {} encoding convertfrom foo abcd encoding convertto foo abcd testencoding delete foo return $x } {{toutf 1} {fromutf 2}} test encoding-6.2 {Tcl_CreateEncoding: replace encoding} {testencoding} { testencoding create foo [namespace code {toutf a}] \ [namespace code {fromutf b}] set x {} encoding convertfrom foo abcd encoding convertto foo abcd testencoding delete foo return $x } {{toutf a} {fromutf b}} test encoding-7.1 {Tcl_ExternalToUtfDString: small buffer} { encoding convertfrom jis0208 8c8c8c8c } 吾吾吾吾 test encoding-7.2 {Tcl_UtfToExternalDString: big buffer} { set a 8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C append a $a append a $a append a $a append a $a set x [encoding convertfrom jis0208 $a] list [string length $x] [string index $x 0] } "512 乎" test encoding-8.1 {Tcl_ExternalToUtf} { set f [open [file join [temporaryDirectory] dummy] w] fconfigure $f -translation binary puts -nonewline $f "ab\x8C\xC1g" close $f set f [open [file join [temporaryDirectory] dummy] r] fconfigure $f -translation lf -encoding shiftjis set x [read $f] close $f file delete [file join [temporaryDirectory] dummy] return $x } ab乎g test encoding-9.1 {Tcl_UtfToExternalDString: small buffer} { encoding convertto jis0208 "吾吾吾吾" } {8c8c8c8c} test encoding-9.2 {Tcl_UtfToExternalDString: big buffer} { set a 乎乎乎乎乎乎乎乎 append a $a append a $a append a $a append a $a append a $a append a $a set x [encoding convertto jis0208 $a] list [string length $x] [string range $x 0 1] } "1024 8C" test encoding-10.1 {Tcl_UtfToExternal} { set f [open [file join [temporaryDirectory] dummy] w] fconfigure $f -translation lf -encoding shiftjis puts -nonewline $f ab乎g close $f set f [open [file join [temporaryDirectory] dummy] r] fconfigure $f -translation binary set x [read $f] close $f file delete [file join [temporaryDirectory] dummy] return $x } "ab\x8C\xC1g" test encoding-11.1 {LoadEncodingFile: unknown encoding} {testencoding} { set system [encoding system] set path [encoding dirs] encoding system iso8859-1 encoding dirs {} llength jis0208 ;# Shimmer any cached Tcl_Encoding in shared literal set x [list [catch {encoding convertto jis0208 乎} msg] $msg] encoding dirs $path unset -nocomplain path encoding system $system lappend x [encoding convertto jis0208 乎] } {1 {unknown encoding "jis0208"} 8C} test encoding-11.2 {LoadEncodingFile: single-byte} { encoding convertfrom jis0201 \xA1 } 。 test encoding-11.3 {LoadEncodingFile: double-byte} { encoding convertfrom jis0208 8C } 乎 test encoding-11.4 {LoadEncodingFile: multi-byte} { encoding convertfrom shiftjis \x8C\xC1 } 乎 test encoding-11.5 {LoadEncodingFile: escape file} { encoding convertto iso2022 乎 } \x1B\$B8C\x1B(B test encoding-11.5.1 {LoadEncodingFile: escape file} { encoding convertto iso2022-jp 乎 } \x1B\$B8C\x1B(B test encoding-11.6 {LoadEncodingFile: invalid file} -constraints {testencoding} -setup { set system [encoding system] set path [encoding dirs] encoding system iso8859-1 } -body { cd [temporaryDirectory] encoding dirs [file join tmp encoding] makeDirectory tmp makeDirectory [file join tmp encoding] set f [open [file join tmp encoding splat.enc] w] fconfigure $f -translation binary puts $f "abcdefghijklmnop" close $f encoding convertto splat 乎 } -returnCodes error -cleanup { file delete [file join [temporaryDirectory] tmp encoding splat.enc] removeDirectory [file join tmp encoding] removeDirectory tmp cd [workingDirectory] encoding dirs $path encoding system $system unset -nocomplain path } -result {invalid encoding file "splat"} test encoding-11.8 {encoding: extended Unicode UTF-16} { encoding convertto utf-16le 😹 } =Ø9Þ test encoding-11.9 {encoding: extended Unicode UTF-16} { encoding convertto utf-16be 😹 } Ø=Þ9 test encoding-11.10 {encoding: extended Unicode UTF-32} { encoding convertto utf-32le 😹 } 9\xF6\x01\x00 test encoding-11.11 {encoding: extended Unicode UTF-32} { encoding convertto utf-32be 😹 } \x00\x01\xF69 # OpenEncodingFile is fully tested by the rest of the tests in this file. test encoding-12.1 {LoadTableEncoding: normal encoding} { set x [encoding convertto iso8859-3 Ġ] append x [encoding convertto -profile tcl8 iso8859-3 Õ] append x [encoding convertfrom iso8859-3 Õ] } "Õ?Ġ" test encoding-12.2 {LoadTableEncoding: single-byte encoding} { set x [encoding convertto iso8859-3 abĠg] append x [encoding convertfrom iso8859-3 abÕg] } "abÕgabĠg" test encoding-12.3 {LoadTableEncoding: multi-byte encoding} { set x [encoding convertto shiftjis ab乎g] append x [encoding convertfrom shiftjis ab\x8C\xC1g] } "ab\x8C\xC1gab乎g" test encoding-12.4 {LoadTableEncoding: double-byte encoding} { set x [encoding convertto jis0208 乎α] append x [encoding convertfrom jis0208 8C&A] } "8C&A乎α" test encoding-12.5 {LoadTableEncoding: symbol encoding} { set x [encoding convertto symbol γ] append x [encoding convertto symbol g] append x [encoding convertfrom symbol g] } "ggγ" test encoding-12.7 {cp864 [ecafd8611d]} { encoding convertfrom cp864 \xA7 } € test encoding-12.8 {cp165 [ecafd8611d]} { encoding convertfrom cp165 \xA7 } ﺈ test encoding-13.1 {LoadEscapeTable} { encoding convertto iso2022 ab乎棙g } ab\x1B\$B8C\x1B\$\(DD%\x1B(Bg test encoding-15.1 {UtfToUtfProc} { encoding convertto utf-8 £ } "\xC2\xA3" test encoding-15.2 {UtfToUtfProc null character output} testbytestring { binary scan [testbytestring [encoding convertto utf-8 \x00]] H* z set z } 00 test encoding-15.3 {UtfToUtfProc null character input} teststringbytes { set y [encoding convertfrom utf-8 [encoding convertto utf-8 \x00]] binary scan [teststringbytes $y] H* z set z } c080 test encoding-15.4 {UtfToUtfProc emoji character input} -body { set x \xED\xA0\xBD\xED\xB8\x82 set y [encoding convertfrom -profile tcl8 utf-8 \xED\xA0\xBD\xED\xB8\x82] list [string length $x] $y } -result "6 \uD83D\uDE02" test encoding-15.5 {UtfToUtfProc emoji character input} { set x \xF0\x9F\x98\x82 set y [encoding convertfrom utf-8 \xF0\x9F\x98\x82] list [string length $x] $y } "4 😂" test encoding-15.6 {UtfToUtfProc emoji character output} { set x \uDE02\uD83D\uDE02\uD83D set y [encoding convertto -profile tcl8 utf-8 \uDE02\uD83D\uDE02\uD83D] binary scan $y H* z list [string length $y] $z } {12 edb882eda0bdedb882eda0bd} test encoding-15.7 {UtfToUtfProc emoji character output} { set x \uDE02\uD83D\uD83D set y [encoding convertto -profile tcl8 utf-8 \uDE02\uD83D\uD83D] binary scan $y H* z list [string length $x] [string length $y] $z } {3 9 edb882eda0bdeda0bd} test encoding-15.8 {UtfToUtfProc emoji character output} { set x \uDE02\uD83Dé set y [encoding convertto -profile tcl8 utf-8 \uDE02\uD83Dé] binary scan $y H* z list [string length $x] [string length $y] $z } {3 8 edb882eda0bdc3a9} test encoding-15.9 {UtfToUtfProc emoji character output} { set x \uDE02\uD83DX set y [encoding convertto -profile tcl8 utf-8 \uDE02\uD83DX] binary scan $y H* z list [string length $x] [string length $y] $z } {3 7 edb882eda0bd58} test encoding-15.10 {UtfToUtfProc high surrogate character output} { set x \uDE02é set y [encoding convertto -profile tcl8 utf-8 \uDE02é] binary scan $y H* z list [string length $x] [string length $y] $z } {2 5 edb882c3a9} test encoding-15.11 {UtfToUtfProc low surrogate character output} { set x \uDA02é set y [encoding convertto -profile tcl8 utf-8 \uDA02é] binary scan $y H* z list [string length $x] [string length $y] $z } {2 5 eda882c3a9} test encoding-15.12 {UtfToUtfProc high surrogate character output} { set x \uDE02Y set y [encoding convertto -profile tcl8 utf-8 \uDE02Y] binary scan $y H* z list [string length $x] [string length $y] $z } {2 4 edb88259} test encoding-15.13 {UtfToUtfProc low surrogate character output} { set x \uDA02Y set y [encoding convertto -profile tcl8 utf-8 \uDA02Y] binary scan $y H* z list [string length $x] [string length $y] $z } {2 4 eda88259} test encoding-15.14 {UtfToUtfProc high surrogate character output} { set x \uDE02 set y [encoding convertto -profile tcl8 utf-8 \uDE02] binary scan $y H* z list [string length $x] [string length $y] $z } {1 3 edb882} test encoding-15.15 {UtfToUtfProc low surrogate character output} { set x \uDA02 set y [encoding convertto -profile tcl8 utf-8 \uDA02] binary scan $y H* z list [string length $x] [string length $y] $z } {1 3 eda882} test encoding-15.16 {UtfToUtfProc: Invalid 4-byte UTF-8, see [ed29806ba]} { set x \xF0\xA0\xA1\xC2 set y [encoding convertfrom -profile tcl8 utf-8 \xF0\xA0\xA1\xC2] list [string length $x] $y } "4 \xF0\xA0\xA1\xC2" test encoding-15.17 {UtfToUtfProc emoji character output} { set x 😂 set y [encoding convertto utf-8 😂] binary scan $y H* z list [string length $y] $z } {4 f09f9882} test encoding-15.18 {UtfToUtfProc CESU-8 6-byte sequence} { set y [encoding convertto cesu-8 \U10000] binary scan $y H* z list [string length $y] $z } {6 eda080edb080} test encoding-15.19 {UtfToUtfProc CESU-8 upper surrogate} { set y [encoding convertto cesu-8 \uD800] binary scan $y H* z list [string length $y] $z } {3 eda080} test encoding-15.20 {UtfToUtfProc CESU-8 lower surrogate} { set y [encoding convertto cesu-8 \uDC00] binary scan $y H* z list [string length $y] $z } {3 edb080} test encoding-15.21 {UtfToUtfProc CESU-8 noncharacter} { set y [encoding convertto cesu-8 \uFFFF] binary scan $y H* z list [string length $y] $z } {3 efbfbf} test encoding-15.22 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { set y [encoding convertto cesu-8 \x80] binary scan $y H* z list [string length $y] $z } {2 c280} test encoding-15.23 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { set y [encoding convertto cesu-8 \u100] binary scan $y H* z list [string length $y] $z } {2 c480} test encoding-15.24 {UtfToUtfProc CESU-8 bug [048dd20b4171c8da]} { set y [encoding convertto cesu-8 \u3FF] binary scan $y H* z list [string length $y] $z } {2 cfbf} test encoding-15.25 {UtfToUtfProc CESU-8} { encoding convertfrom cesu-8 \x00 } \x00 test encoding-15.26 {UtfToUtfProc CESU-8} { encoding convertfrom -profile tcl8 cesu-8 \xC0\x80 } \x00 test encoding-15.27 {UtfToUtfProc -profile strict CESU-8} { encoding convertfrom -profile strict cesu-8 \x00 } \x00 test encoding-15.28 {UtfToUtfProc -profile strict CESU-8} -body { encoding convertfrom -profile strict cesu-8 \xC0\x80 } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} test encoding-15.29 {UtfToUtfProc CESU-8} { encoding convertto cesu-8 \x00 } \x00 test encoding-15.30 {UtfToUtfProc -profile strict CESU-8} { encoding convertto -profile strict cesu-8 \x00 } \x00 test encoding-15.31 {UtfToUtfProc -profile strict CESU-8 (bytes F0-F4 are invalid)} -body { encoding convertfrom -profile strict cesu-8 \xF1\x86\x83\x9C } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xF1'} test encoding-15.32 {UtfToUtfProc CESU-8 [2f22a7364d]} -body { encoding convertto cesu-8 \U1f600 } -result \xED\xA0\xBD\xED\xB8\x80 test encoding-15.33 {UtfToUtfProc CESU-8 [63325009a8]} -body { encoding convertto cesu-8 \u0400 } -result \xD0\x80 test encoding-16.1 {Utf16ToUtfProc} -body { set val [encoding convertfrom utf-16 NN] list $val [format %x [scan $val %c]] } -result "乎 4e4e" test encoding-16.2 {Utf16ToUtfProc} -body { set val [encoding convertfrom utf-16 "\xD8\xD8\xDC\xDC"] list $val [format %x [scan $val %c]] } -result "\U460DC 460dc" test encoding-16.3 {Utf16ToUtfProc} -body { set val [encoding convertfrom -profile tcl8 utf-16 "\xDC\xDC"] list $val [format %x [scan $val %c]] } -result "\uDCDC dcdc" test encoding-16.4 {Ucs2ToUtfProc} -body { set val [encoding convertfrom ucs-2 NN] list $val [format %x [scan $val %c]] } -result "乎 4e4e" test encoding-16.5 {Ucs2ToUtfProc} -body { set val [encoding convertfrom ucs-2 "\xD8\xD8\xDC\xDC"] list $val [format %x [scan $val %c]] } -result "\U460DC 460dc" test encoding-16.6 {Utf32ToUtfProc} -body { set val [encoding convertfrom utf-32le NN\0\0] list $val [format %x [scan $val %c]] } -result "乎 4e4e" test encoding-16.7 {Utf32ToUtfProc} -body { set val [encoding convertfrom utf-32be \0\0NN] list $val [format %x [scan $val %c]] } -result "乎 4e4e" test encoding-16.8 {Utf32ToUtfProc} -body { set val [encoding convertfrom -profile tcl8 utf-32 \x41\x00\x00\x41] list $val [format %x [scan $val %c]] } -result "\uFFFD fffd" test encoding-16.9 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xD8\x00\x00 } -result \uD800 test encoding-16.10 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xDC\x00\x00 } -result \uDC00 test encoding-16.11 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xD8\x00\x00\x00\xDC\x00\x00 } -result \uD800\uDC00 test encoding-16.12 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32le \x00\xDC\x00\x00\x00\xD8\x00\x00 } -result \uDC00\uD800 test encoding-16.13 {Utf16ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-16le \x00\xD8 } -result \uD800 test encoding-16.14 {Utf16ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-16le \x00\xDC } -result \uDC00 test encoding-16.15 {Utf16ToUtfProc} -body { encoding convertfrom utf-16le \x00\xD8\x00\xDC } -result \U010000 test encoding-16.16 {Utf16ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-16le \x00\xDC\x00\xD8 } -result \uDC00\uD800 test encoding-16.17 {Utf32ToUtfProc} -body { list [encoding convertfrom -profile strict -failindex idx utf-32le \x41\x00\x00\x00\x00\xD8\x00\x00\x42\x00\x00\x00] [set idx] } -result {A 4} test encoding-16.18 { Utf16ToUtfProc, Tcl_UniCharToUtf, surrogate pairs in utf-16 } -body { apply [list {} { for {set i 0xD800} {$i < 0xDBFF} {incr i} { for {set j 0xDC00} {$j < 0xDFFF} {incr j} { set string [binary format S2 [list $i $j]] set status [catch { set decoded [encoding convertfrom utf-16be $string] set encoded [encoding convertto utf-16be $decoded] }] if {$status || ( $encoded ne $string )} { return [list [format %x $i] [format %x $j]] } } } return done } [namespace current]] } -result done test encoding-16.19.strict {Utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile strict utf-16 "\x41\x41\x41" } -returnCodes 1 -result {unexpected byte sequence starting at index 2: '\x41'} test encoding-16.19.tcl8 {Utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile tcl8 utf-16 "\x41\x41\x41" } -result \u4141\uFFFD test encoding-16.20.tcl8 {Utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile tcl8 utf-16 "\xD8\xD8" } -result \uD8D8 test encoding-16.20.strict {Utf16ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile strict utf-16 "\xD8\xD8" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xD8'} test encoding-16.21.tcl8 {Utf32ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile tcl8 utf-32 "\x00\x00\x00\x00\x41\x41" } -result \x00\uFFFD test encoding-16.21.strict {Utf32ToUtfProc, bug [d19fe0a5b]} -body { encoding convertfrom -profile strict utf-32 "\x00\x00\x00\x00\x41\x41" } -returnCodes 1 -result {unexpected byte sequence starting at index 4: '\x41'} test encoding-16.22 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body { encoding convertfrom -profile strict utf-16le \x00\xD8 } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x00'} test encoding-16.23 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body { encoding convertfrom -profile strict utf-16le \x00\xDC } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x00'} test encoding-16.24 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32 "\xFF\xFF\xFF\xFF" } -result \uFFFD test encoding-16.25.strict {Utf32ToUtfProc} -body { encoding convertfrom -profile strict utf-32 "\x01\x00\x00\x01" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x01'} test encoding-16.25.tcl8 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32 "\x01\x00\x00\x01" } -result \uFFFD test encoding-17.1 {UtfToUtf16Proc} -body { encoding convertto utf-16 "\U460DC" } -result "\xD8\xD8\xDC\xDC" test encoding-17.2 {UtfToUcs2Proc} -body { encoding convertfrom utf-16 \xD8\xD8\xDC\xDC } -result "\U460DC" test encoding-17.3 {UtfToUtf16Proc} -body { encoding convertto -profile tcl8 utf-16be "\uDCDC" } -result "\xDC\xDC" test encoding-17.4 {UtfToUtf16Proc} -body { encoding convertto -profile tcl8 utf-16le "\uD8D8" } -result "\xD8\xD8" test encoding-17.5 {UtfToUtf32Proc} -body { encoding convertto utf-32le "\U460DC" } -result "\xDC\x60\x04\x00" test encoding-17.6 {UtfToUtf32Proc} -body { encoding convertto utf-32be "\U460DC" } -result "\x00\x04\x60\xDC" test encoding-17.7 {UtfToUtf16Proc} -body { encoding convertto -profile strict utf-16be "\uDCDC" } -returnCodes error -result {unexpected character at index 0: 'U+00DCDC'} test encoding-17.8 {UtfToUtf16Proc} -body { encoding convertto -profile strict utf-16le "\uD8D8" } -returnCodes error -result {unexpected character at index 0: 'U+00D8D8'} test encoding-17.9 {Utf32ToUtfProc} -body { encoding convertfrom -profile strict utf-32 "\xFF\xFF\xFF\xFF" } -returnCodes error -result {unexpected byte sequence starting at index 0: '\xFF'} test encoding-17.10 {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32 "\xFF\xFF\xFF\xFF" } -result \uFFFD test encoding-17.11 {Utf32ToUtfProc} -body { encoding convertfrom -profile strict utf-32le "\x00\xD8\x00\x00" } -returnCodes error -result {unexpected byte sequence starting at index 0: '\x00'} test encoding-17.12 {Utf32ToUtfProc} -body { encoding convertfrom -profile strict utf-32le "\x00\xDC\x00\x00" } -returnCodes error -result {unexpected byte sequence starting at index 0: '\x00'} test encoding-18.1 {TableToUtfProc on invalid input} -body { list [catch {encoding convertto -profile tcl8 jis0208 \\} res] $res } -result {0 !)} test encoding-18.2 {TableToUtfProc on invalid input with -profile strict} -body { list [catch {encoding convertto -profile strict jis0208 \\} res] $res } -result {1 {unexpected character at index 0: 'U+00005C'}} test encoding-18.3 {TableToUtfProc on invalid input with -profile strict -failindex} -body { list [catch {encoding convertto -profile strict -failindex pos jis0208 \\} res] $res $pos } -result {0 {} 0} test encoding-18.4 {TableToUtfProc on invalid input with -failindex -profile strict} -body { list [catch {encoding convertto -failindex pos -profile strict jis0208 \\} res] $res $pos } -result {0 {} 0} test encoding-18.5 {TableToUtfProc on invalid input with -failindex} -body { list [catch {encoding convertto -profile tcl8 -failindex pos jis0208 \\} res] $res $pos } -result {0 !) -1} test encoding-18.6 {TableToUtfProc on invalid input with -profile tcl8} -body { list [catch {encoding convertto -profile tcl8 jis0208 \\} res] $res } -result {0 !)} test encoding-19.1 {TableFromUtfProc} -body { encoding convertfrom -profile tcl8 ascii AÁ } -result AÁ test encoding-19.2 {TableFromUtfProc} -body { encoding convertfrom -profile tcl8 ascii AÁ } -result AÁ test encoding-19.3 {TableFromUtfProc} -body { encoding convertfrom -profile strict ascii AÁ } -returnCodes 1 -result {unexpected byte sequence starting at index 1: '\xC1'} test encoding-19.4 {TableFromUtfProc} -body { list [encoding convertfrom -profile tcl8 -failindex idx ascii AÁ] [set idx] } -result [list A\xC1 -1] test encoding-19.5 {TableFromUtfProc} -body { list [encoding convertfrom -failindex idx -profile strict ascii A\xC1] [set idx] } -result {A 1} test encoding-19.6 {TableFromUtfProc} -body { list [encoding convertfrom -failindex idx -profile strict ascii AÁB] [set idx] } -result {A 1} test encoding-20.1 {TableFreefProc} { } {} test encoding-21.1 {EscapeToUtfProc} { } {} test encoding-22.1 {EscapeFromUtfProc} { } {} set iso2022encData "\x1B\$B;d\$I\$b\$G\$O!\"%A%C%W\$49XF~;~\$K\$4EPO?\$\$\$?\$@\$\$\$?\$4=;=j\$r%-%c%C%7%e%\"%&%H\$N:]\$N\x1B(B \x1B\$B>.@Z= 0} { if {$count} { incr count 1 ; # account for newline append out \n } append out $line incr count $num } close $fid if {[string compare $iso2022uniData $out]} { return -code error "iso2022-jp read in doesn't match original" } list $count $out } [list [string length $iso2022uniData] $iso2022uniData] test encoding-23.3 {iso2022-jp escape encoding test} { # read $fis reads size in chars, not raw bytes. set fid [open iso2022.txt r] fconfigure $fid -encoding iso2022-jp set data [read $fid 50] close $fid return $data } [string range $iso2022uniData 0 49] ; # 0 .. 49 inclusive == 50 cd [workingDirectory] # Code to make the next few tests more intelligible; the code being tested # should be in the body of the test! proc runInSubprocess {contents {filename iso2022.tcl}} { set theFile [makeFile $contents $filename] try { exec [interpreter] $theFile } finally { removeFile $theFile } } test encoding-24.1 {EscapeFreeProc on open channels} exec { runInSubprocess { set f [open [file join [file dirname [info script]] iso2022.txt]] fconfigure $f -encoding iso2022-jp gets $f } } {} test encoding-24.2 {EscapeFreeProc on open channels} {exec} { # Bug #524674 output runInSubprocess { encoding system cp1252; # Bug #2891556 crash revelator fconfigure stdout -encoding iso2022-jp puts ab乎棙g set env(TCL_FINALIZE_ON_EXIT) 1 exit } } "ab\x1B\$B8C\x1B\$(DD%\x1B(Bg" test encoding-24.3 {EscapeFreeProc on open channels} {stdio} { # Bug #219314 - if we don't free escape encodings correctly on channel # closure, we go boom set file [makeFile { encoding system iso2022-jp set a "乎乞也"; # 3 Japanese Kanji letters puts $a } iso2022.tcl] set f [open "|[list [interpreter] $file]"] fconfigure $f -encoding iso2022-jp set count [gets $f line] close $f removeFile iso2022.tcl list $count $line } [list 3 乎乞也] test encoding-24.4.strict {Parse invalid utf-8, strict} -body { encoding convertfrom -profile strict utf-8 "\xC0\x80" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} test encoding-24.4.tcl8 {UtfToUtfProc utf-8} { encoding convertfrom -profile tcl8 utf-8 \xC0\x80 } \x00 test encoding-24.5 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xC0\x81"] } 2 test encoding-24.6 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xC1\xBF"] } 2 test encoding-24.7 {Parse valid or invalid utf-8} { string length [encoding convertfrom utf-8 "\xC2\x80"] } 1 test encoding-24.8 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xE0\x80\x80"] } 3 test encoding-24.9 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xE0\x9F\xBF"] } 3 test encoding-24.10 {Parse valid or invalid utf-8} { string length [encoding convertfrom utf-8 "\xE0\xA0\x80"] } 1 test encoding-24.11 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xEF\xBF\xBF"] } 1 test encoding-24.12 {Parse invalid utf-8} -body { encoding convertfrom -profile tcl8 utf-8 "\xC0\x81" } -result \xC0\x81 test encoding-24.12.1 {Parse invalid utf-8} -body { encoding convertfrom -profile strict utf-8 "\xC0\x81" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} test encoding-24.13 {Parse invalid utf-8} -body { encoding convertfrom -profile tcl8 utf-8 "\xC1\xBF" } -result \xC1\xBF test encoding-24.13.1 {Parse invalid utf-8} -body { encoding convertfrom -profile strict utf-8 "\xC1\xBF" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC1'} test encoding-24.14 {Parse valid utf-8} { encoding convertfrom utf-8 "\xC2\x80" } \x80 test encoding-24.15.strict {Parse invalid utf-8, -profile strict} -body { encoding convertfrom -profile strict utf-8 "Z\xE0\x80" } -returnCodes 1 -result "unexpected byte sequence starting at index 1: '\\xE0'" test encoding-24.15.tcl8 {Parse invalid utf-8, -profile tcl8} -body { encoding convertfrom -profile tcl8 utf-8 "Z\xE0\x80" } -result Z\xE0\u20AC test encoding-24.16 {Parse valid or invalid utf-8} -constraints testbytestring -body { encoding convertto utf-8 [testbytestring "Z\u4343\x80"] } -returnCodes 1 -result {expected byte sequence but character 1 was '䍃€' (U+004343)} test encoding-24.17 {Parse valid or invalid utf-8} -constraints testbytestring -body { encoding convertto utf-8 [testbytestring "Z\xE0\x80"] } -result "Z\xC3\xA0\xE2\x82\xAC" test encoding-24.18 {Parse valid or invalid utf-8} -constraints testbytestring -body { encoding convertto utf-8 [testbytestring "Z\xE0\x80xxxxxx"] } -result "Z\xC3\xA0\xE2\x82\xACxxxxxx" test encoding-24.19.1 {Parse valid or invalid utf-8} -body { encoding convertto -profile tcl8 utf-8 "ZX\uD800" } -result ZX\xED\xA0\x80 test encoding-24.19.2 {Parse valid or invalid utf-8} -body { encoding convertto -profile strict utf-8 "ZX\uD800" } -returnCodes 1 -match glob -result "unexpected character at index 2: 'U+00D800'" test encoding-24.20 {Parse with -profile tcl8 but without providing encoding} -body { encoding convertfrom -profile tcl8 "\x20" } -result {wrong # args: should be "::tcl::encoding::convertfrom ?-profile profile? ?-failindex var? encoding data" or "::tcl::encoding::convertfrom data"} -returnCodes error test encoding-24.21 {Parse with -profile tcl8 but without providing encoding} -body { string length [encoding convertto -profile tcl8 "\x20"] } -result {wrong # args: should be "::tcl::encoding::convertto ?-profile profile? ?-failindex var? encoding data" or "::tcl::encoding::convertto data"} -returnCodes error test encoding-24.22 {Syntax error, two encodings} -body { encoding convertfrom iso8859-1 utf-8 "ZX\uD800" } -result {bad option "iso8859-1": must be -profile or -failindex} -returnCodes error test encoding-24.23 {Syntax error, two encodings} -body { encoding convertto iso8859-1 utf-8 "ZX\uD800" } -result {bad option "iso8859-1": must be -profile or -failindex} -returnCodes error test encoding-24.24 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 "\xC0\x80\x00\x00" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} test encoding-24.25 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 "\x40\x80\x00\x00" } -returnCodes 1 -result {unexpected byte sequence starting at index 1: '\x80'} test encoding-24.26 {Parse valid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 "\xF1\x80\x80\x80" } -result \U40000 test encoding-24.27 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 "\xF0\x80\x80\x80" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xF0'} test encoding-24.28 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 "\xFF\x00\x00" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xFF'} test encoding-24.29 {Parse invalid utf-8} -body { encoding convertfrom utf-8 \xEF\xBF\xBF } -result \uFFFF test encoding-24.30 {Parse noncharacter with -profile strict} -body { encoding convertfrom -profile strict utf-8 \xEF\xBF\xBF } -result \uFFFF test encoding-24.31 {Parse invalid utf-8 with -profile tcl8} -body { encoding convertfrom -profile tcl8 utf-8 \xEF\xBF\xBF } -result \uFFFF test encoding-24.32 {Try to generate invalid utf-8} -body { encoding convertto utf-8 \uFFFF } -result \xEF\xBF\xBF test encoding-24.33 {Try to generate invalid utf-8} -body { encoding convertto -profile strict utf-8 \uFFFF } -result \xEF\xBF\xBF test encoding-24.34 {Try to generate invalid utf-8 with -profile tcl8} -body { encoding convertto -profile tcl8 utf-8 \uFFFF } -result \xEF\xBF\xBF test encoding-24.35 {Parse invalid utf-8} -body { encoding convertfrom -profile tcl8 utf-8 \xED\xA0\x80 } -result \uD800 test encoding-24.36 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 \xED\xA0\x80 } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xED'} test encoding-24.37 {Parse invalid utf-8 with -profile tcl8} -body { encoding convertfrom -profile tcl8 utf-8 \xED\xA0\x80 } -result \uD800 test encoding-24.38.1 {Try to generate invalid utf-8} -body { encoding convertto -profile tcl8 utf-8 \uD800 } -result \xED\xA0\x80 test encoding-24.38.2 {Try to generate invalid utf-8 - default profile} -body { encoding convertto utf-8 \uD800 } -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'} test encoding-24.39 {Try to generate invalid utf-8 with -profile strict} -body { encoding convertto -profile strict utf-8 \uD800 } -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'} test encoding-24.40 {Try to generate invalid utf-8 with -profile tcl8} -body { encoding convertto -profile tcl8 utf-8 \uD800 } -result \xED\xA0\x80 test encoding-24.41 {Parse invalid utf-8 with -profile strict} -body { encoding convertfrom -profile strict utf-8 \xED\xA0\x80\xED\xB0\x80 } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xED'} test encoding-24.42 {Parse invalid utf-8, fallback to cp1252 [885c86a9a0]} -body { encoding convertfrom -profile tcl8 utf-8 \xF0\x80\x80\x80 } -result \xF0\u20AC\u20AC\u20AC test encoding-24.43 {Parse invalid utf-8, fallback to cp1252 [885c86a9a0]} -body { encoding convertfrom -profile tcl8 utf-8 \x80 } -result \u20AC test encoding-24.44 {Try to generate invalid ucs-2 with -profile strict} -body { encoding convertto -profile strict ucs-2 \uD800 } -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'} test encoding-24.45 {Try to generate invalid ucs-2 with -profile strict} -body { encoding convertto -profile strict ucs-2 \U10000 } -returnCodes 1 -result {unexpected character at index 0: 'U+010000'} file delete [file join [temporaryDirectory] iso2022.txt] # # Begin jajp encoding round-trip conformity tests # proc foreach-jisx0208 {varName command} { upvar 1 $varName code foreach range { {2121 217E} {2221 222E} {223A 2241} {224A 2250} {225C 226A} {2272 2279} {227E 227E} {2330 2339} {2421 2473} {2521 2576} {2821 2821} {282C 282C} {2837 2837} {30 21 4E 7E} {4F21 4F53} {50 21 73 7E} {7421 7426} } { if {[llength $range] == 2} { # for adhoc range. simple {first last}. inclusive. scan $range %x%x first last for {set i $first} {$i <= $last} {incr i} { set code $i uplevel 1 $command } } elseif {[llength $range] == 4} { # for uniform range. scan $range %x%x%x%x h0 l0 hend lend for {set hi $h0} {$hi <= $hend} {incr hi} { for {set lo $l0} {$lo <= $lend} {incr lo} { set code [expr {$hi << 8 | ($lo & 0xff)}] uplevel 1 $command } } } else { error "really?" } } } proc gen-jisx0208-euc-jp {code} { binary format cc \ [expr {($code >> 8) | 0x80}] [expr {($code & 0xFF) | 0x80}] } proc gen-jisx0208-iso2022-jp {code} { binary format a3cca3 \ "\x1B\$B" [expr {$code >> 8}] [expr {$code & 0xFF}] "\x1B(B" } proc gen-jisx0208-cp932 {code} { set c1 [expr {($code >> 8) | 0x80}] set c2 [expr {($code & 0xff)| 0x80}] if {$c1 % 2} { set c1 [expr {($c1 >> 1) + ($c1 < 0xDF ? 0x31 : 0x71)}] incr c2 [expr {- (0x60 + ($c2 < 0xE0))}] } else { set c1 [expr {($c1 >> 1) + ($c1 < 0xDF ? 0x30 : 0x70)}] incr c2 -2 } binary format cc $c1 $c2 } proc channel-diff {fa fb} { set diff {} while {[gets $fa la] >= 0 && [gets $fb lb] >= 0} { if {[string compare $la $lb] == 0} continue # lappend diff $la $lb # For more readable (easy to analyze) output. set code [lindex $la 0] binary scan [lindex $la 1] H* expected binary scan [lindex $lb 1] H* got lappend diff [list $code $expected $got] } return $diff } # Create char tables. cd [temporaryDirectory] foreach enc {cp932 euc-jp iso2022-jp} { set f [open $enc.chars w] fconfigure $f -encoding iso8859-1 foreach-jisx0208 code { puts $f [format "%04X %s" $code [gen-jisx0208-$enc $code]] } close $f } # shiftjis == cp932 for jisx0208. file copy -force cp932.chars shiftjis.chars set NUM 0 foreach from {cp932 shiftjis euc-jp iso2022-jp} { foreach to {cp932 shiftjis euc-jp iso2022-jp} { test encoding-25.[incr NUM] "jisx0208 $from => $to" -setup { cd [temporaryDirectory] } -body { set f [open $from.chars] fconfigure $f -encoding $from set out [open $from.$to.tcltestout w] fconfigure $out -encoding $to puts -nonewline $out [read $f] close $out close $f # then compare $to.chars <=> $from.to.tcltestout as binary. set fa [open $to.chars rb] set fb [open $from.$to.tcltestout rb] channel-diff $fa $fb # Difference should be empty. } -cleanup { close $fa close $fb } -result {} } } test encoding-26.0 {Tcl_GetEncodingSearchPath} -setup { set origPath [encoding dirs] encoding dirs slappy } -body { encoding dirs } -cleanup { encoding dirs $origPath } -result slappy file delete {*}[glob -directory [temporaryDirectory] *.chars *.tcltestout] # ===> Cut here <=== # EscapeFreeProc, GetTableEncoding, unilen are fully tested by the rest of # this file. test encoding-27.1 {encoding dirs basic behavior} -returnCodes error -body { encoding dirs ? ? } -result {wrong # args: should be "encoding dirs ?dirList?"} test encoding-27.2 {encoding dirs basic behavior} -returnCodes error -body { encoding dirs "\{not a list" } -result "expected directory list but got \"\{not a list\"" }; # proc runtests test encoding-28.0 {all encodings load} -body { set string hello foreach name [encoding names] { if {$name ne "unicode"} { incr count } encoding convertto -profile tcl8 $name $string # discard the cached internal representation of Tcl_Encoding # Unfortunately, without this, encoding 2-1 fails. llength $name } return $count } -result 94 runtests test encoding-bug-183a1adcc0-1 {Bug [183a1adcc0] Buffer overflow Tcl_UtfToExternal} -constraints { testencoding } -body { # Note - buffers are initialized to \xFF list [catch {testencoding Tcl_UtfToExternal utf-16 A {start end} {} 1} result] $result } -result [list 0 [list nospace {} \xFF]] test encoding-bug-183a1adcc0-2 {Bug [183a1adcc0] Buffer overflow Tcl_UtfToExternal} -constraints { testencoding } -body { # Note - buffers are initialized to \xFF list [catch {testencoding Tcl_UtfToExternal utf-16 A {start end} {} 0} result] $result } -result [list 0 [list nospace {} {}]] test encoding-bug-183a1adcc0-3 {Bug [183a1adcc0] Buffer overflow Tcl_UtfToExternal} -constraints { testencoding } -body { # Note - buffers are initialized to \xFF list [catch {testencoding Tcl_UtfToExternal utf-16 A {start end} {} 2} result] $result } -result [list 0 [list nospace {} \x00\x00]] test encoding-bug-183a1adcc0-4 {Bug [183a1adcc0] Buffer overflow Tcl_UtfToExternal} -constraints { testencoding } -body { # Note - buffers are initialized to \xFF list [catch {testencoding Tcl_UtfToExternal utf-16 A {start end} {} 3} result] $result } -result [list 0 [list nospace {} \x00\x00\xFF]] test encoding-bug-183a1adcc0-5 {Bug [183a1adcc0] Buffer overflow Tcl_UtfToExternal} -constraints { testencoding } -body { list [catch {testencoding Tcl_UtfToExternal utf-16 A {start end} {} 4} result] $result } -result [list 0 [list ok {} [expr {$::tcl_platform(byteOrder) eq "littleEndian" ? "\x41\x00" : "\x00\x41"}]\x00\x00]] } test encoding-29.0 {get encoding nul terminator lengths} -constraints { testencoding } -body { list \ [testencoding nullength ascii] \ [testencoding nullength utf-16] \ [testencoding nullength utf-32] \ [testencoding nullength gb12345] \ [testencoding nullength ksc5601] } -result {1 2 4 2 2} test encoding-30.0 {encoding convertto large strings UINT_MAX} -constraints { perf } -body { # Test to ensure not misinterpreted as -1 list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertto ascii $s]] } -result {4294967295 1} test encoding-30.1 {encoding convertto large strings > 4GB} -constraints { perf } -body { list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertto ascii $s]] } -result {4294967296 1} test encoding-30.2 {encoding convertfrom large strings UINT_MAX} -constraints { perf } -body { # Test to ensure not misinterpreted as -1 list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertfrom ascii $s]] } -result {4294967295 1} test encoding-30.3 {encoding convertfrom large strings > 4GB} -constraints { perf } -body { list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertfrom ascii $s]] } -result {4294967296 1} # TIP 716 tests tcltests::testnumargs "encoding user" "" "" test encoding-31.0 {encoding user} -body { encoding user } -result [expr {$::tcl_platform(platform) eq "windows" ? [tcltests::windowscodepage] : [encoding system]}] test encoding-31.1 {encoding system does not change encoding user} -setup { set system [encoding system] set user [encoding user] } -body { encoding system ascii list [encoding system] [string equal [encoding user] $user] } -cleanup { encoding system $system unset system unset user } -result {ascii 1} test encoding-31.2 {encoding system on newer Windows always returns utf-8} -body { string equal [encoding system] \ [expr { [tcltests::windowsbuildnumber] > 18362 ? "utf-8" : [tcltests::windowscodepage] }] } -constraints win -result 1 test encoding-bug-6a3e2cb0f0-1 {Bug [6a3e2cb0f0] - invalid bytes in escape encodings} -body { encoding convertfrom -profile tcl8 iso2022-jp x\x1B\x7Aaby } -result x\uFFFDy test encoding-bug-6a3e2cb0f0-2 {Bug [6a3e2cb0f0] - invalid bytes in escape encodings} -body { encoding convertfrom -profile strict iso2022-jp x\x1B\x7Aaby } -returnCodes error -result {unexpected byte sequence starting at index 1: '\x1B'} test encoding-bug-6a3e2cb0f0-3 {Bug [6a3e2cb0f0] - invalid bytes in escape encodings} -body { encoding convertfrom -profile replace iso2022-jp x\x1B\x7Aaby } -result x\uFFFDy test encoding-bug-66ffafd309-1-tcl8 {Bug [66ffafd309] - truncated DBCS} -body { encoding convertfrom -profile tcl8 gb12345 x } -result x test encoding-bug-66ffafd309-1-strict {Bug [66ffafd309] - truncated DBCS} -body { encoding convertfrom -profile strict gb12345 x } -result {unexpected byte sequence starting at index 0: '\x78'} -returnCodes error test encoding-bug-66ffafd309-1-replace {Bug [66ffafd309] - truncated DBCS} -body { encoding convertfrom -profile replace gb12345 x } -result \uFFFD test encoding-bug-66ffafd309-2-tcl8 {Bug [66ffafd309] - invalid DBCS} -body { # Not truncated but invalid encoding convertfrom -profile tcl8 jis0208 \x78\x79 } -result \x78\x79 test encoding-bug-66ffafd309-2-strict {Bug [66ffafd309] - invalid DBCS} -body { # Not truncated but invalid encoding convertfrom -profile strict jis0208 \x78\x79 } -result {unexpected byte sequence starting at index 1: '\x79'} -returnCodes error test encoding-bug-66ffafd309-2-replace {Bug [66ffafd309] - invalid DBCS} -body { # Not truncated but invalid encoding convertfrom -profile replace jis0208 \x78\x79 } -result \uFFFD\uFFFD test encoding-bug-201c7a3aa6-strict {Crash encoding non-BMP to iso2022} -body { encoding convertto -profile strict iso2022 \U1f600 } -result {unexpected character at index 0: 'U+01F600'} -returnCodes error test encoding-bug-201c7a3aa6-replace {Crash encoding non-BMP to iso2022} -body { encoding convertto -profile replace iso2022 \U1f600 } -result ? test encoding-bug-201c7a3aa6-tcl8 {Crash encoding non-BMP to iso2022} -body { encoding convertto -profile tcl8 iso2022 \U1f600 } -result ? test encoding-bug-7346adc50f-strict {OOM on convertfrom truncated iso2022 - strict} -body { encoding convertfrom -profile strict iso2022-jp "\x1b\$B\$*;n\$" } -result {unexpected byte sequence starting at index 7: '\x24'} -returnCodes error test encoding-bug-7346adc50f-failindex {OOM on convertfrom truncated iso2022 - failindex} -body { list [encoding convertfrom -failindex failix iso2022-jp "\x1b\$B\$*;n\$"] $failix } -cleanup { unset -nocomplain failix } -result [list \u304A\u8A66 7] test encoding-bug-7346adc50f-replace {OOM on convertfrom truncated iso2022 - replace} -body { encoding convertfrom -profile replace iso2022-jp "\x1b\$B\$*;n\$" } -result \u304A\u8A66\uFFFD test encoding-bug-7346adc50f-tcl8 {OOM on convertfrom truncated iso2022 - tcl8} -body { encoding convertfrom -profile tcl8 iso2022-jp "\x1b\$B\$*;n\$" } -result \u304A\u8A66\uFFFD test encoding-dirs-bug-87b69745be {encoding dirs reset on interp creation} -setup { set origEncodingDirs [encoding dirs] } -cleanup { encoding dirs $origEncodingDirs unset -nocomplain origEncodingDirs } -body { encoding dirs [linsert [encoding dirs] end /temp] interp delete [interp create] encoding dirs } -result [linsert [encoding dirs] end /temp] # cleanup namespace delete ::tcl::test::encoding ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/dstring.test0000644000175000017500000004113415104661341015267 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for Tcl's dynamic string library # procedures. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testdstring [llength [info commands testdstring]] if {[testConstraint testdstring]} { testdstring free } test dstring-1.1 {appending and retrieving} -constraints testdstring -setup { testdstring free } -body { testdstring append "abc" -1 list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {abc 3} test dstring-1.2 {appending and retrieving} -constraints testdstring -setup { testdstring free } -body { testdstring append "abc" -1 testdstring append " xyzzy" 3 testdstring append " 12345" -1 list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {{abc xy 12345} 12} test dstring-1.3 {appending and retrieving} -constraints testdstring -setup { testdstring free } -body { foreach l {a b c d e f g h i j k l m n o p} { testdstring append $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l\n -1 } list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {{aaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeee fffffffffffffffffffff ggggggggggggggggggggg hhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkk lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooo ppppppppppppppppppppp } 352} test dstring-2.1 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring element "abc" testdstring element "d e f" list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {{abc {d e f}} 11} test dstring-2.2 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring element "x" testdstring element "\{" testdstring element "ab\}" testdstring get } -cleanup { testdstring free } -result {x \{ ab\}} test dstring-2.3 {appending list elements} -constraints testdstring -setup { testdstring free } -body { foreach l {a b c d e f g h i j k l m n o p} { testdstring element $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l } testdstring get } -cleanup { testdstring free } -result {aaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeee fffffffffffffffffffff ggggggggggggggggggggg hhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkk lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooo ppppppppppppppppppppp} test dstring-2.4 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append "a\{" -1 testdstring element abc testdstring append " \{" -1 testdstring element xyzzy testdstring get } -cleanup { testdstring free } -result "a{ abc {xyzzy" test dstring-2.5 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append " \{" -1 testdstring element abc testdstring get } -cleanup { testdstring free } -result " {abc" test dstring-2.6 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append " " -1 testdstring element abc testdstring get } -cleanup { testdstring free } -result { abc} test dstring-2.7 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append "\\ " -1 testdstring element abc testdstring get } -cleanup { testdstring free } -result "\\ abc" test dstring-2.8 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append "x " -1 testdstring element abc testdstring get } -cleanup { testdstring free } -result {x abc} test dstring-2.9 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring element # testdstring get } -cleanup { testdstring free } -result {{#}} test dstring-2.10 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append " " -1 testdstring element # testdstring get } -cleanup { testdstring free } -result { {#}} test dstring-2.11 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append \t -1 testdstring element # testdstring get } -cleanup { testdstring free } -result \t{#} test dstring-2.12 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring element # testdstring get } -cleanup { testdstring free } -result {x #} test dstring-2.13 {appending list elements} -constraints testdstring -setup { testdstring free } -body { # This test checks the sophistication in Tcl_DStringAppendElement's # decision about whether #-quoting can be disabled. testdstring append "x " -1 testdstring element # testdstring get } -cleanup { testdstring free } -result {x #} test dstring-2.14 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append " " -1 testdstring element # testdstring get } -cleanup { testdstring free } -result { {#}} test dstring-2.15 {appending list elements} -constraints testdstring -setup { testdstring free } -body { # This test checks the sophistication in Tcl_DStringAppendElement's # decision about whether #-quoting can be disabled. testdstring append "x " -1 testdstring element # testdstring get } -cleanup { testdstring free } -result {x #} test dstring-2.16 {appending list elements - bug [46dda6fc29] segfault} -constraints testdstring -setup { testdstring free } -body { testdstring element "\\\n"; # Will setfault testdstring get } -cleanup { testdstring free } -result \\\\\\n test dstring-2.17 {appending list elements - bug [46dda6fc29] segfault} -constraints testdstring -setup { testdstring free } -body { testdstring element "\\\{"; # Will setfault testdstring get } -cleanup { testdstring free } -result [list [list \{]] test dstring-2.18 {appending list elements - bug [46dda6fc29] segfault} -constraints testdstring -setup { testdstring free } -body { testdstring element "\\\}"; # Will setfault testdstring get } -cleanup { testdstring free } -result [list [list \}]] test dstring-2.19 {appending list elements - bug [46dda6fc29] segfault} -constraints testdstring -setup { testdstring free } -body { testdstring element "\\\\"; # Will setfault testdstring get } -cleanup { testdstring free } -result [list [list \\]] test dstring-3.1 {nested sublists} -constraints testdstring -setup { testdstring free } -body { testdstring start testdstring element foo testdstring element bar testdstring end testdstring element another testdstring get } -cleanup { testdstring free } -result {{foo bar} another} test dstring-3.2 {nested sublists} -constraints testdstring -setup { testdstring free } -body { testdstring start testdstring start testdstring element abc testdstring element def testdstring end testdstring end testdstring element ghi testdstring get } -cleanup { testdstring free } -result {{{abc def}} ghi} test dstring-3.3 {nested sublists} -constraints testdstring -setup { testdstring free } -body { testdstring start testdstring start testdstring start testdstring element foo testdstring element foo2 testdstring end testdstring end testdstring element foo3 testdstring end testdstring element foo4 testdstring get } -cleanup { testdstring free } -result {{{{foo foo2}} foo3} foo4} test dstring-3.4 {nested sublists} -constraints testdstring -setup { testdstring free } -body { testdstring element before testdstring start testdstring element during testdstring element more testdstring end testdstring element last testdstring get } -cleanup { testdstring free } -result {before {during more} last} test dstring-3.5 {nested sublists} -constraints testdstring -setup { testdstring free } -body { testdstring element "\{" testdstring start testdstring element first testdstring element second testdstring end testdstring get } -cleanup { testdstring free } -result {\{ {first second}} test dstring-3.6 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring start testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x {{#}}} test dstring-3.7 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring start testdstring append " " -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x { {#}}} test dstring-3.8 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring start testdstring append \t -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result "x {\t{#}}" test dstring-3.9 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring start testdstring append x -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x {x #}} test dstring-3.10 {appending list elements} -constraints testdstring -setup { testdstring free } -body { # This test checks the sophistication in Tcl_DStringAppendElement's # decision about whether #-quoting can be disabled. testdstring append x -1 testdstring start testdstring append "x " -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x {x #}} test dstring-3.11 {appending list elements} -constraints testdstring -setup { testdstring free } -body { testdstring append x -1 testdstring start testdstring append " " -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x { {#}}} test dstring-3.12 {appending list elements} -constraints testdstring -setup { testdstring free } -body { # This test checks the sophistication in Tcl_DStringAppendElement's # decision about whether #-quoting can be disabled. testdstring append x -1 testdstring start testdstring append "x " -1 testdstring element # testdstring end testdstring get } -cleanup { testdstring free } -result {x {x #}} test dstring-4.1 {truncation} -constraints testdstring -setup { testdstring free } -body { testdstring append "abcdefg" -1 testdstring trunc 3 list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {abc 3} test dstring-4.2 {truncation} -constraints testdstring -setup { testdstring free } -body { testdstring append "xyzzy" -1 testdstring trunc 0 list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {{} 0} test dstring-4.3 {truncation} -constraints testdstring -setup { testdstring free } -body { testdstring append "xwvut" -1 # Pass a negative length to Tcl_DStringSetLength(); # if not caught, causing '\0' to be written out-of-bounds, # try corrupting dsPtr->length which begins # 2*sizeof(Tcl_Size) bytes before dsPtr->staticSpace[], # so that the result is -256 (on little endian systems) # rather than e.g. -8 or -16. # (sizeof(Tcl_Size) does not seem to be available via Tcl, # so assume sizeof(Tcl_Size) == sizeof(void*) for Tcl 9.) testdstring trunc [expr {-2*([package vsatisfies $tcl_version 9.0-] ? $tcl_platform(pointerSize) : 4)}] list [testdstring get] [testdstring length] } -cleanup { testdstring free } -result {{} 0} test dstring-5.1 {copying to result} -constraints testdstring -setup { testdstring free } -body { testdstring append xyz -1 testdstring result } -cleanup { testdstring free } -result xyz test dstring-5.2 {copying to result} -constraints testdstring -setup { testdstring free unset -nocomplain a } -body { foreach l {a b c d e f g h i j k l m n o p} { testdstring append $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l\n -1 } set a [testdstring result] testdstring append abc -1 list $a [testdstring get] } -cleanup { testdstring free } -result {{aaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeee fffffffffffffffffffff ggggggggggggggggggggg hhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkk lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooo ppppppppppppppppppppp } abc} test dstring-6.1 {Tcl_DStringGetResult} -constraints testdstring -setup { testdstring free } -body { list [testdstring gresult staticsmall] [testdstring get] } -cleanup { testdstring free } -result {{} short} test dstring-6.2 {Tcl_DStringGetResult} -constraints testdstring -setup { testdstring free } -body { foreach l {a b c d e f g h i j k l m n o p} { testdstring append $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l\n -1 } list [testdstring gresult staticsmall] [testdstring get] } -cleanup { testdstring free } -result {{} short} test dstring-6.3 {Tcl_DStringGetResult} -constraints testdstring -body { set result {} lappend result [testdstring gresult staticlarge] testdstring append x 1 lappend result [testdstring get] } -cleanup { testdstring free } -result {{} {first0 first1 first2 first3 first4 first5 first6 first7 first8 first9 second0 second1 second2 second3 second4 second5 second6 second7 second8 second9 third0 third1 third2 third3 third4 third5 third6 third7 third8 third9 fourth0 fourth1 fourth2 fourth3 fourth4 fourth5 fourth6 fourth7 fourth8 fourth9 fifth0 fifth1 fifth2 fifth3 fifth4 fifth5 fifth6 fifth7 fifth8 fifth9 sixth0 sixth1 sixth2 sixth3 sixth4 sixth5 sixth6 sixth7 sixth8 sixth9 seventh0 seventh1 seventh2 seventh3 seventh4 seventh5 seventh6 seventh7 seventh8 seventh9 x}} test dstring-6.4 {Tcl_DStringGetResult} -constraints testdstring -body { set result {} lappend result [testdstring gresult free] testdstring append y 1 lappend result [testdstring get] } -cleanup { testdstring free } -result {{} {This is a malloc-ed stringy}} test dstring-6.5 {Tcl_DStringGetResult} -constraints testdstring -body { set result {} lappend result [testdstring gresult special] testdstring append z 1 lappend result [testdstring get] } -cleanup { testdstring free } -result {{} {This is a specially-allocated stringz}} test dstring-7.1 {copying to Tcl_Obj} -constraints testdstring -setup { testdstring free } -body { testdstring append xyz -1 list [testdstring toobj] [testdstring length] } -cleanup { testdstring free } -result {xyz 0} test dstring-7.2 {copying to a Tcl_Obj} -constraints testdstring -setup { testdstring free unset -nocomplain a } -body { foreach l {a b c d e f g h i j k l m n o p} { testdstring append $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l\n -1 } set a [testdstring toobj] testdstring append abc -1 list $a [testdstring get] } -cleanup { testdstring free } -result {{aaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeee fffffffffffffffffffff ggggggggggggggggggggg hhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjj kkkkkkkkkkkkkkkkkkkkk lllllllllllllllllllll mmmmmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnnnnnnnn ooooooooooooooooooooo ppppppppppppppppppppp } abc} # cleanup if {[testConstraint testdstring]} { testdstring free } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/dict.test0000644000175000017500000017767415104661341014563 0ustar sergeisergei# This test file covers the dictionary object type and the dict command used # to work with values of that type. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 2003-2009 Donal K. Fellows # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] } testConstraint testobj [llength [info commands testobj]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc memtest script { set end [lindex [split [memory info] \n] 3 3] for {set i 0} {$i < 5} {incr i} { uplevel 1 $script set tmp $end set end [lindex [split [memory info] \n] 3 3] } expr {$end - $tmp} } } test dict-1.1 {dict command basic syntax} -returnCodes error -body { dict } -result {wrong # args: should be "dict subcommand ?arg ...?"} test dict-1.2 {dict command basic syntax} -returnCodes error -body { dict ? } -match glob -result {unknown or ambiguous subcommand "?": must be *} test dict-2.1 {dict create command} { dict create } {} test dict-2.2 {dict create command} { dict create a b } {a b} test dict-2.3 {dict create command} -body { set result {} set dict [dict create a b c d] # Can't compare directly as ordering of values is undefined foreach key {a c} { set idx [lsearch -exact $dict $key] if {$idx & 1} { error "found $key at odd index $idx in $dict" } lappend result [lindex $dict [expr {$idx+1}]] } return $result } -cleanup { unset result dict key idx } -result {b d} test dict-2.4 {dict create command} -returnCodes error -body { dict create a } -result {wrong # args: should be "dict create ?key value ...?"} test dict-2.5 {dict create command} -returnCodes error -body { dict create a b c } -result {wrong # args: should be "dict create ?key value ...?"} test dict-2.6 {dict create command - initialse refcount field!} -body { # Bug 715751 will show up in memory debuggers like purify for {set i 0} {$i<10} {incr i} { set dictv [dict create a 0] set share [dict values $dictv] list [dict incr dictv a] } } -cleanup { unset i dictv share } -result {} test dict-2.7 {dict create command - #-quoting in string rep} { dict create # #comment } {{#} #comment} test dict-2.8 {dict create command - #-quoting in string rep} -body { dict create #a x #b x } -match glob -result {{#?} x #? x} test dict-2.9 {dict create command: compilation} { apply {{} {dict create [format a] b}} } {a b} test dict-2.10 {dict create command: compilation} { apply {{} {dict create [format a] b c d}} } {a b c d} test dict-2.11 {dict create command: compilation} { apply {{} {dict create [format a] b c d a x}} } {a x c d} test dict-2.12 {dict create command: non-compilation} { dict create [format a] b } {a b} test dict-2.13 {dict create command: non-compilation} { dict create [format a] b c d } {a b c d} test dict-2.14 {dict create command: non-compilation} { dict create [format a] b c d a x } {a x c d} test dict-3.1 {dict get command} {dict get {a b} a} b test dict-3.2 {dict get command} {dict get {a b c d} a} b test dict-3.3 {dict get command} {dict get {a b c d} c} d test dict-3.4 {dict get command} -returnCodes error -body { dict get {a b c d} b } -result {key "b" not known in dictionary} test dict-3.5 {dict get command} {dict get {a {p q r s} b {u v x y}} a p} q test dict-3.6 {dict get command} {dict get {a {p q r s} b {u v x y}} a r} s test dict-3.7 {dict get command} {dict get {a {p q r s} b {u v x y}} b u} v test dict-3.8 {dict get command} {dict get {a {p q r s} b {u v x y}} b x} y test dict-3.9 {dict get command} -returnCodes error -body { dict get {a {p q r s} b {u v x y}} a z } -result {key "z" not known in dictionary} test dict-3.10 {dict get command} -returnCodes error -body { dict get {a {p q r s} b {u v x y}} c z } -result {key "c" not known in dictionary} test dict-3.11 {dict get command} {dict get [dict create a b c d] a} b test dict-3.12 {dict get command} -returnCodes error -body { dict get } -result {wrong # args: should be "dict get dictionary ?key ...?"} test dict-3.13 {dict get command} -body { set dict [dict get {a b c d}] if {$dict eq "a b c d"} { return OK } elseif {$dict eq "c d a b"} { return reordered } else { return $dict } } -cleanup { unset dict } -result OK test dict-3.14 {dict get command} -returnCodes error -body { dict get {a b c d} a c } -result {missing value to go with key} test dict-3.15 {compiled dict get error cleanliness - Bug 2431847} -body { apply {{} { dict set a(z) b c dict get $a(z) d }} } -returnCodes error -result {key "d" not known in dictionary} test dict-3.16 {dict/list shimmering - Bug 3004007} testobj { set l [list p 1 p 2 q 3] dict get $l q list $l [testobj objtype $l] } {{p 1 p 2 q 3} dict} test dict-4.1 {dict replace command} { dict replace {a b c d} } {a b c d} test dict-4.2 {dict replace command} { dict replace {a b c d} e f } {a b c d e f} test dict-4.3 {dict replace command} { dict replace {a b c d} c f } {a b c f} test dict-4.4 {dict replace command} { dict replace {a b c d} c x a y } {a y c x} test dict-4.5 {dict replace command} -returnCodes error -body { dict replace } -result {wrong # args: should be "dict replace dictionary ?key value ...?"} test dict-4.6 {dict replace command} -returnCodes error -body { dict replace {a a} a } -result {wrong # args: should be "dict replace dictionary ?key value ...?"} test dict-4.7 {dict replace command} -returnCodes error -body { dict replace {a a a} a b } -result {missing value to go with key} test dict-4.8 {dict replace command} -returnCodes error -body { dict replace [list a a a] a b } -result {missing value to go with key} test dict-4.9 {dict replace command} {dict replace [list a a] a b} {a b} test dict-4.10 {dict replace command} {dict replace [list a a] a b a c} {a c} test dict-4.11 {dict replace command: canonicality is forced} { dict replace { a b c d } } {a b c d} test dict-4.12 {dict replace command: canonicality is forced} { dict replace {a b c d a e} } {a e c d} test dict-4.13 {dict replace command: type check is mandatory} -body { dict replace { a b c d e } } -errorCode {TCL VALUE DICTIONARY} -result {missing value to go with key} test dict-4.14 {dict replace command: type check is mandatory} -body { dict replace { a b {}c d } } -returnCodes error -result {dict element in braces followed by "c" instead of space} test dict-4.14a {dict replace command: type check is mandatory} { catch {dict replace { a b {}c d }} -> opt dict get $opt -errorcode } {TCL VALUE DICTIONARY JUNK} test dict-4.15 {dict replace command: type check is mandatory} -body { dict replace { a b ""c d } } -returnCodes error -result {dict element in quotes followed by "c" instead of space} test dict-4.15a {dict replace command: type check is mandatory} { catch {dict replace { a b ""c d }} -> opt dict get $opt -errorcode } {TCL VALUE DICTIONARY JUNK} test dict-4.16 {dict replace command: type check is mandatory} -body { dict replace " a b \"c d " } -returnCodes error -result {unmatched open quote in dict} test dict-4.16a {dict replace command: type check is mandatory} { catch {dict replace " a b \"c d "} -> opt dict get $opt -errorcode } {TCL VALUE DICTIONARY QUOTE} test dict-4.17 {dict replace command: type check is mandatory} -body { dict replace " a b \{c d " } -errorCode {TCL VALUE DICTIONARY BRACE} -result {unmatched open brace in dict} test dict-4.18 {dict replace command: canonicality forcing doesn't leak} { set example { a b c d } list $example [dict replace $example] } {{ a b c d } {a b c d}} test dict-5.1 {dict remove command} {dict remove {a b c d} a} {c d} test dict-5.2 {dict remove command} {dict remove {a b c d} c} {a b} test dict-5.3 {dict remove command} {dict remove {a b c d} a c} {} test dict-5.4 {dict remove command} {dict remove {a b c d} c a} {} test dict-5.5 {dict remove command} { dict remove {a b c d} } {a b c d} test dict-5.6 {dict remove command} {dict remove {a b} c} {a b} test dict-5.7 {dict remove command} -returnCodes error -body { dict remove } -result {wrong # args: should be "dict remove dictionary ?key ...?"} test dict-5.8 {dict remove command: canonicality is forced} { dict remove { a b c d } } {a b c d} test dict-5.9 {dict remove command: canonicality is forced} { dict remove {a b c d a e} } {a e c d} test dict-5.10 {dict remove command: canonicality forced by update} { dict remove { a b c d } c } {a b} test dict-5.11 {dict remove command: type check is mandatory} -body { dict remove { a b c d e } } -returnCodes error -result {missing value to go with key} test dict-5.12 {dict remove command: type check is mandatory} -body { dict remove { a b {}c d } } -returnCodes error -result {dict element in braces followed by "c" instead of space} test dict-5.13 {dict remove command: canonicality forcing doesn't leak} { set example { a b c d } list $example [dict remove $example] } {{ a b c d } {a b c d}} test dict-6.1 {dict keys command} {dict keys {a b}} a test dict-6.2 {dict keys command} {dict keys {c d}} c test dict-6.3 {dict keys command} {lsort [dict keys {a b c d}]} {a c} test dict-6.4 {dict keys command} {dict keys {a b c d} a} a test dict-6.5 {dict keys command} {dict keys {a b c d} c} c test dict-6.6 {dict keys command} {dict keys {a b c d} e} {} test dict-6.7 {dict keys command} {lsort [dict keys {a b c d ca da} c*]} {c ca} test dict-6.8 {dict keys command} -returnCodes error -body { dict keys } -result {wrong # args: should be "dict keys dictionary ?pattern?"} test dict-6.9 {dict keys command} -returnCodes error -body { dict keys {} a b } -result {wrong # args: should be "dict keys dictionary ?pattern?"} test dict-6.10 {dict keys command} -returnCodes error -body { dict keys a } -result {missing value to go with key} test dict-7.1 {dict values command} {dict values {a b}} b test dict-7.2 {dict values command} {dict values {c d}} d test dict-7.3 {dict values command} {lsort [dict values {a b c d}]} {b d} test dict-7.4 {dict values command} {dict values {a b c d} b} b test dict-7.5 {dict values command} {dict values {a b c d} d} d test dict-7.6 {dict values command} {dict values {a b c d} e} {} test dict-7.7 {dict values command} {lsort [dict values {a b c d ca da} d*]} {d da} test dict-7.8 {dict values command} -returnCodes error -body { dict values } -result {wrong # args: should be "dict values dictionary ?pattern?"} test dict-7.9 {dict values command} -returnCodes error -body { dict values {} a b } -result {wrong # args: should be "dict values dictionary ?pattern?"} test dict-7.10 {dict values command} -returnCodes error -body { dict values a } -result {missing value to go with key} test dict-8.1 {dict size command} {dict size {}} 0 test dict-8.2 {dict size command} {dict size {a b}} 1 test dict-8.3 {dict size command} {dict size {a b c d}} 2 test dict-8.4 {dict size command} -returnCodes error -body { dict size } -result {wrong # args: should be "dict size dictionary"} test dict-8.5 {dict size command} -returnCodes error -body { dict size a b } -result {wrong # args: should be "dict size dictionary"} test dict-8.6 {dict size command} -returnCodes error -body { dict size a } -result {missing value to go with key} test dict-9.1 {dict exists command} {dict exists {a b} a} 1 test dict-9.2 {dict exists command} {dict exists {a b} b} 0 test dict-9.3 {dict exists command} {dict exists {a {b c}} a b} 1 test dict-9.4 {dict exists command} {dict exists {a {b c}} a c} 0 test dict-9.5 {dict exists command} {dict exists {a {b c}} b c} 0 test dict-9.6 {dict exists command} {dict exists {a {b c d}} a c} 0 test dict-9.7 {dict exists command} -returnCodes error -body { dict exists } -result {wrong # args: should be "dict exists dictionary key ?key ...?"} test dict-9.8 {dict exists command} -returnCodes error -body { dict exists {} } -result {wrong # args: should be "dict exists dictionary key ?key ...?"} test dict-10.1 {dict info command} -body { # Actual string returned by this command is undefined; it is # intended for human consumption and not for use by scripts. dict info {} } -match glob -result * test dict-10.2 {dict info command} -returnCodes error -body { dict info } -result {wrong # args: should be "dict info dictionary"} test dict-10.3 {dict info command} -returnCodes error -body { dict info {} x } -result {wrong # args: should be "dict info dictionary"} test dict-10.4 {dict info command} -returnCodes error -body { dict info x } -result {missing value to go with key} test dict-11.1 {dict incr command: unshared value} -body { set dictv [dict create \ a [string index "=0=" 1] \ b [expr {1+2}] \ c [expr {wide(0x80000000)+1}]] dict incr dictv a } -cleanup { unset dictv } -result {a 1 b 3 c 2147483649} test dict-11.2 {dict incr command: unshared value} -body { set dictv [dict create \ a [string index "=0=" 1] \ b [expr {1+2}] \ c [expr {wide(0x80000000)+1}]] dict incr dictv b } -cleanup { unset dictv } -result {a 0 b 4 c 2147483649} test dict-11.3 {dict incr command: unshared value} -body { set dictv [dict create \ a [string index "=0=" 1] \ b [expr {1+2}] \ c [expr {wide(0x80000000)+1}]] dict incr dictv c } -cleanup { unset dictv } -result {a 0 b 3 c 2147483650} test dict-11.4 {dict incr command: shared value} -body { set dictv [dict create a 0 b [expr {1+2}] c [expr {wide(0x80000000)+1}]] set sharing [dict values $dictv] dict incr dictv a } -cleanup { unset dictv sharing } -result {a 1 b 3 c 2147483649} test dict-11.5 {dict incr command: shared value} -body { set dictv [dict create a 0 b [expr {1+2}] c [expr {wide(0x80000000)+1}]] set sharing [dict values $dictv] dict incr dictv b } -cleanup { unset dictv sharing } -result {a 0 b 4 c 2147483649} test dict-11.6 {dict incr command: shared value} -body { set dictv [dict create a 0 b [expr {1+2}] c [expr {wide(0x80000000)+1}]] set sharing [dict values $dictv] dict incr dictv c } -cleanup { unset dictv sharing } -result {a 0 b 3 c 2147483650} test dict-11.7 {dict incr command: unknown values} -body { set dictv [dict create a 0 b [expr {1+2}] c [expr {wide(0x80000000)+1}]] dict incr dictv d } -cleanup { unset dictv } -result {a 0 b 3 c 2147483649 d 1} test dict-11.8 {dict incr command} -body { set dictv {a 1} dict incr dictv a 2 } -cleanup { unset dictv } -result {a 3} test dict-11.9 {dict incr command} -returnCodes error -body { set dictv {a dummy} dict incr dictv a } -cleanup { unset dictv } -result {expected integer but got "dummy"} test dict-11.10 {dict incr command} -returnCodes error -body { set dictv {a 1} dict incr dictv a dummy } -cleanup { unset dictv } -result {expected integer but got "dummy"} test dict-11.11 {dict incr command} -setup { unset -nocomplain dictv } -body { dict incr dictv a } -cleanup { unset dictv } -result {a 1} test dict-11.12 {dict incr command} -returnCodes error -body { set dictv a dict incr dictv a } -cleanup { unset dictv } -result {missing value to go with key} test dict-11.13 {dict incr command} -returnCodes error -body { set dictv a dict incr dictv a a a } -cleanup { unset dictv } -result {wrong # args: should be "dict incr dictVarName key ?increment?"} test dict-11.14 {dict incr command} -returnCodes error -body { set dictv a dict incr dictv } -cleanup { unset dictv } -result {wrong # args: should be "dict incr dictVarName key ?increment?"} test dict-11.15 {dict incr command: write failure} -setup { unset -nocomplain dictVar } -body { set dictVar(block) {} dict incr dictVar a } -returnCodes error -cleanup { unset dictVar } -result {can't set "dictVar": variable is array} test dict-11.16 {dict incr command: compilation} { apply {{} { set v {a 0 b 0 c 0} dict incr v a dict incr v b 1 dict incr v c 2 dict incr v d 3 list [dict get $v a] [dict get $v b] [dict get $v c] [dict get $v d] }} } {1 1 2 3} test dict-11.17 {dict incr command: compilation} { apply {{} { set dictv {a 1} dict incr dictv a 2 }} } {a 3} test dict-12.1 {dict lappend command} -body { set dictv {a a} dict lappend dictv a } -cleanup { unset dictv } -result {a a} test dict-12.2 {dict lappend command} -body { set dictv {a a} set sharing [dict values $dictv] dict lappend dictv a b } -cleanup { unset dictv sharing } -result {a {a b}} test dict-12.3 {dict lappend command} -body { set dictv {a a} dict lappend dictv a b c } -cleanup { unset dictv } -result {a {a b c}} test dict-12.2.1 {dict lappend command} -body { set dictv [dict create a [string index =a= 1]] dict lappend dictv a b } -cleanup { unset dictv } -result {a {a b}} test dict-12.4 {dict lappend command} -body { set dictv {} dict lappend dictv a x y z } -cleanup { unset dictv } -result {a {x y z}} test dict-12.5 {dict lappend command} -body { unset -nocomplain dictv dict lappend dictv a b } -cleanup { unset dictv } -result {a b} test dict-12.6 {dict lappend command} -returnCodes error -body { set dictv a dict lappend dictv a a } -cleanup { unset dictv } -result {missing value to go with key} test dict-12.7 {dict lappend command} -returnCodes error -body { dict lappend } -result {wrong # args: should be "dict lappend dictVarName key ?value ...?"} test dict-12.8 {dict lappend command} -returnCodes error -body { dict lappend dictv } -result {wrong # args: should be "dict lappend dictVarName key ?value ...?"} test dict-12.9 {dict lappend command} -returnCodes error -body { set dictv [dict create a "\{"] dict lappend dictv a a } -cleanup { unset dictv } -result {unmatched open brace in list} test dict-12.10 {dict lappend command: write failure} -setup { unset -nocomplain dictVar } -body { set dictVar(block) {} dict lappend dictVar a x } -returnCodes error -cleanup { unset dictVar } -result {can't set "dictVar": variable is array} test dict-12.11 {compiled dict append: invalidate string rep - Bug 3079830} { apply {{} {set d {a 1 b 2 c 3}; dict lappend d b 22}} } {a 1 b {2 22} c 3} test dict-13.1 {dict append command} -body { set dictv {a a} dict append dictv a } -cleanup { unset dictv } -result {a a} test dict-13.2 {dict append command} -body { set dictv {a a} set sharing [dict values $dictv] dict append dictv a b } -cleanup { unset dictv sharing } -result {a ab} test dict-13.3 {dict append command} -body { set dictv {a a} dict append dictv a b c } -cleanup { unset dictv } -result {a abc} test dict-13.2.1 {dict append command} -body { set dictv [dict create a [string index =a= 1]] dict append dictv a b } -cleanup { unset dictv } -result {a ab} test dict-13.4 {dict append command} -body { set dictv {} dict append dictv a x y z } -cleanup { unset dictv } -result {a xyz} test dict-13.5 {dict append command} -body { unset -nocomplain dictv dict append dictv a b } -cleanup { unset dictv } -result {a b} test dict-13.6 {dict append command} -returnCodes error -body { set dictv a dict append dictv a a } -cleanup { unset dictv } -result {missing value to go with key} test dict-13.7 {dict append command} -returnCodes error -body { dict append } -result {wrong # args: should be "dict append dictVarName key ?value ...?"} test dict-13.8 {dict append command} -returnCodes error -body { dict append dictv } -result {wrong # args: should be "dict append dictVarName key ?value ...?"} test dict-13.9 {dict append command: write failure} -setup { unset -nocomplain dictVar } -body { set dictVar(block) {} dict append dictVar a x } -returnCodes error -cleanup { unset dictVar } -result {can't set "dictVar": variable is array} test dict-13.10 {compiled dict append: crash case} { apply {{} {dict append dictVar a o k}} } {a ok} test dict-13.11 {compiled dict append: invalidate string rep - Bug 3079830} { apply {{} {set d {a 1 b 2 c 3}; dict append d b 22}} } {a 1 b 222 c 3} test dict-14.1 {dict for command: syntax} -returnCodes error -body { dict for } -result {wrong # args: should be "dict for {keyVarName valueVarName} dictionary script"} test dict-14.2 {dict for command: syntax} -returnCodes error -body { dict for x } -result {wrong # args: should be "dict for {keyVarName valueVarName} dictionary script"} test dict-14.3 {dict for command: syntax} -returnCodes error -body { dict for x x } -result {wrong # args: should be "dict for {keyVarName valueVarName} dictionary script"} test dict-14.4 {dict for command: syntax} -returnCodes error -body { dict for x x x x } -result {wrong # args: should be "dict for {keyVarName valueVarName} dictionary script"} test dict-14.5 {dict for command: syntax} -returnCodes error -body { dict for x x x } -result {must have exactly two variable names} test dict-14.6 {dict for command: syntax} -returnCodes error -body { dict for {x x x} x x } -result {must have exactly two variable names} test dict-14.7 {dict for command: syntax} -returnCodes error -body { dict for "\{x" x x } -result {unmatched open brace in list} test dict-14.8 {dict for command} -body { # This test confirms that [dict keys], [dict values] and [dict for] # all traverse a dictionary in the same order. set dictv {a A b B c C} set keys {} set values {} dict for {k v} $dictv { lappend keys $k lappend values $v } set result [expr { $keys eq [dict keys $dictv] && $values eq [dict values $dictv] }] expr {$result ? "YES" : [list "NO" $dictv $keys $values]} } -cleanup { unset result keys values k v dictv } -result YES test dict-14.9 {dict for command} { dict for {k v} {} { error "unexpected execution of 'dict for' body" } } {} test dict-14.10 {dict for command: script results} -body { set times 0 dict for {k v} {a a b b} { incr times continue error "shouldn't get here" } return $times } -cleanup { unset times k v } -result 2 test dict-14.11 {dict for command: script results} -body { set times 0 dict for {k v} {a a b b} { incr times break error "shouldn't get here" } return $times } -cleanup { unset times k v } -result 1 test dict-14.12 {dict for command: script results} -body { set times 0 list [catch { dict for {k v} {a a b b} { incr times error test } } msg] $msg $times $::errorInfo } -cleanup { unset times k v msg } -result {1 test 1 {test while executing "error test" ("dict for" body line 3) invoked from within "dict for {k v} {a a b b} { incr times error test }"}} test dict-14.13 {dict for command: script results} { apply {{} { dict for {k v} {a b} { return ok,$k,$v error "skipped return completely" } error "return didn't go far enough" }} } ok,a,b test dict-14.14 {dict for command: handle representation loss} -constraints testobj -body { set dictVar {a b c d e f g h} set keys {} set values {} dict for {k v} $dictVar { if {[string length $dictVar]} { lappend keys $k lappend values $v } } list [lsort $keys] [lsort $values] [testobj objtype $dictVar] } -cleanup { unset dictVar keys values k v } -result {{a c e g} {b d f h} string} test dict-14.15 {dict for command: keys are unique and iterated over once only} -setup { unset -nocomplain accum array set accum {} } -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict for {k v} $dictVar { append accum($k) $v, } set result [lsort [array names accum]] lappend result : foreach k $result { catch {lappend result $accum($k)} } return $result } -cleanup { unset dictVar k v result accum } -result {a1 a2 b1 b2 bar foo : a, b, c, d, foo, bar,} test dict-14.16 {dict for command in compilation context} { apply {{} { set res {x x x x x x} dict for {k v} {a 0 b 1 c 2 d 3 e 4 f 5} { lset res $v $k continue } return $res }} } {a b c d e f} test dict-14.17 {dict for command in compilation context} { # Bug 1379349 apply {{} { set d [dict create a 1] ;# Dict must be unshared! dict for {k v} $d { dict set d $k 0 ;# Any modification will do } return $d }} } {a 0} test dict-14.18 {dict for command in compilation context} { # Bug 1382528 apply {{} { dict for {k v} {} {} ;# Note empty dict catch { error foo } ;# Note compiled [catch] }} } 1 test dict-14.19 {dict for and invalid dicts: bug 1531184} -body { di[list]ct for {k v} x {} } -returnCodes 1 -result {missing value to go with key} test dict-14.20 {dict for stack space compilation: bug 1903325} { apply {{x y args} { dict for {a b} $x {} concat "c=$y,$args" }} {} 1 2 3 } {c=1,2 3} test dict-14.21 {compiled dict for and break} { apply {{} { dict for {a b} {c d e f} { lappend result $a,$b break } return $result }} } c,d test dict-14.22 {dict for and exception range depths: Bug 3614382} { apply {{} { dict for {a b} {c d} { dict for {e f} {g h} { return 5 } } }} } 5 # There's probably a lot more tests to add here. Really ought to use a # coverage tool for this job... test dict-15.1 {dict set command} -body { set dictVar {} dict set dictVar a x } -cleanup { unset dictVar } -result {a x} test dict-15.2 {dict set command} -body { set dictvar {a {}} dict set dictvar a b x } -cleanup { unset dictvar } -result {a {b x}} test dict-15.3 {dict set command} -body { set dictvar {a {b {}}} dict set dictvar a b c x } -cleanup { unset dictvar } -result {a {b {c x}}} test dict-15.4 {dict set command} -body { set dictVar {a y} dict set dictVar a x } -cleanup { unset dictVar } -result {a x} test dict-15.5 {dict set command} -body { set dictVar {a {b y}} dict set dictVar a b x } -cleanup { unset dictVar } -result {a {b x}} test dict-15.6 {dict set command} -body { set dictVar {a {b {c y}}} dict set dictVar a b c x } -cleanup { unset dictVar } -result {a {b {c x}}} test dict-15.7 {dict set command: path creation} -body { set dictVar {} dict set dictVar a b x } -cleanup { unset dictVar } -result {a {b x}} test dict-15.8 {dict set command: creates variables} -setup { unset -nocomplain dictVar } -body { dict set dictVar a x return $dictVar } -cleanup { unset dictVar } -result {a x} test dict-15.9 {dict set command: write failure} -setup { unset -nocomplain dictVar } -body { set dictVar(block) {} dict set dictVar a x } -returnCodes error -cleanup { unset dictVar } -result {can't set "dictVar": variable is array} test dict-15.10 {dict set command: syntax} -returnCodes error -body { dict set } -result {wrong # args: should be "dict set dictVarName key ?key ...? value"} test dict-15.11 {dict set command: syntax} -returnCodes error -body { dict set a } -result {wrong # args: should be "dict set dictVarName key ?key ...? value"} test dict-15.12 {dict set command: syntax} -returnCodes error -body { dict set a a } -result {wrong # args: should be "dict set dictVarName key ?key ...? value"} test dict-15.13 {dict set command} -returnCodes error -body { set dictVar a dict set dictVar b c } -cleanup { unset dictVar } -result {missing value to go with key} test dict-16.1 {dict unset command} -body { set dictVar {a b c d} dict unset dictVar a } -cleanup { unset dictVar } -result {c d} test dict-16.2 {dict unset command} -body { set dictVar {a b c d} dict unset dictVar c } -cleanup { unset dictVar } -result {a b} test dict-16.3 {dict unset command} -body { set dictVar {a b} dict unset dictVar c } -cleanup { unset dictVar } -result {a b} test dict-16.4 {dict unset command} -body { set dictVar {a {b c d e}} dict unset dictVar a b } -cleanup { unset dictVar } -result {a {d e}} test dict-16.5 {dict unset command} -returnCodes error -body { set dictVar a dict unset dictVar a } -cleanup { unset dictVar } -result {missing value to go with key} test dict-16.6 {dict unset command} -returnCodes error -body { set dictVar {a b} dict unset dictVar c d } -cleanup { unset dictVar } -result {key "c" not known in dictionary} test dict-16.7 {dict unset command} -setup { unset -nocomplain dictVar } -body { list [info exists dictVar] [dict unset dictVar a] [info exists dictVar] } -cleanup { unset dictVar } -result {0 {} 1} test dict-16.8 {dict unset command} -returnCodes error -body { dict unset dictVar } -result {wrong # args: should be "dict unset dictVarName key ?key ...?"} test dict-16.9 {dict unset command: write failure} -setup { unset -nocomplain dictVar } -body { set dictVar(block) {} dict unset dictVar a } -returnCodes error -cleanup { unset dictVar } -result {can't set "dictVar": variable is array} # Now test with an LVT present (i.e., the bytecoded version). test dict-16.10 {dict unset command} -body { apply {{} { set dictVar {a b c d} dict unset dictVar a }} } -result {c d} test dict-16.11 {dict unset command} -body { apply {{} { set dictVar {a b c d} dict unset dictVar c }} } -result {a b} test dict-16.12 {dict unset command} -body { apply {{} { set dictVar {a b} dict unset dictVar c }} } -result {a b} test dict-16.13 {dict unset command} -body { apply {{} { set dictVar {a {b c d e}} dict unset dictVar a b }} } -result {a {d e}} test dict-16.14 {dict unset command} -returnCodes error -body { apply {{} { set dictVar a dict unset dictVar a }} } -result {missing value to go with key} test dict-16.15 {dict unset command} -returnCodes error -body { apply {{} { set dictVar {a b} dict unset dictVar c d }} } -result {key "c" not known in dictionary} test dict-16.16 {dict unset command} -body { apply {{} {list [info exists dictVar] [dict unset dictVar a] [info exists dictVar]}} } -result {0 {} 1} test dict-16.17 {dict unset command} -returnCodes error -body { apply {{} {dict unset dictVar}} } -result {wrong # args: should be "dict unset dictVarName key ?key ...?"} test dict-16.18 {dict unset command: write failure} -body { apply {{} { set dictVar(block) {} dict unset dictVar a }} } -returnCodes error -result {can't set "dictVar": variable is array} test dict-17.1 {dict filter command: key} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict filter $dictVar key a2 } -cleanup { unset dictVar } -result {a2 b} test dict-17.2 {dict filter command: key} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict size [dict filter $dictVar key *] } -cleanup { unset dictVar } -result 6 test dict-17.3 {dict filter command: key} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict filter $dictVar key ??? } -cleanup { unset dictVar } -result {foo bar bar foo} test dict-17.4 {dict filter command: key - no patterns} { dict filter {a b c d} key } {} test dict-17.4.1 {dict filter command: key - many patterns} { dict filter {a1 a a2 b b1 c b2 d foo bar bar foo} key a? b? } {a1 a a2 b b1 c b2 d} test dict-17.5 {dict filter command: key - bad dict} -returnCodes error -body { dict filter {a b c} key } -result {missing value to go with key} test dict-17.6 {dict filter command: value} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict filter $dictVar value c } -cleanup { unset dictVar } -result {b1 c} test dict-17.7 {dict filter command: value} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict size [dict filter $dictVar value *] } -cleanup { unset dictVar } -result 6 test dict-17.8 {dict filter command: value} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict filter $dictVar value ??? } -cleanup { unset dictVar } -result {foo bar bar foo} test dict-17.9 {dict filter command: value - no patterns} { dict filter {a b c d} value } {} test dict-17.9.1 {dict filter command: value - many patterns} { dict filter {a a1 b a2 c b1 foo bar bar foo d b2} value a? b? } {a a1 b a2 c b1 d b2} test dict-17.10 {dict filter command: value - bad dict} -body { dict filter {a b c} value a } -returnCodes error -result {missing value to go with key} test dict-17.11 {dict filter command: script} -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} set n 0 list [dict filter $dictVar script {k v} { incr n expr {[string length $k] == [string length $v]} }] $n } -cleanup { unset dictVar n k v } -result {{foo bar bar foo} 6} test dict-17.12 {dict filter command: script} -returnCodes error -body { dict filter {a b} script {k v} { concat $k $v } } -cleanup { unset k v } -result {expected boolean value but got a list} test dict-17.13 {dict filter command: script} -body { list [catch {dict filter {a b} script {k v} {error x}} msg] $msg \ $::errorInfo } -cleanup { unset k v msg } -result {1 x {x while executing "error x" ("dict filter" script line 1) invoked from within "dict filter {a b} script {k v} {error x}"}} test dict-17.14 {dict filter command: script} -setup { set n 0 } -body { list [dict filter {a b c d} script {k v} { incr n break error boom! }] $n } -cleanup { unset n k v } -result {{} 1} test dict-17.15 {dict filter command: script} -setup { set n 0 } -body { list [dict filter {a b c d} script {k v} { incr n continue error boom! }] $n } -cleanup { unset n k v } -result {{} 2} test dict-17.16 {dict filter command: script} { apply {{} { dict filter {a b} script {k v} { return ok,$k,$v error "skipped return completely" } error "return didn't go far enough" }} } ok,a,b test dict-17.17 {dict filter command: script} -body { dict filter {a b} script {k k} {continue} return $k } -cleanup { unset k } -result b test dict-17.18 {dict filter command: script} -returnCodes error -body { dict filter {a b} script {k k} } -result {wrong # args: should be "dict filter dictionary script {keyVarName valueVarName} filterScript"} test dict-17.19 {dict filter command: script} -returnCodes error -body { dict filter {a b} script k {continue} } -result {must have exactly two variable names} test dict-17.20 {dict filter command: script} -returnCodes error -body { dict filter {a b} script "\{k v" {continue} } -result {unmatched open brace in list} test dict-17.21 {dict filter command} -returnCodes error -body { dict filter {a b} } -result {wrong # args: should be "dict filter dictionary filterType ?arg ...?"} test dict-17.22 {dict filter command} -returnCodes error -body { dict filter {a b} JUNK } -result {bad filterType "JUNK": must be key, script, or value} test dict-17.23 {dict filter command} -returnCodes error -body { dict filter a key * } -result {missing value to go with key} test dict-18.1 {dict-list relationship} -body { # Test that any internal conversion between list and dict does not change # the object set l [list 1 2 3 4 5 6 7 8 9 0 q w e r t y] dict values $l return $l } -cleanup { unset l } -result {1 2 3 4 5 6 7 8 9 0 q w e r t y} test dict-18.2 {dict-list relationship} -body { # Test that the dictionary is a valid list set d [dict create "abc def" 0 "a\{b" 1 "c\}d" 2] for {set t 0} {$t < 5} {incr t} { llength $d dict lappend d "abc def" "\}\{" dict append d "a\{b" "\}" dict incr d "c\}d" 1 } llength $d } -cleanup { unset d t } -result 6 test dict-18.3 {dict-list relationship} -body { set ld [list a b c d c e f g] list [string length $ld] [dict size $ld] [llength $ld] } -cleanup { unset ld } -result {15 3 8} test dict-18.4 {dict-list relationship} -body { set ld [list a b c d c e f g] list [llength $ld] [dict size $ld] [llength $ld] } -cleanup { unset ld } -result {8 3 8} # This is a test for a specific bug. # It shows a bad ref counter when running with memdebug on. test dict-19.1 {memory bug} { apply {{} { set successors [dict create x {c d}] dict set successors x a b dict get $successors x }} } [dict create c d a b] test dict-19.2 {dict: testing for leaks} -constraints memory -body { # This test is made to stress object reference management memtest { apply {{} { # A shared invalid dictionary set apa {a {}b c d} set bepa $apa catch {dict replace $apa e f} catch {dict remove $apa c d} catch {dict incr apa a 5} catch {dict lappend apa a 5} catch {dict append apa a 5} catch {dict set apa a 5} catch {dict unset apa a} # A shared valid dictionary, invalid incr set apa {a b c d} set bepa $apa catch {dict incr bepa a 5} # An error during write to an unshared object, incr set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {dict incr bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to a shared object, incr set apa {a 1 b 2} set bepa $apa trace add variable bepa write {error hej} catch {dict incr bepa a 5} trace remove variable bepa write {error hej} unset bepa # A shared valid dictionary, invalid lappend set apa [list a {{}b} c d] set bepa $apa catch {dict lappend bepa a 5} # An error during write to an unshared object, lappend set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {dict lappend bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to a shared object, lappend set apa {a 1 b 2} set bepa $apa trace add variable bepa write {error hej} catch {dict lappend bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to an unshared object, append set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {dict append bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to a shared object, append set apa {a 1 b 2} set bepa $apa trace add variable bepa write {error hej} catch {dict append bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to an unshared object, set set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {dict set bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to a shared object, set set apa {a 1 b 2} set bepa $apa trace add variable bepa write {error hej} catch {dict set bepa a 5} trace remove variable bepa write {error hej} unset bepa # An error during write to an unshared object, unset set apa {a 1 b 2} set bepa [lrange $apa 0 end] trace add variable bepa write {error hej} catch {dict unset bepa a} trace remove variable bepa write {error hej} unset bepa # An error during write to a shared object, unset set apa {a 1 b 2} set bepa $apa trace add variable bepa write {error hej} catch {dict unset bepa a} trace remove variable bepa write {error hej} unset bepa }} } } -result 0 test dict-19.3 {testing for leaks - Bug 2874678} -constraints memory -body { set d aDictVar; # Force interpreted [dict incr] memtest { dict incr $d aKey 0 unset $d } } -cleanup { unset d } -result 0 test dict-20.1 {dict merge command} { dict merge } {} test dict-20.2 {dict merge command} { dict merge {a b c d e f} } {a b c d e f} test dict-20.3 {dict merge command} -body { dict merge {a b c d e} } -result {missing value to go with key} -returnCodes error test dict-20.4 {dict merge command} { dict merge {a b c d} {e f g h} } {a b c d e f g h} test dict-20.5 {dict merge command} -body { dict merge {a b c d e} {e f g h} } -result {missing value to go with key} -returnCodes error test dict-20.6 {dict merge command} -body { dict merge {a b c d} {e f g h i} } -result {missing value to go with key} -returnCodes error test dict-20.7 {dict merge command} { dict merge {a b c d e f} {e x g h} } {a b c d e x g h} test dict-20.8 {dict merge command} { dict merge {a b c d} {a x c y} } {a x c y} test dict-20.9 {dict merge command} { dict merge {a b c d} {c y a x} } {a x c y} test dict-20.10 {dict merge command} { dict merge {a b c d e f} {a x 1 2 3 4} {a - 1 -} } {a - c d e f 1 - 3 4} test dict-20.11 {dict merge command} { apply {{} {dict merge}} } {} test dict-20.12 {dict merge command} { apply {{} {dict merge {a b c d e f}}} } {a b c d e f} test dict-20.13 {dict merge command} -body { apply {{} {dict merge {a b c d e}}} } -result {missing value to go with key} -returnCodes error test dict-20.14 {dict merge command} { apply {{} {dict merge {a b c d} {e f g h}}} } {a b c d e f g h} test dict-20.15 {dict merge command} -body { apply {{} {dict merge {a b c d e} {e f g h}}} } -result {missing value to go with key} -returnCodes error test dict-20.16 {dict merge command} -body { apply {{} {dict merge {a b c d} {e f g h i}}} } -result {missing value to go with key} -returnCodes error test dict-20.17 {dict merge command} { apply {{} {dict merge {a b c d e f} {e x g h}}} } {a b c d e x g h} test dict-20.18 {dict merge command} { apply {{} {dict merge {a b c d} {a x c y}}} } {a x c y} test dict-20.19 {dict merge command} { apply {{} {dict merge {a b c d} {c y a x}}} } {a x c y} test dict-20.20 {dict merge command} { apply {{} {dict merge {a b c d e f} {a x 1 2 3 4} {a - 1 -}}} } {a - c d e f 1 - 3 4} test dict-20.21 {dict merge command: canonicality not forced} { dict merge { a b c d } } { a b c d } test dict-20.22 {dict merge command: canonicality not forced} { dict merge { a b c d } {} } { a b c d } test dict-20.23 {dict merge command: canonicality forced by update} { dict merge { a b c d } {a b} } {a b c d} test dict-20.24 {dict merge command: type check is mandatory} -body { dict merge { a b c d e } } -returnCodes error -result {missing value to go with key} test dict-20.25 {dict merge command: type check is mandatory} -body { dict merge { a b {}c d } } -returnCodes error -result {dict element in braces followed by "c" instead of space} test dict-21.1 {dict update command} -returnCodes 1 -body { dict update } -result {wrong # args: should be "dict update dictVarName key varName ?key varName ...? script"} test dict-21.2 {dict update command} -returnCodes 1 -body { dict update v } -result {wrong # args: should be "dict update dictVarName key varName ?key varName ...? script"} test dict-21.3 {dict update command} -returnCodes 1 -body { dict update v k } -result {wrong # args: should be "dict update dictVarName key varName ?key varName ...? script"} test dict-21.4 {dict update command} -returnCodes 1 -body { dict update v k v } -result {wrong # args: should be "dict update dictVarName key varName ?key varName ...? script"} test dict-21.5 {dict update command} -body { set a {b c} set result {} set bb {} dict update a b bb { lappend result $a $bb } lappend result $a } -cleanup { unset a result bb } -result {{b c} c {b c}} test dict-21.6 {dict update command} -body { set a {b c} set result {} set bb {} dict update a b bb { lappend result $a $bb [set bb d] } lappend result $a } -cleanup { unset a result bb } -result {{b c} c d {b d}} test dict-21.7 {dict update command} -body { set a {b c} set result {} set bb {} dict update a b bb { lappend result $a $bb [unset bb] } lappend result $a } -cleanup { unset a result } -result {{b c} c {} {}} test dict-21.8 {dict update command} -body { set a {b c d e} dict update a b v1 d v2 { lassign "$v1 $v2" v2 v1 } return $a } -cleanup { unset a v1 v2 } -result {b e d c} test dict-21.9 {dict update command} -body { set a {b c d e} dict update a b v1 d v2 {unset a} info exist a } -cleanup { unset v1 v2 } -result 0 test dict-21.10 {dict update command} -body { set a {b {c d}} dict update a b v1 { dict update v1 c v2 { set v2 foo } } return $a } -cleanup { unset a v1 v2 } -result {b {c foo}} test dict-21.11 {dict update command} -body { set a {b c d e} dict update a b v1 d v2 { dict set a f g } return $a } -cleanup { unset a v1 v2 } -result {b c d e f g} test dict-21.12 {dict update command} -body { set a {b c d e} dict update a b v1 d v2 f v3 { set v3 g } return $a } -cleanup { unset a v1 v2 v3 } -result {b c d e f g} test dict-21.13 {dict update command: compilation} { apply {d { while 1 { dict update d a alpha b beta { set beta $alpha unset alpha break } } return $d }} {a 1 c 2} } {c 2 b 1} test dict-21.14 {dict update command: compilation} { apply {x { set indices {2 3} trace add variable aa write "string length \$indices ;#" dict update x k aa l bb {} }} {k 1 l 2} } {} test dict-21.15 {dict update command: compilation} { apply {x { set indices {2 3} trace add variable aa read "string length \$indices ;#" dict update x k aa l bb {} }} {k 1 l 2} } {} test dict-21.16 {dict update command: no recursive structures [Bug 1786481]} -body { set foo {a {b {c {d {e 1}}}}} dict update foo a t { dict update t b t { dict update t c t { dict update t d t { dict incr t e } } } } string range [append foo OK] end-1 end } -cleanup { unset foo t } -result OK test dict-21.17 {dict update command: no recursive structures [Bug 1786481]} { apply {{} { set foo {a {b {c {d {e 1}}}}} dict update foo a t { dict update t b t { dict update t c t { dict update t d t { dict incr t e } } } } string range [append foo OK] end-1 end }} } OK test dict-22.1 {dict with command} -body { dict with } -returnCodes 1 -result {wrong # args: should be "dict with dictVarName ?key ...? script"} test dict-22.2 {dict with command} -body { dict with v } -returnCodes 1 -result {wrong # args: should be "dict with dictVarName ?key ...? script"} test dict-22.3 {dict with command} -body { unset -nocomplain v dict with v {error "in body"} } -returnCodes 1 -result {can't read "v": no such variable} test dict-22.4 {dict with command} -body { set a {b c d e} unset -nocomplain b d set result [list [info exist b] [info exist d]] dict with a { lappend result [info exist b] [info exist d] $b $d } return $result } -cleanup { unset a b d result } -result {0 0 1 1 c e} test dict-22.5 {dict with command} -body { set a {b c d e} dict with a { lassign "$b $d" d b } return $a } -cleanup { unset a b d } -result {b e d c} test dict-22.6 {dict with command} -body { set a {b c d e} dict with a { unset b # This *won't* go into the dict... set f g } return $a } -cleanup { unset a d f } -result {d e} test dict-22.7 {dict with command} -body { set a {b c d e} dict with a { dict unset a b } return $a } -cleanup { unset a } -result {d e b c} test dict-22.8 {dict with command} -body { set a [dict create b c] dict with a { set b $a } return $a } -cleanup { unset a b } -result {b {b c}} test dict-22.9 {dict with command} -body { set a {b {c d}} dict with a b { set c $c$c } return $a } -cleanup { unset a c } -result {b {c dd}} test dict-22.10 {dict with command: result handling tricky case} -body { set a {b {c d}} foreach i {0 1} { if {$i} break dict with a b { set a {} # We're checking to see if we lose this break break } } list $i $a } -cleanup { unset a i c } -result {0 {}} test dict-22.11 {dict with command: no recursive structures [Bug 1786481]} -body { set foo {t {t {t {inner 1}}}} dict with foo { dict with t { dict with t { dict with t { incr inner } } } } string range [append foo OK] end-1 end } -cleanup { unset foo t inner } -result OK test dict-22.12 {dict with: compiled} { apply {{} { set d {a 1 b 2} list [dict with d { set a $b unset b dict set d c 3 list ok }] $d }} } {ok {a 2 c 3}} test dict-22.13 {dict with: compiled} { apply {i { set d($i) {a 1 b 2} list [dict with d($i) { set a $b unset b dict set d($i) c 3 list ok }] [array get d] }} e } {ok {e {a 2 c 3}}} test dict-22.14 {dict with: compiled} { apply {{} { set d {a 1 b 2} foreach x {1 2 3} { dict with d { incr a $b if {$x == 2} break } unset a b } list $a $b $x $d }} } {5 2 2 {a 5 b 2}} test dict-22.15 {dict with: compiled} { apply {i { set d($i) {a 1 b 2} foreach x {1 2 3} { dict with d($i) { incr a $b if {$x == 2} break } unset a b } list $a $b $x [array get d] }} e } {5 2 2 {e {a 5 b 2}}} test dict-22.16 {dict with: compiled} { apply {{} { set d {p {q {a 1 b 2}}} dict with d p q { set a $b.$a } return $d }} } {p {q {a 2.1 b 2}}} test dict-22.17 {dict with: compiled} { apply {i { set d($i) {p {q {a 1 b 2}}} dict with d($i) p q { set a $b.$a } array get d }} e } {e {p {q {a 2.1 b 2}}}} test dict-22.18 {dict with: compiled} { set ::d {a 1 b 2} apply {{} { dict with ::d { set a $b.$a } return $::d }} } {a 2.1 b 2} test dict-22.19 {dict with: compiled} { set ::d {p {q {r {a 1 b 2}}}} apply {{} { dict with ::d p q r { set a $b.$a } return $::d }} } {p {q {r {a 2.1 b 2}}}} test dict-22.20 {dict with: compiled} { apply {d { dict with d { } return $a,$b }} {a 1 b 2} } 1,2 test dict-22.21 {dict with: compiled} { apply {d { dict with d p q { } return $a,$b }} {p {q {a 1 b 2}}} } 1,2 test dict-22.22 {dict with: compiled} { set ::d {a 1 b 2} apply {{} { dict with ::d { } return $a,$b }} } 1,2 test dict-22.23 {dict with: compiled} { set ::d {p {q {a 1 b 2}}} apply {{} { dict with ::d p q { } return $a,$b }} } 1,2 proc linenumber {} { dict get [info frame -1] line } test dict-23.1 {dict compilation crash: Bug 3487626} { apply {{} {apply {n { set e {} set k {} dict for {a b} {c {d {e {f g}}}} { ::tcl::dict::for {h i} $b { dict update i e j { ::tcl::dict::update j f k { return [expr {$n - [linenumber]}] } } } } }} [linenumber]}} } 5 test dict-23.2 {dict compilation crash: Bug 3487626} { # Something isn't quite right in line number and continuation line # tracking; at time of writing, this test produces 7, not 5, which # indicates that the extra newlines in the non-script argument are # confusing things. apply {{} {apply {n { set e {} set k {} dict for {a { b }} {c {d {e {f g}}}} { ::tcl::dict::for {h { i }} ${ b } { dict update { i } e { j } { ::tcl::dict::update { j } f k { return [expr {$n - [linenumber]}] } } } } }} [linenumber]}} } 5 rename linenumber {} test dict-24.1 {dict map command: syntax} -returnCodes error -body { dict map } -result {wrong # args: should be "dict map {keyVarName valueVarName} dictionary script"} test dict-24.2 {dict map command: syntax} -returnCodes error -body { dict map x } -result {wrong # args: should be "dict map {keyVarName valueVarName} dictionary script"} test dict-24.3 {dict map command: syntax} -returnCodes error -body { dict map x x } -result {wrong # args: should be "dict map {keyVarName valueVarName} dictionary script"} test dict-24.4 {dict map command: syntax} -returnCodes error -body { dict map x x x x } -result {wrong # args: should be "dict map {keyVarName valueVarName} dictionary script"} test dict-24.5 {dict map command: syntax} -returnCodes error -body { dict map x x x } -result {must have exactly two variable names} test dict-24.6 {dict map command: syntax} -returnCodes error -body { dict map {x x x} x x } -result {must have exactly two variable names} test dict-24.7 {dict map command: syntax} -returnCodes error -body { dict map "\{x" x x } -result {unmatched open brace in list} test dict-24.8 {dict map command} -setup { set values {} set keys {} } -body { # This test confirms that [dict keys], [dict values] and [dict map] # all traverse a dictionary in the same order. set dictv {a A b B c C} dict map {k v} $dictv { lappend keys $k lappend values $v } set result [expr { $keys eq [dict keys $dictv] && $values eq [dict values $dictv] }] expr {$result ? "YES" : [list "NO" $dictv $keys $values]} } -cleanup { unset result keys values k v dictv } -result YES test dict-24.9 {dict map command} { dict map {k v} {} { error "unexpected execution of 'dict map' body" } } {} test dict-24.10 {dict map command: script results} -body { set times 0 dict map {k v} {a a b b} { incr times continue error "shouldn't get here" } return $times } -cleanup { unset times k v } -result 2 test dict-24.11 {dict map command: script results} -body { set times 0 dict map {k v} {a a b b} { incr times break error "shouldn't get here" } return $times } -cleanup { unset times k v } -result 1 test dict-24.12 {dict map command: script results} -body { set times 0 list [catch { dict map {k v} {a a b b} { incr times error test } } msg] $msg $times $::errorInfo } -cleanup { unset times k v msg } -result {1 test 1 {test while executing "error test" ("dict map" body line 3) invoked from within "dict map {k v} {a a b b} { incr times error test }"}} test dict-24.13 {dict map command: script results} { apply {{} { dict map {k v} {a b} { return ok,$k,$v error "skipped return completely" } error "return didn't go far enough" }} } ok,a,b test dict-24.14 {dict map command: handle representation loss} -constraints testobj -setup { set keys {} set values {} } -body { set dictVar {a b c d e f g h} list [dict size [dict map {k v} $dictVar { if {[string length $dictVar]} { lappend keys $k lappend values $v return -level 0 $k } }]] [lsort $keys] [lsort $values] [testobj objtype $dictVar] } -cleanup { unset dictVar keys values k v } -result {4 {a c e g} {b d f h} string} test dict-24.14a {dict map command: handle representation loss} -constraints testobj -body { apply {{} { set dictVar {a b c d e f g h} list [dict size [dict map {k v} $dictVar { if {[string length $dictVar]} { lappend keys $k lappend values $v return -level 0 $k } }]] [lsort $keys] [lsort $values] [testobj objtype $dictVar] }} } -result {4 {a c e g} {b d f h} string} test dict-24.15 {dict map command: keys are unique and iterated over once only} -setup { unset -nocomplain accum array set accum {} } -body { set dictVar {a1 a a2 b b1 c b2 d foo bar bar foo} dict map {k v} $dictVar { append accum($k) $v, } set result [lsort [array names accum]] lappend result : foreach k $result { catch {lappend result $accum($k)} } return $result } -cleanup { unset dictVar k v result accum } -result {a1 a2 b1 b2 bar foo : a, b, c, d, foo, bar,} test dict-24.16 {dict map command in compilation context} { apply {{} { set res {x x x x x x} dict map {k v} {a 0 b 1 c 2 d 3 e 4 f 5} { lset res $v $k continue } return $res }} } {a b c d e f} test dict-24.17 {dict map command in compilation context} { # Bug 1379349 (dict for) apply {{} { set d [dict create a 1] ;# Dict must be unshared! dict map {k v} $d { dict set d $k 0 ;# Any modification will do } return $d }} } {a 0} test dict-24.17a {dict map command in compilation context} { # Bug 1379349 (dict for) apply {{} { set d [dict create a 1] ;# Dict must be unshared! dict map {k v} $d { dict set d $k 0 ;# Any modification will do } }} } {a {a 0}} test dict-24.18 {dict map command in compilation context} { # Bug 1382528 (dict for) apply {{} { dict map {k v} {} {} ;# Note empty dict catch { error foo } ;# Note compiled [catch] }} } 1 test dict-24.19 {dict map and invalid dicts: 'dict for' bug 1531184} -body { di[list]ct map {k v} x {} } -returnCodes 1 -result {missing value to go with key} test dict-24.20 {dict map stack space compilation: 'dict for' bug 1903325} { apply {{x y args} { dict map {a b} $x {} concat "c=$y,$args" }} {} 1 2 3 } {c=1,2 3} proc linenumber {} { dict get [info frame -1] line } test dict-24.20.1 {dict compilation crash: 'dict for' bug 3487626} { apply {{} {apply {n { set e {} set k {} dict map {a b} {c {d {e {f g}}}} { ::tcl::dict::map {h i} $b { dict update i e j { ::tcl::dict::update j f k { return [expr {$n - [linenumber]}] } } } } }} [linenumber]}} } 5 test dict-24.21 {dict compilation crash: 'dict for' bug 3487626} { apply {{} {apply {n { set e {} set k {} dict map {a { b }} {c {d {e {f g}}}} { ::tcl::dict::map {h { i }} ${ b } { dict update { i } e { j } { ::tcl::dict::update { j } f k { return [expr {$n - [linenumber]}] } } } } }} [linenumber]}} } 5 test dict-23.3 {CompileWord OBOE} { # segfault when buggy apply {{} {tcl::dict::lappend foo bar \ [format baz]}} } {bar baz} test dict-23.4 {CompileWord OBOE} { apply {n { dict set foo {*}{ } [return [incr n -[linenumber]]] val }} [linenumber] } 1 test dict-23.5 {CompileWord OBOE} { # segfault when buggy apply {{} {tcl::dict::incr foo \ [format bar]}} } {bar 1} test dict-23.6 {CompileWord OBOE} { apply {n { dict get {a b} {*}{ } [return [incr n -[linenumber]]] }} [linenumber] } 1 test dict-23.7 {CompileWord OBOE} { apply {n { dict for {a b} [return [incr n -[linenumber]]] {*}{ } {} }} [linenumber] } 2 test dict-23.8 {CompileWord OBOE} { apply {n { dict update foo {*}{ } [return [incr n -[linenumber]]] x {} }} [linenumber] } 1 test dict-23.9 {CompileWord OBOE} { apply {n { dict exists {} {*}{ } [return [incr n -[linenumber]]] }} [linenumber] } 1 test dict-23.10 {CompileWord OBOE} { apply {n { dict with foo {*}{ } [return [incr n -[linenumber]]] {} }} [linenumber] } 1 test dict-23.11 {CompileWord OBOE} { apply {n { dict with ::foo {*}{ } [return [incr n -[linenumber]]] {} }} [linenumber] } 1 test dict-23.12 {CompileWord OBOE} { apply {n { dict with {*}{ } [return [incr n -[linenumber]]] {} }} [linenumber] } 1 test dict-23.13 {CompileWord OBOE} { apply {n { dict with {*}{ } [return [incr n -[linenumber]]] {bar} }} [linenumber] } 1 test dict-23.14 {CompileWord OBOE} { apply {n { dict with foo {*}{ } [return [incr n -[linenumber]]] {bar} }} [linenumber] } 1 rename linenumber {} test dict-24.22 {dict map results (non-compiled)} { dict map {k v} [dict map {k v} {a 1 b 2 c 3 d 4} { list $v $k }] { return -level 0 "$k,$v" } } {a {a,1 a} b {b,2 b} c {c,3 c} d {d,4 d}} test dict-24.23 {dict map results (compiled)} { apply {{} { dict map {k v} [dict map {k v} {a 1 b 2 c 3 d 4} { list $v $k }] { return -level 0 "$k,$v" } }} } {a {a,1 a} b {b,2 b} c {c,3 c} d {d,4 d}} test dict-24.23a {dict map results (compiled)} { apply {{list} { dict map {k v} [dict map {k v} $list { list $v $k }] { return -level 0 "$k,$v" } }} {a 1 b 2 c 3 d 4} } {a {a,1 a} b {b,2 b} c {c,3 c} d {d,4 d}} test dict-24.24 {dict map with huge dict (non-compiled)} { tcl::mathop::+ {*}[dict map {k v} [lsearch -all [lrepeat 100000 x] x] { expr { $k * $v } }] } 166666666600000 test dict-24.25 {dict map with huge dict (compiled)} { apply {{n} { tcl::mathop::+ {*}[dict map {k v} [lsearch -all [lrepeat $n y] y] { expr { $k * $v } }] }} 100000 } 166666666600000 test dict-25.1 {compiled dict update with low-refcount values [Bug d553228d9f]} { # Test crashes on failure apply {{} { lassign {} item dict update item item item two two {} }} } {} set dict dict; # Used to force interpretation, not compilation test dict-26.1 {dict getdef command} -body { dict getdef {a b} a c } -result b test dict-26.2 {dict getdef command} -body { dict getdef {a b} b c } -result c test dict-26.3 {dict getdef command} -body { dict getdef {a {b c}} a b d } -result c test dict-26.4 {dict getdef command} -body { dict getdef {a {b c}} a c d } -result d test dict-26.5 {dict getdef command} -body { dict getdef {a {b c}} b c d } -result d test dict-26.6 {dict getdef command} -returnCodes error -body { dict getdef {a {b c d}} a b d } -result {missing value to go with key} test dict-26.7 {dict getdef command} -returnCodes error -body { dict getdef } -result {wrong # args: should be "dict getdef dictionary ?key ...? key default"} test dict-26.8 {dict getdef command} -returnCodes error -body { dict getdef {} } -result {wrong # args: should be "dict getdef dictionary ?key ...? key default"} test dict-26.9 {dict getdef command} -returnCodes error -body { dict getdef {} {} } -result {wrong # args: should be "dict getdef dictionary ?key ...? key default"} test dict-26.10 {dict getdef command} -returnCodes error -body { dict getdef {a b c} d e } -result {missing value to go with key} test dict-26.11 {dict getdef command} -body { $dict getdef {a b} a c } -result b test dict-26.12 {dict getdef command} -body { $dict getdef {a b} b c } -result c test dict-26.13 {dict getdef command} -body { $dict getdef {a {b c}} a b d } -result c test dict-26.14 {dict getdef command} -body { $dict getdef {a {b c}} a c d } -result d test dict-26.15 {dict getdef command} -body { $dict getdef {a {b c}} b c d } -result d test dict-26.16 {dict getdef command} -returnCodes error -body { $dict getdef {a {b c d}} a b d } -result {missing value to go with key} test dict-26.17 {dict getdef command} -returnCodes error -body { $dict getdef {a b c} d e } -result {missing value to go with key} test dict-27.1 {dict getwithdefault command} -body { dict getwithdefault {a b} a c } -result b test dict-27.2 {dict getwithdefault command} -body { dict getwithdefault {a b} b c } -result c test dict-27.3 {dict getwithdefault command} -body { dict getwithdefault {a {b c}} a b d } -result c test dict-27.4 {dict getwithdefault command} -body { dict getwithdefault {a {b c}} a c d } -result d test dict-27.5 {dict getwithdefault command} -body { dict getwithdefault {a {b c}} b c d } -result d test dict-27.6 {dict getwithdefault command} -returnCodes error -body { dict getwithdefault {a {b c d}} a b d } -result {missing value to go with key} test dict-27.7 {dict getwithdefault command} -returnCodes error -body { dict getwithdefault } -result {wrong # args: should be "dict getwithdefault dictionary ?key ...? key default"} test dict-27.8 {dict getwithdefault command} -returnCodes error -body { dict getwithdefault {} } -result {wrong # args: should be "dict getwithdefault dictionary ?key ...? key default"} test dict-27.9 {dict getwithdefault command} -returnCodes error -body { dict getwithdefault {} {} } -result {wrong # args: should be "dict getwithdefault dictionary ?key ...? key default"} test dict-27.10 {dict getdef command} -returnCodes error -body { dict getwithdefault {a b c} d e } -result {missing value to go with key} test dict-27.11 {dict getwithdefault command} -body { $dict getwithdefault {a b} a c } -result b test dict-27.12 {dict getwithdefault command} -body { $dict getwithdefault {a b} b c } -result c test dict-27.13 {dict getwithdefault command} -body { $dict getwithdefault {a {b c}} a b d } -result c test dict-27.14 {dict getwithdefault command} -body { $dict getwithdefault {a {b c}} a c d } -result d test dict-27.15 {dict getwithdefault command} -body { $dict getwithdefault {a {b c}} b c d } -result d test dict-27.16 {dict getwithdefault command} -returnCodes error -body { $dict getwithdefault {a {b c d}} a b d } -result {missing value to go with key} test dict-27.17 {dict getdef command} -returnCodes error -body { $dict getwithdefault {a b c} d e } -result {missing value to go with key} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/dcall.test0000644000175000017500000000257215104661341014677 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for Tcl_CallWhenDeleted. # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testdcall [llength [info commands testdcall]] test dcall-1.1 {deletion callbacks} testdcall { lsort -increasing [testdcall 1 2 3] } {1 2 3} test dcall-1.2 {deletion callbacks} testdcall { testdcall } {} test dcall-1.3 {deletion callbacks} testdcall { lsort -increasing [testdcall 20 21 22 -22] } {20 21} test dcall-1.4 {deletion callbacks} testdcall { lsort -increasing [testdcall 20 21 22 -20] } {21 22} test dcall-1.5 {deletion callbacks} testdcall { lsort -increasing [testdcall 20 21 22 -21] } {20 22} test dcall-1.6 {deletion callbacks} testdcall { lsort -increasing [testdcall 20 21 22 -21 -22 -20] } {} # cleanup cleanupTests return tcl9.0.3/tests/coroutine.test0000644000175000017500000006711315104661341015631 0ustar sergeisergei# Commands covered: coroutine, yield, yieldto, [info coroutine] # # This file contains a collection of tests for experimental commands that are # found in ::tcl::unsupported. The tests will migrate to normal test files # if/when the commands find their way into the core. # # Copyright © 2008 Miguel Sofer. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testnrelevels [llength [info commands testnrelevels]] testConstraint memory [llength [info commands memory]] set lambda [list {{start 0} {stop 10}} { # init set i $start set imax $stop yield while {$i < $imax} { yield [expr {$i*$stop}] incr i } }] test coroutine-1.1 {coroutine basic} -setup { coroutine foo ::apply $lambda set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [foo] } set res } -cleanup { rename foo {} unset res } -result {0 10 20} test coroutine-1.2 {coroutine basic} -setup { coroutine foo ::apply $lambda 2 8 set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [foo] } set res } -cleanup { rename foo {} unset res } -result {16 24 32} test coroutine-1.3 {yield returns new arg} -setup { set body { # init set i $start set imax $stop yield while {$i < $imax} { set stop [yield [expr {$i*$stop}]] incr i } } coroutine foo ::apply [list {{start 2} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [foo $k] } set res } -cleanup { rename foo {} unset res } -result {20 6 12} test coroutine-1.4 {yield in nested proc} -setup { proc moo {} { upvar 1 i i stop stop yield [expr {$i*$stop}] } set body { # init set i $start set imax $stop yield while {$i < $imax} { moo incr i } } coroutine foo ::apply [list {{start 0} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [foo $k] } set res } -cleanup { rename foo {} rename moo {} unset body res } -result {0 10 20} test coroutine-1.5 {just yield} -body { coroutine foo yield list [foo] [catch foo msg] $msg } -cleanup { unset msg } -result {{} 1 {invalid command name "foo"}} test coroutine-1.6 {just yield} -body { coroutine foo [list yield] list [foo] [catch foo msg] $msg } -cleanup { unset msg } -result {{} 1 {invalid command name "foo"}} test coroutine-1.7 {yield in nested uplevel} -setup { set body { # init set i $start set imax $stop yield while {$i < $imax} { uplevel 0 [list yield [expr {$i*$stop}]] incr i } } coroutine foo ::apply [list {{start 0} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [eval foo $k] } set res } -cleanup { rename foo {} unset body res } -result {0 10 20} test coroutine-1.8 {yield in nested uplevel} -setup { set body { # init set i $start set imax $stop yield while {$i < $imax} { uplevel 0 yield [expr {$i*$stop}] incr i } } coroutine foo ::apply [list {{start 0} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [eval foo $k] } set res } -cleanup { rename foo {} unset body res } -result {0 10 20} test coroutine-1.9 {yield in nested eval} -setup { proc moo {} { upvar 1 i i stop stop yield [expr {$i*$stop}] } set body { # init set i $start set imax $stop yield while {$i < $imax} { eval moo incr i } } coroutine foo ::apply [list {{start 0} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [foo $k] } set res } -cleanup { rename moo {} unset body res } -result {0 10 20} test coroutine-1.10 {yield in nested eval} -setup { set body { # init set i $start set imax $stop yield while {$i < $imax} { eval yield [expr {$i*$stop}] incr i } } coroutine foo ::apply [list {{start 0} {stop 10}} $body] set res {} } -body { for {set k 1} {$k < 4} {incr k} { lappend res [eval foo $k] } set res } -cleanup { unset body res } -result {0 10 20} test coroutine-1.11 {yield outside coroutine} -setup { proc moo {} { upvar 1 i i stop stop yield [expr {$i*$stop}] } } -body { variable i 5 stop 6 moo } -cleanup { rename moo {} unset i stop } -returnCodes error -result {yield can only be called in a coroutine} test coroutine-1.12 {proc as coroutine} -setup { set body { # init set i $start set imax $stop yield while {$i < $imax} { uplevel 0 [list yield [expr {$i*$stop}]] incr i } } proc moo {{start 0} {stop 10}} $body coroutine foo moo 2 8 } -body { list [foo] [foo] } -cleanup { unset body rename moo {} rename foo {} } -result {16 24} test coroutine-1.13 {subst as coroutine: literal} { list [coroutine foo eval {subst {>>[yield a],[yield b]<<}}] [foo x] [foo y] } {a b >>x,y<<} test coroutine-1.14 {subst as coroutine: in variable} { set pattern {>>[yield c],[yield d]<<} list [coroutine foo eval {subst $pattern}] [foo p] [foo q] } {c d >>p,q<<} test coroutine-2.1 {self deletion on return} -body { coroutine foo set x 3 foo } -returnCodes error -result {invalid command name "foo"} test coroutine-2.2 {self deletion on return} -body { coroutine foo ::apply [list {} {yield; yield 1; return 2}] list [foo] [foo] [catch foo msg] $msg } -result {1 2 1 {invalid command name "foo"}} test coroutine-2.3 {self deletion on error return} -body { coroutine foo ::apply [list {} {yield;yield 1; error ouch!}] list [foo] [catch foo msg] $msg [catch foo msg] $msg } -result {1 1 ouch! 1 {invalid command name "foo"}} test coroutine-2.4 {self deletion on other return} -body { coroutine foo ::apply [list {} {yield;yield 1; return -code 100 ouch!}] list [foo] [catch foo msg] $msg [catch foo msg] $msg } -result {1 100 ouch! 1 {invalid command name "foo"}} test coroutine-2.5 {deletion of suspended coroutine} -body { coroutine foo ::apply [list {} {yield; yield 1; return 2}] list [foo] [rename foo {}] [catch foo msg] $msg } -result {1 {} 1 {invalid command name "foo"}} test coroutine-2.6 {deletion of running coroutine} -body { coroutine foo ::apply [list {} {yield; rename foo {}; yield 1; return 2}] list [foo] [catch foo msg] $msg } -result {1 1 {invalid command name "foo"}} test coroutine-3.1 {info level computation} -setup { proc a {} {while 1 {yield [info level]}} proc b {} foo } -body { # note that coroutines execute in uplevel #0 set l0 [coroutine foo a] set l1 [foo] set l2 [b] list $l0 $l1 $l2 } -cleanup { rename a {} rename b {} } -result {1 1 1} test coroutine-3.2 {info frame computation} -setup { proc a {} {while 1 {yield [info frame]}} proc b {} foo } -body { set l0 [coroutine foo a] set l1 [foo] set l2 [b] expr {$l2 - $l1} } -cleanup { rename a {} rename b {} } -result 1 test coroutine-3.3 {info coroutine} -setup { proc a {} {info coroutine} proc b {} a } -body { b } -cleanup { rename a {} rename b {} } -result {} test coroutine-3.4 {info coroutine} -setup { proc a {} {info coroutine} proc b {} a } -body { coroutine foo b } -cleanup { rename a {} rename b {} } -result ::foo test coroutine-3.5 {info coroutine} -setup { proc a {} {info coroutine} proc b {} {rename [info coroutine] {}; a} } -body { coroutine foo b } -cleanup { rename a {} rename b {} } -result {} test coroutine-3.6 {info frame, bug #2910094} -setup { proc stack {} { set res [list "LEVEL:[set lev [info frame]]"] for {set i 1} {$i < $lev} {incr i} { lappend res [info frame $i] } set res # the precise command depends on line numbers and such, is likely not # to be stable: just check that the test completes! return } proc a {} stack } -body { coroutine aa a } -cleanup { rename stack {} rename a {} } -result {} test coroutine-3.7 {bug 0b874c344d} { dict get [coroutine X coroutine Y info frame 0] cmd } {coroutine X coroutine Y info frame 0} test coroutine-4.1 {bug #2093188} -setup { proc foo {} { set v 1 trace add variable v {write unset} bar yield set v 2 yield set v 3 } proc bar args {lappend ::res $args} coroutine a foo } -body { list [a] [a] $::res } -cleanup { rename foo {} rename bar {} unset ::res } -result {{} 3 {{v {} write} {v {} write} {v {} unset}}} test coroutine-4.2 {bug #2093188} -setup { proc foo {} { set v 1 trace add variable v {read unset} bar yield set v 2 set v yield set v 3 } proc bar args {lappend ::res $args} coroutine a foo } -body { list [a] [a] $::res } -cleanup { rename foo {} rename bar {} unset ::res } -result {{} 3 {{v {} read} {v {} unset}}} test coroutine-4.3 {bug #2093947} -setup { proc foo {} { set v 1 trace add variable v {write unset} bar yield set v 2 yield set v 3 } proc bar args {lappend ::res $args} } -body { coroutine a foo a a coroutine a foo a rename a {} set ::res } -cleanup { rename foo {} rename bar {} unset ::res } -result {{v {} write} {v {} write} {v {} unset} {v {} write} {v {} unset}} test coroutine-4.4 {bug #2917627: cmd resolution} -setup { proc a {} {return global} namespace eval b {proc a {} {return local}} } -body { namespace eval b {coroutine foo a} } -cleanup { rename a {} namespace delete b } -result local test coroutine-4.5 {bug #2724403} -constraints {memory} \ -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { set ns ::y$i namespace eval $ns {} proc ${ns}::start {} {yield; puts hello} coroutine ${ns}::run ${ns}::start namespace delete $ns set start $end set end [getbytes] } set leakedBytes [expr {$end - $start}] } -cleanup { rename getbytes {} unset i ns start end } -result 0 test coroutine-4.6 {compile context, bug #3282869} -setup { unset -nocomplain ::x proc f x { coroutine D eval {yield X$x;yield Y} } } -body { f 12 } -cleanup { rename f {} } -returnCodes error -match glob -result {can't read *} test coroutine-4.7 {compile context, bug #3282869} -setup { proc f x { coroutine D eval {yield X$x;yield Y$x} } } -body { set ::x 15 set ::x [f 12] D } -cleanup { D unset ::x rename f {} } -result YX15 test coroutine-5.1 {right numLevels on coro return} -constraints {testnrelevels} \ -setup { proc nestedYield {{val {}}} { yield $val } proc getNumLevel {} { # remove the level for this proc's call expr {[lindex [testnrelevels] 1] - 1} } proc relativeLevel base { # remove the level for this proc's call expr {[getNumLevel] - $base - 1} } proc foo {} { while 1 { nestedYield } } set res {} } -body { set base [getNumLevel] lappend res [relativeLevel $base] eval {coroutine a foo} # back to base level lappend res [relativeLevel $base] a lappend res [relativeLevel $base] eval a lappend res [relativeLevel $base] eval {eval a} lappend res [relativeLevel $base] rename a {} lappend res [relativeLevel $base] set res } -cleanup { rename foo {} rename nestedYield {} rename getNumLevel {} rename relativeLevel {} unset res } -result {0 0 0 0 0 0} test coroutine-5.2 {right numLevels within coro} -constraints {testnrelevels} \ -setup { proc nestedYield {{val {}}} { yield $val } proc getNumLevel {} { # remove the level for this proc's call expr {[lindex [testnrelevels] 1] - 1} } proc relativeLevel base { # remove the level for this proc's call expr {[getNumLevel] - $base - 1} } proc foo base { while 1 { set base [nestedYield [relativeLevel $base]] } } set res {} } -body { lappend res [eval {coroutine a foo [getNumLevel]}] lappend res [a [getNumLevel]] lappend res [eval {a [getNumLevel]}] lappend res [eval {eval {a [getNumLevel]}}] set base [lindex $res 0] foreach x $res[set res {}] { lappend res [expr {$x-$base}] } set res } -cleanup { rename a {} rename foo {} rename nestedYield {} rename getNumLevel {} rename relativeLevel {} unset res } -result {0 0 0 0} test coroutine-6.1 {coroutine nargs} -body { coroutine a ::apply $lambda a } -cleanup { rename a {} } -result 0 test coroutine-6.2 {coroutine nargs} -body { coroutine a ::apply $lambda a a } -cleanup { rename a {} } -result 0 test coroutine-6.3 {coroutine nargs} -body { coroutine a ::apply $lambda a a a } -cleanup { rename a {} } -returnCodes error -result {wrong # args: should be "a ?arg?"} test coroutine-7.1 {yieldto} -body { coroutine c apply {{} { yield yieldto return -level 0 -code 1 quux return quuy }} set res [list [catch c msg] $msg] lappend res [catch c msg] $msg lappend res [catch c msg] $msg } -cleanup { unset res } -result [list 1 quux 0 quuy 1 {invalid command name "c"}] test coroutine-7.2 {multi-argument yielding with yieldto} -body { proc corobody {} { set a 1 while 1 { set a [yield $a] set a [yieldto return -level 0 $a] lappend a [llength $a] } } coroutine a corobody coroutine b corobody list [a x] [a y z] [a \{p] [a \{q r] [a] [a] [rename a {}] \ [b ok] [rename b {}] } -cleanup { rename corobody {} } -result {x {y z 2} \{p {\{q r 2} {} 0 {} ok {}} test coroutine-7.3 {yielding between coroutines} -body { proc juggler {target {value ""}} { if {$value eq ""} { set value [yield [info coroutine]] } while {[llength $value]} { lappend ::result $value [info coroutine] set value [lrange $value 0 end-1] lassign [yieldto $target $value] value } # Clear nested collection of coroutines catch $target } set result "" coroutine j1 juggler [coroutine j2 juggler [coroutine j3 juggler j1]]\ {a b c d e} list $result [info command j1] [info command j2] [info command j3] } -cleanup { catch {rename juggler ""} } -result {{{a b c d e} ::j1 {a b c d} ::j2 {a b c} ::j3 {a b} ::j1 a ::j2} {} {} {}} test coroutine-7.4 {Bug 8ff0cb9fe1} -setup { proc foo {a b} {catch yield; return 1} } -cleanup { rename foo {} } -body { coroutine demo lsort -command foo {a b} } -result {b a} test coroutine-7.5 {return codes} { set result {} foreach code {0 1 2 3 4 5} { lappend result [catch {coroutine demo return -level 0 -code $code}] } set result } {0 1 2 3 4 5} test coroutine-7.6 {Early yield crashes} -setup { set i [interp create] } -body { # Force into a child interpreter [bug 60559fd4a6] $i eval { proc foo args {} trace add execution foo enter {catch yield} coroutine demo foo rename foo {} return ok } } -cleanup { interp delete $i } -result ok test coroutine-7.7 {Bug 2486550} -setup { set i [interp create] $i hide yield } -body { # Force into a child interpreter [bug 60559fd4a6] $i eval { coroutine demo interp invokehidden {} yield ok } } -cleanup { $i eval demo interp delete $i } -result ok test coroutine-7.8 {yieldto context nuke: Bug a90d9331bc} -setup { namespace eval cotest {} set ::result "" } -body { proc cotest::body {} { lappend ::result a yield OUT lappend ::result b yieldto ::return -level 0 123 lappend ::result c return } lappend ::result [coroutine cotest cotest::body] namespace delete cotest namespace eval cotest {} lappend ::result [cotest] cotest return $result } -returnCodes error -cleanup { catch {namespace delete ::cotest} catch {rename cotest ""} } -result {yieldto called in deleted namespace} test coroutine-7.9 {yieldto context nuke: Bug a90d9331bc} -setup { namespace eval cotest {} set ::result "" } -body { proc cotest::body {} { set y ::yieldto lappend ::result a yield OUT lappend ::result b $y ::return -level 0 123 lappend ::result c return } lappend ::result [coroutine cotest cotest::body] namespace delete cotest namespace eval cotest {} lappend ::result [cotest] cotest return $result } -returnCodes error -cleanup { catch {namespace delete ::cotest} catch {rename cotest ""} } -result {yieldto called in deleted namespace} test coroutine-7.10 {yieldto context nuke: Bug a90d9331bc} -setup { namespace eval cotest {} set ::result "" } -body { proc cotest::body {} { lappend ::result a yield OUT lappend ::result b yieldto ::return -level 0 -cotest [namespace delete ::cotest] 123 lappend ::result c return } lappend ::result [coroutine cotest cotest::body] lappend ::result [cotest] cotest return $result } -returnCodes error -cleanup { catch {namespace delete ::cotest} catch {rename cotest ""} } -result {yieldto called in deleted namespace} test coroutine-7.11 {yieldto context nuke: Bug a90d9331bc} -setup { namespace eval cotest {} set ::result "" } -body { proc cotest::body {} { set y ::yieldto lappend ::result a yield OUT lappend ::result b $y ::return -level 0 -cotest [namespace delete ::cotest] 123 lappend ::result c return } lappend ::result [coroutine cotest cotest::body] lappend ::result [cotest] cotest return $result } -returnCodes error -cleanup { catch {namespace delete ::cotest} catch {rename cotest ""} } -result {yieldto called in deleted namespace} test coroutine-7.12 {coro floor above street level #3008307} -body { proc c {} { yield } proc cc {} { coroutine C c } proc boom {} { cc ; # coro created at level 2 C ; # and called at level 1 } boom ; # does not crash: the coro floor is a good insulator list } -cleanup { rename boom {}; rename cc {}; rename c {} } -result {} test coroutine-7.13 { issue f9800d52bd61f240 vwait is not NRE-enabled, and yieldto cannot find the right splicing spot } -body { coroutine c0 apply [list {} { variable done yield yieldto c1 after 0 c2 vwait [namespace current]::done } [namespace current]] coroutine c1 apply [list {} { yield tailcall c0 } [namespace current]] coroutine c2 apply [list {} { variable done yield yieldto try {yieldto c1} on error {} [list after 0 [list [info coroutine]]] yieldto try {yieldto c1} on error {} [list after 0 [list [info coroutine]]] set done 1 } [namespace current]] after 0 [list [namespace which c0]] vwait [namespace current]::done return $done } -result 1 test coroutine-7.14 { issue 5106fddd4400e5b9 failure to yieldto is not the same thing as not calling yieldto in the first place } -body { variable done variable done1 coroutine c0 ::apply [list {} { yield after 0 [list [namespace which c1]] vwait [namespace current]::done1 } [namespace current]] coroutine c1 ::apply [list {} { variable done1 yield yieldto try "yieldto [list [info coroutine]]" on error {} " ::set [list [namespace current]]::done1 failure ::set [list [namespace current]]::done0 failure " set done1 success } [namespace current]] after 1 [list [namespace which c0]] vwait [namespace current]::done0 if {[namespace which [namespace current]::c1] ne {}} { # prior to the fix for 5106fddd4400e5b9, the nested yieldto turned into a # tailcall which was eventutally activated, causing control to return to # c1. After the fix, that doesn't happen, so if c1 still exists call it # one final time to allow it to finish and clean up rename c1 {} } return [list $done0 $done1] } -result {failure failure} test coroutine-8.1.1 {coro inject, ticket 42202ba1e5ff566e} -body { interp create child child eval { coroutine demo apply {{} { while {1} yield }} demo coroinject demo set ::result inject-executed } interp delete child } -result {} test coroutine-8.1.2 {coro inject with result, ticket 42202ba1e5ff566e} -body { interp create child child eval { coroutine demo apply {{} { while {1} yield }} demo coroinject demo lappend ::result inject-executed } child eval demo set result [child eval {set ::result}] interp delete child set result } -result {inject-executed yield {}} test coroutine-9.1 {coroprobe with yield} -body { coroutine demo apply {{} { foreach i {1 2} yield }} list [coroprobe demo set i] [demo] [coroprobe demo set i] [demo] } -cleanup { catch {rename demo {}} } -result {1 {} 2 {}} test coroutine-9.2 {coroprobe with yieldto} -body { coroutine demo apply {{} { lmap i {1 2} {yieldto string cat} }} list [coroprobe demo set i] [demo a b] [coroprobe demo set i] [demo c d] } -cleanup { catch {rename demo {}} } -result {1 {} 2 {{a b} {c d}}} test coroutine-9.3 {coroprobe errors} -setup { catch {rename demo {}} } -body { coroprobe demo set i } -returnCodes error -result {can only inject a probe command into a coroutine} test coroutine-9.4 {coroprobe errors} -body { proc demo {} { foreach i {1 2} yield } coroprobe demo set i } -returnCodes error -cleanup { catch {rename demo {}} } -result {can only inject a probe command into a coroutine} test coroutine-9.5 {coroprobe errors} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroprobe } -returnCodes error -cleanup { catch {rename demo {}} } -result {wrong # args: should be "coroprobe coroName cmd ?arg1 arg2 ...?"} test coroutine-9.6 {coroprobe errors} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroprobe demo } -returnCodes error -cleanup { catch {rename demo {}} } -result {wrong # args: should be "coroprobe coroName cmd ?arg1 arg2 ...?"} test coroutine-9.7 {coroprobe errors in probe command} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroprobe demo set } -returnCodes error -cleanup { catch {rename demo {}} } -result {wrong # args: should be "set varName ?newValue?"} test coroutine-9.8 {coroprobe errors in probe command} -body { coroutine demo apply {{} { foreach i {1 2} yield }} list [catch {coroprobe demo set}] [demo] [coroprobe demo set i] } -cleanup { catch {rename demo {}} } -result {1 {} 2} test coroutine-9.9 {coroprobe: advanced features} -setup { set i [interp create] } -body { $i eval { coroutine demo apply {{} { set f [info level],[info frame] foreach i {1 2} yield }} coroprobe demo apply {{} { upvar 1 f f list [info coroutine] [info level] [info frame] $f }} } } -cleanup { interp delete $i } -result {::demo 2 3 1,2} test coroutine-10.1 {coroinject with yield} -setup { set result {} } -body { coroutine demo apply {{} { lmap i {1 2} yield }} coroinject demo apply {{op val} {lappend ::result $op $val}} list $result [demo x] [demo y] $result } -cleanup { catch {rename demo {}} } -result {{} {} {{yield x} y} {yield x}} test coroutine-10.2 {coroinject stacking} -setup { set result {} } -body { coroutine demo apply {{} { lmap i {1 2} yield }} coroinject demo apply {{op val} {lappend ::result $op $val A;return $val}} coroinject demo apply {{op val} {lappend ::result $op $val B;return $val}} list $result [demo x] [demo y] $result } -cleanup { catch {rename demo {}} } -result {{} {} {x y} {yield x B yield x A}} test coroutine-10.3 {coroinject with yieldto} -setup { set result {} } -body { coroutine demo apply {{} { lmap i {1 2} {yieldto string cat} }} coroinject demo apply {{op val} {lappend ::result $op $val;return $val}} list $result [demo x mp] [demo y le] $result } -cleanup { catch {rename demo {}} } -result {{} {} {{x mp} {y le}} {yieldto {x mp}}} test coroutine-10.4 {coroinject errors} -setup { catch {rename demo {}} } -body { coroinject demo set i } -returnCodes error -result {can only inject a command into a coroutine} test coroutine-10.5 {coroinject errors} -body { proc demo {} { foreach i {1 2} yield } coroinject demo set i } -returnCodes error -cleanup { catch {rename demo {}} } -result {can only inject a command into a coroutine} test coroutine-10.6 {coroinject errors} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroinject } -returnCodes error -cleanup { catch {rename demo {}} } -result {wrong # args: should be "coroinject coroName cmd ?arg1 arg2 ...?"} test coroutine-10.7 {coroinject errors} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroinject demo } -returnCodes error -cleanup { catch {rename demo {}} } -result {wrong # args: should be "coroinject coroName cmd ?arg1 arg2 ...?"} test coroutine-10.8 {coroinject errors in injected command} -body { coroutine demo apply {{} { foreach i {1 2} yield }} coroinject demo apply {args {error "ERR: $args"}} list [catch demo msg] $msg [catch demo msg] $msg } -cleanup { catch {rename demo {}} } -result {1 {ERR: yield {}} 1 {invalid command name "demo"}} test coroutine-10.9 {coroinject: advanced features} -setup { set i [interp create] } -body { $i eval { coroutine demo apply {{} { set l [info level] set f [info frame] lmap i {1 2} yield }} coroinject demo apply {{arg op val} { global result upvar 1 f f l l lappend result [info coroutine] $arg $op $val lappend result [info level] $l [info frame] $f lappend result [yield $arg] return [string toupper $val] }} grill list [demo ABC] [demo pqr] [demo def] $result } } -cleanup { interp delete $i } -result {grill {} {ABC def} {::demo grill yield ABC 2 1 3 2 pqr}} test coroutine-11.1 {coro type} { coroutine demo eval { yield yield "PHASE 1" yieldto string cat "PHASE 2" ::tcl::unsupported::corotype [info coroutine] } list [demo] [::tcl::unsupported::corotype demo] \ [demo] [::tcl::unsupported::corotype demo] [demo] } {{PHASE 1} yield {PHASE 2} yieldto active} test coroutine-11.2 {coro type} -setup { catch {rename nosuchcommand ""} } -returnCodes error -body { ::tcl::unsupported::corotype nosuchcommand } -result {can only get coroutine type of a coroutine} test coroutine-11.3 {coro type} -returnCodes error -body { proc notacoroutine {} {} ::tcl::unsupported::corotype notacoroutine } -returnCodes error -cleanup { rename notacoroutine {} } -result {can only get coroutine type of a coroutine} test coroutine-12.1 {coroutine general introspection} -setup { set i [interp create] } -body { $i eval { # Make the introspection code namespace path tcl::unsupported proc probe {var type args} { upvar 1 $var v set f [info frame] incr f -1 set result [list $v [dict get [info frame $f] proc]] if {$type eq "yield"} { tailcall yield $result } else { tailcall yieldto string cat $result } } proc pokecoro {c var} { coroinject $c probe $var $c } # Coroutine implementations proc cbody1 {} { set val [info coroutine] set accum {} while {[set val [yield $val]] ne ""} { lappend accum $val set val ok } return $accum } proc cbody2 {} { set val [info coroutine] set accum {} while {[llength [set val [yieldto string cat $val]]]} { lappend accum {*}$val set val ok } return $accum } # Make the coroutines coroutine c1 cbody1 coroutine c2 cbody2 list [c1 abc] [c2 1 2 3] [pokecoro c1 accum] [pokecoro c2 accum] \ [c1 def] [c2 4 5 6] [pokecoro c1 accum] [pokecoro c2 accum] \ [c1] [c2] } } -cleanup { interp delete $i } -result {ok ok {abc ::cbody1} {{1 2 3} ::cbody2} ok ok {{abc def} ::cbody1} {{1 2 3 4 5 6} ::cbody2} {abc def} {1 2 3 4 5 6}} # cleanup unset lambda ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/config.test0000644000175000017500000000420515104661341015060 0ustar sergeisergei# -*- tcl -*- # Commands covered: pkgconfig # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test pkgconfig-1.1 {query keys} -body { lsort [::tcl::pkgconfig list] } -match glob -result {*bindir,install bindir,runtime*docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime*scriptdir,install scriptdir,runtime*} test pkgconfig-1.2 {query keys multiple times} { string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list] } 0 test pkgconfig-1.3 {query value multiple times} { string compare \ [::tcl::pkgconfig get bindir,install] \ [::tcl::pkgconfig get bindir,install] } 0 test pkgconfig-2.0 {error: missing subcommand} { catch {::tcl::pkgconfig} msg set msg } {wrong # args: should be "::tcl::pkgconfig subcommand ?arg?"} test pkgconfig-2.1 {error: illegal subcommand} { catch {::tcl::pkgconfig foo} msg set msg } {bad subcommand "foo": must be get or list} test pkgconfig-2.2 {error: list with arguments} { catch {::tcl::pkgconfig list foo} msg set msg } {wrong # args: should be "::tcl::pkgconfig list"} test pkgconfig-2.3 {error: get without arguments} { catch {::tcl::pkgconfig get} msg set msg } {wrong # args: should be "::tcl::pkgconfig get key"} test pkgconfig-2.4 {error: query unknown key} { catch {::tcl::pkgconfig get foo} msg set msg } {key not known} test pkgconfig-2.5 {error: query with to many arguments} { catch {::tcl::pkgconfig get foo bar} msg set msg } {wrong # args: should be "::tcl::pkgconfig subcommand ?arg?"} # cleanup ::tcltest::cleanupTests return tcl9.0.3/tests/concat.test0000644000175000017500000000306515104661341015065 0ustar sergeisergei# Commands covered: concat # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } test concat-1.1 {simple concatenation} { concat a b c d e f g } {a b c d e f g} test concat-1.2 {merging lists together} { concat a {b c d} {e f g h} } {a b c d e f g h} test concat-1.3 {merge lists, retain sub-lists} { concat a {b {c d}} {{e f}} g h } {a b {c d} {e f} g h} test concat-1.4 {special characters} { concat a\{ {b \{c d} \{d } "a{ b \\{c d {d" test concat-2.1 {error: one empty argument} { concat {} } {} test concat-3.1 {error: no arguments} { list [catch concat msg] $msg } {0 {}} test concat-4.1 {pruning off extra white space} { concat {} {a b c} } {a b c} test concat-4.2 {pruning off extra white space} { concat x y " a b c \n\t " " " " def " } {x y a b c def} test concat-4.3 {pruning off extra white space sets length correctly} { llength [concat { {{a}} }] } 1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/compile.test0000644000175000017500000011506115104661341015246 0ustar sergeisergei# This file contains tests for the files tclCompile.c, tclCompCmds.c and # tclLiteral.c # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint exec [llength [info commands exec]] testConstraint memory [llength [info commands memory]] testConstraint testevalex [llength [info commands testevalex]] # The following tests are very incomplete, although the rest of the # test suite covers this file fairly well. catch {rename p ""} catch {namespace delete test_ns_compile} catch {unset x} catch {unset y} catch {unset a} test compile-1.1 {TclCompileString: look up cmds in proc ns, not current ns} -setup { catch {namespace delete test_ns_compile} catch {unset x} } -body { set x 123 namespace eval test_ns_compile { proc set {args} { global x lappend x test_ns_compile::set } proc p {} { set 0 } } list [test_ns_compile::p] [set x] } -result {{123 test_ns_compile::set} {123 test_ns_compile::set}} test compile-1.2 {TclCompileString, error result is reset if TclGetLong determines word isn't an integer} { proc p {x} {info commands 3m} list [catch {p} msg] $msg } {1 {wrong # args: should be "p x"}} test compile-2.1 {TclCompileDollarVar: global scalar name with ::s} -setup { catch {unset x} } -body { set x 123 list $::x [expr {"x" in [info globals]}] } -result {123 1} test compile-2.2 {TclCompileDollarVar: global scalar name with ::s} -setup { catch {unset y} } -body { proc p {} { set ::y 789 return $::y } list [p] $::y [expr {"y" in [info globals]}] } -result {789 789 1} test compile-2.3 {TclCompileDollarVar: global array name with ::s} -setup { catch {unset a} } -body { set ::a(1) 2 list $::a(1) [set ::a($::a(1)) 3] $::a(2) [expr {"a" in [info globals]}] } -result {2 3 3 1} test compile-2.4 {TclCompileDollarVar: global scalar name with ::s} -setup { catch {unset a} } -body { proc p {} { set ::a(1) 1 return $::a($::a(1)) } list [p] $::a(1) [expr {"a" in [info globals]}] } -result {1 1 1} test compile-2.5 {TclCompileDollarVar: global array, called as ${arrName(0)}} -setup { catch {unset a} } -body { proc p {} { global a set a(1) 1 return ${a(1)}$::a(1)$a(1) } list [p] $::a(1) [expr {"a" in [info globals]}] } -result {111 1 1} test compile-3.1 {TclCompileCatchCmd: only catch cmds with scalar vars are compiled inline} -setup { catch {unset a} } -body { set a(1) xyzzyx proc p {} { global a catch {set x 123} a(1) } list [p] $a(1) } -result {0 123} test compile-3.2 {TclCompileCatchCmd: non-local variables} { set ::foo 1 proc catch-test {} { catch {set x 3} ::foo } catch-test return $::foo } 3 test compile-3.3 {TclCompileCatchCmd: overagressive compiling [bug 219184]} { proc catch-test {str} { catch [eval $str GOOD] error BAD } catch {catch-test error} ::foo return $::foo } {GOOD} test compile-3.4 {TclCompileCatchCmd: bcc'ed [return] is caught} { proc foo {} { set fail [catch { return 1 }] ; # {} return 2 } foo } {2} test compile-3.5 {TclCompileCatchCmd: recover from error, [Bug 705406]} { proc foo {} { catch { if {[a]} { if b {} } } } list [catch foo msg] $msg } {0 1} test compile-3.6 {TclCompileCatchCmd: error in storing result [Bug 3098302]} {*}{ -setup { namespace eval catchtest { variable result1 {} } trace add variable catchtest::result1 write catchtest::failtrace proc catchtest::failtrace {n1 n2 op} { return -code error "trace on $n1 fails by request" } } -body { proc catchtest::x {} { variable result1 set count 0 for {set i 0} {$i < 10} {incr i} { set status2 [catch { set status1 [catch { return -code error -level 0 "original failure" } result1 options1] } result2 options2] incr count } list $count $result2 } catchtest::x } -result {10 {can't set "result1": trace on result1 fails by request}} -cleanup {namespace delete catchtest} } test compile-3.7 {TclCompileCatchCmd: error in storing options [Bug 3098302]} {*}{ -setup { namespace eval catchtest { variable options1 {} } trace add variable catchtest::options1 write catchtest::failtrace proc catchtest::failtrace {n1 n2 op} { return -code error "trace on $n1 fails by request" } } -body { proc catchtest::x {} { variable options1 set count 0 for {set i 0} {$i < 10} {incr i} { set status2 [catch { set status1 [catch { return -code error -level 0 "original failure" } result1 options1] } result2 options2] incr count } list $count $result2 } catchtest::x } -result {10 {can't set "options1": trace on options1 fails by request}} -cleanup {namespace delete catchtest} } test compile-4.1 {TclCompileForCmd: command substituted test expression} { set i 0 set j 0 # Should be "forever" for {} [expr {$i < 3}] {} { set j [incr i] if {$j > 3} break } set j } {4} test compile-5.1 {TclCompileForeachCmd: exception stack} { proc foreach-exception-test {} { foreach array(index) [list 1 2 3] break foreach array(index) [list 1 2 3] break foreach scalar [list 1 2 3] break } list [catch foreach-exception-test result] $result } {0 {}} test compile-5.2 {TclCompileForeachCmd: non-local variables} { set ::foo 1 proc foreach-test {} { foreach ::foo {1 2 3} {} } foreach-test set ::foo } 3 test compile-5.3 {TclCompileForeachCmd: [Bug b9b2079e6d]} -setup { proc demo {} { foreach x y { if 1 break else } } } -body { demo } -cleanup { rename demo {} } -returnCodes error -result {wrong # args: no script following "else" argument} test compile-6.1 {TclCompileSetCmd: global scalar names with ::s} -setup { catch {unset x} catch {unset y} } -body { set x 123 proc p {} { set ::y 789 return $::y } list $::x [expr {"x" in [info globals]}] \ [p] $::y [expr {"y" in [info globals]}] } -result {123 1 789 789 1} test compile-6.2 {TclCompileSetCmd: global array names with ::s} -setup { catch {unset a} } -body { set ::a(1) 2 proc p {} { set ::a(1) 1 return $::a($::a(1)) } list $::a(1) [p] [set ::a($::a(1)) 3] $::a(1) [expr {"a" in [info globals]}] } -result {2 1 3 3 1} test compile-6.3 {TclCompileSetCmd: namespace var names with ::s} -setup { catch {namespace delete test_ns_compile} catch {unset x} } -body { namespace eval test_ns_compile { variable v hello variable arr set ::x $::test_ns_compile::v set ::test_ns_compile::arr(1) 123 } list $::x $::test_ns_compile::arr(1) } -result {hello 123} test compile-7.1 {TclCompileWhileCmd: command substituted test expression} { set i 0 set j 0 # Should be "forever" while [expr {$i < 3}] { set j [incr i] if {$j > 3} break } set j } {4} test compile-8.1 {CollectArgInfo: binary data} { list [catch "string length \x00foo" msg] $msg } {0 4} test compile-8.2 {CollectArgInfo: binary data} { list [catch "string length foo\x00" msg] $msg } {0 4} test compile-8.3 {CollectArgInfo: handle "]" at end of command properly} { set x ] } {]} test compile-9.1 {UpdateStringOfByteCode: called for duplicate of compiled empty object} { proc p {} { set x {} eval $x append x { } eval $x } p } {} test compile-10.1 {BLACKBOX: exception stack overflow} { set x {{0}} set y 0 while {$y < 100} { if !$x {incr y} } } {} test compile-11.1 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { # shared object - Interp result && Var 'r' set r [list foobar] # command that will add error to result lindex a bogus }} } -returnCodes error -result {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?} test compile-11.2 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; string index a bogus }} } -returnCodes error -result {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?} test compile-11.3 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; string index a 0o9 }} } -returnCodes error -match glob -result {*} test compile-11.4 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; array set var {one two many} }} } -returnCodes error -result {list must have an even number of elements} test compile-11.5 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; incr foo bar baz}} } -returnCodes error -result {wrong # args: should be "incr varName ?increment?"} test compile-11.6 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; incr}} } -returnCodes error -result {wrong # args: should be "incr varName ?increment?"} test compile-11.7 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; expr [concat !a] }} } -returnCodes error -match glob -result * test compile-11.8 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; expr {!a} }} } -returnCodes error -match glob -result * test compile-11.9 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; llength "\{" }} list [catch {p} msg] $msg } -returnCodes error -result {unmatched open brace in list} # # Special section for tests of tclLiteral.c # The following tests check for incorrect memory handling in # TclReleaseLiteral. They are only effective when tcl is compiled with # TCL_MEM_DEBUG # # Special test for leak on interp delete [Bug 467523]. test compile-12.1 {testing literal leak on interp delete} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { interp create foo foo eval { namespace eval bar {} } interp delete foo set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i tmp leakedBytes } -result 0 # Special test for a memory error in a preliminary fix of [Bug 467523]. It # requires executing a helpfile. Presumably the child process is used because # when this test fails, it crashes. test compile-12.2 {testing error on literal deletion} -constraints {memory exec} -body { set sourceFile [makeFile { for {set i 0} {$i < 5} {incr i} { namespace eval bar {} namespace delete bar } puts 0 } source.file] exec [interpreter] $sourceFile } -cleanup { catch {removeFile $sourceFile} } -result 0 # Test to catch buffer overrun in TclCompileTokens from buf 530320 test compile-12.3 {check for a buffer overrun} -body { proc crash {} { puts $array([expr {a+2}]) } crash } -returnCodes error -cleanup { rename crash {} } -match glob -result * test compile-12.4 {TclCleanupLiteralTable segfault} -body { # Tcl Bug 1001997 # Here, we're trying to test a case that causes a crash in # TclCleanupLiteralTable. The conditions that we're trying to establish # are: # - TclCleanupLiteralTable is attempting to clean up a bytecode object in # the literal table. # - The bytecode object in question contains the only reference to another # literal. # - The literal in question is in the same hash bucket as the bytecode # object, and immediately follows it in the chain. # Since newly registered literals are added at the FRONT of the bucket # chains, and since the bytecode object is registered before its literals, # this is difficult to achieve. What we do is: # (a) do a [namespace eval] of a string that's calculated to hash into # the same bucket as a literal that it contains. In this case, the # script and the variable 'bugbug' land in the same bucket. # (b) do a [namespace eval] of a string that contains enough literals to # force TclRegisterLiteral to rebuild the global literal table. The # newly created hash buckets will contain the literals, IN REVERSE # ORDER, thus putting the bytecode immediately ahead of 'bugbug' and # 'bug4345bug'. The bytecode object will contain the only references # to those two literals. # (c) Delete the interpreter to invoke TclCleanupLiteralTable and tickle # the bug. proc foo {} { set i [interp create] $i eval { namespace eval ::w {concat 4649; variable bugbug} namespace eval ::w { concat x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 \ x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 \ x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 \ x31 x32 X33 X34 X35 X36 X37 X38 X39 X40 \ x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 \ x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 \ x61 x62 x63 x64 concat y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 \ y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 \ y21 y22 y23 y24 y25 y26 y27 y28 y29 y30 \ y31 y32 Y33 Y34 Y35 Y36 Y37 Y38 Y39 Y40 \ y41 y42 y43 y44 y45 y46 y47 y48 y49 y50 \ y51 y52 y53 y54 y55 y56 y57 y58 y59 y60 \ y61 y62 y63 y64 concat z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 \ z11 z12 z13 z14 z15 z16 z17 z18 z19 z20 \ z21 z22 z23 z24 z25 z26 z27 z28 z29 z30 \ z31 z32 } } interp delete $i; # must not crash return ok } foo } -cleanup { rename foo {} } -result ok # Special test for underestimating the maxStackSize required for a compiled # command. A failure will cause a segfault in the child process. test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} { set body {set x [list} for {set i 0} {$i < 3000} {incr i} { append body " $i" } append body {]; puts OK} regsub BODY {proc crash {} {BODY}; crash} $body script list [catch {exec [interpreter] << $script} msg] $msg } {0 OK} # Tests of nested compile (body in body compilation), should not generate stack overflow # (with abnormal program termination), bug [fec0c17d39]: proc _ti_gencode {} { # creates test interpreter on demand with [gencode] generator: if {[interp exists ti]} { return } interp create ti ti eval {proc gencode {nr {cmd eval} {nl 0}} { set code "" set e ""; if {$nl} {set e "\n"} for {set i 0} {$i < $nr} {incr i} { append code "$cmd \{$e" } append code "lappend result 1$e" for {set i 0} {$i < $nr} {incr i} { append code "\}$e" } #puts [format "%% %.40s ... %d bytes" $code [string length $code]] return $code }} } test compile-13.2 {TclCompileScript: testing expected nested scripts compilation} -setup { # dynamic constraint - ensure the stack is large enough on this box for this test: if { [testConstraint unix] && ![catch { exec sh -c {ulimit -s} } stsz] && $stsz ne "unlimited" && $stsz <= 2048 } { tcltest::Skip "too small stack limit ($stsz <= 2048)" } _ti_gencode interp recursionlimit ti [expr {10000+50}] ti eval {set result {}} } -body { # Test different compilation variants (instructions evalStk, invokeStk, etc), # with 1500 (1000 in debug) nested scripts (bodies). If you get SO/SF exceptions on some low-stack # boxes or systems, please don't decrease it (either provide new or extend a constraint above) ti eval {foreach cmd {eval "if 1" try catch} { set c [gencode [expr {[tcl::build-info debug] ? 1500 : 1000}] $cmd] if 1 $c }} ti eval {set result} } -result {1 1 1 1} test compile-13.3 {TclCompileScript: testing check of max depth by nested scripts compilation} -setup { _ti_gencode interp recursionlimit ti 100 ti eval {set result {}} } -body { # Test different compilation variants (instructions evalStk, invokeStk, etc), # with 500 nested scripts (bodies). It must generate "too many nested compilations" # error for any variant we're testing here: ti eval {foreach cmd {eval "if 1" try catch} { set c [gencode 500 $cmd] lappend errors [catch $c e] $e }} #puts $errors # all of nested calls exceed the limit, so must end with "too many nested compilations" # (or evaluations, depending on compile method/instruction and "mixed" compile within # evaluation), so no one succeeds, the result must be empty: ti eval {set result} } -result {} # # clean up: if {[interp exists ti]} { interp delete ti } rename _ti_gencode {} # Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342] test compile-14.1 {testing errors in element name; segfault?} {} { catch {set a([error])} msg1 catch {set bubba([join $abba $jubba]) $vol} msg2 list $msg1 $msg2 } {{wrong # args: should be "error message ?errorInfo? ?errorCode?"} {can't read "abba": no such variable}} test compile-14.2 {testing element name "$"} -body { unset -nocomplain a set a() 1 set a(1) 2 set a($) 3 list [set a()] [set a(1)] [set a($)] [unset a() a(1); lindex [array names a] 0] } -cleanup {unset a} -result [list 1 2 3 {$}] # Tests compile-15.* cover Tcl Bug 633204 test compile-15.1 {proper TCL_RETURN code from [return]} { apply {{} {catch return}} } 2 test compile-15.2 {proper TCL_RETURN code from [return]} { apply {{} {catch {return foo}}} } 2 test compile-15.3 {proper TCL_RETURN code from [return]} { apply {{} {catch {return $::tcl_library}}} } 2 test compile-15.4 {proper TCL_RETURN code from [return]} { apply {{} {catch {return [info library]}}} } 2 test compile-15.5 {proper TCL_RETURN code from [return]} { apply {{} {catch {set a 1}; return}} } "" # Do all tests once byte compiled and once with direct string evaluation foreach noComp {0 1} { if {$noComp} { interp alias {} run {} testevalex set constraints testevalex } else { interp alias {} run {} if 1 set constraints {} } test compile-16.1.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 255]" } [lrepeat 255 a] test compile-16.2.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 256]" } [lrepeat 256 a] test compile-16.3.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 257]" } [lrepeat 257 a] test compile-16.4.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list} } {} test compile-16.5.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}{x y z}} } {x y z} test compile-16.6.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}[list x y z]} } {x y z} test compile-16.7.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}[list x y z][list x y z]} } {x y zx y z} test compile-16.8.$noComp {TclCompileScript: word expansion} -body { set l {x y z} run {{*}list {*}$l} } -constraints $constraints -cleanup { unset l } -result {x y z} test compile-16.9.$noComp {TclCompileScript: word expansion} -body { set l {x y z} run {{*}list {*}$l$l} } -constraints $constraints -cleanup { unset l } -result {x y zx y z} test compile-16.10.$noComp {TclCompileScript: word expansion} -body { run {{*}\{} } -constraints $constraints -returnCodes error \ -result {unmatched open brace in list} test compile-16.11.$noComp {TclCompileScript: word expansion} -body { proc badList {} {return \{} run {{*}[badList]} } -constraints $constraints -cleanup { rename badList {} } -returnCodes error -result {unmatched open brace in list} test compile-16.12.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x y z} } {x y z} test compile-16.13.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x y {*}z} } {x y z} test compile-16.14.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x {*}y z} } {x y z} test compile-16.15.$noComp {TclCompileScript: word expansion} $constraints { run {list x y {*}z} } {x y z} test compile-16.16.$noComp {TclCompileScript: word expansion} $constraints { run {list x {*}y z} } {x y z} test compile-16.17.$noComp {TclCompileScript: word expansion} $constraints { run {list {*}x y z} } {x y z} # These tests note that expansion can in theory cause the number of arguments # to a command to exceed INT_MAX, which is as big as objc is allowed to get. # # In practice, it seems we will run out of memory before we confront this # issue. Note that compiled operations run out of memory at smaller objc # values than direct string evaluation. # # These tests are constrained as knownBug because they are likely to cause # memory allocation panics somewhere, and we don't want panics in the test # suite. # test compile-16.18.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<10}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<10}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -result [expr {1<<20}] test compile-16.19.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<11}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<11}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -result [expr {1<<22}] test compile-16.20.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<12}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<12}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -result [expr {1<<24}] # This is the one that should cause overflow test compile-16.21.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<16}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<16}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -result [expr {wide(1)<<32}] test compile-16.22.$noComp { Bug 845412: TclCompileScript: word expansion not mandatory } -body { # This test may crash and will fail unless Bug 845412 is fixed. proc ReturnResults args {return $args} run "ReturnResults [string repeat {x } 260]" } -constraints $constraints -cleanup { rename ReturnResults {} } -result [string trim [string repeat {x } 260]] test compile-16.23.$noComp { Bug 1032805: defer parse error until run time } -constraints $constraints -body { namespace eval x { run { proc if {a b} {uplevel 1 [list set $a $b]} if 1 {syntax {}{}} } } } -cleanup { namespace delete x } -result {syntax {}{}} test compile-16.24.$noComp { Bug 1638414: bad list constant as first expanded term } -constraints $constraints -body { run "{*}\"\{foo bar\"" } -returnCodes error -result {unmatched open brace in list} test compile-16.25.$noComp {TclCompileScript: word expansion, naked backslashes} $constraints { run {list {*}{a \n b}} } {a { } b} test compile-16.26.$noComp {TclCompileScript: word expansion, protected backslashes} $constraints { run {list {*}{a {\n} b}} } {a {\n} b} } ;# End of noComp loop # These tests are messy because it wrecks the interpreter it runs in! They # demonstrate issues arising from [FRQ 1101710] test compile-17.1 {Command interpretation binding for compiled code} -constraints knownBug -setup { set i [interp create] } -body { $i eval { if 1 { expr [ proc expr args {return substituted} format {[subst compiled]} ] } } } -cleanup { interp delete $i } -result substituted test compile-17.2 {Command interpretation binding for non-compiled code} -setup { set i [interp create] } -body { $i eval { if 1 { [subst expr] [ proc expr args {return substituted} format {[subst compiled]} ] } } } -cleanup { interp delete $i } -result substituted # This tests the supported parts of the unsupported [disassemble] command. It # does not check the format of disassembled bytecode though; that's liable to # change without warning. set disassemblables [linsert [join { constructor destructor lambda method objmethod proc script } ", "] end-1 or] test compile-18.1 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble } -match glob -result {wrong # args: should be "*"} test compile-18.2 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble ? } -result "bad type \"?\": must be $disassemblables" test compile-18.3 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble lambda } -match glob -result {wrong # args: should be "* lambda lambdaTerm"} test compile-18.4 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble lambda \{ } -result "can't interpret \"\{\" as a lambda expression" test compile-18.5 {disassembler - basics} -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble lambda {{} {}} } -match glob -result * test compile-18.6 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble proc } -match glob -result {wrong # args: should be "* proc procName"} test compile-18.7 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble proc nosuchproc } -result {"nosuchproc" isn't a procedure} test compile-18.8 {disassembler - basics} -setup { proc chewonthis {} {} } -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble proc chewonthis } -cleanup { rename chewonthis {} } -match glob -result * test compile-18.9 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble script } -match glob -result {wrong # args: should be "* script script"} test compile-18.10 {disassembler - basics} -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble script {} } -match glob -result * test compile-18.11 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble method } -match glob -result {wrong # args: should be "* method className methodName"} test compile-18.12 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble method nosuchclass foo } -result {nosuchclass does not refer to an object} test compile-18.13 {disassembler - basics} -returnCodes error -setup { oo::object create justanobject } -body { tcl::unsupported::disassemble method justanobject foo } -cleanup { justanobject destroy } -result {"justanobject" is not a class} test compile-18.14 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble method oo::object nosuchmethod } -result {unknown method "nosuchmethod"} test compile-18.15 {disassembler - basics} -setup { oo::class create foo {method bar {} {}} } -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble method foo bar } -cleanup { foo destroy } -match glob -result * test compile-18.16 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble objmethod } -match glob -result {wrong # args: should be "* objmethod objectName methodName"} test compile-18.17 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble objmethod nosuchobject foo } -result {nosuchobject does not refer to an object} test compile-18.18 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble objmethod oo::object nosuchmethod } -result {unknown method "nosuchmethod"} test compile-18.19 {disassembler - basics} -setup { oo::object create foo oo::objdefine foo {method bar {} {}} } -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble objmethod foo bar } -cleanup { foo destroy } -match glob -result * # There never was a compile-18.20. # The keys of the dictionary produced by [getbytecode] are defined. set bytecodekeys {literals variables exception instructions auxiliary commands script namespace stackdepth exceptdepth} set allbytecodekeys [list {*}$bytecodekeys initiallinenumber sourcefile] test compile-18.21 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode } -match glob -result {wrong # args: should be "*"} test compile-18.22 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode ? } -result "bad type \"?\": must be $disassemblables" test compile-18.23 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode lambda } -match glob -result {wrong # args: should be "* lambda lambdaTerm"} test compile-18.24 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode lambda \{ } -result "can't interpret \"\{\" as a lambda expression" test compile-18.25 {disassembler - basics} -body { dict keys [tcl::unsupported::getbytecode lambda {{} {}}] } -result $allbytecodekeys test compile-18.26 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode proc } -match glob -result {wrong # args: should be "* proc procName"} test compile-18.27 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode proc nosuchproc } -result {"nosuchproc" isn't a procedure} test compile-18.28 {disassembler - basics} -setup { proc chewonthis {} {} } -body { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename chewonthis {} } -result $allbytecodekeys test compile-18.28.1 {disassembler - tricky bit} -setup { eval [list proc chewonthis {} {}] } -body { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename chewonthis {} } -result $bytecodekeys test compile-18.28.2 {disassembler - tricky bit} -setup { eval {proc chewonthis {} {}} } -body { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename chewonthis {} } -result $allbytecodekeys test compile-18.28.3 {disassembler - tricky bit} -setup { proc Proc {n a b} { proc $n $a $b } Proc chewonthis {} {} } -body { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename Proc {} rename chewonthis {} } -result $bytecodekeys test compile-18.28.4 {disassembler - tricky bit} -setup { proc Proc {n a b} { tailcall proc $n $a $b } Proc chewonthis {} {} } -body { dict keys [tcl::unsupported::getbytecode proc chewonthis] } -cleanup { rename Proc {} rename chewonthis {} } -result $allbytecodekeys test compile-18.29 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode script } -match glob -result {wrong # args: should be "* script script"} test compile-18.30 {disassembler - basics} -body { dict keys [tcl::unsupported::getbytecode script {}] } -result $bytecodekeys test compile-18.31 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode method } -match glob -result {wrong # args: should be "* method className methodName"} test compile-18.32 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode method nosuchclass foo } -result {nosuchclass does not refer to an object} test compile-18.33 {disassembler - basics} -returnCodes error -setup { oo::object create justanobject } -body { tcl::unsupported::getbytecode method justanobject foo } -cleanup { justanobject destroy } -result {"justanobject" is not a class} test compile-18.34 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode method oo::object nosuchmethod } -result {unknown method "nosuchmethod"} test compile-18.35 {disassembler - basics} -setup { oo::class create foo {method bar {} {}} } -body { dict keys [tcl::unsupported::getbytecode method foo bar] } -cleanup { foo destroy } -result $allbytecodekeys test compile-18.36 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode objmethod } -match glob -result {wrong # args: should be "* objmethod objectName methodName"} test compile-18.37 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode objmethod nosuchobject foo } -result {nosuchobject does not refer to an object} test compile-18.38 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode objmethod oo::object nosuchmethod } -result {unknown method "nosuchmethod"} test compile-18.39 {disassembler - basics} -setup { oo::object create foo oo::objdefine foo {method bar {} {}} } -body { dict keys [tcl::unsupported::getbytecode objmethod foo bar] } -cleanup { foo destroy } -result $allbytecodekeys test compile-18.40 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble constructor } -match glob -result {wrong # args: should be "* constructor className"} test compile-18.41 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble constructor nosuchclass } -result {nosuchclass does not refer to an object} test compile-18.42 {disassembler - basics} -returnCodes error -setup { oo::object create justanobject } -body { tcl::unsupported::disassemble constructor justanobject } -cleanup { justanobject destroy } -result {"justanobject" is not a class} test compile-18.43 {disassembler - basics} -returnCodes error -setup { oo::class create constructorless } -body { tcl::unsupported::disassemble constructor constructorless } -cleanup { constructorless destroy } -result {"constructorless" has no defined constructor} test compile-18.44 {disassembler - basics} -setup { oo::class create foo {constructor {} {set x 1}} } -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble constructor foo } -cleanup { foo destroy } -match glob -result * test compile-18.45 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode constructor } -match glob -result {wrong # args: should be "* constructor className"} test compile-18.46 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode constructor nosuchobject } -result {nosuchobject does not refer to an object} test compile-18.47 {disassembler - basics} -returnCodes error -setup { oo::class create constructorless } -body { tcl::unsupported::getbytecode constructor constructorless } -cleanup { constructorless destroy } -result {"constructorless" has no defined constructor} test compile-18.48 {disassembler - basics} -setup { oo::class create foo {constructor {} {set x 1}} } -body { dict keys [tcl::unsupported::getbytecode constructor foo] } -cleanup { foo destroy } -result $allbytecodekeys # There is no compile-18.49 test compile-18.50 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble destructor } -match glob -result {wrong # args: should be "* destructor className"} test compile-18.51 {disassembler - basics} -returnCodes error -body { tcl::unsupported::disassemble destructor nosuchclass } -result {nosuchclass does not refer to an object} test compile-18.52 {disassembler - basics} -returnCodes error -setup { oo::object create justanobject } -body { tcl::unsupported::disassemble destructor justanobject } -cleanup { justanobject destroy } -result {"justanobject" is not a class} test compile-18.53 {disassembler - basics} -returnCodes error -setup { oo::class create constructorless } -body { tcl::unsupported::disassemble destructor constructorless } -cleanup { constructorless destroy } -result {"constructorless" has no defined destructor} test compile-18.54 {disassembler - basics} -setup { oo::class create foo {destructor {set x 1}} } -body { # Allow any string: the result format is not defined anywhere! tcl::unsupported::disassemble destructor foo } -cleanup { foo destroy } -match glob -result * test compile-18.55 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode destructor } -match glob -result {wrong # args: should be "* destructor className"} test compile-18.56 {disassembler - basics} -returnCodes error -body { tcl::unsupported::getbytecode destructor nosuchobject } -result {nosuchobject does not refer to an object} test compile-18.57 {disassembler - basics} -returnCodes error -setup { oo::class create constructorless } -body { tcl::unsupported::getbytecode destructor constructorless } -cleanup { constructorless destroy } -result {"constructorless" has no defined destructor} test compile-18.58 {disassembler - basics} -setup { oo::class create foo {destructor {set x 1}} } -body { dict keys [tcl::unsupported::getbytecode destructor foo] } -cleanup { foo destroy } -result $allbytecodekeys test compile-19.0 {Bug 3614102: reset stack housekeeping} -body { # This will panic in a --enable-symbols=compile build, unless bug is fixed. apply {{} {list [if 1]}} } -returnCodes error -match glob -result * test compile-20.1 {ensure there are no infinite loops in optimizing} { tcl::unsupported::disassemble script { while 1 { return -code continue -level 0 } } return } {} test compile-20.2 {ensure there are no infinite loops in optimizing} { tcl::unsupported::disassemble script { while 1 { while 1 { return -code break -level 0 } } } return } {} test compile-21.1 {stack balance management} { apply {{} { set result {} while 1 { lappend result a lappend result [list b [break]] lappend result c } return $result }} } a test compile-21.2 {stack balance management} { apply {{} { set result {} while {[incr i] <= 10} { lappend result $i lappend result [list b [continue] c] lappend result c } return $result }} } {1 2 3 4 5 6 7 8 9 10} test compile-21.3 {stack balance management} { apply {args { set result {} while 1 { lappend result a lappend result [concat {*}$args [break]] lappend result c } return $result }} P Q R S T } a test compile-21.4 {stack balance management} { apply {args { set result {} while {[incr i] <= 10} { lappend result $i lappend result [concat {*}$args [continue] c] lappend result c } return $result }} P Q R S T } {1 2 3 4 5 6 7 8 9 10} # TODO sometime - check that bytecode from tbcload is *not* disassembled. # cleanup catch {rename p ""} catch {namespace delete test_ns_compile} catch {unset x} catch {unset y} catch {unset a} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/compExpr.test0000644000175000017500000004266015104661341015417 0ustar sergeisergei# This file contains a collection of tests for the procedures in the file # tclCompExpr.c. Sourcing this file into Tcl runs the tests and generates # output for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands # Constrain memory leak tests testConstraint memory [llength [info commands memory]] catch {unset a} test compExpr-1.1 {TclCompileExpr procedure, successful expr parse and compile} { expr 1+2 } 3 test compExpr-1.2 {TclCompileExpr procedure, error parsing expr} -body { expr 1+2+ } -returnCodes error -match glob -result * test compExpr-1.3 {TclCompileExpr procedure, error compiling expr} -body { list [catch {expr "foo(123)"} msg] $msg } -match glob -result {1 {* "*foo"}} test compExpr-1.4 {TclCompileExpr procedure, expr has no operators} { set a {0o00123} expr {$a} } 83 test compExpr-2.1 {CompileSubExpr procedure, TCL_TOKEN_WORD parse token} -setup { unset -nocomplain a } -body { set a 27 expr {"foo$a" < "bar"} } -result 0 test compExpr-2.2 {CompileSubExpr procedure, error compiling TCL_TOKEN_WORD parse token} -body { expr {"00[expr 1+]" + 17} } -returnCodes error -match glob -result * test compExpr-2.3 {CompileSubExpr procedure, TCL_TOKEN_TEXT parse token} { expr {{12345}} } 12345 test compExpr-2.4 {CompileSubExpr procedure, empty TCL_TOKEN_TEXT parse token} { expr {{}} } {} test compExpr-2.5 {CompileSubExpr procedure, TCL_TOKEN_BS parse token} { expr "\{ \\ +123 \}" } 123 test compExpr-2.6 {CompileSubExpr procedure, TCL_TOKEN_COMMAND parse token} { expr {[info tclversion] != ""} } 1 test compExpr-2.7 {CompileSubExpr procedure, TCL_TOKEN_COMMAND parse token} { expr {[]} } {} test compExpr-2.8 {CompileSubExpr procedure, error in TCL_TOKEN_COMMAND parse token} -body { expr {[foo "bar"xxx] + 17} } -returnCodes error -match glob -result * test compExpr-2.9 {CompileSubExpr procedure, TCL_TOKEN_VARIABLE parse token} -setup { unset -nocomplain a } -body { set a 123 expr {$a*2} } -result 246 test compExpr-2.10 {CompileSubExpr procedure, TCL_TOKEN_VARIABLE parse token} -setup { unset -nocomplain a unset -nocomplain b } -body { set a(george) martha set b geo expr {$a(${b}rge)} } -result martha test compExpr-2.11 {CompileSubExpr procedure, error in TCL_TOKEN_VARIABLE parse token} -body { unset -nocomplain a expr {$a + 17} } -returnCodes error -result {can't read "a": no such variable} test compExpr-2.12 {CompileSubExpr procedure, TCL_TOKEN_SUB_EXPR parse token} { expr {27||3? 3<<(1+4) : 4&&9} } 96 test compExpr-2.13 {CompileSubExpr procedure, error in TCL_TOKEN_SUB_EXPR parse token} -setup { unset -nocomplain a } -body { set a 15 list [catch {expr {27 || "$a[expr 1+]00"}} msg] $msg } -result {0 1} test compExpr-2.14 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, op found} { expr {5*6} } 30 test compExpr-2.15 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, math function found} { format %.6g [expr {sin(2.0)}] } 0.909297 test compExpr-2.16 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, math function not found} -body { list [catch {expr {fred(2.0)}} msg] $msg } -match glob -result {1 {* "*fred"}} test compExpr-2.17 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4*2} } 8 test compExpr-2.18 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4/2} } 2 test compExpr-2.19 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4%2} } 0 test compExpr-2.20 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4<<2} } 16 test compExpr-2.21 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4>>2} } 1 test compExpr-2.22 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4<2} } 0 test compExpr-2.23 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4>2} } 1 test compExpr-2.24 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4<=2} } 0 test compExpr-2.25 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4>=2} } 1 test compExpr-2.26 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4==2} } 0 test compExpr-2.27 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4!=2} } 1 test compExpr-2.28 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4&2} } 0 test compExpr-2.29 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4^2} } 6 test compExpr-2.30 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator} { expr {4|2} } 6 test compExpr-2.31 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator, 1 operand} { expr {!4} } 0 test compExpr-2.32 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator, 1 operand} { expr {~4} } -5 test compExpr-2.33 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, normal operator, comparison} -setup { unset -nocomplain a } -body { set a 15 expr {$a==15} ;# compiled out-of-line to runtime call on Tcl_ExprObjCmd } -result 1 test compExpr-2.34 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} { expr {+2} } 2 test compExpr-2.35 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, error in special operator} -body { expr {+[expr 1+]} } -returnCodes error -match glob -result * test compExpr-2.36 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} { expr {4+2} } 6 test compExpr-2.37 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, error in special operator} -body { expr {[expr 1+]+5} } -returnCodes error -match glob -result * test compExpr-2.38 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, error in special operator} -body { expr {5+[expr 1+]} } -returnCodes error -match glob -result * test compExpr-2.39 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} { expr {-2} } -2 test compExpr-2.40 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} { expr {4-2} } 2 test compExpr-2.41 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} -setup { unset -nocomplain a } -body { set a true expr {0||$a} } -result 1 test compExpr-2.42 {CompileSubExpr procedure, error in TCL_TOKEN_SUB_EXPR parse token} -setup { unset -nocomplain a } -body { set a 15 list [catch {expr {27 || "$a[expr 1+]00"}} msg] $msg } -result {0 1} test compExpr-2.43 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} -setup { unset -nocomplain a } -body { set a false expr {3&&$a} } -result 0 test compExpr-2.44 {CompileSubExpr procedure, TCL_TOKEN_OPERATOR token, special operator} -setup { unset -nocomplain a } -body { set a false expr {$a||1? 1 : 0} } -result 1 test compExpr-2.45 {CompileSubExpr procedure, error in TCL_TOKEN_SUB_EXPR parse token} -setup { unset -nocomplain a } -body { set a 15 list [catch {expr {1? 54 : "$a[expr 1+]00"}} msg] $msg } -result {0 54} test compExpr-3.1 {CompileLandOrLorExpr procedure, numeric 1st operand} -setup { unset -nocomplain a } -body { set a 2 expr {[set a]||0} } -result 1 test compExpr-3.2 {CompileLandOrLorExpr procedure, nonnumeric 1st operand} -setup { unset -nocomplain a } -body { set a no expr {$a&&1} } -result 0 test compExpr-3.3 {CompileSubExpr procedure, error in 1st operand} -body { expr {[expr *2]||0} } -returnCodes error -match glob -result * test compExpr-3.4 {CompileLandOrLorExpr procedure, result is 1 or 0} -setup { unset -nocomplain a unset -nocomplain b } -body { set a no set b true expr {$a || $b} } -result 1 test compExpr-3.5 {CompileLandOrLorExpr procedure, short-circuit semantics} -setup { unset -nocomplain a } -body { set a yes expr {$a || [exit]} } -result 1 test compExpr-3.6 {CompileLandOrLorExpr procedure, short-circuit semantics} -setup { unset -nocomplain a } -body { set a no expr {$a && [exit]} } -result 0 test compExpr-3.7 {CompileLandOrLorExpr procedure, numeric 2nd operand} -setup { unset -nocomplain a } -body { set a 2 expr {0||[set a]} } -result 1 test compExpr-3.8 {CompileLandOrLorExpr procedure, nonnumeric 2nd operand} -setup { unset -nocomplain a } -body { set a no expr {1&&$a} } -result 0 test compExpr-3.9 {CompileLandOrLorExpr procedure, error in 2nd operand} -body { expr {0||[expr %2]} } -returnCodes error -match glob -result * test compExpr-3.10 {CompileLandOrLorExpr procedure, long lor/land arm} { set a "abcdefghijkl" set i 7 expr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} } 1 test compExpr-4.1 {CompileCondExpr procedure, simple test} -setup { unset -nocomplain a } -body { set a 2 expr {($a > 1)? "ok" : "nope"} } -result ok test compExpr-4.2 {CompileCondExpr procedure, complex test, convert to numeric} -setup { unset -nocomplain a } -body { set a no expr {[set a]? 27 : -54} } -result -54 test compExpr-4.3 {CompileCondExpr procedure, error in test} -body { expr {[expr *2]? +1 : -1} } -returnCodes error -match glob -result * test compExpr-4.4 {CompileCondExpr procedure, simple "true" clause} -setup { unset -nocomplain a } -body { set a no expr {1? (27-2) : -54} } -result 25 test compExpr-4.5 {CompileCondExpr procedure, convert "true" clause to numeric} -setup { unset -nocomplain a } -body { set a no expr {1? $a : -54} } -result no test compExpr-4.6 {CompileCondExpr procedure, error in "true" clause} -body { expr {1? [expr *2] : -127} } -returnCodes error -match glob -result * test compExpr-4.7 {CompileCondExpr procedure, simple "false" clause} -setup { unset -nocomplain a } -body { set a no expr {(2-2)? -3.14159 : "nope"} } -result nope test compExpr-4.8 {CompileCondExpr procedure, convert "false" clause to numeric} -setup { unset -nocomplain a } -body { set a 0o0123 expr {0? 42 : $a} } -result 83 test compExpr-4.9 {CompileCondExpr procedure, error in "false" clause} { list [catch {expr {1? 15 : [expr *2]}} msg] $msg } {0 15} test compExpr-5.1 {CompileMathFuncCall procedure, math function found} { format %.6g [expr {atan2(1.0, 2.0)}] } 0.463648 test compExpr-5.2 {CompileMathFuncCall procedure, math function not found} -body { expr {do_it()} } -returnCodes error -match glob -result {* "*do_it"} test compExpr-5.5 {CompileMathFuncCall procedure, not enough arguments} -body { expr {atan2(1.0)} } -returnCodes error -match glob -result {not enough arguments for math function*} test compExpr-5.6 {CompileMathFuncCall procedure, complex argument} { format %.6g [expr {pow(2.1, 27.5-(24.4*(5%2)))}] } 9.97424 test compExpr-5.7 {CompileMathFuncCall procedure, error in argument} -body { expr {sinh(2.*)} } -returnCodes error -match glob -result * test compExpr-5.8 {CompileMathFuncCall procedure, too many arguments} -body { expr {sinh(2.0, 3.0)} } -returnCodes error -match glob -result {too many arguments for math function*} test compExpr-5.9 {CompileMathFuncCall procedure, too many arguments} -body { expr {0 <= rand(5.2)} } -returnCodes error -match glob -result {too many arguments for math function*} test compExpr-6.1 {LogSyntaxError procedure, error in expr longer than 60 chars} -body { expr {(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)*(+0123456)/} -1 foo 3 } -returnCodes error -match glob -result * test compExpr-7.1 {Memory Leak} -constraints memory -setup { proc getbytes {} { set lines [split [memory info] \n] lindex $lines 3 3 } } -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { interp create child child eval expr 1+2+3+4+5+6+7+8+9+10+11+12+13 interp delete child set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { unset end i tmp rename getbytes {} } -result 0 test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setup { proc getbytes {} { set lines [split [memory info] \n] lindex $lines 3 3 } } -body { set i 5 set end [getbytes] while {[incr i -1]} { expr ${i}000 set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { unset end i tmp rename getbytes {} } -result 0 proc extract {opcodes descriptor} { set instructions [dict values [dict get $descriptor instructions]] return [lmap i $instructions { if {[lindex $i 0] in $opcodes} {string cat $i} else continue }] } test compExpr-8.1 {TIP 582: expression comments} -setup {} -body { extract {loadStk add} [tcl::unsupported::getbytecode script {expr { $abc # + $def + $ghi }}] } -result {loadStk loadStk add} test compExpr-8.2 {TIP 582: expression comments} -setup {} -body { extract {loadStk add} [tcl::unsupported::getbytecode script {expr { $abc # + $def # + $ghi }}] } -result loadStk test compExpr-8.3 {TIP 582: expression comments} -setup {} -body { extract {loadStk add} [tcl::unsupported::getbytecode script {expr { $abc # + $def\ + $ghi }}] } -result loadStk test compExpr-8.4 {TIP 582: expression comments} -setup {} -body { extract {loadStk add} [tcl::unsupported::getbytecode script {expr { $abc # + $def\\ + $ghi }}] } -result {loadStk loadStk add} # cleanup catch {unset a} catch {unset b} catch {rename extract ""} ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/compExpr-old.test0000644000175000017500000010601715104661341016170 0ustar sergeisergei# Commands covered: expr # # This file contains the original set of tests for the compilation (and # indirectly execution) of Tcl's expr command. A new set of tests covering # the new implementation are in the files "parseExpr.test" and # "compExpr.test". Sourcing this file into Tcl runs the tests and generates # output for errors. No output means no errors were found. # # Copyright © 1996-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] # procedures used below proc put_hello_char {c} { global a append a [format %c $c] return $c } proc hello_world {} { global a set a "" set L1 [set l0 [set h_1 [set q 0]]] for {put_hello_char [expr [put_hello_char [expr [set h 7]*10+2]]+29]} {$l0?[put_hello_char $l0] :!$h_1} {put_hello_char $ll;expr {$L1==2?[set ll [expr 32+0-0+[set bar 0]]]:0}} {expr {[incr L1]==[expr 1+([string length "abc"]-[string length "abc"])] ?[set ll [set l0 [expr 54<<1]]]:$ll==108&&$L1<3? [incr ll [expr 1|1<<1]; set ll $ll; set ll $ll; set ll $ll; set ll $ll; set l0 [expr ([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])]; set l0; set l0 $l0; set l0; set l0]:$L1==4&&$ll==32?[set ll [expr 19+$h1+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])+[set foo [expr ([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])+([string length "abc"]-[string length "abc"])]]]] :[set q [expr $q-$h1+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])]]};expr {$L1==5?[incr ll -8; set ll $ll; set ll]:$q&&$h1&&1};expr {$L1==4+2 ?[incr ll 3]:[expr ([string length "abc"]-[string length "abc"])+1]};expr {$ll==($h<<4)+2+0&&$L1!=6?[incr ll -6]:[set h1 [expr 100+([string length "abc"]-[string length "abc"])-([string length "abc"]-[string length "abc"])]]} expr {$L1!=1<<3?[incr q [expr ([string length "abc"]-[string length "abc"])-1]]:[set h_1 [set ll $h1]]} } set a } proc 12days {a b c} { global xxx expr {1<$a?[expr {$a<3?[12days -79 -13 [string range $c [12days -87 \ [expr 1-$b] [string range $c [12days -86 0 [string range $c 1 end]] \ end]] end]]:1};expr {$a<$b?[12days [expr $a+1] $b $c]:3};expr {[12days \ -94 [expr $a-27] $c]&&$a==2?$b<13?[12days 2 [expr $b+1] "%s %d %d\n"]:9 :16}]:$a<0?$a<-72?[12days $b $a "@n'+,#'/*\{\}w+/w#cdnr/+,\{\}r/*de\}+,/*\{*+,/w\{%+,/w#q#n+,/#\{l+,/n\{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,\}\{w+K w'K:'+\}e#';dq#'l q#'+d'K#!/+k#;q#'r\}eKK#\}w'r\}eKK\{nl\]'/#;#q#n')\{)#\}w')\{)\{nl\]'/+#n';d\}rw' i;# )\{nl\]!/n\{n#'; r\{#w'r nc\{nl\]'/#\{l,+'K \{rw' iK\{;\[\{nl\]'/w#q#n'wk nw' iwk\{KK\{nl\]!/w\{%'l##w#' i; :\{nl\]'/*\{q#'ld;r'\}\{nlwb!/*de\}'c ;;\{nl'-\{\}rw\]'/+,\}##'*\}#nc,',#nw\]'/+kd'+e\}+;#'rdq#w! nr'/ ') \}+\}\{rl#'\{n' ')# \}'+\}##(!!/"] :$a<-50?[string compare [format %c $b] [string index $c 0]]==0?[append \ xxx [string index $c 31];scan [string index $c 31] %c x;set x] :[12days -65 $b [string range $c 1 end]]:[12days [expr ([string compare \ [string index $c 0] "/"]==0)+$a] $b [string range $c 1 end]]:0<$a ?[12days 2 2 "%s"]:[string compare [string index $c 0] "/"]==0|| [12days 0 [12days -61 [scan [string index $c 0] %c x; set x] \ "!ek;dc i@bK'(q)-\[w\]*%n+r3#l,\{\}:\nuwloca-O;m .vpbks,fxntdCeghiry"] \ [string range $c 1 end]]} } proc do_twelve_days {} { global xxx set xxx "" 12days 1 1 1 set result [string length $xxx] unset xxx return $result } # start of tests catch {unset a b i x} test compExpr-old-1.1 {TclCompileExprCmd: no expression} { list [catch {expr } msg] $msg } {1 {wrong # args: should be "expr arg ?arg ...?"}} test compExpr-old-1.2 {TclCompileExprCmd: one expression word} { expr -25 } -25 test compExpr-old-1.3 {TclCompileExprCmd: two expression words} { expr -8.2 -6 } -14.2 test compExpr-old-1.4 {TclCompileExprCmd: five expression words} { expr 20 - 5 +10 -7 } 18 test compExpr-old-1.5 {TclCompileExprCmd: quoted expression word} { expr "0005" } 5 test compExpr-old-1.6 {TclCompileExprCmd: quoted expression word} { catch {expr "0005"zxy} msg set msg } {extra characters after close-quote} test compExpr-old-1.7 {TclCompileExprCmd: expression word in braces} { expr {-0005} } -5 test compExpr-old-1.8 {TclCompileExprCmd: expression word in braces} { expr {{-0x1234}} } -4660 test compExpr-old-1.9 {TclCompileExprCmd: expression word in braces} { catch {expr {-0005}foo} msg set msg } {extra characters after close-brace} test compExpr-old-1.10 {TclCompileExprCmd: other expression word in braces} { expr 4*[llength "6 2"] } 8 test compExpr-old-1.11 {TclCompileExprCmd: expression word terminated by ;} { expr 4*[llength "6 2"]; } 8 test compExpr-old-1.12 {TclCompileExprCmd: inlined expr (in "catch") inside other catch} { set a xxx catch { # Might not be a number set a [expr 10*$a] } } 1 test compExpr-old-1.13 {TclCompileExprCmd: second level of substitutions in expr not in braces with single var reference} { set a xxx set x 27; set bool {$x}; if $bool {set a foo} set a } foo test compExpr-old-1.14 {TclCompileExprCmd: second level of substitutions in expr with comparison as top-level operator} { set a xxx set x 2; set b {$x}; set a [expr $b == 2] set a } 1 test compExpr-old-2.1 {TclCompileExpr: are builtin functions registered?} { expr double(5*[llength "6 2"]) } 10.0 test compExpr-old-2.2 {TclCompileExpr: error in expr} -body { expr 2***3 } -returnCodes error -match glob -result * test compExpr-old-2.3 {TclCompileExpr: junk after legal expr} -body { expr 7*[llength "a b"]foo } -returnCodes error -match glob -result * test compExpr-old-2.4 {TclCompileExpr: numeric expr string rep == formatted int rep} { expr {0001} } 1 test compExpr-old-3.1 {CompileCondExpr: just lor expr} {expr 3||0} 1 test compExpr-old-3.2 {CompileCondExpr: error in lor expr} -body { expr x||3 } -returnCodes error -match glob -result * test compExpr-old-3.3 {CompileCondExpr: test true arm} {expr 3>2?44:66} 44 test compExpr-old-3.4 {CompileCondExpr: error compiling true arm} -body { expr 3>2?2***3:66 } -returnCodes error -match glob -result * test compExpr-old-3.5 {CompileCondExpr: test false arm} {expr 2>3?44:66} 66 test compExpr-old-3.6 {CompileCondExpr: error compiling false arm} -body { expr 2>3?44:2***3 } -returnCodes error -match glob -result * test compExpr-old-3.7 {CompileCondExpr: long arms & nested cond exprs} { hello_world } {Hello world} test compExpr-old-3.8 {CompileCondExpr: long arms & nested cond exprs} unix { # Fails with a stack overflow on threaded Windows builds do_twelve_days } 2358 test compExpr-old-4.1 {CompileLorExpr: just land expr} {expr 1.3&&3.3} 1 test compExpr-old-4.2 {CompileLorExpr: error in land expr} -body { expr x&&3 } -returnCodes error -match glob -result * test compExpr-old-4.3 {CompileLorExpr: simple lor exprs} {expr 0||1.0} 1 test compExpr-old-4.4 {CompileLorExpr: simple lor exprs} {expr 3.0||0.0} 1 test compExpr-old-4.5 {CompileLorExpr: simple lor exprs} {expr 0||0||1} 1 test compExpr-old-4.6 {CompileLorExpr: error compiling lor arm} -body { expr 2***3||4.0 } -returnCodes error -match glob -result * test compExpr-old-4.7 {CompileLorExpr: error compiling lor arm} -body { expr 1.3||2***3 } -returnCodes error -match glob -result * test compExpr-old-4.8 {CompileLorExpr: error compiling lor arms} { list [catch {expr {"a"||"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test compExpr-old-4.9 {CompileLorExpr: long lor arm} { set a "abcdefghijkl" set i 7 expr {[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]] || [string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]&&[string compare [format %c $i] [string index $a $i]]} } 1 test compExpr-old-5.1 {CompileLandExpr: just bitor expr} {expr 7|0x13} 23 test compExpr-old-5.2 {CompileLandExpr: error in bitor expr} -body { expr x|3 } -returnCodes error -match glob -result * test compExpr-old-5.3 {CompileLandExpr: simple land exprs} {expr 0&&1.0} 0 test compExpr-old-5.4 {CompileLandExpr: simple land exprs} {expr 0&&0} 0 test compExpr-old-5.5 {CompileLandExpr: simple land exprs} {expr 3.0&&1.2} 1 test compExpr-old-5.6 {CompileLandExpr: simple land exprs} {expr 1&&1&&2} 1 test compExpr-old-5.7 {CompileLandExpr: error compiling land arm} -body { expr 2***3&&4.0 } -returnCodes error -match glob -result * test compExpr-old-5.8 {CompileLandExpr: error compiling land arm} -body { expr 1.3&&2***3 } -returnCodes error -match glob -result * test compExpr-old-5.9 {CompileLandExpr: error compiling land arm} { list [catch {expr {"a"&&"b"}} msg] $msg } {1 {expected boolean value but got "a"}} test compExpr-old-5.10 {CompileLandExpr: long land arms} { set a "abcdefghijkl" set i 7 expr {[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]] && [string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]^[string compare [format %c 103] [string index $a $i]]^[string compare [format %c 105] [string index $a $i]]} } 1 test compExpr-old-6.1 {CompileBitXorExpr: just bitand expr} {expr 7&0x13} 3 test compExpr-old-6.2 {CompileBitXorExpr: error in bitand expr} -body { expr x|3 } -returnCodes error -match glob -result * test compExpr-old-6.3 {CompileBitXorExpr: simple bitxor exprs} {expr 7^0x13} 20 test compExpr-old-6.4 {CompileBitXorExpr: simple bitxor exprs} {expr 3^0x10} 19 test compExpr-old-6.5 {CompileBitXorExpr: simple bitxor exprs} {expr 0^7} 7 test compExpr-old-6.6 {CompileBitXorExpr: simple bitxor exprs} {expr -1^7} -8 test compExpr-old-6.7 {CompileBitXorExpr: error compiling bitxor arm} -body { expr 2***3|6 } -returnCodes error -match glob -result * test compExpr-old-6.8 {CompileBitXorExpr: error compiling bitxor arm} -body { expr 2^x } -returnCodes error -match glob -result * test compExpr-old-6.9 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {24.0^3}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "^"}} test compExpr-old-6.10 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {"a"^"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "^"}} test compExpr-old-7.1 {CompileBitAndExpr: just equality expr} {expr 3==2} 0 test compExpr-old-7.2 {CompileBitAndExpr: just equality expr} {expr 2.0==2} 1 test compExpr-old-7.3 {CompileBitAndExpr: just equality expr} {expr 3.2!=2.2} 1 test compExpr-old-7.4 {CompileBitAndExpr: just equality expr} {expr {"abc" == "abd"}} 0 test compExpr-old-7.5 {CompileBitAndExpr: error in equality expr} -body { expr x==3 } -returnCodes error -match glob -result * test compExpr-old-7.6 {CompileBitAndExpr: simple bitand exprs} {expr 7&0x13} 3 test compExpr-old-7.7 {CompileBitAndExpr: simple bitand exprs} {expr 0xf2&0x53} 82 test compExpr-old-7.8 {CompileBitAndExpr: simple bitand exprs} {expr 3&6} 2 test compExpr-old-7.9 {CompileBitAndExpr: simple bitand exprs} {expr -1&-7} -7 test compExpr-old-7.10 {CompileBitAndExpr: error compiling bitand arm} -body { expr 2***3&6 } -returnCodes error -match glob -result * test compExpr-old-7.11 {CompileBitAndExpr: error compiling bitand arm} -body { expr 2&x } -returnCodes error -match glob -result * test compExpr-old-7.12 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {24.0&3}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of "&"}} test compExpr-old-7.13 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {"a"&"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "&"}} test compExpr-old-8.1 {CompileEqualityExpr: just relational expr} {expr 3>=2} 1 test compExpr-old-8.2 {CompileEqualityExpr: just relational expr} {expr 2<=2.1} 1 test compExpr-old-8.3 {CompileEqualityExpr: just relational expr} {expr 3.2>"2.2"} 1 test compExpr-old-8.4 {CompileEqualityExpr: just relational expr} {expr {"0y"<"0x12"}} 0 test compExpr-old-8.5 {CompileEqualityExpr: error in relational expr} -body { expr x>3 } -returnCodes error -match glob -result * test compExpr-old-8.6 {CompileEqualityExpr: simple equality exprs} {expr 7==0x13} 0 test compExpr-old-8.7 {CompileEqualityExpr: simple equality exprs} {expr -0xf2!=0x53} 1 test compExpr-old-8.8 {CompileEqualityExpr: simple equality exprs} {expr {"12398712938788234-1298379" != ""}} 1 test compExpr-old-8.9 {CompileEqualityExpr: simple equality exprs} {expr -1!="abc"} 1 test compExpr-old-8.10 {CompileEqualityExpr: error compiling equality arm} -body { expr 2***3==6 } -returnCodes error -match glob -result * test compExpr-old-8.11 {CompileEqualityExpr: error compiling equality arm} -body { expr 2!=x } -returnCodes error -match glob -result * test compExpr-old-9.1 {CompileRelationalExpr: just shift expr} {expr 3<<2} 12 test compExpr-old-9.2 {CompileRelationalExpr: just shift expr} {expr 0xff>>2} 63 test compExpr-old-9.3 {CompileRelationalExpr: just shift expr} {expr -1>>2} -1 test compExpr-old-9.4 {CompileRelationalExpr: just shift expr} {expr {1<<3}} 8 test compExpr-old-9.5 {CompileRelationalExpr: large shift expr} { expr {int(1<<63)} } 9223372036854775808 test compExpr-old-9.6 {CompileRelationalExpr: error in shift expr} -body { expr x>>3 } -returnCodes error -match glob -result * test compExpr-old-9.7 {CompileRelationalExpr: simple relational exprs} {expr 0xff>=+0x3} 1 test compExpr-old-9.8 {CompileRelationalExpr: simple relational exprs} {expr -0xf2<0x3} 1 test compExpr-old-9.9 {CompileRelationalExpr: error compiling relational arm} -body { expr 2***3>6 } -returnCodes error -match glob -result * test compExpr-old-9.10 {CompileRelationalExpr: error compiling relational arm} -body { expr 2>0x3} 31 test compExpr-old-10.7 {CompileShiftExpr: simple shift exprs} {expr -0xf2<<0x3} -1936 test compExpr-old-10.8 {CompileShiftExpr: error compiling shift arm} -body { expr 2***3>>6 } -returnCodes error -match glob -result * test compExpr-old-10.9 {CompileShiftExpr: error compiling shift arm} -body { expr 2<>43}} msg] $msg } {1 {cannot use floating-point value "24.0" as left operand of ">>"}} test compExpr-old-10.11 {CompileShiftExpr: runtime error} { list [catch {expr {"a"<<"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "<<"}} test compExpr-old-11.1 {CompileAddExpr: just multiply expr} {expr 4*-2} -8 test compExpr-old-11.2 {CompileAddExpr: just multiply expr} {expr 0xff%2} 1 test compExpr-old-11.3 {CompileAddExpr: just multiply expr} {expr -1/2} -1 test compExpr-old-11.4 {CompileAddExpr: just multiply expr} {expr 7891%0o123} 6 test compExpr-old-11.5 {CompileAddExpr: error in multiply expr} -body { expr x*3 } -returnCodes error -match glob -result * test compExpr-old-11.6 {CompileAddExpr: simple add exprs} {expr 0xff++0x3} 258 test compExpr-old-11.7 {CompileAddExpr: simple add exprs} {expr -0xf2--0x3} -239 test compExpr-old-11.8 {CompileAddExpr: error compiling add arm} -body { expr 2***3+6 } -returnCodes error -match glob -result * test compExpr-old-11.9 {CompileAddExpr: error compiling add arm} -body { expr 2-x } -returnCodes error -match glob -result * test compExpr-old-11.10 {CompileAddExpr: runtime error} { list [catch {expr {24.0+"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "+"}} test compExpr-old-11.11 {CompileAddExpr: runtime error} { list [catch {expr {"a"-"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "-"}} test compExpr-old-11.12 {CompileAddExpr: runtime error} { list [catch {expr {3/0}} msg] $msg } {1 {divide by zero}} test compExpr-old-11.13a {CompileAddExpr: runtime error} ieeeFloatingPoint { list [catch {expr {2.3/0.0}} msg] $msg } {0 Inf} test compExpr-old-11.13b {CompileAddExpr: runtime error} !ieeeFloatingPoint { list [catch {expr {2.3/0.0}} msg] $msg } {1 {divide by zero}} test compExpr-old-12.1 {CompileMultiplyExpr: just unary expr} {expr ~4} -5 test compExpr-old-12.2 {CompileMultiplyExpr: just unary expr} {expr --5} 5 test compExpr-old-12.3 {CompileMultiplyExpr: just unary expr} {expr !27} 0 test compExpr-old-12.4 {CompileMultiplyExpr: just unary expr} {expr ~0xff00ff} -16711936 test compExpr-old-12.5 {CompileMultiplyExpr: error in unary expr} -body { expr ~x } -returnCodes error -match glob -result * test compExpr-old-12.6 {CompileMultiplyExpr: simple multiply exprs} {expr 0xff*0x3} 765 test compExpr-old-12.7 {CompileMultiplyExpr: simple multiply exprs} {expr -0xf2%-0x3} -2 test compExpr-old-12.8 {CompileMultiplyExpr: error compiling multiply arm} -body { expr 2*3%%6 } -returnCodes error -match glob -result * test compExpr-old-12.9 {CompileMultiplyExpr: error compiling multiply arm} -body { expr 2*x } -returnCodes error -match glob -result * test compExpr-old-12.10 {CompileMultiplyExpr: runtime error} { list [catch {expr {24.0*"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as right operand of "*"}} test compExpr-old-12.11 {CompileMultiplyExpr: runtime error} { list [catch {expr {"a"/"b"}} msg] $msg } {1 {cannot use non-numeric string "a" as left operand of "/"}} test compExpr-old-13.1 {CompileUnaryExpr: unary exprs} {expr -0xff} -255 test compExpr-old-13.2 {CompileUnaryExpr: unary exprs} {expr +0o00123} 83 test compExpr-old-13.3 {CompileUnaryExpr: unary exprs} {expr +--++36} 36 test compExpr-old-13.4 {CompileUnaryExpr: unary exprs} {expr !2} 0 test compExpr-old-13.5 {CompileUnaryExpr: unary exprs} {expr +--+-62.0} -62.0 test compExpr-old-13.6 {CompileUnaryExpr: unary exprs} {expr !0.0} 1 test compExpr-old-13.7 {CompileUnaryExpr: unary exprs} {expr !0xef} 0 test compExpr-old-13.8 {CompileUnaryExpr: error compiling unary expr} -body { expr ~x } -returnCodes error -match glob -result * test compExpr-old-13.9 {CompileUnaryExpr: error compiling unary expr} -body { expr !1.x set msg } -returnCodes error -match glob -result * test compExpr-old-13.10 {CompileUnaryExpr: runtime error} { list [catch {expr {~"xx"}} msg] $msg } {1 {cannot use non-numeric string "xx" as operand of "~"}} test compExpr-old-13.11 {CompileUnaryExpr: runtime error} { list [catch {expr ~4.0} msg] $msg } {1 {cannot use floating-point value "4.0" as operand of "~"}} test compExpr-old-13.12 {CompileUnaryExpr: just primary expr} {expr 0x123} 291 test compExpr-old-13.13 {CompileUnaryExpr: just primary expr} { set a 27 expr $a } 27 test compExpr-old-13.14 {CompileUnaryExpr: just primary expr} { expr double(27) } 27.0 test compExpr-old-13.15 {CompileUnaryExpr: just primary expr} {expr "123"} 123 test compExpr-old-13.16 {CompileUnaryExpr: error in primary expr} { catch {expr [set]} msg set msg } {wrong # args: should be "set varName ?newValue?"} test compExpr-old-14.1 {CompilePrimaryExpr: literal primary} {expr 1} 1 test compExpr-old-14.2 {CompilePrimaryExpr: literal primary} {expr 123} 123 test compExpr-old-14.3 {CompilePrimaryExpr: literal primary} {expr 0xff} 255 test compExpr-old-14.4 {CompilePrimaryExpr: literal primary} {expr 0o0010} 8 test compExpr-old-14.5 {CompilePrimaryExpr: literal primary} {expr 62.0} 62.0 test compExpr-old-14.6 {CompilePrimaryExpr: literal primary} { expr 3.1400000 } 3.14 test compExpr-old-14.7 {CompilePrimaryExpr: literal primary} {expr {{abcde}<{abcdef}}} 1 test compExpr-old-14.8 {CompilePrimaryExpr: literal primary} {expr {{abc\ def} < {abcdef}}} 1 test compExpr-old-14.9 {CompilePrimaryExpr: literal primary} {expr {{abc\tde} > {abc\tdef}}} 0 test compExpr-old-14.10 {CompilePrimaryExpr: literal primary} {expr {{123}}} 123 test compExpr-old-14.11 {CompilePrimaryExpr: var reference primary} { set i 789 list [expr {$i}] [expr $i] } {789 789} test compExpr-old-14.12 {CompilePrimaryExpr: var reference primary} { set i {789} ;# test expr's aggressive conversion to numeric semantics list [expr {$i}] [expr $i] } {789 789} test compExpr-old-14.13 {CompilePrimaryExpr: var reference primary} { catch {unset a} set a(foo) foo set a(bar) bar set a(123) 123 set result "" lappend result [expr $a(123)] [expr {$a(bar)<$a(foo)}] catch {unset a} set result } {123 1} test compExpr-old-14.14 {CompilePrimaryExpr: var reference primary} { set i 123 ;# test "$var.0" floating point conversion hack list [expr $i] [expr $i.0] [expr $i.0/12.0] } {123 123.0 10.25} test compExpr-old-14.15 {CompilePrimaryExpr: var reference primary} { set i 123 catch {expr $i.2} msg set msg } 123.2 test compExpr-old-14.16 {CompilePrimaryExpr: error compiling var reference primary} -body { expr {$a(foo} } -returnCodes error -match glob -result * test compExpr-old-14.17 {CompilePrimaryExpr: string primary that looks like var ref} -body { expr $ } -returnCodes error -match glob -result * test compExpr-old-14.18 {CompilePrimaryExpr: quoted string primary} { expr "21" } 21 test compExpr-old-14.19 {CompilePrimaryExpr: quoted string primary} { set i 123 set x 456 expr "$i+$x" } 579 test compExpr-old-14.20 {CompilePrimaryExpr: quoted string primary} { set i 3 set x 6 expr 2+"$i.$x" } 5.6 test compExpr-old-14.21 {CompilePrimaryExpr: error in quoted string primary} { catch {expr "[set]"} msg set msg } {wrong # args: should be "set varName ?newValue?"} test compExpr-old-14.22 {CompilePrimaryExpr: subcommand primary} { expr {[set i 123; set i]} } 123 test compExpr-old-14.23 {CompilePrimaryExpr: error in subcommand primary} -body { catch {expr {[set]}} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test compExpr-old-14.24 {CompilePrimaryExpr: error in subcommand primary} -body { expr {[set i} } -returnCodes error -match glob -result * test compExpr-old-14.25 {CompilePrimaryExpr: math function primary} { format %.6g [expr exp(1.0)] } 2.71828 test compExpr-old-14.26 {CompilePrimaryExpr: math function primary} { format %.6g [expr pow(2.0+0.1,3.0+0.1)] } 9.97424 test compExpr-old-14.27 {CompilePrimaryExpr: error in math function primary} -body { expr sinh::(2.0) } -returnCodes error -match glob -result * test compExpr-old-14.28 {CompilePrimaryExpr: subexpression primary} { expr 2+(3*4) } 14 test compExpr-old-14.29 {CompilePrimaryExpr: error in subexpression primary} -body { catch {expr 2+(3*[set])} msg set ::errorInfo } -match glob -result {wrong # args: should be "set varName ?newValue?" while *ing "set"*} test compExpr-old-14.30 {CompilePrimaryExpr: missing paren in subexpression primary} -body { expr 2+(3*(4+5) } -returnCodes error -match glob -result * test compExpr-old-14.31 {CompilePrimaryExpr: just var ref in subexpression primary} { set i "5+10" list "[expr $i] == 15" "[expr ($i)] == 15" "[eval expr ($i)] == 15" } {{15 == 15} {15 == 15} {15 == 15}} test compExpr-old-14.32 {CompilePrimaryExpr: unexpected token} -body { expr @ } -returnCodes error -match glob -result * test compExpr-old-15.1 {CompileMathFuncCall: missing parenthesis} -body { expr sinh2.0) } -returnCodes error -match glob -result * test compExpr-old-15.2 {CompileMathFuncCall: unknown math function} -body { catch {expr whazzathuh(1)} msg set ::errorInfo } -match glob -result {* "*whazzathuh" while *ing "expr whazzathuh(1)"} test compExpr-old-15.3 {CompileMathFuncCall: too many arguments} -body { catch {expr sin(1,2,3)} msg set ::errorInfo } -match glob -result {too many arguments for math function* while *ing "expr sin(1,2,3)"} test compExpr-old-15.4 {CompileMathFuncCall: ')' found before last required arg} -body { catch {expr sin()} msg set ::errorInfo } -match glob -result {not enough arguments for math function* while *ing "expr sin()"} test compExpr-old-15.5 {CompileMathFuncCall: not enough arguments} -body { catch {expr pow(1)} msg set ::errorInfo } -match glob -result {not enough arguments for math function* while *ing "expr pow(1)"} test compExpr-old-15.6 {CompileMathFuncCall: missing ')'} -body { expr sin(1 } -returnCodes error -match glob -result * test compExpr-old-16.1 {GetToken: checks whether integer token starting with "0x" (e.g., "0x$") is invalid} { catch {unset a} set a(VALUE) ff15 set i 123 if {[expr 0x$a(VALUE)] & 16} { set i {} } set i } {} test compExpr-old-16.2 {GetToken: check for string literal in braces} { expr {{1}} } {1} # Check "expr" and computed command names. test compExpr-old-17.1 {expr and computed command names} { set i 0 set z expr $z 1+2 } 3 # Check correct conversion of operands to numbers: If the string looks like # an integer, convert to integer. Otherwise, if the string looks like a # double, convert to double. test compExpr-old-18.1 {expr and conversion of operands to numbers} { set x [lindex 11 0] catch {expr int($x)} expr {$x} } 11 # Check "expr" and interpreter result object resetting before appending # an error msg during evaluation of exprs not in {}s test compExpr-old-19.1 {expr and interpreter result object resetting} { proc p {} { set t 10.0 set x 2.0 set dx 0.2 set f {$dx-$x/10} set g {-$x/5} set center 1.0 set x [expr $x-$center] set dx [expr $dx+$g] set x [expr $x+$f+$center] set x [expr $x+$f+$center] set y [expr round($x)] } p } 3 # cleanup if {[info exists a]} { unset a } ::tcltest::cleanupTests return tcl9.0.3/tests/cmdMZ.test0000644000175000017500000004760415104661341014637 0ustar sergeisergei# The tests in this file cover the procedures in tclCmdMZ.c. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint noappverifier [expr { [llength [info commands testappverifierpresent]] == 0 || ![testappverifierpresent]}] namespace eval ::tcl::test::cmdMZ { namespace import ::tcltest::cleanupTests namespace import ::tcltest::customMatch namespace import ::tcltest::makeFile namespace import ::tcltest::removeFile namespace import ::tcltest::temporaryDirectory namespace import ::tcltest::testConstraint namespace import ::tcltest::test testConstraint memory [llength [info commands memory]] proc ListGlobMatch {expected actual} { if {[llength $expected] != [llength $actual]} { return 0 } foreach e $expected a $actual { if {![string match $e $a]} { return 0 } } return 1 } customMatch listGlob [namespace which ListGlobMatch] # Tcl_PwdObjCmd test cmdMZ-1.1 {Tcl_PwdObjCmd} -returnCodes error -body { pwd a } -result {wrong # args: should be "pwd"} test cmdMZ-1.2 {Tcl_PwdObjCmd: simple pwd} { catch pwd } 0 test cmdMZ-1.3 {Tcl_PwdObjCmd: simple pwd} -body { pwd } -match glob -result {?*} test cmdMZ-1.4 {Tcl_PwdObjCmd: failure} -setup { set cwd [pwd] set foodir [file join [temporaryDirectory] foo] file delete -force $foodir file mkdir $foodir cd $foodir } -constraints {unix nonPortable} -body { # This test fails on various Unix platforms (eg Linux) where permissions # caching causes this to fail. The caching is strictly incorrect, but we # have no control over that. file attr . -permissions 0 pwd } -returnCodes error -cleanup { cd $cwd file delete -force $foodir } -result {error getting working directory name: permission denied} # The tests for Tcl_RegexpObjCmd, Tcl_RegsubObjCmd are in regexp.test # Tcl_RenameObjCmd test cmdMZ-2.1 {Tcl_RenameObjCmd: error conditions} -returnCodes error -body { rename r1 } -result {wrong # args: should be "rename oldName newName"} test cmdMZ-2.2 {Tcl_RenameObjCmd: error conditions} -returnCodes error -body { rename r1 r2 r3 } -result {wrong # args: should be "rename oldName newName"} test cmdMZ-2.3 {Tcl_RenameObjCmd: success} -setup { catch {rename r2 {}} } -body { proc r1 {} {return "r1"} rename r1 r2 r2 } -result {r1} test cmdMZ-2.4 {Tcl_RenameObjCmd: success} { proc r1 {} {return "r1"} rename r1 {} list [catch {r1} msg] $msg } {1 {invalid command name "r1"}} # Some tests for Tcl_ReturnObjCmd are in proc-old.test test cmdMZ-return-1.0 {return checks for bad option values} -body { return -options foo } -returnCodes error -match glob -result {bad -options value:*} test cmdMZ-return-1.1 {return checks for bad option values} -body { return -code err } -returnCodes error -match glob -result {bad completion code "err": must be ok, error, return, break, continue*, or an integer} test cmdMZ-return-1.2 {return checks for bad option values} -body { return -code 0x100000000 } -returnCodes error -match glob -result {bad completion code "0x100000000": must be ok, error, return, break, continue*, or an integer} test cmdMZ-return-1.3 {return checks for bad option values} -body { return -level foo } -returnCodes error -match glob -result {bad -level value: *} test cmdMZ-return-1.4 {return checks for bad option values} -body { return -level -1 } -returnCodes error -match glob -result {bad -level value: *} test cmdMZ-return-1.5 {return checks for bad option values} -body { return -level 3.1415926 } -returnCodes error -match glob -result {bad -level value: *} proc dictSort {d} { set result {} foreach k [lsort [dict keys $d]] { dict set result $k [dict get $d $k] } return $result } test cmdMZ-return-2.0 {return option handling} { list [catch return -> foo] [dictSort $foo] } {2 {-code 0 -level 1}} test cmdMZ-return-2.1 {return option handling} { list [catch {return -bar soom} -> foo] [dictSort $foo] } {2 {-bar soom -code 0 -level 1}} test cmdMZ-return-2.2 {return option handling} { list [catch {return -code return} -> foo] [dictSort $foo] } {2 {-code 0 -level 2}} test cmdMZ-return-2.3 {return option handling} { list [catch {return -code return -level 10} -> foo] [dictSort $foo] } {2 {-code 0 -level 11}} test cmdMZ-return-2.4 {return option handling} -body { return -level 0 -code error } -returnCodes error -result {} test cmdMZ-return-2.5 {return option handling} -body { return -level 0 -code return } -returnCodes return -result {} test cmdMZ-return-2.6 {return option handling} -body { return -level 0 -code break } -returnCodes break -result {} test cmdMZ-return-2.7 {return option handling} -body { return -level 0 -code continue } -returnCodes continue -result {} test cmdMZ-return-2.8 {return option handling} -body { return -level 0 -code -1 } -returnCodes -1 -result {} test cmdMZ-return-2.9 {return option handling} -body { return -level 0 -code 10 } -returnCodes 10 -result {} test cmdMZ-return-2.10 {return option handling} -body { list [catch {return -level 0 -code error} -> foo] [dictSort $foo] } -match glob -result {1 {-code 1 -errorcode NONE -errorinfo { while executing "return -level 0 -code error"} -errorline 1 -errorstack * -level 0}} test cmdMZ-return-2.11 {return option handling} { list [catch {return -level 0 -code break} -> foo] [dictSort $foo] } {3 {-code 3 -level 0}} test cmdMZ-return-2.12 {return option handling} -body { return -level 0 -code error -options {-code ok} } -result {} test cmdMZ-return-2.13 {return option handling} -body { return -level 0 -code error -options {-code err} } -returnCodes error -match glob -result {bad completion code "err": must be ok, error, return, break, continue*, or an integer} test cmdMZ-return-2.14 {return option handling} -body { return -level 0 -code error -options {-code foo -options {-code break}} } -returnCodes break -result {} test cmdMZ-return-2.15 {return opton handling} { list [catch { apply {{} { return -code error -errorcode {a b} c }} } result] $result $::errorCode } {1 c {a b}} test cmdMZ-return-2.16 {return opton handling} { list [catch { apply {{} { return -code error -errorcode [list a b] c }} } result] $result $::errorCode } {1 c {a b}} test cmdMZ-return-2.17 {return opton handling} { list [catch { apply {{} { return -code error -errorcode a\ b c }} } result] $result $::errorCode } {1 c {a b}} test cmdMZ-return-2.18 {return option handling} { list [catch { return -code error -errorstack [list CALL a CALL b] yo } -> foo] [dictSort $foo] [info errorstack] } {2 {-code 1 -errorcode NONE -errorstack {CALL a CALL b} -level 1} {CALL a CALL b}} test cmdMZ-return-2.19 {return option handling} -body { return -level 0 -options {-options {-code break} -code continue} } -returnCodes continue -result {} test cmdMZ-return-2.20 {return option handling} { list [catch { return -level 0 -options {-foo 1} -options {-bar 2} } -> foo] $foo } {0 {-foo 1 -bar 2 -code 0 -level 0}} test cmdMZ-return-2.21 {return option handling} { list [catch { return -level 0 -options {-options {-foo 1} -options {-bar 2}} } -> foo] $foo } {0 {-foo 1 -bar 2 -code 0 -level 0}} # Check that the result of a [return -options $opts $result] is # indistinguishable from that of the originally caught script, no matter what # the script is/does. (TIP 90) foreach {testid script} { cmdMZ-return-3.0 {} cmdMZ-return-3.1 {format x} cmdMZ-return-3.2 {set} cmdMZ-return-3.3 {set a 1} cmdMZ-return-3.4 {error} cmdMZ-return-3.5 {error foo} cmdMZ-return-3.6 {error foo bar} cmdMZ-return-3.7 {error foo bar baz} cmdMZ-return-3.8 {return -level 0} cmdMZ-return-3.9 {return -code error} cmdMZ-return-3.10 {return -code error -errorinfo foo} cmdMZ-return-3.11 {return -code error -errorinfo foo -errorcode bar} cmdMZ-return-3.12 {return -code error -errorinfo foo -errorcode bar -errorline 10} cmdMZ-return-3.12.1 {return -code error -errorinfo foo -errorcode bar -errorline 10 -errorstack baz} cmdMZ-return-3.13 {return -options {x y z 2}} cmdMZ-return-3.14 {return -level 3 -code break sdf} } { test $testid "check that return after a catch is same:\n$script" { set one [list [catch $script foo bar] $foo [dictSort $bar] \ $::errorCode $::errorInfo] set two [list [catch {return -options $bar $foo} foo2 bar2] \ $foo2 [dictSort $bar2] $::errorCode $::errorInfo] string equal $one $two } 1 } # The tests for Tcl_ScanObjCmd are in scan.test # Tcl_SourceObjCmd # More tests of Tcl_SourceObjCmd are in source.test test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} -constraints { unixOrWin } -returnCodes error -body { source } -match glob -result {wrong # args: should be "source*fileName"} test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} -constraints { unixOrWin } -returnCodes error -body { source a b c d e f } -match glob -result {wrong # args: should be "source*fileName"} test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body { set file [makeFile { set x 146 error "error in sourced file" set y $x } source.file] list [catch {source $file} msg] $msg $::errorInfo } -cleanup { removeFile source.file } -match listGlob -result {1 {error in sourced file} {error in sourced file while executing "error "error in sourced file"" (file "*" line 3) invoked from within "source $file"}} test cmdMZ-3.6 {Tcl_SourceObjCmd: simple script} -body { set file [makeFile {list ok} source.file] source $file } -cleanup { removeFile source.file } -result ok # Tcl_SplitObjCmd test cmdMZ-4.1 {Tcl_SplitObjCmd: split errors} -returnCodes error -body { split } -result {wrong # args: should be "split string ?splitChars?"} test cmdMZ-4.2 {Tcl_SplitObjCmd: split errors} -returnCodes error -body { split a b c } -result {wrong # args: should be "split string ?splitChars?"} test cmdMZ-4.3 {Tcl_SplitObjCmd: basic split commands} { split "a\n b\t\r c\n " } {a {} b {} {} c {} {}} test cmdMZ-4.4 {Tcl_SplitObjCmd: basic split commands} { split "word 1xyzword 2zword 3" xyz } {{word 1} {} {} {word 2} {word 3}} test cmdMZ-4.5 {Tcl_SplitObjCmd: basic split commands} { split "12345" {} } {1 2 3 4 5} test cmdMZ-4.6 {Tcl_SplitObjCmd: basic split commands} { split "a\}b\[c\{\]\$" } "a\\\}b\\\[c\\\{\\\]\\\$" test cmdMZ-4.7 {Tcl_SplitObjCmd: basic split commands} { split {} {} } {} test cmdMZ-4.8 {Tcl_SplitObjCmd: basic split commands} { split {} } {} test cmdMZ-4.9 {Tcl_SplitObjCmd: basic split commands} { split { } } {{} {} {} {}} test cmdMZ-4.10 {Tcl_SplitObjCmd: basic split commands} { apply {{} { set x {} foreach f [split {]\n} {}] { append x $f } return $x }} } {]\n} test cmdMZ-4.11 {Tcl_SplitObjCmd: basic split commands} { apply {{} { set x ab\x00c set y [split $x {}] binary scan $y c* z return $z }} } {97 32 98 32 0 32 99} test cmdMZ-4.12 {Tcl_SplitObjCmd: basic split commands} { split "a0ab1b2bbb3\x00c4" ab\x00c } {{} 0 {} 1 2 {} {} 3 {} 4} test cmdMZ-4.13 {Tcl_SplitObjCmd: basic split commands} { # if not UTF-8 aware, result is "a {} {} b qwå {} N wq" split "a乎b qw幎N wq" " 乎" } "a b qw幎N wq" # The tests for Tcl_StringObjCmd are in string.test # The tests for Tcl_SubstObjCmd are in subst.test # The tests for Tcl_SwitchObjCmd are in switch.test # todo: rewrite this if monotonic clock is provided resp. command "after" # gets microsecond accuracy (RFE [fdfbd5e10] gets merged): proc _nrt_sleep {msec} { set stime [clock microseconds] set usec [expr {$msec * 1000}] set etime [expr {$stime + $usec}] while {[set tm [clock microseconds]] < $etime} { # don't use after 0 unless it's NRT-capable, so yes - busy-wait (but it's more precise): # after 0 if {$tm < $stime} { # avoid too long delays by backwards time jumps, simply skip test tcltest::Skip "time-jump?" } } } _nrt_sleep 0; # warm up (clock, compile, etc) test cmdMZ-5.1 {Tcl_TimeObjCmd: basic format of command} -body { time } -returnCodes error -result {wrong # args: should be "time command ?count?"} test cmdMZ-5.2 {Tcl_TimeObjCmd: basic format of command} -body { time a b c } -returnCodes error -result {wrong # args: should be "time command ?count?"} test cmdMZ-5.3 {Tcl_TimeObjCmd: basic format of command} -body { time a b } -returnCodes error -result {expected integer but got "b"} test cmdMZ-5.4 {Tcl_TimeObjCmd: nothing happens with negative iteration counts} { time bogusCmd -12456 } {0 microseconds per iteration} test cmdMZ-5.5 {Tcl_TimeObjCmd: result format} -body { time {format 1} } -match regexp -result {^\d+ microseconds per iteration} test cmdMZ-5.6 {Tcl_TimeObjCmd: slower commands take longer} -body { set m1 [lindex [time {_nrt_sleep 0.01}] 0] set m2 [lindex [time {_nrt_sleep 10.0}] 0] list \ [expr {$m1 < $m2}] \ $m1 $m2; # interesting only in error case. } -match glob -result [list 1 *] test cmdMZ-5.7 {Tcl_TimeObjCmd: errors generate right trace} { list [catch {time {error foo}} msg] $msg $::errorInfo } {1 foo {foo while executing "error foo" invoked from within "time {error foo}"}} test cmdMZ-5.7.1 {Tcl_TimeObjCmd: return from time} { set x 0 proc r1 {} {upvar x x; time {incr x; return "r1"; incr x} 10} list [r1] $x } {r1 1} test cmdMZ-5.8 {Tcl_TimeObjCmd: done optimization: nested call of self inside time (if compiled)} { set x [set y 0] set m1 { if {[incr x] <= 5} { # nested call should return result, so covering that: if {![string is integer -strict [eval $m1]]} {error unexpected} } # increase again (no "continue" from nested call): incr x } time {incr y; eval $m1} 5 list $y $x } {5 20} test cmdMZ-6.1 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate} msg] $msg } {1 {wrong # args: should be "timerate ?-direct? ?-calibrate? ?-overhead double? command ?time ?max-count??"}} test cmdMZ-6.2.1 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate a b c d} msg] $msg } {1 {wrong # args: should be "timerate ?-direct? ?-calibrate? ?-overhead double? command ?time ?max-count??"}} test cmdMZ-6.2.2 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate a b c} msg] $msg } {1 {expected integer but got "b"}} test cmdMZ-6.2.3 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate a b} msg] $msg } {1 {expected integer but got "b"}} test cmdMZ-6.3 {Tcl_TimeRateObjCmd: basic format of command} { list [catch {timerate -overhead b {} a b} msg] $msg } {1 {expected floating-point number but got "b"}} test cmdMZ-6.4 {Tcl_TimeRateObjCmd: compile of script happens even with negative iteration counts} { list [catch {timerate "foreach a {c d e} \{" -12456} msg] $msg } {1 {missing close-brace}} test cmdMZ-6.5a {Tcl_TimeRateObjCmd: result format and one iteration} { regexp {^\d+(?:\.\d+)? \ws/# 1 # \d+(?:\.\d+)? #/sec \d+(?:\.\d+)? net-ms$} [timerate {} 0] } 1 test cmdMZ-6.5b {Tcl_TimeRateObjCmd: result format without iterations} { regexp {^0 \ws/# 0 # 0 #/sec 0 net-ms$} [timerate {} 0 0] } 1 test cmdMZ-6.6 { Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measurement } -constraints noappverifier -body { set m1 [timerate {_nrt_sleep 0.01} 50] set m2 [timerate {_nrt_sleep 1.00} 50] if {[testConstraint valgrind] && ([lindex $m1 0] >= 100 || [lindex $m1 2] <= 500)} { tcltest::Skip "too-slow-by-valgrind" } list [list \ [expr {[lindex $m1 0] < [lindex $m2 0]}] \ [expr {[lindex $m1 0] < 100}] \ [expr {[lindex $m2 0] > 100}] \ [expr {[lindex $m1 2] > 500}] \ [expr {[lindex $m2 2] < 500}] \ [expr {[lindex $m1 4] > 10000}] \ [expr {[lindex $m2 4] < 10000}] \ [expr {[lindex $m1 6] > 5 && [lindex $m1 6] < 100}] \ [expr {[lindex $m2 6] > 5 && [lindex $m2 6] < 100}] \ ] $m1 $m2; # interesting only in error case. } -match glob -result [list [lrepeat 9 1] *] test cmdMZ-6.7 {Tcl_TimeRateObjCmd: errors generate right trace} { list [catch {timerate {error foo} 1} msg] $msg $::errorInfo } {1 foo {foo while executing "error foo" invoked from within "timerate {error foo} 1"}} test cmdMZ-6.7.1 {Tcl_TimeRateObjCmd: return from timerate} { set x 0 proc r1 {} {upvar x x; timerate {incr x; return "r1"; incr x} 1000 10} list [r1] $x } {r1 1} test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} -body { set m1 [timerate {break}] list [list \ [expr {[lindex $m1 0] < 1000}] \ [expr {[lindex $m1 2] == 1}] \ [expr {[lindex $m1 4] > 1000}] \ [expr {[lindex $m1 6] < 10}] \ ] $m1; # interesting only in error case. } -match glob -result [list {1 1 1 1} *] test cmdMZ-6.8.1 {Tcl_TimeRateObjCmd: allow (conditional) continue in timerate} -body { set m1 [timerate {continue; return -code error "unexpected"} 1000 10] list [list \ [expr {[lindex $m1 0] < 1000}] \ [expr {[lindex $m1 2] == 10}] \ [expr {[lindex $m1 4] > 1000}] \ [expr {[lindex $m1 6] < 100}] \ ] $m1; # interesting only in error case. } -match glob -result [list {1 1 1 1} *] test cmdMZ-6.9 {Tcl_TimeRateObjCmd: max count of iterations} { set m1 [timerate {} 1000 5]; # max-count wins set m2 [timerate {_nrt_sleep 20} 1 5]; # max-time wins list [lindex $m1 2] [lindex $m2 2] } {5 1} test cmdMZ-6.10 {Tcl_TimeRateObjCmd: huge overhead cause 0us result} -body { set m1 [timerate -overhead 1e6 {_nrt_sleep 10} 100 1] list [list \ [expr {[lindex $m1 0] == 0.0}] \ [expr {[lindex $m1 2] == 1}] \ [expr {[lindex $m1 4] == 1000000}] \ [expr {[lindex $m1 6] <= 0.001}] \ ] $m1; # interesting only in error case. } -match glob -result [list {1 1 1 1} *] test cmdMZ-6.11 {Tcl_TimeRateObjCmd: done/continue optimization rollback} { set m1 {set m2 ok} if 1 $m1 timerate $m1 1000 10 if 1 $m1; # if rollback is missing throws an error: invoked "continue" outside of a loop } ok test cmdMZ-6.12 {Tcl_TimeRateObjCmd: done optimization: nested call of self inside timerate} { set x 0 set m1 { if {[incr x] <= 5} { # nested call should return result, so covering that: if {![string is integer -strict [eval $m1]]} {error unexpected} } # increase again (no "continue" from nested call): incr x } list [lindex [timerate $m1 1000 5] 2] $x } {5 20} test cmdMZ-6.13 {Tcl_TimeRateObjCmd: stability by O(n**2), avoid long execution time on growing iteration time} {!memory} { # don't run this test on memory-debug builds - it seems to be very time-consuming there, # what may led to an unexpectedly high increase by such complexity and it'd fail... set result {} # test the function with quadratic complexity (iteration growth 2x, 10x, 100x): foreach e {2 10 100} { set x 1 set m1 [timerate { apply {x { while {[incr x -1]} {} }} [set x [expr {$x*$e}]] } 50] lappend result "${e}x" # check it was too slow (it is OK to use factor 10 to prevent sporadic # errors on some slow systems or timing issues, because if it is not fixed, # the execution time may grow hundreds and thousand times): if {[lindex $m1 6] > 50 * 10} { lappend result "unexpected long: $m1" } } set result } {2x 10x 100x} test cmdMZ-try-1.0 { fix for issue 45b9faf103f2 [try] interaction with local variable names produces segmentation violation } -body { ::apply {{} { set cmd try $cmd { lindex 5 } on ok res {} set res }} } -result 5 # The tests for Tcl_WhileObjCmd are in while.test # cleanup cleanupTests } namespace delete ::tcl::test::cmdMZ return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/cmdInfo.test0000644000175000017500000000713415104661341015176 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for Tcl_GetCommandInfo, # Tcl_SetCommandInfo, Tcl_CreateCommand, Tcl_DeleteCommand, and # Tcl_NameOfCommand. Sourcing this file into Tcl runs the tests # and generates output for errors. No output means no errors were # found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testcmdinfo [llength [info commands testcmdinfo]] testConstraint testcmdtoken [llength [info commands testcmdtoken]] test cmdinfo-1.1 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 testcmdinfo get x1 } {CmdProc1 original CmdDelProc1 original :: stringProc} test cmdinfo-1.2 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 x1 } {CmdProc1 original} test cmdinfo-1.3 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 testcmdinfo get x1 } {CmdProc2 new_command_data CmdDelProc2 new_delete_data :: stringProc} test cmdinfo-1.4 {command procedure and clientData} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 x1 } {CmdProc2 new_command_data} test cmdinfo-2.1 {command deletion callbacks} {testcmdinfo} { testcmdinfo create x1 testcmdinfo delete x1 } {CmdDelProc1 original} test cmdinfo-2.2 {command deletion callbacks} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 testcmdinfo delete x1 } {CmdDelProc2 new_delete_data} test cmdinfo-3.1 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} { testcmdinfo get non_existent } {??} test cmdinfo-3.2 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} { testcmdinfo create x1 testcmdinfo modify x1 } 1 test cmdinfo-3.3 {Tcl_Get/SetCommandInfo return values} {testcmdinfo} { testcmdinfo modify non_existent } 0 test cmdinfo-4.1 {Tcl_GetCommandName/Tcl_GetCommandFullName procedures} \ {testcmdtoken} { set x [testcmdtoken create x1] rename x1 newName set y [testcmdtoken name $x] rename newName x1 lappend y {*}[testcmdtoken name $x] } {newName ::newName x1 ::x1} catch {rename newTestCmd {}} catch {rename newTestCmd2 {}} test cmdinfo-5.1 {Names for commands created when inside namespaces} \ {testcmdtoken} { # create namespace cmdInfoNs1 namespace eval cmdInfoNs1 {} ;# creates namespace cmdInfoNs1 # create namespace cmdInfoNs1::cmdInfoNs2 and execute a script in it set x [namespace eval cmdInfoNs1::cmdInfoNs2 { # the following creates a cmd in the global namespace testcmdtoken create testCmd }] set y [testcmdtoken name $x] rename ::testCmd newTestCmd lappend y {*}[testcmdtoken name $x] } {testCmd ::testCmd newTestCmd ::newTestCmd} test cmdinfo-6.1 {Names for commands created when outside namespaces} \ {testcmdtoken} { set x [testcmdtoken create cmdInfoNs1::cmdInfoNs2::testCmd] set y [testcmdtoken name $x] rename cmdInfoNs1::cmdInfoNs2::testCmd newTestCmd2 lappend y {*}[testcmdtoken name $x] } {testCmd ::cmdInfoNs1::cmdInfoNs2::testCmd newTestCmd2 ::newTestCmd2} # cleanup catch {namespace delete cmdInfoNs1::cmdInfoNs2 cmdInfoNs1} catch {rename x1 ""} cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/cmdIL.test0000644000175000017500000007616515104661341014621 0ustar sergeisergei# This file contains a collection of tests for the procedures in the file # tclCmdIL.c. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] proc memusage {} { set fd [open /proc/[pid]/statm] set line [gets $fd] if {[llength $line] != 7} { error "Unexpected /proc/pid/statm format" } set result [lindex $line 5] close $fd return $result } testConstraint hasMemUsage [expr {![catch {memusage}]}] testConstraint testobj [llength [info commands testobj]] source [file join [file dirname [info script]] internals.tcl] namespace import -force ::tcltest::internals::* test cmdIL-1.1 {Tcl_LsortObjCmd procedure} -returnCodes error -body { lsort } -result {wrong # args: should be "lsort ?-option value ...? list"} test cmdIL-1.2 {Tcl_LsortObjCmd procedure} -returnCodes error -body { lsort -foo {1 3 2 5} } -result {bad option "-foo": must be -ascii, -command, -decreasing, -dictionary, -increasing, -index, -indices, -integer, -nocase, -real, -stride, or -unique} test cmdIL-1.3 {Tcl_LsortObjCmd procedure, default options} { lsort {d e c b a \{ d35 d300} } {a b c d d300 d35 e \{} test cmdIL-1.4 {Tcl_LsortObjCmd procedure, -ascii option} { lsort -integer -ascii {d e c b a d35 d300} } {a b c d d300 d35 e} test cmdIL-1.5 {Tcl_LsortObjCmd procedure, -command option} -body { lsort -command {1 3 2 5} } -returnCodes error -result {"-command" option must be followed by comparison command} test cmdIL-1.6 {Tcl_LsortObjCmd procedure, -command option} -setup { proc cmp {a b} { expr {[string match x* $b] - [string match x* $a]} } } -body { lsort -command cmp {x1 abc x2 def x3 x4} } -result {x1 x2 x3 x4 abc def} -cleanup { rename cmp "" } test cmdIL-1.7 {Tcl_LsortObjCmd procedure, -decreasing option} { lsort -decreasing {d e c b a d35 d300} } {e d35 d300 d c b a} test cmdIL-1.8 {Tcl_LsortObjCmd procedure, -dictionary option} { lsort -dictionary {d e c b a d35 d300} } {a b c d d35 d300 e} test cmdIL-1.9 {Tcl_LsortObjCmd procedure, -dictionary option} { lsort -dictionary {1k 0k 10k} } {0k 1k 10k} test cmdIL-1.10 {Tcl_LsortObjCmd procedure, -increasing option} { lsort -decreasing -increasing {d e c b a d35 d300} } {a b c d d300 d35 e} test cmdIL-1.11 {Tcl_LsortObjCmd procedure, -index option} -body { lsort -index {1 3 2 5} } -returnCodes error -result {"-index" option must be followed by list index} test cmdIL-1.12 {Tcl_LsortObjCmd procedure, -index option} -body { lsort -index foo {1 3 2 5} } -returnCodes error -result {bad index "foo": must be integer?[+-]integer? or end?[+-]integer?} test cmdIL-1.13 {Tcl_LsortObjCmd procedure, -index option} { lsort -index end -integer {{2 25} {10 20 50 100} {3 16 42} 1} } {1 {2 25} {3 16 42} {10 20 50 100}} test cmdIL-1.14 {Tcl_LsortObjCmd procedure, -index option} { lsort -index 1 -integer {{1 25 100} {3 16 42} {10 20 50}} } {{3 16 42} {10 20 50} {1 25 100}} test cmdIL-1.15 {Tcl_LsortObjCmd procedure, -integer option} { lsort -integer {24 6 300 18} } {6 18 24 300} test cmdIL-1.16 {Tcl_LsortObjCmd procedure, -integer option} -body { lsort -integer {1 3 2.4} } -returnCodes error -result {expected integer but got "2.4"} test cmdIL-1.17 {Tcl_LsortObjCmd procedure, -real option} { lsort -real {24.2 6e3 150e-1} } {150e-1 24.2 6e3} test cmdIL-1.18 {Tcl_LsortObjCmd procedure, bogus list} -body { lsort "1 2 3 \{ 4" } -returnCodes error -result {unmatched open brace in list} test cmdIL-1.19 {Tcl_LsortObjCmd procedure, empty list} { lsort {} } {} test cmdIL-1.22 {Tcl_LsortObjCmd procedure, unique sort} { lsort -integer -unique {3 1 2 3 1 4 3} } {1 2 3 4} test cmdIL-1.23 {Tcl_LsortObjCmd procedure, unique sort with index} { # lsort -unique should return the last unique item lsort -unique -index 0 {{a b} {c b} {a c} {d a}} } {{a c} {c b} {d a}} test cmdIL-1.24 {Tcl_LsortObjCmd procedure, order of -index and -command} -setup { catch {rename 1 ""} proc testcmp {a b} {return [string compare $a $b]} } -body { set l [list [list a b] [list c d]] lsort -command testcmp -index 1 $l } -cleanup { rename testcmp "" } -result [list [list a b] [list c d]] test cmdIL-1.25 {Tcl_LsortObjCmd procedure, order of -index and -command} -setup { catch {rename 1 ""} proc testcmp {a b} {return [string compare $a $b]} } -body { set l [list [list a b] [list c d]] lsort -index 1 -command testcmp $l } -cleanup { rename testcmp "" } -result [list [list a b] [list c d]] # Note that the required order only exists in the end-1'th element; indexing # using the end element or any fixed offset from the start will not work... test cmdIL-1.26 {Tcl_LsortObjCmd procedure, offset indexing from end} { lsort -index end-1 {{a 1 e i} {b 2 3 f g} {c 4 5 6 d h}} } {{c 4 5 6 d h} {a 1 e i} {b 2 3 f g}} test cmdIL-1.27 {Tcl_LsortObjCmd procedure, returning indices} { lsort -indices {a c b} } {0 2 1} test cmdIL-1.28 {Tcl_LsortObjCmd procedure, returning indices} { lsort -indices -unique -decreasing -real {1.2 34.5 34.5 5.6} } {2 3 0} test cmdIL-1.29 {Tcl_LsortObjCmd procedure, loss of list rep during sorting} { set l {1 2 3} string length [lsort -command {apply {args {string length $::l}}} $l] } 5 test cmdIL-1.30 {Tcl_LsortObjCmd procedure, -stride option} { lsort -stride 2 {f e d c b a} } {b a d c f e} test cmdIL-1.31 {Tcl_LsortObjCmd procedure, -stride option} { lsort -stride 3 {f e d c b a} } {c b a f e d} test cmdIL-1.32 {lsort -stride errors} -returnCodes error -body { lsort -stride foo bar } -result {expected integer but got "foo"} test cmdIL-1.33 {lsort -stride errors} -returnCodes error -body { lsort -stride 1 bar } -result {stride length must be at least 2} test cmdIL-1.34 {lsort -stride errors} -returnCodes error -body { lsort -stride 2 {a b c} } -result {list size must be a multiple of the stride length} test cmdIL-1.35 {lsort -stride errors} -returnCodes error -body { lsort -stride 2 -index 3 {a b c d} } -result {when used with "-stride", the leading "-index" value must be within the group} test cmdIL-1.36 {lsort -stride and -index: Bug 2918962} { lsort -stride 2 -index {0 1} { {{c o d e} 54321} {{b l a h} 94729} {{b i g} 12345} {{d e m o} 34512} } } {{{b i g} 12345} {{d e m o} 34512} {{c o d e} 54321} {{b l a h} 94729}} test cmdIL-1.37 {Tcl_LsortObjCmd procedure, Bug 8e1e31eac0fd6b6c} { lsort -ascii [list \x00 \x7F \x80 \uFFFF] } [list \x00 \x7F \x80 \uFFFF] test cmdIL-1.38 {Tcl_LsortObjCmd procedure, Bug 8e1e31eac0fd6b6c} { lsort -ascii -nocase [list \x00 \x7F \x80 \uFFFF] } [list \x00 \x7F \x80 \uFFFF] test cmdIL-1.39 {Tcl_LsortObjCmd procedure, Bug 8e1e31eac0fd6b6c} { lsort -ascii [list \x00 \x7F \x80 \U01ffff \uFFFF] } [list \x00 \x7F \x80 \uFFFF \U01ffff] test cmdIL-1.40 {Tcl_LsortObjCmd procedure, Bug 8e1e31eac0fd6b6c} { lsort -ascii -nocase [list \x00 \x7F \x80 \U01ffff \uFFFF] } [list \x00 \x7F \x80 \uFFFF \U01FFFF] test cmdIL-1.41 {lsort -stride and -index} -body { lsort -stride 2 -index -2 {a 2 b 1} } -returnCodes error -result {index "-2" out of range} test cmdIL-1.42 {lsort -stride and-index} -body { lsort -stride 2 -index -1-1 {a 2 b 1} } -returnCodes error -result {index "-1-1" out of range} test cmdIL-1.43 {lsort -stride errors} -returnCodes error -body { lsort -stride 4294967296 bar } -result {list size must be a multiple of the stride length} # Can't think of any good tests for the MergeSort and MergeLists procedures, # except a bunch of random lists to sort. test cmdIL-2.1 {MergeSort and MergeLists procedures} -setup { set result {} set r 1435753299 proc rand {} { global r set r [expr {(16807 * $r) % (0x7FFFFFFF)}] } } -body { for {set i 0} {$i < 150} {incr i} { set x {} for {set j 0} {$j < $i} {incr j} { lappend x [expr {[rand] & 0xfff}] } set y [lsort -integer $x] set old -1 foreach el $y { if {$el < $old} { append result "list {$x} sorted to {$y}, element $el out of order\n" break } set old $el } } string trim $result } -cleanup { rename rand "" } -result {} test cmdIL-3.1 {SortCompare procedure, skip comparisons after error} -body { set ::x 0 list [catch { lsort -integer -command {apply {{a b} { incr ::x error "error #$::x" }}} {48 6 28 190 16 2 3 6 1} } msg] $msg $::x } -result {1 {error #1} 1} test cmdIL-3.2 {SortCompare procedure, -index option} -body { lsort -integer -index 2 "\\\{ {30 40 50}" } -returnCodes error -result {unmatched open brace in list} test cmdIL-3.3 {SortCompare procedure, -index option} -body { lsort -integer -index 2 {{20 10} {15 30 40}} } -returnCodes error -result {element 2 missing from sublist "20 10"} test cmdIL-3.4 {SortCompare procedure, -index option} -body { lsort -integer -index 2 "{a b c} \\\{" } -returnCodes error -result {expected integer but got "c"} test cmdIL-3.4.1 {SortCompare procedure, -index option} -body { lsort -integer -index 2 "{1 2 3} \\\{" } -returnCodes error -result {unmatched open brace in list} test cmdIL-3.5 {SortCompare procedure, -index option} -body { lsort -integer -index 2 {{20 10 13} {15}} } -returnCodes error -result {element 2 missing from sublist "15"} test cmdIL-3.5.1 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index 1+3 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {element 4 missing from sublist "1 . c"} test cmdIL-3.5.2 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index -1-1 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {index "-1-1" out of range} test cmdIL-3.5.3 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index -2 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {index "-2" out of range} test cmdIL-3.5.4 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end-4 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {element end-4 missing from sublist "1 . c"} test cmdIL-3.5.5 {SortCompare procedure, -index option} { lsort -index {} {a b} } {a b} test cmdIL-3.5.6 {SortCompare procedure, -index option} { lsort -index {} [list a \{] } {a \{} test cmdIL-3.5.7 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end--1 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {index "end--1" out of range} test cmdIL-3.5.8 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end+1 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {index "end+1" out of range} test cmdIL-3.5.9 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end+2 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {index "end+2" out of range} test cmdIL-3.5.10 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index 0 {{}} } -returnCodes error -result {element 0 missing from sublist ""} test cmdIL-3.6 {SortCompare procedure, -index option} { lsort -integer -index 2 {{1 15 30} {2 5 25} {3 25 20}} } {{3 25 20} {2 5 25} {1 15 30}} test cmdIL-3.7 {SortCompare procedure, -ascii option} { lsort -ascii {d e c b a d35 d300 100 20} } {100 20 a b c d d300 d35 e} test cmdIL-3.8 {SortCompare procedure, -dictionary option} { lsort -dictionary {d e c b a d35 d300 100 20} } {20 100 a b c d d35 d300 e} test cmdIL-3.9 {SortCompare procedure, -integer option} -body { lsort -integer {x 3} } -returnCodes error -result {expected integer but got "x"} test cmdIL-3.10 {SortCompare procedure, -integer option} -body { lsort -integer {3 q} } -returnCodes error -result {expected integer but got "q"} test cmdIL-3.11 {SortCompare procedure, -integer option} { lsort -integer {35 21 0x20 0d30 0o23 100 8} } {8 0o23 21 0d30 0x20 35 100} test cmdIL-3.12 {SortCompare procedure, -real option} -body { lsort -real {6...4 3} } -returnCodes error -result {expected floating-point number but got "6...4"} test cmdIL-3.13 {SortCompare procedure, -real option} -body { lsort -real {3 1x7} } -returnCodes error -result {expected floating-point number but got "1x7"} test cmdIL-3.14 {SortCompare procedure, -real option} { lsort -real {24 2.5e01 16.7 85e-1 10.004} } {85e-1 10.004 16.7 24 2.5e01} test cmdIL-3.15 {SortCompare procedure, -command option} -body { proc cmp {a b} { error "comparison error" } list [catch {lsort -command cmp {48 6}} msg] $msg $::errorInfo } -cleanup { rename cmp "" } -result {1 {comparison error} {comparison error while executing "error "comparison error"" (procedure "cmp" line 2) invoked from within "cmp 48 6" (-compare command) invoked from within "lsort -command cmp {48 6}"}} test cmdIL-3.16 {SortCompare procedure, -command option, long command} -body { proc cmp {dummy a b} { string compare $a $b } lsort -command {cmp {this argument is very very long in order to make the dstring overflow its statically allocated space}} {{this first element is also long in order to help expand the dstring} {the second element, last but not least, is quite long also, in order to make absolutely sure that space is allocated dynamically for the dstring}} } -cleanup { rename cmp "" } -result {{the second element, last but not least, is quite long also, in order to make absolutely sure that space is allocated dynamically for the dstring} {this first element is also long in order to help expand the dstring}} test cmdIL-3.17 {SortCompare procedure, -command option, non-integer result} -body { proc cmp {a b} { return foow } lsort -command cmp {48 6} } -returnCodes error -cleanup { rename cmp "" } -result {-compare command returned non-integer result} test cmdIL-3.18 {SortCompare procedure, -command option} -body { proc cmp {a b} { expr {$b - $a} } lsort -command cmp {48 6 18 22 21 35 36} } -cleanup { rename cmp "" } -result {48 36 35 22 21 18 6} test cmdIL-3.19 {SortCompare procedure, -decreasing option} { lsort -decreasing -integer {35 21 0x20 30 0o23 100 8} } {100 35 0x20 30 21 0o23 8} test cmdIL-4.1 {DictionaryCompare procedure, numerics, leading zeros} { lsort -dictionary {a003b a03b} } {a03b a003b} test cmdIL-4.2 {DictionaryCompare procedure, numerics, leading zeros} { lsort -dictionary {a3b a03b} } {a3b a03b} test cmdIL-4.3 {DictionaryCompare procedure, numerics, leading zeros} { lsort -dictionary {a3b A03b} } {A03b a3b} test cmdIL-4.4 {DictionaryCompare procedure, numerics, leading zeros} { lsort -dictionary {a3b a03B} } {a3b a03B} test cmdIL-4.5 {DictionaryCompare procedure, numerics, leading zeros} { lsort -dictionary {00000 000} } {000 00000} test cmdIL-4.6 {DictionaryCompare procedure, numerics, different lengths} { lsort -dictionary {a321b a03210b} } {a321b a03210b} test cmdIL-4.7 {DictionaryCompare procedure, numerics, different lengths} { lsort -dictionary {a03210b a321b} } {a321b a03210b} test cmdIL-4.8 {DictionaryCompare procedure, numerics} { lsort -dictionary {48 6a 18b 22a 21aa 35 36} } {6a 18b 21aa 22a 35 36 48} test cmdIL-4.9 {DictionaryCompare procedure, numerics} { lsort -dictionary {a123x a123b} } {a123b a123x} test cmdIL-4.10 {DictionaryCompare procedure, numerics} { lsort -dictionary {a123b a123x} } {a123b a123x} test cmdIL-4.11 {DictionaryCompare procedure, numerics} { lsort -dictionary {a1b aab} } {a1b aab} test cmdIL-4.12 {DictionaryCompare procedure, numerics} { lsort -dictionary {a1b a!b} } {a!b a1b} test cmdIL-4.13 {DictionaryCompare procedure, numerics} { lsort -dictionary {a1b2c a1b1c} } {a1b1c a1b2c} test cmdIL-4.14 {DictionaryCompare procedure, numerics} { lsort -dictionary {a1b2c a1b3c} } {a1b2c a1b3c} test cmdIL-4.15 {DictionaryCompare procedure, long numbers} { lsort -dictionary {a7654884321988762b a7654884321988761b} } {a7654884321988761b a7654884321988762b} test cmdIL-4.16 {DictionaryCompare procedure, long numbers} { lsort -dictionary {a8765488432198876b a7654884321988761b} } {a7654884321988761b a8765488432198876b} test cmdIL-4.17 {DictionaryCompare procedure, case} { lsort -dictionary {aBCd abcc} } {abcc aBCd} test cmdIL-4.18 {DictionaryCompare procedure, case} { lsort -dictionary {aBCd abce} } {aBCd abce} test cmdIL-4.19 {DictionaryCompare procedure, case} { lsort -dictionary {abcd ABcc} } {ABcc abcd} test cmdIL-4.20 {DictionaryCompare procedure, case} { lsort -dictionary {abcd ABce} } {abcd ABce} test cmdIL-4.21 {DictionaryCompare procedure, case} { lsort -dictionary {abCD ABcd} } {ABcd abCD} test cmdIL-4.22 {DictionaryCompare procedure, case} { lsort -dictionary {ABcd aBCd} } {ABcd aBCd} test cmdIL-4.23 {DictionaryCompare procedure, case} { lsort -dictionary {ABcd AbCd} } {ABcd AbCd} test cmdIL-4.24 {DictionaryCompare procedure, international characters} {hasIsoLocale} { ::tcltest::set_iso8859_1_locale set result [lsort -dictionary "a b c A B C ã Ä"] ::tcltest::restore_locale set result } "A a B b C c ã Ä" test cmdIL-4.25 {DictionaryCompare procedure, international characters} {hasIsoLocale} { ::tcltest::set_iso8859_1_locale set result [lsort -dictionary "a23ã a23Å a23ä"] ::tcltest::restore_locale set result } "a23ã a23ä a23Å" test cmdIL-4.26 {DefaultCompare procedure, signed characters} { set l [lsort [list "abc\200" "abc"]] set viewlist {} foreach s $l { set viewelem "" set len [string length $s] for {set i 0} {$i < $len} {incr i} { set c [string index $s $i] scan $c %c d if {$d > 0 && $d < 128} { append viewelem $c } else { append viewelem "\\[format %03o $d]" } } lappend viewlist $viewelem } set viewlist } [list "abc" "abc\\200"] test cmdIL-4.27 {DictionaryCompare procedure, signed characters} { set l [lsort -dictionary [list "abc\200" "abc"]] set viewlist {} foreach s $l { set viewelem "" set len [string length $s] for {set i 0} {$i < $len} {incr i} { set c [string index $s $i] scan $c %c d if {$d > 0 && $d < 128} { append viewelem $c } else { append viewelem "\\[format %03o $d]" } } lappend viewlist $viewelem } set viewlist } [list "abc" "abc\\200"] test cmdIL-4.28 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA ` c CC] } [list ` AA c CC] test cmdIL-4.29 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA ` c ^ \\ CC \[ \]] } [list \[ \\ \] ^ ` AA c CC] test cmdIL-4.30 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA ` c ^ _ \\ CC \[ dude \] funky] } [list \[ \\ \] ^ _ ` AA c CC dude funky] test cmdIL-4.31 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA c ` CC] } [list ` AA c CC] test cmdIL-4.32 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA c CC `] } [list ` AA c CC] test cmdIL-4.33 {DictionaryCompare procedure, chars between Z and a in ASCII} { lsort -dictionary [list AA ! c CC `] } [list ! ` AA c CC] test cmdIL-4.34 {SortCompare procedure, -ascii option with -nocase option} { lsort -ascii -nocase {d e c b a d35 d300 100 20} } {100 20 a b c d d300 d35 e} test cmdIL-4.35 {SortCompare procedure, -ascii option with -nocase option} { lsort -ascii -nocase {d E c B a D35 d300 100 20} } {100 20 a B c d d300 D35 E} test cmdIL-4.36 {SortCompare procedure, UTF-8 with -nocase option} { scan [lsort -ascii -nocase [list \u101 \u100]] %c%c%c } {257 32 256} test cmdIL-4.37 {SortCompare procedure, UTF-8 with -nocase option} { scan [lsort -ascii -nocase [list a\x00a a]] %c%c%c%c%c } {97 32 97 0 97} test cmdIL-4.38 {SortCompare procedure, UTF-8 with -nocase option} { scan [lsort -ascii -nocase [list a a\x00a]] %c%c%c%c%c } {97 32 97 0 97} test cmdIL-5.1 {lsort with list style index} { lsort -ascii -decreasing -index {0 1} { {{Jim Alpha} 20000410} {{Joe Bravo} 19990320} {{Jacky Charlie} 19390911} } } {{{Jacky Charlie} 19390911} {{Joe Bravo} 19990320} {{Jim Alpha} 20000410}} test cmdIL-5.2 {lsort with list style index} { lsort -decreasing -index {0 1} { {{Jim Alpha} 20000410} {{Joe Bravo} 19990320} {{Jacky Charlie} 19390911} } } {{{Jacky Charlie} 19390911} {{Joe Bravo} 19990320} {{Jim Alpha} 20000410}} test cmdIL-5.3 {lsort with list style index} { lsort -integer -increasing -index {1 end} { {{Jim Alpha} 20000410} {{Joe Bravo} 19990320} {{Jacky Charlie} 19390911} } } {{{Jacky Charlie} 19390911} {{Joe Bravo} 19990320} {{Jim Alpha} 20000410}} test cmdIL-5.4 {lsort with list style index} { lsort -integer -index {1 end-1} { {the {0 1 2 3 4 5} quick} {brown {0 1 2 3 4} fox} {jumps {30 31 2 33} over} {the {0 1 2} lazy} {dogs {0 1}} } } {{dogs {0 1}} {the {0 1 2} lazy} {jumps {30 31 2 33} over} {brown {0 1 2 3 4} fox} {the {0 1 2 3 4 5} quick}} test cmdIL-5.5 {lsort with list style index and sharing} -body { proc test_lsort {l} { set n $l foreach e $l {lappend n [list [expr {rand()}] $e]} lindex [lsort -real -index $l $n] 1 1 } expr {srand(1)} test_lsort 0 } -result 0 -cleanup { rename test_lsort "" } test cmdIL-5.6 {lsort with multiple list-style index options} { lsort -index {1 2 3} -index 0 {{a b} {c d} {b e}} } {{a b} {b e} {c d}} test cmdIL-5.7 {lsort memory exhaustion} -constraints {testWithLimit} -body { # test it in child process (with limited address space) ca. 80MB extra memory # on x64 system it would be not enough to sort 4M items (the half 2M only), # warn and skip if no error (enough memory) or error by list creation: testWithLimit \ -warn-on-code 0 -warn-on-alloc-error 1 \ -addmem [expr {$tcl_platform(pointerSize)*4000000 + $tcl_platform(pointerSize)*3*2000000}] \ { # create list and get length (avoid too long output in interactive shells): llength [set l [lrepeat 4000000 ""]] # test OOM: llength [lsort $l] } # expecting error no memory by sort } -returnCodes 1 -result {no enough memory to proccess sort of 4000000 items} # Compiled version test cmdIL-6.1 {lassign command syntax} -returnCodes error -body { apply {{} { lassign }} } -result {wrong # args: should be "lassign list ?varName ...?"} test cmdIL-6.2 {lassign command syntax} { apply {{} { lassign x }} } x test cmdIL-6.3 {lassign command} -body { apply {{} { set x FAIL list [lassign a x] $x }} } -result {{} a} test cmdIL-6.4 {lassign command} -body { apply {{} { set x FAIL set y FAIL list [lassign a x y] $x $y }} } -result {{} a {}} test cmdIL-6.5 {lassign command} -body { apply {{} { set x FAIL set y FAIL list [lassign {a b} x y] $x $y }} } -result {{} a b} test cmdIL-6.6 {lassign command} -body { apply {{} { set x FAIL set y FAIL list [lassign {a b c} x y] $x $y }} } -result {c a b} test cmdIL-6.7 {lassign command} -body { apply {{} { set x FAIL set y FAIL list [lassign {a b c d} x y] $x $y }} } -result {{c d} a b} test cmdIL-6.8 {lassign command - list format error} -body { apply {{} { set x FAIL set y FAIL list [catch {lassign {a {b}c d} x y} msg] $msg $x $y }} } -result {1 {list element in braces followed by "c" instead of space} FAIL FAIL} test cmdIL-6.9 {lassign command - assignment to arrays} -body { apply {{} { list [lassign {a b} x(x)] $x(x) }} } -result {b a} test cmdIL-6.10 {lassign command - variable update error} -body { apply {{} { set x(x) {} lassign a x }} } -returnCodes error -result {can't set "x": variable is array} test cmdIL-6.11 {lassign command - variable update error} -body { apply {{} { set x(x) {} set y FAIL list [catch {lassign a y x} msg] $msg $y }} } -result {1 {can't set "x": variable is array} a} test cmdIL-6.12 {lassign command - memory leak testing} -setup { unset -nocomplain x y set x(x) {} set y FAIL proc getbytes {} { set lines [split [memory info] "\n"] lindex [lindex $lines 3] 3 } proc stress {} { global x y lassign {} y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y catch {lassign {} y y y y y y y y y y y y y y y y y y y y y y y y y x} catch {lassign {} x} } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { stress set tmp $end set end [getbytes] } expr {$end - $tmp} } -result 0 -cleanup { unset -nocomplain x y i tmp end rename getbytes {} rename stress {} } # Force non-compiled version test cmdIL-6.13 {lassign command syntax} -returnCodes error -body { apply {{} { set lassign lassign $lassign }} } -result {wrong # args: should be "lassign list ?varName ...?"} test cmdIL-6.14 {lassign command syntax} { apply {{} { set lassign lassign $lassign x }} } x test cmdIL-6.15 {lassign command} -body { apply {{} { set lassign lassign set x FAIL list [$lassign a x] $x }} } -result {{} a} test cmdIL-6.16 {lassign command} -body { apply {{} { set lassign lassign set x FAIL set y FAIL list [$lassign a x y] $x $y }} } -result {{} a {}} test cmdIL-6.17 {lassign command} -body { apply {{} { set lassign lassign set x FAIL set y FAIL list [$lassign {a b} x y] $x $y }} } -result {{} a b} test cmdIL-6.18 {lassign command} -body { apply {{} { set lassign lassign set x FAIL set y FAIL list [$lassign {a b c} x y] $x $y }} } -result {c a b} test cmdIL-6.19 {lassign command} -body { apply {{} { set lassign lassign set x FAIL set y FAIL list [$lassign {a b c d} x y] $x $y }} } -result {{c d} a b} test cmdIL-6.20 {lassign command - list format error} -body { apply {{} { set lassign lassign set x FAIL set y FAIL list [catch {$lassign {a {b}c d} x y} msg] $msg $x $y }} } -result {1 {list element in braces followed by "c" instead of space} FAIL FAIL} test cmdIL-6.21 {lassign command - assignment to arrays} -body { apply {{} { set lassign lassign list [$lassign {a b} x(x)] $x(x) }} } -result {b a} test cmdIL-6.22 {lassign command - variable update error} -body { apply {{} { set lassign lassign set x(x) {} $lassign a x }} } -returnCodes 1 -result {can't set "x": variable is array} test cmdIL-6.23 {lassign command - variable update error} -body { apply {{} { set lassign lassign set x(x) {} set y FAIL list [catch {$lassign a y x} msg] $msg $y }} } -result {1 {can't set "x": variable is array} a} test cmdIL-6.24 {lassign command - memory leak testing} -setup { set x(x) {} set y FAIL proc getbytes {} { set lines [split [memory info] "\n"] lindex [lindex $lines 3] 3 } proc stress {} { global x y set lassign lassign $lassign {} y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y catch {$lassign {} y y y y y y y y y y y y y y y y y y y y y y y y y x} catch {$lassign {} x} } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { stress set tmp $end set end [getbytes] } expr {$end - $tmp} } -result 0 -cleanup { unset -nocomplain x y i tmp end rename getbytes {} rename stress {} } # Assorted shimmering problems test cmdIL-6.25 {lassign command (compiled) - shimmering protection} -body { apply {{} { set x {a b c} list [lassign $x $x y] $x [set $x] $y }} } -result {c {a b c} a b} test cmdIL-6.26 {lassign command (uncompiled) - shimmering protection} -body { apply {{} { set x {a b c} set lassign lassign list [$lassign $x $x y] $x [set $x] $y }} } -result {c {a b c} a b} test cmdIL-6.27 {bug-f5e36eb588 - uncompiled lassign on lseq does not bloat memory} -constraints { hasMemUsage } -body { set l [lseq 1000000] lassign $l x set premem [memusage] set lassign lassign $lassign $l x set postmem [memusage] expr {($postmem-$premem) < 100} } -result 1 test cmdIL-7.1 {lreverse command} -body { lreverse } -returnCodes error -result "wrong # args: should be \"lreverse list\"" test cmdIL-7.2 {lreverse command} -body { lreverse a b } -returnCodes error -result "wrong # args: should be \"lreverse list\"" test cmdIL-7.3 {lreverse command} -body { lreverse "not \{a list" } -returnCodes error -result {unmatched open brace in list} test cmdIL-7.4 {lreverse command - shared object} { set x {a b {c d} e f} lreverse $x } {f e {c d} b a} test cmdIL-7.5 {lreverse command - unshared object} { lreverse [list a b {c d} e f] } {f e {c d} b a} test cmdIL-7.6 {lreverse command - unshared object [Bug 1672585]} { lreverse [set x {1 2 3}][unset x] } {3 2 1} test cmdIL-7.7 {lreverse command - empty object [Bug 1876793]} { lreverse [list] } {} test cmdIL-7.8 {lreverse command - shared internalrep [Bug 1675044]} -setup { teststringobj set 1 {1 2 3} testobj convert 1 list testobj duplicate 1 2 variable x [teststringobj get 1] variable y [teststringobj get 2] testobj freeallvars proc K {a b} {return $a} } -constraints testobj -body { lreverse [K $y [unset y]] lindex $x 0 } -cleanup { unset -nocomplain x y rename K {} } -result 1 test cmdIL-8.1 {lremove command: error path} -returnCodes error -body { lremove } -result {wrong # args: should be "lremove list ?index ...?"} test cmdIL-8.2 {lremove command: error path} -returnCodes error -body { lremove {{}{}} } -result {list element in braces followed by "{}" instead of space} test cmdIL-8.3 {lremove command: error path} -returnCodes error -body { lremove {a b c} gorp } -result {bad index "gorp": must be integer?[+-]integer? or end?[+-]integer?} test cmdIL-8.4 {lremove command: no indices} -body { lremove {a b c} } -result {a b c} test cmdIL-8.5 {lremove command: before start} -body { lremove {a b c} -1 } -result {a b c} test cmdIL-8.6 {lremove command: after end} -body { lremove {a b c} 3 } -result {a b c} test cmdIL-8.7 {lremove command} -body { lremove {a b c} 0 } -result {b c} test cmdIL-8.8 {lremove command} -body { lremove {a b c} 1 } -result {a c} test cmdIL-8.9 {lremove command} -body { lremove {a b c} end } -result {a b} test cmdIL-8.10 {lremove command} -body { lremove {a b c} end-1 } -result {a c} test cmdIL-8.11 {lremove command} -body { lremove {a b c d e} 1 3 } -result {a c e} test cmdIL-8.12 {lremove command} -body { lremove {a b c d e} 3 1 } -result {a c e} test cmdIL-8.13 {lremove command: same index twice} -body { lremove {a b c d e} 2 2 } -result {a b d e} test cmdIL-8.14 {lremove command: same index twice} -body { lremove {a b c d e} 3 end-1 } -result {a b c e} test cmdIL-8.15 {lremove command: many indices} -body { lremove {a b c d e} 1 3 1 4 0 } -result {c} # This belongs in info test, but adding tests there breaks tests # that compute source file line numbers. test info-20.6 {Bug 3587651} -setup { namespace eval my {namespace eval tcl {namespace eval mathfunc { proc demo x {return 42} }}}} -body { namespace eval my {expr {"demo" in [info functions]}}} -cleanup { namespace delete my } -result 1 # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/cmdAH.test0000644000175000017500000022640615104661341014600 0ustar sergeisergei# The file tests the tclCmdAH.c file. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1996-1998 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testchmod [llength [info commands testchmod]] testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testvolumetype [llength [info commands testvolumetype]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint time64bit [expr { ([llength [info command testsize]] ? [testsize st_mtime] : $::tcl_platform(pointerSize)) >= 8 }] testConstraint filetime64bit [expr { [testConstraint time64bit] && ( ![testConstraint unix] || [apply {{} { # check whether disk may have 2038 problem, see [fd91b0ca09cb171f]: set fn [makeFile "" foo.text] if {[catch { exec sh -c "TZ=:UTC LC_TIME=en_US touch -ma -t '207006290000' '$fn' && TZ=:UTC LC_TIME=en_US ls -l '$fn'" } res]} { #puts "Check constraint failed:\t$res" set res {} } removeFile $fn regexp {\mJun\s+29\s+2070\M} $res }}] ) }] testConstraint linkDirectory [expr { ![testConstraint win] || ($::tcl_platform(osVersion) >= 5.0 && [lindex [file system [temporaryDirectory]] 1] eq "NTFS") }] testConstraint notWine [expr {![info exists ::env(CI_USING_WINE)]}] # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] global env set cmdAHwd [pwd] catch {set platform [testgetplatform]} proc waitForEvenSecondForFAT {} { # Windows 9x uses filesystems (the FAT* family of FSes) without enough # data in its timestamps for even per-second-accurate timings. :^( # This procedure based on work by Helmut Giese if { [testConstraint win] && [lindex [file system [temporaryDirectory]] 1] ne "NTFS" } then { # Assume non-NTFS means FAT{12,16,32} and hence in need of special # help... set start [clock seconds] while {1} { set now [clock seconds] if {$now!=$start && !($now & 1)} { break } after 50 } } } test cmdAH-0.1 {Tcl_BreakObjCmd, errors} -body { break foo } -returnCodes error -result {wrong # args: should be "break"} test cmdAH-0.2 {Tcl_BreakObjCmd, success} { list [catch {break} msg] $msg } {3 {}} test cmdAH-1.1 {Tcl_CatchObjCmd, errors} -returnCodes error -body { catch } -result {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"} test cmdAH-1.2 {Tcl_CatchObjCmd, errors} { list [catch {catch foo bar baz} msg] $msg } {0 1} test cmdAH-1.3 {Tcl_CatchObjCmd, errors} -returnCodes error -body { catch foo bar baz spaz } -result {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"} test cmdAH-1.4 {Bug 3595576} { catch {catch {} -> noSuchNs::var} } 1 test cmdAH-1.5 {Bug 3595576} { catch {catch error -> noSuchNs::var} } 1 test cmdAH-2.1 {Tcl_CdObjCmd} -returnCodes error -body { cd foo bar } -result {wrong # args: should be "cd ?dirName?"} set foodir [file join [temporaryDirectory] foo] test cmdAH-2.2 {Tcl_CdObjCmd} -setup { file delete -force $foodir set oldpwd [pwd] } -body { file mkdir $foodir cd $foodir file tail [pwd] } -cleanup { cd $oldpwd file delete $foodir } -result foo test cmdAH-2.3 {Tcl_CdObjCmd} -setup { global env set oldpwd [pwd] set temp $env(HOME) file delete -force $foodir } -body { set env(HOME) $oldpwd file mkdir $foodir cd $foodir cd [file home] string equal [pwd] $oldpwd } -cleanup { cd $oldpwd file delete $foodir set env(HOME) $temp } -result 1 test cmdAH-2.4 {Tcl_CdObjCmd} -setup { global env set oldpwd [pwd] set temp $env(HOME) file delete -force $foodir } -body { set env(HOME) $oldpwd file mkdir $foodir cd $foodir cd string equal [pwd] $oldpwd } -cleanup { cd $oldpwd file delete $foodir set env(HOME) $temp } -result 1 test cmdAH-2.5 {Tcl_CdObjCmd} -returnCodes error -body { cd ~ } -result {couldn't change working directory to "~": no such file or directory} test cmdAH-2.5.1 {Tcl_CdObjCmd} -setup { set oldpwd [pwd] cd [temporaryDirectory] file delete ./~ file mkdir ~ } -body { cd ~ pwd } -cleanup { cd [temporaryDirectory] file delete ./~ cd $oldpwd } -result [file join [temporaryDirectory] ~] test cmdAH-2.6 {Tcl_CdObjCmd} -returnCodes error -body { cd _foobar } -result {couldn't change working directory to "_foobar": no such file or directory} test cmdAH-2.6.1 {Tcl_CdObjCmd} -returnCodes error -body { cd "" } -result {couldn't change working directory to "": no such file or directory} test cmdAH-2.6.2 {cd} -constraints {unix nonPortable} -setup { set dir [pwd] } -body { cd / pwd } -cleanup { cd $dir } -result {/} test cmdAH-2.6.3 {Tcl_CdObjCmd, bug #3118489} -setup { set dir [pwd] } -returnCodes error -body { cd .\x00 } -cleanup { cd $dir } -match glob -result "couldn't change working directory to \".\x00\": *" test cmdAH-2.7 {Tcl_ConcatObjCmd} { concat } {} test cmdAH-2.8 {Tcl_ConcatObjCmd} { concat a } a test cmdAH-2.9 {Tcl_ConcatObjCmd} { concat a {b c} } {a b c} test cmdAH-3.1 {Tcl_ContinueObjCmd, errors} -returnCodes error -body { continue foo } -result {wrong # args: should be "continue"} test cmdAH-3.2 {Tcl_ContinueObjCmd, success} { list [catch {continue} msg] $msg } {4 {}} ### # encoding command set "numargErrors(encoding system)" {^wrong # args: should be "(encoding |::tcl::encoding::)system \?encoding\?"$} set "numargErrors(encoding convertfrom)" {wrong # args: should be "(encoding |::tcl::encoding::)convertfrom \?-profile profile\? \?-failindex var\? encoding data" or "(encoding |::tcl::encoding::)convertfrom data"} set "numargErrors(encoding convertto)" {wrong # args: should be "(encoding |::tcl::encoding::)convertto \?-profile profile\? \?-failindex var\? encoding data" or "(encoding |::tcl::encoding::)convertto data"} set "numargErrors(encoding names)" {wrong # args: should be "encoding names"} set "numargErrors(encoding profiles)" {wrong # args: should be "encoding profiles"} source [file join [file dirname [info script]] encodingVectors.tcl] # Maps utf-{16,32}{le,be} to utf-16, utf-32 and # others to "". Used to test utf-16, utf-32 based # on system endianness proc endianUtf {enc} { if {$::tcl_platform(byteOrder) eq "littleEndian"} { set endian le } else { set endian be } if {$enc eq "utf-16$endian" || $enc eq "utf-32$endian"} { return [string range $enc 0 5] } return "" } # # Check errors for invalid number of arguments proc badnumargs {id cmd cmdargs} { variable numargErrors test $id.a "Syntax error: $cmd $cmdargs" \ -body [list {*}$cmd {*}$cmdargs] \ -result $numargErrors($cmd) \ -match regexp \ -returnCodes error test $id.b "Syntax error: $cmd (byte compiled)" \ -setup [list proc compiled_proc {} [list {*}$cmd {*}$cmdargs]] \ -body {compiled_proc} \ -cleanup {rename compiled_proc {}} \ -result $numargErrors($cmd) \ -match regexp \ -returnCodes error } # Wraps tests resulting in unknown encoding errors proc unknownencodingtest {id cmd} { set result "unknown encoding \"[lindex $cmd end-1]\"" test $id.a "Unknown encoding error: $cmd" \ -body [list encoding {*}$cmd] \ -result $result \ -returnCodes error test $id.b "Syntax error: $cmd (byte compiled)" \ -setup [list proc encoding_test {} [list encoding {*}$cmd]] \ -body {encoding_test} \ -cleanup {rename encoding_test {}} \ -result $result \ -returnCodes error } # Wraps tests for conversion, successful or not. # Really more general than just for encoding conversion. proc testconvert {id body result args} { test $id.a $body \ -body $body \ -result $result \ {*}$args dict append args -setup \n[list proc compiled_script {} $body] dict append args -cleanup "\nrename compiled_script {}" test $id.b "$body (byte compiled)" \ -body {compiled_script} \ -result $result \ {*}$args } # Wrapper to verify encoding convert{to,from} ?-profile? # Generates tests for compiled and uncompiled implementation. # Also generates utf-{16,32} tests if passed encoding is utf-{16,32}{le,be} # The enc and profile are appended to id to generate the test id proc testprofile {id converter enc profile data result args} { testconvert $id.$enc.$profile [list encoding $converter -profile $profile $enc $data] $result {*}$args if {[set enc2 [endianUtf $enc]] ne ""} { # If utf{16,32}-{le,be}, also do utf{16,32} testconvert $id.$enc2.$profile [list encoding $converter -profile $profile $enc2 $data] $result {*}$args } # If this is the default profile, generate a test without specifying profile if {$profile eq $::encDefaultProfile} { testconvert $id.$enc.default [list encoding $converter $enc $data] $result {*}$args if {[set enc2 [endianUtf $enc]] ne ""} { # If utf{16,32}-{le,be}, also do utf{16,32} testconvert $id.$enc2.default [list encoding $converter $enc2 $data] $result {*}$args } } } # Wrapper to verify encoding convert{to,from} -failindex ?-profile? # Generates tests for compiled and uncompiled implementation. # Also generates utf-{16,32} tests if passed encoding is utf-{16,32}{le,be} # The enc and profile are appended to id to generate the test id proc testfailindex {id converter enc data result failidx {profile default}} { testconvert $id.$enc.$profile "list \[encoding $converter -profile $profile -failindex idx $enc [list $data]\] \[set idx\]" [list $result $failidx] if {[set enc2 [endianUtf $enc]] ne ""} { # If utf{16,32}-{le,be}, also do utf{16,32} testconvert $id.$enc2.$profile "list \[encoding $converter -profile $profile -failindex idx $enc2 [list $data]\] \[set idx]" [list $result $failidx] } # If this is the default profile, generate a test without specifying profile if {$profile eq $::encDefaultProfile} { testconvert $id.$enc.default "list \[encoding $converter -failindex idx $enc [list $data]\] \[set idx]" [list $result $failidx] if {[set enc2 [endianUtf $enc]] ne ""} { # If utf{16,32}-{le,be}, also do utf{16,32} testconvert $id.$enc2.default "list \[encoding $converter -failindex idx $enc2 [list $data]\] \[set idx]" [list $result $failidx] } } } test cmdAH-4.1.1 {encoding} -returnCodes error -body { encoding } -result {wrong # args: should be "encoding subcommand ?arg ...?"} test cmdAH-4.1.2 {Tcl_EncodingObjCmd} -returnCodes error -body { encoding foo } -result {unknown or ambiguous subcommand "foo": must be convertfrom, convertto, dirs, names, profiles, system, or user} # # encoding system 4.2.* badnumargs cmdAH-4.2.1 {encoding system} {ascii ascii} test cmdAH-4.2.2 {Tcl_EncodingObjCmd} -setup { set system [encoding system] } -body { encoding system iso8859-1 encoding system } -cleanup { encoding system $system } -result iso8859-1 # # encoding convertfrom 4.3.* # Odd number of args is always invalid since last two args # are ENCODING DATA and all options take a value badnumargs cmdAH-4.3.1 {encoding convertfrom} {} badnumargs cmdAH-4.3.2 {encoding convertfrom} {-failindex VAR ABC} badnumargs cmdAH-4.3.3 {encoding convertfrom} {-profile VAR ABC} badnumargs cmdAH-4.3.4 {encoding convertfrom} {-failindex VAR -profile strict ABC} badnumargs cmdAH-4.3.5 {encoding convertfrom} {-profile strict -failindex VAR ABC} # Test that last two args always treated as ENCODING DATA unknownencodingtest cmdAH-4.3.6 {convertfrom -failindex ABC} unknownencodingtest cmdAH-4.3.7 {convertfrom -profile ABC} unknownencodingtest cmdAH-4.3.8 {convertfrom nosuchencoding ABC} unknownencodingtest cmdAH-4.3.9 {convertfrom -failindex VAR -profile ABC} unknownencodingtest cmdAH-4.3.10 {convertfrom -profile strict -failindex ABC} testconvert cmdAH-4.3.11 { encoding convertfrom jis0208 \x38\x43 } 乎 -setup { set system [encoding system] encoding system iso8859-1 } -cleanup { encoding system $system } # Verify single arg defaults to system encoding testconvert cmdAH-4.3.12 { encoding convertfrom \x38\x43 } 乎 -setup { set system [encoding system] encoding system jis0208 } -cleanup { encoding system $system } # convertfrom ?-profile? : valid byte sequences foreach {enc str hex ctrl comment} $encValidStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set prefix A set suffix B set prefix_bytes [encoding convertto $enc A] set suffix_bytes [encoding convertto $enc B] foreach profile $encProfiles { testprofile cmdAH-4.3.13.$hex.solo convertfrom $enc $profile $bytes $str testprofile cmdAH-4.3.13.$hex.lead convertfrom $enc $profile $bytes$suffix_bytes $str$suffix testprofile cmdAH-4.3.13.$hex.tail convertfrom $enc $profile $prefix_bytes$bytes $prefix$str testprofile cmdAH-4.3.13.$hex.middle convertfrom $enc $profile $prefix_bytes$bytes$suffix_bytes $prefix$str$suffix } } # convertfrom ?-profile? : invalid byte sequences foreach {enc hex profile str failidx ctrl comment} $encInvalidBytes { if {"knownBug" in $ctrl} continue set bytes [binary format H* $hex] set prefix A set suffix B set prefix_bytes [encoding convertto $enc $prefix] set suffix_bytes [encoding convertto $enc $suffix] set prefixLen [string length $prefix_bytes] set result [list $str] # TODO - if the bad byte is unprintable, tcltest errors out when printing a mismatch # so glob it out in error message pattern for now. set errorWithoutPrefix [list "unexpected byte sequence starting at index $failidx: *" -returnCodes error -match glob] set errorWithPrefix [list "unexpected byte sequence starting at index [expr {$failidx+$prefixLen}]: *" -returnCodes error -match glob] if {$ctrl eq {} || "solo" in $ctrl} { if {$failidx == -1} { set result [list $str] } else { set result $errorWithoutPrefix } testprofile cmdAH-4.3.13.$hex.solo convertfrom $enc $profile $bytes {*}$result } if {$ctrl eq {} || "lead" in $ctrl} { if {$failidx == -1} { set result [list $str$suffix] } else { set result $errorWithoutPrefix } testprofile cmdAH-4.3.13.$hex.lead convertfrom $enc $profile $bytes$suffix_bytes {*}$result } if {$ctrl eq {} || "tail" in $ctrl} { if {$failidx == -1} { set result [list $prefix$str] } else { set result $errorWithPrefix } testprofile cmdAH-4.3.13.$hex.tail convertfrom $enc $profile $prefix_bytes$bytes {*}$result } if {$ctrl eq {} || "middle" in $ctrl} { if {$failidx == -1} { set result [list $prefix$str$suffix] } else { set result $errorWithPrefix } testprofile cmdAH-4.3.13.$hex.middle convertfrom $enc $profile $prefix_bytes$bytes$suffix_bytes {*}$result } } # convertfrom -failindex ?-profile? - valid data foreach {enc str hex ctrl comment} $encValidStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set prefix A set suffix B set prefix_bytes [encoding convertto $enc $prefix] set suffix_bytes [encoding convertto $enc $suffix] foreach profile $encProfiles { testfailindex cmdAH-4.3.14.$hex.solo convertfrom $enc $bytes $str -1 $profile testfailindex cmdAH-4.3.14.$hex.lead convertfrom $enc $bytes$suffix_bytes $str$suffix -1 $profile testfailindex cmdAH-4.3.14.$hex.tail convertfrom $enc $prefix_bytes$bytes $prefix$str -1 $profile testfailindex cmdAH-4.3.14.$hex.middle convertfrom $enc $prefix_bytes$bytes$suffix_bytes $prefix$str$suffix -1 $profile } } # convertfrom -failindex ?-profile? - invalid data foreach {enc hex profile str failidx ctrl comment} $encInvalidBytes { if {"knownBug" in $ctrl} continue # There are multiple test cases based on location of invalid bytes set bytes [binary decode hex $hex] set prefix A set suffix B set prefix_bytes [encoding convertto $enc $prefix] set suffix_bytes [encoding convertto $enc $suffix] set prefixLen [string length $prefix_bytes] if {$ctrl eq {} || "solo" in $ctrl} { testfailindex cmdAH-4.3.14.$hex.solo convertfrom $enc $bytes $str $failidx $profile } if {$ctrl eq {} || "lead" in $ctrl} { if {$failidx == -1} { # If success expected set result $str$suffix } else { # Failure expected set result "" } testfailindex cmdAH-4.3.14.$hex.lead convertfrom $enc $bytes$suffix_bytes $result $failidx $profile } if {$ctrl eq {} || "tail" in $ctrl} { set expected_failidx $failidx if {$failidx == -1} { # If success expected set result $prefix$str } else { # Failure expected set result $prefix incr expected_failidx $prefixLen } testfailindex cmdAH-4.3.14.$hex.tail convertfrom $enc $prefix_bytes$bytes $result $expected_failidx $profile } if {$ctrl eq {} || "middle" in $ctrl} { set expected_failidx $failidx if {$failidx == -1} { # If success expected set result $prefix$str$suffix } else { # Failure expected set result $prefix incr expected_failidx $prefixLen } testfailindex cmdAH-4.3.14.$hex.middle convertfrom $enc $prefix_bytes$bytes$suffix_bytes $result $expected_failidx $profile } } # # encoding convertto 4.4.* badnumargs cmdAH-4.4.1 {encoding convertto} {} badnumargs cmdAH-4.4.2 {encoding convertto} {-failindex VAR ABC} badnumargs cmdAH-4.4.3 {encoding convertto} {-profile VAR ABC} badnumargs cmdAH-4.4.4 {encoding convertto} {-failindex VAR -profile strict ABC} badnumargs cmdAH-4.4.5 {encoding convertto} {-profile strict -failindex VAR ABC} # Test that last two args always treated as ENCODING DATA unknownencodingtest cmdAH-4.4.6 {convertto -failindex ABC} unknownencodingtest cmdAH-4.4.7 {convertto -profile ABC} unknownencodingtest cmdAH-4.4.8 {convertto nosuchencoding ABC} unknownencodingtest cmdAH-4.4.9 {convertto -failindex VAR -profile ABC} unknownencodingtest cmdAH-4.4.10 {convertto -profile strict -failindex ABC} testconvert cmdAH-4.4.11 { encoding convertto jis0208 乎 } \x38\x43 -setup { set system [encoding system] encoding system iso8859-1 } -cleanup { encoding system $system } # Verify single arg defaults to system encoding testconvert cmdAH-4.4.12 { encoding convertto 乎 } \x38\x43 -setup { set system [encoding system] encoding system jis0208 } -cleanup { encoding system $system } # convertto ?-profile? : valid byte sequences foreach {enc str hex ctrl comment} $encValidStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set printable [tcltest::Asciify $str] set prefix A set suffix B set prefix_bytes [encoding convertto $enc A] set suffix_bytes [encoding convertto $enc B] foreach profile $encProfiles { testprofile cmdAH-4.4.13.$printable.solo convertto $enc $profile $str $bytes testprofile cmdAH-4.4.13.$printable.lead convertto $enc $profile $str$suffix $bytes$suffix_bytes testprofile cmdAH-4.4.13.$printable.tail convertto $enc $profile $prefix$str $prefix_bytes$bytes testprofile cmdAH-4.4.13.$printable.middle convertto $enc $profile $prefix$str$suffix $prefix_bytes$bytes$suffix_bytes } } # convertto ?-profile? : invalid byte sequences foreach {enc str profile hex failidx ctrl comment} $encUnencodableStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set printable [tcltest::Asciify $str] set prefix A set suffix B set prefix_bytes [encoding convertto $enc $prefix] set suffix_bytes [encoding convertto $enc $suffix] set prefixLen [string length $prefix_bytes] set result [list $bytes] # TODO - if the bad byte is unprintable, tcltest errors out when printing a mismatch # so glob it out in error message pattern for now. set errorWithoutPrefix [list "unexpected character at index $failidx: *" -returnCodes error -match glob] set errorWithPrefix [list "unexpected character at index [expr {$failidx+$prefixLen}]: *" -returnCodes error -match glob] if {$ctrl eq {} || "solo" in $ctrl} { if {$failidx == -1} { set result [list $bytes] } else { set result $errorWithoutPrefix } testprofile cmdAH-4.4.13.$printable.solo convertto $enc $profile $str {*}$result } if {$ctrl eq {} || "lead" in $ctrl} { if {$failidx == -1} { set result [list $bytes$suffix_bytes] } else { set result $errorWithoutPrefix } testprofile cmdAH-4.4.13.$printable.lead convertto $enc $profile $str$suffix {*}$result } if {$ctrl eq {} || "tail" in $ctrl} { if {$failidx == -1} { set result [list $prefix_bytes$bytes] } else { set result $errorWithPrefix } testprofile cmdAH-4.4.13.$printable.tail convertto $enc $profile $prefix$str {*}$result } if {$ctrl eq {} || "middle" in $ctrl} { if {$failidx == -1} { set result [list $prefix_bytes$bytes$suffix_bytes] } else { set result $errorWithPrefix } testprofile cmdAH-4.4.13.$printable.middle convertto $enc $profile $prefix$str$suffix {*}$result } } # convertto -failindex ?-profile? - valid data foreach {enc str hex ctrl comment} $encValidStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set printable [tcltest::Asciify $str] set prefix A set suffix B set prefix_bytes [encoding convertto $enc A] set suffix_bytes [encoding convertto $enc B] foreach profile $encProfiles { testfailindex cmdAH-4.4.14.$enc.$printable.solo convertto $enc $str $bytes -1 $profile testfailindex cmdAH-4.4.14.$enc.$printable.lead convertto $enc $str$suffix $bytes$suffix_bytes -1 $profile testfailindex cmdAH-4.4.14.$enc.$printable.tail convertto $enc $prefix$str $prefix_bytes$bytes -1 $profile testfailindex cmdAH-4.4.14.$enc.$printable.middle convertto $enc $prefix$str$suffix $prefix_bytes$bytes$suffix_bytes -1 $profile } } # convertto -failindex ?-profile? - invalid data foreach {enc str profile hex failidx ctrl comment} $encUnencodableStrings { if {"knownBug" in $ctrl} continue set bytes [binary decode hex $hex] set printable [tcltest::Asciify $str] set prefix A set suffix B set prefixLen [string length [encoding convertto $enc $prefix]] if {$ctrl eq {} || "solo" in $ctrl} { testfailindex cmdAH-4.4.14.$printable.solo convertto $enc $str $bytes $failidx $profile } if {$ctrl eq {} || "lead" in $ctrl} { if {$failidx == -1} { # If success expected set result $bytes$suffix } else { # Failure expected set result "" } testfailindex cmdAH-4.4.14.$printable.lead convertto $enc $str$suffix $result $failidx $profile } if {$ctrl eq {} || "tail" in $ctrl} { set expected_failidx $failidx if {$failidx == -1} { # If success expected set result $prefix$bytes } else { # Failure expected set result $prefix incr expected_failidx $prefixLen } testfailindex cmdAH-4.4.14.$printable.tail convertto $enc $prefix$str $result $expected_failidx $profile } if {$ctrl eq {} || "middle" in $ctrl} { set expected_failidx $failidx if {$failidx == -1} { # If success expected set result $prefix$bytes$suffix } else { # Failure expected set result $prefix incr expected_failidx $prefixLen } testfailindex cmdAH-4.4.14.$printable.middle convertto $enc $prefix$str$suffix $result $expected_failidx $profile } } test cmdAH-4.4.xx {convertto -profile strict} -constraints {testbytestring knownBug} -body { # TODO - what does testbytestring even test? Invalid UTF8 in the Tcl_Obj bytes field encoding convertto -profile strict utf-8 A[testbytestring \x80]B } -returnCodes error -result {unexpected byte sequence starting at index 1: '\x80'} # # encoding names 4.5.* badnumargs cmdAH-4.5.1 {encoding names} {foo} test cmdAH-4.5.2 {encoding names should include at least utf-8 and iso8859-1 and at least one more} -body { set names [encoding names] list [expr {"utf-8" in $names}] [expr {"iso8859-1" in $names}] [expr {[llength $names] > 2}] } -result {1 1 1} # # encoding profiles 4.6.* badnumargs cmdAH-4.6.1 {encoding profiles} {foo} test cmdAH-4.6.2 {encoding profiles} -body { lsort [encoding profiles] } -result {replace strict tcl8} # # file command test cmdAH-5.1 {Tcl_FileObjCmd} -returnCodes error -body { file } -result {wrong # args: should be "file subcommand ?arg ...?"} test cmdAH-5.2 {Tcl_FileObjCmd} -returnCodes error -body { file x } -result {unknown or ambiguous subcommand "x": must be atime, attributes, channels, copy, delete, dirname, executable, exists, extension, home, isdirectory, isfile, join, link, lstat, mkdir, mtime, nativename, normalize, owned, pathtype, readable, readlink, rename, rootname, separator, size, split, stat, system, tail, tempdir, tempfile, tildeexpand, type, volumes, or writable} test cmdAH-5.3 {Tcl_FileObjCmd} -returnCodes error -body { file exists } -result {wrong # args: should be "file exists name"} test cmdAH-5.4 {Tcl_FileObjCmd} { file exists "" } 0 # volume test cmdAH-6.1 {Tcl_FileObjCmd: volumes} -returnCodes error -body { file volumes x } -result {wrong # args: should be "file volumes"} test cmdAH-6.2 {Tcl_FileObjCmd: volumes} -body { lindex [file volumes] 0 } -match glob -result ?* test cmdAH-6.3 {Tcl_FileObjCmd: volumes} -constraints unix -body { set volumeList [file volumes] glob -nocomplain [lindex $volumeList 0]* } -match glob -result * test cmdAH-6.4 {Tcl_FileObjCmd: volumes} -constraints win -body { set volumeList [string tolower [file volumes]] set element [lsearch -exact $volumeList "c:/"] list [expr {$element>=0}] [glob -nocomplain [lindex $volumeList $element]*] } -match glob -result {1 *} # attributes test cmdAH-7.1 {Tcl_FileObjCmd - file attrs} -setup { set foofile [makeFile abcde foo.file] catch {file delete -force $foofile} } -body { close [open $foofile w] file attributes $foofile } -cleanup { # We used [makeFile] so we undo with [removeFile] removeFile $foofile } -match glob -result * # dirname test cmdAH-8.1 {Tcl_FileObjCmd: dirname} -returnCodes error -body { file dirname a b } -result {wrong # args: should be "file dirname name"} test cmdAH-8.2 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname /a/b } /a test cmdAH-8.3 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname {} } . test cmdAH-8.5 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform win file dirname {} } . test cmdAH-8.6 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname .def } . test cmdAH-8.8 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform win file dirname a } . test cmdAH-8.9 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname a/b/c.d } a/b test cmdAH-8.10 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname a/b.c/d } a/b.c test cmdAH-8.11 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname /. } / test cmdAH-8.12 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname / } / test cmdAH-8.13 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname /foo } / test cmdAH-8.14 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname //foo } //foo test cmdAH-8.15 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname //foo/bar } //foo test cmdAH-8.16 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname {//foo\/bar/baz} } {//foo\/bar} test cmdAH-8.17 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname {//foo\/bar/baz/blat} } {//foo\/bar/baz} test cmdAH-8.18 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname /foo// } / test cmdAH-8.19 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname ./a } . test cmdAH-8.20 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname a/.a } a test cmdAH-8.21 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname c:foo } c: test cmdAH-8.22 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname c: } c: test cmdAH-8.23 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname c:/ } c:/ test cmdAH-8.24 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname {c:\foo} } c:/ test cmdAH-8.25 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname {//foo/bar/baz} } //foo/bar test cmdAH-8.26 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform windows file dirname {//foo/bar} } //foo/bar test cmdAH-8.38 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname ~/foo } ~ test cmdAH-8.39 {Tcl_FileObjCmd: dirname} testsetplatform { testsetplatform unix file dirname ~bar/foo } ~bar test cmdAH-8.43 {Tcl_FileObjCmd: dirname} -setup { global env set temp $env(HOME) } -constraints testsetplatform -body { set env(HOME) "/homewontexist/test" testsetplatform unix file dirname [file home] } -cleanup { set env(HOME) $temp } -result /homewontexist test cmdAH-8.44 {Tcl_FileObjCmd: dirname} -setup { global env set temp $env(HOME) } -constraints testsetplatform -body { set env(HOME) "~" testsetplatform unix file dirname [file home] } -cleanup { set env(HOME) $temp } -result . test cmdAH-8.45 {Tcl_FileObjCmd: dirname ~} -body { file dirname ~ } -result . test cmdAH-8.46 {Tcl_FileObjCmd: dirname} { set f [file normalize [info nameof]] file exists $f set res1 [file dirname [file join $f foo/bar]] set res2 [file dirname "${f}/foo/bar"] if {$res1 eq $res2} { return "ok" } return "file dirname problem, $res1, $res2 not equal" } {ok} # tail test cmdAH-9.1 {Tcl_FileObjCmd: tail} -returnCodes error -body { file tail a b } -result {wrong # args: should be "file tail name"} test cmdAH-9.2 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail /a/b } b test cmdAH-9.3 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail {} } {} test cmdAH-9.5 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform win file tail {} } {} test cmdAH-9.6 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail .def } .def test cmdAH-9.8 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform win file tail a } a test cmdAH-9.9 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file ta a/b/c.d } c.d test cmdAH-9.10 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail a/b.c/d } d test cmdAH-9.11 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail /. } . test cmdAH-9.12 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail / } {} test cmdAH-9.13 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail /foo } foo test cmdAH-9.14 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail //foo } {} test cmdAH-9.15 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail //foo/bar } bar test cmdAH-9.16 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail {//foo\/bar/baz} } baz test cmdAH-9.17 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail {//foo\/bar/baz/blat} } blat test cmdAH-9.18 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail /foo// } foo test cmdAH-9.19 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail ./a } a test cmdAH-9.20 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail a/.a } .a test cmdAH-9.21 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c:foo } foo test cmdAH-9.22 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c: } {} test cmdAH-9.23 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c:/ } {} test cmdAH-9.24 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail {c:\foo} } foo test cmdAH-9.25 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail {//foo/bar/baz} } baz test cmdAH-9.26 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail {//foo/bar} } {} test cmdAH-9.42 {Tcl_FileObjCmd: tail ~} -body { file tail ~ } -result ~ test cmdAH-9.43 {Tcl_FileObjCmd: tail} -constraints testsetplatform -setup { global env set temp $env(HOME) } -body { set env(HOME) "~" testsetplatform unix file tail [file home] } -cleanup { set env(HOME) $temp } -result ~ test cmdAH-9.46 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform unix file tail {f.oo\bar/baz.bat} } baz.bat test cmdAH-9.47 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c:foo } foo test cmdAH-9.48 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c: } {} test cmdAH-9.49 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail c:/foo } foo test cmdAH-9.50 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail {c:/foo\bar} } bar test cmdAH-9.51 {Tcl_FileObjCmd: tail} testsetplatform { testsetplatform windows file tail {foo\bar} } bar test cmdAH-9.52 {Tcl_FileObjCmd: tail / normalize, bug 7a9dc52b29} { list \ [file tail {~/~foo}] \ [file tail {~/test/~foo}] \ [file tail [file normalize {~/~foo}]] \ [file tail [file normalize {~/test/~foo}]] } [lrepeat 4 ~foo] # rootname test cmdAH-10.1 {Tcl_FileObjCmd: rootname} -returnCodes error -body { file rootname a b } -result {wrong # args: should be "file rootname name"} test cmdAH-10.2 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname {} } {} test cmdAH-10.3 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file ro foo } foo test cmdAH-10.4 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname foo. } foo test cmdAH-10.5 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname .foo } {} test cmdAH-10.6 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname abc.def } abc test cmdAH-10.7 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname abc.def.ghi } abc.def test cmdAH-10.8 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname a/b/c.d } a/b/c test cmdAH-10.9 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname a/b.c/d } a/b.c/d test cmdAH-10.10 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform unix file rootname a/b.c/ } a/b.c/ test cmdAH-10.23 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname {} } {} test cmdAH-10.24 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file ro foo } foo test cmdAH-10.25 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname foo. } foo test cmdAH-10.26 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname .foo } {} test cmdAH-10.27 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname abc.def } abc test cmdAH-10.28 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname abc.def.ghi } abc.def test cmdAH-10.29 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a/b/c.d } a/b/c test cmdAH-10.30 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a/b.c/d } a/b.c/d test cmdAH-10.31 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a\\b.c\\ } a\\b.c\\ test cmdAH-10.32 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a\\b\\c.d } a\\b\\c test cmdAH-10.33 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a\\b.c\\d } a\\b.c\\d test cmdAH-10.34 {Tcl_FileObjCmd: rootname} testsetplatform { testsetplatform windows file rootname a\\b.c\\ } a\\b.c\\ set num 35 foreach outer { {} a .a a. a.a } { foreach inner { {} a .a a. a.a } { set thing [format %s/%s $outer $inner] ;test cmdAH-10.$num {Tcl_FileObjCmd: rootname and extension options} testsetplatform " testsetplatform unix [list format %s%s [file rootname $thing] [file ext $thing]] " $thing incr num } } # extension test cmdAH-11.1 {Tcl_FileObjCmd: extension} -returnCodes error -body { file extension a b } -result {wrong # args: should be "file extension name"} test cmdAH-11.2 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension {} } {} test cmdAH-11.3 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file ext foo } {} test cmdAH-11.4 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension foo. } . test cmdAH-11.5 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension .foo } .foo test cmdAH-11.6 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension abc.def } .def test cmdAH-11.7 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension abc.def.ghi } .ghi test cmdAH-11.8 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension a/b/c.d } .d test cmdAH-11.9 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension a/b.c/d } {} test cmdAH-11.10 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform unix file extension a/b.c/ } {} test cmdAH-11.23 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension {} } {} test cmdAH-11.24 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file ext foo } {} test cmdAH-11.25 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension foo. } . test cmdAH-11.26 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension .foo } .foo test cmdAH-11.27 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension abc.def } .def test cmdAH-11.28 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension abc.def.ghi } .ghi test cmdAH-11.29 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a/b/c.d } .d test cmdAH-11.30 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a/b.c/d } {} test cmdAH-11.31 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a\\b.c\\ } {} test cmdAH-11.32 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a\\b\\c.d } .d test cmdAH-11.33 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a\\b.c\\d } {} test cmdAH-11.34 {Tcl_FileObjCmd: extension} testsetplatform { testsetplatform windows file extension a\\b.c\\ } {} foreach {test onPlatform value result} { cmdAH-11.35 unix a..b .b cmdAH-11.36 windows a..b .b cmdAH-11.37 unix a...b .b cmdAH-11.38 windows a...b .b cmdAH-11.39 unix a.c..b .b cmdAH-11.40 windows a.c..b .b cmdAH-11.41 unix ..b .b cmdAH-11.42 windows ..b .b } { test $test {Tcl_FileObjCmd: extension} testsetplatform " testsetplatform $onPlatform file extension $value " $result } # pathtype test cmdAH-12.1 {Tcl_FileObjCmd: pathtype} -returnCodes error -body { file pathtype a b } -result {wrong # args: should be "file pathtype name"} test cmdAH-12.2 {Tcl_FileObjCmd: pathtype} testsetplatform { testsetplatform unix file pathtype /a } absolute test cmdAH-12.3 {Tcl_FileObjCmd: pathtype} testsetplatform { testsetplatform unix file p a } relative test cmdAH-12.4 {Tcl_FileObjCmd: pathtype} testsetplatform { testsetplatform windows file pathtype c:a } volumerelative # split test cmdAH-13.1 {Tcl_FileObjCmd: split} -returnCodes error -body { file split a b } -result {wrong # args: should be "file split name"} test cmdAH-13.2 {Tcl_FileObjCmd: split} testsetplatform { testsetplatform unix file split a } a test cmdAH-13.3 {Tcl_FileObjCmd: split} testsetplatform { testsetplatform unix file split a/b } {a b} # join test cmdAH-14.1 {Tcl_FileObjCmd: join} testsetplatform { testsetplatform unix file join a } a test cmdAH-14.2 {Tcl_FileObjCmd: join} testsetplatform { testsetplatform unix file join a b } a/b test cmdAH-14.3 {Tcl_FileObjCmd: join} testsetplatform { testsetplatform unix file join a b c d } a/b/c/d # error handling of Tcl_TranslateFileName test cmdAH-15.1 {Tcl_FileObjCmd} -constraints testsetplatform -body { testsetplatform unix file atime ~_bad_user } -returnCodes error -result {could not read "~_bad_user": no such file or directory} catch {testsetplatform $platform} # readable set gorpfile [makeFile abcde górp.file] set dirfile [makeDirectory dir.file] test cmdAH-16.1 {Tcl_FileObjCmd: readable} { -returnCodes error -body {file readable a b} -result {wrong # args: should be "file readable name"} } test cmdAH-16.2 {Tcl_FileObjCmd: readable} { -constraints testchmod -setup {testchmod 0o444 $gorpfile} -body {file readable $gorpfile} -result 1 } test cmdAH-16.3 {Tcl_FileObjCmd: readable} { -constraints {unix notRoot testchmod notWsl} -setup {testchmod 0o333 $gorpfile} -body {file readable $gorpfile} -result 0 } # writable test cmdAH-17.1 {Tcl_FileObjCmd: writable} { -returnCodes error -body {file writable a b} -result {wrong # args: should be "file writable name"} } test cmdAH-17.2 {Tcl_FileObjCmd: writable} { -constraints {notRoot testchmod} -setup {testchmod 0o555 $gorpfile} -body {file writable $gorpfile} -result 0 } test cmdAH-17.3 {Tcl_FileObjCmd: writable} { -constraints testchmod -setup {testchmod 0o222 $gorpfile} -body {file writable $gorpfile} -result 1 } # executable removeFile $gorpfile removeDirectory $dirfile set dirfile [makeDirectory dir.file] set gorpfile [makeFile abcde górp.file] test cmdAH-18.1 {Tcl_FileObjCmd: executable} -returnCodes error -body { file executable a b } -result {wrong # args: should be "file executable name"} test cmdAH-18.2 {Tcl_FileObjCmd: executable} {notRoot notWsl} { file executable $gorpfile } 0 test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unix testchmod} { # Only on unix will setting the execute bit on a regular file cause that # file to be executable. testchmod 0o775 $gorpfile file exe $gorpfile } 1 test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body { # On windows, must be a .exe, .com, etc. set x {} set gorpexes {} foreach ext {exe com cmd bat} { lappend x [file exe nosuchfile.$ext] set gorpexe [makeFile foo gorp.$ext] lappend gorpexes $gorpexe lappend x [file exe $gorpexe] [file exe [string toupper $gorpexe]] } set x } -cleanup { foreach gorpexe $gorpexes { removeFile $gorpexe } } -result {0 1 1 0 1 1 0 1 1 0 1 1} test cmdAH-18.6 {Tcl_FileObjCmd: executable} {} { # Directories are always executable. file exe $dirfile } 1 removeDirectory $dirfile removeFile $gorpfile set linkfile [file join [temporaryDirectory] link.file] file delete $linkfile # exists test cmdAH-19.1 {Tcl_FileObjCmd: exists} -returnCodes error -body { file exists a b } -result {wrong # args: should be "file exists name"} test cmdAH-19.2 {Tcl_FileObjCmd: exists} {file exists $gorpfile} 0 test cmdAH-19.3 {Tcl_FileObjCmd: exists} { file exists [file join [temporaryDirectory] dir.file górp.file] } 0 catch { set gorpfile [makeFile abcde górp.file] set dirfile [makeDirectory dir.file] set subgorp [makeFile 12345 [file join $dirfile górp.file]] } test cmdAH-19.4 {Tcl_FileObjCmd: exists} { file exists $gorpfile } 1 test cmdAH-19.5 {Tcl_FileObjCmd: exists} { file exists $subgorp } 1 # nativename test cmdAH-19.6 {Tcl_FileObjCmd: nativename} -body { testsetplatform unix file nativename a/b } -constraints testsetplatform -cleanup { testsetplatform $platform } -result a/b test cmdAH-19.7 {Tcl_FileObjCmd: nativename} -body { testsetplatform windows file nativename a/b } -constraints testsetplatform -cleanup { testsetplatform $platform } -result {a\b} test cmdAH-19.9 {Tcl_FileObjCmd: ~ : exists} { file exists ~nOsUcHuSeR } 0 test cmdAH-19.10 {Tcl_FileObjCmd: ~ : nativename} -body { file nativename ~nOsUcHuSeR } -result ~nOsUcHuSeR # The test below has to be done in /tmp rather than the current directory in # order to guarantee (?) a local file system: some NFS file systems won't do # the stuff below correctly. test cmdAH-19.11 {Tcl_FileObjCmd: exists} -constraints {unix notRoot} -setup { file delete -force /tmp/tcl.foo.dir/file file delete -force /tmp/tcl.foo.dir } -body { makeDirectory /tmp/tcl.foo.dir makeFile 12345 /tmp/tcl.foo.dir/file file attributes /tmp/tcl.foo.dir -permissions 0 file exists /tmp/tcl.foo.dir/file } -cleanup { file attributes /tmp/tcl.foo.dir -permissions 0o775 removeFile /tmp/tcl.foo.dir/file removeDirectory /tmp/tcl.foo.dir } -result 0 test cmdAH-19.12 {Bug 3608360: [file exists] mustn't do globbing} -setup { set newdirfile [makeDirectory newdir.file] set cwd [pwd] cd $newdirfile # Content of file is totally unimportant; name is *not* set innocentBystander [makeFile "abc" [file join $newdirfile foo.bar]] } -body { list [file exists foo.bar] [file exists *.bar] } -cleanup { cd $cwd removeFile $innocentBystander removeDirectory $newdirfile } -result {1 0} # Stat related commands catch {testsetplatform $platform} removeFile $gorpfile set gorpfile [makeFile "Test string" górp.file] catch {file attributes $gorpfile -permissions 0o765} # avoid problems with non-local filesystems if {[testConstraint unix] && [file exists /tmp]} { set file [makeFile "data" touch.me /tmp] } else { set file [makeFile "data" touch.me] } # atime test cmdAH-20.1 {Tcl_FileObjCmd: atime} -returnCodes error -body { file atime a b c } -result {wrong # args: should be "file atime name ?time?"} test cmdAH-20.2 {Tcl_FileObjCmd: atime} -setup { unset -nocomplain stat } -body { file stat $gorpfile stat list [expr {[file mtime $gorpfile] == $stat(mtime)}] \ [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-20.3 {Tcl_FileObjCmd: atime} { list [catch {file atime _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-20.4 {Tcl_FileObjCmd: atime} -returnCodes error -body { file atime $file notint } -result {expected integer but got "notint"} test cmdAH-20.5 {Tcl_FileObjCmd: atime touch} {unix} { set atime [file atime $file] after 1100; # pause a sec to notice change in atime set newatime [clock seconds] set modatime [file atime $file $newatime] expr {$newatime == $modatime ? 1 : "$newatime != $modatime"} } 1 test cmdAH-20.6 {Tcl_FileObjCmd: atime touch} -setup { set old [pwd] cd $::tcltest::temporaryDirectory set volumetype [testvolumetype] cd $old } -constraints {win testvolumetype} -body { if {"NTFS" ne $volumetype} { # Windows FAT doesn't understand atime, but NTFS does. May also fail # for Windows on NFS mounted disks. return 1 } cd $old set atime [file atime $file] after 1100; # pause a sec to notice change in atime set newatime [clock seconds] set modatime [file atime $file $newatime] expr {$newatime == $modatime ? 1 : "$newatime != $modatime"} } -result 1 test cmdAH-20.7 { Tcl_FileObjCmd: atime (built-in Windows names) } -constraints {win} -body { file atime con } -result "could not get access time for file \"con\"" -returnCodes error test cmdAH-20.7.1 { Tcl_FileObjCmd: atime (built-in Windows names with dir path and extension) } -constraints {win} -body { file atime [file join [temporaryDirectory] CON.txt] } -match regexp -result {could not (?:get access time|read)} -returnCodes error if {[testConstraint unix] && [file exists /tmp]} { removeFile touch.me /tmp } else { removeFile touch.me } # isdirectory test cmdAH-21.1 {Tcl_FileObjCmd: isdirectory} -returnCodes error -body { file isdirectory a b } -result {wrong # args: should be "file isdirectory name"} test cmdAH-21.2 {Tcl_FileObjCmd: isdirectory} {file isdirectory $gorpfile} 0 test cmdAH-21.3 {Tcl_FileObjCmd: isdirectory} {file isdirectory $dirfile} 1 # isfile test cmdAH-22.1 {Tcl_FileObjCmd: isfile} -returnCodes error -body { file isfile a b } -result {wrong # args: should be "file isfile name"} test cmdAH-22.2 {Tcl_FileObjCmd: isfile} {file isfile $gorpfile} 1 test cmdAH-22.3 {Tcl_FileObjCmd: isfile} {file isfile $dirfile} 0 # lstat and readlink: don't run these tests everywhere, since not all sites # will have symbolic links catch {file link -symbolic $linkfile $gorpfile} test cmdAH-23.1 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a } -result {could not read "a": no such file or directory} test cmdAH-23.2 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a b c } -result {wrong # args: should be "file lstat name ?varName?"} test cmdAH-23.3 {Tcl_FileObjCmd: lstat} -setup { unset -nocomplain stat } -constraints {unix nonPortable} -body { file lstat $linkfile stat lsort [array names stat] } -result {atime ctime dev gid ino mode mtime nlink size type uid} test cmdAH-23.4 {Tcl_FileObjCmd: lstat} -setup { unset -nocomplain stat } -constraints {unix nonPortable} -body { file lstat $linkfile stat list $stat(nlink) [expr {$stat(mode) & 0o777}] $stat(type) } -result {1 511 link} test cmdAH-23.5 {Tcl_FileObjCmd: lstat errors} {nonPortable} { list [catch {file lstat _bogus_ stat} msg] [string tolower $msg] \ $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-23.6 {Tcl_FileObjCmd: lstat errors} -setup { unset -nocomplain x } -body { set x 44 list [catch {file lstat $gorpfile x} msg] $msg $errorCode } -result {1 {can't set "x(dev)": variable isn't array} {TCL LOOKUP VARNAME x}} unset -nocomplain stat # mkdir set dirA [file join [temporaryDirectory] a] set dirB [file join [temporaryDirectory] a] test cmdAH-23.7 {Tcl_FileObjCmd: mkdir} -setup { catch {file delete -force $dirA} } -body { file mkdir $dirA file isdirectory $dirA } -cleanup { file delete $dirA } -result {1} test cmdAH-23.8 {Tcl_FileObjCmd: mkdir} -setup { catch {file delete -force $dirA} } -body { file mkdir $dirA/b file isdirectory $dirA/b } -cleanup { file delete -force $dirA } -result {1} test cmdAH-23.9 {Tcl_FileObjCmd: mkdir} -setup { catch {file delete -force $dirA} } -body { file mkdir $dirA/b/c file isdirectory $dirA/b/c } -cleanup { file delete -force $dirA } -result {1} test cmdAH-23.10 {Tcl_FileObjCmd: mkdir} -setup { catch {file delete -force $dirA} catch {file delete -force $dirB} } -body { file mkdir $dirA/b $dirB/a/c list [file isdirectory $dirA/b] [file isdirectory $dirB/a/c] } -cleanup { file delete -force $dirA file delete -force $dirB } -result {1 1} test cmdAH-23.11 {Tcl_FileObjCmd: mkdir} { # Allow zero arguments (TIP 323) file mkdir } {} set file [makeFile "data" touch.me] # mtime test cmdAH-24.1 {Tcl_FileObjCmd: mtime} -returnCodes error -body { file mtime a b c } -result {wrong # args: should be "file mtime name ?time?"} test cmdAH-24.2 {Tcl_FileObjCmd: mtime} -setup { # Check (allowing for clock-skew and OS interrupts as best we can) that # the change in mtime on a file being written is the time elapsed between # writes. Note that this can still fail on very busy systems if there are # long preemptions between the writes and the reading of the clock, but # there's not much you can do about that other than the completely # horrible "keep on trying to write until you managed to do it all in less # than a second." - DKF waitForEvenSecondForFAT } -body { set f [open $gorpfile w] puts $f "More text" close $f set clockOld [clock seconds] set fileOld [file mtime $gorpfile] after 2000 set f [open $gorpfile w] puts $f "More text" close $f set clockNew [clock seconds] set fileNew [file mtime $gorpfile] expr { (($fileNew > $fileOld) && ($clockNew > $clockOld) && (abs(($fileNew-$fileOld) - ($clockNew-$clockOld)) <= 1)) ? "1" : "file:($fileOld=>$fileNew) clock:($clockOld=>$clockNew)" } } -result {1} test cmdAH-24.3 {Tcl_FileObjCmd: mtime} -setup { unset -nocomplain stat } -body { file stat $gorpfile stat list [expr {[file mtime $gorpfile] == $stat(mtime)}] \ [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-24.4 {Tcl_FileObjCmd: mtime} { list [catch {file mtime _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-24.5 {Tcl_FileObjCmd: mtime} -setup { # Under Unix, use a file in /tmp to avoid clock skew due to NFS. On other # platforms, just use a file in the local directory. if {[testConstraint unix]} { set name /tmp/tcl.test.[pid] } else { set name [file join [temporaryDirectory] tf] } } -body { # Make sure that a new file's time is correct. 10 seconds variance is # allowed used due to slow networks or clock skew on a network drive. file delete -force $name close [open $name w] expr {abs([clock seconds]-[file mtime $name])<10} } -cleanup { file delete $name } -result {1} test cmdAH-24.7 {Tcl_FileObjCmd: mtime} -returnCodes error -body { file mtime $file notint } -result {expected integer but got "notint"} test cmdAH-24.8 {Tcl_FileObjCmd: mtime touch} unix { set mtime [file mtime $file] after 1100; # pause a sec to notice change in mtime set newmtime [clock seconds] set modmtime [file mtime $file $newmtime] expr {$newmtime == $modmtime ? 1 : "$newmtime != $modmtime"} } 1 test cmdAH-24.9 {Tcl_FileObjCmd: mtime touch with non-ascii chars} -setup { set oldfile $file } -constraints unix -body { # introduce some non-ascii characters. append file • file delete -force $file file rename $oldfile $file set mtime [file mtime $file] after 1100; # pause a sec to notice change in mtime set newmtime [clock seconds] set modmtime [file mtime $file $newmtime] expr {$newmtime == $modmtime ? 1 : "$newmtime != $modmtime"} } -cleanup { file rename $file $oldfile } -result 1 test cmdAH-24.10 {Tcl_FileObjCmd: mtime touch} -constraints win -setup { waitForEvenSecondForFAT } -body { set mtime [file mtime $file] after 2100; # pause two secs to notice change in mtime on FAT fs'es set newmtime [clock seconds] set modmtime [file mtime $file $newmtime] expr {$newmtime == $modmtime ? 1 : "$newmtime != $modmtime"} } -result 1 test cmdAH-24.11 {Tcl_FileObjCmd: mtime touch with non-ascii chars} -setup { waitForEvenSecondForFAT set oldfile $file } -constraints win -body { # introduce some non-ascii characters. append file • file delete -force $file file rename $oldfile $file set mtime [file mtime $file] after 2100; # pause two secs to notice change in mtime on FAT fs'es set newmtime [clock seconds] set modmtime [file mtime $file $newmtime] expr {$newmtime == $modmtime ? 1 : "$newmtime != $modmtime"} } -cleanup { file rename $file $oldfile } -result 1 removeFile touch.me rename waitForEvenSecondForFAT {} test cmdAH-24.12 {Tcl_FileObjCmd: mtime and daylight savings} -setup { set name [file join [temporaryDirectory] clockchange] file delete -force $name close [open $name w] } -body { set time [clock scan "21:00:00 October 30 2004 GMT"] file mtime $name $time set newmtime [file mtime $name] expr {$newmtime == $time ? 1 : "$newmtime != $time"} } -cleanup { file delete $name } -result {1} # bug 1420432: setting mtime fails for directories on windows. test cmdAH-24.13 {Tcl_FileObjCmd: directory mtime} -setup { set dirname [file join [temporaryDirectory] tmp[pid]] file delete -force $dirname } -constraints tempNotWin -body { file mkdir $dirname set old [file mtime $dirname] file mtime $dirname 0 set new [file mtime $dirname] list $new [expr {$old != $new}] } -cleanup { file delete -force $dirname } -result {0 1} test cmdAH-24.14 { Tcl_FileObjCmd: mtime (built-in Windows names) } -constraints {win} -body { file mtime con } -result "could not get modification time for file \"con\"" -returnCodes error test cmdAH-24.14.1 { Tcl_FileObjCmd: mtime (built-in Windows names with dir path and extension) } -constraints {win} -body { file mtime [file join [temporaryDirectory] CON.txt] } -match regexp -result {could not (?:get modification time|read)} -returnCodes error # 3155760000 is 64-bit Unix time, Wed Jan 01 00:00:00 GMT 2070: test cmdAH-24.20.1 {Tcl_FileObjCmd: atime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit filetime64bit} -setup { set filename [makeFile "" foo.text] } -body { # This test may fail if your system does not have a 64-bit time_t. # That is to be expected and is not a problem with Tcl. list [file atime $filename 3155760000] [file atime $filename] } -cleanup { removeFile $filename } -result {3155760000 3155760000} test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -constraints {time64bit filetime64bit} -setup { set filename [makeFile "" foo.text] } -body { # This test may fail if your system does not have a 64-bit time_t. # That is to be expected and is not a problem with Tcl. list [file mtime $filename 3155760000] [file mtime $filename] } -cleanup { file delete -force $filename } -result {3155760000 3155760000} # owned test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body { file owned a b } -result {wrong # args: should be "file owned name"} test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -setup { set fn $gorpfile # prefer temp file to check owner (try to avoid bug [7de2d722bd]): if { [info exists ::env(TEMP)] && [file isdirectory $::env(TEMP)] && [file dirname $fn] ne [file normalize $::env(TEMP)] } { set fn [file join $::env(TEMP)/test-owner-from-tcl.txt] set fn [makeFile "data" test-owner-from-tcl.txt $::env(TEMP)] } # be sure we have really owned this file before trying to check that # (avoid dependency on admin with UAC and the setting "System objects: # Default owner for objects created by members of the Administrators group"): catch { exec takeown /F [file nativename $fn] } } -body { file owned $fn } -cleanup { if {$fn ne $gorpfile} { removeFile $fn } } -result 1 test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { # Avoid problems with AFS set tmpfile [makeFile "data" touch.me /tmp] } -body { file owned $tmpfile } -cleanup { removeFile touch.me /tmp } -result 1 test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} { file owned / } 0 test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints {win notWine} -body { if {[info exists env(SystemRoot)]} { file owned $env(SystemRoot) } else { file owned $env(windir) } } -result 0 test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body { file owned nosuchfile } -result 0 # readlink test cmdAH-26.1 {Tcl_FileObjCmd: readlink} -returnCodes error -body { file readlink a b } -result {wrong # args: should be "file readlink name"} test cmdAH-26.2 {Tcl_FileObjCmd: readlink} {unix nonPortable} { file readlink $linkfile } $gorpfile test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unix nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not readlink "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-26.5 {Tcl_FileObjCmd: readlink errors} {win nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not readlink "_bogus_": invalid argument} {POSIX EINVAL {invalid argument}}} # size test cmdAH-27.1 {Tcl_FileObjCmd: size} -returnCodes error -body { file size a b } -result {wrong # args: should be "file size name"} test cmdAH-27.2 {Tcl_FileObjCmd: size} { set oldsize [file size $gorpfile] set f [open $gorpfile a] fconfigure $f -translation lf puts $f "More text" close $f expr {[file size $gorpfile] - $oldsize} } {10} test cmdAH-27.3 {Tcl_FileObjCmd: size} { list [catch {file size _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-27.4 { Tcl_FileObjCmd: size (built-in Windows names) } -constraints {win} -body { file size con } -result 0 test cmdAH-27.4.1 { Tcl_FileObjCmd: size (built-in Windows names with dir path and extension) } -constraints {win} -body { try { set res [file size [file join [temporaryDirectory] con.txt]] } trap {POSIX ENOENT} {} { set res 0 } set res } -result 0 catch {testsetplatform $platform} removeFile $gorpfile set gorpfile [makeFile "Test string" górp.file] catch {file attributes $gorpfile -permissions 0o765} # stat test cmdAH-28.1 {Tcl_FileObjCmd: stat} -returnCodes error -body { file stat } -result {wrong # args: should be "file stat name ?varName?"} test cmdAH-28.2 {Tcl_FileObjCmd: stat} -returnCodes error -body { file stat _bogus_ a b } -result {wrong # args: should be "file stat name ?varName?"} test cmdAH-28.3 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain stat array set stat {blocks {} blksize {}} } -body { file stat $gorpfile stat unset stat(blocks) stat(blksize); # Ignore these fields; not always set lsort [array names stat] } -result {atime ctime dev gid ino mode mtime nlink size type uid} test cmdAH-28.4 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain stat } -body { file stat $gorpfile stat list $stat(nlink) $stat(size) $stat(type) } -result {1 12 file} test cmdAH-28.5 {Tcl_FileObjCmd: stat} -constraints {unix notWsl} -setup { unset -nocomplain stat } -body { file stat $gorpfile stat format 0o%03o [expr {$stat(mode) & 0o777}] } -result 0o765 test cmdAH-28.6 {Tcl_FileObjCmd: stat} { list [catch {file stat _bogus_ stat} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-28.7 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain x } -returnCodes error -body { set x 44 file stat $gorpfile x } -result {can't set "x(dev)": variable isn't array} test cmdAH-28.8 {Tcl_FileObjCmd: stat} -setup { set filename [makeFile "" foo.text] } -body { # Sign extension of purported unsigned short to int. file stat $filename stat expr {$stat(mode) > 0} } -cleanup { removeFile $filename } -result 1 test cmdAH-28.9 {Tcl_FileObjCmd: stat} win { # stat of root directory was failing. Don't care about answer, just that # test runs. Relative paths that resolve to root set old [pwd] cd c:/ file stat c: stat file stat c:. stat file stat . stat cd $old file stat / stat file stat c:/ stat file stat c:/. stat } {} test cmdAH-28.10 {Tcl_FileObjCmd: stat} {win nonPortable} { # stat of root directory was failing. Don't care about answer, just that # test runs. file stat //pop/$env(USERNAME) stat file stat //pop/$env(USERNAME)/ stat file stat //pop/$env(USERNAME)/. stat } {} test cmdAH-28.11 {Tcl_FileObjCmd: stat} -setup { set old [pwd] } -constraints {win nonPortable} -body { # stat of network directory was returning id of current local drive. cd c:/ file stat //pop/$env(USERNAME) stat expr {$stat(dev) == 2} } -cleanup { cd $old } -result 0 test cmdAH-28.12 {Tcl_FileObjCmd: stat} -setup { set filename [makeFile "" foo.test] } -body { # stat(mode) with S_IFREG flag was returned as a negative number if mode_t # was a short instead of an unsigned short. file stat $filename stat expr {$stat(mode) > 0} } -cleanup { removeFile $filename } -result 1 test cmdAH-28.13 {Tcl_FileObjCmd: stat (built-in Windows names)} -constraints {win} -setup { unset -nocomplain stat } -body { file stat con stat lmap elem {atime ctime dev gid ino mode mtime nlink size type uid} {set stat($elem)} } -result {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} test cmdAH-28.13.1 {Tcl_FileObjCmd: stat (built-in Windows names)} -constraints {win} -setup { unset -nocomplain stat } -body { try { file stat [file join [temporaryDirectory] CON.txt] stat set res [lmap elem {atime ctime dev gid ino mode mtime nlink size type uid} {set stat($elem)}] } trap {POSIX ENOENT} {} { set res {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} } set res } -result {0 0 -1 0 0 8630 0 0 0 characterSpecial 0} test cmdAH-28.14 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain stat } -body { file stat $gorpfile stat expr { [lsort -stride 2 [array get stat]] eq [lsort -stride 2 [file stat $gorpfile]] } } -result {1} unset -nocomplain stat # type test cmdAH-29.1 {Tcl_FileObjCmd: type} -returnCodes error -body { file type a b } -result {wrong # args: should be "file type name"} test cmdAH-29.2 {Tcl_FileObjCmd: type} { file type $dirfile } directory test cmdAH-29.3.0 {Tcl_FileObjCmd: delete removes link not file} {unix nonPortable} { set exists [list [file exists $linkfile] [file exists $gorpfile]] file delete $linkfile set exists2 [list [file exists $linkfile] [file exists $gorpfile]] list $exists $exists2 } {{1 1} {0 1}} test cmdAH-29.3 {Tcl_FileObjCmd: type} { file type $gorpfile } file test cmdAH-29.4 {Tcl_FileObjCmd: type} -constraints {unix} -setup { catch {file delete $linkfile} } -body { # Unlike [exec ln -s], [file link] requires an existing target file link -symbolic $linkfile $gorpfile file type $linkfile } -cleanup { file delete $linkfile } -result link test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory notWine} -setup { set tempdir [makeDirectory temp] } -body { set linkdir [file join [temporaryDirectory] link.dir] file link -symbolic $linkdir $tempdir file type $linkdir } -cleanup { file delete $linkdir removeDirectory $tempdir } -result link test cmdAH-29.5 {Tcl_FileObjCmd: type} { list [catch {file type _bogus_} msg] [string tolower $msg] $errorCode } {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-29.6 { Tcl_FileObjCmd: type (built-in Windows names) } -constraints {win} -body { file type con } -result "characterSpecial" test cmdAH-29.6.1 { Tcl_FileObjCmd: type (built-in Windows names, with dir path and extension) } -constraints {win} -body { try { set res [file type [file join [temporaryDirectory] CON.txt]] } trap {POSIX ENOENT} {} { set res {characterSpecial} } set res } -result "characterSpecial" # Error conditions test cmdAH-30.1 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file gorp x } -result {unknown or ambiguous subcommand "gorp": must be atime, attributes, channels, copy, delete, dirname, executable, exists, extension, home, isdirectory, isfile, join, link, lstat, mkdir, mtime, nativename, normalize, owned, pathtype, readable, readlink, rename, rootname, separator, size, split, stat, system, tail, tempdir, tempfile, tildeexpand, type, volumes, or writable} test cmdAH-30.2 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file ex x } -match glob -result {unknown or ambiguous subcommand "ex": must be *} test cmdAH-30.3 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file is x } -match glob -result {unknown or ambiguous subcommand "is": must be *} test cmdAH-30.4 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file z x } -match glob -result {unknown or ambiguous subcommand "z": must be *} test cmdAH-30.5 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file read x } -match glob -result {unknown or ambiguous subcommand "read": must be *} test cmdAH-30.6 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file s x } -match glob -result {unknown or ambiguous subcommand "s": must be *} test cmdAH-30.7 {Tcl_FileObjCmd: error conditions} -returnCodes error -body { file t x } -match glob -result {unknown or ambiguous subcommand "t": must be *} # channels # In testing 'file channels', we need to make sure that a channel created in # one interp isn't visible in another. interp create simpleInterp interp create -safe safeInterp interp create catch {safeInterp expose file file} test cmdAH-31.1 {Tcl_FileObjCmd: channels, too many args} -body { file channels a b } -returnCodes error -result {wrong # args: should be "file channels ?pattern?"} test cmdAH-31.2 {Tcl_FileObjCmd: channels, too many args} { # Normal interps start out with only the standard channels lsort [simpleInterp eval [list file chan]] } {stderr stdin stdout} test cmdAH-31.3 {Tcl_FileObjCmd: channels, globbing} { string equal [file channels] [file channels *] } {1} test cmdAH-31.4 {Tcl_FileObjCmd: channels, globbing} { lsort [file channels std*] } {stderr stdin stdout} set newFileId [open $gorpfile w] test cmdAH-31.5 {Tcl_FileObjCmd: channels} { set res [file channels $newFileId] string equal $newFileId $res } {1} test cmdAH-31.6 {Tcl_FileObjCmd: channels in other interp} { # Safe interps start out with no channels safeInterp eval [list file channels] } {} test cmdAH-31.7 {Tcl_FileObjCmd: channels in other interp} -body { safeInterp eval [list puts $newFileId "hello"] } -returnCodes error -result "can not find channel named \"$newFileId\"" interp share {} $newFileId safeInterp interp share {} stdout safeInterp test cmdAH-31.8 {Tcl_FileObjCmd: channels in other interp} { # $newFileId should now be visible in both interps list [file channels $newFileId] \ [safeInterp eval [list file channels $newFileId]] } [list $newFileId $newFileId] test cmdAH-31.9 {Tcl_FileObjCmd: channels in other interp} { lsort [safeInterp eval [list file channels]] } [lsort [list stdout $newFileId]] test cmdAH-31.10 {Tcl_FileObjCmd: channels in other interp} { # we can now write to $newFileId from child safeInterp eval [list puts $newFileId "hello"] } {} interp transfer {} $newFileId safeInterp test cmdAH-31.11 {Tcl_FileObjCmd: channels in other interp} { # $newFileId should now be visible only in safeInterp list [file channels $newFileId] \ [safeInterp eval [list file channels $newFileId]] } [list {} $newFileId] test cmdAH-31.12 {Tcl_FileObjCmd: channels in other interp} { lsort [safeInterp eval [list file channels]] } [lsort [list stdout $newFileId]] test cmdAH-31.13 {Tcl_FileObjCmd: channels in other interp} { safeInterp eval [list close $newFileId] safeInterp eval [list file channels] } {stdout} # Temp files (TIP#210) test cmdAH-32.1 {file tempfile - usage} -returnCodes error -body { file tempfile a b c } -result {wrong # args: should be "file tempfile ?nameVar? ?template?"} test cmdAH-32.2 {file tempfile - returns a read/write channel} -body { set f [file tempfile] puts $f ok seek $f 0 gets $f } -cleanup { catch {close $f} } -result ok test cmdAH-32.3 {file tempfile - makes filenames} -setup { unset -nocomplain name } -body { set result [info exists name] set f [file tempfile name] lappend result [info exists name] [file exists $name] close $f lappend result [file exists $name] } -cleanup { catch {close $f} catch {file delete $name} } -result {0 1 1 1} # We try to obey the template on Unix, but don't (currently) bother on Win test cmdAH-32.4 {file tempfile - templates} -constraints unix -body { close [file tempfile name foo] expr {[string match foo* [file tail $name]] ? "ok" : "foo produced $name"} } -cleanup { catch {file delete $name} } -result ok test cmdAH-32.5 {file tempfile - templates} -constraints unix -body { set template [file join $dirfile foo] close [file tempfile name $template] expr {[string match $template* $name] ? "ok" : "$template produced $name"} } -cleanup { catch {file delete $name} } -result ok # Not portable; not all Unix systems have mkstemps() test cmdAH-32.6 {file tempfile - templates} -body { set template [file join $dirfile foo] close [file tempfile name $template.bar] expr {[string match $template*.bar $name] ? "ok" : "$template.bar produced $name"} } -constraints {unix nonPortable} -cleanup { catch {file delete $name} } -result ok test cmdAH-33.1 {file tempdir} -body { file tempdir a b } -returnCodes error -result {wrong # args: should be "file tempdir ?template?"} test cmdAH-33.2 {file tempdir} -body { set d [file tempdir] list [file tail $d] [file exists $d] [file type $d] \ [glob -nocomplain -directory $d *] } -match glob -result {tcl_* 1 directory {}} -cleanup { catch {file delete $d} } test cmdAH-33.3 {file tempdir} -body { set d [file tempdir gorp] list [file tail $d] [file exists $d] [file type $d] \ [glob -nocomplain -directory $d *] } -match glob -result {gorp_* 1 directory {}} -cleanup { catch {file delete $d} } test cmdAH-33.4 {file tempdir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base } -body { set pre [glob -nocomplain -directory $base *] set d [file normalize [file tempdir $base/]] list [string map [list $base GORP:] $d] [file exists $d] [file type $d] \ $pre [glob -nocomplain -directory $d *] } -match glob -result {GORP:/tcl_* 1 directory {} {}} -cleanup { catch {file delete -force $base} } test cmdAH-33.5 {file tempdir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base } -body { set pre [glob -nocomplain -directory $base *] set d [file normalize [file tempdir $base/gorp]] list [string map [list $base GORP:] $d] [file exists $d] [file type $d] \ $pre [glob -nocomplain -directory $d *] } -match glob -result {GORP:/gorp_* 1 directory {} {}} -cleanup { catch {file delete -force $base} } test cmdAH-33.6 {file tempdir: missing parent dir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base } -returnCodes error -body { file tempdir $base/quux/ } -cleanup { catch {file delete -force $base} } -result {can't create temporary directory: no such file or directory} test cmdAH-33.7 {file tempdir: missing parent dir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base } -returnCodes error -body { file tempdir $base/quux/foobar } -cleanup { catch {file delete -force $base} } -result {can't create temporary directory: no such file or directory} # This shouldn't work, but just in case a test above failed... catch {close $newFileId} interp delete safeInterp interp delete simpleInterp # cleanup catch {testsetplatform $platform} unset -nocomplain platform # Tcl_ForObjCmd is tested in for.test catch {file attributes $dirfile -permissions 0o777} removeDirectory $dirfile removeFile $gorpfile # No idea how well [removeFile] copes with links... file delete $linkfile cd $cmdAHwd ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/clock.test0000644000175000017500000737452215104661341014731 0ustar sergeisergei# clock.test -- # # This test file covers the 'clock' command that manipulates time. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 2004 Kevin B. Kenny. All rights reserved. # Copyright © 2015 Sergey G. Brester aka sebres. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } if {[testConstraint win]} { if {[catch { ::tcltest::loadTestedCommands }]} { # nothing to be done (registry loaded on demand) } } # Application Verifier hooks system calls in a way that locale # detection fails. Disable tests that depend on that if # it is running. testConstraint noappverifier [expr { [llength [info commands testappverifierpresent]] == 0 || ![testappverifierpresent]}] package require msgcat 1.4 testConstraint detroit \ [expr {![catch {clock format 0 -timezone :America/Detroit -format %z}]}] testConstraint y2038 \ [expr {[clock format 2158894800 -format %z -timezone :America/Detroit] eq {-0400}}] # Test with both validity modes - validate on / off: set valid_mode [::tcl::unsupported::clock::configure -valid] # Wrapper to show validity mode in the test-case name (for possible errors): proc test {args} { variable valid_mode lset args 0 [lindex $args 0].vm:$valid_mode tailcall ::tcltest::test {*}$args } puts [outputChannel] " Validity default mode: [expr {$valid_mode ? "on": "off"}]" testConstraint valid_off [expr {![::tcl::unsupported::clock::configure -valid]}] if {[namespace which -command ::tcl::unsupported::timerate] ne ""} { namespace import ::tcl::unsupported::timerate } # TEST PLAN # clock-0: # several base test-cases # # clock-1: # [clock format] - tests of bad and empty arguments # # clock-2 # formatting of year, month and day of month # # clock-3 # formatting of fiscal year, fiscal week and day of week. # # clock-4 # formatting of time of day. # # clock-5 # handling of Daylight Saving Time in a known locale, formatting of # %z and %Z # # clock-6 # input conversion - seconds # # clock-7 # input conversion - Julian Day # # clock-8 # input conversion - ccyymmdd # # clock-9 # input conversion - ccyymmdd (test that %s and %J take precedence) # # clock-10 # input conversion - ccyyddd # # clock-11 # input conversion - relative precedence of ccyyddd and ccyymmdd # (tests the 'rightmost field' comparison) # # clock-12 # input conversion - ccyyWwwd # # clock-13 # input conversion - ccyyWwwd (test that %s and %J take precedence, # and that invalid days are rejected). # # clock-14 # input conversion - yymmdd # # clock-15 # precedence - yymmdd # # clock-16 # input conversion and precedence - yyddd # # clock-17 # input conversion - yyWwwd # # clock-18 # precedence - yyWwwd # # clock-19 # input conversion - mmdd # # clock-20 # precedence - mmdd # # clock-21 # input conversion and precedence - ddd # # clock-22 # input conversion - Wwwd # # clock-23 # precedence - Wwwd # # clock-24 # input conversion - naked day of month # # clock-25 # precedence - naked day of month # # clock-26 # input conversion - naked day of week # # clock-27 # precedence - day of week # # clock-28 # scan with empty -format is midnight of base date # # clock-29 # scanning of all time-of-day formats # # clock-30 # [clock add] # # clock-31 # Use of -locale system on Windows # # clock-32 # Handling of the Julian-Gregorian transition # # clock-33 # Legacy tests - [clock clicks] # # clock-34 # Legacy tests - [clock scan] without -format # # clock-35 # Legacy tests - [clock seconds] # # clock-36 # Legacy tests - [clock scan] with 'next monthname' # # clock-37 # Test that -gmt does not affect the value of %s # # clock-38 # Regression test to verify that changes in TZ work # both east and west of Greenwich # # clock-68 # Leap seconds/minutes/hours # Note that all code between comments '# BEGIN' and '# END' is # autogenerated by 'tools/makeTestCases.tcl'. DO NOT EDIT CODE BETWEEN # '# BEGIN' and '# END'. # Define a fictitious locale, 'en_US_roman', for formatting of clock # strings with localized numerics and eras. This locale will be used # in testing the 'clock' command. namespace eval ::tcl::clock { ::msgcat::mcmset en_US_roman { LOCALE_ERAS { {-62164627200 {} 0} {-59008867200 c 100} {-55853107200 cc 200} {-52697347200 ccc 300} {-49541587200 cd 400} {-46385827200 d 500} {-43230067200 dc 600} {-40074307200 dcc 700} {-36918547200 dccc 800} {-33762787200 cm 900} {-30607027200 m 1000} {-27451267200 mc 1100} {-24295507200 mcc 1200} {-21139747200 mccc 1300} {-17983987200 mcd 1400} {-14828227200 md 1500} {-11672467200 mdc 1600} {-8516707200 mdcc 1700} {-5364662400 mdccc 1800} {-2208988800 mcm 1900} {946684800 mm 2000} } LOCALE_NUMERALS { ? i ii iii iv v vi vii viii ix x xi xii xiii xiv xv xvi xvii xviii xix xx xxi xxii xxiii xxiv xxv xxvi xxvii xxviii xxix xxx xxxi xxxii xxxiii xxxiv xxxv xxxvi xxxvii xxxviii xxxix xl xli xlii xliii xliv xlv xlvi xlvii xlviii xlix l li lii liii liv lv lvi lvii lviii lix lx lxi lxii lxiii lxiv lxv lxvi lxvii lxviii lxix lxx lxxi lxxii lxxiii lxxiv lxxv lxxvi lxxvii lxxviii lxxix lxxx lxxxi lxxxii lxxxiii lxxxiv lxxxv lxxxvi lxxxvii lxxxviii lxxxix xc xci xcii xciii xciv xcv xcvi xcvii xcviii xcix c } DATE_FORMAT {%m/%d/%Y} TIME_FORMAT {%H:%M:%S} DATE_TIME_FORMAT {%x %X} LOCALE_DATE_FORMAT {die %Od mensis %Om annoque %EY} LOCALE_TIME_FORMAT {%OH h %OM m %OS s} LOCALE_DATE_TIME_FORMAT {%Ex %EX} BCE {Before Christ} CE {Anno Domini} } } #---------------------------------------------------------------------- # # The tests for the Windows platform are careful *not* to muck with # the system registry. Instead, the 'registry' command is overridden # in the '::tcl::clock' namespace. # #---------------------------------------------------------------------- namespace eval ::testClock { namespace export registry set reg \ [dict create \ HKEY_CURRENT_USER\\Control\ Panel\\International \ [dict create \ locale 0409 \ sShortDate dd-MMM-yyyy \ sLongDate "'the' dd''' day of' MMMM yyyy" \ sTimeFormat "h:mm:ss tt"] \ HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\TimeZoneInformation \ [dict create \ Bias 300 \ StandardBias 0 \ DaylightBias -60 \ StandardStart \x00\x00\x0B\x00\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00 \ DaylightStart \x00\x00\x03\x00\x02\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00]] } proc ::testClock::registry { cmd path key } { variable reg if { $cmd ne {get} } { return -code error "test case attempts to write/query the registry" } if { ![dict exists $reg $path $key] } { return -code error "test case attempts to read unknown registry entry $path $key" } return [dict get $reg $path $key] } proc ::testClock::_setupRegistry {} { rename ::tcl::clock::_hasRegistry ::tcl::clock::_org_hasRegistry proc ::tcl::clock::_hasRegistry {} {return 1} namespace eval ::tcl::clock { namespace import -force ::testClock::registry } ::tcl::clock::ClearCaches } proc ::testClock::_cleanupRegistry {} { if {[namespace which -command ::tcl::clock::registry] ne ""} { rename ::tcl::clock::registry {} } rename ::tcl::clock::_hasRegistry {} rename ::tcl::clock::_org_hasRegistry ::tcl::clock::_hasRegistry ::tcl::clock::ClearCaches } proc ::testClock::_setupNoTZ {} { if { [info exists ::env(TZ)] } { variable orgTZ $::env(TZ) unset ::env(TZ) } if { [info exists ::env(TCL_TZ)] } { variable orgTclTZ $::env(TCL_TZ) unset ::env(TCL_TZ) } } proc ::testClock::_cleanupNoTZ {} { variable orgTclTZ if { [info exists orgTclTZ] } { set ::env(TCL_TZ) $orgTclTZ } else { unset -nocomplain ::env(TCL_TZ) } variable orgTZ if { [info exists orgTZ] } { set ::env(TZ) $orgTZ } else { unset -nocomplain ::env(TZ) } } # Don't confuse all following tests with TZ or TCL_TZ environment vars (unset them here): ::testClock::_setupNoTZ # Base test cases: # no lazy creation of clock-ensemble (interim, bug [9889f96f4da77e3b], [31fd84270644f67d]), # so ensemble created implicitely in init.tcl test clock-0.1 "initial: auto-loading of ensemble and stubs on demand" -setup { set i [interp create]; # because clock can be used somewhere, test it in new interp: } -body { $i eval { lappend ret ens:[namespace ensemble exists ::clock] clock seconds; # init ensemble (but not yet stubs, loading of clock.tcl retarded) lappend ret ens:[namespace ensemble exists ::clock] lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] clock format now; # clock.tcl stubs expected lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] } } -cleanup { interp delete $i } -result {ens:1 ens:1 stubs:0 stubs:1} test clock-0.1a "initial: safe interpreter shares clock command with parent" -setup { set i [interp create] $i eval {set sci [interp create -safe]} } -body { $i eval { lappend ret ens:[namespace ensemble exists ::clock] $sci eval { clock seconds }; # init ensemble (but not yet stubs, loading of clock.tcl retarded) lappend ret ens:[namespace ensemble exists ::clock] lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] $sci eval { clock format now }; # clock.tcl stubs expected lappend ret stubs:[expr {[namespace which -command ::tcl::clock::GetSystemTimeZone] ne ""}] } } -cleanup { interp delete $i } -result {ens:1 ens:1 stubs:0 stubs:1} test clock-0.2 "initial: loading of format/locale does not overwrite interp state (errorInfo)" -setup { # be sure - we have no cached locale/msgcat, etc: if {[namespace which -command ::tcl::clock::ClearCaches] ne ""} { ::tcl::clock::ClearCaches } } -body { if {[catch { return -level 0 -code error -errorcode {EXPERR TEST-ERROR} -errorinfo "ERROR expected error" test }]} { clock format now -locale de; # should not overwrite error code/info list $::errorCode $::errorInfo } } -result {{EXPERR TEST-ERROR} {ERROR expected error}} # Test some of the basics of [clock format] set syntax "clockval|now ?-format string? ?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?" test clock-1.0 "clock format - wrong # args" { list [catch {clock format} msg] $msg $::errorCode } [subst {1 {wrong # args: should be "clock format $syntax"} {CLOCK wrongNumArgs}}] test clock-1.0.1 "clock format - wrong # args (compiled ensemble with invalid syntax)" { list [catch {clock format 0 -too-few-options-4-test} msg] $msg $::errorCode } [subst {1 {wrong # args: should be "clock format $syntax"} {CLOCK wrongNumArgs}}] test clock-1.1 "clock format - bad time" { list [catch {clock format foo} msg opt] $msg [dict getd $opt -errorcode {}] } {1 {bad seconds "foo": must be now or integer} {CLOCK badOption foo}} test clock-1.2 "clock format - bad gmt val" { list [catch {clock format 0 -gmt foo} msg] $msg } {1 {expected boolean value but got "foo"}} test clock-1.3 "clock format - empty val" { clock format 0 -gmt 1 -format "" } {} test clock-1.4 "clock format - bad flag" { # range error message for possible extensions: list [catch {clock format 0 -oops badflag} msg] $msg $::errorCode } [subst {1 {bad option "-oops": must be -format, -gmt, -locale, or -timezone} {CLOCK badOption -oops}}] test clock-1.4.1 "clock format - unexpected option for this sub-command" { # range error message for possible extensions: list [catch {clock format 0 -base 0} msg] $msg $::errorCode } [subst {1 {bad option "-base": must be -format, -gmt, -locale, or -timezone} {CLOCK badOption -base}}] test clock-1.5 "clock format - bad timezone (not found)" -body { clock format 0 -format "%s" -timezone :NOWHERE } -returnCodes 1 -result {time zone ":NOWHERE" not found} -errorCode {CLOCK badTimeZone :NOWHERE} foreach tz [list {*}{ ../UNSAFEPATH/NOWHERE UNSAFEPATH/../GMT //UNSAFEPATH/NOWHERE zipfs:/UNSAFEPATH/NOWHERE C:/UNSAFEPATH/NOWHERE } [list $::tcl::clock::DataDir/GMT] ] { test clock-1.5.1.$tz "clock format - bad timezone (not valid - unsafe path)" -body { clock format 0 -format "%s" -timezone $tz } -returnCodes 1 -result "time zone \":$tz\" not valid" -errorCode [list CLOCK badTimeZone :$tz] } test clock-1.6 "clock format - gmt + timezone" { list [catch {clock format 0 -timezone :GMT -gmt true} msg] $msg $::errorCode } {1 {cannot use -gmt and -timezone in same call} {CLOCK gmtWithTimezone}} test clock-1.7 "clock format - option abbreviations" { clock format 0 -g true -f "%Y-%m-%d" } 1970-01-01 test clock-1.7.1 "clock format - command abbreviations (compat regression test)" { clock f 0 -g 1 -f "%Y-%m-%d" } 1970-01-01 test clock-1.8 "clock format now" { # give one second more for test (if on boundary of the current second): set n [clock format [clock seconds] -g 1 -f "%s"] expr {[clock format now -g 1 -f "%s"] in [list $n [incr n]]} } 1 test clock-1.9 "clock arguments: option doubly present" { list [catch {clock format 0 -gmt 1 -gmt 0} result] $result } {1 {bad option "-gmt": doubly present}} test clock-1.10 {clock format: text with token (bug [a858d95f4bfddafb])} { clock format 0 -format text(%d) -gmt 1 } {text(01)} # BEGIN testcases2 # Test formatting of Gregorian year, month, day, all formats # Formats tested: %b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y %EY test clock-2.1 {conversion of 1872-01-01} { clock format -3092556304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1872 12:34:56 die i mensis i annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2404794 01 i 1 01/01/1872 die i mensis i annoque mdccclxxii 72 lxxii 1872} test clock-2.2 {conversion of 1872-01-31} { clock format -3089964304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1872 12:34:56 die xxxi mensis i annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2404824 01 i 1 01/31/1872 die xxxi mensis i annoque mdccclxxii 72 lxxii 1872} test clock-2.3 {conversion of 1872-02-01} { clock format -3089877904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1872 12:34:56 die i mensis ii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2404825 02 ii 2 02/01/1872 die i mensis ii annoque mdccclxxii 72 lxxii 1872} test clock-2.4 {conversion of 1872-02-29} { clock format -3087458704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1872 12:34:56 die xxix mensis ii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2404853 02 ii 2 02/29/1872 die xxix mensis ii annoque mdccclxxii 72 lxxii 1872} test clock-2.5 {conversion of 1872-03-01} { clock format -3087372304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1872 12:34:56 die i mensis iii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2404854 03 iii 3 03/01/1872 die i mensis iii annoque mdccclxxii 72 lxxii 1872} test clock-2.6 {conversion of 1872-03-31} { clock format -3084780304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1872 12:34:56 die xxxi mensis iii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2404884 03 iii 3 03/31/1872 die xxxi mensis iii annoque mdccclxxii 72 lxxii 1872} test clock-2.7 {conversion of 1872-04-01} { clock format -3084693904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1872 12:34:56 die i mensis iv annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2404885 04 iv 4 04/01/1872 die i mensis iv annoque mdccclxxii 72 lxxii 1872} test clock-2.8 {conversion of 1872-04-30} { clock format -3082188304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1872 12:34:56 die xxx mensis iv annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2404914 04 iv 4 04/30/1872 die xxx mensis iv annoque mdccclxxii 72 lxxii 1872} test clock-2.9 {conversion of 1872-05-01} { clock format -3082101904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1872 12:34:56 die i mensis v annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2404915 05 v 5 05/01/1872 die i mensis v annoque mdccclxxii 72 lxxii 1872} test clock-2.10 {conversion of 1872-05-31} { clock format -3079509904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1872 12:34:56 die xxxi mensis v annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2404945 05 v 5 05/31/1872 die xxxi mensis v annoque mdccclxxii 72 lxxii 1872} test clock-2.11 {conversion of 1872-06-01} { clock format -3079423504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1872 12:34:56 die i mensis vi annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2404946 06 vi 6 06/01/1872 die i mensis vi annoque mdccclxxii 72 lxxii 1872} test clock-2.12 {conversion of 1872-06-30} { clock format -3076917904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1872 12:34:56 die xxx mensis vi annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2404975 06 vi 6 06/30/1872 die xxx mensis vi annoque mdccclxxii 72 lxxii 1872} test clock-2.13 {conversion of 1872-07-01} { clock format -3076831504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1872 12:34:56 die i mensis vii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2404976 07 vii 7 07/01/1872 die i mensis vii annoque mdccclxxii 72 lxxii 1872} test clock-2.14 {conversion of 1872-07-31} { clock format -3074239504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1872 12:34:56 die xxxi mensis vii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2405006 07 vii 7 07/31/1872 die xxxi mensis vii annoque mdccclxxii 72 lxxii 1872} test clock-2.15 {conversion of 1872-08-01} { clock format -3074153104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1872 12:34:56 die i mensis viii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2405007 08 viii 8 08/01/1872 die i mensis viii annoque mdccclxxii 72 lxxii 1872} test clock-2.16 {conversion of 1872-08-31} { clock format -3071561104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1872 12:34:56 die xxxi mensis viii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2405037 08 viii 8 08/31/1872 die xxxi mensis viii annoque mdccclxxii 72 lxxii 1872} test clock-2.17 {conversion of 1872-09-01} { clock format -3071474704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1872 12:34:56 die i mensis ix annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2405038 09 ix 9 09/01/1872 die i mensis ix annoque mdccclxxii 72 lxxii 1872} test clock-2.18 {conversion of 1872-09-30} { clock format -3068969104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1872 12:34:56 die xxx mensis ix annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2405067 09 ix 9 09/30/1872 die xxx mensis ix annoque mdccclxxii 72 lxxii 1872} test clock-2.19 {conversion of 1872-10-01} { clock format -3068882704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1872 12:34:56 die i mensis x annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2405068 10 x 10 10/01/1872 die i mensis x annoque mdccclxxii 72 lxxii 1872} test clock-2.20 {conversion of 1872-10-31} { clock format -3066290704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1872 12:34:56 die xxxi mensis x annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2405098 10 x 10 10/31/1872 die xxxi mensis x annoque mdccclxxii 72 lxxii 1872} test clock-2.21 {conversion of 1872-11-01} { clock format -3066204304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1872 12:34:56 die i mensis xi annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2405099 11 xi 11 11/01/1872 die i mensis xi annoque mdccclxxii 72 lxxii 1872} test clock-2.22 {conversion of 1872-11-30} { clock format -3063698704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1872 12:34:56 die xxx mensis xi annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2405128 11 xi 11 11/30/1872 die xxx mensis xi annoque mdccclxxii 72 lxxii 1872} test clock-2.23 {conversion of 1872-12-01} { clock format -3063612304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1872 12:34:56 die i mensis xii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2405129 12 xii 12 12/01/1872 die i mensis xii annoque mdccclxxii 72 lxxii 1872} test clock-2.24 {conversion of 1872-12-31} { clock format -3061020304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1872 12:34:56 die xxxi mensis xii annoque mdccclxxii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2405159 12 xii 12 12/31/1872 die xxxi mensis xii annoque mdccclxxii 72 lxxii 1872} test clock-2.25 {conversion of 1873-01-01} { clock format -3060933904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1873 12:34:56 die i mensis i annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2405160 01 i 1 01/01/1873 die i mensis i annoque mdccclxxiii 73 lxxiii 1873} test clock-2.26 {conversion of 1873-01-31} { clock format -3058341904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1873 12:34:56 die xxxi mensis i annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2405190 01 i 1 01/31/1873 die xxxi mensis i annoque mdccclxxiii 73 lxxiii 1873} test clock-2.27 {conversion of 1873-02-01} { clock format -3058255504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1873 12:34:56 die i mensis ii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2405191 02 ii 2 02/01/1873 die i mensis ii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.28 {conversion of 1873-02-28} { clock format -3055922704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1873 12:34:56 die xxviii mensis ii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2405218 02 ii 2 02/28/1873 die xxviii mensis ii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.29 {conversion of 1873-03-01} { clock format -3055836304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1873 12:34:56 die i mensis iii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2405219 03 iii 3 03/01/1873 die i mensis iii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.30 {conversion of 1873-03-31} { clock format -3053244304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1873 12:34:56 die xxxi mensis iii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2405249 03 iii 3 03/31/1873 die xxxi mensis iii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.31 {conversion of 1873-04-01} { clock format -3053157904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1873 12:34:56 die i mensis iv annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2405250 04 iv 4 04/01/1873 die i mensis iv annoque mdccclxxiii 73 lxxiii 1873} test clock-2.32 {conversion of 1873-04-30} { clock format -3050652304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1873 12:34:56 die xxx mensis iv annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2405279 04 iv 4 04/30/1873 die xxx mensis iv annoque mdccclxxiii 73 lxxiii 1873} test clock-2.33 {conversion of 1873-05-01} { clock format -3050565904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1873 12:34:56 die i mensis v annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2405280 05 v 5 05/01/1873 die i mensis v annoque mdccclxxiii 73 lxxiii 1873} test clock-2.34 {conversion of 1873-05-31} { clock format -3047973904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1873 12:34:56 die xxxi mensis v annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2405310 05 v 5 05/31/1873 die xxxi mensis v annoque mdccclxxiii 73 lxxiii 1873} test clock-2.35 {conversion of 1873-06-01} { clock format -3047887504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1873 12:34:56 die i mensis vi annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2405311 06 vi 6 06/01/1873 die i mensis vi annoque mdccclxxiii 73 lxxiii 1873} test clock-2.36 {conversion of 1873-06-30} { clock format -3045381904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1873 12:34:56 die xxx mensis vi annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2405340 06 vi 6 06/30/1873 die xxx mensis vi annoque mdccclxxiii 73 lxxiii 1873} test clock-2.37 {conversion of 1873-07-01} { clock format -3045295504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1873 12:34:56 die i mensis vii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2405341 07 vii 7 07/01/1873 die i mensis vii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.38 {conversion of 1873-07-31} { clock format -3042703504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1873 12:34:56 die xxxi mensis vii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2405371 07 vii 7 07/31/1873 die xxxi mensis vii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.39 {conversion of 1873-08-01} { clock format -3042617104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1873 12:34:56 die i mensis viii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2405372 08 viii 8 08/01/1873 die i mensis viii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.40 {conversion of 1873-08-31} { clock format -3040025104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1873 12:34:56 die xxxi mensis viii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2405402 08 viii 8 08/31/1873 die xxxi mensis viii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.41 {conversion of 1873-09-01} { clock format -3039938704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1873 12:34:56 die i mensis ix annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2405403 09 ix 9 09/01/1873 die i mensis ix annoque mdccclxxiii 73 lxxiii 1873} test clock-2.42 {conversion of 1873-09-30} { clock format -3037433104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1873 12:34:56 die xxx mensis ix annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2405432 09 ix 9 09/30/1873 die xxx mensis ix annoque mdccclxxiii 73 lxxiii 1873} test clock-2.43 {conversion of 1873-10-01} { clock format -3037346704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1873 12:34:56 die i mensis x annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2405433 10 x 10 10/01/1873 die i mensis x annoque mdccclxxiii 73 lxxiii 1873} test clock-2.44 {conversion of 1873-10-31} { clock format -3034754704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1873 12:34:56 die xxxi mensis x annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2405463 10 x 10 10/31/1873 die xxxi mensis x annoque mdccclxxiii 73 lxxiii 1873} test clock-2.45 {conversion of 1873-11-01} { clock format -3034668304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1873 12:34:56 die i mensis xi annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2405464 11 xi 11 11/01/1873 die i mensis xi annoque mdccclxxiii 73 lxxiii 1873} test clock-2.46 {conversion of 1873-11-30} { clock format -3032162704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1873 12:34:56 die xxx mensis xi annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2405493 11 xi 11 11/30/1873 die xxx mensis xi annoque mdccclxxiii 73 lxxiii 1873} test clock-2.47 {conversion of 1873-12-01} { clock format -3032076304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1873 12:34:56 die i mensis xii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2405494 12 xii 12 12/01/1873 die i mensis xii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.48 {conversion of 1873-12-31} { clock format -3029484304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1873 12:34:56 die xxxi mensis xii annoque mdccclxxiii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2405524 12 xii 12 12/31/1873 die xxxi mensis xii annoque mdccclxxiii 73 lxxiii 1873} test clock-2.49 {conversion of 1876-01-01} { clock format -2966325904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1876 12:34:56 die i mensis i annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2406255 01 i 1 01/01/1876 die i mensis i annoque mdccclxxvi 76 lxxvi 1876} test clock-2.50 {conversion of 1876-01-31} { clock format -2963733904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1876 12:34:56 die xxxi mensis i annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2406285 01 i 1 01/31/1876 die xxxi mensis i annoque mdccclxxvi 76 lxxvi 1876} test clock-2.51 {conversion of 1876-02-01} { clock format -2963647504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1876 12:34:56 die i mensis ii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2406286 02 ii 2 02/01/1876 die i mensis ii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.52 {conversion of 1876-02-29} { clock format -2961228304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1876 12:34:56 die xxix mensis ii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2406314 02 ii 2 02/29/1876 die xxix mensis ii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.53 {conversion of 1876-03-01} { clock format -2961141904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1876 12:34:56 die i mensis iii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2406315 03 iii 3 03/01/1876 die i mensis iii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.54 {conversion of 1876-03-31} { clock format -2958549904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1876 12:34:56 die xxxi mensis iii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2406345 03 iii 3 03/31/1876 die xxxi mensis iii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.55 {conversion of 1876-04-01} { clock format -2958463504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1876 12:34:56 die i mensis iv annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2406346 04 iv 4 04/01/1876 die i mensis iv annoque mdccclxxvi 76 lxxvi 1876} test clock-2.56 {conversion of 1876-04-30} { clock format -2955957904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1876 12:34:56 die xxx mensis iv annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2406375 04 iv 4 04/30/1876 die xxx mensis iv annoque mdccclxxvi 76 lxxvi 1876} test clock-2.57 {conversion of 1876-05-01} { clock format -2955871504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1876 12:34:56 die i mensis v annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2406376 05 v 5 05/01/1876 die i mensis v annoque mdccclxxvi 76 lxxvi 1876} test clock-2.58 {conversion of 1876-05-31} { clock format -2953279504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1876 12:34:56 die xxxi mensis v annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2406406 05 v 5 05/31/1876 die xxxi mensis v annoque mdccclxxvi 76 lxxvi 1876} test clock-2.59 {conversion of 1876-06-01} { clock format -2953193104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1876 12:34:56 die i mensis vi annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2406407 06 vi 6 06/01/1876 die i mensis vi annoque mdccclxxvi 76 lxxvi 1876} test clock-2.60 {conversion of 1876-06-30} { clock format -2950687504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1876 12:34:56 die xxx mensis vi annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2406436 06 vi 6 06/30/1876 die xxx mensis vi annoque mdccclxxvi 76 lxxvi 1876} test clock-2.61 {conversion of 1876-07-01} { clock format -2950601104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1876 12:34:56 die i mensis vii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2406437 07 vii 7 07/01/1876 die i mensis vii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.62 {conversion of 1876-07-31} { clock format -2948009104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1876 12:34:56 die xxxi mensis vii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2406467 07 vii 7 07/31/1876 die xxxi mensis vii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.63 {conversion of 1876-08-01} { clock format -2947922704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1876 12:34:56 die i mensis viii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2406468 08 viii 8 08/01/1876 die i mensis viii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.64 {conversion of 1876-08-31} { clock format -2945330704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1876 12:34:56 die xxxi mensis viii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2406498 08 viii 8 08/31/1876 die xxxi mensis viii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.65 {conversion of 1876-09-01} { clock format -2945244304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1876 12:34:56 die i mensis ix annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2406499 09 ix 9 09/01/1876 die i mensis ix annoque mdccclxxvi 76 lxxvi 1876} test clock-2.66 {conversion of 1876-09-30} { clock format -2942738704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1876 12:34:56 die xxx mensis ix annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2406528 09 ix 9 09/30/1876 die xxx mensis ix annoque mdccclxxvi 76 lxxvi 1876} test clock-2.67 {conversion of 1876-10-01} { clock format -2942652304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1876 12:34:56 die i mensis x annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2406529 10 x 10 10/01/1876 die i mensis x annoque mdccclxxvi 76 lxxvi 1876} test clock-2.68 {conversion of 1876-10-31} { clock format -2940060304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1876 12:34:56 die xxxi mensis x annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2406559 10 x 10 10/31/1876 die xxxi mensis x annoque mdccclxxvi 76 lxxvi 1876} test clock-2.69 {conversion of 1876-11-01} { clock format -2939973904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1876 12:34:56 die i mensis xi annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2406560 11 xi 11 11/01/1876 die i mensis xi annoque mdccclxxvi 76 lxxvi 1876} test clock-2.70 {conversion of 1876-11-30} { clock format -2937468304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1876 12:34:56 die xxx mensis xi annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2406589 11 xi 11 11/30/1876 die xxx mensis xi annoque mdccclxxvi 76 lxxvi 1876} test clock-2.71 {conversion of 1876-12-01} { clock format -2937381904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1876 12:34:56 die i mensis xii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2406590 12 xii 12 12/01/1876 die i mensis xii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.72 {conversion of 1876-12-31} { clock format -2934789904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1876 12:34:56 die xxxi mensis xii annoque mdccclxxvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2406620 12 xii 12 12/31/1876 die xxxi mensis xii annoque mdccclxxvi 76 lxxvi 1876} test clock-2.73 {conversion of 1877-01-01} { clock format -2934703504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1877 12:34:56 die i mensis i annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2406621 01 i 1 01/01/1877 die i mensis i annoque mdccclxxvii 77 lxxvii 1877} test clock-2.74 {conversion of 1877-01-31} { clock format -2932111504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1877 12:34:56 die xxxi mensis i annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2406651 01 i 1 01/31/1877 die xxxi mensis i annoque mdccclxxvii 77 lxxvii 1877} test clock-2.75 {conversion of 1877-02-01} { clock format -2932025104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1877 12:34:56 die i mensis ii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2406652 02 ii 2 02/01/1877 die i mensis ii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.76 {conversion of 1877-02-28} { clock format -2929692304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1877 12:34:56 die xxviii mensis ii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2406679 02 ii 2 02/28/1877 die xxviii mensis ii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.77 {conversion of 1877-03-01} { clock format -2929605904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1877 12:34:56 die i mensis iii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2406680 03 iii 3 03/01/1877 die i mensis iii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.78 {conversion of 1877-03-31} { clock format -2927013904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1877 12:34:56 die xxxi mensis iii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2406710 03 iii 3 03/31/1877 die xxxi mensis iii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.79 {conversion of 1877-04-01} { clock format -2926927504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1877 12:34:56 die i mensis iv annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2406711 04 iv 4 04/01/1877 die i mensis iv annoque mdccclxxvii 77 lxxvii 1877} test clock-2.80 {conversion of 1877-04-30} { clock format -2924421904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1877 12:34:56 die xxx mensis iv annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2406740 04 iv 4 04/30/1877 die xxx mensis iv annoque mdccclxxvii 77 lxxvii 1877} test clock-2.81 {conversion of 1877-05-01} { clock format -2924335504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1877 12:34:56 die i mensis v annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2406741 05 v 5 05/01/1877 die i mensis v annoque mdccclxxvii 77 lxxvii 1877} test clock-2.82 {conversion of 1877-05-31} { clock format -2921743504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1877 12:34:56 die xxxi mensis v annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2406771 05 v 5 05/31/1877 die xxxi mensis v annoque mdccclxxvii 77 lxxvii 1877} test clock-2.83 {conversion of 1877-06-01} { clock format -2921657104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1877 12:34:56 die i mensis vi annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2406772 06 vi 6 06/01/1877 die i mensis vi annoque mdccclxxvii 77 lxxvii 1877} test clock-2.84 {conversion of 1877-06-30} { clock format -2919151504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1877 12:34:56 die xxx mensis vi annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2406801 06 vi 6 06/30/1877 die xxx mensis vi annoque mdccclxxvii 77 lxxvii 1877} test clock-2.85 {conversion of 1877-07-01} { clock format -2919065104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1877 12:34:56 die i mensis vii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2406802 07 vii 7 07/01/1877 die i mensis vii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.86 {conversion of 1877-07-31} { clock format -2916473104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1877 12:34:56 die xxxi mensis vii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2406832 07 vii 7 07/31/1877 die xxxi mensis vii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.87 {conversion of 1877-08-01} { clock format -2916386704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1877 12:34:56 die i mensis viii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2406833 08 viii 8 08/01/1877 die i mensis viii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.88 {conversion of 1877-08-31} { clock format -2913794704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1877 12:34:56 die xxxi mensis viii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2406863 08 viii 8 08/31/1877 die xxxi mensis viii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.89 {conversion of 1877-09-01} { clock format -2913708304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1877 12:34:56 die i mensis ix annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2406864 09 ix 9 09/01/1877 die i mensis ix annoque mdccclxxvii 77 lxxvii 1877} test clock-2.90 {conversion of 1877-09-30} { clock format -2911202704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1877 12:34:56 die xxx mensis ix annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2406893 09 ix 9 09/30/1877 die xxx mensis ix annoque mdccclxxvii 77 lxxvii 1877} test clock-2.91 {conversion of 1877-10-01} { clock format -2911116304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1877 12:34:56 die i mensis x annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2406894 10 x 10 10/01/1877 die i mensis x annoque mdccclxxvii 77 lxxvii 1877} test clock-2.92 {conversion of 1877-10-31} { clock format -2908524304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1877 12:34:56 die xxxi mensis x annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2406924 10 x 10 10/31/1877 die xxxi mensis x annoque mdccclxxvii 77 lxxvii 1877} test clock-2.93 {conversion of 1877-11-01} { clock format -2908437904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1877 12:34:56 die i mensis xi annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2406925 11 xi 11 11/01/1877 die i mensis xi annoque mdccclxxvii 77 lxxvii 1877} test clock-2.94 {conversion of 1877-11-30} { clock format -2905932304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1877 12:34:56 die xxx mensis xi annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2406954 11 xi 11 11/30/1877 die xxx mensis xi annoque mdccclxxvii 77 lxxvii 1877} test clock-2.95 {conversion of 1877-12-01} { clock format -2905845904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1877 12:34:56 die i mensis xii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2406955 12 xii 12 12/01/1877 die i mensis xii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.96 {conversion of 1877-12-31} { clock format -2903253904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1877 12:34:56 die xxxi mensis xii annoque mdccclxxvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2406985 12 xii 12 12/31/1877 die xxxi mensis xii annoque mdccclxxvii 77 lxxvii 1877} test clock-2.97 {conversion of 1880-01-01} { clock format -2840095504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1880 12:34:56 die i mensis i annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2407716 01 i 1 01/01/1880 die i mensis i annoque mdccclxxx 80 lxxx 1880} test clock-2.98 {conversion of 1880-01-31} { clock format -2837503504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1880 12:34:56 die xxxi mensis i annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2407746 01 i 1 01/31/1880 die xxxi mensis i annoque mdccclxxx 80 lxxx 1880} test clock-2.99 {conversion of 1880-02-01} { clock format -2837417104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1880 12:34:56 die i mensis ii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2407747 02 ii 2 02/01/1880 die i mensis ii annoque mdccclxxx 80 lxxx 1880} test clock-2.100 {conversion of 1880-02-29} { clock format -2834997904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1880 12:34:56 die xxix mensis ii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2407775 02 ii 2 02/29/1880 die xxix mensis ii annoque mdccclxxx 80 lxxx 1880} test clock-2.101 {conversion of 1880-03-01} { clock format -2834911504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1880 12:34:56 die i mensis iii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2407776 03 iii 3 03/01/1880 die i mensis iii annoque mdccclxxx 80 lxxx 1880} test clock-2.102 {conversion of 1880-03-31} { clock format -2832319504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1880 12:34:56 die xxxi mensis iii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2407806 03 iii 3 03/31/1880 die xxxi mensis iii annoque mdccclxxx 80 lxxx 1880} test clock-2.103 {conversion of 1880-04-01} { clock format -2832233104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1880 12:34:56 die i mensis iv annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2407807 04 iv 4 04/01/1880 die i mensis iv annoque mdccclxxx 80 lxxx 1880} test clock-2.104 {conversion of 1880-04-30} { clock format -2829727504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1880 12:34:56 die xxx mensis iv annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2407836 04 iv 4 04/30/1880 die xxx mensis iv annoque mdccclxxx 80 lxxx 1880} test clock-2.105 {conversion of 1880-05-01} { clock format -2829641104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1880 12:34:56 die i mensis v annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2407837 05 v 5 05/01/1880 die i mensis v annoque mdccclxxx 80 lxxx 1880} test clock-2.106 {conversion of 1880-05-31} { clock format -2827049104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1880 12:34:56 die xxxi mensis v annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2407867 05 v 5 05/31/1880 die xxxi mensis v annoque mdccclxxx 80 lxxx 1880} test clock-2.107 {conversion of 1880-06-01} { clock format -2826962704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1880 12:34:56 die i mensis vi annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2407868 06 vi 6 06/01/1880 die i mensis vi annoque mdccclxxx 80 lxxx 1880} test clock-2.108 {conversion of 1880-06-30} { clock format -2824457104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1880 12:34:56 die xxx mensis vi annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2407897 06 vi 6 06/30/1880 die xxx mensis vi annoque mdccclxxx 80 lxxx 1880} test clock-2.109 {conversion of 1880-07-01} { clock format -2824370704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1880 12:34:56 die i mensis vii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2407898 07 vii 7 07/01/1880 die i mensis vii annoque mdccclxxx 80 lxxx 1880} test clock-2.110 {conversion of 1880-07-31} { clock format -2821778704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1880 12:34:56 die xxxi mensis vii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2407928 07 vii 7 07/31/1880 die xxxi mensis vii annoque mdccclxxx 80 lxxx 1880} test clock-2.111 {conversion of 1880-08-01} { clock format -2821692304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1880 12:34:56 die i mensis viii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2407929 08 viii 8 08/01/1880 die i mensis viii annoque mdccclxxx 80 lxxx 1880} test clock-2.112 {conversion of 1880-08-31} { clock format -2819100304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1880 12:34:56 die xxxi mensis viii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2407959 08 viii 8 08/31/1880 die xxxi mensis viii annoque mdccclxxx 80 lxxx 1880} test clock-2.113 {conversion of 1880-09-01} { clock format -2819013904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1880 12:34:56 die i mensis ix annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2407960 09 ix 9 09/01/1880 die i mensis ix annoque mdccclxxx 80 lxxx 1880} test clock-2.114 {conversion of 1880-09-30} { clock format -2816508304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1880 12:34:56 die xxx mensis ix annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2407989 09 ix 9 09/30/1880 die xxx mensis ix annoque mdccclxxx 80 lxxx 1880} test clock-2.115 {conversion of 1880-10-01} { clock format -2816421904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1880 12:34:56 die i mensis x annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2407990 10 x 10 10/01/1880 die i mensis x annoque mdccclxxx 80 lxxx 1880} test clock-2.116 {conversion of 1880-10-31} { clock format -2813829904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1880 12:34:56 die xxxi mensis x annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2408020 10 x 10 10/31/1880 die xxxi mensis x annoque mdccclxxx 80 lxxx 1880} test clock-2.117 {conversion of 1880-11-01} { clock format -2813743504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1880 12:34:56 die i mensis xi annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2408021 11 xi 11 11/01/1880 die i mensis xi annoque mdccclxxx 80 lxxx 1880} test clock-2.118 {conversion of 1880-11-30} { clock format -2811237904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1880 12:34:56 die xxx mensis xi annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2408050 11 xi 11 11/30/1880 die xxx mensis xi annoque mdccclxxx 80 lxxx 1880} test clock-2.119 {conversion of 1880-12-01} { clock format -2811151504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1880 12:34:56 die i mensis xii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2408051 12 xii 12 12/01/1880 die i mensis xii annoque mdccclxxx 80 lxxx 1880} test clock-2.120 {conversion of 1880-12-31} { clock format -2808559504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1880 12:34:56 die xxxi mensis xii annoque mdccclxxx xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2408081 12 xii 12 12/31/1880 die xxxi mensis xii annoque mdccclxxx 80 lxxx 1880} test clock-2.121 {conversion of 1881-01-01} { clock format -2808473104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1881 12:34:56 die i mensis i annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2408082 01 i 1 01/01/1881 die i mensis i annoque mdccclxxxi 81 lxxxi 1881} test clock-2.122 {conversion of 1881-01-31} { clock format -2805881104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1881 12:34:56 die xxxi mensis i annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2408112 01 i 1 01/31/1881 die xxxi mensis i annoque mdccclxxxi 81 lxxxi 1881} test clock-2.123 {conversion of 1881-02-01} { clock format -2805794704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1881 12:34:56 die i mensis ii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2408113 02 ii 2 02/01/1881 die i mensis ii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.124 {conversion of 1881-02-28} { clock format -2803461904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1881 12:34:56 die xxviii mensis ii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2408140 02 ii 2 02/28/1881 die xxviii mensis ii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.125 {conversion of 1881-03-01} { clock format -2803375504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1881 12:34:56 die i mensis iii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2408141 03 iii 3 03/01/1881 die i mensis iii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.126 {conversion of 1881-03-31} { clock format -2800783504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1881 12:34:56 die xxxi mensis iii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2408171 03 iii 3 03/31/1881 die xxxi mensis iii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.127 {conversion of 1881-04-01} { clock format -2800697104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1881 12:34:56 die i mensis iv annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2408172 04 iv 4 04/01/1881 die i mensis iv annoque mdccclxxxi 81 lxxxi 1881} test clock-2.128 {conversion of 1881-04-30} { clock format -2798191504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1881 12:34:56 die xxx mensis iv annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2408201 04 iv 4 04/30/1881 die xxx mensis iv annoque mdccclxxxi 81 lxxxi 1881} test clock-2.129 {conversion of 1881-05-01} { clock format -2798105104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1881 12:34:56 die i mensis v annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2408202 05 v 5 05/01/1881 die i mensis v annoque mdccclxxxi 81 lxxxi 1881} test clock-2.130 {conversion of 1881-05-31} { clock format -2795513104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1881 12:34:56 die xxxi mensis v annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2408232 05 v 5 05/31/1881 die xxxi mensis v annoque mdccclxxxi 81 lxxxi 1881} test clock-2.131 {conversion of 1881-06-01} { clock format -2795426704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1881 12:34:56 die i mensis vi annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2408233 06 vi 6 06/01/1881 die i mensis vi annoque mdccclxxxi 81 lxxxi 1881} test clock-2.132 {conversion of 1881-06-30} { clock format -2792921104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1881 12:34:56 die xxx mensis vi annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2408262 06 vi 6 06/30/1881 die xxx mensis vi annoque mdccclxxxi 81 lxxxi 1881} test clock-2.133 {conversion of 1881-07-01} { clock format -2792834704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1881 12:34:56 die i mensis vii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2408263 07 vii 7 07/01/1881 die i mensis vii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.134 {conversion of 1881-07-31} { clock format -2790242704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1881 12:34:56 die xxxi mensis vii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2408293 07 vii 7 07/31/1881 die xxxi mensis vii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.135 {conversion of 1881-08-01} { clock format -2790156304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1881 12:34:56 die i mensis viii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2408294 08 viii 8 08/01/1881 die i mensis viii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.136 {conversion of 1881-08-31} { clock format -2787564304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1881 12:34:56 die xxxi mensis viii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2408324 08 viii 8 08/31/1881 die xxxi mensis viii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.137 {conversion of 1881-09-01} { clock format -2787477904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1881 12:34:56 die i mensis ix annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2408325 09 ix 9 09/01/1881 die i mensis ix annoque mdccclxxxi 81 lxxxi 1881} test clock-2.138 {conversion of 1881-09-30} { clock format -2784972304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1881 12:34:56 die xxx mensis ix annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2408354 09 ix 9 09/30/1881 die xxx mensis ix annoque mdccclxxxi 81 lxxxi 1881} test clock-2.139 {conversion of 1881-10-01} { clock format -2784885904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1881 12:34:56 die i mensis x annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2408355 10 x 10 10/01/1881 die i mensis x annoque mdccclxxxi 81 lxxxi 1881} test clock-2.140 {conversion of 1881-10-31} { clock format -2782293904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1881 12:34:56 die xxxi mensis x annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2408385 10 x 10 10/31/1881 die xxxi mensis x annoque mdccclxxxi 81 lxxxi 1881} test clock-2.141 {conversion of 1881-11-01} { clock format -2782207504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1881 12:34:56 die i mensis xi annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2408386 11 xi 11 11/01/1881 die i mensis xi annoque mdccclxxxi 81 lxxxi 1881} test clock-2.142 {conversion of 1881-11-30} { clock format -2779701904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1881 12:34:56 die xxx mensis xi annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2408415 11 xi 11 11/30/1881 die xxx mensis xi annoque mdccclxxxi 81 lxxxi 1881} test clock-2.143 {conversion of 1881-12-01} { clock format -2779615504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1881 12:34:56 die i mensis xii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2408416 12 xii 12 12/01/1881 die i mensis xii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.144 {conversion of 1881-12-31} { clock format -2777023504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1881 12:34:56 die xxxi mensis xii annoque mdccclxxxi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2408446 12 xii 12 12/31/1881 die xxxi mensis xii annoque mdccclxxxi 81 lxxxi 1881} test clock-2.145 {conversion of 1884-01-01} { clock format -2713865104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1884 12:34:56 die i mensis i annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2409177 01 i 1 01/01/1884 die i mensis i annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.146 {conversion of 1884-01-31} { clock format -2711273104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1884 12:34:56 die xxxi mensis i annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2409207 01 i 1 01/31/1884 die xxxi mensis i annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.147 {conversion of 1884-02-01} { clock format -2711186704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1884 12:34:56 die i mensis ii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2409208 02 ii 2 02/01/1884 die i mensis ii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.148 {conversion of 1884-02-29} { clock format -2708767504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1884 12:34:56 die xxix mensis ii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2409236 02 ii 2 02/29/1884 die xxix mensis ii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.149 {conversion of 1884-03-01} { clock format -2708681104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1884 12:34:56 die i mensis iii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2409237 03 iii 3 03/01/1884 die i mensis iii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.150 {conversion of 1884-03-31} { clock format -2706089104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1884 12:34:56 die xxxi mensis iii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2409267 03 iii 3 03/31/1884 die xxxi mensis iii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.151 {conversion of 1884-04-01} { clock format -2706002704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1884 12:34:56 die i mensis iv annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2409268 04 iv 4 04/01/1884 die i mensis iv annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.152 {conversion of 1884-04-30} { clock format -2703497104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1884 12:34:56 die xxx mensis iv annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2409297 04 iv 4 04/30/1884 die xxx mensis iv annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.153 {conversion of 1884-05-01} { clock format -2703410704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1884 12:34:56 die i mensis v annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2409298 05 v 5 05/01/1884 die i mensis v annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.154 {conversion of 1884-05-31} { clock format -2700818704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1884 12:34:56 die xxxi mensis v annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2409328 05 v 5 05/31/1884 die xxxi mensis v annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.155 {conversion of 1884-06-01} { clock format -2700732304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1884 12:34:56 die i mensis vi annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2409329 06 vi 6 06/01/1884 die i mensis vi annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.156 {conversion of 1884-06-30} { clock format -2698226704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1884 12:34:56 die xxx mensis vi annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2409358 06 vi 6 06/30/1884 die xxx mensis vi annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.157 {conversion of 1884-07-01} { clock format -2698140304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1884 12:34:56 die i mensis vii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2409359 07 vii 7 07/01/1884 die i mensis vii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.158 {conversion of 1884-07-31} { clock format -2695548304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1884 12:34:56 die xxxi mensis vii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2409389 07 vii 7 07/31/1884 die xxxi mensis vii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.159 {conversion of 1884-08-01} { clock format -2695461904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1884 12:34:56 die i mensis viii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2409390 08 viii 8 08/01/1884 die i mensis viii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.160 {conversion of 1884-08-31} { clock format -2692869904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1884 12:34:56 die xxxi mensis viii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2409420 08 viii 8 08/31/1884 die xxxi mensis viii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.161 {conversion of 1884-09-01} { clock format -2692783504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1884 12:34:56 die i mensis ix annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2409421 09 ix 9 09/01/1884 die i mensis ix annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.162 {conversion of 1884-09-30} { clock format -2690277904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1884 12:34:56 die xxx mensis ix annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2409450 09 ix 9 09/30/1884 die xxx mensis ix annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.163 {conversion of 1884-10-01} { clock format -2690191504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1884 12:34:56 die i mensis x annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2409451 10 x 10 10/01/1884 die i mensis x annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.164 {conversion of 1884-10-31} { clock format -2687599504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1884 12:34:56 die xxxi mensis x annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2409481 10 x 10 10/31/1884 die xxxi mensis x annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.165 {conversion of 1884-11-01} { clock format -2687513104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1884 12:34:56 die i mensis xi annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2409482 11 xi 11 11/01/1884 die i mensis xi annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.166 {conversion of 1884-11-30} { clock format -2685007504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1884 12:34:56 die xxx mensis xi annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2409511 11 xi 11 11/30/1884 die xxx mensis xi annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.167 {conversion of 1884-12-01} { clock format -2684921104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1884 12:34:56 die i mensis xii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2409512 12 xii 12 12/01/1884 die i mensis xii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.168 {conversion of 1884-12-31} { clock format -2682329104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1884 12:34:56 die xxxi mensis xii annoque mdccclxxxiv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2409542 12 xii 12 12/31/1884 die xxxi mensis xii annoque mdccclxxxiv 84 lxxxiv 1884} test clock-2.169 {conversion of 1885-01-01} { clock format -2682242704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1885 12:34:56 die i mensis i annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2409543 01 i 1 01/01/1885 die i mensis i annoque mdccclxxxv 85 lxxxv 1885} test clock-2.170 {conversion of 1885-01-31} { clock format -2679650704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1885 12:34:56 die xxxi mensis i annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2409573 01 i 1 01/31/1885 die xxxi mensis i annoque mdccclxxxv 85 lxxxv 1885} test clock-2.171 {conversion of 1885-02-01} { clock format -2679564304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1885 12:34:56 die i mensis ii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2409574 02 ii 2 02/01/1885 die i mensis ii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.172 {conversion of 1885-02-28} { clock format -2677231504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1885 12:34:56 die xxviii mensis ii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2409601 02 ii 2 02/28/1885 die xxviii mensis ii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.173 {conversion of 1885-03-01} { clock format -2677145104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1885 12:34:56 die i mensis iii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2409602 03 iii 3 03/01/1885 die i mensis iii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.174 {conversion of 1885-03-31} { clock format -2674553104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1885 12:34:56 die xxxi mensis iii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2409632 03 iii 3 03/31/1885 die xxxi mensis iii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.175 {conversion of 1885-04-01} { clock format -2674466704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1885 12:34:56 die i mensis iv annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2409633 04 iv 4 04/01/1885 die i mensis iv annoque mdccclxxxv 85 lxxxv 1885} test clock-2.176 {conversion of 1885-04-30} { clock format -2671961104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1885 12:34:56 die xxx mensis iv annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2409662 04 iv 4 04/30/1885 die xxx mensis iv annoque mdccclxxxv 85 lxxxv 1885} test clock-2.177 {conversion of 1885-05-01} { clock format -2671874704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1885 12:34:56 die i mensis v annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2409663 05 v 5 05/01/1885 die i mensis v annoque mdccclxxxv 85 lxxxv 1885} test clock-2.178 {conversion of 1885-05-31} { clock format -2669282704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1885 12:34:56 die xxxi mensis v annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2409693 05 v 5 05/31/1885 die xxxi mensis v annoque mdccclxxxv 85 lxxxv 1885} test clock-2.179 {conversion of 1885-06-01} { clock format -2669196304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1885 12:34:56 die i mensis vi annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2409694 06 vi 6 06/01/1885 die i mensis vi annoque mdccclxxxv 85 lxxxv 1885} test clock-2.180 {conversion of 1885-06-30} { clock format -2666690704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1885 12:34:56 die xxx mensis vi annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2409723 06 vi 6 06/30/1885 die xxx mensis vi annoque mdccclxxxv 85 lxxxv 1885} test clock-2.181 {conversion of 1885-07-01} { clock format -2666604304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1885 12:34:56 die i mensis vii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2409724 07 vii 7 07/01/1885 die i mensis vii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.182 {conversion of 1885-07-31} { clock format -2664012304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1885 12:34:56 die xxxi mensis vii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2409754 07 vii 7 07/31/1885 die xxxi mensis vii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.183 {conversion of 1885-08-01} { clock format -2663925904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1885 12:34:56 die i mensis viii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2409755 08 viii 8 08/01/1885 die i mensis viii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.184 {conversion of 1885-08-31} { clock format -2661333904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1885 12:34:56 die xxxi mensis viii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2409785 08 viii 8 08/31/1885 die xxxi mensis viii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.185 {conversion of 1885-09-01} { clock format -2661247504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1885 12:34:56 die i mensis ix annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2409786 09 ix 9 09/01/1885 die i mensis ix annoque mdccclxxxv 85 lxxxv 1885} test clock-2.186 {conversion of 1885-09-30} { clock format -2658741904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1885 12:34:56 die xxx mensis ix annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2409815 09 ix 9 09/30/1885 die xxx mensis ix annoque mdccclxxxv 85 lxxxv 1885} test clock-2.187 {conversion of 1885-10-01} { clock format -2658655504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1885 12:34:56 die i mensis x annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2409816 10 x 10 10/01/1885 die i mensis x annoque mdccclxxxv 85 lxxxv 1885} test clock-2.188 {conversion of 1885-10-31} { clock format -2656063504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1885 12:34:56 die xxxi mensis x annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2409846 10 x 10 10/31/1885 die xxxi mensis x annoque mdccclxxxv 85 lxxxv 1885} test clock-2.189 {conversion of 1885-11-01} { clock format -2655977104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1885 12:34:56 die i mensis xi annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2409847 11 xi 11 11/01/1885 die i mensis xi annoque mdccclxxxv 85 lxxxv 1885} test clock-2.190 {conversion of 1885-11-30} { clock format -2653471504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1885 12:34:56 die xxx mensis xi annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2409876 11 xi 11 11/30/1885 die xxx mensis xi annoque mdccclxxxv 85 lxxxv 1885} test clock-2.191 {conversion of 1885-12-01} { clock format -2653385104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1885 12:34:56 die i mensis xii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2409877 12 xii 12 12/01/1885 die i mensis xii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.192 {conversion of 1885-12-31} { clock format -2650793104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1885 12:34:56 die xxxi mensis xii annoque mdccclxxxv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2409907 12 xii 12 12/31/1885 die xxxi mensis xii annoque mdccclxxxv 85 lxxxv 1885} test clock-2.193 {conversion of 1888-01-01} { clock format -2587634704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1888 12:34:56 die i mensis i annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2410638 01 i 1 01/01/1888 die i mensis i annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.194 {conversion of 1888-01-31} { clock format -2585042704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1888 12:34:56 die xxxi mensis i annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2410668 01 i 1 01/31/1888 die xxxi mensis i annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.195 {conversion of 1888-02-01} { clock format -2584956304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1888 12:34:56 die i mensis ii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2410669 02 ii 2 02/01/1888 die i mensis ii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.196 {conversion of 1888-02-29} { clock format -2582537104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1888 12:34:56 die xxix mensis ii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2410697 02 ii 2 02/29/1888 die xxix mensis ii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.197 {conversion of 1888-03-01} { clock format -2582450704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1888 12:34:56 die i mensis iii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2410698 03 iii 3 03/01/1888 die i mensis iii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.198 {conversion of 1888-03-31} { clock format -2579858704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1888 12:34:56 die xxxi mensis iii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2410728 03 iii 3 03/31/1888 die xxxi mensis iii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.199 {conversion of 1888-04-01} { clock format -2579772304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1888 12:34:56 die i mensis iv annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2410729 04 iv 4 04/01/1888 die i mensis iv annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.200 {conversion of 1888-04-30} { clock format -2577266704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1888 12:34:56 die xxx mensis iv annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2410758 04 iv 4 04/30/1888 die xxx mensis iv annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.201 {conversion of 1888-05-01} { clock format -2577180304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1888 12:34:56 die i mensis v annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2410759 05 v 5 05/01/1888 die i mensis v annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.202 {conversion of 1888-05-31} { clock format -2574588304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1888 12:34:56 die xxxi mensis v annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2410789 05 v 5 05/31/1888 die xxxi mensis v annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.203 {conversion of 1888-06-01} { clock format -2574501904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1888 12:34:56 die i mensis vi annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2410790 06 vi 6 06/01/1888 die i mensis vi annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.204 {conversion of 1888-06-30} { clock format -2571996304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1888 12:34:56 die xxx mensis vi annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2410819 06 vi 6 06/30/1888 die xxx mensis vi annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.205 {conversion of 1888-07-01} { clock format -2571909904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1888 12:34:56 die i mensis vii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2410820 07 vii 7 07/01/1888 die i mensis vii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.206 {conversion of 1888-07-31} { clock format -2569317904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1888 12:34:56 die xxxi mensis vii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2410850 07 vii 7 07/31/1888 die xxxi mensis vii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.207 {conversion of 1888-08-01} { clock format -2569231504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1888 12:34:56 die i mensis viii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2410851 08 viii 8 08/01/1888 die i mensis viii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.208 {conversion of 1888-08-31} { clock format -2566639504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1888 12:34:56 die xxxi mensis viii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2410881 08 viii 8 08/31/1888 die xxxi mensis viii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.209 {conversion of 1888-09-01} { clock format -2566553104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1888 12:34:56 die i mensis ix annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2410882 09 ix 9 09/01/1888 die i mensis ix annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.210 {conversion of 1888-09-30} { clock format -2564047504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1888 12:34:56 die xxx mensis ix annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2410911 09 ix 9 09/30/1888 die xxx mensis ix annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.211 {conversion of 1888-10-01} { clock format -2563961104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1888 12:34:56 die i mensis x annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2410912 10 x 10 10/01/1888 die i mensis x annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.212 {conversion of 1888-10-31} { clock format -2561369104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1888 12:34:56 die xxxi mensis x annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2410942 10 x 10 10/31/1888 die xxxi mensis x annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.213 {conversion of 1888-11-01} { clock format -2561282704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1888 12:34:56 die i mensis xi annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2410943 11 xi 11 11/01/1888 die i mensis xi annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.214 {conversion of 1888-11-30} { clock format -2558777104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1888 12:34:56 die xxx mensis xi annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2410972 11 xi 11 11/30/1888 die xxx mensis xi annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.215 {conversion of 1888-12-01} { clock format -2558690704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1888 12:34:56 die i mensis xii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2410973 12 xii 12 12/01/1888 die i mensis xii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.216 {conversion of 1888-12-31} { clock format -2556098704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1888 12:34:56 die xxxi mensis xii annoque mdccclxxxviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2411003 12 xii 12 12/31/1888 die xxxi mensis xii annoque mdccclxxxviii 88 lxxxviii 1888} test clock-2.217 {conversion of 1889-01-01} { clock format -2556012304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1889 12:34:56 die i mensis i annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2411004 01 i 1 01/01/1889 die i mensis i annoque mdccclxxxix 89 lxxxix 1889} test clock-2.218 {conversion of 1889-01-31} { clock format -2553420304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1889 12:34:56 die xxxi mensis i annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2411034 01 i 1 01/31/1889 die xxxi mensis i annoque mdccclxxxix 89 lxxxix 1889} test clock-2.219 {conversion of 1889-02-01} { clock format -2553333904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1889 12:34:56 die i mensis ii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2411035 02 ii 2 02/01/1889 die i mensis ii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.220 {conversion of 1889-02-28} { clock format -2551001104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1889 12:34:56 die xxviii mensis ii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2411062 02 ii 2 02/28/1889 die xxviii mensis ii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.221 {conversion of 1889-03-01} { clock format -2550914704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1889 12:34:56 die i mensis iii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2411063 03 iii 3 03/01/1889 die i mensis iii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.222 {conversion of 1889-03-31} { clock format -2548322704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1889 12:34:56 die xxxi mensis iii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2411093 03 iii 3 03/31/1889 die xxxi mensis iii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.223 {conversion of 1889-04-01} { clock format -2548236304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1889 12:34:56 die i mensis iv annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2411094 04 iv 4 04/01/1889 die i mensis iv annoque mdccclxxxix 89 lxxxix 1889} test clock-2.224 {conversion of 1889-04-30} { clock format -2545730704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1889 12:34:56 die xxx mensis iv annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2411123 04 iv 4 04/30/1889 die xxx mensis iv annoque mdccclxxxix 89 lxxxix 1889} test clock-2.225 {conversion of 1889-05-01} { clock format -2545644304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1889 12:34:56 die i mensis v annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2411124 05 v 5 05/01/1889 die i mensis v annoque mdccclxxxix 89 lxxxix 1889} test clock-2.226 {conversion of 1889-05-31} { clock format -2543052304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1889 12:34:56 die xxxi mensis v annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2411154 05 v 5 05/31/1889 die xxxi mensis v annoque mdccclxxxix 89 lxxxix 1889} test clock-2.227 {conversion of 1889-06-01} { clock format -2542965904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1889 12:34:56 die i mensis vi annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2411155 06 vi 6 06/01/1889 die i mensis vi annoque mdccclxxxix 89 lxxxix 1889} test clock-2.228 {conversion of 1889-06-30} { clock format -2540460304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1889 12:34:56 die xxx mensis vi annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2411184 06 vi 6 06/30/1889 die xxx mensis vi annoque mdccclxxxix 89 lxxxix 1889} test clock-2.229 {conversion of 1889-07-01} { clock format -2540373904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1889 12:34:56 die i mensis vii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2411185 07 vii 7 07/01/1889 die i mensis vii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.230 {conversion of 1889-07-31} { clock format -2537781904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1889 12:34:56 die xxxi mensis vii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2411215 07 vii 7 07/31/1889 die xxxi mensis vii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.231 {conversion of 1889-08-01} { clock format -2537695504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1889 12:34:56 die i mensis viii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2411216 08 viii 8 08/01/1889 die i mensis viii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.232 {conversion of 1889-08-31} { clock format -2535103504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1889 12:34:56 die xxxi mensis viii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2411246 08 viii 8 08/31/1889 die xxxi mensis viii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.233 {conversion of 1889-09-01} { clock format -2535017104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1889 12:34:56 die i mensis ix annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2411247 09 ix 9 09/01/1889 die i mensis ix annoque mdccclxxxix 89 lxxxix 1889} test clock-2.234 {conversion of 1889-09-30} { clock format -2532511504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1889 12:34:56 die xxx mensis ix annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2411276 09 ix 9 09/30/1889 die xxx mensis ix annoque mdccclxxxix 89 lxxxix 1889} test clock-2.235 {conversion of 1889-10-01} { clock format -2532425104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1889 12:34:56 die i mensis x annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2411277 10 x 10 10/01/1889 die i mensis x annoque mdccclxxxix 89 lxxxix 1889} test clock-2.236 {conversion of 1889-10-31} { clock format -2529833104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1889 12:34:56 die xxxi mensis x annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2411307 10 x 10 10/31/1889 die xxxi mensis x annoque mdccclxxxix 89 lxxxix 1889} test clock-2.237 {conversion of 1889-11-01} { clock format -2529746704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1889 12:34:56 die i mensis xi annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2411308 11 xi 11 11/01/1889 die i mensis xi annoque mdccclxxxix 89 lxxxix 1889} test clock-2.238 {conversion of 1889-11-30} { clock format -2527241104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1889 12:34:56 die xxx mensis xi annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2411337 11 xi 11 11/30/1889 die xxx mensis xi annoque mdccclxxxix 89 lxxxix 1889} test clock-2.239 {conversion of 1889-12-01} { clock format -2527154704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1889 12:34:56 die i mensis xii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2411338 12 xii 12 12/01/1889 die i mensis xii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.240 {conversion of 1889-12-31} { clock format -2524562704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1889 12:34:56 die xxxi mensis xii annoque mdccclxxxix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2411368 12 xii 12 12/31/1889 die xxxi mensis xii annoque mdccclxxxix 89 lxxxix 1889} test clock-2.241 {conversion of 1890-01-01} { clock format -2524476304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1890 12:34:56 die i mensis i annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2411369 01 i 1 01/01/1890 die i mensis i annoque mdcccxc 90 xc 1890} test clock-2.242 {conversion of 1890-01-31} { clock format -2521884304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1890 12:34:56 die xxxi mensis i annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2411399 01 i 1 01/31/1890 die xxxi mensis i annoque mdcccxc 90 xc 1890} test clock-2.243 {conversion of 1890-02-01} { clock format -2521797904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1890 12:34:56 die i mensis ii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2411400 02 ii 2 02/01/1890 die i mensis ii annoque mdcccxc 90 xc 1890} test clock-2.244 {conversion of 1890-02-28} { clock format -2519465104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1890 12:34:56 die xxviii mensis ii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2411427 02 ii 2 02/28/1890 die xxviii mensis ii annoque mdcccxc 90 xc 1890} test clock-2.245 {conversion of 1890-03-01} { clock format -2519378704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1890 12:34:56 die i mensis iii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2411428 03 iii 3 03/01/1890 die i mensis iii annoque mdcccxc 90 xc 1890} test clock-2.246 {conversion of 1890-03-31} { clock format -2516786704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1890 12:34:56 die xxxi mensis iii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2411458 03 iii 3 03/31/1890 die xxxi mensis iii annoque mdcccxc 90 xc 1890} test clock-2.247 {conversion of 1890-04-01} { clock format -2516700304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1890 12:34:56 die i mensis iv annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2411459 04 iv 4 04/01/1890 die i mensis iv annoque mdcccxc 90 xc 1890} test clock-2.248 {conversion of 1890-04-30} { clock format -2514194704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1890 12:34:56 die xxx mensis iv annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2411488 04 iv 4 04/30/1890 die xxx mensis iv annoque mdcccxc 90 xc 1890} test clock-2.249 {conversion of 1890-05-01} { clock format -2514108304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1890 12:34:56 die i mensis v annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2411489 05 v 5 05/01/1890 die i mensis v annoque mdcccxc 90 xc 1890} test clock-2.250 {conversion of 1890-05-31} { clock format -2511516304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1890 12:34:56 die xxxi mensis v annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2411519 05 v 5 05/31/1890 die xxxi mensis v annoque mdcccxc 90 xc 1890} test clock-2.251 {conversion of 1890-06-01} { clock format -2511429904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1890 12:34:56 die i mensis vi annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2411520 06 vi 6 06/01/1890 die i mensis vi annoque mdcccxc 90 xc 1890} test clock-2.252 {conversion of 1890-06-30} { clock format -2508924304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1890 12:34:56 die xxx mensis vi annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2411549 06 vi 6 06/30/1890 die xxx mensis vi annoque mdcccxc 90 xc 1890} test clock-2.253 {conversion of 1890-07-01} { clock format -2508837904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1890 12:34:56 die i mensis vii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2411550 07 vii 7 07/01/1890 die i mensis vii annoque mdcccxc 90 xc 1890} test clock-2.254 {conversion of 1890-07-31} { clock format -2506245904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1890 12:34:56 die xxxi mensis vii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2411580 07 vii 7 07/31/1890 die xxxi mensis vii annoque mdcccxc 90 xc 1890} test clock-2.255 {conversion of 1890-08-01} { clock format -2506159504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1890 12:34:56 die i mensis viii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2411581 08 viii 8 08/01/1890 die i mensis viii annoque mdcccxc 90 xc 1890} test clock-2.256 {conversion of 1890-08-31} { clock format -2503567504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1890 12:34:56 die xxxi mensis viii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2411611 08 viii 8 08/31/1890 die xxxi mensis viii annoque mdcccxc 90 xc 1890} test clock-2.257 {conversion of 1890-09-01} { clock format -2503481104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1890 12:34:56 die i mensis ix annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2411612 09 ix 9 09/01/1890 die i mensis ix annoque mdcccxc 90 xc 1890} test clock-2.258 {conversion of 1890-09-30} { clock format -2500975504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1890 12:34:56 die xxx mensis ix annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2411641 09 ix 9 09/30/1890 die xxx mensis ix annoque mdcccxc 90 xc 1890} test clock-2.259 {conversion of 1890-10-01} { clock format -2500889104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1890 12:34:56 die i mensis x annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2411642 10 x 10 10/01/1890 die i mensis x annoque mdcccxc 90 xc 1890} test clock-2.260 {conversion of 1890-10-31} { clock format -2498297104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1890 12:34:56 die xxxi mensis x annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2411672 10 x 10 10/31/1890 die xxxi mensis x annoque mdcccxc 90 xc 1890} test clock-2.261 {conversion of 1890-11-01} { clock format -2498210704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1890 12:34:56 die i mensis xi annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2411673 11 xi 11 11/01/1890 die i mensis xi annoque mdcccxc 90 xc 1890} test clock-2.262 {conversion of 1890-11-30} { clock format -2495705104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1890 12:34:56 die xxx mensis xi annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2411702 11 xi 11 11/30/1890 die xxx mensis xi annoque mdcccxc 90 xc 1890} test clock-2.263 {conversion of 1890-12-01} { clock format -2495618704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1890 12:34:56 die i mensis xii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2411703 12 xii 12 12/01/1890 die i mensis xii annoque mdcccxc 90 xc 1890} test clock-2.264 {conversion of 1890-12-31} { clock format -2493026704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1890 12:34:56 die xxxi mensis xii annoque mdcccxc xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2411733 12 xii 12 12/31/1890 die xxxi mensis xii annoque mdcccxc 90 xc 1890} test clock-2.265 {conversion of 1891-01-01} { clock format -2492940304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1891 12:34:56 die i mensis i annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2411734 01 i 1 01/01/1891 die i mensis i annoque mdcccxci 91 xci 1891} test clock-2.266 {conversion of 1891-01-31} { clock format -2490348304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1891 12:34:56 die xxxi mensis i annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2411764 01 i 1 01/31/1891 die xxxi mensis i annoque mdcccxci 91 xci 1891} test clock-2.267 {conversion of 1891-02-01} { clock format -2490261904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1891 12:34:56 die i mensis ii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2411765 02 ii 2 02/01/1891 die i mensis ii annoque mdcccxci 91 xci 1891} test clock-2.268 {conversion of 1891-02-28} { clock format -2487929104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1891 12:34:56 die xxviii mensis ii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2411792 02 ii 2 02/28/1891 die xxviii mensis ii annoque mdcccxci 91 xci 1891} test clock-2.269 {conversion of 1891-03-01} { clock format -2487842704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1891 12:34:56 die i mensis iii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2411793 03 iii 3 03/01/1891 die i mensis iii annoque mdcccxci 91 xci 1891} test clock-2.270 {conversion of 1891-03-31} { clock format -2485250704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1891 12:34:56 die xxxi mensis iii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2411823 03 iii 3 03/31/1891 die xxxi mensis iii annoque mdcccxci 91 xci 1891} test clock-2.271 {conversion of 1891-04-01} { clock format -2485164304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1891 12:34:56 die i mensis iv annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2411824 04 iv 4 04/01/1891 die i mensis iv annoque mdcccxci 91 xci 1891} test clock-2.272 {conversion of 1891-04-30} { clock format -2482658704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1891 12:34:56 die xxx mensis iv annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2411853 04 iv 4 04/30/1891 die xxx mensis iv annoque mdcccxci 91 xci 1891} test clock-2.273 {conversion of 1891-05-01} { clock format -2482572304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1891 12:34:56 die i mensis v annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2411854 05 v 5 05/01/1891 die i mensis v annoque mdcccxci 91 xci 1891} test clock-2.274 {conversion of 1891-05-31} { clock format -2479980304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1891 12:34:56 die xxxi mensis v annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2411884 05 v 5 05/31/1891 die xxxi mensis v annoque mdcccxci 91 xci 1891} test clock-2.275 {conversion of 1891-06-01} { clock format -2479893904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1891 12:34:56 die i mensis vi annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2411885 06 vi 6 06/01/1891 die i mensis vi annoque mdcccxci 91 xci 1891} test clock-2.276 {conversion of 1891-06-30} { clock format -2477388304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1891 12:34:56 die xxx mensis vi annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2411914 06 vi 6 06/30/1891 die xxx mensis vi annoque mdcccxci 91 xci 1891} test clock-2.277 {conversion of 1891-07-01} { clock format -2477301904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1891 12:34:56 die i mensis vii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2411915 07 vii 7 07/01/1891 die i mensis vii annoque mdcccxci 91 xci 1891} test clock-2.278 {conversion of 1891-07-31} { clock format -2474709904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1891 12:34:56 die xxxi mensis vii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2411945 07 vii 7 07/31/1891 die xxxi mensis vii annoque mdcccxci 91 xci 1891} test clock-2.279 {conversion of 1891-08-01} { clock format -2474623504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1891 12:34:56 die i mensis viii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2411946 08 viii 8 08/01/1891 die i mensis viii annoque mdcccxci 91 xci 1891} test clock-2.280 {conversion of 1891-08-31} { clock format -2472031504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1891 12:34:56 die xxxi mensis viii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2411976 08 viii 8 08/31/1891 die xxxi mensis viii annoque mdcccxci 91 xci 1891} test clock-2.281 {conversion of 1891-09-01} { clock format -2471945104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1891 12:34:56 die i mensis ix annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2411977 09 ix 9 09/01/1891 die i mensis ix annoque mdcccxci 91 xci 1891} test clock-2.282 {conversion of 1891-09-30} { clock format -2469439504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1891 12:34:56 die xxx mensis ix annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2412006 09 ix 9 09/30/1891 die xxx mensis ix annoque mdcccxci 91 xci 1891} test clock-2.283 {conversion of 1891-10-01} { clock format -2469353104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1891 12:34:56 die i mensis x annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2412007 10 x 10 10/01/1891 die i mensis x annoque mdcccxci 91 xci 1891} test clock-2.284 {conversion of 1891-10-31} { clock format -2466761104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1891 12:34:56 die xxxi mensis x annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2412037 10 x 10 10/31/1891 die xxxi mensis x annoque mdcccxci 91 xci 1891} test clock-2.285 {conversion of 1891-11-01} { clock format -2466674704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1891 12:34:56 die i mensis xi annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2412038 11 xi 11 11/01/1891 die i mensis xi annoque mdcccxci 91 xci 1891} test clock-2.286 {conversion of 1891-11-30} { clock format -2464169104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1891 12:34:56 die xxx mensis xi annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2412067 11 xi 11 11/30/1891 die xxx mensis xi annoque mdcccxci 91 xci 1891} test clock-2.287 {conversion of 1891-12-01} { clock format -2464082704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1891 12:34:56 die i mensis xii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2412068 12 xii 12 12/01/1891 die i mensis xii annoque mdcccxci 91 xci 1891} test clock-2.288 {conversion of 1891-12-31} { clock format -2461490704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1891 12:34:56 die xxxi mensis xii annoque mdcccxci xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2412098 12 xii 12 12/31/1891 die xxxi mensis xii annoque mdcccxci 91 xci 1891} test clock-2.289 {conversion of 1892-01-01} { clock format -2461404304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1892 12:34:56 die i mensis i annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2412099 01 i 1 01/01/1892 die i mensis i annoque mdcccxcii 92 xcii 1892} test clock-2.290 {conversion of 1892-01-31} { clock format -2458812304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1892 12:34:56 die xxxi mensis i annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2412129 01 i 1 01/31/1892 die xxxi mensis i annoque mdcccxcii 92 xcii 1892} test clock-2.291 {conversion of 1892-02-01} { clock format -2458725904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1892 12:34:56 die i mensis ii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2412130 02 ii 2 02/01/1892 die i mensis ii annoque mdcccxcii 92 xcii 1892} test clock-2.292 {conversion of 1892-02-29} { clock format -2456306704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1892 12:34:56 die xxix mensis ii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2412158 02 ii 2 02/29/1892 die xxix mensis ii annoque mdcccxcii 92 xcii 1892} test clock-2.293 {conversion of 1892-03-01} { clock format -2456220304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1892 12:34:56 die i mensis iii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2412159 03 iii 3 03/01/1892 die i mensis iii annoque mdcccxcii 92 xcii 1892} test clock-2.294 {conversion of 1892-03-31} { clock format -2453628304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1892 12:34:56 die xxxi mensis iii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2412189 03 iii 3 03/31/1892 die xxxi mensis iii annoque mdcccxcii 92 xcii 1892} test clock-2.295 {conversion of 1892-04-01} { clock format -2453541904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1892 12:34:56 die i mensis iv annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2412190 04 iv 4 04/01/1892 die i mensis iv annoque mdcccxcii 92 xcii 1892} test clock-2.296 {conversion of 1892-04-30} { clock format -2451036304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1892 12:34:56 die xxx mensis iv annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2412219 04 iv 4 04/30/1892 die xxx mensis iv annoque mdcccxcii 92 xcii 1892} test clock-2.297 {conversion of 1892-05-01} { clock format -2450949904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1892 12:34:56 die i mensis v annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2412220 05 v 5 05/01/1892 die i mensis v annoque mdcccxcii 92 xcii 1892} test clock-2.298 {conversion of 1892-05-31} { clock format -2448357904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1892 12:34:56 die xxxi mensis v annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2412250 05 v 5 05/31/1892 die xxxi mensis v annoque mdcccxcii 92 xcii 1892} test clock-2.299 {conversion of 1892-06-01} { clock format -2448271504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1892 12:34:56 die i mensis vi annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2412251 06 vi 6 06/01/1892 die i mensis vi annoque mdcccxcii 92 xcii 1892} test clock-2.300 {conversion of 1892-06-30} { clock format -2445765904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1892 12:34:56 die xxx mensis vi annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2412280 06 vi 6 06/30/1892 die xxx mensis vi annoque mdcccxcii 92 xcii 1892} test clock-2.301 {conversion of 1892-07-01} { clock format -2445679504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1892 12:34:56 die i mensis vii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2412281 07 vii 7 07/01/1892 die i mensis vii annoque mdcccxcii 92 xcii 1892} test clock-2.302 {conversion of 1892-07-31} { clock format -2443087504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1892 12:34:56 die xxxi mensis vii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2412311 07 vii 7 07/31/1892 die xxxi mensis vii annoque mdcccxcii 92 xcii 1892} test clock-2.303 {conversion of 1892-08-01} { clock format -2443001104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1892 12:34:56 die i mensis viii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2412312 08 viii 8 08/01/1892 die i mensis viii annoque mdcccxcii 92 xcii 1892} test clock-2.304 {conversion of 1892-08-31} { clock format -2440409104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1892 12:34:56 die xxxi mensis viii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2412342 08 viii 8 08/31/1892 die xxxi mensis viii annoque mdcccxcii 92 xcii 1892} test clock-2.305 {conversion of 1892-09-01} { clock format -2440322704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1892 12:34:56 die i mensis ix annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2412343 09 ix 9 09/01/1892 die i mensis ix annoque mdcccxcii 92 xcii 1892} test clock-2.306 {conversion of 1892-09-30} { clock format -2437817104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1892 12:34:56 die xxx mensis ix annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2412372 09 ix 9 09/30/1892 die xxx mensis ix annoque mdcccxcii 92 xcii 1892} test clock-2.307 {conversion of 1892-10-01} { clock format -2437730704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1892 12:34:56 die i mensis x annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2412373 10 x 10 10/01/1892 die i mensis x annoque mdcccxcii 92 xcii 1892} test clock-2.308 {conversion of 1892-10-31} { clock format -2435138704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1892 12:34:56 die xxxi mensis x annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2412403 10 x 10 10/31/1892 die xxxi mensis x annoque mdcccxcii 92 xcii 1892} test clock-2.309 {conversion of 1892-11-01} { clock format -2435052304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1892 12:34:56 die i mensis xi annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2412404 11 xi 11 11/01/1892 die i mensis xi annoque mdcccxcii 92 xcii 1892} test clock-2.310 {conversion of 1892-11-30} { clock format -2432546704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1892 12:34:56 die xxx mensis xi annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2412433 11 xi 11 11/30/1892 die xxx mensis xi annoque mdcccxcii 92 xcii 1892} test clock-2.311 {conversion of 1892-12-01} { clock format -2432460304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1892 12:34:56 die i mensis xii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2412434 12 xii 12 12/01/1892 die i mensis xii annoque mdcccxcii 92 xcii 1892} test clock-2.312 {conversion of 1892-12-31} { clock format -2429868304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1892 12:34:56 die xxxi mensis xii annoque mdcccxcii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2412464 12 xii 12 12/31/1892 die xxxi mensis xii annoque mdcccxcii 92 xcii 1892} test clock-2.313 {conversion of 1893-01-01} { clock format -2429781904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1893 12:34:56 die i mensis i annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2412465 01 i 1 01/01/1893 die i mensis i annoque mdcccxciii 93 xciii 1893} test clock-2.314 {conversion of 1893-01-31} { clock format -2427189904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1893 12:34:56 die xxxi mensis i annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2412495 01 i 1 01/31/1893 die xxxi mensis i annoque mdcccxciii 93 xciii 1893} test clock-2.315 {conversion of 1893-02-01} { clock format -2427103504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1893 12:34:56 die i mensis ii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2412496 02 ii 2 02/01/1893 die i mensis ii annoque mdcccxciii 93 xciii 1893} test clock-2.316 {conversion of 1893-02-28} { clock format -2424770704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1893 12:34:56 die xxviii mensis ii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2412523 02 ii 2 02/28/1893 die xxviii mensis ii annoque mdcccxciii 93 xciii 1893} test clock-2.317 {conversion of 1893-03-01} { clock format -2424684304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1893 12:34:56 die i mensis iii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2412524 03 iii 3 03/01/1893 die i mensis iii annoque mdcccxciii 93 xciii 1893} test clock-2.318 {conversion of 1893-03-31} { clock format -2422092304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1893 12:34:56 die xxxi mensis iii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2412554 03 iii 3 03/31/1893 die xxxi mensis iii annoque mdcccxciii 93 xciii 1893} test clock-2.319 {conversion of 1893-04-01} { clock format -2422005904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1893 12:34:56 die i mensis iv annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2412555 04 iv 4 04/01/1893 die i mensis iv annoque mdcccxciii 93 xciii 1893} test clock-2.320 {conversion of 1893-04-30} { clock format -2419500304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1893 12:34:56 die xxx mensis iv annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2412584 04 iv 4 04/30/1893 die xxx mensis iv annoque mdcccxciii 93 xciii 1893} test clock-2.321 {conversion of 1893-05-01} { clock format -2419413904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1893 12:34:56 die i mensis v annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2412585 05 v 5 05/01/1893 die i mensis v annoque mdcccxciii 93 xciii 1893} test clock-2.322 {conversion of 1893-05-31} { clock format -2416821904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1893 12:34:56 die xxxi mensis v annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2412615 05 v 5 05/31/1893 die xxxi mensis v annoque mdcccxciii 93 xciii 1893} test clock-2.323 {conversion of 1893-06-01} { clock format -2416735504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1893 12:34:56 die i mensis vi annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2412616 06 vi 6 06/01/1893 die i mensis vi annoque mdcccxciii 93 xciii 1893} test clock-2.324 {conversion of 1893-06-30} { clock format -2414229904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1893 12:34:56 die xxx mensis vi annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2412645 06 vi 6 06/30/1893 die xxx mensis vi annoque mdcccxciii 93 xciii 1893} test clock-2.325 {conversion of 1893-07-01} { clock format -2414143504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1893 12:34:56 die i mensis vii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2412646 07 vii 7 07/01/1893 die i mensis vii annoque mdcccxciii 93 xciii 1893} test clock-2.326 {conversion of 1893-07-31} { clock format -2411551504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1893 12:34:56 die xxxi mensis vii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2412676 07 vii 7 07/31/1893 die xxxi mensis vii annoque mdcccxciii 93 xciii 1893} test clock-2.327 {conversion of 1893-08-01} { clock format -2411465104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1893 12:34:56 die i mensis viii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2412677 08 viii 8 08/01/1893 die i mensis viii annoque mdcccxciii 93 xciii 1893} test clock-2.328 {conversion of 1893-08-31} { clock format -2408873104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1893 12:34:56 die xxxi mensis viii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2412707 08 viii 8 08/31/1893 die xxxi mensis viii annoque mdcccxciii 93 xciii 1893} test clock-2.329 {conversion of 1893-09-01} { clock format -2408786704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1893 12:34:56 die i mensis ix annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2412708 09 ix 9 09/01/1893 die i mensis ix annoque mdcccxciii 93 xciii 1893} test clock-2.330 {conversion of 1893-09-30} { clock format -2406281104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1893 12:34:56 die xxx mensis ix annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2412737 09 ix 9 09/30/1893 die xxx mensis ix annoque mdcccxciii 93 xciii 1893} test clock-2.331 {conversion of 1893-10-01} { clock format -2406194704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1893 12:34:56 die i mensis x annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2412738 10 x 10 10/01/1893 die i mensis x annoque mdcccxciii 93 xciii 1893} test clock-2.332 {conversion of 1893-10-31} { clock format -2403602704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1893 12:34:56 die xxxi mensis x annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2412768 10 x 10 10/31/1893 die xxxi mensis x annoque mdcccxciii 93 xciii 1893} test clock-2.333 {conversion of 1893-11-01} { clock format -2403516304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1893 12:34:56 die i mensis xi annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2412769 11 xi 11 11/01/1893 die i mensis xi annoque mdcccxciii 93 xciii 1893} test clock-2.334 {conversion of 1893-11-30} { clock format -2401010704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1893 12:34:56 die xxx mensis xi annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2412798 11 xi 11 11/30/1893 die xxx mensis xi annoque mdcccxciii 93 xciii 1893} test clock-2.335 {conversion of 1893-12-01} { clock format -2400924304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1893 12:34:56 die i mensis xii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2412799 12 xii 12 12/01/1893 die i mensis xii annoque mdcccxciii 93 xciii 1893} test clock-2.336 {conversion of 1893-12-31} { clock format -2398332304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1893 12:34:56 die xxxi mensis xii annoque mdcccxciii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2412829 12 xii 12 12/31/1893 die xxxi mensis xii annoque mdcccxciii 93 xciii 1893} test clock-2.337 {conversion of 1894-01-01} { clock format -2398245904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1894 12:34:56 die i mensis i annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2412830 01 i 1 01/01/1894 die i mensis i annoque mdcccxciv 94 xciv 1894} test clock-2.338 {conversion of 1894-01-31} { clock format -2395653904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1894 12:34:56 die xxxi mensis i annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2412860 01 i 1 01/31/1894 die xxxi mensis i annoque mdcccxciv 94 xciv 1894} test clock-2.339 {conversion of 1894-02-01} { clock format -2395567504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1894 12:34:56 die i mensis ii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2412861 02 ii 2 02/01/1894 die i mensis ii annoque mdcccxciv 94 xciv 1894} test clock-2.340 {conversion of 1894-02-28} { clock format -2393234704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1894 12:34:56 die xxviii mensis ii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2412888 02 ii 2 02/28/1894 die xxviii mensis ii annoque mdcccxciv 94 xciv 1894} test clock-2.341 {conversion of 1894-03-01} { clock format -2393148304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1894 12:34:56 die i mensis iii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2412889 03 iii 3 03/01/1894 die i mensis iii annoque mdcccxciv 94 xciv 1894} test clock-2.342 {conversion of 1894-03-31} { clock format -2390556304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1894 12:34:56 die xxxi mensis iii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2412919 03 iii 3 03/31/1894 die xxxi mensis iii annoque mdcccxciv 94 xciv 1894} test clock-2.343 {conversion of 1894-04-01} { clock format -2390469904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1894 12:34:56 die i mensis iv annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2412920 04 iv 4 04/01/1894 die i mensis iv annoque mdcccxciv 94 xciv 1894} test clock-2.344 {conversion of 1894-04-30} { clock format -2387964304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1894 12:34:56 die xxx mensis iv annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2412949 04 iv 4 04/30/1894 die xxx mensis iv annoque mdcccxciv 94 xciv 1894} test clock-2.345 {conversion of 1894-05-01} { clock format -2387877904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1894 12:34:56 die i mensis v annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2412950 05 v 5 05/01/1894 die i mensis v annoque mdcccxciv 94 xciv 1894} test clock-2.346 {conversion of 1894-05-31} { clock format -2385285904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1894 12:34:56 die xxxi mensis v annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2412980 05 v 5 05/31/1894 die xxxi mensis v annoque mdcccxciv 94 xciv 1894} test clock-2.347 {conversion of 1894-06-01} { clock format -2385199504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1894 12:34:56 die i mensis vi annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2412981 06 vi 6 06/01/1894 die i mensis vi annoque mdcccxciv 94 xciv 1894} test clock-2.348 {conversion of 1894-06-30} { clock format -2382693904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1894 12:34:56 die xxx mensis vi annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2413010 06 vi 6 06/30/1894 die xxx mensis vi annoque mdcccxciv 94 xciv 1894} test clock-2.349 {conversion of 1894-07-01} { clock format -2382607504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1894 12:34:56 die i mensis vii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2413011 07 vii 7 07/01/1894 die i mensis vii annoque mdcccxciv 94 xciv 1894} test clock-2.350 {conversion of 1894-07-31} { clock format -2380015504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1894 12:34:56 die xxxi mensis vii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2413041 07 vii 7 07/31/1894 die xxxi mensis vii annoque mdcccxciv 94 xciv 1894} test clock-2.351 {conversion of 1894-08-01} { clock format -2379929104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1894 12:34:56 die i mensis viii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2413042 08 viii 8 08/01/1894 die i mensis viii annoque mdcccxciv 94 xciv 1894} test clock-2.352 {conversion of 1894-08-31} { clock format -2377337104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1894 12:34:56 die xxxi mensis viii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2413072 08 viii 8 08/31/1894 die xxxi mensis viii annoque mdcccxciv 94 xciv 1894} test clock-2.353 {conversion of 1894-09-01} { clock format -2377250704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1894 12:34:56 die i mensis ix annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2413073 09 ix 9 09/01/1894 die i mensis ix annoque mdcccxciv 94 xciv 1894} test clock-2.354 {conversion of 1894-09-30} { clock format -2374745104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1894 12:34:56 die xxx mensis ix annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2413102 09 ix 9 09/30/1894 die xxx mensis ix annoque mdcccxciv 94 xciv 1894} test clock-2.355 {conversion of 1894-10-01} { clock format -2374658704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1894 12:34:56 die i mensis x annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2413103 10 x 10 10/01/1894 die i mensis x annoque mdcccxciv 94 xciv 1894} test clock-2.356 {conversion of 1894-10-31} { clock format -2372066704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1894 12:34:56 die xxxi mensis x annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2413133 10 x 10 10/31/1894 die xxxi mensis x annoque mdcccxciv 94 xciv 1894} test clock-2.357 {conversion of 1894-11-01} { clock format -2371980304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1894 12:34:56 die i mensis xi annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2413134 11 xi 11 11/01/1894 die i mensis xi annoque mdcccxciv 94 xciv 1894} test clock-2.358 {conversion of 1894-11-30} { clock format -2369474704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1894 12:34:56 die xxx mensis xi annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2413163 11 xi 11 11/30/1894 die xxx mensis xi annoque mdcccxciv 94 xciv 1894} test clock-2.359 {conversion of 1894-12-01} { clock format -2369388304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1894 12:34:56 die i mensis xii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2413164 12 xii 12 12/01/1894 die i mensis xii annoque mdcccxciv 94 xciv 1894} test clock-2.360 {conversion of 1894-12-31} { clock format -2366796304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1894 12:34:56 die xxxi mensis xii annoque mdcccxciv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2413194 12 xii 12 12/31/1894 die xxxi mensis xii annoque mdcccxciv 94 xciv 1894} test clock-2.361 {conversion of 1895-01-01} { clock format -2366709904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1895 12:34:56 die i mensis i annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2413195 01 i 1 01/01/1895 die i mensis i annoque mdcccxcv 95 xcv 1895} test clock-2.362 {conversion of 1895-01-31} { clock format -2364117904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1895 12:34:56 die xxxi mensis i annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2413225 01 i 1 01/31/1895 die xxxi mensis i annoque mdcccxcv 95 xcv 1895} test clock-2.363 {conversion of 1895-02-01} { clock format -2364031504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1895 12:34:56 die i mensis ii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2413226 02 ii 2 02/01/1895 die i mensis ii annoque mdcccxcv 95 xcv 1895} test clock-2.364 {conversion of 1895-02-28} { clock format -2361698704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1895 12:34:56 die xxviii mensis ii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2413253 02 ii 2 02/28/1895 die xxviii mensis ii annoque mdcccxcv 95 xcv 1895} test clock-2.365 {conversion of 1895-03-01} { clock format -2361612304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1895 12:34:56 die i mensis iii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2413254 03 iii 3 03/01/1895 die i mensis iii annoque mdcccxcv 95 xcv 1895} test clock-2.366 {conversion of 1895-03-31} { clock format -2359020304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1895 12:34:56 die xxxi mensis iii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2413284 03 iii 3 03/31/1895 die xxxi mensis iii annoque mdcccxcv 95 xcv 1895} test clock-2.367 {conversion of 1895-04-01} { clock format -2358933904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1895 12:34:56 die i mensis iv annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2413285 04 iv 4 04/01/1895 die i mensis iv annoque mdcccxcv 95 xcv 1895} test clock-2.368 {conversion of 1895-04-30} { clock format -2356428304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1895 12:34:56 die xxx mensis iv annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2413314 04 iv 4 04/30/1895 die xxx mensis iv annoque mdcccxcv 95 xcv 1895} test clock-2.369 {conversion of 1895-05-01} { clock format -2356341904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1895 12:34:56 die i mensis v annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2413315 05 v 5 05/01/1895 die i mensis v annoque mdcccxcv 95 xcv 1895} test clock-2.370 {conversion of 1895-05-31} { clock format -2353749904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1895 12:34:56 die xxxi mensis v annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2413345 05 v 5 05/31/1895 die xxxi mensis v annoque mdcccxcv 95 xcv 1895} test clock-2.371 {conversion of 1895-06-01} { clock format -2353663504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1895 12:34:56 die i mensis vi annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2413346 06 vi 6 06/01/1895 die i mensis vi annoque mdcccxcv 95 xcv 1895} test clock-2.372 {conversion of 1895-06-30} { clock format -2351157904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1895 12:34:56 die xxx mensis vi annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2413375 06 vi 6 06/30/1895 die xxx mensis vi annoque mdcccxcv 95 xcv 1895} test clock-2.373 {conversion of 1895-07-01} { clock format -2351071504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1895 12:34:56 die i mensis vii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2413376 07 vii 7 07/01/1895 die i mensis vii annoque mdcccxcv 95 xcv 1895} test clock-2.374 {conversion of 1895-07-31} { clock format -2348479504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1895 12:34:56 die xxxi mensis vii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2413406 07 vii 7 07/31/1895 die xxxi mensis vii annoque mdcccxcv 95 xcv 1895} test clock-2.375 {conversion of 1895-08-01} { clock format -2348393104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1895 12:34:56 die i mensis viii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2413407 08 viii 8 08/01/1895 die i mensis viii annoque mdcccxcv 95 xcv 1895} test clock-2.376 {conversion of 1895-08-31} { clock format -2345801104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1895 12:34:56 die xxxi mensis viii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2413437 08 viii 8 08/31/1895 die xxxi mensis viii annoque mdcccxcv 95 xcv 1895} test clock-2.377 {conversion of 1895-09-01} { clock format -2345714704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1895 12:34:56 die i mensis ix annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2413438 09 ix 9 09/01/1895 die i mensis ix annoque mdcccxcv 95 xcv 1895} test clock-2.378 {conversion of 1895-09-30} { clock format -2343209104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1895 12:34:56 die xxx mensis ix annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2413467 09 ix 9 09/30/1895 die xxx mensis ix annoque mdcccxcv 95 xcv 1895} test clock-2.379 {conversion of 1895-10-01} { clock format -2343122704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1895 12:34:56 die i mensis x annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2413468 10 x 10 10/01/1895 die i mensis x annoque mdcccxcv 95 xcv 1895} test clock-2.380 {conversion of 1895-10-31} { clock format -2340530704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1895 12:34:56 die xxxi mensis x annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2413498 10 x 10 10/31/1895 die xxxi mensis x annoque mdcccxcv 95 xcv 1895} test clock-2.381 {conversion of 1895-11-01} { clock format -2340444304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1895 12:34:56 die i mensis xi annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2413499 11 xi 11 11/01/1895 die i mensis xi annoque mdcccxcv 95 xcv 1895} test clock-2.382 {conversion of 1895-11-30} { clock format -2337938704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1895 12:34:56 die xxx mensis xi annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2413528 11 xi 11 11/30/1895 die xxx mensis xi annoque mdcccxcv 95 xcv 1895} test clock-2.383 {conversion of 1895-12-01} { clock format -2337852304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1895 12:34:56 die i mensis xii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2413529 12 xii 12 12/01/1895 die i mensis xii annoque mdcccxcv 95 xcv 1895} test clock-2.384 {conversion of 1895-12-31} { clock format -2335260304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1895 12:34:56 die xxxi mensis xii annoque mdcccxcv xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2413559 12 xii 12 12/31/1895 die xxxi mensis xii annoque mdcccxcv 95 xcv 1895} test clock-2.385 {conversion of 1896-01-01} { clock format -2335173904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1896 12:34:56 die i mensis i annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2413560 01 i 1 01/01/1896 die i mensis i annoque mdcccxcvi 96 xcvi 1896} test clock-2.386 {conversion of 1896-01-31} { clock format -2332581904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1896 12:34:56 die xxxi mensis i annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2413590 01 i 1 01/31/1896 die xxxi mensis i annoque mdcccxcvi 96 xcvi 1896} test clock-2.387 {conversion of 1896-02-01} { clock format -2332495504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1896 12:34:56 die i mensis ii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2413591 02 ii 2 02/01/1896 die i mensis ii annoque mdcccxcvi 96 xcvi 1896} test clock-2.388 {conversion of 1896-02-29} { clock format -2330076304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1896 12:34:56 die xxix mensis ii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 29 xxix 29 xxix Feb 060 2413619 02 ii 2 02/29/1896 die xxix mensis ii annoque mdcccxcvi 96 xcvi 1896} test clock-2.389 {conversion of 1896-03-01} { clock format -2329989904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1896 12:34:56 die i mensis iii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 061 2413620 03 iii 3 03/01/1896 die i mensis iii annoque mdcccxcvi 96 xcvi 1896} test clock-2.390 {conversion of 1896-03-31} { clock format -2327397904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1896 12:34:56 die xxxi mensis iii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 091 2413650 03 iii 3 03/31/1896 die xxxi mensis iii annoque mdcccxcvi 96 xcvi 1896} test clock-2.391 {conversion of 1896-04-01} { clock format -2327311504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1896 12:34:56 die i mensis iv annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 092 2413651 04 iv 4 04/01/1896 die i mensis iv annoque mdcccxcvi 96 xcvi 1896} test clock-2.392 {conversion of 1896-04-30} { clock format -2324805904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1896 12:34:56 die xxx mensis iv annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 121 2413680 04 iv 4 04/30/1896 die xxx mensis iv annoque mdcccxcvi 96 xcvi 1896} test clock-2.393 {conversion of 1896-05-01} { clock format -2324719504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1896 12:34:56 die i mensis v annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 122 2413681 05 v 5 05/01/1896 die i mensis v annoque mdcccxcvi 96 xcvi 1896} test clock-2.394 {conversion of 1896-05-31} { clock format -2322127504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1896 12:34:56 die xxxi mensis v annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 152 2413711 05 v 5 05/31/1896 die xxxi mensis v annoque mdcccxcvi 96 xcvi 1896} test clock-2.395 {conversion of 1896-06-01} { clock format -2322041104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1896 12:34:56 die i mensis vi annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 153 2413712 06 vi 6 06/01/1896 die i mensis vi annoque mdcccxcvi 96 xcvi 1896} test clock-2.396 {conversion of 1896-06-30} { clock format -2319535504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1896 12:34:56 die xxx mensis vi annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 182 2413741 06 vi 6 06/30/1896 die xxx mensis vi annoque mdcccxcvi 96 xcvi 1896} test clock-2.397 {conversion of 1896-07-01} { clock format -2319449104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1896 12:34:56 die i mensis vii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 183 2413742 07 vii 7 07/01/1896 die i mensis vii annoque mdcccxcvi 96 xcvi 1896} test clock-2.398 {conversion of 1896-07-31} { clock format -2316857104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1896 12:34:56 die xxxi mensis vii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 213 2413772 07 vii 7 07/31/1896 die xxxi mensis vii annoque mdcccxcvi 96 xcvi 1896} test clock-2.399 {conversion of 1896-08-01} { clock format -2316770704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1896 12:34:56 die i mensis viii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 214 2413773 08 viii 8 08/01/1896 die i mensis viii annoque mdcccxcvi 96 xcvi 1896} test clock-2.400 {conversion of 1896-08-31} { clock format -2314178704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1896 12:34:56 die xxxi mensis viii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 244 2413803 08 viii 8 08/31/1896 die xxxi mensis viii annoque mdcccxcvi 96 xcvi 1896} test clock-2.401 {conversion of 1896-09-01} { clock format -2314092304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1896 12:34:56 die i mensis ix annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 245 2413804 09 ix 9 09/01/1896 die i mensis ix annoque mdcccxcvi 96 xcvi 1896} test clock-2.402 {conversion of 1896-09-30} { clock format -2311586704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1896 12:34:56 die xxx mensis ix annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 274 2413833 09 ix 9 09/30/1896 die xxx mensis ix annoque mdcccxcvi 96 xcvi 1896} test clock-2.403 {conversion of 1896-10-01} { clock format -2311500304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1896 12:34:56 die i mensis x annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 275 2413834 10 x 10 10/01/1896 die i mensis x annoque mdcccxcvi 96 xcvi 1896} test clock-2.404 {conversion of 1896-10-31} { clock format -2308908304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1896 12:34:56 die xxxi mensis x annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 305 2413864 10 x 10 10/31/1896 die xxxi mensis x annoque mdcccxcvi 96 xcvi 1896} test clock-2.405 {conversion of 1896-11-01} { clock format -2308821904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1896 12:34:56 die i mensis xi annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 306 2413865 11 xi 11 11/01/1896 die i mensis xi annoque mdcccxcvi 96 xcvi 1896} test clock-2.406 {conversion of 1896-11-30} { clock format -2306316304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1896 12:34:56 die xxx mensis xi annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 335 2413894 11 xi 11 11/30/1896 die xxx mensis xi annoque mdcccxcvi 96 xcvi 1896} test clock-2.407 {conversion of 1896-12-01} { clock format -2306229904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1896 12:34:56 die i mensis xii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 336 2413895 12 xii 12 12/01/1896 die i mensis xii annoque mdcccxcvi 96 xcvi 1896} test clock-2.408 {conversion of 1896-12-31} { clock format -2303637904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1896 12:34:56 die xxxi mensis xii annoque mdcccxcvi xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 366 2413925 12 xii 12 12/31/1896 die xxxi mensis xii annoque mdcccxcvi 96 xcvi 1896} test clock-2.409 {conversion of 1897-01-01} { clock format -2303551504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1897 12:34:56 die i mensis i annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2413926 01 i 1 01/01/1897 die i mensis i annoque mdcccxcvii 97 xcvii 1897} test clock-2.410 {conversion of 1897-01-31} { clock format -2300959504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1897 12:34:56 die xxxi mensis i annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2413956 01 i 1 01/31/1897 die xxxi mensis i annoque mdcccxcvii 97 xcvii 1897} test clock-2.411 {conversion of 1897-02-01} { clock format -2300873104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1897 12:34:56 die i mensis ii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2413957 02 ii 2 02/01/1897 die i mensis ii annoque mdcccxcvii 97 xcvii 1897} test clock-2.412 {conversion of 1897-02-28} { clock format -2298540304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1897 12:34:56 die xxviii mensis ii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2413984 02 ii 2 02/28/1897 die xxviii mensis ii annoque mdcccxcvii 97 xcvii 1897} test clock-2.413 {conversion of 1897-03-01} { clock format -2298453904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1897 12:34:56 die i mensis iii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2413985 03 iii 3 03/01/1897 die i mensis iii annoque mdcccxcvii 97 xcvii 1897} test clock-2.414 {conversion of 1897-03-31} { clock format -2295861904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1897 12:34:56 die xxxi mensis iii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2414015 03 iii 3 03/31/1897 die xxxi mensis iii annoque mdcccxcvii 97 xcvii 1897} test clock-2.415 {conversion of 1897-04-01} { clock format -2295775504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1897 12:34:56 die i mensis iv annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2414016 04 iv 4 04/01/1897 die i mensis iv annoque mdcccxcvii 97 xcvii 1897} test clock-2.416 {conversion of 1897-04-30} { clock format -2293269904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1897 12:34:56 die xxx mensis iv annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2414045 04 iv 4 04/30/1897 die xxx mensis iv annoque mdcccxcvii 97 xcvii 1897} test clock-2.417 {conversion of 1897-05-01} { clock format -2293183504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1897 12:34:56 die i mensis v annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2414046 05 v 5 05/01/1897 die i mensis v annoque mdcccxcvii 97 xcvii 1897} test clock-2.418 {conversion of 1897-05-31} { clock format -2290591504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1897 12:34:56 die xxxi mensis v annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2414076 05 v 5 05/31/1897 die xxxi mensis v annoque mdcccxcvii 97 xcvii 1897} test clock-2.419 {conversion of 1897-06-01} { clock format -2290505104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1897 12:34:56 die i mensis vi annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2414077 06 vi 6 06/01/1897 die i mensis vi annoque mdcccxcvii 97 xcvii 1897} test clock-2.420 {conversion of 1897-06-30} { clock format -2287999504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1897 12:34:56 die xxx mensis vi annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2414106 06 vi 6 06/30/1897 die xxx mensis vi annoque mdcccxcvii 97 xcvii 1897} test clock-2.421 {conversion of 1897-07-01} { clock format -2287913104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1897 12:34:56 die i mensis vii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2414107 07 vii 7 07/01/1897 die i mensis vii annoque mdcccxcvii 97 xcvii 1897} test clock-2.422 {conversion of 1897-07-31} { clock format -2285321104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1897 12:34:56 die xxxi mensis vii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2414137 07 vii 7 07/31/1897 die xxxi mensis vii annoque mdcccxcvii 97 xcvii 1897} test clock-2.423 {conversion of 1897-08-01} { clock format -2285234704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1897 12:34:56 die i mensis viii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2414138 08 viii 8 08/01/1897 die i mensis viii annoque mdcccxcvii 97 xcvii 1897} test clock-2.424 {conversion of 1897-08-31} { clock format -2282642704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1897 12:34:56 die xxxi mensis viii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2414168 08 viii 8 08/31/1897 die xxxi mensis viii annoque mdcccxcvii 97 xcvii 1897} test clock-2.425 {conversion of 1897-09-01} { clock format -2282556304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1897 12:34:56 die i mensis ix annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2414169 09 ix 9 09/01/1897 die i mensis ix annoque mdcccxcvii 97 xcvii 1897} test clock-2.426 {conversion of 1897-09-30} { clock format -2280050704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1897 12:34:56 die xxx mensis ix annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2414198 09 ix 9 09/30/1897 die xxx mensis ix annoque mdcccxcvii 97 xcvii 1897} test clock-2.427 {conversion of 1897-10-01} { clock format -2279964304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1897 12:34:56 die i mensis x annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2414199 10 x 10 10/01/1897 die i mensis x annoque mdcccxcvii 97 xcvii 1897} test clock-2.428 {conversion of 1897-10-31} { clock format -2277372304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1897 12:34:56 die xxxi mensis x annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2414229 10 x 10 10/31/1897 die xxxi mensis x annoque mdcccxcvii 97 xcvii 1897} test clock-2.429 {conversion of 1897-11-01} { clock format -2277285904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1897 12:34:56 die i mensis xi annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2414230 11 xi 11 11/01/1897 die i mensis xi annoque mdcccxcvii 97 xcvii 1897} test clock-2.430 {conversion of 1897-11-30} { clock format -2274780304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1897 12:34:56 die xxx mensis xi annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2414259 11 xi 11 11/30/1897 die xxx mensis xi annoque mdcccxcvii 97 xcvii 1897} test clock-2.431 {conversion of 1897-12-01} { clock format -2274693904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1897 12:34:56 die i mensis xii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2414260 12 xii 12 12/01/1897 die i mensis xii annoque mdcccxcvii 97 xcvii 1897} test clock-2.432 {conversion of 1897-12-31} { clock format -2272101904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1897 12:34:56 die xxxi mensis xii annoque mdcccxcvii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2414290 12 xii 12 12/31/1897 die xxxi mensis xii annoque mdcccxcvii 97 xcvii 1897} test clock-2.433 {conversion of 1898-01-01} { clock format -2272015504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1898 12:34:56 die i mensis i annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2414291 01 i 1 01/01/1898 die i mensis i annoque mdcccxcviii 98 xcviii 1898} test clock-2.434 {conversion of 1898-01-31} { clock format -2269423504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1898 12:34:56 die xxxi mensis i annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2414321 01 i 1 01/31/1898 die xxxi mensis i annoque mdcccxcviii 98 xcviii 1898} test clock-2.435 {conversion of 1898-02-01} { clock format -2269337104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1898 12:34:56 die i mensis ii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2414322 02 ii 2 02/01/1898 die i mensis ii annoque mdcccxcviii 98 xcviii 1898} test clock-2.436 {conversion of 1898-02-28} { clock format -2267004304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1898 12:34:56 die xxviii mensis ii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2414349 02 ii 2 02/28/1898 die xxviii mensis ii annoque mdcccxcviii 98 xcviii 1898} test clock-2.437 {conversion of 1898-03-01} { clock format -2266917904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1898 12:34:56 die i mensis iii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2414350 03 iii 3 03/01/1898 die i mensis iii annoque mdcccxcviii 98 xcviii 1898} test clock-2.438 {conversion of 1898-03-31} { clock format -2264325904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1898 12:34:56 die xxxi mensis iii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2414380 03 iii 3 03/31/1898 die xxxi mensis iii annoque mdcccxcviii 98 xcviii 1898} test clock-2.439 {conversion of 1898-04-01} { clock format -2264239504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1898 12:34:56 die i mensis iv annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2414381 04 iv 4 04/01/1898 die i mensis iv annoque mdcccxcviii 98 xcviii 1898} test clock-2.440 {conversion of 1898-04-30} { clock format -2261733904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1898 12:34:56 die xxx mensis iv annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2414410 04 iv 4 04/30/1898 die xxx mensis iv annoque mdcccxcviii 98 xcviii 1898} test clock-2.441 {conversion of 1898-05-01} { clock format -2261647504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1898 12:34:56 die i mensis v annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2414411 05 v 5 05/01/1898 die i mensis v annoque mdcccxcviii 98 xcviii 1898} test clock-2.442 {conversion of 1898-05-31} { clock format -2259055504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1898 12:34:56 die xxxi mensis v annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2414441 05 v 5 05/31/1898 die xxxi mensis v annoque mdcccxcviii 98 xcviii 1898} test clock-2.443 {conversion of 1898-06-01} { clock format -2258969104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1898 12:34:56 die i mensis vi annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2414442 06 vi 6 06/01/1898 die i mensis vi annoque mdcccxcviii 98 xcviii 1898} test clock-2.444 {conversion of 1898-06-30} { clock format -2256463504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1898 12:34:56 die xxx mensis vi annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2414471 06 vi 6 06/30/1898 die xxx mensis vi annoque mdcccxcviii 98 xcviii 1898} test clock-2.445 {conversion of 1898-07-01} { clock format -2256377104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1898 12:34:56 die i mensis vii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2414472 07 vii 7 07/01/1898 die i mensis vii annoque mdcccxcviii 98 xcviii 1898} test clock-2.446 {conversion of 1898-07-31} { clock format -2253785104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1898 12:34:56 die xxxi mensis vii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2414502 07 vii 7 07/31/1898 die xxxi mensis vii annoque mdcccxcviii 98 xcviii 1898} test clock-2.447 {conversion of 1898-08-01} { clock format -2253698704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1898 12:34:56 die i mensis viii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2414503 08 viii 8 08/01/1898 die i mensis viii annoque mdcccxcviii 98 xcviii 1898} test clock-2.448 {conversion of 1898-08-31} { clock format -2251106704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1898 12:34:56 die xxxi mensis viii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2414533 08 viii 8 08/31/1898 die xxxi mensis viii annoque mdcccxcviii 98 xcviii 1898} test clock-2.449 {conversion of 1898-09-01} { clock format -2251020304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1898 12:34:56 die i mensis ix annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2414534 09 ix 9 09/01/1898 die i mensis ix annoque mdcccxcviii 98 xcviii 1898} test clock-2.450 {conversion of 1898-09-30} { clock format -2248514704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1898 12:34:56 die xxx mensis ix annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2414563 09 ix 9 09/30/1898 die xxx mensis ix annoque mdcccxcviii 98 xcviii 1898} test clock-2.451 {conversion of 1898-10-01} { clock format -2248428304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1898 12:34:56 die i mensis x annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2414564 10 x 10 10/01/1898 die i mensis x annoque mdcccxcviii 98 xcviii 1898} test clock-2.452 {conversion of 1898-10-31} { clock format -2245836304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1898 12:34:56 die xxxi mensis x annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2414594 10 x 10 10/31/1898 die xxxi mensis x annoque mdcccxcviii 98 xcviii 1898} test clock-2.453 {conversion of 1898-11-01} { clock format -2245749904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1898 12:34:56 die i mensis xi annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2414595 11 xi 11 11/01/1898 die i mensis xi annoque mdcccxcviii 98 xcviii 1898} test clock-2.454 {conversion of 1898-11-30} { clock format -2243244304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1898 12:34:56 die xxx mensis xi annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2414624 11 xi 11 11/30/1898 die xxx mensis xi annoque mdcccxcviii 98 xcviii 1898} test clock-2.455 {conversion of 1898-12-01} { clock format -2243157904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1898 12:34:56 die i mensis xii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2414625 12 xii 12 12/01/1898 die i mensis xii annoque mdcccxcviii 98 xcviii 1898} test clock-2.456 {conversion of 1898-12-31} { clock format -2240565904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1898 12:34:56 die xxxi mensis xii annoque mdcccxcviii xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2414655 12 xii 12 12/31/1898 die xxxi mensis xii annoque mdcccxcviii 98 xcviii 1898} test clock-2.457 {conversion of 1899-01-01} { clock format -2240479504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1899 12:34:56 die i mensis i annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jan 001 2414656 01 i 1 01/01/1899 die i mensis i annoque mdcccxcix 99 xcix 1899} test clock-2.458 {conversion of 1899-01-31} { clock format -2237887504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1899 12:34:56 die xxxi mensis i annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jan 031 2414686 01 i 1 01/31/1899 die xxxi mensis i annoque mdcccxcix 99 xcix 1899} test clock-2.459 {conversion of 1899-02-01} { clock format -2237801104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1899 12:34:56 die i mensis ii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Feb 032 2414687 02 ii 2 02/01/1899 die i mensis ii annoque mdcccxcix 99 xcix 1899} test clock-2.460 {conversion of 1899-02-28} { clock format -2235468304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1899 12:34:56 die xxviii mensis ii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 28 xxviii 28 xxviii Feb 059 2414714 02 ii 2 02/28/1899 die xxviii mensis ii annoque mdcccxcix 99 xcix 1899} test clock-2.461 {conversion of 1899-03-01} { clock format -2235381904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1899 12:34:56 die i mensis iii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Mar 060 2414715 03 iii 3 03/01/1899 die i mensis iii annoque mdcccxcix 99 xcix 1899} test clock-2.462 {conversion of 1899-03-31} { clock format -2232789904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1899 12:34:56 die xxxi mensis iii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Mar 090 2414745 03 iii 3 03/31/1899 die xxxi mensis iii annoque mdcccxcix 99 xcix 1899} test clock-2.463 {conversion of 1899-04-01} { clock format -2232703504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1899 12:34:56 die i mensis iv annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Apr 091 2414746 04 iv 4 04/01/1899 die i mensis iv annoque mdcccxcix 99 xcix 1899} test clock-2.464 {conversion of 1899-04-30} { clock format -2230197904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1899 12:34:56 die xxx mensis iv annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Apr 120 2414775 04 iv 4 04/30/1899 die xxx mensis iv annoque mdcccxcix 99 xcix 1899} test clock-2.465 {conversion of 1899-05-01} { clock format -2230111504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1899 12:34:56 die i mensis v annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i May 121 2414776 05 v 5 05/01/1899 die i mensis v annoque mdcccxcix 99 xcix 1899} test clock-2.466 {conversion of 1899-05-31} { clock format -2227519504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1899 12:34:56 die xxxi mensis v annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi May 151 2414806 05 v 5 05/31/1899 die xxxi mensis v annoque mdcccxcix 99 xcix 1899} test clock-2.467 {conversion of 1899-06-01} { clock format -2227433104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1899 12:34:56 die i mensis vi annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jun 152 2414807 06 vi 6 06/01/1899 die i mensis vi annoque mdcccxcix 99 xcix 1899} test clock-2.468 {conversion of 1899-06-30} { clock format -2224927504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1899 12:34:56 die xxx mensis vi annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Jun 181 2414836 06 vi 6 06/30/1899 die xxx mensis vi annoque mdcccxcix 99 xcix 1899} test clock-2.469 {conversion of 1899-07-01} { clock format -2224841104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1899 12:34:56 die i mensis vii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Jul 182 2414837 07 vii 7 07/01/1899 die i mensis vii annoque mdcccxcix 99 xcix 1899} test clock-2.470 {conversion of 1899-07-31} { clock format -2222249104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1899 12:34:56 die xxxi mensis vii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Jul 212 2414867 07 vii 7 07/31/1899 die xxxi mensis vii annoque mdcccxcix 99 xcix 1899} test clock-2.471 {conversion of 1899-08-01} { clock format -2222162704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1899 12:34:56 die i mensis viii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Aug 213 2414868 08 viii 8 08/01/1899 die i mensis viii annoque mdcccxcix 99 xcix 1899} test clock-2.472 {conversion of 1899-08-31} { clock format -2219570704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1899 12:34:56 die xxxi mensis viii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Aug 243 2414898 08 viii 8 08/31/1899 die xxxi mensis viii annoque mdcccxcix 99 xcix 1899} test clock-2.473 {conversion of 1899-09-01} { clock format -2219484304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1899 12:34:56 die i mensis ix annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Sep 244 2414899 09 ix 9 09/01/1899 die i mensis ix annoque mdcccxcix 99 xcix 1899} test clock-2.474 {conversion of 1899-09-30} { clock format -2216978704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1899 12:34:56 die xxx mensis ix annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Sep 273 2414928 09 ix 9 09/30/1899 die xxx mensis ix annoque mdcccxcix 99 xcix 1899} test clock-2.475 {conversion of 1899-10-01} { clock format -2216892304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1899 12:34:56 die i mensis x annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Oct 274 2414929 10 x 10 10/01/1899 die i mensis x annoque mdcccxcix 99 xcix 1899} test clock-2.476 {conversion of 1899-10-31} { clock format -2214300304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1899 12:34:56 die xxxi mensis x annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Oct 304 2414959 10 x 10 10/31/1899 die xxxi mensis x annoque mdcccxcix 99 xcix 1899} test clock-2.477 {conversion of 1899-11-01} { clock format -2214213904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1899 12:34:56 die i mensis xi annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Nov 305 2414960 11 xi 11 11/01/1899 die i mensis xi annoque mdcccxcix 99 xcix 1899} test clock-2.478 {conversion of 1899-11-30} { clock format -2211708304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1899 12:34:56 die xxx mensis xi annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 30 xxx 30 xxx Nov 334 2414989 11 xi 11 11/30/1899 die xxx mensis xi annoque mdcccxcix 99 xcix 1899} test clock-2.479 {conversion of 1899-12-01} { clock format -2211621904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1899 12:34:56 die i mensis xii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 01 i 1 i Dec 335 2414990 12 xii 12 12/01/1899 die i mensis xii annoque mdcccxcix 99 xcix 1899} test clock-2.480 {conversion of 1899-12-31} { clock format -2209029904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1899 12:34:56 die xxxi mensis xii annoque mdcccxcix xii h xxxiv m lvi s 18 mdccc 31 xxxi 31 xxxi Dec 365 2415020 12 xii 12 12/31/1899 die xxxi mensis xii annoque mdcccxcix 99 xcix 1899} test clock-2.481 {conversion of 1900-01-01} { clock format -2208943504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1900 12:34:56 die i mensis i annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2415021 01 i 1 01/01/1900 die i mensis i annoque mcm? 00 ? 1900} test clock-2.482 {conversion of 1900-01-31} { clock format -2206351504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1900 12:34:56 die xxxi mensis i annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2415051 01 i 1 01/31/1900 die xxxi mensis i annoque mcm? 00 ? 1900} test clock-2.483 {conversion of 1900-02-01} { clock format -2206265104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1900 12:34:56 die i mensis ii annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2415052 02 ii 2 02/01/1900 die i mensis ii annoque mcm? 00 ? 1900} test clock-2.484 {conversion of 1900-02-28} { clock format -2203932304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1900 12:34:56 die xxviii mensis ii annoque mcm? xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2415079 02 ii 2 02/28/1900 die xxviii mensis ii annoque mcm? 00 ? 1900} test clock-2.485 {conversion of 1900-03-01} { clock format -2203845904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1900 12:34:56 die i mensis iii annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2415080 03 iii 3 03/01/1900 die i mensis iii annoque mcm? 00 ? 1900} test clock-2.486 {conversion of 1900-03-31} { clock format -2201253904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1900 12:34:56 die xxxi mensis iii annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2415110 03 iii 3 03/31/1900 die xxxi mensis iii annoque mcm? 00 ? 1900} test clock-2.487 {conversion of 1900-04-01} { clock format -2201167504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1900 12:34:56 die i mensis iv annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2415111 04 iv 4 04/01/1900 die i mensis iv annoque mcm? 00 ? 1900} test clock-2.488 {conversion of 1900-04-30} { clock format -2198661904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1900 12:34:56 die xxx mensis iv annoque mcm? xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2415140 04 iv 4 04/30/1900 die xxx mensis iv annoque mcm? 00 ? 1900} test clock-2.489 {conversion of 1900-05-01} { clock format -2198575504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1900 12:34:56 die i mensis v annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2415141 05 v 5 05/01/1900 die i mensis v annoque mcm? 00 ? 1900} test clock-2.490 {conversion of 1900-05-31} { clock format -2195983504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1900 12:34:56 die xxxi mensis v annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2415171 05 v 5 05/31/1900 die xxxi mensis v annoque mcm? 00 ? 1900} test clock-2.491 {conversion of 1900-06-01} { clock format -2195897104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1900 12:34:56 die i mensis vi annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2415172 06 vi 6 06/01/1900 die i mensis vi annoque mcm? 00 ? 1900} test clock-2.492 {conversion of 1900-06-30} { clock format -2193391504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1900 12:34:56 die xxx mensis vi annoque mcm? xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2415201 06 vi 6 06/30/1900 die xxx mensis vi annoque mcm? 00 ? 1900} test clock-2.493 {conversion of 1900-07-01} { clock format -2193305104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1900 12:34:56 die i mensis vii annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2415202 07 vii 7 07/01/1900 die i mensis vii annoque mcm? 00 ? 1900} test clock-2.494 {conversion of 1900-07-31} { clock format -2190713104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1900 12:34:56 die xxxi mensis vii annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2415232 07 vii 7 07/31/1900 die xxxi mensis vii annoque mcm? 00 ? 1900} test clock-2.495 {conversion of 1900-08-01} { clock format -2190626704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1900 12:34:56 die i mensis viii annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2415233 08 viii 8 08/01/1900 die i mensis viii annoque mcm? 00 ? 1900} test clock-2.496 {conversion of 1900-08-31} { clock format -2188034704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1900 12:34:56 die xxxi mensis viii annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2415263 08 viii 8 08/31/1900 die xxxi mensis viii annoque mcm? 00 ? 1900} test clock-2.497 {conversion of 1900-09-01} { clock format -2187948304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1900 12:34:56 die i mensis ix annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2415264 09 ix 9 09/01/1900 die i mensis ix annoque mcm? 00 ? 1900} test clock-2.498 {conversion of 1900-09-30} { clock format -2185442704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1900 12:34:56 die xxx mensis ix annoque mcm? xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2415293 09 ix 9 09/30/1900 die xxx mensis ix annoque mcm? 00 ? 1900} test clock-2.499 {conversion of 1900-10-01} { clock format -2185356304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1900 12:34:56 die i mensis x annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2415294 10 x 10 10/01/1900 die i mensis x annoque mcm? 00 ? 1900} test clock-2.500 {conversion of 1900-10-31} { clock format -2182764304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1900 12:34:56 die xxxi mensis x annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2415324 10 x 10 10/31/1900 die xxxi mensis x annoque mcm? 00 ? 1900} test clock-2.501 {conversion of 1900-11-01} { clock format -2182677904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1900 12:34:56 die i mensis xi annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2415325 11 xi 11 11/01/1900 die i mensis xi annoque mcm? 00 ? 1900} test clock-2.502 {conversion of 1900-11-30} { clock format -2180172304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1900 12:34:56 die xxx mensis xi annoque mcm? xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2415354 11 xi 11 11/30/1900 die xxx mensis xi annoque mcm? 00 ? 1900} test clock-2.503 {conversion of 1900-12-01} { clock format -2180085904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1900 12:34:56 die i mensis xii annoque mcm? xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2415355 12 xii 12 12/01/1900 die i mensis xii annoque mcm? 00 ? 1900} test clock-2.504 {conversion of 1900-12-31} { clock format -2177493904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1900 12:34:56 die xxxi mensis xii annoque mcm? xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2415385 12 xii 12 12/31/1900 die xxxi mensis xii annoque mcm? 00 ? 1900} test clock-2.505 {conversion of 1944-01-01} { clock format -820495504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1944 12:34:56 die i mensis i annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2431091 01 i 1 01/01/1944 die i mensis i annoque mcmxliv 44 xliv 1944} test clock-2.506 {conversion of 1944-01-31} { clock format -817903504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1944 12:34:56 die xxxi mensis i annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2431121 01 i 1 01/31/1944 die xxxi mensis i annoque mcmxliv 44 xliv 1944} test clock-2.507 {conversion of 1944-02-01} { clock format -817817104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1944 12:34:56 die i mensis ii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2431122 02 ii 2 02/01/1944 die i mensis ii annoque mcmxliv 44 xliv 1944} test clock-2.508 {conversion of 1944-02-29} { clock format -815397904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1944 12:34:56 die xxix mensis ii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2431150 02 ii 2 02/29/1944 die xxix mensis ii annoque mcmxliv 44 xliv 1944} test clock-2.509 {conversion of 1944-03-01} { clock format -815311504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1944 12:34:56 die i mensis iii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2431151 03 iii 3 03/01/1944 die i mensis iii annoque mcmxliv 44 xliv 1944} test clock-2.510 {conversion of 1944-03-31} { clock format -812719504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1944 12:34:56 die xxxi mensis iii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2431181 03 iii 3 03/31/1944 die xxxi mensis iii annoque mcmxliv 44 xliv 1944} test clock-2.511 {conversion of 1944-04-01} { clock format -812633104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1944 12:34:56 die i mensis iv annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2431182 04 iv 4 04/01/1944 die i mensis iv annoque mcmxliv 44 xliv 1944} test clock-2.512 {conversion of 1944-04-30} { clock format -810127504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1944 12:34:56 die xxx mensis iv annoque mcmxliv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2431211 04 iv 4 04/30/1944 die xxx mensis iv annoque mcmxliv 44 xliv 1944} test clock-2.513 {conversion of 1944-05-01} { clock format -810041104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1944 12:34:56 die i mensis v annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2431212 05 v 5 05/01/1944 die i mensis v annoque mcmxliv 44 xliv 1944} test clock-2.514 {conversion of 1944-05-31} { clock format -807449104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1944 12:34:56 die xxxi mensis v annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2431242 05 v 5 05/31/1944 die xxxi mensis v annoque mcmxliv 44 xliv 1944} test clock-2.515 {conversion of 1944-06-01} { clock format -807362704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1944 12:34:56 die i mensis vi annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2431243 06 vi 6 06/01/1944 die i mensis vi annoque mcmxliv 44 xliv 1944} test clock-2.516 {conversion of 1944-06-30} { clock format -804857104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1944 12:34:56 die xxx mensis vi annoque mcmxliv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2431272 06 vi 6 06/30/1944 die xxx mensis vi annoque mcmxliv 44 xliv 1944} test clock-2.517 {conversion of 1944-07-01} { clock format -804770704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1944 12:34:56 die i mensis vii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2431273 07 vii 7 07/01/1944 die i mensis vii annoque mcmxliv 44 xliv 1944} test clock-2.518 {conversion of 1944-07-31} { clock format -802178704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1944 12:34:56 die xxxi mensis vii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2431303 07 vii 7 07/31/1944 die xxxi mensis vii annoque mcmxliv 44 xliv 1944} test clock-2.519 {conversion of 1944-08-01} { clock format -802092304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1944 12:34:56 die i mensis viii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2431304 08 viii 8 08/01/1944 die i mensis viii annoque mcmxliv 44 xliv 1944} test clock-2.520 {conversion of 1944-08-31} { clock format -799500304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1944 12:34:56 die xxxi mensis viii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2431334 08 viii 8 08/31/1944 die xxxi mensis viii annoque mcmxliv 44 xliv 1944} test clock-2.521 {conversion of 1944-09-01} { clock format -799413904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1944 12:34:56 die i mensis ix annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2431335 09 ix 9 09/01/1944 die i mensis ix annoque mcmxliv 44 xliv 1944} test clock-2.522 {conversion of 1944-09-30} { clock format -796908304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1944 12:34:56 die xxx mensis ix annoque mcmxliv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2431364 09 ix 9 09/30/1944 die xxx mensis ix annoque mcmxliv 44 xliv 1944} test clock-2.523 {conversion of 1944-10-01} { clock format -796821904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1944 12:34:56 die i mensis x annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2431365 10 x 10 10/01/1944 die i mensis x annoque mcmxliv 44 xliv 1944} test clock-2.524 {conversion of 1944-10-31} { clock format -794229904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1944 12:34:56 die xxxi mensis x annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2431395 10 x 10 10/31/1944 die xxxi mensis x annoque mcmxliv 44 xliv 1944} test clock-2.525 {conversion of 1944-11-01} { clock format -794143504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1944 12:34:56 die i mensis xi annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2431396 11 xi 11 11/01/1944 die i mensis xi annoque mcmxliv 44 xliv 1944} test clock-2.526 {conversion of 1944-11-30} { clock format -791637904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1944 12:34:56 die xxx mensis xi annoque mcmxliv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2431425 11 xi 11 11/30/1944 die xxx mensis xi annoque mcmxliv 44 xliv 1944} test clock-2.527 {conversion of 1944-12-01} { clock format -791551504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1944 12:34:56 die i mensis xii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2431426 12 xii 12 12/01/1944 die i mensis xii annoque mcmxliv 44 xliv 1944} test clock-2.528 {conversion of 1944-12-31} { clock format -788959504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1944 12:34:56 die xxxi mensis xii annoque mcmxliv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2431456 12 xii 12 12/31/1944 die xxxi mensis xii annoque mcmxliv 44 xliv 1944} test clock-2.529 {conversion of 1945-01-01} { clock format -788873104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1945 12:34:56 die i mensis i annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2431457 01 i 1 01/01/1945 die i mensis i annoque mcmxlv 45 xlv 1945} test clock-2.530 {conversion of 1945-01-31} { clock format -786281104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1945 12:34:56 die xxxi mensis i annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2431487 01 i 1 01/31/1945 die xxxi mensis i annoque mcmxlv 45 xlv 1945} test clock-2.531 {conversion of 1945-02-01} { clock format -786194704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1945 12:34:56 die i mensis ii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2431488 02 ii 2 02/01/1945 die i mensis ii annoque mcmxlv 45 xlv 1945} test clock-2.532 {conversion of 1945-02-28} { clock format -783861904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1945 12:34:56 die xxviii mensis ii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2431515 02 ii 2 02/28/1945 die xxviii mensis ii annoque mcmxlv 45 xlv 1945} test clock-2.533 {conversion of 1945-03-01} { clock format -783775504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1945 12:34:56 die i mensis iii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2431516 03 iii 3 03/01/1945 die i mensis iii annoque mcmxlv 45 xlv 1945} test clock-2.534 {conversion of 1945-03-31} { clock format -781183504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1945 12:34:56 die xxxi mensis iii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2431546 03 iii 3 03/31/1945 die xxxi mensis iii annoque mcmxlv 45 xlv 1945} test clock-2.535 {conversion of 1945-04-01} { clock format -781097104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1945 12:34:56 die i mensis iv annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2431547 04 iv 4 04/01/1945 die i mensis iv annoque mcmxlv 45 xlv 1945} test clock-2.536 {conversion of 1945-04-30} { clock format -778591504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1945 12:34:56 die xxx mensis iv annoque mcmxlv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2431576 04 iv 4 04/30/1945 die xxx mensis iv annoque mcmxlv 45 xlv 1945} test clock-2.537 {conversion of 1945-05-01} { clock format -778505104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1945 12:34:56 die i mensis v annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2431577 05 v 5 05/01/1945 die i mensis v annoque mcmxlv 45 xlv 1945} test clock-2.538 {conversion of 1945-05-31} { clock format -775913104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1945 12:34:56 die xxxi mensis v annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2431607 05 v 5 05/31/1945 die xxxi mensis v annoque mcmxlv 45 xlv 1945} test clock-2.539 {conversion of 1945-06-01} { clock format -775826704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1945 12:34:56 die i mensis vi annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2431608 06 vi 6 06/01/1945 die i mensis vi annoque mcmxlv 45 xlv 1945} test clock-2.540 {conversion of 1945-06-30} { clock format -773321104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1945 12:34:56 die xxx mensis vi annoque mcmxlv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2431637 06 vi 6 06/30/1945 die xxx mensis vi annoque mcmxlv 45 xlv 1945} test clock-2.541 {conversion of 1945-07-01} { clock format -773234704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1945 12:34:56 die i mensis vii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2431638 07 vii 7 07/01/1945 die i mensis vii annoque mcmxlv 45 xlv 1945} test clock-2.542 {conversion of 1945-07-31} { clock format -770642704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1945 12:34:56 die xxxi mensis vii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2431668 07 vii 7 07/31/1945 die xxxi mensis vii annoque mcmxlv 45 xlv 1945} test clock-2.543 {conversion of 1945-08-01} { clock format -770556304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1945 12:34:56 die i mensis viii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2431669 08 viii 8 08/01/1945 die i mensis viii annoque mcmxlv 45 xlv 1945} test clock-2.544 {conversion of 1945-08-31} { clock format -767964304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1945 12:34:56 die xxxi mensis viii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2431699 08 viii 8 08/31/1945 die xxxi mensis viii annoque mcmxlv 45 xlv 1945} test clock-2.545 {conversion of 1945-09-01} { clock format -767877904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1945 12:34:56 die i mensis ix annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2431700 09 ix 9 09/01/1945 die i mensis ix annoque mcmxlv 45 xlv 1945} test clock-2.546 {conversion of 1945-09-30} { clock format -765372304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1945 12:34:56 die xxx mensis ix annoque mcmxlv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2431729 09 ix 9 09/30/1945 die xxx mensis ix annoque mcmxlv 45 xlv 1945} test clock-2.547 {conversion of 1945-10-01} { clock format -765285904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1945 12:34:56 die i mensis x annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2431730 10 x 10 10/01/1945 die i mensis x annoque mcmxlv 45 xlv 1945} test clock-2.548 {conversion of 1945-10-31} { clock format -762693904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1945 12:34:56 die xxxi mensis x annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2431760 10 x 10 10/31/1945 die xxxi mensis x annoque mcmxlv 45 xlv 1945} test clock-2.549 {conversion of 1945-11-01} { clock format -762607504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1945 12:34:56 die i mensis xi annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2431761 11 xi 11 11/01/1945 die i mensis xi annoque mcmxlv 45 xlv 1945} test clock-2.550 {conversion of 1945-11-30} { clock format -760101904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1945 12:34:56 die xxx mensis xi annoque mcmxlv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2431790 11 xi 11 11/30/1945 die xxx mensis xi annoque mcmxlv 45 xlv 1945} test clock-2.551 {conversion of 1945-12-01} { clock format -760015504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1945 12:34:56 die i mensis xii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2431791 12 xii 12 12/01/1945 die i mensis xii annoque mcmxlv 45 xlv 1945} test clock-2.552 {conversion of 1945-12-31} { clock format -757423504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1945 12:34:56 die xxxi mensis xii annoque mcmxlv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2431821 12 xii 12 12/31/1945 die xxxi mensis xii annoque mcmxlv 45 xlv 1945} test clock-2.553 {conversion of 1948-01-01} { clock format -694265104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1948 12:34:56 die i mensis i annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2432552 01 i 1 01/01/1948 die i mensis i annoque mcmxlviii 48 xlviii 1948} test clock-2.554 {conversion of 1948-01-31} { clock format -691673104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1948 12:34:56 die xxxi mensis i annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2432582 01 i 1 01/31/1948 die xxxi mensis i annoque mcmxlviii 48 xlviii 1948} test clock-2.555 {conversion of 1948-02-01} { clock format -691586704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1948 12:34:56 die i mensis ii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2432583 02 ii 2 02/01/1948 die i mensis ii annoque mcmxlviii 48 xlviii 1948} test clock-2.556 {conversion of 1948-02-29} { clock format -689167504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1948 12:34:56 die xxix mensis ii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2432611 02 ii 2 02/29/1948 die xxix mensis ii annoque mcmxlviii 48 xlviii 1948} test clock-2.557 {conversion of 1948-03-01} { clock format -689081104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1948 12:34:56 die i mensis iii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2432612 03 iii 3 03/01/1948 die i mensis iii annoque mcmxlviii 48 xlviii 1948} test clock-2.558 {conversion of 1948-03-31} { clock format -686489104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1948 12:34:56 die xxxi mensis iii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2432642 03 iii 3 03/31/1948 die xxxi mensis iii annoque mcmxlviii 48 xlviii 1948} test clock-2.559 {conversion of 1948-04-01} { clock format -686402704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1948 12:34:56 die i mensis iv annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2432643 04 iv 4 04/01/1948 die i mensis iv annoque mcmxlviii 48 xlviii 1948} test clock-2.560 {conversion of 1948-04-30} { clock format -683897104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1948 12:34:56 die xxx mensis iv annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2432672 04 iv 4 04/30/1948 die xxx mensis iv annoque mcmxlviii 48 xlviii 1948} test clock-2.561 {conversion of 1948-05-01} { clock format -683810704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1948 12:34:56 die i mensis v annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2432673 05 v 5 05/01/1948 die i mensis v annoque mcmxlviii 48 xlviii 1948} test clock-2.562 {conversion of 1948-05-31} { clock format -681218704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1948 12:34:56 die xxxi mensis v annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2432703 05 v 5 05/31/1948 die xxxi mensis v annoque mcmxlviii 48 xlviii 1948} test clock-2.563 {conversion of 1948-06-01} { clock format -681132304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1948 12:34:56 die i mensis vi annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2432704 06 vi 6 06/01/1948 die i mensis vi annoque mcmxlviii 48 xlviii 1948} test clock-2.564 {conversion of 1948-06-30} { clock format -678626704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1948 12:34:56 die xxx mensis vi annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2432733 06 vi 6 06/30/1948 die xxx mensis vi annoque mcmxlviii 48 xlviii 1948} test clock-2.565 {conversion of 1948-07-01} { clock format -678540304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1948 12:34:56 die i mensis vii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2432734 07 vii 7 07/01/1948 die i mensis vii annoque mcmxlviii 48 xlviii 1948} test clock-2.566 {conversion of 1948-07-31} { clock format -675948304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1948 12:34:56 die xxxi mensis vii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2432764 07 vii 7 07/31/1948 die xxxi mensis vii annoque mcmxlviii 48 xlviii 1948} test clock-2.567 {conversion of 1948-08-01} { clock format -675861904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1948 12:34:56 die i mensis viii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2432765 08 viii 8 08/01/1948 die i mensis viii annoque mcmxlviii 48 xlviii 1948} test clock-2.568 {conversion of 1948-08-31} { clock format -673269904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1948 12:34:56 die xxxi mensis viii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2432795 08 viii 8 08/31/1948 die xxxi mensis viii annoque mcmxlviii 48 xlviii 1948} test clock-2.569 {conversion of 1948-09-01} { clock format -673183504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1948 12:34:56 die i mensis ix annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2432796 09 ix 9 09/01/1948 die i mensis ix annoque mcmxlviii 48 xlviii 1948} test clock-2.570 {conversion of 1948-09-30} { clock format -670677904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1948 12:34:56 die xxx mensis ix annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2432825 09 ix 9 09/30/1948 die xxx mensis ix annoque mcmxlviii 48 xlviii 1948} test clock-2.571 {conversion of 1948-10-01} { clock format -670591504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1948 12:34:56 die i mensis x annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2432826 10 x 10 10/01/1948 die i mensis x annoque mcmxlviii 48 xlviii 1948} test clock-2.572 {conversion of 1948-10-31} { clock format -667999504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1948 12:34:56 die xxxi mensis x annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2432856 10 x 10 10/31/1948 die xxxi mensis x annoque mcmxlviii 48 xlviii 1948} test clock-2.573 {conversion of 1948-11-01} { clock format -667913104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1948 12:34:56 die i mensis xi annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2432857 11 xi 11 11/01/1948 die i mensis xi annoque mcmxlviii 48 xlviii 1948} test clock-2.574 {conversion of 1948-11-30} { clock format -665407504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1948 12:34:56 die xxx mensis xi annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2432886 11 xi 11 11/30/1948 die xxx mensis xi annoque mcmxlviii 48 xlviii 1948} test clock-2.575 {conversion of 1948-12-01} { clock format -665321104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1948 12:34:56 die i mensis xii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2432887 12 xii 12 12/01/1948 die i mensis xii annoque mcmxlviii 48 xlviii 1948} test clock-2.576 {conversion of 1948-12-31} { clock format -662729104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1948 12:34:56 die xxxi mensis xii annoque mcmxlviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2432917 12 xii 12 12/31/1948 die xxxi mensis xii annoque mcmxlviii 48 xlviii 1948} test clock-2.577 {conversion of 1949-01-01} { clock format -662642704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1949 12:34:56 die i mensis i annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2432918 01 i 1 01/01/1949 die i mensis i annoque mcmxlix 49 xlix 1949} test clock-2.578 {conversion of 1949-01-31} { clock format -660050704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1949 12:34:56 die xxxi mensis i annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2432948 01 i 1 01/31/1949 die xxxi mensis i annoque mcmxlix 49 xlix 1949} test clock-2.579 {conversion of 1949-02-01} { clock format -659964304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1949 12:34:56 die i mensis ii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2432949 02 ii 2 02/01/1949 die i mensis ii annoque mcmxlix 49 xlix 1949} test clock-2.580 {conversion of 1949-02-28} { clock format -657631504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1949 12:34:56 die xxviii mensis ii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2432976 02 ii 2 02/28/1949 die xxviii mensis ii annoque mcmxlix 49 xlix 1949} test clock-2.581 {conversion of 1949-03-01} { clock format -657545104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1949 12:34:56 die i mensis iii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2432977 03 iii 3 03/01/1949 die i mensis iii annoque mcmxlix 49 xlix 1949} test clock-2.582 {conversion of 1949-03-31} { clock format -654953104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1949 12:34:56 die xxxi mensis iii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2433007 03 iii 3 03/31/1949 die xxxi mensis iii annoque mcmxlix 49 xlix 1949} test clock-2.583 {conversion of 1949-04-01} { clock format -654866704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1949 12:34:56 die i mensis iv annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2433008 04 iv 4 04/01/1949 die i mensis iv annoque mcmxlix 49 xlix 1949} test clock-2.584 {conversion of 1949-04-30} { clock format -652361104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1949 12:34:56 die xxx mensis iv annoque mcmxlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2433037 04 iv 4 04/30/1949 die xxx mensis iv annoque mcmxlix 49 xlix 1949} test clock-2.585 {conversion of 1949-05-01} { clock format -652274704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1949 12:34:56 die i mensis v annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2433038 05 v 5 05/01/1949 die i mensis v annoque mcmxlix 49 xlix 1949} test clock-2.586 {conversion of 1949-05-31} { clock format -649682704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1949 12:34:56 die xxxi mensis v annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2433068 05 v 5 05/31/1949 die xxxi mensis v annoque mcmxlix 49 xlix 1949} test clock-2.587 {conversion of 1949-06-01} { clock format -649596304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1949 12:34:56 die i mensis vi annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2433069 06 vi 6 06/01/1949 die i mensis vi annoque mcmxlix 49 xlix 1949} test clock-2.588 {conversion of 1949-06-30} { clock format -647090704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1949 12:34:56 die xxx mensis vi annoque mcmxlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2433098 06 vi 6 06/30/1949 die xxx mensis vi annoque mcmxlix 49 xlix 1949} test clock-2.589 {conversion of 1949-07-01} { clock format -647004304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1949 12:34:56 die i mensis vii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2433099 07 vii 7 07/01/1949 die i mensis vii annoque mcmxlix 49 xlix 1949} test clock-2.590 {conversion of 1949-07-31} { clock format -644412304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1949 12:34:56 die xxxi mensis vii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2433129 07 vii 7 07/31/1949 die xxxi mensis vii annoque mcmxlix 49 xlix 1949} test clock-2.591 {conversion of 1949-08-01} { clock format -644325904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1949 12:34:56 die i mensis viii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2433130 08 viii 8 08/01/1949 die i mensis viii annoque mcmxlix 49 xlix 1949} test clock-2.592 {conversion of 1949-08-31} { clock format -641733904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1949 12:34:56 die xxxi mensis viii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2433160 08 viii 8 08/31/1949 die xxxi mensis viii annoque mcmxlix 49 xlix 1949} test clock-2.593 {conversion of 1949-09-01} { clock format -641647504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1949 12:34:56 die i mensis ix annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2433161 09 ix 9 09/01/1949 die i mensis ix annoque mcmxlix 49 xlix 1949} test clock-2.594 {conversion of 1949-09-30} { clock format -639141904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1949 12:34:56 die xxx mensis ix annoque mcmxlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2433190 09 ix 9 09/30/1949 die xxx mensis ix annoque mcmxlix 49 xlix 1949} test clock-2.595 {conversion of 1949-10-01} { clock format -639055504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1949 12:34:56 die i mensis x annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2433191 10 x 10 10/01/1949 die i mensis x annoque mcmxlix 49 xlix 1949} test clock-2.596 {conversion of 1949-10-31} { clock format -636463504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1949 12:34:56 die xxxi mensis x annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2433221 10 x 10 10/31/1949 die xxxi mensis x annoque mcmxlix 49 xlix 1949} test clock-2.597 {conversion of 1949-11-01} { clock format -636377104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1949 12:34:56 die i mensis xi annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2433222 11 xi 11 11/01/1949 die i mensis xi annoque mcmxlix 49 xlix 1949} test clock-2.598 {conversion of 1949-11-30} { clock format -633871504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1949 12:34:56 die xxx mensis xi annoque mcmxlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2433251 11 xi 11 11/30/1949 die xxx mensis xi annoque mcmxlix 49 xlix 1949} test clock-2.599 {conversion of 1949-12-01} { clock format -633785104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1949 12:34:56 die i mensis xii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2433252 12 xii 12 12/01/1949 die i mensis xii annoque mcmxlix 49 xlix 1949} test clock-2.600 {conversion of 1949-12-31} { clock format -631193104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1949 12:34:56 die xxxi mensis xii annoque mcmxlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2433282 12 xii 12 12/31/1949 die xxxi mensis xii annoque mcmxlix 49 xlix 1949} test clock-2.601 {conversion of 1952-01-01} { clock format -568034704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1952 12:34:56 die i mensis i annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2434013 01 i 1 01/01/1952 die i mensis i annoque mcmlii 52 lii 1952} test clock-2.602 {conversion of 1952-01-31} { clock format -565442704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1952 12:34:56 die xxxi mensis i annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2434043 01 i 1 01/31/1952 die xxxi mensis i annoque mcmlii 52 lii 1952} test clock-2.603 {conversion of 1952-02-01} { clock format -565356304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1952 12:34:56 die i mensis ii annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2434044 02 ii 2 02/01/1952 die i mensis ii annoque mcmlii 52 lii 1952} test clock-2.604 {conversion of 1952-02-29} { clock format -562937104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1952 12:34:56 die xxix mensis ii annoque mcmlii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2434072 02 ii 2 02/29/1952 die xxix mensis ii annoque mcmlii 52 lii 1952} test clock-2.605 {conversion of 1952-03-01} { clock format -562850704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1952 12:34:56 die i mensis iii annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2434073 03 iii 3 03/01/1952 die i mensis iii annoque mcmlii 52 lii 1952} test clock-2.606 {conversion of 1952-03-31} { clock format -560258704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1952 12:34:56 die xxxi mensis iii annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2434103 03 iii 3 03/31/1952 die xxxi mensis iii annoque mcmlii 52 lii 1952} test clock-2.607 {conversion of 1952-04-01} { clock format -560172304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1952 12:34:56 die i mensis iv annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2434104 04 iv 4 04/01/1952 die i mensis iv annoque mcmlii 52 lii 1952} test clock-2.608 {conversion of 1952-04-30} { clock format -557666704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1952 12:34:56 die xxx mensis iv annoque mcmlii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2434133 04 iv 4 04/30/1952 die xxx mensis iv annoque mcmlii 52 lii 1952} test clock-2.609 {conversion of 1952-05-01} { clock format -557580304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1952 12:34:56 die i mensis v annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2434134 05 v 5 05/01/1952 die i mensis v annoque mcmlii 52 lii 1952} test clock-2.610 {conversion of 1952-05-31} { clock format -554988304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1952 12:34:56 die xxxi mensis v annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2434164 05 v 5 05/31/1952 die xxxi mensis v annoque mcmlii 52 lii 1952} test clock-2.611 {conversion of 1952-06-01} { clock format -554901904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1952 12:34:56 die i mensis vi annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2434165 06 vi 6 06/01/1952 die i mensis vi annoque mcmlii 52 lii 1952} test clock-2.612 {conversion of 1952-06-30} { clock format -552396304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1952 12:34:56 die xxx mensis vi annoque mcmlii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2434194 06 vi 6 06/30/1952 die xxx mensis vi annoque mcmlii 52 lii 1952} test clock-2.613 {conversion of 1952-07-01} { clock format -552309904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1952 12:34:56 die i mensis vii annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2434195 07 vii 7 07/01/1952 die i mensis vii annoque mcmlii 52 lii 1952} test clock-2.614 {conversion of 1952-07-31} { clock format -549717904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1952 12:34:56 die xxxi mensis vii annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2434225 07 vii 7 07/31/1952 die xxxi mensis vii annoque mcmlii 52 lii 1952} test clock-2.615 {conversion of 1952-08-01} { clock format -549631504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1952 12:34:56 die i mensis viii annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2434226 08 viii 8 08/01/1952 die i mensis viii annoque mcmlii 52 lii 1952} test clock-2.616 {conversion of 1952-08-31} { clock format -547039504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1952 12:34:56 die xxxi mensis viii annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2434256 08 viii 8 08/31/1952 die xxxi mensis viii annoque mcmlii 52 lii 1952} test clock-2.617 {conversion of 1952-09-01} { clock format -546953104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1952 12:34:56 die i mensis ix annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2434257 09 ix 9 09/01/1952 die i mensis ix annoque mcmlii 52 lii 1952} test clock-2.618 {conversion of 1952-09-30} { clock format -544447504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1952 12:34:56 die xxx mensis ix annoque mcmlii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2434286 09 ix 9 09/30/1952 die xxx mensis ix annoque mcmlii 52 lii 1952} test clock-2.619 {conversion of 1952-10-01} { clock format -544361104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1952 12:34:56 die i mensis x annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2434287 10 x 10 10/01/1952 die i mensis x annoque mcmlii 52 lii 1952} test clock-2.620 {conversion of 1952-10-31} { clock format -541769104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1952 12:34:56 die xxxi mensis x annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2434317 10 x 10 10/31/1952 die xxxi mensis x annoque mcmlii 52 lii 1952} test clock-2.621 {conversion of 1952-11-01} { clock format -541682704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1952 12:34:56 die i mensis xi annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2434318 11 xi 11 11/01/1952 die i mensis xi annoque mcmlii 52 lii 1952} test clock-2.622 {conversion of 1952-11-30} { clock format -539177104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1952 12:34:56 die xxx mensis xi annoque mcmlii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2434347 11 xi 11 11/30/1952 die xxx mensis xi annoque mcmlii 52 lii 1952} test clock-2.623 {conversion of 1952-12-01} { clock format -539090704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1952 12:34:56 die i mensis xii annoque mcmlii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2434348 12 xii 12 12/01/1952 die i mensis xii annoque mcmlii 52 lii 1952} test clock-2.624 {conversion of 1952-12-31} { clock format -536498704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1952 12:34:56 die xxxi mensis xii annoque mcmlii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2434378 12 xii 12 12/31/1952 die xxxi mensis xii annoque mcmlii 52 lii 1952} test clock-2.625 {conversion of 1953-01-01} { clock format -536412304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1953 12:34:56 die i mensis i annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2434379 01 i 1 01/01/1953 die i mensis i annoque mcmliii 53 liii 1953} test clock-2.626 {conversion of 1953-01-31} { clock format -533820304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1953 12:34:56 die xxxi mensis i annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2434409 01 i 1 01/31/1953 die xxxi mensis i annoque mcmliii 53 liii 1953} test clock-2.627 {conversion of 1953-02-01} { clock format -533733904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1953 12:34:56 die i mensis ii annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2434410 02 ii 2 02/01/1953 die i mensis ii annoque mcmliii 53 liii 1953} test clock-2.628 {conversion of 1953-02-28} { clock format -531401104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1953 12:34:56 die xxviii mensis ii annoque mcmliii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2434437 02 ii 2 02/28/1953 die xxviii mensis ii annoque mcmliii 53 liii 1953} test clock-2.629 {conversion of 1953-03-01} { clock format -531314704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1953 12:34:56 die i mensis iii annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2434438 03 iii 3 03/01/1953 die i mensis iii annoque mcmliii 53 liii 1953} test clock-2.630 {conversion of 1953-03-31} { clock format -528722704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1953 12:34:56 die xxxi mensis iii annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2434468 03 iii 3 03/31/1953 die xxxi mensis iii annoque mcmliii 53 liii 1953} test clock-2.631 {conversion of 1953-04-01} { clock format -528636304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1953 12:34:56 die i mensis iv annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2434469 04 iv 4 04/01/1953 die i mensis iv annoque mcmliii 53 liii 1953} test clock-2.632 {conversion of 1953-04-30} { clock format -526130704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1953 12:34:56 die xxx mensis iv annoque mcmliii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2434498 04 iv 4 04/30/1953 die xxx mensis iv annoque mcmliii 53 liii 1953} test clock-2.633 {conversion of 1953-05-01} { clock format -526044304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1953 12:34:56 die i mensis v annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2434499 05 v 5 05/01/1953 die i mensis v annoque mcmliii 53 liii 1953} test clock-2.634 {conversion of 1953-05-31} { clock format -523452304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1953 12:34:56 die xxxi mensis v annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2434529 05 v 5 05/31/1953 die xxxi mensis v annoque mcmliii 53 liii 1953} test clock-2.635 {conversion of 1953-06-01} { clock format -523365904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1953 12:34:56 die i mensis vi annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2434530 06 vi 6 06/01/1953 die i mensis vi annoque mcmliii 53 liii 1953} test clock-2.636 {conversion of 1953-06-30} { clock format -520860304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1953 12:34:56 die xxx mensis vi annoque mcmliii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2434559 06 vi 6 06/30/1953 die xxx mensis vi annoque mcmliii 53 liii 1953} test clock-2.637 {conversion of 1953-07-01} { clock format -520773904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1953 12:34:56 die i mensis vii annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2434560 07 vii 7 07/01/1953 die i mensis vii annoque mcmliii 53 liii 1953} test clock-2.638 {conversion of 1953-07-31} { clock format -518181904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1953 12:34:56 die xxxi mensis vii annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2434590 07 vii 7 07/31/1953 die xxxi mensis vii annoque mcmliii 53 liii 1953} test clock-2.639 {conversion of 1953-08-01} { clock format -518095504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1953 12:34:56 die i mensis viii annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2434591 08 viii 8 08/01/1953 die i mensis viii annoque mcmliii 53 liii 1953} test clock-2.640 {conversion of 1953-08-31} { clock format -515503504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1953 12:34:56 die xxxi mensis viii annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2434621 08 viii 8 08/31/1953 die xxxi mensis viii annoque mcmliii 53 liii 1953} test clock-2.641 {conversion of 1953-09-01} { clock format -515417104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1953 12:34:56 die i mensis ix annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2434622 09 ix 9 09/01/1953 die i mensis ix annoque mcmliii 53 liii 1953} test clock-2.642 {conversion of 1953-09-30} { clock format -512911504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1953 12:34:56 die xxx mensis ix annoque mcmliii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2434651 09 ix 9 09/30/1953 die xxx mensis ix annoque mcmliii 53 liii 1953} test clock-2.643 {conversion of 1953-10-01} { clock format -512825104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1953 12:34:56 die i mensis x annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2434652 10 x 10 10/01/1953 die i mensis x annoque mcmliii 53 liii 1953} test clock-2.644 {conversion of 1953-10-31} { clock format -510233104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1953 12:34:56 die xxxi mensis x annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2434682 10 x 10 10/31/1953 die xxxi mensis x annoque mcmliii 53 liii 1953} test clock-2.645 {conversion of 1953-11-01} { clock format -510146704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1953 12:34:56 die i mensis xi annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2434683 11 xi 11 11/01/1953 die i mensis xi annoque mcmliii 53 liii 1953} test clock-2.646 {conversion of 1953-11-30} { clock format -507641104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1953 12:34:56 die xxx mensis xi annoque mcmliii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2434712 11 xi 11 11/30/1953 die xxx mensis xi annoque mcmliii 53 liii 1953} test clock-2.647 {conversion of 1953-12-01} { clock format -507554704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1953 12:34:56 die i mensis xii annoque mcmliii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2434713 12 xii 12 12/01/1953 die i mensis xii annoque mcmliii 53 liii 1953} test clock-2.648 {conversion of 1953-12-31} { clock format -504962704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1953 12:34:56 die xxxi mensis xii annoque mcmliii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2434743 12 xii 12 12/31/1953 die xxxi mensis xii annoque mcmliii 53 liii 1953} test clock-2.649 {conversion of 1956-01-01} { clock format -441804304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1956 12:34:56 die i mensis i annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2435474 01 i 1 01/01/1956 die i mensis i annoque mcmlvi 56 lvi 1956} test clock-2.650 {conversion of 1956-01-31} { clock format -439212304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1956 12:34:56 die xxxi mensis i annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2435504 01 i 1 01/31/1956 die xxxi mensis i annoque mcmlvi 56 lvi 1956} test clock-2.651 {conversion of 1956-02-01} { clock format -439125904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1956 12:34:56 die i mensis ii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2435505 02 ii 2 02/01/1956 die i mensis ii annoque mcmlvi 56 lvi 1956} test clock-2.652 {conversion of 1956-02-29} { clock format -436706704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1956 12:34:56 die xxix mensis ii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2435533 02 ii 2 02/29/1956 die xxix mensis ii annoque mcmlvi 56 lvi 1956} test clock-2.653 {conversion of 1956-03-01} { clock format -436620304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1956 12:34:56 die i mensis iii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2435534 03 iii 3 03/01/1956 die i mensis iii annoque mcmlvi 56 lvi 1956} test clock-2.654 {conversion of 1956-03-31} { clock format -434028304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1956 12:34:56 die xxxi mensis iii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2435564 03 iii 3 03/31/1956 die xxxi mensis iii annoque mcmlvi 56 lvi 1956} test clock-2.655 {conversion of 1956-04-01} { clock format -433941904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1956 12:34:56 die i mensis iv annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2435565 04 iv 4 04/01/1956 die i mensis iv annoque mcmlvi 56 lvi 1956} test clock-2.656 {conversion of 1956-04-30} { clock format -431436304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1956 12:34:56 die xxx mensis iv annoque mcmlvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2435594 04 iv 4 04/30/1956 die xxx mensis iv annoque mcmlvi 56 lvi 1956} test clock-2.657 {conversion of 1956-05-01} { clock format -431349904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1956 12:34:56 die i mensis v annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2435595 05 v 5 05/01/1956 die i mensis v annoque mcmlvi 56 lvi 1956} test clock-2.658 {conversion of 1956-05-31} { clock format -428757904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1956 12:34:56 die xxxi mensis v annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2435625 05 v 5 05/31/1956 die xxxi mensis v annoque mcmlvi 56 lvi 1956} test clock-2.659 {conversion of 1956-06-01} { clock format -428671504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1956 12:34:56 die i mensis vi annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2435626 06 vi 6 06/01/1956 die i mensis vi annoque mcmlvi 56 lvi 1956} test clock-2.660 {conversion of 1956-06-30} { clock format -426165904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1956 12:34:56 die xxx mensis vi annoque mcmlvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2435655 06 vi 6 06/30/1956 die xxx mensis vi annoque mcmlvi 56 lvi 1956} test clock-2.661 {conversion of 1956-07-01} { clock format -426079504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1956 12:34:56 die i mensis vii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2435656 07 vii 7 07/01/1956 die i mensis vii annoque mcmlvi 56 lvi 1956} test clock-2.662 {conversion of 1956-07-31} { clock format -423487504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1956 12:34:56 die xxxi mensis vii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2435686 07 vii 7 07/31/1956 die xxxi mensis vii annoque mcmlvi 56 lvi 1956} test clock-2.663 {conversion of 1956-08-01} { clock format -423401104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1956 12:34:56 die i mensis viii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2435687 08 viii 8 08/01/1956 die i mensis viii annoque mcmlvi 56 lvi 1956} test clock-2.664 {conversion of 1956-08-31} { clock format -420809104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1956 12:34:56 die xxxi mensis viii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2435717 08 viii 8 08/31/1956 die xxxi mensis viii annoque mcmlvi 56 lvi 1956} test clock-2.665 {conversion of 1956-09-01} { clock format -420722704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1956 12:34:56 die i mensis ix annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2435718 09 ix 9 09/01/1956 die i mensis ix annoque mcmlvi 56 lvi 1956} test clock-2.666 {conversion of 1956-09-30} { clock format -418217104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1956 12:34:56 die xxx mensis ix annoque mcmlvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2435747 09 ix 9 09/30/1956 die xxx mensis ix annoque mcmlvi 56 lvi 1956} test clock-2.667 {conversion of 1956-10-01} { clock format -418130704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1956 12:34:56 die i mensis x annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2435748 10 x 10 10/01/1956 die i mensis x annoque mcmlvi 56 lvi 1956} test clock-2.668 {conversion of 1956-10-31} { clock format -415538704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1956 12:34:56 die xxxi mensis x annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2435778 10 x 10 10/31/1956 die xxxi mensis x annoque mcmlvi 56 lvi 1956} test clock-2.669 {conversion of 1956-11-01} { clock format -415452304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1956 12:34:56 die i mensis xi annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2435779 11 xi 11 11/01/1956 die i mensis xi annoque mcmlvi 56 lvi 1956} test clock-2.670 {conversion of 1956-11-30} { clock format -412946704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1956 12:34:56 die xxx mensis xi annoque mcmlvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2435808 11 xi 11 11/30/1956 die xxx mensis xi annoque mcmlvi 56 lvi 1956} test clock-2.671 {conversion of 1956-12-01} { clock format -412860304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1956 12:34:56 die i mensis xii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2435809 12 xii 12 12/01/1956 die i mensis xii annoque mcmlvi 56 lvi 1956} test clock-2.672 {conversion of 1956-12-31} { clock format -410268304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1956 12:34:56 die xxxi mensis xii annoque mcmlvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2435839 12 xii 12 12/31/1956 die xxxi mensis xii annoque mcmlvi 56 lvi 1956} test clock-2.673 {conversion of 1957-01-01} { clock format -410181904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1957 12:34:56 die i mensis i annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2435840 01 i 1 01/01/1957 die i mensis i annoque mcmlvii 57 lvii 1957} test clock-2.674 {conversion of 1957-01-31} { clock format -407589904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1957 12:34:56 die xxxi mensis i annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2435870 01 i 1 01/31/1957 die xxxi mensis i annoque mcmlvii 57 lvii 1957} test clock-2.675 {conversion of 1957-02-01} { clock format -407503504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1957 12:34:56 die i mensis ii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2435871 02 ii 2 02/01/1957 die i mensis ii annoque mcmlvii 57 lvii 1957} test clock-2.676 {conversion of 1957-02-28} { clock format -405170704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1957 12:34:56 die xxviii mensis ii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2435898 02 ii 2 02/28/1957 die xxviii mensis ii annoque mcmlvii 57 lvii 1957} test clock-2.677 {conversion of 1957-03-01} { clock format -405084304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1957 12:34:56 die i mensis iii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2435899 03 iii 3 03/01/1957 die i mensis iii annoque mcmlvii 57 lvii 1957} test clock-2.678 {conversion of 1957-03-31} { clock format -402492304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1957 12:34:56 die xxxi mensis iii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2435929 03 iii 3 03/31/1957 die xxxi mensis iii annoque mcmlvii 57 lvii 1957} test clock-2.679 {conversion of 1957-04-01} { clock format -402405904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1957 12:34:56 die i mensis iv annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2435930 04 iv 4 04/01/1957 die i mensis iv annoque mcmlvii 57 lvii 1957} test clock-2.680 {conversion of 1957-04-30} { clock format -399900304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1957 12:34:56 die xxx mensis iv annoque mcmlvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2435959 04 iv 4 04/30/1957 die xxx mensis iv annoque mcmlvii 57 lvii 1957} test clock-2.681 {conversion of 1957-05-01} { clock format -399813904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1957 12:34:56 die i mensis v annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2435960 05 v 5 05/01/1957 die i mensis v annoque mcmlvii 57 lvii 1957} test clock-2.682 {conversion of 1957-05-31} { clock format -397221904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1957 12:34:56 die xxxi mensis v annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2435990 05 v 5 05/31/1957 die xxxi mensis v annoque mcmlvii 57 lvii 1957} test clock-2.683 {conversion of 1957-06-01} { clock format -397135504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1957 12:34:56 die i mensis vi annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2435991 06 vi 6 06/01/1957 die i mensis vi annoque mcmlvii 57 lvii 1957} test clock-2.684 {conversion of 1957-06-30} { clock format -394629904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1957 12:34:56 die xxx mensis vi annoque mcmlvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2436020 06 vi 6 06/30/1957 die xxx mensis vi annoque mcmlvii 57 lvii 1957} test clock-2.685 {conversion of 1957-07-01} { clock format -394543504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1957 12:34:56 die i mensis vii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2436021 07 vii 7 07/01/1957 die i mensis vii annoque mcmlvii 57 lvii 1957} test clock-2.686 {conversion of 1957-07-31} { clock format -391951504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1957 12:34:56 die xxxi mensis vii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2436051 07 vii 7 07/31/1957 die xxxi mensis vii annoque mcmlvii 57 lvii 1957} test clock-2.687 {conversion of 1957-08-01} { clock format -391865104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1957 12:34:56 die i mensis viii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2436052 08 viii 8 08/01/1957 die i mensis viii annoque mcmlvii 57 lvii 1957} test clock-2.688 {conversion of 1957-08-31} { clock format -389273104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1957 12:34:56 die xxxi mensis viii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2436082 08 viii 8 08/31/1957 die xxxi mensis viii annoque mcmlvii 57 lvii 1957} test clock-2.689 {conversion of 1957-09-01} { clock format -389186704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1957 12:34:56 die i mensis ix annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2436083 09 ix 9 09/01/1957 die i mensis ix annoque mcmlvii 57 lvii 1957} test clock-2.690 {conversion of 1957-09-30} { clock format -386681104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1957 12:34:56 die xxx mensis ix annoque mcmlvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2436112 09 ix 9 09/30/1957 die xxx mensis ix annoque mcmlvii 57 lvii 1957} test clock-2.691 {conversion of 1957-10-01} { clock format -386594704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1957 12:34:56 die i mensis x annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2436113 10 x 10 10/01/1957 die i mensis x annoque mcmlvii 57 lvii 1957} test clock-2.692 {conversion of 1957-10-31} { clock format -384002704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1957 12:34:56 die xxxi mensis x annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2436143 10 x 10 10/31/1957 die xxxi mensis x annoque mcmlvii 57 lvii 1957} test clock-2.693 {conversion of 1957-11-01} { clock format -383916304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1957 12:34:56 die i mensis xi annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2436144 11 xi 11 11/01/1957 die i mensis xi annoque mcmlvii 57 lvii 1957} test clock-2.694 {conversion of 1957-11-30} { clock format -381410704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1957 12:34:56 die xxx mensis xi annoque mcmlvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2436173 11 xi 11 11/30/1957 die xxx mensis xi annoque mcmlvii 57 lvii 1957} test clock-2.695 {conversion of 1957-12-01} { clock format -381324304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1957 12:34:56 die i mensis xii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2436174 12 xii 12 12/01/1957 die i mensis xii annoque mcmlvii 57 lvii 1957} test clock-2.696 {conversion of 1957-12-31} { clock format -378732304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1957 12:34:56 die xxxi mensis xii annoque mcmlvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2436204 12 xii 12 12/31/1957 die xxxi mensis xii annoque mcmlvii 57 lvii 1957} test clock-2.697 {conversion of 1959-01-01} { clock format -347109904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1959 12:34:56 die i mensis i annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2436570 01 i 1 01/01/1959 die i mensis i annoque mcmlix 59 lix 1959} test clock-2.698 {conversion of 1959-01-31} { clock format -344517904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1959 12:34:56 die xxxi mensis i annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2436600 01 i 1 01/31/1959 die xxxi mensis i annoque mcmlix 59 lix 1959} test clock-2.699 {conversion of 1959-02-01} { clock format -344431504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1959 12:34:56 die i mensis ii annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2436601 02 ii 2 02/01/1959 die i mensis ii annoque mcmlix 59 lix 1959} test clock-2.700 {conversion of 1959-02-28} { clock format -342098704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1959 12:34:56 die xxviii mensis ii annoque mcmlix xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2436628 02 ii 2 02/28/1959 die xxviii mensis ii annoque mcmlix 59 lix 1959} test clock-2.701 {conversion of 1959-03-01} { clock format -342012304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1959 12:34:56 die i mensis iii annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2436629 03 iii 3 03/01/1959 die i mensis iii annoque mcmlix 59 lix 1959} test clock-2.702 {conversion of 1959-03-31} { clock format -339420304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1959 12:34:56 die xxxi mensis iii annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2436659 03 iii 3 03/31/1959 die xxxi mensis iii annoque mcmlix 59 lix 1959} test clock-2.703 {conversion of 1959-04-01} { clock format -339333904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1959 12:34:56 die i mensis iv annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2436660 04 iv 4 04/01/1959 die i mensis iv annoque mcmlix 59 lix 1959} test clock-2.704 {conversion of 1959-04-30} { clock format -336828304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1959 12:34:56 die xxx mensis iv annoque mcmlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2436689 04 iv 4 04/30/1959 die xxx mensis iv annoque mcmlix 59 lix 1959} test clock-2.705 {conversion of 1959-05-01} { clock format -336741904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1959 12:34:56 die i mensis v annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2436690 05 v 5 05/01/1959 die i mensis v annoque mcmlix 59 lix 1959} test clock-2.706 {conversion of 1959-05-31} { clock format -334149904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1959 12:34:56 die xxxi mensis v annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2436720 05 v 5 05/31/1959 die xxxi mensis v annoque mcmlix 59 lix 1959} test clock-2.707 {conversion of 1959-06-01} { clock format -334063504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1959 12:34:56 die i mensis vi annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2436721 06 vi 6 06/01/1959 die i mensis vi annoque mcmlix 59 lix 1959} test clock-2.708 {conversion of 1959-06-30} { clock format -331557904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1959 12:34:56 die xxx mensis vi annoque mcmlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2436750 06 vi 6 06/30/1959 die xxx mensis vi annoque mcmlix 59 lix 1959} test clock-2.709 {conversion of 1959-07-01} { clock format -331471504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1959 12:34:56 die i mensis vii annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2436751 07 vii 7 07/01/1959 die i mensis vii annoque mcmlix 59 lix 1959} test clock-2.710 {conversion of 1959-07-31} { clock format -328879504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1959 12:34:56 die xxxi mensis vii annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2436781 07 vii 7 07/31/1959 die xxxi mensis vii annoque mcmlix 59 lix 1959} test clock-2.711 {conversion of 1959-08-01} { clock format -328793104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1959 12:34:56 die i mensis viii annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2436782 08 viii 8 08/01/1959 die i mensis viii annoque mcmlix 59 lix 1959} test clock-2.712 {conversion of 1959-08-31} { clock format -326201104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1959 12:34:56 die xxxi mensis viii annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2436812 08 viii 8 08/31/1959 die xxxi mensis viii annoque mcmlix 59 lix 1959} test clock-2.713 {conversion of 1959-09-01} { clock format -326114704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1959 12:34:56 die i mensis ix annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2436813 09 ix 9 09/01/1959 die i mensis ix annoque mcmlix 59 lix 1959} test clock-2.714 {conversion of 1959-09-30} { clock format -323609104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1959 12:34:56 die xxx mensis ix annoque mcmlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2436842 09 ix 9 09/30/1959 die xxx mensis ix annoque mcmlix 59 lix 1959} test clock-2.715 {conversion of 1959-10-01} { clock format -323522704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1959 12:34:56 die i mensis x annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2436843 10 x 10 10/01/1959 die i mensis x annoque mcmlix 59 lix 1959} test clock-2.716 {conversion of 1959-10-31} { clock format -320930704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1959 12:34:56 die xxxi mensis x annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2436873 10 x 10 10/31/1959 die xxxi mensis x annoque mcmlix 59 lix 1959} test clock-2.717 {conversion of 1959-11-01} { clock format -320844304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1959 12:34:56 die i mensis xi annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2436874 11 xi 11 11/01/1959 die i mensis xi annoque mcmlix 59 lix 1959} test clock-2.718 {conversion of 1959-11-30} { clock format -318338704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1959 12:34:56 die xxx mensis xi annoque mcmlix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2436903 11 xi 11 11/30/1959 die xxx mensis xi annoque mcmlix 59 lix 1959} test clock-2.719 {conversion of 1959-12-01} { clock format -318252304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1959 12:34:56 die i mensis xii annoque mcmlix xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2436904 12 xii 12 12/01/1959 die i mensis xii annoque mcmlix 59 lix 1959} test clock-2.720 {conversion of 1959-12-31} { clock format -315660304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1959 12:34:56 die xxxi mensis xii annoque mcmlix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2436934 12 xii 12 12/31/1959 die xxxi mensis xii annoque mcmlix 59 lix 1959} test clock-2.721 {conversion of 1960-01-01} { clock format -315573904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1960 12:34:56 die i mensis i annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2436935 01 i 1 01/01/1960 die i mensis i annoque mcmlx 60 lx 1960} test clock-2.722 {conversion of 1960-01-31} { clock format -312981904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1960 12:34:56 die xxxi mensis i annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2436965 01 i 1 01/31/1960 die xxxi mensis i annoque mcmlx 60 lx 1960} test clock-2.723 {conversion of 1960-02-01} { clock format -312895504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1960 12:34:56 die i mensis ii annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2436966 02 ii 2 02/01/1960 die i mensis ii annoque mcmlx 60 lx 1960} test clock-2.724 {conversion of 1960-02-29} { clock format -310476304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1960 12:34:56 die xxix mensis ii annoque mcmlx xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2436994 02 ii 2 02/29/1960 die xxix mensis ii annoque mcmlx 60 lx 1960} test clock-2.725 {conversion of 1960-03-01} { clock format -310389904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1960 12:34:56 die i mensis iii annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2436995 03 iii 3 03/01/1960 die i mensis iii annoque mcmlx 60 lx 1960} test clock-2.726 {conversion of 1960-03-31} { clock format -307797904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1960 12:34:56 die xxxi mensis iii annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2437025 03 iii 3 03/31/1960 die xxxi mensis iii annoque mcmlx 60 lx 1960} test clock-2.727 {conversion of 1960-04-01} { clock format -307711504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1960 12:34:56 die i mensis iv annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2437026 04 iv 4 04/01/1960 die i mensis iv annoque mcmlx 60 lx 1960} test clock-2.728 {conversion of 1960-04-30} { clock format -305205904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1960 12:34:56 die xxx mensis iv annoque mcmlx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2437055 04 iv 4 04/30/1960 die xxx mensis iv annoque mcmlx 60 lx 1960} test clock-2.729 {conversion of 1960-05-01} { clock format -305119504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1960 12:34:56 die i mensis v annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2437056 05 v 5 05/01/1960 die i mensis v annoque mcmlx 60 lx 1960} test clock-2.730 {conversion of 1960-05-31} { clock format -302527504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1960 12:34:56 die xxxi mensis v annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2437086 05 v 5 05/31/1960 die xxxi mensis v annoque mcmlx 60 lx 1960} test clock-2.731 {conversion of 1960-06-01} { clock format -302441104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1960 12:34:56 die i mensis vi annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2437087 06 vi 6 06/01/1960 die i mensis vi annoque mcmlx 60 lx 1960} test clock-2.732 {conversion of 1960-06-30} { clock format -299935504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1960 12:34:56 die xxx mensis vi annoque mcmlx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2437116 06 vi 6 06/30/1960 die xxx mensis vi annoque mcmlx 60 lx 1960} test clock-2.733 {conversion of 1960-07-01} { clock format -299849104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1960 12:34:56 die i mensis vii annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2437117 07 vii 7 07/01/1960 die i mensis vii annoque mcmlx 60 lx 1960} test clock-2.734 {conversion of 1960-07-31} { clock format -297257104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1960 12:34:56 die xxxi mensis vii annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2437147 07 vii 7 07/31/1960 die xxxi mensis vii annoque mcmlx 60 lx 1960} test clock-2.735 {conversion of 1960-08-01} { clock format -297170704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1960 12:34:56 die i mensis viii annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2437148 08 viii 8 08/01/1960 die i mensis viii annoque mcmlx 60 lx 1960} test clock-2.736 {conversion of 1960-08-31} { clock format -294578704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1960 12:34:56 die xxxi mensis viii annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2437178 08 viii 8 08/31/1960 die xxxi mensis viii annoque mcmlx 60 lx 1960} test clock-2.737 {conversion of 1960-09-01} { clock format -294492304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1960 12:34:56 die i mensis ix annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2437179 09 ix 9 09/01/1960 die i mensis ix annoque mcmlx 60 lx 1960} test clock-2.738 {conversion of 1960-09-30} { clock format -291986704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1960 12:34:56 die xxx mensis ix annoque mcmlx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2437208 09 ix 9 09/30/1960 die xxx mensis ix annoque mcmlx 60 lx 1960} test clock-2.739 {conversion of 1960-10-01} { clock format -291900304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1960 12:34:56 die i mensis x annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2437209 10 x 10 10/01/1960 die i mensis x annoque mcmlx 60 lx 1960} test clock-2.740 {conversion of 1960-10-31} { clock format -289308304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1960 12:34:56 die xxxi mensis x annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2437239 10 x 10 10/31/1960 die xxxi mensis x annoque mcmlx 60 lx 1960} test clock-2.741 {conversion of 1960-11-01} { clock format -289221904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1960 12:34:56 die i mensis xi annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2437240 11 xi 11 11/01/1960 die i mensis xi annoque mcmlx 60 lx 1960} test clock-2.742 {conversion of 1960-11-30} { clock format -286716304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1960 12:34:56 die xxx mensis xi annoque mcmlx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2437269 11 xi 11 11/30/1960 die xxx mensis xi annoque mcmlx 60 lx 1960} test clock-2.743 {conversion of 1960-12-01} { clock format -286629904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1960 12:34:56 die i mensis xii annoque mcmlx xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2437270 12 xii 12 12/01/1960 die i mensis xii annoque mcmlx 60 lx 1960} test clock-2.744 {conversion of 1960-12-31} { clock format -284037904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1960 12:34:56 die xxxi mensis xii annoque mcmlx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2437300 12 xii 12 12/31/1960 die xxxi mensis xii annoque mcmlx 60 lx 1960} test clock-2.745 {conversion of 1961-01-01} { clock format -283951504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1961 12:34:56 die i mensis i annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2437301 01 i 1 01/01/1961 die i mensis i annoque mcmlxi 61 lxi 1961} test clock-2.746 {conversion of 1961-01-31} { clock format -281359504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1961 12:34:56 die xxxi mensis i annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2437331 01 i 1 01/31/1961 die xxxi mensis i annoque mcmlxi 61 lxi 1961} test clock-2.747 {conversion of 1961-02-01} { clock format -281273104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1961 12:34:56 die i mensis ii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2437332 02 ii 2 02/01/1961 die i mensis ii annoque mcmlxi 61 lxi 1961} test clock-2.748 {conversion of 1961-02-28} { clock format -278940304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1961 12:34:56 die xxviii mensis ii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2437359 02 ii 2 02/28/1961 die xxviii mensis ii annoque mcmlxi 61 lxi 1961} test clock-2.749 {conversion of 1961-03-01} { clock format -278853904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1961 12:34:56 die i mensis iii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2437360 03 iii 3 03/01/1961 die i mensis iii annoque mcmlxi 61 lxi 1961} test clock-2.750 {conversion of 1961-03-31} { clock format -276261904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1961 12:34:56 die xxxi mensis iii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2437390 03 iii 3 03/31/1961 die xxxi mensis iii annoque mcmlxi 61 lxi 1961} test clock-2.751 {conversion of 1961-04-01} { clock format -276175504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1961 12:34:56 die i mensis iv annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2437391 04 iv 4 04/01/1961 die i mensis iv annoque mcmlxi 61 lxi 1961} test clock-2.752 {conversion of 1961-04-30} { clock format -273669904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1961 12:34:56 die xxx mensis iv annoque mcmlxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2437420 04 iv 4 04/30/1961 die xxx mensis iv annoque mcmlxi 61 lxi 1961} test clock-2.753 {conversion of 1961-05-01} { clock format -273583504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1961 12:34:56 die i mensis v annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2437421 05 v 5 05/01/1961 die i mensis v annoque mcmlxi 61 lxi 1961} test clock-2.754 {conversion of 1961-05-31} { clock format -270991504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1961 12:34:56 die xxxi mensis v annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2437451 05 v 5 05/31/1961 die xxxi mensis v annoque mcmlxi 61 lxi 1961} test clock-2.755 {conversion of 1961-06-01} { clock format -270905104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1961 12:34:56 die i mensis vi annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2437452 06 vi 6 06/01/1961 die i mensis vi annoque mcmlxi 61 lxi 1961} test clock-2.756 {conversion of 1961-06-30} { clock format -268399504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1961 12:34:56 die xxx mensis vi annoque mcmlxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2437481 06 vi 6 06/30/1961 die xxx mensis vi annoque mcmlxi 61 lxi 1961} test clock-2.757 {conversion of 1961-07-01} { clock format -268313104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1961 12:34:56 die i mensis vii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2437482 07 vii 7 07/01/1961 die i mensis vii annoque mcmlxi 61 lxi 1961} test clock-2.758 {conversion of 1961-07-31} { clock format -265721104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1961 12:34:56 die xxxi mensis vii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2437512 07 vii 7 07/31/1961 die xxxi mensis vii annoque mcmlxi 61 lxi 1961} test clock-2.759 {conversion of 1961-08-01} { clock format -265634704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1961 12:34:56 die i mensis viii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2437513 08 viii 8 08/01/1961 die i mensis viii annoque mcmlxi 61 lxi 1961} test clock-2.760 {conversion of 1961-08-31} { clock format -263042704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1961 12:34:56 die xxxi mensis viii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2437543 08 viii 8 08/31/1961 die xxxi mensis viii annoque mcmlxi 61 lxi 1961} test clock-2.761 {conversion of 1961-09-01} { clock format -262956304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1961 12:34:56 die i mensis ix annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2437544 09 ix 9 09/01/1961 die i mensis ix annoque mcmlxi 61 lxi 1961} test clock-2.762 {conversion of 1961-09-30} { clock format -260450704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1961 12:34:56 die xxx mensis ix annoque mcmlxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2437573 09 ix 9 09/30/1961 die xxx mensis ix annoque mcmlxi 61 lxi 1961} test clock-2.763 {conversion of 1961-10-01} { clock format -260364304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1961 12:34:56 die i mensis x annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2437574 10 x 10 10/01/1961 die i mensis x annoque mcmlxi 61 lxi 1961} test clock-2.764 {conversion of 1961-10-31} { clock format -257772304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1961 12:34:56 die xxxi mensis x annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2437604 10 x 10 10/31/1961 die xxxi mensis x annoque mcmlxi 61 lxi 1961} test clock-2.765 {conversion of 1961-11-01} { clock format -257685904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1961 12:34:56 die i mensis xi annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2437605 11 xi 11 11/01/1961 die i mensis xi annoque mcmlxi 61 lxi 1961} test clock-2.766 {conversion of 1961-11-30} { clock format -255180304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1961 12:34:56 die xxx mensis xi annoque mcmlxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2437634 11 xi 11 11/30/1961 die xxx mensis xi annoque mcmlxi 61 lxi 1961} test clock-2.767 {conversion of 1961-12-01} { clock format -255093904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1961 12:34:56 die i mensis xii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2437635 12 xii 12 12/01/1961 die i mensis xii annoque mcmlxi 61 lxi 1961} test clock-2.768 {conversion of 1961-12-31} { clock format -252501904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1961 12:34:56 die xxxi mensis xii annoque mcmlxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2437665 12 xii 12 12/31/1961 die xxxi mensis xii annoque mcmlxi 61 lxi 1961} test clock-2.769 {conversion of 1962-01-01} { clock format -252415504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1962 12:34:56 die i mensis i annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2437666 01 i 1 01/01/1962 die i mensis i annoque mcmlxii 62 lxii 1962} test clock-2.770 {conversion of 1962-01-31} { clock format -249823504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1962 12:34:56 die xxxi mensis i annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2437696 01 i 1 01/31/1962 die xxxi mensis i annoque mcmlxii 62 lxii 1962} test clock-2.771 {conversion of 1962-02-01} { clock format -249737104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1962 12:34:56 die i mensis ii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2437697 02 ii 2 02/01/1962 die i mensis ii annoque mcmlxii 62 lxii 1962} test clock-2.772 {conversion of 1962-02-28} { clock format -247404304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1962 12:34:56 die xxviii mensis ii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2437724 02 ii 2 02/28/1962 die xxviii mensis ii annoque mcmlxii 62 lxii 1962} test clock-2.773 {conversion of 1962-03-01} { clock format -247317904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1962 12:34:56 die i mensis iii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2437725 03 iii 3 03/01/1962 die i mensis iii annoque mcmlxii 62 lxii 1962} test clock-2.774 {conversion of 1962-03-31} { clock format -244725904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1962 12:34:56 die xxxi mensis iii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2437755 03 iii 3 03/31/1962 die xxxi mensis iii annoque mcmlxii 62 lxii 1962} test clock-2.775 {conversion of 1962-04-01} { clock format -244639504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1962 12:34:56 die i mensis iv annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2437756 04 iv 4 04/01/1962 die i mensis iv annoque mcmlxii 62 lxii 1962} test clock-2.776 {conversion of 1962-04-30} { clock format -242133904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1962 12:34:56 die xxx mensis iv annoque mcmlxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2437785 04 iv 4 04/30/1962 die xxx mensis iv annoque mcmlxii 62 lxii 1962} test clock-2.777 {conversion of 1962-05-01} { clock format -242047504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1962 12:34:56 die i mensis v annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2437786 05 v 5 05/01/1962 die i mensis v annoque mcmlxii 62 lxii 1962} test clock-2.778 {conversion of 1962-05-31} { clock format -239455504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1962 12:34:56 die xxxi mensis v annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2437816 05 v 5 05/31/1962 die xxxi mensis v annoque mcmlxii 62 lxii 1962} test clock-2.779 {conversion of 1962-06-01} { clock format -239369104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1962 12:34:56 die i mensis vi annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2437817 06 vi 6 06/01/1962 die i mensis vi annoque mcmlxii 62 lxii 1962} test clock-2.780 {conversion of 1962-06-30} { clock format -236863504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1962 12:34:56 die xxx mensis vi annoque mcmlxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2437846 06 vi 6 06/30/1962 die xxx mensis vi annoque mcmlxii 62 lxii 1962} test clock-2.781 {conversion of 1962-07-01} { clock format -236777104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1962 12:34:56 die i mensis vii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2437847 07 vii 7 07/01/1962 die i mensis vii annoque mcmlxii 62 lxii 1962} test clock-2.782 {conversion of 1962-07-31} { clock format -234185104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1962 12:34:56 die xxxi mensis vii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2437877 07 vii 7 07/31/1962 die xxxi mensis vii annoque mcmlxii 62 lxii 1962} test clock-2.783 {conversion of 1962-08-01} { clock format -234098704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1962 12:34:56 die i mensis viii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2437878 08 viii 8 08/01/1962 die i mensis viii annoque mcmlxii 62 lxii 1962} test clock-2.784 {conversion of 1962-08-31} { clock format -231506704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1962 12:34:56 die xxxi mensis viii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2437908 08 viii 8 08/31/1962 die xxxi mensis viii annoque mcmlxii 62 lxii 1962} test clock-2.785 {conversion of 1962-09-01} { clock format -231420304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1962 12:34:56 die i mensis ix annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2437909 09 ix 9 09/01/1962 die i mensis ix annoque mcmlxii 62 lxii 1962} test clock-2.786 {conversion of 1962-09-30} { clock format -228914704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1962 12:34:56 die xxx mensis ix annoque mcmlxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2437938 09 ix 9 09/30/1962 die xxx mensis ix annoque mcmlxii 62 lxii 1962} test clock-2.787 {conversion of 1962-10-01} { clock format -228828304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1962 12:34:56 die i mensis x annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2437939 10 x 10 10/01/1962 die i mensis x annoque mcmlxii 62 lxii 1962} test clock-2.788 {conversion of 1962-10-31} { clock format -226236304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1962 12:34:56 die xxxi mensis x annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2437969 10 x 10 10/31/1962 die xxxi mensis x annoque mcmlxii 62 lxii 1962} test clock-2.789 {conversion of 1962-11-01} { clock format -226149904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1962 12:34:56 die i mensis xi annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2437970 11 xi 11 11/01/1962 die i mensis xi annoque mcmlxii 62 lxii 1962} test clock-2.790 {conversion of 1962-11-30} { clock format -223644304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1962 12:34:56 die xxx mensis xi annoque mcmlxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2437999 11 xi 11 11/30/1962 die xxx mensis xi annoque mcmlxii 62 lxii 1962} test clock-2.791 {conversion of 1962-12-01} { clock format -223557904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1962 12:34:56 die i mensis xii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2438000 12 xii 12 12/01/1962 die i mensis xii annoque mcmlxii 62 lxii 1962} test clock-2.792 {conversion of 1962-12-31} { clock format -220965904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1962 12:34:56 die xxxi mensis xii annoque mcmlxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2438030 12 xii 12 12/31/1962 die xxxi mensis xii annoque mcmlxii 62 lxii 1962} test clock-2.793 {conversion of 1963-01-01} { clock format -220879504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1963 12:34:56 die i mensis i annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2438031 01 i 1 01/01/1963 die i mensis i annoque mcmlxiii 63 lxiii 1963} test clock-2.794 {conversion of 1963-01-31} { clock format -218287504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1963 12:34:56 die xxxi mensis i annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2438061 01 i 1 01/31/1963 die xxxi mensis i annoque mcmlxiii 63 lxiii 1963} test clock-2.795 {conversion of 1963-02-01} { clock format -218201104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1963 12:34:56 die i mensis ii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2438062 02 ii 2 02/01/1963 die i mensis ii annoque mcmlxiii 63 lxiii 1963} test clock-2.796 {conversion of 1963-02-28} { clock format -215868304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1963 12:34:56 die xxviii mensis ii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2438089 02 ii 2 02/28/1963 die xxviii mensis ii annoque mcmlxiii 63 lxiii 1963} test clock-2.797 {conversion of 1963-03-01} { clock format -215781904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1963 12:34:56 die i mensis iii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2438090 03 iii 3 03/01/1963 die i mensis iii annoque mcmlxiii 63 lxiii 1963} test clock-2.798 {conversion of 1963-03-31} { clock format -213189904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1963 12:34:56 die xxxi mensis iii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2438120 03 iii 3 03/31/1963 die xxxi mensis iii annoque mcmlxiii 63 lxiii 1963} test clock-2.799 {conversion of 1963-04-01} { clock format -213103504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1963 12:34:56 die i mensis iv annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2438121 04 iv 4 04/01/1963 die i mensis iv annoque mcmlxiii 63 lxiii 1963} test clock-2.800 {conversion of 1963-04-30} { clock format -210597904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1963 12:34:56 die xxx mensis iv annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2438150 04 iv 4 04/30/1963 die xxx mensis iv annoque mcmlxiii 63 lxiii 1963} test clock-2.801 {conversion of 1963-05-01} { clock format -210511504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1963 12:34:56 die i mensis v annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2438151 05 v 5 05/01/1963 die i mensis v annoque mcmlxiii 63 lxiii 1963} test clock-2.802 {conversion of 1963-05-31} { clock format -207919504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1963 12:34:56 die xxxi mensis v annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2438181 05 v 5 05/31/1963 die xxxi mensis v annoque mcmlxiii 63 lxiii 1963} test clock-2.803 {conversion of 1963-06-01} { clock format -207833104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1963 12:34:56 die i mensis vi annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2438182 06 vi 6 06/01/1963 die i mensis vi annoque mcmlxiii 63 lxiii 1963} test clock-2.804 {conversion of 1963-06-30} { clock format -205327504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1963 12:34:56 die xxx mensis vi annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2438211 06 vi 6 06/30/1963 die xxx mensis vi annoque mcmlxiii 63 lxiii 1963} test clock-2.805 {conversion of 1963-07-01} { clock format -205241104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1963 12:34:56 die i mensis vii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2438212 07 vii 7 07/01/1963 die i mensis vii annoque mcmlxiii 63 lxiii 1963} test clock-2.806 {conversion of 1963-07-31} { clock format -202649104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1963 12:34:56 die xxxi mensis vii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2438242 07 vii 7 07/31/1963 die xxxi mensis vii annoque mcmlxiii 63 lxiii 1963} test clock-2.807 {conversion of 1963-08-01} { clock format -202562704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1963 12:34:56 die i mensis viii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2438243 08 viii 8 08/01/1963 die i mensis viii annoque mcmlxiii 63 lxiii 1963} test clock-2.808 {conversion of 1963-08-31} { clock format -199970704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1963 12:34:56 die xxxi mensis viii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2438273 08 viii 8 08/31/1963 die xxxi mensis viii annoque mcmlxiii 63 lxiii 1963} test clock-2.809 {conversion of 1963-09-01} { clock format -199884304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1963 12:34:56 die i mensis ix annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2438274 09 ix 9 09/01/1963 die i mensis ix annoque mcmlxiii 63 lxiii 1963} test clock-2.810 {conversion of 1963-09-30} { clock format -197378704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1963 12:34:56 die xxx mensis ix annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2438303 09 ix 9 09/30/1963 die xxx mensis ix annoque mcmlxiii 63 lxiii 1963} test clock-2.811 {conversion of 1963-10-01} { clock format -197292304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1963 12:34:56 die i mensis x annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2438304 10 x 10 10/01/1963 die i mensis x annoque mcmlxiii 63 lxiii 1963} test clock-2.812 {conversion of 1963-10-31} { clock format -194700304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1963 12:34:56 die xxxi mensis x annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2438334 10 x 10 10/31/1963 die xxxi mensis x annoque mcmlxiii 63 lxiii 1963} test clock-2.813 {conversion of 1963-11-01} { clock format -194613904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1963 12:34:56 die i mensis xi annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2438335 11 xi 11 11/01/1963 die i mensis xi annoque mcmlxiii 63 lxiii 1963} test clock-2.814 {conversion of 1963-11-30} { clock format -192108304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1963 12:34:56 die xxx mensis xi annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2438364 11 xi 11 11/30/1963 die xxx mensis xi annoque mcmlxiii 63 lxiii 1963} test clock-2.815 {conversion of 1963-12-01} { clock format -192021904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1963 12:34:56 die i mensis xii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2438365 12 xii 12 12/01/1963 die i mensis xii annoque mcmlxiii 63 lxiii 1963} test clock-2.816 {conversion of 1963-12-31} { clock format -189429904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1963 12:34:56 die xxxi mensis xii annoque mcmlxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2438395 12 xii 12 12/31/1963 die xxxi mensis xii annoque mcmlxiii 63 lxiii 1963} test clock-2.817 {conversion of 1964-01-01} { clock format -189343504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1964 12:34:56 die i mensis i annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2438396 01 i 1 01/01/1964 die i mensis i annoque mcmlxiv 64 lxiv 1964} test clock-2.818 {conversion of 1964-01-31} { clock format -186751504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1964 12:34:56 die xxxi mensis i annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2438426 01 i 1 01/31/1964 die xxxi mensis i annoque mcmlxiv 64 lxiv 1964} test clock-2.819 {conversion of 1964-02-01} { clock format -186665104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1964 12:34:56 die i mensis ii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2438427 02 ii 2 02/01/1964 die i mensis ii annoque mcmlxiv 64 lxiv 1964} test clock-2.820 {conversion of 1964-02-29} { clock format -184245904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1964 12:34:56 die xxix mensis ii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2438455 02 ii 2 02/29/1964 die xxix mensis ii annoque mcmlxiv 64 lxiv 1964} test clock-2.821 {conversion of 1964-03-01} { clock format -184159504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1964 12:34:56 die i mensis iii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2438456 03 iii 3 03/01/1964 die i mensis iii annoque mcmlxiv 64 lxiv 1964} test clock-2.822 {conversion of 1964-03-31} { clock format -181567504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1964 12:34:56 die xxxi mensis iii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2438486 03 iii 3 03/31/1964 die xxxi mensis iii annoque mcmlxiv 64 lxiv 1964} test clock-2.823 {conversion of 1964-04-01} { clock format -181481104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1964 12:34:56 die i mensis iv annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2438487 04 iv 4 04/01/1964 die i mensis iv annoque mcmlxiv 64 lxiv 1964} test clock-2.824 {conversion of 1964-04-30} { clock format -178975504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1964 12:34:56 die xxx mensis iv annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2438516 04 iv 4 04/30/1964 die xxx mensis iv annoque mcmlxiv 64 lxiv 1964} test clock-2.825 {conversion of 1964-05-01} { clock format -178889104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1964 12:34:56 die i mensis v annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2438517 05 v 5 05/01/1964 die i mensis v annoque mcmlxiv 64 lxiv 1964} test clock-2.826 {conversion of 1964-05-31} { clock format -176297104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1964 12:34:56 die xxxi mensis v annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2438547 05 v 5 05/31/1964 die xxxi mensis v annoque mcmlxiv 64 lxiv 1964} test clock-2.827 {conversion of 1964-06-01} { clock format -176210704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1964 12:34:56 die i mensis vi annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2438548 06 vi 6 06/01/1964 die i mensis vi annoque mcmlxiv 64 lxiv 1964} test clock-2.828 {conversion of 1964-06-30} { clock format -173705104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1964 12:34:56 die xxx mensis vi annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2438577 06 vi 6 06/30/1964 die xxx mensis vi annoque mcmlxiv 64 lxiv 1964} test clock-2.829 {conversion of 1964-07-01} { clock format -173618704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1964 12:34:56 die i mensis vii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2438578 07 vii 7 07/01/1964 die i mensis vii annoque mcmlxiv 64 lxiv 1964} test clock-2.830 {conversion of 1964-07-31} { clock format -171026704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1964 12:34:56 die xxxi mensis vii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2438608 07 vii 7 07/31/1964 die xxxi mensis vii annoque mcmlxiv 64 lxiv 1964} test clock-2.831 {conversion of 1964-08-01} { clock format -170940304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1964 12:34:56 die i mensis viii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2438609 08 viii 8 08/01/1964 die i mensis viii annoque mcmlxiv 64 lxiv 1964} test clock-2.832 {conversion of 1964-08-31} { clock format -168348304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1964 12:34:56 die xxxi mensis viii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2438639 08 viii 8 08/31/1964 die xxxi mensis viii annoque mcmlxiv 64 lxiv 1964} test clock-2.833 {conversion of 1964-09-01} { clock format -168261904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1964 12:34:56 die i mensis ix annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2438640 09 ix 9 09/01/1964 die i mensis ix annoque mcmlxiv 64 lxiv 1964} test clock-2.834 {conversion of 1964-09-30} { clock format -165756304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1964 12:34:56 die xxx mensis ix annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2438669 09 ix 9 09/30/1964 die xxx mensis ix annoque mcmlxiv 64 lxiv 1964} test clock-2.835 {conversion of 1964-10-01} { clock format -165669904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1964 12:34:56 die i mensis x annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2438670 10 x 10 10/01/1964 die i mensis x annoque mcmlxiv 64 lxiv 1964} test clock-2.836 {conversion of 1964-10-31} { clock format -163077904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1964 12:34:56 die xxxi mensis x annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2438700 10 x 10 10/31/1964 die xxxi mensis x annoque mcmlxiv 64 lxiv 1964} test clock-2.837 {conversion of 1964-11-01} { clock format -162991504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1964 12:34:56 die i mensis xi annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2438701 11 xi 11 11/01/1964 die i mensis xi annoque mcmlxiv 64 lxiv 1964} test clock-2.838 {conversion of 1964-11-30} { clock format -160485904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1964 12:34:56 die xxx mensis xi annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2438730 11 xi 11 11/30/1964 die xxx mensis xi annoque mcmlxiv 64 lxiv 1964} test clock-2.839 {conversion of 1964-12-01} { clock format -160399504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1964 12:34:56 die i mensis xii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2438731 12 xii 12 12/01/1964 die i mensis xii annoque mcmlxiv 64 lxiv 1964} test clock-2.840 {conversion of 1964-12-31} { clock format -157807504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1964 12:34:56 die xxxi mensis xii annoque mcmlxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2438761 12 xii 12 12/31/1964 die xxxi mensis xii annoque mcmlxiv 64 lxiv 1964} test clock-2.841 {conversion of 1965-01-01} { clock format -157721104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1965 12:34:56 die i mensis i annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2438762 01 i 1 01/01/1965 die i mensis i annoque mcmlxv 65 lxv 1965} test clock-2.842 {conversion of 1965-01-31} { clock format -155129104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1965 12:34:56 die xxxi mensis i annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2438792 01 i 1 01/31/1965 die xxxi mensis i annoque mcmlxv 65 lxv 1965} test clock-2.843 {conversion of 1965-02-01} { clock format -155042704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1965 12:34:56 die i mensis ii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2438793 02 ii 2 02/01/1965 die i mensis ii annoque mcmlxv 65 lxv 1965} test clock-2.844 {conversion of 1965-02-28} { clock format -152709904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1965 12:34:56 die xxviii mensis ii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2438820 02 ii 2 02/28/1965 die xxviii mensis ii annoque mcmlxv 65 lxv 1965} test clock-2.845 {conversion of 1965-03-01} { clock format -152623504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1965 12:34:56 die i mensis iii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2438821 03 iii 3 03/01/1965 die i mensis iii annoque mcmlxv 65 lxv 1965} test clock-2.846 {conversion of 1965-03-31} { clock format -150031504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1965 12:34:56 die xxxi mensis iii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2438851 03 iii 3 03/31/1965 die xxxi mensis iii annoque mcmlxv 65 lxv 1965} test clock-2.847 {conversion of 1965-04-01} { clock format -149945104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1965 12:34:56 die i mensis iv annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2438852 04 iv 4 04/01/1965 die i mensis iv annoque mcmlxv 65 lxv 1965} test clock-2.848 {conversion of 1965-04-30} { clock format -147439504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1965 12:34:56 die xxx mensis iv annoque mcmlxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2438881 04 iv 4 04/30/1965 die xxx mensis iv annoque mcmlxv 65 lxv 1965} test clock-2.849 {conversion of 1965-05-01} { clock format -147353104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1965 12:34:56 die i mensis v annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2438882 05 v 5 05/01/1965 die i mensis v annoque mcmlxv 65 lxv 1965} test clock-2.850 {conversion of 1965-05-31} { clock format -144761104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1965 12:34:56 die xxxi mensis v annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2438912 05 v 5 05/31/1965 die xxxi mensis v annoque mcmlxv 65 lxv 1965} test clock-2.851 {conversion of 1965-06-01} { clock format -144674704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1965 12:34:56 die i mensis vi annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2438913 06 vi 6 06/01/1965 die i mensis vi annoque mcmlxv 65 lxv 1965} test clock-2.852 {conversion of 1965-06-30} { clock format -142169104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1965 12:34:56 die xxx mensis vi annoque mcmlxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2438942 06 vi 6 06/30/1965 die xxx mensis vi annoque mcmlxv 65 lxv 1965} test clock-2.853 {conversion of 1965-07-01} { clock format -142082704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1965 12:34:56 die i mensis vii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2438943 07 vii 7 07/01/1965 die i mensis vii annoque mcmlxv 65 lxv 1965} test clock-2.854 {conversion of 1965-07-31} { clock format -139490704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1965 12:34:56 die xxxi mensis vii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2438973 07 vii 7 07/31/1965 die xxxi mensis vii annoque mcmlxv 65 lxv 1965} test clock-2.855 {conversion of 1965-08-01} { clock format -139404304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1965 12:34:56 die i mensis viii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2438974 08 viii 8 08/01/1965 die i mensis viii annoque mcmlxv 65 lxv 1965} test clock-2.856 {conversion of 1965-08-31} { clock format -136812304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1965 12:34:56 die xxxi mensis viii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2439004 08 viii 8 08/31/1965 die xxxi mensis viii annoque mcmlxv 65 lxv 1965} test clock-2.857 {conversion of 1965-09-01} { clock format -136725904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1965 12:34:56 die i mensis ix annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2439005 09 ix 9 09/01/1965 die i mensis ix annoque mcmlxv 65 lxv 1965} test clock-2.858 {conversion of 1965-09-30} { clock format -134220304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1965 12:34:56 die xxx mensis ix annoque mcmlxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2439034 09 ix 9 09/30/1965 die xxx mensis ix annoque mcmlxv 65 lxv 1965} test clock-2.859 {conversion of 1965-10-01} { clock format -134133904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1965 12:34:56 die i mensis x annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2439035 10 x 10 10/01/1965 die i mensis x annoque mcmlxv 65 lxv 1965} test clock-2.860 {conversion of 1965-10-31} { clock format -131541904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1965 12:34:56 die xxxi mensis x annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2439065 10 x 10 10/31/1965 die xxxi mensis x annoque mcmlxv 65 lxv 1965} test clock-2.861 {conversion of 1965-11-01} { clock format -131455504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1965 12:34:56 die i mensis xi annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2439066 11 xi 11 11/01/1965 die i mensis xi annoque mcmlxv 65 lxv 1965} test clock-2.862 {conversion of 1965-11-30} { clock format -128949904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1965 12:34:56 die xxx mensis xi annoque mcmlxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2439095 11 xi 11 11/30/1965 die xxx mensis xi annoque mcmlxv 65 lxv 1965} test clock-2.863 {conversion of 1965-12-01} { clock format -128863504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1965 12:34:56 die i mensis xii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2439096 12 xii 12 12/01/1965 die i mensis xii annoque mcmlxv 65 lxv 1965} test clock-2.864 {conversion of 1965-12-31} { clock format -126271504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1965 12:34:56 die xxxi mensis xii annoque mcmlxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2439126 12 xii 12 12/31/1965 die xxxi mensis xii annoque mcmlxv 65 lxv 1965} test clock-2.865 {conversion of 1966-01-01} { clock format -126185104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1966 12:34:56 die i mensis i annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2439127 01 i 1 01/01/1966 die i mensis i annoque mcmlxvi 66 lxvi 1966} test clock-2.866 {conversion of 1966-01-31} { clock format -123593104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1966 12:34:56 die xxxi mensis i annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2439157 01 i 1 01/31/1966 die xxxi mensis i annoque mcmlxvi 66 lxvi 1966} test clock-2.867 {conversion of 1966-02-01} { clock format -123506704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1966 12:34:56 die i mensis ii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2439158 02 ii 2 02/01/1966 die i mensis ii annoque mcmlxvi 66 lxvi 1966} test clock-2.868 {conversion of 1966-02-28} { clock format -121173904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1966 12:34:56 die xxviii mensis ii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2439185 02 ii 2 02/28/1966 die xxviii mensis ii annoque mcmlxvi 66 lxvi 1966} test clock-2.869 {conversion of 1966-03-01} { clock format -121087504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1966 12:34:56 die i mensis iii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2439186 03 iii 3 03/01/1966 die i mensis iii annoque mcmlxvi 66 lxvi 1966} test clock-2.870 {conversion of 1966-03-31} { clock format -118495504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1966 12:34:56 die xxxi mensis iii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2439216 03 iii 3 03/31/1966 die xxxi mensis iii annoque mcmlxvi 66 lxvi 1966} test clock-2.871 {conversion of 1966-04-01} { clock format -118409104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1966 12:34:56 die i mensis iv annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2439217 04 iv 4 04/01/1966 die i mensis iv annoque mcmlxvi 66 lxvi 1966} test clock-2.872 {conversion of 1966-04-30} { clock format -115903504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1966 12:34:56 die xxx mensis iv annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2439246 04 iv 4 04/30/1966 die xxx mensis iv annoque mcmlxvi 66 lxvi 1966} test clock-2.873 {conversion of 1966-05-01} { clock format -115817104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1966 12:34:56 die i mensis v annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2439247 05 v 5 05/01/1966 die i mensis v annoque mcmlxvi 66 lxvi 1966} test clock-2.874 {conversion of 1966-05-31} { clock format -113225104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1966 12:34:56 die xxxi mensis v annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2439277 05 v 5 05/31/1966 die xxxi mensis v annoque mcmlxvi 66 lxvi 1966} test clock-2.875 {conversion of 1966-06-01} { clock format -113138704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1966 12:34:56 die i mensis vi annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2439278 06 vi 6 06/01/1966 die i mensis vi annoque mcmlxvi 66 lxvi 1966} test clock-2.876 {conversion of 1966-06-30} { clock format -110633104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1966 12:34:56 die xxx mensis vi annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2439307 06 vi 6 06/30/1966 die xxx mensis vi annoque mcmlxvi 66 lxvi 1966} test clock-2.877 {conversion of 1966-07-01} { clock format -110546704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1966 12:34:56 die i mensis vii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2439308 07 vii 7 07/01/1966 die i mensis vii annoque mcmlxvi 66 lxvi 1966} test clock-2.878 {conversion of 1966-07-31} { clock format -107954704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1966 12:34:56 die xxxi mensis vii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2439338 07 vii 7 07/31/1966 die xxxi mensis vii annoque mcmlxvi 66 lxvi 1966} test clock-2.879 {conversion of 1966-08-01} { clock format -107868304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1966 12:34:56 die i mensis viii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2439339 08 viii 8 08/01/1966 die i mensis viii annoque mcmlxvi 66 lxvi 1966} test clock-2.880 {conversion of 1966-08-31} { clock format -105276304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1966 12:34:56 die xxxi mensis viii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2439369 08 viii 8 08/31/1966 die xxxi mensis viii annoque mcmlxvi 66 lxvi 1966} test clock-2.881 {conversion of 1966-09-01} { clock format -105189904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1966 12:34:56 die i mensis ix annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2439370 09 ix 9 09/01/1966 die i mensis ix annoque mcmlxvi 66 lxvi 1966} test clock-2.882 {conversion of 1966-09-30} { clock format -102684304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1966 12:34:56 die xxx mensis ix annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2439399 09 ix 9 09/30/1966 die xxx mensis ix annoque mcmlxvi 66 lxvi 1966} test clock-2.883 {conversion of 1966-10-01} { clock format -102597904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1966 12:34:56 die i mensis x annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2439400 10 x 10 10/01/1966 die i mensis x annoque mcmlxvi 66 lxvi 1966} test clock-2.884 {conversion of 1966-10-31} { clock format -100005904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1966 12:34:56 die xxxi mensis x annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2439430 10 x 10 10/31/1966 die xxxi mensis x annoque mcmlxvi 66 lxvi 1966} test clock-2.885 {conversion of 1966-11-01} { clock format -99919504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1966 12:34:56 die i mensis xi annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2439431 11 xi 11 11/01/1966 die i mensis xi annoque mcmlxvi 66 lxvi 1966} test clock-2.886 {conversion of 1966-11-30} { clock format -97413904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1966 12:34:56 die xxx mensis xi annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2439460 11 xi 11 11/30/1966 die xxx mensis xi annoque mcmlxvi 66 lxvi 1966} test clock-2.887 {conversion of 1966-12-01} { clock format -97327504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1966 12:34:56 die i mensis xii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2439461 12 xii 12 12/01/1966 die i mensis xii annoque mcmlxvi 66 lxvi 1966} test clock-2.888 {conversion of 1966-12-31} { clock format -94735504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1966 12:34:56 die xxxi mensis xii annoque mcmlxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2439491 12 xii 12 12/31/1966 die xxxi mensis xii annoque mcmlxvi 66 lxvi 1966} test clock-2.889 {conversion of 1967-01-01} { clock format -94649104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1967 12:34:56 die i mensis i annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2439492 01 i 1 01/01/1967 die i mensis i annoque mcmlxvii 67 lxvii 1967} test clock-2.890 {conversion of 1967-01-31} { clock format -92057104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1967 12:34:56 die xxxi mensis i annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2439522 01 i 1 01/31/1967 die xxxi mensis i annoque mcmlxvii 67 lxvii 1967} test clock-2.891 {conversion of 1967-02-01} { clock format -91970704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1967 12:34:56 die i mensis ii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2439523 02 ii 2 02/01/1967 die i mensis ii annoque mcmlxvii 67 lxvii 1967} test clock-2.892 {conversion of 1967-02-28} { clock format -89637904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1967 12:34:56 die xxviii mensis ii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2439550 02 ii 2 02/28/1967 die xxviii mensis ii annoque mcmlxvii 67 lxvii 1967} test clock-2.893 {conversion of 1967-03-01} { clock format -89551504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1967 12:34:56 die i mensis iii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2439551 03 iii 3 03/01/1967 die i mensis iii annoque mcmlxvii 67 lxvii 1967} test clock-2.894 {conversion of 1967-03-31} { clock format -86959504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1967 12:34:56 die xxxi mensis iii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2439581 03 iii 3 03/31/1967 die xxxi mensis iii annoque mcmlxvii 67 lxvii 1967} test clock-2.895 {conversion of 1967-04-01} { clock format -86873104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1967 12:34:56 die i mensis iv annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2439582 04 iv 4 04/01/1967 die i mensis iv annoque mcmlxvii 67 lxvii 1967} test clock-2.896 {conversion of 1967-04-30} { clock format -84367504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1967 12:34:56 die xxx mensis iv annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2439611 04 iv 4 04/30/1967 die xxx mensis iv annoque mcmlxvii 67 lxvii 1967} test clock-2.897 {conversion of 1967-05-01} { clock format -84281104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1967 12:34:56 die i mensis v annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2439612 05 v 5 05/01/1967 die i mensis v annoque mcmlxvii 67 lxvii 1967} test clock-2.898 {conversion of 1967-05-31} { clock format -81689104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1967 12:34:56 die xxxi mensis v annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2439642 05 v 5 05/31/1967 die xxxi mensis v annoque mcmlxvii 67 lxvii 1967} test clock-2.899 {conversion of 1967-06-01} { clock format -81602704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1967 12:34:56 die i mensis vi annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2439643 06 vi 6 06/01/1967 die i mensis vi annoque mcmlxvii 67 lxvii 1967} test clock-2.900 {conversion of 1967-06-30} { clock format -79097104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1967 12:34:56 die xxx mensis vi annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2439672 06 vi 6 06/30/1967 die xxx mensis vi annoque mcmlxvii 67 lxvii 1967} test clock-2.901 {conversion of 1967-07-01} { clock format -79010704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1967 12:34:56 die i mensis vii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2439673 07 vii 7 07/01/1967 die i mensis vii annoque mcmlxvii 67 lxvii 1967} test clock-2.902 {conversion of 1967-07-31} { clock format -76418704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1967 12:34:56 die xxxi mensis vii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2439703 07 vii 7 07/31/1967 die xxxi mensis vii annoque mcmlxvii 67 lxvii 1967} test clock-2.903 {conversion of 1967-08-01} { clock format -76332304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1967 12:34:56 die i mensis viii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2439704 08 viii 8 08/01/1967 die i mensis viii annoque mcmlxvii 67 lxvii 1967} test clock-2.904 {conversion of 1967-08-31} { clock format -73740304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1967 12:34:56 die xxxi mensis viii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2439734 08 viii 8 08/31/1967 die xxxi mensis viii annoque mcmlxvii 67 lxvii 1967} test clock-2.905 {conversion of 1967-09-01} { clock format -73653904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1967 12:34:56 die i mensis ix annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2439735 09 ix 9 09/01/1967 die i mensis ix annoque mcmlxvii 67 lxvii 1967} test clock-2.906 {conversion of 1967-09-30} { clock format -71148304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1967 12:34:56 die xxx mensis ix annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2439764 09 ix 9 09/30/1967 die xxx mensis ix annoque mcmlxvii 67 lxvii 1967} test clock-2.907 {conversion of 1967-10-01} { clock format -71061904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1967 12:34:56 die i mensis x annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2439765 10 x 10 10/01/1967 die i mensis x annoque mcmlxvii 67 lxvii 1967} test clock-2.908 {conversion of 1967-10-31} { clock format -68469904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1967 12:34:56 die xxxi mensis x annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2439795 10 x 10 10/31/1967 die xxxi mensis x annoque mcmlxvii 67 lxvii 1967} test clock-2.909 {conversion of 1967-11-01} { clock format -68383504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1967 12:34:56 die i mensis xi annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2439796 11 xi 11 11/01/1967 die i mensis xi annoque mcmlxvii 67 lxvii 1967} test clock-2.910 {conversion of 1967-11-30} { clock format -65877904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1967 12:34:56 die xxx mensis xi annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2439825 11 xi 11 11/30/1967 die xxx mensis xi annoque mcmlxvii 67 lxvii 1967} test clock-2.911 {conversion of 1967-12-01} { clock format -65791504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1967 12:34:56 die i mensis xii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2439826 12 xii 12 12/01/1967 die i mensis xii annoque mcmlxvii 67 lxvii 1967} test clock-2.912 {conversion of 1967-12-31} { clock format -63199504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1967 12:34:56 die xxxi mensis xii annoque mcmlxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2439856 12 xii 12 12/31/1967 die xxxi mensis xii annoque mcmlxvii 67 lxvii 1967} test clock-2.913 {conversion of 1968-01-01} { clock format -63113104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1968 12:34:56 die i mensis i annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2439857 01 i 1 01/01/1968 die i mensis i annoque mcmlxviii 68 lxviii 1968} test clock-2.914 {conversion of 1968-01-31} { clock format -60521104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1968 12:34:56 die xxxi mensis i annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2439887 01 i 1 01/31/1968 die xxxi mensis i annoque mcmlxviii 68 lxviii 1968} test clock-2.915 {conversion of 1968-02-01} { clock format -60434704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1968 12:34:56 die i mensis ii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2439888 02 ii 2 02/01/1968 die i mensis ii annoque mcmlxviii 68 lxviii 1968} test clock-2.916 {conversion of 1968-02-29} { clock format -58015504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1968 12:34:56 die xxix mensis ii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2439916 02 ii 2 02/29/1968 die xxix mensis ii annoque mcmlxviii 68 lxviii 1968} test clock-2.917 {conversion of 1968-03-01} { clock format -57929104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1968 12:34:56 die i mensis iii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2439917 03 iii 3 03/01/1968 die i mensis iii annoque mcmlxviii 68 lxviii 1968} test clock-2.918 {conversion of 1968-03-31} { clock format -55337104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1968 12:34:56 die xxxi mensis iii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2439947 03 iii 3 03/31/1968 die xxxi mensis iii annoque mcmlxviii 68 lxviii 1968} test clock-2.919 {conversion of 1968-04-01} { clock format -55250704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1968 12:34:56 die i mensis iv annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2439948 04 iv 4 04/01/1968 die i mensis iv annoque mcmlxviii 68 lxviii 1968} test clock-2.920 {conversion of 1968-04-30} { clock format -52745104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1968 12:34:56 die xxx mensis iv annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2439977 04 iv 4 04/30/1968 die xxx mensis iv annoque mcmlxviii 68 lxviii 1968} test clock-2.921 {conversion of 1968-05-01} { clock format -52658704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1968 12:34:56 die i mensis v annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2439978 05 v 5 05/01/1968 die i mensis v annoque mcmlxviii 68 lxviii 1968} test clock-2.922 {conversion of 1968-05-31} { clock format -50066704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1968 12:34:56 die xxxi mensis v annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2440008 05 v 5 05/31/1968 die xxxi mensis v annoque mcmlxviii 68 lxviii 1968} test clock-2.923 {conversion of 1968-06-01} { clock format -49980304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1968 12:34:56 die i mensis vi annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2440009 06 vi 6 06/01/1968 die i mensis vi annoque mcmlxviii 68 lxviii 1968} test clock-2.924 {conversion of 1968-06-30} { clock format -47474704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1968 12:34:56 die xxx mensis vi annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2440038 06 vi 6 06/30/1968 die xxx mensis vi annoque mcmlxviii 68 lxviii 1968} test clock-2.925 {conversion of 1968-07-01} { clock format -47388304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1968 12:34:56 die i mensis vii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2440039 07 vii 7 07/01/1968 die i mensis vii annoque mcmlxviii 68 lxviii 1968} test clock-2.926 {conversion of 1968-07-31} { clock format -44796304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1968 12:34:56 die xxxi mensis vii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2440069 07 vii 7 07/31/1968 die xxxi mensis vii annoque mcmlxviii 68 lxviii 1968} test clock-2.927 {conversion of 1968-08-01} { clock format -44709904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1968 12:34:56 die i mensis viii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2440070 08 viii 8 08/01/1968 die i mensis viii annoque mcmlxviii 68 lxviii 1968} test clock-2.928 {conversion of 1968-08-31} { clock format -42117904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1968 12:34:56 die xxxi mensis viii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2440100 08 viii 8 08/31/1968 die xxxi mensis viii annoque mcmlxviii 68 lxviii 1968} test clock-2.929 {conversion of 1968-09-01} { clock format -42031504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1968 12:34:56 die i mensis ix annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2440101 09 ix 9 09/01/1968 die i mensis ix annoque mcmlxviii 68 lxviii 1968} test clock-2.930 {conversion of 1968-09-30} { clock format -39525904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1968 12:34:56 die xxx mensis ix annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2440130 09 ix 9 09/30/1968 die xxx mensis ix annoque mcmlxviii 68 lxviii 1968} test clock-2.931 {conversion of 1968-10-01} { clock format -39439504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1968 12:34:56 die i mensis x annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2440131 10 x 10 10/01/1968 die i mensis x annoque mcmlxviii 68 lxviii 1968} test clock-2.932 {conversion of 1968-10-31} { clock format -36847504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1968 12:34:56 die xxxi mensis x annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2440161 10 x 10 10/31/1968 die xxxi mensis x annoque mcmlxviii 68 lxviii 1968} test clock-2.933 {conversion of 1968-11-01} { clock format -36761104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1968 12:34:56 die i mensis xi annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2440162 11 xi 11 11/01/1968 die i mensis xi annoque mcmlxviii 68 lxviii 1968} test clock-2.934 {conversion of 1968-11-30} { clock format -34255504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1968 12:34:56 die xxx mensis xi annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2440191 11 xi 11 11/30/1968 die xxx mensis xi annoque mcmlxviii 68 lxviii 1968} test clock-2.935 {conversion of 1968-12-01} { clock format -34169104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1968 12:34:56 die i mensis xii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2440192 12 xii 12 12/01/1968 die i mensis xii annoque mcmlxviii 68 lxviii 1968} test clock-2.936 {conversion of 1968-12-31} { clock format -31577104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1968 12:34:56 die xxxi mensis xii annoque mcmlxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2440222 12 xii 12 12/31/1968 die xxxi mensis xii annoque mcmlxviii 68 lxviii 1968} test clock-2.937 {conversion of 1969-01-01} { clock format -31490704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1969 12:34:56 die i mensis i annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2440223 01 i 1 01/01/1969 die i mensis i annoque mcmlxix 69 lxix 1969} test clock-2.938 {conversion of 1969-01-31} { clock format -28898704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1969 12:34:56 die xxxi mensis i annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2440253 01 i 1 01/31/1969 die xxxi mensis i annoque mcmlxix 69 lxix 1969} test clock-2.939 {conversion of 1969-02-01} { clock format -28812304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1969 12:34:56 die i mensis ii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2440254 02 ii 2 02/01/1969 die i mensis ii annoque mcmlxix 69 lxix 1969} test clock-2.940 {conversion of 1969-02-28} { clock format -26479504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1969 12:34:56 die xxviii mensis ii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2440281 02 ii 2 02/28/1969 die xxviii mensis ii annoque mcmlxix 69 lxix 1969} test clock-2.941 {conversion of 1969-03-01} { clock format -26393104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1969 12:34:56 die i mensis iii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2440282 03 iii 3 03/01/1969 die i mensis iii annoque mcmlxix 69 lxix 1969} test clock-2.942 {conversion of 1969-03-31} { clock format -23801104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1969 12:34:56 die xxxi mensis iii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2440312 03 iii 3 03/31/1969 die xxxi mensis iii annoque mcmlxix 69 lxix 1969} test clock-2.943 {conversion of 1969-04-01} { clock format -23714704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1969 12:34:56 die i mensis iv annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2440313 04 iv 4 04/01/1969 die i mensis iv annoque mcmlxix 69 lxix 1969} test clock-2.944 {conversion of 1969-04-30} { clock format -21209104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1969 12:34:56 die xxx mensis iv annoque mcmlxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2440342 04 iv 4 04/30/1969 die xxx mensis iv annoque mcmlxix 69 lxix 1969} test clock-2.945 {conversion of 1969-05-01} { clock format -21122704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1969 12:34:56 die i mensis v annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2440343 05 v 5 05/01/1969 die i mensis v annoque mcmlxix 69 lxix 1969} test clock-2.946 {conversion of 1969-05-31} { clock format -18530704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1969 12:34:56 die xxxi mensis v annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2440373 05 v 5 05/31/1969 die xxxi mensis v annoque mcmlxix 69 lxix 1969} test clock-2.947 {conversion of 1969-06-01} { clock format -18444304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1969 12:34:56 die i mensis vi annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2440374 06 vi 6 06/01/1969 die i mensis vi annoque mcmlxix 69 lxix 1969} test clock-2.948 {conversion of 1969-06-30} { clock format -15938704 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1969 12:34:56 die xxx mensis vi annoque mcmlxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2440403 06 vi 6 06/30/1969 die xxx mensis vi annoque mcmlxix 69 lxix 1969} test clock-2.949 {conversion of 1969-07-01} { clock format -15852304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1969 12:34:56 die i mensis vii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2440404 07 vii 7 07/01/1969 die i mensis vii annoque mcmlxix 69 lxix 1969} test clock-2.950 {conversion of 1969-07-31} { clock format -13260304 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1969 12:34:56 die xxxi mensis vii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2440434 07 vii 7 07/31/1969 die xxxi mensis vii annoque mcmlxix 69 lxix 1969} test clock-2.951 {conversion of 1969-08-01} { clock format -13173904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1969 12:34:56 die i mensis viii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2440435 08 viii 8 08/01/1969 die i mensis viii annoque mcmlxix 69 lxix 1969} test clock-2.952 {conversion of 1969-08-31} { clock format -10581904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1969 12:34:56 die xxxi mensis viii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2440465 08 viii 8 08/31/1969 die xxxi mensis viii annoque mcmlxix 69 lxix 1969} test clock-2.953 {conversion of 1969-09-01} { clock format -10495504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1969 12:34:56 die i mensis ix annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2440466 09 ix 9 09/01/1969 die i mensis ix annoque mcmlxix 69 lxix 1969} test clock-2.954 {conversion of 1969-09-30} { clock format -7989904 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1969 12:34:56 die xxx mensis ix annoque mcmlxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2440495 09 ix 9 09/30/1969 die xxx mensis ix annoque mcmlxix 69 lxix 1969} test clock-2.955 {conversion of 1969-10-01} { clock format -7903504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1969 12:34:56 die i mensis x annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2440496 10 x 10 10/01/1969 die i mensis x annoque mcmlxix 69 lxix 1969} test clock-2.956 {conversion of 1969-10-31} { clock format -5311504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1969 12:34:56 die xxxi mensis x annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2440526 10 x 10 10/31/1969 die xxxi mensis x annoque mcmlxix 69 lxix 1969} test clock-2.957 {conversion of 1969-11-01} { clock format -5225104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1969 12:34:56 die i mensis xi annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2440527 11 xi 11 11/01/1969 die i mensis xi annoque mcmlxix 69 lxix 1969} test clock-2.958 {conversion of 1969-11-30} { clock format -2719504 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1969 12:34:56 die xxx mensis xi annoque mcmlxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2440556 11 xi 11 11/30/1969 die xxx mensis xi annoque mcmlxix 69 lxix 1969} test clock-2.959 {conversion of 1969-12-01} { clock format -2633104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1969 12:34:56 die i mensis xii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2440557 12 xii 12 12/01/1969 die i mensis xii annoque mcmlxix 69 lxix 1969} test clock-2.960 {conversion of 1969-12-31} { clock format -41104 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1969 12:34:56 die xxxi mensis xii annoque mcmlxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2440587 12 xii 12 12/31/1969 die xxxi mensis xii annoque mcmlxix 69 lxix 1969} test clock-2.961 {conversion of 1970-01-01} { clock format 45296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1970 12:34:56 die i mensis i annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2440588 01 i 1 01/01/1970 die i mensis i annoque mcmlxx 70 lxx 1970} test clock-2.962 {conversion of 1970-01-31} { clock format 2637296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1970 12:34:56 die xxxi mensis i annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2440618 01 i 1 01/31/1970 die xxxi mensis i annoque mcmlxx 70 lxx 1970} test clock-2.963 {conversion of 1970-02-01} { clock format 2723696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1970 12:34:56 die i mensis ii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2440619 02 ii 2 02/01/1970 die i mensis ii annoque mcmlxx 70 lxx 1970} test clock-2.964 {conversion of 1970-02-28} { clock format 5056496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1970 12:34:56 die xxviii mensis ii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2440646 02 ii 2 02/28/1970 die xxviii mensis ii annoque mcmlxx 70 lxx 1970} test clock-2.965 {conversion of 1970-03-01} { clock format 5142896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1970 12:34:56 die i mensis iii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2440647 03 iii 3 03/01/1970 die i mensis iii annoque mcmlxx 70 lxx 1970} test clock-2.966 {conversion of 1970-03-31} { clock format 7734896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1970 12:34:56 die xxxi mensis iii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2440677 03 iii 3 03/31/1970 die xxxi mensis iii annoque mcmlxx 70 lxx 1970} test clock-2.967 {conversion of 1970-04-01} { clock format 7821296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1970 12:34:56 die i mensis iv annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2440678 04 iv 4 04/01/1970 die i mensis iv annoque mcmlxx 70 lxx 1970} test clock-2.968 {conversion of 1970-04-30} { clock format 10326896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1970 12:34:56 die xxx mensis iv annoque mcmlxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2440707 04 iv 4 04/30/1970 die xxx mensis iv annoque mcmlxx 70 lxx 1970} test clock-2.969 {conversion of 1970-05-01} { clock format 10413296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1970 12:34:56 die i mensis v annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2440708 05 v 5 05/01/1970 die i mensis v annoque mcmlxx 70 lxx 1970} test clock-2.970 {conversion of 1970-05-31} { clock format 13005296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1970 12:34:56 die xxxi mensis v annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2440738 05 v 5 05/31/1970 die xxxi mensis v annoque mcmlxx 70 lxx 1970} test clock-2.971 {conversion of 1970-06-01} { clock format 13091696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1970 12:34:56 die i mensis vi annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2440739 06 vi 6 06/01/1970 die i mensis vi annoque mcmlxx 70 lxx 1970} test clock-2.972 {conversion of 1970-06-30} { clock format 15597296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1970 12:34:56 die xxx mensis vi annoque mcmlxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2440768 06 vi 6 06/30/1970 die xxx mensis vi annoque mcmlxx 70 lxx 1970} test clock-2.973 {conversion of 1970-07-01} { clock format 15683696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1970 12:34:56 die i mensis vii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2440769 07 vii 7 07/01/1970 die i mensis vii annoque mcmlxx 70 lxx 1970} test clock-2.974 {conversion of 1970-07-31} { clock format 18275696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1970 12:34:56 die xxxi mensis vii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2440799 07 vii 7 07/31/1970 die xxxi mensis vii annoque mcmlxx 70 lxx 1970} test clock-2.975 {conversion of 1970-08-01} { clock format 18362096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1970 12:34:56 die i mensis viii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2440800 08 viii 8 08/01/1970 die i mensis viii annoque mcmlxx 70 lxx 1970} test clock-2.976 {conversion of 1970-08-31} { clock format 20954096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1970 12:34:56 die xxxi mensis viii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2440830 08 viii 8 08/31/1970 die xxxi mensis viii annoque mcmlxx 70 lxx 1970} test clock-2.977 {conversion of 1970-09-01} { clock format 21040496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1970 12:34:56 die i mensis ix annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2440831 09 ix 9 09/01/1970 die i mensis ix annoque mcmlxx 70 lxx 1970} test clock-2.978 {conversion of 1970-09-30} { clock format 23546096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1970 12:34:56 die xxx mensis ix annoque mcmlxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2440860 09 ix 9 09/30/1970 die xxx mensis ix annoque mcmlxx 70 lxx 1970} test clock-2.979 {conversion of 1970-10-01} { clock format 23632496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1970 12:34:56 die i mensis x annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2440861 10 x 10 10/01/1970 die i mensis x annoque mcmlxx 70 lxx 1970} test clock-2.980 {conversion of 1970-10-31} { clock format 26224496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1970 12:34:56 die xxxi mensis x annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2440891 10 x 10 10/31/1970 die xxxi mensis x annoque mcmlxx 70 lxx 1970} test clock-2.981 {conversion of 1970-11-01} { clock format 26310896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1970 12:34:56 die i mensis xi annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2440892 11 xi 11 11/01/1970 die i mensis xi annoque mcmlxx 70 lxx 1970} test clock-2.982 {conversion of 1970-11-30} { clock format 28816496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1970 12:34:56 die xxx mensis xi annoque mcmlxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2440921 11 xi 11 11/30/1970 die xxx mensis xi annoque mcmlxx 70 lxx 1970} test clock-2.983 {conversion of 1970-12-01} { clock format 28902896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1970 12:34:56 die i mensis xii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2440922 12 xii 12 12/01/1970 die i mensis xii annoque mcmlxx 70 lxx 1970} test clock-2.984 {conversion of 1970-12-31} { clock format 31494896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1970 12:34:56 die xxxi mensis xii annoque mcmlxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2440952 12 xii 12 12/31/1970 die xxxi mensis xii annoque mcmlxx 70 lxx 1970} test clock-2.985 {conversion of 1971-01-01} { clock format 31581296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1971 12:34:56 die i mensis i annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2440953 01 i 1 01/01/1971 die i mensis i annoque mcmlxxi 71 lxxi 1971} test clock-2.986 {conversion of 1971-01-31} { clock format 34173296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1971 12:34:56 die xxxi mensis i annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2440983 01 i 1 01/31/1971 die xxxi mensis i annoque mcmlxxi 71 lxxi 1971} test clock-2.987 {conversion of 1971-02-01} { clock format 34259696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1971 12:34:56 die i mensis ii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2440984 02 ii 2 02/01/1971 die i mensis ii annoque mcmlxxi 71 lxxi 1971} test clock-2.988 {conversion of 1971-02-28} { clock format 36592496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1971 12:34:56 die xxviii mensis ii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2441011 02 ii 2 02/28/1971 die xxviii mensis ii annoque mcmlxxi 71 lxxi 1971} test clock-2.989 {conversion of 1971-03-01} { clock format 36678896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1971 12:34:56 die i mensis iii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2441012 03 iii 3 03/01/1971 die i mensis iii annoque mcmlxxi 71 lxxi 1971} test clock-2.990 {conversion of 1971-03-31} { clock format 39270896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1971 12:34:56 die xxxi mensis iii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2441042 03 iii 3 03/31/1971 die xxxi mensis iii annoque mcmlxxi 71 lxxi 1971} test clock-2.991 {conversion of 1971-04-01} { clock format 39357296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1971 12:34:56 die i mensis iv annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2441043 04 iv 4 04/01/1971 die i mensis iv annoque mcmlxxi 71 lxxi 1971} test clock-2.992 {conversion of 1971-04-30} { clock format 41862896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1971 12:34:56 die xxx mensis iv annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2441072 04 iv 4 04/30/1971 die xxx mensis iv annoque mcmlxxi 71 lxxi 1971} test clock-2.993 {conversion of 1971-05-01} { clock format 41949296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1971 12:34:56 die i mensis v annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2441073 05 v 5 05/01/1971 die i mensis v annoque mcmlxxi 71 lxxi 1971} test clock-2.994 {conversion of 1971-05-31} { clock format 44541296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1971 12:34:56 die xxxi mensis v annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2441103 05 v 5 05/31/1971 die xxxi mensis v annoque mcmlxxi 71 lxxi 1971} test clock-2.995 {conversion of 1971-06-01} { clock format 44627696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1971 12:34:56 die i mensis vi annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2441104 06 vi 6 06/01/1971 die i mensis vi annoque mcmlxxi 71 lxxi 1971} test clock-2.996 {conversion of 1971-06-30} { clock format 47133296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1971 12:34:56 die xxx mensis vi annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2441133 06 vi 6 06/30/1971 die xxx mensis vi annoque mcmlxxi 71 lxxi 1971} test clock-2.997 {conversion of 1971-07-01} { clock format 47219696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1971 12:34:56 die i mensis vii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2441134 07 vii 7 07/01/1971 die i mensis vii annoque mcmlxxi 71 lxxi 1971} test clock-2.998 {conversion of 1971-07-31} { clock format 49811696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1971 12:34:56 die xxxi mensis vii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2441164 07 vii 7 07/31/1971 die xxxi mensis vii annoque mcmlxxi 71 lxxi 1971} test clock-2.999 {conversion of 1971-08-01} { clock format 49898096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1971 12:34:56 die i mensis viii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2441165 08 viii 8 08/01/1971 die i mensis viii annoque mcmlxxi 71 lxxi 1971} test clock-2.1000 {conversion of 1971-08-31} { clock format 52490096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1971 12:34:56 die xxxi mensis viii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2441195 08 viii 8 08/31/1971 die xxxi mensis viii annoque mcmlxxi 71 lxxi 1971} test clock-2.1001 {conversion of 1971-09-01} { clock format 52576496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1971 12:34:56 die i mensis ix annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2441196 09 ix 9 09/01/1971 die i mensis ix annoque mcmlxxi 71 lxxi 1971} test clock-2.1002 {conversion of 1971-09-30} { clock format 55082096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1971 12:34:56 die xxx mensis ix annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2441225 09 ix 9 09/30/1971 die xxx mensis ix annoque mcmlxxi 71 lxxi 1971} test clock-2.1003 {conversion of 1971-10-01} { clock format 55168496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1971 12:34:56 die i mensis x annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2441226 10 x 10 10/01/1971 die i mensis x annoque mcmlxxi 71 lxxi 1971} test clock-2.1004 {conversion of 1971-10-31} { clock format 57760496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1971 12:34:56 die xxxi mensis x annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2441256 10 x 10 10/31/1971 die xxxi mensis x annoque mcmlxxi 71 lxxi 1971} test clock-2.1005 {conversion of 1971-11-01} { clock format 57846896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1971 12:34:56 die i mensis xi annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2441257 11 xi 11 11/01/1971 die i mensis xi annoque mcmlxxi 71 lxxi 1971} test clock-2.1006 {conversion of 1971-11-30} { clock format 60352496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1971 12:34:56 die xxx mensis xi annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2441286 11 xi 11 11/30/1971 die xxx mensis xi annoque mcmlxxi 71 lxxi 1971} test clock-2.1007 {conversion of 1971-12-01} { clock format 60438896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1971 12:34:56 die i mensis xii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2441287 12 xii 12 12/01/1971 die i mensis xii annoque mcmlxxi 71 lxxi 1971} test clock-2.1008 {conversion of 1971-12-31} { clock format 63030896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1971 12:34:56 die xxxi mensis xii annoque mcmlxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2441317 12 xii 12 12/31/1971 die xxxi mensis xii annoque mcmlxxi 71 lxxi 1971} test clock-2.1009 {conversion of 1972-01-01} { clock format 63117296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1972 12:34:56 die i mensis i annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2441318 01 i 1 01/01/1972 die i mensis i annoque mcmlxxii 72 lxxii 1972} test clock-2.1010 {conversion of 1972-01-31} { clock format 65709296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1972 12:34:56 die xxxi mensis i annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2441348 01 i 1 01/31/1972 die xxxi mensis i annoque mcmlxxii 72 lxxii 1972} test clock-2.1011 {conversion of 1972-02-01} { clock format 65795696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1972 12:34:56 die i mensis ii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2441349 02 ii 2 02/01/1972 die i mensis ii annoque mcmlxxii 72 lxxii 1972} test clock-2.1012 {conversion of 1972-02-29} { clock format 68214896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1972 12:34:56 die xxix mensis ii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2441377 02 ii 2 02/29/1972 die xxix mensis ii annoque mcmlxxii 72 lxxii 1972} test clock-2.1013 {conversion of 1972-03-01} { clock format 68301296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1972 12:34:56 die i mensis iii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2441378 03 iii 3 03/01/1972 die i mensis iii annoque mcmlxxii 72 lxxii 1972} test clock-2.1014 {conversion of 1972-03-31} { clock format 70893296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1972 12:34:56 die xxxi mensis iii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2441408 03 iii 3 03/31/1972 die xxxi mensis iii annoque mcmlxxii 72 lxxii 1972} test clock-2.1015 {conversion of 1972-04-01} { clock format 70979696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1972 12:34:56 die i mensis iv annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2441409 04 iv 4 04/01/1972 die i mensis iv annoque mcmlxxii 72 lxxii 1972} test clock-2.1016 {conversion of 1972-04-30} { clock format 73485296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1972 12:34:56 die xxx mensis iv annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2441438 04 iv 4 04/30/1972 die xxx mensis iv annoque mcmlxxii 72 lxxii 1972} test clock-2.1017 {conversion of 1972-05-01} { clock format 73571696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1972 12:34:56 die i mensis v annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2441439 05 v 5 05/01/1972 die i mensis v annoque mcmlxxii 72 lxxii 1972} test clock-2.1018 {conversion of 1972-05-31} { clock format 76163696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1972 12:34:56 die xxxi mensis v annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2441469 05 v 5 05/31/1972 die xxxi mensis v annoque mcmlxxii 72 lxxii 1972} test clock-2.1019 {conversion of 1972-06-01} { clock format 76250096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1972 12:34:56 die i mensis vi annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2441470 06 vi 6 06/01/1972 die i mensis vi annoque mcmlxxii 72 lxxii 1972} test clock-2.1020 {conversion of 1972-06-30} { clock format 78755696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1972 12:34:56 die xxx mensis vi annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2441499 06 vi 6 06/30/1972 die xxx mensis vi annoque mcmlxxii 72 lxxii 1972} test clock-2.1021 {conversion of 1972-07-01} { clock format 78842096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1972 12:34:56 die i mensis vii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2441500 07 vii 7 07/01/1972 die i mensis vii annoque mcmlxxii 72 lxxii 1972} test clock-2.1022 {conversion of 1972-07-31} { clock format 81434096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1972 12:34:56 die xxxi mensis vii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2441530 07 vii 7 07/31/1972 die xxxi mensis vii annoque mcmlxxii 72 lxxii 1972} test clock-2.1023 {conversion of 1972-08-01} { clock format 81520496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1972 12:34:56 die i mensis viii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2441531 08 viii 8 08/01/1972 die i mensis viii annoque mcmlxxii 72 lxxii 1972} test clock-2.1024 {conversion of 1972-08-31} { clock format 84112496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1972 12:34:56 die xxxi mensis viii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2441561 08 viii 8 08/31/1972 die xxxi mensis viii annoque mcmlxxii 72 lxxii 1972} test clock-2.1025 {conversion of 1972-09-01} { clock format 84198896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1972 12:34:56 die i mensis ix annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2441562 09 ix 9 09/01/1972 die i mensis ix annoque mcmlxxii 72 lxxii 1972} test clock-2.1026 {conversion of 1972-09-30} { clock format 86704496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1972 12:34:56 die xxx mensis ix annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2441591 09 ix 9 09/30/1972 die xxx mensis ix annoque mcmlxxii 72 lxxii 1972} test clock-2.1027 {conversion of 1972-10-01} { clock format 86790896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1972 12:34:56 die i mensis x annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2441592 10 x 10 10/01/1972 die i mensis x annoque mcmlxxii 72 lxxii 1972} test clock-2.1028 {conversion of 1972-10-31} { clock format 89382896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1972 12:34:56 die xxxi mensis x annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2441622 10 x 10 10/31/1972 die xxxi mensis x annoque mcmlxxii 72 lxxii 1972} test clock-2.1029 {conversion of 1972-11-01} { clock format 89469296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1972 12:34:56 die i mensis xi annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2441623 11 xi 11 11/01/1972 die i mensis xi annoque mcmlxxii 72 lxxii 1972} test clock-2.1030 {conversion of 1972-11-30} { clock format 91974896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1972 12:34:56 die xxx mensis xi annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2441652 11 xi 11 11/30/1972 die xxx mensis xi annoque mcmlxxii 72 lxxii 1972} test clock-2.1031 {conversion of 1972-12-01} { clock format 92061296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1972 12:34:56 die i mensis xii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2441653 12 xii 12 12/01/1972 die i mensis xii annoque mcmlxxii 72 lxxii 1972} test clock-2.1032 {conversion of 1972-12-31} { clock format 94653296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1972 12:34:56 die xxxi mensis xii annoque mcmlxxii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2441683 12 xii 12 12/31/1972 die xxxi mensis xii annoque mcmlxxii 72 lxxii 1972} test clock-2.1033 {conversion of 1973-01-01} { clock format 94739696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1973 12:34:56 die i mensis i annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2441684 01 i 1 01/01/1973 die i mensis i annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1034 {conversion of 1973-01-31} { clock format 97331696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1973 12:34:56 die xxxi mensis i annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2441714 01 i 1 01/31/1973 die xxxi mensis i annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1035 {conversion of 1973-02-01} { clock format 97418096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1973 12:34:56 die i mensis ii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2441715 02 ii 2 02/01/1973 die i mensis ii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1036 {conversion of 1973-02-28} { clock format 99750896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1973 12:34:56 die xxviii mensis ii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2441742 02 ii 2 02/28/1973 die xxviii mensis ii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1037 {conversion of 1973-03-01} { clock format 99837296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1973 12:34:56 die i mensis iii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2441743 03 iii 3 03/01/1973 die i mensis iii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1038 {conversion of 1973-03-31} { clock format 102429296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1973 12:34:56 die xxxi mensis iii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2441773 03 iii 3 03/31/1973 die xxxi mensis iii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1039 {conversion of 1973-04-01} { clock format 102515696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1973 12:34:56 die i mensis iv annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2441774 04 iv 4 04/01/1973 die i mensis iv annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1040 {conversion of 1973-04-30} { clock format 105021296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1973 12:34:56 die xxx mensis iv annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2441803 04 iv 4 04/30/1973 die xxx mensis iv annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1041 {conversion of 1973-05-01} { clock format 105107696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1973 12:34:56 die i mensis v annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2441804 05 v 5 05/01/1973 die i mensis v annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1042 {conversion of 1973-05-31} { clock format 107699696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1973 12:34:56 die xxxi mensis v annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2441834 05 v 5 05/31/1973 die xxxi mensis v annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1043 {conversion of 1973-06-01} { clock format 107786096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1973 12:34:56 die i mensis vi annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2441835 06 vi 6 06/01/1973 die i mensis vi annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1044 {conversion of 1973-06-30} { clock format 110291696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1973 12:34:56 die xxx mensis vi annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2441864 06 vi 6 06/30/1973 die xxx mensis vi annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1045 {conversion of 1973-07-01} { clock format 110378096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1973 12:34:56 die i mensis vii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2441865 07 vii 7 07/01/1973 die i mensis vii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1046 {conversion of 1973-07-31} { clock format 112970096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1973 12:34:56 die xxxi mensis vii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2441895 07 vii 7 07/31/1973 die xxxi mensis vii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1047 {conversion of 1973-08-01} { clock format 113056496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1973 12:34:56 die i mensis viii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2441896 08 viii 8 08/01/1973 die i mensis viii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1048 {conversion of 1973-08-31} { clock format 115648496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1973 12:34:56 die xxxi mensis viii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2441926 08 viii 8 08/31/1973 die xxxi mensis viii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1049 {conversion of 1973-09-01} { clock format 115734896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1973 12:34:56 die i mensis ix annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2441927 09 ix 9 09/01/1973 die i mensis ix annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1050 {conversion of 1973-09-30} { clock format 118240496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1973 12:34:56 die xxx mensis ix annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2441956 09 ix 9 09/30/1973 die xxx mensis ix annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1051 {conversion of 1973-10-01} { clock format 118326896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1973 12:34:56 die i mensis x annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2441957 10 x 10 10/01/1973 die i mensis x annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1052 {conversion of 1973-10-31} { clock format 120918896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1973 12:34:56 die xxxi mensis x annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2441987 10 x 10 10/31/1973 die xxxi mensis x annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1053 {conversion of 1973-11-01} { clock format 121005296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1973 12:34:56 die i mensis xi annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2441988 11 xi 11 11/01/1973 die i mensis xi annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1054 {conversion of 1973-11-30} { clock format 123510896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1973 12:34:56 die xxx mensis xi annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2442017 11 xi 11 11/30/1973 die xxx mensis xi annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1055 {conversion of 1973-12-01} { clock format 123597296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1973 12:34:56 die i mensis xii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2442018 12 xii 12 12/01/1973 die i mensis xii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1056 {conversion of 1973-12-31} { clock format 126189296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1973 12:34:56 die xxxi mensis xii annoque mcmlxxiii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2442048 12 xii 12 12/31/1973 die xxxi mensis xii annoque mcmlxxiii 73 lxxiii 1973} test clock-2.1057 {conversion of 1974-01-01} { clock format 126275696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1974 12:34:56 die i mensis i annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2442049 01 i 1 01/01/1974 die i mensis i annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1058 {conversion of 1974-01-31} { clock format 128867696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1974 12:34:56 die xxxi mensis i annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2442079 01 i 1 01/31/1974 die xxxi mensis i annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1059 {conversion of 1974-02-01} { clock format 128954096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1974 12:34:56 die i mensis ii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2442080 02 ii 2 02/01/1974 die i mensis ii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1060 {conversion of 1974-02-28} { clock format 131286896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1974 12:34:56 die xxviii mensis ii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2442107 02 ii 2 02/28/1974 die xxviii mensis ii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1061 {conversion of 1974-03-01} { clock format 131373296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1974 12:34:56 die i mensis iii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2442108 03 iii 3 03/01/1974 die i mensis iii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1062 {conversion of 1974-03-31} { clock format 133965296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1974 12:34:56 die xxxi mensis iii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2442138 03 iii 3 03/31/1974 die xxxi mensis iii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1063 {conversion of 1974-04-01} { clock format 134051696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1974 12:34:56 die i mensis iv annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2442139 04 iv 4 04/01/1974 die i mensis iv annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1064 {conversion of 1974-04-30} { clock format 136557296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1974 12:34:56 die xxx mensis iv annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2442168 04 iv 4 04/30/1974 die xxx mensis iv annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1065 {conversion of 1974-05-01} { clock format 136643696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1974 12:34:56 die i mensis v annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2442169 05 v 5 05/01/1974 die i mensis v annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1066 {conversion of 1974-05-31} { clock format 139235696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1974 12:34:56 die xxxi mensis v annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2442199 05 v 5 05/31/1974 die xxxi mensis v annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1067 {conversion of 1974-06-01} { clock format 139322096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1974 12:34:56 die i mensis vi annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2442200 06 vi 6 06/01/1974 die i mensis vi annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1068 {conversion of 1974-06-30} { clock format 141827696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1974 12:34:56 die xxx mensis vi annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2442229 06 vi 6 06/30/1974 die xxx mensis vi annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1069 {conversion of 1974-07-01} { clock format 141914096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1974 12:34:56 die i mensis vii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2442230 07 vii 7 07/01/1974 die i mensis vii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1070 {conversion of 1974-07-31} { clock format 144506096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1974 12:34:56 die xxxi mensis vii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2442260 07 vii 7 07/31/1974 die xxxi mensis vii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1071 {conversion of 1974-08-01} { clock format 144592496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1974 12:34:56 die i mensis viii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2442261 08 viii 8 08/01/1974 die i mensis viii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1072 {conversion of 1974-08-31} { clock format 147184496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1974 12:34:56 die xxxi mensis viii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2442291 08 viii 8 08/31/1974 die xxxi mensis viii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1073 {conversion of 1974-09-01} { clock format 147270896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1974 12:34:56 die i mensis ix annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2442292 09 ix 9 09/01/1974 die i mensis ix annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1074 {conversion of 1974-09-30} { clock format 149776496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1974 12:34:56 die xxx mensis ix annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2442321 09 ix 9 09/30/1974 die xxx mensis ix annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1075 {conversion of 1974-10-01} { clock format 149862896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1974 12:34:56 die i mensis x annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2442322 10 x 10 10/01/1974 die i mensis x annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1076 {conversion of 1974-10-31} { clock format 152454896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1974 12:34:56 die xxxi mensis x annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2442352 10 x 10 10/31/1974 die xxxi mensis x annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1077 {conversion of 1974-11-01} { clock format 152541296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1974 12:34:56 die i mensis xi annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2442353 11 xi 11 11/01/1974 die i mensis xi annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1078 {conversion of 1974-11-30} { clock format 155046896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1974 12:34:56 die xxx mensis xi annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2442382 11 xi 11 11/30/1974 die xxx mensis xi annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1079 {conversion of 1974-12-01} { clock format 155133296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1974 12:34:56 die i mensis xii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2442383 12 xii 12 12/01/1974 die i mensis xii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1080 {conversion of 1974-12-31} { clock format 157725296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1974 12:34:56 die xxxi mensis xii annoque mcmlxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2442413 12 xii 12 12/31/1974 die xxxi mensis xii annoque mcmlxxiv 74 lxxiv 1974} test clock-2.1081 {conversion of 1975-01-01} { clock format 157811696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1975 12:34:56 die i mensis i annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2442414 01 i 1 01/01/1975 die i mensis i annoque mcmlxxv 75 lxxv 1975} test clock-2.1082 {conversion of 1975-01-31} { clock format 160403696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1975 12:34:56 die xxxi mensis i annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2442444 01 i 1 01/31/1975 die xxxi mensis i annoque mcmlxxv 75 lxxv 1975} test clock-2.1083 {conversion of 1975-02-01} { clock format 160490096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1975 12:34:56 die i mensis ii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2442445 02 ii 2 02/01/1975 die i mensis ii annoque mcmlxxv 75 lxxv 1975} test clock-2.1084 {conversion of 1975-02-28} { clock format 162822896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1975 12:34:56 die xxviii mensis ii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2442472 02 ii 2 02/28/1975 die xxviii mensis ii annoque mcmlxxv 75 lxxv 1975} test clock-2.1085 {conversion of 1975-03-01} { clock format 162909296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1975 12:34:56 die i mensis iii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2442473 03 iii 3 03/01/1975 die i mensis iii annoque mcmlxxv 75 lxxv 1975} test clock-2.1086 {conversion of 1975-03-31} { clock format 165501296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1975 12:34:56 die xxxi mensis iii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2442503 03 iii 3 03/31/1975 die xxxi mensis iii annoque mcmlxxv 75 lxxv 1975} test clock-2.1087 {conversion of 1975-04-01} { clock format 165587696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1975 12:34:56 die i mensis iv annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2442504 04 iv 4 04/01/1975 die i mensis iv annoque mcmlxxv 75 lxxv 1975} test clock-2.1088 {conversion of 1975-04-30} { clock format 168093296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1975 12:34:56 die xxx mensis iv annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2442533 04 iv 4 04/30/1975 die xxx mensis iv annoque mcmlxxv 75 lxxv 1975} test clock-2.1089 {conversion of 1975-05-01} { clock format 168179696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1975 12:34:56 die i mensis v annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2442534 05 v 5 05/01/1975 die i mensis v annoque mcmlxxv 75 lxxv 1975} test clock-2.1090 {conversion of 1975-05-31} { clock format 170771696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1975 12:34:56 die xxxi mensis v annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2442564 05 v 5 05/31/1975 die xxxi mensis v annoque mcmlxxv 75 lxxv 1975} test clock-2.1091 {conversion of 1975-06-01} { clock format 170858096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1975 12:34:56 die i mensis vi annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2442565 06 vi 6 06/01/1975 die i mensis vi annoque mcmlxxv 75 lxxv 1975} test clock-2.1092 {conversion of 1975-06-30} { clock format 173363696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1975 12:34:56 die xxx mensis vi annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2442594 06 vi 6 06/30/1975 die xxx mensis vi annoque mcmlxxv 75 lxxv 1975} test clock-2.1093 {conversion of 1975-07-01} { clock format 173450096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1975 12:34:56 die i mensis vii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2442595 07 vii 7 07/01/1975 die i mensis vii annoque mcmlxxv 75 lxxv 1975} test clock-2.1094 {conversion of 1975-07-31} { clock format 176042096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1975 12:34:56 die xxxi mensis vii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2442625 07 vii 7 07/31/1975 die xxxi mensis vii annoque mcmlxxv 75 lxxv 1975} test clock-2.1095 {conversion of 1975-08-01} { clock format 176128496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1975 12:34:56 die i mensis viii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2442626 08 viii 8 08/01/1975 die i mensis viii annoque mcmlxxv 75 lxxv 1975} test clock-2.1096 {conversion of 1975-08-31} { clock format 178720496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1975 12:34:56 die xxxi mensis viii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2442656 08 viii 8 08/31/1975 die xxxi mensis viii annoque mcmlxxv 75 lxxv 1975} test clock-2.1097 {conversion of 1975-09-01} { clock format 178806896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1975 12:34:56 die i mensis ix annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2442657 09 ix 9 09/01/1975 die i mensis ix annoque mcmlxxv 75 lxxv 1975} test clock-2.1098 {conversion of 1975-09-30} { clock format 181312496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1975 12:34:56 die xxx mensis ix annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2442686 09 ix 9 09/30/1975 die xxx mensis ix annoque mcmlxxv 75 lxxv 1975} test clock-2.1099 {conversion of 1975-10-01} { clock format 181398896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1975 12:34:56 die i mensis x annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2442687 10 x 10 10/01/1975 die i mensis x annoque mcmlxxv 75 lxxv 1975} test clock-2.1100 {conversion of 1975-10-31} { clock format 183990896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1975 12:34:56 die xxxi mensis x annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2442717 10 x 10 10/31/1975 die xxxi mensis x annoque mcmlxxv 75 lxxv 1975} test clock-2.1101 {conversion of 1975-11-01} { clock format 184077296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1975 12:34:56 die i mensis xi annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2442718 11 xi 11 11/01/1975 die i mensis xi annoque mcmlxxv 75 lxxv 1975} test clock-2.1102 {conversion of 1975-11-30} { clock format 186582896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1975 12:34:56 die xxx mensis xi annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2442747 11 xi 11 11/30/1975 die xxx mensis xi annoque mcmlxxv 75 lxxv 1975} test clock-2.1103 {conversion of 1975-12-01} { clock format 186669296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1975 12:34:56 die i mensis xii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2442748 12 xii 12 12/01/1975 die i mensis xii annoque mcmlxxv 75 lxxv 1975} test clock-2.1104 {conversion of 1975-12-31} { clock format 189261296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1975 12:34:56 die xxxi mensis xii annoque mcmlxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2442778 12 xii 12 12/31/1975 die xxxi mensis xii annoque mcmlxxv 75 lxxv 1975} test clock-2.1105 {conversion of 1976-01-01} { clock format 189347696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1976 12:34:56 die i mensis i annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2442779 01 i 1 01/01/1976 die i mensis i annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1106 {conversion of 1976-01-31} { clock format 191939696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1976 12:34:56 die xxxi mensis i annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2442809 01 i 1 01/31/1976 die xxxi mensis i annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1107 {conversion of 1976-02-01} { clock format 192026096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1976 12:34:56 die i mensis ii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2442810 02 ii 2 02/01/1976 die i mensis ii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1108 {conversion of 1976-02-29} { clock format 194445296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1976 12:34:56 die xxix mensis ii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2442838 02 ii 2 02/29/1976 die xxix mensis ii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1109 {conversion of 1976-03-01} { clock format 194531696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1976 12:34:56 die i mensis iii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2442839 03 iii 3 03/01/1976 die i mensis iii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1110 {conversion of 1976-03-31} { clock format 197123696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1976 12:34:56 die xxxi mensis iii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2442869 03 iii 3 03/31/1976 die xxxi mensis iii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1111 {conversion of 1976-04-01} { clock format 197210096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1976 12:34:56 die i mensis iv annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2442870 04 iv 4 04/01/1976 die i mensis iv annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1112 {conversion of 1976-04-30} { clock format 199715696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1976 12:34:56 die xxx mensis iv annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2442899 04 iv 4 04/30/1976 die xxx mensis iv annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1113 {conversion of 1976-05-01} { clock format 199802096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1976 12:34:56 die i mensis v annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2442900 05 v 5 05/01/1976 die i mensis v annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1114 {conversion of 1976-05-31} { clock format 202394096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1976 12:34:56 die xxxi mensis v annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2442930 05 v 5 05/31/1976 die xxxi mensis v annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1115 {conversion of 1976-06-01} { clock format 202480496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1976 12:34:56 die i mensis vi annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2442931 06 vi 6 06/01/1976 die i mensis vi annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1116 {conversion of 1976-06-30} { clock format 204986096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1976 12:34:56 die xxx mensis vi annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2442960 06 vi 6 06/30/1976 die xxx mensis vi annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1117 {conversion of 1976-07-01} { clock format 205072496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1976 12:34:56 die i mensis vii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2442961 07 vii 7 07/01/1976 die i mensis vii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1118 {conversion of 1976-07-31} { clock format 207664496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1976 12:34:56 die xxxi mensis vii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2442991 07 vii 7 07/31/1976 die xxxi mensis vii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1119 {conversion of 1976-08-01} { clock format 207750896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1976 12:34:56 die i mensis viii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2442992 08 viii 8 08/01/1976 die i mensis viii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1120 {conversion of 1976-08-31} { clock format 210342896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1976 12:34:56 die xxxi mensis viii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2443022 08 viii 8 08/31/1976 die xxxi mensis viii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1121 {conversion of 1976-09-01} { clock format 210429296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1976 12:34:56 die i mensis ix annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2443023 09 ix 9 09/01/1976 die i mensis ix annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1122 {conversion of 1976-09-30} { clock format 212934896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1976 12:34:56 die xxx mensis ix annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2443052 09 ix 9 09/30/1976 die xxx mensis ix annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1123 {conversion of 1976-10-01} { clock format 213021296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1976 12:34:56 die i mensis x annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2443053 10 x 10 10/01/1976 die i mensis x annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1124 {conversion of 1976-10-31} { clock format 215613296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1976 12:34:56 die xxxi mensis x annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2443083 10 x 10 10/31/1976 die xxxi mensis x annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1125 {conversion of 1976-11-01} { clock format 215699696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1976 12:34:56 die i mensis xi annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2443084 11 xi 11 11/01/1976 die i mensis xi annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1126 {conversion of 1976-11-30} { clock format 218205296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1976 12:34:56 die xxx mensis xi annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2443113 11 xi 11 11/30/1976 die xxx mensis xi annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1127 {conversion of 1976-12-01} { clock format 218291696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1976 12:34:56 die i mensis xii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2443114 12 xii 12 12/01/1976 die i mensis xii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1128 {conversion of 1976-12-31} { clock format 220883696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1976 12:34:56 die xxxi mensis xii annoque mcmlxxvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2443144 12 xii 12 12/31/1976 die xxxi mensis xii annoque mcmlxxvi 76 lxxvi 1976} test clock-2.1129 {conversion of 1977-01-01} { clock format 220970096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1977 12:34:56 die i mensis i annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2443145 01 i 1 01/01/1977 die i mensis i annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1130 {conversion of 1977-01-31} { clock format 223562096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1977 12:34:56 die xxxi mensis i annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2443175 01 i 1 01/31/1977 die xxxi mensis i annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1131 {conversion of 1977-02-01} { clock format 223648496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1977 12:34:56 die i mensis ii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2443176 02 ii 2 02/01/1977 die i mensis ii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1132 {conversion of 1977-02-28} { clock format 225981296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1977 12:34:56 die xxviii mensis ii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2443203 02 ii 2 02/28/1977 die xxviii mensis ii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1133 {conversion of 1977-03-01} { clock format 226067696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1977 12:34:56 die i mensis iii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2443204 03 iii 3 03/01/1977 die i mensis iii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1134 {conversion of 1977-03-31} { clock format 228659696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1977 12:34:56 die xxxi mensis iii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2443234 03 iii 3 03/31/1977 die xxxi mensis iii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1135 {conversion of 1977-04-01} { clock format 228746096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1977 12:34:56 die i mensis iv annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2443235 04 iv 4 04/01/1977 die i mensis iv annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1136 {conversion of 1977-04-30} { clock format 231251696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1977 12:34:56 die xxx mensis iv annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2443264 04 iv 4 04/30/1977 die xxx mensis iv annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1137 {conversion of 1977-05-01} { clock format 231338096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1977 12:34:56 die i mensis v annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2443265 05 v 5 05/01/1977 die i mensis v annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1138 {conversion of 1977-05-31} { clock format 233930096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1977 12:34:56 die xxxi mensis v annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2443295 05 v 5 05/31/1977 die xxxi mensis v annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1139 {conversion of 1977-06-01} { clock format 234016496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1977 12:34:56 die i mensis vi annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2443296 06 vi 6 06/01/1977 die i mensis vi annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1140 {conversion of 1977-06-30} { clock format 236522096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1977 12:34:56 die xxx mensis vi annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2443325 06 vi 6 06/30/1977 die xxx mensis vi annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1141 {conversion of 1977-07-01} { clock format 236608496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1977 12:34:56 die i mensis vii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2443326 07 vii 7 07/01/1977 die i mensis vii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1142 {conversion of 1977-07-31} { clock format 239200496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1977 12:34:56 die xxxi mensis vii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2443356 07 vii 7 07/31/1977 die xxxi mensis vii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1143 {conversion of 1977-08-01} { clock format 239286896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1977 12:34:56 die i mensis viii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2443357 08 viii 8 08/01/1977 die i mensis viii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1144 {conversion of 1977-08-31} { clock format 241878896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1977 12:34:56 die xxxi mensis viii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2443387 08 viii 8 08/31/1977 die xxxi mensis viii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1145 {conversion of 1977-09-01} { clock format 241965296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1977 12:34:56 die i mensis ix annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2443388 09 ix 9 09/01/1977 die i mensis ix annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1146 {conversion of 1977-09-30} { clock format 244470896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1977 12:34:56 die xxx mensis ix annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2443417 09 ix 9 09/30/1977 die xxx mensis ix annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1147 {conversion of 1977-10-01} { clock format 244557296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1977 12:34:56 die i mensis x annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2443418 10 x 10 10/01/1977 die i mensis x annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1148 {conversion of 1977-10-31} { clock format 247149296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1977 12:34:56 die xxxi mensis x annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2443448 10 x 10 10/31/1977 die xxxi mensis x annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1149 {conversion of 1977-11-01} { clock format 247235696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1977 12:34:56 die i mensis xi annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2443449 11 xi 11 11/01/1977 die i mensis xi annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1150 {conversion of 1977-11-30} { clock format 249741296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1977 12:34:56 die xxx mensis xi annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2443478 11 xi 11 11/30/1977 die xxx mensis xi annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1151 {conversion of 1977-12-01} { clock format 249827696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1977 12:34:56 die i mensis xii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2443479 12 xii 12 12/01/1977 die i mensis xii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1152 {conversion of 1977-12-31} { clock format 252419696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1977 12:34:56 die xxxi mensis xii annoque mcmlxxvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2443509 12 xii 12 12/31/1977 die xxxi mensis xii annoque mcmlxxvii 77 lxxvii 1977} test clock-2.1153 {conversion of 1978-01-01} { clock format 252506096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1978 12:34:56 die i mensis i annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2443510 01 i 1 01/01/1978 die i mensis i annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1154 {conversion of 1978-01-31} { clock format 255098096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1978 12:34:56 die xxxi mensis i annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2443540 01 i 1 01/31/1978 die xxxi mensis i annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1155 {conversion of 1978-02-01} { clock format 255184496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1978 12:34:56 die i mensis ii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2443541 02 ii 2 02/01/1978 die i mensis ii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1156 {conversion of 1978-02-28} { clock format 257517296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1978 12:34:56 die xxviii mensis ii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2443568 02 ii 2 02/28/1978 die xxviii mensis ii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1157 {conversion of 1978-03-01} { clock format 257603696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1978 12:34:56 die i mensis iii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2443569 03 iii 3 03/01/1978 die i mensis iii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1158 {conversion of 1978-03-31} { clock format 260195696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1978 12:34:56 die xxxi mensis iii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2443599 03 iii 3 03/31/1978 die xxxi mensis iii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1159 {conversion of 1978-04-01} { clock format 260282096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1978 12:34:56 die i mensis iv annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2443600 04 iv 4 04/01/1978 die i mensis iv annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1160 {conversion of 1978-04-30} { clock format 262787696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1978 12:34:56 die xxx mensis iv annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2443629 04 iv 4 04/30/1978 die xxx mensis iv annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1161 {conversion of 1978-05-01} { clock format 262874096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1978 12:34:56 die i mensis v annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2443630 05 v 5 05/01/1978 die i mensis v annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1162 {conversion of 1978-05-31} { clock format 265466096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1978 12:34:56 die xxxi mensis v annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2443660 05 v 5 05/31/1978 die xxxi mensis v annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1163 {conversion of 1978-06-01} { clock format 265552496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1978 12:34:56 die i mensis vi annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2443661 06 vi 6 06/01/1978 die i mensis vi annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1164 {conversion of 1978-06-30} { clock format 268058096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1978 12:34:56 die xxx mensis vi annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2443690 06 vi 6 06/30/1978 die xxx mensis vi annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1165 {conversion of 1978-07-01} { clock format 268144496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1978 12:34:56 die i mensis vii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2443691 07 vii 7 07/01/1978 die i mensis vii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1166 {conversion of 1978-07-31} { clock format 270736496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1978 12:34:56 die xxxi mensis vii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2443721 07 vii 7 07/31/1978 die xxxi mensis vii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1167 {conversion of 1978-08-01} { clock format 270822896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1978 12:34:56 die i mensis viii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2443722 08 viii 8 08/01/1978 die i mensis viii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1168 {conversion of 1978-08-31} { clock format 273414896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1978 12:34:56 die xxxi mensis viii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2443752 08 viii 8 08/31/1978 die xxxi mensis viii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1169 {conversion of 1978-09-01} { clock format 273501296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1978 12:34:56 die i mensis ix annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2443753 09 ix 9 09/01/1978 die i mensis ix annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1170 {conversion of 1978-09-30} { clock format 276006896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1978 12:34:56 die xxx mensis ix annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2443782 09 ix 9 09/30/1978 die xxx mensis ix annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1171 {conversion of 1978-10-01} { clock format 276093296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1978 12:34:56 die i mensis x annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2443783 10 x 10 10/01/1978 die i mensis x annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1172 {conversion of 1978-10-31} { clock format 278685296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1978 12:34:56 die xxxi mensis x annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2443813 10 x 10 10/31/1978 die xxxi mensis x annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1173 {conversion of 1978-11-01} { clock format 278771696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1978 12:34:56 die i mensis xi annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2443814 11 xi 11 11/01/1978 die i mensis xi annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1174 {conversion of 1978-11-30} { clock format 281277296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1978 12:34:56 die xxx mensis xi annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2443843 11 xi 11 11/30/1978 die xxx mensis xi annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1175 {conversion of 1978-12-01} { clock format 281363696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1978 12:34:56 die i mensis xii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2443844 12 xii 12 12/01/1978 die i mensis xii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1176 {conversion of 1978-12-31} { clock format 283955696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1978 12:34:56 die xxxi mensis xii annoque mcmlxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2443874 12 xii 12 12/31/1978 die xxxi mensis xii annoque mcmlxxviii 78 lxxviii 1978} test clock-2.1177 {conversion of 1979-01-01} { clock format 284042096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1979 12:34:56 die i mensis i annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2443875 01 i 1 01/01/1979 die i mensis i annoque mcmlxxix 79 lxxix 1979} test clock-2.1178 {conversion of 1979-01-31} { clock format 286634096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1979 12:34:56 die xxxi mensis i annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2443905 01 i 1 01/31/1979 die xxxi mensis i annoque mcmlxxix 79 lxxix 1979} test clock-2.1179 {conversion of 1979-02-01} { clock format 286720496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1979 12:34:56 die i mensis ii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2443906 02 ii 2 02/01/1979 die i mensis ii annoque mcmlxxix 79 lxxix 1979} test clock-2.1180 {conversion of 1979-02-28} { clock format 289053296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1979 12:34:56 die xxviii mensis ii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2443933 02 ii 2 02/28/1979 die xxviii mensis ii annoque mcmlxxix 79 lxxix 1979} test clock-2.1181 {conversion of 1979-03-01} { clock format 289139696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1979 12:34:56 die i mensis iii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2443934 03 iii 3 03/01/1979 die i mensis iii annoque mcmlxxix 79 lxxix 1979} test clock-2.1182 {conversion of 1979-03-31} { clock format 291731696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1979 12:34:56 die xxxi mensis iii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2443964 03 iii 3 03/31/1979 die xxxi mensis iii annoque mcmlxxix 79 lxxix 1979} test clock-2.1183 {conversion of 1979-04-01} { clock format 291818096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1979 12:34:56 die i mensis iv annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2443965 04 iv 4 04/01/1979 die i mensis iv annoque mcmlxxix 79 lxxix 1979} test clock-2.1184 {conversion of 1979-04-30} { clock format 294323696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1979 12:34:56 die xxx mensis iv annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2443994 04 iv 4 04/30/1979 die xxx mensis iv annoque mcmlxxix 79 lxxix 1979} test clock-2.1185 {conversion of 1979-05-01} { clock format 294410096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1979 12:34:56 die i mensis v annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2443995 05 v 5 05/01/1979 die i mensis v annoque mcmlxxix 79 lxxix 1979} test clock-2.1186 {conversion of 1979-05-31} { clock format 297002096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1979 12:34:56 die xxxi mensis v annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2444025 05 v 5 05/31/1979 die xxxi mensis v annoque mcmlxxix 79 lxxix 1979} test clock-2.1187 {conversion of 1979-06-01} { clock format 297088496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1979 12:34:56 die i mensis vi annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2444026 06 vi 6 06/01/1979 die i mensis vi annoque mcmlxxix 79 lxxix 1979} test clock-2.1188 {conversion of 1979-06-30} { clock format 299594096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1979 12:34:56 die xxx mensis vi annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2444055 06 vi 6 06/30/1979 die xxx mensis vi annoque mcmlxxix 79 lxxix 1979} test clock-2.1189 {conversion of 1979-07-01} { clock format 299680496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1979 12:34:56 die i mensis vii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2444056 07 vii 7 07/01/1979 die i mensis vii annoque mcmlxxix 79 lxxix 1979} test clock-2.1190 {conversion of 1979-07-31} { clock format 302272496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1979 12:34:56 die xxxi mensis vii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2444086 07 vii 7 07/31/1979 die xxxi mensis vii annoque mcmlxxix 79 lxxix 1979} test clock-2.1191 {conversion of 1979-08-01} { clock format 302358896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1979 12:34:56 die i mensis viii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2444087 08 viii 8 08/01/1979 die i mensis viii annoque mcmlxxix 79 lxxix 1979} test clock-2.1192 {conversion of 1979-08-31} { clock format 304950896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1979 12:34:56 die xxxi mensis viii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2444117 08 viii 8 08/31/1979 die xxxi mensis viii annoque mcmlxxix 79 lxxix 1979} test clock-2.1193 {conversion of 1979-09-01} { clock format 305037296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1979 12:34:56 die i mensis ix annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2444118 09 ix 9 09/01/1979 die i mensis ix annoque mcmlxxix 79 lxxix 1979} test clock-2.1194 {conversion of 1979-09-30} { clock format 307542896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1979 12:34:56 die xxx mensis ix annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2444147 09 ix 9 09/30/1979 die xxx mensis ix annoque mcmlxxix 79 lxxix 1979} test clock-2.1195 {conversion of 1979-10-01} { clock format 307629296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1979 12:34:56 die i mensis x annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2444148 10 x 10 10/01/1979 die i mensis x annoque mcmlxxix 79 lxxix 1979} test clock-2.1196 {conversion of 1979-10-31} { clock format 310221296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1979 12:34:56 die xxxi mensis x annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2444178 10 x 10 10/31/1979 die xxxi mensis x annoque mcmlxxix 79 lxxix 1979} test clock-2.1197 {conversion of 1979-11-01} { clock format 310307696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1979 12:34:56 die i mensis xi annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2444179 11 xi 11 11/01/1979 die i mensis xi annoque mcmlxxix 79 lxxix 1979} test clock-2.1198 {conversion of 1979-11-30} { clock format 312813296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1979 12:34:56 die xxx mensis xi annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2444208 11 xi 11 11/30/1979 die xxx mensis xi annoque mcmlxxix 79 lxxix 1979} test clock-2.1199 {conversion of 1979-12-01} { clock format 312899696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1979 12:34:56 die i mensis xii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2444209 12 xii 12 12/01/1979 die i mensis xii annoque mcmlxxix 79 lxxix 1979} test clock-2.1200 {conversion of 1979-12-31} { clock format 315491696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1979 12:34:56 die xxxi mensis xii annoque mcmlxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2444239 12 xii 12 12/31/1979 die xxxi mensis xii annoque mcmlxxix 79 lxxix 1979} test clock-2.1201 {conversion of 1980-01-01} { clock format 315578096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1980 12:34:56 die i mensis i annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2444240 01 i 1 01/01/1980 die i mensis i annoque mcmlxxx 80 lxxx 1980} test clock-2.1202 {conversion of 1980-01-31} { clock format 318170096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1980 12:34:56 die xxxi mensis i annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2444270 01 i 1 01/31/1980 die xxxi mensis i annoque mcmlxxx 80 lxxx 1980} test clock-2.1203 {conversion of 1980-02-01} { clock format 318256496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1980 12:34:56 die i mensis ii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2444271 02 ii 2 02/01/1980 die i mensis ii annoque mcmlxxx 80 lxxx 1980} test clock-2.1204 {conversion of 1980-02-29} { clock format 320675696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1980 12:34:56 die xxix mensis ii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2444299 02 ii 2 02/29/1980 die xxix mensis ii annoque mcmlxxx 80 lxxx 1980} test clock-2.1205 {conversion of 1980-03-01} { clock format 320762096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1980 12:34:56 die i mensis iii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2444300 03 iii 3 03/01/1980 die i mensis iii annoque mcmlxxx 80 lxxx 1980} test clock-2.1206 {conversion of 1980-03-31} { clock format 323354096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1980 12:34:56 die xxxi mensis iii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2444330 03 iii 3 03/31/1980 die xxxi mensis iii annoque mcmlxxx 80 lxxx 1980} test clock-2.1207 {conversion of 1980-04-01} { clock format 323440496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1980 12:34:56 die i mensis iv annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2444331 04 iv 4 04/01/1980 die i mensis iv annoque mcmlxxx 80 lxxx 1980} test clock-2.1208 {conversion of 1980-04-30} { clock format 325946096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1980 12:34:56 die xxx mensis iv annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2444360 04 iv 4 04/30/1980 die xxx mensis iv annoque mcmlxxx 80 lxxx 1980} test clock-2.1209 {conversion of 1980-05-01} { clock format 326032496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1980 12:34:56 die i mensis v annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2444361 05 v 5 05/01/1980 die i mensis v annoque mcmlxxx 80 lxxx 1980} test clock-2.1210 {conversion of 1980-05-31} { clock format 328624496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1980 12:34:56 die xxxi mensis v annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2444391 05 v 5 05/31/1980 die xxxi mensis v annoque mcmlxxx 80 lxxx 1980} test clock-2.1211 {conversion of 1980-06-01} { clock format 328710896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1980 12:34:56 die i mensis vi annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2444392 06 vi 6 06/01/1980 die i mensis vi annoque mcmlxxx 80 lxxx 1980} test clock-2.1212 {conversion of 1980-06-30} { clock format 331216496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1980 12:34:56 die xxx mensis vi annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2444421 06 vi 6 06/30/1980 die xxx mensis vi annoque mcmlxxx 80 lxxx 1980} test clock-2.1213 {conversion of 1980-07-01} { clock format 331302896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1980 12:34:56 die i mensis vii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2444422 07 vii 7 07/01/1980 die i mensis vii annoque mcmlxxx 80 lxxx 1980} test clock-2.1214 {conversion of 1980-07-31} { clock format 333894896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1980 12:34:56 die xxxi mensis vii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2444452 07 vii 7 07/31/1980 die xxxi mensis vii annoque mcmlxxx 80 lxxx 1980} test clock-2.1215 {conversion of 1980-08-01} { clock format 333981296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1980 12:34:56 die i mensis viii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2444453 08 viii 8 08/01/1980 die i mensis viii annoque mcmlxxx 80 lxxx 1980} test clock-2.1216 {conversion of 1980-08-31} { clock format 336573296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1980 12:34:56 die xxxi mensis viii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2444483 08 viii 8 08/31/1980 die xxxi mensis viii annoque mcmlxxx 80 lxxx 1980} test clock-2.1217 {conversion of 1980-09-01} { clock format 336659696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1980 12:34:56 die i mensis ix annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2444484 09 ix 9 09/01/1980 die i mensis ix annoque mcmlxxx 80 lxxx 1980} test clock-2.1218 {conversion of 1980-09-30} { clock format 339165296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1980 12:34:56 die xxx mensis ix annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2444513 09 ix 9 09/30/1980 die xxx mensis ix annoque mcmlxxx 80 lxxx 1980} test clock-2.1219 {conversion of 1980-10-01} { clock format 339251696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1980 12:34:56 die i mensis x annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2444514 10 x 10 10/01/1980 die i mensis x annoque mcmlxxx 80 lxxx 1980} test clock-2.1220 {conversion of 1980-10-31} { clock format 341843696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1980 12:34:56 die xxxi mensis x annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2444544 10 x 10 10/31/1980 die xxxi mensis x annoque mcmlxxx 80 lxxx 1980} test clock-2.1221 {conversion of 1980-11-01} { clock format 341930096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1980 12:34:56 die i mensis xi annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2444545 11 xi 11 11/01/1980 die i mensis xi annoque mcmlxxx 80 lxxx 1980} test clock-2.1222 {conversion of 1980-11-30} { clock format 344435696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1980 12:34:56 die xxx mensis xi annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2444574 11 xi 11 11/30/1980 die xxx mensis xi annoque mcmlxxx 80 lxxx 1980} test clock-2.1223 {conversion of 1980-12-01} { clock format 344522096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1980 12:34:56 die i mensis xii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2444575 12 xii 12 12/01/1980 die i mensis xii annoque mcmlxxx 80 lxxx 1980} test clock-2.1224 {conversion of 1980-12-31} { clock format 347114096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1980 12:34:56 die xxxi mensis xii annoque mcmlxxx xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2444605 12 xii 12 12/31/1980 die xxxi mensis xii annoque mcmlxxx 80 lxxx 1980} test clock-2.1225 {conversion of 1981-01-01} { clock format 347200496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1981 12:34:56 die i mensis i annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2444606 01 i 1 01/01/1981 die i mensis i annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1226 {conversion of 1981-01-31} { clock format 349792496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1981 12:34:56 die xxxi mensis i annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2444636 01 i 1 01/31/1981 die xxxi mensis i annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1227 {conversion of 1981-02-01} { clock format 349878896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1981 12:34:56 die i mensis ii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2444637 02 ii 2 02/01/1981 die i mensis ii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1228 {conversion of 1981-02-28} { clock format 352211696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1981 12:34:56 die xxviii mensis ii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2444664 02 ii 2 02/28/1981 die xxviii mensis ii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1229 {conversion of 1981-03-01} { clock format 352298096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1981 12:34:56 die i mensis iii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2444665 03 iii 3 03/01/1981 die i mensis iii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1230 {conversion of 1981-03-31} { clock format 354890096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1981 12:34:56 die xxxi mensis iii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2444695 03 iii 3 03/31/1981 die xxxi mensis iii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1231 {conversion of 1981-04-01} { clock format 354976496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1981 12:34:56 die i mensis iv annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2444696 04 iv 4 04/01/1981 die i mensis iv annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1232 {conversion of 1981-04-30} { clock format 357482096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1981 12:34:56 die xxx mensis iv annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2444725 04 iv 4 04/30/1981 die xxx mensis iv annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1233 {conversion of 1981-05-01} { clock format 357568496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1981 12:34:56 die i mensis v annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2444726 05 v 5 05/01/1981 die i mensis v annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1234 {conversion of 1981-05-31} { clock format 360160496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1981 12:34:56 die xxxi mensis v annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2444756 05 v 5 05/31/1981 die xxxi mensis v annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1235 {conversion of 1981-06-01} { clock format 360246896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1981 12:34:56 die i mensis vi annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2444757 06 vi 6 06/01/1981 die i mensis vi annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1236 {conversion of 1981-06-30} { clock format 362752496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1981 12:34:56 die xxx mensis vi annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2444786 06 vi 6 06/30/1981 die xxx mensis vi annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1237 {conversion of 1981-07-01} { clock format 362838896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1981 12:34:56 die i mensis vii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2444787 07 vii 7 07/01/1981 die i mensis vii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1238 {conversion of 1981-07-31} { clock format 365430896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1981 12:34:56 die xxxi mensis vii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2444817 07 vii 7 07/31/1981 die xxxi mensis vii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1239 {conversion of 1981-08-01} { clock format 365517296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1981 12:34:56 die i mensis viii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2444818 08 viii 8 08/01/1981 die i mensis viii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1240 {conversion of 1981-08-31} { clock format 368109296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1981 12:34:56 die xxxi mensis viii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2444848 08 viii 8 08/31/1981 die xxxi mensis viii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1241 {conversion of 1981-09-01} { clock format 368195696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1981 12:34:56 die i mensis ix annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2444849 09 ix 9 09/01/1981 die i mensis ix annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1242 {conversion of 1981-09-30} { clock format 370701296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1981 12:34:56 die xxx mensis ix annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2444878 09 ix 9 09/30/1981 die xxx mensis ix annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1243 {conversion of 1981-10-01} { clock format 370787696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1981 12:34:56 die i mensis x annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2444879 10 x 10 10/01/1981 die i mensis x annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1244 {conversion of 1981-10-31} { clock format 373379696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1981 12:34:56 die xxxi mensis x annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2444909 10 x 10 10/31/1981 die xxxi mensis x annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1245 {conversion of 1981-11-01} { clock format 373466096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1981 12:34:56 die i mensis xi annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2444910 11 xi 11 11/01/1981 die i mensis xi annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1246 {conversion of 1981-11-30} { clock format 375971696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1981 12:34:56 die xxx mensis xi annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2444939 11 xi 11 11/30/1981 die xxx mensis xi annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1247 {conversion of 1981-12-01} { clock format 376058096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1981 12:34:56 die i mensis xii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2444940 12 xii 12 12/01/1981 die i mensis xii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1248 {conversion of 1981-12-31} { clock format 378650096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1981 12:34:56 die xxxi mensis xii annoque mcmlxxxi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2444970 12 xii 12 12/31/1981 die xxxi mensis xii annoque mcmlxxxi 81 lxxxi 1981} test clock-2.1249 {conversion of 1984-01-01} { clock format 441808496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1984 12:34:56 die i mensis i annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2445701 01 i 1 01/01/1984 die i mensis i annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1250 {conversion of 1984-01-31} { clock format 444400496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1984 12:34:56 die xxxi mensis i annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2445731 01 i 1 01/31/1984 die xxxi mensis i annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1251 {conversion of 1984-02-01} { clock format 444486896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1984 12:34:56 die i mensis ii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2445732 02 ii 2 02/01/1984 die i mensis ii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1252 {conversion of 1984-02-29} { clock format 446906096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1984 12:34:56 die xxix mensis ii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2445760 02 ii 2 02/29/1984 die xxix mensis ii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1253 {conversion of 1984-03-01} { clock format 446992496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1984 12:34:56 die i mensis iii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2445761 03 iii 3 03/01/1984 die i mensis iii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1254 {conversion of 1984-03-31} { clock format 449584496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1984 12:34:56 die xxxi mensis iii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2445791 03 iii 3 03/31/1984 die xxxi mensis iii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1255 {conversion of 1984-04-01} { clock format 449670896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1984 12:34:56 die i mensis iv annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2445792 04 iv 4 04/01/1984 die i mensis iv annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1256 {conversion of 1984-04-30} { clock format 452176496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1984 12:34:56 die xxx mensis iv annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2445821 04 iv 4 04/30/1984 die xxx mensis iv annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1257 {conversion of 1984-05-01} { clock format 452262896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1984 12:34:56 die i mensis v annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2445822 05 v 5 05/01/1984 die i mensis v annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1258 {conversion of 1984-05-31} { clock format 454854896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1984 12:34:56 die xxxi mensis v annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2445852 05 v 5 05/31/1984 die xxxi mensis v annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1259 {conversion of 1984-06-01} { clock format 454941296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1984 12:34:56 die i mensis vi annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2445853 06 vi 6 06/01/1984 die i mensis vi annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1260 {conversion of 1984-06-30} { clock format 457446896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1984 12:34:56 die xxx mensis vi annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2445882 06 vi 6 06/30/1984 die xxx mensis vi annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1261 {conversion of 1984-07-01} { clock format 457533296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1984 12:34:56 die i mensis vii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2445883 07 vii 7 07/01/1984 die i mensis vii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1262 {conversion of 1984-07-31} { clock format 460125296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1984 12:34:56 die xxxi mensis vii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2445913 07 vii 7 07/31/1984 die xxxi mensis vii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1263 {conversion of 1984-08-01} { clock format 460211696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1984 12:34:56 die i mensis viii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2445914 08 viii 8 08/01/1984 die i mensis viii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1264 {conversion of 1984-08-31} { clock format 462803696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1984 12:34:56 die xxxi mensis viii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2445944 08 viii 8 08/31/1984 die xxxi mensis viii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1265 {conversion of 1984-09-01} { clock format 462890096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1984 12:34:56 die i mensis ix annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2445945 09 ix 9 09/01/1984 die i mensis ix annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1266 {conversion of 1984-09-30} { clock format 465395696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1984 12:34:56 die xxx mensis ix annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2445974 09 ix 9 09/30/1984 die xxx mensis ix annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1267 {conversion of 1984-10-01} { clock format 465482096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1984 12:34:56 die i mensis x annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2445975 10 x 10 10/01/1984 die i mensis x annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1268 {conversion of 1984-10-31} { clock format 468074096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1984 12:34:56 die xxxi mensis x annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2446005 10 x 10 10/31/1984 die xxxi mensis x annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1269 {conversion of 1984-11-01} { clock format 468160496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1984 12:34:56 die i mensis xi annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2446006 11 xi 11 11/01/1984 die i mensis xi annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1270 {conversion of 1984-11-30} { clock format 470666096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1984 12:34:56 die xxx mensis xi annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2446035 11 xi 11 11/30/1984 die xxx mensis xi annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1271 {conversion of 1984-12-01} { clock format 470752496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1984 12:34:56 die i mensis xii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2446036 12 xii 12 12/01/1984 die i mensis xii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1272 {conversion of 1984-12-31} { clock format 473344496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1984 12:34:56 die xxxi mensis xii annoque mcmlxxxiv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2446066 12 xii 12 12/31/1984 die xxxi mensis xii annoque mcmlxxxiv 84 lxxxiv 1984} test clock-2.1273 {conversion of 1985-01-01} { clock format 473430896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1985 12:34:56 die i mensis i annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2446067 01 i 1 01/01/1985 die i mensis i annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1274 {conversion of 1985-01-31} { clock format 476022896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1985 12:34:56 die xxxi mensis i annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2446097 01 i 1 01/31/1985 die xxxi mensis i annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1275 {conversion of 1985-02-01} { clock format 476109296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1985 12:34:56 die i mensis ii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2446098 02 ii 2 02/01/1985 die i mensis ii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1276 {conversion of 1985-02-28} { clock format 478442096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1985 12:34:56 die xxviii mensis ii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2446125 02 ii 2 02/28/1985 die xxviii mensis ii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1277 {conversion of 1985-03-01} { clock format 478528496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1985 12:34:56 die i mensis iii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2446126 03 iii 3 03/01/1985 die i mensis iii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1278 {conversion of 1985-03-31} { clock format 481120496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1985 12:34:56 die xxxi mensis iii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2446156 03 iii 3 03/31/1985 die xxxi mensis iii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1279 {conversion of 1985-04-01} { clock format 481206896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1985 12:34:56 die i mensis iv annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2446157 04 iv 4 04/01/1985 die i mensis iv annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1280 {conversion of 1985-04-30} { clock format 483712496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1985 12:34:56 die xxx mensis iv annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2446186 04 iv 4 04/30/1985 die xxx mensis iv annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1281 {conversion of 1985-05-01} { clock format 483798896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1985 12:34:56 die i mensis v annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2446187 05 v 5 05/01/1985 die i mensis v annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1282 {conversion of 1985-05-31} { clock format 486390896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1985 12:34:56 die xxxi mensis v annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2446217 05 v 5 05/31/1985 die xxxi mensis v annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1283 {conversion of 1985-06-01} { clock format 486477296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1985 12:34:56 die i mensis vi annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2446218 06 vi 6 06/01/1985 die i mensis vi annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1284 {conversion of 1985-06-30} { clock format 488982896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1985 12:34:56 die xxx mensis vi annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2446247 06 vi 6 06/30/1985 die xxx mensis vi annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1285 {conversion of 1985-07-01} { clock format 489069296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1985 12:34:56 die i mensis vii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2446248 07 vii 7 07/01/1985 die i mensis vii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1286 {conversion of 1985-07-31} { clock format 491661296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1985 12:34:56 die xxxi mensis vii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2446278 07 vii 7 07/31/1985 die xxxi mensis vii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1287 {conversion of 1985-08-01} { clock format 491747696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1985 12:34:56 die i mensis viii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2446279 08 viii 8 08/01/1985 die i mensis viii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1288 {conversion of 1985-08-31} { clock format 494339696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1985 12:34:56 die xxxi mensis viii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2446309 08 viii 8 08/31/1985 die xxxi mensis viii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1289 {conversion of 1985-09-01} { clock format 494426096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1985 12:34:56 die i mensis ix annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2446310 09 ix 9 09/01/1985 die i mensis ix annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1290 {conversion of 1985-09-30} { clock format 496931696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1985 12:34:56 die xxx mensis ix annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2446339 09 ix 9 09/30/1985 die xxx mensis ix annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1291 {conversion of 1985-10-01} { clock format 497018096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1985 12:34:56 die i mensis x annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2446340 10 x 10 10/01/1985 die i mensis x annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1292 {conversion of 1985-10-31} { clock format 499610096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1985 12:34:56 die xxxi mensis x annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2446370 10 x 10 10/31/1985 die xxxi mensis x annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1293 {conversion of 1985-11-01} { clock format 499696496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1985 12:34:56 die i mensis xi annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2446371 11 xi 11 11/01/1985 die i mensis xi annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1294 {conversion of 1985-11-30} { clock format 502202096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1985 12:34:56 die xxx mensis xi annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2446400 11 xi 11 11/30/1985 die xxx mensis xi annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1295 {conversion of 1985-12-01} { clock format 502288496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1985 12:34:56 die i mensis xii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2446401 12 xii 12 12/01/1985 die i mensis xii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1296 {conversion of 1985-12-31} { clock format 504880496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1985 12:34:56 die xxxi mensis xii annoque mcmlxxxv xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2446431 12 xii 12 12/31/1985 die xxxi mensis xii annoque mcmlxxxv 85 lxxxv 1985} test clock-2.1297 {conversion of 1988-01-01} { clock format 568038896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1988 12:34:56 die i mensis i annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2447162 01 i 1 01/01/1988 die i mensis i annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1298 {conversion of 1988-01-31} { clock format 570630896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1988 12:34:56 die xxxi mensis i annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2447192 01 i 1 01/31/1988 die xxxi mensis i annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1299 {conversion of 1988-02-01} { clock format 570717296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1988 12:34:56 die i mensis ii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2447193 02 ii 2 02/01/1988 die i mensis ii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1300 {conversion of 1988-02-29} { clock format 573136496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1988 12:34:56 die xxix mensis ii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2447221 02 ii 2 02/29/1988 die xxix mensis ii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1301 {conversion of 1988-03-01} { clock format 573222896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1988 12:34:56 die i mensis iii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2447222 03 iii 3 03/01/1988 die i mensis iii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1302 {conversion of 1988-03-31} { clock format 575814896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1988 12:34:56 die xxxi mensis iii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2447252 03 iii 3 03/31/1988 die xxxi mensis iii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1303 {conversion of 1988-04-01} { clock format 575901296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1988 12:34:56 die i mensis iv annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2447253 04 iv 4 04/01/1988 die i mensis iv annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1304 {conversion of 1988-04-30} { clock format 578406896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1988 12:34:56 die xxx mensis iv annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2447282 04 iv 4 04/30/1988 die xxx mensis iv annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1305 {conversion of 1988-05-01} { clock format 578493296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1988 12:34:56 die i mensis v annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2447283 05 v 5 05/01/1988 die i mensis v annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1306 {conversion of 1988-05-31} { clock format 581085296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1988 12:34:56 die xxxi mensis v annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2447313 05 v 5 05/31/1988 die xxxi mensis v annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1307 {conversion of 1988-06-01} { clock format 581171696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1988 12:34:56 die i mensis vi annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2447314 06 vi 6 06/01/1988 die i mensis vi annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1308 {conversion of 1988-06-30} { clock format 583677296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1988 12:34:56 die xxx mensis vi annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2447343 06 vi 6 06/30/1988 die xxx mensis vi annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1309 {conversion of 1988-07-01} { clock format 583763696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1988 12:34:56 die i mensis vii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2447344 07 vii 7 07/01/1988 die i mensis vii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1310 {conversion of 1988-07-31} { clock format 586355696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1988 12:34:56 die xxxi mensis vii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2447374 07 vii 7 07/31/1988 die xxxi mensis vii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1311 {conversion of 1988-08-01} { clock format 586442096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1988 12:34:56 die i mensis viii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2447375 08 viii 8 08/01/1988 die i mensis viii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1312 {conversion of 1988-08-31} { clock format 589034096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1988 12:34:56 die xxxi mensis viii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2447405 08 viii 8 08/31/1988 die xxxi mensis viii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1313 {conversion of 1988-09-01} { clock format 589120496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1988 12:34:56 die i mensis ix annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2447406 09 ix 9 09/01/1988 die i mensis ix annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1314 {conversion of 1988-09-30} { clock format 591626096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1988 12:34:56 die xxx mensis ix annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2447435 09 ix 9 09/30/1988 die xxx mensis ix annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1315 {conversion of 1988-10-01} { clock format 591712496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1988 12:34:56 die i mensis x annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2447436 10 x 10 10/01/1988 die i mensis x annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1316 {conversion of 1988-10-31} { clock format 594304496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1988 12:34:56 die xxxi mensis x annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2447466 10 x 10 10/31/1988 die xxxi mensis x annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1317 {conversion of 1988-11-01} { clock format 594390896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1988 12:34:56 die i mensis xi annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2447467 11 xi 11 11/01/1988 die i mensis xi annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1318 {conversion of 1988-11-30} { clock format 596896496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1988 12:34:56 die xxx mensis xi annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2447496 11 xi 11 11/30/1988 die xxx mensis xi annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1319 {conversion of 1988-12-01} { clock format 596982896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1988 12:34:56 die i mensis xii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2447497 12 xii 12 12/01/1988 die i mensis xii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1320 {conversion of 1988-12-31} { clock format 599574896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1988 12:34:56 die xxxi mensis xii annoque mcmlxxxviii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2447527 12 xii 12 12/31/1988 die xxxi mensis xii annoque mcmlxxxviii 88 lxxxviii 1988} test clock-2.1321 {conversion of 1989-01-01} { clock format 599661296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1989 12:34:56 die i mensis i annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2447528 01 i 1 01/01/1989 die i mensis i annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1322 {conversion of 1989-01-31} { clock format 602253296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1989 12:34:56 die xxxi mensis i annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2447558 01 i 1 01/31/1989 die xxxi mensis i annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1323 {conversion of 1989-02-01} { clock format 602339696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1989 12:34:56 die i mensis ii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2447559 02 ii 2 02/01/1989 die i mensis ii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1324 {conversion of 1989-02-28} { clock format 604672496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1989 12:34:56 die xxviii mensis ii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2447586 02 ii 2 02/28/1989 die xxviii mensis ii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1325 {conversion of 1989-03-01} { clock format 604758896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1989 12:34:56 die i mensis iii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2447587 03 iii 3 03/01/1989 die i mensis iii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1326 {conversion of 1989-03-31} { clock format 607350896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1989 12:34:56 die xxxi mensis iii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2447617 03 iii 3 03/31/1989 die xxxi mensis iii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1327 {conversion of 1989-04-01} { clock format 607437296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1989 12:34:56 die i mensis iv annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2447618 04 iv 4 04/01/1989 die i mensis iv annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1328 {conversion of 1989-04-30} { clock format 609942896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1989 12:34:56 die xxx mensis iv annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2447647 04 iv 4 04/30/1989 die xxx mensis iv annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1329 {conversion of 1989-05-01} { clock format 610029296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1989 12:34:56 die i mensis v annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2447648 05 v 5 05/01/1989 die i mensis v annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1330 {conversion of 1989-05-31} { clock format 612621296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1989 12:34:56 die xxxi mensis v annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2447678 05 v 5 05/31/1989 die xxxi mensis v annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1331 {conversion of 1989-06-01} { clock format 612707696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1989 12:34:56 die i mensis vi annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2447679 06 vi 6 06/01/1989 die i mensis vi annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1332 {conversion of 1989-06-30} { clock format 615213296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1989 12:34:56 die xxx mensis vi annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2447708 06 vi 6 06/30/1989 die xxx mensis vi annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1333 {conversion of 1989-07-01} { clock format 615299696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1989 12:34:56 die i mensis vii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2447709 07 vii 7 07/01/1989 die i mensis vii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1334 {conversion of 1989-07-31} { clock format 617891696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1989 12:34:56 die xxxi mensis vii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2447739 07 vii 7 07/31/1989 die xxxi mensis vii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1335 {conversion of 1989-08-01} { clock format 617978096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1989 12:34:56 die i mensis viii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2447740 08 viii 8 08/01/1989 die i mensis viii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1336 {conversion of 1989-08-31} { clock format 620570096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1989 12:34:56 die xxxi mensis viii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2447770 08 viii 8 08/31/1989 die xxxi mensis viii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1337 {conversion of 1989-09-01} { clock format 620656496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1989 12:34:56 die i mensis ix annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2447771 09 ix 9 09/01/1989 die i mensis ix annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1338 {conversion of 1989-09-30} { clock format 623162096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1989 12:34:56 die xxx mensis ix annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2447800 09 ix 9 09/30/1989 die xxx mensis ix annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1339 {conversion of 1989-10-01} { clock format 623248496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1989 12:34:56 die i mensis x annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2447801 10 x 10 10/01/1989 die i mensis x annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1340 {conversion of 1989-10-31} { clock format 625840496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1989 12:34:56 die xxxi mensis x annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2447831 10 x 10 10/31/1989 die xxxi mensis x annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1341 {conversion of 1989-11-01} { clock format 625926896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1989 12:34:56 die i mensis xi annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2447832 11 xi 11 11/01/1989 die i mensis xi annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1342 {conversion of 1989-11-30} { clock format 628432496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1989 12:34:56 die xxx mensis xi annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2447861 11 xi 11 11/30/1989 die xxx mensis xi annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1343 {conversion of 1989-12-01} { clock format 628518896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1989 12:34:56 die i mensis xii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2447862 12 xii 12 12/01/1989 die i mensis xii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1344 {conversion of 1989-12-31} { clock format 631110896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1989 12:34:56 die xxxi mensis xii annoque mcmlxxxix xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2447892 12 xii 12 12/31/1989 die xxxi mensis xii annoque mcmlxxxix 89 lxxxix 1989} test clock-2.1345 {conversion of 1992-01-01} { clock format 694269296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1992 12:34:56 die i mensis i annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2448623 01 i 1 01/01/1992 die i mensis i annoque mcmxcii 92 xcii 1992} test clock-2.1346 {conversion of 1992-01-31} { clock format 696861296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1992 12:34:56 die xxxi mensis i annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2448653 01 i 1 01/31/1992 die xxxi mensis i annoque mcmxcii 92 xcii 1992} test clock-2.1347 {conversion of 1992-02-01} { clock format 696947696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1992 12:34:56 die i mensis ii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2448654 02 ii 2 02/01/1992 die i mensis ii annoque mcmxcii 92 xcii 1992} test clock-2.1348 {conversion of 1992-02-29} { clock format 699366896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1992 12:34:56 die xxix mensis ii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2448682 02 ii 2 02/29/1992 die xxix mensis ii annoque mcmxcii 92 xcii 1992} test clock-2.1349 {conversion of 1992-03-01} { clock format 699453296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1992 12:34:56 die i mensis iii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2448683 03 iii 3 03/01/1992 die i mensis iii annoque mcmxcii 92 xcii 1992} test clock-2.1350 {conversion of 1992-03-31} { clock format 702045296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1992 12:34:56 die xxxi mensis iii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2448713 03 iii 3 03/31/1992 die xxxi mensis iii annoque mcmxcii 92 xcii 1992} test clock-2.1351 {conversion of 1992-04-01} { clock format 702131696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1992 12:34:56 die i mensis iv annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2448714 04 iv 4 04/01/1992 die i mensis iv annoque mcmxcii 92 xcii 1992} test clock-2.1352 {conversion of 1992-04-30} { clock format 704637296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1992 12:34:56 die xxx mensis iv annoque mcmxcii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2448743 04 iv 4 04/30/1992 die xxx mensis iv annoque mcmxcii 92 xcii 1992} test clock-2.1353 {conversion of 1992-05-01} { clock format 704723696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1992 12:34:56 die i mensis v annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2448744 05 v 5 05/01/1992 die i mensis v annoque mcmxcii 92 xcii 1992} test clock-2.1354 {conversion of 1992-05-31} { clock format 707315696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1992 12:34:56 die xxxi mensis v annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2448774 05 v 5 05/31/1992 die xxxi mensis v annoque mcmxcii 92 xcii 1992} test clock-2.1355 {conversion of 1992-06-01} { clock format 707402096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1992 12:34:56 die i mensis vi annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2448775 06 vi 6 06/01/1992 die i mensis vi annoque mcmxcii 92 xcii 1992} test clock-2.1356 {conversion of 1992-06-30} { clock format 709907696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1992 12:34:56 die xxx mensis vi annoque mcmxcii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2448804 06 vi 6 06/30/1992 die xxx mensis vi annoque mcmxcii 92 xcii 1992} test clock-2.1357 {conversion of 1992-07-01} { clock format 709994096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1992 12:34:56 die i mensis vii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2448805 07 vii 7 07/01/1992 die i mensis vii annoque mcmxcii 92 xcii 1992} test clock-2.1358 {conversion of 1992-07-31} { clock format 712586096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1992 12:34:56 die xxxi mensis vii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2448835 07 vii 7 07/31/1992 die xxxi mensis vii annoque mcmxcii 92 xcii 1992} test clock-2.1359 {conversion of 1992-08-01} { clock format 712672496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1992 12:34:56 die i mensis viii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2448836 08 viii 8 08/01/1992 die i mensis viii annoque mcmxcii 92 xcii 1992} test clock-2.1360 {conversion of 1992-08-31} { clock format 715264496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1992 12:34:56 die xxxi mensis viii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2448866 08 viii 8 08/31/1992 die xxxi mensis viii annoque mcmxcii 92 xcii 1992} test clock-2.1361 {conversion of 1992-09-01} { clock format 715350896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1992 12:34:56 die i mensis ix annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2448867 09 ix 9 09/01/1992 die i mensis ix annoque mcmxcii 92 xcii 1992} test clock-2.1362 {conversion of 1992-09-30} { clock format 717856496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1992 12:34:56 die xxx mensis ix annoque mcmxcii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2448896 09 ix 9 09/30/1992 die xxx mensis ix annoque mcmxcii 92 xcii 1992} test clock-2.1363 {conversion of 1992-10-01} { clock format 717942896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1992 12:34:56 die i mensis x annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2448897 10 x 10 10/01/1992 die i mensis x annoque mcmxcii 92 xcii 1992} test clock-2.1364 {conversion of 1992-10-31} { clock format 720534896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1992 12:34:56 die xxxi mensis x annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2448927 10 x 10 10/31/1992 die xxxi mensis x annoque mcmxcii 92 xcii 1992} test clock-2.1365 {conversion of 1992-11-01} { clock format 720621296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1992 12:34:56 die i mensis xi annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2448928 11 xi 11 11/01/1992 die i mensis xi annoque mcmxcii 92 xcii 1992} test clock-2.1366 {conversion of 1992-11-30} { clock format 723126896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1992 12:34:56 die xxx mensis xi annoque mcmxcii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2448957 11 xi 11 11/30/1992 die xxx mensis xi annoque mcmxcii 92 xcii 1992} test clock-2.1367 {conversion of 1992-12-01} { clock format 723213296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1992 12:34:56 die i mensis xii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2448958 12 xii 12 12/01/1992 die i mensis xii annoque mcmxcii 92 xcii 1992} test clock-2.1368 {conversion of 1992-12-31} { clock format 725805296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1992 12:34:56 die xxxi mensis xii annoque mcmxcii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2448988 12 xii 12 12/31/1992 die xxxi mensis xii annoque mcmxcii 92 xcii 1992} test clock-2.1369 {conversion of 1993-01-01} { clock format 725891696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1993 12:34:56 die i mensis i annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2448989 01 i 1 01/01/1993 die i mensis i annoque mcmxciii 93 xciii 1993} test clock-2.1370 {conversion of 1993-01-31} { clock format 728483696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1993 12:34:56 die xxxi mensis i annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2449019 01 i 1 01/31/1993 die xxxi mensis i annoque mcmxciii 93 xciii 1993} test clock-2.1371 {conversion of 1993-02-01} { clock format 728570096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1993 12:34:56 die i mensis ii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2449020 02 ii 2 02/01/1993 die i mensis ii annoque mcmxciii 93 xciii 1993} test clock-2.1372 {conversion of 1993-02-28} { clock format 730902896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1993 12:34:56 die xxviii mensis ii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2449047 02 ii 2 02/28/1993 die xxviii mensis ii annoque mcmxciii 93 xciii 1993} test clock-2.1373 {conversion of 1993-03-01} { clock format 730989296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1993 12:34:56 die i mensis iii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2449048 03 iii 3 03/01/1993 die i mensis iii annoque mcmxciii 93 xciii 1993} test clock-2.1374 {conversion of 1993-03-31} { clock format 733581296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1993 12:34:56 die xxxi mensis iii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2449078 03 iii 3 03/31/1993 die xxxi mensis iii annoque mcmxciii 93 xciii 1993} test clock-2.1375 {conversion of 1993-04-01} { clock format 733667696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1993 12:34:56 die i mensis iv annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2449079 04 iv 4 04/01/1993 die i mensis iv annoque mcmxciii 93 xciii 1993} test clock-2.1376 {conversion of 1993-04-30} { clock format 736173296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1993 12:34:56 die xxx mensis iv annoque mcmxciii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2449108 04 iv 4 04/30/1993 die xxx mensis iv annoque mcmxciii 93 xciii 1993} test clock-2.1377 {conversion of 1993-05-01} { clock format 736259696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1993 12:34:56 die i mensis v annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2449109 05 v 5 05/01/1993 die i mensis v annoque mcmxciii 93 xciii 1993} test clock-2.1378 {conversion of 1993-05-31} { clock format 738851696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1993 12:34:56 die xxxi mensis v annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2449139 05 v 5 05/31/1993 die xxxi mensis v annoque mcmxciii 93 xciii 1993} test clock-2.1379 {conversion of 1993-06-01} { clock format 738938096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1993 12:34:56 die i mensis vi annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2449140 06 vi 6 06/01/1993 die i mensis vi annoque mcmxciii 93 xciii 1993} test clock-2.1380 {conversion of 1993-06-30} { clock format 741443696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1993 12:34:56 die xxx mensis vi annoque mcmxciii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2449169 06 vi 6 06/30/1993 die xxx mensis vi annoque mcmxciii 93 xciii 1993} test clock-2.1381 {conversion of 1993-07-01} { clock format 741530096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1993 12:34:56 die i mensis vii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2449170 07 vii 7 07/01/1993 die i mensis vii annoque mcmxciii 93 xciii 1993} test clock-2.1382 {conversion of 1993-07-31} { clock format 744122096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1993 12:34:56 die xxxi mensis vii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2449200 07 vii 7 07/31/1993 die xxxi mensis vii annoque mcmxciii 93 xciii 1993} test clock-2.1383 {conversion of 1993-08-01} { clock format 744208496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1993 12:34:56 die i mensis viii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2449201 08 viii 8 08/01/1993 die i mensis viii annoque mcmxciii 93 xciii 1993} test clock-2.1384 {conversion of 1993-08-31} { clock format 746800496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1993 12:34:56 die xxxi mensis viii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2449231 08 viii 8 08/31/1993 die xxxi mensis viii annoque mcmxciii 93 xciii 1993} test clock-2.1385 {conversion of 1993-09-01} { clock format 746886896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1993 12:34:56 die i mensis ix annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2449232 09 ix 9 09/01/1993 die i mensis ix annoque mcmxciii 93 xciii 1993} test clock-2.1386 {conversion of 1993-09-30} { clock format 749392496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1993 12:34:56 die xxx mensis ix annoque mcmxciii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2449261 09 ix 9 09/30/1993 die xxx mensis ix annoque mcmxciii 93 xciii 1993} test clock-2.1387 {conversion of 1993-10-01} { clock format 749478896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1993 12:34:56 die i mensis x annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2449262 10 x 10 10/01/1993 die i mensis x annoque mcmxciii 93 xciii 1993} test clock-2.1388 {conversion of 1993-10-31} { clock format 752070896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1993 12:34:56 die xxxi mensis x annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2449292 10 x 10 10/31/1993 die xxxi mensis x annoque mcmxciii 93 xciii 1993} test clock-2.1389 {conversion of 1993-11-01} { clock format 752157296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1993 12:34:56 die i mensis xi annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2449293 11 xi 11 11/01/1993 die i mensis xi annoque mcmxciii 93 xciii 1993} test clock-2.1390 {conversion of 1993-11-30} { clock format 754662896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1993 12:34:56 die xxx mensis xi annoque mcmxciii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2449322 11 xi 11 11/30/1993 die xxx mensis xi annoque mcmxciii 93 xciii 1993} test clock-2.1391 {conversion of 1993-12-01} { clock format 754749296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1993 12:34:56 die i mensis xii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2449323 12 xii 12 12/01/1993 die i mensis xii annoque mcmxciii 93 xciii 1993} test clock-2.1392 {conversion of 1993-12-31} { clock format 757341296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1993 12:34:56 die xxxi mensis xii annoque mcmxciii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2449353 12 xii 12 12/31/1993 die xxxi mensis xii annoque mcmxciii 93 xciii 1993} test clock-2.1393 {conversion of 1996-01-01} { clock format 820499696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1996 12:34:56 die i mensis i annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2450084 01 i 1 01/01/1996 die i mensis i annoque mcmxcvi 96 xcvi 1996} test clock-2.1394 {conversion of 1996-01-31} { clock format 823091696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1996 12:34:56 die xxxi mensis i annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2450114 01 i 1 01/31/1996 die xxxi mensis i annoque mcmxcvi 96 xcvi 1996} test clock-2.1395 {conversion of 1996-02-01} { clock format 823178096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1996 12:34:56 die i mensis ii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2450115 02 ii 2 02/01/1996 die i mensis ii annoque mcmxcvi 96 xcvi 1996} test clock-2.1396 {conversion of 1996-02-29} { clock format 825597296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/1996 12:34:56 die xxix mensis ii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 29 xxix 29 xxix Feb 060 2450143 02 ii 2 02/29/1996 die xxix mensis ii annoque mcmxcvi 96 xcvi 1996} test clock-2.1397 {conversion of 1996-03-01} { clock format 825683696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1996 12:34:56 die i mensis iii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 061 2450144 03 iii 3 03/01/1996 die i mensis iii annoque mcmxcvi 96 xcvi 1996} test clock-2.1398 {conversion of 1996-03-31} { clock format 828275696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1996 12:34:56 die xxxi mensis iii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 091 2450174 03 iii 3 03/31/1996 die xxxi mensis iii annoque mcmxcvi 96 xcvi 1996} test clock-2.1399 {conversion of 1996-04-01} { clock format 828362096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1996 12:34:56 die i mensis iv annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 092 2450175 04 iv 4 04/01/1996 die i mensis iv annoque mcmxcvi 96 xcvi 1996} test clock-2.1400 {conversion of 1996-04-30} { clock format 830867696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1996 12:34:56 die xxx mensis iv annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 121 2450204 04 iv 4 04/30/1996 die xxx mensis iv annoque mcmxcvi 96 xcvi 1996} test clock-2.1401 {conversion of 1996-05-01} { clock format 830954096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1996 12:34:56 die i mensis v annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i May 122 2450205 05 v 5 05/01/1996 die i mensis v annoque mcmxcvi 96 xcvi 1996} test clock-2.1402 {conversion of 1996-05-31} { clock format 833546096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1996 12:34:56 die xxxi mensis v annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 152 2450235 05 v 5 05/31/1996 die xxxi mensis v annoque mcmxcvi 96 xcvi 1996} test clock-2.1403 {conversion of 1996-06-01} { clock format 833632496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1996 12:34:56 die i mensis vi annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 153 2450236 06 vi 6 06/01/1996 die i mensis vi annoque mcmxcvi 96 xcvi 1996} test clock-2.1404 {conversion of 1996-06-30} { clock format 836138096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1996 12:34:56 die xxx mensis vi annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 182 2450265 06 vi 6 06/30/1996 die xxx mensis vi annoque mcmxcvi 96 xcvi 1996} test clock-2.1405 {conversion of 1996-07-01} { clock format 836224496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1996 12:34:56 die i mensis vii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 183 2450266 07 vii 7 07/01/1996 die i mensis vii annoque mcmxcvi 96 xcvi 1996} test clock-2.1406 {conversion of 1996-07-31} { clock format 838816496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1996 12:34:56 die xxxi mensis vii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 213 2450296 07 vii 7 07/31/1996 die xxxi mensis vii annoque mcmxcvi 96 xcvi 1996} test clock-2.1407 {conversion of 1996-08-01} { clock format 838902896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1996 12:34:56 die i mensis viii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 214 2450297 08 viii 8 08/01/1996 die i mensis viii annoque mcmxcvi 96 xcvi 1996} test clock-2.1408 {conversion of 1996-08-31} { clock format 841494896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1996 12:34:56 die xxxi mensis viii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 244 2450327 08 viii 8 08/31/1996 die xxxi mensis viii annoque mcmxcvi 96 xcvi 1996} test clock-2.1409 {conversion of 1996-09-01} { clock format 841581296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1996 12:34:56 die i mensis ix annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 245 2450328 09 ix 9 09/01/1996 die i mensis ix annoque mcmxcvi 96 xcvi 1996} test clock-2.1410 {conversion of 1996-09-30} { clock format 844086896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1996 12:34:56 die xxx mensis ix annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 274 2450357 09 ix 9 09/30/1996 die xxx mensis ix annoque mcmxcvi 96 xcvi 1996} test clock-2.1411 {conversion of 1996-10-01} { clock format 844173296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1996 12:34:56 die i mensis x annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 275 2450358 10 x 10 10/01/1996 die i mensis x annoque mcmxcvi 96 xcvi 1996} test clock-2.1412 {conversion of 1996-10-31} { clock format 846765296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1996 12:34:56 die xxxi mensis x annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 305 2450388 10 x 10 10/31/1996 die xxxi mensis x annoque mcmxcvi 96 xcvi 1996} test clock-2.1413 {conversion of 1996-11-01} { clock format 846851696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1996 12:34:56 die i mensis xi annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 306 2450389 11 xi 11 11/01/1996 die i mensis xi annoque mcmxcvi 96 xcvi 1996} test clock-2.1414 {conversion of 1996-11-30} { clock format 849357296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1996 12:34:56 die xxx mensis xi annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 335 2450418 11 xi 11 11/30/1996 die xxx mensis xi annoque mcmxcvi 96 xcvi 1996} test clock-2.1415 {conversion of 1996-12-01} { clock format 849443696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1996 12:34:56 die i mensis xii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 336 2450419 12 xii 12 12/01/1996 die i mensis xii annoque mcmxcvi 96 xcvi 1996} test clock-2.1416 {conversion of 1996-12-31} { clock format 852035696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1996 12:34:56 die xxxi mensis xii annoque mcmxcvi xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 366 2450449 12 xii 12 12/31/1996 die xxxi mensis xii annoque mcmxcvi 96 xcvi 1996} test clock-2.1417 {conversion of 1997-01-01} { clock format 852122096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/1997 12:34:56 die i mensis i annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jan 001 2450450 01 i 1 01/01/1997 die i mensis i annoque mcmxcvii 97 xcvii 1997} test clock-2.1418 {conversion of 1997-01-31} { clock format 854714096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/1997 12:34:56 die xxxi mensis i annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jan 031 2450480 01 i 1 01/31/1997 die xxxi mensis i annoque mcmxcvii 97 xcvii 1997} test clock-2.1419 {conversion of 1997-02-01} { clock format 854800496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/1997 12:34:56 die i mensis ii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Feb 032 2450481 02 ii 2 02/01/1997 die i mensis ii annoque mcmxcvii 97 xcvii 1997} test clock-2.1420 {conversion of 1997-02-28} { clock format 857133296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/1997 12:34:56 die xxviii mensis ii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 28 xxviii 28 xxviii Feb 059 2450508 02 ii 2 02/28/1997 die xxviii mensis ii annoque mcmxcvii 97 xcvii 1997} test clock-2.1421 {conversion of 1997-03-01} { clock format 857219696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/1997 12:34:56 die i mensis iii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Mar 060 2450509 03 iii 3 03/01/1997 die i mensis iii annoque mcmxcvii 97 xcvii 1997} test clock-2.1422 {conversion of 1997-03-31} { clock format 859811696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/1997 12:34:56 die xxxi mensis iii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Mar 090 2450539 03 iii 3 03/31/1997 die xxxi mensis iii annoque mcmxcvii 97 xcvii 1997} test clock-2.1423 {conversion of 1997-04-01} { clock format 859898096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/1997 12:34:56 die i mensis iv annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Apr 091 2450540 04 iv 4 04/01/1997 die i mensis iv annoque mcmxcvii 97 xcvii 1997} test clock-2.1424 {conversion of 1997-04-30} { clock format 862403696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/1997 12:34:56 die xxx mensis iv annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Apr 120 2450569 04 iv 4 04/30/1997 die xxx mensis iv annoque mcmxcvii 97 xcvii 1997} test clock-2.1425 {conversion of 1997-05-01} { clock format 862490096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/1997 12:34:56 die i mensis v annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i May 121 2450570 05 v 5 05/01/1997 die i mensis v annoque mcmxcvii 97 xcvii 1997} test clock-2.1426 {conversion of 1997-05-31} { clock format 865082096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/1997 12:34:56 die xxxi mensis v annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi May 151 2450600 05 v 5 05/31/1997 die xxxi mensis v annoque mcmxcvii 97 xcvii 1997} test clock-2.1427 {conversion of 1997-06-01} { clock format 865168496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/1997 12:34:56 die i mensis vi annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jun 152 2450601 06 vi 6 06/01/1997 die i mensis vi annoque mcmxcvii 97 xcvii 1997} test clock-2.1428 {conversion of 1997-06-30} { clock format 867674096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/1997 12:34:56 die xxx mensis vi annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Jun 181 2450630 06 vi 6 06/30/1997 die xxx mensis vi annoque mcmxcvii 97 xcvii 1997} test clock-2.1429 {conversion of 1997-07-01} { clock format 867760496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/1997 12:34:56 die i mensis vii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Jul 182 2450631 07 vii 7 07/01/1997 die i mensis vii annoque mcmxcvii 97 xcvii 1997} test clock-2.1430 {conversion of 1997-07-31} { clock format 870352496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/1997 12:34:56 die xxxi mensis vii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Jul 212 2450661 07 vii 7 07/31/1997 die xxxi mensis vii annoque mcmxcvii 97 xcvii 1997} test clock-2.1431 {conversion of 1997-08-01} { clock format 870438896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/1997 12:34:56 die i mensis viii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Aug 213 2450662 08 viii 8 08/01/1997 die i mensis viii annoque mcmxcvii 97 xcvii 1997} test clock-2.1432 {conversion of 1997-08-31} { clock format 873030896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/1997 12:34:56 die xxxi mensis viii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Aug 243 2450692 08 viii 8 08/31/1997 die xxxi mensis viii annoque mcmxcvii 97 xcvii 1997} test clock-2.1433 {conversion of 1997-09-01} { clock format 873117296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/1997 12:34:56 die i mensis ix annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Sep 244 2450693 09 ix 9 09/01/1997 die i mensis ix annoque mcmxcvii 97 xcvii 1997} test clock-2.1434 {conversion of 1997-09-30} { clock format 875622896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/1997 12:34:56 die xxx mensis ix annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Sep 273 2450722 09 ix 9 09/30/1997 die xxx mensis ix annoque mcmxcvii 97 xcvii 1997} test clock-2.1435 {conversion of 1997-10-01} { clock format 875709296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/1997 12:34:56 die i mensis x annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Oct 274 2450723 10 x 10 10/01/1997 die i mensis x annoque mcmxcvii 97 xcvii 1997} test clock-2.1436 {conversion of 1997-10-31} { clock format 878301296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/1997 12:34:56 die xxxi mensis x annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Oct 304 2450753 10 x 10 10/31/1997 die xxxi mensis x annoque mcmxcvii 97 xcvii 1997} test clock-2.1437 {conversion of 1997-11-01} { clock format 878387696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/1997 12:34:56 die i mensis xi annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Nov 305 2450754 11 xi 11 11/01/1997 die i mensis xi annoque mcmxcvii 97 xcvii 1997} test clock-2.1438 {conversion of 1997-11-30} { clock format 880893296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/1997 12:34:56 die xxx mensis xi annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 30 xxx 30 xxx Nov 334 2450783 11 xi 11 11/30/1997 die xxx mensis xi annoque mcmxcvii 97 xcvii 1997} test clock-2.1439 {conversion of 1997-12-01} { clock format 880979696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/1997 12:34:56 die i mensis xii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 01 i 1 i Dec 335 2450784 12 xii 12 12/01/1997 die i mensis xii annoque mcmxcvii 97 xcvii 1997} test clock-2.1440 {conversion of 1997-12-31} { clock format 883571696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/1997 12:34:56 die xxxi mensis xii annoque mcmxcvii xii h xxxiv m lvi s 19 mcm 31 xxxi 31 xxxi Dec 365 2450814 12 xii 12 12/31/1997 die xxxi mensis xii annoque mcmxcvii 97 xcvii 1997} test clock-2.1441 {conversion of 2000-01-01} { clock format 946730096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2000 12:34:56 die i mensis i annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2451545 01 i 1 01/01/2000 die i mensis i annoque mm? 00 ? 2000} test clock-2.1442 {conversion of 2000-01-31} { clock format 949322096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2000 12:34:56 die xxxi mensis i annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2451575 01 i 1 01/31/2000 die xxxi mensis i annoque mm? 00 ? 2000} test clock-2.1443 {conversion of 2000-02-01} { clock format 949408496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2000 12:34:56 die i mensis ii annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2451576 02 ii 2 02/01/2000 die i mensis ii annoque mm? 00 ? 2000} test clock-2.1444 {conversion of 2000-02-29} { clock format 951827696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2000 12:34:56 die xxix mensis ii annoque mm? xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2451604 02 ii 2 02/29/2000 die xxix mensis ii annoque mm? 00 ? 2000} test clock-2.1445 {conversion of 2000-03-01} { clock format 951914096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2000 12:34:56 die i mensis iii annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2451605 03 iii 3 03/01/2000 die i mensis iii annoque mm? 00 ? 2000} test clock-2.1446 {conversion of 2000-03-31} { clock format 954506096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2000 12:34:56 die xxxi mensis iii annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2451635 03 iii 3 03/31/2000 die xxxi mensis iii annoque mm? 00 ? 2000} test clock-2.1447 {conversion of 2000-04-01} { clock format 954592496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2000 12:34:56 die i mensis iv annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2451636 04 iv 4 04/01/2000 die i mensis iv annoque mm? 00 ? 2000} test clock-2.1448 {conversion of 2000-04-30} { clock format 957098096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2000 12:34:56 die xxx mensis iv annoque mm? xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2451665 04 iv 4 04/30/2000 die xxx mensis iv annoque mm? 00 ? 2000} test clock-2.1449 {conversion of 2000-05-01} { clock format 957184496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2000 12:34:56 die i mensis v annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2451666 05 v 5 05/01/2000 die i mensis v annoque mm? 00 ? 2000} test clock-2.1450 {conversion of 2000-05-31} { clock format 959776496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2000 12:34:56 die xxxi mensis v annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2451696 05 v 5 05/31/2000 die xxxi mensis v annoque mm? 00 ? 2000} test clock-2.1451 {conversion of 2000-06-01} { clock format 959862896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2000 12:34:56 die i mensis vi annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2451697 06 vi 6 06/01/2000 die i mensis vi annoque mm? 00 ? 2000} test clock-2.1452 {conversion of 2000-06-30} { clock format 962368496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2000 12:34:56 die xxx mensis vi annoque mm? xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2451726 06 vi 6 06/30/2000 die xxx mensis vi annoque mm? 00 ? 2000} test clock-2.1453 {conversion of 2000-07-01} { clock format 962454896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2000 12:34:56 die i mensis vii annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2451727 07 vii 7 07/01/2000 die i mensis vii annoque mm? 00 ? 2000} test clock-2.1454 {conversion of 2000-07-31} { clock format 965046896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2000 12:34:56 die xxxi mensis vii annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2451757 07 vii 7 07/31/2000 die xxxi mensis vii annoque mm? 00 ? 2000} test clock-2.1455 {conversion of 2000-08-01} { clock format 965133296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2000 12:34:56 die i mensis viii annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2451758 08 viii 8 08/01/2000 die i mensis viii annoque mm? 00 ? 2000} test clock-2.1456 {conversion of 2000-08-31} { clock format 967725296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2000 12:34:56 die xxxi mensis viii annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2451788 08 viii 8 08/31/2000 die xxxi mensis viii annoque mm? 00 ? 2000} test clock-2.1457 {conversion of 2000-09-01} { clock format 967811696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2000 12:34:56 die i mensis ix annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2451789 09 ix 9 09/01/2000 die i mensis ix annoque mm? 00 ? 2000} test clock-2.1458 {conversion of 2000-09-30} { clock format 970317296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2000 12:34:56 die xxx mensis ix annoque mm? xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2451818 09 ix 9 09/30/2000 die xxx mensis ix annoque mm? 00 ? 2000} test clock-2.1459 {conversion of 2000-10-01} { clock format 970403696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2000 12:34:56 die i mensis x annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2451819 10 x 10 10/01/2000 die i mensis x annoque mm? 00 ? 2000} test clock-2.1460 {conversion of 2000-10-31} { clock format 972995696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2000 12:34:56 die xxxi mensis x annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2451849 10 x 10 10/31/2000 die xxxi mensis x annoque mm? 00 ? 2000} test clock-2.1461 {conversion of 2000-11-01} { clock format 973082096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2000 12:34:56 die i mensis xi annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2451850 11 xi 11 11/01/2000 die i mensis xi annoque mm? 00 ? 2000} test clock-2.1462 {conversion of 2000-11-30} { clock format 975587696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2000 12:34:56 die xxx mensis xi annoque mm? xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2451879 11 xi 11 11/30/2000 die xxx mensis xi annoque mm? 00 ? 2000} test clock-2.1463 {conversion of 2000-12-01} { clock format 975674096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2000 12:34:56 die i mensis xii annoque mm? xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2451880 12 xii 12 12/01/2000 die i mensis xii annoque mm? 00 ? 2000} test clock-2.1464 {conversion of 2000-12-31} { clock format 978266096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2000 12:34:56 die xxxi mensis xii annoque mm? xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2451910 12 xii 12 12/31/2000 die xxxi mensis xii annoque mm? 00 ? 2000} test clock-2.1465 {conversion of 2001-01-01} { clock format 978352496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2001 12:34:56 die i mensis i annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2451911 01 i 1 01/01/2001 die i mensis i annoque mmi 01 i 2001} test clock-2.1466 {conversion of 2001-01-31} { clock format 980944496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2001 12:34:56 die xxxi mensis i annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2451941 01 i 1 01/31/2001 die xxxi mensis i annoque mmi 01 i 2001} test clock-2.1467 {conversion of 2001-02-01} { clock format 981030896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2001 12:34:56 die i mensis ii annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2451942 02 ii 2 02/01/2001 die i mensis ii annoque mmi 01 i 2001} test clock-2.1468 {conversion of 2001-02-28} { clock format 983363696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2001 12:34:56 die xxviii mensis ii annoque mmi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2451969 02 ii 2 02/28/2001 die xxviii mensis ii annoque mmi 01 i 2001} test clock-2.1469 {conversion of 2001-03-01} { clock format 983450096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2001 12:34:56 die i mensis iii annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2451970 03 iii 3 03/01/2001 die i mensis iii annoque mmi 01 i 2001} test clock-2.1470 {conversion of 2001-03-31} { clock format 986042096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2001 12:34:56 die xxxi mensis iii annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2452000 03 iii 3 03/31/2001 die xxxi mensis iii annoque mmi 01 i 2001} test clock-2.1471 {conversion of 2001-04-01} { clock format 986128496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2001 12:34:56 die i mensis iv annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2452001 04 iv 4 04/01/2001 die i mensis iv annoque mmi 01 i 2001} test clock-2.1472 {conversion of 2001-04-30} { clock format 988634096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2001 12:34:56 die xxx mensis iv annoque mmi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2452030 04 iv 4 04/30/2001 die xxx mensis iv annoque mmi 01 i 2001} test clock-2.1473 {conversion of 2001-05-01} { clock format 988720496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2001 12:34:56 die i mensis v annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2452031 05 v 5 05/01/2001 die i mensis v annoque mmi 01 i 2001} test clock-2.1474 {conversion of 2001-05-31} { clock format 991312496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2001 12:34:56 die xxxi mensis v annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2452061 05 v 5 05/31/2001 die xxxi mensis v annoque mmi 01 i 2001} test clock-2.1475 {conversion of 2001-06-01} { clock format 991398896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2001 12:34:56 die i mensis vi annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2452062 06 vi 6 06/01/2001 die i mensis vi annoque mmi 01 i 2001} test clock-2.1476 {conversion of 2001-06-30} { clock format 993904496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2001 12:34:56 die xxx mensis vi annoque mmi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2452091 06 vi 6 06/30/2001 die xxx mensis vi annoque mmi 01 i 2001} test clock-2.1477 {conversion of 2001-07-01} { clock format 993990896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2001 12:34:56 die i mensis vii annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2452092 07 vii 7 07/01/2001 die i mensis vii annoque mmi 01 i 2001} test clock-2.1478 {conversion of 2001-07-31} { clock format 996582896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2001 12:34:56 die xxxi mensis vii annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2452122 07 vii 7 07/31/2001 die xxxi mensis vii annoque mmi 01 i 2001} test clock-2.1479 {conversion of 2001-08-01} { clock format 996669296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2001 12:34:56 die i mensis viii annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2452123 08 viii 8 08/01/2001 die i mensis viii annoque mmi 01 i 2001} test clock-2.1480 {conversion of 2001-08-31} { clock format 999261296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2001 12:34:56 die xxxi mensis viii annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2452153 08 viii 8 08/31/2001 die xxxi mensis viii annoque mmi 01 i 2001} test clock-2.1481 {conversion of 2001-09-01} { clock format 999347696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2001 12:34:56 die i mensis ix annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2452154 09 ix 9 09/01/2001 die i mensis ix annoque mmi 01 i 2001} test clock-2.1482 {conversion of 2001-09-30} { clock format 1001853296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2001 12:34:56 die xxx mensis ix annoque mmi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2452183 09 ix 9 09/30/2001 die xxx mensis ix annoque mmi 01 i 2001} test clock-2.1483 {conversion of 2001-10-01} { clock format 1001939696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2001 12:34:56 die i mensis x annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2452184 10 x 10 10/01/2001 die i mensis x annoque mmi 01 i 2001} test clock-2.1484 {conversion of 2001-10-31} { clock format 1004531696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2001 12:34:56 die xxxi mensis x annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2452214 10 x 10 10/31/2001 die xxxi mensis x annoque mmi 01 i 2001} test clock-2.1485 {conversion of 2001-11-01} { clock format 1004618096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2001 12:34:56 die i mensis xi annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2452215 11 xi 11 11/01/2001 die i mensis xi annoque mmi 01 i 2001} test clock-2.1486 {conversion of 2001-11-30} { clock format 1007123696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2001 12:34:56 die xxx mensis xi annoque mmi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2452244 11 xi 11 11/30/2001 die xxx mensis xi annoque mmi 01 i 2001} test clock-2.1487 {conversion of 2001-12-01} { clock format 1007210096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2001 12:34:56 die i mensis xii annoque mmi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2452245 12 xii 12 12/01/2001 die i mensis xii annoque mmi 01 i 2001} test clock-2.1488 {conversion of 2001-12-31} { clock format 1009802096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2001 12:34:56 die xxxi mensis xii annoque mmi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2452275 12 xii 12 12/31/2001 die xxxi mensis xii annoque mmi 01 i 2001} test clock-2.1489 {conversion of 2002-01-01} { clock format 1009888496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2002 12:34:56 die i mensis i annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2452276 01 i 1 01/01/2002 die i mensis i annoque mmii 02 ii 2002} test clock-2.1490 {conversion of 2002-01-31} { clock format 1012480496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2002 12:34:56 die xxxi mensis i annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2452306 01 i 1 01/31/2002 die xxxi mensis i annoque mmii 02 ii 2002} test clock-2.1491 {conversion of 2002-02-01} { clock format 1012566896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2002 12:34:56 die i mensis ii annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2452307 02 ii 2 02/01/2002 die i mensis ii annoque mmii 02 ii 2002} test clock-2.1492 {conversion of 2002-02-28} { clock format 1014899696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2002 12:34:56 die xxviii mensis ii annoque mmii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2452334 02 ii 2 02/28/2002 die xxviii mensis ii annoque mmii 02 ii 2002} test clock-2.1493 {conversion of 2002-03-01} { clock format 1014986096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2002 12:34:56 die i mensis iii annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2452335 03 iii 3 03/01/2002 die i mensis iii annoque mmii 02 ii 2002} test clock-2.1494 {conversion of 2002-03-31} { clock format 1017578096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2002 12:34:56 die xxxi mensis iii annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2452365 03 iii 3 03/31/2002 die xxxi mensis iii annoque mmii 02 ii 2002} test clock-2.1495 {conversion of 2002-04-01} { clock format 1017664496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2002 12:34:56 die i mensis iv annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2452366 04 iv 4 04/01/2002 die i mensis iv annoque mmii 02 ii 2002} test clock-2.1496 {conversion of 2002-04-30} { clock format 1020170096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2002 12:34:56 die xxx mensis iv annoque mmii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2452395 04 iv 4 04/30/2002 die xxx mensis iv annoque mmii 02 ii 2002} test clock-2.1497 {conversion of 2002-05-01} { clock format 1020256496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2002 12:34:56 die i mensis v annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2452396 05 v 5 05/01/2002 die i mensis v annoque mmii 02 ii 2002} test clock-2.1498 {conversion of 2002-05-31} { clock format 1022848496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2002 12:34:56 die xxxi mensis v annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2452426 05 v 5 05/31/2002 die xxxi mensis v annoque mmii 02 ii 2002} test clock-2.1499 {conversion of 2002-06-01} { clock format 1022934896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2002 12:34:56 die i mensis vi annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2452427 06 vi 6 06/01/2002 die i mensis vi annoque mmii 02 ii 2002} test clock-2.1500 {conversion of 2002-06-30} { clock format 1025440496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2002 12:34:56 die xxx mensis vi annoque mmii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2452456 06 vi 6 06/30/2002 die xxx mensis vi annoque mmii 02 ii 2002} test clock-2.1501 {conversion of 2002-07-01} { clock format 1025526896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2002 12:34:56 die i mensis vii annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2452457 07 vii 7 07/01/2002 die i mensis vii annoque mmii 02 ii 2002} test clock-2.1502 {conversion of 2002-07-31} { clock format 1028118896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2002 12:34:56 die xxxi mensis vii annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2452487 07 vii 7 07/31/2002 die xxxi mensis vii annoque mmii 02 ii 2002} test clock-2.1503 {conversion of 2002-08-01} { clock format 1028205296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2002 12:34:56 die i mensis viii annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2452488 08 viii 8 08/01/2002 die i mensis viii annoque mmii 02 ii 2002} test clock-2.1504 {conversion of 2002-08-31} { clock format 1030797296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2002 12:34:56 die xxxi mensis viii annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2452518 08 viii 8 08/31/2002 die xxxi mensis viii annoque mmii 02 ii 2002} test clock-2.1505 {conversion of 2002-09-01} { clock format 1030883696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2002 12:34:56 die i mensis ix annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2452519 09 ix 9 09/01/2002 die i mensis ix annoque mmii 02 ii 2002} test clock-2.1506 {conversion of 2002-09-30} { clock format 1033389296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2002 12:34:56 die xxx mensis ix annoque mmii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2452548 09 ix 9 09/30/2002 die xxx mensis ix annoque mmii 02 ii 2002} test clock-2.1507 {conversion of 2002-10-01} { clock format 1033475696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2002 12:34:56 die i mensis x annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2452549 10 x 10 10/01/2002 die i mensis x annoque mmii 02 ii 2002} test clock-2.1508 {conversion of 2002-10-31} { clock format 1036067696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2002 12:34:56 die xxxi mensis x annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2452579 10 x 10 10/31/2002 die xxxi mensis x annoque mmii 02 ii 2002} test clock-2.1509 {conversion of 2002-11-01} { clock format 1036154096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2002 12:34:56 die i mensis xi annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2452580 11 xi 11 11/01/2002 die i mensis xi annoque mmii 02 ii 2002} test clock-2.1510 {conversion of 2002-11-30} { clock format 1038659696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2002 12:34:56 die xxx mensis xi annoque mmii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2452609 11 xi 11 11/30/2002 die xxx mensis xi annoque mmii 02 ii 2002} test clock-2.1511 {conversion of 2002-12-01} { clock format 1038746096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2002 12:34:56 die i mensis xii annoque mmii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2452610 12 xii 12 12/01/2002 die i mensis xii annoque mmii 02 ii 2002} test clock-2.1512 {conversion of 2002-12-31} { clock format 1041338096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2002 12:34:56 die xxxi mensis xii annoque mmii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2452640 12 xii 12 12/31/2002 die xxxi mensis xii annoque mmii 02 ii 2002} test clock-2.1513 {conversion of 2003-01-01} { clock format 1041424496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2003 12:34:56 die i mensis i annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2452641 01 i 1 01/01/2003 die i mensis i annoque mmiii 03 iii 2003} test clock-2.1514 {conversion of 2003-01-31} { clock format 1044016496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2003 12:34:56 die xxxi mensis i annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2452671 01 i 1 01/31/2003 die xxxi mensis i annoque mmiii 03 iii 2003} test clock-2.1515 {conversion of 2003-02-01} { clock format 1044102896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2003 12:34:56 die i mensis ii annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2452672 02 ii 2 02/01/2003 die i mensis ii annoque mmiii 03 iii 2003} test clock-2.1516 {conversion of 2003-02-28} { clock format 1046435696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2003 12:34:56 die xxviii mensis ii annoque mmiii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2452699 02 ii 2 02/28/2003 die xxviii mensis ii annoque mmiii 03 iii 2003} test clock-2.1517 {conversion of 2003-03-01} { clock format 1046522096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2003 12:34:56 die i mensis iii annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2452700 03 iii 3 03/01/2003 die i mensis iii annoque mmiii 03 iii 2003} test clock-2.1518 {conversion of 2003-03-31} { clock format 1049114096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2003 12:34:56 die xxxi mensis iii annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2452730 03 iii 3 03/31/2003 die xxxi mensis iii annoque mmiii 03 iii 2003} test clock-2.1519 {conversion of 2003-04-01} { clock format 1049200496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2003 12:34:56 die i mensis iv annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2452731 04 iv 4 04/01/2003 die i mensis iv annoque mmiii 03 iii 2003} test clock-2.1520 {conversion of 2003-04-30} { clock format 1051706096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2003 12:34:56 die xxx mensis iv annoque mmiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2452760 04 iv 4 04/30/2003 die xxx mensis iv annoque mmiii 03 iii 2003} test clock-2.1521 {conversion of 2003-05-01} { clock format 1051792496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2003 12:34:56 die i mensis v annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2452761 05 v 5 05/01/2003 die i mensis v annoque mmiii 03 iii 2003} test clock-2.1522 {conversion of 2003-05-31} { clock format 1054384496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2003 12:34:56 die xxxi mensis v annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2452791 05 v 5 05/31/2003 die xxxi mensis v annoque mmiii 03 iii 2003} test clock-2.1523 {conversion of 2003-06-01} { clock format 1054470896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2003 12:34:56 die i mensis vi annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2452792 06 vi 6 06/01/2003 die i mensis vi annoque mmiii 03 iii 2003} test clock-2.1524 {conversion of 2003-06-30} { clock format 1056976496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2003 12:34:56 die xxx mensis vi annoque mmiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2452821 06 vi 6 06/30/2003 die xxx mensis vi annoque mmiii 03 iii 2003} test clock-2.1525 {conversion of 2003-07-01} { clock format 1057062896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2003 12:34:56 die i mensis vii annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2452822 07 vii 7 07/01/2003 die i mensis vii annoque mmiii 03 iii 2003} test clock-2.1526 {conversion of 2003-07-31} { clock format 1059654896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2003 12:34:56 die xxxi mensis vii annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2452852 07 vii 7 07/31/2003 die xxxi mensis vii annoque mmiii 03 iii 2003} test clock-2.1527 {conversion of 2003-08-01} { clock format 1059741296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2003 12:34:56 die i mensis viii annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2452853 08 viii 8 08/01/2003 die i mensis viii annoque mmiii 03 iii 2003} test clock-2.1528 {conversion of 2003-08-31} { clock format 1062333296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2003 12:34:56 die xxxi mensis viii annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2452883 08 viii 8 08/31/2003 die xxxi mensis viii annoque mmiii 03 iii 2003} test clock-2.1529 {conversion of 2003-09-01} { clock format 1062419696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2003 12:34:56 die i mensis ix annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2452884 09 ix 9 09/01/2003 die i mensis ix annoque mmiii 03 iii 2003} test clock-2.1530 {conversion of 2003-09-30} { clock format 1064925296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2003 12:34:56 die xxx mensis ix annoque mmiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2452913 09 ix 9 09/30/2003 die xxx mensis ix annoque mmiii 03 iii 2003} test clock-2.1531 {conversion of 2003-10-01} { clock format 1065011696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2003 12:34:56 die i mensis x annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2452914 10 x 10 10/01/2003 die i mensis x annoque mmiii 03 iii 2003} test clock-2.1532 {conversion of 2003-10-31} { clock format 1067603696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2003 12:34:56 die xxxi mensis x annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2452944 10 x 10 10/31/2003 die xxxi mensis x annoque mmiii 03 iii 2003} test clock-2.1533 {conversion of 2003-11-01} { clock format 1067690096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2003 12:34:56 die i mensis xi annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2452945 11 xi 11 11/01/2003 die i mensis xi annoque mmiii 03 iii 2003} test clock-2.1534 {conversion of 2003-11-30} { clock format 1070195696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2003 12:34:56 die xxx mensis xi annoque mmiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2452974 11 xi 11 11/30/2003 die xxx mensis xi annoque mmiii 03 iii 2003} test clock-2.1535 {conversion of 2003-12-01} { clock format 1070282096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2003 12:34:56 die i mensis xii annoque mmiii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2452975 12 xii 12 12/01/2003 die i mensis xii annoque mmiii 03 iii 2003} test clock-2.1536 {conversion of 2003-12-31} { clock format 1072874096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2003 12:34:56 die xxxi mensis xii annoque mmiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2453005 12 xii 12 12/31/2003 die xxxi mensis xii annoque mmiii 03 iii 2003} test clock-2.1537 {conversion of 2004-01-01} { clock format 1072960496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2004 12:34:56 die i mensis i annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2453006 01 i 1 01/01/2004 die i mensis i annoque mmiv 04 iv 2004} test clock-2.1538 {conversion of 2004-01-31} { clock format 1075552496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2004 12:34:56 die xxxi mensis i annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2453036 01 i 1 01/31/2004 die xxxi mensis i annoque mmiv 04 iv 2004} test clock-2.1539 {conversion of 2004-02-01} { clock format 1075638896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2004 12:34:56 die i mensis ii annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2453037 02 ii 2 02/01/2004 die i mensis ii annoque mmiv 04 iv 2004} test clock-2.1540 {conversion of 2004-02-29} { clock format 1078058096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2004 12:34:56 die xxix mensis ii annoque mmiv xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2453065 02 ii 2 02/29/2004 die xxix mensis ii annoque mmiv 04 iv 2004} test clock-2.1541 {conversion of 2004-03-01} { clock format 1078144496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2004 12:34:56 die i mensis iii annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2453066 03 iii 3 03/01/2004 die i mensis iii annoque mmiv 04 iv 2004} test clock-2.1542 {conversion of 2004-03-31} { clock format 1080736496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2004 12:34:56 die xxxi mensis iii annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2453096 03 iii 3 03/31/2004 die xxxi mensis iii annoque mmiv 04 iv 2004} test clock-2.1543 {conversion of 2004-04-01} { clock format 1080822896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2004 12:34:56 die i mensis iv annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2453097 04 iv 4 04/01/2004 die i mensis iv annoque mmiv 04 iv 2004} test clock-2.1544 {conversion of 2004-04-30} { clock format 1083328496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2004 12:34:56 die xxx mensis iv annoque mmiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2453126 04 iv 4 04/30/2004 die xxx mensis iv annoque mmiv 04 iv 2004} test clock-2.1545 {conversion of 2004-05-01} { clock format 1083414896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2004 12:34:56 die i mensis v annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2453127 05 v 5 05/01/2004 die i mensis v annoque mmiv 04 iv 2004} test clock-2.1546 {conversion of 2004-05-31} { clock format 1086006896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2004 12:34:56 die xxxi mensis v annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2453157 05 v 5 05/31/2004 die xxxi mensis v annoque mmiv 04 iv 2004} test clock-2.1547 {conversion of 2004-06-01} { clock format 1086093296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2004 12:34:56 die i mensis vi annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2453158 06 vi 6 06/01/2004 die i mensis vi annoque mmiv 04 iv 2004} test clock-2.1548 {conversion of 2004-06-30} { clock format 1088598896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2004 12:34:56 die xxx mensis vi annoque mmiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2453187 06 vi 6 06/30/2004 die xxx mensis vi annoque mmiv 04 iv 2004} test clock-2.1549 {conversion of 2004-07-01} { clock format 1088685296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2004 12:34:56 die i mensis vii annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2453188 07 vii 7 07/01/2004 die i mensis vii annoque mmiv 04 iv 2004} test clock-2.1550 {conversion of 2004-07-31} { clock format 1091277296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2004 12:34:56 die xxxi mensis vii annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2453218 07 vii 7 07/31/2004 die xxxi mensis vii annoque mmiv 04 iv 2004} test clock-2.1551 {conversion of 2004-08-01} { clock format 1091363696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2004 12:34:56 die i mensis viii annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2453219 08 viii 8 08/01/2004 die i mensis viii annoque mmiv 04 iv 2004} test clock-2.1552 {conversion of 2004-08-31} { clock format 1093955696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2004 12:34:56 die xxxi mensis viii annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2453249 08 viii 8 08/31/2004 die xxxi mensis viii annoque mmiv 04 iv 2004} test clock-2.1553 {conversion of 2004-09-01} { clock format 1094042096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2004 12:34:56 die i mensis ix annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2453250 09 ix 9 09/01/2004 die i mensis ix annoque mmiv 04 iv 2004} test clock-2.1554 {conversion of 2004-09-30} { clock format 1096547696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2004 12:34:56 die xxx mensis ix annoque mmiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2453279 09 ix 9 09/30/2004 die xxx mensis ix annoque mmiv 04 iv 2004} test clock-2.1555 {conversion of 2004-10-01} { clock format 1096634096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2004 12:34:56 die i mensis x annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2453280 10 x 10 10/01/2004 die i mensis x annoque mmiv 04 iv 2004} test clock-2.1556 {conversion of 2004-10-31} { clock format 1099226096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2004 12:34:56 die xxxi mensis x annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2453310 10 x 10 10/31/2004 die xxxi mensis x annoque mmiv 04 iv 2004} test clock-2.1557 {conversion of 2004-11-01} { clock format 1099312496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2004 12:34:56 die i mensis xi annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2453311 11 xi 11 11/01/2004 die i mensis xi annoque mmiv 04 iv 2004} test clock-2.1558 {conversion of 2004-11-30} { clock format 1101818096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2004 12:34:56 die xxx mensis xi annoque mmiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2453340 11 xi 11 11/30/2004 die xxx mensis xi annoque mmiv 04 iv 2004} test clock-2.1559 {conversion of 2004-12-01} { clock format 1101904496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2004 12:34:56 die i mensis xii annoque mmiv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2453341 12 xii 12 12/01/2004 die i mensis xii annoque mmiv 04 iv 2004} test clock-2.1560 {conversion of 2004-12-31} { clock format 1104496496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2004 12:34:56 die xxxi mensis xii annoque mmiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2453371 12 xii 12 12/31/2004 die xxxi mensis xii annoque mmiv 04 iv 2004} test clock-2.1561 {conversion of 2005-01-01} { clock format 1104582896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2005 12:34:56 die i mensis i annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2453372 01 i 1 01/01/2005 die i mensis i annoque mmv 05 v 2005} test clock-2.1562 {conversion of 2005-01-31} { clock format 1107174896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2005 12:34:56 die xxxi mensis i annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2453402 01 i 1 01/31/2005 die xxxi mensis i annoque mmv 05 v 2005} test clock-2.1563 {conversion of 2005-02-01} { clock format 1107261296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2005 12:34:56 die i mensis ii annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2453403 02 ii 2 02/01/2005 die i mensis ii annoque mmv 05 v 2005} test clock-2.1564 {conversion of 2005-02-28} { clock format 1109594096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2005 12:34:56 die xxviii mensis ii annoque mmv xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2453430 02 ii 2 02/28/2005 die xxviii mensis ii annoque mmv 05 v 2005} test clock-2.1565 {conversion of 2005-03-01} { clock format 1109680496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2005 12:34:56 die i mensis iii annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2453431 03 iii 3 03/01/2005 die i mensis iii annoque mmv 05 v 2005} test clock-2.1566 {conversion of 2005-03-31} { clock format 1112272496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2005 12:34:56 die xxxi mensis iii annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2453461 03 iii 3 03/31/2005 die xxxi mensis iii annoque mmv 05 v 2005} test clock-2.1567 {conversion of 2005-04-01} { clock format 1112358896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2005 12:34:56 die i mensis iv annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2453462 04 iv 4 04/01/2005 die i mensis iv annoque mmv 05 v 2005} test clock-2.1568 {conversion of 2005-04-30} { clock format 1114864496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2005 12:34:56 die xxx mensis iv annoque mmv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2453491 04 iv 4 04/30/2005 die xxx mensis iv annoque mmv 05 v 2005} test clock-2.1569 {conversion of 2005-05-01} { clock format 1114950896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2005 12:34:56 die i mensis v annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2453492 05 v 5 05/01/2005 die i mensis v annoque mmv 05 v 2005} test clock-2.1570 {conversion of 2005-05-31} { clock format 1117542896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2005 12:34:56 die xxxi mensis v annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2453522 05 v 5 05/31/2005 die xxxi mensis v annoque mmv 05 v 2005} test clock-2.1571 {conversion of 2005-06-01} { clock format 1117629296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2005 12:34:56 die i mensis vi annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2453523 06 vi 6 06/01/2005 die i mensis vi annoque mmv 05 v 2005} test clock-2.1572 {conversion of 2005-06-30} { clock format 1120134896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2005 12:34:56 die xxx mensis vi annoque mmv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2453552 06 vi 6 06/30/2005 die xxx mensis vi annoque mmv 05 v 2005} test clock-2.1573 {conversion of 2005-07-01} { clock format 1120221296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2005 12:34:56 die i mensis vii annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2453553 07 vii 7 07/01/2005 die i mensis vii annoque mmv 05 v 2005} test clock-2.1574 {conversion of 2005-07-31} { clock format 1122813296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2005 12:34:56 die xxxi mensis vii annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2453583 07 vii 7 07/31/2005 die xxxi mensis vii annoque mmv 05 v 2005} test clock-2.1575 {conversion of 2005-08-01} { clock format 1122899696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2005 12:34:56 die i mensis viii annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2453584 08 viii 8 08/01/2005 die i mensis viii annoque mmv 05 v 2005} test clock-2.1576 {conversion of 2005-08-31} { clock format 1125491696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2005 12:34:56 die xxxi mensis viii annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2453614 08 viii 8 08/31/2005 die xxxi mensis viii annoque mmv 05 v 2005} test clock-2.1577 {conversion of 2005-09-01} { clock format 1125578096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2005 12:34:56 die i mensis ix annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2453615 09 ix 9 09/01/2005 die i mensis ix annoque mmv 05 v 2005} test clock-2.1578 {conversion of 2005-09-30} { clock format 1128083696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2005 12:34:56 die xxx mensis ix annoque mmv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2453644 09 ix 9 09/30/2005 die xxx mensis ix annoque mmv 05 v 2005} test clock-2.1579 {conversion of 2005-10-01} { clock format 1128170096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2005 12:34:56 die i mensis x annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2453645 10 x 10 10/01/2005 die i mensis x annoque mmv 05 v 2005} test clock-2.1580 {conversion of 2005-10-31} { clock format 1130762096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2005 12:34:56 die xxxi mensis x annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2453675 10 x 10 10/31/2005 die xxxi mensis x annoque mmv 05 v 2005} test clock-2.1581 {conversion of 2005-11-01} { clock format 1130848496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2005 12:34:56 die i mensis xi annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2453676 11 xi 11 11/01/2005 die i mensis xi annoque mmv 05 v 2005} test clock-2.1582 {conversion of 2005-11-30} { clock format 1133354096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2005 12:34:56 die xxx mensis xi annoque mmv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2453705 11 xi 11 11/30/2005 die xxx mensis xi annoque mmv 05 v 2005} test clock-2.1583 {conversion of 2005-12-01} { clock format 1133440496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2005 12:34:56 die i mensis xii annoque mmv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2453706 12 xii 12 12/01/2005 die i mensis xii annoque mmv 05 v 2005} test clock-2.1584 {conversion of 2005-12-31} { clock format 1136032496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2005 12:34:56 die xxxi mensis xii annoque mmv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2453736 12 xii 12 12/31/2005 die xxxi mensis xii annoque mmv 05 v 2005} test clock-2.1585 {conversion of 2006-01-01} { clock format 1136118896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2006 12:34:56 die i mensis i annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2453737 01 i 1 01/01/2006 die i mensis i annoque mmvi 06 vi 2006} test clock-2.1586 {conversion of 2006-01-31} { clock format 1138710896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2006 12:34:56 die xxxi mensis i annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2453767 01 i 1 01/31/2006 die xxxi mensis i annoque mmvi 06 vi 2006} test clock-2.1587 {conversion of 2006-02-01} { clock format 1138797296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2006 12:34:56 die i mensis ii annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2453768 02 ii 2 02/01/2006 die i mensis ii annoque mmvi 06 vi 2006} test clock-2.1588 {conversion of 2006-02-28} { clock format 1141130096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2006 12:34:56 die xxviii mensis ii annoque mmvi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2453795 02 ii 2 02/28/2006 die xxviii mensis ii annoque mmvi 06 vi 2006} test clock-2.1589 {conversion of 2006-03-01} { clock format 1141216496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2006 12:34:56 die i mensis iii annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2453796 03 iii 3 03/01/2006 die i mensis iii annoque mmvi 06 vi 2006} test clock-2.1590 {conversion of 2006-03-31} { clock format 1143808496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2006 12:34:56 die xxxi mensis iii annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2453826 03 iii 3 03/31/2006 die xxxi mensis iii annoque mmvi 06 vi 2006} test clock-2.1591 {conversion of 2006-04-01} { clock format 1143894896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2006 12:34:56 die i mensis iv annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2453827 04 iv 4 04/01/2006 die i mensis iv annoque mmvi 06 vi 2006} test clock-2.1592 {conversion of 2006-04-30} { clock format 1146400496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2006 12:34:56 die xxx mensis iv annoque mmvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2453856 04 iv 4 04/30/2006 die xxx mensis iv annoque mmvi 06 vi 2006} test clock-2.1593 {conversion of 2006-05-01} { clock format 1146486896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2006 12:34:56 die i mensis v annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2453857 05 v 5 05/01/2006 die i mensis v annoque mmvi 06 vi 2006} test clock-2.1594 {conversion of 2006-05-31} { clock format 1149078896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2006 12:34:56 die xxxi mensis v annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2453887 05 v 5 05/31/2006 die xxxi mensis v annoque mmvi 06 vi 2006} test clock-2.1595 {conversion of 2006-06-01} { clock format 1149165296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2006 12:34:56 die i mensis vi annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2453888 06 vi 6 06/01/2006 die i mensis vi annoque mmvi 06 vi 2006} test clock-2.1596 {conversion of 2006-06-30} { clock format 1151670896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2006 12:34:56 die xxx mensis vi annoque mmvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2453917 06 vi 6 06/30/2006 die xxx mensis vi annoque mmvi 06 vi 2006} test clock-2.1597 {conversion of 2006-07-01} { clock format 1151757296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2006 12:34:56 die i mensis vii annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2453918 07 vii 7 07/01/2006 die i mensis vii annoque mmvi 06 vi 2006} test clock-2.1598 {conversion of 2006-07-31} { clock format 1154349296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2006 12:34:56 die xxxi mensis vii annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2453948 07 vii 7 07/31/2006 die xxxi mensis vii annoque mmvi 06 vi 2006} test clock-2.1599 {conversion of 2006-08-01} { clock format 1154435696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2006 12:34:56 die i mensis viii annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2453949 08 viii 8 08/01/2006 die i mensis viii annoque mmvi 06 vi 2006} test clock-2.1600 {conversion of 2006-08-31} { clock format 1157027696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2006 12:34:56 die xxxi mensis viii annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2453979 08 viii 8 08/31/2006 die xxxi mensis viii annoque mmvi 06 vi 2006} test clock-2.1601 {conversion of 2006-09-01} { clock format 1157114096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2006 12:34:56 die i mensis ix annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2453980 09 ix 9 09/01/2006 die i mensis ix annoque mmvi 06 vi 2006} test clock-2.1602 {conversion of 2006-09-30} { clock format 1159619696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2006 12:34:56 die xxx mensis ix annoque mmvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2454009 09 ix 9 09/30/2006 die xxx mensis ix annoque mmvi 06 vi 2006} test clock-2.1603 {conversion of 2006-10-01} { clock format 1159706096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2006 12:34:56 die i mensis x annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2454010 10 x 10 10/01/2006 die i mensis x annoque mmvi 06 vi 2006} test clock-2.1604 {conversion of 2006-10-31} { clock format 1162298096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2006 12:34:56 die xxxi mensis x annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2454040 10 x 10 10/31/2006 die xxxi mensis x annoque mmvi 06 vi 2006} test clock-2.1605 {conversion of 2006-11-01} { clock format 1162384496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2006 12:34:56 die i mensis xi annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2454041 11 xi 11 11/01/2006 die i mensis xi annoque mmvi 06 vi 2006} test clock-2.1606 {conversion of 2006-11-30} { clock format 1164890096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2006 12:34:56 die xxx mensis xi annoque mmvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2454070 11 xi 11 11/30/2006 die xxx mensis xi annoque mmvi 06 vi 2006} test clock-2.1607 {conversion of 2006-12-01} { clock format 1164976496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2006 12:34:56 die i mensis xii annoque mmvi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2454071 12 xii 12 12/01/2006 die i mensis xii annoque mmvi 06 vi 2006} test clock-2.1608 {conversion of 2006-12-31} { clock format 1167568496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2006 12:34:56 die xxxi mensis xii annoque mmvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2454101 12 xii 12 12/31/2006 die xxxi mensis xii annoque mmvi 06 vi 2006} test clock-2.1609 {conversion of 2007-01-01} { clock format 1167654896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2007 12:34:56 die i mensis i annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2454102 01 i 1 01/01/2007 die i mensis i annoque mmvii 07 vii 2007} test clock-2.1610 {conversion of 2007-01-31} { clock format 1170246896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2007 12:34:56 die xxxi mensis i annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2454132 01 i 1 01/31/2007 die xxxi mensis i annoque mmvii 07 vii 2007} test clock-2.1611 {conversion of 2007-02-01} { clock format 1170333296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2007 12:34:56 die i mensis ii annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2454133 02 ii 2 02/01/2007 die i mensis ii annoque mmvii 07 vii 2007} test clock-2.1612 {conversion of 2007-02-28} { clock format 1172666096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2007 12:34:56 die xxviii mensis ii annoque mmvii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2454160 02 ii 2 02/28/2007 die xxviii mensis ii annoque mmvii 07 vii 2007} test clock-2.1613 {conversion of 2007-03-01} { clock format 1172752496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2007 12:34:56 die i mensis iii annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2454161 03 iii 3 03/01/2007 die i mensis iii annoque mmvii 07 vii 2007} test clock-2.1614 {conversion of 2007-03-31} { clock format 1175344496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2007 12:34:56 die xxxi mensis iii annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2454191 03 iii 3 03/31/2007 die xxxi mensis iii annoque mmvii 07 vii 2007} test clock-2.1615 {conversion of 2007-04-01} { clock format 1175430896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2007 12:34:56 die i mensis iv annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2454192 04 iv 4 04/01/2007 die i mensis iv annoque mmvii 07 vii 2007} test clock-2.1616 {conversion of 2007-04-30} { clock format 1177936496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2007 12:34:56 die xxx mensis iv annoque mmvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2454221 04 iv 4 04/30/2007 die xxx mensis iv annoque mmvii 07 vii 2007} test clock-2.1617 {conversion of 2007-05-01} { clock format 1178022896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2007 12:34:56 die i mensis v annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2454222 05 v 5 05/01/2007 die i mensis v annoque mmvii 07 vii 2007} test clock-2.1618 {conversion of 2007-05-31} { clock format 1180614896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2007 12:34:56 die xxxi mensis v annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2454252 05 v 5 05/31/2007 die xxxi mensis v annoque mmvii 07 vii 2007} test clock-2.1619 {conversion of 2007-06-01} { clock format 1180701296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2007 12:34:56 die i mensis vi annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2454253 06 vi 6 06/01/2007 die i mensis vi annoque mmvii 07 vii 2007} test clock-2.1620 {conversion of 2007-06-30} { clock format 1183206896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2007 12:34:56 die xxx mensis vi annoque mmvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2454282 06 vi 6 06/30/2007 die xxx mensis vi annoque mmvii 07 vii 2007} test clock-2.1621 {conversion of 2007-07-01} { clock format 1183293296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2007 12:34:56 die i mensis vii annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2454283 07 vii 7 07/01/2007 die i mensis vii annoque mmvii 07 vii 2007} test clock-2.1622 {conversion of 2007-07-31} { clock format 1185885296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2007 12:34:56 die xxxi mensis vii annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2454313 07 vii 7 07/31/2007 die xxxi mensis vii annoque mmvii 07 vii 2007} test clock-2.1623 {conversion of 2007-08-01} { clock format 1185971696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2007 12:34:56 die i mensis viii annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2454314 08 viii 8 08/01/2007 die i mensis viii annoque mmvii 07 vii 2007} test clock-2.1624 {conversion of 2007-08-31} { clock format 1188563696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2007 12:34:56 die xxxi mensis viii annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2454344 08 viii 8 08/31/2007 die xxxi mensis viii annoque mmvii 07 vii 2007} test clock-2.1625 {conversion of 2007-09-01} { clock format 1188650096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2007 12:34:56 die i mensis ix annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2454345 09 ix 9 09/01/2007 die i mensis ix annoque mmvii 07 vii 2007} test clock-2.1626 {conversion of 2007-09-30} { clock format 1191155696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2007 12:34:56 die xxx mensis ix annoque mmvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2454374 09 ix 9 09/30/2007 die xxx mensis ix annoque mmvii 07 vii 2007} test clock-2.1627 {conversion of 2007-10-01} { clock format 1191242096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2007 12:34:56 die i mensis x annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2454375 10 x 10 10/01/2007 die i mensis x annoque mmvii 07 vii 2007} test clock-2.1628 {conversion of 2007-10-31} { clock format 1193834096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2007 12:34:56 die xxxi mensis x annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2454405 10 x 10 10/31/2007 die xxxi mensis x annoque mmvii 07 vii 2007} test clock-2.1629 {conversion of 2007-11-01} { clock format 1193920496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2007 12:34:56 die i mensis xi annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2454406 11 xi 11 11/01/2007 die i mensis xi annoque mmvii 07 vii 2007} test clock-2.1630 {conversion of 2007-11-30} { clock format 1196426096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2007 12:34:56 die xxx mensis xi annoque mmvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2454435 11 xi 11 11/30/2007 die xxx mensis xi annoque mmvii 07 vii 2007} test clock-2.1631 {conversion of 2007-12-01} { clock format 1196512496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2007 12:34:56 die i mensis xii annoque mmvii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2454436 12 xii 12 12/01/2007 die i mensis xii annoque mmvii 07 vii 2007} test clock-2.1632 {conversion of 2007-12-31} { clock format 1199104496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2007 12:34:56 die xxxi mensis xii annoque mmvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2454466 12 xii 12 12/31/2007 die xxxi mensis xii annoque mmvii 07 vii 2007} test clock-2.1633 {conversion of 2008-01-01} { clock format 1199190896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2008 12:34:56 die i mensis i annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2454467 01 i 1 01/01/2008 die i mensis i annoque mmviii 08 viii 2008} test clock-2.1634 {conversion of 2008-01-31} { clock format 1201782896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2008 12:34:56 die xxxi mensis i annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2454497 01 i 1 01/31/2008 die xxxi mensis i annoque mmviii 08 viii 2008} test clock-2.1635 {conversion of 2008-02-01} { clock format 1201869296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2008 12:34:56 die i mensis ii annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2454498 02 ii 2 02/01/2008 die i mensis ii annoque mmviii 08 viii 2008} test clock-2.1636 {conversion of 2008-02-29} { clock format 1204288496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2008 12:34:56 die xxix mensis ii annoque mmviii xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2454526 02 ii 2 02/29/2008 die xxix mensis ii annoque mmviii 08 viii 2008} test clock-2.1637 {conversion of 2008-03-01} { clock format 1204374896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2008 12:34:56 die i mensis iii annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2454527 03 iii 3 03/01/2008 die i mensis iii annoque mmviii 08 viii 2008} test clock-2.1638 {conversion of 2008-03-31} { clock format 1206966896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2008 12:34:56 die xxxi mensis iii annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2454557 03 iii 3 03/31/2008 die xxxi mensis iii annoque mmviii 08 viii 2008} test clock-2.1639 {conversion of 2008-04-01} { clock format 1207053296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2008 12:34:56 die i mensis iv annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2454558 04 iv 4 04/01/2008 die i mensis iv annoque mmviii 08 viii 2008} test clock-2.1640 {conversion of 2008-04-30} { clock format 1209558896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2008 12:34:56 die xxx mensis iv annoque mmviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2454587 04 iv 4 04/30/2008 die xxx mensis iv annoque mmviii 08 viii 2008} test clock-2.1641 {conversion of 2008-05-01} { clock format 1209645296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2008 12:34:56 die i mensis v annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2454588 05 v 5 05/01/2008 die i mensis v annoque mmviii 08 viii 2008} test clock-2.1642 {conversion of 2008-05-31} { clock format 1212237296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2008 12:34:56 die xxxi mensis v annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2454618 05 v 5 05/31/2008 die xxxi mensis v annoque mmviii 08 viii 2008} test clock-2.1643 {conversion of 2008-06-01} { clock format 1212323696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2008 12:34:56 die i mensis vi annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2454619 06 vi 6 06/01/2008 die i mensis vi annoque mmviii 08 viii 2008} test clock-2.1644 {conversion of 2008-06-30} { clock format 1214829296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2008 12:34:56 die xxx mensis vi annoque mmviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2454648 06 vi 6 06/30/2008 die xxx mensis vi annoque mmviii 08 viii 2008} test clock-2.1645 {conversion of 2008-07-01} { clock format 1214915696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2008 12:34:56 die i mensis vii annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2454649 07 vii 7 07/01/2008 die i mensis vii annoque mmviii 08 viii 2008} test clock-2.1646 {conversion of 2008-07-31} { clock format 1217507696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2008 12:34:56 die xxxi mensis vii annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2454679 07 vii 7 07/31/2008 die xxxi mensis vii annoque mmviii 08 viii 2008} test clock-2.1647 {conversion of 2008-08-01} { clock format 1217594096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2008 12:34:56 die i mensis viii annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2454680 08 viii 8 08/01/2008 die i mensis viii annoque mmviii 08 viii 2008} test clock-2.1648 {conversion of 2008-08-31} { clock format 1220186096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2008 12:34:56 die xxxi mensis viii annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2454710 08 viii 8 08/31/2008 die xxxi mensis viii annoque mmviii 08 viii 2008} test clock-2.1649 {conversion of 2008-09-01} { clock format 1220272496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2008 12:34:56 die i mensis ix annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2454711 09 ix 9 09/01/2008 die i mensis ix annoque mmviii 08 viii 2008} test clock-2.1650 {conversion of 2008-09-30} { clock format 1222778096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2008 12:34:56 die xxx mensis ix annoque mmviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2454740 09 ix 9 09/30/2008 die xxx mensis ix annoque mmviii 08 viii 2008} test clock-2.1651 {conversion of 2008-10-01} { clock format 1222864496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2008 12:34:56 die i mensis x annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2454741 10 x 10 10/01/2008 die i mensis x annoque mmviii 08 viii 2008} test clock-2.1652 {conversion of 2008-10-31} { clock format 1225456496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2008 12:34:56 die xxxi mensis x annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2454771 10 x 10 10/31/2008 die xxxi mensis x annoque mmviii 08 viii 2008} test clock-2.1653 {conversion of 2008-11-01} { clock format 1225542896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2008 12:34:56 die i mensis xi annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2454772 11 xi 11 11/01/2008 die i mensis xi annoque mmviii 08 viii 2008} test clock-2.1654 {conversion of 2008-11-30} { clock format 1228048496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2008 12:34:56 die xxx mensis xi annoque mmviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2454801 11 xi 11 11/30/2008 die xxx mensis xi annoque mmviii 08 viii 2008} test clock-2.1655 {conversion of 2008-12-01} { clock format 1228134896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2008 12:34:56 die i mensis xii annoque mmviii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2454802 12 xii 12 12/01/2008 die i mensis xii annoque mmviii 08 viii 2008} test clock-2.1656 {conversion of 2008-12-31} { clock format 1230726896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2008 12:34:56 die xxxi mensis xii annoque mmviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2454832 12 xii 12 12/31/2008 die xxxi mensis xii annoque mmviii 08 viii 2008} test clock-2.1657 {conversion of 2009-01-01} { clock format 1230813296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2009 12:34:56 die i mensis i annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2454833 01 i 1 01/01/2009 die i mensis i annoque mmix 09 ix 2009} test clock-2.1658 {conversion of 2009-01-31} { clock format 1233405296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2009 12:34:56 die xxxi mensis i annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2454863 01 i 1 01/31/2009 die xxxi mensis i annoque mmix 09 ix 2009} test clock-2.1659 {conversion of 2009-02-01} { clock format 1233491696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2009 12:34:56 die i mensis ii annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2454864 02 ii 2 02/01/2009 die i mensis ii annoque mmix 09 ix 2009} test clock-2.1660 {conversion of 2009-02-28} { clock format 1235824496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2009 12:34:56 die xxviii mensis ii annoque mmix xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2454891 02 ii 2 02/28/2009 die xxviii mensis ii annoque mmix 09 ix 2009} test clock-2.1661 {conversion of 2009-03-01} { clock format 1235910896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2009 12:34:56 die i mensis iii annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2454892 03 iii 3 03/01/2009 die i mensis iii annoque mmix 09 ix 2009} test clock-2.1662 {conversion of 2009-03-31} { clock format 1238502896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2009 12:34:56 die xxxi mensis iii annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2454922 03 iii 3 03/31/2009 die xxxi mensis iii annoque mmix 09 ix 2009} test clock-2.1663 {conversion of 2009-04-01} { clock format 1238589296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2009 12:34:56 die i mensis iv annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2454923 04 iv 4 04/01/2009 die i mensis iv annoque mmix 09 ix 2009} test clock-2.1664 {conversion of 2009-04-30} { clock format 1241094896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2009 12:34:56 die xxx mensis iv annoque mmix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2454952 04 iv 4 04/30/2009 die xxx mensis iv annoque mmix 09 ix 2009} test clock-2.1665 {conversion of 2009-05-01} { clock format 1241181296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2009 12:34:56 die i mensis v annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2454953 05 v 5 05/01/2009 die i mensis v annoque mmix 09 ix 2009} test clock-2.1666 {conversion of 2009-05-31} { clock format 1243773296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2009 12:34:56 die xxxi mensis v annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2454983 05 v 5 05/31/2009 die xxxi mensis v annoque mmix 09 ix 2009} test clock-2.1667 {conversion of 2009-06-01} { clock format 1243859696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2009 12:34:56 die i mensis vi annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2454984 06 vi 6 06/01/2009 die i mensis vi annoque mmix 09 ix 2009} test clock-2.1668 {conversion of 2009-06-30} { clock format 1246365296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2009 12:34:56 die xxx mensis vi annoque mmix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2455013 06 vi 6 06/30/2009 die xxx mensis vi annoque mmix 09 ix 2009} test clock-2.1669 {conversion of 2009-07-01} { clock format 1246451696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2009 12:34:56 die i mensis vii annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2455014 07 vii 7 07/01/2009 die i mensis vii annoque mmix 09 ix 2009} test clock-2.1670 {conversion of 2009-07-31} { clock format 1249043696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2009 12:34:56 die xxxi mensis vii annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2455044 07 vii 7 07/31/2009 die xxxi mensis vii annoque mmix 09 ix 2009} test clock-2.1671 {conversion of 2009-08-01} { clock format 1249130096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2009 12:34:56 die i mensis viii annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2455045 08 viii 8 08/01/2009 die i mensis viii annoque mmix 09 ix 2009} test clock-2.1672 {conversion of 2009-08-31} { clock format 1251722096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2009 12:34:56 die xxxi mensis viii annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2455075 08 viii 8 08/31/2009 die xxxi mensis viii annoque mmix 09 ix 2009} test clock-2.1673 {conversion of 2009-09-01} { clock format 1251808496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2009 12:34:56 die i mensis ix annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2455076 09 ix 9 09/01/2009 die i mensis ix annoque mmix 09 ix 2009} test clock-2.1674 {conversion of 2009-09-30} { clock format 1254314096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2009 12:34:56 die xxx mensis ix annoque mmix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2455105 09 ix 9 09/30/2009 die xxx mensis ix annoque mmix 09 ix 2009} test clock-2.1675 {conversion of 2009-10-01} { clock format 1254400496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2009 12:34:56 die i mensis x annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2455106 10 x 10 10/01/2009 die i mensis x annoque mmix 09 ix 2009} test clock-2.1676 {conversion of 2009-10-31} { clock format 1256992496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2009 12:34:56 die xxxi mensis x annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2455136 10 x 10 10/31/2009 die xxxi mensis x annoque mmix 09 ix 2009} test clock-2.1677 {conversion of 2009-11-01} { clock format 1257078896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2009 12:34:56 die i mensis xi annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2455137 11 xi 11 11/01/2009 die i mensis xi annoque mmix 09 ix 2009} test clock-2.1678 {conversion of 2009-11-30} { clock format 1259584496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2009 12:34:56 die xxx mensis xi annoque mmix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2455166 11 xi 11 11/30/2009 die xxx mensis xi annoque mmix 09 ix 2009} test clock-2.1679 {conversion of 2009-12-01} { clock format 1259670896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2009 12:34:56 die i mensis xii annoque mmix xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2455167 12 xii 12 12/01/2009 die i mensis xii annoque mmix 09 ix 2009} test clock-2.1680 {conversion of 2009-12-31} { clock format 1262262896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2009 12:34:56 die xxxi mensis xii annoque mmix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2455197 12 xii 12 12/31/2009 die xxxi mensis xii annoque mmix 09 ix 2009} test clock-2.1681 {conversion of 2010-01-01} { clock format 1262349296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2010 12:34:56 die i mensis i annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2455198 01 i 1 01/01/2010 die i mensis i annoque mmx 10 x 2010} test clock-2.1682 {conversion of 2010-01-31} { clock format 1264941296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2010 12:34:56 die xxxi mensis i annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2455228 01 i 1 01/31/2010 die xxxi mensis i annoque mmx 10 x 2010} test clock-2.1683 {conversion of 2010-02-01} { clock format 1265027696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2010 12:34:56 die i mensis ii annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2455229 02 ii 2 02/01/2010 die i mensis ii annoque mmx 10 x 2010} test clock-2.1684 {conversion of 2010-02-28} { clock format 1267360496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2010 12:34:56 die xxviii mensis ii annoque mmx xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2455256 02 ii 2 02/28/2010 die xxviii mensis ii annoque mmx 10 x 2010} test clock-2.1685 {conversion of 2010-03-01} { clock format 1267446896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2010 12:34:56 die i mensis iii annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2455257 03 iii 3 03/01/2010 die i mensis iii annoque mmx 10 x 2010} test clock-2.1686 {conversion of 2010-03-31} { clock format 1270038896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2010 12:34:56 die xxxi mensis iii annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2455287 03 iii 3 03/31/2010 die xxxi mensis iii annoque mmx 10 x 2010} test clock-2.1687 {conversion of 2010-04-01} { clock format 1270125296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2010 12:34:56 die i mensis iv annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2455288 04 iv 4 04/01/2010 die i mensis iv annoque mmx 10 x 2010} test clock-2.1688 {conversion of 2010-04-30} { clock format 1272630896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2010 12:34:56 die xxx mensis iv annoque mmx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2455317 04 iv 4 04/30/2010 die xxx mensis iv annoque mmx 10 x 2010} test clock-2.1689 {conversion of 2010-05-01} { clock format 1272717296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2010 12:34:56 die i mensis v annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2455318 05 v 5 05/01/2010 die i mensis v annoque mmx 10 x 2010} test clock-2.1690 {conversion of 2010-05-31} { clock format 1275309296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2010 12:34:56 die xxxi mensis v annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2455348 05 v 5 05/31/2010 die xxxi mensis v annoque mmx 10 x 2010} test clock-2.1691 {conversion of 2010-06-01} { clock format 1275395696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2010 12:34:56 die i mensis vi annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2455349 06 vi 6 06/01/2010 die i mensis vi annoque mmx 10 x 2010} test clock-2.1692 {conversion of 2010-06-30} { clock format 1277901296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2010 12:34:56 die xxx mensis vi annoque mmx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2455378 06 vi 6 06/30/2010 die xxx mensis vi annoque mmx 10 x 2010} test clock-2.1693 {conversion of 2010-07-01} { clock format 1277987696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2010 12:34:56 die i mensis vii annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2455379 07 vii 7 07/01/2010 die i mensis vii annoque mmx 10 x 2010} test clock-2.1694 {conversion of 2010-07-31} { clock format 1280579696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2010 12:34:56 die xxxi mensis vii annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2455409 07 vii 7 07/31/2010 die xxxi mensis vii annoque mmx 10 x 2010} test clock-2.1695 {conversion of 2010-08-01} { clock format 1280666096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2010 12:34:56 die i mensis viii annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2455410 08 viii 8 08/01/2010 die i mensis viii annoque mmx 10 x 2010} test clock-2.1696 {conversion of 2010-08-31} { clock format 1283258096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2010 12:34:56 die xxxi mensis viii annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2455440 08 viii 8 08/31/2010 die xxxi mensis viii annoque mmx 10 x 2010} test clock-2.1697 {conversion of 2010-09-01} { clock format 1283344496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2010 12:34:56 die i mensis ix annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2455441 09 ix 9 09/01/2010 die i mensis ix annoque mmx 10 x 2010} test clock-2.1698 {conversion of 2010-09-30} { clock format 1285850096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2010 12:34:56 die xxx mensis ix annoque mmx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2455470 09 ix 9 09/30/2010 die xxx mensis ix annoque mmx 10 x 2010} test clock-2.1699 {conversion of 2010-10-01} { clock format 1285936496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2010 12:34:56 die i mensis x annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2455471 10 x 10 10/01/2010 die i mensis x annoque mmx 10 x 2010} test clock-2.1700 {conversion of 2010-10-31} { clock format 1288528496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2010 12:34:56 die xxxi mensis x annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2455501 10 x 10 10/31/2010 die xxxi mensis x annoque mmx 10 x 2010} test clock-2.1701 {conversion of 2010-11-01} { clock format 1288614896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2010 12:34:56 die i mensis xi annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2455502 11 xi 11 11/01/2010 die i mensis xi annoque mmx 10 x 2010} test clock-2.1702 {conversion of 2010-11-30} { clock format 1291120496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2010 12:34:56 die xxx mensis xi annoque mmx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2455531 11 xi 11 11/30/2010 die xxx mensis xi annoque mmx 10 x 2010} test clock-2.1703 {conversion of 2010-12-01} { clock format 1291206896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2010 12:34:56 die i mensis xii annoque mmx xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2455532 12 xii 12 12/01/2010 die i mensis xii annoque mmx 10 x 2010} test clock-2.1704 {conversion of 2010-12-31} { clock format 1293798896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2010 12:34:56 die xxxi mensis xii annoque mmx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2455562 12 xii 12 12/31/2010 die xxxi mensis xii annoque mmx 10 x 2010} test clock-2.1705 {conversion of 2011-01-01} { clock format 1293885296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2011 12:34:56 die i mensis i annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2455563 01 i 1 01/01/2011 die i mensis i annoque mmxi 11 xi 2011} test clock-2.1706 {conversion of 2011-01-31} { clock format 1296477296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2011 12:34:56 die xxxi mensis i annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2455593 01 i 1 01/31/2011 die xxxi mensis i annoque mmxi 11 xi 2011} test clock-2.1707 {conversion of 2011-02-01} { clock format 1296563696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2011 12:34:56 die i mensis ii annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2455594 02 ii 2 02/01/2011 die i mensis ii annoque mmxi 11 xi 2011} test clock-2.1708 {conversion of 2011-02-28} { clock format 1298896496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2011 12:34:56 die xxviii mensis ii annoque mmxi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2455621 02 ii 2 02/28/2011 die xxviii mensis ii annoque mmxi 11 xi 2011} test clock-2.1709 {conversion of 2011-03-01} { clock format 1298982896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2011 12:34:56 die i mensis iii annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2455622 03 iii 3 03/01/2011 die i mensis iii annoque mmxi 11 xi 2011} test clock-2.1710 {conversion of 2011-03-31} { clock format 1301574896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2011 12:34:56 die xxxi mensis iii annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2455652 03 iii 3 03/31/2011 die xxxi mensis iii annoque mmxi 11 xi 2011} test clock-2.1711 {conversion of 2011-04-01} { clock format 1301661296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2011 12:34:56 die i mensis iv annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2455653 04 iv 4 04/01/2011 die i mensis iv annoque mmxi 11 xi 2011} test clock-2.1712 {conversion of 2011-04-30} { clock format 1304166896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2011 12:34:56 die xxx mensis iv annoque mmxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2455682 04 iv 4 04/30/2011 die xxx mensis iv annoque mmxi 11 xi 2011} test clock-2.1713 {conversion of 2011-05-01} { clock format 1304253296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2011 12:34:56 die i mensis v annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2455683 05 v 5 05/01/2011 die i mensis v annoque mmxi 11 xi 2011} test clock-2.1714 {conversion of 2011-05-31} { clock format 1306845296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2011 12:34:56 die xxxi mensis v annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2455713 05 v 5 05/31/2011 die xxxi mensis v annoque mmxi 11 xi 2011} test clock-2.1715 {conversion of 2011-06-01} { clock format 1306931696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2011 12:34:56 die i mensis vi annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2455714 06 vi 6 06/01/2011 die i mensis vi annoque mmxi 11 xi 2011} test clock-2.1716 {conversion of 2011-06-30} { clock format 1309437296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2011 12:34:56 die xxx mensis vi annoque mmxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2455743 06 vi 6 06/30/2011 die xxx mensis vi annoque mmxi 11 xi 2011} test clock-2.1717 {conversion of 2011-07-01} { clock format 1309523696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2011 12:34:56 die i mensis vii annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2455744 07 vii 7 07/01/2011 die i mensis vii annoque mmxi 11 xi 2011} test clock-2.1718 {conversion of 2011-07-31} { clock format 1312115696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2011 12:34:56 die xxxi mensis vii annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2455774 07 vii 7 07/31/2011 die xxxi mensis vii annoque mmxi 11 xi 2011} test clock-2.1719 {conversion of 2011-08-01} { clock format 1312202096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2011 12:34:56 die i mensis viii annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2455775 08 viii 8 08/01/2011 die i mensis viii annoque mmxi 11 xi 2011} test clock-2.1720 {conversion of 2011-08-31} { clock format 1314794096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2011 12:34:56 die xxxi mensis viii annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2455805 08 viii 8 08/31/2011 die xxxi mensis viii annoque mmxi 11 xi 2011} test clock-2.1721 {conversion of 2011-09-01} { clock format 1314880496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2011 12:34:56 die i mensis ix annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2455806 09 ix 9 09/01/2011 die i mensis ix annoque mmxi 11 xi 2011} test clock-2.1722 {conversion of 2011-09-30} { clock format 1317386096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2011 12:34:56 die xxx mensis ix annoque mmxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2455835 09 ix 9 09/30/2011 die xxx mensis ix annoque mmxi 11 xi 2011} test clock-2.1723 {conversion of 2011-10-01} { clock format 1317472496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2011 12:34:56 die i mensis x annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2455836 10 x 10 10/01/2011 die i mensis x annoque mmxi 11 xi 2011} test clock-2.1724 {conversion of 2011-10-31} { clock format 1320064496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2011 12:34:56 die xxxi mensis x annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2455866 10 x 10 10/31/2011 die xxxi mensis x annoque mmxi 11 xi 2011} test clock-2.1725 {conversion of 2011-11-01} { clock format 1320150896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2011 12:34:56 die i mensis xi annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2455867 11 xi 11 11/01/2011 die i mensis xi annoque mmxi 11 xi 2011} test clock-2.1726 {conversion of 2011-11-30} { clock format 1322656496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2011 12:34:56 die xxx mensis xi annoque mmxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2455896 11 xi 11 11/30/2011 die xxx mensis xi annoque mmxi 11 xi 2011} test clock-2.1727 {conversion of 2011-12-01} { clock format 1322742896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2011 12:34:56 die i mensis xii annoque mmxi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2455897 12 xii 12 12/01/2011 die i mensis xii annoque mmxi 11 xi 2011} test clock-2.1728 {conversion of 2011-12-31} { clock format 1325334896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2011 12:34:56 die xxxi mensis xii annoque mmxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2455927 12 xii 12 12/31/2011 die xxxi mensis xii annoque mmxi 11 xi 2011} test clock-2.1729 {conversion of 2012-01-01} { clock format 1325421296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2012 12:34:56 die i mensis i annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2455928 01 i 1 01/01/2012 die i mensis i annoque mmxii 12 xii 2012} test clock-2.1730 {conversion of 2012-01-31} { clock format 1328013296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2012 12:34:56 die xxxi mensis i annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2455958 01 i 1 01/31/2012 die xxxi mensis i annoque mmxii 12 xii 2012} test clock-2.1731 {conversion of 2012-02-01} { clock format 1328099696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2012 12:34:56 die i mensis ii annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2455959 02 ii 2 02/01/2012 die i mensis ii annoque mmxii 12 xii 2012} test clock-2.1732 {conversion of 2012-02-29} { clock format 1330518896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2012 12:34:56 die xxix mensis ii annoque mmxii xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2455987 02 ii 2 02/29/2012 die xxix mensis ii annoque mmxii 12 xii 2012} test clock-2.1733 {conversion of 2012-03-01} { clock format 1330605296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2012 12:34:56 die i mensis iii annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2455988 03 iii 3 03/01/2012 die i mensis iii annoque mmxii 12 xii 2012} test clock-2.1734 {conversion of 2012-03-31} { clock format 1333197296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2012 12:34:56 die xxxi mensis iii annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2456018 03 iii 3 03/31/2012 die xxxi mensis iii annoque mmxii 12 xii 2012} test clock-2.1735 {conversion of 2012-04-01} { clock format 1333283696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2012 12:34:56 die i mensis iv annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2456019 04 iv 4 04/01/2012 die i mensis iv annoque mmxii 12 xii 2012} test clock-2.1736 {conversion of 2012-04-30} { clock format 1335789296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2012 12:34:56 die xxx mensis iv annoque mmxii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2456048 04 iv 4 04/30/2012 die xxx mensis iv annoque mmxii 12 xii 2012} test clock-2.1737 {conversion of 2012-05-01} { clock format 1335875696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2012 12:34:56 die i mensis v annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2456049 05 v 5 05/01/2012 die i mensis v annoque mmxii 12 xii 2012} test clock-2.1738 {conversion of 2012-05-31} { clock format 1338467696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2012 12:34:56 die xxxi mensis v annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2456079 05 v 5 05/31/2012 die xxxi mensis v annoque mmxii 12 xii 2012} test clock-2.1739 {conversion of 2012-06-01} { clock format 1338554096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2012 12:34:56 die i mensis vi annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2456080 06 vi 6 06/01/2012 die i mensis vi annoque mmxii 12 xii 2012} test clock-2.1740 {conversion of 2012-06-30} { clock format 1341059696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2012 12:34:56 die xxx mensis vi annoque mmxii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2456109 06 vi 6 06/30/2012 die xxx mensis vi annoque mmxii 12 xii 2012} test clock-2.1741 {conversion of 2012-07-01} { clock format 1341146096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2012 12:34:56 die i mensis vii annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2456110 07 vii 7 07/01/2012 die i mensis vii annoque mmxii 12 xii 2012} test clock-2.1742 {conversion of 2012-07-31} { clock format 1343738096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2012 12:34:56 die xxxi mensis vii annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2456140 07 vii 7 07/31/2012 die xxxi mensis vii annoque mmxii 12 xii 2012} test clock-2.1743 {conversion of 2012-08-01} { clock format 1343824496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2012 12:34:56 die i mensis viii annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2456141 08 viii 8 08/01/2012 die i mensis viii annoque mmxii 12 xii 2012} test clock-2.1744 {conversion of 2012-08-31} { clock format 1346416496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2012 12:34:56 die xxxi mensis viii annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2456171 08 viii 8 08/31/2012 die xxxi mensis viii annoque mmxii 12 xii 2012} test clock-2.1745 {conversion of 2012-09-01} { clock format 1346502896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2012 12:34:56 die i mensis ix annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2456172 09 ix 9 09/01/2012 die i mensis ix annoque mmxii 12 xii 2012} test clock-2.1746 {conversion of 2012-09-30} { clock format 1349008496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2012 12:34:56 die xxx mensis ix annoque mmxii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2456201 09 ix 9 09/30/2012 die xxx mensis ix annoque mmxii 12 xii 2012} test clock-2.1747 {conversion of 2012-10-01} { clock format 1349094896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2012 12:34:56 die i mensis x annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2456202 10 x 10 10/01/2012 die i mensis x annoque mmxii 12 xii 2012} test clock-2.1748 {conversion of 2012-10-31} { clock format 1351686896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2012 12:34:56 die xxxi mensis x annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2456232 10 x 10 10/31/2012 die xxxi mensis x annoque mmxii 12 xii 2012} test clock-2.1749 {conversion of 2012-11-01} { clock format 1351773296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2012 12:34:56 die i mensis xi annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2456233 11 xi 11 11/01/2012 die i mensis xi annoque mmxii 12 xii 2012} test clock-2.1750 {conversion of 2012-11-30} { clock format 1354278896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2012 12:34:56 die xxx mensis xi annoque mmxii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2456262 11 xi 11 11/30/2012 die xxx mensis xi annoque mmxii 12 xii 2012} test clock-2.1751 {conversion of 2012-12-01} { clock format 1354365296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2012 12:34:56 die i mensis xii annoque mmxii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2456263 12 xii 12 12/01/2012 die i mensis xii annoque mmxii 12 xii 2012} test clock-2.1752 {conversion of 2012-12-31} { clock format 1356957296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2012 12:34:56 die xxxi mensis xii annoque mmxii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2456293 12 xii 12 12/31/2012 die xxxi mensis xii annoque mmxii 12 xii 2012} test clock-2.1753 {conversion of 2013-01-01} { clock format 1357043696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2013 12:34:56 die i mensis i annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2456294 01 i 1 01/01/2013 die i mensis i annoque mmxiii 13 xiii 2013} test clock-2.1754 {conversion of 2013-01-31} { clock format 1359635696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2013 12:34:56 die xxxi mensis i annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2456324 01 i 1 01/31/2013 die xxxi mensis i annoque mmxiii 13 xiii 2013} test clock-2.1755 {conversion of 2013-02-01} { clock format 1359722096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2013 12:34:56 die i mensis ii annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2456325 02 ii 2 02/01/2013 die i mensis ii annoque mmxiii 13 xiii 2013} test clock-2.1756 {conversion of 2013-02-28} { clock format 1362054896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2013 12:34:56 die xxviii mensis ii annoque mmxiii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2456352 02 ii 2 02/28/2013 die xxviii mensis ii annoque mmxiii 13 xiii 2013} test clock-2.1757 {conversion of 2013-03-01} { clock format 1362141296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2013 12:34:56 die i mensis iii annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2456353 03 iii 3 03/01/2013 die i mensis iii annoque mmxiii 13 xiii 2013} test clock-2.1758 {conversion of 2013-03-31} { clock format 1364733296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2013 12:34:56 die xxxi mensis iii annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2456383 03 iii 3 03/31/2013 die xxxi mensis iii annoque mmxiii 13 xiii 2013} test clock-2.1759 {conversion of 2013-04-01} { clock format 1364819696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2013 12:34:56 die i mensis iv annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2456384 04 iv 4 04/01/2013 die i mensis iv annoque mmxiii 13 xiii 2013} test clock-2.1760 {conversion of 2013-04-30} { clock format 1367325296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2013 12:34:56 die xxx mensis iv annoque mmxiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2456413 04 iv 4 04/30/2013 die xxx mensis iv annoque mmxiii 13 xiii 2013} test clock-2.1761 {conversion of 2013-05-01} { clock format 1367411696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2013 12:34:56 die i mensis v annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2456414 05 v 5 05/01/2013 die i mensis v annoque mmxiii 13 xiii 2013} test clock-2.1762 {conversion of 2013-05-31} { clock format 1370003696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2013 12:34:56 die xxxi mensis v annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2456444 05 v 5 05/31/2013 die xxxi mensis v annoque mmxiii 13 xiii 2013} test clock-2.1763 {conversion of 2013-06-01} { clock format 1370090096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2013 12:34:56 die i mensis vi annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2456445 06 vi 6 06/01/2013 die i mensis vi annoque mmxiii 13 xiii 2013} test clock-2.1764 {conversion of 2013-06-30} { clock format 1372595696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2013 12:34:56 die xxx mensis vi annoque mmxiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2456474 06 vi 6 06/30/2013 die xxx mensis vi annoque mmxiii 13 xiii 2013} test clock-2.1765 {conversion of 2013-07-01} { clock format 1372682096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2013 12:34:56 die i mensis vii annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2456475 07 vii 7 07/01/2013 die i mensis vii annoque mmxiii 13 xiii 2013} test clock-2.1766 {conversion of 2013-07-31} { clock format 1375274096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2013 12:34:56 die xxxi mensis vii annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2456505 07 vii 7 07/31/2013 die xxxi mensis vii annoque mmxiii 13 xiii 2013} test clock-2.1767 {conversion of 2013-08-01} { clock format 1375360496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2013 12:34:56 die i mensis viii annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2456506 08 viii 8 08/01/2013 die i mensis viii annoque mmxiii 13 xiii 2013} test clock-2.1768 {conversion of 2013-08-31} { clock format 1377952496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2013 12:34:56 die xxxi mensis viii annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2456536 08 viii 8 08/31/2013 die xxxi mensis viii annoque mmxiii 13 xiii 2013} test clock-2.1769 {conversion of 2013-09-01} { clock format 1378038896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2013 12:34:56 die i mensis ix annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2456537 09 ix 9 09/01/2013 die i mensis ix annoque mmxiii 13 xiii 2013} test clock-2.1770 {conversion of 2013-09-30} { clock format 1380544496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2013 12:34:56 die xxx mensis ix annoque mmxiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2456566 09 ix 9 09/30/2013 die xxx mensis ix annoque mmxiii 13 xiii 2013} test clock-2.1771 {conversion of 2013-10-01} { clock format 1380630896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2013 12:34:56 die i mensis x annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2456567 10 x 10 10/01/2013 die i mensis x annoque mmxiii 13 xiii 2013} test clock-2.1772 {conversion of 2013-10-31} { clock format 1383222896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2013 12:34:56 die xxxi mensis x annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2456597 10 x 10 10/31/2013 die xxxi mensis x annoque mmxiii 13 xiii 2013} test clock-2.1773 {conversion of 2013-11-01} { clock format 1383309296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2013 12:34:56 die i mensis xi annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2456598 11 xi 11 11/01/2013 die i mensis xi annoque mmxiii 13 xiii 2013} test clock-2.1774 {conversion of 2013-11-30} { clock format 1385814896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2013 12:34:56 die xxx mensis xi annoque mmxiii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2456627 11 xi 11 11/30/2013 die xxx mensis xi annoque mmxiii 13 xiii 2013} test clock-2.1775 {conversion of 2013-12-01} { clock format 1385901296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2013 12:34:56 die i mensis xii annoque mmxiii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2456628 12 xii 12 12/01/2013 die i mensis xii annoque mmxiii 13 xiii 2013} test clock-2.1776 {conversion of 2013-12-31} { clock format 1388493296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2013 12:34:56 die xxxi mensis xii annoque mmxiii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2456658 12 xii 12 12/31/2013 die xxxi mensis xii annoque mmxiii 13 xiii 2013} test clock-2.1777 {conversion of 2016-01-01} { clock format 1451651696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2016 12:34:56 die i mensis i annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2457389 01 i 1 01/01/2016 die i mensis i annoque mmxvi 16 xvi 2016} test clock-2.1778 {conversion of 2016-01-31} { clock format 1454243696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2016 12:34:56 die xxxi mensis i annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2457419 01 i 1 01/31/2016 die xxxi mensis i annoque mmxvi 16 xvi 2016} test clock-2.1779 {conversion of 2016-02-01} { clock format 1454330096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2016 12:34:56 die i mensis ii annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2457420 02 ii 2 02/01/2016 die i mensis ii annoque mmxvi 16 xvi 2016} test clock-2.1780 {conversion of 2016-02-29} { clock format 1456749296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2016 12:34:56 die xxix mensis ii annoque mmxvi xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2457448 02 ii 2 02/29/2016 die xxix mensis ii annoque mmxvi 16 xvi 2016} test clock-2.1781 {conversion of 2016-03-01} { clock format 1456835696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2016 12:34:56 die i mensis iii annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2457449 03 iii 3 03/01/2016 die i mensis iii annoque mmxvi 16 xvi 2016} test clock-2.1782 {conversion of 2016-03-31} { clock format 1459427696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2016 12:34:56 die xxxi mensis iii annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2457479 03 iii 3 03/31/2016 die xxxi mensis iii annoque mmxvi 16 xvi 2016} test clock-2.1783 {conversion of 2016-04-01} { clock format 1459514096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2016 12:34:56 die i mensis iv annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2457480 04 iv 4 04/01/2016 die i mensis iv annoque mmxvi 16 xvi 2016} test clock-2.1784 {conversion of 2016-04-30} { clock format 1462019696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2016 12:34:56 die xxx mensis iv annoque mmxvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2457509 04 iv 4 04/30/2016 die xxx mensis iv annoque mmxvi 16 xvi 2016} test clock-2.1785 {conversion of 2016-05-01} { clock format 1462106096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2016 12:34:56 die i mensis v annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2457510 05 v 5 05/01/2016 die i mensis v annoque mmxvi 16 xvi 2016} test clock-2.1786 {conversion of 2016-05-31} { clock format 1464698096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2016 12:34:56 die xxxi mensis v annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2457540 05 v 5 05/31/2016 die xxxi mensis v annoque mmxvi 16 xvi 2016} test clock-2.1787 {conversion of 2016-06-01} { clock format 1464784496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2016 12:34:56 die i mensis vi annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2457541 06 vi 6 06/01/2016 die i mensis vi annoque mmxvi 16 xvi 2016} test clock-2.1788 {conversion of 2016-06-30} { clock format 1467290096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2016 12:34:56 die xxx mensis vi annoque mmxvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2457570 06 vi 6 06/30/2016 die xxx mensis vi annoque mmxvi 16 xvi 2016} test clock-2.1789 {conversion of 2016-07-01} { clock format 1467376496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2016 12:34:56 die i mensis vii annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2457571 07 vii 7 07/01/2016 die i mensis vii annoque mmxvi 16 xvi 2016} test clock-2.1790 {conversion of 2016-07-31} { clock format 1469968496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2016 12:34:56 die xxxi mensis vii annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2457601 07 vii 7 07/31/2016 die xxxi mensis vii annoque mmxvi 16 xvi 2016} test clock-2.1791 {conversion of 2016-08-01} { clock format 1470054896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2016 12:34:56 die i mensis viii annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2457602 08 viii 8 08/01/2016 die i mensis viii annoque mmxvi 16 xvi 2016} test clock-2.1792 {conversion of 2016-08-31} { clock format 1472646896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2016 12:34:56 die xxxi mensis viii annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2457632 08 viii 8 08/31/2016 die xxxi mensis viii annoque mmxvi 16 xvi 2016} test clock-2.1793 {conversion of 2016-09-01} { clock format 1472733296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2016 12:34:56 die i mensis ix annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2457633 09 ix 9 09/01/2016 die i mensis ix annoque mmxvi 16 xvi 2016} test clock-2.1794 {conversion of 2016-09-30} { clock format 1475238896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2016 12:34:56 die xxx mensis ix annoque mmxvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2457662 09 ix 9 09/30/2016 die xxx mensis ix annoque mmxvi 16 xvi 2016} test clock-2.1795 {conversion of 2016-10-01} { clock format 1475325296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2016 12:34:56 die i mensis x annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2457663 10 x 10 10/01/2016 die i mensis x annoque mmxvi 16 xvi 2016} test clock-2.1796 {conversion of 2016-10-31} { clock format 1477917296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2016 12:34:56 die xxxi mensis x annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2457693 10 x 10 10/31/2016 die xxxi mensis x annoque mmxvi 16 xvi 2016} test clock-2.1797 {conversion of 2016-11-01} { clock format 1478003696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2016 12:34:56 die i mensis xi annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2457694 11 xi 11 11/01/2016 die i mensis xi annoque mmxvi 16 xvi 2016} test clock-2.1798 {conversion of 2016-11-30} { clock format 1480509296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2016 12:34:56 die xxx mensis xi annoque mmxvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2457723 11 xi 11 11/30/2016 die xxx mensis xi annoque mmxvi 16 xvi 2016} test clock-2.1799 {conversion of 2016-12-01} { clock format 1480595696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2016 12:34:56 die i mensis xii annoque mmxvi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2457724 12 xii 12 12/01/2016 die i mensis xii annoque mmxvi 16 xvi 2016} test clock-2.1800 {conversion of 2016-12-31} { clock format 1483187696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2016 12:34:56 die xxxi mensis xii annoque mmxvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2457754 12 xii 12 12/31/2016 die xxxi mensis xii annoque mmxvi 16 xvi 2016} test clock-2.1801 {conversion of 2017-01-01} { clock format 1483274096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2017 12:34:56 die i mensis i annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2457755 01 i 1 01/01/2017 die i mensis i annoque mmxvii 17 xvii 2017} test clock-2.1802 {conversion of 2017-01-31} { clock format 1485866096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2017 12:34:56 die xxxi mensis i annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2457785 01 i 1 01/31/2017 die xxxi mensis i annoque mmxvii 17 xvii 2017} test clock-2.1803 {conversion of 2017-02-01} { clock format 1485952496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2017 12:34:56 die i mensis ii annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2457786 02 ii 2 02/01/2017 die i mensis ii annoque mmxvii 17 xvii 2017} test clock-2.1804 {conversion of 2017-02-28} { clock format 1488285296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2017 12:34:56 die xxviii mensis ii annoque mmxvii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2457813 02 ii 2 02/28/2017 die xxviii mensis ii annoque mmxvii 17 xvii 2017} test clock-2.1805 {conversion of 2017-03-01} { clock format 1488371696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2017 12:34:56 die i mensis iii annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2457814 03 iii 3 03/01/2017 die i mensis iii annoque mmxvii 17 xvii 2017} test clock-2.1806 {conversion of 2017-03-31} { clock format 1490963696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2017 12:34:56 die xxxi mensis iii annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2457844 03 iii 3 03/31/2017 die xxxi mensis iii annoque mmxvii 17 xvii 2017} test clock-2.1807 {conversion of 2017-04-01} { clock format 1491050096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2017 12:34:56 die i mensis iv annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2457845 04 iv 4 04/01/2017 die i mensis iv annoque mmxvii 17 xvii 2017} test clock-2.1808 {conversion of 2017-04-30} { clock format 1493555696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2017 12:34:56 die xxx mensis iv annoque mmxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2457874 04 iv 4 04/30/2017 die xxx mensis iv annoque mmxvii 17 xvii 2017} test clock-2.1809 {conversion of 2017-05-01} { clock format 1493642096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2017 12:34:56 die i mensis v annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2457875 05 v 5 05/01/2017 die i mensis v annoque mmxvii 17 xvii 2017} test clock-2.1810 {conversion of 2017-05-31} { clock format 1496234096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2017 12:34:56 die xxxi mensis v annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2457905 05 v 5 05/31/2017 die xxxi mensis v annoque mmxvii 17 xvii 2017} test clock-2.1811 {conversion of 2017-06-01} { clock format 1496320496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2017 12:34:56 die i mensis vi annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2457906 06 vi 6 06/01/2017 die i mensis vi annoque mmxvii 17 xvii 2017} test clock-2.1812 {conversion of 2017-06-30} { clock format 1498826096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2017 12:34:56 die xxx mensis vi annoque mmxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2457935 06 vi 6 06/30/2017 die xxx mensis vi annoque mmxvii 17 xvii 2017} test clock-2.1813 {conversion of 2017-07-01} { clock format 1498912496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2017 12:34:56 die i mensis vii annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2457936 07 vii 7 07/01/2017 die i mensis vii annoque mmxvii 17 xvii 2017} test clock-2.1814 {conversion of 2017-07-31} { clock format 1501504496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2017 12:34:56 die xxxi mensis vii annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2457966 07 vii 7 07/31/2017 die xxxi mensis vii annoque mmxvii 17 xvii 2017} test clock-2.1815 {conversion of 2017-08-01} { clock format 1501590896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2017 12:34:56 die i mensis viii annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2457967 08 viii 8 08/01/2017 die i mensis viii annoque mmxvii 17 xvii 2017} test clock-2.1816 {conversion of 2017-08-31} { clock format 1504182896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2017 12:34:56 die xxxi mensis viii annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2457997 08 viii 8 08/31/2017 die xxxi mensis viii annoque mmxvii 17 xvii 2017} test clock-2.1817 {conversion of 2017-09-01} { clock format 1504269296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2017 12:34:56 die i mensis ix annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2457998 09 ix 9 09/01/2017 die i mensis ix annoque mmxvii 17 xvii 2017} test clock-2.1818 {conversion of 2017-09-30} { clock format 1506774896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2017 12:34:56 die xxx mensis ix annoque mmxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2458027 09 ix 9 09/30/2017 die xxx mensis ix annoque mmxvii 17 xvii 2017} test clock-2.1819 {conversion of 2017-10-01} { clock format 1506861296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2017 12:34:56 die i mensis x annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2458028 10 x 10 10/01/2017 die i mensis x annoque mmxvii 17 xvii 2017} test clock-2.1820 {conversion of 2017-10-31} { clock format 1509453296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2017 12:34:56 die xxxi mensis x annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2458058 10 x 10 10/31/2017 die xxxi mensis x annoque mmxvii 17 xvii 2017} test clock-2.1821 {conversion of 2017-11-01} { clock format 1509539696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2017 12:34:56 die i mensis xi annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2458059 11 xi 11 11/01/2017 die i mensis xi annoque mmxvii 17 xvii 2017} test clock-2.1822 {conversion of 2017-11-30} { clock format 1512045296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2017 12:34:56 die xxx mensis xi annoque mmxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2458088 11 xi 11 11/30/2017 die xxx mensis xi annoque mmxvii 17 xvii 2017} test clock-2.1823 {conversion of 2017-12-01} { clock format 1512131696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2017 12:34:56 die i mensis xii annoque mmxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2458089 12 xii 12 12/01/2017 die i mensis xii annoque mmxvii 17 xvii 2017} test clock-2.1824 {conversion of 2017-12-31} { clock format 1514723696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2017 12:34:56 die xxxi mensis xii annoque mmxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2458119 12 xii 12 12/31/2017 die xxxi mensis xii annoque mmxvii 17 xvii 2017} test clock-2.1825 {conversion of 2020-01-01} { clock format 1577882096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2020 12:34:56 die i mensis i annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2458850 01 i 1 01/01/2020 die i mensis i annoque mmxx 20 xx 2020} test clock-2.1826 {conversion of 2020-01-31} { clock format 1580474096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2020 12:34:56 die xxxi mensis i annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2458880 01 i 1 01/31/2020 die xxxi mensis i annoque mmxx 20 xx 2020} test clock-2.1827 {conversion of 2020-02-01} { clock format 1580560496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2020 12:34:56 die i mensis ii annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2458881 02 ii 2 02/01/2020 die i mensis ii annoque mmxx 20 xx 2020} test clock-2.1828 {conversion of 2020-02-29} { clock format 1582979696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2020 12:34:56 die xxix mensis ii annoque mmxx xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2458909 02 ii 2 02/29/2020 die xxix mensis ii annoque mmxx 20 xx 2020} test clock-2.1829 {conversion of 2020-03-01} { clock format 1583066096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2020 12:34:56 die i mensis iii annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2458910 03 iii 3 03/01/2020 die i mensis iii annoque mmxx 20 xx 2020} test clock-2.1830 {conversion of 2020-03-31} { clock format 1585658096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2020 12:34:56 die xxxi mensis iii annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2458940 03 iii 3 03/31/2020 die xxxi mensis iii annoque mmxx 20 xx 2020} test clock-2.1831 {conversion of 2020-04-01} { clock format 1585744496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2020 12:34:56 die i mensis iv annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2458941 04 iv 4 04/01/2020 die i mensis iv annoque mmxx 20 xx 2020} test clock-2.1832 {conversion of 2020-04-30} { clock format 1588250096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2020 12:34:56 die xxx mensis iv annoque mmxx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2458970 04 iv 4 04/30/2020 die xxx mensis iv annoque mmxx 20 xx 2020} test clock-2.1833 {conversion of 2020-05-01} { clock format 1588336496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2020 12:34:56 die i mensis v annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2458971 05 v 5 05/01/2020 die i mensis v annoque mmxx 20 xx 2020} test clock-2.1834 {conversion of 2020-05-31} { clock format 1590928496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2020 12:34:56 die xxxi mensis v annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2459001 05 v 5 05/31/2020 die xxxi mensis v annoque mmxx 20 xx 2020} test clock-2.1835 {conversion of 2020-06-01} { clock format 1591014896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2020 12:34:56 die i mensis vi annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2459002 06 vi 6 06/01/2020 die i mensis vi annoque mmxx 20 xx 2020} test clock-2.1836 {conversion of 2020-06-30} { clock format 1593520496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2020 12:34:56 die xxx mensis vi annoque mmxx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2459031 06 vi 6 06/30/2020 die xxx mensis vi annoque mmxx 20 xx 2020} test clock-2.1837 {conversion of 2020-07-01} { clock format 1593606896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2020 12:34:56 die i mensis vii annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2459032 07 vii 7 07/01/2020 die i mensis vii annoque mmxx 20 xx 2020} test clock-2.1838 {conversion of 2020-07-31} { clock format 1596198896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2020 12:34:56 die xxxi mensis vii annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2459062 07 vii 7 07/31/2020 die xxxi mensis vii annoque mmxx 20 xx 2020} test clock-2.1839 {conversion of 2020-08-01} { clock format 1596285296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2020 12:34:56 die i mensis viii annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2459063 08 viii 8 08/01/2020 die i mensis viii annoque mmxx 20 xx 2020} test clock-2.1840 {conversion of 2020-08-31} { clock format 1598877296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2020 12:34:56 die xxxi mensis viii annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2459093 08 viii 8 08/31/2020 die xxxi mensis viii annoque mmxx 20 xx 2020} test clock-2.1841 {conversion of 2020-09-01} { clock format 1598963696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2020 12:34:56 die i mensis ix annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2459094 09 ix 9 09/01/2020 die i mensis ix annoque mmxx 20 xx 2020} test clock-2.1842 {conversion of 2020-09-30} { clock format 1601469296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2020 12:34:56 die xxx mensis ix annoque mmxx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2459123 09 ix 9 09/30/2020 die xxx mensis ix annoque mmxx 20 xx 2020} test clock-2.1843 {conversion of 2020-10-01} { clock format 1601555696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2020 12:34:56 die i mensis x annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2459124 10 x 10 10/01/2020 die i mensis x annoque mmxx 20 xx 2020} test clock-2.1844 {conversion of 2020-10-31} { clock format 1604147696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2020 12:34:56 die xxxi mensis x annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2459154 10 x 10 10/31/2020 die xxxi mensis x annoque mmxx 20 xx 2020} test clock-2.1845 {conversion of 2020-11-01} { clock format 1604234096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2020 12:34:56 die i mensis xi annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2459155 11 xi 11 11/01/2020 die i mensis xi annoque mmxx 20 xx 2020} test clock-2.1846 {conversion of 2020-11-30} { clock format 1606739696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2020 12:34:56 die xxx mensis xi annoque mmxx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2459184 11 xi 11 11/30/2020 die xxx mensis xi annoque mmxx 20 xx 2020} test clock-2.1847 {conversion of 2020-12-01} { clock format 1606826096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2020 12:34:56 die i mensis xii annoque mmxx xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2459185 12 xii 12 12/01/2020 die i mensis xii annoque mmxx 20 xx 2020} test clock-2.1848 {conversion of 2020-12-31} { clock format 1609418096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2020 12:34:56 die xxxi mensis xii annoque mmxx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2459215 12 xii 12 12/31/2020 die xxxi mensis xii annoque mmxx 20 xx 2020} test clock-2.1849 {conversion of 2021-01-01} { clock format 1609504496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2021 12:34:56 die i mensis i annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2459216 01 i 1 01/01/2021 die i mensis i annoque mmxxi 21 xxi 2021} test clock-2.1850 {conversion of 2021-01-31} { clock format 1612096496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2021 12:34:56 die xxxi mensis i annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2459246 01 i 1 01/31/2021 die xxxi mensis i annoque mmxxi 21 xxi 2021} test clock-2.1851 {conversion of 2021-02-01} { clock format 1612182896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2021 12:34:56 die i mensis ii annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2459247 02 ii 2 02/01/2021 die i mensis ii annoque mmxxi 21 xxi 2021} test clock-2.1852 {conversion of 2021-02-28} { clock format 1614515696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2021 12:34:56 die xxviii mensis ii annoque mmxxi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2459274 02 ii 2 02/28/2021 die xxviii mensis ii annoque mmxxi 21 xxi 2021} test clock-2.1853 {conversion of 2021-03-01} { clock format 1614602096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2021 12:34:56 die i mensis iii annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2459275 03 iii 3 03/01/2021 die i mensis iii annoque mmxxi 21 xxi 2021} test clock-2.1854 {conversion of 2021-03-31} { clock format 1617194096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2021 12:34:56 die xxxi mensis iii annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2459305 03 iii 3 03/31/2021 die xxxi mensis iii annoque mmxxi 21 xxi 2021} test clock-2.1855 {conversion of 2021-04-01} { clock format 1617280496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2021 12:34:56 die i mensis iv annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2459306 04 iv 4 04/01/2021 die i mensis iv annoque mmxxi 21 xxi 2021} test clock-2.1856 {conversion of 2021-04-30} { clock format 1619786096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2021 12:34:56 die xxx mensis iv annoque mmxxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2459335 04 iv 4 04/30/2021 die xxx mensis iv annoque mmxxi 21 xxi 2021} test clock-2.1857 {conversion of 2021-05-01} { clock format 1619872496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2021 12:34:56 die i mensis v annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2459336 05 v 5 05/01/2021 die i mensis v annoque mmxxi 21 xxi 2021} test clock-2.1858 {conversion of 2021-05-31} { clock format 1622464496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2021 12:34:56 die xxxi mensis v annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2459366 05 v 5 05/31/2021 die xxxi mensis v annoque mmxxi 21 xxi 2021} test clock-2.1859 {conversion of 2021-06-01} { clock format 1622550896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2021 12:34:56 die i mensis vi annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2459367 06 vi 6 06/01/2021 die i mensis vi annoque mmxxi 21 xxi 2021} test clock-2.1860 {conversion of 2021-06-30} { clock format 1625056496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2021 12:34:56 die xxx mensis vi annoque mmxxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2459396 06 vi 6 06/30/2021 die xxx mensis vi annoque mmxxi 21 xxi 2021} test clock-2.1861 {conversion of 2021-07-01} { clock format 1625142896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2021 12:34:56 die i mensis vii annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2459397 07 vii 7 07/01/2021 die i mensis vii annoque mmxxi 21 xxi 2021} test clock-2.1862 {conversion of 2021-07-31} { clock format 1627734896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2021 12:34:56 die xxxi mensis vii annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2459427 07 vii 7 07/31/2021 die xxxi mensis vii annoque mmxxi 21 xxi 2021} test clock-2.1863 {conversion of 2021-08-01} { clock format 1627821296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2021 12:34:56 die i mensis viii annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2459428 08 viii 8 08/01/2021 die i mensis viii annoque mmxxi 21 xxi 2021} test clock-2.1864 {conversion of 2021-08-31} { clock format 1630413296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2021 12:34:56 die xxxi mensis viii annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2459458 08 viii 8 08/31/2021 die xxxi mensis viii annoque mmxxi 21 xxi 2021} test clock-2.1865 {conversion of 2021-09-01} { clock format 1630499696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2021 12:34:56 die i mensis ix annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2459459 09 ix 9 09/01/2021 die i mensis ix annoque mmxxi 21 xxi 2021} test clock-2.1866 {conversion of 2021-09-30} { clock format 1633005296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2021 12:34:56 die xxx mensis ix annoque mmxxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2459488 09 ix 9 09/30/2021 die xxx mensis ix annoque mmxxi 21 xxi 2021} test clock-2.1867 {conversion of 2021-10-01} { clock format 1633091696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2021 12:34:56 die i mensis x annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2459489 10 x 10 10/01/2021 die i mensis x annoque mmxxi 21 xxi 2021} test clock-2.1868 {conversion of 2021-10-31} { clock format 1635683696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2021 12:34:56 die xxxi mensis x annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2459519 10 x 10 10/31/2021 die xxxi mensis x annoque mmxxi 21 xxi 2021} test clock-2.1869 {conversion of 2021-11-01} { clock format 1635770096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2021 12:34:56 die i mensis xi annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2459520 11 xi 11 11/01/2021 die i mensis xi annoque mmxxi 21 xxi 2021} test clock-2.1870 {conversion of 2021-11-30} { clock format 1638275696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2021 12:34:56 die xxx mensis xi annoque mmxxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2459549 11 xi 11 11/30/2021 die xxx mensis xi annoque mmxxi 21 xxi 2021} test clock-2.1871 {conversion of 2021-12-01} { clock format 1638362096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2021 12:34:56 die i mensis xii annoque mmxxi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2459550 12 xii 12 12/01/2021 die i mensis xii annoque mmxxi 21 xxi 2021} test clock-2.1872 {conversion of 2021-12-31} { clock format 1640954096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2021 12:34:56 die xxxi mensis xii annoque mmxxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2459580 12 xii 12 12/31/2021 die xxxi mensis xii annoque mmxxi 21 xxi 2021} test clock-2.1873 {conversion of 2024-01-01} { clock format 1704112496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2024 12:34:56 die i mensis i annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2460311 01 i 1 01/01/2024 die i mensis i annoque mmxxiv 24 xxiv 2024} test clock-2.1874 {conversion of 2024-01-31} { clock format 1706704496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2024 12:34:56 die xxxi mensis i annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2460341 01 i 1 01/31/2024 die xxxi mensis i annoque mmxxiv 24 xxiv 2024} test clock-2.1875 {conversion of 2024-02-01} { clock format 1706790896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2024 12:34:56 die i mensis ii annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2460342 02 ii 2 02/01/2024 die i mensis ii annoque mmxxiv 24 xxiv 2024} test clock-2.1876 {conversion of 2024-02-29} { clock format 1709210096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2024 12:34:56 die xxix mensis ii annoque mmxxiv xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2460370 02 ii 2 02/29/2024 die xxix mensis ii annoque mmxxiv 24 xxiv 2024} test clock-2.1877 {conversion of 2024-03-01} { clock format 1709296496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2024 12:34:56 die i mensis iii annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2460371 03 iii 3 03/01/2024 die i mensis iii annoque mmxxiv 24 xxiv 2024} test clock-2.1878 {conversion of 2024-03-31} { clock format 1711888496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2024 12:34:56 die xxxi mensis iii annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2460401 03 iii 3 03/31/2024 die xxxi mensis iii annoque mmxxiv 24 xxiv 2024} test clock-2.1879 {conversion of 2024-04-01} { clock format 1711974896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2024 12:34:56 die i mensis iv annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2460402 04 iv 4 04/01/2024 die i mensis iv annoque mmxxiv 24 xxiv 2024} test clock-2.1880 {conversion of 2024-04-30} { clock format 1714480496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2024 12:34:56 die xxx mensis iv annoque mmxxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2460431 04 iv 4 04/30/2024 die xxx mensis iv annoque mmxxiv 24 xxiv 2024} test clock-2.1881 {conversion of 2024-05-01} { clock format 1714566896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2024 12:34:56 die i mensis v annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2460432 05 v 5 05/01/2024 die i mensis v annoque mmxxiv 24 xxiv 2024} test clock-2.1882 {conversion of 2024-05-31} { clock format 1717158896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2024 12:34:56 die xxxi mensis v annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2460462 05 v 5 05/31/2024 die xxxi mensis v annoque mmxxiv 24 xxiv 2024} test clock-2.1883 {conversion of 2024-06-01} { clock format 1717245296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2024 12:34:56 die i mensis vi annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2460463 06 vi 6 06/01/2024 die i mensis vi annoque mmxxiv 24 xxiv 2024} test clock-2.1884 {conversion of 2024-06-30} { clock format 1719750896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2024 12:34:56 die xxx mensis vi annoque mmxxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2460492 06 vi 6 06/30/2024 die xxx mensis vi annoque mmxxiv 24 xxiv 2024} test clock-2.1885 {conversion of 2024-07-01} { clock format 1719837296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2024 12:34:56 die i mensis vii annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2460493 07 vii 7 07/01/2024 die i mensis vii annoque mmxxiv 24 xxiv 2024} test clock-2.1886 {conversion of 2024-07-31} { clock format 1722429296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2024 12:34:56 die xxxi mensis vii annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2460523 07 vii 7 07/31/2024 die xxxi mensis vii annoque mmxxiv 24 xxiv 2024} test clock-2.1887 {conversion of 2024-08-01} { clock format 1722515696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2024 12:34:56 die i mensis viii annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2460524 08 viii 8 08/01/2024 die i mensis viii annoque mmxxiv 24 xxiv 2024} test clock-2.1888 {conversion of 2024-08-31} { clock format 1725107696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2024 12:34:56 die xxxi mensis viii annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2460554 08 viii 8 08/31/2024 die xxxi mensis viii annoque mmxxiv 24 xxiv 2024} test clock-2.1889 {conversion of 2024-09-01} { clock format 1725194096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2024 12:34:56 die i mensis ix annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2460555 09 ix 9 09/01/2024 die i mensis ix annoque mmxxiv 24 xxiv 2024} test clock-2.1890 {conversion of 2024-09-30} { clock format 1727699696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2024 12:34:56 die xxx mensis ix annoque mmxxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2460584 09 ix 9 09/30/2024 die xxx mensis ix annoque mmxxiv 24 xxiv 2024} test clock-2.1891 {conversion of 2024-10-01} { clock format 1727786096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2024 12:34:56 die i mensis x annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2460585 10 x 10 10/01/2024 die i mensis x annoque mmxxiv 24 xxiv 2024} test clock-2.1892 {conversion of 2024-10-31} { clock format 1730378096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2024 12:34:56 die xxxi mensis x annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2460615 10 x 10 10/31/2024 die xxxi mensis x annoque mmxxiv 24 xxiv 2024} test clock-2.1893 {conversion of 2024-11-01} { clock format 1730464496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2024 12:34:56 die i mensis xi annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2460616 11 xi 11 11/01/2024 die i mensis xi annoque mmxxiv 24 xxiv 2024} test clock-2.1894 {conversion of 2024-11-30} { clock format 1732970096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2024 12:34:56 die xxx mensis xi annoque mmxxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2460645 11 xi 11 11/30/2024 die xxx mensis xi annoque mmxxiv 24 xxiv 2024} test clock-2.1895 {conversion of 2024-12-01} { clock format 1733056496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2024 12:34:56 die i mensis xii annoque mmxxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2460646 12 xii 12 12/01/2024 die i mensis xii annoque mmxxiv 24 xxiv 2024} test clock-2.1896 {conversion of 2024-12-31} { clock format 1735648496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2024 12:34:56 die xxxi mensis xii annoque mmxxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2460676 12 xii 12 12/31/2024 die xxxi mensis xii annoque mmxxiv 24 xxiv 2024} test clock-2.1897 {conversion of 2025-01-01} { clock format 1735734896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2025 12:34:56 die i mensis i annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2460677 01 i 1 01/01/2025 die i mensis i annoque mmxxv 25 xxv 2025} test clock-2.1898 {conversion of 2025-01-31} { clock format 1738326896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2025 12:34:56 die xxxi mensis i annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2460707 01 i 1 01/31/2025 die xxxi mensis i annoque mmxxv 25 xxv 2025} test clock-2.1899 {conversion of 2025-02-01} { clock format 1738413296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2025 12:34:56 die i mensis ii annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2460708 02 ii 2 02/01/2025 die i mensis ii annoque mmxxv 25 xxv 2025} test clock-2.1900 {conversion of 2025-02-28} { clock format 1740746096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2025 12:34:56 die xxviii mensis ii annoque mmxxv xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2460735 02 ii 2 02/28/2025 die xxviii mensis ii annoque mmxxv 25 xxv 2025} test clock-2.1901 {conversion of 2025-03-01} { clock format 1740832496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2025 12:34:56 die i mensis iii annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2460736 03 iii 3 03/01/2025 die i mensis iii annoque mmxxv 25 xxv 2025} test clock-2.1902 {conversion of 2025-03-31} { clock format 1743424496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2025 12:34:56 die xxxi mensis iii annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2460766 03 iii 3 03/31/2025 die xxxi mensis iii annoque mmxxv 25 xxv 2025} test clock-2.1903 {conversion of 2025-04-01} { clock format 1743510896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2025 12:34:56 die i mensis iv annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2460767 04 iv 4 04/01/2025 die i mensis iv annoque mmxxv 25 xxv 2025} test clock-2.1904 {conversion of 2025-04-30} { clock format 1746016496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2025 12:34:56 die xxx mensis iv annoque mmxxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2460796 04 iv 4 04/30/2025 die xxx mensis iv annoque mmxxv 25 xxv 2025} test clock-2.1905 {conversion of 2025-05-01} { clock format 1746102896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2025 12:34:56 die i mensis v annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2460797 05 v 5 05/01/2025 die i mensis v annoque mmxxv 25 xxv 2025} test clock-2.1906 {conversion of 2025-05-31} { clock format 1748694896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2025 12:34:56 die xxxi mensis v annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2460827 05 v 5 05/31/2025 die xxxi mensis v annoque mmxxv 25 xxv 2025} test clock-2.1907 {conversion of 2025-06-01} { clock format 1748781296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2025 12:34:56 die i mensis vi annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2460828 06 vi 6 06/01/2025 die i mensis vi annoque mmxxv 25 xxv 2025} test clock-2.1908 {conversion of 2025-06-30} { clock format 1751286896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2025 12:34:56 die xxx mensis vi annoque mmxxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2460857 06 vi 6 06/30/2025 die xxx mensis vi annoque mmxxv 25 xxv 2025} test clock-2.1909 {conversion of 2025-07-01} { clock format 1751373296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2025 12:34:56 die i mensis vii annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2460858 07 vii 7 07/01/2025 die i mensis vii annoque mmxxv 25 xxv 2025} test clock-2.1910 {conversion of 2025-07-31} { clock format 1753965296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2025 12:34:56 die xxxi mensis vii annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2460888 07 vii 7 07/31/2025 die xxxi mensis vii annoque mmxxv 25 xxv 2025} test clock-2.1911 {conversion of 2025-08-01} { clock format 1754051696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2025 12:34:56 die i mensis viii annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2460889 08 viii 8 08/01/2025 die i mensis viii annoque mmxxv 25 xxv 2025} test clock-2.1912 {conversion of 2025-08-31} { clock format 1756643696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2025 12:34:56 die xxxi mensis viii annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2460919 08 viii 8 08/31/2025 die xxxi mensis viii annoque mmxxv 25 xxv 2025} test clock-2.1913 {conversion of 2025-09-01} { clock format 1756730096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2025 12:34:56 die i mensis ix annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2460920 09 ix 9 09/01/2025 die i mensis ix annoque mmxxv 25 xxv 2025} test clock-2.1914 {conversion of 2025-09-30} { clock format 1759235696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2025 12:34:56 die xxx mensis ix annoque mmxxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2460949 09 ix 9 09/30/2025 die xxx mensis ix annoque mmxxv 25 xxv 2025} test clock-2.1915 {conversion of 2025-10-01} { clock format 1759322096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2025 12:34:56 die i mensis x annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2460950 10 x 10 10/01/2025 die i mensis x annoque mmxxv 25 xxv 2025} test clock-2.1916 {conversion of 2025-10-31} { clock format 1761914096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2025 12:34:56 die xxxi mensis x annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2460980 10 x 10 10/31/2025 die xxxi mensis x annoque mmxxv 25 xxv 2025} test clock-2.1917 {conversion of 2025-11-01} { clock format 1762000496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2025 12:34:56 die i mensis xi annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2460981 11 xi 11 11/01/2025 die i mensis xi annoque mmxxv 25 xxv 2025} test clock-2.1918 {conversion of 2025-11-30} { clock format 1764506096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2025 12:34:56 die xxx mensis xi annoque mmxxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2461010 11 xi 11 11/30/2025 die xxx mensis xi annoque mmxxv 25 xxv 2025} test clock-2.1919 {conversion of 2025-12-01} { clock format 1764592496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2025 12:34:56 die i mensis xii annoque mmxxv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2461011 12 xii 12 12/01/2025 die i mensis xii annoque mmxxv 25 xxv 2025} test clock-2.1920 {conversion of 2025-12-31} { clock format 1767184496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2025 12:34:56 die xxxi mensis xii annoque mmxxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2461041 12 xii 12 12/31/2025 die xxxi mensis xii annoque mmxxv 25 xxv 2025} test clock-2.1921 {conversion of 2037-01-01} { clock format 2114426096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2037 12:34:56 die i mensis i annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2465060 01 i 1 01/01/2037 die i mensis i annoque mmxxxvii 37 xxxvii 2037} test clock-2.1922 {conversion of 2037-01-31} { clock format 2117018096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2037 12:34:56 die xxxi mensis i annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2465090 01 i 1 01/31/2037 die xxxi mensis i annoque mmxxxvii 37 xxxvii 2037} test clock-2.1923 {conversion of 2037-02-01} { clock format 2117104496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2037 12:34:56 die i mensis ii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2465091 02 ii 2 02/01/2037 die i mensis ii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1924 {conversion of 2037-02-28} { clock format 2119437296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2037 12:34:56 die xxviii mensis ii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2465118 02 ii 2 02/28/2037 die xxviii mensis ii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1925 {conversion of 2037-03-01} { clock format 2119523696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2037 12:34:56 die i mensis iii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2465119 03 iii 3 03/01/2037 die i mensis iii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1926 {conversion of 2037-03-31} { clock format 2122115696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2037 12:34:56 die xxxi mensis iii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2465149 03 iii 3 03/31/2037 die xxxi mensis iii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1927 {conversion of 2037-04-01} { clock format 2122202096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2037 12:34:56 die i mensis iv annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2465150 04 iv 4 04/01/2037 die i mensis iv annoque mmxxxvii 37 xxxvii 2037} test clock-2.1928 {conversion of 2037-04-30} { clock format 2124707696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2037 12:34:56 die xxx mensis iv annoque mmxxxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2465179 04 iv 4 04/30/2037 die xxx mensis iv annoque mmxxxvii 37 xxxvii 2037} test clock-2.1929 {conversion of 2037-05-01} { clock format 2124794096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2037 12:34:56 die i mensis v annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2465180 05 v 5 05/01/2037 die i mensis v annoque mmxxxvii 37 xxxvii 2037} test clock-2.1930 {conversion of 2037-05-31} { clock format 2127386096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2037 12:34:56 die xxxi mensis v annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2465210 05 v 5 05/31/2037 die xxxi mensis v annoque mmxxxvii 37 xxxvii 2037} test clock-2.1931 {conversion of 2037-06-01} { clock format 2127472496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2037 12:34:56 die i mensis vi annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2465211 06 vi 6 06/01/2037 die i mensis vi annoque mmxxxvii 37 xxxvii 2037} test clock-2.1932 {conversion of 2037-06-30} { clock format 2129978096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2037 12:34:56 die xxx mensis vi annoque mmxxxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2465240 06 vi 6 06/30/2037 die xxx mensis vi annoque mmxxxvii 37 xxxvii 2037} test clock-2.1933 {conversion of 2037-07-01} { clock format 2130064496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2037 12:34:56 die i mensis vii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2465241 07 vii 7 07/01/2037 die i mensis vii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1934 {conversion of 2037-07-31} { clock format 2132656496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2037 12:34:56 die xxxi mensis vii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2465271 07 vii 7 07/31/2037 die xxxi mensis vii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1935 {conversion of 2037-08-01} { clock format 2132742896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2037 12:34:56 die i mensis viii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2465272 08 viii 8 08/01/2037 die i mensis viii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1936 {conversion of 2037-08-31} { clock format 2135334896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2037 12:34:56 die xxxi mensis viii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2465302 08 viii 8 08/31/2037 die xxxi mensis viii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1937 {conversion of 2037-09-01} { clock format 2135421296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2037 12:34:56 die i mensis ix annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2465303 09 ix 9 09/01/2037 die i mensis ix annoque mmxxxvii 37 xxxvii 2037} test clock-2.1938 {conversion of 2037-09-30} { clock format 2137926896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2037 12:34:56 die xxx mensis ix annoque mmxxxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2465332 09 ix 9 09/30/2037 die xxx mensis ix annoque mmxxxvii 37 xxxvii 2037} test clock-2.1939 {conversion of 2037-10-01} { clock format 2138013296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2037 12:34:56 die i mensis x annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2465333 10 x 10 10/01/2037 die i mensis x annoque mmxxxvii 37 xxxvii 2037} test clock-2.1940 {conversion of 2037-10-31} { clock format 2140605296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2037 12:34:56 die xxxi mensis x annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2465363 10 x 10 10/31/2037 die xxxi mensis x annoque mmxxxvii 37 xxxvii 2037} test clock-2.1941 {conversion of 2037-11-01} { clock format 2140691696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2037 12:34:56 die i mensis xi annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2465364 11 xi 11 11/01/2037 die i mensis xi annoque mmxxxvii 37 xxxvii 2037} test clock-2.1942 {conversion of 2037-11-30} { clock format 2143197296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2037 12:34:56 die xxx mensis xi annoque mmxxxvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2465393 11 xi 11 11/30/2037 die xxx mensis xi annoque mmxxxvii 37 xxxvii 2037} test clock-2.1943 {conversion of 2037-12-01} { clock format 2143283696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2037 12:34:56 die i mensis xii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2465394 12 xii 12 12/01/2037 die i mensis xii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1944 {conversion of 2037-12-31} { clock format 2145875696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2037 12:34:56 die xxxi mensis xii annoque mmxxxvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2465424 12 xii 12 12/31/2037 die xxxi mensis xii annoque mmxxxvii 37 xxxvii 2037} test clock-2.1945 {conversion of 2038-01-01} { clock format 2145962096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2038 12:34:56 die i mensis i annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2465425 01 i 1 01/01/2038 die i mensis i annoque mmxxxviii 38 xxxviii 2038} test clock-2.1946 {conversion of 2038-01-31} { clock format 2148554096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2038 12:34:56 die xxxi mensis i annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2465455 01 i 1 01/31/2038 die xxxi mensis i annoque mmxxxviii 38 xxxviii 2038} test clock-2.1947 {conversion of 2038-02-01} { clock format 2148640496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2038 12:34:56 die i mensis ii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2465456 02 ii 2 02/01/2038 die i mensis ii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1948 {conversion of 2038-02-28} { clock format 2150973296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2038 12:34:56 die xxviii mensis ii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2465483 02 ii 2 02/28/2038 die xxviii mensis ii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1949 {conversion of 2038-03-01} { clock format 2151059696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2038 12:34:56 die i mensis iii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2465484 03 iii 3 03/01/2038 die i mensis iii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1950 {conversion of 2038-03-31} { clock format 2153651696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2038 12:34:56 die xxxi mensis iii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2465514 03 iii 3 03/31/2038 die xxxi mensis iii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1951 {conversion of 2038-04-01} { clock format 2153738096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2038 12:34:56 die i mensis iv annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2465515 04 iv 4 04/01/2038 die i mensis iv annoque mmxxxviii 38 xxxviii 2038} test clock-2.1952 {conversion of 2038-04-30} { clock format 2156243696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2038 12:34:56 die xxx mensis iv annoque mmxxxviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2465544 04 iv 4 04/30/2038 die xxx mensis iv annoque mmxxxviii 38 xxxviii 2038} test clock-2.1953 {conversion of 2038-05-01} { clock format 2156330096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2038 12:34:56 die i mensis v annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2465545 05 v 5 05/01/2038 die i mensis v annoque mmxxxviii 38 xxxviii 2038} test clock-2.1954 {conversion of 2038-05-31} { clock format 2158922096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2038 12:34:56 die xxxi mensis v annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2465575 05 v 5 05/31/2038 die xxxi mensis v annoque mmxxxviii 38 xxxviii 2038} test clock-2.1955 {conversion of 2038-06-01} { clock format 2159008496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2038 12:34:56 die i mensis vi annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2465576 06 vi 6 06/01/2038 die i mensis vi annoque mmxxxviii 38 xxxviii 2038} test clock-2.1956 {conversion of 2038-06-30} { clock format 2161514096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2038 12:34:56 die xxx mensis vi annoque mmxxxviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2465605 06 vi 6 06/30/2038 die xxx mensis vi annoque mmxxxviii 38 xxxviii 2038} test clock-2.1957 {conversion of 2038-07-01} { clock format 2161600496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2038 12:34:56 die i mensis vii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2465606 07 vii 7 07/01/2038 die i mensis vii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1958 {conversion of 2038-07-31} { clock format 2164192496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2038 12:34:56 die xxxi mensis vii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2465636 07 vii 7 07/31/2038 die xxxi mensis vii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1959 {conversion of 2038-08-01} { clock format 2164278896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2038 12:34:56 die i mensis viii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2465637 08 viii 8 08/01/2038 die i mensis viii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1960 {conversion of 2038-08-31} { clock format 2166870896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2038 12:34:56 die xxxi mensis viii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2465667 08 viii 8 08/31/2038 die xxxi mensis viii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1961 {conversion of 2038-09-01} { clock format 2166957296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2038 12:34:56 die i mensis ix annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2465668 09 ix 9 09/01/2038 die i mensis ix annoque mmxxxviii 38 xxxviii 2038} test clock-2.1962 {conversion of 2038-09-30} { clock format 2169462896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2038 12:34:56 die xxx mensis ix annoque mmxxxviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2465697 09 ix 9 09/30/2038 die xxx mensis ix annoque mmxxxviii 38 xxxviii 2038} test clock-2.1963 {conversion of 2038-10-01} { clock format 2169549296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2038 12:34:56 die i mensis x annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2465698 10 x 10 10/01/2038 die i mensis x annoque mmxxxviii 38 xxxviii 2038} test clock-2.1964 {conversion of 2038-10-31} { clock format 2172141296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2038 12:34:56 die xxxi mensis x annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2465728 10 x 10 10/31/2038 die xxxi mensis x annoque mmxxxviii 38 xxxviii 2038} test clock-2.1965 {conversion of 2038-11-01} { clock format 2172227696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2038 12:34:56 die i mensis xi annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2465729 11 xi 11 11/01/2038 die i mensis xi annoque mmxxxviii 38 xxxviii 2038} test clock-2.1966 {conversion of 2038-11-30} { clock format 2174733296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2038 12:34:56 die xxx mensis xi annoque mmxxxviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2465758 11 xi 11 11/30/2038 die xxx mensis xi annoque mmxxxviii 38 xxxviii 2038} test clock-2.1967 {conversion of 2038-12-01} { clock format 2174819696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2038 12:34:56 die i mensis xii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2465759 12 xii 12 12/01/2038 die i mensis xii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1968 {conversion of 2038-12-31} { clock format 2177411696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2038 12:34:56 die xxxi mensis xii annoque mmxxxviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2465789 12 xii 12 12/31/2038 die xxxi mensis xii annoque mmxxxviii 38 xxxviii 2038} test clock-2.1969 {conversion of 2039-01-01} { clock format 2177498096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2039 12:34:56 die i mensis i annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2465790 01 i 1 01/01/2039 die i mensis i annoque mmxxxix 39 xxxix 2039} test clock-2.1970 {conversion of 2039-01-31} { clock format 2180090096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2039 12:34:56 die xxxi mensis i annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2465820 01 i 1 01/31/2039 die xxxi mensis i annoque mmxxxix 39 xxxix 2039} test clock-2.1971 {conversion of 2039-02-01} { clock format 2180176496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2039 12:34:56 die i mensis ii annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2465821 02 ii 2 02/01/2039 die i mensis ii annoque mmxxxix 39 xxxix 2039} test clock-2.1972 {conversion of 2039-02-28} { clock format 2182509296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2039 12:34:56 die xxviii mensis ii annoque mmxxxix xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2465848 02 ii 2 02/28/2039 die xxviii mensis ii annoque mmxxxix 39 xxxix 2039} test clock-2.1973 {conversion of 2039-03-01} { clock format 2182595696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2039 12:34:56 die i mensis iii annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2465849 03 iii 3 03/01/2039 die i mensis iii annoque mmxxxix 39 xxxix 2039} test clock-2.1974 {conversion of 2039-03-31} { clock format 2185187696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2039 12:34:56 die xxxi mensis iii annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2465879 03 iii 3 03/31/2039 die xxxi mensis iii annoque mmxxxix 39 xxxix 2039} test clock-2.1975 {conversion of 2039-04-01} { clock format 2185274096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2039 12:34:56 die i mensis iv annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2465880 04 iv 4 04/01/2039 die i mensis iv annoque mmxxxix 39 xxxix 2039} test clock-2.1976 {conversion of 2039-04-30} { clock format 2187779696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2039 12:34:56 die xxx mensis iv annoque mmxxxix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2465909 04 iv 4 04/30/2039 die xxx mensis iv annoque mmxxxix 39 xxxix 2039} test clock-2.1977 {conversion of 2039-05-01} { clock format 2187866096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2039 12:34:56 die i mensis v annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2465910 05 v 5 05/01/2039 die i mensis v annoque mmxxxix 39 xxxix 2039} test clock-2.1978 {conversion of 2039-05-31} { clock format 2190458096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2039 12:34:56 die xxxi mensis v annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2465940 05 v 5 05/31/2039 die xxxi mensis v annoque mmxxxix 39 xxxix 2039} test clock-2.1979 {conversion of 2039-06-01} { clock format 2190544496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2039 12:34:56 die i mensis vi annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2465941 06 vi 6 06/01/2039 die i mensis vi annoque mmxxxix 39 xxxix 2039} test clock-2.1980 {conversion of 2039-06-30} { clock format 2193050096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2039 12:34:56 die xxx mensis vi annoque mmxxxix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2465970 06 vi 6 06/30/2039 die xxx mensis vi annoque mmxxxix 39 xxxix 2039} test clock-2.1981 {conversion of 2039-07-01} { clock format 2193136496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2039 12:34:56 die i mensis vii annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2465971 07 vii 7 07/01/2039 die i mensis vii annoque mmxxxix 39 xxxix 2039} test clock-2.1982 {conversion of 2039-07-31} { clock format 2195728496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2039 12:34:56 die xxxi mensis vii annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2466001 07 vii 7 07/31/2039 die xxxi mensis vii annoque mmxxxix 39 xxxix 2039} test clock-2.1983 {conversion of 2039-08-01} { clock format 2195814896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2039 12:34:56 die i mensis viii annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2466002 08 viii 8 08/01/2039 die i mensis viii annoque mmxxxix 39 xxxix 2039} test clock-2.1984 {conversion of 2039-08-31} { clock format 2198406896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2039 12:34:56 die xxxi mensis viii annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2466032 08 viii 8 08/31/2039 die xxxi mensis viii annoque mmxxxix 39 xxxix 2039} test clock-2.1985 {conversion of 2039-09-01} { clock format 2198493296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2039 12:34:56 die i mensis ix annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2466033 09 ix 9 09/01/2039 die i mensis ix annoque mmxxxix 39 xxxix 2039} test clock-2.1986 {conversion of 2039-09-30} { clock format 2200998896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2039 12:34:56 die xxx mensis ix annoque mmxxxix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2466062 09 ix 9 09/30/2039 die xxx mensis ix annoque mmxxxix 39 xxxix 2039} test clock-2.1987 {conversion of 2039-10-01} { clock format 2201085296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2039 12:34:56 die i mensis x annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2466063 10 x 10 10/01/2039 die i mensis x annoque mmxxxix 39 xxxix 2039} test clock-2.1988 {conversion of 2039-10-31} { clock format 2203677296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2039 12:34:56 die xxxi mensis x annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2466093 10 x 10 10/31/2039 die xxxi mensis x annoque mmxxxix 39 xxxix 2039} test clock-2.1989 {conversion of 2039-11-01} { clock format 2203763696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2039 12:34:56 die i mensis xi annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2466094 11 xi 11 11/01/2039 die i mensis xi annoque mmxxxix 39 xxxix 2039} test clock-2.1990 {conversion of 2039-11-30} { clock format 2206269296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2039 12:34:56 die xxx mensis xi annoque mmxxxix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2466123 11 xi 11 11/30/2039 die xxx mensis xi annoque mmxxxix 39 xxxix 2039} test clock-2.1991 {conversion of 2039-12-01} { clock format 2206355696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2039 12:34:56 die i mensis xii annoque mmxxxix xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2466124 12 xii 12 12/01/2039 die i mensis xii annoque mmxxxix 39 xxxix 2039} test clock-2.1992 {conversion of 2039-12-31} { clock format 2208947696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2039 12:34:56 die xxxi mensis xii annoque mmxxxix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2466154 12 xii 12 12/31/2039 die xxxi mensis xii annoque mmxxxix 39 xxxix 2039} test clock-2.1993 {conversion of 2040-01-01} { clock format 2209034096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2040 12:34:56 die i mensis i annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2466155 01 i 1 01/01/2040 die i mensis i annoque mmxl 40 xl 2040} test clock-2.1994 {conversion of 2040-01-31} { clock format 2211626096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2040 12:34:56 die xxxi mensis i annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2466185 01 i 1 01/31/2040 die xxxi mensis i annoque mmxl 40 xl 2040} test clock-2.1995 {conversion of 2040-02-01} { clock format 2211712496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2040 12:34:56 die i mensis ii annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2466186 02 ii 2 02/01/2040 die i mensis ii annoque mmxl 40 xl 2040} test clock-2.1996 {conversion of 2040-02-29} { clock format 2214131696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2040 12:34:56 die xxix mensis ii annoque mmxl xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2466214 02 ii 2 02/29/2040 die xxix mensis ii annoque mmxl 40 xl 2040} test clock-2.1997 {conversion of 2040-03-01} { clock format 2214218096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2040 12:34:56 die i mensis iii annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2466215 03 iii 3 03/01/2040 die i mensis iii annoque mmxl 40 xl 2040} test clock-2.1998 {conversion of 2040-03-31} { clock format 2216810096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2040 12:34:56 die xxxi mensis iii annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2466245 03 iii 3 03/31/2040 die xxxi mensis iii annoque mmxl 40 xl 2040} test clock-2.1999 {conversion of 2040-04-01} { clock format 2216896496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2040 12:34:56 die i mensis iv annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2466246 04 iv 4 04/01/2040 die i mensis iv annoque mmxl 40 xl 2040} test clock-2.2000 {conversion of 2040-04-30} { clock format 2219402096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2040 12:34:56 die xxx mensis iv annoque mmxl xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2466275 04 iv 4 04/30/2040 die xxx mensis iv annoque mmxl 40 xl 2040} test clock-2.2001 {conversion of 2040-05-01} { clock format 2219488496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2040 12:34:56 die i mensis v annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2466276 05 v 5 05/01/2040 die i mensis v annoque mmxl 40 xl 2040} test clock-2.2002 {conversion of 2040-05-31} { clock format 2222080496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2040 12:34:56 die xxxi mensis v annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2466306 05 v 5 05/31/2040 die xxxi mensis v annoque mmxl 40 xl 2040} test clock-2.2003 {conversion of 2040-06-01} { clock format 2222166896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2040 12:34:56 die i mensis vi annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2466307 06 vi 6 06/01/2040 die i mensis vi annoque mmxl 40 xl 2040} test clock-2.2004 {conversion of 2040-06-30} { clock format 2224672496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2040 12:34:56 die xxx mensis vi annoque mmxl xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2466336 06 vi 6 06/30/2040 die xxx mensis vi annoque mmxl 40 xl 2040} test clock-2.2005 {conversion of 2040-07-01} { clock format 2224758896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2040 12:34:56 die i mensis vii annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2466337 07 vii 7 07/01/2040 die i mensis vii annoque mmxl 40 xl 2040} test clock-2.2006 {conversion of 2040-07-31} { clock format 2227350896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2040 12:34:56 die xxxi mensis vii annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2466367 07 vii 7 07/31/2040 die xxxi mensis vii annoque mmxl 40 xl 2040} test clock-2.2007 {conversion of 2040-08-01} { clock format 2227437296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2040 12:34:56 die i mensis viii annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2466368 08 viii 8 08/01/2040 die i mensis viii annoque mmxl 40 xl 2040} test clock-2.2008 {conversion of 2040-08-31} { clock format 2230029296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2040 12:34:56 die xxxi mensis viii annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2466398 08 viii 8 08/31/2040 die xxxi mensis viii annoque mmxl 40 xl 2040} test clock-2.2009 {conversion of 2040-09-01} { clock format 2230115696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2040 12:34:56 die i mensis ix annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2466399 09 ix 9 09/01/2040 die i mensis ix annoque mmxl 40 xl 2040} test clock-2.2010 {conversion of 2040-09-30} { clock format 2232621296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2040 12:34:56 die xxx mensis ix annoque mmxl xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2466428 09 ix 9 09/30/2040 die xxx mensis ix annoque mmxl 40 xl 2040} test clock-2.2011 {conversion of 2040-10-01} { clock format 2232707696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2040 12:34:56 die i mensis x annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2466429 10 x 10 10/01/2040 die i mensis x annoque mmxl 40 xl 2040} test clock-2.2012 {conversion of 2040-10-31} { clock format 2235299696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2040 12:34:56 die xxxi mensis x annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2466459 10 x 10 10/31/2040 die xxxi mensis x annoque mmxl 40 xl 2040} test clock-2.2013 {conversion of 2040-11-01} { clock format 2235386096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2040 12:34:56 die i mensis xi annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2466460 11 xi 11 11/01/2040 die i mensis xi annoque mmxl 40 xl 2040} test clock-2.2014 {conversion of 2040-11-30} { clock format 2237891696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2040 12:34:56 die xxx mensis xi annoque mmxl xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2466489 11 xi 11 11/30/2040 die xxx mensis xi annoque mmxl 40 xl 2040} test clock-2.2015 {conversion of 2040-12-01} { clock format 2237978096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2040 12:34:56 die i mensis xii annoque mmxl xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2466490 12 xii 12 12/01/2040 die i mensis xii annoque mmxl 40 xl 2040} test clock-2.2016 {conversion of 2040-12-31} { clock format 2240570096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2040 12:34:56 die xxxi mensis xii annoque mmxl xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2466520 12 xii 12 12/31/2040 die xxxi mensis xii annoque mmxl 40 xl 2040} test clock-2.2017 {conversion of 2041-01-01} { clock format 2240656496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2041 12:34:56 die i mensis i annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2466521 01 i 1 01/01/2041 die i mensis i annoque mmxli 41 xli 2041} test clock-2.2018 {conversion of 2041-01-31} { clock format 2243248496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2041 12:34:56 die xxxi mensis i annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2466551 01 i 1 01/31/2041 die xxxi mensis i annoque mmxli 41 xli 2041} test clock-2.2019 {conversion of 2041-02-01} { clock format 2243334896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2041 12:34:56 die i mensis ii annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2466552 02 ii 2 02/01/2041 die i mensis ii annoque mmxli 41 xli 2041} test clock-2.2020 {conversion of 2041-02-28} { clock format 2245667696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2041 12:34:56 die xxviii mensis ii annoque mmxli xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2466579 02 ii 2 02/28/2041 die xxviii mensis ii annoque mmxli 41 xli 2041} test clock-2.2021 {conversion of 2041-03-01} { clock format 2245754096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2041 12:34:56 die i mensis iii annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2466580 03 iii 3 03/01/2041 die i mensis iii annoque mmxli 41 xli 2041} test clock-2.2022 {conversion of 2041-03-31} { clock format 2248346096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2041 12:34:56 die xxxi mensis iii annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2466610 03 iii 3 03/31/2041 die xxxi mensis iii annoque mmxli 41 xli 2041} test clock-2.2023 {conversion of 2041-04-01} { clock format 2248432496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2041 12:34:56 die i mensis iv annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2466611 04 iv 4 04/01/2041 die i mensis iv annoque mmxli 41 xli 2041} test clock-2.2024 {conversion of 2041-04-30} { clock format 2250938096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2041 12:34:56 die xxx mensis iv annoque mmxli xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2466640 04 iv 4 04/30/2041 die xxx mensis iv annoque mmxli 41 xli 2041} test clock-2.2025 {conversion of 2041-05-01} { clock format 2251024496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2041 12:34:56 die i mensis v annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2466641 05 v 5 05/01/2041 die i mensis v annoque mmxli 41 xli 2041} test clock-2.2026 {conversion of 2041-05-31} { clock format 2253616496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2041 12:34:56 die xxxi mensis v annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2466671 05 v 5 05/31/2041 die xxxi mensis v annoque mmxli 41 xli 2041} test clock-2.2027 {conversion of 2041-06-01} { clock format 2253702896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2041 12:34:56 die i mensis vi annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2466672 06 vi 6 06/01/2041 die i mensis vi annoque mmxli 41 xli 2041} test clock-2.2028 {conversion of 2041-06-30} { clock format 2256208496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2041 12:34:56 die xxx mensis vi annoque mmxli xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2466701 06 vi 6 06/30/2041 die xxx mensis vi annoque mmxli 41 xli 2041} test clock-2.2029 {conversion of 2041-07-01} { clock format 2256294896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2041 12:34:56 die i mensis vii annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2466702 07 vii 7 07/01/2041 die i mensis vii annoque mmxli 41 xli 2041} test clock-2.2030 {conversion of 2041-07-31} { clock format 2258886896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2041 12:34:56 die xxxi mensis vii annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2466732 07 vii 7 07/31/2041 die xxxi mensis vii annoque mmxli 41 xli 2041} test clock-2.2031 {conversion of 2041-08-01} { clock format 2258973296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2041 12:34:56 die i mensis viii annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2466733 08 viii 8 08/01/2041 die i mensis viii annoque mmxli 41 xli 2041} test clock-2.2032 {conversion of 2041-08-31} { clock format 2261565296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2041 12:34:56 die xxxi mensis viii annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2466763 08 viii 8 08/31/2041 die xxxi mensis viii annoque mmxli 41 xli 2041} test clock-2.2033 {conversion of 2041-09-01} { clock format 2261651696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2041 12:34:56 die i mensis ix annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2466764 09 ix 9 09/01/2041 die i mensis ix annoque mmxli 41 xli 2041} test clock-2.2034 {conversion of 2041-09-30} { clock format 2264157296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2041 12:34:56 die xxx mensis ix annoque mmxli xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2466793 09 ix 9 09/30/2041 die xxx mensis ix annoque mmxli 41 xli 2041} test clock-2.2035 {conversion of 2041-10-01} { clock format 2264243696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2041 12:34:56 die i mensis x annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2466794 10 x 10 10/01/2041 die i mensis x annoque mmxli 41 xli 2041} test clock-2.2036 {conversion of 2041-10-31} { clock format 2266835696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2041 12:34:56 die xxxi mensis x annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2466824 10 x 10 10/31/2041 die xxxi mensis x annoque mmxli 41 xli 2041} test clock-2.2037 {conversion of 2041-11-01} { clock format 2266922096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2041 12:34:56 die i mensis xi annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2466825 11 xi 11 11/01/2041 die i mensis xi annoque mmxli 41 xli 2041} test clock-2.2038 {conversion of 2041-11-30} { clock format 2269427696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2041 12:34:56 die xxx mensis xi annoque mmxli xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2466854 11 xi 11 11/30/2041 die xxx mensis xi annoque mmxli 41 xli 2041} test clock-2.2039 {conversion of 2041-12-01} { clock format 2269514096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2041 12:34:56 die i mensis xii annoque mmxli xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2466855 12 xii 12 12/01/2041 die i mensis xii annoque mmxli 41 xli 2041} test clock-2.2040 {conversion of 2041-12-31} { clock format 2272106096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2041 12:34:56 die xxxi mensis xii annoque mmxli xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2466885 12 xii 12 12/31/2041 die xxxi mensis xii annoque mmxli 41 xli 2041} test clock-2.2041 {conversion of 2042-01-01} { clock format 2272192496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2042 12:34:56 die i mensis i annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2466886 01 i 1 01/01/2042 die i mensis i annoque mmxlii 42 xlii 2042} test clock-2.2042 {conversion of 2042-01-31} { clock format 2274784496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2042 12:34:56 die xxxi mensis i annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2466916 01 i 1 01/31/2042 die xxxi mensis i annoque mmxlii 42 xlii 2042} test clock-2.2043 {conversion of 2042-02-01} { clock format 2274870896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2042 12:34:56 die i mensis ii annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2466917 02 ii 2 02/01/2042 die i mensis ii annoque mmxlii 42 xlii 2042} test clock-2.2044 {conversion of 2042-02-28} { clock format 2277203696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2042 12:34:56 die xxviii mensis ii annoque mmxlii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2466944 02 ii 2 02/28/2042 die xxviii mensis ii annoque mmxlii 42 xlii 2042} test clock-2.2045 {conversion of 2042-03-01} { clock format 2277290096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2042 12:34:56 die i mensis iii annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2466945 03 iii 3 03/01/2042 die i mensis iii annoque mmxlii 42 xlii 2042} test clock-2.2046 {conversion of 2042-03-31} { clock format 2279882096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2042 12:34:56 die xxxi mensis iii annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2466975 03 iii 3 03/31/2042 die xxxi mensis iii annoque mmxlii 42 xlii 2042} test clock-2.2047 {conversion of 2042-04-01} { clock format 2279968496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2042 12:34:56 die i mensis iv annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2466976 04 iv 4 04/01/2042 die i mensis iv annoque mmxlii 42 xlii 2042} test clock-2.2048 {conversion of 2042-04-30} { clock format 2282474096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2042 12:34:56 die xxx mensis iv annoque mmxlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2467005 04 iv 4 04/30/2042 die xxx mensis iv annoque mmxlii 42 xlii 2042} test clock-2.2049 {conversion of 2042-05-01} { clock format 2282560496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2042 12:34:56 die i mensis v annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2467006 05 v 5 05/01/2042 die i mensis v annoque mmxlii 42 xlii 2042} test clock-2.2050 {conversion of 2042-05-31} { clock format 2285152496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2042 12:34:56 die xxxi mensis v annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2467036 05 v 5 05/31/2042 die xxxi mensis v annoque mmxlii 42 xlii 2042} test clock-2.2051 {conversion of 2042-06-01} { clock format 2285238896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2042 12:34:56 die i mensis vi annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2467037 06 vi 6 06/01/2042 die i mensis vi annoque mmxlii 42 xlii 2042} test clock-2.2052 {conversion of 2042-06-30} { clock format 2287744496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2042 12:34:56 die xxx mensis vi annoque mmxlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2467066 06 vi 6 06/30/2042 die xxx mensis vi annoque mmxlii 42 xlii 2042} test clock-2.2053 {conversion of 2042-07-01} { clock format 2287830896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2042 12:34:56 die i mensis vii annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2467067 07 vii 7 07/01/2042 die i mensis vii annoque mmxlii 42 xlii 2042} test clock-2.2054 {conversion of 2042-07-31} { clock format 2290422896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2042 12:34:56 die xxxi mensis vii annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2467097 07 vii 7 07/31/2042 die xxxi mensis vii annoque mmxlii 42 xlii 2042} test clock-2.2055 {conversion of 2042-08-01} { clock format 2290509296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2042 12:34:56 die i mensis viii annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2467098 08 viii 8 08/01/2042 die i mensis viii annoque mmxlii 42 xlii 2042} test clock-2.2056 {conversion of 2042-08-31} { clock format 2293101296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2042 12:34:56 die xxxi mensis viii annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2467128 08 viii 8 08/31/2042 die xxxi mensis viii annoque mmxlii 42 xlii 2042} test clock-2.2057 {conversion of 2042-09-01} { clock format 2293187696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2042 12:34:56 die i mensis ix annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2467129 09 ix 9 09/01/2042 die i mensis ix annoque mmxlii 42 xlii 2042} test clock-2.2058 {conversion of 2042-09-30} { clock format 2295693296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2042 12:34:56 die xxx mensis ix annoque mmxlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2467158 09 ix 9 09/30/2042 die xxx mensis ix annoque mmxlii 42 xlii 2042} test clock-2.2059 {conversion of 2042-10-01} { clock format 2295779696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2042 12:34:56 die i mensis x annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2467159 10 x 10 10/01/2042 die i mensis x annoque mmxlii 42 xlii 2042} test clock-2.2060 {conversion of 2042-10-31} { clock format 2298371696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2042 12:34:56 die xxxi mensis x annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2467189 10 x 10 10/31/2042 die xxxi mensis x annoque mmxlii 42 xlii 2042} test clock-2.2061 {conversion of 2042-11-01} { clock format 2298458096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2042 12:34:56 die i mensis xi annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2467190 11 xi 11 11/01/2042 die i mensis xi annoque mmxlii 42 xlii 2042} test clock-2.2062 {conversion of 2042-11-30} { clock format 2300963696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2042 12:34:56 die xxx mensis xi annoque mmxlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2467219 11 xi 11 11/30/2042 die xxx mensis xi annoque mmxlii 42 xlii 2042} test clock-2.2063 {conversion of 2042-12-01} { clock format 2301050096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2042 12:34:56 die i mensis xii annoque mmxlii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2467220 12 xii 12 12/01/2042 die i mensis xii annoque mmxlii 42 xlii 2042} test clock-2.2064 {conversion of 2042-12-31} { clock format 2303642096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2042 12:34:56 die xxxi mensis xii annoque mmxlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2467250 12 xii 12 12/31/2042 die xxxi mensis xii annoque mmxlii 42 xlii 2042} test clock-2.2065 {conversion of 2043-01-01} { clock format 2303728496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2043 12:34:56 die i mensis i annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2467251 01 i 1 01/01/2043 die i mensis i annoque mmxliii 43 xliii 2043} test clock-2.2066 {conversion of 2043-01-31} { clock format 2306320496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2043 12:34:56 die xxxi mensis i annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2467281 01 i 1 01/31/2043 die xxxi mensis i annoque mmxliii 43 xliii 2043} test clock-2.2067 {conversion of 2043-02-01} { clock format 2306406896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2043 12:34:56 die i mensis ii annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2467282 02 ii 2 02/01/2043 die i mensis ii annoque mmxliii 43 xliii 2043} test clock-2.2068 {conversion of 2043-02-28} { clock format 2308739696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2043 12:34:56 die xxviii mensis ii annoque mmxliii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2467309 02 ii 2 02/28/2043 die xxviii mensis ii annoque mmxliii 43 xliii 2043} test clock-2.2069 {conversion of 2043-03-01} { clock format 2308826096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2043 12:34:56 die i mensis iii annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2467310 03 iii 3 03/01/2043 die i mensis iii annoque mmxliii 43 xliii 2043} test clock-2.2070 {conversion of 2043-03-31} { clock format 2311418096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2043 12:34:56 die xxxi mensis iii annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2467340 03 iii 3 03/31/2043 die xxxi mensis iii annoque mmxliii 43 xliii 2043} test clock-2.2071 {conversion of 2043-04-01} { clock format 2311504496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2043 12:34:56 die i mensis iv annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2467341 04 iv 4 04/01/2043 die i mensis iv annoque mmxliii 43 xliii 2043} test clock-2.2072 {conversion of 2043-04-30} { clock format 2314010096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2043 12:34:56 die xxx mensis iv annoque mmxliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2467370 04 iv 4 04/30/2043 die xxx mensis iv annoque mmxliii 43 xliii 2043} test clock-2.2073 {conversion of 2043-05-01} { clock format 2314096496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2043 12:34:56 die i mensis v annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2467371 05 v 5 05/01/2043 die i mensis v annoque mmxliii 43 xliii 2043} test clock-2.2074 {conversion of 2043-05-31} { clock format 2316688496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2043 12:34:56 die xxxi mensis v annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2467401 05 v 5 05/31/2043 die xxxi mensis v annoque mmxliii 43 xliii 2043} test clock-2.2075 {conversion of 2043-06-01} { clock format 2316774896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2043 12:34:56 die i mensis vi annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2467402 06 vi 6 06/01/2043 die i mensis vi annoque mmxliii 43 xliii 2043} test clock-2.2076 {conversion of 2043-06-30} { clock format 2319280496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2043 12:34:56 die xxx mensis vi annoque mmxliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2467431 06 vi 6 06/30/2043 die xxx mensis vi annoque mmxliii 43 xliii 2043} test clock-2.2077 {conversion of 2043-07-01} { clock format 2319366896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2043 12:34:56 die i mensis vii annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2467432 07 vii 7 07/01/2043 die i mensis vii annoque mmxliii 43 xliii 2043} test clock-2.2078 {conversion of 2043-07-31} { clock format 2321958896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2043 12:34:56 die xxxi mensis vii annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2467462 07 vii 7 07/31/2043 die xxxi mensis vii annoque mmxliii 43 xliii 2043} test clock-2.2079 {conversion of 2043-08-01} { clock format 2322045296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2043 12:34:56 die i mensis viii annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2467463 08 viii 8 08/01/2043 die i mensis viii annoque mmxliii 43 xliii 2043} test clock-2.2080 {conversion of 2043-08-31} { clock format 2324637296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2043 12:34:56 die xxxi mensis viii annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2467493 08 viii 8 08/31/2043 die xxxi mensis viii annoque mmxliii 43 xliii 2043} test clock-2.2081 {conversion of 2043-09-01} { clock format 2324723696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2043 12:34:56 die i mensis ix annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2467494 09 ix 9 09/01/2043 die i mensis ix annoque mmxliii 43 xliii 2043} test clock-2.2082 {conversion of 2043-09-30} { clock format 2327229296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2043 12:34:56 die xxx mensis ix annoque mmxliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2467523 09 ix 9 09/30/2043 die xxx mensis ix annoque mmxliii 43 xliii 2043} test clock-2.2083 {conversion of 2043-10-01} { clock format 2327315696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2043 12:34:56 die i mensis x annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2467524 10 x 10 10/01/2043 die i mensis x annoque mmxliii 43 xliii 2043} test clock-2.2084 {conversion of 2043-10-31} { clock format 2329907696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2043 12:34:56 die xxxi mensis x annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2467554 10 x 10 10/31/2043 die xxxi mensis x annoque mmxliii 43 xliii 2043} test clock-2.2085 {conversion of 2043-11-01} { clock format 2329994096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2043 12:34:56 die i mensis xi annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2467555 11 xi 11 11/01/2043 die i mensis xi annoque mmxliii 43 xliii 2043} test clock-2.2086 {conversion of 2043-11-30} { clock format 2332499696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2043 12:34:56 die xxx mensis xi annoque mmxliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2467584 11 xi 11 11/30/2043 die xxx mensis xi annoque mmxliii 43 xliii 2043} test clock-2.2087 {conversion of 2043-12-01} { clock format 2332586096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2043 12:34:56 die i mensis xii annoque mmxliii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2467585 12 xii 12 12/01/2043 die i mensis xii annoque mmxliii 43 xliii 2043} test clock-2.2088 {conversion of 2043-12-31} { clock format 2335178096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2043 12:34:56 die xxxi mensis xii annoque mmxliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2467615 12 xii 12 12/31/2043 die xxxi mensis xii annoque mmxliii 43 xliii 2043} test clock-2.2089 {conversion of 2044-01-01} { clock format 2335264496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2044 12:34:56 die i mensis i annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2467616 01 i 1 01/01/2044 die i mensis i annoque mmxliv 44 xliv 2044} test clock-2.2090 {conversion of 2044-01-31} { clock format 2337856496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2044 12:34:56 die xxxi mensis i annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2467646 01 i 1 01/31/2044 die xxxi mensis i annoque mmxliv 44 xliv 2044} test clock-2.2091 {conversion of 2044-02-01} { clock format 2337942896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2044 12:34:56 die i mensis ii annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2467647 02 ii 2 02/01/2044 die i mensis ii annoque mmxliv 44 xliv 2044} test clock-2.2092 {conversion of 2044-02-29} { clock format 2340362096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2044 12:34:56 die xxix mensis ii annoque mmxliv xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2467675 02 ii 2 02/29/2044 die xxix mensis ii annoque mmxliv 44 xliv 2044} test clock-2.2093 {conversion of 2044-03-01} { clock format 2340448496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2044 12:34:56 die i mensis iii annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2467676 03 iii 3 03/01/2044 die i mensis iii annoque mmxliv 44 xliv 2044} test clock-2.2094 {conversion of 2044-03-31} { clock format 2343040496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2044 12:34:56 die xxxi mensis iii annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2467706 03 iii 3 03/31/2044 die xxxi mensis iii annoque mmxliv 44 xliv 2044} test clock-2.2095 {conversion of 2044-04-01} { clock format 2343126896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2044 12:34:56 die i mensis iv annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2467707 04 iv 4 04/01/2044 die i mensis iv annoque mmxliv 44 xliv 2044} test clock-2.2096 {conversion of 2044-04-30} { clock format 2345632496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2044 12:34:56 die xxx mensis iv annoque mmxliv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2467736 04 iv 4 04/30/2044 die xxx mensis iv annoque mmxliv 44 xliv 2044} test clock-2.2097 {conversion of 2044-05-01} { clock format 2345718896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2044 12:34:56 die i mensis v annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2467737 05 v 5 05/01/2044 die i mensis v annoque mmxliv 44 xliv 2044} test clock-2.2098 {conversion of 2044-05-31} { clock format 2348310896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2044 12:34:56 die xxxi mensis v annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2467767 05 v 5 05/31/2044 die xxxi mensis v annoque mmxliv 44 xliv 2044} test clock-2.2099 {conversion of 2044-06-01} { clock format 2348397296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2044 12:34:56 die i mensis vi annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2467768 06 vi 6 06/01/2044 die i mensis vi annoque mmxliv 44 xliv 2044} test clock-2.2100 {conversion of 2044-06-30} { clock format 2350902896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2044 12:34:56 die xxx mensis vi annoque mmxliv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2467797 06 vi 6 06/30/2044 die xxx mensis vi annoque mmxliv 44 xliv 2044} test clock-2.2101 {conversion of 2044-07-01} { clock format 2350989296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2044 12:34:56 die i mensis vii annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2467798 07 vii 7 07/01/2044 die i mensis vii annoque mmxliv 44 xliv 2044} test clock-2.2102 {conversion of 2044-07-31} { clock format 2353581296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2044 12:34:56 die xxxi mensis vii annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2467828 07 vii 7 07/31/2044 die xxxi mensis vii annoque mmxliv 44 xliv 2044} test clock-2.2103 {conversion of 2044-08-01} { clock format 2353667696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2044 12:34:56 die i mensis viii annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2467829 08 viii 8 08/01/2044 die i mensis viii annoque mmxliv 44 xliv 2044} test clock-2.2104 {conversion of 2044-08-31} { clock format 2356259696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2044 12:34:56 die xxxi mensis viii annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2467859 08 viii 8 08/31/2044 die xxxi mensis viii annoque mmxliv 44 xliv 2044} test clock-2.2105 {conversion of 2044-09-01} { clock format 2356346096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2044 12:34:56 die i mensis ix annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2467860 09 ix 9 09/01/2044 die i mensis ix annoque mmxliv 44 xliv 2044} test clock-2.2106 {conversion of 2044-09-30} { clock format 2358851696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2044 12:34:56 die xxx mensis ix annoque mmxliv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2467889 09 ix 9 09/30/2044 die xxx mensis ix annoque mmxliv 44 xliv 2044} test clock-2.2107 {conversion of 2044-10-01} { clock format 2358938096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2044 12:34:56 die i mensis x annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2467890 10 x 10 10/01/2044 die i mensis x annoque mmxliv 44 xliv 2044} test clock-2.2108 {conversion of 2044-10-31} { clock format 2361530096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2044 12:34:56 die xxxi mensis x annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2467920 10 x 10 10/31/2044 die xxxi mensis x annoque mmxliv 44 xliv 2044} test clock-2.2109 {conversion of 2044-11-01} { clock format 2361616496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2044 12:34:56 die i mensis xi annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2467921 11 xi 11 11/01/2044 die i mensis xi annoque mmxliv 44 xliv 2044} test clock-2.2110 {conversion of 2044-11-30} { clock format 2364122096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2044 12:34:56 die xxx mensis xi annoque mmxliv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2467950 11 xi 11 11/30/2044 die xxx mensis xi annoque mmxliv 44 xliv 2044} test clock-2.2111 {conversion of 2044-12-01} { clock format 2364208496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2044 12:34:56 die i mensis xii annoque mmxliv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2467951 12 xii 12 12/01/2044 die i mensis xii annoque mmxliv 44 xliv 2044} test clock-2.2112 {conversion of 2044-12-31} { clock format 2366800496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2044 12:34:56 die xxxi mensis xii annoque mmxliv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2467981 12 xii 12 12/31/2044 die xxxi mensis xii annoque mmxliv 44 xliv 2044} test clock-2.2113 {conversion of 2045-01-01} { clock format 2366886896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2045 12:34:56 die i mensis i annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2467982 01 i 1 01/01/2045 die i mensis i annoque mmxlv 45 xlv 2045} test clock-2.2114 {conversion of 2045-01-31} { clock format 2369478896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2045 12:34:56 die xxxi mensis i annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2468012 01 i 1 01/31/2045 die xxxi mensis i annoque mmxlv 45 xlv 2045} test clock-2.2115 {conversion of 2045-02-01} { clock format 2369565296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2045 12:34:56 die i mensis ii annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2468013 02 ii 2 02/01/2045 die i mensis ii annoque mmxlv 45 xlv 2045} test clock-2.2116 {conversion of 2045-02-28} { clock format 2371898096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2045 12:34:56 die xxviii mensis ii annoque mmxlv xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2468040 02 ii 2 02/28/2045 die xxviii mensis ii annoque mmxlv 45 xlv 2045} test clock-2.2117 {conversion of 2045-03-01} { clock format 2371984496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2045 12:34:56 die i mensis iii annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2468041 03 iii 3 03/01/2045 die i mensis iii annoque mmxlv 45 xlv 2045} test clock-2.2118 {conversion of 2045-03-31} { clock format 2374576496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2045 12:34:56 die xxxi mensis iii annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2468071 03 iii 3 03/31/2045 die xxxi mensis iii annoque mmxlv 45 xlv 2045} test clock-2.2119 {conversion of 2045-04-01} { clock format 2374662896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2045 12:34:56 die i mensis iv annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2468072 04 iv 4 04/01/2045 die i mensis iv annoque mmxlv 45 xlv 2045} test clock-2.2120 {conversion of 2045-04-30} { clock format 2377168496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2045 12:34:56 die xxx mensis iv annoque mmxlv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2468101 04 iv 4 04/30/2045 die xxx mensis iv annoque mmxlv 45 xlv 2045} test clock-2.2121 {conversion of 2045-05-01} { clock format 2377254896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2045 12:34:56 die i mensis v annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2468102 05 v 5 05/01/2045 die i mensis v annoque mmxlv 45 xlv 2045} test clock-2.2122 {conversion of 2045-05-31} { clock format 2379846896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2045 12:34:56 die xxxi mensis v annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2468132 05 v 5 05/31/2045 die xxxi mensis v annoque mmxlv 45 xlv 2045} test clock-2.2123 {conversion of 2045-06-01} { clock format 2379933296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2045 12:34:56 die i mensis vi annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2468133 06 vi 6 06/01/2045 die i mensis vi annoque mmxlv 45 xlv 2045} test clock-2.2124 {conversion of 2045-06-30} { clock format 2382438896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2045 12:34:56 die xxx mensis vi annoque mmxlv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2468162 06 vi 6 06/30/2045 die xxx mensis vi annoque mmxlv 45 xlv 2045} test clock-2.2125 {conversion of 2045-07-01} { clock format 2382525296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2045 12:34:56 die i mensis vii annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2468163 07 vii 7 07/01/2045 die i mensis vii annoque mmxlv 45 xlv 2045} test clock-2.2126 {conversion of 2045-07-31} { clock format 2385117296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2045 12:34:56 die xxxi mensis vii annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2468193 07 vii 7 07/31/2045 die xxxi mensis vii annoque mmxlv 45 xlv 2045} test clock-2.2127 {conversion of 2045-08-01} { clock format 2385203696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2045 12:34:56 die i mensis viii annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2468194 08 viii 8 08/01/2045 die i mensis viii annoque mmxlv 45 xlv 2045} test clock-2.2128 {conversion of 2045-08-31} { clock format 2387795696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2045 12:34:56 die xxxi mensis viii annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2468224 08 viii 8 08/31/2045 die xxxi mensis viii annoque mmxlv 45 xlv 2045} test clock-2.2129 {conversion of 2045-09-01} { clock format 2387882096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2045 12:34:56 die i mensis ix annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2468225 09 ix 9 09/01/2045 die i mensis ix annoque mmxlv 45 xlv 2045} test clock-2.2130 {conversion of 2045-09-30} { clock format 2390387696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2045 12:34:56 die xxx mensis ix annoque mmxlv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2468254 09 ix 9 09/30/2045 die xxx mensis ix annoque mmxlv 45 xlv 2045} test clock-2.2131 {conversion of 2045-10-01} { clock format 2390474096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2045 12:34:56 die i mensis x annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2468255 10 x 10 10/01/2045 die i mensis x annoque mmxlv 45 xlv 2045} test clock-2.2132 {conversion of 2045-10-31} { clock format 2393066096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2045 12:34:56 die xxxi mensis x annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2468285 10 x 10 10/31/2045 die xxxi mensis x annoque mmxlv 45 xlv 2045} test clock-2.2133 {conversion of 2045-11-01} { clock format 2393152496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2045 12:34:56 die i mensis xi annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2468286 11 xi 11 11/01/2045 die i mensis xi annoque mmxlv 45 xlv 2045} test clock-2.2134 {conversion of 2045-11-30} { clock format 2395658096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2045 12:34:56 die xxx mensis xi annoque mmxlv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2468315 11 xi 11 11/30/2045 die xxx mensis xi annoque mmxlv 45 xlv 2045} test clock-2.2135 {conversion of 2045-12-01} { clock format 2395744496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2045 12:34:56 die i mensis xii annoque mmxlv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2468316 12 xii 12 12/01/2045 die i mensis xii annoque mmxlv 45 xlv 2045} test clock-2.2136 {conversion of 2045-12-31} { clock format 2398336496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2045 12:34:56 die xxxi mensis xii annoque mmxlv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2468346 12 xii 12 12/31/2045 die xxxi mensis xii annoque mmxlv 45 xlv 2045} test clock-2.2137 {conversion of 2046-01-01} { clock format 2398422896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2046 12:34:56 die i mensis i annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2468347 01 i 1 01/01/2046 die i mensis i annoque mmxlvi 46 xlvi 2046} test clock-2.2138 {conversion of 2046-01-31} { clock format 2401014896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2046 12:34:56 die xxxi mensis i annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2468377 01 i 1 01/31/2046 die xxxi mensis i annoque mmxlvi 46 xlvi 2046} test clock-2.2139 {conversion of 2046-02-01} { clock format 2401101296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2046 12:34:56 die i mensis ii annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2468378 02 ii 2 02/01/2046 die i mensis ii annoque mmxlvi 46 xlvi 2046} test clock-2.2140 {conversion of 2046-02-28} { clock format 2403434096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2046 12:34:56 die xxviii mensis ii annoque mmxlvi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2468405 02 ii 2 02/28/2046 die xxviii mensis ii annoque mmxlvi 46 xlvi 2046} test clock-2.2141 {conversion of 2046-03-01} { clock format 2403520496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2046 12:34:56 die i mensis iii annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2468406 03 iii 3 03/01/2046 die i mensis iii annoque mmxlvi 46 xlvi 2046} test clock-2.2142 {conversion of 2046-03-31} { clock format 2406112496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2046 12:34:56 die xxxi mensis iii annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2468436 03 iii 3 03/31/2046 die xxxi mensis iii annoque mmxlvi 46 xlvi 2046} test clock-2.2143 {conversion of 2046-04-01} { clock format 2406198896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2046 12:34:56 die i mensis iv annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2468437 04 iv 4 04/01/2046 die i mensis iv annoque mmxlvi 46 xlvi 2046} test clock-2.2144 {conversion of 2046-04-30} { clock format 2408704496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2046 12:34:56 die xxx mensis iv annoque mmxlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2468466 04 iv 4 04/30/2046 die xxx mensis iv annoque mmxlvi 46 xlvi 2046} test clock-2.2145 {conversion of 2046-05-01} { clock format 2408790896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2046 12:34:56 die i mensis v annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2468467 05 v 5 05/01/2046 die i mensis v annoque mmxlvi 46 xlvi 2046} test clock-2.2146 {conversion of 2046-05-31} { clock format 2411382896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2046 12:34:56 die xxxi mensis v annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2468497 05 v 5 05/31/2046 die xxxi mensis v annoque mmxlvi 46 xlvi 2046} test clock-2.2147 {conversion of 2046-06-01} { clock format 2411469296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2046 12:34:56 die i mensis vi annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2468498 06 vi 6 06/01/2046 die i mensis vi annoque mmxlvi 46 xlvi 2046} test clock-2.2148 {conversion of 2046-06-30} { clock format 2413974896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2046 12:34:56 die xxx mensis vi annoque mmxlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2468527 06 vi 6 06/30/2046 die xxx mensis vi annoque mmxlvi 46 xlvi 2046} test clock-2.2149 {conversion of 2046-07-01} { clock format 2414061296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2046 12:34:56 die i mensis vii annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2468528 07 vii 7 07/01/2046 die i mensis vii annoque mmxlvi 46 xlvi 2046} test clock-2.2150 {conversion of 2046-07-31} { clock format 2416653296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2046 12:34:56 die xxxi mensis vii annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2468558 07 vii 7 07/31/2046 die xxxi mensis vii annoque mmxlvi 46 xlvi 2046} test clock-2.2151 {conversion of 2046-08-01} { clock format 2416739696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2046 12:34:56 die i mensis viii annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2468559 08 viii 8 08/01/2046 die i mensis viii annoque mmxlvi 46 xlvi 2046} test clock-2.2152 {conversion of 2046-08-31} { clock format 2419331696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2046 12:34:56 die xxxi mensis viii annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2468589 08 viii 8 08/31/2046 die xxxi mensis viii annoque mmxlvi 46 xlvi 2046} test clock-2.2153 {conversion of 2046-09-01} { clock format 2419418096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2046 12:34:56 die i mensis ix annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2468590 09 ix 9 09/01/2046 die i mensis ix annoque mmxlvi 46 xlvi 2046} test clock-2.2154 {conversion of 2046-09-30} { clock format 2421923696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2046 12:34:56 die xxx mensis ix annoque mmxlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2468619 09 ix 9 09/30/2046 die xxx mensis ix annoque mmxlvi 46 xlvi 2046} test clock-2.2155 {conversion of 2046-10-01} { clock format 2422010096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2046 12:34:56 die i mensis x annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2468620 10 x 10 10/01/2046 die i mensis x annoque mmxlvi 46 xlvi 2046} test clock-2.2156 {conversion of 2046-10-31} { clock format 2424602096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2046 12:34:56 die xxxi mensis x annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2468650 10 x 10 10/31/2046 die xxxi mensis x annoque mmxlvi 46 xlvi 2046} test clock-2.2157 {conversion of 2046-11-01} { clock format 2424688496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2046 12:34:56 die i mensis xi annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2468651 11 xi 11 11/01/2046 die i mensis xi annoque mmxlvi 46 xlvi 2046} test clock-2.2158 {conversion of 2046-11-30} { clock format 2427194096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2046 12:34:56 die xxx mensis xi annoque mmxlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2468680 11 xi 11 11/30/2046 die xxx mensis xi annoque mmxlvi 46 xlvi 2046} test clock-2.2159 {conversion of 2046-12-01} { clock format 2427280496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2046 12:34:56 die i mensis xii annoque mmxlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2468681 12 xii 12 12/01/2046 die i mensis xii annoque mmxlvi 46 xlvi 2046} test clock-2.2160 {conversion of 2046-12-31} { clock format 2429872496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2046 12:34:56 die xxxi mensis xii annoque mmxlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2468711 12 xii 12 12/31/2046 die xxxi mensis xii annoque mmxlvi 46 xlvi 2046} test clock-2.2161 {conversion of 2047-01-01} { clock format 2429958896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2047 12:34:56 die i mensis i annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2468712 01 i 1 01/01/2047 die i mensis i annoque mmxlvii 47 xlvii 2047} test clock-2.2162 {conversion of 2047-01-31} { clock format 2432550896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2047 12:34:56 die xxxi mensis i annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2468742 01 i 1 01/31/2047 die xxxi mensis i annoque mmxlvii 47 xlvii 2047} test clock-2.2163 {conversion of 2047-02-01} { clock format 2432637296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2047 12:34:56 die i mensis ii annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2468743 02 ii 2 02/01/2047 die i mensis ii annoque mmxlvii 47 xlvii 2047} test clock-2.2164 {conversion of 2047-02-28} { clock format 2434970096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2047 12:34:56 die xxviii mensis ii annoque mmxlvii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2468770 02 ii 2 02/28/2047 die xxviii mensis ii annoque mmxlvii 47 xlvii 2047} test clock-2.2165 {conversion of 2047-03-01} { clock format 2435056496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2047 12:34:56 die i mensis iii annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2468771 03 iii 3 03/01/2047 die i mensis iii annoque mmxlvii 47 xlvii 2047} test clock-2.2166 {conversion of 2047-03-31} { clock format 2437648496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2047 12:34:56 die xxxi mensis iii annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2468801 03 iii 3 03/31/2047 die xxxi mensis iii annoque mmxlvii 47 xlvii 2047} test clock-2.2167 {conversion of 2047-04-01} { clock format 2437734896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2047 12:34:56 die i mensis iv annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2468802 04 iv 4 04/01/2047 die i mensis iv annoque mmxlvii 47 xlvii 2047} test clock-2.2168 {conversion of 2047-04-30} { clock format 2440240496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2047 12:34:56 die xxx mensis iv annoque mmxlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2468831 04 iv 4 04/30/2047 die xxx mensis iv annoque mmxlvii 47 xlvii 2047} test clock-2.2169 {conversion of 2047-05-01} { clock format 2440326896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2047 12:34:56 die i mensis v annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2468832 05 v 5 05/01/2047 die i mensis v annoque mmxlvii 47 xlvii 2047} test clock-2.2170 {conversion of 2047-05-31} { clock format 2442918896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2047 12:34:56 die xxxi mensis v annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2468862 05 v 5 05/31/2047 die xxxi mensis v annoque mmxlvii 47 xlvii 2047} test clock-2.2171 {conversion of 2047-06-01} { clock format 2443005296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2047 12:34:56 die i mensis vi annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2468863 06 vi 6 06/01/2047 die i mensis vi annoque mmxlvii 47 xlvii 2047} test clock-2.2172 {conversion of 2047-06-30} { clock format 2445510896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2047 12:34:56 die xxx mensis vi annoque mmxlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2468892 06 vi 6 06/30/2047 die xxx mensis vi annoque mmxlvii 47 xlvii 2047} test clock-2.2173 {conversion of 2047-07-01} { clock format 2445597296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2047 12:34:56 die i mensis vii annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2468893 07 vii 7 07/01/2047 die i mensis vii annoque mmxlvii 47 xlvii 2047} test clock-2.2174 {conversion of 2047-07-31} { clock format 2448189296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2047 12:34:56 die xxxi mensis vii annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2468923 07 vii 7 07/31/2047 die xxxi mensis vii annoque mmxlvii 47 xlvii 2047} test clock-2.2175 {conversion of 2047-08-01} { clock format 2448275696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2047 12:34:56 die i mensis viii annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2468924 08 viii 8 08/01/2047 die i mensis viii annoque mmxlvii 47 xlvii 2047} test clock-2.2176 {conversion of 2047-08-31} { clock format 2450867696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2047 12:34:56 die xxxi mensis viii annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2468954 08 viii 8 08/31/2047 die xxxi mensis viii annoque mmxlvii 47 xlvii 2047} test clock-2.2177 {conversion of 2047-09-01} { clock format 2450954096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2047 12:34:56 die i mensis ix annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2468955 09 ix 9 09/01/2047 die i mensis ix annoque mmxlvii 47 xlvii 2047} test clock-2.2178 {conversion of 2047-09-30} { clock format 2453459696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2047 12:34:56 die xxx mensis ix annoque mmxlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2468984 09 ix 9 09/30/2047 die xxx mensis ix annoque mmxlvii 47 xlvii 2047} test clock-2.2179 {conversion of 2047-10-01} { clock format 2453546096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2047 12:34:56 die i mensis x annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2468985 10 x 10 10/01/2047 die i mensis x annoque mmxlvii 47 xlvii 2047} test clock-2.2180 {conversion of 2047-10-31} { clock format 2456138096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2047 12:34:56 die xxxi mensis x annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2469015 10 x 10 10/31/2047 die xxxi mensis x annoque mmxlvii 47 xlvii 2047} test clock-2.2181 {conversion of 2047-11-01} { clock format 2456224496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2047 12:34:56 die i mensis xi annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2469016 11 xi 11 11/01/2047 die i mensis xi annoque mmxlvii 47 xlvii 2047} test clock-2.2182 {conversion of 2047-11-30} { clock format 2458730096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2047 12:34:56 die xxx mensis xi annoque mmxlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2469045 11 xi 11 11/30/2047 die xxx mensis xi annoque mmxlvii 47 xlvii 2047} test clock-2.2183 {conversion of 2047-12-01} { clock format 2458816496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2047 12:34:56 die i mensis xii annoque mmxlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2469046 12 xii 12 12/01/2047 die i mensis xii annoque mmxlvii 47 xlvii 2047} test clock-2.2184 {conversion of 2047-12-31} { clock format 2461408496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2047 12:34:56 die xxxi mensis xii annoque mmxlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2469076 12 xii 12 12/31/2047 die xxxi mensis xii annoque mmxlvii 47 xlvii 2047} test clock-2.2185 {conversion of 2048-01-01} { clock format 2461494896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2048 12:34:56 die i mensis i annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2469077 01 i 1 01/01/2048 die i mensis i annoque mmxlviii 48 xlviii 2048} test clock-2.2186 {conversion of 2048-01-31} { clock format 2464086896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2048 12:34:56 die xxxi mensis i annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2469107 01 i 1 01/31/2048 die xxxi mensis i annoque mmxlviii 48 xlviii 2048} test clock-2.2187 {conversion of 2048-02-01} { clock format 2464173296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2048 12:34:56 die i mensis ii annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2469108 02 ii 2 02/01/2048 die i mensis ii annoque mmxlviii 48 xlviii 2048} test clock-2.2188 {conversion of 2048-02-29} { clock format 2466592496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2048 12:34:56 die xxix mensis ii annoque mmxlviii xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2469136 02 ii 2 02/29/2048 die xxix mensis ii annoque mmxlviii 48 xlviii 2048} test clock-2.2189 {conversion of 2048-03-01} { clock format 2466678896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2048 12:34:56 die i mensis iii annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2469137 03 iii 3 03/01/2048 die i mensis iii annoque mmxlviii 48 xlviii 2048} test clock-2.2190 {conversion of 2048-03-31} { clock format 2469270896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2048 12:34:56 die xxxi mensis iii annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2469167 03 iii 3 03/31/2048 die xxxi mensis iii annoque mmxlviii 48 xlviii 2048} test clock-2.2191 {conversion of 2048-04-01} { clock format 2469357296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2048 12:34:56 die i mensis iv annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2469168 04 iv 4 04/01/2048 die i mensis iv annoque mmxlviii 48 xlviii 2048} test clock-2.2192 {conversion of 2048-04-30} { clock format 2471862896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2048 12:34:56 die xxx mensis iv annoque mmxlviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2469197 04 iv 4 04/30/2048 die xxx mensis iv annoque mmxlviii 48 xlviii 2048} test clock-2.2193 {conversion of 2048-05-01} { clock format 2471949296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2048 12:34:56 die i mensis v annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2469198 05 v 5 05/01/2048 die i mensis v annoque mmxlviii 48 xlviii 2048} test clock-2.2194 {conversion of 2048-05-31} { clock format 2474541296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2048 12:34:56 die xxxi mensis v annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2469228 05 v 5 05/31/2048 die xxxi mensis v annoque mmxlviii 48 xlviii 2048} test clock-2.2195 {conversion of 2048-06-01} { clock format 2474627696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2048 12:34:56 die i mensis vi annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2469229 06 vi 6 06/01/2048 die i mensis vi annoque mmxlviii 48 xlviii 2048} test clock-2.2196 {conversion of 2048-06-30} { clock format 2477133296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2048 12:34:56 die xxx mensis vi annoque mmxlviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2469258 06 vi 6 06/30/2048 die xxx mensis vi annoque mmxlviii 48 xlviii 2048} test clock-2.2197 {conversion of 2048-07-01} { clock format 2477219696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2048 12:34:56 die i mensis vii annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2469259 07 vii 7 07/01/2048 die i mensis vii annoque mmxlviii 48 xlviii 2048} test clock-2.2198 {conversion of 2048-07-31} { clock format 2479811696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2048 12:34:56 die xxxi mensis vii annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2469289 07 vii 7 07/31/2048 die xxxi mensis vii annoque mmxlviii 48 xlviii 2048} test clock-2.2199 {conversion of 2048-08-01} { clock format 2479898096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2048 12:34:56 die i mensis viii annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2469290 08 viii 8 08/01/2048 die i mensis viii annoque mmxlviii 48 xlviii 2048} test clock-2.2200 {conversion of 2048-08-31} { clock format 2482490096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2048 12:34:56 die xxxi mensis viii annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2469320 08 viii 8 08/31/2048 die xxxi mensis viii annoque mmxlviii 48 xlviii 2048} test clock-2.2201 {conversion of 2048-09-01} { clock format 2482576496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2048 12:34:56 die i mensis ix annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2469321 09 ix 9 09/01/2048 die i mensis ix annoque mmxlviii 48 xlviii 2048} test clock-2.2202 {conversion of 2048-09-30} { clock format 2485082096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2048 12:34:56 die xxx mensis ix annoque mmxlviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2469350 09 ix 9 09/30/2048 die xxx mensis ix annoque mmxlviii 48 xlviii 2048} test clock-2.2203 {conversion of 2048-10-01} { clock format 2485168496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2048 12:34:56 die i mensis x annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2469351 10 x 10 10/01/2048 die i mensis x annoque mmxlviii 48 xlviii 2048} test clock-2.2204 {conversion of 2048-10-31} { clock format 2487760496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2048 12:34:56 die xxxi mensis x annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2469381 10 x 10 10/31/2048 die xxxi mensis x annoque mmxlviii 48 xlviii 2048} test clock-2.2205 {conversion of 2048-11-01} { clock format 2487846896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2048 12:34:56 die i mensis xi annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2469382 11 xi 11 11/01/2048 die i mensis xi annoque mmxlviii 48 xlviii 2048} test clock-2.2206 {conversion of 2048-11-30} { clock format 2490352496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2048 12:34:56 die xxx mensis xi annoque mmxlviii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2469411 11 xi 11 11/30/2048 die xxx mensis xi annoque mmxlviii 48 xlviii 2048} test clock-2.2207 {conversion of 2048-12-01} { clock format 2490438896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2048 12:34:56 die i mensis xii annoque mmxlviii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2469412 12 xii 12 12/01/2048 die i mensis xii annoque mmxlviii 48 xlviii 2048} test clock-2.2208 {conversion of 2048-12-31} { clock format 2493030896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2048 12:34:56 die xxxi mensis xii annoque mmxlviii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2469442 12 xii 12 12/31/2048 die xxxi mensis xii annoque mmxlviii 48 xlviii 2048} test clock-2.2209 {conversion of 2049-01-01} { clock format 2493117296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2049 12:34:56 die i mensis i annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2469443 01 i 1 01/01/2049 die i mensis i annoque mmxlix 49 xlix 2049} test clock-2.2210 {conversion of 2049-01-31} { clock format 2495709296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2049 12:34:56 die xxxi mensis i annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2469473 01 i 1 01/31/2049 die xxxi mensis i annoque mmxlix 49 xlix 2049} test clock-2.2211 {conversion of 2049-02-01} { clock format 2495795696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2049 12:34:56 die i mensis ii annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2469474 02 ii 2 02/01/2049 die i mensis ii annoque mmxlix 49 xlix 2049} test clock-2.2212 {conversion of 2049-02-28} { clock format 2498128496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2049 12:34:56 die xxviii mensis ii annoque mmxlix xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2469501 02 ii 2 02/28/2049 die xxviii mensis ii annoque mmxlix 49 xlix 2049} test clock-2.2213 {conversion of 2049-03-01} { clock format 2498214896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2049 12:34:56 die i mensis iii annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2469502 03 iii 3 03/01/2049 die i mensis iii annoque mmxlix 49 xlix 2049} test clock-2.2214 {conversion of 2049-03-31} { clock format 2500806896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2049 12:34:56 die xxxi mensis iii annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2469532 03 iii 3 03/31/2049 die xxxi mensis iii annoque mmxlix 49 xlix 2049} test clock-2.2215 {conversion of 2049-04-01} { clock format 2500893296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2049 12:34:56 die i mensis iv annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2469533 04 iv 4 04/01/2049 die i mensis iv annoque mmxlix 49 xlix 2049} test clock-2.2216 {conversion of 2049-04-30} { clock format 2503398896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2049 12:34:56 die xxx mensis iv annoque mmxlix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2469562 04 iv 4 04/30/2049 die xxx mensis iv annoque mmxlix 49 xlix 2049} test clock-2.2217 {conversion of 2049-05-01} { clock format 2503485296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2049 12:34:56 die i mensis v annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2469563 05 v 5 05/01/2049 die i mensis v annoque mmxlix 49 xlix 2049} test clock-2.2218 {conversion of 2049-05-31} { clock format 2506077296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2049 12:34:56 die xxxi mensis v annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2469593 05 v 5 05/31/2049 die xxxi mensis v annoque mmxlix 49 xlix 2049} test clock-2.2219 {conversion of 2049-06-01} { clock format 2506163696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2049 12:34:56 die i mensis vi annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2469594 06 vi 6 06/01/2049 die i mensis vi annoque mmxlix 49 xlix 2049} test clock-2.2220 {conversion of 2049-06-30} { clock format 2508669296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2049 12:34:56 die xxx mensis vi annoque mmxlix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2469623 06 vi 6 06/30/2049 die xxx mensis vi annoque mmxlix 49 xlix 2049} test clock-2.2221 {conversion of 2049-07-01} { clock format 2508755696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2049 12:34:56 die i mensis vii annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2469624 07 vii 7 07/01/2049 die i mensis vii annoque mmxlix 49 xlix 2049} test clock-2.2222 {conversion of 2049-07-31} { clock format 2511347696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2049 12:34:56 die xxxi mensis vii annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2469654 07 vii 7 07/31/2049 die xxxi mensis vii annoque mmxlix 49 xlix 2049} test clock-2.2223 {conversion of 2049-08-01} { clock format 2511434096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2049 12:34:56 die i mensis viii annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2469655 08 viii 8 08/01/2049 die i mensis viii annoque mmxlix 49 xlix 2049} test clock-2.2224 {conversion of 2049-08-31} { clock format 2514026096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2049 12:34:56 die xxxi mensis viii annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2469685 08 viii 8 08/31/2049 die xxxi mensis viii annoque mmxlix 49 xlix 2049} test clock-2.2225 {conversion of 2049-09-01} { clock format 2514112496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2049 12:34:56 die i mensis ix annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2469686 09 ix 9 09/01/2049 die i mensis ix annoque mmxlix 49 xlix 2049} test clock-2.2226 {conversion of 2049-09-30} { clock format 2516618096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2049 12:34:56 die xxx mensis ix annoque mmxlix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2469715 09 ix 9 09/30/2049 die xxx mensis ix annoque mmxlix 49 xlix 2049} test clock-2.2227 {conversion of 2049-10-01} { clock format 2516704496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2049 12:34:56 die i mensis x annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2469716 10 x 10 10/01/2049 die i mensis x annoque mmxlix 49 xlix 2049} test clock-2.2228 {conversion of 2049-10-31} { clock format 2519296496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2049 12:34:56 die xxxi mensis x annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2469746 10 x 10 10/31/2049 die xxxi mensis x annoque mmxlix 49 xlix 2049} test clock-2.2229 {conversion of 2049-11-01} { clock format 2519382896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2049 12:34:56 die i mensis xi annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2469747 11 xi 11 11/01/2049 die i mensis xi annoque mmxlix 49 xlix 2049} test clock-2.2230 {conversion of 2049-11-30} { clock format 2521888496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2049 12:34:56 die xxx mensis xi annoque mmxlix xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2469776 11 xi 11 11/30/2049 die xxx mensis xi annoque mmxlix 49 xlix 2049} test clock-2.2231 {conversion of 2049-12-01} { clock format 2521974896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2049 12:34:56 die i mensis xii annoque mmxlix xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2469777 12 xii 12 12/01/2049 die i mensis xii annoque mmxlix 49 xlix 2049} test clock-2.2232 {conversion of 2049-12-31} { clock format 2524566896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2049 12:34:56 die xxxi mensis xii annoque mmxlix xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2469807 12 xii 12 12/31/2049 die xxxi mensis xii annoque mmxlix 49 xlix 2049} test clock-2.2233 {conversion of 2052-01-01} { clock format 2587725296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2052 12:34:56 die i mensis i annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2470538 01 i 1 01/01/2052 die i mensis i annoque mmlii 52 lii 2052} test clock-2.2234 {conversion of 2052-01-31} { clock format 2590317296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2052 12:34:56 die xxxi mensis i annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2470568 01 i 1 01/31/2052 die xxxi mensis i annoque mmlii 52 lii 2052} test clock-2.2235 {conversion of 2052-02-01} { clock format 2590403696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2052 12:34:56 die i mensis ii annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2470569 02 ii 2 02/01/2052 die i mensis ii annoque mmlii 52 lii 2052} test clock-2.2236 {conversion of 2052-02-29} { clock format 2592822896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2052 12:34:56 die xxix mensis ii annoque mmlii xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2470597 02 ii 2 02/29/2052 die xxix mensis ii annoque mmlii 52 lii 2052} test clock-2.2237 {conversion of 2052-03-01} { clock format 2592909296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2052 12:34:56 die i mensis iii annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2470598 03 iii 3 03/01/2052 die i mensis iii annoque mmlii 52 lii 2052} test clock-2.2238 {conversion of 2052-03-31} { clock format 2595501296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2052 12:34:56 die xxxi mensis iii annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2470628 03 iii 3 03/31/2052 die xxxi mensis iii annoque mmlii 52 lii 2052} test clock-2.2239 {conversion of 2052-04-01} { clock format 2595587696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2052 12:34:56 die i mensis iv annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2470629 04 iv 4 04/01/2052 die i mensis iv annoque mmlii 52 lii 2052} test clock-2.2240 {conversion of 2052-04-30} { clock format 2598093296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2052 12:34:56 die xxx mensis iv annoque mmlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2470658 04 iv 4 04/30/2052 die xxx mensis iv annoque mmlii 52 lii 2052} test clock-2.2241 {conversion of 2052-05-01} { clock format 2598179696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2052 12:34:56 die i mensis v annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2470659 05 v 5 05/01/2052 die i mensis v annoque mmlii 52 lii 2052} test clock-2.2242 {conversion of 2052-05-31} { clock format 2600771696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2052 12:34:56 die xxxi mensis v annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2470689 05 v 5 05/31/2052 die xxxi mensis v annoque mmlii 52 lii 2052} test clock-2.2243 {conversion of 2052-06-01} { clock format 2600858096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2052 12:34:56 die i mensis vi annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2470690 06 vi 6 06/01/2052 die i mensis vi annoque mmlii 52 lii 2052} test clock-2.2244 {conversion of 2052-06-30} { clock format 2603363696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2052 12:34:56 die xxx mensis vi annoque mmlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2470719 06 vi 6 06/30/2052 die xxx mensis vi annoque mmlii 52 lii 2052} test clock-2.2245 {conversion of 2052-07-01} { clock format 2603450096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2052 12:34:56 die i mensis vii annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2470720 07 vii 7 07/01/2052 die i mensis vii annoque mmlii 52 lii 2052} test clock-2.2246 {conversion of 2052-07-31} { clock format 2606042096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2052 12:34:56 die xxxi mensis vii annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2470750 07 vii 7 07/31/2052 die xxxi mensis vii annoque mmlii 52 lii 2052} test clock-2.2247 {conversion of 2052-08-01} { clock format 2606128496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2052 12:34:56 die i mensis viii annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2470751 08 viii 8 08/01/2052 die i mensis viii annoque mmlii 52 lii 2052} test clock-2.2248 {conversion of 2052-08-31} { clock format 2608720496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2052 12:34:56 die xxxi mensis viii annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2470781 08 viii 8 08/31/2052 die xxxi mensis viii annoque mmlii 52 lii 2052} test clock-2.2249 {conversion of 2052-09-01} { clock format 2608806896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2052 12:34:56 die i mensis ix annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2470782 09 ix 9 09/01/2052 die i mensis ix annoque mmlii 52 lii 2052} test clock-2.2250 {conversion of 2052-09-30} { clock format 2611312496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2052 12:34:56 die xxx mensis ix annoque mmlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2470811 09 ix 9 09/30/2052 die xxx mensis ix annoque mmlii 52 lii 2052} test clock-2.2251 {conversion of 2052-10-01} { clock format 2611398896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2052 12:34:56 die i mensis x annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2470812 10 x 10 10/01/2052 die i mensis x annoque mmlii 52 lii 2052} test clock-2.2252 {conversion of 2052-10-31} { clock format 2613990896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2052 12:34:56 die xxxi mensis x annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2470842 10 x 10 10/31/2052 die xxxi mensis x annoque mmlii 52 lii 2052} test clock-2.2253 {conversion of 2052-11-01} { clock format 2614077296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2052 12:34:56 die i mensis xi annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2470843 11 xi 11 11/01/2052 die i mensis xi annoque mmlii 52 lii 2052} test clock-2.2254 {conversion of 2052-11-30} { clock format 2616582896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2052 12:34:56 die xxx mensis xi annoque mmlii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2470872 11 xi 11 11/30/2052 die xxx mensis xi annoque mmlii 52 lii 2052} test clock-2.2255 {conversion of 2052-12-01} { clock format 2616669296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2052 12:34:56 die i mensis xii annoque mmlii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2470873 12 xii 12 12/01/2052 die i mensis xii annoque mmlii 52 lii 2052} test clock-2.2256 {conversion of 2052-12-31} { clock format 2619261296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2052 12:34:56 die xxxi mensis xii annoque mmlii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2470903 12 xii 12 12/31/2052 die xxxi mensis xii annoque mmlii 52 lii 2052} test clock-2.2257 {conversion of 2053-01-01} { clock format 2619347696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2053 12:34:56 die i mensis i annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2470904 01 i 1 01/01/2053 die i mensis i annoque mmliii 53 liii 2053} test clock-2.2258 {conversion of 2053-01-31} { clock format 2621939696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2053 12:34:56 die xxxi mensis i annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2470934 01 i 1 01/31/2053 die xxxi mensis i annoque mmliii 53 liii 2053} test clock-2.2259 {conversion of 2053-02-01} { clock format 2622026096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2053 12:34:56 die i mensis ii annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2470935 02 ii 2 02/01/2053 die i mensis ii annoque mmliii 53 liii 2053} test clock-2.2260 {conversion of 2053-02-28} { clock format 2624358896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2053 12:34:56 die xxviii mensis ii annoque mmliii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2470962 02 ii 2 02/28/2053 die xxviii mensis ii annoque mmliii 53 liii 2053} test clock-2.2261 {conversion of 2053-03-01} { clock format 2624445296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2053 12:34:56 die i mensis iii annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2470963 03 iii 3 03/01/2053 die i mensis iii annoque mmliii 53 liii 2053} test clock-2.2262 {conversion of 2053-03-31} { clock format 2627037296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2053 12:34:56 die xxxi mensis iii annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2470993 03 iii 3 03/31/2053 die xxxi mensis iii annoque mmliii 53 liii 2053} test clock-2.2263 {conversion of 2053-04-01} { clock format 2627123696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2053 12:34:56 die i mensis iv annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2470994 04 iv 4 04/01/2053 die i mensis iv annoque mmliii 53 liii 2053} test clock-2.2264 {conversion of 2053-04-30} { clock format 2629629296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2053 12:34:56 die xxx mensis iv annoque mmliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2471023 04 iv 4 04/30/2053 die xxx mensis iv annoque mmliii 53 liii 2053} test clock-2.2265 {conversion of 2053-05-01} { clock format 2629715696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2053 12:34:56 die i mensis v annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2471024 05 v 5 05/01/2053 die i mensis v annoque mmliii 53 liii 2053} test clock-2.2266 {conversion of 2053-05-31} { clock format 2632307696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2053 12:34:56 die xxxi mensis v annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2471054 05 v 5 05/31/2053 die xxxi mensis v annoque mmliii 53 liii 2053} test clock-2.2267 {conversion of 2053-06-01} { clock format 2632394096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2053 12:34:56 die i mensis vi annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2471055 06 vi 6 06/01/2053 die i mensis vi annoque mmliii 53 liii 2053} test clock-2.2268 {conversion of 2053-06-30} { clock format 2634899696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2053 12:34:56 die xxx mensis vi annoque mmliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2471084 06 vi 6 06/30/2053 die xxx mensis vi annoque mmliii 53 liii 2053} test clock-2.2269 {conversion of 2053-07-01} { clock format 2634986096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2053 12:34:56 die i mensis vii annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2471085 07 vii 7 07/01/2053 die i mensis vii annoque mmliii 53 liii 2053} test clock-2.2270 {conversion of 2053-07-31} { clock format 2637578096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2053 12:34:56 die xxxi mensis vii annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2471115 07 vii 7 07/31/2053 die xxxi mensis vii annoque mmliii 53 liii 2053} test clock-2.2271 {conversion of 2053-08-01} { clock format 2637664496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2053 12:34:56 die i mensis viii annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2471116 08 viii 8 08/01/2053 die i mensis viii annoque mmliii 53 liii 2053} test clock-2.2272 {conversion of 2053-08-31} { clock format 2640256496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2053 12:34:56 die xxxi mensis viii annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2471146 08 viii 8 08/31/2053 die xxxi mensis viii annoque mmliii 53 liii 2053} test clock-2.2273 {conversion of 2053-09-01} { clock format 2640342896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2053 12:34:56 die i mensis ix annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2471147 09 ix 9 09/01/2053 die i mensis ix annoque mmliii 53 liii 2053} test clock-2.2274 {conversion of 2053-09-30} { clock format 2642848496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2053 12:34:56 die xxx mensis ix annoque mmliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2471176 09 ix 9 09/30/2053 die xxx mensis ix annoque mmliii 53 liii 2053} test clock-2.2275 {conversion of 2053-10-01} { clock format 2642934896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2053 12:34:56 die i mensis x annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2471177 10 x 10 10/01/2053 die i mensis x annoque mmliii 53 liii 2053} test clock-2.2276 {conversion of 2053-10-31} { clock format 2645526896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2053 12:34:56 die xxxi mensis x annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2471207 10 x 10 10/31/2053 die xxxi mensis x annoque mmliii 53 liii 2053} test clock-2.2277 {conversion of 2053-11-01} { clock format 2645613296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2053 12:34:56 die i mensis xi annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2471208 11 xi 11 11/01/2053 die i mensis xi annoque mmliii 53 liii 2053} test clock-2.2278 {conversion of 2053-11-30} { clock format 2648118896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2053 12:34:56 die xxx mensis xi annoque mmliii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2471237 11 xi 11 11/30/2053 die xxx mensis xi annoque mmliii 53 liii 2053} test clock-2.2279 {conversion of 2053-12-01} { clock format 2648205296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2053 12:34:56 die i mensis xii annoque mmliii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2471238 12 xii 12 12/01/2053 die i mensis xii annoque mmliii 53 liii 2053} test clock-2.2280 {conversion of 2053-12-31} { clock format 2650797296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2053 12:34:56 die xxxi mensis xii annoque mmliii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2471268 12 xii 12 12/31/2053 die xxxi mensis xii annoque mmliii 53 liii 2053} test clock-2.2281 {conversion of 2056-01-01} { clock format 2713955696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2056 12:34:56 die i mensis i annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2471999 01 i 1 01/01/2056 die i mensis i annoque mmlvi 56 lvi 2056} test clock-2.2282 {conversion of 2056-01-31} { clock format 2716547696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2056 12:34:56 die xxxi mensis i annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2472029 01 i 1 01/31/2056 die xxxi mensis i annoque mmlvi 56 lvi 2056} test clock-2.2283 {conversion of 2056-02-01} { clock format 2716634096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2056 12:34:56 die i mensis ii annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2472030 02 ii 2 02/01/2056 die i mensis ii annoque mmlvi 56 lvi 2056} test clock-2.2284 {conversion of 2056-02-29} { clock format 2719053296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2056 12:34:56 die xxix mensis ii annoque mmlvi xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2472058 02 ii 2 02/29/2056 die xxix mensis ii annoque mmlvi 56 lvi 2056} test clock-2.2285 {conversion of 2056-03-01} { clock format 2719139696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2056 12:34:56 die i mensis iii annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2472059 03 iii 3 03/01/2056 die i mensis iii annoque mmlvi 56 lvi 2056} test clock-2.2286 {conversion of 2056-03-31} { clock format 2721731696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2056 12:34:56 die xxxi mensis iii annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2472089 03 iii 3 03/31/2056 die xxxi mensis iii annoque mmlvi 56 lvi 2056} test clock-2.2287 {conversion of 2056-04-01} { clock format 2721818096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2056 12:34:56 die i mensis iv annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2472090 04 iv 4 04/01/2056 die i mensis iv annoque mmlvi 56 lvi 2056} test clock-2.2288 {conversion of 2056-04-30} { clock format 2724323696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2056 12:34:56 die xxx mensis iv annoque mmlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2472119 04 iv 4 04/30/2056 die xxx mensis iv annoque mmlvi 56 lvi 2056} test clock-2.2289 {conversion of 2056-05-01} { clock format 2724410096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2056 12:34:56 die i mensis v annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2472120 05 v 5 05/01/2056 die i mensis v annoque mmlvi 56 lvi 2056} test clock-2.2290 {conversion of 2056-05-31} { clock format 2727002096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2056 12:34:56 die xxxi mensis v annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2472150 05 v 5 05/31/2056 die xxxi mensis v annoque mmlvi 56 lvi 2056} test clock-2.2291 {conversion of 2056-06-01} { clock format 2727088496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2056 12:34:56 die i mensis vi annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2472151 06 vi 6 06/01/2056 die i mensis vi annoque mmlvi 56 lvi 2056} test clock-2.2292 {conversion of 2056-06-30} { clock format 2729594096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2056 12:34:56 die xxx mensis vi annoque mmlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2472180 06 vi 6 06/30/2056 die xxx mensis vi annoque mmlvi 56 lvi 2056} test clock-2.2293 {conversion of 2056-07-01} { clock format 2729680496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2056 12:34:56 die i mensis vii annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2472181 07 vii 7 07/01/2056 die i mensis vii annoque mmlvi 56 lvi 2056} test clock-2.2294 {conversion of 2056-07-31} { clock format 2732272496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2056 12:34:56 die xxxi mensis vii annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2472211 07 vii 7 07/31/2056 die xxxi mensis vii annoque mmlvi 56 lvi 2056} test clock-2.2295 {conversion of 2056-08-01} { clock format 2732358896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2056 12:34:56 die i mensis viii annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2472212 08 viii 8 08/01/2056 die i mensis viii annoque mmlvi 56 lvi 2056} test clock-2.2296 {conversion of 2056-08-31} { clock format 2734950896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2056 12:34:56 die xxxi mensis viii annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2472242 08 viii 8 08/31/2056 die xxxi mensis viii annoque mmlvi 56 lvi 2056} test clock-2.2297 {conversion of 2056-09-01} { clock format 2735037296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2056 12:34:56 die i mensis ix annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2472243 09 ix 9 09/01/2056 die i mensis ix annoque mmlvi 56 lvi 2056} test clock-2.2298 {conversion of 2056-09-30} { clock format 2737542896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2056 12:34:56 die xxx mensis ix annoque mmlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2472272 09 ix 9 09/30/2056 die xxx mensis ix annoque mmlvi 56 lvi 2056} test clock-2.2299 {conversion of 2056-10-01} { clock format 2737629296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2056 12:34:56 die i mensis x annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2472273 10 x 10 10/01/2056 die i mensis x annoque mmlvi 56 lvi 2056} test clock-2.2300 {conversion of 2056-10-31} { clock format 2740221296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2056 12:34:56 die xxxi mensis x annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2472303 10 x 10 10/31/2056 die xxxi mensis x annoque mmlvi 56 lvi 2056} test clock-2.2301 {conversion of 2056-11-01} { clock format 2740307696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2056 12:34:56 die i mensis xi annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2472304 11 xi 11 11/01/2056 die i mensis xi annoque mmlvi 56 lvi 2056} test clock-2.2302 {conversion of 2056-11-30} { clock format 2742813296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2056 12:34:56 die xxx mensis xi annoque mmlvi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2472333 11 xi 11 11/30/2056 die xxx mensis xi annoque mmlvi 56 lvi 2056} test clock-2.2303 {conversion of 2056-12-01} { clock format 2742899696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2056 12:34:56 die i mensis xii annoque mmlvi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2472334 12 xii 12 12/01/2056 die i mensis xii annoque mmlvi 56 lvi 2056} test clock-2.2304 {conversion of 2056-12-31} { clock format 2745491696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2056 12:34:56 die xxxi mensis xii annoque mmlvi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2472364 12 xii 12 12/31/2056 die xxxi mensis xii annoque mmlvi 56 lvi 2056} test clock-2.2305 {conversion of 2057-01-01} { clock format 2745578096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2057 12:34:56 die i mensis i annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2472365 01 i 1 01/01/2057 die i mensis i annoque mmlvii 57 lvii 2057} test clock-2.2306 {conversion of 2057-01-31} { clock format 2748170096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2057 12:34:56 die xxxi mensis i annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2472395 01 i 1 01/31/2057 die xxxi mensis i annoque mmlvii 57 lvii 2057} test clock-2.2307 {conversion of 2057-02-01} { clock format 2748256496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2057 12:34:56 die i mensis ii annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2472396 02 ii 2 02/01/2057 die i mensis ii annoque mmlvii 57 lvii 2057} test clock-2.2308 {conversion of 2057-02-28} { clock format 2750589296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2057 12:34:56 die xxviii mensis ii annoque mmlvii xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2472423 02 ii 2 02/28/2057 die xxviii mensis ii annoque mmlvii 57 lvii 2057} test clock-2.2309 {conversion of 2057-03-01} { clock format 2750675696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2057 12:34:56 die i mensis iii annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2472424 03 iii 3 03/01/2057 die i mensis iii annoque mmlvii 57 lvii 2057} test clock-2.2310 {conversion of 2057-03-31} { clock format 2753267696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2057 12:34:56 die xxxi mensis iii annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2472454 03 iii 3 03/31/2057 die xxxi mensis iii annoque mmlvii 57 lvii 2057} test clock-2.2311 {conversion of 2057-04-01} { clock format 2753354096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2057 12:34:56 die i mensis iv annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2472455 04 iv 4 04/01/2057 die i mensis iv annoque mmlvii 57 lvii 2057} test clock-2.2312 {conversion of 2057-04-30} { clock format 2755859696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2057 12:34:56 die xxx mensis iv annoque mmlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2472484 04 iv 4 04/30/2057 die xxx mensis iv annoque mmlvii 57 lvii 2057} test clock-2.2313 {conversion of 2057-05-01} { clock format 2755946096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2057 12:34:56 die i mensis v annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2472485 05 v 5 05/01/2057 die i mensis v annoque mmlvii 57 lvii 2057} test clock-2.2314 {conversion of 2057-05-31} { clock format 2758538096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2057 12:34:56 die xxxi mensis v annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2472515 05 v 5 05/31/2057 die xxxi mensis v annoque mmlvii 57 lvii 2057} test clock-2.2315 {conversion of 2057-06-01} { clock format 2758624496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2057 12:34:56 die i mensis vi annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2472516 06 vi 6 06/01/2057 die i mensis vi annoque mmlvii 57 lvii 2057} test clock-2.2316 {conversion of 2057-06-30} { clock format 2761130096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2057 12:34:56 die xxx mensis vi annoque mmlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2472545 06 vi 6 06/30/2057 die xxx mensis vi annoque mmlvii 57 lvii 2057} test clock-2.2317 {conversion of 2057-07-01} { clock format 2761216496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2057 12:34:56 die i mensis vii annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2472546 07 vii 7 07/01/2057 die i mensis vii annoque mmlvii 57 lvii 2057} test clock-2.2318 {conversion of 2057-07-31} { clock format 2763808496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2057 12:34:56 die xxxi mensis vii annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2472576 07 vii 7 07/31/2057 die xxxi mensis vii annoque mmlvii 57 lvii 2057} test clock-2.2319 {conversion of 2057-08-01} { clock format 2763894896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2057 12:34:56 die i mensis viii annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2472577 08 viii 8 08/01/2057 die i mensis viii annoque mmlvii 57 lvii 2057} test clock-2.2320 {conversion of 2057-08-31} { clock format 2766486896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2057 12:34:56 die xxxi mensis viii annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2472607 08 viii 8 08/31/2057 die xxxi mensis viii annoque mmlvii 57 lvii 2057} test clock-2.2321 {conversion of 2057-09-01} { clock format 2766573296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2057 12:34:56 die i mensis ix annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2472608 09 ix 9 09/01/2057 die i mensis ix annoque mmlvii 57 lvii 2057} test clock-2.2322 {conversion of 2057-09-30} { clock format 2769078896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2057 12:34:56 die xxx mensis ix annoque mmlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2472637 09 ix 9 09/30/2057 die xxx mensis ix annoque mmlvii 57 lvii 2057} test clock-2.2323 {conversion of 2057-10-01} { clock format 2769165296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2057 12:34:56 die i mensis x annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2472638 10 x 10 10/01/2057 die i mensis x annoque mmlvii 57 lvii 2057} test clock-2.2324 {conversion of 2057-10-31} { clock format 2771757296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2057 12:34:56 die xxxi mensis x annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2472668 10 x 10 10/31/2057 die xxxi mensis x annoque mmlvii 57 lvii 2057} test clock-2.2325 {conversion of 2057-11-01} { clock format 2771843696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2057 12:34:56 die i mensis xi annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2472669 11 xi 11 11/01/2057 die i mensis xi annoque mmlvii 57 lvii 2057} test clock-2.2326 {conversion of 2057-11-30} { clock format 2774349296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2057 12:34:56 die xxx mensis xi annoque mmlvii xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2472698 11 xi 11 11/30/2057 die xxx mensis xi annoque mmlvii 57 lvii 2057} test clock-2.2327 {conversion of 2057-12-01} { clock format 2774435696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2057 12:34:56 die i mensis xii annoque mmlvii xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2472699 12 xii 12 12/01/2057 die i mensis xii annoque mmlvii 57 lvii 2057} test clock-2.2328 {conversion of 2057-12-31} { clock format 2777027696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2057 12:34:56 die xxxi mensis xii annoque mmlvii xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2472729 12 xii 12 12/31/2057 die xxxi mensis xii annoque mmlvii 57 lvii 2057} test clock-2.2329 {conversion of 2060-01-01} { clock format 2840186096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2060 12:34:56 die i mensis i annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2473460 01 i 1 01/01/2060 die i mensis i annoque mmlx 60 lx 2060} test clock-2.2330 {conversion of 2060-01-31} { clock format 2842778096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2060 12:34:56 die xxxi mensis i annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2473490 01 i 1 01/31/2060 die xxxi mensis i annoque mmlx 60 lx 2060} test clock-2.2331 {conversion of 2060-02-01} { clock format 2842864496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2060 12:34:56 die i mensis ii annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2473491 02 ii 2 02/01/2060 die i mensis ii annoque mmlx 60 lx 2060} test clock-2.2332 {conversion of 2060-02-29} { clock format 2845283696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2060 12:34:56 die xxix mensis ii annoque mmlx xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2473519 02 ii 2 02/29/2060 die xxix mensis ii annoque mmlx 60 lx 2060} test clock-2.2333 {conversion of 2060-03-01} { clock format 2845370096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2060 12:34:56 die i mensis iii annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2473520 03 iii 3 03/01/2060 die i mensis iii annoque mmlx 60 lx 2060} test clock-2.2334 {conversion of 2060-03-31} { clock format 2847962096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2060 12:34:56 die xxxi mensis iii annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2473550 03 iii 3 03/31/2060 die xxxi mensis iii annoque mmlx 60 lx 2060} test clock-2.2335 {conversion of 2060-04-01} { clock format 2848048496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2060 12:34:56 die i mensis iv annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2473551 04 iv 4 04/01/2060 die i mensis iv annoque mmlx 60 lx 2060} test clock-2.2336 {conversion of 2060-04-30} { clock format 2850554096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2060 12:34:56 die xxx mensis iv annoque mmlx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2473580 04 iv 4 04/30/2060 die xxx mensis iv annoque mmlx 60 lx 2060} test clock-2.2337 {conversion of 2060-05-01} { clock format 2850640496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2060 12:34:56 die i mensis v annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2473581 05 v 5 05/01/2060 die i mensis v annoque mmlx 60 lx 2060} test clock-2.2338 {conversion of 2060-05-31} { clock format 2853232496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2060 12:34:56 die xxxi mensis v annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2473611 05 v 5 05/31/2060 die xxxi mensis v annoque mmlx 60 lx 2060} test clock-2.2339 {conversion of 2060-06-01} { clock format 2853318896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2060 12:34:56 die i mensis vi annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2473612 06 vi 6 06/01/2060 die i mensis vi annoque mmlx 60 lx 2060} test clock-2.2340 {conversion of 2060-06-30} { clock format 2855824496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2060 12:34:56 die xxx mensis vi annoque mmlx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2473641 06 vi 6 06/30/2060 die xxx mensis vi annoque mmlx 60 lx 2060} test clock-2.2341 {conversion of 2060-07-01} { clock format 2855910896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2060 12:34:56 die i mensis vii annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2473642 07 vii 7 07/01/2060 die i mensis vii annoque mmlx 60 lx 2060} test clock-2.2342 {conversion of 2060-07-31} { clock format 2858502896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2060 12:34:56 die xxxi mensis vii annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2473672 07 vii 7 07/31/2060 die xxxi mensis vii annoque mmlx 60 lx 2060} test clock-2.2343 {conversion of 2060-08-01} { clock format 2858589296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2060 12:34:56 die i mensis viii annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2473673 08 viii 8 08/01/2060 die i mensis viii annoque mmlx 60 lx 2060} test clock-2.2344 {conversion of 2060-08-31} { clock format 2861181296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2060 12:34:56 die xxxi mensis viii annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2473703 08 viii 8 08/31/2060 die xxxi mensis viii annoque mmlx 60 lx 2060} test clock-2.2345 {conversion of 2060-09-01} { clock format 2861267696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2060 12:34:56 die i mensis ix annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2473704 09 ix 9 09/01/2060 die i mensis ix annoque mmlx 60 lx 2060} test clock-2.2346 {conversion of 2060-09-30} { clock format 2863773296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2060 12:34:56 die xxx mensis ix annoque mmlx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2473733 09 ix 9 09/30/2060 die xxx mensis ix annoque mmlx 60 lx 2060} test clock-2.2347 {conversion of 2060-10-01} { clock format 2863859696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2060 12:34:56 die i mensis x annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2473734 10 x 10 10/01/2060 die i mensis x annoque mmlx 60 lx 2060} test clock-2.2348 {conversion of 2060-10-31} { clock format 2866451696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2060 12:34:56 die xxxi mensis x annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2473764 10 x 10 10/31/2060 die xxxi mensis x annoque mmlx 60 lx 2060} test clock-2.2349 {conversion of 2060-11-01} { clock format 2866538096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2060 12:34:56 die i mensis xi annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2473765 11 xi 11 11/01/2060 die i mensis xi annoque mmlx 60 lx 2060} test clock-2.2350 {conversion of 2060-11-30} { clock format 2869043696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2060 12:34:56 die xxx mensis xi annoque mmlx xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2473794 11 xi 11 11/30/2060 die xxx mensis xi annoque mmlx 60 lx 2060} test clock-2.2351 {conversion of 2060-12-01} { clock format 2869130096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2060 12:34:56 die i mensis xii annoque mmlx xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2473795 12 xii 12 12/01/2060 die i mensis xii annoque mmlx 60 lx 2060} test clock-2.2352 {conversion of 2060-12-31} { clock format 2871722096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2060 12:34:56 die xxxi mensis xii annoque mmlx xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2473825 12 xii 12 12/31/2060 die xxxi mensis xii annoque mmlx 60 lx 2060} test clock-2.2353 {conversion of 2061-01-01} { clock format 2871808496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2061 12:34:56 die i mensis i annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2473826 01 i 1 01/01/2061 die i mensis i annoque mmlxi 61 lxi 2061} test clock-2.2354 {conversion of 2061-01-31} { clock format 2874400496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2061 12:34:56 die xxxi mensis i annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2473856 01 i 1 01/31/2061 die xxxi mensis i annoque mmlxi 61 lxi 2061} test clock-2.2355 {conversion of 2061-02-01} { clock format 2874486896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2061 12:34:56 die i mensis ii annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2473857 02 ii 2 02/01/2061 die i mensis ii annoque mmlxi 61 lxi 2061} test clock-2.2356 {conversion of 2061-02-28} { clock format 2876819696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2061 12:34:56 die xxviii mensis ii annoque mmlxi xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2473884 02 ii 2 02/28/2061 die xxviii mensis ii annoque mmlxi 61 lxi 2061} test clock-2.2357 {conversion of 2061-03-01} { clock format 2876906096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2061 12:34:56 die i mensis iii annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2473885 03 iii 3 03/01/2061 die i mensis iii annoque mmlxi 61 lxi 2061} test clock-2.2358 {conversion of 2061-03-31} { clock format 2879498096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2061 12:34:56 die xxxi mensis iii annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2473915 03 iii 3 03/31/2061 die xxxi mensis iii annoque mmlxi 61 lxi 2061} test clock-2.2359 {conversion of 2061-04-01} { clock format 2879584496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2061 12:34:56 die i mensis iv annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2473916 04 iv 4 04/01/2061 die i mensis iv annoque mmlxi 61 lxi 2061} test clock-2.2360 {conversion of 2061-04-30} { clock format 2882090096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2061 12:34:56 die xxx mensis iv annoque mmlxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2473945 04 iv 4 04/30/2061 die xxx mensis iv annoque mmlxi 61 lxi 2061} test clock-2.2361 {conversion of 2061-05-01} { clock format 2882176496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2061 12:34:56 die i mensis v annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2473946 05 v 5 05/01/2061 die i mensis v annoque mmlxi 61 lxi 2061} test clock-2.2362 {conversion of 2061-05-31} { clock format 2884768496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2061 12:34:56 die xxxi mensis v annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2473976 05 v 5 05/31/2061 die xxxi mensis v annoque mmlxi 61 lxi 2061} test clock-2.2363 {conversion of 2061-06-01} { clock format 2884854896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2061 12:34:56 die i mensis vi annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2473977 06 vi 6 06/01/2061 die i mensis vi annoque mmlxi 61 lxi 2061} test clock-2.2364 {conversion of 2061-06-30} { clock format 2887360496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2061 12:34:56 die xxx mensis vi annoque mmlxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2474006 06 vi 6 06/30/2061 die xxx mensis vi annoque mmlxi 61 lxi 2061} test clock-2.2365 {conversion of 2061-07-01} { clock format 2887446896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2061 12:34:56 die i mensis vii annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2474007 07 vii 7 07/01/2061 die i mensis vii annoque mmlxi 61 lxi 2061} test clock-2.2366 {conversion of 2061-07-31} { clock format 2890038896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2061 12:34:56 die xxxi mensis vii annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2474037 07 vii 7 07/31/2061 die xxxi mensis vii annoque mmlxi 61 lxi 2061} test clock-2.2367 {conversion of 2061-08-01} { clock format 2890125296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2061 12:34:56 die i mensis viii annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2474038 08 viii 8 08/01/2061 die i mensis viii annoque mmlxi 61 lxi 2061} test clock-2.2368 {conversion of 2061-08-31} { clock format 2892717296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2061 12:34:56 die xxxi mensis viii annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2474068 08 viii 8 08/31/2061 die xxxi mensis viii annoque mmlxi 61 lxi 2061} test clock-2.2369 {conversion of 2061-09-01} { clock format 2892803696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2061 12:34:56 die i mensis ix annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2474069 09 ix 9 09/01/2061 die i mensis ix annoque mmlxi 61 lxi 2061} test clock-2.2370 {conversion of 2061-09-30} { clock format 2895309296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2061 12:34:56 die xxx mensis ix annoque mmlxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2474098 09 ix 9 09/30/2061 die xxx mensis ix annoque mmlxi 61 lxi 2061} test clock-2.2371 {conversion of 2061-10-01} { clock format 2895395696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2061 12:34:56 die i mensis x annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2474099 10 x 10 10/01/2061 die i mensis x annoque mmlxi 61 lxi 2061} test clock-2.2372 {conversion of 2061-10-31} { clock format 2897987696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2061 12:34:56 die xxxi mensis x annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2474129 10 x 10 10/31/2061 die xxxi mensis x annoque mmlxi 61 lxi 2061} test clock-2.2373 {conversion of 2061-11-01} { clock format 2898074096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2061 12:34:56 die i mensis xi annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2474130 11 xi 11 11/01/2061 die i mensis xi annoque mmlxi 61 lxi 2061} test clock-2.2374 {conversion of 2061-11-30} { clock format 2900579696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2061 12:34:56 die xxx mensis xi annoque mmlxi xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2474159 11 xi 11 11/30/2061 die xxx mensis xi annoque mmlxi 61 lxi 2061} test clock-2.2375 {conversion of 2061-12-01} { clock format 2900666096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2061 12:34:56 die i mensis xii annoque mmlxi xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2474160 12 xii 12 12/01/2061 die i mensis xii annoque mmlxi 61 lxi 2061} test clock-2.2376 {conversion of 2061-12-31} { clock format 2903258096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2061 12:34:56 die xxxi mensis xii annoque mmlxi xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2474190 12 xii 12 12/31/2061 die xxxi mensis xii annoque mmlxi 61 lxi 2061} test clock-2.2377 {conversion of 2064-01-01} { clock format 2966416496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2064 12:34:56 die i mensis i annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2474921 01 i 1 01/01/2064 die i mensis i annoque mmlxiv 64 lxiv 2064} test clock-2.2378 {conversion of 2064-01-31} { clock format 2969008496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2064 12:34:56 die xxxi mensis i annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2474951 01 i 1 01/31/2064 die xxxi mensis i annoque mmlxiv 64 lxiv 2064} test clock-2.2379 {conversion of 2064-02-01} { clock format 2969094896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2064 12:34:56 die i mensis ii annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2474952 02 ii 2 02/01/2064 die i mensis ii annoque mmlxiv 64 lxiv 2064} test clock-2.2380 {conversion of 2064-02-29} { clock format 2971514096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/29/2064 12:34:56 die xxix mensis ii annoque mmlxiv xii h xxxiv m lvi s 20 mm 29 xxix 29 xxix Feb 060 2474980 02 ii 2 02/29/2064 die xxix mensis ii annoque mmlxiv 64 lxiv 2064} test clock-2.2381 {conversion of 2064-03-01} { clock format 2971600496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2064 12:34:56 die i mensis iii annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 061 2474981 03 iii 3 03/01/2064 die i mensis iii annoque mmlxiv 64 lxiv 2064} test clock-2.2382 {conversion of 2064-03-31} { clock format 2974192496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2064 12:34:56 die xxxi mensis iii annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 091 2475011 03 iii 3 03/31/2064 die xxxi mensis iii annoque mmlxiv 64 lxiv 2064} test clock-2.2383 {conversion of 2064-04-01} { clock format 2974278896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2064 12:34:56 die i mensis iv annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 092 2475012 04 iv 4 04/01/2064 die i mensis iv annoque mmlxiv 64 lxiv 2064} test clock-2.2384 {conversion of 2064-04-30} { clock format 2976784496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2064 12:34:56 die xxx mensis iv annoque mmlxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 121 2475041 04 iv 4 04/30/2064 die xxx mensis iv annoque mmlxiv 64 lxiv 2064} test clock-2.2385 {conversion of 2064-05-01} { clock format 2976870896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2064 12:34:56 die i mensis v annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i May 122 2475042 05 v 5 05/01/2064 die i mensis v annoque mmlxiv 64 lxiv 2064} test clock-2.2386 {conversion of 2064-05-31} { clock format 2979462896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2064 12:34:56 die xxxi mensis v annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 152 2475072 05 v 5 05/31/2064 die xxxi mensis v annoque mmlxiv 64 lxiv 2064} test clock-2.2387 {conversion of 2064-06-01} { clock format 2979549296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2064 12:34:56 die i mensis vi annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 153 2475073 06 vi 6 06/01/2064 die i mensis vi annoque mmlxiv 64 lxiv 2064} test clock-2.2388 {conversion of 2064-06-30} { clock format 2982054896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2064 12:34:56 die xxx mensis vi annoque mmlxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 182 2475102 06 vi 6 06/30/2064 die xxx mensis vi annoque mmlxiv 64 lxiv 2064} test clock-2.2389 {conversion of 2064-07-01} { clock format 2982141296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2064 12:34:56 die i mensis vii annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 183 2475103 07 vii 7 07/01/2064 die i mensis vii annoque mmlxiv 64 lxiv 2064} test clock-2.2390 {conversion of 2064-07-31} { clock format 2984733296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2064 12:34:56 die xxxi mensis vii annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 213 2475133 07 vii 7 07/31/2064 die xxxi mensis vii annoque mmlxiv 64 lxiv 2064} test clock-2.2391 {conversion of 2064-08-01} { clock format 2984819696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2064 12:34:56 die i mensis viii annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 214 2475134 08 viii 8 08/01/2064 die i mensis viii annoque mmlxiv 64 lxiv 2064} test clock-2.2392 {conversion of 2064-08-31} { clock format 2987411696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2064 12:34:56 die xxxi mensis viii annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 244 2475164 08 viii 8 08/31/2064 die xxxi mensis viii annoque mmlxiv 64 lxiv 2064} test clock-2.2393 {conversion of 2064-09-01} { clock format 2987498096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2064 12:34:56 die i mensis ix annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 245 2475165 09 ix 9 09/01/2064 die i mensis ix annoque mmlxiv 64 lxiv 2064} test clock-2.2394 {conversion of 2064-09-30} { clock format 2990003696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2064 12:34:56 die xxx mensis ix annoque mmlxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 274 2475194 09 ix 9 09/30/2064 die xxx mensis ix annoque mmlxiv 64 lxiv 2064} test clock-2.2395 {conversion of 2064-10-01} { clock format 2990090096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2064 12:34:56 die i mensis x annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 275 2475195 10 x 10 10/01/2064 die i mensis x annoque mmlxiv 64 lxiv 2064} test clock-2.2396 {conversion of 2064-10-31} { clock format 2992682096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2064 12:34:56 die xxxi mensis x annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 305 2475225 10 x 10 10/31/2064 die xxxi mensis x annoque mmlxiv 64 lxiv 2064} test clock-2.2397 {conversion of 2064-11-01} { clock format 2992768496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2064 12:34:56 die i mensis xi annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 306 2475226 11 xi 11 11/01/2064 die i mensis xi annoque mmlxiv 64 lxiv 2064} test clock-2.2398 {conversion of 2064-11-30} { clock format 2995274096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2064 12:34:56 die xxx mensis xi annoque mmlxiv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 335 2475255 11 xi 11 11/30/2064 die xxx mensis xi annoque mmlxiv 64 lxiv 2064} test clock-2.2399 {conversion of 2064-12-01} { clock format 2995360496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2064 12:34:56 die i mensis xii annoque mmlxiv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 336 2475256 12 xii 12 12/01/2064 die i mensis xii annoque mmlxiv 64 lxiv 2064} test clock-2.2400 {conversion of 2064-12-31} { clock format 2997952496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2064 12:34:56 die xxxi mensis xii annoque mmlxiv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 366 2475286 12 xii 12 12/31/2064 die xxxi mensis xii annoque mmlxiv 64 lxiv 2064} test clock-2.2401 {conversion of 2065-01-01} { clock format 2998038896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/01/2065 12:34:56 die i mensis i annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jan 001 2475287 01 i 1 01/01/2065 die i mensis i annoque mmlxv 65 lxv 2065} test clock-2.2402 {conversion of 2065-01-31} { clock format 3000630896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jan January 01/31/2065 12:34:56 die xxxi mensis i annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jan 031 2475317 01 i 1 01/31/2065 die xxxi mensis i annoque mmlxv 65 lxv 2065} test clock-2.2403 {conversion of 2065-02-01} { clock format 3000717296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/01/2065 12:34:56 die i mensis ii annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Feb 032 2475318 02 ii 2 02/01/2065 die i mensis ii annoque mmlxv 65 lxv 2065} test clock-2.2404 {conversion of 2065-02-28} { clock format 3003050096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Feb February 02/28/2065 12:34:56 die xxviii mensis ii annoque mmlxv xii h xxxiv m lvi s 20 mm 28 xxviii 28 xxviii Feb 059 2475345 02 ii 2 02/28/2065 die xxviii mensis ii annoque mmlxv 65 lxv 2065} test clock-2.2405 {conversion of 2065-03-01} { clock format 3003136496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/01/2065 12:34:56 die i mensis iii annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Mar 060 2475346 03 iii 3 03/01/2065 die i mensis iii annoque mmlxv 65 lxv 2065} test clock-2.2406 {conversion of 2065-03-31} { clock format 3005728496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Mar March 03/31/2065 12:34:56 die xxxi mensis iii annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Mar 090 2475376 03 iii 3 03/31/2065 die xxxi mensis iii annoque mmlxv 65 lxv 2065} test clock-2.2407 {conversion of 2065-04-01} { clock format 3005814896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/01/2065 12:34:56 die i mensis iv annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Apr 091 2475377 04 iv 4 04/01/2065 die i mensis iv annoque mmlxv 65 lxv 2065} test clock-2.2408 {conversion of 2065-04-30} { clock format 3008320496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Apr April 04/30/2065 12:34:56 die xxx mensis iv annoque mmlxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Apr 120 2475406 04 iv 4 04/30/2065 die xxx mensis iv annoque mmlxv 65 lxv 2065} test clock-2.2409 {conversion of 2065-05-01} { clock format 3008406896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/01/2065 12:34:56 die i mensis v annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i May 121 2475407 05 v 5 05/01/2065 die i mensis v annoque mmlxv 65 lxv 2065} test clock-2.2410 {conversion of 2065-05-31} { clock format 3010998896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {May May 05/31/2065 12:34:56 die xxxi mensis v annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi May 151 2475437 05 v 5 05/31/2065 die xxxi mensis v annoque mmlxv 65 lxv 2065} test clock-2.2411 {conversion of 2065-06-01} { clock format 3011085296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/01/2065 12:34:56 die i mensis vi annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jun 152 2475438 06 vi 6 06/01/2065 die i mensis vi annoque mmlxv 65 lxv 2065} test clock-2.2412 {conversion of 2065-06-30} { clock format 3013590896 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jun June 06/30/2065 12:34:56 die xxx mensis vi annoque mmlxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Jun 181 2475467 06 vi 6 06/30/2065 die xxx mensis vi annoque mmlxv 65 lxv 2065} test clock-2.2413 {conversion of 2065-07-01} { clock format 3013677296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/01/2065 12:34:56 die i mensis vii annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Jul 182 2475468 07 vii 7 07/01/2065 die i mensis vii annoque mmlxv 65 lxv 2065} test clock-2.2414 {conversion of 2065-07-31} { clock format 3016269296 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Jul July 07/31/2065 12:34:56 die xxxi mensis vii annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Jul 212 2475498 07 vii 7 07/31/2065 die xxxi mensis vii annoque mmlxv 65 lxv 2065} test clock-2.2415 {conversion of 2065-08-01} { clock format 3016355696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/01/2065 12:34:56 die i mensis viii annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Aug 213 2475499 08 viii 8 08/01/2065 die i mensis viii annoque mmlxv 65 lxv 2065} test clock-2.2416 {conversion of 2065-08-31} { clock format 3018947696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Aug August 08/31/2065 12:34:56 die xxxi mensis viii annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Aug 243 2475529 08 viii 8 08/31/2065 die xxxi mensis viii annoque mmlxv 65 lxv 2065} test clock-2.2417 {conversion of 2065-09-01} { clock format 3019034096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/01/2065 12:34:56 die i mensis ix annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Sep 244 2475530 09 ix 9 09/01/2065 die i mensis ix annoque mmlxv 65 lxv 2065} test clock-2.2418 {conversion of 2065-09-30} { clock format 3021539696 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Sep September 09/30/2065 12:34:56 die xxx mensis ix annoque mmlxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Sep 273 2475559 09 ix 9 09/30/2065 die xxx mensis ix annoque mmlxv 65 lxv 2065} test clock-2.2419 {conversion of 2065-10-01} { clock format 3021626096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/01/2065 12:34:56 die i mensis x annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Oct 274 2475560 10 x 10 10/01/2065 die i mensis x annoque mmlxv 65 lxv 2065} test clock-2.2420 {conversion of 2065-10-31} { clock format 3024218096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Oct October 10/31/2065 12:34:56 die xxxi mensis x annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Oct 304 2475590 10 x 10 10/31/2065 die xxxi mensis x annoque mmlxv 65 lxv 2065} test clock-2.2421 {conversion of 2065-11-01} { clock format 3024304496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/01/2065 12:34:56 die i mensis xi annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Nov 305 2475591 11 xi 11 11/01/2065 die i mensis xi annoque mmlxv 65 lxv 2065} test clock-2.2422 {conversion of 2065-11-30} { clock format 3026810096 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Nov November 11/30/2065 12:34:56 die xxx mensis xi annoque mmlxv xii h xxxiv m lvi s 20 mm 30 xxx 30 xxx Nov 334 2475620 11 xi 11 11/30/2065 die xxx mensis xi annoque mmlxv 65 lxv 2065} test clock-2.2423 {conversion of 2065-12-01} { clock format 3026896496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/01/2065 12:34:56 die i mensis xii annoque mmlxv xii h xxxiv m lvi s 20 mm 01 i 1 i Dec 335 2475621 12 xii 12 12/01/2065 die i mensis xii annoque mmlxv 65 lxv 2065} test clock-2.2424 {conversion of 2065-12-31} { clock format 3029488496 \ -format {%b %B %c %Ec %C %EC %d %Od %e %Oe %h %j %J %m %Om %N %x %Ex %y %Oy %Y} \ -gmt true -locale en_US_roman } {Dec December 12/31/2065 12:34:56 die xxxi mensis xii annoque mmlxv xii h xxxiv m lvi s 20 mm 31 xxxi 31 xxxi Dec 365 2475651 12 xii 12 12/31/2065 die xxxi mensis xii annoque mmlxv 65 lxv 2065} # END testcases2 # BEGIN testcases3 test clock-3.1 {ISO week-based calendar 1871-W52-1} { clock format -3093206400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1871-W52-1 } {Mon Monday 71 1871 1 52 52 1 52} test clock-3.2 {ISO week-based calendar 1871-W52-6} { clock format -3092774400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1871-W52-6 } {Sat Saturday 71 1871 6 52 52 6 52} test clock-3.3 {ISO week-based calendar 1871-W52-7} { clock format -3092688000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1871-W52-7 } {Sun Sunday 71 1871 7 53 52 0 52} test clock-3.4 {ISO week-based calendar 1872-W01-1} { clock format -3092601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W01-1 } {Mon Monday 72 1872 1 00 01 1 01} test clock-3.5 {ISO week-based calendar 1872-W01-6} { clock format -3092169600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W01-6 } {Sat Saturday 72 1872 6 00 01 6 01} test clock-3.6 {ISO week-based calendar 1872-W01-7} { clock format -3092083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W01-7 } {Sun Sunday 72 1872 7 01 01 0 01} test clock-3.7 {ISO week-based calendar 1872-W02-1} { clock format -3091996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W02-1 } {Mon Monday 72 1872 1 01 02 1 02} test clock-3.8 {ISO week-based calendar 1872-W52-1} { clock format -3061756800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W52-1 } {Mon Monday 72 1872 1 51 52 1 52} test clock-3.9 {ISO week-based calendar 1872-W52-6} { clock format -3061324800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W52-6 } {Sat Saturday 72 1872 6 51 52 6 52} test clock-3.10 {ISO week-based calendar 1872-W52-7} { clock format -3061238400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1872-W52-7 } {Sun Sunday 72 1872 7 52 52 0 52} test clock-3.11 {ISO week-based calendar 1873-W01-1} { clock format -3061152000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1873-W01-1 } {Mon Monday 73 1873 1 52 01 1 53} test clock-3.12 {ISO week-based calendar 1873-W01-3} { clock format -3060979200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1873-W01-3 } {Wed Wednesday 73 1873 3 00 01 3 00} test clock-3.13 {ISO week-based calendar 1873-W01-6} { clock format -3060720000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1873-W01-6 } {Sat Saturday 73 1873 6 00 01 6 00} test clock-3.14 {ISO week-based calendar 1873-W01-7} { clock format -3060633600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1873-W01-7 } {Sun Sunday 73 1873 7 01 01 0 00} test clock-3.15 {ISO week-based calendar 1873-W02-1} { clock format -3060547200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1873-W02-1 } {Mon Monday 73 1873 1 01 02 1 01} test clock-3.16 {ISO week-based calendar 1875-W52-1} { clock format -2966803200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1875-W52-1 } {Mon Monday 75 1875 1 52 52 1 52} test clock-3.17 {ISO week-based calendar 1875-W52-6} { clock format -2966371200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1875-W52-6 } {Sat Saturday 75 1875 6 00 52 6 00} test clock-3.18 {ISO week-based calendar 1875-W52-7} { clock format -2966284800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1875-W52-7 } {Sun Sunday 75 1875 7 01 52 0 00} test clock-3.19 {ISO week-based calendar 1876-W01-1} { clock format -2966198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W01-1 } {Mon Monday 76 1876 1 01 01 1 01} test clock-3.20 {ISO week-based calendar 1876-W01-6} { clock format -2965766400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W01-6 } {Sat Saturday 76 1876 6 01 01 6 01} test clock-3.21 {ISO week-based calendar 1876-W01-7} { clock format -2965680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W01-7 } {Sun Sunday 76 1876 7 02 01 0 01} test clock-3.22 {ISO week-based calendar 1876-W02-1} { clock format -2965593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W02-1 } {Mon Monday 76 1876 1 02 02 1 02} test clock-3.23 {ISO week-based calendar 1876-W52-1} { clock format -2935353600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W52-1 } {Mon Monday 76 1876 1 52 52 1 52} test clock-3.24 {ISO week-based calendar 1876-W52-6} { clock format -2934921600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W52-6 } {Sat Saturday 76 1876 6 52 52 6 52} test clock-3.25 {ISO week-based calendar 1876-W52-7} { clock format -2934835200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1876-W52-7 } {Sun Sunday 76 1876 7 53 52 0 52} test clock-3.26 {ISO week-based calendar 1877-W01-1} { clock format -2934748800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1877-W01-1 } {Mon Monday 77 1877 1 00 01 1 01} test clock-3.27 {ISO week-based calendar 1877-W01-6} { clock format -2934316800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1877-W01-6 } {Sat Saturday 77 1877 6 00 01 6 01} test clock-3.28 {ISO week-based calendar 1877-W01-7} { clock format -2934230400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1877-W01-7 } {Sun Sunday 77 1877 7 01 01 0 01} test clock-3.29 {ISO week-based calendar 1877-W02-1} { clock format -2934144000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1877-W02-1 } {Mon Monday 77 1877 1 01 02 1 02} test clock-3.30 {ISO week-based calendar 1879-W52-1} { clock format -2841004800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1879-W52-1 } {Mon Monday 79 1879 1 51 52 1 51} test clock-3.31 {ISO week-based calendar 1879-W52-6} { clock format -2840572800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1879-W52-6 } {Sat Saturday 79 1879 6 51 52 6 51} test clock-3.32 {ISO week-based calendar 1879-W52-7} { clock format -2840486400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1879-W52-7 } {Sun Sunday 79 1879 7 52 52 0 51} test clock-3.33 {ISO week-based calendar 1880-W01-1} { clock format -2840400000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W01-1 } {Mon Monday 80 1880 1 52 01 1 52} test clock-3.34 {ISO week-based calendar 1880-W01-4} { clock format -2840140800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W01-4 } {Thu Thursday 80 1880 4 00 01 4 00} test clock-3.35 {ISO week-based calendar 1880-W01-6} { clock format -2839968000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W01-6 } {Sat Saturday 80 1880 6 00 01 6 00} test clock-3.36 {ISO week-based calendar 1880-W01-7} { clock format -2839881600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W01-7 } {Sun Sunday 80 1880 7 01 01 0 00} test clock-3.37 {ISO week-based calendar 1880-W02-1} { clock format -2839795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W02-1 } {Mon Monday 80 1880 1 01 02 1 01} test clock-3.38 {ISO week-based calendar 1880-W53-1} { clock format -2808950400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W53-1 } {Mon Monday 80 1880 1 52 53 1 52} test clock-3.39 {ISO week-based calendar 1880-W53-6} { clock format -2808518400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W53-6 } {Sat Saturday 80 1880 6 00 53 6 00} test clock-3.40 {ISO week-based calendar 1880-W53-7} { clock format -2808432000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1880-W53-7 } {Sun Sunday 80 1880 7 01 53 0 00} test clock-3.41 {ISO week-based calendar 1881-W01-1} { clock format -2808345600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1881-W01-1 } {Mon Monday 81 1881 1 01 01 1 01} test clock-3.42 {ISO week-based calendar 1881-W01-6} { clock format -2807913600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1881-W01-6 } {Sat Saturday 81 1881 6 01 01 6 01} test clock-3.43 {ISO week-based calendar 1881-W01-7} { clock format -2807827200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1881-W01-7 } {Sun Sunday 81 1881 7 02 01 0 01} test clock-3.44 {ISO week-based calendar 1881-W02-1} { clock format -2807740800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1881-W02-1 } {Mon Monday 81 1881 1 02 02 1 02} test clock-3.45 {ISO week-based calendar 1883-W52-1} { clock format -2714601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1883-W52-1 } {Mon Monday 83 1883 1 51 52 1 52} test clock-3.46 {ISO week-based calendar 1883-W52-6} { clock format -2714169600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1883-W52-6 } {Sat Saturday 83 1883 6 51 52 6 52} test clock-3.47 {ISO week-based calendar 1883-W52-7} { clock format -2714083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1883-W52-7 } {Sun Sunday 83 1883 7 52 52 0 52} test clock-3.48 {ISO week-based calendar 1884-W01-1} { clock format -2713996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W01-1 } {Mon Monday 84 1884 1 52 01 1 53} test clock-3.49 {ISO week-based calendar 1884-W01-2} { clock format -2713910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W01-2 } {Tue Tuesday 84 1884 2 00 01 2 00} test clock-3.50 {ISO week-based calendar 1884-W01-6} { clock format -2713564800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W01-6 } {Sat Saturday 84 1884 6 00 01 6 00} test clock-3.51 {ISO week-based calendar 1884-W01-7} { clock format -2713478400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W01-7 } {Sun Sunday 84 1884 7 01 01 0 00} test clock-3.52 {ISO week-based calendar 1884-W02-1} { clock format -2713392000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W02-1 } {Mon Monday 84 1884 1 01 02 1 01} test clock-3.53 {ISO week-based calendar 1884-W52-1} { clock format -2683152000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W52-1 } {Mon Monday 84 1884 1 51 52 1 51} test clock-3.54 {ISO week-based calendar 1884-W52-6} { clock format -2682720000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W52-6 } {Sat Saturday 84 1884 6 51 52 6 51} test clock-3.55 {ISO week-based calendar 1884-W52-7} { clock format -2682633600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1884-W52-7 } {Sun Sunday 84 1884 7 52 52 0 51} test clock-3.56 {ISO week-based calendar 1885-W01-1} { clock format -2682547200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1885-W01-1 } {Mon Monday 85 1885 1 52 01 1 52} test clock-3.57 {ISO week-based calendar 1885-W01-4} { clock format -2682288000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1885-W01-4 } {Thu Thursday 85 1885 4 00 01 4 00} test clock-3.58 {ISO week-based calendar 1885-W01-6} { clock format -2682115200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1885-W01-6 } {Sat Saturday 85 1885 6 00 01 6 00} test clock-3.59 {ISO week-based calendar 1885-W01-7} { clock format -2682028800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1885-W01-7 } {Sun Sunday 85 1885 7 01 01 0 00} test clock-3.60 {ISO week-based calendar 1885-W02-1} { clock format -2681942400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1885-W02-1 } {Mon Monday 85 1885 1 01 02 1 01} test clock-3.61 {ISO week-based calendar 1887-W52-1} { clock format -2588198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1887-W52-1 } {Mon Monday 87 1887 1 52 52 1 52} test clock-3.62 {ISO week-based calendar 1887-W52-6} { clock format -2587766400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1887-W52-6 } {Sat Saturday 87 1887 6 52 52 6 52} test clock-3.63 {ISO week-based calendar 1887-W52-7} { clock format -2587680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1887-W52-7 } {Sun Sunday 87 1887 7 01 52 0 00} test clock-3.64 {ISO week-based calendar 1888-W01-1} { clock format -2587593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W01-1 } {Mon Monday 88 1888 1 01 01 1 01} test clock-3.65 {ISO week-based calendar 1888-W01-6} { clock format -2587161600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W01-6 } {Sat Saturday 88 1888 6 01 01 6 01} test clock-3.66 {ISO week-based calendar 1888-W01-7} { clock format -2587075200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W01-7 } {Sun Sunday 88 1888 7 02 01 0 01} test clock-3.67 {ISO week-based calendar 1888-W02-1} { clock format -2586988800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W02-1 } {Mon Monday 88 1888 1 02 02 1 02} test clock-3.68 {ISO week-based calendar 1888-W52-1} { clock format -2556748800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W52-1 } {Mon Monday 88 1888 1 52 52 1 52} test clock-3.69 {ISO week-based calendar 1888-W52-6} { clock format -2556316800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W52-6 } {Sat Saturday 88 1888 6 52 52 6 52} test clock-3.70 {ISO week-based calendar 1888-W52-7} { clock format -2556230400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1888-W52-7 } {Sun Sunday 88 1888 7 53 52 0 52} test clock-3.71 {ISO week-based calendar 1889-W01-1} { clock format -2556144000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W01-1 } {Mon Monday 89 1889 1 53 01 1 53} test clock-3.72 {ISO week-based calendar 1889-W01-2} { clock format -2556057600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W01-2 } {Tue Tuesday 89 1889 2 00 01 2 00} test clock-3.73 {ISO week-based calendar 1889-W01-6} { clock format -2555712000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W01-6 } {Sat Saturday 89 1889 6 00 01 6 00} test clock-3.74 {ISO week-based calendar 1889-W01-7} { clock format -2555625600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W01-7 } {Sun Sunday 89 1889 7 01 01 0 00} test clock-3.75 {ISO week-based calendar 1889-W02-1} { clock format -2555539200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W02-1 } {Mon Monday 89 1889 1 01 02 1 01} test clock-3.76 {ISO week-based calendar 1889-W52-1} { clock format -2525299200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W52-1 } {Mon Monday 89 1889 1 51 52 1 51} test clock-3.77 {ISO week-based calendar 1889-W52-6} { clock format -2524867200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W52-6 } {Sat Saturday 89 1889 6 51 52 6 51} test clock-3.78 {ISO week-based calendar 1889-W52-7} { clock format -2524780800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1889-W52-7 } {Sun Sunday 89 1889 7 52 52 0 51} test clock-3.79 {ISO week-based calendar 1890-W01-1} { clock format -2524694400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W01-1 } {Mon Monday 90 1890 1 52 01 1 52} test clock-3.80 {ISO week-based calendar 1890-W01-3} { clock format -2524521600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W01-3 } {Wed Wednesday 90 1890 3 00 01 3 00} test clock-3.81 {ISO week-based calendar 1890-W01-6} { clock format -2524262400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W01-6 } {Sat Saturday 90 1890 6 00 01 6 00} test clock-3.82 {ISO week-based calendar 1890-W01-7} { clock format -2524176000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W01-7 } {Sun Sunday 90 1890 7 01 01 0 00} test clock-3.83 {ISO week-based calendar 1890-W02-1} { clock format -2524089600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W02-1 } {Mon Monday 90 1890 1 01 02 1 01} test clock-3.84 {ISO week-based calendar 1890-W52-1} { clock format -2493849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W52-1 } {Mon Monday 90 1890 1 51 52 1 51} test clock-3.85 {ISO week-based calendar 1890-W52-6} { clock format -2493417600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W52-6 } {Sat Saturday 90 1890 6 51 52 6 51} test clock-3.86 {ISO week-based calendar 1890-W52-7} { clock format -2493331200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1890-W52-7 } {Sun Sunday 90 1890 7 52 52 0 51} test clock-3.87 {ISO week-based calendar 1891-W01-1} { clock format -2493244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W01-1 } {Mon Monday 91 1891 1 52 01 1 52} test clock-3.88 {ISO week-based calendar 1891-W01-4} { clock format -2492985600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W01-4 } {Thu Thursday 91 1891 4 00 01 4 00} test clock-3.89 {ISO week-based calendar 1891-W01-6} { clock format -2492812800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W01-6 } {Sat Saturday 91 1891 6 00 01 6 00} test clock-3.90 {ISO week-based calendar 1891-W01-7} { clock format -2492726400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W01-7 } {Sun Sunday 91 1891 7 01 01 0 00} test clock-3.91 {ISO week-based calendar 1891-W02-1} { clock format -2492640000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W02-1 } {Mon Monday 91 1891 1 01 02 1 01} test clock-3.92 {ISO week-based calendar 1891-W53-1} { clock format -2461795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W53-1 } {Mon Monday 91 1891 1 52 53 1 52} test clock-3.93 {ISO week-based calendar 1891-W53-5} { clock format -2461449600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W53-5 } {Fri Friday 91 1891 5 00 53 5 00} test clock-3.94 {ISO week-based calendar 1891-W53-6} { clock format -2461363200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W53-6 } {Sat Saturday 91 1891 6 00 53 6 00} test clock-3.95 {ISO week-based calendar 1891-W53-7} { clock format -2461276800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1891-W53-7 } {Sun Sunday 91 1891 7 01 53 0 00} test clock-3.96 {ISO week-based calendar 1892-W01-1} { clock format -2461190400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W01-1 } {Mon Monday 92 1892 1 01 01 1 01} test clock-3.97 {ISO week-based calendar 1892-W01-6} { clock format -2460758400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W01-6 } {Sat Saturday 92 1892 6 01 01 6 01} test clock-3.98 {ISO week-based calendar 1892-W01-7} { clock format -2460672000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W01-7 } {Sun Sunday 92 1892 7 02 01 0 01} test clock-3.99 {ISO week-based calendar 1892-W02-1} { clock format -2460585600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W02-1 } {Mon Monday 92 1892 1 02 02 1 02} test clock-3.100 {ISO week-based calendar 1892-W52-1} { clock format -2430345600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W52-1 } {Mon Monday 92 1892 1 52 52 1 52} test clock-3.101 {ISO week-based calendar 1892-W52-6} { clock format -2429913600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W52-6 } {Sat Saturday 92 1892 6 52 52 6 52} test clock-3.102 {ISO week-based calendar 1892-W52-7} { clock format -2429827200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1892-W52-7 } {Sun Sunday 92 1892 7 01 52 0 00} test clock-3.103 {ISO week-based calendar 1893-W01-1} { clock format -2429740800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W01-1 } {Mon Monday 93 1893 1 01 01 1 01} test clock-3.104 {ISO week-based calendar 1893-W01-6} { clock format -2429308800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W01-6 } {Sat Saturday 93 1893 6 01 01 6 01} test clock-3.105 {ISO week-based calendar 1893-W01-7} { clock format -2429222400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W01-7 } {Sun Sunday 93 1893 7 02 01 0 01} test clock-3.106 {ISO week-based calendar 1893-W02-1} { clock format -2429136000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W02-1 } {Mon Monday 93 1893 1 02 02 1 02} test clock-3.107 {ISO week-based calendar 1893-W52-1} { clock format -2398896000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W52-1 } {Mon Monday 93 1893 1 52 52 1 52} test clock-3.108 {ISO week-based calendar 1893-W52-6} { clock format -2398464000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W52-6 } {Sat Saturday 93 1893 6 52 52 6 52} test clock-3.109 {ISO week-based calendar 1893-W52-7} { clock format -2398377600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1893-W52-7 } {Sun Sunday 93 1893 7 53 52 0 52} test clock-3.110 {ISO week-based calendar 1894-W01-1} { clock format -2398291200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W01-1 } {Mon Monday 94 1894 1 00 01 1 01} test clock-3.111 {ISO week-based calendar 1894-W01-6} { clock format -2397859200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W01-6 } {Sat Saturday 94 1894 6 00 01 6 01} test clock-3.112 {ISO week-based calendar 1894-W01-7} { clock format -2397772800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W01-7 } {Sun Sunday 94 1894 7 01 01 0 01} test clock-3.113 {ISO week-based calendar 1894-W02-1} { clock format -2397686400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W02-1 } {Mon Monday 94 1894 1 01 02 1 02} test clock-3.114 {ISO week-based calendar 1894-W52-1} { clock format -2367446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W52-1 } {Mon Monday 94 1894 1 51 52 1 52} test clock-3.115 {ISO week-based calendar 1894-W52-6} { clock format -2367014400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W52-6 } {Sat Saturday 94 1894 6 51 52 6 52} test clock-3.116 {ISO week-based calendar 1894-W52-7} { clock format -2366928000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1894-W52-7 } {Sun Sunday 94 1894 7 52 52 0 52} test clock-3.117 {ISO week-based calendar 1895-W01-1} { clock format -2366841600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W01-1 } {Mon Monday 95 1895 1 52 01 1 53} test clock-3.118 {ISO week-based calendar 1895-W01-2} { clock format -2366755200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W01-2 } {Tue Tuesday 95 1895 2 00 01 2 00} test clock-3.119 {ISO week-based calendar 1895-W01-6} { clock format -2366409600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W01-6 } {Sat Saturday 95 1895 6 00 01 6 00} test clock-3.120 {ISO week-based calendar 1895-W01-7} { clock format -2366323200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W01-7 } {Sun Sunday 95 1895 7 01 01 0 00} test clock-3.121 {ISO week-based calendar 1895-W02-1} { clock format -2366236800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W02-1 } {Mon Monday 95 1895 1 01 02 1 01} test clock-3.122 {ISO week-based calendar 1895-W52-1} { clock format -2335996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W52-1 } {Mon Monday 95 1895 1 51 52 1 51} test clock-3.123 {ISO week-based calendar 1895-W52-6} { clock format -2335564800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W52-6 } {Sat Saturday 95 1895 6 51 52 6 51} test clock-3.124 {ISO week-based calendar 1895-W52-7} { clock format -2335478400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1895-W52-7 } {Sun Sunday 95 1895 7 52 52 0 51} test clock-3.125 {ISO week-based calendar 1896-W01-1} { clock format -2335392000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W01-1 } {Mon Monday 96 1896 1 52 01 1 52} test clock-3.126 {ISO week-based calendar 1896-W01-3} { clock format -2335219200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W01-3 } {Wed Wednesday 96 1896 3 00 01 3 00} test clock-3.127 {ISO week-based calendar 1896-W01-6} { clock format -2334960000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W01-6 } {Sat Saturday 96 1896 6 00 01 6 00} test clock-3.128 {ISO week-based calendar 1896-W01-7} { clock format -2334873600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W01-7 } {Sun Sunday 96 1896 7 01 01 0 00} test clock-3.129 {ISO week-based calendar 1896-W02-1} { clock format -2334787200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W02-1 } {Mon Monday 96 1896 1 01 02 1 01} test clock-3.130 {ISO week-based calendar 1896-W53-1} { clock format -2303942400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W53-1 } {Mon Monday 96 1896 1 52 53 1 52} test clock-3.131 {ISO week-based calendar 1896-W53-5} { clock format -2303596800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W53-5 } {Fri Friday 96 1896 5 00 53 5 00} test clock-3.132 {ISO week-based calendar 1896-W53-6} { clock format -2303510400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W53-6 } {Sat Saturday 96 1896 6 00 53 6 00} test clock-3.133 {ISO week-based calendar 1896-W53-7} { clock format -2303424000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1896-W53-7 } {Sun Sunday 96 1896 7 01 53 0 00} test clock-3.134 {ISO week-based calendar 1897-W01-1} { clock format -2303337600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W01-1 } {Mon Monday 97 1897 1 01 01 1 01} test clock-3.135 {ISO week-based calendar 1897-W01-6} { clock format -2302905600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W01-6 } {Sat Saturday 97 1897 6 01 01 6 01} test clock-3.136 {ISO week-based calendar 1897-W01-7} { clock format -2302819200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W01-7 } {Sun Sunday 97 1897 7 02 01 0 01} test clock-3.137 {ISO week-based calendar 1897-W02-1} { clock format -2302732800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W02-1 } {Mon Monday 97 1897 1 02 02 1 02} test clock-3.138 {ISO week-based calendar 1897-W52-1} { clock format -2272492800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W52-1 } {Mon Monday 97 1897 1 52 52 1 52} test clock-3.139 {ISO week-based calendar 1897-W52-6} { clock format -2272060800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W52-6 } {Sat Saturday 97 1897 6 00 52 6 00} test clock-3.140 {ISO week-based calendar 1897-W52-7} { clock format -2271974400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1897-W52-7 } {Sun Sunday 97 1897 7 01 52 0 00} test clock-3.141 {ISO week-based calendar 1898-W01-1} { clock format -2271888000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W01-1 } {Mon Monday 98 1898 1 01 01 1 01} test clock-3.142 {ISO week-based calendar 1898-W01-6} { clock format -2271456000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W01-6 } {Sat Saturday 98 1898 6 01 01 6 01} test clock-3.143 {ISO week-based calendar 1898-W01-7} { clock format -2271369600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W01-7 } {Sun Sunday 98 1898 7 02 01 0 01} test clock-3.144 {ISO week-based calendar 1898-W02-1} { clock format -2271283200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W02-1 } {Mon Monday 98 1898 1 02 02 1 02} test clock-3.145 {ISO week-based calendar 1898-W52-1} { clock format -2241043200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W52-1 } {Mon Monday 98 1898 1 52 52 1 52} test clock-3.146 {ISO week-based calendar 1898-W52-6} { clock format -2240611200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W52-6 } {Sat Saturday 98 1898 6 52 52 6 52} test clock-3.147 {ISO week-based calendar 1898-W52-7} { clock format -2240524800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1898-W52-7 } {Sun Sunday 98 1898 7 01 52 0 00} test clock-3.148 {ISO week-based calendar 1899-W01-1} { clock format -2240438400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W01-1 } {Mon Monday 99 1899 1 01 01 1 01} test clock-3.149 {ISO week-based calendar 1899-W01-6} { clock format -2240006400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W01-6 } {Sat Saturday 99 1899 6 01 01 6 01} test clock-3.150 {ISO week-based calendar 1899-W01-7} { clock format -2239920000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W01-7 } {Sun Sunday 99 1899 7 02 01 0 01} test clock-3.151 {ISO week-based calendar 1899-W02-1} { clock format -2239833600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W02-1 } {Mon Monday 99 1899 1 02 02 1 02} test clock-3.152 {ISO week-based calendar 1899-W52-1} { clock format -2209593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W52-1 } {Mon Monday 99 1899 1 52 52 1 52} test clock-3.153 {ISO week-based calendar 1899-W52-6} { clock format -2209161600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W52-6 } {Sat Saturday 99 1899 6 52 52 6 52} test clock-3.154 {ISO week-based calendar 1899-W52-7} { clock format -2209075200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1899-W52-7 } {Sun Sunday 99 1899 7 53 52 0 52} test clock-3.155 {ISO week-based calendar 1900-W01-1} { clock format -2208988800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1900-W01-1 } {Mon Monday 00 1900 1 00 01 1 01} test clock-3.156 {ISO week-based calendar 1900-W01-6} { clock format -2208556800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1900-W01-6 } {Sat Saturday 00 1900 6 00 01 6 01} test clock-3.157 {ISO week-based calendar 1900-W01-7} { clock format -2208470400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1900-W01-7 } {Sun Sunday 00 1900 7 01 01 0 01} test clock-3.158 {ISO week-based calendar 1900-W02-1} { clock format -2208384000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1900-W02-1 } {Mon Monday 00 1900 1 01 02 1 02} test clock-3.159 {ISO week-based calendar 1943-W52-1} { clock format -820972800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1943-W52-1 } {Mon Monday 43 1943 1 52 52 1 52} test clock-3.160 {ISO week-based calendar 1943-W52-6} { clock format -820540800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1943-W52-6 } {Sat Saturday 43 1943 6 00 52 6 00} test clock-3.161 {ISO week-based calendar 1943-W52-7} { clock format -820454400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1943-W52-7 } {Sun Sunday 43 1943 7 01 52 0 00} test clock-3.162 {ISO week-based calendar 1944-W01-1} { clock format -820368000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W01-1 } {Mon Monday 44 1944 1 01 01 1 01} test clock-3.163 {ISO week-based calendar 1944-W01-6} { clock format -819936000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W01-6 } {Sat Saturday 44 1944 6 01 01 6 01} test clock-3.164 {ISO week-based calendar 1944-W01-7} { clock format -819849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W01-7 } {Sun Sunday 44 1944 7 02 01 0 01} test clock-3.165 {ISO week-based calendar 1944-W02-1} { clock format -819763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W02-1 } {Mon Monday 44 1944 1 02 02 1 02} test clock-3.166 {ISO week-based calendar 1944-W52-1} { clock format -789523200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W52-1 } {Mon Monday 44 1944 1 52 52 1 52} test clock-3.167 {ISO week-based calendar 1944-W52-6} { clock format -789091200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W52-6 } {Sat Saturday 44 1944 6 52 52 6 52} test clock-3.168 {ISO week-based calendar 1944-W52-7} { clock format -789004800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1944-W52-7 } {Sun Sunday 44 1944 7 53 52 0 52} test clock-3.169 {ISO week-based calendar 1945-W01-1} { clock format -788918400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1945-W01-1 } {Mon Monday 45 1945 1 00 01 1 01} test clock-3.170 {ISO week-based calendar 1945-W01-6} { clock format -788486400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1945-W01-6 } {Sat Saturday 45 1945 6 00 01 6 01} test clock-3.171 {ISO week-based calendar 1945-W01-7} { clock format -788400000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1945-W01-7 } {Sun Sunday 45 1945 7 01 01 0 01} test clock-3.172 {ISO week-based calendar 1945-W02-1} { clock format -788313600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1945-W02-1 } {Mon Monday 45 1945 1 01 02 1 02} test clock-3.173 {ISO week-based calendar 1947-W52-1} { clock format -695174400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1947-W52-1 } {Mon Monday 47 1947 1 51 52 1 51} test clock-3.174 {ISO week-based calendar 1947-W52-6} { clock format -694742400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1947-W52-6 } {Sat Saturday 47 1947 6 51 52 6 51} test clock-3.175 {ISO week-based calendar 1947-W52-7} { clock format -694656000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1947-W52-7 } {Sun Sunday 47 1947 7 52 52 0 51} test clock-3.176 {ISO week-based calendar 1948-W01-1} { clock format -694569600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W01-1 } {Mon Monday 48 1948 1 52 01 1 52} test clock-3.177 {ISO week-based calendar 1948-W01-4} { clock format -694310400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W01-4 } {Thu Thursday 48 1948 4 00 01 4 00} test clock-3.178 {ISO week-based calendar 1948-W01-6} { clock format -694137600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W01-6 } {Sat Saturday 48 1948 6 00 01 6 00} test clock-3.179 {ISO week-based calendar 1948-W01-7} { clock format -694051200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W01-7 } {Sun Sunday 48 1948 7 01 01 0 00} test clock-3.180 {ISO week-based calendar 1948-W02-1} { clock format -693964800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W02-1 } {Mon Monday 48 1948 1 01 02 1 01} test clock-3.181 {ISO week-based calendar 1948-W53-1} { clock format -663120000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W53-1 } {Mon Monday 48 1948 1 52 53 1 52} test clock-3.182 {ISO week-based calendar 1948-W53-6} { clock format -662688000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W53-6 } {Sat Saturday 48 1948 6 00 53 6 00} test clock-3.183 {ISO week-based calendar 1948-W53-7} { clock format -662601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1948-W53-7 } {Sun Sunday 48 1948 7 01 53 0 00} test clock-3.184 {ISO week-based calendar 1949-W01-1} { clock format -662515200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1949-W01-1 } {Mon Monday 49 1949 1 01 01 1 01} test clock-3.185 {ISO week-based calendar 1949-W01-6} { clock format -662083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1949-W01-6 } {Sat Saturday 49 1949 6 01 01 6 01} test clock-3.186 {ISO week-based calendar 1949-W01-7} { clock format -661996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1949-W01-7 } {Sun Sunday 49 1949 7 02 01 0 01} test clock-3.187 {ISO week-based calendar 1949-W02-1} { clock format -661910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1949-W02-1 } {Mon Monday 49 1949 1 02 02 1 02} test clock-3.188 {ISO week-based calendar 1951-W52-1} { clock format -568771200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1951-W52-1 } {Mon Monday 51 1951 1 51 52 1 52} test clock-3.189 {ISO week-based calendar 1951-W52-6} { clock format -568339200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1951-W52-6 } {Sat Saturday 51 1951 6 51 52 6 52} test clock-3.190 {ISO week-based calendar 1951-W52-7} { clock format -568252800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1951-W52-7 } {Sun Sunday 51 1951 7 52 52 0 52} test clock-3.191 {ISO week-based calendar 1952-W01-1} { clock format -568166400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W01-1 } {Mon Monday 52 1952 1 52 01 1 53} test clock-3.192 {ISO week-based calendar 1952-W01-2} { clock format -568080000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W01-2 } {Tue Tuesday 52 1952 2 00 01 2 00} test clock-3.193 {ISO week-based calendar 1952-W01-6} { clock format -567734400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W01-6 } {Sat Saturday 52 1952 6 00 01 6 00} test clock-3.194 {ISO week-based calendar 1952-W01-7} { clock format -567648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W01-7 } {Sun Sunday 52 1952 7 01 01 0 00} test clock-3.195 {ISO week-based calendar 1952-W02-1} { clock format -567561600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W02-1 } {Mon Monday 52 1952 1 01 02 1 01} test clock-3.196 {ISO week-based calendar 1952-W52-1} { clock format -537321600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W52-1 } {Mon Monday 52 1952 1 51 52 1 51} test clock-3.197 {ISO week-based calendar 1952-W52-6} { clock format -536889600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W52-6 } {Sat Saturday 52 1952 6 51 52 6 51} test clock-3.198 {ISO week-based calendar 1952-W52-7} { clock format -536803200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1952-W52-7 } {Sun Sunday 52 1952 7 52 52 0 51} test clock-3.199 {ISO week-based calendar 1953-W01-1} { clock format -536716800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1953-W01-1 } {Mon Monday 53 1953 1 52 01 1 52} test clock-3.200 {ISO week-based calendar 1953-W01-4} { clock format -536457600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1953-W01-4 } {Thu Thursday 53 1953 4 00 01 4 00} test clock-3.201 {ISO week-based calendar 1953-W01-6} { clock format -536284800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1953-W01-6 } {Sat Saturday 53 1953 6 00 01 6 00} test clock-3.202 {ISO week-based calendar 1953-W01-7} { clock format -536198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1953-W01-7 } {Sun Sunday 53 1953 7 01 01 0 00} test clock-3.203 {ISO week-based calendar 1953-W02-1} { clock format -536112000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1953-W02-1 } {Mon Monday 53 1953 1 01 02 1 01} test clock-3.204 {ISO week-based calendar 1955-W52-1} { clock format -442368000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1955-W52-1 } {Mon Monday 55 1955 1 52 52 1 52} test clock-3.205 {ISO week-based calendar 1955-W52-6} { clock format -441936000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1955-W52-6 } {Sat Saturday 55 1955 6 52 52 6 52} test clock-3.206 {ISO week-based calendar 1955-W52-7} { clock format -441849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1955-W52-7 } {Sun Sunday 55 1955 7 01 52 0 00} test clock-3.207 {ISO week-based calendar 1956-W01-1} { clock format -441763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W01-1 } {Mon Monday 56 1956 1 01 01 1 01} test clock-3.208 {ISO week-based calendar 1956-W01-6} { clock format -441331200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W01-6 } {Sat Saturday 56 1956 6 01 01 6 01} test clock-3.209 {ISO week-based calendar 1956-W01-7} { clock format -441244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W01-7 } {Sun Sunday 56 1956 7 02 01 0 01} test clock-3.210 {ISO week-based calendar 1956-W02-1} { clock format -441158400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W02-1 } {Mon Monday 56 1956 1 02 02 1 02} test clock-3.211 {ISO week-based calendar 1956-W52-1} { clock format -410918400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W52-1 } {Mon Monday 56 1956 1 52 52 1 52} test clock-3.212 {ISO week-based calendar 1956-W52-6} { clock format -410486400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W52-6 } {Sat Saturday 56 1956 6 52 52 6 52} test clock-3.213 {ISO week-based calendar 1956-W52-7} { clock format -410400000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1956-W52-7 } {Sun Sunday 56 1956 7 53 52 0 52} test clock-3.214 {ISO week-based calendar 1957-W01-1} { clock format -410313600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1957-W01-1 } {Mon Monday 57 1957 1 53 01 1 53} test clock-3.215 {ISO week-based calendar 1957-W01-2} { clock format -410227200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1957-W01-2 } {Tue Tuesday 57 1957 2 00 01 2 00} test clock-3.216 {ISO week-based calendar 1957-W01-6} { clock format -409881600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1957-W01-6 } {Sat Saturday 57 1957 6 00 01 6 00} test clock-3.217 {ISO week-based calendar 1957-W01-7} { clock format -409795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1957-W01-7 } {Sun Sunday 57 1957 7 01 01 0 00} test clock-3.218 {ISO week-based calendar 1957-W02-1} { clock format -409708800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1957-W02-1 } {Mon Monday 57 1957 1 01 02 1 01} test clock-3.219 {ISO week-based calendar 1958-W52-1} { clock format -348019200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1958-W52-1 } {Mon Monday 58 1958 1 51 52 1 51} test clock-3.220 {ISO week-based calendar 1958-W52-6} { clock format -347587200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1958-W52-6 } {Sat Saturday 58 1958 6 51 52 6 51} test clock-3.221 {ISO week-based calendar 1958-W52-7} { clock format -347500800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1958-W52-7 } {Sun Sunday 58 1958 7 52 52 0 51} test clock-3.222 {ISO week-based calendar 1959-W01-1} { clock format -347414400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W01-1 } {Mon Monday 59 1959 1 52 01 1 52} test clock-3.223 {ISO week-based calendar 1959-W01-4} { clock format -347155200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W01-4 } {Thu Thursday 59 1959 4 00 01 4 00} test clock-3.224 {ISO week-based calendar 1959-W01-6} { clock format -346982400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W01-6 } {Sat Saturday 59 1959 6 00 01 6 00} test clock-3.225 {ISO week-based calendar 1959-W01-7} { clock format -346896000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W01-7 } {Sun Sunday 59 1959 7 01 01 0 00} test clock-3.226 {ISO week-based calendar 1959-W02-1} { clock format -346809600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W02-1 } {Mon Monday 59 1959 1 01 02 1 01} test clock-3.227 {ISO week-based calendar 1959-W53-1} { clock format -315964800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W53-1 } {Mon Monday 59 1959 1 52 53 1 52} test clock-3.228 {ISO week-based calendar 1959-W53-5} { clock format -315619200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W53-5 } {Fri Friday 59 1959 5 00 53 5 00} test clock-3.229 {ISO week-based calendar 1959-W53-6} { clock format -315532800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W53-6 } {Sat Saturday 59 1959 6 00 53 6 00} test clock-3.230 {ISO week-based calendar 1959-W53-7} { clock format -315446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1959-W53-7 } {Sun Sunday 59 1959 7 01 53 0 00} test clock-3.231 {ISO week-based calendar 1960-W01-1} { clock format -315360000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W01-1 } {Mon Monday 60 1960 1 01 01 1 01} test clock-3.232 {ISO week-based calendar 1960-W01-6} { clock format -314928000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W01-6 } {Sat Saturday 60 1960 6 01 01 6 01} test clock-3.233 {ISO week-based calendar 1960-W01-7} { clock format -314841600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W01-7 } {Sun Sunday 60 1960 7 02 01 0 01} test clock-3.234 {ISO week-based calendar 1960-W02-1} { clock format -314755200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W02-1 } {Mon Monday 60 1960 1 02 02 1 02} test clock-3.235 {ISO week-based calendar 1960-W52-1} { clock format -284515200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W52-1 } {Mon Monday 60 1960 1 52 52 1 52} test clock-3.236 {ISO week-based calendar 1960-W52-6} { clock format -284083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W52-6 } {Sat Saturday 60 1960 6 52 52 6 52} test clock-3.237 {ISO week-based calendar 1960-W52-7} { clock format -283996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1960-W52-7 } {Sun Sunday 60 1960 7 01 52 0 00} test clock-3.238 {ISO week-based calendar 1961-W01-1} { clock format -283910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W01-1 } {Mon Monday 61 1961 1 01 01 1 01} test clock-3.239 {ISO week-based calendar 1961-W01-6} { clock format -283478400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W01-6 } {Sat Saturday 61 1961 6 01 01 6 01} test clock-3.240 {ISO week-based calendar 1961-W01-7} { clock format -283392000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W01-7 } {Sun Sunday 61 1961 7 02 01 0 01} test clock-3.241 {ISO week-based calendar 1961-W02-1} { clock format -283305600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W02-1 } {Mon Monday 61 1961 1 02 02 1 02} test clock-3.242 {ISO week-based calendar 1961-W52-1} { clock format -253065600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W52-1 } {Mon Monday 61 1961 1 52 52 1 52} test clock-3.243 {ISO week-based calendar 1961-W52-6} { clock format -252633600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W52-6 } {Sat Saturday 61 1961 6 52 52 6 52} test clock-3.244 {ISO week-based calendar 1961-W52-7} { clock format -252547200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1961-W52-7 } {Sun Sunday 61 1961 7 53 52 0 52} test clock-3.245 {ISO week-based calendar 1962-W01-1} { clock format -252460800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W01-1 } {Mon Monday 62 1962 1 00 01 1 01} test clock-3.246 {ISO week-based calendar 1962-W01-6} { clock format -252028800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W01-6 } {Sat Saturday 62 1962 6 00 01 6 01} test clock-3.247 {ISO week-based calendar 1962-W01-7} { clock format -251942400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W01-7 } {Sun Sunday 62 1962 7 01 01 0 01} test clock-3.248 {ISO week-based calendar 1962-W02-1} { clock format -251856000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W02-1 } {Mon Monday 62 1962 1 01 02 1 02} test clock-3.249 {ISO week-based calendar 1962-W52-1} { clock format -221616000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W52-1 } {Mon Monday 62 1962 1 51 52 1 52} test clock-3.250 {ISO week-based calendar 1962-W52-6} { clock format -221184000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W52-6 } {Sat Saturday 62 1962 6 51 52 6 52} test clock-3.251 {ISO week-based calendar 1962-W52-7} { clock format -221097600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1962-W52-7 } {Sun Sunday 62 1962 7 52 52 0 52} test clock-3.252 {ISO week-based calendar 1963-W01-1} { clock format -221011200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W01-1 } {Mon Monday 63 1963 1 52 01 1 53} test clock-3.253 {ISO week-based calendar 1963-W01-2} { clock format -220924800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W01-2 } {Tue Tuesday 63 1963 2 00 01 2 00} test clock-3.254 {ISO week-based calendar 1963-W01-6} { clock format -220579200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W01-6 } {Sat Saturday 63 1963 6 00 01 6 00} test clock-3.255 {ISO week-based calendar 1963-W01-7} { clock format -220492800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W01-7 } {Sun Sunday 63 1963 7 01 01 0 00} test clock-3.256 {ISO week-based calendar 1963-W02-1} { clock format -220406400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W02-1 } {Mon Monday 63 1963 1 01 02 1 01} test clock-3.257 {ISO week-based calendar 1963-W52-1} { clock format -190166400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W52-1 } {Mon Monday 63 1963 1 51 52 1 51} test clock-3.258 {ISO week-based calendar 1963-W52-6} { clock format -189734400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W52-6 } {Sat Saturday 63 1963 6 51 52 6 51} test clock-3.259 {ISO week-based calendar 1963-W52-7} { clock format -189648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1963-W52-7 } {Sun Sunday 63 1963 7 52 52 0 51} test clock-3.260 {ISO week-based calendar 1964-W01-1} { clock format -189561600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W01-1 } {Mon Monday 64 1964 1 52 01 1 52} test clock-3.261 {ISO week-based calendar 1964-W01-3} { clock format -189388800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W01-3 } {Wed Wednesday 64 1964 3 00 01 3 00} test clock-3.262 {ISO week-based calendar 1964-W01-6} { clock format -189129600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W01-6 } {Sat Saturday 64 1964 6 00 01 6 00} test clock-3.263 {ISO week-based calendar 1964-W01-7} { clock format -189043200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W01-7 } {Sun Sunday 64 1964 7 01 01 0 00} test clock-3.264 {ISO week-based calendar 1964-W02-1} { clock format -188956800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W02-1 } {Mon Monday 64 1964 1 01 02 1 01} test clock-3.265 {ISO week-based calendar 1964-W53-1} { clock format -158112000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W53-1 } {Mon Monday 64 1964 1 52 53 1 52} test clock-3.266 {ISO week-based calendar 1964-W53-5} { clock format -157766400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W53-5 } {Fri Friday 64 1964 5 00 53 5 00} test clock-3.267 {ISO week-based calendar 1964-W53-6} { clock format -157680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W53-6 } {Sat Saturday 64 1964 6 00 53 6 00} test clock-3.268 {ISO week-based calendar 1964-W53-7} { clock format -157593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1964-W53-7 } {Sun Sunday 64 1964 7 01 53 0 00} test clock-3.269 {ISO week-based calendar 1965-W01-1} { clock format -157507200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W01-1 } {Mon Monday 65 1965 1 01 01 1 01} test clock-3.270 {ISO week-based calendar 1965-W01-6} { clock format -157075200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W01-6 } {Sat Saturday 65 1965 6 01 01 6 01} test clock-3.271 {ISO week-based calendar 1965-W01-7} { clock format -156988800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W01-7 } {Sun Sunday 65 1965 7 02 01 0 01} test clock-3.272 {ISO week-based calendar 1965-W02-1} { clock format -156902400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W02-1 } {Mon Monday 65 1965 1 02 02 1 02} test clock-3.273 {ISO week-based calendar 1965-W52-1} { clock format -126662400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W52-1 } {Mon Monday 65 1965 1 52 52 1 52} test clock-3.274 {ISO week-based calendar 1965-W52-6} { clock format -126230400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W52-6 } {Sat Saturday 65 1965 6 00 52 6 00} test clock-3.275 {ISO week-based calendar 1965-W52-7} { clock format -126144000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1965-W52-7 } {Sun Sunday 65 1965 7 01 52 0 00} test clock-3.276 {ISO week-based calendar 1966-W01-1} { clock format -126057600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W01-1 } {Mon Monday 66 1966 1 01 01 1 01} test clock-3.277 {ISO week-based calendar 1966-W01-6} { clock format -125625600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W01-6 } {Sat Saturday 66 1966 6 01 01 6 01} test clock-3.278 {ISO week-based calendar 1966-W01-7} { clock format -125539200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W01-7 } {Sun Sunday 66 1966 7 02 01 0 01} test clock-3.279 {ISO week-based calendar 1966-W02-1} { clock format -125452800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W02-1 } {Mon Monday 66 1966 1 02 02 1 02} test clock-3.280 {ISO week-based calendar 1966-W52-1} { clock format -95212800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W52-1 } {Mon Monday 66 1966 1 52 52 1 52} test clock-3.281 {ISO week-based calendar 1966-W52-6} { clock format -94780800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W52-6 } {Sat Saturday 66 1966 6 52 52 6 52} test clock-3.282 {ISO week-based calendar 1966-W52-7} { clock format -94694400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1966-W52-7 } {Sun Sunday 66 1966 7 01 52 0 00} test clock-3.283 {ISO week-based calendar 1967-W01-1} { clock format -94608000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W01-1 } {Mon Monday 67 1967 1 01 01 1 01} test clock-3.284 {ISO week-based calendar 1967-W01-6} { clock format -94176000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W01-6 } {Sat Saturday 67 1967 6 01 01 6 01} test clock-3.285 {ISO week-based calendar 1967-W01-7} { clock format -94089600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W01-7 } {Sun Sunday 67 1967 7 02 01 0 01} test clock-3.286 {ISO week-based calendar 1967-W02-1} { clock format -94003200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W02-1 } {Mon Monday 67 1967 1 02 02 1 02} test clock-3.287 {ISO week-based calendar 1967-W52-1} { clock format -63763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W52-1 } {Mon Monday 67 1967 1 52 52 1 52} test clock-3.288 {ISO week-based calendar 1967-W52-6} { clock format -63331200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W52-6 } {Sat Saturday 67 1967 6 52 52 6 52} test clock-3.289 {ISO week-based calendar 1967-W52-7} { clock format -63244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1967-W52-7 } {Sun Sunday 67 1967 7 53 52 0 52} test clock-3.290 {ISO week-based calendar 1968-W01-1} { clock format -63158400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W01-1 } {Mon Monday 68 1968 1 00 01 1 01} test clock-3.291 {ISO week-based calendar 1968-W01-6} { clock format -62726400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W01-6 } {Sat Saturday 68 1968 6 00 01 6 01} test clock-3.292 {ISO week-based calendar 1968-W01-7} { clock format -62640000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W01-7 } {Sun Sunday 68 1968 7 01 01 0 01} test clock-3.293 {ISO week-based calendar 1968-W02-1} { clock format -62553600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W02-1 } {Mon Monday 68 1968 1 01 02 1 02} test clock-3.294 {ISO week-based calendar 1968-W52-1} { clock format -32313600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W52-1 } {Mon Monday 68 1968 1 51 52 1 52} test clock-3.295 {ISO week-based calendar 1968-W52-6} { clock format -31881600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W52-6 } {Sat Saturday 68 1968 6 51 52 6 52} test clock-3.296 {ISO week-based calendar 1968-W52-7} { clock format -31795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1968-W52-7 } {Sun Sunday 68 1968 7 52 52 0 52} test clock-3.297 {ISO week-based calendar 1969-W01-1} { clock format -31708800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W01-1 } {Mon Monday 69 1969 1 52 01 1 53} test clock-3.298 {ISO week-based calendar 1969-W01-3} { clock format -31536000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W01-3 } {Wed Wednesday 69 1969 3 00 01 3 00} test clock-3.299 {ISO week-based calendar 1969-W01-6} { clock format -31276800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W01-6 } {Sat Saturday 69 1969 6 00 01 6 00} test clock-3.300 {ISO week-based calendar 1969-W01-7} { clock format -31190400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W01-7 } {Sun Sunday 69 1969 7 01 01 0 00} test clock-3.301 {ISO week-based calendar 1969-W02-1} { clock format -31104000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W02-1 } {Mon Monday 69 1969 1 01 02 1 01} test clock-3.302 {ISO week-based calendar 1969-W52-1} { clock format -864000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W52-1 } {Mon Monday 69 1969 1 51 52 1 51} test clock-3.303 {ISO week-based calendar 1969-W52-6} { clock format -432000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W52-6 } {Sat Saturday 69 1969 6 51 52 6 51} test clock-3.304 {ISO week-based calendar 1969-W52-7} { clock format -345600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1969-W52-7 } {Sun Sunday 69 1969 7 52 52 0 51} test clock-3.305 {ISO week-based calendar 1970-W01-1} { clock format -259200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W01-1 } {Mon Monday 70 1970 1 52 01 1 52} test clock-3.306 {ISO week-based calendar 1970-W01-4} { clock format 0 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W01-4 } {Thu Thursday 70 1970 4 00 01 4 00} test clock-3.307 {ISO week-based calendar 1970-W01-6} { clock format 172800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W01-6 } {Sat Saturday 70 1970 6 00 01 6 00} test clock-3.308 {ISO week-based calendar 1970-W01-7} { clock format 259200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W01-7 } {Sun Sunday 70 1970 7 01 01 0 00} test clock-3.309 {ISO week-based calendar 1970-W02-1} { clock format 345600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W02-1 } {Mon Monday 70 1970 1 01 02 1 01} test clock-3.310 {ISO week-based calendar 1970-W53-1} { clock format 31190400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W53-1 } {Mon Monday 70 1970 1 52 53 1 52} test clock-3.311 {ISO week-based calendar 1970-W53-5} { clock format 31536000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W53-5 } {Fri Friday 70 1970 5 00 53 5 00} test clock-3.312 {ISO week-based calendar 1970-W53-6} { clock format 31622400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W53-6 } {Sat Saturday 70 1970 6 00 53 6 00} test clock-3.313 {ISO week-based calendar 1970-W53-7} { clock format 31708800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1970-W53-7 } {Sun Sunday 70 1970 7 01 53 0 00} test clock-3.314 {ISO week-based calendar 1971-W01-1} { clock format 31795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W01-1 } {Mon Monday 71 1971 1 01 01 1 01} test clock-3.315 {ISO week-based calendar 1971-W01-6} { clock format 32227200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W01-6 } {Sat Saturday 71 1971 6 01 01 6 01} test clock-3.316 {ISO week-based calendar 1971-W01-7} { clock format 32313600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W01-7 } {Sun Sunday 71 1971 7 02 01 0 01} test clock-3.317 {ISO week-based calendar 1971-W02-1} { clock format 32400000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W02-1 } {Mon Monday 71 1971 1 02 02 1 02} test clock-3.318 {ISO week-based calendar 1971-W52-1} { clock format 62640000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W52-1 } {Mon Monday 71 1971 1 52 52 1 52} test clock-3.319 {ISO week-based calendar 1971-W52-6} { clock format 63072000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W52-6 } {Sat Saturday 71 1971 6 00 52 6 00} test clock-3.320 {ISO week-based calendar 1971-W52-7} { clock format 63158400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1971-W52-7 } {Sun Sunday 71 1971 7 01 52 0 00} test clock-3.321 {ISO week-based calendar 1972-W01-1} { clock format 63244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W01-1 } {Mon Monday 72 1972 1 01 01 1 01} test clock-3.322 {ISO week-based calendar 1972-W01-6} { clock format 63676800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W01-6 } {Sat Saturday 72 1972 6 01 01 6 01} test clock-3.323 {ISO week-based calendar 1972-W01-7} { clock format 63763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W01-7 } {Sun Sunday 72 1972 7 02 01 0 01} test clock-3.324 {ISO week-based calendar 1972-W02-1} { clock format 63849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W02-1 } {Mon Monday 72 1972 1 02 02 1 02} test clock-3.325 {ISO week-based calendar 1972-W52-1} { clock format 94089600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W52-1 } {Mon Monday 72 1972 1 52 52 1 52} test clock-3.326 {ISO week-based calendar 1972-W52-6} { clock format 94521600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W52-6 } {Sat Saturday 72 1972 6 52 52 6 52} test clock-3.327 {ISO week-based calendar 1972-W52-7} { clock format 94608000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1972-W52-7 } {Sun Sunday 72 1972 7 53 52 0 52} test clock-3.328 {ISO week-based calendar 1973-W01-1} { clock format 94694400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W01-1 } {Mon Monday 73 1973 1 00 01 1 01} test clock-3.329 {ISO week-based calendar 1973-W01-6} { clock format 95126400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W01-6 } {Sat Saturday 73 1973 6 00 01 6 01} test clock-3.330 {ISO week-based calendar 1973-W01-7} { clock format 95212800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W01-7 } {Sun Sunday 73 1973 7 01 01 0 01} test clock-3.331 {ISO week-based calendar 1973-W02-1} { clock format 95299200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W02-1 } {Mon Monday 73 1973 1 01 02 1 02} test clock-3.332 {ISO week-based calendar 1973-W52-1} { clock format 125539200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W52-1 } {Mon Monday 73 1973 1 51 52 1 52} test clock-3.333 {ISO week-based calendar 1973-W52-6} { clock format 125971200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W52-6 } {Sat Saturday 73 1973 6 51 52 6 52} test clock-3.334 {ISO week-based calendar 1973-W52-7} { clock format 126057600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1973-W52-7 } {Sun Sunday 73 1973 7 52 52 0 52} test clock-3.335 {ISO week-based calendar 1974-W01-1} { clock format 126144000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W01-1 } {Mon Monday 74 1974 1 52 01 1 53} test clock-3.336 {ISO week-based calendar 1974-W01-2} { clock format 126230400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W01-2 } {Tue Tuesday 74 1974 2 00 01 2 00} test clock-3.337 {ISO week-based calendar 1974-W01-6} { clock format 126576000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W01-6 } {Sat Saturday 74 1974 6 00 01 6 00} test clock-3.338 {ISO week-based calendar 1974-W01-7} { clock format 126662400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W01-7 } {Sun Sunday 74 1974 7 01 01 0 00} test clock-3.339 {ISO week-based calendar 1974-W02-1} { clock format 126748800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W02-1 } {Mon Monday 74 1974 1 01 02 1 01} test clock-3.340 {ISO week-based calendar 1974-W52-1} { clock format 156988800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W52-1 } {Mon Monday 74 1974 1 51 52 1 51} test clock-3.341 {ISO week-based calendar 1974-W52-6} { clock format 157420800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W52-6 } {Sat Saturday 74 1974 6 51 52 6 51} test clock-3.342 {ISO week-based calendar 1974-W52-7} { clock format 157507200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1974-W52-7 } {Sun Sunday 74 1974 7 52 52 0 51} test clock-3.343 {ISO week-based calendar 1975-W01-1} { clock format 157593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W01-1 } {Mon Monday 75 1975 1 52 01 1 52} test clock-3.344 {ISO week-based calendar 1975-W01-3} { clock format 157766400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W01-3 } {Wed Wednesday 75 1975 3 00 01 3 00} test clock-3.345 {ISO week-based calendar 1975-W01-6} { clock format 158025600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W01-6 } {Sat Saturday 75 1975 6 00 01 6 00} test clock-3.346 {ISO week-based calendar 1975-W01-7} { clock format 158112000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W01-7 } {Sun Sunday 75 1975 7 01 01 0 00} test clock-3.347 {ISO week-based calendar 1975-W02-1} { clock format 158198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W02-1 } {Mon Monday 75 1975 1 01 02 1 01} test clock-3.348 {ISO week-based calendar 1975-W52-1} { clock format 188438400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W52-1 } {Mon Monday 75 1975 1 51 52 1 51} test clock-3.349 {ISO week-based calendar 1975-W52-6} { clock format 188870400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W52-6 } {Sat Saturday 75 1975 6 51 52 6 51} test clock-3.350 {ISO week-based calendar 1975-W52-7} { clock format 188956800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1975-W52-7 } {Sun Sunday 75 1975 7 52 52 0 51} test clock-3.351 {ISO week-based calendar 1976-W01-1} { clock format 189043200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W01-1 } {Mon Monday 76 1976 1 52 01 1 52} test clock-3.352 {ISO week-based calendar 1976-W01-4} { clock format 189302400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W01-4 } {Thu Thursday 76 1976 4 00 01 4 00} test clock-3.353 {ISO week-based calendar 1976-W01-6} { clock format 189475200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W01-6 } {Sat Saturday 76 1976 6 00 01 6 00} test clock-3.354 {ISO week-based calendar 1976-W01-7} { clock format 189561600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W01-7 } {Sun Sunday 76 1976 7 01 01 0 00} test clock-3.355 {ISO week-based calendar 1976-W02-1} { clock format 189648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W02-1 } {Mon Monday 76 1976 1 01 02 1 01} test clock-3.356 {ISO week-based calendar 1976-W53-1} { clock format 220492800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W53-1 } {Mon Monday 76 1976 1 52 53 1 52} test clock-3.357 {ISO week-based calendar 1976-W53-6} { clock format 220924800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W53-6 } {Sat Saturday 76 1976 6 00 53 6 00} test clock-3.358 {ISO week-based calendar 1976-W53-7} { clock format 221011200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1976-W53-7 } {Sun Sunday 76 1976 7 01 53 0 00} test clock-3.359 {ISO week-based calendar 1977-W01-1} { clock format 221097600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W01-1 } {Mon Monday 77 1977 1 01 01 1 01} test clock-3.360 {ISO week-based calendar 1977-W01-6} { clock format 221529600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W01-6 } {Sat Saturday 77 1977 6 01 01 6 01} test clock-3.361 {ISO week-based calendar 1977-W01-7} { clock format 221616000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W01-7 } {Sun Sunday 77 1977 7 02 01 0 01} test clock-3.362 {ISO week-based calendar 1977-W02-1} { clock format 221702400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W02-1 } {Mon Monday 77 1977 1 02 02 1 02} test clock-3.363 {ISO week-based calendar 1977-W52-1} { clock format 251942400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W52-1 } {Mon Monday 77 1977 1 52 52 1 52} test clock-3.364 {ISO week-based calendar 1977-W52-6} { clock format 252374400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W52-6 } {Sat Saturday 77 1977 6 52 52 6 52} test clock-3.365 {ISO week-based calendar 1977-W52-7} { clock format 252460800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1977-W52-7 } {Sun Sunday 77 1977 7 01 52 0 00} test clock-3.366 {ISO week-based calendar 1978-W01-1} { clock format 252547200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W01-1 } {Mon Monday 78 1978 1 01 01 1 01} test clock-3.367 {ISO week-based calendar 1978-W01-6} { clock format 252979200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W01-6 } {Sat Saturday 78 1978 6 01 01 6 01} test clock-3.368 {ISO week-based calendar 1978-W01-7} { clock format 253065600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W01-7 } {Sun Sunday 78 1978 7 02 01 0 01} test clock-3.369 {ISO week-based calendar 1978-W02-1} { clock format 253152000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W02-1 } {Mon Monday 78 1978 1 02 02 1 02} test clock-3.370 {ISO week-based calendar 1978-W52-1} { clock format 283392000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W52-1 } {Mon Monday 78 1978 1 52 52 1 52} test clock-3.371 {ISO week-based calendar 1978-W52-6} { clock format 283824000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W52-6 } {Sat Saturday 78 1978 6 52 52 6 52} test clock-3.372 {ISO week-based calendar 1978-W52-7} { clock format 283910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1978-W52-7 } {Sun Sunday 78 1978 7 53 52 0 52} test clock-3.373 {ISO week-based calendar 1979-W01-1} { clock format 283996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W01-1 } {Mon Monday 79 1979 1 00 01 1 01} test clock-3.374 {ISO week-based calendar 1979-W01-6} { clock format 284428800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W01-6 } {Sat Saturday 79 1979 6 00 01 6 01} test clock-3.375 {ISO week-based calendar 1979-W01-7} { clock format 284515200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W01-7 } {Sun Sunday 79 1979 7 01 01 0 01} test clock-3.376 {ISO week-based calendar 1979-W02-1} { clock format 284601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W02-1 } {Mon Monday 79 1979 1 01 02 1 02} test clock-3.377 {ISO week-based calendar 1979-W52-1} { clock format 314841600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W52-1 } {Mon Monday 79 1979 1 51 52 1 52} test clock-3.378 {ISO week-based calendar 1979-W52-6} { clock format 315273600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W52-6 } {Sat Saturday 79 1979 6 51 52 6 52} test clock-3.379 {ISO week-based calendar 1979-W52-7} { clock format 315360000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1979-W52-7 } {Sun Sunday 79 1979 7 52 52 0 52} test clock-3.380 {ISO week-based calendar 1980-W01-1} { clock format 315446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W01-1 } {Mon Monday 80 1980 1 52 01 1 53} test clock-3.381 {ISO week-based calendar 1980-W01-2} { clock format 315532800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W01-2 } {Tue Tuesday 80 1980 2 00 01 2 00} test clock-3.382 {ISO week-based calendar 1980-W01-6} { clock format 315878400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W01-6 } {Sat Saturday 80 1980 6 00 01 6 00} test clock-3.383 {ISO week-based calendar 1980-W01-7} { clock format 315964800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W01-7 } {Sun Sunday 80 1980 7 01 01 0 00} test clock-3.384 {ISO week-based calendar 1980-W02-1} { clock format 316051200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W02-1 } {Mon Monday 80 1980 1 01 02 1 01} test clock-3.385 {ISO week-based calendar 1980-W52-1} { clock format 346291200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W52-1 } {Mon Monday 80 1980 1 51 52 1 51} test clock-3.386 {ISO week-based calendar 1980-W52-6} { clock format 346723200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W52-6 } {Sat Saturday 80 1980 6 51 52 6 51} test clock-3.387 {ISO week-based calendar 1980-W52-7} { clock format 346809600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1980-W52-7 } {Sun Sunday 80 1980 7 52 52 0 51} test clock-3.388 {ISO week-based calendar 1981-W01-1} { clock format 346896000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1981-W01-1 } {Mon Monday 81 1981 1 52 01 1 52} test clock-3.389 {ISO week-based calendar 1981-W01-4} { clock format 347155200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1981-W01-4 } {Thu Thursday 81 1981 4 00 01 4 00} test clock-3.390 {ISO week-based calendar 1981-W01-6} { clock format 347328000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1981-W01-6 } {Sat Saturday 81 1981 6 00 01 6 00} test clock-3.391 {ISO week-based calendar 1981-W01-7} { clock format 347414400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1981-W01-7 } {Sun Sunday 81 1981 7 01 01 0 00} test clock-3.392 {ISO week-based calendar 1981-W02-1} { clock format 347500800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1981-W02-1 } {Mon Monday 81 1981 1 01 02 1 01} test clock-3.393 {ISO week-based calendar 1983-W52-1} { clock format 441244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1983-W52-1 } {Mon Monday 83 1983 1 52 52 1 52} test clock-3.394 {ISO week-based calendar 1983-W52-6} { clock format 441676800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1983-W52-6 } {Sat Saturday 83 1983 6 52 52 6 52} test clock-3.395 {ISO week-based calendar 1983-W52-7} { clock format 441763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1983-W52-7 } {Sun Sunday 83 1983 7 01 52 0 00} test clock-3.396 {ISO week-based calendar 1984-W01-1} { clock format 441849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W01-1 } {Mon Monday 84 1984 1 01 01 1 01} test clock-3.397 {ISO week-based calendar 1984-W01-6} { clock format 442281600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W01-6 } {Sat Saturday 84 1984 6 01 01 6 01} test clock-3.398 {ISO week-based calendar 1984-W01-7} { clock format 442368000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W01-7 } {Sun Sunday 84 1984 7 02 01 0 01} test clock-3.399 {ISO week-based calendar 1984-W02-1} { clock format 442454400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W02-1 } {Mon Monday 84 1984 1 02 02 1 02} test clock-3.400 {ISO week-based calendar 1984-W52-1} { clock format 472694400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W52-1 } {Mon Monday 84 1984 1 52 52 1 52} test clock-3.401 {ISO week-based calendar 1984-W52-6} { clock format 473126400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W52-6 } {Sat Saturday 84 1984 6 52 52 6 52} test clock-3.402 {ISO week-based calendar 1984-W52-7} { clock format 473212800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1984-W52-7 } {Sun Sunday 84 1984 7 53 52 0 52} test clock-3.403 {ISO week-based calendar 1985-W01-1} { clock format 473299200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1985-W01-1 } {Mon Monday 85 1985 1 53 01 1 53} test clock-3.404 {ISO week-based calendar 1985-W01-2} { clock format 473385600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1985-W01-2 } {Tue Tuesday 85 1985 2 00 01 2 00} test clock-3.405 {ISO week-based calendar 1985-W01-6} { clock format 473731200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1985-W01-6 } {Sat Saturday 85 1985 6 00 01 6 00} test clock-3.406 {ISO week-based calendar 1985-W01-7} { clock format 473817600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1985-W01-7 } {Sun Sunday 85 1985 7 01 01 0 00} test clock-3.407 {ISO week-based calendar 1985-W02-1} { clock format 473904000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1985-W02-1 } {Mon Monday 85 1985 1 01 02 1 01} test clock-3.408 {ISO week-based calendar 1987-W53-1} { clock format 567648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1987-W53-1 } {Mon Monday 87 1987 1 52 53 1 52} test clock-3.409 {ISO week-based calendar 1987-W53-5} { clock format 567993600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1987-W53-5 } {Fri Friday 87 1987 5 00 53 5 00} test clock-3.410 {ISO week-based calendar 1987-W53-6} { clock format 568080000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1987-W53-6 } {Sat Saturday 87 1987 6 00 53 6 00} test clock-3.411 {ISO week-based calendar 1987-W53-7} { clock format 568166400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1987-W53-7 } {Sun Sunday 87 1987 7 01 53 0 00} test clock-3.412 {ISO week-based calendar 1988-W01-1} { clock format 568252800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W01-1 } {Mon Monday 88 1988 1 01 01 1 01} test clock-3.413 {ISO week-based calendar 1988-W01-6} { clock format 568684800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W01-6 } {Sat Saturday 88 1988 6 01 01 6 01} test clock-3.414 {ISO week-based calendar 1988-W01-7} { clock format 568771200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W01-7 } {Sun Sunday 88 1988 7 02 01 0 01} test clock-3.415 {ISO week-based calendar 1988-W02-1} { clock format 568857600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W02-1 } {Mon Monday 88 1988 1 02 02 1 02} test clock-3.416 {ISO week-based calendar 1988-W52-1} { clock format 599097600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W52-1 } {Mon Monday 88 1988 1 52 52 1 52} test clock-3.417 {ISO week-based calendar 1988-W52-6} { clock format 599529600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W52-6 } {Sat Saturday 88 1988 6 52 52 6 52} test clock-3.418 {ISO week-based calendar 1988-W52-7} { clock format 599616000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1988-W52-7 } {Sun Sunday 88 1988 7 01 52 0 00} test clock-3.419 {ISO week-based calendar 1989-W01-1} { clock format 599702400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1989-W01-1 } {Mon Monday 89 1989 1 01 01 1 01} test clock-3.420 {ISO week-based calendar 1989-W01-6} { clock format 600134400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1989-W01-6 } {Sat Saturday 89 1989 6 01 01 6 01} test clock-3.421 {ISO week-based calendar 1989-W01-7} { clock format 600220800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1989-W01-7 } {Sun Sunday 89 1989 7 02 01 0 01} test clock-3.422 {ISO week-based calendar 1989-W02-1} { clock format 600307200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1989-W02-1 } {Mon Monday 89 1989 1 02 02 1 02} test clock-3.423 {ISO week-based calendar 1991-W52-1} { clock format 693446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1991-W52-1 } {Mon Monday 91 1991 1 51 52 1 51} test clock-3.424 {ISO week-based calendar 1991-W52-6} { clock format 693878400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1991-W52-6 } {Sat Saturday 91 1991 6 51 52 6 51} test clock-3.425 {ISO week-based calendar 1991-W52-7} { clock format 693964800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1991-W52-7 } {Sun Sunday 91 1991 7 52 52 0 51} test clock-3.426 {ISO week-based calendar 1992-W01-1} { clock format 694051200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W01-1 } {Mon Monday 92 1992 1 52 01 1 52} test clock-3.427 {ISO week-based calendar 1992-W01-3} { clock format 694224000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W01-3 } {Wed Wednesday 92 1992 3 00 01 3 00} test clock-3.428 {ISO week-based calendar 1992-W01-6} { clock format 694483200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W01-6 } {Sat Saturday 92 1992 6 00 01 6 00} test clock-3.429 {ISO week-based calendar 1992-W01-7} { clock format 694569600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W01-7 } {Sun Sunday 92 1992 7 01 01 0 00} test clock-3.430 {ISO week-based calendar 1992-W02-1} { clock format 694656000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W02-1 } {Mon Monday 92 1992 1 01 02 1 01} test clock-3.431 {ISO week-based calendar 1992-W53-1} { clock format 725500800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W53-1 } {Mon Monday 92 1992 1 52 53 1 52} test clock-3.432 {ISO week-based calendar 1992-W53-5} { clock format 725846400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W53-5 } {Fri Friday 92 1992 5 00 53 5 00} test clock-3.433 {ISO week-based calendar 1992-W53-6} { clock format 725932800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W53-6 } {Sat Saturday 92 1992 6 00 53 6 00} test clock-3.434 {ISO week-based calendar 1992-W53-7} { clock format 726019200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1992-W53-7 } {Sun Sunday 92 1992 7 01 53 0 00} test clock-3.435 {ISO week-based calendar 1993-W01-1} { clock format 726105600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1993-W01-1 } {Mon Monday 93 1993 1 01 01 1 01} test clock-3.436 {ISO week-based calendar 1993-W01-6} { clock format 726537600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1993-W01-6 } {Sat Saturday 93 1993 6 01 01 6 01} test clock-3.437 {ISO week-based calendar 1993-W01-7} { clock format 726624000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1993-W01-7 } {Sun Sunday 93 1993 7 02 01 0 01} test clock-3.438 {ISO week-based calendar 1993-W02-1} { clock format 726710400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1993-W02-1 } {Mon Monday 93 1993 1 02 02 1 02} test clock-3.439 {ISO week-based calendar 1995-W52-1} { clock format 819849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1995-W52-1 } {Mon Monday 95 1995 1 52 52 1 52} test clock-3.440 {ISO week-based calendar 1995-W52-6} { clock format 820281600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1995-W52-6 } {Sat Saturday 95 1995 6 52 52 6 52} test clock-3.441 {ISO week-based calendar 1995-W52-7} { clock format 820368000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1995-W52-7 } {Sun Sunday 95 1995 7 53 52 0 52} test clock-3.442 {ISO week-based calendar 1996-W01-1} { clock format 820454400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W01-1 } {Mon Monday 96 1996 1 00 01 1 01} test clock-3.443 {ISO week-based calendar 1996-W01-6} { clock format 820886400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W01-6 } {Sat Saturday 96 1996 6 00 01 6 01} test clock-3.444 {ISO week-based calendar 1996-W01-7} { clock format 820972800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W01-7 } {Sun Sunday 96 1996 7 01 01 0 01} test clock-3.445 {ISO week-based calendar 1996-W02-1} { clock format 821059200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W02-1 } {Mon Monday 96 1996 1 01 02 1 02} test clock-3.446 {ISO week-based calendar 1996-W52-1} { clock format 851299200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W52-1 } {Mon Monday 96 1996 1 51 52 1 52} test clock-3.447 {ISO week-based calendar 1996-W52-6} { clock format 851731200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W52-6 } {Sat Saturday 96 1996 6 51 52 6 52} test clock-3.448 {ISO week-based calendar 1996-W52-7} { clock format 851817600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1996-W52-7 } {Sun Sunday 96 1996 7 52 52 0 52} test clock-3.449 {ISO week-based calendar 1997-W01-1} { clock format 851904000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1997-W01-1 } {Mon Monday 97 1997 1 52 01 1 53} test clock-3.450 {ISO week-based calendar 1997-W01-3} { clock format 852076800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1997-W01-3 } {Wed Wednesday 97 1997 3 00 01 3 00} test clock-3.451 {ISO week-based calendar 1997-W01-6} { clock format 852336000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1997-W01-6 } {Sat Saturday 97 1997 6 00 01 6 00} test clock-3.452 {ISO week-based calendar 1997-W01-7} { clock format 852422400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1997-W01-7 } {Sun Sunday 97 1997 7 01 01 0 00} test clock-3.453 {ISO week-based calendar 1997-W02-1} { clock format 852508800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1997-W02-1 } {Mon Monday 97 1997 1 01 02 1 01} test clock-3.454 {ISO week-based calendar 1999-W52-1} { clock format 946252800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1999-W52-1 } {Mon Monday 99 1999 1 52 52 1 52} test clock-3.455 {ISO week-based calendar 1999-W52-6} { clock format 946684800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1999-W52-6 } {Sat Saturday 99 1999 6 00 52 6 00} test clock-3.456 {ISO week-based calendar 1999-W52-7} { clock format 946771200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 1999-W52-7 } {Sun Sunday 99 1999 7 01 52 0 00} test clock-3.457 {ISO week-based calendar 2000-W01-1} { clock format 946857600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W01-1 } {Mon Monday 00 2000 1 01 01 1 01} test clock-3.458 {ISO week-based calendar 2000-W01-6} { clock format 947289600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W01-6 } {Sat Saturday 00 2000 6 01 01 6 01} test clock-3.459 {ISO week-based calendar 2000-W01-7} { clock format 947376000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W01-7 } {Sun Sunday 00 2000 7 02 01 0 01} test clock-3.460 {ISO week-based calendar 2000-W02-1} { clock format 947462400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W02-1 } {Mon Monday 00 2000 1 02 02 1 02} test clock-3.461 {ISO week-based calendar 2000-W52-1} { clock format 977702400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W52-1 } {Mon Monday 00 2000 1 52 52 1 52} test clock-3.462 {ISO week-based calendar 2000-W52-6} { clock format 978134400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W52-6 } {Sat Saturday 00 2000 6 52 52 6 52} test clock-3.463 {ISO week-based calendar 2000-W52-7} { clock format 978220800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2000-W52-7 } {Sun Sunday 00 2000 7 53 52 0 52} test clock-3.464 {ISO week-based calendar 2001-W01-1} { clock format 978307200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W01-1 } {Mon Monday 01 2001 1 00 01 1 01} test clock-3.465 {ISO week-based calendar 2001-W01-6} { clock format 978739200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W01-6 } {Sat Saturday 01 2001 6 00 01 6 01} test clock-3.466 {ISO week-based calendar 2001-W01-7} { clock format 978825600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W01-7 } {Sun Sunday 01 2001 7 01 01 0 01} test clock-3.467 {ISO week-based calendar 2001-W02-1} { clock format 978912000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W02-1 } {Mon Monday 01 2001 1 01 02 1 02} test clock-3.468 {ISO week-based calendar 2001-W52-1} { clock format 1009152000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W52-1 } {Mon Monday 01 2001 1 51 52 1 52} test clock-3.469 {ISO week-based calendar 2001-W52-6} { clock format 1009584000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W52-6 } {Sat Saturday 01 2001 6 51 52 6 52} test clock-3.470 {ISO week-based calendar 2001-W52-7} { clock format 1009670400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2001-W52-7 } {Sun Sunday 01 2001 7 52 52 0 52} test clock-3.471 {ISO week-based calendar 2002-W01-1} { clock format 1009756800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W01-1 } {Mon Monday 02 2002 1 52 01 1 53} test clock-3.472 {ISO week-based calendar 2002-W01-2} { clock format 1009843200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W01-2 } {Tue Tuesday 02 2002 2 00 01 2 00} test clock-3.473 {ISO week-based calendar 2002-W01-6} { clock format 1010188800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W01-6 } {Sat Saturday 02 2002 6 00 01 6 00} test clock-3.474 {ISO week-based calendar 2002-W01-7} { clock format 1010275200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W01-7 } {Sun Sunday 02 2002 7 01 01 0 00} test clock-3.475 {ISO week-based calendar 2002-W02-1} { clock format 1010361600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W02-1 } {Mon Monday 02 2002 1 01 02 1 01} test clock-3.476 {ISO week-based calendar 2002-W52-1} { clock format 1040601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W52-1 } {Mon Monday 02 2002 1 51 52 1 51} test clock-3.477 {ISO week-based calendar 2002-W52-6} { clock format 1041033600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W52-6 } {Sat Saturday 02 2002 6 51 52 6 51} test clock-3.478 {ISO week-based calendar 2002-W52-7} { clock format 1041120000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2002-W52-7 } {Sun Sunday 02 2002 7 52 52 0 51} test clock-3.479 {ISO week-based calendar 2003-W01-1} { clock format 1041206400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W01-1 } {Mon Monday 03 2003 1 52 01 1 52} test clock-3.480 {ISO week-based calendar 2003-W01-3} { clock format 1041379200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W01-3 } {Wed Wednesday 03 2003 3 00 01 3 00} test clock-3.481 {ISO week-based calendar 2003-W01-6} { clock format 1041638400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W01-6 } {Sat Saturday 03 2003 6 00 01 6 00} test clock-3.482 {ISO week-based calendar 2003-W01-7} { clock format 1041724800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W01-7 } {Sun Sunday 03 2003 7 01 01 0 00} test clock-3.483 {ISO week-based calendar 2003-W02-1} { clock format 1041811200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W02-1 } {Mon Monday 03 2003 1 01 02 1 01} test clock-3.484 {ISO week-based calendar 2003-W52-1} { clock format 1072051200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W52-1 } {Mon Monday 03 2003 1 51 52 1 51} test clock-3.485 {ISO week-based calendar 2003-W52-6} { clock format 1072483200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W52-6 } {Sat Saturday 03 2003 6 51 52 6 51} test clock-3.486 {ISO week-based calendar 2003-W52-7} { clock format 1072569600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2003-W52-7 } {Sun Sunday 03 2003 7 52 52 0 51} test clock-3.487 {ISO week-based calendar 2004-W01-1} { clock format 1072656000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W01-1 } {Mon Monday 04 2004 1 52 01 1 52} test clock-3.488 {ISO week-based calendar 2004-W01-4} { clock format 1072915200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W01-4 } {Thu Thursday 04 2004 4 00 01 4 00} test clock-3.489 {ISO week-based calendar 2004-W01-6} { clock format 1073088000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W01-6 } {Sat Saturday 04 2004 6 00 01 6 00} test clock-3.490 {ISO week-based calendar 2004-W01-7} { clock format 1073174400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W01-7 } {Sun Sunday 04 2004 7 01 01 0 00} test clock-3.491 {ISO week-based calendar 2004-W02-1} { clock format 1073260800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W02-1 } {Mon Monday 04 2004 1 01 02 1 01} test clock-3.492 {ISO week-based calendar 2004-W53-1} { clock format 1104105600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W53-1 } {Mon Monday 04 2004 1 52 53 1 52} test clock-3.493 {ISO week-based calendar 2004-W53-6} { clock format 1104537600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W53-6 } {Sat Saturday 04 2004 6 00 53 6 00} test clock-3.494 {ISO week-based calendar 2004-W53-7} { clock format 1104624000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2004-W53-7 } {Sun Sunday 04 2004 7 01 53 0 00} test clock-3.495 {ISO week-based calendar 2005-W01-1} { clock format 1104710400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W01-1 } {Mon Monday 05 2005 1 01 01 1 01} test clock-3.496 {ISO week-based calendar 2005-W01-6} { clock format 1105142400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W01-6 } {Sat Saturday 05 2005 6 01 01 6 01} test clock-3.497 {ISO week-based calendar 2005-W01-7} { clock format 1105228800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W01-7 } {Sun Sunday 05 2005 7 02 01 0 01} test clock-3.498 {ISO week-based calendar 2005-W02-1} { clock format 1105315200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W02-1 } {Mon Monday 05 2005 1 02 02 1 02} test clock-3.499 {ISO week-based calendar 2005-W52-1} { clock format 1135555200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W52-1 } {Mon Monday 05 2005 1 52 52 1 52} test clock-3.500 {ISO week-based calendar 2005-W52-6} { clock format 1135987200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W52-6 } {Sat Saturday 05 2005 6 52 52 6 52} test clock-3.501 {ISO week-based calendar 2005-W52-7} { clock format 1136073600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2005-W52-7 } {Sun Sunday 05 2005 7 01 52 0 00} test clock-3.502 {ISO week-based calendar 2006-W01-1} { clock format 1136160000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W01-1 } {Mon Monday 06 2006 1 01 01 1 01} test clock-3.503 {ISO week-based calendar 2006-W01-6} { clock format 1136592000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W01-6 } {Sat Saturday 06 2006 6 01 01 6 01} test clock-3.504 {ISO week-based calendar 2006-W01-7} { clock format 1136678400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W01-7 } {Sun Sunday 06 2006 7 02 01 0 01} test clock-3.505 {ISO week-based calendar 2006-W02-1} { clock format 1136764800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W02-1 } {Mon Monday 06 2006 1 02 02 1 02} test clock-3.506 {ISO week-based calendar 2006-W52-1} { clock format 1167004800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W52-1 } {Mon Monday 06 2006 1 52 52 1 52} test clock-3.507 {ISO week-based calendar 2006-W52-6} { clock format 1167436800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W52-6 } {Sat Saturday 06 2006 6 52 52 6 52} test clock-3.508 {ISO week-based calendar 2006-W52-7} { clock format 1167523200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2006-W52-7 } {Sun Sunday 06 2006 7 53 52 0 52} test clock-3.509 {ISO week-based calendar 2007-W01-1} { clock format 1167609600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W01-1 } {Mon Monday 07 2007 1 00 01 1 01} test clock-3.510 {ISO week-based calendar 2007-W01-6} { clock format 1168041600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W01-6 } {Sat Saturday 07 2007 6 00 01 6 01} test clock-3.511 {ISO week-based calendar 2007-W01-7} { clock format 1168128000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W01-7 } {Sun Sunday 07 2007 7 01 01 0 01} test clock-3.512 {ISO week-based calendar 2007-W02-1} { clock format 1168214400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W02-1 } {Mon Monday 07 2007 1 01 02 1 02} test clock-3.513 {ISO week-based calendar 2007-W52-1} { clock format 1198454400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W52-1 } {Mon Monday 07 2007 1 51 52 1 52} test clock-3.514 {ISO week-based calendar 2007-W52-6} { clock format 1198886400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W52-6 } {Sat Saturday 07 2007 6 51 52 6 52} test clock-3.515 {ISO week-based calendar 2007-W52-7} { clock format 1198972800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2007-W52-7 } {Sun Sunday 07 2007 7 52 52 0 52} test clock-3.516 {ISO week-based calendar 2008-W01-1} { clock format 1199059200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W01-1 } {Mon Monday 08 2008 1 52 01 1 53} test clock-3.517 {ISO week-based calendar 2008-W01-2} { clock format 1199145600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W01-2 } {Tue Tuesday 08 2008 2 00 01 2 00} test clock-3.518 {ISO week-based calendar 2008-W01-6} { clock format 1199491200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W01-6 } {Sat Saturday 08 2008 6 00 01 6 00} test clock-3.519 {ISO week-based calendar 2008-W01-7} { clock format 1199577600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W01-7 } {Sun Sunday 08 2008 7 01 01 0 00} test clock-3.520 {ISO week-based calendar 2008-W02-1} { clock format 1199664000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W02-1 } {Mon Monday 08 2008 1 01 02 1 01} test clock-3.521 {ISO week-based calendar 2008-W52-1} { clock format 1229904000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W52-1 } {Mon Monday 08 2008 1 51 52 1 51} test clock-3.522 {ISO week-based calendar 2008-W52-6} { clock format 1230336000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W52-6 } {Sat Saturday 08 2008 6 51 52 6 51} test clock-3.523 {ISO week-based calendar 2008-W52-7} { clock format 1230422400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2008-W52-7 } {Sun Sunday 08 2008 7 52 52 0 51} test clock-3.524 {ISO week-based calendar 2009-W01-1} { clock format 1230508800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W01-1 } {Mon Monday 09 2009 1 52 01 1 52} test clock-3.525 {ISO week-based calendar 2009-W01-4} { clock format 1230768000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W01-4 } {Thu Thursday 09 2009 4 00 01 4 00} test clock-3.526 {ISO week-based calendar 2009-W01-6} { clock format 1230940800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W01-6 } {Sat Saturday 09 2009 6 00 01 6 00} test clock-3.527 {ISO week-based calendar 2009-W01-7} { clock format 1231027200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W01-7 } {Sun Sunday 09 2009 7 01 01 0 00} test clock-3.528 {ISO week-based calendar 2009-W02-1} { clock format 1231113600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W02-1 } {Mon Monday 09 2009 1 01 02 1 01} test clock-3.529 {ISO week-based calendar 2009-W53-1} { clock format 1261958400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W53-1 } {Mon Monday 09 2009 1 52 53 1 52} test clock-3.530 {ISO week-based calendar 2009-W53-5} { clock format 1262304000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W53-5 } {Fri Friday 09 2009 5 00 53 5 00} test clock-3.531 {ISO week-based calendar 2009-W53-6} { clock format 1262390400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W53-6 } {Sat Saturday 09 2009 6 00 53 6 00} test clock-3.532 {ISO week-based calendar 2009-W53-7} { clock format 1262476800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2009-W53-7 } {Sun Sunday 09 2009 7 01 53 0 00} test clock-3.533 {ISO week-based calendar 2010-W01-1} { clock format 1262563200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W01-1 } {Mon Monday 10 2010 1 01 01 1 01} test clock-3.534 {ISO week-based calendar 2010-W01-6} { clock format 1262995200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W01-6 } {Sat Saturday 10 2010 6 01 01 6 01} test clock-3.535 {ISO week-based calendar 2010-W01-7} { clock format 1263081600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W01-7 } {Sun Sunday 10 2010 7 02 01 0 01} test clock-3.536 {ISO week-based calendar 2010-W02-1} { clock format 1263168000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W02-1 } {Mon Monday 10 2010 1 02 02 1 02} test clock-3.537 {ISO week-based calendar 2010-W52-1} { clock format 1293408000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W52-1 } {Mon Monday 10 2010 1 52 52 1 52} test clock-3.538 {ISO week-based calendar 2010-W52-6} { clock format 1293840000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W52-6 } {Sat Saturday 10 2010 6 00 52 6 00} test clock-3.539 {ISO week-based calendar 2010-W52-7} { clock format 1293926400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2010-W52-7 } {Sun Sunday 10 2010 7 01 52 0 00} test clock-3.540 {ISO week-based calendar 2011-W01-1} { clock format 1294012800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W01-1 } {Mon Monday 11 2011 1 01 01 1 01} test clock-3.541 {ISO week-based calendar 2011-W01-6} { clock format 1294444800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W01-6 } {Sat Saturday 11 2011 6 01 01 6 01} test clock-3.542 {ISO week-based calendar 2011-W01-7} { clock format 1294531200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W01-7 } {Sun Sunday 11 2011 7 02 01 0 01} test clock-3.543 {ISO week-based calendar 2011-W02-1} { clock format 1294617600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W02-1 } {Mon Monday 11 2011 1 02 02 1 02} test clock-3.544 {ISO week-based calendar 2011-W52-1} { clock format 1324857600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W52-1 } {Mon Monday 11 2011 1 52 52 1 52} test clock-3.545 {ISO week-based calendar 2011-W52-6} { clock format 1325289600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W52-6 } {Sat Saturday 11 2011 6 52 52 6 52} test clock-3.546 {ISO week-based calendar 2011-W52-7} { clock format 1325376000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2011-W52-7 } {Sun Sunday 11 2011 7 01 52 0 00} test clock-3.547 {ISO week-based calendar 2012-W01-1} { clock format 1325462400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W01-1 } {Mon Monday 12 2012 1 01 01 1 01} test clock-3.548 {ISO week-based calendar 2012-W01-6} { clock format 1325894400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W01-6 } {Sat Saturday 12 2012 6 01 01 6 01} test clock-3.549 {ISO week-based calendar 2012-W01-7} { clock format 1325980800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W01-7 } {Sun Sunday 12 2012 7 02 01 0 01} test clock-3.550 {ISO week-based calendar 2012-W02-1} { clock format 1326067200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W02-1 } {Mon Monday 12 2012 1 02 02 1 02} test clock-3.551 {ISO week-based calendar 2012-W52-1} { clock format 1356307200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W52-1 } {Mon Monday 12 2012 1 52 52 1 52} test clock-3.552 {ISO week-based calendar 2012-W52-6} { clock format 1356739200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W52-6 } {Sat Saturday 12 2012 6 52 52 6 52} test clock-3.553 {ISO week-based calendar 2012-W52-7} { clock format 1356825600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2012-W52-7 } {Sun Sunday 12 2012 7 53 52 0 52} test clock-3.554 {ISO week-based calendar 2013-W01-1} { clock format 1356912000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2013-W01-1 } {Mon Monday 13 2013 1 53 01 1 53} test clock-3.555 {ISO week-based calendar 2013-W01-2} { clock format 1356998400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2013-W01-2 } {Tue Tuesday 13 2013 2 00 01 2 00} test clock-3.556 {ISO week-based calendar 2013-W01-6} { clock format 1357344000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2013-W01-6 } {Sat Saturday 13 2013 6 00 01 6 00} test clock-3.557 {ISO week-based calendar 2013-W01-7} { clock format 1357430400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2013-W01-7 } {Sun Sunday 13 2013 7 01 01 0 00} test clock-3.558 {ISO week-based calendar 2013-W02-1} { clock format 1357516800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2013-W02-1 } {Mon Monday 13 2013 1 01 02 1 01} test clock-3.559 {ISO week-based calendar 2015-W53-1} { clock format 1451260800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2015-W53-1 } {Mon Monday 15 2015 1 52 53 1 52} test clock-3.560 {ISO week-based calendar 2015-W53-5} { clock format 1451606400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2015-W53-5 } {Fri Friday 15 2015 5 00 53 5 00} test clock-3.561 {ISO week-based calendar 2015-W53-6} { clock format 1451692800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2015-W53-6 } {Sat Saturday 15 2015 6 00 53 6 00} test clock-3.562 {ISO week-based calendar 2015-W53-7} { clock format 1451779200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2015-W53-7 } {Sun Sunday 15 2015 7 01 53 0 00} test clock-3.563 {ISO week-based calendar 2016-W01-1} { clock format 1451865600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W01-1 } {Mon Monday 16 2016 1 01 01 1 01} test clock-3.564 {ISO week-based calendar 2016-W01-6} { clock format 1452297600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W01-6 } {Sat Saturday 16 2016 6 01 01 6 01} test clock-3.565 {ISO week-based calendar 2016-W01-7} { clock format 1452384000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W01-7 } {Sun Sunday 16 2016 7 02 01 0 01} test clock-3.566 {ISO week-based calendar 2016-W02-1} { clock format 1452470400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W02-1 } {Mon Monday 16 2016 1 02 02 1 02} test clock-3.567 {ISO week-based calendar 2016-W52-1} { clock format 1482710400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W52-1 } {Mon Monday 16 2016 1 52 52 1 52} test clock-3.568 {ISO week-based calendar 2016-W52-6} { clock format 1483142400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W52-6 } {Sat Saturday 16 2016 6 52 52 6 52} test clock-3.569 {ISO week-based calendar 2016-W52-7} { clock format 1483228800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2016-W52-7 } {Sun Sunday 16 2016 7 01 52 0 00} test clock-3.570 {ISO week-based calendar 2017-W01-1} { clock format 1483315200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2017-W01-1 } {Mon Monday 17 2017 1 01 01 1 01} test clock-3.571 {ISO week-based calendar 2017-W01-6} { clock format 1483747200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2017-W01-6 } {Sat Saturday 17 2017 6 01 01 6 01} test clock-3.572 {ISO week-based calendar 2017-W01-7} { clock format 1483833600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2017-W01-7 } {Sun Sunday 17 2017 7 02 01 0 01} test clock-3.573 {ISO week-based calendar 2017-W02-1} { clock format 1483920000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2017-W02-1 } {Mon Monday 17 2017 1 02 02 1 02} test clock-3.574 {ISO week-based calendar 2019-W52-1} { clock format 1577059200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2019-W52-1 } {Mon Monday 19 2019 1 51 52 1 51} test clock-3.575 {ISO week-based calendar 2019-W52-6} { clock format 1577491200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2019-W52-6 } {Sat Saturday 19 2019 6 51 52 6 51} test clock-3.576 {ISO week-based calendar 2019-W52-7} { clock format 1577577600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2019-W52-7 } {Sun Sunday 19 2019 7 52 52 0 51} test clock-3.577 {ISO week-based calendar 2020-W01-1} { clock format 1577664000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W01-1 } {Mon Monday 20 2020 1 52 01 1 52} test clock-3.578 {ISO week-based calendar 2020-W01-3} { clock format 1577836800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W01-3 } {Wed Wednesday 20 2020 3 00 01 3 00} test clock-3.579 {ISO week-based calendar 2020-W01-6} { clock format 1578096000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W01-6 } {Sat Saturday 20 2020 6 00 01 6 00} test clock-3.580 {ISO week-based calendar 2020-W01-7} { clock format 1578182400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W01-7 } {Sun Sunday 20 2020 7 01 01 0 00} test clock-3.581 {ISO week-based calendar 2020-W02-1} { clock format 1578268800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W02-1 } {Mon Monday 20 2020 1 01 02 1 01} test clock-3.582 {ISO week-based calendar 2020-W53-1} { clock format 1609113600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W53-1 } {Mon Monday 20 2020 1 52 53 1 52} test clock-3.583 {ISO week-based calendar 2020-W53-5} { clock format 1609459200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W53-5 } {Fri Friday 20 2020 5 00 53 5 00} test clock-3.584 {ISO week-based calendar 2020-W53-6} { clock format 1609545600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W53-6 } {Sat Saturday 20 2020 6 00 53 6 00} test clock-3.585 {ISO week-based calendar 2020-W53-7} { clock format 1609632000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2020-W53-7 } {Sun Sunday 20 2020 7 01 53 0 00} test clock-3.586 {ISO week-based calendar 2021-W01-1} { clock format 1609718400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2021-W01-1 } {Mon Monday 21 2021 1 01 01 1 01} test clock-3.587 {ISO week-based calendar 2021-W01-6} { clock format 1610150400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2021-W01-6 } {Sat Saturday 21 2021 6 01 01 6 01} test clock-3.588 {ISO week-based calendar 2021-W01-7} { clock format 1610236800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2021-W01-7 } {Sun Sunday 21 2021 7 02 01 0 01} test clock-3.589 {ISO week-based calendar 2021-W02-1} { clock format 1610323200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2021-W02-1 } {Mon Monday 21 2021 1 02 02 1 02} test clock-3.590 {ISO week-based calendar 2023-W52-1} { clock format 1703462400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2023-W52-1 } {Mon Monday 23 2023 1 52 52 1 52} test clock-3.591 {ISO week-based calendar 2023-W52-6} { clock format 1703894400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2023-W52-6 } {Sat Saturday 23 2023 6 52 52 6 52} test clock-3.592 {ISO week-based calendar 2023-W52-7} { clock format 1703980800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2023-W52-7 } {Sun Sunday 23 2023 7 53 52 0 52} test clock-3.593 {ISO week-based calendar 2024-W01-1} { clock format 1704067200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W01-1 } {Mon Monday 24 2024 1 00 01 1 01} test clock-3.594 {ISO week-based calendar 2024-W01-6} { clock format 1704499200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W01-6 } {Sat Saturday 24 2024 6 00 01 6 01} test clock-3.595 {ISO week-based calendar 2024-W01-7} { clock format 1704585600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W01-7 } {Sun Sunday 24 2024 7 01 01 0 01} test clock-3.596 {ISO week-based calendar 2024-W02-1} { clock format 1704672000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W02-1 } {Mon Monday 24 2024 1 01 02 1 02} test clock-3.597 {ISO week-based calendar 2024-W52-1} { clock format 1734912000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W52-1 } {Mon Monday 24 2024 1 51 52 1 52} test clock-3.598 {ISO week-based calendar 2024-W52-6} { clock format 1735344000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W52-6 } {Sat Saturday 24 2024 6 51 52 6 52} test clock-3.599 {ISO week-based calendar 2024-W52-7} { clock format 1735430400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2024-W52-7 } {Sun Sunday 24 2024 7 52 52 0 52} test clock-3.600 {ISO week-based calendar 2025-W01-1} { clock format 1735516800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2025-W01-1 } {Mon Monday 25 2025 1 52 01 1 53} test clock-3.601 {ISO week-based calendar 2025-W01-3} { clock format 1735689600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2025-W01-3 } {Wed Wednesday 25 2025 3 00 01 3 00} test clock-3.602 {ISO week-based calendar 2025-W01-6} { clock format 1735948800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2025-W01-6 } {Sat Saturday 25 2025 6 00 01 6 00} test clock-3.603 {ISO week-based calendar 2025-W01-7} { clock format 1736035200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2025-W01-7 } {Sun Sunday 25 2025 7 01 01 0 00} test clock-3.604 {ISO week-based calendar 2025-W02-1} { clock format 1736121600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2025-W02-1 } {Mon Monday 25 2025 1 01 02 1 01} test clock-3.605 {ISO week-based calendar 2036-W52-1} { clock format 2113516800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2036-W52-1 } {Mon Monday 36 2036 1 51 52 1 51} test clock-3.606 {ISO week-based calendar 2036-W52-6} { clock format 2113948800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2036-W52-6 } {Sat Saturday 36 2036 6 51 52 6 51} test clock-3.607 {ISO week-based calendar 2036-W52-7} { clock format 2114035200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2036-W52-7 } {Sun Sunday 36 2036 7 52 52 0 51} test clock-3.608 {ISO week-based calendar 2037-W01-1} { clock format 2114121600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W01-1 } {Mon Monday 37 2037 1 52 01 1 52} test clock-3.609 {ISO week-based calendar 2037-W01-4} { clock format 2114380800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W01-4 } {Thu Thursday 37 2037 4 00 01 4 00} test clock-3.610 {ISO week-based calendar 2037-W01-6} { clock format 2114553600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W01-6 } {Sat Saturday 37 2037 6 00 01 6 00} test clock-3.611 {ISO week-based calendar 2037-W01-7} { clock format 2114640000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W01-7 } {Sun Sunday 37 2037 7 01 01 0 00} test clock-3.612 {ISO week-based calendar 2037-W02-1} { clock format 2114726400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W02-1 } {Mon Monday 37 2037 1 01 02 1 01} test clock-3.613 {ISO week-based calendar 2037-W53-1} { clock format 2145571200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W53-1 } {Mon Monday 37 2037 1 52 53 1 52} test clock-3.614 {ISO week-based calendar 2037-W53-5} { clock format 2145916800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W53-5 } {Fri Friday 37 2037 5 00 53 5 00} test clock-3.615 {ISO week-based calendar 2037-W53-6} { clock format 2146003200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W53-6 } {Sat Saturday 37 2037 6 00 53 6 00} test clock-3.616 {ISO week-based calendar 2037-W53-7} { clock format 2146089600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2037-W53-7 } {Sun Sunday 37 2037 7 01 53 0 00} test clock-3.617 {ISO week-based calendar 2038-W01-1} { clock format 2146176000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W01-1 } {Mon Monday 38 2038 1 01 01 1 01} test clock-3.618 {ISO week-based calendar 2038-W01-6} { clock format 2146608000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W01-6 } {Sat Saturday 38 2038 6 01 01 6 01} test clock-3.619 {ISO week-based calendar 2038-W01-7} { clock format 2146694400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W01-7 } {Sun Sunday 38 2038 7 02 01 0 01} test clock-3.620 {ISO week-based calendar 2038-W02-1} { clock format 2146780800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W02-1 } {Mon Monday 38 2038 1 02 02 1 02} test clock-3.621 {ISO week-based calendar 2038-W52-1} { clock format 2177020800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W52-1 } {Mon Monday 38 2038 1 52 52 1 52} test clock-3.622 {ISO week-based calendar 2038-W52-6} { clock format 2177452800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W52-6 } {Sat Saturday 38 2038 6 00 52 6 00} test clock-3.623 {ISO week-based calendar 2038-W52-7} { clock format 2177539200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2038-W52-7 } {Sun Sunday 38 2038 7 01 52 0 00} test clock-3.624 {ISO week-based calendar 2039-W01-1} { clock format 2177625600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W01-1 } {Mon Monday 39 2039 1 01 01 1 01} test clock-3.625 {ISO week-based calendar 2039-W01-6} { clock format 2178057600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W01-6 } {Sat Saturday 39 2039 6 01 01 6 01} test clock-3.626 {ISO week-based calendar 2039-W01-7} { clock format 2178144000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W01-7 } {Sun Sunday 39 2039 7 02 01 0 01} test clock-3.627 {ISO week-based calendar 2039-W02-1} { clock format 2178230400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W02-1 } {Mon Monday 39 2039 1 02 02 1 02} test clock-3.628 {ISO week-based calendar 2039-W52-1} { clock format 2208470400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W52-1 } {Mon Monday 39 2039 1 52 52 1 52} test clock-3.629 {ISO week-based calendar 2039-W52-6} { clock format 2208902400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W52-6 } {Sat Saturday 39 2039 6 52 52 6 52} test clock-3.630 {ISO week-based calendar 2039-W52-7} { clock format 2208988800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2039-W52-7 } {Sun Sunday 39 2039 7 01 52 0 00} test clock-3.631 {ISO week-based calendar 2040-W01-1} { clock format 2209075200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W01-1 } {Mon Monday 40 2040 1 01 01 1 01} test clock-3.632 {ISO week-based calendar 2040-W01-6} { clock format 2209507200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W01-6 } {Sat Saturday 40 2040 6 01 01 6 01} test clock-3.633 {ISO week-based calendar 2040-W01-7} { clock format 2209593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W01-7 } {Sun Sunday 40 2040 7 02 01 0 01} test clock-3.634 {ISO week-based calendar 2040-W02-1} { clock format 2209680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W02-1 } {Mon Monday 40 2040 1 02 02 1 02} test clock-3.635 {ISO week-based calendar 2040-W52-1} { clock format 2239920000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W52-1 } {Mon Monday 40 2040 1 52 52 1 52} test clock-3.636 {ISO week-based calendar 2040-W52-6} { clock format 2240352000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W52-6 } {Sat Saturday 40 2040 6 52 52 6 52} test clock-3.637 {ISO week-based calendar 2040-W52-7} { clock format 2240438400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2040-W52-7 } {Sun Sunday 40 2040 7 53 52 0 52} test clock-3.638 {ISO week-based calendar 2041-W01-1} { clock format 2240524800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W01-1 } {Mon Monday 41 2041 1 53 01 1 53} test clock-3.639 {ISO week-based calendar 2041-W01-2} { clock format 2240611200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W01-2 } {Tue Tuesday 41 2041 2 00 01 2 00} test clock-3.640 {ISO week-based calendar 2041-W01-6} { clock format 2240956800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W01-6 } {Sat Saturday 41 2041 6 00 01 6 00} test clock-3.641 {ISO week-based calendar 2041-W01-7} { clock format 2241043200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W01-7 } {Sun Sunday 41 2041 7 01 01 0 00} test clock-3.642 {ISO week-based calendar 2041-W02-1} { clock format 2241129600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W02-1 } {Mon Monday 41 2041 1 01 02 1 01} test clock-3.643 {ISO week-based calendar 2041-W52-1} { clock format 2271369600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W52-1 } {Mon Monday 41 2041 1 51 52 1 51} test clock-3.644 {ISO week-based calendar 2041-W52-6} { clock format 2271801600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W52-6 } {Sat Saturday 41 2041 6 51 52 6 51} test clock-3.645 {ISO week-based calendar 2041-W52-7} { clock format 2271888000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2041-W52-7 } {Sun Sunday 41 2041 7 52 52 0 51} test clock-3.646 {ISO week-based calendar 2042-W01-1} { clock format 2271974400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W01-1 } {Mon Monday 42 2042 1 52 01 1 52} test clock-3.647 {ISO week-based calendar 2042-W01-3} { clock format 2272147200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W01-3 } {Wed Wednesday 42 2042 3 00 01 3 00} test clock-3.648 {ISO week-based calendar 2042-W01-6} { clock format 2272406400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W01-6 } {Sat Saturday 42 2042 6 00 01 6 00} test clock-3.649 {ISO week-based calendar 2042-W01-7} { clock format 2272492800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W01-7 } {Sun Sunday 42 2042 7 01 01 0 00} test clock-3.650 {ISO week-based calendar 2042-W02-1} { clock format 2272579200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W02-1 } {Mon Monday 42 2042 1 01 02 1 01} test clock-3.651 {ISO week-based calendar 2042-W52-1} { clock format 2302819200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W52-1 } {Mon Monday 42 2042 1 51 52 1 51} test clock-3.652 {ISO week-based calendar 2042-W52-6} { clock format 2303251200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W52-6 } {Sat Saturday 42 2042 6 51 52 6 51} test clock-3.653 {ISO week-based calendar 2042-W52-7} { clock format 2303337600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2042-W52-7 } {Sun Sunday 42 2042 7 52 52 0 51} test clock-3.654 {ISO week-based calendar 2043-W01-1} { clock format 2303424000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W01-1 } {Mon Monday 43 2043 1 52 01 1 52} test clock-3.655 {ISO week-based calendar 2043-W01-4} { clock format 2303683200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W01-4 } {Thu Thursday 43 2043 4 00 01 4 00} test clock-3.656 {ISO week-based calendar 2043-W01-6} { clock format 2303856000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W01-6 } {Sat Saturday 43 2043 6 00 01 6 00} test clock-3.657 {ISO week-based calendar 2043-W01-7} { clock format 2303942400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W01-7 } {Sun Sunday 43 2043 7 01 01 0 00} test clock-3.658 {ISO week-based calendar 2043-W02-1} { clock format 2304028800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W02-1 } {Mon Monday 43 2043 1 01 02 1 01} test clock-3.659 {ISO week-based calendar 2043-W53-1} { clock format 2334873600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W53-1 } {Mon Monday 43 2043 1 52 53 1 52} test clock-3.660 {ISO week-based calendar 2043-W53-5} { clock format 2335219200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W53-5 } {Fri Friday 43 2043 5 00 53 5 00} test clock-3.661 {ISO week-based calendar 2043-W53-6} { clock format 2335305600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W53-6 } {Sat Saturday 43 2043 6 00 53 6 00} test clock-3.662 {ISO week-based calendar 2043-W53-7} { clock format 2335392000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2043-W53-7 } {Sun Sunday 43 2043 7 01 53 0 00} test clock-3.663 {ISO week-based calendar 2044-W01-1} { clock format 2335478400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W01-1 } {Mon Monday 44 2044 1 01 01 1 01} test clock-3.664 {ISO week-based calendar 2044-W01-6} { clock format 2335910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W01-6 } {Sat Saturday 44 2044 6 01 01 6 01} test clock-3.665 {ISO week-based calendar 2044-W01-7} { clock format 2335996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W01-7 } {Sun Sunday 44 2044 7 02 01 0 01} test clock-3.666 {ISO week-based calendar 2044-W02-1} { clock format 2336083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W02-1 } {Mon Monday 44 2044 1 02 02 1 02} test clock-3.667 {ISO week-based calendar 2044-W52-1} { clock format 2366323200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W52-1 } {Mon Monday 44 2044 1 52 52 1 52} test clock-3.668 {ISO week-based calendar 2044-W52-6} { clock format 2366755200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W52-6 } {Sat Saturday 44 2044 6 52 52 6 52} test clock-3.669 {ISO week-based calendar 2044-W52-7} { clock format 2366841600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2044-W52-7 } {Sun Sunday 44 2044 7 01 52 0 00} test clock-3.670 {ISO week-based calendar 2045-W01-1} { clock format 2366928000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W01-1 } {Mon Monday 45 2045 1 01 01 1 01} test clock-3.671 {ISO week-based calendar 2045-W01-6} { clock format 2367360000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W01-6 } {Sat Saturday 45 2045 6 01 01 6 01} test clock-3.672 {ISO week-based calendar 2045-W01-7} { clock format 2367446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W01-7 } {Sun Sunday 45 2045 7 02 01 0 01} test clock-3.673 {ISO week-based calendar 2045-W02-1} { clock format 2367532800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W02-1 } {Mon Monday 45 2045 1 02 02 1 02} test clock-3.674 {ISO week-based calendar 2045-W52-1} { clock format 2397772800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W52-1 } {Mon Monday 45 2045 1 52 52 1 52} test clock-3.675 {ISO week-based calendar 2045-W52-6} { clock format 2398204800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W52-6 } {Sat Saturday 45 2045 6 52 52 6 52} test clock-3.676 {ISO week-based calendar 2045-W52-7} { clock format 2398291200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2045-W52-7 } {Sun Sunday 45 2045 7 53 52 0 52} test clock-3.677 {ISO week-based calendar 2046-W01-1} { clock format 2398377600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W01-1 } {Mon Monday 46 2046 1 00 01 1 01} test clock-3.678 {ISO week-based calendar 2046-W01-6} { clock format 2398809600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W01-6 } {Sat Saturday 46 2046 6 00 01 6 01} test clock-3.679 {ISO week-based calendar 2046-W01-7} { clock format 2398896000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W01-7 } {Sun Sunday 46 2046 7 01 01 0 01} test clock-3.680 {ISO week-based calendar 2046-W02-1} { clock format 2398982400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W02-1 } {Mon Monday 46 2046 1 01 02 1 02} test clock-3.681 {ISO week-based calendar 2046-W52-1} { clock format 2429222400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W52-1 } {Mon Monday 46 2046 1 51 52 1 52} test clock-3.682 {ISO week-based calendar 2046-W52-6} { clock format 2429654400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W52-6 } {Sat Saturday 46 2046 6 51 52 6 52} test clock-3.683 {ISO week-based calendar 2046-W52-7} { clock format 2429740800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2046-W52-7 } {Sun Sunday 46 2046 7 52 52 0 52} test clock-3.684 {ISO week-based calendar 2047-W01-1} { clock format 2429827200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W01-1 } {Mon Monday 47 2047 1 52 01 1 53} test clock-3.685 {ISO week-based calendar 2047-W01-2} { clock format 2429913600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W01-2 } {Tue Tuesday 47 2047 2 00 01 2 00} test clock-3.686 {ISO week-based calendar 2047-W01-6} { clock format 2430259200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W01-6 } {Sat Saturday 47 2047 6 00 01 6 00} test clock-3.687 {ISO week-based calendar 2047-W01-7} { clock format 2430345600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W01-7 } {Sun Sunday 47 2047 7 01 01 0 00} test clock-3.688 {ISO week-based calendar 2047-W02-1} { clock format 2430432000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W02-1 } {Mon Monday 47 2047 1 01 02 1 01} test clock-3.689 {ISO week-based calendar 2047-W52-1} { clock format 2460672000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W52-1 } {Mon Monday 47 2047 1 51 52 1 51} test clock-3.690 {ISO week-based calendar 2047-W52-6} { clock format 2461104000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W52-6 } {Sat Saturday 47 2047 6 51 52 6 51} test clock-3.691 {ISO week-based calendar 2047-W52-7} { clock format 2461190400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2047-W52-7 } {Sun Sunday 47 2047 7 52 52 0 51} test clock-3.692 {ISO week-based calendar 2048-W01-1} { clock format 2461276800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W01-1 } {Mon Monday 48 2048 1 52 01 1 52} test clock-3.693 {ISO week-based calendar 2048-W01-3} { clock format 2461449600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W01-3 } {Wed Wednesday 48 2048 3 00 01 3 00} test clock-3.694 {ISO week-based calendar 2048-W01-6} { clock format 2461708800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W01-6 } {Sat Saturday 48 2048 6 00 01 6 00} test clock-3.695 {ISO week-based calendar 2048-W01-7} { clock format 2461795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W01-7 } {Sun Sunday 48 2048 7 01 01 0 00} test clock-3.696 {ISO week-based calendar 2048-W02-1} { clock format 2461881600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W02-1 } {Mon Monday 48 2048 1 01 02 1 01} test clock-3.697 {ISO week-based calendar 2048-W53-1} { clock format 2492726400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W53-1 } {Mon Monday 48 2048 1 52 53 1 52} test clock-3.698 {ISO week-based calendar 2048-W53-5} { clock format 2493072000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W53-5 } {Fri Friday 48 2048 5 00 53 5 00} test clock-3.699 {ISO week-based calendar 2048-W53-6} { clock format 2493158400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W53-6 } {Sat Saturday 48 2048 6 00 53 6 00} test clock-3.700 {ISO week-based calendar 2048-W53-7} { clock format 2493244800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2048-W53-7 } {Sun Sunday 48 2048 7 01 53 0 00} test clock-3.701 {ISO week-based calendar 2049-W01-1} { clock format 2493331200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2049-W01-1 } {Mon Monday 49 2049 1 01 01 1 01} test clock-3.702 {ISO week-based calendar 2049-W01-6} { clock format 2493763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2049-W01-6 } {Sat Saturday 49 2049 6 01 01 6 01} test clock-3.703 {ISO week-based calendar 2049-W01-7} { clock format 2493849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2049-W01-7 } {Sun Sunday 49 2049 7 02 01 0 01} test clock-3.704 {ISO week-based calendar 2049-W02-1} { clock format 2493936000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2049-W02-1 } {Mon Monday 49 2049 1 02 02 1 02} test clock-3.705 {ISO week-based calendar 2051-W52-1} { clock format 2587075200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2051-W52-1 } {Mon Monday 51 2051 1 52 52 1 52} test clock-3.706 {ISO week-based calendar 2051-W52-6} { clock format 2587507200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2051-W52-6 } {Sat Saturday 51 2051 6 52 52 6 52} test clock-3.707 {ISO week-based calendar 2051-W52-7} { clock format 2587593600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2051-W52-7 } {Sun Sunday 51 2051 7 53 52 0 52} test clock-3.708 {ISO week-based calendar 2052-W01-1} { clock format 2587680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W01-1 } {Mon Monday 52 2052 1 00 01 1 01} test clock-3.709 {ISO week-based calendar 2052-W01-6} { clock format 2588112000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W01-6 } {Sat Saturday 52 2052 6 00 01 6 01} test clock-3.710 {ISO week-based calendar 2052-W01-7} { clock format 2588198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W01-7 } {Sun Sunday 52 2052 7 01 01 0 01} test clock-3.711 {ISO week-based calendar 2052-W02-1} { clock format 2588284800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W02-1 } {Mon Monday 52 2052 1 01 02 1 02} test clock-3.712 {ISO week-based calendar 2052-W52-1} { clock format 2618524800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W52-1 } {Mon Monday 52 2052 1 51 52 1 52} test clock-3.713 {ISO week-based calendar 2052-W52-6} { clock format 2618956800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W52-6 } {Sat Saturday 52 2052 6 51 52 6 52} test clock-3.714 {ISO week-based calendar 2052-W52-7} { clock format 2619043200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2052-W52-7 } {Sun Sunday 52 2052 7 52 52 0 52} test clock-3.715 {ISO week-based calendar 2053-W01-1} { clock format 2619129600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2053-W01-1 } {Mon Monday 53 2053 1 52 01 1 53} test clock-3.716 {ISO week-based calendar 2053-W01-3} { clock format 2619302400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2053-W01-3 } {Wed Wednesday 53 2053 3 00 01 3 00} test clock-3.717 {ISO week-based calendar 2053-W01-6} { clock format 2619561600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2053-W01-6 } {Sat Saturday 53 2053 6 00 01 6 00} test clock-3.718 {ISO week-based calendar 2053-W01-7} { clock format 2619648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2053-W01-7 } {Sun Sunday 53 2053 7 01 01 0 00} test clock-3.719 {ISO week-based calendar 2053-W02-1} { clock format 2619734400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2053-W02-1 } {Mon Monday 53 2053 1 01 02 1 01} test clock-3.720 {ISO week-based calendar 2055-W52-1} { clock format 2713478400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2055-W52-1 } {Mon Monday 55 2055 1 52 52 1 52} test clock-3.721 {ISO week-based calendar 2055-W52-6} { clock format 2713910400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2055-W52-6 } {Sat Saturday 55 2055 6 00 52 6 00} test clock-3.722 {ISO week-based calendar 2055-W52-7} { clock format 2713996800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2055-W52-7 } {Sun Sunday 55 2055 7 01 52 0 00} test clock-3.723 {ISO week-based calendar 2056-W01-1} { clock format 2714083200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W01-1 } {Mon Monday 56 2056 1 01 01 1 01} test clock-3.724 {ISO week-based calendar 2056-W01-6} { clock format 2714515200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W01-6 } {Sat Saturday 56 2056 6 01 01 6 01} test clock-3.725 {ISO week-based calendar 2056-W01-7} { clock format 2714601600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W01-7 } {Sun Sunday 56 2056 7 02 01 0 01} test clock-3.726 {ISO week-based calendar 2056-W02-1} { clock format 2714688000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W02-1 } {Mon Monday 56 2056 1 02 02 1 02} test clock-3.727 {ISO week-based calendar 2056-W52-1} { clock format 2744928000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W52-1 } {Mon Monday 56 2056 1 52 52 1 52} test clock-3.728 {ISO week-based calendar 2056-W52-6} { clock format 2745360000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W52-6 } {Sat Saturday 56 2056 6 52 52 6 52} test clock-3.729 {ISO week-based calendar 2056-W52-7} { clock format 2745446400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2056-W52-7 } {Sun Sunday 56 2056 7 53 52 0 52} test clock-3.730 {ISO week-based calendar 2057-W01-1} { clock format 2745532800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2057-W01-1 } {Mon Monday 57 2057 1 00 01 1 01} test clock-3.731 {ISO week-based calendar 2057-W01-6} { clock format 2745964800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2057-W01-6 } {Sat Saturday 57 2057 6 00 01 6 01} test clock-3.732 {ISO week-based calendar 2057-W01-7} { clock format 2746051200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2057-W01-7 } {Sun Sunday 57 2057 7 01 01 0 01} test clock-3.733 {ISO week-based calendar 2057-W02-1} { clock format 2746137600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2057-W02-1 } {Mon Monday 57 2057 1 01 02 1 02} test clock-3.734 {ISO week-based calendar 2059-W52-1} { clock format 2839276800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2059-W52-1 } {Mon Monday 59 2059 1 51 52 1 51} test clock-3.735 {ISO week-based calendar 2059-W52-6} { clock format 2839708800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2059-W52-6 } {Sat Saturday 59 2059 6 51 52 6 51} test clock-3.736 {ISO week-based calendar 2059-W52-7} { clock format 2839795200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2059-W52-7 } {Sun Sunday 59 2059 7 52 52 0 51} test clock-3.737 {ISO week-based calendar 2060-W01-1} { clock format 2839881600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W01-1 } {Mon Monday 60 2060 1 52 01 1 52} test clock-3.738 {ISO week-based calendar 2060-W01-4} { clock format 2840140800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W01-4 } {Thu Thursday 60 2060 4 00 01 4 00} test clock-3.739 {ISO week-based calendar 2060-W01-6} { clock format 2840313600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W01-6 } {Sat Saturday 60 2060 6 00 01 6 00} test clock-3.740 {ISO week-based calendar 2060-W01-7} { clock format 2840400000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W01-7 } {Sun Sunday 60 2060 7 01 01 0 00} test clock-3.741 {ISO week-based calendar 2060-W02-1} { clock format 2840486400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W02-1 } {Mon Monday 60 2060 1 01 02 1 01} test clock-3.742 {ISO week-based calendar 2060-W53-1} { clock format 2871331200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W53-1 } {Mon Monday 60 2060 1 52 53 1 52} test clock-3.743 {ISO week-based calendar 2060-W53-6} { clock format 2871763200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W53-6 } {Sat Saturday 60 2060 6 00 53 6 00} test clock-3.744 {ISO week-based calendar 2060-W53-7} { clock format 2871849600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2060-W53-7 } {Sun Sunday 60 2060 7 01 53 0 00} test clock-3.745 {ISO week-based calendar 2061-W01-1} { clock format 2871936000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2061-W01-1 } {Mon Monday 61 2061 1 01 01 1 01} test clock-3.746 {ISO week-based calendar 2061-W01-6} { clock format 2872368000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2061-W01-6 } {Sat Saturday 61 2061 6 01 01 6 01} test clock-3.747 {ISO week-based calendar 2061-W01-7} { clock format 2872454400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2061-W01-7 } {Sun Sunday 61 2061 7 02 01 0 01} test clock-3.748 {ISO week-based calendar 2061-W02-1} { clock format 2872540800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2061-W02-1 } {Mon Monday 61 2061 1 02 02 1 02} test clock-3.749 {ISO week-based calendar 2063-W52-1} { clock format 2965680000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2063-W52-1 } {Mon Monday 63 2063 1 51 52 1 52} test clock-3.750 {ISO week-based calendar 2063-W52-6} { clock format 2966112000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2063-W52-6 } {Sat Saturday 63 2063 6 51 52 6 52} test clock-3.751 {ISO week-based calendar 2063-W52-7} { clock format 2966198400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2063-W52-7 } {Sun Sunday 63 2063 7 52 52 0 52} test clock-3.752 {ISO week-based calendar 2064-W01-1} { clock format 2966284800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W01-1 } {Mon Monday 64 2064 1 52 01 1 53} test clock-3.753 {ISO week-based calendar 2064-W01-2} { clock format 2966371200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W01-2 } {Tue Tuesday 64 2064 2 00 01 2 00} test clock-3.754 {ISO week-based calendar 2064-W01-6} { clock format 2966716800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W01-6 } {Sat Saturday 64 2064 6 00 01 6 00} test clock-3.755 {ISO week-based calendar 2064-W01-7} { clock format 2966803200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W01-7 } {Sun Sunday 64 2064 7 01 01 0 00} test clock-3.756 {ISO week-based calendar 2064-W02-1} { clock format 2966889600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W02-1 } {Mon Monday 64 2064 1 01 02 1 01} test clock-3.757 {ISO week-based calendar 2064-W52-1} { clock format 2997129600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W52-1 } {Mon Monday 64 2064 1 51 52 1 51} test clock-3.758 {ISO week-based calendar 2064-W52-6} { clock format 2997561600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W52-6 } {Sat Saturday 64 2064 6 51 52 6 51} test clock-3.759 {ISO week-based calendar 2064-W52-7} { clock format 2997648000 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2064-W52-7 } {Sun Sunday 64 2064 7 52 52 0 51} test clock-3.760 {ISO week-based calendar 2065-W01-1} { clock format 2997734400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2065-W01-1 } {Mon Monday 65 2065 1 52 01 1 52} test clock-3.761 {ISO week-based calendar 2065-W01-4} { clock format 2997993600 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2065-W01-4 } {Thu Thursday 65 2065 4 00 01 4 00} test clock-3.762 {ISO week-based calendar 2065-W01-6} { clock format 2998166400 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2065-W01-6 } {Sat Saturday 65 2065 6 00 01 6 00} test clock-3.763 {ISO week-based calendar 2065-W01-7} { clock format 2998252800 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2065-W01-7 } {Sun Sunday 65 2065 7 01 01 0 00} test clock-3.764 {ISO week-based calendar 2065-W02-1} { clock format 2998339200 -format {%a %A %g %G %u %U %V %w %W} -gmt true; # 2065-W02-1 } {Mon Monday 65 2065 1 01 02 1 01} # END testcases3 # BEGIN testcases4 # Test formatting of time of day # Format groups tested: %H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+ test clock-4.1 { format time of day 00:00:00 } { clock format 0 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 00 ? AM am 12:00:00 am 00:00 00 ? 00:00:00 00:00:00 ? h ? m ? s Thu Jan 1 00:00:00 GMT 1970} test clock-4.2 { format time of day 00:00:01 } { clock format 1 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 00 ? AM am 12:00:01 am 00:00 01 i 00:00:01 00:00:01 ? h ? m i s Thu Jan 1 00:00:01 GMT 1970} test clock-4.3 { format time of day 00:00:58 } { clock format 58 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 00 ? AM am 12:00:58 am 00:00 58 lviii 00:00:58 00:00:58 ? h ? m lviii s Thu Jan 1 00:00:58 GMT 1970} test clock-4.4 { format time of day 00:00:59 } { clock format 59 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 00 ? AM am 12:00:59 am 00:00 59 lix 00:00:59 00:00:59 ? h ? m lix s Thu Jan 1 00:00:59 GMT 1970} test clock-4.5 { format time of day 00:01:00 } { clock format 60 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 01 i AM am 12:01:00 am 00:01 00 ? 00:01:00 00:01:00 ? h i m ? s Thu Jan 1 00:01:00 GMT 1970} test clock-4.6 { format time of day 00:01:01 } { clock format 61 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 01 i AM am 12:01:01 am 00:01 01 i 00:01:01 00:01:01 ? h i m i s Thu Jan 1 00:01:01 GMT 1970} test clock-4.7 { format time of day 00:01:58 } { clock format 118 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 01 i AM am 12:01:58 am 00:01 58 lviii 00:01:58 00:01:58 ? h i m lviii s Thu Jan 1 00:01:58 GMT 1970} test clock-4.8 { format time of day 00:01:59 } { clock format 119 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 01 i AM am 12:01:59 am 00:01 59 lix 00:01:59 00:01:59 ? h i m lix s Thu Jan 1 00:01:59 GMT 1970} test clock-4.9 { format time of day 00:58:00 } { clock format 3480 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 58 lviii AM am 12:58:00 am 00:58 00 ? 00:58:00 00:58:00 ? h lviii m ? s Thu Jan 1 00:58:00 GMT 1970} test clock-4.10 { format time of day 00:58:01 } { clock format 3481 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 58 lviii AM am 12:58:01 am 00:58 01 i 00:58:01 00:58:01 ? h lviii m i s Thu Jan 1 00:58:01 GMT 1970} test clock-4.11 { format time of day 00:58:58 } { clock format 3538 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 58 lviii AM am 12:58:58 am 00:58 58 lviii 00:58:58 00:58:58 ? h lviii m lviii s Thu Jan 1 00:58:58 GMT 1970} test clock-4.12 { format time of day 00:58:59 } { clock format 3539 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 58 lviii AM am 12:58:59 am 00:58 59 lix 00:58:59 00:58:59 ? h lviii m lix s Thu Jan 1 00:58:59 GMT 1970} test clock-4.13 { format time of day 00:59:00 } { clock format 3540 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 59 lix AM am 12:59:00 am 00:59 00 ? 00:59:00 00:59:00 ? h lix m ? s Thu Jan 1 00:59:00 GMT 1970} test clock-4.14 { format time of day 00:59:01 } { clock format 3541 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 59 lix AM am 12:59:01 am 00:59 01 i 00:59:01 00:59:01 ? h lix m i s Thu Jan 1 00:59:01 GMT 1970} test clock-4.15 { format time of day 00:59:58 } { clock format 3598 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 59 lix AM am 12:59:58 am 00:59 58 lviii 00:59:58 00:59:58 ? h lix m lviii s Thu Jan 1 00:59:58 GMT 1970} test clock-4.16 { format time of day 00:59:59 } { clock format 3599 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {00 ? 12 xii 0 ? 12 xii 59 lix AM am 12:59:59 am 00:59 59 lix 00:59:59 00:59:59 ? h lix m lix s Thu Jan 1 00:59:59 GMT 1970} test clock-4.17 { format time of day 01:00:00 } { clock format 3600 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 00 ? AM am 01:00:00 am 01:00 00 ? 01:00:00 01:00:00 i h ? m ? s Thu Jan 1 01:00:00 GMT 1970} test clock-4.18 { format time of day 01:00:01 } { clock format 3601 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 00 ? AM am 01:00:01 am 01:00 01 i 01:00:01 01:00:01 i h ? m i s Thu Jan 1 01:00:01 GMT 1970} test clock-4.19 { format time of day 01:00:58 } { clock format 3658 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 00 ? AM am 01:00:58 am 01:00 58 lviii 01:00:58 01:00:58 i h ? m lviii s Thu Jan 1 01:00:58 GMT 1970} test clock-4.20 { format time of day 01:00:59 } { clock format 3659 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 00 ? AM am 01:00:59 am 01:00 59 lix 01:00:59 01:00:59 i h ? m lix s Thu Jan 1 01:00:59 GMT 1970} test clock-4.21 { format time of day 01:01:00 } { clock format 3660 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 01 i AM am 01:01:00 am 01:01 00 ? 01:01:00 01:01:00 i h i m ? s Thu Jan 1 01:01:00 GMT 1970} test clock-4.22 { format time of day 01:01:01 } { clock format 3661 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 01 i AM am 01:01:01 am 01:01 01 i 01:01:01 01:01:01 i h i m i s Thu Jan 1 01:01:01 GMT 1970} test clock-4.23 { format time of day 01:01:58 } { clock format 3718 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 01 i AM am 01:01:58 am 01:01 58 lviii 01:01:58 01:01:58 i h i m lviii s Thu Jan 1 01:01:58 GMT 1970} test clock-4.24 { format time of day 01:01:59 } { clock format 3719 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 01 i AM am 01:01:59 am 01:01 59 lix 01:01:59 01:01:59 i h i m lix s Thu Jan 1 01:01:59 GMT 1970} test clock-4.25 { format time of day 01:58:00 } { clock format 7080 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 58 lviii AM am 01:58:00 am 01:58 00 ? 01:58:00 01:58:00 i h lviii m ? s Thu Jan 1 01:58:00 GMT 1970} test clock-4.26 { format time of day 01:58:01 } { clock format 7081 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 58 lviii AM am 01:58:01 am 01:58 01 i 01:58:01 01:58:01 i h lviii m i s Thu Jan 1 01:58:01 GMT 1970} test clock-4.27 { format time of day 01:58:58 } { clock format 7138 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 58 lviii AM am 01:58:58 am 01:58 58 lviii 01:58:58 01:58:58 i h lviii m lviii s Thu Jan 1 01:58:58 GMT 1970} test clock-4.28 { format time of day 01:58:59 } { clock format 7139 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 58 lviii AM am 01:58:59 am 01:58 59 lix 01:58:59 01:58:59 i h lviii m lix s Thu Jan 1 01:58:59 GMT 1970} test clock-4.29 { format time of day 01:59:00 } { clock format 7140 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 59 lix AM am 01:59:00 am 01:59 00 ? 01:59:00 01:59:00 i h lix m ? s Thu Jan 1 01:59:00 GMT 1970} test clock-4.30 { format time of day 01:59:01 } { clock format 7141 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 59 lix AM am 01:59:01 am 01:59 01 i 01:59:01 01:59:01 i h lix m i s Thu Jan 1 01:59:01 GMT 1970} test clock-4.31 { format time of day 01:59:58 } { clock format 7198 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 59 lix AM am 01:59:58 am 01:59 58 lviii 01:59:58 01:59:58 i h lix m lviii s Thu Jan 1 01:59:58 GMT 1970} test clock-4.32 { format time of day 01:59:59 } { clock format 7199 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {01 i 01 i 1 i 1 i 59 lix AM am 01:59:59 am 01:59 59 lix 01:59:59 01:59:59 i h lix m lix s Thu Jan 1 01:59:59 GMT 1970} test clock-4.33 { format time of day 11:00:00 } { clock format 39600 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 00 ? AM am 11:00:00 am 11:00 00 ? 11:00:00 11:00:00 xi h ? m ? s Thu Jan 1 11:00:00 GMT 1970} test clock-4.34 { format time of day 11:00:01 } { clock format 39601 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 00 ? AM am 11:00:01 am 11:00 01 i 11:00:01 11:00:01 xi h ? m i s Thu Jan 1 11:00:01 GMT 1970} test clock-4.35 { format time of day 11:00:58 } { clock format 39658 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 00 ? AM am 11:00:58 am 11:00 58 lviii 11:00:58 11:00:58 xi h ? m lviii s Thu Jan 1 11:00:58 GMT 1970} test clock-4.36 { format time of day 11:00:59 } { clock format 39659 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 00 ? AM am 11:00:59 am 11:00 59 lix 11:00:59 11:00:59 xi h ? m lix s Thu Jan 1 11:00:59 GMT 1970} test clock-4.37 { format time of day 11:01:00 } { clock format 39660 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 01 i AM am 11:01:00 am 11:01 00 ? 11:01:00 11:01:00 xi h i m ? s Thu Jan 1 11:01:00 GMT 1970} test clock-4.38 { format time of day 11:01:01 } { clock format 39661 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 01 i AM am 11:01:01 am 11:01 01 i 11:01:01 11:01:01 xi h i m i s Thu Jan 1 11:01:01 GMT 1970} test clock-4.39 { format time of day 11:01:58 } { clock format 39718 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 01 i AM am 11:01:58 am 11:01 58 lviii 11:01:58 11:01:58 xi h i m lviii s Thu Jan 1 11:01:58 GMT 1970} test clock-4.40 { format time of day 11:01:59 } { clock format 39719 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 01 i AM am 11:01:59 am 11:01 59 lix 11:01:59 11:01:59 xi h i m lix s Thu Jan 1 11:01:59 GMT 1970} test clock-4.41 { format time of day 11:58:00 } { clock format 43080 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 58 lviii AM am 11:58:00 am 11:58 00 ? 11:58:00 11:58:00 xi h lviii m ? s Thu Jan 1 11:58:00 GMT 1970} test clock-4.42 { format time of day 11:58:01 } { clock format 43081 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 58 lviii AM am 11:58:01 am 11:58 01 i 11:58:01 11:58:01 xi h lviii m i s Thu Jan 1 11:58:01 GMT 1970} test clock-4.43 { format time of day 11:58:58 } { clock format 43138 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 58 lviii AM am 11:58:58 am 11:58 58 lviii 11:58:58 11:58:58 xi h lviii m lviii s Thu Jan 1 11:58:58 GMT 1970} test clock-4.44 { format time of day 11:58:59 } { clock format 43139 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 58 lviii AM am 11:58:59 am 11:58 59 lix 11:58:59 11:58:59 xi h lviii m lix s Thu Jan 1 11:58:59 GMT 1970} test clock-4.45 { format time of day 11:59:00 } { clock format 43140 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 59 lix AM am 11:59:00 am 11:59 00 ? 11:59:00 11:59:00 xi h lix m ? s Thu Jan 1 11:59:00 GMT 1970} test clock-4.46 { format time of day 11:59:01 } { clock format 43141 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 59 lix AM am 11:59:01 am 11:59 01 i 11:59:01 11:59:01 xi h lix m i s Thu Jan 1 11:59:01 GMT 1970} test clock-4.47 { format time of day 11:59:58 } { clock format 43198 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 59 lix AM am 11:59:58 am 11:59 58 lviii 11:59:58 11:59:58 xi h lix m lviii s Thu Jan 1 11:59:58 GMT 1970} test clock-4.48 { format time of day 11:59:59 } { clock format 43199 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {11 xi 11 xi 11 xi 11 xi 59 lix AM am 11:59:59 am 11:59 59 lix 11:59:59 11:59:59 xi h lix m lix s Thu Jan 1 11:59:59 GMT 1970} test clock-4.49 { format time of day 12:00:00 } { clock format 43200 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 00 ? PM pm 12:00:00 pm 12:00 00 ? 12:00:00 12:00:00 xii h ? m ? s Thu Jan 1 12:00:00 GMT 1970} test clock-4.50 { format time of day 12:00:01 } { clock format 43201 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 00 ? PM pm 12:00:01 pm 12:00 01 i 12:00:01 12:00:01 xii h ? m i s Thu Jan 1 12:00:01 GMT 1970} test clock-4.51 { format time of day 12:00:58 } { clock format 43258 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 00 ? PM pm 12:00:58 pm 12:00 58 lviii 12:00:58 12:00:58 xii h ? m lviii s Thu Jan 1 12:00:58 GMT 1970} test clock-4.52 { format time of day 12:00:59 } { clock format 43259 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 00 ? PM pm 12:00:59 pm 12:00 59 lix 12:00:59 12:00:59 xii h ? m lix s Thu Jan 1 12:00:59 GMT 1970} test clock-4.53 { format time of day 12:01:00 } { clock format 43260 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 01 i PM pm 12:01:00 pm 12:01 00 ? 12:01:00 12:01:00 xii h i m ? s Thu Jan 1 12:01:00 GMT 1970} test clock-4.54 { format time of day 12:01:01 } { clock format 43261 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 01 i PM pm 12:01:01 pm 12:01 01 i 12:01:01 12:01:01 xii h i m i s Thu Jan 1 12:01:01 GMT 1970} test clock-4.55 { format time of day 12:01:58 } { clock format 43318 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 01 i PM pm 12:01:58 pm 12:01 58 lviii 12:01:58 12:01:58 xii h i m lviii s Thu Jan 1 12:01:58 GMT 1970} test clock-4.56 { format time of day 12:01:59 } { clock format 43319 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 01 i PM pm 12:01:59 pm 12:01 59 lix 12:01:59 12:01:59 xii h i m lix s Thu Jan 1 12:01:59 GMT 1970} test clock-4.57 { format time of day 12:58:00 } { clock format 46680 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 58 lviii PM pm 12:58:00 pm 12:58 00 ? 12:58:00 12:58:00 xii h lviii m ? s Thu Jan 1 12:58:00 GMT 1970} test clock-4.58 { format time of day 12:58:01 } { clock format 46681 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 58 lviii PM pm 12:58:01 pm 12:58 01 i 12:58:01 12:58:01 xii h lviii m i s Thu Jan 1 12:58:01 GMT 1970} test clock-4.59 { format time of day 12:58:58 } { clock format 46738 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 58 lviii PM pm 12:58:58 pm 12:58 58 lviii 12:58:58 12:58:58 xii h lviii m lviii s Thu Jan 1 12:58:58 GMT 1970} test clock-4.60 { format time of day 12:58:59 } { clock format 46739 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 58 lviii PM pm 12:58:59 pm 12:58 59 lix 12:58:59 12:58:59 xii h lviii m lix s Thu Jan 1 12:58:59 GMT 1970} test clock-4.61 { format time of day 12:59:00 } { clock format 46740 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 59 lix PM pm 12:59:00 pm 12:59 00 ? 12:59:00 12:59:00 xii h lix m ? s Thu Jan 1 12:59:00 GMT 1970} test clock-4.62 { format time of day 12:59:01 } { clock format 46741 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 59 lix PM pm 12:59:01 pm 12:59 01 i 12:59:01 12:59:01 xii h lix m i s Thu Jan 1 12:59:01 GMT 1970} test clock-4.63 { format time of day 12:59:58 } { clock format 46798 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 59 lix PM pm 12:59:58 pm 12:59 58 lviii 12:59:58 12:59:58 xii h lix m lviii s Thu Jan 1 12:59:58 GMT 1970} test clock-4.64 { format time of day 12:59:59 } { clock format 46799 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {12 xii 12 xii 12 xii 12 xii 59 lix PM pm 12:59:59 pm 12:59 59 lix 12:59:59 12:59:59 xii h lix m lix s Thu Jan 1 12:59:59 GMT 1970} test clock-4.65 { format time of day 13:00:00 } { clock format 46800 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 00 ? PM pm 01:00:00 pm 13:00 00 ? 13:00:00 13:00:00 xiii h ? m ? s Thu Jan 1 13:00:00 GMT 1970} test clock-4.66 { format time of day 13:00:01 } { clock format 46801 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 00 ? PM pm 01:00:01 pm 13:00 01 i 13:00:01 13:00:01 xiii h ? m i s Thu Jan 1 13:00:01 GMT 1970} test clock-4.67 { format time of day 13:00:58 } { clock format 46858 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 00 ? PM pm 01:00:58 pm 13:00 58 lviii 13:00:58 13:00:58 xiii h ? m lviii s Thu Jan 1 13:00:58 GMT 1970} test clock-4.68 { format time of day 13:00:59 } { clock format 46859 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 00 ? PM pm 01:00:59 pm 13:00 59 lix 13:00:59 13:00:59 xiii h ? m lix s Thu Jan 1 13:00:59 GMT 1970} test clock-4.69 { format time of day 13:01:00 } { clock format 46860 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 01 i PM pm 01:01:00 pm 13:01 00 ? 13:01:00 13:01:00 xiii h i m ? s Thu Jan 1 13:01:00 GMT 1970} test clock-4.70 { format time of day 13:01:01 } { clock format 46861 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 01 i PM pm 01:01:01 pm 13:01 01 i 13:01:01 13:01:01 xiii h i m i s Thu Jan 1 13:01:01 GMT 1970} test clock-4.71 { format time of day 13:01:58 } { clock format 46918 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 01 i PM pm 01:01:58 pm 13:01 58 lviii 13:01:58 13:01:58 xiii h i m lviii s Thu Jan 1 13:01:58 GMT 1970} test clock-4.72 { format time of day 13:01:59 } { clock format 46919 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 01 i PM pm 01:01:59 pm 13:01 59 lix 13:01:59 13:01:59 xiii h i m lix s Thu Jan 1 13:01:59 GMT 1970} test clock-4.73 { format time of day 13:58:00 } { clock format 50280 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 58 lviii PM pm 01:58:00 pm 13:58 00 ? 13:58:00 13:58:00 xiii h lviii m ? s Thu Jan 1 13:58:00 GMT 1970} test clock-4.74 { format time of day 13:58:01 } { clock format 50281 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 58 lviii PM pm 01:58:01 pm 13:58 01 i 13:58:01 13:58:01 xiii h lviii m i s Thu Jan 1 13:58:01 GMT 1970} test clock-4.75 { format time of day 13:58:58 } { clock format 50338 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 58 lviii PM pm 01:58:58 pm 13:58 58 lviii 13:58:58 13:58:58 xiii h lviii m lviii s Thu Jan 1 13:58:58 GMT 1970} test clock-4.76 { format time of day 13:58:59 } { clock format 50339 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 58 lviii PM pm 01:58:59 pm 13:58 59 lix 13:58:59 13:58:59 xiii h lviii m lix s Thu Jan 1 13:58:59 GMT 1970} test clock-4.77 { format time of day 13:59:00 } { clock format 50340 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 59 lix PM pm 01:59:00 pm 13:59 00 ? 13:59:00 13:59:00 xiii h lix m ? s Thu Jan 1 13:59:00 GMT 1970} test clock-4.78 { format time of day 13:59:01 } { clock format 50341 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 59 lix PM pm 01:59:01 pm 13:59 01 i 13:59:01 13:59:01 xiii h lix m i s Thu Jan 1 13:59:01 GMT 1970} test clock-4.79 { format time of day 13:59:58 } { clock format 50398 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 59 lix PM pm 01:59:58 pm 13:59 58 lviii 13:59:58 13:59:58 xiii h lix m lviii s Thu Jan 1 13:59:58 GMT 1970} test clock-4.80 { format time of day 13:59:59 } { clock format 50399 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {13 xiii 01 i 13 xiii 1 i 59 lix PM pm 01:59:59 pm 13:59 59 lix 13:59:59 13:59:59 xiii h lix m lix s Thu Jan 1 13:59:59 GMT 1970} test clock-4.81 { format time of day 23:00:00 } { clock format 82800 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 00 ? PM pm 11:00:00 pm 23:00 00 ? 23:00:00 23:00:00 xxiii h ? m ? s Thu Jan 1 23:00:00 GMT 1970} test clock-4.82 { format time of day 23:00:01 } { clock format 82801 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 00 ? PM pm 11:00:01 pm 23:00 01 i 23:00:01 23:00:01 xxiii h ? m i s Thu Jan 1 23:00:01 GMT 1970} test clock-4.83 { format time of day 23:00:58 } { clock format 82858 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 00 ? PM pm 11:00:58 pm 23:00 58 lviii 23:00:58 23:00:58 xxiii h ? m lviii s Thu Jan 1 23:00:58 GMT 1970} test clock-4.84 { format time of day 23:00:59 } { clock format 82859 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 00 ? PM pm 11:00:59 pm 23:00 59 lix 23:00:59 23:00:59 xxiii h ? m lix s Thu Jan 1 23:00:59 GMT 1970} test clock-4.85 { format time of day 23:01:00 } { clock format 82860 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 01 i PM pm 11:01:00 pm 23:01 00 ? 23:01:00 23:01:00 xxiii h i m ? s Thu Jan 1 23:01:00 GMT 1970} test clock-4.86 { format time of day 23:01:01 } { clock format 82861 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 01 i PM pm 11:01:01 pm 23:01 01 i 23:01:01 23:01:01 xxiii h i m i s Thu Jan 1 23:01:01 GMT 1970} test clock-4.87 { format time of day 23:01:58 } { clock format 82918 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 01 i PM pm 11:01:58 pm 23:01 58 lviii 23:01:58 23:01:58 xxiii h i m lviii s Thu Jan 1 23:01:58 GMT 1970} test clock-4.88 { format time of day 23:01:59 } { clock format 82919 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 01 i PM pm 11:01:59 pm 23:01 59 lix 23:01:59 23:01:59 xxiii h i m lix s Thu Jan 1 23:01:59 GMT 1970} test clock-4.89 { format time of day 23:58:00 } { clock format 86280 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 58 lviii PM pm 11:58:00 pm 23:58 00 ? 23:58:00 23:58:00 xxiii h lviii m ? s Thu Jan 1 23:58:00 GMT 1970} test clock-4.90 { format time of day 23:58:01 } { clock format 86281 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 58 lviii PM pm 11:58:01 pm 23:58 01 i 23:58:01 23:58:01 xxiii h lviii m i s Thu Jan 1 23:58:01 GMT 1970} test clock-4.91 { format time of day 23:58:58 } { clock format 86338 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 58 lviii PM pm 11:58:58 pm 23:58 58 lviii 23:58:58 23:58:58 xxiii h lviii m lviii s Thu Jan 1 23:58:58 GMT 1970} test clock-4.92 { format time of day 23:58:59 } { clock format 86339 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 58 lviii PM pm 11:58:59 pm 23:58 59 lix 23:58:59 23:58:59 xxiii h lviii m lix s Thu Jan 1 23:58:59 GMT 1970} test clock-4.93 { format time of day 23:59:00 } { clock format 86340 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 59 lix PM pm 11:59:00 pm 23:59 00 ? 23:59:00 23:59:00 xxiii h lix m ? s Thu Jan 1 23:59:00 GMT 1970} test clock-4.94 { format time of day 23:59:01 } { clock format 86341 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 59 lix PM pm 11:59:01 pm 23:59 01 i 23:59:01 23:59:01 xxiii h lix m i s Thu Jan 1 23:59:01 GMT 1970} test clock-4.95 { format time of day 23:59:58 } { clock format 86398 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 59 lix PM pm 11:59:58 pm 23:59 58 lviii 23:59:58 23:59:58 xxiii h lix m lviii s Thu Jan 1 23:59:58 GMT 1970} test clock-4.96 { format time of day 23:59:59 } { clock format 86399 \ -format {%H %OH %I %OI %k %Ok %l %Ol %M %OM %p %P %r %R %S %OS %T %X %EX %+} \ -locale en_US_roman \ -gmt true } {23 xxiii 11 xi 23 xxiii 11 xi 59 lix PM pm 11:59:59 pm 23:59 59 lix 23:59:59 23:59:59 xxiii h lix m lix s Thu Jan 1 23:59:59 GMT 1970} test clock-4.97.1 { format JDN/JD (calendar and astronomical) } { clock format 0 -format {%J %EJ %Ej} -gmt true } {2440588 2440588.0 2440587.5} test clock-4.97.2 { format JDN/JD (calendar and astronomical) } { clock format 43200 -format {%J %EJ %Ej} -gmt true } {2440588 2440588.5 2440588.0} test clock-4.97.3 { format JDN/JD (calendar and astronomical) } { clock format 86399 -format {%J %EJ %Ej} -gmt true } {2440588 2440588.99998843 2440588.49998843} test clock-4.97.4 { format JDN/JD (calendar and astronomical) } { clock format 86400 -format {%J %EJ %Ej} -gmt true } {2440589 2440589.0 2440588.5} test clock-4.97.5 { format JDN/JD (calendar and astronomical) } { clock format 129599 -format {%J %EJ %Ej} -gmt true } {2440589 2440589.49998843 2440588.99998843} test clock-4.97.6 { format JDN/JD (calendar and astronomical) } { clock format 129600 -format {%J %EJ %Ej} -gmt true } {2440589 2440589.5 2440589.0} test clock-4.97.7 { format JDN/JD (calendar and astronomical) } { set i 1548249092 list \ [clock format $i -format {%J %EJ %Ej} -gmt true] \ [clock format [incr i] -format {%J %EJ %Ej} -gmt true] \ [clock format [incr i] -format {%J %EJ %Ej} -gmt true] } {{2458507 2458507.54967593 2458507.04967593} {2458507 2458507.5496875 2458507.0496875} {2458507 2458507.54969907 2458507.04969907}} test clock-4.97.8 { format JDN/JD (calendar and astronomical) } { set res {} foreach i { -172800 -129600 -86400 -43200 -1 0 1 21600 43199 43200 86399 86400 86401 108000 129600 172800 } { lappend res $i [clock format [expr {-210866803200 - $i}] \ -format {%EE %Y-%m-%d %T -- %J %EJ %Ej} -gmt true] } set res } [list \ -172800 {B.C.E. 4713-01-03 00:00:00 -- 0000002 2.0 1.5} \ -129600 {B.C.E. 4713-01-02 12:00:00 -- 0000001 1.5 1.0} \ -86400 {B.C.E. 4713-01-02 00:00:00 -- 0000001 1.0 0.5} \ -43200 {B.C.E. 4713-01-01 12:00:00 -- 0000000 0.5 0.0} \ -1 {B.C.E. 4713-01-01 00:00:01 -- 0000000 0.00001157 -0.49998843} \ 0 {B.C.E. 4713-01-01 00:00:00 -- 0000000 0.0 -0.5} \ 1 {B.C.E. 4714-12-31 23:59:59 -- -000001 -0.00001157 -0.50001157} \ 21600 {B.C.E. 4714-12-31 18:00:00 -- -000001 -0.25 -0.75} \ 43199 {B.C.E. 4714-12-31 12:00:01 -- -000001 -0.49998843 -0.99998843} \ 43200 {B.C.E. 4714-12-31 12:00:00 -- -000001 -0.5 -1.0} \ 86399 {B.C.E. 4714-12-31 00:00:01 -- -000001 -0.99998843 -1.49998843} \ 86400 {B.C.E. 4714-12-31 00:00:00 -- -000001 -1.0 -1.5} \ 86401 {B.C.E. 4714-12-30 23:59:59 -- -000002 -1.00001157 -1.50001157} \ 108000 {B.C.E. 4714-12-30 18:00:00 -- -000002 -1.25 -1.75} \ 129600 {B.C.E. 4714-12-30 12:00:00 -- -000002 -1.5 -2.0} \ 172800 {B.C.E. 4714-12-30 00:00:00 -- -000002 -2.0 -2.5} \ ] test clock-4.97.9 { format JDN/JD (calendar and astronomical) } { set res {} foreach i { -86400 -43200 -1 0 1 43199 43200 43201 86400 } { lappend res $i [clock format [expr {653133196800 + $i}] \ -format {%Y-%m-%d %T -- %J %EJ %Ej} -gmt true] } set res } [list \ -86400 {22666-12-19 00:00:00 -- 9999999 9999999.0 9999998.5} \ -43200 {22666-12-19 12:00:00 -- 9999999 9999999.5 9999999.0} \ -1 {22666-12-19 23:59:59 -- 9999999 9999999.99998843 9999999.49998843} \ 0 {22666-12-20 00:00:00 -- 10000000 10000000.0 9999999.5} \ 1 {22666-12-20 00:00:01 -- 10000000 10000000.00001157 9999999.50001157} \ 43199 {22666-12-20 11:59:59 -- 10000000 10000000.49998843 9999999.99998843} \ 43200 {22666-12-20 12:00:00 -- 10000000 10000000.5 10000000.0} \ 43201 {22666-12-20 12:00:01 -- 10000000 10000000.50001157 10000000.00001157} \ 86400 {22666-12-21 00:00:00 -- 10000001 10000001.0 10000000.5} \ ] # END testcases4 # BEGIN testcases5 # Test formatting of Daylight Saving Time test clock-5.1 {does Detroit exist} { clock format 0 -format {} -timezone :America/Detroit concat } {} test clock-5.2 {does Detroit have a Y2038 problem} detroit { if { [clock format 2158894800 -format %z -timezone :America/Detroit] ne {-0400} } { concat {y2038 problem} } else { concat {ok} } } ok test clock-5.3 {time zone boundary case 1904-12-31 23:59:59} detroit { clock format -2051202470 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:59:59 -053211 LMT} test clock-5.4 {time zone boundary case 1904-12-31 23:32:11} detroit { clock format -2051202469 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:32:11 -0600 CST} test clock-5.5 {time zone boundary case 1904-12-31 23:32:12} detroit { clock format -2051202468 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:32:12 -0600 CST} test clock-5.6 {time zone boundary case 1915-05-15 01:59:59} detroit { clock format -1724083201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0600 CST} test clock-5.7 {time zone boundary case 1915-05-15 03:00:00} detroit { clock format -1724083200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0500 EST} test clock-5.8 {time zone boundary case 1915-05-15 03:00:01} detroit { clock format -1724083199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0500 EST} test clock-5.9 {time zone boundary case 1941-12-31 23:59:59} detroit { clock format -883594801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:59:59 -0500 EST} test clock-5.10 {time zone boundary case 1942-01-01 00:00:00} detroit { clock format -883594800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:00 -0500 EST} test clock-5.11 {time zone boundary case 1942-01-01 00:00:01} detroit { clock format -883594799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:01 -0500 EST} test clock-5.12 {time zone boundary case 1942-02-09 01:59:59} detroit { clock format -880218001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.13 {time zone boundary case 1942-02-09 03:00:00} detroit { clock format -880218000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EWT} test clock-5.14 {time zone boundary case 1942-02-09 03:00:01} detroit { clock format -880217999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EWT} test clock-5.15 {time zone boundary case 1945-08-14 18:59:59} detroit { clock format -769395601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {18:59:59 -0400 EWT} test clock-5.16 {time zone boundary case 1945-08-14 19:00:00} detroit { clock format -769395600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {19:00:00 -0400 EPT} test clock-5.17 {time zone boundary case 1945-08-14 19:00:01} detroit { clock format -769395599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {19:00:01 -0400 EPT} test clock-5.18 {time zone boundary case 1945-09-30 01:59:59} detroit { clock format -765396001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EPT} test clock-5.19 {time zone boundary case 1945-09-30 01:00:00} detroit { clock format -765396000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.20 {time zone boundary case 1945-09-30 01:00:01} detroit { clock format -765395999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.21 {time zone boundary case 1945-12-31 23:59:59} detroit { clock format -757364401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:59:59 -0500 EST} test clock-5.22 {time zone boundary case 1946-01-01 00:00:00} detroit { clock format -757364400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:00 -0500 EST} test clock-5.23 {time zone boundary case 1946-01-01 00:00:01} detroit { clock format -757364399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:01 -0500 EST} test clock-5.24 {time zone boundary case 1948-04-25 01:59:59} detroit { clock format -684349201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.25 {time zone boundary case 1948-04-25 03:00:00} detroit { clock format -684349200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.26 {time zone boundary case 1948-04-25 03:00:01} detroit { clock format -684349199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.27 {time zone boundary case 1948-09-26 01:59:59} detroit { clock format -671047201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.28 {time zone boundary case 1948-09-26 01:00:00} detroit { clock format -671047200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.29 {time zone boundary case 1948-09-26 01:00:01} detroit { clock format -671047199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} # Detroit did not observe Daylight Saving Time in 1967 test clock-5.36 {time zone boundary case 1972-12-31 23:59:59} detroit { clock format 94712399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:59:59 -0500 EST} test clock-5.37 {time zone boundary case 1973-01-01 00:00:00} detroit { clock format 94712400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:00 -0500 EST} test clock-5.38 {time zone boundary case 1973-01-01 00:00:01} detroit { clock format 94712401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:01 -0500 EST} test clock-5.39 {time zone boundary case 1973-04-29 01:59:59} detroit { clock format 104914799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.40 {time zone boundary case 1973-04-29 03:00:00} detroit { clock format 104914800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.41 {time zone boundary case 1973-04-29 03:00:01} detroit { clock format 104914801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.42 {time zone boundary case 1973-10-28 01:59:59} detroit { clock format 120635999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.43 {time zone boundary case 1973-10-28 01:00:00} detroit { clock format 120636000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.44 {time zone boundary case 1973-10-28 01:00:01} detroit { clock format 120636001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.45 {time zone boundary case 1974-01-06 01:59:59} detroit { clock format 126687599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.46 {time zone boundary case 1974-01-06 03:00:00} detroit { clock format 126687600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.47 {time zone boundary case 1974-01-06 03:00:01} detroit { clock format 126687601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.48 {time zone boundary case 1974-10-27 01:59:59} detroit { clock format 152085599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.49 {time zone boundary case 1974-10-27 01:00:00} detroit { clock format 152085600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.50 {time zone boundary case 1974-10-27 01:00:01} detroit { clock format 152085601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.51 {time zone boundary case 1974-12-31 23:59:59} detroit { clock format 157784399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {23:59:59 -0500 EST} test clock-5.52 {time zone boundary case 1975-01-01 00:00:00} detroit { clock format 157784400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:00 -0500 EST} test clock-5.53 {time zone boundary case 1975-01-01 00:00:01} detroit { clock format 157784401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {00:00:01 -0500 EST} test clock-5.54 {time zone boundary case 1975-04-27 01:59:59} detroit { clock format 167813999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.55 {time zone boundary case 1975-04-27 03:00:00} detroit { clock format 167814000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.56 {time zone boundary case 1975-04-27 03:00:01} detroit { clock format 167814001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.57 {time zone boundary case 1975-10-26 01:59:59} detroit { clock format 183535199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.58 {time zone boundary case 1975-10-26 01:00:00} detroit { clock format 183535200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.59 {time zone boundary case 1975-10-26 01:00:01} detroit { clock format 183535201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.60 {time zone boundary case 1976-04-25 01:59:59} detroit { clock format 199263599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.61 {time zone boundary case 1976-04-25 03:00:00} detroit { clock format 199263600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.62 {time zone boundary case 1976-04-25 03:00:01} detroit { clock format 199263601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.63 {time zone boundary case 1976-10-31 01:59:59} detroit { clock format 215589599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.64 {time zone boundary case 1976-10-31 01:00:00} detroit { clock format 215589600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.65 {time zone boundary case 1976-10-31 01:00:01} detroit { clock format 215589601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.66 {time zone boundary case 1977-04-24 01:59:59} detroit { clock format 230713199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.67 {time zone boundary case 1977-04-24 03:00:00} detroit { clock format 230713200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.68 {time zone boundary case 1977-04-24 03:00:01} detroit { clock format 230713201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.69 {time zone boundary case 1977-10-30 01:59:59} detroit { clock format 247039199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.70 {time zone boundary case 1977-10-30 01:00:00} detroit { clock format 247039200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.71 {time zone boundary case 1977-10-30 01:00:01} detroit { clock format 247039201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.72 {time zone boundary case 1978-04-30 01:59:59} detroit { clock format 262767599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.73 {time zone boundary case 1978-04-30 03:00:00} detroit { clock format 262767600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.74 {time zone boundary case 1978-04-30 03:00:01} detroit { clock format 262767601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.75 {time zone boundary case 1978-10-29 01:59:59} detroit { clock format 278488799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.76 {time zone boundary case 1978-10-29 01:00:00} detroit { clock format 278488800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.77 {time zone boundary case 1978-10-29 01:00:01} detroit { clock format 278488801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.78 {time zone boundary case 1979-04-29 01:59:59} detroit { clock format 294217199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.79 {time zone boundary case 1979-04-29 03:00:00} detroit { clock format 294217200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.80 {time zone boundary case 1979-04-29 03:00:01} detroit { clock format 294217201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.81 {time zone boundary case 1979-10-28 01:59:59} detroit { clock format 309938399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.82 {time zone boundary case 1979-10-28 01:00:00} detroit { clock format 309938400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.83 {time zone boundary case 1979-10-28 01:00:01} detroit { clock format 309938401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.84 {time zone boundary case 1980-04-27 01:59:59} detroit { clock format 325666799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.85 {time zone boundary case 1980-04-27 03:00:00} detroit { clock format 325666800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.86 {time zone boundary case 1980-04-27 03:00:01} detroit { clock format 325666801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.87 {time zone boundary case 1980-10-26 01:59:59} detroit { clock format 341387999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.88 {time zone boundary case 1980-10-26 01:00:00} detroit { clock format 341388000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.89 {time zone boundary case 1980-10-26 01:00:01} detroit { clock format 341388001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.90 {time zone boundary case 1981-04-26 01:59:59} detroit { clock format 357116399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.91 {time zone boundary case 1981-04-26 03:00:00} detroit { clock format 357116400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.92 {time zone boundary case 1981-04-26 03:00:01} detroit { clock format 357116401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.93 {time zone boundary case 1981-10-25 01:59:59} detroit { clock format 372837599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.94 {time zone boundary case 1981-10-25 01:00:00} detroit { clock format 372837600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.95 {time zone boundary case 1981-10-25 01:00:01} detroit { clock format 372837601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.96 {time zone boundary case 1982-04-25 01:59:59} detroit { clock format 388565999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.97 {time zone boundary case 1982-04-25 03:00:00} detroit { clock format 388566000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.98 {time zone boundary case 1982-04-25 03:00:01} detroit { clock format 388566001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.99 {time zone boundary case 1982-10-31 01:59:59} detroit { clock format 404891999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.100 {time zone boundary case 1982-10-31 01:00:00} detroit { clock format 404892000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.101 {time zone boundary case 1982-10-31 01:00:01} detroit { clock format 404892001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.102 {time zone boundary case 1983-04-24 01:59:59} detroit { clock format 420015599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.103 {time zone boundary case 1983-04-24 03:00:00} detroit { clock format 420015600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.104 {time zone boundary case 1983-04-24 03:00:01} detroit { clock format 420015601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.105 {time zone boundary case 1983-10-30 01:59:59} detroit { clock format 436341599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.106 {time zone boundary case 1983-10-30 01:00:00} detroit { clock format 436341600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.107 {time zone boundary case 1983-10-30 01:00:01} detroit { clock format 436341601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.108 {time zone boundary case 1984-04-29 01:59:59} detroit { clock format 452069999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.109 {time zone boundary case 1984-04-29 03:00:00} detroit { clock format 452070000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.110 {time zone boundary case 1984-04-29 03:00:01} detroit { clock format 452070001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.111 {time zone boundary case 1984-10-28 01:59:59} detroit { clock format 467791199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.112 {time zone boundary case 1984-10-28 01:00:00} detroit { clock format 467791200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.113 {time zone boundary case 1984-10-28 01:00:01} detroit { clock format 467791201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.114 {time zone boundary case 1985-04-28 01:59:59} detroit { clock format 483519599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.115 {time zone boundary case 1985-04-28 03:00:00} detroit { clock format 483519600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.116 {time zone boundary case 1985-04-28 03:00:01} detroit { clock format 483519601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.117 {time zone boundary case 1985-10-27 01:59:59} detroit { clock format 499240799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.118 {time zone boundary case 1985-10-27 01:00:00} detroit { clock format 499240800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.119 {time zone boundary case 1985-10-27 01:00:01} detroit { clock format 499240801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.120 {time zone boundary case 1986-04-27 01:59:59} detroit { clock format 514969199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.121 {time zone boundary case 1986-04-27 03:00:00} detroit { clock format 514969200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.122 {time zone boundary case 1986-04-27 03:00:01} detroit { clock format 514969201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.123 {time zone boundary case 1986-10-26 01:59:59} detroit { clock format 530690399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.124 {time zone boundary case 1986-10-26 01:00:00} detroit { clock format 530690400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.125 {time zone boundary case 1986-10-26 01:00:01} detroit { clock format 530690401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.126 {time zone boundary case 1987-04-05 01:59:59} detroit { clock format 544604399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.127 {time zone boundary case 1987-04-05 03:00:00} detroit { clock format 544604400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.128 {time zone boundary case 1987-04-05 03:00:01} detroit { clock format 544604401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.129 {time zone boundary case 1987-10-25 01:59:59} detroit { clock format 562139999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.130 {time zone boundary case 1987-10-25 01:00:00} detroit { clock format 562140000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.131 {time zone boundary case 1987-10-25 01:00:01} detroit { clock format 562140001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.132 {time zone boundary case 1988-04-03 01:59:59} detroit { clock format 576053999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.133 {time zone boundary case 1988-04-03 03:00:00} detroit { clock format 576054000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.134 {time zone boundary case 1988-04-03 03:00:01} detroit { clock format 576054001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.135 {time zone boundary case 1988-10-30 01:59:59} detroit { clock format 594194399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.136 {time zone boundary case 1988-10-30 01:00:00} detroit { clock format 594194400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.137 {time zone boundary case 1988-10-30 01:00:01} detroit { clock format 594194401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.138 {time zone boundary case 1989-04-02 01:59:59} detroit { clock format 607503599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.139 {time zone boundary case 1989-04-02 03:00:00} detroit { clock format 607503600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.140 {time zone boundary case 1989-04-02 03:00:01} detroit { clock format 607503601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.141 {time zone boundary case 1989-10-29 01:59:59} detroit { clock format 625643999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.142 {time zone boundary case 1989-10-29 01:00:00} detroit { clock format 625644000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.143 {time zone boundary case 1989-10-29 01:00:01} detroit { clock format 625644001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.144 {time zone boundary case 1990-04-01 01:59:59} detroit { clock format 638953199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.145 {time zone boundary case 1990-04-01 03:00:00} detroit { clock format 638953200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.146 {time zone boundary case 1990-04-01 03:00:01} detroit { clock format 638953201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.147 {time zone boundary case 1990-10-28 01:59:59} detroit { clock format 657093599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.148 {time zone boundary case 1990-10-28 01:00:00} detroit { clock format 657093600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.149 {time zone boundary case 1990-10-28 01:00:01} detroit { clock format 657093601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.150 {time zone boundary case 1991-04-07 01:59:59} detroit { clock format 671007599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.151 {time zone boundary case 1991-04-07 03:00:00} detroit { clock format 671007600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.152 {time zone boundary case 1991-04-07 03:00:01} detroit { clock format 671007601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.153 {time zone boundary case 1991-10-27 01:59:59} detroit { clock format 688543199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.154 {time zone boundary case 1991-10-27 01:00:00} detroit { clock format 688543200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.155 {time zone boundary case 1991-10-27 01:00:01} detroit { clock format 688543201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.156 {time zone boundary case 1992-04-05 01:59:59} detroit { clock format 702457199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.157 {time zone boundary case 1992-04-05 03:00:00} detroit { clock format 702457200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.158 {time zone boundary case 1992-04-05 03:00:01} detroit { clock format 702457201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.159 {time zone boundary case 1992-10-25 01:59:59} detroit { clock format 719992799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.160 {time zone boundary case 1992-10-25 01:00:00} detroit { clock format 719992800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.161 {time zone boundary case 1992-10-25 01:00:01} detroit { clock format 719992801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.162 {time zone boundary case 1993-04-04 01:59:59} detroit { clock format 733906799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.163 {time zone boundary case 1993-04-04 03:00:00} detroit { clock format 733906800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.164 {time zone boundary case 1993-04-04 03:00:01} detroit { clock format 733906801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.165 {time zone boundary case 1993-10-31 01:59:59} detroit { clock format 752047199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.166 {time zone boundary case 1993-10-31 01:00:00} detroit { clock format 752047200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.167 {time zone boundary case 1993-10-31 01:00:01} detroit { clock format 752047201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.168 {time zone boundary case 1994-04-03 01:59:59} detroit { clock format 765356399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.169 {time zone boundary case 1994-04-03 03:00:00} detroit { clock format 765356400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.170 {time zone boundary case 1994-04-03 03:00:01} detroit { clock format 765356401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.171 {time zone boundary case 1994-10-30 01:59:59} detroit { clock format 783496799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.172 {time zone boundary case 1994-10-30 01:00:00} detroit { clock format 783496800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.173 {time zone boundary case 1994-10-30 01:00:01} detroit { clock format 783496801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.174 {time zone boundary case 1995-04-02 01:59:59} detroit { clock format 796805999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.175 {time zone boundary case 1995-04-02 03:00:00} detroit { clock format 796806000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.176 {time zone boundary case 1995-04-02 03:00:01} detroit { clock format 796806001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.177 {time zone boundary case 1995-10-29 01:59:59} detroit { clock format 814946399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.178 {time zone boundary case 1995-10-29 01:00:00} detroit { clock format 814946400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.179 {time zone boundary case 1995-10-29 01:00:01} detroit { clock format 814946401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.180 {time zone boundary case 1996-04-07 01:59:59} detroit { clock format 828860399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.181 {time zone boundary case 1996-04-07 03:00:00} detroit { clock format 828860400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.182 {time zone boundary case 1996-04-07 03:00:01} detroit { clock format 828860401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.183 {time zone boundary case 1996-10-27 01:59:59} detroit { clock format 846395999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.184 {time zone boundary case 1996-10-27 01:00:00} detroit { clock format 846396000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.185 {time zone boundary case 1996-10-27 01:00:01} detroit { clock format 846396001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.186 {time zone boundary case 1997-04-06 01:59:59} detroit { clock format 860309999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.187 {time zone boundary case 1997-04-06 03:00:00} detroit { clock format 860310000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.188 {time zone boundary case 1997-04-06 03:00:01} detroit { clock format 860310001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.189 {time zone boundary case 1997-10-26 01:59:59} detroit { clock format 877845599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.190 {time zone boundary case 1997-10-26 01:00:00} detroit { clock format 877845600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.191 {time zone boundary case 1997-10-26 01:00:01} detroit { clock format 877845601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.192 {time zone boundary case 1998-04-05 01:59:59} detroit { clock format 891759599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.193 {time zone boundary case 1998-04-05 03:00:00} detroit { clock format 891759600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.194 {time zone boundary case 1998-04-05 03:00:01} detroit { clock format 891759601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.195 {time zone boundary case 1998-10-25 01:59:59} detroit { clock format 909295199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.196 {time zone boundary case 1998-10-25 01:00:00} detroit { clock format 909295200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.197 {time zone boundary case 1998-10-25 01:00:01} detroit { clock format 909295201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.198 {time zone boundary case 1999-04-04 01:59:59} detroit { clock format 923209199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.199 {time zone boundary case 1999-04-04 03:00:00} detroit { clock format 923209200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.200 {time zone boundary case 1999-04-04 03:00:01} detroit { clock format 923209201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.201 {time zone boundary case 1999-10-31 01:59:59} detroit { clock format 941349599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.202 {time zone boundary case 1999-10-31 01:00:00} detroit { clock format 941349600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.203 {time zone boundary case 1999-10-31 01:00:01} detroit { clock format 941349601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.204 {time zone boundary case 2000-04-02 01:59:59} detroit { clock format 954658799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.205 {time zone boundary case 2000-04-02 03:00:00} detroit { clock format 954658800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.206 {time zone boundary case 2000-04-02 03:00:01} detroit { clock format 954658801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.207 {time zone boundary case 2000-10-29 01:59:59} detroit { clock format 972799199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.208 {time zone boundary case 2000-10-29 01:00:00} detroit { clock format 972799200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.209 {time zone boundary case 2000-10-29 01:00:01} detroit { clock format 972799201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.210 {time zone boundary case 2001-04-01 01:59:59} detroit { clock format 986108399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.211 {time zone boundary case 2001-04-01 03:00:00} detroit { clock format 986108400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.212 {time zone boundary case 2001-04-01 03:00:01} detroit { clock format 986108401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.213 {time zone boundary case 2001-10-28 01:59:59} detroit { clock format 1004248799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.214 {time zone boundary case 2001-10-28 01:00:00} detroit { clock format 1004248800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.215 {time zone boundary case 2001-10-28 01:00:01} detroit { clock format 1004248801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.216 {time zone boundary case 2002-04-07 01:59:59} detroit { clock format 1018162799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.217 {time zone boundary case 2002-04-07 03:00:00} detroit { clock format 1018162800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.218 {time zone boundary case 2002-04-07 03:00:01} detroit { clock format 1018162801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.219 {time zone boundary case 2002-10-27 01:59:59} detroit { clock format 1035698399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.220 {time zone boundary case 2002-10-27 01:00:00} detroit { clock format 1035698400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.221 {time zone boundary case 2002-10-27 01:00:01} detroit { clock format 1035698401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.222 {time zone boundary case 2003-04-06 01:59:59} detroit { clock format 1049612399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.223 {time zone boundary case 2003-04-06 03:00:00} detroit { clock format 1049612400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.224 {time zone boundary case 2003-04-06 03:00:01} detroit { clock format 1049612401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.225 {time zone boundary case 2003-10-26 01:59:59} detroit { clock format 1067147999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.226 {time zone boundary case 2003-10-26 01:00:00} detroit { clock format 1067148000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.227 {time zone boundary case 2003-10-26 01:00:01} detroit { clock format 1067148001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.228 {time zone boundary case 2004-04-04 01:59:59} detroit { clock format 1081061999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.229 {time zone boundary case 2004-04-04 03:00:00} detroit { clock format 1081062000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.230 {time zone boundary case 2004-04-04 03:00:01} detroit { clock format 1081062001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.231 {time zone boundary case 2004-10-31 01:59:59} detroit { clock format 1099202399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.232 {time zone boundary case 2004-10-31 01:00:00} detroit { clock format 1099202400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.233 {time zone boundary case 2004-10-31 01:00:01} detroit { clock format 1099202401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.234 {time zone boundary case 2005-04-03 01:59:59} detroit { clock format 1112511599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.235 {time zone boundary case 2005-04-03 03:00:00} detroit { clock format 1112511600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.236 {time zone boundary case 2005-04-03 03:00:01} detroit { clock format 1112511601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.237 {time zone boundary case 2005-10-30 01:59:59} detroit { clock format 1130651999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.238 {time zone boundary case 2005-10-30 01:00:00} detroit { clock format 1130652000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.239 {time zone boundary case 2005-10-30 01:00:01} detroit { clock format 1130652001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.240 {time zone boundary case 2006-04-02 01:59:59} detroit { clock format 1143961199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.241 {time zone boundary case 2006-04-02 03:00:00} detroit { clock format 1143961200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.242 {time zone boundary case 2006-04-02 03:00:01} detroit { clock format 1143961201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.243 {time zone boundary case 2006-10-29 01:59:59} detroit { clock format 1162101599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.244 {time zone boundary case 2006-10-29 01:00:00} detroit { clock format 1162101600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.245 {time zone boundary case 2006-10-29 01:00:01} detroit { clock format 1162101601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.246 {time zone boundary case 2007-03-11 01:59:59} detroit { clock format 1173596399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.247 {time zone boundary case 2007-03-11 03:00:00} detroit { clock format 1173596400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.248 {time zone boundary case 2007-03-11 03:00:01} detroit { clock format 1173596401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.249 {time zone boundary case 2007-11-04 01:59:59} detroit { clock format 1194155999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.250 {time zone boundary case 2007-11-04 01:00:00} detroit { clock format 1194156000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.251 {time zone boundary case 2007-11-04 01:00:01} detroit { clock format 1194156001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.252 {time zone boundary case 2008-03-09 01:59:59} detroit { clock format 1205045999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.253 {time zone boundary case 2008-03-09 03:00:00} detroit { clock format 1205046000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.254 {time zone boundary case 2008-03-09 03:00:01} detroit { clock format 1205046001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.255 {time zone boundary case 2008-11-02 01:59:59} detroit { clock format 1225605599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.256 {time zone boundary case 2008-11-02 01:00:00} detroit { clock format 1225605600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.257 {time zone boundary case 2008-11-02 01:00:01} detroit { clock format 1225605601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.258 {time zone boundary case 2009-03-08 01:59:59} detroit { clock format 1236495599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.259 {time zone boundary case 2009-03-08 03:00:00} detroit { clock format 1236495600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.260 {time zone boundary case 2009-03-08 03:00:01} detroit { clock format 1236495601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.261 {time zone boundary case 2009-11-01 01:59:59} detroit { clock format 1257055199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.262 {time zone boundary case 2009-11-01 01:00:00} detroit { clock format 1257055200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.263 {time zone boundary case 2009-11-01 01:00:01} detroit { clock format 1257055201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.264 {time zone boundary case 2010-03-14 01:59:59} detroit { clock format 1268549999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.265 {time zone boundary case 2010-03-14 03:00:00} detroit { clock format 1268550000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.266 {time zone boundary case 2010-03-14 03:00:01} detroit { clock format 1268550001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.267 {time zone boundary case 2010-11-07 01:59:59} detroit { clock format 1289109599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.268 {time zone boundary case 2010-11-07 01:00:00} detroit { clock format 1289109600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.269 {time zone boundary case 2010-11-07 01:00:01} detroit { clock format 1289109601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.270 {time zone boundary case 2011-03-13 01:59:59} detroit { clock format 1299999599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.271 {time zone boundary case 2011-03-13 03:00:00} detroit { clock format 1299999600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.272 {time zone boundary case 2011-03-13 03:00:01} detroit { clock format 1299999601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.273 {time zone boundary case 2011-11-06 01:59:59} detroit { clock format 1320559199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.274 {time zone boundary case 2011-11-06 01:00:00} detroit { clock format 1320559200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.275 {time zone boundary case 2011-11-06 01:00:01} detroit { clock format 1320559201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.276 {time zone boundary case 2012-03-11 01:59:59} detroit { clock format 1331449199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.277 {time zone boundary case 2012-03-11 03:00:00} detroit { clock format 1331449200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.278 {time zone boundary case 2012-03-11 03:00:01} detroit { clock format 1331449201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.279 {time zone boundary case 2012-11-04 01:59:59} detroit { clock format 1352008799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.280 {time zone boundary case 2012-11-04 01:00:00} detroit { clock format 1352008800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.281 {time zone boundary case 2012-11-04 01:00:01} detroit { clock format 1352008801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.282 {time zone boundary case 2013-03-10 01:59:59} detroit { clock format 1362898799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.283 {time zone boundary case 2013-03-10 03:00:00} detroit { clock format 1362898800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.284 {time zone boundary case 2013-03-10 03:00:01} detroit { clock format 1362898801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.285 {time zone boundary case 2013-11-03 01:59:59} detroit { clock format 1383458399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.286 {time zone boundary case 2013-11-03 01:00:00} detroit { clock format 1383458400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.287 {time zone boundary case 2013-11-03 01:00:01} detroit { clock format 1383458401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.288 {time zone boundary case 2014-03-09 01:59:59} detroit { clock format 1394348399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.289 {time zone boundary case 2014-03-09 03:00:00} detroit { clock format 1394348400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.290 {time zone boundary case 2014-03-09 03:00:01} detroit { clock format 1394348401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.291 {time zone boundary case 2014-11-02 01:59:59} detroit { clock format 1414907999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.292 {time zone boundary case 2014-11-02 01:00:00} detroit { clock format 1414908000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.293 {time zone boundary case 2014-11-02 01:00:01} detroit { clock format 1414908001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.294 {time zone boundary case 2015-03-08 01:59:59} detroit { clock format 1425797999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.295 {time zone boundary case 2015-03-08 03:00:00} detroit { clock format 1425798000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.296 {time zone boundary case 2015-03-08 03:00:01} detroit { clock format 1425798001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.297 {time zone boundary case 2015-11-01 01:59:59} detroit { clock format 1446357599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.298 {time zone boundary case 2015-11-01 01:00:00} detroit { clock format 1446357600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.299 {time zone boundary case 2015-11-01 01:00:01} detroit { clock format 1446357601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.300 {time zone boundary case 2016-03-13 01:59:59} detroit { clock format 1457852399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.301 {time zone boundary case 2016-03-13 03:00:00} detroit { clock format 1457852400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.302 {time zone boundary case 2016-03-13 03:00:01} detroit { clock format 1457852401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.303 {time zone boundary case 2016-11-06 01:59:59} detroit { clock format 1478411999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.304 {time zone boundary case 2016-11-06 01:00:00} detroit { clock format 1478412000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.305 {time zone boundary case 2016-11-06 01:00:01} detroit { clock format 1478412001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.306 {time zone boundary case 2017-03-12 01:59:59} detroit { clock format 1489301999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.307 {time zone boundary case 2017-03-12 03:00:00} detroit { clock format 1489302000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.308 {time zone boundary case 2017-03-12 03:00:01} detroit { clock format 1489302001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.309 {time zone boundary case 2017-11-05 01:59:59} detroit { clock format 1509861599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.310 {time zone boundary case 2017-11-05 01:00:00} detroit { clock format 1509861600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.311 {time zone boundary case 2017-11-05 01:00:01} detroit { clock format 1509861601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.312 {time zone boundary case 2018-03-11 01:59:59} detroit { clock format 1520751599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.313 {time zone boundary case 2018-03-11 03:00:00} detroit { clock format 1520751600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.314 {time zone boundary case 2018-03-11 03:00:01} detroit { clock format 1520751601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.315 {time zone boundary case 2018-11-04 01:59:59} detroit { clock format 1541311199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.316 {time zone boundary case 2018-11-04 01:00:00} detroit { clock format 1541311200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.317 {time zone boundary case 2018-11-04 01:00:01} detroit { clock format 1541311201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.318 {time zone boundary case 2019-03-10 01:59:59} detroit { clock format 1552201199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.319 {time zone boundary case 2019-03-10 03:00:00} detroit { clock format 1552201200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.320 {time zone boundary case 2019-03-10 03:00:01} detroit { clock format 1552201201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.321 {time zone boundary case 2019-11-03 01:59:59} detroit { clock format 1572760799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.322 {time zone boundary case 2019-11-03 01:00:00} detroit { clock format 1572760800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.323 {time zone boundary case 2019-11-03 01:00:01} detroit { clock format 1572760801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.324 {time zone boundary case 2020-03-08 01:59:59} detroit { clock format 1583650799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.325 {time zone boundary case 2020-03-08 03:00:00} detroit { clock format 1583650800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.326 {time zone boundary case 2020-03-08 03:00:01} detroit { clock format 1583650801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.327 {time zone boundary case 2020-11-01 01:59:59} detroit { clock format 1604210399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.328 {time zone boundary case 2020-11-01 01:00:00} detroit { clock format 1604210400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.329 {time zone boundary case 2020-11-01 01:00:01} detroit { clock format 1604210401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.330 {time zone boundary case 2021-03-14 01:59:59} detroit { clock format 1615705199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.331 {time zone boundary case 2021-03-14 03:00:00} detroit { clock format 1615705200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.332 {time zone boundary case 2021-03-14 03:00:01} detroit { clock format 1615705201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.333 {time zone boundary case 2021-11-07 01:59:59} detroit { clock format 1636264799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.334 {time zone boundary case 2021-11-07 01:00:00} detroit { clock format 1636264800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.335 {time zone boundary case 2021-11-07 01:00:01} detroit { clock format 1636264801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.336 {time zone boundary case 2022-03-13 01:59:59} detroit { clock format 1647154799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.337 {time zone boundary case 2022-03-13 03:00:00} detroit { clock format 1647154800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.338 {time zone boundary case 2022-03-13 03:00:01} detroit { clock format 1647154801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.339 {time zone boundary case 2022-11-06 01:59:59} detroit { clock format 1667714399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.340 {time zone boundary case 2022-11-06 01:00:00} detroit { clock format 1667714400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.341 {time zone boundary case 2022-11-06 01:00:01} detroit { clock format 1667714401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.342 {time zone boundary case 2023-03-12 01:59:59} detroit { clock format 1678604399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.343 {time zone boundary case 2023-03-12 03:00:00} detroit { clock format 1678604400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.344 {time zone boundary case 2023-03-12 03:00:01} detroit { clock format 1678604401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.345 {time zone boundary case 2023-11-05 01:59:59} detroit { clock format 1699163999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.346 {time zone boundary case 2023-11-05 01:00:00} detroit { clock format 1699164000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.347 {time zone boundary case 2023-11-05 01:00:01} detroit { clock format 1699164001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.348 {time zone boundary case 2024-03-10 01:59:59} detroit { clock format 1710053999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.349 {time zone boundary case 2024-03-10 03:00:00} detroit { clock format 1710054000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.350 {time zone boundary case 2024-03-10 03:00:01} detroit { clock format 1710054001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.351 {time zone boundary case 2024-11-03 01:59:59} detroit { clock format 1730613599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.352 {time zone boundary case 2024-11-03 01:00:00} detroit { clock format 1730613600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.353 {time zone boundary case 2024-11-03 01:00:01} detroit { clock format 1730613601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.354 {time zone boundary case 2025-03-09 01:59:59} detroit { clock format 1741503599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.355 {time zone boundary case 2025-03-09 03:00:00} detroit { clock format 1741503600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.356 {time zone boundary case 2025-03-09 03:00:01} detroit { clock format 1741503601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.357 {time zone boundary case 2025-11-02 01:59:59} detroit { clock format 1762063199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.358 {time zone boundary case 2025-11-02 01:00:00} detroit { clock format 1762063200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.359 {time zone boundary case 2025-11-02 01:00:01} detroit { clock format 1762063201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.360 {time zone boundary case 2026-03-08 01:59:59} detroit { clock format 1772953199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.361 {time zone boundary case 2026-03-08 03:00:00} detroit { clock format 1772953200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.362 {time zone boundary case 2026-03-08 03:00:01} detroit { clock format 1772953201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.363 {time zone boundary case 2026-11-01 01:59:59} detroit { clock format 1793512799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.364 {time zone boundary case 2026-11-01 01:00:00} detroit { clock format 1793512800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.365 {time zone boundary case 2026-11-01 01:00:01} detroit { clock format 1793512801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.366 {time zone boundary case 2027-03-14 01:59:59} detroit { clock format 1805007599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.367 {time zone boundary case 2027-03-14 03:00:00} detroit { clock format 1805007600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.368 {time zone boundary case 2027-03-14 03:00:01} detroit { clock format 1805007601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.369 {time zone boundary case 2027-11-07 01:59:59} detroit { clock format 1825567199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.370 {time zone boundary case 2027-11-07 01:00:00} detroit { clock format 1825567200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.371 {time zone boundary case 2027-11-07 01:00:01} detroit { clock format 1825567201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.372 {time zone boundary case 2028-03-12 01:59:59} detroit { clock format 1836457199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.373 {time zone boundary case 2028-03-12 03:00:00} detroit { clock format 1836457200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.374 {time zone boundary case 2028-03-12 03:00:01} detroit { clock format 1836457201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.375 {time zone boundary case 2028-11-05 01:59:59} detroit { clock format 1857016799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.376 {time zone boundary case 2028-11-05 01:00:00} detroit { clock format 1857016800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.377 {time zone boundary case 2028-11-05 01:00:01} detroit { clock format 1857016801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.378 {time zone boundary case 2029-03-11 01:59:59} detroit { clock format 1867906799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.379 {time zone boundary case 2029-03-11 03:00:00} detroit { clock format 1867906800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.380 {time zone boundary case 2029-03-11 03:00:01} detroit { clock format 1867906801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.381 {time zone boundary case 2029-11-04 01:59:59} detroit { clock format 1888466399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.382 {time zone boundary case 2029-11-04 01:00:00} detroit { clock format 1888466400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.383 {time zone boundary case 2029-11-04 01:00:01} detroit { clock format 1888466401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.384 {time zone boundary case 2030-03-10 01:59:59} detroit { clock format 1899356399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.385 {time zone boundary case 2030-03-10 03:00:00} detroit { clock format 1899356400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.386 {time zone boundary case 2030-03-10 03:00:01} detroit { clock format 1899356401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.387 {time zone boundary case 2030-11-03 01:59:59} detroit { clock format 1919915999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.388 {time zone boundary case 2030-11-03 01:00:00} detroit { clock format 1919916000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.389 {time zone boundary case 2030-11-03 01:00:01} detroit { clock format 1919916001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.390 {time zone boundary case 2031-03-09 01:59:59} detroit { clock format 1930805999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.391 {time zone boundary case 2031-03-09 03:00:00} detroit { clock format 1930806000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.392 {time zone boundary case 2031-03-09 03:00:01} detroit { clock format 1930806001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.393 {time zone boundary case 2031-11-02 01:59:59} detroit { clock format 1951365599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.394 {time zone boundary case 2031-11-02 01:00:00} detroit { clock format 1951365600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.395 {time zone boundary case 2031-11-02 01:00:01} detroit { clock format 1951365601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.396 {time zone boundary case 2032-03-14 01:59:59} detroit { clock format 1962860399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.397 {time zone boundary case 2032-03-14 03:00:00} detroit { clock format 1962860400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.398 {time zone boundary case 2032-03-14 03:00:01} detroit { clock format 1962860401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.399 {time zone boundary case 2032-11-07 01:59:59} detroit { clock format 1983419999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.400 {time zone boundary case 2032-11-07 01:00:00} detroit { clock format 1983420000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.401 {time zone boundary case 2032-11-07 01:00:01} detroit { clock format 1983420001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.402 {time zone boundary case 2033-03-13 01:59:59} detroit { clock format 1994309999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.403 {time zone boundary case 2033-03-13 03:00:00} detroit { clock format 1994310000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.404 {time zone boundary case 2033-03-13 03:00:01} detroit { clock format 1994310001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.405 {time zone boundary case 2033-11-06 01:59:59} detroit { clock format 2014869599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.406 {time zone boundary case 2033-11-06 01:00:00} detroit { clock format 2014869600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.407 {time zone boundary case 2033-11-06 01:00:01} detroit { clock format 2014869601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.408 {time zone boundary case 2034-03-12 01:59:59} detroit { clock format 2025759599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.409 {time zone boundary case 2034-03-12 03:00:00} detroit { clock format 2025759600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.410 {time zone boundary case 2034-03-12 03:00:01} detroit { clock format 2025759601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.411 {time zone boundary case 2034-11-05 01:59:59} detroit { clock format 2046319199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.412 {time zone boundary case 2034-11-05 01:00:00} detroit { clock format 2046319200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.413 {time zone boundary case 2034-11-05 01:00:01} detroit { clock format 2046319201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.414 {time zone boundary case 2035-03-11 01:59:59} detroit { clock format 2057209199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.415 {time zone boundary case 2035-03-11 03:00:00} detroit { clock format 2057209200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.416 {time zone boundary case 2035-03-11 03:00:01} detroit { clock format 2057209201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.417 {time zone boundary case 2035-11-04 01:59:59} detroit { clock format 2077768799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.418 {time zone boundary case 2035-11-04 01:00:00} detroit { clock format 2077768800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.419 {time zone boundary case 2035-11-04 01:00:01} detroit { clock format 2077768801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.420 {time zone boundary case 2036-03-09 01:59:59} detroit { clock format 2088658799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.421 {time zone boundary case 2036-03-09 03:00:00} detroit { clock format 2088658800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.422 {time zone boundary case 2036-03-09 03:00:01} detroit { clock format 2088658801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.423 {time zone boundary case 2036-11-02 01:59:59} detroit { clock format 2109218399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.424 {time zone boundary case 2036-11-02 01:00:00} detroit { clock format 2109218400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.425 {time zone boundary case 2036-11-02 01:00:01} detroit { clock format 2109218401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.426 {time zone boundary case 2037-03-08 01:59:59} detroit { clock format 2120108399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.427 {time zone boundary case 2037-03-08 03:00:00} detroit { clock format 2120108400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.428 {time zone boundary case 2037-03-08 03:00:01} detroit { clock format 2120108401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.429 {time zone boundary case 2037-11-01 01:59:59} detroit { clock format 2140667999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.430 {time zone boundary case 2037-11-01 01:00:00} detroit { clock format 2140668000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.431 {time zone boundary case 2037-11-01 01:00:01} detroit { clock format 2140668001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.432 {time zone boundary case 2038-03-14 01:59:59} {detroit y2038} { clock format 2152162799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.433 {time zone boundary case 2038-03-14 03:00:00} {detroit y2038} { clock format 2152162800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.434 {time zone boundary case 2038-03-14 03:00:01} {detroit y2038} { clock format 2152162801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.435 {time zone boundary case 2038-11-07 01:59:59} {detroit y2038} { clock format 2172722399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.436 {time zone boundary case 2038-11-07 01:00:00} {detroit y2038} { clock format 2172722400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.437 {time zone boundary case 2038-11-07 01:00:01} {detroit y2038} { clock format 2172722401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.438 {time zone boundary case 2039-03-13 01:59:59} {detroit y2038} { clock format 2183612399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.439 {time zone boundary case 2039-03-13 03:00:00} {detroit y2038} { clock format 2183612400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.440 {time zone boundary case 2039-03-13 03:00:01} {detroit y2038} { clock format 2183612401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.441 {time zone boundary case 2039-11-06 01:59:59} {detroit y2038} { clock format 2204171999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.442 {time zone boundary case 2039-11-06 01:00:00} {detroit y2038} { clock format 2204172000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.443 {time zone boundary case 2039-11-06 01:00:01} {detroit y2038} { clock format 2204172001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.444 {time zone boundary case 2040-03-11 01:59:59} {detroit y2038} { clock format 2215061999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.445 {time zone boundary case 2040-03-11 03:00:00} {detroit y2038} { clock format 2215062000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.446 {time zone boundary case 2040-03-11 03:00:01} {detroit y2038} { clock format 2215062001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.447 {time zone boundary case 2040-11-04 01:59:59} {detroit y2038} { clock format 2235621599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.448 {time zone boundary case 2040-11-04 01:00:00} {detroit y2038} { clock format 2235621600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.449 {time zone boundary case 2040-11-04 01:00:01} {detroit y2038} { clock format 2235621601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.450 {time zone boundary case 2041-03-10 01:59:59} {detroit y2038} { clock format 2246511599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.451 {time zone boundary case 2041-03-10 03:00:00} {detroit y2038} { clock format 2246511600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.452 {time zone boundary case 2041-03-10 03:00:01} {detroit y2038} { clock format 2246511601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.453 {time zone boundary case 2041-11-03 01:59:59} {detroit y2038} { clock format 2267071199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.454 {time zone boundary case 2041-11-03 01:00:00} {detroit y2038} { clock format 2267071200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.455 {time zone boundary case 2041-11-03 01:00:01} {detroit y2038} { clock format 2267071201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.456 {time zone boundary case 2042-03-09 01:59:59} {detroit y2038} { clock format 2277961199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.457 {time zone boundary case 2042-03-09 03:00:00} {detroit y2038} { clock format 2277961200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.458 {time zone boundary case 2042-03-09 03:00:01} {detroit y2038} { clock format 2277961201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.459 {time zone boundary case 2042-11-02 01:59:59} {detroit y2038} { clock format 2298520799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.460 {time zone boundary case 2042-11-02 01:00:00} {detroit y2038} { clock format 2298520800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.461 {time zone boundary case 2042-11-02 01:00:01} {detroit y2038} { clock format 2298520801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.462 {time zone boundary case 2043-03-08 01:59:59} {detroit y2038} { clock format 2309410799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.463 {time zone boundary case 2043-03-08 03:00:00} {detroit y2038} { clock format 2309410800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.464 {time zone boundary case 2043-03-08 03:00:01} {detroit y2038} { clock format 2309410801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.465 {time zone boundary case 2043-11-01 01:59:59} {detroit y2038} { clock format 2329970399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.466 {time zone boundary case 2043-11-01 01:00:00} {detroit y2038} { clock format 2329970400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.467 {time zone boundary case 2043-11-01 01:00:01} {detroit y2038} { clock format 2329970401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.468 {time zone boundary case 2044-03-13 01:59:59} {detroit y2038} { clock format 2341465199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.469 {time zone boundary case 2044-03-13 03:00:00} {detroit y2038} { clock format 2341465200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.470 {time zone boundary case 2044-03-13 03:00:01} {detroit y2038} { clock format 2341465201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.471 {time zone boundary case 2044-11-06 01:59:59} {detroit y2038} { clock format 2362024799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.472 {time zone boundary case 2044-11-06 01:00:00} {detroit y2038} { clock format 2362024800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.473 {time zone boundary case 2044-11-06 01:00:01} {detroit y2038} { clock format 2362024801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.474 {time zone boundary case 2045-03-12 01:59:59} {detroit y2038} { clock format 2372914799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.475 {time zone boundary case 2045-03-12 03:00:00} {detroit y2038} { clock format 2372914800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.476 {time zone boundary case 2045-03-12 03:00:01} {detroit y2038} { clock format 2372914801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.477 {time zone boundary case 2045-11-05 01:59:59} {detroit y2038} { clock format 2393474399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.478 {time zone boundary case 2045-11-05 01:00:00} {detroit y2038} { clock format 2393474400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.479 {time zone boundary case 2045-11-05 01:00:01} {detroit y2038} { clock format 2393474401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.480 {time zone boundary case 2046-03-11 01:59:59} {detroit y2038} { clock format 2404364399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.481 {time zone boundary case 2046-03-11 03:00:00} {detroit y2038} { clock format 2404364400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.482 {time zone boundary case 2046-03-11 03:00:01} {detroit y2038} { clock format 2404364401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.483 {time zone boundary case 2046-11-04 01:59:59} {detroit y2038} { clock format 2424923999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.484 {time zone boundary case 2046-11-04 01:00:00} {detroit y2038} { clock format 2424924000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.485 {time zone boundary case 2046-11-04 01:00:01} {detroit y2038} { clock format 2424924001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.486 {time zone boundary case 2047-03-10 01:59:59} {detroit y2038} { clock format 2435813999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.487 {time zone boundary case 2047-03-10 03:00:00} {detroit y2038} { clock format 2435814000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.488 {time zone boundary case 2047-03-10 03:00:01} {detroit y2038} { clock format 2435814001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.489 {time zone boundary case 2047-11-03 01:59:59} {detroit y2038} { clock format 2456373599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.490 {time zone boundary case 2047-11-03 01:00:00} {detroit y2038} { clock format 2456373600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.491 {time zone boundary case 2047-11-03 01:00:01} {detroit y2038} { clock format 2456373601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.492 {time zone boundary case 2048-03-08 01:59:59} {detroit y2038} { clock format 2467263599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.493 {time zone boundary case 2048-03-08 03:00:00} {detroit y2038} { clock format 2467263600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.494 {time zone boundary case 2048-03-08 03:00:01} {detroit y2038} { clock format 2467263601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.495 {time zone boundary case 2048-11-01 01:59:59} {detroit y2038} { clock format 2487823199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.496 {time zone boundary case 2048-11-01 01:00:00} {detroit y2038} { clock format 2487823200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.497 {time zone boundary case 2048-11-01 01:00:01} {detroit y2038} { clock format 2487823201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.498 {time zone boundary case 2049-03-14 01:59:59} {detroit y2038} { clock format 2499317999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.499 {time zone boundary case 2049-03-14 03:00:00} {detroit y2038} { clock format 2499318000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.500 {time zone boundary case 2049-03-14 03:00:01} {detroit y2038} { clock format 2499318001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.501 {time zone boundary case 2049-11-07 01:59:59} {detroit y2038} { clock format 2519877599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.502 {time zone boundary case 2049-11-07 01:00:00} {detroit y2038} { clock format 2519877600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.503 {time zone boundary case 2049-11-07 01:00:01} {detroit y2038} { clock format 2519877601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.504 {time zone boundary case 2050-03-13 01:59:59} {detroit y2038} { clock format 2530767599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.505 {time zone boundary case 2050-03-13 03:00:00} {detroit y2038} { clock format 2530767600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.506 {time zone boundary case 2050-03-13 03:00:01} {detroit y2038} { clock format 2530767601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.507 {time zone boundary case 2050-11-06 01:59:59} {detroit y2038} { clock format 2551327199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.508 {time zone boundary case 2050-11-06 01:00:00} {detroit y2038} { clock format 2551327200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.509 {time zone boundary case 2050-11-06 01:00:01} {detroit y2038} { clock format 2551327201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.510 {time zone boundary case 2051-03-12 01:59:59} {detroit y2038} { clock format 2562217199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.511 {time zone boundary case 2051-03-12 03:00:00} {detroit y2038} { clock format 2562217200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.512 {time zone boundary case 2051-03-12 03:00:01} {detroit y2038} { clock format 2562217201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.513 {time zone boundary case 2051-11-05 01:59:59} {detroit y2038} { clock format 2582776799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.514 {time zone boundary case 2051-11-05 01:00:00} {detroit y2038} { clock format 2582776800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.515 {time zone boundary case 2051-11-05 01:00:01} {detroit y2038} { clock format 2582776801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.516 {time zone boundary case 2052-03-10 01:59:59} {detroit y2038} { clock format 2593666799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.517 {time zone boundary case 2052-03-10 03:00:00} {detroit y2038} { clock format 2593666800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.518 {time zone boundary case 2052-03-10 03:00:01} {detroit y2038} { clock format 2593666801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.519 {time zone boundary case 2052-11-03 01:59:59} {detroit y2038} { clock format 2614226399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.520 {time zone boundary case 2052-11-03 01:00:00} {detroit y2038} { clock format 2614226400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.521 {time zone boundary case 2052-11-03 01:00:01} {detroit y2038} { clock format 2614226401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.522 {time zone boundary case 2053-03-09 01:59:59} {detroit y2038} { clock format 2625116399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.523 {time zone boundary case 2053-03-09 03:00:00} {detroit y2038} { clock format 2625116400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.524 {time zone boundary case 2053-03-09 03:00:01} {detroit y2038} { clock format 2625116401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.525 {time zone boundary case 2053-11-02 01:59:59} {detroit y2038} { clock format 2645675999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.526 {time zone boundary case 2053-11-02 01:00:00} {detroit y2038} { clock format 2645676000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.527 {time zone boundary case 2053-11-02 01:00:01} {detroit y2038} { clock format 2645676001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.528 {time zone boundary case 2054-03-08 01:59:59} {detroit y2038} { clock format 2656565999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.529 {time zone boundary case 2054-03-08 03:00:00} {detroit y2038} { clock format 2656566000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.530 {time zone boundary case 2054-03-08 03:00:01} {detroit y2038} { clock format 2656566001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.531 {time zone boundary case 2054-11-01 01:59:59} {detroit y2038} { clock format 2677125599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.532 {time zone boundary case 2054-11-01 01:00:00} {detroit y2038} { clock format 2677125600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.533 {time zone boundary case 2054-11-01 01:00:01} {detroit y2038} { clock format 2677125601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.534 {time zone boundary case 2055-03-14 01:59:59} {detroit y2038} { clock format 2688620399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.535 {time zone boundary case 2055-03-14 03:00:00} {detroit y2038} { clock format 2688620400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.536 {time zone boundary case 2055-03-14 03:00:01} {detroit y2038} { clock format 2688620401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.537 {time zone boundary case 2055-11-07 01:59:59} {detroit y2038} { clock format 2709179999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.538 {time zone boundary case 2055-11-07 01:00:00} {detroit y2038} { clock format 2709180000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.539 {time zone boundary case 2055-11-07 01:00:01} {detroit y2038} { clock format 2709180001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.540 {time zone boundary case 2056-03-12 01:59:59} {detroit y2038} { clock format 2720069999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.541 {time zone boundary case 2056-03-12 03:00:00} {detroit y2038} { clock format 2720070000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.542 {time zone boundary case 2056-03-12 03:00:01} {detroit y2038} { clock format 2720070001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.543 {time zone boundary case 2056-11-05 01:59:59} {detroit y2038} { clock format 2740629599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.544 {time zone boundary case 2056-11-05 01:00:00} {detroit y2038} { clock format 2740629600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.545 {time zone boundary case 2056-11-05 01:00:01} {detroit y2038} { clock format 2740629601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.546 {time zone boundary case 2057-03-11 01:59:59} {detroit y2038} { clock format 2751519599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.547 {time zone boundary case 2057-03-11 03:00:00} {detroit y2038} { clock format 2751519600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.548 {time zone boundary case 2057-03-11 03:00:01} {detroit y2038} { clock format 2751519601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.549 {time zone boundary case 2057-11-04 01:59:59} {detroit y2038} { clock format 2772079199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.550 {time zone boundary case 2057-11-04 01:00:00} {detroit y2038} { clock format 2772079200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.551 {time zone boundary case 2057-11-04 01:00:01} {detroit y2038} { clock format 2772079201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.552 {time zone boundary case 2058-03-10 01:59:59} {detroit y2038} { clock format 2782969199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.553 {time zone boundary case 2058-03-10 03:00:00} {detroit y2038} { clock format 2782969200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.554 {time zone boundary case 2058-03-10 03:00:01} {detroit y2038} { clock format 2782969201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.555 {time zone boundary case 2058-11-03 01:59:59} {detroit y2038} { clock format 2803528799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.556 {time zone boundary case 2058-11-03 01:00:00} {detroit y2038} { clock format 2803528800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.557 {time zone boundary case 2058-11-03 01:00:01} {detroit y2038} { clock format 2803528801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.558 {time zone boundary case 2059-03-09 01:59:59} {detroit y2038} { clock format 2814418799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.559 {time zone boundary case 2059-03-09 03:00:00} {detroit y2038} { clock format 2814418800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.560 {time zone boundary case 2059-03-09 03:00:01} {detroit y2038} { clock format 2814418801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.561 {time zone boundary case 2059-11-02 01:59:59} {detroit y2038} { clock format 2834978399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.562 {time zone boundary case 2059-11-02 01:00:00} {detroit y2038} { clock format 2834978400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.563 {time zone boundary case 2059-11-02 01:00:01} {detroit y2038} { clock format 2834978401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.564 {time zone boundary case 2060-03-14 01:59:59} {detroit y2038} { clock format 2846473199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.565 {time zone boundary case 2060-03-14 03:00:00} {detroit y2038} { clock format 2846473200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.566 {time zone boundary case 2060-03-14 03:00:01} {detroit y2038} { clock format 2846473201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.567 {time zone boundary case 2060-11-07 01:59:59} {detroit y2038} { clock format 2867032799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.568 {time zone boundary case 2060-11-07 01:00:00} {detroit y2038} { clock format 2867032800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.569 {time zone boundary case 2060-11-07 01:00:01} {detroit y2038} { clock format 2867032801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.570 {time zone boundary case 2061-03-13 01:59:59} {detroit y2038} { clock format 2877922799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.571 {time zone boundary case 2061-03-13 03:00:00} {detroit y2038} { clock format 2877922800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.572 {time zone boundary case 2061-03-13 03:00:01} {detroit y2038} { clock format 2877922801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.573 {time zone boundary case 2061-11-06 01:59:59} {detroit y2038} { clock format 2898482399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.574 {time zone boundary case 2061-11-06 01:00:00} {detroit y2038} { clock format 2898482400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.575 {time zone boundary case 2061-11-06 01:00:01} {detroit y2038} { clock format 2898482401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.576 {time zone boundary case 2062-03-12 01:59:59} {detroit y2038} { clock format 2909372399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.577 {time zone boundary case 2062-03-12 03:00:00} {detroit y2038} { clock format 2909372400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.578 {time zone boundary case 2062-03-12 03:00:01} {detroit y2038} { clock format 2909372401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.579 {time zone boundary case 2062-11-05 01:59:59} {detroit y2038} { clock format 2929931999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.580 {time zone boundary case 2062-11-05 01:00:00} {detroit y2038} { clock format 2929932000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.581 {time zone boundary case 2062-11-05 01:00:01} {detroit y2038} { clock format 2929932001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.582 {time zone boundary case 2063-03-11 01:59:59} {detroit y2038} { clock format 2940821999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.583 {time zone boundary case 2063-03-11 03:00:00} {detroit y2038} { clock format 2940822000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.584 {time zone boundary case 2063-03-11 03:00:01} {detroit y2038} { clock format 2940822001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.585 {time zone boundary case 2063-11-04 01:59:59} {detroit y2038} { clock format 2961381599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.586 {time zone boundary case 2063-11-04 01:00:00} {detroit y2038} { clock format 2961381600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.587 {time zone boundary case 2063-11-04 01:00:01} {detroit y2038} { clock format 2961381601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.588 {time zone boundary case 2064-03-09 01:59:59} {detroit y2038} { clock format 2972271599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.589 {time zone boundary case 2064-03-09 03:00:00} {detroit y2038} { clock format 2972271600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.590 {time zone boundary case 2064-03-09 03:00:01} {detroit y2038} { clock format 2972271601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.591 {time zone boundary case 2064-11-02 01:59:59} {detroit y2038} { clock format 2992831199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.592 {time zone boundary case 2064-11-02 01:00:00} {detroit y2038} { clock format 2992831200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.593 {time zone boundary case 2064-11-02 01:00:01} {detroit y2038} { clock format 2992831201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.594 {time zone boundary case 2065-03-08 01:59:59} {detroit y2038} { clock format 3003721199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.595 {time zone boundary case 2065-03-08 03:00:00} {detroit y2038} { clock format 3003721200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.596 {time zone boundary case 2065-03-08 03:00:01} {detroit y2038} { clock format 3003721201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.597 {time zone boundary case 2065-11-01 01:59:59} {detroit y2038} { clock format 3024280799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.598 {time zone boundary case 2065-11-01 01:00:00} {detroit y2038} { clock format 3024280800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.599 {time zone boundary case 2065-11-01 01:00:01} {detroit y2038} { clock format 3024280801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.600 {time zone boundary case 2066-03-14 01:59:59} {detroit y2038} { clock format 3035775599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.601 {time zone boundary case 2066-03-14 03:00:00} {detroit y2038} { clock format 3035775600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.602 {time zone boundary case 2066-03-14 03:00:01} {detroit y2038} { clock format 3035775601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.603 {time zone boundary case 2066-11-07 01:59:59} {detroit y2038} { clock format 3056335199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.604 {time zone boundary case 2066-11-07 01:00:00} {detroit y2038} { clock format 3056335200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.605 {time zone boundary case 2066-11-07 01:00:01} {detroit y2038} { clock format 3056335201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.606 {time zone boundary case 2067-03-13 01:59:59} {detroit y2038} { clock format 3067225199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.607 {time zone boundary case 2067-03-13 03:00:00} {detroit y2038} { clock format 3067225200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.608 {time zone boundary case 2067-03-13 03:00:01} {detroit y2038} { clock format 3067225201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.609 {time zone boundary case 2067-11-06 01:59:59} {detroit y2038} { clock format 3087784799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.610 {time zone boundary case 2067-11-06 01:00:00} {detroit y2038} { clock format 3087784800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.611 {time zone boundary case 2067-11-06 01:00:01} {detroit y2038} { clock format 3087784801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.612 {time zone boundary case 2068-03-11 01:59:59} {detroit y2038} { clock format 3098674799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.613 {time zone boundary case 2068-03-11 03:00:00} {detroit y2038} { clock format 3098674800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.614 {time zone boundary case 2068-03-11 03:00:01} {detroit y2038} { clock format 3098674801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.615 {time zone boundary case 2068-11-04 01:59:59} {detroit y2038} { clock format 3119234399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.616 {time zone boundary case 2068-11-04 01:00:00} {detroit y2038} { clock format 3119234400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.617 {time zone boundary case 2068-11-04 01:00:01} {detroit y2038} { clock format 3119234401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.618 {time zone boundary case 2069-03-10 01:59:59} {detroit y2038} { clock format 3130124399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.619 {time zone boundary case 2069-03-10 03:00:00} {detroit y2038} { clock format 3130124400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.620 {time zone boundary case 2069-03-10 03:00:01} {detroit y2038} { clock format 3130124401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.621 {time zone boundary case 2069-11-03 01:59:59} {detroit y2038} { clock format 3150683999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.622 {time zone boundary case 2069-11-03 01:00:00} {detroit y2038} { clock format 3150684000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.623 {time zone boundary case 2069-11-03 01:00:01} {detroit y2038} { clock format 3150684001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.624 {time zone boundary case 2070-03-09 01:59:59} {detroit y2038} { clock format 3161573999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.625 {time zone boundary case 2070-03-09 03:00:00} {detroit y2038} { clock format 3161574000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.626 {time zone boundary case 2070-03-09 03:00:01} {detroit y2038} { clock format 3161574001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.627 {time zone boundary case 2070-11-02 01:59:59} {detroit y2038} { clock format 3182133599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.628 {time zone boundary case 2070-11-02 01:00:00} {detroit y2038} { clock format 3182133600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.629 {time zone boundary case 2070-11-02 01:00:01} {detroit y2038} { clock format 3182133601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.630 {time zone boundary case 2071-03-08 01:59:59} {detroit y2038} { clock format 3193023599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.631 {time zone boundary case 2071-03-08 03:00:00} {detroit y2038} { clock format 3193023600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.632 {time zone boundary case 2071-03-08 03:00:01} {detroit y2038} { clock format 3193023601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.633 {time zone boundary case 2071-11-01 01:59:59} {detroit y2038} { clock format 3213583199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.634 {time zone boundary case 2071-11-01 01:00:00} {detroit y2038} { clock format 3213583200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.635 {time zone boundary case 2071-11-01 01:00:01} {detroit y2038} { clock format 3213583201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.636 {time zone boundary case 2072-03-13 01:59:59} {detroit y2038} { clock format 3225077999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.637 {time zone boundary case 2072-03-13 03:00:00} {detroit y2038} { clock format 3225078000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.638 {time zone boundary case 2072-03-13 03:00:01} {detroit y2038} { clock format 3225078001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.639 {time zone boundary case 2072-11-06 01:59:59} {detroit y2038} { clock format 3245637599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.640 {time zone boundary case 2072-11-06 01:00:00} {detroit y2038} { clock format 3245637600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.641 {time zone boundary case 2072-11-06 01:00:01} {detroit y2038} { clock format 3245637601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.642 {time zone boundary case 2073-03-12 01:59:59} {detroit y2038} { clock format 3256527599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.643 {time zone boundary case 2073-03-12 03:00:00} {detroit y2038} { clock format 3256527600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.644 {time zone boundary case 2073-03-12 03:00:01} {detroit y2038} { clock format 3256527601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.645 {time zone boundary case 2073-11-05 01:59:59} {detroit y2038} { clock format 3277087199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.646 {time zone boundary case 2073-11-05 01:00:00} {detroit y2038} { clock format 3277087200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.647 {time zone boundary case 2073-11-05 01:00:01} {detroit y2038} { clock format 3277087201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.648 {time zone boundary case 2074-03-11 01:59:59} {detroit y2038} { clock format 3287977199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.649 {time zone boundary case 2074-03-11 03:00:00} {detroit y2038} { clock format 3287977200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.650 {time zone boundary case 2074-03-11 03:00:01} {detroit y2038} { clock format 3287977201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.651 {time zone boundary case 2074-11-04 01:59:59} {detroit y2038} { clock format 3308536799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.652 {time zone boundary case 2074-11-04 01:00:00} {detroit y2038} { clock format 3308536800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.653 {time zone boundary case 2074-11-04 01:00:01} {detroit y2038} { clock format 3308536801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.654 {time zone boundary case 2075-03-10 01:59:59} {detroit y2038} { clock format 3319426799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.655 {time zone boundary case 2075-03-10 03:00:00} {detroit y2038} { clock format 3319426800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.656 {time zone boundary case 2075-03-10 03:00:01} {detroit y2038} { clock format 3319426801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.657 {time zone boundary case 2075-11-03 01:59:59} {detroit y2038} { clock format 3339986399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.658 {time zone boundary case 2075-11-03 01:00:00} {detroit y2038} { clock format 3339986400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.659 {time zone boundary case 2075-11-03 01:00:01} {detroit y2038} { clock format 3339986401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.660 {time zone boundary case 2076-03-08 01:59:59} {detroit y2038} { clock format 3350876399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.661 {time zone boundary case 2076-03-08 03:00:00} {detroit y2038} { clock format 3350876400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.662 {time zone boundary case 2076-03-08 03:00:01} {detroit y2038} { clock format 3350876401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.663 {time zone boundary case 2076-11-01 01:59:59} {detroit y2038} { clock format 3371435999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.664 {time zone boundary case 2076-11-01 01:00:00} {detroit y2038} { clock format 3371436000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.665 {time zone boundary case 2076-11-01 01:00:01} {detroit y2038} { clock format 3371436001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.666 {time zone boundary case 2077-03-14 01:59:59} {detroit y2038} { clock format 3382930799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.667 {time zone boundary case 2077-03-14 03:00:00} {detroit y2038} { clock format 3382930800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.668 {time zone boundary case 2077-03-14 03:00:01} {detroit y2038} { clock format 3382930801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.669 {time zone boundary case 2077-11-07 01:59:59} {detroit y2038} { clock format 3403490399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.670 {time zone boundary case 2077-11-07 01:00:00} {detroit y2038} { clock format 3403490400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.671 {time zone boundary case 2077-11-07 01:00:01} {detroit y2038} { clock format 3403490401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.672 {time zone boundary case 2078-03-13 01:59:59} {detroit y2038} { clock format 3414380399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.673 {time zone boundary case 2078-03-13 03:00:00} {detroit y2038} { clock format 3414380400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.674 {time zone boundary case 2078-03-13 03:00:01} {detroit y2038} { clock format 3414380401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.675 {time zone boundary case 2078-11-06 01:59:59} {detroit y2038} { clock format 3434939999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.676 {time zone boundary case 2078-11-06 01:00:00} {detroit y2038} { clock format 3434940000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.677 {time zone boundary case 2078-11-06 01:00:01} {detroit y2038} { clock format 3434940001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.678 {time zone boundary case 2079-03-12 01:59:59} {detroit y2038} { clock format 3445829999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.679 {time zone boundary case 2079-03-12 03:00:00} {detroit y2038} { clock format 3445830000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.680 {time zone boundary case 2079-03-12 03:00:01} {detroit y2038} { clock format 3445830001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.681 {time zone boundary case 2079-11-05 01:59:59} {detroit y2038} { clock format 3466389599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.682 {time zone boundary case 2079-11-05 01:00:00} {detroit y2038} { clock format 3466389600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.683 {time zone boundary case 2079-11-05 01:00:01} {detroit y2038} { clock format 3466389601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.684 {time zone boundary case 2080-03-10 01:59:59} {detroit y2038} { clock format 3477279599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.685 {time zone boundary case 2080-03-10 03:00:00} {detroit y2038} { clock format 3477279600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.686 {time zone boundary case 2080-03-10 03:00:01} {detroit y2038} { clock format 3477279601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.687 {time zone boundary case 2080-11-03 01:59:59} {detroit y2038} { clock format 3497839199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.688 {time zone boundary case 2080-11-03 01:00:00} {detroit y2038} { clock format 3497839200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.689 {time zone boundary case 2080-11-03 01:00:01} {detroit y2038} { clock format 3497839201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.690 {time zone boundary case 2081-03-09 01:59:59} {detroit y2038} { clock format 3508729199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.691 {time zone boundary case 2081-03-09 03:00:00} {detroit y2038} { clock format 3508729200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.692 {time zone boundary case 2081-03-09 03:00:01} {detroit y2038} { clock format 3508729201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.693 {time zone boundary case 2081-11-02 01:59:59} {detroit y2038} { clock format 3529288799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.694 {time zone boundary case 2081-11-02 01:00:00} {detroit y2038} { clock format 3529288800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.695 {time zone boundary case 2081-11-02 01:00:01} {detroit y2038} { clock format 3529288801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.696 {time zone boundary case 2082-03-08 01:59:59} {detroit y2038} { clock format 3540178799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.697 {time zone boundary case 2082-03-08 03:00:00} {detroit y2038} { clock format 3540178800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.698 {time zone boundary case 2082-03-08 03:00:01} {detroit y2038} { clock format 3540178801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.699 {time zone boundary case 2082-11-01 01:59:59} {detroit y2038} { clock format 3560738399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.700 {time zone boundary case 2082-11-01 01:00:00} {detroit y2038} { clock format 3560738400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.701 {time zone boundary case 2082-11-01 01:00:01} {detroit y2038} { clock format 3560738401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.702 {time zone boundary case 2083-03-14 01:59:59} {detroit y2038} { clock format 3572233199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.703 {time zone boundary case 2083-03-14 03:00:00} {detroit y2038} { clock format 3572233200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.704 {time zone boundary case 2083-03-14 03:00:01} {detroit y2038} { clock format 3572233201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.705 {time zone boundary case 2083-11-07 01:59:59} {detroit y2038} { clock format 3592792799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.706 {time zone boundary case 2083-11-07 01:00:00} {detroit y2038} { clock format 3592792800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.707 {time zone boundary case 2083-11-07 01:00:01} {detroit y2038} { clock format 3592792801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.708 {time zone boundary case 2084-03-12 01:59:59} {detroit y2038} { clock format 3603682799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.709 {time zone boundary case 2084-03-12 03:00:00} {detroit y2038} { clock format 3603682800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.710 {time zone boundary case 2084-03-12 03:00:01} {detroit y2038} { clock format 3603682801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.711 {time zone boundary case 2084-11-05 01:59:59} {detroit y2038} { clock format 3624242399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.712 {time zone boundary case 2084-11-05 01:00:00} {detroit y2038} { clock format 3624242400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.713 {time zone boundary case 2084-11-05 01:00:01} {detroit y2038} { clock format 3624242401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.714 {time zone boundary case 2085-03-11 01:59:59} {detroit y2038} { clock format 3635132399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.715 {time zone boundary case 2085-03-11 03:00:00} {detroit y2038} { clock format 3635132400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.716 {time zone boundary case 2085-03-11 03:00:01} {detroit y2038} { clock format 3635132401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.717 {time zone boundary case 2085-11-04 01:59:59} {detroit y2038} { clock format 3655691999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.718 {time zone boundary case 2085-11-04 01:00:00} {detroit y2038} { clock format 3655692000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.719 {time zone boundary case 2085-11-04 01:00:01} {detroit y2038} { clock format 3655692001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.720 {time zone boundary case 2086-03-10 01:59:59} {detroit y2038} { clock format 3666581999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.721 {time zone boundary case 2086-03-10 03:00:00} {detroit y2038} { clock format 3666582000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.722 {time zone boundary case 2086-03-10 03:00:01} {detroit y2038} { clock format 3666582001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.723 {time zone boundary case 2086-11-03 01:59:59} {detroit y2038} { clock format 3687141599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.724 {time zone boundary case 2086-11-03 01:00:00} {detroit y2038} { clock format 3687141600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.725 {time zone boundary case 2086-11-03 01:00:01} {detroit y2038} { clock format 3687141601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.726 {time zone boundary case 2087-03-09 01:59:59} {detroit y2038} { clock format 3698031599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.727 {time zone boundary case 2087-03-09 03:00:00} {detroit y2038} { clock format 3698031600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.728 {time zone boundary case 2087-03-09 03:00:01} {detroit y2038} { clock format 3698031601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.729 {time zone boundary case 2087-11-02 01:59:59} {detroit y2038} { clock format 3718591199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.730 {time zone boundary case 2087-11-02 01:00:00} {detroit y2038} { clock format 3718591200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.731 {time zone boundary case 2087-11-02 01:00:01} {detroit y2038} { clock format 3718591201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.732 {time zone boundary case 2088-03-14 01:59:59} {detroit y2038} { clock format 3730085999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.733 {time zone boundary case 2088-03-14 03:00:00} {detroit y2038} { clock format 3730086000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.734 {time zone boundary case 2088-03-14 03:00:01} {detroit y2038} { clock format 3730086001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.735 {time zone boundary case 2088-11-07 01:59:59} {detroit y2038} { clock format 3750645599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.736 {time zone boundary case 2088-11-07 01:00:00} {detroit y2038} { clock format 3750645600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.737 {time zone boundary case 2088-11-07 01:00:01} {detroit y2038} { clock format 3750645601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.738 {time zone boundary case 2089-03-13 01:59:59} {detroit y2038} { clock format 3761535599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.739 {time zone boundary case 2089-03-13 03:00:00} {detroit y2038} { clock format 3761535600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.740 {time zone boundary case 2089-03-13 03:00:01} {detroit y2038} { clock format 3761535601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.741 {time zone boundary case 2089-11-06 01:59:59} {detroit y2038} { clock format 3782095199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.742 {time zone boundary case 2089-11-06 01:00:00} {detroit y2038} { clock format 3782095200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.743 {time zone boundary case 2089-11-06 01:00:01} {detroit y2038} { clock format 3782095201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.744 {time zone boundary case 2090-03-12 01:59:59} {detroit y2038} { clock format 3792985199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.745 {time zone boundary case 2090-03-12 03:00:00} {detroit y2038} { clock format 3792985200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.746 {time zone boundary case 2090-03-12 03:00:01} {detroit y2038} { clock format 3792985201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.747 {time zone boundary case 2090-11-05 01:59:59} {detroit y2038} { clock format 3813544799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.748 {time zone boundary case 2090-11-05 01:00:00} {detroit y2038} { clock format 3813544800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.749 {time zone boundary case 2090-11-05 01:00:01} {detroit y2038} { clock format 3813544801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.750 {time zone boundary case 2091-03-11 01:59:59} {detroit y2038} { clock format 3824434799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.751 {time zone boundary case 2091-03-11 03:00:00} {detroit y2038} { clock format 3824434800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.752 {time zone boundary case 2091-03-11 03:00:01} {detroit y2038} { clock format 3824434801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.753 {time zone boundary case 2091-11-04 01:59:59} {detroit y2038} { clock format 3844994399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.754 {time zone boundary case 2091-11-04 01:00:00} {detroit y2038} { clock format 3844994400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.755 {time zone boundary case 2091-11-04 01:00:01} {detroit y2038} { clock format 3844994401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.756 {time zone boundary case 2092-03-09 01:59:59} {detroit y2038} { clock format 3855884399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.757 {time zone boundary case 2092-03-09 03:00:00} {detroit y2038} { clock format 3855884400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.758 {time zone boundary case 2092-03-09 03:00:01} {detroit y2038} { clock format 3855884401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.759 {time zone boundary case 2092-11-02 01:59:59} {detroit y2038} { clock format 3876443999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.760 {time zone boundary case 2092-11-02 01:00:00} {detroit y2038} { clock format 3876444000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.761 {time zone boundary case 2092-11-02 01:00:01} {detroit y2038} { clock format 3876444001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.762 {time zone boundary case 2093-03-08 01:59:59} {detroit y2038} { clock format 3887333999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.763 {time zone boundary case 2093-03-08 03:00:00} {detroit y2038} { clock format 3887334000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.764 {time zone boundary case 2093-03-08 03:00:01} {detroit y2038} { clock format 3887334001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.765 {time zone boundary case 2093-11-01 01:59:59} {detroit y2038} { clock format 3907893599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.766 {time zone boundary case 2093-11-01 01:00:00} {detroit y2038} { clock format 3907893600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.767 {time zone boundary case 2093-11-01 01:00:01} {detroit y2038} { clock format 3907893601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.768 {time zone boundary case 2094-03-14 01:59:59} {detroit y2038} { clock format 3919388399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.769 {time zone boundary case 2094-03-14 03:00:00} {detroit y2038} { clock format 3919388400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.770 {time zone boundary case 2094-03-14 03:00:01} {detroit y2038} { clock format 3919388401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.771 {time zone boundary case 2094-11-07 01:59:59} {detroit y2038} { clock format 3939947999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.772 {time zone boundary case 2094-11-07 01:00:00} {detroit y2038} { clock format 3939948000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.773 {time zone boundary case 2094-11-07 01:00:01} {detroit y2038} { clock format 3939948001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.774 {time zone boundary case 2095-03-13 01:59:59} {detroit y2038} { clock format 3950837999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.775 {time zone boundary case 2095-03-13 03:00:00} {detroit y2038} { clock format 3950838000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.776 {time zone boundary case 2095-03-13 03:00:01} {detroit y2038} { clock format 3950838001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.777 {time zone boundary case 2095-11-06 01:59:59} {detroit y2038} { clock format 3971397599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.778 {time zone boundary case 2095-11-06 01:00:00} {detroit y2038} { clock format 3971397600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.779 {time zone boundary case 2095-11-06 01:00:01} {detroit y2038} { clock format 3971397601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.780 {time zone boundary case 2096-03-11 01:59:59} {detroit y2038} { clock format 3982287599 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.781 {time zone boundary case 2096-03-11 03:00:00} {detroit y2038} { clock format 3982287600 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.782 {time zone boundary case 2096-03-11 03:00:01} {detroit y2038} { clock format 3982287601 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.783 {time zone boundary case 2096-11-04 01:59:59} {detroit y2038} { clock format 4002847199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.784 {time zone boundary case 2096-11-04 01:00:00} {detroit y2038} { clock format 4002847200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.785 {time zone boundary case 2096-11-04 01:00:01} {detroit y2038} { clock format 4002847201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.786 {time zone boundary case 2097-03-10 01:59:59} {detroit y2038} { clock format 4013737199 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.787 {time zone boundary case 2097-03-10 03:00:00} {detroit y2038} { clock format 4013737200 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.788 {time zone boundary case 2097-03-10 03:00:01} {detroit y2038} { clock format 4013737201 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.789 {time zone boundary case 2097-11-03 01:59:59} {detroit y2038} { clock format 4034296799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.790 {time zone boundary case 2097-11-03 01:00:00} {detroit y2038} { clock format 4034296800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.791 {time zone boundary case 2097-11-03 01:00:01} {detroit y2038} { clock format 4034296801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.792 {time zone boundary case 2098-03-09 01:59:59} {detroit y2038} { clock format 4045186799 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.793 {time zone boundary case 2098-03-09 03:00:00} {detroit y2038} { clock format 4045186800 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.794 {time zone boundary case 2098-03-09 03:00:01} {detroit y2038} { clock format 4045186801 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.795 {time zone boundary case 2098-11-02 01:59:59} {detroit y2038} { clock format 4065746399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.796 {time zone boundary case 2098-11-02 01:00:00} {detroit y2038} { clock format 4065746400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.797 {time zone boundary case 2098-11-02 01:00:01} {detroit y2038} { clock format 4065746401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} test clock-5.798 {time zone boundary case 2099-03-08 01:59:59} {detroit y2038} { clock format 4076636399 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0500 EST} test clock-5.799 {time zone boundary case 2099-03-08 03:00:00} {detroit y2038} { clock format 4076636400 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:00 -0400 EDT} test clock-5.800 {time zone boundary case 2099-03-08 03:00:01} {detroit y2038} { clock format 4076636401 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {03:00:01 -0400 EDT} test clock-5.801 {time zone boundary case 2099-11-01 01:59:59} {detroit y2038} { clock format 4097195999 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:59:59 -0400 EDT} test clock-5.802 {time zone boundary case 2099-11-01 01:00:00} {detroit y2038} { clock format 4097196000 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:00 -0500 EST} test clock-5.803 {time zone boundary case 2099-11-01 01:00:01} {detroit y2038} { clock format 4097196001 -format {%H:%M:%S %z %Z} \ -timezone :America/Detroit } {01:00:01 -0500 EST} # END testcases5 # Test input conversions. test clock-6.0 {input of seconds} { clock scan {-9223372036854775808} -format %s -gmt true } -9223372036854775808 test clock-6.1 {input of seconds} { clock scan {-2147483649} -format %s -gmt true } -2147483649 test clock-6.2 {input of seconds} { clock scan {-2147483648} -format %s -gmt true } -2147483648 test clock-6.3 {input of seconds} { clock scan {-1} -format %s -gmt true } -1 test clock-6.4 {input of seconds} { clock scan {0} -format %s -gmt true } 0 test clock-6.5 {input of seconds} { clock scan {1} -format %s -gmt true } 1 test clock-6.6 {input of seconds} { clock scan {2147483647} -format %s -gmt true } 2147483647 test clock-6.7 {input of seconds} { clock scan {2147483648} -format %s -gmt true } 2147483648 test clock-6.8 {input of seconds} { clock scan {9223372036854775807} -format %s -gmt true } 9223372036854775807 test clock-6.8b "clock scan - bad base" { list [catch {clock scan "" -base foo -gmt 1} msg opt] $msg [dict getd $opt -errorcode {}] } {1 {bad seconds "foo": must be now or integer} {CLOCK badOption foo}} test clock-6.9 {input of seconds - overflow} { list [catch {clock scan -9223372036854775809 -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } {1 {integer value too large to represent} {CLOCK dateTooLarge}} test clock-6.10 {input of seconds - overflow} { list [catch {clock scan 9223372036854775808 -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } {1 {integer value too large to represent} {CLOCK dateTooLarge}} foreach sign {{} -} { test clock-6.10a$sign {input of seconds - overflow, bug [1f40aa83c5]} { list [catch {clock scan ${sign}27670116110564327423 -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } {1 {integer value too large to represent} {CLOCK dateTooLarge}} test clock-6.10b$sign {input of seconds - overflow, bug [1f40aa83c5]} { list [catch {clock scan ${sign}27670116110564327424 -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } {1 {integer value too large to represent} {CLOCK dateTooLarge}} test clock-6.10c$sign {input of seconds - no overflow, bug [1f40aa83c5]} { list [catch {clock scan ${sign}[string repeat 9 18] -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } [list 0 ${sign}[string repeat 9 18] {}] test clock-6.10d$sign {input of seconds - overflow, bug [1f40aa83c5]} { list [catch {clock scan ${sign}[string repeat 9 19] -format %s -gmt true} result opt] $result [dict getd $opt -errorcode ""] } {1 {integer value too large to represent} {CLOCK dateTooLarge}} # both fololowing freescan test don't generate overflow error, # since it is a free scan, thus the token is simply not recognized further in yacc lexer, # therefore we get parse error (can be surely changed latter): test clock-6.10e$sign {input of seconds - overflow (but since freescan parse error, but not boom), bug [1f40aa83c5]} -body { list [catch {clock scan ${sign}27670116110564327423 -gmt true} result opt] $result [dict getd $opt -errorcode ""] } -match glob -result {1 {unable to convert date-time string "*": syntax error *} {TCL VALUE DATE PARSE}} test clock-6.10f$sign {input of seconds - overflow (but since freescan parse error, but not boom), bug [1f40aa83c5]} -body { list [catch {clock scan ${sign}27670116110564327424 -gmt true} result opt] $result [dict getd $opt -errorcode ""] } -match glob -result {1 {unable to convert date-time string "*": syntax error *} {TCL VALUE DATE PARSE}} }; unset sign test clock-6.11 {input of seconds - two values} { clock scan {1 2} -format {%s %s} -gmt true } 2 test clock-6.12.0 {input of short forms of locale token (%b)} { list [clock scan "12 Ja 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] \ [clock scan "12 Au 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] } {979257600 997574400} test clock-6.12.1 {input of all forms of unambiguous short locale token (%b)} { # find all unambiguous short forms and check it'll be scanned successful and correctly: set months {January February March April May June July August September October November December} set res {} foreach mon $months { set i 0 while {[incr i] < [string length $mon]} { # short month form: set shm [string range $mon 0 $i] # differentiate ambiguous: if {[llength [lsearch -all -glob $months "${shm}*"]] <= 1} { # unambiguous (expected date with wull month): set e "12 $mon 2001" } else { # ambiguous (expected error): set e "input string does not match supplied format" } set s "12 $shm 2001" # scan and format with full month name: catch {clock format \ [clock scan $s -format "%d %b %Y" -locale en_US_roman -gmt 1] \ -format "%d %B %Y" -locale en_US_roman -gmt 1} t # check it corresponds the full form: if {$t ne $e} { lappend res "unexpected result converting $s, expected \"$e\", got \"$t\"" } } } set res } {} test clock-6.13 {input of lowercase locale token (%b)} { list [clock scan "12 ja 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] \ [clock scan "12 au 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] } {979257600 997574400} test clock-6.14 {input of uppercase locale token (%b)} { list [clock scan "12 JA 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] \ [clock scan "12 AU 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1] } {979257600 997574400} test clock-6.15 {input of ambiguous short locale token (%b)} { list [catch { clock scan "12 J 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1 } result] $result $errorCode } {1 {input string does not match supplied format} {CLOCK badInputString}} test clock-6.16 {input of ambiguous short locale token (%b)} { list [catch { clock scan "12 Ju 2001" -format "%d %b %Y" -locale en_US_roman -gmt 1 } result] $result $errorCode } {1 {input string does not match supplied format} {CLOCK badInputString}} test clock-6.17 {spaces are always optional in non-strict mode (default)} { list [clock scan "2009-06-30T18:30:00+02:00" -format "%Y-%m-%dT%H:%M:%S%z" -gmt 1] \ [clock scan "2009-06-30T18:30:00 +02:00" -format "%Y-%m-%dT%H:%M:%S%z" -gmt 1] \ [clock scan "2009-06-30T18:30:00Z" -format "%Y-%m-%dT%H:%M:%S%z" -timezone CET] \ [clock scan "2009-06-30T18:30:00 Z" -format "%Y-%m-%dT%H:%M:%S%z" -timezone CET] } {1246379400 1246379400 1246386600 1246386600} test clock-6.18 {zone token (%z) is optional} { list [clock scan "2009-06-30T18:30:00 -01:00" -format "%Y-%m-%dT%H:%M:%S%z" -gmt 1] \ [clock scan "2009-06-30T18:30:00" -format "%Y-%m-%dT%H:%M:%S%z" -gmt 1] \ [clock scan " 2009-06-30T18:30:00 " -format "%Y-%m-%dT%H:%M:%S%z" -gmt 1] \ } {1246390200 1246386600 1246386600} test clock-6.19 {no token parsing} { list [catch { clock scan "%E%O%" -format "%E%O%" }] \ [catch { clock scan "...%..." -format "...%%..." }] } {0 0} test clock-6.20 {special char tokens %n, %t} { clock scan "30\t06\t2009\n18\t30" -format "%d%t%m%t%Y%n%H%t%M" -gmt 1 } 1246386600 # Hi, Jeff! proc _testStarDates {s {days {366*2}} {step {86400}}} { set step [expr {int($step * 86400)}] # reconvert - arrange in order of stardate: set s [set i [clock scan [clock format $s -f "%Q" -g 1] -g 1]] # test: set wrong {} while {$i < $s + $days*86400} { set d [clock format $i -f "%Q" -g 1] if {![regexp {^Stardate \d+\.\d$} $d]} { lappend wrong "wrong: $d -- ($i) -- [clock format $i -g 1]" } if {[catch { set i2 [clock scan $d -f "%Q" -g 1] } msg]} { lappend wrong "$d -- ($i) -- [clock format $i -g 1]: $msg" } if {$i != $i2} { lappend wrong "$d -- ($i != $i2) -- [clock format $i -g 1]" } incr i $step } join $wrong \n } test clock-6.21.0 {Stardate 0 day} { list [set d [clock format -757382400 -format "%Q" -gmt 1]] \ [clock scan $d -format "%Q" -gmt 1] } [list "Stardate 00000.0" -757382400] test clock-6.21.0.1 {Stardate 0.1 - 1.9 (test negative clock value -> positive Stardate)} { _testStarDates -757382400 2 0.1 } {} test clock-6.21.0.2 {Stardate 10000.1 - 10002.9 (test negative clock value -> positive Stardate)} { _testStarDates [clock scan "Stardate 10000.1" -f %Q -g 1] 3 0.1 } {} test clock-6.21.0.3 {Stardate 80000.1 - 80002.9 (test positive clock value)} { _testStarDates [clock scan "Stardate 80001.1" -f %Q -g 1] 3 0.1 } {} test clock-6.21.1 {Stardate} { list [set d [clock format 1482857280 -format "%Q" -gmt 1]] \ [clock scan $d -format "%Q" -gmt 1] } [list "Stardate 70986.7" 1482857280] test clock-6.21.2 {Stardate next time} { list [set d [clock format 1482865920 -format "%Q" -gmt 1]] \ [clock scan $d -format "%Q" -gmt 1] } [list "Stardate 70986.8" 1482865920] test clock-6.21.3 {Stardate correct scan over year (leap year, begin, middle and end of the year)} { _testStarDates [clock scan "01.01.2016" -f "%d.%m.%Y" -g 1] [expr {366*2}] 1 } {} rename _testStarDates {} test clock-6.22.1 {Greedy match} { clock format [clock scan "111" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 00:00:00 GMT 2001} test clock-6.22.2 {Greedy match} { clock format [clock scan "1111" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Thu Jan 11 00:00:00 GMT 2001} test clock-6.22.3 {Greedy match} { clock format [clock scan "11111" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Sun Nov 11 00:00:00 GMT 2001} test clock-6.22.4 {Greedy match} { clock format [clock scan "111111" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Fri Nov 11 00:00:00 GMT 2011} test clock-6.22.5 {Greedy match} { clock format [clock scan "1 1 1" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 00:00:00 GMT 2001} test clock-6.22.6 {Greedy match} { clock format [clock scan "111 1" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Thu Jan 11 00:00:00 GMT 2001} test clock-6.22.7 {Greedy match} { clock format [clock scan "1 111" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Thu Nov 01 00:00:00 GMT 2001} test clock-6.22.8 {Greedy match} { clock format [clock scan "1 11 1" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Thu Nov 01 00:00:00 GMT 2001} test clock-6.22.9 {Greedy match} { clock format [clock scan "1 11 11" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Tue Nov 01 00:00:00 GMT 2011} test clock-6.22.10 {Greedy match} { clock format [clock scan "11 11 11" -format "%d%m%y" -gmt 1] -locale en -gmt 1 } {Fri Nov 11 00:00:00 GMT 2011} test clock-6.22.11 {Greedy match} { clock format [clock scan "1111 120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Sat Jan 01 01:02:00 GMT 2011} test clock-6.22.12 {Greedy match} { clock format [clock scan "11 1 120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 01:02:00 GMT 2001} test clock-6.22.13 {Greedy match} { clock format [clock scan "1 11 120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 01:02:00 GMT 2001} test clock-6.22.14 {Greedy match} { clock format [clock scan "111120" -format "%y%m%d%H%M%S" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 01:02:00 GMT 2001} test clock-6.22.15 {Greedy match} { clock format [clock scan "1111120" -format "%y%m%d%H%M%S" -gmt 1] -locale en -gmt 1 } {Sat Jan 01 01:02:00 GMT 2011} test clock-6.22.16 {Greedy match} { clock format [clock scan "11121120" -format "%y%m%d%H%M%S" -gmt 1] -locale en -gmt 1 } {Thu Dec 01 01:02:00 GMT 2011} test clock-6.22.17 {Greedy match} { clock format [clock scan "111213120" -format "%y%m%d%H%M%S" -gmt 1] -locale en -gmt 1 } {Tue Dec 13 01:02:00 GMT 2011} test clock-6.22.17.1 {Greedy match (space wins as date-time separator)} { clock format [clock scan "1112 13120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Sun Jan 02 13:12:00 GMT 2011} test clock-6.22.18 {Greedy match (second space wins as date-time separator)} { clock format [clock scan "1112 13 120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Tue Dec 13 01:02:00 GMT 2011} test clock-6.22.19 {Greedy match (space wins as date-time separator)} { clock format [clock scan "111 213120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Mon Jan 01 21:31:20 GMT 2001} test clock-6.22.20 {Greedy match (second space wins as date-time separator)} { clock format [clock scan "111 2 13120" -format "%y%m%d %H%M%S" -gmt 1] -locale en -gmt 1 } {Sun Jan 02 13:12:00 GMT 2011} test clock-6.23 {clock scan: text with token (bug [a858d95f4bfddafb])} { clock scan {text(01)} -format text(%d) -gmt 1 -base 0 } 0 test clock-7.1 {Julian Day} { clock scan 0 -format %J -gmt true } -210866803200 test clock-7.2 {Julian Day} { clock format [clock scan 2440588 -format %J -gmt true] \ -format %Y-%m-%d -gmt true } 1970-01-01 test clock-7.3 {Julian Day} { clock format [clock scan 2451545 -format %J -gmt true] \ -format %Y-%m-%d -gmt true } 2000-01-01 test clock-7.3.1 {Julian Day} { clock format [clock scan 2488070 -format %J -gmt true] \ -format %Y-%m-%d -gmt true } 2100-01-01 test clock-7.4 {Julian Day} { clock format [clock scan 5373484 -format %J -gmt true] \ -format %Y-%m-%d -gmt true } 9999-12-31 test clock-7.5 {Julian Day, bad} { list [catch { clock scan bogus -format %J } result] $result $errorCode } {1 {input string does not match supplied format} {CLOCK badInputString}} test clock-7.6 {Julian Day, overflow} { list [catch { clock scan 5373485 -format %J } result] $result $errorCode } {1 {requested date too large to represent} {CLOCK dateTooLarge}} test clock-7.7 {Julian Day, overflow} { list [catch { clock scan 2147483648 -format %J } result] $result $errorCode } {1 {requested date too large to represent} {CLOCK dateTooLarge}} test clock-7.8 {Julian Day, precedence below seconds} { list [clock scan {2440588 86400} -format {%J %s} -gmt true] \ [clock scan {2440589 0} -format {%J %s} -gmt true] \ [clock scan {86400 2440588} -format {%s %J} -gmt true] \ [clock scan {0 2440589} -format {%s %J} -gmt true] } {86400 0 86400 0} test clock-7.9 {Julian Day, two values} { clock scan {2440588 2440589} -format {%J %J} -gmt true } 86400 test clock-7.10 {Julian Day, negative amount} { # Note: %J does not accept negative input; # add negative amounts to Julian day 0 instead set s0 [clock scan 0 -format %J -gmt true] set J0 [scan [clock format $s0 -format %J -gmt true] %lld] set s0m1d [clock add $s0 -1 days -timezone :UTC] set s0m24h [clock add $s0 -24 hours -timezone :UTC] set J0m24h [scan [clock format $s0m24h -format %J -gmt true] %lld] set s0m1s [clock add $s0 -1 seconds -timezone :UTC] set J0m1s [scan [clock format $s0m1s -format %J -gmt true] %lld] list $s0m1d $s0m24h $J0m24h $s0m1s $J0m1s $s0 $J0 \ [::tcl::mathop::== $s0m1d $s0m24h] [::tcl::mathop::== $J0m24h $J0m1s] } [list -210866889600 -210866889600 -1 -210866803201 -1 -210866803200 0 1 1] test clock-7.11.1 {Calendar vs Astronomical Julian Day (without and with time fraction)} { list \ [clock scan {2440588} -format {%J} -gmt true] \ [clock scan {2440588} -format {%EJ} -gmt true] \ [clock scan {2440588} -format {%Ej} -gmt true] \ [clock scan {2440588.5} -format {%EJ} -gmt true] \ [clock scan {2440588.5} -format {%Ej} -gmt true] \ } {0 0 43200 43200 86400} test clock-7.11.2 {Astronomical JDN/JD} { clock scan 0 -format %Ej -gmt true } -210866760000 test clock-7.12 {Astronomical JDN/JD} { clock format [clock scan 2440587.5 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "1970-01-01 00:00:00" test clock-7.13 {Astronomical JDN/JD} { clock format [clock scan 2451544.5 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "2000-01-01 00:00:00" test clock-7.13.1 {Astronomical JDN/JD} { clock format [clock scan 2488069.5 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "2100-01-01 00:00:00" test clock-7.14 {Astronomical JDN/JD} { clock format [clock scan 5373483.5 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "9999-12-31 00:00:00" test clock-7.14.1 {Astronomical JDN/JD} { clock format [clock scan 5373484 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "9999-12-31 12:00:00" test clock-7.14.2 {Astronomical JDN/JD} { clock format [clock scan 5373484.49999 -format %Ej -gmt true] \ -format "%Y-%m-%d %T" -gmt true } "9999-12-31 23:59:59" test clock-7.15 {Astronomical JDN/JD, bad} { list [catch { clock scan bogus -format %Ej } result] $result $errorCode } {1 {input string does not match supplied format} {CLOCK badInputString}} test clock-7.16 {Astronomical JDN/JD, overflow} { list [catch { clock scan 5373484.5 -format %Ej } result] $result $errorCode \ [catch { clock scan 5373485 -format %Ej } result] $result $errorCode \ [catch { clock scan 2147483648 -format %Ej } result] $result $errorCode \ [catch { clock scan 2147483648.5 -format %Ej } result] $result $errorCode } [lrepeat 4 1 {requested date too large to represent} {CLOCK dateTooLarge}] test clock-7.18 {Astronomical JDN/JD, same precedence as seconds (last wins} { list [clock scan {2440588 86400} -format {%Ej %s} -gmt true] \ [clock scan {2440589 0} -format {%Ej %s} -gmt true] \ [clock scan {86400 2440588} -format {%s %Ej} -gmt true] \ [clock scan {0 2440589} -format {%s %Ej} -gmt true] } {86400 0 43200 129600} test clock-7.19 {Astronomical JDN/JD, two values} { clock scan {2440588 2440589} -format {%Ej %Ej} -gmt true } 129600 test clock-7.20 {all JDN/JD are signed (and extended accept floats)} { set res {} foreach i {%J %EJ %Ej} { lappend res [clock scan "-1" -format $i -gmt 1] } foreach i {%EJ %Ej} { lappend res [clock scan "-1.5" -format $i -gmt 1] } set res } {-210866889600 -210866889600 -210866846400 -210866846400 -210866803200} # BEGIN testcases8 # Test parsing of ccyymmdd test clock-8.1 {parse ccyymmdd} { clock scan {1970 Jan 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.2 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.3 {parse ccyymmdd} { clock scan {1970 Jan 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.4 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.5 {parse ccyymmdd} { clock scan {1970 January 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.6 {parse ccyymmdd} { clock scan {1970 January ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.7 {parse ccyymmdd} { clock scan {1970 January 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.8 {parse ccyymmdd} { clock scan {1970 January ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.9 {parse ccyymmdd} { clock scan {1970 Jan 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.10 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.11 {parse ccyymmdd} { clock scan {1970 Jan 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.12 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.13 {parse ccyymmdd} { clock scan {1970 01 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.14 {parse ccyymmdd} { clock scan {1970 01 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.15 {parse ccyymmdd} { clock scan {1970 01 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.16 {parse ccyymmdd} { clock scan {1970 01 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.17 {parse ccyymmdd} { clock scan {1970 i 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.18 {parse ccyymmdd} { clock scan {1970 i ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.19 {parse ccyymmdd} { clock scan {1970 i 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.20 {parse ccyymmdd} { clock scan {1970 i ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.21 {parse ccyymmdd} { clock scan {1970 1 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.22 {parse ccyymmdd} { clock scan {1970 1 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.23 {parse ccyymmdd} { clock scan {1970 1 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.24 {parse ccyymmdd} { clock scan {1970 1 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.25 {parse ccyymmdd} { clock scan {1970 Jan 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.26 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.27 {parse ccyymmdd} { clock scan {1970 Jan 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.28 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.29 {parse ccyymmdd} { clock scan {1970 January 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.30 {parse ccyymmdd} { clock scan {1970 January ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.31 {parse ccyymmdd} { clock scan {1970 January 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.32 {parse ccyymmdd} { clock scan {1970 January ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.33 {parse ccyymmdd} { clock scan {1970 Jan 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.34 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.35 {parse ccyymmdd} { clock scan {1970 Jan 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.36 {parse ccyymmdd} { clock scan {1970 Jan ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.37 {parse ccyymmdd} { clock scan {1970 01 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.38 {parse ccyymmdd} { clock scan {1970 01 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.39 {parse ccyymmdd} { clock scan {1970 01 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.40 {parse ccyymmdd} { clock scan {1970 01 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.41 {parse ccyymmdd} { clock scan {1970 i 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.42 {parse ccyymmdd} { clock scan {1970 i ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.43 {parse ccyymmdd} { clock scan {1970 i 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.44 {parse ccyymmdd} { clock scan {1970 i ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.45 {parse ccyymmdd} { clock scan {1970 1 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 86400 test clock-8.46 {parse ccyymmdd} { clock scan {1970 1 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 86400 test clock-8.47 {parse ccyymmdd} { clock scan {1970 1 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 86400 test clock-8.48 {parse ccyymmdd} { clock scan {1970 1 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-8.49 {parse ccyymmdd} { clock scan 01/02/1970 -format %x -locale en_US_roman -gmt 1 } 86400 test clock-8.50 {parse ccyymmdd} { clock scan 01/02/1970 -format %D -locale en_US_roman -gmt 1 } 86400 test clock-8.51 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.52 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.53 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.54 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.55 {parse ccyymmdd} { clock scan {1970 January 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.56 {parse ccyymmdd} { clock scan {1970 January xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.57 {parse ccyymmdd} { clock scan {1970 January 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.58 {parse ccyymmdd} { clock scan {1970 January xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.59 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.60 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.61 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.62 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.63 {parse ccyymmdd} { clock scan {1970 01 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.64 {parse ccyymmdd} { clock scan {1970 01 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.65 {parse ccyymmdd} { clock scan {1970 01 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.66 {parse ccyymmdd} { clock scan {1970 01 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.67 {parse ccyymmdd} { clock scan {1970 i 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.68 {parse ccyymmdd} { clock scan {1970 i xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.69 {parse ccyymmdd} { clock scan {1970 i 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.70 {parse ccyymmdd} { clock scan {1970 i xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.71 {parse ccyymmdd} { clock scan {1970 1 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.72 {parse ccyymmdd} { clock scan {1970 1 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.73 {parse ccyymmdd} { clock scan {1970 1 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.74 {parse ccyymmdd} { clock scan {1970 1 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.75 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.76 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.77 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.78 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.79 {parse ccyymmdd} { clock scan {1970 January 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.80 {parse ccyymmdd} { clock scan {1970 January xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.81 {parse ccyymmdd} { clock scan {1970 January 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.82 {parse ccyymmdd} { clock scan {1970 January xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.83 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.84 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.85 {parse ccyymmdd} { clock scan {1970 Jan 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.86 {parse ccyymmdd} { clock scan {1970 Jan xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.87 {parse ccyymmdd} { clock scan {1970 01 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.88 {parse ccyymmdd} { clock scan {1970 01 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.89 {parse ccyymmdd} { clock scan {1970 01 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.90 {parse ccyymmdd} { clock scan {1970 01 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.91 {parse ccyymmdd} { clock scan {1970 i 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.92 {parse ccyymmdd} { clock scan {1970 i xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.93 {parse ccyymmdd} { clock scan {1970 i 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.94 {parse ccyymmdd} { clock scan {1970 i xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.95 {parse ccyymmdd} { clock scan {1970 1 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 2592000 test clock-8.96 {parse ccyymmdd} { clock scan {1970 1 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-8.97 {parse ccyymmdd} { clock scan {1970 1 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 2592000 test clock-8.98 {parse ccyymmdd} { clock scan {1970 1 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-8.99 {parse ccyymmdd} { clock scan 01/31/1970 -format %x -locale en_US_roman -gmt 1 } 2592000 test clock-8.100 {parse ccyymmdd} { clock scan 01/31/1970 -format %D -locale en_US_roman -gmt 1 } 2592000 test clock-8.101 {parse ccyymmdd} { clock scan {1970 Dec 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.102 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.103 {parse ccyymmdd} { clock scan {1970 Dec 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.104 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.105 {parse ccyymmdd} { clock scan {1970 December 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.106 {parse ccyymmdd} { clock scan {1970 December ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.107 {parse ccyymmdd} { clock scan {1970 December 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.108 {parse ccyymmdd} { clock scan {1970 December ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.109 {parse ccyymmdd} { clock scan {1970 Dec 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.110 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.111 {parse ccyymmdd} { clock scan {1970 Dec 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.112 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.113 {parse ccyymmdd} { clock scan {1970 12 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.114 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.115 {parse ccyymmdd} { clock scan {1970 12 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.116 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.117 {parse ccyymmdd} { clock scan {1970 xii 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.118 {parse ccyymmdd} { clock scan {1970 xii ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.119 {parse ccyymmdd} { clock scan {1970 xii 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.120 {parse ccyymmdd} { clock scan {1970 xii ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.121 {parse ccyymmdd} { clock scan {1970 12 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.122 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.123 {parse ccyymmdd} { clock scan {1970 12 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.124 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.125 {parse ccyymmdd} { clock scan {1970 Dec 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.126 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.127 {parse ccyymmdd} { clock scan {1970 Dec 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.128 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.129 {parse ccyymmdd} { clock scan {1970 December 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.130 {parse ccyymmdd} { clock scan {1970 December ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.131 {parse ccyymmdd} { clock scan {1970 December 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.132 {parse ccyymmdd} { clock scan {1970 December ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.133 {parse ccyymmdd} { clock scan {1970 Dec 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.134 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.135 {parse ccyymmdd} { clock scan {1970 Dec 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.136 {parse ccyymmdd} { clock scan {1970 Dec ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.137 {parse ccyymmdd} { clock scan {1970 12 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.138 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.139 {parse ccyymmdd} { clock scan {1970 12 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.140 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.141 {parse ccyymmdd} { clock scan {1970 xii 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.142 {parse ccyymmdd} { clock scan {1970 xii ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.143 {parse ccyymmdd} { clock scan {1970 xii 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.144 {parse ccyymmdd} { clock scan {1970 xii ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.145 {parse ccyymmdd} { clock scan {1970 12 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 28944000 test clock-8.146 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-8.147 {parse ccyymmdd} { clock scan {1970 12 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 28944000 test clock-8.148 {parse ccyymmdd} { clock scan {1970 12 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-8.149 {parse ccyymmdd} { clock scan 12/02/1970 -format %x -locale en_US_roman -gmt 1 } 28944000 test clock-8.150 {parse ccyymmdd} { clock scan 12/02/1970 -format %D -locale en_US_roman -gmt 1 } 28944000 test clock-8.151 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.152 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.153 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.154 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.155 {parse ccyymmdd} { clock scan {1970 December 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.156 {parse ccyymmdd} { clock scan {1970 December xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.157 {parse ccyymmdd} { clock scan {1970 December 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.158 {parse ccyymmdd} { clock scan {1970 December xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.159 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.160 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.161 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.162 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.163 {parse ccyymmdd} { clock scan {1970 12 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.164 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.165 {parse ccyymmdd} { clock scan {1970 12 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.166 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.167 {parse ccyymmdd} { clock scan {1970 xii 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.168 {parse ccyymmdd} { clock scan {1970 xii xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.169 {parse ccyymmdd} { clock scan {1970 xii 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.170 {parse ccyymmdd} { clock scan {1970 xii xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.171 {parse ccyymmdd} { clock scan {1970 12 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.172 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.173 {parse ccyymmdd} { clock scan {1970 12 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.174 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.175 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.176 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.177 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.178 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.179 {parse ccyymmdd} { clock scan {1970 December 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.180 {parse ccyymmdd} { clock scan {1970 December xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.181 {parse ccyymmdd} { clock scan {1970 December 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.182 {parse ccyymmdd} { clock scan {1970 December xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.183 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.184 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.185 {parse ccyymmdd} { clock scan {1970 Dec 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.186 {parse ccyymmdd} { clock scan {1970 Dec xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.187 {parse ccyymmdd} { clock scan {1970 12 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.188 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.189 {parse ccyymmdd} { clock scan {1970 12 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.190 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.191 {parse ccyymmdd} { clock scan {1970 xii 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.192 {parse ccyymmdd} { clock scan {1970 xii xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.193 {parse ccyymmdd} { clock scan {1970 xii 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.194 {parse ccyymmdd} { clock scan {1970 xii xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.195 {parse ccyymmdd} { clock scan {1970 12 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 31449600 test clock-8.196 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-8.197 {parse ccyymmdd} { clock scan {1970 12 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 31449600 test clock-8.198 {parse ccyymmdd} { clock scan {1970 12 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-8.199 {parse ccyymmdd} { clock scan 12/31/1970 -format %x -locale en_US_roman -gmt 1 } 31449600 test clock-8.200 {parse ccyymmdd} { clock scan 12/31/1970 -format %D -locale en_US_roman -gmt 1 } 31449600 test clock-8.201 {parse ccyymmdd} { clock scan {1971 Jan 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.202 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.203 {parse ccyymmdd} { clock scan {1971 Jan 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.204 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.205 {parse ccyymmdd} { clock scan {1971 January 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.206 {parse ccyymmdd} { clock scan {1971 January ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.207 {parse ccyymmdd} { clock scan {1971 January 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.208 {parse ccyymmdd} { clock scan {1971 January ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.209 {parse ccyymmdd} { clock scan {1971 Jan 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.210 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.211 {parse ccyymmdd} { clock scan {1971 Jan 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.212 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.213 {parse ccyymmdd} { clock scan {1971 01 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.214 {parse ccyymmdd} { clock scan {1971 01 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.215 {parse ccyymmdd} { clock scan {1971 01 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.216 {parse ccyymmdd} { clock scan {1971 01 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.217 {parse ccyymmdd} { clock scan {1971 i 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.218 {parse ccyymmdd} { clock scan {1971 i ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.219 {parse ccyymmdd} { clock scan {1971 i 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.220 {parse ccyymmdd} { clock scan {1971 i ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.221 {parse ccyymmdd} { clock scan {1971 1 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.222 {parse ccyymmdd} { clock scan {1971 1 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.223 {parse ccyymmdd} { clock scan {1971 1 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.224 {parse ccyymmdd} { clock scan {1971 1 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.225 {parse ccyymmdd} { clock scan {1971 Jan 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.226 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.227 {parse ccyymmdd} { clock scan {1971 Jan 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.228 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.229 {parse ccyymmdd} { clock scan {1971 January 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.230 {parse ccyymmdd} { clock scan {1971 January ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.231 {parse ccyymmdd} { clock scan {1971 January 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.232 {parse ccyymmdd} { clock scan {1971 January ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.233 {parse ccyymmdd} { clock scan {1971 Jan 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.234 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.235 {parse ccyymmdd} { clock scan {1971 Jan 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.236 {parse ccyymmdd} { clock scan {1971 Jan ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.237 {parse ccyymmdd} { clock scan {1971 01 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.238 {parse ccyymmdd} { clock scan {1971 01 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.239 {parse ccyymmdd} { clock scan {1971 01 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.240 {parse ccyymmdd} { clock scan {1971 01 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.241 {parse ccyymmdd} { clock scan {1971 i 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.242 {parse ccyymmdd} { clock scan {1971 i ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.243 {parse ccyymmdd} { clock scan {1971 i 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.244 {parse ccyymmdd} { clock scan {1971 i ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.245 {parse ccyymmdd} { clock scan {1971 1 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 31622400 test clock-8.246 {parse ccyymmdd} { clock scan {1971 1 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 31622400 test clock-8.247 {parse ccyymmdd} { clock scan {1971 1 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 31622400 test clock-8.248 {parse ccyymmdd} { clock scan {1971 1 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 31622400 test clock-8.249 {parse ccyymmdd} { clock scan 01/02/1971 -format %x -locale en_US_roman -gmt 1 } 31622400 test clock-8.250 {parse ccyymmdd} { clock scan 01/02/1971 -format %D -locale en_US_roman -gmt 1 } 31622400 test clock-8.251 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.252 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.253 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.254 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.255 {parse ccyymmdd} { clock scan {1971 January 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.256 {parse ccyymmdd} { clock scan {1971 January xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.257 {parse ccyymmdd} { clock scan {1971 January 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.258 {parse ccyymmdd} { clock scan {1971 January xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.259 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.260 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.261 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.262 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.263 {parse ccyymmdd} { clock scan {1971 01 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.264 {parse ccyymmdd} { clock scan {1971 01 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.265 {parse ccyymmdd} { clock scan {1971 01 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.266 {parse ccyymmdd} { clock scan {1971 01 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.267 {parse ccyymmdd} { clock scan {1971 i 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.268 {parse ccyymmdd} { clock scan {1971 i xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.269 {parse ccyymmdd} { clock scan {1971 i 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.270 {parse ccyymmdd} { clock scan {1971 i xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.271 {parse ccyymmdd} { clock scan {1971 1 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.272 {parse ccyymmdd} { clock scan {1971 1 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.273 {parse ccyymmdd} { clock scan {1971 1 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.274 {parse ccyymmdd} { clock scan {1971 1 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.275 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.276 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.277 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.278 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.279 {parse ccyymmdd} { clock scan {1971 January 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.280 {parse ccyymmdd} { clock scan {1971 January xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.281 {parse ccyymmdd} { clock scan {1971 January 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.282 {parse ccyymmdd} { clock scan {1971 January xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.283 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.284 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.285 {parse ccyymmdd} { clock scan {1971 Jan 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.286 {parse ccyymmdd} { clock scan {1971 Jan xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.287 {parse ccyymmdd} { clock scan {1971 01 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.288 {parse ccyymmdd} { clock scan {1971 01 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.289 {parse ccyymmdd} { clock scan {1971 01 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.290 {parse ccyymmdd} { clock scan {1971 01 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.291 {parse ccyymmdd} { clock scan {1971 i 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.292 {parse ccyymmdd} { clock scan {1971 i xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.293 {parse ccyymmdd} { clock scan {1971 i 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.294 {parse ccyymmdd} { clock scan {1971 i xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.295 {parse ccyymmdd} { clock scan {1971 1 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 34128000 test clock-8.296 {parse ccyymmdd} { clock scan {1971 1 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 34128000 test clock-8.297 {parse ccyymmdd} { clock scan {1971 1 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 34128000 test clock-8.298 {parse ccyymmdd} { clock scan {1971 1 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 34128000 test clock-8.299 {parse ccyymmdd} { clock scan 01/31/1971 -format %x -locale en_US_roman -gmt 1 } 34128000 test clock-8.300 {parse ccyymmdd} { clock scan 01/31/1971 -format %D -locale en_US_roman -gmt 1 } 34128000 test clock-8.301 {parse ccyymmdd} { clock scan {1971 Dec 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.302 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.303 {parse ccyymmdd} { clock scan {1971 Dec 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.304 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.305 {parse ccyymmdd} { clock scan {1971 December 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.306 {parse ccyymmdd} { clock scan {1971 December ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.307 {parse ccyymmdd} { clock scan {1971 December 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.308 {parse ccyymmdd} { clock scan {1971 December ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.309 {parse ccyymmdd} { clock scan {1971 Dec 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.310 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.311 {parse ccyymmdd} { clock scan {1971 Dec 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.312 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.313 {parse ccyymmdd} { clock scan {1971 12 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.314 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.315 {parse ccyymmdd} { clock scan {1971 12 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.316 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.317 {parse ccyymmdd} { clock scan {1971 xii 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.318 {parse ccyymmdd} { clock scan {1971 xii ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.319 {parse ccyymmdd} { clock scan {1971 xii 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.320 {parse ccyymmdd} { clock scan {1971 xii ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.321 {parse ccyymmdd} { clock scan {1971 12 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.322 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.323 {parse ccyymmdd} { clock scan {1971 12 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.324 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.325 {parse ccyymmdd} { clock scan {1971 Dec 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.326 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.327 {parse ccyymmdd} { clock scan {1971 Dec 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.328 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.329 {parse ccyymmdd} { clock scan {1971 December 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.330 {parse ccyymmdd} { clock scan {1971 December ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.331 {parse ccyymmdd} { clock scan {1971 December 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.332 {parse ccyymmdd} { clock scan {1971 December ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.333 {parse ccyymmdd} { clock scan {1971 Dec 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.334 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.335 {parse ccyymmdd} { clock scan {1971 Dec 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.336 {parse ccyymmdd} { clock scan {1971 Dec ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.337 {parse ccyymmdd} { clock scan {1971 12 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.338 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.339 {parse ccyymmdd} { clock scan {1971 12 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.340 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.341 {parse ccyymmdd} { clock scan {1971 xii 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.342 {parse ccyymmdd} { clock scan {1971 xii ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.343 {parse ccyymmdd} { clock scan {1971 xii 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.344 {parse ccyymmdd} { clock scan {1971 xii ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.345 {parse ccyymmdd} { clock scan {1971 12 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 60480000 test clock-8.346 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 60480000 test clock-8.347 {parse ccyymmdd} { clock scan {1971 12 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 60480000 test clock-8.348 {parse ccyymmdd} { clock scan {1971 12 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 60480000 test clock-8.349 {parse ccyymmdd} { clock scan 12/02/1971 -format %x -locale en_US_roman -gmt 1 } 60480000 test clock-8.350 {parse ccyymmdd} { clock scan 12/02/1971 -format %D -locale en_US_roman -gmt 1 } 60480000 test clock-8.351 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.352 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.353 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.354 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.355 {parse ccyymmdd} { clock scan {1971 December 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.356 {parse ccyymmdd} { clock scan {1971 December xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.357 {parse ccyymmdd} { clock scan {1971 December 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.358 {parse ccyymmdd} { clock scan {1971 December xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.359 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.360 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.361 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.362 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.363 {parse ccyymmdd} { clock scan {1971 12 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.364 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.365 {parse ccyymmdd} { clock scan {1971 12 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.366 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.367 {parse ccyymmdd} { clock scan {1971 xii 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.368 {parse ccyymmdd} { clock scan {1971 xii xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.369 {parse ccyymmdd} { clock scan {1971 xii 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.370 {parse ccyymmdd} { clock scan {1971 xii xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.371 {parse ccyymmdd} { clock scan {1971 12 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.372 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.373 {parse ccyymmdd} { clock scan {1971 12 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.374 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.375 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.376 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.377 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.378 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.379 {parse ccyymmdd} { clock scan {1971 December 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.380 {parse ccyymmdd} { clock scan {1971 December xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.381 {parse ccyymmdd} { clock scan {1971 December 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.382 {parse ccyymmdd} { clock scan {1971 December xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.383 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.384 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.385 {parse ccyymmdd} { clock scan {1971 Dec 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.386 {parse ccyymmdd} { clock scan {1971 Dec xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.387 {parse ccyymmdd} { clock scan {1971 12 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.388 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.389 {parse ccyymmdd} { clock scan {1971 12 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.390 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.391 {parse ccyymmdd} { clock scan {1971 xii 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.392 {parse ccyymmdd} { clock scan {1971 xii xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.393 {parse ccyymmdd} { clock scan {1971 xii 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.394 {parse ccyymmdd} { clock scan {1971 xii xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.395 {parse ccyymmdd} { clock scan {1971 12 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 62985600 test clock-8.396 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 62985600 test clock-8.397 {parse ccyymmdd} { clock scan {1971 12 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 62985600 test clock-8.398 {parse ccyymmdd} { clock scan {1971 12 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 62985600 test clock-8.399 {parse ccyymmdd} { clock scan 12/31/1971 -format %x -locale en_US_roman -gmt 1 } 62985600 test clock-8.400 {parse ccyymmdd} { clock scan 12/31/1971 -format %D -locale en_US_roman -gmt 1 } 62985600 test clock-8.401 {parse ccyymmdd} { clock scan {2000 Jan 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.402 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.403 {parse ccyymmdd} { clock scan {2000 Jan 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.404 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.405 {parse ccyymmdd} { clock scan {2000 January 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.406 {parse ccyymmdd} { clock scan {2000 January ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.407 {parse ccyymmdd} { clock scan {2000 January 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.408 {parse ccyymmdd} { clock scan {2000 January ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.409 {parse ccyymmdd} { clock scan {2000 Jan 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.410 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.411 {parse ccyymmdd} { clock scan {2000 Jan 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.412 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.413 {parse ccyymmdd} { clock scan {2000 01 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.414 {parse ccyymmdd} { clock scan {2000 01 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.415 {parse ccyymmdd} { clock scan {2000 01 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.416 {parse ccyymmdd} { clock scan {2000 01 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.417 {parse ccyymmdd} { clock scan {2000 i 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.418 {parse ccyymmdd} { clock scan {2000 i ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.419 {parse ccyymmdd} { clock scan {2000 i 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.420 {parse ccyymmdd} { clock scan {2000 i ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.421 {parse ccyymmdd} { clock scan {2000 1 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.422 {parse ccyymmdd} { clock scan {2000 1 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.423 {parse ccyymmdd} { clock scan {2000 1 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.424 {parse ccyymmdd} { clock scan {2000 1 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.425 {parse ccyymmdd} { clock scan {2000 Jan 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.426 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.427 {parse ccyymmdd} { clock scan {2000 Jan 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.428 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.429 {parse ccyymmdd} { clock scan {2000 January 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.430 {parse ccyymmdd} { clock scan {2000 January ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.431 {parse ccyymmdd} { clock scan {2000 January 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.432 {parse ccyymmdd} { clock scan {2000 January ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.433 {parse ccyymmdd} { clock scan {2000 Jan 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.434 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.435 {parse ccyymmdd} { clock scan {2000 Jan 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.436 {parse ccyymmdd} { clock scan {2000 Jan ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.437 {parse ccyymmdd} { clock scan {2000 01 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.438 {parse ccyymmdd} { clock scan {2000 01 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.439 {parse ccyymmdd} { clock scan {2000 01 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.440 {parse ccyymmdd} { clock scan {2000 01 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.441 {parse ccyymmdd} { clock scan {2000 i 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.442 {parse ccyymmdd} { clock scan {2000 i ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.443 {parse ccyymmdd} { clock scan {2000 i 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.444 {parse ccyymmdd} { clock scan {2000 i ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.445 {parse ccyymmdd} { clock scan {2000 1 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 946771200 test clock-8.446 {parse ccyymmdd} { clock scan {2000 1 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-8.447 {parse ccyymmdd} { clock scan {2000 1 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 946771200 test clock-8.448 {parse ccyymmdd} { clock scan {2000 1 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-8.449 {parse ccyymmdd} { clock scan 01/02/2000 -format %x -locale en_US_roman -gmt 1 } 946771200 test clock-8.450 {parse ccyymmdd} { clock scan 01/02/2000 -format %D -locale en_US_roman -gmt 1 } 946771200 test clock-8.451 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.452 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.453 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.454 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.455 {parse ccyymmdd} { clock scan {2000 January 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.456 {parse ccyymmdd} { clock scan {2000 January xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.457 {parse ccyymmdd} { clock scan {2000 January 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.458 {parse ccyymmdd} { clock scan {2000 January xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.459 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.460 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.461 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.462 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.463 {parse ccyymmdd} { clock scan {2000 01 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.464 {parse ccyymmdd} { clock scan {2000 01 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.465 {parse ccyymmdd} { clock scan {2000 01 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.466 {parse ccyymmdd} { clock scan {2000 01 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.467 {parse ccyymmdd} { clock scan {2000 i 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.468 {parse ccyymmdd} { clock scan {2000 i xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.469 {parse ccyymmdd} { clock scan {2000 i 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.470 {parse ccyymmdd} { clock scan {2000 i xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.471 {parse ccyymmdd} { clock scan {2000 1 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.472 {parse ccyymmdd} { clock scan {2000 1 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.473 {parse ccyymmdd} { clock scan {2000 1 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.474 {parse ccyymmdd} { clock scan {2000 1 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.475 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.476 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.477 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.478 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.479 {parse ccyymmdd} { clock scan {2000 January 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.480 {parse ccyymmdd} { clock scan {2000 January xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.481 {parse ccyymmdd} { clock scan {2000 January 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.482 {parse ccyymmdd} { clock scan {2000 January xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.483 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.484 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.485 {parse ccyymmdd} { clock scan {2000 Jan 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.486 {parse ccyymmdd} { clock scan {2000 Jan xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.487 {parse ccyymmdd} { clock scan {2000 01 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.488 {parse ccyymmdd} { clock scan {2000 01 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.489 {parse ccyymmdd} { clock scan {2000 01 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.490 {parse ccyymmdd} { clock scan {2000 01 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.491 {parse ccyymmdd} { clock scan {2000 i 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.492 {parse ccyymmdd} { clock scan {2000 i xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.493 {parse ccyymmdd} { clock scan {2000 i 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.494 {parse ccyymmdd} { clock scan {2000 i xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.495 {parse ccyymmdd} { clock scan {2000 1 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 949276800 test clock-8.496 {parse ccyymmdd} { clock scan {2000 1 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-8.497 {parse ccyymmdd} { clock scan {2000 1 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 949276800 test clock-8.498 {parse ccyymmdd} { clock scan {2000 1 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-8.499 {parse ccyymmdd} { clock scan 01/31/2000 -format %x -locale en_US_roman -gmt 1 } 949276800 test clock-8.500 {parse ccyymmdd} { clock scan 01/31/2000 -format %D -locale en_US_roman -gmt 1 } 949276800 test clock-8.501 {parse ccyymmdd} { clock scan {2000 Dec 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.502 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.503 {parse ccyymmdd} { clock scan {2000 Dec 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.504 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.505 {parse ccyymmdd} { clock scan {2000 December 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.506 {parse ccyymmdd} { clock scan {2000 December ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.507 {parse ccyymmdd} { clock scan {2000 December 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.508 {parse ccyymmdd} { clock scan {2000 December ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.509 {parse ccyymmdd} { clock scan {2000 Dec 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.510 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.511 {parse ccyymmdd} { clock scan {2000 Dec 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.512 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.513 {parse ccyymmdd} { clock scan {2000 12 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.514 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.515 {parse ccyymmdd} { clock scan {2000 12 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.516 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.517 {parse ccyymmdd} { clock scan {2000 xii 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.518 {parse ccyymmdd} { clock scan {2000 xii ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.519 {parse ccyymmdd} { clock scan {2000 xii 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.520 {parse ccyymmdd} { clock scan {2000 xii ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.521 {parse ccyymmdd} { clock scan {2000 12 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.522 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.523 {parse ccyymmdd} { clock scan {2000 12 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.524 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.525 {parse ccyymmdd} { clock scan {2000 Dec 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.526 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.527 {parse ccyymmdd} { clock scan {2000 Dec 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.528 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.529 {parse ccyymmdd} { clock scan {2000 December 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.530 {parse ccyymmdd} { clock scan {2000 December ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.531 {parse ccyymmdd} { clock scan {2000 December 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.532 {parse ccyymmdd} { clock scan {2000 December ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.533 {parse ccyymmdd} { clock scan {2000 Dec 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.534 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.535 {parse ccyymmdd} { clock scan {2000 Dec 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.536 {parse ccyymmdd} { clock scan {2000 Dec ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.537 {parse ccyymmdd} { clock scan {2000 12 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.538 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.539 {parse ccyymmdd} { clock scan {2000 12 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.540 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.541 {parse ccyymmdd} { clock scan {2000 xii 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.542 {parse ccyymmdd} { clock scan {2000 xii ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.543 {parse ccyymmdd} { clock scan {2000 xii 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.544 {parse ccyymmdd} { clock scan {2000 xii ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.545 {parse ccyymmdd} { clock scan {2000 12 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 975715200 test clock-8.546 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-8.547 {parse ccyymmdd} { clock scan {2000 12 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 975715200 test clock-8.548 {parse ccyymmdd} { clock scan {2000 12 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-8.549 {parse ccyymmdd} { clock scan 12/02/2000 -format %x -locale en_US_roman -gmt 1 } 975715200 test clock-8.550 {parse ccyymmdd} { clock scan 12/02/2000 -format %D -locale en_US_roman -gmt 1 } 975715200 test clock-8.551 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.552 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.553 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.554 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.555 {parse ccyymmdd} { clock scan {2000 December 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.556 {parse ccyymmdd} { clock scan {2000 December xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.557 {parse ccyymmdd} { clock scan {2000 December 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.558 {parse ccyymmdd} { clock scan {2000 December xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.559 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.560 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.561 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.562 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.563 {parse ccyymmdd} { clock scan {2000 12 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.564 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.565 {parse ccyymmdd} { clock scan {2000 12 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.566 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.567 {parse ccyymmdd} { clock scan {2000 xii 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.568 {parse ccyymmdd} { clock scan {2000 xii xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.569 {parse ccyymmdd} { clock scan {2000 xii 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.570 {parse ccyymmdd} { clock scan {2000 xii xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.571 {parse ccyymmdd} { clock scan {2000 12 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.572 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.573 {parse ccyymmdd} { clock scan {2000 12 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.574 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.575 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.576 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.577 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.578 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.579 {parse ccyymmdd} { clock scan {2000 December 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.580 {parse ccyymmdd} { clock scan {2000 December xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.581 {parse ccyymmdd} { clock scan {2000 December 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.582 {parse ccyymmdd} { clock scan {2000 December xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.583 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.584 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.585 {parse ccyymmdd} { clock scan {2000 Dec 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.586 {parse ccyymmdd} { clock scan {2000 Dec xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.587 {parse ccyymmdd} { clock scan {2000 12 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.588 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.589 {parse ccyymmdd} { clock scan {2000 12 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.590 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.591 {parse ccyymmdd} { clock scan {2000 xii 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.592 {parse ccyymmdd} { clock scan {2000 xii xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.593 {parse ccyymmdd} { clock scan {2000 xii 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.594 {parse ccyymmdd} { clock scan {2000 xii xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.595 {parse ccyymmdd} { clock scan {2000 12 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 978220800 test clock-8.596 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-8.597 {parse ccyymmdd} { clock scan {2000 12 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 978220800 test clock-8.598 {parse ccyymmdd} { clock scan {2000 12 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-8.599 {parse ccyymmdd} { clock scan 12/31/2000 -format %x -locale en_US_roman -gmt 1 } 978220800 test clock-8.600 {parse ccyymmdd} { clock scan 12/31/2000 -format %D -locale en_US_roman -gmt 1 } 978220800 test clock-8.601 {parse ccyymmdd} { clock scan {2001 Jan 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.602 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.603 {parse ccyymmdd} { clock scan {2001 Jan 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.604 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.605 {parse ccyymmdd} { clock scan {2001 January 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.606 {parse ccyymmdd} { clock scan {2001 January ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.607 {parse ccyymmdd} { clock scan {2001 January 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.608 {parse ccyymmdd} { clock scan {2001 January ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.609 {parse ccyymmdd} { clock scan {2001 Jan 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.610 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.611 {parse ccyymmdd} { clock scan {2001 Jan 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.612 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.613 {parse ccyymmdd} { clock scan {2001 01 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.614 {parse ccyymmdd} { clock scan {2001 01 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.615 {parse ccyymmdd} { clock scan {2001 01 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.616 {parse ccyymmdd} { clock scan {2001 01 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.617 {parse ccyymmdd} { clock scan {2001 i 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.618 {parse ccyymmdd} { clock scan {2001 i ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.619 {parse ccyymmdd} { clock scan {2001 i 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.620 {parse ccyymmdd} { clock scan {2001 i ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.621 {parse ccyymmdd} { clock scan {2001 1 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.622 {parse ccyymmdd} { clock scan {2001 1 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.623 {parse ccyymmdd} { clock scan {2001 1 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.624 {parse ccyymmdd} { clock scan {2001 1 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.625 {parse ccyymmdd} { clock scan {2001 Jan 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.626 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.627 {parse ccyymmdd} { clock scan {2001 Jan 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.628 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.629 {parse ccyymmdd} { clock scan {2001 January 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.630 {parse ccyymmdd} { clock scan {2001 January ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.631 {parse ccyymmdd} { clock scan {2001 January 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.632 {parse ccyymmdd} { clock scan {2001 January ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.633 {parse ccyymmdd} { clock scan {2001 Jan 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.634 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.635 {parse ccyymmdd} { clock scan {2001 Jan 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.636 {parse ccyymmdd} { clock scan {2001 Jan ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.637 {parse ccyymmdd} { clock scan {2001 01 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.638 {parse ccyymmdd} { clock scan {2001 01 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.639 {parse ccyymmdd} { clock scan {2001 01 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.640 {parse ccyymmdd} { clock scan {2001 01 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.641 {parse ccyymmdd} { clock scan {2001 i 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.642 {parse ccyymmdd} { clock scan {2001 i ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.643 {parse ccyymmdd} { clock scan {2001 i 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.644 {parse ccyymmdd} { clock scan {2001 i ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.645 {parse ccyymmdd} { clock scan {2001 1 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 978393600 test clock-8.646 {parse ccyymmdd} { clock scan {2001 1 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 978393600 test clock-8.647 {parse ccyymmdd} { clock scan {2001 1 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 978393600 test clock-8.648 {parse ccyymmdd} { clock scan {2001 1 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 978393600 test clock-8.649 {parse ccyymmdd} { clock scan 01/02/2001 -format %x -locale en_US_roman -gmt 1 } 978393600 test clock-8.650 {parse ccyymmdd} { clock scan 01/02/2001 -format %D -locale en_US_roman -gmt 1 } 978393600 test clock-8.651 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.652 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.653 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.654 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.655 {parse ccyymmdd} { clock scan {2001 January 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.656 {parse ccyymmdd} { clock scan {2001 January xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.657 {parse ccyymmdd} { clock scan {2001 January 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.658 {parse ccyymmdd} { clock scan {2001 January xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.659 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.660 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.661 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.662 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.663 {parse ccyymmdd} { clock scan {2001 01 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.664 {parse ccyymmdd} { clock scan {2001 01 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.665 {parse ccyymmdd} { clock scan {2001 01 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.666 {parse ccyymmdd} { clock scan {2001 01 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.667 {parse ccyymmdd} { clock scan {2001 i 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.668 {parse ccyymmdd} { clock scan {2001 i xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.669 {parse ccyymmdd} { clock scan {2001 i 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.670 {parse ccyymmdd} { clock scan {2001 i xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.671 {parse ccyymmdd} { clock scan {2001 1 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.672 {parse ccyymmdd} { clock scan {2001 1 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.673 {parse ccyymmdd} { clock scan {2001 1 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.674 {parse ccyymmdd} { clock scan {2001 1 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.675 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.676 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.677 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.678 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.679 {parse ccyymmdd} { clock scan {2001 January 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.680 {parse ccyymmdd} { clock scan {2001 January xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.681 {parse ccyymmdd} { clock scan {2001 January 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.682 {parse ccyymmdd} { clock scan {2001 January xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.683 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.684 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.685 {parse ccyymmdd} { clock scan {2001 Jan 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.686 {parse ccyymmdd} { clock scan {2001 Jan xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.687 {parse ccyymmdd} { clock scan {2001 01 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.688 {parse ccyymmdd} { clock scan {2001 01 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.689 {parse ccyymmdd} { clock scan {2001 01 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.690 {parse ccyymmdd} { clock scan {2001 01 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.691 {parse ccyymmdd} { clock scan {2001 i 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.692 {parse ccyymmdd} { clock scan {2001 i xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.693 {parse ccyymmdd} { clock scan {2001 i 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.694 {parse ccyymmdd} { clock scan {2001 i xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.695 {parse ccyymmdd} { clock scan {2001 1 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 980899200 test clock-8.696 {parse ccyymmdd} { clock scan {2001 1 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 980899200 test clock-8.697 {parse ccyymmdd} { clock scan {2001 1 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 980899200 test clock-8.698 {parse ccyymmdd} { clock scan {2001 1 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 980899200 test clock-8.699 {parse ccyymmdd} { clock scan 01/31/2001 -format %x -locale en_US_roman -gmt 1 } 980899200 test clock-8.700 {parse ccyymmdd} { clock scan 01/31/2001 -format %D -locale en_US_roman -gmt 1 } 980899200 test clock-8.701 {parse ccyymmdd} { clock scan {2001 Dec 02} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.702 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.703 {parse ccyymmdd} { clock scan {2001 Dec 2} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.704 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.705 {parse ccyymmdd} { clock scan {2001 December 02} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.706 {parse ccyymmdd} { clock scan {2001 December ii} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.707 {parse ccyymmdd} { clock scan {2001 December 2} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.708 {parse ccyymmdd} { clock scan {2001 December ii} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.709 {parse ccyymmdd} { clock scan {2001 Dec 02} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.710 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.711 {parse ccyymmdd} { clock scan {2001 Dec 2} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.712 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.713 {parse ccyymmdd} { clock scan {2001 12 02} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.714 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.715 {parse ccyymmdd} { clock scan {2001 12 2} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.716 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.717 {parse ccyymmdd} { clock scan {2001 xii 02} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.718 {parse ccyymmdd} { clock scan {2001 xii ii} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.719 {parse ccyymmdd} { clock scan {2001 xii 2} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.720 {parse ccyymmdd} { clock scan {2001 xii ii} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.721 {parse ccyymmdd} { clock scan {2001 12 02} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.722 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.723 {parse ccyymmdd} { clock scan {2001 12 2} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.724 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.725 {parse ccyymmdd} { clock scan {2001 Dec 02} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.726 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.727 {parse ccyymmdd} { clock scan {2001 Dec 2} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.728 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.729 {parse ccyymmdd} { clock scan {2001 December 02} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.730 {parse ccyymmdd} { clock scan {2001 December ii} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.731 {parse ccyymmdd} { clock scan {2001 December 2} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.732 {parse ccyymmdd} { clock scan {2001 December ii} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.733 {parse ccyymmdd} { clock scan {2001 Dec 02} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.734 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.735 {parse ccyymmdd} { clock scan {2001 Dec 2} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.736 {parse ccyymmdd} { clock scan {2001 Dec ii} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.737 {parse ccyymmdd} { clock scan {2001 12 02} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.738 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.739 {parse ccyymmdd} { clock scan {2001 12 2} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.740 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.741 {parse ccyymmdd} { clock scan {2001 xii 02} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.742 {parse ccyymmdd} { clock scan {2001 xii ii} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.743 {parse ccyymmdd} { clock scan {2001 xii 2} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.744 {parse ccyymmdd} { clock scan {2001 xii ii} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.745 {parse ccyymmdd} { clock scan {2001 12 02} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.746 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.747 {parse ccyymmdd} { clock scan {2001 12 2} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.748 {parse ccyymmdd} { clock scan {2001 12 ii} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 1007251200 test clock-8.749 {parse ccyymmdd} { clock scan 12/02/2001 -format %x -locale en_US_roman -gmt 1 } 1007251200 test clock-8.750 {parse ccyymmdd} { clock scan 12/02/2001 -format %D -locale en_US_roman -gmt 1 } 1007251200 test clock-8.751 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%C%y %b %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.752 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%C%y %b %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.753 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%C%y %b %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.754 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%C%y %b %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.755 {parse ccyymmdd} { clock scan {2001 December 31} -format {%C%y %B %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.756 {parse ccyymmdd} { clock scan {2001 December xxxi} -format {%C%y %B %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.757 {parse ccyymmdd} { clock scan {2001 December 31} -format {%C%y %B %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.758 {parse ccyymmdd} { clock scan {2001 December xxxi} -format {%C%y %B %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.759 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%C%y %h %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.760 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%C%y %h %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.761 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%C%y %h %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.762 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%C%y %h %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.763 {parse ccyymmdd} { clock scan {2001 12 31} -format {%C%y %m %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.764 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%C%y %m %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.765 {parse ccyymmdd} { clock scan {2001 12 31} -format {%C%y %m %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.766 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%C%y %m %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.767 {parse ccyymmdd} { clock scan {2001 xii 31} -format {%C%y %Om %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.768 {parse ccyymmdd} { clock scan {2001 xii xxxi} -format {%C%y %Om %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.769 {parse ccyymmdd} { clock scan {2001 xii 31} -format {%C%y %Om %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.770 {parse ccyymmdd} { clock scan {2001 xii xxxi} -format {%C%y %Om %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.771 {parse ccyymmdd} { clock scan {2001 12 31} -format {%C%y %N %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.772 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%C%y %N %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.773 {parse ccyymmdd} { clock scan {2001 12 31} -format {%C%y %N %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.774 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%C%y %N %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.775 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%Y %b %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.776 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%Y %b %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.777 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%Y %b %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.778 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%Y %b %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.779 {parse ccyymmdd} { clock scan {2001 December 31} -format {%Y %B %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.780 {parse ccyymmdd} { clock scan {2001 December xxxi} -format {%Y %B %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.781 {parse ccyymmdd} { clock scan {2001 December 31} -format {%Y %B %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.782 {parse ccyymmdd} { clock scan {2001 December xxxi} -format {%Y %B %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.783 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%Y %h %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.784 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%Y %h %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.785 {parse ccyymmdd} { clock scan {2001 Dec 31} -format {%Y %h %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.786 {parse ccyymmdd} { clock scan {2001 Dec xxxi} -format {%Y %h %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.787 {parse ccyymmdd} { clock scan {2001 12 31} -format {%Y %m %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.788 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%Y %m %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.789 {parse ccyymmdd} { clock scan {2001 12 31} -format {%Y %m %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.790 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%Y %m %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.791 {parse ccyymmdd} { clock scan {2001 xii 31} -format {%Y %Om %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.792 {parse ccyymmdd} { clock scan {2001 xii xxxi} -format {%Y %Om %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.793 {parse ccyymmdd} { clock scan {2001 xii 31} -format {%Y %Om %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.794 {parse ccyymmdd} { clock scan {2001 xii xxxi} -format {%Y %Om %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.795 {parse ccyymmdd} { clock scan {2001 12 31} -format {%Y %N %d} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.796 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%Y %N %Od} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.797 {parse ccyymmdd} { clock scan {2001 12 31} -format {%Y %N %e} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.798 {parse ccyymmdd} { clock scan {2001 12 xxxi} -format {%Y %N %Oe} -locale en_US_roman -gmt 1 } 1009756800 test clock-8.799 {parse ccyymmdd} { clock scan 12/31/2001 -format %x -locale en_US_roman -gmt 1 } 1009756800 test clock-8.800 {parse ccyymmdd} { clock scan 12/31/2001 -format %D -locale en_US_roman -gmt 1 } 1009756800 # END testcases8 test clock-9.1 {seconds take precedence over ccyymmdd} { clock scan {0 20000101} -format {%s %Y%m%d} -gmt true } 0 test clock-9.2 {Calendar julian day takes precedence over ccyymmdd} { list \ [clock scan {2440588 20000101} -format {%J %Y%m%d} -gmt true] \ [clock scan {2440588 20000101} -format {%EJ %Y%m%d} -gmt true] } {0 0} test clock-9.2.1 {Calendar julian day (with time fraction) takes precedence over date-time} { list \ [clock scan {2440588.0 20000101 010203} -format {%EJ %Y%m%d %H%M%S} -gmt true] \ [clock scan {2440588.5 20000101 010203} -format {%EJ %Y%m%d %H%M%S} -gmt true] } {0 43200} test clock-9.3 {Astro julian day takes always precedence over date-time} { list \ [clock scan {2440587.5 20000101 010203} -format {%Ej %Y%m%d %H%M%S} -gmt true] \ [clock scan {2440588 20000101 010203} -format {%Ej %Y%m%d %H%M%S} -gmt true] } {0 43200} # Test parsing of ccyyddd test clock-10.1 {parse ccyyddd} { clock scan {1970 001} -format {%Y %j} -locale en_US_roman -gmt 1 } 0 test clock-10.2 {parse ccyyddd} { clock scan {1970 365} -format {%Y %j} -locale en_US_roman -gmt 1 } 31449600 test clock-10.3 {parse ccyyddd} { clock scan {1971 001} -format {%Y %j} -locale en_US_roman -gmt 1 } 31536000 test clock-10.4 {parse ccyyddd} { clock scan {1971 365} -format {%Y %j} -locale en_US_roman -gmt 1 } 62985600 test clock-10.5 {parse ccyyddd} { clock scan {2000 001} -format {%Y %j} -locale en_US_roman -gmt 1 } 946684800 test clock-10.6 {parse ccyyddd} { clock scan {2000 365} -format {%Y %j} -locale en_US_roman -gmt 1 } 978134400 test clock-10.7 {parse ccyyddd} { clock scan {2001 001} -format {%Y %j} -locale en_US_roman -gmt 1 } 978307200 test clock-10.8 {parse ccyyddd} { clock scan {2001 365} -format {%Y %j} -locale en_US_roman -gmt 1 } 1009756800 test clock-10.9 {seconds take precedence over ccyyddd} { list [clock scan {0 2000001} -format {%s %Y%j} -gmt true] \ [clock scan {2000001 0} -format {%Y%j %s} -gmt true] } {0 0} test clock-10.10 {julian day takes precedence over ccyyddd} { list [clock scan {2440588 2000001} -format {%J %Y%j} -gmt true] \ [clock scan {2000001 2440588} -format {%Y%j %J} -gmt true] } {0 0} # BEGIN testcases11 # Test precedence yyyymmdd over yyyyddd if {!$valid_mode} { set res {-result 0} } else { set res {-returnCodes error -result "unable to convert input string: ambiguous day"} } test clock-11.1 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700101002 -format %Y%m%d%j -gmt 1 } {*}$res test clock-11.2 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01197001002 -format %m%Y%d%j -gmt 1 } {*}$res test clock-11.3 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01197001002 -format %d%Y%m%j -gmt 1 } {*}$res test clock-11.4 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00219700101 -format %j%Y%m%d -gmt 1 } {*}$res test clock-11.5 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700100201 -format %Y%m%j%d -gmt 1 } {*}$res test clock-11.6 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01197000201 -format %m%Y%j%d -gmt 1 } {*}$res test clock-11.7 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01197000201 -format %d%Y%j%m -gmt 1 } {*}$res test clock-11.8 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00219700101 -format %j%Y%d%m -gmt 1 } {*}$res test clock-11.9 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700101002 -format %Y%d%m%j -gmt 1 } {*}$res test clock-11.10 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01011970002 -format %m%d%Y%j -gmt 1 } {*}$res test clock-11.11 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01011970002 -format %d%m%Y%j -gmt 1 } {*}$res test clock-11.12 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00201197001 -format %j%m%Y%d -gmt 1 } {*}$res test clock-11.13 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700100201 -format %Y%d%j%m -gmt 1 } {*}$res test clock-11.14 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01010021970 -format %m%d%j%Y -gmt 1 } {*}$res test clock-11.15 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01010021970 -format %d%m%j%Y -gmt 1 } {*}$res test clock-11.16 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00201011970 -format %j%m%d%Y -gmt 1 } {*}$res test clock-11.17 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700020101 -format %Y%j%m%d -gmt 1 } {*}$res test clock-11.18 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01002197001 -format %m%j%Y%d -gmt 1 } {*}$res test clock-11.19 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01002197001 -format %d%j%Y%m -gmt 1 } {*}$res test clock-11.20 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00201197001 -format %j%d%Y%m -gmt 1 } {*}$res test clock-11.21 {precedence of ccyymmdd over ccyyddd} -body { clock scan 19700020101 -format %Y%j%d%m -gmt 1 } {*}$res test clock-11.22 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01002011970 -format %m%j%d%Y -gmt 1 } {*}$res test clock-11.23 {precedence of ccyymmdd over ccyyddd} -body { clock scan 01002011970 -format %d%j%m%Y -gmt 1 } {*}$res test clock-11.24 {precedence of ccyymmdd over ccyyddd} -body { clock scan 00201011970 -format %j%d%m%Y -gmt 1 } {*}$res unset -nocomplain res # END testcases11 # BEGIN testcases12 # Test parsing of ccyyWwwd test clock-12.1 {parse ccyyWwwd} { clock scan {1970 W01 Fri} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 86400 test clock-12.2 {parse ccyyWwwd} { clock scan {1970 W01 Friday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 86400 test clock-12.3 {parse ccyyWwwd} { clock scan {1970 W01 5} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 86400 test clock-12.4 {parse ccyyWwwd} { clock scan {1970 W01 5} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 86400 test clock-12.5 {parse ccyyWwwd} { clock scan {1970 W01 v} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 86400 test clock-12.6 {parse ccyyWwwd} { clock scan {1970 W01 v} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 86400 test clock-12.7 {parse ccyyWwwd} { clock scan {1970 W05 Sat} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 2592000 test clock-12.8 {parse ccyyWwwd} { clock scan {1970 W05 Saturday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 2592000 test clock-12.9 {parse ccyyWwwd} { clock scan {1970 W05 6} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 2592000 test clock-12.10 {parse ccyyWwwd} { clock scan {1970 W05 6} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 2592000 test clock-12.11 {parse ccyyWwwd} { clock scan {1970 W05 vi} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 2592000 test clock-12.12 {parse ccyyWwwd} { clock scan {1970 W05 vi} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 2592000 test clock-12.13 {parse ccyyWwwd} { clock scan {1970 W49 Wed} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 28944000 test clock-12.14 {parse ccyyWwwd} { clock scan {1970 W49 Wednesday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 28944000 test clock-12.15 {parse ccyyWwwd} { clock scan {1970 W49 3} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 28944000 test clock-12.16 {parse ccyyWwwd} { clock scan {1970 W49 3} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 28944000 test clock-12.17 {parse ccyyWwwd} { clock scan {1970 W49 iii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 28944000 test clock-12.18 {parse ccyyWwwd} { clock scan {1970 W49 iii} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 28944000 test clock-12.19 {parse ccyyWwwd} { clock scan {1970 W53 Thu} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 31449600 test clock-12.20 {parse ccyyWwwd} { clock scan {1970 W53 Thursday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 31449600 test clock-12.21 {parse ccyyWwwd} { clock scan {1970 W53 4} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 31449600 test clock-12.22 {parse ccyyWwwd} { clock scan {1970 W53 4} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 31449600 test clock-12.23 {parse ccyyWwwd} { clock scan {1970 W53 iv} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 31449600 test clock-12.24 {parse ccyyWwwd} { clock scan {1970 W53 iv} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 31449600 test clock-12.25 {parse ccyyWwwd} { clock scan {1970 W53 Sat} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 31622400 test clock-12.26 {parse ccyyWwwd} { clock scan {1970 W53 Saturday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 31622400 test clock-12.27 {parse ccyyWwwd} { clock scan {1970 W53 6} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 31622400 test clock-12.28 {parse ccyyWwwd} { clock scan {1970 W53 6} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 31622400 test clock-12.29 {parse ccyyWwwd} { clock scan {1970 W53 vi} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 31622400 test clock-12.30 {parse ccyyWwwd} { clock scan {1970 W53 vi} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 31622400 test clock-12.31 {parse ccyyWwwd} { clock scan {1971 W04 Sun} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 34128000 test clock-12.32 {parse ccyyWwwd} { clock scan {1971 W04 Sunday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 34128000 test clock-12.33 {parse ccyyWwwd} { clock scan {1971 W04 7} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 34128000 test clock-12.34 {parse ccyyWwwd} { clock scan {1971 W04 0} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 34128000 test clock-12.35 {parse ccyyWwwd} { clock scan {1971 W04 vii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 34128000 test clock-12.36 {parse ccyyWwwd} { clock scan {1971 W04 ?} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 34128000 test clock-12.37 {parse ccyyWwwd} { clock scan {1971 W48 Thu} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 60480000 test clock-12.38 {parse ccyyWwwd} { clock scan {1971 W48 Thursday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 60480000 test clock-12.39 {parse ccyyWwwd} { clock scan {1971 W48 4} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 60480000 test clock-12.40 {parse ccyyWwwd} { clock scan {1971 W48 4} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 60480000 test clock-12.41 {parse ccyyWwwd} { clock scan {1971 W48 iv} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 60480000 test clock-12.42 {parse ccyyWwwd} { clock scan {1971 W48 iv} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 60480000 test clock-12.43 {parse ccyyWwwd} { clock scan {1971 W52 Fri} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 62985600 test clock-12.44 {parse ccyyWwwd} { clock scan {1971 W52 Friday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 62985600 test clock-12.45 {parse ccyyWwwd} { clock scan {1971 W52 5} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 62985600 test clock-12.46 {parse ccyyWwwd} { clock scan {1971 W52 5} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 62985600 test clock-12.47 {parse ccyyWwwd} { clock scan {1971 W52 v} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 62985600 test clock-12.48 {parse ccyyWwwd} { clock scan {1971 W52 v} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 62985600 test clock-12.49 {parse ccyyWwwd} { clock scan {1999 W52 Sun} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 946771200 test clock-12.50 {parse ccyyWwwd} { clock scan {1999 W52 Sunday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 946771200 test clock-12.51 {parse ccyyWwwd} { clock scan {1999 W52 7} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 946771200 test clock-12.52 {parse ccyyWwwd} { clock scan {1999 W52 0} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 946771200 test clock-12.53 {parse ccyyWwwd} { clock scan {1999 W52 vii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 946771200 test clock-12.54 {parse ccyyWwwd} { clock scan {1999 W52 ?} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 946771200 test clock-12.55 {parse ccyyWwwd} { clock scan {2000 W05 Mon} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 949276800 test clock-12.56 {parse ccyyWwwd} { clock scan {2000 W05 Monday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 949276800 test clock-12.57 {parse ccyyWwwd} { clock scan {2000 W05 1} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 949276800 test clock-12.58 {parse ccyyWwwd} { clock scan {2000 W05 1} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 949276800 test clock-12.59 {parse ccyyWwwd} { clock scan {2000 W05 i} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 949276800 test clock-12.60 {parse ccyyWwwd} { clock scan {2000 W05 i} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 949276800 test clock-12.61 {parse ccyyWwwd} { clock scan {2000 W48 Sat} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 975715200 test clock-12.62 {parse ccyyWwwd} { clock scan {2000 W48 Saturday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 975715200 test clock-12.63 {parse ccyyWwwd} { clock scan {2000 W48 6} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 975715200 test clock-12.64 {parse ccyyWwwd} { clock scan {2000 W48 6} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 975715200 test clock-12.65 {parse ccyyWwwd} { clock scan {2000 W48 vi} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 975715200 test clock-12.66 {parse ccyyWwwd} { clock scan {2000 W48 vi} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 975715200 test clock-12.67 {parse ccyyWwwd} { clock scan {2000 W52 Sun} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 978220800 test clock-12.68 {parse ccyyWwwd} { clock scan {2000 W52 Sunday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 978220800 test clock-12.69 {parse ccyyWwwd} { clock scan {2000 W52 7} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 978220800 test clock-12.70 {parse ccyyWwwd} { clock scan {2000 W52 0} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 978220800 test clock-12.71 {parse ccyyWwwd} { clock scan {2000 W52 vii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 978220800 test clock-12.72 {parse ccyyWwwd} { clock scan {2000 W52 ?} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 978220800 test clock-12.73 {parse ccyyWwwd} { clock scan {2001 W01 Tue} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 978393600 test clock-12.74 {parse ccyyWwwd} { clock scan {2001 W01 Tuesday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 978393600 test clock-12.75 {parse ccyyWwwd} { clock scan {2001 W01 2} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 978393600 test clock-12.76 {parse ccyyWwwd} { clock scan {2001 W01 2} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 978393600 test clock-12.77 {parse ccyyWwwd} { clock scan {2001 W01 ii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 978393600 test clock-12.78 {parse ccyyWwwd} { clock scan {2001 W01 ii} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 978393600 test clock-12.79 {parse ccyyWwwd} { clock scan {2001 W05 Wed} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 980899200 test clock-12.80 {parse ccyyWwwd} { clock scan {2001 W05 Wednesday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 980899200 test clock-12.81 {parse ccyyWwwd} { clock scan {2001 W05 3} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 980899200 test clock-12.82 {parse ccyyWwwd} { clock scan {2001 W05 3} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 980899200 test clock-12.83 {parse ccyyWwwd} { clock scan {2001 W05 iii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 980899200 test clock-12.84 {parse ccyyWwwd} { clock scan {2001 W05 iii} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 980899200 test clock-12.85 {parse ccyyWwwd} { clock scan {2001 W48 Sun} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.86 {parse ccyyWwwd} { clock scan {2001 W48 Sunday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.87 {parse ccyyWwwd} { clock scan {2001 W48 7} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.88 {parse ccyyWwwd} { clock scan {2001 W48 0} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.89 {parse ccyyWwwd} { clock scan {2001 W48 vii} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.90 {parse ccyyWwwd} { clock scan {2001 W48 ?} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 1007251200 test clock-12.91 {parse ccyyWwwd} { clock scan {2002 W01 Mon} -format {%G W%V %a} -locale en_US_roman -gmt 1 } 1009756800 test clock-12.92 {parse ccyyWwwd} { clock scan {2002 W01 Monday} -format {%G W%V %A} -locale en_US_roman -gmt 1 } 1009756800 test clock-12.93 {parse ccyyWwwd} { clock scan {2002 W01 1} -format {%G W%V %u} -locale en_US_roman -gmt 1 } 1009756800 test clock-12.94 {parse ccyyWwwd} { clock scan {2002 W01 1} -format {%G W%V %w} -locale en_US_roman -gmt 1 } 1009756800 test clock-12.95 {parse ccyyWwwd} { clock scan {2002 W01 i} -format {%G W%V %Ou} -locale en_US_roman -gmt 1 } 1009756800 test clock-12.96 {parse ccyyWwwd} { clock scan {2002 W01 i} -format {%G W%V %Ow} -locale en_US_roman -gmt 1 } 1009756800 # END testcases12 test clock-13.1 {test that %s takes precedence over ccyyWwwd} valid_off { list [clock scan {0 2000W011} -format {%s %GW%V%u} -gmt true] \ [clock scan {2000W011 0} -format {%GW%V%u %s} -gmt true] } {0 0} test clock-13.2 {test that %J takes precedence over ccyyWwwd} valid_off { list [clock scan {2440588 2000W011} -format {%J %GW%V%u} -gmt true] \ [clock scan {2000W011 2440588} -format {%GW%V%u %J} -gmt true] } {0 0} test clock-13.3 {invalid weekday} { catch {clock scan 2000W018 -format %GW%V%u -gmt true} result list $result $::errorCode } {{day of week is greater than 7} {CLOCK badDayOfWeek}} test clock-13.4 {invalid weekday} { catch { clock scan {2000 W01 viii} \ -format {%G W%V %Ou} -gmt true -locale en_US_roman } result list $result $::errorCode } {{day of week is greater than 7} {CLOCK badDayOfWeek}} # BEGIN testcases14 # Test parsing of yymmdd test clock-14.1 {parse yymmdd} { clock scan {38 Jan 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.2 {parse yymmdd} { clock scan {38 Jan ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.3 {parse yymmdd} { clock scan {38 Jan 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.4 {parse yymmdd} { clock scan {38 Jan ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.5 {parse yymmdd} { clock scan {38 January 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.6 {parse yymmdd} { clock scan {38 January ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.7 {parse yymmdd} { clock scan {38 January 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.8 {parse yymmdd} { clock scan {38 January ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.9 {parse yymmdd} { clock scan {38 Jan 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.10 {parse yymmdd} { clock scan {38 Jan ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.11 {parse yymmdd} { clock scan {38 Jan 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.12 {parse yymmdd} { clock scan {38 Jan ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.13 {parse yymmdd} { clock scan {38 01 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.14 {parse yymmdd} { clock scan {38 01 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.15 {parse yymmdd} { clock scan {38 01 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.16 {parse yymmdd} { clock scan {38 01 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.17 {parse yymmdd} { clock scan {38 i 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.18 {parse yymmdd} { clock scan {38 i ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.19 {parse yymmdd} { clock scan {38 i 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.20 {parse yymmdd} { clock scan {38 i ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.21 {parse yymmdd} { clock scan {38 1 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.22 {parse yymmdd} { clock scan {38 1 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.23 {parse yymmdd} { clock scan {38 1 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.24 {parse yymmdd} { clock scan {38 1 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.25 {parse yymmdd} { clock scan {xxxviii Jan 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.26 {parse yymmdd} { clock scan {xxxviii Jan ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.27 {parse yymmdd} { clock scan {xxxviii Jan 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.28 {parse yymmdd} { clock scan {xxxviii Jan ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.29 {parse yymmdd} { clock scan {xxxviii January 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.30 {parse yymmdd} { clock scan {xxxviii January ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.31 {parse yymmdd} { clock scan {xxxviii January 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.32 {parse yymmdd} { clock scan {xxxviii January ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.33 {parse yymmdd} { clock scan {xxxviii Jan 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.34 {parse yymmdd} { clock scan {xxxviii Jan ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.35 {parse yymmdd} { clock scan {xxxviii Jan 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.36 {parse yymmdd} { clock scan {xxxviii Jan ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.37 {parse yymmdd} { clock scan {xxxviii 01 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.38 {parse yymmdd} { clock scan {xxxviii 01 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.39 {parse yymmdd} { clock scan {xxxviii 01 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.40 {parse yymmdd} { clock scan {xxxviii 01 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.41 {parse yymmdd} { clock scan {xxxviii i 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.42 {parse yymmdd} { clock scan {xxxviii i ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.43 {parse yymmdd} { clock scan {xxxviii i 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.44 {parse yymmdd} { clock scan {xxxviii i ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.45 {parse yymmdd} { clock scan {xxxviii 1 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.46 {parse yymmdd} { clock scan {xxxviii 1 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.47 {parse yymmdd} { clock scan {xxxviii 1 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.48 {parse yymmdd} { clock scan {xxxviii 1 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } -1009756800 test clock-14.49 {parse yymmdd} { clock scan {38 Jan 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.50 {parse yymmdd} { clock scan {38 Jan xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.51 {parse yymmdd} { clock scan {38 Jan 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.52 {parse yymmdd} { clock scan {38 Jan xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.53 {parse yymmdd} { clock scan {38 January 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.54 {parse yymmdd} { clock scan {38 January xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.55 {parse yymmdd} { clock scan {38 January 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.56 {parse yymmdd} { clock scan {38 January xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.57 {parse yymmdd} { clock scan {38 Jan 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.58 {parse yymmdd} { clock scan {38 Jan xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.59 {parse yymmdd} { clock scan {38 Jan 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.60 {parse yymmdd} { clock scan {38 Jan xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.61 {parse yymmdd} { clock scan {38 01 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.62 {parse yymmdd} { clock scan {38 01 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.63 {parse yymmdd} { clock scan {38 01 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.64 {parse yymmdd} { clock scan {38 01 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.65 {parse yymmdd} { clock scan {38 i 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.66 {parse yymmdd} { clock scan {38 i xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.67 {parse yymmdd} { clock scan {38 i 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.68 {parse yymmdd} { clock scan {38 i xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.69 {parse yymmdd} { clock scan {38 1 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.70 {parse yymmdd} { clock scan {38 1 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.71 {parse yymmdd} { clock scan {38 1 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.72 {parse yymmdd} { clock scan {38 1 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.73 {parse yymmdd} { clock scan {xxxviii Jan 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.74 {parse yymmdd} { clock scan {xxxviii Jan xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.75 {parse yymmdd} { clock scan {xxxviii Jan 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.76 {parse yymmdd} { clock scan {xxxviii Jan xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.77 {parse yymmdd} { clock scan {xxxviii January 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.78 {parse yymmdd} { clock scan {xxxviii January xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.79 {parse yymmdd} { clock scan {xxxviii January 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.80 {parse yymmdd} { clock scan {xxxviii January xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.81 {parse yymmdd} { clock scan {xxxviii Jan 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.82 {parse yymmdd} { clock scan {xxxviii Jan xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.83 {parse yymmdd} { clock scan {xxxviii Jan 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.84 {parse yymmdd} { clock scan {xxxviii Jan xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.85 {parse yymmdd} { clock scan {xxxviii 01 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.86 {parse yymmdd} { clock scan {xxxviii 01 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.87 {parse yymmdd} { clock scan {xxxviii 01 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.88 {parse yymmdd} { clock scan {xxxviii 01 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.89 {parse yymmdd} { clock scan {xxxviii i 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.90 {parse yymmdd} { clock scan {xxxviii i xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.91 {parse yymmdd} { clock scan {xxxviii i 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.92 {parse yymmdd} { clock scan {xxxviii i xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.93 {parse yymmdd} { clock scan {xxxviii 1 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.94 {parse yymmdd} { clock scan {xxxviii 1 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.95 {parse yymmdd} { clock scan {xxxviii 1 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.96 {parse yymmdd} { clock scan {xxxviii 1 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } -1007251200 test clock-14.97 {parse yymmdd} { clock scan {38 Dec 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.98 {parse yymmdd} { clock scan {38 Dec ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.99 {parse yymmdd} { clock scan {38 Dec 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.100 {parse yymmdd} { clock scan {38 Dec ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.101 {parse yymmdd} { clock scan {38 December 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.102 {parse yymmdd} { clock scan {38 December ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.103 {parse yymmdd} { clock scan {38 December 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.104 {parse yymmdd} { clock scan {38 December ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.105 {parse yymmdd} { clock scan {38 Dec 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.106 {parse yymmdd} { clock scan {38 Dec ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.107 {parse yymmdd} { clock scan {38 Dec 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.108 {parse yymmdd} { clock scan {38 Dec ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.109 {parse yymmdd} { clock scan {38 12 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.110 {parse yymmdd} { clock scan {38 12 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.111 {parse yymmdd} { clock scan {38 12 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.112 {parse yymmdd} { clock scan {38 12 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.113 {parse yymmdd} { clock scan {38 xii 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.114 {parse yymmdd} { clock scan {38 xii ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.115 {parse yymmdd} { clock scan {38 xii 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.116 {parse yymmdd} { clock scan {38 xii ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.117 {parse yymmdd} { clock scan {38 12 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.118 {parse yymmdd} { clock scan {38 12 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.119 {parse yymmdd} { clock scan {38 12 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.120 {parse yymmdd} { clock scan {38 12 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.121 {parse yymmdd} { clock scan {xxxviii Dec 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.122 {parse yymmdd} { clock scan {xxxviii Dec ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.123 {parse yymmdd} { clock scan {xxxviii Dec 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.124 {parse yymmdd} { clock scan {xxxviii Dec ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.125 {parse yymmdd} { clock scan {xxxviii December 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.126 {parse yymmdd} { clock scan {xxxviii December ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.127 {parse yymmdd} { clock scan {xxxviii December 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.128 {parse yymmdd} { clock scan {xxxviii December ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.129 {parse yymmdd} { clock scan {xxxviii Dec 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.130 {parse yymmdd} { clock scan {xxxviii Dec ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.131 {parse yymmdd} { clock scan {xxxviii Dec 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.132 {parse yymmdd} { clock scan {xxxviii Dec ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.133 {parse yymmdd} { clock scan {xxxviii 12 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.134 {parse yymmdd} { clock scan {xxxviii 12 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.135 {parse yymmdd} { clock scan {xxxviii 12 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.136 {parse yymmdd} { clock scan {xxxviii 12 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.137 {parse yymmdd} { clock scan {xxxviii xii 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.138 {parse yymmdd} { clock scan {xxxviii xii ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.139 {parse yymmdd} { clock scan {xxxviii xii 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.140 {parse yymmdd} { clock scan {xxxviii xii ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.141 {parse yymmdd} { clock scan {xxxviii 12 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } -980899200 test clock-14.142 {parse yymmdd} { clock scan {xxxviii 12 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } -980899200 test clock-14.143 {parse yymmdd} { clock scan {xxxviii 12 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } -980899200 test clock-14.144 {parse yymmdd} { clock scan {xxxviii 12 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } -980899200 test clock-14.145 {parse yymmdd} { clock scan {38 Dec 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.146 {parse yymmdd} { clock scan {38 Dec xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.147 {parse yymmdd} { clock scan {38 Dec 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.148 {parse yymmdd} { clock scan {38 Dec xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.149 {parse yymmdd} { clock scan {38 December 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.150 {parse yymmdd} { clock scan {38 December xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.151 {parse yymmdd} { clock scan {38 December 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.152 {parse yymmdd} { clock scan {38 December xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.153 {parse yymmdd} { clock scan {38 Dec 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.154 {parse yymmdd} { clock scan {38 Dec xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.155 {parse yymmdd} { clock scan {38 Dec 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.156 {parse yymmdd} { clock scan {38 Dec xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.157 {parse yymmdd} { clock scan {38 12 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.158 {parse yymmdd} { clock scan {38 12 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.159 {parse yymmdd} { clock scan {38 12 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.160 {parse yymmdd} { clock scan {38 12 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.161 {parse yymmdd} { clock scan {38 xii 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.162 {parse yymmdd} { clock scan {38 xii xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.163 {parse yymmdd} { clock scan {38 xii 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.164 {parse yymmdd} { clock scan {38 xii xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.165 {parse yymmdd} { clock scan {38 12 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.166 {parse yymmdd} { clock scan {38 12 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.167 {parse yymmdd} { clock scan {38 12 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.168 {parse yymmdd} { clock scan {38 12 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.169 {parse yymmdd} { clock scan {xxxviii Dec 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.170 {parse yymmdd} { clock scan {xxxviii Dec xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.171 {parse yymmdd} { clock scan {xxxviii Dec 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.172 {parse yymmdd} { clock scan {xxxviii Dec xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.173 {parse yymmdd} { clock scan {xxxviii December 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.174 {parse yymmdd} { clock scan {xxxviii December xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.175 {parse yymmdd} { clock scan {xxxviii December 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.176 {parse yymmdd} { clock scan {xxxviii December xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.177 {parse yymmdd} { clock scan {xxxviii Dec 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.178 {parse yymmdd} { clock scan {xxxviii Dec xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.179 {parse yymmdd} { clock scan {xxxviii Dec 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.180 {parse yymmdd} { clock scan {xxxviii Dec xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.181 {parse yymmdd} { clock scan {xxxviii 12 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.182 {parse yymmdd} { clock scan {xxxviii 12 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.183 {parse yymmdd} { clock scan {xxxviii 12 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.184 {parse yymmdd} { clock scan {xxxviii 12 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.185 {parse yymmdd} { clock scan {xxxviii xii 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.186 {parse yymmdd} { clock scan {xxxviii xii xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.187 {parse yymmdd} { clock scan {xxxviii xii 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.188 {parse yymmdd} { clock scan {xxxviii xii xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.189 {parse yymmdd} { clock scan {xxxviii 12 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } -978393600 test clock-14.190 {parse yymmdd} { clock scan {xxxviii 12 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } -978393600 test clock-14.191 {parse yymmdd} { clock scan {xxxviii 12 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } -978393600 test clock-14.192 {parse yymmdd} { clock scan {xxxviii 12 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } -978393600 test clock-14.193 {parse yymmdd} { clock scan {70 Jan 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.194 {parse yymmdd} { clock scan {70 Jan ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.195 {parse yymmdd} { clock scan {70 Jan 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.196 {parse yymmdd} { clock scan {70 Jan ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.197 {parse yymmdd} { clock scan {70 January 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.198 {parse yymmdd} { clock scan {70 January ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.199 {parse yymmdd} { clock scan {70 January 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.200 {parse yymmdd} { clock scan {70 January ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.201 {parse yymmdd} { clock scan {70 Jan 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.202 {parse yymmdd} { clock scan {70 Jan ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.203 {parse yymmdd} { clock scan {70 Jan 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.204 {parse yymmdd} { clock scan {70 Jan ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.205 {parse yymmdd} { clock scan {70 01 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.206 {parse yymmdd} { clock scan {70 01 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.207 {parse yymmdd} { clock scan {70 01 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.208 {parse yymmdd} { clock scan {70 01 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.209 {parse yymmdd} { clock scan {70 i 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.210 {parse yymmdd} { clock scan {70 i ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.211 {parse yymmdd} { clock scan {70 i 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.212 {parse yymmdd} { clock scan {70 i ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.213 {parse yymmdd} { clock scan {70 1 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.214 {parse yymmdd} { clock scan {70 1 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.215 {parse yymmdd} { clock scan {70 1 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.216 {parse yymmdd} { clock scan {70 1 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.217 {parse yymmdd} { clock scan {lxx Jan 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.218 {parse yymmdd} { clock scan {lxx Jan ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.219 {parse yymmdd} { clock scan {lxx Jan 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.220 {parse yymmdd} { clock scan {lxx Jan ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.221 {parse yymmdd} { clock scan {lxx January 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.222 {parse yymmdd} { clock scan {lxx January ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.223 {parse yymmdd} { clock scan {lxx January 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.224 {parse yymmdd} { clock scan {lxx January ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.225 {parse yymmdd} { clock scan {lxx Jan 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.226 {parse yymmdd} { clock scan {lxx Jan ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.227 {parse yymmdd} { clock scan {lxx Jan 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.228 {parse yymmdd} { clock scan {lxx Jan ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.229 {parse yymmdd} { clock scan {lxx 01 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.230 {parse yymmdd} { clock scan {lxx 01 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.231 {parse yymmdd} { clock scan {lxx 01 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.232 {parse yymmdd} { clock scan {lxx 01 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.233 {parse yymmdd} { clock scan {lxx i 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.234 {parse yymmdd} { clock scan {lxx i ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.235 {parse yymmdd} { clock scan {lxx i 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.236 {parse yymmdd} { clock scan {lxx i ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.237 {parse yymmdd} { clock scan {lxx 1 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 86400 test clock-14.238 {parse yymmdd} { clock scan {lxx 1 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 86400 test clock-14.239 {parse yymmdd} { clock scan {lxx 1 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 86400 test clock-14.240 {parse yymmdd} { clock scan {lxx 1 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 86400 test clock-14.241 {parse yymmdd} { clock scan {70 Jan 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.242 {parse yymmdd} { clock scan {70 Jan xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.243 {parse yymmdd} { clock scan {70 Jan 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.244 {parse yymmdd} { clock scan {70 Jan xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.245 {parse yymmdd} { clock scan {70 January 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.246 {parse yymmdd} { clock scan {70 January xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.247 {parse yymmdd} { clock scan {70 January 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.248 {parse yymmdd} { clock scan {70 January xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.249 {parse yymmdd} { clock scan {70 Jan 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.250 {parse yymmdd} { clock scan {70 Jan xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.251 {parse yymmdd} { clock scan {70 Jan 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.252 {parse yymmdd} { clock scan {70 Jan xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.253 {parse yymmdd} { clock scan {70 01 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.254 {parse yymmdd} { clock scan {70 01 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.255 {parse yymmdd} { clock scan {70 01 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.256 {parse yymmdd} { clock scan {70 01 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.257 {parse yymmdd} { clock scan {70 i 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.258 {parse yymmdd} { clock scan {70 i xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.259 {parse yymmdd} { clock scan {70 i 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.260 {parse yymmdd} { clock scan {70 i xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.261 {parse yymmdd} { clock scan {70 1 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.262 {parse yymmdd} { clock scan {70 1 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.263 {parse yymmdd} { clock scan {70 1 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.264 {parse yymmdd} { clock scan {70 1 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.265 {parse yymmdd} { clock scan {lxx Jan 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.266 {parse yymmdd} { clock scan {lxx Jan xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.267 {parse yymmdd} { clock scan {lxx Jan 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.268 {parse yymmdd} { clock scan {lxx Jan xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.269 {parse yymmdd} { clock scan {lxx January 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.270 {parse yymmdd} { clock scan {lxx January xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.271 {parse yymmdd} { clock scan {lxx January 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.272 {parse yymmdd} { clock scan {lxx January xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.273 {parse yymmdd} { clock scan {lxx Jan 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.274 {parse yymmdd} { clock scan {lxx Jan xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.275 {parse yymmdd} { clock scan {lxx Jan 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.276 {parse yymmdd} { clock scan {lxx Jan xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.277 {parse yymmdd} { clock scan {lxx 01 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.278 {parse yymmdd} { clock scan {lxx 01 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.279 {parse yymmdd} { clock scan {lxx 01 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.280 {parse yymmdd} { clock scan {lxx 01 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.281 {parse yymmdd} { clock scan {lxx i 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.282 {parse yymmdd} { clock scan {lxx i xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.283 {parse yymmdd} { clock scan {lxx i 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.284 {parse yymmdd} { clock scan {lxx i xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.285 {parse yymmdd} { clock scan {lxx 1 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 2592000 test clock-14.286 {parse yymmdd} { clock scan {lxx 1 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 2592000 test clock-14.287 {parse yymmdd} { clock scan {lxx 1 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 2592000 test clock-14.288 {parse yymmdd} { clock scan {lxx 1 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 2592000 test clock-14.289 {parse yymmdd} { clock scan {70 Dec 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.290 {parse yymmdd} { clock scan {70 Dec ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.291 {parse yymmdd} { clock scan {70 Dec 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.292 {parse yymmdd} { clock scan {70 Dec ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.293 {parse yymmdd} { clock scan {70 December 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.294 {parse yymmdd} { clock scan {70 December ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.295 {parse yymmdd} { clock scan {70 December 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.296 {parse yymmdd} { clock scan {70 December ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.297 {parse yymmdd} { clock scan {70 Dec 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.298 {parse yymmdd} { clock scan {70 Dec ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.299 {parse yymmdd} { clock scan {70 Dec 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.300 {parse yymmdd} { clock scan {70 Dec ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.301 {parse yymmdd} { clock scan {70 12 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.302 {parse yymmdd} { clock scan {70 12 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.303 {parse yymmdd} { clock scan {70 12 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.304 {parse yymmdd} { clock scan {70 12 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.305 {parse yymmdd} { clock scan {70 xii 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.306 {parse yymmdd} { clock scan {70 xii ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.307 {parse yymmdd} { clock scan {70 xii 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.308 {parse yymmdd} { clock scan {70 xii ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.309 {parse yymmdd} { clock scan {70 12 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.310 {parse yymmdd} { clock scan {70 12 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.311 {parse yymmdd} { clock scan {70 12 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.312 {parse yymmdd} { clock scan {70 12 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.313 {parse yymmdd} { clock scan {lxx Dec 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.314 {parse yymmdd} { clock scan {lxx Dec ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.315 {parse yymmdd} { clock scan {lxx Dec 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.316 {parse yymmdd} { clock scan {lxx Dec ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.317 {parse yymmdd} { clock scan {lxx December 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.318 {parse yymmdd} { clock scan {lxx December ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.319 {parse yymmdd} { clock scan {lxx December 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.320 {parse yymmdd} { clock scan {lxx December ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.321 {parse yymmdd} { clock scan {lxx Dec 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.322 {parse yymmdd} { clock scan {lxx Dec ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.323 {parse yymmdd} { clock scan {lxx Dec 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.324 {parse yymmdd} { clock scan {lxx Dec ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.325 {parse yymmdd} { clock scan {lxx 12 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.326 {parse yymmdd} { clock scan {lxx 12 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.327 {parse yymmdd} { clock scan {lxx 12 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.328 {parse yymmdd} { clock scan {lxx 12 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.329 {parse yymmdd} { clock scan {lxx xii 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.330 {parse yymmdd} { clock scan {lxx xii ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.331 {parse yymmdd} { clock scan {lxx xii 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.332 {parse yymmdd} { clock scan {lxx xii ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.333 {parse yymmdd} { clock scan {lxx 12 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 28944000 test clock-14.334 {parse yymmdd} { clock scan {lxx 12 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 28944000 test clock-14.335 {parse yymmdd} { clock scan {lxx 12 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 28944000 test clock-14.336 {parse yymmdd} { clock scan {lxx 12 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 28944000 test clock-14.337 {parse yymmdd} { clock scan {70 Dec 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.338 {parse yymmdd} { clock scan {70 Dec xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.339 {parse yymmdd} { clock scan {70 Dec 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.340 {parse yymmdd} { clock scan {70 Dec xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.341 {parse yymmdd} { clock scan {70 December 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.342 {parse yymmdd} { clock scan {70 December xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.343 {parse yymmdd} { clock scan {70 December 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.344 {parse yymmdd} { clock scan {70 December xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.345 {parse yymmdd} { clock scan {70 Dec 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.346 {parse yymmdd} { clock scan {70 Dec xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.347 {parse yymmdd} { clock scan {70 Dec 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.348 {parse yymmdd} { clock scan {70 Dec xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.349 {parse yymmdd} { clock scan {70 12 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.350 {parse yymmdd} { clock scan {70 12 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.351 {parse yymmdd} { clock scan {70 12 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.352 {parse yymmdd} { clock scan {70 12 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.353 {parse yymmdd} { clock scan {70 xii 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.354 {parse yymmdd} { clock scan {70 xii xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.355 {parse yymmdd} { clock scan {70 xii 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.356 {parse yymmdd} { clock scan {70 xii xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.357 {parse yymmdd} { clock scan {70 12 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.358 {parse yymmdd} { clock scan {70 12 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.359 {parse yymmdd} { clock scan {70 12 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.360 {parse yymmdd} { clock scan {70 12 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.361 {parse yymmdd} { clock scan {lxx Dec 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.362 {parse yymmdd} { clock scan {lxx Dec xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.363 {parse yymmdd} { clock scan {lxx Dec 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.364 {parse yymmdd} { clock scan {lxx Dec xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.365 {parse yymmdd} { clock scan {lxx December 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.366 {parse yymmdd} { clock scan {lxx December xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.367 {parse yymmdd} { clock scan {lxx December 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.368 {parse yymmdd} { clock scan {lxx December xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.369 {parse yymmdd} { clock scan {lxx Dec 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.370 {parse yymmdd} { clock scan {lxx Dec xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.371 {parse yymmdd} { clock scan {lxx Dec 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.372 {parse yymmdd} { clock scan {lxx Dec xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.373 {parse yymmdd} { clock scan {lxx 12 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.374 {parse yymmdd} { clock scan {lxx 12 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.375 {parse yymmdd} { clock scan {lxx 12 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.376 {parse yymmdd} { clock scan {lxx 12 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.377 {parse yymmdd} { clock scan {lxx xii 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.378 {parse yymmdd} { clock scan {lxx xii xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.379 {parse yymmdd} { clock scan {lxx xii 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.380 {parse yymmdd} { clock scan {lxx xii xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.381 {parse yymmdd} { clock scan {lxx 12 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 31449600 test clock-14.382 {parse yymmdd} { clock scan {lxx 12 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 31449600 test clock-14.383 {parse yymmdd} { clock scan {lxx 12 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 31449600 test clock-14.384 {parse yymmdd} { clock scan {lxx 12 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 31449600 test clock-14.385 {parse yymmdd} { clock scan {00 Jan 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.386 {parse yymmdd} { clock scan {00 Jan ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.387 {parse yymmdd} { clock scan {00 Jan 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.388 {parse yymmdd} { clock scan {00 Jan ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.389 {parse yymmdd} { clock scan {00 January 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.390 {parse yymmdd} { clock scan {00 January ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.391 {parse yymmdd} { clock scan {00 January 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.392 {parse yymmdd} { clock scan {00 January ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.393 {parse yymmdd} { clock scan {00 Jan 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.394 {parse yymmdd} { clock scan {00 Jan ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.395 {parse yymmdd} { clock scan {00 Jan 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.396 {parse yymmdd} { clock scan {00 Jan ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.397 {parse yymmdd} { clock scan {00 01 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.398 {parse yymmdd} { clock scan {00 01 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.399 {parse yymmdd} { clock scan {00 01 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.400 {parse yymmdd} { clock scan {00 01 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.401 {parse yymmdd} { clock scan {00 i 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.402 {parse yymmdd} { clock scan {00 i ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.403 {parse yymmdd} { clock scan {00 i 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.404 {parse yymmdd} { clock scan {00 i ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.405 {parse yymmdd} { clock scan {00 1 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.406 {parse yymmdd} { clock scan {00 1 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.407 {parse yymmdd} { clock scan {00 1 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.408 {parse yymmdd} { clock scan {00 1 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.409 {parse yymmdd} { clock scan {? Jan 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.410 {parse yymmdd} { clock scan {? Jan ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.411 {parse yymmdd} { clock scan {? Jan 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.412 {parse yymmdd} { clock scan {? Jan ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.413 {parse yymmdd} { clock scan {? January 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.414 {parse yymmdd} { clock scan {? January ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.415 {parse yymmdd} { clock scan {? January 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.416 {parse yymmdd} { clock scan {? January ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.417 {parse yymmdd} { clock scan {? Jan 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.418 {parse yymmdd} { clock scan {? Jan ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.419 {parse yymmdd} { clock scan {? Jan 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.420 {parse yymmdd} { clock scan {? Jan ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.421 {parse yymmdd} { clock scan {? 01 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.422 {parse yymmdd} { clock scan {? 01 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.423 {parse yymmdd} { clock scan {? 01 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.424 {parse yymmdd} { clock scan {? 01 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.425 {parse yymmdd} { clock scan {? i 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.426 {parse yymmdd} { clock scan {? i ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.427 {parse yymmdd} { clock scan {? i 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.428 {parse yymmdd} { clock scan {? i ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.429 {parse yymmdd} { clock scan {? 1 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 946771200 test clock-14.430 {parse yymmdd} { clock scan {? 1 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 946771200 test clock-14.431 {parse yymmdd} { clock scan {? 1 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 946771200 test clock-14.432 {parse yymmdd} { clock scan {? 1 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 946771200 test clock-14.433 {parse yymmdd} { clock scan {00 Jan 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.434 {parse yymmdd} { clock scan {00 Jan xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.435 {parse yymmdd} { clock scan {00 Jan 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.436 {parse yymmdd} { clock scan {00 Jan xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.437 {parse yymmdd} { clock scan {00 January 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.438 {parse yymmdd} { clock scan {00 January xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.439 {parse yymmdd} { clock scan {00 January 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.440 {parse yymmdd} { clock scan {00 January xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.441 {parse yymmdd} { clock scan {00 Jan 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.442 {parse yymmdd} { clock scan {00 Jan xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.443 {parse yymmdd} { clock scan {00 Jan 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.444 {parse yymmdd} { clock scan {00 Jan xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.445 {parse yymmdd} { clock scan {00 01 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.446 {parse yymmdd} { clock scan {00 01 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.447 {parse yymmdd} { clock scan {00 01 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.448 {parse yymmdd} { clock scan {00 01 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.449 {parse yymmdd} { clock scan {00 i 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.450 {parse yymmdd} { clock scan {00 i xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.451 {parse yymmdd} { clock scan {00 i 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.452 {parse yymmdd} { clock scan {00 i xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.453 {parse yymmdd} { clock scan {00 1 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.454 {parse yymmdd} { clock scan {00 1 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.455 {parse yymmdd} { clock scan {00 1 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.456 {parse yymmdd} { clock scan {00 1 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.457 {parse yymmdd} { clock scan {? Jan 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.458 {parse yymmdd} { clock scan {? Jan xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.459 {parse yymmdd} { clock scan {? Jan 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.460 {parse yymmdd} { clock scan {? Jan xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.461 {parse yymmdd} { clock scan {? January 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.462 {parse yymmdd} { clock scan {? January xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.463 {parse yymmdd} { clock scan {? January 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.464 {parse yymmdd} { clock scan {? January xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.465 {parse yymmdd} { clock scan {? Jan 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.466 {parse yymmdd} { clock scan {? Jan xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.467 {parse yymmdd} { clock scan {? Jan 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.468 {parse yymmdd} { clock scan {? Jan xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.469 {parse yymmdd} { clock scan {? 01 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.470 {parse yymmdd} { clock scan {? 01 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.471 {parse yymmdd} { clock scan {? 01 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.472 {parse yymmdd} { clock scan {? 01 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.473 {parse yymmdd} { clock scan {? i 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.474 {parse yymmdd} { clock scan {? i xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.475 {parse yymmdd} { clock scan {? i 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.476 {parse yymmdd} { clock scan {? i xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.477 {parse yymmdd} { clock scan {? 1 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 949276800 test clock-14.478 {parse yymmdd} { clock scan {? 1 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 949276800 test clock-14.479 {parse yymmdd} { clock scan {? 1 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 949276800 test clock-14.480 {parse yymmdd} { clock scan {? 1 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 949276800 test clock-14.481 {parse yymmdd} { clock scan {00 Dec 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.482 {parse yymmdd} { clock scan {00 Dec ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.483 {parse yymmdd} { clock scan {00 Dec 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.484 {parse yymmdd} { clock scan {00 Dec ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.485 {parse yymmdd} { clock scan {00 December 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.486 {parse yymmdd} { clock scan {00 December ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.487 {parse yymmdd} { clock scan {00 December 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.488 {parse yymmdd} { clock scan {00 December ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.489 {parse yymmdd} { clock scan {00 Dec 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.490 {parse yymmdd} { clock scan {00 Dec ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.491 {parse yymmdd} { clock scan {00 Dec 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.492 {parse yymmdd} { clock scan {00 Dec ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.493 {parse yymmdd} { clock scan {00 12 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.494 {parse yymmdd} { clock scan {00 12 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.495 {parse yymmdd} { clock scan {00 12 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.496 {parse yymmdd} { clock scan {00 12 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.497 {parse yymmdd} { clock scan {00 xii 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.498 {parse yymmdd} { clock scan {00 xii ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.499 {parse yymmdd} { clock scan {00 xii 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.500 {parse yymmdd} { clock scan {00 xii ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.501 {parse yymmdd} { clock scan {00 12 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.502 {parse yymmdd} { clock scan {00 12 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.503 {parse yymmdd} { clock scan {00 12 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.504 {parse yymmdd} { clock scan {00 12 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.505 {parse yymmdd} { clock scan {? Dec 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.506 {parse yymmdd} { clock scan {? Dec ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.507 {parse yymmdd} { clock scan {? Dec 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.508 {parse yymmdd} { clock scan {? Dec ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.509 {parse yymmdd} { clock scan {? December 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.510 {parse yymmdd} { clock scan {? December ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.511 {parse yymmdd} { clock scan {? December 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.512 {parse yymmdd} { clock scan {? December ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.513 {parse yymmdd} { clock scan {? Dec 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.514 {parse yymmdd} { clock scan {? Dec ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.515 {parse yymmdd} { clock scan {? Dec 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.516 {parse yymmdd} { clock scan {? Dec ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.517 {parse yymmdd} { clock scan {? 12 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.518 {parse yymmdd} { clock scan {? 12 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.519 {parse yymmdd} { clock scan {? 12 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.520 {parse yymmdd} { clock scan {? 12 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.521 {parse yymmdd} { clock scan {? xii 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.522 {parse yymmdd} { clock scan {? xii ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.523 {parse yymmdd} { clock scan {? xii 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.524 {parse yymmdd} { clock scan {? xii ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.525 {parse yymmdd} { clock scan {? 12 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 975715200 test clock-14.526 {parse yymmdd} { clock scan {? 12 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 975715200 test clock-14.527 {parse yymmdd} { clock scan {? 12 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 975715200 test clock-14.528 {parse yymmdd} { clock scan {? 12 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 975715200 test clock-14.529 {parse yymmdd} { clock scan {00 Dec 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.530 {parse yymmdd} { clock scan {00 Dec xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.531 {parse yymmdd} { clock scan {00 Dec 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.532 {parse yymmdd} { clock scan {00 Dec xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.533 {parse yymmdd} { clock scan {00 December 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.534 {parse yymmdd} { clock scan {00 December xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.535 {parse yymmdd} { clock scan {00 December 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.536 {parse yymmdd} { clock scan {00 December xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.537 {parse yymmdd} { clock scan {00 Dec 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.538 {parse yymmdd} { clock scan {00 Dec xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.539 {parse yymmdd} { clock scan {00 Dec 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.540 {parse yymmdd} { clock scan {00 Dec xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.541 {parse yymmdd} { clock scan {00 12 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.542 {parse yymmdd} { clock scan {00 12 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.543 {parse yymmdd} { clock scan {00 12 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.544 {parse yymmdd} { clock scan {00 12 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.545 {parse yymmdd} { clock scan {00 xii 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.546 {parse yymmdd} { clock scan {00 xii xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.547 {parse yymmdd} { clock scan {00 xii 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.548 {parse yymmdd} { clock scan {00 xii xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.549 {parse yymmdd} { clock scan {00 12 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.550 {parse yymmdd} { clock scan {00 12 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.551 {parse yymmdd} { clock scan {00 12 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.552 {parse yymmdd} { clock scan {00 12 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.553 {parse yymmdd} { clock scan {? Dec 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.554 {parse yymmdd} { clock scan {? Dec xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.555 {parse yymmdd} { clock scan {? Dec 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.556 {parse yymmdd} { clock scan {? Dec xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.557 {parse yymmdd} { clock scan {? December 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.558 {parse yymmdd} { clock scan {? December xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.559 {parse yymmdd} { clock scan {? December 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.560 {parse yymmdd} { clock scan {? December xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.561 {parse yymmdd} { clock scan {? Dec 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.562 {parse yymmdd} { clock scan {? Dec xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.563 {parse yymmdd} { clock scan {? Dec 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.564 {parse yymmdd} { clock scan {? Dec xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.565 {parse yymmdd} { clock scan {? 12 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.566 {parse yymmdd} { clock scan {? 12 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.567 {parse yymmdd} { clock scan {? 12 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.568 {parse yymmdd} { clock scan {? 12 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.569 {parse yymmdd} { clock scan {? xii 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.570 {parse yymmdd} { clock scan {? xii xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.571 {parse yymmdd} { clock scan {? xii 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.572 {parse yymmdd} { clock scan {? xii xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.573 {parse yymmdd} { clock scan {? 12 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 978220800 test clock-14.574 {parse yymmdd} { clock scan {? 12 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 978220800 test clock-14.575 {parse yymmdd} { clock scan {? 12 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 978220800 test clock-14.576 {parse yymmdd} { clock scan {? 12 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 978220800 test clock-14.577 {parse yymmdd} { clock scan {37 Jan 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.578 {parse yymmdd} { clock scan {37 Jan ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.579 {parse yymmdd} { clock scan {37 Jan 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.580 {parse yymmdd} { clock scan {37 Jan ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.581 {parse yymmdd} { clock scan {37 January 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.582 {parse yymmdd} { clock scan {37 January ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.583 {parse yymmdd} { clock scan {37 January 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.584 {parse yymmdd} { clock scan {37 January ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.585 {parse yymmdd} { clock scan {37 Jan 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.586 {parse yymmdd} { clock scan {37 Jan ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.587 {parse yymmdd} { clock scan {37 Jan 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.588 {parse yymmdd} { clock scan {37 Jan ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.589 {parse yymmdd} { clock scan {37 01 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.590 {parse yymmdd} { clock scan {37 01 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.591 {parse yymmdd} { clock scan {37 01 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.592 {parse yymmdd} { clock scan {37 01 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.593 {parse yymmdd} { clock scan {37 i 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.594 {parse yymmdd} { clock scan {37 i ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.595 {parse yymmdd} { clock scan {37 i 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.596 {parse yymmdd} { clock scan {37 i ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.597 {parse yymmdd} { clock scan {37 1 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.598 {parse yymmdd} { clock scan {37 1 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.599 {parse yymmdd} { clock scan {37 1 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.600 {parse yymmdd} { clock scan {37 1 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.601 {parse yymmdd} { clock scan {xxxvii Jan 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.602 {parse yymmdd} { clock scan {xxxvii Jan ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.603 {parse yymmdd} { clock scan {xxxvii Jan 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.604 {parse yymmdd} { clock scan {xxxvii Jan ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.605 {parse yymmdd} { clock scan {xxxvii January 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.606 {parse yymmdd} { clock scan {xxxvii January ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.607 {parse yymmdd} { clock scan {xxxvii January 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.608 {parse yymmdd} { clock scan {xxxvii January ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.609 {parse yymmdd} { clock scan {xxxvii Jan 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.610 {parse yymmdd} { clock scan {xxxvii Jan ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.611 {parse yymmdd} { clock scan {xxxvii Jan 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.612 {parse yymmdd} { clock scan {xxxvii Jan ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.613 {parse yymmdd} { clock scan {xxxvii 01 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.614 {parse yymmdd} { clock scan {xxxvii 01 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.615 {parse yymmdd} { clock scan {xxxvii 01 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.616 {parse yymmdd} { clock scan {xxxvii 01 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.617 {parse yymmdd} { clock scan {xxxvii i 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.618 {parse yymmdd} { clock scan {xxxvii i ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.619 {parse yymmdd} { clock scan {xxxvii i 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.620 {parse yymmdd} { clock scan {xxxvii i ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.621 {parse yymmdd} { clock scan {xxxvii 1 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.622 {parse yymmdd} { clock scan {xxxvii 1 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.623 {parse yymmdd} { clock scan {xxxvii 1 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.624 {parse yymmdd} { clock scan {xxxvii 1 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 2114467200 test clock-14.625 {parse yymmdd} { clock scan {37 Jan 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.626 {parse yymmdd} { clock scan {37 Jan xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.627 {parse yymmdd} { clock scan {37 Jan 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.628 {parse yymmdd} { clock scan {37 Jan xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.629 {parse yymmdd} { clock scan {37 January 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.630 {parse yymmdd} { clock scan {37 January xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.631 {parse yymmdd} { clock scan {37 January 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.632 {parse yymmdd} { clock scan {37 January xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.633 {parse yymmdd} { clock scan {37 Jan 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.634 {parse yymmdd} { clock scan {37 Jan xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.635 {parse yymmdd} { clock scan {37 Jan 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.636 {parse yymmdd} { clock scan {37 Jan xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.637 {parse yymmdd} { clock scan {37 01 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.638 {parse yymmdd} { clock scan {37 01 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.639 {parse yymmdd} { clock scan {37 01 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.640 {parse yymmdd} { clock scan {37 01 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.641 {parse yymmdd} { clock scan {37 i 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.642 {parse yymmdd} { clock scan {37 i xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.643 {parse yymmdd} { clock scan {37 i 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.644 {parse yymmdd} { clock scan {37 i xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.645 {parse yymmdd} { clock scan {37 1 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.646 {parse yymmdd} { clock scan {37 1 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.647 {parse yymmdd} { clock scan {37 1 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.648 {parse yymmdd} { clock scan {37 1 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.649 {parse yymmdd} { clock scan {xxxvii Jan 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.650 {parse yymmdd} { clock scan {xxxvii Jan xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.651 {parse yymmdd} { clock scan {xxxvii Jan 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.652 {parse yymmdd} { clock scan {xxxvii Jan xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.653 {parse yymmdd} { clock scan {xxxvii January 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.654 {parse yymmdd} { clock scan {xxxvii January xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.655 {parse yymmdd} { clock scan {xxxvii January 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.656 {parse yymmdd} { clock scan {xxxvii January xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.657 {parse yymmdd} { clock scan {xxxvii Jan 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.658 {parse yymmdd} { clock scan {xxxvii Jan xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.659 {parse yymmdd} { clock scan {xxxvii Jan 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.660 {parse yymmdd} { clock scan {xxxvii Jan xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.661 {parse yymmdd} { clock scan {xxxvii 01 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.662 {parse yymmdd} { clock scan {xxxvii 01 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.663 {parse yymmdd} { clock scan {xxxvii 01 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.664 {parse yymmdd} { clock scan {xxxvii 01 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.665 {parse yymmdd} { clock scan {xxxvii i 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.666 {parse yymmdd} { clock scan {xxxvii i xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.667 {parse yymmdd} { clock scan {xxxvii i 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.668 {parse yymmdd} { clock scan {xxxvii i xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.669 {parse yymmdd} { clock scan {xxxvii 1 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.670 {parse yymmdd} { clock scan {xxxvii 1 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.671 {parse yymmdd} { clock scan {xxxvii 1 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.672 {parse yymmdd} { clock scan {xxxvii 1 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 2116972800 test clock-14.673 {parse yymmdd} { clock scan {37 Dec 02} -format {%y %b %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.674 {parse yymmdd} { clock scan {37 Dec ii} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.675 {parse yymmdd} { clock scan {37 Dec 2} -format {%y %b %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.676 {parse yymmdd} { clock scan {37 Dec ii} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.677 {parse yymmdd} { clock scan {37 December 02} -format {%y %B %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.678 {parse yymmdd} { clock scan {37 December ii} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.679 {parse yymmdd} { clock scan {37 December 2} -format {%y %B %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.680 {parse yymmdd} { clock scan {37 December ii} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.681 {parse yymmdd} { clock scan {37 Dec 02} -format {%y %h %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.682 {parse yymmdd} { clock scan {37 Dec ii} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.683 {parse yymmdd} { clock scan {37 Dec 2} -format {%y %h %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.684 {parse yymmdd} { clock scan {37 Dec ii} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.685 {parse yymmdd} { clock scan {37 12 02} -format {%y %m %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.686 {parse yymmdd} { clock scan {37 12 ii} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.687 {parse yymmdd} { clock scan {37 12 2} -format {%y %m %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.688 {parse yymmdd} { clock scan {37 12 ii} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.689 {parse yymmdd} { clock scan {37 xii 02} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.690 {parse yymmdd} { clock scan {37 xii ii} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.691 {parse yymmdd} { clock scan {37 xii 2} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.692 {parse yymmdd} { clock scan {37 xii ii} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.693 {parse yymmdd} { clock scan {37 12 02} -format {%y %N %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.694 {parse yymmdd} { clock scan {37 12 ii} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.695 {parse yymmdd} { clock scan {37 12 2} -format {%y %N %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.696 {parse yymmdd} { clock scan {37 12 ii} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.697 {parse yymmdd} { clock scan {xxxvii Dec 02} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.698 {parse yymmdd} { clock scan {xxxvii Dec ii} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.699 {parse yymmdd} { clock scan {xxxvii Dec 2} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.700 {parse yymmdd} { clock scan {xxxvii Dec ii} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.701 {parse yymmdd} { clock scan {xxxvii December 02} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.702 {parse yymmdd} { clock scan {xxxvii December ii} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.703 {parse yymmdd} { clock scan {xxxvii December 2} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.704 {parse yymmdd} { clock scan {xxxvii December ii} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.705 {parse yymmdd} { clock scan {xxxvii Dec 02} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.706 {parse yymmdd} { clock scan {xxxvii Dec ii} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.707 {parse yymmdd} { clock scan {xxxvii Dec 2} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.708 {parse yymmdd} { clock scan {xxxvii Dec ii} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.709 {parse yymmdd} { clock scan {xxxvii 12 02} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.710 {parse yymmdd} { clock scan {xxxvii 12 ii} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.711 {parse yymmdd} { clock scan {xxxvii 12 2} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.712 {parse yymmdd} { clock scan {xxxvii 12 ii} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.713 {parse yymmdd} { clock scan {xxxvii xii 02} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.714 {parse yymmdd} { clock scan {xxxvii xii ii} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.715 {parse yymmdd} { clock scan {xxxvii xii 2} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.716 {parse yymmdd} { clock scan {xxxvii xii ii} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.717 {parse yymmdd} { clock scan {xxxvii 12 02} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.718 {parse yymmdd} { clock scan {xxxvii 12 ii} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.719 {parse yymmdd} { clock scan {xxxvii 12 2} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.720 {parse yymmdd} { clock scan {xxxvii 12 ii} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 2143324800 test clock-14.721 {parse yymmdd} { clock scan {37 Dec 31} -format {%y %b %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.722 {parse yymmdd} { clock scan {37 Dec xxxi} -format {%y %b %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.723 {parse yymmdd} { clock scan {37 Dec 31} -format {%y %b %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.724 {parse yymmdd} { clock scan {37 Dec xxxi} -format {%y %b %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.725 {parse yymmdd} { clock scan {37 December 31} -format {%y %B %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.726 {parse yymmdd} { clock scan {37 December xxxi} -format {%y %B %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.727 {parse yymmdd} { clock scan {37 December 31} -format {%y %B %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.728 {parse yymmdd} { clock scan {37 December xxxi} -format {%y %B %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.729 {parse yymmdd} { clock scan {37 Dec 31} -format {%y %h %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.730 {parse yymmdd} { clock scan {37 Dec xxxi} -format {%y %h %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.731 {parse yymmdd} { clock scan {37 Dec 31} -format {%y %h %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.732 {parse yymmdd} { clock scan {37 Dec xxxi} -format {%y %h %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.733 {parse yymmdd} { clock scan {37 12 31} -format {%y %m %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.734 {parse yymmdd} { clock scan {37 12 xxxi} -format {%y %m %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.735 {parse yymmdd} { clock scan {37 12 31} -format {%y %m %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.736 {parse yymmdd} { clock scan {37 12 xxxi} -format {%y %m %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.737 {parse yymmdd} { clock scan {37 xii 31} -format {%y %Om %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.738 {parse yymmdd} { clock scan {37 xii xxxi} -format {%y %Om %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.739 {parse yymmdd} { clock scan {37 xii 31} -format {%y %Om %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.740 {parse yymmdd} { clock scan {37 xii xxxi} -format {%y %Om %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.741 {parse yymmdd} { clock scan {37 12 31} -format {%y %N %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.742 {parse yymmdd} { clock scan {37 12 xxxi} -format {%y %N %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.743 {parse yymmdd} { clock scan {37 12 31} -format {%y %N %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.744 {parse yymmdd} { clock scan {37 12 xxxi} -format {%y %N %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.745 {parse yymmdd} { clock scan {xxxvii Dec 31} -format {%Oy %b %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.746 {parse yymmdd} { clock scan {xxxvii Dec xxxi} -format {%Oy %b %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.747 {parse yymmdd} { clock scan {xxxvii Dec 31} -format {%Oy %b %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.748 {parse yymmdd} { clock scan {xxxvii Dec xxxi} -format {%Oy %b %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.749 {parse yymmdd} { clock scan {xxxvii December 31} -format {%Oy %B %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.750 {parse yymmdd} { clock scan {xxxvii December xxxi} -format {%Oy %B %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.751 {parse yymmdd} { clock scan {xxxvii December 31} -format {%Oy %B %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.752 {parse yymmdd} { clock scan {xxxvii December xxxi} -format {%Oy %B %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.753 {parse yymmdd} { clock scan {xxxvii Dec 31} -format {%Oy %h %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.754 {parse yymmdd} { clock scan {xxxvii Dec xxxi} -format {%Oy %h %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.755 {parse yymmdd} { clock scan {xxxvii Dec 31} -format {%Oy %h %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.756 {parse yymmdd} { clock scan {xxxvii Dec xxxi} -format {%Oy %h %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.757 {parse yymmdd} { clock scan {xxxvii 12 31} -format {%Oy %m %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.758 {parse yymmdd} { clock scan {xxxvii 12 xxxi} -format {%Oy %m %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.759 {parse yymmdd} { clock scan {xxxvii 12 31} -format {%Oy %m %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.760 {parse yymmdd} { clock scan {xxxvii 12 xxxi} -format {%Oy %m %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.761 {parse yymmdd} { clock scan {xxxvii xii 31} -format {%Oy %Om %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.762 {parse yymmdd} { clock scan {xxxvii xii xxxi} -format {%Oy %Om %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.763 {parse yymmdd} { clock scan {xxxvii xii 31} -format {%Oy %Om %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.764 {parse yymmdd} { clock scan {xxxvii xii xxxi} -format {%Oy %Om %Oe} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.765 {parse yymmdd} { clock scan {xxxvii 12 31} -format {%Oy %N %d} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.766 {parse yymmdd} { clock scan {xxxvii 12 xxxi} -format {%Oy %N %Od} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.767 {parse yymmdd} { clock scan {xxxvii 12 31} -format {%Oy %N %e} -locale en_US_roman -gmt 1 } 2145830400 test clock-14.768 {parse yymmdd} { clock scan {xxxvii 12 xxxi} -format {%Oy %N %Oe} -locale en_US_roman -gmt 1 } 2145830400 # END testcases14 test clock-15.1 {yymmdd precedence below seconds} { list [clock scan {0 000101} -format {%s %y%m%d} -gmt true] \ [clock scan {000101 0} -format {%y%m%d %s} -gmt true] } {0 0} test clock-15.2 {yymmdd precedence below julian day} { list [clock scan {2440588 000101} -format {%J %y%m%d} -gmt true] \ [clock scan {000101 2440588} -format {%y%m%d %J} -gmt true] } {0 0} test clock-15.3 {yymmdd precedence below yyyyWwwd} valid_off { list [clock scan {1970W014000101} -format {%GW%V%u%y%m%d} -gmt true] \ [clock scan {0001011970W014} -format {%y%m%d%GW%V%u} -gmt true] } {0 0} # Test parsing of yyddd test clock-16.1 {parse yyddd} { clock scan {70 001} -format {%y %j} -locale en_US_roman -gmt 1 } 0 test clock-16.2 {parse yyddd} { clock scan {70 365} -format {%y %j} -locale en_US_roman -gmt 1 } 31449600 test clock-16.3 {parse yyddd} { clock scan {71 001} -format {%y %j} -locale en_US_roman -gmt 1 } 31536000 test clock-16.4 {parse yyddd} { clock scan {71 365} -format {%y %j} -locale en_US_roman -gmt 1 } 62985600 test clock-16.5 {parse yyddd} { clock scan {00 001} -format {%y %j} -locale en_US_roman -gmt 1 } 946684800 test clock-16.6 {parse yyddd} { clock scan {00 365} -format {%y %j} -locale en_US_roman -gmt 1 } 978134400 test clock-16.7 {parse yyddd} { clock scan {01 001} -format {%y %j} -locale en_US_roman -gmt 1 } 978307200 test clock-16.8 {parse yyddd} { clock scan {01 365} -format {%y %j} -locale en_US_roman -gmt 1 } 1009756800 test clock-16.9 {seconds take precedence over yyddd} { list [clock scan {0 00001} -format {%s %y%j} -gmt true] \ [clock scan {00001 0} -format {%y%j %s} -gmt true] } {0 0} test clock-16.10 {julian day takes precedence over yyddd} { list [clock scan {2440588 00001} -format {%J %y%j} -gmt true] \ [clock scan {00001 2440588} -format {%Y%j %J} -gmt true] } {0 0} test clock-16.11 {yyddd precedence below yyyyWwwd} valid_off { list [clock scan {1970W01400001} -format {%GW%V%u%y%j} -gmt true] \ [clock scan {000011970W014} -format {%y%j%GW%V%u} -gmt true] } {0 0} # BEGIN testcases17 # Test parsing of yyWwwd test clock-17.1 {parse yyWwwd} { clock scan {70 W01 Fri} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 86400 test clock-17.2 {parse yyWwwd} { clock scan {70 W01 Friday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 86400 test clock-17.3 {parse yyWwwd} { clock scan {70 W01 5} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 86400 test clock-17.4 {parse yyWwwd} { clock scan {70 W01 5} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 86400 test clock-17.5 {parse yyWwwd} { clock scan {70 W01 v} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 86400 test clock-17.6 {parse yyWwwd} { clock scan {70 W01 v} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 86400 test clock-17.7 {parse yyWwwd} { clock scan {70 W05 Sat} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 2592000 test clock-17.8 {parse yyWwwd} { clock scan {70 W05 Saturday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 2592000 test clock-17.9 {parse yyWwwd} { clock scan {70 W05 6} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 2592000 test clock-17.10 {parse yyWwwd} { clock scan {70 W05 6} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 2592000 test clock-17.11 {parse yyWwwd} { clock scan {70 W05 vi} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 2592000 test clock-17.12 {parse yyWwwd} { clock scan {70 W05 vi} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 2592000 test clock-17.13 {parse yyWwwd} { clock scan {70 W49 Wed} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 28944000 test clock-17.14 {parse yyWwwd} { clock scan {70 W49 Wednesday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 28944000 test clock-17.15 {parse yyWwwd} { clock scan {70 W49 3} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 28944000 test clock-17.16 {parse yyWwwd} { clock scan {70 W49 3} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 28944000 test clock-17.17 {parse yyWwwd} { clock scan {70 W49 iii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 28944000 test clock-17.18 {parse yyWwwd} { clock scan {70 W49 iii} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 28944000 test clock-17.19 {parse yyWwwd} { clock scan {70 W53 Thu} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 31449600 test clock-17.20 {parse yyWwwd} { clock scan {70 W53 Thursday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 31449600 test clock-17.21 {parse yyWwwd} { clock scan {70 W53 4} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 31449600 test clock-17.22 {parse yyWwwd} { clock scan {70 W53 4} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 31449600 test clock-17.23 {parse yyWwwd} { clock scan {70 W53 iv} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 31449600 test clock-17.24 {parse yyWwwd} { clock scan {70 W53 iv} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 31449600 test clock-17.25 {parse yyWwwd} { clock scan {70 W53 Sat} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 31622400 test clock-17.26 {parse yyWwwd} { clock scan {70 W53 Saturday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 31622400 test clock-17.27 {parse yyWwwd} { clock scan {70 W53 6} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 31622400 test clock-17.28 {parse yyWwwd} { clock scan {70 W53 6} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 31622400 test clock-17.29 {parse yyWwwd} { clock scan {70 W53 vi} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 31622400 test clock-17.30 {parse yyWwwd} { clock scan {70 W53 vi} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 31622400 test clock-17.31 {parse yyWwwd} { clock scan {71 W04 Sun} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 34128000 test clock-17.32 {parse yyWwwd} { clock scan {71 W04 Sunday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 34128000 test clock-17.33 {parse yyWwwd} { clock scan {71 W04 7} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 34128000 test clock-17.34 {parse yyWwwd} { clock scan {71 W04 0} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 34128000 test clock-17.35 {parse yyWwwd} { clock scan {71 W04 vii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 34128000 test clock-17.36 {parse yyWwwd} { clock scan {71 W04 ?} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 34128000 test clock-17.37 {parse yyWwwd} { clock scan {71 W48 Thu} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 60480000 test clock-17.38 {parse yyWwwd} { clock scan {71 W48 Thursday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 60480000 test clock-17.39 {parse yyWwwd} { clock scan {71 W48 4} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 60480000 test clock-17.40 {parse yyWwwd} { clock scan {71 W48 4} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 60480000 test clock-17.41 {parse yyWwwd} { clock scan {71 W48 iv} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 60480000 test clock-17.42 {parse yyWwwd} { clock scan {71 W48 iv} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 60480000 test clock-17.43 {parse yyWwwd} { clock scan {71 W52 Fri} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 62985600 test clock-17.44 {parse yyWwwd} { clock scan {71 W52 Friday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 62985600 test clock-17.45 {parse yyWwwd} { clock scan {71 W52 5} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 62985600 test clock-17.46 {parse yyWwwd} { clock scan {71 W52 5} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 62985600 test clock-17.47 {parse yyWwwd} { clock scan {71 W52 v} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 62985600 test clock-17.48 {parse yyWwwd} { clock scan {71 W52 v} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 62985600 test clock-17.49 {parse yyWwwd} { clock scan {99 W52 Sun} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 946771200 test clock-17.50 {parse yyWwwd} { clock scan {99 W52 Sunday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 946771200 test clock-17.51 {parse yyWwwd} { clock scan {99 W52 7} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 946771200 test clock-17.52 {parse yyWwwd} { clock scan {99 W52 0} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 946771200 test clock-17.53 {parse yyWwwd} { clock scan {99 W52 vii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 946771200 test clock-17.54 {parse yyWwwd} { clock scan {99 W52 ?} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 946771200 test clock-17.55 {parse yyWwwd} { clock scan {00 W05 Mon} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 949276800 test clock-17.56 {parse yyWwwd} { clock scan {00 W05 Monday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 949276800 test clock-17.57 {parse yyWwwd} { clock scan {00 W05 1} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 949276800 test clock-17.58 {parse yyWwwd} { clock scan {00 W05 1} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 949276800 test clock-17.59 {parse yyWwwd} { clock scan {00 W05 i} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 949276800 test clock-17.60 {parse yyWwwd} { clock scan {00 W05 i} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 949276800 test clock-17.61 {parse yyWwwd} { clock scan {00 W48 Sat} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 975715200 test clock-17.62 {parse yyWwwd} { clock scan {00 W48 Saturday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 975715200 test clock-17.63 {parse yyWwwd} { clock scan {00 W48 6} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 975715200 test clock-17.64 {parse yyWwwd} { clock scan {00 W48 6} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 975715200 test clock-17.65 {parse yyWwwd} { clock scan {00 W48 vi} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 975715200 test clock-17.66 {parse yyWwwd} { clock scan {00 W48 vi} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 975715200 test clock-17.67 {parse yyWwwd} { clock scan {00 W52 Sun} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 978220800 test clock-17.68 {parse yyWwwd} { clock scan {00 W52 Sunday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 978220800 test clock-17.69 {parse yyWwwd} { clock scan {00 W52 7} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 978220800 test clock-17.70 {parse yyWwwd} { clock scan {00 W52 0} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 978220800 test clock-17.71 {parse yyWwwd} { clock scan {00 W52 vii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 978220800 test clock-17.72 {parse yyWwwd} { clock scan {00 W52 ?} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 978220800 test clock-17.73 {parse yyWwwd} { clock scan {01 W01 Tue} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 978393600 test clock-17.74 {parse yyWwwd} { clock scan {01 W01 Tuesday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 978393600 test clock-17.75 {parse yyWwwd} { clock scan {01 W01 2} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 978393600 test clock-17.76 {parse yyWwwd} { clock scan {01 W01 2} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 978393600 test clock-17.77 {parse yyWwwd} { clock scan {01 W01 ii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 978393600 test clock-17.78 {parse yyWwwd} { clock scan {01 W01 ii} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 978393600 test clock-17.79 {parse yyWwwd} { clock scan {01 W05 Wed} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 980899200 test clock-17.80 {parse yyWwwd} { clock scan {01 W05 Wednesday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 980899200 test clock-17.81 {parse yyWwwd} { clock scan {01 W05 3} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 980899200 test clock-17.82 {parse yyWwwd} { clock scan {01 W05 3} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 980899200 test clock-17.83 {parse yyWwwd} { clock scan {01 W05 iii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 980899200 test clock-17.84 {parse yyWwwd} { clock scan {01 W05 iii} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 980899200 test clock-17.85 {parse yyWwwd} { clock scan {01 W48 Sun} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.86 {parse yyWwwd} { clock scan {01 W48 Sunday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.87 {parse yyWwwd} { clock scan {01 W48 7} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.88 {parse yyWwwd} { clock scan {01 W48 0} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.89 {parse yyWwwd} { clock scan {01 W48 vii} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.90 {parse yyWwwd} { clock scan {01 W48 ?} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 1007251200 test clock-17.91 {parse yyWwwd} { clock scan {02 W01 Mon} -format {%g W%V %a} -locale en_US_roman -gmt 1 } 1009756800 test clock-17.92 {parse yyWwwd} { clock scan {02 W01 Monday} -format {%g W%V %A} -locale en_US_roman -gmt 1 } 1009756800 test clock-17.93 {parse yyWwwd} { clock scan {02 W01 1} -format {%g W%V %u} -locale en_US_roman -gmt 1 } 1009756800 test clock-17.94 {parse yyWwwd} { clock scan {02 W01 1} -format {%g W%V %w} -locale en_US_roman -gmt 1 } 1009756800 test clock-17.95 {parse yyWwwd} { clock scan {02 W01 i} -format {%g W%V %Ou} -locale en_US_roman -gmt 1 } 1009756800 test clock-17.96 {parse yyWwwd} { clock scan {02 W01 i} -format {%g W%V %Ow} -locale en_US_roman -gmt 1 } 1009756800 # END testcases17 # Test precedence of yyWwwd test clock-18.1 {seconds take precedence over yyWwwd} valid_off { list [clock scan {0 00W014} -format {%s %gW%V%u} -gmt true] \ [clock scan {00W014 0} -format {%gW%V%u %s} -gmt true] } {0 0} test clock-18.2 {julian day takes precedence over yyddd} { list [clock scan {2440588 00W014} -format {%J %gW%V%u} -gmt true] \ [clock scan {00W014 2440588} -format {%gW%V%u %J} -gmt true] } {0 0} test clock-18.3 {yyWwwd precedence below yyyymmdd} valid_off { list [clock scan {19700101 00W014} -format {%Y%m%d %gW%V%u} -gmt true] \ [clock scan {00W014 19700101} -format {%gW%V%u %Y%m%d} -gmt true] } {0 0} test clock-18.4 {yyWwwd precedence below yyyyddd} valid_off { list [clock scan {1970001 00W014} -format {%Y%j %gW%V%u} -gmt true] \ [clock scan {00W014 1970001} -format {%gW%V%u %Y%j} -gmt true] } {0 0} # BEGIN testcases19 # Test parsing of mmdd test clock-19.1 {parse mmdd} { clock scan {Jan 02} -format {%b %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.2 {parse mmdd} { clock scan {Jan ii} -format {%b %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.3 {parse mmdd} { clock scan {Jan 2} -format {%b %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.4 {parse mmdd} { clock scan {Jan ii} -format {%b %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.5 {parse mmdd} { clock scan {January 02} -format {%B %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.6 {parse mmdd} { clock scan {January ii} -format {%B %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.7 {parse mmdd} { clock scan {January 2} -format {%B %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.8 {parse mmdd} { clock scan {January ii} -format {%B %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.9 {parse mmdd} { clock scan {Jan 02} -format {%h %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.10 {parse mmdd} { clock scan {Jan ii} -format {%h %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.11 {parse mmdd} { clock scan {Jan 2} -format {%h %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.12 {parse mmdd} { clock scan {Jan ii} -format {%h %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.13 {parse mmdd} { clock scan {01 02} -format {%m %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.14 {parse mmdd} { clock scan {01 ii} -format {%m %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.15 {parse mmdd} { clock scan {01 2} -format {%m %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.16 {parse mmdd} { clock scan {01 ii} -format {%m %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.17 {parse mmdd} { clock scan {i 02} -format {%Om %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.18 {parse mmdd} { clock scan {i ii} -format {%Om %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.19 {parse mmdd} { clock scan {i 2} -format {%Om %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.20 {parse mmdd} { clock scan {i ii} -format {%Om %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.21 {parse mmdd} { clock scan { 1 02} -format {%N %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.22 {parse mmdd} { clock scan { 1 ii} -format {%N %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.23 {parse mmdd} { clock scan { 1 2} -format {%N %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.24 {parse mmdd} { clock scan { 1 ii} -format {%N %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1009756800 test clock-19.25 {parse mmdd} { clock scan {Jan 31} -format {%b %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.26 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.27 {parse mmdd} { clock scan {Jan 31} -format {%b %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.28 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.29 {parse mmdd} { clock scan {January 31} -format {%B %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.30 {parse mmdd} { clock scan {January xxxi} -format {%B %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.31 {parse mmdd} { clock scan {January 31} -format {%B %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.32 {parse mmdd} { clock scan {January xxxi} -format {%B %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.33 {parse mmdd} { clock scan {Jan 31} -format {%h %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.34 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.35 {parse mmdd} { clock scan {Jan 31} -format {%h %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.36 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.37 {parse mmdd} { clock scan {01 31} -format {%m %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.38 {parse mmdd} { clock scan {01 xxxi} -format {%m %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.39 {parse mmdd} { clock scan {01 31} -format {%m %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.40 {parse mmdd} { clock scan {01 xxxi} -format {%m %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.41 {parse mmdd} { clock scan {i 31} -format {%Om %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.42 {parse mmdd} { clock scan {i xxxi} -format {%Om %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.43 {parse mmdd} { clock scan {i 31} -format {%Om %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.44 {parse mmdd} { clock scan {i xxxi} -format {%Om %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.45 {parse mmdd} { clock scan { 1 31} -format {%N %d} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.46 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.47 {parse mmdd} { clock scan { 1 31} -format {%N %e} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.48 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -1007251200 test clock-19.49 {parse mmdd} { clock scan {Dec 02} -format {%b %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.50 {parse mmdd} { clock scan {Dec ii} -format {%b %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.51 {parse mmdd} { clock scan {Dec 2} -format {%b %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.52 {parse mmdd} { clock scan {Dec ii} -format {%b %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.53 {parse mmdd} { clock scan {December 02} -format {%B %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.54 {parse mmdd} { clock scan {December ii} -format {%B %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.55 {parse mmdd} { clock scan {December 2} -format {%B %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.56 {parse mmdd} { clock scan {December ii} -format {%B %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.57 {parse mmdd} { clock scan {Dec 02} -format {%h %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.58 {parse mmdd} { clock scan {Dec ii} -format {%h %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.59 {parse mmdd} { clock scan {Dec 2} -format {%h %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.60 {parse mmdd} { clock scan {Dec ii} -format {%h %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.61 {parse mmdd} { clock scan {12 02} -format {%m %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.62 {parse mmdd} { clock scan {12 ii} -format {%m %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.63 {parse mmdd} { clock scan {12 2} -format {%m %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.64 {parse mmdd} { clock scan {12 ii} -format {%m %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.65 {parse mmdd} { clock scan {xii 02} -format {%Om %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.66 {parse mmdd} { clock scan {xii ii} -format {%Om %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.67 {parse mmdd} { clock scan {xii 2} -format {%Om %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.68 {parse mmdd} { clock scan {xii ii} -format {%Om %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.69 {parse mmdd} { clock scan {12 02} -format {%N %d} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.70 {parse mmdd} { clock scan {12 ii} -format {%N %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.71 {parse mmdd} { clock scan {12 2} -format {%N %e} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.72 {parse mmdd} { clock scan {12 ii} -format {%N %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -980899200 test clock-19.73 {parse mmdd} { clock scan {Dec 31} -format {%b %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.74 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.75 {parse mmdd} { clock scan {Dec 31} -format {%b %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.76 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.77 {parse mmdd} { clock scan {December 31} -format {%B %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.78 {parse mmdd} { clock scan {December xxxi} -format {%B %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.79 {parse mmdd} { clock scan {December 31} -format {%B %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.80 {parse mmdd} { clock scan {December xxxi} -format {%B %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.81 {parse mmdd} { clock scan {Dec 31} -format {%h %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.82 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.83 {parse mmdd} { clock scan {Dec 31} -format {%h %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.84 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.85 {parse mmdd} { clock scan {12 31} -format {%m %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.86 {parse mmdd} { clock scan {12 xxxi} -format {%m %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.87 {parse mmdd} { clock scan {12 31} -format {%m %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.88 {parse mmdd} { clock scan {12 xxxi} -format {%m %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.89 {parse mmdd} { clock scan {xii 31} -format {%Om %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.90 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.91 {parse mmdd} { clock scan {xii 31} -format {%Om %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.92 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.93 {parse mmdd} { clock scan {12 31} -format {%N %d} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.94 {parse mmdd} { clock scan {12 xxxi} -format {%N %Od} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.95 {parse mmdd} { clock scan {12 31} -format {%N %e} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.96 {parse mmdd} { clock scan {12 xxxi} -format {%N %Oe} -locale en_US_roman -base -1009843200 -gmt 1 } -978393600 test clock-19.97 {parse mmdd} { clock scan {Jan 02} -format {%b %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.98 {parse mmdd} { clock scan {Jan ii} -format {%b %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.99 {parse mmdd} { clock scan {Jan 2} -format {%b %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.100 {parse mmdd} { clock scan {Jan ii} -format {%b %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.101 {parse mmdd} { clock scan {January 02} -format {%B %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.102 {parse mmdd} { clock scan {January ii} -format {%B %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.103 {parse mmdd} { clock scan {January 2} -format {%B %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.104 {parse mmdd} { clock scan {January ii} -format {%B %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.105 {parse mmdd} { clock scan {Jan 02} -format {%h %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.106 {parse mmdd} { clock scan {Jan ii} -format {%h %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.107 {parse mmdd} { clock scan {Jan 2} -format {%h %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.108 {parse mmdd} { clock scan {Jan ii} -format {%h %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.109 {parse mmdd} { clock scan {01 02} -format {%m %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.110 {parse mmdd} { clock scan {01 ii} -format {%m %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.111 {parse mmdd} { clock scan {01 2} -format {%m %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.112 {parse mmdd} { clock scan {01 ii} -format {%m %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.113 {parse mmdd} { clock scan {i 02} -format {%Om %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.114 {parse mmdd} { clock scan {i ii} -format {%Om %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.115 {parse mmdd} { clock scan {i 2} -format {%Om %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.116 {parse mmdd} { clock scan {i ii} -format {%Om %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.117 {parse mmdd} { clock scan { 1 02} -format {%N %d} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.118 {parse mmdd} { clock scan { 1 ii} -format {%N %Od} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.119 {parse mmdd} { clock scan { 1 2} -format {%N %e} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.120 {parse mmdd} { clock scan { 1 ii} -format {%N %Oe} -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-19.121 {parse mmdd} { clock scan {Jan 31} -format {%b %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.122 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.123 {parse mmdd} { clock scan {Jan 31} -format {%b %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.124 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.125 {parse mmdd} { clock scan {January 31} -format {%B %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.126 {parse mmdd} { clock scan {January xxxi} -format {%B %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.127 {parse mmdd} { clock scan {January 31} -format {%B %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.128 {parse mmdd} { clock scan {January xxxi} -format {%B %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.129 {parse mmdd} { clock scan {Jan 31} -format {%h %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.130 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.131 {parse mmdd} { clock scan {Jan 31} -format {%h %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.132 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.133 {parse mmdd} { clock scan {01 31} -format {%m %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.134 {parse mmdd} { clock scan {01 xxxi} -format {%m %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.135 {parse mmdd} { clock scan {01 31} -format {%m %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.136 {parse mmdd} { clock scan {01 xxxi} -format {%m %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.137 {parse mmdd} { clock scan {i 31} -format {%Om %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.138 {parse mmdd} { clock scan {i xxxi} -format {%Om %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.139 {parse mmdd} { clock scan {i 31} -format {%Om %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.140 {parse mmdd} { clock scan {i xxxi} -format {%Om %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.141 {parse mmdd} { clock scan { 1 31} -format {%N %d} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.142 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Od} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.143 {parse mmdd} { clock scan { 1 31} -format {%N %e} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.144 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Oe} -locale en_US_roman -base 0 -gmt 1 } 2592000 test clock-19.145 {parse mmdd} { clock scan {Dec 02} -format {%b %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.146 {parse mmdd} { clock scan {Dec ii} -format {%b %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.147 {parse mmdd} { clock scan {Dec 2} -format {%b %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.148 {parse mmdd} { clock scan {Dec ii} -format {%b %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.149 {parse mmdd} { clock scan {December 02} -format {%B %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.150 {parse mmdd} { clock scan {December ii} -format {%B %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.151 {parse mmdd} { clock scan {December 2} -format {%B %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.152 {parse mmdd} { clock scan {December ii} -format {%B %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.153 {parse mmdd} { clock scan {Dec 02} -format {%h %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.154 {parse mmdd} { clock scan {Dec ii} -format {%h %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.155 {parse mmdd} { clock scan {Dec 2} -format {%h %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.156 {parse mmdd} { clock scan {Dec ii} -format {%h %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.157 {parse mmdd} { clock scan {12 02} -format {%m %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.158 {parse mmdd} { clock scan {12 ii} -format {%m %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.159 {parse mmdd} { clock scan {12 2} -format {%m %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.160 {parse mmdd} { clock scan {12 ii} -format {%m %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.161 {parse mmdd} { clock scan {xii 02} -format {%Om %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.162 {parse mmdd} { clock scan {xii ii} -format {%Om %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.163 {parse mmdd} { clock scan {xii 2} -format {%Om %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.164 {parse mmdd} { clock scan {xii ii} -format {%Om %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.165 {parse mmdd} { clock scan {12 02} -format {%N %d} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.166 {parse mmdd} { clock scan {12 ii} -format {%N %Od} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.167 {parse mmdd} { clock scan {12 2} -format {%N %e} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.168 {parse mmdd} { clock scan {12 ii} -format {%N %Oe} -locale en_US_roman -base 0 -gmt 1 } 28944000 test clock-19.169 {parse mmdd} { clock scan {Dec 31} -format {%b %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.170 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.171 {parse mmdd} { clock scan {Dec 31} -format {%b %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.172 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.173 {parse mmdd} { clock scan {December 31} -format {%B %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.174 {parse mmdd} { clock scan {December xxxi} -format {%B %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.175 {parse mmdd} { clock scan {December 31} -format {%B %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.176 {parse mmdd} { clock scan {December xxxi} -format {%B %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.177 {parse mmdd} { clock scan {Dec 31} -format {%h %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.178 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.179 {parse mmdd} { clock scan {Dec 31} -format {%h %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.180 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.181 {parse mmdd} { clock scan {12 31} -format {%m %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.182 {parse mmdd} { clock scan {12 xxxi} -format {%m %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.183 {parse mmdd} { clock scan {12 31} -format {%m %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.184 {parse mmdd} { clock scan {12 xxxi} -format {%m %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.185 {parse mmdd} { clock scan {xii 31} -format {%Om %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.186 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.187 {parse mmdd} { clock scan {xii 31} -format {%Om %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.188 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.189 {parse mmdd} { clock scan {12 31} -format {%N %d} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.190 {parse mmdd} { clock scan {12 xxxi} -format {%N %Od} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.191 {parse mmdd} { clock scan {12 31} -format {%N %e} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.192 {parse mmdd} { clock scan {12 xxxi} -format {%N %Oe} -locale en_US_roman -base 0 -gmt 1 } 31449600 test clock-19.193 {parse mmdd} { clock scan {Jan 02} -format {%b %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.194 {parse mmdd} { clock scan {Jan ii} -format {%b %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.195 {parse mmdd} { clock scan {Jan 2} -format {%b %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.196 {parse mmdd} { clock scan {Jan ii} -format {%b %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.197 {parse mmdd} { clock scan {January 02} -format {%B %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.198 {parse mmdd} { clock scan {January ii} -format {%B %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.199 {parse mmdd} { clock scan {January 2} -format {%B %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.200 {parse mmdd} { clock scan {January ii} -format {%B %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.201 {parse mmdd} { clock scan {Jan 02} -format {%h %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.202 {parse mmdd} { clock scan {Jan ii} -format {%h %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.203 {parse mmdd} { clock scan {Jan 2} -format {%h %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.204 {parse mmdd} { clock scan {Jan ii} -format {%h %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.205 {parse mmdd} { clock scan {01 02} -format {%m %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.206 {parse mmdd} { clock scan {01 ii} -format {%m %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.207 {parse mmdd} { clock scan {01 2} -format {%m %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.208 {parse mmdd} { clock scan {01 ii} -format {%m %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.209 {parse mmdd} { clock scan {i 02} -format {%Om %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.210 {parse mmdd} { clock scan {i ii} -format {%Om %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.211 {parse mmdd} { clock scan {i 2} -format {%Om %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.212 {parse mmdd} { clock scan {i ii} -format {%Om %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.213 {parse mmdd} { clock scan { 1 02} -format {%N %d} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.214 {parse mmdd} { clock scan { 1 ii} -format {%N %Od} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.215 {parse mmdd} { clock scan { 1 2} -format {%N %e} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.216 {parse mmdd} { clock scan { 1 ii} -format {%N %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-19.217 {parse mmdd} { clock scan {Jan 31} -format {%b %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.218 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.219 {parse mmdd} { clock scan {Jan 31} -format {%b %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.220 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.221 {parse mmdd} { clock scan {January 31} -format {%B %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.222 {parse mmdd} { clock scan {January xxxi} -format {%B %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.223 {parse mmdd} { clock scan {January 31} -format {%B %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.224 {parse mmdd} { clock scan {January xxxi} -format {%B %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.225 {parse mmdd} { clock scan {Jan 31} -format {%h %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.226 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.227 {parse mmdd} { clock scan {Jan 31} -format {%h %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.228 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.229 {parse mmdd} { clock scan {01 31} -format {%m %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.230 {parse mmdd} { clock scan {01 xxxi} -format {%m %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.231 {parse mmdd} { clock scan {01 31} -format {%m %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.232 {parse mmdd} { clock scan {01 xxxi} -format {%m %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.233 {parse mmdd} { clock scan {i 31} -format {%Om %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.234 {parse mmdd} { clock scan {i xxxi} -format {%Om %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.235 {parse mmdd} { clock scan {i 31} -format {%Om %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.236 {parse mmdd} { clock scan {i xxxi} -format {%Om %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.237 {parse mmdd} { clock scan { 1 31} -format {%N %d} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.238 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Od} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.239 {parse mmdd} { clock scan { 1 31} -format {%N %e} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.240 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 949276800 test clock-19.241 {parse mmdd} { clock scan {Dec 02} -format {%b %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.242 {parse mmdd} { clock scan {Dec ii} -format {%b %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.243 {parse mmdd} { clock scan {Dec 2} -format {%b %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.244 {parse mmdd} { clock scan {Dec ii} -format {%b %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.245 {parse mmdd} { clock scan {December 02} -format {%B %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.246 {parse mmdd} { clock scan {December ii} -format {%B %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.247 {parse mmdd} { clock scan {December 2} -format {%B %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.248 {parse mmdd} { clock scan {December ii} -format {%B %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.249 {parse mmdd} { clock scan {Dec 02} -format {%h %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.250 {parse mmdd} { clock scan {Dec ii} -format {%h %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.251 {parse mmdd} { clock scan {Dec 2} -format {%h %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.252 {parse mmdd} { clock scan {Dec ii} -format {%h %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.253 {parse mmdd} { clock scan {12 02} -format {%m %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.254 {parse mmdd} { clock scan {12 ii} -format {%m %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.255 {parse mmdd} { clock scan {12 2} -format {%m %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.256 {parse mmdd} { clock scan {12 ii} -format {%m %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.257 {parse mmdd} { clock scan {xii 02} -format {%Om %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.258 {parse mmdd} { clock scan {xii ii} -format {%Om %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.259 {parse mmdd} { clock scan {xii 2} -format {%Om %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.260 {parse mmdd} { clock scan {xii ii} -format {%Om %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.261 {parse mmdd} { clock scan {12 02} -format {%N %d} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.262 {parse mmdd} { clock scan {12 ii} -format {%N %Od} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.263 {parse mmdd} { clock scan {12 2} -format {%N %e} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.264 {parse mmdd} { clock scan {12 ii} -format {%N %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 975715200 test clock-19.265 {parse mmdd} { clock scan {Dec 31} -format {%b %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.266 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.267 {parse mmdd} { clock scan {Dec 31} -format {%b %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.268 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.269 {parse mmdd} { clock scan {December 31} -format {%B %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.270 {parse mmdd} { clock scan {December xxxi} -format {%B %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.271 {parse mmdd} { clock scan {December 31} -format {%B %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.272 {parse mmdd} { clock scan {December xxxi} -format {%B %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.273 {parse mmdd} { clock scan {Dec 31} -format {%h %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.274 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.275 {parse mmdd} { clock scan {Dec 31} -format {%h %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.276 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.277 {parse mmdd} { clock scan {12 31} -format {%m %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.278 {parse mmdd} { clock scan {12 xxxi} -format {%m %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.279 {parse mmdd} { clock scan {12 31} -format {%m %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.280 {parse mmdd} { clock scan {12 xxxi} -format {%m %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.281 {parse mmdd} { clock scan {xii 31} -format {%Om %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.282 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.283 {parse mmdd} { clock scan {xii 31} -format {%Om %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.284 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.285 {parse mmdd} { clock scan {12 31} -format {%N %d} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.286 {parse mmdd} { clock scan {12 xxxi} -format {%N %Od} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.287 {parse mmdd} { clock scan {12 31} -format {%N %e} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.288 {parse mmdd} { clock scan {12 xxxi} -format {%N %Oe} -locale en_US_roman -base 946684800 -gmt 1 } 978220800 test clock-19.289 {parse mmdd} { clock scan {Jan 02} -format {%b %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.290 {parse mmdd} { clock scan {Jan ii} -format {%b %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.291 {parse mmdd} { clock scan {Jan 2} -format {%b %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.292 {parse mmdd} { clock scan {Jan ii} -format {%b %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.293 {parse mmdd} { clock scan {January 02} -format {%B %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.294 {parse mmdd} { clock scan {January ii} -format {%B %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.295 {parse mmdd} { clock scan {January 2} -format {%B %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.296 {parse mmdd} { clock scan {January ii} -format {%B %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.297 {parse mmdd} { clock scan {Jan 02} -format {%h %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.298 {parse mmdd} { clock scan {Jan ii} -format {%h %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.299 {parse mmdd} { clock scan {Jan 2} -format {%h %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.300 {parse mmdd} { clock scan {Jan ii} -format {%h %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.301 {parse mmdd} { clock scan {01 02} -format {%m %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.302 {parse mmdd} { clock scan {01 ii} -format {%m %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.303 {parse mmdd} { clock scan {01 2} -format {%m %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.304 {parse mmdd} { clock scan {01 ii} -format {%m %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.305 {parse mmdd} { clock scan {i 02} -format {%Om %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.306 {parse mmdd} { clock scan {i ii} -format {%Om %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.307 {parse mmdd} { clock scan {i 2} -format {%Om %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.308 {parse mmdd} { clock scan {i ii} -format {%Om %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.309 {parse mmdd} { clock scan { 1 02} -format {%N %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.310 {parse mmdd} { clock scan { 1 ii} -format {%N %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.311 {parse mmdd} { clock scan { 1 2} -format {%N %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.312 {parse mmdd} { clock scan { 1 ii} -format {%N %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2114467200 test clock-19.313 {parse mmdd} { clock scan {Jan 31} -format {%b %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.314 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.315 {parse mmdd} { clock scan {Jan 31} -format {%b %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.316 {parse mmdd} { clock scan {Jan xxxi} -format {%b %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.317 {parse mmdd} { clock scan {January 31} -format {%B %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.318 {parse mmdd} { clock scan {January xxxi} -format {%B %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.319 {parse mmdd} { clock scan {January 31} -format {%B %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.320 {parse mmdd} { clock scan {January xxxi} -format {%B %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.321 {parse mmdd} { clock scan {Jan 31} -format {%h %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.322 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.323 {parse mmdd} { clock scan {Jan 31} -format {%h %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.324 {parse mmdd} { clock scan {Jan xxxi} -format {%h %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.325 {parse mmdd} { clock scan {01 31} -format {%m %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.326 {parse mmdd} { clock scan {01 xxxi} -format {%m %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.327 {parse mmdd} { clock scan {01 31} -format {%m %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.328 {parse mmdd} { clock scan {01 xxxi} -format {%m %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.329 {parse mmdd} { clock scan {i 31} -format {%Om %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.330 {parse mmdd} { clock scan {i xxxi} -format {%Om %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.331 {parse mmdd} { clock scan {i 31} -format {%Om %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.332 {parse mmdd} { clock scan {i xxxi} -format {%Om %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.333 {parse mmdd} { clock scan { 1 31} -format {%N %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.334 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.335 {parse mmdd} { clock scan { 1 31} -format {%N %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.336 {parse mmdd} { clock scan { 1 xxxi} -format {%N %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2116972800 test clock-19.337 {parse mmdd} { clock scan {Dec 02} -format {%b %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.338 {parse mmdd} { clock scan {Dec ii} -format {%b %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.339 {parse mmdd} { clock scan {Dec 2} -format {%b %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.340 {parse mmdd} { clock scan {Dec ii} -format {%b %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.341 {parse mmdd} { clock scan {December 02} -format {%B %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.342 {parse mmdd} { clock scan {December ii} -format {%B %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.343 {parse mmdd} { clock scan {December 2} -format {%B %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.344 {parse mmdd} { clock scan {December ii} -format {%B %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.345 {parse mmdd} { clock scan {Dec 02} -format {%h %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.346 {parse mmdd} { clock scan {Dec ii} -format {%h %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.347 {parse mmdd} { clock scan {Dec 2} -format {%h %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.348 {parse mmdd} { clock scan {Dec ii} -format {%h %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.349 {parse mmdd} { clock scan {12 02} -format {%m %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.350 {parse mmdd} { clock scan {12 ii} -format {%m %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.351 {parse mmdd} { clock scan {12 2} -format {%m %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.352 {parse mmdd} { clock scan {12 ii} -format {%m %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.353 {parse mmdd} { clock scan {xii 02} -format {%Om %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.354 {parse mmdd} { clock scan {xii ii} -format {%Om %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.355 {parse mmdd} { clock scan {xii 2} -format {%Om %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.356 {parse mmdd} { clock scan {xii ii} -format {%Om %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.357 {parse mmdd} { clock scan {12 02} -format {%N %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.358 {parse mmdd} { clock scan {12 ii} -format {%N %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.359 {parse mmdd} { clock scan {12 2} -format {%N %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.360 {parse mmdd} { clock scan {12 ii} -format {%N %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2143324800 test clock-19.361 {parse mmdd} { clock scan {Dec 31} -format {%b %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.362 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.363 {parse mmdd} { clock scan {Dec 31} -format {%b %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.364 {parse mmdd} { clock scan {Dec xxxi} -format {%b %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.365 {parse mmdd} { clock scan {December 31} -format {%B %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.366 {parse mmdd} { clock scan {December xxxi} -format {%B %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.367 {parse mmdd} { clock scan {December 31} -format {%B %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.368 {parse mmdd} { clock scan {December xxxi} -format {%B %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.369 {parse mmdd} { clock scan {Dec 31} -format {%h %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.370 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.371 {parse mmdd} { clock scan {Dec 31} -format {%h %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.372 {parse mmdd} { clock scan {Dec xxxi} -format {%h %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.373 {parse mmdd} { clock scan {12 31} -format {%m %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.374 {parse mmdd} { clock scan {12 xxxi} -format {%m %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.375 {parse mmdd} { clock scan {12 31} -format {%m %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.376 {parse mmdd} { clock scan {12 xxxi} -format {%m %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.377 {parse mmdd} { clock scan {xii 31} -format {%Om %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.378 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.379 {parse mmdd} { clock scan {xii 31} -format {%Om %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.380 {parse mmdd} { clock scan {xii xxxi} -format {%Om %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.381 {parse mmdd} { clock scan {12 31} -format {%N %d} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.382 {parse mmdd} { clock scan {12 xxxi} -format {%N %Od} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.383 {parse mmdd} { clock scan {12 31} -format {%N %e} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 test clock-19.384 {parse mmdd} { clock scan {12 xxxi} -format {%N %Oe} -locale en_US_roman -base 2114380800 -gmt 1 } 2145830400 # END testcases19 test clock-20.1 {seconds take precedence over mmdd} { list [clock scan {0 0201} -format {%s %m%d} -gmt true -base 0] \ [clock scan {0201 0} -format {%m%d %s} -gmt true -base 0] } {0 0} test clock-20.2 {julian day takes precedence over yyddd} { list [clock scan {2440588 0201} -format {%J %m%d} -gmt true -base 0] \ [clock scan {0201 2440588} -format {%m%d %J} -gmt true -base 0] } {0 0} test clock-20.3 {yyyyWwwd over mmdd} { list [clock scan {1970W014 0201} -format {%GW%V%u %m%d} -gmt true -base 0] \ [clock scan {0201 1970W014} -format {%m%d %GW%V%u} -gmt true -base 0] } {0 0} test clock-20.4 {yyWwwd over mmdd} { list [clock scan {70W014 0201} -format {%gW%V%u %m%d} -gmt true -base 0] \ [clock scan {0201 70W014} -format {%m%d %gW%V%u} -gmt true -base 0] } {0 0} # Test parsing of ddd test clock-21.1 {parse ddd} { clock scan {001} -format {%j} -locale en_US_roman -gmt 1 -base 0 } 0 test clock-21.2 {parse ddd} { clock scan {365} -format {%j} -locale en_US_roman -gmt 1 -base 0 } 31449600 test clock-21.3 {parse ddd} { clock scan {001} -format {%j} -locale en_US_roman -gmt 1 -base 31536000 } 31536000 test clock-21.4 {parse ddd} { clock scan {365} -format {%j} -locale en_US_roman -gmt 1 -base 31536000 } 62985600 test clock-21.5 {seconds take precedence over ddd} { list [clock scan {0 002} -format {%s %j} -gmt true -base 0] \ [clock scan {002 0} -format {%j %s} -gmt true -base 0] } {0 0} test clock-21.6 {julian day takes precedence over yyddd} { list [clock scan {2440588 002} -format {%J %j} -gmt true -base 0] \ [clock scan {002 2440588} -format {%j %J} -gmt true -base 0] } {0 0} test clock-21.7 {yyyyWwwd over ddd} { list [clock scan {1970W014 002} -format {%GW%V%u %j} -gmt true -base 0] \ [clock scan {002 1970W014} -format {%j %GW%V%u} -gmt true -base 0] } {0 0} test clock-21.8 {yyWwwd over ddd} { list [clock scan {70W014 002} -format {%gW%V%u %j} -gmt true -base 0] \ [clock scan {002 70W014} -format {%j %gW%V%u} -gmt true -base 0] } {0 0} # BEGIN testcases22 # Test parsing of Wwwd test clock-22.1 {parse Wwwd} { clock scan {W09 Sun} -format {W%V %a} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.2 {parse Wwwd} { clock scan {W09 Sunday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.3 {parse Wwwd} { clock scan {W09 7} -format {W%V %u} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.4 {parse Wwwd} { clock scan {W09 0} -format {W%V %w} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.5 {parse Wwwd} { clock scan {W09 vii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.6 {parse Wwwd} { clock scan {W09 ?} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 259200 } 5097600 test clock-22.7 {parse Wwwd} { clock scan {W14 Tue} -format {W%V %a} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.8 {parse Wwwd} { clock scan {W14 Tuesday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.9 {parse Wwwd} { clock scan {W14 2} -format {W%V %u} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.10 {parse Wwwd} { clock scan {W14 2} -format {W%V %w} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.11 {parse Wwwd} { clock scan {W14 ii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.12 {parse Wwwd} { clock scan {W14 ii} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 259200 } 7689600 test clock-22.13 {parse Wwwd} { clock scan {W40 Thu} -format {W%V %a} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.14 {parse Wwwd} { clock scan {W40 Thursday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.15 {parse Wwwd} { clock scan {W40 4} -format {W%V %u} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.16 {parse Wwwd} { clock scan {W40 4} -format {W%V %w} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.17 {parse Wwwd} { clock scan {W40 iv} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.18 {parse Wwwd} { clock scan {W40 iv} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 259200 } 23587200 test clock-22.19 {parse Wwwd} { clock scan {W44 Sat} -format {W%V %a} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.20 {parse Wwwd} { clock scan {W44 Saturday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.21 {parse Wwwd} { clock scan {W44 6} -format {W%V %u} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.22 {parse Wwwd} { clock scan {W44 6} -format {W%V %w} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.23 {parse Wwwd} { clock scan {W44 vi} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.24 {parse Wwwd} { clock scan {W44 vi} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 259200 } 26179200 test clock-22.25 {parse Wwwd} { clock scan {W09 Mon} -format {W%V %a} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.26 {parse Wwwd} { clock scan {W09 Monday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.27 {parse Wwwd} { clock scan {W09 1} -format {W%V %u} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.28 {parse Wwwd} { clock scan {W09 1} -format {W%V %w} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.29 {parse Wwwd} { clock scan {W09 i} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.30 {parse Wwwd} { clock scan {W09 i} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 31795200 } 36633600 test clock-22.31 {parse Wwwd} { clock scan {W13 Wed} -format {W%V %a} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.32 {parse Wwwd} { clock scan {W13 Wednesday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.33 {parse Wwwd} { clock scan {W13 3} -format {W%V %u} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.34 {parse Wwwd} { clock scan {W13 3} -format {W%V %w} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.35 {parse Wwwd} { clock scan {W13 iii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.36 {parse Wwwd} { clock scan {W13 iii} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 31795200 } 39225600 test clock-22.37 {parse Wwwd} { clock scan {W39 Fri} -format {W%V %a} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.38 {parse Wwwd} { clock scan {W39 Friday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.39 {parse Wwwd} { clock scan {W39 5} -format {W%V %u} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.40 {parse Wwwd} { clock scan {W39 5} -format {W%V %w} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.41 {parse Wwwd} { clock scan {W39 v} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.42 {parse Wwwd} { clock scan {W39 v} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 31795200 } 55123200 test clock-22.43 {parse Wwwd} { clock scan {W43 Sun} -format {W%V %a} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.44 {parse Wwwd} { clock scan {W43 Sunday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.45 {parse Wwwd} { clock scan {W43 7} -format {W%V %u} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.46 {parse Wwwd} { clock scan {W43 0} -format {W%V %w} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.47 {parse Wwwd} { clock scan {W43 vii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.48 {parse Wwwd} { clock scan {W43 ?} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 31795200 } 57715200 test clock-22.49 {parse Wwwd} { clock scan {W09 Wed} -format {W%V %a} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.50 {parse Wwwd} { clock scan {W09 Wednesday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.51 {parse Wwwd} { clock scan {W09 3} -format {W%V %u} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.52 {parse Wwwd} { clock scan {W09 3} -format {W%V %w} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.53 {parse Wwwd} { clock scan {W09 iii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.54 {parse Wwwd} { clock scan {W09 iii} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 946944000 } 951868800 test clock-22.55 {parse Wwwd} { clock scan {W13 Fri} -format {W%V %a} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.56 {parse Wwwd} { clock scan {W13 Friday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.57 {parse Wwwd} { clock scan {W13 5} -format {W%V %u} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.58 {parse Wwwd} { clock scan {W13 5} -format {W%V %w} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.59 {parse Wwwd} { clock scan {W13 v} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.60 {parse Wwwd} { clock scan {W13 v} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 946944000 } 954460800 test clock-22.61 {parse Wwwd} { clock scan {W39 Sun} -format {W%V %a} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.62 {parse Wwwd} { clock scan {W39 Sunday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.63 {parse Wwwd} { clock scan {W39 7} -format {W%V %u} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.64 {parse Wwwd} { clock scan {W39 0} -format {W%V %w} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.65 {parse Wwwd} { clock scan {W39 vii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.66 {parse Wwwd} { clock scan {W39 ?} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 946944000 } 970358400 test clock-22.67 {parse Wwwd} { clock scan {W44 Tue} -format {W%V %a} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.68 {parse Wwwd} { clock scan {W44 Tuesday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.69 {parse Wwwd} { clock scan {W44 2} -format {W%V %u} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.70 {parse Wwwd} { clock scan {W44 2} -format {W%V %w} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.71 {parse Wwwd} { clock scan {W44 ii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.72 {parse Wwwd} { clock scan {W44 ii} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 946944000 } 972950400 test clock-22.73 {parse Wwwd} { clock scan {W09 Thu} -format {W%V %a} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.74 {parse Wwwd} { clock scan {W09 Thursday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.75 {parse Wwwd} { clock scan {W09 4} -format {W%V %u} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.76 {parse Wwwd} { clock scan {W09 4} -format {W%V %w} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.77 {parse Wwwd} { clock scan {W09 iv} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.78 {parse Wwwd} { clock scan {W09 iv} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 978566400 } 983404800 test clock-22.79 {parse Wwwd} { clock scan {W13 Sat} -format {W%V %a} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.80 {parse Wwwd} { clock scan {W13 Saturday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.81 {parse Wwwd} { clock scan {W13 6} -format {W%V %u} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.82 {parse Wwwd} { clock scan {W13 6} -format {W%V %w} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.83 {parse Wwwd} { clock scan {W13 vi} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.84 {parse Wwwd} { clock scan {W13 vi} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 978566400 } 985996800 test clock-22.85 {parse Wwwd} { clock scan {W40 Mon} -format {W%V %a} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.86 {parse Wwwd} { clock scan {W40 Monday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.87 {parse Wwwd} { clock scan {W40 1} -format {W%V %u} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.88 {parse Wwwd} { clock scan {W40 1} -format {W%V %w} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.89 {parse Wwwd} { clock scan {W40 i} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.90 {parse Wwwd} { clock scan {W40 i} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 978566400 } 1001894400 test clock-22.91 {parse Wwwd} { clock scan {W44 Wed} -format {W%V %a} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 test clock-22.92 {parse Wwwd} { clock scan {W44 Wednesday} -format {W%V %A} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 test clock-22.93 {parse Wwwd} { clock scan {W44 3} -format {W%V %u} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 test clock-22.94 {parse Wwwd} { clock scan {W44 3} -format {W%V %w} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 test clock-22.95 {parse Wwwd} { clock scan {W44 iii} -format {W%V %Ou} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 test clock-22.96 {parse Wwwd} { clock scan {W44 iii} -format {W%V %Ow} -locale en_US_roman -gmt 1 -base 978566400 } 1004486400 # END testcases22 # Test precedence of Wwwd test clock-23.1 {seconds take precedence over Wwwd} { list [clock scan {0 W024} -format {%s W%V%u} -gmt true -base 0] \ [clock scan {W024 0} -format {W%V%u %s} -gmt true -base 0] } {0 0} test clock-23.2 {julian day takes precedence over Wwwd} { list [clock scan {2440588 W024} -format {%J W%V%u} -gmt true -base 0] \ [clock scan {W024 2440588} -format {W%V%u %J} -gmt true -base 0] } {0 0} test clock-23.3 {Wwwd precedence below yyyymmdd} { list [clock scan {19700101 W014} -format {%Y%m%d W%V%u} -gmt true -base 0] \ [clock scan {W014 19700101} -format {W%V%u %Y%m%d} -gmt true -base 0] } {0 0} test clock-23.4 {Wwwd precedence below yyyyddd} { list [clock scan {1970001 W014} -format {%Y%j W%V%u} -gmt true -base 0] \ [clock scan {W014 1970001} -format {W%V%u %Y%j} -gmt true -base 0] } {0 0} test clock-23.5 {Wwwd precedence below yymmdd} { list [clock scan {700101 W014} -format {%y%m%d W%V%u} -gmt true -base 0] \ [clock scan {W014 700101} -format {W%V%u %y%m%d} -gmt true -base 0] } {0 0} test clock-23.6 {Wwwd precedence below yyddd} { list [clock scan {70001 W014} -format {%y%j W%V%u} -gmt true -base 0] \ [clock scan {W014 70001} -format {W%V%u %y%j} -gmt true -base 0] } {0 0} # BEGIN testcases24 # Test parsing of naked day-of-month test clock-24.1 {parse naked day of month} { clock scan 02 -format %d -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-24.2 {parse naked day of month} { clock scan ii -format %Od -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-24.3 {parse naked day of month} { clock scan { 2} -format %e -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-24.4 {parse naked day of month} { clock scan ii -format %Oe -locale en_US_roman -base 0 -gmt 1 } 86400 test clock-24.5 {parse naked day of month} { clock scan 28 -format %d -locale en_US_roman -base 0 -gmt 1 } 2332800 test clock-24.6 {parse naked day of month} { clock scan xxviii -format %Od -locale en_US_roman -base 0 -gmt 1 } 2332800 test clock-24.7 {parse naked day of month} { clock scan 28 -format %e -locale en_US_roman -base 0 -gmt 1 } 2332800 test clock-24.8 {parse naked day of month} { clock scan xxviii -format %Oe -locale en_US_roman -base 0 -gmt 1 } 2332800 test clock-24.9 {parse naked day of month} { clock scan 02 -format %d -locale en_US_roman -base 28857600 -gmt 1 } 28944000 test clock-24.10 {parse naked day of month} { clock scan ii -format %Od -locale en_US_roman -base 28857600 -gmt 1 } 28944000 test clock-24.11 {parse naked day of month} { clock scan { 2} -format %e -locale en_US_roman -base 28857600 -gmt 1 } 28944000 test clock-24.12 {parse naked day of month} { clock scan ii -format %Oe -locale en_US_roman -base 28857600 -gmt 1 } 28944000 test clock-24.13 {parse naked day of month} { clock scan 28 -format %d -locale en_US_roman -base 28857600 -gmt 1 } 31190400 test clock-24.14 {parse naked day of month} { clock scan xxviii -format %Od -locale en_US_roman -base 28857600 -gmt 1 } 31190400 test clock-24.15 {parse naked day of month} { clock scan 28 -format %e -locale en_US_roman -base 28857600 -gmt 1 } 31190400 test clock-24.16 {parse naked day of month} { clock scan xxviii -format %Oe -locale en_US_roman -base 28857600 -gmt 1 } 31190400 test clock-24.17 {parse naked day of month} { clock scan 02 -format %d -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-24.18 {parse naked day of month} { clock scan ii -format %Od -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-24.19 {parse naked day of month} { clock scan { 2} -format %e -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-24.20 {parse naked day of month} { clock scan ii -format %Oe -locale en_US_roman -base 946684800 -gmt 1 } 946771200 test clock-24.21 {parse naked day of month} { clock scan 28 -format %d -locale en_US_roman -base 946684800 -gmt 1 } 949017600 test clock-24.22 {parse naked day of month} { clock scan xxviii -format %Od -locale en_US_roman -base 946684800 -gmt 1 } 949017600 test clock-24.23 {parse naked day of month} { clock scan 28 -format %e -locale en_US_roman -base 946684800 -gmt 1 } 949017600 test clock-24.24 {parse naked day of month} { clock scan xxviii -format %Oe -locale en_US_roman -base 946684800 -gmt 1 } 949017600 test clock-24.25 {parse naked day of month} { clock scan 02 -format %d -locale en_US_roman -base 975628800 -gmt 1 } 975715200 test clock-24.26 {parse naked day of month} { clock scan ii -format %Od -locale en_US_roman -base 975628800 -gmt 1 } 975715200 test clock-24.27 {parse naked day of month} { clock scan { 2} -format %e -locale en_US_roman -base 975628800 -gmt 1 } 975715200 test clock-24.28 {parse naked day of month} { clock scan ii -format %Oe -locale en_US_roman -base 975628800 -gmt 1 } 975715200 test clock-24.29 {parse naked day of month} { clock scan 28 -format %d -locale en_US_roman -base 975628800 -gmt 1 } 977961600 test clock-24.30 {parse naked day of month} { clock scan xxviii -format %Od -locale en_US_roman -base 975628800 -gmt 1 } 977961600 test clock-24.31 {parse naked day of month} { clock scan 28 -format %e -locale en_US_roman -base 975628800 -gmt 1 } 977961600 test clock-24.32 {parse naked day of month} { clock scan xxviii -format %Oe -locale en_US_roman -base 975628800 -gmt 1 } 977961600 # END testcases24 test clock-25.1 {seconds take precedence over dd} { list [clock scan {0 02} -format {%s %d} -gmt true -base 0] \ [clock scan {02 0} -format {%d %s} -gmt true -base 0] } {0 0} test clock-25.2 {julian day takes precedence over dd} { list [clock scan {2440588 02} -format {%J %d} -gmt true -base 0] \ [clock scan {02 2440588} -format {%d %J} -gmt true -base 0] } {0 0} test clock-25.3 {yyyyddd over dd} { list [clock scan {1970001 02} -format {%Y%j %d} -gmt true -base 0] \ [clock scan {02 1970001} -format {%d %Y%j} -gmt true -base 0] } {0 0} test clock-25.4 {yyyyWwwd over dd} { list [clock scan {1970W014 02} -format {%GW%V%u %d} -gmt true -base 0] \ [clock scan {02 1970W014} -format {%d %GW%V%u} -gmt true -base 0] } {0 0} test clock-25.5 {yyWwwd over dd} { list [clock scan {70W014 02} -format {%gW%V%u %d} -gmt true -base 0] \ [clock scan {02 70W014} -format {%d %gW%V%u} -gmt true -base 0] } {0 0} test clock-25.6 {yyddd over dd} { list [clock scan {70001 02} -format {%y%j %d} -gmt true -base 0] \ [clock scan {02 70001} -format {%d %y%j} -gmt true -base 0] } {0 0} test clock-25.7 {ddd over dd} { list [clock scan {001 02} -format {%j %d} -gmt true -base 0] \ [clock scan {02 001} -format {%d %j} -gmt true -base 0] } {0 0} # BEGIN testcases26 # Test parsing of naked day of week test clock-26.1 {parse naked day of week} { clock scan Mon -format %a -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.2 {parse naked day of week} { clock scan Monday -format %A -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.3 {parse naked day of week} { clock scan 1 -format %u -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.4 {parse naked day of week} { clock scan 1 -format %w -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.5 {parse naked day of week} { clock scan i -format %Ou -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.6 {parse naked day of week} { clock scan i -format %Ow -locale en_US_roman -gmt 1 -base 0 } -259200 test clock-26.7 {parse naked day of week} { clock scan Sun -format %a -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.8 {parse naked day of week} { clock scan Sunday -format %A -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.9 {parse naked day of week} { clock scan 7 -format %u -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.10 {parse naked day of week} { clock scan 0 -format %w -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.11 {parse naked day of week} { clock scan vii -format %Ou -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.12 {parse naked day of week} { clock scan ? -format %Ow -locale en_US_roman -gmt 1 -base 0 } 259200 test clock-26.13 {parse naked day of week} { clock scan Mon -format %a -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.14 {parse naked day of week} { clock scan Monday -format %A -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.15 {parse naked day of week} { clock scan 1 -format %u -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.16 {parse naked day of week} { clock scan 1 -format %w -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.17 {parse naked day of week} { clock scan i -format %Ou -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.18 {parse naked day of week} { clock scan i -format %Ow -locale en_US_roman -gmt 1 -base 30844800 } 30585600 test clock-26.19 {parse naked day of week} { clock scan Sun -format %a -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.20 {parse naked day of week} { clock scan Sunday -format %A -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.21 {parse naked day of week} { clock scan 7 -format %u -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.22 {parse naked day of week} { clock scan 0 -format %w -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.23 {parse naked day of week} { clock scan vii -format %Ou -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.24 {parse naked day of week} { clock scan ? -format %Ow -locale en_US_roman -gmt 1 -base 30844800 } 31104000 test clock-26.25 {parse naked day of week} { clock scan Mon -format %a -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.26 {parse naked day of week} { clock scan Monday -format %A -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.27 {parse naked day of week} { clock scan 1 -format %u -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.28 {parse naked day of week} { clock scan 1 -format %w -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.29 {parse naked day of week} { clock scan i -format %Ou -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.30 {parse naked day of week} { clock scan i -format %Ow -locale en_US_roman -gmt 1 -base 978566400 } 978307200 test clock-26.31 {parse naked day of week} { clock scan Sun -format %a -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.32 {parse naked day of week} { clock scan Sunday -format %A -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.33 {parse naked day of week} { clock scan 7 -format %u -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.34 {parse naked day of week} { clock scan 0 -format %w -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.35 {parse naked day of week} { clock scan vii -format %Ou -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.36 {parse naked day of week} { clock scan ? -format %Ow -locale en_US_roman -gmt 1 -base 978566400 } 978825600 test clock-26.37 {parse naked day of week} { clock scan Mon -format %a -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.38 {parse naked day of week} { clock scan Monday -format %A -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.39 {parse naked day of week} { clock scan 1 -format %u -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.40 {parse naked day of week} { clock scan 1 -format %w -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.41 {parse naked day of week} { clock scan i -format %Ou -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.42 {parse naked day of week} { clock scan i -format %Ow -locale en_US_roman -gmt 1 -base 1009411200 } 1009152000 test clock-26.43 {parse naked day of week} { clock scan Sun -format %a -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 test clock-26.44 {parse naked day of week} { clock scan Sunday -format %A -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 test clock-26.45 {parse naked day of week} { clock scan 7 -format %u -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 test clock-26.46 {parse naked day of week} { clock scan 0 -format %w -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 test clock-26.47 {parse naked day of week} { clock scan vii -format %Ou -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 test clock-26.48 {parse naked day of week} { clock scan ? -format %Ow -locale en_US_roman -gmt 1 -base 1009411200 } 1009670400 # END testcases26 if {!$valid_mode} { set res {-result {0 0}} } else { set res {-returnCodes error -result "unable to convert input string: invalid day of week"} } test clock-27.1 {seconds take precedence over naked weekday} -body { list [clock scan {0 1} -format {%s %u} -gmt true -base 0] \ [clock scan {1 0} -format {%u %s} -gmt true -base 0] } {*}$res test clock-27.2 {julian day takes precedence over naked weekday} -body { list [clock scan {2440588 1} -format {%J %u} -gmt true -base 0] \ [clock scan {1 2440588} -format {%u %J} -gmt true -base 0] } {*}$res test clock-27.3 {yyyymmdd over naked weekday} -body { list [clock scan {19700101 1} -format {%Y%m%d %u} -gmt true -base 0] \ [clock scan {1 19700101} -format {%u %Y%m%d} -gmt true -base 0] } {*}$res test clock-27.4 {yyyyddd over naked weekday} -body { list [clock scan {1970001 1} -format {%Y%j %u} -gmt true -base 0] \ [clock scan {1 1970001} -format {%u %Y%j} -gmt true -base 0] } {*}$res test clock-27.5 {yymmdd over naked weekday} -body { list [clock scan {700101 1} -format {%y%m%d %u} -gmt true -base 0] \ [clock scan {1 700101} -format {%u %y%m%d} -gmt true -base 0] } {*}$res test clock-27.6 {yyddd over naked weekday} -body { list [clock scan {70001 1} -format {%y%j %u} -gmt true -base 0] \ [clock scan {1 70001} -format {%u %y%j} -gmt true -base 0] } {*}$res test clock-27.7 {mmdd over naked weekday} -body { list [clock scan {0101 1} -format {%m%d %u} -gmt true -base 0] \ [clock scan {1 0101} -format {%u %m%d} -gmt true -base 0] } {*}$res test clock-27.8 {ddd over naked weekday} -body { list [clock scan {001 1} -format {%j %u} -gmt true -base 0] \ [clock scan {1 001} -format {%u %j} -gmt true -base 0] } {*}$res test clock-27.9 {naked day of month over naked weekday} -body { list [clock scan {01 1} -format {%d %u} -gmt true -base 0] \ [clock scan {1 01} -format {%u %d} -gmt true -base 0] } {*}$res unset -nocomplain res test clock-28.1 {base date} { clock scan {} -format {} -gmt true -base 1234567890 } 1234483200 # BEGIN testcases29 # Test parsing of time of day test clock-29.1 {time parsing} { clock scan {2440588 00 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 0 test clock-29.2 {time parsing} { clock scan {2440588 00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 0 test clock-29.3 {time parsing} { clock scan {2440588 00:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 0 test clock-29.4 {time parsing} { clock scan {2440588 00:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 0 test clock-29.5 {time parsing} { clock scan {2440588 00:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 0 test clock-29.6 {time parsing} { clock scan {2440588 0 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 0 test clock-29.7 {time parsing} { clock scan {2440588 0:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 0 test clock-29.8 {time parsing} { clock scan {2440588 0:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 0 test clock-29.9 {time parsing} { clock scan {2440588 0:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 0 test clock-29.10 {time parsing} { clock scan {2440588 0:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 0 test clock-29.11 {time parsing} { clock scan {2440588 ? } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 0 test clock-29.12 {time parsing} { clock scan {2440588 ?:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 0 test clock-29.13 {time parsing} { clock scan {2440588 ?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 0 test clock-29.14 {time parsing} { clock scan {2440588 ?:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 0 test clock-29.15 {time parsing} { clock scan {2440588 ?:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 0 test clock-29.16 {time parsing} { clock scan {2440588 ? } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 0 test clock-29.17 {time parsing} { clock scan {2440588 ?:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 0 test clock-29.18 {time parsing} { clock scan {2440588 ?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 0 test clock-29.19 {time parsing} { clock scan {2440588 ?:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 0 test clock-29.20 {time parsing} { clock scan {2440588 ?:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 0 test clock-29.21 {time parsing} { clock scan {2440588 12 AM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 0 test clock-29.22 {time parsing} { clock scan {2440588 12:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 0 test clock-29.23 {time parsing} { clock scan {2440588 12:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 0 test clock-29.24 {time parsing} { clock scan {2440588 12:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 0 test clock-29.25 {time parsing} { clock scan {2440588 12:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 0 test clock-29.26 {time parsing} { clock scan {2440588 12 AM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 0 test clock-29.27 {time parsing} { clock scan {2440588 12:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 0 test clock-29.28 {time parsing} { clock scan {2440588 12:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 0 test clock-29.29 {time parsing} { clock scan {2440588 12:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 0 test clock-29.30 {time parsing} { clock scan {2440588 12:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 0 test clock-29.31 {time parsing} { clock scan {2440588 xii AM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 0 test clock-29.32 {time parsing} { clock scan {2440588 xii:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 0 test clock-29.33 {time parsing} { clock scan {2440588 xii:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 0 test clock-29.34 {time parsing} { clock scan {2440588 xii:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 0 test clock-29.35 {time parsing} { clock scan {2440588 xii:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 0 test clock-29.36 {time parsing} { clock scan {2440588 xii AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 0 test clock-29.37 {time parsing} { clock scan {2440588 xii:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 0 test clock-29.38 {time parsing} { clock scan {2440588 xii:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 0 test clock-29.39 {time parsing} { clock scan {2440588 xii:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 0 test clock-29.40 {time parsing} { clock scan {2440588 xii:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 0 test clock-29.41 {time parsing} { clock scan {2440588 12 am} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 0 test clock-29.42 {time parsing} { clock scan {2440588 12:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 0 test clock-29.43 {time parsing} { clock scan {2440588 12:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 0 test clock-29.44 {time parsing} { clock scan {2440588 12:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 0 test clock-29.45 {time parsing} { clock scan {2440588 12:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 0 test clock-29.46 {time parsing} { clock scan {2440588 12 am} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 0 test clock-29.47 {time parsing} { clock scan {2440588 12:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 0 test clock-29.48 {time parsing} { clock scan {2440588 12:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 0 test clock-29.49 {time parsing} { clock scan {2440588 12:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 0 test clock-29.50 {time parsing} { clock scan {2440588 12:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 0 test clock-29.51 {time parsing} { clock scan {2440588 xii am} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 0 test clock-29.52 {time parsing} { clock scan {2440588 xii:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 0 test clock-29.53 {time parsing} { clock scan {2440588 xii:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 0 test clock-29.54 {time parsing} { clock scan {2440588 xii:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 0 test clock-29.55 {time parsing} { clock scan {2440588 xii:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 0 test clock-29.56 {time parsing} { clock scan {2440588 xii am} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 0 test clock-29.57 {time parsing} { clock scan {2440588 xii:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 0 test clock-29.58 {time parsing} { clock scan {2440588 xii:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 0 test clock-29.59 {time parsing} { clock scan {2440588 xii:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 0 test clock-29.60 {time parsing} { clock scan {2440588 xii:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 0 test clock-29.61 {time parsing} { clock scan {2440588 00:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 1 test clock-29.62 {time parsing} { clock scan {2440588 00:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 1 test clock-29.63 {time parsing} { clock scan {2440588 0:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 1 test clock-29.64 {time parsing} { clock scan {2440588 0:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 1 test clock-29.65 {time parsing} { clock scan {2440588 ?:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 1 test clock-29.66 {time parsing} { clock scan {2440588 ?:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 1 test clock-29.67 {time parsing} { clock scan {2440588 ?:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 1 test clock-29.68 {time parsing} { clock scan {2440588 ?:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 1 test clock-29.69 {time parsing} { clock scan {2440588 12:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 1 test clock-29.70 {time parsing} { clock scan {2440588 12:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 1 test clock-29.71 {time parsing} { clock scan {2440588 12:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 1 test clock-29.72 {time parsing} { clock scan {2440588 12:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 1 test clock-29.73 {time parsing} { clock scan {2440588 xii:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 1 test clock-29.74 {time parsing} { clock scan {2440588 xii:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 1 test clock-29.75 {time parsing} { clock scan {2440588 xii:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 1 test clock-29.76 {time parsing} { clock scan {2440588 xii:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 1 test clock-29.77 {time parsing} { clock scan {2440588 12:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 1 test clock-29.78 {time parsing} { clock scan {2440588 12:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 1 test clock-29.79 {time parsing} { clock scan {2440588 12:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 1 test clock-29.80 {time parsing} { clock scan {2440588 12:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 1 test clock-29.81 {time parsing} { clock scan {2440588 xii:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 1 test clock-29.82 {time parsing} { clock scan {2440588 xii:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 1 test clock-29.83 {time parsing} { clock scan {2440588 xii:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 1 test clock-29.84 {time parsing} { clock scan {2440588 xii:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 1 test clock-29.85 {time parsing} { clock scan {2440588 00:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 59 test clock-29.86 {time parsing} { clock scan {2440588 00:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 59 test clock-29.87 {time parsing} { clock scan {2440588 0:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 59 test clock-29.88 {time parsing} { clock scan {2440588 0:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 59 test clock-29.89 {time parsing} { clock scan {2440588 ?:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 59 test clock-29.90 {time parsing} { clock scan {2440588 ?:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 59 test clock-29.91 {time parsing} { clock scan {2440588 ?:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 59 test clock-29.92 {time parsing} { clock scan {2440588 ?:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 59 test clock-29.93 {time parsing} { clock scan {2440588 12:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 59 test clock-29.94 {time parsing} { clock scan {2440588 12:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 59 test clock-29.95 {time parsing} { clock scan {2440588 12:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 59 test clock-29.96 {time parsing} { clock scan {2440588 12:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 59 test clock-29.97 {time parsing} { clock scan {2440588 xii:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 59 test clock-29.98 {time parsing} { clock scan {2440588 xii:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 59 test clock-29.99 {time parsing} { clock scan {2440588 xii:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 59 test clock-29.100 {time parsing} { clock scan {2440588 xii:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 59 test clock-29.101 {time parsing} { clock scan {2440588 12:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 59 test clock-29.102 {time parsing} { clock scan {2440588 12:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 59 test clock-29.103 {time parsing} { clock scan {2440588 12:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 59 test clock-29.104 {time parsing} { clock scan {2440588 12:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 59 test clock-29.105 {time parsing} { clock scan {2440588 xii:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 59 test clock-29.106 {time parsing} { clock scan {2440588 xii:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 59 test clock-29.107 {time parsing} { clock scan {2440588 xii:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 59 test clock-29.108 {time parsing} { clock scan {2440588 xii:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 59 test clock-29.109 {time parsing} { clock scan {2440588 00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 60 test clock-29.110 {time parsing} { clock scan {2440588 00:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 60 test clock-29.111 {time parsing} { clock scan {2440588 00:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 60 test clock-29.112 {time parsing} { clock scan {2440588 00:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 60 test clock-29.113 {time parsing} { clock scan {2440588 0:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 60 test clock-29.114 {time parsing} { clock scan {2440588 0:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 60 test clock-29.115 {time parsing} { clock scan {2440588 0:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 60 test clock-29.116 {time parsing} { clock scan {2440588 0:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 60 test clock-29.117 {time parsing} { clock scan {2440588 ?:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 60 test clock-29.118 {time parsing} { clock scan {2440588 ?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 60 test clock-29.119 {time parsing} { clock scan {2440588 ?:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 60 test clock-29.120 {time parsing} { clock scan {2440588 ?:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 60 test clock-29.121 {time parsing} { clock scan {2440588 ?:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 60 test clock-29.122 {time parsing} { clock scan {2440588 ?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 60 test clock-29.123 {time parsing} { clock scan {2440588 ?:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 60 test clock-29.124 {time parsing} { clock scan {2440588 ?:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 60 test clock-29.125 {time parsing} { clock scan {2440588 12:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 60 test clock-29.126 {time parsing} { clock scan {2440588 12:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 60 test clock-29.127 {time parsing} { clock scan {2440588 12:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 60 test clock-29.128 {time parsing} { clock scan {2440588 12:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 60 test clock-29.129 {time parsing} { clock scan {2440588 12:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 60 test clock-29.130 {time parsing} { clock scan {2440588 12:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 60 test clock-29.131 {time parsing} { clock scan {2440588 12:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 60 test clock-29.132 {time parsing} { clock scan {2440588 12:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 60 test clock-29.133 {time parsing} { clock scan {2440588 xii:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 60 test clock-29.134 {time parsing} { clock scan {2440588 xii:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 60 test clock-29.135 {time parsing} { clock scan {2440588 xii:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 60 test clock-29.136 {time parsing} { clock scan {2440588 xii:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 60 test clock-29.137 {time parsing} { clock scan {2440588 xii:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 60 test clock-29.138 {time parsing} { clock scan {2440588 xii:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 60 test clock-29.139 {time parsing} { clock scan {2440588 xii:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 60 test clock-29.140 {time parsing} { clock scan {2440588 xii:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 60 test clock-29.141 {time parsing} { clock scan {2440588 12:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 60 test clock-29.142 {time parsing} { clock scan {2440588 12:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 60 test clock-29.143 {time parsing} { clock scan {2440588 12:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 60 test clock-29.144 {time parsing} { clock scan {2440588 12:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 60 test clock-29.145 {time parsing} { clock scan {2440588 12:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 60 test clock-29.146 {time parsing} { clock scan {2440588 12:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 60 test clock-29.147 {time parsing} { clock scan {2440588 12:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 60 test clock-29.148 {time parsing} { clock scan {2440588 12:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 60 test clock-29.149 {time parsing} { clock scan {2440588 xii:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 60 test clock-29.150 {time parsing} { clock scan {2440588 xii:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 60 test clock-29.151 {time parsing} { clock scan {2440588 xii:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 60 test clock-29.152 {time parsing} { clock scan {2440588 xii:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 60 test clock-29.153 {time parsing} { clock scan {2440588 xii:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 60 test clock-29.154 {time parsing} { clock scan {2440588 xii:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 60 test clock-29.155 {time parsing} { clock scan {2440588 xii:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 60 test clock-29.156 {time parsing} { clock scan {2440588 xii:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 60 test clock-29.157 {time parsing} { clock scan {2440588 00:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 61 test clock-29.158 {time parsing} { clock scan {2440588 00:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 61 test clock-29.159 {time parsing} { clock scan {2440588 0:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 61 test clock-29.160 {time parsing} { clock scan {2440588 0:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 61 test clock-29.161 {time parsing} { clock scan {2440588 ?:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 61 test clock-29.162 {time parsing} { clock scan {2440588 ?:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 61 test clock-29.163 {time parsing} { clock scan {2440588 ?:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 61 test clock-29.164 {time parsing} { clock scan {2440588 ?:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 61 test clock-29.165 {time parsing} { clock scan {2440588 12:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 61 test clock-29.166 {time parsing} { clock scan {2440588 12:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 61 test clock-29.167 {time parsing} { clock scan {2440588 12:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 61 test clock-29.168 {time parsing} { clock scan {2440588 12:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 61 test clock-29.169 {time parsing} { clock scan {2440588 xii:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 61 test clock-29.170 {time parsing} { clock scan {2440588 xii:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 61 test clock-29.171 {time parsing} { clock scan {2440588 xii:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 61 test clock-29.172 {time parsing} { clock scan {2440588 xii:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 61 test clock-29.173 {time parsing} { clock scan {2440588 12:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 61 test clock-29.174 {time parsing} { clock scan {2440588 12:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 61 test clock-29.175 {time parsing} { clock scan {2440588 12:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 61 test clock-29.176 {time parsing} { clock scan {2440588 12:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 61 test clock-29.177 {time parsing} { clock scan {2440588 xii:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 61 test clock-29.178 {time parsing} { clock scan {2440588 xii:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 61 test clock-29.179 {time parsing} { clock scan {2440588 xii:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 61 test clock-29.180 {time parsing} { clock scan {2440588 xii:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 61 test clock-29.181 {time parsing} { clock scan {2440588 00:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 119 test clock-29.182 {time parsing} { clock scan {2440588 00:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 119 test clock-29.183 {time parsing} { clock scan {2440588 0:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 119 test clock-29.184 {time parsing} { clock scan {2440588 0:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 119 test clock-29.185 {time parsing} { clock scan {2440588 ?:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 119 test clock-29.186 {time parsing} { clock scan {2440588 ?:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 119 test clock-29.187 {time parsing} { clock scan {2440588 ?:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 119 test clock-29.188 {time parsing} { clock scan {2440588 ?:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 119 test clock-29.189 {time parsing} { clock scan {2440588 12:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 119 test clock-29.190 {time parsing} { clock scan {2440588 12:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 119 test clock-29.191 {time parsing} { clock scan {2440588 12:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 119 test clock-29.192 {time parsing} { clock scan {2440588 12:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 119 test clock-29.193 {time parsing} { clock scan {2440588 xii:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 119 test clock-29.194 {time parsing} { clock scan {2440588 xii:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 119 test clock-29.195 {time parsing} { clock scan {2440588 xii:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 119 test clock-29.196 {time parsing} { clock scan {2440588 xii:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 119 test clock-29.197 {time parsing} { clock scan {2440588 12:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 119 test clock-29.198 {time parsing} { clock scan {2440588 12:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 119 test clock-29.199 {time parsing} { clock scan {2440588 12:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 119 test clock-29.200 {time parsing} { clock scan {2440588 12:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 119 test clock-29.201 {time parsing} { clock scan {2440588 xii:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 119 test clock-29.202 {time parsing} { clock scan {2440588 xii:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 119 test clock-29.203 {time parsing} { clock scan {2440588 xii:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 119 test clock-29.204 {time parsing} { clock scan {2440588 xii:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 119 test clock-29.205 {time parsing} { clock scan {2440588 00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 3540 test clock-29.206 {time parsing} { clock scan {2440588 00:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 3540 test clock-29.207 {time parsing} { clock scan {2440588 00:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3540 test clock-29.208 {time parsing} { clock scan {2440588 00:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3540 test clock-29.209 {time parsing} { clock scan {2440588 0:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 3540 test clock-29.210 {time parsing} { clock scan {2440588 0:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 3540 test clock-29.211 {time parsing} { clock scan {2440588 0:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3540 test clock-29.212 {time parsing} { clock scan {2440588 0:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3540 test clock-29.213 {time parsing} { clock scan {2440588 ?:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 3540 test clock-29.214 {time parsing} { clock scan {2440588 ?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 3540 test clock-29.215 {time parsing} { clock scan {2440588 ?:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3540 test clock-29.216 {time parsing} { clock scan {2440588 ?:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3540 test clock-29.217 {time parsing} { clock scan {2440588 ?:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 3540 test clock-29.218 {time parsing} { clock scan {2440588 ?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 3540 test clock-29.219 {time parsing} { clock scan {2440588 ?:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3540 test clock-29.220 {time parsing} { clock scan {2440588 ?:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3540 test clock-29.221 {time parsing} { clock scan {2440588 12:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 3540 test clock-29.222 {time parsing} { clock scan {2440588 12:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 3540 test clock-29.223 {time parsing} { clock scan {2440588 12:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3540 test clock-29.224 {time parsing} { clock scan {2440588 12:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3540 test clock-29.225 {time parsing} { clock scan {2440588 12:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 3540 test clock-29.226 {time parsing} { clock scan {2440588 12:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 3540 test clock-29.227 {time parsing} { clock scan {2440588 12:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3540 test clock-29.228 {time parsing} { clock scan {2440588 12:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3540 test clock-29.229 {time parsing} { clock scan {2440588 xii:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 3540 test clock-29.230 {time parsing} { clock scan {2440588 xii:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 3540 test clock-29.231 {time parsing} { clock scan {2440588 xii:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3540 test clock-29.232 {time parsing} { clock scan {2440588 xii:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3540 test clock-29.233 {time parsing} { clock scan {2440588 xii:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 3540 test clock-29.234 {time parsing} { clock scan {2440588 xii:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 3540 test clock-29.235 {time parsing} { clock scan {2440588 xii:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3540 test clock-29.236 {time parsing} { clock scan {2440588 xii:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3540 test clock-29.237 {time parsing} { clock scan {2440588 12:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 3540 test clock-29.238 {time parsing} { clock scan {2440588 12:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 3540 test clock-29.239 {time parsing} { clock scan {2440588 12:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3540 test clock-29.240 {time parsing} { clock scan {2440588 12:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3540 test clock-29.241 {time parsing} { clock scan {2440588 12:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 3540 test clock-29.242 {time parsing} { clock scan {2440588 12:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 3540 test clock-29.243 {time parsing} { clock scan {2440588 12:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3540 test clock-29.244 {time parsing} { clock scan {2440588 12:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3540 test clock-29.245 {time parsing} { clock scan {2440588 xii:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 3540 test clock-29.246 {time parsing} { clock scan {2440588 xii:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 3540 test clock-29.247 {time parsing} { clock scan {2440588 xii:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3540 test clock-29.248 {time parsing} { clock scan {2440588 xii:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3540 test clock-29.249 {time parsing} { clock scan {2440588 xii:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 3540 test clock-29.250 {time parsing} { clock scan {2440588 xii:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 3540 test clock-29.251 {time parsing} { clock scan {2440588 xii:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3540 test clock-29.252 {time parsing} { clock scan {2440588 xii:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3540 test clock-29.253 {time parsing} { clock scan {2440588 00:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3541 test clock-29.254 {time parsing} { clock scan {2440588 00:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3541 test clock-29.255 {time parsing} { clock scan {2440588 0:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3541 test clock-29.256 {time parsing} { clock scan {2440588 0:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3541 test clock-29.257 {time parsing} { clock scan {2440588 ?:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3541 test clock-29.258 {time parsing} { clock scan {2440588 ?:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3541 test clock-29.259 {time parsing} { clock scan {2440588 ?:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3541 test clock-29.260 {time parsing} { clock scan {2440588 ?:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3541 test clock-29.261 {time parsing} { clock scan {2440588 12:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3541 test clock-29.262 {time parsing} { clock scan {2440588 12:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3541 test clock-29.263 {time parsing} { clock scan {2440588 12:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3541 test clock-29.264 {time parsing} { clock scan {2440588 12:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3541 test clock-29.265 {time parsing} { clock scan {2440588 xii:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3541 test clock-29.266 {time parsing} { clock scan {2440588 xii:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3541 test clock-29.267 {time parsing} { clock scan {2440588 xii:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3541 test clock-29.268 {time parsing} { clock scan {2440588 xii:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3541 test clock-29.269 {time parsing} { clock scan {2440588 12:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3541 test clock-29.270 {time parsing} { clock scan {2440588 12:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3541 test clock-29.271 {time parsing} { clock scan {2440588 12:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3541 test clock-29.272 {time parsing} { clock scan {2440588 12:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3541 test clock-29.273 {time parsing} { clock scan {2440588 xii:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3541 test clock-29.274 {time parsing} { clock scan {2440588 xii:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3541 test clock-29.275 {time parsing} { clock scan {2440588 xii:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3541 test clock-29.276 {time parsing} { clock scan {2440588 xii:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3541 test clock-29.277 {time parsing} { clock scan {2440588 00:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3599 test clock-29.278 {time parsing} { clock scan {2440588 00:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3599 test clock-29.279 {time parsing} { clock scan {2440588 0:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3599 test clock-29.280 {time parsing} { clock scan {2440588 0:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3599 test clock-29.281 {time parsing} { clock scan {2440588 ?:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3599 test clock-29.282 {time parsing} { clock scan {2440588 ?:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3599 test clock-29.283 {time parsing} { clock scan {2440588 ?:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3599 test clock-29.284 {time parsing} { clock scan {2440588 ?:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3599 test clock-29.285 {time parsing} { clock scan {2440588 12:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3599 test clock-29.286 {time parsing} { clock scan {2440588 12:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3599 test clock-29.287 {time parsing} { clock scan {2440588 12:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3599 test clock-29.288 {time parsing} { clock scan {2440588 12:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3599 test clock-29.289 {time parsing} { clock scan {2440588 xii:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3599 test clock-29.290 {time parsing} { clock scan {2440588 xii:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3599 test clock-29.291 {time parsing} { clock scan {2440588 xii:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3599 test clock-29.292 {time parsing} { clock scan {2440588 xii:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3599 test clock-29.293 {time parsing} { clock scan {2440588 12:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3599 test clock-29.294 {time parsing} { clock scan {2440588 12:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3599 test clock-29.295 {time parsing} { clock scan {2440588 12:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3599 test clock-29.296 {time parsing} { clock scan {2440588 12:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3599 test clock-29.297 {time parsing} { clock scan {2440588 xii:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3599 test clock-29.298 {time parsing} { clock scan {2440588 xii:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3599 test clock-29.299 {time parsing} { clock scan {2440588 xii:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3599 test clock-29.300 {time parsing} { clock scan {2440588 xii:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3599 test clock-29.301 {time parsing} { clock scan {2440588 01 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 3600 test clock-29.302 {time parsing} { clock scan {2440588 01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 3600 test clock-29.303 {time parsing} { clock scan {2440588 01:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 3600 test clock-29.304 {time parsing} { clock scan {2440588 01:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3600 test clock-29.305 {time parsing} { clock scan {2440588 01:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3600 test clock-29.306 {time parsing} { clock scan {2440588 1 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 3600 test clock-29.307 {time parsing} { clock scan {2440588 1:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 3600 test clock-29.308 {time parsing} { clock scan {2440588 1:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 3600 test clock-29.309 {time parsing} { clock scan {2440588 1:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3600 test clock-29.310 {time parsing} { clock scan {2440588 1:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3600 test clock-29.311 {time parsing} { clock scan {2440588 i } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 3600 test clock-29.312 {time parsing} { clock scan {2440588 i:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 3600 test clock-29.313 {time parsing} { clock scan {2440588 i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 3600 test clock-29.314 {time parsing} { clock scan {2440588 i:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3600 test clock-29.315 {time parsing} { clock scan {2440588 i:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3600 test clock-29.316 {time parsing} { clock scan {2440588 i } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 3600 test clock-29.317 {time parsing} { clock scan {2440588 i:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 3600 test clock-29.318 {time parsing} { clock scan {2440588 i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 3600 test clock-29.319 {time parsing} { clock scan {2440588 i:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3600 test clock-29.320 {time parsing} { clock scan {2440588 i:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3600 test clock-29.321 {time parsing} { clock scan {2440588 01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 3600 test clock-29.322 {time parsing} { clock scan {2440588 01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 3600 test clock-29.323 {time parsing} { clock scan {2440588 01:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 3600 test clock-29.324 {time parsing} { clock scan {2440588 01:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3600 test clock-29.325 {time parsing} { clock scan {2440588 01:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3600 test clock-29.326 {time parsing} { clock scan {2440588 1 AM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 3600 test clock-29.327 {time parsing} { clock scan {2440588 1:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 3600 test clock-29.328 {time parsing} { clock scan {2440588 1:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 3600 test clock-29.329 {time parsing} { clock scan {2440588 1:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3600 test clock-29.330 {time parsing} { clock scan {2440588 1:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3600 test clock-29.331 {time parsing} { clock scan {2440588 i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 3600 test clock-29.332 {time parsing} { clock scan {2440588 i:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 3600 test clock-29.333 {time parsing} { clock scan {2440588 i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 3600 test clock-29.334 {time parsing} { clock scan {2440588 i:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3600 test clock-29.335 {time parsing} { clock scan {2440588 i:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3600 test clock-29.336 {time parsing} { clock scan {2440588 i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 3600 test clock-29.337 {time parsing} { clock scan {2440588 i:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 3600 test clock-29.338 {time parsing} { clock scan {2440588 i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 3600 test clock-29.339 {time parsing} { clock scan {2440588 i:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3600 test clock-29.340 {time parsing} { clock scan {2440588 i:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3600 test clock-29.341 {time parsing} { clock scan {2440588 01 am} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 3600 test clock-29.342 {time parsing} { clock scan {2440588 01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 3600 test clock-29.343 {time parsing} { clock scan {2440588 01:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 3600 test clock-29.344 {time parsing} { clock scan {2440588 01:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3600 test clock-29.345 {time parsing} { clock scan {2440588 01:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3600 test clock-29.346 {time parsing} { clock scan {2440588 1 am} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 3600 test clock-29.347 {time parsing} { clock scan {2440588 1:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 3600 test clock-29.348 {time parsing} { clock scan {2440588 1:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 3600 test clock-29.349 {time parsing} { clock scan {2440588 1:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3600 test clock-29.350 {time parsing} { clock scan {2440588 1:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3600 test clock-29.351 {time parsing} { clock scan {2440588 i am} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 3600 test clock-29.352 {time parsing} { clock scan {2440588 i:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 3600 test clock-29.353 {time parsing} { clock scan {2440588 i:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 3600 test clock-29.354 {time parsing} { clock scan {2440588 i:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3600 test clock-29.355 {time parsing} { clock scan {2440588 i:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3600 test clock-29.356 {time parsing} { clock scan {2440588 i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 3600 test clock-29.357 {time parsing} { clock scan {2440588 i:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 3600 test clock-29.358 {time parsing} { clock scan {2440588 i:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 3600 test clock-29.359 {time parsing} { clock scan {2440588 i:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3600 test clock-29.360 {time parsing} { clock scan {2440588 i:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3600 test clock-29.361 {time parsing} { clock scan {2440588 01:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3601 test clock-29.362 {time parsing} { clock scan {2440588 01:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3601 test clock-29.363 {time parsing} { clock scan {2440588 1:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3601 test clock-29.364 {time parsing} { clock scan {2440588 1:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3601 test clock-29.365 {time parsing} { clock scan {2440588 i:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3601 test clock-29.366 {time parsing} { clock scan {2440588 i:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3601 test clock-29.367 {time parsing} { clock scan {2440588 i:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3601 test clock-29.368 {time parsing} { clock scan {2440588 i:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3601 test clock-29.369 {time parsing} { clock scan {2440588 01:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3601 test clock-29.370 {time parsing} { clock scan {2440588 01:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3601 test clock-29.371 {time parsing} { clock scan {2440588 1:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3601 test clock-29.372 {time parsing} { clock scan {2440588 1:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3601 test clock-29.373 {time parsing} { clock scan {2440588 i:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3601 test clock-29.374 {time parsing} { clock scan {2440588 i:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3601 test clock-29.375 {time parsing} { clock scan {2440588 i:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3601 test clock-29.376 {time parsing} { clock scan {2440588 i:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3601 test clock-29.377 {time parsing} { clock scan {2440588 01:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3601 test clock-29.378 {time parsing} { clock scan {2440588 01:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3601 test clock-29.379 {time parsing} { clock scan {2440588 1:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3601 test clock-29.380 {time parsing} { clock scan {2440588 1:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3601 test clock-29.381 {time parsing} { clock scan {2440588 i:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3601 test clock-29.382 {time parsing} { clock scan {2440588 i:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3601 test clock-29.383 {time parsing} { clock scan {2440588 i:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3601 test clock-29.384 {time parsing} { clock scan {2440588 i:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3601 test clock-29.385 {time parsing} { clock scan {2440588 01:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3659 test clock-29.386 {time parsing} { clock scan {2440588 01:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3659 test clock-29.387 {time parsing} { clock scan {2440588 1:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3659 test clock-29.388 {time parsing} { clock scan {2440588 1:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3659 test clock-29.389 {time parsing} { clock scan {2440588 i:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3659 test clock-29.390 {time parsing} { clock scan {2440588 i:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3659 test clock-29.391 {time parsing} { clock scan {2440588 i:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3659 test clock-29.392 {time parsing} { clock scan {2440588 i:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3659 test clock-29.393 {time parsing} { clock scan {2440588 01:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3659 test clock-29.394 {time parsing} { clock scan {2440588 01:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3659 test clock-29.395 {time parsing} { clock scan {2440588 1:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3659 test clock-29.396 {time parsing} { clock scan {2440588 1:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3659 test clock-29.397 {time parsing} { clock scan {2440588 i:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3659 test clock-29.398 {time parsing} { clock scan {2440588 i:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3659 test clock-29.399 {time parsing} { clock scan {2440588 i:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3659 test clock-29.400 {time parsing} { clock scan {2440588 i:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3659 test clock-29.401 {time parsing} { clock scan {2440588 01:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3659 test clock-29.402 {time parsing} { clock scan {2440588 01:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3659 test clock-29.403 {time parsing} { clock scan {2440588 1:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3659 test clock-29.404 {time parsing} { clock scan {2440588 1:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3659 test clock-29.405 {time parsing} { clock scan {2440588 i:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3659 test clock-29.406 {time parsing} { clock scan {2440588 i:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3659 test clock-29.407 {time parsing} { clock scan {2440588 i:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3659 test clock-29.408 {time parsing} { clock scan {2440588 i:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3659 test clock-29.409 {time parsing} { clock scan {2440588 01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 3660 test clock-29.410 {time parsing} { clock scan {2440588 01:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 3660 test clock-29.411 {time parsing} { clock scan {2440588 01:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3660 test clock-29.412 {time parsing} { clock scan {2440588 01:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3660 test clock-29.413 {time parsing} { clock scan {2440588 1:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 3660 test clock-29.414 {time parsing} { clock scan {2440588 1:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 3660 test clock-29.415 {time parsing} { clock scan {2440588 1:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3660 test clock-29.416 {time parsing} { clock scan {2440588 1:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3660 test clock-29.417 {time parsing} { clock scan {2440588 i:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 3660 test clock-29.418 {time parsing} { clock scan {2440588 i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 3660 test clock-29.419 {time parsing} { clock scan {2440588 i:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3660 test clock-29.420 {time parsing} { clock scan {2440588 i:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3660 test clock-29.421 {time parsing} { clock scan {2440588 i:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 3660 test clock-29.422 {time parsing} { clock scan {2440588 i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 3660 test clock-29.423 {time parsing} { clock scan {2440588 i:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3660 test clock-29.424 {time parsing} { clock scan {2440588 i:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3660 test clock-29.425 {time parsing} { clock scan {2440588 01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 3660 test clock-29.426 {time parsing} { clock scan {2440588 01:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 3660 test clock-29.427 {time parsing} { clock scan {2440588 01:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3660 test clock-29.428 {time parsing} { clock scan {2440588 01:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3660 test clock-29.429 {time parsing} { clock scan {2440588 1:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 3660 test clock-29.430 {time parsing} { clock scan {2440588 1:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 3660 test clock-29.431 {time parsing} { clock scan {2440588 1:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3660 test clock-29.432 {time parsing} { clock scan {2440588 1:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3660 test clock-29.433 {time parsing} { clock scan {2440588 i:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 3660 test clock-29.434 {time parsing} { clock scan {2440588 i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 3660 test clock-29.435 {time parsing} { clock scan {2440588 i:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3660 test clock-29.436 {time parsing} { clock scan {2440588 i:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3660 test clock-29.437 {time parsing} { clock scan {2440588 i:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 3660 test clock-29.438 {time parsing} { clock scan {2440588 i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 3660 test clock-29.439 {time parsing} { clock scan {2440588 i:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3660 test clock-29.440 {time parsing} { clock scan {2440588 i:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3660 test clock-29.441 {time parsing} { clock scan {2440588 01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 3660 test clock-29.442 {time parsing} { clock scan {2440588 01:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 3660 test clock-29.443 {time parsing} { clock scan {2440588 01:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3660 test clock-29.444 {time parsing} { clock scan {2440588 01:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3660 test clock-29.445 {time parsing} { clock scan {2440588 1:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 3660 test clock-29.446 {time parsing} { clock scan {2440588 1:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 3660 test clock-29.447 {time parsing} { clock scan {2440588 1:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3660 test clock-29.448 {time parsing} { clock scan {2440588 1:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3660 test clock-29.449 {time parsing} { clock scan {2440588 i:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 3660 test clock-29.450 {time parsing} { clock scan {2440588 i:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 3660 test clock-29.451 {time parsing} { clock scan {2440588 i:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3660 test clock-29.452 {time parsing} { clock scan {2440588 i:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3660 test clock-29.453 {time parsing} { clock scan {2440588 i:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 3660 test clock-29.454 {time parsing} { clock scan {2440588 i:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 3660 test clock-29.455 {time parsing} { clock scan {2440588 i:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3660 test clock-29.456 {time parsing} { clock scan {2440588 i:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3660 test clock-29.457 {time parsing} { clock scan {2440588 01:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3661 test clock-29.458 {time parsing} { clock scan {2440588 01:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3661 test clock-29.459 {time parsing} { clock scan {2440588 1:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3661 test clock-29.460 {time parsing} { clock scan {2440588 1:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3661 test clock-29.461 {time parsing} { clock scan {2440588 i:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3661 test clock-29.462 {time parsing} { clock scan {2440588 i:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3661 test clock-29.463 {time parsing} { clock scan {2440588 i:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3661 test clock-29.464 {time parsing} { clock scan {2440588 i:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3661 test clock-29.465 {time parsing} { clock scan {2440588 01:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3661 test clock-29.466 {time parsing} { clock scan {2440588 01:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3661 test clock-29.467 {time parsing} { clock scan {2440588 1:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3661 test clock-29.468 {time parsing} { clock scan {2440588 1:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3661 test clock-29.469 {time parsing} { clock scan {2440588 i:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3661 test clock-29.470 {time parsing} { clock scan {2440588 i:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3661 test clock-29.471 {time parsing} { clock scan {2440588 i:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3661 test clock-29.472 {time parsing} { clock scan {2440588 i:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3661 test clock-29.473 {time parsing} { clock scan {2440588 01:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3661 test clock-29.474 {time parsing} { clock scan {2440588 01:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3661 test clock-29.475 {time parsing} { clock scan {2440588 1:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3661 test clock-29.476 {time parsing} { clock scan {2440588 1:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3661 test clock-29.477 {time parsing} { clock scan {2440588 i:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3661 test clock-29.478 {time parsing} { clock scan {2440588 i:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3661 test clock-29.479 {time parsing} { clock scan {2440588 i:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3661 test clock-29.480 {time parsing} { clock scan {2440588 i:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3661 test clock-29.481 {time parsing} { clock scan {2440588 01:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 3719 test clock-29.482 {time parsing} { clock scan {2440588 01:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 3719 test clock-29.483 {time parsing} { clock scan {2440588 1:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 3719 test clock-29.484 {time parsing} { clock scan {2440588 1:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 3719 test clock-29.485 {time parsing} { clock scan {2440588 i:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 3719 test clock-29.486 {time parsing} { clock scan {2440588 i:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 3719 test clock-29.487 {time parsing} { clock scan {2440588 i:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 3719 test clock-29.488 {time parsing} { clock scan {2440588 i:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 3719 test clock-29.489 {time parsing} { clock scan {2440588 01:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 3719 test clock-29.490 {time parsing} { clock scan {2440588 01:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 3719 test clock-29.491 {time parsing} { clock scan {2440588 1:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 3719 test clock-29.492 {time parsing} { clock scan {2440588 1:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 3719 test clock-29.493 {time parsing} { clock scan {2440588 i:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 3719 test clock-29.494 {time parsing} { clock scan {2440588 i:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 3719 test clock-29.495 {time parsing} { clock scan {2440588 i:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 3719 test clock-29.496 {time parsing} { clock scan {2440588 i:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 3719 test clock-29.497 {time parsing} { clock scan {2440588 01:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 3719 test clock-29.498 {time parsing} { clock scan {2440588 01:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 3719 test clock-29.499 {time parsing} { clock scan {2440588 1:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 3719 test clock-29.500 {time parsing} { clock scan {2440588 1:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 3719 test clock-29.501 {time parsing} { clock scan {2440588 i:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 3719 test clock-29.502 {time parsing} { clock scan {2440588 i:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 3719 test clock-29.503 {time parsing} { clock scan {2440588 i:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 3719 test clock-29.504 {time parsing} { clock scan {2440588 i:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 3719 test clock-29.505 {time parsing} { clock scan {2440588 01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 7140 test clock-29.506 {time parsing} { clock scan {2440588 01:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 7140 test clock-29.507 {time parsing} { clock scan {2440588 01:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 7140 test clock-29.508 {time parsing} { clock scan {2440588 01:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 7140 test clock-29.509 {time parsing} { clock scan {2440588 1:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 7140 test clock-29.510 {time parsing} { clock scan {2440588 1:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 7140 test clock-29.511 {time parsing} { clock scan {2440588 1:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 7140 test clock-29.512 {time parsing} { clock scan {2440588 1:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 7140 test clock-29.513 {time parsing} { clock scan {2440588 i:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 7140 test clock-29.514 {time parsing} { clock scan {2440588 i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 7140 test clock-29.515 {time parsing} { clock scan {2440588 i:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 7140 test clock-29.516 {time parsing} { clock scan {2440588 i:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 7140 test clock-29.517 {time parsing} { clock scan {2440588 i:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 7140 test clock-29.518 {time parsing} { clock scan {2440588 i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 7140 test clock-29.519 {time parsing} { clock scan {2440588 i:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 7140 test clock-29.520 {time parsing} { clock scan {2440588 i:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 7140 test clock-29.521 {time parsing} { clock scan {2440588 01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 7140 test clock-29.522 {time parsing} { clock scan {2440588 01:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 7140 test clock-29.523 {time parsing} { clock scan {2440588 01:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 7140 test clock-29.524 {time parsing} { clock scan {2440588 01:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 7140 test clock-29.525 {time parsing} { clock scan {2440588 1:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 7140 test clock-29.526 {time parsing} { clock scan {2440588 1:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 7140 test clock-29.527 {time parsing} { clock scan {2440588 1:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 7140 test clock-29.528 {time parsing} { clock scan {2440588 1:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 7140 test clock-29.529 {time parsing} { clock scan {2440588 i:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 7140 test clock-29.530 {time parsing} { clock scan {2440588 i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 7140 test clock-29.531 {time parsing} { clock scan {2440588 i:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 7140 test clock-29.532 {time parsing} { clock scan {2440588 i:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 7140 test clock-29.533 {time parsing} { clock scan {2440588 i:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 7140 test clock-29.534 {time parsing} { clock scan {2440588 i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 7140 test clock-29.535 {time parsing} { clock scan {2440588 i:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 7140 test clock-29.536 {time parsing} { clock scan {2440588 i:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 7140 test clock-29.537 {time parsing} { clock scan {2440588 01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 7140 test clock-29.538 {time parsing} { clock scan {2440588 01:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 7140 test clock-29.539 {time parsing} { clock scan {2440588 01:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 7140 test clock-29.540 {time parsing} { clock scan {2440588 01:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 7140 test clock-29.541 {time parsing} { clock scan {2440588 1:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 7140 test clock-29.542 {time parsing} { clock scan {2440588 1:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 7140 test clock-29.543 {time parsing} { clock scan {2440588 1:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 7140 test clock-29.544 {time parsing} { clock scan {2440588 1:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 7140 test clock-29.545 {time parsing} { clock scan {2440588 i:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 7140 test clock-29.546 {time parsing} { clock scan {2440588 i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 7140 test clock-29.547 {time parsing} { clock scan {2440588 i:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 7140 test clock-29.548 {time parsing} { clock scan {2440588 i:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 7140 test clock-29.549 {time parsing} { clock scan {2440588 i:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 7140 test clock-29.550 {time parsing} { clock scan {2440588 i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 7140 test clock-29.551 {time parsing} { clock scan {2440588 i:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 7140 test clock-29.552 {time parsing} { clock scan {2440588 i:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 7140 test clock-29.553 {time parsing} { clock scan {2440588 01:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 7141 test clock-29.554 {time parsing} { clock scan {2440588 01:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 7141 test clock-29.555 {time parsing} { clock scan {2440588 1:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 7141 test clock-29.556 {time parsing} { clock scan {2440588 1:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 7141 test clock-29.557 {time parsing} { clock scan {2440588 i:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 7141 test clock-29.558 {time parsing} { clock scan {2440588 i:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 7141 test clock-29.559 {time parsing} { clock scan {2440588 i:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 7141 test clock-29.560 {time parsing} { clock scan {2440588 i:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 7141 test clock-29.561 {time parsing} { clock scan {2440588 01:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 7141 test clock-29.562 {time parsing} { clock scan {2440588 01:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 7141 test clock-29.563 {time parsing} { clock scan {2440588 1:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 7141 test clock-29.564 {time parsing} { clock scan {2440588 1:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 7141 test clock-29.565 {time parsing} { clock scan {2440588 i:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 7141 test clock-29.566 {time parsing} { clock scan {2440588 i:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 7141 test clock-29.567 {time parsing} { clock scan {2440588 i:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 7141 test clock-29.568 {time parsing} { clock scan {2440588 i:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 7141 test clock-29.569 {time parsing} { clock scan {2440588 01:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 7141 test clock-29.570 {time parsing} { clock scan {2440588 01:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 7141 test clock-29.571 {time parsing} { clock scan {2440588 1:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 7141 test clock-29.572 {time parsing} { clock scan {2440588 1:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 7141 test clock-29.573 {time parsing} { clock scan {2440588 i:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 7141 test clock-29.574 {time parsing} { clock scan {2440588 i:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 7141 test clock-29.575 {time parsing} { clock scan {2440588 i:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 7141 test clock-29.576 {time parsing} { clock scan {2440588 i:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 7141 test clock-29.577 {time parsing} { clock scan {2440588 01:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 7199 test clock-29.578 {time parsing} { clock scan {2440588 01:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 7199 test clock-29.579 {time parsing} { clock scan {2440588 1:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 7199 test clock-29.580 {time parsing} { clock scan {2440588 1:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 7199 test clock-29.581 {time parsing} { clock scan {2440588 i:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 7199 test clock-29.582 {time parsing} { clock scan {2440588 i:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 7199 test clock-29.583 {time parsing} { clock scan {2440588 i:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 7199 test clock-29.584 {time parsing} { clock scan {2440588 i:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 7199 test clock-29.585 {time parsing} { clock scan {2440588 01:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 7199 test clock-29.586 {time parsing} { clock scan {2440588 01:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 7199 test clock-29.587 {time parsing} { clock scan {2440588 1:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 7199 test clock-29.588 {time parsing} { clock scan {2440588 1:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 7199 test clock-29.589 {time parsing} { clock scan {2440588 i:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 7199 test clock-29.590 {time parsing} { clock scan {2440588 i:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 7199 test clock-29.591 {time parsing} { clock scan {2440588 i:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 7199 test clock-29.592 {time parsing} { clock scan {2440588 i:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 7199 test clock-29.593 {time parsing} { clock scan {2440588 01:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 7199 test clock-29.594 {time parsing} { clock scan {2440588 01:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 7199 test clock-29.595 {time parsing} { clock scan {2440588 1:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 7199 test clock-29.596 {time parsing} { clock scan {2440588 1:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 7199 test clock-29.597 {time parsing} { clock scan {2440588 i:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 7199 test clock-29.598 {time parsing} { clock scan {2440588 i:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 7199 test clock-29.599 {time parsing} { clock scan {2440588 i:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 7199 test clock-29.600 {time parsing} { clock scan {2440588 i:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 7199 test clock-29.601 {time parsing} { clock scan {2440588 11 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 39600 test clock-29.602 {time parsing} { clock scan {2440588 11:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 39600 test clock-29.603 {time parsing} { clock scan {2440588 11:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 39600 test clock-29.604 {time parsing} { clock scan {2440588 11:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39600 test clock-29.605 {time parsing} { clock scan {2440588 11:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39600 test clock-29.606 {time parsing} { clock scan {2440588 11 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 39600 test clock-29.607 {time parsing} { clock scan {2440588 11:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 39600 test clock-29.608 {time parsing} { clock scan {2440588 11:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 39600 test clock-29.609 {time parsing} { clock scan {2440588 11:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39600 test clock-29.610 {time parsing} { clock scan {2440588 11:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39600 test clock-29.611 {time parsing} { clock scan {2440588 xi } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 39600 test clock-29.612 {time parsing} { clock scan {2440588 xi:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 39600 test clock-29.613 {time parsing} { clock scan {2440588 xi:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 39600 test clock-29.614 {time parsing} { clock scan {2440588 xi:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39600 test clock-29.615 {time parsing} { clock scan {2440588 xi:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39600 test clock-29.616 {time parsing} { clock scan {2440588 xi } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 39600 test clock-29.617 {time parsing} { clock scan {2440588 xi:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 39600 test clock-29.618 {time parsing} { clock scan {2440588 xi:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 39600 test clock-29.619 {time parsing} { clock scan {2440588 xi:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39600 test clock-29.620 {time parsing} { clock scan {2440588 xi:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39600 test clock-29.621 {time parsing} { clock scan {2440588 11 AM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 39600 test clock-29.622 {time parsing} { clock scan {2440588 11:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 39600 test clock-29.623 {time parsing} { clock scan {2440588 11:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 39600 test clock-29.624 {time parsing} { clock scan {2440588 11:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39600 test clock-29.625 {time parsing} { clock scan {2440588 11:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39600 test clock-29.626 {time parsing} { clock scan {2440588 11 AM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 39600 test clock-29.627 {time parsing} { clock scan {2440588 11:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 39600 test clock-29.628 {time parsing} { clock scan {2440588 11:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 39600 test clock-29.629 {time parsing} { clock scan {2440588 11:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39600 test clock-29.630 {time parsing} { clock scan {2440588 11:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39600 test clock-29.631 {time parsing} { clock scan {2440588 xi AM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 39600 test clock-29.632 {time parsing} { clock scan {2440588 xi:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 39600 test clock-29.633 {time parsing} { clock scan {2440588 xi:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 39600 test clock-29.634 {time parsing} { clock scan {2440588 xi:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39600 test clock-29.635 {time parsing} { clock scan {2440588 xi:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39600 test clock-29.636 {time parsing} { clock scan {2440588 xi AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 39600 test clock-29.637 {time parsing} { clock scan {2440588 xi:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 39600 test clock-29.638 {time parsing} { clock scan {2440588 xi:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 39600 test clock-29.639 {time parsing} { clock scan {2440588 xi:00:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39600 test clock-29.640 {time parsing} { clock scan {2440588 xi:?:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39600 test clock-29.641 {time parsing} { clock scan {2440588 11 am} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 39600 test clock-29.642 {time parsing} { clock scan {2440588 11:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 39600 test clock-29.643 {time parsing} { clock scan {2440588 11:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 39600 test clock-29.644 {time parsing} { clock scan {2440588 11:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39600 test clock-29.645 {time parsing} { clock scan {2440588 11:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39600 test clock-29.646 {time parsing} { clock scan {2440588 11 am} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 39600 test clock-29.647 {time parsing} { clock scan {2440588 11:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 39600 test clock-29.648 {time parsing} { clock scan {2440588 11:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 39600 test clock-29.649 {time parsing} { clock scan {2440588 11:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39600 test clock-29.650 {time parsing} { clock scan {2440588 11:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39600 test clock-29.651 {time parsing} { clock scan {2440588 xi am} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 39600 test clock-29.652 {time parsing} { clock scan {2440588 xi:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 39600 test clock-29.653 {time parsing} { clock scan {2440588 xi:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 39600 test clock-29.654 {time parsing} { clock scan {2440588 xi:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39600 test clock-29.655 {time parsing} { clock scan {2440588 xi:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39600 test clock-29.656 {time parsing} { clock scan {2440588 xi am} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 39600 test clock-29.657 {time parsing} { clock scan {2440588 xi:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 39600 test clock-29.658 {time parsing} { clock scan {2440588 xi:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 39600 test clock-29.659 {time parsing} { clock scan {2440588 xi:00:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39600 test clock-29.660 {time parsing} { clock scan {2440588 xi:?:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39600 test clock-29.661 {time parsing} { clock scan {2440588 11:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39601 test clock-29.662 {time parsing} { clock scan {2440588 11:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39601 test clock-29.663 {time parsing} { clock scan {2440588 11:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39601 test clock-29.664 {time parsing} { clock scan {2440588 11:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39601 test clock-29.665 {time parsing} { clock scan {2440588 xi:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39601 test clock-29.666 {time parsing} { clock scan {2440588 xi:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39601 test clock-29.667 {time parsing} { clock scan {2440588 xi:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39601 test clock-29.668 {time parsing} { clock scan {2440588 xi:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39601 test clock-29.669 {time parsing} { clock scan {2440588 11:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39601 test clock-29.670 {time parsing} { clock scan {2440588 11:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39601 test clock-29.671 {time parsing} { clock scan {2440588 11:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39601 test clock-29.672 {time parsing} { clock scan {2440588 11:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39601 test clock-29.673 {time parsing} { clock scan {2440588 xi:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39601 test clock-29.674 {time parsing} { clock scan {2440588 xi:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39601 test clock-29.675 {time parsing} { clock scan {2440588 xi:00:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39601 test clock-29.676 {time parsing} { clock scan {2440588 xi:?:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39601 test clock-29.677 {time parsing} { clock scan {2440588 11:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39601 test clock-29.678 {time parsing} { clock scan {2440588 11:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39601 test clock-29.679 {time parsing} { clock scan {2440588 11:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39601 test clock-29.680 {time parsing} { clock scan {2440588 11:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39601 test clock-29.681 {time parsing} { clock scan {2440588 xi:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39601 test clock-29.682 {time parsing} { clock scan {2440588 xi:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39601 test clock-29.683 {time parsing} { clock scan {2440588 xi:00:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39601 test clock-29.684 {time parsing} { clock scan {2440588 xi:?:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39601 test clock-29.685 {time parsing} { clock scan {2440588 11:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39659 test clock-29.686 {time parsing} { clock scan {2440588 11:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39659 test clock-29.687 {time parsing} { clock scan {2440588 11:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39659 test clock-29.688 {time parsing} { clock scan {2440588 11:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39659 test clock-29.689 {time parsing} { clock scan {2440588 xi:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39659 test clock-29.690 {time parsing} { clock scan {2440588 xi:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39659 test clock-29.691 {time parsing} { clock scan {2440588 xi:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39659 test clock-29.692 {time parsing} { clock scan {2440588 xi:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39659 test clock-29.693 {time parsing} { clock scan {2440588 11:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39659 test clock-29.694 {time parsing} { clock scan {2440588 11:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39659 test clock-29.695 {time parsing} { clock scan {2440588 11:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39659 test clock-29.696 {time parsing} { clock scan {2440588 11:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39659 test clock-29.697 {time parsing} { clock scan {2440588 xi:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39659 test clock-29.698 {time parsing} { clock scan {2440588 xi:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39659 test clock-29.699 {time parsing} { clock scan {2440588 xi:00:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39659 test clock-29.700 {time parsing} { clock scan {2440588 xi:?:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39659 test clock-29.701 {time parsing} { clock scan {2440588 11:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39659 test clock-29.702 {time parsing} { clock scan {2440588 11:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39659 test clock-29.703 {time parsing} { clock scan {2440588 11:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39659 test clock-29.704 {time parsing} { clock scan {2440588 11:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39659 test clock-29.705 {time parsing} { clock scan {2440588 xi:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39659 test clock-29.706 {time parsing} { clock scan {2440588 xi:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39659 test clock-29.707 {time parsing} { clock scan {2440588 xi:00:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39659 test clock-29.708 {time parsing} { clock scan {2440588 xi:?:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39659 test clock-29.709 {time parsing} { clock scan {2440588 11:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 39660 test clock-29.710 {time parsing} { clock scan {2440588 11:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 39660 test clock-29.711 {time parsing} { clock scan {2440588 11:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39660 test clock-29.712 {time parsing} { clock scan {2440588 11:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39660 test clock-29.713 {time parsing} { clock scan {2440588 11:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 39660 test clock-29.714 {time parsing} { clock scan {2440588 11:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 39660 test clock-29.715 {time parsing} { clock scan {2440588 11:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39660 test clock-29.716 {time parsing} { clock scan {2440588 11:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39660 test clock-29.717 {time parsing} { clock scan {2440588 xi:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 39660 test clock-29.718 {time parsing} { clock scan {2440588 xi:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 39660 test clock-29.719 {time parsing} { clock scan {2440588 xi:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39660 test clock-29.720 {time parsing} { clock scan {2440588 xi:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39660 test clock-29.721 {time parsing} { clock scan {2440588 xi:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 39660 test clock-29.722 {time parsing} { clock scan {2440588 xi:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 39660 test clock-29.723 {time parsing} { clock scan {2440588 xi:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39660 test clock-29.724 {time parsing} { clock scan {2440588 xi:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39660 test clock-29.725 {time parsing} { clock scan {2440588 11:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 39660 test clock-29.726 {time parsing} { clock scan {2440588 11:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 39660 test clock-29.727 {time parsing} { clock scan {2440588 11:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39660 test clock-29.728 {time parsing} { clock scan {2440588 11:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39660 test clock-29.729 {time parsing} { clock scan {2440588 11:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 39660 test clock-29.730 {time parsing} { clock scan {2440588 11:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 39660 test clock-29.731 {time parsing} { clock scan {2440588 11:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39660 test clock-29.732 {time parsing} { clock scan {2440588 11:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39660 test clock-29.733 {time parsing} { clock scan {2440588 xi:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 39660 test clock-29.734 {time parsing} { clock scan {2440588 xi:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 39660 test clock-29.735 {time parsing} { clock scan {2440588 xi:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39660 test clock-29.736 {time parsing} { clock scan {2440588 xi:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39660 test clock-29.737 {time parsing} { clock scan {2440588 xi:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 39660 test clock-29.738 {time parsing} { clock scan {2440588 xi:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 39660 test clock-29.739 {time parsing} { clock scan {2440588 xi:01:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39660 test clock-29.740 {time parsing} { clock scan {2440588 xi:i:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39660 test clock-29.741 {time parsing} { clock scan {2440588 11:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 39660 test clock-29.742 {time parsing} { clock scan {2440588 11:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 39660 test clock-29.743 {time parsing} { clock scan {2440588 11:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39660 test clock-29.744 {time parsing} { clock scan {2440588 11:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39660 test clock-29.745 {time parsing} { clock scan {2440588 11:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 39660 test clock-29.746 {time parsing} { clock scan {2440588 11:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 39660 test clock-29.747 {time parsing} { clock scan {2440588 11:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39660 test clock-29.748 {time parsing} { clock scan {2440588 11:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39660 test clock-29.749 {time parsing} { clock scan {2440588 xi:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 39660 test clock-29.750 {time parsing} { clock scan {2440588 xi:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 39660 test clock-29.751 {time parsing} { clock scan {2440588 xi:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39660 test clock-29.752 {time parsing} { clock scan {2440588 xi:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39660 test clock-29.753 {time parsing} { clock scan {2440588 xi:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 39660 test clock-29.754 {time parsing} { clock scan {2440588 xi:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 39660 test clock-29.755 {time parsing} { clock scan {2440588 xi:01:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39660 test clock-29.756 {time parsing} { clock scan {2440588 xi:i:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39660 test clock-29.757 {time parsing} { clock scan {2440588 11:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39661 test clock-29.758 {time parsing} { clock scan {2440588 11:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39661 test clock-29.759 {time parsing} { clock scan {2440588 11:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39661 test clock-29.760 {time parsing} { clock scan {2440588 11:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39661 test clock-29.761 {time parsing} { clock scan {2440588 xi:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39661 test clock-29.762 {time parsing} { clock scan {2440588 xi:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39661 test clock-29.763 {time parsing} { clock scan {2440588 xi:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39661 test clock-29.764 {time parsing} { clock scan {2440588 xi:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39661 test clock-29.765 {time parsing} { clock scan {2440588 11:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39661 test clock-29.766 {time parsing} { clock scan {2440588 11:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39661 test clock-29.767 {time parsing} { clock scan {2440588 11:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39661 test clock-29.768 {time parsing} { clock scan {2440588 11:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39661 test clock-29.769 {time parsing} { clock scan {2440588 xi:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39661 test clock-29.770 {time parsing} { clock scan {2440588 xi:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39661 test clock-29.771 {time parsing} { clock scan {2440588 xi:01:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39661 test clock-29.772 {time parsing} { clock scan {2440588 xi:i:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39661 test clock-29.773 {time parsing} { clock scan {2440588 11:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39661 test clock-29.774 {time parsing} { clock scan {2440588 11:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39661 test clock-29.775 {time parsing} { clock scan {2440588 11:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39661 test clock-29.776 {time parsing} { clock scan {2440588 11:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39661 test clock-29.777 {time parsing} { clock scan {2440588 xi:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39661 test clock-29.778 {time parsing} { clock scan {2440588 xi:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39661 test clock-29.779 {time parsing} { clock scan {2440588 xi:01:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39661 test clock-29.780 {time parsing} { clock scan {2440588 xi:i:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39661 test clock-29.781 {time parsing} { clock scan {2440588 11:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 39719 test clock-29.782 {time parsing} { clock scan {2440588 11:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 39719 test clock-29.783 {time parsing} { clock scan {2440588 11:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 39719 test clock-29.784 {time parsing} { clock scan {2440588 11:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 39719 test clock-29.785 {time parsing} { clock scan {2440588 xi:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 39719 test clock-29.786 {time parsing} { clock scan {2440588 xi:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 39719 test clock-29.787 {time parsing} { clock scan {2440588 xi:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 39719 test clock-29.788 {time parsing} { clock scan {2440588 xi:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 39719 test clock-29.789 {time parsing} { clock scan {2440588 11:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 39719 test clock-29.790 {time parsing} { clock scan {2440588 11:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 39719 test clock-29.791 {time parsing} { clock scan {2440588 11:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 39719 test clock-29.792 {time parsing} { clock scan {2440588 11:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 39719 test clock-29.793 {time parsing} { clock scan {2440588 xi:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 39719 test clock-29.794 {time parsing} { clock scan {2440588 xi:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 39719 test clock-29.795 {time parsing} { clock scan {2440588 xi:01:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 39719 test clock-29.796 {time parsing} { clock scan {2440588 xi:i:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 39719 test clock-29.797 {time parsing} { clock scan {2440588 11:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 39719 test clock-29.798 {time parsing} { clock scan {2440588 11:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 39719 test clock-29.799 {time parsing} { clock scan {2440588 11:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 39719 test clock-29.800 {time parsing} { clock scan {2440588 11:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 39719 test clock-29.801 {time parsing} { clock scan {2440588 xi:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 39719 test clock-29.802 {time parsing} { clock scan {2440588 xi:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 39719 test clock-29.803 {time parsing} { clock scan {2440588 xi:01:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 39719 test clock-29.804 {time parsing} { clock scan {2440588 xi:i:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 39719 test clock-29.805 {time parsing} { clock scan {2440588 11:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 43140 test clock-29.806 {time parsing} { clock scan {2440588 11:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 43140 test clock-29.807 {time parsing} { clock scan {2440588 11:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43140 test clock-29.808 {time parsing} { clock scan {2440588 11:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43140 test clock-29.809 {time parsing} { clock scan {2440588 11:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 43140 test clock-29.810 {time parsing} { clock scan {2440588 11:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 43140 test clock-29.811 {time parsing} { clock scan {2440588 11:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43140 test clock-29.812 {time parsing} { clock scan {2440588 11:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43140 test clock-29.813 {time parsing} { clock scan {2440588 xi:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 43140 test clock-29.814 {time parsing} { clock scan {2440588 xi:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 43140 test clock-29.815 {time parsing} { clock scan {2440588 xi:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43140 test clock-29.816 {time parsing} { clock scan {2440588 xi:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43140 test clock-29.817 {time parsing} { clock scan {2440588 xi:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 43140 test clock-29.818 {time parsing} { clock scan {2440588 xi:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 43140 test clock-29.819 {time parsing} { clock scan {2440588 xi:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43140 test clock-29.820 {time parsing} { clock scan {2440588 xi:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43140 test clock-29.821 {time parsing} { clock scan {2440588 11:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 43140 test clock-29.822 {time parsing} { clock scan {2440588 11:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 43140 test clock-29.823 {time parsing} { clock scan {2440588 11:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43140 test clock-29.824 {time parsing} { clock scan {2440588 11:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43140 test clock-29.825 {time parsing} { clock scan {2440588 11:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 43140 test clock-29.826 {time parsing} { clock scan {2440588 11:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 43140 test clock-29.827 {time parsing} { clock scan {2440588 11:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43140 test clock-29.828 {time parsing} { clock scan {2440588 11:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43140 test clock-29.829 {time parsing} { clock scan {2440588 xi:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 43140 test clock-29.830 {time parsing} { clock scan {2440588 xi:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 43140 test clock-29.831 {time parsing} { clock scan {2440588 xi:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43140 test clock-29.832 {time parsing} { clock scan {2440588 xi:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43140 test clock-29.833 {time parsing} { clock scan {2440588 xi:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 43140 test clock-29.834 {time parsing} { clock scan {2440588 xi:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 43140 test clock-29.835 {time parsing} { clock scan {2440588 xi:59:00 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43140 test clock-29.836 {time parsing} { clock scan {2440588 xi:lix:? AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43140 test clock-29.837 {time parsing} { clock scan {2440588 11:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 43140 test clock-29.838 {time parsing} { clock scan {2440588 11:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 43140 test clock-29.839 {time parsing} { clock scan {2440588 11:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43140 test clock-29.840 {time parsing} { clock scan {2440588 11:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43140 test clock-29.841 {time parsing} { clock scan {2440588 11:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 43140 test clock-29.842 {time parsing} { clock scan {2440588 11:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 43140 test clock-29.843 {time parsing} { clock scan {2440588 11:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43140 test clock-29.844 {time parsing} { clock scan {2440588 11:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43140 test clock-29.845 {time parsing} { clock scan {2440588 xi:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 43140 test clock-29.846 {time parsing} { clock scan {2440588 xi:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 43140 test clock-29.847 {time parsing} { clock scan {2440588 xi:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43140 test clock-29.848 {time parsing} { clock scan {2440588 xi:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43140 test clock-29.849 {time parsing} { clock scan {2440588 xi:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 43140 test clock-29.850 {time parsing} { clock scan {2440588 xi:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 43140 test clock-29.851 {time parsing} { clock scan {2440588 xi:59:00 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43140 test clock-29.852 {time parsing} { clock scan {2440588 xi:lix:? am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43140 test clock-29.853 {time parsing} { clock scan {2440588 11:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43141 test clock-29.854 {time parsing} { clock scan {2440588 11:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43141 test clock-29.855 {time parsing} { clock scan {2440588 11:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43141 test clock-29.856 {time parsing} { clock scan {2440588 11:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43141 test clock-29.857 {time parsing} { clock scan {2440588 xi:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43141 test clock-29.858 {time parsing} { clock scan {2440588 xi:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43141 test clock-29.859 {time parsing} { clock scan {2440588 xi:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43141 test clock-29.860 {time parsing} { clock scan {2440588 xi:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43141 test clock-29.861 {time parsing} { clock scan {2440588 11:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43141 test clock-29.862 {time parsing} { clock scan {2440588 11:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43141 test clock-29.863 {time parsing} { clock scan {2440588 11:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43141 test clock-29.864 {time parsing} { clock scan {2440588 11:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43141 test clock-29.865 {time parsing} { clock scan {2440588 xi:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43141 test clock-29.866 {time parsing} { clock scan {2440588 xi:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43141 test clock-29.867 {time parsing} { clock scan {2440588 xi:59:01 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43141 test clock-29.868 {time parsing} { clock scan {2440588 xi:lix:i AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43141 test clock-29.869 {time parsing} { clock scan {2440588 11:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43141 test clock-29.870 {time parsing} { clock scan {2440588 11:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43141 test clock-29.871 {time parsing} { clock scan {2440588 11:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43141 test clock-29.872 {time parsing} { clock scan {2440588 11:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43141 test clock-29.873 {time parsing} { clock scan {2440588 xi:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43141 test clock-29.874 {time parsing} { clock scan {2440588 xi:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43141 test clock-29.875 {time parsing} { clock scan {2440588 xi:59:01 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43141 test clock-29.876 {time parsing} { clock scan {2440588 xi:lix:i am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43141 test clock-29.877 {time parsing} { clock scan {2440588 11:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43199 test clock-29.878 {time parsing} { clock scan {2440588 11:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43199 test clock-29.879 {time parsing} { clock scan {2440588 11:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43199 test clock-29.880 {time parsing} { clock scan {2440588 11:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43199 test clock-29.881 {time parsing} { clock scan {2440588 xi:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43199 test clock-29.882 {time parsing} { clock scan {2440588 xi:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43199 test clock-29.883 {time parsing} { clock scan {2440588 xi:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43199 test clock-29.884 {time parsing} { clock scan {2440588 xi:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43199 test clock-29.885 {time parsing} { clock scan {2440588 11:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43199 test clock-29.886 {time parsing} { clock scan {2440588 11:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43199 test clock-29.887 {time parsing} { clock scan {2440588 11:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43199 test clock-29.888 {time parsing} { clock scan {2440588 11:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43199 test clock-29.889 {time parsing} { clock scan {2440588 xi:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43199 test clock-29.890 {time parsing} { clock scan {2440588 xi:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43199 test clock-29.891 {time parsing} { clock scan {2440588 xi:59:59 AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43199 test clock-29.892 {time parsing} { clock scan {2440588 xi:lix:lix AM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43199 test clock-29.893 {time parsing} { clock scan {2440588 11:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43199 test clock-29.894 {time parsing} { clock scan {2440588 11:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43199 test clock-29.895 {time parsing} { clock scan {2440588 11:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43199 test clock-29.896 {time parsing} { clock scan {2440588 11:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43199 test clock-29.897 {time parsing} { clock scan {2440588 xi:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43199 test clock-29.898 {time parsing} { clock scan {2440588 xi:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43199 test clock-29.899 {time parsing} { clock scan {2440588 xi:59:59 am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43199 test clock-29.900 {time parsing} { clock scan {2440588 xi:lix:lix am} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43199 test clock-29.901 {time parsing} { clock scan {2440588 12 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 43200 test clock-29.902 {time parsing} { clock scan {2440588 12:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 43200 test clock-29.903 {time parsing} { clock scan {2440588 12:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 43200 test clock-29.904 {time parsing} { clock scan {2440588 12:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43200 test clock-29.905 {time parsing} { clock scan {2440588 12:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43200 test clock-29.906 {time parsing} { clock scan {2440588 12 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 43200 test clock-29.907 {time parsing} { clock scan {2440588 12:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 43200 test clock-29.908 {time parsing} { clock scan {2440588 12:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 43200 test clock-29.909 {time parsing} { clock scan {2440588 12:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43200 test clock-29.910 {time parsing} { clock scan {2440588 12:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43200 test clock-29.911 {time parsing} { clock scan {2440588 xii } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 43200 test clock-29.912 {time parsing} { clock scan {2440588 xii:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 43200 test clock-29.913 {time parsing} { clock scan {2440588 xii:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 43200 test clock-29.914 {time parsing} { clock scan {2440588 xii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43200 test clock-29.915 {time parsing} { clock scan {2440588 xii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43200 test clock-29.916 {time parsing} { clock scan {2440588 xii } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 43200 test clock-29.917 {time parsing} { clock scan {2440588 xii:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 43200 test clock-29.918 {time parsing} { clock scan {2440588 xii:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 43200 test clock-29.919 {time parsing} { clock scan {2440588 xii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43200 test clock-29.920 {time parsing} { clock scan {2440588 xii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43200 test clock-29.921 {time parsing} { clock scan {2440588 12 PM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 43200 test clock-29.922 {time parsing} { clock scan {2440588 12:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 43200 test clock-29.923 {time parsing} { clock scan {2440588 12:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 43200 test clock-29.924 {time parsing} { clock scan {2440588 12:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43200 test clock-29.925 {time parsing} { clock scan {2440588 12:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43200 test clock-29.926 {time parsing} { clock scan {2440588 12 PM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 43200 test clock-29.927 {time parsing} { clock scan {2440588 12:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 43200 test clock-29.928 {time parsing} { clock scan {2440588 12:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 43200 test clock-29.929 {time parsing} { clock scan {2440588 12:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43200 test clock-29.930 {time parsing} { clock scan {2440588 12:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43200 test clock-29.931 {time parsing} { clock scan {2440588 xii PM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 43200 test clock-29.932 {time parsing} { clock scan {2440588 xii:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 43200 test clock-29.933 {time parsing} { clock scan {2440588 xii:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 43200 test clock-29.934 {time parsing} { clock scan {2440588 xii:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43200 test clock-29.935 {time parsing} { clock scan {2440588 xii:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43200 test clock-29.936 {time parsing} { clock scan {2440588 xii PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 43200 test clock-29.937 {time parsing} { clock scan {2440588 xii:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 43200 test clock-29.938 {time parsing} { clock scan {2440588 xii:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 43200 test clock-29.939 {time parsing} { clock scan {2440588 xii:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43200 test clock-29.940 {time parsing} { clock scan {2440588 xii:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43200 test clock-29.941 {time parsing} { clock scan {2440588 12 pm} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 43200 test clock-29.942 {time parsing} { clock scan {2440588 12:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 43200 test clock-29.943 {time parsing} { clock scan {2440588 12:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 43200 test clock-29.944 {time parsing} { clock scan {2440588 12:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43200 test clock-29.945 {time parsing} { clock scan {2440588 12:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43200 test clock-29.946 {time parsing} { clock scan {2440588 12 pm} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 43200 test clock-29.947 {time parsing} { clock scan {2440588 12:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 43200 test clock-29.948 {time parsing} { clock scan {2440588 12:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 43200 test clock-29.949 {time parsing} { clock scan {2440588 12:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43200 test clock-29.950 {time parsing} { clock scan {2440588 12:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43200 test clock-29.951 {time parsing} { clock scan {2440588 xii pm} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 43200 test clock-29.952 {time parsing} { clock scan {2440588 xii:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 43200 test clock-29.953 {time parsing} { clock scan {2440588 xii:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 43200 test clock-29.954 {time parsing} { clock scan {2440588 xii:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43200 test clock-29.955 {time parsing} { clock scan {2440588 xii:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43200 test clock-29.956 {time parsing} { clock scan {2440588 xii pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 43200 test clock-29.957 {time parsing} { clock scan {2440588 xii:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 43200 test clock-29.958 {time parsing} { clock scan {2440588 xii:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 43200 test clock-29.959 {time parsing} { clock scan {2440588 xii:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43200 test clock-29.960 {time parsing} { clock scan {2440588 xii:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43200 test clock-29.961 {time parsing} { clock scan {2440588 12:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43201 test clock-29.962 {time parsing} { clock scan {2440588 12:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43201 test clock-29.963 {time parsing} { clock scan {2440588 12:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43201 test clock-29.964 {time parsing} { clock scan {2440588 12:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43201 test clock-29.965 {time parsing} { clock scan {2440588 xii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43201 test clock-29.966 {time parsing} { clock scan {2440588 xii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43201 test clock-29.967 {time parsing} { clock scan {2440588 xii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43201 test clock-29.968 {time parsing} { clock scan {2440588 xii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43201 test clock-29.969 {time parsing} { clock scan {2440588 12:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43201 test clock-29.970 {time parsing} { clock scan {2440588 12:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43201 test clock-29.971 {time parsing} { clock scan {2440588 12:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43201 test clock-29.972 {time parsing} { clock scan {2440588 12:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43201 test clock-29.973 {time parsing} { clock scan {2440588 xii:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43201 test clock-29.974 {time parsing} { clock scan {2440588 xii:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43201 test clock-29.975 {time parsing} { clock scan {2440588 xii:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43201 test clock-29.976 {time parsing} { clock scan {2440588 xii:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43201 test clock-29.977 {time parsing} { clock scan {2440588 12:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43201 test clock-29.978 {time parsing} { clock scan {2440588 12:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43201 test clock-29.979 {time parsing} { clock scan {2440588 12:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43201 test clock-29.980 {time parsing} { clock scan {2440588 12:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43201 test clock-29.981 {time parsing} { clock scan {2440588 xii:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43201 test clock-29.982 {time parsing} { clock scan {2440588 xii:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43201 test clock-29.983 {time parsing} { clock scan {2440588 xii:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43201 test clock-29.984 {time parsing} { clock scan {2440588 xii:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43201 test clock-29.985 {time parsing} { clock scan {2440588 12:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43259 test clock-29.986 {time parsing} { clock scan {2440588 12:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43259 test clock-29.987 {time parsing} { clock scan {2440588 12:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43259 test clock-29.988 {time parsing} { clock scan {2440588 12:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43259 test clock-29.989 {time parsing} { clock scan {2440588 xii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43259 test clock-29.990 {time parsing} { clock scan {2440588 xii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43259 test clock-29.991 {time parsing} { clock scan {2440588 xii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43259 test clock-29.992 {time parsing} { clock scan {2440588 xii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43259 test clock-29.993 {time parsing} { clock scan {2440588 12:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43259 test clock-29.994 {time parsing} { clock scan {2440588 12:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43259 test clock-29.995 {time parsing} { clock scan {2440588 12:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43259 test clock-29.996 {time parsing} { clock scan {2440588 12:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43259 test clock-29.997 {time parsing} { clock scan {2440588 xii:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43259 test clock-29.998 {time parsing} { clock scan {2440588 xii:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43259 test clock-29.999 {time parsing} { clock scan {2440588 xii:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43259 test clock-29.1000 {time parsing} { clock scan {2440588 xii:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43259 test clock-29.1001 {time parsing} { clock scan {2440588 12:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43259 test clock-29.1002 {time parsing} { clock scan {2440588 12:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43259 test clock-29.1003 {time parsing} { clock scan {2440588 12:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43259 test clock-29.1004 {time parsing} { clock scan {2440588 12:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43259 test clock-29.1005 {time parsing} { clock scan {2440588 xii:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43259 test clock-29.1006 {time parsing} { clock scan {2440588 xii:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43259 test clock-29.1007 {time parsing} { clock scan {2440588 xii:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43259 test clock-29.1008 {time parsing} { clock scan {2440588 xii:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43259 test clock-29.1009 {time parsing} { clock scan {2440588 12:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 43260 test clock-29.1010 {time parsing} { clock scan {2440588 12:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 43260 test clock-29.1011 {time parsing} { clock scan {2440588 12:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43260 test clock-29.1012 {time parsing} { clock scan {2440588 12:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43260 test clock-29.1013 {time parsing} { clock scan {2440588 12:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 43260 test clock-29.1014 {time parsing} { clock scan {2440588 12:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 43260 test clock-29.1015 {time parsing} { clock scan {2440588 12:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43260 test clock-29.1016 {time parsing} { clock scan {2440588 12:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43260 test clock-29.1017 {time parsing} { clock scan {2440588 xii:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 43260 test clock-29.1018 {time parsing} { clock scan {2440588 xii:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 43260 test clock-29.1019 {time parsing} { clock scan {2440588 xii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43260 test clock-29.1020 {time parsing} { clock scan {2440588 xii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43260 test clock-29.1021 {time parsing} { clock scan {2440588 xii:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 43260 test clock-29.1022 {time parsing} { clock scan {2440588 xii:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 43260 test clock-29.1023 {time parsing} { clock scan {2440588 xii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43260 test clock-29.1024 {time parsing} { clock scan {2440588 xii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43260 test clock-29.1025 {time parsing} { clock scan {2440588 12:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 43260 test clock-29.1026 {time parsing} { clock scan {2440588 12:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 43260 test clock-29.1027 {time parsing} { clock scan {2440588 12:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43260 test clock-29.1028 {time parsing} { clock scan {2440588 12:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43260 test clock-29.1029 {time parsing} { clock scan {2440588 12:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 43260 test clock-29.1030 {time parsing} { clock scan {2440588 12:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 43260 test clock-29.1031 {time parsing} { clock scan {2440588 12:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43260 test clock-29.1032 {time parsing} { clock scan {2440588 12:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43260 test clock-29.1033 {time parsing} { clock scan {2440588 xii:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 43260 test clock-29.1034 {time parsing} { clock scan {2440588 xii:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 43260 test clock-29.1035 {time parsing} { clock scan {2440588 xii:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43260 test clock-29.1036 {time parsing} { clock scan {2440588 xii:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43260 test clock-29.1037 {time parsing} { clock scan {2440588 xii:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 43260 test clock-29.1038 {time parsing} { clock scan {2440588 xii:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 43260 test clock-29.1039 {time parsing} { clock scan {2440588 xii:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43260 test clock-29.1040 {time parsing} { clock scan {2440588 xii:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43260 test clock-29.1041 {time parsing} { clock scan {2440588 12:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 43260 test clock-29.1042 {time parsing} { clock scan {2440588 12:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 43260 test clock-29.1043 {time parsing} { clock scan {2440588 12:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43260 test clock-29.1044 {time parsing} { clock scan {2440588 12:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43260 test clock-29.1045 {time parsing} { clock scan {2440588 12:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 43260 test clock-29.1046 {time parsing} { clock scan {2440588 12:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 43260 test clock-29.1047 {time parsing} { clock scan {2440588 12:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43260 test clock-29.1048 {time parsing} { clock scan {2440588 12:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43260 test clock-29.1049 {time parsing} { clock scan {2440588 xii:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 43260 test clock-29.1050 {time parsing} { clock scan {2440588 xii:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 43260 test clock-29.1051 {time parsing} { clock scan {2440588 xii:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43260 test clock-29.1052 {time parsing} { clock scan {2440588 xii:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43260 test clock-29.1053 {time parsing} { clock scan {2440588 xii:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 43260 test clock-29.1054 {time parsing} { clock scan {2440588 xii:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 43260 test clock-29.1055 {time parsing} { clock scan {2440588 xii:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43260 test clock-29.1056 {time parsing} { clock scan {2440588 xii:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43260 test clock-29.1057 {time parsing} { clock scan {2440588 12:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43261 test clock-29.1058 {time parsing} { clock scan {2440588 12:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43261 test clock-29.1059 {time parsing} { clock scan {2440588 12:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43261 test clock-29.1060 {time parsing} { clock scan {2440588 12:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43261 test clock-29.1061 {time parsing} { clock scan {2440588 xii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43261 test clock-29.1062 {time parsing} { clock scan {2440588 xii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43261 test clock-29.1063 {time parsing} { clock scan {2440588 xii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43261 test clock-29.1064 {time parsing} { clock scan {2440588 xii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43261 test clock-29.1065 {time parsing} { clock scan {2440588 12:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43261 test clock-29.1066 {time parsing} { clock scan {2440588 12:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43261 test clock-29.1067 {time parsing} { clock scan {2440588 12:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43261 test clock-29.1068 {time parsing} { clock scan {2440588 12:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43261 test clock-29.1069 {time parsing} { clock scan {2440588 xii:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43261 test clock-29.1070 {time parsing} { clock scan {2440588 xii:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43261 test clock-29.1071 {time parsing} { clock scan {2440588 xii:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43261 test clock-29.1072 {time parsing} { clock scan {2440588 xii:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43261 test clock-29.1073 {time parsing} { clock scan {2440588 12:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43261 test clock-29.1074 {time parsing} { clock scan {2440588 12:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43261 test clock-29.1075 {time parsing} { clock scan {2440588 12:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43261 test clock-29.1076 {time parsing} { clock scan {2440588 12:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43261 test clock-29.1077 {time parsing} { clock scan {2440588 xii:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43261 test clock-29.1078 {time parsing} { clock scan {2440588 xii:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43261 test clock-29.1079 {time parsing} { clock scan {2440588 xii:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43261 test clock-29.1080 {time parsing} { clock scan {2440588 xii:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43261 test clock-29.1081 {time parsing} { clock scan {2440588 12:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 43319 test clock-29.1082 {time parsing} { clock scan {2440588 12:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 43319 test clock-29.1083 {time parsing} { clock scan {2440588 12:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 43319 test clock-29.1084 {time parsing} { clock scan {2440588 12:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 43319 test clock-29.1085 {time parsing} { clock scan {2440588 xii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 43319 test clock-29.1086 {time parsing} { clock scan {2440588 xii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 43319 test clock-29.1087 {time parsing} { clock scan {2440588 xii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 43319 test clock-29.1088 {time parsing} { clock scan {2440588 xii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 43319 test clock-29.1089 {time parsing} { clock scan {2440588 12:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 43319 test clock-29.1090 {time parsing} { clock scan {2440588 12:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 43319 test clock-29.1091 {time parsing} { clock scan {2440588 12:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 43319 test clock-29.1092 {time parsing} { clock scan {2440588 12:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 43319 test clock-29.1093 {time parsing} { clock scan {2440588 xii:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 43319 test clock-29.1094 {time parsing} { clock scan {2440588 xii:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 43319 test clock-29.1095 {time parsing} { clock scan {2440588 xii:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 43319 test clock-29.1096 {time parsing} { clock scan {2440588 xii:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 43319 test clock-29.1097 {time parsing} { clock scan {2440588 12:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 43319 test clock-29.1098 {time parsing} { clock scan {2440588 12:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 43319 test clock-29.1099 {time parsing} { clock scan {2440588 12:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 43319 test clock-29.1100 {time parsing} { clock scan {2440588 12:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 43319 test clock-29.1101 {time parsing} { clock scan {2440588 xii:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 43319 test clock-29.1102 {time parsing} { clock scan {2440588 xii:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 43319 test clock-29.1103 {time parsing} { clock scan {2440588 xii:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 43319 test clock-29.1104 {time parsing} { clock scan {2440588 xii:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 43319 test clock-29.1105 {time parsing} { clock scan {2440588 12:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 46740 test clock-29.1106 {time parsing} { clock scan {2440588 12:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 46740 test clock-29.1107 {time parsing} { clock scan {2440588 12:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46740 test clock-29.1108 {time parsing} { clock scan {2440588 12:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46740 test clock-29.1109 {time parsing} { clock scan {2440588 12:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 46740 test clock-29.1110 {time parsing} { clock scan {2440588 12:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 46740 test clock-29.1111 {time parsing} { clock scan {2440588 12:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46740 test clock-29.1112 {time parsing} { clock scan {2440588 12:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46740 test clock-29.1113 {time parsing} { clock scan {2440588 xii:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 46740 test clock-29.1114 {time parsing} { clock scan {2440588 xii:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 46740 test clock-29.1115 {time parsing} { clock scan {2440588 xii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46740 test clock-29.1116 {time parsing} { clock scan {2440588 xii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46740 test clock-29.1117 {time parsing} { clock scan {2440588 xii:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 46740 test clock-29.1118 {time parsing} { clock scan {2440588 xii:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 46740 test clock-29.1119 {time parsing} { clock scan {2440588 xii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46740 test clock-29.1120 {time parsing} { clock scan {2440588 xii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46740 test clock-29.1121 {time parsing} { clock scan {2440588 12:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 46740 test clock-29.1122 {time parsing} { clock scan {2440588 12:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 46740 test clock-29.1123 {time parsing} { clock scan {2440588 12:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46740 test clock-29.1124 {time parsing} { clock scan {2440588 12:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46740 test clock-29.1125 {time parsing} { clock scan {2440588 12:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 46740 test clock-29.1126 {time parsing} { clock scan {2440588 12:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 46740 test clock-29.1127 {time parsing} { clock scan {2440588 12:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46740 test clock-29.1128 {time parsing} { clock scan {2440588 12:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46740 test clock-29.1129 {time parsing} { clock scan {2440588 xii:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 46740 test clock-29.1130 {time parsing} { clock scan {2440588 xii:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 46740 test clock-29.1131 {time parsing} { clock scan {2440588 xii:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46740 test clock-29.1132 {time parsing} { clock scan {2440588 xii:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46740 test clock-29.1133 {time parsing} { clock scan {2440588 xii:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 46740 test clock-29.1134 {time parsing} { clock scan {2440588 xii:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 46740 test clock-29.1135 {time parsing} { clock scan {2440588 xii:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46740 test clock-29.1136 {time parsing} { clock scan {2440588 xii:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46740 test clock-29.1137 {time parsing} { clock scan {2440588 12:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 46740 test clock-29.1138 {time parsing} { clock scan {2440588 12:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 46740 test clock-29.1139 {time parsing} { clock scan {2440588 12:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46740 test clock-29.1140 {time parsing} { clock scan {2440588 12:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46740 test clock-29.1141 {time parsing} { clock scan {2440588 12:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 46740 test clock-29.1142 {time parsing} { clock scan {2440588 12:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 46740 test clock-29.1143 {time parsing} { clock scan {2440588 12:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46740 test clock-29.1144 {time parsing} { clock scan {2440588 12:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46740 test clock-29.1145 {time parsing} { clock scan {2440588 xii:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 46740 test clock-29.1146 {time parsing} { clock scan {2440588 xii:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 46740 test clock-29.1147 {time parsing} { clock scan {2440588 xii:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46740 test clock-29.1148 {time parsing} { clock scan {2440588 xii:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46740 test clock-29.1149 {time parsing} { clock scan {2440588 xii:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 46740 test clock-29.1150 {time parsing} { clock scan {2440588 xii:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 46740 test clock-29.1151 {time parsing} { clock scan {2440588 xii:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46740 test clock-29.1152 {time parsing} { clock scan {2440588 xii:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46740 test clock-29.1153 {time parsing} { clock scan {2440588 12:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46741 test clock-29.1154 {time parsing} { clock scan {2440588 12:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46741 test clock-29.1155 {time parsing} { clock scan {2440588 12:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46741 test clock-29.1156 {time parsing} { clock scan {2440588 12:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46741 test clock-29.1157 {time parsing} { clock scan {2440588 xii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46741 test clock-29.1158 {time parsing} { clock scan {2440588 xii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46741 test clock-29.1159 {time parsing} { clock scan {2440588 xii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46741 test clock-29.1160 {time parsing} { clock scan {2440588 xii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46741 test clock-29.1161 {time parsing} { clock scan {2440588 12:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46741 test clock-29.1162 {time parsing} { clock scan {2440588 12:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46741 test clock-29.1163 {time parsing} { clock scan {2440588 12:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46741 test clock-29.1164 {time parsing} { clock scan {2440588 12:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46741 test clock-29.1165 {time parsing} { clock scan {2440588 xii:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46741 test clock-29.1166 {time parsing} { clock scan {2440588 xii:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46741 test clock-29.1167 {time parsing} { clock scan {2440588 xii:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46741 test clock-29.1168 {time parsing} { clock scan {2440588 xii:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46741 test clock-29.1169 {time parsing} { clock scan {2440588 12:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46741 test clock-29.1170 {time parsing} { clock scan {2440588 12:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46741 test clock-29.1171 {time parsing} { clock scan {2440588 12:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46741 test clock-29.1172 {time parsing} { clock scan {2440588 12:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46741 test clock-29.1173 {time parsing} { clock scan {2440588 xii:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46741 test clock-29.1174 {time parsing} { clock scan {2440588 xii:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46741 test clock-29.1175 {time parsing} { clock scan {2440588 xii:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46741 test clock-29.1176 {time parsing} { clock scan {2440588 xii:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46741 test clock-29.1177 {time parsing} { clock scan {2440588 12:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46799 test clock-29.1178 {time parsing} { clock scan {2440588 12:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46799 test clock-29.1179 {time parsing} { clock scan {2440588 12:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46799 test clock-29.1180 {time parsing} { clock scan {2440588 12:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46799 test clock-29.1181 {time parsing} { clock scan {2440588 xii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46799 test clock-29.1182 {time parsing} { clock scan {2440588 xii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46799 test clock-29.1183 {time parsing} { clock scan {2440588 xii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46799 test clock-29.1184 {time parsing} { clock scan {2440588 xii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46799 test clock-29.1185 {time parsing} { clock scan {2440588 12:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46799 test clock-29.1186 {time parsing} { clock scan {2440588 12:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46799 test clock-29.1187 {time parsing} { clock scan {2440588 12:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46799 test clock-29.1188 {time parsing} { clock scan {2440588 12:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46799 test clock-29.1189 {time parsing} { clock scan {2440588 xii:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46799 test clock-29.1190 {time parsing} { clock scan {2440588 xii:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46799 test clock-29.1191 {time parsing} { clock scan {2440588 xii:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46799 test clock-29.1192 {time parsing} { clock scan {2440588 xii:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46799 test clock-29.1193 {time parsing} { clock scan {2440588 12:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46799 test clock-29.1194 {time parsing} { clock scan {2440588 12:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46799 test clock-29.1195 {time parsing} { clock scan {2440588 12:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46799 test clock-29.1196 {time parsing} { clock scan {2440588 12:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46799 test clock-29.1197 {time parsing} { clock scan {2440588 xii:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46799 test clock-29.1198 {time parsing} { clock scan {2440588 xii:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46799 test clock-29.1199 {time parsing} { clock scan {2440588 xii:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46799 test clock-29.1200 {time parsing} { clock scan {2440588 xii:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46799 test clock-29.1201 {time parsing} { clock scan {2440588 13 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 46800 test clock-29.1202 {time parsing} { clock scan {2440588 13:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 46800 test clock-29.1203 {time parsing} { clock scan {2440588 13:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 46800 test clock-29.1204 {time parsing} { clock scan {2440588 13:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46800 test clock-29.1205 {time parsing} { clock scan {2440588 13:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46800 test clock-29.1206 {time parsing} { clock scan {2440588 13 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 46800 test clock-29.1207 {time parsing} { clock scan {2440588 13:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 46800 test clock-29.1208 {time parsing} { clock scan {2440588 13:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 46800 test clock-29.1209 {time parsing} { clock scan {2440588 13:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46800 test clock-29.1210 {time parsing} { clock scan {2440588 13:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46800 test clock-29.1211 {time parsing} { clock scan {2440588 xiii } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 46800 test clock-29.1212 {time parsing} { clock scan {2440588 xiii:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 46800 test clock-29.1213 {time parsing} { clock scan {2440588 xiii:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 46800 test clock-29.1214 {time parsing} { clock scan {2440588 xiii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46800 test clock-29.1215 {time parsing} { clock scan {2440588 xiii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46800 test clock-29.1216 {time parsing} { clock scan {2440588 xiii } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 46800 test clock-29.1217 {time parsing} { clock scan {2440588 xiii:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 46800 test clock-29.1218 {time parsing} { clock scan {2440588 xiii:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 46800 test clock-29.1219 {time parsing} { clock scan {2440588 xiii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46800 test clock-29.1220 {time parsing} { clock scan {2440588 xiii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46800 test clock-29.1221 {time parsing} { clock scan {2440588 01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 46800 test clock-29.1222 {time parsing} { clock scan {2440588 01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 46800 test clock-29.1223 {time parsing} { clock scan {2440588 01:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 46800 test clock-29.1224 {time parsing} { clock scan {2440588 01:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46800 test clock-29.1225 {time parsing} { clock scan {2440588 01:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46800 test clock-29.1226 {time parsing} { clock scan {2440588 1 PM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 46800 test clock-29.1227 {time parsing} { clock scan {2440588 1:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 46800 test clock-29.1228 {time parsing} { clock scan {2440588 1:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 46800 test clock-29.1229 {time parsing} { clock scan {2440588 1:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46800 test clock-29.1230 {time parsing} { clock scan {2440588 1:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46800 test clock-29.1231 {time parsing} { clock scan {2440588 i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 46800 test clock-29.1232 {time parsing} { clock scan {2440588 i:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 46800 test clock-29.1233 {time parsing} { clock scan {2440588 i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 46800 test clock-29.1234 {time parsing} { clock scan {2440588 i:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46800 test clock-29.1235 {time parsing} { clock scan {2440588 i:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46800 test clock-29.1236 {time parsing} { clock scan {2440588 i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 46800 test clock-29.1237 {time parsing} { clock scan {2440588 i:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 46800 test clock-29.1238 {time parsing} { clock scan {2440588 i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 46800 test clock-29.1239 {time parsing} { clock scan {2440588 i:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46800 test clock-29.1240 {time parsing} { clock scan {2440588 i:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46800 test clock-29.1241 {time parsing} { clock scan {2440588 01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 46800 test clock-29.1242 {time parsing} { clock scan {2440588 01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 46800 test clock-29.1243 {time parsing} { clock scan {2440588 01:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 46800 test clock-29.1244 {time parsing} { clock scan {2440588 01:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46800 test clock-29.1245 {time parsing} { clock scan {2440588 01:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46800 test clock-29.1246 {time parsing} { clock scan {2440588 1 pm} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 46800 test clock-29.1247 {time parsing} { clock scan {2440588 1:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 46800 test clock-29.1248 {time parsing} { clock scan {2440588 1:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 46800 test clock-29.1249 {time parsing} { clock scan {2440588 1:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46800 test clock-29.1250 {time parsing} { clock scan {2440588 1:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46800 test clock-29.1251 {time parsing} { clock scan {2440588 i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 46800 test clock-29.1252 {time parsing} { clock scan {2440588 i:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 46800 test clock-29.1253 {time parsing} { clock scan {2440588 i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 46800 test clock-29.1254 {time parsing} { clock scan {2440588 i:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46800 test clock-29.1255 {time parsing} { clock scan {2440588 i:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46800 test clock-29.1256 {time parsing} { clock scan {2440588 i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 46800 test clock-29.1257 {time parsing} { clock scan {2440588 i:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 46800 test clock-29.1258 {time parsing} { clock scan {2440588 i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 46800 test clock-29.1259 {time parsing} { clock scan {2440588 i:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46800 test clock-29.1260 {time parsing} { clock scan {2440588 i:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46800 test clock-29.1261 {time parsing} { clock scan {2440588 13:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46801 test clock-29.1262 {time parsing} { clock scan {2440588 13:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46801 test clock-29.1263 {time parsing} { clock scan {2440588 13:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46801 test clock-29.1264 {time parsing} { clock scan {2440588 13:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46801 test clock-29.1265 {time parsing} { clock scan {2440588 xiii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46801 test clock-29.1266 {time parsing} { clock scan {2440588 xiii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46801 test clock-29.1267 {time parsing} { clock scan {2440588 xiii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46801 test clock-29.1268 {time parsing} { clock scan {2440588 xiii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46801 test clock-29.1269 {time parsing} { clock scan {2440588 01:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46801 test clock-29.1270 {time parsing} { clock scan {2440588 01:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46801 test clock-29.1271 {time parsing} { clock scan {2440588 1:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46801 test clock-29.1272 {time parsing} { clock scan {2440588 1:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46801 test clock-29.1273 {time parsing} { clock scan {2440588 i:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46801 test clock-29.1274 {time parsing} { clock scan {2440588 i:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46801 test clock-29.1275 {time parsing} { clock scan {2440588 i:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46801 test clock-29.1276 {time parsing} { clock scan {2440588 i:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46801 test clock-29.1277 {time parsing} { clock scan {2440588 01:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46801 test clock-29.1278 {time parsing} { clock scan {2440588 01:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46801 test clock-29.1279 {time parsing} { clock scan {2440588 1:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46801 test clock-29.1280 {time parsing} { clock scan {2440588 1:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46801 test clock-29.1281 {time parsing} { clock scan {2440588 i:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46801 test clock-29.1282 {time parsing} { clock scan {2440588 i:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46801 test clock-29.1283 {time parsing} { clock scan {2440588 i:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46801 test clock-29.1284 {time parsing} { clock scan {2440588 i:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46801 test clock-29.1285 {time parsing} { clock scan {2440588 13:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46859 test clock-29.1286 {time parsing} { clock scan {2440588 13:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46859 test clock-29.1287 {time parsing} { clock scan {2440588 13:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46859 test clock-29.1288 {time parsing} { clock scan {2440588 13:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46859 test clock-29.1289 {time parsing} { clock scan {2440588 xiii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46859 test clock-29.1290 {time parsing} { clock scan {2440588 xiii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46859 test clock-29.1291 {time parsing} { clock scan {2440588 xiii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46859 test clock-29.1292 {time parsing} { clock scan {2440588 xiii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46859 test clock-29.1293 {time parsing} { clock scan {2440588 01:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46859 test clock-29.1294 {time parsing} { clock scan {2440588 01:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46859 test clock-29.1295 {time parsing} { clock scan {2440588 1:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46859 test clock-29.1296 {time parsing} { clock scan {2440588 1:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46859 test clock-29.1297 {time parsing} { clock scan {2440588 i:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46859 test clock-29.1298 {time parsing} { clock scan {2440588 i:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46859 test clock-29.1299 {time parsing} { clock scan {2440588 i:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46859 test clock-29.1300 {time parsing} { clock scan {2440588 i:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46859 test clock-29.1301 {time parsing} { clock scan {2440588 01:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46859 test clock-29.1302 {time parsing} { clock scan {2440588 01:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46859 test clock-29.1303 {time parsing} { clock scan {2440588 1:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46859 test clock-29.1304 {time parsing} { clock scan {2440588 1:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46859 test clock-29.1305 {time parsing} { clock scan {2440588 i:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46859 test clock-29.1306 {time parsing} { clock scan {2440588 i:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46859 test clock-29.1307 {time parsing} { clock scan {2440588 i:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46859 test clock-29.1308 {time parsing} { clock scan {2440588 i:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46859 test clock-29.1309 {time parsing} { clock scan {2440588 13:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 46860 test clock-29.1310 {time parsing} { clock scan {2440588 13:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 46860 test clock-29.1311 {time parsing} { clock scan {2440588 13:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46860 test clock-29.1312 {time parsing} { clock scan {2440588 13:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46860 test clock-29.1313 {time parsing} { clock scan {2440588 13:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 46860 test clock-29.1314 {time parsing} { clock scan {2440588 13:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 46860 test clock-29.1315 {time parsing} { clock scan {2440588 13:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46860 test clock-29.1316 {time parsing} { clock scan {2440588 13:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46860 test clock-29.1317 {time parsing} { clock scan {2440588 xiii:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 46860 test clock-29.1318 {time parsing} { clock scan {2440588 xiii:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 46860 test clock-29.1319 {time parsing} { clock scan {2440588 xiii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46860 test clock-29.1320 {time parsing} { clock scan {2440588 xiii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46860 test clock-29.1321 {time parsing} { clock scan {2440588 xiii:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 46860 test clock-29.1322 {time parsing} { clock scan {2440588 xiii:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 46860 test clock-29.1323 {time parsing} { clock scan {2440588 xiii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46860 test clock-29.1324 {time parsing} { clock scan {2440588 xiii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46860 test clock-29.1325 {time parsing} { clock scan {2440588 01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 46860 test clock-29.1326 {time parsing} { clock scan {2440588 01:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 46860 test clock-29.1327 {time parsing} { clock scan {2440588 01:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46860 test clock-29.1328 {time parsing} { clock scan {2440588 01:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46860 test clock-29.1329 {time parsing} { clock scan {2440588 1:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 46860 test clock-29.1330 {time parsing} { clock scan {2440588 1:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 46860 test clock-29.1331 {time parsing} { clock scan {2440588 1:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46860 test clock-29.1332 {time parsing} { clock scan {2440588 1:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46860 test clock-29.1333 {time parsing} { clock scan {2440588 i:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 46860 test clock-29.1334 {time parsing} { clock scan {2440588 i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 46860 test clock-29.1335 {time parsing} { clock scan {2440588 i:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46860 test clock-29.1336 {time parsing} { clock scan {2440588 i:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46860 test clock-29.1337 {time parsing} { clock scan {2440588 i:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 46860 test clock-29.1338 {time parsing} { clock scan {2440588 i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 46860 test clock-29.1339 {time parsing} { clock scan {2440588 i:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46860 test clock-29.1340 {time parsing} { clock scan {2440588 i:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46860 test clock-29.1341 {time parsing} { clock scan {2440588 01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 46860 test clock-29.1342 {time parsing} { clock scan {2440588 01:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 46860 test clock-29.1343 {time parsing} { clock scan {2440588 01:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46860 test clock-29.1344 {time parsing} { clock scan {2440588 01:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46860 test clock-29.1345 {time parsing} { clock scan {2440588 1:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 46860 test clock-29.1346 {time parsing} { clock scan {2440588 1:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 46860 test clock-29.1347 {time parsing} { clock scan {2440588 1:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46860 test clock-29.1348 {time parsing} { clock scan {2440588 1:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46860 test clock-29.1349 {time parsing} { clock scan {2440588 i:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 46860 test clock-29.1350 {time parsing} { clock scan {2440588 i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 46860 test clock-29.1351 {time parsing} { clock scan {2440588 i:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46860 test clock-29.1352 {time parsing} { clock scan {2440588 i:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46860 test clock-29.1353 {time parsing} { clock scan {2440588 i:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 46860 test clock-29.1354 {time parsing} { clock scan {2440588 i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 46860 test clock-29.1355 {time parsing} { clock scan {2440588 i:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46860 test clock-29.1356 {time parsing} { clock scan {2440588 i:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46860 test clock-29.1357 {time parsing} { clock scan {2440588 13:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46861 test clock-29.1358 {time parsing} { clock scan {2440588 13:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46861 test clock-29.1359 {time parsing} { clock scan {2440588 13:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46861 test clock-29.1360 {time parsing} { clock scan {2440588 13:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46861 test clock-29.1361 {time parsing} { clock scan {2440588 xiii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46861 test clock-29.1362 {time parsing} { clock scan {2440588 xiii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46861 test clock-29.1363 {time parsing} { clock scan {2440588 xiii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46861 test clock-29.1364 {time parsing} { clock scan {2440588 xiii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46861 test clock-29.1365 {time parsing} { clock scan {2440588 01:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46861 test clock-29.1366 {time parsing} { clock scan {2440588 01:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46861 test clock-29.1367 {time parsing} { clock scan {2440588 1:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46861 test clock-29.1368 {time parsing} { clock scan {2440588 1:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46861 test clock-29.1369 {time parsing} { clock scan {2440588 i:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46861 test clock-29.1370 {time parsing} { clock scan {2440588 i:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46861 test clock-29.1371 {time parsing} { clock scan {2440588 i:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46861 test clock-29.1372 {time parsing} { clock scan {2440588 i:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46861 test clock-29.1373 {time parsing} { clock scan {2440588 01:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46861 test clock-29.1374 {time parsing} { clock scan {2440588 01:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46861 test clock-29.1375 {time parsing} { clock scan {2440588 1:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46861 test clock-29.1376 {time parsing} { clock scan {2440588 1:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46861 test clock-29.1377 {time parsing} { clock scan {2440588 i:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46861 test clock-29.1378 {time parsing} { clock scan {2440588 i:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46861 test clock-29.1379 {time parsing} { clock scan {2440588 i:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46861 test clock-29.1380 {time parsing} { clock scan {2440588 i:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46861 test clock-29.1381 {time parsing} { clock scan {2440588 13:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 46919 test clock-29.1382 {time parsing} { clock scan {2440588 13:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 46919 test clock-29.1383 {time parsing} { clock scan {2440588 13:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 46919 test clock-29.1384 {time parsing} { clock scan {2440588 13:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 46919 test clock-29.1385 {time parsing} { clock scan {2440588 xiii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 46919 test clock-29.1386 {time parsing} { clock scan {2440588 xiii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 46919 test clock-29.1387 {time parsing} { clock scan {2440588 xiii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 46919 test clock-29.1388 {time parsing} { clock scan {2440588 xiii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 46919 test clock-29.1389 {time parsing} { clock scan {2440588 01:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 46919 test clock-29.1390 {time parsing} { clock scan {2440588 01:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 46919 test clock-29.1391 {time parsing} { clock scan {2440588 1:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 46919 test clock-29.1392 {time parsing} { clock scan {2440588 1:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 46919 test clock-29.1393 {time parsing} { clock scan {2440588 i:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 46919 test clock-29.1394 {time parsing} { clock scan {2440588 i:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 46919 test clock-29.1395 {time parsing} { clock scan {2440588 i:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 46919 test clock-29.1396 {time parsing} { clock scan {2440588 i:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 46919 test clock-29.1397 {time parsing} { clock scan {2440588 01:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 46919 test clock-29.1398 {time parsing} { clock scan {2440588 01:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 46919 test clock-29.1399 {time parsing} { clock scan {2440588 1:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 46919 test clock-29.1400 {time parsing} { clock scan {2440588 1:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 46919 test clock-29.1401 {time parsing} { clock scan {2440588 i:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 46919 test clock-29.1402 {time parsing} { clock scan {2440588 i:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 46919 test clock-29.1403 {time parsing} { clock scan {2440588 i:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 46919 test clock-29.1404 {time parsing} { clock scan {2440588 i:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 46919 test clock-29.1405 {time parsing} { clock scan {2440588 13:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 50340 test clock-29.1406 {time parsing} { clock scan {2440588 13:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 50340 test clock-29.1407 {time parsing} { clock scan {2440588 13:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 50340 test clock-29.1408 {time parsing} { clock scan {2440588 13:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 50340 test clock-29.1409 {time parsing} { clock scan {2440588 13:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 50340 test clock-29.1410 {time parsing} { clock scan {2440588 13:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 50340 test clock-29.1411 {time parsing} { clock scan {2440588 13:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 50340 test clock-29.1412 {time parsing} { clock scan {2440588 13:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 50340 test clock-29.1413 {time parsing} { clock scan {2440588 xiii:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 50340 test clock-29.1414 {time parsing} { clock scan {2440588 xiii:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 50340 test clock-29.1415 {time parsing} { clock scan {2440588 xiii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 50340 test clock-29.1416 {time parsing} { clock scan {2440588 xiii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 50340 test clock-29.1417 {time parsing} { clock scan {2440588 xiii:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 50340 test clock-29.1418 {time parsing} { clock scan {2440588 xiii:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 50340 test clock-29.1419 {time parsing} { clock scan {2440588 xiii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 50340 test clock-29.1420 {time parsing} { clock scan {2440588 xiii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 50340 test clock-29.1421 {time parsing} { clock scan {2440588 01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 50340 test clock-29.1422 {time parsing} { clock scan {2440588 01:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 50340 test clock-29.1423 {time parsing} { clock scan {2440588 01:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 50340 test clock-29.1424 {time parsing} { clock scan {2440588 01:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 50340 test clock-29.1425 {time parsing} { clock scan {2440588 1:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 50340 test clock-29.1426 {time parsing} { clock scan {2440588 1:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 50340 test clock-29.1427 {time parsing} { clock scan {2440588 1:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 50340 test clock-29.1428 {time parsing} { clock scan {2440588 1:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 50340 test clock-29.1429 {time parsing} { clock scan {2440588 i:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 50340 test clock-29.1430 {time parsing} { clock scan {2440588 i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 50340 test clock-29.1431 {time parsing} { clock scan {2440588 i:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 50340 test clock-29.1432 {time parsing} { clock scan {2440588 i:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 50340 test clock-29.1433 {time parsing} { clock scan {2440588 i:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 50340 test clock-29.1434 {time parsing} { clock scan {2440588 i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 50340 test clock-29.1435 {time parsing} { clock scan {2440588 i:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 50340 test clock-29.1436 {time parsing} { clock scan {2440588 i:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 50340 test clock-29.1437 {time parsing} { clock scan {2440588 01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 50340 test clock-29.1438 {time parsing} { clock scan {2440588 01:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 50340 test clock-29.1439 {time parsing} { clock scan {2440588 01:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 50340 test clock-29.1440 {time parsing} { clock scan {2440588 01:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 50340 test clock-29.1441 {time parsing} { clock scan {2440588 1:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 50340 test clock-29.1442 {time parsing} { clock scan {2440588 1:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 50340 test clock-29.1443 {time parsing} { clock scan {2440588 1:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 50340 test clock-29.1444 {time parsing} { clock scan {2440588 1:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 50340 test clock-29.1445 {time parsing} { clock scan {2440588 i:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 50340 test clock-29.1446 {time parsing} { clock scan {2440588 i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 50340 test clock-29.1447 {time parsing} { clock scan {2440588 i:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 50340 test clock-29.1448 {time parsing} { clock scan {2440588 i:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 50340 test clock-29.1449 {time parsing} { clock scan {2440588 i:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 50340 test clock-29.1450 {time parsing} { clock scan {2440588 i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 50340 test clock-29.1451 {time parsing} { clock scan {2440588 i:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 50340 test clock-29.1452 {time parsing} { clock scan {2440588 i:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 50340 test clock-29.1453 {time parsing} { clock scan {2440588 13:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 50341 test clock-29.1454 {time parsing} { clock scan {2440588 13:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 50341 test clock-29.1455 {time parsing} { clock scan {2440588 13:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 50341 test clock-29.1456 {time parsing} { clock scan {2440588 13:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 50341 test clock-29.1457 {time parsing} { clock scan {2440588 xiii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 50341 test clock-29.1458 {time parsing} { clock scan {2440588 xiii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 50341 test clock-29.1459 {time parsing} { clock scan {2440588 xiii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 50341 test clock-29.1460 {time parsing} { clock scan {2440588 xiii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 50341 test clock-29.1461 {time parsing} { clock scan {2440588 01:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 50341 test clock-29.1462 {time parsing} { clock scan {2440588 01:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 50341 test clock-29.1463 {time parsing} { clock scan {2440588 1:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 50341 test clock-29.1464 {time parsing} { clock scan {2440588 1:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 50341 test clock-29.1465 {time parsing} { clock scan {2440588 i:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 50341 test clock-29.1466 {time parsing} { clock scan {2440588 i:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 50341 test clock-29.1467 {time parsing} { clock scan {2440588 i:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 50341 test clock-29.1468 {time parsing} { clock scan {2440588 i:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 50341 test clock-29.1469 {time parsing} { clock scan {2440588 01:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 50341 test clock-29.1470 {time parsing} { clock scan {2440588 01:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 50341 test clock-29.1471 {time parsing} { clock scan {2440588 1:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 50341 test clock-29.1472 {time parsing} { clock scan {2440588 1:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 50341 test clock-29.1473 {time parsing} { clock scan {2440588 i:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 50341 test clock-29.1474 {time parsing} { clock scan {2440588 i:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 50341 test clock-29.1475 {time parsing} { clock scan {2440588 i:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 50341 test clock-29.1476 {time parsing} { clock scan {2440588 i:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 50341 test clock-29.1477 {time parsing} { clock scan {2440588 13:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 50399 test clock-29.1478 {time parsing} { clock scan {2440588 13:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 50399 test clock-29.1479 {time parsing} { clock scan {2440588 13:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 50399 test clock-29.1480 {time parsing} { clock scan {2440588 13:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 50399 test clock-29.1481 {time parsing} { clock scan {2440588 xiii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 50399 test clock-29.1482 {time parsing} { clock scan {2440588 xiii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 50399 test clock-29.1483 {time parsing} { clock scan {2440588 xiii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 50399 test clock-29.1484 {time parsing} { clock scan {2440588 xiii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 50399 test clock-29.1485 {time parsing} { clock scan {2440588 01:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 50399 test clock-29.1486 {time parsing} { clock scan {2440588 01:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 50399 test clock-29.1487 {time parsing} { clock scan {2440588 1:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 50399 test clock-29.1488 {time parsing} { clock scan {2440588 1:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 50399 test clock-29.1489 {time parsing} { clock scan {2440588 i:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 50399 test clock-29.1490 {time parsing} { clock scan {2440588 i:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 50399 test clock-29.1491 {time parsing} { clock scan {2440588 i:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 50399 test clock-29.1492 {time parsing} { clock scan {2440588 i:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 50399 test clock-29.1493 {time parsing} { clock scan {2440588 01:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 50399 test clock-29.1494 {time parsing} { clock scan {2440588 01:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 50399 test clock-29.1495 {time parsing} { clock scan {2440588 1:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 50399 test clock-29.1496 {time parsing} { clock scan {2440588 1:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 50399 test clock-29.1497 {time parsing} { clock scan {2440588 i:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 50399 test clock-29.1498 {time parsing} { clock scan {2440588 i:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 50399 test clock-29.1499 {time parsing} { clock scan {2440588 i:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 50399 test clock-29.1500 {time parsing} { clock scan {2440588 i:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 50399 test clock-29.1501 {time parsing} { clock scan {2440588 23 } \ -gmt true -locale en_US_roman \ -format {%J %H } } 82800 test clock-29.1502 {time parsing} { clock scan {2440588 23:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 82800 test clock-29.1503 {time parsing} { clock scan {2440588 23:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 82800 test clock-29.1504 {time parsing} { clock scan {2440588 23:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82800 test clock-29.1505 {time parsing} { clock scan {2440588 23:?:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82800 test clock-29.1506 {time parsing} { clock scan {2440588 23 } \ -gmt true -locale en_US_roman \ -format {%J %k } } 82800 test clock-29.1507 {time parsing} { clock scan {2440588 23:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 82800 test clock-29.1508 {time parsing} { clock scan {2440588 23:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 82800 test clock-29.1509 {time parsing} { clock scan {2440588 23:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82800 test clock-29.1510 {time parsing} { clock scan {2440588 23:?:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82800 test clock-29.1511 {time parsing} { clock scan {2440588 xxiii } \ -gmt true -locale en_US_roman \ -format {%J %OH } } 82800 test clock-29.1512 {time parsing} { clock scan {2440588 xxiii:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 82800 test clock-29.1513 {time parsing} { clock scan {2440588 xxiii:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 82800 test clock-29.1514 {time parsing} { clock scan {2440588 xxiii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82800 test clock-29.1515 {time parsing} { clock scan {2440588 xxiii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82800 test clock-29.1516 {time parsing} { clock scan {2440588 xxiii } \ -gmt true -locale en_US_roman \ -format {%J %Ok } } 82800 test clock-29.1517 {time parsing} { clock scan {2440588 xxiii:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 82800 test clock-29.1518 {time parsing} { clock scan {2440588 xxiii:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 82800 test clock-29.1519 {time parsing} { clock scan {2440588 xxiii:00:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82800 test clock-29.1520 {time parsing} { clock scan {2440588 xxiii:?:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82800 test clock-29.1521 {time parsing} { clock scan {2440588 11 PM} \ -gmt true -locale en_US_roman \ -format {%J %I %p} } 82800 test clock-29.1522 {time parsing} { clock scan {2440588 11:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 82800 test clock-29.1523 {time parsing} { clock scan {2440588 11:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 82800 test clock-29.1524 {time parsing} { clock scan {2440588 11:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82800 test clock-29.1525 {time parsing} { clock scan {2440588 11:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82800 test clock-29.1526 {time parsing} { clock scan {2440588 11 PM} \ -gmt true -locale en_US_roman \ -format {%J %l %p} } 82800 test clock-29.1527 {time parsing} { clock scan {2440588 11:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 82800 test clock-29.1528 {time parsing} { clock scan {2440588 11:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 82800 test clock-29.1529 {time parsing} { clock scan {2440588 11:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82800 test clock-29.1530 {time parsing} { clock scan {2440588 11:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82800 test clock-29.1531 {time parsing} { clock scan {2440588 xi PM} \ -gmt true -locale en_US_roman \ -format {%J %OI %p} } 82800 test clock-29.1532 {time parsing} { clock scan {2440588 xi:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 82800 test clock-29.1533 {time parsing} { clock scan {2440588 xi:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 82800 test clock-29.1534 {time parsing} { clock scan {2440588 xi:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82800 test clock-29.1535 {time parsing} { clock scan {2440588 xi:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82800 test clock-29.1536 {time parsing} { clock scan {2440588 xi PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol %p} } 82800 test clock-29.1537 {time parsing} { clock scan {2440588 xi:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 82800 test clock-29.1538 {time parsing} { clock scan {2440588 xi:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 82800 test clock-29.1539 {time parsing} { clock scan {2440588 xi:00:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82800 test clock-29.1540 {time parsing} { clock scan {2440588 xi:?:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82800 test clock-29.1541 {time parsing} { clock scan {2440588 11 pm} \ -gmt true -locale en_US_roman \ -format {%J %I %P} } 82800 test clock-29.1542 {time parsing} { clock scan {2440588 11:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 82800 test clock-29.1543 {time parsing} { clock scan {2440588 11:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 82800 test clock-29.1544 {time parsing} { clock scan {2440588 11:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82800 test clock-29.1545 {time parsing} { clock scan {2440588 11:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82800 test clock-29.1546 {time parsing} { clock scan {2440588 11 pm} \ -gmt true -locale en_US_roman \ -format {%J %l %P} } 82800 test clock-29.1547 {time parsing} { clock scan {2440588 11:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 82800 test clock-29.1548 {time parsing} { clock scan {2440588 11:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 82800 test clock-29.1549 {time parsing} { clock scan {2440588 11:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82800 test clock-29.1550 {time parsing} { clock scan {2440588 11:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82800 test clock-29.1551 {time parsing} { clock scan {2440588 xi pm} \ -gmt true -locale en_US_roman \ -format {%J %OI %P} } 82800 test clock-29.1552 {time parsing} { clock scan {2440588 xi:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 82800 test clock-29.1553 {time parsing} { clock scan {2440588 xi:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 82800 test clock-29.1554 {time parsing} { clock scan {2440588 xi:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82800 test clock-29.1555 {time parsing} { clock scan {2440588 xi:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82800 test clock-29.1556 {time parsing} { clock scan {2440588 xi pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol %P} } 82800 test clock-29.1557 {time parsing} { clock scan {2440588 xi:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 82800 test clock-29.1558 {time parsing} { clock scan {2440588 xi:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 82800 test clock-29.1559 {time parsing} { clock scan {2440588 xi:00:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82800 test clock-29.1560 {time parsing} { clock scan {2440588 xi:?:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82800 test clock-29.1561 {time parsing} { clock scan {2440588 23:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82801 test clock-29.1562 {time parsing} { clock scan {2440588 23:?:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82801 test clock-29.1563 {time parsing} { clock scan {2440588 23:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82801 test clock-29.1564 {time parsing} { clock scan {2440588 23:?:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82801 test clock-29.1565 {time parsing} { clock scan {2440588 xxiii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82801 test clock-29.1566 {time parsing} { clock scan {2440588 xxiii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82801 test clock-29.1567 {time parsing} { clock scan {2440588 xxiii:00:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82801 test clock-29.1568 {time parsing} { clock scan {2440588 xxiii:?:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82801 test clock-29.1569 {time parsing} { clock scan {2440588 11:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82801 test clock-29.1570 {time parsing} { clock scan {2440588 11:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82801 test clock-29.1571 {time parsing} { clock scan {2440588 11:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82801 test clock-29.1572 {time parsing} { clock scan {2440588 11:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82801 test clock-29.1573 {time parsing} { clock scan {2440588 xi:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82801 test clock-29.1574 {time parsing} { clock scan {2440588 xi:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82801 test clock-29.1575 {time parsing} { clock scan {2440588 xi:00:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82801 test clock-29.1576 {time parsing} { clock scan {2440588 xi:?:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82801 test clock-29.1577 {time parsing} { clock scan {2440588 11:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82801 test clock-29.1578 {time parsing} { clock scan {2440588 11:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82801 test clock-29.1579 {time parsing} { clock scan {2440588 11:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82801 test clock-29.1580 {time parsing} { clock scan {2440588 11:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82801 test clock-29.1581 {time parsing} { clock scan {2440588 xi:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82801 test clock-29.1582 {time parsing} { clock scan {2440588 xi:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82801 test clock-29.1583 {time parsing} { clock scan {2440588 xi:00:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82801 test clock-29.1584 {time parsing} { clock scan {2440588 xi:?:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82801 test clock-29.1585 {time parsing} { clock scan {2440588 23:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82859 test clock-29.1586 {time parsing} { clock scan {2440588 23:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82859 test clock-29.1587 {time parsing} { clock scan {2440588 23:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82859 test clock-29.1588 {time parsing} { clock scan {2440588 23:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82859 test clock-29.1589 {time parsing} { clock scan {2440588 xxiii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82859 test clock-29.1590 {time parsing} { clock scan {2440588 xxiii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82859 test clock-29.1591 {time parsing} { clock scan {2440588 xxiii:00:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82859 test clock-29.1592 {time parsing} { clock scan {2440588 xxiii:?:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82859 test clock-29.1593 {time parsing} { clock scan {2440588 11:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82859 test clock-29.1594 {time parsing} { clock scan {2440588 11:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82859 test clock-29.1595 {time parsing} { clock scan {2440588 11:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82859 test clock-29.1596 {time parsing} { clock scan {2440588 11:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82859 test clock-29.1597 {time parsing} { clock scan {2440588 xi:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82859 test clock-29.1598 {time parsing} { clock scan {2440588 xi:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82859 test clock-29.1599 {time parsing} { clock scan {2440588 xi:00:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82859 test clock-29.1600 {time parsing} { clock scan {2440588 xi:?:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82859 test clock-29.1601 {time parsing} { clock scan {2440588 11:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82859 test clock-29.1602 {time parsing} { clock scan {2440588 11:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82859 test clock-29.1603 {time parsing} { clock scan {2440588 11:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82859 test clock-29.1604 {time parsing} { clock scan {2440588 11:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82859 test clock-29.1605 {time parsing} { clock scan {2440588 xi:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82859 test clock-29.1606 {time parsing} { clock scan {2440588 xi:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82859 test clock-29.1607 {time parsing} { clock scan {2440588 xi:00:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82859 test clock-29.1608 {time parsing} { clock scan {2440588 xi:?:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82859 test clock-29.1609 {time parsing} { clock scan {2440588 23:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 82860 test clock-29.1610 {time parsing} { clock scan {2440588 23:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 82860 test clock-29.1611 {time parsing} { clock scan {2440588 23:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82860 test clock-29.1612 {time parsing} { clock scan {2440588 23:i:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82860 test clock-29.1613 {time parsing} { clock scan {2440588 23:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 82860 test clock-29.1614 {time parsing} { clock scan {2440588 23:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 82860 test clock-29.1615 {time parsing} { clock scan {2440588 23:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82860 test clock-29.1616 {time parsing} { clock scan {2440588 23:i:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82860 test clock-29.1617 {time parsing} { clock scan {2440588 xxiii:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 82860 test clock-29.1618 {time parsing} { clock scan {2440588 xxiii:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 82860 test clock-29.1619 {time parsing} { clock scan {2440588 xxiii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82860 test clock-29.1620 {time parsing} { clock scan {2440588 xxiii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82860 test clock-29.1621 {time parsing} { clock scan {2440588 xxiii:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 82860 test clock-29.1622 {time parsing} { clock scan {2440588 xxiii:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 82860 test clock-29.1623 {time parsing} { clock scan {2440588 xxiii:01:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82860 test clock-29.1624 {time parsing} { clock scan {2440588 xxiii:i:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82860 test clock-29.1625 {time parsing} { clock scan {2440588 11:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 82860 test clock-29.1626 {time parsing} { clock scan {2440588 11:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 82860 test clock-29.1627 {time parsing} { clock scan {2440588 11:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82860 test clock-29.1628 {time parsing} { clock scan {2440588 11:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82860 test clock-29.1629 {time parsing} { clock scan {2440588 11:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 82860 test clock-29.1630 {time parsing} { clock scan {2440588 11:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 82860 test clock-29.1631 {time parsing} { clock scan {2440588 11:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82860 test clock-29.1632 {time parsing} { clock scan {2440588 11:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82860 test clock-29.1633 {time parsing} { clock scan {2440588 xi:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 82860 test clock-29.1634 {time parsing} { clock scan {2440588 xi:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 82860 test clock-29.1635 {time parsing} { clock scan {2440588 xi:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82860 test clock-29.1636 {time parsing} { clock scan {2440588 xi:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82860 test clock-29.1637 {time parsing} { clock scan {2440588 xi:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 82860 test clock-29.1638 {time parsing} { clock scan {2440588 xi:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 82860 test clock-29.1639 {time parsing} { clock scan {2440588 xi:01:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82860 test clock-29.1640 {time parsing} { clock scan {2440588 xi:i:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82860 test clock-29.1641 {time parsing} { clock scan {2440588 11:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 82860 test clock-29.1642 {time parsing} { clock scan {2440588 11:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 82860 test clock-29.1643 {time parsing} { clock scan {2440588 11:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82860 test clock-29.1644 {time parsing} { clock scan {2440588 11:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82860 test clock-29.1645 {time parsing} { clock scan {2440588 11:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 82860 test clock-29.1646 {time parsing} { clock scan {2440588 11:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 82860 test clock-29.1647 {time parsing} { clock scan {2440588 11:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82860 test clock-29.1648 {time parsing} { clock scan {2440588 11:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82860 test clock-29.1649 {time parsing} { clock scan {2440588 xi:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 82860 test clock-29.1650 {time parsing} { clock scan {2440588 xi:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 82860 test clock-29.1651 {time parsing} { clock scan {2440588 xi:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82860 test clock-29.1652 {time parsing} { clock scan {2440588 xi:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82860 test clock-29.1653 {time parsing} { clock scan {2440588 xi:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 82860 test clock-29.1654 {time parsing} { clock scan {2440588 xi:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 82860 test clock-29.1655 {time parsing} { clock scan {2440588 xi:01:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82860 test clock-29.1656 {time parsing} { clock scan {2440588 xi:i:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82860 test clock-29.1657 {time parsing} { clock scan {2440588 23:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82861 test clock-29.1658 {time parsing} { clock scan {2440588 23:i:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82861 test clock-29.1659 {time parsing} { clock scan {2440588 23:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82861 test clock-29.1660 {time parsing} { clock scan {2440588 23:i:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82861 test clock-29.1661 {time parsing} { clock scan {2440588 xxiii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82861 test clock-29.1662 {time parsing} { clock scan {2440588 xxiii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82861 test clock-29.1663 {time parsing} { clock scan {2440588 xxiii:01:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82861 test clock-29.1664 {time parsing} { clock scan {2440588 xxiii:i:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82861 test clock-29.1665 {time parsing} { clock scan {2440588 11:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82861 test clock-29.1666 {time parsing} { clock scan {2440588 11:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82861 test clock-29.1667 {time parsing} { clock scan {2440588 11:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82861 test clock-29.1668 {time parsing} { clock scan {2440588 11:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82861 test clock-29.1669 {time parsing} { clock scan {2440588 xi:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82861 test clock-29.1670 {time parsing} { clock scan {2440588 xi:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82861 test clock-29.1671 {time parsing} { clock scan {2440588 xi:01:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82861 test clock-29.1672 {time parsing} { clock scan {2440588 xi:i:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82861 test clock-29.1673 {time parsing} { clock scan {2440588 11:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82861 test clock-29.1674 {time parsing} { clock scan {2440588 11:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82861 test clock-29.1675 {time parsing} { clock scan {2440588 11:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82861 test clock-29.1676 {time parsing} { clock scan {2440588 11:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82861 test clock-29.1677 {time parsing} { clock scan {2440588 xi:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82861 test clock-29.1678 {time parsing} { clock scan {2440588 xi:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82861 test clock-29.1679 {time parsing} { clock scan {2440588 xi:01:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82861 test clock-29.1680 {time parsing} { clock scan {2440588 xi:i:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82861 test clock-29.1681 {time parsing} { clock scan {2440588 23:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 82919 test clock-29.1682 {time parsing} { clock scan {2440588 23:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 82919 test clock-29.1683 {time parsing} { clock scan {2440588 23:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 82919 test clock-29.1684 {time parsing} { clock scan {2440588 23:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 82919 test clock-29.1685 {time parsing} { clock scan {2440588 xxiii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 82919 test clock-29.1686 {time parsing} { clock scan {2440588 xxiii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 82919 test clock-29.1687 {time parsing} { clock scan {2440588 xxiii:01:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 82919 test clock-29.1688 {time parsing} { clock scan {2440588 xxiii:i:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 82919 test clock-29.1689 {time parsing} { clock scan {2440588 11:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 82919 test clock-29.1690 {time parsing} { clock scan {2440588 11:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 82919 test clock-29.1691 {time parsing} { clock scan {2440588 11:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 82919 test clock-29.1692 {time parsing} { clock scan {2440588 11:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 82919 test clock-29.1693 {time parsing} { clock scan {2440588 xi:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 82919 test clock-29.1694 {time parsing} { clock scan {2440588 xi:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 82919 test clock-29.1695 {time parsing} { clock scan {2440588 xi:01:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 82919 test clock-29.1696 {time parsing} { clock scan {2440588 xi:i:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 82919 test clock-29.1697 {time parsing} { clock scan {2440588 11:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 82919 test clock-29.1698 {time parsing} { clock scan {2440588 11:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 82919 test clock-29.1699 {time parsing} { clock scan {2440588 11:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 82919 test clock-29.1700 {time parsing} { clock scan {2440588 11:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 82919 test clock-29.1701 {time parsing} { clock scan {2440588 xi:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 82919 test clock-29.1702 {time parsing} { clock scan {2440588 xi:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 82919 test clock-29.1703 {time parsing} { clock scan {2440588 xi:01:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 82919 test clock-29.1704 {time parsing} { clock scan {2440588 xi:i:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 82919 test clock-29.1705 {time parsing} { clock scan {2440588 23:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M } } 86340 test clock-29.1706 {time parsing} { clock scan {2440588 23:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM } } 86340 test clock-29.1707 {time parsing} { clock scan {2440588 23:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 86340 test clock-29.1708 {time parsing} { clock scan {2440588 23:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 86340 test clock-29.1709 {time parsing} { clock scan {2440588 23:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M } } 86340 test clock-29.1710 {time parsing} { clock scan {2440588 23:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM } } 86340 test clock-29.1711 {time parsing} { clock scan {2440588 23:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 86340 test clock-29.1712 {time parsing} { clock scan {2440588 23:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 86340 test clock-29.1713 {time parsing} { clock scan {2440588 xxiii:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M } } 86340 test clock-29.1714 {time parsing} { clock scan {2440588 xxiii:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM } } 86340 test clock-29.1715 {time parsing} { clock scan {2440588 xxiii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 86340 test clock-29.1716 {time parsing} { clock scan {2440588 xxiii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 86340 test clock-29.1717 {time parsing} { clock scan {2440588 xxiii:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M } } 86340 test clock-29.1718 {time parsing} { clock scan {2440588 xxiii:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM } } 86340 test clock-29.1719 {time parsing} { clock scan {2440588 xxiii:59:00 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 86340 test clock-29.1720 {time parsing} { clock scan {2440588 xxiii:lix:? } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 86340 test clock-29.1721 {time parsing} { clock scan {2440588 11:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %p} } 86340 test clock-29.1722 {time parsing} { clock scan {2440588 11:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %p} } 86340 test clock-29.1723 {time parsing} { clock scan {2440588 11:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 86340 test clock-29.1724 {time parsing} { clock scan {2440588 11:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 86340 test clock-29.1725 {time parsing} { clock scan {2440588 11:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %p} } 86340 test clock-29.1726 {time parsing} { clock scan {2440588 11:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %p} } 86340 test clock-29.1727 {time parsing} { clock scan {2440588 11:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 86340 test clock-29.1728 {time parsing} { clock scan {2440588 11:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 86340 test clock-29.1729 {time parsing} { clock scan {2440588 xi:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %p} } 86340 test clock-29.1730 {time parsing} { clock scan {2440588 xi:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %p} } 86340 test clock-29.1731 {time parsing} { clock scan {2440588 xi:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 86340 test clock-29.1732 {time parsing} { clock scan {2440588 xi:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 86340 test clock-29.1733 {time parsing} { clock scan {2440588 xi:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %p} } 86340 test clock-29.1734 {time parsing} { clock scan {2440588 xi:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %p} } 86340 test clock-29.1735 {time parsing} { clock scan {2440588 xi:59:00 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 86340 test clock-29.1736 {time parsing} { clock scan {2440588 xi:lix:? PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 86340 test clock-29.1737 {time parsing} { clock scan {2440588 11:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M %P} } 86340 test clock-29.1738 {time parsing} { clock scan {2440588 11:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM %P} } 86340 test clock-29.1739 {time parsing} { clock scan {2440588 11:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 86340 test clock-29.1740 {time parsing} { clock scan {2440588 11:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 86340 test clock-29.1741 {time parsing} { clock scan {2440588 11:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M %P} } 86340 test clock-29.1742 {time parsing} { clock scan {2440588 11:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM %P} } 86340 test clock-29.1743 {time parsing} { clock scan {2440588 11:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 86340 test clock-29.1744 {time parsing} { clock scan {2440588 11:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 86340 test clock-29.1745 {time parsing} { clock scan {2440588 xi:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M %P} } 86340 test clock-29.1746 {time parsing} { clock scan {2440588 xi:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM %P} } 86340 test clock-29.1747 {time parsing} { clock scan {2440588 xi:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 86340 test clock-29.1748 {time parsing} { clock scan {2440588 xi:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 86340 test clock-29.1749 {time parsing} { clock scan {2440588 xi:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M %P} } 86340 test clock-29.1750 {time parsing} { clock scan {2440588 xi:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM %P} } 86340 test clock-29.1751 {time parsing} { clock scan {2440588 xi:59:00 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 86340 test clock-29.1752 {time parsing} { clock scan {2440588 xi:lix:? pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 86340 test clock-29.1753 {time parsing} { clock scan {2440588 23:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 86341 test clock-29.1754 {time parsing} { clock scan {2440588 23:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 86341 test clock-29.1755 {time parsing} { clock scan {2440588 23:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 86341 test clock-29.1756 {time parsing} { clock scan {2440588 23:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 86341 test clock-29.1757 {time parsing} { clock scan {2440588 xxiii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 86341 test clock-29.1758 {time parsing} { clock scan {2440588 xxiii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 86341 test clock-29.1759 {time parsing} { clock scan {2440588 xxiii:59:01 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 86341 test clock-29.1760 {time parsing} { clock scan {2440588 xxiii:lix:i } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 86341 test clock-29.1761 {time parsing} { clock scan {2440588 11:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 86341 test clock-29.1762 {time parsing} { clock scan {2440588 11:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 86341 test clock-29.1763 {time parsing} { clock scan {2440588 11:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 86341 test clock-29.1764 {time parsing} { clock scan {2440588 11:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 86341 test clock-29.1765 {time parsing} { clock scan {2440588 xi:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 86341 test clock-29.1766 {time parsing} { clock scan {2440588 xi:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 86341 test clock-29.1767 {time parsing} { clock scan {2440588 xi:59:01 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 86341 test clock-29.1768 {time parsing} { clock scan {2440588 xi:lix:i PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 86341 test clock-29.1769 {time parsing} { clock scan {2440588 11:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 86341 test clock-29.1770 {time parsing} { clock scan {2440588 11:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 86341 test clock-29.1771 {time parsing} { clock scan {2440588 11:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 86341 test clock-29.1772 {time parsing} { clock scan {2440588 11:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 86341 test clock-29.1773 {time parsing} { clock scan {2440588 xi:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 86341 test clock-29.1774 {time parsing} { clock scan {2440588 xi:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 86341 test clock-29.1775 {time parsing} { clock scan {2440588 xi:59:01 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 86341 test clock-29.1776 {time parsing} { clock scan {2440588 xi:lix:i pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 86341 test clock-29.1777 {time parsing} { clock scan {2440588 23:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %H:%M:%S } } 86399 test clock-29.1778 {time parsing} { clock scan {2440588 23:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %H:%OM:%OS } } 86399 test clock-29.1779 {time parsing} { clock scan {2440588 23:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %k:%M:%S } } 86399 test clock-29.1780 {time parsing} { clock scan {2440588 23:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %k:%OM:%OS } } 86399 test clock-29.1781 {time parsing} { clock scan {2440588 xxiii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %OH:%M:%S } } 86399 test clock-29.1782 {time parsing} { clock scan {2440588 xxiii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %OH:%OM:%OS } } 86399 test clock-29.1783 {time parsing} { clock scan {2440588 xxiii:59:59 } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%M:%S } } 86399 test clock-29.1784 {time parsing} { clock scan {2440588 xxiii:lix:lix } \ -gmt true -locale en_US_roman \ -format {%J %Ok:%OM:%OS } } 86399 test clock-29.1785 {time parsing} { clock scan {2440588 11:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %p} } 86399 test clock-29.1786 {time parsing} { clock scan {2440588 11:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %p} } 86399 test clock-29.1787 {time parsing} { clock scan {2440588 11:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %p} } 86399 test clock-29.1788 {time parsing} { clock scan {2440588 11:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %p} } 86399 test clock-29.1789 {time parsing} { clock scan {2440588 xi:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %p} } 86399 test clock-29.1790 {time parsing} { clock scan {2440588 xi:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %p} } 86399 test clock-29.1791 {time parsing} { clock scan {2440588 xi:59:59 PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %p} } 86399 test clock-29.1792 {time parsing} { clock scan {2440588 xi:lix:lix PM} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %p} } 86399 test clock-29.1793 {time parsing} { clock scan {2440588 11:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%M:%S %P} } 86399 test clock-29.1794 {time parsing} { clock scan {2440588 11:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %I:%OM:%OS %P} } 86399 test clock-29.1795 {time parsing} { clock scan {2440588 11:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%M:%S %P} } 86399 test clock-29.1796 {time parsing} { clock scan {2440588 11:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %l:%OM:%OS %P} } 86399 test clock-29.1797 {time parsing} { clock scan {2440588 xi:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%M:%S %P} } 86399 test clock-29.1798 {time parsing} { clock scan {2440588 xi:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %OI:%OM:%OS %P} } 86399 test clock-29.1799 {time parsing} { clock scan {2440588 xi:59:59 pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%M:%S %P} } 86399 test clock-29.1800 {time parsing} { clock scan {2440588 xi:lix:lix pm} \ -gmt true -locale en_US_roman \ -format {%J %Ol:%OM:%OS %P} } 86399 test clock-29.1811 {parsing of several localized formats} { set res {} foreach loc {en de fr} { foreach fmt {"%x %X" "%X %x"} { lappend res [clock scan \ [clock format 0 -format $fmt -locale $loc -gmt 1] \ -format $fmt -locale $loc -gmt 1] } } set res } [lrepeat 6 0] test clock-29.1812 {parsing of several localized formats} { set res {} foreach loc {en de fr} { foreach fmt {"%a %d-%m-%Y" "%a %b %x-%X" "%a, %x %X" "%b, %x %X"} { lappend res [clock scan \ [clock format 0 -format $fmt -locale $loc -gmt 1] \ -format $fmt -locale $loc -gmt 1] } } set res } [lrepeat 12 0] test clock-29.1813 {cache consistency when deriving localized formats, bug [2c0f49e26c27847a]} { # ensure localized formats are not affected by mistaken merge of mc # from parent locale, so such formats got invalidated in child cache: namespace inscope ::tcl::clock { ::msgcat::mcset en_US_roman_xx DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset en_US_roman_xx_yy DATE_FORMAT "%Y|%m|%d" } list [clock format 86400 -format %x -gmt 1 -locale en_US_roman] \ [clock format 86400 -format %x -gmt 1 -locale en_US_roman_xx] \ [clock format 86400 -format %x -gmt 1 -locale en_US_roman_xx_yy] } {01/02/1970 02.01.1970 1970|01|02} # END testcases29 # BEGIN testcases30 # Test [clock add] test clock-30.1 {clock add years} { set t [clock scan 2000-01-01 -format %Y-%m-%d -timezone :UTC] set f [clock add $t 1 year -timezone :UTC] clock format $f -format %Y-%m-%d -timezone :UTC } {2001-01-01} test clock-30.2 {clock add years - leap day} { set t [clock scan 2000-02-29 -format %Y-%m-%d -timezone :UTC] set f [clock add $t 1 years -timezone :UTC] clock format $f -format %Y-%m-%d -timezone :UTC } {2001-02-28} test clock-30.3 {clock add months} { set t [clock scan 2000-01-01 -format %Y-%m-%d -timezone :UTC] set f [clock add $t 1 month -timezone :UTC] clock format $f -format %Y-%m-%d -timezone :UTC } {2000-02-01} test clock-30.4 {clock add months, short month} { set t [clock scan 2000-01-31 -format %Y-%m-%d -timezone :UTC] set f [clock add $t 1 months -timezone :UTC] clock format $f -format %Y-%m-%d -timezone :UTC } {2000-02-29} test clock-30.5 {clock add months, end of year} { set t [clock scan 2000-12-01 -format %Y-%m-%d -timezone :UTC] set f [clock add $t 1 month -timezone :UTC] clock format $f -format %Y-%m-%d -timezone :UTC } {2001-01-01} test clock-30.6 {clock add months, one year one month vs 13 months} { set t [clock scan 2000-02-29 -format %Y-%m-%d -timezone :UTC] set f1 [clock add $t 1 year 1 month -timezone :UTC] set f2 [clock add $t 13 months -timezone :UTC] set x1 [clock format $f1 -format %Y-%m-%d -timezone :UTC] set x2 [clock format $f2 -format %Y-%m-%d -timezone :UTC] list $x1 $x2 } {2001-03-28 2001-03-29} test clock-30.7 {clock add months, 1 year 1 month vs 1 month 1 year} { set t [clock scan 2000-02-29 -format %Y-%m-%d -timezone :UTC] set f1 [clock add $t 1 year 1 month -timezone :UTC] set f2 [clock add $t 1 month 1 year -timezone :UTC] set x1 [clock format $f1 -format %Y-%m-%d -timezone :UTC] set x2 [clock format $f2 -format %Y-%m-%d -timezone :UTC] list $x1 $x2 } {2001-03-28 2001-03-29} test clock-30.8 {clock add months, negative} { set t [clock scan 2000-03-31 -format %Y-%m-%d -timezone :UTC] set f1 [clock add $t -1 month -timezone :UTC] set f2 [clock add $t -2 month -timezone :UTC] set f3 [clock add $t -3 month -timezone :UTC] set f4 [clock add $t -4 month -timezone :UTC] set x1 [clock format $f1 -format %Y-%m-%d -timezone :UTC] set x2 [clock format $f2 -format %Y-%m-%d -timezone :UTC] set x3 [clock format $f3 -format %Y-%m-%d -timezone :UTC] set x4 [clock format $f4 -format %Y-%m-%d -timezone :UTC] list $x1 $x2 $x3 $x4 } {2000-02-29 2000-01-31 1999-12-31 1999-11-30} test clock-30.8a {clock add months, negative, over threshold of a year} { set t [clock scan 2019-01-31 -format %Y-%m-%d -gmt 1] list [clock format [clock add $t -1 month -gmt 1] -format %Y-%m-%d -gmt 1] \ [clock format [clock add $t -2 month -gmt 1] -format %Y-%m-%d -gmt 1] \ [clock format [clock add $t -3 month -gmt 1] -format %Y-%m-%d -gmt 1] \ [clock format [clock add $t -4 month -gmt 1] -format %Y-%m-%d -gmt 1] } {2018-12-31 2018-11-30 2018-10-31 2018-09-30} test clock-30.8b {clock add months, negative, over threshold of a year} { set t [clock scan 2000-01-28 -format %Y-%m-%d -gmt 1] for {set i 1} {$i < 24} {incr i 1} { set f1 [clock add $t -$i month -gmt 1] set f2 [clock add $f1 $i month -gmt 1] if {$f2 != $t} { error "\[clock add $t -$i month -gmt 1\] does not consider\ \[clock add $f1 $i month -gmt 1\] != $t" } } } {} test clock-30.9 {clock add days} { set t [clock scan {2000-01-01 12:34:56} -format {%Y-%m-%d %H:%M:%S} \ -timezone :UTC] set f1 [clock add $t 1 day -timezone :UTC] set f2 [clock add $t -1 day -timezone :UTC] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] list $x1 $x2 } {{2000-01-02 12:34:56} {1999-12-31 12:34:56}} test clock-30.10 {clock add days, spring DST conversion, before} { set t [clock scan {2004-04-03 01:59:59} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 days \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-04-04 01:59:59 -0500} {2004-04-05 01:59:59 -0400}} test clock-30.11 {clock add days, spring DST conversion, bad case} { set t [clock scan {2004-04-03 02:30:00} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-04-04 03:30:00 -0400} {2004-04-05 02:30:00 -0400}} test clock-30.12 {clock add days, spring DST conversion, after} { set t [clock scan {2004-04-03 03:00:00} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 day -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-04-04 03:00:00 -0400} {2004-04-05 03:00:00 -0400}} test clock-30.13 {clock add days, fall DST conversion, before} { set t [clock scan {2004-10-30 00:59:59} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-10-31 00:59:59 -0400} {2004-11-01 00:59:59 -0500}} test clock-30.14 {clock add days, fall DST conversion, bad case} { set t [clock scan {2004-10-30 01:30:00} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-10-31 01:30:00 -0400} {2004-11-01 01:30:00 -0500}} test clock-30.15 {clock add days, fall DST conversion, after} { set t [clock scan {2004-10-30 02:30:00} -format {%Y-%m-%d %H:%M:%S} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f2 [clock add $t 2 day \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] list $x1 $x2 } {{2004-10-31 02:30:00 -0500} {2004-11-01 02:30:00 -0500}} test clock-30.16 {clock add weeks} { set t [clock scan {2000-01-01 12:34:56} -format {%Y-%m-%d %H:%M:%S} \ -timezone :UTC] set f1 [clock add $t 1 week -timezone :UTC] set f2 [clock add $t -1 weeks -timezone :UTC] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] list $x1 $x2 } {{2000-01-08 12:34:56} {1999-12-25 12:34:56}} test clock-30.17 {clock add hours} { set t [clock scan {2000-01-01 12:34:56} -format {%Y-%m-%d %H:%M:%S} \ -timezone :UTC] set f1 [clock add $t 1 hour -timezone :UTC] set f2 [clock add $t -1 hours -timezone :UTC] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] list $x1 $x2 } {{2000-01-01 13:34:56} {2000-01-01 11:34:56}} test clock-30.18 {clock add hours at DST conversion} { set t [clock scan {2004-04-04 01:00:00 -0500} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 hour -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-04-04 03:00:00 -0400} test clock-30.19 {clock add hours at DST conversion} { set t [clock scan {2004-10-31 01:00:00 -0400} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 1 hour \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-10-31 01:00:00 -0500} test clock-30.20 {clock add minutes} { set t [clock scan {2000-01-01 12:34:56} -format {%Y-%m-%d %H:%M:%S} \ -timezone :UTC] set f1 [clock add $t 60 minute -timezone :UTC] set f2 [clock add $t -60 minutes -timezone :UTC] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] list $x1 $x2 } {{2000-01-01 13:34:56} {2000-01-01 11:34:56}} test clock-30.21 {clock add minutes at DST conversion} { set t [clock scan {2004-04-04 01:00:00 -0500} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 60 minutes \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-04-04 03:00:00 -0400} test clock-30.22 {clock add minutes at DST conversion} { set t [clock scan {2004-10-31 01:00:00 -0400} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 60 minutes \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-10-31 01:00:00 -0500} test clock-30.23 {clock add seconds} { set t [clock scan {2000-01-01 12:34:56} -format {%Y-%m-%d %H:%M:%S} \ -timezone :UTC] set f1 [clock add $t 3600 second -timezone :UTC] set f2 [clock add $t -3600 seconds -timezone :UTC] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] set x2 [clock format $f2 -format {%Y-%m-%d %H:%M:%S} -timezone :UTC] list $x1 $x2 } {{2000-01-01 13:34:56} {2000-01-01 11:34:56}} test clock-30.24 {clock add seconds at DST conversion} { set t [clock scan {2004-04-04 01:00:00 -0500} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 3600 seconds \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-04-04 03:00:00 -0400} test clock-30.25 {clock add seconds at DST conversion} { set t [clock scan {2004-10-31 01:00:00 -0400} \ -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set f1 [clock add $t 3600 seconds -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] set x1 [clock format $f1 -format {%Y-%m-%d %H:%M:%S %z} \ -timezone EST05:00EDT04:00,M4.1.0/02:00,M10.5.0/02:00] } {2004-10-31 01:00:00 -0500} test clock-30.26 {clock add weekdays} { set t [clock scan {2013-11-20}] ;# Wednesday set f1 [clock add $t 3 weekdays] set x1 [clock format $f1 -format {%Y-%m-%d}] } {2013-11-25} test clock-30.27 {clock add weekdays starting on Saturday} { set t [clock scan {2013-11-23}] ;# Saturday set f1 [clock add $t 1 weekday] set x1 [clock format $f1 -format {%Y-%m-%d}] } {2013-11-25} test clock-30.28 {clock add weekdays starting on Sunday} { set t [clock scan {2013-11-24}] ;# Sunday set f1 [clock add $t 1 weekday] set x1 [clock format $f1 -format {%Y-%m-%d}] } {2013-11-25} test clock-30.29 {clock add 0 weekdays starting on a weekend} { set t [clock scan {2016-02-27}] ;# Saturday set f1 [clock add $t 0 weekdays] set x1 [clock format $f1 -format {%Y-%m-%d}] } {2016-02-27} test clock-30.30 {clock add weekdays and back} -body { set n [clock seconds] # we start on each day of the week for {set i 0} {$i < 7} {incr i} { set start [clock add $n $i days] set startu [clock format $start -format %u] # add 0 - 100 weekdays for {set j 0} {$j < 100} {incr j} { set forth [clock add $start $j weekdays] set back [clock add $forth -$j weekdays] # If $s was a weekday or $j was 0, $b must be the same day. # Otherwise, $b must be the immediately preceeding Friday set fail 0 if {$j == 0 || $startu < 6} { if {$start != $back} { set fail 1} } else { set friday [clock add $start -[expr {$startu % 5}] days] if {$friday != $back} { set fail 1 } } if {$fail} { set sdate [clock format $start -format {%Y-%m-%d}] set bdate [clock format $back -format {%Y-%m-%d}] return "$sdate + $j - $j := $bdate" } } } return "OK" } -result {OK} test clock-30.31 {regression test - add no int overflow} { list \ [list \ [clock add 0 1600000000 seconds 24856 days -gmt 1] \ [clock add 0 1600000000 seconds 815 months -gmt 1] \ [clock add 0 1600000000 seconds 69 years -gmt 1] \ [clock add 0 1600000000 seconds 596524 hours -gmt 1] \ [clock add 0 1600000000 seconds 35791395 minutes -gmt 1] \ [clock add 0 1600000000 seconds 0x7fffffff seconds -gmt 1] ] \ [list \ [clock add 1600000000 24856 days -gmt 1] \ [clock add 1600000000 815 months -gmt 1] \ [clock add 1600000000 69 years -gmt 1] \ [clock add 1600000000 596524 hours -gmt 1] \ [clock add 1600000000 35791395 minutes -gmt 1] \ [clock add 1600000000 0x7fffffff seconds -gmt 1] ] } [lrepeat 2 {3747558400 3743238400 3777452800 3747486400 3747483700 3747483647}] test clock-30.32 {regression test - add no int overflow} { list \ [list \ [clock add 3777452800 -1600000000 seconds -24856 days -gmt 1] \ [clock add 3777452800 -1600000000 seconds -815 months -gmt 1] \ [clock add 3777452800 -1600000000 seconds -69 years -gmt 1] \ [clock add 3777452800 -1600000000 seconds -596524 hours -gmt 1] \ [clock add 3777452800 -1600000000 seconds -35791395 minutes -gmt 1] \ [clock add 3777452800 -1600000000 seconds -0x7fffffff seconds -gmt 1] ] \ [list \ [clock add 2177452800 -24856 days -gmt 1] \ [clock add 2177452800 -815 months -gmt 1] \ [clock add 2177452800 -69 years -gmt 1] \ [clock add 2177452800 -596524 hours -gmt 1] \ [clock add 2177452800 -35791395 minutes -gmt 1] \ [clock add 2177452800 -0x7fffffff seconds -gmt 1] ] } [lrepeat 2 {29894400 34214400 0 29966400 29969100 29969153}] test clock-30.33 {regression test - add with negative base (local seconds of the day, bug [482db1d796540e68])} { list \ [list \ [clock add -631152000 27463 days 3000 seconds -timezone :CET] \ [clock add -631152000 902 months 10 days 3000 seconds -timezone :CET] \ [clock add -631152000 75 years 69 days 3000 seconds -timezone :CET] \ [clock add -631152000 659112 hours 3000 seconds -timezone :CET] \ [clock add -631152000 39546720 minutes 3000 seconds -timezone :CET] \ [clock add -631152000 2372806200 seconds -timezone :CET] ] \ [list \ [clock add -631152000 27463 days 3000 seconds -gmt 1] \ [clock add -631152000 902 months 10 days 3000 seconds -gmt 1] \ [clock add -631152000 75 years 69 days 3000 seconds -gmt 1] \ [clock add -631152000 659112 hours 3000 seconds -gmt 1] \ [clock add -631152000 39546720 minutes 3000 seconds -gmt 1] \ [clock add -631152000 2372806200 seconds -gmt 1] ] } [lrepeat 2 [lrepeat 6 [expr {-631152000 + 2372806200}]]] test clock-30.34 {regression test - clock add jump over DST hole with TZ (1 day != 24 hours, etc)} -body { # time units (in opposite to date units) have to ignore DST hole (affects UTC only, so remain relative time), # however date units have to jump over the DST hole with retaining of current local time. proc test_add_dst {t args} { set exp [lindex $args end]; set args [lreplace $args end end] set tz [lindex $args end] set v [clock format [clock add $t {*}$args] -format "%Y-%m-%d %H:%M:%S %Z" -timezone $tz] if {$v ne $exp} { list "\"$v\" ne \"$exp\"" " while testing \[clock format \[clock add $t $args\] -format \"%Y-%m-%d %H:%M:%S %Z\" -timezone $tz\]" } } set t [clock scan "2024-03-31 01:59:59" -timezone :CET]; # 1 second before time switch CET/CEST join [list \ {*}[test_add_dst $t -timezone :CET {2024-03-31 01:59:59 CET}] \ {*}[test_add_dst $t -1 month -timezone :CET {2024-02-29 01:59:59 CET}] \ {*}[test_add_dst $t 1 second -1 month -timezone :CET {2024-02-29 03:00:00 CET}] \ {*}[test_add_dst $t -1 day -timezone :CET {2024-03-30 01:59:59 CET}] \ {*}[test_add_dst $t 1 second -1 day -timezone :CET {2024-03-30 03:00:00 CET}] \ {*}[test_add_dst $t 1 second -timezone :CET {2024-03-31 03:00:00 CEST}] \ {*}[test_add_dst $t 1 day -timezone :CET {2024-04-01 01:59:59 CEST}] \ {*}[test_add_dst $t 24 hours -timezone :CET {2024-04-01 02:59:59 CEST}] \ {*}[test_add_dst $t 1440 minutes -timezone :CET {2024-04-01 02:59:59 CEST}] \ {*}[test_add_dst $t 86400 seconds -timezone :CET {2024-04-01 02:59:59 CEST}] \ {*}[test_add_dst $t 1 second 1 day -timezone :CET {2024-04-01 03:00:00 CEST}] \ {*}[test_add_dst $t 1 second 24 hours -timezone :CET {2024-04-01 03:00:00 CEST}] \ {*}[test_add_dst $t 1 second 1440 minutes -timezone :CET {2024-04-01 03:00:00 CEST}] \ {*}[test_add_dst $t 1 second 86400 seconds -timezone :CET {2024-04-01 03:00:00 CEST}] \ {*}[test_add_dst $t 1 month -timezone :CET {2024-04-30 01:59:59 CEST}] \ {*}[test_add_dst $t 1 second 1 month -timezone :CET {2024-04-30 03:00:00 CEST}] \ \ {*}[test_add_dst $t -timezone :GMT {2024-03-31 00:59:59 GMT}] \ {*}[test_add_dst $t -1 month -timezone :GMT {2024-02-29 00:59:59 GMT}] \ {*}[test_add_dst $t 1 second -1 month -timezone :GMT {2024-02-29 01:00:00 GMT}] \ {*}[test_add_dst $t -1 day -timezone :GMT {2024-03-30 00:59:59 GMT}] \ {*}[test_add_dst $t 1 second -1 day -timezone :GMT {2024-03-30 01:00:00 GMT}] \ {*}[test_add_dst $t 1 second -timezone :GMT {2024-03-31 01:00:00 GMT}] \ {*}[test_add_dst $t 1 day -timezone :GMT {2024-04-01 00:59:59 GMT}] \ {*}[test_add_dst $t 24 hours -timezone :GMT {2024-04-01 00:59:59 GMT}] \ {*}[test_add_dst $t 1440 minutes -timezone :GMT {2024-04-01 00:59:59 GMT}] \ {*}[test_add_dst $t 86400 seconds -timezone :GMT {2024-04-01 00:59:59 GMT}] \ {*}[test_add_dst $t 1 second 1 day -timezone :GMT {2024-04-01 01:00:00 GMT}] \ {*}[test_add_dst $t 1 second 24 hours -timezone :GMT {2024-04-01 01:00:00 GMT}] \ {*}[test_add_dst $t 1 second 1440 minutes -timezone :GMT {2024-04-01 01:00:00 GMT}] \ {*}[test_add_dst $t 1 second 86400 seconds -timezone :GMT {2024-04-01 01:00:00 GMT}] \ {*}[test_add_dst $t 1 month -timezone :GMT {2024-04-30 00:59:59 GMT}] \ {*}[test_add_dst $t 1 second 1 month -timezone :GMT {2024-04-30 01:00:00 GMT}] \ ] \n } -cleanup { rename test_add_dst {} } -result {} # END testcases30 test clock-31.1 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -timezone :UTC -locale system -format %x } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -timezone :UTC -locale current \ -format {%d-%b-%Y}] test clock-31.2 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -timezone :UTC -locale system -format %Ex } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -timezone :UTC -locale current \ -format {the %d' day of %B %Y}] test clock-31.3 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -timezone :UTC -locale system -format %X } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -timezone :UTC -locale current \ -format {%l:%M:%S %p}] test clock-31.4 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -locale system -format %x } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -locale current -timezone EST5 \ -format {%d-%b-%Y}] test clock-31.5 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -locale system -format %Ex } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -locale current -timezone EST5 \ -format {the %d' day of %B %Y}] test clock-31.6 {system locale} \ -constraints {win noappverifier} \ -setup { ::testClock::_setupRegistry } \ -body { clock format 0 -locale system -format "%X %Z" } \ -cleanup { ::testClock::_cleanupRegistry } \ -result [clock format 0 -locale current -timezone EST5 \ -format {%l:%M:%S %p %Z}] test clock-32.1 {scan/format across the Gregorian change} { set problems {} set t [expr { wide(-6857395200) }] foreach d { 1 2 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 } \ j { 245 246 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 } { set u [format 1752-09-%02d $d] set s [clock format $t -format %Y-%m-%d \ -locale en_US_roman -timezone :UTC] if { $s ne $u } { append problems "formatting $t: $s should be $u\n" } set v [clock scan $u -format %Y-%m-%d \ -locale en_US_roman -timezone :UTC] if { $t ne $v } { append problems "scanning $u: $t should be $v\n" } set u [format 1752-%03d $j] set s [clock format $t -format %Y-%j \ -locale en_US_roman -timezone :UTC] if { $s ne $u } { append problems "formatting $t: $s should be $u\n" } set v [clock scan $u -format %Y-%j \ -locale en_US_roman -timezone :UTC] if { $t ne $v } { append problems "scanning $u: $t should be $v\n" } incr t 86400 } set problems } {} # Legacy tests # clock clicks test clock-33.1 {clock clicks tests} { expr {[clock clicks] + 1} concat {} } {} test clock-33.2 {clock clicks tests} { set start [clock clicks] after 10 set end [clock clicks] expr {$end > $start} } {1} test clock-33.3 {clock clicks tests} { list [catch {clock clicks foo} msg] $msg } {1 {bad option "foo": must be -milliseconds or -microseconds}} test clock-33.4 {clock clicks tests} { expr {[clock clicks -milliseconds] + 1} concat {} } {} test clock-33.4a {clock milliseconds} { expr { [clock milliseconds] + 1 } concat {} } {} test clock-33.5 {clock clicks tests, millisecond timing test} { # This test can fail on a system that is so heavily loaded that # the test takes >60 ms to run. if {[lindex [timerate { set start [clock clicks -milli] timerate {} 10; # short but precise busy wait set end [clock clicks -milli] } 1 1] 0] > 60000} { ::tcltest::Skip "timing issue" } # 60 msecs seems to be the max time slice under Windows 95/98 expr { ($end > $start) && (($end - $start) <= 60) ? "ok" : "test should have taken 0-60 ms, actually took [expr {$end - $start}]"} } {ok} test clock-33.5a {clock tests, millisecond timing test} { # This test can fail on a system that is so heavily loaded that # the test takes >60 ms to run. if {[lindex [timerate { set start [clock milliseconds] timerate {} 10; # short but precise busy wait set end [clock milliseconds] } 1 1] 0] > 60000} { ::tcltest::Skip "timing issue" } # 60 msecs seems to be the max time slice under Windows 95/98 expr { ($end > $start) && (($end - $start) <= 60) ? "ok" : "test should have taken 0-60 ms, actually took [expr {$end - $start}]"} } {ok} test clock-33.6 {clock clicks, milli with too much abbreviation} { list [catch { clock clicks ? } msg] $msg } {1 {bad option "?": must be -milliseconds or -microseconds}} test clock-33.7 {clock clicks, milli with too much abbreviation} { list [catch { clock clicks - } msg] $msg } {1 {ambiguous option "-": must be -milliseconds or -microseconds}} test clock-33.8 {clock clicks test, microsecond timing test} { # This test can fail on a system that is so heavily loaded that # the test takes >60 ms to run. if {[lindex [timerate { set start [clock clicks -micro] timerate {} 10; # short but precise busy wait set end [clock clicks -micro] } 1 1] 0] > 60000} { ::tcltest::Skip "timing issue" } expr {($end > $start) && (($end - $start) <= 60000)} } {1} test clock-33.8a {clock test, microsecond timing test} { # This test can fail on a system that is so heavily loaded that # the test takes >60 ms to run. if {[lindex [timerate { set start [clock microseconds] timerate {} 10; # short but precise busy wait set end [clock microseconds] } 1 1] 0] > 60000} { ::tcltest::Skip "timing issue" } expr {($end > $start) && (($end - $start) <= 60000)} } {1} test clock-33.9 {clock clicks test, millis align with seconds} { set t1 [clock seconds] while { 1 } { set t2 [clock clicks -millis] set t3 [clock seconds] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000 == $t3 } } {1} test clock-33.9a {clock test, millis align with seconds} { set t1 [clock seconds] while { 1 } { set t2 [clock milliseconds] set t3 [clock seconds] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000 == $t3 } } {1} test clock-33.10 {clock clicks test, micros align with seconds} { set t1 [clock seconds] while { 1 } { set t2 [clock clicks -micros] set t3 [clock seconds] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000000 == $t3 } } {1} test clock-33.10a {clock test, micros align with seconds} { set t1 [clock seconds] while { 1 } { set t2 [clock microseconds] set t3 [clock seconds] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000000 == $t3 } } {1} test clock-33.11 {clock clicks test, millis align with micros} { set t1 [clock clicks -millis] while { 1 } { set t2 [clock clicks -micros] set t3 [clock clicks -millis] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000 == $t3 } } {1} test clock-33.11a {clock test, millis align with micros} { set t1 [clock milliseconds] while { 1 } { set t2 [clock microseconds] set t3 [clock milliseconds] if { $t3 == $t1 } break set t1 $t3 } expr { $t2 / 1000 == $t3 } } {1} # clock scan set syntax "clock scan string ?-base seconds? ?-format string? ?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE? ?-validate boolean?" test clock-34.1 {clock scan tests} { list [catch {clock scan} msg] $msg } [subst {1 {wrong # args: should be "$syntax"}}] test clock-34.2 {clock scan tests} {*}{ -body {clock scan "bad-string"} -returnCodes error -match glob -result {unable to convert date-time string "bad-string"*} } test clock-34.3 {clock scan tests} { clock format [clock scan "14 Feb 92" -gmt true] \ -format {%m/%d/%y %I:%M:%S %p} -gmt true } {02/14/92 12:00:00 AM} test clock-34.4 {clock scan tests} { clock format [clock scan "Feb 14, 1992 12:20 PM" -gmt true] \ -format {%m/%d/%y %I:%M:%S %p} -gmt true } {02/14/92 12:20:00 PM} test clock-34.5 {clock scan tests} { clock format \ [clock scan "Feb 14, 1992 12:20 PM" -base 319363200 -gmt true] \ -format {%m/%d/%y %I:%M:%S %p} -gmt true } {02/14/92 12:20:00 PM} test clock-34.6 {clock scan tests} { set time [clock scan "Oct 23,1992 15:00"] clock format $time -format {%b %d,%Y %H:%M} } {Oct 23,1992 15:00} test clock-34.7 {clock scan tests} { set time [clock scan "Oct 23,1992 15:00 GMT"] clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true } {Oct 23,1992 15:00 GMT} test clock-34.8 {clock scan tests} { set time [clock scan "Oct 23,1992 15:00" -gmt true] clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true } {Oct 23,1992 15:00 GMT} test clock-34.9 {clock scan tests} { list [catch {clock scan "Jan 12" -bad arg} msg] $msg } [subst {1 {bad option "-bad": must be -base, -format, -gmt, -locale, -timezone or -validate}}] # The following two two tests test the two year date policy test clock-34.10 {clock scan tests} { set time [clock scan "1/1/71" -gmt true] clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true } {Jan 01,1971 00:00 GMT} test clock-34.11 {clock scan tests} { set time [clock scan "1/1/37" -gmt true] clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true } {Jan 01,2037 00:00 GMT} test clock-34.11.1 {clock scan tests: same century switch} { set times [clock scan "1/1/37" -gmt true] } [clock scan "1/1/37" -format "%m/%d/%y" -gmt true] test clock-34.11.2 {clock scan tests: same century switch} { set times [clock scan "1/1/38" -gmt true] } [clock scan "1/1/38" -format "%m/%d/%y" -gmt true] test clock-34.11.3 {clock scan tests: same century switch} { set times [clock scan "1/1/39" -gmt true] } [clock scan "1/1/39" -format "%m/%d/%y" -gmt true] test clock-34.12 {clock scan, relative times} { set time [clock scan "Oct 23, 1992 -1 day" -gmt true] clock format $time -format {%b %d, %Y} -gmt true } "Oct 22, 1992" test clock-34.13 {clock scan, ISO 8601 base date format} { set time [clock scan "19921023" -gmt true] clock format $time -format {%b %d, %Y} -gmt true } "Oct 23, 1992" test clock-34.14 {clock scan, ISO 8601 expanded date format} { set time [clock scan "1992-10-23" -gmt true] clock format $time -format {%b %d, %Y} -gmt true } "Oct 23, 1992" test clock-34.15 {clock scan, DD-Mon-YYYY format} { set time [clock scan "23-Oct-1992" -gmt true] clock format $time -format {%b %d, %Y} -gmt true } "Oct 23, 1992" test clock-34.16 {clock scan, ISO 8601 point in time format} { set time [clock scan "19921023T235959" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.16.1a {clock scan, ISO 8601 T literal optional (YYYYMMDDhhmmss)} { set time [clock scan "19921023235959" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.16.1b {clock scan, ISO 8601 T literal optional (YYYYMMDDhhmm)} { set time [clock scan "199210232359" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:00" test clock-34.16.2 {clock scan, ISO 8601 extended date time} { set time [clock scan "1992-10-23T23:59:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.17 {clock scan, ISO 8601 point in time format} { set time [clock scan "19921023 235959" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.17.2a {clock scan, ISO 8601 extended date time (YYYY-MM-DD hh:mm:ss)} { set time [clock scan "1992-10-23 23:59:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.17.2b {clock scan, ISO 8601 extended date time (YYYY-MM-DDThh:mm:ss)} { set time [clock scan "1992-10-23T23:59:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.17.2c {clock scan, ISO 8601 extended date time (YYYY-MM-DD hh:mm)} { set time [clock scan "1992-10-23 23:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:00" test clock-34.17.2d {clock scan, ISO 8601 extended date time (YYYY-MM-DDThh:mm)} { set time [clock scan "1992-10-23T23:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:00" test clock-34.17.3 {clock scan, TZ-word boundaries - Z is not TZ here } -body { set time [clock scan "1992-10-23Z23:59:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } -returnCodes error -match glob \ -result {unable to convert date-time string*} test clock-34.17.4 {clock scan, TZ-word boundaries - Z is TZ UTC here} { set time [clock scan "1992-10-23 Z 23:59:59" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.17.5 {clock scan, ISO 8601 extended date time with UTC TZ} { set time [clock scan "1992-10-23T23:59:59Z" -timezone :America/Detroit] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 23:59:59" test clock-34.18 {clock scan, ISO 8601 point in time format} { set time [clock scan "19921023T000000" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 00:00:00" test clock-34.18.2 {clock scan, ISO 8601 extended date time} { set time [clock scan "1992-10-23T00:00:00" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 00:00:00" test clock-34.18.3 {clock scan, TZ-word boundaries - Z is not TZ here } -body { set time [clock scan "1992-10-23Z00:00:00" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } -returnCodes error -match glob \ -result {unable to convert date-time string*} test clock-34.18.4 {clock scan, TZ-word boundaries - Z is TZ UTC here} { set time [clock scan "1992-10-23 Z 00:00:00" -gmt true] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 00:00:00" test clock-34.18.5 {clock scan, ISO 8601 extended date time with UTC TZ} { set time [clock scan "1992-10-23T00:00:00Z" -timezone :America/Detroit] clock format $time -format {%b %d, %Y %H:%M:%S} -gmt true } "Oct 23, 1992 00:00:00" test clock-34.20.1 {clock scan tests (-TZ)} { set time [clock scan "31 Jan 14 23:59:59 -0100" -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Feb 01,2014 00:59:59 GMT} test clock-34.20.2 {clock scan tests (+TZ)} { set time [clock scan "31 Jan 14 23:59:59 +0100" -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 31,2014 22:59:59 GMT} test clock-34.20.3 {clock scan tests (-TZ)} { set time [clock scan "23:59:59 -0100" -base 0 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 02,1970 00:59:59 GMT} test clock-34.20.4 {clock scan tests (+TZ)} { set time [clock scan "23:59:59 +0100" -base 0 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 01,1970 22:59:59 GMT} test clock-34.20.5 {clock scan tests (TZ)} { set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST" -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jun 30,2014 21:59:59 GMT} test clock-34.20.6 {clock scan tests (TZ)} { set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET" -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 31,2014 22:59:59 GMT} test clock-34.20.7 {clock scan tests (relspec, day unit not TZ)} { set time [clock scan "23:59:59 +15 day" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Feb 08,1970 23:59:59 GMT} test clock-34.20.8 {clock scan tests (relspec, day unit not TZ)} { set time [clock scan "23:59:59 -15 day" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 09,1970 23:59:59 GMT} test clock-34.20.9 {clock scan tests (merid and TZ)} { set time [clock scan "10:59 pm CET" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 24,1970 21:59:00 GMT} test clock-34.20.10 {clock scan tests (merid and TZ)} { set time [clock scan "10:59 pm +0100" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 24,1970 21:59:00 GMT} test clock-34.20.11 {clock scan tests (complex TZ)} { list [clock scan "GMT+1000" -base 100000000 -gmt 1] \ [clock scan "GMT+10" -base 100000000 -gmt 1] \ [clock scan "+1000" -base 100000000 -gmt 1] } [lrepeat 3 99964000] test clock-34.20.12 {clock scan tests (complex TZ)} { list [clock scan "GMT-1000" -base 100000000 -gmt 1] \ [clock scan "GMT-10" -base 100000000 -gmt 1] \ [clock scan "-1000" -base 100000000 -gmt 1] } [lrepeat 3 100036000] test clock-34.20.13 {clock scan tests (complex TZ)} { list [clock scan "GMT-0000" -base 100000000 -gmt 1] \ [clock scan "GMT+0000" -base 100000000 -gmt 1] \ [clock scan "GMT" -base 100000000 -gmt 1] } [lrepeat 3 100000000] test clock-34.20.14 {clock scan tests (complex TZ)} { list [clock scan "CET+1000" -base 100000000 -gmt 1] \ [clock scan "CET-1000" -base 100000000 -gmt 1] } {99960400 100032400} test clock-34.20.15 {clock scan tests (complex TZ)} { list [clock scan "CET-0000" -base 100000000 -gmt 1] \ [clock scan "CET+0000" -base 100000000 -gmt 1] \ [clock scan "CET" -base 100000000 -gmt 1] } [lrepeat 3 99996400] test clock-34.20.16 {clock scan tests (complex TZ)} { list [clock format [clock scan "00:00 GMT+1000" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00 GMT+10" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00 +1000" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00" -base 100000000 -timezone +1000] -gmt 1] } [lrepeat 4 "Fri Mar 02 14:00:00 GMT 1973"] test clock-34.20.17 {clock scan tests (complex TZ)} { list [clock format [clock scan "00:00 GMT+0100" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00 GMT+01" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00 GMT+1" -base 100000000 -gmt 1] -gmt 1] \ [clock format [clock scan "00:00" -base 100000000 -timezone +0100] -gmt 1] } [lrepeat 4 "Fri Mar 02 23:00:00 GMT 1973"] test clock-34.20.18 {clock scan tests (no TZ)} { list [clock scan "1000days" -base 100000000 -gmt 1] \ [clock scan "1000 days" -base 100000000 -gmt 1] \ [clock scan "+1000days" -base 100000000 -gmt 1] \ [clock scan "+1000 days" -base 100000000 -gmt 1] \ [clock scan "GMT +1000 days" -base 100000000 -gmt 1] \ [clock scan "00:00 GMT +1000 days" -base 100000000 -gmt 1] } [lrepeat 6 186364800] test clock-34.20.19 {clock scan tests (no TZ)} { list [clock scan "-1000days" -base 100000000 -gmt 1] \ [clock scan "-1000 days" -base 100000000 -gmt 1] \ [clock scan "GMT -1000days" -base 100000000 -gmt 1] \ [clock scan "00:00 GMT -1000 days" -base 100000000 -gmt 1] \ } [lrepeat 4 13564800] test clock-34.20.20 {clock scan tests (TZ, TZ + 1day)} { clock scan "00:00 GMT+1000 day" -base 100000000 -gmt 1 } 100015200 test clock-34.20.21 {clock scan tests (local date of base depends on given TZ, time apllied to different day)} { list [clock scan "23:59:59 -0100" -base 0 -timezone :CET] \ [clock scan "23:59:59 -0100" -base 0 -gmt 1] \ [clock scan "23:59:59 -0100" -base 0 -timezone -1400] \ [clock scan "23:59:59 -0100" -base 0 -timezone :Pacific/Apia] } {89999 89999 3599 3599} # CLOCK SCAN REAL TESTS # We use 5am PST, 31-12-1999 as the base for these scans because irrespective # of your local timezone it should always give us times on December 31, 1999 set 5amPST 946645200 test clock-34.19 {clock scan, number meridian} { set t1 [clock scan "5 am" -base $5amPST -gmt true] set t2 [clock scan "5 pm" -base $5amPST -gmt true] set t3 [clock scan "5 a.m." -base $5amPST -gmt true] set t4 [clock scan "5 p.m." -base $5amPST -gmt true] list \ [clock format $t1 -format {%b %d, %Y %H:%M:%S} -gmt true] \ [clock format $t2 -format {%b %d, %Y %H:%M:%S} -gmt true] \ [clock format $t3 -format {%b %d, %Y %H:%M:%S} -gmt true] \ [clock format $t4 -format {%b %d, %Y %H:%M:%S} -gmt true] } [list "Dec 31, 1999 05:00:00" "Dec 31, 1999 17:00:00" \ "Dec 31, 1999 05:00:00" "Dec 31, 1999 17:00:00"] test clock-34.20 {clock scan, number:number meridian} { clock format [clock scan "5:30 pm" -base $5amPST -gmt true] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 17:30:00" test clock-34.21 {clock scan, number:number-timezone} { clock format [clock scan "00:00-0800" -gmt true -base $5amPST] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 08:00:00" test clock-34.22 {clock scan, number:number:number o_merid} { clock format [clock scan "8:00:00" -gmt true -base $5amPST] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 08:00:00" test clock-34.23 {clock scan, number:number:number o_merid} { clock format [clock scan "8:00:00 am" -gmt true -base $5amPST] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 08:00:00" test clock-34.24 {clock scan, number:number:number o_merid} { clock format [clock scan "8:00:00 pm" -gmt true -base $5amPST] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 20:00:00" test clock-34.25 {clock scan, number:number:number-timezone} { clock format [clock scan "00:00:30-0800" -gmt true -base $5amPST] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Dec 31, 1999 08:00:30" test clock-34.26 {clock scan, DST for days} { clock scan "tomorrow" -base [clock scan "19991031 00:00:00"] } [clock scan "19991101 00:00:00"] test clock-34.27 {clock scan, DST for days} { clock scan "yesterday" -base [clock scan "19991101 00:00:00"] } [clock scan "19991031 00:00:00"] test clock-34.28 {clock scan, day} { clock format [clock scan "Monday" -gmt true -base 946627200] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Jan 03, 2000 00:00:00" test clock-34.29 {clock scan, number/number} { clock format [clock scan "1/1" -gmt true -base 946627200] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Jan 01, 1999 00:00:00" test clock-34.30 {clock scan, number/number} { clock format [clock scan "1/1/1999" -gmt true -base 946627200] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Jan 01, 1999 00:00:00" test clock-34.31 {clock scan, number/number} { clock format [clock scan "19990101" -gmt true -base 946627200] \ -format {%b %d, %Y %H:%M:%S} -gmt true } "Jan 01, 1999 00:00:00" test clock-34.32 {clock scan, relative minutes} { clock scan "now + 1 minute" -base 946627200 } 946627260 test clock-34.33 {clock scan, relative minutes} { clock scan "now +1 minute" -base 946627200 } 946627260 test clock-34.34 {clock scan, relative minutes} { clock scan "now 1 minute" -base 946627200 } 946627260 test clock-34.35 {clock scan, relative minutes} { clock scan "now - 1 minute" -base 946627200 } 946627140 test clock-34.36 {clock scan, relative minutes} { clock scan "now -1 minute" -base 946627200 } 946627140 test clock-34.37 {clock scan, day of week} { clock format [clock scan "wednesday" -base [clock scan 20000112]] \ -format {%b %d, %Y} } "Jan 12, 2000" test clock-34.38 {clock scan, next day of week} { clock format [clock scan "next wednesday" -base [clock scan 20000112]] \ -format {%b %d, %Y} } "Jan 19, 2000" test clock-34.39 {clock scan, day of week} { clock format [clock scan "thursday" -base [clock scan 20000112]] \ -format {%b %d, %Y} } "Jan 13, 2000" test clock-34.40 {clock scan, next day of week} { clock format [clock scan "next thursday" -base [clock scan 20000112]] \ -format {%b %d, %Y} } "Jan 20, 2000" test clock-34.40.1 {clock scan, ordinal month after relative date} { # This will fail without the bug fix (clock.tcl), as still missing # month/julian day conversion before ordinal month increment clock format [ \ clock scan "5 years 18 months 387 days" -base 0 -gmt 1 ] -format {%a, %b %d, %Y} -gmt 1 -locale en_US_roman } "Sat, Jul 23, 1977" test clock-34.40.2 {clock scan, ordinal month after relative date} { # This will fail without the bug fix (clock.tcl), as still missing # month/julian day conversion before ordinal month increment clock format [ \ clock scan "5 years 18 months 387 days next Jan" -base 0 -gmt 1 ] -format {%a, %b %d, %Y} -gmt 1 -locale en_US_roman } "Mon, Jan 23, 1978" test clock-34.40.3 {clock scan, day of week after ordinal date} { # This will fail without the bug fix (clock.tcl), because the relative # week day should be applied after whole date conversion clock format [ \ clock scan "5 years 18 months 387 days next January Fri" -base 0 -gmt 1 ] -format {%a, %b %d, %Y} -gmt 1 -locale en_US_roman } "Fri, Jan 27, 1978" # weekday specification and base. test clock-34.41 {2nd monday in november} { set res {} foreach i {91 92 93 94 95 96} { set nov8th [clock scan 11/8/$i] set monday [clock scan monday -base $nov8th] lappend res [clock format $monday -format %Y-%m-%d] } set res } {1991-11-11 1992-11-09 1993-11-08 1994-11-14 1995-11-13 1996-11-11} test clock-34.42 {2nd monday in november (2nd try)} { set res {} foreach i {91 92 93 94 95 96} { set nov1th [clock scan 11/1/$i] set monday [clock scan "2 monday" -base $nov1th] lappend res [clock format $monday -format %Y-%m-%d] } set res } {1991-11-11 1992-11-09 1993-11-08 1994-11-14 1995-11-13 1996-11-11} test clock-34.43 {last monday in november} { set res {} foreach i {91 92 93 94 95 96} { set dec1th [clock scan 12/1/$i] set monday [clock scan "monday 1 week ago" -base $dec1th] lappend res [clock format $monday -format %Y-%m-%d] } set res } {1991-11-25 1992-11-30 1993-11-29 1994-11-28 1995-11-27 1996-11-25} test clock-34.44 {2nd monday in november} { set res {} foreach i {91 92 93 94 95 96} { set nov8th [clock scan 11/8/$i -gmt 1] set monday [clock scan monday -base $nov8th -gmt 1] lappend res [clock format $monday -format %Y-%m-%d -gmt 1] } set res } {1991-11-11 1992-11-09 1993-11-08 1994-11-14 1995-11-13 1996-11-11} test clock-34.45 {2nd monday in november (2nd try)} { set res {} foreach i {91 92 93 94 95 96} { set nov1th [clock scan 11/1/$i -gmt 1] set monday [clock scan "2 monday" -base $nov1th -gmt 1] lappend res [clock format $monday -format %Y-%m-%d -gmt 1] } set res } {1991-11-11 1992-11-09 1993-11-08 1994-11-14 1995-11-13 1996-11-11} test clock-34.46 {last monday in november} { set res {} foreach i {91 92 93 94 95 96} { set dec1th [clock scan 12/1/$i -gmt 1] set monday [clock scan "monday 1 week ago" -base $dec1th -gmt 1] lappend res [clock format $monday -format %Y-%m-%d -gmt 1] } set res } {1991-11-25 1992-11-30 1993-11-29 1994-11-28 1995-11-27 1996-11-25} test clock-34.47 {ago with multiple relative units} { set base [clock scan "12/31/1999 00:00:00"] set res [clock scan "2 days 2 hours ago" -base $base] expr {$base - $res} } 180000 test clock-34.48 {more than one ToD} {*}{ -body {clock scan {10:00 11:00}} -returnCodes error -result {unable to convert date-time string "10:00 11:00": more than one time of day in string} } test clock-34.49 {more than one date} {*}{ -body {clock scan {1/1/2001 2/2/2002}} -returnCodes error -result {unable to convert date-time string "1/1/2001 2/2/2002": more than one date in string} } test clock-34.50 {more than one time zone} {*}{ -body {clock scan {10:00 EST CST}} -returnCodes error -result {unable to convert date-time string "10:00 EST CST": more than one time zone in string} } test clock-34.51 {more than one weekday} {*}{ -body {clock scan {Monday Tuesday}} -returnCodes error -result {unable to convert date-time string "Monday Tuesday": more than one weekday in string} } test clock-34.52 {more than one ordinal month} {*}{ -body {clock scan {next January next March}} -returnCodes error -result {unable to convert date-time string "next January next March": more than one ordinal month in string} } test clock-34.53 {clock scan, ISO 8601 point in time format} { set time [clock scan "19921023T00:00:00"] clock format $time -format {%b %d, %Y %H:%M:%S} } "Oct 23, 1992 00:00:00" test clock-34.54 {clock scan, ISO 8601 point in time format} { set time [clock scan "1992-10-23T00:00:00"] clock format $time -format {%b %d, %Y %H:%M:%S} } "Oct 23, 1992 00:00:00" test clock-34.55 {clock scan, ISO 8601 invalid TZ} -body { set time [clock scan "19921023MST000000"] clock format $time -format {%b %d, %Y %H:%M:%S} } -returnCodes error -match glob -result {unable to convert date-time string*} test clock-34.56 {clock scan, ISO 8601 invalid TZ} -body { set time [clock scan "19921023M000000"] clock format $time -format {%b %d, %Y %H:%M:%S} } -returnCodes error -match glob -result {unable to convert date-time string*} test clock-34.57 {clock scan, ISO 8601 invalid TZ} -body { set time [clock scan "1992-10-23M00:00:00"] clock format $time -format {%b %d, %Y %H:%M:%S} } -returnCodes error -match glob -result {unable to convert date-time string*} test clock-34.58 {clock scan, ISO 8601 invalid TZ} -body { set time [clock scan "1992-10-23MST00:00:00"] clock format $time -format {%b %d, %Y %H:%M:%S} } -returnCodes error -match glob -result {unable to convert date-time string*} test clock-34.59 {clock scan tests (-TZ)} { set time [clock scan "31 Jan 14 23:59:59 -0100"] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Feb 01,2014 00:59:59 GMT} test clock-34.60 {clock scan tests (+TZ)} { set time [clock scan "31 Jan 14 23:59:59 +0100"] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 31,2014 22:59:59 GMT} test clock-34.61 {clock scan tests (-TZ)} { set time [clock scan "23:59:59 -0100" -base 0 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 02,1970 00:59:59 GMT} test clock-34.62 {clock scan tests (+TZ)} { set time [clock scan "23:59:59 +0100" -base 0 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 01,1970 22:59:59 GMT} test clock-34.63 {clock scan tests (TZ)} { set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST"] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jun 30,2014 21:59:59 GMT} test clock-34.64 {clock scan tests (TZ)} { set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET"] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 31,2014 22:59:59 GMT} test clock-34.65 {clock scan tests (relspec, day unit not TZ)} { set time [clock scan "23:59:59 +15 day" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Feb 08,1970 23:59:59 GMT} test clock-34.66 {clock scan tests (relspec, day unit not TZ)} { set time [clock scan "23:59:59 -15 day" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 09,1970 23:59:59 GMT} test clock-34.67 {clock scan tests (merid and TZ)} { set time [clock scan "10:59 pm CET" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 24,1970 21:59:00 GMT} test clock-34.68 {clock scan tests (merid and TZ)} { set time [clock scan "10:59 pm +0100" -base 2000000 -gmt true] clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true } {Jan 24,1970 21:59:00 GMT} test clock-34.69.1 {relative from base, date switch} { set base [clock scan "12/31/2016 23:59:59" -gmt 1] clock format [clock scan "+1 second" \ -base $base -gmt 1] -gmt 1 -format {%Y-%m-%d %H:%M:%S} } {2017-01-01 00:00:00} test clock-34.69.2 {relative time, daylight switch} { set base [clock scan "03/27/2016" -timezone CET] set res {} lappend res [clock format [clock scan "+1 hour" \ -base $base -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] lappend res [clock format [clock scan "+2 hour" \ -base $base -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] } {{2016-03-27 01:00:00 CET} {2016-03-27 03:00:00 CEST}} test clock-34.69.3 {relative time with day increment / daylight switch} { set base [clock scan "03/27/2016" -timezone CET] set res {} lappend res [clock format [clock scan "+5 day +25 hour" \ -base [expr {$base - 6*24*60*60}] -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] lappend res [clock format [clock scan "+5 day +26 hour" \ -base [expr {$base - 6*24*60*60}] -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] } {{2016-03-27 01:00:00 CET} {2016-03-27 03:00:00 CEST}} test clock-34.69.4 {relative time with month & day increment / daylight switch} { set base [clock scan "03/27/2016" -timezone CET] set res {} lappend res [clock format [clock scan "next Mar +5 day +25 hour" \ -base [expr {$base - 35*24*60*60}] -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] lappend res [clock format [clock scan "next Mar +5 day +26 hour" \ -base [expr {$base - 35*24*60*60}] -timezone CET] -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}] } {{2016-03-27 01:00:00 CET} {2016-03-27 03:00:00 CEST}} test clock-34.70.1 {check date in DST-hole: daylight switch CET -> CEST} { set res {} # forwards set base 1459033200 for {set i 0} {$i <= 3} {incr i} { set d [clock scan "+$i hour" -base $base -timezone CET] lappend res "$d = [clock format $d -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}]" } lappend res "#--" # backwards set base 1459044000 for {set i 0} {$i <= 3} {incr i} { set d [clock scan "-$i hour" -base $base -timezone CET] lappend res "$d = [clock format $d -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}]" } set res } [split [regsub -all {^\n|\n$} { 1459033200 = 2016-03-27 00:00:00 CET 1459036800 = 2016-03-27 01:00:00 CET 1459040400 = 2016-03-27 03:00:00 CEST 1459044000 = 2016-03-27 04:00:00 CEST #-- 1459044000 = 2016-03-27 04:00:00 CEST 1459040400 = 2016-03-27 03:00:00 CEST 1459036800 = 2016-03-27 01:00:00 CET 1459033200 = 2016-03-27 00:00:00 CET } {}] \n] test clock-34.70.2 {check date in DST-hole: daylight switch CEST -> CET} { set res {} # forwards set base 1477782000 for {set i 0} {$i <= 3} {incr i} { set d [clock scan "+$i hour" -base $base -timezone CET] lappend res "$d = [clock format $d -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}]" } lappend res "#--" # backwards set base 1477792800 for {set i 0} {$i <= 3} {incr i} { set d [clock scan "-$i hour" -base $base -timezone CET] lappend res "$d = [clock format $d -timezone CET -format {%Y-%m-%d %H:%M:%S %Z}]" } set res } [split [regsub -all {^\n|\n$} { 1477782000 = 2016-10-30 01:00:00 CEST 1477785600 = 2016-10-30 02:00:00 CEST 1477789200 = 2016-10-30 02:00:00 CET 1477792800 = 2016-10-30 03:00:00 CET #-- 1477792800 = 2016-10-30 03:00:00 CET 1477789200 = 2016-10-30 02:00:00 CET 1477785600 = 2016-10-30 02:00:00 CEST 1477782000 = 2016-10-30 01:00:00 CEST } {}] \n] # clock seconds test clock-35.1 {clock seconds tests} { expr {[clock seconds] + 1} concat {} } {} test clock-35.2 {clock seconds tests} { list [catch {clock seconds foo} msg] $msg } {1 {wrong # args: should be "clock seconds"}} test clock-35.3 {clock seconds tests} { set start [clock seconds] after 2000 set end [clock seconds] expr {$end > $start} } {1} test clock-36.1 {clock scan next monthname} { clock format [clock scan "next june" -base [clock scan "june 1, 2000"]] \ -format %m.%Y } "06.2001" test clock-36.2 {clock scan next monthname} { clock format [clock scan "next july" -base [clock scan "june 1, 2000"]] \ -format %m.%Y } "07.2000" test clock-36.3 {clock scan next monthname} { clock format [clock scan "next may" -base [clock scan "june 1, 2000"]] \ -format %m.%Y } "05.2001" test clock-37.1 {%s gmt testing} { set s [clock scan "2017-05-10 09:00:00" -gmt 1] set a [clock format $s -format %s -gmt 0] set b [clock format $s -format %s -gmt 1] set c [clock scan $s -format %s -gmt 0] set d [clock scan $s -format %s -gmt 1] # %s, being the difference between local and Greenwich, does not # depend on the time zone. list [expr {$b-$a}] [expr {$d-$c}] } {0 0} test clock-37.2 {%Es gmt testing CET} { set s [clock scan "2017-01-10 09:00:00" -gmt 1] set a [clock format $s -format %Es -timezone CET] set b [clock format $s -format %Es -gmt 1] set c [clock scan $s -format %Es -timezone CET] set d [clock scan $s -format %Es -gmt 1] # %Es depend on the time zone (local seconds instead of posix seconds). list [expr {$b-$a}] [expr {$d-$c}] } {-3600 3600} test clock-37.3 {%Es gmt testing CEST} { set s [clock scan "2017-05-10 09:00:00" -gmt 1] set a [clock format $s -format %Es -timezone CET] set b [clock format $s -format %Es -gmt 1] set c [clock scan $s -format %Es -timezone CET] set d [clock scan $s -format %Es -gmt 1] # %Es depend on the time zone (local seconds instead of posix seconds). list [expr {$b-$a}] [expr {$d-$c}] } {-7200 7200} test clock-38.1 {regression - convertUTCToLocalViaC - east of Greenwich} \ -setup { set env(TZ) CET-01:00CEST-02:00,M3.5.0/02:00,M10.5.0/03:00 } \ -body { clock format 0 -format %H:%M:%S -timezone :localtime } \ -cleanup { unset -nocomplain env(TZ) } \ -result {01:00:00} test clock-38.2 {make sure TZ is not cached after unset} \ -body { set t1 [clock format 0 -locale en] # a time zone that is unlikely to anywhere set env(TZ) "+04:20" set t2 [clock format 0 -locale en] unset -nocomplain env(TZ) set t3 [clock format 0 -locale en] list [expr {$t1 eq $t3 && $t1 ne $t2}] [subst {"$t1" eq "$t3" && "$t1" ne "$t2"}] } \ -cleanup { unset -nocomplain env(TZ) } \ -match glob -result {1 *} test clock-38.3sc {ensure cache of base is correct for :localtime if TZ-env changing / scan} \ -body { set res {} foreach env(TZ) {GMT-11:30 GMT-07:30 GMT-03:30 GMT} \ i {{07:30:00} {03:30:00} {23:30:00} {20:00:00}} \ { lappend res [clock scan $i -format "%H:%M:%S" -base [expr {20*60*60}] -timezone :localtime] } set res } \ -cleanup { unset -nocomplain env(TZ) } \ -result [lrepeat 4 [expr {20*60*60}]] test clock-38.3fm {ensure cache of base is correct for :localtime if TZ-env changing / format} \ -body { set res {} foreach env(TZ) {GMT-11:30 GMT-07:30 GMT-03:30 GMT} { lappend res [clock format [expr {20*60*60}] -format "%Y-%m-%dT%H:%M:%S %Z" -timezone :localtime] } set res } \ -cleanup { unset -nocomplain env(TZ) } \ -result {{1970-01-02T07:30:00 +1130} {1970-01-02T03:30:00 +0730} {1970-01-01T23:30:00 +0330} {1970-01-01T20:00:00 +0000}} test clock-38.4sc {ensure cache of base is correct for :localtime if TZ-env changing / scan (system TZ, no registry)} \ -setup { ::testClock::_setupRegistry # simulate we have no registry, so system TZ and :localtime get +HHMM format proc ::tcl::clock::_hasRegistry {} {return 0} } -body { # force epoch switch and set first TZ (a time zone that is unlikely to anywhere) and use :localtime set env(TZ) "+03:20" clock scan "12:00:00" -format "%H:%M:%S" -base [expr {20*60*60}] -timezone :localtime -locale en # force epoch switch, with unset TZ, it shall be system timezone now unset -nocomplain env(TZ) set t1 [clock scan "12:00:00" -format "%H:%M:%S" -base [expr {20*60*60}] -locale en] # force epoch switch and set another TZ (a time zone that is unlikely to anywhere) and use system timezone set env(TZ) "+04:20" set t2 [clock scan "12:00:00" -format "%H:%M:%S" -base [expr {20*60*60}] -locale en] # force epoch switch, with unset TZ, it shall be again system timezone unset -nocomplain env(TZ) set t3 [clock scan "12:00:00" -format "%H:%M:%S" -base [expr {20*60*60}] -locale en] # compare scanned values (t1 must be equal t3 and not equal t2): list [expr {$t1 == $t3 && $t1 != $t2}] [subst {$t1 == $t3 && $t1 != $t2}] } -cleanup { unset -nocomplain env(TZ) ::testClock::_cleanupRegistry } -match glob -result {1 *} test clock-38.4fm {ensure cache of base is correct for :localtime if TZ-env changing / format (system TZ, no registry)} \ -setup { ::testClock::_setupRegistry # simulate we have no registry, so system TZ and :localtime get +HHMM format proc ::tcl::clock::_hasRegistry {} {return 0} } -body { # force epoch switch and set first TZ (a time zone that is unlikely to anywhere) and use :localtime set env(TZ) "+03:20" clock format 0 -timezone :localtime -locale en # force epoch switch, with unset TZ, it shall be system timezone now unset -nocomplain env(TZ) set t1 [clock format 0 -locale en] # force epoch switch and set another TZ (a time zone that is unlikely to anywhere) and use system timezone set env(TZ) "+04:20" set t2 [clock format 0 -locale en] # force epoch switch, with unset TZ, it shall be again system timezone unset -nocomplain env(TZ) set t3 [clock format 0 -locale en] # compare formatted values (t1 must be equal t3 and not equal t2): list [expr {$t1 eq $t3 && $t1 ne $t2}] [subst {"$t1" eq "$t3" && "$t1" ne "$t2"}] } -cleanup { unset -nocomplain env(TZ) ::testClock::_cleanupRegistry } -match glob -result {1 *} test clock-39.1 {regression - synonym timezones} { clock format 0 -format {%H:%M:%S} -timezone :US/Eastern } {19:00:00} test clock-40.1 {regression - bad month with -timezone :localtime} \ -setup { set env(TZ) UTC0 } \ -body { clock scan 2000-01-01T00:00:00 -timezone :localtime \ -format %Y-%m-%dT%H:%M:%S } \ -cleanup { unset -nocomplain env(TZ) } \ -result 946684800 test clock-41.1 {regression test - format group %k when hour is 0 } { clock format 0 -format %k -gmt true } { 0} test clock-42.1 {regression test - %z in :localtime when west of Greenwich } \ -setup { set env(TZ) EST5 } \ -body { clock format 0 -format %z -timezone :localtime } \ -cleanup { unset -nocomplain env(TZ) } \ -result {-0500} # 43.1 was a bad test - mktime returning -1 is an error according to Posix. test clock-44.1 {regression test - time zone name containing hyphen } \ -setup { set env(TZ) US/East-Indiana } \ -body { clock format 1098466496 -format %H:%M:%S%z -timezone US/East-Indiana } \ -cleanup { unset -nocomplain env(TZ) } \ -result {12:34:56-0500} test clock-44.2 {regression test - time zone containing only two digits} \ -body { clock scan 1985-04-12T10:15:30+04 -format %Y-%m-%dT%H:%M:%S%Z } \ -result 482134530 test clock-44.3 {regression test - spaces between some scan tokens are optional (TCL_CLOCK_FULL_COMPAT, no-strict only)} \ -body { list [clock scan {9 Apr 2024} -format {%d %b%Y} -gmt 1] \ [clock scan {Tue, 9 Apr 2024 00:00:00 +0000} -format {%a, %d %b%Y %H:%M:%S %Z} -gmt 1] } \ -result {1712620800 1712620800} test clock-44.4 {regression test - spaces between all scan tokens are optional (TCL_CLOCK_FULL_COMPAT, no-strict only)} \ -body { list [clock scan {9 Apr 2024} -format {%d%b%Y} -gmt 1] \ [clock scan {Tue, 9 Apr 2024 00:00:00 +0000} -format {%a,%d%b%Y%H:%M:%S%Z} -gmt 1] } \ -result {1712620800 1712620800} test clock-45.1 {compat: scan regression on spaces (multiple spaces in format)} \ -body { list \ [clock scan "11/08/2018 0612" -format "%m/%d/%Y %H%M" -gmt 1] \ [clock scan "11/08/2018 0612" -format "%m/%d/%Y %H%M" -gmt 1] \ [clock scan "11/08/2018 0612" -format "%m/%d/%Y %H%M" -gmt 1] \ [clock scan " 11/08/2018 0612" -format " %m/%d/%Y %H%M" -gmt 1] \ [clock scan " 11/08/2018 0612" -format " %m/%d/%Y %H%M" -gmt 1] \ [clock scan " 11/08/2018 0612" -format " %m/%d/%Y %H%M" -gmt 1] \ [clock scan "11/08/2018 0612 " -format "%m/%d/%Y %H%M " -gmt 1] \ [clock scan "11/08/2018 0612 " -format "%m/%d/%Y %H%M " -gmt 1] \ [clock scan "11/08/2018 0612 " -format "%m/%d/%Y %H%M " -gmt 1] } -result [lrepeat 9 1541657520] test clock-45.2 {compat: scan regression on spaces (multiple leading/trailing spaces in input)} \ -body { set sp [string repeat " " 20] list \ [clock scan "NOV 7${sp}" -format "%b %d" -base 0 -gmt 1 -locale en] \ [clock scan "${sp}NOV 7" -format "%b %d" -base 0 -gmt 1 -locale en] \ [clock scan "${sp}NOV 7${sp}" -format "%b %d" -base 0 -gmt 1 -locale en] \ [clock scan "1970 NOV 7${sp}" -format "%Y %b %d" -gmt 1 -locale en] \ [clock scan "${sp}1970 NOV 7" -format "%Y %b %d" -gmt 1 -locale en] \ [clock scan "${sp}1970 NOV 7${sp}" -format "%Y %b %d" -gmt 1 -locale en] } -result [lrepeat 6 26784000] test clock-45.3 {compat: scan regression on spaces (shortest match)} \ -body { list \ [clock scan "11 1 120" -format "%y%m%d %H%M%S" -gmt 1] \ [clock scan "11 1 120 " -format "%y%m%d %H%M%S" -gmt 1] \ [clock scan " 11 1 120" -format "%y%m%d %H%M%S" -gmt 1] \ [clock scan "11 1 120 " -format "%y%m%d %H%M%S " -gmt 1] \ [clock scan " 11 1 120" -format " %y%m%d %H%M%S" -gmt 1] } -result [lrepeat 5 978310920] test clock-45.4 {compat: scan regression on spaces (mandatory leading/trailing spaces in format)} \ -body { list \ [catch {clock scan "11 1 120" -format "%y%m%d %H%M%S " -gmt 1} ret] $ret \ [catch {clock scan "11 1 120" -format " %y%m%d %H%M%S" -gmt 1} ret] $ret \ [catch {clock scan "11 1 120" -format " %y%m%d %H%M%S " -gmt 1} ret] $ret } -result [lrepeat 3 1 "input string does not match supplied format"] test clock-45.5 {regression test - freescan no int overflow} { # note that the relative date changes currently reset the time to 00:00, # this can be changed later (simply achievable by adding 00:00 if expected): list \ [clock scan "+24856 days" -base 1600000000 -gmt 1] \ [clock scan "+815 months" -base 1600000000 -gmt 1] \ [clock scan "+69 years" -base 1600000000 -gmt 1] \ [clock scan "+596524 hours" -base 1600000000 -gmt 1] \ [clock scan "+35791395 minutes" -base 1600000000 -gmt 1] \ [clock scan "+2147483647 seconds" -base 1600000000 -gmt 1] } {3747513600 3743193600 3777408000 3747486400 3747483700 3747483647} test clock-45.6 {regression test - freescan no int overflow} { # note that the relative date changes currently reset the time to 00:00, # this can be changed later (simply achievable by adding 00:00 if expected): list \ [clock scan "-24856 days" -base 2177452800 -gmt 1] \ [clock scan "-815 months" -base 2177452800 -gmt 1] \ [clock scan "-69 years" -base 2177452800 -gmt 1] \ [clock scan "-596524 hours" -base 2177452800 -gmt 1] \ [clock scan "-35791395 minutes" -base 2177452800 -gmt 1] \ [clock scan "-2147483647 seconds" -base 2177452800 -gmt 1] } {29894400 34214400 0 29966400 29969100 29969153} test clock-46.1 {regression test - month zero} -constraints valid_off \ -body { clock scan 2004-00-00 -format %Y-%m-%d } -result [clock scan 2003-11-30 -format %Y-%m-%d] test clock-46.2 {regression test - month zero} -constraints valid_off \ -body { clock scan 20040000 } -result [clock scan 2003-11-30 -format %Y-%m-%d] test clock-46.3 {regression test - month thirteen} -constraints valid_off \ -body { clock scan 2004-13-01 -format %Y-%m-%d } -result [clock scan 2005-01-01 -format %Y-%m-%d] test clock-46.4 {regression test - month thirteen} -constraints valid_off \ -body { clock scan 20041301 } -result [clock scan 2005-01-01 -format %Y-%m-%d] test clock-46.5 {regression test - good time} \ -body { # 12:01 apm are valid input strings... list [clock scan "12:01 am" -base 0 -gmt 1] \ [clock scan "12:01 pm" -base 0 -gmt 1] } -result {60 43260} test clock-46.6 {freescan: regression test - bad time} -constraints valid_off \ -body { # 13:00 am/pm are invalid input strings... list [clock scan "13:00 am" -base 0 -gmt 1] \ [clock scan "13:00 pm" -base 0 -gmt 1] } -result {3600 46800} if {!$valid_mode} { test clock-46.7a {regression test - switch day by large not-valid time, see bug [3ee8f1c2a785f4d8]} {valid_off} { list [clock scan 23:59:59 -base 0 -gmt 1 -format %H:%M:%S] \ [clock scan 24:00:00 -base 0 -gmt 1 -format %H:%M:%S] \ [clock scan 48:00:00 -base 0 -gmt 1 -format %H:%M:%S] } {86399 86400 172800} test clock-46.7b {freescan: regression test - switch day by large not-valid time, see bug [3ee8f1c2a785f4d8]} {valid_off} { list [clock scan 23:59:59 -base 0 -gmt 1] \ [clock scan 24:00:00 -base 0 -gmt 1] \ [clock scan 48:00:00 -base 0 -gmt 1] } {86399 86400 172800} } else { test clock-46.8a {regression test - invalid time (hour)} { list [catch {clock scan 24:00:01 -base 0 -gmt 1 -format %H:%M:%S} msg] $msg \ [catch {clock scan 48:00:00 -base 0 -gmt 1 -format %H:%M:%S} msg] $msg } {1 {unable to convert input string: invalid time} 1 {unable to convert input string: invalid time (hour)}} test clock-46.8b {freescan: regression test - invalid time (hour)} { list [catch {clock scan 24:00:01 -base 0 -gmt 1} msg] $msg \ [catch {clock scan 48:00:00 -base 0 -gmt 1} msg] $msg } {1 {unable to convert input string: invalid time} 1 {unable to convert input string: invalid time (hour)}} } proc _invalid_test {testtz scnargs args} { global valid_mode # ensure validation works TZ independently, since the conversion # of local time to UTC may adjust date/time tokens, depending on TZ: set res {} if {$testtz eq ""} { set testtz {:GMT :CET {} :Europe/Berlin :localtime} } if {!$valid_mode} { # globally -valid 0, so add it explicitely lappend scnargs -valid 1 } foreach tz $testtz { foreach {v} $args { lappend res [catch {clock scan $v {*}$scnargs -timezone $tz} msg] $msg } } set res } # test without and with relative offsets: foreach {idx relstr} {"" "" "+rel" "+ 15 month + 40 days + 30 hours + 80 minutes +9999 seconds"} { test clock-46.10$idx {freescan: validation rules: invalid time} \ -body { # 13:00 am/pm are invalid input strings... _invalid_test {} {} "13:00 am$relstr" "13:00 pm$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid time (hour)}] test clock-46.11$idx {freescan: validation rules: invalid time} \ -body { # invalid minutes in input strings... _invalid_test {} {} "23:70$relstr" "11:80 pm$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid time (minutes)}] test clock-46.12$idx {freescan: validation rules: invalid time} \ -body { # invalid seconds in input strings... _invalid_test {} {} "23:00:70$relstr" "11:00:80 pm$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid time}] test clock-46.13$idx {freescan: validation rules: invalid day} \ -body { _invalid_test {} {} "29 Feb 2017$relstr" "30 Feb 2016$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid day}] test clock-46.14$idx {freescan: validation rules: invalid day} \ -body { _invalid_test {} {} "0 Feb 2017$relstr" "00 Feb 2017$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid day}] test clock-46.15$idx {freescan: validation rules: invalid month} \ -body { _invalid_test {} {} "13/13/2017$relstr" "00/00/2017$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid month}] test clock-46.16$idx {freescan: validation rules: invalid day of week} \ -body { _invalid_test {} {} "Sat Jan 02 00:00:00 1970$relstr" "Thu Jan 04 00:00:00 1970$relstr" } -result [lrepeat 10 1 {unable to convert input string: invalid day of week}] test clock-46.17$idx {scan: validation rules: invalid year} -setup { set orgcfg [list -min-year [::tcl::unsupported::clock::configure -min-year] -max-year [::tcl::unsupported::clock::configure -max-year] \ -year-century [::tcl::unsupported::clock::configure -year-century] -century-switch [::tcl::unsupported::clock::configure -century-switch]] ::tcl::unsupported::clock::configure -min-year 2000 -max-year 2100 -year-century 2000 -century-switch 38 } -body { _invalid_test {} {} "70-01-01$relstr" "1870-01-01$relstr" "9570-01-01$relstr" } -result [lrepeat 15 1 {unable to convert input string: invalid year}] -cleanup { ::tcl::unsupported::clock::configure {*}$orgcfg unset -nocomplain orgcfg } }; # foreach test clock-46.16-pos-fs {freescan: validation rules: valid day of week (must work for all weekdays)} \ -body { _invalid_test {:GMT -12:00 +12:00} {} {Sat, 01 Jan 2000 00:00:00} {Sun, 02 Jan 2000 00:00:00} {Mon, 03 Jan 2000 00:00:00} {Tue, 04 Jan 2000 00:00:00} {Wed, 05 Jan 2000 00:00:00} {Thu, 06 Jan 2000 00:00:00} {Fri, 07 Jan 2000 00:00:00} } -result [list \ 0 946684800 0 946771200 0 946857600 0 946944000 0 947030400 0 947116800 0 947203200 \ 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 0 947246400 \ 0 946641600 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 \ ] test clock-46.16-pos-fmt1 {scan with format: validation rules: valid day of week (must work for all weekdays)} \ -body { _invalid_test {:GMT -12:00 +12:00} {-format "%a, %d %b %Y %H:%M:%S"} {Sat, 01 Jan 2000 00:00:00} {Sun, 02 Jan 2000 00:00:00} {Mon, 03 Jan 2000 00:00:00} {Tue, 04 Jan 2000 00:00:00} {Wed, 05 Jan 2000 00:00:00} {Thu, 06 Jan 2000 00:00:00} {Fri, 07 Jan 2000 00:00:00} } -result [list \ 0 946684800 0 946771200 0 946857600 0 946944000 0 947030400 0 947116800 0 947203200 \ 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 0 947246400 \ 0 946641600 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 \ ] test clock-46.16-pos-fmt2 {scan with format: validation rules: valid day of week (must work for all weekdays)} \ -body { _invalid_test {:GMT -12:00 +12:00} {-format "%u, %d %b %Y %H:%M:%S"} {6, 01 Jan 2000 00:00:00} {7, 02 Jan 2000 00:00:00} {1, 03 Jan 2000 00:00:00} {2, 04 Jan 2000 00:00:00} {3, 05 Jan 2000 00:00:00} {4, 06 Jan 2000 00:00:00} {5, 07 Jan 2000 00:00:00} } -result [list \ 0 946684800 0 946771200 0 946857600 0 946944000 0 947030400 0 947116800 0 947203200 \ 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 0 947246400 \ 0 946641600 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 \ ] test clock-46.16-pos-fmt3 {scan with format: validation rules: valid day of week (must work for all weekdays)} \ -body { _invalid_test {:GMT -12:00 +12:00} {-format "%w, %d %b %Y %H:%M:%S"} {6, 01 Jan 2000 00:00:00} {0, 02 Jan 2000 00:00:00} {1, 03 Jan 2000 00:00:00} {2, 04 Jan 2000 00:00:00} {3, 05 Jan 2000 00:00:00} {4, 06 Jan 2000 00:00:00} {5, 07 Jan 2000 00:00:00} } -result [list \ 0 946684800 0 946771200 0 946857600 0 946944000 0 947030400 0 947116800 0 947203200 \ 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 0 947246400 \ 0 946641600 0 946728000 0 946814400 0 946900800 0 946987200 0 947073600 0 947160000 \ ] rename _invalid_test {} unset -nocomplain idx relstr set dst_hole_check { {":Europe/Berlin" "2017-03-26 01:59:59" "2017-03-26 02:00:00" "2017-03-26 02:59:59" "2017-03-26 03:00:00" "2017-10-29 01:59:59" "2017-10-29 02:00:00"} {":Europe/Berlin" "2018-03-25 01:59:59" "2018-03-25 02:00:00" "2018-03-25 02:59:59" "2018-03-25 03:00:00" "2018-10-28 01:59:59" "2018-10-28 02:00:00"} {":America/New_York" "2017-03-12 01:59:59" "2017-03-12 02:00:00" "2017-03-12 02:59:59" "2017-03-12 03:00:00" "2017-11-05 01:59:59" "2017-11-05 02:00:00"} {":America/New_York" "2018-03-11 01:59:59" "2018-03-11 02:00:00" "2018-03-11 02:59:59" "2018-03-11 03:00:00" "2018-11-04 01:59:59" "2018-11-04 02:00:00"} } test clock-46.19-1 {free-scan: validation rules: invalid time (DST-hole, out of range in time-zone)} \ -body { set res {} foreach tz $dst_hole_check { set dt [lassign $tz tz]; foreach dt $dt { lappend res [set v [catch {clock scan $dt -timezone $tz -valid 1} msg]] if {$v} { lappend res $msg } }} set res } -cleanup { unset -nocomplain res v dt tz } -result [lrepeat 4 \ {*}[list 0 {*}[lrepeat 2 1 {unable to convert input string: invalid time (does not exist in this time-zone)}] 0 0 0]] test clock-46.19-2 {free-scan: validation rules regression: all scans successful, if -valid 0} \ -body { set res {} set res {} foreach tz $dst_hole_check { set dt [lassign $tz tz]; foreach dt $dt { lappend res [set v [catch {clock scan $dt -timezone $tz} msg]] }} set res } -cleanup { unset -nocomplain res v dt tz } -result [lrepeat 4 {*}[if {$valid_mode} {list 0 1 1 0 0 0} else {list 0 0 0 0 0 0}]] test clock-46.19-3 {scan: validation rules: invalid time (DST-hole, out of range in time-zone)} \ -body { set res {} foreach tz $dst_hole_check { set dt [lassign $tz tz]; foreach dt $dt { lappend res [set v [catch {clock scan $dt -timezone $tz -format "%Y-%m-%d %H:%M:%S" -valid 1} msg]] if {$v} { lappend res $msg } }} set res } -cleanup { unset -nocomplain res v dt tz } -result [lrepeat 4 \ {*}[list 0 {*}[lrepeat 2 1 {unable to convert input string: invalid time (does not exist in this time-zone)}] 0 0 0]] test clock-46.19-4 {scan: validation rules regression: all scans successful, if -valid 0} \ -body { set res {} set res {} foreach tz $dst_hole_check { set dt [lassign $tz tz]; foreach dt $dt { lappend res [set v [catch {clock scan $dt -timezone $tz -format "%Y-%m-%d %H:%M:%S"} msg]] }} set res } -cleanup { unset -nocomplain res v dt tz } -result [lrepeat 4 {*}[if {$valid_mode} {list 0 1 1 0 0 0} else {list 0 0 0 0 0 0}]] unset -nocomplain dst_hole_check proc _invalid_test {args} { global valid_mode # ensure validation works TZ independently, since the conversion # of local time to UTC may adjust date/time tokens, depending on TZ: set res {} foreach tz {:GMT :CET {} :Europe/Berlin :localtime} { foreach {v fmt} $args { if {$valid_mode} { # globally -valid 1 lappend res [catch {clock scan $v -format $fmt -timezone $tz} msg] $msg } else { lappend res [catch {clock scan $v -format $fmt -valid 1 -timezone $tz} msg] $msg } } } set res } test clock-46.20 {scan: validation rules: invalid time} \ -body { # 13:00 am/pm are invalid input strings... _invalid_test "13:00 am" "%H:%M %p" "13:00 pm" "%H:%M %p" } -result [lrepeat 10 1 {unable to convert input string: invalid time (hour)}] test clock-46.21 {scan: validation rules: invalid time} \ -body { # invalid minutes in input strings... _invalid_test "23:70" "%H:%M" "11:80 pm" "%H:%M %p" } -result [lrepeat 10 1 {unable to convert input string: invalid time (minutes)}] test clock-46.22 {scan: validation rules: invalid time} \ -body { # invalid seconds in input strings... _invalid_test "23:00:70" "%H:%M:%S" "11:00:80 pm" "%H:%M:%S %p" } -result [lrepeat 10 1 {unable to convert input string: invalid time}] test clock-46.23 {scan: validation rules: invalid day} \ -body { _invalid_test "29 Feb 2017" "%d %b %Y" "30 Feb 2016" "%d %b %Y" } -result [lrepeat 10 1 {unable to convert input string: invalid day}] test clock-46.24 {scan: validation rules: invalid day} \ -body { _invalid_test "0 Feb 2017" "%d %b %Y" "00 Feb 2017" "%d %b %Y" } -result [lrepeat 10 1 {unable to convert input string: invalid day}] test clock-46.25 {scan: validation rules: invalid month} \ -body { _invalid_test "13/13/2017" "%m/%d/%Y" "00/01/2017" "%m/%d/%Y" } -result [lrepeat 10 1 {unable to convert input string: invalid month}] test clock-46.26 {scan: validation rules: ambiguous day} \ -body { _invalid_test "1970-01-02--004" "%Y-%m-%d--%j" "70-01-02--004" "%y-%m-%d--%j" } -result [lrepeat 10 1 {unable to convert input string: ambiguous day}] test clock-46.27 {scan: validation rules: ambiguous year} \ -body { _invalid_test "19700106 00W014" "%Y%m%d %gW%V%u" "1970006 00W014" "%Y%j %gW%V%u" } -result [lrepeat 10 1 {unable to convert input string: ambiguous year}] test clock-46.28 {scan: validation rules: invalid day of week} \ -body { _invalid_test "Sat Jan 02 00:00:00 1970" "%a %b %d %H:%M:%S %Y" } -result [lrepeat 5 1 {unable to convert input string: invalid day of week}] test clock-46.29-1 {scan: validation rules: invalid day of year} \ -body { _invalid_test "000-2017" "%j-%Y" "366-2017" "%j-%Y" "000-2017" "%j-%G" "366-2017" "%j-%G" } -result [lrepeat 20 1 {unable to convert input string: invalid day of year}] test clock-46.29-2 {scan: validation rules: valid day of leap/not leap year} \ -body { list [clock format [clock scan "366-2016" -format "%j-%Y" -valid 1 -gmt 1] -format "%d-%m-%Y" -gmt 1] \ [clock format [clock scan "365-2017" -format "%j-%Y" -valid 1 -gmt 1] -format "%d-%m-%Y" -gmt 1] \ [clock format [clock scan "366-2016" -format "%j-%G" -valid 1 -gmt 1] -format "%d-%m-%Y" -gmt 1] \ [clock format [clock scan "365-2017" -format "%j-%G" -valid 1 -gmt 1] -format "%d-%m-%Y" -gmt 1] } -result {31-12-2016 31-12-2017 31-12-2016 31-12-2017} test clock-46.30 {scan: validation rules: invalid year} -setup { set orgcfg [list -min-year [::tcl::unsupported::clock::configure -min-year] -max-year [::tcl::unsupported::clock::configure -max-year] \ -year-century [::tcl::unsupported::clock::configure -year-century] -century-switch [::tcl::unsupported::clock::configure -century-switch]] ::tcl::unsupported::clock::configure -min-year 2000 -max-year 2100 -year-century 2000 -century-switch 38 } -body { _invalid_test "01-01-70" "%d-%m-%y" "01-01-1870" "%d-%m-%C%y" "01-01-1970" "%d-%m-%Y" } -result [lrepeat 15 1 {unable to convert input string: invalid year}] -cleanup { ::tcl::unsupported::clock::configure {*}$orgcfg unset -nocomplain orgcfg } test clock-46.31 {scan: validation rules: invalid iso year} -setup { set orgcfg [list -min-year [::tcl::unsupported::clock::configure -min-year] -max-year [::tcl::unsupported::clock::configure -max-year] \ -year-century [::tcl::unsupported::clock::configure -year-century] -century-switch [::tcl::unsupported::clock::configure -century-switch]] ::tcl::unsupported::clock::configure -min-year 2000 -max-year 2100 -year-century 2000 -century-switch 38 } -body { _invalid_test "01-01-70" "%d-%m-%g" "01-01-9870" "%d-%m-%C%g" "01-01-9870" "%d-%m-%G" } -result [lrepeat 15 1 {unable to convert input string: invalid iso year}] -cleanup { ::tcl::unsupported::clock::configure {*}$orgcfg unset -nocomplain orgcfg } rename _invalid_test {} test clock-47.1 {regression test - four-digit time} { clock scan 0012 } [clock scan 0012 -format %H%M] test clock-47.2 {regression test - four digit time} { clock scan 0039 } [clock scan 0039 -format %H%M] test clock-48.1 {Bug 1185933: 'i' destroyed by clock init} -setup { interp create child } -body { interp eval child { set i 12345 clock format 0 list [catch { set i } result] $result } } -cleanup { interp delete child } -result {0 12345} test clock-49.1 {regression test - localtime with negative arg (Bug 1237907)} \ -body { list [catch { clock format -86400 -timezone :localtime -format %Y } result] $result } \ -match regexp \ -result {0 1969|1 {localtime failed \(clock value may be too large/small to represent\)}} test clock-49.2 {regression test - missing time zone file (Bug 1237907)} \ -constraints {win noappverifier} \ -setup { # override the registry so that the test takes place in New York time ::testClock::_setupRegistry # make it so New York time is a missing file dict set ::tcl::clock::WinZoneInfo \ {-18000 0 3600 0 11 0 1 2 0 0 0 0 3 0 2 2 0 0 0} \ :No/Such/File ::tcl::clock::ClearCaches } \ -body { list [::tcl::clock::GuessWindowsTimeZone] \ [clock format 0 -locale system -format "%H:%M:%S %Z"] \ [clock format -86400 -format "%Y"] } \ -cleanup { # restore the registry and environment ::testClock::_cleanupRegistry # put New York back on the map dict set ::tcl::clock::WinZoneInfo \ {-18000 0 3600 0 11 0 1 2 0 0 0 0 3 0 2 2 0 0 0} \ :America/New_York ::tcl::clock::ClearCaches } \ -result {<-0500>+05:00:00<-0400>+04:00:00,M3.2.0/02:00:00,M11.1.0/02:00:00 {19:00:00 -0500} 1969} test clock-50.1 {format / scan -1 as a local time} { if {[catch { clock scan \ [clock format -1 -format %Y%m%d%H%M%S -timezone :localtime] \ -format %Y%m%d%H%M%S -timezone :localtime } result]} { if { [regexp " too large" $result] } { set result -1 } } set result } -1 test clock-50.2 {format / scan -2 as a local time} { if {[catch { clock scan \ [clock format -2 -format %Y%m%d%H%M%S -timezone :localtime] \ -format %Y%m%d%H%M%S -timezone :localtime } result]} { if { [regexp " too large" $result] } { set result -2 } } set result } -2 test clock-51.1 {correct conversion of times in Sydney} { # Paul Mackerras reported a bug where DST rollover in New South Wales # was miscalculated. The problem was that tclZIC.tcl had a # typo in the switch case where DST begins/ends at a given time # Standard Time (that is, winter time). set result {} foreach t {1130601599 1130601600 1130637599 1130637600} { lappend result [clock format $t -format %H:%M:%S \ -timezone :Australia/Sydney] } set result } {01:59:59 03:00:00 12:59:59 13:00:00} test clock-52.1 {Posix timezone and conversion on last Sunday} { # Martin Lemburg reported a bug where if tzdata is missing, then # times are converted incorrectly in locales where DST conversion # happens in the last (nominal 5th) week of a month. set result {} set timezone -01:00:00-02:00:00,M3.5.0/02:00:00,M10.5.0/01:00:00 foreach t {1143334799 1143334800} { lappend result [clock format $t -format %H:%M:%S -timezone $timezone] \ [clock format $t -format %H:%M:%S -timezone :Europe/Berlin] } set result } {01:59:59 01:59:59 03:00:00 03:00:00} test clock-52.2 {correct conversion of times in Europe} { # [Bug 2207436] set result {} foreach t [list 1206838799 1206838800 1224982799 1224982800] { lappend result [clock format $t -format %H:%M:%S \ -timezone MET-1METDST] lappend result [clock format $t -format %H:%M:%S \ -timezone MET0METDST] } set result } {01:59:59 00:59:59 03:00:00 02:00:00 02:59:59 01:59:59 02:00:00 01:00:00} test clock-52.3 {correct conversion of times in Russia} { # [Bug 2207436] set result {} foreach t [list 1206799199 1206799200 1224943199 1224943200] { lappend result [clock format $t -format %H:%M:%S \ -timezone WST-12WSTDST] } set result } {01:59:59 03:00:00 02:59:59 02:00:00} test clock-52.4 {correct conversion of times in USA} { # [Bug 2207436] set result {} foreach t [list 1268549999 1268550000 1257055199 1257055200] { lappend result [clock format $t -format %H:%M:%S \ -timezone EST5EDT] } set result } {01:59:59 03:00:00 01:59:59 01:00:00} # Regression test for Bug # 1505383 test clock-53.1 {%EC %Ey} { clock format 0 -gmt true -locale en_US_roman -format %EC%Ey } mcmlxx # Test that glob-special characters can be handled in [clock] test clock-54.1 {glob specials in [clock format]} \ -setup { clock format 0 -gmt 1 -format %Y } \ -body { clock format 0 -gmt 1 -format {*[%Y%m%d]*} } \ -result {*[19700101]*} test clock-54.2 {glob specials in [clock scan]} \ -setup { clock scan 1970 -gmt 1 -format %Y } \ -body { clock scan {*[19700101]*} -format {*[%Y%m%d]*} -gmt 1 } \ -result 0 test clock-55.1 {Common Era} { clock format -62135769600 -gmt 1 -format {%d %m %Y %EE} } {01 01 0001 C.E.} test clock-55.2 {Common Era} { clock format -62135769600 -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } {01 01 0001 Anno Domini} test clock-55.3 {Before the Common Era} { clock format -62135769601 -gmt 1 -format {%d %m %Y %EE} } {31 12 0001 B.C.E.} test clock-55.4 {Before the Common Era} { clock format -62135769601 -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } {31 12 0001 Before Christ} test clock-55.5 {Common Era} { clock scan {01 01 0001 C.E.} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135769600 test clock-55.6 {Common Era} { clock scan {01 01 0001 A.D.} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135769600 test clock-55.7 {Common Era} { clock scan {01 01 0001 Anno Domini} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135769600 test clock-55.8 {Before the Common Era} { clock scan {31 12 0001 B.C.E.} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135856000 test clock-55.9 {Common Era} { clock scan {31 12 0001 B.C.} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135856000 test clock-55.10 {Common Era} { clock scan {31 12 0001 Before Christ} \ -gmt 1 -format {%d %m %Y %EE} -locale en_US_roman } -62135856000 test clock-56.1 {use of zoneinfo, version 1} {*}{ -setup { clock format [clock seconds] set tzdir [makeDirectory zoneinfo] set tzdir2 [makeDirectory Test $tzdir] set tzfile [makeFile {} PhoenixOne $tzdir2] set f [open $tzfile wb] puts -nonewline $f [binary format c* { 0x54 0x5a 0x69 0x66 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x0c 0x9e 0xa6 0x3a 0x90 0x9f 0xbb 0x07 0x80 0xa0 0x86 0x1c 0x90 0xa1 0x9a 0xe9 0x80 0xcb 0x89 0x0c 0x90 0xcf 0x17 0xdf 0x1c 0xcf 0x8f 0xe5 0xac 0xd0 0x81 0x1a 0x1c 0xfa 0xf8 0x75 0x10 0xfb 0xe8 0x58 0x00 0x00 0x01 0x00 0x01 0x02 0x01 0x02 0x01 0x00 0x01 0xff 0xff 0xab 0xa0 0x01 0x00 0xff 0xff 0x9d 0x90 0x00 0x04 0xff 0xff 0xab 0xa0 0x01 0x08 0x4d 0x44 0x54 0x00 0x4d 0x53 0x54 0x00 0x4d 0x57 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00 }] close $f set ::tcl::clock::ZoneinfoPaths \ [linsert $::tcl::clock::ZoneinfoPaths 0 $tzdir] ::tcl::clock::ClearCaches } -cleanup { set ::tcl::clock::ZoneinfoPaths \ [lrange $::tcl::clock::ZoneinfoPaths 1 end] ::tcl::clock::ClearCaches removeFile PhoenixOne $tzdir2 removeDirectory Test $tzdir removeDirectory zoneinfo } -body { clock format 1072940400 -timezone :Test/PhoenixOne \ -format {%Y-%m-%d %H:%M:%S %Z} } -result {2004-01-01 00:00:00 MST} } test clock-56.2 {use of zoneinfo, version 2} {*}{ -setup { clock format [clock seconds] set tzdir [makeDirectory zoneinfo] set tzdir2 [makeDirectory Test $tzdir] set tzfile [makeFile {} PhoenixTwo $tzdir2] set f [open $tzfile wb] puts -nonewline $f [binary format c* { 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x0c 0x9e 0xa6 0x3a 0x90 0x9f 0xbb 0x07 0x80 0xa0 0x86 0x1c 0x90 0xa1 0x9a 0xe9 0x80 0xcb 0x89 0x0c 0x90 0xcf 0x17 0xdf 0x1c 0xcf 0x8f 0xe5 0xac 0xd0 0x81 0x1a 0x1c 0xfa 0xf8 0x75 0x10 0xfb 0xe8 0x58 0x00 0x00 0x01 0x00 0x01 0x02 0x01 0x02 0x01 0x00 0x01 0xff 0xff 0xab 0xa0 0x01 0x00 0xff 0xff 0x9d 0x90 0x00 0x04 0xff 0xff 0xab 0xa0 0x01 0x08 0x4d 0x44 0x54 0x00 0x4d 0x53 0x54 0x00 0x4d 0x57 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0b 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x10 0xff 0xff 0xff 0xff 0x5e 0x04 0x0c 0xb0 0xff 0xff 0xff 0xff 0x9e 0xa6 0x3a 0x90 0xff 0xff 0xff 0xff 0x9f 0xbb 0x07 0x80 0xff 0xff 0xff 0xff 0xa0 0x86 0x1c 0x90 0xff 0xff 0xff 0xff 0xa1 0x9a 0xe9 0x80 0xff 0xff 0xff 0xff 0xcb 0x89 0x0c 0x90 0xff 0xff 0xff 0xff 0xcf 0x17 0xdf 0x1c 0xff 0xff 0xff 0xff 0xcf 0x8f 0xe5 0xac 0xff 0xff 0xff 0xff 0xd0 0x81 0x1a 0x1c 0xff 0xff 0xff 0xff 0xfa 0xf8 0x75 0x10 0xff 0xff 0xff 0xff 0xfb 0xe8 0x58 0x00 0x02 0x01 0x02 0x01 0x02 0x03 0x02 0x03 0x02 0x01 0x02 0xff 0xff 0x96 0xee 0x00 0x00 0xff 0xff 0xab 0xa0 0x01 0x04 0xff 0xff 0x9d 0x90 0x00 0x08 0xff 0xff 0xab 0xa0 0x01 0x0c 0x4c 0x4d 0x54 0x00 0x4d 0x44 0x54 0x00 0x4d 0x53 0x54 0x00 0x4d 0x57 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0a 0x4d 0x53 0x54 0x37 0x0a }] close $f set ::tcl::clock::ZoneinfoPaths \ [linsert $::tcl::clock::ZoneinfoPaths 0 $tzdir] ::tcl::clock::ClearCaches } -cleanup { set ::tcl::clock::ZoneinfoPaths \ [lrange $::tcl::clock::ZoneinfoPaths 1 end] ::tcl::clock::ClearCaches removeFile PhoenixTwo $tzdir2 removeDirectory Test $tzdir removeDirectory zoneinfo } -body { clock format 1072940400 -timezone :Test/PhoenixTwo \ -format {%Y-%m-%d %H:%M:%S %Z} } -result {2004-01-01 00:00:00 MST} } test clock-56.3 {use of zoneinfo, version 2, Y2038 compliance} {*}{ -setup { clock format [clock seconds] set tzdir [makeDirectory zoneinfo] set tzdir2 [makeDirectory Test $tzdir] set tzfile [makeFile {} TijuanaTwo $tzdir2] set f [open $tzfile wb] puts -nonewline $f [binary format c* { 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x95 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x18 0xa5 0xb6 0xf6 0x80 0xa9 0x79 0x4f 0x70 0xaf 0xf2 0x7c 0xf0 0xb6 0x66 0x64 0x70 0xb7 0x1b 0x10 0x00 0xb8 0x0a 0xf2 0xf0 0xcb 0xea 0x8d 0x80 0xd2 0x23 0xf4 0x70 0xd2 0x99 0xba 0x70 0xd7 0x1b 0x59 0x00 0xd8 0x91 0xb4 0xf0 0xe2 0x7e 0x59 0xa0 0xe3 0x49 0x52 0x90 0xe4 0x5e 0x3b 0xa0 0xe5 0x29 0x34 0x90 0xe6 0x47 0x58 0x20 0xe7 0x12 0x51 0x10 0xe8 0x27 0x3a 0x20 0xe8 0xf2 0x33 0x10 0xea 0x07 0x1c 0x20 0xea 0xd2 0x15 0x10 0xeb 0xe6 0xfe 0x20 0xec 0xb1 0xf7 0x10 0xed 0xc6 0xe0 0x20 0xee 0x91 0xd9 0x10 0x0b 0xe0 0xaf 0xa0 0x0c 0xd9 0xcd 0x10 0x0d 0xc0 0x91 0xa0 0x0e 0xb9 0xaf 0x10 0x0f 0xa9 0xae 0x20 0x10 0x99 0x91 0x10 0x11 0x89 0x90 0x20 0x12 0x79 0x73 0x10 0x13 0x69 0x72 0x20 0x14 0x59 0x55 0x10 0x15 0x49 0x54 0x20 0x16 0x39 0x37 0x10 0x17 0x29 0x36 0x20 0x18 0x22 0x53 0x90 0x19 0x09 0x18 0x20 0x1a 0x02 0x35 0x90 0x1a 0xf2 0x34 0xa0 0x1b 0xe2 0x17 0x90 0x1c 0xd2 0x16 0xa0 0x1d 0xc1 0xf9 0x90 0x1e 0xb1 0xf8 0xa0 0x1f 0xa1 0xdb 0x90 0x20 0x76 0x2b 0x20 0x21 0x81 0xbd 0x90 0x22 0x56 0x0d 0x20 0x23 0x6a 0xda 0x10 0x24 0x35 0xef 0x20 0x25 0x4a 0xbc 0x10 0x26 0x15 0xd1 0x20 0x27 0x2a 0x9e 0x10 0x27 0xfe 0xed 0xa0 0x29 0x0a 0x80 0x10 0x29 0xde 0xcf 0xa0 0x2a 0xea 0x62 0x10 0x2b 0xbe 0xb1 0xa0 0x2c 0xd3 0x7e 0x90 0x2d 0x9e 0x93 0xa0 0x2e 0xb3 0x60 0x90 0x2f 0x7e 0x75 0xa0 0x30 0x93 0x42 0x90 0x31 0x67 0x92 0x20 0x32 0x73 0x24 0x90 0x33 0x47 0x74 0x20 0x34 0x53 0x06 0x90 0x35 0x27 0x56 0x20 0x36 0x32 0xe8 0x90 0x37 0x07 0x38 0x20 0x38 0x1c 0x05 0x10 0x38 0xe7 0x1a 0x20 0x39 0xfb 0xe7 0x10 0x3a 0xc6 0xfc 0x20 0x3b 0xdb 0xc9 0x10 0x3c 0xb0 0x18 0xa0 0x3d 0xbb 0xab 0x10 0x3e 0x8f 0xfa 0xa0 0x3f 0x9b 0x8d 0x10 0x40 0x6f 0xdc 0xa0 0x41 0x84 0xa9 0x90 0x42 0x4f 0xbe 0xa0 0x43 0x64 0x8b 0x90 0x44 0x2f 0xa0 0xa0 0x45 0x44 0x6d 0x90 0x46 0x0f 0x82 0xa0 0x47 0x24 0x4f 0x90 0x47 0xf8 0x9f 0x20 0x49 0x04 0x31 0x90 0x49 0xd8 0x81 0x20 0x4a 0xe4 0x13 0x90 0x4b 0xb8 0x63 0x20 0x4c 0xcd 0x30 0x10 0x4d 0x98 0x45 0x20 0x4e 0xad 0x12 0x10 0x4f 0x78 0x27 0x20 0x50 0x8c 0xf4 0x10 0x51 0x61 0x43 0xa0 0x52 0x6c 0xd6 0x10 0x53 0x41 0x25 0xa0 0x54 0x4c 0xb8 0x10 0x55 0x21 0x07 0xa0 0x56 0x2c 0x9a 0x10 0x57 0x00 0xe9 0xa0 0x58 0x15 0xb6 0x90 0x58 0xe0 0xcb 0xa0 0x59 0xf5 0x98 0x90 0x5a 0xc0 0xad 0xa0 0x5b 0xd5 0x7a 0x90 0x5c 0xa9 0xca 0x20 0x5d 0xb5 0x5c 0x90 0x5e 0x89 0xac 0x20 0x5f 0x95 0x3e 0x90 0x60 0x69 0x8e 0x20 0x61 0x7e 0x5b 0x10 0x62 0x49 0x70 0x20 0x63 0x5e 0x3d 0x10 0x64 0x29 0x52 0x20 0x65 0x3e 0x1f 0x10 0x66 0x12 0x6e 0xa0 0x67 0x1e 0x01 0x10 0x67 0xf2 0x50 0xa0 0x68 0xfd 0xe3 0x10 0x69 0xd2 0x32 0xa0 0x6a 0xdd 0xc5 0x10 0x6b 0xb2 0x14 0xa0 0x6c 0xc6 0xe1 0x90 0x6d 0x91 0xf6 0xa0 0x6e 0xa6 0xc3 0x90 0x6f 0x71 0xd8 0xa0 0x70 0x86 0xa5 0x90 0x71 0x5a 0xf5 0x20 0x72 0x66 0x87 0x90 0x73 0x3a 0xd7 0x20 0x74 0x46 0x69 0x90 0x75 0x1a 0xb9 0x20 0x76 0x2f 0x86 0x10 0x76 0xfa 0x9b 0x20 0x78 0x0f 0x68 0x10 0x78 0xda 0x7d 0x20 0x79 0xef 0x4a 0x10 0x7a 0xba 0x5f 0x20 0x7b 0xcf 0x2c 0x10 0x7c 0xa3 0x7b 0xa0 0x7d 0xaf 0x0e 0x10 0x7e 0x83 0x5d 0xa0 0x7f 0x8e 0xf0 0x10 0x01 0x02 0x01 0x02 0x03 0x02 0x04 0x05 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0xff 0xff 0x92 0x4c 0x00 0x00 0xff 0xff 0x9d 0x90 0x00 0x04 0xff 0xff 0x8f 0x80 0x00 0x08 0xff 0xff 0x9d 0x90 0x01 0x0c 0xff 0xff 0x9d 0x90 0x01 0x10 0xff 0xff 0x9d 0x90 0x01 0x14 0x4c 0x4d 0x54 0x00 0x4d 0x53 0x54 0x00 0x50 0x53 0x54 0x00 0x50 0x44 0x54 0x00 0x50 0x57 0x54 0x00 0x50 0x50 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x01 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x95 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x18 0xff 0xff 0xff 0xff 0xa5 0xb6 0xf6 0x80 0xff 0xff 0xff 0xff 0xa9 0x79 0x4f 0x70 0xff 0xff 0xff 0xff 0xaf 0xf2 0x7c 0xf0 0xff 0xff 0xff 0xff 0xb6 0x66 0x64 0x70 0xff 0xff 0xff 0xff 0xb7 0x1b 0x10 0x00 0xff 0xff 0xff 0xff 0xb8 0x0a 0xf2 0xf0 0xff 0xff 0xff 0xff 0xcb 0xea 0x8d 0x80 0xff 0xff 0xff 0xff 0xd2 0x23 0xf4 0x70 0xff 0xff 0xff 0xff 0xd2 0x99 0xba 0x70 0xff 0xff 0xff 0xff 0xd7 0x1b 0x59 0x00 0xff 0xff 0xff 0xff 0xd8 0x91 0xb4 0xf0 0xff 0xff 0xff 0xff 0xe2 0x7e 0x59 0xa0 0xff 0xff 0xff 0xff 0xe3 0x49 0x52 0x90 0xff 0xff 0xff 0xff 0xe4 0x5e 0x3b 0xa0 0xff 0xff 0xff 0xff 0xe5 0x29 0x34 0x90 0xff 0xff 0xff 0xff 0xe6 0x47 0x58 0x20 0xff 0xff 0xff 0xff 0xe7 0x12 0x51 0x10 0xff 0xff 0xff 0xff 0xe8 0x27 0x3a 0x20 0xff 0xff 0xff 0xff 0xe8 0xf2 0x33 0x10 0xff 0xff 0xff 0xff 0xea 0x07 0x1c 0x20 0xff 0xff 0xff 0xff 0xea 0xd2 0x15 0x10 0xff 0xff 0xff 0xff 0xeb 0xe6 0xfe 0x20 0xff 0xff 0xff 0xff 0xec 0xb1 0xf7 0x10 0xff 0xff 0xff 0xff 0xed 0xc6 0xe0 0x20 0xff 0xff 0xff 0xff 0xee 0x91 0xd9 0x10 0x00 0x00 0x00 0x00 0x0b 0xe0 0xaf 0xa0 0x00 0x00 0x00 0x00 0x0c 0xd9 0xcd 0x10 0x00 0x00 0x00 0x00 0x0d 0xc0 0x91 0xa0 0x00 0x00 0x00 0x00 0x0e 0xb9 0xaf 0x10 0x00 0x00 0x00 0x00 0x0f 0xa9 0xae 0x20 0x00 0x00 0x00 0x00 0x10 0x99 0x91 0x10 0x00 0x00 0x00 0x00 0x11 0x89 0x90 0x20 0x00 0x00 0x00 0x00 0x12 0x79 0x73 0x10 0x00 0x00 0x00 0x00 0x13 0x69 0x72 0x20 0x00 0x00 0x00 0x00 0x14 0x59 0x55 0x10 0x00 0x00 0x00 0x00 0x15 0x49 0x54 0x20 0x00 0x00 0x00 0x00 0x16 0x39 0x37 0x10 0x00 0x00 0x00 0x00 0x17 0x29 0x36 0x20 0x00 0x00 0x00 0x00 0x18 0x22 0x53 0x90 0x00 0x00 0x00 0x00 0x19 0x09 0x18 0x20 0x00 0x00 0x00 0x00 0x1a 0x02 0x35 0x90 0x00 0x00 0x00 0x00 0x1a 0xf2 0x34 0xa0 0x00 0x00 0x00 0x00 0x1b 0xe2 0x17 0x90 0x00 0x00 0x00 0x00 0x1c 0xd2 0x16 0xa0 0x00 0x00 0x00 0x00 0x1d 0xc1 0xf9 0x90 0x00 0x00 0x00 0x00 0x1e 0xb1 0xf8 0xa0 0x00 0x00 0x00 0x00 0x1f 0xa1 0xdb 0x90 0x00 0x00 0x00 0x00 0x20 0x76 0x2b 0x20 0x00 0x00 0x00 0x00 0x21 0x81 0xbd 0x90 0x00 0x00 0x00 0x00 0x22 0x56 0x0d 0x20 0x00 0x00 0x00 0x00 0x23 0x6a 0xda 0x10 0x00 0x00 0x00 0x00 0x24 0x35 0xef 0x20 0x00 0x00 0x00 0x00 0x25 0x4a 0xbc 0x10 0x00 0x00 0x00 0x00 0x26 0x15 0xd1 0x20 0x00 0x00 0x00 0x00 0x27 0x2a 0x9e 0x10 0x00 0x00 0x00 0x00 0x27 0xfe 0xed 0xa0 0x00 0x00 0x00 0x00 0x29 0x0a 0x80 0x10 0x00 0x00 0x00 0x00 0x29 0xde 0xcf 0xa0 0x00 0x00 0x00 0x00 0x2a 0xea 0x62 0x10 0x00 0x00 0x00 0x00 0x2b 0xbe 0xb1 0xa0 0x00 0x00 0x00 0x00 0x2c 0xd3 0x7e 0x90 0x00 0x00 0x00 0x00 0x2d 0x9e 0x93 0xa0 0x00 0x00 0x00 0x00 0x2e 0xb3 0x60 0x90 0x00 0x00 0x00 0x00 0x2f 0x7e 0x75 0xa0 0x00 0x00 0x00 0x00 0x30 0x93 0x42 0x90 0x00 0x00 0x00 0x00 0x31 0x67 0x92 0x20 0x00 0x00 0x00 0x00 0x32 0x73 0x24 0x90 0x00 0x00 0x00 0x00 0x33 0x47 0x74 0x20 0x00 0x00 0x00 0x00 0x34 0x53 0x06 0x90 0x00 0x00 0x00 0x00 0x35 0x27 0x56 0x20 0x00 0x00 0x00 0x00 0x36 0x32 0xe8 0x90 0x00 0x00 0x00 0x00 0x37 0x07 0x38 0x20 0x00 0x00 0x00 0x00 0x38 0x1c 0x05 0x10 0x00 0x00 0x00 0x00 0x38 0xe7 0x1a 0x20 0x00 0x00 0x00 0x00 0x39 0xfb 0xe7 0x10 0x00 0x00 0x00 0x00 0x3a 0xc6 0xfc 0x20 0x00 0x00 0x00 0x00 0x3b 0xdb 0xc9 0x10 0x00 0x00 0x00 0x00 0x3c 0xb0 0x18 0xa0 0x00 0x00 0x00 0x00 0x3d 0xbb 0xab 0x10 0x00 0x00 0x00 0x00 0x3e 0x8f 0xfa 0xa0 0x00 0x00 0x00 0x00 0x3f 0x9b 0x8d 0x10 0x00 0x00 0x00 0x00 0x40 0x6f 0xdc 0xa0 0x00 0x00 0x00 0x00 0x41 0x84 0xa9 0x90 0x00 0x00 0x00 0x00 0x42 0x4f 0xbe 0xa0 0x00 0x00 0x00 0x00 0x43 0x64 0x8b 0x90 0x00 0x00 0x00 0x00 0x44 0x2f 0xa0 0xa0 0x00 0x00 0x00 0x00 0x45 0x44 0x6d 0x90 0x00 0x00 0x00 0x00 0x46 0x0f 0x82 0xa0 0x00 0x00 0x00 0x00 0x47 0x24 0x4f 0x90 0x00 0x00 0x00 0x00 0x47 0xf8 0x9f 0x20 0x00 0x00 0x00 0x00 0x49 0x04 0x31 0x90 0x00 0x00 0x00 0x00 0x49 0xd8 0x81 0x20 0x00 0x00 0x00 0x00 0x4a 0xe4 0x13 0x90 0x00 0x00 0x00 0x00 0x4b 0xb8 0x63 0x20 0x00 0x00 0x00 0x00 0x4c 0xcd 0x30 0x10 0x00 0x00 0x00 0x00 0x4d 0x98 0x45 0x20 0x00 0x00 0x00 0x00 0x4e 0xad 0x12 0x10 0x00 0x00 0x00 0x00 0x4f 0x78 0x27 0x20 0x00 0x00 0x00 0x00 0x50 0x8c 0xf4 0x10 0x00 0x00 0x00 0x00 0x51 0x61 0x43 0xa0 0x00 0x00 0x00 0x00 0x52 0x6c 0xd6 0x10 0x00 0x00 0x00 0x00 0x53 0x41 0x25 0xa0 0x00 0x00 0x00 0x00 0x54 0x4c 0xb8 0x10 0x00 0x00 0x00 0x00 0x55 0x21 0x07 0xa0 0x00 0x00 0x00 0x00 0x56 0x2c 0x9a 0x10 0x00 0x00 0x00 0x00 0x57 0x00 0xe9 0xa0 0x00 0x00 0x00 0x00 0x58 0x15 0xb6 0x90 0x00 0x00 0x00 0x00 0x58 0xe0 0xcb 0xa0 0x00 0x00 0x00 0x00 0x59 0xf5 0x98 0x90 0x00 0x00 0x00 0x00 0x5a 0xc0 0xad 0xa0 0x00 0x00 0x00 0x00 0x5b 0xd5 0x7a 0x90 0x00 0x00 0x00 0x00 0x5c 0xa9 0xca 0x20 0x00 0x00 0x00 0x00 0x5d 0xb5 0x5c 0x90 0x00 0x00 0x00 0x00 0x5e 0x89 0xac 0x20 0x00 0x00 0x00 0x00 0x5f 0x95 0x3e 0x90 0x00 0x00 0x00 0x00 0x60 0x69 0x8e 0x20 0x00 0x00 0x00 0x00 0x61 0x7e 0x5b 0x10 0x00 0x00 0x00 0x00 0x62 0x49 0x70 0x20 0x00 0x00 0x00 0x00 0x63 0x5e 0x3d 0x10 0x00 0x00 0x00 0x00 0x64 0x29 0x52 0x20 0x00 0x00 0x00 0x00 0x65 0x3e 0x1f 0x10 0x00 0x00 0x00 0x00 0x66 0x12 0x6e 0xa0 0x00 0x00 0x00 0x00 0x67 0x1e 0x01 0x10 0x00 0x00 0x00 0x00 0x67 0xf2 0x50 0xa0 0x00 0x00 0x00 0x00 0x68 0xfd 0xe3 0x10 0x00 0x00 0x00 0x00 0x69 0xd2 0x32 0xa0 0x00 0x00 0x00 0x00 0x6a 0xdd 0xc5 0x10 0x00 0x00 0x00 0x00 0x6b 0xb2 0x14 0xa0 0x00 0x00 0x00 0x00 0x6c 0xc6 0xe1 0x90 0x00 0x00 0x00 0x00 0x6d 0x91 0xf6 0xa0 0x00 0x00 0x00 0x00 0x6e 0xa6 0xc3 0x90 0x00 0x00 0x00 0x00 0x6f 0x71 0xd8 0xa0 0x00 0x00 0x00 0x00 0x70 0x86 0xa5 0x90 0x00 0x00 0x00 0x00 0x71 0x5a 0xf5 0x20 0x00 0x00 0x00 0x00 0x72 0x66 0x87 0x90 0x00 0x00 0x00 0x00 0x73 0x3a 0xd7 0x20 0x00 0x00 0x00 0x00 0x74 0x46 0x69 0x90 0x00 0x00 0x00 0x00 0x75 0x1a 0xb9 0x20 0x00 0x00 0x00 0x00 0x76 0x2f 0x86 0x10 0x00 0x00 0x00 0x00 0x76 0xfa 0x9b 0x20 0x00 0x00 0x00 0x00 0x78 0x0f 0x68 0x10 0x00 0x00 0x00 0x00 0x78 0xda 0x7d 0x20 0x00 0x00 0x00 0x00 0x79 0xef 0x4a 0x10 0x00 0x00 0x00 0x00 0x7a 0xba 0x5f 0x20 0x00 0x00 0x00 0x00 0x7b 0xcf 0x2c 0x10 0x00 0x00 0x00 0x00 0x7c 0xa3 0x7b 0xa0 0x00 0x00 0x00 0x00 0x7d 0xaf 0x0e 0x10 0x00 0x00 0x00 0x00 0x7e 0x83 0x5d 0xa0 0x00 0x00 0x00 0x00 0x7f 0x8e 0xf0 0x10 0x01 0x02 0x01 0x02 0x03 0x02 0x04 0x05 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0x03 0x02 0xff 0xff 0x92 0x4c 0x00 0x00 0xff 0xff 0x9d 0x90 0x00 0x04 0xff 0xff 0x8f 0x80 0x00 0x08 0xff 0xff 0x9d 0x90 0x01 0x0c 0xff 0xff 0x9d 0x90 0x01 0x10 0xff 0xff 0x9d 0x90 0x01 0x14 0x4c 0x4d 0x54 0x00 0x4d 0x53 0x54 0x00 0x50 0x53 0x54 0x00 0x50 0x44 0x54 0x00 0x50 0x57 0x54 0x00 0x50 0x50 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x01 0x0a 0x50 0x53 0x54 0x38 0x50 0x44 0x54 0x2c 0x4d 0x34 0x2e 0x31 0x2e 0x30 0x2c 0x4d 0x31 0x30 0x2e 0x35 0x2e 0x30 0x0a }] close $f set ::tcl::clock::ZoneinfoPaths \ [linsert $::tcl::clock::ZoneinfoPaths 0 $tzdir] ::tcl::clock::ClearCaches } -cleanup { set ::tcl::clock::ZoneinfoPaths \ [lrange $::tcl::clock::ZoneinfoPaths 1 end] ::tcl::clock::ClearCaches removeFile TijuanaTwo $tzdir2 removeDirectory Test $tzdir removeDirectory zoneinfo } -body { clock format 2224738800 -timezone :Test/TijuanaTwo \ -format {%Y-%m-%d %H:%M:%S %Z} } -result {2040-07-01 00:00:00 PDT} } test clock-56.4 {Bug 3470928} {*}{ -setup { clock format [clock seconds] set tzdir [makeDirectory zoneinfo] set tzdir2 [makeDirectory Test $tzdir] set tzfile [makeFile {} Windhoek $tzdir2] set f [open $tzfile wb] puts -nonewline $f [binary format c* { 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x5c 0x00 0x00 0x00 0x06 0x00 0x00 0x00 0x13 0x82 0x46 0xcf 0x68 0xcc 0xae 0x8c 0x80 0xcd 0x9e 0x6f 0x70 0x26 0x06 0xa7 0xe0 0x2d 0x9d 0xea 0xe0 0x2e 0x69 0x1c 0x10 0x2f 0x7d 0xe9 0x00 0x30 0x48 0xfe 0x10 0x31 0x67 0x05 0x80 0x32 0x28 0xe0 0x10 0x33 0x46 0xe7 0x80 0x34 0x11 0xfc 0x90 0x35 0x26 0xc9 0x80 0x35 0xf1 0xde 0x90 0x37 0x06 0xab 0x80 0x37 0xd1 0xc0 0x90 0x38 0xe6 0x8d 0x80 0x39 0xb1 0xa2 0x90 0x3a 0xc6 0x6f 0x80 0x3b 0x91 0x84 0x90 0x3c 0xaf 0x8c 0x00 0x3d 0x71 0x66 0x90 0x3e 0x8f 0x6e 0x00 0x3f 0x5a 0x83 0x10 0x40 0x6f 0x50 0x00 0x41 0x3a 0x65 0x10 0x42 0x4f 0x32 0x00 0x43 0x1a 0x47 0x10 0x44 0x2f 0x14 0x00 0x44 0xfa 0x29 0x10 0x46 0x0e 0xf6 0x00 0x46 0xda 0x0b 0x10 0x47 0xf8 0x12 0x80 0x48 0xc3 0x27 0x90 0x49 0xd7 0xf4 0x80 0x4a 0xa3 0x09 0x90 0x4b 0xb7 0xd6 0x80 0x4c 0x82 0xeb 0x90 0x4d 0x97 0xb8 0x80 0x4e 0x62 0xcd 0x90 0x4f 0x77 0x9a 0x80 0x50 0x42 0xaf 0x90 0x51 0x60 0xb7 0x00 0x52 0x22 0x91 0x90 0x53 0x40 0x99 0x00 0x54 0x0b 0xae 0x10 0x55 0x20 0x7b 0x00 0x55 0xeb 0x90 0x10 0x57 0x00 0x5d 0x00 0x57 0xcb 0x72 0x10 0x58 0xe0 0x3f 0x00 0x59 0xab 0x54 0x10 0x5a 0xc0 0x21 0x00 0x5b 0x8b 0x36 0x10 0x5c 0xa9 0x3d 0x80 0x5d 0x6b 0x18 0x10 0x5e 0x89 0x1f 0x80 0x5f 0x54 0x34 0x90 0x60 0x69 0x01 0x80 0x61 0x34 0x16 0x90 0x62 0x48 0xe3 0x80 0x63 0x13 0xf8 0x90 0x64 0x28 0xc5 0x80 0x64 0xf3 0xda 0x90 0x66 0x11 0xe2 0x00 0x66 0xd3 0xbc 0x90 0x67 0xf1 0xc4 0x00 0x68 0xbc 0xd9 0x10 0x69 0xd1 0xa6 0x00 0x6a 0x9c 0xbb 0x10 0x6b 0xb1 0x88 0x00 0x6c 0x7c 0x9d 0x10 0x6d 0x91 0x6a 0x00 0x6e 0x5c 0x7f 0x10 0x6f 0x71 0x4c 0x00 0x70 0x3c 0x61 0x10 0x71 0x5a 0x68 0x80 0x72 0x1c 0x43 0x10 0x73 0x3a 0x4a 0x80 0x74 0x05 0x5f 0x90 0x75 0x1a 0x2c 0x80 0x75 0xe5 0x41 0x90 0x76 0xfa 0x0e 0x80 0x77 0xc5 0x23 0x90 0x78 0xd9 0xf0 0x80 0x79 0xa5 0x05 0x90 0x7a 0xb9 0xd2 0x80 0x7b 0x84 0xe7 0x90 0x7c 0xa2 0xef 0x00 0x7d 0x6e 0x04 0x10 0x7e 0x82 0xd1 0x00 0x7f 0x4d 0xe6 0x10 0x01 0x02 0x01 0x03 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x05 0x04 0x00 0x00 0x15 0x18 0x00 0x00 0x00 0x00 0x1c 0x20 0x00 0x05 0x00 0x00 0x2a 0x30 0x01 0x05 0x00 0x00 0x1c 0x20 0x00 0x0a 0x00 0x00 0x1c 0x20 0x01 0x0e 0x00 0x00 0x0e 0x10 0x00 0x01 0x53 0x57 0x41 0x54 0x00 0x53 0x41 0x53 0x54 0x00 0x43 0x41 0x54 0x00 0x57 0x41 0x53 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x54 0x5a 0x69 0x66 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x5d 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x17 0xff 0xff 0xff 0xff 0x6d 0x7b 0x4b 0x78 0xff 0xff 0xff 0xff 0x82 0x46 0xcf 0x68 0xff 0xff 0xff 0xff 0xcc 0xae 0x8c 0x80 0xff 0xff 0xff 0xff 0xcd 0x9e 0x6f 0x70 0x00 0x00 0x00 0x00 0x26 0x06 0xa7 0xe0 0x00 0x00 0x00 0x00 0x2d 0x9d 0xea 0xe0 0x00 0x00 0x00 0x00 0x2e 0x69 0x1c 0x10 0x00 0x00 0x00 0x00 0x2f 0x7d 0xe9 0x00 0x00 0x00 0x00 0x00 0x30 0x48 0xfe 0x10 0x00 0x00 0x00 0x00 0x31 0x67 0x05 0x80 0x00 0x00 0x00 0x00 0x32 0x28 0xe0 0x10 0x00 0x00 0x00 0x00 0x33 0x46 0xe7 0x80 0x00 0x00 0x00 0x00 0x34 0x11 0xfc 0x90 0x00 0x00 0x00 0x00 0x35 0x26 0xc9 0x80 0x00 0x00 0x00 0x00 0x35 0xf1 0xde 0x90 0x00 0x00 0x00 0x00 0x37 0x06 0xab 0x80 0x00 0x00 0x00 0x00 0x37 0xd1 0xc0 0x90 0x00 0x00 0x00 0x00 0x38 0xe6 0x8d 0x80 0x00 0x00 0x00 0x00 0x39 0xb1 0xa2 0x90 0x00 0x00 0x00 0x00 0x3a 0xc6 0x6f 0x80 0x00 0x00 0x00 0x00 0x3b 0x91 0x84 0x90 0x00 0x00 0x00 0x00 0x3c 0xaf 0x8c 0x00 0x00 0x00 0x00 0x00 0x3d 0x71 0x66 0x90 0x00 0x00 0x00 0x00 0x3e 0x8f 0x6e 0x00 0x00 0x00 0x00 0x00 0x3f 0x5a 0x83 0x10 0x00 0x00 0x00 0x00 0x40 0x6f 0x50 0x00 0x00 0x00 0x00 0x00 0x41 0x3a 0x65 0x10 0x00 0x00 0x00 0x00 0x42 0x4f 0x32 0x00 0x00 0x00 0x00 0x00 0x43 0x1a 0x47 0x10 0x00 0x00 0x00 0x00 0x44 0x2f 0x14 0x00 0x00 0x00 0x00 0x00 0x44 0xfa 0x29 0x10 0x00 0x00 0x00 0x00 0x46 0x0e 0xf6 0x00 0x00 0x00 0x00 0x00 0x46 0xda 0x0b 0x10 0x00 0x00 0x00 0x00 0x47 0xf8 0x12 0x80 0x00 0x00 0x00 0x00 0x48 0xc3 0x27 0x90 0x00 0x00 0x00 0x00 0x49 0xd7 0xf4 0x80 0x00 0x00 0x00 0x00 0x4a 0xa3 0x09 0x90 0x00 0x00 0x00 0x00 0x4b 0xb7 0xd6 0x80 0x00 0x00 0x00 0x00 0x4c 0x82 0xeb 0x90 0x00 0x00 0x00 0x00 0x4d 0x97 0xb8 0x80 0x00 0x00 0x00 0x00 0x4e 0x62 0xcd 0x90 0x00 0x00 0x00 0x00 0x4f 0x77 0x9a 0x80 0x00 0x00 0x00 0x00 0x50 0x42 0xaf 0x90 0x00 0x00 0x00 0x00 0x51 0x60 0xb7 0x00 0x00 0x00 0x00 0x00 0x52 0x22 0x91 0x90 0x00 0x00 0x00 0x00 0x53 0x40 0x99 0x00 0x00 0x00 0x00 0x00 0x54 0x0b 0xae 0x10 0x00 0x00 0x00 0x00 0x55 0x20 0x7b 0x00 0x00 0x00 0x00 0x00 0x55 0xeb 0x90 0x10 0x00 0x00 0x00 0x00 0x57 0x00 0x5d 0x00 0x00 0x00 0x00 0x00 0x57 0xcb 0x72 0x10 0x00 0x00 0x00 0x00 0x58 0xe0 0x3f 0x00 0x00 0x00 0x00 0x00 0x59 0xab 0x54 0x10 0x00 0x00 0x00 0x00 0x5a 0xc0 0x21 0x00 0x00 0x00 0x00 0x00 0x5b 0x8b 0x36 0x10 0x00 0x00 0x00 0x00 0x5c 0xa9 0x3d 0x80 0x00 0x00 0x00 0x00 0x5d 0x6b 0x18 0x10 0x00 0x00 0x00 0x00 0x5e 0x89 0x1f 0x80 0x00 0x00 0x00 0x00 0x5f 0x54 0x34 0x90 0x00 0x00 0x00 0x00 0x60 0x69 0x01 0x80 0x00 0x00 0x00 0x00 0x61 0x34 0x16 0x90 0x00 0x00 0x00 0x00 0x62 0x48 0xe3 0x80 0x00 0x00 0x00 0x00 0x63 0x13 0xf8 0x90 0x00 0x00 0x00 0x00 0x64 0x28 0xc5 0x80 0x00 0x00 0x00 0x00 0x64 0xf3 0xda 0x90 0x00 0x00 0x00 0x00 0x66 0x11 0xe2 0x00 0x00 0x00 0x00 0x00 0x66 0xd3 0xbc 0x90 0x00 0x00 0x00 0x00 0x67 0xf1 0xc4 0x00 0x00 0x00 0x00 0x00 0x68 0xbc 0xd9 0x10 0x00 0x00 0x00 0x00 0x69 0xd1 0xa6 0x00 0x00 0x00 0x00 0x00 0x6a 0x9c 0xbb 0x10 0x00 0x00 0x00 0x00 0x6b 0xb1 0x88 0x00 0x00 0x00 0x00 0x00 0x6c 0x7c 0x9d 0x10 0x00 0x00 0x00 0x00 0x6d 0x91 0x6a 0x00 0x00 0x00 0x00 0x00 0x6e 0x5c 0x7f 0x10 0x00 0x00 0x00 0x00 0x6f 0x71 0x4c 0x00 0x00 0x00 0x00 0x00 0x70 0x3c 0x61 0x10 0x00 0x00 0x00 0x00 0x71 0x5a 0x68 0x80 0x00 0x00 0x00 0x00 0x72 0x1c 0x43 0x10 0x00 0x00 0x00 0x00 0x73 0x3a 0x4a 0x80 0x00 0x00 0x00 0x00 0x74 0x05 0x5f 0x90 0x00 0x00 0x00 0x00 0x75 0x1a 0x2c 0x80 0x00 0x00 0x00 0x00 0x75 0xe5 0x41 0x90 0x00 0x00 0x00 0x00 0x76 0xfa 0x0e 0x80 0x00 0x00 0x00 0x00 0x77 0xc5 0x23 0x90 0x00 0x00 0x00 0x00 0x78 0xd9 0xf0 0x80 0x00 0x00 0x00 0x00 0x79 0xa5 0x05 0x90 0x00 0x00 0x00 0x00 0x7a 0xb9 0xd2 0x80 0x00 0x00 0x00 0x00 0x7b 0x84 0xe7 0x90 0x00 0x00 0x00 0x00 0x7c 0xa2 0xef 0x00 0x00 0x00 0x00 0x00 0x7d 0x6e 0x04 0x10 0x00 0x00 0x00 0x00 0x7e 0x82 0xd1 0x00 0x00 0x00 0x00 0x00 0x7f 0x4d 0xe6 0x10 0x01 0x02 0x03 0x02 0x04 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x06 0x05 0x00 0x00 0x10 0x08 0x00 0x00 0x00 0x00 0x15 0x18 0x00 0x04 0x00 0x00 0x1c 0x20 0x00 0x09 0x00 0x00 0x2a 0x30 0x01 0x09 0x00 0x00 0x1c 0x20 0x00 0x0e 0x00 0x00 0x1c 0x20 0x01 0x12 0x00 0x00 0x0e 0x10 0x00 0x05 0x4c 0x4d 0x54 0x00 0x53 0x57 0x41 0x54 0x00 0x53 0x41 0x53 0x54 0x00 0x43 0x41 0x54 0x00 0x57 0x41 0x53 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0a 0x57 0x41 0x54 0x2d 0x31 0x57 0x41 0x53 0x54 0x2c 0x4d 0x39 0x2e 0x31 0x2e 0x30 0x2c 0x4d 0x34 0x2e 0x31 0x2e 0x30 0x0a }] close $f set ::tcl::clock::ZoneinfoPaths \ [linsert $::tcl::clock::ZoneinfoPaths 0 $tzdir] ::tcl::clock::ClearCaches } -body { clock format 1326054606 -timezone :Test/Windhoek } -cleanup { set ::tcl::clock::ZoneinfoPaths \ [lrange $::tcl::clock::ZoneinfoPaths 1 end] ::tcl::clock::ClearCaches removeFile Windhoek $tzdir2 removeDirectory Test $tzdir removeDirectory zoneinfo } -result {Sun Jan 08 22:30:06 WAST 2012} } test clock-57.1 {clock scan - abbreviated options} { clock scan 1970-01-01 -f %Y-%m-%d -g true } 0 test clock-57.2 {clock scan - not -gmt and -timezone in the same call} { catch {clock scan 1970-01-01 -format %Y-%m-%d -gmt true -timezone :Europe/Berlin} } 1 test clock-57.3 {clock scan - not -g and -timezone in the same call} { catch {clock scan 1970-01-01 -format %Y-%m-%d -g true -timezone :Europe/Berlin} } 1 test clock-58.1 {clock l10n - Japanese localisation} {*}{ -setup { proc backslashify { string } { set retval {} foreach char [split $string {}] { scan $char %c ccode if { $ccode >= 0x0020 && $ccode < 0x007f && $char ne "\{" && $char ne "\}" && $char ne "\[" && $char ne "\]" && $char ne "\\" && $char ne "\$" } { append retval $char } else { append retval \\u [format %04x $ccode] } } return $retval } } -body { set trouble {} foreach {date jdate} { 1872-12-31 西暦1872年12月31日 1873-01-01 明治06年01月01日 1912-07-29 明治45年07月29日 1912-07-30 大正01年07月30日 1926-12-24 大正15年12月24日 1926-12-25 昭和01年12月25日 1989-01-07 昭和64年01月07日 1989-01-08 平成01年01月08日 2019-04-30 平成31年04月30日 2019-05-01 令和01年05月01日 } { set status [catch { set secs [clock scan $date \ -timezone +0900 \ -locale ja_JP \ -format %Y-%m-%d] set jda [clock format $secs \ -timezone +0900 \ -locale ja_JP \ -format %Ex] } result] if {$status != 0} { append trouble \n $date " gives error " $result } elseif {$jda ne $jdate} { append trouble \n $date " converts to " \ [backslashify $jda] " and should be " \ [backslashify $jdate] } # There is no code for scanning dates on the locale's # alternative calendar. continue set status [catch { set secs [clock scan $jdate \ -timezone +0900 \ -locale ja_JP \ -format %Ex] set da [clock format $secs \ -timezone +0900 \ -locale ja_JP \ -format %Y-%m-%d] } result] if {$status != 0} { append trouble \n [backslashify $jdate] " gives error " $result } elseif {$da ne $date} { append trouble \n [backslashify $jdate] " converts to " \ $da " and should be " $date } } set trouble } -cleanup { rename backslashify {} } -result {} } test clock-59.1 {military time zones} { set hour 0 set base [clock scan "20000101 000000" -format "%Y%m%d %H%M%S" -gmt 1] set trouble {} foreach {pzone mzone} { Z Z A N B O C P D Q E R F S G T H U I V K W L X M Y } { catch {clock scan "20000101 000000 $pzone" \ -format "%Y%m%d %H%M%S %Z"} ps1 catch {clock scan "20000101 000000 $pzone"} ps2 catch {clock scan "20000101 000000 $mzone" \ -format "%Y%m%d %H%M%S %Z"} ms1 catch {clock scan "20000101 000000 $mzone"} ms2 if {$ps1 != $base - 3600 * $hour} { lappend trouble [list pzone $pzone hour $hour ps1 is $ps1] } if {$ps2 != $base - 3600 * $hour} { lappend trouble [list pzone $pzone ps2 is $ps2] } if {$ms1 != $base + 3600 * $hour} { lappend trouble [list mzone $mzone ms1 is $ms1] } if {$ms2 != $base + 3600 * $hour} { lappend trouble [list mzone $mzone ms2 is $ms2] } incr hour } join $trouble \n } {} test clock-59.2 {correct time zone names, format and scan back, bug and regression [2c237beffbace823]} { set result {} foreach {base tz} { 1700000000 "Etc/GMT-2" 1700000000 "Etc/GMT+2" 1301184000 "Europe/Kaliningrad" 152632800 "Pacific/Chatham" -765317964 "America/Paramaribo" -2337928528 "Australia/Eucla" } { set v [clock format $base -timezone Etc/GMT-2 -format "%Y-%m-%d %H:%M:%S %Z"] lappend result [expr {[set t [clock scan $v -format "%Y-%m-%d %H:%M:%S %Z"]] == $base ? 1 : "0 ($t != $base for $v)"}] lappend result [expr {[set t [clock scan $v]] == $base ? 1 : "0 ($t != $base for $v)"}] } set result } [lrepeat 12 1] # case-insensitive matching of weekday and month names [Bug 1781282] test clock-60.1 {case insensitive weekday names} { clock scan "2000-W01 monday" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-1" -gmt true -format "%G-W%V-%u"] test clock-60.2 {case insensitive weekday names} { clock scan "2000-W01 Monday" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-1" -gmt true -format "%G-W%V-%u"] test clock-60.3 {case insensitive weekday names} { clock scan "2000-W01 MONDAY" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-1" -gmt true -format "%G-W%V-%u"] test clock-60.4 {case insensitive weekday names} { clock scan "2000-W01 friday" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-5" -gmt true -format "%G-W%V-%u"] test clock-60.5 {case insensitive weekday names} { clock scan "2000-W01 Friday" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-5" -gmt true -format "%G-W%V-%u"] test clock-60.6 {case insensitive weekday names} { clock scan "2000-W01 FRIDAY" -gmt true -format "%G-W%V %a" } [clock scan "2000-W01-5" -gmt true -format "%G-W%V-%u"] test clock-60.7 {case insensitive month names} { clock scan "1 january 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-01-01" -gmt true -format "%Y-%m-%d"] test clock-60.8 {case insensitive month names} { clock scan "1 January 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-01-01" -gmt true -format "%Y-%m-%d"] test clock-60.9 {case insensitive month names} { clock scan "1 JANUARY 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-01-01" -gmt true -format "%Y-%m-%d"] test clock-60.10 {case insensitive month names} { clock scan "1 december 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-12-01" -gmt true -format "%Y-%m-%d"] test clock-60.11 {case insensitive month names} { clock scan "1 December 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-12-01" -gmt true -format "%Y-%m-%d"] test clock-60.12 {case insensitive month names} { clock scan "1 DECEMBER 2000" -gmt true -format "%d %b %Y" } [clock scan "2000-12-01" -gmt true -format "%Y-%m-%d"] test clock-61.1 {overflow of a wide integer on output} {*}{ -body { clock format 0x8000000000000000 -format %s -gmt true } -result {integer value too large to represent} -errorCode {CLOCK badOption 0x8000000000000000} -returnCodes error } test clock-61.1b {overflow of a wide integer on base} {*}{ -body { clock scan "" -base 0x8000000000000000 -gmt true } -result {integer value too large to represent} -errorCode {CLOCK badOption 0x8000000000000000} -returnCodes error } test clock-61.2 {overflow of a wide integer on output} {*}{ -body { clock format -0x8000000000000001 -format %s -gmt true } -result {integer value too large to represent} -errorCode {CLOCK badOption -0x8000000000000001} -returnCodes error } test clock-61.2b {overflow of a wide integer on base} {*}{ -body { clock scan "" -base -0x8000000000000001 -gmt true } -result {integer value too large to represent} -errorCode {CLOCK badOption -0x8000000000000001} -returnCodes error } test clock-61.3 {near-miss overflow of a wide integer on output, very large datetime (upper range)} { clock format 0x00F0000000000000 -format "%s %Y %EE" -gmt true } [list [expr 0x00F0000000000000] 2140702833 C.E.] test clock-61.4 {near-miss overflow of a wide integer on output, very small datetime (lower range)} { clock format -0x00F0000000000000 -format "%s %Y %EE" -gmt true } [list [expr -0x00F0000000000000] 2140654939 B.C.E.] test clock-61.5 {overflow of possible date-time (upper range)} -body { clock format 0x00F0000000000001 -gmt true } -returnCodes error -result {integer value too large to represent} -errorCode {CLOCK badOption 0x00F0000000000001} test clock-61.6 {overflow of possible date-time (lower range)} -body { clock format -0x00F0000000000001 -gmt true } -returnCodes error -result {integer value too large to represent} -errorCode {CLOCK badOption -0x00F0000000000001} test clock-62.1 {Bug 1902423} {*}{ -setup {::tcl::clock::ClearCaches} -body { set s 1204049747 set f1 [clock format $s -format {%Y-%m-%d %T} -locale C] set f2 [clock format $s -format {%Y-%m-%d %H:%M:%S} -locale C] if {$f1 ne $f2} { subst "$f2 is not $f1" } else { subst "ok" } } -result ok } test clock-63.1 {Incorrect use of internal ConvertLocalToUTC command} {*}{ -body { ::tcl::clock::ConvertLocalToUTC {immaterial stuff} {} 12345 } -returnCodes error -result {key "localseconds" not found in dictionary} } test clock-64.1 {:: in format string [Bug 2362156]} {*}{ -body { clock scan 2001-02-03::04:05:06 -gmt 1 -format %Y-%m-%d::%H:%M:%S } -result 981173106 } test clock-64.2 {:: in format string [Bug 2362156]} {*}{ -body { clock format 981173106 -gmt 1 -format %Y-%m-%d::%H:%M:%S } -result 2001-02-03::04:05:06 } test clock-65.1 {clock add, bad option [Bug 2481670]} {*}{ -body { clock add 0 1 year -foo bar } -match glob -returnCodes error -result {bad option "-foo"*} } test clock-65.2 {clock add with both -timezone and -gmt} {*}{ -body { clock add 0 1 year -timezone :CET -gmt true } -match glob -returnCodes error -result {cannot use -gmt and -timezone in same call} } test clock-66.1 {clock scan, no date, never-before-seen timezone} {*}{ -setup { ::tcl::clock::ClearCaches } -body { clock scan 1200 \ -timezone {+05:00:00+04:00:00,M3.2.0/02:00:00,M11.1.0/02:00:00} \ -base 1256529600 \ -format %H%M } -result 1256572800 } test clock-67.1 {clock format, %% with a letter following [Bug 2819334]} { clock format [clock seconds] -format %%r } %r test clock-67.2 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222 } -returnCodes error -match glob -result * test clock-67.3 {Bug d19a30db57} -body { # error, not segfault tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222 } -returnCodes error -match glob -result * test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat set current [msgcat::mclocale] } -body { msgcat::mclocale de_de set res [regexp {^\d{2}\.\d{2}\.\d{4}$} [clock format 1 -locale current -format %x]] msgcat::mclocale en_uk lappend res [regexp {^\d{2}/\d{2}/\d{4}$} [clock format 1 -locale current -format %x]] } -cleanup { msgcat::mclocale $current } -result {1 1} test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup { package require msgcat set current [msgcat::mclocale] } -body { msgcat::mclocale de_de set res [clock scan "01.01.1970" -locale current -format %x -gmt 1] msgcat::mclocale en_uk # This will fail without the bug fix, as still de_de is active expr {$res == [clock scan "01/01/1970" -locale current -format %x -gmt 1]} } -cleanup { msgcat::mclocale $current } -result {1} proc _check_scan {res_ d tz fmt i {fmt2str ""}} { upvar $res_ res # expectation is fail on result like "invalid time": set e [expr {![string is wideinteger -strict $i] && [string match "*invalid*" $i]}]; # conversion: set lmscan {{args} { upvar d d tz tz fmt fmt fmt2str fmt2str set s [clock scan $d -timezone $tz {*}$args] if {$fmt2str eq ""} { set s } else { clock format $s -timezone $tz -locale en -format $fmt2str } }} # check with free scan: set v [catch { apply $lmscan } t] if {($v != $e) || (!$e ? $t != $i : ![string match "*$i*" $t])} { lappend res "free-scan \"$d\" [expr {!$v ? "succeeds" : "fails"}] with \"$t\" expected [expr {!$e ? "success" : "fail"}] with \"$i\"" } # check with formatted scan: set v [catch { apply $lmscan -locale en -format $fmt } t] if {($v != $e) || (!$e ? $t != $i : ![string match "*$i*" $t])} { lappend res "frmt-scan \"$d\" [expr {!$v ? "succeeds" : "fails"}] with \"$t\" expected [expr {!$e ? "success" : "fail"}] with \"$i\"" } } test clock-68.1 {Leap second, minute, hour [f2b5f89c0d], regression test (no validity check)} -constraints valid_off -body { set res {} foreach {d i} { "2012-06-29 23:59:60" 1341014400 "2012-05-30 23:59:60" 1338422400 "2012-05-30 23:60:60" 1338422460 "2012-05-30 24:00:60" 1338422460 "2012-05-30 24:60:00" 1338426000 } { # check with free and format scan: _check_scan res $d UTC "%Y-%m-%d %H:%M:%S" $i } join $res \n; # must be empty } -result {} test clock-68.1a {24:00 time [aee9f2b916], regression test} -body { set res {} foreach {d i} { "2012-06-30 24:00:00" 1341100800 } { # check with free and format scan: _check_scan res $d UTC "%Y-%m-%d %H:%M:%S" $i } join $res \n; # must be empty } -result {} test clock-68.1b {24:00 time [aee9f2b916], [882da1e28b], regression test} -body { set res {} foreach {d tz i} { "Sat, 2012-06-30 24:00:00 GMT" GMT 1341100800 "Sat, 2012-06-30 24:00:00 +1145" +1145 1341058500 "Sat, 2012-06-30 24:00:00 -1145" -1145 1341143100 "Sun, 2012-07-01 24:00:00 GMT" GMT 1341187200 "Sun, 2012-07-01 24:00:00 +1145" +1145 1341144900 "Sun, 2012-07-01 24:00:00 -1145" -1145 1341229500 } { # check with free and format scan: _check_scan res $d $tz "%a, %Y-%m-%d %H:%M:%S %z" $i } join $res \n; # must be empty } -result {} test clock-68.2 {Leap second, "24:00", regression test (validity check)} -constraints !valid_off -body { # Leap seconds are not supported. "24:00" is supported. set res {} foreach {d i} { "2012-06-29 23:59:60" "invalid time" "2012-05-30 23:59:60" "invalid time" "2012-05-30 23:60:60" "invalid time" "2012-05-30 24:00:01" "invalid time" "2012-05-30 24:01:00" "invalid time" "1971-06-30 23:59:60" "invalid time" "2012-06-30 23:59:60" "invalid time" "2018-06-30 23:59:60" "invalid time" } { # check with free and format scan: _check_scan res $d UTC "%Y-%m-%d %H:%M:%S" $i } join $res \n; # must be empty } -result {} # cleanup ::tcl::clock::ClearCaches rename test {} namespace import -force ::tcltest::* # adjust expected skipped (valid_off is an artificial constraint): if {$valid_mode && [info exists ::tcltest::skippedBecause(valid_off)]} { incr ::tcltest::numTests(Total) -$::tcltest::skippedBecause(valid_off) incr ::tcltest::numTests(Skipped) -$::tcltest::skippedBecause(valid_off) unset ::tcltest::skippedBecause(valid_off) } if {!$valid_mode && [info exists ::tcltest::skippedBecause(!valid_off)]} { incr ::tcltest::numTests(Total) -$::tcltest::skippedBecause(!valid_off) incr ::tcltest::numTests(Skipped) -$::tcltest::skippedBecause(!valid_off) unset ::tcltest::skippedBecause(!valid_off) } ::testClock::_cleanupNoTZ namespace delete ::testClock ::tcltest::cleanupTests unset valid_mode return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/clock-ivm.test0000644000175000017500000000046315104661341015501 0ustar sergeisergei# clock-ivm.test -- # # This test file covers the 'clock' command using inverted validity mode. # # See the file "clock.test" for more information. ::tcl::unsupported::clock::configure -valid [expr {![::tcl::unsupported::clock::configure -valid]}] source [file join [file dirname [info script]] clock.test]tcl9.0.3/tests/chanio.test0000644000175000017500000076475515104661341015103 0ustar sergeisergei# -*- tcl -*- # Functionality covered: operation of all IO commands, and all procedures # defined in generic/tclIO.c. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } testConstraint noappverifier [expr { [llength [info commands testappverifierpresent]] == 0 || ![testappverifierpresent]}] namespace eval ::tcl::test::io { if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } variable umaskValue variable path variable f variable i variable n variable v variable msg variable expected set ::tcltestlib {} catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] set ::tcltestlib [info loaded {} Tcltest] } source [file join [file dirname [info script]] tcltests.tcl] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testchannel [llength [info commands testchannel]] testConstraint testfevent [llength [info commands testfevent]] testConstraint testchannelevent [llength [info commands testchannelevent]] testConstraint testmainthread [llength [info commands testmainthread]] testConstraint testservicemode [llength [info commands testservicemode]] testConstraint notWinCI [expr { $::tcl_platform(platform) ne "windows" || ![info exists ::env(CI)]}] testConstraint notOSX [expr {$::tcl_platform(os) ne "Darwin"}] # File permissions broken on wsl without some "exotic" wsl configuration testConstraint notWsl [expr {[llength [array names ::env *WSL*]] == 0}] testConstraint specialfiles [expr {[file exists /dev/zero] || [file exists NUL]}] # You need a *very* special environment to do some tests. In particular, # many file systems do not support large-files... testConstraint largefileSupport [expr {$::tcl_platform(os) ne "Darwin"}] # some tests can only be run is umask is 2 if "umask" cannot be run, the # tests will be skipped. set umaskValue 0 testConstraint umask [expr {![catch {set umaskValue [scan [exec /bin/sh -c umask] %o]}]}] testConstraint makeFileInHome [expr {![file exists $::env(HOME)/_test_] && [file writable $::env(HOME)]}] # set up a long data file for some of the following tests set path(longfile) [makeFile {} longfile] set f [open $path(longfile) w] chan configure $f -translation lf for { set i 0 } { $i < 100 } { incr i} { chan puts $f "#123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \#123456789abcdef01 \#" } chan close $f set path(cat) [makeFile { set f stdin if {$argv ne ""} { set f [open [lindex $argv 0]] } chan configure $f -translation binary -blocking 0 -eofchar \x1A chan configure stdout -translation binary -buffering none chan event $f readable "foo $f" proc foo {f} { set x [chan read $f] catch {chan puts -nonewline $x} if {[chan eof $f]} { chan close $f exit 0 } } vwait forever } cat] set thisScript [file join [pwd] [info script]] proc contents {file} { set f [open $file] chan configure $f -translation binary set a [chan read $f] chan close $f return $a } # Wrapper round butt-ugly pipe syntax proc openpipe {{mode r+} args} { open "|[list [interpreter] {*}$args]" $mode } test chan-io-1.5 {Tcl_WriteChars: CheckChannelErrors} {emptyTest} { # no test, need to cause an async error. } {} set path(test1) [makeFile {} test1] test chan-io-1.6 {Tcl_WriteChars: WriteBytes} { set f [open $path(test1) w] chan configure $f -translation binary chan puts -nonewline $f "a\x4D\x00" chan close $f contents $path(test1) } aM\x00 test chan-io-1.7 {Tcl_WriteChars: WriteChars} { set f [open $path(test1) w] chan configure $f -encoding shiftjis chan puts -nonewline $f "a乍\x00" chan close $f contents $path(test1) } "a\x93\xE1\x00" set path(test2) [makeFile {} test2] test chan-io-1.8 {Tcl_WriteChars: WriteChars} { # This test written for SF bug #506297. # # Executing this test without the fix for the referenced bug applied to # tcl will cause tcl, more specifically WriteChars, to go into an infinite # loop. set f [open $path(test2) w] chan configure $f -encoding iso2022-jp chan puts -nonewline $f [format %s%c [string repeat " " 4] 12399] chan close $f contents $path(test2) } " \x1B\$B\$O\x1B(B" test chan-io-1.9 {Tcl_WriteChars: WriteChars} { # When closing a channel with an encoding that appends escape bytes, check # for the case where the escape bytes overflow the current IO buffer. The # bytes should be moved into a new buffer. set data "1234567890 [format %c 12399]" set sizes [list] # With default buffer size set f [open $path(test2) w] chan configure $f -encoding iso2022-jp chan puts -nonewline $f $data chan close $f lappend sizes [file size $path(test2)] # With buffer size equal to the length of the data, the escape bytes would # go into the next buffer. set f [open $path(test2) w] chan configure $f -encoding iso2022-jp -buffersize 16 chan puts -nonewline $f $data chan close $f lappend sizes [file size $path(test2)] # With buffer size that is large enough to hold 1 byte of escaped data, # but not all 3. This should not write the escape bytes to the first # buffer and then again to the second buffer. set f [open $path(test2) w] chan configure $f -encoding iso2022-jp -buffersize 17 chan puts -nonewline $f $data chan close $f lappend sizes [file size $path(test2)] # With buffer size that can hold 2 out of 3 bytes of escaped data. set f [open $path(test2) w] chan configure $f -encoding iso2022-jp -buffersize 18 chan puts -nonewline $f $data chan close $f lappend sizes [file size $path(test2)] # With buffer size that can hold all the data and escape bytes. set f [open $path(test2) w] chan configure $f -encoding iso2022-jp -buffersize 19 chan puts -nonewline $f $data chan close $f lappend sizes [file size $path(test2)] } {19 19 19 19 19} test chan-io-2.1 {WriteBytes} { # loop until all bytes are written set f [open $path(test1) w] chan configure $f -translation binary -buffersize 16 -translation crlf chan puts $f "abcdefghijklmnopqrstuvwxyz" chan close $f contents $path(test1) } "abcdefghijklmnopqrstuvwxyz\r\n" test chan-io-2.2 {WriteBytes: savedLF > 0} { # After flushing buffer, there was a \n left over from the last # \n -> \r\n expansion. It gets stuck at beginning of this buffer. set f [open $path(test1) w] chan configure $f -translation binary -buffersize 16 -translation crlf chan puts -nonewline $f "123456789012345\n12" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "123456789012345\r" "123456789012345\r\n12"] test chan-io-2.3 {WriteBytes: flush on line} -body { # Tcl "line" buffering has weird behavior: if current buffer contains a # \n, entire buffer gets flushed. Logical behavior would be to flush only # up to the \n. set f [open $path(test1) w] chan configure $f -translation binary -buffering line -translation crlf chan puts -nonewline $f "\n12" contents $path(test1) } -cleanup { chan close $f } -result "\r\n12" test chan-io-2.4 {WriteBytes: reset sawLF after each buffer} { set f [open $path(test1) w] chan configure $f -translation binary -buffering line -buffersize 16 chan puts -nonewline $f "abcdefg\nhijklmnopqrstuvwxyz" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] test chan-io-3.1 {WriteChars: compatibility with WriteBytes} { # loop until all bytes are written set f [open $path(test1) w] chan configure $f -encoding ascii -buffersize 16 -translation crlf chan puts $f "abcdefghijklmnopqrstuvwxyz" chan close $f contents $path(test1) } "abcdefghijklmnopqrstuvwxyz\r\n" test chan-io-3.2 {WriteChars: compatibility with WriteBytes: savedLF > 0} { # After flushing buffer, there was a \n left over from the last # \n -> \r\n expansion. It gets stuck at beginning of this buffer. set f [open $path(test1) w] chan configure $f -encoding ascii -buffersize 16 -translation crlf chan puts -nonewline $f "123456789012345\n12" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "123456789012345\r" "123456789012345\r\n12"] test chan-io-3.3 {WriteChars: compatibility with WriteBytes: flush on line} -body { # Tcl "line" buffering has weird behavior: if current buffer contains a # \n, entire buffer gets flushed. Logical behavior would be to flush only # up to the \n. set f [open $path(test1) w] chan configure $f -encoding ascii -buffering line -translation crlf chan puts -nonewline $f "\n12" contents $path(test1) } -cleanup { chan close $f } -result "\r\n12" test chan-io-3.4 {WriteChars: loop over stage buffer} -body { # stage buffer maps to more than can be queued at once. set f [open $path(test1) w] chan configure $f -encoding jis0208 -buffersize 16 -profile tcl8 chan puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } -cleanup { catch {chan close $f} } -result [list "!)!)!)!)!)!)!)!)" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test chan-io-3.5 {WriteChars: saved != 0} -body { # Bytes produced by UtfToExternal from end of last channel buffer had to # be moved to beginning of next channel buffer to preserve requested # buffersize. set f [open $path(test1) w] chan configure $f -encoding jis0208 -buffersize 17 -profile tcl8 chan puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } -cleanup { catch {chan close $f} } -result [list "!)!)!)!)!)!)!)!)!" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test chan-io-3.6 {WriteChars: (stageRead + dstWrote == 0)} -body { # One incomplete UTF-8 character at end of staging buffer. Backup in src # to the beginning of that UTF-8 character and try again. # # Translate the first 16 bytes, produce 14 bytes of output, 2 left over # (first two bytes of A in UTF-8). Given those two bytes try # translating them again, find that no bytes are read produced, and break # to outer loop where those two bytes will have the remaining 4 bytes (the # last byte of A plus the all of B) appended. set f [open $path(test1) w] chan configure $f -encoding shiftjis -buffersize 16 chan puts -nonewline $f 12345678901234AB set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } -cleanup { catch {chan close $f} } -result [list "12345678901234\x82\x60" "12345678901234\x82\x60\x82\x61"] test chan-io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} -body { # When translating UTF-8 to external, the produced bytes went past end of # the channel buffer. This is done on purpose - we then truncate the bytes # at the end of the partial character to preserve the requested blocksize # on flush. The truncated bytes are moved to the beginning of the next # channel buffer. set f [open $path(test1) w] chan configure $f -encoding jis0208 -buffersize 17 -profile tcl8 chan puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } -cleanup { catch {chan close $f} } -result [list "!)!)!)!)!)!)!)!)!" "!)!)!)!)!)!)!)!)!)!)!)!)!)!)!)"] test chan-io-3.8 {WriteChars: reset sawLF after each buffer} -body { set f [open $path(test1) w] chan configure $f -encoding ascii -buffering line -translation lf \ -buffersize 16 chan puts -nonewline $f "abcdefg\nhijklmnopqrstuvwxyz" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } -cleanup { catch {chan close $f} } -result [list "abcdefg\nhijklmno" "abcdefg\nhijklmnopqrstuvwxyz"] test chan-io-4.1 {TranslateOutputEOL: lf} { # search for \n set f [open $path(test1) w] chan configure $f -buffering line -translation lf chan puts $f "abcde" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "abcde\n" "abcde\n"] test chan-io-4.2 {TranslateOutputEOL: cr} { # search for \n, replace with \r set f [open $path(test1) w] chan configure $f -buffering line -translation cr chan puts $f "abcde" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "abcde\r" "abcde\r"] test chan-io-4.3 {TranslateOutputEOL: crlf} { # simple case: search for \n, replace with \r set f [open $path(test1) w] chan configure $f -buffering line -translation crlf chan puts $f "abcde" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "abcde\r\n" "abcde\r\n"] test chan-io-4.4 {TranslateOutputEOL: crlf} { # Keep storing more bytes in output buffer until output buffer is full. We # have 13 bytes initially that would turn into 18 bytes. Fill dest buffer # while (dstEnd < dstMax). set f [open $path(test1) w] chan configure $f -translation crlf -buffersize 16 chan puts -nonewline $f "1234567\n\n\n\n\nA" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "1234567\r\n\r\n\r\n\r\n\r" "1234567\r\n\r\n\r\n\r\n\r\nA"] test chan-io-4.5 {TranslateOutputEOL: crlf} { # Check for overflow of the destination buffer set f [open $path(test1) w] chan configure $f -translation crlf -buffersize 12 chan puts -nonewline $f "12345678901\n456789012345678901234" chan close $f set x [contents $path(test1)] } "12345678901\r\n456789012345678901234" test chan-io-5.1 {CheckFlush: not full} { set f [open $path(test1) w] chan puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "" "12345678901234567890"] test chan-io-5.2 {CheckFlush: full} { set f [open $path(test1) w] chan configure $f -buffersize 16 chan puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "1234567890123456" "12345678901234567890"] test chan-io-5.3 {CheckFlush: not line} { set f [open $path(test1) w] chan configure $f -buffering line chan puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "" "12345678901234567890"] test chan-io-5.4 {CheckFlush: line} { set f [open $path(test1) w] chan configure $f -buffering line -translation lf -encoding ascii chan puts -nonewline $f "1234567890\n1234567890" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "1234567890\n1234567890" "1234567890\n1234567890"] test chan-io-5.5 {CheckFlush: none} { set f [open $path(test1) w] chan configure $f -buffering none chan puts -nonewline $f "1234567890" set x [list [contents $path(test1)]] chan close $f lappend x [contents $path(test1)] } [list "1234567890" "1234567890"] test chan-io-6.1 {Tcl_GetsObj: working} -body { set f [open $path(test1) w] chan puts $f "foo\nboo" chan close $f set f [open $path(test1)] chan gets $f } -cleanup { chan close $f } -result {foo} test chan-io-6.2 {Tcl_GetsObj: CheckChannelErrors() != 0} emptyTest { # no test, need to cause an async error. } {} test chan-io-6.3 {Tcl_GetsObj: how many have we used?} -body { # if (bufPtr != NULL) {oldRemoved = bufPtr->nextRemoved} set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f "abc\ndefg" chan close $f set f [open $path(test1)] list [chan tell $f] [chan gets $f line] [chan tell $f] [chan gets $f line] $line } -cleanup { chan close $f } -result {0 3 5 4 defg} test chan-io-6.4 {Tcl_GetsObj: encoding == NULL} -body { set f [open $path(test1) w] chan configure $f -translation binary chan puts $f "\x81\x34\x00" chan close $f set f [open $path(test1)] chan configure $f -translation binary list [chan gets $f line] $line } -cleanup { chan close $f } -result [list 3 "\x81\x34\x00"] test chan-io-6.5 {Tcl_GetsObj: encoding != NULL} -body { set f [open $path(test1) w] chan configure $f -translation binary chan puts $f "\x88\xEA\x92\x9A" chan close $f set f [open $path(test1)] chan configure $f -encoding shiftjis list [chan gets $f line] $line } -cleanup { chan close $f } -result [list 2 "一丁"] set a "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" append a $a append a $a test chan-io-6.6 {Tcl_GetsObj: loop test} -body { # if (dst >= dstEnd) set f [open $path(test1) w] chan puts $f $a chan puts $f hi chan close $f set f [open $path(test1)] list [chan gets $f line] $line } -cleanup { chan close $f } -result [list 256 $a] test chan-io-6.7 {Tcl_GetsObj: error in input} -constraints stdio -body { # if (FilterInputBytes(chanPtr, &gs) != 0) set f [openpipe w+ $path(cat)] chan puts -nonewline $f "hi\nwould" chan flush $f chan gets $f chan configure $f -blocking 0 chan gets $f line } -cleanup { chan close $f } -result {-1} test chan-io-6.8 {Tcl_GetsObj: remember if EOF is seen} -body { set f [open $path(test1) w] chan puts $f "abcdef\x1Aghijk\nwombat" chan close $f set f [open $path(test1)] chan configure $f -eofchar \x1A list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {6 abcdef -1 {}} test chan-io-6.9 {Tcl_GetsObj: remember if EOF is seen} -body { set f [open $path(test1) w] chan puts $f "abcdefghijk\nwom\x1Abat" chan close $f set f [open $path(test1)] chan configure $f -eofchar \x1A list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {11 abcdefghijk 3 wom} # Comprehensive tests test chan-io-6.10 {Tcl_GetsObj: lf mode: no chars} -body { set f [open $path(test1) w] chan close $f set f [open $path(test1)] chan configure $f -translation lf list [chan gets $f line] $line } -cleanup { chan close $f } -result {-1 {}} test chan-io-6.11 {Tcl_GetsObj: lf mode: lone \n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\n" chan close $f set f [open $path(test1)] chan configure $f -translation lf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.12 {Tcl_GetsObj: lf mode: lone \r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r" chan close $f set f [open $path(test1)] chan configure $f -translation lf set x [list [chan gets $f line] $line [chan gets $f line] $line] } -cleanup { chan close $f } -result [list 1 "\r" -1 ""] test chan-io-6.13 {Tcl_GetsObj: lf mode: 1 char} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f a chan close $f set f [open $path(test1)] chan configure $f -translation lf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.14 {Tcl_GetsObj: lf mode: 1 char followed by EOL} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\n" chan close $f set f [open $path(test1)] chan configure $f -translation lf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.15 {Tcl_GetsObj: lf mode: several chars} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" chan close $f set f [open $path(test1)] chan configure $f -translation lf list [chan gets $f line] $line [chan gets $f line] $line \ [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 4 "abcd" 10 "efgh\rijkl\r" 4 "mnop" -1 ""] test chan-io-6.16 {Tcl_GetsObj: cr mode: no chars} -body { set f [open $path(test1) w] chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line } -cleanup { chan close $f } -result {-1 {}} test chan-io-6.17 {Tcl_GetsObj: cr mode: lone \n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\n" chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 1 "\n" -1 ""] test chan-io-6.18 {Tcl_GetsObj: cr mode: lone \r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r" chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.19 {Tcl_GetsObj: cr mode: 1 char} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f a chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.20 {Tcl_GetsObj: cr mode: 1 char followed by EOL} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\r" chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.21 {Tcl_GetsObj: cr mode: several chars} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" chan close $f set f [open $path(test1)] chan configure $f -translation cr list [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 9 "abcd\nefgh" 4 "ijkl" 5 "\nmnop" -1 ""] test chan-io-6.22 {Tcl_GetsObj: crlf mode: no chars} -body { set f [open $path(test1) w] chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line } -cleanup { chan close $f } -result {-1 {}} test chan-io-6.23 {Tcl_GetsObj: crlf mode: lone \n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\n" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 1 "\n" -1 ""] test chan-io-6.24 {Tcl_GetsObj: crlf mode: lone \r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 1 "\r" -1 ""] test chan-io-6.25 {Tcl_GetsObj: crlf mode: \r\r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r\r" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 2 "\r\r" -1 ""] test chan-io-6.26 {Tcl_GetsObj: crlf mode: \r\n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.27 {Tcl_GetsObj: crlf mode: 1 char} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f a chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.28 {Tcl_GetsObj: crlf mode: 1 char followed by EOL} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.29 {Tcl_GetsObj: crlf mode: several chars} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" chan close $f set f [open $path(test1)] chan configure $f -translation crlf list [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 14 "abcd\nefgh\rijkl" 4 "mnop" -1 ""] test chan-io-6.30 {Tcl_GetsObj: crlf mode: buffer exhausted} -constraints {testchannel} -body { # if (eol >= dstEnd) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\r\nabcdefghijklmnoprstuvwxyz" chan close $f set f [open $path(test1)] chan configure $f -translation crlf -buffersize 16 list [chan gets $f line] $line [testchannel inputbuffered $f] } -cleanup { chan close $f } -result [list 15 "123456789012345" 15] test chan-io-6.31 {Tcl_GetsObj: crlf mode: buffer exhausted, blocked} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # (FilterInputBytes() != 0) set f [openpipe w+ $path(cat)] chan configure $f -translation {crlf lf} -buffering none chan puts -nonewline $f "bbbbbbbbbbbbbb\r\n123456789012345\r" chan configure $f -buffersize 16 lappend x [chan gets $f] chan configure $f -blocking 0 lappend x [chan gets $f line] $line [chan blocked $f] \ [testchannel inputbuffered $f] } -cleanup { chan close $f } -result {bbbbbbbbbbbbbb -1 {} 1 16} test chan-io-6.32 {Tcl_GetsObj: crlf mode: buffer exhausted, more data} -constraints {testchannel} -body { # not (FilterInputBytes() != 0) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\r\n123" chan close $f set f [open $path(test1)] chan configure $f -translation crlf -buffersize 16 list [chan gets $f line] $line [chan tell $f] [testchannel inputbuffered $f] } -cleanup { chan close $f } -result {15 123456789012345 17 3} test chan-io-6.33 {Tcl_GetsObj: crlf mode: buffer exhausted, at eof} -body { # eol still equals dstEnd set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\r" chan close $f set f [open $path(test1)] chan configure $f -translation crlf -buffersize 16 list [chan gets $f line] $line [chan eof $f] } -cleanup { chan close $f } -result [list 16 "123456789012345\r" 1] test chan-io-6.34 {Tcl_GetsObj: crlf mode: buffer exhausted, not followed by \n} -body { # not (*eol == '\n') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\rabcd\r\nefg" chan close $f set f [open $path(test1)] chan configure $f -translation crlf -buffersize 16 list [chan gets $f line] $line [chan tell $f] } -cleanup { chan close $f } -result [list 20 "123456789012345\rabcd" 22] test chan-io-6.35 {Tcl_GetsObj: auto mode: no chars} -body { set f [open $path(test1) w] chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line } -cleanup { chan close $f } -result {-1 {}} test chan-io-6.36 {Tcl_GetsObj: auto mode: lone \n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\n" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.37 {Tcl_GetsObj: auto mode: lone \r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.38 {Tcl_GetsObj: auto mode: \r\r} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r\r" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} 0 {} -1 {}} test chan-io-6.39 {Tcl_GetsObj: auto mode: \r\n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {0 {} -1 {}} test chan-io-6.40 {Tcl_GetsObj: auto mode: 1 char} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f a chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.41 {Tcl_GetsObj: auto mode: 1 char followed by EOL} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {1 a -1 {}} test chan-io-6.42 {Tcl_GetsObj: auto mode: several chars} -setup { set x "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\nefgh\rijkl\r\nmnop" chan close $f set f [open $path(test1)] chan configure $f -translation auto lappend x [chan gets $f line] $line [chan gets $f line] $line lappend x [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result {4 abcd 4 efgh 4 ijkl 4 mnop -1 {}} test chan-io-6.43 {Tcl_GetsObj: input saw cr} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # if (chanPtr->flags & INPUT_SAW_CR) set f [openpipe w+ $path(cat)] chan configure $f -translation {auto lf} -buffering none chan puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" chan configure $f -buffersize 16 lappend x [chan gets $f] chan configure $f -blocking 0 lappend x [chan gets $f line] $line [testchannel queuedcr $f] chan configure $f -blocking 1 chan puts -nonewline $f "\nabcd\refg\x1A" lappend x [chan gets $f line] $line [testchannel queuedcr $f] lappend x [chan gets $f line] $line } -cleanup { chan close $f } -result {bbbbbbbbbbbbbbb 15 123456789abcdef 1 4 abcd 0 3 efg} test chan-io-6.44 {Tcl_GetsObj: input saw cr, not followed by cr} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # not (*eol == '\n') set f [openpipe w+ $path(cat)] chan configure $f -translation {auto lf} -buffering none chan puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" chan configure $f -buffersize 16 lappend x [chan gets $f] chan configure $f -blocking 0 lappend x [chan gets $f line] $line [testchannel queuedcr $f] chan configure $f -blocking 1 chan puts -nonewline $f "abcd\refg\x1A" lappend x [chan gets $f line] $line [testchannel queuedcr $f] lappend x [chan gets $f line] $line } -cleanup { chan close $f } -result {bbbbbbbbbbbbbbb 15 123456789abcdef 1 4 abcd 0 3 efg} test chan-io-6.45 {Tcl_GetsObj: input saw cr, skip right number of bytes} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # Tcl_ExternalToUtf() set f [openpipe w+ $path(cat)] chan configure $f -translation {auto lf} -buffering none chan configure $f -encoding utf-16 chan puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" chan configure $f -buffersize 16 chan gets $f chan configure $f -blocking 0 lappend x [chan gets $f line] $line [testchannel queuedcr $f] chan configure $f -blocking 1 chan puts -nonewline $f "\nabcd\refg" lappend x [chan gets $f line] $line [testchannel queuedcr $f] } -cleanup { chan close $f } -result {15 123456789abcdef 1 4 abcd 0} test chan-io-6.46 {Tcl_GetsObj: input saw cr, followed by just \n should give eof} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # memmove() set f [openpipe w+ $path(cat)] chan configure $f -translation {auto lf} -buffering none chan puts -nonewline $f "bbbbbbbbbbbbbbb\n123456789abcdef\r" chan configure $f -buffersize 16 chan gets $f chan configure $f -blocking 0 lappend x [chan gets $f line] $line [testchannel queuedcr $f] chan configure $f -blocking 1 chan puts -nonewline $f "\n\x1A" lappend x [chan gets $f line] $line [testchannel queuedcr $f] } -cleanup { chan close $f } -result {15 123456789abcdef 1 -1 {} 0} test chan-io-6.47 {Tcl_GetsObj: auto mode: \r at end of buffer, peek for \n} -constraints {testchannel} -body { # (eol == dstEnd) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\r\nabcdefghijklmnopq" chan close $f set f [open $path(test1)] chan configure $f -translation auto -buffersize 16 list [chan gets $f] [testchannel inputbuffered $f] } -cleanup { chan close $f } -result {123456789012345 15} test chan-io-6.48 {Tcl_GetsObj: auto mode: \r at end of buffer, no more avail} -constraints {testchannel} -body { # PeekAhead() did not get any, so (eol >= dstEnd) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456789012345\r" chan close $f set f [open $path(test1)] chan configure $f -translation auto -buffersize 16 list [chan gets $f] [testchannel queuedcr $f] } -cleanup { chan close $f } -result {123456789012345 1} test chan-io-6.49 {Tcl_GetsObj: auto mode: \r followed by \n} -constraints {testchannel} -body { # if (*eol == '\n') {skip++} set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456\r\n78901" chan close $f set f [open $path(test1)] list [chan gets $f] [testchannel queuedcr $f] [chan tell $f] [chan gets $f] } -cleanup { chan close $f } -result {123456 0 8 78901} test chan-io-6.50 {Tcl_GetsObj: auto mode: \r not followed by \n} -constraints {testchannel} -body { # not (*eol == '\n') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456\r78901" chan close $f set f [open $path(test1)] list [chan gets $f] [testchannel queuedcr $f] [chan tell $f] [chan gets $f] } -cleanup { chan close $f } -result {123456 0 7 78901} test chan-io-6.51 {Tcl_GetsObj: auto mode: \n} -body { # else if (*eol == '\n') {goto gotoeol;} set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456\n78901" chan close $f set f [open $path(test1)] list [chan gets $f] [chan tell $f] [chan gets $f] } -cleanup { chan close $f } -result {123456 7 78901} test chan-io-6.52 {Tcl_GetsObj: saw EOF character} -constraints {testchannel} -body { # if (eof != NULL) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "123456\x1Ak9012345\r" chan close $f set f [open $path(test1)] chan configure $f -eofchar \x1A list [chan gets $f] [testchannel queuedcr $f] [chan tell $f] [chan gets $f] } -cleanup { chan close $f } -result {123456 0 6 {}} test chan-io-6.53 {Tcl_GetsObj: device EOF} -body { # didn't produce any bytes set f [open $path(test1) w] chan close $f set f [open $path(test1)] list [chan gets $f line] $line [chan eof $f] } -cleanup { chan close $f } -result {-1 {} 1} test chan-io-6.54 {Tcl_GetsObj: device EOF} -body { # got some bytes before EOF. set f [open $path(test1) w] chan puts -nonewline $f abc chan close $f set f [open $path(test1)] list [chan gets $f line] $line [chan eof $f] } -cleanup { chan close $f } -result {3 abc 1} test chan-io-6.55 {Tcl_GetsObj: overconverted} -body { # Tcl_ExternalToUtf(), make sure state updated set f [open $path(test1) w] chan configure $f -encoding iso2022-jp chan puts $f "there一ok\n丁more bytes\nhere" chan close $f set f [open $path(test1)] chan configure $f -encoding iso2022-jp list [chan gets $f line] $line [chan gets $f line] $line [chan gets $f line] $line } -cleanup { chan close $f } -result [list 8 "there一ok" 11 "丁more bytes" 4 "here"] test chan-io-6.56 {Tcl_GetsObj: incomplete lines should disable file events} -setup { update variable x {} } -constraints {stdio fileevent noappverifier} -body { set f [openpipe w+ $path(cat)] chan configure $f -buffering none chan puts -nonewline $f "foobar" chan configure $f -blocking 0 after 500 [namespace code { lappend x timeout }] chan event $f readable [namespace code { lappend x [chan gets $f] }] vwait [namespace which -variable x] vwait [namespace which -variable x] chan configure $f -blocking 1 chan puts -nonewline $f "baz\n" after 500 [namespace code { lappend x timeout }] chan configure $f -blocking 0 vwait [namespace which -variable x] vwait [namespace which -variable x] return $x } -cleanup { chan close $f } -result {{} timeout foobarbaz timeout} test chan-io-7.1 {FilterInputBytes: split up character at end of buffer} -body { # (result == TCL_CONVERT_MULTIBYTE) set f [open $path(test1) w] chan configure $f -encoding shiftjis chan puts $f "123456789012301234\nend" chan close $f set f [open $path(test1)] chan configure $f -encoding shiftjis -buffersize 16 chan gets $f } -cleanup { chan close $f } -result "123456789012301234" test chan-io-7.2 {FilterInputBytes: split up character in middle of buffer} -body { # (bufPtr->nextAdded < bufPtr->bufLength) set f [open $path(test1) w] chan configure $f -translation binary chan puts -nonewline $f "1234567890\n123\x82\x4F\x82\x50\x82" chan close $f set f [open $path(test1)] chan configure $f -encoding shiftjis list [chan gets $f line] $line [chan eof $f] } -cleanup { chan close $f } -result {10 1234567890 0} test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup { set x "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation binary chan puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" chan close $f set f [open $path(test1)] chan configure $f -encoding shiftjis -profile tcl8 lappend x [chan gets $f line] $line lappend x [chan tell $f] [testchannel inputbuffered $f] [chan eof $f] lappend x [chan gets $f line] $line } -cleanup { chan close $f } -result [list 16 "123456789012301\x82" 18 0 1 -1 ""] test chan-io-7.4 {FilterInputBytes: recover from split up character} -setup { variable x "" } -constraints {stdio fileevent} -body { set f [openpipe w+ $path(cat)] chan configure $f -translation binary -buffering none chan puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" chan configure $f -encoding shiftjis -blocking 0 chan event $f read [namespace code { lappend x [chan gets $f line] $line [chan blocked $f] }] vwait [namespace which -variable x] chan configure $f -translation binary -blocking 1 chan puts $f "\x51\x82\x52" chan configure $f -encoding shiftjis vwait [namespace which -variable x] return $x } -cleanup { chan close $f } -result [list -1 "" 1 17 "12345678901230123" 0] test chan-io-8.1 {PeekAhead: only go to device if no more cached data} -constraints {testchannel} -body { # (bufPtr->nextPtr == NULL) set f [open $path(test1) w] chan configure $f -encoding ascii -translation lf chan puts -nonewline $f "123456789012345\r\n2345678" chan close $f set f [open $path(test1)] chan configure $f -encoding ascii -translation auto -buffersize 16 # here chan gets $f testchannel inputbuffered $f } -cleanup { chan close $f } -result 7 test chan-io-8.2 {PeekAhead: only go to device if no more cached data} -setup { variable x {} } -constraints {stdio testchannel fileevent} -body { # not (bufPtr->nextPtr == NULL) set f [openpipe w+ $path(cat)] chan configure $f -translation lf -encoding ascii -buffering none chan puts -nonewline $f "123456789012345\r\nbcdefghijklmnopqrstuvwxyz" chan event $f read [namespace code { lappend x [chan gets $f line] $line [testchannel inputbuffered $f] }] chan configure $f -encoding utf-16 -buffersize 16 -blocking 0 vwait [namespace which -variable x] chan configure $f -translation auto -encoding ascii -blocking 1 # here vwait [namespace which -variable x] return $x } -cleanup { chan close $f } -result {-1 {} 42 15 123456789012345 25} test chan-io-8.3 {PeekAhead: no cached data available} -constraints {stdio testchannel fileevent} -body { # (bytesLeft == 0) set f [openpipe w+ $path(cat)] chan configure $f -translation {auto binary} chan puts -nonewline $f "abcdefghijklmno\r" chan flush $f list [chan gets $f line] $line [testchannel queuedcr $f] } -cleanup { chan close $f } -result {15 abcdefghijklmno 1} set a "123456789012345678901234567890" append a "123456789012345678901234567890" append a "1234567890123456789012345678901" test chan-io-8.4 {PeekAhead: cached data available in this buffer} -body { # not (bytesLeft == 0) set f [open $path(test1) w+] chan configure $f -translation binary chan puts $f "${a}\r\nabcdef" chan close $f set f [open $path(test1)] chan configure $f -translation binary -translation auto # "${a}\r" was converted in one operation (because ENCODING_LINESIZE is # 30). To check if "\n" follows, calls PeekAhead and determines that # cached data is available in buffer w/o having to call driver. chan gets $f } -cleanup { chan close $f } -result $a unset a test chan-io-8.5 {PeekAhead: don't peek if last read was short} -constraints {stdio testchannel fileevent} -body { # (bufPtr->nextAdded < bufPtr->length) set f [openpipe w+ $path(cat)] chan configure $f -translation {auto binary} chan puts -nonewline $f "abcdefghijklmno\r" chan flush $f # here list [chan gets $f line] $line [testchannel queuedcr $f] } -cleanup { chan close $f } -result {15 abcdefghijklmno 1} test chan-io-8.6 {PeekAhead: change to non-blocking mode} -constraints {stdio testchannel fileevent} -body { # ((chanPtr->flags & CHANNEL_NONBLOCKING) == 0) set f [openpipe w+ $path(cat)] chan configure $f -translation {auto binary} -buffersize 16 chan puts -nonewline $f "abcdefghijklmno\r" chan flush $f # here list [chan gets $f line] $line [testchannel queuedcr $f] } -cleanup { chan close $f } -result {15 abcdefghijklmno 1} test chan-io-8.7 {PeekAhead: cleanup} -setup { set x "" } -constraints {stdio testchannel fileevent} -body { # Make sure bytes are removed from buffer. set f [openpipe w+ $path(cat)] chan configure $f -translation {auto binary} -buffering none chan puts -nonewline $f "abcdefghijklmno\r" # here lappend x [chan gets $f line] $line [testchannel queuedcr $f] chan puts -nonewline $f \x1A lappend x [chan gets $f line] $line } -cleanup { chan close $f } -result {15 abcdefghijklmno 1 -1 {}} test chan-io-9.1 {CommonGetsCleanup} emptyTest { } {} test chan-io-10.1 {Tcl_ReadChars: CheckChannelErrors} emptyTest { # no test, need to cause an async error. } {} test chan-io-10.2 {Tcl_ReadChars: loop until enough copied} -body { # one time # for (copied = 0; (unsigned) toRead > 0; ) set f [open $path(test1) w] chan puts $f abcdefghijklmnop chan close $f set f [open $path(test1)] chan read $f 5 } -cleanup { chan close $f } -result {abcde} test chan-io-10.3 {Tcl_ReadChars: loop until enough copied} -body { # multiple times # for (copied = 0; (unsigned) toRead > 0; ) set f [open $path(test1) w] chan puts $f abcdefghijklmnopqrstuvwxyz chan close $f set f [open $path(test1)] chan configure $f -buffersize 16 # here chan read $f 19 } -cleanup { chan close $f } -result {abcdefghijklmnopqrs} test chan-io-10.4 {Tcl_ReadChars: no more in channel buffer} -body { # (copiedNow < 0) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] # here chan read $f 1000 } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-10.5 {Tcl_ReadChars: stop on EOF} -body { # (chanPtr->flags & CHANNEL_EOF) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] # here chan read $f 1000 } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-11.1 {ReadBytes: want to read a lot} -body { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] chan configure $f -translation binary # here chan read $f 1000 } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-11.2 {ReadBytes: want to read all} -body { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] chan configure $f -translation binary # here chan read $f } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-11.3 {ReadBytes: allocate more space} -body { # (toRead > length - offset - 1) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijklmnopqrstuvwxyz chan close $f set f [open $path(test1)] chan configure $f -buffersize 16 -translation binary # here chan read $f } -cleanup { chan close $f } -result {abcdefghijklmnopqrstuvwxyz} test chan-io-11.4 {ReadBytes: EOF char found} -body { # (TranslateInputEOL() != 0) set f [open $path(test1) w] chan puts $f abcdefghijklmnopqrstuvwxyz chan close $f set f [open $path(test1)] chan configure $f -translation binary -eofchar m # here list [chan read $f] [chan eof $f] [chan read $f] [chan eof $f] } -cleanup { chan close $f } -result {abcdefghijkl 1 {} 1} test chan-io-12.1 {ReadChars: want to read a lot} -body { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] # here chan read $f 1000 } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-12.2 {ReadChars: want to read all} -body { # ((unsigned) toRead > (unsigned) srcLen) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijkl chan close $f set f [open $path(test1)] # here chan read $f } -cleanup { chan close $f } -result {abcdefghijkl} test chan-io-12.3 {ReadChars: allocate more space} -body { # (toRead > length - offset - 1) set f [open $path(test1) w] chan puts -nonewline $f abcdefghijklmnopqrstuvwxyz chan close $f set f [open $path(test1)] chan configure $f -buffersize 16 # here chan read $f } -cleanup { chan close $f } -result {abcdefghijklmnopqrstuvwxyz} test chan-io-12.4 {ReadChars: split-up char} -setup { variable x {} } -constraints {stdio testchannel fileevent} -body { # (srcRead == 0) set f [openpipe w+ $path(cat)] chan configure $f -translation binary -buffering none -buffersize 16 chan puts -nonewline $f "123456789012345\x96" chan configure $f -encoding shiftjis -blocking 0 chan event $f read [namespace code { lappend x [chan read $f] [testchannel inputbuffered $f] }] chan configure $f -encoding shiftjis vwait [namespace which -variable x] chan configure $f -translation binary -blocking 1 chan puts -nonewline $f \x7B after 500 ;# Give the cat process time to catch up chan configure $f -encoding shiftjis -blocking 0 vwait [namespace which -variable x] return $x } -cleanup { chan close $f } -result [list "123456789012345" 1 本 0] test chan-io-12.5 {ReadChars: chan events on partial characters} -setup { variable x {} } -constraints {stdio fileevent} -body { set path(test1) [makeFile { chan configure stdout -translation binary -buffering none chan gets stdin; chan puts -nonewline \xE7 chan gets stdin; chan puts -nonewline \x89 chan gets stdin; chan puts -nonewline \xA6 } test1] set f [openpipe r+ $path(test1)] chan event $f readable [namespace code { lappend x [chan read $f] if {[chan eof $f]} { lappend x eof } }] chan puts $f "go1" chan flush $f chan configure $f -blocking 0 -encoding utf-8 vwait [namespace which -variable x] after 500 [namespace code { lappend x timeout }] vwait [namespace which -variable x] chan puts $f "go2" chan flush $f vwait [namespace which -variable x] after 500 [namespace code { lappend x timeout }] vwait [namespace which -variable x] chan puts $f "go3" chan flush $f vwait [namespace which -variable x] vwait [namespace which -variable x] lappend x [catch {chan close $f} msg] $msg } -result "{} timeout {} timeout 牦 {} eof 0 {}" test chan-io-13.1 {TranslateInputEOL: cr mode} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\rdef\r" chan close $f set f [open $path(test1)] chan configure $f -translation cr chan read $f } -cleanup { chan close $f } -result "abcd\ndef\n" test chan-io-13.2 {TranslateInputEOL: crlf mode} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r\ndef\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "abcd\ndef\n" test chan-io-13.3 {TranslateInputEOL: crlf mode: naked cr} -body { # (src >= srcMax) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r\ndef\r" chan close $f set f [open $path(test1)] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "abcd\ndef\r" test chan-io-13.4 {TranslateInputEOL: crlf mode: cr followed by not \n} -body { # (src >= srcMax) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r\ndef\rfgh" chan close $f set f [open $path(test1)] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "abcd\ndef\rfgh" test chan-io-13.5 {TranslateInputEOL: crlf mode: naked lf} -body { # (src >= srcMax) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r\ndef\nfgh" chan close $f set f [open $path(test1)] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "abcd\ndef\nfgh" test chan-io-13.6 {TranslateInputEOL: auto mode: saw cr in last segment} -setup { variable x {} variable y {} } -constraints {stdio testchannel fileevent noappverifier} -body { # (chanPtr->flags & INPUT_SAW_CR) # This test may fail on slower machines. set f [openpipe w+ $path(cat)] chan configure $f -blocking 0 -buffering none -translation {auto lf} chan event $f read [namespace code { lappend x [chan read $f] [testchannel queuedcr $f] }] chan puts -nonewline $f "abcdefghj\r" after 500 [namespace code {set y ok}] vwait [namespace which -variable y] chan puts -nonewline $f "\n01234" after 500 [namespace code {set y ok}] vwait [namespace which -variable y] return $x } -cleanup { chan close $f } -result [list "abcdefghj\n" 1 "01234" 0] test chan-io-13.7 {TranslateInputEOL: auto mode: naked \r} -constraints testchannel -body { # (src >= srcMax) set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r" chan close $f set f [open $path(test1)] chan configure $f -translation auto list [chan read $f] [testchannel queuedcr $f] } -cleanup { chan close $f } -result [list "abcd\n" 1] test chan-io-13.8 {TranslateInputEOL: auto mode: \r\n} -body { # (*src == '\n') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\r\ndef" chan close $f set f [open $path(test1)] chan configure $f -translation auto chan read $f } -cleanup { chan close $f } -result "abcd\ndef" test chan-io-13.9 {TranslateInputEOL: auto mode: \r followed by not \n} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\rdef" chan close $f set f [open $path(test1)] chan configure $f -translation auto chan read $f } -cleanup { chan close $f } -result "abcd\ndef" test chan-io-13.10 {TranslateInputEOL: auto mode: \n} -body { # not (*src == '\r') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\ndef" chan close $f set f [open $path(test1)] chan configure $f -translation auto chan read $f } -cleanup { chan close $f } -result "abcd\ndef" test chan-io-13.11 {TranslateInputEOL: EOF char} -body { # (*chanPtr->inEofChar != '\x00') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "abcd\ndefgh" chan close $f set f [open $path(test1)] chan configure $f -translation auto -eofchar e chan read $f } -cleanup { chan close $f } -result "abcd\nd" test chan-io-13.12 {TranslateInputEOL: find EOF char in src} -body { # (*chanPtr->inEofChar != '\x00') set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "\r\n\r\n\r\nab\r\n\r\ndef\r\n\r\n\r\n" chan close $f set f [open $path(test1)] chan configure $f -translation auto -eofchar e chan read $f } -cleanup { chan close $f } -result "\n\n\nab\n\nd" # Test standard handle management. The functions tested are Tcl_SetStdChannel # and Tcl_GetStdChannel. Incidentally we are also testing channel table # management. if {[testConstraint testchannel]} { set consoleFileNames [lsort [testchannel open]] } else { # just to avoid an error set consoleFileNames [list] } test chan-io-14.1 {Tcl_SetStdChannel and Tcl_GetStdChannel} {testchannel} { set result "" lappend result [chan configure stdin -buffering] lappend result [chan configure stdout -buffering] lappend result [chan configure stderr -buffering] lappend result [lsort [testchannel open]] } [list line line none $consoleFileNames] test chan-io-14.2 {Tcl_SetStdChannel and Tcl_GetStdChannel} -setup { interp create x set result "" } -body { lappend result [x eval {chan configure stdin -buffering}] lappend result [x eval {chan configure stdout -buffering}] lappend result [x eval {chan configure stderr -buffering}] } -cleanup { interp delete x } -result {line line none} set path(test3) [makeFile {} test3] test chan-io-14.3 {Tcl_SetStdChannel & Tcl_GetStdChannel} -constraints exec -body { set f [open $path(test1) w] chan puts -nonewline $f { chan close stdin chan close stdout chan close stderr set f [} chan puts $f [list open $path(test1) r]] chan puts $f "set f2 \[[list open $path(test2) w]]" chan puts $f "set f3 \[[list open $path(test3) w]]" chan puts $f { chan puts stdout [chan gets stdin] chan puts stdout out chan puts stderr err chan close $f chan close $f2 chan close $f3 } chan close $f set result [exec [interpreter] $path(test1)] set f [open $path(test2) r] set f2 [open $path(test3) r] lappend result [chan read $f] [chan read $f2] } -cleanup { chan close $f chan close $f2 } -result {{ out } {err }} # This test relies on the fact that stdout is used before stderr. test chan-io-14.4 {Tcl_SetStdChannel & Tcl_GetStdChannel} -constraints {exec} -body { set f [open $path(test1) w] chan puts -nonewline $f { chan close stdin chan close stdout chan close stderr set f [} chan puts $f [list open $path(test1) r]] chan puts $f "set f2 \[[list open $path(test2) w]]" chan puts $f "set f3 \[[list open $path(test3) w]]" chan puts $f { chan puts stdout [chan gets stdin] chan puts stdout $f2 chan puts stderr $f3 chan close $f chan close $f2 chan close $f3 } chan close $f set result [exec [interpreter] $path(test1)] set f [open $path(test2) r] set f2 [open $path(test3) r] lappend result [chan read $f] [chan read $f2] } -cleanup { chan close $f chan close $f2 } -result {{ chan close stdin stdout } {stderr }} catch {interp delete z} test chan-io-14.5 {Tcl_GetChannel: stdio name translation} -setup { interp create z } -body { chan eof stdin catch {z eval chan flush stdin} msg1 catch {z eval chan close stdin} msg2 catch {z eval chan flush stdin} msg3 list $msg1 $msg2 $msg3 } -cleanup { interp delete z } -result {{channel "stdin" wasn't opened for writing} {} {can not find channel named "stdin"}} test chan-io-14.6 {Tcl_GetChannel: stdio name translation} -setup { interp create z } -body { chan eof stdout catch {z eval chan flush stdout} msg1 catch {z eval chan close stdout} msg2 catch {z eval chan flush stdout} msg3 list $msg1 $msg2 $msg3 } -cleanup { interp delete z } -result {{} {} {can not find channel named "stdout"}} test chan-io-14.7 {Tcl_GetChannel: stdio name translation} -setup { interp create z } -body { chan eof stderr catch {z eval chan flush stderr} msg1 catch {z eval chan close stderr} msg2 catch {z eval chan flush stderr} msg3 list $msg1 $msg2 $msg3 } -cleanup { interp delete z } -result {{} {} {can not find channel named "stderr"}} set path(script) [makeFile {} script] test chan-io-14.8 {reuse of stdio special channels} -setup { file delete $path(script) file delete $path(test1) } -constraints stdio -body { set f [open $path(script) w] chan puts -nonewline $f { chan close stderr set f [} chan puts $f [list open $path(test1) w]] chan puts -nonewline $f { chan puts stderr hello chan close $f set f [} chan puts $f [list open $path(test1) r]] chan puts $f { chan puts [chan gets $f] } chan close $f set f [openpipe r $path(script)] chan gets $f } -cleanup { chan close $f } -result hello test chan-io-14.9 {reuse of stdio special channels} -setup { file delete $path(script) file delete $path(test1) } -constraints {stdio fileevent} -body { set f [open $path(script) w] chan puts $f { array set path [lindex $argv 0] set f [open $path(test1) w] chan puts $f hello chan close $f chan close stderr set f [open "|[list [info nameofexecutable] $path(cat) $path(test1)]" r] chan puts [chan gets $f] } chan close $f set f [openpipe r $path(script) [array get path]] chan gets $f } -cleanup { chan close $f # Added delay to give Windows time to stop the spawned process and clean # up its grip on the file test1. Added delete as proper test cleanup. # The failing tests were 18.1 and 18.2 as first re-users of file "test1". after [expr {[testConstraint win] ? 10000 : 500}] file delete $path(script) file delete $path(test1) } -result hello test chan-io-15.1 {Tcl_CreateChan CloseHandler} emptyTest { } {} test chan-io-16.1 {Tcl_DeleteChan CloseHandler} emptyTest { } {} # Test channel table management. The functions tested are GetChannelTable, # DeleteChannelTable, Tcl_RegisterChannel, Tcl_UnregisterChannel, # Tcl_GetChannel and Tcl_CreateChannel. # # These functions use "eof stdin" to ensure that the standard channels are # added to the channel table of the interpreter. test chan-io-17.1 {GetChannelTable, DeleteChannelTable on std handles} -setup { set l "" } -constraints {testchannel} -body { set l1 [testchannel refcount stdin] chan eof stdin interp create x lappend l [expr {[testchannel refcount stdin] - $l1}] x eval {chan eof stdin} lappend l [expr {[testchannel refcount stdin] - $l1}] interp delete x lappend l [expr {[testchannel refcount stdin] - $l1}] } -result {0 1 0} test chan-io-17.2 {GetChannelTable, DeleteChannelTable on std handles} -setup { set l "" } -constraints {testchannel} -body { set l1 [testchannel refcount stdout] chan eof stdin interp create x lappend l [expr {[testchannel refcount stdout] - $l1}] x eval {chan eof stdout} lappend l [expr {[testchannel refcount stdout] - $l1}] interp delete x lappend l [expr {[testchannel refcount stdout] - $l1}] } -result {0 1 0} test chan-io-17.3 {GetChannelTable, DeleteChannelTable on std handles} -setup { set l "" } -constraints {testchannel} -body { set l1 [testchannel refcount stderr] chan eof stdin interp create x lappend l [expr {[testchannel refcount stderr] - $l1}] x eval {chan eof stderr} lappend l [expr {[testchannel refcount stderr] - $l1}] interp delete x lappend l [expr {[testchannel refcount stderr] - $l1}] } -result {0 1 0} test chan-io-18.1 {Tcl_RegisterChannel, Tcl_UnregisterChannel} -setup { file delete -force $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] chan close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being chan closed" } string equal $l [list 1 "can not find channel named \"$f\""] } -result 1 test chan-io-18.2 {Tcl_RegisterChannel, Tcl_UnregisterChannel} -setup { file delete -force $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] interp create x interp share "" $f x lappend l [lindex [testchannel info $f] 15] x eval chan close $f lappend l [lindex [testchannel info $f] 15] interp delete x lappend l [lindex [testchannel info $f] 15] chan close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being chan closed" } string equal $l [list 1 2 1 1 "can not find channel named \"$f\""] } -result 1 test chan-io-18.3 {Tcl_RegisterChannel, Tcl_UnregisterChannel} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] lappend l [lindex [testchannel info $f] 15] interp create x interp share "" $f x lappend l [lindex [testchannel info $f] 15] interp delete x lappend l [lindex [testchannel info $f] 15] chan close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being chan closed" } string equal $l [list 1 2 1 "can not find channel named \"$f\""] } -result 1 test chan-io-19.1 {Tcl_GetChannel->Tcl_GetStdChannel, standard handles} { chan eof stdin } 0 test chan-io-19.2 {testing Tcl_GetChannel, user opened handle} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan eof $f } -cleanup { chan close $f } -result 0 test chan-io-19.3 {Tcl_GetChannel, channel not found} -body { chan eof file34 } -returnCodes error -result {can not find channel named "file34"} test chan-io-19.4 {Tcl_CreateChannel, insertion into channel table} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] lappend l [chan eof $f] chan close $f if {[catch {lindex [testchannel info $f] 15} msg]} { lappend l $msg } else { lappend l "very broken: $f found after being chan closed" } string equal $l [list 0 "can not find channel named \"$f\""] } -result 1 test chan-io-20.1 {Tcl_CreateChannel: initial settings} -setup { set old [encoding system] } -body { set a [open $path(test2) w] encoding system ascii set f [open $path(test1) w] chan configure $f -encoding } -cleanup { encoding system $old chan close $f chan close $a } -result {ascii} test chan-io-20.2 {Tcl_CreateChannel: initial settings} -constraints {win} -body { set f [open $path(test1) w+] list [chan configure $f -eofchar] [chan configure $f -translation] } -cleanup { chan close $f } -result {{} {auto crlf}} test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -body { set f [open $path(test1) w+] list [chan configure $f -eofchar] [chan configure $f -translation] } -cleanup { chan close $f } -result {{} {auto lf}} test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup { set path(stdout) [makeFile {} stdout] } -constraints {stdio notWinCI} -body { set f [open $path(script) w] chan puts -nonewline $f { chan close stdout set f1 [} chan puts $f [list open $path(stdout) w]] chan puts $f { chan configure $f1 -buffersize 777 chan puts stderr [chan configure stdout -buffersize] } chan close $f set f [openpipe r $path(script)] chan close $f } -cleanup { removeFile $path(stdout) } -returnCodes error -result {777} test chan-io-21.1 {Chan CloseChannelsOnExit} emptyTest { } {} # Test management of attributes associated with a channel, such as its default # translation, its name and type, etc. The functions tested in this group are # Tcl_GetChannelName, Tcl_GetChannelType and Tcl_GetChannelFile. # Tcl_GetChannelInstanceData not tested because files do not use the instance # data. test chan-io-22.1 {Tcl_GetChannelMode} emptyTest { # Not used anywhere in Tcl. } {} test chan-io-23.1 {Tcl_GetChannelName} -constraints {testchannel} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] set n [testchannel name $f] expr {$n eq $f ? "ok" : "$n != $f"} } -cleanup { chan close $f } -result ok test chan-io-24.1 {Tcl_GetChannelType} -constraints {testchannel} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] testchannel type $f } -cleanup { chan close $f } -result "file" test chan-io-25.1 {Tcl_GetChannelHandle, input} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f "1234567890\n098765432" chan close $f set f [open $path(test1) r] chan gets $f lappend l [testchannel inputbuffered $f] lappend l [chan tell $f] } -cleanup { chan close $f } -result {10 11} test chan-io-25.2 {Tcl_GetChannelHandle, output} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [chan tell $f] chan flush $f lappend l [testchannel outputbuffered $f] lappend l [chan tell $f] } -cleanup { chan close $f file delete $path(test1) } -result {6 6 0 6} test chan-io-26.1 {Tcl_GetChannelInstanceData} -body { # "pid" command uses Tcl_GetChannelInstanceData # Don't care what pid is (but must be a number), just want to exercise it. set f [openpipe r << exit] pid $f } -constraints stdio -cleanup { chan close $f } -match regexp -result {^\d+$} # Test flushing. The functions tested here are FlushChannel. test chan-io-27.1 {FlushChannel, no output buffered} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan flush $f file size $path(test1) } -cleanup { chan close $f } -result 0 test chan-io-27.2 {FlushChannel, some output buffered} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello lappend l [file size $path(test1)] chan flush $f lappend l [file size $path(test1)] chan close $f lappend l [file size $path(test1)] } -result {0 6 6} test chan-io-27.3 {FlushChannel, implicit flush on chan close} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello lappend l [file size $path(test1)] chan close $f lappend l [file size $path(test1)] } -result {0 6} test chan-io-27.4 {FlushChannel, implicit flush when buffer fills} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan configure $f -buffersize 60 lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { chan puts $f hello } lappend l [file size $path(test1)] chan flush $f lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {0 60 72} test chan-io-27.5 {FlushChannel, implicit flush when buffer fills and on chan close} -setup { file delete $path(test1) set l "" } -constraints {unixOrWin} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffersize 60 lappend l [file size $path(test1)] for {set i 0} {$i < 12} {incr i} { chan puts $f hello } lappend l [file size $path(test1)] chan close $f lappend l [file size $path(test1)] } -result {0 60 72} set path(pipe) [makeFile {} pipe] set path(output) [makeFile {} output] test chan-io-27.6 {FlushChannel, async flushing, async chan close} -setup { file delete $path(pipe) file delete $path(output) } -constraints {stdio asyncPipeChan Close} -body { set f [open $path(pipe) w] chan puts $f "set f \[[list open $path(output) w]]" chan puts $f { chan configure $f -translation lf -buffering none while {![chan eof stdin]} { after 20 chan puts -nonewline $f [chan read stdin 1024] } chan close $f } chan close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] chan close $f set f [openpipe w $path(pipe)] chan configure $f -blocking off chan puts -nonewline $f $x chan close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } } -result ok # Tests closing a channel. The functions tested are Chan CloseChannel and # Tcl_Chan Close. test chan-io-28.1 {Chan CloseChannel called when all references are dropped} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] interp create x interp share "" $f x lappend l [testchannel refcount $f] x eval chan close $f interp delete x lappend l [testchannel refcount $f] } -cleanup { chan close $f } -result {2 1} test chan-io-28.2 {Chan CloseChannel called when all references are dropped} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] interp create x interp share "" $f x chan puts -nonewline $f abc chan close $f x eval chan puts $f def x eval chan close $f interp delete x set f [open $path(test1) r] chan gets $f } -cleanup { chan close $f } -result abcdef test chan-io-28.3 {Chan CloseChannel, not called before output queue is empty} -setup { file delete $path(pipe) file delete $path(output) } -constraints {stdio asyncPipeChan Close nonPortable} -body { set f [open $path(pipe) w] chan puts $f { set f [open $path(output) w] chan configure $f -translation lf -buffering none for {set x 0} {$x < 20} {incr x} { after 20 chan puts -nonewline $f [chan read stdin 1024] } chan close $f } chan close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] chan close $f set f [openpipe r+ $path(pipe)] chan configure $f -blocking off chan puts -nonewline $f $x chan close $f set counter 0 while {([file size $path(output)] < 20480) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result probably_broken } else { set result ok } } -result ok test chan-io-28.4 {Tcl_Chan Close} -constraints {testchannel} -setup { file delete $path(test1) set l "" } -body { lappend l [lsort [testchannel open]] set f [open $path(test1) w] lappend l [lsort [testchannel open]] chan close $f lappend l [lsort [testchannel open]] set x [list $consoleFileNames \ [lsort [list {*}$consoleFileNames $f]] \ $consoleFileNames] expr {$l eq $x ? "ok" : "{$l} != {$x}"} } -result ok test chan-io-28.5 {Tcl_Chan Close vs standard handles} -setup { file delete $path(script) } -constraints {stdio unix testchannel} -body { set f [open $path(script) w] chan puts $f { chan close stdin chan puts [testchannel open] } chan close $f set f [openpipe r $path(script)] set l [chan gets $f] chan close $f lsort $l } -result {file1 file2} test chan-io-28.6 {Tcl_CloseEx (half-close) pipe} -setup { set cat [makeFile { fconfigure stdout -buffering line while {[gets stdin line] >= 0} {puts $line} puts DONE exit 0 } cat.tcl] variable done } -constraints noappverifier -body { set ff [openpipe r+ $cat] puts $ff Hey close $ff w set timer [after 1000 [namespace code {set done Failed}]] set acc {} fileevent $ff readable [namespace code { if {[gets $ff line] < 0} { set done Succeeded } else { lappend acc $line } }] vwait [namespace which -variable done] after cancel $timer close $ff r list $done $acc } -cleanup { removeFile cat.tcl } -result {Succeeded {Hey DONE}} test chan-io-28.7 {Tcl_CloseEx (half-close) socket} -setup { set echo [makeFile { proc accept {s args} {set ::sok $s} set s [socket -server accept 0] puts [lindex [fconfigure $s -sockname] 2] flush stdout vwait ::sok fconfigure $sok -buffering line while {[gets $sok line]>=0} {puts $sok $line} puts $sok DONE exit 0 } echo.tcl] variable done unset -nocomplain done set done "" set timer "" set ff [openpipe r $echo] gets $ff port } -body { set s [socket 127.0.0.1 $port] puts $s Hey close $s w set timer [after 1000 [namespace code {set done Failed}]] set acc {} fileevent $s readable [namespace code { if {[gets $s line]<0} { set done Succeeded } else { lappend acc $line } }] vwait [namespace which -variable done] list $done $acc } -cleanup { catch {close $s} close $ff after cancel $timer removeFile echo.tcl } -result {Succeeded {Hey DONE}} test chan-io-29.1 {Tcl_WriteChars, channel not writable} -body { chan puts stdin hello } -returnCodes error -result {channel "stdin" wasn't opened for writing} test chan-io-29.2 {Tcl_WriteChars, empty string} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts -nonewline $f "" chan close $f file size $path(test1) } -result 0 test chan-io-29.3 {Tcl_WriteChars, nonempty string} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts -nonewline $f hello chan close $f file size $path(test1) } -result 5 test chan-io-29.4 {Tcl_WriteChars, buffering in full buffering mode} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffering full chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {6 0 0 6} test chan-io-29.5 {Tcl_WriteChars, buffering in line buffering mode} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffering line chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {5 0 0 11} test chan-io-29.6 {Tcl_WriteChars, buffering in no buffering mode} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffering none chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {0 5 0 11} test chan-io-29.7 {Tcl_Flush, full buffering} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffering full chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {5 0 11 0 0 11} test chan-io-29.8 {Tcl_Flush, full buffering} -setup { file delete $path(test1) set l "" } -constraints {testchannel} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffering line chan puts -nonewline $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan puts $f hello lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] chan flush $f lappend l [testchannel outputbuffered $f] lappend l [file size $path(test1)] } -cleanup { chan close $f } -result {5 0 0 5 0 11 0 11} test chan-io-29.9 {Tcl_Flush, channel not writable} -body { chan flush stdin } -returnCodes error -result {channel "stdin" wasn't opened for writing} test chan-io-29.10 {Tcl_WriteChars, looping and buffering} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { chan puts $f1 [chan gets $f2] } chan close $f2 chan close $f1 file size $path(test1) } -result 387 test chan-io-29.11 {Tcl_WriteChars, no newline, implicit flush} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] set f2 [open $path(longfile) r] for {set x 0} {$x < 10} {incr x} { chan puts -nonewline $f1 [chan gets $f2] } chan close $f1 chan close $f2 file size $path(test1) } -result 377 test chan-io-29.12 {Tcl_WriteChars on a pipe} -setup { file delete $path(test1) file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 "set f1 \[[list open $path(longfile) r]]" chan puts $f1 { for {set x 0} {$x < 10} {incr x} { chan puts [chan gets $f1] } } chan close $f1 set f1 [openpipe r $path(pipe)] set f2 [open $path(longfile) r] set y ok for {set x 0} {$x < 10} {incr x} { set l1 [chan gets $f1] set l2 [chan gets $f2] if {$l1 ne $l2} { set y broken:$x } } return $y } -cleanup { chan close $f1 chan close $f2 } -result ok test chan-io-29.13 {Tcl_WriteChars to a pipe, line buffered} -setup { file delete $path(test1) file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 { chan puts [chan gets stdin] chan puts [chan gets stdin] } chan close $f1 set y ok set f1 [openpipe r+ $path(pipe)] chan configure $f1 -buffering line set f2 [open $path(longfile) r] set line [chan gets $f2] chan puts $f1 $line set backline [chan gets $f1] if {$line ne $backline} { set y broken1 } set line [chan gets $f2] chan puts $f1 $line set backline [chan gets $f1] if {$line ne $backline} { set y broken2 } return $y } -cleanup { chan close $f1 chan close $f2 } -result ok test chan-io-29.14 {Tcl_WriteChars, buffering and implicit flush at chan close} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts -nonewline $f "Text1" chan puts -nonewline $f " Text 2" chan puts $f " Text 3" chan close $f set f [open $path(test3) r] chan gets $f } -cleanup { chan close $f } -result {Text1 Text 2 Text 3} test chan-io-29.15 {Tcl_Flush, channel not open for writing} -setup { file delete $path(test1) set fd [open $path(test1) w] chan close $fd } -body { set fd [open $path(test1) r] chan flush $fd } -returnCodes error -cleanup { catch {chan close $fd} } -match glob -result {channel "*" wasn't opened for writing} test chan-io-29.16 {Tcl_Flush on pipe opened only for reading} -setup { set fd [openpipe r cat longfile] } -constraints stdio -body { chan flush $fd } -returnCodes error -cleanup { catch {chan close $fd} } -match glob -result {channel "*" wasn't opened for writing} test chan-io-29.17 {Tcl_WriteChars buffers, then Tcl_Flush flushes} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 hello chan puts $f1 hello chan puts $f1 hello chan flush $f1 file size $path(test1) } -cleanup { chan close $f1 } -result 18 test chan-io-29.18 {Tcl_WriteChars and Tcl_Flush intermixed} -setup { file delete $path(test1) set x "" set f1 [open $path(test1) w] } -body { chan configure $f1 -translation lf chan puts $f1 hello chan puts $f1 hello chan puts $f1 hello chan flush $f1 lappend x [file size $path(test1)] chan puts $f1 hello chan flush $f1 lappend x [file size $path(test1)] chan puts $f1 hello chan flush $f1 lappend x [file size $path(test1)] } -cleanup { chan close $f1 } -result {18 24 30} test chan-io-29.19 {Explicit and implicit flushes} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf set x "" chan puts $f1 hello chan puts $f1 hello chan puts $f1 hello chan flush $f1 lappend x [file size $path(test1)] chan puts $f1 hello chan flush $f1 lappend x [file size $path(test1)] chan puts $f1 hello chan close $f1 lappend x [file size $path(test1)] } -result {18 24 30} test chan-io-29.20 {Implicit flush when buffer is full} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf set line "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" for {set x 0} {$x < 100} {incr x} { chan puts $f1 $line } set z "" lappend z [file size $path(test1)] for {set x 0} {$x < 100} {incr x} { chan puts $f1 $line } lappend z [file size $path(test1)] chan close $f1 lappend z [file size $path(test1)] } -result {4096 12288 12600} test chan-io-29.21 {Tcl_Flush to pipe} -setup { file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 {set x [chan read stdin 6]} chan puts $f1 {set cnt [string length $x]} chan puts $f1 {chan puts "read $cnt characters"} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello chan flush $f1 chan gets $f1 } -cleanup { catch {chan close $f1} } -result "read 6 characters" test chan-io-29.22 {Tcl_Flush called at other end of pipe} -setup { file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 { chan configure stdout -buffering full chan puts hello chan puts hello chan flush stdout chan gets stdin chan puts bye chan flush stdout } chan close $f1 set f1 [openpipe r+ $path(pipe)] set x "" lappend x [chan gets $f1] lappend x [chan gets $f1] chan puts $f1 hello chan flush $f1 lappend x [chan gets $f1] } -cleanup { chan close $f1 } -result {hello hello bye} test chan-io-29.23 {Tcl_Flush and line buffering at end of pipe} -setup { file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 { chan puts hello chan puts hello chan gets stdin chan puts bye } chan close $f1 set f1 [openpipe r+ $path(pipe)] set x "" lappend x [chan gets $f1] lappend x [chan gets $f1] chan puts $f1 hello chan flush $f1 lappend x [chan gets $f1] } -cleanup { chan close $f1 } -result {hello hello bye} test chan-io-29.24 {Tcl_WriteChars and Tcl_Flush move end of file} -setup { variable x {} } -body { set f [open $path(test3) w] chan puts $f "Line 1" chan puts $f "Line 2" set f2 [open $path(test3)] lappend x [chan read -nonewline $f2] chan close $f2 chan flush $f set f2 [open $path(test3)] lappend x [chan read -nonewline $f2] } -cleanup { chan close $f2 chan close $f } -result "{} {Line 1\nLine 2}" test chan-io-29.25 {Implicit flush with Tcl_Flush to command pipelines} -setup { file delete $path(test3) } -constraints {stdio fileevent} -body { set f [openpipe w $path(cat) | [interpreter] $path(cat) > $path(test3)] chan puts $f "Line 1" chan puts $f "Line 2" chan close $f after 100 set f [open $path(test3) r] chan read $f } -cleanup { chan close $f } -result "Line 1\nLine 2\n" test chan-io-29.26 {Tcl_Flush, Tcl_Write on bidirectional pipelines} -constraints {stdio unixExecs} -body { set f [open "|[list cat -u]" r+] chan puts $f "Line1" chan flush $f chan gets $f } -cleanup { chan close $f } -result {Line1} test chan-io-29.27 {Tcl_Flush on chan closed pipeline} -setup { file delete $path(pipe) set f [open $path(pipe) w] chan puts $f {exit} chan close $f } -constraints stdio -body { set f [openpipe r+ $path(pipe)] chan gets $f chan puts $f output after 50 # # The flush below will get a SIGPIPE. This is an expected part of the test # and indicates that the test operates correctly. If you run this test # under a debugger, the signal will by intercepted unless you disable the # debugger's signal interception. # if {[catch {chan flush $f} msg]} { set x [list 1 $msg $::errorCode] catch {chan close $f} } elseif {[catch {chan close $f} msg]} { set x [list 1 $msg $::errorCode] } else { set x {this was supposed to fail and did not} } string tolower $x } -match glob -result {1 {error flushing "*": broken pipe} {posix epipe {broken pipe}}} test chan-io-29.28 {Tcl_WriteChars, lf mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan flush $f file size $path(test1) } -cleanup { chan close $f } -result 21 test chan-io-29.29 {Tcl_WriteChars, cr mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f file size $path(test1) } -result 21 test chan-io-29.30 {Tcl_WriteChars, crlf mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f file size $path(test1) } -result 25 test chan-io-29.31 {Tcl_WriteChars, background flush} -setup { file delete $path(pipe) file delete $path(output) } -constraints stdio -body { set f [open $path(pipe) w] chan puts $f "set f \[[list open $path(output) w]]" chan puts $f {chan configure $f -translation lf} set x [list while {![chan eof stdin]}] set x "$x {" chan puts $f $x chan puts $f { chan puts -nonewline $f [chan read stdin 4096]} chan puts $f { chan flush $f} chan puts $f "}" chan puts $f {chan close $f} chan close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] chan close $f set f [openpipe r+ $path(pipe)] chan configure $f -blocking off chan puts -nonewline $f $x chan close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 10 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } # allow a little time for the background process to chan close. # otherwise, the following test fails on the [file delete $path(output)] # on Windows because a process still has the file open. after 100 set v 1; vwait v return $result } -result ok test chan-io-29.32 {Tcl_WriteChars, background flush to slow reader} -setup { file delete $path(pipe) file delete $path(output) } -constraints {stdio asyncPipeChan Close} -body { set f [open $path(pipe) w] chan puts $f "set f \[[list open $path(output) w]]" chan puts $f {chan configure $f -translation lf} set x [list while {![chan eof stdin]}] set x "$x \{" chan puts $f $x chan puts $f { after 20} chan puts $f { chan puts -nonewline $f [chan read stdin 1024]} chan puts $f { chan flush $f} chan puts $f "\}" chan puts $f {chan close $f} chan close $f set x 01234567890123456789012345678901 for {set i 0} {$i < 11} {incr i} { set x "$x$x" } set f [open $path(output) w] chan close $f set f [openpipe r+ $path(pipe)] chan configure $f -blocking off chan puts -nonewline $f $x chan close $f set counter 0 while {([file size $path(output)] < 65536) && ($counter < 1000)} { after 20 [list incr [namespace which -variable counter]] vwait [namespace which -variable counter] } if {$counter == 1000} { set result "file size only [file size $path(output)]" } else { set result ok } } -result ok test chan-io-29.33 {Tcl_Flush, implicit flush on exit} -setup { set f [open $path(script) w] chan puts $f "set f \[[list open $path(test1) w]]" chan puts $f {chan configure $f -translation lf chan puts $f hello chan puts $f bye chan puts $f strange } chan close $f } -constraints exec -body { exec [interpreter] $path(script) set f [open $path(test1) r] chan read $f } -cleanup { chan close $f } -result "hello\nbye\nstrange\n" test chan-io-29.34 {Tcl_Chan Close, async flush on chan close, using sockets} -setup { variable c 0 variable x running set l abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz proc writelots {s l} { for {set i 0} {$i < 2000} {incr i} { chan puts $s $l } } } -constraints {socket tempNotMac fileevent notWinCI} -body { proc accept {s a p} { variable x chan event $s readable [namespace code [list readit $s]] chan configure $s -blocking off set x accepted } proc readit {s} { variable c variable x set l [chan gets $s] if {[chan eof $s]} { chan close $s set x done } elseif {([string length $l] > 0) || ![chan blocked $s]} { incr c } } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set cs [socket 127.0.0.1 [lindex [chan configure $ss -sockname] 2]] vwait [namespace which -variable x] chan configure $cs -blocking off writelots $cs $l chan close $cs chan close $ss vwait [namespace which -variable x] set c } -result 2000 test chan-io-29.35 {Tcl_Chan Close vs chan event vs multiple interpreters} -setup { catch {interp delete x} catch {interp delete y} } -constraints {socket tempNotMac fileevent} -body { # On Mac, this test screws up sockets such that subsequent tests using # port 2828 either cause errors or panic(). interp create x interp create y set s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] proc accept {s a p} { chan puts $s hello chan close $s } set c [socket 127.0.0.1 [lindex [chan configure $s -sockname] 2]] interp share {} $c x interp share {} $c y chan close $c x eval { proc readit {s} { chan gets $s if {[chan eof $s]} { chan close $s } } } y eval { proc readit {s} { chan gets $s if {[chan eof $s]} { chan close $s } } } x eval "chan event $c readable \{readit $c\}" y eval "chan event $c readable \{readit $c\}" y eval [list chan close $c] update } -cleanup { chan close $s interp delete x interp delete y } -result "" # Test end of line translations. Procedures tested are Tcl_Write, Tcl_Read. test chan-io-30.1 {Tcl_Write lf, Tcl_Read lf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf chan read $f } -cleanup { chan close $f } -result "hello\nthere\nand\nhere\n" test chan-io-30.2 {Tcl_Write lf, Tcl_Read cr} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr chan read $f } -cleanup { chan close $f } -result "hello\nthere\nand\nhere\n" test chan-io-30.3 {Tcl_Write lf, Tcl_Read crlf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "hello\nthere\nand\nhere\n" test chan-io-30.4 {Tcl_Write cr, Tcl_Read cr} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr chan read $f } -cleanup { chan close $f } -result "hello\nthere\nand\nhere\n" test chan-io-30.5 {Tcl_Write cr, Tcl_Read lf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf chan read $f } -cleanup { chan close $f } -result "hello\rthere\rand\rhere\r" test chan-io-30.6 {Tcl_Write cr, Tcl_Read crlf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "hello\rthere\rand\rhere\r" test chan-io-30.7 {Tcl_Write crlf, Tcl_Read crlf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf chan read $f } -cleanup { chan close $f } -result "hello\nthere\nand\nhere\n" test chan-io-30.8 {Tcl_Write crlf, Tcl_Read lf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf chan read $f } -cleanup { chan close $f } -result "hello\r\nthere\r\nand\r\nhere\r\n" test chan-io-30.9 {Tcl_Write crlf, Tcl_Read cr} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr chan read $f } -cleanup { chan close $f } -result "hello\n\nthere\n\nand\n\nhere\n\n" test chan-io-30.10 {Tcl_Write lf, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] list [chan read $f] [chan configure $f -translation] } -cleanup { chan close $f } -result {{hello there and here } auto} test chan-io-30.11 {Tcl_Write cr, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] list [chan read $f] [chan configure $f -translation] } -cleanup { chan close $f } -result {{hello there and here } auto} test chan-io-30.12 {Tcl_Write crlf, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] list [chan read $f] [chan configure $f -translation] } -cleanup { chan close $f } -result {{hello there and here } auto} test chan-io-30.13 {Tcl_Write crlf on block boundary, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf chan puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { chan puts $f $line } chan close $f set f [open $path(test1) r] chan configure $f -translation auto string length [chan read $f] } -cleanup { chan close $f } -result [expr {700*15 + 1}] test chan-io-30.14 {Tcl_Write crlf on block boundary, Tcl_Read crlf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf chan puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { chan puts $f $line } chan close $f set f [open $path(test1) r] chan configure $f -translation crlf string length [chan read $f] } -cleanup { chan close $f } -result [expr {700*15 + 1}] test chan-io-30.15 {Tcl_Write mixed, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\rhere chan close $f set f [open $path(test1) r] chan configure $f -translation auto chan read $f } -cleanup { chan close $f } -result {hello there and here } test chan-io-30.16 {Tcl_Write ^Z at end, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f hello\nthere\nand\rhere\n\x1A chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan read $f } -cleanup { chan close $f } -result {hello there and here } test chan-io-30.17 {Tcl_Write, implicit ^Z at end, Tcl_Read auto} -setup { file delete $path(test1) } -constraints {win} -body { set f [open $path(test1) w] chan configure $f -translation lf -eofchar \x1A chan puts $f hello\nthere\nand\rhere chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan read $f } -cleanup { chan close $f } -result {hello there and here } test chan-io-30.18 {Tcl_Write, ^Z in middle, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] chan puts $f $s chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A set l "" lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1 {} 1} test chan-io-30.19 {Tcl_Write, ^Z no newline in middle, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf set s [format "abc\ndef\n%cghi\nqrs" 26] chan puts $f $s chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A set l "" lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1 {} 1} test chan-io-30.20 {Tcl_Write, ^Z in middle ignored, Tcl_Read lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation lf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "abc def 0 \x1Aghi 0 qrs 0 {} 1" test chan-io-30.21 {Tcl_Write, ^Z in middle ignored, Tcl_Read cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation cr set x [chan gets $f] lappend l [string equal $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {1 1 {} 1} test chan-io-30.22 {Tcl_Write, ^Z in middle ignored, Tcl_Read crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cghi\nqrs" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation crlf set x [chan gets $f] lappend l [string equal $x "abc\ndef\n\x1Aghi\nqrs\n"] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {1 1 {} 1} test chan-io-30.23 {Tcl_Write lf, ^Z in middle, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format abc\ndef\n%cqrs\ntuv 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} test chan-io-30.24 {Tcl_Write lf, ^Z in middle, Tcl_Read lf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf set c [format abc\ndef\n%cqrs\ntuv 26] chan puts $f $c chan close $f set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} test chan-io-30.25 {Tcl_Write cr, ^Z in middle, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] chan puts $f $c chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} test chan-io-30.26 {Tcl_Write cr, ^Z in middle, Tcl_Read cr} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr set c [format abc\ndef\n%cqrs\ntuv 26] chan puts $f $c chan close $f set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} test chan-io-30.27 {Tcl_Write crlf, ^Z in middle, Tcl_Read auto} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] chan puts $f $c chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} test chan-io-30.28 {Tcl_Write crlf, ^Z in middle, Tcl_Read crlf} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf set c [format abc\ndef\n%cqrs\ntuv 26] chan puts $f $c chan close $f set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A list [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 1} # Test end of line translations. Functions tested are Tcl_Write and # Tcl_Gets. test chan-io-31.1 {Tcl_Write lf, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] } -cleanup { chan close $f } -result {hello 6 auto there 12 auto} test chan-io-31.2 {Tcl_Write cr, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] } -cleanup { chan close $f } -result {hello 6 auto there 12 auto} test chan-io-31.3 {Tcl_Write crlf, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] } -cleanup { chan close $f } -result {hello 7 auto there 14 auto} test chan-io-31.4 {Tcl_Write lf, Tcl_Gets lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] } -cleanup { chan close $f } -result {hello 6 lf there 12 lf} test chan-io-31.5 {Tcl_Write lf, Tcl_Gets cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {21 21 cr 1 {} 21 cr 1} test chan-io-31.6 {Tcl_Write lf, Tcl_Gets crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {21 21 crlf 1 {} 21 crlf 1} test chan-io-31.7 {Tcl_Write cr, Tcl_Gets cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello 6 cr 0 there 12 cr 0} test chan-io-31.8 {Tcl_Write cr, Tcl_Gets lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {21 21 lf 1 {} 21 lf 1} test chan-io-31.9 {Tcl_Write cr, Tcl_Gets crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {21 21 crlf 1 {} 21 crlf 1} test chan-io-31.10 {Tcl_Write crlf, Tcl_Gets crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation crlf lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello 7 crlf 0 there 14 crlf 0} test chan-io-31.11 {Tcl_Write crlf, Tcl_Gets cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation cr lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello 6 cr 0 6 13 cr 0} test chan-io-31.12 {Tcl_Write crlf, Tcl_Gets lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f hello\nthere\nand\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation lf lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] lappend l [string length [chan gets $f]] lappend l [chan tell $f] lappend l [chan configure $f -translation] lappend l [chan eof $f] } -cleanup { chan close $f } -result {6 7 lf 0 6 14 lf 0} test chan-io-31.13 {binary mode is synonym of lf mode} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation binary chan configure $f -translation } -cleanup { chan close $f } -result lf # # Test chan-io-9.14 has been removed because "auto" output translation mode is # not supported. # test chan-io-31.14 {Tcl_Write mixed, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f hello\nthere\rand\r\nhere chan close $f set f [open $path(test1) r] chan configure $f -translation auto lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.15 {Tcl_Write mixed, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f hello\nthere\rand\r\nhere\r chan close $f set f [open $path(test1) r] chan configure $f -translation auto lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.16 {Tcl_Write mixed, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f hello\nthere\rand\r\nhere\n chan close $f set f [open $path(test1) r] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.17 {Tcl_Write mixed, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f hello\nthere\rand\r\nhere\r\n chan close $f set f [open $path(test1) r] chan configure $f -translation auto lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.18 {Tcl_Write ^Z at end, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "hello\nthere\nand\rhere\n\%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.19 {Tcl_Write, implicit ^Z at end, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf -eofchar \x1A chan puts $f hello\nthere\nand\rhere chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {hello there and here 0 {} 1} test chan-io-31.20 {Tcl_Write, ^Z in middle, Tcl_Gets auto, eofChar} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.21 {Tcl_Write, no newline ^Z in middle, Tcl_Gets auto, eofChar} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.22 {Tcl_Write, ^Z in middle ignored, Tcl_Gets lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation lf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test chan-io-31.23 {Tcl_Write, ^Z in middle ignored, Tcl_Gets cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation cr lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test chan-io-31.24 {Tcl_Write, ^Z in middle ignored, Tcl_Gets crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation crlf lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "abc def 0 \x1Aqrs 0 tuv 0 {} 1" test chan-io-31.25 {Tcl_Write lf, ^Z in middle, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.26 {Tcl_Write lf, ^Z in middle, Tcl_Gets lf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.27 {Tcl_Write cr, ^Z in middle, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.28 {Tcl_Write cr, ^Z in middle, Tcl_Gets cr} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.29 {Tcl_Write crlf, ^Z in middle, Tcl_Gets auto} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.30 {Tcl_Write crlf, ^Z in middle, Tcl_Gets crlf} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f [format "abc\ndef\n%cqrs\ntuv" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A lappend l [chan gets $f] lappend l [chan gets $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {abc def 0 {} 1} test chan-io-31.31 {Tcl_Write crlf on block boundary, Tcl_Gets crlf} -setup { file delete $path(test1) set c "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf chan puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { chan puts $f $line } chan close $f set f [open $path(test1) r] chan configure $f -translation crlf while {[chan gets $f line] >= 0} { append c $line\n } chan close $f string length $c } -result [expr {700*15 + 1}] test chan-io-31.32 {Tcl_Write crlf on block boundary, Tcl_Gets auto} -setup { file delete $path(test1) set c "" } -body { set f [open $path(test1) w] chan configure $f -translation crlf set line "123456789ABCDE" ;# 14 char plus crlf chan puts -nonewline $f x ;# shift crlf across block boundary for {set i 0} {$i < 700} {incr i} { chan puts $f $line } chan close $f set f [open $path(test1) r] chan configure $f -translation auto while {[chan gets $f line] >= 0} { append c $line\n } chan close $f string length $c } -result [expr {700*15 + 1}] # Test Tcl_Read and buffering. test chan-io-32.1 {Tcl_Read, channel not readable} -body { read stdout } -returnCodes error -result {channel "stdout" wasn't opened for reading} test chan-io-32.2 {Tcl_Read, zero byte count} { chan read stdin 0 } "" test chan-io-32.3 {Tcl_Read, negative byte count} -setup { set f [open $path(longfile) r] } -body { chan read $f -1 } -returnCodes error -cleanup { chan close $f } -result {expected non-negative integer but got "-1"} test chan-io-32.4 {Tcl_Read, positive byte count} -body { set f [open $path(longfile) r] string length [chan read $f 1024] } -cleanup { chan close $f } -result 1024 test chan-io-32.5 {Tcl_Read, multiple buffers} -body { set f [open $path(longfile) r] chan configure $f -buffersize 100 string length [chan read $f 1024] } -cleanup { chan close $f } -result 1024 test chan-io-32.6 {Tcl_Read, very large read} { set f1 [open $path(longfile) r] set z [chan read $f1 1000000] chan close $f1 set l [string length $z] set x ok set z [file size $path(longfile)] if {$z != $l} { set x "$z != $l" } set x } ok test chan-io-32.7 {Tcl_Read, nonblocking, file} {nonBlockFiles} { set f1 [open $path(longfile) r] chan configure $f1 -blocking off set z [chan read $f1 20] chan close $f1 set l [string length $z] set x ok if {$l != 20} { set x "$l != 20" } set x } ok test chan-io-32.8 {Tcl_Read, nonblocking, file} {nonBlockFiles} { set f1 [open $path(longfile) r] chan configure $f1 -blocking off set z [chan read $f1 1000000] chan close $f1 set x ok set l [string length $z] set z [file size $path(longfile)] if {$z != $l} { set x "$z != $l" } set x } ok test chan-io-32.9 {Tcl_Read, read to end of file} { set f1 [open $path(longfile) r] set z [chan read $f1] chan close $f1 set l [string length $z] set x ok set z [file size $path(longfile)] if {$z != $l} { set x "$z != $l" } set x } ok test chan-io-32.10 {Tcl_Read from a pipe} -setup { file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 {chan puts [chan gets stdin]} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello chan flush $f1 chan read $f1 } -cleanup { chan close $f1 } -result "hello\n" test chan-io-32.11 {Tcl_Read from a pipe} -setup { file delete $path(pipe) set x "" } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 {chan puts [chan gets stdin]} chan puts $f1 {chan puts [chan gets stdin]} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello chan flush $f1 lappend x [chan read $f1 6] chan puts $f1 hello chan flush $f1 lappend x [chan read $f1] } -cleanup { chan close $f1 } -result {{hello } {hello }} test chan-io-32.12 {Tcl_Read, -nonewline} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan puts $f1 hello chan puts $f1 bye chan close $f1 set f1 [open $path(test1) r] chan read -nonewline $f1 } -cleanup { chan close $f1 } -result {hello bye} test chan-io-32.13 {Tcl_Read, -nonewline} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan puts $f1 hello chan puts $f1 bye chan close $f1 set f1 [open $path(test1) r] set c [chan read -nonewline $f1] list [string length $c] $c } -cleanup { chan close $f1 } -result {9 {hello bye}} test chan-io-32.14 {Tcl_Read, reading in small chunks} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts $f "Two lines: this one" chan puts $f "and this one" chan close $f set f [open $path(test1)] list [chan read $f 1] [chan read $f 2] [chan read $f] } -cleanup { chan close $f } -result {T wo { lines: this one and this one }} test chan-io-32.15 {Tcl_Read, asking for more input than available} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts $f "Two lines: this one" chan puts $f "and this one" chan close $f set f [open $path(test1)] chan read $f 100 } -cleanup { chan close $f } -result {Two lines: this one and this one } test chan-io-32.16 {Tcl_Read, read to end of file with -nonewline} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts $f "Two lines: this one" chan puts $f "and this one" chan close $f set f [open $path(test1)] chan read -nonewline $f } -cleanup { chan close $f } -result {Two lines: this one and this one} # Test Tcl_Gets. test chan-io-33.1 {Tcl_Gets, reading what was written} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan puts $f1 "first line" chan close $f1 set f1 [open $path(test1) r] chan gets $f1 } -cleanup { chan close $f1 } -result {first line} test chan-io-33.2 {Tcl_Gets into variable} { set f1 [open $path(longfile) r] set c [chan gets $f1 x] set l [string length x] set z ok if {$l != $l} { set z broken } chan close $f1 set z } ok test chan-io-33.3 {Tcl_Gets from pipe} -setup { file delete $path(pipe) } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 {chan puts [chan gets stdin]} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello chan flush $f1 chan gets $f1 } -cleanup { chan close $f1 } -result hello test chan-io-33.4 {Tcl_Gets with long line} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan close $f set f [open $path(test3)] chan gets $f } -cleanup { chan close $f } -result {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} test chan-io-33.5 {Tcl_Gets with long line} -setup { set f [open $path(test3) w] puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" puts $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" close $f } -body { set f [open $path(test3)] set x [chan gets $f y] chan close $f list $x $y } -result {260 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ} test chan-io-33.6 {Tcl_Gets and end of file} -setup { file delete $path(test3) set x {} } -body { set f [open $path(test3) w] chan puts -nonewline $f "Test1\nTest2" chan close $f set f [open $path(test3)] set y {} lappend x [chan gets $f y] $y set y {} lappend x [chan gets $f y] $y set y {} lappend x [chan gets $f y] $y } -cleanup { chan close $f } -result {5 Test1 5 Test2 -1 {}} test chan-io-33.7 {Tcl_Gets and bad variable} -setup { set f [open $path(test3) w] chan puts $f "Line 1" chan puts $f "Line 2" chan close $f catch {unset x} set f [open $path(test3) r] } -body { set x 24 chan gets $f x(0) } -returnCodes error -cleanup { chan close $f } -result {can't set "x(0)": variable isn't array} test chan-io-33.8 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 100} {incr y} {chan puts $f $x} chan close $f set f [open $path(test3) r] chan configure $f -translation lf for {set y 0} {$y < 100} {incr y} {chan gets $f} chan close $f set y } 100 test chan-io-33.9 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 200} {incr y} {chan puts $f $x} chan close $f set f [open $path(test3) r] chan configure $f -translation lf for {set y 0} {$y < 200} {incr y} {chan gets $f} chan close $f set y } 200 test chan-io-33.10 {Tcl_Gets, exercising double buffering} { set f [open $path(test3) w] chan configure $f -translation lf set x "" for {set y 0} {$y < 99} {incr y} {set x "a$x"} for {set y 0} {$y < 300} {incr y} {chan puts $f $x} chan close $f set f [open $path(test3) r] chan configure $f -translation lf for {set y 0} {$y < 300} {incr y} {chan gets $f} chan close $f set y } 300 # Test Tcl_Seek and Tcl_Tell. test chan-io-34.1 {Tcl_Seek to current position at start of file} -body { set f1 [open $path(longfile) r] chan seek $f1 0 current chan tell $f1 } -cleanup { chan close $f1 } -result 0 test chan-io-34.2 {Tcl_Seek to offset from start} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 10 start chan tell $f1 } -cleanup { chan close $f1 } -result 10 test chan-io-34.3 {Tcl_Seek to end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 0 end chan tell $f1 } -cleanup { chan close $f1 } -result 54 test chan-io-34.4 {Tcl_Seek to offset from end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 -10 end chan tell $f1 } -cleanup { chan close $f1 } -result 44 test chan-io-34.5 {Tcl_Seek to offset from current position} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 10 current chan seek $f1 10 current chan tell $f1 } -cleanup { chan close $f1 } -result 20 test chan-io-34.6 {Tcl_Seek to offset from end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 -10 end list [chan tell $f1] [chan read $f1] } -cleanup { chan close $f1 } -result {44 {rstuvwxyz }} test chan-io-34.7 {Tcl_Seek to offset from end of file, then to current position} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 -10 end set c1 [chan tell $f1] set r1 [chan read $f1 5] chan seek $f1 0 current list $c1 $r1 [chan tell $f1] } -cleanup { chan close $f1 } -result {44 rstuv 49} test chan-io-34.8 {Tcl_Seek on pipes: not supported} -setup { set pipe [openpipe] } -constraints stdio -body { chan seek $pipe 0 current } -returnCodes error -cleanup { chan close $pipe } -match glob -result {error during seek on "*": invalid argument} test chan-io-34.9 {Tcl_Seek, testing buffered input flushing} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts -nonewline $f "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" chan close $f set f [open $path(test3) RDWR] set x [chan read $f 1] chan seek $f 3 lappend x [chan read $f 1] chan seek $f 0 start lappend x [chan read $f 1] chan seek $f 10 current lappend x [chan read $f 1] chan seek $f -2 end lappend x [chan read $f 1] chan seek $f 50 end lappend x [chan read $f 1] chan seek $f 1 lappend x [chan read $f 1] } -cleanup { chan close $f } -result {a d a l Y {} b} set path(test3) [makeFile {} test3] test chan-io-34.10 {Tcl_Seek testing flushing of buffered input} { set f [open $path(test3) w] chan configure $f -translation lf chan puts $f xyz\n123 chan close $f set f [open $path(test3) r+] chan configure $f -translation lf set x [chan gets $f] chan seek $f 0 current chan puts $f 456 chan close $f list $x [viewFile test3] } "xyz {xyz 456}" test chan-io-34.11 {Tcl_Seek testing flushing of buffered output} { set f [open $path(test3) w] chan puts $f xyz\n123 chan close $f set f [open $path(test3) w+] chan puts $f xyzzy chan seek $f 2 set x [chan gets $f] chan close $f list $x [viewFile test3] } "zzy xyzzy" test chan-io-34.12 {Tcl_Seek testing combination of write, seek back and read} { set f [open $path(test3) w] chan configure $f -translation lf chan puts $f xyz\n123 chan close $f set f [open $path(test3) a+] chan configure $f -translation lf chan puts $f xyzzy chan flush $f set x [chan tell $f] chan seek $f -4 cur set y [chan gets $f] chan close $f list $x [viewFile test3] $y } {14 {xyz 123 xyzzy} zzy} test chan-io-34.13 {Tcl_Tell at start of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan tell $f1 } -cleanup { chan close $f1 } -result 0 test chan-io-34.14 {Tcl_Tell after seek to end of file} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 0 end chan tell $f1 } -cleanup { chan close $f1 } -result 54 test chan-io-34.15 {Tcl_Tell combined with seeking} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan puts $f1 "abcdefghijklmnopqrstuvwxyz" chan close $f1 set f1 [open $path(test1) r] chan seek $f1 10 start set c1 [chan tell $f1] chan seek $f1 10 current list $c1 [chan tell $f1] } -cleanup { chan close $f1 } -result {10 20} test chan-io-34.16 {Tcl_Tell on pipe: always -1} -constraints stdio -body { set f1 [openpipe] chan tell $f1 } -cleanup { chan close $f1 } -result -1 test chan-io-34.17 {Tcl_Tell on pipe: always -1} stdio { set f1 [openpipe] chan puts $f1 {chan puts hello} chan flush $f1 set c [chan tell $f1] chan gets $f1 chan close $f1 set c } -1 test chan-io-34.18 {Tcl_Tell combined with seeking and reading} -setup { file delete $path(test2) } -body { set f [open $path(test2) w] chan configure $f -translation lf chan puts -nonewline $f "line1\nline2\nline3\nline4\nline5\n" chan close $f set f [open $path(test2)] chan configure $f -translation lf set x [chan tell $f] chan read $f 3 lappend x [chan tell $f] chan seek $f 2 lappend x [chan tell $f] chan seek $f 10 current lappend x [chan tell $f] chan seek $f 0 end lappend x [chan tell $f] } -cleanup { chan close $f } -result {0 3 2 12 30} test chan-io-34.19 {Tcl_Tell combined with opening in append mode} -body { set f [open $path(test3) w] chan configure $f -translation lf chan puts $f "abcdefghijklmnopqrstuvwxyz" chan puts $f "abcdefghijklmnopqrstuvwxyz" chan close $f set f [open $path(test3) a] chan tell $f } -cleanup { chan close $f } -result 54 test chan-io-34.20 {Tcl_Tell combined with writing} -setup { set l "" } -body { set f [open $path(test3) w] chan seek $f 29 start lappend l [chan tell $f] chan puts -nonewline $f a chan seek $f 39 start lappend l [chan tell $f] chan puts -nonewline $f a lappend l [chan tell $f] chan seek $f 407 end lappend l [chan tell $f] } -cleanup { chan close $f } -result {29 39 40 447} test chan-io-34.21 {Tcl_Seek and Tcl_Tell on large files} -setup { file delete $path(test3) set l "" } -constraints {largefileSupport extensive} -body { set f [open $path(test3) w] chan configure $f -translation binary lappend l [chan tell $f] chan puts -nonewline $f abcdef lappend l [chan tell $f] chan flush $f lappend l [chan tell $f] # 4GB offset! chan seek $f 0x100000000 lappend l [chan tell $f] chan puts -nonewline $f abcdef lappend l [chan tell $f] chan close $f lappend l [file size $path(test3)] # truncate... chan close [open $path(test3) w] lappend l [file size $path(test3)] } -result {0 6 6 4294967296 4294967302 4294967302 0} # Test Tcl_Eof test chan-io-35.1 {Tcl_Eof} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan puts $f hello chan puts $f hello chan close $f set f [open $path(test1)] set x [chan eof $f] lappend x [chan eof $f] chan gets $f lappend x [chan eof $f] chan gets $f lappend x [chan eof $f] chan gets $f lappend x [chan eof $f] lappend x [chan eof $f] } -cleanup { chan close $f } -result {0 0 0 0 1 1} test chan-io-35.2 {Tcl_Eof with pipe} -constraints stdio -setup { file delete $path(pipe) } -body { set f1 [open $path(pipe) w] chan puts $f1 {chan gets stdin} chan puts $f1 {chan puts hello} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello set x [chan eof $f1] chan flush $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] } -cleanup { chan close $f1 } -result {0 0 0 1} test chan-io-35.3 {Tcl_Eof with pipe} -constraints stdio -setup { file delete $path(pipe) } -body { set f1 [open $path(pipe) w] chan puts $f1 {chan gets stdin} chan puts $f1 {chan puts hello} chan close $f1 set f1 [openpipe r+ $path(pipe)] chan puts $f1 hello set x [chan eof $f1] chan flush $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] chan gets $f1 lappend x [chan eof $f1] } -cleanup { chan close $f1 } -result {0 0 0 1 1 1} test chan-io-35.4 {Tcl_Eof, eof detection on nonblocking file} -setup { file delete $path(test1) set l "" } -constraints {nonBlockFiles} -body { chan close [open $path(test1) w] set f [open $path(test1) r] chan configure $f -blocking off lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {{} 1} test chan-io-35.5 {Tcl_Eof, eof detection on nonblocking pipe} -setup { file delete $path(pipe) set l "" } -constraints stdio -body { set f [open $path(pipe) w] chan puts $f { exit } chan close $f set f [openpipe r $path(pipe)] lappend l [chan gets $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {{} 1} test chan-io-35.6 {Tcl_Eof, eof char, lf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 8 1} test chan-io-35.7 {Tcl_Eof, eof char, lf write, lf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 8 1} test chan-io-35.8 {Tcl_Eof, eof char, cr write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 8 1} test chan-io-35.9 {Tcl_Eof, eof char, cr write, cr read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {8 8 1} test chan-io-35.10 {Tcl_Eof, eof char, crlf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {10 8 1} test chan-io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf -eofchar \x1A chan puts $f abc\ndef chan close $f set s [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A list $s [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {10 8 1} test chan-io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {17 8 1} test chan-io-35.13 {Tcl_Eof, eof char in middle, lf write, lf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {17 8 1} test chan-io-35.14 {Tcl_Eof, eof char in middle, cr write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {17 8 1} test chan-io-35.15 {Tcl_Eof, eof char in middle, cr write, cr read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {17 8 1} test chan-io-35.16 {Tcl_Eof, eof char in middle, crlf write, auto read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {21 8 1} test chan-io-35.17 {Tcl_Eof, eof char in middle, crlf write, crlf read} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts $f [format abc\ndef\n%cqrs\nuvw 26] chan close $f set c [file size $path(test1)] set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A list $c [string length [chan read $f]] [chan eof $f] } -cleanup { chan close $f } -result {21 8 1} # Test Tcl_InputBlocked test chan-io-36.1 {Tcl_InputBlocked on nonblocking pipe} -setup { set x "" } -constraints stdio -body { set f1 [openpipe] chan puts $f1 {chan puts hello_from_pipe} chan flush $f1 chan gets $f1 chan configure $f1 -blocking off -buffering full chan puts $f1 {chan puts hello} lappend x [chan gets $f1] lappend x [chan blocked $f1] chan flush $f1 after 200 lappend x [chan gets $f1] lappend x [chan blocked $f1] lappend x [chan gets $f1] lappend x [chan blocked $f1] } -cleanup { chan close $f1 } -result {{} 1 hello 0 {} 1} test chan-io-36.2 {Tcl_InputBlocked on blocking pipe} -setup { set x "" } -constraints stdio -body { set f1 [openpipe] chan configure $f1 -buffering line chan puts $f1 {chan puts hello_from_pipe} lappend x [chan gets $f1] lappend x [chan blocked $f1] chan puts $f1 {exit} lappend x [chan gets $f1] lappend x [chan blocked $f1] lappend x [chan eof $f1] } -cleanup { chan close $f1 } -result {hello_from_pipe 0 {} 0 1} test chan-io-36.3 {Tcl_InputBlocked vs files, short read} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan puts $f abcdefghijklmnop chan close $f set f [open $path(test1) r] lappend l [chan blocked $f] lappend l [chan read $f 3] lappend l [chan blocked $f] lappend l [chan read -nonewline $f] lappend l [chan blocked $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {0 abc 0 defghijklmnop 0 1} test chan-io-36.4 {Tcl_InputBlocked vs files, event driven read} -setup { file delete $path(test1) set l "" variable x } -constraints {fileevent} -body { set f [open $path(test1) w] chan puts $f abcdefghijklmnop chan close $f set f [open $path(test1) r] chan event $f readable [namespace code { lappend l [chan read $f 3] if {[chan eof $f]} {lappend l eof; chan close $f; set x done} }] vwait [namespace which -variable x] return $l } -result {abc def ghi jkl mno {p } eof} test chan-io-36.5 {Tcl_InputBlocked vs files, short read, nonblocking} -setup { file delete $path(test1) set l "" } -constraints {nonBlockFiles} -body { set f [open $path(test1) w] chan puts $f abcdefghijklmnop chan close $f set f [open $path(test1) r] chan configure $f -blocking off lappend l [chan blocked $f] lappend l [chan read $f 3] lappend l [chan blocked $f] lappend l [chan read -nonewline $f] lappend l [chan blocked $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result {0 abc 0 defghijklmnop 0 1} test chan-io-36.6 {Tcl_InputBlocked vs files, event driven read} -setup { file delete $path(test1) set l "" variable x } -constraints {nonBlockFiles fileevent} -body { set f [open $path(test1) w] chan puts $f abcdefghijklmnop chan close $f set f [open $path(test1) r] chan configure $f -blocking off chan event $f readable [namespace code { lappend l [chan read $f 3] if {[chan eof $f]} {lappend l eof; chan close $f; set x done} }] vwait [namespace which -variable x] return $l } -result {abc def ghi jkl mno {p } eof} # Test Tcl_InputBuffered test chan-io-37.1 {Tcl_InputBuffered} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(longfile) r] chan configure $f -buffersize 4096 chan read $f 3 lappend l [testchannel inputbuffered $f] lappend l [chan tell $f] } -cleanup { chan close $f } -result {4093 3} test chan-io-37.2 {Tcl_InputBuffered, test input flushing on seek} -setup { set l "" } -constraints {testchannel} -body { set f [open $path(longfile) r] chan configure $f -buffersize 4096 chan read $f 3 lappend l [testchannel inputbuffered $f] lappend l [chan tell $f] chan seek $f 0 current lappend l [testchannel inputbuffered $f] lappend l [chan tell $f] } -cleanup { chan close $f } -result {4093 3 0 3} # Test Tcl_SetChannelBufferSize, Tcl_GetChannelBufferSize test chan-io-38.1 {Tcl_GetChannelBufferSize, default buffer size} -body { set f [open $path(longfile) r] chan configure $f -buffersize } -cleanup { chan close $f } -result 4096 test chan-io-38.2 {Tcl_SetChannelBufferSize, Tcl_GetChannelBufferSize} -setup { set l "" } -body { set f [open $path(longfile) r] lappend l [chan configure $f -buffersize] chan configure $f -buffersize 10000 lappend l [chan configure $f -buffersize] chan configure $f -buffersize 1 lappend l [chan configure $f -buffersize] chan configure $f -buffersize -1 lappend l [chan configure $f -buffersize] chan configure $f -buffersize 0 lappend l [chan configure $f -buffersize] chan configure $f -buffersize 100000 lappend l [chan configure $f -buffersize] chan configure $f -buffersize 10000000 lappend l [chan configure $f -buffersize] } -cleanup { chan close $f } -result {4096 10000 1 1 1 100000 1048576} test chan-io-38.3 {Tcl_SetChannelBufferSize, changing buffersize between reads} { # This test crashes the interp if Bug #427196 is not fixed set chan [open [info script] r] chan configure $chan -buffersize 10 -encoding utf-8 set var [chan read $chan 2] chan configure $chan -buffersize 32 append var [chan read $chan] chan close $chan } {} # Test Tcl_SetChannelOption, Tcl_GetChannelOption test chan-io-39.1 {Tcl_GetChannelOption} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -blocking } -cleanup { chan close $f1 } -result 1 # # Test 17.2 was removed. # test chan-io-39.2 {Tcl_GetChannelOption} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -buffering } -cleanup { chan close $f1 } -result full test chan-io-39.3 {Tcl_GetChannelOption} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -buffering line chan configure $f1 -buffering } -cleanup { chan close $f1 } -result line test chan-io-39.4 {Tcl_GetChannelOption, Tcl_SetChannelOption} -setup { file delete $path(test1) set l "" } -body { set f1 [open $path(test1) w] lappend l [chan configure $f1 -buffering] chan configure $f1 -buffering line lappend l [chan configure $f1 -buffering] chan configure $f1 -buffering none lappend l [chan configure $f1 -buffering] chan configure $f1 -buffering line lappend l [chan configure $f1 -buffering] chan configure $f1 -buffering full lappend l [chan configure $f1 -buffering] } -cleanup { chan close $f1 } -result {full line none line full} test chan-io-39.5 {Tcl_GetChannelOption, invariance} -setup { file delete $path(test1) set l "" } -body { set f1 [open $path(test1) w] lappend l [chan configure $f1 -buffering] lappend l [list [catch {chan configure $f1 -buffering green} msg] $msg] lappend l [chan configure $f1 -buffering] } -cleanup { chan close $f1 } -result {full {1 {bad value for -buffering: must be one of full, line, or none}} full} test chan-io-39.6 {Tcl_SetChannelOption, multiple options} -setup { file delete $path(test1) } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf -buffering line chan puts $f1 hello chan puts $f1 bye file size $path(test1) } -cleanup { chan close $f1 } -result 10 test chan-io-39.7 {Tcl_SetChannelOption, buffering, translation} -setup { file delete $path(test1) set x "" } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf chan puts $f1 hello chan puts $f1 bye chan configure $f1 -buffering line lappend x [file size $path(test1)] chan puts $f1 really_bye lappend x [file size $path(test1)] } -cleanup { chan close $f1 } -result {0 21} test chan-io-39.8 {Tcl_SetChannelOption, different buffering options} -setup { file delete $path(test1) set l "" } -body { set f1 [open $path(test1) w] chan configure $f1 -translation lf -buffering none chan puts -nonewline $f1 hello lappend l [file size $path(test1)] chan puts -nonewline $f1 hello lappend l [file size $path(test1)] chan configure $f1 -buffering full chan puts -nonewline $f1 hello lappend l [file size $path(test1)] chan configure $f1 -buffering none lappend l [file size $path(test1)] chan puts -nonewline $f1 hello lappend l [file size $path(test1)] chan close $f1 lappend l [file size $path(test1)] } -result {5 10 10 10 20 20} test chan-io-39.9 {Tcl_SetChannelOption, blocking mode} -setup { file delete $path(test1) set x "" } -constraints {nonBlockFiles} -body { set f1 [open $path(test1) w] chan close $f1 set f1 [open $path(test1) r] lappend x [chan configure $f1 -blocking] chan configure $f1 -blocking off lappend x [chan configure $f1 -blocking] lappend x [chan gets $f1] lappend x [chan read $f1 1000] lappend x [chan blocked $f1] lappend x [chan eof $f1] } -cleanup { chan close $f1 } -result {1 0 {} {} 0 1} test chan-io-39.10 {Tcl_SetChannelOption, blocking mode} -setup { file delete $path(pipe) set x "" } -constraints stdio -body { set f1 [open $path(pipe) w] chan puts $f1 { chan gets stdin after 100 chan puts hi chan gets stdin } chan close $f1 set f1 [openpipe r+ $path(pipe)] chan configure $f1 -blocking off -buffering line lappend x [chan configure $f1 -blocking] lappend x [chan gets $f1] lappend x [chan blocked $f1] chan configure $f1 -blocking on chan puts $f1 hello chan configure $f1 -blocking off lappend x [chan gets $f1] lappend x [chan blocked $f1] chan configure $f1 -blocking on chan puts $f1 bye chan configure $f1 -blocking off lappend x [chan gets $f1] lappend x [chan blocked $f1] chan configure $f1 -blocking on lappend x [chan configure $f1 -blocking] lappend x [chan gets $f1] lappend x [chan blocked $f1] lappend x [chan eof $f1] lappend x [chan gets $f1] lappend x [chan eof $f1] } -cleanup { chan close $f1 } -result {0 {} 1 {} 1 {} 1 1 hi 0 0 {} 1} test chan-io-39.11 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size clipped to lower bound} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -buffersize -10 chan configure $f -buffersize } -cleanup { chan close $f } -result 1 test chan-io-39.12 {Tcl_SetChannelOption, Tcl_GetChannelOption buffer size clipped to upper bound} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -buffersize 10000000 chan configure $f -buffersize } -cleanup { chan close $f } -result 1048576 test chan-io-39.13 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -buffersize 40000 chan configure $f -buffersize } -cleanup { chan close $f } -result 40000 test chan-io-39.14 {Tcl_SetChannelOption: -encoding, binary & utf-8} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation binary chan puts -nonewline $f \xE7\x89\xA6 chan close $f set f [open $path(test1) r] chan configure $f -encoding utf-8 chan read $f } -cleanup { chan close $f } -result 牦 test chan-io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} -setup { file delete $path(test1) } -body { set f [open $path(test1) w] chan configure $f -translation binary chan puts -nonewline $f \xE7\x89\xA6 chan close $f set f [open $path(test1) r] chan configure $f -encoding utf-8 chan read $f } -cleanup { chan close $f } -result 牦 test chan-io-39.16 {Tcl_SetChannelOption: -encoding, errors} -setup { file delete $path(test1) set f [open $path(test1) w] } -body { chan configure $f -encoding foobar } -returnCodes error -cleanup { chan close $f } -result {unknown encoding "foobar"} test chan-io-39.17 {Tcl_SetChannelOption: -encoding, clearing CHANNEL_NEED_MORE_DATA} -setup { variable x {} } -constraints {stdio fileevent} -body { set f [openpipe r+ $path(cat)] chan configure $f -encoding iso8859-1 chan puts -nonewline $f \xE7 chan flush $f chan configure $f -encoding utf-8 -blocking 0 chan event $f readable [namespace code { lappend x [chan read $f] }] vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] chan configure $f -encoding utf-8 vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] chan configure $f -encoding iso8859-1 vwait [namespace which -variable x] after 300 [namespace code { lappend x timeout }] vwait [namespace which -variable x] return $x } -cleanup { chan close $f } -result "{} timeout {} timeout \xE7 timeout" test chan-io-39.18 {Tcl_SetChannelOption, setting read mode independently} \ -constraints {socket} -body { proc accept {s a p} {chan close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [chan configure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update chan configure $s2 -translation {auto lf} chan configure $s2 -translation } -cleanup { chan close $s1 chan close $s2 } -result {auto lf} test chan-io-39.19 {Tcl_SetChannelOption, setting read mode independently} \ -constraints {socket} -body { proc accept {s a p} {chan close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [chan configure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update chan configure $s2 -translation {auto crlf} chan configure $s2 -translation } -cleanup { chan close $s1 chan close $s2 } -result {auto crlf} test chan-io-39.20 {Tcl_SetChannelOption, setting read mode independently} \ -constraints {socket} -body { proc accept {s a p} {chan close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [chan configure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update chan configure $s2 -translation {auto cr} chan configure $s2 -translation } -cleanup { chan close $s1 chan close $s2 } -result {auto cr} test chan-io-39.21 {Tcl_SetChannelOption, setting read mode independently} \ -constraints {socket} -body { proc accept {s a p} {chan close $s} set s1 [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [chan configure $s1 -sockname] 2] set s2 [socket 127.0.0.1 $port] update chan configure $s2 -translation {auto auto} chan configure $s2 -translation } -cleanup { chan close $s1 chan close $s2 } -result {auto crlf} test chan-io-39.22 {Tcl_SetChannelOption, invariance} -setup { file delete $path(test1) set l "" } -constraints {unix deprecated} -body { set f1 [open $path(test1) w+] lappend l [chan configure $f1 -eofchar] chan configure $f1 -eofchar {O {}} lappend l [chan configure $f1 -eofchar] chan configure $f1 -eofchar D lappend l [chan configure $f1 -eofchar] } -cleanup { chan close $f1 } -result {{} O D} test chan-io-39.22a {Tcl_SetChannelOption, invariance} -constraints deprecated -setup { file delete $path(test1) set l [list] } -body { set f1 [open $path(test1) w+] chan configure $f1 -eofchar {O {}} lappend l [chan configure $f1 -eofchar] chan configure $f1 -eofchar D lappend l [chan configure $f1 -eofchar] lappend l [list [catch {chan configure $f1 -eofchar {1 2 3}} msg] $msg] } -cleanup { chan close $f1 } -result {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}} test chan-io-39.23 { Tcl_GetChannelOption, server socket is not readable or writable, but should still have valid -eofchar and -translation options. } -setup { set l [list] } -body { set sock [socket -server [namespace code accept] -myaddr 127.0.0.1 0] lappend l [chan configure $sock -eofchar] \ [chan configure $sock -translation] } -cleanup { chan close $sock } -result {{} auto} test chan-io-39.24 {Tcl_SetChannelOption, server socket is not readable or\ writable so we can't change -eofchar or -translation} -setup { set l [list] } -body { set sock [socket -server [namespace code accept] -myaddr 127.0.0.1 0] chan configure $sock -eofchar D -translation lf lappend l [chan configure $sock -eofchar] \ [chan configure $sock -translation] } -cleanup { chan close $sock } -result {{} auto} test chan-io-40.1 {POSIX open access modes: RDWR} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts $f xyzzy chan close $f set f [open $path(test3) RDWR] chan puts -nonewline $f "ab" chan seek $f 0 current set x [chan gets $f] chan close $f set f [open $path(test3) r] lappend x [chan gets $f] } -cleanup { chan close $f } -result {zzy abzzy} test chan-io-40.2 {POSIX open access modes: CREAT} -setup { file delete $path(test3) } -constraints {unix notWsl} -body { set f [open $path(test3) {WRONLY CREAT} 0o600] file stat $path(test3) stats set x [format 0o%03o [expr {$stats(mode) & 0o777}]] chan puts $f "line 1" chan close $f set f [open $path(test3) r] lappend x [chan gets $f] } -cleanup { chan close $f } -result {0o600 {line 1}} test chan-io-40.3 {POSIX open access modes: CREAT} -setup { file delete $path(test3) } -constraints {unix umask notWsl} -body { # This test only works if your umask is 2, like ouster's. chan close [open $path(test3) {WRONLY CREAT}] file stat $path(test3) stats format 0o%03o [expr {$stats(mode) & 0o777}] } -result [format 0o%03o [expr {0o666 & ~ $umaskValue}]] test chan-io-40.4 {POSIX open access modes: CREAT} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts $f xyzzy chan close $f set f [open $path(test3) {WRONLY CREAT}] chan puts -nonewline $f "ab" chan close $f set f [open $path(test3) r] chan gets $f } -cleanup { chan close $f } -result abzzy test chan-io-40.5 {POSIX open access modes: APPEND} -setup { file delete $path(test3) set x "" } -body { set f [open $path(test3) w] chan configure $f -translation lf chan puts $f xyzzy chan close $f set f [open $path(test3) {WRONLY APPEND}] chan configure $f -translation lf chan puts $f "new line" chan seek $f 0 chan puts $f "abc" chan close $f set f [open $path(test3) r] chan configure $f -translation lf chan seek $f 6 current lappend x [chan gets $f] lappend x [chan gets $f] } -cleanup { chan close $f } -result {{new line} abc} test chan-io-40.6 {POSIX open access modes: EXCL} -match regexp -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts $f xyzzy chan close $f open $path(test3) {WRONLY CREAT EXCL} } -returnCodes error -result {(?i)couldn't open ".*test3": file (already )?exists} test chan-io-40.7 {POSIX open access modes: EXCL} -setup { file delete $path(test3) } -body { set f [open $path(test3) {WRONLY CREAT EXCL}] chan puts $f "A test line" chan close $f viewFile test3 } -result {A test line} test chan-io-40.8 {POSIX open access modes: TRUNC} -setup { file delete $path(test3) } -body { set f [open $path(test3) w] chan puts $f xyzzy chan close $f set f [open $path(test3) {WRONLY TRUNC}] chan puts $f abc chan close $f set f [open $path(test3) r] chan gets $f } -cleanup { chan close $f } -result abc test chan-io-40.9 {POSIX open access modes: NONBLOCK} -setup { file delete $path(test3) } -constraints {nonPortable unix} -body { set f [open $path(test3) {WRONLY NONBLOCK CREAT}] chan puts $f "NONBLOCK test" chan close $f set f [open $path(test3) r] chan gets $f } -cleanup { chan close $f } -result {NONBLOCK test} test chan-io-40.10 {POSIX open access modes: RDONLY} -body { set f [open $path(test1) w] chan puts $f "two lines: this one" chan puts $f "and this" chan close $f set f [open $path(test1) RDONLY] list [chan gets $f] [catch {chan puts $f Test} msg] $msg } -cleanup { chan close $f } -match glob -result {{two lines: this one} 1 {channel "*" wasn't opened for writing}} test chan-io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.13 {POSIX open access modes: WRONLY} -body { makeFile xyzzy test3 set f [open $path(test3) WRONLY] chan puts -nonewline $f "ab" chan seek $f 0 current set x [list [catch {chan gets $f} msg] $msg] chan close $f lappend x [viewFile test3] } -match glob -result {1 {channel "*" wasn't opened for reading} abzzy} test chan-io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR } -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] chan puts -nonewline $f "ab" chan seek $f 0 current set x [chan gets $f] chan close $f lappend x [viewFile test3] } {zzy abzzy} test chan-io-40.16 {verify no tilde substitution in open} -setup { set curdir [pwd] cd [temporaryDirectory] } -body { close [open ~ w] list [file isfile ~] } -cleanup { file delete ./~ ;# ./ because don't want to delete home in case of bugs! cd $curdir } -result 1 test chan-io-41.1 {Tcl_FileeventCmd: errors} -constraints fileevent -body { chan event foo } -returnCodes error -result {wrong # args: should be "chan event channel event ?script?"} test chan-io-41.2 {Tcl_FileeventCmd: errors} -constraints fileevent -body { chan event foo bar baz q } -returnCodes error -result {wrong # args: should be "chan event channel event ?script?"} test chan-io-41.3 {Tcl_FileeventCmd: errors} -constraints fileevent -body { chan event gorp readable } -returnCodes error -result {can not find channel named "gorp"} test chan-io-41.4 {Tcl_FileeventCmd: errors} -constraints fileevent -body { chan event gorp writable } -returnCodes error -result {can not find channel named "gorp"} test chan-io-41.5 {Tcl_FileeventCmd: errors} -constraints fileevent -body { chan event gorp who-knows } -returnCodes error -result {bad event name "who-knows": must be readable or writable} test chan-io-41.6 {Tcl_FileeventCmd: directory} -constraints {fileevent unix} -setup { set tempdir [::tcltests::tempdir] } -body { set chan [open $tempdir] chan event $chan readable [list ::apply [list {} { variable success set success 1 } [namespace current]]] vwait [namespace current]::success return $success } -cleanup { close $chan file delete -force tempdir } -result 1 test chan-io-41.7 {Tcl_FileeventCmd: special} -constraints { fileevent specialfiles } -body { set special /dev/zero if {![file exists $special]} { set special NUL } set chan [open $special] chan event $chan readable [list ::apply [list {} { variable success set success 1 } [namespace current]]] vwait [namespace current]::success return $success } -cleanup { close $chan } -result 1 test chan-io-41.8 {Tcl_FileeventCmd: symbolic link} -constraints {fileevent unix} -setup { set tempdir [::tcltests::tempdir] } -body { set target [makeFile {not again} thefile $tempdir] set link [file join $tempdir thelin] file link -symbolic $link $target set chan [open $link] chan event $chan readable [list ::apply [list {} { variable success set success 1 } [namespace current]]] vwait [namespace current]::success return $success } -cleanup { close $chan file delete -force $tempdir } -result 1 # # Test chan event on a file # set path(foo) [makeFile {} foo] set f [open $path(foo) w+] test chan-io-42.1 {Tcl_FileeventCmd: creating, deleting, querying} {fileevent} { list [chan event $f readable] [chan event $f writable] } {{} {}} test chan-io-42.2 {Tcl_FileeventCmd: replacing} {fileevent} { set result {} chan event $f r "first script" lappend result [chan event $f readable] chan event $f r "new script" lappend result [chan event $f readable] chan event $f r "yet another" lappend result [chan event $f readable] chan event $f r "" lappend result [chan event $f readable] } {{first script} {new script} {yet another} {}} test chan-io-42.3 {Tcl_FileeventCmd: replacing, with NULL chars in script} {fileevent} { set result {} chan event $f r "first scr\x00ipt" lappend result [string length [chan event $f readable]] chan event $f r "new scr\x00ipt" lappend result [string length [chan event $f readable]] chan event $f r "yet ano\x00ther" lappend result [string length [chan event $f readable]] chan event $f r "" lappend result [chan event $f readable] } {13 11 12 {}} test chan-io-43.1 {Tcl_FileeventCmd: creating, deleting, querying} {stdio unixExecs fileevent} { set result {} chan event $f readable "script 1" lappend result [chan event $f readable] [chan event $f writable] chan event $f writable "write script" lappend result [chan event $f readable] [chan event $f writable] chan event $f readable {} lappend result [chan event $f readable] [chan event $f writable] chan event $f writable {} lappend result [chan event $f readable] [chan event $f writable] } {{script 1} {} {script 1} {write script} {} {write script} {} {}} test chan-io-43.2 {Tcl_FileeventCmd: deleting when many present} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] set result {} } -constraints {stdio unixExecs fileevent} -body { lappend result [chan event $f r] [chan event $f2 r] [chan event $f3 r] chan event $f r "chan read f" chan event $f2 r "chan read f2" chan event $f3 r "chan read f3" lappend result [chan event $f r] [chan event $f2 r] [chan event $f3 r] chan event $f2 r {} lappend result [chan event $f r] [chan event $f2 r] [chan event $f3 r] chan event $f3 r {} lappend result [chan event $f r] [chan event $f2 r] [chan event $f3 r] chan event $f r {} lappend result [chan event $f r] [chan event $f2 r] [chan event $f3 r] } -cleanup { catch {chan close $f2} catch {chan close $f3} } -result {{} {} {} {chan read f} {chan read f2} {chan read f3} {chan read f} {} {chan read f3} {chan read f} {} {} {} {} {}} test chan-io-44.1 {FileEventProc procedure: normal read event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] } -constraints {stdio unixExecs fileevent} -body { chan event $f2 readable [namespace code { set x [chan gets $f2]; chan event $f2 readable {} }] chan puts $f2 text; chan flush $f2 variable x initial vwait [namespace which -variable x] return $x } -cleanup { catch {chan close $f2} catch {chan close $f3} } -result {text} test chan-io-44.2 {FileEventProc procedure: error in read event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -constraints {stdio unixExecs fileevent} -body { chan event $f2 readable {error bogus} chan puts $f2 text; chan flush $f2 variable x initial vwait [namespace which -variable x] list $x [chan event $f2 readable] } -cleanup { interp bgerror {} $handler catch {chan close $f2} catch {chan close $f3} } -result {bogus {}} test chan-io-44.3 {FileEventProc procedure: normal write event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] } -constraints {stdio unixExecs fileevent} -body { chan event $f2 writable [namespace code { lappend x "triggered" incr count -1 if {$count <= 0} { chan event $f2 writable {} } }] variable x initial set count 3 vwait [namespace which -variable x] vwait [namespace which -variable x] vwait [namespace which -variable x] return $x } -cleanup { catch {chan close $f2} catch {chan close $f3} } -result {initial triggered triggered triggered} test chan-io-44.4 {FileEventProc procedure: eror in write event} -setup { set f2 [open "|[list cat -u]" r+] set f3 [open "|[list cat -u]" r+] proc myHandler {msg options} { variable x $msg } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -constraints {stdio unixExecs fileevent} -body { chan event $f2 writable {error bad-write} variable x initial vwait [namespace which -variable x] list $x [chan event $f2 writable] } -cleanup { interp bgerror {} $handler catch {chan close $f2} catch {chan close $f3} } -result {bad-write {}} test chan-io-44.5 {FileEventProc procedure: end of file} -constraints { stdio unixExecs fileevent } -body { set f4 [openpipe r $path(cat) << foo] chan event $f4 readable [namespace code { if {[chan gets $f4 line] < 0} { lappend x eof chan event $f4 readable {} } else { lappend x $line } }] variable x initial vwait [namespace which -variable x] vwait [namespace which -variable x] set x } -cleanup { chan close $f4 } -result {initial foo eof} chan close $f makeFile "foo bar" foo test chan-io-45.1 {DeleteFileEvent, cleanup on chan close} {fileevent} { set f [open $path(foo) r] chan event $f readable [namespace code { lappend x "binding triggered: \"[chan gets $f]\"" chan event $f readable {} }] chan close $f set x initial after 100 [namespace code { set y done }] variable y vwait [namespace which -variable y] set x } {initial} test chan-io-45.2 {DeleteFileEvent, cleanup on chan close} {fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] chan event $f readable [namespace code { lappend x "f triggered: \"[chan gets $f]\"" chan event $f readable {} }] chan event $f2 readable [namespace code { lappend x "f2 triggered: \"[chan gets $f2]\"" chan event $f2 readable {} }] chan close $f variable x initial vwait [namespace which -variable x] chan close $f2 set x } {initial {f2 triggered: "foo bar"}} test chan-io-45.3 {DeleteFileEvent, cleanup on chan close} {fileevent} { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] chan event $f readable {f script} chan event $f2 readable {f2 script} chan event $f3 readable {f3 script} set x {} chan close $f2 lappend x [catch {chan event $f readable} msg] $msg \ [catch {chan event $f2 readable}] \ [catch {chan event $f3 readable} msg] $msg chan close $f3 lappend x [catch {chan event $f readable} msg] $msg \ [catch {chan event $f2 readable}] \ [catch {chan event $f3 readable}] chan close $f lappend x [catch {chan event $f readable}] \ [catch {chan event $f2 readable}] \ [catch {chan event $f3 readable}] } {0 {f script} 1 0 {f3 script} 0 {f script} 1 1 1 1 1} # Execute these tests only if the "testfevent" command is present. test chan-io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileevent notOSX} { testfevent create set script "set f \[[list open $path(foo) r]]\n" append script { set x "no event" chan event $f readable [namespace code { set x "f triggered: [chan gets $f]" chan event $f readable {} }] } set timer [after 10 lappend x timeout] testfevent cmd $script vwait x after cancel $timer testfevent cmd {chan close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} test chan-io-46.2 {Tcl event loop vs multiple interpreters} testfevent { testfevent create testfevent cmd { variable x 0 after 100 {set x triggered} vwait [namespace which -variable x] set x } } {triggered} test chan-io-46.3 {Tcl event loop vs multiple interpreters} testfevent { testfevent create testfevent cmd { set x 0 after 10 {lappend x timer} after 30 set result $x update idletasks lappend result $x update lappend result $x } } {0 0 {0 timer}} test chan-io-47.1 {chan event vs multiple interpreters} -setup { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] set x {} } -constraints {testfevent fileevent} -body { chan event $f readable {script 1} testfevent create testfevent share $f2 testfevent cmd "chan event $f2 readable {script 2}" chan event $f3 readable {sript 3} lappend x [chan event $f2 readable] testfevent delete lappend x [chan event $f readable] [chan event $f2 readable] \ [chan event $f3 readable] } -cleanup { chan close $f chan close $f2 chan close $f3 } -result {{} {script 1} {} {sript 3}} test chan-io-47.2 {deleting chan event on interpreter delete} -setup { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] set f4 [open $path(foo) r] } -constraints {testfevent fileevent} -body { chan event $f readable {script 1} testfevent create testfevent share $f2 testfevent share $f3 testfevent cmd "chan event $f2 readable {script 2} chan event $f3 readable {script 3}" chan event $f4 readable {script 4} testfevent delete list [chan event $f readable] [chan event $f2 readable] \ [chan event $f3 readable] [chan event $f4 readable] } -cleanup { chan close $f chan close $f2 chan close $f3 chan close $f4 } -result {{script 1} {} {} {script 4}} test chan-io-47.3 {deleting chan event on interpreter delete} -setup { set f [open $path(foo) r] set f2 [open $path(foo) r] set f3 [open $path(foo) r] set f4 [open $path(foo) r] } -constraints {testfevent fileevent} -body { testfevent create testfevent share $f3 testfevent share $f4 chan event $f readable {script 1} chan event $f2 readable {script 2} testfevent cmd "chan event $f3 readable {script 3} chan event $f4 readable {script 4}" testfevent delete list [chan event $f readable] [chan event $f2 readable] \ [chan event $f3 readable] [chan event $f4 readable] } -cleanup { chan close $f chan close $f2 chan close $f3 chan close $f4 } -result {{script 1} {script 2} {} {}} test chan-io-47.4 {file events on shared files and multiple interpreters} -setup { set f [open $path(foo) r] set f2 [open $path(foo) r] } -constraints {testfevent fileevent} -body { testfevent create testfevent share $f testfevent cmd "chan event $f readable {script 1}" chan event $f readable {script 2} chan event $f2 readable {script 3} list [chan event $f2 readable] [testfevent cmd "chan event $f readable"] \ [chan event $f readable] } -cleanup { testfevent delete chan close $f chan close $f2 } -result {{script 3} {script 1} {script 2}} test chan-io-47.5 {file events on shared files, deleting file events} -setup { set f [open $path(foo) r] } -body { testfevent create testfevent share $f testfevent cmd "chan event $f readable {script 1}" chan event $f readable {script 2} testfevent cmd "chan event $f readable {}" list [testfevent cmd "chan event $f readable"] [chan event $f readable] } -constraints {testfevent fileevent} -cleanup { testfevent delete chan close $f } -result {{} {script 2}} test chan-io-47.6 {file events on shared files, deleting file events} -setup { set f [open $path(foo) r] } -body { testfevent create testfevent share $f testfevent cmd "chan event $f readable {script 1}" chan event $f readable {script 2} chan event $f readable {} list [testfevent cmd "chan event $f readable"] [chan event $f readable] } -constraints {testfevent fileevent} -cleanup { testfevent delete chan close $f } -result {{script 1} {}} unset path(foo) removeFile foo set path(bar) [makeFile {} bar] test chan-io-48.1 {testing readability conditions} {fileevent} { set f [open $path(bar) w] chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan close $f set f [open $path(bar) r] chan event $f readable [namespace code { lappend l called if {[chan eof $f]} { chan close $f set x done } else { chan gets $f } }] set l "" variable x not_done vwait [namespace which -variable x] list $x $l } {done {called called called called called called called}} test chan-io-48.2 {testing readability conditions} {nonBlockFiles fileevent} { set f [open $path(bar) w] chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan close $f set f [open $path(bar) r] chan event $f readable [namespace code { lappend l called if {[chan eof $f]} { chan close $f set x done } else { chan gets $f } }] chan configure $f -blocking off set l "" variable x not_done vwait [namespace which -variable x] list $x $l } {done {called called called called called called called}} set path(my_script) [makeFile {} my_script] test chan-io-48.3 {testing readability conditions} -setup { set l "" } -constraints {stdio unix nonBlockFiles fileevent} -body { set f [open $path(bar) w] chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan puts $f abcdefg chan close $f set f [open $path(my_script) w] chan puts $f { proc copy_slowly {f} { while {![chan eof $f]} { chan puts [chan gets $f] after 200 } chan close $f } } chan close $f set f [openpipe] chan event $f readable [namespace code { if {[chan eof $f]} { set x done } else { chan gets $f lappend l [chan blocked $f] chan gets $f lappend l [chan blocked $f] } }] chan configure $f -buffering line chan configure $f -blocking off variable x not_done chan puts $f [list source $path(my_script)] chan puts $f "set f \[[list open $path(bar) r]]" chan puts $f {copy_slowly $f} chan puts $f {exit} vwait [namespace which -variable x] list $x $l } -cleanup { chan close $f } -result {done {0 1 0 1 0 1 0 1 0 1 0 1 0 0}} unset path(bar) removeFile bar test chan-io-48.4 {lf write, testing readability, ^Z termination, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.5 {lf write, testing readability, ^Z in middle, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.6 {cr write, testing readability, ^Z termination, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.7 {cr write, testing readability, ^Z in middle, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.8 {crlf write, testing readability, ^Z termination, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.9 {crlf write, testing readability, ^Z in middle, auto read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation auto -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.10 {lf write, testing readability, ^Z in middle, lf read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.11 {lf write, testing readability, ^Z termination, lf read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation lf -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.12 {cr write, testing readability, ^Z in middle, cr read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.13 {cr write, testing readability, ^Z termination, cr read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation cr chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation cr -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.14 {crlf write, testing readability, ^Z in middle, crlf read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts -nonewline $f [format "abc\ndef\n%cfoo\nbar\n" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-48.15 {crlf write, testing readability, ^Z termi, crlf read mode} -setup { file delete $path(test1) set c 0 set l "" } -constraints {fileevent} -body { set f [open $path(test1) w] chan configure $f -translation crlf chan puts -nonewline $f [format "abc\ndef\n%c" 26] chan close $f set f [open $path(test1) r] chan configure $f -translation crlf -eofchar \x1A chan event $f readable [namespace code { if {[chan eof $f]} { set x done chan close $f } else { lappend l [chan gets $f] incr c } }] variable x vwait [namespace which -variable x] list $c $l } -result {3 {abc def {}}} test chan-io-49.1 {testing crlf reading, leftover cr disgorgment} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\rb\rc\r\n" chan close $f set f [open $path(test1) r] lappend l [file size $path(test1)] chan configure $f -translation crlf lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan read $f 1] lappend l [chan tell $f] lappend l [chan eof $f] lappend l [chan read $f 1] lappend l [chan eof $f] } -cleanup { chan close $f } -result "7 a 1 [list \r] 2 b 3 [list \r] 4 c 5 { } 7 0 {} 1" test chan-io-49.2 {testing crlf reading, leftover cr disgorgment} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\rb\rc\r\n" chan close $f set f [open $path(test1) r] lappend l [file size $path(test1)] chan configure $f -translation crlf lappend l [chan read $f 2] lappend l [chan tell $f] lappend l [chan read $f 2] lappend l [chan tell $f] lappend l [chan read $f 2] lappend l [chan tell $f] lappend l [chan eof $f] lappend l [chan read $f 2] lappend l [chan tell $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "7 [list a\r] 2 [list b\r] 4 [list c\n] 7 0 {} 7 1" test chan-io-49.3 {testing crlf reading, leftover cr disgorgment} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\rb\rc\r\n" chan close $f set f [open $path(test1) r] lappend l [file size $path(test1)] chan configure $f -translation crlf lappend l [chan read $f 3] lappend l [chan tell $f] lappend l [chan read $f 3] lappend l [chan tell $f] lappend l [chan eof $f] lappend l [chan read $f 3] lappend l [chan tell $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "7 [list a\rb] 3 [list \rc\n] 7 0 {} 7 1" test chan-io-49.4 {testing crlf reading, leftover cr disgorgment} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\rb\rc\r\n" chan close $f set f [open $path(test1) r] lappend l [file size $path(test1)] chan configure $f -translation crlf lappend l [chan read $f 3] lappend l [chan tell $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan eof $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result "7 [list a\rb] 3 [list \rc] 7 0 {} 7 1" test chan-io-49.5 {testing crlf reading, leftover cr disgorgment} -setup { file delete $path(test1) set l "" } -body { set f [open $path(test1) w] chan configure $f -translation lf chan puts -nonewline $f "a\rb\rc\r\n" chan close $f set f [open $path(test1) r] lappend l [file size $path(test1)] chan configure $f -translation crlf lappend l [set x [chan gets $f]] lappend l [chan tell $f] lappend l [chan gets $f] lappend l [chan tell $f] lappend l [chan eof $f] } -cleanup { chan close $f } -result [list 7 a\rb\rc 7 {} 7 1] test chan-io-50.1 {testing handler deletion} -setup { file delete $path(test1) } -constraints testchannelevent -body { set f [open $path(test1) w] chan close $f set f [open $path(test1) r] variable z not_called set timer [after 50 lappend z timeout] testservicemode 0 testchannelevent $f add readable [namespace code { variable z called testchannelevent $f delete 0 }] testservicemode 1 vwait z after cancel $timer set z } -cleanup { chan close $f } -result called test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] set z "" } -constraints {testchannelevent testservicemode} -body { proc delhandler {f i} { variable z lappend z "called delhandler $f $i" testchannelevent $f delete 0 } set z "" set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 vwait z after cancel $timer string equal $z \ [list [list called delhandler $f 0] [list called delhandler $f 1]] } -cleanup { chan close $f } -result 1 test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] } -constraints {testchannelevent testservicemode} -body { proc notcalled {f i} { variable z lappend z "notcalled was called!! $f $i" } proc delhandler {f i} { variable z testchannelevent $f delete 1 lappend z "delhandler $f $i called" testchannelevent $f delete 0 lappend z "delhandler $f $i deleted myself" } set z "" set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 vwait z after cancel $timer string equal $z \ [list [list delhandler $f 0 called] \ [list delhandler $f 0 deleted myself]] } -cleanup { chan close $f } -result 1 test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f } -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code { if {$u eq "recursive"} { testchannelevent $f delete 0 lappend z "delrecursive deleting recursive" } else { lappend z "delrecursive calling recursive" set u recursive update } }] variable u toplevel variable z "" set timer [after 50 lappend z timeout] vwait z after cancel $timer set z } -cleanup { chan close $f update } -result {{delrecursive calling recursive} {delrecursive deleting recursive}} test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f update } -constraints {testchannelevent testservicemode notOSX} -body { proc notcalled {f} { variable z lappend z "notcalled was called!! $f" } proc del {f} { variable u variable z if {$u eq "recursive"} { testchannelevent $f delete 1 testchannelevent $f delete 0 lappend z "del deleted notcalled" lappend z "del deleted myself" } else { set u recursive lappend z "del calling recursive" set timer [after 50 lappend z timeout] set mode [testservicemode 1] vwait z after cancel $timer testservicemode $mode lappend z "del after update" } } set z "" set u toplevel set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f]] testchannelevent $f add readable [namespace code [list del $f]] testservicemode 1 vwait z after cancel $timer set z } -cleanup { chan close $f update } -result [list {del calling recursive} {del deleted notcalled} \ {del deleted myself} {del after update}] test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f } -constraints {testchannelevent testservicemode} -body { proc first {f} { variable u variable z if {$u eq "toplevel"} { lappend z "first called" set mode [testservicemode 1] set timer [after 50 lappend z timeout] set u first vwait z after cancel $timer testservicemode $mode lappend z "first after update" } else { lappend z "first called not toplevel" } } proc second {f} { variable u variable z if {$u eq "first"} { lappend z "second called, first time" set u second testchannelevent $f delete 0 } elseif {$u eq "second"} { lappend z "second called, second time" testchannelevent $f delete 0 } else { lappend z "second called, cannot happen!" testchannelevent $f removeall } } set z "" set u toplevel set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list second $f]] testchannelevent $f add readable [namespace code [list first $f]] testservicemode 1 vwait z after cancel $timer set z } -cleanup { chan close $f } -result [list {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ {first after update}] test chan-io-51.1 {Test old socket deletion on Macintosh} -setup { set x 0 set result "" variable wait "" } -constraints {socket} -body { proc accept {s a p} { variable x chan configure $s -blocking off chan puts $s "sock[incr x]" chan close $s variable wait done } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set port [lindex [chan configure $ss -sockname] 2] set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [chan gets $cs] chan close $cs set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [chan gets $cs] chan close $cs set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [chan gets $cs] chan close $cs set cs [socket 127.0.0.1 $port] vwait [namespace which -variable wait] lappend result [chan gets $cs] } -cleanup { chan close $cs chan close $ss } -result {sock1 sock2 sock3 sock4} test chan-io-52.1 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan copy $f1 $f2 -command " # " chan copy $f1 $f2 } -returnCodes error -cleanup { chan close $f1 chan close $f2 } -match glob -result {channel "*" is busy} test chan-io-52.2 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] set f3 [open $thisScript] chan copy $f1 $f2 -command " # " chan copy $f3 $f2 } -returnCodes error -cleanup { chan close $f1 chan close $f2 chan close $f3 } -match glob -result {channel "*" is busy} test chan-io-52.3 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation lf -encoding iso8859-1 -blocking 0 chan configure $f2 -translation cr -encoding iso8859-1 -blocking 0 set s0 [chan copy $f1 $f2] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {($s1 == $s2) && ($s0 == $s1)} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.4 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation lf -blocking 0 chan configure $f2 -translation cr -blocking 0 chan copy $f1 $f2 -size 40 set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 lappend result [file size $path(test1)] } -result {0 0 40} test chan-io-52.5 {TclCopyChannel, all} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size -1 ;# -1 means 'copy all', same as if no -size specified. set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.5a {TclCopyChannel, all, other negative value} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size -2 ;# < 0 behaves like -1, copy all set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.5b {TclCopyChannel, all, wrap to negative value} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 -size 3221176172 ;# Wrapped to < 0, behaves like -1, copy all set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.6 {TclCopyChannel} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 set s0 [chan copy $f1 $f2 -size [expr {[file size $thisScript] + 5}]] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {($s1 == $s2) && ($s0 == $s1)} { lappend result ok } return $result } -result {0 0 ok} test chan-io-52.7 {TclCopyChannel} -constraints {fcopy} -setup { file delete $path(test1) } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation binary -blocking 0 chan configure $f2 -translation binary -blocking 0 chan copy $f1 $f2 set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] if {[file size $thisScript] == [file size $path(test1)]} { lappend result ok } return $result } -cleanup { chan close $f1 chan close $f2 } -result {0 0 ok} test chan-io-52.8 {TclCopyChannel} -setup { file delete $path(test1) file delete $path(pipe) } -constraints {stdio fcopy} -body { set f1 [open $path(pipe) w] chan configure $f1 -translation lf chan puts $f1 " chan puts ready chan gets stdin set f1 \[open [list $thisScript] r\] chan configure \$f1 -translation lf chan puts \[chan read \$f1 100\] chan close \$f1 " chan close $f1 set f1 [openpipe r+ $path(pipe)] chan configure $f1 -translation lf chan gets $f1 chan puts $f1 ready chan flush $f1 set f2 [open $path(test1) w] chan configure $f2 -translation lf set s0 [chan copy $f1 $f2 -size 40] catch {chan close $f1} chan close $f2 list $s0 [file size $path(test1)] } -result {40 40} # Empty files, to register them with the test facility set path(kyrillic.txt) [makeFile {} kyrillic.txt] set path(utf8-fcopy.txt) [makeFile {} utf8-fcopy.txt] set path(utf8-rp.txt) [makeFile {} utf8-rp.txt] # Create kyrillic file, use lf translation to avoid os eol issues set out [open $path(kyrillic.txt) w] chan configure $out -encoding koi8-r -translation lf chan puts $out АА chan close $out test chan-io-52.9 {TclCopyChannel & encodings} {fcopy} { # Copy kyrillic to UTF-8, using chan copy. set in [open $path(kyrillic.txt) r] set out [open $path(utf8-fcopy.txt) w] chan configure $in -encoding koi8-r -translation lf chan configure $out -encoding utf-8 -translation lf chan copy $in $out chan close $in chan close $out # Do the same again, but differently (read/chan puts). set in [open $path(kyrillic.txt) r] set out [open $path(utf8-rp.txt) w] chan configure $in -encoding koi8-r -translation lf chan configure $out -encoding utf-8 -translation lf chan puts -nonewline $out [chan read $in] chan close $in chan close $out list [file size $path(kyrillic.txt)] \ [file size $path(utf8-fcopy.txt)] \ [file size $path(utf8-rp.txt)] } {3 5 5} test chan-io-52.10 {TclCopyChannel & encodings} -constraints {fcopy} -body { set in [open $path(kyrillic.txt) r] set out [open $path(utf8-fcopy.txt) w] chan configure $in -encoding koi8-r -translation lf chan configure $out -translation binary chan copy $in $out file size $path(utf8-fcopy.txt) } -cleanup { chan close $in chan close $out unset in out } -returnCodes 1 -match glob -result {error writing "*":\ invalid or incomplete multibyte or wide character} test chan-io-52.11 {TclCopyChannel & encodings} -setup { set f [open $path(utf8-fcopy.txt) w] fconfigure $f -encoding utf-8 -translation lf puts $f АА close $f } -constraints {fcopy} -body { set in [open $path(utf8-fcopy.txt) r] set out [open $path(kyrillic.txt) w] chan configure $in -translation binary chan configure $out -encoding koi8-r -translation lf -profile strict catch {chan copy $in $out} cres copts return $cres } -cleanup { if {$in in [chan names]} { close $in } if {$out in [chan names]} { close $out } catch {unset cres} } -match glob -result {error writing "*": invalid or incomplete\ multibyte or wide character} test chan-io-53.1 {CopyData} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation lf -blocking 0 chan configure $f2 -translation cr -blocking 0 chan copy $f1 $f2 -size 0 set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 chan close $f2 lappend result [file size $path(test1)] } -result {0 0 0} test chan-io-53.2 {CopyData} -setup { file delete $path(test1) } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] chan configure $f1 -translation lf -encoding iso8859-1 -blocking 0 chan configure $f2 -translation cr -encoding iso8859-1 -blocking 0 chan copy $f1 $f2 -command [namespace code {set s0}] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] variable s0 vwait [namespace which -variable s0] chan close $f1 chan close $f2 set s1 [file size $thisScript] set s2 [file size $path(test1)] if {($s1 == $s2) && ($s0 == $s1)} { lappend result ok } return $result } -result {0 0 ok} test chan-io-53.3 {CopyData: background read underflow} -setup { file delete $path(test1) file delete $path(pipe) } -constraints {stdio unix fcopy} -body { set f1 [open $path(pipe) w] chan puts -nonewline $f1 { chan puts ready chan flush stdout ;# Don't assume line buffered! chan copy stdin stdout -command { set x } vwait x set f [} chan puts $f1 [list open $path(test1) w]] chan puts $f1 { chan configure $f -translation lf chan puts $f "done" chan close $f } chan close $f1 set f1 [openpipe r+ $path(pipe)] set result [chan gets $f1] chan puts $f1 line1 chan flush $f1 lappend result [chan gets $f1] chan puts $f1 line2 chan flush $f1 lappend result [chan gets $f1] chan close $f1 after 500 set f [open $path(test1)] lappend result [chan read $f] } -cleanup { chan close $f } -result "ready line1 line2 {done\n}" test chan-io-53.4 {CopyData: background write overflow} -setup { set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n variable x for {set x 0} {$x < 12} {incr x} { append big $big } file delete $path(test1) file delete $path(pipe) } -constraints {stdio unix fileevent fcopy} -body { set f1 [open $path(pipe) w] chan puts $f1 { chan puts ready chan copy stdin stdout -command { set x } vwait x set f [open $path(test1) w] chan configure $f -translation lf chan puts $f "done" chan close $f } chan close $f1 set f1 [openpipe r+ $path(pipe)] set result [chan gets $f1] chan configure $f1 -blocking 0 chan puts $f1 $big chan flush $f1 after 500 set result "" chan event $f1 read [namespace code { append result [chan read $f1 1024] if {[string length $result] >= [string length $big]} { set x done } }] vwait [namespace which -variable x] return $x } -cleanup { set big {} chan close $f1 } -result done set result {} proc FcopyTestAccept {sock args} { after 1000 "chan close $sock" } proc FcopyTestDone {bytes {error {}}} { variable fcopyTestDone if {[string length $error]} { set fcopyTestDone 1 } else { set fcopyTestDone 0 } } test chan-io-53.5 {CopyData: error during chan copy} {socket fcopy} { variable fcopyTestDone set listen [socket -server [namespace code FcopyTestAccept] -myaddr 127.0.0.1 0] set in [open $thisScript] ;# 126 K set out [socket 127.0.0.1 [lindex [chan configure $listen -sockname] 2]] catch {unset fcopyTestDone} chan close $listen ;# This means the socket open never really succeeds chan copy $in $out -command [namespace code FcopyTestDone] variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] ;# The error occurs here in the b.g. } chan close $in chan close $out set fcopyTestDone ;# 1 for error condition } 1 test chan-io-53.6 {CopyData: error during chan copy} -setup { variable fcopyTestDone file delete $path(pipe) file delete $path(test1) catch {unset fcopyTestDone} } -constraints {stdio fcopy} -body { set f1 [open $path(pipe) w] chan puts $f1 "exit 1" chan close $f1 set in [openpipe r+ $path(pipe)] set out [open $path(test1) w] chan copy $in $out -command [namespace code FcopyTestDone] variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] } return $fcopyTestDone ;# 0 for plain end of file } -cleanup { catch {chan close $in} chan close $out } -result 0 proc doFcopy {in out {bytes 0} {error {}}} { variable fcopyTestDone variable fcopyTestCount incr fcopyTestCount $bytes if {[string length $error]} { set fcopyTestDone 1 } elseif {[chan eof $in]} { set fcopyTestDone 0 } else { # Delay next chan copy to wait for size>0 input bytes after 100 [list chan copy $in $out -size 1000 \ -command [namespace code [list doFcopy $in $out]]] } } test chan-io-53.7 {CopyData: Flooding chan copy from pipe} -setup { variable fcopyTestDone file delete $path(pipe) catch {unset fcopyTestDone} } -constraints {stdio fcopy} -body { set fcopyTestCount 0 set f1 [open $path(pipe) w] chan puts $f1 { # Write 10 bytes / 10 msec proc Write {count} { chan puts -nonewline "1234567890" if {[incr count -1]} { after 10 [list Write $count] } else { set ::ready 1 } } chan configure stdout -buffering none Write 345 ;# 3450 bytes ~3.45 sec vwait ready exit 0 } chan close $f1 set in [openpipe r+ $path(pipe) &] set out [open $path(test1) w] doFcopy $in $out variable fcopyTestDone if {![info exists fcopyTestDone]} { vwait [namespace which -variable fcopyTestDone] } # -1=error 0=script error N=number of bytes expr {($fcopyTestDone == 0) ? $fcopyTestCount : -1} } -cleanup { catch {chan close $in} chan close $out } -result {3450} test chan-io-53.8 {CopyData: async callback and error handling, Bug 1932639} -setup { # copy progress callback. errors out intentionally proc cmd args { lappend ::RES "CMD $args" error !STOP } # capture callback error here proc ::bgerror args { lappend ::RES "bgerror/OK $args" set ::forever has-been-reached return } # Files we use for our channels set foo [makeFile ashgdfashdgfasdhgfasdhgf foo] set bar [makeFile {} bar] # Channels to copy between set f [open $foo r] ; fconfigure $f -translation binary set g [open $bar w] ; fconfigure $g -translation binary -buffering none } -constraints {stdio fcopy} -body { # Record input size, so that result is always defined lappend ::RES [file size $bar] # Run the copy. Should not invoke -command now. chan copy $f $g -size 2 -command [namespace code cmd] # Check that -command was not called synchronously set sbs [file size $bar] lappend ::RES [expr {($sbs > 0) ? "sync/FAIL" : "sync/OK"}] $sbs # Now let the async part happen. Should capture the error in cmd via # bgerror. If not break the event loop via timer. set token [after 1000 { lappend ::RES {bgerror/FAIL timeout} set ::forever has-been-reached }] vwait ::forever catch {after cancel $token} # Report set ::RES } -cleanup { chan close $f chan close $g catch {unset ::RES} catch {unset ::forever} rename ::bgerror {} removeFile foo removeFile bar } -result {0 sync/OK 0 {CMD 2} {bgerror/OK !STOP}} test chan-io-53.8a {CopyData: async callback and error handling, Bug 1932639, at eof} -setup { # copy progress callback. proc cmd args { lappend ::RES "CMD $args" set ::forever has-been-reached return } # Files we use for our channels set foo [makeFile ashgdfashdgfasdhgfasdhgf foo] set bar [makeFile {} bar] # Channels to copy between set f [open $foo r] ; chan configure $f -translation binary set g [open $bar w] ; chan configure $g -translation binary -buffering none } -constraints {stdio fcopy} -body { # Initialize and force eof on the input. chan seek $f 0 end ; chan read $f 1 set ::RES [chan eof $f] # Run the copy. Should not invoke -command now. chan copy $f $g -size 2 -command [namespace code cmd] # Check that -command was not called synchronously lappend ::RES [expr {([llength $::RES] > 1) ? "sync/FAIL" : "sync/OK"}] # Now let the async part happen. Should capture the eof in cmd # If not break the event loop via timer. set token [after 1000 { lappend ::RES {cmd/FAIL timeout} set ::forever has-been-reached }] vwait ::forever catch {after cancel $token} # Report return $::RES } -cleanup { chan close $f chan close $g catch {unset ::RES} catch {unset ::forever} removeFile foo removeFile bar } -result {1 sync/OK {CMD 0}} test chan-io-53.9 {CopyData: -size and event interaction, Bug 780533} -setup { set out [makeFile {} out] set err [makeFile {} err] set pipe [open "|[list [info nameofexecutable] 2> $err]" r+] chan configure $pipe -translation binary -buffering line chan puts $pipe { chan configure stdout -translation binary -buffering line chan puts stderr Waiting... after 1000 foreach x {a b c} { chan puts stderr Looping... chan puts $x after 500 } proc bye args { if {[chan gets stdin line]<0} { chan puts stderr "CHILD: EOF detected, exiting" exit } else { chan puts stderr "CHILD: ignoring line: $line" } } chan puts stderr Now-sleeping-forever chan event stdin readable bye vwait forever } proc ::done args { set ::forever OK return } set ::forever {} set out [open $out w] } -constraints {stdio fcopy} -body { chan copy $pipe $out -size 6 -command ::done set token [after 5000 { set ::forever {fcopy hangs} }] vwait ::forever catch {after cancel $token} set ::forever } -cleanup { chan close $pipe rename ::done {} if {[testConstraint win]} { after 1000; # Allow Windows time to figure out that the # process is gone } catch {close $out} catch {removeFile out} catch {removeFile err} catch {unset ::forever} } -result OK test chan-io-53.10 {Bug 1350564, multi-directional fcopy} -setup { set err [makeFile {} err] set pipe [open "|[list [info nameofexecutable] 2> $err]" r+] chan configure $pipe -translation binary -buffering line chan puts $pipe { chan configure stderr -buffering line # Kill server when pipe closed by invoker. proc bye args { if {![chan eof stdin]} { chan gets stdin ; return } chan puts stderr BYE exit } # Server code. Bi-directional copy between 2 sockets. proc geof {sok} { chan puts stderr DONE/$sok chan close $sok } proc new {sok args} { chan puts stderr NEW/$sok global l srv chan configure $sok -translation binary -buffering none lappend l $sok if {[llength $l] == 2} { chan close $srv foreach {a b} $l break chan copy $a $b -command [list geof $a] chan copy $b $a -command [list geof $b] chan puts stderr 2COPY } chan puts stderr ... } chan puts stderr SRV set l {} set srv [socket -server new -myaddr 127.0.0.1 0] set port [lindex [chan configure $srv -sockname] 2] chan puts stderr WAITING chan event stdin readable bye puts "OK $port" vwait forever } # wait for OK from server. lassign [chan gets $pipe] ok port # Now the two clients. proc done {sock} { if {[chan eof $sock]} { chan close $sock ; return } lappend ::forever [chan gets $sock] return } set a [socket 127.0.0.1 $port] set b [socket 127.0.0.1 $port] chan configure $a -translation binary -buffering none chan configure $b -translation binary -buffering none chan event $a readable [namespace code "done $a"] chan event $b readable [namespace code "done $b"] } -constraints {stdio fcopy} -body { # Now pass data through the server in both directions. set ::forever {} chan puts $a AB vwait ::forever chan puts $b BA vwait ::forever set ::forever } -cleanup { catch {chan close $a} catch {chan close $b} chan close $pipe if {[testConstraint win]} { after 1000 ;# Give Windows time to kill the process } removeFile err catch {unset ::forever} } -result {AB BA} test chan-io-54.1 {Recursive channel events} {socket fileevent} { # This test checks to see if file events are delivered during recursive # event loops when there is buffered data on the channel. proc accept {s a p} { variable as chan configure $s -translation lf chan puts $s "line 1\nline2\nline3" chan flush $s set as $s } proc readit {s next} { variable x variable result lappend result $next if {$next == 1} { chan event $s readable [namespace code [list readit $s 2]] vwait [namespace which -variable x] } incr x } set ss [socket -server [namespace code accept] -myaddr 127.0.0.1 0] # We need to delay on some systems until the creation of the server socket # completes. set done 0 for {set i 0} {$i < 10} {incr i} { if {![catch { set cs [socket 127.0.0.1 [lindex [chan configure $ss -sockname] 2]] }]} { set done 1 break } after 100 } if {$done == 0} { chan close $ss error "failed to connect to server" } variable result {} variable x 0 variable as vwait [namespace which -variable as] chan configure $cs -translation lf lappend result [chan gets $cs] chan configure $cs -blocking off chan event $cs readable [namespace code [list readit $cs 1]] set a [after 2000 [namespace code { set x failure }]] vwait [namespace which -variable x] after cancel $a chan close $as chan close $ss chan close $cs list $result $x } {{{line 1} 1 2} 2} test chan-io-54.2 {Testing for busy-wait in recursive channel events} -setup { set accept {} set after {} variable done 0 } -constraints {socket fileevent} -body { variable s [socket -server [namespace code accept] -myaddr 127.0.0.1 0] proc accept {s a p} { variable counter 0 variable accept $s chan configure $s -blocking off -buffering line -translation lf chan event $s readable [namespace code "doit $s"] } proc doit {s} { variable counter variable after incr counter if {[chan gets $s] eq ""} { chan event $s readable [namespace code "doit1 $s"] set after [after 1000 [namespace code { chan puts $writer hello chan flush $writer set done 1 }]] } } proc doit1 {s} { variable counter variable accept incr counter chan gets $s chan close $s set accept {} } proc producer {} { variable s variable writer set writer [socket 127.0.0.1 [lindex [chan configure $s -sockname] 2]] chan configure $writer -buffering line chan puts -nonewline $writer hello chan flush $writer } producer vwait [namespace which -variable done] chan close $writer chan close $s after cancel $after set counter } -cleanup { if {$accept ne {}} {chan close $accept} } -result 1 set path(fooBar) [makeFile {} fooBar] test chan-io-55.1 {ChannelEventScriptInvoker: deletion} -constraints { fileevent } -setup { variable x proc eventScript {fd} { variable x chan close $fd error "planned error" set x whoops } proc myHandler args { variable x got_error } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] } -body { set f [open $path(fooBar) w] chan event $f writable [namespace code [list eventScript $f]] variable x not_done vwait [namespace which -variable x] set x } -cleanup { interp bgerror {} $handler } -result {got_error} test chan-io-56.1 {ChannelTimerProc} {testchannelevent} { set f [open $path(fooBar) w] chan puts $f "this is a test" chan close $f set f [open $path(fooBar) r] testchannelevent $f add readable [namespace code { chan read $f 1 incr x }] variable x 0 vwait [namespace which -variable x] vwait [namespace which -variable x] set result $x testchannelevent $f set 0 none after idle [namespace code {set y done}] variable y vwait [namespace which -variable y] chan close $f lappend result $y } {2 done} test chan-io-57.1 {buffered data and file events, gets} -setup { variable s2 } -constraints {fileevent} -body { proc accept {sock args} { variable s2 set s2 $sock } set server [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set s [socket 127.0.0.1 [lindex [chan configure $server -sockname] 2]] vwait [namespace which -variable s2] update chan event $s2 readable [namespace code {lappend result readable}] chan puts $s "12\n34567890" chan flush $s variable result [chan gets $s2] after 1000 [namespace code {lappend result timer}] vwait [namespace which -variable result] lappend result [chan gets $s2] vwait [namespace which -variable result] set result } -cleanup { chan close $s chan close $s2 chan close $server } -result {12 readable 34567890 timer} test chan-io-57.2 {buffered data and file events, read} -setup { variable s2 } -constraints {fileevent} -body { proc accept {sock args} { variable s2 set s2 $sock } set server [socket -server [namespace code accept] -myaddr 127.0.0.1 0] set s [socket 127.0.0.1 [lindex [chan configure $server -sockname] 2]] vwait [namespace which -variable s2] update chan event $s2 readable [namespace code {lappend result readable}] chan puts -nonewline $s "1234567890" chan flush $s variable result [chan read $s2 1] after 1000 [namespace code {lappend result timer}] vwait [namespace which -variable result] lappend result [chan read $s2 9] vwait [namespace which -variable result] set result } -cleanup { chan close $s chan close $s2 chan close $server } -result {1 readable 234567890 timer} test chan-io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin fileevent} { set out [open $path(script) w] chan puts $out { chan puts "normal message from pipe" chan puts stderr "error message from pipe" exit 1 } proc readit {pipe} { variable x variable result if {[chan eof $pipe]} { set x [catch {chan close $pipe} line] lappend result catch $line } else { chan gets $pipe line lappend result chan gets $line } } chan close $out set pipe [openpipe r $path(script)] chan event $pipe readable [namespace code [list readit $pipe]] variable x "" set result "" vwait [namespace which -variable x] list $x $result } {1 {chan gets {normal message from pipe} chan gets {} catch {error message from pipe}}} test chan-io-59.1 {Thread reference of channels} {testmainthread testchannel} { # TIP #10 # More complicated tests (like that the reference changes as a channel is # moved from thread to thread) can be done only in the extension which # fully implements the moving of channels between threads, i.e. 'Threads'. set f [open $path(longfile) r] set result [testchannel mthread $f] chan close $f string equal $result [testmainthread] } {1} test chan-io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # This test will hang in older revisions of the core. set out [open $path(script) w] chan puts $out "catch {load $::tcltestlib Tcltest}" chan puts $out { chan puts [testbytestring \xE2] exit 1 } proc readit {pipe} { variable x variable result if {[chan eof $pipe]} { set x [catch {chan close $pipe} line] lappend result catch $line } else { chan gets $pipe line lappend result gets $line } } chan close $out set pipe [openpipe r $path(script)] chan event $pipe readable [namespace code [list readit $pipe]] variable x "" set result "" vwait [namespace which -variable x] # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result } {1 {gets {} catch {error writing "stdout": invalid or incomplete multibyte or wide character}}} test chan-io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] set f [open $datafile w] chan configure $f -translation binary chan puts -nonewline $f [string repeat "Ho hum\n" 11] chan puts $f = set line [string repeat "Ge gla " 4] chan puts -nonewline $f [string repeat [string trimright $line]\n 834] chan close $f } -body { set f [open $datafile r] chan configure $f -eofchar = set res {} lappend res [chan read $f; chan tell $f] chan configure $f -eofchar {} lappend res [chan read $f 1] lappend res [chan read $f; chan tell $f] # Any seek zaps the internals into a good state. #chan seek $f 0 start #chan seek $f 0 current #lappend res [chan read $f; chan tell $f] } -cleanup { chan close $f removeFile eofchar } -result {77 = 23431} # Test the cutting and splicing of channels, this is incidentally the # attach/detach facility of package Thread, but __without any safeguards__. It # can also be used to emulate transfer of channels between threads, and is # used for that here. test chan-io-70.0 {Cutting & Splicing channels} -setup { set f [makeFile {... dummy ...} cutsplice] set res {} } -constraints {testchannel} -body { set c [open $f r] lappend res [catch {chan seek $c 0 start}] testchannel cut $c lappend res [catch {chan seek $c 0 start}] testchannel splice $c lappend res [catch {chan seek $c 0 start}] } -cleanup { chan close $c removeFile cutsplice } -result {0 1 0} test chan-io-70.1 {Transfer channel} -setup { set f [makeFile {... dummy ...} cutsplice] set res {} } -constraints {testchannel thread} -body { set c [open $f r] lappend res [catch {chan seek $c 0 start}] testchannel cut $c lappend res [catch {chan seek $c 0 start}] set tid [thread::create -preserved] thread::send $tid [list set c $c] thread::send $tid {load {} Tcltest} lappend res [thread::send $tid { testchannel splice $c set res [catch {chan seek $c 0 start}] chan close $c set res }] } -cleanup { thread::release $tid removeFile cutsplice } -result {0 1 0} # ### ### ### ######### ######### ######### foreach {n msg expected} { 0 {} {} 1 {{message only}} {{message only}} 2 {-options x} {-options x} 3 {-options {x y} {the message}} {-options {x y} {the message}} 4 {-code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 5 {-code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 6 {-code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 7 {-code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 8 {-code error -level 0 -f ba snarf} {-code error -level 0 -f ba snarf} 9 {-code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 10 {-code error -level 5 -f ba snarf} {-code error -level 0 -f ba snarf} 11 {-code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 12 {-code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 13 {-code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 14 {-code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} 15 {-code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 16 {-code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} 17 {-code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 18 {-code error -level 0 -f ba} {-code error -level 0 -f ba} 19 {-code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 20 {-code error -level 5 -f ba} {-code error -level 0 -f ba} 21 {-code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 22 {-code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 23 {-code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 24 {-code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 25 {-code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 26 {-code error -level X -f ba snarf} {-code error -level 0 -f ba snarf} 27 {-code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 28 {-code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 29 {-code 1 -level X -f ba} {-code 1 -level 0 -f ba} 30 {-code 0 -level X -f ba} {-code 1 -level 0 -f ba} 31 {-code error -level X -f ba} {-code error -level 0 -f ba} 32 {-code ok -level X -f ba} {-code 1 -level 0 -f ba} 33 {-code boss -level X -f ba} {-code 1 -level 0 -f ba} 34 {-code 1 -code 1 -level 0 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 35 {-code 1 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 36 {-code 1 -code 1 -level 5 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 37 {-code 1 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 38 {-code 1 -code error -level 0 -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 39 {-code 1 -code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 40 {-code 1 -code error -level 5 -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 41 {-code 1 -code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 42 {-code 1 -code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 43 {-code 1 -code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 44 {-code 1 -code 1 -level 0 -f ba} {-code 1 -code 1 -level 0 -f ba} 45 {-code 1 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 46 {-code 1 -code 1 -level 5 -f ba} {-code 1 -code 1 -level 0 -f ba} 47 {-code 1 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 48 {-code 1 -code error -level 0 -f ba} {-code 1 -code error -level 0 -f ba} 49 {-code 1 -code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 50 {-code 1 -code error -level 5 -f ba} {-code 1 -code error -level 0 -f ba} 51 {-code 1 -code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 52 {-code 1 -code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 53 {-code 1 -code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 54 {-code 1 -code 1 -level X -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 55 {-code 1 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 56 {-code 1 -code error -level X -f ba snarf} {-code 1 -code error -level 0 -f ba snarf} 57 {-code 1 -code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 58 {-code 1 -code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 59 {-code 1 -code 1 -level X -f ba} {-code 1 -code 1 -level 0 -f ba} 60 {-code 1 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} 61 {-code 1 -code error -level X -f ba} {-code 1 -code error -level 0 -f ba} 62 {-code 1 -code ok -level X -f ba} {-code 1 -level 0 -f ba} 63 {-code 1 -code boss -level X -f ba} {-code 1 -level 0 -f ba} 64 {-code 0 -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 65 {-code 0 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 66 {-code 0 -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 67 {-code 0 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 68 {-code 0 -code error -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 69 {-code 0 -code ok -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 70 {-code 0 -code error -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 71 {-code 0 -code ok -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 72 {-code 0 -code boss -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 73 {-code 0 -code boss -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 74 {-code 0 -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} 75 {-code 0 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} 76 {-code 0 -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} 77 {-code 0 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} 78 {-code 0 -code error -level 0 -f ba} {-code 1 -level 0 -f ba} 79 {-code 0 -code ok -level 0 -f ba} {-code 1 -level 0 -f ba} 80 {-code 0 -code error -level 5 -f ba} {-code 1 -level 0 -f ba} 81 {-code 0 -code ok -level 5 -f ba} {-code 1 -level 0 -f ba} 82 {-code 0 -code boss -level 0 -f ba} {-code 1 -level 0 -f ba} 83 {-code 0 -code boss -level 5 -f ba} {-code 1 -level 0 -f ba} 84 {-code 0 -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 85 {-code 0 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 86 {-code 0 -code error -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 87 {-code 0 -code ok -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 88 {-code 0 -code boss -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} 89 {-code 0 -code 1 -level X -f ba} {-code 1 -level 0 -f ba} 90 {-code 0 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} 91 {-code 0 -code error -level X -f ba} {-code 1 -level 0 -f ba} 92 {-code 0 -code ok -level X -f ba} {-code 1 -level 0 -f ba} 93 {-code 0 -code boss -level X -f ba} {-code 1 -level 0 -f ba} 94 {-code 1 -code 1 -level 0 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 95 {-code 0 -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} 96 {-code 1 -code 1 -level 5 -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} 97 {-code 0 -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} 98 {-code error -code 1 -level 0 -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} 99 {-code ok -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} a0 {-code error -code 1 -level 5 -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} a1 {-code ok -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} a2 {-code boss -code 1 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} a3 {-code boss -code 1 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} a4 {-code 1 -code 1 -level 0 -f ba} {-code 1 -code 1 -level 0 -f ba} a5 {-code 0 -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} a6 {-code 1 -code 1 -level 5 -f ba} {-code 1 -code 1 -level 0 -f ba} a7 {-code 0 -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} a8 {-code error -code 1 -level 0 -f ba} {-code error -code 1 -level 0 -f ba} a9 {-code ok -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} b0 {-code error -code 1 -level 5 -f ba} {-code error -code 1 -level 0 -f ba} b1 {-code ok -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} b2 {-code boss -code 1 -level 0 -f ba} {-code 1 -level 0 -f ba} b3 {-code boss -code 1 -level 5 -f ba} {-code 1 -level 0 -f ba} b4 {-code 1 -code 1 -level X -f ba snarf} {-code 1 -code 1 -level 0 -f ba snarf} b5 {-code 0 -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b6 {-code error -code 1 -level X -f ba snarf} {-code error -code 1 -level 0 -f ba snarf} b7 {-code ok -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b8 {-code boss -code 1 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} b9 {-code 1 -code 1 -level X -f ba} {-code 1 -code 1 -level 0 -f ba} c0 {-code 0 -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c1 {-code error -code 1 -level X -f ba} {-code error -code 1 -level 0 -f ba} c2 {-code ok -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c3 {-code boss -code 1 -level X -f ba} {-code 1 -level 0 -f ba} c4 {-code 1 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c5 {-code 0 -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c6 {-code 1 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} c7 {-code 0 -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} c8 {-code error -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} c9 {-code ok -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} d0 {-code error -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d1 {-code ok -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d2 {-code boss -code 0 -level 0 -f ba snarf} {-code 1 -level 0 -f ba snarf} d3 {-code boss -code 0 -level 5 -f ba snarf} {-code 1 -level 0 -f ba snarf} d4 {-code 1 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d5 {-code 0 -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d6 {-code 1 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} d7 {-code 0 -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} d8 {-code error -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} d9 {-code ok -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} e0 {-code error -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e1 {-code ok -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e2 {-code boss -code 0 -level 0 -f ba} {-code 1 -level 0 -f ba} e3 {-code boss -code 0 -level 5 -f ba} {-code 1 -level 0 -f ba} e4 {-code 1 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e5 {-code 0 -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e6 {-code error -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e7 {-code ok -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e8 {-code boss -code 0 -level X -f ba snarf} {-code 1 -level 0 -f ba snarf} e9 {-code 1 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f0 {-code 0 -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f1 {-code error -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f2 {-code ok -code 0 -level X -f ba} {-code 1 -level 0 -f ba} f3 {-code boss -code 0 -level X -f ba} {-code 1 -level 0 -f ba} } { test chan-io-71.$n {Tcl_SetChannelError} -setup { set f [makeFile {... dummy ...} cutsplice] } -constraints {testchannel} -body { set c [open $f r] testchannel setchannelerror $c [lrange $msg 0 end] } -cleanup { chan close $c removeFile cutsplice } -result [lrange $expected 0 end] test chan-io-72.$n {Tcl_SetChannelErrorInterp} -setup { set f [makeFile {... dummy ...} cutsplice] } -constraints {testchannel} -body { set c [open $f r] testchannel setchannelerrorinterp $c [lrange $msg 0 end] } -cleanup { chan close $c removeFile cutsplice } -result [lrange $expected 0 end] } test chan-io-73.1 {channel Tcl_Obj SetChannelFromAny} -body { # Test for Bug 1847044 - don't spoil type unless we have a valid channel chan close [lreplace [list a] 0 end] } -returnCodes error -match glob -result * # ### ### ### ######### ######### ######### # cleanup foreach file [list fooBar longfile script output test1 pipe my_script \ test2 test3 cat kyrillic.txt utf8-fcopy.txt utf8-rp.txt] { removeFile $file } cleanupTests } namespace delete ::tcl::test::io tcl9.0.3/tests/chan.test0000644000175000017500000002425415104661341014532 0ustar sergeisergei# This file contains a collection of tests for the Tcl built-in 'chan' # command. Sourcing this file into Tcl runs the tests and generates # output for errors. No output means no errors were found. # # Copyright © 2005 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } source [file join [file dirname [info script]] tcltests.tcl] package require tcltests # # Note: The tests for the chan methods "create" and "postevent" # currently reside in the file "ioCmd.test". # test chan-1.1 {chan command general syntax} -body { chan } -returnCodes error -result "wrong # args: should be \"chan subcommand ?arg ...?\"" test chan-1.2 {chan command general syntax} -body { chan FOOBAR } -returnCodes error -match glob -result "unknown or ambiguous subcommand \"FOOBAR\": must be *" test chan-2.1 {chan command: blocked subcommand} -body { chan blocked foo bar } -returnCodes error -result "wrong # args: should be \"chan blocked channel\"" test chan-3.1 {chan command: close subcommand} -body { chan close foo bar zet } -returnCodes error -result "wrong # args: should be \"chan close channel ?direction?\"" test chan-3.2 {chan command: close subcommand} -setup { set chan [open [info script] r] } -body { chan close $chan bar } -cleanup { close $chan } -returnCodes error -result "bad direction \"bar\": must be read or write" test chan-3.3 {chan command: close subcommand} -setup { set chan [open [info script] r] } -body { chan close $chan write } -cleanup { close $chan } -returnCodes error -result "Half-close of write-side not possible, side not opened or already closed" test chan-4.1 {chan command: configure subcommand} -body { chan configure } -returnCodes error -result "wrong # args: should be \"chan configure channel ?-option value ...?\"" test chan-4.2 {chan command: [Bug 800753]} -body { chan configure stdout -eofchar Ā } -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-4.3 {chan command: [Bug 800753]} -body { chan configure stdout -eofchar \x00 } -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-4.4 {chan command: check valid inValue, no outValue} -constraints deprecated -body { chan configure stdout -eofchar [list \x27 {}] } -result {} test chan-4.5 {chan command: check valid inValue, invalid outValue} -body { chan configure stdout -eofchar [list \x27 \x80] } -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-4.6 {chan command: check no inValue, valid outValue} -body { chan configure stdout -eofchar [list {} \x27] } -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} test chan-5.1 {chan command: copy subcommand} -body { chan copy foo } -returnCodes error -result "wrong # args: should be \"chan copy input output ?-size size? ?-command callback?\"" test chan-6.1 {chan command: eof subcommand} -body { chan eof foo bar } -returnCodes error -result "wrong # args: should be \"chan eof channel\"" test chan-7.1 {chan command: event subcommand} -body { chan event foo } -returnCodes error -result "wrong # args: should be \"chan event channel event ?script?\"" test chan-8.1 {chan command: flush subcommand} -body { chan flush foo bar } -returnCodes error -result "wrong # args: should be \"chan flush channel\"" test chan-9.1 {chan command: gets subcommand} -body { chan gets } -returnCodes error -result "wrong # args: should be \"chan gets channel ?varName?\"" test chan-10.1 {chan command: names subcommand} -body { chan names foo bar } -returnCodes error -result "wrong # args: should be \"chan names ?pattern?\"" test chan-11.1 {chan command: puts subcommand} -body { chan puts foo bar foo bar } -returnCodes error -result "wrong # args: should be \"chan puts ?-nonewline? ?channel? string\"" test chan-12.1 {chan command: read subcommand} -body { chan read } -returnCodes error -result "wrong # args: should be \"chan read channel ?numChars?\" or \"chan read ?-nonewline? channel\"" test chan-13.1 {chan command: seek subcommand} -body { chan seek foo bar foo bar } -returnCodes error -result "wrong # args: should be \"chan seek channel offset ?origin?\"" test chan-14.1 {chan command: tell subcommand} -body { chan tell foo bar } -returnCodes error -result "wrong # args: should be \"chan tell channel\"" test chan-15.1 {chan command: truncate subcommand} -body { chan truncate foo bar foo bar } -returnCodes error -result "wrong \# args: should be \"chan truncate channel ?length?\"" test chan-15.2 {chan command: truncate subcommand} -setup { set file [makeFile {} testTruncate] set f [open $file w+] fconfigure $f -translation binary } -body { seek $f 0 puts -nonewline $f 12345 seek $f 0 chan truncate $f 2 read $f } -result 12 -cleanup { catch {close $f} catch {removeFile $file} } test chan-15.3 {chan command: isbinary subcommand} -setup { set file [makeFile {} testIsBinary] set f [open $file w+] fconfigure $f -translation binary } -body { chan isbinary $f } -result 1 -cleanup { catch {close $f} catch {removeFile $file} } # TIP 287: chan pending test chan-16.1 {chan command: pending subcommand} -body { chan pending } -returnCodes error -result "wrong # args: should be \"chan pending mode channel\"" test chan-16.2 {chan command: pending subcommand} -body { chan pending stdin } -returnCodes error -result "wrong # args: should be \"chan pending mode channel\"" test chan-16.3 {chan command: pending subcommand} -body { chan pending stdin stdout stderr } -returnCodes error -result "wrong # args: should be \"chan pending mode channel\"" test chan-16.4 {chan command: pending subcommand} -body { chan pending {input output} stdout } -returnCodes error -result "bad mode \"input output\": must be input or output" test chan-16.5 {chan command: pending input subcommand} -body { chan pending input stdout } -result -1 test chan-16.6 {chan command: pending input subcommand} -body { chan pending input stdin } -result 0 test chan-16.7 {chan command: pending input subcommand} -body { chan pending input FOOBAR } -returnCodes error -result "can not find channel named \"FOOBAR\"" test chan-16.8 {chan command: pending input subcommand} -setup { set file [makeFile {} testAvailable] set f [open $file w+] chan configure $f -translation lf -buffering line } -body { chan puts $f foo chan puts $f bar chan puts $f baz chan seek $f 0 chan gets $f chan pending input $f } -result 8 -cleanup { catch {chan close $f} catch {removeFile $file} } test chan-16.9 {chan command: pending input subcommand} -setup { proc chan-16.9-accept {sock addr port} { chan configure $sock -blocking 0 -buffering line -buffersize 32 chan event $sock readable [list chan-16.9-readable $sock] } proc chan-16.9-readable {sock} { set r [chan gets $sock line] set l [string length $line] set e [chan eof $sock] set b [chan blocked $sock] set i [chan pending input $sock] lappend ::chan-16.9-data $r $l $e $b $i if {$r >= 0 || $e || $l || !$b || $i > 128} { set data [read $sock $i] lappend ::chan-16.9-data [string range $data 0 2] lappend ::chan-16.9-data [string range $data end-2 end] set ::chan-16.9-done 1 chan event $sock readable {} } else { after idle chan-16.9-client } } proc chan-16.9-client {} { chan puts -nonewline $::client ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 chan flush $::client } set ::server [socket -server chan-16.9-accept -myaddr 127.0.0.1 0] set ::client [socket 127.0.0.1 [lindex [fconfigure $::server -sockname] 2]] set ::chan-16.9-data [list] set ::chan-16.9-done 0 } -body { after idle chan-16.9-client vwait ::chan-16.9-done set ::chan-16.9-data } -result {-1 0 0 1 36 -1 0 0 1 72 -1 0 0 1 108 -1 0 0 1 144 ABC 890} -cleanup { catch {chan close $client} catch {chan close $server} rename chan-16.9-accept {} rename chan-16.9-readable {} rename chan-16.9-client {} unset -nocomplain ::chan-16.9-data unset -nocomplain ::chan-16.9-done unset -nocomplain ::server unset -nocomplain ::client } test chan-16.10 {chan command: pending output subcommand} -body { chan pending output stdin } -result -1 test chan-16.11 {chan command: pending output subcommand} -body { chan pending output stdout } -result 0 test chan-16.12 {chan command: pending output subcommand} -body { chan pending output FOOBAR } -returnCodes error -result "can not find channel named \"FOOBAR\"" test chan-16.13 {chan command: pending output subcommand} -setup { set file [makeFile {} testPendingOutput] set f [open $file w+] chan configure $f -translation lf -buffering full -buffersize 1024 } -body { set result [list] chan puts $f [string repeat x 512] lappend result [chan pending output $f] chan flush $f lappend result [chan pending output $f] } -result [list 513 0] -cleanup { unset -nocomplain result catch {chan close $f} catch {removeFile $file} } # TIP 304: chan pipe test chan-17.1 {chan command: pipe subcommand} -body { chan pipe foo } -returnCodes error -result "wrong # args: should be \"chan pipe \"" test chan-17.2 {chan command: pipe subcommand} -body { chan pipe foo bar } -returnCodes error -result "wrong # args: should be \"chan pipe \"" test chan-17.3 {chan command: pipe subcommand} -body { set l [chan pipe] foreach {pr pw} $l break list [llength $l] [fconfigure $pr -blocking] [fconfigure $pw -blocking] } -result [list 2 1 1] -cleanup { close $pw close $pr } test chan-17.4 {chan command: pipe subcommand} -body { set ::done 0 foreach {::pr ::pw} [chan pipe] break after 100 {puts $::pw foo;flush $::pw} fileevent $::pr readable {set ::done 1} after 500 {set ::done -1} vwait ::done set out nope if {$::done==1} {gets $::pr out} list $::done $out } -result [list 1 foo] -cleanup { close $::pw close $::pr } cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/brodnik.test0000644000175000017500000000333215104661341015243 0ustar sergeisergei# This file contains a collection of tests for the routine TclMSB() in the # file tclUtil.c. # # Contributions from Don Porter, NIST, 2013. (not subject to US copyright) # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package require Tcl 8.6- package require tcltest 2 namespace eval ::tcl::test::brodnik { namespace import ::tcltest::loadTestedCommands namespace import ::tcltest::testConstraint namespace import ::tcltest::test namespace import ::tcltest::cleanupTests loadTestedCommands try {package require tcl::test} testConstraint testmsb [expr {[namespace which -command testmsb] ne {}}] namespace eval tcl { namespace eval mathfunc { proc log2 {i} { set k 0 while {[set i [expr {$i>>1}]]} { incr k } return $k } } } # Test out-of-range rejection test brodnik-1.0 {TclMSB correctness} -constraints testmsb -body { testmsb 0 } -returnCodes error -match glob -result * # Tests for values with MSB in the low block variable v 1 while {$v < 1<<8} { test brodnik-1.$v {TclMSB correctness} testmsb { testmsb $v } [expr {int(log2($v))}] incr v } variable i 8 while {$i < 8*$::tcl_platform(pointerSize) - 1} { variable j -1 while {$j < 2} { set v [expr {(1<<$i) + $j}] test brodnik-2.$i.$j {TclMSB correctness} testmsb { testmsb $v } [expr {int(log2($v))}] incr j } incr i } # Test out-of-range rejection test brodnik-3.0 {TclMSB correctness} -constraints testmsb -body { testmsb [expr 1<<64] } -returnCodes error -match glob -result * cleanupTests } namespace delete ::tcl::test::brodnik return tcl9.0.3/tests/binary.test0000644000175000017500000033550015104661341015104 0ustar sergeisergei# This file tests the tclBinary.c file and the "binary" Tcl command. # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands source [file join [file dirname [info script]] tcltests.tcl] catch [list package require -exact tcl::test [info patchlevel]] testConstraint bigEndian [expr {$tcl_platform(byteOrder) eq "bigEndian"}] testConstraint littleEndian [expr {$tcl_platform(byteOrder) eq "littleEndian"}] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}] # Big test for correct ordering of data in [expr] proc testIEEE {} { variable ieeeValues binary scan [binary format dd -1.0 1.0] c* c switch -exact -- $c { {0 0 0 0 0 0 -16 -65 0 0 0 0 0 0 -16 63} { # little endian binary scan \x00\x00\x00\x00\x00\x00\xF0\xFF d \ ieeeValues(-Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF0\xBF d \ ieeeValues(-Normal) binary scan \x00\x00\x00\x00\x00\x00\x08\x80 d \ ieeeValues(-Subnormal) binary scan \x00\x00\x00\x00\x00\x00\x00\x80 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x00\x00\x00\x00\x00\x08\x00 d \ ieeeValues(+Subnormal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x3F d \ ieeeValues(+Normal) binary scan \x00\x00\x00\x00\x00\x00\xF0\x7F d \ ieeeValues(+Infinity) binary scan \x00\x00\x00\x00\x00\x00\xF8\x7F d \ ieeeValues(NaN) set ieeeValues(littleEndian) 1 return 1 } {-65 -16 0 0 0 0 0 0 63 -16 0 0 0 0 0 0} { binary scan \xFF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Infinity) binary scan \xBF\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Normal) binary scan \x80\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-Subnormal) binary scan \x80\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(-0) binary scan \x00\x00\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+0) binary scan \x00\x08\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Subnormal) binary scan \x3F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Normal) binary scan \x7F\xF0\x00\x00\x00\x00\x00\x00 d \ ieeeValues(+Infinity) binary scan \x7F\xF8\x00\x00\x00\x00\x00\x00 d \ ieeeValues(NaN) set ieeeValues(littleEndian) 0 return 1 } default { return 0 } } } testConstraint ieeeFloatingPoint [testIEEE] # ---------------------------------------------------------------------- test binary-0.1 {DupByteArrayInternalRep} { set hdr [binary format cc 0 0316] set buf hellomatt set data $hdr append data $buf string length $data } 11 test binary-1.1 {Tcl_BinaryObjCmd: bad args} -body { binary } -returnCodes error -match glob -result {wrong # args: *} test binary-1.2 {Tcl_BinaryObjCmd: bad args} -returnCodes error -body { binary foo } -match glob -result {unknown or ambiguous subcommand "foo": *} test binary-1.3 {Tcl_BinaryObjCmd: format error} -returnCodes error -body { binary f } -result {wrong # args: should be "binary format formatString ?arg ...?"} test binary-1.4 {Tcl_BinaryObjCmd: format} -body { binary format "" } -result {} test binary-2.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format a } -result {not enough arguments for all format specifiers} test binary-2.2 {Tcl_BinaryObjCmd: format} { binary format a0 foo } {} test binary-2.3 {Tcl_BinaryObjCmd: format} { binary format a f } {f} test binary-2.4 {Tcl_BinaryObjCmd: format} { binary format a foo } {f} test binary-2.5 {Tcl_BinaryObjCmd: format} { binary format a3 foo } {foo} test binary-2.6 {Tcl_BinaryObjCmd: format} { binary format a5 foo } foo\x00\x00 test binary-2.7 {Tcl_BinaryObjCmd: format} { binary format a*a3 foobarbaz blat } foobarbazbla test binary-2.8 {Tcl_BinaryObjCmd: format} { binary format a*X3a2 foobar x } foox\x00r test binary-3.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format A } -result {not enough arguments for all format specifiers} test binary-3.2 {Tcl_BinaryObjCmd: format} { binary format A0 f } {} test binary-3.3 {Tcl_BinaryObjCmd: format} { binary format A f } {f} test binary-3.4 {Tcl_BinaryObjCmd: format} { binary format A foo } {f} test binary-3.5 {Tcl_BinaryObjCmd: format} { binary format A3 foo } {foo} test binary-3.6 {Tcl_BinaryObjCmd: format} { binary format A5 foo } {foo } test binary-3.7 {Tcl_BinaryObjCmd: format} { binary format A*A3 foobarbaz blat } foobarbazbla test binary-3.8 {Tcl_BinaryObjCmd: format} { binary format A*X3A2 foobar x } {foox r} test binary-4.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format B } -result {not enough arguments for all format specifiers} test binary-4.2 {Tcl_BinaryObjCmd: format} { binary format B0 1 } {} test binary-4.3 {Tcl_BinaryObjCmd: format} { binary format B 1 } \x80 test binary-4.4 {Tcl_BinaryObjCmd: format} { binary format B* 010011 } \x4C test binary-4.5 {Tcl_BinaryObjCmd: format} { binary format B8 01001101 } \x4D test binary-4.6 {Tcl_BinaryObjCmd: format} { binary format A2X2B9 oo 01001101 } \x4D\x00 test binary-4.7 {Tcl_BinaryObjCmd: format} { binary format B9 010011011010 } \x4D\x80 test binary-4.8 {Tcl_BinaryObjCmd: format} { binary format B2B3 10 010 } \x80\x40 test binary-4.9 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format B1B5 1 foo } -result {expected binary string but got "foo" instead} test binary-5.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format b } -result {not enough arguments for all format specifiers} test binary-5.2 {Tcl_BinaryObjCmd: format} { binary format b0 1 } {} test binary-5.3 {Tcl_BinaryObjCmd: format} { binary format b 1 } \x01 test binary-5.4 {Tcl_BinaryObjCmd: format} { binary format b* 010011 } 2 test binary-5.5 {Tcl_BinaryObjCmd: format} { binary format b8 01001101 } \xB2 test binary-5.6 {Tcl_BinaryObjCmd: format} { binary format A2X2b9 oo 01001101 } \xB2\x00 test binary-5.7 {Tcl_BinaryObjCmd: format} { binary format b9 010011011010 } \xB2\x01 test binary-5.8 {Tcl_BinaryObjCmd: format} { binary format b17 1 } \x01\x00\x00 test binary-5.9 {Tcl_BinaryObjCmd: format} { binary format b2b3 10 010 } \x01\x02 test binary-5.10 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format b1b5 1 foo } -result {expected binary string but got "foo" instead} test binary-6.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format h } -result {not enough arguments for all format specifiers} test binary-6.2 {Tcl_BinaryObjCmd: format} { binary format h0 1 } {} test binary-6.3 {Tcl_BinaryObjCmd: format} { binary format h 1 } \x01 test binary-6.4 {Tcl_BinaryObjCmd: format} { binary format h c } \x0C test binary-6.5 {Tcl_BinaryObjCmd: format} { binary format h* baadf00d } \xAB\xDA\x0F\xD0 test binary-6.6 {Tcl_BinaryObjCmd: format} { binary format h4 c410 } \x4C\x01 test binary-6.7 {Tcl_BinaryObjCmd: format} { binary format h6 c4102 } \x4C\x01\x02 test binary-6.8 {Tcl_BinaryObjCmd: format} { binary format h5 c41020304 } \x4C\x01\x02 test binary-6.9 {Tcl_BinaryObjCmd: format} { binary format a3X3h5 foo 2 } \x02\x00\x00 test binary-6.10 {Tcl_BinaryObjCmd: format} { binary format h2h3 23 456 } \x32\x54\x06 test binary-6.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format h2 foo } -result {expected hexadecimal string but got "foo" instead} test binary-7.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format H } -result {not enough arguments for all format specifiers} test binary-7.2 {Tcl_BinaryObjCmd: format} { binary format H0 1 } {} test binary-7.3 {Tcl_BinaryObjCmd: format} { binary format H 1 } \x10 test binary-7.4 {Tcl_BinaryObjCmd: format} { binary format H c } \xC0 test binary-7.5 {Tcl_BinaryObjCmd: format} { binary format H* baadf00d } \xBA\xAD\xF0\x0D test binary-7.6 {Tcl_BinaryObjCmd: format} { binary format H4 c410 } \xC4\x10 test binary-7.7 {Tcl_BinaryObjCmd: format} { binary format H6 c4102 } \xC4\x10\x20 test binary-7.8 {Tcl_BinaryObjCmd: format} { binary format H5 c41023304 } \xC4\x10\x20 test binary-7.9 {Tcl_BinaryObjCmd: format} { binary format a3X3H5 foo 2 } \x20\x00\x00 test binary-7.10 {Tcl_BinaryObjCmd: format} { binary format H2H3 23 456 } \x23\x45\x60 test binary-7.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format H2 foo } -result {expected hexadecimal string but got "foo" instead} test binary-8.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format c } -result {not enough arguments for all format specifiers} test binary-8.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format c blat } -result {expected integer but got "blat"} test binary-8.3 {Tcl_BinaryObjCmd: format} { binary format c0 0x50 } {} test binary-8.4 {Tcl_BinaryObjCmd: format} { binary format c 0x50 } P test binary-8.5 {Tcl_BinaryObjCmd: format} { binary format c 0x5052 } R test binary-8.6 {Tcl_BinaryObjCmd: format} { binary format c2 {0x50 0x52} } PR test binary-8.7 {Tcl_BinaryObjCmd: format} { binary format c2 {0x50 0x52 0x53} } PR test binary-8.8 {Tcl_BinaryObjCmd: format} { binary format c* {0x50 0x52} } PR test binary-8.9 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format c2 {0x50} } -result {number of elements in list does not match count} test binary-8.10 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format c $a } -result "expected integer but got a list" test binary-8.11 {Tcl_BinaryObjCmd: format} { set a {0x50 0x51} binary format c1 $a } P test binary-9.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format s } -result {not enough arguments for all format specifiers} test binary-9.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format s blat } -result {expected integer but got "blat"} test binary-9.3 {Tcl_BinaryObjCmd: format} { binary format s0 0x50 } {} test binary-9.4 {Tcl_BinaryObjCmd: format} { binary format s 0x50 } P\x00 test binary-9.5 {Tcl_BinaryObjCmd: format} { binary format s 0x5052 } RP test binary-9.6 {Tcl_BinaryObjCmd: format} { binary format s 0x505251 0x53 } QR test binary-9.7 {Tcl_BinaryObjCmd: format} { binary format s2 {0x50 0x52} } P\x00R\x00 test binary-9.8 {Tcl_BinaryObjCmd: format} { binary format s* {0x5051 0x52} } QPR\x00 test binary-9.9 {Tcl_BinaryObjCmd: format} { binary format s2 {0x50 0x52 0x53} 0x54 } P\x00R\x00 test binary-9.10 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format s2 {0x50} } -result {number of elements in list does not match count} test binary-9.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format s $a } -result "expected integer but got a list" test binary-9.12 {Tcl_BinaryObjCmd: format} { set a {0x50 0x51} binary format s1 $a } P\x00 test binary-10.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format S } -result {not enough arguments for all format specifiers} test binary-10.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format S blat } -result {expected integer but got "blat"} test binary-10.3 {Tcl_BinaryObjCmd: format} { binary format S0 0x50 } {} test binary-10.4 {Tcl_BinaryObjCmd: format} { binary format S 0x50 } \x00P test binary-10.5 {Tcl_BinaryObjCmd: format} { binary format S 0x5052 } PR test binary-10.6 {Tcl_BinaryObjCmd: format} { binary format S 0x505251 0x53 } RQ test binary-10.7 {Tcl_BinaryObjCmd: format} { binary format S2 {0x50 0x52} } \x00P\x00R test binary-10.8 {Tcl_BinaryObjCmd: format} { binary format S* {0x5051 0x52} } PQ\x00R test binary-10.9 {Tcl_BinaryObjCmd: format} { binary format S2 {0x50 0x52 0x53} 0x54 } \x00P\x00R test binary-10.10 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format S2 {0x50} } -result {number of elements in list does not match count} test binary-10.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format S $a } -result "expected integer but got a list" test binary-10.12 {Tcl_BinaryObjCmd: format} { set a {0x50 0x51} binary format S1 $a } \x00P test binary-11.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format i } -result {not enough arguments for all format specifiers} test binary-11.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format i blat } -result {expected integer but got "blat"} test binary-11.3 {Tcl_BinaryObjCmd: format} { binary format i0 0x50 } {} test binary-11.4 {Tcl_BinaryObjCmd: format} { binary format i 0x50 } P\x00\x00\x00 test binary-11.5 {Tcl_BinaryObjCmd: format} { binary format i 0x5052 } RP\x00\x00 test binary-11.6 {Tcl_BinaryObjCmd: format} { binary format i 0x505251 0x53 } QRP\x00 test binary-11.7 {Tcl_BinaryObjCmd: format} { binary format i1 {0x505251 0x53} } QRP\x00 test binary-11.8 {Tcl_BinaryObjCmd: format} { binary format i 0x53525150 } PQRS test binary-11.9 {Tcl_BinaryObjCmd: format} { binary format i2 {0x50 0x52} } P\x00\x00\x00R\x00\x00\x00 test binary-11.10 {Tcl_BinaryObjCmd: format} { binary format i* {0x50515253 0x52} } SRQPR\x00\x00\x00 test binary-11.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format i2 {0x50} } -result {number of elements in list does not match count} test binary-11.12 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format i $a } -result "expected integer but got a list" test binary-11.13 {Tcl_BinaryObjCmd: format} { set a {0x50 0x51} binary format i1 $a } P\x00\x00\x00 test binary-12.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format I } -result {not enough arguments for all format specifiers} test binary-12.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format I blat } -result {expected integer but got "blat"} test binary-12.3 {Tcl_BinaryObjCmd: format} { binary format I0 0x50 } {} test binary-12.4 {Tcl_BinaryObjCmd: format} { binary format I 0x50 } \x00\x00\x00P test binary-12.5 {Tcl_BinaryObjCmd: format} { binary format I 0x5052 } \x00\x00PR test binary-12.6 {Tcl_BinaryObjCmd: format} { binary format I 0x505251 0x53 } \x00PRQ test binary-12.7 {Tcl_BinaryObjCmd: format} { binary format I1 {0x505251 0x53} } \x00PRQ test binary-12.8 {Tcl_BinaryObjCmd: format} { binary format I 0x53525150 } SRQP test binary-12.9 {Tcl_BinaryObjCmd: format} { binary format I2 {0x50 0x52} } \x00\x00\x00P\x00\x00\x00R test binary-12.10 {Tcl_BinaryObjCmd: format} { binary format I* {0x50515253 0x52} } PQRS\x00\x00\x00R test binary-12.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format i2 {0x50} } -result {number of elements in list does not match count} test binary-12.12 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format I $a } -result "expected integer but got a list" test binary-12.13 {Tcl_BinaryObjCmd: format} { set a {0x50 0x51} binary format I1 $a } \x00\x00\x00P test binary-13.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format f } -result {not enough arguments for all format specifiers} test binary-13.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format f blat } -result {expected floating-point number but got "blat"} test binary-13.3 {Tcl_BinaryObjCmd: format} { binary format f0 1.6 } {} test binary-13.4 {Tcl_BinaryObjCmd: format} bigEndian { binary format f 1.6 } \x3F\xCC\xCC\xCD test binary-13.5 {Tcl_BinaryObjCmd: format} littleEndian { binary format f 1.6 } \xCD\xCC\xCC\x3F test binary-13.6 {Tcl_BinaryObjCmd: format} bigEndian { binary format f* {1.6 3.4} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-13.7 {Tcl_BinaryObjCmd: format} littleEndian { binary format f* {1.6 3.4} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-13.8 {Tcl_BinaryObjCmd: format} bigEndian { binary format f2 {1.6 3.4} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-13.9 {Tcl_BinaryObjCmd: format} littleEndian { binary format f2 {1.6 3.4} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-13.10 {Tcl_BinaryObjCmd: format} bigEndian { binary format f2 {1.6 3.4 5.6} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-13.11 {Tcl_BinaryObjCmd: format} littleEndian { binary format f2 {1.6 3.4 5.6} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-13.12 {Tcl_BinaryObjCmd: float overflow} bigEndian { binary format f -3.402825e+38 } \xFF\x80\x00\x00 test binary-13.13 {Tcl_BinaryObjCmd: float overflow} littleEndian { binary format f -3.402825e+38 } \x00\x00\x80\xFF test binary-13.14 {Tcl_BinaryObjCmd: float underflow} bigEndian { binary format f -3.402825e-100 } \x80\x00\x00\x00 test binary-13.15 {Tcl_BinaryObjCmd: float underflow} littleEndian { binary format f -3.402825e-100 } \x00\x00\x00\x80 test binary-13.16 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format f2 {1.6} } -result {number of elements in list does not match count} test binary-13.17 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {1.6 3.4} binary format f $a } -result "expected floating-point number but got a list" test binary-13.18 {Tcl_BinaryObjCmd: format} bigEndian { set a {1.6 3.4} binary format f1 $a } \x3F\xCC\xCC\xCD test binary-13.19 {Tcl_BinaryObjCmd: format} littleEndian { set a {1.6 3.4} binary format f1 $a } \xCD\xCC\xCC\x3F test binary-13.20 {Tcl_BinaryObjCmd: format float Inf} bigEndian { binary format f Inf } \x7F\x80\x00\x00 test binary-13.21 {Tcl_BinaryObjCmd: format float Inf} littleEndian { binary format f Inf } \x00\x00\x80\x7F test binary-13.22 {Tcl_BinaryObjCmd: format float -Inf} bigEndian { binary format f -Inf } \xFF\x80\x00\x00 test binary-13.23 {Tcl_BinaryObjCmd: format float -Inf} littleEndian { binary format f -Inf } \x00\x00\x80\xFF test binary-14.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format d } -result {not enough arguments for all format specifiers} test binary-14.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format d blat } -result {expected floating-point number but got "blat"} test binary-14.3 {Tcl_BinaryObjCmd: format} { binary format d0 1.6 } {} test binary-14.4 {Tcl_BinaryObjCmd: format} bigEndian { binary format d 1.6 } \x3F\xF9\x99\x99\x99\x99\x99\x9A test binary-14.5 {Tcl_BinaryObjCmd: format} littleEndian { binary format d 1.6 } \x9A\x99\x99\x99\x99\x99\xF9\x3F test binary-14.6 {Tcl_BinaryObjCmd: format} bigEndian { binary format d* {1.6 3.4} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-14.7 {Tcl_BinaryObjCmd: format} littleEndian { binary format d* {1.6 3.4} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-14.8 {Tcl_BinaryObjCmd: format} bigEndian { binary format d2 {1.6 3.4} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-14.9 {Tcl_BinaryObjCmd: format} littleEndian { binary format d2 {1.6 3.4} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-14.10 {Tcl_BinaryObjCmd: format} bigEndian { binary format d2 {1.6 3.4 5.6} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-14.11 {Tcl_BinaryObjCmd: format} littleEndian { binary format d2 {1.6 3.4 5.6} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-14.14 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format d2 {1.6} } -result {number of elements in list does not match count} test binary-14.15 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {1.6 3.4} binary format d $a } -result "expected floating-point number but got a list" test binary-14.16 {Tcl_BinaryObjCmd: format} bigEndian { set a {1.6 3.4} binary format d1 $a } \x3F\xF9\x99\x99\x99\x99\x99\x9A test binary-14.17 {Tcl_BinaryObjCmd: format} littleEndian { set a {1.6 3.4} binary format d1 $a } \x9A\x99\x99\x99\x99\x99\xF9\x3F test binary-14.18 {FormatNumber: Bug 1116542} { binary scan [binary format d 1.25] d w set w } 1.25 test binary-15.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format ax*a "y" "z" } -result {cannot use "*" in format string with "x"} test binary-15.2 {Tcl_BinaryObjCmd: format} { binary format axa "y" "z" } y\x00z test binary-15.3 {Tcl_BinaryObjCmd: format} { binary format ax3a "y" "z" } y\x00\x00\x00z test binary-15.4 {Tcl_BinaryObjCmd: format} { binary format a*X3x3a* "foo" "z" } \x00\x00\x00z test binary-15.5 {Tcl_BinaryObjCmd: format - bug #1923966} { binary format x0s 1 } \x01\x00 test binary-15.6 {Tcl_BinaryObjCmd: format - bug #1923966} { binary format x0ss 1 1 } \x01\x00\x01\x00 test binary-15.7 {Tcl_BinaryObjCmd: format - bug #1923966} { binary format x1s 1 } \x00\x01\x00 test binary-15.8 {Tcl_BinaryObjCmd: format - bug #1923966} { binary format x1ss 1 1 } \x00\x01\x00\x01\x00 test binary-16.1 {Tcl_BinaryObjCmd: format} { binary format a*X*a "foo" "z" } zoo test binary-16.2 {Tcl_BinaryObjCmd: format} { binary format aX3a "y" "z" } z test binary-16.3 {Tcl_BinaryObjCmd: format} { binary format a*Xa* "foo" "zy" } fozy test binary-16.4 {Tcl_BinaryObjCmd: format} { binary format a*X3a "foobar" "z" } foozar test binary-16.5 {Tcl_BinaryObjCmd: format} { binary format a*X3aX2a "foobar" "z" "b" } fobzar test binary-17.1 {Tcl_BinaryObjCmd: format} { binary format @1 } \x00 test binary-17.2 {Tcl_BinaryObjCmd: format} { binary format @5a2 "ab" } \x00\x00\x00\x00\x00\x61\x62 test binary-17.3 {Tcl_BinaryObjCmd: format} { binary format {a* @0 a2 @* a*} "foobar" "ab" "blat" } abobarblat test binary-18.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format u0a3 abc abd } -result {bad field specifier "u"} test binary-19.1 {Tcl_BinaryObjCmd: errors} -returnCodes error -body { binary s } -result {wrong # args: should be "binary scan value formatString ?varName ...?"} test binary-19.2 {Tcl_BinaryObjCmd: errors} -returnCodes error -body { binary scan foo } -result {wrong # args: should be "binary scan value formatString ?varName ...?"} test binary-19.3 {Tcl_BinaryObjCmd: scan} { binary scan {} {} } 0 test binary-20.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc a } -result {not enough arguments for all format specifiers} test binary-20.2 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan abc a arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-20.3 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { set arg1 abc list [binary scan abc a0 arg1] $arg1 } -result {1 {}} test binary-20.4 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc a* arg1] $arg1 } -result {1 abc} test binary-20.5 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc a5 arg1] [info exists arg1] } -result {0 0} test binary-20.6 {Tcl_BinaryObjCmd: scan} { set arg1 foo list [binary scan abc a2 arg1] $arg1 } {1 ab} test binary-20.7 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 unset -nocomplain arg2 } -body { list [binary scan abcdef a2a2 arg1 arg2] $arg1 $arg2 } -result {2 ab cd} test binary-20.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc a2 arg1(a)] $arg1(a) } -result {1 ab} test binary-20.9 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc a arg1(a)] $arg1(a) } -result {1 a} test binary-21.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc A } -result {not enough arguments for all format specifiers} test binary-21.2 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan abc A arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-21.3 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { set arg1 abc list [binary scan abc A0 arg1] $arg1 } -result {1 {}} test binary-21.4 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc A* arg1] $arg1 } -result {1 abc} test binary-21.5 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc A5 arg1] [info exists arg1] } -result {0 0} test binary-21.6 {Tcl_BinaryObjCmd: scan} { set arg1 foo list [binary scan abc A2 arg1] $arg1 } {1 ab} test binary-21.7 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 unset -nocomplain arg2 } -body { list [binary scan abcdef A2A2 arg1 arg2] $arg1 $arg2 } -result {2 ab cd} test binary-21.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc A2 arg1(a)] $arg1(a) } -result {1 ab} test binary-21.9 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc A2 arg1(a)] $arg1(a) } -result {1 ab} test binary-21.10 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan abc A arg1(a)] $arg1(a) } -result {1 a} test binary-21.11 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan "abc def \x00 " A* arg1] $arg1 } -result {1 {abc def}} test binary-21.12 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan "abc def \x00ghi " A* arg1] $arg1 } -result [list 1 "abc def \x00ghi"] test binary-21.13 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan "abc def \x00 " C* arg1] $arg1 } -result {1 {abc def }} test binary-21.14 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -body { list [binary scan "abc def \x00ghi" C* arg1] $arg1 } -result {1 {abc def }} test binary-22.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc b } -result {not enough arguments for all format specifiers} test binary-22.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 b* arg1] $arg1 } {1 0100101011001010} test binary-22.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 b arg1] $arg1 } {1 0} test binary-22.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 b1 arg1] $arg1 } {1 0} test binary-22.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 b0 arg1] $arg1 } {1 {}} test binary-22.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 b5 arg1] $arg1 } {1 01001} test binary-22.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 b8 arg1] $arg1 } {1 01001010} test binary-22.8 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 b14 arg1] $arg1 } {1 01001010110010} test binary-22.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 b14 arg1] $arg1 } {0 foo} test binary-22.10 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 b1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-22.11 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 arg2 } -body { set arg1 foo set arg2 bar list [binary scan \x07\x87\x05 b5b* arg1 arg2] $arg1 $arg2 } -result {2 11100 1110000110100000} test binary-23.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc B } -result {not enough arguments for all format specifiers} test binary-23.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 B* arg1] $arg1 } {1 0101001001010011} test binary-23.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 B arg1] $arg1 } {1 1} test binary-23.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 B1 arg1] $arg1 } {1 1} test binary-23.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 B0 arg1] $arg1 } {1 {}} test binary-23.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 B5 arg1] $arg1 } {1 01010} test binary-23.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 B8 arg1] $arg1 } {1 01010010} test binary-23.8 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 B14 arg1] $arg1 } {1 01010010010100} test binary-23.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 B14 arg1] $arg1 } {0 foo} test binary-23.10 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 B1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-23.11 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 arg2 } -body { set arg1 foo set arg2 bar list [binary scan \x70\x87\x05 B5B* arg1 arg2] $arg1 $arg2 } -result {2 01110 1000011100000101} test binary-24.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc h } -result {not enough arguments for all format specifiers} test binary-24.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 h* arg1] $arg1 } {1 253a} test binary-24.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xC2\xA3 h arg1] $arg1 } {1 2} test binary-24.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 h1 arg1] $arg1 } {1 2} test binary-24.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 h0 arg1] $arg1 } {1 {}} test binary-24.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xF2\x53 h2 arg1] $arg1 } {1 2f} test binary-24.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 h3 arg1] $arg1 } {1 253} test binary-24.8 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 h3 arg1] $arg1 } {0 foo} test binary-24.9 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 h1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-24.10 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 arg2 } -body { set arg1 foo set arg2 bar list [binary scan \x70\x87\x05 h2h* arg1 arg2] $arg1 $arg2 } -result {2 07 7850} test binary-25.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc H } -result {not enough arguments for all format specifiers} test binary-25.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 H* arg1] $arg1 } {1 52a3} test binary-25.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xC2\xA3 H arg1] $arg1 } {1 c} test binary-25.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x82\x53 H1 arg1] $arg1 } {1 8} test binary-25.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 H0 arg1] $arg1 } {1 {}} test binary-25.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xF2\x53 H2 arg1] $arg1 } {1 f2} test binary-25.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\x53 H3 arg1] $arg1 } {1 525} test binary-25.8 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 H3 arg1] $arg1 } {0 foo} test binary-25.9 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 H1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-25.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x70\x87\x05 H2H* arg1 arg2] $arg1 $arg2 } {2 70 8705} test binary-26.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc c } -result {not enough arguments for all format specifiers} test binary-26.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 c* arg1] $arg1 } {1 {82 -93}} test binary-26.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 c arg1] $arg1 } {1 82} test binary-26.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 c1 arg1] $arg1 } {1 82} test binary-26.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 c0 arg1] $arg1 } {1 {}} test binary-26.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 c2 arg1] $arg1 } {1 {82 -93}} test binary-26.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xFF c arg1] $arg1 } {1 -1} test binary-26.8 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 c3 arg1] $arg1 } {0 foo} test binary-26.9 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 c1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-26.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x70\x87\x05 c2c* arg1 arg2] $arg1 $arg2 } {2 {112 -121} 5} test binary-26.11 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 cu* arg1] $arg1 } {1 {82 163}} test binary-26.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 cu arg1] $arg1 } {1 82} test binary-26.13 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xFF cu arg1] $arg1 } {1 255} test binary-26.14 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x80 cuc arg1 arg2] $arg1 $arg2 } {2 128 -128} test binary-26.15 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x80 ccu arg1 arg2] $arg1 $arg2 } {2 -128 128} test binary-27.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc s } -result {not enough arguments for all format specifiers} test binary-27.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 s* arg1] $arg1 } {1 {-23726 21587}} test binary-27.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 s arg1] $arg1 } {1 -23726} test binary-27.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 s1 arg1] $arg1 } {1 -23726} test binary-27.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 s0 arg1] $arg1 } {1 {}} test binary-27.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 s2 arg1] $arg1 } {1 {-23726 21587}} test binary-27.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 s1 arg1] $arg1 } {0 foo} test binary-27.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 s1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-27.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x05 s2c* arg1 arg2] $arg1 $arg2 } {2 {-23726 21587} 5} test binary-27.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 su* arg1] $arg1 } {1 {41810 21587}} test binary-27.11 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \xFF\xFF\xFF\xFF sus arg1 arg2] $arg1 $arg2 } {2 65535 -1} test binary-27.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \xFF\xFF\xFF\xFF ssu arg1 arg2] $arg1 $arg2 } {2 -1 65535} test binary-28.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc S } -result {not enough arguments for all format specifiers} test binary-28.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 S* arg1] $arg1 } {1 {21155 21332}} test binary-28.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 S arg1] $arg1 } {1 21155} test binary-28.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 S1 arg1] $arg1 } {1 21155} test binary-28.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3 S0 arg1] $arg1 } {1 {}} test binary-28.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 S2 arg1] $arg1 } {1 {21155 21332}} test binary-28.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 S1 arg1] $arg1 } {0 foo} test binary-28.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 S1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-28.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x05 S2c* arg1 arg2] $arg1 $arg2 } {2 {21155 21332} 5} test binary-28.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 Su* arg1] $arg1 } {1 {21155 21332}} test binary-28.11 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \xA3\x52\x54\x53 Su* arg1] $arg1 } {1 {41810 21587}} test binary-29.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc i } -result {not enough arguments for all format specifiers} test binary-29.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 i* arg1] $arg1 } {1 {1414767442 67305985}} test binary-29.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 i arg1] $arg1 } {1 1414767442} test binary-29.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 i1 arg1] $arg1 } {1 1414767442} test binary-29.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53 i0 arg1] $arg1 } {1 {}} test binary-29.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 i2 arg1] $arg1 } {1 {1414767442 67305985}} test binary-29.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 i1 arg1] $arg1 } {0 foo} test binary-29.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53\x53\x54 i1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-29.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04\x05 i2c* arg1 arg2] $arg1 $arg2 } {2 {1414767442 67305985} 5} test binary-29.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF iui arg1 arg2] $arg1 $arg2 } {2 4294967295 -1} test binary-29.11 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF iiu arg1 arg2] $arg1 $arg2 } {2 -1 4294967295} test binary-29.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \x80\x00\x00\x00\x00\x00\x00\x80 iuiu arg1 arg2] $arg1 $arg2 } {2 128 2147483648} test binary-30.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc I } -result {not enough arguments for all format specifiers} test binary-30.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 I* arg1] $arg1 } {1 {1386435412 16909060}} test binary-30.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 I arg1] $arg1 } {1 1386435412} test binary-30.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 I1 arg1] $arg1 } {1 1386435412} test binary-30.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53 I0 arg1] $arg1 } {1 {}} test binary-30.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 I2 arg1] $arg1 } {1 {1386435412 16909060}} test binary-30.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 I1 arg1] $arg1 } {0 foo} test binary-30.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53\x53\x54 I1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-30.9 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04\x05 I2c* arg1 arg2] $arg1 $arg2 } {2 {1386435412 16909060} 5} test binary-30.10 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF IuI arg1 arg2] $arg1 $arg2 } {2 4294967295 -1} test binary-30.11 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF IIu arg1 arg2] $arg1 $arg2 } {2 -1 4294967295} test binary-30.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 arg2 list [binary scan \x80\x00\x00\x00\x00\x00\x00\x80 IuIu arg1 arg2] $arg1 $arg2 } {2 2147483648 128} test binary-31.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc f } -result {not enough arguments for all format specifiers} test binary-31.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A f* arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-31.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 f* arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-31.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A f arg1] $arg1 } {1 1.600000023841858} test binary-31.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 f arg1] $arg1 } {1 1.600000023841858} test binary-31.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD f1 arg1] $arg1 } {1 1.600000023841858} test binary-31.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F f1 arg1] $arg1 } {1 1.600000023841858} test binary-31.8 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD f0 arg1] $arg1 } {1 {}} test binary-31.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F f0 arg1] $arg1 } {1 {}} test binary-31.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A f2 arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-31.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 f2 arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-31.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 f1 arg1] $arg1 } {0 foo} test binary-31.13 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x3F\xCC\xCC\xCD f1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-31.14 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A\x05 f2c* arg1 arg2] $arg1 $arg2 } {2 {1.600000023841858 3.4000000953674316} 5} test binary-31.15 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40\x05 f2c* arg1 arg2] $arg1 $arg2 } {2 {1.600000023841858 3.4000000953674316} 5} test binary-32.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc d } -result {not enough arguments for all format specifiers} test binary-32.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 d* arg1] $arg1 } {1 {1.6 3.4}} test binary-32.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 d* arg1] $arg1 } {1 {1.6 3.4}} test binary-32.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 d arg1] $arg1 } {1 1.6} test binary-32.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 d arg1] $arg1 } {1 1.6} test binary-32.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A d1 arg1] $arg1 } {1 1.6} test binary-32.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F d1 arg1] $arg1 } {1 1.6} test binary-32.8 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A d0 arg1] $arg1 } {1 {}} test binary-32.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F d0 arg1] $arg1 } {1 {}} test binary-32.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 d2 arg1] $arg1 } {1 {1.6 3.4}} test binary-32.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 d2 arg1] $arg1 } {1 {1.6 3.4}} test binary-32.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 d1 arg1] $arg1 } {0 foo} test binary-32.13 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A d1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-32.14 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33\x05 d2c* arg1 arg2] $arg1 $arg2 } {2 {1.6 3.4} 5} test binary-32.15 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40\x05 d2c* arg1 arg2] $arg1 $arg2 } {2 {1.6 3.4} 5} test binary-33.1 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 list [binary scan abcdefg a2xa3 arg1 arg2] $arg1 $arg2 } {2 ab def} test binary-33.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3x*a3 arg1 arg2] $arg1 $arg2 } {1 abc foo} test binary-33.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3x20a3 arg1 arg2] $arg1 $arg2 } {1 abc foo} test binary-33.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abc a3x20a3 arg1 arg2] $arg1 $arg2 } {1 abc foo} test binary-33.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x1a1 arg1] $arg1 } {1 b} test binary-33.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x5a1 arg1] $arg1 } {1 f} test binary-33.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x0a1 arg1] $arg1 } {1 a} test binary-34.1 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 list [binary scan abcdefg a2Xa3 arg1 arg2] $arg1 $arg2 } {2 ab bcd} test binary-34.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3X*a3 arg1 arg2] $arg1 $arg2 } {2 abc abc} test binary-34.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3X20a3 arg1 arg2] $arg1 $arg2 } {2 abc abc} test binary-34.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abc X20a3 arg1] $arg1 } {1 abc} test binary-34.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x*X1a1 arg1] $arg1 } {1 f} test binary-34.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x*X5a1 arg1] $arg1 } {1 b} test binary-34.7 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x3X0a1 arg1] $arg1 } {1 d} test binary-35.1 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 unset -nocomplain arg2 } -returnCodes error -body { binary scan abcdefg a2@a3 arg1 arg2 } -result {missing count for "@" field specifier} test binary-35.2 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3@*a3 arg1 arg2] $arg1 $arg2 } {1 abc foo} test binary-35.3 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 unset -nocomplain arg2 set arg2 foo list [binary scan abcdefg a3@20a3 arg1 arg2] $arg1 $arg2 } {1 abc foo} test binary-35.4 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef @2a3 arg1] $arg1 } {1 cde} test binary-35.5 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x*@1a1 arg1] $arg1 } {1 b} test binary-35.6 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 list [binary scan abcdef x*@0a1 arg1] $arg1 } {1 a} test binary-36.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abcdef u0a3 } -result {bad field specifier "u"} # GetFormatSpec is pretty thoroughly tested above, but there are a few cases # we should text explicitly test binary-37.1 {GetFormatSpec: whitespace} { binary format "a3 a5 a3" foo barblat baz } foobarblbaz test binary-37.2 {GetFormatSpec: whitespace} { binary format " " foo } {} test binary-37.3 {GetFormatSpec: whitespace} { binary format " a3" foo } foo test binary-37.4 {GetFormatSpec: whitespace} { binary format "" foo } {} test binary-37.5 {GetFormatSpec: whitespace} { binary format "" foo } {} test binary-37.6 {GetFormatSpec: whitespace} { binary format " a3 " foo } foo test binary-37.7 {GetFormatSpec: numbers} -returnCodes error -body { binary scan abcdef "x-1" foo } -result {bad field specifier "-"} test binary-37.8 {GetFormatSpec: numbers} { unset -nocomplain arg1 set arg1 foo list [binary scan abcdef "a0x3" arg1] $arg1 } {1 {}} test binary-37.9 {GetFormatSpec: numbers} { # test format of neg numbers # bug report/fix provided by Harald Kirsch set x [binary format f* {1 -1 2 -2 0}] binary scan $x f* bla set bla } {1.0 -1.0 2.0 -2.0 0.0} test binary-37.10 {GetFormatSpec: count overflow} { binary scan x a[format %ld 0x7fffffff] r } 0 test binary-37.11 {GetFormatSpec: count overflow} { binary scan x a[format %ld 0x10000000] r } 0 test binary-37.12 {GetFormatSpec: count overflow} { binary scan x a[format %ld 0x100000000] r } 0 test binary-37.13 {GetFormatSpec: count overflow} { binary scan x a[format %lld 0x10000000000000000] r } 0 test binary-38.1 {FormatNumber: word alignment} { set x [binary format c1s1 1 1] } \x01\x01\x00 test binary-38.2 {FormatNumber: word alignment} { set x [binary format c1S1 1 1] } \x01\x00\x01 test binary-38.3 {FormatNumber: word alignment} { set x [binary format c1i1 1 1] } \x01\x01\x00\x00\x00 test binary-38.4 {FormatNumber: word alignment} { set x [binary format c1I1 1 1] } \x01\x00\x00\x00\x01 test binary-38.5 {FormatNumber: word alignment} bigEndian { set x [binary format c1d1 1 1.6] } \x01\x3F\xF9\x99\x99\x99\x99\x99\x9A test binary-38.6 {FormatNumber: word alignment} littleEndian { set x [binary format c1d1 1 1.6] } \x01\x9A\x99\x99\x99\x99\x99\xF9\x3F test binary-38.7 {FormatNumber: word alignment} bigEndian { set x [binary format c1f1 1 1.6] } \x01\x3F\xCC\xCC\xCD test binary-38.8 {FormatNumber: word alignment} littleEndian { set x [binary format c1f1 1 1.6] } \x01\xCD\xCC\xCC\x3F test binary-39.1 {ScanNumber: sign extension} { unset -nocomplain arg1 list [binary scan \x52\xA3 c2 arg1] $arg1 } {1 {82 -93}} test binary-39.2 {ScanNumber: sign extension} { unset -nocomplain arg1 list [binary scan \x01\x02\x01\x81\x82\x01\x81\x82 s4 arg1] $arg1 } {1 {513 -32511 386 -32127}} test binary-39.3 {ScanNumber: sign extension} { unset -nocomplain arg1 list [binary scan \x01\x02\x01\x81\x82\x01\x81\x82 S4 arg1] $arg1 } {1 {258 385 -32255 -32382}} test binary-39.4 {ScanNumber: sign extension} { unset -nocomplain arg1 list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 i5 arg1] $arg1 } {1 {33620225 16843137 16876033 25297153 -2130640639}} test binary-39.5 {ScanNumber: sign extension} { unset -nocomplain arg1 list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 I5 arg1] $arg1 } {1 {16843010 -2130640639 25297153 16876033 16843137}} test binary-39.6 {ScanNumber: no sign extension} { unset -nocomplain arg1 list [binary scan \x52\xA3 cu2 arg1] $arg1 } {1 {82 163}} test binary-39.7 {ScanNumber: no sign extension} { unset -nocomplain arg1 list [binary scan \x01\x02\x01\x81\x82\x01\x81\x82 su4 arg1] $arg1 } {1 {513 33025 386 33409}} test binary-39.8 {ScanNumber: no sign extension} { unset -nocomplain arg1 list [binary scan \x01\x02\x01\x81\x82\x01\x81\x82 Su4 arg1] $arg1 } {1 {258 385 33281 33154}} test binary-39.9 {ScanNumber: no sign extension} { unset -nocomplain arg1 list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 iu5 arg1] $arg1 } {1 {33620225 16843137 16876033 25297153 2164326657}} test binary-39.10 {ScanNumber: no sign extension} { unset -nocomplain arg1 list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 Iu5 arg1] $arg1 } {1 {16843010 2164326657 25297153 16876033 16843137}} test binary-40.3 {ScanNumber: NaN} -body { unset -nocomplain arg1 list [binary scan \xFF\xFF\xFF\xFF f1 arg1] $arg1 } -match glob -result {1 -NaN*} test binary-40.4 {ScanNumber: NaN} -body { unset -nocomplain arg1 list [binary scan \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF d arg1] $arg1 } -match glob -result {1 -NaN*} test binary-41.1 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -body { list [binary scan \x01\x01\x00 c1s1 arg1 arg2] $arg1 $arg2 } -result {2 1 1} test binary-41.2 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -body { list [binary scan \x01\x00\x01 c1S1 arg1 arg2] $arg1 $arg2 } -result {2 1 1} test binary-41.3 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -body { list [binary scan \x01\x01\x00\x00\x00 c1i1 arg1 arg2] $arg1 $arg2 } -result {2 1 1} test binary-41.4 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -body { list [binary scan \x01\x00\x00\x00\x01 c1I1 arg1 arg2] $arg1 $arg2 } -result {2 1 1} test binary-41.5 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -constraints bigEndian -body { list [binary scan \x01\x3F\xCC\xCC\xCD c1f1 arg1 arg2] $arg1 $arg2 } -result {2 1 1.600000023841858} test binary-41.6 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -constraints littleEndian -body { list [binary scan \x01\xCD\xCC\xCC\x3F c1f1 arg1 arg2] $arg1 $arg2 } -result {2 1 1.600000023841858} test binary-41.7 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -constraints bigEndian -body { list [binary scan \x01\x3F\xF9\x99\x99\x99\x99\x99\x9A c1d1 arg1 arg2] $arg1 $arg2 } -result {2 1 1.6} test binary-41.8 {ScanNumber: word alignment} -setup { unset -nocomplain arg1 arg2 } -constraints littleEndian -body { list [binary scan \x01\x9A\x99\x99\x99\x99\x99\xF9\x3F c1d1 arg1 arg2] $arg1 $arg2 } -result {2 1 1.6} test binary-42.1 {Tcl_BinaryObjCmd: bad arguments} -constraints {} -body { binary ? } -returnCodes error -match glob -result {unknown or ambiguous subcommand "?": *} # Wide int (guaranteed at least 64-bit) handling test binary-43.1 {Tcl_BinaryObjCmd: format wide int} {} { binary format w 7810179016327718216 } HelloTcl test binary-43.2 {Tcl_BinaryObjCmd: format wide int} {} { binary format W 7810179016327718216 } lcTolleH test binary-43.5 {Tcl_BinaryObjCmd: scan wide int} {} { unset -nocomplain arg1 list [binary scan \x80[string repeat \x00 7] W arg1] $arg1 } {1 -9223372036854775808} test binary-43.6 {Tcl_BinaryObjCmd: scan unsigned wide int} {} { unset -nocomplain arg1 list [binary scan \x80[string repeat \x00 7] Wu arg1] $arg1 } {1 9223372036854775808} test binary-43.7 {Tcl_BinaryObjCmd: scan unsigned wide int} {} { unset -nocomplain arg1 list [binary scan [string repeat \x00 7]\x80 wu arg1] $arg1 } {1 9223372036854775808} test binary-43.8 {Tcl_BinaryObjCmd: scan unsigned wide int} {} { unset -nocomplain arg1 arg2 list [binary scan \x80[string repeat \x00 7]\x80[string repeat \x00 7] WuW arg1 arg2] $arg1 $arg2 } {2 9223372036854775808 -9223372036854775808} test binary-43.9 {Tcl_BinaryObjCmd: scan unsigned wide int} {} { unset -nocomplain arg1 arg2 list [binary scan [string repeat \x00 7]\x80[string repeat \x00 7]\x80 wuw arg1 arg2] $arg1 $arg2 } {2 9223372036854775808 -9223372036854775808} test binary-44.1 {Tcl_BinaryObjCmd: scan wide int} {} { binary scan HelloTcl W x set x } 5216694956358656876 test binary-44.2 {Tcl_BinaryObjCmd: scan wide int} {} { binary scan lcTolleH w x set x } 5216694956358656876 test binary-44.3 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} {} { binary scan [binary format w [expr {wide(3) << 31}]] w x set x } 6442450944 test binary-44.4 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} {} { binary scan [binary format W [expr {wide(3) << 31}]] W x set x } 6442450944 test binary-44.5 {Tcl_BinaryObjCmd: scan wide int with bit 31 and 64 set} {} { binary scan [binary format w [expr {(wide(3) << 31) + (wide(3) << 64)}]] w x set x } 6442450944 test binary-44.6 {Tcl_BinaryObjCmd: scan wide int with bit 31 and 64 set} {} { binary scan [binary format W [expr {(wide(3) << 31) + (wide(3) << 64)}]] W x set x } 6442450944 test binary-45.1 {Tcl_BinaryObjCmd: combined wide int handling} { binary scan [binary format sws 16450 -1 19521] c* x set x } {66 64 -1 -1 -1 -1 -1 -1 -1 -1 65 76} test binary-45.2 {Tcl_BinaryObjCmd: combined wide int handling} { binary scan [binary format sWs 16450 0x7fffffff 19521] c* x set x } {66 64 0 0 0 0 127 -1 -1 -1 65 76} test binary-46.1 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { binary format a* € } \xAC test binary-46.2 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { list [binary scan [binary format a* €₽] s x] $x } {1 -16980} test binary-46.3 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { set x {} set y {} set z {} list [binary scan [binary format a* €₽] aaa x y z] $x $y $z } "2 \xAC \xBD {}" test binary-46.4 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { set x [encoding convertto iso8859-15 €] set y [binary format a* $x] list $x $y } "\xA4 \xA4" test binary-46.5 {Tcl_BinaryObjCmd: handling of non-ISO8859-1 chars} { set x [binary scan \xA4 a* y] list $x $y [encoding convertfrom iso8859-15 $y] } "1 \xA4 €" test binary-47.1 {Tcl_BinaryObjCmd: number cache reference count handling} { # This test is only reliable when memory debugging is turned on, but # without even memory debugging it should still generate the expected # answers and might therefore still pick up memory corruption caused by # [Bug 851747]. list [binary scan aba ccc x x x] $x } {3 97} ### TIP#129: endian specifiers ---- # format t test binary-48.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format t } -result {not enough arguments for all format specifiers} test binary-48.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format t blat } -result {expected integer but got "blat"} test binary-48.3 {Tcl_BinaryObjCmd: format} { binary format S0 0x50 } {} test binary-48.4 {Tcl_BinaryObjCmd: format} bigEndian { binary format t 0x50 } \x00P test binary-48.5 {Tcl_BinaryObjCmd: format} littleEndian { binary format t 0x50 } P\x00 test binary-48.6 {Tcl_BinaryObjCmd: format} bigEndian { binary format t 0x5052 } PR test binary-48.7 {Tcl_BinaryObjCmd: format} littleEndian { binary format t 0x5052 } RP test binary-48.8 {Tcl_BinaryObjCmd: format} bigEndian { binary format t 0x505251 0x53 } RQ test binary-48.9 {Tcl_BinaryObjCmd: format} littleEndian { binary format t 0x505251 0x53 } QR test binary-48.10 {Tcl_BinaryObjCmd: format} bigEndian { binary format t2 {0x50 0x52} } \x00P\x00R test binary-48.11 {Tcl_BinaryObjCmd: format} littleEndian { binary format t2 {0x50 0x52} } P\x00R\x00 test binary-48.12 {Tcl_BinaryObjCmd: format} bigEndian { binary format t* {0x5051 0x52} } PQ\x00R test binary-48.13 {Tcl_BinaryObjCmd: format} littleEndian { binary format t* {0x5051 0x52} } QPR\x00 test binary-48.14 {Tcl_BinaryObjCmd: format} bigEndian { binary format t2 {0x50 0x52 0x53} 0x54 } \x00P\x00R test binary-48.15 {Tcl_BinaryObjCmd: format} littleEndian { binary format t2 {0x50 0x52 0x53} 0x54 } P\x00R\x00 test binary-48.16 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format t2 {0x50} } -result {number of elements in list does not match count} test binary-48.17 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format t $a } -result "expected integer but got a list" test binary-48.18 {Tcl_BinaryObjCmd: format} bigEndian { set a {0x50 0x51} binary format t1 $a } \x00P test binary-48.19 {Tcl_BinaryObjCmd: format} littleEndian { set a {0x50 0x51} binary format t1 $a } P\x00 # format n test binary-49.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format n } -result {not enough arguments for all format specifiers} test binary-49.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format n blat } -result {expected integer but got "blat"} test binary-49.3 {Tcl_BinaryObjCmd: format} { binary format n0 0x50 } {} test binary-49.4 {Tcl_BinaryObjCmd: format} littleEndian { binary format n 0x50 } P\x00\x00\x00 test binary-49.5 {Tcl_BinaryObjCmd: format} littleEndian { binary format n 0x5052 } RP\x00\x00 test binary-49.6 {Tcl_BinaryObjCmd: format} littleEndian { binary format n 0x505251 0x53 } QRP\x00 test binary-49.7 {Tcl_BinaryObjCmd: format} littleEndian { binary format i1 {0x505251 0x53} } QRP\x00 test binary-49.8 {Tcl_BinaryObjCmd: format} littleEndian { binary format n 0x53525150 } PQRS test binary-49.9 {Tcl_BinaryObjCmd: format} littleEndian { binary format n2 {0x50 0x52} } P\x00\x00\x00R\x00\x00\x00 test binary-49.10 {Tcl_BinaryObjCmd: format} littleEndian { binary format n* {0x50515253 0x52} } SRQPR\x00\x00\x00 test binary-49.11 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format n2 {0x50} } -result {number of elements in list does not match count} test binary-49.12 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {0x50 0x51} binary format n $a } -result "expected integer but got a list" test binary-49.13 {Tcl_BinaryObjCmd: format} littleEndian { set a {0x50 0x51} binary format n1 $a } P\x00\x00\x00 test binary-49.14 {Tcl_BinaryObjCmd: format} bigEndian { binary format n 0x50 } \x00\x00\x00P test binary-49.15 {Tcl_BinaryObjCmd: format} bigEndian { binary format n 0x5052 } \x00\x00PR test binary-49.16 {Tcl_BinaryObjCmd: format} bigEndian { binary format n 0x505251 0x53 } \x00PRQ test binary-49.17 {Tcl_BinaryObjCmd: format} bigEndian { binary format i1 {0x505251 0x53} } QRP\x00 test binary-49.18 {Tcl_BinaryObjCmd: format} bigEndian { binary format n 0x53525150 } SRQP test binary-49.19 {Tcl_BinaryObjCmd: format} bigEndian { binary format n2 {0x50 0x52} } \x00\x00\x00P\x00\x00\x00R test binary-49.20 {Tcl_BinaryObjCmd: format} bigEndian { binary format n* {0x50515253 0x52} } PQRS\x00\x00\x00R # format m test binary-50.1 {Tcl_BinaryObjCmd: format wide int} littleEndian { binary format m 7810179016327718216 } HelloTcl test binary-50.2 {Tcl_BinaryObjCmd: format wide int} bigEndian { binary format m 7810179016327718216 } lcTolleH test binary-50.3 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} littleEndian { binary scan [binary format m [expr {wide(3) << 31}]] w x set x } 6442450944 test binary-50.4 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} bigEndian { binary scan [binary format m [expr {wide(3) << 31}]] W x set x } 6442450944 # format Q/q test binary-51.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format Q } -result {not enough arguments for all format specifiers} test binary-51.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format q blat } -result {expected floating-point number but got "blat"} test binary-51.3 {Tcl_BinaryObjCmd: format} { binary format q0 1.6 } {} test binary-51.4 {Tcl_BinaryObjCmd: format} {} { binary format Q 1.6 } \x3F\xF9\x99\x99\x99\x99\x99\x9A test binary-51.5 {Tcl_BinaryObjCmd: format} {} { binary format q 1.6 } \x9A\x99\x99\x99\x99\x99\xF9\x3F test binary-51.6 {Tcl_BinaryObjCmd: format} {} { binary format Q* {1.6 3.4} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-51.7 {Tcl_BinaryObjCmd: format} {} { binary format q* {1.6 3.4} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-51.8 {Tcl_BinaryObjCmd: format} {} { binary format Q2 {1.6 3.4} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-51.9 {Tcl_BinaryObjCmd: format} {} { binary format q2 {1.6 3.4} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-51.10 {Tcl_BinaryObjCmd: format} {} { binary format Q2 {1.6 3.4 5.6} } \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 test binary-51.11 {Tcl_BinaryObjCmd: format} {} { binary format q2 {1.6 3.4 5.6} } \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 test binary-51.14 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format q2 {1.6} } -result {number of elements in list does not match count} test binary-51.15 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {1.6 3.4} binary format q $a } -result "expected floating-point number but got a list" test binary-51.16 {Tcl_BinaryObjCmd: format} {} { set a {1.6 3.4} binary format Q1 $a } \x3F\xF9\x99\x99\x99\x99\x99\x9A test binary-51.17 {Tcl_BinaryObjCmd: format} {} { set a {1.6 3.4} binary format q1 $a } \x9A\x99\x99\x99\x99\x99\xF9\x3F # format R/r test binary-53.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format r } -result {not enough arguments for all format specifiers} test binary-53.2 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format r blat } -result {expected floating-point number but got "blat"} test binary-53.3 {Tcl_BinaryObjCmd: format} { binary format f0 1.6 } {} test binary-53.4 {Tcl_BinaryObjCmd: format} {} { binary format R 1.6 } \x3F\xCC\xCC\xCD test binary-53.5 {Tcl_BinaryObjCmd: format} {} { binary format r 1.6 } \xCD\xCC\xCC\x3F test binary-53.6 {Tcl_BinaryObjCmd: format} {} { binary format R* {1.6 3.4} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-53.7 {Tcl_BinaryObjCmd: format} {} { binary format r* {1.6 3.4} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-53.8 {Tcl_BinaryObjCmd: format} {} { binary format R2 {1.6 3.4} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-53.9 {Tcl_BinaryObjCmd: format} {} { binary format r2 {1.6 3.4} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-53.10 {Tcl_BinaryObjCmd: format} {} { binary format R2 {1.6 3.4 5.6} } \x3F\xCC\xCC\xCD\x40\x59\x99\x9A test binary-53.11 {Tcl_BinaryObjCmd: format} {} { binary format r2 {1.6 3.4 5.6} } \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 test binary-53.12 {Tcl_BinaryObjCmd: float overflow} {} { binary format R -3.402825e+38 } \xFF\x80\x00\x00 test binary-53.13 {Tcl_BinaryObjCmd: float overflow} {} { binary format r -3.402825e+38 } \x00\x00\x80\xFF test binary-53.14 {Tcl_BinaryObjCmd: float underflow} {} { binary format R -3.402825e-100 } \x80\x00\x00\x00 test binary-53.15 {Tcl_BinaryObjCmd: float underflow} {} { binary format r -3.402825e-100 } \x00\x00\x00\x80 test binary-53.16 {Tcl_BinaryObjCmd: format} -returnCodes error -body { binary format r2 {1.6} } -result {number of elements in list does not match count} test binary-53.17 {Tcl_BinaryObjCmd: format} -returnCodes error -body { set a {1.6 3.4} binary format r $a } -result "expected floating-point number but got a list" test binary-53.18 {Tcl_BinaryObjCmd: format} {} { set a {1.6 3.4} binary format R1 $a } \x3F\xCC\xCC\xCD test binary-53.19 {Tcl_BinaryObjCmd: format} {} { set a {1.6 3.4} binary format r1 $a } \xCD\xCC\xCC\x3F test binary-53.20 {Tcl_BinaryObjCmd: float Inf} {} { binary format R Inf } \x7F\x80\x00\x00 test binary-53.21 {Tcl_BinaryObjCmd: float Inf} {} { binary format r Inf } \x00\x00\x80\x7F test binary-53.22 {Binary float Inf round trip} -body { binary scan [binary format R Inf] R inf binary scan [binary format R -Inf] R inf_ list $inf $inf_ } -result {Inf -Inf} test binary-53.23 {Binary float round to FLT_MAX} -body { binary scan [binary format H* 7f7fffff] R fltmax binary scan [binary format H* 47effffff0000000] Q round_to_fltmax binary scan [binary format R $round_to_fltmax] R fltmax1 expr {$fltmax eq $fltmax1} } -result 1 test binary-53.24 {Binary float round to -FLT_MAX} -body { binary scan [binary format H* ff7fffff] R fltmax binary scan [binary format H* c7effffff0000000] Q round_to_fltmax binary scan [binary format R $round_to_fltmax] R fltmax1 expr {$fltmax eq $fltmax1} } -result 1 test binary-53.25 {Binary float round to Inf} -body { binary scan [binary format H* 47effffff0000001] Q round_to_inf binary scan [binary format R $round_to_inf] R inf1 expr {$inf1 eq Inf} } -result 1 test binary-53.26 {Binary float round to -Inf} -body { binary scan [binary format H* c7effffff0000001] Q round_to_inf binary scan [binary format R $round_to_inf] R inf1 expr {$inf1 eq -Inf} } -result 1 # scan t (s) test binary-54.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc t } -result {not enough arguments for all format specifiers} test binary-54.2 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t* arg1] $arg1 } {1 {-23726 21587}} test binary-54.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t arg1] $arg1 } {1 -23726} test binary-54.4 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3 t1 arg1] $arg1 } {1 -23726} test binary-54.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3 t0 arg1] $arg1 } {1 {}} test binary-54.6 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t2 arg1] $arg1 } {1 {-23726 21587}} test binary-54.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 t1 arg1] $arg1 } {0 foo} test binary-54.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 t1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-54.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x05 t2c* arg1 arg2] $arg1 $arg2 } {2 {-23726 21587} 5} test binary-54.10 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x00\x80\x00\x80 tut arg1 arg2] $arg1 $arg2 } {2 32768 -32768} test binary-54.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x00\x80\x00\x80 ttu arg1 arg2] $arg1 $arg2 } {2 -32768 32768} # scan t (b) test binary-55.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc t } -result {not enough arguments for all format specifiers} test binary-55.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t* arg1] $arg1 } {1 {21155 21332}} test binary-55.3 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t arg1] $arg1 } {1 21155} test binary-55.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3 t1 arg1] $arg1 } {1 21155} test binary-55.5 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3 t0 arg1] $arg1 } {1 {}} test binary-55.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 t2 arg1] $arg1 } {1 {21155 21332}} test binary-55.7 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 t1 arg1] $arg1 } {0 foo} test binary-55.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53 t1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-55.9 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x05 t2c* arg1 arg2] $arg1 $arg2 } {2 {21155 21332} 5} test binary-55.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x00\x80\x00 tut arg1 arg2] $arg1 $arg2 } {2 32768 -32768} test binary-55.11 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x00\x80\x00 ttu arg1 arg2] $arg1 $arg2 } {2 -32768 32768} # scan n (s) test binary-56.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc n } -result {not enough arguments for all format specifiers} test binary-56.2 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n* arg1] $arg1 } {1 {1414767442 67305985}} test binary-56.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n arg1] $arg1 } {1 1414767442} test binary-56.4 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 n1 arg1] $arg1 } {1 1414767442} test binary-56.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53 n0 arg1] $arg1 } {1 {}} test binary-56.6 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n2 arg1] $arg1 } {1 {1414767442 67305985}} test binary-56.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 n1 arg1] $arg1 } {0 foo} test binary-56.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53\x53\x54 n1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-56.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04\x05 n2c* arg1 arg2] $arg1 $arg2 } {2 {1414767442 67305985} 5} test binary-56.10 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x00\x00\x00\x80\x00\x00\x00 nun arg1 arg2] $arg1 $arg2 } {2 128 128} test binary-56.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x00\x00\x00\x80\x00\x00\x00\x80 nun arg1 arg2] $arg1 $arg2 } {2 2147483648 -2147483648} # scan n (b) test binary-57.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc n } -result {not enough arguments for all format specifiers} test binary-57.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n* arg1] $arg1 } {1 {1386435412 16909060}} test binary-57.3 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n arg1] $arg1 } {1 1386435412} test binary-57.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54 n1 arg1] $arg1 } {1 1386435412} test binary-57.5 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53 n0 arg1] $arg1 } {1 {}} test binary-57.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04 n2 arg1] $arg1 } {1 {1386435412 16909060}} test binary-57.7 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 n1 arg1] $arg1 } {0 foo} test binary-57.8 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x52\x53\x53\x54 n1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-57.9 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x52\xA3\x53\x54\x01\x02\x03\x04\x05 n2c* arg1 arg2] $arg1 $arg2 } {2 {1386435412 16909060} 5} test binary-57.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x80\x00\x00\x00\x80\x00\x00\x00 nun arg1 arg2] $arg1 $arg2 } {2 2147483648 -2147483648} test binary-57.11 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x00\x00\x00\x80\x00\x00\x00\x80 nun arg1 arg2] $arg1 $arg2 } {2 128 128} # scan Q/q test binary-58.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc q } -result {not enough arguments for all format specifiers} test binary-58.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 Q* arg1] $arg1 } {1 {1.6 3.4}} test binary-58.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 q* arg1] $arg1 } {1 {1.6 3.4}} test binary-58.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 Q arg1] $arg1 } {1 1.6} test binary-58.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 q arg1] $arg1 } {1 1.6} test binary-58.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A Q1 arg1] $arg1 } {1 1.6} test binary-58.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F q1 arg1] $arg1 } {1 1.6} test binary-58.8 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A Q0 arg1] $arg1 } {1 {}} test binary-58.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F q0 arg1] $arg1 } {1 {}} test binary-58.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33 Q2 arg1] $arg1 } {1 {1.6 3.4}} test binary-58.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40 q2 arg1] $arg1 } {1 {1.6 3.4}} test binary-58.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 q1 arg1] $arg1 } {0 foo} test binary-58.13 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A q1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-58.14 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x3F\xF9\x99\x99\x99\x99\x99\x9A\x40\x0B\x33\x33\x33\x33\x33\x33\x05 Q2c* arg1 arg2] $arg1 $arg2 } {2 {1.6 3.4} 5} test binary-58.15 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x9A\x99\x99\x99\x99\x99\xF9\x3F\x33\x33\x33\x33\x33\x33\x0B\x40\x05 q2c* arg1 arg2] $arg1 $arg2 } {2 {1.6 3.4} 5} # scan R/r test binary-59.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body { binary scan abc r } -result {not enough arguments for all format specifiers} test binary-59.2 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A R* arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-59.3 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 r* arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-59.4 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A R arg1] $arg1 } {1 1.600000023841858} test binary-59.5 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 r arg1] $arg1 } {1 1.600000023841858} test binary-59.6 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD R1 arg1] $arg1 } {1 1.600000023841858} test binary-59.7 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F r1 arg1] $arg1 } {1 1.600000023841858} test binary-59.8 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD R0 arg1] $arg1 } {1 {}} test binary-59.9 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F r0 arg1] $arg1 } {1 {}} test binary-59.10 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A R2 arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-59.11 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40 r2 arg1] $arg1 } {1 {1.600000023841858 3.4000000953674316}} test binary-59.12 {Tcl_BinaryObjCmd: scan} { unset -nocomplain arg1 set arg1 foo list [binary scan \x52 r1 arg1] $arg1 } {0 foo} test binary-59.13 {Tcl_BinaryObjCmd: scan} -setup { unset -nocomplain arg1 } -returnCodes error -body { set arg1 1 binary scan \x3F\xCC\xCC\xCD r1 arg1(a) } -result {can't set "arg1(a)": variable isn't array} test binary-59.14 {Tcl_BinaryObjCmd: scan} bigEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \x3F\xCC\xCC\xCD\x40\x59\x99\x9A\x05 R2c* arg1 arg2] $arg1 $arg2 } {2 {1.600000023841858 3.4000000953674316} 5} test binary-59.15 {Tcl_BinaryObjCmd: scan} littleEndian { unset -nocomplain arg1 arg2 set arg1 foo set arg2 bar list [binary scan \xCD\xCC\xCC\x3F\x9A\x99\x59\x40\x05 r2c* arg1 arg2] $arg1 $arg2 } {2 {1.600000023841858 3.4000000953674316} 5} test binary-60.1 {[binary format] with NaN} -body { binary scan [binary format dqQfrR NaN NaN NaN NaN NaN NaN] dqQfrR \ v1 v2 v3 v4 v5 v6 list $v1 $v2 $v3 $v4 $v5 $v6 } -match regexp -result {NaN(\([[:xdigit:]]+\))? NaN(\([[:xdigit:]]+\))? NaN(\([[:xdigit:]]+\))? NaN(\([[:xdigit:]]+\))? NaN(\([[:xdigit:]]+\))? NaN(\([[:xdigit:]]+\))?} # scan m test binary-61.1 {Tcl_BinaryObjCmd: scan wide int} bigEndian { binary scan HelloTcl m x set x } 5216694956358656876 test binary-61.2 {Tcl_BinaryObjCmd: scan wide int} littleEndian { binary scan lcTolleH m x set x } 5216694956358656876 test binary-61.3 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} littleEndian { binary scan [binary format w [expr {wide(3) << 31}]] m x set x } 6442450944 test binary-61.4 {Tcl_BinaryObjCmd: scan wide int with bit 31 set} bigEndian { binary scan [binary format W [expr {wide(3) << 31}]] m x set x } 6442450944 # scan/format infinities test binary-62.1 {infinity} ieeeFloatingPoint { binary scan [binary format q Infinity] w w format 0x%016lx $w } 0x7ff0000000000000 test binary-62.2 {infinity} ieeeFloatingPoint { binary scan [binary format q -Infinity] w w format 0x%016lx $w } 0xfff0000000000000 test binary-62.3 {infinity} ieeeFloatingPoint { binary scan [binary format q Inf] w w format 0x%016lx $w } 0x7ff0000000000000 test binary-62.4 {infinity} ieeeFloatingPoint { binary scan [binary format q -Infinity] w w format 0x%016lx $w } 0xfff0000000000000 test binary-62.5 {infinity} ieeeFloatingPoint { binary scan [binary format w 0x7FF0000000000000] q d set d } Inf test binary-62.6 {infinity} ieeeFloatingPoint { binary scan [binary format w 0xFFF0000000000000] q d set d } -Inf test binary-62.7 {infinity} ieeeFloatingPoint { binary scan [binary format r Inf] iu i format 0x%08x $i } 0x7f800000 test binary-62.8 {infinity} ieeeFloatingPoint { binary scan [binary format r -Inf] iu i format 0x%08x $i } 0xff800000 test binary-62.9 {infinity} ieeeFloatingPoint { binary scan [binary format i 0x7F800000] r d set d } Inf test binary-62.10 {infinity} ieeeFloatingPoint { binary scan [binary format i 0xFF800000] r d set d } -Inf # scan/format Not-a-Number test binary-63.1 {NaN} ieeeFloatingPoint { binary scan [binary format q NaN] w w format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}] } 0x7ff0000000000000 test binary-63.2 {NaN} ieeeFloatingPoint { binary scan [binary format q -NaN] w w format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}] } 0xfff0000000000000 test binary-63.3 {NaN} ieeeFloatingPoint { binary scan [binary format q NaN(3123456789aBc)] w w format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}] } 0x7ff3123456789abc test binary-63.4 {NaN} ieeeFloatingPoint { binary scan [binary format q {NaN( 3123456789aBc)}] w w format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}] } 0x7ff3123456789abc # Make sure TclParseNumber() rejects invalid nan-hex formats [Bug 3402540] test binary-63.5 {NaN} -constraints ieeeFloatingPoint -body { binary format q Nan( } -returnCodes error -match glob -result {expected floating-point number*} test binary-63.6 {NaN} -constraints ieeeFloatingPoint -body { binary format q Nan() } -returnCodes error -match glob -result {expected floating-point number*} test binary-63.7 {NaN} -constraints ieeeFloatingPoint -body { binary format q Nan(g) } -returnCodes error -match glob -result {expected floating-point number*} test binary-63.8 {NaN} -constraints ieeeFloatingPoint -body { binary format q Nan(1,2) } -returnCodes error -match glob -result {expected floating-point number*} test binary-63.9 {NaN} -constraints ieeeFloatingPoint -body { binary format q Nan(1234567890abcd) } -returnCodes error -match glob -result {expected floating-point number*} test binary-64.1 {NaN} -constraints ieeeFloatingPoint -body { binary scan [binary format w 0x7ff8000000000000] q d set d } -match glob -result NaN* test binary-64.2 {NaN} -constraints ieeeFloatingPoint -body { binary scan [binary format w 0x7ff0123456789aBc] q d set d } -match glob -result NaN(*123456789abc) test binary-65.1 {largest significand} ieeeFloatingPoint { binary scan [binary format w 0x3fcfffffffffffff] q d set d } 0.24999999999999997 test binary-65.2 {smallest significand} ieeeFloatingPoint { binary scan [binary format w 0x3fd0000000000000] q d set d } 0.25 test binary-65.3 {largest significand} ieeeFloatingPoint { binary scan [binary format w 0x3fdfffffffffffff] q d set d } 0.49999999999999994 test binary-65.4 {smallest significand} ieeeFloatingPoint { binary scan [binary format w 0x3fe0000000000000] q d set d } 0.5 test binary-65.5 {largest significand} ieeeFloatingPoint { binary scan [binary format w 0x3fffffffffffffff] q d set d } 1.9999999999999998 test binary-65.6 {smallest significand} ieeeFloatingPoint { binary scan [binary format w 0x4000000000000000] q d set d } 2.0 test binary-65.7 {smallest significand} ieeeFloatingPoint { binary scan [binary format w 0x434fffffffffffff] q d set d } 18014398509481982.0 test binary-65.8 {largest significand} ieeeFloatingPoint { binary scan [binary format w 0x4350000000000000] q d set d } 18014398509481984.0 test binary-65.9 {largest significand} ieeeFloatingPoint { binary scan [binary format w 0x4350000000000001] q d set d } 18014398509481988.0 test binary-70.1 {binary encode hex} -body { binary encode hex } -returnCodes error -match glob -result "wrong # args: *" test binary-70.2 {binary encode hex} -body { binary encode hex a } -result {61} test binary-70.3 {binary encode hex} -body { binary encode hex {} } -result {} test binary-70.4 {binary encode hex} -body { binary encode hex [string repeat a 20] } -result [string repeat 61 20] test binary-70.5 {binary encode hex} -body { binary encode hex \x00\x01\x02\x03\x04\x00\x01\x02\x03\x04 } -result {00010203040001020304} test binary-71.1 {binary decode hex} -body { binary decode hex } -returnCodes error -match glob -result "wrong # args: *" test binary-71.2 {binary decode hex} -body { binary decode hex 61 } -result {a} test binary-71.3 {binary decode hex} -body { binary decode hex {} } -result {} test binary-71.4 {binary decode hex} -body { binary decode hex [string repeat 61 20] } -result [string repeat a 20] test binary-71.5 {binary decode hex} -body { binary decode hex 00010203040001020304 } -result "\x00\x01\x02\x03\x04\x00\x01\x02\x03\x04" test binary-71.6 {binary decode hex} -body { binary decode hex "61 61" } -result {aa} test binary-71.7 {binary decode hex} -body { binary decode hex "61\n\n\n61" } -result {aa} test binary-71.8 {binary decode hex} -match glob -body { binary decode hex -strict "61 61" } -returnCodes error -result {invalid hexadecimal digit " " * at position 2} test binary-71.9 {binary decode hex} -body { set r [binary decode hex "6"] list [string length $r] $r } -result {0 {}} test binary-71.10 {binary decode hex} -body { string length [binary decode hex " "] } -result 0 test binary-71.11 {binary decode hex: Bug b98fa55285} -body { apply {{} { set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c26\n" set decoded [binary decode hex $str] list [string length $decoded] [scan [string index $decoded end] %c] }} } -result {29 38} test binary-71.12 {binary decode hex: Bug b98fa55285 cross check} -body { apply {{} { set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n" set decoded [binary decode hex $str] list [string length $decoded] [scan [string index $decoded end] %c] }} } -result {28 140} test binary-71.13 {binary decode hex: Bug b98fa55285 cross check} -body { apply {{} { set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n\n" set decoded [binary decode hex $str] list [string length $decoded] [scan [string index $decoded end] %c] }} } -result {28 140} test binary-71.14 {binary decode hex: Bug b98fa55285 cross check} -body { apply {{} { set str "137b6f95e7519389e7c4b36599781e2ccf492699649249aae43fbe8c2\n\n\n" set decoded [binary decode hex $str] list [string length $decoded] [scan [string index $decoded end] %c] }} } -result {28 140} test binary-72.1 {binary encode base64} -body { binary encode base64 } -returnCodes error -match glob -result "wrong # args: *" test binary-72.2 {binary encode base64} -body { binary encode base64 abc } -result {YWJj} test binary-72.3 {binary encode base64} -body { binary encode base64 {} } -result {} test binary-72.4 {binary encode base64} -body { binary encode base64 [string repeat abc 20] } -result [string repeat YWJj 20] test binary-72.5 {binary encode base64} -body { binary encode base64 \x00\x01\x02\x03\x04\x00\x01\x02\x03 } -result {AAECAwQAAQID} test binary-72.6 {binary encode base64} -body { binary encode base64 \x00 } -result {AA==} test binary-72.7 {binary encode base64} -body { binary encode base64 \x00\x00 } -result {AAA=} test binary-72.8 {binary encode base64} -body { binary encode base64 \x00\x00\x00 } -result {AAAA} test binary-72.9 {binary encode base64} -body { binary encode base64 \x00\x00\x00\x00 } -result {AAAAAA==} test binary-72.10 {binary encode base64} -body { binary encode base64 -maxlen 0 -wrapchar : abcabcabc } -result {YWJjYWJjYWJj} test binary-72.11 {binary encode base64} -body { binary encode base64 -maxlen 1 -wrapchar : abcabcabc } -result {Y:W:J:j:Y:W:J:j:Y:W:J:j} test binary-72.12 {binary encode base64} -body { binary encode base64 -maxlen 2 -wrapchar : abcabcabc } -result {YW:Jj:YW:Jj:YW:Jj} test binary-72.13 {binary encode base64} -body { binary encode base64 -maxlen 3 -wrapchar : abcabcabc } -result {YWJ:jYW:JjY:WJj} test binary-72.14 {binary encode base64} -body { binary encode base64 -maxlen 4 -wrapchar : abcabcabc } -result {YWJj:YWJj:YWJj} test binary-72.15 {binary encode base64} -body { binary encode base64 -maxlen 5 -wrapchar : abcabcabc } -result {YWJjY:WJjYW:Jj} test binary-72.16 {binary encode base64} -body { binary encode base64 -maxlen 6 -wrapchar : abcabcabc } -result {YWJjYW:JjYWJj} test binary-72.17 {binary encode base64} -body { binary encode base64 -maxlen 7 -wrapchar : abcabcabc } -result {YWJjYWJ:jYWJj} test binary-72.18 {binary encode base64} -body { binary encode base64 -maxlen 8 -wrapchar : abcabcabc } -result {YWJjYWJj:YWJj} test binary-72.19 {binary encode base64} -body { binary encode base64 -maxlen 9 -wrapchar : abcabcabc } -result {YWJjYWJjY:WJj} test binary-72.20 {binary encode base64} -body { binary encode base64 -maxlen 10 -wrapchar : abcabcabc } -result {YWJjYWJjYW:Jj} test binary-72.21 {binary encode base64} -body { binary encode base64 -maxlen 11 -wrapchar : abcabcabc } -result {YWJjYWJjYWJ:j} test binary-72.22 {binary encode base64} -body { binary encode base64 -maxlen 12 -wrapchar : abcabcabc } -result {YWJjYWJjYWJj} test binary-72.23 {binary encode base64} -body { binary encode base64 -maxlen 13 -wrapchar : abcabcabc } -result {YWJjYWJjYWJj} test binary-72.24 {binary encode base64} -body { binary encode base64 -maxlen 60 -wrapchar : abcabcabc } -result {YWJjYWJjYWJj} test binary-72.25 {binary encode base64} -body { binary encode base64 -maxlen 2 -wrapchar * abcabcabc } -result {YW*Jj*YW*Jj*YW*Jj} test binary-72.26 {binary encode base64} -body { binary encode base64 -maxlen 6 -wrapchar -*- abcabcabc } -result {YWJjYW-*-JjYWJj} test binary-72.27 {binary encode base64} -body { binary encode base64 -maxlen 4 -wrapchar -*- abcabcabc } -result {YWJj-*-YWJj-*-YWJj} test binary-72.28 {binary encode base64} -body { binary encode base64 -maxlen 6 -wrapchar 0123456789 abcabcabc } -result {YWJjYW0123456789JjYWJj} test binary-72.29 {binary encode base64} { string length [binary encode base64 -maxlen 3 -wrapchar \xCA abc] } 5 test binary-72.30 {binary encode base64} { string length [binary encode base64 -maxlen 4294967296 abc] } 4 test binary-72.31 {binary encode base64} -body { string length [binary encode base64 -maxlen 18446744073709551616 abc] } -returnCodes 1 -result {integer value too large to represent} test binary-73.1 {binary decode base64} -body { binary decode base64 } -returnCodes error -match glob -result "wrong # args: *" test binary-73.2 {binary decode base64} -body { binary decode base64 YWJj } -result {abc} test binary-73.3 {binary decode base64} -body { binary decode base64 {} } -result {} test binary-73.4 {binary decode base64} -body { binary decode base64 [string repeat YWJj 20] } -result [string repeat abc 20] test binary-73.5 {binary decode base64} -body { binary decode base64 AAECAwQAAQID } -result "\x00\x01\x02\x03\x04\x00\x01\x02\x03" test binary-73.6 {binary decode base64} -body { binary decode base64 AA== } -result "\x00" test binary-73.7 {binary decode base64} -body { binary decode base64 AAA= } -result "\x00\x00" test binary-73.8 {binary decode base64} -body { binary decode base64 AAAA } -result "\x00\x00\x00" test binary-73.9 {binary decode base64} -body { binary decode base64 AAAAAA== } -result "\x00\x00\x00\x00" test binary-73.10 {binary decode base64} -body { set s "[string repeat YWJj 10]\n[string repeat YWJj 10]" binary decode base64 $s } -result [string repeat abc 20] test binary-73.11 {binary decode base64} -body { set s "[string repeat YWJj 10]\n [string repeat YWJj 10]" binary decode base64 $s } -result [string repeat abc 20] test binary-73.12 {binary decode base64} -body { binary decode base64 -strict ":YWJj" } -returnCodes error -match glob -result {invalid base64 character ":" * at position 0} test binary-73.13 {binary decode base64} -body { set s "[string repeat YWJj 10]:[string repeat YWJj 10]" binary decode base64 -strict $s } -returnCodes error -match glob -result {invalid base64 character ":" * at position 40} test binary-73.14 {binary decode base64} -body { set s "[string repeat YWJj 10]\n [string repeat YWJj 10]" binary decode base64 -strict $s } -returnCodes error -match glob -result {invalid base64 character *} test binary-73.20 {binary decode base64} -body { set r [binary decode base64 Y] list [string length $r] $r } -result {0 {}} test binary-73.21 {binary decode base64} -body { set r [binary decode base64 YW] list [string length $r] $r } -result {1 a} test binary-73.22 {binary decode base64} -body { set r [binary decode base64 YWJ] list [string length $r] $r } -result {2 ab} test binary-73.23 {binary decode base64} -body { set r [binary decode base64 YWJj] list [string length $r] $r } -result {3 abc} test binary-73.24 {binary decode base64} -body { string length [binary decode base64 " "] } -result 0 test binary-73.25 {binary decode base64} -body { list [string length [set r [binary decode base64 WA==\n]]] $r } -result {1 X} test binary-73.26 {binary decode base64} -body { list [string length [set r [binary decode base64 WFk=\n]]] $r } -result {2 XY} test binary-73.27 {binary decode base64} -body { list [string length [set r [binary decode base64 WFla\n]]] $r } -result {3 XYZ} test binary-73.28 {binary decode base64} -body { list [string length [set r [binary decode base64 -strict WA==\n]]] $r } -returnCodes error -match glob -result {invalid base64 character *} test binary-73.29 {binary decode base64} -body { list [string length [set r [binary decode base64 -strict WFk=\n]]] $r } -returnCodes error -match glob -result {invalid base64 character *} test binary-73.30 {binary decode base64} -body { list [string length [set r [binary decode base64 -strict WFla\n]]] $r } -returnCodes error -match glob -result {invalid base64 character *} test binary-73.31 {binary decode base64} -body { list [string length [set r [binary decode base64 -strict WA==WFla]]] $r } -returnCodes error -match glob -result {invalid base64 character *} test binary-73.32 {binary decode base64, bug [00d04c4f12]} -body { list \ [string length [binary decode base64 =]] \ [string length [binary decode base64 " ="]] \ [string length [binary decode base64 " ="]] \ [string length [binary decode base64 "\r\n\t="]] \ } -result [lrepeat 4 0] test binary-73.33 {binary decode base64, bug [00d04c4f12]} -body { list \ [string length [binary decode base64 ==]] \ [string length [binary decode base64 " =="]] \ [string length [binary decode base64 " =="]] \ [string length [binary decode base64 " =="]] \ } -result [lrepeat 4 0] test binary-73.34 {binary decode base64, (compatibility) unfulfilled base64 (single char) in non-strict mode} -body { list \ [expr {[binary decode base64 a] eq [binary decode base64 ""]}] \ [expr {[binary decode base64 abcda] eq [binary decode base64 "abcd"]}] } -result [lrepeat 2 1] test binary-73.35 {binary decode base64, bad base64 in strict mode} -body { set r {} foreach c {a " a" " a" " a" " a" abcda abcdabcda a= a== abcda= abcda==} { lappend r \ [catch {binary decode base64 $c}] \ [catch {binary decode base64 -strict $c}] } set r } -result [lrepeat 11 0 1] test binary-73.36 {binary decode base64: check encoded & decoded equals original} -body { set r {} for {set i 0} {$i < 255 && [llength $r] < 20} {incr i} { foreach c {1 2 3 4 5 6 7 8} { set c [string repeat [format %c $i] $c] if {[set a [binary decode base64 [set x [binary encode base64 $c]]]] ne $c} { lappend r "encode & decode is wrong on string `$c` (encoded: $x): `$a` != `$c`" } } } join $r \n } -result {} test binary-73.37 {binary decode base64: Bug ffeb2097af} { binary decode base64 [binary encode base64 -maxlen 3 -wrapchar : abc] } abc test binary-74.1 {binary encode uuencode} -body { binary encode uuencode } -returnCodes error -match glob -result "wrong # args: *" test binary-74.2 {binary encode uuencode} -body { binary encode uuencode abc } -result {#86)C } test binary-74.3 {binary encode uuencode} -body { binary encode uuencode {} } -result {} test binary-74.4 {binary encode uuencode} -body { binary encode uuencode [string repeat abc 20] } -result "M[string repeat 86)C 15]\n/[string repeat 86)C 5]\n" test binary-74.5 {binary encode uuencode} -body { binary encode uuencode \x00\x01\x02\x03\x04\x00\x01\x02\x03 } -result ")``\$\"`P0``0(#\n" test binary-74.6 {binary encode uuencode} -body { binary encode uuencode \0 } -result {!`` } test binary-74.7 {binary encode uuencode} -body { binary encode uuencode \x00\x00 } -result "\"``` " test binary-74.8 {binary encode uuencode} -body { binary encode uuencode \x00\x00\x00 } -result {#```` } test binary-74.9 {binary encode uuencode} -body { binary encode uuencode \x00\x00\x00\x00 } -result {$`````` } test binary-74.10 {binary encode uuencode} -returnCodes error -body { binary encode uuencode -foo 30 abcabcabc } -result {bad option "-foo": must be -maxlen or -wrapchar} test binary-74.11 {binary encode uuencode} -returnCodes error -body { binary encode uuencode -maxlen 4 abcabcabc } -result {line length out of range} test binary-74.12 {binary encode uuencode} -body { binary encode uuencode -maxlen 5 -wrapchar \t abcabcabc } -result #86)C\t#86)C\t#86)C\t test binary-74.13 {binary encode uuencode} -body { binary encode uuencode -maxlen 85 -wrapchar \t abcabcabc } -result )86)C86)C86)C\t test binary-74.14 {binary encode uuencode} -returnCodes error -body { binary encode uuencode -maxlen 86 abcabcabc } -result {line length out of range} test binary-75.1 {binary decode uuencode} -body { binary decode uuencode } -returnCodes error -match glob -result "wrong # args: *" test binary-75.2 {binary decode uuencode} -body { binary decode uuencode "#86)C\n" } -result {abc} test binary-75.3 {binary decode uuencode} -body { binary decode uuencode {} } -result {} test binary-75.3.1 {binary decode uuencode} -body { binary decode uuencode `\n } -result {} test binary-75.4 {binary decode uuencode} -body { binary decode uuencode "M[string repeat 86)C 15]\n/[string repeat 86)C 5]\n" } -result [string repeat abc 20] test binary-75.5 {binary decode uuencode} -body { binary decode uuencode ")``\$\"`P0``0(#" } -result "\x00\x01\x02\x03\x04\x00\x01\x02\x03" test binary-75.6 {binary decode uuencode} -body { string length [binary decode uuencode "`\n"] } -result 0 test binary-75.7 {binary decode uuencode} -body { string length [binary decode uuencode "!`\n"] } -result 1 test binary-75.8 {binary decode uuencode} -body { string length [binary decode uuencode "\"``\n"] } -result 2 test binary-75.9 {binary decode uuencode} -body { string length [binary decode uuencode "#```\n"] } -result 3 test binary-75.10 {binary decode uuencode} -body { set s ">[string repeat 86)C 10]\n>[string repeat 86)C 10]" binary decode uuencode $s } -result [string repeat abc 20] test binary-75.11 {binary decode uuencode} -body { set s ">[string repeat 86)C 10]\n\t>\t[string repeat 86)C 10]\r" binary decode uuencode $s } -result [string repeat abc 20] test binary-75.12 {binary decode uuencode} -body { binary decode uuencode -strict "|86)C" } -returnCodes error -match glob -result {invalid uuencode character "|" * at position 0} test binary-75.13 {binary decode uuencode} -body { set s ">[string repeat 86)C 10]|[string repeat 86)C 10]" binary decode uuencode -strict $s } -returnCodes error -match glob -result {invalid uuencode character "|" * at position 41} test binary-75.14 {binary decode uuencode} -body { set s ">[string repeat 86)C 10]\na[string repeat 86)C 10]" binary decode uuencode -strict $s } -returnCodes error -match glob -result {invalid uuencode character *} test binary-75.20 {binary decode uuencode} -body { set r [binary decode uuencode " 8"] list [string length $r] $r } -result {0 {}} test binary-75.21 {binary decode uuencode} -body { set r [binary decode uuencode "!86"] list [string length $r] $r } -result {1 a} test binary-75.22 {binary decode uuencode} -body { set r [binary decode uuencode "\"86)"] list [string length $r] $r } -result {2 ab} test binary-75.23 {binary decode uuencode} -body { set r [binary decode uuencode "#86)C"] list [string length $r] $r } -result {3 abc} test binary-75.24 {binary decode uuencode} -body { set s "#04)\# " binary decode uuencode $s } -result ABC test binary-75.25 {binary decode uuencode} -body { set s "#04)\#z" binary decode uuencode $s } -returnCodes error -match glob -result {invalid uuencode character "z" * at position 5} test binary-75.26 {binary decode uuencode} -body { string length [binary decode uuencode " "] } -result 0 test binary-76.1 {binary string appending growth algorithm} unix { # Create zero-length byte array first set f [open /dev/null rb] chan configure $f -blocking 0 set str [read $f 2] close $f # Append to it string length [append str [binary format a* foo]] } 3 test binary-76.2 {binary string appending growth algorithm} win { # Create zero-length byte array first set f [open NUL rb] chan configure $f -blocking 0 set str [read $f 2] close $f # Append to it string length [append str [binary format a* foo]] } 3 test binary-77.1 {string cat ops on all bytearrays} { apply {{a b} { return [binary format H* $a][binary format H* $b] }} ab cd } [binary format H* abcd] test binary-77.2 {string cat ops on all bytearrays} { apply {{a b} { set one [binary format H* $a] return $one[binary format H* $b] }} ab cd } [binary format H* abcd] test binary-78.1 {unicode (out of BMP) to byte-array conversion, bug-[bd94500678]} -body { # just test for BO-segfault (high surrogate w/o advance source pointer for out of BMP char if TCL_UTF_MAX == 3): binary encode hex \U0001f415 binary scan \U0001f415 a* v; set v set str {} } -result * -match glob -returnCodes error testConstraint testsetbytearraylength \ [expr {"testsetbytearraylength" in [info commands]}] test binary-79.1 {Tcl_SetByteArrayLength} testsetbytearraylength { testsetbytearraylength [string cat A B C] 1 } A test binary-79.2 {Tcl_SetByteArrayLength} -body { testsetbytearraylength [string cat Ł B C] 1 } -constraints testsetbytearraylength -returnCodes error -match glob -result * test binary-79.3 {Tcl_SetByteArrayLength} testsetbytearraylength { testsetbytearraylength [string cat A B \u0141] 0 } {} test binary-79.4 {Tcl_SetByteArrayLength} testsetbytearraylength { testsetbytearraylength [string cat A B \u0141] 1 } A test binary-79.5 {Tcl_SetByteArrayLength} testsetbytearraylength { testsetbytearraylength [string cat A B \u0141] 2 } AB test binary-79.6 {Tcl_SetByteArrayLength} -body { testsetbytearraylength [string cat A B \u0141] 3 } -constraints testsetbytearraylength -returnCodes error -match glob -result * test binary-80.1 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body { testbytestring "乎" } -result "expected byte sequence but character 0 was '乎' (U+004E4E)" test binary-80.2 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body { testbytestring [testbytestring "\x00\xA0\xA0\xA0\xE4\xB9\x8E"] } -result "expected byte sequence but character 4 was '乎' (U+004E4E)" test binary-80.3 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body { testbytestring [testbytestring "\xC0\x80\xA0\xA0\xA0\xE4\xB9\x8E"] } -result "expected byte sequence but character 4 was '乎' (U+004E4E)" test binary-80.4 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body { testbytestring [testbytestring "\xC0\x80\xA0\xA0\xA0\xF0\x9F\x98\x81"] } -result "expected byte sequence but character 4 was '\U01F601' (U+01F601)" test binary-80.5 {Tcl_GetBytesFromObj} -constraints { bigmem testbytestring pointerIs64bit deprecated } -body { # dynamic constraint - ensure the data segment is large enough on this box for this test: if { [testConstraint unix] && ![catch { exec sh -c {ulimit -d} } dssz] && $dssz ne "unlimited" && $dssz <= 4400000 } { tcltest::Skip "DBIGMEM: too small data seg size limit ($dssz <= 4400000)" } # dynamic constraint - ensure we're able to allocate such large block: if {[catch { string repeat A [expr 2**31] } ret opt]} { if {[string match "*unable to alloc*" $ret]} { tcltest::Skip "DBIGMEM: $ret" } return {*}$opt $ret } # test: testbytestring $ret } -cleanup { unset -nocomplain opt ret dssz } -returnCodes 1 -result "byte sequence length exceeds INT_MAX" # ---------------------------------------------------------------------- # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/bigdata.test0000644000175000017500000010555515104661341015220 0ustar sergeisergei# Test cases for large sized data # # Copyright © 2023 Ashok P. Nadkarni # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # These are very rudimentary tests for large size arguments to commands. # They do not exercise all possible code paths such as shared/unshared Tcl_Objs, # literal/variable arguments etc. # They do however test compiled and uncompiled execution. if {"::tcltest" ni [namespace children]} { package require tcltest namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] source [file join [file dirname [info script]] tcltests.tcl] # # bigtest and bigtestRO (RO->read only) generate compiled and uncompiled # versions of the given test script. The difference between the two is # that bigtest generates separate test instances for the two cases while # bigtestRO generates a single test case covering both. The latter can # only be used when operands are not modified and when combining tests # does not consume too much additional memory. # Wrapper to generate compiled and uncompiled cases for a test. If $args does # not contain a -body key, $comment is treated as the test body proc bigtest {id comment result args} { if {[dict exists $args -body]} { set body [dict get $args -body] dict unset args -body } else { set body $comment } dict lappend args -constraints bigdata uplevel 1 [list test $id.uncompiled "$comment (uncompiled)" \ -body [list testevalex $body] \ -result $result \ {*}$args] uplevel 1 [list test $id.compiled-script "$comment (compiled script)" \ -body [list try $body] \ -result $result \ {*}$args] return # TODO - is this proc compilation required separately from the compile-script above? dict append args -setup \n[list proc testxproc {} $body] dict append args -cleanup "\nrename testxproc {}" uplevel 1 [list test $id.compiled-proc "$comment (compiled proc)" \ -body {testxproc} \ -result $result \ {*}$args] } # Like bigtest except that both compiled and uncompiled are combined into one # test using the same inout argument. This saves time but for obvious reasons # should only be used when the input argument is not modified. proc bigtestRO {id comment result args} { if {[dict exists $args -body]} { set body [dict get $args -body] dict unset args -body } else { set body $comment } dict lappend args -constraints bigdata set wrapper "" set body "{$body}" append wrapper "set uncompiled_result \[testevalex $body]" \n append wrapper "set compiled_result \[try $body]" \n append wrapper {list $uncompiled_result $compiled_result} uplevel 1 [list test $id.uncompiled,compiled {$comment} \ -body $wrapper \ -result [list $result $result] \ {*}$args] return } interp alias {} bigClean {} unset -nocomplain s s1 s2 bin bin1 bin2 l l1 l2 interp alias {} bigString {} testbigdata string interp alias {} bigBinary {} testbigdata bytearray interp alias {} bigList {} testbigdata list proc bigPatLen {} { proc bigPatLen {} "return [string length [testbigdata string]]" bigPatLen } # Returns list of expected elements at the indices specified proc bigStringIndices {indices} { set pat [testbigdata string] set patlen [string length $pat] lmap idx $indices { string index $pat [expr {$idx%$patlen}] } } # Returns the largest multiple of the pattern length that is less than $limit proc bigPatlenMultiple {limit} { set patlen [bigPatLen] return [expr {($limit/$patlen)*$patlen}] } set ::bigLengths(intmax) 0x7fffffff set ::bigLengths(uintmax) 0xffffffff # Some tests are more convenient if operands are multiple of pattern length if {[testConstraint bigdata]} { set ::bigLengths(patlenmultiple) [bigPatlenMultiple $::bigLengths(intmax)] set ::bigLengths(upatlenmultiple) [bigPatlenMultiple $::bigLengths(uintmax)] } # # script limits bigtestRO script-length-bigdata-1 {Test script length limit} b -body { try [string cat [string repeat " " 0x7ffffff7] "set a b"] } # TODO - different behaviour between compiled and uncompiled test script-length-bigdata-2.compiled {Test script length limit} -body { try [string cat [string repeat " " 0x7ffffff8] "set a b"] } -constraints { bigdata } -result {Script length 2147483647 exceeds max permitted length 2147483646.} -returnCodes error test script-length-bigdata-2.uncompiled {Test script length limit} -body { testevalex [string cat [string repeat " " 0x7ffffff8] "set a b"] } -constraints { bigdata } -result b test script-bytecode-length-bigdata-1 {Test bytecode length limit} -body { # Note we need to exceed bytecode limit without exceeding script char limit set s [string repeat {{*}$x;} [expr 0x7fffffff/6]] catch $s r e } -cleanup { bigClean } -constraints panicInEnterCmdStartData # # string cat bigtest string-cat-bigdata-1 "string cat large small result > INT_MAX" 1 -body { string equal \ [string cat [bigString $::bigLengths(patlenmultiple)] [bigString]] \ [bigString [expr {[bigPatLen]+$::bigLengths(patlenmultiple)}]] } bigtest string-cat-bigdata-2 "string cat small large result > INT_MAX" 1 -body { string equal \ [string cat [bigString] [bigString $::bigLengths(patlenmultiple)]] \ [bigString [expr {[bigPatLen]+$::bigLengths(patlenmultiple)}]] } bigtest string-cat-bigdata-3 "string cat result > UINT_MAX" 1 -body { set s [bigString $::bigLengths(patlenmultiple)] string equal \ [string cat $s [bigString] $s] \ [bigString [expr {[bigPatLen]+2*$::bigLengths(patlenmultiple)}]] } # # string compare/equal bigtestRO string-equal/compare-bigdata-1 "string compare/equal equal strings" {0 1} -body { list [string compare $s1 $s2] [string equal $s1 $s2] } -setup { set s1 [bigString 0x100000000] set s2 [bigString 0x100000000]; # Separate so Tcl_Obj is not the same } -cleanup { bigClean } bigtestRO string-equal/compare-bigdata-2 "string compare/equal -length unequal strings" {-1 0 0 1} -body { # Also tests lengths do not wrap set result {} lappend result [string compare $s1 $s2] lappend result [string equal $s1 $s2] # Check lengths > UINT_MAX # Also that lengths do not truncate to sizeof(int) lappend result [string compare -length 0x100000000 $s1 $s2] lappend result [string equal -length 0x100000000 $s1 $s2] } -setup { set s1 [bigString 0x100000001] set s2 [bigString 0x100000001 0x100000000]; # Differs in last char } -cleanup { bigClean } # # string first bigtestRO string-first-bigdata-1 "string first > INT_MAX" {2147483648 -1 2147483650 1} -body { list \ [string first X $s] \ [string first Y $s] \ [string first 0 $s 0x80000000] \ [string first 1 $s end-0x80000010] } -setup { set s [bigString 0x8000000a 0x80000000] } -cleanup { bigClean } bigtestRO string-first-bigdata-2 "string first > UINT_MAX" {4294967296 -1 4294967300 1} -body { list \ [string first X $s] \ [string first Y $s] \ [string first 0 $s 0x100000000] \ [string first 1 $s end-0x100000010] } -setup { set s [bigString 0x10000000a 0x100000000] } -cleanup { bigClean } bigtestRO string-first-bigdata-3 "string first - long needle" 10 -body { string first $needle $s } -setup { set s [bigString 0x10000000a 0] set needle [bigString 0x100000000] } -cleanup { bigClean needle } # # string index bigtestRO string-index-bigdata-1 "string index" {6 7 5 {} 5 4 {} 9 {}} -body { list \ [string index $s 0x100000000] \ [string index $s 0x100000000+1] \ [string index $s 0x100000000-1] \ [string index $s 0x10000000a] \ [string index $s end] \ [string index $s end-1] \ [string index $s end+1] \ [string index $s end-0x100000000] \ [string index $s end-0x10000000a] } -setup { set s [bigString 0x10000000a] } -cleanup { bigClean } # # string insert bigtestRO string-insert-bigdata-1 "string insert" 1 -body { # Note insert at multiple of 10 to enable comparison against generated string string equal [string insert [bigString 4294967312] 4294967310 "0123456789"] [bigString 4294967322] } bigtestRO string-insert-bigdata-2 "string insert" 1 -body { string equal [string insert [bigString 4294967312] 10 "0123456789"] [bigString 4294967322] } # # string is bigtestRO string-is-bigdata-1 "string is" {1 0 0 4294967296} -body { # TODO - add the other "is" classes unset -nocomplain failat result lappend result [string is alnum -failindex failat $s] [info exists failat] lappend result [string is digit -failindex failat $s] $failat } -setup { set s [bigString 0x10000000a 0x100000000] } -cleanup { bigClean failat } # # string last bigtestRO string-last-bigdata-1 "string last > INT_MAX" {2 -1 2147483640 11} -body { set s [bigString 0x80000010 2] list \ [string last X $s] \ [string last Y $s] \ [string last 0 $s 0x80000000] \ [string last 1 $s end-0x80000000] } -setup { set s [bigString 0x80000010 2] } -cleanup { bigClean } bigtestRO string-last-bigdata-2 "string last > UINT_MAX" {4294967320 -1 4294967290 1} -body { list \ [string last 0 $s] \ [string last Y $s] \ [string last 0 $s 0x100000000] \ [string last 1 $s end-0x100000010] } -setup { set s [bigString 0x10000001a 2] } -cleanup { bigClean } bigtestRO string-last-bigdata-3 "string last - long needle" 0 -body { string last $needle $s } -setup { set s [bigString 0x10000000a 0x10000000a] set needle [bigString 0x100000000] } -cleanup { bigClean needle } # # string length bigtestRO string-length-bigdata-1 {string length $s} 4294967296 -setup { set s [bigString 0x100000000] } -cleanup { bigClean } # # string map bigtestRO string-map-bigdata-1 {string map} {5 0 0 5} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [string map {0 5 5 0} $s] list \ [string index $s2 0] \ [string index $s2 5] \ [string index $s2 end] \ [string index $s2 end-5] } -setup { set s [bigString 0x100000000] } -cleanup { bigClean } -constraints bugTakesTooLong # # string match bigtestRO string-match-bigdata-1 {string match} {1 0 1} -body { list \ [string match 0*5 $s] \ [string match 0*4 $s] \ [string match $s $s] } -setup { set s [bigString 0x100000000] } -cleanup { bigClean } # # string range bigtestRO string-range-bigdata-1 "string range" {6 7 5 {} 5 4 {} 9 {}} -body { list \ [string range $s 0x100000000 0x100000000] \ [string range $s 0x100000000+1 0x100000000+1] \ [string range $s 0x100000000-1 0x100000000-1] \ [string range $s 0x10000000a 0x10000000a] \ [string range $s end end] \ [string range $s end-1 end-1] \ [string range $s end+1 end+1] \ [string range $s end-0x100000000 end-0x100000000] \ [string range $s end-0x10000000a end-0x10000000a] } -setup { set s [bigString 0x10000000a] } -cleanup { bigClean } bigtestRO string-range-bigdata-2 "bug ad9361fd20 case 1" aXaaaa -body { string range [string insert [string repeat a 0x80000000] end-0x7fffffff X] 0 5 } bigtestRO string-range-bigdata-3 "bug ad9361fd20 case 2" 2 -body { string length [string range $s end-0x7fffffff end-0x7ffffffe] } -setup { set s [string repeat a 0xffffffff] } -cleanup { bigClean } # TODO - add tests for large result range # # string repeat - use bigtest, not bigtestRO !! bigtest string-repeat-bigdata-1 "string repeat single char length > UINT_MAX" 4294967296 -body { string length [string repeat x 0x100000000] } bigtest string-repeat-bigdata-2 "string repeat multiple char" {4294967296 0123456789abcdef 0123456789abcdef} -body { set s [string repeat 0123456789abcdef [expr 0x100000000/16]] list \ [string length $s] \ [string range $s 0 15] \ [string range $s end-15 end] } -cleanup { bigClean } # # string replace bigtestRO string-replace-bigdata-1 "string replace" {789012345 012345678 XYZ789012345 012345678XYZ} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain result lappend result [string replace $s 0 0x100000000] lappend result [string replace $s end-0x100000000 end] lappend result [string replace $s 0 0x100000000 XYZ] lappend result [string replace $s end-0x100000000 end XYZ] } -setup { set s [bigString 0x10000000a] } -cleanup { bigClean } # TODO - # - replacements string is large # - replace in the middle - string length grows, shrinks # - last < first # # string reverse bigtestRO string-reverse-bigdata-1 "string reverse" {5432109876 9876543210} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 result set s2 [string reverse $s] list [string range $s2 0 9] [string range $s2 end-9 end] } -setup { set s [bigString 0x10000000a] } -cleanup { bigClean } # # string tolower bigtestRO string-tolower-bigdata-1 "string tolower" 1 -body { string equal [string tolower $s] [string repeat abcd $repts] } -setup { set repts [expr 0x100000010/4] set s [string repeat ABCD $repts] } -cleanup { bigClean repts } bigtestRO string-tolower-bigdata-2 "string tolower first last" {4294967312 ABCDabcdABCD 4294967312 ABCDabcdABCD 4294967312 ABCDabcdABCD} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 result set s2 [string tolower $s 4 7] lappend result [string length $s2] [string range $s2 0 11] unset s2; #Explicit free to reduce total memory set s2 [string tolower $s 0x100000008 0x10000000b] lappend result [string length $s2] [string range $s2 0x100000004 end] unset s2; #Explicit free to reduce total memory set s2 [string tolower $s end-7 end-4] lappend result [string length $s2] [string range $s2 0x100000004 end] } -setup { set repts [expr 0x100000010/4] set s [string repeat ABCD $repts] } -cleanup { bigClean repts } # # string totitle bigtestRO string-totitle-bigdata-1 "string totitle first last" {4294967312 aBcDAbcdaBcD 4294967312 aBcDAbcdaBcD 4294967312 aBcDAbcdaBcD} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 result set s2 [string totitle $s 4 7] lappend result [string length $s2] [string range $s2 0 11] unset s2; #Explicit free to reduce total memory set s2 [string totitle $s 0x100000008 0x10000000b] lappend result [string length $s2] [string range $s2 0x100000004 0x10000000f] unset s2; #Explicit free to reduce total memory set s2 [string totitle $s end-7 end-4] lappend result [string length $s2] [string range $s2 0x100000004 0x10000000f] } -setup { set repts [expr 0x100000010/4] set s [string repeat aBcD $repts] } -cleanup { bigClean repts } # # string toupper bigtestRO string-toupper-bigdata-1 "string toupper" 1 -body { string equal [string toupper $s] [string repeat ABCD $repts] } -setup { set repts [expr 0x100000010/4] set s [string repeat abcd $repts] } -cleanup { bigClean repts } bigtestRO string-toupper-bigdata-2 "string toupper first last" {4294967312 abcdABCDabcd 4294967312 abcdABCDabcd 4294967312 abcdABCDabcd} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 result set s2 [string toupper $s 4 7] lappend result [string length $s2] [string range $s2 0 11] unset s2; #Explicit free to reduce total memory set s2 [string toupper $s 0x100000008 0x10000000b] lappend result [string length $s2] [string range $s2 0x100000004 0x10000000f] unset s2; #Explicit free to reduce total memory set s2 [string toupper $s end-7 end-4] lappend result [string length $s2] [string range $s2 0x100000004 0x10000000f] } -setup { set repts [expr 0x100000010/4] set s [string repeat abcd $repts] } -cleanup { bigClean repts } # # string trim bigtestRO string-trim-bigdata-1 "string trim" {abcdyxxy yxxyabcd} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [string trim $s xy] list [string range $s2 0 7] [string range $s2 end-7 end] } -setup { set repts [expr 0x100000010/8] set s [string repeat xyabcdyx $repts] } -cleanup { bigClean } # # string trimleft bigtestRO string-trimleft-bigdata-1 "string trimleft" {abcdyxxy xyabcdyx} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [string trimleft $s xy] list [string range $s2 0 7] [string range $s2 end-7 end] } -setup { set repts [expr 0x100000010/8] set s [string repeat xyabcdyx $repts] } -cleanup { bigClean } # # string trimright bigtestRO string-trimright-bigdata-1 "string trimright" {xyabcdyx yxxyabcd} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [string trimright $s xy] list [string range $s2 0 7] [string range $s2 end-7 end] } -setup { set repts [expr 0x100000010/8] set s [string repeat xyabcdyx $repts] } -cleanup { bigClean } # # append bigtestRO append-bigdata-1 "append large to small" 1 -body { set s 0123456789 append s [bigString 0x100000000] string equal $s [bigString 0x10000000a] } -cleanup { bigClean } bigtest append-bigdata-2 "append small to cross UINT_MAX boundary" 1 -body { append s 0123456789 string equal $s [bigString 4294967300] } -setup { set s [bigString 4294967290] } -cleanup { bigClean } bigtest append-bigdata-3 "append small to cross UINT_MAX boundary" 1 -body { set s2 "" append s2 $s $s $s $s string equal $s2 [bigString 4294967320] } -setup { # Make length multiple of 4 AND 10 since the bigString pattern length is 10 set len [expr 4294967320/4] set s [bigString $len] } -cleanup { bigClean } # # format bigtestRO format-bigdata-1 "format %s" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [format %s $s] string equal $s $s2 } -setup { set s [bigString 0x100000000] } -cleanup { bigClean } bigtest format-bigdata-2 "format bigstring%s" 1 -body { set s [format $s X] string equal $s [bigString 0x100000001 0x100000000] } -setup { set s [bigString 0x100000000] append s %s } -cleanup { bigClean } bigtest format-bigdata-3 "format big width" {4294967300 { } { a}} -body { set s [format %4294967300s a] list [string length $s] [string range $s 0 3] [string range $s end-3 end] } -cleanup { bigClean } bigtest format-bigdata-4 "format big negative width" {4294967300 {a } { }} -body { set s [format %-4294967300s a] list [string length $s] [string range $s 0 3] [string range $s end-3 end] } -cleanup { bigClean } bigtest format-bigdata-5 "format big * width" {4294967300 { } { a}} -body { set s [format %*s 4294967300 a] list [string length $s] [string range $s 0 3] [string range $s end-3 end] } -cleanup { bigClean } bigtest format-bigdata-6 "format big negative * width" {4294967300 {a } { }} -body { set s [format %*s -4294967300 a] list [string length $s] [string range $s 0 3] [string range $s end-3 end] } -cleanup { bigClean } bigtestRO format-bigdata-7 "format big precision" {4294967300 0123 6789} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [format %.4294967300s $s] list [string length $s2] [string range $s2 0 3] [string range $s2 end-3 end] } -setup { set s [testbigdata string 4294967310] } -cleanup { bigClean } bigtestRO format-bigdata-8 "format big * precision" {4294967300 0123 6789} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain s2 set s2 [format %.*s 4294967300 $s] list [string length $s2] [string range $s2 0 3] [string range $s2 end-3 end] } -setup { set s [testbigdata string 4294967310] } -cleanup { bigClean } # # scan bigtestRO scan-bigdata-1 "scan %s" {1 1 2 X 1 2 4294967300 01234X} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain result digits x lappend result [string equal [scan $s %s] $s] lappend result [string equal [scan $s {%[0-9X]}] $s] lappend result [scan $s {%[0-9]%s} digits x] $x lappend result [string equal $digits [bigString 0x100000009]] lappend result [scan $s %4294967300s%s x y] lappend result [string length $x] $y } -setup { set s [bigString 0x10000000a 0x100000009] } -cleanup { bigClean digits } # # regexp bigtestRO regexp-bigdata-1 "regexp" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain result digits lappend result [regexp {[[:digit:]]*X} $s] } -setup { set s [bigString 0x100000000 0x100000000] } -cleanup { bigClean digits } bigtestRO regexp-bigdata-2 "regexp with capture" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain result digits match lappend result [regexp {([[:digit:]])*X} $s match digits] [string equal $match $s] puts B unset match; # Free up memory lappend result [string equal $digits [bigString 0x100000009]] } -setup { set s [bigString 0x10000000a 0x100000009] } -cleanup { bigClean digits match } -constraints bugTakesTooLong # # regsub bigtestRO regsub-bigdata-1 "regsub" X -body { regsub -all \\d $s {} } -setup { set s [bigString 0x100000001 0x100000000] } -cleanup { bigClean } -constraints bugTakesTooLong bigtestRO regsub-bigdata-2 "regsub" 1 -body { string equal [regsub -all \\d $s x] [string cat [string repeat x 0x100000000] X] } -setup { set s [bigString 0x100000001 0x100000000] } -cleanup { bigClean } -constraints bugTakesTooLong # # subst bigtestRO subst-bigdata-1 "subst" {1 1} -body { unset -nocomplain result lappend result [string equal [subst $s] $s] lappend result [string equal [subst {$s}] $s] } -setup { set s [bigString 0x10000000a] } -cleanup { bigClean } # # binary format bigtestRO binary-format-bigdata-1 "binary format aN" [list 4294967296 X\0\0\0 \0\0\0\0] -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain bin set bin [binary format a4294967296 X] list [string length $bin] [string range $bin 0 3] [string range $bin end-3 end] } -cleanup { bigClean } # TODO - do string compare and add other format specifiers bigtestRO binary-format-bigdata-2 "binary format a*" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain bin2 set bin2 [binary format a* $bin] string equal $bin $bin2 } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } # # binary scan bigtestRO binary-scan-bigdata-1 "binary scan aN" {4294967296 0123 2345} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain bin2 binary scan $bin a4294967296 bin2 list [string length $bin2] [string range $bin2 0 3] [string range $bin2 end-3 end] } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } # TODO - do string compare and add other format specifiers once above bug is fixed bigtestRO binary-scan-bigdata-2 "binary scan a*" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain bin2 binary scan $bin a* bin2 string equal $bin $bin2 } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } # TODO - do string compare and add other format specifiers once above bug is fixed # # binary encode / decode base64 bigtestRO binary-encode/decode-base64-bigdata-1 "binary encode/decode base64" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. string equal $bin [binary decode base64 [binary encode base64 $bin]] } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } # # binary encode / decode hex bigtestRO binary-encode/decode-hex-bigdata-1 "binary encode/decode hex" 1 -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. string equal $bin [binary decode hex [binary encode hex $bin]] } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } # # binary encode / decode uuencode bigtestRO binary-encode/decode-uuencode-bigdata-1 "binary encode/decode uuencode" 1 -body { string equal $bin [binary decode uuencode [binary encode uuencode $bin]] } -setup { set bin [bigBinary 4294967296] } -cleanup { bigClean } ################################################################ # List commands # # foreach bigtestRO foreach-bigdata-1 "foreach" 1 -body { # Unset explicitly before setting as bigtestRO runs the script twice. unset -nocomplain l2 foreach x $l { lappend l2 $x } testlutil equal $l $l2 } -setup { set l [bigList 0x100000000] } -cleanup { bigClean } # # lappend bigtest lappend-bigdata-1 "lappend" {4294967300 4294967300 {1 2 3 4 5 a b c d}} -body { # Do NOT initialize l in a -setup block. That requires more memory and fails. # Do not have enough memory for a full compare. # Just check end set l [bigList 0x100000000] list [llength [lappend l a b c d]] [llength $l] [lrange $l end-8 end] } -cleanup { bigClean } # # lassign bigtestRO lassign-bigdata-1 "lassign" {0 1 2 3 4 5 6 7 8 {9 0 1 2 3 4 5 6 7 8} {6 7 8 9 0 1 2 3 4 5}} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain l2 set l2 [lassign $l a b c d e f g h i] list $a $b $c $d $e $f $g $h $i [lrange $l2 0 9] [lrange $l2 end-9 end] } -setup { set l [bigList 0x10000000a] } -cleanup { bigClean } # # ledit bigtest ledit-bigdata-1 "ledit - small result" {{0 X Y Z 8} {0 X Y Z 8}} -body { list [ledit l 1 0x100000001 X Y Z] $l } -setup { set l [bigList 0x100000003] } -cleanup { bigClean } bigtest ledit-bigdata-2 "ledit - large result" {4294967304 4294967304 {a b c d e f g 7}} -body { # Do NOT initialize l in a -setup block. That requires more memory and fails. set l [bigList 0x100000002] list [llength [ledit l 0x100000000 0x100000000 a b c d e f g]] [llength $l] [lrange $l 0x100000000 end] } -cleanup { bigClean } bigtest ledit-bigdata-3 "ledit - small -> large result" {2147483650 2147483650 {a b 0 1 2 3 4 5} {0 1 e f g h i j}} -body { set l2 {a b c d e f g h i j} list [llength [ledit l2 2 3 {*}$l]] [llength $l2] [lrange $l2 0 7] [lrange $l2 end-7 end] } -setup { # Note total number of arguments has to be less than INT_MAX set l [bigList 2147483642] } -cleanup { bigClean } -constraints memoryAllocationPanic # # lindex bigtestRO lindex-bigdata-1 "lindex" {6 7 5 {} 5 4 {} 9 {}} -body { list \ [lindex $l 0x100000000] \ [lindex $l 0x100000000+1] \ [lindex $l 0x100000000-1] \ [lindex $l 0x10000000a] \ [lindex $l end] \ [lindex $l end-1] \ [lindex $l end+1] \ [lindex $l end-0x100000000] \ [lindex $l end-0x10000000a] } -setup { set l [bigList 0x10000000a] } -cleanup { bigClean } # TODO nested index # # linsert # Cannot use bigtestRO here because 16GB memory not enough to have two 4G sized lists # Have to throw away source list every time. Also means we cannot compare entire lists # and instead just compare the affected range bigtest linsert-bigdata-1 "linsert" {4294967330 1} -body { # Note insert at multiple of 10 to enable comparison against generated string set ins [split abcdefghij ""] set pat [split 0123456789 ""] set insidx 2000000000 set l [linsert [bigList 4294967320] $insidx {*}$ins] list \ [llength $l] \ [testlutil equal [lrange $l $insidx-10 $insidx+19] [concat $pat $ins $pat]] } -cleanup { bigClean } # # list and {*} # TODO - compiled and uncompiled behave differently so tested separately test list-bigdata-1.compiled {list {*}} -body { set l [bigList 0x100000000] set l2 [list {*}$l] unset l list [llength $l2] [lindex $l2 0] [lindex $l2 end] } -cleanup { bigClean } -constraints { bigdata } -result {4294967296 0 5} test list-bigdata-1.uncompiled {list {*}} -body { set l [bigList 0x7fffffff] testevalex {set l2 [list {*}$l]} } -cleanup { bigClean } -constraints { bigdata } -result {Number of words in command exceeds limit 2147483647.} -returnCodes error # # llength bigtestRO llength-bigdata-1 {llength} 4294967296 -body { llength $l } -setup { set l [bigList 0x100000000] } -cleanup { bigClean } # # lmap bigtestRO lmap-bigdata-1 "lmap" 4294967296 -body { set n 0 if {0} { # TODO - This is the right test but runs out of memory testlutil equal $l [lmap e $l {set e}] } else { lmap e $l {incr n; continue} } set n } -setup { set l [bigList 0x100000000] } -cleanup { bigClean puts "" } # # lrange bigtestRO lrange-bigdata-1 "lrange" {6 {6 7} 7 5 {} 5 4 {} 9 {8 9} {}} -body { list \ [lrange $l 0x100000000 0x100000000] \ [lrange $l 0x100000000 0x100000001] \ [lrange $l 0x100000000+1 0x100000000+1] \ [lrange $l 0x100000000-1 0x100000000-1] \ [lrange $l 0x10000000a 0x10000000a] \ [lrange $l end end] \ [lrange $l end-1 end-1] \ [lrange $l end+1 end+1] \ [lrange $l end-0x100000000 end-0x100000000] \ [lrange $l end-0x100000001 end-0x100000000] \ [lrange $l end-0x10000000a end-0x10000000a] } -setup { set l [bigList 0x10000000a] } -cleanup { bigClean } # TODO - add tests for large result range # # lrepeat - use bigtest, not bigtestRO !! bigtest lrepeat-bigdata-1 "lrepeat single element length > UINT_MAX" 4294967296 -body { # Just to test long lengths are accepted as arguments llength [lrepeat 0x100000000 x] } bigtest lrepeat-bigdata-2 "string repeat multiple char" {4294967400 {0 1 2 3 4 5 6 7}} -body { set len [expr 4294967400/8] set l [lrepeat $len 0 1 2 3 4 5 6 7] list [llength $l] [lrange $l end-7 end] } -cleanup { bigClean } # # lreplace bigtestRO lreplace-bigdata-1 "lreplace - small result" [list \ [split 789012345 ""] \ [split 012345678 ""] \ [split XYZ789012345 ""] \ [split 012345678XYZ ""] \ ] -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain result lappend result [lreplace $l 0 0x100000000] lappend result [lreplace $l end-0x100000000 end] lappend result [lreplace $l 0 0x100000000 X Y Z] lappend result [lreplace $l end-0x100000000 end X Y Z] } -setup { set l [bigList 0x10000000a] } -cleanup { bigClean } bigtest lreplace-bigdata-2 "lreplace - large result" {4294967301 {a b c d e 0 1 2 3 4 5 6}} -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain l2 set l2 [lreplace [bigList 4294967296] 4294967290 0 a b c d e] lrange $l2 4294967290 end } -setup { #set l [bigList 4294967296] } -cleanup { bigClean } -constraints bugOutOfMemoryPanic # # lsearch bigtestRO lsearch-bigdata-1 "lsearch" {4294967300 4294967310 -1} -body { list \ [lsearch -exact $l X] \ [lsearch -exact -start 4294967291 $l 0] \ [lsearch -exact $l Y] } -setup { set l [bigList 0x100000010 4294967300] } -cleanup { bigClean } # TODO - stride, inline, all # # lseq bigtest lseq-bigdata-1 "lseq" {4294967297 4294967296} -body { list [llength $l] [lindex $l 0x100000000] } -setup { set l [lseq 0x100000001] } -cleanup { bigClean } bigtest lseq-bigdata-2 "lseq" {9223372036854775807 9223372036854775799} -body { list [llength $l] [lindex $l 9223372036854775800] } -setup { set l [lseq 0x7fffffffffffffff]; llength $l } -cleanup { bigClean } -constraints bug_fa00fbbbab # # lset bigtest lset-bigdata-1 "lset" {4294967297 4294967297 {1 2 3 4 5 X}} -body { # Do NOT initialize l in a -setup block. That requires more memory and fails. set l [bigList 0x100000001] list [llength [lset l 0x100000000 X]] [llength $l] [lrange $l end-5 end] } -cleanup { bigClean } # # lsort bigtestRO lsort-bigdata-1 "lsort" [list 4294967296 [lrepeat 10 0] [lrepeat 10 9]] -body { # Unset explicitly before setting to save memory as bigtestRO runs the # script below twice. unset -nocomplain l2 set l2 [lsort $l] list [llength $l2] [lrange $l2 0 9] [lrange $l2 end-9 end] } -setup { set l [bigList 0x100000000] } -cleanup { bigClean } -constraints notenoughmemoryexception # # join bigtestRO join-bigdata-1 "join" [list 0123456789 6789012345] -body { set s [join $l ""] list [string range $s 0 9] [string range $s end-9 end] } -setup { set l [bigList 0x100000000] } -cleanup { bigClean } bigtest split-bigdata-1 "split" {4294967296 {0 1 2 3 4} {1 2 3 4 5}} -body { # Fill list compare needs too much memory set l [split $s ""] list [llength $l] [lrange 0 4] [lrange end-4 end] } -setup { set s [bigString 0x100000000] } -cleanup { bigClean } -constraints bugTakesTooLong bigtestRO concat-bigdata-1 "concat" {4294967296 {0 1 2 3 4} {6 7 0 1 2} {3 4 5 6 7}} -body { unset -nocomplain l2 set l2 [concat $l $l] list [llength $l2] [lrange $l2 0 4] [lrange $l2 0x80000000-2 0x80000000+2] [lrange $l2 end-4 end] } -setup { set l [bigList 0x80000000] } test puts-bigdata-1 "puts" -setup { set fpath [makeFile {} bug-0306a5563.data] } -constraints { bigdata } -body { set fd [open $fpath w] puts -nonewline $fd [testbigdata string 0x80000001] close $fd set fd [open $fpath] seek $fd 0x7FFFFFFA set written [read $fd] close $fd set written } -result {2345678} test puts-bigdata-2 "puts" -setup { set fpath [tcltest::makeFile {} bug-0306a5563.data] } -constraints { bigdata } -body { set fd [open $fpath w] set s [testbigdata string 0x7FFFFFFE] # The character to append in the next line is —, EM DASH, # code point 0x2014 (decimal 8212, UTF-8 #xE2 #x80 #x94) append s \u2014 puts -nonewline $fd $s close $fd set fd [open $fpath] seek $fd 0x7FFFFFFA set written [read $fd] close $fd set written } -result {2345—} test source-bigdata-1 "source" -setup { # This test crashes because the frame linenumber tracking # wraps around at INT_MAX set fpath [tcltest::makeFile {} source-bigdata-1.tcl] set fd [open $fpath w] fconfigure $fd -translation lf puts -nonewline $fd [string repeat \n 4294967296] puts $fd {dict get [info frame 0] line} close $fd } -constraints { bigdata knownBug } -body { set line [source $fpath] } -result 4294967297 # # TODO # lremove # lreverse # encoding convertfrom # encoding convertto # dict * # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/basic.test0000644000175000017500000007344415104661341014707 0ustar sergeisergei# This file contains tests for the tclBasic.c source file. Tests appear in # the same order as the C code that they test. The set of tests is # currently incomplete since it currently includes only new tests for # code changed for the addition of Tcl namespaces. Other variable- # related tests appear in several other test files including # assocd.test, cmdInfo.test, eval.test, expr.test, interp.test, # and trace.test. # # Sourcing this file into Tcl runs the tests and generates output for # errors. No output means no errors were found. # # Copyright © 1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testevalex [llength [info commands testevalex]] testConstraint testcmdtoken [llength [info commands testcmdtoken]] testConstraint testcreatecommand [llength [info commands testcreatecommand]] testConstraint exec [llength [info commands exec]] catch {namespace delete test_ns_basic} catch {interp delete test_interp} catch {rename p ""} catch {rename q ""} catch {rename cmd ""} unset -nocomplain x test basic-1.1 {Tcl_CreateInterp, creates interp's global namespace} { catch {interp delete test_interp} interp create test_interp interp eval test_interp { namespace eval test_ns_basic { proc p {} { return [namespace current] } } } list [interp eval test_interp {test_ns_basic::p}] \ [interp delete test_interp] } {::test_ns_basic {}} test basic-2.1 {TclHideUnsafeCommands} {emptyTest} { } {} test basic-3.1 {Tcl_CallWhenDeleted: see dcall.test} {emptyTest} { } {} test basic-4.1 {Tcl_DontCallWhenDeleted: see dcall.test} {emptyTest} { } {} test basic-5.1 {Tcl_SetAssocData: see assoc.test} {emptyTest} { } {} test basic-6.1 {Tcl_DeleteAssocData: see assoc.test} {emptyTest} { } {} test basic-7.1 {Tcl_GetAssocData: see assoc.test} {emptyTest} { } {} test basic-8.1 {Tcl_InterpDeleted} {emptyTest} { } {} test basic-9.1 {Tcl_DeleteInterp: see interp.test} {emptyTest} { } {} test basic-10.1 {DeleteInterpProc, destroys interp's global namespace} { catch {interp delete test_interp} interp create test_interp interp eval test_interp { namespace eval test_ns_basic { namespace export p proc p {} { return [namespace current] } } namespace eval test_ns_2 { namespace import ::test_ns_basic::p variable v 27 proc q {} { variable v return "[p] $v" } } } list [interp eval test_interp {test_ns_2::q}] \ [interp eval test_interp {namespace delete ::}] \ [catch {interp eval test_interp {set a 123}} msg] $msg \ [interp delete test_interp] } {{::test_ns_basic 27} {} 1 {invalid command name "set"} {}} test basic-11.1 {HiddenCmdsDeleteProc, invalidate cached refs to deleted hidden cmd} { catch {interp delete test_interp} interp create test_interp interp eval test_interp { proc p {} { return 27 } } interp alias {} localP test_interp p list [interp eval test_interp {p}] \ [localP] \ [test_interp hide p] \ [catch {localP} msg] $msg \ [interp delete test_interp] \ [catch {localP} msg] $msg } {27 27 {} 1 {invalid command name "p"} {} 1 {invalid command name "localP"}} # NB: More tests about hide/expose are found in interp.test test basic-12.1 {Tcl_HideCommand, names of hidden cmds can't have namespace qualifiers} { catch {interp delete test_interp} interp create test_interp interp eval test_interp { namespace eval test_ns_basic { proc p {} { return [namespace current] } } } list [catch {test_interp hide test_ns_basic::p x} msg] $msg \ [catch {test_interp hide x test_ns_basic::p} msg1] $msg1 \ [interp delete test_interp] } {1 {can only hide global namespace commands (use rename then hide)} 1 {cannot use namespace qualifiers in hidden command token (rename)} {}} test basic-12.2 {Tcl_HideCommand, a hidden cmd remembers its containing namespace} { catch {namespace delete test_ns_basic} catch {rename cmd ""} proc cmd {} { ;# note that this is global return [namespace current] } namespace eval test_ns_basic { proc hideCmd {} { interp hide {} cmd } proc exposeCmd {} { interp expose {} cmd } proc callCmd {} { cmd } } list [test_ns_basic::callCmd] \ [test_ns_basic::hideCmd] \ [catch {cmd} msg] $msg \ [test_ns_basic::exposeCmd] \ [test_ns_basic::callCmd] \ [namespace delete test_ns_basic] } {:: {} 1 {invalid command name "cmd"} {} :: {}} test basic-13.1 {Tcl_ExposeCommand, a command stays in the global namespace and cannot go to another namespace} { catch {namespace delete test_ns_basic} catch {rename cmd ""} proc cmd {} { ;# note that this is global return [namespace current] } namespace eval test_ns_basic { proc hideCmd {} { interp hide {} cmd } proc exposeCmdFailing {} { interp expose {} cmd ::test_ns_basic::newCmd } proc exposeCmdWorkAround {} { interp expose {} cmd; rename cmd ::test_ns_basic::newCmd; } proc callCmd {} { cmd } } list [test_ns_basic::callCmd] \ [test_ns_basic::hideCmd] \ [catch {test_ns_basic::exposeCmdFailing} msg] $msg \ [test_ns_basic::exposeCmdWorkAround] \ [test_ns_basic::newCmd] \ [namespace delete test_ns_basic] } {:: {} 1 {cannot expose to a namespace (use expose to toplevel, then rename)} {} ::test_ns_basic {}} test basic-13.2 {Tcl_ExposeCommand, invalidate cached refs to cmd now being exposed} { catch {rename p ""} catch {rename cmd ""} proc p {} { cmd } proc cmd {} { return 42 } list [p] \ [interp hide {} cmd] \ [proc cmd {} {return Hello}] \ [cmd] \ [rename cmd ""] \ [interp expose {} cmd] \ [p] } {42 {} {} Hello {} {} 42} test basic-14.1 {Tcl_CreateCommand, new cmd goes into a namespace specified in its name, if any} {testcreatecommand} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [testcreatecommand create] \ [test_ns_basic::createdcommand] \ [testcreatecommand delete] } {{} {CreatedCommandProc in ::test_ns_basic} {}} test basic-14.2 {Tcl_CreateCommand, namespace code ignore single ":"s in middle or end of names} {testcreatecommand} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename value:at: ""} list [testcreatecommand create2] \ [value:at:] \ [testcreatecommand delete2] } {{} {CreatedCommandProc2 in ::} {}} test basic-15.1 {Tcl_CreateObjCommand, new cmd goes into a namespace specified in its name, if any} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_basic {} proc test_ns_basic::cmd {} { ;# proc requires that ns already exist return [namespace current] } list [test_ns_basic::cmd] \ [namespace delete test_ns_basic] } {::test_ns_basic {}} test basic-15.2 {Tcl_CreateObjCommand, Bug 0e4d88b650} -setup { proc deleter {ns args} { namespace delete $ns } namespace eval n { proc p {} {} } trace add command n::p delete [list [namespace which deleter] [namespace current]::n] } -body { proc n::p {} {} } -cleanup { namespace delete n rename deleter {} } test basic-16.1 {InvokeStringCommand} {emptyTest} { } {} test basic-17.1 {InvokeObjCommand} {emptyTest} { } {} test basic-18.1 {TclRenameCommand, name of existing cmd can have namespace qualifiers} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename cmd ""} namespace eval test_ns_basic { proc p {} { return "p in [namespace current]" } } list [test_ns_basic::p] \ [rename test_ns_basic::p test_ns_basic::q] \ [test_ns_basic::q] } {{p in ::test_ns_basic} {} {p in ::test_ns_basic}} test basic-18.2 {TclRenameCommand, existing cmd must be found} { catch {namespace delete {*}[namespace children :: test_ns_*]} list [catch {rename test_ns_basic::p test_ns_basic::q} msg] $msg } {1 {can't rename "test_ns_basic::p": command doesn't exist}} test basic-18.3 {TclRenameCommand, delete cmd if new name is empty} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_basic { proc p {} { return "p in [namespace current]" } } list [info commands test_ns_basic::*] \ [rename test_ns_basic::p ""] \ [info commands test_ns_basic::*] } {::test_ns_basic::p {} {}} test basic-18.4 {TclRenameCommand, bad new name} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_basic { proc p {} { return "p in [namespace current]" } } rename test_ns_basic::p :::george::martha } {} test basic-18.5 {TclRenameCommand, new name must not already exist} -setup { if {![llength [info commands :::george::martha]]} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_basic { proc p {} { return "p in [namespace current]" } } rename test_ns_basic::p :::george::martha } } -body { namespace eval test_ns_basic { proc q {} { return 42 } } list [catch {rename test_ns_basic::q :::george::martha} msg] $msg } -result {1 {can't rename to ":::george::martha": command already exists}} test basic-18.6 {TclRenameCommand, check for command shadowing by newly renamed cmd} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} catch {rename q ""} proc p {} { return "p in [namespace current]" } proc q {} { return "q in [namespace current]" } namespace eval test_ns_basic { proc callP {} { p } } list [test_ns_basic::callP] \ [rename q test_ns_basic::p] \ [test_ns_basic::callP] } {{p in ::} {} {q in ::test_ns_basic}} test basic-19.1 {Tcl_SetCommandInfo} {emptyTest} { } {} test basic-20.1 {Tcl_GetCommandInfo, names for commands created inside namespaces} {testcmdtoken} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} catch {rename q ""} unset -nocomplain x set x [namespace eval test_ns_basic::test_ns_basic2 { # the following creates a cmd in the global namespace testcmdtoken create p }] list [testcmdtoken name $x] \ [rename ::p q] \ [testcmdtoken name $x] } {{p ::p} {} {q ::q}} test basic-20.2 {Tcl_GetCommandInfo, names for commands created outside namespaces} {testcmdtoken} { catch {rename q ""} set x [testcmdtoken create test_ns_basic::test_ns_basic2::p] list [testcmdtoken name $x] \ [rename test_ns_basic::test_ns_basic2::p q] \ [testcmdtoken name $x] } {{p ::test_ns_basic::test_ns_basic2::p} {} {q ::q}} test basic-20.3 {Tcl_GetCommandInfo, #-quoting} testcmdtoken { catch {rename \# ""} set x [testcmdtoken create \#] return [testcmdtoken name $x] } {{#} ::#} test basic-21.1 {Tcl_GetCommandName} {emptyTest} { } {} test basic-22.1 {Tcl_GetCommandFullName} { catch {namespace delete {*}[namespace children :: test_ns_*]} namespace eval test_ns_basic1 { namespace export cmd* proc cmd1 {} {} proc cmd2 {} {} } namespace eval test_ns_basic2 { namespace export * namespace import ::test_ns_basic1::* proc p {} {} } namespace eval test_ns_basic3 { namespace import ::test_ns_basic2::* proc q {} {} list [namespace which -command foreach] \ [namespace which -command q] \ [namespace which -command p] \ [namespace which -command cmd1] \ [namespace which -command ::test_ns_basic2::cmd2] } } {::foreach ::test_ns_basic3::q ::test_ns_basic3::p ::test_ns_basic3::cmd1 ::test_ns_basic2::cmd2} test basic-23.1 {Tcl_DeleteCommand} {emptyTest} { } {} test basic-24.1 {Tcl_DeleteCommandFromToken, invalidate all compiled code if cmd has compile proc} { catch {interp delete test_interp} unset -nocomplain x interp create test_interp interp eval test_interp { proc useSet {} { return [set a 123] } } set x [interp eval test_interp {useSet}] interp eval test_interp { rename set "" proc set {args} { return "set called with $args" } } list $x \ [interp eval test_interp {useSet}] \ [interp delete test_interp] } {123 {set called with a 123} {}} test basic-24.2 {Tcl_DeleteCommandFromToken, deleting commands changes command epoch} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} proc p {} { return "global p" } namespace eval test_ns_basic { proc p {} { return "namespace p" } proc callP {} { p } } list [test_ns_basic::callP] \ [rename test_ns_basic::p ""] \ [test_ns_basic::callP] } {{namespace p} {} {global p}} test basic-24.3 {Tcl_DeleteCommandFromToken, delete imported cmds that refer to a deleted cmd} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {rename p ""} namespace eval test_ns_basic { namespace export p proc p {} {return 42} } namespace eval test_ns_basic2 { namespace import ::test_ns_basic::* proc callP {} { p } } list [test_ns_basic2::callP] \ [info commands test_ns_basic2::*] \ [rename test_ns_basic::p ""] \ [catch {test_ns_basic2::callP} msg] $msg \ [info commands test_ns_basic2::*] } {42 {::test_ns_basic2::callP ::test_ns_basic2::p} {} 1 {invalid command name "p"} ::test_ns_basic2::callP} test basic-25.1 {TclCleanupCommand} {emptyTest} { } {} test basic-26.1 {Tcl_EvalObj: preserve object while evaling it} -setup { proc myHandler {msg options} { set ::x [dict get $options -errorinfo] } set handler [interp bgerror {}] interp bgerror {} [namespace which myHandler] set fName [makeFile {} test1] } -body { # If object isn't preserved, errorInfo would be set to # "foo\n while executing\n\"garbage bytes\"" because the object's # string would have been freed, leaving garbage bytes for the error # message. set f [open $fName w] chan event $f writable "chan event $f writable {}; error foo" set x {} vwait x close $f set x } -cleanup { removeFile test1 interp bgerror {} $handler rename myHandler {} } -result "foo\n while executing\n\"error foo\"" test basic-26.2 {Tcl_EvalObjEx, pure-list branch: preserve "objv"} -body { # # Follow the pure-list branch in a manner that # a - the pure-list internal rep is destroyed by shimmering # b - the command returns an error # As the error code in Tcl_EvalObjv accesses the list elements, this will # cause a segfault if [Bug 1119369] has not been fixed. # NOTE: a MEM_DEBUG build may be necessary to guarantee the segfault. # set SRC [list foo 1] ;# pure-list command proc foo str { # Shimmer pure-list to cmdName, cleanup and error proc $::SRC {} {}; $::SRC error "BAD CALL" } catch {eval $SRC} } -result 1 -cleanup { rename foo {} rename $::SRC {} unset ::SRC } test basic-26.3 {Tcl_EvalObjEx, pure-list branch: preserve "objv"} -body { # # Follow the pure-list branch in a manner that # a - the pure-list internal rep is destroyed by shimmering # b - the command accesses its command line # This will cause a segfault if [Bug 1119369] has not been fixed. # NOTE: a MEM_DEBUG build may be necessary to guarantee the segfault. # set SRC [list foo 1] ;# pure-list command proc foo str { # Shimmer pure-list to cmdName, cleanup and error proc $::SRC {} {}; $::SRC info level 0 } catch {eval $SRC} } -result 0 -cleanup { rename foo {} rename $::SRC {} unset ::SRC } test basic-27.1 {Tcl_ExprLong} {emptyTest} { } {} test basic-28.1 {Tcl_ExprDouble} {emptyTest} { } {} test basic-29.1 {Tcl_ExprBoolean} {emptyTest} { } {} test basic-30.1 {Tcl_ExprLongObj} {emptyTest} { } {} test basic-31.1 {Tcl_ExprDoubleObj} {emptyTest} { } {} test basic-32.1 {Tcl_ExprBooleanObj} {emptyTest} { } {} test basic-36.1 {Tcl_EvalObjv, lookup of "unknown" command} { catch {namespace delete {*}[namespace children :: test_ns_*]} catch {interp delete test_interp} interp create test_interp interp eval test_interp { proc unknown {args} { return "global unknown" } namespace eval test_ns_basic { proc unknown {args} { return "namespace unknown" } } } list [interp alias test_interp newAlias test_interp doesntExist] \ [catch {interp eval test_interp {newAlias}} msg] $msg \ [interp delete test_interp] } {newAlias 0 {global unknown} {}} test basic-37.1 {Tcl_ExprString: see expr.test} {emptyTest} { } {} test basic-38.1 {Tcl_ExprObj} {emptyTest} { } {} # Tests basic-39.* and basic-40.* refactored into trace.test test basic-41.1 {Tcl_AddErrorInfo} {emptyTest} { } {} test basic-42.1 {Tcl_AddObjErrorInfo} {emptyTest} { } {} test basic-43.1 {Tcl_VarEval} {emptyTest} { } {} test basic-44.1 {Tcl_GlobalEval} {emptyTest} { } {} test basic-45.1 {Tcl_SetRecursionLimit: see interp.test} {emptyTest} { } {} test basic-46.1 {Tcl_AllowExceptions: exception return not allowed} {stdio} { catch {close $f} set res [catch { set f [open |[list [interpreter]] w+] chan configure $f -buffering line puts $f {chan configure stdout -buffering line} puts $f continue puts $f {puts $::errorInfo} puts $f {puts DONE} set newMsg {} set msg {} while {$newMsg != "DONE"} { set newMsg [gets $f] append msg "${newMsg}\n" } close $f } error] list $res $msg } {1 {invoked "continue" outside of a loop while executing "continue" DONE }} test basic-46.2 {Tcl_AllowExceptions: exception return not allowed} -setup { set fName [makeFile { puts hello break } BREAKtest] } -constraints { exec } -body { exec [interpreter] $fName } -cleanup { removeFile BREAKtest } -returnCodes error -match glob -result {hello invoked "break" outside of a loop while executing "break" (file "*BREAKtest" line 3)} test basic-46.3 {Tcl_AllowExceptions: exception return not allowed} -setup { set fName [makeFile { interp alias {} patch {} info patchlevel patch break } BREAKtest] } -constraints { exec } -body { exec [interpreter] $fName } -cleanup { removeFile BREAKtest } -returnCodes error -match glob -result {invoked "break" outside of a loop while executing "break" (file "*BREAKtest" line 4)} test basic-46.4 {Tcl_AllowExceptions: exception return not allowed} -setup { set fName [makeFile { foo [set a 1] [break] } BREAKtest] } -constraints { exec } -body { exec [interpreter] $fName } -cleanup { removeFile BREAKtest } -returnCodes error -match glob -result {invoked "break" outside of a loop while executing* "foo \[set a 1] \[break]" (file "*BREAKtest" line 2)} test basic-46.5 {Tcl_AllowExceptions: exception return not allowed} -setup { set fName [makeFile { return -code return } BREAKtest] } -constraints { exec } -body { exec [interpreter] $fName } -cleanup { removeFile BREAKtest } -returnCodes error -match glob -result {command returned bad code: 2 while executing "return -code return" (file "*BREAKtest" line 2)} test basic-47.1 {Tcl_EvalEx: check for missing close-bracket} -constraints { testevalex } -body { testevalex {a[set b [format cd]} } -returnCodes error -result {missing close-bracket} # Some lists for expansion tests to work with set l1 [list a {b b} c d] set l2 [list e f {g g} h] proc l3 {} { list i j k {l l} } # Do all tests once byte compiled and once with direct string evaluation foreach noComp {0 1} { if {$noComp} { interp alias {} run {} testevalex set constraints testevalex } else { interp alias {} run {} if 1 set constraints {} } test basic-47.2.$noComp {Tcl_EvalEx: error during word expansion} -body { run {{*}\{} } -constraints $constraints -returnCodes error -result {unmatched open brace in list} test basic-47.3.$noComp {Tcl_EvalEx, error during substitution} -body { run {{*}[error foo]} } -constraints $constraints -returnCodes error -result foo test basic-47.4.$noComp {Tcl_EvalEx: no expansion} $constraints { run {list {*} {*} {*}} } {* * *} test basic-47.5.$noComp {Tcl_EvalEx: expansion} $constraints { run {list {*}{} {*} {*}x {*}"y z"} } {* x y z} test basic-47.6.$noComp {Tcl_EvalEx: expansion to zero args} $constraints { run {list {*}{}} } {} test basic-47.7.$noComp {Tcl_EvalEx: expansion to one arg} $constraints { run {list {*}x} } x test basic-47.8.$noComp {Tcl_EvalEx: expansion to many args} $constraints { run {list {*}"y z"} } {y z} test basic-47.9.$noComp {Tcl_EvalEx: expansion and subst order} $constraints { set x 0 run {list [incr x] {*}[incr x] [incr x] \ {*}[list [incr x] [incr x]] [incr x]} } {1 2 3 4 5 6} test basic-47.10.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{} a b c d e f g h i j k l m n o p q r} } {a b c d e f g h i j k l m n o p q r} test basic-47.11.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}1 a b c d e f g h i j k l m n o p q r} } {1 a b c d e f g h i j k l m n o p q r} test basic-47.12.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{1 2} a b c d e f g h i j k l m n o p q r} } {1 2 a b c d e f g h i j k l m n o p q r} test basic-47.13.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{} {*}{1 2} a b c d e f g h i j k l m n o p q} } {1 2 a b c d e f g h i j k l m n o p q} test basic-47.14.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{} a b c d e f g h i j k l m n o p q r s} } {a b c d e f g h i j k l m n o p q r s} test basic-47.15.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}1 a b c d e f g h i j k l m n o p q r s} } {1 a b c d e f g h i j k l m n o p q r s} test basic-47.16.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{1 2} a b c d e f g h i j k l m n o p q r s} } {1 2 a b c d e f g h i j k l m n o p q r s} test basic-47.17.$noComp {Tcl_EvalEx: expand and memory management} $constraints { run {concat {*}{} {*}{1 2} a b c d e f g h i j k l m n o p q r} } {1 2 a b c d e f g h i j k l m n o p q r} test basic-48.1.$noComp {expansion: parsing} $constraints { run { # A comment # Another comment list 1 2\ 3 {*}$::l1 # Comment again } } {1 2 3 a {b b} c d} test basic-48.2.$noComp {no expansion} $constraints { run {list $::l1 $::l2 [l3]} } {{a {b b} c d} {e f {g g} h} {i j k {l l}}} test basic-48.3.$noComp {expansion} $constraints { run {list {*}$::l1 $::l2 {*}[l3]} } {a {b b} c d {e f {g g} h} i j k {l l}} test basic-48.4.$noComp {expansion: really long cmd} $constraints { set cmd [list list] for {set t 0} {$t < 500} {incr t} { lappend cmd {{*}$::l1} } llength [run [join $cmd]] } 2000 test basic-48.5.$noComp {expansion: error detection} -setup { set l "a {a b}x y" } -constraints $constraints -body { run {list $::l1 {*}$l} } -cleanup { unset l } -returnCodes 1 -result {list element in braces followed by "x" instead of space} test basic-48.6.$noComp {expansion: odd usage} $constraints { run {list {*}$::l1$::l2} } {a {b b} c de f {g g} h} test basic-48.7.$noComp {expansion: odd usage} -constraints $constraints -body { run {list {*}[l3]$::l1} } -returnCodes 1 -result {list element in braces followed by "a" instead of space} test basic-48.8.$noComp {expansion: odd usage} $constraints { run {list {*}hej$::l1} } {heja {b b} c d} test basic-48.9.$noComp {expansion: Not all {*} should trigger} $constraints { run {list {*}$::l1 \{*\}$::l2 "{*}$::l1" {{*} i j k}} } {a {b b} c d {{*}e f {g g} h} {{*}a {b b} c d} {{*} i j k}} test basic-48.10.$noComp {expansion: expansion of command word} -setup { set cmd [list string range jultomte] } -constraints $constraints -body { run {{*}$cmd 2 6} } -cleanup { unset cmd } -result ltomt test basic-48.11.$noComp {expansion: expansion into nothing} -setup { set cmd {} set bar {} } -constraints $constraints -body { run {{*}$cmd {*}$bar} } -cleanup { unset cmd bar } -result {} test basic-48.12.$noComp {expansion: odd usage} $constraints { run {list {*}$::l1 {*}"hej hopp" {*}$::l2} } {a {b b} c d hej hopp e f {g g} h} test basic-48.13.$noComp {expansion: odd usage} $constraints { run {list {*}$::l1 {*}{hej hopp} {*}$::l2} } {a {b b} c d hej hopp e f {g g} h} test basic-48.14.$noComp {expansion: hash command} -setup { catch {rename \# ""} set cmd "#" } -constraints $constraints -body { run { {*}$cmd apa bepa } } -cleanup { unset cmd } -returnCodes 1 -result {invalid command name "#"} test basic-48.15.$noComp {expansion: complex words} -setup { set a(x) [list a {b c} d e] set b x set c [list {f\ g h\ i j k} x y] set d {0\ 1 2 3} } -constraints $constraints -body { run { lappend d {*}$a($b) {*}[lindex $c 0] } } -cleanup { unset a b c d } -result {{0 1} 2 3 a {b c} d e {f g} {h i} j k} testConstraint memory [llength [info commands memory]] test basic-48.16.$noComp {expansion: testing for leaks} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex [lindex $lines 3] 3 } # This test is made to stress the allocation, reallocation and # object reference management in Tcl_EvalEx. proc stress {} { set a x # Create free objects that should disappear set l [list 1$a 2$a 3$a 4$a 5$a 6$a 7$a] # A short number of words and a short result (8) set l [run {list {*}$l $a$a}] # A short number of words and a longer result (27) set l [run {list {*}$l $a$a {*}$l $a$a {*}$l $a$a}] # A short number of words and a longer result, with an error # This is to stress the cleanup in the error case if {![catch {run {_moo_ {*}$l $a$a {*}$l $a$a {*}$l}}]} { error "An error was expected in the previous statement" } # Many words set l [run {list {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a {*}$l $a$a \ {*}$l $a$a}] if {[llength $l] != 19*28} { error "Bad Length: [llength $l] should be [expr {19*28}]" } } } -constraints [linsert $constraints 0 memory] -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { stress set tmp $end set end [getbytes] } set leak [expr {$end - $tmp}] } -cleanup { unset end i tmp rename getbytes {} rename stress {} } -result 0 test basic-48.17.$noComp {expansion: object safety} -constraints $constraints -body { set third [expr {1.0/3.0}] set l [list $third $third] set x [run {list $third {*}$l $third}] set res [list] foreach t $x { lappend res [expr {$t * 3.0}] } set res } -cleanup { unset res t l x third } -result {1.0 1.0 1.0 1.0} test basic-48.18.$noComp {expansion: list semantics} -constraints $constraints -body { set badcmd { list a b set apa 10 } set apa 0 list [llength [run { {*}$badcmd }]] $apa } -cleanup { unset apa badcmd } -result {5 0} test basic-48.19.$noComp {expansion: error checking order} -body { set badlist "a {}x y" set a 0 set b 0 catch {run {list [incr a] {*}$badlist [incr b]}} list $a $b } -constraints $constraints -cleanup { unset badlist a b } -result {1 0} test basic-48.20.$noComp {expansion: odd case with word boundaries} $constraints { run {list {*}$::l1 {*}"hej hopp" {*}$::l2} } {a {b b} c d hej hopp e f {g g} h} test basic-48.21.$noComp {expansion: odd case with word boundaries} $constraints { run {list {*}$::l1 {*}{hej hopp} {*}$::l2} } {a {b b} c d hej hopp e f {g g} h} test basic-48.22.$noComp {expansion: odd case with word boundaries} -body { run {list {*}$::l1 {*}"hej hopp {*}$::l2} } -constraints $constraints -returnCodes error -result {missing "} test basic-48.23.$noComp {expansion: handle return codes} -constraints $constraints -body { set res {} for {set t 0} {$t < 10} {incr t} { run { {*}break } } lappend res $t for {set t 0} {$t < 10} {incr t} { run { {*}continue } set t 20 } lappend res $t lappend res [catch { run { {*}{error Hejsan} } } err] lappend res $err } -cleanup { unset res t } -result {0 10 1 Hejsan} test basic-48.24.$noComp {expansion: empty not canonical list, regression test, bug [cc1e91552c]} -constraints $constraints -setup { unset -nocomplain a } -body { run {list [list {*}{ }] [list {*}[format %c 32]] [list {*}[set a { }]]} } -result [lrepeat 3 {}] -cleanup {unset -nocomplain a} test basic-48.25.$noComp {Bug cc191552c: expansion: empty non-canonical list} -constraints $constraints -setup { unset -nocomplain ::CRLF set ::CRLF "\r\n" } -body { # Force variant that turned up in Bug 2c154a40be as that's externally # noticeable in an important downstream project. run {scan [list {*}$::CRLF]x %c%c%c} } -cleanup { unset -nocomplain ::CRLF } -result {120 {} {}} } ;# End of noComp loop test basic-49.1 {Tcl_EvalEx: verify TCL_EVAL_GLOBAL operation} testevalex { set ::x global namespace eval ns { variable x namespace testevalex {set x changed} global set ::result [list $::x $x] } namespace delete ns set ::result } {changed namespace} test basic-49.2 {Tcl_EvalEx: verify TCL_EVAL_GLOBAL operation} testevalex { set ::x global namespace eval ns { variable x namespace testevalex {set ::context $x} global } namespace delete ns set ::context } {global} test basic-50.1 {[586e71dce4] EvalObjv level #0 exception handling} -setup { interp create child interp alias {} foo child return } -body { list [catch foo m] $m } -cleanup { unset -nocomplain m interp delete child } -result {0 {}} # Clean up after expand tests unset noComp l1 l2 constraints rename l3 {} rename run {} #cleanup catch {namespace delete {*}[namespace children :: test_ns_*]} catch {namespace delete george} catch {interp delete test_interp} catch {rename p ""} catch {rename q ""} catch {rename cmd ""} catch {rename value:at: ""} unset -nocomplain x cleanupTests return tcl9.0.3/tests/autoMkindex.test0000644000175000017500000002652415104661341016113 0ustar sergeisergei# Commands covered: auto_mkindex auto_import # # This file contains tests related to autoloading and generating the # autoloading index. # # Copyright © 1998 Lucent Technologies, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } makeFile {# Test file for: # auto_mkindex # # This file provides example cases for testing the Tcl autoloading facility. # Things are much more complicated with namespaces and classes. The # "auto_mkindex" facility can no longer be built on top of a simple regular # expression parser. It must recognize constructs like this: # # namespace eval foo { # proc test {x y} { ... } # namespace eval bar { # proc another {args} { ... } # } # } # # Note that procedures and itcl class definitions can be nested inside of # namespaces. # # Copyright © 1993-1998 Lucent Technologies, Inc. # This shouldn't cause any problems namespace import -force blt::* # Should be able to handle "proc" definitions, even if they are preceded by # white space. proc normal {x y} {return [expr {$x+$y}]} proc indented {x y} {return [expr {$x+$y}]} # # Should be able to handle proc declarations within namespaces, even if they # have explicit namespace paths. # namespace eval buried { proc inside {args} {return "inside: $args"} namespace export pub_* proc pub_one {args} {return "one: $args"} proc pub_two {args} {return "two: $args"} } proc buried::within {args} {return "within: $args"} namespace eval buried { namespace eval under { proc neath {args} {return "neath: $args"} } namespace eval ::buried { proc relative {args} {return "relative: $args"} proc ::top {args} {return "top: $args"} proc ::buried::explicit {args} {return "explicit: $args"} } } # With proper hooks, we should be able to support other commands that create # procedures proc buried::myproc {name body args} { ::proc $name $body $args } namespace eval ::buried { proc mycmd1 args {return "mycmd"} myproc mycmd2 args {return "mycmd"} } ::buried::myproc mycmd3 args {return "another"} proc {buried::my proc} {name body args} { ::proc $name $body $args } namespace eval ::buried { proc mycmd4 args {return "mycmd"} {my proc} mycmd5 args {return "mycmd"} } {::buried::my proc} mycmd6 args {return "another"} # A correctly functioning [auto_import] won't choke when a child namespace # [namespace import]s from its parent. # namespace eval ::parent::child { namespace import ::parent::* } proc ::parent::child::test {} {} } autoMkindex.tcl # Save initial state of auto_mkindex_parser auto_load auto_mkindex if {[info exists auto_mkindex_parser::initCommands]} { set saveCommands $auto_mkindex_parser::initCommands } proc AutoMkindexTestReset {} { global saveCommands if {[info exists saveCommands]} { set auto_mkindex_parser::initCommands $saveCommands } elseif {[info exists auto_mkindex_parser::initCommands]} { unset auto_mkindex_parser::initCommands } } set result "" set origDir [pwd] cd $::tcltest::temporaryDirectory test autoMkindex-1.1 {remove any existing tclIndex file} { file delete tclIndex file exists tclIndex } {0} test autoMkindex-1.2 {build tclIndex based on a test file} { auto_mkindex . autoMkindex.tcl file exists tclIndex } {1} set element "{source -encoding utf-8 [file join . autoMkindex.tcl]}" test autoMkindex-1.3 {examine tclIndex} -setup { file delete tclIndex } -body { auto_mkindex . autoMkindex.tcl namespace eval tcl_autoMkindex_tmp { set dir "." variable auto_index source tclIndex set ::result "" foreach elem [lsort [array names auto_index]] { lappend ::result [list $elem $auto_index($elem)] } } return $result } -cleanup { namespace delete tcl_autoMkindex_tmp } -result "{::buried::explicit $element} {::buried::inside $element} {{::buried::my proc} $element} {::buried::mycmd1 $element} {::buried::mycmd4 $element} {::buried::myproc $element} {::buried::pub_one $element} {::buried::pub_two $element} {::buried::relative $element} {::buried::under::neath $element} {::buried::within $element} {::parent::child::test $element} {indented $element} {normal $element} {top $element}" test autoMkindex-2.1 {commands on the autoload path can be imported} -setup { file delete tclIndex interp create child } -body { auto_mkindex . autoMkindex.tcl child eval { namespace eval blt {} set auto_path [linsert $auto_path 0 .] set info [list [catch {namespace import buried::*} result] $result] foreach name [lsort [info commands pub_*]] { lappend info $name [namespace origin $name] } return $info } } -cleanup { interp delete child } -result "0 {} pub_one ::buried::pub_one pub_two ::buried::pub_two" # Test auto_mkindex hooks # Child hook executes interesting code in the interp used to watch code. test autoMkindex-3.1 {childHook} -setup { file delete tclIndex } -body { auto_mkindex_parser::childhook { _%@namespace eval ::blt { proc foo {} {} _%@namespace export foo } } auto_mkindex_parser::childhook { _%@namespace import -force ::blt::* } auto_mkindex . autoMkindex.tcl file exists tclIndex } -cleanup { # Reset initCommands to avoid trashing other tests AutoMkindexTestReset } -result 1 # The auto_mkindex_parser::command is used to register commands that create # new commands. test autoMkindex-3.2 {auto_mkindex_parser::command} -setup { file delete tclIndex } -body { auto_mkindex_parser::command buried::myproc {name args} { variable index variable scriptFile append index [list set auto_index([fullname $name])] \ " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n" } auto_mkindex . autoMkindex.tcl namespace eval tcl_autoMkindex_tmp { set dir "." variable auto_index source tclIndex set ::result "" foreach elem [lsort [array names auto_index]] { lappend ::result [list $elem $auto_index($elem)] } return $::result } } -cleanup { namespace delete tcl_autoMkindex_tmp # Reset initCommands to avoid trashing other tests AutoMkindexTestReset } -result "{::buried::explicit $element} {::buried::inside $element} {{::buried::my proc} $element} {::buried::mycmd1 $element} {::buried::mycmd2 $element} {::buried::mycmd4 $element} {::buried::myproc $element} {::buried::pub_one $element} {::buried::pub_two $element} {::buried::relative $element} {::buried::under::neath $element} {::buried::within $element} {::parent::child::test $element} {indented $element} {mycmd3 $element} {normal $element} {top $element}" test autoMkindex-3.3 {auto_mkindex_parser::command} -setup { file delete tclIndex } -constraints {knownBug} -body { auto_mkindex_parser::command {buried::my proc} {name args} { variable index variable scriptFile puts "my proc $name" append index [list set auto_index([fullname $name])] \ " \[list source -encoding utf-8 \[file join \$dir [list $scriptFile]\]\]\n" } auto_mkindex . autoMkindex.tcl namespace eval tcl_autoMkindex_tmp { set dir "." variable auto_index source tclIndex set ::result "" foreach elem [lsort [array names auto_index]] { lappend ::result [list $elem $auto_index($elem)] } } list [lsearch -inline $::result *mycmd4*] \ [lsearch -inline $::result *mycmd5*] \ [lsearch -inline $::result *mycmd6*] } -cleanup { namespace delete tcl_autoMkindex_tmp # Reset initCommands to avoid trashing other tests AutoMkindexTestReset } -result "{::buried::mycmd4 $element} {::buried::mycmd5 $element} {mycmd6 $element}" makeFile { namespace eval wok { namespace ensemble create -subcommands {commands vars} proc commands {{pattern *}} { puts [join [lsort -dictionary [info commands $pattern]] \n] } proc vars {{pattern *}} { puts [join [lsort -dictionary [info vars $pattern]] \n] } } } ensemblecommands.tcl test autoMkindex-3.4 {ensemble commands in tclIndex} { file delete tclIndex auto_mkindex . ensemblecommands.tcl set f [open tclIndex r] set dat [list] foreach r [split [string trim [read $f]] "\n"] { if {[string match {set auto_index*} $r]} { lappend dat $r } } set result [lsort $dat] close $f set result } {{set auto_index(::wok::commands) [list source -encoding utf-8 [file join $dir ensemblecommands.tcl]]} {set auto_index(::wok::vars) [list source -encoding utf-8 [file join $dir ensemblecommands.tcl]]} {set auto_index(wok) [list source -encoding utf-8 [file join $dir ensemblecommands.tcl]]}} removeFile ensemblecommands.tcl test autoMkindex-4.1 {platform independent source commands} -setup { file delete tclIndex makeDirectory pkg makeFile { package provide football 1.0 namespace eval ::pro:: { # # export only public functions. # namespace export {[a-z]*} } namespace eval ::college:: { # # export only public functions. # namespace export {[a-z]*} } proc ::pro::team {} { puts "go packers!" return true } proc ::college::team {} { puts "go badgers!" return true } } [file join pkg samename.tcl] } -body { auto_mkindex . pkg/samename.tcl set f [open tclIndex r] lsort [lrange [split [string trim [read $f]] "\n"] end-1 end] } -cleanup { catch {close $f} removeFile [file join pkg samename.tcl] removeDirectory pkg } -result {{set auto_index(::college::team) [list source -encoding utf-8 [file join $dir pkg samename.tcl]]} {set auto_index(::pro::team) [list source -encoding utf-8 [file join $dir pkg samename.tcl]]}} test autoMkindex-5.1 {escape magic tcl chars in general code} -setup { file delete tclIndex makeDirectory pkg makeFile { set dollar1 "this string contains an unescaped dollar sign -> \\$foo" set dollar2 \ "this string contains an escaped dollar sign -> \$foo \\\$foo" set bracket1 "this contains an unescaped bracket [NoSuchProc]" set bracket2 "this contains an escaped bracket \[NoSuchProc\]" set bracket3 \ "this contains nested unescaped brackets [[NoSuchProc]]" proc testProc {} {} } [file join pkg magicchar.tcl] set result {} } -body { auto_mkindex . pkg/magicchar.tcl set f [open tclIndex r] lindex [split [string trim [read $f]] "\n"] end } -cleanup { catch {close $f} removeFile [file join pkg magicchar.tcl] removeDirectory pkg } -result {set auto_index(testProc) [list source -encoding utf-8 [file join $dir pkg magicchar.tcl]]} test autoMkindex-5.2 {correctly locate auto loaded procs with []} -setup { file delete tclIndex makeDirectory pkg makeFile { proc {[magic mojo proc]} {} {} } [file join pkg magicchar2.tcl] set result {} interp create child } -body { auto_mkindex . pkg/magicchar2.tcl # Make a child interp to test the autoloading child eval {lappend auto_path [pwd]} child eval {catch {{[magic mojo proc]}}} } -cleanup { interp delete child removeFile [file join pkg magicchar2.tcl] removeDirectory pkg } -result 0 # Clean up. unset result AutoMkindexTestReset if {[info exists saveCommands]} { unset saveCommands } rename AutoMkindexTestReset "" removeFile autoMkindex.tcl if {[file exists tclIndex]} { file delete -force tclIndex } cd $origDir ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/auto0/0000755000175000017500000000000015104662670013747 5ustar sergeisergeitcl9.0.3/tests/auto0/modules/0000755000175000017500000000000015104662673015422 5ustar sergeisergeitcl9.0.3/tests/auto0/modules/test0-0.5.tm0000644000175000017500000000010315076154264017315 0ustar sergeisergeinamespace eval test0 {} proc test0::try0 args { return res0 } tcl9.0.3/tests/auto0/modules/mod2/0000755000175000017500000000000015104662673016263 5ustar sergeisergeitcl9.0.3/tests/auto0/modules/mod2/test2-2.0.tm0000644000175000017500000000011715076154264020162 0ustar sergeisergeinamespace eval mod2::test2 {} proc mod2::test2::try2 args { return res2 } tcl9.0.3/tests/auto0/modules/mod1/0000755000175000017500000000000015104662672016261 5ustar sergeisergeitcl9.0.3/tests/auto0/modules/mod1/test1-1.0.tm0000644000175000017500000000011715076154264020157 0ustar sergeisergeinamespace eval mod1::test1 {} proc mod1::test1::try1 args { return res1 } tcl9.0.3/tests/auto0/auto2/0000755000175000017500000000000015104662667015007 5ustar sergeisergeitcl9.0.3/tests/auto0/auto2/tclIndex0000644000175000017500000000064115076154264016502 0ustar sergeisergei# Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(report2) [list source [file join $dir file2.tcl]] tcl9.0.3/tests/auto0/auto2/pkgIndex.tcl0000644000175000017500000000104615076154264017262 0ustar sergeisergei# Tcl package index file, version 1.1 # This file is generated by the "pkg_mkIndex" command # and sourced either when an application starts up or # by a "package unknown" script. It invokes the # "package ifneeded" command to set up package-related # information so that packages will be loaded automatically # in response to "package require" commands. When this # script is sourced, the variable $dir must contain the # full path name of this file's directory. package ifneeded SafeTestPackage2 2.3.4 [list source [file join $dir package2.tcl]] tcl9.0.3/tests/auto0/auto2/package2.tcl0000644000175000017500000000012515076154264017163 0ustar sergeisergeiproc HeresPackage2 {args} { return OK2 } package provide SafeTestPackage2 2.3.4 tcl9.0.3/tests/auto0/auto2/file2.tcl0000644000175000017500000000004715076154264016512 0ustar sergeisergeiproc report2 {args} { return ok2 } tcl9.0.3/tests/auto0/auto1/0000755000175000017500000000000015104662665015004 5ustar sergeisergeitcl9.0.3/tests/auto0/auto1/tclIndex0000644000175000017500000000064115076154264016501 0ustar sergeisergei# Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(report1) [list source [file join $dir file1.tcl]] tcl9.0.3/tests/auto0/auto1/pkgIndex.tcl0000644000175000017500000000104615076154264017261 0ustar sergeisergei# Tcl package index file, version 1.1 # This file is generated by the "pkg_mkIndex" command # and sourced either when an application starts up or # by a "package unknown" script. It invokes the # "package ifneeded" command to set up package-related # information so that packages will be loaded automatically # in response to "package require" commands. When this # script is sourced, the variable $dir must contain the # full path name of this file's directory. package ifneeded SafeTestPackage1 1.2.3 [list source [file join $dir package1.tcl]] tcl9.0.3/tests/auto0/auto1/package1.tcl0000644000175000017500000000012515076154264017161 0ustar sergeisergeiproc HeresPackage1 {args} { return OK1 } package provide SafeTestPackage1 1.2.3 tcl9.0.3/tests/auto0/auto1/file1.tcl0000644000175000017500000000004715076154264016510 0ustar sergeisergeiproc report1 {args} { return ok1 } tcl9.0.3/tests/auto-files.zip0000644000175000017500000001053715104661341015513 0ustar sergeisergeiPK )Pauto0/UT z _ _ux PK )P auto0/auto1/UT z _ _ux PK)PA3LtJUauto0/auto1/package1.tclUT z _z _ux +(OVH-J-HLNLO5TN,J/URԒҢ<oCZ.̔TĴԐ^C=#=c.PK )P`''auto0/auto1/file1.tclUT z _z _ux proc report1 {args} { return ok1 } PK)PSauto0/auto1/tclIndexUT z _z _ux MN0 EW M[6MȤH*q{t$Vs}8ZTp\$ɗ8:1vu{jHi0(dg*(X ՊQr$ !tQ2?Ɣ8w &7!ԌУ\#'5@mQδ=DDMVQ7 Kmۡgmt7]w]]y/zO맘٧W.PK)P޼6A&auto0/auto1/pkgIndex.tclUT z _z _ux ]QN0+F-ސġ4&MKrbKvvq tfX: n-Mzs$gl9Lq$*KO0GP4Ml$BTJ.f?p$$5 z lk;rf$,`#]iw!KZ$u' YBrVg5AF^$G-Py!rK/O EK'mDˈ򚤇"X6$6⭮]:sG}_qpV])p( W,"M-/PK )P auto0/auto2/UT z _ _ux PK )Pnȇ''auto0/auto2/file2.tclUT z _z _ux proc report2 {args} { return ok2 } PK)PnWZJUauto0/auto2/package2.tclUT z _z _ux +(OVH-J-HLNLO5RN,J/URԒҢ<o#Z.̔TĴԐ^#=c=.PK)PԤauto0/auto2/tclIndexUT z _z _ux Mn EW6~KߪjrӰ閿!qr> >ιxI8ɗo8 :#~5Nb4NY^V,f(9VUĐl(cJ; a|jFc.HMg{Mk(gZggsئVEeG(;P\6:j!黮.BOauto0/modules/mod2/test2-2.0.tmUT z _z _ux KM-.HLNUH-KQO1*I-.1R*(OFREF E \ @PZRZjPK)Pm>Cauto0/modules/test0-0.5.tmUT z _z _ux KM-.HLNUH-KQ(I-.1P*(OpJ* ҋ((HprPK )PAauto0/UTz _ux PK )P A@auto0/auto1/UTz _ux PK)PA3LtJUauto0/auto1/package1.tclUTz _ux PK )P`''"auto0/auto1/file1.tclUTz _ux PK)PSauto0/auto1/tclIndexUTz _ux PK)P޼6A&auto0/auto1/pkgIndex.tclUTz _ux PK )P Anauto0/auto2/UTz _ux PK )Pnȇ''auto0/auto2/file2.tclUTz _ux PK)PnWZJU*auto0/auto2/package2.tclUTz _ux PK)PԤauto0/auto2/tclIndexUTz _ux PK)PB& auto0/auto2/pkgIndex.tclUTz _ux PK )PAauto0/modules/UTz _ux PK )PAauto0/modules/mod1/UTz _ux PK)PnݱBO2 auto0/modules/mod1/test1-1.0.tmUTz _ux PK )PA auto0/modules/mod2/UTz _ux PK)PE>BO auto0/modules/mod2/test2-2.0.tmUTz _ux PK)Pm>C auto0/modules/test0-0.5.tmUTz _ux PKG tcl9.0.3/tests/async.test0000644000175000017500000001507415104661341014736 0ustar sergeisergei# Commands covered: none # # This file contains a collection of tests for Tcl_AsyncCreate and related # library procedures. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint testasync [llength [info commands testasync]] testConstraint knownMsvcBug [expr {[tcl::build-info msvc]>0}] proc async1 {result code} { global aresult acode set aresult $result set acode $code return "new result" } proc async2 {result code} { global aresult acode set aresult $result set acode $code return -code error "xyzzy" } proc async3 {result code} { global aresult set aresult "test pattern" return -code $code $result } proc \# {result code} { global aresult acode set aresult $result set acode $code return "comment quoting" } if {[testConstraint testasync]} { set handler1 [testasync create async1] set handler2 [testasync create async2] set handler3 [testasync create async3] set handler4 [testasync create \#] } test async-1.1 {basic async handlers} testasync { set aresult xxx set acode yyy list [catch {testasync mark $handler1 "original" 0} msg] $msg \ $acode $aresult } {0 {new result} 0 original} test async-1.2 {basic async handlers} testasync { set aresult xxx set acode yyy list [catch {testasync mark $handler1 "original" 1} msg] $msg \ $acode $aresult } {0 {new result} 1 original} test async-1.3 {basic async handlers} testasync { set aresult xxx set acode yyy list [catch {testasync mark $handler2 "old" 0} msg] $msg \ $acode $aresult } {1 xyzzy 0 old} test async-1.4 {basic async handlers} testasync { set aresult xxx set acode yyy list [catch {testasync mark $handler2 "old" 3} msg] $msg \ $acode $aresult } {1 xyzzy 3 old} test async-1.5 {basic async handlers} testasync { set aresult xxx list [catch {testasync mark $handler3 "foobar" 0} msg] $msg $aresult } {0 foobar {test pattern}} test async-1.6 {basic async handlers} testasync { set aresult xxx list [catch {testasync mark $handler3 "foobar" 1} msg] $msg $aresult } {1 foobar {test pattern}} test async-1.7 {basic async handlers} testasync { set aresult xxx set acode yyy list [catch {testasync mark $handler4 "original" 0} msg] $msg \ $acode $aresult } {0 {comment quoting} 0 original} proc mult1 {result code} { global x lappend x mult1 return -code 7 mult1 } proc mult2 {result code} { global x lappend x mult2 return -code 9 mult2 } proc mult3 {result code} { global x hm1 hm2 lappend x [catch {testasync mark $hm2 serial2 0}] lappend x [catch {testasync mark $hm1 serial1 0}] lappend x mult3 return -code 11 mult3 } if {[testConstraint testasync]} { set hm1 [testasync create mult1] set hm2 [testasync create mult2] set hm3 [testasync create mult3] } test async-2.1 {multiple handlers} testasync { set x {} list [catch {testasync mark $hm3 "foobar" 5} msg] $msg $x } {9 mult2 {0 0 mult3 mult1 mult2}} proc del1 {result code} { global x hm1 hm2 hm3 hm4 lappend x [catch {testasync mark $hm3 serial2 0}] lappend x [catch {testasync mark $hm1 serial1 0}] lappend x [catch {testasync mark $hm4 serial1 0}] testasync delete $hm1 testasync delete $hm2 testasync delete $hm3 lappend x del1 return -code 13 del1 } proc del2 {result code} { global x lappend x del2 return -code 3 del2 } if {[testConstraint testasync]} { testasync delete $handler1 testasync delete $hm2 testasync delete $hm3 set hm2 [testasync create del1] set hm3 [testasync create mult2] set hm4 [testasync create del2] } test async-3.1 {deleting handlers} testasync { set x {} list [catch {testasync mark $hm2 "foobar" 5} msg] $msg $x } {3 del2 {0 0 0 del1 del2}} test async-4.1 {async interrupting bytecode sequence} -constraints { testasync thread } -setup { set hm [testasync create async3] proc nothing {} { # empty proc } } -body { apply {{handle} { global aresult set aresult {Async event not delivered} testasync marklater $handle # allow plenty of time to pass in case valgrind is running set start [clock seconds] while { [clock seconds] - $start < 180 && $aresult eq "Async event not delivered" } { # be less busy after 100 nothing } return $aresult }} $hm } -result {test pattern} -cleanup { # give other threads some time to go way so that valgrind doesn't pick up # "still reachable" cases from early thread termination after 100 testasync delete $hm } test async-4.2 {async interrupting straight bytecode sequence} -constraints { testasync thread } -setup { set hm [testasync create async3] } -body { apply {{handle} { global aresult set aresult {Async event not delivered} testasync marklater $handle # allow plenty of time to pass in case valgrind is running set start [clock seconds] while { [clock seconds] - $start < 180 && $aresult eq "Async event not delivered" } { # be less busy after 100 } return $aresult }} $hm } -result {test pattern} -cleanup { # give other threads some time to go way so that valgrind doesn't pick up # "still reachable" cases from early thread termination after 100 testasync delete $hm } test async-4.3 {async interrupting loop-less bytecode sequence} -constraints { testasync thread knownMsvcBug } -setup { set hm [testasync create async3] } -body { apply [list {handle} [concat { global aresult set aresult {Async event not delivered} testasync marklater $handle set i 0 } "[string repeat {;incr i;} 1500000]after 10;" { return $aresult }]] $hm } -result {test pattern} -cleanup { # give other threads some time to go way so that valgrind doesn't pick up # "still reachable" cases from early thread termination after 100 testasync delete $hm } # cleanup if {[testConstraint testasync]} { testasync delete } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # End: tcl9.0.3/tests/assocd.test0000644000175000017500000000442415104661341015072 0ustar sergeisergei# This file tests the AssocData facility of Tcl # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1994 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] testConstraint testgetassocdata [llength [info commands testgetassocdata]] testConstraint testsetassocdata [llength [info commands testsetassocdata]] testConstraint testdelassocdata [llength [info commands testdelassocdata]] test assocd-1.1 {testing setting assoc data} testsetassocdata { testsetassocdata a 1 } "" test assocd-1.2 {testing setting assoc data} testsetassocdata { testsetassocdata a 2 } "" test assocd-1.3 {testing setting assoc data} testsetassocdata { testsetassocdata 123 456 } "" test assocd-1.4 {testing setting assoc data} testsetassocdata { testsetassocdata abc "abc d e f" } "" test assocd-2.1 {testing getting assoc data} -setup { testsetassocdata a 2 } -constraints {testgetassocdata} -body { testgetassocdata a } -result 2 test assocd-2.2 {testing getting assoc data} -setup { testsetassocdata 123 456 } -constraints {testgetassocdata} -body { testgetassocdata 123 } -result 456 test assocd-2.3 {testing getting assoc data} -setup { testsetassocdata abc "abc d e f" } -constraints {testgetassocdata} -body { testgetassocdata abc } -result "abc d e f" test assocd-2.4 {testing getting assoc data} testgetassocdata { testgetassocdata xxx } "" test assocd-3.1 {testing deleting assoc data} testdelassocdata { testdelassocdata a } "" test assocd-3.2 {testing deleting assoc data} testdelassocdata { testdelassocdata 123 } "" test assocd-3.3 {testing deleting assoc data} testdelassocdata { list [catch {testdelassocdata nonexistent} msg] $msg } {0 {}} # cleanup cleanupTests return tcl9.0.3/tests/assemble1.bench0000644000175000017500000000310615076154264015577 0ustar sergeisergeiproc ulam1 {n} { set max $n while {$n != 1} { if {$n > $max} { set max $n } if {$n % 2} { set n [expr {3 * $n + 1}] } else { set n [expr {$n / 2}] } } return $max } set tcl_traceCompile 2; ulam1 1; set tcl_traceCompile 0 proc ulam2 {n} { tcl::unsupported::assemble { load n; # max dup; # max n jump start; # max n label loop; # max n over 1; # max n max over 1; # max in max n ge; # man n max>=n jumpTrue skip; # max n reverse 2; # n max pop; # n dup; # n n label skip; # max n dup; # max n n push 2; # max n n 2 mod; # max n n%2 jumpTrue odd; # max n push 2; # max n 2 div; # max n/2 -> max n jump start; # max n label odd; # max n push 3; # max n 3 mult; # max 3*n push 1; # max 3*n 1 add; # max 3*n+1 label start; # max n dup; # max n n push 1; # max n n 1 neq; # max n n>1 jumpTrue loop; # max n pop; # max } } set tcl_traceCompile 2; ulam2 1; set tcl_traceCompile 0 proc test1 {n} { for {set i 1} {$i <= $n} {incr i} { ulam1 $i } } proc test2 {n} { for {set i 1} {$i <= $n} {incr i} { ulam2 $i } } for {set j 0} {$j < 10} {incr j} { test1 1 set before [clock microseconds] test1 30000 set after [clock microseconds] puts "compiled: [expr {1e-6 * ($after - $before)}]" test2 1 set before [clock microseconds] test2 30000 set after [clock microseconds] puts "assembled: [expr {1e-6 * ($after - $before)}]" } tcl9.0.3/tests/assemble.test0000644000175000017500000017447615104661341015430 0ustar sergeisergei# assemble.test -- # # Test suite for the 'tcl::unsupported::assemble' command # # Copyright © 2010 Ozgur Dogan Ugurlu. # Copyright © 2010 Kevin B. Kenny. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. #----------------------------------------------------------------------------- # Commands covered: assemble if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } namespace eval tcl::unsupported {namespace export assemble} namespace import tcl::unsupported::assemble # Procedure to make code that fills the literal and local variable tables, to # force instructions to spill to four bytes. proc fillTables {} { set s {} set sep {} for {set i 0} {$i < 256} {incr i} { append s $sep [list set v$i literal$i] set sep \n } return $s } testConstraint memory [llength [info commands memory]] if {[testConstraint memory]} { proc getbytes {} { set lines [split [memory info] \n] return [lindex $lines 3 3] } proc leaktest {script {iterations 3}} { set end [getbytes] for {set i 0} {$i < $iterations} {incr i} { uplevel 1 $script set tmp $end set end [getbytes] } return [expr {$end - $tmp}] } } # assemble-1 - TclNRAssembleObjCmd test assemble-1.1 {wrong # args, direct eval} { -body { eval [list assemble] } -returnCodes error -result {wrong # args*} -match glob } test assemble-1.2 {wrong # args, direct eval} { -body { eval [list assemble too many] } -returnCodes error -result {wrong # args*} -match glob } test assemble-1.3 {error reporting, direct eval} { -body { list [catch { eval [list assemble { # bad opcode rubbish }] } result] $result $errorInfo } -match glob -result {1 {bad instruction "rubbish":*} {bad instruction "rubbish":* while executing "rubbish" ("assemble" body, line 3)*}} -cleanup {unset result} } test assemble-1.4 {simple direct eval} { -body { eval [list assemble {push {this is a test}}] } -result {this is a test} } # assemble-2 - CompileAssembleObj test assemble-2.1 {bytecode reuse, direct eval} { -body { set x {push "this is a test"} list [eval [list assemble $x]] \ [eval [list assemble $x]] } -result {{this is a test} {this is a test}} } test assemble-2.2 {bytecode discard, direct eval} { -body { set x {load value} proc p1 {x} { set value value1 assemble $x } proc p2 {x} { set a b set value value2 assemble $x } list [p1 $x] [p2 $x] } -result {value1 value2} -cleanup { unset x rename p1 {} rename p2 {} } } test assemble-2.3 {null script, direct eval} { -body { set x {} assemble $x } -result {} -cleanup {unset x} } # assemble-3 - TclCompileAssembleCmd test assemble-3.1 {wrong # args, compiled path} { -body { proc x {} { assemble } x } -returnCodes error -match glob -result {wrong # args:*} -cleanup {rename x {}} } test assemble-3.2 {wrong # args, compiled path} { -body { proc x {} { assemble too many } x } -returnCodes error -match glob -result {wrong # args:*} -cleanup { rename x {} } } # assemble-4 - TclAssembleCode mainline test assemble-4.1 {syntax error} { -body { proc x {} { assemble { {}extra } } list [catch x result] $result $::errorInfo } -cleanup { rename x {} unset result } -match glob -result {1 {extra characters after close-brace} {extra characters after close-brace while executing "{}e" ("assemble" body, line 2)*}} } test assemble-4.2 {null command} { -body { proc x {} { assemble { push hello; pop;;push goodbye } } x } -result goodbye -cleanup { rename x {} } } # assemble-5 - GetNextOperand off-nominal cases test assemble-5.1 {unsupported expansion} { -body { proc x {y} { assemble { {*}$y } } list [catch {x {push hello}} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} -cleanup { rename x {} unset result } } test assemble-5.2 {unsupported substitution} { -body { proc x {y} { assemble { $y } } list [catch {x {nop}} result] $result $::errorCode } -cleanup { rename x {} unset result } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} } test assemble-5.3 {unsupported substitution} { -body { proc x {} { assemble { [x] } } list [catch {x} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} -cleanup {rename x {}} } test assemble-5.4 {backslash substitution} { -body { proc x {} { assemble { p\x75sh\ hello\ world } } x } -cleanup { rename x {} } -result {hello world} } # assemble-6 - ASSEM_PUSH test assemble-6.1 {push, wrong # args} { -body { assemble push } -returnCodes error -match glob -result {wrong # args*} } test assemble-6.2 {push, wrong # args} { -body { assemble {push too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-6.3 {push} { -body { eval [list assemble {push hello}] } -result hello } test assemble-6.4 {push4} { -body { proc x {} " [fillTables] assemble {push hello} " x } -cleanup { rename x {} } -result hello } # assemble-7 - ASSEM_1BYTE test assemble-7.1 {add, wrong # args} { -body { assemble {add excess} } -returnCodes error -match glob -result {wrong # args*} } test assemble-7.2 {add} { -body { assemble { push 2 push 2 add } } -result {4} } test assemble-7.3 {appendArrayStk} { -body { set a(b) {hello, } assemble { push a push b push world appendArrayStk } set a(b) } -result {hello, world} -cleanup {unset a} } test assemble-7.4 {appendStk} { -body { set a {hello, } assemble { push a push world appendStk } set a } -result {hello, world} -cleanup {unset a} } test assemble-7.5 {bitwise ops} { -body { list \ [assemble {push 0b1100; push 0b1010; bitand}] \ [assemble {push 0b1100; bitnot}] \ [assemble {push 0b1100; push 0b1010; bitor}] \ [assemble {push 0b1100; push 0b1010; bitxor}] } -result {8 -13 14 6} } test assemble-7.6 {div} { -body { assemble {push 999999; push 7; div} } -result 142857 } test assemble-7.7 {dup} { -body { assemble { push 1; dup; dup; add; dup; add; dup; add; add } } -result 9 } test assemble-7.8 {eq} { -body { list \ [assemble {push able; push baker; eq}] \ [assemble {push able; push able; eq}] } -result {0 1} } test assemble-7.9 {evalStk} { -body { assemble { push {concat test 7.3} evalStk } } -result {test 7.3} } test assemble-7.9a {evalStk, syntax} { -body { assemble { push {{}bad} evalStk } } -returnCodes error -result {extra characters after close-brace} } test assemble-7.9b {evalStk, backtrace} { -body { proc y {z} { error testing } proc x {} { assemble { push { # test error in evalStk y asd } evalStk } } list [catch x result] $result $errorInfo } -result {1 testing {testing while executing "error testing" (procedure "y" line 2) invoked from within "y asd"*}} -match glob -cleanup { rename y {} rename x {} } } test assemble-7.10 {existArrayStk} { -body { proc x {name key} { set a(b) c assemble { load name; load key; existArrayStk } } list [x a a] [x a b] [x b a] [x b b] } -result {0 1 0 0} -cleanup {rename x {}} } test assemble-7.11 {existStk} { -body { proc x {name} { set a b assemble { load name; existStk } } list [x a] [x b] } -result {1 0} -cleanup {rename x {}} } test assemble-7.12 {expon} { -body { assemble {push 3; push 4; expon} } -result 81 } test assemble-7.13 {exprStk} { -body { assemble { push {acos(-1)} exprStk } } -result 3.141592653589793 } test assemble-7.13a {exprStk, syntax} { -body { assemble { push {2+} exprStk } } -returnCodes error -result {missing operand at _@_ in expression "2+_@_"} } test assemble-7.13b {exprStk, backtrace} { -body { proc y {z} { error testing } proc x {} { assemble { push {[y asd]} exprStk } } list [catch x result] $result $errorInfo } -result {1 testing {testing while executing "error testing" (procedure "y" line 2) invoked from within "y asd"*}} -match glob -cleanup { rename y {} rename x {} } } test assemble-7.14 {ge gt le lt} { -body { proc x {a b} { list [assemble {load a; load b; ge}] \ [assemble {load a; load b; gt}] \ [assemble {load a; load b; le}] \ [assemble {load a; load b; lt}] } list [x 0 0] [x 0 1] [x 1 0] } -result {{1 0 1 0} {0 0 1 1} {1 1 0 0}} -cleanup {rename x {}} } test assemble-7.15 {incrArrayStk} { -body { proc x {} { set a(b) 5 assemble { push a; push b; push 7; incrArrayStk } } x } -result 12 -cleanup {rename x {}} } test assemble-7.16 {incrStk} { -body { proc x {} { set a 5 assemble { push a; push 7; incrStk } } x } -result 12 -cleanup {rename x {}} } test assemble-7.18 {lappendArrayStk} { -body { proc x {} { set able(baker) charlie assemble { push able push baker push dog lappendArrayStk } } x } -result {charlie dog} -cleanup {rename x {}} } test assemble-7.19 {lappendStk} { -body { proc x {} { set able baker assemble { push able push charlie lappendStk } } x } -result {baker charlie} -cleanup {rename x {}} } test assemble-7.20 {listIndex} { -body { assemble { push {a b c d} push 2 listIndex } } -result c } test assemble-7.21 {listLength} { -body { assemble { push {a b c d} listLength } } -result 4 } test assemble-7.22 {loadArrayStk} { -body { proc x {} { set able(baker) charlie assemble { push able push baker loadArrayStk } } x } -result charlie -cleanup {rename x {}} } test assemble-7.23 {loadStk} { -body { proc x {} { set able baker assemble { push able loadStk } } x } -result baker -cleanup {rename x {}} } test assemble-7.24 {lsetList} { -body { proc x {} { set l {{a b} {c d} {e f} {g h}} assemble { push {2 1}; push i; load l; lsetList } } x } -result {{a b} {c d} {e i} {g h}} -cleanup {rename x {}} } test assemble-7.25 {lshift} { -body { assemble {push 16; push 4; lshift} } -result 256 } test assemble-7.26 {mod} { -body { assemble {push 123456; push 1000; mod} } -result 456 } test assemble-7.27 {mult} { -body { assemble {push 12345679; push 9; mult} } -result 111111111 } test assemble-7.28 {neq} { -body { list \ [assemble {push able; push baker; neq}] \ [assemble {push able; push able; neq}] } -result {1 0} } test assemble-7.29 {not} { -body { list \ [assemble {push 17; not}] \ [assemble {push 0; not}] } -result {0 1} } test assemble-7.30 {pop} { -body { assemble {push this; pop; push that} } -result that } test assemble-7.31 {rshift} { -body { assemble {push 257; push 4; rshift} } -result 16 } test assemble-7.32 {storeArrayStk} { -body { proc x {} { assemble { push able; push baker; push charlie; storeArrayStk } array get able } x } -result {baker charlie} -cleanup {rename x {}} } test assemble-7.33 {storeStk} { -body { proc x {} { assemble { push able; push baker; storeStk } set able } x } -result {baker} -cleanup {rename x {}} } test assemble-7,34 {strcmp} { -body { proc x {a b} { assemble { load a; load b; strcmp } } list [x able baker] [x baker able] [x baker baker] } -result {-1 1 0} -cleanup {rename x {}} } test assemble-7.35 {streq/strneq} { -body { proc x {a b} { list \ [assemble {load a; load b; streq}] \ [assemble {load a; load b; strneq}] } list [x able able] [x able baker] } -result {{1 0} {0 1}} -cleanup {rename x {}} } test assemble-7.36 {strindex} { -body { assemble {push testing; push 4; strindex} } -result i } test assemble-7.37 {strlen} { -body { assemble {push testing; strlen} } -result 7 } test assemble-7.38 {sub} { -body { assemble {push 42; push 17; sub} } -result 25 } test assemble-7.39 {tryCvtToNumeric} { -body { assemble { push 42; tryCvtToNumeric } } -result 42 } # assemble-7.40 absent test assemble-7.41 {uminus} { -body { assemble { push 42; uminus } } -result -42 } test assemble-7.42 {uplus} { -body { assemble { push 42; uplus } } -result 42 } test assemble-7.43 {uplus} { -body { assemble { push NaN; uplus } } -returnCodes error -result {cannot use non-numeric floating-point value "NaN" as operand of "+"} } test assemble-7.43.1 {tryCvtToNumeric} { -body { assemble { push NaN; tryCvtToNumeric } } -returnCodes error -result {domain error: argument not in valid range} } test assemble-7.44 {listIn} { -body { assemble { push b; push {a b c}; listIn } } -result 1 } test assemble-7.45 {listNotIn} { -body { assemble { push d; push {a b c}; listNotIn } } -result 1 } test assemble-7.46 {nop} { -body { assemble { push x; nop; nop; nop} } -result x } # assemble-8 ASSEM_LVT and FindLocalVar test assemble-8.1 {load, wrong # args} { -body { assemble load } -returnCodes error -match glob -result {wrong # args*} } test assemble-8.2 {load, wrong # args} { -body { assemble {load too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-8.3 {nonlocal var} { -body { list [catch {assemble {load ::env}} result] $result $errorCode } -result {1 {variable "::env" is not local} {TCL ASSEM NONLOCAL ::env}} -cleanup {unset result} } test assemble-8.4 {bad context} { -body { set x 1 list [catch {assemble {load x}} result] $result $errorCode } -result {1 {cannot use this instruction to create a variable in a non-proc context} {TCL ASSEM LVT}} -cleanup {unset result} } test assemble-8.5 {bad context} { -body { namespace eval assem { set x 1 assemble {load x} } } -result {cannot use this instruction to create a variable in a non-proc context} -errorCode {TCL ASSEM LVT} -cleanup {namespace delete assem} } test assemble-8.6 {load1} { -body { proc x {a} { assemble { load a } } x able } -result able -cleanup {rename x {}} } test assemble-8.7 {load4} { -body { proc x {a} " [fillTables] set b \$a assemble {load b} " x able } -result able -cleanup {rename x {}} } test assemble-8.8 {loadArray1} { -body { proc x {} { set able(baker) charlie assemble { push baker loadArray able } } x } -result charlie -cleanup {rename x {}} } test assemble-8.9 {loadArray4} { -body " proc x {} { [fillTables] set able(baker) charlie assemble { push baker loadArray able } } x " -result charlie -cleanup {rename x {}} } test assemble-8.10 {append1} { -body { proc x {} { set y {hello, } assemble { push world; append y } } x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.11 {append4} { -body { proc x {} " [fillTables] set y {hello, } assemble { push world; append y } " x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.12 {appendArray1} { -body { proc x {} { set y(z) {hello, } assemble { push z; push world; appendArray y } } x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.13 {appendArray4} { -body { proc x {} " [fillTables] set y(z) {hello, } assemble { push z; push world; appendArray y } " x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.14 {lappend1} { -body { proc x {} { set y {hello,} assemble { push world; lappend y } } x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.15 {lappend4} { -body { proc x {} " [fillTables] set y {hello,} assemble { push world; lappend y } " x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.16 {lappendArray1} { -body { proc x {} { set y(z) {hello,} assemble { push z; push world; lappendArray y } } x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.17 {lappendArray4} { -body { proc x {} " [fillTables] set y(z) {hello,} assemble { push z; push world; lappendArray y } " x } -result {hello, world} -cleanup {rename x {}} } test assemble-8.18 {store1} { -body { proc x {} { assemble { push test; store y } set y } x } -result {test} -cleanup {rename x {}} } test assemble-8.19 {store4} { -body { proc x {} " [fillTables] assemble { push test; store y } set y " x } -result test -cleanup {rename x {}} } test assemble-8.20 {storeArray1} { -body { proc x {} { assemble { push z; push test; storeArray y } set y(z) } x } -result test -cleanup {rename x {}} } test assemble-8.21 {storeArray4} { -body { proc x {} " [fillTables] assemble { push z; push test; storeArray y } " x } -result test -cleanup {rename x {}} } # assemble-9 - ASSEM_CONCAT1, GetIntegerOperand, CheckOneByte test assemble-9.1 {wrong # args} { -body {assemble concat} -result {wrong # args*} -match glob -returnCodes error } test assemble-9.2 {wrong # args} { -body {assemble {concat too many}} -result {wrong # args*} -match glob -returnCodes error } test assemble-9.3 {not a number} { -body {assemble {concat rubbish}} -result {expected integer but got "rubbish"} -returnCodes error } test assemble-9.4 {too small} { -body {assemble {concat -1}} -result {operand does not fit in one byte} -returnCodes error } test assemble-9.5 {too small} { -body {assemble {concat 256}} -result {operand does not fit in one byte} -returnCodes error } test assemble-9.6 {concat} { -body { assemble {push h; push e; push l; push l; push o; concat 5} } -result hello } test assemble-9.7 {concat} { -body { assemble {concat 0} } -result {operand must be positive} -errorCode {TCL ASSEM POSITIVE} } # assemble-10 -- eval and expr test assemble-10.1 {eval - wrong # args} { -body { assemble {eval} } -returnCodes error -match glob -result {wrong # args*} } test assemble-10.2 {eval - wrong # args} { -body { assemble {eval too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-10.3 {eval} { -body { proc x {} { assemble { push 3 store n pop eval {expr {3*$n + 1}} push 1 add } } x } -result 11 -cleanup {rename x {}} } test assemble-10.4 {expr} { -body { proc x {} { assemble { push 3 store n pop expr {3*$n + 1} push 1 add } } x } -result 11 -cleanup {rename x {}} } test assemble-10.5 {eval and expr - nonsimple} { -body { proc x {} { assemble { eval "s\x65t n 3" pop expr "\x33*\$n + 1" push 1 add } } x } -result 11 -cleanup { rename x {} } } test assemble-10.6 {eval - noncompilable} { -body { list [catch {assemble {eval $x}} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} } test assemble-10.7 {expr - noncompilable} { -body { list [catch {assemble {expr $x}} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} } # assemble-11 - ASSEM_LVT4 (exist, existArray, dictAppend, dictLappend, # nsupvar, variable, upvar) test assemble-11.1 {exist - wrong # args} { -body { assemble {exist} } -returnCodes error -match glob -result {wrong # args*} } test assemble-11.2 {exist - wrong # args} { -body { assemble {exist too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-11.3 {nonlocal var} { -body { list [catch {assemble {exist ::env}} result] $result $errorCode } -result {1 {variable "::env" is not local} {TCL ASSEM NONLOCAL ::env}} -cleanup {unset result} } test assemble-11.4 {exist} { -body { proc x {} { set y z list [assemble {exist y}] \ [assemble {exist z}] } x } -result {1 0} -cleanup {rename x {}} } test assemble-11.5 {existArray} { -body { proc x {} { set a(b) c list [assemble {push b; existArray a}] \ [assemble {push c; existArray a}] \ [assemble {push a; existArray b}] } x } -result {1 0 0} -cleanup {rename x {}} } test assemble-11.6 {dictAppend} { -body { proc x {} { set dict {a 1 b 2 c 3} assemble {push b; push 22; dictAppend dict} } x } -result {a 1 b 222 c 3} -cleanup {rename x {}} } test assemble-11.7 {dictLappend} { -body { proc x {} { set dict {a 1 b 2 c 3} assemble {push b; push 2; dictLappend dict} } x } -result {a 1 b {2 2} c 3} -cleanup {rename x {}} } test assemble-11.8 {upvar} { -body { proc x {v} { assemble {push 1; load v; upvar w; pop; load w} } proc y {} { set z 123 x z } y } -result 123 -cleanup {rename x {}; rename y {}} } test assemble-11.9 {nsupvar} { -body { namespace eval q { variable v 123 } proc x {} { assemble {push q; push v; nsupvar y; pop; load y} } x } -result 123 -cleanup {namespace delete q; rename x {}} } test assemble-11.10 {variable} { -body { namespace eval q { namespace eval r {variable v 123}} proc x {} { assemble {push q::r::v; variable y; load y} } x } -result 123 -cleanup {namespace delete q; rename x {}} } # assemble-12 - ASSEM_LVT1 (incr and incrArray) test assemble-12.1 {incr - wrong # args} { -body { assemble {incr} } -returnCodes error -match glob -result {wrong # args*} } test assemble-12.2 {incr - wrong # args} { -body { assemble {incr too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-12.3 {incr nonlocal var} { -body { list [catch {assemble {incr ::env}} result] $result $errorCode } -result {1 {variable "::env" is not local} {TCL ASSEM NONLOCAL ::env}} -cleanup {unset result} } test assemble-12.4 {incr} { -body { proc x {} { set y 5 assemble {push 3; incr y} } x } -result 8 -cleanup {rename x {}} } test assemble-12.5 {incrArray} { -body { proc x {} { set a(b) 5 assemble {push b; push 3; incrArray a} } x } -result 8 -cleanup {rename x {}} } test assemble-12.6 {incr, stupid stack restriction} { -body { proc x {} " [fillTables] set y 5 assemble {push 3; incr y} " list [catch {x} result] $result $errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {unset result; rename x {}} } # assemble-13 -- ASSEM_LVT1_SINT1 - incrImm and incrArrayImm test assemble-13.1 {incrImm - wrong # args} { -body { assemble {incrImm x} } -returnCodes error -match glob -result {wrong # args*} } test assemble-13.2 {incrImm - wrong # args} { -body { assemble {incrImm too many args} } -returnCodes error -match glob -result {wrong # args*} } test assemble-13.3 {incrImm nonlocal var} { -body { list [catch {assemble {incrImm ::env 2}} result] $result $errorCode } -result {1 {variable "::env" is not local} {TCL ASSEM NONLOCAL ::env}} -cleanup {unset result} } test assemble-13.4 {incrImm not a number} { -body { proc x {} { assemble {incrImm x rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-13.5 {incrImm too big} { -body { proc x {} { assemble {incrImm x 0x80} } list [catch x result] $result $::errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {rename x {}; unset result} } test assemble-13.6 {incrImm too small} { -body { proc x {} { assemble {incrImm x -0x81} } list [catch x result] $result $::errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {rename x {}; unset result} } test assemble-13.7 {incrImm} { -body { proc x {} { set y 1 list [assemble {incrImm y -0x80}] [assemble {incrImm y 0x7f}] } x } -result {-127 0} -cleanup {rename x {}} } test assemble-13.8 {incrArrayImm} { -body { proc x {} { set a(b) 5 assemble {push b; incrArrayImm a 3} } x } -result 8 -cleanup {rename x {}} } test assemble-13.9 {incrImm, stupid stack restriction} { -body { proc x {} " [fillTables] set y 5 assemble {incrImm y 3} " list [catch {x} result] $result $errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {unset result; rename x {}} } # assemble-14 -- ASSEM_SINT1 (incrArrayStkImm and incrStkImm) test assemble-14.1 {incrStkImm - wrong # args} { -body { assemble {incrStkImm} } -returnCodes error -match glob -result {wrong # args*} } test assemble-14.2 {incrStkImm - wrong # args} { -body { assemble {incrStkImm too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-14.3 {incrStkImm not a number} { -body { proc x {} { assemble {incrStkImm rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-14.4 {incrStkImm too big} { -body { proc x {} { assemble {incrStkImm 0x80} } list [catch x result] $result $::errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {rename x {}; unset result} } test assemble-14.5 {incrStkImm too small} { -body { proc x {} { assemble {incrStkImm -0x81} } list [catch x result] $result $::errorCode } -result {1 {operand does not fit in one byte} {TCL ASSEM 1BYTE}} -cleanup {rename x {}; unset result} } test assemble-14.6 {incrStkImm} { -body { proc x {} { set y 1 list [assemble {push y; incrStkImm -0x80}] \ [assemble {push y; incrStkImm 0x7f}] } x } -result {-127 0} -cleanup {rename x {}} } test assemble-14.7 {incrArrayStkImm} { -body { proc x {} { set a(b) 5 assemble {push a; push b; incrArrayStkImm 3} } x } -result 8 -cleanup {rename x {}} } # assemble-15 - listIndexImm test assemble-15.1 {listIndexImm - wrong # args} -body { assemble {listIndexImm} } -returnCodes error -match glob -result {wrong # args*} test assemble-15.2 {listIndexImm - wrong # args} -body { assemble {listIndexImm too many} } -returnCodes error -match glob -result {wrong # args*} test assemble-15.3 {listIndexImm - bad substitution} -body { list [catch {assemble {listIndexImm $foo}} result] $result $::errorCode } -cleanup { unset result } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} test assemble-15.4 {listIndexImm - invalid index} -body { assemble {listIndexImm rubbish} } -returnCodes error -match glob -result {bad index "rubbish"*} test assemble-15.5 {listIndexImm} -body { assemble {push {a b c}; listIndexImm 2} } -result c test assemble-15.6 {listIndexImm} -body { assemble {push {a b c}; listIndexImm end-1} } -result b test assemble-15.7 {listIndexImm} -body { assemble {push {a b c}; listIndexImm end} } -result c test assemble-15.8 {listIndexImm} -body { assemble {push {a b c}; listIndexImm end+2} } -result {} test assemble-15.9 {listIndexImm} -body { assemble {push {a b c}; listIndexImm -1-1} } -result {} # assemble-16 - invokeStk test assemble-16.1 {invokeStk - wrong # args} { -body { assemble {invokeStk} } -returnCodes error -match glob -result {wrong # args*} } test assemble-16.2 {invokeStk - wrong # args} { -body { assemble {invokeStk too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-16.3 {invokeStk - not a number} { -body { proc x {} { assemble {invokeStk rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-16.4 {invokeStk - no operands} { -body { proc x {} { assemble {invokeStk 0} } list [catch x result] $result $::errorCode } -result {1 {operand must be positive} {TCL ASSEM POSITIVE}} -cleanup {rename x {}; unset result} } test assemble-16.5 {invokeStk1} { -body { tcl::unsupported::assemble {push concat; push 1; push 2; invokeStk 3} } -result {1 2} } test assemble-16.6 {invokeStk4} { -body { proc x {n} { set code {push concat} set shouldbe {} for {set i 1} {$i < $n} {incr i} { append code \n {push a} $i lappend shouldbe a$i } append code \n {invokeStk} { } $n set is [assemble $code] expr {$is eq $shouldbe} } list [x 254] [x 255] [x 256] [x 257] } -result {1 1 1 1} -cleanup {rename x {}} } # assemble-17 -- jumps and labels test assemble-17.1 {label, wrong # args} { -body { assemble {label} } -returnCodes error -match glob -result {wrong # args*} } test assemble-17.2 {label, wrong # args} { -body { assemble {label too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-17.3 {label, bad subst} { -body { list [catch {assemble {label $foo}} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} -cleanup {unset result} } test assemble-17.4 {duplicate label} { -body { list [catch {assemble {label foo; label foo}} result] \ $result $::errorCode } -result {1 {duplicate definition of label "foo"} {TCL ASSEM DUPLABEL foo}} } test assemble-17.5 {jump, wrong # args} { -body { assemble {jump} } -returnCodes error -match glob -result {wrong # args*} } test assemble-17.6 {jump, wrong # args} { -body { assemble {jump too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-17.7 {jump, bad subst} { -body { list [catch {assemble {jump $foo}} result] $result $::errorCode } -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}} -cleanup {unset result} } test assemble-17.8 {jump - ahead and back} { -body { assemble { jump three label one push a jump four label two push b jump six label three push c jump five label four push d jump two label five push e jump one label six push f concat 6 } } -result ceadbf } test assemble-17.9 {jump - resolve a label multiple times} { -body { proc x {} { set case 0 set result {} assemble { jump common label zero pop incrImm case 1 pop push a append result pop jump common label one pop incrImm case 1 pop push b append result pop jump common label common load case dup push 0 eq jumpTrue zero dup push 1 eq jumpTrue one dup push 2 eq jumpTrue two dup push 3 eq jumpTrue three label two pop incrImm case 1 pop push c append result pop jump common label three pop incrImm case 1 pop push d append result } } x } -result abcd -cleanup {rename x {}} } test assemble-17.10 {jump4 needed} { -body { assemble "push x; jump one; label two; [string repeat {dup; pop;} 128] jump three; label one; jump two; label three" } -result x } test assemble-17.11 {jumpTrue} { -body { proc x {y} { assemble { load y jumpTrue then push no jump else label then push yes label else } } list [x 0] [x 1] } -result {no yes} -cleanup {rename x {}} } test assemble-17.12 {jumpFalse} { -body { proc x {y} { assemble { load y jumpFalse then push no jump else label then push yes label else } } list [x 0] [x 1] } -result {yes no} -cleanup {rename x {}} } test assemble-17.13 {jump to undefined label} { -body { list [catch {assemble {jump nowhere}} result] $result $::errorCode } -result {1 {undefined label "nowhere"} {TCL ASSEM NOLABEL nowhere}} } test assemble-17.14 {jump to undefined label, line number correct?} { -body { catch {assemble {#1 #2 #3 jump nowhere #5 #6 }} set ::errorInfo } -match glob -result {*"assemble" body, line 4*} } test assemble-17.15 {multiple passes of code resizing} { -setup { set body { push - } for {set i 0} {$i < 14} {incr i} { append body "label a" $i \ "; push a; concat 2; nop; nop; jump b" \ $i \n } append body {label a14; push a; concat 2; push 1; jumpTrue b14} \n append body {label a15; push a; concat 2; push 0; jumpFalse b15} \n for {set i 0} {$i < 15} {incr i} { append body "label b" $i \ "; push b; concat 2; nop; nop; jump a" \ [expr {$i+1}] \n } append body {label c; push -; concat 2; nop; nop; nop; jump d} \n append body {label b15; push b; concat 2; nop; nop; jump c} \n append body {label d} proc x {} [list assemble $body] } -body { x } -cleanup { catch {unset body} catch {rename x {}} } -result -abababababababababababababababab- } # assemble-18 - lindexMulti test assemble-18.1 {lindexMulti - wrong # args} { -body { assemble {lindexMulti} } -returnCodes error -match glob -result {wrong # args*} } test assemble-18.2 {lindexMulti - wrong # args} { -body { assemble {lindexMulti too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-18.3 {lindexMulti - bad subst} { -body { assemble {lindexMulti $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-18.4 {lindexMulti - not a number} { -body { proc x {} { assemble {lindexMulti rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-18.5 {lindexMulti - bad operand count} { -body { proc x {} { assemble {lindexMulti 0} } list [catch x result] $result $::errorCode } -result {1 {operand must be positive} {TCL ASSEM POSITIVE}} -cleanup {rename x {}; unset result} } test assemble-18.6 {lindexMulti} { -body { assemble {push {{a b c} {d e f} {g h j}}; lindexMulti 1} } -result {{a b c} {d e f} {g h j}} } test assemble-18.7 {lindexMulti} { -body { assemble {push {{a b c} {d e f} {g h j}}; push 1; lindexMulti 2} } -result {d e f} } test assemble-18.8 {lindexMulti} { -body { assemble {push {{a b c} {d e f} {g h j}}; push 2; push 1; lindexMulti 3} } -result h } # assemble-19 - list test assemble-19.1 {list - wrong # args} { -body { assemble {list} } -returnCodes error -match glob -result {wrong # args*} } test assemble-19.2 {list - wrong # args} { -body { assemble {list too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-19.3 {list - bad subst} { -body { assemble {list $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-19.4 {list - not a number} { -body { proc x {} { assemble {list rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-19.5 {list - negative operand count} { -body { proc x {} { assemble {list -1} } list [catch x result] $result $::errorCode } -result {1 {operand must be nonnegative} {TCL ASSEM NONNEGATIVE}} -cleanup {rename x {}; unset result} } test assemble-19.6 {list - no args} { -body { assemble {list 0} } -result {} } test assemble-19.7 {list - 1 arg} { -body { assemble {push hello; list 1} } -result hello } test assemble-19.8 {list - 2 args} { -body { assemble {push hello; push world; list 2} } -result {hello world} } # assemble-20 - lsetFlat test assemble-20.1 {lsetFlat - wrong # args} { -body { assemble {lsetFlat} } -returnCodes error -match glob -result {wrong # args*} } test assemble-20.2 {lsetFlat - wrong # args} { -body { assemble {lsetFlat too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-20.3 {lsetFlat - bad subst} { -body { assemble {lsetFlat $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-20.4 {lsetFlat - not a number} { -body { proc x {} { assemble {lsetFlat rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-20.5 {lsetFlat - negative operand count} { -body { proc x {} { assemble {lsetFlat 1} } list [catch x result] $result $::errorCode } -result {1 {operand must be >=2} {TCL ASSEM OPERAND>=2}} -cleanup {rename x {}; unset result} } test assemble-20.6 {lsetFlat} { -body { assemble {push b; push a; lsetFlat 2} } -result b } test assemble-20.7 {lsetFlat} { -body { assemble {push 1; push d; push {a b c}; lsetFlat 3} } -result {a d c} } # assemble-21 - over test assemble-21.1 {over - wrong # args} { -body { assemble {over} } -returnCodes error -match glob -result {wrong # args*} } test assemble-21.2 {over - wrong # args} { -body { assemble {over too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-21.3 {over - bad subst} { -body { assemble {over $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-21.4 {over - not a number} { -body { proc x {} { assemble {over rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-21.5 {over - negative operand count} { -body { proc x {} { assemble {over -1} } list [catch x result] $result $::errorCode } -result {1 {operand must be nonnegative} {TCL ASSEM NONNEGATIVE}} -cleanup {rename x {}; unset result} } test assemble-21.6 {over} { -body { proc x {} { assemble { push 1 push 2 push 3 over 0 store x pop pop pop pop load x } } x } -result 3 -cleanup {rename x {}} } test assemble-21.7 {over} { -body { proc x {} { assemble { push 1 push 2 push 3 over 2 store x pop pop pop pop load x } } x } -result 1 -cleanup {rename x {}} } # assemble-22 - reverse test assemble-22.1 {reverse - wrong # args} { -body { assemble {reverse} } -returnCodes error -match glob -result {wrong # args*} } test assemble-22.2 {reverse - wrong # args} { -body { assemble {reverse too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-22.3 {reverse - bad subst} { -body { assemble {reverse $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-22.4 {reverse - not a number} { -body { proc x {} { assemble {reverse rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-22.5 {reverse - negative operand count} { -body { proc x {} { assemble {reverse -1} } list [catch x result] $result $::errorCode } -result {1 {operand must be nonnegative} {TCL ASSEM NONNEGATIVE}} -cleanup {rename x {}; unset result} } test assemble-22.6 {reverse - zero operand count} { -body { proc x {} { assemble {push 1; reverse 0} } x } -result 1 -cleanup {rename x {}} } test assemble-22.7 {reverse} { -body { proc x {} { assemble { push 1 push 2 push 3 reverse 1 store x pop pop pop load x } } x } -result 3 -cleanup {rename x {}} } test assemble-22.8 {reverse} { -body { proc x {} { assemble { push 1 push 2 push 3 reverse 3 store x pop pop pop load x } } x } -result 1 -cleanup {rename x {}} } # assemble-23 - ASSEM_BOOL (strmatch, unsetStk, unsetArrayStk) test assemble-23.1 {strmatch - wrong # args} { -body { assemble {strmatch} } -returnCodes error -match glob -result {wrong # args*} } test assemble-23.2 {strmatch - wrong # args} { -body { assemble {strmatch too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-23.3 {strmatch - bad subst} { -body { assemble {strmatch $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-23.4 {strmatch - not a boolean} { -body { proc x {} { assemble {strmatch rubbish} } x } -returnCodes error -result {expected boolean value but got "rubbish"} -cleanup {rename x {}} } test assemble-23.5 {strmatch} { -body { proc x {a b} { list [assemble {load a; load b; strmatch 0}] \ [assemble {load a; load b; strmatch 1}] } list [x foo*.grill fengbar.grill] [x foo*.grill foobar.grill] [x foo*.grill FOOBAR.GRILL] } -result {{0 0} {1 1} {0 1}} -cleanup {rename x {}} } test assemble-23.6 {unsetStk} { -body { proc x {} { set a {} assemble {push a; unsetStk false} info exists a } x } -result 0 -cleanup {rename x {}} } test assemble-23.7 {unsetStk} { -body { proc x {} { assemble {push a; unsetStk false} info exists a } x } -result 0 -cleanup {rename x {}} } test assemble-23.8 {unsetStk} { -body { proc x {} { assemble {push a; unsetStk true} info exists a } x } -returnCodes error -result {can't unset "a": no such variable} -cleanup {rename x {}} } test assemble-23.9 {unsetArrayStk} { -body { proc x {} { set a(b) {} assemble {push a; push b; unsetArrayStk false} info exists a(b) } x } -result 0 -cleanup {rename x {}} } test assemble-23.10 {unsetArrayStk} { -body { proc x {} { assemble {push a; push b; unsetArrayStk false} info exists a(b) } x } -result 0 -cleanup {rename x {}} } test assemble-23.11 {unsetArrayStk} { -body { proc x {} { assemble {push a; push b; unsetArrayStk true} info exists a(b) } x } -returnCodes error -result {can't unset "a(b)": no such variable} -cleanup {rename x {}} } # assemble-24 -- ASSEM_BOOL_LVT4 (unset; unsetArray) test assemble-24.1 {unset - wrong # args} { -body { assemble {unset one} } -returnCodes error -match glob -result {wrong # args*} } test assemble-24.2 {unset - wrong # args} { -body { assemble {unset too many args} } -returnCodes error -match glob -result {wrong # args*} } test assemble-24.3 {unset - bad subst -arg 1} { -body { assemble {unset $foo bar} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-24.4 {unset - not a boolean} { -body { proc x {} { assemble {unset rubbish trash} } x } -returnCodes error -result {expected boolean value but got "rubbish"} -cleanup {rename x {}} } test assemble-24.5 {unset - bad subst - arg 2} { -body { assemble {unset true $bar} } -returnCodes error -result {assembly code may not contain substitutions} } test assemble-24.6 {unset - nonlocal var} { -body { assemble {unset true ::foo::bar} } -returnCodes error -result {variable "::foo::bar" is not local} } test assemble-24.7 {unset} { -body { proc x {} { set a {} assemble {unset false a} info exists a } x } -result 0 -cleanup {rename x {}} } test assemble-24.8 {unset} { -body { proc x {} { assemble {unset false a} info exists a } x } -result 0 -cleanup {rename x {}} } test assemble-24.9 {unset} { -body { proc x {} { assemble {unset true a} info exists a } x } -returnCodes error -result {can't unset "a": no such variable} -cleanup {rename x {}} } test assemble-24.10 {unsetArray} { -body { proc x {} { set a(b) {} assemble {push b; unsetArray false a} info exists a(b) } x } -result 0 -cleanup {rename x {}} } test assemble-24.11 {unsetArray} { -body { proc x {} { assemble {push b; unsetArray false a} info exists a(b) } x } -result 0 -cleanup {rename x {}} } test assemble-24.12 {unsetArray} { -body { proc x {} { assemble {push b; unsetArray true a} info exists a(b) } x } -returnCodes error -result {can't unset "a(b)": no such variable} -cleanup {rename x {}} } # assemble-25 - dict get test assemble-25.1 {dict get - wrong # args} { -body { assemble {dictGet} } -returnCodes error -match glob -result {wrong # args*} } test assemble-25.2 {dict get - wrong # args} { -body { assemble {dictGet too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-25.3 {dictGet - bad subst} { -body { assemble {dictGet $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-25.4 {dict get - not a number} { -body { proc x {} { assemble {dictGet rubbish} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-25.5 {dictGet - negative operand count} { -body { proc x {} { assemble {dictGet 0} } list [catch x result] $result $::errorCode } -result {1 {operand must be positive} {TCL ASSEM POSITIVE}} -cleanup {rename x {}; unset result} } test assemble-25.6 {dictGet - 1 index} { -body { assemble {push {a 1 b 2}; push a; dictGet 1} } -result 1 } # assemble-26 - dict set test assemble-26.1 {dict set - wrong # args} { -body { assemble {dictSet 1} } -returnCodes error -match glob -result {wrong # args*} } test assemble-26.2 {dict get - wrong # args} { -body { assemble {dictSet too many args} } -returnCodes error -match glob -result {wrong # args*} } test assemble-26.3 {dictSet - bad subst} { -body { assemble {dictSet 1 $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-26.4 {dictSet - not a number} { -body { proc x {} { assemble {dictSet rubbish foo} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-26.5 {dictSet - zero operand count} { -body { proc x {} { assemble {dictSet 0 foo} } list [catch x result] $result $::errorCode } -result {1 {operand must be positive} {TCL ASSEM POSITIVE}} -cleanup {rename x {}; unset result} } test assemble-26.6 {dictSet - bad local} { -body { proc x {} { assemble {dictSet 1 ::foo::bar} } list [catch x result] $result $::errorCode } -result {1 {variable "::foo::bar" is not local} {TCL ASSEM NONLOCAL ::foo::bar}} -cleanup {rename x {}; unset result} } test assemble-26.7 {dictSet} { -body { proc x {} { set dict {a 1 b 2 c 3} assemble {push b; push 4; dictSet 1 dict} } x } -result {a 1 b 4 c 3} -cleanup {rename x {}} } # assemble-27 - dictUnset test assemble-27.1 {dictUnset - wrong # args} { -body { assemble {dictUnset 1} } -returnCodes error -match glob -result {wrong # args*} } test assemble-27.2 {dictUnset - wrong # args} { -body { assemble {dictUnset too many args} } -returnCodes error -match glob -result {wrong # args*} } test assemble-27.3 {dictUnset - bad subst} { -body { assemble {dictUnset 1 $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-27.4 {dictUnset - not a number} { -body { proc x {} { assemble {dictUnset rubbish foo} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-27.5 {dictUnset - zero operand count} { -body { proc x {} { assemble {dictUnset 0 foo} } list [catch x result] $result $::errorCode } -result {1 {operand must be positive} {TCL ASSEM POSITIVE}} -cleanup {rename x {}; unset result} } test assemble-27.6 {dictUnset - bad local} { -body { proc x {} { assemble {dictUnset 1 ::foo::bar} } list [catch x result] $result $::errorCode } -result {1 {variable "::foo::bar" is not local} {TCL ASSEM NONLOCAL ::foo::bar}} -cleanup {rename x {}; unset result} } test assemble-27.7 {dictUnset} { -body { proc x {} { set dict {a 1 b 2 c 3} assemble {push b; dictUnset 1 dict} } x } -result {a 1 c 3} -cleanup {rename x {}} } # assemble-28 - dictIncrImm test assemble-28.1 {dictIncrImm - wrong # args} { -body { assemble {dictIncrImm 1} } -returnCodes error -match glob -result {wrong # args*} } test assemble-28.2 {dictIncrImm - wrong # args} { -body { assemble {dictIncrImm too many args} } -returnCodes error -match glob -result {wrong # args*} } test assemble-28.3 {dictIncrImm - bad subst} { -body { assemble {dictIncrImm 1 $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-28.4 {dictIncrImm - not a number} { -body { proc x {} { assemble {dictIncrImm rubbish foo} } x } -returnCodes error -result {expected integer but got "rubbish"} -cleanup {rename x {}} } test assemble-28.5 {dictIncrImm - bad local} { -body { proc x {} { assemble {dictIncrImm 1 ::foo::bar} } list [catch x result] $result $::errorCode } -result {1 {variable "::foo::bar" is not local} {TCL ASSEM NONLOCAL ::foo::bar}} -cleanup {rename x {}; unset result} } test assemble-28.6 {dictIncrImm} { -body { proc x {} { set dict {a 1 b 2 c 3} assemble {push b; dictIncrImm 42 dict} } x } -result {a 1 b 44 c 3} -cleanup {rename x {}} } # assemble-29 - ASSEM_REGEXP test assemble-29.1 {regexp - wrong # args} { -body { assemble {regexp} } -returnCodes error -match glob -result {wrong # args*} } test assemble-29.2 {regexp - wrong # args} { -body { assemble {regexp too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-29.3 {regexp - bad subst} { -body { assemble {regexp $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-29.4 {regexp - not a boolean} { -body { proc x {} { assemble {regexp rubbish} } x } -returnCodes error -result {expected boolean value but got "rubbish"} -cleanup {rename x {}} } test assemble-29.5 {regexp} { -body { assemble {push br.*br; push abracadabra; regexp false} } -result 1 } test assemble-29.6 {regexp} { -body { assemble {push br.*br; push aBRacadabra; regexp false} } -result 0 } test assemble-29.7 {regexp} { -body { assemble {push br.*br; push aBRacadabra; regexp true} } -result 1 } # assemble-30 - Catches test assemble-30.1 {simplest possible catch} { -body { proc x {} { assemble { beginCatch @bad push error push testing invokeStk 2 pop push 0 jump @ok label @bad push 1; # should be pushReturnCode label @ok endCatch } } x } -result 1 -cleanup {rename x {}} } test assemble-30.2 {catch in external catch conntext} { -body { proc x {} { list [catch { assemble { beginCatch @bad push error push testing invokeStk 2 pop push 0 jump @ok label @bad pushReturnCode label @ok endCatch } } result] $result } x } -result {0 1} -cleanup {rename x {}} } test assemble-30.3 {embedded catches} { -body { proc x {} { list [catch { assemble { beginCatch @bad push error eval { list [catch {error whatever} result] $result } invokeStk 2 push 0 reverse 2 jump @done label @bad pushReturnCode pushResult label @done endCatch list 2 } } result2] $result2 } x } -result {0 {1 {1 whatever}}} -cleanup {rename x {}} } test assemble-30.4 {throw in wrong context} { -body { proc x {} { list [catch { assemble { beginCatch @bad push error eval { list [catch {error whatever} result] $result } invokeStk 2 push 0 reverse 2 jump @done label @bad load x pushResult label @done endCatch list 2 } } result] $result $::errorCode [split $::errorInfo \n] } x } -match glob -result {1 {"loadScalar1" instruction may not appear in a context where an exception has been caught and not disposed of.} {TCL ASSEM BADTHROW} {{"loadScalar1" instruction may not appear in a context where an exception has been caught and not disposed of.} { in assembly code between lines 10 and 15}*}} -cleanup {rename x {}} } test assemble-30.5 {unclosed catch} { -body { proc x {} { assemble { beginCatch @error push 0 jump @done label @error push 1 label @done push "" pop } } list [catch {x} result] $result $::errorCode $::errorInfo } -match glob -result {1 {catch still active on exit from assembly code} {TCL ASSEM UNCLOSEDCATCH} {catch still active on exit from assembly code ("assemble" body, line 2)*}} -cleanup {rename x {}} } test assemble-30.6 {inconsistent catch contexts} { -body { proc x {y} { assemble { load y jumpTrue @inblock beginCatch @error label @inblock push 0 jump @done label @error push 1 label @done } } list [catch {x 2} result] $::errorCode $::errorInfo } -match glob -result {1 {TCL ASSEM BADCATCH} {execution reaches an instruction in inconsistent exception contexts ("assemble" body, line 5)*}} -cleanup {rename x {}} } # assemble-31 - Jump tables test assemble-31.1 {jumpTable, wrong # args} { -body { assemble {jumpTable} } -returnCodes error -match glob -result {wrong # args*} } test assemble-31.2 {jumpTable, wrong # args} { -body { assemble {jumpTable too many} } -returnCodes error -match glob -result {wrong # args*} } test assemble-31.3 {jumpTable - bad subst} { -body { assemble {jumpTable $foo} } -returnCodes error -match glob -result {assembly code may not contain substitutions} } test assemble-31.4 {jumptable - not a list} { -body { assemble {jumpTable \{rubbish} } -returnCodes error -result {unmatched open brace in list} } test assemble-31.5 {jumpTable, badly structured} { -body { list [catch {assemble { # line 2 jumpTable {one two three};# line 3 }} result] \ $result $::errorCode $::errorInfo } -match glob -result {1 {jump table must have an even number of list elements} {TCL ASSEM BADJUMPTABLE} {jump table must have an even number of list elements*("assemble" body, line 3)*}} } test assemble-31.6 {jumpTable, missing symbol} { -body { list [catch {assemble { # line 2 jumpTable {1 a};# line 3 }} result] \ $result $::errorCode $::errorInfo } -match glob -result {1 {undefined label "a"} {TCL ASSEM NOLABEL a} {undefined label "a"*("assemble" body, line 3)*}} } test assemble-31.7 {jumptable, actual example} { -setup { proc x {} { set result {} for {set i 0} {$i < 5} {incr i} { lappend result [assemble { load i jumpTable {1 @one 2 @two 3 @three} push {none of the above} jump @done label @one push one jump @done label @two push two jump @done label @three push three label @done }] } set tcl_traceCompile 2 set result } } -body x -result {{none of the above} one two three {none of the above}} -cleanup {set tcl_traceCompile 0; rename x {}} } test assemble-40.1 {unbalanced stack} { -body { list \ [catch { assemble { push 3 dup mult push 4 dup mult pop expon } } result] $result $::errorInfo } -result {1 {stack underflow} {stack underflow in assembly code between lines 1 and end of assembly code*}} -match glob -returnCodes ok } test assemble-40.2 {unbalanced stack} {*}{ -body { list \ [catch { assemble { label a push {} label b pop label c pop label d push {} } } result] $result $::errorInfo } -result {1 {stack underflow} {stack underflow in assembly code between lines 7 and 9*}} -match glob -returnCodes ok } test assemble-41.1 {Inconsistent stack usage} {*}{ -body { proc x {y} { assemble { load y jumpFalse else push 0 jump then label else push 1 push 2 label then pop } } catch {x 1} set errorInfo } -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 10)*} -cleanup {rename x {}} } test assemble-41.2 {Inconsistent stack, jumptable and default} { -body { proc x {y} { assemble { load y jumpTable {0 else} push 0 label else pop } } catch {x 1} set errorInfo } -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 6)*} -cleanup {rename x {}} } test assemble-41.3 {Inconsistent stack, two legs of jumptable} { -body { proc x {y} { assemble { load y jumpTable {0 no 1 yes} label no push 0 label yes pop } } catch {x 1} set errorInfo } -match glob -result {inconsistent stack depths on two execution paths ("assemble" body, line 7)*} -cleanup {rename x {}} } test assemble-50.1 {Ulam's 3n+1 problem, TAL implementation} { -body { proc ulam {n} { assemble { load n; # max dup; # max n jump start; # max n label loop; # max n over 1; # max n max over 1; # max in max n ge; # man n max>=n jumpTrue skip; # max n reverse 2; # n max pop; # n dup; # n n label skip; # max n dup; # max n n push 2; # max n n 2 mod; # max n n%2 jumpTrue odd; # max n push 2; # max n 2 div; # max n/2 -> max n jump start; # max n label odd; # max n push 3; # max n 3 mult; # max 3*n push 1; # max 3*n 1 add; # max 3*n+1 label start; # max n dup; # max n n push 1; # max n n 1 neq; # max n n>1 jumpTrue loop; # max n pop; # max } } set result {} for {set i 1} {$i < 30} {incr i} { lappend result [ulam $i] } set result } -result {1 2 16 4 16 16 52 8 52 16 52 16 40 52 160 16 52 52 88 20 64 52 160 24 88 40 9232 52 88} -cleanup {rename ulam {}} } test assemble-51.1 {memory leak testing} memory { leaktest { apply {{} {assemble {push hello}}} } } 0 test assemble-51.2 {memory leak testing} memory { leaktest { apply {{{x 0}} {assemble {incrImm x 1}}} } } 0 test assemble-51.3 {memory leak testing} memory { leaktest { apply {{n} { assemble { load n; # max dup; # max n jump start; # max n label loop; # max n over 1; # max n max over 1; # max in max n ge; # man n max>=n jumpTrue skip; # max n reverse 2; # n max pop; # n dup; # n n label skip; # max n dup; # max n n push 2; # max n n 2 mod; # max n n%2 jumpTrue odd; # max n push 2; # max n 2 div; # max n/2 -> max n jump start; # max n label odd; # max n push 3; # max n 3 mult; # max 3*n push 1; # max 3*n 1 add; # max 3*n+1 label start; # max n dup; # max n n push 1; # max n n 1 neq; # max n n>1 jumpTrue loop; # max n pop; # max } }} 1 } } 0 test assemble-51.4 {memory leak testing} memory { leaktest { catch { apply {{} { assemble {reverse polish notation} }} } } } 0 test assemble-52.1 {Bug 3154ea2759} { apply {{} { # Needs six exception ranges to force the range allocations to use the # malloced store. ::tcl::unsupported::assemble { beginCatch @badLabel push error push testing invokeStk 2 pop push 0 jump @okLabel label @badLabel push 1; # should be pushReturnCode label @okLabel endCatch pop beginCatch @badLabel2 push error push testing invokeStk 2 pop push 0 jump @okLabel2 label @badLabel2 push 1; # should be pushReturnCode label @okLabel2 endCatch pop beginCatch @badLabel3 push error push testing invokeStk 2 pop push 0 jump @okLabel3 label @badLabel3 push 1; # should be pushReturnCode label @okLabel3 endCatch pop beginCatch @badLabel4 push error push testing invokeStk 2 pop push 0 jump @okLabel4 label @badLabel4 push 1; # should be pushReturnCode label @okLabel4 endCatch pop beginCatch @badLabel5 push error push testing invokeStk 2 pop push 0 jump @okLabel5 label @badLabel5 push 1; # should be pushReturnCode label @okLabel5 endCatch pop beginCatch @badLabel6 push error push testing invokeStk 2 pop push 0 jump @okLabel6 label @badLabel6 push 1; # should be pushReturnCode label @okLabel6 endCatch pop } }} } {}; # must not crash rename fillTables {} rename assemble {} if {[testConstraint memory]} { rename getbytes {} rename leaktest {} } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/apply.test0000644000175000017500000002410115104661341014735 0ustar sergeisergei# Commands covered: apply # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2005-2006 Miguel Sofer # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] if {[info commands ::apply] eq {}} { return } testConstraint memory [llength [info commands memory]] testConstraint applylambda [llength [info commands testapplylambda]] # Tests for wrong number of arguments test apply-1.1 {not enough arguments} -returnCodes error -body { apply } -result {wrong # args: should be "apply lambdaExpr ?arg ...?"} # Tests for malformed lambda test apply-2.0 {malformed lambda} -returnCodes error -body { set lambda a apply $lambda } -result {can't interpret "a" as a lambda expression} test apply-2.1 {malformed lambda} -returnCodes error -body { set lambda [list a b c d] apply $lambda } -result {can't interpret "a b c d" as a lambda expression} test apply-2.2 {malformed lambda} { set lambda [list {{}} boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {argument with no name} {argument with no name (parsing lambda expression "{{}} boo") invoked from within "apply $lambda"}} test apply-2.3 {malformed lambda} { set lambda [list {{a b c}} boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {too many fields in argument specifier "a b c"} {too many fields in argument specifier "a b c" (parsing lambda expression "{{a b c}} boo") invoked from within "apply $lambda"}} test apply-2.4 {malformed lambda} { set lambda [list a(1) boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {formal parameter "a(1)" is an array element} {formal parameter "a(1)" is an array element (parsing lambda expression "a(1) boo") invoked from within "apply $lambda"}} test apply-2.5 {malformed lambda} { set lambda [list a::b boo] list [catch {apply $lambda} msg] $msg $::errorInfo } {1 {formal parameter "a::b" is not a simple name} {formal parameter "a::b" is not a simple name (parsing lambda expression "a::b boo") invoked from within "apply $lambda"}} # Tests for runtime errors in the lambda expression test apply-3.1 {non-existing namespace} -body { apply [list x {set x 1} ::NONEXIST::FOR::SURE] x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.2 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} ::NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST apply $lambda x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.3 {non-existing namespace} -body { apply [list x {set x 1} NONEXIST::FOR::SURE] x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-3.4 {non-existing namespace} -body { namespace eval ::NONEXIST::FOR::SURE {} set lambda [list x {set x 1} NONEXIST::FOR::SURE] apply $lambda x namespace delete ::NONEXIST apply $lambda x } -returnCodes error -result {namespace "::NONEXIST::FOR::SURE" not found} test apply-4.1 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] apply $lambda } -returnCodes error -result {wrong # args: should be "apply lambdaExpr x"} test apply-4.2 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] apply $lambda a b } -returnCodes error -result {wrong # args: should be "apply lambdaExpr x"} test apply-4.3 {error in arguments to lambda expression} -body { interp alias {} foo {} ::apply [list x {set x 1}] foo a b } -cleanup { rename foo {} } -returnCodes error -result {wrong # args: should be "foo x"} test apply-4.4 {error in arguments to lambda expression} -body { interp alias {} foo {} ::apply [list x {set x 1}] a foo b } -cleanup { rename foo {} } -returnCodes error -result {wrong # args: should be "foo"} test apply-4.5 {error in arguments to lambda expression} -body { set lambda [list x {set x 1}] namespace eval a { namespace ensemble create -command ::bar -map {id {::a::const foo}} proc const val { return $val } proc alias {object slot = command args} { set map [namespace ensemble configure $object -map] dict set map $slot [linsert $args 0 $command] namespace ensemble configure $object -map $map } proc method {object name params body} { set params [linsert $params 0 self] alias $object $name = ::apply [list $params $body] $object } method ::bar boo x {return "[expr {$x*$x}] - $self"} } bar boo } -cleanup { namespace delete ::a } -returnCodes error -result {wrong # args: should be "bar boo x"} test apply-5.1 {runtime error in lambda expression} { set lambda [list {} {error foo}] set res [catch {apply $lambda}] list $res $::errorInfo } {1 {foo while executing "error foo" (lambda term "{} {error foo}" line 1) invoked from within "apply $lambda"}} # Tests for correct execution; as the implementation is the same as that for # procs, the general functionality is mostly tested elsewhere test apply-6.1 {info level} { set lev [info level] set lambda [list {} {info level}] expr {[apply $lambda] - $lev} } 1 test apply-6.2 {info level} { set lambda [list {} {info level 0}] apply $lambda } {apply {{} {info level 0}}} test apply-6.3 {info level} { set lambda [list args {info level 0}] apply $lambda x y } {apply {args {info level 0}} x y} # Tests for correct namespace scope namespace eval ::testApply { proc testApply args {return testApply} } test apply-7.1 {namespace access} { set ::testApply::x 0 set body {set x 1; set x} list [apply [list args $body ::testApply]] $::testApply::x } {1 0} test apply-7.2 {namespace access} { set ::testApply::x 0 set body {variable x; set x} list [apply [list args $body ::testApply]] $::testApply::x } {0 0} test apply-7.3 {namespace access} { set ::testApply::x 0 set body {variable x; set x 1} list [apply [list args $body ::testApply]] $::testApply::x } {1 1} test apply-7.4 {namespace access} { set ::testApply::x 0 set body {testApply} apply [list args $body ::testApply] } testApply test apply-7.5 {namespace access} { set ::testApply::x 0 set body {set x 1; set x} list [apply [list args $body testApply]] $::testApply::x } {1 0} test apply-7.6 {namespace access} { set ::testApply::x 0 set body {variable x; set x} list [apply [list args $body testApply]] $::testApply::x } {0 0} test apply-7.7 {namespace access} { set ::testApply::x 0 set body {variable x; set x 1} list [apply [list args $body testApply]] $::testApply::x } {1 1} test apply-7.8 {namespace access} { set ::testApply::x 0 set body {testApply} apply [list args $body testApply] } testApply # Tests for correct argument treatment set applyBody { set res {} foreach v [info locals] { if {$v eq "res"} continue lappend res [list $v [set $v]] } set res } test apply-8.1 {args treatment} { apply [list args $applyBody] 1 2 3 } {{args {1 2 3}}} test apply-8.2 {args treatment} { apply [list {x args} $applyBody] 1 2 } {{x 1} {args 2}} test apply-8.3 {args treatment} { apply [list {x args} $applyBody] 1 2 3 } {{x 1} {args {2 3}}} test apply-8.4 {default values} { apply [list {{x 1} {y 2}} $applyBody] } {{x 1} {y 2}} test apply-8.5 {default values} { apply [list {{x 1} {y 2}} $applyBody] 3 4 } {{x 3} {y 4}} test apply-8.6 {default values} { apply [list {{x 1} {y 2}} $applyBody] 3 } {{x 3} {y 2}} test apply-8.7 {default values} { apply [list {x {y 2}} $applyBody] 1 } {{x 1} {y 2}} test apply-8.8 {default values} { apply [list {x {y 2}} $applyBody] 1 3 } {{x 1} {y 3}} test apply-8.9 {default values} { apply [list {x {y 2} args} $applyBody] 1 } {{x 1} {y 2} {args {}}} test apply-8.10 {default values} { apply [list {x {y 2} args} $applyBody] 1 3 } {{x 1} {y 3} {args {}}} # Tests for leaks test apply-9.1 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } set lam [list {} {set a 1}] } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { ::apply [lrange $lam 0 end] set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain lam end i tmp leakedBytes } -result 0 test apply-9.2 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { ::apply [list {} {set a 1}] set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i tmp leakedBytes } -result 0 test apply-9.3 {leaking internal rep} -setup { proc getbytes {} { set lines [split [memory info] "\n"] lindex $lines 3 3 } } -constraints memory -body { set end [getbytes] for {set i 0} {$i < 5} {incr i} { set x [list {} {set a 1} ::NS::THAT::DOES::NOT::EXIST] catch {::apply $x} set x {} set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] } -cleanup { rename getbytes {} unset -nocomplain end i x tmp leakedBytes } -result 0 # Tests for specific bugs test apply-10.1 {Test for precompiled bytecode body} -constraints { applylambda } -body { testapplylambda } -result 42 # Tests for the avoidance of recompilation # cleanup namespace delete testApply ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/appendComp.test0000644000175000017500000002764015104661341015711 0ustar sergeisergei# Commands covered: append lappend # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch {unset x} test appendComp-1.1 {append command} -setup { unset -nocomplain x } -body { proc foo {} {append ::x 1 2 abc "long string"} list [foo] $x } -result {{12abclong string} {12abclong string}} test appendComp-1.2 {append command} { proc foo {} { set x "" list [append x first] [append x second] [append x third] $x } foo } {first firstsecond firstsecondthird firstsecondthird} test appendComp-1.3 {append command} { proc foo {} { set x "abcd" append x } foo } abcd test appendComp-2.1 {long appends} { proc foo {} { set x "" for {set i 0} {$i < 1000} {incr i} { append x "foobar " } set y "foobar" set y "$y $y $y $y $y $y $y $y $y $y" set y "$y $y $y $y $y $y $y $y $y $y" set y "$y $y $y $y $y $y $y $y $y $y " expr {$x == $y} } foo } 1 test appendComp-3.1 {append errors} -returnCodes error -body { proc foo {} {append} foo } -result {wrong # args: should be "append varName ?value ...?"} test appendComp-3.2 {append errors} -returnCodes error -body { proc foo {} { set x "" append x(0) 44 } foo } -result {can't set "x(0)": variable isn't array} test appendComp-3.3 {append errors} -returnCodes error -body { proc foo {} { unset -nocomplain x append x } foo } -result {can't read "x": no such variable} test appendComp-4.1 {lappend command} { proc foo {} { global x unset -nocomplain x lappend x 1 2 abc "long string" } list [foo] $x } {{1 2 abc {long string}} {1 2 abc {long string}}} test appendComp-4.2 {lappend command} { proc foo {} { set x "" list [lappend x first] [lappend x second] [lappend x third] $x } foo } {first {first second} {first second third} {first second third}} test appendComp-4.3 {lappend command} { proc foo {} { global x set x old unset x lappend x new } set result [foo] rename foo {} set result } {new} test appendComp-4.4 {lappend command} { proc foo {} { set x {} lappend x \{\ abc } foo } {\{\ abc} test appendComp-4.5 {lappend command} { proc foo {} { set x {} lappend x \{ abc } foo } {\{ abc} test appendComp-4.6 {lappend command} { proc foo {} { set x {1 2 3} lappend x } foo } {1 2 3} test appendComp-4.7 {lappend command} { proc foo {} { set x "a\{" lappend x abc } foo } "a\\\{ abc" test appendComp-4.8 {lappend command} { proc foo {} { set x "\\\{" lappend x abc } foo } "\\{ abc" test appendComp-4.9 {lappend command} -returnCodes error -body { proc foo {} { set x " \{" lappend x abc } foo } -result {unmatched open brace in list} test appendComp-4.10 {lappend command} -returnCodes error -body { proc foo {} { set x " \{" lappend x abc } foo } -result {unmatched open brace in list} test appendComp-4.11 {lappend command} -returnCodes error -body { proc foo {} { set x "\{\{\{" lappend x abc } foo } -result {unmatched open brace in list} test appendComp-4.12 {lappend command} -returnCodes error -body { proc foo {} { set x "x \{\{\{" lappend x abc } foo } -result {unmatched open brace in list} test appendComp-4.13 {lappend command} { proc foo {} { set x "x\{\{\{" lappend x abc } foo } "x\\\{\\\{\\\{ abc" test appendComp-4.14 {lappend command} { proc foo {} { set x " " lappend x abc } foo } "abc" test appendComp-4.15 {lappend command} { proc foo {} { set x "\\ " lappend x abc } foo } "{ } abc" test appendComp-4.16 {lappend command} { proc foo {} { set x "x " lappend x abc } foo } "x abc" test appendComp-4.17 {lappend command} { proc foo {} { lappend x } foo } {} test appendComp-4.18 {lappend command} { proc foo {} { lappend x {} } foo } {{}} test appendComp-4.19 {lappend command} { proc foo {} { lappend x(0) } foo } {} test appendComp-4.20 {lappend command} { proc foo {} { lappend x(0) abc } foo } {abc} test appendComp-5.1 {long lappends} -setup { unset -nocomplain x proc check {var size} { set l [llength $var] if {$l != $size} { return "length mismatch: should have been $size, was $l" } for {set i 0} {$i < $size} {incr i} { set j [lindex $var $i] if {$j ne "item $i"} { return "element $i should have been \"item $i\", was \"$j\"" } } return ok } } -body { set x "" for {set i 0} {$i < 300} {incr i} { lappend x "item $i" } check $x 300 } -cleanup { unset -nocomplain x catch {rename check ""} } -result ok test appendComp-6.1 {lappend errors} -returnCodes error -body { proc foo {} {lappend} foo } -result {wrong # args: should be "lappend varName ?value ...?"} test appendComp-6.2 {lappend errors} -returnCodes error -body { proc foo {} { set x "" lappend x(0) 44 } foo } -result {can't set "x(0)": variable isn't array} test appendComp-7.1 {lappendComp-created var and error in trace on that var} -setup { catch {rename foo ""} unset -nocomplain x } -body { proc bar {} { global x trace add variable x write foo proc foo {} {global x; unset x} catch {lappend x 1} proc foo {args} {global x; unset x} info exists x set x lappend x 1 list [info exists x] [catch {set x} msg] $msg } bar } -result {0 1 {can't read "x": no such variable}} test appendComp-7.2 {lappend var triggers read trace, index var} -setup { unset -nocomplain ::result } -body { proc bar {} { trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar a return $::result } bar } -result {myvar {} read} -constraints {bug_3057639} test appendComp-7.3 {lappend var triggers read trace, stack var} -setup { unset -nocomplain ::result unset -nocomplain ::myvar } -body { proc bar {} { trace add variable ::myvar read foo proc foo {args} {append ::result $args} lappend ::myvar a return $::result } bar } -result {::myvar {} r} -constraints {bug_3057639} test appendComp-7.4 {lappend var triggers read trace, array var} -setup { unset -nocomplain ::result } -body { # The behavior of read triggers on lappend changed in 8.0 to not trigger # them. Maybe not correct, but been there a while. proc bar {} { trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar(b) a return $::result } bar } -result {myvar b read} -constraints {bug_3057639} test appendComp-7.5 {lappend var triggers read trace, array var} -setup { unset -nocomplain ::result } -body { # The behavior of read triggers on lappend changed in 8.0 to not trigger # them. Maybe not correct, but been there a while. proc bar {} { trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar(b) a b return $::result } bar } -result {myvar b read} test appendComp-7.6 {lappend var triggers read trace, array var exists} -setup { unset -nocomplain ::result } -body { proc bar {} { set myvar(0) 1 trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar(b) a return $::result } bar } -result {myvar b read} -constraints {bug_3057639} test appendComp-7.7 {lappend var triggers read trace, array stack var} -setup { unset -nocomplain ::myvar unset -nocomplain ::result } -body { proc bar {} { trace add variable ::myvar read foo proc foo {args} {append ::result $args} lappend ::myvar(b) a return $::result } bar } -result {::myvar b read} -constraints {bug_3057639} test appendComp-7.8 {lappend var triggers read trace, array stack var} -setup { unset -nocomplain ::myvar unset -nocomplain ::result } -body { proc bar {} { trace add variable ::myvar read foo proc foo {args} {append ::result $args} lappend ::myvar(b) a b return $::result } bar } -result {::myvar b read} test appendComp-7.9 {append var does not trigger read trace} -setup { unset -nocomplain ::result } -body { proc bar {} { trace add variable myvar read foo proc foo {args} {append ::result $args} append myvar a info exists ::result } bar } -result {0} test appendComp-8.1 {defer error to runtime} -setup { interp create child } -body { child eval { proc foo {} { proc append args {} append } foo } } -cleanup { interp delete child } -result {} # New tests for bug 3057639 to show off the more consistent behaviour of # lappend in both direct-eval and bytecompiled code paths (see append.test for # the direct-eval variants). lappend now behaves like append. 9.0/1 lappend - # 9.2/3 append. # Note also the tests above now constrained by bug-3057639, these changed # behaviour with the triggering of read traces in bc mode gone. # Going back to the tests below. The direct-eval tests are ok before and after # patch (no read traces run for lappend, append). The compiled tests are # failing for lappend (9.0/1) before the patch, showing how it invokes read # traces in the compiled path. The append tests are good (9.2/3). After the # patch the failures are gone. test appendComp-9.0 {bug 3057639, lappend compiled, read trace on non-existing array variable element} -setup { unset -nocomplain myvar array set myvar {} } -body { proc nonull {var key val} { upvar 1 $var lvar if {![info exists lvar($key)]} { return -code error "BOOM. no such variable" } } trace add variable myvar read nonull proc foo {} { lappend ::myvar(key) "new value" } list [catch { foo } msg] $msg } -result {0 {{new value}}} test appendComp-9.1 {bug 3057639, lappend direct eval, read trace on non-existing env element} -setup { unset -nocomplain ::env(__DUMMY__) } -body { proc foo {} { lappend ::env(__DUMMY__) "new value" } list [catch { foo } msg] $msg } -cleanup { unset -nocomplain ::env(__DUMMY__) } -result {0 {{new value}}} test appendComp-9.2 {bug 3057639, append compiled, read trace on non-existing array variable element} -setup { unset -nocomplain myvar array set myvar {} } -body { proc nonull {var key val} { upvar 1 $var lvar if {![info exists lvar($key)]} { return -code error "BOOM. no such variable" } } trace add variable myvar read nonull proc foo {} { append ::myvar(key) "new value" } list [catch { foo } msg] $msg } -result {0 {new value}} test appendComp-9.3 {bug 3057639, append direct eval, read trace on non-existing env element} -setup { unset -nocomplain ::env(__DUMMY__) } -body { proc foo {} { append ::env(__DUMMY__) "new value" } list [catch { foo } msg] $msg } -cleanup { unset -nocomplain ::env(__DUMMY__) } -result {0 {new value}} test appendComp-10.1 {Bug 214cc0eb22: lappend with no values} { apply {lst { lappend lst }} "# 1 2 3" } "# 1 2 3" test appendComp-10.2 {Bug 214cc0eb22: lappend with no values} -body { apply {lst { lappend lst }} "1 \{ 2" } -returnCodes error -result {unmatched open brace in list} test appendComp-10.3 {Bug 214cc0eb22: expanded lappend with no values} { apply {lst { lappend lst {*}[list] }} "# 1 2 3" } "# 1 2 3" test appendComp-10.4 {Bug 214cc0eb22: expanded lappend with no values} -body { apply {lst { lappend lst {*}[list] }} "1 \{ 2" } -returnCodes error -result {unmatched open brace in list} catch {unset i x result y} catch {rename foo ""} catch {rename bar ""} catch {rename check ""} catch {rename bar {}} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/append.test0000644000175000017500000002420015104661341015057 0ustar sergeisergei# Commands covered: append lappend # # This file contains a collection of tests for one or more of the Tcl built-in # commands. Sourcing this file into Tcl runs the tests and generates output # for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1996 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands unset -nocomplain x catch [list package require -exact tcl::test [info patchlevel]] testConstraint testbytestring [llength [info commands testbytestring]] test append-1.1 {append command} { unset -nocomplain x list [append x 1 2 abc "long string"] $x } {{12abclong string} {12abclong string}} test append-1.2 {append command} { set x "" list [append x first] [append x second] [append x third] $x } {first firstsecond firstsecondthird firstsecondthird} test append-1.3 {append command} { set x "abcd" append x } abcd test append-2.1 {long appends} { set x "" for {set i 0} {$i < 1000} {incr i} { append x "foobar " } set y "foobar" set y "$y $y $y $y $y $y $y $y $y $y" set y "$y $y $y $y $y $y $y $y $y $y" set y "$y $y $y $y $y $y $y $y $y $y " expr {$x == $y} } 1 test append-3.1 {append errors} -returnCodes error -body { append } -result {wrong # args: should be "append varName ?value ...?"} test append-3.2 {append errors} -returnCodes error -body { set x "" append x(0) 44 } -result {can't set "x(0)": variable isn't array} test append-3.3 {append errors} -returnCodes error -body { unset -nocomplain x append x } -result {can't read "x": no such variable} test append-3.4 {append surrogates} -body { set x \uD83D append x \uDE02 } -result \uD83D\uDE02 test append-3.5 {append surrogates} -body { set x \uD83D set x $x\uDE02 } -result \uD83D\uDE02 test append-3.6 {append surrogates} -body { set x \uDE02 set x \uD83D$x } -result \uD83D\uDE02 test append-3.7 {append \xC0 \x80} -constraints testbytestring -body { set x [testbytestring \xC0] string length [append x [testbytestring \x80]] } -result 2 test append-3.8 {append \xC0 \x80} -constraints testbytestring -body { set x [testbytestring \xC0] string length $x[testbytestring \x80] } -result 2 test append-3.9 {append \xC0 \x80} -constraints testbytestring -body { set x [testbytestring \x80] string length [testbytestring \xC0]$x } -result 2 test append-3.10 {append surrogates} -body { set x \uD83D string range $x 0 end append x \uDE02 } -result [string range \uD83D\uDE02 0 end] test append-4.1 {lappend command} { unset -nocomplain x list [lappend x 1 2 abc "long string"] $x } {{1 2 abc {long string}} {1 2 abc {long string}}} test append-4.2 {lappend command} { set x "" list [lappend x first] [lappend x second] [lappend x third] $x } {first {first second} {first second third} {first second third}} test append-4.3 {lappend command} -body { proc foo {} { global x set x old unset x lappend x new } foo } -cleanup { rename foo {} } -result {new} test append-4.4 {lappend command} { set x {} lappend x \{\ abc } {\{\ abc} test append-4.5 {lappend command} { set x {} lappend x \{ abc } {\{ abc} test append-4.6 {lappend command} { set x {1 2 3} lappend x } {1 2 3} test append-4.7 {lappend command} { set x "a\{" lappend x abc } "a\\\{ abc" test append-4.8 {lappend command} { set x "\\\{" lappend x abc } "\\{ abc" test append-4.9 {lappend command} -returnCodes error -body { set x " \{" lappend x abc } -result {unmatched open brace in list} test append-4.10 {lappend command} -returnCodes error -body { set x " \{" lappend x abc } -result {unmatched open brace in list} test append-4.11 {lappend command} -returnCodes error -body { set x "\{\{\{" lappend x abc } -result {unmatched open brace in list} test append-4.12 {lappend command} -returnCodes error -body { set x "x \{\{\{" lappend x abc } -result {unmatched open brace in list} test append-4.13 {lappend command} { set x "x\{\{\{" lappend x abc } "x\\\{\\\{\\\{ abc" test append-4.14 {lappend command} { set x " " lappend x abc } "abc" test append-4.15 {lappend command} { set x "\\ " lappend x abc } "{ } abc" test append-4.16 {lappend command} { set x "x " lappend x abc } "x abc" test append-4.17 {lappend command} { unset -nocomplain x lappend x } {} test append-4.18 {lappend command} { unset -nocomplain x lappend x {} } {{}} test append-4.19 {lappend command} { unset -nocomplain x lappend x(0) } {} test append-4.20 {lappend command} { unset -nocomplain x lappend x(0) abc } {abc} unset -nocomplain x test append-4.21 {lappend command} -returnCodes error -body { set x \" lappend x } -result {unmatched open quote in list} test append-4.22 {lappend command} -returnCodes error -body { set x \" lappend x abc } -result {unmatched open quote in list} test append-5.1 {long lappends} -setup { unset -nocomplain x proc check {var size} { set l [llength $var] if {$l != $size} { return "length mismatch: should have been $size, was $l" } for {set i 0} {$i < $size} {incr i} { set j [lindex $var $i] if {$j ne "item $i"} { return "element $i should have been \"item $i\", was \"$j\"" } } return ok } } -body { set x "" for {set i 0} {$i < 300} {incr i} { lappend x "item $i" } check $x 300 } -cleanup { rename check {} } -result ok test append-6.1 {lappend errors} -returnCodes error -body { lappend } -result {wrong # args: should be "lappend varName ?value ...?"} test append-6.2 {lappend errors} -returnCodes error -body { set x "" lappend x(0) 44 } -result {can't set "x(0)": variable isn't array} test append-7.1 {lappend-created var and error in trace on that var} -setup { catch {rename foo ""} unset -nocomplain x } -body { trace add variable x write foo proc foo {} {global x; unset x} catch {lappend x 1} proc foo {args} {global x; unset x} info exists x set x lappend x 1 list [info exists x] [catch {set x} msg] $msg } -result {0 1 {can't read "x": no such variable}} test append-7.2 {lappend var triggers read trace} -setup { unset -nocomplain myvar unset -nocomplain ::result } -body { trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar a return $::result } -result {myvar {} read} test append-7.3 {lappend var triggers read trace, array var} -setup { unset -nocomplain myvar unset -nocomplain ::result } -body { # The behavior of read triggers on lappend changed in 8.0 to not trigger # them, and was changed back in 8.4. trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar(b) a return $::result } -result {myvar b read} test append-7.4 {lappend var triggers read trace, array var exists} -setup { unset -nocomplain myvar unset -nocomplain ::result } -body { set myvar(0) 1 trace add variable myvar read foo proc foo {args} {append ::result $args} lappend myvar(b) a return $::result } -result {myvar b read} test append-7.5 {append var does not trigger read trace} -setup { unset -nocomplain myvar unset -nocomplain ::result } -body { trace add variable myvar read foo proc foo {args} {append ::result $args} append myvar a info exists ::result } -result {0} # THERE ARE NO append-8.* TESTS # New tests for bug 3057639 to show off the more consistent behaviour of # lappend in both direct-eval and bytecompiled code paths (see appendComp.test # for the compiled variants). lappend now behaves like append. 9.0/1 lappend - # 9.2/3 append test append-9.0 {bug 3057639, lappend direct eval, read trace on non-existing array variable element} -setup { unset -nocomplain myvar } -body { array set myvar {} proc nonull {var key val} { upvar 1 $var lvar if {![info exists lvar($key)]} { return -code error "no such variable" } } trace add variable myvar read nonull list [catch { lappend myvar(key) "new value" } msg] $msg } -result {0 {{new value}}} test append-9.1 {bug 3057639, lappend direct eval, read trace on non-existing env element} -setup { unset -nocomplain ::env(__DUMMY__) } -body { list [catch { lappend ::env(__DUMMY__) "new value" } msg] $msg } -cleanup { unset -nocomplain ::env(__DUMMY__) } -result {0 {{new value}}} test append-9.2 {bug 3057639, append direct eval, read trace on non-existing array variable element} -setup { unset -nocomplain myvar } -body { array set myvar {} proc nonull {var key val} { upvar 1 $var lvar if {![info exists lvar($key)]} { return -code error "no such variable" } } trace add variable myvar read nonull list [catch { append myvar(key) "new value" } msg] $msg } -result {0 {new value}} test append-9.3 {bug 3057639, append direct eval, read trace on non-existing env element} -setup { unset -nocomplain ::env(__DUMMY__) } -body { list [catch { append ::env(__DUMMY__) "new value" } msg] $msg } -cleanup { unset -nocomplain ::env(__DUMMY__) } -result {0 {new value}} test append-10.1 {Bug 214cc0eb22: lappend with no values} { set lst "# 1 2 3" [subst lappend] lst } "# 1 2 3" test append-10.2 {Bug 214cc0eb22: lappend with no values} -body { set lst "1 \{ 2" [subst lappend] lst } -returnCodes error -result {unmatched open brace in list} test append-10.3 {Bug 214cc0eb22: expanded lappend with no values} { set lst "# 1 2 3" [subst lappend] lst {*}[list] } "# 1 2 3" test append-10.4 {Bug 214cc0eb22: expanded lappend with no values} -body { set lst "1 \{ 2" [subst lappend] lst {*}[list] } -returnCodes error -result {unmatched open brace in list} unset -nocomplain i x result y catch {rename foo ""} # cleanup ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: tcl9.0.3/tests/all.tcl0000644000175000017500000000173415104661341014172 0ustar sergeisergei# all.tcl -- # # This file contains a top-level script to run all of the Tcl # tests. Execute it by invoking "source all.tcl" when running tcltest # in this directory. # # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2000 Ajuba Solutions # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package prefer latest package require tcltest 2.5 namespace import ::tcltest::* configure -testdir [file normalize [file dirname [info script]]] {*}$argv if {[singleProcess]} { interp debug {} -frame 1 } set ErrorOnFailures [info exists env(ERROR_ON_FAILURES)] unset -nocomplain env(ERROR_ON_FAILURES) if {[runAllTests] && $ErrorOnFailures} {exit 1} # if calling direct only (avoid rewrite exit if inlined or interactive): if { [info exists ::argv0] && [file tail $::argv0] eq [file tail [info script]] && !([info exists ::tcl_interactive] && $::tcl_interactive) } { proc exit args {} }tcl9.0.3/tests/abstractlist.test0000644000175000017500000006406615104661341016325 0ustar sergeisergei# Exercise AbstractList via the "lstring" command defined in tclTestABSList.c # # Copyright © 2022 Brian Griffin # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } catch { ::tcltest::loadTestedCommands package require -exact tcl::test [info patchlevel] } testConstraint testevalex [llength [info commands testevalex]] testConstraint testobj [llength [info commands testobj]] testConstraint lstring [llength [info commands lstring]] testConstraint lgen [llength [info commands lgegenn]] set abstractlisttestvars [info var *] proc value-cmp {vara varb} { upvar $vara a upvar $varb b set ta [tcl::unsupported::representation $a] set tb [tcl::unsupported::representation $b] return [string compare $ta $tb] } set str "If you can keep your head when all about you Are losing theirs and blaming it on you," set str2 "If you can trust yourself when all men doubt you, But make allowance for their doubting, too." test abstractlist-1.0 {error cases} -constraints lstring -body { lstring } \ -returnCodes 1 \ -result {wrong # args: should be "lstring string"} test abstractlist-1.1 {error cases} -constraints lstring -body { lstring a b c } -returnCodes 1 \ -result {wrong # args: should be "lstring string"} test abstractlist-2.0 {no shimmer llength} -constraints {testobj lstring} -body { set l [lstring $str] set l-isa [testobj objtype $l] set len [llength $l] set l-isa2 [testobj objtype $l] list $l ${l-isa} ${len} ${l-isa2} } -cleanup { unset l } -result {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring 85 lstring} test abstractlist-2.1 {no shimmer lindex} {testobj lstring} { set l [lstring $str] set l-isa [testobj objtype $l] set ele [lindex $l 22] set l-isa2 [testobj objtype $l] list $l ${l-isa} ${ele} ${l-isa2} } {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring e lstring} test abstractlist-2.2 {no shimmer lreverse} {testobj lstring} { set l [lstring $str] set l-isa [testobj objtype $l] set r [lreverse $l] set r-isa [testobj objtype $r] set l-isa2 [testobj objtype $l] list $r ${l-isa} ${r-isa} ${l-isa2} } {{, u o y { } n o { } t i { } g n i m a l b { } d n a { } s r i e h t { } g n i s o l { } e r A { } u o y { } t u o b a { } l l a { } n e h w { } d a e h { } r u o y { } p e e k { } n a c { } u o y { } f I} lstring lstring lstring} test abstractlist-2.3 {no shimmer lrange} {testobj lstring} { set l [lstring $str] set l-isa [testobj objtype $l] set il [lsearch -all [lstring $str] { }] set l-isa2 [testobj objtype $l] lappend il [llength $l] set start 0 set words [lmap i $il { set w [join [lrange $l $start $i-1] {} ] set start [expr {$i+1}] set w }] set l-isa3 [testobj objtype $l] list ${l-isa} $il ${l-isa2} ${l-isa3} $words } {lstring {2 6 10 15 20 25 30 34 40 44 48 55 62 66 74 77 80 85} lstring lstring {If you can keep your head when all about you Are losing theirs and blaming it on you,}} test abstractlist-2.4 {no shimmer foreach} {testobj lstring} { set l [lstring $str] set l-isa [testobj objtype $l] set word {} set words {} foreach c $l { if {$c eq { }} { lappend words $word set word {} } else { append word $c } } if {$word ne ""} { lappend words $word } set l-isa2 [testobj objtype $l] list ${l-isa} ${l-isa2} $words } {lstring lstring {If you can keep your head when all about you Are losing theirs and blaming it on you,}} # # The TBCE implements lreplace as a lrange + lappend operation, so, in this case, $m list, not an lstring. # test abstractlist-2.5 {!no shimmer lreplace} {testobj lstring} { set l [lstring $str2] set l-isa [testobj objtype $l] set m [lreplace $l 78 86 { } f a i l i n g] set m-isa [testobj objtype $m] set l-isa1 [testobj objtype $l] list ${l-isa} $m ${m-isa} ${l-isa1} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } f a i l i n g , { } t o o .} lstring lstring} test abstractlist-2.6 {no shimmer ledit} {testobj lstring} { # "ledit m 9 8 S" set l [lstring $str2] set l-isa [testobj objtype $l] set e [ledit l 68 67 s] set e-isa [testobj objtype $e] list ${l-isa} $e ${e-isa} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e s { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} test abstractlist-2.7 {no shimmer linsert} -constraints {testobj lstring} -body { # "ledit m 9 8 S" set l [lstring $str2] set l-isa [testobj objtype $l] set i [linsert $l 11 {*}[split "truly " {}]] set i-isa [testobj objtype $i] set res [list ${l-isa} $i ${i-isa}] set p [lpop i 23] set p-isa [testobj objtype $p] set i-isa2 [testobj objtype $i] lappend res $p ${p-isa} $i ${i-isa2} } -cleanup { unset l i l-isa i-isa res p p-isa } -result {lstring {I f { } y o u { } c a n { } t r u l y { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring y none {I f { } y o u { } c a n { } t r u l y { } t r u s t { } o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} test abstractlist-2.8 {shimmer lassign} {testobj lstring} { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set l2 [lassign $l i n c] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {o n c e i v a b l e} lstring lstring} test abstractlist-2.9 {no shimmer lremove} {testobj lstring} { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set l2 [lremove $l 0 1] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {c o n c e i v a b l e} lstring lstring} test abstractlist-2.10 {shimmer lreverse} {testobj lstring} { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set l2 [lreverse $l] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {e l b a v i e c n o c n I} lstring lstring} test abstractlist-2.11 {shimmer lset} {testobj lstring} { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set m [lset l 2 k] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } {{I n k o n c e i v a b l e} lstring {I n k o n c e i v a b l e} lstring 0} # lrepeat test abstractlist-2.12 {shimmer lrepeat} {testobj lstring} { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set m [lrepeat 3 $l] set m-isa [testobj objtype $m] set n [lindex $m 1] list $l ${l-isa} $m ${m-isa} [testobj objtype $n] [value-cmp l n] } {{I n c o n c e i v a b l e} lstring {{I n c o n c e i v a b l e} {I n c o n c e i v a b l e} {I n c o n c e i v a b l e}} list lstring 0} test abstractlist-2.13 {no shimmer join llength==1} {testobj lstring} { set l [lstring G] set l-isa [testobj objtype $l] set j [join $l :] set j-isa [testobj objtype $j] list ${l-isa} $l ${j-isa} $j } {lstring G none G} test abstractlist-2.14 {error case lset multiple indicies} -constraints {testobj lstring} -body { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set m [lset l 2 0 1 k] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } -returnCodes 1 \ -result {Multiple indicies not supported by lstring.} # lsort test abstractlist-3.0 {no shimmer llength} {testobj lstring} { set l [lstring -not SLICE $str] set l-isa [testobj objtype $l] set len [llength $l] set l-isa2 [testobj objtype $l] list $l ${l-isa} ${len} ${l-isa2} } {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring 85 lstring} test abstractlist-3.1 {no shimmer lindex} {testobj lstring} { set l [lstring -not SLICE $str] set l-isa [testobj objtype $l] set n 22 set ele [lindex $l $n] ;# exercise INST_LIST_INDEX set l-isa2 [testobj objtype $l] list $l ${l-isa} ${ele} ${l-isa2} } {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring e lstring} test abstractlist-3.2 {no shimmer lreverse} {testobj lstring} { set l [lstring -not SLICE $str] set l-isa [testobj objtype $l] set r [lreverse $l] set r-isa [testobj objtype $r] set l-isa2 [testobj objtype $l] list $r ${l-isa} ${r-isa} ${l-isa2} } {{, u o y { } n o { } t i { } g n i m a l b { } d n a { } s r i e h t { } g n i s o l { } e r A { } u o y { } t u o b a { } l l a { } n e h w { } d a e h { } r u o y { } p e e k { } n a c { } u o y { } f I} lstring lstring lstring} test abstractlist-3.3 {shimmer lrange} {testobj lstring} { set l [lstring -not SLICE $str] set l-isa [testobj objtype $l] set il [lsearch -all [lstring -not SLICE $str] { }] set l-isa2 [testobj objtype $l] lappend il [llength $l] set start 0 set words [lmap i $il { set w [join [lrange $l $start $i-1] {} ] set start [expr {$i+1}] set w }] set l-isa3 [testobj objtype $l]; # lrange defaults to list behavior list ${l-isa} $il ${l-isa2} ${l-isa3} $words } {lstring {2 6 10 15 20 25 30 34 40 44 48 55 62 66 74 77 80 85} lstring list {If you can keep your head when all about you Are losing theirs and blaming it on you,}} test abstractlist-3.4 {no shimmer foreach} {testobj lstring} { set l [lstring -not SLICE $str] set l-isa [testobj objtype $l] set word {} set words {} foreach c $l { if {$c eq { }} { lappend words $word set word {} } else { append word $c } } if {$word ne ""} { lappend words $word } set l-isa2 [testobj objtype $l] list ${l-isa} ${l-isa2} $words } {lstring lstring {If you can keep your head when all about you Are losing theirs and blaming it on you,}} # # The TBCE implements lreplace as a lrange + lappend operation, so, in this case, $m list, not an lstring. # test abstractlist-3.5 {!no shimmer lreplace} {testobj lstring} { set l [lstring -not SLICE $str2] set l-isa [testobj objtype $l] set m [lreplace $l 79 86 f a i l i n g] set m-isa [testobj objtype $m] set l-isa1 [testobj objtype $l] list ${l-isa} $m ${m-isa} ${l-isa1} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } f a i l i n g , { } t o o .} lstring lstring} test abstractlist-3.6 {no shimmer ledit} {testobj lstring} { # "ledit m 9 8 S" set l [lstring -not SLICE $str2] set l-isa [testobj objtype $l] set e [ledit l 68 67 s] set e-isa [testobj objtype $e] list ${l-isa} $e ${e-isa} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e s { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} test abstractlist-3.7 {no shimmer linsert} {testobj lstring} { # "ledit m 9 8 S" set res {} set l [lstring -not SLICE $str2] set l-isa [testobj objtype $l] set i [linsert $l 35 {*}[split "wo" {}]] set i-isa [testobj objtype $i] set res [list ${l-isa} $i ${i-isa}] set p [lpop i 23] set p-isa [testobj objtype $p] set i-isa2 [testobj objtype $i] lappend res $p ${p-isa} $i ${i-isa2} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } w o m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring l none {I f { } y o u { } c a n { } t r u s t { } y o u r s e f { } w h e n { } a l l { } w o m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} test abstractlist-3.8 {shimmer lassign} {testobj lstring} { set l [lstring -not SLICE Inconceivable] set l-isa [testobj objtype $l] set l2 [lassign $l i n c] ;# must be using lrange internally set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {o n c e i v a b l e} list list} test abstractlist-3.9 {no shimmer lremove} {testobj lstring} { set l [lstring -not SLICE Inconceivable] set l-isa [testobj objtype $l] set l2 [lremove $l 0 1] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {c o n c e i v a b l e} lstring lstring} test abstractlist-3.10 {shimmer lreverse} {testobj lstring} { set l [lstring -not SLICE Inconceivable] set l-isa [testobj objtype $l] set l2 [lreverse $l] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {e l b a v i e c n o c n I} lstring lstring} test abstractlist-3.11 {shimmer lset} {testobj lstring} { set l [lstring -not SLICE Inconceivable] set l-isa [testobj objtype $l] set four 4 set m [lset l $four-2 k] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } {{I n k o n c e i v a b l e} lstring {I n k o n c e i v a b l e} lstring 0} # lrepeat test abstractlist-3.12 {shimmer lrepeat} {testobj lstring} { set l [lstring -not SLICE Inconceivable] set l-isa [testobj objtype $l] set m [lrepeat 3 $l] set m-isa [testobj objtype $m] set n [lindex $m 1] list $l ${l-isa} $m ${m-isa} [testobj objtype $n] [value-cmp l n] } {{I n c o n c e i v a b l e} lstring {{I n c o n c e i v a b l e} {I n c o n c e i v a b l e} {I n c o n c e i v a b l e}} list lstring 0} # lsort foreach not {{} REVERSE SLICE SETELEMENT REPLACE GETELEMENTS} { testConstraint [format "%sShimmer" [string totitle $not]] [expr {$not eq ""}] set options [expr {$not ne "" ? "-not $not" : ""}] test abstractlist-$not-4.0 {no shimmer llength} {testobj lstring} { set l [lstring {*}$options $str] set l-isa [testobj objtype $l] set len [llength $l] set l-isa2 [testobj objtype $l] list $l ${l-isa} ${len} ${l-isa2} } {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring 85 lstring} test abstractlist-$not-4.1 {no shimmer lindex} {testobj lstring} { set l [lstring {*}$options $str] set l-isa [testobj objtype $l] set ele [lindex $l 22] set l-isa2 [testobj objtype $l] list $l ${l-isa} ${ele} ${l-isa2} } {{I f { } y o u { } c a n { } k e e p { } y o u r { } h e a d { } w h e n { } a l l { } a b o u t { } y o u { } A r e { } l o s i n g { } t h e i r s { } a n d { } b l a m i n g { } i t { } o n { } y o u ,} lstring e lstring} test abstractlist-$not-4.2 {lreverse} {ReverseShimmer testobj lstring} { set l [lstring {*}$options $str] set l-isa [testobj objtype $l] set r [lreverse $l] set r-isa [testobj objtype $r] set l-isa2 [testobj objtype $l] list $r ${l-isa} ${r-isa} ${l-isa2} } {{, u o y { } n o { } t i { } g n i m a l b { } d n a { } s r i e h t { } g n i s o l { } e r A { } u o y { } t u o b a { } l l a { } n e h w { } d a e h { } r u o y { } p e e k { } n a c { } u o y { } f I} lstring lstring lstring} test abstractlist-$not-4.3 {no shimmer lrange} {RangeShimmer testobj lstring} { set l [lstring {*}$options $str] set l-isa [testobj objtype $l] set il [lsearch -all [lstring {*}$options $str] { }] set l-isa2 [testobj objtype $l] lappend il [llength $l] set start 0 set words [lmap i $il { set w [join [lrange $l $start $i-1] {} ] set start [expr {$i+1}] set w }] set l-isa3 [testobj objtype $l] list ${l-isa} $il ${l-isa2} ${l-isa3} $words } {lstring {2 7 10 16 25 29 36 39 47 55 58 63} lstring lstring {If you can keep your head when all about you Are losing theirs and blaming it on you,}} test abstractlist-$not-4.4 {no shimmer foreach} {testobj lstring} { set l [lstring {*}$options $str] set l-isa [testobj objtype $l] set word {} set words {} foreach c $l { if {$c eq { }} { lappend words $word set word {} } else { append word $c } } if {$word ne ""} { lappend words $word } set l-isa2 [testobj objtype $l] list ${l-isa} ${l-isa2} $words } {lstring lstring {If you can keep your head when all about you Are losing theirs and blaming it on you,}} # # The TBCE implements lreplace as a lrange + lappend operation, so, in this case, $m list, not an lstring. # test abstractlist-$not-4.5 {!no shimmer lreplace} {RangeShimmer testobj lstring} { set l [lstring {*}$options $str2] set l-isa [testobj objtype $l] set m [lreplace $l 18 23 { } f a i l ?] set m-isa [testobj objtype $m] set l-isa1 [testobj objtype $l] list ${l-isa} $m ${m-isa} ${l-isa1} } {lstring {} list lstring} test abstractlist-$not-4.6 {no shimmer ledit} {SetelementShimmer ReplaceShimmer testobj lstring} { set l [lstring {*}$options $str2] set l-isa [testobj objtype $l] set e [ledit l 68 67 s] set e-isa [testobj objtype $e] list ${l-isa} $e ${e-isa} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e s { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} test abstractlist-$not-4.7 {no shimmer linsert} {ReplaceShimmer GetelementsShimmer testobj lstring} { set l [lstring {*}$options $str2] set l-isa [testobj objtype $l] set i [linsert $l 12 {*}[split "almost " {}]] set i-isa [testobj objtype $i] set res [list ${l-isa} $i ${i-isa}] set p [lpop i 23] set p-isa [testobj objtype $p] set i-isa2 [testobj objtype $i] lappend res $p ${p-isa} $i ${i-isa2} } {lstring {I f { } y o u { } c a n { } t r u s t { } y o u r s e l f { } w h e n { } a l l { } m e n { } d o u b t { } y o u , { } B u t { } m a k e { } a l l o w a n c e { } f o r { } t h e i r { } d o u b t i n g , { } t o o .} lstring} # lassign probably uses lrange internally test abstractlist-$not-4.8 {shimmer lassign} {RangeShimmer testobj lstring} { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set l2 [lassign $l i n c] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {o n c e i v a b l e} lstring lstring} test abstractlist-$not-4.9 {no shimmer lremove} {ReplaceShimmer testobj lstring} { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set l2 [lremove $l 0 1] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {c o n c e i v a b l e} lstring lstring} test abstractlist-$not-4.10 {shimmer lreverse} {ReverseShimmer testobj lstring} { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set l2 [lreverse $l] set l-isa2 [testobj objtype $l] set l2-isa [testobj objtype $l2] list $l ${l-isa} $l2 ${l-isa2} ${l2-isa} } {{I n c o n c e i v a b l e} lstring {e l b a v i e c n o c n I} lstring lstring} test abstractlist-$not-4.11 {shimmer lset} {SetelementShimmer testobj lstring} { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set m [lset l 2 k] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } {{I n k o n c e i v a b l e} lstring {I n k o n c e i v a b l e} lstring 0} test abstractlist-$not-4.11x {lset not compiled} {SetelementShimmer testobj lstring testevalex} { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set m [testevalex {lset l 2 k}] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } {{I n k o n c e i v a b l e} lstring {I n k o n c e i v a b l e} lstring 0} test abstractlist-$not-4.11e {error case lset multiple indicies} \ -constraints {SetelementShimmer testobj lstring testevalex} -body { set l [lstring Inconceivable] set l-isa [testobj objtype $l] set m [testevalex {lset l 2 0 1 k}] set m-isa [testobj objtype $m] list $l ${l-isa} $m ${m-isa} [value-cmp l m] } -returnCodes 1 \ -result {Multiple indicies not supported by lstring.} # lrepeat test abstractlist-$not-4.12 {shimmer lrepeat} -constraints {testobj lstring} -body { set l [lstring {*}$options Inconceivable] set l-isa [testobj objtype $l] set m [lrepeat 3 $l] set m-isa [testobj objtype $m] set n [lindex $m 1] list $l ${l-isa} $m ${m-isa} [testobj objtype $n] [value-cmp l n] } -cleanup { } -result {{I n c o n c e i v a b l e} lstring {{I n c o n c e i v a b l e} {I n c o n c e i v a b l e} {I n c o n c e i v a b l e}} list lstring 0} # Disable constraint testConstraint [format "%sShimmer" [string totitle $not]] 1 } # # Test fix for bug in TEBC for STR CONCAT, and LIST INDEX # instructions. # This example abstract list (lgen) causes a rescursive call in TEBC, # stack management was not included for these instructions in TEBC. # test abstractlist-lgen-bug {bug in str concat and list operations} -constraints lgen -setup { set lgenfile [makeFile { # Test TIP 192 - Lazy Lists set res {} set cntr 0 # Fatal error here when [source]'d -- It is a refcounting problem... lappend res Index*2:[lgen 1 expr 2* ]:-- set x [lseq 17] set y [lgen 17 apply {{index} {expr {$index * 6}}}] ;# expr * 6 foreach i $x n $y { lappend res "$i -> $n" } proc my_expr {offset index} { expr {$index + $offset} } lappend res my_expr(3):[my_expr 3 0] lappend res [set ss [lgen 15 my_expr 7]] lappend res s2:[list "Index+7:" $ss ":--"] lappend res foo:[list "Index-8:" [lgen 15 my_expr -8] ":--"] set 9 [lgen 15 my_expr 7] lappend res 9len=[llength $9] lappend res 9(3)=[lindex $9 3] lappend res bar:[list "Index+7:" $9 ":--"] lappend res Index+7:$9:-- lappend res Index+7:[lgen 15 my_expr 7]:-- proc fib {phi n} { set d [expr {round(pow($phi, $n) / sqrt(5.0))}] return $d } set phi [expr {(1 + sqrt(5.0)) / 2.0}] lappend res fib:[lmap n [lseq 5] {fib $phi $n}] set x [lgen 20 fib $phi] lappend res "First 20 fibbinacci:[lgen 20 fib $phi]" lappend res "First 20 fibbinacci from x :$x" unset x lappend res Good-Bye! set res } source.file] } -body { set tcl_traceExec 0 set tcl_traceCompile 0 set f $lgenfile #set script [format "puts ====-%s-====\nsource %s\nputs ====-done-====\n" $f $f] set script [format "source %s" $f] #puts stderr "eval $script" eval $script } -cleanup { removeFile source.file unset res } -result {Index*2:0:-- {0 -> 0} {1 -> 6} {2 -> 12} {3 -> 18} {4 -> 24} {5 -> 30} {6 -> 36} {7 -> 42} {8 -> 48} {9 -> 54} {10 -> 60} {11 -> 66} {12 -> 72} {13 -> 78} {14 -> 84} {15 -> 90} {16 -> 96} my_expr(3):3 {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21} {s2:Index+7: {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21} :--} {foo:Index-8: {-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6} :--} 9len=15 9(3)=10 {bar:Index+7: {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21} :--} {Index+7:7 8 9 10 11 12 13 14 15 16 17 18 19 20 21:--} {Index+7:7 8 9 10 11 12 13 14 15 16 17 18 19 20 21:--} {fib:0 1 1 2 3} {First 20 fibbinacci:0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181} {First 20 fibbinacci from x :0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181} Good-Bye!} test abstractlist-lgen-bug2 {bug in foreach} -constraints lgen -body { set x [lseq 17] set y [lgen 17 expr 6*] lappend res x-[lrange [tcl::unsupported::representation $x] 0 3] lappend res y-[lrange [tcl::unsupported::representation $y] 0 3] foreach i $x n $y { lappend res "$i -> $n" } lappend res x-[lrange [tcl::unsupported::representation $x] 0 3] lappend res y-[lrange [tcl::unsupported::representation $y] 0 3] } -cleanup { unset res } -result {{x-value is a arithseries} {y-value is a lgenseries} {0 -> 0} {1 -> 6} {2 -> 12} {3 -> 18} {4 -> 24} {5 -> 30} {6 -> 36} {7 -> 42} {8 -> 48} {9 -> 54} {10 -> 60} {11 -> 66} {12 -> 72} {13 -> 78} {14 -> 84} {15 -> 90} {16 -> 96} {x-value is a arithseries} {y-value is a lgenseries}} # scalar values test abstractlist-int {TclLengthOne: anti-shimmer of boolean, int, double, bignum} testobj { set res {} foreach i [list [expr {1+0}] [expr {true}] [expr {3.141592}] [expr {round(double(0x7fffffffffffffff))}]] { lappend res [testobj objtype $i] lappend res [llength $i] lappend res [testobj objtype $i] } #set w [expr {3.141592}] #lappend res [testobj objtype $w] [llength $w] [testobj objtype $w] set res } {int 1 int boolean 1 boolean double 1 double bignum 1 bignum} # lsort # cleanup ::tcltest::cleanupTests proc my_abstl_cleanup {vars} { set nowvars [uplevel info vars] foreach var $nowvars { if {$var ni $vars} { uplevel unset $var lappend clean-list $var } } return ${clean-list} } my_abstl_cleanup $abstractlisttestvars tcl9.0.3/tests/aaa_exit.test0000644000175000017500000000271715104661341015374 0ustar sergeisergei# Commands covered: exit, emphasis on finalization hangs # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {"::tcltest" ni [namespace children]} { package require tcltest 2.5 namespace import -force ::tcltest::* } foreach {fin_on_exit testname} {0 {normal, quick exit} 1 {full-finalized exit}} { test exit-1.[expr {$fin_on_exit+1}] $testname -setup { set tout [expr {1000 + [::tcl::pkgconfig get mem_debug] * 5000}] set tout [after $tout [list set done "Exit hangs (timeout) !!!"]] set f {} } -body { set f [open [list | [interpreter] << "set ::env(TCL_FINALIZE_ON_EXIT) $fin_on_exit; exit"] r] fileevent $f readable [namespace code {after cancel $tout; set done OK}] vwait done if {$done eq "OK"} { if {[catch {close $f} err]} { set done "Exit misbehaves: $err" } } set done } -cleanup { after cancel $tout if {$f ne {}} { catch { close $f } } unset -nocomplain fin_on_exit testname done f } -result OK } # cleanup ::tcltest::cleanupTests return tcl9.0.3/README.md0000644000175000017500000001752215104661341013035 0ustar sergeisergei# README: Tcl This is the **Tcl 9.0.3** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). 9.1 (in development, daily build) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/linux-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions/workflows/linux-build.yml?query=branch%3Amain) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/win-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions/workflows/win-build.yml?query=branch%3Amain) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/mac-build.yml/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions/workflows/mac-build.yml?query=branch%3Amain)
    9.0 (production release, daily build) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/linux-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tcl/actions/workflows/linux-build.yml?query=branch%3Acore-9-0-branch) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/win-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tcl/actions/workflows/win-build.yml?query=branch%3Acore-9-0-branch) [![Build Status](https://github.com/tcltk/tcl/actions/workflows/mac-build.yml/badge.svg?branch=core-9-0-branch)](https://github.com/tcltk/tcl/actions/workflows/mac-build.yml?query=branch%3Acore-9-0-branch) ## Contents 1. [Introduction](#intro) 2. [Documentation](#doc) 3. [Compiling and installing Tcl](#build) 4. [Development tools](#devtools) 5. [Tcl newsgroup](#complangtcl) 6. [The Tcler's Wiki](#wiki) 7. [Mailing lists](#email) 8. [Support and Training](#support) 9. [Tracking Development](#watch) 10. [Thank You](#thanks) ##
    1. Introduction Tcl provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and macOS. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications. Tcl is maintained, enhanced, and distributed freely by the Tcl community. Source code development and tracking of bug reports and feature requests take place at [core.tcl-lang.org](https://core.tcl-lang.org/). Tcl/Tk release and mailing list services are [hosted by SourceForge](https://sourceforge.net/projects/tcl/) with the Tcl Developer Xchange hosted at [www.tcl-lang.org](https://www.tcl-lang.org). Tcl is a freely available open-source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. See the file `license.terms` for complete information. ## 2. Documentation Extensive documentation is available on our website. The home page for this release, including new features, is [here](https://www.tcl-lang.org/software/tcltk/9.0.html). Detailed release notes can be found at the [file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/) by clicking on the relevant version. Information about Tcl itself can be found at the [Developer Xchange](https://www.tcl-lang.org/about/). There have been many Tcl books on the market. Many are mentioned in [the Wiki](https://wiki.tcl-lang.org/_/ref?N=25206). The complete set of reference manual entries for Tcl 9.0 is [online, here](https://www.tcl-lang.org/man/tcl9.0/). ### 2a. Unix Documentation The `doc` subdirectory in this release contains a complete set of reference manual entries for Tcl. Files with extension "`.1`" are for programs (for example, `tclsh.1`); files with extension "`.3`" are for C library procedures; and files with extension "`.n`" describe Tcl commands. The file "`doc/Tcl.n`" gives a quick summary of the Tcl language syntax. To print any of the man pages on Unix, cd to the "doc" directory and invoke your favorite variant of troff using the normal -man macros, for example groff -man -Tpdf Tcl.n >output.pdf to print Tcl.n to PDF. If Tcl has been installed correctly and your "man" program supports it, you should be able to access the Tcl manual entries using the normal "man" mechanisms, such as man Tcl ### 2b. Windows Documentation The "doc" subdirectory in this release contains a complete set of Windows help files for Tcl. Once you install this Tcl release, a shortcut to the Windows help Tcl documentation will appear in the "Start" menu: Start | Programs | Tcl | Tcl Help ## 3. Compiling and installing Tcl There are brief notes in the `unix/README`, `win/README`, and `macosx/README` about compiling on these different platforms. There is additional information about building Tcl from sources [online](https://www.tcl-lang.org/doc/howto/compile.html). ## 4. Development tools ActiveState produces a high-quality set of commercial quality development tools that is available to accelerate your Tcl application development. Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger, static code checker, single-file wrapping utility, bytecode compiler, and more. More information can be found at https://www.activestate.com/products/tcl/ ## 5. Tcl newsgroup There is a USENET newsgroup, "`comp.lang.tcl`", intended for the exchange of information about Tcl, Tk, and related applications. The newsgroup is a great place to ask general information questions. For bug reports, please see the "Support and bug fixes" section below. ## 6. Tcl'ers Wiki There is a [wiki-based open community site](https://wiki.tcl-lang.org/) covering all aspects of Tcl/Tk. It is dedicated to the Tcl programming language and its extensions. A wealth of useful information can be found there. It contains code snippets, references to papers, books, and FAQs, as well as pointers to development tools, extensions, and applications. You can also recommend additional URLs by editing the wiki yourself. ## 7. Mailing lists Several mailing lists are hosted at SourceForge to discuss development or use issues (like Macintosh and Windows topics). For more information and to subscribe, visit [here](https://sourceforge.net/projects/tcl/) and go to the Mailing Lists page. ## 8. Support and Training We are very interested in receiving bug reports, patches, and suggestions for improvements. We prefer that you send this information to us as tickets entered into [our issue tracker](https://core.tcl-lang.org/tcl/reportlist). We will log and follow-up on each bug, although we cannot promise a specific turn-around time. Enhancements may take longer and may not happen at all unless there is widespread support for them (we're trying to slow the rate at which Tcl/Tk turns into a kitchen sink). It's very difficult to make incompatible changes to Tcl/Tk at this point, due to the size of the installed base. The Tcl community is too large for us to provide much individual support for users. If you need help we suggest that you post questions to `comp.lang.tcl` or ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/tcl). We read the newsgroup and will attempt to answer esoteric questions for which no one else is likely to know the answer. In addition, see the wiki for [links to other organizations](https://wiki.tcl-lang.org/training) that offer Tcl/Tk training. ## 9. Tracking Development Tcl is developed in public. You can keep an eye on how Tcl is changing at [core.tcl-lang.org](https://core.tcl-lang.org/). ## 10. Thank You We'd like to express our thanks to the Tcl community for all the helpful suggestions, bug reports, and patches we have received. Tcl/Tk has improved vastly and will continue to do so with your help. tcl9.0.3/pkgs/0000755000175000017500000000000015104662776012530 5ustar sergeisergeitcl9.0.3/pkgs/README0000644000175000017500000000513115103062726013374 0ustar sergeisergei The 'pkgs' subdirectory of the Tcl source code distribution is meant to be a place where the source code distribution of Tcl packages may be placed so that they are built, installed, and tested along with Tcl. As originally distributed, Tcl re-distributes a number of packages in this location. The build systems for Tcl are written so that additional packages may be added, or the original packages removed in any number and still have all packages present get built, installed, and tested along with Tcl. In order for a package to work properly under the pkgs subdirectory, it needs to conform to the following conventions. All files of the package need to be contained in (subdirs of ...) a single subdirectory of the "pkgs" directrory. In that subdirectory of "pkgs" there must be an executable file named "configure". When the program "configure" is run, it should generate a file "Makefile" in the current working directory. The "configure" program should be able to accept as command line arguments all the arguments that can be passed to the top unix/configure program. It should also accept the --with-tcl= and --with-tclinclude= options in the conventional way. The generated "Makefile" must be one suitable for controlling the operations of a `make` program. The following targets must be defined: : Perform a build of the runtime components of the package from sources. install: Copy the runtime components of the package into their installed location. Must respect the DESTDIR variable for determining the installation location. test: Run the test suite of the package. Must respect the TCLSH_PROG, TESTFLAGS variables. clean: Delete all files generated by the default build target. distclean: Delete all generated files. dist: Produce a copy of the package's source code distribution. Must respect the DIST_ROOT variable determining where to write the generated directory. Packages that are written to make use of the Tcl Extension Architecture (TEA) and that make use of the tclconfig collection of support files, should conform to these conventions without further efforts. These conventions are subject to revision and refinement over time to better support the needs of the build system. Efforts will be made to keep the TEA support scripts consistent with the demands of this system. In addition, it is requested that packages also support building with Microsoft Visual Studio tools. This means the file win/makefile.vc should be included, suitable for use by the nmake program, defining the targets , install, test, and clean. tcl9.0.3/pkgs/package.list.txt0000644000175000017500000000152615103062726015626 0ustar sergeisergei# This file contains the mapping of directory names to package names for # documentation purposes. Each non-blank non-comment line is a two-element # list that says a possible name of directory (multiple lines may be needed # because of capitalization issues) and the documentation name of the package # to match. Pseudo-numeric suffixes are interpreted as version numbers. # [incr Tcl] itcl {[incr Tcl]} Itcl {[incr Tcl]} # SQLite Sqlite SQLite3 sqlite SQLite3 Sqlite3 SQLite3 sqlite3 SQLite3 # Thread Thread Thread thread Thread # Tcl Database Connectivity tdbc TDBC Tdbc TDBC TDBC TDBC # Drivers for TDBC Tdbcmysql tdbc::mysql tdbcmysql tdbc::mysql Tdbcodbc tdbc::odbc tdbcodbc tdbc::odbc Tdbcpostgres tdbc::postgres tdbcpostgres tdbc::postgres Tdbcsqlite3 tdbc::sqlite3 tdbcsqlite3 tdbc::sqlite3 Tdbcsqlite tdbc::sqlite3 tdbcsqlite tdbc::sqlite3 tcl9.0.3/manifest.uuid0000644000175000017500000000010115104661451014237 0ustar sergeisergeia527703e8829e0c3d27188dff72627dc0914d9c0cc9d4acfac297b78fff01081 tcl9.0.3/macosx/0000755000175000017500000000000015104662752013050 5ustar sergeisergeitcl9.0.3/macosx/Tclsh-Info.plist.in0000644000175000017500000000235415035744305016502 0ustar sergeisergei CFBundleDevelopmentRegion English CFBundleExecutable tclsh@TCL_VERSION@ CFBundleGetInfoString Tcl Shell @TCL_VERSION@@TCL_PATCH_LEVEL@, Copyright © 1987-@TCL_YEAR@ Tcl Core Team, Copyright © 2001-@TCL_YEAR@ Daniel A. Steffen, Copyright © 2001-2009 Apple Inc., Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIdentifier com.tcltk.tclsh CFBundleInfoDictionaryVersion 6.0 CFBundleName tclsh CFBundlePackageType APPL CFBundleShortVersionString @TCL_VERSION@@TCL_PATCH_LEVEL@ CFBundleSignature TclS CFBundleVersion @TCL_VERSION@@TCL_PATCH_LEVEL@ tcl9.0.3/macosx/tclMacOSXNotify.c0000644000175000017500000015100315104661341016173 0ustar sergeisergei/* * tclMacOSXNotify.c -- * * This file contains the implementation of a merged CFRunLoop/select() * based notifier, which is the lowest-level part of the Tcl event loop. * This file works together with generic/tclNotify.c. * * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 2001-2009, Apple Inc. * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" /* * In macOS 10.12 the os_unfair_lock was introduced as a replacement for the * OSSpinLock, and the OSSpinLock was deprecated. */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 #define USE_OS_UNFAIR_LOCK #include #endif #ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier is * in tclUnixNotfy.c */ #include #include #if !defined(USE_OS_UNFAIR_LOCK) /* * We use the Darwin-native spinlock API rather than pthread mutexes for * notifier locking: this radically simplifies the implementation and lowers * overhead. Note that these are not pure spinlocks, they employ various * strategies to back off and relinquish the processor, making them immune to * most priority-inversion livelocks (c.f. 'man 3 OSSpinLockLock' and Darwin * sources: xnu/osfmk/{ppc,i386}/commpage/spinlocks.s). */ #if defined(HAVE_LIBKERN_OSATOMIC_H) && defined(HAVE_OSSPINLOCKLOCK) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wunused-function" /* * Use OSSpinLock API where available (Tiger or later). */ #include /* * Wrappers so that we get warnings in just one small part of this file. */ static inline void SpinLockLock( OSSpinLock *lock) { OSSpinLockLock(lock); } static inline void SpinLockUnlock( OSSpinLock *lock) { OSSpinLockUnlock(lock); } static inline bool SpinLockTry( OSSpinLock *lock) { return OSSpinLockTry(lock); } #define SPINLOCK_INIT OS_SPINLOCK_INIT #else /* * Otherwise, use commpage spinlock SPI directly. */ typedef uint32_t OSSpinLock; static inline void SpinLockLock( OSSpinLock *lock) { extern void _spin_lock(OSSpinLock *lock); _spin_lock(lock); } static inline void SpinLockUnlock( OSSpinLock *lock) { extern void _spin_unlock(OSSpinLock *lock); _spin_unlock(lock); } static inline int SpinLockTry( OSSpinLock *lock) { extern int _spin_lock_try(OSSpinLock *lock); return _spin_lock_try(lock); } #define SPINLOCK_INIT 0 #pragma GCC diagnostic pop #endif /* HAVE_LIBKERN_OSATOMIC_H && HAVE_OSSPINLOCKLOCK */ #endif /* not using os_unfair_lock */ /* * These locks control access to the global notifier state. */ #if defined(USE_OS_UNFAIR_LOCK) static os_unfair_lock notifierInitLock = OS_UNFAIR_LOCK_INIT; static os_unfair_lock notifierLock = OS_UNFAIR_LOCK_INIT; #else static OSSpinLock notifierInitLock = SPINLOCK_INIT; static OSSpinLock notifierLock = SPINLOCK_INIT; #endif /* * Macros that abstract notifier locking/unlocking */ #if defined(USE_OS_UNFAIR_LOCK) #define LOCK_NOTIFIER_INIT os_unfair_lock_lock(¬ifierInitLock) #define UNLOCK_NOTIFIER_INIT os_unfair_lock_unlock(¬ifierInitLock) #define LOCK_NOTIFIER os_unfair_lock_lock(¬ifierLock) #define UNLOCK_NOTIFIER os_unfair_lock_unlock(¬ifierLock) #define LOCK_NOTIFIER_TSD os_unfair_lock_lock(&tsdPtr->tsdLock) #define UNLOCK_NOTIFIER_TSD os_unfair_lock_unlock(&tsdPtr->tsdLock) #else #define LOCK_NOTIFIER_INIT SpinLockLock(¬ifierInitLock) #define UNLOCK_NOTIFIER_INIT SpinLockUnlock(¬ifierInitLock) #define LOCK_NOTIFIER SpinLockLock(¬ifierLock) #define UNLOCK_NOTIFIER SpinLockUnlock(¬ifierLock) #define LOCK_NOTIFIER_TSD SpinLockLock(&tsdPtr->tsdLock) #define UNLOCK_NOTIFIER_TSD SpinLockUnlock(&tsdPtr->tsdLock) #endif /* * This structure is used to keep track of the notifier info for a registered * file. */ typedef struct FileHandler { int fd; int mask; /* Mask of desired events: TCL_READABLE, * etc. */ int readyMask; /* Mask of events that have been seen since * the last time file handlers were invoked * for this file. */ Tcl_FileProc *proc; /* Function to call, in the style of * Tcl_CreateFileHandler. */ void *clientData; /* Argument to pass to proc. */ struct FileHandler *nextPtr;/* Next in list of all files we care about. */ } FileHandler; /* * The following structure is what is added to the Tcl event queue when file * handlers are ready to fire. */ typedef struct { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find * the FileHandler structure for the file * (can't point directly to the FileHandler * structure because it could go away while * the event is queued). */ } FileHandlerEvent; /* * The following structure contains a set of select() masks to track readable, * writable, and exceptional conditions. */ typedef struct { fd_set readable; fd_set writable; fd_set exceptional; } SelectMasks; /* * The following static structure contains the state information for the * select based implementation of the Tcl notifier. One of these structures is * created for each thread that is using the notifier. */ typedef struct ThreadSpecificData { FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ int polled; /* True if the notifier thread has polled for * this thread. */ int sleeping; /* True if runloop is inside Tcl_Sleep. */ int runLoopSourcePerformed; /* True after the runLoopSource callack was * performed. */ int runLoopRunning; /* True if this thread's Tcl runLoop is * running. */ int runLoopNestingLevel; /* Level of nested runLoop invocations. */ /* Must hold the notifierLock before accessing the following fields: */ /* Start notifierLock section */ int onList; /* True if this thread is on the * waitingList */ struct ThreadSpecificData *nextPtr, *prevPtr; /* All threads that are currently waiting on * an event have their ThreadSpecificData * structure on a doubly-linked listed formed * from these pointers. */ /* End notifierLock section */ #if defined(USE_OS_UNFAIR_LOCK) os_unfair_lock tsdLock; #else OSSpinLock tsdLock; /* Must hold this lock before acessing the * following fields from more than one * thread. */ #endif /* Start tsdLock section */ SelectMasks checkMasks; /* This structure is used to build up the * masks to be used in the next call to * select. Bits are set in response to calls * to Tcl_CreateFileHandler. */ SelectMasks readyMasks; /* This array reflects the readable/writable * conditions that were found to exist by the * last call to select. */ int numFdBits; /* Number of valid bits in checkMasks (one * more than highest fd for which * Tcl_WatchFile has been called). */ int polling; /* True if this thread is polling for * events. */ CFRunLoopRef runLoop; /* This thread's CFRunLoop, needs to be woken * up whenever the runLoopSource is * signaled. */ CFRunLoopSourceRef runLoopSource; /* Any other thread alerts a notifier that an * event is ready to be processed by signaling * this CFRunLoopSource. */ CFRunLoopObserverRef runLoopObserver, runLoopObserverTcl; /* Adds/removes this thread from waitingList * when the CFRunLoop starts/stops. */ CFRunLoopTimerRef runLoopTimer; /* Wakes up CFRunLoop after given timeout when * running embedded. */ /* End tsdLock section */ CFTimeInterval waitTime; /* runLoopTimer wait time when running * embedded. */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; /* * The following static indicates the number of threads that have initialized * notifiers. * * You must hold the notifierInitLock before accessing this variable. */ static int notifierCount = 0; /* * The following variable points to the head of a doubly-linked list of * ThreadSpecificData structures for all threads that are currently waiting on * an event. * * You must hold the notifierLock before accessing this list. */ static ThreadSpecificData *waitingListPtr = NULL; /* * The notifier thread spends all its time in select() waiting for a file * descriptor associated with one of the threads on the waitingListPtr list to * do something interesting. But if the contents of the waitingListPtr list * ever changes, we need to wake up and restart the select() system call. You * can wake up the notifier thread by writing a single byte to the file * descriptor defined below. This file descriptor is the input-end of a pipe * and the notifier thread is listening for data on the output-end of the same * pipe. Hence writing to this file descriptor will cause the select() system * call to return and wake up the notifier thread. * * You must hold the notifierLock lock before writing to the pipe. */ static int triggerPipe = -1; static int receivePipe = -1; /* Output end of triggerPipe */ /* * The following static indicates if the notifier thread is running. * * You must hold the notifierInitLock before accessing this variable. */ static int notifierThreadRunning; /* * The following static flag indicates that async handlers are pending. */ #if TCL_THREADS static int asyncPending = 0; #endif /* * Signal mask information for notifier thread. */ static sigset_t notifierSigMask; static sigset_t allSigMask; /* * This is the thread ID of the notifier thread that does select. Only valid * when notifierThreadRunning is non-zero. * * You must hold the notifierInitLock before accessing this variable. */ static pthread_t notifierThread; /* * Custom runloop mode for running with only the runloop source for the * notifier thread. */ #ifndef TCL_EVENTS_ONLY_RUN_LOOP_MODE #define TCL_EVENTS_ONLY_RUN_LOOP_MODE "com.tcltk.tclEventsOnlyRunLoopMode" #endif #ifdef __CONSTANT_CFSTRINGS__ #define tclEventsOnlyRunLoopMode CFSTR(TCL_EVENTS_ONLY_RUN_LOOP_MODE) #else static CFStringRef tclEventsOnlyRunLoopMode = NULL; #endif /* * CFTimeInterval to wait forever. */ #define CF_TIMEINTERVAL_FOREVER 5.05e8 /* * Static routines defined in this file. */ static void StartNotifierThread(void); static TCL_NORETURN void NotifierThreadProc(void *clientData); static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); static void TimerWakeUp(CFRunLoopTimerRef timer, void *info); static void QueueFileEvents(void *info); static void UpdateWaitingListAndServiceEvents( CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info); static int OnOffWaitingList(ThreadSpecificData *tsdPtr, int onList, int signalNotifier); #ifdef HAVE_PTHREAD_ATFORK static int atForkInit = 0; static void AtForkPrepare(void); static void AtForkParent(void); static void AtForkChild(void); #endif /* HAVE_PTHREAD_ATFORK */ /* *---------------------------------------------------------------------- * * LookUpFileHandler -- * * Look up the file handler structure (and optionally the previous one in * the chain) associated with a file descriptor. * * Returns: * A pointer to the file handler, or NULL if it can't be found. * * Side effects: * If prevPtrPtr is non-NULL, it will be written to if the file handler * is found. * *---------------------------------------------------------------------- */ static inline FileHandler * LookUpFileHandler( ThreadSpecificData *tsdPtr, /* Where to look things up. */ int fd, /* What we are looking for. */ FileHandler **prevPtrPtr) /* If non-NULL, where to report the previous * pointer. */ { FileHandler *filePtr, *prevPtr; /* * Find the entry for the given file (and return if there isn't one). */ for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ; prevPtr = filePtr, filePtr = filePtr->nextPtr) { if (filePtr == NULL) { return NULL; } if (filePtr->fd == fd) { break; } } /* * Report what we've found to our caller. */ if (prevPtrPtr) { *prevPtrPtr = prevPtr; } return filePtr; } /* *---------------------------------------------------------------------- * * TclpInitNotifier -- * * Initializes the platform specific notifier state. * * Results: * Returns a handle to the notifier state for this thread. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpInitNotifier(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #ifdef WEAK_IMPORT_SPINLOCKLOCK /* * Initialize support for weakly imported spinlock API. */ if (pthread_once(&spinLockLockInitControl, SpinLockLockInit)) { Tcl_Panic("Tcl_InitNotifier: %s", "pthread_once failed"); } #endif #ifndef __CONSTANT_CFSTRINGS__ if (!tclEventsOnlyRunLoopMode) { tclEventsOnlyRunLoopMode = CFSTR(TCL_EVENTS_ONLY_RUN_LOOP_MODE); } #endif /* * Initialize CFRunLoopSource and add it to CFRunLoop of this thread. */ if (!tsdPtr->runLoop) { CFRunLoopRef runLoop = CFRunLoopGetCurrent(); CFRunLoopSourceRef runLoopSource; CFRunLoopSourceContext runLoopSourceContext; CFRunLoopObserverContext runLoopObserverContext; CFRunLoopObserverRef runLoopObserver, runLoopObserverTcl; bzero(&runLoopSourceContext, sizeof(CFRunLoopSourceContext)); runLoopSourceContext.info = tsdPtr; runLoopSourceContext.perform = QueueFileEvents; runLoopSource = CFRunLoopSourceCreate(NULL, LONG_MIN, &runLoopSourceContext); if (!runLoopSource) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create CFRunLoopSource"); } CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopCommonModes); CFRunLoopAddSource(runLoop, runLoopSource, tclEventsOnlyRunLoopMode); bzero(&runLoopObserverContext, sizeof(CFRunLoopObserverContext)); runLoopObserverContext.info = tsdPtr; runLoopObserver = CFRunLoopObserverCreate(NULL, kCFRunLoopEntry|kCFRunLoopExit, TRUE, LONG_MIN, UpdateWaitingListAndServiceEvents, &runLoopObserverContext); if (!runLoopObserver) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create CFRunLoopObserver"); } CFRunLoopAddObserver(runLoop, runLoopObserver, kCFRunLoopCommonModes); /* * Create a second CFRunLoopObserver with the same callback as above * for the tclEventsOnlyRunLoopMode to ensure that the callback can be * re-entered via Tcl_ServiceAll() in the kCFRunLoopBeforeWaiting case * (CFRunLoop prevents observer callback re-entry of a given observer * instance). */ runLoopObserverTcl = CFRunLoopObserverCreate(NULL, kCFRunLoopEntry|kCFRunLoopExit, TRUE, LONG_MIN, UpdateWaitingListAndServiceEvents, &runLoopObserverContext); if (!runLoopObserverTcl) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create CFRunLoopObserver"); } CFRunLoopAddObserver(runLoop, runLoopObserverTcl, tclEventsOnlyRunLoopMode); tsdPtr->runLoop = runLoop; tsdPtr->runLoopSource = runLoopSource; tsdPtr->runLoopObserver = runLoopObserver; tsdPtr->runLoopObserverTcl = runLoopObserverTcl; tsdPtr->runLoopTimer = NULL; tsdPtr->waitTime = CF_TIMEINTERVAL_FOREVER; #if defined(USE_OS_UNFAIR_LOCK) tsdPtr->tsdLock = OS_UNFAIR_LOCK_INIT; #else tsdPtr->tsdLock = SPINLOCK_INIT; #endif } LOCK_NOTIFIER_INIT; #ifdef HAVE_PTHREAD_ATFORK /* * Install pthread_atfork handlers to reinitialize the notifier in the * child of a fork. */ if (!atForkInit) { int result = pthread_atfork(AtForkPrepare, AtForkParent, AtForkChild); if (result) { Tcl_Panic("Tcl_InitNotifier: %s", "pthread_atfork failed"); } atForkInit = 1; } #endif /* HAVE_PTHREAD_ATFORK */ if (notifierCount == 0) { int fds[2], status; /* * Initialize trigger pipe. */ if (pipe(fds) != 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not create trigger pipe"); } status = fcntl(fds[0], F_GETFL); status |= O_NONBLOCK; if (fcntl(fds[0], F_SETFL, status) < 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not make receive pipe non-blocking"); } status = fcntl(fds[1], F_GETFL); status |= O_NONBLOCK; if (fcntl(fds[1], F_SETFL, status) < 0) { Tcl_Panic("Tcl_InitNotifier: %s", "could not make trigger pipe non-blocking"); } receivePipe = fds[0]; triggerPipe = fds[1]; /* * Create notifier thread lazily in Tcl_WaitForEvent() to avoid * interfering with fork() followed immediately by execve() (we cannot * execve() when more than one thread is present). */ notifierThreadRunning = 0; } notifierCount++; UNLOCK_NOTIFIER_INIT; return tsdPtr; } /* *---------------------------------------------------------------------- * * Tcl_MacOSXNotifierAddRunLoopMode -- * * Add the tcl notifier RunLoop source, observer and timer (if any) * to the given RunLoop mode. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void Tcl_MacOSXNotifierAddRunLoopMode( const void *runLoopMode) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); CFStringRef mode = (CFStringRef) runLoopMode; if (tsdPtr->runLoop) { CFRunLoopAddSource(tsdPtr->runLoop, tsdPtr->runLoopSource, mode); CFRunLoopAddObserver(tsdPtr->runLoop, tsdPtr->runLoopObserver, mode); if (tsdPtr->runLoopTimer) { CFRunLoopAddTimer(tsdPtr->runLoop, tsdPtr->runLoopTimer, mode); } } } /* *---------------------------------------------------------------------- * * StartNotifierThread -- * * Start notifier thread if necessary. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void StartNotifierThread(void) { LOCK_NOTIFIER_INIT; if (!notifierCount) { Tcl_Panic("StartNotifierThread: notifier not initialized"); } if (!notifierThreadRunning) { int result; pthread_attr_t attr; /* * Arrange for the notifier thread to start with all * signals blocked. In its mainloop it unblocks the * signals at safe points. */ sigfillset(&allSigMask); pthread_sigmask(SIG_BLOCK, &allSigMask, ¬ifierSigMask); pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); pthread_attr_setstacksize(&attr, 60 * 1024); result = pthread_create(¬ifierThread, &attr, (void * (*)(void *)) NotifierThreadProc, NULL); pthread_attr_destroy(&attr); if (result) { Tcl_Panic("StartNotifierThread: unable to start notifier thread"); } notifierThreadRunning = 1; /* * Restore original signal mask. */ pthread_sigmask(SIG_SETMASK, ¬ifierSigMask, NULL); } UNLOCK_NOTIFIER_INIT; } /* *---------------------------------------------------------------------- * * TclpFinalizeNotifier -- * * This function is called to cleanup the notifier state before a thread * is terminated. * * Results: * None. * * Side effects: * May terminate the background notifier thread if this is the last * notifier instance. * *---------------------------------------------------------------------- */ void TclpFinalizeNotifier( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); LOCK_NOTIFIER_INIT; notifierCount--; /* * If this is the last thread to use the notifier, close the notifier pipe * and wait for the background thread to terminate. */ if (notifierCount == 0) { if (triggerPipe != -1) { /* * Send "q" message to the notifier thread so that it will * terminate. The notifier will return from its call to select() * and notice that a "q" message has arrived, it will then close * its side of the pipe and terminate its thread. Note the we can * not just close the pipe and check for EOF in the notifier * thread because if a background child process was created with * exec, select() would not register the EOF on the pipe until the * child processes had terminated. [Bug: 4139] [Bug 1222872] */ write(triggerPipe, "q", 1); close(triggerPipe); if (notifierThreadRunning) { int result = pthread_join(notifierThread, NULL); if (result) { Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier " "thread"); } notifierThreadRunning = 0; /* * If async marks are outstanding, perform actions now. */ if (asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } } close(receivePipe); triggerPipe = -1; } } UNLOCK_NOTIFIER_INIT; LOCK_NOTIFIER_TSD; /* For concurrency with Tcl_AlertNotifier */ if (tsdPtr->runLoop) { tsdPtr->runLoop = NULL; /* * Remove runLoopSource, runLoopObserver and runLoopTimer from all * CFRunLoops. */ CFRunLoopSourceInvalidate(tsdPtr->runLoopSource); CFRelease(tsdPtr->runLoopSource); tsdPtr->runLoopSource = NULL; CFRunLoopObserverInvalidate(tsdPtr->runLoopObserver); CFRelease(tsdPtr->runLoopObserver); tsdPtr->runLoopObserver = NULL; CFRunLoopObserverInvalidate(tsdPtr->runLoopObserverTcl); CFRelease(tsdPtr->runLoopObserverTcl); tsdPtr->runLoopObserverTcl = NULL; if (tsdPtr->runLoopTimer) { CFRunLoopTimerInvalidate(tsdPtr->runLoopTimer); CFRelease(tsdPtr->runLoopTimer); tsdPtr->runLoopTimer = NULL; } } UNLOCK_NOTIFIER_TSD; } /* *---------------------------------------------------------------------- * * TclpAlertNotifier -- * * Wake up the specified notifier from any thread. This routine is called * by the platform independent notifier code whenever the Tcl_ThreadAlert * routine is called. This routine is guaranteed not to be called on a * given notifier after Tcl_FinalizeNotifier is called for that notifier. * * Results: * None. * * Side effects: * Signals the notifier condition variable for the specified notifier. * *---------------------------------------------------------------------- */ void TclpAlertNotifier( void *clientData) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; LOCK_NOTIFIER_TSD; if (tsdPtr->runLoop) { CFRunLoopSourceSignal(tsdPtr->runLoopSource); CFRunLoopWakeUp(tsdPtr->runLoop); } UNLOCK_NOTIFIER_TSD; } /* *---------------------------------------------------------------------- * * TclpSetTimer -- * * This function sets the current notifier timer value. * * Results: * None. * * Side effects: * Replaces any previous timer. * *---------------------------------------------------------------------- */ void TclpSetTimer( const Tcl_Time *timePtr) /* Timeout value, may be NULL. */ { ThreadSpecificData *tsdPtr; CFRunLoopTimerRef runLoopTimer; CFTimeInterval waitTime; tsdPtr = TCL_TSD_INIT(&dataKey); runLoopTimer = tsdPtr->runLoopTimer; if (!runLoopTimer) { return; } if (timePtr) { Tcl_Time vTime = *timePtr; if (vTime.sec != 0 || vTime.usec != 0) { TclScaleTime(&vTime); waitTime = vTime.sec + 1.0e-6 * vTime.usec; } else { waitTime = 0; } } else { waitTime = CF_TIMEINTERVAL_FOREVER; } tsdPtr->waitTime = waitTime; CFRunLoopTimerSetNextFireDate(runLoopTimer, CFAbsoluteTimeGetCurrent() + waitTime); } /* *---------------------------------------------------------------------- * * TimerWakeUp -- * * CFRunLoopTimer callback. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void TimerWakeUp( TCL_UNUSED(CFRunLoopTimerRef), TCL_UNUSED(void *)) { } /* *---------------------------------------------------------------------- * * TclpServiceModeHook -- * * This function is invoked whenever the service mode changes. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void TclpServiceModeHook( int mode) /* Either TCL_SERVICE_ALL, or * TCL_SERVICE_NONE. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (mode == TCL_SERVICE_ALL && !tsdPtr->runLoopTimer) { if (!tsdPtr->runLoop) { Tcl_Panic("Tcl_ServiceModeHook: Notifier not initialized"); } tsdPtr->runLoopTimer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + CF_TIMEINTERVAL_FOREVER, CF_TIMEINTERVAL_FOREVER, 0, 0, TimerWakeUp, NULL); if (tsdPtr->runLoopTimer) { CFRunLoopAddTimer(tsdPtr->runLoop, tsdPtr->runLoopTimer, kCFRunLoopCommonModes); StartNotifierThread(); } } } /* *---------------------------------------------------------------------- * * TclpCreateFileHandler -- * * This function registers a file handler with the notifier. * * Results: * None. * * Side effects: * Creates a new file handler structure. * *---------------------------------------------------------------------- */ void TclpCreateFileHandler( int fd, /* Handle of stream to watch. */ int mask, /* OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION: indicates * conditions under which proc should be * called. */ Tcl_FileProc *proc, /* Function to call for each selected * event. */ void *clientData) /* Arbitrary data to pass to proc. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); FileHandler *filePtr = LookUpFileHandler(tsdPtr, fd, NULL); if (filePtr == NULL) { filePtr = (FileHandler *) Tcl_Alloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->readyMask = 0; filePtr->nextPtr = tsdPtr->firstFileHandlerPtr; tsdPtr->firstFileHandlerPtr = filePtr; } filePtr->proc = proc; filePtr->clientData = clientData; filePtr->mask = mask; /* * Update the check masks for this file. */ LOCK_NOTIFIER_TSD; if (mask & TCL_READABLE) { FD_SET(fd, &tsdPtr->checkMasks.readable); } else { FD_CLR(fd, &tsdPtr->checkMasks.readable); } if (mask & TCL_WRITABLE) { FD_SET(fd, &tsdPtr->checkMasks.writable); } else { FD_CLR(fd, &tsdPtr->checkMasks.writable); } if (mask & TCL_EXCEPTION) { FD_SET(fd, &tsdPtr->checkMasks.exceptional); } else { FD_CLR(fd, &tsdPtr->checkMasks.exceptional); } if (tsdPtr->numFdBits <= fd) { tsdPtr->numFdBits = fd+1; } UNLOCK_NOTIFIER_TSD; } /* *---------------------------------------------------------------------- * * TclpDeleteFileHandler -- * * Cancel a previously-arranged callback arrangement for a file. * * Results: * None. * * Side effects: * If a callback was previously registered on file, remove it. * *---------------------------------------------------------------------- */ void TclpDeleteFileHandler( int fd) /* Stream id for which to remove callback * function. */ { FileHandler *filePtr, *prevPtr; int i, numFdBits = -1; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * Find the entry for the given file (and return if there isn't one). */ filePtr = LookUpFileHandler(tsdPtr, fd, &prevPtr); if (filePtr == NULL) { return; } /* * Find current max fd. */ if (fd + 1 == tsdPtr->numFdBits) { numFdBits = 0; for (i = fd - 1; i >= 0; i--) { if (FD_ISSET(i, &tsdPtr->checkMasks.readable) || FD_ISSET(i, &tsdPtr->checkMasks.writable) || FD_ISSET(i, &tsdPtr->checkMasks.exceptional)) { numFdBits = i + 1; break; } } } LOCK_NOTIFIER_TSD; if (numFdBits != -1) { tsdPtr->numFdBits = numFdBits; } /* * Update the check masks for this file. */ if (filePtr->mask & TCL_READABLE) { FD_CLR(fd, &tsdPtr->checkMasks.readable); } if (filePtr->mask & TCL_WRITABLE) { FD_CLR(fd, &tsdPtr->checkMasks.writable); } if (filePtr->mask & TCL_EXCEPTION) { FD_CLR(fd, &tsdPtr->checkMasks.exceptional); } UNLOCK_NOTIFIER_TSD; /* * Clean up information in the callback record. */ if (prevPtr == NULL) { tsdPtr->firstFileHandlerPtr = filePtr->nextPtr; } else { prevPtr->nextPtr = filePtr->nextPtr; } Tcl_Free(filePtr); } /* *---------------------------------------------------------------------- * * FileHandlerEventProc -- * * This function is called by Tcl_ServiceEvent when a file event reaches * the front of the event queue. This function is responsible for * actually handling the event by invoking the callback for the file * handler. * * Results: * Returns 1 if the event was handled, meaning it should be removed from * the queue. Returns 0 if the event was not handled, meaning it should * stay on the queue. The only time the event isn't handled is if the * TCL_FILE_EVENTS flag bit isn't set. * * Side effects: * Whatever the file handler's callback function does. * *---------------------------------------------------------------------- */ static int FileHandlerEventProc( Tcl_Event *evPtr, /* Event to service. */ int flags) /* Flags that indicate what events to handle, * such as TCL_FILE_EVENTS. */ { int mask; FileHandler *filePtr; FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr; ThreadSpecificData *tsdPtr; if (!(flags & TCL_FILE_EVENTS)) { return 0; } /* * Search through the file handlers to find the one whose handle matches * the event. We do this rather than keeping a pointer to the file handler * directly in the event, so that the handler can be deleted while the * event is queued without leaving a dangling pointer. */ tsdPtr = TCL_TSD_INIT(&dataKey); filePtr = LookUpFileHandler(tsdPtr, fileEvPtr->fd, NULL); if (filePtr != NULL) { /* * The code is tricky for two reasons: * 1. The file handler's desired events could have changed since the * time when the event was queued, so AND the ready mask with the * desired mask. * 2. The file could have been closed and re-opened since the time * when the event was queued. This is why the ready mask is stored * in the file handler rather than the queued event: it will be * zeroed when a new file handler is created for the newly opened * file. */ mask = filePtr->readyMask & filePtr->mask; filePtr->readyMask = 0; if (mask != 0) { LOCK_NOTIFIER_TSD; if (mask & TCL_READABLE) { FD_CLR(filePtr->fd, &tsdPtr->readyMasks.readable); } if (mask & TCL_WRITABLE) { FD_CLR(filePtr->fd, &tsdPtr->readyMasks.writable); } if (mask & TCL_EXCEPTION) { FD_CLR(filePtr->fd, &tsdPtr->readyMasks.exceptional); } UNLOCK_NOTIFIER_TSD; filePtr->proc(filePtr->clientData, mask); } } return 1; } /* *---------------------------------------------------------------------- * * TclpNotifierData -- * * This function returns a void pointer to be associated * with a Tcl_AsyncHandler. * * Results: * On MacOSX, returns always NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ void * TclpNotifierData(void) { return NULL; } /* *---------------------------------------------------------------------- * * TclpWaitForEvent -- * * This function is called by Tcl_DoOneEvent to wait for new events on * the message queue. If the block time is 0, then Tcl_WaitForEvent just * polls without blocking. * * Results: * Returns 0 if a tcl event or timeout occurred and 1 if a non-tcl * CFRunLoop source was processed. * * Side effects: * None. * *---------------------------------------------------------------------- */ int TclpWaitForEvent( const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { int result, polling, runLoopRunning; CFTimeInterval waitTime; SInt32 runLoopStatus; ThreadSpecificData *tsdPtr; result = -1; polling = 0; waitTime = CF_TIMEINTERVAL_FOREVER; tsdPtr = TCL_TSD_INIT(&dataKey); if (!tsdPtr->runLoop) { Tcl_Panic("Tcl_WaitForEvent: Notifier not initialized"); } /* * A NULL timePtr means wait forever. */ if (timePtr) { Tcl_Time vTime = *timePtr; /* * TIP #233 (Virtualized Time). Is virtual time in effect? And do we * actually have something to scale? If yes to both then we call the * handler to do this scaling. */ if (vTime.sec != 0 || vTime.usec != 0) { TclScaleTime(&vTime); waitTime = vTime.sec + 1.0e-6 * vTime.usec; } else { /* * The max block time was set to 0. * * If we set the waitTime to 0, then the call to CFRunLoopInMode * may return without processing all of its sources. The Apple * documentation says that if the waitTime is 0 "only one pass is * made through the run loop before returning; if multiple sources * or timers are ready to fire immediately, only one (possibly two * if one is a version 0 source) will be fired, regardless of the * value of returnAfterSourceHandled." This can cause some chanio * tests to fail. So we use a small positive waitTime unless * there is another RunLoop running. */ polling = 1; waitTime = tsdPtr->runLoopRunning ? 0 : 0.0001; } } StartNotifierThread(); LOCK_NOTIFIER_TSD; tsdPtr->polling = polling; UNLOCK_NOTIFIER_TSD; tsdPtr->runLoopSourcePerformed = 0; /* * If the Tcl runloop is already running (e.g. if Tcl_WaitForEvent was * called recursively) start a new runloop in a custom runloop mode * containing only the source for the notifier thread. Otherwise wakeups * from other sources added to the common runloop mode might get lost or * 3rd party event handlers might get called when they do not expect to * be. */ runLoopRunning = tsdPtr->runLoopRunning; tsdPtr->runLoopRunning = 1; runLoopStatus = CFRunLoopRunInMode( runLoopRunning ? tclEventsOnlyRunLoopMode : kCFRunLoopDefaultMode, waitTime, TRUE); tsdPtr->runLoopRunning = runLoopRunning; LOCK_NOTIFIER_TSD; tsdPtr->polling = 0; UNLOCK_NOTIFIER_TSD; switch (runLoopStatus) { case kCFRunLoopRunFinished: Tcl_Panic("Tcl_WaitForEvent: CFRunLoop finished"); break; case kCFRunLoopRunTimedOut: QueueFileEvents(tsdPtr); result = 0; break; case kCFRunLoopRunStopped: case kCFRunLoopRunHandledSource: result = tsdPtr->runLoopSourcePerformed ? 0 : 1; break; } return result; } /* *---------------------------------------------------------------------- * * QueueFileEvents -- * * CFRunLoopSource callback for queueing file events. * * Results: * None. * * Side effects: * Queues file events that are detected by the select. * *---------------------------------------------------------------------- */ static void QueueFileEvents( void *info) { SelectMasks readyMasks; FileHandler *filePtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) info; /* * Queue all detected file events. */ LOCK_NOTIFIER_TSD; FD_COPY(&tsdPtr->readyMasks.readable, &readyMasks.readable); FD_COPY(&tsdPtr->readyMasks.writable, &readyMasks.writable); FD_COPY(&tsdPtr->readyMasks.exceptional, &readyMasks.exceptional); FD_ZERO(&tsdPtr->readyMasks.readable); FD_ZERO(&tsdPtr->readyMasks.writable); FD_ZERO(&tsdPtr->readyMasks.exceptional); UNLOCK_NOTIFIER_TSD; tsdPtr->runLoopSourcePerformed = 1; for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL); filePtr = filePtr->nextPtr) { int mask = 0; if (FD_ISSET(filePtr->fd, &readyMasks.readable)) { mask |= TCL_READABLE; } if (FD_ISSET(filePtr->fd, &readyMasks.writable)) { mask |= TCL_WRITABLE; } if (FD_ISSET(filePtr->fd, &readyMasks.exceptional)) { mask |= TCL_EXCEPTION; } if (!mask) { continue; } /* * Don't bother to queue an event if the mask was previously non-zero * since an event must still be on the queue. */ if (filePtr->readyMask == 0) { FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) Tcl_Alloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); } filePtr->readyMask = mask; } } /* *---------------------------------------------------------------------- * * UpdateWaitingListAndServiceEvents -- * * CFRunLoopObserver callback for updating waitingList and servicing Tcl * events. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void UpdateWaitingListAndServiceEvents( TCL_UNUSED(CFRunLoopObserverRef), CFRunLoopActivity activity, void *info) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) info; if (tsdPtr->sleeping) { return; } switch (activity) { case kCFRunLoopEntry: tsdPtr->runLoopNestingLevel++; if (tsdPtr->numFdBits > 0 || tsdPtr->polling) { LOCK_NOTIFIER; if (!OnOffWaitingList(tsdPtr, 1, 1) && tsdPtr->polling) { write(triggerPipe, "", 1); } UNLOCK_NOTIFIER; } break; case kCFRunLoopExit: if (tsdPtr->runLoopNestingLevel == 1) { LOCK_NOTIFIER; OnOffWaitingList(tsdPtr, 0, 1); UNLOCK_NOTIFIER; } tsdPtr->runLoopNestingLevel--; break; default: break; } } /* *---------------------------------------------------------------------- * * OnOffWaitingList -- * * Add/remove the specified thread to/from the global waitingList and * optionally signal the notifier. * * !!! Requires notifierLock to be held !!! * * Results: * Boolean indicating whether the waitingList was changed. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int OnOffWaitingList( ThreadSpecificData *tsdPtr, int onList, int signalNotifier) { int changeWaitingList; changeWaitingList = (!onList ^ !tsdPtr->onList); if (changeWaitingList) { if (onList) { tsdPtr->nextPtr = waitingListPtr; if (waitingListPtr) { waitingListPtr->prevPtr = tsdPtr; } tsdPtr->prevPtr = NULL; waitingListPtr = tsdPtr; tsdPtr->onList = 1; } else { if (tsdPtr->prevPtr) { tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr; } else { waitingListPtr = tsdPtr->nextPtr; } if (tsdPtr->nextPtr) { tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr; } tsdPtr->nextPtr = tsdPtr->prevPtr = NULL; tsdPtr->onList = 0; } if (signalNotifier) { write(triggerPipe, "", 1); } } return changeWaitingList; } /* *---------------------------------------------------------------------- * * Tcl_Sleep -- * * Delay execution for the specified number of milliseconds. * * Results: * None. * * Side effects: * Time passes. * *---------------------------------------------------------------------- */ void Tcl_Sleep( int ms) /* Number of milliseconds to sleep. */ { Tcl_Time vdelay; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (ms <= 0) { return; } /* * TIP #233: Scale from virtual time to real-time. */ vdelay.sec = ms / 1000; vdelay.usec = (ms % 1000) * 1000; TclScaleTime(&vdelay); if (tsdPtr->runLoop) { CFTimeInterval waitTime; CFRunLoopTimerRef runLoopTimer = tsdPtr->runLoopTimer; CFAbsoluteTime nextTimerFire = 0, waitEnd, now; SInt32 runLoopStatus; waitTime = vdelay.sec + 1.0e-6 * vdelay.usec; now = CFAbsoluteTimeGetCurrent(); waitEnd = now + waitTime; if (runLoopTimer) { nextTimerFire = CFRunLoopTimerGetNextFireDate(runLoopTimer); if (nextTimerFire < waitEnd) { CFRunLoopTimerSetNextFireDate(runLoopTimer, now + CF_TIMEINTERVAL_FOREVER); } else { runLoopTimer = NULL; } } tsdPtr->sleeping = 1; do { runLoopStatus = CFRunLoopRunInMode(kCFRunLoopDefaultMode, waitTime, FALSE); switch (runLoopStatus) { case kCFRunLoopRunFinished: Tcl_Panic("Tcl_Sleep: CFRunLoop finished"); break; case kCFRunLoopRunStopped: waitTime = waitEnd - CFAbsoluteTimeGetCurrent(); break; case kCFRunLoopRunTimedOut: waitTime = 0; break; } } while (waitTime > 0); tsdPtr->sleeping = 0; if (runLoopTimer) { CFRunLoopTimerSetNextFireDate(runLoopTimer, nextTimerFire); } } else { struct timespec waitTime; waitTime.tv_sec = vdelay.sec; waitTime.tv_nsec = vdelay.usec * 1000; while (nanosleep(&waitTime, &waitTime)); } } /* *---------------------------------------------------------------------- * * TclUnixWaitForFile -- * * This function waits synchronously for a file to become readable or * writable, with an optional timeout. * * Results: * The return value is an OR'ed combination of TCL_READABLE, * TCL_WRITABLE, and TCL_EXCEPTION, indicating the conditions that are * present on file at the time of the return. This function will not * return until either "timeout" milliseconds have elapsed or at least * one of the conditions given by mask has occurred for file (a return * value of 0 means that a timeout occurred). No normal events will be * serviced during the execution of this function. * * Side effects: * Time passes. * *---------------------------------------------------------------------- */ int TclUnixWaitForFile( int fd, /* Handle for file on which to wait. */ int mask, /* What to wait for: OR'ed combination of * TCL_READABLE, TCL_WRITABLE, and * TCL_EXCEPTION. */ int timeout) /* Maximum amount of time to wait for one of * the conditions in mask to occur, in * milliseconds. A value of 0 means don't wait * at all, and a value of -1 means wait * forever. */ { Tcl_Time abortTime = {0, 0}, now; /* silence gcc 4 warning */ struct timeval blockTime, *timeoutPtr; int numFound, result = 0; fd_set readableMask; fd_set writableMask; fd_set exceptionalMask; #define SET_BITS(var, bits) ((var) |= (bits)) #define CLEAR_BITS(var, bits) ((var) &= ~(bits)) #ifndef _DARWIN_C_SOURCE /* * Sanity check fd. */ if (fd >= FD_SETSIZE) { Tcl_Panic("TclUnixWaitForFile cannot handle file id %d", fd); /* must never get here, or select masks overrun will occur below */ } #endif /* * If there is a non-zero finite timeout, compute the time when we give * up. */ if (timeout > 0) { Tcl_GetTime(&now); abortTime.sec = now.sec + timeout/1000; abortTime.usec = now.usec + (timeout%1000)*1000; if (abortTime.usec >= 1000000) { abortTime.usec -= 1000000; abortTime.sec += 1; } timeoutPtr = &blockTime; } else if (timeout == 0) { timeoutPtr = &blockTime; blockTime.tv_sec = 0; blockTime.tv_usec = 0; } else { timeoutPtr = NULL; } /* * Initialize the select masks. */ FD_ZERO(&readableMask); FD_ZERO(&writableMask); FD_ZERO(&exceptionalMask); /* * Loop in a mini-event loop of our own, waiting for either the file to * become ready or a timeout to occur. */ while (1) { if (timeout > 0) { blockTime.tv_sec = abortTime.sec - now.sec; blockTime.tv_usec = abortTime.usec - now.usec; if (blockTime.tv_usec < 0) { blockTime.tv_sec -= 1; blockTime.tv_usec += 1000000; } if (blockTime.tv_sec < 0) { blockTime.tv_sec = 0; blockTime.tv_usec = 0; } } /* * Setup the select masks for the fd. */ if (mask & TCL_READABLE) { FD_SET(fd, &readableMask); } if (mask & TCL_WRITABLE) { FD_SET(fd, &writableMask); } if (mask & TCL_EXCEPTION) { FD_SET(fd, &exceptionalMask); } /* * Wait for the event or a timeout. */ numFound = select(fd + 1, &readableMask, &writableMask, &exceptionalMask, timeoutPtr); if (numFound == 1) { if (FD_ISSET(fd, &readableMask)) { SET_BITS(result, TCL_READABLE); } if (FD_ISSET(fd, &writableMask)) { SET_BITS(result, TCL_WRITABLE); } if (FD_ISSET(fd, &exceptionalMask)) { SET_BITS(result, TCL_EXCEPTION); } result &= mask; if (result) { break; } } if (timeout == 0) { break; } if (timeout < 0) { continue; } /* * The select returned early, so we need to recompute the timeout. */ Tcl_GetTime(&now); if ((abortTime.sec < now.sec) || (abortTime.sec==now.sec && abortTime.usec<=now.usec)) { break; } } return result; } /* *---------------------------------------------------------------------- * * TclAsyncNotifier -- * * This procedure sets the async mark of an async handler to a * given value, if it is called from the notifier thread. * * Result: * True, when the handler will be marked, false otherwise. * * Side effetcs: * The trigger pipe is written when called from the notifier * thread. * *---------------------------------------------------------------------- */ int TclAsyncNotifier( int sigNumber, /* Signal number. */ TCL_UNUSED(Tcl_ThreadId), /* Target thread. */ TCL_UNUSED(void *), /* Notifier data. */ int *flagPtr, /* Flag to mark. */ int value) /* Value of mark. */ { #if TCL_THREADS /* * WARNING: * This code most likely runs in a signal handler. Thus, * only few async-signal-safe system calls are allowed, * e.g. pthread_self(), sem_post(), write(). */ if (pthread_equal(pthread_self(), (pthread_t) notifierThread)) { if (notifierThreadRunning) { *flagPtr = value; if (!asyncPending) { asyncPending = 1; write(triggerPipe, "S", 1); } return 1; } return 0; } /* * Re-send the signal to the notifier thread. */ pthread_kill((pthread_t) notifierThread, sigNumber); #endif return 0; } /* *---------------------------------------------------------------------- * * NotifierThreadProc -- * * This routine is the initial (and only) function executed by the * special notifier thread. Its job is to wait for file descriptors to * become readable or writable or to have an exception condition and then * to notify other threads who are interested in this information by * signalling a condition variable. Other threads can signal this * notifier thread of a change in their interests by writing a single * byte to a special pipe that the notifier thread is monitoring. * * Result: * None. Once started, this routine never exits. It dies with the overall * process or terminates its own thread (on notifier termination). * * Side effects: * The trigger pipe used to signal the notifier thread is created when * the notifier thread first starts. * *---------------------------------------------------------------------- */ static TCL_NORETURN void NotifierThreadProc( TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr; fd_set readableMask, writableMask, exceptionalMask; int i, ret, numFdBits = 0, polling; struct timeval poll = {0., 0.}, *timePtr; char buf[2]; /* * Look for file events and report them to interested threads. */ while (1) { FD_ZERO(&readableMask); FD_ZERO(&writableMask); FD_ZERO(&exceptionalMask); /* * Compute the logical OR of the select masks from all the waiting * notifiers. */ timePtr = NULL; LOCK_NOTIFIER; for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { LOCK_NOTIFIER_TSD; for (i = tsdPtr->numFdBits-1; i >= 0; --i) { if (FD_ISSET(i, &tsdPtr->checkMasks.readable)) { FD_SET(i, &readableMask); } if (FD_ISSET(i, &tsdPtr->checkMasks.writable)) { FD_SET(i, &writableMask); } if (FD_ISSET(i, &tsdPtr->checkMasks.exceptional)) { FD_SET(i, &exceptionalMask); } } if (tsdPtr->numFdBits > numFdBits) { numFdBits = tsdPtr->numFdBits; } polling = tsdPtr->polling; UNLOCK_NOTIFIER_TSD; if ((tsdPtr->polled = polling)) { timePtr = &poll; } } UNLOCK_NOTIFIER; /* * Set up the select mask to include the receive pipe. */ if (receivePipe >= numFdBits) { numFdBits = receivePipe + 1; } FD_SET(receivePipe, &readableMask); /* * Signals are unblocked only during select(). */ pthread_sigmask(SIG_SETMASK, ¬ifierSigMask, NULL); ret = select(numFdBits, &readableMask, &writableMask, &exceptionalMask, timePtr); pthread_sigmask(SIG_BLOCK, &allSigMask, NULL); if (ret == -1) { /* * In case a signal was caught during select(), * perform work on async handlers now. */ if (errno == EINTR && asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } /* * Try again immediately on an error. */ continue; } /* * Alert any threads that are waiting on a ready file descriptor. */ LOCK_NOTIFIER; for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) { int found = 0; SelectMasks readyMasks, checkMasks; LOCK_NOTIFIER_TSD; FD_COPY(&tsdPtr->checkMasks.readable, &checkMasks.readable); FD_COPY(&tsdPtr->checkMasks.writable, &checkMasks.writable); FD_COPY(&tsdPtr->checkMasks.exceptional, &checkMasks.exceptional); UNLOCK_NOTIFIER_TSD; found = tsdPtr->polled; FD_ZERO(&readyMasks.readable); FD_ZERO(&readyMasks.writable); FD_ZERO(&readyMasks.exceptional); for (i = tsdPtr->numFdBits-1; i >= 0; --i) { if (FD_ISSET(i, &checkMasks.readable) && FD_ISSET(i, &readableMask)) { FD_SET(i, &readyMasks.readable); found = 1; } if (FD_ISSET(i, &checkMasks.writable) && FD_ISSET(i, &writableMask)) { FD_SET(i, &readyMasks.writable); found = 1; } if (FD_ISSET(i, &checkMasks.exceptional) && FD_ISSET(i, &exceptionalMask)) { FD_SET(i, &readyMasks.exceptional); found = 1; } } if (found) { /* * Remove the ThreadSpecificData structure of this thread from * the waiting list. This prevents us from spinning * continuously on select until the other threads runs and * services the file event. */ OnOffWaitingList(tsdPtr, 0, 0); LOCK_NOTIFIER_TSD; FD_COPY(&readyMasks.readable, &tsdPtr->readyMasks.readable); FD_COPY(&readyMasks.writable, &tsdPtr->readyMasks.writable); FD_COPY(&readyMasks.exceptional, &tsdPtr->readyMasks.exceptional); UNLOCK_NOTIFIER_TSD; tsdPtr->polled = 0; if (tsdPtr->runLoop) { CFRunLoopSourceSignal(tsdPtr->runLoopSource); CFRunLoopWakeUp(tsdPtr->runLoop); } } } UNLOCK_NOTIFIER; /* * Consume the next byte from the notifier pipe if the pipe was * readable. Note that there may be multiple bytes pending, but to * avoid a race condition we only read one at a time. */ if (FD_ISSET(receivePipe, &readableMask)) { i = read(receivePipe, buf, 1); if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) { /* * Someone closed the write end of the pipe or sent us a Quit * message [Bug: 4139] and then closed the write end of the * pipe so we need to shut down the notifier thread. */ break; } if (asyncPending) { asyncPending = 0; TclAsyncMarkFromNotifier(); } } } pthread_exit(0); } #ifdef HAVE_PTHREAD_ATFORK /* *---------------------------------------------------------------------- * * AtForkPrepare -- * * Lock the notifier in preparation for a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkPrepare(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); LOCK_NOTIFIER_INIT; LOCK_NOTIFIER; LOCK_NOTIFIER_TSD; } /* *---------------------------------------------------------------------- * * AtForkParent -- * * Unlock the notifier in the parent after a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkParent(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); UNLOCK_NOTIFIER_TSD; UNLOCK_NOTIFIER; UNLOCK_NOTIFIER_INIT; } /* *---------------------------------------------------------------------- * * AtForkChild -- * * Unlock and reinstall the notifier in the child after a fork. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void AtForkChild(void) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); /* * If a child process unlocks an os_unfair_lock that was created in its * parent the child will exit with an illegal instruction error. So we * reinitialize the lock in the child rather than attempt to unlock it. */ #if defined(USE_OS_UNFAIR_LOCK) notifierInitLock = OS_UNFAIR_LOCK_INIT; notifierLock = OS_UNFAIR_LOCK_INIT; tsdPtr->tsdLock = OS_UNFAIR_LOCK_INIT; #else UNLOCK_NOTIFIER_TSD; UNLOCK_NOTIFIER; UNLOCK_NOTIFIER_INIT; #endif asyncPending = 0; if (tsdPtr->runLoop) { tsdPtr->runLoop = NULL; tsdPtr->runLoopSource = NULL; tsdPtr->runLoopTimer = NULL; } if (notifierCount > 0) { notifierCount = 1; notifierThreadRunning = 0; /* * Restart the notifier thread for signal handling. */ StartNotifierThread(); } } #endif /* HAVE_PTHREAD_ATFORK */ #else /* HAVE_COREFOUNDATION */ void Tcl_MacOSXNotifierAddRunLoopMode( const void *runLoopMode) { Tcl_Panic("Tcl_MacOSXNotifierAddRunLoopMode: " "Tcl not built with CoreFoundation support"); } #endif /* HAVE_COREFOUNDATION */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/macosx/tclMacOSXFCmd.c0000644000175000017500000004542315104661341015544 0ustar sergeisergei/* * tclMacOSXFCmd.c * * This file implements the MacOSX specific portion of file manipulation * subcommands of the "file" command. * * Copyright © 2003-2007 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #ifdef HAVE_GETATTRLIST #include #include #include #endif /* Darwin 8 copyfile API. */ #ifdef HAVE_COPYFILE #ifdef HAVE_COPYFILE_H #include #else /* HAVE_COPYFILE_H */ int copyfile(const char *from, const char *to, void *state, uint32_t flags); #define COPYFILE_ACL (1<<0) #define COPYFILE_XATTR (1<<2) #define COPYFILE_NOFOLLOW_SRC (1<<18) #endif /* HAVE_COPYFILE_H */ #endif /* HAVE_COPYFILE */ #ifdef WEAK_IMPORT_COPYFILE #define MayUseCopyFile() (copyfile != NULL) #elif defined(HAVE_COPYFILE) #define MayUseCopyFile() (1) #else #define MayUseCopyFile() (0) #endif #include /* * Constants for file attributes subcommand. Need to be kept in sync with * tclUnixFCmd.c ! */ enum { UNIX_GROUP_ATTRIBUTE, UNIX_OWNER_ATTRIBUTE, UNIX_PERMISSIONS_ATTRIBUTE, #ifdef HAVE_CHFLAGS UNIX_READONLY_ATTRIBUTE, #endif #ifdef MAC_OSX_TCL MACOSX_CREATOR_ATTRIBUTE, MACOSX_TYPE_ATTRIBUTE, MACOSX_HIDDEN_ATTRIBUTE, MACOSX_RSRCLENGTH_ATTRIBUTE, #endif }; typedef u_int32_t OSType; static int GetOSTypeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, OSType *osTypePtr); static Tcl_Obj * NewOSTypeObj(const OSType newOSType); static int SetOSTypeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static void UpdateStringOfOSType(Tcl_Obj *objPtr); static const Tcl_ObjType tclOSTypeType = { "osType", /* name */ NULL, /* freeIntRepProc */ NULL, /* dupIntRepProc */ UpdateStringOfOSType, /* updateStringProc */ SetOSTypeFromAny, /* setFromAnyProc */ TCL_OBJTYPE_V0 }; enum { kIsInvisible = 0x4000, }; #define kFinfoIsInvisible (OSSwapHostToBigConstInt16(kIsInvisible)) typedef struct finderinfo { u_int32_t type; u_int32_t creator; u_int16_t fdFlags; u_int32_t location; u_int16_t reserved; u_int32_t extendedFileInfo[4]; } __attribute__ ((__packed__)) finderinfo; typedef struct { u_int64_t reserved1; /* Make sure data is 8-byte aligned */ u_int32_t reserved2; /* See [992f94d847] */ u_int32_t info_length; u_int32_t data[8]; } fileinfobuf; /* *---------------------------------------------------------------------- * * TclMacOSXGetFileAttribute * * Gets a MacOSX attribute of a file. Which attribute is controlled by * objIndex. The object will have ref count 0. * * Results: * Standard TCL result. Returns a new Tcl_Obj in attributePtrPtr if there * is no error. * * Side effects: * A new object is allocated. * *---------------------------------------------------------------------- */ int TclMacOSXGetFileAttribute( Tcl_Interp *interp, /* The interp we are using for errors. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { #ifdef HAVE_GETATTRLIST int result; Tcl_StatBuf statBuf; struct attrlist alist; fileinfobuf finfo; finderinfo *finder = (finderinfo *) &finfo.data; off_t *rsrcForkSize = (off_t *) &finfo.data; const char *native; result = TclpObjStat(fileName, &statBuf); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } if (S_ISDIR(statBuf.st_mode) && objIndex != MACOSX_HIDDEN_ATTRIBUTE) { /* * Directories only support attribute "-hidden". */ errno = EISDIR; Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid attribute: %s", Tcl_PosixError(interp))); return TCL_ERROR; } bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) { alist.fileattr = ATTR_FILE_RSRCLENGTH; } else { alist.commonattr = ATTR_CMN_FNDRINFO; } native = (const char *)Tcl_FSGetNativePath(fileName); result = getattrlist(native, &alist, &finfo.info_length, sizeof(fileinfobuf) - offsetof(fileinfobuf, info_length), 0); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read attributes of \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } switch (objIndex) { case MACOSX_CREATOR_ATTRIBUTE: *attributePtrPtr = NewOSTypeObj( OSSwapBigToHostInt32(finder->creator)); break; case MACOSX_TYPE_ATTRIBUTE: *attributePtrPtr = NewOSTypeObj( OSSwapBigToHostInt32(finder->type)); break; case MACOSX_HIDDEN_ATTRIBUTE: TclNewIntObj(*attributePtrPtr, (finder->fdFlags & kFinfoIsInvisible) != 0); break; case MACOSX_RSRCLENGTH_ATTRIBUTE: TclNewIntObj(*attributePtrPtr, *rsrcForkSize); break; } return TCL_OK; #else Tcl_SetObjResult(interp, Tcl_NewStringObj( "Mac OS X file attributes not supported", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (char *)NULL); return TCL_ERROR; #endif /* HAVE_GETATTRLIST */ } /* *--------------------------------------------------------------------------- * * TclMacOSXSetFileAttribute -- * * Sets a MacOSX attribute of a file. Which attribute is controlled by * objIndex. * * Results: * Standard TCL result. * * Side effects: * As above. * *--------------------------------------------------------------------------- */ int TclMacOSXSetFileAttribute( Tcl_Interp *interp, /* The interp for error reporting. */ int objIndex, /* The index of the attribute. */ Tcl_Obj *fileName, /* The name of the file (UTF-8). */ Tcl_Obj *attributePtr) /* New owner for file. */ { #ifdef HAVE_GETATTRLIST int result; Tcl_StatBuf statBuf; struct attrlist alist; fileinfobuf finfo; finderinfo *finder = (finderinfo *) &finfo.data; off_t *rsrcForkSize = (off_t *) &finfo.data; const char *native; result = TclpObjStat(fileName, &statBuf); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } if (S_ISDIR(statBuf.st_mode) && objIndex != MACOSX_HIDDEN_ATTRIBUTE) { /* * Directories only support attribute "-hidden". */ errno = EISDIR; Tcl_SetObjResult(interp, Tcl_ObjPrintf( "invalid attribute: %s", Tcl_PosixError(interp))); return TCL_ERROR; } bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) { alist.fileattr = ATTR_FILE_RSRCLENGTH; } else { alist.commonattr = ATTR_CMN_FNDRINFO; } native = (const char *)Tcl_FSGetNativePath(fileName); result = getattrlist(native, &alist, &finfo.info_length, sizeof(fileinfobuf) - offsetof(fileinfobuf, info_length), 0); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not read attributes of \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } if (objIndex != MACOSX_RSRCLENGTH_ATTRIBUTE) { OSType t; int h; switch (objIndex) { case MACOSX_CREATOR_ATTRIBUTE: if (GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) { return TCL_ERROR; } finder->creator = OSSwapHostToBigInt32(t); break; case MACOSX_TYPE_ATTRIBUTE: if (GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) { return TCL_ERROR; } finder->type = OSSwapHostToBigInt32(t); break; case MACOSX_HIDDEN_ATTRIBUTE: if (Tcl_GetBooleanFromObj(interp, attributePtr, &h) != TCL_OK) { return TCL_ERROR; } if (h) { finder->fdFlags |= kFinfoIsInvisible; } else { finder->fdFlags &= ~kFinfoIsInvisible; } break; } result = setattrlist(native, &alist, &finfo.data, sizeof(finfo.data), 0); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not set attributes of \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } } else { Tcl_WideInt newRsrcForkSize; if (TclGetWideIntFromObj(interp, attributePtr, &newRsrcForkSize) != TCL_OK) { return TCL_ERROR; } if (newRsrcForkSize != *rsrcForkSize) { Tcl_DString ds; /* * Only setting rsrclength to 0 to strip a file's resource fork is * supported. */ if (newRsrcForkSize != 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "setting nonzero rsrclength not supported", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (char *)NULL); return TCL_ERROR; } /* * Construct path to resource fork. */ Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, native, TCL_INDEX_NONE); Tcl_DStringAppend(&ds, _PATH_RSRCFORKSPEC, TCL_INDEX_NONE); result = truncate(Tcl_DStringValue(&ds), 0); if (result != 0) { /* * truncate() on a valid resource fork path may fail with a * permission error in some OS releases, try truncating with * open() instead: */ int fd = open(Tcl_DStringValue(&ds), O_WRONLY | O_TRUNC); if (fd > 0) { result = close(fd); } } Tcl_DStringFree(&ds); if (result != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "could not truncate resource fork of \"%s\": %s", TclGetString(fileName), Tcl_PosixError(interp))); return TCL_ERROR; } } } return TCL_OK; #else Tcl_SetObjResult(interp, Tcl_NewStringObj( "Mac OS X file attributes not supported", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "UNSUPPORTED", (char *)NULL); return TCL_ERROR; #endif } /* *--------------------------------------------------------------------------- * * TclMacOSXCopyFileAttributes -- * * Copy the MacOSX attributes and resource fork (if present) from one * file to another. * * Results: * Standard Tcl result. * * Side effects: * MacOSX attributes and resource fork are updated in the new file to * reflect the old file. * *--------------------------------------------------------------------------- */ int TclMacOSXCopyFileAttributes( const char *src, /* Path name of source file (native). */ const char *dst, /* Path name of target file (native). */ const Tcl_StatBuf *statBufPtr) /* Stat info for source file */ { if (MayUseCopyFile()) { #ifdef HAVE_COPYFILE if (0 == copyfile(src, dst, NULL, (S_ISLNK(statBufPtr->st_mode) ? COPYFILE_XATTR | COPYFILE_NOFOLLOW_SRC : COPYFILE_XATTR | COPYFILE_ACL))) { return TCL_OK; } #endif /* HAVE_COPYFILE */ } else { #if (!defined(HAVE_COPYFILE) || defined(WEAK_IMPORT_COPYFILE)) && defined(HAVE_GETATTRLIST) struct attrlist alist; fileinfobuf finfo; off_t *rsrcForkSize = (off_t *) &finfo.data; Tcl_DString srcBuf, dstBuf; int result; bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; alist.commonattr = ATTR_CMN_FNDRINFO; if (getattrlist(src, &alist, &finfo.info_length, sizeof(fileinfobuf) - offsetof(fileinfobuf, info_length), 0)) { return TCL_ERROR; } if (setattrlist(dst, &alist, &finfo.data, sizeof(finfo.data), 0)) { return TCL_ERROR; } /* * If we're a directory, we're done as they never have resource forks. */ if (S_ISDIR(statBufPtr->st_mode)) { return TCL_OK; } /* * We only copy a non-empty resource fork, so determine if that's the * case first. */ alist.commonattr = 0; alist.fileattr = ATTR_FILE_RSRCLENGTH; if (getattrlist(src, &alist, &finfo.info_length, sizeof(fileinfobuf) - offsetof(fileinfobuf, info_length), 0)) { return TCL_ERROR; } else if (*rsrcForkSize == 0) { return TCL_OK; } /* * Construct paths to resource forks. */ Tcl_DStringInit(&srcBuf); Tcl_DStringAppend(&srcBuf, src, TCL_INDEX_NONE); Tcl_DStringAppend(&srcBuf, _PATH_RSRCFORKSPEC, TCL_INDEX_NONE); Tcl_DStringInit(&dstBuf); Tcl_DStringAppend(&dstBuf, dst, TCL_INDEX_NONE); Tcl_DStringAppend(&dstBuf, _PATH_RSRCFORKSPEC, TCL_INDEX_NONE); /* * Do the copy. */ result = TclUnixCopyFile(Tcl_DStringValue(&srcBuf), Tcl_DStringValue(&dstBuf), statBufPtr, 1); Tcl_DStringFree(&srcBuf); Tcl_DStringFree(&dstBuf); if (result == 0) { return TCL_OK; } #endif /* (!HAVE_COPYFILE || WEAK_IMPORT_COPYFILE) && HAVE_GETATTRLIST */ } return TCL_ERROR; } /* *---------------------------------------------------------------------- * * TclMacOSXMatchType -- * * This routine is used by the globbing code to check if a file matches a * given mac type and/or creator code. * * Results: * The return value is 1, 0 or -1 indicating whether the file matches the * given criteria, does not match them, or an error occurred (in which * case an error is left in interp). * * Side effects: * None. * *---------------------------------------------------------------------- */ int TclMacOSXMatchType( Tcl_Interp *interp, /* Interpreter to receive errors. */ const char *pathName, /* Native path to check. */ const char *fileName, /* Native filename to check. */ Tcl_StatBuf *statBufPtr, /* Stat info for file to check */ Tcl_GlobTypeData *types) /* Type description to match against. */ { #ifdef HAVE_GETATTRLIST struct attrlist alist; fileinfobuf finfo; finderinfo *finder = (finderinfo *) &finfo.data; OSType osType; bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; alist.commonattr = ATTR_CMN_FNDRINFO; if (getattrlist(pathName, &alist, &finfo.info_length, sizeof(fileinfobuf) - offsetof(fileinfobuf, info_length), 0)) { return 0; } if ((types->perm & TCL_GLOB_PERM_HIDDEN) && !((finder->fdFlags & kFinfoIsInvisible) || (*fileName == '.'))) { return 0; } if (S_ISDIR(statBufPtr->st_mode) && (types->macType || types->macCreator)) { /* * Directories don't support types or creators. */ return 0; } if (types->macType) { if (GetOSTypeFromObj(interp, types->macType, &osType) != TCL_OK) { return -1; } if (osType != OSSwapBigToHostInt32(finder->type)) { return 0; } } if (types->macCreator) { if (GetOSTypeFromObj(interp, types->macCreator, &osType) != TCL_OK) { return -1; } if (osType != OSSwapBigToHostInt32(finder->creator)) { return 0; } } #endif return 1; } /* *---------------------------------------------------------------------- * * GetOSTypeFromObj -- * * Attempt to return an OSType from the Tcl object "objPtr". * * Results: * Standard TCL result. If an error occurs during conversion, an error * message is left in interp->objResult. * * Side effects: * The string representation of objPtr will be updated if necessary. * *---------------------------------------------------------------------- */ static int GetOSTypeFromObj( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr, /* The object from which to get an OSType. */ OSType *osTypePtr) /* Place to store resulting OSType. */ { int result = TCL_OK; if (!TclHasInternalRep(objPtr, &tclOSTypeType)) { result = SetOSTypeFromAny(interp, objPtr); } *osTypePtr = (OSType) objPtr->internalRep.wideValue; return result; } /* *---------------------------------------------------------------------- * * NewOSTypeObj -- * * Create a new OSType object. * * Results: * The newly created OSType object is returned, it has ref count 0. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Tcl_Obj * NewOSTypeObj( const OSType osType) /* OSType used to initialize the new * object. */ { Tcl_Obj *objPtr; TclNewObj(objPtr); TclInvalidateStringRep(objPtr); objPtr->internalRep.wideValue = (Tcl_WideInt) osType; objPtr->typePtr = &tclOSTypeType; return objPtr; } /* *---------------------------------------------------------------------- * * SetOSTypeFromAny -- * * Attempts to force the internal representation for a Tcl object to * tclOSTypeType, specifically. * * Results: * The return value is a standard object Tcl result. If an error occurs * during conversion, an error message is left in the interpreter's * result unless "interp" is NULL. * *---------------------------------------------------------------------- */ static int SetOSTypeFromAny( Tcl_Interp *interp, /* Tcl interpreter */ Tcl_Obj *objPtr) /* Pointer to the object to convert */ { const char *string; int result = TCL_OK; Tcl_DString ds; Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman"); Tcl_Size length; string = TclGetStringFromObj(objPtr, &length); Tcl_UtfToExternalDStringEx(NULL, encoding, string, length, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); if (Tcl_DStringLength(&ds) > 4) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected Macintosh OS type but got \"%s\": ", string)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "MAC_OSTYPE", (char *)NULL); } result = TCL_ERROR; } else { OSType osType; char bytes[4] = {'\0','\0','\0','\0'}; memcpy(bytes, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); osType = (OSType) bytes[0] << 24 | (OSType) bytes[1] << 16 | (OSType) bytes[2] << 8 | (OSType) bytes[3]; TclFreeInternalRep(objPtr); objPtr->internalRep.wideValue = (Tcl_WideInt) osType; objPtr->typePtr = &tclOSTypeType; } Tcl_DStringFree(&ds); Tcl_FreeEncoding(encoding); return result; } /* *---------------------------------------------------------------------- * * UpdateStringOfOSType -- * * Update the string representation for an OSType object. Note: This * function does not free an existing old string rep so storage will be * lost if this has not already been done. * * Results: * None. * * Side effects: * The object's string is set to a valid string that results from the * OSType-to-string conversion. * *---------------------------------------------------------------------- */ static void UpdateStringOfOSType( Tcl_Obj *objPtr) /* OSType object whose string rep to * update. */ { const size_t size = TCL_UTF_MAX * 4; char *dst = Tcl_InitStringRep(objPtr, NULL, size); OSType osType = (OSType) objPtr->internalRep.wideValue; int written = 0; Tcl_Encoding encoding; char src[5]; TclOOM(dst, size+1); src[0] = (char) (osType >> 24); src[1] = (char) (osType >> 16); src[2] = (char) (osType >> 8); src[3] = (char) (osType); src[4] = '\0'; encoding = Tcl_GetEncoding(NULL, "macRoman"); Tcl_ExternalToUtf(NULL, encoding, src, TCL_INDEX_NONE, /* flags */ 0, /* statePtr */ NULL, dst, size, /* srcReadPtr */ NULL, /* dstWrotePtr */ &written, /* dstCharsPtr */ NULL); Tcl_FreeEncoding(encoding); (void)Tcl_InitStringRep(objPtr, NULL, written); } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/macosx/tclMacOSXBundle.c0000644000175000017500000001216115104661341016135 0ustar sergeisergei/* * tclMacOSXBundle.c -- * * This file implements functions that inspect CFBundle structures on * MacOS X. * * Copyright © 2001-2009 Apple Inc. * Copyright © 2003-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclPort.h" #include "tclInt.h" #ifdef HAVE_COREFOUNDATION #include #include #ifdef TCL_DEBUG_LOAD #define TclLoadDbgMsg(m, ...) \ do { \ fprintf(stderr, "%s:%d: %s(): " m ".\n", \ strrchr(__FILE__, '/')+1, __LINE__, __func__, \ ##__VA_ARGS__); \ } while (0) #else #define TclLoadDbgMsg(m, ...) #endif /* TCL_DEBUG_LOAD */ /* * Forward declaration of functions defined in this file: */ static short OpenResourceMap(CFBundleRef bundleRef); #endif /* HAVE_COREFOUNDATION */ /* *---------------------------------------------------------------------- * * OpenResourceMap -- * * Wrapper that dynamically acquires the address for the function * CFBundleOpenBundleResourceMap before calling it, since it is only * present in full CoreFoundation on Mac OS X and not in CFLite on pure * Darwin. Factored out because it is moderately ugly code. * *---------------------------------------------------------------------- */ #ifdef HAVE_COREFOUNDATION static short OpenResourceMap( CFBundleRef bundleRef) { static int initialized = FALSE; static short (*openresourcemap)(CFBundleRef) = NULL; if (!initialized) { { openresourcemap = (short (*)(CFBundleRef))dlsym(RTLD_NEXT, "CFBundleOpenBundleResourceMap"); #ifdef TCL_DEBUG_LOAD if (!openresourcemap) { const char *errMsg = dlerror(); TclLoadDbgMsg("dlsym() failed: %s", errMsg); } #endif /* TCL_DEBUG_LOAD */ } initialized = TRUE; } if (openresourcemap) { return openresourcemap(bundleRef); } return -1; } #endif /* HAVE_COREFOUNDATION */ /* *---------------------------------------------------------------------- * * Tcl_MacOSXOpenVersionedBundleResources -- * * Given the bundle and version name for a shared library (version name * can be NULL to indicate latest version), this routine sets libraryPath * to the Resources/Scripts directory in the framework package. If * hasResourceFile is true, it will also open the main resource file for * the bundle. * * Results: * TCL_OK if the bundle could be opened, and the Scripts folder found. * TCL_ERROR otherwise. * * Side effects: * libraryVariableName may be set, and the resource file opened. * *---------------------------------------------------------------------- */ int Tcl_MacOSXOpenVersionedBundleResources( TCL_UNUSED(Tcl_Interp *), const char *bundleName, const char *bundleVersion, int hasResourceFile, Tcl_Size maxPathLen, char *libraryPath) { #ifdef HAVE_COREFOUNDATION CFBundleRef bundleRef, versionedBundleRef = NULL; CFStringRef bundleNameRef; CFURLRef libURL; libraryPath[0] = '\0'; bundleNameRef = CFStringCreateWithCString(NULL, bundleName, kCFStringEncodingUTF8); bundleRef = CFBundleGetBundleWithIdentifier(bundleNameRef); CFRelease(bundleNameRef); if (bundleVersion && bundleRef) { /* * Create bundle from bundleVersion subdirectory of 'Versions'. */ CFURLRef bundleURL = CFBundleCopyBundleURL(bundleRef); if (bundleURL) { CFStringRef bundleVersionRef = CFStringCreateWithCString(NULL, bundleVersion, kCFStringEncodingUTF8); if (bundleVersionRef) { CFComparisonResult versionComparison = kCFCompareLessThan; CFStringRef bundleTailRef = CFURLCopyLastPathComponent( bundleURL); if (bundleTailRef) { versionComparison = CFStringCompare(bundleTailRef, bundleVersionRef, 0); CFRelease(bundleTailRef); } if (versionComparison != kCFCompareEqualTo) { CFURLRef versURL = CFURLCreateCopyAppendingPathComponent( NULL, bundleURL, CFSTR("Versions"), TRUE); if (versURL) { CFURLRef versionedBundleURL = CFURLCreateCopyAppendingPathComponent( NULL, versURL, bundleVersionRef, TRUE); if (versionedBundleURL) { versionedBundleRef = CFBundleCreate(NULL, versionedBundleURL); if (versionedBundleRef) { bundleRef = versionedBundleRef; } CFRelease(versionedBundleURL); } CFRelease(versURL); } } CFRelease(bundleVersionRef); } CFRelease(bundleURL); } } if (bundleRef) { if (hasResourceFile) { (void) OpenResourceMap(bundleRef); } libURL = CFBundleCopyResourceURL(bundleRef, CFSTR("Scripts"), NULL, NULL); if (libURL) { /* * FIXME: This is a quick fix, it is probably not right for * internationalization. */ CFURLGetFileSystemRepresentation(libURL, TRUE, (unsigned char *) libraryPath, maxPathLen); CFRelease(libURL); } if (versionedBundleRef) { { CFRelease(versionedBundleRef); } } } if (libraryPath[0]) { return TCL_OK; } #endif /* HAVE_COREFOUNDATION */ return TCL_ERROR; } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ tcl9.0.3/macosx/Tcl-Info.plist.in0000644000175000017500000000236315035744305016147 0ustar sergeisergei CFBundleDevelopmentRegion English CFBundleExecutable @TCL_LIB_FILE@ CFBundleGetInfoString Tcl @TCL_VERSION@@TCL_PATCH_LEVEL@, Copyright © 1987-@TCL_YEAR@ Tcl Core Team, Copyright © 2001-@TCL_YEAR@ Daniel A. Steffen, Copyright © 2001-2009 Apple Inc., Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIdentifier com.tcltk.tcllibrary CFBundleInfoDictionaryVersion 6.0 CFBundleName Tcl @TCL_VERSION@ CFBundlePackageType FMWK CFBundleShortVersionString @TCL_VERSION@@TCL_PATCH_LEVEL@ CFBundleSignature Tcl CFBundleVersion @TCL_VERSION@@TCL_PATCH_LEVEL@ tcl9.0.3/macosx/README0000644000175000017500000001367615104661341013736 0ustar sergeisergeiTcl macOS README ------------------- This is the README file for the macOS/Darwin version of Tcl. 1. Where to go for support -------------------------- - The tcl-mac mailing list on sourceforge is the best place to ask questions specific to Tcl & Tk on Mac OS X: http://lists.sourceforge.net/lists/listinfo/tcl-mac (this page also has a link to searchable archives of the list, please check them before asking on the list, many questions have already been answered). - For general Tcl/Tk questions, the newsgroup comp.lang.tcl is your best bet: 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/_/ref?N=3753 http://wiki.tcl.tk/_/ref?N=8361 - Please report bugs with Tcl on Mac OS X to the tracker: https://core.tcl-lang.org/tcl/reportlist 2. Using Tcl on Mac OS X ------------------------ - At a minimum, Mac OS X 10.3 is required to run Tcl. - Unless weak-linking is used, Tcl built on Mac OS X 10.x will not run on 10.y with y < x; on the other hand Tcl built on 10.y will always run on 10.x with y <= x (but without any of the fixes and optimizations that would be available in a binary built on 10.x). Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). - Tcl extensions can be installed in any of: $HOME/Library/Tcl /Library/Tcl $HOME/Library/Frameworks /Library/Frameworks (searched in that order). Given a potential package directory $pkg, Tcl on OSX checks for the file $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. This allows building extensions as frameworks with all script files contained in the Resources/Scripts directory of the framework. - [load]able binary extensions can linked as either ordinary shared libraries (.dylib) or as MachO bundles (since 8.4.10/8.5a3); bundles have the advantage that they are [load]ed more efficiently from a tcl VFS (no temporary copy to the native filesystem required), and prior to Mac OS X 10.5, only bundles can be [unload]ed. - The 'deploy' target of macosx/GNUmakefile installs the html manpages into the standard documentation location in the Tcl framework: Tcl.framework/Resources/Documentation/Reference/Tcl No nroff manpages are installed by default by the GNUmakefile. - The Tcl framework can be installed in any of the system's standard framework directories: $HOME/Library/Frameworks /Library/Frameworks 3. Building Tcl on Mac OS X --------------------------- - Tcl supports macOS 10.13 and newer. While Tcl may build on earlier versions of the OS, it is not tested on versions older than 10.13. You will need to install an Apple clang toolchain either by downloading the Xcode app from Apple's App Store, or by installing the Command Line Tools. The Command Line Tools can be installed by running the command: xcode-select --install in the Terminal. - Tcl is most easily built as a macOS framework via the GNUmakefile in tcl/macosx (see below for details), but can also be built with the standard unix configure and make buildsystem in tcl/unix as on any other unix platform (indeed, the GNUmakefile is just a wrapper around the unix buildsystem). The Mac OS X specific configure flags are --enable-framework and --disable-corefoundation (which disables CF and notably reverts to the standard select based notifier). - To build universal binaries for macOS 10.13 and newer set CFLAGS as follows: export CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.13" (This will cause clang to set macOS 11 as the target OS for the arm64 architecture since Apple Silicon was not supported until macOS 11.) Universal builds of Tcl TEA extensions are also possible with CFLAGS set as above, they will be [load]able by universal as well as thin binaries of Tcl. Detailed Instructions for building with macosx/GNUmakefile ---------------------------------------------------------- - Unpack the Tcl source release archive. - The following instructions assume the Tcl source tree is named "tcl${ver}", (where ${ver} is a shell variable containing the Tcl version number e.g. '9.0'). Setup this shell variable as follows: ver="9.0" - Setup environment variables as desired, for example: CFLAGS="-arch x86_64 -arch arm64 -mmacosx-version-min=10.13" export CFLAGS - Change to the directory containing the Tcl source tree and build: make -C tcl${ver}/macosx - Install Tcl onto the root volume (admin password required): sudo make -C tcl${ver}/macosx install if you don't have an admin password, you can install into your home directory instead by passing an INSTALL_ROOT argument to make: make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/" - The default GNUmakefile targets will build _both_ debug and optimized versions of the Tcl framework with the standard convention of naming the debug library Tcl.framework/Tcl_debug. This allows switching to the debug libraries at runtime by setting export DYLD_IMAGE_SUFFIX=_debug (c.f. man dyld for more details) If you only want to build and install the debug or optimized build, use the 'develop' or 'deploy' target variants of the GNUmakefile, respectively. For example, to build and install only the optimized versions: make -C tcl${ver}/macosx deploy sudo make -C tcl${ver}/macosx install-deploy - To build a Tcl.framework for use as a subframework in another framework, use the install-embedded target and set SUBFRAMEWORK=1. Set the DYLIB_INSTALL_DIR variable to the path which should be the install_name path of the Tcl library, set the DESTDIR variable to the pathname of a staging directory where the framework will be written . For example, running this command in the Tcl source directory: make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcl \ DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework will produce a Tcl.framework intended for installing as a subframework of Some.framework. The framework will be found in /tmp/tcl/Frameworks/ tcl9.0.3/macosx/license.terms0000644000175000017500000000431715076154263015554 0ustar sergeisergeiThis software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. tcl9.0.3/macosx/GNUmakefile0000644000175000017500000001564515104661341015126 0ustar sergeisergei######################################################################################################## # # Makefile wrapper to build tcl on Mac OS X in a way compatible with the tk/macosx Xcode buildsystem # uses the standard Unix build system in tcl/unix (which can be used directly instead of this # if you are not using the tk/macosx projects). # # Copyright (c) 2002-2008 Daniel A. Steffen # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. ######################################################################################################## #------------------------------------------------------------------------------------------------------- # customizable settings DESTDIR ?= INSTALL_ROOT ?= ${DESTDIR} BUILD_DIR ?= ${CURDIR}/../../build SYMROOT ?= ${BUILD_DIR}/${PROJECT} OBJROOT ?= ${SYMROOT} EXTRA_CONFIGURE_ARGS ?= EXTRA_MAKE_ARGS ?= INSTALL_PATH ?= /Library/Frameworks PREFIX ?= /usr/local BINDIR ?= ${PREFIX}/bin LIBDIR ?= ${INSTALL_PATH} MANDIR ?= ${PREFIX}/man # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= # Checks and overrides for subframework builds ifeq (${SUBFRAMEWORK},1) ifeq (${DYLIB_INSTALL_DIR},) @echo "Cannot install subframework with empty DYLIB_INSTALL_DIR !" && false endif ifeq (${DESTDIR},) @echo "Cannot install subframework with empty DESTDIR !" && false endif override BUILD_DIR = ${DESTDIR}/build override INSTALL_PATH = /Frameworks endif #------------------------------------------------------------------------------------------------------- # meta targets meta := all install embedded install-embedded clean distclean test styles := develop deploy all := ${styles} all : ${all} install := ${styles:%=install-%} install : ${install} install-%: action := install- embedded := ${styles:%=embedded-%} embedded : embedded-deploy install-embedded := ${embedded:%=install-%} install-embedded : install-embedded-deploy clean := ${styles:%=clean-%} clean : ${clean} clean-%: action := clean- distclean := ${styles:%=distclean-%} distclean : ${distclean} distclean-%: action := distclean- test := ${styles:%=test-%} test : ${test} test-%: action := test- targets := $(foreach v,${meta},${$v}) #------------------------------------------------------------------------------------------------------- # build styles BUILD_STYLE = CONFIGURE_ARGS = OBJ_DIR = ${OBJROOT}/${BUILD_STYLE} empty := space := ${empty} ${empty} objdir = $(subst ${space},\ ,${OBJ_DIR}) develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip \ EXTRA_CFLAGS=-DNDEBUG embedded_make_args := EMBEDDED_BUILD=1 install_make_args := INSTALL_BUILD=1 ${targets}: ${MAKE} ${action}${PROJECT} \ $(foreach s,${styles} embedded install,$(if $(findstring $s,$@),${${s}_make_args})) #------------------------------------------------------------------------------------------------------- # project specific settings PROJECT := tcl PRODUCT_NAME := Tcl UNIX_DIR := ${CURDIR}/../unix VERSION := $(shell awk -F= '/^TCL_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.ac) TCLSH := tclsh${VERSION} BUILD_TARGET := all tcltest INSTALL_TARGET := install export CPPROG := cp -p INSTALL_TARGETS = install-binaries install-headers install-libraries ifeq (${EMBEDDED_BUILD},) INSTALL_TARGETS += install-private-headers endif ifeq (${INSTALL_BUILD}_${EMBEDDED_BUILD}_${BUILD_STYLE},1__Deployment) INSTALL_TARGETS += install-packages html-tcl ifneq (${INSTALL_MANPAGES},) INSTALL_TARGETS += install-doc endif endif MAKE_VARS := INSTALL_ROOT INSTALL_TARGETS VERSION GENERIC_FLAGS MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v='${$v}') build-${PROJECT}: target = ${BUILD_TARGET} install-${PROJECT}: target = ${INSTALL_TARGET} clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \ target = $* DO_MAKE = +${MAKE} -C "${OBJ_DIR}" ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS} #------------------------------------------------------------------------------------------------------- # build rules ${PROJECT}: ${MAKE} install-${PROJECT} INSTALL_ROOT="${OBJ_DIR}/" ${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ ${UNIX_DIR}/tclConfig.sh.in Tcl-Info.plist.in mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \ if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \ --prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \ --mandir="${MANDIR}" --enable-framework --enable-dtrace --disable-zipfs \ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi build-${PROJECT}: ${objdir}/Makefile ${DO_MAKE} ifeq (${INSTALL_BUILD},) # symbolic link hackery to trick # 'make install INSTALL_ROOT=${OBJ_DIR}' # into building Tcl.framework and tclsh in ${SYMROOT} @cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,.${LIBDIR})) $(dir $(subst ${space},\ ,.${BINDIR})) "${SYMROOT}" && \ rm -f ".${LIBDIR}" ".${BINDIR}" && ln -fs "${SYMROOT}" ".${LIBDIR}" && \ ln -fs "${SYMROOT}" ".${BINDIR}" && ln -fs "${OBJ_DIR}/tcltest" "${SYMROOT}" endif install-${PROJECT}: build-${PROJECT} ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_) @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false endif ifeq (${EMBEDDED_BUILD},1) @rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework" endif ${DO_MAKE} ifeq (${INSTALL_BUILD},1) ifeq (${EMBEDDED_BUILD},1) # if we are embedding frameworks, don't install tclsh @rm -f "${INSTALL_ROOT}${BINDIR}/${TCLSH}" && \ rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true else # install tclsh symbolic link @ln -fs ${TCLSH} "${INSTALL_ROOT}${BINDIR}/tclsh" endif endif ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_) # keep copy of debug library around, so that # Deployment build can be installed on top # of Development build without overwriting # the debug library @if [ -d "${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}" ]; then \ cd "${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}"; \ ln -f "${PRODUCT_NAME}" "${PRODUCT_NAME}_debug"; \ fi endif clean-${PROJECT}: %-${PROJECT}: ${DO_MAKE} rm -rf "${SYMROOT}"/{${PRODUCT_NAME}.framework,${TCLSH},tcltest} rm -f "${OBJ_DIR}"{"${LIBDIR}","${BINDIR}"} && \ rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${LIBDIR})) 2>&- || true && \ rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${BINDIR})) 2>&- || true distclean-${PROJECT}: %-${PROJECT}: clean-${PROJECT} ${DO_MAKE} rm -rf "${OBJ_DIR}" test-${PROJECT}: %-${PROJECT}: build-${PROJECT} ${DO_MAKE} #------------------------------------------------------------------------------------------------------- .PHONY: ${meta} ${targets} ${PROJECT} build-${PROJECT} install-${PROJECT} \ clean-${PROJECT} distclean-${PROJECT} .NOTPARALLEL: #------------------------------------------------------------------------------------------------------- tcl9.0.3/macosx/configure.ac0000644000175000017500000000065615104661341015336 0ustar sergeisergei#! /bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. dnl Ensure that the config (auto)headers support is used, then just dnl include the configure sources from ../unix: m4_include(../unix/aclocal.m4) m4_define(SC_USE_CONFIG_HEADERS) m4_include(../unix/configure.ac) tcl9.0.3/macosx/configure0000755000175000017500000122324015104662054014756 0ustar sergeisergei#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for tcl 9.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' PACKAGE_VERSION='9.0' PACKAGE_STRING='tcl 9.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='DLTEST_SUFFIX DLTEST_LD EXTRA_TCLSH_LIBS EXTRA_BUILD_HTML EXTRA_INSTALL_BINARIES EXTRA_INSTALL EXTRA_APP_CC_SWITCHES EXTRA_CC_SWITCHES PACKAGE_DIR HTML_DIR PRIVATE_INCLUDE_DIR TCL_LIBRARY TCL_MODULE_PATH TCL_PACKAGE_PATH BUILD_DLTEST MAKEFILE_SHELL DTRACE_OBJ DTRACE_HDR DTRACE_SRC INSTALL_TZDATA TCL_HAS_LONGLONG TCL_UNSHARED_LIB_SUFFIX TCL_SHARED_LIB_SUFFIX TCL_LIB_VERSIONS_OK TCL_BUILD_LIB_SPEC LD_LIBRARY_PATH_VAR TCL_SHARED_BUILD CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_SHARED_LIB_SUFFIX TCL_SRC_DIR TCL_BUILD_STUB_LIB_PATH TCL_BUILD_STUB_LIB_SPEC TCL_INCLUDE_SPEC TCL_STUB_LIB_PATH TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE PKG_CFG_ARGS TCL_YEAR TCL_PATCH_LEVEL TCL_MINOR_VERSION TCL_MAJOR_VERSION TCL_VERSION TCL_BUILDTIME_LIBRARY INSTALL_MSGS INSTALL_LIBRARIES TCL_ZIP_FILE ZIPFS_BUILD ZIP_INSTALL_OBJS ZIP_PROG_VFSSEARCH ZIP_PROG_OPTIONS ZIP_PROG MACHER_PROG EXEEXT_FOR_BUILD CC_FOR_BUILD DTRACE LDFLAGS_DEFAULT CFLAGS_DEFAULT INSTALL_STUB_LIB DLL_INSTALL_DIR INSTALL_LIB MAKE_STUB_LIB MAKE_LIB SHLIB_SUFFIX SHLIB_CFLAGS SHLIB_LD_LIBS TK_SHLIB_LD_EXTRAS TCL_SHLIB_LD_EXTRAS SHLIB_LD STLIB_LD LD_SEARCH_FLAGS CC_SEARCH_FLAGS LDFLAGS_OPTIMIZE LDFLAGS_DEBUG CFLAGS_NOLTO CFLAGS_WARNING CFLAGS_OPTIMIZE CFLAGS_DEBUG LDAIX_SRC PLAT_SRCS PLAT_OBJS DL_OBJS DL_LIBS TCL_LIBS LIBOBJS AR RANLIB TOMMATH_INCLUDE TOMMATH_SRCS TOMMATH_OBJS TCL_PC_CFLAGS TCL_PC_REQUIRES_PRIVATE ZLIB_INCLUDE ZLIB_SRCS ZLIB_OBJS TCLSH_PROG SHARED_BUILD CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAN_FLAGS target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL OBJEXT_FOR_BUILD' ac_subst_files='' ac_user_opts=' enable_option_checking enable_man_symlinks enable_man_compression enable_man_suffix with_encoding enable_shared with_system_libtommath enable_64bit enable_64bit_vis enable_rpath enable_corefoundation enable_load enable_symbols enable_langinfo enable_dll_unloading with_tzdata enable_dtrace enable_framework enable_zipfs ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF 'configure' configures tcl 9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tcl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tcl 9.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-man-symlinks use symlinks for the manpages (default: off) --enable-man-compression=PROG compress the manpages with PROG (default: off) --enable-man-suffix=STRING use STRING as a suffix to manpage file names (default: no, tcl if enabled without specifying STRING) --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-corefoundation use CoreFoundation API on MacOSX (default: on) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on) --enable-dll-unloading enable the 'unload' command (default: on) --enable-dtrace build with DTrace support (default: off) --enable-framework package shared libraries in MacOSX frameworks (default: off) --enable-zipfs build with Zipfs support (default: on) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values (default: utf-8) --with-system-libtommath use external libtommath (default: true if available, false otherwise) --with-tzdata install timezone data (default: autodetect) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tcl configure 9.0 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) eval "$4=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then 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 fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; 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 eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers tclConfig.h:../unix/tclConfig.h.in" TCL_VERSION=9.0 TCL_MAJOR_VERSION=9 TCL_MINOR_VERSION=0 TCL_PATCH_LEVEL=".3" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} EXTRA_BUILD_HTML=${EXTRA_BUILD_HTML:-"@:"} #------------------------------------------------------------------------ # Setup configure arguments for bundled packages #------------------------------------------------------------------------ PKG_CFG_ARGS="$ac_configure_args ${PKG_CFG_ARGS}" if test -r "$cache_file" -a -f "$cache_file"; then case $cache_file in [\\/]* | ?:[\\/]* ) pkg_cache_file=$cache_file ;; *) pkg_cache_file=../../$cache_file ;; esac PKG_CFG_ARGS="${PKG_CFG_ARGS} --cache-file=$pkg_cache_file" fi #------------------------------------------------------------------------ # Empty slate for bundled packages, to avoid stale configuration #------------------------------------------------------------------------ #rm -Rf pkgs if test -f Makefile; then make distclean-packages fi #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # Make sure srcdir is fully qualified! srcdir="`cd "$srcdir" ; pwd`" TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ # Compress and/or soft link the manpages? #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 printf %s "checking whether to use symlinks for manpages... " >&6; } # Check whether --enable-man-symlinks was given. if test ${enable_man_symlinks+y} then : enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 printf %s "checking whether to compress the manpages... " >&6; } # Check whether --enable-man-compression was given. if test ${enable_man_compression+y} then : enableval=$enable_man_compression; case $enableval in yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } if test "$enableval" != "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 printf %s "checking for compressed file suffix... " >&6; } touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 printf "%s\n" "$Z" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 printf %s "checking whether to add a package name suffix for the manpages... " >&6; } # Check whether --enable-man-suffix was given. if test ${enable_man_suffix+y} then : enableval=$enable_man_suffix; case $enableval in yes) enableval="tcl" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac else case e in #( e) enableval="no" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 printf "%s\n" "$enableval" >&6; } #------------------------------------------------------------------------ # Standard compiler checks #------------------------------------------------------------------------ # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo (void) {return 0; } $ac_kw foo_t foo (void) {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac #-------------------------------------------------------------------- # Supply substitutes for missing POSIX header files. Special notes: # - stdlib.h doesn't define strtol or strtoul in some versions # of SunOS # - some versions of string.h don't declare procedures such # as strstr # Do this early, otherwise an autoconf bug throws errors on configure #-------------------------------------------------------------------- ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 printf %s "checking for egrep -e... " >&6; } if test ${ac_cv_path_EGREP_TRADITIONAL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then : fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi if test "$ac_cv_path_EGREP_TRADITIONAL" then : ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" else case e in #( e) if test -z "$EGREP_TRADITIONAL"; then ac_path_EGREP_TRADITIONAL_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. # Check for GNU $ac_path_EGREP_TRADITIONAL case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_TRADITIONAL_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "strstr" >/dev/null 2>&1 then : else case e in #( e) tcl_ok=0 ;; esac fi rm -rf conftest* cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "strerror" >/dev/null 2>&1 then : else case e in #( e) tcl_ok=0 ;; esac fi rm -rf conftest* ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" if test "x$ac_cv_header_sys_wait_h" = xyes then : else case e in #( e) printf "%s\n" "#define NO_SYS_WAIT_H 1" >>confdefs.h ;; esac fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : else case e in #( e) printf "%s\n" "#define NO_DLFCN_H 1" >>confdefs.h ;; esac fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Determines the correct executable file extension (.exe) #-------------------------------------------------------------------- #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 printf %s "checking if the compiler understands -pipe... " >&6; } if test ${tcl_cv_cc_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_pipe=yes else case e in #( e) tcl_cv_cc_pipe=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 printf "%s\n" "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ # Check whether --with-encoding was given. if test ${with_encoding+y} then : withval=$with_encoding; with_tcencoding=${withval} fi if test x"${with_tcencoding}" != x ; then printf "%s\n" "#define TCL_CFGVAL_ENCODING \"${with_tcencoding}\"" >>confdefs.h else printf "%s\n" "#define TCL_CFGVAL_ENCODING \"utf-8\"" >>confdefs.h fi #-------------------------------------------------------------------- # Look for libraries that we will need when compiling the Tcl shell #-------------------------------------------------------------------- #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" if test "x$ac_cv_func_sin" = xyes then : MATH_LIBS="" else case e in #( e) MATH_LIBS="-lm" ;; esac fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5 printf %s "checking for main in -linet... " >&6; } if test ${ac_cv_lib_inet_main+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_inet_main=yes else case e in #( e) ac_cv_lib_inet_main=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5 printf "%s\n" "$ac_cv_lib_inet_main" >&6; } if test "x$ac_cv_lib_inet_main" = xyes then : LIBS="$LIBS -linet" fi ac_fn_c_check_header_compile "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default" if test "x$ac_cv_header_net_errno_h" = xyes then : printf "%s\n" "#define HAVE_NET_ERRNO_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes then : tcl_checkSocket=0 else case e in #( e) tcl_checkSocket=1 ;; esac fi if test "$tcl_checkSocket" = 1; then ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" if test "x$ac_cv_func_setsockopt" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 printf %s "checking for setsockopt in -lsocket... " >&6; } if test ${ac_cv_lib_socket_setsockopt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char setsockopt (void); int main (void) { return setsockopt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_setsockopt=yes else case e in #( e) ac_cv_lib_socket_setsockopt=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 printf "%s\n" "$ac_cv_lib_socket_setsockopt" >&6; } if test "x$ac_cv_lib_socket_setsockopt" = xyes then : LIBS="$LIBS -lsocket" else case e in #( e) tcl_checkBoth=1 ;; esac fi ;; esac fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept" if test "x$ac_cv_func_accept" = xyes then : tcl_checkNsl=0 else case e in #( e) LIBS=$tk_oldLibs ;; esac fi fi ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes else case e in #( e) ac_cv_lib_nsl_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes then : LIBS="$LIBS -lnsl" fi ;; esac fi printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _THREAD_SAFE 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 printf %s "checking for pthread_mutex_init in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthread_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 printf %s "checking for __pthread_mutex_init in -lpthread... " >&6; } if test ${ac_cv_lib_pthread___pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (void); int main (void) { return __pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread___pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthread___pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 printf %s "checking for pthread_mutex_init in -lpthreads... " >&6; } if test ${ac_cv_lib_pthreads_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthreads_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_pthreads_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes then : _ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 printf %s "checking for pthread_mutex_init in -lc... " >&6; } if test ${ac_cv_lib_c_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_c_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_c_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 printf %s "checking for pthread_mutex_init in -lc_r... " >&6; } if test ${ac_cv_lib_c_r_pthread_mutex_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (void); int main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_c_r_pthread_mutex_init=yes else case e in #( e) ac_cv_lib_c_r_pthread_mutex_init=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 printf "%s\n" "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&5 printf "%s\n" "$as_me: WARNING: Don't know how to find pthread lib on your system - you must edit the LIBS in the Makefile..." >&2;} fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" ac_fn_c_check_func "$LINENO" "pthread_attr_setstacksize" "ac_cv_func_pthread_attr_setstacksize" if test "x$ac_cv_func_pthread_attr_setstacksize" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork" if test "x$ac_cv_func_pthread_atfork" = xyes then : printf "%s\n" "#define HAVE_PTHREAD_ATFORK 1" >>confdefs.h fi LIBS=$ac_saved_libs # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 printf %s "checking how to build libraries... " >&6; } # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared" >&5 printf "%s\n" "shared" >&6; } SHARED_BUILD=1 else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static" >&5 printf "%s\n" "static" >&6; } SHARED_BUILD=0 printf "%s\n" "#define STATIC_BUILD 1" >>confdefs.h fi #-------------------------------------------------------------------- # Look for a native installed tclsh binary (if available) # If one cannot be found then use the binary we build (fails for # cross compiling). This is used for NATIVE_TCLSH in Makefile. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 printf %s "checking for tclsh... " >&6; } if test ${ac_cv_path_tclsh+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/tclsh[8-9]* 2> /dev/null` \ `ls -r $dir/tclsh* 2> /dev/null` ; do if test x"$ac_cv_path_tclsh" = x ; then if test -f "$j" ; then ac_cv_path_tclsh=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 printf "%s\n" "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 printf "%s\n" "No tclsh found on PATH" >&6; } fi if test "$TCLSH_PROG" = ""; then TCLSH_PROG='./${TCL_EXE}' fi #------------------------------------------------------------------------ # Add stuff for zlib #------------------------------------------------------------------------ zlib_ok=yes ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes then : ac_fn_c_check_type "$LINENO" "gz_header" "ac_cv_type_gz_header" "#include " if test "x$ac_cv_type_gz_header" = xyes then : else case e in #( e) zlib_ok=no ;; esac fi else case e in #( e) zlib_ok=no ;; esac fi if test $zlib_ok = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing deflateSetHeader" >&5 printf %s "checking for library containing deflateSetHeader... " >&6; } if test ${ac_cv_search_deflateSetHeader+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char deflateSetHeader (void); int main (void) { return deflateSetHeader (); ; return 0; } _ACEOF for ac_lib in '' z do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_deflateSetHeader=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_deflateSetHeader+y} then : break fi done if test ${ac_cv_search_deflateSetHeader+y} then : else case e in #( e) ac_cv_search_deflateSetHeader=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflateSetHeader" >&5 printf "%s\n" "$ac_cv_search_deflateSetHeader" >&6; } ac_res=$ac_cv_search_deflateSetHeader if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else case e in #( e) zlib_ok=no ;; esac fi fi if test $zlib_ok = no then : ZLIB_OBJS=\${ZLIB_OBJS} ZLIB_SRCS=\${ZLIB_SRCS} ZLIB_INCLUDE=-I\${ZLIB_DIR} printf "%s\n" "#define TCL_WITH_INTERNAL_ZLIB 1" >>confdefs.h fi #------------------------------------------------------------------------ # Add stuff for libtommath libtommath_ok=yes # Check whether --with-system-libtommath was given. if test ${with_system_libtommath+y} then : withval=$with_system_libtommath; libtommath_ok=${withval} fi if test x"${libtommath_ok}" = x -o x"${libtommath_ok}" != xno; then ac_fn_c_check_header_compile "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default" if test "x$ac_cv_header_tommath_h" = xyes then : ac_fn_c_check_type "$LINENO" "mp_int" "ac_cv_type_mp_int" "#include " if test "x$ac_cv_type_mp_int" = xyes then : else case e in #( e) libtommath_ok=no ;; esac fi else case e in #( e) libtommath_ok=no ;; esac fi if test $libtommath_ok = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mp_log_u32 in -ltommath" >&5 printf %s "checking for mp_log_u32 in -ltommath... " >&6; } if test ${ac_cv_lib_tommath_mp_log_u32+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltommath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char mp_log_u32 (void); int main (void) { return mp_log_u32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_tommath_mp_log_u32=yes else case e in #( e) ac_cv_lib_tommath_mp_log_u32=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tommath_mp_log_u32" >&5 printf "%s\n" "$ac_cv_lib_tommath_mp_log_u32" >&6; } if test "x$ac_cv_lib_tommath_mp_log_u32" = xyes then : MATH_LIBS="$MATH_LIBS -ltommath" else case e in #( e) libtommath_ok=no ;; esac fi fi fi if test $libtommath_ok = yes then : TCL_PC_REQUIRES_PRIVATE='libtommath >= 1.2.0,' TCL_PC_CFLAGS='-DTCL_WITH_EXTERNAL_TOMMATH' printf "%s\n" "#define TCL_WITH_EXTERNAL_TOMMATH 1" >>confdefs.h else case e in #( e) TOMMATH_OBJS=\${TOMMATH_OBJS} TOMMATH_SRCS=\${TOMMATH_SRCS} TOMMATH_INCLUDE=-I\${TOMMATH_DIR} ;; esac fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Step 0.a: Enable 64 bit support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 printf %s "checking if 64bit support is requested... " >&6; } # Check whether --enable-64bit was given. if test ${enable_64bit+y} then : enableval=$enable_64bit; do64bit=$enableval else case e in #( e) do64bit=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 printf "%s\n" "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 printf %s "checking if 64bit Sparc VIS support is requested... " >&6; } # Check whether --enable-64bit-vis was given. if test ${enable_64bit_vis+y} then : enableval=$enable_64bit_vis; do64bitVIS=$enableval else case e in #( e) do64bitVIS=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 printf "%s\n" "$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes" then : do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 printf %s "checking if compiler supports visibility \"hidden\"... " >&6; } if test ${tcl_cv_cc_visibility_hidden+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main (void) { f(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_visibility_hidden=yes else case e in #( e) tcl_cv_cc_visibility_hidden=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 printf "%s\n" "$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes then : printf "%s\n" "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h printf "%s\n" "#define HAVE_HIDDEN 1" >>confdefs.h fi # Step 0.d: Disable -rpath support? { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 printf %s "checking if rpath support is requested... " >&6; } # Check whether --enable-rpath was given. if test ${enable_rpath+y} then : enableval=$enable_rpath; doRpath=$enableval else case e in #( e) doRpath=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 printf "%s\n" "$doRpath" >&6; } # Step 1: set the variable "system" to hold the name and version number # for the system. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 printf %s "checking system version... " >&6; } if test ${tcl_cv_sys_version+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 printf "%s\n" "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : have_dl=yes else case e in #( e) have_dl=no ;; esac fi # Require ranlib early so we can override it in special cases below. # 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] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = yes then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" case "${CC}" in *++|*++-*) ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac else case e in #( e) CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" ;; esac fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" if test "x${SHLIB_VERSION}" = x then : SHLIB_VERSION="1.0" fi case $system in AIX-*) if test "$GCC" != "yes" then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 printf "%s\n" "Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # ldAix No longer needed with use of -bexpall/-brtl # but some extensions may still reference it LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : if test "$GCC" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" ;; esac fi fi if test "`uname -m`" = ia64 then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = yes then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else case e in #( e) CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' ;; esac fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else case e in #( e) if test "$GCC" = yes then : SHLIB_LD='${CC} -shared -Wl,-bexpall' else case e in #( e) SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" ;; esac fi SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; esac fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 printf %s "checking for inet_ntoa in -lbind... " >&6; } if test ${ac_cv_lib_bind_inet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (void); int main (void) { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bind_inet_ntoa=yes else case e in #( e) ac_cv_lib_bind_inet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_bind_inet_ntoa" >&6; } if test "x$ac_cv_lib_bind_inet_ntoa" = xyes then : LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*|MINGW32_*|MSYS_*) SHLIB_CFLAGS="-fno-common" SHLIB_LD='${CC} -shared -Wl,--out-implib,$(patsubst cyg%.dll,lib%.dll,$@).a' SHLIB_SUFFIX=".dll" DL_OBJS="tclLoadDl.o" PLAT_OBJS='${CYGWIN_OBJS}' PLAT_SRCS='${CYGWIN_SRCS}' DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 printf %s "checking for Cygwin version of gcc... " >&6; } if test ${ac_cv_cygwin+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __CYGWIN__ #error cygwin #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cygwin=no else case e in #( e) ac_cv_cygwin=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 printf "%s\n" "$ac_cv_cygwin" >&6; } if test "$ac_cv_cygwin" = "no"; then as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32" # The eval makes quoting arguments work. if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix then : else { echo "configure: error: configure failed for ../win" 1>&2; exit 1; } fi fi ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 printf %s "checking for inet_ntoa in -lnetwork... " >&6; } if test ${ac_cv_lib_network_inet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (void); int main (void) { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_network_inet_ntoa=yes else case e in #( e) ac_cv_lib_network_inet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_network_inet_ntoa" >&6; } if test "x$ac_cv_lib_network_inet_ntoa" = xyes then : LIBS="$LIBS -lnetwork" fi ;; HP-UX-*.11.*) # Use updated header definitions where possible printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h printf "%s\n" "#define _XOPEN_SOURCE 1" >>confdefs.h LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = ia64 then : SHLIB_SUFFIX=".so" else case e in #( e) SHLIB_SUFFIX=".sl" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = yes then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else case e in #( e) CFLAGS="$CFLAGS -z" ;; esac fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" then : if test "$GCC" = yes then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" ;; esac fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi if test "$tcl_ok" = yes then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case e in #( e) case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" ;; esac fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : if test "$GCC" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else case e in #( e) do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" ;; esac fi fi ;; Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) SHLIB_CFLAGS="-fPIC -fno-common" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; esac if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha" then : CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 printf %s "checking if compiler accepts -m64 flag... " >&6; } if test ${tcl_cv_cc_m64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_m64=yes else case e in #( e) tcl_cv_cc_m64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 printf "%s\n" "$tcl_cv_cc_m64" >&6; } if test $tcl_cv_cc_m64 = yes then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related to inlining of # functions like strtol()/strtoul(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x then : CFLAGS="$CFLAGS -fno-inline" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; Darwin-*) CFLAGS_OPTIMIZE="-O2" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes then : case `arch` in ppc) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 printf %s "checking if compiler accepts -arch ppc64 flag... " >&6; } if test ${tcl_cv_cc_arch_ppc64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_ppc64=yes else case e in #( e) tcl_cv_cc_arch_ppc64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 printf "%s\n" "$tcl_cv_cc_arch_ppc64" >&6; } if test $tcl_cv_cc_arch_ppc64 = yes then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi;; i386|x86_64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 printf %s "checking if compiler accepts -arch x86_64 flag... " >&6; } if test ${tcl_cv_cc_arch_x86_64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_x86_64=yes else case e in #( e) tcl_cv_cc_arch_x86_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 printf "%s\n" "$tcl_cv_cc_arch_x86_64" >&6; } if test $tcl_cv_cc_arch_x86_64 = yes then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi;; arm64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64 flag" >&5 printf %s "checking if compiler accepts -arch arm64 flag... " >&6; } if test ${tcl_cv_cc_arch_arm64+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch arm64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_arch_arm64=yes else case e in #( e) tcl_cv_cc_arch_arm64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64" >&5 printf "%s\n" "$tcl_cv_cc_arch_arm64" >&6; } if test $tcl_cv_cc_arch_arm64 = yes then : CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes fi;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 printf "%s\n" "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else case e in #( e) # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) ' then : fat_32_64=yes fi ;; esac fi SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="$LDFLAGS -headerpad_max_install_names" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 printf %s "checking if ld accepts -search_paths_first flag... " >&6; } if test ${tcl_cv_ld_search_paths_first+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_ld_search_paths_first=yes else case e in #( e) tcl_cv_ld_search_paths_first=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 printf "%s\n" "$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes then : printf "%s\n" "#define MODULE_SCOPE __private_extern__" >>confdefs.h tcl_cv_cc_visibility_hidden=yes fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH" printf "%s\n" "#define MAC_OSX_TCL 1" >>confdefs.h PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 printf %s "checking whether to use CoreFoundation... " >&6; } # Check whether --enable-corefoundation was given. if test ${enable_corefoundation+y} then : enableval=$enable_corefoundation; tcl_corefoundation=$enableval else case e in #( e) tcl_corefoundation=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 printf "%s\n" "$tcl_corefoundation" >&6; } if test $tcl_corefoundation = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 printf %s "checking for CoreFoundation.framework... " >&6; } if test ${tcl_cv_lib_corefoundation+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_libs=$LIBS if test "$fat_32_64" = yes then : for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit # archs from CFLAGS et al. while testing for # presence of CF. 64-bit CF is disabled in # tclUnixPort.h if necessary. eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi LIBS="$LIBS -framework CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_lib_corefoundation=yes else case e in #( e) tcl_cv_lib_corefoundation=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$fat_32_64" = yes then : for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi LIBS=$hold_libs ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 printf "%s\n" "$tcl_cv_lib_corefoundation" >&6; } if test $tcl_cv_lib_corefoundation = yes then : LIBS="$LIBS -framework CoreFoundation" printf "%s\n" "#define HAVE_COREFOUNDATION 1" >>confdefs.h else case e in #( e) tcl_corefoundation=no ;; esac fi if test "$fat_32_64" = yes -a $tcl_corefoundation = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 printf %s "checking for 64-bit CoreFoundation... " >&6; } if test ${tcl_cv_lib_corefoundation_64+y} then : printf %s "(cached) " >&6 else case e in #( e) for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_lib_corefoundation_64=yes else case e in #( e) tcl_cv_lib_corefoundation_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 printf "%s\n" "$tcl_cv_lib_corefoundation_64" >&6; } if test $tcl_cv_lib_corefoundation_64 = no then : printf "%s\n" "#define NO_COREFOUNDATION_64 1" >>confdefs.h LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi fi fi ;; OS/390-*) SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy printf "%s\n" "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = 1 then : SHLIB_LD='${CC} -shared' else case e in #( e) SHLIB_LD='${CC} -non_shared' ;; esac fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes then : CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes then : CFLAGS="$CFLAGS -mieee" else case e in #( e) CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" ;; esac fi # see pthread_intro(3) for pthread support on osf1, k.furukawa CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = yes then : LIBS="$LIBS -lpthread -lmach -lexc" else case e in #( e) CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; esac fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = yes then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else case e in #( e) SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" ;; esac fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else case e in #( e) SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; esac fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. printf "%s\n" "#define _REENTRANT 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes then : arch=`isainfo` if test "$arch" = "sparcv9 sparc" then : if test "$GCC" = yes then : if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else case e in #( e) do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" ;; esac fi else case e in #( e) do64bit_ok=yes if test "$do64bitVIS" = yes then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else case e in #( e) CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" ;; esac fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" ;; esac fi else case e in #( e) if test "$arch" = "amd64 i386" then : if test "$GCC" = yes then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else case e in #( e) do64bit_ok=yes case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac ;; esac fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 printf "%s\n" "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} ;; esac fi ;; esac fi fi #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- if test "$GCC" = yes then : use_sunmath=no else case e in #( e) arch=`isainfo` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 printf %s "checking whether to use -lsunmath for fp rounding control... " >&6; } if test "$arch" = "amd64 i386" -o "$arch" = "i386" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } MATH_LIBS="-lsunmath $MATH_LIBS" ac_fn_c_check_header_compile "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" if test "x$ac_cv_header_sunmath_h" = xyes then : fi use_sunmath=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } use_sunmath=no ;; esac fi ;; esac fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = yes then : if test "$arch" = "sparcv9 sparc" then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else case e in #( e) if test "$arch" = "amd64 i386" then : SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi ;; esac fi fi else case e in #( e) if test "$use_sunmath" = yes then : textmode=textoff else case e in #( e) textmode=text ;; esac fi case $system in SunOS-5.[1-9][0-9]*|SunOS-5.[7-9]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ;; esac fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 printf %s "checking for ld accepts -Bexport flag... " >&6; } if test ${tcl_cv_ld_Bexport+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int i; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_ld_Bexport=yes else case e in #( e) tcl_cv_ld_Bexport=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 printf "%s\n" "$tcl_cv_ld_Bexport" >&6; } if test $tcl_cv_ld_Bexport = yes then : LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = yes -a "$do64bit_ok" = no then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 printf "%s\n" "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi if test "$do64bit" = yes -a "$do64bit_ok" = yes then : printf "%s\n" "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load was given. if test ${enable_load+y} then : enableval=$enable_load; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = no then : DL_OBJS="" fi if test "x$DL_OBJS" != x then : BUILD_DLTEST="\$(DLTEST_TARGETS)" else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 printf "%s\n" "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" ;; esac fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes then : case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*|MSYS_*) ;; HP-UX*) ;; Darwin-*) ;; IRIX*) ;; Linux*|GNU*) ;; NetBSD-*|OpenBSD-*) ;; OSF1-*) ;; SCO_SV-3.2*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$tcl_cv_cc_visibility_hidden" != yes then : printf "%s\n" "#define MODULE_SCOPE extern" >>confdefs.h fi if test "$SHARED_LIB_SUFFIX" = "" then : SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" then : UNSHARED_LIB_SUFFIX='${VERSION}.a' fi DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != "" then : LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll" then : INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else case e in #( e) INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ;; esac fi else case e in #( e) LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} if test "$RANLIB" = "" then : MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' else case e in #( e) MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' ;; esac fi INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ;; esac fi # Stub lib does not depend on shared/static configuration if test "$RANLIB" = "" then : MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' else case e in #( e) MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' ;; esac fi INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. if test "x${TCL_LIBS}" = x then : TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 printf %s "checking for cast to union support... " >&6; } if test ${tcl_cv_cast_to_union+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { union foo { int i; double d; }; union foo f = (union foo) (int) 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cast_to_union=yes else case e in #( e) tcl_cv_cast_to_union=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 printf "%s\n" "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 printf %s "checking for working -fno-lto... " >&6; } if test ${ac_cv_nolto+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_nolto=yes else case e in #( e) ac_cv_nolto=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 printf "%s\n" "$ac_cv_nolto" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_nolto" = "yes" ; then CFLAGS_NOLTO="-fno-lto" else CFLAGS_NOLTO="" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5 printf %s "checking if the compiler understands -finput-charset... " >&6; } if test ${tcl_cv_cc_input_charset+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_input_charset=yes else case e in #( e) tcl_cv_cc_input_charset=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5 printf "%s\n" "$tcl_cv_cc_input_charset" >&6; } if test $tcl_cv_cc_input_charset = yes; then CFLAGS="$CFLAGS -finput-charset=UTF-8" fi # Check for vfork, posix_spawnp() and friends unconditionally ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" if test "x$ac_cv_func_vfork" = xyes then : printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" if test "x$ac_cv_func_posix_spawnp" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawn_file_actions_adddup2" "ac_cv_func_posix_spawn_file_actions_adddup2" if test "x$ac_cv_func_posix_spawn_file_actions_adddup2" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_spawnattr_setflags" "ac_cv_func_posix_spawnattr_setflags" if test "x$ac_cv_func_posix_spawnattr_setflags" = xyes then : printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h fi # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. printf "%s\n" "#define TCL_SHLIB_EXT \"${SHLIB_SUFFIX}\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 printf %s "checking for build with symbols... " >&6; } # Check whether --enable-symbols was given. if test ${enable_symbols+y} then : enableval=$enable_symbols; tcl_ok=$enableval else case e in #( e) tcl_ok=no ;; esac fi # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' printf "%s\n" "#define NDEBUG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 printf "%s\n" "yes (standard debugging)" >&6; } fi fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then printf "%s\n" "#define TCL_COMPILE_DEBUG 1" >>confdefs.h printf "%s\n" "#define TCL_COMPILE_STATS 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 printf "%s\n" "enabled symbols mem compile debugging" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 printf "%s\n" "enabled $tcl_ok debugging" >&6; } fi fi printf "%s\n" "#define MP_PREC 4" >>confdefs.h #-------------------------------------------------------------------- # Detect what compiler flags to set for 64-bit support. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 printf %s "checking for required early compiler flags... " >&6; } tcl_flags="" if test ${tcl_cv_flag__isoc99_source+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__isoc99_source=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main (void) { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__isoc99_source=yes else case e in #( e) tcl_cv_flag__isoc99_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test ${tcl_cv_flag__file_offset_bits+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__file_offset_bits=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include int main (void) { switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__file_offset_bits=yes else case e in #( e) tcl_cv_flag__file_offset_bits=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi if test ${tcl_cv_flag__largefile64_source+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__largefile64_source=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main (void) { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_flag__largefile64_source=yes else case e in #( e) tcl_cv_flag__largefile64_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then printf "%s\n" "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 printf "%s\n" "${tcl_flags}" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5 printf %s "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; } if test ${tcl_cv_type_64bit+y} then : printf %s "(cached) " >&6 else case e in #( e) tcl_cv_type_64bit=none # See if we could use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { switch (0) { case 1: case (sizeof(long long)==sizeof(long)): ; } ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_64bit="long long" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "${tcl_cv_type_64bit}" = none ; then printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } # Now check for auxiliary declarations { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit time_t" >&5 printf %s "checking for 64-bit time_t... " >&6; } if test ${tcl_cv_time_t_64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_time_t_64=yes else case e in #( e) tcl_cv_time_t_64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_time_t_64" >&5 printf "%s\n" "$tcl_cv_time_t_64" >&6; } if test "x${tcl_cv_time_t_64}" = "xno" ; then # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 # which SC_TCL_EARLY_FLAGS has defined if necessary. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _TIME_BITS=64 enables 64-bit time_t" >&5 printf %s "checking if _TIME_BITS=64 enables 64-bit time_t... " >&6; } if test ${tcl_cv__time_bits+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _TIME_BITS 64 #include int main (void) { switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv__time_bits=yes else case e in #( e) tcl_cv__time_bits=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv__time_bits" >&5 printf "%s\n" "$tcl_cv__time_bits" >&6; } if test "x${tcl_cv__time_bits}" = "xyes" ; then printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 printf %s "checking for struct dirent64... " >&6; } if test ${tcl_cv_struct_dirent64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { struct dirent64 p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_struct_dirent64=yes else case e in #( e) tcl_cv_struct_dirent64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 printf "%s\n" "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then printf "%s\n" "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5 printf %s "checking for DIR64... " >&6; } if test ${tcl_cv_DIR64+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_DIR64=yes else case e in #( e) tcl_cv_DIR64=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 printf "%s\n" "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : printf "%s\n" "#define HAVE_OPEN64 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64" if test "x$ac_cv_func_lseek64" = xyes then : printf "%s\n" "#define HAVE_LSEEK64 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 printf %s "checking for off64_t... " >&6; } if test ${tcl_cv_type_off64_t+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { off64_t offset; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_off64_t=yes else case e in #( e) tcl_cv_type_off64_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then printf "%s\n" "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi #-------------------------------------------------------------------- # Check endianness because we can optimize comparisons of # Tcl_UniChar strings to memcmp on big-endian systems. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO" then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes else case e in #( e) ac_cv_c_bigendian=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } int main (int argc, char **argv) { /* Intimidate the compiler so that it does not optimize the arrays away. */ char *p = argv[0]; ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; return use_ascii (argc) == use_ebcdic (*p); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no else case e in #( e) ac_cv_c_bigendian=yes ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) # ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac #-------------------------------------------------------------------- # Supply substitutes for missing POSIX library procedures, or # set flags so Tcl uses alternate procedures. #-------------------------------------------------------------------- # Check if Posix compliant getcwd exists, if not we'll use getwd. for ac_func in getcwd do : ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" if test "x$ac_cv_func_getcwd" = xyes then : printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h else case e in #( e) printf "%s\n" "#define USEGETWD 1" >>confdefs.h ;; esac fi done # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes then : printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" if test "x$ac_cv_func_waitpid" = xyes then : printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" waitpid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes then : else case e in #( e) printf "%s\n" "#define NO_STRERROR 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" if test "x$ac_cv_func_getwd" = xyes then : else case e in #( e) printf "%s\n" "#define NO_GETWD 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" if test "x$ac_cv_func_wait3" = xyes then : else case e in #( e) printf "%s\n" "#define NO_WAIT3 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" if test "x$ac_cv_func_fork" = xyes then : else case e in #( e) printf "%s\n" "#define NO_FORK 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod" if test "x$ac_cv_func_mknod" = xyes then : else case e in #( e) printf "%s\n" "#define NO_MKNOD 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "tcdrain" "ac_cv_func_tcdrain" if test "x$ac_cv_func_tcdrain" = xyes then : else case e in #( e) printf "%s\n" "#define NO_TCDRAIN 1" >>confdefs.h ;; esac fi ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes then : else case e in #( e) printf "%s\n" "#define NO_UNAME 1" >>confdefs.h ;; esac fi if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print $1}'`" -lt 7; then # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232 ac_cv_func_realpath=no fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes then : else case e in #( e) printf "%s\n" "#define NO_REALPATH 1" >>confdefs.h ;; esac fi NEED_FAKE_RFC2553=0 for ac_func in getnameinfo getaddrinfo freeaddrinfo gai_strerror do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi done ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #include #include #include #include " if test "x$ac_cv_type_struct_addrinfo" = xyes then : printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " #include #include #include #include " if test "x$ac_cv_type_struct_in6_addr" = xyes then : printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " #include #include #include #include " if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #include #include #include #include " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h else case e in #( e) NEED_FAKE_RFC2553=1 ;; esac fi if test "x$NEED_FAKE_RFC2553" = "x1"; then printf "%s\n" "#define NEED_FAKE_RFC2553 1" >>confdefs.h case " $LIBOBJS " in *" fake-rfc2553.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fake-rfc2553.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes then : fi fi #-------------------------------------------------------------------- # Look for thread-safe variants of some library functions. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" if test "x$ac_cv_func_getpwuid_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 5 args" >&5 printf %s "checking for getpwuid_r with 5 args... " >&6; } if test ${tcl_cv_api_getpwuid_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { uid_t uid; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwuid_r(uid, &pw, buf, buflen, &pwp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwuid_r_5=yes else case e in #( e) tcl_cv_api_getpwuid_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_5" >&5 printf "%s\n" "$tcl_cv_api_getpwuid_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwuid_r with 4 args" >&5 printf %s "checking for getpwuid_r with 4 args... " >&6; } if test ${tcl_cv_api_getpwuid_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { uid_t uid; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(uid, &pw, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwuid_r_4=yes else case e in #( e) tcl_cv_api_getpwuid_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwuid_r_4" >&5 printf "%s\n" "$tcl_cv_api_getpwuid_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwuid_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r" if test "x$ac_cv_func_getpwnam_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 5 args" >&5 printf %s "checking for getpwnam_r with 5 args... " >&6; } if test ${tcl_cv_api_getpwnam_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct passwd pw, *pwp; char buf[512]; int buflen = 512; (void) getpwnam_r(name, &pw, buf, buflen, &pwp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwnam_r_5=yes else case e in #( e) tcl_cv_api_getpwnam_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_5" >&5 printf "%s\n" "$tcl_cv_api_getpwnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpwnam_r with 4 args" >&5 printf %s "checking for getpwnam_r with 4 args... " >&6; } if test ${tcl_cv_api_getpwnam_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct passwd pw; char buf[512]; int buflen = 512; (void)getpwnam_r(name, &pw, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getpwnam_r_4=yes else case e in #( e) tcl_cv_api_getpwnam_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getpwnam_r_4" >&5 printf "%s\n" "$tcl_cv_api_getpwnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getpwnam_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" if test "x$ac_cv_func_getgrgid_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 5 args" >&5 printf %s "checking for getgrgid_r with 5 args... " >&6; } if test ${tcl_cv_api_getgrgid_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { gid_t gid; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrgid_r(gid, &gr, buf, buflen, &grp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrgid_r_5=yes else case e in #( e) tcl_cv_api_getgrgid_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_5" >&5 printf "%s\n" "$tcl_cv_api_getgrgid_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrgid_r with 4 args" >&5 printf %s "checking for getgrgid_r with 4 args... " >&6; } if test ${tcl_cv_api_getgrgid_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { gid_t gid; struct group gr; char buf[512]; int buflen = 512; (void)getgrgid_r(gid, &gr, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrgid_r_4=yes else case e in #( e) tcl_cv_api_getgrgid_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrgid_r_4" >&5 printf "%s\n" "$tcl_cv_api_getgrgid_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrgid_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r" if test "x$ac_cv_func_getgrnam_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 5 args" >&5 printf %s "checking for getgrnam_r with 5 args... " >&6; } if test ${tcl_cv_api_getgrnam_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct group gr, *grp; char buf[512]; int buflen = 512; (void) getgrnam_r(name, &gr, buf, buflen, &grp); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrnam_r_5=yes else case e in #( e) tcl_cv_api_getgrnam_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_5" >&5 printf "%s\n" "$tcl_cv_api_getgrnam_r_5" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getgrnam_r with 4 args" >&5 printf %s "checking for getgrnam_r with 4 args... " >&6; } if test ${tcl_cv_api_getgrnam_r_4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { char *name; struct group gr; char buf[512]; int buflen = 512; (void)getgrnam_r(name, &gr, buf, buflen); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_getgrnam_r_4=yes else case e in #( e) tcl_cv_api_getgrnam_r_4=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_getgrnam_r_4" >&5 printf "%s\n" "$tcl_cv_api_getgrnam_r_4" >&6; } tcl_ok=$tcl_cv_api_getgrnam_r_4 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R_4 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h fi fi if test "`uname -s`" = "Darwin" && \ test "`uname -r | awk -F. '{print $1}'`" -gt 5; then # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h elif test "`uname -s`" = "HP-UX" && \ test "`uname -r|sed -e 's|B\.||' -e 's|\..*$||'`" -gt 10; then # Starting with HPUX 11.00 (we believe), gethostbyX # are actually MT-safe as they always return pointers # from TSD instead of static storage. printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYNAME 1" >>confdefs.h printf "%s\n" "#define HAVE_MTSAFE_GETHOSTBYADDR 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac # Avoids picking hidden internal symbol from libc ac_fn_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_gethostbyname_r" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : tcl_cv_api_gethostbyname_r=yes else case e in #( e) tcl_cv_api_gethostbyname_r=no ;; esac fi if test "$tcl_cv_api_gethostbyname_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" if test "x$ac_cv_func_gethostbyname_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 args" >&5 printf %s "checking for gethostbyname_r with 6 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_6+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he, *res; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_6=yes else case e in #( e) tcl_cv_api_gethostbyname_r_6=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_6" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_6" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_6 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 args" >&5 printf %s "checking for gethostbyname_r with 5 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_5+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_5=yes else case e in #( e) tcl_cv_api_gethostbyname_r_5=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_5" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_5" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_5 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 3 args" >&5 printf %s "checking for gethostbyname_r with 3 args... " >&6; } if test ${tcl_cv_api_gethostbyname_r_3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *name; struct hostent *he; struct hostent_data data; (void) gethostbyname_r(name, he, &data); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyname_r_3=yes else case e in #( e) tcl_cv_api_gethostbyname_r_3=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyname_r_3" >&5 printf "%s\n" "$tcl_cv_api_gethostbyname_r_3" >&6; } tcl_ok=$tcl_cv_api_gethostbyname_r_3 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h fi fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h fi fi fi # Avoids picking hidden internal symbol from libc ac_fn_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : tcl_cv_api_gethostbyaddr_r=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r=no ;; esac fi if test "$tcl_cv_api_gethostbyaddr_r" = yes; then ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r" if test "x$ac_cv_func_gethostbyaddr_r" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 7 args" >&5 printf %s "checking for gethostbyaddr_r with 7 args... " >&6; } if test ${tcl_cv_api_gethostbyaddr_r_7+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *addr; int length; int type; struct hostent *result; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyaddr_r_7=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r_7=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_7" >&5 printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_7" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_7 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r with 8 args" >&5 printf %s "checking for gethostbyaddr_r with 8 args... " >&6; } if test ${tcl_cv_api_gethostbyaddr_r_8+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *addr; int length; int type; struct hostent *result, *resultp; char buffer[2048]; int buflen = 2048; int h_errnop; (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_api_gethostbyaddr_r_8=yes else case e in #( e) tcl_cv_api_gethostbyaddr_r_8=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_gethostbyaddr_r_8" >&5 printf "%s\n" "$tcl_cv_api_gethostbyaddr_r_8" >&6; } tcl_ok=$tcl_cv_api_gethostbyaddr_r_8 if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h fi fi if test "$tcl_ok" = yes; then printf "%s\n" "#define HAVE_GETHOSTBYADDR_R 1" >>confdefs.h fi fi fi fi #--------------------------------------------------------------------------- # Check for serial port interface. # # termios.h is present on all POSIX systems. # sys/ioctl.h is almost always present, though what it contains # is system-specific. # sys/modem.h is needed on HP-UX. #--------------------------------------------------------------------------- ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" if test "x$ac_cv_header_sys_modem_h" = xyes then : printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h fi #-------------------------------------------------------------------- # Include sys/select.h if it exists and if it supplies things # that appear to be useful and aren't already in sys/types.h. # This appears to be true only on the RS/6000 under AIX. Some # systems like OSF/1 have a sys/select.h that's of no use, and # other systems like SCO UNIX have a sys/select.h that's # pernicious. If "fd_set" isn't defined anywhere then set a # special flag. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 printf %s "checking for fd_set in sys/types... " >&6; } if test ${tcl_cv_type_fd_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { fd_set readMask, writeMask; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_fd_set=yes else case e in #( e) tcl_cv_type_fd_set=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 printf "%s\n" "$tcl_cv_type_fd_set" >&6; } tcl_ok=$tcl_cv_type_fd_set if test $tcl_ok = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 printf %s "checking for fd_mask in sys/select... " >&6; } if test ${tcl_cv_grep_fd_mask+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "fd_mask" >/dev/null 2>&1 then : tcl_cv_grep_fd_mask=present else case e in #( e) tcl_cv_grep_fd_mask=missing ;; esac fi rm -rf conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 printf "%s\n" "$tcl_cv_grep_fd_mask" >&6; } if test $tcl_cv_grep_fd_mask = present; then printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h tcl_ok=yes fi fi if test $tcl_ok = no; then printf "%s\n" "#define NO_FD_SET 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 printf %s "checking for pselect... " >&6; } if test ${tcl_cv_func_pselect+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *func = pselect; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_func_pselect=yes else case e in #( e) tcl_cv_func_pselect=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_func_pselect" >&5 printf "%s\n" "$tcl_cv_func_pselect" >&6; } tcl_ok=$tcl_cv_func_pselect if test $tcl_ok = yes; then printf "%s\n" "#define HAVE_PSELECT 1" >>confdefs.h fi #------------------------------------------------------------------------ # Options for the notifier. Checks for epoll(7) on Linux, and # kqueue(2) on {DragonFly,Free,Net,Open}BSD #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for advanced notifier support" >&5 printf %s "checking for advanced notifier support... " >&6; } case x`uname -s` in xLinux) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: epoll(7)" >&5 printf "%s\n" "epoll(7)" >&6; } for ac_header in sys/epoll.h do : ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h printf "%s\n" "#define NOTIFIER_EPOLL 1" >>confdefs.h fi done for ac_header in sys/eventfd.h do : ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_eventfd_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h fi done;; xDragonFlyBSD|xFreeBSD|xNetBSD|xOpenBSD) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: kqueue(2)" >&5 printf "%s\n" "kqueue(2)" >&6; } # Messy because we want to check if *all* the headers are present, and not # just *any* tcl_kqueue_headers=x for ac_header in sys/types.h sys/event.h sys/time.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF tcl_kqueue_headers=${tcl_kqueue_headers}y fi done if test $tcl_kqueue_headers = xyyy then : printf "%s\n" "#define NOTIFIER_KQUEUE 1" >>confdefs.h fi;; xDarwin) # Assume that we've got CoreFoundation present (checked elsewhere because # of wider impact). { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OSX" >&5 printf "%s\n" "OSX" >&6; };; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; };; esac #------------------------------------------------------------------------------ # Find out all about time handling differences. #------------------------------------------------------------------------------ ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" if test "x$ac_cv_func_gmtime_r" = xyes then : printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" if test "x$ac_cv_func_localtime_r" = xyes then : printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_tzadj in struct tm" >&5 printf %s "checking tm_tzadj in struct tm... " >&6; } if test ${tcl_cv_member_tm_tzadj+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct tm tm; (void)tm.tm_tzadj; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_member_tm_tzadj=yes else case e in #( e) tcl_cv_member_tm_tzadj=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_tzadj" >&5 printf "%s\n" "$tcl_cv_member_tm_tzadj" >&6; } if test $tcl_cv_member_tm_tzadj = yes ; then printf "%s\n" "#define HAVE_TM_TZADJ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking tm_gmtoff in struct tm" >&5 printf %s "checking tm_gmtoff in struct tm... " >&6; } if test ${tcl_cv_member_tm_gmtoff+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { struct tm tm; (void)tm.tm_gmtoff; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_member_tm_gmtoff=yes else case e in #( e) tcl_cv_member_tm_gmtoff=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_member_tm_gmtoff" >&5 printf "%s\n" "$tcl_cv_member_tm_gmtoff" >&6; } if test $tcl_cv_member_tm_gmtoff = yes ; then printf "%s\n" "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking long timezone variable" >&5 printf %s "checking long timezone variable... " >&6; } if test ${tcl_cv_timezone_long+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { extern long timezone; timezone += 1; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_timezone_long=yes else case e in #( e) tcl_cv_timezone_long=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_long" >&5 printf "%s\n" "$tcl_cv_timezone_long" >&6; } if test $tcl_cv_timezone_long = yes ; then printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking time_t timezone variable" >&5 printf %s "checking time_t timezone variable... " >&6; } if test ${tcl_cv_timezone_time+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { extern time_t timezone; timezone += 1; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_timezone_time=yes else case e in #( e) tcl_cv_timezone_time=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_timezone_time" >&5 printf "%s\n" "$tcl_cv_timezone_time" >&6; } if test $tcl_cv_timezone_time = yes ; then printf "%s\n" "#define HAVE_TIMEZONE_VAR 1" >>confdefs.h fi fi #-------------------------------------------------------------------- # Some systems (e.g., IRIX 4.0.5) lack some fields in struct stat. But # we might be able to use fstatfs instead. Some systems (OpenBSD?) also # lack blkcnt_t. #-------------------------------------------------------------------- if test "$ac_cv_cygwin" != "yes"; then ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blocks" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blksize" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_rdev" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h fi fi ac_fn_c_check_type "$LINENO" "blkcnt_t" "ac_cv_type_blkcnt_t" "$ac_includes_default" if test "x$ac_cv_type_blkcnt_t" = xyes then : printf "%s\n" "#define HAVE_BLKCNT_T 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs" if test "x$ac_cv_func_fstatfs" = xyes then : else case e in #( e) printf "%s\n" "#define NO_FSTATFS 1" >>confdefs.h ;; esac fi #-------------------------------------------------------------------- # Check for various typedefs and provide substitutes if # they don't exist. #-------------------------------------------------------------------- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : else case e in #( e) printf "%s\n" "#define mode_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default " if test "x$ac_cv_type_pid_t" = xyes then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else case e in #( e) ac_pid_type='__int64' ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else case e in #( e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" if test "x$ac_cv_type_uid_t" = xyes then : else case e in #( e) printf "%s\n" "#define uid_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" if test "x$ac_cv_type_gid_t" = xyes then : else case e in #( e) printf "%s\n" "#define gid_t int" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 printf %s "checking for socklen_t... " >&6; } if test ${tcl_cv_type_socklen_t+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { socklen_t foo; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_type_socklen_t=yes else case e in #( e) tcl_cv_type_socklen_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_socklen_t" >&5 printf "%s\n" "$tcl_cv_type_socklen_t" >&6; } if test $tcl_cv_type_socklen_t = no; then printf "%s\n" "#define socklen_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" " #include " if test "x$ac_cv_type_intptr_t" = xyes then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" " #include " if test "x$ac_cv_type_uintptr_t" = xyes then : printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h fi #-------------------------------------------------------------------- # The check below checks whether defines the type # "union wait" correctly. It's needed because of weirdness in # HP-UX where "union wait" is defined in both the BSD and SYS-V # environments. Checking the usability of WIFEXITED seems to do # the trick. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking union wait" >&5 printf %s "checking union wait... " >&6; } if test ${tcl_cv_union_wait+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { union wait x; WIFEXITED(x); /* Generates compiler error if WIFEXITED * uses an int. */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_union_wait=yes else case e in #( e) tcl_cv_union_wait=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_union_wait" >&5 printf "%s\n" "$tcl_cv_union_wait" >&6; } if test $tcl_cv_union_wait = no; then printf "%s\n" "#define NO_UNION_WAIT 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check whether there is an strncasecmp function on this system. # This is a bit tricky because under SCO it's in -lsocket and # under Sequent Dynix it's in -linet. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi if test "$tcl_ok" = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -lsocket" >&5 printf %s "checking for strncasecmp in -lsocket... " >&6; } if test ${ac_cv_lib_socket_strncasecmp+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char strncasecmp (void); int main (void) { return strncasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_strncasecmp=yes else case e in #( e) ac_cv_lib_socket_strncasecmp=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_strncasecmp" >&5 printf "%s\n" "$ac_cv_lib_socket_strncasecmp" >&6; } if test "x$ac_cv_lib_socket_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi fi if test "$tcl_ok" = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strncasecmp in -linet" >&5 printf %s "checking for strncasecmp in -linet... " >&6; } if test ${ac_cv_lib_inet_strncasecmp+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char strncasecmp (void); int main (void) { return strncasecmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_inet_strncasecmp=yes else case e in #( e) ac_cv_lib_inet_strncasecmp=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_strncasecmp" >&5 printf "%s\n" "$ac_cv_lib_inet_strncasecmp" >&6; } if test "x$ac_cv_lib_inet_strncasecmp" = xyes then : tcl_ok=1 else case e in #( e) tcl_ok=0 ;; esac fi fi if test "$tcl_ok" = 0; then case " $LIBOBJS " in *" strncasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" ;; esac USE_COMPAT=1 fi #-------------------------------------------------------------------- # The code below deals with several issues related to gettimeofday: # 1. Some systems don't provide a gettimeofday function at all # (set NO_GETTOD if this is the case). # 2. See if gettimeofday is declared in the header file. # if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can # declare it. #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes then : else case e in #( e) printf "%s\n" "#define NO_GETTOD 1" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday declaration" >&5 printf %s "checking for gettimeofday declaration... " >&6; } if test ${tcl_cv_grep_gettimeofday+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP_TRADITIONAL "gettimeofday" >/dev/null 2>&1 then : tcl_cv_grep_gettimeofday=present else case e in #( e) tcl_cv_grep_gettimeofday=missing ;; esac fi rm -rf conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_gettimeofday" >&5 printf "%s\n" "$tcl_cv_grep_gettimeofday" >&6; } if test $tcl_cv_grep_gettimeofday = missing ; then printf "%s\n" "#define GETTOD_NOT_DECLARED 1" >>confdefs.h fi #-------------------------------------------------------------------- # The following code checks to see whether it is possible to get # signed chars on this platform. This is needed in order to # properly generate sign-extended ints from character values. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 printf %s "checking whether char is unsigned... " >&6; } if test ${ac_cv_c_char_unsigned+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_char_unsigned=no else case e in #( e) ac_cv_c_char_unsigned=yes ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes; then printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking signed char declarations" >&5 printf %s "checking signed char declarations... " >&6; } if test ${tcl_cv_char_signed+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { signed char *p; p = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_char_signed=yes else case e in #( e) tcl_cv_char_signed=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_char_signed" >&5 printf "%s\n" "$tcl_cv_char_signed" >&6; } if test $tcl_cv_char_signed = yes; then printf "%s\n" "#define HAVE_SIGNED_CHAR 1" >>confdefs.h fi #-------------------------------------------------------------------- # Does putenv() copy or not? We need to know to avoid memory leaks. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a putenv() that copies the buffer" >&5 printf %s "checking for a putenv() that copies the buffer... " >&6; } if test ${tcl_cv_putenv_copy+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : tcl_cv_putenv_copy=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #define OURVAR "havecopy=yes" int main (int argc, char *argv[]) { char *foo, *bar; foo = (char *)strdup(OURVAR); putenv(foo); strcpy((char *)(strchr(foo, '=') + 1), "no"); bar = getenv("havecopy"); if (!strcmp(bar, "no")) { /* doesnt copy */ return 0; } else { /* does copy */ return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO" then : tcl_cv_putenv_copy=no else case e in #( e) tcl_cv_putenv_copy=yes ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_putenv_copy" >&5 printf "%s\n" "$tcl_cv_putenv_copy" >&6; } if test $tcl_cv_putenv_copy = yes; then printf "%s\n" "#define HAVE_PUTENV_THAT_COPIES 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for support of nl_langinfo function #-------------------------------------------------------------------- # Check whether --enable-langinfo was given. if test ${enable_langinfo+y} then : enableval=$enable_langinfo; langinfo_ok=$enableval else case e in #( e) langinfo_ok=yes ;; esac fi HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes then : langinfo_ok=yes else case e in #( e) langinfo_ok=no ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use nl_langinfo" >&5 printf %s "checking whether to use nl_langinfo... " >&6; } if test "$langinfo_ok" = "yes"; then if test ${tcl_cv_langinfo_h+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { nl_langinfo(CODESET); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_langinfo_h=yes else case e in #( e) tcl_cv_langinfo_h=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_langinfo_h" >&5 printf "%s\n" "$tcl_cv_langinfo_h" >&6; } if test $tcl_cv_langinfo_h = yes; then printf "%s\n" "#define HAVE_LANGINFO 1" >>confdefs.h fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $langinfo_ok" >&5 printf "%s\n" "$langinfo_ok" >&6; } fi #-------------------------------------------------------------------- # Check for support of cfmakeraw, chflags and mkstemps functions #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "cfmakeraw" "ac_cv_func_cfmakeraw" if test "x$ac_cv_func_cfmakeraw" = xyes then : printf "%s\n" "#define HAVE_CFMAKERAW 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" if test "x$ac_cv_func_chflags" = xyes then : printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkstemps" "ac_cv_func_mkstemps" if test "x$ac_cv_func_mkstemps" = xyes then : printf "%s\n" "#define HAVE_MKSTEMPS 1" >>confdefs.h fi #-------------------------------------------------------------------- # Darwin specific API checks and defines #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then ac_fn_c_check_func "$LINENO" "getattrlist" "ac_cv_func_getattrlist" if test "x$ac_cv_func_getattrlist" = xyes then : printf "%s\n" "#define HAVE_GETATTRLIST 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "copyfile.h" "ac_cv_header_copyfile_h" "$ac_includes_default" if test "x$ac_cv_header_copyfile_h" = xyes then : printf "%s\n" "#define HAVE_COPYFILE_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "copyfile" "ac_cv_func_copyfile" if test "x$ac_cv_func_copyfile" = xyes then : printf "%s\n" "#define HAVE_COPYFILE 1" >>confdefs.h fi if test $tcl_corefoundation = yes; then ac_fn_c_check_header_compile "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default" if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes then : printf "%s\n" "#define HAVE_LIBKERN_OSATOMIC_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "OSSpinLockLock" "ac_cv_func_OSSpinLockLock" if test "x$ac_cv_func_OSSpinLockLock" = xyes then : printf "%s\n" "#define HAVE_OSSPINLOCKLOCK 1" >>confdefs.h fi fi printf "%s\n" "#define TCL_LOAD_FROM_MEMORY 1" >>confdefs.h printf "%s\n" "#define TCL_WIDE_CLICKS 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 printf %s "checking if weak import is available... " >&6; } if test ${tcl_cv_cc_weak_import+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int rand(void) __attribute__((weak_import)); int main (void) { rand(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cc_weak_import=yes else case e in #( e) tcl_cv_cc_weak_import=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 printf "%s\n" "$tcl_cv_cc_weak_import" >&6; } if test $tcl_cv_cc_weak_import = yes; then printf "%s\n" "#define HAVE_WEAK_IMPORT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 printf %s "checking if Darwin SUSv3 extensions are available... " >&6; } if test ${tcl_cv_cc_darwin_c_source+y} then : printf %s "(cached) " >&6 else case e in #( e) hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _DARWIN_C_SOURCE 1 #include int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : tcl_cv_cc_darwin_c_source=yes else case e in #( e) tcl_cv_cc_darwin_c_source=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$hold_cflags ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 printf "%s\n" "$tcl_cv_cc_darwin_c_source" >&6; } if test $tcl_cv_cc_darwin_c_source = yes; then printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h fi # Build .bundle dltest binaries in addition to .dylib DLTEST_LD='${CC} -bundle -Wl,-w ${CFLAGS} ${LDFLAGS}' DLTEST_SUFFIX=".bundle" else DLTEST_LD='${SHLIB_LD}' DLTEST_SUFFIX="" fi #-------------------------------------------------------------------- # Check for support of fts functions (readdir replacement) #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fts" >&5 printf %s "checking for fts... " >&6; } if test ${tcl_cv_api_fts+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { char*const p[2] = {"/", NULL}; FTS *f = fts_open(p, FTS_PHYSICAL|FTS_NOCHDIR|FTS_NOSTAT, NULL); FTSENT *e = fts_read(f); fts_close(f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_api_fts=yes else case e in #( e) tcl_cv_api_fts=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_api_fts" >&5 printf "%s\n" "$tcl_cv_api_fts" >&6; } if test $tcl_cv_api_fts = yes; then printf "%s\n" "#define HAVE_FTS 1" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below check for systems where POSIX-style non-blocking # I/O (O_NONBLOCK) doesn't work or is unimplemented. On these systems # (mostly older ones), use the old BSD-style FIONBIO approach instead. #-------------------------------------------------------------------- ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_filio_h" = xyes then : printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system version" >&5 printf %s "checking system version... " >&6; } if test ${tcl_cv_sys_version+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 printf "%s\n" "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 printf "%s\n" "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 printf %s "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O... " >&6; } case $system in OSF*) printf "%s\n" "#define USE_FIONBIO 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FIONBIO" >&5 printf "%s\n" "FIONBIO" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: O_NONBLOCK" >&5 printf "%s\n" "O_NONBLOCK" >&6; } ;; esac #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use dll unloading" >&5 printf %s "checking whether to use dll unloading... " >&6; } # Check whether --enable-dll-unloading was given. if test ${enable_dll_unloading+y} then : enableval=$enable_dll_unloading; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test $tcl_ok = yes; then printf "%s\n" "#define TCL_UNLOAD_DLLS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 printf "%s\n" "$tcl_ok" >&6; } #------------------------------------------------------------------------ # Check whether the timezone data is supplied by the OS or has # to be installed by Tcl. The default is autodetection, but can # be overridden on the configure command line either way. #------------------------------------------------------------------------ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timezone data" >&5 printf %s "checking for timezone data... " >&6; } # Check whether --with-tzdata was given. if test ${with_tzdata+y} then : withval=$with_tzdata; tcl_ok=$withval else case e in #( e) tcl_ok=auto ;; esac fi # # Any directories that get added here must also be added to the # search path in ::tcl::clock::Initialize (library/clock.tcl). # case $tcl_ok in no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by OS vendor" >&5 printf "%s\n" "supplied by OS vendor" >&6; } ;; yes) # nothing to do here ;; auto*) if test ${tcl_cv_dir_zoneinfo+y} then : printf %s "(cached) " >&6 else case e in #( e) for dir in /usr/share/zoneinfo \ /usr/share/lib/zoneinfo \ /usr/lib/zoneinfo do if test -f $dir/UTC -o -f $dir/GMT then tcl_cv_dir_zoneinfo="$dir" break fi done ;; esac fi if test -n "$tcl_cv_dir_zoneinfo"; then tcl_ok=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dir" >&5 printf "%s\n" "$dir" >&6; } else tcl_ok=yes fi ;; *) as_fn_error $? "invalid argument: $tcl_ok" "$LINENO" 5 ;; esac if test $tcl_ok = yes then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supplied by Tcl" >&5 printf "%s\n" "supplied by Tcl" >&6; } INSTALL_TZDATA=install-tzdata fi #-------------------------------------------------------------------- # DTrace support #-------------------------------------------------------------------- # Check whether --enable-dtrace was given. if test ${enable_dtrace+y} then : enableval=$enable_dtrace; tcl_ok=$enableval else case e in #( e) tcl_ok=no ;; esac fi if test $tcl_ok = yes; then ac_fn_c_check_header_compile "$LINENO" "sys/sdt.h" "ac_cv_header_sys_sdt_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sdt_h" = xyes then : tcl_ok=yes else case e in #( e) tcl_ok=no ;; esac fi fi if test $tcl_ok = yes; then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DTRACE+y} then : printf %s "(cached) " >&6 else case e in #( e) case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_DTRACE="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 printf "%s\n" "$DTRACE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$ac_cv_path_DTRACE" && tcl_ok=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable DTrace support" >&5 printf %s "checking whether to enable DTrace support... " >&6; } MAKEFILE_SHELL='/bin/sh' if test $tcl_ok = yes; then printf "%s\n" "#define USE_DTRACE 1" >>confdefs.h DTRACE_SRC="\${DTRACE_SRC}" DTRACE_HDR="\${DTRACE_HDR}" if test "`uname -s`" != "Darwin" ; then DTRACE_OBJ="\${DTRACE_OBJ}" if test "`uname -s`" = "SunOS" -a "$SHARED_BUILD" = "0" ; then # Need to create an intermediate object file to ensure tclDTrace.o # gets included when linking against the static tcl library. STLIB_LD='stlib_ld () { /usr/ccs/bin/ld -r -o $${1%.a}.o "$${@:2}" && '"${STLIB_LD}"' $${1} $${1%.a}.o ; } && stlib_ld' MAKEFILE_SHELL='/bin/bash' # Force use of Sun ar and ranlib, the GNU versions choke on # tclDTrace.o and the combined object file above. AR='/usr/ccs/bin/ar' RANLIB='/usr/ccs/bin/ranlib' fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_ok" >&5 printf "%s\n" "$tcl_ok" >&6; } #-------------------------------------------------------------------- # The check below checks whether the cpuid instruction is usable. #-------------------------------------------------------------------- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cpuid instruction is usable" >&5 printf %s "checking whether the cpuid instruction is usable... " >&6; } if test ${tcl_cv_cpuid+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { int index,regsPtr[4]; __asm__ __volatile__("mov %%ebx, %%edi \n\t" "cpuid \n\t" "mov %%ebx, %%esi \n\t" "mov %%edi, %%ebx \n\t" : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) : "a"(index) : "edi"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : tcl_cv_cpuid=yes else case e in #( e) tcl_cv_cpuid=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cpuid" >&5 printf "%s\n" "$tcl_cv_cpuid" >&6; } if test $tcl_cv_cpuid = yes; then printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h fi #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- TCL_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} TCL_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX} if test "$ac_cv_cygwin" = "yes" -a "$SHARED_BUILD" != "0"; then eval "TCL_LIB_FILE=cygtcl${LIB_SUFFIX}" EXTRA_INSTALL_BINARIES='$(INSTALL_LIBRARY) $(patsubst cyg%.dll,lib%.dll.a,${LIB_FILE}) "$(LIB_INSTALL_DIR)"' else eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}" fi # tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed # since on some platforms TCL_LIB_FILE contains shell escapes. # (See also: TCL_TRIM_DOTS). eval "TCL_LIB_FILE=${TCL_LIB_FILE}" test -z "$TCL_LIBRARY" && TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)' PRIVATE_INCLUDE_DIR='$(includedir)' HTML_DIR='$(DISTDIR)/html' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 printf %s "checking how to package libraries... " >&6; } # Check whether --enable-framework was given. if test ${enable_framework+y} then : enableval=$enable_framework; enable_framework=$enableval else case e in #( e) enable_framework=no ;; esac fi if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 printf "%s\n" "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 printf "%s\n" "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: framework" >&5 printf "%s\n" "framework" >&6; } FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 printf "%s\n" "shared library" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: static library" >&5 printf "%s\n" "static library" >&6; } fi FRAMEWORK_BUILD=0 fi fi TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xA000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' ac_config_files="$ac_config_files Tcl-Info.plist:../macosx/Tcl-Info.plist.in Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" TCL_YEAR="`date +%Y`" fi if test "$FRAMEWORK_BUILD" = "1" ; then printf "%s\n" "#define TCL_FRAMEWORK 1" >>confdefs.h # Construct a fake local framework structure to make linking with # '-framework Tcl' and running of tcltest work ac_config_commands="$ac_config_commands Tcl.framework" LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" # default install directory for bundled packages if test "${libdir}" = '${exec_prefix}/lib' -o "`basename ${libdir}`" = 'Frameworks'; then PACKAGE_DIR="/Library/Tcl" else PACKAGE_DIR="$libdir" fi if test "${libdir}" = '${exec_prefix}/lib'; then # override libdir default libdir="/Library/Frameworks" fi TCL_LIB_FILE="Tcl" TCL_LIB_FLAG="-framework Tcl" TCL_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tcl" TCL_LIB_SPEC="-F${libdir} -framework Tcl" libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" TCL_LIBRARY="${libdir}/Resources/Scripts" includedir="${libdir}/Headers" PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" EXTRA_INSTALL="install-private-headers html-tcl" EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)/TclTOC.html"' EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' # Don't use AC_DEFINE for the following as the framework version define # needs to go into the Makefile even when using autoheader, so that we # can pick up a potential make override of VERSION. Also, don't put this # into CFLAGS as it should not go into tclConfig.sh EXTRA_CC_SWITCHES='-DTCL_FRAMEWORK_VERSION=\"$(VERSION)\"' else # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" # default install directory for bundled packages PACKAGE_DIR="$libdir" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TCL_LIB_FLAG="-ltcl${TCL_VERSION}" else TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" fi VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" VERSION=${TCL_VERSION} #-------------------------------------------------------------------- # Zipfs support - Tip 430 #-------------------------------------------------------------------- # Check whether --enable-zipfs was given. if test ${enable_zipfs+y} then : enableval=$enable_zipfs; tcl_ok=$enableval else case e in #( e) tcl_ok=yes ;; esac fi if test "$tcl_ok" = "yes" -a "x$enable_framework" != "xyes"; then # # Find a native compiler # # Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD='$(CC)' else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc" >&5 printf %s "checking for gcc... " >&6; } if test ${ac_cv_path_cc+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/gcc 2> /dev/null` \ `ls -r $dir/gcc 2> /dev/null` ; do if test x"$ac_cv_path_cc" = x ; then if test -f "$j" ; then ac_cv_path_cc=$j break fi fi done done ;; esac fi fi fi # Also set EXEEXT_FOR_BUILD. if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' OBJEXT_FOR_BUILD='$(OBJEXT)' else OBJEXT_FOR_BUILD='.no' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5 printf %s "checking for build system executable suffix... " >&6; } if test ${bfd_cv_build_exeext+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f conftest* echo 'int main () { return 0; }' > conftest.c bfd_cv_build_exeext= ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; esac done rm -f conftest* test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5 printf "%s\n" "$bfd_cv_build_exeext" >&6; } EXEEXT_FOR_BUILD="" test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} fi # # Find a native zip implementation # MACHER_PROG="" ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macher" >&5 printf %s "checking for macher... " >&6; } if test ${ac_cv_path_macher+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/macher 2> /dev/null` \ `ls -r $dir/macher 2> /dev/null` ; do if test x"$ac_cv_path_macher" = x ; then if test -f "$j" ; then ac_cv_path_macher=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_macher" ; then MACHER_PROG="$ac_cv_path_macher" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHER_PROG" >&5 printf "%s\n" "$MACHER_PROG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Macher not found" >&5 printf "%s\n" "Macher not found" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zip" >&5 printf %s "checking for zip... " >&6; } if test ${ac_cv_path_zip+y} then : printf %s "(cached) " >&6 else case e in #( e) search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ;; esac fi if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5 printf "%s\n" "$ZIP_PROG" >&6; } ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5 printf "%s\n" "No zip found on PATH. Building minizip" >&6; } fi ZIPFS_BUILD=1 TCL_ZIP_FILE=libtcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_PATCH_LEVEL}.zip else ZIPFS_BUILD=0 TCL_ZIP_FILE= fi # Do checking message here to not mess up interleaved configure output { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for building with zipfs" >&5 printf %s "checking for building with zipfs... " >&6; } if test "${ZIPFS_BUILD}" = 1; then if test "${SHARED_BUILD}" = 0; then ZIPFS_BUILD=2; printf "%s\n" "#define ZIPFS_BUILD 2" >>confdefs.h else printf "%s\n" "#define ZIPFS_BUILD 1" >>confdefs.h \ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } INSTALL_LIBRARIES=install-libraries INSTALL_MSGS=install-msgs fi # Point to tcl script library if we are not embedding it. if test "${ZIPFS_BUILD}" = 0; then TCL_BUILDTIME_LIBRARY=${TCL_SRC_DIR}/library fi #-------------------------------------------------------------------- # The statements below define the symbol TCL_PACKAGE_PATH, which # gives a list of directories that may contain packages. The list # consists of one directory for machine-dependent binaries and # another for platform-independent scripts. #-------------------------------------------------------------------- if test "$FRAMEWORK_BUILD" = "1" ; then test -z "$TCL_PACKAGE_PATH" && \ TCL_PACKAGE_PATH="~/Library/Tcl:/Library/Tcl:~/Library/Frameworks:/Library/Frameworks" test -z "$TCL_MODULE_PATH" && \ TCL_MODULE_PATH="~/Library/Tcl:/Library/Tcl" elif test "$prefix/lib" != "$libdir"; then test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" else test -z "$TCL_PACKAGE_PATH" && TCL_PACKAGE_PATH="${prefix}/lib" fi #-------------------------------------------------------------------- # The statements below define various symbols relating to Tcl # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TCL_VERSION} # double-eval to account for TCL_TRIM_DOTS. # eval "TCL_STUB_LIB_FILE=libtclstub.a" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_DIR=\"${libdir}\"" TCL_STUB_LIB_FLAG="-ltclstub" TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} ac_config_files="$ac_config_files Makefile:../unix/Makefile.in dltest/Makefile:../unix/dltest/Makefile.in tclConfig.sh:../unix/tclConfig.sh.in tcl.pc:../unix/tcl.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # '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" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H DEFS="-DHAVE_TCL_CONFIG_H -imacros tclConfig.h" CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tcl $as_me 9.0, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ tcl config.status 9.0 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # VERSION=${TCL_VERSION} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "tclConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS tclConfig.h:../unix/tclConfig.h.in" ;; "Tcl-Info.plist") CONFIG_FILES="$CONFIG_FILES Tcl-Info.plist:../macosx/Tcl-Info.plist.in" ;; "Tclsh-Info.plist") CONFIG_FILES="$CONFIG_FILES Tclsh-Info.plist:../macosx/Tclsh-Info.plist.in" ;; "Tcl.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tcl.framework" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; "dltest/Makefile") CONFIG_FILES="$CONFIG_FILES dltest/Makefile:../unix/dltest/Makefile.in" ;; "tclConfig.sh") CONFIG_FILES="$CONFIG_FILES tclConfig.sh:../unix/tclConfig.sh.in" ;; "tcl.pc") CONFIG_FILES="$CONFIG_FILES tcl.pc:../unix/tcl.pc.in" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "Tcl.framework":C) n=Tcl && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && unset n f v ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tcl9.0.3/license.terms0000644000175000017500000000431715076154263014262 0ustar sergeisergeiThis software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. tcl9.0.3/libtommath/0000755000175000017500000000000015104662543013714 5ustar sergeisergeitcl9.0.3/libtommath/win64-arm/0000755000175000017500000000000015104662543015440 5ustar sergeisergeitcl9.0.3/libtommath/win64-arm/tommath.lib0000664000175000017500000007131215104661341017602 0ustar sergeisergei! / 1711619299 0 5884 ` 1.013R3R334 4 44445X5X556&6&66667b7b778484889 9 9t9t99:J:J::;;;;;; > >t>t>>?J?J??@ @ @@@@A`A`AAB0B0BBCCCrCrCCDDDDDDEEEEEEFfFfFFGBGBGGHHHzHzHHIRIRIIJ(J(JJKKKlKlKKLHLHLLM M MMMMN`N`NNO6O6OOP P PpPpPPQBQBQQRRRzRzRRSbSbSSTJTJTTUUUUUUVTVTVVW W WWWWXfXfXXYTYTYYZ>Z>ZZ[([([[\\\~\~\\]V]V]]^0^0^^______`h`h``a>a>aabbbxbxbbcLcLccddddddededeef8f8ffg g gvgvgghJhJhhiiiiiijZjZjjk0k0kklllplpllm@m@mmnnnnnnododoopDpDppqqqqqqr\r\__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA__imp_mp_2exptmp_2expt__imp_mp_absmp_abs__imp_mp_addmp_add__imp_mp_add_dmp_add_d__imp_mp_addmodmp_addmod__imp_mp_andmp_and__imp_mp_clampmp_clamp__imp_mp_clearmp_clear__imp_mp_clear_multimp_clear_multi__imp_mp_cmpmp_cmp__imp_mp_cmp_dmp_cmp_d__imp_mp_cmp_magmp_cmp_mag__imp_mp_cnt_lsbmp_cnt_lsb__imp_mp_complementmp_complement__imp_mp_copymp_copy__imp_mp_count_bitsmp_count_bits__imp_mp_decrmp_decr__imp_mp_divmp_div__imp_mp_div_2mp_div_2__imp_mp_div_2dmp_div_2d__imp_mp_div_3mp_div_3__imp_mp_div_dmp_div_d__imp_mp_dr_is_modulusmp_dr_is_modulus__imp_mp_dr_reducemp_dr_reduce__imp_mp_dr_setupmp_dr_setup__imp_mp_error_to_stringmp_error_to_string__imp_mp_exchmp_exch__imp_mp_expt_nmp_expt_n__imp_mp_expt_u32mp_expt_u32__imp_mp_exptmodmp_exptmod__imp_mp_exteuclidmp_exteuclid__imp_mp_freadmp_fread__imp_mp_from_sbinmp_from_sbin__imp_mp_from_ubinmp_from_ubin__imp_mp_fwritemp_fwrite__imp_mp_gcdmp_gcd__imp_mp_get_doublemp_get_double__imp_mp_get_i32mp_get_i32__imp_mp_get_i64mp_get_i64__imp_mp_get_intmp_get_int__imp_mp_get_lmp_get_l__imp_mp_get_llmp_get_ll__imp_mp_get_longmp_get_long__imp_mp_get_long_longmp_get_long_long__imp_mp_get_mag_u32mp_get_mag_u32__imp_mp_get_mag_u64mp_get_mag_u64__imp_mp_get_mag_ulmp_get_mag_ul__imp_mp_get_mag_ullmp_get_mag_ull__imp_mp_growmp_grow__imp_mp_incrmp_incr__imp_mp_initmp_init__imp_mp_init_copymp_init_copy__imp_mp_init_i32mp_init_i32__imp_mp_init_i64mp_init_i64__imp_mp_init_lmp_init_l__imp_mp_init_llmp_init_ll__imp_mp_init_multimp_init_multi__imp_mp_init_setmp_init_set__imp_mp_init_set_intmp_init_set_int__imp_mp_init_sizemp_init_size__imp_mp_init_u32mp_init_u32__imp_mp_init_u64mp_init_u64__imp_mp_init_ulmp_init_ul__imp_mp_init_ullmp_init_ull__imp_mp_invmodmp_invmod__imp_mp_is_squaremp_is_square__imp_mp_isevenmp_iseven__imp_mp_isoddmp_isodd__imp_mp_kroneckermp_kronecker__imp_mp_lcmmp_lcm__imp_mp_log_nmp_log_n__imp_mp_log_u32mp_log_u32__imp_mp_lshdmp_lshd__imp_mp_modmp_mod__imp_mp_mod_2dmp_mod_2d__imp_mp_mod_dmp_mod_d__imp_mp_montgomery_calc_normalizationmp_montgomery_calc_normalization__imp_mp_montgomery_reducemp_montgomery_reduce__imp_mp_montgomery_setupmp_montgomery_setup__imp_mp_mulmp_mul__imp_mp_mul_2mp_mul_2__imp_mp_mul_2dmp_mul_2d__imp_mp_mul_dmp_mul_d__imp_mp_mulmodmp_mulmod__imp_mp_negmp_neg__imp_mp_ormp_or__imp_mp_packmp_pack__imp_mp_pack_countmp_pack_count__imp_mp_prime_fermatmp_prime_fermat__imp_mp_prime_frobenius_underwoodmp_prime_frobenius_underwood__imp_mp_prime_is_primemp_prime_is_prime__imp_mp_prime_miller_rabinmp_prime_miller_rabin__imp_mp_prime_next_primemp_prime_next_prime__imp_mp_prime_rabin_miller_trialsmp_prime_rabin_miller_trials__imp_mp_prime_randmp_prime_rand__imp_mp_prime_strong_lucas_selfridgemp_prime_strong_lucas_selfridge__imp_mp_radix_sizemp_radix_size__imp_mp_randmp_rand__imp_mp_read_radixmp_read_radix__imp_mp_reducemp_reduce__imp_mp_reduce_2kmp_reduce_2k__imp_mp_reduce_2k_lmp_reduce_2k_l__imp_mp_reduce_2k_setupmp_reduce_2k_setup__imp_mp_reduce_2k_setup_lmp_reduce_2k_setup_l__imp_mp_reduce_is_2kmp_reduce_is_2k__imp_mp_reduce_is_2k_lmp_reduce_is_2k_l__imp_mp_reduce_setupmp_reduce_setup__imp_mp_root_nmp_root_n__imp_mp_root_u32mp_root_u32__imp_mp_rshdmp_rshd__imp_mp_sbin_sizemp_sbin_size__imp_mp_setmp_set__imp_mp_set_i32mp_set_i32__imp_mp_set_i64mp_set_i64__imp_mp_set_intmp_set_int__imp_mp_set_lmp_set_l__imp_mp_set_llmp_set_ll__imp_mp_set_longmp_set_long__imp_mp_set_long_longmp_set_long_long__imp_mp_set_u32mp_set_u32__imp_mp_set_u64mp_set_u64__imp_mp_set_ulmp_set_ul__imp_mp_set_ullmp_set_ull__imp_mp_shrinkmp_shrink__imp_mp_signed_rshmp_signed_rsh__imp_mp_sqrmp_sqr__imp_mp_sqrmodmp_sqrmod__imp_mp_sqrtmp_sqrt__imp_mp_sqrtmod_primemp_sqrtmod_prime__imp_mp_submp_sub__imp_mp_sub_dmp_sub_d__imp_mp_submodmp_submod__imp_mp_to_radixmp_to_radix__imp_mp_to_sbinmp_to_sbin__imp_mp_to_ubinmp_to_ubin__imp_mp_ubin_sizemp_ubin_size__imp_mp_unpackmp_unpack__imp_mp_xormp_xor__imp_mp_zeromp_zero__imp_s_mp_adds_mp_add__imp_s_mp_balance_muls_mp_balance_mul__imp_s_mp_karatsuba_muls_mp_karatsuba_mul__imp_s_mp_karatsuba_sqrs_mp_karatsuba_sqr__imp_s_mp_mul_digss_mp_mul_digs__imp_s_mp_mul_digs_fasts_mp_mul_digs_fast__imp_s_mp_reverses_mp_reverse__imp_s_mp_sqrs_mp_sqr__imp_s_mp_sqr_fasts_mp_sqr_fast__imp_s_mp_subs_mp_sub__imp_s_mp_toom_muls_mp_toom_mul__imp_s_mp_toom_sqrs_mp_toom_sqr/ 1711619299 0 5894 ` .01R33 444X55&666b77488 9t99J::;;;R<<.== >t>>J?? @@@`AA0BBCrCCDDDEEEfFFBGGHzHHRII(JJKlKKHLL MMM`NN6OO PpPPBQQRzRRbSSJTTUUUTVV WWWfXXTYY>ZZ([[\~\\V]]0^^___h``>aabxbbLccddddee8ff gvggJhhiiiZjj0kklpll@mmnnndooDppqqq\r1  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTOR__imp_mp_2expt__imp_mp_abs__imp_mp_add__imp_mp_add_d__imp_mp_addmod__imp_mp_and__imp_mp_clamp__imp_mp_clear__imp_mp_clear_multi__imp_mp_cmp__imp_mp_cmp_d__imp_mp_cmp_mag__imp_mp_cnt_lsb__imp_mp_complement__imp_mp_copy__imp_mp_count_bits__imp_mp_decr__imp_mp_div__imp_mp_div_2__imp_mp_div_2d__imp_mp_div_3__imp_mp_div_d__imp_mp_dr_is_modulus__imp_mp_dr_reduce__imp_mp_dr_setup__imp_mp_error_to_string__imp_mp_exch__imp_mp_expt_n__imp_mp_expt_u32__imp_mp_exptmod__imp_mp_exteuclid__imp_mp_fread__imp_mp_from_sbin__imp_mp_from_ubin__imp_mp_fwrite__imp_mp_gcd__imp_mp_get_double__imp_mp_get_i32__imp_mp_get_i64__imp_mp_get_int__imp_mp_get_l__imp_mp_get_ll__imp_mp_get_long__imp_mp_get_long_long__imp_mp_get_mag_u32__imp_mp_get_mag_u64__imp_mp_get_mag_ul__imp_mp_get_mag_ull__imp_mp_grow__imp_mp_incr__imp_mp_init__imp_mp_init_copy__imp_mp_init_i32__imp_mp_init_i64__imp_mp_init_l__imp_mp_init_ll__imp_mp_init_multi__imp_mp_init_set__imp_mp_init_set_int__imp_mp_init_size__imp_mp_init_u32__imp_mp_init_u64__imp_mp_init_ul__imp_mp_init_ull__imp_mp_invmod__imp_mp_is_square__imp_mp_iseven__imp_mp_isodd__imp_mp_kronecker__imp_mp_lcm__imp_mp_log_n__imp_mp_log_u32__imp_mp_lshd__imp_mp_mod__imp_mp_mod_2d__imp_mp_mod_d__imp_mp_montgomery_calc_normalization__imp_mp_montgomery_reduce__imp_mp_montgomery_setup__imp_mp_mul__imp_mp_mul_2__imp_mp_mul_2d__imp_mp_mul_d__imp_mp_mulmod__imp_mp_neg__imp_mp_or__imp_mp_pack__imp_mp_pack_count__imp_mp_prime_fermat__imp_mp_prime_frobenius_underwood__imp_mp_prime_is_prime__imp_mp_prime_miller_rabin__imp_mp_prime_next_prime__imp_mp_prime_rabin_miller_trials__imp_mp_prime_rand__imp_mp_prime_strong_lucas_selfridge__imp_mp_radix_size__imp_mp_rand__imp_mp_read_radix__imp_mp_reduce__imp_mp_reduce_2k__imp_mp_reduce_2k_l__imp_mp_reduce_2k_setup__imp_mp_reduce_2k_setup_l__imp_mp_reduce_is_2k__imp_mp_reduce_is_2k_l__imp_mp_reduce_setup__imp_mp_root_n__imp_mp_root_u32__imp_mp_rshd__imp_mp_sbin_size__imp_mp_set__imp_mp_set_i32__imp_mp_set_i64__imp_mp_set_int__imp_mp_set_l__imp_mp_set_ll__imp_mp_set_long__imp_mp_set_long_long__imp_mp_set_u32__imp_mp_set_u64__imp_mp_set_ul__imp_mp_set_ull__imp_mp_shrink__imp_mp_signed_rsh__imp_mp_sqr__imp_mp_sqrmod__imp_mp_sqrt__imp_mp_sqrtmod_prime__imp_mp_sub__imp_mp_sub_d__imp_mp_submod__imp_mp_to_radix__imp_mp_to_sbin__imp_mp_to_ubin__imp_mp_ubin_size__imp_mp_unpack__imp_mp_xor__imp_mp_zero__imp_s_mp_add__imp_s_mp_balance_mul__imp_s_mp_karatsuba_mul__imp_s_mp_karatsuba_sqr__imp_s_mp_mul_digs__imp_s_mp_mul_digs_fast__imp_s_mp_reverse__imp_s_mp_sqr__imp_s_mp_sqr_fast__imp_s_mp_sub__imp_s_mp_toom_mul__imp_s_mp_toom_sqrmp_2exptmp_absmp_addmp_add_dmp_addmodmp_andmp_clampmp_clearmp_clear_multimp_cmpmp_cmp_dmp_cmp_magmp_cnt_lsbmp_complementmp_copymp_count_bitsmp_decrmp_divmp_div_2mp_div_2dmp_div_3mp_div_dmp_dr_is_modulusmp_dr_reducemp_dr_setupmp_error_to_stringmp_exchmp_expt_nmp_expt_u32mp_exptmodmp_exteuclidmp_freadmp_from_sbinmp_from_ubinmp_fwritemp_gcdmp_get_doublemp_get_i32mp_get_i64mp_get_intmp_get_lmp_get_llmp_get_longmp_get_long_longmp_get_mag_u32mp_get_mag_u64mp_get_mag_ulmp_get_mag_ullmp_growmp_incrmp_initmp_init_copymp_init_i32mp_init_i64mp_init_lmp_init_llmp_init_multimp_init_setmp_init_set_intmp_init_sizemp_init_u32mp_init_u64mp_init_ulmp_init_ullmp_invmodmp_is_squaremp_isevenmp_isoddmp_kroneckermp_lcmmp_log_nmp_log_u32mp_lshdmp_modmp_mod_2dmp_mod_dmp_montgomery_calc_normalizationmp_montgomery_reducemp_montgomery_setupmp_mulmp_mul_2mp_mul_2dmp_mul_dmp_mulmodmp_negmp_ormp_packmp_pack_countmp_prime_fermatmp_prime_frobenius_underwoodmp_prime_is_primemp_prime_miller_rabinmp_prime_next_primemp_prime_rabin_miller_trialsmp_prime_randmp_prime_strong_lucas_selfridgemp_radix_sizemp_randmp_read_radixmp_reducemp_reduce_2kmp_reduce_2k_lmp_reduce_2k_setupmp_reduce_2k_setup_lmp_reduce_is_2kmp_reduce_is_2k_lmp_reduce_setupmp_root_nmp_root_u32mp_rshdmp_sbin_sizemp_setmp_set_i32mp_set_i64mp_set_intmp_set_lmp_set_llmp_set_longmp_set_long_longmp_set_u32mp_set_u64mp_set_ulmp_set_ullmp_shrinkmp_signed_rshmp_sqrmp_sqrmodmp_sqrtmp_sqrtmod_primemp_submp_sub_dmp_submodmp_to_radixmp_to_sbinmp_to_ubinmp_ubin_sizemp_unpackmp_xormp_zeros_mp_adds_mp_balance_muls_mp_karatsuba_muls_mp_karatsuba_sqrs_mp_mul_digss_mp_mul_digs_fasts_mp_reverses_mp_sqrs_mp_sqr_fasts_mp_subs_mp_toom_muls_mp_toom_sqrlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619299 0 506 ` d<f.debug$SD@B.idata$2@0.idata$6@  libtommath.dll'iMicrosoft (R) LINK libtommath.dll@comp.idi.idata$2@h.idata$6.idata$4@h.idata$5@h#<X__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619299 0 253 ` d<f.debug$SDd@B.idata$3@0 libtommath.dll'iMicrosoft (R) LINK@comp.idi__NULL_IMPORT_DESCRIPTOR libtommath.dll/ 1711619299 0 292 ` d<f.debug$SD@B.idata$5@@.idata$4@@ libtommath.dll'iMicrosoft (R) LINK@comp.idi libtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619299 0 44 ` d<fmp_2exptlibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<fmp_abslibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<fmp_addlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_add_dlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fmp_addmodlibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fmp_andlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_clamplibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_clearlibtommath.dlllibtommath.dll/ 1711619299 0 50 ` d<fmp_clear_multilibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<f mp_cmplibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<f mp_cmp_dlibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<f mp_cmp_maglibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<f mp_cnt_lsblibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<f mp_complementlibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<fmp_copylibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<fmp_count_bitslibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<fmp_decrlibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fmp_divlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_div_2libtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fmp_div_2dlibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fmp_div_3libtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_div_dlibtommath.dlllibtommath.dll/ 1711619299 0 52 ` d<f mp_dr_is_moduluslibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<fmp_dr_reducelibtommath.dlllibtommath.dll/ 1711619299 0 47 ` d<fmp_dr_setuplibtommath.dll libtommath.dll/ 1711619299 0 54 ` d<f"mp_error_to_stringlibtommath.dlllibtommath.dll/ 1711619299 0 43 ` d<fmp_exchlibtommath.dll libtommath.dll/ 1711619299 0 45 ` d<fmp_expt_nlibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<fmp_expt_u32libtommath.dll libtommath.dll/ 1711619299 0 46 ` d<fmp_exptmodlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<fmp_exteuclidlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_freadlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<f mp_from_sbinlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<f!mp_from_ubinlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<f"mp_fwritelibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<f#mp_gcdlibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<f$mp_get_doublelibtommath.dll libtommath.dll/ 1711619299 0 46 ` d<f%mp_get_i32libtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<f&mp_get_i64libtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<f'mp_get_intlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<f(mp_get_llibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<f)mp_get_lllibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<f*mp_get_longlibtommath.dll libtommath.dll/ 1711619299 0 52 ` d<f +mp_get_long_longlibtommath.dlllibtommath.dll/ 1711619299 0 50 ` d<f,mp_get_mag_u32libtommath.dlllibtommath.dll/ 1711619299 0 50 ` d<f-mp_get_mag_u64libtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<f.mp_get_mag_ullibtommath.dll libtommath.dll/ 1711619299 0 50 ` d<f/mp_get_mag_ulllibtommath.dlllibtommath.dll/ 1711619299 0 43 ` d<f0mp_growlibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<f1mp_incrlibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<f2mp_initlibtommath.dll libtommath.dll/ 1711619299 0 48 ` d<f3mp_init_copylibtommath.dlllibtommath.dll/ 1711619299 0 47 ` d<f4mp_init_i32libtommath.dll libtommath.dll/ 1711619299 0 47 ` d<f5mp_init_i64libtommath.dll libtommath.dll/ 1711619299 0 45 ` d<f6mp_init_llibtommath.dll libtommath.dll/ 1711619299 0 46 ` d<f7mp_init_lllibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<f8mp_init_multilibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<f9mp_init_setlibtommath.dll libtommath.dll/ 1711619299 0 51 ` d<f:mp_init_set_intlibtommath.dll libtommath.dll/ 1711619299 0 48 ` d<f;mp_init_sizelibtommath.dlllibtommath.dll/ 1711619299 0 47 ` d<f<mp_init_u32libtommath.dll libtommath.dll/ 1711619299 0 47 ` d<f=mp_init_u64libtommath.dll libtommath.dll/ 1711619299 0 46 ` d<f>mp_init_ullibtommath.dlllibtommath.dll/ 1711619299 0 47 ` d<f?mp_init_ulllibtommath.dll libtommath.dll/ 1711619299 0 45 ` d<f@mp_invmodlibtommath.dll libtommath.dll/ 1711619299 0 48 ` d<fAmp_is_squarelibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fBmp_isevenlibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fCmp_isoddlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<fDmp_kroneckerlibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<fEmp_lcmlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fFmp_log_nlibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fGmp_log_u32libtommath.dlllibtommath.dll/ 1711619299 0 43 ` d<fHmp_lshdlibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fImp_modlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fJmp_mod_2dlibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fKmp_mod_dlibtommath.dlllibtommath.dll/ 1711619299 0 68 ` d<f0Lmp_montgomery_calc_normalizationlibtommath.dlllibtommath.dll/ 1711619299 0 56 ` d<f$Mmp_montgomery_reducelibtommath.dlllibtommath.dll/ 1711619299 0 55 ` d<f#Nmp_montgomery_setuplibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fOmp_mullibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fPmp_mul_2libtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fQmp_mul_2dlibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fRmp_mul_dlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fSmp_mulmodlibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fTmp_neglibtommath.dlllibtommath.dll/ 1711619299 0 41 ` d<fUmp_orlibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<fVmp_packlibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<fWmp_pack_countlibtommath.dll libtommath.dll/ 1711619299 0 51 ` d<fXmp_prime_fermatlibtommath.dll libtommath.dll/ 1711619299 0 64 ` d<f,Ymp_prime_frobenius_underwoodlibtommath.dlllibtommath.dll/ 1711619299 0 53 ` d<f!Zmp_prime_is_primelibtommath.dll libtommath.dll/ 1711619299 0 57 ` d<f%[mp_prime_miller_rabinlibtommath.dll libtommath.dll/ 1711619299 0 55 ` d<f#\mp_prime_next_primelibtommath.dll libtommath.dll/ 1711619299 0 64 ` d<f,]mp_prime_rabin_miller_trialslibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<f^mp_prime_randlibtommath.dll libtommath.dll/ 1711619299 0 67 ` d<f/_mp_prime_strong_lucas_selfridgelibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<f`mp_radix_sizelibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<famp_randlibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<fbmp_read_radixlibtommath.dll libtommath.dll/ 1711619299 0 45 ` d<fcmp_reducelibtommath.dll libtommath.dll/ 1711619299 0 48 ` d<fdmp_reduce_2klibtommath.dlllibtommath.dll/ 1711619299 0 50 ` d<femp_reduce_2k_llibtommath.dlllibtommath.dll/ 1711619299 0 54 ` d<f"fmp_reduce_2k_setuplibtommath.dlllibtommath.dll/ 1711619299 0 56 ` d<f$gmp_reduce_2k_setup_llibtommath.dlllibtommath.dll/ 1711619299 0 51 ` d<fhmp_reduce_is_2klibtommath.dll libtommath.dll/ 1711619299 0 53 ` d<f!imp_reduce_is_2k_llibtommath.dll libtommath.dll/ 1711619299 0 51 ` d<fjmp_reduce_setuplibtommath.dll libtommath.dll/ 1711619299 0 45 ` d<fkmp_root_nlibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<flmp_root_u32libtommath.dll libtommath.dll/ 1711619299 0 43 ` d<fmmp_rshdlibtommath.dll libtommath.dll/ 1711619299 0 48 ` d<fnmp_sbin_sizelibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<fomp_setlibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fpmp_set_i32libtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fqmp_set_i64libtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<frmp_set_intlibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fsmp_set_llibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<ftmp_set_lllibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<fump_set_longlibtommath.dll libtommath.dll/ 1711619299 0 52 ` d<f vmp_set_long_longlibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fwmp_set_u32libtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fxmp_set_u64libtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fymp_set_ullibtommath.dll libtommath.dll/ 1711619299 0 46 ` d<fzmp_set_ulllibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<f{mp_shrinklibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<f|mp_signed_rshlibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<f}mp_sqrlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<f~mp_sqrmodlibtommath.dll libtommath.dll/ 1711619299 0 43 ` d<fmp_sqrtlibtommath.dll libtommath.dll/ 1711619299 0 52 ` d<f mp_sqrtmod_primelibtommath.dlllibtommath.dll/ 1711619299 0 42 ` d<fmp_sublibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fmp_sub_dlibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fmp_submodlibtommath.dll libtommath.dll/ 1711619299 0 47 ` d<fmp_to_radixlibtommath.dll libtommath.dll/ 1711619299 0 46 ` d<fmp_to_sbinlibtommath.dlllibtommath.dll/ 1711619299 0 46 ` d<fmp_to_ubinlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<fmp_ubin_sizelibtommath.dlllibtommath.dll/ 1711619299 0 45 ` d<fmp_unpacklibtommath.dll libtommath.dll/ 1711619299 0 42 ` d<fmp_xorlibtommath.dlllibtommath.dll/ 1711619299 0 43 ` d<fmp_zerolibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fs_mp_addlibtommath.dlllibtommath.dll/ 1711619299 0 52 ` d<f s_mp_balance_mullibtommath.dlllibtommath.dll/ 1711619299 0 54 ` d<f"s_mp_karatsuba_mullibtommath.dlllibtommath.dll/ 1711619299 0 54 ` d<f"s_mp_karatsuba_sqrlibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<fs_mp_mul_digslibtommath.dll libtommath.dll/ 1711619299 0 54 ` d<f"s_mp_mul_digs_fastlibtommath.dlllibtommath.dll/ 1711619299 0 48 ` d<fs_mp_reverselibtommath.dlllibtommath.dll/ 1711619299 0 44 ` d<fs_mp_sqrlibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<fs_mp_sqr_fastlibtommath.dll libtommath.dll/ 1711619299 0 44 ` d<fs_mp_sublibtommath.dlllibtommath.dll/ 1711619299 0 49 ` d<fs_mp_toom_mullibtommath.dll libtommath.dll/ 1711619299 0 49 ` d<fs_mp_toom_sqrlibtommath.dll tcl9.0.3/libtommath/win64-arm/libtommath.dll.a0000664000175000017500000005371615104661341020525 0ustar sergeisergei! / 0 0 0 0 5736 ` )d jj66nn>>zzNN $ $ !`!`!!"2"2""###r#r##$J$J$$%$%$%%%%&f&f&&':':''(((v(v(()N)N))*"*"****+`+`++,>,>,,------.X.X../,/,//000n0n001F1F112"2"22223f3f334<4<44555|5|556P6P667 7 77778X8X889@9@99:(:(::::;`;`;;<2<2<<<<=f=f==>D>D>>?2?2??@@@@AAAAAAB\B\BBC4C4CCDDDDDDEdEdEEFFFFFFGGGGGGHVHVHHI*I*IIIIJhJhJJKBKBKKLLLLLLMXMXMMN(N(NNOOOfOfOOP8P8PPQQQxQxQQRNRNRRSSSSSSThThTTUHUHUUVVVVVVW`W`__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA__imp_mp_2exptmp_2expt__imp_mp_absmp_abs__imp_mp_addmp_add__imp_mp_add_dmp_add_d__imp_mp_addmodmp_addmod__imp_mp_andmp_and__imp_mp_clampmp_clamp__imp_mp_clearmp_clear__imp_mp_clear_multimp_clear_multi__imp_mp_cmpmp_cmp__imp_mp_cmp_dmp_cmp_d__imp_mp_cmp_magmp_cmp_mag__imp_mp_cnt_lsbmp_cnt_lsb__imp_mp_complementmp_complement__imp_mp_copymp_copy__imp_mp_count_bitsmp_count_bits__imp_mp_decrmp_decr__imp_mp_divmp_div__imp_mp_div_2mp_div_2__imp_mp_div_2dmp_div_2d__imp_mp_div_3mp_div_3__imp_mp_div_dmp_div_d__imp_mp_dr_is_modulusmp_dr_is_modulus__imp_mp_dr_reducemp_dr_reduce__imp_mp_dr_setupmp_dr_setup__imp_mp_error_to_stringmp_error_to_string__imp_mp_exchmp_exch__imp_mp_expt_u32mp_expt_u32__imp_mp_exptmodmp_exptmod__imp_mp_exteuclidmp_exteuclid__imp_mp_freadmp_fread__imp_mp_from_sbinmp_from_sbin__imp_mp_from_ubinmp_from_ubin__imp_mp_fwritemp_fwrite__imp_mp_gcdmp_gcd__imp_mp_get_doublemp_get_double__imp_mp_get_i32mp_get_i32__imp_mp_get_i64mp_get_i64__imp_mp_get_intmp_get_int__imp_mp_get_lmp_get_l__imp_mp_get_llmp_get_ll__imp_mp_get_longmp_get_long__imp_mp_get_long_longmp_get_long_long__imp_mp_get_mag_u32mp_get_mag_u32__imp_mp_get_mag_u64mp_get_mag_u64__imp_mp_get_mag_ulmp_get_mag_ul__imp_mp_get_mag_ullmp_get_mag_ull__imp_mp_growmp_grow__imp_mp_incrmp_incr__imp_mp_initmp_init__imp_mp_init_copymp_init_copy__imp_mp_init_i32mp_init_i32__imp_mp_init_i64mp_init_i64__imp_mp_init_lmp_init_l__imp_mp_init_llmp_init_ll__imp_mp_init_multimp_init_multi__imp_mp_init_setmp_init_set__imp_mp_init_set_intmp_init_set_int__imp_mp_init_sizemp_init_size__imp_mp_init_u32mp_init_u32__imp_mp_init_u64mp_init_u64__imp_mp_init_ulmp_init_ul__imp_mp_init_ullmp_init_ull__imp_mp_invmodmp_invmod__imp_mp_is_squaremp_is_square__imp_mp_isevenmp_iseven__imp_mp_isoddmp_isodd__imp_mp_kroneckermp_kronecker__imp_mp_lcmmp_lcm__imp_mp_log_u32mp_log_u32__imp_mp_lshdmp_lshd__imp_mp_modmp_mod__imp_mp_mod_2dmp_mod_2d__imp_mp_mod_dmp_mod_d__imp_mp_montgomery_calc_normalizationmp_montgomery_calc_normalization__imp_mp_montgomery_reducemp_montgomery_reduce__imp_mp_montgomery_setupmp_montgomery_setup__imp_mp_mulmp_mul__imp_mp_mul_2mp_mul_2__imp_mp_mul_2dmp_mul_2d__imp_mp_mul_dmp_mul_d__imp_mp_mulmodmp_mulmod__imp_mp_negmp_neg__imp_mp_ormp_or__imp_mp_packmp_pack__imp_mp_pack_countmp_pack_count__imp_mp_prime_fermatmp_prime_fermat__imp_mp_prime_frobenius_underwoodmp_prime_frobenius_underwood__imp_mp_prime_is_primemp_prime_is_prime__imp_mp_prime_miller_rabinmp_prime_miller_rabin__imp_mp_prime_next_primemp_prime_next_prime__imp_mp_prime_rabin_miller_trialsmp_prime_rabin_miller_trials__imp_mp_prime_randmp_prime_rand__imp_mp_prime_strong_lucas_selfridgemp_prime_strong_lucas_selfridge__imp_mp_radix_sizemp_radix_size__imp_mp_randmp_rand__imp_mp_read_radixmp_read_radix__imp_mp_reducemp_reduce__imp_mp_reduce_2kmp_reduce_2k__imp_mp_reduce_2k_lmp_reduce_2k_l__imp_mp_reduce_2k_setupmp_reduce_2k_setup__imp_mp_reduce_2k_setup_lmp_reduce_2k_setup_l__imp_mp_reduce_is_2kmp_reduce_is_2k__imp_mp_reduce_is_2k_lmp_reduce_is_2k_l__imp_mp_reduce_setupmp_reduce_setup__imp_mp_root_u32mp_root_u32__imp_mp_rshdmp_rshd__imp_mp_sbin_sizemp_sbin_size__imp_mp_setmp_set__imp_mp_set_i32mp_set_i32__imp_mp_set_i64mp_set_i64__imp_mp_set_intmp_set_int__imp_mp_set_lmp_set_l__imp_mp_set_llmp_set_ll__imp_mp_set_longmp_set_long__imp_mp_set_long_longmp_set_long_long__imp_mp_set_u32mp_set_u32__imp_mp_set_u64mp_set_u64__imp_mp_set_ulmp_set_ul__imp_mp_set_ullmp_set_ull__imp_mp_shrinkmp_shrink__imp_mp_signed_rshmp_signed_rsh__imp_mp_sqrmp_sqr__imp_mp_sqrmodmp_sqrmod__imp_mp_sqrtmp_sqrt__imp_mp_sqrtmod_primemp_sqrtmod_prime__imp_mp_submp_sub__imp_mp_sub_dmp_sub_d__imp_mp_submodmp_submod__imp_mp_to_radixmp_to_radix__imp_mp_to_sbinmp_to_sbin__imp_mp_to_ubinmp_to_ubin__imp_mp_ubin_sizemp_ubin_size__imp_mp_unpackmp_unpack__imp_mp_xormp_xor__imp_mp_zeromp_zero__imp_s_mp_adds_mp_add__imp_s_mp_karatsuba_muls_mp_karatsuba_mul__imp_s_mp_karatsuba_sqrs_mp_karatsuba_sqr__imp_s_mp_mul_digss_mp_mul_digs__imp_s_mp_mul_digs_fasts_mp_mul_digs_fast__imp_s_mp_reverses_mp_reverse__imp_s_mp_sqrs_mp_sqr__imp_s_mp_sqr_fasts_mp_sqr_fast__imp_s_mp_subs_mp_sub__imp_s_mp_toom_muls_mp_toom_mul__imp_s_mp_toom_sqrs_mp_toom_sqrlibtommath.dll/ 0 0 0 644 379 ` d.idata$2dx@0.idata$6@ libtommath.dll.idata$2h.idata$6.idata$4h.idata$5h#<X__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA libtommath.dll/ 0 0 0 644 127 ` dP.idata$3<@0__NULL_IMPORT_DESCRIPTOR libtommath.dll/ 0 0 0 644 166 ` dt.idata$5d@@.idata$4l@@ libtommath_NULL_THUNK_DATAlibtommath.dll/ 0 0 0 644 44 ` dmp_2exptlibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_abslibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_addlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_add_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_addmodlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_andlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_clamplibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_clearlibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_clear_multilibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_cmplibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_cmp_dlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_cmp_maglibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_cnt_lsblibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_complementlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_copylibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_count_bitslibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_decrlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_divlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_div_2libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_div_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_div_3libtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_div_dlibtommath.dlllibtommath.dll/ 0 0 0 644 52 ` d mp_dr_is_moduluslibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_dr_reducelibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_dr_setuplibtommath.dll libtommath.dll/ 0 0 0 644 54 ` d"mp_error_to_stringlibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_exchlibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_expt_u32libtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_exptmodlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_exteuclidlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_freadlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_from_sbinlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_from_ubinlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_fwritelibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_gcdlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_get_doublelibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_get_i32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_get_i64libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_get_intlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_get_llibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_get_lllibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_get_longlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_get_long_longlibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_u32libtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_u64libtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_get_mag_ullibtommath.dll libtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_ulllibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_growlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_incrlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_initlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_init_copylibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_i32libtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_i64libtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_init_llibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_init_lllibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_init_multilibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_setlibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_init_set_intlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_init_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_u32libtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_u64libtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_init_ullibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_ulllibtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_invmodlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_is_squarelibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_isevenlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_isoddlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_kroneckerlibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_lcmlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_log_u32libtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_lshdlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_modlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mod_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_mod_dlibtommath.dlllibtommath.dll/ 0 0 0 644 68 ` d0mp_montgomery_calc_normalizationlibtommath.dlllibtommath.dll/ 0 0 0 644 56 ` d$mp_montgomery_reducelibtommath.dlllibtommath.dll/ 0 0 0 644 55 ` d#mp_montgomery_setuplibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_mullibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_mul_2libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mul_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_mul_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mulmodlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_neglibtommath.dlllibtommath.dll/ 0 0 0 644 41 ` dmp_orlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_packlibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_pack_countlibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_prime_fermatlibtommath.dll libtommath.dll/ 0 0 0 644 64 ` d,mp_prime_frobenius_underwoodlibtommath.dlllibtommath.dll/ 0 0 0 644 53 ` d!mp_prime_is_primelibtommath.dll libtommath.dll/ 0 0 0 644 57 ` d%mp_prime_miller_rabinlibtommath.dll libtommath.dll/ 0 0 0 644 55 ` d#mp_prime_next_primelibtommath.dll libtommath.dll/ 0 0 0 644 64 ` d,mp_prime_rabin_miller_trialslibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_prime_randlibtommath.dll libtommath.dll/ 0 0 0 644 67 ` d/mp_prime_strong_lucas_selfridgelibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_radix_sizelibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_randlibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_read_radixlibtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_reducelibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_reduce_2klibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_reduce_2k_llibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"mp_reduce_2k_setuplibtommath.dlllibtommath.dll/ 0 0 0 644 56 ` d$mp_reduce_2k_setup_llibtommath.dlllibtommath.dll/ 0 0 0 644 51 ` dmp_reduce_is_2klibtommath.dll libtommath.dll/ 0 0 0 644 53 ` d!mp_reduce_is_2k_llibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_reduce_setuplibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_root_u32libtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_rshdlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_sbin_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_setlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_i32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_i64libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_intlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_set_llibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_set_lllibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_set_longlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_set_long_longlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_u32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_u64libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_set_ullibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_set_ulllibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_shrinklibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_signed_rshlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_sqrmodlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_sqrtlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_sqrtmod_primelibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_sublibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_sub_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_submodlibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_to_radixlibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_to_sbinlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_to_ubinlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_ubin_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_unpacklibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_xorlibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_zerolibtommath.dll libtommath.dll/ 0 0 0 644 44 ` ds_mp_addlibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"s_mp_karatsuba_mullibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"s_mp_karatsuba_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_mul_digslibtommath.dll libtommath.dll/ 0 0 0 644 54 ` d"s_mp_mul_digs_fastlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` ds_mp_reverselibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` ds_mp_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_sqr_fastlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` ds_mp_sublibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_toom_mullibtommath.dll libtommath.dll/ 0 0 0 644 49 ` ds_mp_toom_sqrlibtommath.dll tcl9.0.3/libtommath/win64-arm/libtommath.dll0000775000175000017500000021100015104661341020267 0ustar sergeisergeiMZx@x !L!This program cannot be run in DOS mode.$PEdҁf" : ``@L 08P|(.text `.rdataP,.@@.data @.pdata80@@.tls@@.reloc|P@B4S[c?qT!5(@qM Ts Q(Rs@*i_ȩ h ȩ5\u@@_ ȩ56R6*_?v7 T+@}R?֨_ ȩ56R6*_?v7aTw@@qTR 1 @5(R`a@! @3@qT`a@!@3HR6_ȿ5h@@AR?ֈ R @) *5R*@}R_?Հ?h_ȈuȨ5tД@@ q!T3_5R0 R@cB[ASĨ_h@S[ck#wИ @@(*h5*c*/QqhT*_`4*Q04qAT.*K0*qAT65*C0*=0@ q Ty(R9@ )_I( ȩ5qT@ qKTs(Rs@ i_h ȩ5=:R+@}R_??(_Ȉ:Ȩ5x@@ qT)3?_?5q@T5*0** q*#@kCcB[ASŨ_RD0qT5R*@}R_?Հ?h_ȈuȨ5tД@@ qAT2_*Ȩ5R'0*27 q@A_S{@qTqT{AS¨ @{AS¨_hR%@@?h@@h@A_ a%&'X) `y!c"#F*,_B t*A_**A_*A_֌h @q@A_ @HR? q(1(4  @ yjT( ___S{*5&*{AS¨_S ?!Tt(Rh @S¨_S{*5<*{AS¨_@! +@!|) y*a* @ _ k T)*M)J *J}B!M2A_' 73 @h@@ @_(_h@_֥(_h@_֠(_h@_(_h@_*A_B|@ S{h@kT@{AS¨_b{AS¨A_B|@S{th@kT@{AS¨_b{AS¨7**E@_*?*** S[7*(Rr~e*@5R)Ru(!Ți @(Y6@@[ASè_T`5* @A_S[{@7@k!Tv {B[ASèG1Tv w {B[ASè(CS[#I@@?kTy*` 5 @_qT@q Th A@bTi@h @i@Bh @j4*Rj@_qTj@J@ "= @= =(R*h @_qTk@ *m@q@|AT** Jji  )qT)}!"!*01**#@[CSBC_CS[{#f*5#m*5#* *#*{D[CSBC_S[c(@ @ @?k8_qT @q*h@kT* 5x7 @ @-Rk @/R0RT?qT T @1zh11@  jT @1zh_qT0@|_qaTT @xh @ _qT*T @xh@|qy(411@- @|qy(vw *@cB[ASĨ_@qT @ +Yj+ Q L TH4__@j0  @A_c'@ !@`E_ @*@? kT?qT?qZ_@qaT_@qmT R_@@iT R_#Z_@)@ kmT R_jT_ q T*@)}@ @,}I j K@,@ TCTJ!)!qT*_ @4@?qkT yj+J? T **_*RYj@} 7i)A @D*yj@ T_ 4@A_!R@AS{T(@@kT*5@j @q T @ q#T })! _ bTI  T*  *@k T**"*  hy~ }@  AJA@?JaT*Th@ kT,** }!/* @uh {AS¨_@4 Q@Ri }  A T_*_S @4h @qAT 5h@H4(R*h !R4R*t h @ @? T)* !R @S¨r* @S¨_S [ c k s {(@H 4%1 T@ 9* 5@ {*` 5c* 5*5#*5 @# @Sk k(R*r|(` }(}H R qTiR6K* * 5##* *`5c#K8K**`5@[Q}#1TG@# i|) i<`4*#c W 3*t*{NsMkLcK[JSI_*#*+?kmT{@H Q= cTѿLTw;@/@ y}By{?TKG@X}@ !Dyy + K X}@'? *qG@  *)!@ Qy8 y|@cI yyIiRy}H hG@qyxT))@ y8/@_ qjT @ yi#@IIRy{3HG@yx 5;@ T# 5@N`5P5k@qaT#z5@>`55}G@*ihJJ@*i(c@H4 @k@ *o*5@*>S (@@kTN@5@n @+qh@a!T @*|@ q CT+ }  bT T*)!k!J-_JQ_q@Aӭ mTkT!** }!!. @h ~* @S¨_lJ}Ӎy~1RPAѫ}o* K)  !NNc@nB@n`!NcoD!NBo@n@nT{OT{OBNcNB@nc@nÉ?΁ѐ T <NS[{**qT6 5*$*@ 5qT(Rr~e (RRr~e 4i@,qTn @ )!ȚR)JM, qT(1 N y~oK!nk !" NC NN@n@n"NDn"NDn@n@nDnDnNN@n@n?ѡTT <Nn@!ʚq %Ț nT**{B[ASè_S[ck{!(T@4!T(R!?T !?aT @ )!@) {FkEcD[CSBlT3 {FkEcD[CSBH@?aT{FkEcD[CSBE# 5@ @q T@ @)| |՛ Z {;_T[ QדZ{'h6T#x#t#*{FkEcD[CSB_ @? qjT*_@) ! @ T!)aT R_S[c{6@@zSkT5(~@6*K @qkT*!lywm@} }ӛ) -@JqɓmAT@ K qT) !)}*"!,$q1T$4*{CcB[ASĨ_@ @((_qTi)(٨ _`_ =(@= @=!=)_A7@_S{*#*5!Rq T6#5 qT##~S4**#*{CSB_S[{H@qaTW#(@qATc*5c]*5*5c*c*{E[DSC_qaT$R{E[DSC"qaT$R{E[DSC[@qKT @q$yS@97qTqaTDR*S[c{ccC#'*5c!Rj*4ccC#'V*{VcU[TSS_!RM*5@4@5C 5c#}55s@55ci5Cc555#C55c*@qTcc*5 *5*`5c*S[ck#*Y+qATU+*8R1TBhz~@@Z@@Q?TWkh8qUz Tv5@56+*1aTh@H4*x **1AT*#@kCcB[ASŨ_S !B 5@9qh @S¨_S{@qTAR 5R5h @ѩ@8k@ @I j jTY*{AS¨_S[{3*V *5* *>*5@"R*Z4***5*{C[BSA_S[{ @i 4@I 4c* 5* 5c #z*wk*ԲqTcc**`5**5k TKcc*`5k TK*@5@(4c1qTcc! 5A*~@4*{E[DSCc*)*@5 c*{E[DSC_ @?qT/@) v+ QBg)?Yk!a~B(T/@@aq `_h @qZ@A_h @q@A_h @qZ@A_@4@@_*_ @HR? q(1(4  @ yjT( ___@4@@_*_S !7@*kJT* @})  k T(* ) *)}"!)*@  @S¨_@4h @qT )5h@4(R*h !RK* h @ @? T)* @A_!R@A2RR)` h* @` @A_S{!@k*5*`4 *{AS¨_S{**5**{AS¨_S{*5*{AS¨_S{**5**{AS¨_S7*5@Q !@ 44@1 !@#T @SA_S{*5*{AS¨_S 7?qHR4R )` *R) @  @S¨_S{*d*5**{AS¨_S{V*5*{AS¨_S{*H*5**{AS¨_S{(@qT!RqT@qT @@9h7{AS¨@{AS¨_{AS¨S{?@qaTU@(4 @i)@@(ih8qaT*c! R/*4*{CSB_@i)(ih8qT!Rr*5* 5bhtRiRErR|c (R !? jA T鉝RRةr |)b) ! 6, M . fRk}k! @T,kk,k+ ik T -k+5qaTT"* 5HqT*" T@ivqT@qT iv)*?@!Tiv****!3@{EsDkCcB[ASǨ_@qTI)! ( @_jT_DqTqaTHRbT(RqaThRTqaTR#TqaTR#TqaTR#TqaTR#T qaTR#TqaT(R#TqaTHR#TqaThR#T qaTR#T0qaTR#T@qaTR#TRkaTR| SqT R kaTR | S? qT@qaT(RT R kaTHR%qTRkaThR?qT@R_S[cks{Z?q T*_q ThSv r**` RRKq+RSlK(% Z Rqx)%lRhQ r=} v!5@*?kT@9@ *9j{8*j;8jx8*j88h 5s*5@w6H4!R^55s* `5@*:Zw7* *5!R*44*M-*{GsFkEcD[CSB_pz*?q TH*%@@?qs*@A_S[cks{#?C'ccC##+* *5{R7RxRr<R c*c;%5!RqT1T~V6c`#5G@1TK kTY(R!RKR)Kq7T* 5*c**5C!R~J!RG!RD#!RA*Sc"*5*KcqT*8RkT#55##5#c#`5##@55 5c5c*r qT`5C#C5# 5C5*5CC@5SAq TH@@9(6CC5SAqTH@@9*CC`5[Aq qTCC!R/5` 5;Aq TH @@9(6 5;AqTH @@9* 5CAq qT!R 5CC05+58@5! 44SA 4;A 4#f*5 qTQ7R*%*k T*5#5@5;A4kjT@55#;4*c##C'Cc#+=*{EsDkCcB[ASƨ_(R*hCS[##**`5#*8#*#*#@[CSBC_CS[#(Q_1bTU/@h4*?qT @qHR*h# @*5q @h4*###5 @5*h*#*#@[CSBC_))q"h) _S[{*8vqT*F 5w* @}@?@5 @!R ?`5 @ yv?@TqkTqbT v~ A NAk! NB NA?JAT?T*{B[ASè_  * @)J@ TS[ck{*Q1bT@9 @8?q@9H4I[*RY)@{@:@ Q)?iq Q2Xz)1))Q_ CTvki8qTzT5S5(@85)q`T5qTh@4*w *{DkCcB[ASŨ_CS[{5@#* 5Q###7*/*`5*5#*R~*5##*-*5#U*5)1T#!R#*A*@5#*51T*#*{D[CSBC_CS[{#*5*#*c5T##5#A`51T4**#*{D[CSBC_CS[{#r*`5i*#*.5##E5#`51TS4**#x*{D[CSBC_S{#A*`58*#*@5##3*5@@h#W*{CSB_S{#!*5*#*5#*#;*{CSB_@4qTqkTqTh @ Q*R+R Yk TL{JӟkJ)qT R@A_*@ 4qaT R_qT @qT**_ t~o Ao NCJkcnnc((.!.T ? & T @ J)Tq_kෟ_S (@ R} 4 @S¨_ @S¨S[c{ 7*7 @h4VR#c*` 5= @= ~S5kT y4! b*5Q*9#% 5#c* 5c#O@ 5 5ccL 5cc@5#c59qT#5!R @*h #c{*{IcH[GSF_##!Rk*5#*Z 5v1 T*`4#*N5jqAT##!R* 4*#-S ?q T@kTj @qT!*IM!   qcT* L !_ "TLM+!? T* j JK+@J1 T* @S¨*  kT-** }!t @S¨_l}Ӌy~n})@ O @@T* TA_*@ @@ k  MT_)*i )}*M*"!nA_S ?q*!TZ!t6(Rh @S¨_S ?!T+t(Rh @S¨_S ?q*!TZ8t6(Rh @S¨_4*@)R @* @ _ k T)*M)J *J}B!0A_@! +@!|) y*a* @ _ k T)*M)J *J}B!A_4*@)R @* @ _ k T)*M)J *J}B!A_S (@)HR? q4_kaT* @}*th   @S¨_S @*4!RV5*@4 @S¨_* @S¨!R @S¨I)B@)@ kTI) B)@ kT)R y3?qTqLTA   @A_CS[##*5#*5#*#*#@[CSBC_CS{@qaTUI@h4c*5*@5@cq}c*`5cc*5cc*5 C*cqATc@5cc5cc4*c*c*{DSCC_S[{4AR4*5@1T#cC*5cR*4#cC{*V*{R[QSP_@ T!Rc* 5*5*5m**`5!R*5c@4c@@97j5cc!R6*@4ARr5@1T!R$*`4#8*`5!R*5A*5&* 5C*@5c|*5AR'1CqpM ?q N( K q#T } k@T}@C/R_@|_|ϛF@|ě|b“0B|cA1e7 (*A_S[cks{O@1 s/@qmT@ @)@*_ kT!Q5h@u @ qkTT+"i}   AA }?}aT T* *@L@) kl}AT@:R {S{3_kT@*)}|)|"Q( q T @ QMB }21 pA @#@D@#Ó!|ӅET|B@~~›qe$ TJ4c @l|d@|››?\!T*T$R K @gP@||›t@qgT* @@*(k*T@KQ)JQ() Kk!@L5@ ˓|Ӌ LA)1K! T7 4 }   N @ B"nA N#*5@q  J T@* @ @M4 J_ Tq ? Tyj  @1#@Od|b|b@? kOϓkT@ ###*#@[CSBC_S[cks{/ s/ˣ 7@*.@I@ ?k T*@5@@ k T @*Q @}@~@o!C @IɓJ|z11? T?! KK_kBԁ_qKT!` CqT6~@g!|@|y} 9 ф@B~zڛ ܛJ fy TBK@$_||Û j Bq!T@2h @y@t*M5?k,T'h @ky@t T5*C ! }!  #T 7  J T T"T?k T4*( *}! *@C{EsDkCcB[ASƨ_*?klTS[6bA?@iu 5@" T(Rh@[ASè_֨݋RRH=r Mmʓk  ʠ I  T+,-.hʍ_֡ ()*+ @-@Q@n@mϓ1 A0ѓ ".,8@TH19`TP1 9@TX1 9 T`19Th19Tp19Tx ! 9 nQ- *_S[{5@(6"RB2# @#RrRr? 5""B2##R?4@)*) @ ?qZ{C[BSA_(@T hh8 hi8 h)8) h(8?#T_CS[#@5R#z3* 5q T @@,R+!k!T}M.io@}}Λ0@ГT0io @@1~~N A@.ΓATN@@ΓN###*#@[CSBC_S[cks{/ 7s/@(@zSkT*]`5q Tq @Ɵ,QC @ϓ|!y*J_ T_ @QK!KBK?kB|!Ԁ?k!?qkTd q1"qTF|@|X}1  ф@n=9ڛۛ%UgT !K"@_||›E!q!TÓ0*7Q}Aqyq ~1~ћ0j@)yS` @qiTqƟqT@*j@` @ySh * q~C @ A N΁! NB N?!TaT C ˭  @k@ T_ kT)**H }!$*@C{EsDkCcB[ASƨ_S[{H@@7@kT*5h@ @q` @tT @*-@n@q JM@J TkT *k*TK,@kqJ L@J ATkT4** }!*{B[ASè_S[ck{#c*`C5@@ kȪRr(( ` *)*@5?qKTK@q@ @T}L ? BT+ _ Tl}Ӌ ) J L@k,T ****@<5zS_kTk@**?@ @k}@  ˟CT O . T O . T ~  O 0 1?aT T J )  L@k,TK*kg@CK*45_kTS@*M@3@ @}@   "T k ,Yoly/THKSCI**15?qT'@q;@ @T}L ? 2T+ _ 1Tl}Ӌ ) J L@k,T *;/v~LA-A ?aTTo-_+T`oA:  q / ?T 0M:o T~1B !M- @ ?1ATaT**`*&5KkT#@**@ @k}@  ˟CT O . T O . T ~  O 0 1?aT T J )  L@k,TK*#@# '*`5kT @*~@@ @}@   B"T k ,Yoly/THK #Cc*`5c*5#*5#* 5##Q*`5cCcv*5cc*5cck*@5#e*5q*5Z* 5c)*`5C*5H*5#* 5<*`5 *5C#*5* 5*` 5#* 5l* 5*@ 5##}* 5#w* 5U* 5##l*`5##f*5c*5c[*@5U*5vSI*5 D*@5*5#*9*5#* 5*.*5*5*#C#c*{RkQcP[OSN_֋v~LA-A ?aT@Ti-+T`OA7  q / ?T 0M7o T~1B !M- @ ?1ATATS[cK#\* 5ȪRr ` **`5c*3*`5@zSK* 5 @qT#@Q q#T })! _ BTI  T*  *@kjT** _kT**@  q#T }k!,  "T ? T IK @)1jT*  *@? kJT@)* @l qj #T}ӭ! T  T *hK@qTH Kc#*`5*5cW* 5c* 5* 5* 5cc* 5cc* 5* 5* 5*5&*5c *5*@5#*5vS*5 c*@5**5**5c*@5*5~*5#x*c#*K@cH[GSF_ y~ }K  AJA@?JaT*T% y~}J ()AA )?΁aT* T,z~-}.   AA?aTT43h@@?i@(@i@A_S sZFh@1T iZi4*hzt?֔Ѵ54 @S¨S )(D96 @S¨_*RsZF*9h@1T iZi4*hzt?֔Ѵ54 @S¨S uF @? q`TIR ?q`T?qATs;;T;"T@?) R @S¨_*_? q@TA5 RA_S[ck##C( aE9) 7)R a9R|(=D) ?34FGBGijmT1+T@5@5 @2q6@h5@4TJG"(3тR@( CqTjAqT7i@2@(JT"iub4(C@?i@jA#D#@kCcB[ASƨ_ @?qA T2TyRZ3JG{92"T"@9( Q ?qHT.@) hC@Lki8k ` @9lxy @ylpq @l}`ak @j ?qD (T #* T*Q #ʚ KT?qT*'J6biCP5 4{ 3w S[ck;79jAq+T(@)`T __hT @k @J _T7 (@ :}Z@)@R( (5@?'@q T!qTqTqT qTqTRR(@ R@# (`@a1@?֠4jAjU;@kFcE[DSC_6 (@ R @7#  @ (@?*7  @R/V|8aR"R8@RN@eM h|1@@?@T_ R_ R_S[{*9q(R8:@:@:@s`@8*{B[ASè_S[{*-q(R,@+@+@s`@*{B[ASè_ q`@A_]G@9h4*_*@R*!`:@A*_YG@?(5(=(EA_YG@?(5(=(EA_CCRD_S{(A4* RRt(3s"@?( @( %@?*{AS¨_(AH4(* @?(@ @?kaT  @ @ kAT @jI  >( %@?*@A_S[{? q T *);+ih8J @4A 4( @?(@u67.@@ @@??@53@?3hA5( !@?(Rh:8(A4( @?(@56.@@ @4@??@53@?( %@?ֈAqT3`@@( @( %@? R{B[ASè_@yIR kaT< R @? kT1@y-q_*_< ( @y4*)@yI aq T @?hT @I ?T__S{ TЪIRIG @y? kT = R @? k!T 1@y?-qT @y4 )@y(aR4q!T{AS¨_ ЪIR)IG(@y kT(= R*H@ kTH1@y-qaTH @y(4K)@y J @aq T @? cT @j ? T_ЪIRIG @y? kT = R @? kT 1@y?-qaT @y_*_ЪIRIG @y? kT = R @? kAT 1@y?-qT @y4 )@yHa)qT @9/6_ЪIRIG @y? kT = R @? kT1@y-qTHG__ ЪIR)IG(@y kT(= R*H@ k!TH1@y-qTH @y4K)@yK iq)T+^_ cT,A^ _ T(@(*}S_*_ЪIRIG @y? kT = R  i@? kTi1@y?-qaTi@)4j @y4l)@yk kJqkTl@ khTm_  kT))1*_ 5Q)Q*_j5*@4q,T)@ __+_釟ꇟ)7  _֣l ډ KNA)*?zo ɚK ɚ%ʚ k7,*  (_ )m ) ˭  jʓkAӌ1CTD  _TJ A**K ʚ!ʚ%ɚm`  ʚn}@`( ͚}@  ``q}~`?T/}` ͚0  )`1`q1} ~`?T0 šJ** AK ʚ%ɚm` ʚn}@`ӌ}@(!ʚ  ( ͚  ``q}~`?T/}` ͚0  )`1`q1} ~`?T}`+ )j%ʚ |_CCD_D_GGGGGGGGGGGG @@*@2@6@@GGGGGG>@GGGGB@GGR@N@J@G@&@.@"@@G@GP!0 8!0! SuccessfulUnknown errorOut of heapValue out of rangeMax. iterations reachedBuffer overflowInvalid error code   @ wD"437ae92817f9fc85b7e52be6951adc5b22410a5fd PQ%` (#     $(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/h>?  !"#$%&'()*+,-./0123456789:;<=X  @ wD" %)+/5;=CGIOSYaegkmq %379=KQ[]agou{  #-39;AKQWY_eikw)+57;=GUY[_mqsw %'-?CEIOU]ci  ')/QW]ew #+/=AGIMSMicrosoft Base Cryptographic Provider v1.0 @@@!@0 )))) Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. %d bit pseudo relocation at %p out of range, targeting %p, yielding the value %p. Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%xMingw-w64 runtime failure: runtime error %d  ')0hw3libtommath.dll@xt\ T4 l !!"4'(|t*l,,--.L.<..x023444|5L7777888t8 8999H:::\:;;<L<<<H=?? @$BClCDElFxFHGH H V ] g o               " 0 C P Y g p ~   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~mp_2exptmp_absmp_addmp_add_dmp_addmodmp_andmp_clampmp_clearmp_clear_multimp_cmpmp_cmp_dmp_cmp_magmp_cnt_lsbmp_complementmp_copymp_count_bitsmp_decrmp_divmp_div_2mp_div_2dmp_div_3mp_div_dmp_dr_is_modulusmp_dr_reducemp_dr_setupmp_error_to_stringmp_exchmp_expt_nmp_expt_u32mp_exptmodmp_exteuclidmp_freadmp_from_sbinmp_from_ubinmp_fwritemp_gcdmp_get_doublemp_get_i32mp_get_i64mp_get_intmp_get_lmp_get_llmp_get_longmp_get_long_longmp_get_mag_u32mp_get_mag_u64mp_get_mag_ulmp_get_mag_ullmp_growmp_incrmp_initmp_init_copymp_init_i32mp_init_i64mp_init_lmp_init_llmp_init_multimp_init_setmp_init_set_intmp_init_sizemp_init_u32mp_init_u64mp_init_ulmp_init_ullmp_invmodmp_is_squaremp_isevenmp_isoddmp_kroneckermp_lcmmp_log_nmp_log_u32mp_lshdmp_modmp_mod_2dmp_mod_dmp_montgomery_calc_normalizationmp_montgomery_reducemp_montgomery_setupmp_mulmp_mul_2mp_mul_2dmp_mul_dmp_mulmodmp_negmp_ormp_packmp_pack_countmp_prime_fermatmp_prime_frobenius_underwoodmp_prime_is_primemp_prime_miller_rabinmp_prime_next_primemp_prime_rabin_miller_trialsmp_prime_randmp_prime_strong_lucas_selfridgemp_radix_sizemp_randmp_read_radixmp_reducemp_reduce_2kmp_reduce_2k_lmp_reduce_2k_setupmp_reduce_2k_setup_lmp_reduce_is_2kmp_reduce_is_2k_lmp_reduce_setupmp_root_nmp_root_u32mp_rshdmp_sbin_sizemp_setmp_set_i32mp_set_i64mp_set_intmp_set_lmp_set_llmp_set_longmp_set_long_longmp_set_u32mp_set_u64mp_set_ulmp_set_ullmp_shrinkmp_signed_rshmp_sqrmp_sqrmodmp_sqrtmp_sqrtmod_primemp_submp_sub_dmp_submodmp_to_radixmp_to_sbinmp_to_ubinmp_ubin_sizemp_unpackmp_xormp_zeros_mp_adds_mp_balance_muls_mp_karatsuba_muls_mp_karatsuba_sqrs_mp_mul_digss_mp_mul_digs_fasts_mp_reverses_mp_sqrs_mp_sqr_fasts_mp_subs_mp_toom_muls_mp_toom_sqrX  8 H!@A`bxo(|x"<Tjx0Jfnx4<J\l|"<Tjx0Jfnx4<J\l|_set_new_modecallocfreemallocreallocmemcpy__p___argc__p___argv__p___wargv_configure_narrow_argv_configure_wide_argv_crt_at_quick_exit_crt_atexit_execute_onexit_table_initialize_narrow_environment_initialize_onexit_table_initialize_wide_environment_initterm_register_onexit_functionabort__acrt_iob_func__stdio_common_vfprintf__stdio_common_vfwprintffgetcfwritememsetstrlenstrncmpCryptAcquireContextACryptGenRandomDeleteCriticalSectionEnterCriticalSectionGetLastErrorInitializeCriticalSectionLeaveCriticalSectionSleepTlsGetValueVirtualProtectVirtualQuery__p__environ__p__wenviron__daylight__timezone__tzname_tzsetapi-ms-win-crt-heap-l1-1-0.dllapi-ms-win-crt-private-l1-1-0.dllapi-ms-win-crt-runtime-l1-1-0.dllapi-ms-win-crt-stdio-l1-1-0.dllapi-ms-win-crt-string-l1-1-0.dllADVAPI32.dllKERNEL32.dllapi-ms-win-crt-environment-l1-1-0.dllapi-ms-win-crt-time-l1-1-0.dll@ s**B$B$    B$B$ B$B$ $@ @ք&ք&`  ֈ  i@ @+$($$*@(}@\\f@<$$~)$@0@>@w@  & Fe ,:H֊֊@ 1l&l&. ֆt ^o֊֊   (@%@ % # B$B$@FF ֎ 7@ #@ @+ f@]@b@&&c@<$$ ֈ R ( @(@  @(#e@ ^֎ ֎   J. N }@ qJ,J, > A@4@ք&ք&O@ F**Z ֈ5 ֈ3 ֈ F F!@@ $$@ ` F%3$$$$#  U H@<d d &@"@&&U@ L ֈa - ֈx P @(@X X l@(a@NN.@0.J,J,R@0/J,J,@ ,  @ 1@@ @ ֖ ֖ t   0J,J,^ Y@0I,I,X S@0J,J,0@ )ֆֆR @0J,J,_@ +ddA@   $$@0S I, I,u@(X@   g*  gPx^8 p!x!  X pp  p(TPSTPDTL &0%,\9#5"9#il t(@u<Hx`lt&\x4 l 5#!"4'(t*,'.-L. .x082 3="44#4P|5\7x778"999M#H:9#:9#:9#:;9#;Y"<9#L<9#<9#<H= @$BCCi"D4ExF#HG@ / 1711619250 0 5884 ` 1.013R3R334 4 44445X5X556&6&66667b7b778484889 9 9t9t99:J:J::;;;;;; > >t>t>>?J?J??@ @ @@@@A`A`AAB0B0BBCCCrCrCCDDDDDDEEEEEEFfFfFFGBGBGGHHHzHzHHIRIRIIJ(J(JJKKKlKlKKLHLHLLM M MMMMN`N`NNO6O6OOP P PpPpPPQBQBQQRRRzRzRRSbSbSSTJTJTTUUUUUUVTVTVVW W WWWWXfXfXXYTYTYYZ>Z>ZZ[([([[\\\~\~\\]V]V]]^0^0^^______`h`h``a>a>aabbbxbxbbcLcLccddddddededeef8f8ffg g gvgvgghJhJhhiiiiiijZjZjjk0k0kklllplpllm@m@mmnnnnnnododoopDpDppqqqqqqr\r\__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA__imp_mp_2exptmp_2expt__imp_mp_absmp_abs__imp_mp_addmp_add__imp_mp_add_dmp_add_d__imp_mp_addmodmp_addmod__imp_mp_andmp_and__imp_mp_clampmp_clamp__imp_mp_clearmp_clear__imp_mp_clear_multimp_clear_multi__imp_mp_cmpmp_cmp__imp_mp_cmp_dmp_cmp_d__imp_mp_cmp_magmp_cmp_mag__imp_mp_cnt_lsbmp_cnt_lsb__imp_mp_complementmp_complement__imp_mp_copymp_copy__imp_mp_count_bitsmp_count_bits__imp_mp_decrmp_decr__imp_mp_divmp_div__imp_mp_div_2mp_div_2__imp_mp_div_2dmp_div_2d__imp_mp_div_3mp_div_3__imp_mp_div_dmp_div_d__imp_mp_dr_is_modulusmp_dr_is_modulus__imp_mp_dr_reducemp_dr_reduce__imp_mp_dr_setupmp_dr_setup__imp_mp_error_to_stringmp_error_to_string__imp_mp_exchmp_exch__imp_mp_expt_nmp_expt_n__imp_mp_expt_u32mp_expt_u32__imp_mp_exptmodmp_exptmod__imp_mp_exteuclidmp_exteuclid__imp_mp_freadmp_fread__imp_mp_from_sbinmp_from_sbin__imp_mp_from_ubinmp_from_ubin__imp_mp_fwritemp_fwrite__imp_mp_gcdmp_gcd__imp_mp_get_doublemp_get_double__imp_mp_get_i32mp_get_i32__imp_mp_get_i64mp_get_i64__imp_mp_get_intmp_get_int__imp_mp_get_lmp_get_l__imp_mp_get_llmp_get_ll__imp_mp_get_longmp_get_long__imp_mp_get_long_longmp_get_long_long__imp_mp_get_mag_u32mp_get_mag_u32__imp_mp_get_mag_u64mp_get_mag_u64__imp_mp_get_mag_ulmp_get_mag_ul__imp_mp_get_mag_ullmp_get_mag_ull__imp_mp_growmp_grow__imp_mp_incrmp_incr__imp_mp_initmp_init__imp_mp_init_copymp_init_copy__imp_mp_init_i32mp_init_i32__imp_mp_init_i64mp_init_i64__imp_mp_init_lmp_init_l__imp_mp_init_llmp_init_ll__imp_mp_init_multimp_init_multi__imp_mp_init_setmp_init_set__imp_mp_init_set_intmp_init_set_int__imp_mp_init_sizemp_init_size__imp_mp_init_u32mp_init_u32__imp_mp_init_u64mp_init_u64__imp_mp_init_ulmp_init_ul__imp_mp_init_ullmp_init_ull__imp_mp_invmodmp_invmod__imp_mp_is_squaremp_is_square__imp_mp_isevenmp_iseven__imp_mp_isoddmp_isodd__imp_mp_kroneckermp_kronecker__imp_mp_lcmmp_lcm__imp_mp_log_nmp_log_n__imp_mp_log_u32mp_log_u32__imp_mp_lshdmp_lshd__imp_mp_modmp_mod__imp_mp_mod_2dmp_mod_2d__imp_mp_mod_dmp_mod_d__imp_mp_montgomery_calc_normalizationmp_montgomery_calc_normalization__imp_mp_montgomery_reducemp_montgomery_reduce__imp_mp_montgomery_setupmp_montgomery_setup__imp_mp_mulmp_mul__imp_mp_mul_2mp_mul_2__imp_mp_mul_2dmp_mul_2d__imp_mp_mul_dmp_mul_d__imp_mp_mulmodmp_mulmod__imp_mp_negmp_neg__imp_mp_ormp_or__imp_mp_packmp_pack__imp_mp_pack_countmp_pack_count__imp_mp_prime_fermatmp_prime_fermat__imp_mp_prime_frobenius_underwoodmp_prime_frobenius_underwood__imp_mp_prime_is_primemp_prime_is_prime__imp_mp_prime_miller_rabinmp_prime_miller_rabin__imp_mp_prime_next_primemp_prime_next_prime__imp_mp_prime_rabin_miller_trialsmp_prime_rabin_miller_trials__imp_mp_prime_randmp_prime_rand__imp_mp_prime_strong_lucas_selfridgemp_prime_strong_lucas_selfridge__imp_mp_radix_sizemp_radix_size__imp_mp_randmp_rand__imp_mp_read_radixmp_read_radix__imp_mp_reducemp_reduce__imp_mp_reduce_2kmp_reduce_2k__imp_mp_reduce_2k_lmp_reduce_2k_l__imp_mp_reduce_2k_setupmp_reduce_2k_setup__imp_mp_reduce_2k_setup_lmp_reduce_2k_setup_l__imp_mp_reduce_is_2kmp_reduce_is_2k__imp_mp_reduce_is_2k_lmp_reduce_is_2k_l__imp_mp_reduce_setupmp_reduce_setup__imp_mp_root_nmp_root_n__imp_mp_root_u32mp_root_u32__imp_mp_rshdmp_rshd__imp_mp_sbin_sizemp_sbin_size__imp_mp_setmp_set__imp_mp_set_i32mp_set_i32__imp_mp_set_i64mp_set_i64__imp_mp_set_intmp_set_int__imp_mp_set_lmp_set_l__imp_mp_set_llmp_set_ll__imp_mp_set_longmp_set_long__imp_mp_set_long_longmp_set_long_long__imp_mp_set_u32mp_set_u32__imp_mp_set_u64mp_set_u64__imp_mp_set_ulmp_set_ul__imp_mp_set_ullmp_set_ull__imp_mp_shrinkmp_shrink__imp_mp_signed_rshmp_signed_rsh__imp_mp_sqrmp_sqr__imp_mp_sqrmodmp_sqrmod__imp_mp_sqrtmp_sqrt__imp_mp_sqrtmod_primemp_sqrtmod_prime__imp_mp_submp_sub__imp_mp_sub_dmp_sub_d__imp_mp_submodmp_submod__imp_mp_to_radixmp_to_radix__imp_mp_to_sbinmp_to_sbin__imp_mp_to_ubinmp_to_ubin__imp_mp_ubin_sizemp_ubin_size__imp_mp_unpackmp_unpack__imp_mp_xormp_xor__imp_mp_zeromp_zero__imp_s_mp_adds_mp_add__imp_s_mp_balance_muls_mp_balance_mul__imp_s_mp_karatsuba_muls_mp_karatsuba_mul__imp_s_mp_karatsuba_sqrs_mp_karatsuba_sqr__imp_s_mp_mul_digss_mp_mul_digs__imp_s_mp_mul_digs_fasts_mp_mul_digs_fast__imp_s_mp_reverses_mp_reverse__imp_s_mp_sqrs_mp_sqr__imp_s_mp_sqr_fasts_mp_sqr_fast__imp_s_mp_subs_mp_sub__imp_s_mp_toom_muls_mp_toom_mul__imp_s_mp_toom_sqrs_mp_toom_sqr/ 1711619250 0 5894 ` .01R33 444X55&666b77488 9t99J::;;;R<<.== >t>>J?? @@@`AA0BBCrCCDDDEEEfFFBGGHzHHRII(JJKlKKHLL MMM`NN6OO PpPPBQQRzRRbSSJTTUUUTVV WWWfXXTYY>ZZ([[\~\\V]]0^^___h``>aabxbbLccddddee8ff gvggJhhiiiZjj0kklpll@mmnnndooDppqqq\r1  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTOR__imp_mp_2expt__imp_mp_abs__imp_mp_add__imp_mp_add_d__imp_mp_addmod__imp_mp_and__imp_mp_clamp__imp_mp_clear__imp_mp_clear_multi__imp_mp_cmp__imp_mp_cmp_d__imp_mp_cmp_mag__imp_mp_cnt_lsb__imp_mp_complement__imp_mp_copy__imp_mp_count_bits__imp_mp_decr__imp_mp_div__imp_mp_div_2__imp_mp_div_2d__imp_mp_div_3__imp_mp_div_d__imp_mp_dr_is_modulus__imp_mp_dr_reduce__imp_mp_dr_setup__imp_mp_error_to_string__imp_mp_exch__imp_mp_expt_n__imp_mp_expt_u32__imp_mp_exptmod__imp_mp_exteuclid__imp_mp_fread__imp_mp_from_sbin__imp_mp_from_ubin__imp_mp_fwrite__imp_mp_gcd__imp_mp_get_double__imp_mp_get_i32__imp_mp_get_i64__imp_mp_get_int__imp_mp_get_l__imp_mp_get_ll__imp_mp_get_long__imp_mp_get_long_long__imp_mp_get_mag_u32__imp_mp_get_mag_u64__imp_mp_get_mag_ul__imp_mp_get_mag_ull__imp_mp_grow__imp_mp_incr__imp_mp_init__imp_mp_init_copy__imp_mp_init_i32__imp_mp_init_i64__imp_mp_init_l__imp_mp_init_ll__imp_mp_init_multi__imp_mp_init_set__imp_mp_init_set_int__imp_mp_init_size__imp_mp_init_u32__imp_mp_init_u64__imp_mp_init_ul__imp_mp_init_ull__imp_mp_invmod__imp_mp_is_square__imp_mp_iseven__imp_mp_isodd__imp_mp_kronecker__imp_mp_lcm__imp_mp_log_n__imp_mp_log_u32__imp_mp_lshd__imp_mp_mod__imp_mp_mod_2d__imp_mp_mod_d__imp_mp_montgomery_calc_normalization__imp_mp_montgomery_reduce__imp_mp_montgomery_setup__imp_mp_mul__imp_mp_mul_2__imp_mp_mul_2d__imp_mp_mul_d__imp_mp_mulmod__imp_mp_neg__imp_mp_or__imp_mp_pack__imp_mp_pack_count__imp_mp_prime_fermat__imp_mp_prime_frobenius_underwood__imp_mp_prime_is_prime__imp_mp_prime_miller_rabin__imp_mp_prime_next_prime__imp_mp_prime_rabin_miller_trials__imp_mp_prime_rand__imp_mp_prime_strong_lucas_selfridge__imp_mp_radix_size__imp_mp_rand__imp_mp_read_radix__imp_mp_reduce__imp_mp_reduce_2k__imp_mp_reduce_2k_l__imp_mp_reduce_2k_setup__imp_mp_reduce_2k_setup_l__imp_mp_reduce_is_2k__imp_mp_reduce_is_2k_l__imp_mp_reduce_setup__imp_mp_root_n__imp_mp_root_u32__imp_mp_rshd__imp_mp_sbin_size__imp_mp_set__imp_mp_set_i32__imp_mp_set_i64__imp_mp_set_int__imp_mp_set_l__imp_mp_set_ll__imp_mp_set_long__imp_mp_set_long_long__imp_mp_set_u32__imp_mp_set_u64__imp_mp_set_ul__imp_mp_set_ull__imp_mp_shrink__imp_mp_signed_rsh__imp_mp_sqr__imp_mp_sqrmod__imp_mp_sqrt__imp_mp_sqrtmod_prime__imp_mp_sub__imp_mp_sub_d__imp_mp_submod__imp_mp_to_radix__imp_mp_to_sbin__imp_mp_to_ubin__imp_mp_ubin_size__imp_mp_unpack__imp_mp_xor__imp_mp_zero__imp_s_mp_add__imp_s_mp_balance_mul__imp_s_mp_karatsuba_mul__imp_s_mp_karatsuba_sqr__imp_s_mp_mul_digs__imp_s_mp_mul_digs_fast__imp_s_mp_reverse__imp_s_mp_sqr__imp_s_mp_sqr_fast__imp_s_mp_sub__imp_s_mp_toom_mul__imp_s_mp_toom_sqrmp_2exptmp_absmp_addmp_add_dmp_addmodmp_andmp_clampmp_clearmp_clear_multimp_cmpmp_cmp_dmp_cmp_magmp_cnt_lsbmp_complementmp_copymp_count_bitsmp_decrmp_divmp_div_2mp_div_2dmp_div_3mp_div_dmp_dr_is_modulusmp_dr_reducemp_dr_setupmp_error_to_stringmp_exchmp_expt_nmp_expt_u32mp_exptmodmp_exteuclidmp_freadmp_from_sbinmp_from_ubinmp_fwritemp_gcdmp_get_doublemp_get_i32mp_get_i64mp_get_intmp_get_lmp_get_llmp_get_longmp_get_long_longmp_get_mag_u32mp_get_mag_u64mp_get_mag_ulmp_get_mag_ullmp_growmp_incrmp_initmp_init_copymp_init_i32mp_init_i64mp_init_lmp_init_llmp_init_multimp_init_setmp_init_set_intmp_init_sizemp_init_u32mp_init_u64mp_init_ulmp_init_ullmp_invmodmp_is_squaremp_isevenmp_isoddmp_kroneckermp_lcmmp_log_nmp_log_u32mp_lshdmp_modmp_mod_2dmp_mod_dmp_montgomery_calc_normalizationmp_montgomery_reducemp_montgomery_setupmp_mulmp_mul_2mp_mul_2dmp_mul_dmp_mulmodmp_negmp_ormp_packmp_pack_countmp_prime_fermatmp_prime_frobenius_underwoodmp_prime_is_primemp_prime_miller_rabinmp_prime_next_primemp_prime_rabin_miller_trialsmp_prime_randmp_prime_strong_lucas_selfridgemp_radix_sizemp_randmp_read_radixmp_reducemp_reduce_2kmp_reduce_2k_lmp_reduce_2k_setupmp_reduce_2k_setup_lmp_reduce_is_2kmp_reduce_is_2k_lmp_reduce_setupmp_root_nmp_root_u32mp_rshdmp_sbin_sizemp_setmp_set_i32mp_set_i64mp_set_intmp_set_lmp_set_llmp_set_longmp_set_long_longmp_set_u32mp_set_u64mp_set_ulmp_set_ullmp_shrinkmp_signed_rshmp_sqrmp_sqrmodmp_sqrtmp_sqrtmod_primemp_submp_sub_dmp_submodmp_to_radixmp_to_sbinmp_to_ubinmp_ubin_sizemp_unpackmp_xormp_zeros_mp_adds_mp_balance_muls_mp_karatsuba_muls_mp_karatsuba_sqrs_mp_mul_digss_mp_mul_digs_fasts_mp_reverses_mp_sqrs_mp_sqr_fasts_mp_subs_mp_toom_muls_mp_toom_sqrlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619250 0 506 ` d<f.debug$SD@B.idata$2@0.idata$6@  libtommath.dll'iMicrosoft (R) LINK libtommath.dll@comp.idi.idata$2@h.idata$6.idata$4@h.idata$5@h#<X__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619250 0 253 ` d<f.debug$SDd@B.idata$3@0 libtommath.dll'iMicrosoft (R) LINK@comp.idi__NULL_IMPORT_DESCRIPTOR libtommath.dll/ 1711619250 0 292 ` d<f.debug$SD@B.idata$5@@.idata$4@@ libtommath.dll'iMicrosoft (R) LINK@comp.idi libtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619250 0 44 ` d<fmp_2exptlibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<fmp_abslibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<fmp_addlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_add_dlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fmp_addmodlibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fmp_andlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_clamplibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_clearlibtommath.dlllibtommath.dll/ 1711619250 0 50 ` d<fmp_clear_multilibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<f mp_cmplibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<f mp_cmp_dlibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<f mp_cmp_maglibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<f mp_cnt_lsblibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<f mp_complementlibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<fmp_copylibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<fmp_count_bitslibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<fmp_decrlibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fmp_divlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_div_2libtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fmp_div_2dlibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fmp_div_3libtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_div_dlibtommath.dlllibtommath.dll/ 1711619250 0 52 ` d<f mp_dr_is_moduluslibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<fmp_dr_reducelibtommath.dlllibtommath.dll/ 1711619250 0 47 ` d<fmp_dr_setuplibtommath.dll libtommath.dll/ 1711619250 0 54 ` d<f"mp_error_to_stringlibtommath.dlllibtommath.dll/ 1711619250 0 43 ` d<fmp_exchlibtommath.dll libtommath.dll/ 1711619250 0 45 ` d<fmp_expt_nlibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<fmp_expt_u32libtommath.dll libtommath.dll/ 1711619250 0 46 ` d<fmp_exptmodlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<fmp_exteuclidlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_freadlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<f mp_from_sbinlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<f!mp_from_ubinlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<f"mp_fwritelibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<f#mp_gcdlibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<f$mp_get_doublelibtommath.dll libtommath.dll/ 1711619250 0 46 ` d<f%mp_get_i32libtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<f&mp_get_i64libtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<f'mp_get_intlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<f(mp_get_llibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<f)mp_get_lllibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<f*mp_get_longlibtommath.dll libtommath.dll/ 1711619250 0 52 ` d<f +mp_get_long_longlibtommath.dlllibtommath.dll/ 1711619250 0 50 ` d<f,mp_get_mag_u32libtommath.dlllibtommath.dll/ 1711619250 0 50 ` d<f-mp_get_mag_u64libtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<f.mp_get_mag_ullibtommath.dll libtommath.dll/ 1711619250 0 50 ` d<f/mp_get_mag_ulllibtommath.dlllibtommath.dll/ 1711619250 0 43 ` d<f0mp_growlibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<f1mp_incrlibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<f2mp_initlibtommath.dll libtommath.dll/ 1711619250 0 48 ` d<f3mp_init_copylibtommath.dlllibtommath.dll/ 1711619250 0 47 ` d<f4mp_init_i32libtommath.dll libtommath.dll/ 1711619250 0 47 ` d<f5mp_init_i64libtommath.dll libtommath.dll/ 1711619250 0 45 ` d<f6mp_init_llibtommath.dll libtommath.dll/ 1711619250 0 46 ` d<f7mp_init_lllibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<f8mp_init_multilibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<f9mp_init_setlibtommath.dll libtommath.dll/ 1711619250 0 51 ` d<f:mp_init_set_intlibtommath.dll libtommath.dll/ 1711619250 0 48 ` d<f;mp_init_sizelibtommath.dlllibtommath.dll/ 1711619250 0 47 ` d<f<mp_init_u32libtommath.dll libtommath.dll/ 1711619250 0 47 ` d<f=mp_init_u64libtommath.dll libtommath.dll/ 1711619250 0 46 ` d<f>mp_init_ullibtommath.dlllibtommath.dll/ 1711619250 0 47 ` d<f?mp_init_ulllibtommath.dll libtommath.dll/ 1711619250 0 45 ` d<f@mp_invmodlibtommath.dll libtommath.dll/ 1711619250 0 48 ` d<fAmp_is_squarelibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fBmp_isevenlibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fCmp_isoddlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<fDmp_kroneckerlibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<fEmp_lcmlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fFmp_log_nlibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fGmp_log_u32libtommath.dlllibtommath.dll/ 1711619250 0 43 ` d<fHmp_lshdlibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fImp_modlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fJmp_mod_2dlibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fKmp_mod_dlibtommath.dlllibtommath.dll/ 1711619250 0 68 ` d<f0Lmp_montgomery_calc_normalizationlibtommath.dlllibtommath.dll/ 1711619250 0 56 ` d<f$Mmp_montgomery_reducelibtommath.dlllibtommath.dll/ 1711619250 0 55 ` d<f#Nmp_montgomery_setuplibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fOmp_mullibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fPmp_mul_2libtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fQmp_mul_2dlibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fRmp_mul_dlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fSmp_mulmodlibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fTmp_neglibtommath.dlllibtommath.dll/ 1711619250 0 41 ` d<fUmp_orlibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<fVmp_packlibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<fWmp_pack_countlibtommath.dll libtommath.dll/ 1711619250 0 51 ` d<fXmp_prime_fermatlibtommath.dll libtommath.dll/ 1711619250 0 64 ` d<f,Ymp_prime_frobenius_underwoodlibtommath.dlllibtommath.dll/ 1711619250 0 53 ` d<f!Zmp_prime_is_primelibtommath.dll libtommath.dll/ 1711619250 0 57 ` d<f%[mp_prime_miller_rabinlibtommath.dll libtommath.dll/ 1711619250 0 55 ` d<f#\mp_prime_next_primelibtommath.dll libtommath.dll/ 1711619250 0 64 ` d<f,]mp_prime_rabin_miller_trialslibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<f^mp_prime_randlibtommath.dll libtommath.dll/ 1711619250 0 67 ` d<f/_mp_prime_strong_lucas_selfridgelibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<f`mp_radix_sizelibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<famp_randlibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<fbmp_read_radixlibtommath.dll libtommath.dll/ 1711619250 0 45 ` d<fcmp_reducelibtommath.dll libtommath.dll/ 1711619250 0 48 ` d<fdmp_reduce_2klibtommath.dlllibtommath.dll/ 1711619250 0 50 ` d<femp_reduce_2k_llibtommath.dlllibtommath.dll/ 1711619250 0 54 ` d<f"fmp_reduce_2k_setuplibtommath.dlllibtommath.dll/ 1711619250 0 56 ` d<f$gmp_reduce_2k_setup_llibtommath.dlllibtommath.dll/ 1711619250 0 51 ` d<fhmp_reduce_is_2klibtommath.dll libtommath.dll/ 1711619250 0 53 ` d<f!imp_reduce_is_2k_llibtommath.dll libtommath.dll/ 1711619250 0 51 ` d<fjmp_reduce_setuplibtommath.dll libtommath.dll/ 1711619250 0 45 ` d<fkmp_root_nlibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<flmp_root_u32libtommath.dll libtommath.dll/ 1711619250 0 43 ` d<fmmp_rshdlibtommath.dll libtommath.dll/ 1711619250 0 48 ` d<fnmp_sbin_sizelibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<fomp_setlibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fpmp_set_i32libtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fqmp_set_i64libtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<frmp_set_intlibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fsmp_set_llibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<ftmp_set_lllibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<fump_set_longlibtommath.dll libtommath.dll/ 1711619250 0 52 ` d<f vmp_set_long_longlibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fwmp_set_u32libtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fxmp_set_u64libtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fymp_set_ullibtommath.dll libtommath.dll/ 1711619250 0 46 ` d<fzmp_set_ulllibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<f{mp_shrinklibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<f|mp_signed_rshlibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<f}mp_sqrlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<f~mp_sqrmodlibtommath.dll libtommath.dll/ 1711619250 0 43 ` d<fmp_sqrtlibtommath.dll libtommath.dll/ 1711619250 0 52 ` d<f mp_sqrtmod_primelibtommath.dlllibtommath.dll/ 1711619250 0 42 ` d<fmp_sublibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fmp_sub_dlibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fmp_submodlibtommath.dll libtommath.dll/ 1711619250 0 47 ` d<fmp_to_radixlibtommath.dll libtommath.dll/ 1711619250 0 46 ` d<fmp_to_sbinlibtommath.dlllibtommath.dll/ 1711619250 0 46 ` d<fmp_to_ubinlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<fmp_ubin_sizelibtommath.dlllibtommath.dll/ 1711619250 0 45 ` d<fmp_unpacklibtommath.dll libtommath.dll/ 1711619250 0 42 ` d<fmp_xorlibtommath.dlllibtommath.dll/ 1711619250 0 43 ` d<fmp_zerolibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fs_mp_addlibtommath.dlllibtommath.dll/ 1711619250 0 52 ` d<f s_mp_balance_mullibtommath.dlllibtommath.dll/ 1711619250 0 54 ` d<f"s_mp_karatsuba_mullibtommath.dlllibtommath.dll/ 1711619250 0 54 ` d<f"s_mp_karatsuba_sqrlibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<fs_mp_mul_digslibtommath.dll libtommath.dll/ 1711619250 0 54 ` d<f"s_mp_mul_digs_fastlibtommath.dlllibtommath.dll/ 1711619250 0 48 ` d<fs_mp_reverselibtommath.dlllibtommath.dll/ 1711619250 0 44 ` d<fs_mp_sqrlibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<fs_mp_sqr_fastlibtommath.dll libtommath.dll/ 1711619250 0 44 ` d<fs_mp_sublibtommath.dlllibtommath.dll/ 1711619250 0 49 ` d<fs_mp_toom_mullibtommath.dll libtommath.dll/ 1711619250 0 49 ` d<fs_mp_toom_sqrlibtommath.dll tcl9.0.3/libtommath/win64/libtommath.dll.a0000664000175000017500000005371615104661341017750 0ustar sergeisergei! / 0 0 0 0 5736 ` )d jj66nn>>zzNN $ $ !`!`!!"2"2""###r#r##$J$J$$%$%$%%%%&f&f&&':':''(((v(v(()N)N))*"*"****+`+`++,>,>,,------.X.X../,/,//000n0n001F1F112"2"22223f3f334<4<44555|5|556P6P667 7 77778X8X889@9@99:(:(::::;`;`;;<2<2<<<<=f=f==>D>D>>?2?2??@@@@AAAAAAB\B\BBC4C4CCDDDDDDEdEdEEFFFFFFGGGGGGHVHVHHI*I*IIIIJhJhJJKBKBKKLLLLLLMXMXMMN(N(NNOOOfOfOOP8P8PPQQQxQxQQRNRNRRSSSSSSThThTTUHUHUUVVVVVVW`W`__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA__imp_mp_2exptmp_2expt__imp_mp_absmp_abs__imp_mp_addmp_add__imp_mp_add_dmp_add_d__imp_mp_addmodmp_addmod__imp_mp_andmp_and__imp_mp_clampmp_clamp__imp_mp_clearmp_clear__imp_mp_clear_multimp_clear_multi__imp_mp_cmpmp_cmp__imp_mp_cmp_dmp_cmp_d__imp_mp_cmp_magmp_cmp_mag__imp_mp_cnt_lsbmp_cnt_lsb__imp_mp_complementmp_complement__imp_mp_copymp_copy__imp_mp_count_bitsmp_count_bits__imp_mp_decrmp_decr__imp_mp_divmp_div__imp_mp_div_2mp_div_2__imp_mp_div_2dmp_div_2d__imp_mp_div_3mp_div_3__imp_mp_div_dmp_div_d__imp_mp_dr_is_modulusmp_dr_is_modulus__imp_mp_dr_reducemp_dr_reduce__imp_mp_dr_setupmp_dr_setup__imp_mp_error_to_stringmp_error_to_string__imp_mp_exchmp_exch__imp_mp_expt_u32mp_expt_u32__imp_mp_exptmodmp_exptmod__imp_mp_exteuclidmp_exteuclid__imp_mp_freadmp_fread__imp_mp_from_sbinmp_from_sbin__imp_mp_from_ubinmp_from_ubin__imp_mp_fwritemp_fwrite__imp_mp_gcdmp_gcd__imp_mp_get_doublemp_get_double__imp_mp_get_i32mp_get_i32__imp_mp_get_i64mp_get_i64__imp_mp_get_intmp_get_int__imp_mp_get_lmp_get_l__imp_mp_get_llmp_get_ll__imp_mp_get_longmp_get_long__imp_mp_get_long_longmp_get_long_long__imp_mp_get_mag_u32mp_get_mag_u32__imp_mp_get_mag_u64mp_get_mag_u64__imp_mp_get_mag_ulmp_get_mag_ul__imp_mp_get_mag_ullmp_get_mag_ull__imp_mp_growmp_grow__imp_mp_incrmp_incr__imp_mp_initmp_init__imp_mp_init_copymp_init_copy__imp_mp_init_i32mp_init_i32__imp_mp_init_i64mp_init_i64__imp_mp_init_lmp_init_l__imp_mp_init_llmp_init_ll__imp_mp_init_multimp_init_multi__imp_mp_init_setmp_init_set__imp_mp_init_set_intmp_init_set_int__imp_mp_init_sizemp_init_size__imp_mp_init_u32mp_init_u32__imp_mp_init_u64mp_init_u64__imp_mp_init_ulmp_init_ul__imp_mp_init_ullmp_init_ull__imp_mp_invmodmp_invmod__imp_mp_is_squaremp_is_square__imp_mp_isevenmp_iseven__imp_mp_isoddmp_isodd__imp_mp_kroneckermp_kronecker__imp_mp_lcmmp_lcm__imp_mp_log_u32mp_log_u32__imp_mp_lshdmp_lshd__imp_mp_modmp_mod__imp_mp_mod_2dmp_mod_2d__imp_mp_mod_dmp_mod_d__imp_mp_montgomery_calc_normalizationmp_montgomery_calc_normalization__imp_mp_montgomery_reducemp_montgomery_reduce__imp_mp_montgomery_setupmp_montgomery_setup__imp_mp_mulmp_mul__imp_mp_mul_2mp_mul_2__imp_mp_mul_2dmp_mul_2d__imp_mp_mul_dmp_mul_d__imp_mp_mulmodmp_mulmod__imp_mp_negmp_neg__imp_mp_ormp_or__imp_mp_packmp_pack__imp_mp_pack_countmp_pack_count__imp_mp_prime_fermatmp_prime_fermat__imp_mp_prime_frobenius_underwoodmp_prime_frobenius_underwood__imp_mp_prime_is_primemp_prime_is_prime__imp_mp_prime_miller_rabinmp_prime_miller_rabin__imp_mp_prime_next_primemp_prime_next_prime__imp_mp_prime_rabin_miller_trialsmp_prime_rabin_miller_trials__imp_mp_prime_randmp_prime_rand__imp_mp_prime_strong_lucas_selfridgemp_prime_strong_lucas_selfridge__imp_mp_radix_sizemp_radix_size__imp_mp_randmp_rand__imp_mp_read_radixmp_read_radix__imp_mp_reducemp_reduce__imp_mp_reduce_2kmp_reduce_2k__imp_mp_reduce_2k_lmp_reduce_2k_l__imp_mp_reduce_2k_setupmp_reduce_2k_setup__imp_mp_reduce_2k_setup_lmp_reduce_2k_setup_l__imp_mp_reduce_is_2kmp_reduce_is_2k__imp_mp_reduce_is_2k_lmp_reduce_is_2k_l__imp_mp_reduce_setupmp_reduce_setup__imp_mp_root_u32mp_root_u32__imp_mp_rshdmp_rshd__imp_mp_sbin_sizemp_sbin_size__imp_mp_setmp_set__imp_mp_set_i32mp_set_i32__imp_mp_set_i64mp_set_i64__imp_mp_set_intmp_set_int__imp_mp_set_lmp_set_l__imp_mp_set_llmp_set_ll__imp_mp_set_longmp_set_long__imp_mp_set_long_longmp_set_long_long__imp_mp_set_u32mp_set_u32__imp_mp_set_u64mp_set_u64__imp_mp_set_ulmp_set_ul__imp_mp_set_ullmp_set_ull__imp_mp_shrinkmp_shrink__imp_mp_signed_rshmp_signed_rsh__imp_mp_sqrmp_sqr__imp_mp_sqrmodmp_sqrmod__imp_mp_sqrtmp_sqrt__imp_mp_sqrtmod_primemp_sqrtmod_prime__imp_mp_submp_sub__imp_mp_sub_dmp_sub_d__imp_mp_submodmp_submod__imp_mp_to_radixmp_to_radix__imp_mp_to_sbinmp_to_sbin__imp_mp_to_ubinmp_to_ubin__imp_mp_ubin_sizemp_ubin_size__imp_mp_unpackmp_unpack__imp_mp_xormp_xor__imp_mp_zeromp_zero__imp_s_mp_adds_mp_add__imp_s_mp_karatsuba_muls_mp_karatsuba_mul__imp_s_mp_karatsuba_sqrs_mp_karatsuba_sqr__imp_s_mp_mul_digss_mp_mul_digs__imp_s_mp_mul_digs_fasts_mp_mul_digs_fast__imp_s_mp_reverses_mp_reverse__imp_s_mp_sqrs_mp_sqr__imp_s_mp_sqr_fasts_mp_sqr_fast__imp_s_mp_subs_mp_sub__imp_s_mp_toom_muls_mp_toom_mul__imp_s_mp_toom_sqrs_mp_toom_sqrlibtommath.dll/ 0 0 0 644 379 ` d.idata$2dx@0.idata$6@ libtommath.dll.idata$2h.idata$6.idata$4h.idata$5h#<X__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA libtommath.dll/ 0 0 0 644 127 ` dP.idata$3<@0__NULL_IMPORT_DESCRIPTOR libtommath.dll/ 0 0 0 644 166 ` dt.idata$5d@@.idata$4l@@ libtommath_NULL_THUNK_DATAlibtommath.dll/ 0 0 0 644 44 ` dmp_2exptlibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_abslibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_addlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_add_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_addmodlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_andlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_clamplibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_clearlibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_clear_multilibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_cmplibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_cmp_dlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_cmp_maglibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_cnt_lsblibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_complementlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_copylibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_count_bitslibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_decrlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_divlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_div_2libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_div_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_div_3libtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_div_dlibtommath.dlllibtommath.dll/ 0 0 0 644 52 ` d mp_dr_is_moduluslibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_dr_reducelibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_dr_setuplibtommath.dll libtommath.dll/ 0 0 0 644 54 ` d"mp_error_to_stringlibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_exchlibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_expt_u32libtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_exptmodlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_exteuclidlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_freadlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_from_sbinlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_from_ubinlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_fwritelibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_gcdlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_get_doublelibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_get_i32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_get_i64libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_get_intlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_get_llibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_get_lllibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_get_longlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_get_long_longlibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_u32libtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_u64libtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_get_mag_ullibtommath.dll libtommath.dll/ 0 0 0 644 50 ` dmp_get_mag_ulllibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_growlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_incrlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_initlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_init_copylibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_i32libtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_i64libtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_init_llibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_init_lllibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_init_multilibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_setlibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_init_set_intlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_init_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_u32libtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_init_u64libtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_init_ullibtommath.dlllibtommath.dll/ 0 0 0 644 47 ` dmp_init_ulllibtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_invmodlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_is_squarelibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_isevenlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_isoddlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_kroneckerlibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_lcmlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_log_u32libtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_lshdlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_modlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mod_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_mod_dlibtommath.dlllibtommath.dll/ 0 0 0 644 68 ` d0mp_montgomery_calc_normalizationlibtommath.dlllibtommath.dll/ 0 0 0 644 56 ` d$mp_montgomery_reducelibtommath.dlllibtommath.dll/ 0 0 0 644 55 ` d#mp_montgomery_setuplibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_mullibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_mul_2libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mul_2dlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` dmp_mul_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_mulmodlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_neglibtommath.dlllibtommath.dll/ 0 0 0 644 41 ` dmp_orlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_packlibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_pack_countlibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_prime_fermatlibtommath.dll libtommath.dll/ 0 0 0 644 64 ` d,mp_prime_frobenius_underwoodlibtommath.dlllibtommath.dll/ 0 0 0 644 53 ` d!mp_prime_is_primelibtommath.dll libtommath.dll/ 0 0 0 644 57 ` d%mp_prime_miller_rabinlibtommath.dll libtommath.dll/ 0 0 0 644 55 ` d#mp_prime_next_primelibtommath.dll libtommath.dll/ 0 0 0 644 64 ` d,mp_prime_rabin_miller_trialslibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` dmp_prime_randlibtommath.dll libtommath.dll/ 0 0 0 644 67 ` d/mp_prime_strong_lucas_selfridgelibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_radix_sizelibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_randlibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_read_radixlibtommath.dll libtommath.dll/ 0 0 0 644 45 ` dmp_reducelibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_reduce_2klibtommath.dlllibtommath.dll/ 0 0 0 644 50 ` dmp_reduce_2k_llibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"mp_reduce_2k_setuplibtommath.dlllibtommath.dll/ 0 0 0 644 56 ` d$mp_reduce_2k_setup_llibtommath.dlllibtommath.dll/ 0 0 0 644 51 ` dmp_reduce_is_2klibtommath.dll libtommath.dll/ 0 0 0 644 53 ` d!mp_reduce_is_2k_llibtommath.dll libtommath.dll/ 0 0 0 644 51 ` dmp_reduce_setuplibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_root_u32libtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_rshdlibtommath.dll libtommath.dll/ 0 0 0 644 48 ` dmp_sbin_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_setlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_i32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_i64libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_intlibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_set_llibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_set_lllibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_set_longlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_set_long_longlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_u32libtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_set_u64libtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_set_ullibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_set_ulllibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_shrinklibtommath.dll libtommath.dll/ 0 0 0 644 49 ` dmp_signed_rshlibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_sqrmodlibtommath.dll libtommath.dll/ 0 0 0 644 43 ` dmp_sqrtlibtommath.dll libtommath.dll/ 0 0 0 644 52 ` d mp_sqrtmod_primelibtommath.dlllibtommath.dll/ 0 0 0 644 42 ` dmp_sublibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` dmp_sub_dlibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_submodlibtommath.dll libtommath.dll/ 0 0 0 644 47 ` dmp_to_radixlibtommath.dll libtommath.dll/ 0 0 0 644 46 ` dmp_to_sbinlibtommath.dlllibtommath.dll/ 0 0 0 644 46 ` dmp_to_ubinlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` dmp_ubin_sizelibtommath.dlllibtommath.dll/ 0 0 0 644 45 ` dmp_unpacklibtommath.dll libtommath.dll/ 0 0 0 644 42 ` dmp_xorlibtommath.dlllibtommath.dll/ 0 0 0 644 43 ` dmp_zerolibtommath.dll libtommath.dll/ 0 0 0 644 44 ` ds_mp_addlibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"s_mp_karatsuba_mullibtommath.dlllibtommath.dll/ 0 0 0 644 54 ` d"s_mp_karatsuba_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_mul_digslibtommath.dll libtommath.dll/ 0 0 0 644 54 ` d"s_mp_mul_digs_fastlibtommath.dlllibtommath.dll/ 0 0 0 644 48 ` ds_mp_reverselibtommath.dlllibtommath.dll/ 0 0 0 644 44 ` ds_mp_sqrlibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_sqr_fastlibtommath.dll libtommath.dll/ 0 0 0 644 44 ` ds_mp_sublibtommath.dlllibtommath.dll/ 0 0 0 644 49 ` ds_mp_toom_mullibtommath.dll libtommath.dll/ 0 0 0 644 49 ` ds_mp_toom_sqrlibtommath.dll tcl9.0.3/libtommath/win64/libtommath.dll0000775000175000017500000023700015104661341017522 0ustar sergeisergeiMZx@x !L!This program cannot be run in DOS mode.$PEdf" @`@L ,P4p|(/.text `.rdataL/0@@.data@.@.pdata4P 0@@.tls`:@.reloc|p<@BH 0@AWAVATVWUSH AY0<0H51H>tH1H>uH=H W01HMIeH%0HpH=P1H7t$H9tH-p1H7tH9uH5!u >uH HuH Hft1HHHHt LMЃk/E1 DH []_^A\A^A_Haf.@AWAVAUATVWUSH(L=9A1/ ,MƉIGw*LMLMuLMAăE1L1M|L1M_q.`.H51H.t#Hf.f1H.uHYH .1HtDu!LMLMDAH([]_^A\A]A^A_Ãu-~׃-H=1H7t#Hf.f1H7uH5u6H [-11HjZ/1B1Af.HH -H(xs1H(f.VWSH yt-LHHH10 uHHIH [_^0H [_^f Tf.VH HHfH ^ f.髯f.鋶f.Kf.Kf.鋁f.髇f.鋎f.˗f.Kf. f.f.f.f.@f.|f.mf.+f.H(Wl1H(H(l1H(f.@H(wl1H('f.(f.'f.VH H'HHك~HDH ^f.DB…tLAHIDHt HIE1MQHf.@HL!K4IHDHFH9(s;HFEINEHFINt_A>uHH+(H)%)D$ HFHD$0D$(HL$ HMpAFLtDEILA@rmDƒ11I,HHIL$E~\IFEOE1AJHH9sJHH9IMIIXHHH׃H s 1g1]H1fLLD L0D L0D@LPD@LPD`LpD`LpHHuHt>HHHHH1f.D2 2D3 3H H9uJ M9JDD)DDt)1f.H0HH1H9uA)DreDD)1Ht5F,H\FHFHHrHH1H ^úHIH ^SgAWAVAUATVWUSH:LLHHH$8Aą$H$$Aą|H$ AąWHL$@HDAą2HL$XH,AąC;ED$0D$`D$HHL$X\HHiȉH k<)1:;;)HL$@I1,AąHL$XI,AąLcl$@Lct$XEE)HL$XD"Aąu]Lt$8Ll$pl$x1L$0ȉD$|McHl$@Ll$XHLH$JHLI"etAHL$X1HL$@'H$H$ H$(A Ht2HHAHtHmDH[]_^A\A]A^A_E1HuHL$XDWLl$pLd$8E9AD$H$HIL$HcD$@I9~ IELL$PKHT$hJTH9u*H$DD)D$,LcJ,IEHD$0HIIH|$(FD$0Lt$ L|$8LvH1E1FHt$PH\$@Ld$XHD$HHL$PHT$@fH~HHH)II HHv ItD~E1zH([]_^A\A]A^A_VWH(HHHIu 1ɀ?NH(_^AVVWSH(LIH΃yH uMH[Ht61HIu"AHNH HH9uH1H([_^A^AVVWUSH@MƉHLD$49ÅuvHc\$4HHt_HƉl$ LL$8HHIbTÅu!HT$8AHM1HLcD$4Mt H1H/H@[]_^A^AVVWUSHPLH׃9KHʃ?DHL$8ŅxHL$ HŅWD$(D$@HL$8VHL$ J9ADLE~:HL$8DIE1GŅHL$ DIE1*Ņ9~D)HL$8IE1Ņ9}D)HL$ IE1ŅH|$8H\$ |$ tgHH>u HHHHIНuHtHىIE1t9HHHHP[]_^A^HL$8DI"Ņu F1HL$8HL$ HP[]_^A^DEILIMBLfWHtMf( f('IDA$f\f(fXYXHuIAf( f(f.CA$f\f(fXYXCA$f\f(fXYXIBA$f\f(fXYXIDA$f\f(fXYXHZyufWfWytVH Hcك~DH ^VH HSHHك~HDH ^VH Hcك~DH ^̃9tHA1̋B…tLAHIDHt H1>t7F.H=BHFHHH9wHH1H ^úHIH ^VH Hι HFHtH HF1H ^VWSH HH΋DžuHHt H1H [_^VWSH HODžu HىAH [_^VWSH HHDžu HHAH [_^VWSH HDžu HىAH [_^VWSH0HT$XLD$`LL$hH\$XH\$(Ht-H1fDuHD$(HHHL$(HHu1,H\$ tHHD$ HHHL$ H0uH0[_^VWSH HH.Džu HH@H [_^VWH(x8H΃CHHFHt~F1 H(_^VWSH HDžu Hى@H [_^VWSH HHnDžu HH@H [_^VWSH H?Džu Hى@H [_^VWSH zt>LHH˺H=u#?~ HGu"HHIH [_^jH [_^HHIH [_^3gVWSH@yH1ۃ9HGHH <HLD$8iHfÅHD$8H <HL$ 8rÅ{HT$ HIÅWHL$ 4A.IH#Z)1ۺ#IiONH"I )ʹ IH$ʉ)Ѻ\k(IH ) ҍ J)ʹ BIH$I)z =IH$ɍRʉ)Ѻ . r`IiȅBH )¸Hmr>HT$ H@Åu+HL$ H?ÅuHL$ H"1Ʌ1HL$ H@[_^̃9t HAЃø̃9~ HA1AWAVAUATVWUSHhLHσ:HӅt HGuHCu 1HL$8HLŅHL$ H5Ņ}Hl$ HHIE1ŅJAtHGHH D$|$(uD$(D؃|$@DDHL$PkŅH|$8L|$PLt$ L-|$8HHIE1uvtHD$0HEd1|$@HL$HDHT$0#AܨDDHLMu-D$XLLIuLL$a6uHOH9t118HL$ 1DED&HL$PHL$ HL$8Hh[]_^A\A]A^A_VWUSHXLHHHL$@HT$(E1MŅuoLD$@HHŅuGHHfHT$@LD$(tJHE1LH߅uHT$(HIFHL$@HT$(E1XHX[]_^HE1ŅuVWH(ytH(_^Éփ|LDEtFu(zAuHAHHHNz1IH(_^wAWAVAUATVWUSH(1ۅHϋՍ(9W}HÅu{(HOA~\LcN$INMM)Սz9LAA)AsM1f.fI\IH9~ I11H([]_^A\A]A^A_9L݉)HLH)L9wLH)L9w9L)HHLHLL)HH9sJLHLH)HH9LIMIICIIIHtRLHJ4HHL)1fDD  DDLLDHHuH1At HLH)LH)@HKCM9JI)I)D)AVVWSH8MHH΋HL$ ÅuVLL$ HHE1YÅu3|$ t D$(;GuHL$ L1HT$ HM2HL$ H8[_^A^AVVWSH(Lƅ~rkEFAFINE~!IL^Au1Au{1EA1E11LI$HHHHL!HLIdHHHHL!HDIHA9uM)L)AtLI#HHHI!L HHDH1D~)HEAHAE)AN1褱AE>L1H [_^A\A]A^A_AWAVVWSH@MLIHAHL$(Åu2LD$(HLfÅuHL$(HMPHL$(H@[_^A^A_VWH(HHH9tHHu1>t 1ɃNH(_^AWAVAUATVWUSHHHT$029OLdzHL$8yt HD$0xÍn9wHcl$,H|$@DӅ8IHL$8DAHD$0DHHT$@HZD\$,Hc9HcA1AfHI9Au=LH9}HD$8H@HHL!LIM!H3("!AWAVAUATVWUSH8DL$$DAAIω1݃@H葝HHǃ1HD$0@(‰T$,T$$б(ـAADDAEA HL$$9"D$,؈HD$0D4Dd7LHIucLDLD$(quOD$(D$$ttLM."u,LLuLDLD$(+u D$(N@S2D$$u1'LLŅuLMŅtHt H1I訜HH8[]_^A\A]A^A_f.H8H%HD$ HD$(H8f.fVH օ~H1ɅEH ^AWAVAUATVWUSHHHH$HD$pH$`HD$hH$xHD$`H$HD$XH$HD$PH$HD$HH$0HD$@H$HHD$8H$HD$0H$HD$(H$HD$ HD$xH$H$L$L$AŅUH$L$L$H$f.DL#HLM56LPuLH#ADEy DŽ$LHI$tہrAD)D)IL$H}AŅH$H2L$HE1;AŅoH$+H$H$H$H$HHCH$0HAŅH$H$\$H$H$H$ 9$H$H$xHI2cHHIMHH$HH/HH$0ISHHIH$HHHHHIHH$0TH$:HHH$L$IzH$H$HL$!RHH$L$x2HHH$H$`I HDIH$H$L$@H$$$~CH$t%H$HI$~H$0@1H$Hj[$@ <uH$I,H$xH$`L$v$~CH$t%H$HID$~H$0@1H$H诹$@ <uH$I qH$HI%$OH$HI4HH$HIHHIm$$HH$H$aAŅHE1$H$L$ 9HH@uuHH$Iu^HHIuL$tG;$}LLu*LHMuLH$qAH$E1Lt$pLd$hH$HD$`H$HD$XH$HD$PH$HD$HH$HD$@H$HHD$8H$0HD$0H$HD$(H$HD$ HD$xH$H$`L$xL$ԬDH[]_^A\A]A^A_f.AVVWUSH@LƉHHL$(Ņu'Lt$(L/HLIL'H@[]_^A^AWAVVWUSHHAGMH΃9t%u+H1Ƀ~ȃA1A1tD~HL$(H~Åu]1A@D$0|$(t.H|$(L|$@HHIM߹u|$(uA.1HL$(;HH[]_^A^A_HHV_HEHf.AWAVVWSH H1.HwHOAJ2I^DHOL4uJ Ht7s1DHBHHHHtSHH1(D T\ d0TT TTT\ d0HHu1@tL(TTL1L9t1fL!4HI9uH [_^A^A_AWAVAUATVWUSH(DHH2CAE1}-AH BD=H L)AI4/Hf.HPCу%CʃI9rHH, t59}1HLIXu5HHIfu#Hu< t< uE1?tD AHRDH([]_^A\A]A^A_AVVWUSH@LIHϋHL$(H>ŅSHL$(HL$(HIȅx A0VŅHL$(PkHH9H9uA)DreDD))1fDH,H)HlHiHlHiHlHiHl Hi Hl(Hi(Hl0Hi0Hl8Hi8H@H9uDA9~AN1E>H([]_^A^A_H(HH(H(I1I!LIMAQ9~1MI L1tH(VWH(HH{yFH(_^VWH(HHHHHHyFH(_^VWH(HHyFH(_^H(tLAILA1AQ9~I L1艄H(VH LAHt>IE1MQHf.@HL!K4IHt&HH$IIHD$XHT$XHH$IvHI^H$HII耨H$HIIbHHL$uxHL$xHIIpuaHL$`H$IITuEHT$XH$HL$`HaƅL|$xHl$`HL$xL;L|$xHl$`VWUSH(LHHˋi;juHHt$nHH)nHHIH([]_^1FHHIH([]_^cMAWAVVWUSH8MHHˋA9PL(ƅ{u@)D$ HCHD$0D$(HL$ HMߎAFLREINL{u IH9AFAD EIAAr|EA11f.IH)HH?L!HITHH?L!HTI|HH?L!H|ITHH?L!HTHHA9uH)I)At\DȃH1f.I<H)HH?L!H<H9uH$E1H)H)HAFAAE9~AEN1@yL訑1H8[]_^A^A_AWAVVWSH@MMHHHL$(?Åu2LD$(HHyÅuHL$(LMHL$(wH@[_^A^A_AWAVAUATVWUSHHI'$FMIIσ9LHL$ LDž|$(uA$-ID$(H1|$ t}HD$8HL(H1Hl$ f.fH9t~HHT$8ILL$@ulHD$@ADA4H|$ uI4fA$01MtJIAL1LH+EMt1AHHI HL$ HH[]_^A\A]A^A_VWSH Mt.LHHHI.uHtH{1H [_^AWAVVWUSH8MLHHH9wmIHL$ HYŅuWHt$ LLHr*HL$0 LHIE1軛H؅t 1MtM>HL$ H8[]_^A^A_H(7HcHHHHH(AWAVAUATVWUSHXLL$0DD$,IHH$SHw!H;HcH?! HMHHL$0HH)HT$HAA)HHHHD$81L|$@fDHD$PHL|$@L9IIM|$,HD$PLDH|$HtLl$0L$Ld$81DH+$IEE|HۺADHIu/D!HIEHOH HIrZH"1HX[]_^A\A]A^A_AWAVAUATVWUSHHLNjHL$(I2HT$0Dz9On1ۉL$D$4L,@N4IƀE1SLuAID9u$t*L$HT$(HL5`HT$(H莩ŅL$S=L5;H LM=LMHL$@؛ŅHL$@HŅlHT$@HL$8IMŋL$4D)9} AJ4HƀHyHAuH$yrŅ L5SHL$@9ŅHL$@0HL$8HMŅHH@L$IĀLLb{ŅMLLmLD$(LHAօWuDd$4DKdH HII9s3HyLI`LD$(HHA։HtHD$`D$8A1D$0D$$1Au*L$8MHD$`H@HcуL$8Hu:Ht$@HHoLD$(HHA։Ÿ{Ol$$LD$xD) T$0Dl$$A9Dd$\EL$$Ld$@LLELD$(LHAօL$$uHcD$0H@HH€HL$@IELD$(HL$@H\$hHA։ŸD$0D$$L$Dd$\w|$0t$$Ld$@ LL~u=LD$(LHAօu+DtLLMSuLD$(LHAօtHL$@vLvL$4D9BH@H4HƀA)HvHAu$tHL$@HT$p1LD$(HL$@HA։ŅwщL$f̉ALI%1D;}Ak<)HADH 1HAWAVAUATVWUSH:HHBLHL|$8L|$(Ll$hLl$ HD$0H$H$LD$PL$:ŅudH$HdwŅuL$HH軟ŅtKL|$(Ll$ HD$0H$H$LD$PL$PuH[]_^A\A]A^A_Ã$t$tH$HT$PvŅuH$H$vŅeLt$8L(L$HL$hH1Ņ2|$Pt HD$`uYHL$PH L|$h~HD$xtHL$hH$I tLL~Ņ$t H$u@LL~|$8~HD$HtLH$MtHl$PHL6tt#HLIsHL$hLILHMPugLHT$hMADD)HL$0IqHL$`HIHH_t tu#HT$HEEHL$HH^EEEEe1QAHt$HLd$`DEHL`u(HHsuG<6HH^tHD$0HD$ HD$(HL$`HT$HL$LL$x]HĨ[]_^A\A]A^A_VH 1u"1Hf.DHHtaH ^AWAVAUATVWUSH8E1H $H9AIAvMAE1H$f.fDLHD?HIHHIIIHL9LHr1AH$E1ɻ1LD$f.fA1LH\$ HLIHLLD$I9HL\$0Dt$ EBLBHT$HBL9HHH|$(ABHBHBL1H D)H\$ L\$0BD$ H|$()HT$YLcMI?E1H$1Mf.@DHHICLHIH!LHHMM?IHHHHHM9LLIMMHrL1L ADADH8[]_^A\A]A^A_AWAVAUATVWUSh *7H)LD$XD!AUHIϋD9QLy2AMw~CHL$`sLhHL$`1݃LfHHHAHBHAHAHBHA HA(HBH HA0HA8H@ut+؃1fHA/LVLHWt!LHMHh []_^A\A]A^A_j1Hh []_^A\A]A^A_AWAVAUATVWUSHhEDLIIAw5A$A9Lȁ!LLIAHh[]_^A\A]A^A_HL$PwHt$0l$PE$EHt$`IAD$,ID$HD$@MWE1Ht$HAl$(LD$8fIAHM9-D$,D9EDLAE)D9DLHD$HJHH+8HH?L!H9HHDD)DDt31f.HHHHH?L!HH9uA)׃rlDD)1f.@HH$D``ƅ 1AH$D$IT$DAs AI1IHH9HH9A1^HHH$HHHHHLL$8HHHJMI)HL]1AsLCDCLDLCCLHIHuRHEHHHAAAH s1kHHH!1LLD L0D L0D@LPD@LPD`LpD`LpHHuMt1H4HHHI1D D H I9uH9tYHHHHHtH4H4HHuHr/HHHDHDHDHDHDHDHH9uED$DLDH$`HL$8LM&Ņu(HT$ LM&ŅuHT$hLM&HL$8+HL$P+HL$ +HL$hw+HĀ[]_^A\A^A_GJJH(HKHHt*f.HKHHH KH@HuH(f.@VWH(H5(uHH<utf.HuH ^H(_^VWH(=#LtH(_^LH5'uHH<utf.HuH H(_^sVWH(H{'8tt8u=H5G)H=@)H9u(fHH9tHHtQ H(_^D1f.H(tu H(UAWAVAUATVWSHHl$=4Km'KH  H HHHHCH)HHJJL5 (LH+ (HH'LH)H |,H';u H'{uH'HX xHE؃;u {H;'sGH='Huf.DK9HEH AH0H HL9rӋ=J~hH%J1LuH59f.@HHcH(H9}/DD:EtHL:H:H MH HIIHe[_^A\A]A^A_]ËSTH H;&`L-&L=IAf.H L90DSAr CLN )Ic?  !"#$%&'()*+,-./0123456789:;<=X@@ %)+/5;=CGIOSYaegkmq %379=KQ[]agou{  #-39;AKQWY_eikw)+57;=GUY[_mqsw %'-?CEIOU]ci  ')/QW]ew #+/=AGIMSMicrosoft Base Cryptographic Provider v1.0 ``HA@p@ Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. %d bit pseudo relocation at %p out of range, targeting %p, yielding the value %p. Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%xMingw-w64 runtime failure: runtime error %d 0@phw!3$libtommath.dll0 `0 p !p!!# $$P* , .0P02 2P22203`48899@:<p===0 ==0>`@>>0???@0@`@@ AAAABBDDDFG HJJ@KPKLNOOQTpUU VW0ZZ[_b@dfpjjstv w`x yyPzz0{|P|~0 p0P0Ѝ@АpPPP0P0 a%j%q%x%%%%%%%%%%%%%%& &&&(&1&B&O&[&n&v&&&&&&&&&&&&&'''&'7'F'U'c'r'z''''''''''''(((*(4(A(K(T(a(h(q(|(((((((((() )))")*)8)H)e)w)))))))***'*6*I*^*n*************+++)+3+>+H+V+]+g+o++++++++++++++,",0,C,P,Y,g,p,~,  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~mp_2exptmp_absmp_addmp_add_dmp_addmodmp_andmp_clampmp_clearmp_clear_multimp_cmpmp_cmp_dmp_cmp_magmp_cnt_lsbmp_complementmp_copymp_count_bitsmp_decrmp_divmp_div_2mp_div_2dmp_div_3mp_div_dmp_dr_is_modulusmp_dr_reducemp_dr_setupmp_error_to_stringmp_exchmp_expt_nmp_expt_u32mp_exptmodmp_exteuclidmp_freadmp_from_sbinmp_from_ubinmp_fwritemp_gcdmp_get_doublemp_get_i32mp_get_i64mp_get_intmp_get_lmp_get_llmp_get_longmp_get_long_longmp_get_mag_u32mp_get_mag_u64mp_get_mag_ulmp_get_mag_ullmp_growmp_incrmp_initmp_init_copymp_init_i32mp_init_i64mp_init_lmp_init_llmp_init_multimp_init_setmp_init_set_intmp_init_sizemp_init_u32mp_init_u64mp_init_ulmp_init_ullmp_invmodmp_is_squaremp_isevenmp_isoddmp_kroneckermp_lcmmp_log_nmp_log_u32mp_lshdmp_modmp_mod_2dmp_mod_dmp_montgomery_calc_normalizationmp_montgomery_reducemp_montgomery_setupmp_mulmp_mul_2mp_mul_2dmp_mul_dmp_mulmodmp_negmp_ormp_packmp_pack_countmp_prime_fermatmp_prime_frobenius_underwoodmp_prime_is_primemp_prime_miller_rabinmp_prime_next_primemp_prime_rabin_miller_trialsmp_prime_randmp_prime_strong_lucas_selfridgemp_radix_sizemp_randmp_read_radixmp_reducemp_reduce_2kmp_reduce_2k_lmp_reduce_2k_setupmp_reduce_2k_setup_lmp_reduce_is_2kmp_reduce_is_2k_lmp_reduce_setupmp_root_nmp_root_u32mp_rshdmp_sbin_sizemp_setmp_set_i32mp_set_i64mp_set_intmp_set_lmp_set_llmp_set_longmp_set_long_longmp_set_u32mp_set_u64mp_set_ulmp_set_ullmp_shrinkmp_signed_rshmp_sqrmp_sqrmodmp_sqrtmp_sqrtmod_primemp_submp_sub_dmp_submodmp_to_radixmp_to_sbinmp_to_ubinmp_ubin_sizemp_unpackmp_xormp_zeros_mp_adds_mp_balance_muls_mp_karatsuba_muls_mp_karatsuba_sqrs_mp_mul_digss_mp_mul_digs_fasts_mp_reverses_mp_sqrs_mp_sqr_fasts_mp_subs_mp_toom_muls_mp_toom_sqrX-3/-38/-3H/.!4/@.A4/`.b40x.o4(0.|4x0.40000000011"1<1T1j1x1111112202J2f2n2x222222223343<3J3\3l3|33333000000011"1<1T1j1x1111112202J2f2n2x222222223343<3J3\3l3|33333_set_new_modecallocfreemallocreallocmemcpy__p___argc__p___argv__p___wargv_configure_narrow_argv_configure_wide_argv_crt_at_quick_exit_crt_atexit_execute_onexit_table_initialize_narrow_environment_initialize_onexit_table_initialize_wide_environment_initterm_register_onexit_functionabort__acrt_iob_func__stdio_common_vfprintf__stdio_common_vfwprintffgetcfwritememsetstrlenstrncmpCryptAcquireContextACryptGenRandomDeleteCriticalSectionEnterCriticalSectionGetLastErrorInitializeCriticalSectionLeaveCriticalSectionSleepTlsGetValueVirtualProtectVirtualQuery__p__environ__p__wenviron__daylight__timezone__tzname_tzsetapi-ms-win-crt-heap-l1-1-0.dllapi-ms-win-crt-private-l1-1-0.dllapi-ms-win-crt-runtime-l1-1-0.dllapi-ms-win-crt-stdio-l1-1-0.dllapi-ms-win-crt-string-l1-1-0.dllADVAPI32.dllKERNEL32.dllapi-ms-win-crt-environment-l1-1-0.dllapi-ms-win-crt-time-l1-1-0.dll2 0 Pp` B 0 P p `B20p`2`BBB2`20p`Bp`20p`2`R`20p`20p`BBB0Pp`2`  20Pp`  r0Pp`  r0p`  0 P p `2`B2`  B 0p`2`  0 P p ` B 0 P p ` hR 0 p `  0 P p ` b 0 P p `"b0Pp`  0Pp` - 0 P p ` B 0 P p `Bp`  B0p`  r0Pp`  0Pp`2`2`2`20p`2`2`20p`20p`20p`20p`R0p`20p`Bp`20p`20p`20p`20p`r0p`  0 P p `0Pp`Bp` B 0 P p `  b0p`  B0p`20p` b 0 P p `2 0 Pp` B 0 P p `""hx 0 p `2 0 p `  r0p`Bp`  0 P p `  0 P p `Bp`  b0p`  0 P p `  0 P p `  0Pp`   0 P p ` b 0 P p `b2` A 0 P p `  r0Pp`  0Pp`  20p` B 0 P p `  r0Pp`  b0Pp`  b0Pp`r0p`r0p`Bp``Bp`  0 P p `  B0Pp`BBBp`Bp`Bp`B2`B20p`Bp`2`  b0p`  0p` ' 0 P p `B0Pp`  b0Pp`  r0p`  0 P p `20p`  b0Pp`B  0 P p `  0 P p `B B 0 P p `  0 P p `  0 P p `  0 P p `  0 P p `  0 P p ` ! 0 P p `  0 P p `0Pp`  0 P p `2` b 0 P p `   0 P p `  0 P p `   0 P p `  0 P p `   0 P p `  R0p`0p`bp` b 0 P p `   0 P p `2 0 Pp` % 0 P p ` 0 Pp`BBp`Bp`Bp`B " 0 p ` P  0p`R`  20p`  20p`2`2`BBb  B0p`Bp`  B0p`20p``Bp`bPx^8xAA@@`@px@@`@PSTPDT444 g45 5550Q$5,585-D50P5X5`50pl5px555s55!505 5X550 5p!!6!#6 $$6$I*$6P*,<6 ,.T6 .0l6P016P2262$3603\46`47688689699795:7@:; 7p==07==87==@7@>>H7>/?T70?s?\7??d7??p7@-@|70@[@7`@@7@A7 AuA7AA7AA7A B7B}B7BD7DF7FG 8GH8 H J(8JJ@8J6KP8PKL`8LNl8OO8OQ8QT8TmU8pUU8UV8 VW9W,Z90ZtZ09Z[<9[ _L9_bd9b@d|9@df9hcj9pjj9jj9j#s90ss9stt9tu :vw: wWx4:`x yD: yyX:yNzl:Pzzx:z0{:0{ |:|F|:P|~:~:":0:::: m;p ;M;P;(;v4;݄<;+L;0v\;t;ɍ;Ѝ7;@;;;Ð;Аp;pM<P<t <8<P<h<o<<}<A<P<<O =PT=`,=GD=P\=t= v===~=$=0K=P)=0> N(>P<>D>mP>p\> h>Dp>P>U>`>[>`>>:>P>> >>? ?P ?,?4? / 1711619198 0 6186 ` 1034N55666x6x667J7J778888889`9`99:2:2::; ; ;x;x;;\>\>>?8?8??@@@@@@AXAXAAB0B0BBCCCvCvCCDNDNDDE$E$EEEEFhFhFFG<G<GGHHHHHHIhIhIIJ@J@JJKKK~K~KKLVLVLLM,M,MMNNNvNvNNOPOPOOP(P(PPPPQlQlQQR@R@RRSSSSSSTTTTTTU&U&UUVVVVVVWdWdWWX8X8XXY Y YtYtYYZBZBZZ[ [ [[\\\\\\]x]x]]^f^f^^_<_<__``````afafaabLbLbbc.c.ccdddldlddeBeBeeffffffgZgZggh8h8hhiiiziziijPjPjjk&k&kkkkljljllm<m<mmnnn~n~nnoXoXoop*p*ppppqnqnqqrVrVrrs8s8ssttt~t~ttuVuV__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATA__imp__mp_2expt_mp_2expt__imp__mp_abs_mp_abs__imp__mp_add_mp_add__imp__mp_add_d_mp_add_d__imp__mp_addmod_mp_addmod__imp__mp_and_mp_and__imp__mp_clamp_mp_clamp__imp__mp_clear_mp_clear__imp__mp_clear_multi_mp_clear_multi__imp__mp_cmp_mp_cmp__imp__mp_cmp_d_mp_cmp_d__imp__mp_cmp_mag_mp_cmp_mag__imp__mp_cnt_lsb_mp_cnt_lsb__imp__mp_complement_mp_complement__imp__mp_copy_mp_copy__imp__mp_count_bits_mp_count_bits__imp__mp_decr_mp_decr__imp__mp_div_mp_div__imp__mp_div_2_mp_div_2__imp__mp_div_2d_mp_div_2d__imp__mp_div_3_mp_div_3__imp__mp_div_d_mp_div_d__imp__mp_dr_is_modulus_mp_dr_is_modulus__imp__mp_dr_reduce_mp_dr_reduce__imp__mp_dr_setup_mp_dr_setup__imp__mp_error_to_string_mp_error_to_string__imp__mp_exch_mp_exch__imp__mp_expt_n_mp_expt_n__imp__mp_expt_u32_mp_expt_u32__imp__mp_exptmod_mp_exptmod__imp__mp_exteuclid_mp_exteuclid__imp__mp_fread_mp_fread__imp__mp_from_sbin_mp_from_sbin__imp__mp_from_ubin_mp_from_ubin__imp__mp_fwrite_mp_fwrite__imp__mp_gcd_mp_gcd__imp__mp_get_double_mp_get_double__imp__mp_get_i32_mp_get_i32__imp__mp_get_i64_mp_get_i64__imp__mp_get_int_mp_get_int__imp__mp_get_l_mp_get_l__imp__mp_get_ll_mp_get_ll__imp__mp_get_long_mp_get_long__imp__mp_get_long_long_mp_get_long_long__imp__mp_get_mag_u32_mp_get_mag_u32__imp__mp_get_mag_u64_mp_get_mag_u64__imp__mp_get_mag_ul_mp_get_mag_ul__imp__mp_get_mag_ull_mp_get_mag_ull__imp__mp_grow_mp_grow__imp__mp_incr_mp_incr__imp__mp_init_mp_init__imp__mp_init_copy_mp_init_copy__imp__mp_init_i32_mp_init_i32__imp__mp_init_i64_mp_init_i64__imp__mp_init_l_mp_init_l__imp__mp_init_ll_mp_init_ll__imp__mp_init_multi_mp_init_multi__imp__mp_init_set_mp_init_set__imp__mp_init_set_int_mp_init_set_int__imp__mp_init_size_mp_init_size__imp__mp_init_u32_mp_init_u32__imp__mp_init_u64_mp_init_u64__imp__mp_init_ul_mp_init_ul__imp__mp_init_ull_mp_init_ull__imp__mp_invmod_mp_invmod__imp__mp_is_square_mp_is_square__imp__mp_iseven_mp_iseven__imp__mp_isodd_mp_isodd__imp__mp_kronecker_mp_kronecker__imp__mp_lcm_mp_lcm__imp__mp_log_n_mp_log_n__imp__mp_log_u32_mp_log_u32__imp__mp_lshd_mp_lshd__imp__mp_mod_mp_mod__imp__mp_mod_2d_mp_mod_2d__imp__mp_mod_d_mp_mod_d__imp__mp_montgomery_calc_normalization_mp_montgomery_calc_normalization__imp__mp_montgomery_reduce_mp_montgomery_reduce__imp__mp_montgomery_setup_mp_montgomery_setup__imp__mp_mul_mp_mul__imp__mp_mul_2_mp_mul_2__imp__mp_mul_2d_mp_mul_2d__imp__mp_mul_d_mp_mul_d__imp__mp_mulmod_mp_mulmod__imp__mp_neg_mp_neg__imp__mp_or_mp_or__imp__mp_pack_mp_pack__imp__mp_pack_count_mp_pack_count__imp__mp_prime_fermat_mp_prime_fermat__imp__mp_prime_frobenius_underwood_mp_prime_frobenius_underwood__imp__mp_prime_is_prime_mp_prime_is_prime__imp__mp_prime_miller_rabin_mp_prime_miller_rabin__imp__mp_prime_next_prime_mp_prime_next_prime__imp__mp_prime_rabin_miller_trials_mp_prime_rabin_miller_trials__imp__mp_prime_rand_mp_prime_rand__imp__mp_prime_strong_lucas_selfridge_mp_prime_strong_lucas_selfridge__imp__mp_radix_size_mp_radix_size__imp__mp_rand_mp_rand__imp__mp_read_radix_mp_read_radix__imp__mp_reduce_mp_reduce__imp__mp_reduce_2k_mp_reduce_2k__imp__mp_reduce_2k_l_mp_reduce_2k_l__imp__mp_reduce_2k_setup_mp_reduce_2k_setup__imp__mp_reduce_2k_setup_l_mp_reduce_2k_setup_l__imp__mp_reduce_is_2k_mp_reduce_is_2k__imp__mp_reduce_is_2k_l_mp_reduce_is_2k_l__imp__mp_reduce_setup_mp_reduce_setup__imp__mp_root_n_mp_root_n__imp__mp_root_u32_mp_root_u32__imp__mp_rshd_mp_rshd__imp__mp_sbin_size_mp_sbin_size__imp__mp_set_mp_set__imp__mp_set_i32_mp_set_i32__imp__mp_set_i64_mp_set_i64__imp__mp_set_int_mp_set_int__imp__mp_set_l_mp_set_l__imp__mp_set_ll_mp_set_ll__imp__mp_set_long_mp_set_long__imp__mp_set_long_long_mp_set_long_long__imp__mp_set_u32_mp_set_u32__imp__mp_set_u64_mp_set_u64__imp__mp_set_ul_mp_set_ul__imp__mp_set_ull_mp_set_ull__imp__mp_shrink_mp_shrink__imp__mp_signed_rsh_mp_signed_rsh__imp__mp_sqr_mp_sqr__imp__mp_sqrmod_mp_sqrmod__imp__mp_sqrt_mp_sqrt__imp__mp_sqrtmod_prime_mp_sqrtmod_prime__imp__mp_sub_mp_sub__imp__mp_sub_d_mp_sub_d__imp__mp_submod_mp_submod__imp__mp_to_radix_mp_to_radix__imp__mp_to_sbin_mp_to_sbin__imp__mp_to_ubin_mp_to_ubin__imp__mp_ubin_size_mp_ubin_size__imp__mp_unpack_mp_unpack__imp__mp_xor_mp_xor__imp__mp_zero_mp_zero__imp__s_mp_add_s_mp_add__imp__s_mp_balance_mul_s_mp_balance_mul__imp__s_mp_karatsuba_mul_s_mp_karatsuba_mul__imp__s_mp_karatsuba_sqr_s_mp_karatsuba_sqr__imp__s_mp_mul_digs_s_mp_mul_digs__imp__s_mp_mul_digs_fast_s_mp_mul_digs_fast__imp__s_mp_reverse_s_mp_reverse__imp__s_mp_sqr_s_mp_sqr__imp__s_mp_sqr_fast_s_mp_sqr_fast__imp__s_mp_sub_s_mp_sub__imp__s_mp_toom_mul_s_mp_toom_mul__imp__s_mp_toom_sqr_s_mp_toom_sqr/ 1711619198 0 6196 ` 03N456x66J77888`992:: ;x;;N<<===\>>8??@@@XAA0BBCvCCNDD$EEEhFF?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTOR__imp__mp_2expt__imp__mp_abs__imp__mp_add__imp__mp_add_d__imp__mp_addmod__imp__mp_and__imp__mp_clamp__imp__mp_clear__imp__mp_clear_multi__imp__mp_cmp__imp__mp_cmp_d__imp__mp_cmp_mag__imp__mp_cnt_lsb__imp__mp_complement__imp__mp_copy__imp__mp_count_bits__imp__mp_decr__imp__mp_div__imp__mp_div_2__imp__mp_div_2d__imp__mp_div_3__imp__mp_div_d__imp__mp_dr_is_modulus__imp__mp_dr_reduce__imp__mp_dr_setup__imp__mp_error_to_string__imp__mp_exch__imp__mp_expt_n__imp__mp_expt_u32__imp__mp_exptmod__imp__mp_exteuclid__imp__mp_fread__imp__mp_from_sbin__imp__mp_from_ubin__imp__mp_fwrite__imp__mp_gcd__imp__mp_get_double__imp__mp_get_i32__imp__mp_get_i64__imp__mp_get_int__imp__mp_get_l__imp__mp_get_ll__imp__mp_get_long__imp__mp_get_long_long__imp__mp_get_mag_u32__imp__mp_get_mag_u64__imp__mp_get_mag_ul__imp__mp_get_mag_ull__imp__mp_grow__imp__mp_incr__imp__mp_init__imp__mp_init_copy__imp__mp_init_i32__imp__mp_init_i64__imp__mp_init_l__imp__mp_init_ll__imp__mp_init_multi__imp__mp_init_set__imp__mp_init_set_int__imp__mp_init_size__imp__mp_init_u32__imp__mp_init_u64__imp__mp_init_ul__imp__mp_init_ull__imp__mp_invmod__imp__mp_is_square__imp__mp_iseven__imp__mp_isodd__imp__mp_kronecker__imp__mp_lcm__imp__mp_log_n__imp__mp_log_u32__imp__mp_lshd__imp__mp_mod__imp__mp_mod_2d__imp__mp_mod_d__imp__mp_montgomery_calc_normalization__imp__mp_montgomery_reduce__imp__mp_montgomery_setup__imp__mp_mul__imp__mp_mul_2__imp__mp_mul_2d__imp__mp_mul_d__imp__mp_mulmod__imp__mp_neg__imp__mp_or__imp__mp_pack__imp__mp_pack_count__imp__mp_prime_fermat__imp__mp_prime_frobenius_underwood__imp__mp_prime_is_prime__imp__mp_prime_miller_rabin__imp__mp_prime_next_prime__imp__mp_prime_rabin_miller_trials__imp__mp_prime_rand__imp__mp_prime_strong_lucas_selfridge__imp__mp_radix_size__imp__mp_rand__imp__mp_read_radix__imp__mp_reduce__imp__mp_reduce_2k__imp__mp_reduce_2k_l__imp__mp_reduce_2k_setup__imp__mp_reduce_2k_setup_l__imp__mp_reduce_is_2k__imp__mp_reduce_is_2k_l__imp__mp_reduce_setup__imp__mp_root_n__imp__mp_root_u32__imp__mp_rshd__imp__mp_sbin_size__imp__mp_set__imp__mp_set_i32__imp__mp_set_i64__imp__mp_set_int__imp__mp_set_l__imp__mp_set_ll__imp__mp_set_long__imp__mp_set_long_long__imp__mp_set_u32__imp__mp_set_u64__imp__mp_set_ul__imp__mp_set_ull__imp__mp_shrink__imp__mp_signed_rsh__imp__mp_sqr__imp__mp_sqrmod__imp__mp_sqrt__imp__mp_sqrtmod_prime__imp__mp_sub__imp__mp_sub_d__imp__mp_submod__imp__mp_to_radix__imp__mp_to_sbin__imp__mp_to_ubin__imp__mp_ubin_size__imp__mp_unpack__imp__mp_xor__imp__mp_zero__imp__s_mp_add__imp__s_mp_balance_mul__imp__s_mp_karatsuba_mul__imp__s_mp_karatsuba_sqr__imp__s_mp_mul_digs__imp__s_mp_mul_digs_fast__imp__s_mp_reverse__imp__s_mp_sqr__imp__s_mp_sqr_fast__imp__s_mp_sub__imp__s_mp_toom_mul__imp__s_mp_toom_sqr_mp_2expt_mp_abs_mp_add_mp_add_d_mp_addmod_mp_and_mp_clamp_mp_clear_mp_clear_multi_mp_cmp_mp_cmp_d_mp_cmp_mag_mp_cnt_lsb_mp_complement_mp_copy_mp_count_bits_mp_decr_mp_div_mp_div_2_mp_div_2d_mp_div_3_mp_div_d_mp_dr_is_modulus_mp_dr_reduce_mp_dr_setup_mp_error_to_string_mp_exch_mp_expt_n_mp_expt_u32_mp_exptmod_mp_exteuclid_mp_fread_mp_from_sbin_mp_from_ubin_mp_fwrite_mp_gcd_mp_get_double_mp_get_i32_mp_get_i64_mp_get_int_mp_get_l_mp_get_ll_mp_get_long_mp_get_long_long_mp_get_mag_u32_mp_get_mag_u64_mp_get_mag_ul_mp_get_mag_ull_mp_grow_mp_incr_mp_init_mp_init_copy_mp_init_i32_mp_init_i64_mp_init_l_mp_init_ll_mp_init_multi_mp_init_set_mp_init_set_int_mp_init_size_mp_init_u32_mp_init_u64_mp_init_ul_mp_init_ull_mp_invmod_mp_is_square_mp_iseven_mp_isodd_mp_kronecker_mp_lcm_mp_log_n_mp_log_u32_mp_lshd_mp_mod_mp_mod_2d_mp_mod_d_mp_montgomery_calc_normalization_mp_montgomery_reduce_mp_montgomery_setup_mp_mul_mp_mul_2_mp_mul_2d_mp_mul_d_mp_mulmod_mp_neg_mp_or_mp_pack_mp_pack_count_mp_prime_fermat_mp_prime_frobenius_underwood_mp_prime_is_prime_mp_prime_miller_rabin_mp_prime_next_prime_mp_prime_rabin_miller_trials_mp_prime_rand_mp_prime_strong_lucas_selfridge_mp_radix_size_mp_rand_mp_read_radix_mp_reduce_mp_reduce_2k_mp_reduce_2k_l_mp_reduce_2k_setup_mp_reduce_2k_setup_l_mp_reduce_is_2k_mp_reduce_is_2k_l_mp_reduce_setup_mp_root_n_mp_root_u32_mp_rshd_mp_sbin_size_mp_set_mp_set_i32_mp_set_i64_mp_set_int_mp_set_l_mp_set_ll_mp_set_long_mp_set_long_long_mp_set_u32_mp_set_u64_mp_set_ul_mp_set_ull_mp_shrink_mp_signed_rsh_mp_sqr_mp_sqrmod_mp_sqrt_mp_sqrtmod_prime_mp_sub_mp_sub_d_mp_submod_mp_to_radix_mp_to_sbin_mp_to_ubin_mp_ubin_size_mp_unpack_mp_xor_mp_zero_s_mp_add_s_mp_balance_mul_s_mp_karatsuba_mul_s_mp_karatsuba_sqr_s_mp_mul_digs_s_mp_mul_digs_fast_s_mp_reverse_s_mp_sqr_s_mp_sqr_fast_s_mp_sub_s_mp_toom_mul_s_mp_toom_sqrlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619198 0 506 ` L~<f.debug$SD@B.idata$2@0.idata$6@  libtommath.dll'iMicrosoft (R) LINK libtommath.dll@comp.idi.idata$2@h.idata$6.idata$4@h.idata$5@h#<X__IMPORT_DESCRIPTOR_libtommath__NULL_IMPORT_DESCRIPTORlibtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619198 0 253 ` L~<f.debug$SDd@B.idata$3@0 libtommath.dll'iMicrosoft (R) LINK@comp.idi__NULL_IMPORT_DESCRIPTOR libtommath.dll/ 1711619198 0 284 ` L~<f.debug$SD@B.idata$5@0.idata$4@0 libtommath.dll'iMicrosoft (R) LINK@comp.idi libtommath_NULL_THUNK_DATAlibtommath.dll/ 1711619198 0 45 ` L~<f_mp_2exptlibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<f_mp_abslibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<f_mp_addlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_add_dlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f_mp_addmodlibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<f_mp_andlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_clamplibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_clearlibtommath.dll libtommath.dll/ 1711619198 0 51 ` L~<f_mp_clear_multilibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<f _mp_cmplibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f _mp_cmp_dlibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<f _mp_cmp_maglibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<f _mp_cnt_lsblibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f _mp_complementlibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<f_mp_copylibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<f_mp_count_bitslibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<f_mp_decrlibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<f_mp_divlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_div_2libtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f_mp_div_2dlibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<f_mp_div_3libtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_div_dlibtommath.dll libtommath.dll/ 1711619198 0 53 ` L~<f!_mp_dr_is_moduluslibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f_mp_dr_reducelibtommath.dll libtommath.dll/ 1711619198 0 48 ` L~<f_mp_dr_setuplibtommath.dlllibtommath.dll/ 1711619198 0 55 ` L~<f#_mp_error_to_stringlibtommath.dll libtommath.dll/ 1711619198 0 44 ` L~<f_mp_exchlibtommath.dlllibtommath.dll/ 1711619198 0 46 ` L~<f_mp_expt_nlibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f_mp_expt_u32libtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<f_mp_exptmodlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f_mp_exteuclidlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_freadlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f _mp_from_sbinlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f!_mp_from_ubinlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f"_mp_fwritelibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<f#_mp_gcdlibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f$_mp_get_doublelibtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<f%_mp_get_i32libtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<f&_mp_get_i64libtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<f'_mp_get_intlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f(_mp_get_llibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f)_mp_get_lllibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f*_mp_get_longlibtommath.dlllibtommath.dll/ 1711619198 0 53 ` L~<f!+_mp_get_long_longlibtommath.dll libtommath.dll/ 1711619198 0 51 ` L~<f,_mp_get_mag_u32libtommath.dll libtommath.dll/ 1711619198 0 51 ` L~<f-_mp_get_mag_u64libtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f._mp_get_mag_ullibtommath.dlllibtommath.dll/ 1711619198 0 51 ` L~<f/_mp_get_mag_ulllibtommath.dll libtommath.dll/ 1711619198 0 44 ` L~<f0_mp_growlibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<f1_mp_incrlibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<f2_mp_initlibtommath.dlllibtommath.dll/ 1711619198 0 49 ` L~<f3_mp_init_copylibtommath.dll libtommath.dll/ 1711619198 0 48 ` L~<f4_mp_init_i32libtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f5_mp_init_i64libtommath.dlllibtommath.dll/ 1711619198 0 46 ` L~<f6_mp_init_llibtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<f7_mp_init_lllibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f8_mp_init_multilibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f9_mp_init_setlibtommath.dlllibtommath.dll/ 1711619198 0 52 ` L~<f :_mp_init_set_intlibtommath.dlllibtommath.dll/ 1711619198 0 49 ` L~<f;_mp_init_sizelibtommath.dll libtommath.dll/ 1711619198 0 48 ` L~<f<_mp_init_u32libtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f=_mp_init_u64libtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<f>_mp_init_ullibtommath.dll libtommath.dll/ 1711619198 0 48 ` L~<f?_mp_init_ulllibtommath.dlllibtommath.dll/ 1711619198 0 46 ` L~<f@_mp_invmodlibtommath.dlllibtommath.dll/ 1711619198 0 49 ` L~<fA_mp_is_squarelibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<fB_mp_isevenlibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<fC_mp_isoddlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<fD_mp_kroneckerlibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<fE_mp_lcmlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<fF_mp_log_nlibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fG_mp_log_u32libtommath.dll libtommath.dll/ 1711619198 0 44 ` L~<fH_mp_lshdlibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<fI_mp_modlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<fJ_mp_mod_2dlibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<fK_mp_mod_dlibtommath.dll libtommath.dll/ 1711619198 0 69 ` L~<f1L_mp_montgomery_calc_normalizationlibtommath.dll libtommath.dll/ 1711619198 0 57 ` L~<f%M_mp_montgomery_reducelibtommath.dll libtommath.dll/ 1711619198 0 56 ` L~<f$N_mp_montgomery_setuplibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<fO_mp_mullibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<fP_mp_mul_2libtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<fQ_mp_mul_2dlibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<fR_mp_mul_dlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<fS_mp_mulmodlibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<fT_mp_neglibtommath.dll libtommath.dll/ 1711619198 0 42 ` L~<fU_mp_orlibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<fV_mp_packlibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<fW_mp_pack_countlibtommath.dlllibtommath.dll/ 1711619198 0 52 ` L~<f X_mp_prime_fermatlibtommath.dlllibtommath.dll/ 1711619198 0 65 ` L~<f-Y_mp_prime_frobenius_underwoodlibtommath.dll libtommath.dll/ 1711619198 0 54 ` L~<f"Z_mp_prime_is_primelibtommath.dlllibtommath.dll/ 1711619198 0 58 ` L~<f&[_mp_prime_miller_rabinlibtommath.dlllibtommath.dll/ 1711619198 0 56 ` L~<f$\_mp_prime_next_primelibtommath.dlllibtommath.dll/ 1711619198 0 65 ` L~<f-]_mp_prime_rabin_miller_trialslibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f^_mp_prime_randlibtommath.dlllibtommath.dll/ 1711619198 0 68 ` L~<f0__mp_prime_strong_lucas_selfridgelibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<f`_mp_radix_sizelibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<fa_mp_randlibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<fb_mp_read_radixlibtommath.dlllibtommath.dll/ 1711619198 0 46 ` L~<fc_mp_reducelibtommath.dlllibtommath.dll/ 1711619198 0 49 ` L~<fd_mp_reduce_2klibtommath.dll libtommath.dll/ 1711619198 0 51 ` L~<fe_mp_reduce_2k_llibtommath.dll libtommath.dll/ 1711619198 0 55 ` L~<f#f_mp_reduce_2k_setuplibtommath.dll libtommath.dll/ 1711619198 0 57 ` L~<f%g_mp_reduce_2k_setup_llibtommath.dll libtommath.dll/ 1711619198 0 52 ` L~<f h_mp_reduce_is_2klibtommath.dlllibtommath.dll/ 1711619198 0 54 ` L~<f"i_mp_reduce_is_2k_llibtommath.dlllibtommath.dll/ 1711619198 0 52 ` L~<f j_mp_reduce_setuplibtommath.dlllibtommath.dll/ 1711619198 0 46 ` L~<fk_mp_root_nlibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<fl_mp_root_u32libtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<fm_mp_rshdlibtommath.dlllibtommath.dll/ 1711619198 0 49 ` L~<fn_mp_sbin_sizelibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<fo_mp_setlibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fp_mp_set_i32libtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fq_mp_set_i64libtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fr_mp_set_intlibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<fs_mp_set_llibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<ft_mp_set_lllibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<fu_mp_set_longlibtommath.dlllibtommath.dll/ 1711619198 0 53 ` L~<f!v_mp_set_long_longlibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fw_mp_set_u32libtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<fx_mp_set_u64libtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<fy_mp_set_ullibtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<fz_mp_set_ulllibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f{_mp_shrinklibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<f|_mp_signed_rshlibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<f}_mp_sqrlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f~_mp_sqrmodlibtommath.dlllibtommath.dll/ 1711619198 0 44 ` L~<f_mp_sqrtlibtommath.dlllibtommath.dll/ 1711619198 0 53 ` L~<f!_mp_sqrtmod_primelibtommath.dll libtommath.dll/ 1711619198 0 43 ` L~<f_mp_sublibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_mp_sub_dlibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f_mp_submodlibtommath.dlllibtommath.dll/ 1711619198 0 48 ` L~<f_mp_to_radixlibtommath.dlllibtommath.dll/ 1711619198 0 47 ` L~<f_mp_to_sbinlibtommath.dll libtommath.dll/ 1711619198 0 47 ` L~<f_mp_to_ubinlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f_mp_ubin_sizelibtommath.dll libtommath.dll/ 1711619198 0 46 ` L~<f_mp_unpacklibtommath.dlllibtommath.dll/ 1711619198 0 43 ` L~<f_mp_xorlibtommath.dll libtommath.dll/ 1711619198 0 44 ` L~<f_mp_zerolibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<f_s_mp_addlibtommath.dll libtommath.dll/ 1711619198 0 53 ` L~<f!_s_mp_balance_mullibtommath.dll libtommath.dll/ 1711619198 0 55 ` L~<f#_s_mp_karatsuba_mullibtommath.dll libtommath.dll/ 1711619198 0 55 ` L~<f#_s_mp_karatsuba_sqrlibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f_s_mp_mul_digslibtommath.dlllibtommath.dll/ 1711619198 0 55 ` L~<f#_s_mp_mul_digs_fastlibtommath.dll libtommath.dll/ 1711619198 0 49 ` L~<f_s_mp_reverselibtommath.dll libtommath.dll/ 1711619198 0 45 ` L~<f_s_mp_sqrlibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f_s_mp_sqr_fastlibtommath.dlllibtommath.dll/ 1711619198 0 45 ` L~<f_s_mp_sublibtommath.dll libtommath.dll/ 1711619198 0 50 ` L~<f_s_mp_toom_mullibtommath.dlllibtommath.dll/ 1711619198 0 50 ` L~<f_s_mp_toom_sqrlibtommath.dlltcl9.0.3/libtommath/win32/libtommath.dll0000775000175000017500000021300015104661341017507 0ustar sergeisergeiMZ@ !L!This program cannot be run in DOS mode. $PEL [;f# 'i4@ 0H @dp@|.text``.data<@.rdata@@.bss .edataH 0@@.idatad@ @.CRT,P@.tls`@.relocp@B$ iÍ&WVSD$$ur i~W1 i$@i5H iÅuL i$v[^_ &d=@iX1t&9$׃H iu1ۡL iL iL iitT$(D$T$T$ $Ѓ  i[^_ [^_ f$ i$L iH i &vJH ijt&D$Pi$PiL i:,t&D$Pi$PiL it&$&&UWVSӃ$iui itH+|$D$4$ |$\$4$ ʼn|$\$4$ u1$i[^_]fC|$\$4$_ t|$\$4$ Ņ|$D$4$i Ņv|$D$4$H |$D$4$! |$D$4$ ,f Ń&뷉|$D$4$ & ` iL$T$D$R &t&D$ $ iD$ÐU$ iÍ&t&ÐD$$x%D$D$ $5Í&퍴&fWVS\$ t$$|$({t0D$4$ u|$(t$$\$ [^_\0t&[^_Í&t&{P&t&S\$ D$$i#[Í&t&髐&t&+&t&黩&t&K&t&+&t&&t&{&t&髉&t&黓&t&雘&t&k&t&+&t&K&t&&t&[=&t&{&t&k&t&;+&t&D$$D$D$ $i1ÍvD$$D$D$D$ $i1Í&t&D$$T$(D$D$ T$$i1Í&t&;&&t&&&t&[&&t&S\$ $@&{u؃ڃ[Í&&UWVSt$9F11ۃtF ΋, sډ[^_]Í&t&UWV l$0t$4|$8,$f'ut$|$,$D$gD$ ^_]ÍvVSL$$\$(t$ ʉډ4$HHÉT$D$ngyF[^Í&UWV l$0t$4|$8,$&ut$|$,$D$>hD$ ^_]ÍvUWVST$D$|$ w t!fÃ\ u4GG)ȅ~D$D$t$[^_]v[^_]Í&t&&t&,D$4=w*D$D$0T$T$$/T$8L$ ,Ít&D$=wÍ&vD$=wÍ&vD$=w`Í&vD$=w`Í&v`&t&v&t&&t&D$$D$ D$D$D$ $uÍt&VS\$ t$($;v9r'D$D$$D$ D$$Yu[^Ív&fc&t&&t&D$$D$ D$D$D$ $tÍt&VS\$ t$($+c9r'D$D$$D$ D$$Yt[^Ív&f,D$\$tD$0$pD$0\$$D$0$ fD$ D$ L[^_]Ít& t&t9ut_ #D$t|$`D$lD$hL$dL[^_]t&D$t$h|$`D$dL[^_] iD$ g1L$1~%I v<u9uf1ÐUWVS,D$D\$@D$9CD$D$t&D$@\$@ D$D$D$11t&|$D$H1$ƋD$1ҋ\$ 9l$uD$PD$@D$+D$~D$D$$ID$@$D$DD$D$@$t;D$@D$D$DD$D$@$耜,[^_]ËD$1ɉD$i,1[^_]ÉD$D$@$7 ,[^_]ÐD$P +T$ÐD$@iwiÐUWVSD$T$(:rZJ *hjhjh j 8pXH [^_]ÐUWVS,D$@t$\$D4$|$HD$ Ņt,[^_]Ít&D$<$xL~u6&u4$K,[^_]Ðt$4$Putщ|$t$<$t뾐D$=wPÐUWVS\\$xt$t{^~$uG $u)D$D$|\$D$ D$pt$$l\[^_]Ð$F~ C D$D$|\$t$D$ D$p$f\[^_]Ðl$@|$0D$l$<$ uD$p|$\$$Lul$4$LtHl$<$D$D$,D$,\[^_]Ít& D$NvD$|\$l$D$ <$랍1UWVS$$D$,D$ $$D$$$D$$l$`D$D$pD$ D$PD$D$@\$(|$$t$l$$M …t[^_]Í&vD$@D$$I$l$$…$D$$I$t$$…$D$ |$t$,$\D$p\$|$$@$\$D$D$@$V$\$|$$f$\$D$D$P$U\$|$4$+$\$D$,$UD$@D$D$p$D$PD$$$auml$4$Qu]D$pD$$$6uB$D$$$u$$t$$~&f$\$(D$ $D$$D$$D$D$pD$ D$PD$D$@|$$t$l$$D$,T$‰S[^ÐUWVS\$0l$4|$8{~g$t=Zu=t&C U 9t%\$D$$ytՃ[^_]Ít&$1[^_]ÍD$$t[^_]ÐUWVSL\$`t$dD$8D$t$$8t L[^_]Ðl$8,$DžtcD$D$(^ÐUWV l$0t$4|$8,$&ut$|$,$D$>D$ ^_]ÐV(t$04$uT$44$D$T$>D$(^ÐWVS\$$t$ |$({tXD$$HuC~C u|$(\$$t$ [^_f|$(\$$t$ [^_1c[^_ÐUWVSLt$`D$d~t{F `itjD$,D$iD$4$2ÅuND$,it?l$0D$8,$KÅu'l$l$4$uÅt,$t&1ۃL[^_]Ít&,$(.BON)D$R) D$D$Ѓ¸\)Ѻk( D$D$)PB)  D$D$⸠zk)Ѻ = D$D$ . k)ѺB D$D$)))ǸHm D$l$4$>Ål$,$=Åt$,$!|$dT$ t B ЃÐT$1 ~B ÐUWVS\|$tt$ptyuMG tU\$ t$$u$l$0|$,$te$D$iD$\[^_]Ít&F uG uD$x\1[^_]Ít&uV :uۋL$x벍&,$hD$ l$D$,$D$,T$2|$8?t$@4$tZf!ЉڨEt$$\$t$,$D$HIl$4$D$ tm$D$ \$D$$D$ueT$D$<t ƒ<iT$,|$(P!‰؃EGt&D$,$ufL$x94$D$D$,$D$D$.vF <it&|$(D$8D$x1VSDt$0\$ D$t$$t D[^Ít&D$T\$D$D$P$u\D$TD$D$P$D$ t$\$t[D$T$ou#D$Xt$D$D$P$ST$XBt$$D$D$D$D[^ÍD$P$uȋD$Xt$D$D$T$룐WVST$ D$$t$(Zuw tqxwfxt?tt$(D$$T$ [^_ClvR $T$o[^_Ít&D$$n[^_Í&f̐UWVS\$4t$0~QtK9V|On ى)эt|19}&9uD$\$,$1[^_]fT$4$4u뚐WVS |$4t$4$D$DÅt [^_Ít&D$0t$ D$|$$tÅu!D$t G9D$u%D$84$D$4$ [^_Ít&D$8t$<$D$$UWVS,\$DD$@|$Hk9|$$~Ņueغ$I41ҋ_ )k))Ѝ~D$D$$L$蓢L$!<$,[^_]Í&f|$DD$@,[^_]t&<$1~H,[^_]ÐD$(D$D$ D$$D$D$ $ÐUWVSl$4t$0,$)]$I4$k< )k)DωD$Åu@t$4$Åu-l$4$tt$l$4$u1u[^_]Í&D$14$1뜍t&É[^_]ÐUWVSLD$d|$`t$hD$$|$<\t$4 ?D$<9X3D$<D$$D$tl9~N )|$L$P9D$Ѓ{;,u9}S *сL$ >~L$ u9~N )сL$$ρ ʃ|$|$$rҋ|$T$(T$(P 9D$WD$Xt$,\$0X$<1[^_]Í&D$X|$$<[^_]UWVSLl$p|$x\$|l$|$$D$(;D$dD$0\$$[\$tED$tD$tDt$)19u\$#t$L$(D$)|$,D$$D$PD$(+D$|$lD+t$,1ۉʼnD$NvT$<2WT$9\$uT$$"L$#D$0D$ D$T$$HuT9t#E)؃|$tDD$D$`9w9u݋|$G9|$(t D$GT$h1t |$hL$(D$D$0$0D$L[^_]D$#琐D$ $T$( 1+L$$ÐUWVS,|$Dl$HED$<$zuut$4$Åt,[^_]Í&fD$@t$ <$D$D$Åu|$4$uE4$S,[^_]Í&f떐UWVS$\$@$D$D$pD$ D$`D$D$PD$D$$RDžl$<D&v|$$'\$$8*\$D$$,3$l$$D$uqD$<GtGvlcًD$,\$D$D$p$ǍD$PD$D$ D$`D$D$pD$$\$$Ĝ[^_]ÿ빍t?G$ƉD$&$\$\$$u|$@u D$L8t1qD$`D$D$$$hHD$pD$$<$$D$$%$D$`$GD$, D$PD$$$et8D$p\$|$$uD$P$D$D$)D$p\$D$D$P$ yD$PD$D$pD$$$b0RD$pD$$D$D$p$+$D$D$PD$D$p$$D$$D$$$D$p$D$$D$D$`l$$LJmD$p\$$ {$\$D$$\D$PD$$$=$D$D$pD$D$P$&/D$p\$$t$$ $$\$$D$Dž|$p$\$$$UWVSL\$`|$httt`C tWl$,$l$'ƅuCL$,t7&tMi0$D$u&1L[^_]Ít&C vuҍ&l$$gƅuȃ|$,tD$0D$$ƅuD$0l$D$$ƅ&T$,D$<D$0l$D$$|$,|$dD$0D$D$i$D$0$D$ tBD$0D$D$i$D$0$D$P t$Ή|$h߉ӡiD$D$0$D$0l$D$<$u/|$,9u|$h1D$0$eRl$$P D$A|$,t̃|$duD$d$1ɉD$tuЉD$&D$9D$dyD$0D$$vD$9\$tD$0t$$藿ul$D$0t$$EJl$A:UWVSL$`D$,$h@iD$$`$kty$`$`@ tx$`&v D$@؉D$i4$D$tρL[^_]Ë$`@ 덋$`D$D$$(eL[^_]Ë$`1i<$D$ivءiu ƒuD$$`$L1[^_]Ë$`D$|$<$'?D$0$J$@D$)D$iD$D$l$L$D$D1t&9r)ډD9D$u߃uI|$9|$w$`D$D$D$$`$辸ÅxD$0$舼R$`D$D$D$$`$ÅuōD$,D$$dD$$`$Åu|$, 됐L$P1 v@i9t#uÍvDiÍt<iÐS\$$~D$ \$$iu[Í&1[Í&fUWVSLt$hl$`L$dD$lD$lDD$lD$lT$#<$裇ÅD$,T$D$D$lt )T$T$lɃL$'Nwt$ 3T$&D$(&fD$t|$$D$T$p95T$(L$ D$," D$&D$D$' |$\$,$u-D$dt$<,$t$D$uT$}]l$l$ ,$DžuOT$ D$(ۅu[vD$ tMD$l$D$ t$,$mtىlj,$O<[^_]Ít&D$X<[^_]Ít&D$Xƍt&,$а1҃}L$X1D몿룐D$iD£iÍ&t&UWVS\$0t$4$y ~rt$$ud,l$C }$itDt&D$$iu*C 8t݉3ō&f 9u1[^_]ÐUWVS,\$@t$H|$D$F>?-D$u D$$uPt&itX9~T\$t$$uuR\$l$$u>WtLЃ$ JBC(9is v$$,[^_]Í&rڋtD$C,1[^_]øɐUWVS,t$@D$D\$8t$$_Ņt,[^_]Í&G$D$IvYD$H\$$D$MŅu($|$kt$4$D$Ņt?$臫,[^_]Ít&D$H|$ \$D$$KŅtɍ&D$D|$ \$D$$GŅut$\$4$2ŅuD$4$̫u7t&D$Dt$4$D$VuXD$D4$D$Hu?D$$|$$ut$\$4$.t&vUWVSt&$4t&D$P$D$耤u>|$D$<$Ņu$\$<$D$*Ņt$<$l$$D$迳E$L$BUWVSt$4|$0~U97~YW 1,LJ)9)ÍC~&1ɅD$H$D$o)[^_]Ã[^_]D$ $aÐD$ L$$P  1@:@)ȅ~D$D$$.oÐUWVS|$8t$0T$4% t~T$D$4$xlD$`D$u.D$d\$l0ft D$lD$L[^_]Ít&D$`|$0<$D$lD$uԃ|$8D$0t$dC-iD$މ'D$,T$0DCD$)tjD$,|$D$ D$p<$D$螞tD$<$~D$L[^_]fT$dD$8r-t$d_&fD$밍ލXD$D$D$d$9D$ltD$`xD$uXD$ljD$t$dD$1뗐WVSD$(|$ t$$\$,t6\$ D$FD$<$,utW[^_f𐐐UWVS<\$Pt$T$D$;D$Xl$ \$,$苯Džu_D$\4&D$,CD$ l$D$,$蘛u,9uЋD$\t D$\T$,$Ɛ<[^_]Ít&琐D$ $Q1ҨÐUWVS9~N 3)L$(9L$$Ћ|$,%D$D$B 9T$ ƒ{;,u9}C (сL$0>%~L$0t9~N )сL$4ρ1ȋL$(|$49L$$R|$,B9T$ lD$h\$8t$<p$EL1[^_]ÍvD$8D$D$h$DL[^_]ÐD$ P@@ ~D$T$$YÐUWVS,\$@|$D 7\$L$9 |$ΉD$D$L$Hh9AD$H 1ҋD$D$H(H k 1ۅ~ D؉%9u |$9t09~,D$@ 4)ЍQ9u|$HPD$+~D$D$$XD$H$,1[^_]ÍD$Hl$$',[^_]UWVS|$($9݉NFD$D$0$ݫt |[^_]ÐD$`|$@D$D$<$$9D$($@ D$$$D$P$@D$T$@D$X$@ D$\9݉M1ۙD$ D$,D$1t&D$0~4L$$T$<\$ &ZD$09u\$D$0$|D$P|$D$D$0$$l$<$D$`|$D$$|D$D$9D$ O9\$()L$$T$l$,$u\D$@,$D$$xD$D$ЅuDžD$p$;\$ $L$D$`L$Ɛ$9ul[^_]Ít&{D$(@/iyD$L4$D$踬DžzPi=0LiL‰D$(FD$D$P$D$$}Dž?l$$t$,$賩Dž:D$$$&D$$D$$ D$pt$D$$$豧DžuL$D$`ōD$pl$$ـDžu\$,\$(vl$,$,D$Lt$,$D$Ӆ;|$uʋ\$,C;D$ L$\$,ŋt$(L$`L$D$$fD$L|$$D$օu!9tV؍L$p\$L$$莫tʋ\$,D$pt$D$ $l$$萯Dž\$,$\$811D$,|$$ыD$4D$0D$D$pD$D$0$"D$@|$D$D$0$D$@D$$rD$PD$D$pD$D$`$D$@D$D$PD$D$@$D$@\$$”D$D$D$p$覔urD$@D$D$D$`$guV$D$D$pD$D$@$gŅu1D$p$lD$`$lD$P$k&ɍ&fxUWVS$D$$$llPD$p\$@D$D$D$`|$0D$ D$PD$\$<$܊D$(tD$(Č[^_]Ít&D$<$K$$D$8D$$7|$$,mD\$,6$t$$)$$D$Dkt$D$D$p$+D$$Ft$,vZl$,+l$$ D$$t$,)ōD$`D$D$pl$$zD$P<$D$D$`D$ϗu{D$PD$$$jrD$P|$$zl$,t$$)cv$D$(D$(Č[^_]Í&D$(D$p\$D$D$`D$ D$PD$<$D$iD$(Č[^_]ÐD$P\$$yt$,t$,$$D$i$Et$$0낋$D$(0lSD$$51ۍtD$ $k[ÐUWVS<$D$uD$(D$D$0|$($h$d$`L[^_]D$@D$$1T$8t$$\$HD$$0UWVS\D$x|$t\$pD$|$,D$4$xD$$D$@9G$|$xD$HD$LG D$<D$DD$$9$|F { 1D$0$||$8D$ +D$,1D$(D$,9$|T$$rT$(+$|T$T$09PL~1fT$$Ճ9u鋴$|D$(%DPD$ $|;D$$t:D$ D$,9$|rD$8t$4D$$|s&vD$ $xʼn+l$HD$P|$<D$Ll$D$<$)D$D$4|$,D$$D$@5$x|$$8$|D$@u릐U1WVS,|$Dt$@\$vT$t8ti\$(4$D$tу,[^_]Í&f,[^_]ÐU1WVS$D$8T$<$^D$D$T$D$T$ $Ƌ\$)t$ L$L$\$\$ 1 ȉ$\$1׋t$|$ڋ|$D$T$ 4$|$L$\$ t$|$w<$l$( i, iD$T$= i-$ i4 i 0 i8 i< i$[^_]fUWVS$T$Fu*$D$D$`D$$$F&D$$$mJD$D$$$VJD$D$$$?JD$D$$$(JD$D$D$p$JD$D$D$`$JD$D$D$@D$D$0|$$D$ JD$[^_]Ël$ D$ UWVSlt$ 4$gÅtl[^_]Ít&$VUUU8)D$0T$Չ$iÅu&D$@l$$l$0siÅt%D$0$1I4$)Il[^_]Í&l$@)L$ȋ$D$D$P$iÅ$L$<@ ~.v9 N˻ȅOݍL-|$LL$9}!)1ۍ&f9u\$$L$\9~'<))$vD$P9D$0$GD$@$GD$P$GD$0t$$蒩Åt$D$P$GD$@$G&D$0D$D$PD$D$0$LCÅu$D$D$@D$D$0$觱ÅuD$0D$D$@D$D$0$CÅoD$0D$$ÅU$D$$ΨÅ8D$@D$D$PD$D$@$tÅD$@D$$uÅD$PD$$tÅ$D$D$D$0$OBÅ$D$$rPÅD$0D$$D$D$0$艰ÅsD$0D$D$@D$D$0$cÅM$D$D$PD$$$7Å!$t$D$$ÅD$D$P$%nÅD$؉D$D$@$nÅD$D$$$mÅD$0l$$mÅD$PD$D$@D$D$P$@Å^$D$D$D$P$@Å9$D$D$0D$$$@Å $t$D$$@it% fСiP@iu Ít&Í&&Sit)tt&iu$i7[Ív1Ãiu뽍&&D itÍD i널D$$tt t&D$T$(D$ T$$ &VS=(iD$$t (ittJ[^ t&(Pi(Pi9t&vtЃ9u[^ t&D$(D$D$D$ $d[^ &1ÐS$\$$ D$D$ D$$i\$ T$ \$$T$t&WVSÃ05h i l i1Ƀ 9wxW99u$Džl i؉xl iG D T$D$T$$@i D$(PtPuh i0[^_f@L$ E‹T$l iKS\$ D$L$$@iu@i$XiD$&v1l iD D$G$$iD$Y\$$iI&fUWVS\=d it e[^_]Ít&d i h i)čD$#l ii-i~i iCCO id}>t&E)iuSEi i{SiEЋiiE‰ÈtS tM$iL$fii ii"ifEʁf}HM)4uyEЃ fii%}viEʁ}HM)uƁu | EivEԋM̉t$$iD$ EЉL$D$vii}ԍt&s;iiiirً}ԋh is@iu䍴&l itt$ T$PT$@$Ӄ;=h i|ɍe[^_]ÉD$$iAUWVS$x i@ip it4-@i=@iv$Ճׅu tC4$Ћ[u$x i@i[^_]Ívt iuÍSD$ $ ÅtBD$ $x iD$$C@ip ip iC$x i@i1[Ã&t&St i\$ u1[Í&$x i@ip it'1 vtЋ9ڋPut+Q$x $x i@i1[Í&fp iЍ&SD$$tCw)tMt it i[Ít&ut it5ݍv{[Ðt iuWt iup itv؋[$up it i$x i@ip뢍&f$x i@i;D$1f8MZu @<8PEtÍt&1fx ‰fVST$ \$R<BrDt1ɐP 9wP9w (9u1[^ÍvUWVS1ۃ|$0<$whf=iMZu]<iiPEiuEfi u:ih\t51 (9t&D$|$$uރ[^_]Ít&1ۉ[^_]Ít&1f=iMZu <iiPEit Í&vfi uViSi\$ Dit1ɐP 9rP9r (9u1[^Ív1f=iMZu<iiPEtfi uiÍ&1SL$f=iMZu<iiPEit[Ít&fi uiiDt1ҍt&@' ttȃ(9u1[Í&1f=iMZu<iiPEtfi iDÍ&&1f=iMZu<iiPEit Í&vfi uViS\$ qTit 1ɍt&B 9rB9r(9u1[^ÍvB$[^Ít&1Wf=iMZVS\$u<iiPEit [^_Í&fi u苀itV~Tt1J 9rJ9r(9u1[^_i&fHuP tԅH [^_iÐÐQP=L$ r -=w) XYÐffUWVS\$4L$0D$D$8T$< $݉\$yD$ $ۉ\$݉Ӆy T$ډӉNj$u9vT1 f9v$11L$t؃ڃ[^_]Ít&u@9r1;<$wͽƍu 1lj1Ƌ$렍& ) T$ $ Չډt$ Ӊ9r<$9s9u1?UWVSD$?  !"#$%&'()*+,-./0123456789:;<=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/Xi %)+/5;=CGIOSYaegkmq %379=KQ[]agou{  #-39;AKQWY_eikw)+57;=GUY[_mqsw %'-?CEIOU]ci  ')/QW]ew #+/=AGIMSMicrosoft Base Cryptographic Provider v1.0i`i`i\ iPiMingw-w64 runtime failure: Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%x Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. %d bit pseudo relocation at %p out of range, targeting %p, yielding the value %p. GCC: (GNU) 11.2.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.3.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.2.0GCC: (GNU) 11.3.0[;f6(0240`p !@!!!0"""##`$*+p,/@/000 111p3p7@88 99 <<<<<0===@>>0???@`@@@ A`AAA BBDDEpGpHII@J KPK0LN`N`OPPQRSPSUVVW@\_adggqsstPv wwxxyyz@}}}~@0P`0P`ppPp0PБГ@ P 6&6-646=6G6N6W6`6o6v66666666666666 77*727<7H7S7`7i7v777777777777888.868>8F8S8_8k8u888888888888999$9-989@9G9Q9Z9{999999999999:!:3:I:]:z:::::::::;;*;<;L;V;b;j;w;~;;;;;;;;;;;;<<<#<+<<<C<L<V<b<m<x<<<<<<<<<<< ==#=,=:=  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~libtommath.dllmp_2exptmp_absmp_addmp_add_dmp_addmodmp_andmp_clampmp_clearmp_clear_multimp_cmpmp_cmp_dmp_cmp_magmp_cnt_lsbmp_complementmp_copymp_count_bitsmp_decrmp_divmp_div_2mp_div_2dmp_div_3mp_div_dmp_dr_is_modulusmp_dr_reducemp_dr_setupmp_error_to_stringmp_exchmp_expt_nmp_expt_u32mp_exptmodmp_exteuclidmp_freadmp_from_sbinmp_from_ubinmp_fwritemp_gcdmp_get_doublemp_get_i32mp_get_i64mp_get_intmp_get_lmp_get_llmp_get_longmp_get_long_longmp_get_mag_u32mp_get_mag_u64mp_get_mag_ulmp_get_mag_ullmp_growmp_incrmp_initmp_init_copymp_init_i32mp_init_i64mp_init_lmp_init_llmp_init_multimp_init_setmp_init_set_intmp_init_sizemp_init_u32mp_init_u64mp_init_ulmp_init_ullmp_invmodmp_is_squaremp_isevenmp_isoddmp_kroneckermp_lcmmp_log_nmp_log_u32mp_lshdmp_modmp_mod_2dmp_mod_dmp_montgomery_calc_normalizationmp_montgomery_reducemp_montgomery_setupmp_mulmp_mul_2mp_mul_2dmp_mul_dmp_mulmodmp_negmp_ormp_packmp_pack_countmp_prime_fermatmp_prime_frobenius_underwoodmp_prime_is_primemp_prime_miller_rabinmp_prime_next_primemp_prime_rabin_miller_trialsmp_prime_randmp_prime_strong_lucas_selfridgemp_radix_sizemp_randmp_read_radixmp_reducemp_reduce_2kmp_reduce_2k_lmp_reduce_2k_setupmp_reduce_2k_setup_lmp_reduce_is_2kmp_reduce_is_2k_lmp_reduce_setupmp_root_nmp_root_u32mp_rshdmp_sbin_sizemp_setmp_set_i32mp_set_i64mp_set_intmp_set_lmp_set_llmp_set_longmp_set_long_longmp_set_u32mp_set_u64mp_set_ulmp_set_ullmp_shrinkmp_signed_rshmp_sqrmp_sqrmodmp_sqrtmp_sqrtmod_primemp_submp_sub_dmp_submodmp_to_radixmp_to_sbinmp_to_ubinmp_ubin_sizemp_unpackmp_xormp_zeros_mp_adds_mp_balance_muls_mp_karatsuba_muls_mp_karatsuba_sqrs_mp_mul_digss_mp_mul_digs_fasts_mp_reverses_mp_sqrs_mp_sqr_fasts_mp_subs_mp_toom_muls_mp_toom_sqrP@B@\@C@@XCAHA`ArAAAAAAAABB,B8B@BHBRBZBdBlBtB~BBBBBBBHA`ArAAAAAAAABB,B8B@BHBRBZBdBlBtB~BBBBBBBCryptAcquireContextACryptGenRandomDeleteCriticalSection6EnterCriticalSectioniGetLastErrormInitializeCriticalSectionLeaveCriticalSectionjSleepTlsGetValueVirtualProtectVirtualQuery_amsg_exitc_inittermg_iob_lockN_unlock%abort2callocFfgetcVfreecfwritemallocmemcpymemsetreallocstrlenstrncmpvfprintf@@ADVAPI32.dll@@@@@@@@@KERNEL32.dll(@(@(@(@(@(@(@(@(@(@(@(@(@(@(@(@(@msvcrt.dlliiiD000D0Y0f0q0000011<1c1n1x11111111/282233 44 {200078@226;7>>>P<==>`223-33444)57p22A3]33Y4p2x2= :q<0)1U1a1L56666!6'6,626Y6_6i6s6|6666n7x7777777777 8$8A8Z88P;<<6==>'>a>}>>>>???8?J?^?{????????0/0O0X0j0u0{0000000-131K11111111122"2Q2f2z222222223$3)3/3<3B3e333333344.4Q4Z4e4444444m5w5}55555566#6/676E6u66666666666657?7E7S7Z7u7777777888%8;8E888;= ==="=*=2=:=B=J=R=Z=b=j=r=z==000,0004080 000000377777P 000tcl9.0.3/libtommath/tommath_superclass.h0000664000175000017500000000624115076154263020012 0ustar sergeisergei/* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* super class file for PK algos */ /* default ... include all MPI */ #ifndef LTM_NOTHING #define LTM_ALL #endif /* RSA only (does not support DH/DSA/ECC) */ /* #define SC_RSA_1 */ /* #define SC_RSA_1_WITH_TESTS */ /* For reference.... On an Athlon64 optimizing for speed... LTM's mpi.o with all functions [striped] is 142KiB in size. */ #ifdef SC_RSA_1_WITH_TESTS # define BN_MP_ERROR_TO_STRING_C # define BN_MP_FREAD_C # define BN_MP_FWRITE_C # define BN_MP_INCR_C # define BN_MP_ISEVEN_C # define BN_MP_ISODD_C # define BN_MP_NEG_C # define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C # define BN_MP_RADIX_SIZE_C # define BN_MP_RAND_C # define BN_MP_REDUCE_C # define BN_MP_REDUCE_2K_L_C # define BN_MP_FROM_SBIN_C # define BN_MP_ROOT_U32_C # define BN_MP_SET_L_C # define BN_MP_SET_UL_C # define BN_MP_SBIN_SIZE_C # define BN_MP_TO_RADIX_C # define BN_MP_TO_SBIN_C # define BN_S_MP_RAND_JENKINS_C # define BN_S_MP_RAND_PLATFORM_C #endif /* Works for RSA only, mpi.o is 68KiB */ #if defined(SC_RSA_1) || defined (SC_RSA_1_WITH_TESTS) # define BN_CUTOFFS_C # define BN_MP_ADDMOD_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_EXPTMOD_C # define BN_MP_GCD_C # define BN_MP_INIT_MULTI_C # define BN_MP_INVMOD_C # define BN_MP_LCM_C # define BN_MP_MOD_C # define BN_MP_MOD_D_C # define BN_MP_MULMOD_C # define BN_MP_PRIME_IS_PRIME_C # define BN_MP_PRIME_RABIN_MILLER_TRIALS_C # define BN_MP_PRIME_RAND_C # define BN_MP_RADIX_SMAP_C # define BN_MP_SET_INT_C # define BN_MP_SHRINK_C # define BN_MP_TO_UNSIGNED_BIN_C # define BN_MP_UNSIGNED_BIN_SIZE_C # define BN_PRIME_TAB_C # define BN_S_MP_REVERSE_C /* other modifiers */ # define BN_MP_DIV_SMALL /* Slower division, not critical */ /* here we are on the last pass so we turn things off. The functions classes are still there * but we remove them specifically from the build. This also invokes tweaks in functions * like removing support for even moduli, etc... */ # ifdef LTM_LAST # undef BN_MP_DR_IS_MODULUS_C # undef BN_MP_DR_SETUP_C # undef BN_MP_DR_REDUCE_C # undef BN_MP_DIV_3_C # undef BN_MP_REDUCE_2K_SETUP_C # undef BN_MP_REDUCE_2K_C # undef BN_MP_REDUCE_IS_2K_C # undef BN_MP_REDUCE_SETUP_C # undef BN_S_MP_BALANCE_MUL_C # undef BN_S_MP_EXPTMOD_C # undef BN_S_MP_INVMOD_FAST_C # undef BN_S_MP_KARATSUBA_MUL_C # undef BN_S_MP_KARATSUBA_SQR_C # undef BN_S_MP_MUL_HIGH_DIGS_C # undef BN_S_MP_MUL_HIGH_DIGS_FAST_C # undef BN_S_MP_TOOM_MUL_C # undef BN_S_MP_TOOM_SQR_C # ifndef SC_RSA_1_WITH_TESTS # undef BN_MP_REDUCE_C # endif /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without * trouble. */ # undef BN_MP_MONTGOMERY_REDUCE_C # undef BN_S_MP_MUL_DIGS_C # undef BN_S_MP_SQR_C # endif #endif tcl9.0.3/libtommath/tommath_private.h0000664000175000017500000003531715104661341017276 0ustar sergeisergei/* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef TOMMATH_PRIV_H_ #define TOMMATH_PRIV_H_ #include #ifndef TCL_WITH_EXTERNAL_TOMMATH # include "tclTomMath.h" #else # include "tommath.h" #endif #include "tommath_class.h" /* * Private symbols * --------------- * * On Unix symbols can be marked as hidden if libtommath is compiled * as a shared object. By default, symbols are visible. * As of now, this feature is opt-in via the MP_PRIVATE_SYMBOLS define. * * On Win32 a .def file must be used to specify the exported symbols. */ #if defined (MP_PRIVATE_SYMBOLS) && defined(__GNUC__) && __GNUC__ >= 4 # define MP_PRIVATE __attribute__ ((visibility ("hidden"))) #else # define MP_PRIVATE #endif /* Hardening libtommath * -------------------- * * By default memory is zeroed before calling * MP_FREE to avoid leaking data. This is good * practice in cryptographical applications. * * Note however that memory allocators used * in cryptographical applications can often * be configured by itself to clear memory, * rendering the clearing in tommath unnecessary. * See for example https://github.com/GrapheneOS/hardened_malloc * and the option CONFIG_ZERO_ON_FREE. * * Furthermore there are applications which * value performance more and want this * feature to be disabled. For such applications * define MP_NO_ZERO_ON_FREE during compilation. */ #ifdef MP_NO_ZERO_ON_FREE # define MP_FREE_BUFFER(mem, size) MP_FREE((mem), (size)) # define MP_FREE_DIGITS(mem, digits) MP_FREE((mem), sizeof (mp_digit) * (size_t)(digits)) #else # define MP_FREE_BUFFER(mem, size) \ do { \ size_t fs_ = (size); \ void* fm_ = (mem); \ if (fm_ != NULL) { \ MP_ZERO_BUFFER(fm_, fs_); \ MP_FREE(fm_, fs_); \ } \ } while (0) # define MP_FREE_DIGITS(mem, digits) \ do { \ int fd_ = (digits); \ void* fm_ = (mem); \ if (fm_ != NULL) { \ size_t fs_ = sizeof (mp_digit) * (size_t)fd_; \ MP_ZERO_BUFFER(fm_, fs_); \ MP_FREE(fm_, fs_); \ } \ } while (0) #endif #ifdef MP_USE_MEMSET # include # define MP_ZERO_BUFFER(mem, size) memset((mem), 0, (size)) # define MP_ZERO_DIGITS(mem, digits) \ do { \ int zd_ = (digits); \ if (zd_ > 0) { \ memset((mem), 0, sizeof(mp_digit) * (size_t)zd_); \ } \ } while (0) #else # define MP_ZERO_BUFFER(mem, size) \ do { \ size_t zs_ = (size); \ char* zm_ = (char*)(mem); \ while (zs_-- > 0u) { \ *zm_++ = '\0'; \ } \ } while (0) # define MP_ZERO_DIGITS(mem, digits) \ do { \ int zd_ = (digits); \ mp_digit* zm_ = (mem); \ while (zd_-- > 0) { \ *zm_++ = 0; \ } \ } while (0) #endif /* Tunable cutoffs * --------------- * * - In the default settings, a cutoff X can be modified at runtime * by adjusting the corresponding X_CUTOFF variable. * * - Tunability of the library can be disabled at compile time * by defining the MP_FIXED_CUTOFFS macro. * * - There is an additional file tommath_cutoffs.h, which defines * the default cutoffs. These can be adjusted manually or by the * autotuner. * */ #ifdef MP_FIXED_CUTOFFS # include "tommath_cutoffs.h" # define MP_KARATSUBA_MUL_CUTOFF MP_DEFAULT_KARATSUBA_MUL_CUTOFF # define MP_KARATSUBA_SQR_CUTOFF MP_DEFAULT_KARATSUBA_SQR_CUTOFF # define MP_TOOM_MUL_CUTOFF MP_DEFAULT_TOOM_MUL_CUTOFF # define MP_TOOM_SQR_CUTOFF MP_DEFAULT_TOOM_SQR_CUTOFF #else # define MP_KARATSUBA_MUL_CUTOFF KARATSUBA_MUL_CUTOFF # define MP_KARATSUBA_SQR_CUTOFF KARATSUBA_SQR_CUTOFF # define MP_TOOM_MUL_CUTOFF TOOM_MUL_CUTOFF # define MP_TOOM_SQR_CUTOFF TOOM_SQR_CUTOFF #endif /* define heap macros */ #ifndef MP_MALLOC /* default to libc stuff */ # include # define MP_MALLOC(size) malloc(size) # define MP_REALLOC(mem, oldsize, newsize) realloc((mem), (newsize)) # define MP_CALLOC(nmemb, size) calloc((nmemb), (size)) # define MP_FREE(mem, size) free(mem) #elif 0 /* prototypes for our heap functions */ extern void *MP_MALLOC(size_t size); extern void *MP_REALLOC(void *mem, size_t oldsize, size_t newsize); extern void *MP_CALLOC(size_t nmemb, size_t size); extern void MP_FREE(void *mem, size_t size); #endif /* feature detection macro */ #ifdef _MSC_VER /* Prevent false positive: not enough arguments for function-like macro invocation */ #pragma warning(disable: 4003) #endif #define MP_STRINGIZE(x) MP__STRINGIZE(x) #define MP__STRINGIZE(x) ""#x"" #define MP_HAS(x) (sizeof(MP_STRINGIZE(BN_##x##_C)) == 1u) /* TODO: Remove private_mp_word as soon as deprecated mp_word is removed from tommath. */ #if !defined(MP_64BIT) || defined(__GNUC__) #undef mp_word typedef private_mp_word mp_word; #endif #define MP_MIN(x, y) (((x) < (y)) ? (x) : (y)) #define MP_MAX(x, y) (((x) > (y)) ? (x) : (y)) #define MP_IS_2EXPT(x) (((x) != 0u) && (((x) & ((x) - 1u)) == 0u)) /* Static assertion */ #define MP_STATIC_ASSERT(msg, cond) typedef char mp_static_assert_##msg[(cond) ? 1 : -1]; /* ---> Basic Manipulations <--- */ #define MP_IS_ZERO(a) ((a)->used == 0) #define MP_IS_EVEN(a) (((a)->used == 0) || (((a)->dp[0] & 1u) == 0u)) #define MP_IS_ODD(a) (((a)->used > 0) && (((a)->dp[0] & 1u) == 1u)) #define MP_SIZEOF_BITS(type) ((size_t)CHAR_BIT * sizeof(type)) #define MP_MAXFAST (int)(1uL << (MP_SIZEOF_BITS(mp_word) - (2u * (size_t)MP_DIGIT_BIT))) /* TODO: Remove PRIVATE_MP_WARRAY as soon as deprecated MP_WARRAY is removed from tommath.h */ #undef MP_WARRAY #define MP_WARRAY PRIVATE_MP_WARRAY /* TODO: Remove PRIVATE_MP_PREC as soon as deprecated MP_PREC is removed from tommath.h */ #ifdef PRIVATE_MP_PREC # undef MP_PREC # define MP_PREC PRIVATE_MP_PREC #endif /* Minimum number of available digits in mp_int, MP_PREC >= MP_MIN_PREC */ #define MP_MIN_PREC ((((int)MP_SIZEOF_BITS(uintmax_t) + MP_DIGIT_BIT) - 1) / MP_DIGIT_BIT) MP_STATIC_ASSERT(prec_geq_min_prec, MP_PREC >= MP_MIN_PREC) /* random number source */ extern MP_PRIVATE mp_err(*s_mp_rand_source)(void *out, size_t size); /* lowlevel functions, do not call! */ MP_PRIVATE mp_bool s_mp_get_bit(const mp_int *a, unsigned int b); MP_PRIVATE int s_mp_log_2expt(const mp_int *a, mp_digit base) MP_WUR; MP_PRIVATE int s_mp_log_d(mp_digit base, mp_digit n) MP_WUR; MP_PRIVATE mp_err s_mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; MP_PRIVATE mp_err s_mp_mul_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) MP_WUR; MP_PRIVATE mp_err s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) MP_WUR; MP_PRIVATE mp_err s_mp_mul_high_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) MP_WUR; MP_PRIVATE mp_err s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) MP_WUR; MP_PRIVATE mp_err s_mp_sqr_fast(const mp_int *a, mp_int *b) MP_WUR; MP_PRIVATE mp_err s_mp_sqr(const mp_int *a, mp_int *b) MP_WUR; MP_PRIVATE mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_karatsuba_sqr(const mp_int *a, mp_int *b) MP_WUR; MP_PRIVATE mp_err s_mp_toom_sqr(const mp_int *a, mp_int *b) MP_WUR; MP_PRIVATE mp_err s_mp_invmod_fast(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; MP_PRIVATE mp_err s_mp_montgomery_reduce_fast(mp_int *x, const mp_int *n, mp_digit rho) MP_WUR; MP_PRIVATE mp_err s_mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) MP_WUR; MP_PRIVATE mp_err s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) MP_WUR; MP_PRIVATE mp_err s_mp_log(const mp_int *a, mp_digit base, int *c) MP_WUR; MP_PRIVATE mp_err s_mp_rand_platform(void *p, size_t n) MP_WUR; MP_PRIVATE mp_err s_mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_prime_callback cb, void *dat); MP_PRIVATE void s_mp_reverse(unsigned char *s, size_t len); MP_PRIVATE mp_err s_mp_prime_is_divisible(const mp_int *a, mp_bool *result); /* TODO: jenkins prng is not thread safe as of now */ MP_PRIVATE mp_err s_mp_rand_jenkins(void *p, size_t n) MP_WUR; MP_PRIVATE void s_mp_rand_jenkins_init(uint64_t seed); extern MP_PRIVATE const char *const mp_s_rmap; extern MP_PRIVATE const uint8_t mp_s_rmap_reverse[]; extern MP_PRIVATE const size_t mp_s_rmap_reverse_sz; extern MP_PRIVATE const mp_digit *s_mp_prime_tab; /* deprecated functions */ MP_DEPRECATED(s_mp_invmod_fast) mp_err fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c); MP_DEPRECATED(s_mp_montgomery_reduce_fast) mp_err fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho); MP_DEPRECATED(s_mp_mul_digs_fast) mp_err fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs); MP_DEPRECATED(s_mp_mul_high_digs_fast) mp_err fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs); MP_DEPRECATED(s_mp_sqr_fast) mp_err fast_s_mp_sqr(const mp_int *a, mp_int *b); MP_DEPRECATED(s_mp_balance_mul) mp_err mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c); MP_DEPRECATED(s_mp_exptmod_fast) mp_err mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode); MP_DEPRECATED(s_mp_invmod_slow) mp_err mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c); MP_DEPRECATED(s_mp_karatsuba_mul) mp_err mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c); MP_DEPRECATED(s_mp_karatsuba_sqr) mp_err mp_karatsuba_sqr(const mp_int *a, mp_int *b); MP_DEPRECATED(s_mp_toom_mul) mp_err mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c); MP_DEPRECATED(s_mp_toom_sqr) mp_err mp_toom_sqr(const mp_int *a, mp_int *b); MP_DEPRECATED(s_mp_reverse) void bn_reverse(unsigned char *s, int len); #ifndef TCL_WITH_EXTERNAL_TOMMATH #undef mp_sqr #define mp_sqr TclBN_mp_sqr #endif #define MP_GET_ENDIANNESS(x) \ do{\ int16_t n = 0x1; \ char *p = (char *)&n; \ x = (p[0] == '\x01') ? MP_LITTLE_ENDIAN : MP_BIG_ENDIAN; \ } while (0) /* code-generating macros */ #define MP_SET_UNSIGNED(name, type) \ void name(mp_int * a, type b) \ { \ int i = 0; \ while (b != 0u) { \ a->dp[i++] = ((mp_digit)b & MP_MASK); \ if (MP_SIZEOF_BITS(type) <= MP_DIGIT_BIT) { break; } \ b >>= ((MP_SIZEOF_BITS(type) <= MP_DIGIT_BIT) ? 0 : MP_DIGIT_BIT); \ } \ a->used = i; \ a->sign = MP_ZPOS; \ MP_ZERO_DIGITS(a->dp + a->used, a->alloc - a->used); \ } #define MP_SET_SIGNED(name, uname, type, utype) \ void name(mp_int * a, type b) \ { \ uname(a, (b < 0) ? -(utype)b : (utype)b); \ if (b < 0) { a->sign = MP_NEG; } \ } #define MP_INIT_INT(name , set, type) \ mp_err name(mp_int * a, type b) \ { \ mp_err err; \ if ((err = mp_init(a)) != MP_OKAY) { \ return err; \ } \ set(a, b); \ return MP_OKAY; \ } #define MP_GET_MAG(name, type) \ type name(const mp_int* a) \ { \ unsigned i = MP_MIN((unsigned)a->used, (unsigned)((MP_SIZEOF_BITS(type) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT)); \ type res = 0u; \ while (i --> 0u) { \ res <<= ((MP_SIZEOF_BITS(type) <= MP_DIGIT_BIT) ? 0 : MP_DIGIT_BIT); \ res |= (type)a->dp[i]; \ if (MP_SIZEOF_BITS(type) <= MP_DIGIT_BIT) { break; } \ } \ return res; \ } #define MP_GET_SIGNED(name, mag, type, utype) \ type name(const mp_int* a) \ { \ utype res = mag(a); \ return (a->sign == MP_NEG) ? (type)-res : (type)res; \ } #endif tcl9.0.3/libtommath/tommath_cutoffs.h0000664000175000017500000000100515076154263017270 0ustar sergeisergei/* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Current values evaluated on an AMD A8-6600K (64-bit). Type "make tune" to optimize them for your machine but be aware that it may take a long time. It took 2:30 minutes on the aforementioned machine for example. */ #define MP_DEFAULT_KARATSUBA_MUL_CUTOFF 80 #define MP_DEFAULT_KARATSUBA_SQR_CUTOFF 120 #define MP_DEFAULT_TOOM_MUL_CUTOFF 350 #define MP_DEFAULT_TOOM_SQR_CUTOFF 400 tcl9.0.3/libtommath/tommath_class.h0000664000175000017500000007020615076154263016735 0ustar sergeisergei/* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) #define LTM_INSIDE #if defined(LTM2) # define LTM3 #endif #if defined(LTM1) # define LTM2 #endif #define LTM1 #if defined(LTM_ALL) # define BN_CUTOFFS_C # define BN_DEPRECATED_C # define BN_MP_2EXPT_C # define BN_MP_ABS_C # define BN_MP_ADD_C # define BN_MP_ADD_D_C # define BN_MP_ADDMOD_C # define BN_MP_AND_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_CMP_MAG_C # define BN_MP_CNT_LSB_C # define BN_MP_COMPLEMENT_C # define BN_MP_COPY_C # define BN_MP_COUNT_BITS_C # define BN_MP_DECR_C # define BN_MP_DIV_C # define BN_MP_DIV_2_C # define BN_MP_DIV_2D_C # define BN_MP_DIV_D_C # define BN_MP_DR_IS_MODULUS_C # define BN_MP_DR_REDUCE_C # define BN_MP_DR_SETUP_C # define BN_MP_ERROR_TO_STRING_C # define BN_MP_EXCH_C # define BN_MP_EXPT_N_C # define BN_MP_EXPTMOD_C # define BN_MP_EXTEUCLID_C # define BN_MP_FREAD_C # define BN_MP_FROM_SBIN_C # define BN_MP_FROM_UBIN_C # define BN_MP_FWRITE_C # define BN_MP_GCD_C # define BN_MP_GET_DOUBLE_C # define BN_MP_GET_I32_C # define BN_MP_GET_I64_C # define BN_MP_GET_L_C # define BN_MP_GET_MAG_U32_C # define BN_MP_GET_MAG_U64_C # define BN_MP_GET_MAG_UL_C # define BN_MP_GROW_C # define BN_MP_INCR_C # define BN_MP_INIT_C # define BN_MP_INIT_COPY_C # define BN_MP_INIT_I32_C # define BN_MP_INIT_I64_C # define BN_MP_INIT_L_C # define BN_MP_INIT_MULTI_C # define BN_MP_INIT_SET_C # define BN_MP_INIT_SIZE_C # define BN_MP_INIT_U32_C # define BN_MP_INIT_U64_C # define BN_MP_INIT_UL_C # define BN_MP_INVMOD_C # define BN_MP_IS_SQUARE_C # define BN_MP_ISEVEN_C # define BN_MP_ISODD_C # define BN_MP_KRONECKER_C # define BN_MP_LCM_C # define BN_MP_LOG_N_C # define BN_MP_LSHD_C # define BN_MP_MOD_C # define BN_MP_MOD_2D_C # define BN_MP_MOD_D_C # define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C # define BN_MP_MONTGOMERY_REDUCE_C # define BN_MP_MONTGOMERY_SETUP_C # define BN_MP_MUL_C # define BN_MP_MUL_2_C # define BN_MP_MUL_2D_C # define BN_MP_MUL_D_C # define BN_MP_MULMOD_C # define BN_MP_NEG_C # define BN_MP_OR_C # define BN_MP_PACK_C # define BN_MP_PACK_COUNT_C # define BN_MP_PRIME_FERMAT_C # define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C # define BN_MP_PRIME_IS_PRIME_C # define BN_MP_PRIME_MILLER_RABIN_C # define BN_MP_PRIME_NEXT_PRIME_C # define BN_MP_PRIME_RABIN_MILLER_TRIALS_C # define BN_MP_PRIME_RAND_C # define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C # define BN_MP_RADIX_SIZE_C # define BN_MP_RADIX_SMAP_C # define BN_MP_RAND_C # define BN_MP_READ_RADIX_C # define BN_MP_REDUCE_C # define BN_MP_REDUCE_2K_C # define BN_MP_REDUCE_2K_L_C # define BN_MP_REDUCE_2K_SETUP_C # define BN_MP_REDUCE_2K_SETUP_L_C # define BN_MP_REDUCE_IS_2K_C # define BN_MP_REDUCE_IS_2K_L_C # define BN_MP_REDUCE_SETUP_C # define BN_MP_ROOT_N_C # define BN_MP_RSHD_C # define BN_MP_SBIN_SIZE_C # define BN_MP_SET_C # define BN_MP_SET_DOUBLE_C # define BN_MP_SET_I32_C # define BN_MP_SET_I64_C # define BN_MP_SET_L_C # define BN_MP_SET_U32_C # define BN_MP_SET_U64_C # define BN_MP_SET_UL_C # define BN_MP_SHRINK_C # define BN_MP_SIGNED_RSH_C # define BN_MP_SQR_C # define BN_MP_SQRMOD_C # define BN_MP_SQRT_C # define BN_MP_SQRTMOD_PRIME_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C # define BN_MP_SUBMOD_C # define BN_MP_TO_RADIX_C # define BN_MP_TO_SBIN_C # define BN_MP_TO_UBIN_C # define BN_MP_UBIN_SIZE_C # define BN_MP_UNPACK_C # define BN_MP_XOR_C # define BN_MP_ZERO_C # define BN_PRIME_TAB_C # define BN_S_MP_ADD_C # define BN_S_MP_BALANCE_MUL_C # define BN_S_MP_DIV_3_C # define BN_S_MP_EXPTMOD_C # define BN_S_MP_EXPTMOD_FAST_C # define BN_S_MP_GET_BIT_C # define BN_S_MP_INVMOD_FAST_C # define BN_S_MP_INVMOD_SLOW_C # define BN_S_MP_KARATSUBA_MUL_C # define BN_S_MP_KARATSUBA_SQR_C # define BN_S_MP_LOG_C # define BN_S_MP_LOG_2EXPT_C # define BN_S_MP_LOG_D_C # define BN_S_MP_MONTGOMERY_REDUCE_FAST_C # define BN_S_MP_MUL_DIGS_C # define BN_S_MP_MUL_DIGS_FAST_C # define BN_S_MP_MUL_HIGH_DIGS_C # define BN_S_MP_MUL_HIGH_DIGS_FAST_C # define BN_S_MP_PRIME_IS_DIVISIBLE_C # define BN_S_MP_RAND_JENKINS_C # define BN_S_MP_RAND_PLATFORM_C # define BN_S_MP_REVERSE_C # define BN_S_MP_SQR_C # define BN_S_MP_SQR_FAST_C # define BN_S_MP_SUB_C # define BN_S_MP_TOOM_MUL_C # define BN_S_MP_TOOM_SQR_C #endif #endif #if defined(BN_CUTOFFS_C) #endif #if defined(BN_DEPRECATED_C) # define BN_FAST_MP_INVMOD_C # define BN_FAST_MP_MONTGOMERY_REDUCE_C # define BN_FAST_S_MP_MUL_DIGS_C # define BN_FAST_S_MP_MUL_HIGH_DIGS_C # define BN_FAST_S_MP_SQR_C # define BN_MP_AND_C # define BN_MP_BALANCE_MUL_C # define BN_MP_CMP_D_C # define BN_MP_DIV_3_C # define BN_MP_EXPORT_C # define BN_MP_EXPTMOD_FAST_C # define BN_MP_EXPT_D_C # define BN_MP_EXPT_D_EX_C # define BN_MP_EXPT_N_C # define BN_MP_EXPT_U32_C # define BN_MP_FROM_SBIN_C # define BN_MP_FROM_UBIN_C # define BN_MP_GET_BIT_C # define BN_MP_GET_INT_C # define BN_MP_GET_LL_C # define BN_MP_GET_LONG_C # define BN_MP_GET_LONG_LONG_C # define BN_MP_GET_MAG_U32_C # define BN_MP_GET_MAG_U64_C # define BN_MP_GET_MAG_ULL_C # define BN_MP_GET_MAG_UL_C # define BN_MP_IMPORT_C # define BN_MP_INIT_LL_C # define BN_MP_INIT_SET_INT_C # define BN_MP_INIT_U32_C # define BN_MP_INIT_ULL_C # define BN_MP_INVMOD_SLOW_C # define BN_MP_JACOBI_C # define BN_MP_KARATSUBA_MUL_C # define BN_MP_KARATSUBA_SQR_C # define BN_MP_KRONECKER_C # define BN_MP_LOG_N_C # define BN_MP_LOG_U32_C # define BN_MP_N_ROOT_C # define BN_MP_N_ROOT_EX_C # define BN_MP_OR_C # define BN_MP_PACK_C # define BN_MP_PRIME_IS_DIVISIBLE_C # define BN_MP_PRIME_RANDOM_EX_C # define BN_MP_RAND_DIGIT_C # define BN_MP_READ_SIGNED_BIN_C # define BN_MP_READ_UNSIGNED_BIN_C # define BN_MP_ROOT_N_C # define BN_MP_ROOT_U32_C # define BN_MP_SBIN_SIZE_C # define BN_MP_SET_INT_C # define BN_MP_SET_LL_C # define BN_MP_SET_LONG_C # define BN_MP_SET_LONG_LONG_C # define BN_MP_SET_U32_C # define BN_MP_SET_U64_C # define BN_MP_SET_ULL_C # define BN_MP_SIGNED_BIN_SIZE_C # define BN_MP_SIGNED_RSH_C # define BN_MP_TC_AND_C # define BN_MP_TC_DIV_2D_C # define BN_MP_TC_OR_C # define BN_MP_TC_XOR_C # define BN_MP_TOOM_MUL_C # define BN_MP_TOOM_SQR_C # define BN_MP_TORADIX_C # define BN_MP_TORADIX_N_C # define BN_MP_TO_RADIX_C # define BN_MP_TO_SBIN_C # define BN_MP_TO_SIGNED_BIN_C # define BN_MP_TO_SIGNED_BIN_N_C # define BN_MP_TO_UBIN_C # define BN_MP_TO_UNSIGNED_BIN_C # define BN_MP_TO_UNSIGNED_BIN_N_C # define BN_MP_UBIN_SIZE_C # define BN_MP_UNPACK_C # define BN_MP_UNSIGNED_BIN_SIZE_C # define BN_MP_XOR_C # define BN_S_MP_BALANCE_MUL_C # define BN_S_MP_DIV_3_C # define BN_S_MP_EXPTMOD_FAST_C # define BN_S_MP_GET_BIT_C # define BN_S_MP_INVMOD_FAST_C # define BN_S_MP_INVMOD_SLOW_C # define BN_S_MP_KARATSUBA_MUL_C # define BN_S_MP_KARATSUBA_SQR_C # define BN_S_MP_MONTGOMERY_REDUCE_FAST_C # define BN_S_MP_MUL_DIGS_FAST_C # define BN_S_MP_MUL_HIGH_DIGS_FAST_C # define BN_S_MP_PRIME_IS_DIVISIBLE_C # define BN_S_MP_PRIME_RANDOM_EX_C # define BN_S_MP_RAND_SOURCE_C # define BN_S_MP_REVERSE_C # define BN_S_MP_SQR_FAST_C # define BN_S_MP_TOOM_MUL_C # define BN_S_MP_TOOM_SQR_C #endif #if defined(BN_MP_2EXPT_C) # define BN_MP_GROW_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_ABS_C) # define BN_MP_COPY_C #endif #if defined(BN_MP_ADD_C) # define BN_MP_CMP_MAG_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_ADD_D_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_ADDMOD_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_INIT_C # define BN_MP_MOD_C #endif #if defined(BN_MP_AND_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_CLAMP_C) #endif #if defined(BN_MP_CLEAR_C) #endif #if defined(BN_MP_CLEAR_MULTI_C) # define BN_MP_CLEAR_C #endif #if defined(BN_MP_CMP_C) # define BN_MP_CMP_MAG_C #endif #if defined(BN_MP_CMP_D_C) #endif #if defined(BN_MP_CMP_MAG_C) #endif #if defined(BN_MP_CNT_LSB_C) #endif #if defined(BN_MP_COMPLEMENT_C) # define BN_MP_NEG_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_COPY_C) # define BN_MP_GROW_C #endif #if defined(BN_MP_COUNT_BITS_C) #endif #if defined(BN_MP_DECR_C) # define BN_MP_INCR_C # define BN_MP_SET_C # define BN_MP_SUB_D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_DIV_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_CMP_C # define BN_MP_CMP_MAG_C # define BN_MP_COPY_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_2D_C # define BN_MP_EXCH_C # define BN_MP_INIT_C # define BN_MP_INIT_COPY_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_MUL_2D_C # define BN_MP_MUL_D_C # define BN_MP_RSHD_C # define BN_MP_SUB_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_DIV_2_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_DIV_2D_C) # define BN_MP_CLAMP_C # define BN_MP_COPY_C # define BN_MP_MOD_2D_C # define BN_MP_RSHD_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_DIV_D_C) # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_COPY_C # define BN_MP_DIV_2D_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C # define BN_S_MP_DIV_3_C #endif #if defined(BN_MP_DR_IS_MODULUS_C) #endif #if defined(BN_MP_DR_REDUCE_C) # define BN_MP_CLAMP_C # define BN_MP_CMP_MAG_C # define BN_MP_GROW_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_DR_SETUP_C) #endif #if defined(BN_MP_ERROR_TO_STRING_C) #endif #if defined(BN_MP_EXCH_C) #endif #if defined(BN_MP_EXPT_N_C) # define BN_MP_CLEAR_C # define BN_MP_INIT_COPY_C # define BN_MP_MUL_C # define BN_MP_SET_C # define BN_MP_SQR_C #endif #if defined(BN_MP_EXPTMOD_C) # define BN_MP_ABS_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_DR_IS_MODULUS_C # define BN_MP_INIT_MULTI_C # define BN_MP_INVMOD_C # define BN_MP_REDUCE_IS_2K_C # define BN_MP_REDUCE_IS_2K_L_C # define BN_S_MP_EXPTMOD_C # define BN_S_MP_EXPTMOD_FAST_C #endif #if defined(BN_MP_EXTEUCLID_C) # define BN_MP_CLEAR_MULTI_C # define BN_MP_COPY_C # define BN_MP_DIV_C # define BN_MP_EXCH_C # define BN_MP_INIT_MULTI_C # define BN_MP_MUL_C # define BN_MP_NEG_C # define BN_MP_SET_C # define BN_MP_SUB_C #endif #if defined(BN_MP_FREAD_C) # define BN_MP_ADD_D_C # define BN_MP_MUL_D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_FROM_SBIN_C) # define BN_MP_FROM_UBIN_C #endif #if defined(BN_MP_FROM_UBIN_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C # define BN_MP_MUL_2D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_FWRITE_C) # define BN_MP_RADIX_SIZE_C # define BN_MP_TO_RADIX_C #endif #if defined(BN_MP_GCD_C) # define BN_MP_ABS_C # define BN_MP_CLEAR_C # define BN_MP_CMP_MAG_C # define BN_MP_CNT_LSB_C # define BN_MP_DIV_2D_C # define BN_MP_EXCH_C # define BN_MP_INIT_COPY_C # define BN_MP_MUL_2D_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_GET_DOUBLE_C) #endif #if defined(BN_MP_GET_I32_C) # define BN_MP_GET_MAG_U32_C #endif #if defined(BN_MP_GET_I64_C) # define BN_MP_GET_MAG_U64_C #endif #if defined(BN_MP_GET_L_C) # define BN_MP_GET_MAG_UL_C #endif #if defined(BN_MP_GET_MAG_U32_C) #endif #if defined(BN_MP_GET_MAG_U64_C) #endif #if defined(BN_MP_GET_MAG_UL_C) #endif #if defined(BN_MP_GROW_C) #endif #if defined(BN_MP_INCR_C) # define BN_MP_ADD_D_C # define BN_MP_DECR_C # define BN_MP_SET_C #endif #if defined(BN_MP_INIT_C) #endif #if defined(BN_MP_INIT_COPY_C) # define BN_MP_CLEAR_C # define BN_MP_COPY_C # define BN_MP_INIT_SIZE_C #endif #if defined(BN_MP_INIT_I32_C) # define BN_MP_INIT_C # define BN_MP_SET_I32_C #endif #if defined(BN_MP_INIT_I64_C) # define BN_MP_INIT_C # define BN_MP_SET_I64_C #endif #if defined(BN_MP_INIT_L_C) # define BN_MP_INIT_C # define BN_MP_SET_L_C #endif #if defined(BN_MP_INIT_MULTI_C) # define BN_MP_CLEAR_C # define BN_MP_INIT_C #endif #if defined(BN_MP_INIT_SET_C) # define BN_MP_INIT_C # define BN_MP_SET_C #endif #if defined(BN_MP_INIT_SIZE_C) #endif #if defined(BN_MP_INIT_U32_C) # define BN_MP_INIT_C # define BN_MP_SET_U32_C #endif #if defined(BN_MP_INIT_U64_C) # define BN_MP_INIT_C # define BN_MP_SET_U64_C #endif #if defined(BN_MP_INIT_UL_C) # define BN_MP_INIT_C # define BN_MP_SET_UL_C #endif #if defined(BN_MP_INVMOD_C) # define BN_MP_CMP_D_C # define BN_S_MP_INVMOD_FAST_C # define BN_S_MP_INVMOD_SLOW_C #endif #if defined(BN_MP_IS_SQUARE_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_MAG_C # define BN_MP_GET_I32_C # define BN_MP_INIT_U32_C # define BN_MP_MOD_C # define BN_MP_MOD_D_C # define BN_MP_SQRT_C # define BN_MP_SQR_C #endif #if defined(BN_MP_ISEVEN_C) #endif #if defined(BN_MP_ISODD_C) #endif #if defined(BN_MP_KRONECKER_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_D_C # define BN_MP_CNT_LSB_C # define BN_MP_COPY_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_C # define BN_MP_INIT_COPY_C # define BN_MP_MOD_C #endif #if defined(BN_MP_LCM_C) # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_MAG_C # define BN_MP_DIV_C # define BN_MP_GCD_C # define BN_MP_INIT_MULTI_C # define BN_MP_MUL_C #endif #if defined(BN_MP_LOG_N_C) # define BN_S_MP_LOG_2EXPT_C # define BN_S_MP_LOG_C # define BN_S_MP_LOG_D_C #endif #if defined(BN_MP_LSHD_C) # define BN_MP_GROW_C #endif #if defined(BN_MP_MOD_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_DIV_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C #endif #if defined(BN_MP_MOD_2D_C) # define BN_MP_CLAMP_C # define BN_MP_COPY_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_MOD_D_C) # define BN_MP_DIV_D_C #endif #if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) # define BN_MP_2EXPT_C # define BN_MP_CMP_MAG_C # define BN_MP_COUNT_BITS_C # define BN_MP_MUL_2_C # define BN_MP_SET_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_MONTGOMERY_REDUCE_C) # define BN_MP_CLAMP_C # define BN_MP_CMP_MAG_C # define BN_MP_GROW_C # define BN_MP_RSHD_C # define BN_S_MP_MONTGOMERY_REDUCE_FAST_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_MONTGOMERY_SETUP_C) #endif #if defined(BN_MP_MUL_C) # define BN_S_MP_BALANCE_MUL_C # define BN_S_MP_KARATSUBA_MUL_C # define BN_S_MP_MUL_DIGS_C # define BN_S_MP_MUL_DIGS_FAST_C # define BN_S_MP_TOOM_MUL_C #endif #if defined(BN_MP_MUL_2_C) # define BN_MP_GROW_C #endif #if defined(BN_MP_MUL_2D_C) # define BN_MP_CLAMP_C # define BN_MP_COPY_C # define BN_MP_GROW_C # define BN_MP_LSHD_C #endif #if defined(BN_MP_MUL_D_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_MULMOD_C) # define BN_MP_CLEAR_C # define BN_MP_INIT_SIZE_C # define BN_MP_MOD_C # define BN_MP_MUL_C #endif #if defined(BN_MP_NEG_C) # define BN_MP_COPY_C #endif #if defined(BN_MP_OR_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_PACK_C) # define BN_MP_CLEAR_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_COPY_C # define BN_MP_PACK_COUNT_C #endif #if defined(BN_MP_PACK_COUNT_C) # define BN_MP_COUNT_BITS_C #endif #if defined(BN_MP_PRIME_FERMAT_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_EXPTMOD_C # define BN_MP_INIT_C #endif #if defined(BN_MP_PRIME_FROBENIUS_UNDERWOOD_C) # define BN_MP_ADD_C # define BN_MP_ADD_D_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_COUNT_BITS_C # define BN_MP_EXCH_C # define BN_MP_GCD_C # define BN_MP_INIT_MULTI_C # define BN_MP_KRONECKER_C # define BN_MP_MOD_C # define BN_MP_MUL_2_C # define BN_MP_MUL_C # define BN_MP_MUL_D_C # define BN_MP_SET_C # define BN_MP_SET_U32_C # define BN_MP_SQR_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C # define BN_S_MP_GET_BIT_C #endif #if defined(BN_MP_PRIME_IS_PRIME_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_SET_C # define BN_MP_IS_SQUARE_C # define BN_MP_PRIME_MILLER_RABIN_C # define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C # define BN_MP_RAND_C # define BN_MP_READ_RADIX_C # define BN_MP_SET_C # define BN_S_MP_PRIME_IS_DIVISIBLE_C #endif #if defined(BN_MP_PRIME_MILLER_RABIN_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_CNT_LSB_C # define BN_MP_DIV_2D_C # define BN_MP_EXPTMOD_C # define BN_MP_INIT_C # define BN_MP_INIT_COPY_C # define BN_MP_SQRMOD_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_PRIME_NEXT_PRIME_C) # define BN_MP_ADD_D_C # define BN_MP_CLEAR_C # define BN_MP_CMP_D_C # define BN_MP_INIT_C # define BN_MP_MOD_D_C # define BN_MP_PRIME_IS_PRIME_C # define BN_MP_SET_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) #endif #if defined(BN_MP_PRIME_RAND_C) # define BN_MP_ADD_D_C # define BN_MP_DIV_2_C # define BN_MP_FROM_UBIN_C # define BN_MP_MUL_2_C # define BN_MP_PRIME_IS_PRIME_C # define BN_MP_SUB_D_C # define BN_S_MP_PRIME_RANDOM_EX_C # define BN_S_MP_RAND_CB_C # define BN_S_MP_RAND_SOURCE_C #endif #if defined(BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C) # define BN_MP_ADD_C # define BN_MP_ADD_D_C # define BN_MP_CLEAR_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_CNT_LSB_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_2D_C # define BN_MP_DIV_2_C # define BN_MP_GCD_C # define BN_MP_INIT_C # define BN_MP_INIT_MULTI_C # define BN_MP_KRONECKER_C # define BN_MP_MOD_C # define BN_MP_MUL_2_C # define BN_MP_MUL_C # define BN_MP_SET_C # define BN_MP_SET_I32_C # define BN_MP_SET_U32_C # define BN_MP_SQR_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C # define BN_S_MP_GET_BIT_C # define BN_S_MP_MUL_SI_C #endif #if defined(BN_MP_RADIX_SIZE_C) # define BN_MP_CLEAR_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_D_C # define BN_MP_INIT_COPY_C #endif #if defined(BN_MP_RADIX_SMAP_C) #endif #if defined(BN_MP_RAND_C) # define BN_MP_GROW_C # define BN_MP_RAND_SOURCE_C # define BN_MP_ZERO_C # define BN_S_MP_RAND_PLATFORM_C # define BN_S_MP_RAND_SOURCE_C #endif #if defined(BN_MP_READ_RADIX_C) # define BN_MP_ADD_D_C # define BN_MP_MUL_D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_REDUCE_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_INIT_COPY_C # define BN_MP_LSHD_C # define BN_MP_MOD_2D_C # define BN_MP_MUL_C # define BN_MP_RSHD_C # define BN_MP_SET_C # define BN_MP_SUB_C # define BN_S_MP_MUL_DIGS_C # define BN_S_MP_MUL_HIGH_DIGS_C # define BN_S_MP_MUL_HIGH_DIGS_FAST_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_REDUCE_2K_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_MAG_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_C # define BN_MP_MUL_D_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_REDUCE_2K_L_C) # define BN_MP_CLEAR_C # define BN_MP_CMP_MAG_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_C # define BN_MP_MUL_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_REDUCE_2K_SETUP_C) # define BN_MP_2EXPT_C # define BN_MP_CLEAR_C # define BN_MP_COUNT_BITS_C # define BN_MP_INIT_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_REDUCE_2K_SETUP_L_C) # define BN_MP_2EXPT_C # define BN_MP_CLEAR_C # define BN_MP_COUNT_BITS_C # define BN_MP_INIT_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_REDUCE_IS_2K_C) # define BN_MP_COUNT_BITS_C #endif #if defined(BN_MP_REDUCE_IS_2K_L_C) #endif #if defined(BN_MP_REDUCE_SETUP_C) # define BN_MP_2EXPT_C # define BN_MP_DIV_C #endif #if defined(BN_MP_ROOT_N_C) # define BN_MP_2EXPT_C # define BN_MP_ADD_D_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_COPY_C # define BN_MP_COUNT_BITS_C # define BN_MP_DIV_C # define BN_MP_EXCH_C # define BN_MP_EXPT_N_C # define BN_MP_INIT_MULTI_C # define BN_MP_MUL_C # define BN_MP_MUL_D_C # define BN_MP_SET_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_RSHD_C) # define BN_MP_ZERO_C #endif #if defined(BN_MP_SBIN_SIZE_C) # define BN_MP_UBIN_SIZE_C #endif #if defined(BN_MP_SET_C) #endif #if defined(BN_MP_SET_DOUBLE_C) # define BN_MP_DIV_2D_C # define BN_MP_MUL_2D_C # define BN_MP_SET_U64_C #endif #if defined(BN_MP_SET_I32_C) # define BN_MP_SET_U32_C #endif #if defined(BN_MP_SET_I64_C) # define BN_MP_SET_U64_C #endif #if defined(BN_MP_SET_L_C) # define BN_MP_SET_UL_C #endif #if defined(BN_MP_SET_U32_C) #endif #if defined(BN_MP_SET_U64_C) #endif #if defined(BN_MP_SET_UL_C) #endif #if defined(BN_MP_SHRINK_C) #endif #if defined(BN_MP_SIGNED_RSH_C) # define BN_MP_ADD_D_C # define BN_MP_DIV_2D_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_SQR_C) # define BN_S_MP_KARATSUBA_SQR_C # define BN_S_MP_SQR_C # define BN_S_MP_SQR_FAST_C # define BN_S_MP_TOOM_SQR_C #endif #if defined(BN_MP_SQRMOD_C) # define BN_MP_CLEAR_C # define BN_MP_INIT_C # define BN_MP_MOD_C # define BN_MP_SQR_C #endif #if defined(BN_MP_SQRT_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_CMP_MAG_C # define BN_MP_DIV_2_C # define BN_MP_DIV_C # define BN_MP_EXCH_C # define BN_MP_INIT_C # define BN_MP_INIT_COPY_C # define BN_MP_RSHD_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_SQRTMOD_PRIME_C) # define BN_MP_ADD_D_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_D_C # define BN_MP_COPY_C # define BN_MP_DIV_2_C # define BN_MP_EXPTMOD_C # define BN_MP_INIT_MULTI_C # define BN_MP_KRONECKER_C # define BN_MP_MOD_D_C # define BN_MP_MULMOD_C # define BN_MP_SET_C # define BN_MP_SET_U32_C # define BN_MP_SQRMOD_C # define BN_MP_SUB_D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_SUB_C) # define BN_MP_CMP_MAG_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_MP_SUB_D_C) # define BN_MP_ADD_D_C # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_SUBMOD_C) # define BN_MP_CLEAR_C # define BN_MP_INIT_C # define BN_MP_MOD_C # define BN_MP_SUB_C #endif #if defined(BN_MP_TO_RADIX_C) # define BN_MP_CLEAR_C # define BN_MP_DIV_D_C # define BN_MP_INIT_COPY_C # define BN_S_MP_REVERSE_C #endif #if defined(BN_MP_TO_SBIN_C) # define BN_MP_TO_UBIN_C #endif #if defined(BN_MP_TO_UBIN_C) # define BN_MP_CLEAR_C # define BN_MP_DIV_2D_C # define BN_MP_INIT_COPY_C # define BN_MP_UBIN_SIZE_C #endif #if defined(BN_MP_UBIN_SIZE_C) # define BN_MP_COUNT_BITS_C #endif #if defined(BN_MP_UNPACK_C) # define BN_MP_CLAMP_C # define BN_MP_MUL_2D_C # define BN_MP_ZERO_C #endif #if defined(BN_MP_XOR_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_MP_ZERO_C) #endif #if defined(BN_PRIME_TAB_C) #endif #if defined(BN_S_MP_ADD_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_S_MP_BALANCE_MUL_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_EXCH_C # define BN_MP_INIT_MULTI_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_MUL_C #endif #if defined(BN_S_MP_DIV_3_C) # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C #endif #if defined(BN_S_MP_EXPTMOD_C) # define BN_MP_CLEAR_C # define BN_MP_COPY_C # define BN_MP_COUNT_BITS_C # define BN_MP_EXCH_C # define BN_MP_INIT_C # define BN_MP_MOD_C # define BN_MP_MUL_C # define BN_MP_REDUCE_2K_L_C # define BN_MP_REDUCE_2K_SETUP_L_C # define BN_MP_REDUCE_C # define BN_MP_REDUCE_SETUP_C # define BN_MP_SET_C # define BN_MP_SQR_C #endif #if defined(BN_S_MP_EXPTMOD_FAST_C) # define BN_MP_CLEAR_C # define BN_MP_COPY_C # define BN_MP_COUNT_BITS_C # define BN_MP_DR_REDUCE_C # define BN_MP_DR_SETUP_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C # define BN_MP_MOD_C # define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C # define BN_MP_MONTGOMERY_REDUCE_C # define BN_MP_MONTGOMERY_SETUP_C # define BN_MP_MULMOD_C # define BN_MP_MUL_C # define BN_MP_REDUCE_2K_C # define BN_MP_REDUCE_2K_SETUP_C # define BN_MP_SET_C # define BN_MP_SQR_C # define BN_S_MP_MONTGOMERY_REDUCE_FAST_C #endif #if defined(BN_S_MP_GET_BIT_C) #endif #if defined(BN_S_MP_INVMOD_FAST_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_CMP_MAG_C # define BN_MP_COPY_C # define BN_MP_DIV_2_C # define BN_MP_EXCH_C # define BN_MP_INIT_MULTI_C # define BN_MP_MOD_C # define BN_MP_SET_C # define BN_MP_SUB_C #endif #if defined(BN_S_MP_INVMOD_SLOW_C) # define BN_MP_ADD_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_CMP_MAG_C # define BN_MP_COPY_C # define BN_MP_DIV_2_C # define BN_MP_EXCH_C # define BN_MP_INIT_MULTI_C # define BN_MP_MOD_C # define BN_MP_SET_C # define BN_MP_SUB_C #endif #if defined(BN_S_MP_KARATSUBA_MUL_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_MUL_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_S_MP_KARATSUBA_SQR_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_SQR_C # define BN_S_MP_ADD_C # define BN_S_MP_SUB_C #endif #if defined(BN_S_MP_LOG_C) # define BN_MP_CLEAR_MULTI_C # define BN_MP_CMP_C # define BN_MP_CMP_D_C # define BN_MP_COPY_C # define BN_MP_EXCH_C # define BN_MP_EXPT_N_C # define BN_MP_INIT_MULTI_C # define BN_MP_MUL_C # define BN_MP_SET_C # define BN_MP_SQR_C #endif #if defined(BN_S_MP_LOG_2EXPT_C) # define BN_MP_COUNT_BITS_C #endif #if defined(BN_S_MP_LOG_D_C) #endif #if defined(BN_S_MP_MONTGOMERY_REDUCE_FAST_C) # define BN_MP_CLAMP_C # define BN_MP_CMP_MAG_C # define BN_MP_GROW_C # define BN_S_MP_SUB_C #endif #if defined(BN_S_MP_MUL_DIGS_C) # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C # define BN_S_MP_MUL_DIGS_FAST_C #endif #if defined(BN_S_MP_MUL_DIGS_FAST_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_S_MP_MUL_HIGH_DIGS_C) # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C # define BN_S_MP_MUL_HIGH_DIGS_FAST_C #endif #if defined(BN_S_MP_MUL_HIGH_DIGS_FAST_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_S_MP_PRIME_IS_DIVISIBLE_C) # define BN_MP_MOD_D_C #endif #if defined(BN_S_MP_RAND_JENKINS_C) # define BN_S_MP_RAND_JENKINS_INIT_C #endif #if defined(BN_S_MP_RAND_PLATFORM_C) #endif #if defined(BN_S_MP_REVERSE_C) #endif #if defined(BN_S_MP_SQR_C) # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_EXCH_C # define BN_MP_INIT_SIZE_C #endif #if defined(BN_S_MP_SQR_FAST_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_S_MP_SUB_C) # define BN_MP_CLAMP_C # define BN_MP_GROW_C #endif #if defined(BN_S_MP_TOOM_MUL_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_CLEAR_MULTI_C # define BN_MP_DIV_2_C # define BN_MP_INIT_MULTI_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_MUL_2_C # define BN_MP_MUL_C # define BN_MP_SUB_C # define BN_S_MP_DIV_3_C #endif #if defined(BN_S_MP_TOOM_SQR_C) # define BN_MP_ADD_C # define BN_MP_CLAMP_C # define BN_MP_CLEAR_C # define BN_MP_DIV_2_C # define BN_MP_INIT_C # define BN_MP_INIT_SIZE_C # define BN_MP_LSHD_C # define BN_MP_MUL_2_C # define BN_MP_MUL_C # define BN_MP_SQR_C # define BN_MP_SUB_C #endif #ifdef LTM_INSIDE #undef LTM_INSIDE #ifdef LTM3 # define LTM_LAST #endif #include "tommath_superclass.h" #include "tommath_class.h" #else # define LTM_LAST #endif tcl9.0.3/libtommath/tommath.h0000664000175000017500000007345315104661341015547 0ustar sergeisergei/* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef BN_H_ #define BN_H_ #include #include #include #ifdef LTM_NO_FILE # warning LTM_NO_FILE has been deprecated, use MP_NO_FILE. # define MP_NO_FILE #endif #ifndef MP_NO_FILE # include #endif #ifdef MP_8BIT # ifdef _MSC_VER # pragma message("8-bit (MP_8BIT) support is deprecated and will be dropped completely in the next version.") # else # warning "8-bit (MP_8BIT) support is deprecated and will be dropped completely in the next version." # endif #endif #ifdef __cplusplus extern "C" { #endif /* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */ #if (defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)) && !defined(MP_32BIT) && !defined(MP_64BIT) # define MP_32BIT #endif /* detect 64-bit mode if possible */ #if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) || \ defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || \ defined(__s390x__) || defined(__arch64__) || defined(__aarch64__) || \ defined(__sparcv9) || defined(__sparc_v9__) || defined(__sparc64__) || \ defined(__ia64) || defined(__ia64__) || defined(__itanium__) || defined(_M_IA64) || \ defined(__LP64__) || defined(_LP64) || defined(__64BIT__) # if !(defined(MP_64BIT) || defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT)) # if defined(__GNUC__) && defined(__SIZEOF_INT128__) && !defined(__hppa) /* we support 128bit integers only via: __attribute__((mode(TI))) */ # define MP_64BIT # else /* otherwise we fall back to MP_32BIT even on 64bit platforms */ # define MP_32BIT # endif # endif #endif #ifdef MP_DIGIT_BIT # error Defining MP_DIGIT_BIT is disallowed, use MP_8/16/31/32/64BIT #endif /* some default configurations. * * A "mp_digit" must be able to hold MP_DIGIT_BIT + 1 bits * A "mp_word" must be able to hold 2*MP_DIGIT_BIT + 1 bits * * At the very least a mp_digit must be able to hold 7 bits * [any size beyond that is ok provided it doesn't overflow the data type] */ #ifdef MP_8BIT typedef uint8_t mp_digit; typedef uint16_t private_mp_word; # define MP_DIGIT_BIT 7 #elif defined(MP_16BIT) typedef uint16_t mp_digit; typedef uint32_t private_mp_word; # define MP_DIGIT_BIT 15 #elif defined(MP_64BIT) /* for GCC only on supported platforms */ typedef uint64_t mp_digit; #if defined(__GNUC__) typedef unsigned long private_mp_word __attribute__((mode(TI))); #endif # define MP_DIGIT_BIT 60 #else typedef uint32_t mp_digit; typedef uint64_t private_mp_word; # ifdef MP_31BIT /* * This is an extension that uses 31-bit digits. * Please be aware that not all functions support this size, especially s_mp_mul_digs_fast * will be reduced to work on small numbers only: * Up to 8 limbs, 248 bits instead of up to 512 limbs, 15872 bits with MP_28BIT. */ # define MP_DIGIT_BIT 31 # else /* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */ # define MP_DIGIT_BIT 28 # define MP_28BIT # endif #endif /* mp_word is a private type */ #define mp_word MP_DEPRECATED_PRAGMA("mp_word has been made private") private_mp_word #define MP_SIZEOF_MP_DIGIT (MP_DEPRECATED_PRAGMA("MP_SIZEOF_MP_DIGIT has been deprecated, use sizeof (mp_digit)") sizeof (mp_digit)) #define MP_MASK ((((mp_digit)1)<<((mp_digit)MP_DIGIT_BIT))-((mp_digit)1)) #define MP_DIGIT_MAX MP_MASK /* Primality generation flags */ #define MP_PRIME_BBS 0x0001 /* BBS style prime */ #define MP_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */ #define MP_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */ #define LTM_PRIME_BBS (MP_DEPRECATED_PRAGMA("LTM_PRIME_BBS has been deprecated, use MP_PRIME_BBS") MP_PRIME_BBS) #define LTM_PRIME_SAFE (MP_DEPRECATED_PRAGMA("LTM_PRIME_SAFE has been deprecated, use MP_PRIME_SAFE") MP_PRIME_SAFE) #define LTM_PRIME_2MSB_ON (MP_DEPRECATED_PRAGMA("LTM_PRIME_2MSB_ON has been deprecated, use MP_PRIME_2MSB_ON") MP_PRIME_2MSB_ON) #ifdef MP_USE_ENUMS typedef enum { MP_ZPOS = 0, /* positive */ MP_NEG = 1 /* negative */ } mp_sign; typedef enum { MP_LT = -1, /* less than */ MP_EQ = 0, /* equal */ MP_GT = 1 /* greater than */ } mp_ord; typedef enum { MP_NO = 0, MP_YES = 1 } mp_bool; typedef enum { MP_OKAY = 0, /* no error */ MP_ERR = -1, /* unknown error */ MP_MEM = -2, /* out of mem */ MP_VAL = -3, /* invalid input */ MP_ITER = -4, /* maximum iterations reached */ MP_BUF = -5 /* buffer overflow, supplied buffer too small */ } mp_err; typedef enum { MP_LSB_FIRST = -1, MP_MSB_FIRST = 1 } mp_order; typedef enum { MP_LITTLE_ENDIAN = -1, MP_NATIVE_ENDIAN = 0, MP_BIG_ENDIAN = 1 } mp_endian; #else typedef int mp_sign; #define MP_ZPOS 0 /* positive integer */ #define MP_NEG 1 /* negative */ typedef int mp_ord; #define MP_LT -1 /* less than */ #define MP_EQ 0 /* equal to */ #define MP_GT 1 /* greater than */ typedef int mp_bool; #define MP_YES 1 #define MP_NO 0 typedef int mp_err; #define MP_OKAY 0 /* no error */ #define MP_ERR -1 /* unknown error */ #define MP_MEM -2 /* out of mem */ #define MP_VAL -3 /* invalid input */ #define MP_RANGE (MP_DEPRECATED_PRAGMA("MP_RANGE has been deprecated in favor of MP_VAL") MP_VAL) #define MP_ITER -4 /* maximum iterations reached */ #define MP_BUF -5 /* buffer overflow, supplied buffer too small */ typedef int mp_order; #define MP_LSB_FIRST -1 #define MP_MSB_FIRST 1 typedef int mp_endian; #define MP_LITTLE_ENDIAN -1 #define MP_NATIVE_ENDIAN 0 #define MP_BIG_ENDIAN 1 #endif /* tunable cutoffs */ #ifndef MP_FIXED_CUTOFFS extern int KARATSUBA_MUL_CUTOFF, KARATSUBA_SQR_CUTOFF, TOOM_MUL_CUTOFF, TOOM_SQR_CUTOFF; #endif /* define this to use lower memory usage routines (exptmods mostly) */ /* #define MP_LOW_MEM */ /* default precision */ #ifndef MP_PREC # ifndef MP_LOW_MEM # define PRIVATE_MP_PREC 32 /* default digits of precision */ # elif defined(MP_8BIT) # define PRIVATE_MP_PREC 16 /* default digits of precision */ # else # define PRIVATE_MP_PREC 8 /* default digits of precision */ # endif # define MP_PREC (MP_DEPRECATED_PRAGMA("MP_PREC is an internal macro") PRIVATE_MP_PREC) #endif /* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */ #define PRIVATE_MP_WARRAY (int)(1 << (((CHAR_BIT * (int)sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1)) #define MP_WARRAY (MP_DEPRECATED_PRAGMA("MP_WARRAY is an internal macro") PRIVATE_MP_WARRAY) #if defined(__GNUC__) && __GNUC__ >= 4 # define MP_NULL_TERMINATED __attribute__((sentinel)) #else # define MP_NULL_TERMINATED #endif /* * MP_WUR - warn unused result * --------------------------- * * The result of functions annotated with MP_WUR must be * checked and cannot be ignored. * * Most functions in libtommath return an error code. * This error code must be checked in order to prevent crashes or invalid * results. * * If you still want to avoid the error checks for quick and dirty programs * without robustness guarantees, you can `#define MP_WUR` before including * tommath.h, disabling the warnings. */ #ifndef MP_WUR # if defined(__GNUC__) && __GNUC__ >= 4 # define MP_WUR __attribute__((warn_unused_result)) # else # define MP_WUR # endif #endif #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405) # define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x))) # define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s) # define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s) #elif defined(_MSC_VER) && _MSC_VER >= 1500 # define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x)) # define MP_DEPRECATED_PRAGMA(s) __pragma(message(s)) #else # define MP_DEPRECATED(s) # define MP_DEPRECATED_PRAGMA(s) #endif #define DIGIT_BIT (MP_DEPRECATED_PRAGMA("DIGIT_BIT macro is deprecated, MP_DIGIT_BIT instead") MP_DIGIT_BIT) #define USED(m) (MP_DEPRECATED_PRAGMA("USED macro is deprecated, use z->used instead") (m)->used) #define DIGIT(m, k) (MP_DEPRECATED_PRAGMA("DIGIT macro is deprecated, use z->dp instead") (m)->dp[(k)]) #define SIGN(m) (MP_DEPRECATED_PRAGMA("SIGN macro is deprecated, use z->sign instead") (m)->sign) /* the infamous mp_int structure */ #ifndef MP_INT_DECLARED #define MP_INT_DECLARED typedef struct mp_int mp_int; #endif struct mp_int { int used, alloc; mp_sign sign; mp_digit *dp; }; /* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */ typedef int private_mp_prime_callback(unsigned char *dst, int len, void *dat); typedef private_mp_prime_callback MP_DEPRECATED(mp_rand_source) ltm_prime_callback; /* error code to char* string */ const char *mp_error_to_string(mp_err code) MP_WUR; /* ---> init and deinit bignum functions <--- */ /* init a bignum */ mp_err mp_init(mp_int *a) MP_WUR; /* free a bignum */ void mp_clear(mp_int *a); /* init a null terminated series of arguments */ mp_err mp_init_multi(mp_int *mp, ...) MP_NULL_TERMINATED MP_WUR; /* clear a null terminated series of arguments */ void mp_clear_multi(mp_int *mp, ...) MP_NULL_TERMINATED; /* exchange two ints */ void mp_exch(mp_int *a, mp_int *b); /* shrink ram required for a bignum */ mp_err mp_shrink(mp_int *a) MP_WUR; /* grow an int to a given size */ mp_err mp_grow(mp_int *a, int size) MP_WUR; /* init to a given number of digits */ mp_err mp_init_size(mp_int *a, int size) MP_WUR; /* ---> Basic Manipulations <--- */ #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) mp_bool mp_iseven(const mp_int *a) MP_WUR; mp_bool mp_isodd(const mp_int *a) MP_WUR; #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO) /* set to zero */ void mp_zero(mp_int *a); /* get and set doubles */ double mp_get_double(const mp_int *a) MP_WUR; mp_err mp_set_double(mp_int *a, double b) MP_WUR; /* get integer, set integer and init with integer (int32_t) */ int32_t mp_get_i32(const mp_int *a) MP_WUR; void mp_set_i32(mp_int *a, int32_t b); mp_err mp_init_i32(mp_int *a, int32_t b) MP_WUR; /* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint32_t) */ #define mp_get_u32(a) ((uint32_t)mp_get_i32(a)) void mp_set_u32(mp_int *a, uint32_t b); mp_err mp_init_u32(mp_int *a, uint32_t b) MP_WUR; /* get integer, set integer and init with integer (int64_t) */ int64_t mp_get_i64(const mp_int *a) MP_WUR; void mp_set_i64(mp_int *a, int64_t b); mp_err mp_init_i64(mp_int *a, int64_t b) MP_WUR; /* get integer, set integer and init with integer, behaves like two complement for negative numbers (uint64_t) */ #define mp_get_u64(a) ((uint64_t)mp_get_i64(a)) void mp_set_u64(mp_int *a, uint64_t b); mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR; /* get magnitude */ uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR; uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR; unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_get_mag_u64) unsigned long long mp_get_mag_ull(const mp_int *a) MP_WUR; /* get integer, set integer (long) */ long mp_get_l(const mp_int *a) MP_WUR; void mp_set_l(mp_int *a, long b); mp_err mp_init_l(mp_int *a, long b) MP_WUR; /* get integer, set integer (unsigned long) */ #define mp_get_ul(a) ((unsigned long)mp_get_l(a)) void mp_set_ul(mp_int *a, unsigned long b); mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR; /* get integer, set integer (long long) */ MP_DEPRECATED(mp_get_i64) long long mp_get_ll(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_set_i64) void mp_set_ll(mp_int *a, long long b); MP_DEPRECATED(mp_init_i64) mp_err mp_init_ll(mp_int *a, long long b) MP_WUR; /* get integer, set integer (unsigned long long) */ #define mp_get_ull(a) (MP_DEPRECATED_PRAGMA("mp_get_ull() has been deprecated, use mp_get_u64()") ((unsigned long long)mp_get_ll(a))) MP_DEPRECATED(mp_set_u64) void mp_set_ull(mp_int *a, unsigned long long b); MP_DEPRECATED(mp_init_u64) mp_err mp_init_ull(mp_int *a, unsigned long long b) MP_WUR; /* set to single unsigned digit, up to MP_DIGIT_MAX */ void mp_set(mp_int *a, mp_digit b); mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR; /* get integer, set integer and init with integer (deprecated) */ MP_DEPRECATED(mp_get_mag_u32/mp_get_u32) unsigned long mp_get_int(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_get_mag_ul/mp_get_ul) unsigned long mp_get_long(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_get_mag_u64/mp_get_u64) unsigned long long mp_get_long_long(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_set_ul) mp_err mp_set_int(mp_int *a, unsigned long b); MP_DEPRECATED(mp_set_ul) mp_err mp_set_long(mp_int *a, unsigned long b); MP_DEPRECATED(mp_set_ull) mp_err mp_set_long_long(mp_int *a, unsigned long long b); MP_DEPRECATED(mp_init_ul) mp_err mp_init_set_int(mp_int *a, unsigned long b) MP_WUR; /* copy, b = a */ mp_err mp_copy(const mp_int *a, mp_int *b) MP_WUR; /* inits and copies, a = b */ mp_err mp_init_copy(mp_int *a, const mp_int *b) MP_WUR; /* trim unused digits */ void mp_clamp(mp_int *a); /* export binary data */ MP_DEPRECATED(mp_pack) mp_err mp_export(void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, const mp_int *op) MP_WUR; /* import binary data */ MP_DEPRECATED(mp_unpack) mp_err mp_import(mp_int *rop, size_t count, int order, size_t size, int endian, size_t nails, const void *op) MP_WUR; /* unpack binary data */ mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian, size_t nails, const void *op) MP_WUR; /* pack binary data */ size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) MP_WUR; mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size, mp_endian endian, size_t nails, const mp_int *op) MP_WUR; /* ---> digit manipulation <--- */ /* right shift by "b" digits */ void mp_rshd(mp_int *a, int b); /* left shift by "b" digits */ mp_err mp_lshd(mp_int *a, int b) MP_WUR; /* c = a / 2**b, implemented as c = a >> b */ mp_err mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d) MP_WUR; /* b = a/2 */ mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR; /* a/3 => 3c + d == a */ MP_DEPRECATED(mp_div_d) mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; /* c = a * 2**b, implemented as c = a << b */ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) MP_WUR; /* b = a*2 */ mp_err mp_mul_2(const mp_int *a, mp_int *b) MP_WUR; /* c = a mod 2**b */ mp_err mp_mod_2d(const mp_int *a, int b, mp_int *c) MP_WUR; /* computes a = 2**b */ mp_err mp_2expt(mp_int *a, int b) MP_WUR; /* Counts the number of lsbs which are zero before the first zero bit */ int mp_cnt_lsb(const mp_int *a) MP_WUR; /* I Love Earth! */ /* makes a pseudo-random mp_int of a given size */ mp_err mp_rand(mp_int *a, int digits) MP_WUR; /* makes a pseudo-random small int of a given size */ MP_DEPRECATED(mp_rand) mp_err mp_rand_digit(mp_digit *r) MP_WUR; /* use custom random data source instead of source provided the platform */ void mp_rand_source(mp_err(*source)(void *out, size_t size)); #ifdef MP_PRNG_ENABLE_LTM_RNG # warning MP_PRNG_ENABLE_LTM_RNG has been deprecated, use mp_rand_source instead. /* A last resort to provide random data on systems without any of the other * implemented ways to gather entropy. * It is compatible with `rng_get_bytes()` from libtomcrypt so you could * provide that one and then set `ltm_rng = rng_get_bytes;` */ extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); extern void (*ltm_rng_callback)(void); #endif /* ---> binary operations <--- */ /* Checks the bit at position b and returns MP_YES * if the bit is 1, MP_NO if it is 0 and MP_VAL * in case of error */ MP_DEPRECATED(s_mp_get_bit) int mp_get_bit(const mp_int *a, int b) MP_WUR; /* c = a XOR b (two complement) */ MP_DEPRECATED(mp_xor) mp_err mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = a OR b (two complement) */ MP_DEPRECATED(mp_or) mp_err mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = a AND b (two complement) */ MP_DEPRECATED(mp_and) mp_err mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* b = ~a (bitwise not, two complement) */ mp_err mp_complement(const mp_int *a, mp_int *b) MP_WUR; /* right shift with sign extension */ MP_DEPRECATED(mp_signed_rsh) mp_err mp_tc_div_2d(const mp_int *a, int b, mp_int *c) MP_WUR; mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) MP_WUR; /* ---> Basic arithmetic <--- */ /* b = -a */ mp_err mp_neg(const mp_int *a, mp_int *b) MP_WUR; /* b = |a| */ mp_err mp_abs(const mp_int *a, mp_int *b) MP_WUR; /* compare a to b */ mp_ord mp_cmp(const mp_int *a, const mp_int *b) MP_WUR; /* compare |a| to |b| */ mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b) MP_WUR; /* c = a + b */ mp_err mp_add(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = a - b */ mp_err mp_sub(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = a * b */ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* b = a*a */ mp_err mp_sqr(const mp_int *a, mp_int *b) MP_WUR; /* a/b => cb + d == a */ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) MP_WUR; /* c = a mod b, 0 <= c < b */ mp_err mp_mod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* Increment "a" by one like "a++". Changes input! */ mp_err mp_incr(mp_int *a) MP_WUR; /* Decrement "a" by one like "a--". Changes input! */ mp_err mp_decr(mp_int *a) MP_WUR; /* ---> single digit functions <--- */ /* compare against a single digit */ mp_ord mp_cmp_d(const mp_int *a, mp_digit b) MP_WUR; /* c = a + b */ mp_err mp_add_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* c = a - b */ mp_err mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* c = a * b */ mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; /* a/b => cb + d == a */ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) MP_WUR; /* c = a mod b, 0 <= c < b */ mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) MP_WUR; /* ---> number theory <--- */ /* d = a + b (mod c) */ mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR; /* d = a - b (mod c) */ mp_err mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR; /* d = a * b (mod c) */ mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) MP_WUR; /* c = a * a (mod b) */ mp_err mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = 1/a (mod b) */ mp_err mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* c = (a, b) */ mp_err mp_gcd(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* produces value such that U1*a + U2*b = U3 */ mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) MP_WUR; /* c = [a, b] or (a*b)/(a, b) */ mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* Integer logarithm to integer base */ mp_err mp_log_n(const mp_int *a, int base, int *c) MP_WUR; MP_DEPRECATED(mp_log_n) mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c) MP_WUR; /* c = a**b */ mp_err mp_expt_n(const mp_int *a, int b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_expt_n) mp_err mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_expt_n) mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; /* finds one of the b'th root of a, such that |c|**b <= |a| * * returns error if a < 0 and b is even */ mp_err mp_root_n(const mp_int *a, int b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_root_n) mp_err mp_root_u32(const mp_int *a, uint32_t b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_root_n) mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) MP_WUR; MP_DEPRECATED(mp_root_n) mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) MP_WUR; /* special sqrt algo */ mp_err mp_sqrt(const mp_int *arg, mp_int *ret) MP_WUR; /* special sqrt (mod prime) */ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret) MP_WUR; /* is number a square? */ mp_err mp_is_square(const mp_int *arg, mp_bool *ret) MP_WUR; /* computes the jacobi c = (a | n) (or Legendre if b is prime) */ MP_DEPRECATED(mp_kronecker) mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) MP_WUR; /* computes the Kronecker symbol c = (a | p) (like jacobi() but with {a,p} in Z */ mp_err mp_kronecker(const mp_int *a, const mp_int *p, int *c) MP_WUR; /* used to setup the Barrett reduction for a given modulus b */ mp_err mp_reduce_setup(mp_int *a, const mp_int *b) MP_WUR; /* Barrett Reduction, computes a (mod b) with a precomputed value c * * Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely * compute the reduction as -1 * mp_reduce(mp_abs(x)) [pseudo code]. */ mp_err mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu) MP_WUR; /* setups the montgomery reduction */ mp_err mp_montgomery_setup(const mp_int *n, mp_digit *rho) MP_WUR; /* computes a = B**n mod b without division or multiplication useful for * normalizing numbers in a Montgomery system. */ mp_err mp_montgomery_calc_normalization(mp_int *a, const mp_int *b) MP_WUR; /* computes x/R == x (mod N) via Montgomery Reduction */ mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) MP_WUR; /* returns 1 if a is a valid DR modulus */ mp_bool mp_dr_is_modulus(const mp_int *a) MP_WUR; /* sets the value of "d" required for mp_dr_reduce */ void mp_dr_setup(const mp_int *a, mp_digit *d); /* reduces a modulo n using the Diminished Radix method */ mp_err mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k) MP_WUR; /* returns true if a can be reduced with mp_reduce_2k */ mp_bool mp_reduce_is_2k(const mp_int *a) MP_WUR; /* determines k value for 2k reduction */ mp_err mp_reduce_2k_setup(const mp_int *a, mp_digit *d) MP_WUR; /* reduces a modulo b where b is of the form 2**p - k [0 <= a] */ mp_err mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d) MP_WUR; /* returns true if a can be reduced with mp_reduce_2k_l */ mp_bool mp_reduce_is_2k_l(const mp_int *a) MP_WUR; /* determines k value for 2k reduction */ mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) MP_WUR; /* reduces a modulo b where b is of the form 2**p - k [0 <= a] */ mp_err mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d) MP_WUR; /* Y = G**X (mod P) */ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y) MP_WUR; /* ---> Primes <--- */ /* number of primes */ #ifdef MP_8BIT # define PRIVATE_MP_PRIME_TAB_SIZE 31 #else # define PRIVATE_MP_PRIME_TAB_SIZE 256 #endif #define PRIME_SIZE (MP_DEPRECATED_PRAGMA("PRIME_SIZE has been made internal") PRIVATE_MP_PRIME_TAB_SIZE) /* table of first PRIME_SIZE primes */ MP_DEPRECATED(internal) extern const mp_digit ltm_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE]; /* result=1 if a is divisible by one of the first PRIME_SIZE primes */ MP_DEPRECATED(mp_prime_is_prime) mp_err mp_prime_is_divisible(const mp_int *a, mp_bool *result) MP_WUR; /* performs one Fermat test of "a" using base "b". * Sets result to 0 if composite or 1 if probable prime */ mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR; /* performs one Miller-Rabin test of "a" using base "b". * Sets result to 0 if composite or 1 if probable prime */ mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result) MP_WUR; /* This gives [for a given bit size] the number of trials required * such that Miller-Rabin gives a prob of failure lower than 2^-96 */ int mp_prime_rabin_miller_trials(int size) MP_WUR; /* performs one strong Lucas-Selfridge test of "a". * Sets result to 0 if composite or 1 if probable prime */ mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result) MP_WUR; /* performs one Frobenius test of "a" as described by Paul Underwood. * Sets result to 0 if composite or 1 if probable prime */ mp_err mp_prime_frobenius_underwood(const mp_int *N, mp_bool *result) MP_WUR; /* performs t random rounds of Miller-Rabin on "a" additional to * bases 2 and 3. Also performs an initial sieve of trial * division. Determines if "a" is prime with probability * of error no more than (1/4)**t. * Both a strong Lucas-Selfridge to complete the BPSW test * and a separate Frobenius test are available at compile time. * With t<0 a deterministic test is run for primes up to * 318665857834031151167461. With t<13 (abs(t)-13) additional * tests with sequential small primes are run starting at 43. * Is Fips 186.4 compliant if called with t as computed by * mp_prime_rabin_miller_trials(); * * Sets result to 1 if probably prime, 0 otherwise */ mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result) MP_WUR; /* finds the next prime after the number "a" using "t" trials * of Miller-Rabin. * * bbs_style = 1 means the prime must be congruent to 3 mod 4 */ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style) MP_WUR; /* makes a truly random prime of a given size (bytes), * call with bbs = 1 if you want it to be congruent to 3 mod 4 * * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself * so it can be NULL * * The prime generated will be larger than 2^(8*size). */ #define mp_prime_random(a, t, size, bbs, cb, dat) (MP_DEPRECATED_PRAGMA("mp_prime_random has been deprecated, use mp_prime_rand instead") mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?MP_PRIME_BBS:0, cb, dat)) /* makes a truly random prime of a given size (bits), * * Flags are as follows: * * MP_PRIME_BBS - make prime congruent to 3 mod 4 * MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS) * MP_PRIME_2MSB_ON - make the 2nd highest bit one * * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself * so it can be NULL * */ MP_DEPRECATED(mp_prime_rand) mp_err mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_prime_callback cb, void *dat) MP_WUR; mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) MP_WUR; /* ---> radix conversion <--- */ int mp_count_bits(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_ubin_size) int mp_unsigned_bin_size(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_from_ubin) mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) MP_WUR; MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) MP_WUR; MP_DEPRECATED(mp_to_ubin) mp_err mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR; MP_DEPRECATED(mp_sbin_size) int mp_signed_bin_size(const mp_int *a) MP_WUR; MP_DEPRECATED(mp_from_sbin) mp_err mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) MP_WUR; MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) MP_WUR; MP_DEPRECATED(mp_to_sbin) mp_err mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) MP_WUR; size_t mp_ubin_size(const mp_int *a) MP_WUR; mp_err mp_from_ubin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR; mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR; size_t mp_sbin_size(const mp_int *a) MP_WUR; mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size) MP_WUR; mp_err mp_to_sbin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) MP_WUR; mp_err mp_read_radix(mp_int *a, const char *str, int radix) MP_WUR; MP_DEPRECATED(mp_to_radix) mp_err mp_toradix(const mp_int *a, char *str, int radix) MP_WUR; MP_DEPRECATED(mp_to_radix) mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen) MP_WUR; mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) MP_WUR; mp_err mp_radix_size(const mp_int *a, int radix, int *size) MP_WUR; #ifndef MP_NO_FILE mp_err mp_fread(mp_int *a, int radix, FILE *stream) MP_WUR; mp_err mp_fwrite(const mp_int *a, int radix, FILE *stream) MP_WUR; #endif #define mp_read_raw(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_signed_bin") mp_read_signed_bin((mp), (str), (len))) #define mp_raw_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_signed_bin_size") mp_signed_bin_size(mp)) #define mp_toraw(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_signed_bin") mp_to_signed_bin((mp), (str))) #define mp_read_mag(mp, str, len) (MP_DEPRECATED_PRAGMA("replaced by mp_read_unsigned_bin") mp_read_unsigned_bin((mp), (str), (len)) #define mp_mag_size(mp) (MP_DEPRECATED_PRAGMA("replaced by mp_unsigned_bin_size") mp_unsigned_bin_size(mp)) #define mp_tomag(mp, str) (MP_DEPRECATED_PRAGMA("replaced by mp_to_unsigned_bin") mp_to_unsigned_bin((mp), (str))) #define mp_tobinary(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_binary") mp_toradix((M), (S), 2)) #define mp_tooctal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_octal") mp_toradix((M), (S), 8)) #define mp_todecimal(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_decimal") mp_toradix((M), (S), 10)) #define mp_tohex(M, S) (MP_DEPRECATED_PRAGMA("replaced by mp_to_hex") mp_toradix((M), (S), 16)) #define mp_to_binary(M, S, N) mp_to_radix((M), (S), (N), NULL, 2) #define mp_to_octal(M, S, N) mp_to_radix((M), (S), (N), NULL, 8) #define mp_to_decimal(M, S, N) mp_to_radix((M), (S), (N), NULL, 10) #define mp_to_hex(M, S, N) mp_to_radix((M), (S), (N), NULL, 16) #ifdef __cplusplus } #endif #endif tcl9.0.3/libtommath/tommath.def0000664000175000017500000000534615104661341016052 0ustar sergeisergei; libtommath ; ; Use this command to produce a 32-bit .lib file, for use in any MSVC version ; lib -machine:X86 -name:libtommath.dll -def:tommath.def -out:tommath.lib ; Use this command to produce a 64-bit .lib file, for use in any MSVC version ; lib -machine:X64 -name:libtommath.dll -def:tommath.def -out:tommath.lib ; EXPORTS mp_2expt mp_abs mp_add mp_add_d mp_addmod mp_and mp_clamp mp_clear mp_clear_multi mp_cmp mp_cmp_d mp_cmp_mag mp_cnt_lsb mp_complement mp_copy mp_count_bits mp_decr mp_div mp_div_2 mp_div_2d mp_div_3 mp_div_d mp_dr_is_modulus mp_dr_reduce mp_dr_setup mp_error_to_string mp_exch mp_expt_n mp_expt_u32 mp_exptmod mp_exteuclid mp_fread mp_from_sbin mp_from_ubin mp_fwrite mp_gcd mp_get_double mp_get_i32 mp_get_i64 mp_get_int mp_get_l mp_get_ll mp_get_long mp_get_long_long mp_get_mag_u32 mp_get_mag_u64 mp_get_mag_ul mp_get_mag_ull mp_grow mp_incr mp_init mp_init_copy mp_init_i32 mp_init_i64 mp_init_l mp_init_ll mp_init_multi mp_init_set mp_init_set_int mp_init_size mp_init_u32 mp_init_u64 mp_init_ul mp_init_ull mp_invmod mp_is_square mp_iseven mp_isodd mp_kronecker mp_lcm mp_log_n mp_log_u32 mp_lshd mp_mod mp_mod_2d mp_mod_d mp_montgomery_calc_normalization mp_montgomery_reduce mp_montgomery_setup mp_mul mp_mul_2 mp_mul_2d mp_mul_d mp_mulmod mp_neg mp_or mp_pack mp_pack_count mp_prime_fermat mp_prime_frobenius_underwood mp_prime_is_prime mp_prime_miller_rabin mp_prime_next_prime mp_prime_rabin_miller_trials mp_prime_rand mp_prime_strong_lucas_selfridge mp_radix_size mp_rand mp_read_radix mp_reduce mp_reduce_2k mp_reduce_2k_l mp_reduce_2k_setup mp_reduce_2k_setup_l mp_reduce_is_2k mp_reduce_is_2k_l mp_reduce_setup mp_root_n mp_root_u32 mp_rshd mp_sbin_size mp_set mp_set_double mp_set_i32 mp_set_i64 mp_set_int mp_set_l mp_set_ll mp_set_long mp_set_long_long mp_set_u32 mp_set_u64 mp_set_ul mp_set_ull mp_shrink mp_signed_rsh mp_sqr mp_sqrmod mp_sqrt mp_sqrtmod_prime mp_sub mp_sub_d mp_submod mp_to_radix mp_to_sbin mp_to_ubin mp_ubin_size mp_unpack mp_xor mp_zero s_mp_add s_mp_balance_mul s_mp_karatsuba_mul s_mp_karatsuba_sqr s_mp_mul_digs s_mp_mul_digs_fast s_mp_reverse s_mp_sqr s_mp_sqr_fast s_mp_sub s_mp_toom_mul s_mp_toom_sqr tcl9.0.3/libtommath/sources.cmake0000664000175000017500000000551615104661341016405 0ustar sergeisergei# SPDX-License-Identifier: Unlicense # Autogenerated File! Do not edit. set(SOURCES bn_cutoffs.c bn_deprecated.c bn_mp_2expt.c bn_mp_abs.c bn_mp_add.c bn_mp_add_d.c bn_mp_addmod.c bn_mp_and.c bn_mp_clamp.c bn_mp_clear.c bn_mp_clear_multi.c bn_mp_cmp.c bn_mp_cmp_d.c bn_mp_cmp_mag.c bn_mp_cnt_lsb.c bn_mp_complement.c bn_mp_copy.c bn_mp_count_bits.c bn_mp_decr.c bn_mp_div.c bn_mp_div_2.c bn_mp_div_2d.c bn_mp_div_d.c bn_mp_dr_is_modulus.c bn_mp_dr_reduce.c bn_mp_dr_setup.c bn_mp_error_to_string.c bn_mp_exch.c bn_mp_expt_n.c bn_mp_exptmod.c bn_mp_exteuclid.c bn_mp_fread.c bn_mp_from_sbin.c bn_mp_from_ubin.c bn_mp_fwrite.c bn_mp_gcd.c bn_mp_get_double.c bn_mp_get_i32.c bn_mp_get_i64.c bn_mp_get_l.c bn_mp_get_mag_u32.c bn_mp_get_mag_u64.c bn_mp_get_mag_ul.c bn_mp_grow.c bn_mp_incr.c bn_mp_init.c bn_mp_init_copy.c bn_mp_init_i32.c bn_mp_init_i64.c bn_mp_init_l.c bn_mp_init_multi.c bn_mp_init_set.c bn_mp_init_size.c bn_mp_init_u32.c bn_mp_init_u64.c bn_mp_init_ul.c bn_mp_invmod.c bn_mp_is_square.c bn_mp_iseven.c bn_mp_isodd.c bn_mp_kronecker.c bn_mp_lcm.c bn_mp_log_n.c bn_mp_lshd.c bn_mp_mod.c bn_mp_mod_2d.c bn_mp_mod_d.c bn_mp_montgomery_calc_normalization.c bn_mp_montgomery_reduce.c bn_mp_montgomery_setup.c bn_mp_mul.c bn_mp_mul_2.c bn_mp_mul_2d.c bn_mp_mul_d.c bn_mp_mulmod.c bn_mp_neg.c bn_mp_or.c bn_mp_pack.c bn_mp_pack_count.c bn_mp_prime_fermat.c bn_mp_prime_frobenius_underwood.c bn_mp_prime_is_prime.c bn_mp_prime_miller_rabin.c bn_mp_prime_next_prime.c bn_mp_prime_rabin_miller_trials.c bn_mp_prime_rand.c bn_mp_prime_strong_lucas_selfridge.c bn_mp_radix_size.c bn_mp_radix_smap.c bn_mp_rand.c bn_mp_read_radix.c bn_mp_reduce.c bn_mp_reduce_2k.c bn_mp_reduce_2k_l.c bn_mp_reduce_2k_setup.c bn_mp_reduce_2k_setup_l.c bn_mp_reduce_is_2k.c bn_mp_reduce_is_2k_l.c bn_mp_reduce_setup.c bn_mp_root_n.c bn_mp_rshd.c bn_mp_sbin_size.c bn_mp_set.c bn_mp_set_double.c bn_mp_set_i32.c bn_mp_set_i64.c bn_mp_set_l.c bn_mp_set_u32.c bn_mp_set_u64.c bn_mp_set_ul.c bn_mp_shrink.c bn_mp_signed_rsh.c bn_mp_sqr.c bn_mp_sqrmod.c bn_mp_sqrt.c bn_mp_sqrtmod_prime.c bn_mp_sub.c bn_mp_sub_d.c bn_mp_submod.c bn_mp_to_radix.c bn_mp_to_sbin.c bn_mp_to_ubin.c bn_mp_ubin_size.c bn_mp_unpack.c bn_mp_xor.c bn_mp_zero.c bn_prime_tab.c bn_s_mp_add.c bn_s_mp_balance_mul.c bn_s_mp_div_3.c bn_s_mp_exptmod.c bn_s_mp_exptmod_fast.c bn_s_mp_get_bit.c bn_s_mp_invmod_fast.c bn_s_mp_invmod_slow.c bn_s_mp_karatsuba_mul.c bn_s_mp_karatsuba_sqr.c bn_s_mp_log.c bn_s_mp_log_2expt.c bn_s_mp_log_d.c bn_s_mp_montgomery_reduce_fast.c bn_s_mp_mul_digs.c bn_s_mp_mul_digs_fast.c bn_s_mp_mul_high_digs.c bn_s_mp_mul_high_digs_fast.c bn_s_mp_prime_is_divisible.c bn_s_mp_rand_jenkins.c bn_s_mp_rand_platform.c bn_s_mp_reverse.c bn_s_mp_sqr.c bn_s_mp_sqr_fast.c bn_s_mp_sub.c bn_s_mp_toom_mul.c bn_s_mp_toom_sqr.c ) set(HEADERS tommath.h tommath_class.h tommath_cutoffs.h tommath_private.h tommath_superclass.h ) tcl9.0.3/libtommath/README.md0000664000175000017500000000422115076154263015177 0ustar sergeisergei# libtommath This is the git repository for [LibTomMath](http://www.libtom.net/LibTomMath/), a free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C. ## Build Status ### Travis CI master: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath) develop: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath) ### AppVeyor master: [![Build status](https://ci.appveyor.com/api/projects/status/b80lpolw3i8m6hsh/branch/master?svg=true)](https://ci.appveyor.com/project/libtom/libtommath/branch/master) develop: [![Build status](https://ci.appveyor.com/api/projects/status/b80lpolw3i8m6hsh/branch/develop?svg=true)](https://ci.appveyor.com/project/libtom/libtommath/branch/develop) ### ABI Laboratory API/ABI changes: [check here](https://abi-laboratory.pro/tracker/timeline/libtommath/) ## Summary The `develop` branch contains the in-development version. Stable releases are tagged. Documentation is built from the LaTeX file `bn.tex`. There is also limited documentation in `tommath.h`. There is also a document, `tommath.pdf`, which describes the goals of the project and many of the algorithms used. The project can be build by using `make`. Along with the usual `make`, `make clean` and `make install`, there are several other build targets, see the makefile for details. There are also makefiles for certain specific platforms. ## Testing Tests are located in `demo/` and can be built in two flavors. * `make test` creates a stand-alone test binary that executes several test routines. * `make mtest_opponent` creates a test binary that is intended to be run against `mtest`. `mtest` can be built with `make mtest` and test execution is done like `./mtest/mtest | ./mtest_opponent`. `mtest` is creating test vectors using an alternative MPI library and `test` is consuming these vectors to verify correct behavior of ltm ## Building and Installing Building is straightforward for GNU Linux only, the section "Building LibTomMath" in the documentation in `doc/bn.pdf` has the details. tcl9.0.3/libtommath/makefile_include.mk0000664000175000017500000001003015104661341017514 0ustar sergeisergei# # Include makefile for libtommath # #version of library VERSION=1.3.0 VERSION_PC=1.3.0 VERSION_SO=4:0:3 PLATFORM := $(shell uname | sed -e 's/_.*//') # default make target default: ${LIBNAME} # Compiler and Linker Names ifndef CROSS_COMPILE CROSS_COMPILE= endif # We only need to go through this dance of determining the right compiler if we're using # cross compilation, otherwise $(CC) is fine as-is. ifneq (,$(CROSS_COMPILE)) ifeq ($(origin CC),default) CSTR := "\#ifdef __clang__\nCLANG\n\#endif\n" ifeq ($(PLATFORM),FreeBSD) # XXX: FreeBSD needs extra escaping for some reason CSTR := $$$(CSTR) endif ifneq (,$(shell echo $(CSTR) | $(CC) -E - | grep CLANG)) CC := $(CROSS_COMPILE)clang else CC := $(CROSS_COMPILE)gcc endif # Clang endif # cc is Make's default endif # CROSS_COMPILE non-empty LD=$(CROSS_COMPILE)ld AR=$(CROSS_COMPILE)ar RANLIB=$(CROSS_COMPILE)ranlib ifndef MAKE # BSDs refer to GNU Make as gmake ifneq (,$(findstring $(PLATFORM),FreeBSD OpenBSD DragonFly NetBSD)) MAKE=gmake else MAKE=make endif endif LTM_CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow ifdef SANITIZER LTM_CFLAGS += -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=float-divide-by-zero endif ifndef NO_ADDTL_WARNINGS # additional warnings LTM_CFLAGS += -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align LTM_CFLAGS += -Wstrict-prototypes -Wpointer-arith endif ifdef CONV_WARNINGS LTM_CFLAGS += -std=c89 -Wconversion -Wsign-conversion ifeq ($(CONV_WARNINGS), strict) LTM_CFLAGS += -DMP_USE_ENUMS -Wc++-compat endif else LTM_CFLAGS += -Wsystem-headers endif ifdef COMPILE_DEBUG #debug LTM_CFLAGS += -g3 endif ifdef COMPILE_SIZE #for size LTM_CFLAGS += -Os else ifndef IGNORE_SPEED #for speed LTM_CFLAGS += -O3 -funroll-loops #x86 optimizations [should be valid for any GCC install though] LTM_CFLAGS += -fomit-frame-pointer endif endif # COMPILE_SIZE ifneq ($(findstring clang,$(CC)),) LTM_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header endif ifneq ($(findstring mingw,$(CC)),) LTM_CFLAGS += -Wno-shadow endif ifeq ($(PLATFORM), Darwin) LTM_CFLAGS += -Wno-nullability-completeness endif ifeq ($(PLATFORM), CYGWIN) LIBTOOLFLAGS += -no-undefined endif # add in the standard FLAGS LTM_CFLAGS += $(CFLAGS) LTM_LFLAGS += $(LFLAGS) LTM_LDFLAGS += $(LDFLAGS) LTM_LIBTOOLFLAGS += $(LIBTOOLFLAGS) ifeq ($(PLATFORM),FreeBSD) _ARCH := $(shell sysctl -b hw.machine_arch) else _ARCH := $(shell uname -m) endif # adjust coverage set ifneq ($(filter $(_ARCH), i386 i686 x86_64 amd64 ia64),) COVERAGE = test_standalone timing COVERAGE_APP = ./test && ./timing else COVERAGE = test_standalone COVERAGE_APP = ./test endif HEADERS_PUB=tommath.h HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h $(HEADERS_PUB) #LIBPATH The directory for libtommath to be installed to. #INCPATH The directory to install the header files for libtommath. #DATAPATH The directory to install the pdf docs. DESTDIR ?= PREFIX ?= /usr/local LIBPATH ?= $(PREFIX)/lib INCPATH ?= $(PREFIX)/include DATAPATH ?= $(PREFIX)/share/doc/libtommath/pdf #make the code coverage of the library # coverage: LTM_CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS coverage: LTM_LFLAGS += -lgcov coverage: LTM_LDFLAGS += -lgcov coverage: $(COVERAGE) $(COVERAGE_APP) lcov: coverage rm -f coverage.info lcov --capture --no-external --no-recursion $(LCOV_ARGS) --output-file coverage.info -q genhtml coverage.info --output-directory coverage -q # target that removes all coverage output cleancov-clean: rm -f `find . -type f -name "*.info" | xargs` rm -rf coverage/ # cleans everything - coverage output and standard 'clean' cleancov: cleancov-clean clean clean: rm -f *.gcda *.gcno *.gcov *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o \ demo/*.o test timing mtest_opponent mtest/mtest mtest/mtest.exe tuning_list \ *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la rm -rf .libs/ demo/.libs ${MAKE} -C etc/ clean MAKE=${MAKE} ${MAKE} -C doc/ clean MAKE=${MAKE} tcl9.0.3/libtommath/makefile.unix0000664000175000017500000001154715104661341016403 0ustar sergeisergei# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...) # works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems # # Please do not use here neither any special make syntax nor any unusual tools/utilities! # using ICC compiler: # make -f makefile.unix CC=icc CFLAGS="-O3 -xP -ip" # using Borland C++Builder: # make -f makefile.unix CC=bcc32 #The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs" DESTDIR = PREFIX = /usr/local LIBPATH = $(PREFIX)/lib INCPATH = $(PREFIX)/include CC = cc AR = ar ARFLAGS = r RANLIB = ranlib CFLAGS = -O2 LDFLAGS = VERSION = 1.3.0 #Compilation flags LTM_CFLAGS = -I. $(CFLAGS) LTM_LDFLAGS = $(LDFLAGS) #Library to be created (this makefile builds only static library) LIBMAIN_S = libtommath.a OBJECTS=bn_cutoffs.o bn_deprecated.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o bn_mp_addmod.o \ bn_mp_and.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_decr.o bn_mp_div.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o bn_mp_dr_setup.o \ bn_mp_error_to_string.o bn_mp_exch.o bn_mp_expt_n.o bn_mp_exptmod.o bn_mp_exteuclid.o bn_mp_fread.o \ bn_mp_from_sbin.o bn_mp_from_ubin.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_double.o bn_mp_get_i32.o \ bn_mp_get_i64.o bn_mp_get_l.o bn_mp_get_mag_u32.o bn_mp_get_mag_u64.o bn_mp_get_mag_ul.o bn_mp_grow.o \ bn_mp_incr.o bn_mp_init.o bn_mp_init_copy.o bn_mp_init_i32.o bn_mp_init_i64.o bn_mp_init_l.o \ bn_mp_init_multi.o bn_mp_init_set.o bn_mp_init_size.o bn_mp_init_u32.o bn_mp_init_u64.o bn_mp_init_ul.o \ bn_mp_invmod.o bn_mp_is_square.o bn_mp_iseven.o bn_mp_isodd.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_log_n.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \ bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o \ bn_mp_mulmod.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o bn_mp_pack_count.o bn_mp_prime_fermat.o \ bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o \ bn_mp_prime_next_prime.o bn_mp_prime_rabin_miller_trials.o bn_mp_prime_rand.o \ bn_mp_prime_strong_lucas_selfridge.o bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o \ bn_mp_read_radix.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \ bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o \ bn_mp_root_n.o bn_mp_rshd.o bn_mp_sbin_size.o bn_mp_set.o bn_mp_set_double.o bn_mp_set_i32.o \ bn_mp_set_i64.o bn_mp_set_l.o bn_mp_set_u32.o bn_mp_set_u64.o bn_mp_set_ul.o bn_mp_shrink.o \ bn_mp_signed_rsh.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_submod.o bn_mp_to_radix.o bn_mp_to_sbin.o bn_mp_to_ubin.o bn_mp_ubin_size.o bn_mp_unpack.o \ bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_s_mp_add.o bn_s_mp_balance_mul.o bn_s_mp_div_3.o \ bn_s_mp_exptmod.o bn_s_mp_exptmod_fast.o bn_s_mp_get_bit.o bn_s_mp_invmod_fast.o bn_s_mp_invmod_slow.o \ bn_s_mp_karatsuba_mul.o bn_s_mp_karatsuba_sqr.o bn_s_mp_log.o bn_s_mp_log_2expt.o bn_s_mp_log_d.o \ bn_s_mp_montgomery_reduce_fast.o bn_s_mp_mul_digs.o bn_s_mp_mul_digs_fast.o bn_s_mp_mul_high_digs.o \ bn_s_mp_mul_high_digs_fast.o bn_s_mp_prime_is_divisible.o bn_s_mp_rand_jenkins.o \ bn_s_mp_rand_platform.o bn_s_mp_reverse.o bn_s_mp_sqr.o bn_s_mp_sqr_fast.o bn_s_mp_sub.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o HEADERS_PUB=tommath.h HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h $(HEADERS_PUB) #The default rule for make builds the libtommath.a library (static) default: $(LIBMAIN_S) #Dependencies on *.h $(OBJECTS): $(HEADERS) #This is necessary for compatibility with BSD make (namely on OpenBSD) .SUFFIXES: .o .c .c.o: $(CC) $(LTM_CFLAGS) -c $< -o $@ #Create libtommath.a $(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ #Build test_standalone suite test: demo/shared.o demo/test.o $(LIBMAIN_S) $(CC) $(LTM_CFLAGS) $(LTM_LDFLAGS) $^ -o $@ @echo "NOTICE: start the tests by: ./test" test_standalone: test @echo "test_standalone is deprecated, please use make-target 'test'" all: $(LIBMAIN_S) test tune: $(LIBMAIN_S) $(MAKE) -C etc tune $(MAKE) #NOTE: this makefile works also on cygwin, thus we need to delete *.exe clean: -@rm -f $(OBJECTS) $(LIBMAIN_S) -@rm -f demo/main.o demo/opponent.o demo/test.o test test.exe #Install the library + headers install: $(LIBMAIN_S) @mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig @cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/ @cp $(HEADERS_PUB) $(DESTDIR)$(INCPATH)/ @sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtommath.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc tcl9.0.3/libtommath/makefile.shared0000664000175000017500000001124315104661341016657 0ustar sergeisergei#Makefile for GCC # #Tom St Denis #default files to install ifndef LIBNAME LIBNAME=libtommath.la endif include makefile_include.mk ifndef LIBTOOL ifeq ($(PLATFORM), Darwin) LIBTOOL:=glibtool else LIBTOOL:=libtool endif endif LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) LTLINK = $(LIBTOOL) --mode=link --tag=CC $(CC) LCOV_ARGS=--directory .libs --directory . #START_INS OBJECTS=bn_cutoffs.o bn_deprecated.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o bn_mp_addmod.o \ bn_mp_and.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_decr.o bn_mp_div.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o bn_mp_dr_setup.o \ bn_mp_error_to_string.o bn_mp_exch.o bn_mp_expt_n.o bn_mp_exptmod.o bn_mp_exteuclid.o bn_mp_fread.o \ bn_mp_from_sbin.o bn_mp_from_ubin.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_double.o bn_mp_get_i32.o \ bn_mp_get_i64.o bn_mp_get_l.o bn_mp_get_mag_u32.o bn_mp_get_mag_u64.o bn_mp_get_mag_ul.o bn_mp_grow.o \ bn_mp_incr.o bn_mp_init.o bn_mp_init_copy.o bn_mp_init_i32.o bn_mp_init_i64.o bn_mp_init_l.o \ bn_mp_init_multi.o bn_mp_init_set.o bn_mp_init_size.o bn_mp_init_u32.o bn_mp_init_u64.o bn_mp_init_ul.o \ bn_mp_invmod.o bn_mp_is_square.o bn_mp_iseven.o bn_mp_isodd.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_log_n.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \ bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o \ bn_mp_mulmod.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o bn_mp_pack_count.o bn_mp_prime_fermat.o \ bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o \ bn_mp_prime_next_prime.o bn_mp_prime_rabin_miller_trials.o bn_mp_prime_rand.o \ bn_mp_prime_strong_lucas_selfridge.o bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o \ bn_mp_read_radix.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \ bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o \ bn_mp_root_n.o bn_mp_rshd.o bn_mp_sbin_size.o bn_mp_set.o bn_mp_set_double.o bn_mp_set_i32.o \ bn_mp_set_i64.o bn_mp_set_l.o bn_mp_set_u32.o bn_mp_set_u64.o bn_mp_set_ul.o bn_mp_shrink.o \ bn_mp_signed_rsh.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_submod.o bn_mp_to_radix.o bn_mp_to_sbin.o bn_mp_to_ubin.o bn_mp_ubin_size.o bn_mp_unpack.o \ bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_s_mp_add.o bn_s_mp_balance_mul.o bn_s_mp_div_3.o \ bn_s_mp_exptmod.o bn_s_mp_exptmod_fast.o bn_s_mp_get_bit.o bn_s_mp_invmod_fast.o bn_s_mp_invmod_slow.o \ bn_s_mp_karatsuba_mul.o bn_s_mp_karatsuba_sqr.o bn_s_mp_log.o bn_s_mp_log_2expt.o bn_s_mp_log_d.o \ bn_s_mp_montgomery_reduce_fast.o bn_s_mp_mul_digs.o bn_s_mp_mul_digs_fast.o bn_s_mp_mul_high_digs.o \ bn_s_mp_mul_high_digs_fast.o bn_s_mp_prime_is_divisible.o bn_s_mp_rand_jenkins.o \ bn_s_mp_rand_platform.o bn_s_mp_reverse.o bn_s_mp_sqr.o bn_s_mp_sqr_fast.o bn_s_mp_sub.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o #END_INS objs: $(OBJECTS) .c.o: $(HEADERS) $(LTCOMPILE) $(LTM_CFLAGS) $(LTM_LDFLAGS) -o $@ -c $< LOBJECTS = $(OBJECTS:.o=.lo) $(LIBNAME): $(OBJECTS) $(LTLINK) $(LTM_LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LTM_LIBTOOLFLAGS) install: $(LIBNAME) install -d $(DESTDIR)$(LIBPATH) install -d $(DESTDIR)$(INCPATH) $(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME) install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH) sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,@CMAKE_INSTALL_LIBDIR@,lib,' \ -e 's,@CMAKE_INSTALL_INCLUDEDIR@,include,' libtommath.pc.in > libtommath.pc install -d $(DESTDIR)$(LIBPATH)/pkgconfig install -m 644 libtommath.pc $(DESTDIR)$(LIBPATH)/pkgconfig/ uninstall: $(LIBTOOL) --mode=uninstall rm $(DESTDIR)$(LIBPATH)/$(LIBNAME) rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%) rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc test_standalone: test @echo "test_standalone is deprecated, please use make-target 'test'" test mtest_opponent: demo/shared.o $(LIBNAME) | demo/test.o demo/mtest_opponent.o $(LTLINK) $(LTM_LDFLAGS) demo/$@.o $^ -o $@ .PHONY: mtest mtest: cd mtest ; $(CC) $(LTM_CFLAGS) -O0 mtest.c $(LTM_LDFLAGS) -o mtest timing: $(LIBNAME) demo/timing.c $(LTLINK) $(LTM_CFLAGS) $(LTM_LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing tune: $(LIBNAME) $(LTCOMPILE) $(LTM_CFLAGS) -c etc/tune.c -o etc/tune.o $(LTLINK) $(LTM_LDFLAGS) -o etc/tune etc/tune.o $(LIBNAME) cd etc/; /bin/sh tune_it.sh; cd .. $(MAKE) -f makefile.shared tcl9.0.3/libtommath/makefile.msvc0000664000175000017500000001165115104661341016364 0ustar sergeisergei# MAKEFILE for MS Windows (nmake + Windows SDK) # # BEWARE: variable OBJECTS is updated via helper.pl ### USAGE: # Open a command prompt with WinSDK variables set and start: # # nmake -f makefile.msvc all # test.exe # nmake -f makefile.msvc PREFIX=c:\devel\libtom install #The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs PREFIX = c:\devel CFLAGS = /Ox #Compilation flags LTM_CFLAGS = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D__STDC_WANT_SECURE_LIB__=1 /D_CRT_HAS_CXX17=0 /Wall /wd4146 /wd4127 /wd4668 /wd4710 /wd4711 /wd4820 /wd5045 /WX $(CFLAGS) LTM_LDFLAGS = advapi32.lib #Libraries to be created (this makefile builds only static libraries) LIBMAIN_S =tommath.lib #List of objects to compile (all goes to tommath.lib) OBJECTS=bn_cutoffs.obj bn_deprecated.obj bn_mp_2expt.obj bn_mp_abs.obj bn_mp_add.obj bn_mp_add_d.obj bn_mp_addmod.obj \ bn_mp_and.obj bn_mp_clamp.obj bn_mp_clear.obj bn_mp_clear_multi.obj bn_mp_cmp.obj bn_mp_cmp_d.obj bn_mp_cmp_mag.obj \ bn_mp_cnt_lsb.obj bn_mp_complement.obj bn_mp_copy.obj bn_mp_count_bits.obj bn_mp_decr.obj bn_mp_div.obj bn_mp_div_2.obj \ bn_mp_div_2d.obj bn_mp_div_d.obj bn_mp_dr_is_modulus.obj bn_mp_dr_reduce.obj bn_mp_dr_setup.obj \ bn_mp_error_to_string.obj bn_mp_exch.obj bn_mp_expt_n.obj bn_mp_exptmod.obj bn_mp_exteuclid.obj bn_mp_fread.obj \ bn_mp_from_sbin.obj bn_mp_from_ubin.obj bn_mp_fwrite.obj bn_mp_gcd.obj bn_mp_get_double.obj bn_mp_get_i32.obj \ bn_mp_get_i64.obj bn_mp_get_l.obj bn_mp_get_mag_u32.obj bn_mp_get_mag_u64.obj bn_mp_get_mag_ul.obj bn_mp_grow.obj \ bn_mp_incr.obj bn_mp_init.obj bn_mp_init_copy.obj bn_mp_init_i32.obj bn_mp_init_i64.obj bn_mp_init_l.obj \ bn_mp_init_multi.obj bn_mp_init_set.obj bn_mp_init_size.obj bn_mp_init_u32.obj bn_mp_init_u64.obj bn_mp_init_ul.obj \ bn_mp_invmod.obj bn_mp_is_square.obj bn_mp_iseven.obj bn_mp_isodd.obj bn_mp_kronecker.obj bn_mp_lcm.obj bn_mp_log_n.obj \ bn_mp_lshd.obj bn_mp_mod.obj bn_mp_mod_2d.obj bn_mp_mod_d.obj bn_mp_montgomery_calc_normalization.obj \ bn_mp_montgomery_reduce.obj bn_mp_montgomery_setup.obj bn_mp_mul.obj bn_mp_mul_2.obj bn_mp_mul_2d.obj bn_mp_mul_d.obj \ bn_mp_mulmod.obj bn_mp_neg.obj bn_mp_or.obj bn_mp_pack.obj bn_mp_pack_count.obj bn_mp_prime_fermat.obj \ bn_mp_prime_frobenius_underwood.obj bn_mp_prime_is_prime.obj bn_mp_prime_miller_rabin.obj \ bn_mp_prime_next_prime.obj bn_mp_prime_rabin_miller_trials.obj bn_mp_prime_rand.obj \ bn_mp_prime_strong_lucas_selfridge.obj bn_mp_radix_size.obj bn_mp_radix_smap.obj bn_mp_rand.obj \ bn_mp_read_radix.obj bn_mp_reduce.obj bn_mp_reduce_2k.obj bn_mp_reduce_2k_l.obj bn_mp_reduce_2k_setup.obj \ bn_mp_reduce_2k_setup_l.obj bn_mp_reduce_is_2k.obj bn_mp_reduce_is_2k_l.obj bn_mp_reduce_setup.obj \ bn_mp_root_n.obj bn_mp_rshd.obj bn_mp_sbin_size.obj bn_mp_set.obj bn_mp_set_double.obj bn_mp_set_i32.obj \ bn_mp_set_i64.obj bn_mp_set_l.obj bn_mp_set_u32.obj bn_mp_set_u64.obj bn_mp_set_ul.obj bn_mp_shrink.obj \ bn_mp_signed_rsh.obj bn_mp_sqr.obj bn_mp_sqrmod.obj bn_mp_sqrt.obj bn_mp_sqrtmod_prime.obj bn_mp_sub.obj bn_mp_sub_d.obj \ bn_mp_submod.obj bn_mp_to_radix.obj bn_mp_to_sbin.obj bn_mp_to_ubin.obj bn_mp_ubin_size.obj bn_mp_unpack.obj \ bn_mp_xor.obj bn_mp_zero.obj bn_prime_tab.obj bn_s_mp_add.obj bn_s_mp_balance_mul.obj bn_s_mp_div_3.obj \ bn_s_mp_exptmod.obj bn_s_mp_exptmod_fast.obj bn_s_mp_get_bit.obj bn_s_mp_invmod_fast.obj bn_s_mp_invmod_slow.obj \ bn_s_mp_karatsuba_mul.obj bn_s_mp_karatsuba_sqr.obj bn_s_mp_log.obj bn_s_mp_log_2expt.obj bn_s_mp_log_d.obj \ bn_s_mp_montgomery_reduce_fast.obj bn_s_mp_mul_digs.obj bn_s_mp_mul_digs_fast.obj bn_s_mp_mul_high_digs.obj \ bn_s_mp_mul_high_digs_fast.obj bn_s_mp_prime_is_divisible.obj bn_s_mp_rand_jenkins.obj \ bn_s_mp_rand_platform.obj bn_s_mp_reverse.obj bn_s_mp_sqr.obj bn_s_mp_sqr_fast.obj bn_s_mp_sub.obj \ bn_s_mp_toom_mul.obj bn_s_mp_toom_sqr.obj HEADERS_PUB=tommath.h HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h $(HEADERS_PUB) #The default rule for make builds the tommath.lib library (static) default: $(LIBMAIN_S) #Dependencies on *.h $(OBJECTS): $(HEADERS) .c.obj: $(CC) $(LTM_CFLAGS) /c $< /Fo$@ #Create tommath.lib $(LIBMAIN_S): $(OBJECTS) lib /out:$(LIBMAIN_S) $(OBJECTS) #Build test suite test.exe: $(LIBMAIN_S) demo/shared.obj demo/test.obj cl $(LTM_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTM_LDFLAGS) demo/shared.c demo/test.c /Fe$@ @echo NOTICE: start the tests by launching test.exe test_standalone: test.exe @echo test_standalone is deprecated, please use make-target 'test.exe' all: $(LIBMAIN_S) test.exe tune: $(LIBMAIN_S) $(MAKE) -C etc tune $(MAKE) clean: @-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul #Install the library + headers install: $(LIBMAIN_S) cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" copy /Y tommath*.h "$(PREFIX)\include" tcl9.0.3/libtommath/makefile.mingw0000664000175000017500000001207315104661341016534 0ustar sergeisergei# MAKEFILE for MS Windows (mingw + gcc + gmake) # # BEWARE: variable OBJECTS is updated via helper.pl ### USAGE: # Open a command prompt with gcc + gmake in PATH and start: # # gmake -f makefile.mingw all # test.exe # gmake -f makefile.mingw PREFIX=c:\devel\libtom install #The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs PREFIX = c:\mingw CC = i686-w64-mingw32-gcc #CC = x86_64-w64-mingw32-clang #CC = aarch64-w64-mingw32-clang AR = ar ARFLAGS = r RANLIB = ranlib STRIP = i686-w64-mingw32-gcc-strip #STRIP = x86_64-w64-mingw32-strip #STRIP = aarch64-w64-mingw32-strip CFLAGS = -O2 LDFLAGS = #Compilation flags LTM_CFLAGS = -I. $(CFLAGS) -DTCL_WITH_EXTERNAL_TOMMATH LTM_LDFLAGS = $(LDFLAGS) -static-libgcc #Libraries to be created LIBMAIN_S =libtommath.a LIBMAIN_I =libtommath.dll.a LIBMAIN_D =libtommath.dll #List of objects to compile (all goes to libtommath.a) OBJECTS=bn_cutoffs.o bn_deprecated.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o bn_mp_addmod.o \ bn_mp_and.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_decr.o bn_mp_div.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o bn_mp_dr_setup.o \ bn_mp_error_to_string.o bn_mp_exch.o bn_mp_expt_n.o bn_mp_exptmod.o bn_mp_exteuclid.o bn_mp_fread.o \ bn_mp_from_sbin.o bn_mp_from_ubin.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_double.o bn_mp_get_i32.o \ bn_mp_get_i64.o bn_mp_get_l.o bn_mp_get_mag_u32.o bn_mp_get_mag_u64.o bn_mp_get_mag_ul.o bn_mp_grow.o \ bn_mp_incr.o bn_mp_init.o bn_mp_init_copy.o bn_mp_init_i32.o bn_mp_init_i64.o bn_mp_init_l.o \ bn_mp_init_multi.o bn_mp_init_set.o bn_mp_init_size.o bn_mp_init_u32.o bn_mp_init_u64.o bn_mp_init_ul.o \ bn_mp_invmod.o bn_mp_is_square.o bn_mp_iseven.o bn_mp_isodd.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_log_n.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \ bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o \ bn_mp_mulmod.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o bn_mp_pack_count.o bn_mp_prime_fermat.o \ bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o \ bn_mp_prime_next_prime.o bn_mp_prime_rabin_miller_trials.o bn_mp_prime_rand.o \ bn_mp_prime_strong_lucas_selfridge.o bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o \ bn_mp_read_radix.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \ bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o \ bn_mp_root_n.o bn_mp_rshd.o bn_mp_sbin_size.o bn_mp_set.o bn_mp_set_double.o bn_mp_set_i32.o \ bn_mp_set_i64.o bn_mp_set_l.o bn_mp_set_u32.o bn_mp_set_u64.o bn_mp_set_ul.o bn_mp_shrink.o \ bn_mp_signed_rsh.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_submod.o bn_mp_to_radix.o bn_mp_to_sbin.o bn_mp_to_ubin.o bn_mp_ubin_size.o bn_mp_unpack.o \ bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_s_mp_add.o bn_s_mp_balance_mul.o bn_s_mp_div_3.o \ bn_s_mp_exptmod.o bn_s_mp_exptmod_fast.o bn_s_mp_get_bit.o bn_s_mp_invmod_fast.o bn_s_mp_invmod_slow.o \ bn_s_mp_karatsuba_mul.o bn_s_mp_karatsuba_sqr.o bn_s_mp_log.o bn_s_mp_log_2expt.o bn_s_mp_log_d.o \ bn_s_mp_montgomery_reduce_fast.o bn_s_mp_mul_digs.o bn_s_mp_mul_digs_fast.o bn_s_mp_mul_high_digs.o \ bn_s_mp_mul_high_digs_fast.o bn_s_mp_prime_is_divisible.o bn_s_mp_rand_jenkins.o \ bn_s_mp_rand_platform.o bn_s_mp_reverse.o bn_s_mp_sqr.o bn_s_mp_sqr_fast.o bn_s_mp_sub.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o HEADERS_PUB=tommath.h HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h $(HEADERS_PUB) #The default rule for make builds the libtommath.a library (static) default: $(LIBMAIN_S) #Dependencies on *.h $(OBJECTS): $(HEADERS) .c.o: $(CC) $(LTM_CFLAGS) -c $< -o $@ #Create libtommath.a $(LIBMAIN_S): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ #Create DLL + import library libtommath.dll.a $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS) $(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import tommath.def -Wl,--out-implib=$(LIBMAIN_I) $(LTM_LDFLAGS) $(STRIP) -S $(LIBMAIN_D) #Build test suite test.exe: demo/shared.o demo/test.o $(LIBMAIN_S) $(CC) $(LTM_CFLAGS) $(LTM_LDFLAGS) $^ -o $@ @echo NOTICE: start the tests by launching test.exe test_standalone: test.exe @echo test_standalone is deprecated, please use make-target 'test.exe' all: $(LIBMAIN_S) test.exe tune: $(LIBNAME_S) $(MAKE) -C etc tune $(MAKE) clean: @-cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul #Install the library + headers install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin" cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib" cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include" copy /Y $(LIBMAIN_S) "$(PREFIX)\lib" copy /Y $(LIBMAIN_I) "$(PREFIX)\lib" copy /Y $(LIBMAIN_D) "$(PREFIX)\bin" copy /Y tommath*.h "$(PREFIX)\include" tcl9.0.3/libtommath/makefile0000664000175000017500000001462615104661341015422 0ustar sergeisergei#Makefile for GCC # #Tom St Denis ifeq ($V,1) silent= else silent=@ endif #default files to install ifndef LIBNAME LIBNAME=libtommath.a endif coverage: LIBNAME:=-Wl,--whole-archive $(LIBNAME) -Wl,--no-whole-archive include makefile_include.mk %.o: %.c $(HEADERS) ifneq ($V,1) @echo " * ${CC} $@" endif ${silent} ${CC} -c ${LTM_CFLAGS} $< -o $@ LCOV_ARGS=--directory . #START_INS OBJECTS=bn_cutoffs.o bn_deprecated.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o bn_mp_addmod.o \ bn_mp_and.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_decr.o bn_mp_div.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o bn_mp_dr_setup.o \ bn_mp_error_to_string.o bn_mp_exch.o bn_mp_expt_n.o bn_mp_exptmod.o bn_mp_exteuclid.o bn_mp_fread.o \ bn_mp_from_sbin.o bn_mp_from_ubin.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_double.o bn_mp_get_i32.o \ bn_mp_get_i64.o bn_mp_get_l.o bn_mp_get_mag_u32.o bn_mp_get_mag_u64.o bn_mp_get_mag_ul.o bn_mp_grow.o \ bn_mp_incr.o bn_mp_init.o bn_mp_init_copy.o bn_mp_init_i32.o bn_mp_init_i64.o bn_mp_init_l.o \ bn_mp_init_multi.o bn_mp_init_set.o bn_mp_init_size.o bn_mp_init_u32.o bn_mp_init_u64.o bn_mp_init_ul.o \ bn_mp_invmod.o bn_mp_is_square.o bn_mp_iseven.o bn_mp_isodd.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_log_n.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \ bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o \ bn_mp_mulmod.o bn_mp_neg.o bn_mp_or.o bn_mp_pack.o bn_mp_pack_count.o bn_mp_prime_fermat.o \ bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o \ bn_mp_prime_next_prime.o bn_mp_prime_rabin_miller_trials.o bn_mp_prime_rand.o \ bn_mp_prime_strong_lucas_selfridge.o bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o \ bn_mp_read_radix.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \ bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o \ bn_mp_root_n.o bn_mp_rshd.o bn_mp_sbin_size.o bn_mp_set.o bn_mp_set_double.o bn_mp_set_i32.o \ bn_mp_set_i64.o bn_mp_set_l.o bn_mp_set_u32.o bn_mp_set_u64.o bn_mp_set_ul.o bn_mp_shrink.o \ bn_mp_signed_rsh.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_submod.o bn_mp_to_radix.o bn_mp_to_sbin.o bn_mp_to_ubin.o bn_mp_ubin_size.o bn_mp_unpack.o \ bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_s_mp_add.o bn_s_mp_balance_mul.o bn_s_mp_div_3.o \ bn_s_mp_exptmod.o bn_s_mp_exptmod_fast.o bn_s_mp_get_bit.o bn_s_mp_invmod_fast.o bn_s_mp_invmod_slow.o \ bn_s_mp_karatsuba_mul.o bn_s_mp_karatsuba_sqr.o bn_s_mp_log.o bn_s_mp_log_2expt.o bn_s_mp_log_d.o \ bn_s_mp_montgomery_reduce_fast.o bn_s_mp_mul_digs.o bn_s_mp_mul_digs_fast.o bn_s_mp_mul_high_digs.o \ bn_s_mp_mul_high_digs_fast.o bn_s_mp_prime_is_divisible.o bn_s_mp_rand_jenkins.o \ bn_s_mp_rand_platform.o bn_s_mp_reverse.o bn_s_mp_sqr.o bn_s_mp_sqr_fast.o bn_s_mp_sub.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o #END_INS $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(RANLIB) $@ #make a profiled library (takes a while!!!) # # This will build the library with profile generation # then run the test demo and rebuild the library. # # So far I've seen improvements in the MP math profiled: make CFLAGS="$(CFLAGS) -fprofile-arcs -DTESTING" timing ./timing rm -f *.a *.o timing make CFLAGS="$(CFLAGS) -fbranch-probabilities" #make a single object profiled library profiled_single: perl gen.pl $(CC) $(LTM_CFLAGS) -fprofile-arcs -DTESTING -c mpi.c -o mpi.o $(CC) $(LTM_CFLAGS) -DTESTING -DTIMER demo/timing.c mpi.o -lgcov -o timing ./timing rm -f *.o timing $(CC) $(LTM_CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o $(AR) $(ARFLAGS) $(LIBNAME) mpi.o ranlib $(LIBNAME) install: $(LIBNAME) install -d $(DESTDIR)$(LIBPATH) install -d $(DESTDIR)$(INCPATH) install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH) install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH) uninstall: rm $(DESTDIR)$(LIBPATH)/$(LIBNAME) rm $(HEADERS_PUB:%=$(DESTDIR)$(INCPATH)/%) test_standalone: test @echo "test_standalone is deprecated, please use make-target 'test'" DEMOS=test mtest_opponent define DEMO_template $(1): demo/$(1).o demo/shared.o $$(LIBNAME) $$(CC) $$(LTM_CFLAGS) $$(LTM_LFLAGS) $$^ -o $$@ endef $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo)))) .PHONY: mtest mtest: cd mtest ; $(CC) $(LTM_CFLAGS) -O0 mtest.c $(LTM_LFLAGS) -o mtest timing: $(LIBNAME) demo/timing.c $(CC) $(LTM_CFLAGS) -DTIMER demo/timing.c $(LIBNAME) $(LTM_LFLAGS) -o timing tune: $(LIBNAME) $(MAKE) -C etc tune CFLAGS="$(LTM_CFLAGS)" $(MAKE) # You have to create a file .coveralls.yml with the content "repo_token: " # in the base folder to be able to submit to coveralls coveralls: lcov coveralls-lcov docs manual: $(MAKE) -C doc/ $@ V=$(V) .PHONY: pre_gen pre_gen: mkdir -p pre_gen perl gen.pl sed -e 's/[[:blank:]]*$$//' mpi.c > pre_gen/mpi.c rm mpi.c zipup: $(MAKE) clean $(MAKE) .zipup .zipup: astyle new_file docs @# Update the index, so diff-index won't fail in case the pdf has been created. @# As the pdf creation modifies the tex files, git sometimes detects the @# modified files, but misses that it's put back to its original version. @git update-index --refresh @git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 ) rm -rf libtommath-$(VERSION) ltm-$(VERSION).* @# files/dirs excluded from "git archive" are defined in .gitattributes git archive --format=tar --prefix=libtommath-$(VERSION)/ HEAD | tar x @echo 'fixme check' -@(find libtommath-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true mkdir -p libtommath-$(VERSION)/doc cp doc/bn.pdf libtommath-$(VERSION)/doc/ $(MAKE) -C libtommath-$(VERSION)/ pre_gen tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION) cp doc/bn.pdf bn-$(VERSION).pdf rm -rf libtommath-$(VERSION) gpg -b -a ltm-$(VERSION).tar.xz gpg -b -a ltm-$(VERSION).zip new_file: perl helper.pl --update-files perlcritic: perlcritic *.pl doc/*.pl astyle: @echo " * run astyle on all sources" @astyle --options=astylerc --formatted $(OBJECTS:.o=.c) tommath*.h demo/*.c etc/*.c mtest/mtest.c tcl9.0.3/libtommath/LICENSE0000664000175000017500000000235115076154263014727 0ustar sergeisergei The LibTom license This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to tcl9.0.3/libtommath/libtommath_VS2008.vcproj0000664000175000017500000004165715104661341020235 0ustar sergeisergei tcl9.0.3/libtommath/libtommath_VS2008.sln0000664000175000017500000000253415104661341017515 0ustar sergeisergei Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.ActiveCfg = Debug|x64 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.Build.0 = Debug|x64 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.ActiveCfg = Release|x64 {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {83B84178-7B4F-4B78-9C5D-17B8201D5B61} EndGlobalSection EndGlobal tcl9.0.3/libtommath/libtommath.pc.in0000664000175000017500000000044115076154263017011 0ustar sergeisergeiprefix=@CMAKE_INSTALL_PREFIX@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: LibTomMath Description: public domain library for manipulating large integer numbers Version: @PROJECT_VERSION@ Libs: -L${libdir} -ltommath Cflags: -I${includedir} tcl9.0.3/libtommath/helper.pl0000775000175000017500000004135515104661341015540 0ustar sergeisergei#!/usr/bin/env perl use strict; use warnings; use Getopt::Long; use File::Find 'find'; use File::Basename 'basename'; use File::Glob 'bsd_glob'; sub read_file { my $f = shift; open my $fh, "<", $f or die "FATAL: read_rawfile() cannot open file '$f': $!"; binmode $fh; return do { local $/; <$fh> }; } sub write_file { my ($f, $data) = @_; die "FATAL: write_file() no data" unless defined $data; open my $fh, ">", $f or die "FATAL: write_file() cannot open file '$f': $!"; binmode $fh; print $fh $data or die "FATAL: write_file() cannot write to '$f': $!"; close $fh or die "FATAL: write_file() cannot close '$f': $!"; return; } sub sanitize_comments { my($content) = @_; $content =~ s{/\*(.*?)\*/}{my $x=$1; $x =~ s/\w/x/g; "/*$x*/";}egs; return $content; } sub check_source { my @all_files = ( bsd_glob("makefile*"), bsd_glob("*.{h,c,sh,pl}"), bsd_glob("*/*.{h,c,sh,pl}"), ); my $fails = 0; for my $file (sort @all_files) { my $troubles = {}; my $lineno = 1; my $content = read_file($file); $content = sanitize_comments $content; push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/; for my $l (split /\n/, $content) { push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/; push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/; push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i; push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/; push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/); # we prefer using MP_MALLOC, MP_FREE, MP_REALLOC, MP_CALLOC ... push @{$troubles->{unwanted_malloc}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmalloc\s*\(/; push @{$troubles->{unwanted_realloc}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\brealloc\s*\(/; push @{$troubles->{unwanted_calloc}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bcalloc\s*\(/; push @{$troubles->{unwanted_free}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bfree\s*\(/; # and we probably want to also avoid the following push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmemcpy\s*\(/; push @{$troubles->{unwanted_memset}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmemset\s*\(/; push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmemcpy\s*\(/; push @{$troubles->{unwanted_memmove}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmemmove\s*\(/; push @{$troubles->{unwanted_memcmp}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bmemcmp\s*\(/; push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bstrcmp\s*\(/; push @{$troubles->{unwanted_strcpy}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bstrcpy\s*\(/; push @{$troubles->{unwanted_strncpy}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bstrncpy\s*\(/; push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bclock\s*\(/; push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bqsort\s*\(/; push @{$troubles->{sizeof_no_brackets}}, $lineno if $file =~ /^[^\/]+\.c$/ && $l =~ /\bsizeof\s*[^\(]/; if ($file =~ m|^[^\/]+\.c$| && $l =~ /^static(\s+[a-zA-Z0-9_]+)+\s+([a-zA-Z0-9_]+)\s*\(/) { my $funcname = $2; # static functions should start with s_ push @{$troubles->{staticfunc_name}}, "$lineno($funcname)" if $funcname !~ /^s_/; } $lineno++; } for my $k (sort keys %$troubles) { warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n"; $fails++; } } warn( $fails > 0 ? "check-source: FAIL $fails\n" : "check-source: PASS\n" ); return $fails; } sub check_comments { my $fails = 0; my $first_comment = <<'MARKER'; /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MARKER #my @all_files = (bsd_glob("*.{h,c}"), bsd_glob("*/*.{h,c}")); my @all_files = (bsd_glob("*.{h,c}")); for my $f (@all_files) { my $txt = read_file($f); if ($txt !~ /\Q$first_comment\E/s) { warn "[first_comment] $f\n"; $fails++; } } warn( $fails > 0 ? "check-comments: FAIL $fails\n" : "check-comments: PASS\n" ); return $fails; } sub check_doc { my $fails = 0; my $tex = read_file('doc/bn.tex'); my $tmh = read_file('tommath.h'); my @functions = $tmh =~ /\n\s*[a-zA-Z0-9_* ]+?(mp_[a-z0-9_]+)\s*\([^\)]+\)\s*;/sg; my @macros = $tmh =~ /\n\s*#define\s+([a-z0-9_]+)\s*\([^\)]+\)/sg; for my $n (sort @functions) { (my $nn = $n) =~ s/_/\\_/g; # mp_sub_d >> mp\_sub\_d if ($tex !~ /index\Q{$nn}\E/) { warn "[missing_doc_for_function] $n\n"; $fails++ } } for my $n (sort @macros) { (my $nn = $n) =~ s/_/\\_/g; # mp_iszero >> mp\_iszero if ($tex !~ /index\Q{$nn}\E/) { warn "[missing_doc_for_macro] $n\n"; $fails++ } } warn( $fails > 0 ? "check_doc: FAIL $fails\n" : "check-doc: PASS\n" ); return $fails; } sub prepare_variable { my ($varname, @list) = @_; my $output = "$varname="; my $len = length($output); foreach my $obj (sort @list) { $len = $len + length $obj; $obj =~ s/\*/\$/; if ($len > 100) { $output .= "\\\n"; $len = length $obj; } $output .= $obj . ' '; } $output =~ s/ $//; return $output; } sub prepare_msvc_files_xml { my ($all, $exclude_re, $targets) = @_; my $last = []; my $depth = 2; # sort files in the same order as visual studio (ugly, I know) my @parts = (); for my $orig (@$all) { my $p = $orig; $p =~ s|/|/~|g; $p =~ s|/~([^/]+)$|/$1|g; my @l = map { sprintf "% -99s", $_ } split /\//, $p; push @parts, [ $orig, join(':', @l) ]; } my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } @parts; my $files = "\r\n"; for my $full (@sorted) { my @items = split /\//, $full; # split by '/' $full =~ s|/|\\|g; # replace '/' bt '\' shift @items; # drop first one (src) pop @items; # drop last one (filename.ext) my $current = \@items; if (join(':', @$current) ne join(':', @$last)) { my $common = 0; $common++ while ($last->[$common] && $current->[$common] && $last->[$common] eq $current->[$common]); my $back = @$last - $common; if ($back > 0) { $files .= ("\t" x --$depth) . "\r\n" for (1..$back); } my $fwd = [ @$current ]; splice(@$fwd, 0, $common); for my $i (0..scalar(@$fwd) - 1) { $files .= ("\t" x $depth) . "[$i]\"\r\n"; $files .= ("\t" x $depth) . "\t>\r\n"; $depth++; } $last = $current; } $files .= ("\t" x $depth) . "\r\n"; if ($full =~ $exclude_re) { for (@$targets) { $files .= ("\t" x $depth) . "\t\r\n"; $files .= ("\t" x $depth) . "\t\t\r\n"; $files .= ("\t" x $depth) . "\t\r\n"; } } $files .= ("\t" x $depth) . "\r\n"; } $files .= ("\t" x --$depth) . "\r\n" for (@$last); $files .= "\t"; return $files; } sub patch_file { my ($content, @variables) = @_; for my $v (@variables) { if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) { my $name = $1; $content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s; } else { die "patch_file failed: " . substr($v, 0, 30) . ".."; } } return $content; } sub make_sources_cmake { my ($src_ref, $hdr_ref) = @_; my @sources = @{ $src_ref }; my @headers = @{ $hdr_ref }; my $output = "# SPDX-License-Identifier: Unlicense # Autogenerated File! Do not edit. set(SOURCES\n"; foreach my $sobj (sort @sources) { $output .= $sobj . "\n"; } $output .= ")\n\nset(HEADERS\n"; foreach my $hobj (sort @headers) { $output .= $hobj . "\n"; } $output .= ")\n"; return $output; } sub process_makefiles { my $write = shift; my $changed_count = 0; my @headers = bsd_glob("*.h"); my @sources = bsd_glob("*.c"); my @o = map { my $x = $_; $x =~ s/\.c$/.o/; $x } @sources; my @all = sort(@sources, @headers); my $var_o = prepare_variable("OBJECTS", @o); (my $var_obj = $var_o) =~ s/\.o\b/.obj/sg; # update MSVC project files my $msvc_files = prepare_msvc_files_xml(\@all, qr/NOT_USED_HERE/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']); for my $m (qw/libtommath_VS2008.vcproj/) { my $old = read_file($m); my $new = $old; $new =~ s|.*|$msvc_files|s; if ($old ne $new) { write_file($m, $new) if $write; warn "changed: $m\n"; $changed_count++; } } # update OBJECTS + HEADERS in makefile* for my $m (qw/ makefile makefile.shared makefile_include.mk makefile.msvc makefile.unix makefile.mingw sources.cmake /) { my $old = read_file($m); my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj) : $m eq 'sources.cmake' ? make_sources_cmake(\@sources, \@headers) : patch_file($old, $var_o); if ($old ne $new) { write_file($m, $new) if $write; warn "changed: $m\n"; $changed_count++; } } if ($write) { return 0; # no failures } else { warn( $changed_count > 0 ? "check-makefiles: FAIL $changed_count\n" : "check-makefiles: PASS\n" ); return $changed_count; } } sub draw_func { my ($deplist, $depmap, $out, $indent, $funcslist) = @_; my @funcs = split ',', $funcslist; # try this if you want to have a look at a minimized version of the callgraph without all the trivial functions #if ($deplist =~ /$funcs[0]/ || $funcs[0] =~ /BN_MP_(ADD|SUB|CLEAR|CLEAR_\S+|DIV|MUL|COPY|ZERO|GROW|CLAMP|INIT|INIT_\S+|SET|ABS|CMP|CMP_D|EXCH)_C/) { if ($deplist =~ /$funcs[0]/) { return $deplist; } else { $deplist = $deplist . $funcs[0]; } if ($indent == 0) { } elsif ($indent >= 1) { print {$out} '| ' x ($indent - 1) . '+--->'; } print {$out} $funcs[0] . "\n"; shift @funcs; my $olddeplist = $deplist; foreach my $i (@funcs) { $deplist = draw_func($deplist, $depmap, $out, $indent + 1, ${$depmap}{$i}) if exists ${$depmap}{$i}; } return $olddeplist; } sub update_dep { #open class file and write preamble open(my $class, '>', 'tommath_class.h') or die "Couldn't open tommath_class.h for writing\n"; print {$class} << 'EOS'; /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) #define LTM_INSIDE #if defined(LTM2) # define LTM3 #endif #if defined(LTM1) # define LTM2 #endif #define LTM1 #if defined(LTM_ALL) EOS foreach my $filename (glob 'bn*.c') { my $define = $filename; print "Processing $filename\n"; # convert filename to upper case so we can use it as a define $define =~ tr/[a-z]/[A-Z]/; $define =~ tr/\./_/; print {$class} "# define $define\n"; # now copy text and apply #ifdef as required my $apply = 0; open(my $src, '<', $filename); open(my $out, '>', 'tmp'); # first line will be the #ifdef my $line = <$src>; if ($line =~ /include/) { print {$out} $line; } else { print {$out} << "EOS"; #include "tommath_private.h" #ifdef $define /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ $line EOS $apply = 1; } while (<$src>) { if ($_ !~ /tommath\.h/) { print {$out} $_; } } if ($apply == 1) { print {$out} "#endif\n"; } close $src; close $out; unlink $filename; rename 'tmp', $filename; } print {$class} "#endif\n#endif\n"; # now do classes my %depmap; foreach my $filename (glob 'bn*.c') { my $content; if ($filename =~ "bn_deprecated.c") { open(my $src, '<', $filename) or die "Can't open source file!\n"; read $src, $content, -s $src; close $src; } else { my $cc = $ENV{'CC'} || 'gcc'; $content = `$cc -E -x c -DLTM_ALL $filename`; $content =~ s/^# 1 "$filename".*?^# 2 "$filename"//ms; } # convert filename to upper case so we can use it as a define $filename =~ tr/[a-z]/[A-Z]/; $filename =~ tr/\./_/; print {$class} "#if defined($filename)\n"; my $list = $filename; # strip comments $content =~ s{/\*.*?\*/}{}gs; # scan for mp_* and make classes my @deps = (); foreach my $line (split /\n/, $content) { while ($line =~ /(fast_)?(s_)?mp\_[a-z_0-9]*((?=\;)|(?=\())|(?<=\()mp\_[a-z_0-9]*(?=\()/g) { my $a = $&; next if $a eq "mp_err"; $a =~ tr/[a-z]/[A-Z]/; $a = 'BN_' . $a . '_C'; push @deps, $a; } } if ($filename =~ "BN_DEPRECATED") { push(@deps, qw(BN_MP_GET_LL_C BN_MP_INIT_LL_C BN_MP_SET_LL_C)); push(@deps, qw(BN_MP_GET_MAG_ULL_C BN_MP_INIT_ULL_C BN_MP_SET_ULL_C)); push(@deps, qw(BN_MP_DIV_3_C BN_MP_EXPT_U32_C BN_MP_ROOT_U32_C BN_MP_LOG_U32_C)); } @deps = sort(@deps); foreach my $a (@deps) { if ($list !~ /$a/) { print {$class} "# define $a\n"; } $list = $list . ',' . $a; } $depmap{$filename} = $list; print {$class} "#endif\n\n"; } print {$class} << 'EOS'; #ifdef LTM_INSIDE #undef LTM_INSIDE #ifdef LTM3 # define LTM_LAST #endif #include "tommath_superclass.h" #include "tommath_class.h" #else # define LTM_LAST #endif EOS close $class; #now let's make a cool call graph... open(my $out, '>', 'callgraph.txt'); foreach (sort keys %depmap) { draw_func("", \%depmap, $out, 0, $depmap{$_}); print {$out} "\n\n"; } close $out; return 0; } sub generate_def { my @files = split /\n/, `git ls-files`; @files = grep(/\.c/, @files); @files = map { my $x = $_; $x =~ s/^bn_|\.c$//g; $x; } @files; @files = grep(!/mp_radix_smap/, @files); push(@files, qw(mp_set_int mp_set_long mp_set_long_long mp_get_int mp_get_long mp_get_long_long mp_init_set_int)); push(@files, qw(mp_get_ll mp_get_mag_ull mp_init_ll mp_set_ll mp_init_ull mp_set_ull)); push(@files, qw(mp_div_3 mp_expt_u32 mp_root_u32 mp_log_u32)); my $files = join("\n ", sort(grep(/^mp_/, @files))); write_file "tommath.def", "; libtommath ; ; Use this command to produce a 32-bit .lib file, for use in any MSVC version ; lib -machine:X86 -name:libtommath.dll -def:tommath.def -out:tommath.lib ; Use this command to produce a 64-bit .lib file, for use in any MSVC version ; lib -machine:X64 -name:libtommath.dll -def:tommath.def -out:tommath.lib ; EXPORTS $files "; return 0; } sub die_usage { die <<"MARKER"; usage: $0 -s OR $0 --check-source $0 -o OR $0 --check-comments $0 -m OR $0 --check-makefiles $0 -a OR $0 --check-all $0 -u OR $0 --update-files MARKER } GetOptions( "s|check-source" => \my $check_source, "o|check-comments" => \my $check_comments, "m|check-makefiles" => \my $check_makefiles, "d|check-doc" => \my $check_doc, "a|check-all" => \my $check_all, "u|update-files" => \my $update_files, "h|help" => \my $help ) or die_usage; my $failure; $failure ||= check_source() if $check_all || $check_source; $failure ||= check_comments() if $check_all || $check_comments; $failure ||= check_doc() if $check_doc; # temporarily excluded from --check-all $failure ||= process_makefiles(0) if $check_all || $check_makefiles; $failure ||= process_makefiles(1) if $update_files; $failure ||= update_dep() if $update_files; $failure ||= generate_def() if $update_files; die_usage unless defined $failure; exit $failure ? 1 : 0; tcl9.0.3/libtommath/CMakeLists.txt0000664000175000017500000002611615104661341016457 0ustar sergeisergei# SPDX-License-Identifier: Unlicense # # LibTomMath, a free open source portable number theoretic multiple-precision # integer (MPI) library written entirely in C. # cmake_minimum_required(VERSION 3.10) project(libtommath VERSION 1.3.0 DESCRIPTION "A free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C." HOMEPAGE_URL "https://www.libtom.net/LibTomMath" LANGUAGES C) # package release version # bump if re-releasing the same VERSION + patches # set to 1 if releasing a new VERSION set(PACKAGE_RELEASE_VERSION 1) #----------------------------------------------------------------------------- # Include cmake modules #----------------------------------------------------------------------------- include(GNUInstallDirs) include(CheckIPOSupported) include(CMakePackageConfigHelpers) # default is "No tests" option(BUILD_TESTING "" OFF) include(CTest) include(sources.cmake) #----------------------------------------------------------------------------- # Options #----------------------------------------------------------------------------- option(BUILD_SHARED_LIBS "Build shared library and only the shared library if \"ON\", default is static" OFF) #----------------------------------------------------------------------------- # Add support for ccache if desired #----------------------------------------------------------------------------- find_program(CCACHE ccache) if(CCACHE) option(ENABLE_CCACHE "Enable ccache." ON) endif() # use ccache if installed if(CCACHE AND ENABLE_CCACHE) set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) endif() #----------------------------------------------------------------------------- # Compose CFLAGS #----------------------------------------------------------------------------- # Some information ported from makefile_include.mk if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to 'Release' as none was specified.") set(CMAKE_BUILD_TYPE "Release") endif() # We only differentiate between MSVC and GCC-compatible compilers if(MSVC) set(LTM_C_FLAGS -W3) elseif(WATCOM) set(LTM_C_FLAGS -fo=.obj -oaxt -3r -w3) else() set(LTM_C_FLAGS -Wall -Wsign-compare -Wextra -Wshadow -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wsystem-headers) set(CMAKE_C_FLAGS_DEBUG "-g3") set(CMAKE_C_FLAGS_RELEASE "-O3 -funroll-loops -fomit-frame-pointer") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g3 -O2") set(CMAKE_C_FLAGS_MINSIZEREL "-Os") endif() # What compiler do we have and what are their...uhm... peculiarities if(CMAKE_C_COMPILER_ID MATCHES "(C|c?)lang") list(APPEND LTM_C_FLAGS -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header) # Clang requires at least '-O1' for dead code elimination set(CMAKE_C_FLAGS_DEBUG "-O1 ${CMAKE_C_FLAGS_DEBUG}") endif() if(CMAKE_C_COMPILER MATCHES "mingw") list(APPEND LTM_C_FLAGS -Wno-shadow -Wno-expansion-to-defined -Wno-declaration-after-statement -Wno-bad-function-cast) endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") list(APPEND LTM_C_FLAGS -Wno-nullability-completeness) endif() if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN") list(APPEND LTM_C_FLAGS -no-undefined) endif() # TODO: coverage (lgcov) # If the user set the environment variables at generate-time, append them # in order to allow overriding our defaults. # ${LTM_CFLAGS} means the user passed it via sth like: # $ cmake -DLTM_CFLAGS="foo" list(APPEND LTM_C_FLAGS ${LTM_CFLAGS}) list(APPEND LTM_LD_FLAGS ${LTM_LDFLAGS}) #----------------------------------------------------------------------------- # library target #----------------------------------------------------------------------------- add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS} ) target_include_directories(${PROJECT_NAME} PUBLIC $ $ ) target_compile_options(${PROJECT_NAME} BEFORE PRIVATE ${LTM_C_FLAGS} ) target_link_options(${PROJECT_NAME} BEFORE PRIVATE ${LTM_LD_FLAGS} ) set(PUBLIC_HEADERS tommath.h) set(C89 False CACHE BOOL "(Usually maintained automatically) Enable when the library is in c89 mode to package the correct header files on install") if(C89) list(APPEND PUBLIC_HEADERS tommath_c89.h) endif() set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME tommath VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} PUBLIC_HEADER "${PUBLIC_HEADERS}" ) option(COMPILE_LTO "Build with LTO enabled") if(COMPILE_LTO) check_ipo_supported(RESULT COMPILER_SUPPORTS_LTO) if(COMPILER_SUPPORTS_LTO) set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) else() message(SEND_ERROR "This compiler does not support LTO. Reconfigure ${PROJECT_NAME} with -DCOMPILE_LTO=OFF.") endif() endif() #----------------------------------------------------------------------------- # demo target #----------------------------------------------------------------------------- if(BUILD_TESTING) enable_testing() add_subdirectory(demo) endif() #----------------------------------------------------------------------------- # Install/export targets and files #----------------------------------------------------------------------------- set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") set(PROJECT_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake") set(PROJECT_CONFIG_FILE "${PROJECT_NAME}-config.cmake") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") install(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) # Install libtommath.pc for pkg-config if we build a shared library if(BUILD_SHARED_LIBS) # Let the user override the default directory of the pkg-config file (usually this shouldn't be required to be changed) set(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE PATH "Folder where to install .pc files") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_PKGCONFIGDIR} ) endif() # generate package version file write_basic_package_version_file( ${PROJECT_VERSION_FILE} VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ) # install version file install(FILES ${PROJECT_VERSION_FILE} DESTINATION ${CONFIG_INSTALL_DIR} ) # build directory package config export(EXPORT ${TARGETS_EXPORT_NAME} FILE ${PROJECT_CONFIG_FILE} ) # installed package config install(EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CONFIG_INSTALL_DIR} FILE ${PROJECT_CONFIG_FILE} ) # add to CMake registry export(PACKAGE ${PROJECT_NAME}) #--------------------------------------------------------------------------------------- # Create release packages #--------------------------------------------------------------------------------------- # determine distribution and architecture find_program(LSB_RELEASE lsb_release) find_program(SYSCTL sysctl) find_program(UNAME uname) if(UNAME) execute_process(COMMAND uname -m OUTPUT_VARIABLE MACHINE_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) elseif(SYSCTL) execute_process(COMMAND sysctl -b hw.machine_arch OUTPUT_VARIABLE MACHINE_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) else() string(TOLOWER ${CMAKE_SYSTEM_NAME} MACHINE_ARCH) endif() if(LSB_RELEASE) execute_process(COMMAND lsb_release -si OUTPUT_VARIABLE LINUX_DISTRO OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND lsb_release -sc OUTPUT_VARIABLE LINUX_DISTRO_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND lsb_release -sr OUTPUT_VARIABLE LINUX_DISTRO_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) string(TOLOWER ${LINUX_DISTRO} LINUX_DISTRO) if(LINUX_DISTRO_CODENAME STREQUAL "n/a") set(DISTRO_PACK_PATH ${LINUX_DISTRO}/${LINUX_DISTRO_VERSION}/) else() set(DISTRO_PACK_PATH ${LINUX_DISTRO}/${LINUX_DISTRO_CODENAME}/) endif() else() set(DISTRO_PACK_PATH ${CMAKE_SYSTEM_NAME}/) endif() # make sure untagged versions get a different package name execute_process(COMMAND git describe --exact-match --tags ERROR_QUIET RESULT_VARIABLE REPO_HAS_TAG) if(REPO_HAS_TAG EQUAL 0) set(PACKAGE_NAME_SUFFIX "") else() set(PACKAGE_NAME_SUFFIX "-git") message(STATUS "Use -git suffix") endif() # default CPack generators set(CPACK_GENERATOR TGZ STGZ) # extra CPack generators if(LINUX_DISTRO STREQUAL "debian" OR LINUX_DISTRO STREQUAL "ubuntu" OR LINUX_DISTRO STREQUAL "linuxmint") list(APPEND CPACK_GENERATOR DEB) elseif(LINUX_DISTRO STREQUAL "fedora" OR LINUX_DISTRO STREQUAL "opensuse" OR LINUX_DISTRO STREQUAL "centos") list(APPEND CPACK_GENERATOR RPM) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") list(APPEND CPACK_GENERATOR FREEBSD) endif() set(LTM_DEBIAN_SHARED_PACKAGE_NAME "${PROJECT_NAME}${PACKAGE_NAME_SUFFIX}${PROJECT_VERSION_MAJOR}") # general CPack config set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/packages/${DISTRO_PACK_PATH}) message(STATUS "CPack: packages will be generated under ${CPACK_PACKAGE_DIRECTORY}") if(BUILD_SHARED_LIBS) set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}") set(CPACK_DEBIAN_PACKAGE_NAME "${LTM_DEBIAN_SHARED_PACKAGE_NAME}") else() set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-devel") set(CPACK_DEBIAN_LIBRARIES_PACKAGE_NAME "${PROJECT_NAME}${PACKAGE_NAME_SUFFIX}-dev") endif() set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LibTomMath") set(CPACK_PACKAGE_VENDOR "libtom projects") set(CPACK_PACKAGE_CONTACT "libtom@googlegroups.com") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") set(PACKAGE_NAME_TRAILER ${CPACK_PACKAGE_VERSION}-${PACKAGE_RELEASE_VERSION}_${MACHINE_ARCH}) set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PACKAGE_NAME_TRAILER}) # deb specific CPack config set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON) set(CPACK_DEBIAN_PACKAGE_RELEASE ${PACKAGE_RELEASE_VERSION}) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) if(BUILD_SHARED_LIBS) set(CPACK_DEBIAN_PACKAGE_SECTION "libs") else() set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_DEBIAN_PACKAGE_DEPENDS ${LTM_DEBIAN_SHARED_PACKAGE_NAME}) set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_ALL Libraries) endif() # rpm specific CPack config set(CPACK_RPM_PACKAGE_RELEASE ${PACKAGE_RELEASE_VERSION}) set(CPACK_RPM_PACKAGE_ARCHITECTURE ${MACHINE_ARCH}) set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}") set(CPACK_RPM_PACKAGE_LICENSE "The Unlicense") # FreeBSD specific CPack config set(CPACK_FREEBSD_PACKAGE_MAINTAINER "gahr@FreeBSD.org") set(CPACK_FREEBSD_PACKAGE_ORIGIN "math/libtommath") set(CPACK_FREEBSD_PACKAGE_CATEGORIES "math") include(CPack) tcl9.0.3/libtommath/changes.txt0000664000175000017500000007257615076154263016113 0ustar sergeisergeiMar 27th, 2024 v1.3.0 -- Deprecate more APIs which are replaced in develop (PR #572) -- Add support for CMake (PR #573) -- Add support for GitHub Actions (PR #573) Sep 04th, 2023 v1.2.1 -- Bugfix release because of potential integer overflow c.f. PR #546 resp. CVE-2023-36328 Oct 22nd, 2019 v1.2.0 -- A huge refactoring of the library happened - renaming, deprecating and replacing existing functions by improved API's. All deprecated functions, macros and symbols are only marked as such so this version is still API and ABI compatible to v1.x. -- Daniel Mendler was pushing for those changes and contributing a load of patches, refactorings, code reviews and whatnotelse. -- Christoph Zurnieden re-worked internals of the library, improved the performance, did code reviews and wrote documentation. -- Francois Perrad did some refactoring and took again care of linting the sources and provided all fixes. -- Jan Nijtmans, Karel Miko and Joachim Breitner contributed various patches. -- Private symbols can now be hidden for the shared library builds, disabled by default. -- All API's follow a single code style, are prefixed the same etc. -- Unified, safer and improved API's -- Less magic numbers - return values (where appropriate) and most flags are now enums, this was implemented in a backwards compatible way where return values were int. -- API's with return values are now by default marked as "warn on unsused result", this can be disabled if required (which will most likely hide bugs), c.f. MP_WUR in tommath.h -- Provide a whole set of setters&getters for different primitive types (long, uint32_t, etc.) -- All those primitive setters are now optimized. -- It's possible to automatically tune the cutoff values for Karatsuba&Toom-Cook -- The custom allocators which were formerly known as XMALLOC(), XFREE() etc. are now available as MP_MALLOC(), MP_REALLOC(), MP_CALLOC() and MP_FREE(). MP_REALLOC() and MP_FREE() now also provide the allocated size to ease the usage of simple allocators without tracking. -- Building is now also possible with MSVC 2015, 2017 and 2019 (use makefile.msvc) -- Added mp_decr() and mp_incr() -- Added mp_log_u32() -- Improved prime-checking -- Improved Toom-Cook multiplication -- Removed the LTM book (`make docs` now builds the user manual) Jan 28th, 2019 v1.1.0 -- Christoph Zurnieden contributed FIPS 186.4 compliant prime-checking (PR #113), several other fixes and a load of documentation -- Daniel Mendler provided two's-complement functions (PR #124) and mp_{set,get}_double() (PR #123) -- Francois Perrad took care of linting the sources, provided all fixes and a astylerc to auto-format the sources. -- A bunch of patches by Kevin B Kenny have been back-ported from TCL -- Jan Nijtmans provided the patches to `const`ify all API function arguments (also from TCL) -- mp_rand() has now several native random provider implementations and doesn't rely on `rand()` anymore -- Karel Miko provided fixes when building for MS Windows and re-worked the makefile generating process -- The entire environment and build logic has been extended and improved regarding auto-detection of platforms, libtool and a lot more -- Prevent some potential BOF cases -- Improved/fixed mp_lshd() and mp_invmod() -- A load more bugs were fixed by various contributors Aug 29th, 2017 v1.0.1 -- Dmitry Kovalenko provided fixes to mp_add_d() and mp_init_copy() -- Matt Johnston contributed some improvements to mp_div_2d(), mp_exptmod_fast(), mp_mod() and mp_mulmod() -- Julien Nabet provided a fix to the error handling in mp_init_multi() -- Ben Gardner provided a fix regarding usage of reserved keywords -- Fixed mp_rand() to fill the correct number of bits -- Fixed mp_invmod() -- Use the same 64-bit detection code as in libtomcrypt -- Correct usage of DESTDIR, PREFIX, etc. when installing the library -- Francois Perrad updated all the perl scripts to an actual perl version Feb 5th, 2016 v1.0 -- Bump to 1.0 -- Dirkjan Bussink provided a faster version of mp_expt_d() -- Moritz Lenz contributed a fix to mp_mod() and provided mp_get_long() and mp_set_long() -- Fixed bugs in mp_read_radix(), mp_radix_size Thanks to shameister, Gerhard R, -- Christopher Brown provided mp_export() and mp_import() -- Improvements in the code of mp_init_copy() Thanks to ramkumarkoppu, -- lomereiter provided mp_balance_mul() -- Alexander Boström from the heimdal project contributed patches to mp_prime_next_prime() and mp_invmod() and added a mp_isneg() macro -- Fix build issues for Linux x32 ABI -- Added mp_get_long_long() and mp_set_long_long() -- Carlin provided a patch to use arc4random() instead of rand() on platforms where it is supported -- Karel Miko provided mp_sqrtmod_prime() 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++. -- "mm" from sci.crypt pointed out that my mp_gcd was sub-optimal (I also updated and corrected the book) -- updated some of the @@ tags in tommath.src to reflect source changes. -- updated email and url info in all source files Jan 26th, 2006 v0.38 -- broken makefile.shared fixed -- removed some carry stores that were not required [updated text] November 18th, 2005 v0.37 -- [Don Porter] reported on a TCL list [HEY SEND ME BUGREPORTS ALREADY!!!] that mp_add_d() would compute -0 with some inputs. Fixed. -- [rinick@gmail.com] reported the makefile.bcc was messed up. Fixed. -- [Kevin Kenny] reported some issues with mp_toradix_n(). Now it doesn't require a min of 3 chars of output. -- Made the make command renamable. Wee August 1st, 2005 v0.36 -- LTM_PRIME_2MSB_ON was fixed and the "OFF" flag was removed. -- [Peter LaDow] found a typo in the XREALLOC macro -- [Peter LaDow] pointed out that mp_read_(un)signed_bin should have "const" on the input -- Ported LTC patch to fix the prime_random_ex() function to get the bitsize correct [and the maskOR flags] -- Kevin Kenny pointed out a stray // -- David Hulton pointed out a typo in the textbook [mp_montgomery_setup() pseudo-code] -- Neal Hamilton (Elliptic Semiconductor) pointed out that my Karatsuba notation was backwards and that I could use unsigned operations in the routine. -- Paul Schmidt pointed out a linking error in mp_exptmod() when BN_S_MP_EXPTMOD_C is undefined (and another for read_radix) -- Updated makefiles to be way more flexible March 12th, 2005 v0.35 -- Stupid XOR function missing line again... oops. -- Fixed bug in invmod not handling negative inputs correctly [Wolfgang Ehrhardt] -- Made exteuclid always give positive u3 output...[ Wolfgang Ehrhardt ] -- [Wolfgang Ehrhardt] Suggested a fix for mp_reduce() which avoided underruns. ;-) -- mp_rand() would emit one too many digits and it was possible to get a 0 out of it ... oops -- Added montgomery to the testing to make sure it handles 1..10 digit moduli correctly -- Fixed bug in comba that would lead to possible erroneous outputs when "pa < digs" -- Fixed bug in mp_toradix_size for "0" [Kevin Kenny] -- Updated chapters 1-5 of the textbook ;-) It now talks about the new comba code! February 12th, 2005 v0.34 -- Fixed two more small errors in mp_prime_random_ex() -- Fixed overflow in mp_mul_d() [Kevin Kenny] -- Added mp_to_(un)signed_bin_n() functions which do bounds checking for ya [and report the size] -- Added "large" diminished radix support. Speeds up things like DSA where the moduli is of the form 2^k - P for some P < 2^(k/2) or so Actually is faster than Montgomery on my AMD64 (and probably much faster on a P4) -- Updated the manual a bit -- Ok so I haven't done the textbook work yet... My current freelance gig has landed me in France till the end of Feb/05. Once I get back I'll have tons of free time and I plan to go to town on the book. As of this release the API will freeze. At least until the book catches up with all the changes. I welcome bug reports but new algorithms will have to wait. December 23rd, 2004 v0.33 -- Fixed "small" variant for mp_div() which would munge with negative dividends... -- Fixed bug in mp_prime_random_ex() which would set the most significant byte to zero when no special flags were set -- Fixed overflow [minor] bug in fast_s_mp_sqr() -- Made the makefiles easier to configure the group/user that ltm will install as -- Fixed "final carry" bug in comba multipliers. (Volkan Ceylan) -- Matt Johnston pointed out a missing semi-colon in mp_exptmod October 29th, 2004 v0.32 -- Added "makefile.shared" for shared object support -- Added more to the build options/configs in the manual -- Started the Depends framework, wrote dep.pl to scan deps and produce "callgraph.txt" ;-) -- Wrote SC_RSA_1 which will enable close to the minimum required to perform RSA on 32-bit [or 64-bit] platforms with LibTomCrypt -- Merged in the small/slower mp_div replacement. You can now toggle which you want to use as your mp_div() at build time. Saves roughly 8KB or so. -- Renamed a few files and changed some comments to make depends system work better. (No changes to function names) -- Merged in new Combas that perform 2 reads per inner loop instead of the older 3reads/2writes per inner loop of the old code. Really though if you want speed learn to use TomsFastMath ;-) August 9th, 2004 v0.31 -- "profiled" builds now :-) new timings for Intel Northwoods -- Added "pretty" build target -- Update mp_init() to actually assign 0's instead of relying on calloc() -- "Wolfgang Ehrhardt" found a bug in mp_mul() where if you multiply a negative by zero you get negative zero as the result. Oops. -- J Harper from PeerSec let me toy with his AMD64 and I got 60-bit digits working properly [this also means that I fixed a bug where if sizeof(int) < sizeof(mp_digit) it would bug] April 11th, 2004 v0.30 -- Added "mp_toradix_n" which stores upto "n-1" least significant digits of an mp_int -- Johan Lindh sent a patch so MSVC wouldn't whine about redefining malloc [in weird dll modes] -- Henrik Goldman spotted a missing OPT_CAST in mp_fwrite() -- Tuned tommath.h so that when MP_LOW_MEM is defined MP_PREC shall be reduced. [I also allow MP_PREC to be externally defined now] -- Sped up mp_cnt_lsb() by using a 4x4 table [e.g. 4x speedup] -- Added mp_prime_random_ex() which is a more versatile prime generator accurate to exact bit lengths (unlike the deprecated but still available mp_prime_random() which is only accurate to byte lengths). See the new LTM_PRIME_* flags ;-) -- Alex Polushin contributed an optimized mp_sqrt() as well as mp_get_int() and mp_is_square(). I've cleaned them all up to be a little more consistent [along with one bug fix] for this release. -- Added mp_init_set and mp_init_set_int to initialize and set small constants with one function call. -- Removed /etclib directory [um LibTomPoly deprecates this]. -- Fixed mp_mod() so the sign of the result agrees with the sign of the modulus. ++ N.B. My semester is almost up so expect updates to the textbook to be posted to the libtomcrypt.org website. Jan 25th, 2004 v0.29 ++ Note: "Henrik" from the v0.28 changelog refers to Henrik Goldman ;-) -- Added fix to mp_shrink to prevent a realloc when used == 0 [e.g. realloc zero bytes???] -- Made the mp_prime_rabin_miller_trials() function internal table smaller and also set the minimum number of tests to two (sounds a bit safer). -- Added a mp_exteuclid() which computes the extended euclidean algorithm. -- Fixed a memory leak in s_mp_exptmod() [called when Barrett reduction is to be used] which would arise if a multiplication or subsequent reduction failed [would not free the temp result]. -- Made an API change to mp_radix_size(). It now returns an error code and stores the required size through an "int star" passed to it. Dec 24th, 2003 v0.28 -- Henrik Goldman suggested I add casts to the montomgery code [stores into mu...] so compilers wouldn't spew [erroneous] diagnostics... fixed. -- Henrik Goldman also spotted two typos. One in mp_radix_size() and another in mp_toradix(). -- Added fix to mp_shrink() to avoid a memory leak. -- Added mp_prime_random() which requires a callback to make truly random primes of a given nature (idea from chat with Niels Ferguson at Crypto'03) -- Picked up a second wind. I'm filled with Gooo. Mission Gooo! -- Removed divisions from mp_reduce_is_2k() -- Sped up mp_div_d() [general case] to use only one division per digit instead of two. -- Added the heap macros from LTC to LTM. Now you can easily [by editing four lines of tommath.h] change the name of the heap functions used in LTM [also compatible with LTC via MPI mode] -- Added bn_prime_rabin_miller_trials() which gives the number of Rabin-Miller trials to achieve a failure rate of less than 2^-96 -- fixed bug in fast_mp_invmod(). The initial testing logic was wrong. An invalid input is not when "a" and "b" are even it's when "b" is even [the algo is for odd moduli only]. -- Started a new manual [finally]. It is incomplete and will be finished as time goes on. I had to stop adding full demos around half way in chapter three so I could at least get a good portion of the manual done. If you really need help using the library you can always email me! -- My Textbook is now included as part of the package [all Public Domain] Sept 19th, 2003 v0.27 -- Removed changes.txt~ which was made by accident since "kate" decided it was a good time to re-enable backups... [kde is fun!] -- In mp_grow() "a->dp" is not overwritten by realloc call [re: memory leak] Now if mp_grow() fails the mp_int is still valid and can be cleared via mp_clear() to reclaim the memory. -- Henrik Goldman found a buffer overflow bug in mp_add_d(). Fixed. -- Cleaned up mp_mul_d() to be much easier to read and follow. Aug 29th, 2003 v0.26 -- Fixed typo that caused warning with GCC 3.2 -- Martin Marcel noticed a bug in mp_neg() that allowed negative zeroes. Also, Martin is the fellow who noted the bugs in mp_gcd() of 0.24/0.25. -- Martin Marcel noticed an optimization [and slight bug] in mp_lcm(). -- Added fix to mp_read_unsigned_bin to prevent a buffer overflow. -- Beefed up the comments in the baseline multipliers [and montgomery] -- Added "mont" demo to the makefile.msvc in etc/ -- Optimized sign compares in mp_cmp from 4 to 2 cases. Aug 4th, 2003 v0.25 -- Fix to mp_gcd again... oops (0,-a) == (-a, 0) == a -- Fix to mp_clear which didn't reset the sign [Greg Rose] -- Added mp_error_to_string() to convert return codes to strings. [Greg Rose] -- Optimized fast_mp_invmod() to do the test for invalid inputs [both even] first so temps don't have to be initialized if it's going to fail. -- Optimized mp_gcd() by removing mp_div_2d calls for when one of the inputs is odd. -- Tons of new comments, some indentation fixups, etc. -- mp_jacobi() returns MP_VAL if the modulus is less than or equal to zero. -- fixed two typos in the header of each file :-) -- LibTomMath is officially Public Domain [see LICENSE] July 15th, 2003 v0.24 -- Optimized mp_add_d and mp_sub_d to not allocate temporary variables -- Fixed mp_gcd() so the gcd of 0,0 is 0. Allows the gcd operation to be chained e.g. (0,0,a) == a [instead of 1] -- Should be one of the last release for a while. Working on LibTomMath book now. -- optimized the pprime demo [/etc/pprime.c] to first make a huge table of single digit primes then it reads them randomly instead of randomly choosing/testing single digit primes. July 12th, 2003 v0.23 -- Optimized mp_prime_next_prime() to not use mp_mod [via is_divisible()] in each iteration. Instead now a smaller table is kept of the residues which can be updated without division. -- Fixed a bug in next_prime() where an input of zero would be treated as odd and have two added to it [to move to the next odd]. -- fixed a bug in prime_fermat() and prime_miller_rabin() which allowed the base to be negative, zero or one. Normally the test is only valid if the base is greater than one. -- changed the next_prime() prototype to accept a new parameter "bbs_style" which will find the next prime congruent to 3 mod 4. The default [bbs_style==0] will make primes which are either congruent to 1 or 3 mod 4. -- fixed mp_read_unsigned_bin() so that it doesn't include both code for the case DIGIT_BIT < 8 and >= 8 -- optimized div_d() to easy out on division by 1 [or if a == 0] and use logical shifts if the divisor is a power of two. -- the default DIGIT_BIT type was not int for non-default builds. Fixed. July 2nd, 2003 v0.22 -- Fixed up mp_invmod so the result is properly in range now [was always congruent to the inverse...] -- Fixed up s_mp_exptmod and mp_exptmod_fast so the lower half of the pre-computed table isn't allocated which makes the algorithm use half as much ram. -- Fixed the install script not to make the book :-) [which isn't included anyways] -- added mp_cnt_lsb() which counts how many of the lsbs are zero -- optimized mp_gcd() to use the new mp_cnt_lsb() to replace multiple divisions by two by a single division. -- applied similar optimization to mp_prime_miller_rabin(). -- Fixed a bug in both mp_invmod() and fast_mp_invmod() which tested for odd via "mp_iseven() == 0" which is not valid [since zero is not even either]. June 19th, 2003 v0.21 -- Fixed bug in mp_mul_d which would not handle sign correctly [would not always forward it] -- Removed the #line lines from gen.pl [was in violation of ISO C] June 8th, 2003 v0.20 -- Removed the book from the package. Added the TDCAL license document. -- This release is officially pure-bred TDCAL again [last officially TDCAL based release was v0.16] June 6th, 2003 v0.19 -- Fixed a bug in mp_montgomery_reduce() which was introduced when I tweaked mp_rshd() in the previous release. Essentially the digits were not trimmed before the compare which cause a subtraction to occur all the time. -- Fixed up etc/tune.c a bit to stop testing new cutoffs after 16 failures [to find more optimal points]. Brute force ho! May 29th, 2003 v0.18 -- Fixed a bug in s_mp_sqr which would handle carries properly just not very elegantly. (e.g. correct result, just bad looking code) -- Fixed bug in mp_sqr which still had a 512 constant instead of MP_WARRAY -- Added Toom-Cook multipliers [needs tuning!] -- Added efficient divide by 3 algorithm mp_div_3 -- Re-wrote mp_div_d to be faster than calling mp_div -- Added in a donated BCC makefile and a single page LTM poster (ahalhabsi@sbcglobal.net) -- Added mp_reduce_2k which reduces an input modulo n = 2**p - k for any single digit k -- Made the exptmod system be aware of the 2k reduction algorithms. -- Rewrote mp_dr_reduce to be smaller, simpler and easier to understand. May 17th, 2003 v0.17 -- Benjamin Goldberg submitted optimized mp_add and mp_sub routines. A new gen.pl as well as several smaller suggestions. Thanks! -- removed call to mp_cmp in inner loop of mp_div and put mp_cmp_mag in its place :-) -- Fixed bug in mp_exptmod that would cause it to fail for odd moduli when DIGIT_BIT != 28 -- mp_exptmod now also returns errors if the modulus is negative and will handle negative exponents -- mp_prime_is_prime will now return true if the input is one of the primes in the prime table -- Damian M Gryski (dgryski@uwaterloo.ca) found a index out of bounds error in the mp_fast_s_mp_mul_high_digs function which didn't come up before. (fixed) -- Refactored the DR reduction code so there is only one function per file. -- Fixed bug in the mp_mul() which would erroneously avoid the faster multiplier [comba] when it was allowed. The bug would not cause the incorrect value to be produced just less efficient (fixed) -- Fixed similar bug in the Montgomery reduction code. -- Added tons of (mp_digit) casts so the 7/15/28/31 bit digit code will work flawlessly out of the box. Also added limited support for 64-bit machines with a 60-bit digit. Both thanks to Tom Wu (tom@arcot.com) -- Added new comments here and there, cleaned up some code [style stuff] -- Fixed a lingering typo in mp_exptmod* that would set bitcnt to zero then one. Very silly stuff :-) -- Fixed up mp_exptmod_fast so it would set "redux" to the comba Montgomery reduction if allowed. This saves quite a few calls and if statements. -- Added etc/mont.c a test of the Montgomery reduction [assuming all else works :-| ] -- Fixed up etc/tune.c to use a wider test range [more appropriate] also added a x86 based addition which uses RDTSC for high precision timing. -- Updated demo/demo.c to remove MPI stuff [won't work anyways], made the tests run for 2 seconds each so its not so insanely slow. Also made the output space delimited [and fixed up various errors] -- Added logs directory, logs/graph.dem which will use gnuplot to make a series of PNG files that go with the pre-made index.html. You have to build [via make timing] and run ltmtest first in the root of the package. -- Fixed a bug in mp_sub and mp_add where "-a - -a" or "-a + a" would produce -0 as the result [obviously invalid]. -- Fixed a bug in mp_rshd. If the count == a.used it should zero/return [instead of shifting] -- Fixed a "off-by-one" bug in mp_mul2d. The initial size check on alloc would be off by one if the residue shifting caused a carry. -- Fixed a bug where s_mp_mul_digs() would not call the Comba based routine if allowed. This made Barrett reduction slower than it had to be. Mar 29th, 2003 v0.16 -- Sped up mp_div by making normalization one shift call -- Sped up mp_mul_2d/mp_div_2d by aliasing pointers :-) -- Cleaned up mp_gcd to use the macros for odd/even detection -- Added comments here and there, mostly there but occasionally here too. Mar 22nd, 2003 v0.15 -- Added series of prime testing routines to lib -- Fixed up etc/tune.c -- Added DR reduction algorithm -- Beefed up the manual more. -- Fixed up demo/demo.c so it doesn't have so many warnings and it does the full series of tests -- Added "pre-gen" directory which will hold a "gen.pl"'ed copy of the entire lib [done at zipup time so its always the latest] -- Added conditional casts for C++ users [boo!] Mar 15th, 2003 v0.14 -- Tons of manual updates -- cleaned up the directory -- added MSVC makefiles -- source changes [that I don't recall] -- Fixed up the lshd/rshd code to use pointer aliasing -- Fixed up the mul_2d and div_2d to not call rshd/lshd unless needed -- Fixed up etc/tune.c a tad -- fixed up demo/demo.c to output comma-delimited results of timing also fixed up timing demo to use a finer granularity for various functions -- fixed up demo/demo.c testing to pause during testing so my Duron won't catch on fire [stays around 31-35C during testing :-)] Feb 13th, 2003 v0.13 -- tons of minor speed-ups in low level add, sub, mul_2 and div_2 which propagate to other functions like mp_invmod, mp_div, etc... -- Sped up mp_exptmod_fast by using new code to find R mod m [e.g. B^n mod m] -- minor fixes Jan 17th, 2003 v0.12 -- re-wrote the majority of the makefile so its more portable and will install via "make install" on most *nix platforms -- Re-packaged all the source as separate files. Means the library a single file packagage any more. Instead of just adding "bn.c" you have to add libtommath.a -- Renamed "bn.h" to "tommath.h" -- Changes to the manual to reflect all of this -- Used GNU Indent to clean up the source Jan 15th, 2003 v0.11 -- More subtle fixes -- Moved to gentoo linux [hurrah!] so made *nix specific fixes to the make process -- Sped up the montgomery reduction code quite a bit -- fixed up demo so when building timing for the x86 it assumes ELF format now Jan 9th, 2003 v0.10 -- Pekka Riikonen suggested fixes to the radix conversion code. -- Added baseline montgomery and comba montgomery reductions, sped up exptmods [to a point, see bn.h for MONTGOMERY_EXPT_CUTOFF] Jan 6th, 2003 v0.09 -- Updated the manual to reflect recent changes. :-) -- Added Jacobi function (mp_jacobi) to supplement the number theory side of the lib -- Added a Mersenne prime finder demo in ./etc/mersenne.c Jan 2nd, 2003 v0.08 -- Sped up the multipliers by moving the inner loop variables into a smaller scope -- Corrected a bunch of small "warnings" -- Added more comments -- Made "mtest" be able to use /dev/random, /dev/urandom or stdin for RNG data -- Corrected some bugs where error messages were potentially ignored -- add etc/pprime.c program which makes numbers which are provably prime. Jan 1st, 2003 v0.07 -- Removed alot of heap operations from core functions to speed them up -- Added a root finding function [and mp_sqrt macro like from MPI] -- Added more to manual Dec 31st, 2002 v0.06 -- Sped up the s_mp_add, s_mp_sub which inturn sped up mp_invmod, mp_exptmod, etc... -- Cleaned up the header a bit more Dec 30th, 2002 v0.05 -- Builds with MSVC out of the box -- Fixed a bug in mp_invmod w.r.t. even moduli -- Made mp_toradix and mp_read_radix use char instead of unsigned char arrays -- Fixed up exptmod to use fewer multiplications -- Fixed up mp_init_size to use only one heap operation -- Note there is a slight "off-by-one" bug in the library somewhere without the padding (see the source for comment) the library crashes in libtomcrypt. Anyways a reasonable workaround is to pad the numbers which will always correct it since as the numbers grow the padding will still be beyond the end of the number -- Added more to the manual Dec 29th, 2002 v0.04 -- Fixed a memory leak in mp_to_unsigned_bin -- optimized invmod code -- Fixed bug in mp_div -- use exchange instead of copy for results -- added a bit more to the manual Dec 27th, 2002 v0.03 -- Sped up s_mp_mul_high_digs by not computing the carries of the lower digits -- Fixed a bug where mp_set_int wouldn't zero the value first and set the used member. -- fixed a bug in s_mp_mul_high_digs where the limit placed on the result digits was not calculated properly -- fixed bugs in add/sub/mul/sqr_mod functions where if the modulus and dest were the same it wouldn't work -- fixed a bug in mp_mod and mp_mod_d concerning negative inputs -- mp_mul_d didn't preserve sign -- Many many many many fixes -- Works in LibTomCrypt now :-) -- Added iterations to the timing demos... more accurate. -- Tom needs a job. Dec 26th, 2002 v0.02 -- Fixed a few "slips" in the manual. This is "LibTomMath" afterall :-) -- Added mp_cmp_mag, mp_neg, mp_abs and mp_radix_size that were missing. -- Sped up the fast [comba] multipliers more [yahoo!] Dec 25th,2002 v0.01 -- Initial release. Gimme a break. -- Todo list, add details to manual [e.g. algorithms] more comments in code example programs tcl9.0.3/libtommath/bn_s_mp_toom_sqr.c0000664000175000017500000001071015076154263017424 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_TOOM_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* squaring using Toom-Cook 3-way algorithm */ /* This file contains code from J. Arndt's book "Matters Computational" and the accompanying FXT-library with permission of the author. */ /* squaring using Toom-Cook 3-way algorithm */ /* Setup and interpolation from algorithm SQR_3 in Chung, Jaewook, and M. Anwar Hasan. "Asymmetric squaring formulae." 18th IEEE Symposium on Computer Arithmetic (ARITH'07). IEEE, 2007. */ mp_err s_mp_toom_sqr(const mp_int *a, mp_int *b) { mp_int S0, a0, a1, a2; mp_digit *tmpa, *tmpc; int B, count; mp_err err; /* init temps */ if ((err = mp_init(&S0)) != MP_OKAY) { return err; } /* B */ B = a->used / 3; /** a = a2 * x^2 + a1 * x + a0; */ if ((err = mp_init_size(&a0, B)) != MP_OKAY) goto LBL_ERRa0; a0.used = B; if ((err = mp_init_size(&a1, B)) != MP_OKAY) goto LBL_ERRa1; a1.used = B; if ((err = mp_init_size(&a2, B + (a->used - (3 * B)))) != MP_OKAY) goto LBL_ERRa2; tmpa = a->dp; tmpc = a0.dp; for (count = 0; count < B; count++) { *tmpc++ = *tmpa++; } tmpc = a1.dp; for (; count < (2 * B); count++) { *tmpc++ = *tmpa++; } tmpc = a2.dp; for (; count < a->used; count++) { *tmpc++ = *tmpa++; a2.used++; } mp_clamp(&a0); mp_clamp(&a1); mp_clamp(&a2); /** S0 = a0^2; */ if ((err = mp_sqr(&a0, &S0)) != MP_OKAY) goto LBL_ERR; /** \\S1 = (a2 + a1 + a0)^2 */ /** \\S2 = (a2 - a1 + a0)^2 */ /** \\S1 = a0 + a2; */ /** a0 = a0 + a2; */ if ((err = mp_add(&a0, &a2, &a0)) != MP_OKAY) goto LBL_ERR; /** \\S2 = S1 - a1; */ /** b = a0 - a1; */ if ((err = mp_sub(&a0, &a1, b)) != MP_OKAY) goto LBL_ERR; /** \\S1 = S1 + a1; */ /** a0 = a0 + a1; */ if ((err = mp_add(&a0, &a1, &a0)) != MP_OKAY) goto LBL_ERR; /** \\S1 = S1^2; */ /** a0 = a0^2; */ if ((err = mp_sqr(&a0, &a0)) != MP_OKAY) goto LBL_ERR; /** \\S2 = S2^2; */ /** b = b^2; */ if ((err = mp_sqr(b, b)) != MP_OKAY) goto LBL_ERR; /** \\ S3 = 2 * a1 * a2 */ /** \\S3 = a1 * a2; */ /** a1 = a1 * a2; */ if ((err = mp_mul(&a1, &a2, &a1)) != MP_OKAY) goto LBL_ERR; /** \\S3 = S3 << 1; */ /** a1 = a1 << 1; */ if ((err = mp_mul_2(&a1, &a1)) != MP_OKAY) goto LBL_ERR; /** \\S4 = a2^2; */ /** a2 = a2^2; */ if ((err = mp_sqr(&a2, &a2)) != MP_OKAY) goto LBL_ERR; /** \\ tmp = (S1 + S2)/2 */ /** \\tmp = S1 + S2; */ /** b = a0 + b; */ if ((err = mp_add(&a0, b, b)) != MP_OKAY) goto LBL_ERR; /** \\tmp = tmp >> 1; */ /** b = b >> 1; */ if ((err = mp_div_2(b, b)) != MP_OKAY) goto LBL_ERR; /** \\ S1 = S1 - tmp - S3 */ /** \\S1 = S1 - tmp; */ /** a0 = a0 - b; */ if ((err = mp_sub(&a0, b, &a0)) != MP_OKAY) goto LBL_ERR; /** \\S1 = S1 - S3; */ /** a0 = a0 - a1; */ if ((err = mp_sub(&a0, &a1, &a0)) != MP_OKAY) goto LBL_ERR; /** \\S2 = tmp - S4 -S0 */ /** \\S2 = tmp - S4; */ /** b = b - a2; */ if ((err = mp_sub(b, &a2, b)) != MP_OKAY) goto LBL_ERR; /** \\S2 = S2 - S0; */ /** b = b - S0; */ if ((err = mp_sub(b, &S0, b)) != MP_OKAY) goto LBL_ERR; /** \\P = S4*x^4 + S3*x^3 + S2*x^2 + S1*x + S0; */ /** P = a2*x^4 + a1*x^3 + b*x^2 + a0*x + S0; */ if ((err = mp_lshd(&a2, 4 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(&a1, 3 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(b, 2 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(&a0, 1 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&a2, &a1, &a2)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&a2, b, b)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(b, &a0, b)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(b, &S0, b)) != MP_OKAY) goto LBL_ERR; /** a^2 - P */ LBL_ERR: mp_clear(&a2); LBL_ERRa2: mp_clear(&a1); LBL_ERRa1: mp_clear(&a0); LBL_ERRa0: mp_clear(&S0); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_toom_mul.c0000664000175000017500000001554615076154263017430 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_TOOM_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* multiplication using the Toom-Cook 3-way algorithm * * Much more complicated than Karatsuba but has a lower * asymptotic running time of O(N**1.464). This algorithm is * only particularly useful on VERY large inputs * (we're talking 1000s of digits here...). */ /* This file contains code from J. Arndt's book "Matters Computational" and the accompanying FXT-library with permission of the author. */ /* Setup from Chung, Jaewook, and M. Anwar Hasan. "Asymmetric squaring formulae." 18th IEEE Symposium on Computer Arithmetic (ARITH'07). IEEE, 2007. The interpolation from above needed one temporary variable more than the interpolation here: Bodrato, Marco, and Alberto Zanoni. "What about Toom-Cook matrices optimality." Centro Vito Volterra Universita di Roma Tor Vergata (2006) */ mp_err s_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) { mp_int S1, S2, T1, a0, a1, a2, b0, b1, b2; int B, count; mp_err err; /* init temps */ if ((err = mp_init_multi(&S1, &S2, &T1, (void *)NULL)) != MP_OKAY) { return err; } /* B */ B = MP_MIN(a->used, b->used) / 3; /** a = a2 * x^2 + a1 * x + a0; */ if ((err = mp_init_size(&a0, B)) != MP_OKAY) goto LBL_ERRa0; for (count = 0; count < B; count++) { a0.dp[count] = a->dp[count]; a0.used++; } mp_clamp(&a0); if ((err = mp_init_size(&a1, B)) != MP_OKAY) goto LBL_ERRa1; for (; count < (2 * B); count++) { a1.dp[count - B] = a->dp[count]; a1.used++; } mp_clamp(&a1); if ((err = mp_init_size(&a2, B + (a->used - (3 * B)))) != MP_OKAY) goto LBL_ERRa2; for (; count < a->used; count++) { a2.dp[count - (2 * B)] = a->dp[count]; a2.used++; } mp_clamp(&a2); /** b = b2 * x^2 + b1 * x + b0; */ if ((err = mp_init_size(&b0, B)) != MP_OKAY) goto LBL_ERRb0; for (count = 0; count < B; count++) { b0.dp[count] = b->dp[count]; b0.used++; } mp_clamp(&b0); if ((err = mp_init_size(&b1, B)) != MP_OKAY) goto LBL_ERRb1; for (; count < (2 * B); count++) { b1.dp[count - B] = b->dp[count]; b1.used++; } mp_clamp(&b1); if ((err = mp_init_size(&b2, B + (b->used - (3 * B)))) != MP_OKAY) goto LBL_ERRb2; for (; count < b->used; count++) { b2.dp[count - (2 * B)] = b->dp[count]; b2.used++; } mp_clamp(&b2); /** \\ S1 = (a2+a1+a0) * (b2+b1+b0); */ /** T1 = a2 + a1; */ if ((err = mp_add(&a2, &a1, &T1)) != MP_OKAY) goto LBL_ERR; /** S2 = T1 + a0; */ if ((err = mp_add(&T1, &a0, &S2)) != MP_OKAY) goto LBL_ERR; /** c = b2 + b1; */ if ((err = mp_add(&b2, &b1, c)) != MP_OKAY) goto LBL_ERR; /** S1 = c + b0; */ if ((err = mp_add(c, &b0, &S1)) != MP_OKAY) goto LBL_ERR; /** S1 = S1 * S2; */ if ((err = mp_mul(&S1, &S2, &S1)) != MP_OKAY) goto LBL_ERR; /** \\S2 = (4*a2+2*a1+a0) * (4*b2+2*b1+b0); */ /** T1 = T1 + a2; */ if ((err = mp_add(&T1, &a2, &T1)) != MP_OKAY) goto LBL_ERR; /** T1 = T1 << 1; */ if ((err = mp_mul_2(&T1, &T1)) != MP_OKAY) goto LBL_ERR; /** T1 = T1 + a0; */ if ((err = mp_add(&T1, &a0, &T1)) != MP_OKAY) goto LBL_ERR; /** c = c + b2; */ if ((err = mp_add(c, &b2, c)) != MP_OKAY) goto LBL_ERR; /** c = c << 1; */ if ((err = mp_mul_2(c, c)) != MP_OKAY) goto LBL_ERR; /** c = c + b0; */ if ((err = mp_add(c, &b0, c)) != MP_OKAY) goto LBL_ERR; /** S2 = T1 * c; */ if ((err = mp_mul(&T1, c, &S2)) != MP_OKAY) goto LBL_ERR; /** \\S3 = (a2-a1+a0) * (b2-b1+b0); */ /** a1 = a2 - a1; */ if ((err = mp_sub(&a2, &a1, &a1)) != MP_OKAY) goto LBL_ERR; /** a1 = a1 + a0; */ if ((err = mp_add(&a1, &a0, &a1)) != MP_OKAY) goto LBL_ERR; /** b1 = b2 - b1; */ if ((err = mp_sub(&b2, &b1, &b1)) != MP_OKAY) goto LBL_ERR; /** b1 = b1 + b0; */ if ((err = mp_add(&b1, &b0, &b1)) != MP_OKAY) goto LBL_ERR; /** a1 = a1 * b1; */ if ((err = mp_mul(&a1, &b1, &a1)) != MP_OKAY) goto LBL_ERR; /** b1 = a2 * b2; */ if ((err = mp_mul(&a2, &b2, &b1)) != MP_OKAY) goto LBL_ERR; /** \\S2 = (S2 - S3)/3; */ /** S2 = S2 - a1; */ if ((err = mp_sub(&S2, &a1, &S2)) != MP_OKAY) goto LBL_ERR; /** S2 = S2 / 3; \\ this is an exact division */ if ((err = s_mp_div_3(&S2, &S2, NULL)) != MP_OKAY) goto LBL_ERR; /** a1 = S1 - a1; */ if ((err = mp_sub(&S1, &a1, &a1)) != MP_OKAY) goto LBL_ERR; /** a1 = a1 >> 1; */ if ((err = mp_div_2(&a1, &a1)) != MP_OKAY) goto LBL_ERR; /** a0 = a0 * b0; */ if ((err = mp_mul(&a0, &b0, &a0)) != MP_OKAY) goto LBL_ERR; /** S1 = S1 - a0; */ if ((err = mp_sub(&S1, &a0, &S1)) != MP_OKAY) goto LBL_ERR; /** S2 = S2 - S1; */ if ((err = mp_sub(&S2, &S1, &S2)) != MP_OKAY) goto LBL_ERR; /** S2 = S2 >> 1; */ if ((err = mp_div_2(&S2, &S2)) != MP_OKAY) goto LBL_ERR; /** S1 = S1 - a1; */ if ((err = mp_sub(&S1, &a1, &S1)) != MP_OKAY) goto LBL_ERR; /** S1 = S1 - b1; */ if ((err = mp_sub(&S1, &b1, &S1)) != MP_OKAY) goto LBL_ERR; /** T1 = b1 << 1; */ if ((err = mp_mul_2(&b1, &T1)) != MP_OKAY) goto LBL_ERR; /** S2 = S2 - T1; */ if ((err = mp_sub(&S2, &T1, &S2)) != MP_OKAY) goto LBL_ERR; /** a1 = a1 - S2; */ if ((err = mp_sub(&a1, &S2, &a1)) != MP_OKAY) goto LBL_ERR; /** P = b1*x^4+ S2*x^3+ S1*x^2+ a1*x + a0; */ if ((err = mp_lshd(&b1, 4 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(&S2, 3 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&b1, &S2, &b1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(&S1, 2 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&b1, &S1, &b1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_lshd(&a1, 1 * B)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&b1, &a1, &b1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&b1, &a0, c)) != MP_OKAY) goto LBL_ERR; /** a * b - P */ LBL_ERR: mp_clear(&b2); LBL_ERRb2: mp_clear(&b1); LBL_ERRb1: mp_clear(&b0); LBL_ERRb0: mp_clear(&a2); LBL_ERRa2: mp_clear(&a1); LBL_ERRa1: mp_clear(&a0); LBL_ERRa0: mp_clear_multi(&S1, &S2, &T1, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_sub.c0000664000175000017500000000336015076154263016355 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ mp_err s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c) { int olduse, min, max; mp_err err; /* find sizes */ min = b->used; max = a->used; /* init result */ if (c->alloc < max) { if ((err = mp_grow(c, max)) != MP_OKAY) { return err; } } olduse = c->used; c->used = max; { mp_digit u, *tmpa, *tmpb, *tmpc; int i; /* alias for digit pointers */ tmpa = a->dp; tmpb = b->dp; tmpc = c->dp; /* set carry to zero */ u = 0; for (i = 0; i < min; i++) { /* T[i] = A[i] - B[i] - U */ *tmpc = (*tmpa++ - *tmpb++) - u; /* U = carry bit of T[i] * Note this saves performing an AND operation since * if a carry does occur it will propagate all the way to the * MSB. As a result a single shift is enough to get the carry */ u = *tmpc >> (MP_SIZEOF_BITS(mp_digit) - 1u); /* Clear carry from T[i] */ *tmpc++ &= MP_MASK; } /* now copy higher words if any, e.g. if A has more digits than B */ for (; i < max; i++) { /* T[i] = A[i] - U */ *tmpc = *tmpa++ - u; /* U = carry bit of T[i] */ u = *tmpc >> (MP_SIZEOF_BITS(mp_digit) - 1u); /* Clear carry from T[i] */ *tmpc++ &= MP_MASK; } /* clear digits above used (since we may not have grown result above) */ MP_ZERO_DIGITS(tmpc, olduse - c->used); } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_sqr_fast.c0000664000175000017500000000467315076154263017416 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_SQR_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* the jist of squaring... * you do like mult except the offset of the tmpx [one that * starts closer to zero] can't equal the offset of tmpy. * So basically you set up iy like before then you min it with * (ty-tx) so that it never happens. You double all those * you add in the inner loop After that loop you do the squares and add them in. */ mp_err s_mp_sqr_fast(const mp_int *a, mp_int *b) { int olduse, pa, ix, iz; mp_digit W[MP_WARRAY], *tmpx; mp_word W1; mp_err err; /* grow the destination as required */ pa = a->used + a->used; if (b->alloc < pa) { if ((err = mp_grow(b, pa)) != MP_OKAY) { return err; } } /* number of output digits to produce */ W1 = 0; for (ix = 0; ix < pa; ix++) { int tx, ty, iy; mp_word _W; mp_digit *tmpy; /* clear counter */ _W = 0; /* get offsets into the two bignums */ ty = MP_MIN(a->used-1, ix); tx = ix - ty; /* setup temp aliases */ tmpx = a->dp + tx; tmpy = a->dp + ty; /* this is the number of times the loop will iterrate, essentially while (tx++ < a->used && ty-- >= 0) { ... } */ iy = MP_MIN(a->used-tx, ty+1); /* now for squaring tx can never equal ty * we halve the distance since they approach at a rate of 2x * and we have to round because odd cases need to be executed */ iy = MP_MIN(iy, ((ty-tx)+1)>>1); /* execute loop */ for (iz = 0; iz < iy; iz++) { _W += (mp_word)*tmpx++ * (mp_word)*tmpy--; } /* double the inner product and add carry */ _W = _W + _W + W1; /* even columns have the square term in them */ if (((unsigned)ix & 1u) == 0u) { _W += (mp_word)a->dp[ix>>1] * (mp_word)a->dp[ix>>1]; } /* store it */ W[ix] = (mp_digit)_W & MP_MASK; /* make next carry */ W1 = _W >> (mp_word)MP_DIGIT_BIT; } /* setup dest */ olduse = b->used; b->used = a->used+a->used; { mp_digit *tmpb; tmpb = b->dp; for (ix = 0; ix < pa; ix++) { *tmpb++ = W[ix] & MP_MASK; } /* clear unused digits [that existed in the old copy of c] */ MP_ZERO_DIGITS(tmpb, olduse - ix); } mp_clamp(b); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_sqr.c0000664000175000017500000000362415076154263016374 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ mp_err s_mp_sqr(const mp_int *a, mp_int *b) { mp_int t; int ix, iy, pa; mp_err err; mp_word r; mp_digit u, tmpx, *tmpt; pa = a->used; if ((err = mp_init_size(&t, (2 * pa) + 1)) != MP_OKAY) { return err; } /* default used is maximum possible size */ t.used = (2 * pa) + 1; for (ix = 0; ix < pa; ix++) { /* first calculate the digit at 2*ix */ /* calculate double precision result */ r = (mp_word)t.dp[2*ix] + ((mp_word)a->dp[ix] * (mp_word)a->dp[ix]); /* store lower part in result */ t.dp[ix+ix] = (mp_digit)(r & (mp_word)MP_MASK); /* get the carry */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); /* left hand side of A[ix] * A[iy] */ tmpx = a->dp[ix]; /* alias for where to store the results */ tmpt = t.dp + ((2 * ix) + 1); for (iy = ix + 1; iy < pa; iy++) { /* first calculate the product */ r = (mp_word)tmpx * (mp_word)a->dp[iy]; /* now calculate the double precision result, note we use * addition instead of *2 since it's easier to optimize */ r = (mp_word)*tmpt + r + r + (mp_word)u; /* store lower part */ *tmpt++ = (mp_digit)(r & (mp_word)MP_MASK); /* get carry */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); } /* propagate upwards */ while (u != 0uL) { r = (mp_word)*tmpt + (mp_word)u; *tmpt++ = (mp_digit)(r & (mp_word)MP_MASK); u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); } } mp_clamp(&t); mp_exch(&t, b); mp_clear(&t); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_reverse.c0000664000175000017500000000070015076154263017232 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_REVERSE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reverse an array, used for radix code */ void s_mp_reverse(unsigned char *s, size_t len) { size_t ix, iy; unsigned char t; ix = 0u; iy = len - 1u; while (ix < iy) { t = s[ix]; s[ix] = s[iy]; s[iy] = t; ++ix; --iy; } } #endif tcl9.0.3/libtommath/bn_s_mp_rand_platform.c0000664000175000017500000000735515104661341020414 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_RAND_PLATFORM_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* First the OS-specific special cases * - *BSD * - Windows */ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #define BN_S_READ_ARC4RANDOM_C static mp_err s_read_arc4random(void *p, size_t n) { arc4random_buf(p, n); return MP_OKAY; } #endif #if defined(_WIN32) || defined(_WIN32_WCE) #define BN_S_READ_WINCSP_C #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif #ifdef _WIN32_WCE #define UNDER_CE #define ARM #endif #define WIN32_LEAN_AND_MEAN #include #include static mp_err s_read_wincsp(void *p, size_t n) { static HCRYPTPROV hProv = 0; if (hProv == 0) { HCRYPTPROV h = 0; if (!CryptAcquireContext(&h, NULL, MS_DEF_PROV, PROV_RSA_FULL, (CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET)) && !CryptAcquireContext(&h, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) { return MP_ERR; } hProv = h; } return CryptGenRandom(hProv, (DWORD)n, (BYTE *)p) == TRUE ? MP_OKAY : MP_ERR; } #endif /* WIN32 */ #if !defined(BN_S_READ_WINCSP_C) && defined(__linux__) && defined(__GLIBC_PREREQ) #if __GLIBC_PREREQ(2, 25) #define BN_S_READ_GETRANDOM_C #include #include static mp_err s_read_getrandom(void *p, size_t n) { char *q = (char *)p; while (n > 0u) { ssize_t ret = getrandom(q, n, 0); if (ret < 0) { if (errno == EINTR) { continue; } return MP_ERR; } q += ret; n -= (size_t)ret; } return MP_OKAY; } #endif #endif /* We assume all platforms besides windows provide "/dev/urandom". * In case yours doesn't, define MP_NO_DEV_URANDOM at compile-time. */ #if !defined(BN_S_READ_WINCSP_C) && !defined(MP_NO_DEV_URANDOM) #define BN_S_READ_URANDOM_C #ifndef MP_DEV_URANDOM #define MP_DEV_URANDOM "/dev/urandom" #endif #include #include #include static mp_err s_read_urandom(void *p, size_t n) { int fd; char *q = (char *)p; do { fd = open(MP_DEV_URANDOM, O_RDONLY); } while ((fd == -1) && (errno == EINTR)); if (fd == -1) return MP_ERR; while (n > 0u) { ssize_t ret = read(fd, p, n); if (ret < 0) { if (errno == EINTR) { continue; } close(fd); return MP_ERR; } q += ret; n -= (size_t)ret; } close(fd); return MP_OKAY; } #endif #if defined(MP_PRNG_ENABLE_LTM_RNG) #define BN_S_READ_LTM_RNG unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void)); void (*ltm_rng_callback)(void); static mp_err s_read_ltm_rng(void *p, size_t n) { unsigned long res; if (ltm_rng == NULL) return MP_ERR; res = ltm_rng(p, n, ltm_rng_callback); if (res != n) return MP_ERR; return MP_OKAY; } #endif mp_err s_read_arc4random(void *p, size_t n); mp_err s_read_wincsp(void *p, size_t n); mp_err s_read_getrandom(void *p, size_t n); mp_err s_read_urandom(void *p, size_t n); mp_err s_read_ltm_rng(void *p, size_t n); mp_err s_mp_rand_platform(void *p, size_t n) { mp_err err = MP_ERR; if ((err != MP_OKAY) && MP_HAS(S_READ_ARC4RANDOM)) err = s_read_arc4random(p, n); if ((err != MP_OKAY) && MP_HAS(S_READ_WINCSP)) err = s_read_wincsp(p, n); if ((err != MP_OKAY) && MP_HAS(S_READ_GETRANDOM)) err = s_read_getrandom(p, n); if ((err != MP_OKAY) && MP_HAS(S_READ_URANDOM)) err = s_read_urandom(p, n); if ((err != MP_OKAY) && MP_HAS(S_READ_LTM_RNG)) err = s_read_ltm_rng(p, n); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_rand_jenkins.c0000664000175000017500000000232115104661341020215 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_RAND_JENKINS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Bob Jenkins' http://burtleburtle.net/bob/rand/smallprng.html */ /* Chosen for speed and a good "mix" */ typedef struct { uint64_t a; uint64_t b; uint64_t c; uint64_t d; } ranctx; static ranctx jenkins_x; #define rot(x,k) (((x)<<(k))|((x)>>(64-(k)))) static uint64_t s_rand_jenkins_val(void) { uint64_t e = jenkins_x.a - rot(jenkins_x.b, 7); jenkins_x.a = jenkins_x.b ^ rot(jenkins_x.c, 13); jenkins_x.b = jenkins_x.c + rot(jenkins_x.d, 37); jenkins_x.c = jenkins_x.d + e; jenkins_x.d = e + jenkins_x.a; return jenkins_x.d; } void s_mp_rand_jenkins_init(uint64_t seed) { int i; jenkins_x.a = 0xf1ea5eedULL; jenkins_x.b = jenkins_x.c = jenkins_x.d = seed; for (i = 0; i < 20; ++i) { (void)s_rand_jenkins_val(); } } mp_err s_mp_rand_jenkins(void *p, size_t n) { char *q = (char *)p; while (n > 0u) { int i; uint64_t x = s_rand_jenkins_val(); for (i = 0; (i < 8) && (n > 0u); ++i, --n) { *q++ = (char)(x & 0xFFuLL); x >>= 8; } } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_prime_is_divisible.c0000664000175000017500000000146715104661341021423 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_PRIME_IS_DIVISIBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines if an integers is divisible by one * of the first PRIME_SIZE primes or not * * sets result to 0 if not, 1 if yes */ mp_err s_mp_prime_is_divisible(const mp_int *a, mp_bool *result) { int ix; mp_err err; mp_digit res; /* default to not */ *result = MP_NO; for (ix = 0; ix < PRIVATE_MP_PRIME_TAB_SIZE; ix++) { /* what is a mod LBL_prime_tab[ix] */ if ((err = mp_mod_d(a, s_mp_prime_tab[ix], &res)) != MP_OKAY) { return err; } /* is the residue zero? */ if (res == 0u) { *result = MP_YES; return MP_OKAY; } } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_mul_high_digs_fast.c0000664000175000017500000000415415104661341021375 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_MUL_HIGH_DIGS_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* this is a modified version of s_mp_mul_digs_fast that only produces * output digits *above* digs. See the comments for s_mp_mul_digs_fast * to see how it works. * * This is used in the Barrett reduction since for one of the multiplications * only the higher digits were needed. This essentially halves the work. * * Based on Algorithm 14.12 on pp.595 of HAC. */ mp_err s_mp_mul_high_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) { int olduse, pa, ix, iz; mp_err err; mp_digit W[MP_WARRAY]; mp_word _W; if (digs < 0) { return MP_VAL; } /* grow the destination as required */ pa = a->used + b->used; if (c->alloc < pa) { if ((err = mp_grow(c, pa)) != MP_OKAY) { return err; } } /* number of output digits to produce */ pa = a->used + b->used; _W = 0; for (ix = digs; ix < pa; ix++) { int tx, ty, iy; mp_digit *tmpx, *tmpy; /* get offsets into the two bignums */ ty = MP_MIN(b->used-1, ix); tx = ix - ty; /* setup temp aliases */ tmpx = a->dp + tx; tmpy = b->dp + ty; /* this is the number of times the loop will iterrate, essentially its while (tx++ < a->used && ty-- >= 0) { ... } */ iy = MP_MIN(a->used-tx, ty+1); /* execute loop */ for (iz = 0; iz < iy; iz++) { _W += (mp_word)*tmpx++ * (mp_word)*tmpy--; } /* store term */ W[ix] = (mp_digit)_W & MP_MASK; /* make next carry */ _W = _W >> (mp_word)MP_DIGIT_BIT; } /* setup dest */ olduse = c->used; c->used = pa; { mp_digit *tmpc; tmpc = c->dp + digs; for (ix = digs; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; } /* clear unused digits [that existed in the old copy of c] */ MP_ZERO_DIGITS(tmpc, olduse - ix); } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_mul_high_digs.c0000664000175000017500000000340015104661341020351 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_MUL_HIGH_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* multiplies |a| * |b| and does not compute the lower digs digits * [meant to get the higher part of the product] */ mp_err s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) { mp_int t; int pa, pb, ix, iy; mp_err err; mp_digit u; mp_word r; mp_digit tmpx, *tmpt, *tmpy; if (digs < 0) { return MP_VAL; } /* can we use the fast multiplier? */ if (MP_HAS(S_MP_MUL_HIGH_DIGS_FAST) && ((a->used + b->used + 1) < MP_WARRAY) && (MP_MIN(a->used, b->used) < MP_MAXFAST)) { return s_mp_mul_high_digs_fast(a, b, c, digs); } if ((err = mp_init_size(&t, a->used + b->used + 1)) != MP_OKAY) { return err; } t.used = a->used + b->used + 1; pa = a->used; pb = b->used; for (ix = 0; ix < pa; ix++) { /* clear the carry */ u = 0; /* left hand side of A[ix] * B[iy] */ tmpx = a->dp[ix]; /* alias to the address of where the digits will be stored */ tmpt = &(t.dp[digs]); /* alias for where to read the right hand side from */ tmpy = b->dp + (digs - ix); for (iy = digs - ix; iy < pb; iy++) { /* calculate the double precision result */ r = (mp_word)*tmpt + ((mp_word)tmpx * (mp_word)*tmpy++) + (mp_word)u; /* get the lower part */ *tmpt++ = (mp_digit)(r & (mp_word)MP_MASK); /* carry the carry */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); } *tmpt = u; } mp_clamp(&t); mp_exch(&t, c); mp_clear(&t); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_mul_digs_fast.c0000664000175000017500000000451515076154263020407 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_MUL_DIGS_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Fast (comba) multiplier * * This is the fast column-array [comba] multiplier. It is * designed to compute the columns of the product first * then handle the carries afterwards. This has the effect * of making the nested loops that compute the columns very * simple and schedulable on super-scalar processors. * * This has been modified to produce a variable number of * digits of output so if say only a half-product is required * you don't have to compute the upper half (a feature * required for fast Barrett reduction). * * Based on Algorithm 14.12 on pp.595 of HAC. * */ mp_err s_mp_mul_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) { int olduse, pa, ix, iz; mp_err err; mp_digit W[MP_WARRAY]; mp_word _W; if (digs < 0) { return MP_VAL; } /* grow the destination as required */ if (c->alloc < digs) { if ((err = mp_grow(c, digs)) != MP_OKAY) { return err; } } /* number of output digits to produce */ pa = MP_MIN(digs, a->used + b->used); /* clear the carry */ _W = 0; for (ix = 0; ix < pa; ix++) { int tx, ty; int iy; mp_digit *tmpx, *tmpy; /* get offsets into the two bignums */ ty = MP_MIN(b->used-1, ix); tx = ix - ty; /* setup temp aliases */ tmpx = a->dp + tx; tmpy = b->dp + ty; /* this is the number of times the loop will iterrate, essentially while (tx++ < a->used && ty-- >= 0) { ... } */ iy = MP_MIN(a->used-tx, ty+1); /* execute loop */ for (iz = 0; iz < iy; ++iz) { _W += (mp_word)*tmpx++ * (mp_word)*tmpy--; } /* store term */ W[ix] = (mp_digit)_W & MP_MASK; /* make next carry */ _W = _W >> (mp_word)MP_DIGIT_BIT; } /* setup dest */ olduse = c->used; c->used = pa; { mp_digit *tmpc; tmpc = c->dp; for (ix = 0; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; } /* clear unused digits [that existed in the old copy of c] */ MP_ZERO_DIGITS(tmpc, olduse - ix); } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_mul_digs.c0000664000175000017500000000403315076154263017365 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_MUL_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* multiplies |a| * |b| and only computes upto digs digits of result * HAC pp. 595, Algorithm 14.12 Modified so you can control how * many digits of output are created. */ mp_err s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) { mp_int t; mp_err err; int pa, pb, ix, iy; mp_digit u; mp_word r; mp_digit tmpx, *tmpt, *tmpy; if (digs < 0) { return MP_VAL; } /* can we use the fast multiplier? */ if ((digs < MP_WARRAY) && (MP_MIN(a->used, b->used) < MP_MAXFAST)) { return s_mp_mul_digs_fast(a, b, c, digs); } if ((err = mp_init_size(&t, digs)) != MP_OKAY) { return err; } t.used = digs; /* compute the digits of the product directly */ pa = a->used; for (ix = 0; ix < pa; ix++) { /* set the carry to zero */ u = 0; /* limit ourselves to making digs digits of output */ pb = MP_MIN(b->used, digs - ix); /* setup some aliases */ /* copy of the digit from a used within the nested loop */ tmpx = a->dp[ix]; /* an alias for the destination shifted ix places */ tmpt = t.dp + ix; /* an alias for the digits of b */ tmpy = b->dp; /* compute the columns of the output and propagate the carry */ for (iy = 0; iy < pb; iy++) { /* compute the column as a mp_word */ r = (mp_word)*tmpt + ((mp_word)tmpx * (mp_word)*tmpy++) + (mp_word)u; /* the new column is the lower part of the result */ *tmpt++ = (mp_digit)(r & (mp_word)MP_MASK); /* get the carry word from the result */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); } /* set carry if it is placed below digs */ if ((ix + iy) < digs) { *tmpt = u; } } mp_clamp(&t); mp_exch(&t, c); mp_clear(&t); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_montgomery_reduce_fast.c0000664000175000017500000001041415104661341022316 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_MONTGOMERY_REDUCE_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes xR**-1 == x (mod N) via Montgomery Reduction * * This is an optimized implementation of montgomery_reduce * which uses the comba method to quickly calculate the columns of the * reduction. * * Based on Algorithm 14.32 on pp.601 of HAC. */ mp_err s_mp_montgomery_reduce_fast(mp_int *x, const mp_int *n, mp_digit rho) { int ix, olduse; mp_err err; mp_word W[MP_WARRAY]; if (x->used > MP_WARRAY) { return MP_VAL; } /* get old used count */ olduse = x->used; /* grow a as required */ if (x->alloc < (n->used + 1)) { if ((err = mp_grow(x, n->used + 1)) != MP_OKAY) { return err; } } /* first we have to get the digits of the input into * an array of double precision words W[...] */ { mp_word *_W; mp_digit *tmpx; /* alias for the W[] array */ _W = W; /* alias for the digits of x*/ tmpx = x->dp; /* copy the digits of a into W[0..a->used-1] */ for (ix = 0; ix < x->used; ix++) { *_W++ = *tmpx++; } /* zero the high words of W[a->used..m->used*2] */ if (ix < ((n->used * 2) + 1)) { MP_ZERO_BUFFER(_W, sizeof(mp_word) * (size_t)(((n->used * 2) + 1) - ix)); } } /* now we proceed to zero successive digits * from the least significant upwards */ for (ix = 0; ix < n->used; ix++) { /* mu = ai * m' mod b * * We avoid a double precision multiplication (which isn't required) * by casting the value down to a mp_digit. Note this requires * that W[ix-1] have the carry cleared (see after the inner loop) */ mp_digit mu; mu = ((W[ix] & MP_MASK) * rho) & MP_MASK; /* a = a + mu * m * b**i * * This is computed in place and on the fly. The multiplication * by b**i is handled by offseting which columns the results * are added to. * * Note the comba method normally doesn't handle carries in the * inner loop In this case we fix the carry from the previous * column since the Montgomery reduction requires digits of the * result (so far) [see above] to work. This is * handled by fixing up one carry after the inner loop. The * carry fixups are done in order so after these loops the * first m->used words of W[] have the carries fixed */ { int iy; mp_digit *tmpn; mp_word *_W; /* alias for the digits of the modulus */ tmpn = n->dp; /* Alias for the columns set by an offset of ix */ _W = W + ix; /* inner loop */ for (iy = 0; iy < n->used; iy++) { *_W++ += (mp_word)mu * (mp_word)*tmpn++; } } /* now fix carry for next digit, W[ix+1] */ W[ix + 1] += W[ix] >> (mp_word)MP_DIGIT_BIT; } /* now we have to propagate the carries and * shift the words downward [all those least * significant digits we zeroed]. */ { mp_digit *tmpx; mp_word *_W, *_W1; /* nox fix rest of carries */ /* alias for current word */ _W1 = W + ix; /* alias for next word, where the carry goes */ _W = W + ++ix; for (; ix < ((n->used * 2) + 1); ix++) { *_W++ += *_W1++ >> (mp_word)MP_DIGIT_BIT; } /* copy out, A = A/b**n * * The result is A/b**n but instead of converting from an * array of mp_word to mp_digit than calling mp_rshd * we just copy them in the right order */ /* alias for destination word */ tmpx = x->dp; /* alias for shifted double precision result */ _W = W + n->used; for (ix = 0; ix < (n->used + 1); ix++) { *tmpx++ = *_W++ & (mp_word)MP_MASK; } /* zero oldused digits, if the input a was larger than * m->used+1 we'll have to clear the digits */ MP_ZERO_DIGITS(tmpx, olduse - ix); } /* set the max used and clamp */ x->used = n->used + 1; mp_clamp(x); /* if A >= m then A = A - m */ if (mp_cmp_mag(x, n) != MP_LT) { return s_mp_sub(x, n, x); } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_s_mp_log_d.c0000664000175000017500000000240615104661341016640 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_LOG_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ static mp_word s_pow(mp_word base, mp_word exponent) { mp_word result = 1u; while (exponent != 0u) { if ((exponent & 1u) == 1u) { result *= base; } exponent >>= 1; base *= base; } return result; } int s_mp_log_d(mp_digit base, mp_digit n) { mp_word bracket_low = 1uLL, bracket_high = base, N = n; int ret, high = 1, low = 0; if (n < base) { return 0; } if (n == base) { return 1; } while (bracket_high < N) { low = high; bracket_low = bracket_high; high <<= 1; bracket_high *= bracket_high; } while (((mp_digit)(high - low)) > 1uL) { int mid = (low + high) >> 1; mp_word bracket_mid = bracket_low * s_pow(base, (mp_word)(mid - low)); if (N < bracket_mid) { high = mid ; bracket_high = bracket_mid ; } if (N > bracket_mid) { low = mid ; bracket_low = bracket_mid ; } if (N == bracket_mid) { return mid; } } if (bracket_high == N) { ret = high; } else { ret = low; } return ret; } #endif tcl9.0.3/libtommath/bn_s_mp_log_2expt.c0000664000175000017500000000051115104661341017452 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_LOG_2EXPT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ int s_mp_log_2expt(const mp_int *a, mp_digit base) { int y; for (y = 0; (base & 1) == 0; y++, base >>= 1) {} return (mp_count_bits(a) - 1) / y; } #endif tcl9.0.3/libtommath/bn_s_mp_log.c0000664000175000017500000000405715104661341016341 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_LOG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_err s_mp_log(const mp_int *a, mp_digit base, int *c) { mp_err err; int high, low; mp_int bracket_low, bracket_high, bracket_mid, t, bi_base; mp_ord cmp = mp_cmp_d(a, base); if ((cmp == MP_LT) || (cmp == MP_EQ)) { *c = cmp == MP_EQ; return MP_OKAY; } if ((err = mp_init_multi(&bracket_low, &bracket_high, &bracket_mid, &t, &bi_base, (void *)NULL)) != MP_OKAY) { return err; } low = 0; mp_set(&bracket_low, 1uL); high = 1; mp_set(&bracket_high, base); /* A kind of Giant-step/baby-step algorithm. Idea shamelessly stolen from https://programmingpraxis.com/2010/05/07/integer-logarithms/2/ The effect is asymptotic, hence needs benchmarks to test if the Giant-step should be skipped for small n. */ while (mp_cmp(&bracket_high, a) == MP_LT) { low = high; if ((err = mp_copy(&bracket_high, &bracket_low)) != MP_OKAY) { goto LBL_END; } high <<= 1; if ((err = mp_sqr(&bracket_high, &bracket_high)) != MP_OKAY) { goto LBL_END; } } mp_set(&bi_base, base); while ((high - low) > 1) { int mid = (high + low) >> 1; if ((err = mp_expt_n(&bi_base, mid - low, &t)) != MP_OKAY) { goto LBL_END; } if ((err = mp_mul(&bracket_low, &t, &bracket_mid)) != MP_OKAY) { goto LBL_END; } cmp = mp_cmp(a, &bracket_mid); if (cmp == MP_LT) { high = mid; mp_exch(&bracket_mid, &bracket_high); } if (cmp == MP_GT) { low = mid; mp_exch(&bracket_mid, &bracket_low); } if (cmp == MP_EQ) { *c = mid; goto LBL_END; } } *c = (mp_cmp(&bracket_high, a) == MP_EQ) ? high : low; LBL_END: mp_clear_multi(&bracket_low, &bracket_high, &bracket_mid, &t, &bi_base, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_karatsuba_sqr.c0000664000175000017500000000514315076154262020426 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_KARATSUBA_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Karatsuba squaring, computes b = a*a using three * half size squarings * * See comments of karatsuba_mul for details. It * is essentially the same algorithm but merely * tuned to perform recursive squarings. */ mp_err s_mp_karatsuba_sqr(const mp_int *a, mp_int *b) { mp_int x0, x1, t1, t2, x0x0, x1x1; int B; mp_err err = MP_MEM; /* min # of digits */ B = a->used; /* now divide in two */ B = B >> 1; /* init copy all the temps */ if (mp_init_size(&x0, B) != MP_OKAY) goto LBL_ERR; if (mp_init_size(&x1, a->used - B) != MP_OKAY) goto X0; /* init temps */ if (mp_init_size(&t1, a->used * 2) != MP_OKAY) goto X1; if (mp_init_size(&t2, a->used * 2) != MP_OKAY) goto T1; if (mp_init_size(&x0x0, B * 2) != MP_OKAY) goto T2; if (mp_init_size(&x1x1, (a->used - B) * 2) != MP_OKAY) goto X0X0; { int x; mp_digit *dst, *src; src = a->dp; /* now shift the digits */ dst = x0.dp; for (x = 0; x < B; x++) { *dst++ = *src++; } dst = x1.dp; for (x = B; x < a->used; x++) { *dst++ = *src++; } } x0.used = B; x1.used = a->used - B; mp_clamp(&x0); /* now calc the products x0*x0 and x1*x1 */ if (mp_sqr(&x0, &x0x0) != MP_OKAY) goto X1X1; /* x0x0 = x0*x0 */ if (mp_sqr(&x1, &x1x1) != MP_OKAY) goto X1X1; /* x1x1 = x1*x1 */ /* now calc (x1+x0)**2 */ if (s_mp_add(&x1, &x0, &t1) != MP_OKAY) goto X1X1; /* t1 = x1 - x0 */ if (mp_sqr(&t1, &t1) != MP_OKAY) goto X1X1; /* t1 = (x1 - x0) * (x1 - x0) */ /* add x0y0 */ if (s_mp_add(&x0x0, &x1x1, &t2) != MP_OKAY) goto X1X1; /* t2 = x0x0 + x1x1 */ if (s_mp_sub(&t1, &t2, &t1) != MP_OKAY) goto X1X1; /* t1 = (x1+x0)**2 - (x0x0 + x1x1) */ /* shift by B */ if (mp_lshd(&t1, B) != MP_OKAY) goto X1X1; /* t1 = (x0x0 + x1x1 - (x1-x0)*(x1-x0))< a1b1 * B**2n + ((a1 + a0)(b1 + b0) - (a0b0 + a1b1)) * B + a0b0 * * Note that a1b1 and a0b0 are used twice and only need to be * computed once. So in total three half size (half # of * digit) multiplications are performed, a0b0, a1b1 and * (a1+b1)(a0+b0) * * Note that a multiplication of half the digits requires * 1/4th the number of single precision multiplications so in * total after one call 25% of the single precision multiplications * are saved. Note also that the call to mp_mul can end up back * in this function if the a0, a1, b0, or b1 are above the threshold. * This is known as divide-and-conquer and leads to the famous * O(N**lg(3)) or O(N**1.584) work which is asymptopically lower than * the standard O(N**2) that the baseline/comba methods use. * Generally though the overhead of this method doesn't pay off * until a certain size (N ~ 80) is reached. */ mp_err s_mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c) { mp_int x0, x1, y0, y1, t1, x0y0, x1y1; int B; mp_err err = MP_MEM; /* default the return code to an error */ /* min # of digits */ B = MP_MIN(a->used, b->used); /* now divide in two */ B = B >> 1; /* init copy all the temps */ if (mp_init_size(&x0, B) != MP_OKAY) { goto LBL_ERR; } if (mp_init_size(&x1, a->used - B) != MP_OKAY) { goto X0; } if (mp_init_size(&y0, B) != MP_OKAY) { goto X1; } if (mp_init_size(&y1, b->used - B) != MP_OKAY) { goto Y0; } /* init temps */ if (mp_init_size(&t1, B * 2) != MP_OKAY) { goto Y1; } if (mp_init_size(&x0y0, B * 2) != MP_OKAY) { goto T1; } if (mp_init_size(&x1y1, B * 2) != MP_OKAY) { goto X0Y0; } /* now shift the digits */ x0.used = y0.used = B; x1.used = a->used - B; y1.used = b->used - B; { int x; mp_digit *tmpa, *tmpb, *tmpx, *tmpy; /* we copy the digits directly instead of using higher level functions * since we also need to shift the digits */ tmpa = a->dp; tmpb = b->dp; tmpx = x0.dp; tmpy = y0.dp; for (x = 0; x < B; x++) { *tmpx++ = *tmpa++; *tmpy++ = *tmpb++; } tmpx = x1.dp; for (x = B; x < a->used; x++) { *tmpx++ = *tmpa++; } tmpy = y1.dp; for (x = B; x < b->used; x++) { *tmpy++ = *tmpb++; } } /* only need to clamp the lower words since by definition the * upper words x1/y1 must have a known number of digits */ mp_clamp(&x0); mp_clamp(&y0); /* now calc the products x0y0 and x1y1 */ /* after this x0 is no longer required, free temp [x0==t2]! */ if (mp_mul(&x0, &y0, &x0y0) != MP_OKAY) { goto X1Y1; /* x0y0 = x0*y0 */ } if (mp_mul(&x1, &y1, &x1y1) != MP_OKAY) { goto X1Y1; /* x1y1 = x1*y1 */ } /* now calc x1+x0 and y1+y0 */ if (s_mp_add(&x1, &x0, &t1) != MP_OKAY) { goto X1Y1; /* t1 = x1 - x0 */ } if (s_mp_add(&y1, &y0, &x0) != MP_OKAY) { goto X1Y1; /* t2 = y1 - y0 */ } if (mp_mul(&t1, &x0, &t1) != MP_OKAY) { goto X1Y1; /* t1 = (x1 + x0) * (y1 + y0) */ } /* add x0y0 */ if (mp_add(&x0y0, &x1y1, &x0) != MP_OKAY) { goto X1Y1; /* t2 = x0y0 + x1y1 */ } if (s_mp_sub(&t1, &x0, &t1) != MP_OKAY) { goto X1Y1; /* t1 = (x1+x0)*(y1+y0) - (x1y1 + x0y0) */ } /* shift by B */ if (mp_lshd(&t1, B) != MP_OKAY) { goto X1Y1; /* t1 = (x0y0 + x1y1 - (x1-x0)*(y1-y0))<sign == MP_NEG) || MP_IS_ZERO(b)) { return MP_VAL; } /* init temps */ if ((err = mp_init_multi(&x, &y, &u, &v, &A, &B, &C, &D, (void *)NULL)) != MP_OKAY) { return err; } /* x = a, y = b */ if ((err = mp_mod(a, b, &x)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(b, &y)) != MP_OKAY) goto LBL_ERR; /* 2. [modified] if x,y are both even then return an error! */ if (MP_IS_EVEN(&x) && MP_IS_EVEN(&y)) { err = MP_VAL; goto LBL_ERR; } /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */ if ((err = mp_copy(&x, &u)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&y, &v)) != MP_OKAY) goto LBL_ERR; mp_set(&A, 1uL); mp_set(&D, 1uL); top: /* 4. while u is even do */ while (MP_IS_EVEN(&u)) { /* 4.1 u = u/2 */ if ((err = mp_div_2(&u, &u)) != MP_OKAY) goto LBL_ERR; /* 4.2 if A or B is odd then */ if (MP_IS_ODD(&A) || MP_IS_ODD(&B)) { /* A = (A+y)/2, B = (B-x)/2 */ if ((err = mp_add(&A, &y, &A)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&B, &x, &B)) != MP_OKAY) goto LBL_ERR; } /* A = A/2, B = B/2 */ if ((err = mp_div_2(&A, &A)) != MP_OKAY) goto LBL_ERR; if ((err = mp_div_2(&B, &B)) != MP_OKAY) goto LBL_ERR; } /* 5. while v is even do */ while (MP_IS_EVEN(&v)) { /* 5.1 v = v/2 */ if ((err = mp_div_2(&v, &v)) != MP_OKAY) goto LBL_ERR; /* 5.2 if C or D is odd then */ if (MP_IS_ODD(&C) || MP_IS_ODD(&D)) { /* C = (C+y)/2, D = (D-x)/2 */ if ((err = mp_add(&C, &y, &C)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&D, &x, &D)) != MP_OKAY) goto LBL_ERR; } /* C = C/2, D = D/2 */ if ((err = mp_div_2(&C, &C)) != MP_OKAY) goto LBL_ERR; if ((err = mp_div_2(&D, &D)) != MP_OKAY) goto LBL_ERR; } /* 6. if u >= v then */ if (mp_cmp(&u, &v) != MP_LT) { /* u = u - v, A = A - C, B = B - D */ if ((err = mp_sub(&u, &v, &u)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&A, &C, &A)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&B, &D, &B)) != MP_OKAY) goto LBL_ERR; } else { /* v - v - u, C = C - A, D = D - B */ if ((err = mp_sub(&v, &u, &v)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&C, &A, &C)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&D, &B, &D)) != MP_OKAY) goto LBL_ERR; } /* if not zero goto step 4 */ if (!MP_IS_ZERO(&u)) { goto top; } /* now a = C, b = D, gcd == g*v */ /* if v != 1 then there is no inverse */ if (mp_cmp_d(&v, 1uL) != MP_EQ) { err = MP_VAL; goto LBL_ERR; } /* if its too low */ while (mp_cmp_d(&C, 0uL) == MP_LT) { if ((err = mp_add(&C, b, &C)) != MP_OKAY) goto LBL_ERR; } /* too big */ while (mp_cmp_mag(&C, b) != MP_LT) { if ((err = mp_sub(&C, b, &C)) != MP_OKAY) goto LBL_ERR; } /* C is now the inverse */ mp_exch(&C, c); err = MP_OKAY; LBL_ERR: mp_clear_multi(&x, &y, &u, &v, &A, &B, &C, &D, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_invmod_fast.c0000664000175000017500000000645215104661341020072 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_INVMOD_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes the modular inverse via binary extended euclidean algorithm, * that is c = 1/a mod b * * Based on slow invmod except this is optimized for the case where b is * odd as per HAC Note 14.64 on pp. 610 */ mp_err s_mp_invmod_fast(const mp_int *a, const mp_int *b, mp_int *c) { mp_int x, y, u, v, B, D; mp_sign neg; mp_err err; /* 2. [modified] b must be odd */ if (MP_IS_EVEN(b)) { return MP_VAL; } /* init all our temps */ if ((err = mp_init_multi(&x, &y, &u, &v, &B, &D, (void *)NULL)) != MP_OKAY) { return err; } /* x == modulus, y == value to invert */ if ((err = mp_copy(b, &x)) != MP_OKAY) goto LBL_ERR; /* we need y = |a| */ if ((err = mp_mod(a, b, &y)) != MP_OKAY) goto LBL_ERR; /* if one of x,y is zero return an error! */ if (MP_IS_ZERO(&x) || MP_IS_ZERO(&y)) { err = MP_VAL; goto LBL_ERR; } /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */ if ((err = mp_copy(&x, &u)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&y, &v)) != MP_OKAY) goto LBL_ERR; mp_set(&D, 1uL); top: /* 4. while u is even do */ while (MP_IS_EVEN(&u)) { /* 4.1 u = u/2 */ if ((err = mp_div_2(&u, &u)) != MP_OKAY) goto LBL_ERR; /* 4.2 if B is odd then */ if (MP_IS_ODD(&B)) { if ((err = mp_sub(&B, &x, &B)) != MP_OKAY) goto LBL_ERR; } /* B = B/2 */ if ((err = mp_div_2(&B, &B)) != MP_OKAY) goto LBL_ERR; } /* 5. while v is even do */ while (MP_IS_EVEN(&v)) { /* 5.1 v = v/2 */ if ((err = mp_div_2(&v, &v)) != MP_OKAY) goto LBL_ERR; /* 5.2 if D is odd then */ if (MP_IS_ODD(&D)) { /* D = (D-x)/2 */ if ((err = mp_sub(&D, &x, &D)) != MP_OKAY) goto LBL_ERR; } /* D = D/2 */ if ((err = mp_div_2(&D, &D)) != MP_OKAY) goto LBL_ERR; } /* 6. if u >= v then */ if (mp_cmp(&u, &v) != MP_LT) { /* u = u - v, B = B - D */ if ((err = mp_sub(&u, &v, &u)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&B, &D, &B)) != MP_OKAY) goto LBL_ERR; } else { /* v - v - u, D = D - B */ if ((err = mp_sub(&v, &u, &v)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&D, &B, &D)) != MP_OKAY) goto LBL_ERR; } /* if not zero goto step 4 */ if (!MP_IS_ZERO(&u)) { goto top; } /* now a = C, b = D, gcd == g*v */ /* if v != 1 then there is no inverse */ if (mp_cmp_d(&v, 1uL) != MP_EQ) { err = MP_VAL; goto LBL_ERR; } /* b is now the inverse */ neg = a->sign; while (D.sign == MP_NEG) { if ((err = mp_add(&D, b, &D)) != MP_OKAY) goto LBL_ERR; } /* too big */ while (mp_cmp_mag(&D, b) != MP_LT) { if ((err = mp_sub(&D, b, &D)) != MP_OKAY) goto LBL_ERR; } mp_exch(&D, c); c->sign = neg; err = MP_OKAY; LBL_ERR: mp_clear_multi(&x, &y, &u, &v, &B, &D, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_get_bit.c0000664000175000017500000000101115104661341017160 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_GET_BIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Get bit at position b and return MP_YES if the bit is 1, MP_NO if it is 0 */ mp_bool s_mp_get_bit(const mp_int *a, unsigned int b) { mp_digit bit; int limb = (int)(b / MP_DIGIT_BIT); if (limb >= a->used) { return MP_NO; } bit = (mp_digit)1 << (b % MP_DIGIT_BIT); return ((a->dp[limb] & bit) != 0u) ? MP_YES : MP_NO; } #endif tcl9.0.3/libtommath/bn_s_mp_exptmod_fast.c0000664000175000017500000001736015104661341020256 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_EXPTMOD_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85 * * Uses a left-to-right k-ary sliding window to compute the modular exponentiation. * The value of k changes based on the size of the exponent. * * Uses Montgomery or Diminished Radix reduction [whichever appropriate] */ #ifdef MP_LOW_MEM # define TAB_SIZE 32 # define MAX_WINSIZE 5 #else # define TAB_SIZE 256 # define MAX_WINSIZE 0 #endif mp_err s_mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) { mp_int M[TAB_SIZE], res; mp_digit buf, mp; int bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; mp_err err; /* use a pointer to the reduction algorithm. This allows us to use * one of many reduction algorithms without modding the guts of * the code with if statements everywhere. */ mp_err(*redux)(mp_int *x, const mp_int *n, mp_digit rho); /* find window size */ x = mp_count_bits(X); if (x <= 7) { winsize = 2; } else if (x <= 36) { winsize = 3; } else if (x <= 140) { winsize = 4; } else if (x <= 450) { winsize = 5; } else if (x <= 1303) { winsize = 6; } else if (x <= 3529) { winsize = 7; } else { winsize = 8; } winsize = MAX_WINSIZE ? MP_MIN(MAX_WINSIZE, winsize) : winsize; /* init M array */ /* init first cell */ if ((err = mp_init_size(&M[1], P->alloc)) != MP_OKAY) { return err; } /* now init the second half of the array */ for (x = 1<<(winsize-1); x < (1 << winsize); x++) { if ((err = mp_init_size(&M[x], P->alloc)) != MP_OKAY) { for (y = 1<<(winsize-1); y < x; y++) { mp_clear(&M[y]); } mp_clear(&M[1]); return err; } } /* determine and setup reduction code */ if (redmode == 0) { if (MP_HAS(MP_MONTGOMERY_SETUP)) { /* now setup montgomery */ if ((err = mp_montgomery_setup(P, &mp)) != MP_OKAY) goto LBL_M; } else { err = MP_VAL; goto LBL_M; } /* automatically pick the comba one if available (saves quite a few calls/ifs) */ if (MP_HAS(S_MP_MONTGOMERY_REDUCE_FAST) && (((P->used * 2) + 1) < MP_WARRAY) && (P->used < MP_MAXFAST)) { redux = s_mp_montgomery_reduce_fast; } else if (MP_HAS(MP_MONTGOMERY_REDUCE)) { /* use slower baseline Montgomery method */ redux = mp_montgomery_reduce; } else { err = MP_VAL; goto LBL_M; } } else if (redmode == 1) { if (MP_HAS(MP_DR_SETUP) && MP_HAS(MP_DR_REDUCE)) { /* setup DR reduction for moduli of the form B**k - b */ mp_dr_setup(P, &mp); redux = mp_dr_reduce; } else { err = MP_VAL; goto LBL_M; } } else if (MP_HAS(MP_REDUCE_2K_SETUP) && MP_HAS(MP_REDUCE_2K)) { /* setup DR reduction for moduli of the form 2**k - b */ if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) goto LBL_M; redux = mp_reduce_2k; } else { err = MP_VAL; goto LBL_M; } /* setup result */ if ((err = mp_init_size(&res, P->alloc)) != MP_OKAY) goto LBL_M; /* create M table * * * The first half of the table is not computed though accept for M[0] and M[1] */ if (redmode == 0) { if (MP_HAS(MP_MONTGOMERY_CALC_NORMALIZATION)) { /* now we need R mod m */ if ((err = mp_montgomery_calc_normalization(&res, P)) != MP_OKAY) goto LBL_RES; /* now set M[1] to G * R mod m */ if ((err = mp_mulmod(G, &res, P, &M[1])) != MP_OKAY) goto LBL_RES; } else { err = MP_VAL; goto LBL_RES; } } else { mp_set(&res, 1uL); if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) goto LBL_RES; } /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */ if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) goto LBL_RES; for (x = 0; x < (winsize - 1); x++) { if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) goto LBL_RES; if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, mp)) != MP_OKAY) goto LBL_RES; } /* create upper table */ for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { if ((err = mp_mul(&M[x - 1], &M[1], &M[x])) != MP_OKAY) goto LBL_RES; if ((err = redux(&M[x], P, mp)) != MP_OKAY) goto LBL_RES; } /* set initial mode and bit cnt */ mode = 0; bitcnt = 1; buf = 0; digidx = X->used - 1; bitcpy = 0; bitbuf = 0; for (;;) { /* grab next digit as required */ if (--bitcnt == 0) { /* if digidx == -1 we are out of digits so break */ if (digidx == -1) { break; } /* read next digit and reset bitcnt */ buf = X->dp[digidx--]; bitcnt = (int)MP_DIGIT_BIT; } /* grab the next msb from the exponent */ y = (mp_digit)(buf >> (MP_DIGIT_BIT - 1)) & 1uL; buf <<= (mp_digit)1; /* if the bit is zero and mode == 0 then we ignore it * These represent the leading zero bits before the first 1 bit * in the exponent. Technically this opt is not required but it * does lower the # of trivial squaring/reductions used */ if ((mode == 0) && (y == 0)) { continue; } /* if the bit is zero and mode == 1 then we square */ if ((mode == 1) && (y == 0)) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; continue; } /* else we add it to the window */ bitbuf |= (y << (winsize - ++bitcpy)); mode = 2; if (bitcpy == winsize) { /* ok window is filled so square as required and multiply */ /* square first */ for (x = 0; x < winsize; x++) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; } /* then multiply */ if ((err = mp_mul(&res, &M[bitbuf], &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; /* empty window and reset */ bitcpy = 0; bitbuf = 0; mode = 1; } } /* if bits remain then square/multiply */ if ((mode == 2) && (bitcpy > 0)) { /* square then multiply if the bit is set */ for (x = 0; x < bitcpy; x++) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; /* get next bit of the window */ bitbuf <<= 1; if ((bitbuf & (1 << winsize)) != 0) { /* then multiply */ if ((err = mp_mul(&res, &M[1], &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; } } } if (redmode == 0) { /* fixup result if Montgomery reduction is used * recall that any value in a Montgomery system is * actually multiplied by R mod n. So we have * to reduce one more time to cancel out the factor * of R. */ if ((err = redux(&res, P, mp)) != MP_OKAY) goto LBL_RES; } /* swap res with Y */ mp_exch(&res, Y); err = MP_OKAY; LBL_RES: mp_clear(&res); LBL_M: mp_clear(&M[1]); for (x = 1<<(winsize-1); x < (1 << winsize); x++) { mp_clear(&M[x]); } return err; } #endif tcl9.0.3/libtommath/bn_s_mp_exptmod.c0000664000175000017500000001340215104661341017232 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifdef MP_LOW_MEM # define TAB_SIZE 32 # define MAX_WINSIZE 5 #else # define TAB_SIZE 256 # define MAX_WINSIZE 0 #endif mp_err s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) { mp_int M[TAB_SIZE], res, mu; mp_digit buf; mp_err err; int bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; mp_err(*redux)(mp_int *x, const mp_int *m, const mp_int *mu); /* find window size */ x = mp_count_bits(X); if (x <= 7) { winsize = 2; } else if (x <= 36) { winsize = 3; } else if (x <= 140) { winsize = 4; } else if (x <= 450) { winsize = 5; } else if (x <= 1303) { winsize = 6; } else if (x <= 3529) { winsize = 7; } else { winsize = 8; } winsize = MAX_WINSIZE ? MP_MIN(MAX_WINSIZE, winsize) : winsize; /* init M array */ /* init first cell */ if ((err = mp_init(&M[1])) != MP_OKAY) { return err; } /* now init the second half of the array */ for (x = 1<<(winsize-1); x < (1 << winsize); x++) { if ((err = mp_init(&M[x])) != MP_OKAY) { for (y = 1<<(winsize-1); y < x; y++) { mp_clear(&M[y]); } mp_clear(&M[1]); return err; } } /* create mu, used for Barrett reduction */ if ((err = mp_init(&mu)) != MP_OKAY) goto LBL_M; if (redmode == 0) { if ((err = mp_reduce_setup(&mu, P)) != MP_OKAY) goto LBL_MU; redux = mp_reduce; } else { if ((err = mp_reduce_2k_setup_l(P, &mu)) != MP_OKAY) goto LBL_MU; redux = mp_reduce_2k_l; } /* create M table * * The M table contains powers of the base, * e.g. M[x] = G**x mod P * * The first half of the table is not * computed though accept for M[0] and M[1] */ if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) goto LBL_MU; /* compute the value at M[1<<(winsize-1)] by squaring * M[1] (winsize-1) times */ if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) goto LBL_MU; for (x = 0; x < (winsize - 1); x++) { /* square it */ if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) goto LBL_MU; /* reduce modulo P */ if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, &mu)) != MP_OKAY) goto LBL_MU; } /* create upper table, that is M[x] = M[x-1] * M[1] (mod P) * for x = (2**(winsize - 1) + 1) to (2**winsize - 1) */ for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { if ((err = mp_mul(&M[x - 1], &M[1], &M[x])) != MP_OKAY) goto LBL_MU; if ((err = redux(&M[x], P, &mu)) != MP_OKAY) goto LBL_MU; } /* setup result */ if ((err = mp_init(&res)) != MP_OKAY) goto LBL_MU; mp_set(&res, 1uL); /* set initial mode and bit cnt */ mode = 0; bitcnt = 1; buf = 0; digidx = X->used - 1; bitcpy = 0; bitbuf = 0; for (;;) { /* grab next digit as required */ if (--bitcnt == 0) { /* if digidx == -1 we are out of digits */ if (digidx == -1) { break; } /* read next digit and reset the bitcnt */ buf = X->dp[digidx--]; bitcnt = (int)MP_DIGIT_BIT; } /* grab the next msb from the exponent */ y = (buf >> (mp_digit)(MP_DIGIT_BIT - 1)) & 1uL; buf <<= (mp_digit)1; /* if the bit is zero and mode == 0 then we ignore it * These represent the leading zero bits before the first 1 bit * in the exponent. Technically this opt is not required but it * does lower the # of trivial squaring/reductions used */ if ((mode == 0) && (y == 0)) { continue; } /* if the bit is zero and mode == 1 then we square */ if ((mode == 1) && (y == 0)) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, &mu)) != MP_OKAY) goto LBL_RES; continue; } /* else we add it to the window */ bitbuf |= (y << (winsize - ++bitcpy)); mode = 2; if (bitcpy == winsize) { /* ok window is filled so square as required and multiply */ /* square first */ for (x = 0; x < winsize; x++) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, &mu)) != MP_OKAY) goto LBL_RES; } /* then multiply */ if ((err = mp_mul(&res, &M[bitbuf], &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, &mu)) != MP_OKAY) goto LBL_RES; /* empty window and reset */ bitcpy = 0; bitbuf = 0; mode = 1; } } /* if bits remain then square/multiply */ if ((mode == 2) && (bitcpy > 0)) { /* square then multiply if the bit is set */ for (x = 0; x < bitcpy; x++) { if ((err = mp_sqr(&res, &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, &mu)) != MP_OKAY) goto LBL_RES; bitbuf <<= 1; if ((bitbuf & (1 << winsize)) != 0) { /* then multiply */ if ((err = mp_mul(&res, &M[1], &res)) != MP_OKAY) goto LBL_RES; if ((err = redux(&res, P, &mu)) != MP_OKAY) goto LBL_RES; } } } mp_exch(&res, Y); err = MP_OKAY; LBL_RES: mp_clear(&res); LBL_MU: mp_clear(&mu); LBL_M: mp_clear(&M[1]); for (x = 1<<(winsize-1); x < (1 << winsize); x++) { mp_clear(&M[x]); } return err; } #endif tcl9.0.3/libtommath/bn_s_mp_div_3.c0000664000175000017500000000257615076154262016577 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_DIV_3_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* divide by three (based on routine from MPI and the GMP manual) */ mp_err s_mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) { mp_int q; mp_word w, t; mp_digit b; mp_err err; int ix; /* b = 2**MP_DIGIT_BIT / 3 */ b = ((mp_word)1 << (mp_word)MP_DIGIT_BIT) / (mp_word)3; if ((err = mp_init_size(&q, a->used)) != MP_OKAY) { return err; } q.used = a->used; q.sign = a->sign; w = 0; for (ix = a->used - 1; ix >= 0; ix--) { w = (w << (mp_word)MP_DIGIT_BIT) | (mp_word)a->dp[ix]; if (w >= 3u) { /* multiply w by [1/3] */ t = (w * (mp_word)b) >> (mp_word)MP_DIGIT_BIT; /* now subtract 3 * [w/3] from w, to get the remainder */ w -= t+t+t; /* fixup the remainder as required since * the optimization is not exact. */ while (w >= 3u) { t += 1u; w -= 3u; } } else { t = 0; } q.dp[ix] = (mp_digit)t; } /* [optional] store the remainder */ if (d != NULL) { *d = (mp_digit)w; } /* [optional] store the quotient */ if (c != NULL) { mp_clamp(&q); mp_exch(&q, c); } mp_clear(&q); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_balance_mul.c0000664000175000017500000000404315076154262020024 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_BALANCE_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* single-digit multiplication with the smaller number as the single-digit */ mp_err s_mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) { int count, len_a, len_b, nblocks, i, j, bsize; mp_int a0, tmp, A, B, r; mp_err err; len_a = a->used; len_b = b->used; nblocks = MP_MAX(a->used, b->used) / MP_MIN(a->used, b->used); bsize = MP_MIN(a->used, b->used) ; if ((err = mp_init_size(&a0, bsize + 2)) != MP_OKAY) { return err; } if ((err = mp_init_multi(&tmp, &r, (void *)NULL)) != MP_OKAY) { mp_clear(&a0); return err; } /* Make sure that A is the larger one*/ if (len_a < len_b) { B = *a; A = *b; } else { A = *a; B = *b; } for (i = 0, j=0; i < nblocks; i++) { /* Cut a slice off of a */ a0.used = 0; for (count = 0; count < bsize; count++) { a0.dp[count] = A.dp[ j++ ]; a0.used++; } mp_clamp(&a0); /* Multiply with b */ if ((err = mp_mul(&a0, &B, &tmp)) != MP_OKAY) { goto LBL_ERR; } /* Shift tmp to the correct position */ if ((err = mp_lshd(&tmp, bsize * i)) != MP_OKAY) { goto LBL_ERR; } /* Add to output. No carry needed */ if ((err = mp_add(&r, &tmp, &r)) != MP_OKAY) { goto LBL_ERR; } } /* The left-overs; there are always left-overs */ if (j < A.used) { a0.used = 0; for (count = 0; j < A.used; count++) { a0.dp[count] = A.dp[ j++ ]; a0.used++; } mp_clamp(&a0); if ((err = mp_mul(&a0, &B, &tmp)) != MP_OKAY) { goto LBL_ERR; } if ((err = mp_lshd(&tmp, bsize * i)) != MP_OKAY) { goto LBL_ERR; } if ((err = mp_add(&r, &tmp, &r)) != MP_OKAY) { goto LBL_ERR; } } mp_exch(&r,c); LBL_ERR: mp_clear_multi(&a0, &tmp, &r, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_s_mp_add.c0000664000175000017500000000401315076154262016307 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_S_MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ mp_err s_mp_add(const mp_int *a, const mp_int *b, mp_int *c) { const mp_int *x; mp_err err; int olduse, min, max; /* find sizes, we let |a| <= |b| which means we have to sort * them. "x" will point to the input with the most digits */ if (a->used > b->used) { min = b->used; max = a->used; x = a; } else { min = a->used; max = b->used; x = b; } /* init result */ if (c->alloc < (max + 1)) { if ((err = mp_grow(c, max + 1)) != MP_OKAY) { return err; } } /* get old used digit count and set new one */ olduse = c->used; c->used = max + 1; { mp_digit u, *tmpa, *tmpb, *tmpc; int i; /* alias for digit pointers */ /* first input */ tmpa = a->dp; /* second input */ tmpb = b->dp; /* destination */ tmpc = c->dp; /* zero the carry */ u = 0; for (i = 0; i < min; i++) { /* Compute the sum at one digit, T[i] = A[i] + B[i] + U */ *tmpc = *tmpa++ + *tmpb++ + u; /* U = carry bit of T[i] */ u = *tmpc >> (mp_digit)MP_DIGIT_BIT; /* take away carry bit from T[i] */ *tmpc++ &= MP_MASK; } /* now copy higher words if any, that is in A+B * if A or B has more digits add those in */ if (min != max) { for (; i < max; i++) { /* T[i] = X[i] + U */ *tmpc = x->dp[i] + u; /* U = carry bit of T[i] */ u = *tmpc >> (mp_digit)MP_DIGIT_BIT; /* take away carry bit from T[i] */ *tmpc++ &= MP_MASK; } } /* add carry */ *tmpc++ = u; /* clear digits above oldused */ MP_ZERO_DIGITS(tmpc, olduse - c->used); } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_prime_tab.c0000664000175000017500000000537115104661341016504 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_PRIME_TAB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ const mp_digit ltm_prime_tab[] = { 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, 0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035, 0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059, 0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F, #ifndef MP_8BIT 0x0083, 0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD, 0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF, 0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107, 0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137, 0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167, 0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199, 0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9, 0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7, 0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239, 0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265, 0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293, 0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF, 0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301, 0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B, 0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371, 0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD, 0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5, 0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419, 0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449, 0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B, 0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7, 0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503, 0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529, 0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F, 0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3, 0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7, 0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623, 0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653 #endif }; #if defined(__GNUC__) && __GNUC__ >= 4 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" const mp_digit *s_mp_prime_tab = ltm_prime_tab; #pragma GCC diagnostic pop #elif defined(_MSC_VER) && _MSC_VER >= 1500 #pragma warning(push) #pragma warning(disable: 4996) const mp_digit *s_mp_prime_tab = ltm_prime_tab; #pragma warning(pop) #else const mp_digit *s_mp_prime_tab = ltm_prime_tab; #endif #endif tcl9.0.3/libtommath/bn_mp_zero.c0000664000175000017500000000043715076154262016222 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ZERO_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* set to zero */ void mp_zero(mp_int *a) { a->sign = MP_ZPOS; a->used = 0; MP_ZERO_DIGITS(a->dp, a->alloc); } #endif tcl9.0.3/libtommath/bn_mp_xor.c0000664000175000017500000000261215076154262016050 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_XOR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* two complement xor */ mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c) { int used = MP_MAX(a->used, b->used) + 1, i; mp_err err; mp_digit ac = 1, bc = 1, cc = 1; mp_sign csign = (a->sign != b->sign) ? MP_NEG : MP_ZPOS; if (c->alloc < used) { if ((err = mp_grow(c, used)) != MP_OKAY) { return err; } } for (i = 0; i < used; i++) { mp_digit x, y; /* convert to two complement if negative */ if (a->sign == MP_NEG) { ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK); x = ac & MP_MASK; ac >>= MP_DIGIT_BIT; } else { x = (i >= a->used) ? 0uL : a->dp[i]; } /* convert to two complement if negative */ if (b->sign == MP_NEG) { bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK); y = bc & MP_MASK; bc >>= MP_DIGIT_BIT; } else { y = (i >= b->used) ? 0uL : b->dp[i]; } c->dp[i] = x ^ y; /* convert to to sign-magnitude if negative */ if (csign == MP_NEG) { cc += ~c->dp[i] & MP_MASK; c->dp[i] = cc & MP_MASK; cc >>= MP_DIGIT_BIT; } } c->used = used; c->sign = csign; mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_unpack.c0000664000175000017500000000261315076154262016522 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_UNPACK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* based on gmp's mpz_import. * see http://gmplib.org/manual/Integer-Import-and-Export.html */ mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endian endian, size_t nails, const void *op) { mp_err err; size_t odd_nails, nail_bytes, i, j; unsigned char odd_nail_mask; mp_zero(rop); if (endian == MP_NATIVE_ENDIAN) { MP_GET_ENDIANNESS(endian); } odd_nails = (nails % 8u); odd_nail_mask = 0xff; for (i = 0; i < odd_nails; ++i) { odd_nail_mask ^= (unsigned char)(1u << (7u - i)); } nail_bytes = nails / 8u; for (i = 0; i < count; ++i) { for (j = 0; j < (size - nail_bytes); ++j) { unsigned char byte = *((const unsigned char *)op + (((order == MP_MSB_FIRST) ? i : ((count - 1u) - i)) * size) + ((endian == MP_BIG_ENDIAN) ? (j + nail_bytes) : (((size - 1u) - j) - nail_bytes))); if ((err = mp_mul_2d(rop, (j == 0u) ? (int)(8u - odd_nails) : 8, rop)) != MP_OKAY) { return err; } rop->dp[0] |= (j == 0u) ? (mp_digit)(byte & odd_nail_mask) : (mp_digit)byte; rop->used += 1; } } mp_clamp(rop); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_ubin_size.c0000664000175000017500000000054715076154262017234 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_UBIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* get the size for an unsigned equivalent */ size_t mp_ubin_size(const mp_int *a) { size_t size = (size_t)mp_count_bits(a); return (size / 8u) + (((size & 7u) != 0u) ? 1u : 0u); } #endif tcl9.0.3/libtommath/bn_mp_to_ubin.c0000664000175000017500000000155515076154262016704 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_TO_UBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* store in unsigned [big endian] format */ mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) { size_t x, count; mp_err err; mp_int t; count = mp_ubin_size(a); if (count > maxlen) { return MP_BUF; } if ((err = mp_init_copy(&t, a)) != MP_OKAY) { return err; } for (x = count; x --> 0u;) { #ifndef MP_8BIT buf[x] = (unsigned char)(t.dp[0] & 255u); #else buf[x] = (unsigned char)(t.dp[0] | ((t.dp[1] & 1u) << 7)); #endif if ((err = mp_div_2d(&t, 8, &t, NULL)) != MP_OKAY) { goto LBL_ERR; } } if (written != NULL) { *written = count; } LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_to_sbin.c0000664000175000017500000000113615104661341016666 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_TO_SBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* store in signed [big endian] format */ mp_err mp_to_sbin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written) { mp_err err; if (maxlen == 0u) { return MP_BUF; } if ((err = mp_to_ubin(a, buf + 1, maxlen - 1u, written)) != MP_OKAY) { return err; } if (written != NULL) { (*written)++; } buf[0] = (a->sign == MP_ZPOS) ? (unsigned char)0 : (unsigned char)1; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_to_radix.c0000664000175000017500000000364415076154262017057 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_TO_RADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* stores a bignum as a ASCII string in a given radix (2..64) * * Stores upto "size - 1" chars and always a NULL byte, puts the number of characters * written, including the '\0', in "written". */ mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, int radix) { size_t digs; mp_err err; mp_int t; mp_digit d; char *_s = str; /* check range of radix and size*/ if (maxlen < 2u) { return MP_BUF; } if ((radix < 2) || (radix > 64)) { return MP_VAL; } /* quick out if its zero */ if (MP_IS_ZERO(a)) { *str++ = '0'; *str = '\0'; if (written != NULL) { *written = 2u; } return MP_OKAY; } if ((err = mp_init_copy(&t, a)) != MP_OKAY) { return err; } /* if it is negative output a - */ if (t.sign == MP_NEG) { /* we have to reverse our digits later... but not the - sign!! */ ++_s; /* store the flag and mark the number as positive */ *str++ = '-'; t.sign = MP_ZPOS; /* subtract a char */ --maxlen; } digs = 0u; while (!MP_IS_ZERO(&t)) { if (--maxlen < 1u) { /* no more room */ err = MP_BUF; goto LBL_ERR; } if ((err = mp_div_d(&t, (mp_digit)radix, &t, &d)) != MP_OKAY) { goto LBL_ERR; } *str++ = mp_s_rmap[d]; ++digs; } /* reverse the digits of the string. In this case _s points * to the first digit [exluding the sign] of the number */ s_mp_reverse((unsigned char *)_s, digs); /* append a NULL so the string is properly terminated */ *str = '\0'; digs++; if (written != NULL) { *written = (a->sign == MP_NEG) ? (digs + 1u): digs; } LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_sub_d.c0000664000175000017500000000307015076154262016333 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SUB_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* single digit subtraction */ mp_err mp_sub_d(const mp_int *a, mp_digit b, mp_int *c) { mp_digit *tmpa, *tmpc; mp_err err; int ix, oldused; /* grow c as required */ if (c->alloc < (a->used + 1)) { if ((err = mp_grow(c, a->used + 1)) != MP_OKAY) { return err; } } /* if a is negative just do an unsigned * addition [with fudged signs] */ if (a->sign == MP_NEG) { mp_int a_ = *a; a_.sign = MP_ZPOS; err = mp_add_d(&a_, b, c); c->sign = MP_NEG; /* clamp */ mp_clamp(c); return err; } /* setup regs */ oldused = c->used; tmpa = a->dp; tmpc = c->dp; /* if a <= b simply fix the single digit */ if (((a->used == 1) && (a->dp[0] <= b)) || (a->used == 0)) { if (a->used == 1) { *tmpc++ = b - *tmpa; } else { *tmpc++ = b; } ix = 1; /* negative/1digit */ c->sign = MP_NEG; c->used = 1; } else { mp_digit mu = b; /* positive/size */ c->sign = MP_ZPOS; c->used = a->used; /* subtract digits, mu is carry */ for (ix = 0; ix < a->used; ix++) { *tmpc = *tmpa++ - mu; mu = *tmpc >> (MP_SIZEOF_BITS(mp_digit) - 1u); *tmpc++ &= MP_MASK; } } /* zero excess digits */ MP_ZERO_DIGITS(tmpc, oldused - ix); mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_submod.c0000664000175000017500000000077615104661341016533 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SUBMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* d = a - b (mod c) */ mp_err mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) { mp_err err; mp_int t; if ((err = mp_init(&t)) != MP_OKAY) { return err; } if ((err = mp_sub(a, b, &t)) != MP_OKAY) { goto LBL_ERR; } err = mp_mod(&t, c, d); LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_sub.c0000664000175000017500000000236115076154262016032 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* high level subtraction (handles signs) */ mp_err mp_sub(const mp_int *a, const mp_int *b, mp_int *c) { mp_sign sa = a->sign, sb = b->sign; mp_err err; if (sa != sb) { /* subtract a negative from a positive, OR */ /* subtract a positive from a negative. */ /* In either case, ADD their magnitudes, */ /* and use the sign of the first number. */ c->sign = sa; err = s_mp_add(a, b, c); } else { /* subtract a positive from a positive, OR */ /* subtract a negative from a negative. */ /* First, take the difference between their */ /* magnitudes, then... */ if (mp_cmp_mag(a, b) != MP_LT) { /* Copy the sign from the first */ c->sign = sa; /* The first has a larger or equal magnitude */ err = s_mp_sub(a, b, c); } else { /* The result has the *opposite* sign from */ /* the first number. */ c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS; /* The second has a larger magnitude */ err = s_mp_sub(b, a, c); } } return err; } #endif tcl9.0.3/libtommath/bn_mp_sqrtmod_prime.c0000664000175000017500000001071415104661341020120 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SQRTMOD_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Tonelli-Shanks algorithm * https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm * https://gmplib.org/list-archives/gmp-discuss/2013-April/005300.html * */ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret) { mp_err err; int legendre; mp_int t1, C, Q, S, Z, M, T, R, two; mp_digit i; /* first handle the simple cases */ if (mp_cmp_d(n, 0uL) == MP_EQ) { mp_zero(ret); return MP_OKAY; } if (mp_cmp_d(prime, 2uL) == MP_EQ) return MP_VAL; /* prime must be odd */ if ((err = mp_kronecker(n, prime, &legendre)) != MP_OKAY) return err; if (legendre == -1) return MP_VAL; /* quadratic non-residue mod prime */ if ((err = mp_init_multi(&t1, &C, &Q, &S, &Z, &M, &T, &R, &two, (void *)NULL)) != MP_OKAY) { return err; } /* SPECIAL CASE: if prime mod 4 == 3 * compute directly: err = n^(prime+1)/4 mod prime * Handbook of Applied Cryptography algorithm 3.36 */ if ((err = mp_mod_d(prime, 4uL, &i)) != MP_OKAY) goto cleanup; if (i == 3u) { if ((err = mp_add_d(prime, 1uL, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_div_2(&t1, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_div_2(&t1, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_exptmod(n, &t1, prime, ret)) != MP_OKAY) goto cleanup; err = MP_OKAY; goto cleanup; } /* NOW: Tonelli-Shanks algorithm */ /* factor out powers of 2 from prime-1, defining Q and S as: prime-1 = Q*2^S */ if ((err = mp_copy(prime, &Q)) != MP_OKAY) goto cleanup; if ((err = mp_sub_d(&Q, 1uL, &Q)) != MP_OKAY) goto cleanup; /* Q = prime - 1 */ mp_zero(&S); /* S = 0 */ while (MP_IS_EVEN(&Q)) { if ((err = mp_div_2(&Q, &Q)) != MP_OKAY) goto cleanup; /* Q = Q / 2 */ if ((err = mp_add_d(&S, 1uL, &S)) != MP_OKAY) goto cleanup; /* S = S + 1 */ } /* find a Z such that the Legendre symbol (Z|prime) == -1 */ mp_set_u32(&Z, 2u); /* Z = 2 */ for (;;) { if ((err = mp_kronecker(&Z, prime, &legendre)) != MP_OKAY) goto cleanup; if (legendre == -1) break; if ((err = mp_add_d(&Z, 1uL, &Z)) != MP_OKAY) goto cleanup; /* Z = Z + 1 */ } if ((err = mp_exptmod(&Z, &Q, prime, &C)) != MP_OKAY) goto cleanup; /* C = Z ^ Q mod prime */ if ((err = mp_add_d(&Q, 1uL, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_div_2(&t1, &t1)) != MP_OKAY) goto cleanup; /* t1 = (Q + 1) / 2 */ if ((err = mp_exptmod(n, &t1, prime, &R)) != MP_OKAY) goto cleanup; /* R = n ^ ((Q + 1) / 2) mod prime */ if ((err = mp_exptmod(n, &Q, prime, &T)) != MP_OKAY) goto cleanup; /* T = n ^ Q mod prime */ if ((err = mp_copy(&S, &M)) != MP_OKAY) goto cleanup; /* M = S */ mp_set_u32(&two, 2u); for (;;) { if ((err = mp_copy(&T, &t1)) != MP_OKAY) goto cleanup; i = 0; for (;;) { if (mp_cmp_d(&t1, 1uL) == MP_EQ) break; if ((err = mp_exptmod(&t1, &two, prime, &t1)) != MP_OKAY) goto cleanup; i++; } if (i == 0u) { if ((err = mp_copy(&R, ret)) != MP_OKAY) goto cleanup; err = MP_OKAY; goto cleanup; } if ((err = mp_sub_d(&M, i, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_sub_d(&t1, 1uL, &t1)) != MP_OKAY) goto cleanup; if ((err = mp_exptmod(&two, &t1, prime, &t1)) != MP_OKAY) goto cleanup; /* t1 = 2 ^ (M - i - 1) */ if ((err = mp_exptmod(&C, &t1, prime, &t1)) != MP_OKAY) goto cleanup; /* t1 = C ^ (2 ^ (M - i - 1)) mod prime */ if ((err = mp_sqrmod(&t1, prime, &C)) != MP_OKAY) goto cleanup; /* C = (t1 * t1) mod prime */ if ((err = mp_mulmod(&R, &t1, prime, &R)) != MP_OKAY) goto cleanup; /* R = (R * t1) mod prime */ if ((err = mp_mulmod(&T, &C, prime, &T)) != MP_OKAY) goto cleanup; /* T = (T * C) mod prime */ mp_set(&M, i); /* M = i */ } cleanup: mp_clear_multi(&t1, &C, &Q, &S, &Z, &M, &T, &R, &two, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_mp_sqrt.c0000664000175000017500000000572715076154262016243 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SQRT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef NO_FLOATING_POINT #include #include #if (MP_DIGIT_BIT != 28) || (FLT_RADIX != 2) || (DBL_MANT_DIG != 53) || (DBL_MAX_EXP != 1024) #define NO_FLOATING_POINT #endif #endif /* this function is less generic than mp_n_root, simpler and faster */ mp_err mp_sqrt(const mp_int *arg, mp_int *ret) { mp_err err; mp_int t1, t2; #ifndef NO_FLOATING_POINT int i, j, k; volatile double d; mp_digit dig; #endif /* must be positive */ if (arg->sign == MP_NEG) { return MP_VAL; } /* easy out */ if (MP_IS_ZERO(arg)) { mp_zero(ret); return MP_OKAY; } #ifndef NO_FLOATING_POINT i = (arg->used / 2) - 1; j = 2 * i; if ((err = mp_init_size(&t1, i+2)) != MP_OKAY) { return err; } if ((err = mp_init(&t2)) != MP_OKAY) { goto E2; } for (k = 0; k < i; ++k) { t1.dp[k] = (mp_digit) 0; } /* Estimate the square root using the hardware floating point unit. */ d = 0.0; for (k = arg->used-1; k >= j; --k) { d = ldexp(d, MP_DIGIT_BIT) + (double)(arg->dp[k]); } /* * At this point, d is the nearest floating point number to the most * significant 1 or 2 mp_digits of arg. Extract its square root. */ d = sqrt(d); /* dig is the most significant mp_digit of the square root */ dig = (mp_digit) ldexp(d, -MP_DIGIT_BIT); /* * If the most significant digit is nonzero, find the next digit down * by subtracting MP_DIGIT_BIT times thie most significant digit. * Subtract one from the result so that our initial estimate is always * low. */ if (dig) { t1.used = i+2; d -= ldexp((double) dig, MP_DIGIT_BIT); if (d >= 1.0) { t1.dp[i+1] = dig; t1.dp[i] = ((mp_digit) d) - 1; } else { t1.dp[i+1] = dig-1; t1.dp[i] = MP_DIGIT_MAX; } } else { t1.used = i+1; t1.dp[i] = ((mp_digit) d) - 1; } #else if ((err = mp_init_copy(&t1, arg)) != MP_OKAY) { return err; } if ((err = mp_init(&t2)) != MP_OKAY) { goto E2; } /* First approx. (not very bad for large arg) */ mp_rshd(&t1, t1.used/2); #endif /* t1 > 0 */ if ((err = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) { goto E1; } if ((err = mp_add(&t1, &t2, &t1)) != MP_OKAY) { goto E1; } if ((err = mp_div_2(&t1, &t1)) != MP_OKAY) { goto E1; } /* And now t1 > sqrt(arg) */ do { if ((err = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) { goto E1; } if ((err = mp_add(&t1, &t2, &t1)) != MP_OKAY) { goto E1; } if ((err = mp_div_2(&t1, &t1)) != MP_OKAY) { goto E1; } /* t1 >= sqrt(arg) >= t2 at this point */ } while (mp_cmp_mag(&t1, &t2) == MP_GT); mp_exch(&t1, ret); E1: mp_clear(&t2); E2: mp_clear(&t1); return err; } #endif tcl9.0.3/libtommath/bn_mp_sqrmod.c0000664000175000017500000000075415104661341016543 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SQRMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* c = a * a (mod b) */ mp_err mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c) { mp_err err; mp_int t; if ((err = mp_init(&t)) != MP_OKAY) { return err; } if ((err = mp_sqr(a, &t)) != MP_OKAY) { goto LBL_ERR; } err = mp_mod(&t, b, c); LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_sqr.c0000664000175000017500000000156115076154262016047 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes b = a*a */ mp_err mp_sqr(const mp_int *a, mp_int *b) { mp_err err; if (MP_HAS(S_MP_TOOM_SQR) && /* use Toom-Cook? */ (a->used >= MP_TOOM_SQR_CUTOFF)) { err = s_mp_toom_sqr(a, b); } else if (MP_HAS(S_MP_KARATSUBA_SQR) && /* Karatsuba? */ (a->used >= MP_KARATSUBA_SQR_CUTOFF)) { err = s_mp_karatsuba_sqr(a, b); } else if (MP_HAS(S_MP_SQR_FAST) && /* can we use the fast comba multiplier? */ (((a->used * 2) + 1) < MP_WARRAY) && (a->used < (MP_MAXFAST / 2))) { err = s_mp_sqr_fast(a, b); } else if (MP_HAS(S_MP_SQR)) { err = s_mp_sqr(a, b); } else { err = MP_VAL; } b->sign = MP_ZPOS; return err; } #endif tcl9.0.3/libtommath/bn_mp_signed_rsh.c0000664000175000017500000000105115076154262017361 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SIGNED_RSH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift right by a certain bit count with sign extension */ mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) { mp_err res; if (a->sign == MP_ZPOS) { return mp_div_2d(a, b, c, NULL); } res = mp_add_d(a, 1uL, c); if (res != MP_OKAY) { return res; } res = mp_div_2d(c, b, c, NULL); return (res == MP_OKAY) ? mp_sub_d(c, 1uL, c) : res; } #endif tcl9.0.3/libtommath/bn_mp_shrink.c0000664000175000017500000000116515076154262016540 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SHRINK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shrink a bignum */ mp_err mp_shrink(mp_int *a) { mp_digit *tmp; int alloc = MP_MAX(MP_MIN_PREC, a->used); if (a->alloc != alloc) { if ((tmp = (mp_digit *) MP_REALLOC(a->dp, (size_t)a->alloc * sizeof(mp_digit), (size_t)alloc * sizeof(mp_digit))) == NULL) { return MP_MEM; } a->dp = tmp; a->alloc = alloc; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_set_ul.c0000664000175000017500000000032315104661341016521 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_UNSIGNED(mp_set_ul, unsigned long) #endif tcl9.0.3/libtommath/bn_mp_set_u64.c0000664000175000017500000000032015104661341016514 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_UNSIGNED(mp_set_u64, uint64_t) #endif tcl9.0.3/libtommath/bn_mp_set_u32.c0000664000175000017500000000032015104661341016507 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_UNSIGNED(mp_set_u32, uint32_t) #endif tcl9.0.3/libtommath/bn_mp_set_l.c0000664000175000017500000000034015104661341016333 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_SIGNED(mp_set_l, mp_set_ul, long, unsigned long) #endif tcl9.0.3/libtommath/bn_mp_set_i64.c0000664000175000017500000000034315104661341016505 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_SIGNED(mp_set_i64, mp_set_u64, int64_t, uint64_t) #endif tcl9.0.3/libtommath/bn_mp_set_i32.c0000664000175000017500000000034315104661341016500 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_SET_SIGNED(mp_set_i32, mp_set_u32, int32_t, uint32_t) #endif tcl9.0.3/libtommath/bn_mp_set_double.c0000664000175000017500000000232215104661341017354 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_DOUBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) mp_err mp_set_double(mp_int *a, double b) { uint64_t frac; int exp; mp_err err; union { double dbl; uint64_t bits; } cast; cast.dbl = b; exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFu); frac = (cast.bits & ((1uLL << 52) - 1uLL)) | (1uLL << 52); if (exp == 0x7FF) { /* +-inf, NaN */ return MP_VAL; } exp -= 1023 + 52; mp_set_u64(a, frac); err = (exp < 0) ? mp_div_2d(a, -exp, a, NULL) : mp_mul_2d(a, exp, a); if (err != MP_OKAY) { return err; } if (((cast.bits >> 63) != 0uLL) && !MP_IS_ZERO(a)) { a->sign = MP_NEG; } return MP_OKAY; } #else /* pragma message() not supported by several compilers (in mostly older but still used versions) */ # ifdef _MSC_VER # pragma message("mp_set_double implementation is only available on platforms with IEEE754 floating point format") # else # warning "mp_set_double implementation is only available on platforms with IEEE754 floating point format" # endif #endif #endif tcl9.0.3/libtommath/bn_mp_set.c0000664000175000017500000000056415076154262016037 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* set to a digit */ void mp_set(mp_int *a, mp_digit b) { a->dp[0] = b & MP_MASK; a->sign = MP_ZPOS; a->used = (a->dp[0] != 0u) ? 1 : 0; MP_ZERO_DIGITS(a->dp + a->used, a->alloc - a->used); } #endif tcl9.0.3/libtommath/bn_mp_sbin_size.c0000664000175000017500000000044115104661341017214 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_SBIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* get the size for an signed equivalent */ size_t mp_sbin_size(const mp_int *a) { return 1u + mp_ubin_size(a); } #endif tcl9.0.3/libtommath/bn_mp_rshd.c0000664000175000017500000000213415076154262016177 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_RSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift right a certain amount of digits */ void mp_rshd(mp_int *a, int b) { int x; mp_digit *bottom, *top; /* if b <= 0 then ignore it */ if (b <= 0) { return; } /* if b > used then simply zero it and return */ if (a->used <= b) { mp_zero(a); return; } /* shift the digits down */ /* bottom */ bottom = a->dp; /* top [offset into digits] */ top = a->dp + b; /* this is implemented as a sliding window where * the window is b-digits long and digits from * the top of the window are copied to the bottom * * e.g. b-2 | b-1 | b0 | b1 | b2 | ... | bb | ----> /\ | ----> \-------------------/ ----> */ for (x = 0; x < (a->used - b); x++) { *bottom++ = *top++; } /* zero the top digits */ MP_ZERO_DIGITS(bottom, a->used - x); /* remove excess digits */ a->used -= b; } #endif tcl9.0.3/libtommath/bn_mp_root_n.c0000664000175000017500000000742715104661341016542 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ROOT_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* find the n'th root of an integer * * Result found such that (c)**b <= a and (c+1)**b > a * * This algorithm uses Newton's approximation * x[i+1] = x[i] - f(x[i])/f'(x[i]) * which will find the root in log(N) time where * each step involves a fair bit. */ mp_err mp_root_n(const mp_int *a, int b, mp_int *c) { mp_int t1, t2, t3, a_; int ilog2; mp_err err; if ((unsigned)b > (unsigned)MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } /* input must be positive if b is even */ if (((b & 1) == 0) && mp_isneg(a)) { return MP_VAL; } if ((err = mp_init_multi(&t1, &t2, &t3, (void *)NULL)) != MP_OKAY) { return err; } /* if a is negative fudge the sign but keep track */ a_ = *a; a_.sign = MP_ZPOS; /* Compute seed: 2^(log_2(n)/b + 2)*/ ilog2 = mp_count_bits(a); /* If "b" is larger than INT_MAX it is also larger than log_2(n) because the bit-length of the "n" is measured with an int and hence the root is always < 2 (two). */ if (b > INT_MAX/2) { mp_set(c, 1uL); c->sign = a->sign; err = MP_OKAY; goto LBL_ERR; } /* "b" is smaller than INT_MAX, we can cast safely */ if (ilog2 < b) { mp_set(c, 1uL); c->sign = a->sign; err = MP_OKAY; goto LBL_ERR; } ilog2 = ilog2 / b; if (ilog2 == 0) { mp_set(c, 1uL); c->sign = a->sign; err = MP_OKAY; goto LBL_ERR; } /* Start value must be larger than root */ ilog2 += 2; if ((err = mp_2expt(&t2,ilog2)) != MP_OKAY) goto LBL_ERR; do { /* t1 = t2 */ if ((err = mp_copy(&t2, &t1)) != MP_OKAY) goto LBL_ERR; /* t2 = t1 - ((t1**b - a) / (b * t1**(b-1))) */ /* t3 = t1**(b-1) */ if ((err = mp_expt_n(&t1, b - 1, &t3)) != MP_OKAY) goto LBL_ERR; /* numerator */ /* t2 = t1**b */ if ((err = mp_mul(&t3, &t1, &t2)) != MP_OKAY) goto LBL_ERR; /* t2 = t1**b - a */ if ((err = mp_sub(&t2, &a_, &t2)) != MP_OKAY) goto LBL_ERR; /* denominator */ /* t3 = t1**(b-1) * b */ if ((err = mp_mul_d(&t3, (mp_digit)b, &t3)) != MP_OKAY) goto LBL_ERR; /* t3 = (t1**b - a)/(b * t1**(b-1)) */ if ((err = mp_div(&t2, &t3, &t3, NULL)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&t1, &t3, &t2)) != MP_OKAY) goto LBL_ERR; /* Number of rounds is at most log_2(root). If it is more it got stuck, so break out of the loop and do the rest manually. */ if (ilog2-- == 0) { break; } } while (mp_cmp(&t1, &t2) != MP_EQ); /* result can be off by a few so check */ /* Loop beneath can overshoot by one if found root is smaller than actual root */ for (;;) { mp_ord cmp; if ((err = mp_expt_n(&t1, b, &t2)) != MP_OKAY) goto LBL_ERR; cmp = mp_cmp(&t2, &a_); if (cmp == MP_EQ) { err = MP_OKAY; goto LBL_ERR; } if (cmp == MP_LT) { if ((err = mp_add_d(&t1, 1uL, &t1)) != MP_OKAY) goto LBL_ERR; } else { break; } } /* correct overshoot from above or from recurrence */ for (;;) { if ((err = mp_expt_n(&t1, b, &t2)) != MP_OKAY) goto LBL_ERR; if (mp_cmp(&t2, &a_) == MP_GT) { if ((err = mp_sub_d(&t1, 1uL, &t1)) != MP_OKAY) goto LBL_ERR; } else { break; } } /* set the result */ mp_exch(&t1, c); /* set the sign of the result */ c->sign = a->sign; LBL_ERR: mp_clear_multi(&t1, &t2, &t3, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_mp_reduce_setup.c0000664000175000017500000000076215104661341017724 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* pre-calculate the value required for Barrett reduction * For a given modulus "b" it calulates the value required in "a" */ mp_err mp_reduce_setup(mp_int *a, const mp_int *b) { mp_err err; if ((err = mp_2expt(a, b->used * 2 * MP_DIGIT_BIT)) != MP_OKAY) { return err; } return mp_div(a, b, a, NULL); } #endif tcl9.0.3/libtommath/bn_mp_reduce_is_2k_l.c0000664000175000017500000000125315104661341020102 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_IS_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines if reduce_2k_l can be used */ mp_bool mp_reduce_is_2k_l(const mp_int *a) { int ix, iy; if (a->used == 0) { return MP_NO; } else if (a->used == 1) { return MP_YES; } else if (a->used > 1) { /* if more than half of the digits are -1 we're sold */ for (iy = ix = 0; ix < a->used; ix++) { if (a->dp[ix] == MP_DIGIT_MAX) { ++iy; } } return (iy >= (a->used/2)) ? MP_YES : MP_NO; } else { return MP_NO; } } #endif tcl9.0.3/libtommath/bn_mp_reduce_is_2k.c0000664000175000017500000000150615104661341017570 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_IS_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines if mp_reduce_2k can be used */ mp_bool mp_reduce_is_2k(const mp_int *a) { int ix, iy, iw; mp_digit iz; if (a->used == 0) { return MP_NO; } else if (a->used == 1) { return MP_YES; } else if (a->used > 1) { iy = mp_count_bits(a); iz = 1; iw = 1; /* Test every bit from the second digit up, must be 1 */ for (ix = MP_DIGIT_BIT; ix < iy; ix++) { if ((a->dp[iw] & iz) == 0u) { return MP_NO; } iz <<= 1; if (iz > MP_DIGIT_MAX) { ++iw; iz = 1; } } return MP_YES; } else { return MP_YES; } } #endif tcl9.0.3/libtommath/bn_mp_reduce_2k_setup_l.c0000664000175000017500000000110215104661341020620 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_2K_SETUP_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines the setup value */ mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) { mp_err err; mp_int tmp; if ((err = mp_init(&tmp)) != MP_OKAY) { return err; } if ((err = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { goto LBL_ERR; } if ((err = s_mp_sub(&tmp, a, d)) != MP_OKAY) { goto LBL_ERR; } LBL_ERR: mp_clear(&tmp); return err; } #endif tcl9.0.3/libtommath/bn_mp_reduce_2k_setup.c0000664000175000017500000000122015104661341020306 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_2K_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines the setup value */ mp_err mp_reduce_2k_setup(const mp_int *a, mp_digit *d) { mp_err err; mp_int tmp; int p; if ((err = mp_init(&tmp)) != MP_OKAY) { return err; } p = mp_count_bits(a); if ((err = mp_2expt(&tmp, p)) != MP_OKAY) { mp_clear(&tmp); return err; } if ((err = s_mp_sub(&tmp, a, &tmp)) != MP_OKAY) { mp_clear(&tmp); return err; } *d = tmp.dp[0]; mp_clear(&tmp); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_reduce_2k_l.c0000664000175000017500000000174615104661341017416 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reduces a modulo n where n is of the form 2**p - d This differs from reduce_2k since "d" can be larger than a single digit. */ mp_err mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d) { mp_int q; mp_err err; int p; if ((err = mp_init(&q)) != MP_OKAY) { return err; } p = mp_count_bits(n); top: /* q = a/2**p, a = a mod 2**p */ if ((err = mp_div_2d(a, p, &q, a)) != MP_OKAY) { goto LBL_ERR; } /* q = q * d */ if ((err = mp_mul(&q, d, &q)) != MP_OKAY) { goto LBL_ERR; } /* a = a + q */ if ((err = s_mp_add(a, &q, a)) != MP_OKAY) { goto LBL_ERR; } if (mp_cmp_mag(a, n) != MP_LT) { if ((err = s_mp_sub(a, n, a)) != MP_OKAY) { goto LBL_ERR; } goto top; } LBL_ERR: mp_clear(&q); return err; } #endif tcl9.0.3/libtommath/bn_mp_reduce_2k.c0000664000175000017500000000166315104661341017101 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reduces a modulo n where n is of the form 2**p - d */ mp_err mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d) { mp_int q; mp_err err; int p; if ((err = mp_init(&q)) != MP_OKAY) { return err; } p = mp_count_bits(n); top: /* q = a/2**p, a = a mod 2**p */ if ((err = mp_div_2d(a, p, &q, a)) != MP_OKAY) { goto LBL_ERR; } if (d != 1u) { /* q = q * d */ if ((err = mp_mul_d(&q, d, &q)) != MP_OKAY) { goto LBL_ERR; } } /* a = a + q */ if ((err = s_mp_add(a, &q, a)) != MP_OKAY) { goto LBL_ERR; } if (mp_cmp_mag(a, n) != MP_LT) { if ((err = s_mp_sub(a, n, a)) != MP_OKAY) { goto LBL_ERR; } goto top; } LBL_ERR: mp_clear(&q); return err; } #endif tcl9.0.3/libtommath/bn_mp_reduce.c0000664000175000017500000000371315104661341016503 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reduces x mod m, assumes 0 < x < m**2, mu is * precomputed via mp_reduce_setup. * From HAC pp.604 Algorithm 14.42 */ mp_err mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu) { mp_int q; mp_err err; int um = m->used; /* q = x */ if ((err = mp_init_copy(&q, x)) != MP_OKAY) { return err; } /* q1 = x / b**(k-1) */ mp_rshd(&q, um - 1); /* according to HAC this optimization is ok */ if ((mp_digit)um > ((mp_digit)1 << (MP_DIGIT_BIT - 1))) { if ((err = mp_mul(&q, mu, &q)) != MP_OKAY) { goto CLEANUP; } } else if (MP_HAS(S_MP_MUL_HIGH_DIGS)) { if ((err = s_mp_mul_high_digs(&q, mu, &q, um)) != MP_OKAY) { goto CLEANUP; } } else if (MP_HAS(S_MP_MUL_HIGH_DIGS_FAST)) { if ((err = s_mp_mul_high_digs_fast(&q, mu, &q, um)) != MP_OKAY) { goto CLEANUP; } } else { err = MP_VAL; goto CLEANUP; } /* q3 = q2 / b**(k+1) */ mp_rshd(&q, um + 1); /* x = x mod b**(k+1), quick (no division) */ if ((err = mp_mod_2d(x, MP_DIGIT_BIT * (um + 1), x)) != MP_OKAY) { goto CLEANUP; } /* q = q * m mod b**(k+1), quick (no division) */ if ((err = s_mp_mul_digs(&q, m, &q, um + 1)) != MP_OKAY) { goto CLEANUP; } /* x = x - q */ if ((err = mp_sub(x, &q, x)) != MP_OKAY) { goto CLEANUP; } /* If x < 0, add b**(k+1) to it */ if (mp_cmp_d(x, 0uL) == MP_LT) { mp_set(&q, 1uL); if ((err = mp_lshd(&q, um + 1)) != MP_OKAY) { goto CLEANUP; } if ((err = mp_add(x, &q, x)) != MP_OKAY) { goto CLEANUP; } } /* Back off if it's too big */ while (mp_cmp(x, m) != MP_LT) { if ((err = s_mp_sub(x, m, x)) != MP_OKAY) { goto CLEANUP; } } CLEANUP: mp_clear(&q); return err; } #endif tcl9.0.3/libtommath/bn_mp_read_radix.c0000664000175000017500000000364115076154262017345 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_READ_RADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #define MP_TOUPPER(c) ((((c) >= 'a') && ((c) <= 'z')) ? (((c) + 'A') - 'a') : (c)) /* read a string [ASCII] in a given radix */ mp_err mp_read_radix(mp_int *a, const char *str, int radix) { mp_err err; int y; mp_sign neg; unsigned pos; char ch; /* zero the digit bignum */ mp_zero(a); /* make sure the radix is ok */ if ((radix < 2) || (radix > 64)) { return MP_VAL; } /* if the leading digit is a * minus set the sign to negative. */ if (*str == '-') { ++str; neg = MP_NEG; } else { neg = MP_ZPOS; } /* set the integer to the default of zero */ mp_zero(a); /* process each digit of the string */ while (*str != '\0') { /* if the radix <= 36 the conversion is case insensitive * this allows numbers like 1AB and 1ab to represent the same value * [e.g. in hex] */ ch = (radix <= 36) ? (char)MP_TOUPPER((int)*str) : *str; pos = (unsigned)(ch - '('); if (mp_s_rmap_reverse_sz < pos) { break; } y = (int)mp_s_rmap_reverse[pos]; /* if the char was found in the map * and is less than the given radix add it * to the number, otherwise exit the loop. */ if ((y == 0xff) || (y >= radix)) { break; } if ((err = mp_mul_d(a, (mp_digit)radix, a)) != MP_OKAY) { return err; } if ((err = mp_add_d(a, (mp_digit)y, a)) != MP_OKAY) { return err; } ++str; } /* if an illegal character was found, fail. */ if (!((*str == '\0') || (*str == '\r') || (*str == '\n'))) { mp_zero(a); return MP_VAL; } /* set the sign only if a != 0 */ if (!MP_IS_ZERO(a)) { a->sign = neg; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_rand.c0000664000175000017500000000204015104661341016150 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_RAND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_err(*s_mp_rand_source)(void *out, size_t size) = s_mp_rand_platform; void mp_rand_source(mp_err(*source)(void *out, size_t size)) { s_mp_rand_source = (source == NULL) ? s_mp_rand_platform : source; } mp_err mp_rand(mp_int *a, int digits) { int i; mp_err err; mp_zero(a); if (digits <= 0) { return MP_OKAY; } if ((err = mp_grow(a, digits)) != MP_OKAY) { return err; } if ((err = s_mp_rand_source(a->dp, (size_t)digits * sizeof(mp_digit))) != MP_OKAY) { return err; } /* TODO: We ensure that the highest digit is nonzero. Should this be removed? */ while ((a->dp[digits - 1] & MP_MASK) == 0u) { if ((err = s_mp_rand_source(a->dp + digits - 1, sizeof(mp_digit))) != MP_OKAY) { return err; } } a->used = digits; for (i = 0; i < digits; ++i) { a->dp[i] &= MP_MASK; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_radix_smap.c0000664000175000017500000000216315104661341017361 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_RADIX_SMAP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* chars used in radix conversions */ const char *const mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; const uint8_t mp_s_rmap_reverse[] = { 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, /* ()*+,-./ */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 01234567 */ 0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 89:;<=>? */ 0xff, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, /* @ABCDEFG */ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, /* HIJKLMNO */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, /* PQRSTUVW */ 0x21, 0x22, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff, /* XYZ[\]^_ */ 0xff, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, /* `abcdefg */ 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, /* hijklmno */ 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, /* pqrstuvw */ 0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, /* xyz{|}~. */ }; const size_t mp_s_rmap_reverse_sz = sizeof(mp_s_rmap_reverse); #endif tcl9.0.3/libtommath/bn_mp_radix_size.c0000664000175000017500000000246315076154262017405 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_RADIX_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* returns size of ASCII representation */ mp_err mp_radix_size(const mp_int *a, int radix, int *size) { mp_err err; int digs; mp_int t; mp_digit d; *size = 0; /* make sure the radix is in range */ if ((radix < 2) || (radix > 64)) { return MP_VAL; } if (MP_IS_ZERO(a)) { *size = 2; return MP_OKAY; } /* special case for binary */ if (radix == 2) { *size = (mp_count_bits(a) + ((a->sign == MP_NEG) ? 1 : 0) + 1); return MP_OKAY; } /* digs is the digit count */ digs = 0; /* if it's negative add one for the sign */ if (a->sign == MP_NEG) { ++digs; } /* init a copy of the input */ if ((err = mp_init_copy(&t, a)) != MP_OKAY) { return err; } /* force temp to positive */ t.sign = MP_ZPOS; /* fetch out all of the digits */ while (!MP_IS_ZERO(&t)) { if ((err = mp_div_d(&t, (mp_digit)radix, &t, &d)) != MP_OKAY) { goto LBL_ERR; } ++digs; } /* return digs + 1, the 1 is for the NULL byte that would be required. */ *size = digs + 1; err = MP_OKAY; LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_prime_strong_lucas_selfridge.c0000664000175000017500000002724515104661341023165 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* * See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details */ #ifndef LTM_USE_ONLY_MR /* * 8-bit is just too small. You can try the Frobenius test * but that frobenius test can fail, too, for the same reason. */ #ifndef MP_8BIT /* * multiply bigint a with int d and put the result in c * Like mp_mul_d() but with a signed long as the small input */ static mp_err s_mp_mul_si(const mp_int *a, int32_t d, mp_int *c) { mp_int t; mp_err err; if ((err = mp_init(&t)) != MP_OKAY) { return err; } /* * mp_digit might be smaller than a long, which excludes * the use of mp_mul_d() here. */ mp_set_i32(&t, d); err = mp_mul(a, &t, c); mp_clear(&t); return err; } /* Strong Lucas-Selfridge test. returns MP_YES if it is a strong L-S prime, MP_NO if it is composite Code ported from Thomas Ray Nicely's implementation of the BPSW test at http://www.trnicely.net/misc/bpsw.html Freeware copyright (C) 2016 Thomas R. Nicely . Released into the public domain by the author, who disclaims any legal liability arising from its use The multi-line comments are made by Thomas R. Nicely and are copied verbatim. Additional comments marked "CZ" (without the quotes) are by the code-portist. (If that name sounds familiar, he is the guy who found the fdiv bug in the Pentium (P5x, I think) Intel processor) */ mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result) { /* CZ TODO: choose better variable names! */ mp_int Dz, gcd, Np1, Uz, Vz, U2mz, V2mz, Qmz, Q2mz, Qkdz, T1z, T2z, T3z, T4z, Q2kdz; /* CZ TODO: Some of them need the full 32 bit, hence the (temporary) exclusion of MP_8BIT */ int32_t D, Ds, J, sign, P, Q, r, s, u, Nbits; mp_err err; mp_bool oddness; *result = MP_NO; /* Find the first element D in the sequence {5, -7, 9, -11, 13, ...} such that Jacobi(D,N) = -1 (Selfridge's algorithm). Theory indicates that, if N is not a perfect square, D will "nearly always" be "small." Just in case, an overflow trap for D is included. */ if ((err = mp_init_multi(&Dz, &gcd, &Np1, &Uz, &Vz, &U2mz, &V2mz, &Qmz, &Q2mz, &Qkdz, &T1z, &T2z, &T3z, &T4z, &Q2kdz, (void *)NULL)) != MP_OKAY) { return err; } D = 5; sign = 1; for (;;) { Ds = sign * D; sign = -sign; mp_set_u32(&Dz, (uint32_t)D); if ((err = mp_gcd(a, &Dz, &gcd)) != MP_OKAY) goto LBL_LS_ERR; /* if 1 < GCD < N then N is composite with factor "D", and Jacobi(D,N) is technically undefined (but often returned as zero). */ if ((mp_cmp_d(&gcd, 1uL) == MP_GT) && (mp_cmp(&gcd, a) == MP_LT)) { goto LBL_LS_ERR; } if (Ds < 0) { Dz.sign = MP_NEG; } if ((err = mp_kronecker(&Dz, a, &J)) != MP_OKAY) goto LBL_LS_ERR; if (J == -1) { break; } D += 2; if (D > (INT_MAX - 2)) { err = MP_VAL; goto LBL_LS_ERR; } } P = 1; /* Selfridge's choice */ Q = (1 - Ds) / 4; /* Required so D = P*P - 4*Q */ /* NOTE: The conditions (a) N does not divide Q, and (b) D is square-free or not a perfect square, are included by some authors; e.g., "Prime numbers and computer methods for factorization," Hans Riesel (2nd ed., 1994, Birkhauser, Boston), p. 130. For this particular application of Lucas sequences, these conditions were found to be immaterial. */ /* Now calculate N - Jacobi(D,N) = N + 1 (even), and calculate the odd positive integer d and positive integer s for which N + 1 = 2^s*d (similar to the step for N - 1 in Miller's test). The strong Lucas-Selfridge test then returns N as a strong Lucas probable prime (slprp) if any of the following conditions is met: U_d=0, V_d=0, V_2d=0, V_4d=0, V_8d=0, V_16d=0, ..., etc., ending with V_{2^(s-1)*d}=V_{(N+1)/2}=0 (all equalities mod N). Thus d is the highest index of U that must be computed (since V_2m is independent of U), compared to U_{N+1} for the standard Lucas-Selfridge test; and no index of V beyond (N+1)/2 is required, just as in the standard Lucas-Selfridge test. However, the quantity Q^d must be computed for use (if necessary) in the latter stages of the test. The result is that the strong Lucas-Selfridge test has a running time only slightly greater (order of 10 %) than that of the standard Lucas-Selfridge test, while producing only (roughly) 30 % as many pseudoprimes (and every strong Lucas pseudoprime is also a standard Lucas pseudoprime). Thus the evidence indicates that the strong Lucas-Selfridge test is more effective than the standard Lucas-Selfridge test, and a Baillie-PSW test based on the strong Lucas-Selfridge test should be more reliable. */ if ((err = mp_add_d(a, 1uL, &Np1)) != MP_OKAY) goto LBL_LS_ERR; s = mp_cnt_lsb(&Np1); /* CZ * This should round towards zero because * Thomas R. Nicely used GMP's mpz_tdiv_q_2exp() * and mp_div_2d() is equivalent. Additionally: * dividing an even number by two does not produce * any leftovers. */ if ((err = mp_div_2d(&Np1, s, &Dz, NULL)) != MP_OKAY) goto LBL_LS_ERR; /* We must now compute U_d and V_d. Since d is odd, the accumulated values U and V are initialized to U_1 and V_1 (if the target index were even, U and V would be initialized instead to U_0=0 and V_0=2). The values of U_2m and V_2m are also initialized to U_1 and V_1; the FOR loop calculates in succession U_2 and V_2, U_4 and V_4, U_8 and V_8, etc. If the corresponding bits (1, 2, 3, ...) of t are on (the zero bit having been accounted for in the initialization of U and V), these values are then combined with the previous totals for U and V, using the composition formulas for addition of indices. */ mp_set(&Uz, 1uL); /* U=U_1 */ mp_set(&Vz, (mp_digit)P); /* V=V_1 */ mp_set(&U2mz, 1uL); /* U_1 */ mp_set(&V2mz, (mp_digit)P); /* V_1 */ mp_set_i32(&Qmz, Q); if ((err = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) goto LBL_LS_ERR; /* Initializes calculation of Q^d */ mp_set_i32(&Qkdz, Q); Nbits = mp_count_bits(&Dz); for (u = 1; u < Nbits; u++) { /* zero bit off, already accounted for */ /* Formulas for doubling of indices (carried out mod N). Note that * the indices denoted as "2m" are actually powers of 2, specifically * 2^(ul-1) beginning each loop and 2^ul ending each loop. * * U_2m = U_m*V_m * V_2m = V_m*V_m - 2*Q^m */ if ((err = mp_mul(&U2mz, &V2mz, &U2mz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&U2mz, a, &U2mz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_sqr(&V2mz, &V2mz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_sub(&V2mz, &Q2mz, &V2mz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&V2mz, a, &V2mz)) != MP_OKAY) goto LBL_LS_ERR; /* Must calculate powers of Q for use in V_2m, also for Q^d later */ if ((err = mp_sqr(&Qmz, &Qmz)) != MP_OKAY) goto LBL_LS_ERR; /* prevents overflow */ /* CZ still necessary without a fixed prealloc'd mem.? */ if ((err = mp_mod(&Qmz, a, &Qmz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) goto LBL_LS_ERR; if (s_mp_get_bit(&Dz, (unsigned int)u) == MP_YES) { /* Formulas for addition of indices (carried out mod N); * * U_(m+n) = (U_m*V_n + U_n*V_m)/2 * V_(m+n) = (V_m*V_n + D*U_m*U_n)/2 * * Be careful with division by 2 (mod N)! */ if ((err = mp_mul(&U2mz, &Vz, &T1z)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mul(&Uz, &V2mz, &T2z)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mul(&V2mz, &Vz, &T3z)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mul(&U2mz, &Uz, &T4z)) != MP_OKAY) goto LBL_LS_ERR; if ((err = s_mp_mul_si(&T4z, Ds, &T4z)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_add(&T1z, &T2z, &Uz)) != MP_OKAY) goto LBL_LS_ERR; if (MP_IS_ODD(&Uz)) { if ((err = mp_add(&Uz, a, &Uz)) != MP_OKAY) goto LBL_LS_ERR; } /* CZ * This should round towards negative infinity because * Thomas R. Nicely used GMP's mpz_fdiv_q_2exp(). * But mp_div_2() does not do so, it is truncating instead. */ oddness = MP_IS_ODD(&Uz) ? MP_YES : MP_NO; if ((err = mp_div_2(&Uz, &Uz)) != MP_OKAY) goto LBL_LS_ERR; if ((Uz.sign == MP_NEG) && (oddness != MP_NO)) { if ((err = mp_sub_d(&Uz, 1uL, &Uz)) != MP_OKAY) goto LBL_LS_ERR; } if ((err = mp_add(&T3z, &T4z, &Vz)) != MP_OKAY) goto LBL_LS_ERR; if (MP_IS_ODD(&Vz)) { if ((err = mp_add(&Vz, a, &Vz)) != MP_OKAY) goto LBL_LS_ERR; } oddness = MP_IS_ODD(&Vz) ? MP_YES : MP_NO; if ((err = mp_div_2(&Vz, &Vz)) != MP_OKAY) goto LBL_LS_ERR; if ((Vz.sign == MP_NEG) && (oddness != MP_NO)) { if ((err = mp_sub_d(&Vz, 1uL, &Vz)) != MP_OKAY) goto LBL_LS_ERR; } if ((err = mp_mod(&Uz, a, &Uz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&Vz, a, &Vz)) != MP_OKAY) goto LBL_LS_ERR; /* Calculating Q^d for later use */ if ((err = mp_mul(&Qkdz, &Qmz, &Qkdz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&Qkdz, a, &Qkdz)) != MP_OKAY) goto LBL_LS_ERR; } } /* If U_d or V_d is congruent to 0 mod N, then N is a prime or a strong Lucas pseudoprime. */ if (MP_IS_ZERO(&Uz) || MP_IS_ZERO(&Vz)) { *result = MP_YES; goto LBL_LS_ERR; } /* NOTE: Ribenboim ("The new book of prime number records," 3rd ed., 1995/6) omits the condition V0 on p.142, but includes it on p. 130. The condition is NECESSARY; otherwise the test will return false negatives---e.g., the primes 29 and 2000029 will be returned as composite. */ /* Otherwise, we must compute V_2d, V_4d, V_8d, ..., V_{2^(s-1)*d} by repeated use of the formula V_2m = V_m*V_m - 2*Q^m. If any of these are congruent to 0 mod N, then N is a prime or a strong Lucas pseudoprime. */ /* Initialize 2*Q^(d*2^r) for V_2m */ if ((err = mp_mul_2(&Qkdz, &Q2kdz)) != MP_OKAY) goto LBL_LS_ERR; for (r = 1; r < s; r++) { if ((err = mp_sqr(&Vz, &Vz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_sub(&Vz, &Q2kdz, &Vz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&Vz, a, &Vz)) != MP_OKAY) goto LBL_LS_ERR; if (MP_IS_ZERO(&Vz)) { *result = MP_YES; goto LBL_LS_ERR; } /* Calculate Q^{d*2^r} for next r (final iteration irrelevant). */ if (r < (s - 1)) { if ((err = mp_sqr(&Qkdz, &Qkdz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mod(&Qkdz, a, &Qkdz)) != MP_OKAY) goto LBL_LS_ERR; if ((err = mp_mul_2(&Qkdz, &Q2kdz)) != MP_OKAY) goto LBL_LS_ERR; } } LBL_LS_ERR: mp_clear_multi(&Q2kdz, &T4z, &T3z, &T2z, &T1z, &Qkdz, &Q2mz, &Qmz, &V2mz, &U2mz, &Vz, &Uz, &Np1, &gcd, &Dz, (void *)NULL); return err; } #endif #endif #endif tcl9.0.3/libtommath/bn_mp_prime_rand.c0000664000175000017500000000731615104661341017357 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_RAND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* makes a truly random prime of a given size (bits), * * Flags are as follows: * * MP_PRIME_BBS - make prime congruent to 3 mod 4 * MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS) * MP_PRIME_2MSB_ON - make the 2nd highest bit one * * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself * so it can be NULL * */ /* This is possibly the mother of all prime generation functions, muahahahahaha! */ mp_err s_mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_prime_callback cb, void *dat) { unsigned char *tmp, maskAND, maskOR_msb, maskOR_lsb; int bsize, maskOR_msb_offset; mp_bool res; mp_err err; /* sanity check the input */ if ((size <= 1) || (t <= 0)) { return MP_VAL; } /* MP_PRIME_SAFE implies MP_PRIME_BBS */ if ((flags & MP_PRIME_SAFE) != 0) { flags |= MP_PRIME_BBS; } /* calc the byte size */ bsize = (size>>3); if (size&7) { bsize++; } /* we need a buffer of bsize bytes */ tmp = (unsigned char *) MP_MALLOC((size_t)bsize); if (tmp == NULL) { return MP_MEM; } /* calc the maskAND value for the MSbyte*/ maskAND = ((size&7) == 0) ? 0xFFu : (unsigned char)(0xFFu >> (8 - (size & 7))); /* calc the maskOR_msb */ maskOR_msb = 0; maskOR_msb_offset = ((size & 7) == 1) ? 1 : 0; if ((flags & MP_PRIME_2MSB_ON) != 0) { maskOR_msb |= (unsigned char)(0x80 >> ((9 - size) & 7)); } /* get the maskOR_lsb */ maskOR_lsb = 1u; if ((flags & MP_PRIME_BBS) != 0) { maskOR_lsb |= 3u; } do { /* read the bytes */ if (cb(tmp, bsize, dat) != bsize) { err = MP_VAL; goto error; } /* work over the MSbyte */ tmp[0] &= maskAND; tmp[0] |= (unsigned char)(1 << ((size - 1) & 7)); /* mix in the maskORs */ tmp[maskOR_msb_offset] |= maskOR_msb; tmp[bsize-1] |= maskOR_lsb; /* read it in */ /* TODO: casting only for now until all lengths have been changed to the type "size_t"*/ if ((err = mp_from_ubin(a, tmp, (size_t)bsize)) != MP_OKAY) { goto error; } /* is it prime? */ if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } if (res == MP_NO) { continue; } if ((flags & MP_PRIME_SAFE) != 0) { /* see if (a-1)/2 is prime */ if ((err = mp_sub_d(a, 1uL, a)) != MP_OKAY) { goto error; } if ((err = mp_div_2(a, a)) != MP_OKAY) { goto error; } /* is it prime? */ if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } } } while (res == MP_NO); if ((flags & MP_PRIME_SAFE) != 0) { /* restore a to the original value */ if ((err = mp_mul_2(a, a)) != MP_OKAY) { goto error; } if ((err = mp_add_d(a, 1uL, a)) != MP_OKAY) { goto error; } } err = MP_OKAY; error: MP_FREE_BUFFER(tmp, (size_t)bsize); return err; } static int s_mp_rand_cb(unsigned char *dst, int len, void *dat) { (void)dat; if (len <= 0) { return len; } if (s_mp_rand_source(dst, (size_t)len) != MP_OKAY) { return 0; } return len; } mp_err mp_prime_rand(mp_int *a, int t, int size, int flags) { return s_mp_prime_random_ex(a, t, size, flags, s_mp_rand_cb, NULL); } #endif tcl9.0.3/libtommath/bn_mp_prime_rabin_miller_trials.c0000664000175000017500000000304315104661341022441 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ static const struct { int k, t; } sizes[] = { { 80, -1 }, /* Use deterministic algorithm for size <= 80 bits */ { 81, 37 }, /* max. error = 2^(-96)*/ { 96, 32 }, /* max. error = 2^(-96)*/ { 128, 40 }, /* max. error = 2^(-112)*/ { 160, 35 }, /* max. error = 2^(-112)*/ { 256, 27 }, /* max. error = 2^(-128)*/ { 384, 16 }, /* max. error = 2^(-128)*/ { 512, 18 }, /* max. error = 2^(-160)*/ { 768, 11 }, /* max. error = 2^(-160)*/ { 896, 10 }, /* max. error = 2^(-160)*/ { 1024, 12 }, /* max. error = 2^(-192)*/ { 1536, 8 }, /* max. error = 2^(-192)*/ { 2048, 6 }, /* max. error = 2^(-192)*/ { 3072, 4 }, /* max. error = 2^(-192)*/ { 4096, 5 }, /* max. error = 2^(-256)*/ { 5120, 4 }, /* max. error = 2^(-256)*/ { 6144, 4 }, /* max. error = 2^(-256)*/ { 8192, 3 }, /* max. error = 2^(-256)*/ { 9216, 3 }, /* max. error = 2^(-256)*/ { 10240, 2 } /* For bigger keysizes use always at least 2 Rounds */ }; /* returns # of RM trials required for a given bit size */ int mp_prime_rabin_miller_trials(int size) { int x; for (x = 0; x < (int)(sizeof(sizes)/(sizeof(sizes[0]))); x++) { if (sizes[x].k == size) { return sizes[x].t; } else if (sizes[x].k > size) { return (x == 0) ? sizes[0].t : sizes[x - 1].t; } } return sizes[x-1].t; } #endif tcl9.0.3/libtommath/bn_mp_prime_next_prime.c0000664000175000017500000000703115104661341020577 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_NEXT_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* finds the next prime after the number "a" using "t" trials * of Miller-Rabin. * * bbs_style = 1 means the prime must be congruent to 3 mod 4 */ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style) { int x, y; mp_ord cmp; mp_err err; mp_bool res = MP_NO; mp_digit res_tab[PRIVATE_MP_PRIME_TAB_SIZE], step, kstep; mp_int b; /* force positive */ a->sign = MP_ZPOS; /* simple algo if a is less than the largest prime in the table */ if (mp_cmp_d(a, s_mp_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE-1]) == MP_LT) { /* find which prime it is bigger than "a" */ for (x = 0; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) { cmp = mp_cmp_d(a, s_mp_prime_tab[x]); if (cmp == MP_EQ) { continue; } if (cmp != MP_GT) { if ((bbs_style == 1) && ((s_mp_prime_tab[x] & 3u) != 3u)) { /* try again until we get a prime congruent to 3 mod 4 */ continue; } else { mp_set(a, s_mp_prime_tab[x]); return MP_OKAY; } } } /* fall through to the sieve */ } /* generate a prime congruent to 3 mod 4 or 1/3 mod 4? */ if (bbs_style == 1) { kstep = 4; } else { kstep = 2; } /* at this point we will use a combination of a sieve and Miller-Rabin */ if (bbs_style == 1) { /* if a mod 4 != 3 subtract the correct value to make it so */ if ((a->dp[0] & 3u) != 3u) { if ((err = mp_sub_d(a, (a->dp[0] & 3u) + 1u, a)) != MP_OKAY) { return err; } } } else { if (MP_IS_EVEN(a)) { /* force odd */ if ((err = mp_sub_d(a, 1uL, a)) != MP_OKAY) { return err; } } } /* generate the restable */ for (x = 1; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) { if ((err = mp_mod_d(a, s_mp_prime_tab[x], res_tab + x)) != MP_OKAY) { return err; } } /* init temp used for Miller-Rabin Testing */ if ((err = mp_init(&b)) != MP_OKAY) { return err; } for (;;) { /* skip to the next non-trivially divisible candidate */ step = 0; do { /* y == 1 if any residue was zero [e.g. cannot be prime] */ y = 0; /* increase step to next candidate */ step += kstep; /* compute the new residue without using division */ for (x = 1; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) { /* add the step to each residue */ res_tab[x] += kstep; /* subtract the modulus [instead of using division] */ if (res_tab[x] >= s_mp_prime_tab[x]) { res_tab[x] -= s_mp_prime_tab[x]; } /* set flag if zero */ if (res_tab[x] == 0u) { y = 1; } } } while ((y == 1) && (step < (((mp_digit)1 << MP_DIGIT_BIT) - kstep))); /* add the step */ if ((err = mp_add_d(a, step, a)) != MP_OKAY) { goto LBL_ERR; } /* if didn't pass sieve and step == MP_MAX then skip test */ if ((y == 1) && (step >= (((mp_digit)1 << MP_DIGIT_BIT) - kstep))) { continue; } if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto LBL_ERR; } if (res == MP_YES) { break; } } err = MP_OKAY; LBL_ERR: mp_clear(&b); return err; } #endif tcl9.0.3/libtommath/bn_mp_prime_miller_rabin.c0000664000175000017500000000401315104661341021061 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_MILLER_RABIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Miller-Rabin test of "a" to the base of "b" as described in * HAC pp. 139 Algorithm 4.24 * * Sets result to 0 if definitely composite or 1 if probably prime. * Randomly the chance of error is no more than 1/4 and often * very much lower. */ mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result) { mp_int n1, y, r; mp_err err; int s, j; /* default */ *result = MP_NO; /* ensure b > 1 */ if (mp_cmp_d(b, 1uL) != MP_GT) { return MP_VAL; } /* get n1 = a - 1 */ if ((err = mp_init_copy(&n1, a)) != MP_OKAY) { return err; } if ((err = mp_sub_d(&n1, 1uL, &n1)) != MP_OKAY) { goto LBL_N1; } /* set 2**s * r = n1 */ if ((err = mp_init_copy(&r, &n1)) != MP_OKAY) { goto LBL_N1; } /* count the number of least significant bits * which are zero */ s = mp_cnt_lsb(&r); /* now divide n - 1 by 2**s */ if ((err = mp_div_2d(&r, s, &r, NULL)) != MP_OKAY) { goto LBL_R; } /* compute y = b**r mod a */ if ((err = mp_init(&y)) != MP_OKAY) { goto LBL_R; } if ((err = mp_exptmod(b, &r, a, &y)) != MP_OKAY) { goto LBL_Y; } /* if y != 1 and y != n1 do */ if ((mp_cmp_d(&y, 1uL) != MP_EQ) && (mp_cmp(&y, &n1) != MP_EQ)) { j = 1; /* while j <= s-1 and y != n1 */ while ((j <= (s - 1)) && (mp_cmp(&y, &n1) != MP_EQ)) { if ((err = mp_sqrmod(&y, a, &y)) != MP_OKAY) { goto LBL_Y; } /* if y == 1 then composite */ if (mp_cmp_d(&y, 1uL) == MP_EQ) { goto LBL_Y; } ++j; } /* if y != n1 then composite */ if (mp_cmp(&y, &n1) != MP_EQ) { goto LBL_Y; } } /* probably prime now */ *result = MP_YES; LBL_Y: mp_clear(&y); LBL_R: mp_clear(&r); LBL_N1: mp_clear(&n1); return err; } #endif tcl9.0.3/libtommath/bn_mp_prime_is_prime.c0000664000175000017500000002236215104661341020240 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_IS_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* portable integer log of two with small footprint */ static unsigned int s_floor_ilog2(int value) { unsigned int r = 0; while ((value >>= 1) != 0) { r++; } return r; } mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result) { mp_int b; int ix, p_max = 0, size_a, len; mp_bool res; mp_err err; unsigned int fips_rand, mask; /* default to no */ *result = MP_NO; /* Some shortcuts */ /* N > 3 */ if (a->used == 1) { if ((a->dp[0] == 0u) || (a->dp[0] == 1u)) { *result = MP_NO; return MP_OKAY; } if (a->dp[0] == 2u) { *result = MP_YES; return MP_OKAY; } } /* N must be odd */ if (MP_IS_EVEN(a)) { return MP_OKAY; } /* N is not a perfect square: floor(sqrt(N))^2 != N */ if ((err = mp_is_square(a, &res)) != MP_OKAY) { return err; } if (res != MP_NO) { return MP_OKAY; } /* is the input equal to one of the primes in the table? */ for (ix = 0; ix < PRIVATE_MP_PRIME_TAB_SIZE; ix++) { if (mp_cmp_d(a, s_mp_prime_tab[ix]) == MP_EQ) { *result = MP_YES; return MP_OKAY; } } #ifdef MP_8BIT /* The search in the loop above was exhaustive in this case */ if ((a->used == 1) && (PRIVATE_MP_PRIME_TAB_SIZE >= 31)) { return MP_OKAY; } #endif /* first perform trial division */ if ((err = s_mp_prime_is_divisible(a, &res)) != MP_OKAY) { return err; } /* return if it was trivially divisible */ if (res == MP_YES) { return MP_OKAY; } /* Run the Miller-Rabin test with base 2 for the BPSW test. */ if ((err = mp_init_set(&b, 2uL)) != MP_OKAY) { return err; } if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } /* Rumours have it that Mathematica does a second M-R test with base 3. Other rumours have it that their strong L-S test is slightly different. It does not hurt, though, beside a bit of extra runtime. */ b.dp[0]++; if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } /* * Both, the Frobenius-Underwood test and the the Lucas-Selfridge test are quite * slow so if speed is an issue, define LTM_USE_ONLY_MR to use M-R tests with * bases 2, 3 and t random bases. */ #ifndef LTM_USE_ONLY_MR if (t >= 0) { /* * Use a Frobenius-Underwood test instead of the Lucas-Selfridge test for * MP_8BIT (It is unknown if the Lucas-Selfridge test works with 16-bit * integers but the necesssary analysis is on the todo-list). */ #if defined (MP_8BIT) || defined (LTM_USE_FROBENIUS_TEST) err = mp_prime_frobenius_underwood(a, &res); if ((err != MP_OKAY) && (err != MP_ITER)) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } #else if ((err = mp_prime_strong_lucas_selfridge(a, &res)) != MP_OKAY) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } #endif } #endif /* run at least one Miller-Rabin test with a random base */ if (t == 0) { t = 1; } /* Only recommended if the input range is known to be < 3317044064679887385961981 It uses the bases necessary for a deterministic M-R test if the input is smaller than 3317044064679887385961981 The caller has to check the size. TODO: can be made a bit finer grained but comparing is not free. */ if (t < 0) { /* Sorenson, Jonathan; Webster, Jonathan (2015). "Strong Pseudoprimes to Twelve Prime Bases". */ /* 0x437ae92817f9fc85b7e5 = 318665857834031151167461 */ if ((err = mp_read_radix(&b, "437ae92817f9fc85b7e5", 16)) != MP_OKAY) { goto LBL_B; } if (mp_cmp(a, &b) == MP_LT) { p_max = 12; } else { /* 0x2be6951adc5b22410a5fd = 3317044064679887385961981 */ if ((err = mp_read_radix(&b, "2be6951adc5b22410a5fd", 16)) != MP_OKAY) { goto LBL_B; } if (mp_cmp(a, &b) == MP_LT) { p_max = 13; } else { err = MP_VAL; goto LBL_B; } } /* we did bases 2 and 3 already, skip them */ for (ix = 2; ix < p_max; ix++) { mp_set(&b, s_mp_prime_tab[ix]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } } } /* Do "t" M-R tests with random bases between 3 and "a". See Fips 186.4 p. 126ff */ else if (t > 0) { /* * The mp_digit's have a defined bit-size but the size of the * array a.dp is a simple 'int' and this library can not assume full * compliance to the current C-standard (ISO/IEC 9899:2011) because * it gets used for small embeded processors, too. Some of those MCUs * have compilers that one cannot call standard compliant by any means. * Hence the ugly type-fiddling in the following code. */ size_a = mp_count_bits(a); mask = (1u << s_floor_ilog2(size_a)) - 1u; /* Assuming the General Rieman hypothesis (never thought to write that in a comment) the upper bound can be lowered to 2*(log a)^2. E. Bach, "Explicit bounds for primality testing and related problems," Math. Comp. 55 (1990), 355-380. size_a = (size_a/10) * 7; len = 2 * (size_a * size_a); E.g.: a number of size 2^2048 would be reduced to the upper limit floor(2048/10)*7 = 1428 2 * 1428^2 = 4078368 (would have been ~4030331.9962 with floats and natural log instead) That number is smaller than 2^28, the default bit-size of mp_digit. */ /* How many tests, you might ask? Dana Jacobsen of Math::Prime::Util fame does exactly 1. In words: one. Look at the end of _GMP_is_prime() in Math-Prime-Util-GMP-0.50/primality.c if you do not believe it. The function mp_rand() goes to some length to use a cryptographically good PRNG. That also means that the chance to always get the same base in the loop is non-zero, although very low. If the BPSW test and/or the addtional Frobenious test have been performed instead of just the Miller-Rabin test with the bases 2 and 3, a single extra test should suffice, so such a very unlikely event will not do much harm. To preemptivly answer the dangling question: no, a witness does not need to be prime. */ for (ix = 0; ix < t; ix++) { /* mp_rand() guarantees the first digit to be non-zero */ if ((err = mp_rand(&b, 1)) != MP_OKAY) { goto LBL_B; } /* * Reduce digit before casting because mp_digit might be bigger than * an unsigned int and "mask" on the other side is most probably not. */ fips_rand = (unsigned int)(b.dp[0] & (mp_digit) mask); #ifdef MP_8BIT /* * One 8-bit digit is too small, so concatenate two if the size of * unsigned int allows for it. */ if ((MP_SIZEOF_BITS(unsigned int)/2) >= MP_SIZEOF_BITS(mp_digit)) { if ((err = mp_rand(&b, 1)) != MP_OKAY) { goto LBL_B; } fips_rand <<= MP_SIZEOF_BITS(mp_digit); fips_rand |= (unsigned int) b.dp[0]; fips_rand &= mask; } #endif if (fips_rand > (unsigned int)(INT_MAX - MP_DIGIT_BIT)) { len = INT_MAX / MP_DIGIT_BIT; } else { len = (((int)fips_rand + MP_DIGIT_BIT) / MP_DIGIT_BIT); } /* Unlikely. */ if (len < 0) { ix--; continue; } /* * As mentioned above, one 8-bit digit is too small and * although it can only happen in the unlikely case that * an "unsigned int" is smaller than 16 bit a simple test * is cheap and the correction even cheaper. */ #ifdef MP_8BIT /* All "a" < 2^8 have been caught before */ if (len == 1) { len++; } #endif if ((err = mp_rand(&b, len)) != MP_OKAY) { goto LBL_B; } /* * That number might got too big and the witness has to be * smaller than "a" */ len = mp_count_bits(&b); if (len >= size_a) { len = (len - size_a) + 1; if ((err = mp_div_2d(&b, len, &b, NULL)) != MP_OKAY) { goto LBL_B; } } /* Although the chance for b <= 3 is miniscule, try again. */ if (mp_cmp_d(&b, 3uL) != MP_GT) { ix--; continue; } if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_B; } if (res == MP_NO) { goto LBL_B; } } } /* passed the test */ *result = MP_YES; LBL_B: mp_clear(&b); return err; } #endif tcl9.0.3/libtommath/bn_mp_prime_frobenius_underwood.c0000664000175000017500000001062315104661341022510 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_FROBENIUS_UNDERWOOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* * See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details */ #ifndef LTM_USE_ONLY_MR #ifdef MP_8BIT /* * floor of positive solution of * (2^16)-1 = (a+4)*(2*a+5) * TODO: Both values are smaller than N^(1/4), would have to use a bigint * for a instead but any a biger than about 120 are already so rare that * it is possible to ignore them and still get enough pseudoprimes. * But it is still a restriction of the set of available pseudoprimes * which makes this implementation less secure if used stand-alone. */ #define LTM_FROBENIUS_UNDERWOOD_A 177 #else #define LTM_FROBENIUS_UNDERWOOD_A 32764 #endif mp_err mp_prime_frobenius_underwood(const mp_int *N, mp_bool *result) { mp_int T1z, T2z, Np1z, sz, tz; int a, ap2, length, i, j; mp_err err; *result = MP_NO; if ((err = mp_init_multi(&T1z, &T2z, &Np1z, &sz, &tz, (void *)NULL)) != MP_OKAY) { return err; } for (a = 0; a < LTM_FROBENIUS_UNDERWOOD_A; a++) { /* TODO: That's ugly! No, really, it is! */ if ((a==2) || (a==4) || (a==7) || (a==8) || (a==10) || (a==14) || (a==18) || (a==23) || (a==26) || (a==28)) { continue; } /* (32764^2 - 4) < 2^31, no bigint for >MP_8BIT needed) */ mp_set_u32(&T1z, (uint32_t)a); if ((err = mp_sqr(&T1z, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_sub_d(&T1z, 4uL, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_kronecker(&T1z, N, &j)) != MP_OKAY) goto LBL_FU_ERR; if (j == -1) { break; } if (j == 0) { /* composite */ goto LBL_FU_ERR; } } /* Tell it a composite and set return value accordingly */ if (a >= LTM_FROBENIUS_UNDERWOOD_A) { err = MP_ITER; goto LBL_FU_ERR; } /* Composite if N and (a+4)*(2*a+5) are not coprime */ mp_set_u32(&T1z, (uint32_t)((a+4)*((2*a)+5))); if ((err = mp_gcd(N, &T1z, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if (!((T1z.used == 1) && (T1z.dp[0] == 1u))) goto LBL_FU_ERR; ap2 = a + 2; if ((err = mp_add_d(N, 1uL, &Np1z)) != MP_OKAY) goto LBL_FU_ERR; mp_set(&sz, 1uL); mp_set(&tz, 2uL); length = mp_count_bits(&Np1z); for (i = length - 2; i >= 0; i--) { /* * temp = (sz*(a*sz+2*tz))%N; * tz = ((tz-sz)*(tz+sz))%N; * sz = temp; */ if ((err = mp_mul_2(&tz, &T2z)) != MP_OKAY) goto LBL_FU_ERR; /* a = 0 at about 50% of the cases (non-square and odd input) */ if (a != 0) { if ((err = mp_mul_d(&sz, (mp_digit)a, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_add(&T1z, &T2z, &T2z)) != MP_OKAY) goto LBL_FU_ERR; } if ((err = mp_mul(&T2z, &sz, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_sub(&tz, &sz, &T2z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_add(&sz, &tz, &sz)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_mul(&sz, &T2z, &tz)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_mod(&tz, N, &tz)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_mod(&T1z, N, &sz)) != MP_OKAY) goto LBL_FU_ERR; if (s_mp_get_bit(&Np1z, (unsigned int)i) == MP_YES) { /* * temp = (a+2) * sz + tz * tz = 2 * tz - sz * sz = temp */ if (a == 0) { if ((err = mp_mul_2(&sz, &T1z)) != MP_OKAY) goto LBL_FU_ERR; } else { if ((err = mp_mul_d(&sz, (mp_digit)ap2, &T1z)) != MP_OKAY) goto LBL_FU_ERR; } if ((err = mp_add(&T1z, &tz, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_mul_2(&tz, &T2z)) != MP_OKAY) goto LBL_FU_ERR; if ((err = mp_sub(&T2z, &sz, &tz)) != MP_OKAY) goto LBL_FU_ERR; mp_exch(&sz, &T1z); } } mp_set_u32(&T1z, (uint32_t)((2 * a) + 5)); if ((err = mp_mod(&T1z, N, &T1z)) != MP_OKAY) goto LBL_FU_ERR; if (MP_IS_ZERO(&sz) && (mp_cmp(&tz, &T1z) == MP_EQ)) { *result = MP_YES; } LBL_FU_ERR: mp_clear_multi(&tz, &sz, &Np1z, &T2z, &T1z, (void *)NULL); return err; } #endif #endif tcl9.0.3/libtommath/bn_mp_prime_fermat.c0000664000175000017500000000204115104661341017677 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PRIME_FERMAT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* performs one Fermat test. * * If "a" were prime then b**a == b (mod a) since the order of * the multiplicative sub-group would be phi(a) = a-1. That means * it would be the same as b**(a mod (a-1)) == b**1 == b (mod a). * * Sets result to 1 if the congruence holds, or zero otherwise. */ mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result) { mp_int t; mp_err err; /* default to composite */ *result = MP_NO; /* ensure b > 1 */ if (mp_cmp_d(b, 1uL) != MP_GT) { return MP_VAL; } /* init t */ if ((err = mp_init(&t)) != MP_OKAY) { return err; } /* compute t = b**a mod a */ if ((err = mp_exptmod(b, a, a, &t)) != MP_OKAY) { goto LBL_T; } /* is it equal to b? */ if (mp_cmp(&t, b) == MP_EQ) { *result = MP_YES; } err = MP_OKAY; LBL_T: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_pack_count.c0000664000175000017500000000057715076154261017375 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PACK_COUNT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) { size_t bits = (size_t)mp_count_bits(a); return ((bits / ((size * 8u) - nails)) + (((bits % ((size * 8u) - nails)) != 0u) ? 1u : 0u)); } #endif tcl9.0.3/libtommath/bn_mp_pack.c0000664000175000017500000000335415076154261016161 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_PACK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* based on gmp's mpz_export. * see http://gmplib.org/manual/Integer-Import-and-Export.html */ mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size, mp_endian endian, size_t nails, const mp_int *op) { mp_err err; size_t odd_nails, nail_bytes, i, j, count; unsigned char odd_nail_mask; mp_int t; count = mp_pack_count(op, nails, size); if (count > maxcount) { return MP_BUF; } if ((err = mp_init_copy(&t, op)) != MP_OKAY) { return err; } if (endian == MP_NATIVE_ENDIAN) { MP_GET_ENDIANNESS(endian); } odd_nails = (nails % 8u); odd_nail_mask = 0xff; for (i = 0u; i < odd_nails; ++i) { odd_nail_mask ^= (unsigned char)(1u << (7u - i)); } nail_bytes = nails / 8u; for (i = 0u; i < count; ++i) { for (j = 0u; j < size; ++j) { unsigned char *byte = (unsigned char *)rop + (((order == MP_LSB_FIRST) ? i : ((count - 1u) - i)) * size) + ((endian == MP_LITTLE_ENDIAN) ? j : ((size - 1u) - j)); if (j >= (size - nail_bytes)) { *byte = 0; continue; } *byte = (unsigned char)((j == ((size - nail_bytes) - 1u)) ? (t.dp[0] & odd_nail_mask) : (t.dp[0] & 0xFFuL)); if ((err = mp_div_2d(&t, (j == ((size - nail_bytes) - 1u)) ? (int)(8u - odd_nails) : 8, &t, NULL)) != MP_OKAY) { goto LBL_ERR; } } } if (written != NULL) { *written = count; } err = MP_OKAY; LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_or.c0000664000175000017500000000263715076154261015666 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_OR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* two complement or */ mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c) { int used = MP_MAX(a->used, b->used) + 1, i; mp_err err; mp_digit ac = 1, bc = 1, cc = 1; mp_sign csign = ((a->sign == MP_NEG) || (b->sign == MP_NEG)) ? MP_NEG : MP_ZPOS; if (c->alloc < used) { if ((err = mp_grow(c, used)) != MP_OKAY) { return err; } } for (i = 0; i < used; i++) { mp_digit x, y; /* convert to two complement if negative */ if (a->sign == MP_NEG) { ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK); x = ac & MP_MASK; ac >>= MP_DIGIT_BIT; } else { x = (i >= a->used) ? 0uL : a->dp[i]; } /* convert to two complement if negative */ if (b->sign == MP_NEG) { bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK); y = bc & MP_MASK; bc >>= MP_DIGIT_BIT; } else { y = (i >= b->used) ? 0uL : b->dp[i]; } c->dp[i] = x | y; /* convert to to sign-magnitude if negative */ if (csign == MP_NEG) { cc += ~c->dp[i] & MP_MASK; c->dp[i] = cc & MP_MASK; cc >>= MP_DIGIT_BIT; } } c->used = used; c->sign = csign; mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_neg.c0000664000175000017500000000074215076154261016012 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_NEG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = -a */ mp_err mp_neg(const mp_int *a, mp_int *b) { mp_err err; if (a != b) { if ((err = mp_copy(a, b)) != MP_OKAY) { return err; } } if (!MP_IS_ZERO(b)) { b->sign = (a->sign == MP_ZPOS) ? MP_NEG : MP_ZPOS; } else { b->sign = MP_ZPOS; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mul_d.c0000664000175000017500000000257715076154261016351 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MUL_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* multiply by a digit */ mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) { mp_digit u, *tmpa, *tmpc; mp_word r; mp_err err; int ix, olduse; /* make sure c is big enough to hold a*b */ if (c->alloc < (a->used + 1)) { if ((err = mp_grow(c, a->used + 1)) != MP_OKAY) { return err; } } /* get the original destinations used count */ olduse = c->used; /* set the sign */ c->sign = a->sign; /* alias for a->dp [source] */ tmpa = a->dp; /* alias for c->dp [dest] */ tmpc = c->dp; /* zero carry */ u = 0; /* compute columns */ for (ix = 0; ix < a->used; ix++) { /* compute product and carry sum for this term */ r = (mp_word)u + ((mp_word)*tmpa++ * (mp_word)b); /* mask off higher bits to get a single digit */ *tmpc++ = (mp_digit)(r & (mp_word)MP_MASK); /* send carry into next iteration */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); } /* store final carry [if any] and increment ix offset */ *tmpc++ = u; ++ix; /* now zero digits above the top */ MP_ZERO_DIGITS(tmpc, olduse - ix); /* set used count */ c->used = a->used + 1; mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mul_2d.c0000664000175000017500000000316415076154261016424 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MUL_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift left by a certain bit count */ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) { mp_digit d; mp_err err; if (b < 0) { return MP_VAL; } /* copy */ if (a != c) { if ((err = mp_copy(a, c)) != MP_OKAY) { return err; } } if (c->alloc < (c->used + (b / MP_DIGIT_BIT) + 1)) { if ((err = mp_grow(c, c->used + (b / MP_DIGIT_BIT) + 1)) != MP_OKAY) { return err; } } /* shift by as many digits in the bit count */ if (b >= MP_DIGIT_BIT) { if ((err = mp_lshd(c, b / MP_DIGIT_BIT)) != MP_OKAY) { return err; } } /* shift any bit count < MP_DIGIT_BIT */ d = (mp_digit)(b % MP_DIGIT_BIT); if (d != 0u) { mp_digit *tmpc, shift, mask, r, rr; int x; /* bitmask for carries */ mask = ((mp_digit)1 << d) - (mp_digit)1; /* shift for msbs */ shift = (mp_digit)MP_DIGIT_BIT - d; /* alias */ tmpc = c->dp; /* carry */ r = 0; for (x = 0; x < c->used; x++) { /* get the higher bits of the current word */ rr = (*tmpc >> shift) & mask; /* shift the current word and OR in the carry */ *tmpc = ((*tmpc << d) | r) & MP_MASK; ++tmpc; /* set the carry to the carry bits of the current word */ r = rr; } /* set final carry */ if (r != 0u) { c->dp[(c->used)++] = r; } } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mul_2.c0000664000175000017500000000270715076154261016262 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MUL_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = a*2 */ mp_err mp_mul_2(const mp_int *a, mp_int *b) { int x, oldused; mp_err err; /* grow to accomodate result */ if (b->alloc < (a->used + 1)) { if ((err = mp_grow(b, a->used + 1)) != MP_OKAY) { return err; } } oldused = b->used; b->used = a->used; { mp_digit r, rr, *tmpa, *tmpb; /* alias for source */ tmpa = a->dp; /* alias for dest */ tmpb = b->dp; /* carry */ r = 0; for (x = 0; x < a->used; x++) { /* get what will be the *next* carry bit from the * MSB of the current digit */ rr = *tmpa >> (mp_digit)(MP_DIGIT_BIT - 1); /* now shift up this digit, add in the carry [from the previous] */ *tmpb++ = ((*tmpa++ << 1uL) | r) & MP_MASK; /* copy the carry that would be from the source * digit into the next iteration */ r = rr; } /* new leading digit? */ if (r != 0u) { /* add a MSB which is always 1 at this point */ *tmpb = 1; ++(b->used); } /* now zero any excess digits on the destination * that we didn't write to */ MP_ZERO_DIGITS(b->dp + b->used, oldused - b->used); } b->sign = a->sign; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mulmod.c0000664000175000017500000000101415104661341016521 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MULMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* d = a * b (mod c) */ mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) { mp_err err; mp_int t; if ((err = mp_init_size(&t, c->used)) != MP_OKAY) { return err; } if ((err = mp_mul(a, b, &t)) != MP_OKAY) { goto LBL_ERR; } err = mp_mod(&t, c, d); LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_mul.c0000664000175000017500000000413315076154261016034 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* high level multiplication (handles sign) */ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c) { mp_err err; int min_len = MP_MIN(a->used, b->used), max_len = MP_MAX(a->used, b->used), digs = a->used + b->used + 1; mp_sign neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; if (a == b) { return mp_sqr(a,c); } else if (MP_HAS(S_MP_BALANCE_MUL) && /* Check sizes. The smaller one needs to be larger than the Karatsuba cut-off. * The bigger one needs to be at least about one MP_KARATSUBA_MUL_CUTOFF bigger * to make some sense, but it depends on architecture, OS, position of the * stars... so YMMV. * Using it to cut the input into slices small enough for s_mp_mul_digs_fast * was actually slower on the author's machine, but YMMV. */ (min_len >= MP_KARATSUBA_MUL_CUTOFF) && ((max_len / 2) >= MP_KARATSUBA_MUL_CUTOFF) && /* Not much effect was observed below a ratio of 1:2, but again: YMMV. */ (max_len >= (2 * min_len))) { err = s_mp_balance_mul(a,b,c); } else if (MP_HAS(S_MP_TOOM_MUL) && (min_len >= MP_TOOM_MUL_CUTOFF)) { err = s_mp_toom_mul(a, b, c); } else if (MP_HAS(S_MP_KARATSUBA_MUL) && (min_len >= MP_KARATSUBA_MUL_CUTOFF)) { err = s_mp_karatsuba_mul(a, b, c); } else if (MP_HAS(S_MP_MUL_DIGS_FAST) && /* can we use the fast multiplier? * * The fast multiplier can be used if the output will * have less than MP_WARRAY digits and the number of * digits won't affect carry propagation */ (digs < MP_WARRAY) && (min_len <= MP_MAXFAST)) { err = s_mp_mul_digs_fast(a, b, c, digs); } else if (MP_HAS(S_MP_MUL_DIGS)) { err = s_mp_mul_digs(a, b, c, digs); } else { err = MP_VAL; } c->sign = (c->used > 0) ? neg : MP_ZPOS; return err; } #endif tcl9.0.3/libtommath/bn_mp_montgomery_setup.c0000664000175000017500000000222015104661341020644 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MONTGOMERY_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* setups the montgomery reduction stuff */ mp_err mp_montgomery_setup(const mp_int *n, mp_digit *rho) { mp_digit x, b; /* fast inversion mod 2**k * * Based on the fact that * * XA = 1 (mod 2**n) => (X(2-XA)) A = 1 (mod 2**2n) * => 2*X*A - X*X*A*A = 1 * => 2*(1) - (1) = 1 */ b = n->dp[0]; if ((b & 1u) == 0u) { return MP_VAL; } x = (((b + 2u) & 4u) << 1) + b; /* here x*a==1 mod 2**4 */ x *= 2u - (b * x); /* here x*a==1 mod 2**8 */ #if !defined(MP_8BIT) x *= 2u - (b * x); /* here x*a==1 mod 2**16 */ #endif #if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT)) x *= 2u - (b * x); /* here x*a==1 mod 2**32 */ #endif #ifdef MP_64BIT x *= 2u - (b * x); /* here x*a==1 mod 2**64 */ #endif /* rho = -1/m mod b */ *rho = (mp_digit)(((mp_word)1 << (mp_word)MP_DIGIT_BIT) - x) & MP_MASK; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_montgomery_reduce.c0000664000175000017500000000524715104661341020767 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MONTGOMERY_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) { int ix, digs; mp_err err; mp_digit mu; /* can the fast reduction [comba] method be used? * * Note that unlike in mul you're safely allowed *less* * than the available columns [255 per default] since carries * are fixed up in the inner loop. */ digs = (n->used * 2) + 1; if ((digs < MP_WARRAY) && (x->used <= MP_WARRAY) && (n->used < MP_MAXFAST)) { return s_mp_montgomery_reduce_fast(x, n, rho); } /* grow the input as required */ if (x->alloc < digs) { if ((err = mp_grow(x, digs)) != MP_OKAY) { return err; } } x->used = digs; for (ix = 0; ix < n->used; ix++) { /* mu = ai * rho mod b * * The value of rho must be precalculated via * montgomery_setup() such that * it equals -1/n0 mod b this allows the * following inner loop to reduce the * input one digit at a time */ mu = (mp_digit)(((mp_word)x->dp[ix] * (mp_word)rho) & MP_MASK); /* a = a + mu * m * b**i */ { int iy; mp_digit *tmpn, *tmpx, u; mp_word r; /* alias for digits of the modulus */ tmpn = n->dp; /* alias for the digits of x [the input] */ tmpx = x->dp + ix; /* set the carry to zero */ u = 0; /* Multiply and add in place */ for (iy = 0; iy < n->used; iy++) { /* compute product and sum */ r = ((mp_word)mu * (mp_word)*tmpn++) + (mp_word)u + (mp_word)*tmpx; /* get carry */ u = (mp_digit)(r >> (mp_word)MP_DIGIT_BIT); /* fix digit */ *tmpx++ = (mp_digit)(r & (mp_word)MP_MASK); } /* At this point the ix'th digit of x should be zero */ /* propagate carries upwards as required*/ while (u != 0u) { *tmpx += u; u = *tmpx >> MP_DIGIT_BIT; *tmpx++ &= MP_MASK; } } } /* at this point the n.used'th least * significant digits of x are all zero * which means we can shift x to the * right by n.used digits and the * residue is unchanged. */ /* x = x/b**n.used */ mp_clamp(x); mp_rshd(x, n->used); /* if x >= n then x = x - n */ if (mp_cmp_mag(x, n) != MP_LT) { return s_mp_sub(x, n, x); } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_montgomery_calc_normalization.c0000664000175000017500000000216015104661341023357 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* * shifts with subtractions when the result is greater than b. * * The method is slightly modified to shift B unconditionally upto just under * the leading bit of b. This saves alot of multiple precision shifting. */ mp_err mp_montgomery_calc_normalization(mp_int *a, const mp_int *b) { int x, bits; mp_err err; /* how many bits of last digit does b use */ bits = mp_count_bits(b) % MP_DIGIT_BIT; if (b->used > 1) { if ((err = mp_2expt(a, ((b->used - 1) * MP_DIGIT_BIT) + bits - 1)) != MP_OKAY) { return err; } } else { mp_set(a, 1uL); bits = 1; } /* now compute C = A * B mod b */ for (x = bits - 1; x < (int)MP_DIGIT_BIT; x++) { if ((err = mp_mul_2(a, a)) != MP_OKAY) { return err; } if (mp_cmp_mag(a, b) != MP_LT) { if ((err = s_mp_sub(a, b, a)) != MP_OKAY) { return err; } } } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mod_d.c0000664000175000017500000000041115104661341016306 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MOD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) { return mp_div_d(a, b, NULL, c); } #endif tcl9.0.3/libtommath/bn_mp_mod_2d.c0000664000175000017500000000171315076154261016404 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MOD_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* calc a value mod 2**b */ mp_err mp_mod_2d(const mp_int *a, int b, mp_int *c) { int x; mp_err err; /* if b is <= 0 then zero the int */ if (b <= 0) { mp_zero(c); return MP_OKAY; } /* if the modulus is larger than the value than return */ if (b >= (a->used * MP_DIGIT_BIT)) { return mp_copy(a, c); } /* copy */ if ((err = mp_copy(a, c)) != MP_OKAY) { return err; } /* zero digits above the last digit of the modulus */ x = (b / MP_DIGIT_BIT) + (((b % MP_DIGIT_BIT) == 0) ? 0 : 1); MP_ZERO_DIGITS(c->dp + x, c->used - x); /* clear the digit that is not completely outside/inside the modulus */ c->dp[b / MP_DIGIT_BIT] &= ((mp_digit)1 << (mp_digit)(b % MP_DIGIT_BIT)) - (mp_digit)1; mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_mod.c0000664000175000017500000000122115076154261016011 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_MOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* c = a mod b, 0 <= c < b if b > 0, b < c <= 0 if b < 0 */ mp_err mp_mod(const mp_int *a, const mp_int *b, mp_int *c) { mp_int t; mp_err err; if ((err = mp_init_size(&t, b->used)) != MP_OKAY) { return err; } if ((err = mp_div(a, b, NULL, &t)) != MP_OKAY) { goto LBL_ERR; } if (MP_IS_ZERO(&t) || (t.sign == b->sign)) { err = MP_OKAY; mp_exch(&t, c); } else { err = mp_add(b, &t, c); } LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_lshd.c0000664000175000017500000000221615076154261016171 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_LSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift left a certain amount of digits */ mp_err mp_lshd(mp_int *a, int b) { int x; mp_err err; mp_digit *top, *bottom; /* if its less than zero return */ if (b <= 0) { return MP_OKAY; } /* no need to shift 0 around */ if (MP_IS_ZERO(a)) { return MP_OKAY; } /* grow to fit the new digits */ if (a->alloc < (a->used + b)) { if ((err = mp_grow(a, a->used + b)) != MP_OKAY) { return err; } } /* increment the used by the shift amount then copy upwards */ a->used += b; /* top */ top = a->dp + a->used - 1; /* base */ bottom = (a->dp + a->used - 1) - b; /* much like mp_rshd this is implemented using a sliding window * except the window goes the otherway around. Copying from * the bottom to the top. see bn_mp_rshd.c for more info. */ for (x = a->used - 1; x >= b; x--) { *top-- = *bottom--; } /* zero the lower digits */ MP_ZERO_DIGITS(a->dp, b); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_log_n.c0000664000175000017500000000130015104661341016320 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_LOG_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_err mp_log_n(const mp_int *a, int base, int *c) { if (mp_isneg(a) || mp_iszero(a) || (base < 2) || (unsigned)base > (unsigned)MP_DIGIT_MAX) { return MP_VAL; } if (MP_HAS(S_MP_LOG_2EXPT) && MP_IS_2EXPT((mp_digit)base)) { *c = s_mp_log_2expt(a, (mp_digit)base); return MP_OKAY; } if (MP_HAS(S_MP_LOG_D) && (a->used == 1)) { *c = s_mp_log_d((mp_digit)base, a->dp[0]); return MP_OKAY; } if (MP_HAS(S_MP_LOG)) { return s_mp_log(a, (mp_digit)base, c); } return MP_VAL; } #endif tcl9.0.3/libtommath/bn_mp_lcm.c0000664000175000017500000000211315104661341016000 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_LCM_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes least common multiple as |a*b|/(a, b) */ mp_err mp_lcm(const mp_int *a, const mp_int *b, mp_int *c) { mp_err err; mp_int t1, t2; if ((err = mp_init_multi(&t1, &t2, (void *)NULL)) != MP_OKAY) { return err; } /* t1 = get the GCD of the two inputs */ if ((err = mp_gcd(a, b, &t1)) != MP_OKAY) { goto LBL_T; } /* divide the smallest by the GCD */ if (mp_cmp_mag(a, b) == MP_LT) { /* store quotient in t2 such that t2 * b is the LCM */ if ((err = mp_div(a, &t1, &t2, NULL)) != MP_OKAY) { goto LBL_T; } err = mp_mul(b, &t2, c); } else { /* store quotient in t2 such that t2 * a is the LCM */ if ((err = mp_div(b, &t1, &t2, NULL)) != MP_OKAY) { goto LBL_T; } err = mp_mul(a, &t2, c); } /* fix the sign to positive */ c->sign = MP_ZPOS; LBL_T: mp_clear_multi(&t1, &t2, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_mp_kronecker.c0000664000175000017500000000530315104661341017214 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_KRONECKER_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Kronecker symbol (a|p) Straightforward implementation of algorithm 1.4.10 in Henri Cohen: "A Course in Computational Algebraic Number Theory" @book{cohen2013course, title={A course in computational algebraic number theory}, author={Cohen, Henri}, volume={138}, year={2013}, publisher={Springer Science \& Business Media} } */ mp_err mp_kronecker(const mp_int *a, const mp_int *p, int *c) { mp_int a1, p1, r; mp_err err; int v, k; static const int table[8] = {0, 1, 0, -1, 0, -1, 0, 1}; if (MP_IS_ZERO(p)) { if ((a->used == 1) && (a->dp[0] == 1u)) { *c = 1; } else { *c = 0; } return MP_OKAY; } if (MP_IS_EVEN(a) && MP_IS_EVEN(p)) { *c = 0; return MP_OKAY; } if ((err = mp_init_copy(&a1, a)) != MP_OKAY) { return err; } if ((err = mp_init_copy(&p1, p)) != MP_OKAY) { goto LBL_KRON_0; } v = mp_cnt_lsb(&p1); if ((err = mp_div_2d(&p1, v, &p1, NULL)) != MP_OKAY) { goto LBL_KRON_1; } if ((v & 1) == 0) { k = 1; } else { k = table[a->dp[0] & 7u]; } if (p1.sign == MP_NEG) { p1.sign = MP_ZPOS; if (a1.sign == MP_NEG) { k = -k; } } if ((err = mp_init(&r)) != MP_OKAY) { goto LBL_KRON_1; } for (;;) { if (MP_IS_ZERO(&a1)) { if (mp_cmp_d(&p1, 1uL) == MP_EQ) { *c = k; goto LBL_KRON; } else { *c = 0; goto LBL_KRON; } } v = mp_cnt_lsb(&a1); if ((err = mp_div_2d(&a1, v, &a1, NULL)) != MP_OKAY) { goto LBL_KRON; } if ((v & 1) == 1) { k = k * table[p1.dp[0] & 7u]; } if (a1.sign == MP_NEG) { /* * Compute k = (-1)^((a1)*(p1-1)/4) * k * a1.dp[0] + 1 cannot overflow because the MSB * of the type mp_digit is not set by definition */ if (((a1.dp[0] + 1u) & p1.dp[0] & 2u) != 0u) { k = -k; } } else { /* compute k = (-1)^((a1-1)*(p1-1)/4) * k */ if ((a1.dp[0] & p1.dp[0] & 2u) != 0u) { k = -k; } } if ((err = mp_copy(&a1, &r)) != MP_OKAY) { goto LBL_KRON; } r.sign = MP_ZPOS; if ((err = mp_mod(&p1, &r, &a1)) != MP_OKAY) { goto LBL_KRON; } if ((err = mp_copy(&r, &p1)) != MP_OKAY) { goto LBL_KRON; } } LBL_KRON: mp_clear(&r); LBL_KRON_1: mp_clear(&p1); LBL_KRON_0: mp_clear(&a1); return err; } #endif tcl9.0.3/libtommath/bn_mp_is_square.c0000664000175000017500000000552315104661341017230 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_IS_SQUARE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Check if remainders are possible squares - fast exclude non-squares */ static const char rem_128[128] = { 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 }; static const char rem_105[105] = { 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1 }; /* Store non-zero to ret if arg is square, and zero if not */ mp_err mp_is_square(const mp_int *arg, mp_bool *ret) { mp_err err; mp_digit c; mp_int t; unsigned long r; /* Default to Non-square :) */ *ret = MP_NO; if (arg->sign == MP_NEG) { return MP_VAL; } if (MP_IS_ZERO(arg)) { return MP_OKAY; } /* First check mod 128 (suppose that MP_DIGIT_BIT is at least 7) */ if (rem_128[127u & arg->dp[0]] == (char)1) { return MP_OKAY; } /* Next check mod 105 (3*5*7) */ if ((err = mp_mod_d(arg, 105uL, &c)) != MP_OKAY) { return err; } if (rem_105[c] == (char)1) { return MP_OKAY; } if ((err = mp_init_u32(&t, 11u*13u*17u*19u*23u*29u*31u)) != MP_OKAY) { return err; } if ((err = mp_mod(arg, &t, &t)) != MP_OKAY) { goto LBL_ERR; } r = mp_get_u32(&t); /* Check for other prime modules, note it's not an ERROR but we must * free "t" so the easiest way is to goto LBL_ERR. We know that err * is already equal to MP_OKAY from the mp_mod call */ if (((1uL<<(r%11uL)) & 0x5C4uL) != 0uL) goto LBL_ERR; if (((1uL<<(r%13uL)) & 0x9E4uL) != 0uL) goto LBL_ERR; if (((1uL<<(r%17uL)) & 0x5CE8uL) != 0uL) goto LBL_ERR; if (((1uL<<(r%19uL)) & 0x4F50CuL) != 0uL) goto LBL_ERR; if (((1uL<<(r%23uL)) & 0x7ACCA0uL) != 0uL) goto LBL_ERR; if (((1uL<<(r%29uL)) & 0xC2EDD0CuL) != 0uL) goto LBL_ERR; if (((1uL<<(r%31uL)) & 0x6DE2B848uL) != 0uL) goto LBL_ERR; /* Final check - is sqr(sqrt(arg)) == arg ? */ if ((err = mp_sqrt(arg, &t)) != MP_OKAY) { goto LBL_ERR; } if ((err = mp_sqr(&t, &t)) != MP_OKAY) { goto LBL_ERR; } *ret = (mp_cmp_mag(&t, arg) == MP_EQ) ? MP_YES : MP_NO; LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_isodd.c0000664000175000017500000000036715104661341016340 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ISODD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_bool mp_isodd(const mp_int *a) { return MP_IS_ODD(a) ? MP_YES : MP_NO; } #endif tcl9.0.3/libtommath/bn_mp_iseven.c0000664000175000017500000000037215104661341016523 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ISEVEN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ mp_bool mp_iseven(const mp_int *a) { return MP_IS_EVEN(a) ? MP_YES : MP_NO; } #endif tcl9.0.3/libtommath/bn_mp_invmod.c0000664000175000017500000000121215104661341016520 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INVMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* hac 14.61, pp608 */ mp_err mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) { /* b cannot be negative and has to be >1 */ if ((b->sign == MP_NEG) || (mp_cmp_d(b, 1uL) != MP_GT)) { return MP_VAL; } /* if the modulus is odd we can use a faster routine instead */ if (MP_HAS(S_MP_INVMOD_FAST) && MP_IS_ODD(b)) { return s_mp_invmod_fast(a, b, c); } return MP_HAS(S_MP_INVMOD_SLOW) ? s_mp_invmod_slow(a, b, c) : MP_VAL; } #endif tcl9.0.3/libtommath/bn_mp_init_ul.c0000664000175000017500000000033415104661341016673 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_ul, mp_set_ul, unsigned long) #endif tcl9.0.3/libtommath/bn_mp_init_u64.c0000664000175000017500000000033215104661341016667 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_u64, mp_set_u64, uint64_t) #endif tcl9.0.3/libtommath/bn_mp_init_u32.c0000664000175000017500000000033215104661341016662 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_u32, mp_set_u32, uint32_t) #endif tcl9.0.3/libtommath/bn_mp_init_size.c0000664000175000017500000000110715076154261017232 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* init an mp_init for a given size */ mp_err mp_init_size(mp_int *a, int size) { if (size < 0) { return MP_VAL; } size = MP_MAX(MP_MIN_PREC, size); /* alloc mem */ a->dp = (mp_digit *) MP_CALLOC((size_t)size, sizeof(mp_digit)); if (a->dp == NULL) { return MP_MEM; } /* set the members */ a->used = 0; a->alloc = size; a->sign = MP_ZPOS; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_init_set.c0000664000175000017500000000055015076154261017054 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* initialize and set a digit */ mp_err mp_init_set(mp_int *a, mp_digit b) { mp_err err; if ((err = mp_init(a)) != MP_OKAY) { return err; } mp_set(a, b); return err; } #endif tcl9.0.3/libtommath/bn_mp_init_multi.c0000664000175000017500000000217515076154261017420 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #include mp_err mp_init_multi(mp_int *mp, ...) { mp_err err = MP_OKAY; /* Assume ok until proven otherwise */ int n = 0; /* Number of ok inits */ mp_int *cur_arg = mp; va_list args; va_start(args, mp); /* init args to next argument from caller */ while (cur_arg != NULL) { if (mp_init(cur_arg) != MP_OKAY) { /* Oops - error! Back-track and mp_clear what we already succeeded in init-ing, then return error. */ va_list clean_args; /* now start cleaning up */ cur_arg = mp; va_start(clean_args, mp); while (n-- != 0) { mp_clear(cur_arg); cur_arg = va_arg(clean_args, mp_int *); } va_end(clean_args); err = MP_MEM; break; } n++; cur_arg = va_arg(args, mp_int *); } va_end(args); return err; /* Assumed ok, if error flagged above. */ } #endif tcl9.0.3/libtommath/bn_mp_init_l.c0000664000175000017500000000032015104661341016501 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_l, mp_set_l, long) #endif tcl9.0.3/libtommath/bn_mp_init_i64.c0000664000175000017500000000033115104661341016652 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_i64, mp_set_i64, int64_t) #endif tcl9.0.3/libtommath/bn_mp_init_i32.c0000664000175000017500000000033115104661341016645 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_i32, mp_set_i32, int32_t) #endif tcl9.0.3/libtommath/bn_mp_init_copy.c0000664000175000017500000000067515076154261017243 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* creates "a" then copies b into it */ mp_err mp_init_copy(mp_int *a, const mp_int *b) { mp_err err; if ((err = mp_init_size(a, b->used)) != MP_OKAY) { return err; } if ((err = mp_copy(b, a)) != MP_OKAY) { mp_clear(a); } return err; } #endif tcl9.0.3/libtommath/bn_mp_init.c0000664000175000017500000000107415076154261016203 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* init a new mp_int */ mp_err mp_init(mp_int *a) { /* allocate memory required and clear it */ a->dp = (mp_digit *) MP_CALLOC((size_t)MP_PREC, sizeof(mp_digit)); if (a->dp == NULL) { return MP_MEM; } /* set the used to zero, allocated digits to the default precision * and sign to positive */ a->used = 0; a->alloc = MP_PREC; a->sign = MP_ZPOS; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_incr.c0000664000175000017500000000131615104661341016164 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_INCR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Increment "a" by one like "a++". Changes input! */ mp_err mp_incr(mp_int *a) { if (MP_IS_ZERO(a)) { mp_set(a,1uL); return MP_OKAY; } else if (a->sign == MP_NEG) { mp_err err; a->sign = MP_ZPOS; if ((err = mp_decr(a)) != MP_OKAY) { return err; } /* There is no -0 in LTM */ if (!MP_IS_ZERO(a)) { a->sign = MP_NEG; } return MP_OKAY; } else if (a->dp[0] < MP_DIGIT_MAX) { a->dp[0]++; return MP_OKAY; } else { return mp_add_d(a, 1uL,a); } } #endif tcl9.0.3/libtommath/bn_mp_grow.c0000664000175000017500000000214715076154261016220 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GROW_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* grow as required */ mp_err mp_grow(mp_int *a, int size) { int i; mp_digit *tmp; if (size < 0) { return MP_VAL; } /* if the alloc size is smaller alloc more ram */ if (a->alloc < size) { /* reallocate the array a->dp * * We store the return in a temporary variable * in case the operation failed we don't want * to overwrite the dp member of a. */ tmp = (mp_digit *) MP_REALLOC(a->dp, (size_t)a->alloc * sizeof(mp_digit), (size_t)size * sizeof(mp_digit)); if (tmp == NULL) { /* reallocation failed but "a" is still valid [can be freed] */ return MP_MEM; } /* reallocation succeeded so set a->dp */ a->dp = tmp; /* zero excess digits */ i = a->alloc; a->alloc = size; MP_ZERO_DIGITS(a->dp + i, a->alloc - i); } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_get_mag_ul.c0000664000175000017500000000032615104661341017334 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_MAG_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_MAG(mp_get_mag_ul, unsigned long) #endif tcl9.0.3/libtommath/bn_mp_get_mag_u64.c0000664000175000017500000000032315104661341017327 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_MAG_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_MAG(mp_get_mag_u64, uint64_t) #endif tcl9.0.3/libtommath/bn_mp_get_mag_u32.c0000664000175000017500000000032315104661341017322 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_MAG_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_MAG(mp_get_mag_u32, uint32_t) #endif tcl9.0.3/libtommath/bn_mp_get_l.c0000664000175000017500000000034415104661341016323 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_SIGNED(mp_get_l, mp_get_mag_ul, long, unsigned long) #endif tcl9.0.3/libtommath/bn_mp_get_i64.c0000664000175000017500000000034715104661341016475 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_SIGNED(mp_get_i64, mp_get_mag_u64, int64_t, uint64_t) #endif tcl9.0.3/libtommath/bn_mp_get_i32.c0000664000175000017500000000034715104661341016470 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_GET_SIGNED(mp_get_i32, mp_get_mag_u32, int32_t, uint32_t) #endif tcl9.0.3/libtommath/bn_mp_get_double.c0000664000175000017500000000066415104661341017347 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GET_DOUBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ double mp_get_double(const mp_int *a) { int i; double d = 0.0, fac = 1.0; for (i = 0; i < MP_DIGIT_BIT; ++i) { fac *= 2.0; } for (i = a->used; i --> 0;) { d = (d * fac) + (double)a->dp[i]; } return (a->sign == MP_NEG) ? -d : d; } #endif tcl9.0.3/libtommath/bn_mp_gcd.c0000664000175000017500000000417315104661341015772 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_GCD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Greatest Common Divisor using the binary method */ mp_err mp_gcd(const mp_int *a, const mp_int *b, mp_int *c) { mp_int u, v; int k, u_lsb, v_lsb; mp_err err; /* either zero than gcd is the largest */ if (MP_IS_ZERO(a)) { return mp_abs(b, c); } if (MP_IS_ZERO(b)) { return mp_abs(a, c); } /* get copies of a and b we can modify */ if ((err = mp_init_copy(&u, a)) != MP_OKAY) { return err; } if ((err = mp_init_copy(&v, b)) != MP_OKAY) { goto LBL_U; } /* must be positive for the remainder of the algorithm */ u.sign = v.sign = MP_ZPOS; /* B1. Find the common power of two for u and v */ u_lsb = mp_cnt_lsb(&u); v_lsb = mp_cnt_lsb(&v); k = MP_MIN(u_lsb, v_lsb); if (k > 0) { /* divide the power of two out */ if ((err = mp_div_2d(&u, k, &u, NULL)) != MP_OKAY) { goto LBL_V; } if ((err = mp_div_2d(&v, k, &v, NULL)) != MP_OKAY) { goto LBL_V; } } /* divide any remaining factors of two out */ if (u_lsb != k) { if ((err = mp_div_2d(&u, u_lsb - k, &u, NULL)) != MP_OKAY) { goto LBL_V; } } if (v_lsb != k) { if ((err = mp_div_2d(&v, v_lsb - k, &v, NULL)) != MP_OKAY) { goto LBL_V; } } while (!MP_IS_ZERO(&v)) { /* make sure v is the largest */ if (mp_cmp_mag(&u, &v) == MP_GT) { /* swap u and v to make sure v is >= u */ mp_exch(&u, &v); } /* subtract smallest from largest */ if ((err = s_mp_sub(&v, &u, &v)) != MP_OKAY) { goto LBL_V; } /* Divide out all factors of two */ if ((err = mp_div_2d(&v, mp_cnt_lsb(&v), &v, NULL)) != MP_OKAY) { goto LBL_V; } } /* multiply by 2**k which we divided out at the beginning */ if ((err = mp_mul_2d(&u, k, c)) != MP_OKAY) { goto LBL_V; } c->sign = MP_ZPOS; err = MP_OKAY; LBL_V: mp_clear(&u); LBL_U: mp_clear(&v); return err; } #endif tcl9.0.3/libtommath/bn_mp_fwrite.c0000664000175000017500000000174015104661341016532 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_FWRITE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef MP_NO_FILE mp_err mp_fwrite(const mp_int *a, int radix, FILE *stream) { char *buf; mp_err err; int len; size_t written; /* TODO: this function is not in this PR */ if (MP_HAS(MP_RADIX_SIZE_OVERESTIMATE)) { /* if ((err = mp_radix_size_overestimate(&t, base, &len)) != MP_OKAY) goto LBL_ERR; */ } else { if ((err = mp_radix_size(a, radix, &len)) != MP_OKAY) { return err; } } buf = (char *) MP_MALLOC((size_t)len); if (buf == NULL) { return MP_MEM; } if ((err = mp_to_radix(a, buf, (size_t)len, &written, radix)) != MP_OKAY) { goto LBL_ERR; } if (fwrite(buf, written, 1uL, stream) != 1uL) { err = MP_ERR; goto LBL_ERR; } err = MP_OKAY; LBL_ERR: MP_FREE_BUFFER(buf, (size_t)len); return err; } #endif #endif tcl9.0.3/libtommath/bn_mp_from_ubin.c0000664000175000017500000000155415104661341017215 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_FROM_UBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ mp_err mp_from_ubin(mp_int *a, const unsigned char *buf, size_t size) { mp_err err; /* make sure there are at least two digits */ if (a->alloc < 2) { if ((err = mp_grow(a, 2)) != MP_OKAY) { return err; } } /* zero the int */ mp_zero(a); /* read the bytes in */ while (size-- > 0u) { if ((err = mp_mul_2d(a, 8, a)) != MP_OKAY) { return err; } #ifndef MP_8BIT a->dp[0] |= *buf++; a->used += 1; #else a->dp[0] = (*buf & MP_MASK); a->dp[1] |= ((*buf++ >> 7) & 1u); a->used += 2; #endif } mp_clamp(a); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_from_sbin.c0000664000175000017500000000117315104661341017210 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_FROM_SBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size) { mp_err err; /* read magnitude */ if ((err = mp_from_ubin(a, buf + 1, size - 1u)) != MP_OKAY) { return err; } /* first byte is 0 for positive, non-zero for negative */ if (buf[0] == (unsigned char)0) { a->sign = MP_ZPOS; } else { a->sign = MP_NEG; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_fread.c0000664000175000017500000000224715104661341016316 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_FREAD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef MP_NO_FILE /* read a bigint from a file stream in ASCII */ mp_err mp_fread(mp_int *a, int radix, FILE *stream) { mp_err err; mp_sign neg; /* if first digit is - then set negative */ int ch = fgetc(stream); if (ch == (int)'-') { neg = MP_NEG; ch = fgetc(stream); } else { neg = MP_ZPOS; } /* no digits, return error */ if (ch == EOF) { return MP_ERR; } /* clear a */ mp_zero(a); do { int y; unsigned pos = (unsigned)(ch - (int)'('); if (mp_s_rmap_reverse_sz < pos) { break; } y = (int)mp_s_rmap_reverse[pos]; if ((y == 0xff) || (y >= radix)) { break; } /* shift up and add */ if ((err = mp_mul_d(a, (mp_digit)radix, a)) != MP_OKAY) { return err; } if ((err = mp_add_d(a, (mp_digit)y, a)) != MP_OKAY) { return err; } } while ((ch = fgetc(stream)) != EOF); if (a->used != 0) { a->sign = neg; } return MP_OKAY; } #endif #endif tcl9.0.3/libtommath/bn_mp_exteuclid.c0000664000175000017500000000520515104661341017220 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_EXTEUCLID_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Extended euclidean algorithm of (a, b) produces a*u1 + b*u2 = u3 */ mp_err mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) { mp_int u1, u2, u3, v1, v2, v3, t1, t2, t3, q, tmp; mp_err err; if ((err = mp_init_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, (void *)NULL)) != MP_OKAY) { return err; } /* initialize, (u1,u2,u3) = (1,0,a) */ mp_set(&u1, 1uL); if ((err = mp_copy(a, &u3)) != MP_OKAY) goto LBL_ERR; /* initialize, (v1,v2,v3) = (0,1,b) */ mp_set(&v2, 1uL); if ((err = mp_copy(b, &v3)) != MP_OKAY) goto LBL_ERR; /* loop while v3 != 0 */ while (!MP_IS_ZERO(&v3)) { /* q = u3/v3 */ if ((err = mp_div(&u3, &v3, &q, NULL)) != MP_OKAY) goto LBL_ERR; /* (t1,t2,t3) = (u1,u2,u3) - (v1,v2,v3)q */ if ((err = mp_mul(&v1, &q, &tmp)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&u1, &tmp, &t1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_mul(&v2, &q, &tmp)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&u2, &tmp, &t2)) != MP_OKAY) goto LBL_ERR; if ((err = mp_mul(&v3, &q, &tmp)) != MP_OKAY) goto LBL_ERR; if ((err = mp_sub(&u3, &tmp, &t3)) != MP_OKAY) goto LBL_ERR; /* (u1,u2,u3) = (v1,v2,v3) */ if ((err = mp_copy(&v1, &u1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&v2, &u2)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&v3, &u3)) != MP_OKAY) goto LBL_ERR; /* (v1,v2,v3) = (t1,t2,t3) */ if ((err = mp_copy(&t1, &v1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&t2, &v2)) != MP_OKAY) goto LBL_ERR; if ((err = mp_copy(&t3, &v3)) != MP_OKAY) goto LBL_ERR; } /* make sure U3 >= 0 */ if (u3.sign == MP_NEG) { if ((err = mp_neg(&u1, &u1)) != MP_OKAY) goto LBL_ERR; if ((err = mp_neg(&u2, &u2)) != MP_OKAY) goto LBL_ERR; if ((err = mp_neg(&u3, &u3)) != MP_OKAY) goto LBL_ERR; } /* copy result out */ if (U1 != NULL) { mp_exch(U1, &u1); } if (U2 != NULL) { mp_exch(U2, &u2); } if (U3 != NULL) { mp_exch(U3, &u3); } err = MP_OKAY; LBL_ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, (void *)NULL); return err; } #endif tcl9.0.3/libtommath/bn_mp_expt_n.c0000664000175000017500000000151515076154260016534 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_EXPT_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* calculate c = a**b using a square-multiply algorithm */ mp_err mp_expt_n(const mp_int *a, int b, mp_int *c) { mp_err err; mp_int g; if ((err = mp_init_copy(&g, a)) != MP_OKAY) { return err; } /* set initial result */ mp_set(c, 1uL); while (b > 0) { /* if the bit is set multiply */ if ((b & 1) != 0) { if ((err = mp_mul(c, &g, c)) != MP_OKAY) { goto LBL_ERR; } } /* square */ if (b > 1) { if ((err = mp_sqr(&g, &g)) != MP_OKAY) { goto LBL_ERR; } } /* shift to next bit */ b >>= 1; } LBL_ERR: mp_clear(&g); return err; } #endif tcl9.0.3/libtommath/bn_mp_exptmod.c0000664000175000017500000000432515104661341016714 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* this is a shell function that calls either the normal or Montgomery * exptmod functions. Originally the call to the montgomery code was * embedded in the normal function but that wasted alot of stack space * for nothing (since 99% of the time the Montgomery code would be called) */ mp_err mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y) { int dr; /* modulus P must be positive */ if (P->sign == MP_NEG) { return MP_VAL; } /* if exponent X is negative we have to recurse */ if (X->sign == MP_NEG) { mp_int tmpG, tmpX; mp_err err; if (!MP_HAS(MP_INVMOD)) { return MP_VAL; } if ((err = mp_init_multi(&tmpG, &tmpX, (void *)NULL)) != MP_OKAY) { return err; } /* first compute 1/G mod P */ if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) { goto LBL_ERR; } /* now get |X| */ if ((err = mp_abs(X, &tmpX)) != MP_OKAY) { goto LBL_ERR; } /* and now compute (1/G)**|X| instead of G**X [X < 0] */ err = mp_exptmod(&tmpG, &tmpX, P, Y); LBL_ERR: mp_clear_multi(&tmpG, &tmpX, (void *)NULL); return err; } /* modified diminished radix reduction */ if (MP_HAS(MP_REDUCE_IS_2K_L) && MP_HAS(MP_REDUCE_2K_L) && MP_HAS(S_MP_EXPTMOD) && (mp_reduce_is_2k_l(P) == MP_YES)) { return s_mp_exptmod(G, X, P, Y, 1); } /* is it a DR modulus? default to no */ dr = (MP_HAS(MP_DR_IS_MODULUS) && (mp_dr_is_modulus(P) == MP_YES)) ? 1 : 0; /* if not, is it a unrestricted DR modulus? */ if (MP_HAS(MP_REDUCE_IS_2K) && (dr == 0)) { dr = (mp_reduce_is_2k(P) == MP_YES) ? 2 : 0; } /* if the modulus is odd or dr != 0 use the montgomery method */ if (MP_HAS(S_MP_EXPTMOD_FAST) && (MP_IS_ODD(P) || (dr != 0))) { return s_mp_exptmod_fast(G, X, P, Y, dr); } else if (MP_HAS(S_MP_EXPTMOD)) { /* otherwise use the generic Barrett reduction technique */ return s_mp_exptmod(G, X, P, Y, 0); } else { /* no exptmod for evens */ return MP_VAL; } } #endif tcl9.0.3/libtommath/bn_mp_exch.c0000664000175000017500000000055615076154260016172 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* swap the elements of two integers, for cases where you can't simply swap the * mp_int pointers around */ void mp_exch(mp_int *a, mp_int *b) { mp_int t; t = *a; *a = *b; *b = t; } #endif tcl9.0.3/libtommath/bn_mp_error_to_string.c0000664000175000017500000000117215104661341020452 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ERROR_TO_STRING_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* return a char * string for a given code */ const char *mp_error_to_string(mp_err code) { switch (code) { case MP_OKAY: return "Successful"; case MP_ERR: return "Unknown error"; case MP_MEM: return "Out of heap"; case MP_VAL: return "Value out of range"; case MP_ITER: return "Max. iterations reached"; case MP_BUF: return "Buffer overflow"; default: return "Invalid error code"; } } #endif tcl9.0.3/libtommath/bn_mp_dr_setup.c0000664000175000017500000000072315104661341017057 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DR_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines the setup value */ void mp_dr_setup(const mp_int *a, mp_digit *d) { /* the casts are required if MP_DIGIT_BIT is one less than * the number of bits in a mp_digit [e.g. MP_DIGIT_BIT==31] */ *d = (mp_digit)(((mp_word)1 << (mp_word)MP_DIGIT_BIT) - (mp_word)a->dp[0]); } #endif tcl9.0.3/libtommath/bn_mp_dr_reduce.c0000664000175000017500000000373115104661341017170 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DR_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* reduce "x" in place modulo "n" using the Diminished Radix algorithm. * * Based on algorithm from the paper * * "Generating Efficient Primes for Discrete Log Cryptosystems" * Chae Hoon Lim, Pil Joong Lee, * POSTECH Information Research Laboratories * * The modulus must be of a special format [see manual] * * Has been modified to use algorithm 7.10 from the LTM book instead * * Input x must be in the range 0 <= x <= (n-1)**2 */ mp_err mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k) { mp_err err; int i, m; mp_word r; mp_digit mu, *tmpx1, *tmpx2; /* m = digits in modulus */ m = n->used; /* ensure that "x" has at least 2m digits */ if (x->alloc < (m + m)) { if ((err = mp_grow(x, m + m)) != MP_OKAY) { return err; } } /* top of loop, this is where the code resumes if * another reduction pass is required. */ top: /* aliases for digits */ /* alias for lower half of x */ tmpx1 = x->dp; /* alias for upper half of x, or x/B**m */ tmpx2 = x->dp + m; /* set carry to zero */ mu = 0; /* compute (x mod B**m) + k * [x/B**m] inline and inplace */ for (i = 0; i < m; i++) { r = ((mp_word)*tmpx2++ * (mp_word)k) + *tmpx1 + mu; *tmpx1++ = (mp_digit)(r & MP_MASK); mu = (mp_digit)(r >> ((mp_word)MP_DIGIT_BIT)); } /* set final carry */ *tmpx1++ = mu; /* zero words above m */ MP_ZERO_DIGITS(tmpx1, (x->used - m) - 1); /* clamp, sub and return */ mp_clamp(x); /* if x >= n then subtract and reduce again * Each successive "recursion" makes the input smaller and smaller. */ if (mp_cmp_mag(x, n) != MP_LT) { if ((err = s_mp_sub(x, n, x)) != MP_OKAY) { return err; } goto top; } return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_dr_is_modulus.c0000664000175000017500000000114215104661341020076 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DR_IS_MODULUS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines if a number is a valid DR modulus */ mp_bool mp_dr_is_modulus(const mp_int *a) { int ix; /* must be at least two digits */ if (a->used < 2) { return MP_NO; } /* must be of the form b**k - a [a <= b] so all * but the first digit must be equal to -1 (mod b). */ for (ix = 1; ix < a->used; ix++) { if (a->dp[ix] != MP_MASK) { return MP_NO; } } return MP_YES; } #endif tcl9.0.3/libtommath/bn_mp_div_d.c0000664000175000017500000000322715076154260016326 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DIV_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* single digit division (based on routine from MPI) */ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) { mp_int q; mp_word w; mp_digit t; mp_err err; int ix; /* cannot divide by zero */ if (b == 0u) { return MP_VAL; } /* quick outs */ if ((b == 1u) || MP_IS_ZERO(a)) { if (d != NULL) { *d = 0; } if (c != NULL) { return mp_copy(a, c); } return MP_OKAY; } /* power of two ? */ if ((b & (b - 1u)) == 0u) { ix = 1; while ((ix < MP_DIGIT_BIT) && (b != (((mp_digit)1)<dp[0] & (((mp_digit)1<<(mp_digit)ix) - 1uL); } if (c != NULL) { return mp_div_2d(a, ix, c, NULL); } return MP_OKAY; } /* three? */ if (MP_HAS(S_MP_DIV_3) && (b == 3u)) { return s_mp_div_3(a, c, d); } /* no easy answer [c'est la vie]. Just division */ if ((err = mp_init_size(&q, a->used)) != MP_OKAY) { return err; } q.used = a->used; q.sign = a->sign; w = 0; for (ix = a->used - 1; ix >= 0; ix--) { w = (w << (mp_word)MP_DIGIT_BIT) | (mp_word)a->dp[ix]; if (w >= b) { t = (mp_digit)(w / b); w -= (mp_word)t * (mp_word)b; } else { t = 0; } q.dp[ix] = t; } if (d != NULL) { *d = (mp_digit)w; } if (c != NULL) { mp_clamp(&q); mp_exch(&q, c); } mp_clear(&q); return err; } #endif tcl9.0.3/libtommath/bn_mp_div_2d.c0000664000175000017500000000330015076154260016400 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DIV_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ mp_err mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d) { mp_digit D, r, rr; int x; mp_err err; /* if the shift count is <= 0 then we do no work */ if (b <= 0) { err = mp_copy(a, c); if (d != NULL) { mp_zero(d); } return err; } /* copy */ if ((err = mp_copy(a, c)) != MP_OKAY) { return err; } /* 'a' should not be used after here - it might be the same as d */ /* get the remainder */ if (d != NULL) { if ((err = mp_mod_2d(a, b, d)) != MP_OKAY) { return err; } } /* shift by as many digits in the bit count */ if (b >= MP_DIGIT_BIT) { mp_rshd(c, b / MP_DIGIT_BIT); } /* shift any bit count < MP_DIGIT_BIT */ D = (mp_digit)(b % MP_DIGIT_BIT); if (D != 0u) { mp_digit *tmpc, mask, shift; /* mask */ mask = ((mp_digit)1 << D) - 1uL; /* shift for lsb */ shift = (mp_digit)MP_DIGIT_BIT - D; /* alias */ tmpc = c->dp + (c->used - 1); /* carry */ r = 0; for (x = c->used - 1; x >= 0; x--) { /* get the lower bits of this word in a temp */ rr = *tmpc & mask; /* shift the current word and mix in the carry bits from the previous word */ *tmpc = (*tmpc >> D) | (r << shift); --tmpc; /* set the carry to the carry bits of the current word found above */ r = rr; } } mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_div_2.c0000664000175000017500000000202715076154260016241 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DIV_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = a/2 */ mp_err mp_div_2(const mp_int *a, mp_int *b) { int x, oldused; mp_digit r, rr, *tmpa, *tmpb; mp_err err; /* copy */ if (b->alloc < a->used) { if ((err = mp_grow(b, a->used)) != MP_OKAY) { return err; } } oldused = b->used; b->used = a->used; /* source alias */ tmpa = a->dp + b->used - 1; /* dest alias */ tmpb = b->dp + b->used - 1; /* carry */ r = 0; for (x = b->used - 1; x >= 0; x--) { /* get the carry for the next iteration */ rr = *tmpa & 1u; /* shift the current digit, add in carry and store */ *tmpb-- = (*tmpa-- >> 1) | (r << (MP_DIGIT_BIT - 1)); /* forward carry to next iteration */ r = rr; } /* zero excess digits */ MP_ZERO_DIGITS(b->dp + b->used, oldused - b->used); b->sign = a->sign; mp_clamp(b); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_div.c0000664000175000017500000001562615076154260016031 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DIV_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifdef BN_MP_DIV_SMALL /* slower bit-bang division... also smaller */ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) { mp_int ta, tb, tq, q; int n, n2; mp_err err; /* is divisor zero ? */ if (MP_IS_ZERO(b)) { return MP_VAL; } /* if a < b then q=0, r = a */ if (mp_cmp_mag(a, b) == MP_LT) { if (d != NULL) { err = mp_copy(a, d); } else { err = MP_OKAY; } if (c != NULL) { mp_zero(c); } return err; } /* init our temps */ if ((err = mp_init_multi(&ta, &tb, &tq, &q, (void *)NULL)) != MP_OKAY) { return err; } mp_set(&tq, 1uL); n = mp_count_bits(a) - mp_count_bits(b); if ((err = mp_abs(a, &ta)) != MP_OKAY) goto LBL_ERR; if ((err = mp_abs(b, &tb)) != MP_OKAY) goto LBL_ERR; if ((err = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) goto LBL_ERR; if ((err = mp_mul_2d(&tq, n, &tq)) != MP_OKAY) goto LBL_ERR; while (n-- >= 0) { if (mp_cmp(&tb, &ta) != MP_GT) { if ((err = mp_sub(&ta, &tb, &ta)) != MP_OKAY) goto LBL_ERR; if ((err = mp_add(&q, &tq, &q)) != MP_OKAY) goto LBL_ERR; } if ((err = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) goto LBL_ERR; if ((err = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY) goto LBL_ERR; } /* now q == quotient and ta == remainder */ n = a->sign; n2 = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; if (c != NULL) { mp_exch(c, &q); c->sign = MP_IS_ZERO(c) ? MP_ZPOS : n2; } if (d != NULL) { mp_exch(d, &ta); d->sign = MP_IS_ZERO(d) ? MP_ZPOS : n; } LBL_ERR: mp_clear_multi(&ta, &tb, &tq, &q, (void *)NULL); return err; } #else /* integer signed division. * c*b + d == a [e.g. a/b, c=quotient, d=remainder] * HAC pp.598 Algorithm 14.20 * * Note that the description in HAC is horribly * incomplete. For example, it doesn't consider * the case where digits are removed from 'x' in * the inner loop. It also doesn't consider the * case that y has fewer than three digits, etc.. * * The overall algorithm is as described as * 14.20 from HAC but fixed to treat these cases. */ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) { mp_int q, x, y, t1, t2; int n, t, i, norm; mp_sign neg; mp_err err; /* is divisor zero ? */ if (MP_IS_ZERO(b)) { return MP_VAL; } /* if a < b then q=0, r = a */ if (mp_cmp_mag(a, b) == MP_LT) { if (d != NULL) { err = mp_copy(a, d); } else { err = MP_OKAY; } if (c != NULL) { mp_zero(c); } return err; } if ((err = mp_init_size(&q, a->used + 2)) != MP_OKAY) { return err; } q.used = a->used + 2; if ((err = mp_init(&t1)) != MP_OKAY) goto LBL_Q; if ((err = mp_init(&t2)) != MP_OKAY) goto LBL_T1; if ((err = mp_init_copy(&x, a)) != MP_OKAY) goto LBL_T2; if ((err = mp_init_copy(&y, b)) != MP_OKAY) goto LBL_X; /* fix the sign */ neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; x.sign = y.sign = MP_ZPOS; /* normalize both x and y, ensure that y >= b/2, [b == 2**MP_DIGIT_BIT] */ norm = mp_count_bits(&y) % MP_DIGIT_BIT; if (norm < (MP_DIGIT_BIT - 1)) { norm = (MP_DIGIT_BIT - 1) - norm; if ((err = mp_mul_2d(&x, norm, &x)) != MP_OKAY) goto LBL_Y; if ((err = mp_mul_2d(&y, norm, &y)) != MP_OKAY) goto LBL_Y; } else { norm = 0; } /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */ n = x.used - 1; t = y.used - 1; /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */ /* y = y*b**{n-t} */ if ((err = mp_lshd(&y, n - t)) != MP_OKAY) goto LBL_Y; while (mp_cmp(&x, &y) != MP_LT) { ++(q.dp[n - t]); if ((err = mp_sub(&x, &y, &x)) != MP_OKAY) goto LBL_Y; } /* reset y by shifting it back down */ mp_rshd(&y, n - t); /* step 3. for i from n down to (t + 1) */ for (i = n; i >= (t + 1); i--) { if (i > x.used) { continue; } /* step 3.1 if xi == yt then set q{i-t-1} to b-1, * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */ if (x.dp[i] == y.dp[t]) { q.dp[(i - t) - 1] = ((mp_digit)1 << (mp_digit)MP_DIGIT_BIT) - (mp_digit)1; } else { mp_word tmp; tmp = (mp_word)x.dp[i] << (mp_word)MP_DIGIT_BIT; tmp |= (mp_word)x.dp[i - 1]; tmp /= (mp_word)y.dp[t]; if (tmp > (mp_word)MP_MASK) { tmp = MP_MASK; } q.dp[(i - t) - 1] = (mp_digit)(tmp & (mp_word)MP_MASK); } /* while (q{i-t-1} * (yt * b + y{t-1})) > xi * b**2 + xi-1 * b + xi-2 do q{i-t-1} -= 1; */ q.dp[(i - t) - 1] = (q.dp[(i - t) - 1] + 1uL) & (mp_digit)MP_MASK; do { q.dp[(i - t) - 1] = (q.dp[(i - t) - 1] - 1uL) & (mp_digit)MP_MASK; /* find left hand */ mp_zero(&t1); t1.dp[0] = ((t - 1) < 0) ? 0u : y.dp[t - 1]; t1.dp[1] = y.dp[t]; t1.used = 2; if ((err = mp_mul_d(&t1, q.dp[(i - t) - 1], &t1)) != MP_OKAY) goto LBL_Y; /* find right hand */ t2.dp[0] = ((i - 2) < 0) ? 0u : x.dp[i - 2]; t2.dp[1] = x.dp[i - 1]; /* i >= 1 always holds */ t2.dp[2] = x.dp[i]; t2.used = 3; } while (mp_cmp_mag(&t1, &t2) == MP_GT); /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */ if ((err = mp_mul_d(&y, q.dp[(i - t) - 1], &t1)) != MP_OKAY) goto LBL_Y; if ((err = mp_lshd(&t1, (i - t) - 1)) != MP_OKAY) goto LBL_Y; if ((err = mp_sub(&x, &t1, &x)) != MP_OKAY) goto LBL_Y; /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */ if (x.sign == MP_NEG) { if ((err = mp_copy(&y, &t1)) != MP_OKAY) goto LBL_Y; if ((err = mp_lshd(&t1, (i - t) - 1)) != MP_OKAY) goto LBL_Y; if ((err = mp_add(&x, &t1, &x)) != MP_OKAY) goto LBL_Y; q.dp[(i - t) - 1] = (q.dp[(i - t) - 1] - 1uL) & MP_MASK; } } /* now q is the quotient and x is the remainder * [which we have to normalize] */ /* get sign before writing to c */ x.sign = (x.used == 0) ? MP_ZPOS : a->sign; if (c != NULL) { mp_clamp(&q); mp_exch(&q, c); c->sign = neg; } if (d != NULL) { if ((err = mp_div_2d(&x, norm, &x, NULL)) != MP_OKAY) goto LBL_Y; mp_exch(&x, d); } err = MP_OKAY; LBL_Y: mp_clear(&y); LBL_X: mp_clear(&x); LBL_T2: mp_clear(&t2); LBL_T1: mp_clear(&t1); LBL_Q: mp_clear(&q); return err; } #endif #endif tcl9.0.3/libtommath/bn_mp_decr.c0000664000175000017500000000142615104661341016150 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_DECR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Decrement "a" by one like "a--". Changes input! */ mp_err mp_decr(mp_int *a) { if (MP_IS_ZERO(a)) { mp_set(a,1uL); a->sign = MP_NEG; return MP_OKAY; } else if (a->sign == MP_NEG) { mp_err err; a->sign = MP_ZPOS; if ((err = mp_incr(a)) != MP_OKAY) { return err; } /* There is no -0 in LTM */ if (!MP_IS_ZERO(a)) { a->sign = MP_NEG; } return MP_OKAY; } else if (a->dp[0] > 1uL) { a->dp[0]--; if (a->dp[0] == 0u) { mp_zero(a); } return MP_OKAY; } else { return mp_sub_d(a, 1uL,a); } } #endif tcl9.0.3/libtommath/bn_mp_count_bits.c0000664000175000017500000000110015076154260017376 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_COUNT_BITS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* returns the number of bits in an int */ int mp_count_bits(const mp_int *a) { int r; mp_digit q; /* shortcut */ if (MP_IS_ZERO(a)) { return 0; } /* get number of digits and add that */ r = (a->used - 1) * MP_DIGIT_BIT; /* take the last digit and count the bits in it */ q = a->dp[a->used - 1]; while (q > 0u) { ++r; q >>= 1u; } return r; } #endif tcl9.0.3/libtommath/bn_mp_copy.c0000664000175000017500000000160415076154260016210 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* copy, b = a */ mp_err mp_copy(const mp_int *a, mp_int *b) { int n; mp_digit *tmpa, *tmpb; mp_err err; /* if dst == src do nothing */ if (a == b) { return MP_OKAY; } /* grow dest */ if (b->alloc < a->used) { if ((err = mp_grow(b, a->used)) != MP_OKAY) { return err; } } /* zero b and copy the parameters over */ /* pointer aliases */ /* source */ tmpa = a->dp; /* destination */ tmpb = b->dp; /* copy all the digits */ for (n = 0; n < a->used; n++) { *tmpb++ = *tmpa++; } /* clear high digits */ MP_ZERO_DIGITS(tmpb, b->used - n); /* copy used count and sign */ b->used = a->used; b->sign = a->sign; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_complement.c0000664000175000017500000000050515104661341017373 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_COMPLEMENT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = ~a */ mp_err mp_complement(const mp_int *a, mp_int *b) { mp_err err = mp_neg(a, b); return (err == MP_OKAY) ? mp_sub_d(b, 1uL, b) : err; } #endif tcl9.0.3/libtommath/bn_mp_cnt_lsb.c0000664000175000017500000000142715076154260016665 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CNT_LSB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ static const int lnz[16] = { 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; /* Counts the number of lsbs which are zero before the first zero bit */ int mp_cnt_lsb(const mp_int *a) { int x; mp_digit q, qq; /* easy out */ if (MP_IS_ZERO(a)) { return 0; } /* scan lower digits until non-zero */ for (x = 0; (x < a->used) && (a->dp[x] == 0u); x++) {} q = a->dp[x]; x *= MP_DIGIT_BIT; /* now scan this digit until a 1 is found */ if ((q & 1u) == 0u) { do { qq = q & 15u; x += lnz[qq]; q >>= 4; } while (qq == 0u); } return x; } #endif tcl9.0.3/libtommath/bn_mp_cmp_mag.c0000664000175000017500000000145215076154260016642 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CMP_MAG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* compare maginitude of two ints (unsigned) */ mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b) { int n; const mp_digit *tmpa, *tmpb; /* compare based on # of non-zero digits */ if (a->used > b->used) { return MP_GT; } if (a->used < b->used) { return MP_LT; } /* alias for a */ tmpa = a->dp + (a->used - 1); /* alias for b */ tmpb = b->dp + (a->used - 1); /* compare based on digits */ for (n = 0; n < a->used; ++n, --tmpa, --tmpb) { if (*tmpa > *tmpb) { return MP_GT; } if (*tmpa < *tmpb) { return MP_LT; } } return MP_EQ; } #endif tcl9.0.3/libtommath/bn_mp_cmp_d.c0000664000175000017500000000110415076154260016313 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CMP_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* compare a digit */ mp_ord mp_cmp_d(const mp_int *a, mp_digit b) { /* compare based on sign */ if (a->sign == MP_NEG) { return MP_LT; } /* compare based on magnitude */ if (a->used > 1) { return MP_GT; } /* compare the only digit of a to b */ if (a->dp[0] > b) { return MP_GT; } else if (a->dp[0] < b) { return MP_LT; } else { return MP_EQ; } } #endif tcl9.0.3/libtommath/bn_mp_cmp.c0000664000175000017500000000112515076154260016013 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* compare two ints (signed)*/ mp_ord mp_cmp(const mp_int *a, const mp_int *b) { /* compare based on sign */ if (a->sign != b->sign) { if (a->sign == MP_NEG) { return MP_LT; } else { return MP_GT; } } /* compare digits */ if (a->sign == MP_NEG) { /* if negative compare opposite direction */ return mp_cmp_mag(b, a); } else { return mp_cmp_mag(a, b); } } #endif tcl9.0.3/libtommath/bn_mp_clear_multi.c0000664000175000017500000000064115076154260017536 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CLEAR_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #include void mp_clear_multi(mp_int *mp, ...) { mp_int *next_mp = mp; va_list args; va_start(args, mp); while (next_mp != NULL) { mp_clear(next_mp); next_mp = va_arg(args, mp_int *); } va_end(args); } #endif tcl9.0.3/libtommath/bn_mp_clear.c0000664000175000017500000000076615076154260016334 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CLEAR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* clear one (frees) */ void mp_clear(mp_int *a) { /* only do anything if a hasn't been freed previously */ if (a->dp != NULL) { /* free ram */ MP_FREE_DIGITS(a->dp, a->alloc); /* reset members to make debugging easier */ a->dp = NULL; a->alloc = a->used = 0; a->sign = MP_ZPOS; } } #endif tcl9.0.3/libtommath/bn_mp_clamp.c0000664000175000017500000000124115076154260016327 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_CLAMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* trim unused digits * * This is used to ensure that leading zero digits are * trimed and the leading "used" digit will be non-zero * Typically very fast. Also fixes the sign if there * are no more leading digits */ void mp_clamp(mp_int *a) { /* decrease used while the most significant digit is * zero. */ while ((a->used > 0) && (a->dp[a->used - 1] == 0u)) { --(a->used); } /* reset the sign flag if used == 0 */ if (a->used == 0) { a->sign = MP_ZPOS; } } #endif tcl9.0.3/libtommath/bn_mp_and.c0000664000175000017500000000264215076154260016003 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_AND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* two complement and */ mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c) { int used = MP_MAX(a->used, b->used) + 1, i; mp_err err; mp_digit ac = 1, bc = 1, cc = 1; mp_sign csign = ((a->sign == MP_NEG) && (b->sign == MP_NEG)) ? MP_NEG : MP_ZPOS; if (c->alloc < used) { if ((err = mp_grow(c, used)) != MP_OKAY) { return err; } } for (i = 0; i < used; i++) { mp_digit x, y; /* convert to two complement if negative */ if (a->sign == MP_NEG) { ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK); x = ac & MP_MASK; ac >>= MP_DIGIT_BIT; } else { x = (i >= a->used) ? 0uL : a->dp[i]; } /* convert to two complement if negative */ if (b->sign == MP_NEG) { bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK); y = bc & MP_MASK; bc >>= MP_DIGIT_BIT; } else { y = (i >= b->used) ? 0uL : b->dp[i]; } c->dp[i] = x & y; /* convert to to sign-magnitude if negative */ if (csign == MP_NEG) { cc += ~c->dp[i] & MP_MASK; c->dp[i] = cc & MP_MASK; cc >>= MP_DIGIT_BIT; } } c->used = used; c->sign = csign; mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_add_d.c0000664000175000017500000000354115076154260016273 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ADD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* single digit addition */ mp_err mp_add_d(const mp_int *a, mp_digit b, mp_int *c) { mp_err err; int ix, oldused; mp_digit *tmpa, *tmpc; /* grow c as required */ if (c->alloc < (a->used + 1)) { if ((err = mp_grow(c, a->used + 1)) != MP_OKAY) { return err; } } /* if a is negative and |a| >= b, call c = |a| - b */ if ((a->sign == MP_NEG) && ((a->used > 1) || (a->dp[0] >= b))) { mp_int a_ = *a; /* temporarily fix sign of a */ a_.sign = MP_ZPOS; /* c = |a| - b */ err = mp_sub_d(&a_, b, c); /* fix sign */ c->sign = MP_NEG; /* clamp */ mp_clamp(c); return err; } /* old number of used digits in c */ oldused = c->used; /* source alias */ tmpa = a->dp; /* destination alias */ tmpc = c->dp; /* if a is positive */ if (a->sign == MP_ZPOS) { /* add digits, mu is carry */ mp_digit mu = b; for (ix = 0; ix < a->used; ix++) { *tmpc = *tmpa++ + mu; mu = *tmpc >> MP_DIGIT_BIT; *tmpc++ &= MP_MASK; } /* set final carry */ ix++; *tmpc++ = mu; /* setup size */ c->used = a->used + 1; } else { /* a was negative and |a| < b */ c->used = 1; /* the result is a single digit */ if (a->used == 1) { *tmpc++ = b - a->dp[0]; } else { *tmpc++ = b; } /* setup count so the clearing of oldused * can fall through correctly */ ix = 1; } /* sign always positive */ c->sign = MP_ZPOS; /* now zero to oldused */ MP_ZERO_DIGITS(tmpc, oldused - ix); mp_clamp(c); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_addmod.c0000664000175000017500000000100015104661341016447 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ADDMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* d = a + b (mod c) */ mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d) { mp_err err; mp_int t; if ((err = mp_init(&t)) != MP_OKAY) { return err; } if ((err = mp_add(a, b, &t)) != MP_OKAY) { goto LBL_ERR; } err = mp_mod(&t, c, d); LBL_ERR: mp_clear(&t); return err; } #endif tcl9.0.3/libtommath/bn_mp_add.c0000664000175000017500000000176015076154260015771 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* high level addition (handles signs) */ mp_err mp_add(const mp_int *a, const mp_int *b, mp_int *c) { mp_sign sa, sb; mp_err err; /* get sign of both inputs */ sa = a->sign; sb = b->sign; /* handle two cases, not four */ if (sa == sb) { /* both positive or both negative */ /* add their magnitudes, copy the sign */ c->sign = sa; err = s_mp_add(a, b, c); } else { /* one positive, the other negative */ /* subtract the one with the greater magnitude from */ /* the one of the lesser magnitude. The result gets */ /* the sign of the one with the greater magnitude. */ if (mp_cmp_mag(a, b) == MP_LT) { c->sign = sb; err = s_mp_sub(b, a, c); } else { c->sign = sa; err = s_mp_sub(a, b, c); } } return err; } #endif tcl9.0.3/libtommath/bn_mp_abs.c0000664000175000017500000000100715104661341015773 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_ABS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = |a| * * Simple function copies the input and fixes the sign to positive */ mp_err mp_abs(const mp_int *a, mp_int *b) { mp_err err; /* copy a to b */ if (a != b) { if ((err = mp_copy(a, b)) != MP_OKAY) { return err; } } /* force the sign of b to positive */ b->sign = MP_ZPOS; return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_mp_2expt.c0000664000175000017500000000143015104661341016270 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_MP_2EXPT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* computes a = 2**b * * Simple algorithm which zeroes the int, grows it then just sets one bit * as required. */ mp_err mp_2expt(mp_int *a, int b) { mp_err err; if (b < 0) { return MP_VAL; } /* zero a as per default */ mp_zero(a); /* grow a to accomodate the single bit */ if ((err = mp_grow(a, (b / MP_DIGIT_BIT) + 1)) != MP_OKAY) { return err; } /* set the used count of where the bit will go */ a->used = (b / MP_DIGIT_BIT) + 1; /* put the single bit in its place */ a->dp[b / MP_DIGIT_BIT] = (mp_digit)1 << (mp_digit)(b % MP_DIGIT_BIT); return MP_OKAY; } #endif tcl9.0.3/libtommath/bn_deprecated.c0000664000175000017500000002100515104661341016632 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_DEPRECATED_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifdef BN_MP_GET_BIT_C int mp_get_bit(const mp_int *a, int b) { if (b < 0) { return MP_VAL; } return (s_mp_get_bit(a, (unsigned int)b) == MP_YES) ? MP_YES : MP_NO; } #endif #ifdef BN_MP_JACOBI_C mp_err mp_jacobi(const mp_int *a, const mp_int *n, int *c) { if (a->sign == MP_NEG) { return MP_VAL; } if (mp_cmp_d(n, 0uL) != MP_GT) { return MP_VAL; } return mp_kronecker(a, n, c); } #endif #ifdef BN_MP_PRIME_RANDOM_EX_C mp_err mp_prime_random_ex(mp_int *a, int t, int size, int flags, private_mp_prime_callback cb, void *dat) { return s_mp_prime_random_ex(a, t, size, flags, cb, dat); } #endif #ifdef BN_MP_RAND_DIGIT_C mp_err mp_rand_digit(mp_digit *r) { mp_err err = s_mp_rand_source(r, sizeof(mp_digit)); *r &= MP_MASK; return err; } #endif #ifdef BN_FAST_MP_INVMOD_C mp_err fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c) { return s_mp_invmod_fast(a, b, c); } #endif #ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C mp_err fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho) { return s_mp_montgomery_reduce_fast(x, n, rho); } #endif #ifdef BN_FAST_S_MP_MUL_DIGS_C mp_err fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) { return s_mp_mul_digs_fast(a, b, c, digs); } #endif #ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C mp_err fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) { return s_mp_mul_high_digs_fast(a, b, c, digs); } #endif #ifdef BN_FAST_S_MP_SQR_C mp_err fast_s_mp_sqr(const mp_int *a, mp_int *b) { return s_mp_sqr_fast(a, b); } #endif #ifdef BN_MP_BALANCE_MUL_C mp_err mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c) { return s_mp_balance_mul(a, b, c); } #endif #ifdef BN_MP_DIV_3_C mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) { return s_mp_div_3(a, c, d); } #endif #ifdef BN_MP_EXPTMOD_FAST_C mp_err mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode) { return s_mp_exptmod_fast(G, X, P, Y, redmode); } #endif #ifdef BN_MP_INVMOD_SLOW_C mp_err mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c) { return s_mp_invmod_slow(a, b, c); } #endif #ifdef BN_MP_KARATSUBA_MUL_C mp_err mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c) { return s_mp_karatsuba_mul(a, b, c); } #endif #ifdef BN_MP_KARATSUBA_SQR_C mp_err mp_karatsuba_sqr(const mp_int *a, mp_int *b) { return s_mp_karatsuba_sqr(a, b); } #endif #ifdef BN_MP_TOOM_MUL_C mp_err mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c) { return s_mp_toom_mul(a, b, c); } #endif #ifdef BN_MP_TOOM_SQR_C mp_err mp_toom_sqr(const mp_int *a, mp_int *b) { return s_mp_toom_sqr(a, b); } #endif #ifdef S_MP_REVERSE_C void bn_reverse(unsigned char *s, int len) { if (len > 0) { s_mp_reverse(s, (size_t)len); } } #endif #ifdef BN_MP_TC_AND_C mp_err mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c) { return mp_and(a, b, c); } #endif #ifdef BN_MP_TC_OR_C mp_err mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) { return mp_or(a, b, c); } #endif #ifdef BN_MP_TC_XOR_C mp_err mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) { return mp_xor(a, b, c); } #endif #ifdef BN_MP_TC_DIV_2D_C mp_err mp_tc_div_2d(const mp_int *a, int b, mp_int *c) { return mp_signed_rsh(a, b, c); } #endif #ifdef BN_MP_INIT_SET_INT_C mp_err mp_init_set_int(mp_int *a, unsigned long b) { return mp_init_u32(a, (uint32_t)b); } #endif #ifdef BN_MP_SET_INT_C mp_err mp_set_int(mp_int *a, unsigned long b) { mp_set_u32(a, (uint32_t)b); return MP_OKAY; } #endif #ifdef BN_MP_SET_LONG_C mp_err mp_set_long(mp_int *a, unsigned long b) { mp_set_u64(a, b); return MP_OKAY; } #endif #ifdef BN_MP_SET_LONG_LONG_C mp_err mp_set_long_long(mp_int *a, unsigned long long b) { mp_set_u64(a, b); return MP_OKAY; } #endif #ifdef BN_MP_GET_INT_C unsigned long mp_get_int(const mp_int *a) { return (unsigned long)mp_get_mag_u32(a); } #endif #ifdef BN_MP_GET_LONG_C unsigned long mp_get_long(const mp_int *a) { return (unsigned long)mp_get_mag_ul(a); } #endif #ifdef BN_MP_GET_LONG_LONG_C unsigned long long mp_get_long_long(const mp_int *a) { return (unsigned long long)mp_get_mag_u64(a); } #endif #ifdef BN_MP_GET_LL_C MP_GET_SIGNED(mp_get_ll, mp_get_mag_u64, long long, uint64_t) #endif #ifdef BN_MP_GET_MAG_ULL_C MP_GET_MAG(mp_get_mag_ull, unsigned long long) #endif #ifdef BN_MP_INIT_LL_C MP_INIT_INT(mp_init_ll, mp_set_i64, long long) #endif #ifdef BN_MP_SET_LL_C MP_SET_SIGNED(mp_set_ll, mp_set_i64, long long, long long) #endif #ifdef BN_MP_INIT_ULL_C MP_INIT_INT(mp_init_ull, mp_set_u64, unsigned long long) #endif #ifdef BN_MP_SET_ULL_C MP_SET_UNSIGNED(mp_set_ull, unsigned long long) #endif #ifdef BN_MP_PRIME_IS_DIVISIBLE_C mp_err mp_prime_is_divisible(const mp_int *a, mp_bool *result) { return s_mp_prime_is_divisible(a, result); } #endif #ifdef BN_MP_LOG_U32_C mp_err mp_log_u32(const mp_int *a, uint32_t base, uint32_t *c) { mp_err e; int c_; if (base > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } e = mp_log_n(a, (int)base, &c_); *c = (uint32_t)c_; return e; } #endif #ifdef BN_MP_EXPT_D_EX_C mp_err mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) { (void)fast; if (b > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } return mp_expt_n(a, (int)b, c); } #endif #ifdef BN_MP_EXPT_D_C mp_err mp_expt_d(const mp_int *a, mp_digit b, mp_int *c) { if (b > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } return mp_expt_n(a, (int)b, c); } #endif #ifdef BN_MP_EXPT_U32_C mp_err mp_expt_u32(const mp_int *a, uint32_t b, mp_int *c) { if (b > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } return mp_expt_n(a, (int)b, c); } #endif #ifdef BN_MP_N_ROOT_EX_C mp_err mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast) { (void)fast; if (b > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } return mp_root_n(a, (int)b, c); } #endif #ifdef BN_MP_N_ROOT_C mp_err mp_n_root(const mp_int *a, mp_digit b, mp_int *c) { if (b > MP_MIN(MP_DIGIT_MAX, INT_MAX)) { return MP_VAL; } return mp_root_n(a, (int)b, c); } #endif #ifdef BN_MP_ROOT_U32_C mp_err mp_root_u32(const mp_int *a, uint32_t b, mp_int *c) { return mp_root_n(a, (int)b, c); } #endif #ifdef BN_MP_UNSIGNED_BIN_SIZE_C int mp_unsigned_bin_size(const mp_int *a) { return (int)mp_ubin_size(a); } #endif #ifdef BN_MP_READ_UNSIGNED_BIN_C mp_err mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c) { return mp_from_ubin(a, b, (size_t) c); } #endif #ifdef BN_MP_TO_UNSIGNED_BIN_C mp_err mp_to_unsigned_bin(const mp_int *a, unsigned char *b) { return mp_to_ubin(a, b, SIZE_MAX, NULL); } #endif #ifdef BN_MP_TO_UNSIGNED_BIN_N_C mp_err mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) { size_t n = mp_ubin_size(a); if (*outlen < (unsigned long)n) { return MP_VAL; } *outlen = (unsigned long)n; return mp_to_ubin(a, b, n, NULL); } #endif #ifdef BN_MP_SIGNED_BIN_SIZE_C int mp_signed_bin_size(const mp_int *a) { return (int)mp_sbin_size(a); } #endif #ifdef BN_MP_READ_SIGNED_BIN_C mp_err mp_read_signed_bin(mp_int *a, const unsigned char *b, int c) { return mp_from_sbin(a, b, (size_t) c); } #endif #ifdef BN_MP_TO_SIGNED_BIN_C mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) { return mp_to_sbin(a, b, SIZE_MAX, NULL); } #endif #ifdef BN_MP_TO_SIGNED_BIN_N_C mp_err mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen) { size_t n = mp_sbin_size(a); if (*outlen < (unsigned long)n) { return MP_VAL; } *outlen = (unsigned long)n; return mp_to_sbin(a, b, n, NULL); } #endif #ifdef BN_MP_TORADIX_N_C mp_err mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen) { if (maxlen < 0) { return MP_VAL; } return mp_to_radix(a, str, (size_t)maxlen, NULL, radix); } #endif #ifdef BN_MP_TORADIX_C mp_err mp_toradix(const mp_int *a, char *str, int radix) { return mp_to_radix(a, str, SIZE_MAX, NULL, radix); } #endif #ifdef BN_MP_IMPORT_C mp_err mp_import(mp_int *rop, size_t count, int order, size_t size, int endian, size_t nails, const void *op) { return mp_unpack(rop, count, order, size, endian, nails, op); } #endif #ifdef BN_MP_EXPORT_C mp_err mp_export(void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, const mp_int *op) { return mp_pack(rop, SIZE_MAX, countp, order, size, endian, nails, op); } #endif #endif tcl9.0.3/libtommath/bn_cutoffs.c0000664000175000017500000000070115104661341016203 0ustar sergeisergei#include "tommath_private.h" #ifdef BN_CUTOFFS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef MP_FIXED_CUTOFFS #include "tommath_cutoffs.h" int KARATSUBA_MUL_CUTOFF = MP_DEFAULT_KARATSUBA_MUL_CUTOFF, KARATSUBA_SQR_CUTOFF = MP_DEFAULT_KARATSUBA_SQR_CUTOFF, TOOM_MUL_CUTOFF = MP_DEFAULT_TOOM_MUL_CUTOFF, TOOM_SQR_CUTOFF = MP_DEFAULT_TOOM_SQR_CUTOFF; #endif #endif tcl9.0.3/libtommath/astylerc0000664000175000017500000000102115076154260015461 0ustar sergeisergei# Artistic Style, see http://astyle.sourceforge.net/ # full documentation, see: http://astyle.sourceforge.net/astyle.html # # usage: # astyle --options=astylerc *.[ch] # Do not create backup, annonying in the times of git suffix=none ## Bracket Style Options style=kr ## Tab Options indent=spaces=3 ## Bracket Modify Options ## Indentation Options min-conditional-indent=0 ## Padding Options pad-header unpad-paren align-pointer=name ## Formatting Options break-after-logical max-code-length=120 convert-tabs mode=c tcl9.0.3/libtommath/appveyor.yml0000664000175000017500000000156715104661341016312 0ustar sergeisergeiversion: 1.3.0-{build} branches: only: - master - develop - /^release/ - /^travis/ image: - Visual Studio 2019 - Visual Studio 2017 - Visual Studio 2015 build_script: - cmd: >- if "Visual Studio 2019"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 nmake -f makefile.msvc all test_script: - cmd: test.exe tcl9.0.3/library/0000755000175000017500000000000015104662345013220 5ustar sergeisergeitcl9.0.3/library/writefile.tcl0000644000175000017500000000161715104661341015716 0ustar sergeisergei# writeFile: # Write the contents of a file. # # Copyright © 2023 Donal K Fellows. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # proc writeFile {args} { # Parse the arguments switch [llength $args] { 2 { lassign $args filename data set mode text } 3 { lassign $args filename mode data set MODES {binary text} set ERR [list -level 1 -errorcode [list TCL LOOKUP MODE $mode]] set mode [tcl::prefix match -message "mode" -error $ERR $MODES $mode] } default { set COMMAND [lindex [info level 0] 0] return -code error -errorcode {TCL WRONGARGS} \ "wrong # args: should be \"$COMMAND filename ?mode? data\"" } } # Write the file set f [open $filename [dict get {text w binary wb} $mode]] try { puts -nonewline $f $data } finally { close $f } } tcl9.0.3/library/word.tcl0000644000175000017500000001123415104661341014673 0ustar sergeisergei# word.tcl -- # # This file defines various procedures for computing word boundaries in # strings. This file is primarily needed so Tk text and entry widgets behave # properly for different platforms. # # Copyright © 1996 Sun Microsystems, Inc. # Copyright © 1998 Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # The following variables are used to determine which characters are # interpreted as word characters. See bug [f1253530cdd8]. Will # probably be removed in Tcl 9. if {![info exists ::tcl_wordchars]} { set ::tcl_wordchars {\w} } if {![info exists ::tcl_nonwordchars]} { set ::tcl_nonwordchars {\W} } # Arrange for caches of the real matcher REs to be kept, which enables the REs # themselves to be cached for greater performance (and somewhat greater # clarity too). namespace eval ::tcl { variable WordBreakRE array set WordBreakRE {} proc UpdateWordBreakREs args { # Ignores the arguments global tcl_wordchars tcl_nonwordchars variable WordBreakRE # To keep the RE strings short... set letter $tcl_wordchars set space $tcl_nonwordchars set WordBreakRE(after) "$letter$space|$space$letter" set WordBreakRE(before) "^.*($letter$space|$space$letter)" set WordBreakRE(end) "$space*$letter+$space" set WordBreakRE(next) "$letter*$space+$letter" set WordBreakRE(previous) "$space*($letter+)$space*\$" } # Initialize the cache UpdateWordBreakREs trace add variable ::tcl_wordchars write ::tcl::UpdateWordBreakREs trace add variable ::tcl_nonwordchars write ::tcl::UpdateWordBreakREs } # tcl_wordBreakAfter -- # # This procedure returns the index of the first word boundary after the # starting point in the given string, or -1 if there are no more boundaries in # the given string. The index returned refers to the first character of the # pair that comprises a boundary. # # Arguments: # str - String to search. # start - Index into string specifying starting point. proc tcl_wordBreakAfter {str start} { variable ::tcl::WordBreakRE set result {-1 -1} if {$start < 0} { set start 0; } regexp -indices -start $start -- $WordBreakRE(after) $str result return [lindex $result 1] } # tcl_wordBreakBefore -- # # This procedure returns the index of the first word boundary before the # starting point in the given string, or -1 if there are no more boundaries in # the given string. The index returned refers to the second character of the # pair that comprises a boundary. # # Arguments: # str - String to search. # start - Index into string specifying starting point. proc tcl_wordBreakBefore {str start} { variable ::tcl::WordBreakRE set result {-1 -1} if {$start >= 0} { regexp -indices -- $WordBreakRE(before) [string range $str 0 $start] result } return [lindex $result 1] } # tcl_endOfWord -- # # This procedure returns the index of the first end-of-word location after a # starting index in the given string. An end-of-word location is defined to be # the first whitespace character following the first non-whitespace character # after the starting point. Returns -1 if there are no more words after the # starting point. # # Arguments: # str - String to search. # start - Index into string specifying starting point. proc tcl_endOfWord {str start} { variable ::tcl::WordBreakRE set result {-1 -1} if {$start < 0} { set start 0 } regexp -indices -start $start -- $WordBreakRE(end) $str result return [lindex $result 1] } # tcl_startOfNextWord -- # # This procedure returns the index of the first start-of-word location after a # starting index in the given string. A start-of-word location is defined to # be a non-whitespace character following a whitespace character. Returns -1 # if there are no more start-of-word locations after the starting point. # # Arguments: # str - String to search. # start - Index into string specifying starting point. proc tcl_startOfNextWord {str start} { variable ::tcl::WordBreakRE set result {-1 -1} if {$start < 0} { set start 0 } regexp -indices -start $start -- $WordBreakRE(next) $str result return [lindex $result 1] } # tcl_startOfPreviousWord -- # # This procedure returns the index of the first start-of-word location before # a starting index in the given string. # # Arguments: # str - String to search. # start - Index into string specifying starting point. proc tcl_startOfPreviousWord {str start} { variable ::tcl::WordBreakRE set word {-1 -1} if {$start > 0} { regexp -indices -- $WordBreakRE(previous) [string range [string range $str 0 $start] 0 end-1] \ result word } return [lindex $word 0] } tcl9.0.3/library/tzdata/0000755000175000017500000000000015104662345014507 5ustar sergeisergeitcl9.0.3/library/tzdata/Zulu0000664000175000017500000000022515035744305015372 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:Zulu) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/WET0000664000175000017500000000024615035744305015075 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Lisbon)]} { LoadTimeZoneFile Europe/Lisbon } set TZData(:WET) $TZData(:Europe/Lisbon) tcl9.0.3/library/tzdata/W-SU0000664000175000017500000000024715035744305015172 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Moscow)]} { LoadTimeZoneFile Europe/Moscow } set TZData(:W-SU) $TZData(:Europe/Moscow) tcl9.0.3/library/tzdata/UTC0000664000175000017500000000022415035744305015065 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:UTC) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/US/0000755000175000017500000000000015104662345015036 5ustar sergeisergeitcl9.0.3/library/tzdata/US/Samoa0000664000175000017500000000026715035744305016030 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Pago_Pago)]} { LoadTimeZoneFile Pacific/Pago_Pago } set TZData(:US/Samoa) $TZData(:Pacific/Pago_Pago) tcl9.0.3/library/tzdata/US/Pacific0000664000175000017500000000027715035744305016327 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Los_Angeles)]} { LoadTimeZoneFile America/Los_Angeles } set TZData(:US/Pacific) $TZData(:America/Los_Angeles) tcl9.0.3/library/tzdata/US/Mountain0000664000175000017500000000026115035744305016554 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Denver)]} { LoadTimeZoneFile America/Denver } set TZData(:US/Mountain) $TZData(:America/Denver) tcl9.0.3/library/tzdata/US/Michigan0000664000175000017500000000026415035744305016504 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Detroit)]} { LoadTimeZoneFile America/Detroit } set TZData(:US/Michigan) $TZData(:America/Detroit) tcl9.0.3/library/tzdata/US/Indiana-Starke0000664000175000017500000000031115035744305017550 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Indiana/Knox)]} { LoadTimeZoneFile America/Indiana/Knox } set TZData(:US/Indiana-Starke) $TZData(:America/Indiana/Knox) tcl9.0.3/library/tzdata/US/Hawaii0000664000175000017500000000026515035744305016170 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Honolulu)]} { LoadTimeZoneFile Pacific/Honolulu } set TZData(:US/Hawaii) $TZData(:Pacific/Honolulu) tcl9.0.3/library/tzdata/US/Eastern0000664000175000017500000000026615035744305016370 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/New_York)]} { LoadTimeZoneFile America/New_York } set TZData(:US/Eastern) $TZData(:America/New_York) tcl9.0.3/library/tzdata/US/East-Indiana0000664000175000017500000000033715035744305017223 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Indiana/Indianapolis)]} { LoadTimeZoneFile America/Indiana/Indianapolis } set TZData(:US/East-Indiana) $TZData(:America/Indiana/Indianapolis) tcl9.0.3/library/tzdata/US/Central0000664000175000017500000000026315035744305016354 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Chicago)]} { LoadTimeZoneFile America/Chicago } set TZData(:US/Central) $TZData(:America/Chicago) tcl9.0.3/library/tzdata/US/Arizona0000664000175000017500000000026315035744305016367 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Phoenix)]} { LoadTimeZoneFile America/Phoenix } set TZData(:US/Arizona) $TZData(:America/Phoenix) tcl9.0.3/library/tzdata/US/Aleutian0000664000175000017500000000025315035744305016525 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Adak)]} { LoadTimeZoneFile America/Adak } set TZData(:US/Aleutian) $TZData(:America/Adak) tcl9.0.3/library/tzdata/US/Alaska0000664000175000017500000000027015035744305016156 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Anchorage)]} { LoadTimeZoneFile America/Anchorage } set TZData(:US/Alaska) $TZData(:America/Anchorage) tcl9.0.3/library/tzdata/Universal0000664000175000017500000000023215035744305016401 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:Universal) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/UCT0000664000175000017500000000022415035744305015065 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:UCT) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/Turkey0000664000175000017500000000025715035744305015723 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Istanbul)]} { LoadTimeZoneFile Europe/Istanbul } set TZData(:Turkey) $TZData(:Europe/Istanbul) tcl9.0.3/library/tzdata/Singapore0000664000175000017500000000025715035744305016367 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Singapore)]} { LoadTimeZoneFile Asia/Singapore } set TZData(:Singapore) $TZData(:Asia/Singapore) tcl9.0.3/library/tzdata/ROK0000664000175000017500000000023515035744305015067 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Seoul)]} { LoadTimeZoneFile Asia/Seoul } set TZData(:ROK) $TZData(:Asia/Seoul) tcl9.0.3/library/tzdata/ROC0000664000175000017500000000024015035744305015053 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Taipei)]} { LoadTimeZoneFile Asia/Taipei } set TZData(:ROC) $TZData(:Asia/Taipei) tcl9.0.3/library/tzdata/PST8PDT0000664000175000017500000000027415035744305015545 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Los_Angeles)]} { LoadTimeZoneFile America/Los_Angeles } set TZData(:PST8PDT) $TZData(:America/Los_Angeles) tcl9.0.3/library/tzdata/PRC0000664000175000017500000000024615035744305015062 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Shanghai)]} { LoadTimeZoneFile Asia/Shanghai } set TZData(:PRC) $TZData(:Asia/Shanghai) tcl9.0.3/library/tzdata/Portugal0000664000175000017500000000025315035744305016231 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Lisbon)]} { LoadTimeZoneFile Europe/Lisbon } set TZData(:Portugal) $TZData(:Europe/Lisbon) tcl9.0.3/library/tzdata/Poland0000664000175000017500000000025115035744305015647 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Warsaw)]} { LoadTimeZoneFile Europe/Warsaw } set TZData(:Poland) $TZData(:Europe/Warsaw) tcl9.0.3/library/tzdata/Pacific/0000755000175000017500000000000015104662345016045 5ustar sergeisergeitcl9.0.3/library/tzdata/Pacific/Yap0000664000175000017500000000030315035744305016517 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Port_Moresby)]} { LoadTimeZoneFile Pacific/Port_Moresby } set TZData(:Pacific/Yap) $TZData(:Pacific/Port_Moresby) tcl9.0.3/library/tzdata/Pacific/Wallis0000664000175000017500000000026415035744305017227 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Tarawa)]} { LoadTimeZoneFile Pacific/Tarawa } set TZData(:Pacific/Wallis) $TZData(:Pacific/Tarawa) tcl9.0.3/library/tzdata/Pacific/Wake0000664000175000017500000000026215035744305016661 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Tarawa)]} { LoadTimeZoneFile Pacific/Tarawa } set TZData(:Pacific/Wake) $TZData(:Pacific/Tarawa) tcl9.0.3/library/tzdata/Pacific/Truk0000664000175000017500000000030415035744305016714 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Port_Moresby)]} { LoadTimeZoneFile Pacific/Port_Moresby } set TZData(:Pacific/Truk) $TZData(:Pacific/Port_Moresby) tcl9.0.3/library/tzdata/Pacific/Tongatapu0000664000175000017500000000070715035744305017740 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Tongatapu) { {-9223372036854775808 44352 0 LMT} {-767189952 44400 0 +1220} {-284041200 46800 0 +1300} {915102000 46800 0 +1300} {939214800 50400 1 +1400} {953384400 46800 0 +1300} {973342800 50400 1 +1400} {980596800 46800 0 +1300} {1004792400 50400 1 +1400} {1012046400 46800 0 +1300} {1478350800 50400 1 +1400} {1484398800 46800 0 +1300} } tcl9.0.3/library/tzdata/Pacific/Tarawa0000664000175000017500000000022415035744305017207 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Tarawa) { {-9223372036854775808 41524 0 LMT} {-2177494324 43200 0 +1200} } tcl9.0.3/library/tzdata/Pacific/Tahiti0000664000175000017500000000022615035744305017214 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Tahiti) { {-9223372036854775808 -35896 0 LMT} {-1806674504 -36000 0 -1000} } tcl9.0.3/library/tzdata/Pacific/Samoa0000664000175000017500000000027415035744305017035 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Pago_Pago)]} { LoadTimeZoneFile Pacific/Pago_Pago } set TZData(:Pacific/Samoa) $TZData(:Pacific/Pago_Pago) tcl9.0.3/library/tzdata/Pacific/Saipan0000664000175000017500000000025615035744305017210 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Guam)]} { LoadTimeZoneFile Pacific/Guam } set TZData(:Pacific/Saipan) $TZData(:Pacific/Guam) tcl9.0.3/library/tzdata/Pacific/Rarotonga0000664000175000017500000000173415035744305017733 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Rarotonga) { {-9223372036854775808 48056 0 LMT} {-2209555256 -38344 0 LMT} {-543072056 -37800 0 -1130} {279714600 -34200 0 -1030} {289387800 -36000 0 -1000} {309952800 -34200 1 -1030} {320837400 -36000 0 -1000} {341402400 -34200 1 -1030} {352287000 -36000 0 -1000} {372852000 -34200 1 -1030} {384341400 -36000 0 -1000} {404906400 -34200 1 -1030} {415791000 -36000 0 -1000} {436356000 -34200 1 -1030} {447240600 -36000 0 -1000} {467805600 -34200 1 -1030} {478690200 -36000 0 -1000} {499255200 -34200 1 -1030} {510139800 -36000 0 -1000} {530704800 -34200 1 -1030} {541589400 -36000 0 -1000} {562154400 -34200 1 -1030} {573643800 -36000 0 -1000} {594208800 -34200 1 -1030} {605093400 -36000 0 -1000} {625658400 -34200 1 -1030} {636543000 -36000 0 -1000} {657108000 -34200 1 -1030} {667992600 -36000 0 -1000} } tcl9.0.3/library/tzdata/Pacific/Port_Moresby0000664000175000017500000000027115035744305020416 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Port_Moresby) { {-9223372036854775808 35320 0 LMT} {-2840176120 35312 0 PMMT} {-2366790512 36000 0 +1000} } tcl9.0.3/library/tzdata/Pacific/Ponape0000664000175000017500000000030315035744305017210 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Guadalcanal)]} { LoadTimeZoneFile Pacific/Guadalcanal } set TZData(:Pacific/Ponape) $TZData(:Pacific/Guadalcanal) tcl9.0.3/library/tzdata/Pacific/Pohnpei0000664000175000017500000000030415035744305017371 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Guadalcanal)]} { LoadTimeZoneFile Pacific/Guadalcanal } set TZData(:Pacific/Pohnpei) $TZData(:Pacific/Guadalcanal) tcl9.0.3/library/tzdata/Pacific/Pitcairn0000664000175000017500000000026715035744305017550 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Pitcairn) { {-9223372036854775808 -31220 0 LMT} {-2177421580 -30600 0 -0930} {893665800 -28800 0 -0800} } tcl9.0.3/library/tzdata/Pacific/Palau0000664000175000017500000000026215035744305017034 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Palau) { {-9223372036854775808 -54124 0 LMT} {-3944624276 32276 0 LMT} {-2177485076 32400 0 +0900} } tcl9.0.3/library/tzdata/Pacific/Pago_Pago0000664000175000017500000000026515035744305017631 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Pago_Pago) { {-9223372036854775808 45432 0 LMT} {-2445424632 -40968 0 LMT} {-1861879032 -39600 0 SST} } tcl9.0.3/library/tzdata/Pacific/Noumea0000664000175000017500000000051015035744305017212 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Noumea) { {-9223372036854775808 39948 0 LMT} {-1829387148 39600 0 +1100} {250002000 43200 1 +1200} {257342400 39600 0 +1100} {281451600 43200 1 +1200} {288878400 39600 0 +1100} {849366000 43200 1 +1200} {857228400 39600 0 +1100} } tcl9.0.3/library/tzdata/Pacific/Norfolk0000664000175000017500000001225515035744305017411 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Norfolk) { {-9223372036854775808 40312 0 LMT} {-2177493112 40320 0 +1112} {-599656320 41400 0 +1130} {152029800 45000 1 +1230} {162916200 41400 0 +1130} {1443882600 39600 0 +1100} {1561899600 39600 0 +1100} {1570287600 43200 1 +1200} {1586012400 39600 0 +1100} {1601737200 43200 1 +1200} {1617462000 39600 0 +1100} {1633186800 43200 1 +1200} {1648911600 39600 0 +1100} {1664636400 43200 1 +1200} {1680361200 39600 0 +1100} {1696086000 43200 1 +1200} {1712415600 39600 0 +1100} {1728140400 43200 1 +1200} {1743865200 39600 0 +1100} {1759590000 43200 1 +1200} {1775314800 39600 0 +1100} {1791039600 43200 1 +1200} {1806764400 39600 0 +1100} {1822489200 43200 1 +1200} {1838214000 39600 0 +1100} {1853938800 43200 1 +1200} {1869663600 39600 0 +1100} {1885993200 43200 1 +1200} {1901718000 39600 0 +1100} {1917442800 43200 1 +1200} {1933167600 39600 0 +1100} {1948892400 43200 1 +1200} {1964617200 39600 0 +1100} {1980342000 43200 1 +1200} {1996066800 39600 0 +1100} {2011791600 43200 1 +1200} {2027516400 39600 0 +1100} {2043241200 43200 1 +1200} {2058966000 39600 0 +1100} {2075295600 43200 1 +1200} {2091020400 39600 0 +1100} {2106745200 43200 1 +1200} {2122470000 39600 0 +1100} {2138194800 43200 1 +1200} {2153919600 39600 0 +1100} {2169644400 43200 1 +1200} {2185369200 39600 0 +1100} {2201094000 43200 1 +1200} {2216818800 39600 0 +1100} {2233148400 43200 1 +1200} {2248873200 39600 0 +1100} {2264598000 43200 1 +1200} {2280322800 39600 0 +1100} {2296047600 43200 1 +1200} {2311772400 39600 0 +1100} {2327497200 43200 1 +1200} {2343222000 39600 0 +1100} {2358946800 43200 1 +1200} {2374671600 39600 0 +1100} {2390396400 43200 1 +1200} {2406121200 39600 0 +1100} {2422450800 43200 1 +1200} {2438175600 39600 0 +1100} {2453900400 43200 1 +1200} {2469625200 39600 0 +1100} {2485350000 43200 1 +1200} {2501074800 39600 0 +1100} {2516799600 43200 1 +1200} {2532524400 39600 0 +1100} {2548249200 43200 1 +1200} {2563974000 39600 0 +1100} {2579698800 43200 1 +1200} {2596028400 39600 0 +1100} {2611753200 43200 1 +1200} {2627478000 39600 0 +1100} {2643202800 43200 1 +1200} {2658927600 39600 0 +1100} {2674652400 43200 1 +1200} {2690377200 39600 0 +1100} {2706102000 43200 1 +1200} {2721826800 39600 0 +1100} {2737551600 43200 1 +1200} {2753276400 39600 0 +1100} {2769606000 43200 1 +1200} {2785330800 39600 0 +1100} {2801055600 43200 1 +1200} {2816780400 39600 0 +1100} {2832505200 43200 1 +1200} {2848230000 39600 0 +1100} {2863954800 43200 1 +1200} {2879679600 39600 0 +1100} {2895404400 43200 1 +1200} {2911129200 39600 0 +1100} {2926854000 43200 1 +1200} {2942578800 39600 0 +1100} {2958908400 43200 1 +1200} {2974633200 39600 0 +1100} {2990358000 43200 1 +1200} {3006082800 39600 0 +1100} {3021807600 43200 1 +1200} {3037532400 39600 0 +1100} {3053257200 43200 1 +1200} {3068982000 39600 0 +1100} {3084706800 43200 1 +1200} {3100431600 39600 0 +1100} {3116761200 43200 1 +1200} {3132486000 39600 0 +1100} {3148210800 43200 1 +1200} {3163935600 39600 0 +1100} {3179660400 43200 1 +1200} {3195385200 39600 0 +1100} {3211110000 43200 1 +1200} {3226834800 39600 0 +1100} {3242559600 43200 1 +1200} {3258284400 39600 0 +1100} {3274009200 43200 1 +1200} {3289734000 39600 0 +1100} {3306063600 43200 1 +1200} {3321788400 39600 0 +1100} {3337513200 43200 1 +1200} {3353238000 39600 0 +1100} {3368962800 43200 1 +1200} {3384687600 39600 0 +1100} {3400412400 43200 1 +1200} {3416137200 39600 0 +1100} {3431862000 43200 1 +1200} {3447586800 39600 0 +1100} {3463311600 43200 1 +1200} {3479641200 39600 0 +1100} {3495366000 43200 1 +1200} {3511090800 39600 0 +1100} {3526815600 43200 1 +1200} {3542540400 39600 0 +1100} {3558265200 43200 1 +1200} {3573990000 39600 0 +1100} {3589714800 43200 1 +1200} {3605439600 39600 0 +1100} {3621164400 43200 1 +1200} {3636889200 39600 0 +1100} {3653218800 43200 1 +1200} {3668943600 39600 0 +1100} {3684668400 43200 1 +1200} {3700393200 39600 0 +1100} {3716118000 43200 1 +1200} {3731842800 39600 0 +1100} {3747567600 43200 1 +1200} {3763292400 39600 0 +1100} {3779017200 43200 1 +1200} {3794742000 39600 0 +1100} {3810466800 43200 1 +1200} {3826191600 39600 0 +1100} {3842521200 43200 1 +1200} {3858246000 39600 0 +1100} {3873970800 43200 1 +1200} {3889695600 39600 0 +1100} {3905420400 43200 1 +1200} {3921145200 39600 0 +1100} {3936870000 43200 1 +1200} {3952594800 39600 0 +1100} {3968319600 43200 1 +1200} {3984044400 39600 0 +1100} {4000374000 43200 1 +1200} {4016098800 39600 0 +1100} {4031823600 43200 1 +1200} {4047548400 39600 0 +1100} {4063273200 43200 1 +1200} {4078998000 39600 0 +1100} {4094722800 43200 1 +1200} } tcl9.0.3/library/tzdata/Pacific/Niue0000664000175000017500000000026315035744305016673 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Niue) { {-9223372036854775808 -40780 0 LMT} {-543069620 -40800 0 -1220} {-173623200 -39600 0 -1100} } tcl9.0.3/library/tzdata/Pacific/Nauru0000664000175000017500000000035715035744305017071 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Nauru) { {-9223372036854775808 40060 0 LMT} {-1545131260 41400 0 +1130} {-862918200 32400 0 +0900} {-767350800 41400 0 +1130} {287418600 43200 0 +1200} } tcl9.0.3/library/tzdata/Pacific/Midway0000664000175000017500000000027515035744305017230 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Pago_Pago)]} { LoadTimeZoneFile Pacific/Pago_Pago } set TZData(:Pacific/Midway) $TZData(:Pacific/Pago_Pago) tcl9.0.3/library/tzdata/Pacific/Marquesas0000664000175000017500000000023115035744305017727 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Marquesas) { {-9223372036854775808 -33480 0 LMT} {-1806676920 -34200 0 -1030} } tcl9.0.3/library/tzdata/Pacific/Majuro0000664000175000017500000000026415035744305017231 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Tarawa)]} { LoadTimeZoneFile Pacific/Tarawa } set TZData(:Pacific/Majuro) $TZData(:Pacific/Tarawa) tcl9.0.3/library/tzdata/Pacific/Kwajalein0000664000175000017500000000046115035744305017700 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Kwajalein) { {-9223372036854775808 40160 0 LMT} {-2177492960 39600 0 +1100} {-1041418800 36000 0 +1000} {-907408800 32400 0 +0900} {-817462800 39600 0 +1100} {-7988400 -43200 0 -1200} {745934400 43200 0 +1200} } tcl9.0.3/library/tzdata/Pacific/Kosrae0000664000175000017500000000061415035744305017217 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Kosrae) { {-9223372036854775808 -47284 0 LMT} {-3944631116 39116 0 LMT} {-2177491916 39600 0 +1100} {-1743678000 32400 0 +0900} {-1606813200 39600 0 +1100} {-1041418800 36000 0 +1000} {-907408800 32400 0 +0900} {-770634000 39600 0 +1100} {-7988400 43200 0 +1200} {915105600 39600 0 +1100} } tcl9.0.3/library/tzdata/Pacific/Kiritimati0000664000175000017500000000032715035744305020102 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Kiritimati) { {-9223372036854775808 -37760 0 LMT} {-2177415040 -38400 0 -1140} {307622400 -36000 0 -1000} {788868000 50400 0 +1400} } tcl9.0.3/library/tzdata/Pacific/Kanton0000664000175000017500000000031615035744305017224 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Kanton) { {-9223372036854775808 0 0 -00} {-1020470400 -43200 0 -1200} {307627200 -39600 0 -1100} {788871600 46800 0 +1300} } tcl9.0.3/library/tzdata/Pacific/Johnston0000664000175000017500000000027415035744305017577 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Honolulu)]} { LoadTimeZoneFile Pacific/Honolulu } set TZData(:Pacific/Johnston) $TZData(:Pacific/Honolulu) tcl9.0.3/library/tzdata/Pacific/Honolulu0000664000175000017500000000051415035744305017577 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Honolulu) { {-9223372036854775808 -37886 0 LMT} {-2334101314 -37800 0 HST} {-1157283000 -34200 1 HDT} {-1155436200 -34200 0 HST} {-880201800 -34200 1 HWT} {-769395600 -34200 1 HPT} {-765376200 -37800 0 HST} {-712150200 -36000 0 HST} } tcl9.0.3/library/tzdata/Pacific/Guam0000664000175000017500000000130515035744305016662 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Guam) { {-9223372036854775808 -51660 0 LMT} {-3944626740 34740 0 LMT} {-2177487540 36000 0 GST} {-885549600 32400 0 +0900} {-802256400 36000 0 GST} {-331891200 39600 1 GDT} {-281610000 36000 0 GST} {-73728000 39600 1 GDT} {-29415540 36000 0 GST} {-16704000 39600 1 GDT} {-10659600 36000 0 GST} {9907200 39600 1 GDT} {21394800 36000 0 GST} {41356800 39600 1 GDT} {52844400 36000 0 GST} {124819200 39600 1 GDT} {130863600 36000 0 GST} {201888000 39600 1 GDT} {209487660 36000 0 GST} {230659200 39600 1 GDT} {241542000 36000 0 GST} {977493600 36000 0 ChST} } tcl9.0.3/library/tzdata/Pacific/Guadalcanal0000664000175000017500000000023115035744305020162 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Guadalcanal) { {-9223372036854775808 38388 0 LMT} {-1806748788 39600 0 +1100} } tcl9.0.3/library/tzdata/Pacific/Gambier0000664000175000017500000000022715035744305017341 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Gambier) { {-9223372036854775808 -32388 0 LMT} {-1806678012 -32400 0 -0900} } tcl9.0.3/library/tzdata/Pacific/Galapagos0000664000175000017500000000036615035744305017675 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Galapagos) { {-9223372036854775808 -21504 0 LMT} {-1230746496 -18000 0 -0500} {504939600 -21600 0 -0600} {722930400 -18000 1 -0500} {728888400 -21600 0 -0600} } tcl9.0.3/library/tzdata/Pacific/Funafuti0000664000175000017500000000026615035744305017557 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Tarawa)]} { LoadTimeZoneFile Pacific/Tarawa } set TZData(:Pacific/Funafuti) $TZData(:Pacific/Tarawa) tcl9.0.3/library/tzdata/Pacific/Fiji0000664000175000017500000000176215035744305016661 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Fiji) { {-9223372036854775808 42944 0 LMT} {-1709985344 43200 0 +1200} {909842400 46800 1 +1300} {920124000 43200 0 +1200} {941896800 46800 1 +1300} {951573600 43200 0 +1200} {1259416800 46800 1 +1300} {1269698400 43200 0 +1200} {1287842400 46800 1 +1300} {1299333600 43200 0 +1200} {1319292000 46800 1 +1300} {1327154400 43200 0 +1200} {1350741600 46800 1 +1300} {1358604000 43200 0 +1200} {1382796000 46800 1 +1300} {1390050000 43200 0 +1200} {1414850400 46800 1 +1300} {1421503200 43200 0 +1200} {1446300000 46800 1 +1300} {1452952800 43200 0 +1200} {1478354400 46800 1 +1300} {1484402400 43200 0 +1200} {1509804000 46800 1 +1300} {1515852000 43200 0 +1200} {1541253600 46800 1 +1300} {1547301600 43200 0 +1200} {1573308000 46800 1 +1300} {1578751200 43200 0 +1200} {1608386400 46800 1 +1300} {1610805600 43200 0 +1200} } tcl9.0.3/library/tzdata/Pacific/Fakaofo0000664000175000017500000000026615035744305017344 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Fakaofo) { {-9223372036854775808 -41096 0 LMT} {-2177411704 -39600 0 -1100} {1325242800 46800 0 +1300} } tcl9.0.3/library/tzdata/Pacific/Enderbury0000664000175000017500000000026715035744305017736 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Kanton)]} { LoadTimeZoneFile Pacific/Kanton } set TZData(:Pacific/Enderbury) $TZData(:Pacific/Kanton) tcl9.0.3/library/tzdata/Pacific/Efate0000664000175000017500000000144715035744305017024 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Efate) { {-9223372036854775808 40396 0 LMT} {-1829387596 39600 0 +1100} {125409600 43200 1 +1200} {133876800 39600 0 +1100} {433256400 43200 1 +1200} {448977600 39600 0 +1100} {464706000 43200 1 +1200} {480427200 39600 0 +1100} {496760400 43200 1 +1200} {511876800 39600 0 +1100} {528210000 43200 1 +1200} {543931200 39600 0 +1100} {559659600 43200 1 +1200} {575380800 39600 0 +1100} {591109200 43200 1 +1200} {606830400 39600 0 +1100} {622558800 43200 1 +1200} {638280000 39600 0 +1100} {654008400 43200 1 +1200} {669729600 39600 0 +1100} {686062800 43200 1 +1200} {696340800 39600 0 +1100} {719931600 43200 1 +1200} {727790400 39600 0 +1100} } tcl9.0.3/library/tzdata/Pacific/Easter0000664000175000017500000002041315035744305017215 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Easter) { {-9223372036854775808 -26248 0 LMT} {-2524495352 -26248 0 EMT} {-1178124152 -25200 0 -0700} {-36619200 -21600 1 -0600} {-23922000 -25200 0 -0700} {-3355200 -21600 1 -0600} {7527600 -25200 0 -0700} {24465600 -21600 1 -0600} {37767600 -25200 0 -0700} {55915200 -21600 1 -0600} {69217200 -25200 0 -0700} {87969600 -21600 1 -0600} {100666800 -25200 0 -0700} {118209600 -21600 1 -0600} {132116400 -25200 0 -0700} {150868800 -21600 1 -0600} {163566000 -25200 0 -0700} {182318400 -21600 1 -0600} {195620400 -25200 0 -0700} {213768000 -21600 1 -0600} {227070000 -25200 0 -0700} {245217600 -21600 1 -0600} {258519600 -25200 0 -0700} {277272000 -21600 1 -0600} {289969200 -25200 0 -0700} {308721600 -21600 1 -0600} {321418800 -25200 0 -0700} {340171200 -21600 1 -0600} {353473200 -25200 0 -0700} {371620800 -21600 1 -0600} {384922800 -21600 0 -0600} {403070400 -18000 1 -0500} {416372400 -21600 0 -0600} {434520000 -18000 1 -0500} {447822000 -21600 0 -0600} {466574400 -18000 1 -0500} {479271600 -21600 0 -0600} {498024000 -18000 1 -0500} {510721200 -21600 0 -0600} {529473600 -18000 1 -0500} {545194800 -21600 0 -0600} {560923200 -18000 1 -0500} {574225200 -21600 0 -0600} {592372800 -18000 1 -0500} {605674800 -21600 0 -0600} {624427200 -18000 1 -0500} {637124400 -21600 0 -0600} {653457600 -18000 1 -0500} {668574000 -21600 0 -0600} {687326400 -18000 1 -0500} {700628400 -21600 0 -0600} {718776000 -18000 1 -0500} {732078000 -21600 0 -0600} {750225600 -18000 1 -0500} {763527600 -21600 0 -0600} {781675200 -18000 1 -0500} {794977200 -21600 0 -0600} {813729600 -18000 1 -0500} {826426800 -21600 0 -0600} {845179200 -18000 1 -0500} {859690800 -21600 0 -0600} {876628800 -18000 1 -0500} {889930800 -21600 0 -0600} {906868800 -18000 1 -0500} {923194800 -21600 0 -0600} {939528000 -18000 1 -0500} {952830000 -21600 0 -0600} {971582400 -18000 1 -0500} {984279600 -21600 0 -0600} {1003032000 -18000 1 -0500} {1015729200 -21600 0 -0600} {1034481600 -18000 1 -0500} {1047178800 -21600 0 -0600} {1065931200 -18000 1 -0500} {1079233200 -21600 0 -0600} {1097380800 -18000 1 -0500} {1110682800 -21600 0 -0600} {1128830400 -18000 1 -0500} {1142132400 -21600 0 -0600} {1160884800 -18000 1 -0500} {1173582000 -21600 0 -0600} {1192334400 -18000 1 -0500} {1206846000 -21600 0 -0600} {1223784000 -18000 1 -0500} {1237086000 -21600 0 -0600} {1255233600 -18000 1 -0500} {1270350000 -21600 0 -0600} {1286683200 -18000 1 -0500} {1304823600 -21600 0 -0600} {1313899200 -18000 1 -0500} {1335668400 -21600 0 -0600} {1346558400 -18000 1 -0500} {1367118000 -21600 0 -0600} {1378612800 -18000 1 -0500} {1398567600 -21600 0 -0600} {1410062400 -18000 1 -0500} {1463281200 -21600 0 -0600} {1471147200 -18000 1 -0500} {1494730800 -21600 0 -0600} {1502596800 -18000 1 -0500} {1526180400 -21600 0 -0600} {1534046400 -18000 1 -0500} {1554606000 -21600 0 -0600} {1567915200 -18000 1 -0500} {1586055600 -21600 0 -0600} {1599364800 -18000 1 -0500} {1617505200 -21600 0 -0600} {1630814400 -18000 1 -0500} {1648954800 -21600 0 -0600} {1662868800 -18000 1 -0500} {1680404400 -21600 0 -0600} {1693713600 -18000 1 -0500} {1712458800 -21600 0 -0600} {1725768000 -18000 1 -0500} {1743908400 -21600 0 -0600} {1757217600 -18000 1 -0500} {1775358000 -21600 0 -0600} {1788667200 -18000 1 -0500} {1806807600 -21600 0 -0600} {1820116800 -18000 1 -0500} {1838257200 -21600 0 -0600} {1851566400 -18000 1 -0500} {1870311600 -21600 0 -0600} {1883016000 -18000 1 -0500} {1901761200 -21600 0 -0600} {1915070400 -18000 1 -0500} {1933210800 -21600 0 -0600} {1946520000 -18000 1 -0500} {1964660400 -21600 0 -0600} {1977969600 -18000 1 -0500} {1996110000 -21600 0 -0600} {2009419200 -18000 1 -0500} {2027559600 -21600 0 -0600} {2040868800 -18000 1 -0500} {2059614000 -21600 0 -0600} {2072318400 -18000 1 -0500} {2091063600 -21600 0 -0600} {2104372800 -18000 1 -0500} {2122513200 -21600 0 -0600} {2135822400 -18000 1 -0500} {2153962800 -21600 0 -0600} {2167272000 -18000 1 -0500} {2185412400 -21600 0 -0600} {2198721600 -18000 1 -0500} {2217466800 -21600 0 -0600} {2230171200 -18000 1 -0500} {2248916400 -21600 0 -0600} {2262225600 -18000 1 -0500} {2280366000 -21600 0 -0600} {2293675200 -18000 1 -0500} {2311815600 -21600 0 -0600} {2325124800 -18000 1 -0500} {2343265200 -21600 0 -0600} {2356574400 -18000 1 -0500} {2374714800 -21600 0 -0600} {2388024000 -18000 1 -0500} {2406769200 -21600 0 -0600} {2419473600 -18000 1 -0500} {2438218800 -21600 0 -0600} {2451528000 -18000 1 -0500} {2469668400 -21600 0 -0600} {2482977600 -18000 1 -0500} {2501118000 -21600 0 -0600} {2514427200 -18000 1 -0500} {2532567600 -21600 0 -0600} {2545876800 -18000 1 -0500} {2564017200 -21600 0 -0600} {2577326400 -18000 1 -0500} {2596071600 -21600 0 -0600} {2609380800 -18000 1 -0500} {2627521200 -21600 0 -0600} {2640830400 -18000 1 -0500} {2658970800 -21600 0 -0600} {2672280000 -18000 1 -0500} {2690420400 -21600 0 -0600} {2703729600 -18000 1 -0500} {2721870000 -21600 0 -0600} {2735179200 -18000 1 -0500} {2753924400 -21600 0 -0600} {2766628800 -18000 1 -0500} {2785374000 -21600 0 -0600} {2798683200 -18000 1 -0500} {2816823600 -21600 0 -0600} {2830132800 -18000 1 -0500} {2848273200 -21600 0 -0600} {2861582400 -18000 1 -0500} {2879722800 -21600 0 -0600} {2893032000 -18000 1 -0500} {2911172400 -21600 0 -0600} {2924481600 -18000 1 -0500} {2943226800 -21600 0 -0600} {2955931200 -18000 1 -0500} {2974676400 -21600 0 -0600} {2987985600 -18000 1 -0500} {3006126000 -21600 0 -0600} {3019435200 -18000 1 -0500} {3037575600 -21600 0 -0600} {3050884800 -18000 1 -0500} {3069025200 -21600 0 -0600} {3082334400 -18000 1 -0500} {3101079600 -21600 0 -0600} {3113784000 -18000 1 -0500} {3132529200 -21600 0 -0600} {3145838400 -18000 1 -0500} {3163978800 -21600 0 -0600} {3177288000 -18000 1 -0500} {3195428400 -21600 0 -0600} {3208737600 -18000 1 -0500} {3226878000 -21600 0 -0600} {3240187200 -18000 1 -0500} {3258327600 -21600 0 -0600} {3271636800 -18000 1 -0500} {3290382000 -21600 0 -0600} {3303086400 -18000 1 -0500} {3321831600 -21600 0 -0600} {3335140800 -18000 1 -0500} {3353281200 -21600 0 -0600} {3366590400 -18000 1 -0500} {3384730800 -21600 0 -0600} {3398040000 -18000 1 -0500} {3416180400 -21600 0 -0600} {3429489600 -18000 1 -0500} {3447630000 -21600 0 -0600} {3460939200 -18000 1 -0500} {3479684400 -21600 0 -0600} {3492993600 -18000 1 -0500} {3511134000 -21600 0 -0600} {3524443200 -18000 1 -0500} {3542583600 -21600 0 -0600} {3555892800 -18000 1 -0500} {3574033200 -21600 0 -0600} {3587342400 -18000 1 -0500} {3605482800 -21600 0 -0600} {3618792000 -18000 1 -0500} {3637537200 -21600 0 -0600} {3650241600 -18000 1 -0500} {3668986800 -21600 0 -0600} {3682296000 -18000 1 -0500} {3700436400 -21600 0 -0600} {3713745600 -18000 1 -0500} {3731886000 -21600 0 -0600} {3745195200 -18000 1 -0500} {3763335600 -21600 0 -0600} {3776644800 -18000 1 -0500} {3794785200 -21600 0 -0600} {3808094400 -18000 1 -0500} {3826839600 -21600 0 -0600} {3839544000 -18000 1 -0500} {3858289200 -21600 0 -0600} {3871598400 -18000 1 -0500} {3889738800 -21600 0 -0600} {3903048000 -18000 1 -0500} {3921188400 -21600 0 -0600} {3934497600 -18000 1 -0500} {3952638000 -21600 0 -0600} {3965947200 -18000 1 -0500} {3984692400 -21600 0 -0600} {3997396800 -18000 1 -0500} {4016142000 -21600 0 -0600} {4029451200 -18000 1 -0500} {4047591600 -21600 0 -0600} {4060900800 -18000 1 -0500} {4079041200 -21600 0 -0600} {4092350400 -18000 1 -0500} } tcl9.0.3/library/tzdata/Pacific/Chuuk0000664000175000017500000000030515035744305017047 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Port_Moresby)]} { LoadTimeZoneFile Pacific/Port_Moresby } set TZData(:Pacific/Chuuk) $TZData(:Pacific/Port_Moresby) tcl9.0.3/library/tzdata/Pacific/Chatham0000664000175000017500000001734315035744305017347 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Chatham) { {-9223372036854775808 44028 0 LMT} {-3192437628 44100 0 +1215} {-757426500 45900 0 +1245} {152632800 49500 1 +1345} {162309600 45900 0 +1245} {183477600 49500 1 +1345} {194968800 45900 0 +1245} {215532000 49500 1 +1345} {226418400 45900 0 +1245} {246981600 49500 1 +1345} {257868000 45900 0 +1245} {278431200 49500 1 +1345} {289317600 45900 0 +1245} {309880800 49500 1 +1345} {320767200 45900 0 +1245} {341330400 49500 1 +1345} {352216800 45900 0 +1245} {372780000 49500 1 +1345} {384271200 45900 0 +1245} {404834400 49500 1 +1345} {415720800 45900 0 +1245} {436284000 49500 1 +1345} {447170400 45900 0 +1245} {467733600 49500 1 +1345} {478620000 45900 0 +1245} {499183200 49500 1 +1345} {510069600 45900 0 +1245} {530632800 49500 1 +1345} {541519200 45900 0 +1245} {562082400 49500 1 +1345} {573573600 45900 0 +1245} {594136800 49500 1 +1345} {605023200 45900 0 +1245} {623772000 49500 1 +1345} {637682400 45900 0 +1245} {655221600 49500 1 +1345} {669132000 45900 0 +1245} {686671200 49500 1 +1345} {700581600 45900 0 +1245} {718120800 49500 1 +1345} {732636000 45900 0 +1245} {749570400 49500 1 +1345} {764085600 45900 0 +1245} {781020000 49500 1 +1345} {795535200 45900 0 +1245} {812469600 49500 1 +1345} {826984800 45900 0 +1245} {844524000 49500 1 +1345} {858434400 45900 0 +1245} {875973600 49500 1 +1345} {889884000 45900 0 +1245} {907423200 49500 1 +1345} {921938400 45900 0 +1245} {938872800 49500 1 +1345} {953388000 45900 0 +1245} {970322400 49500 1 +1345} {984837600 45900 0 +1245} {1002376800 49500 1 +1345} {1016287200 45900 0 +1245} {1033826400 49500 1 +1345} {1047736800 45900 0 +1245} {1065276000 49500 1 +1345} {1079791200 45900 0 +1245} {1096725600 49500 1 +1345} {1111240800 45900 0 +1245} {1128175200 49500 1 +1345} {1142690400 45900 0 +1245} {1159624800 49500 1 +1345} {1174140000 45900 0 +1245} {1191074400 49500 1 +1345} {1207404000 45900 0 +1245} {1222524000 49500 1 +1345} {1238853600 45900 0 +1245} {1253973600 49500 1 +1345} {1270303200 45900 0 +1245} {1285423200 49500 1 +1345} {1301752800 45900 0 +1245} {1316872800 49500 1 +1345} {1333202400 45900 0 +1245} {1348927200 49500 1 +1345} {1365256800 45900 0 +1245} {1380376800 49500 1 +1345} {1396706400 45900 0 +1245} {1411826400 49500 1 +1345} {1428156000 45900 0 +1245} {1443276000 49500 1 +1345} {1459605600 45900 0 +1245} {1474725600 49500 1 +1345} {1491055200 45900 0 +1245} {1506175200 49500 1 +1345} {1522504800 45900 0 +1245} {1538229600 49500 1 +1345} {1554559200 45900 0 +1245} {1569679200 49500 1 +1345} {1586008800 45900 0 +1245} {1601128800 49500 1 +1345} {1617458400 45900 0 +1245} {1632578400 49500 1 +1345} {1648908000 45900 0 +1245} {1664028000 49500 1 +1345} {1680357600 45900 0 +1245} {1695477600 49500 1 +1345} {1712412000 45900 0 +1245} {1727532000 49500 1 +1345} {1743861600 45900 0 +1245} {1758981600 49500 1 +1345} {1775311200 45900 0 +1245} {1790431200 49500 1 +1345} {1806760800 45900 0 +1245} {1821880800 49500 1 +1345} {1838210400 45900 0 +1245} {1853330400 49500 1 +1345} {1869660000 45900 0 +1245} {1885384800 49500 1 +1345} {1901714400 45900 0 +1245} {1916834400 49500 1 +1345} {1933164000 45900 0 +1245} {1948284000 49500 1 +1345} {1964613600 45900 0 +1245} {1979733600 49500 1 +1345} {1996063200 45900 0 +1245} {2011183200 49500 1 +1345} {2027512800 45900 0 +1245} {2042632800 49500 1 +1345} {2058962400 45900 0 +1245} {2074687200 49500 1 +1345} {2091016800 45900 0 +1245} {2106136800 49500 1 +1345} {2122466400 45900 0 +1245} {2137586400 49500 1 +1345} {2153916000 45900 0 +1245} {2169036000 49500 1 +1345} {2185365600 45900 0 +1245} {2200485600 49500 1 +1345} {2216815200 45900 0 +1245} {2232540000 49500 1 +1345} {2248869600 45900 0 +1245} {2263989600 49500 1 +1345} {2280319200 45900 0 +1245} {2295439200 49500 1 +1345} {2311768800 45900 0 +1245} {2326888800 49500 1 +1345} {2343218400 45900 0 +1245} {2358338400 49500 1 +1345} {2374668000 45900 0 +1245} {2389788000 49500 1 +1345} {2406117600 45900 0 +1245} {2421842400 49500 1 +1345} {2438172000 45900 0 +1245} {2453292000 49500 1 +1345} {2469621600 45900 0 +1245} {2484741600 49500 1 +1345} {2501071200 45900 0 +1245} {2516191200 49500 1 +1345} {2532520800 45900 0 +1245} {2547640800 49500 1 +1345} {2563970400 45900 0 +1245} {2579090400 49500 1 +1345} {2596024800 45900 0 +1245} {2611144800 49500 1 +1345} {2627474400 45900 0 +1245} {2642594400 49500 1 +1345} {2658924000 45900 0 +1245} {2674044000 49500 1 +1345} {2690373600 45900 0 +1245} {2705493600 49500 1 +1345} {2721823200 45900 0 +1245} {2736943200 49500 1 +1345} {2753272800 45900 0 +1245} {2768997600 49500 1 +1345} {2785327200 45900 0 +1245} {2800447200 49500 1 +1345} {2816776800 45900 0 +1245} {2831896800 49500 1 +1345} {2848226400 45900 0 +1245} {2863346400 49500 1 +1345} {2879676000 45900 0 +1245} {2894796000 49500 1 +1345} {2911125600 45900 0 +1245} {2926245600 49500 1 +1345} {2942575200 45900 0 +1245} {2958300000 49500 1 +1345} {2974629600 45900 0 +1245} {2989749600 49500 1 +1345} {3006079200 45900 0 +1245} {3021199200 49500 1 +1345} {3037528800 45900 0 +1245} {3052648800 49500 1 +1345} {3068978400 45900 0 +1245} {3084098400 49500 1 +1345} {3100428000 45900 0 +1245} {3116152800 49500 1 +1345} {3132482400 45900 0 +1245} {3147602400 49500 1 +1345} {3163932000 45900 0 +1245} {3179052000 49500 1 +1345} {3195381600 45900 0 +1245} {3210501600 49500 1 +1345} {3226831200 45900 0 +1245} {3241951200 49500 1 +1345} {3258280800 45900 0 +1245} {3273400800 49500 1 +1345} {3289730400 45900 0 +1245} {3305455200 49500 1 +1345} {3321784800 45900 0 +1245} {3336904800 49500 1 +1345} {3353234400 45900 0 +1245} {3368354400 49500 1 +1345} {3384684000 45900 0 +1245} {3399804000 49500 1 +1345} {3416133600 45900 0 +1245} {3431253600 49500 1 +1345} {3447583200 45900 0 +1245} {3462703200 49500 1 +1345} {3479637600 45900 0 +1245} {3494757600 49500 1 +1345} {3511087200 45900 0 +1245} {3526207200 49500 1 +1345} {3542536800 45900 0 +1245} {3557656800 49500 1 +1345} {3573986400 45900 0 +1245} {3589106400 49500 1 +1345} {3605436000 45900 0 +1245} {3620556000 49500 1 +1345} {3636885600 45900 0 +1245} {3652610400 49500 1 +1345} {3668940000 45900 0 +1245} {3684060000 49500 1 +1345} {3700389600 45900 0 +1245} {3715509600 49500 1 +1345} {3731839200 45900 0 +1245} {3746959200 49500 1 +1345} {3763288800 45900 0 +1245} {3778408800 49500 1 +1345} {3794738400 45900 0 +1245} {3809858400 49500 1 +1345} {3826188000 45900 0 +1245} {3841912800 49500 1 +1345} {3858242400 45900 0 +1245} {3873362400 49500 1 +1345} {3889692000 45900 0 +1245} {3904812000 49500 1 +1345} {3921141600 45900 0 +1245} {3936261600 49500 1 +1345} {3952591200 45900 0 +1245} {3967711200 49500 1 +1345} {3984040800 45900 0 +1245} {3999765600 49500 1 +1345} {4016095200 45900 0 +1245} {4031215200 49500 1 +1345} {4047544800 45900 0 +1245} {4062664800 49500 1 +1345} {4078994400 45900 0 +1245} {4094114400 49500 1 +1345} } tcl9.0.3/library/tzdata/Pacific/Bougainville0000664000175000017500000000042615035744305020414 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Bougainville) { {-9223372036854775808 37336 0 LMT} {-2840178136 35312 0 PMMT} {-2366790512 36000 0 +1000} {-868010400 32400 0 +0900} {-768906000 36000 0 +1000} {1419696000 39600 0 +1100} } tcl9.0.3/library/tzdata/Pacific/Auckland0000664000175000017500000002044715035744305017523 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Auckland) { {-9223372036854775808 41944 0 LMT} {-3192435544 41400 0 NZMT} {-1330335000 45000 1 NZST} {-1320057000 41400 0 NZMT} {-1300699800 43200 1 NZST} {-1287396000 41400 0 NZMT} {-1269250200 43200 1 NZST} {-1255946400 41400 0 NZMT} {-1237800600 43200 1 NZST} {-1224496800 41400 0 NZMT} {-1206351000 43200 1 NZST} {-1192442400 41400 0 NZMT} {-1174901400 43200 1 NZST} {-1160992800 41400 0 NZMT} {-1143451800 43200 1 NZST} {-1125914400 41400 0 NZMT} {-1112607000 43200 1 NZST} {-1094464800 41400 0 NZMT} {-1081157400 43200 1 NZST} {-1063015200 41400 0 NZMT} {-1049707800 43200 1 NZST} {-1031565600 41400 0 NZMT} {-1018258200 43200 1 NZST} {-1000116000 41400 0 NZMT} {-986808600 43200 1 NZST} {-968061600 41400 0 NZMT} {-955359000 43200 1 NZST} {-936612000 41400 0 NZMT} {-923304600 43200 1 NZST} {-757425600 43200 0 NZST} {152632800 46800 1 NZDT} {162309600 43200 0 NZST} {183477600 46800 1 NZDT} {194968800 43200 0 NZST} {215532000 46800 1 NZDT} {226418400 43200 0 NZST} {246981600 46800 1 NZDT} {257868000 43200 0 NZST} {278431200 46800 1 NZDT} {289317600 43200 0 NZST} {309880800 46800 1 NZDT} {320767200 43200 0 NZST} {341330400 46800 1 NZDT} {352216800 43200 0 NZST} {372780000 46800 1 NZDT} {384271200 43200 0 NZST} {404834400 46800 1 NZDT} {415720800 43200 0 NZST} {436284000 46800 1 NZDT} {447170400 43200 0 NZST} {467733600 46800 1 NZDT} {478620000 43200 0 NZST} {499183200 46800 1 NZDT} {510069600 43200 0 NZST} {530632800 46800 1 NZDT} {541519200 43200 0 NZST} {562082400 46800 1 NZDT} {573573600 43200 0 NZST} {594136800 46800 1 NZDT} {605023200 43200 0 NZST} {623772000 46800 1 NZDT} {637682400 43200 0 NZST} {655221600 46800 1 NZDT} {669132000 43200 0 NZST} {686671200 46800 1 NZDT} {700581600 43200 0 NZST} {718120800 46800 1 NZDT} {732636000 43200 0 NZST} {749570400 46800 1 NZDT} {764085600 43200 0 NZST} {781020000 46800 1 NZDT} {795535200 43200 0 NZST} {812469600 46800 1 NZDT} {826984800 43200 0 NZST} {844524000 46800 1 NZDT} {858434400 43200 0 NZST} {875973600 46800 1 NZDT} {889884000 43200 0 NZST} {907423200 46800 1 NZDT} {921938400 43200 0 NZST} {938872800 46800 1 NZDT} {953388000 43200 0 NZST} {970322400 46800 1 NZDT} {984837600 43200 0 NZST} {1002376800 46800 1 NZDT} {1016287200 43200 0 NZST} {1033826400 46800 1 NZDT} {1047736800 43200 0 NZST} {1065276000 46800 1 NZDT} {1079791200 43200 0 NZST} {1096725600 46800 1 NZDT} {1111240800 43200 0 NZST} {1128175200 46800 1 NZDT} {1142690400 43200 0 NZST} {1159624800 46800 1 NZDT} {1174140000 43200 0 NZST} {1191074400 46800 1 NZDT} {1207404000 43200 0 NZST} {1222524000 46800 1 NZDT} {1238853600 43200 0 NZST} {1253973600 46800 1 NZDT} {1270303200 43200 0 NZST} {1285423200 46800 1 NZDT} {1301752800 43200 0 NZST} {1316872800 46800 1 NZDT} {1333202400 43200 0 NZST} {1348927200 46800 1 NZDT} {1365256800 43200 0 NZST} {1380376800 46800 1 NZDT} {1396706400 43200 0 NZST} {1411826400 46800 1 NZDT} {1428156000 43200 0 NZST} {1443276000 46800 1 NZDT} {1459605600 43200 0 NZST} {1474725600 46800 1 NZDT} {1491055200 43200 0 NZST} {1506175200 46800 1 NZDT} {1522504800 43200 0 NZST} {1538229600 46800 1 NZDT} {1554559200 43200 0 NZST} {1569679200 46800 1 NZDT} {1586008800 43200 0 NZST} {1601128800 46800 1 NZDT} {1617458400 43200 0 NZST} {1632578400 46800 1 NZDT} {1648908000 43200 0 NZST} {1664028000 46800 1 NZDT} {1680357600 43200 0 NZST} {1695477600 46800 1 NZDT} {1712412000 43200 0 NZST} {1727532000 46800 1 NZDT} {1743861600 43200 0 NZST} {1758981600 46800 1 NZDT} {1775311200 43200 0 NZST} {1790431200 46800 1 NZDT} {1806760800 43200 0 NZST} {1821880800 46800 1 NZDT} {1838210400 43200 0 NZST} {1853330400 46800 1 NZDT} {1869660000 43200 0 NZST} {1885384800 46800 1 NZDT} {1901714400 43200 0 NZST} {1916834400 46800 1 NZDT} {1933164000 43200 0 NZST} {1948284000 46800 1 NZDT} {1964613600 43200 0 NZST} {1979733600 46800 1 NZDT} {1996063200 43200 0 NZST} {2011183200 46800 1 NZDT} {2027512800 43200 0 NZST} {2042632800 46800 1 NZDT} {2058962400 43200 0 NZST} {2074687200 46800 1 NZDT} {2091016800 43200 0 NZST} {2106136800 46800 1 NZDT} {2122466400 43200 0 NZST} {2137586400 46800 1 NZDT} {2153916000 43200 0 NZST} {2169036000 46800 1 NZDT} {2185365600 43200 0 NZST} {2200485600 46800 1 NZDT} {2216815200 43200 0 NZST} {2232540000 46800 1 NZDT} {2248869600 43200 0 NZST} {2263989600 46800 1 NZDT} {2280319200 43200 0 NZST} {2295439200 46800 1 NZDT} {2311768800 43200 0 NZST} {2326888800 46800 1 NZDT} {2343218400 43200 0 NZST} {2358338400 46800 1 NZDT} {2374668000 43200 0 NZST} {2389788000 46800 1 NZDT} {2406117600 43200 0 NZST} {2421842400 46800 1 NZDT} {2438172000 43200 0 NZST} {2453292000 46800 1 NZDT} {2469621600 43200 0 NZST} {2484741600 46800 1 NZDT} {2501071200 43200 0 NZST} {2516191200 46800 1 NZDT} {2532520800 43200 0 NZST} {2547640800 46800 1 NZDT} {2563970400 43200 0 NZST} {2579090400 46800 1 NZDT} {2596024800 43200 0 NZST} {2611144800 46800 1 NZDT} {2627474400 43200 0 NZST} {2642594400 46800 1 NZDT} {2658924000 43200 0 NZST} {2674044000 46800 1 NZDT} {2690373600 43200 0 NZST} {2705493600 46800 1 NZDT} {2721823200 43200 0 NZST} {2736943200 46800 1 NZDT} {2753272800 43200 0 NZST} {2768997600 46800 1 NZDT} {2785327200 43200 0 NZST} {2800447200 46800 1 NZDT} {2816776800 43200 0 NZST} {2831896800 46800 1 NZDT} {2848226400 43200 0 NZST} {2863346400 46800 1 NZDT} {2879676000 43200 0 NZST} {2894796000 46800 1 NZDT} {2911125600 43200 0 NZST} {2926245600 46800 1 NZDT} {2942575200 43200 0 NZST} {2958300000 46800 1 NZDT} {2974629600 43200 0 NZST} {2989749600 46800 1 NZDT} {3006079200 43200 0 NZST} {3021199200 46800 1 NZDT} {3037528800 43200 0 NZST} {3052648800 46800 1 NZDT} {3068978400 43200 0 NZST} {3084098400 46800 1 NZDT} {3100428000 43200 0 NZST} {3116152800 46800 1 NZDT} {3132482400 43200 0 NZST} {3147602400 46800 1 NZDT} {3163932000 43200 0 NZST} {3179052000 46800 1 NZDT} {3195381600 43200 0 NZST} {3210501600 46800 1 NZDT} {3226831200 43200 0 NZST} {3241951200 46800 1 NZDT} {3258280800 43200 0 NZST} {3273400800 46800 1 NZDT} {3289730400 43200 0 NZST} {3305455200 46800 1 NZDT} {3321784800 43200 0 NZST} {3336904800 46800 1 NZDT} {3353234400 43200 0 NZST} {3368354400 46800 1 NZDT} {3384684000 43200 0 NZST} {3399804000 46800 1 NZDT} {3416133600 43200 0 NZST} {3431253600 46800 1 NZDT} {3447583200 43200 0 NZST} {3462703200 46800 1 NZDT} {3479637600 43200 0 NZST} {3494757600 46800 1 NZDT} {3511087200 43200 0 NZST} {3526207200 46800 1 NZDT} {3542536800 43200 0 NZST} {3557656800 46800 1 NZDT} {3573986400 43200 0 NZST} {3589106400 46800 1 NZDT} {3605436000 43200 0 NZST} {3620556000 46800 1 NZDT} {3636885600 43200 0 NZST} {3652610400 46800 1 NZDT} {3668940000 43200 0 NZST} {3684060000 46800 1 NZDT} {3700389600 43200 0 NZST} {3715509600 46800 1 NZDT} {3731839200 43200 0 NZST} {3746959200 46800 1 NZDT} {3763288800 43200 0 NZST} {3778408800 46800 1 NZDT} {3794738400 43200 0 NZST} {3809858400 46800 1 NZDT} {3826188000 43200 0 NZST} {3841912800 46800 1 NZDT} {3858242400 43200 0 NZST} {3873362400 46800 1 NZDT} {3889692000 43200 0 NZST} {3904812000 46800 1 NZDT} {3921141600 43200 0 NZST} {3936261600 46800 1 NZDT} {3952591200 43200 0 NZST} {3967711200 46800 1 NZDT} {3984040800 43200 0 NZST} {3999765600 46800 1 NZDT} {4016095200 43200 0 NZST} {4031215200 46800 1 NZDT} {4047544800 43200 0 NZST} {4062664800 46800 1 NZDT} {4078994400 43200 0 NZST} {4094114400 46800 1 NZDT} } tcl9.0.3/library/tzdata/Pacific/Apia0000664000175000017500000000163615035744305016652 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Pacific/Apia) { {-9223372036854775808 45184 0 LMT} {-2445424384 -41216 0 LMT} {-1861878784 -41400 0 -1230} {-631110600 -39600 0 -1100} {1285498800 -36000 1 -1000} {1301752800 -39600 0 -1100} {1316872800 -36000 1 -1000} {1325239200 50400 0 +1400} {1333202400 46800 0 +1300} {1348927200 50400 1 +1400} {1365256800 46800 0 +1300} {1380376800 50400 1 +1400} {1396706400 46800 0 +1300} {1411826400 50400 1 +1400} {1428156000 46800 0 +1300} {1443276000 50400 1 +1400} {1459605600 46800 0 +1300} {1474725600 50400 1 +1400} {1491055200 46800 0 +1300} {1506175200 50400 1 +1400} {1522504800 46800 0 +1300} {1538229600 50400 1 +1400} {1554559200 46800 0 +1300} {1569679200 50400 1 +1400} {1586008800 46800 0 +1300} {1601128800 50400 1 +1400} {1617458400 46800 0 +1300} } tcl9.0.3/library/tzdata/NZ-CHAT0000664000175000017500000000026015035744305015476 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Chatham)]} { LoadTimeZoneFile Pacific/Chatham } set TZData(:NZ-CHAT) $TZData(:Pacific/Chatham) tcl9.0.3/library/tzdata/NZ0000664000175000017500000000025615035744305014766 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Auckland)]} { LoadTimeZoneFile Pacific/Auckland } set TZData(:NZ) $TZData(:Pacific/Auckland) tcl9.0.3/library/tzdata/Navajo0000664000175000017500000000025415035744305015653 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Denver)]} { LoadTimeZoneFile America/Denver } set TZData(:Navajo) $TZData(:America/Denver) tcl9.0.3/library/tzdata/MST7MDT0000664000175000017500000000025515035744305015535 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Denver)]} { LoadTimeZoneFile America/Denver } set TZData(:MST7MDT) $TZData(:America/Denver) tcl9.0.3/library/tzdata/MST0000664000175000017500000000025415035744305015100 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Phoenix)]} { LoadTimeZoneFile America/Phoenix } set TZData(:MST) $TZData(:America/Phoenix) tcl9.0.3/library/tzdata/Mexico/0000755000175000017500000000000015104662345015733 5ustar sergeisergeitcl9.0.3/library/tzdata/Mexico/General0000664000175000017500000000030315035744305017231 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Mexico_City)]} { LoadTimeZoneFile America/Mexico_City } set TZData(:Mexico/General) $TZData(:America/Mexico_City) tcl9.0.3/library/tzdata/Mexico/BajaSur0000664000175000017500000000027215035744305017210 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Mazatlan)]} { LoadTimeZoneFile America/Mazatlan } set TZData(:Mexico/BajaSur) $TZData(:America/Mazatlan) tcl9.0.3/library/tzdata/Mexico/BajaNorte0000664000175000017500000000027115035744305017525 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Tijuana)]} { LoadTimeZoneFile America/Tijuana } set TZData(:Mexico/BajaNorte) $TZData(:America/Tijuana) tcl9.0.3/library/tzdata/MET0000664000175000017500000000025415035744305015062 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Brussels)]} { LoadTimeZoneFile Europe/Brussels } set TZData(:MET) $TZData(:Europe/Brussels) tcl9.0.3/library/tzdata/Libya0000664000175000017500000000025315035744305015474 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Tripoli)]} { LoadTimeZoneFile Africa/Tripoli } set TZData(:Libya) $TZData(:Africa/Tripoli) tcl9.0.3/library/tzdata/Kwajalein0000664000175000017500000000027015035744305016340 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Kwajalein)]} { LoadTimeZoneFile Pacific/Kwajalein } set TZData(:Kwajalein) $TZData(:Pacific/Kwajalein) tcl9.0.3/library/tzdata/Japan0000664000175000017500000000023715035744305015467 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Tokyo)]} { LoadTimeZoneFile Asia/Tokyo } set TZData(:Japan) $TZData(:Asia/Tokyo) tcl9.0.3/library/tzdata/Jamaica0000664000175000017500000000026015035744305015757 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Jamaica)]} { LoadTimeZoneFile America/Jamaica } set TZData(:Jamaica) $TZData(:America/Jamaica) tcl9.0.3/library/tzdata/Israel0000664000175000017500000000025415035744305015654 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Jerusalem)]} { LoadTimeZoneFile Asia/Jerusalem } set TZData(:Israel) $TZData(:Asia/Jerusalem) tcl9.0.3/library/tzdata/Iran0000664000175000017500000000024115035744305015322 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Tehran)]} { LoadTimeZoneFile Asia/Tehran } set TZData(:Iran) $TZData(:Asia/Tehran) tcl9.0.3/library/tzdata/Indian/0000755000175000017500000000000015104662345015711 5ustar sergeisergeitcl9.0.3/library/tzdata/Indian/Reunion0000664000175000017500000000025015035744305017252 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Dubai)]} { LoadTimeZoneFile Asia/Dubai } set TZData(:Indian/Reunion) $TZData(:Asia/Dubai) tcl9.0.3/library/tzdata/Indian/Mayotte0000664000175000017500000000026415035744305017262 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Indian/Mayotte) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Indian/Mauritius0000664000175000017500000000042015035744305017614 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Indian/Mauritius) { {-9223372036854775808 13800 0 LMT} {-1988164200 14400 0 +0400} {403041600 18000 1 +0500} {417034800 14400 0 +0400} {1224972000 18000 1 +0500} {1238274000 14400 0 +0400} } tcl9.0.3/library/tzdata/Indian/Maldives0000664000175000017500000000026215035744305017402 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Indian/Maldives) { {-9223372036854775808 17640 0 LMT} {-2840158440 17640 0 MMT} {-315636840 18000 0 +0500} } tcl9.0.3/library/tzdata/Indian/Mahe0000664000175000017500000000024515035744305016511 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Dubai)]} { LoadTimeZoneFile Asia/Dubai } set TZData(:Indian/Mahe) $TZData(:Asia/Dubai) tcl9.0.3/library/tzdata/Indian/Kerguelen0000664000175000017500000000027115035744305017557 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Indian/Maldives)]} { LoadTimeZoneFile Indian/Maldives } set TZData(:Indian/Kerguelen) $TZData(:Indian/Maldives) tcl9.0.3/library/tzdata/Indian/Comoro0000664000175000017500000000026315035744305017075 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Indian/Comoro) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Indian/Cocos0000664000175000017500000000025115035744305016702 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Yangon)]} { LoadTimeZoneFile Asia/Yangon } set TZData(:Indian/Cocos) $TZData(:Asia/Yangon) tcl9.0.3/library/tzdata/Indian/Christmas0000664000175000017500000000026015035744305017571 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Bangkok)]} { LoadTimeZoneFile Asia/Bangkok } set TZData(:Indian/Christmas) $TZData(:Asia/Bangkok) tcl9.0.3/library/tzdata/Indian/Chagos0000664000175000017500000000026115035744305017041 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Indian/Chagos) { {-9223372036854775808 17380 0 LMT} {-1988167780 18000 0 +0500} {820436400 21600 0 +0600} } tcl9.0.3/library/tzdata/Indian/Antananarivo0000664000175000017500000000027115035744305020257 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Indian/Antananarivo) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Iceland0000664000175000017500000000025515035744305015775 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Iceland) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/HST0000664000175000017500000000025715035744305015076 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Honolulu)]} { LoadTimeZoneFile Pacific/Honolulu } set TZData(:HST) $TZData(:Pacific/Honolulu) tcl9.0.3/library/tzdata/Hongkong0000664000175000017500000000025615035744305016211 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Hong_Kong)]} { LoadTimeZoneFile Asia/Hong_Kong } set TZData(:Hongkong) $TZData(:Asia/Hong_Kong) tcl9.0.3/library/tzdata/Greenwich0000664000175000017500000000023215035744305016344 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:Greenwich) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/GMT00000664000175000017500000000022515035744305015142 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:GMT0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/GMT-00000664000175000017500000000022615035744305015220 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:GMT-0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/GMT+00000664000175000017500000000022615035744305015216 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:GMT+0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/GMT0000664000175000017500000000022415035744305015061 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:GMT) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/GB-Eire0000664000175000017500000000025215035744305015605 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:GB-Eire) $TZData(:Europe/London) tcl9.0.3/library/tzdata/GB0000664000175000017500000000024515035744305014725 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:GB) $TZData(:Europe/London) tcl9.0.3/library/tzdata/Europe/0000755000175000017500000000000015104662345015746 5ustar sergeisergeitcl9.0.3/library/tzdata/Europe/Zurich0000664000175000017500000001561715035744305017151 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Zurich) { {-9223372036854775808 2048 0 LMT} {-3675198848 1786 0 BMT} {-2385246586 3600 0 CET} {-904435200 7200 1 CEST} {-891129600 3600 0 CET} {-872985600 7200 1 CEST} {-859680000 3600 0 CET} {347151600 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Zaporozhye0000664000175000017500000000025615035744305020050 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Kyiv)]} { LoadTimeZoneFile Europe/Kyiv } set TZData(:Europe/Zaporozhye) $TZData(:Europe/Kyiv) tcl9.0.3/library/tzdata/Europe/Zagreb0000664000175000017500000000026615035744305017111 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Belgrade)]} { LoadTimeZoneFile Europe/Belgrade } set TZData(:Europe/Zagreb) $TZData(:Europe/Belgrade) tcl9.0.3/library/tzdata/Europe/Warsaw0000664000175000017500000002025615035744305017144 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Warsaw) { {-9223372036854775808 5040 0 LMT} {-2840145840 5040 0 WMT} {-1717032240 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618696800 7200 0 EET} {-1600473600 10800 1 EEST} {-1587168000 7200 0 EET} {-931734000 7200 0 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796870800 7200 0 CEST} {-796608000 3600 0 CET} {-778726800 7200 1 CEST} {-762660000 3600 0 CET} {-748486800 7200 1 CEST} {-733273200 3600 0 CET} {-715215600 7200 1 CEST} {-701910000 3600 0 CET} {-684975600 7200 1 CEST} {-670460400 3600 0 CET} {-654130800 7200 1 CEST} {-639010800 3600 0 CET} {-397094400 7200 1 CEST} {-386812800 3600 0 CET} {-371088000 7200 1 CEST} {-355363200 3600 0 CET} {-334195200 7200 1 CEST} {-323308800 3600 0 CET} {-307584000 7200 1 CEST} {-291859200 3600 0 CET} {-271296000 7200 1 CEST} {-260409600 3600 0 CET} {-239846400 7200 1 CEST} {-228960000 3600 0 CET} {-208396800 7200 1 CEST} {-197510400 3600 0 CET} {-176342400 7200 1 CEST} {-166060800 3600 0 CET} {220921200 3600 0 CET} {228873600 7200 1 CEST} {243993600 3600 0 CET} {260323200 7200 1 CEST} {276048000 3600 0 CET} {291772800 7200 1 CEST} {307497600 3600 0 CET} {323827200 7200 1 CEST} {338947200 3600 0 CET} {354672000 7200 1 CEST} {370396800 3600 0 CET} {386121600 7200 1 CEST} {401846400 3600 0 CET} {417571200 7200 1 CEST} {433296000 3600 0 CET} {449020800 7200 1 CEST} {465350400 3600 0 CET} {481075200 7200 1 CEST} {496800000 3600 0 CET} {512524800 7200 1 CEST} {528249600 3600 0 CET} {543974400 7200 1 CEST} {559699200 3600 0 CET} {567990000 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Volgograd0000664000175000017500000000405015035744305017616 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Volgograd) { {-9223372036854775808 10660 0 LMT} {-1577761060 10800 0 +0300} {-1247540400 14400 0 +0400} {-256881600 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 10800 0 MSD} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {638319600 14400 1 MSD} {654649200 10800 0 MSK} {670374000 14400 0 +0400} {701820000 10800 0 MSD} {701823600 14400 1 MSD} {717548400 10800 0 MSK} {733273200 14400 1 MSD} {748998000 10800 0 MSK} {764722800 14400 1 MSD} {780447600 10800 0 MSK} {796172400 14400 1 MSD} {811897200 10800 0 MSK} {828226800 14400 1 MSD} {846370800 10800 0 MSK} {859676400 14400 1 MSD} {877820400 10800 0 MSK} {891126000 14400 1 MSD} {909270000 10800 0 MSK} {922575600 14400 1 MSD} {941324400 10800 0 MSK} {954025200 14400 1 MSD} {972774000 10800 0 MSK} {985474800 14400 1 MSD} {1004223600 10800 0 MSK} {1017529200 14400 1 MSD} {1035673200 10800 0 MSK} {1048978800 14400 1 MSD} {1067122800 10800 0 MSK} {1080428400 14400 1 MSD} {1099177200 10800 0 MSK} {1111878000 14400 1 MSD} {1130626800 10800 0 MSK} {1143327600 14400 1 MSD} {1162076400 10800 0 MSK} {1174777200 14400 1 MSD} {1193526000 10800 0 MSK} {1206831600 14400 1 MSD} {1224975600 10800 0 MSK} {1238281200 14400 1 MSD} {1256425200 10800 0 MSK} {1269730800 14400 1 MSD} {1288479600 10800 0 MSK} {1301180400 14400 0 MSK} {1414274400 10800 0 MSK} {1540681200 14400 0 +0400} {1609020000 10800 0 MSK} } tcl9.0.3/library/tzdata/Europe/Vilnius0000664000175000017500000001610115035744305017323 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Vilnius) { {-9223372036854775808 6076 0 LMT} {-2840146876 5040 0 WMT} {-1672536240 5736 0 KMT} {-1585100136 3600 0 CET} {-1561251600 7200 0 EET} {-1553565600 3600 0 CET} {-928198800 10800 0 MSK} {-900126000 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-802141200 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 7200 0 EEMMTT} {606873600 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {670377600 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {846374400 7200 0 EET} {859680000 10800 1 EEST} {877824000 7200 0 EET} {883605600 7200 0 EET} {891133200 7200 0 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 7200 0 EET} {1041372000 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Vienna0000664000175000017500000001675315035744305017127 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Vienna) { {-9223372036854775808 3921 0 LMT} {-2422055121 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-1577926800 3600 0 CET} {-1569711600 7200 1 CEST} {-1555801200 3600 0 CET} {-938905200 7200 0 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-781052400 7200 1 CEST} {-780188400 3600 0 CET} {-757386000 3600 0 CET} {-748479600 7200 1 CEST} {-733273200 3600 0 CET} {-717634800 7200 1 CEST} {-701910000 3600 0 CET} {-684975600 7200 1 CEST} {-670460400 3600 0 CET} {323823600 7200 1 CEST} {338940000 3600 0 CET} {347151600 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Vatican0000664000175000017500000000025315035744305017260 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Rome)]} { LoadTimeZoneFile Europe/Rome } set TZData(:Europe/Vatican) $TZData(:Europe/Rome) tcl9.0.3/library/tzdata/Europe/Vaduz0000664000175000017500000000025715035744305016770 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Zurich)]} { LoadTimeZoneFile Europe/Zurich } set TZData(:Europe/Vaduz) $TZData(:Europe/Zurich) tcl9.0.3/library/tzdata/Europe/Uzhgorod0000664000175000017500000000025415035744305017475 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Kyiv)]} { LoadTimeZoneFile Europe/Kyiv } set TZData(:Europe/Uzhgorod) $TZData(:Europe/Kyiv) tcl9.0.3/library/tzdata/Europe/Ulyanovsk0000664000175000017500000000420615035744305017670 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Ulyanovsk) { {-9223372036854775808 11616 0 LMT} {-1593820800 10800 0 +0300} {-1247540400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 10800 0 +0300} {606870000 14400 1 +0400} {622594800 10800 0 +0300} {638319600 14400 1 +0400} {654649200 10800 0 +0300} {670374000 7200 0 +0200} {670377600 10800 1 +0300} {686102400 7200 0 +0200} {695779200 10800 0 +0300} {701823600 14400 1 +0400} {717548400 10800 0 +0300} {733273200 14400 1 +0400} {748998000 10800 0 +0300} {764722800 14400 1 +0400} {780447600 10800 0 +0300} {796172400 14400 1 +0400} {811897200 10800 0 +0300} {828226800 14400 1 +0400} {846370800 10800 0 +0300} {859676400 14400 1 +0400} {877820400 10800 0 +0300} {891126000 14400 1 +0400} {909270000 10800 0 +0300} {922575600 14400 1 +0400} {941324400 10800 0 +0300} {954025200 14400 1 +0400} {972774000 10800 0 +0300} {985474800 14400 1 +0400} {1004223600 10800 0 +0300} {1017529200 14400 1 +0400} {1035673200 10800 0 +0300} {1048978800 14400 1 +0400} {1067122800 10800 0 +0300} {1080428400 14400 1 +0400} {1099177200 10800 0 +0300} {1111878000 14400 1 +0400} {1130626800 10800 0 +0300} {1143327600 14400 1 +0400} {1162076400 10800 0 +0300} {1174777200 14400 1 +0400} {1193526000 10800 0 +0300} {1206831600 14400 1 +0400} {1224975600 10800 0 +0300} {1238281200 14400 1 +0400} {1256425200 10800 0 +0300} {1269730800 14400 1 +0400} {1288479600 10800 0 +0300} {1301180400 14400 0 +0400} {1414274400 10800 0 +0300} {1459033200 14400 0 +0400} } tcl9.0.3/library/tzdata/Europe/Tiraspol0000664000175000017500000000027015035744305017467 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Chisinau)]} { LoadTimeZoneFile Europe/Chisinau } set TZData(:Europe/Tiraspol) $TZData(:Europe/Chisinau) tcl9.0.3/library/tzdata/Europe/Tirane0000664000175000017500000001636415035744305017127 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Tirane) { {-9223372036854775808 4760 0 LMT} {-1767230360 3600 0 CET} {-932346000 7200 0 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-843519600 3600 0 CET} {136854000 7200 1 CEST} {149896800 3600 0 CET} {168130800 7200 1 CEST} {181432800 3600 0 CET} {199839600 7200 1 CEST} {213141600 3600 0 CET} {231894000 7200 1 CEST} {244591200 3600 0 CET} {263257200 7200 1 CEST} {276040800 3600 0 CET} {294706800 7200 1 CEST} {307490400 3600 0 CET} {326156400 7200 1 CEST} {339458400 3600 0 CET} {357087600 7200 1 CEST} {370389600 3600 0 CET} {389142000 7200 1 CEST} {402444000 3600 0 CET} {419468400 7200 1 CEST} {433807200 3600 0 CET} {449622000 7200 1 CEST} {457480800 7200 0 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Tallinn0000664000175000017500000001617715035744305017310 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Tallinn) { {-9223372036854775808 5940 0 LMT} {-2840146740 5940 0 TMT} {-1638322740 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-1593824400 5940 0 TMT} {-1535938740 7200 0 EET} {-927943200 10800 0 MSK} {-892954800 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-797648400 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {670377600 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {846374400 7200 0 EET} {859680000 10800 1 EEST} {877824000 7200 0 EET} {891129600 10800 1 EEST} {906415200 10800 0 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941335200 7200 0 EET} {1014242400 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Stockholm0000664000175000017500000000026315035744305017637 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Berlin)]} { LoadTimeZoneFile Europe/Berlin } set TZData(:Europe/Stockholm) $TZData(:Europe/Berlin) tcl9.0.3/library/tzdata/Europe/Sofia0000664000175000017500000001634415035744305016744 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Sofia) { {-9223372036854775808 5596 0 LMT} {-2840146396 7016 0 IMT} {-2369527016 7200 0 EET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-788922000 3600 0 CET} {-781048800 7200 0 EET} {291762000 10800 0 EEST} {307576800 7200 0 EET} {323816400 10800 1 EEST} {339026400 7200 0 EET} {355266000 10800 1 EEST} {370393200 7200 0 EET} {386715600 10800 1 EEST} {401846400 7200 0 EET} {417571200 10800 1 EEST} {433296000 7200 0 EET} {449020800 10800 1 EEST} {465350400 7200 0 EET} {481075200 10800 1 EEST} {496800000 7200 0 EET} {512524800 10800 1 EEST} {528249600 7200 0 EET} {543974400 10800 1 EEST} {559699200 7200 0 EET} {575424000 10800 1 EEST} {591148800 7200 0 EET} {606873600 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {662680800 7200 0 EET} {670370400 10800 1 EEST} {686091600 7200 0 EET} {701820000 10800 1 EEST} {717541200 7200 0 EET} {733269600 10800 1 EEST} {748990800 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {846363600 7200 0 EET} {852069600 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Skopje0000664000175000017500000000026615035744305017132 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Belgrade)]} { LoadTimeZoneFile Europe/Belgrade } set TZData(:Europe/Skopje) $TZData(:Europe/Belgrade) tcl9.0.3/library/tzdata/Europe/Simferopol0000664000175000017500000000440315035744305020013 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Simferopol) { {-9223372036854775808 8184 0 LMT} {-2840148984 8160 0 SMT} {-1441160160 7200 0 EET} {-1247536800 10800 0 MSK} {-888894000 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-811645200 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {631141200 10800 0 MSK} {646786800 7200 0 EET} {701042400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {767743200 14400 0 MSD} {780447600 10800 0 MSK} {796172400 14400 1 MSD} {811897200 10800 0 MSK} {828219600 14400 1 MSD} {846374400 10800 0 MSK} {859683600 10800 0 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396137600 14400 0 MSK} {1414274400 10800 0 MSK} } tcl9.0.3/library/tzdata/Europe/Saratov0000664000175000017500000000411215035744305017310 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Saratov) { {-9223372036854775808 11058 0 LMT} {-1593820800 10800 0 +0300} {-1247540400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 10800 0 +0300} {575420400 14400 1 +0400} {591145200 10800 0 +0300} {606870000 14400 1 +0400} {622594800 10800 0 +0300} {638319600 14400 1 +0400} {654649200 10800 0 +0300} {670374000 14400 0 +0400} {701820000 10800 0 +0300} {701823600 14400 1 +0400} {717548400 10800 0 +0300} {733273200 14400 1 +0400} {748998000 10800 0 +0300} {764722800 14400 1 +0400} {780447600 10800 0 +0300} {796172400 14400 1 +0400} {811897200 10800 0 +0300} {828226800 14400 1 +0400} {846370800 10800 0 +0300} {859676400 14400 1 +0400} {877820400 10800 0 +0300} {891126000 14400 1 +0400} {909270000 10800 0 +0300} {922575600 14400 1 +0400} {941324400 10800 0 +0300} {954025200 14400 1 +0400} {972774000 10800 0 +0300} {985474800 14400 1 +0400} {1004223600 10800 0 +0300} {1017529200 14400 1 +0400} {1035673200 10800 0 +0300} {1048978800 14400 1 +0400} {1067122800 10800 0 +0300} {1080428400 14400 1 +0400} {1099177200 10800 0 +0300} {1111878000 14400 1 +0400} {1130626800 10800 0 +0300} {1143327600 14400 1 +0400} {1162076400 10800 0 +0300} {1174777200 14400 1 +0400} {1193526000 10800 0 +0300} {1206831600 14400 1 +0400} {1224975600 10800 0 +0300} {1238281200 14400 1 +0400} {1256425200 10800 0 +0300} {1269730800 14400 1 +0400} {1288479600 10800 0 +0300} {1301180400 14400 0 +0400} {1414274400 10800 0 +0300} {1480806000 14400 0 +0400} } tcl9.0.3/library/tzdata/Europe/Sarajevo0000664000175000017500000000027015035744305017444 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Belgrade)]} { LoadTimeZoneFile Europe/Belgrade } set TZData(:Europe/Sarajevo) $TZData(:Europe/Belgrade) tcl9.0.3/library/tzdata/Europe/San_Marino0000664000175000017500000000025615035744305017724 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Rome)]} { LoadTimeZoneFile Europe/Rome } set TZData(:Europe/San_Marino) $TZData(:Europe/Rome) tcl9.0.3/library/tzdata/Europe/Samara0000664000175000017500000000420515035744305017100 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Samara) { {-9223372036854775808 12020 0 LMT} {-1593820800 10800 0 +0300} {-1247540400 14400 0 +0400} {-1102305600 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 10800 0 +0300} {606870000 14400 1 +0400} {622594800 10800 0 +0300} {638319600 14400 1 +0400} {654649200 10800 0 +0300} {670374000 7200 0 +0200} {670377600 10800 1 +0300} {686102400 10800 0 +0300} {687916800 14400 0 +0400} {701820000 18000 1 +0500} {717544800 14400 0 +0400} {733269600 18000 1 +0500} {748994400 14400 0 +0400} {764719200 18000 1 +0500} {780444000 14400 0 +0400} {796168800 18000 1 +0500} {811893600 14400 0 +0400} {828223200 18000 1 +0500} {846367200 14400 0 +0400} {859672800 18000 1 +0500} {877816800 14400 0 +0400} {891122400 18000 1 +0500} {909266400 14400 0 +0400} {922572000 18000 1 +0500} {941320800 14400 0 +0400} {954021600 18000 1 +0500} {972770400 14400 0 +0400} {985471200 18000 1 +0500} {1004220000 14400 0 +0400} {1017525600 18000 1 +0500} {1035669600 14400 0 +0400} {1048975200 18000 1 +0500} {1067119200 14400 0 +0400} {1080424800 18000 1 +0500} {1099173600 14400 0 +0400} {1111874400 18000 1 +0500} {1130623200 14400 0 +0400} {1143324000 18000 1 +0500} {1162072800 14400 0 +0400} {1174773600 18000 1 +0500} {1193522400 14400 0 +0400} {1206828000 18000 1 +0500} {1224972000 14400 0 +0400} {1238277600 18000 1 +0500} {1256421600 14400 0 +0400} {1269727200 10800 0 +0300} {1269730800 14400 1 +0400} {1288479600 10800 0 +0300} {1301180400 14400 0 +0400} } tcl9.0.3/library/tzdata/Europe/Rome0000664000175000017500000002047715035744305016607 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Rome) { {-9223372036854775808 2996 0 LMT} {-3252098996 2996 0 RMT} {-2403565200 3600 0 CET} {-1690765200 7200 1 CEST} {-1680487200 3600 0 CET} {-1664758800 7200 1 CEST} {-1648951200 3600 0 CET} {-1635123600 7200 1 CEST} {-1616896800 3600 0 CET} {-1604278800 7200 1 CEST} {-1585533600 3600 0 CET} {-1571014800 7200 1 CEST} {-1555293600 3600 0 CET} {-932432400 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-830307600 7200 0 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-807152400 7200 0 CEST} {-798073200 3600 0 CET} {-781052400 7200 1 CEST} {-766717200 3600 0 CET} {-750898800 7200 1 CEST} {-733359600 3600 0 CET} {-719456400 7200 1 CEST} {-701917200 3600 0 CET} {-689209200 7200 1 CEST} {-670460400 3600 0 CET} {-114051600 7200 1 CEST} {-103168800 3600 0 CET} {-81997200 7200 1 CEST} {-71715600 3600 0 CET} {-50547600 7200 1 CEST} {-40266000 3600 0 CET} {-18493200 7200 1 CEST} {-8211600 3600 0 CET} {12956400 7200 1 CEST} {23238000 3600 0 CET} {43801200 7200 1 CEST} {54687600 3600 0 CET} {75855600 7200 1 CEST} {86742000 3600 0 CET} {107910000 7200 1 CEST} {118191600 3600 0 CET} {138754800 7200 1 CEST} {149641200 3600 0 CET} {170809200 7200 1 CEST} {181090800 3600 0 CET} {202258800 7200 1 CEST} {212540400 3600 0 CET} {233103600 7200 1 CEST} {243990000 3600 0 CET} {265158000 7200 1 CEST} {276044400 3600 0 CET} {296607600 7200 1 CEST} {307494000 3600 0 CET} {315529200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Riga0000664000175000017500000001635015035744305016562 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Riga) { {-9223372036854775808 5794 0 LMT} {-2840146594 5794 0 RMT} {-1632008194 9394 1 LST} {-1618702594 5794 0 RMT} {-1601681794 9394 1 LST} {-1597275394 5794 0 RMT} {-1377308194 7200 0 EET} {-928029600 10800 0 MSK} {-899521200 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-795834000 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {670377600 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {843955200 7200 0 EET} {853797600 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {951775200 7200 0 EET} {978386400 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Prague0000664000175000017500000001712315035744305017122 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Prague) { {-9223372036854775808 3464 0 LMT} {-3786829064 3464 0 PMT} {-2469401864 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-938905200 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-781052400 7200 1 CEST} {-777862800 7200 0 CEST} {-765327600 3600 0 CET} {-746578800 7200 1 CEST} {-733359600 3600 0 CET} {-728517600 0 1 GMT} {-721260000 0 0 CET} {-716425200 7200 1 CEST} {-701910000 3600 0 CET} {-684975600 7200 1 CEST} {-670460400 3600 0 CET} {-654217200 7200 1 CEST} {-639010800 3600 0 CET} {283993200 3600 0 CET} {291776400 7200 1 CEST} {307501200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Podgorica0000664000175000017500000000027115035744305017602 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Belgrade)]} { LoadTimeZoneFile Europe/Belgrade } set TZData(:Europe/Podgorica) $TZData(:Europe/Belgrade) tcl9.0.3/library/tzdata/Europe/Paris0000664000175000017500000002120615035744305016752 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Paris) { {-9223372036854775808 561 0 LMT} {-2486592561 561 0 PMT} {-1855958961 0 0 WET} {-1689814800 3600 1 WEST} {-1680397200 0 0 WET} {-1665363600 3600 1 WEST} {-1648342800 0 0 WET} {-1635123600 3600 1 WEST} {-1616893200 0 0 WET} {-1604278800 3600 1 WEST} {-1585443600 0 0 WET} {-1574038800 3600 1 WEST} {-1552266000 0 0 WET} {-1539997200 3600 1 WEST} {-1520557200 0 0 WET} {-1507510800 3600 1 WEST} {-1490576400 0 0 WET} {-1470618000 3600 1 WEST} {-1459126800 0 0 WET} {-1444006800 3600 1 WEST} {-1427677200 0 0 WET} {-1411952400 3600 1 WEST} {-1396227600 0 0 WET} {-1379293200 3600 1 WEST} {-1364778000 0 0 WET} {-1348448400 3600 1 WEST} {-1333328400 0 0 WET} {-1316394000 3600 1 WEST} {-1301274000 0 0 WET} {-1284339600 3600 1 WEST} {-1269824400 0 0 WET} {-1253494800 3600 1 WEST} {-1238374800 0 0 WET} {-1221440400 3600 1 WEST} {-1206925200 0 0 WET} {-1191200400 3600 1 WEST} {-1175475600 0 0 WET} {-1160355600 3600 1 WEST} {-1143421200 0 0 WET} {-1127696400 3600 1 WEST} {-1111971600 0 0 WET} {-1096851600 3600 1 WEST} {-1080522000 0 0 WET} {-1063587600 3600 1 WEST} {-1049072400 0 0 WET} {-1033347600 3600 1 WEST} {-1017622800 0 0 WET} {-1002502800 3600 1 WEST} {-986173200 0 0 WET} {-969238800 3600 1 WEST} {-950490000 0 0 WET} {-942012000 3600 1 WEST} {-932436000 7200 0 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-800067600 7200 0 WEMT} {-796266000 3600 1 WEST} {-781052400 7200 1 WEMT} {-766616400 3600 0 CET} {196819200 7200 1 CEST} {212540400 3600 0 CET} {220921200 3600 0 CET} {228877200 7200 1 CEST} {243997200 3600 0 CET} {260326800 7200 1 CEST} {276051600 3600 0 CET} {291776400 7200 1 CEST} {307501200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Oslo0000664000175000017500000000025615035744305016612 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Berlin)]} { LoadTimeZoneFile Europe/Berlin } set TZData(:Europe/Oslo) $TZData(:Europe/Berlin) tcl9.0.3/library/tzdata/Europe/Nicosia0000664000175000017500000000025615035744305017263 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Nicosia)]} { LoadTimeZoneFile Asia/Nicosia } set TZData(:Europe/Nicosia) $TZData(:Asia/Nicosia) tcl9.0.3/library/tzdata/Europe/Moscow0000664000175000017500000000445315035744305017150 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Moscow) { {-9223372036854775808 9017 0 LMT} {-2840149817 9017 0 MMT} {-1688265017 9079 0 MMT} {-1656819079 12679 1 MST} {-1641353479 9079 0 MMT} {-1627965079 16279 1 MDST} {-1618716679 12679 1 MST} {-1596429079 16279 1 MDST} {-1593820800 14400 0 MSD} {-1589860800 10800 0 MSK} {-1542427200 14400 1 MSD} {-1539493200 18000 1 +05} {-1525323600 14400 1 MSD} {-1491188400 7200 0 EET} {-1247536800 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {638319600 14400 1 MSD} {654649200 10800 0 MSK} {670374000 7200 0 EEMMTT} {670377600 10800 1 EEST} {686102400 7200 0 EET} {695779200 10800 0 MSD} {701823600 14400 1 MSD} {717548400 10800 0 MSK} {733273200 14400 1 MSD} {748998000 10800 0 MSK} {764722800 14400 1 MSD} {780447600 10800 0 MSK} {796172400 14400 1 MSD} {811897200 10800 0 MSK} {828226800 14400 1 MSD} {846370800 10800 0 MSK} {859676400 14400 1 MSD} {877820400 10800 0 MSK} {891126000 14400 1 MSD} {909270000 10800 0 MSK} {922575600 14400 1 MSD} {941324400 10800 0 MSK} {954025200 14400 1 MSD} {972774000 10800 0 MSK} {985474800 14400 1 MSD} {1004223600 10800 0 MSK} {1017529200 14400 1 MSD} {1035673200 10800 0 MSK} {1048978800 14400 1 MSD} {1067122800 10800 0 MSK} {1080428400 14400 1 MSD} {1099177200 10800 0 MSK} {1111878000 14400 1 MSD} {1130626800 10800 0 MSK} {1143327600 14400 1 MSD} {1162076400 10800 0 MSK} {1174777200 14400 1 MSD} {1193526000 10800 0 MSK} {1206831600 14400 1 MSD} {1224975600 10800 0 MSK} {1238281200 14400 1 MSD} {1256425200 10800 0 MSK} {1269730800 14400 1 MSD} {1288479600 10800 0 MSK} {1301180400 14400 0 MSK} {1414274400 10800 0 MSK} } tcl9.0.3/library/tzdata/Europe/Monaco0000664000175000017500000000025515035744305017111 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Paris)]} { LoadTimeZoneFile Europe/Paris } set TZData(:Europe/Monaco) $TZData(:Europe/Paris) tcl9.0.3/library/tzdata/Europe/Minsk0000664000175000017500000000407015035744305016755 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Minsk) { {-9223372036854775808 6616 0 LMT} {-2840147416 6600 0 MMT} {-1441158600 7200 0 EET} {-1247536800 10800 0 MSK} {-899780400 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-804646800 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {631141200 10800 0 MSK} {670374000 7200 0 EEMMTT} {670377600 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {846374400 7200 0 EET} {859680000 10800 1 EEST} {877824000 7200 0 EET} {891129600 10800 1 EEST} {909273600 7200 0 EET} {922579200 10800 1 EEST} {941328000 7200 0 EET} {954028800 10800 1 EEST} {972777600 7200 0 EET} {985478400 10800 1 EEST} {1004227200 7200 0 EET} {1017532800 10800 1 EEST} {1035676800 7200 0 EET} {1048982400 10800 1 EEST} {1067126400 7200 0 EET} {1080432000 10800 1 EEST} {1099180800 7200 0 EET} {1111881600 10800 1 EEST} {1130630400 7200 0 EET} {1143331200 10800 1 EEST} {1162080000 7200 0 EET} {1174780800 10800 1 EEST} {1193529600 7200 0 EET} {1206835200 10800 1 EEST} {1224979200 7200 0 EET} {1238284800 10800 1 EEST} {1256428800 7200 0 EET} {1269734400 10800 1 EEST} {1288483200 7200 0 EET} {1301184000 10800 0 +0300} } tcl9.0.3/library/tzdata/Europe/Mariehamn0000664000175000017500000000027115035744305017574 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Helsinki)]} { LoadTimeZoneFile Europe/Helsinki } set TZData(:Europe/Mariehamn) $TZData(:Europe/Helsinki) tcl9.0.3/library/tzdata/Europe/Malta0000664000175000017500000002035115035744305016732 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Malta) { {-9223372036854775808 3484 0 LMT} {-2403478684 3600 0 CET} {-1690765200 7200 1 CEST} {-1680487200 3600 0 CET} {-1664758800 7200 1 CEST} {-1648951200 3600 0 CET} {-1635123600 7200 1 CEST} {-1616896800 3600 0 CET} {-1604278800 7200 1 CEST} {-1585533600 3600 0 CET} {-1571014800 7200 1 CEST} {-1555293600 3600 0 CET} {-932432400 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812588400 7200 1 CEST} {-798073200 3600 0 CET} {-781052400 7200 1 CEST} {-766717200 3600 0 CET} {-750898800 7200 1 CEST} {-733359600 3600 0 CET} {-719456400 7200 1 CEST} {-701917200 3600 0 CET} {-689209200 7200 1 CEST} {-670460400 3600 0 CET} {-114051600 7200 1 CEST} {-103168800 3600 0 CET} {-81997200 7200 1 CEST} {-71715600 3600 0 CET} {-50547600 7200 1 CEST} {-40266000 3600 0 CET} {-18493200 7200 1 CEST} {-8211600 3600 0 CET} {12956400 7200 1 CEST} {23238000 3600 0 CET} {43801200 7200 1 CEST} {54687600 3600 0 CET} {75855600 7200 1 CEST} {86742000 3600 0 CET} {102380400 7200 0 CEST} {118105200 3600 0 CET} {135730800 7200 1 CEST} {148518000 3600 0 CET} {167187600 7200 1 CEST} {180489600 3600 0 CET} {198637200 7200 1 CEST} {211939200 3600 0 CET} {230086800 7200 1 CEST} {243388800 3600 0 CET} {261536400 7200 1 CEST} {274838400 3600 0 CET} {292986000 7200 1 CEST} {306288000 3600 0 CET} {323312400 7200 1 CEST} {338342400 3600 0 CET} {347151600 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Madrid0000664000175000017500000002004115035744305017070 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Madrid) { {-9223372036854775808 -884 0 LMT} {-2177452800 0 0 WET} {-1631926800 3600 1 WEST} {-1616889600 0 0 WET} {-1601168400 3600 1 WEST} {-1585353600 0 0 WET} {-1442451600 3600 1 WEST} {-1427673600 0 0 WET} {-1379293200 3600 1 WEST} {-1364774400 0 0 WET} {-1348448400 3600 1 WEST} {-1333324800 0 0 WET} {-1316390400 3600 1 WEST} {-1301270400 0 0 WET} {-1284339600 3600 1 WEST} {-1269820800 0 0 WET} {-1026954000 3600 1 WEST} {-1017619200 0 0 WET} {-1001898000 3600 1 WEST} {-999482400 7200 1 WEMT} {-986090400 3600 1 WEST} {-954115200 0 0 WET} {-940208400 3600 0 CET} {-873079200 7200 1 CEST} {-862621200 3600 0 CET} {-842839200 7200 1 CEST} {-828320400 3600 0 CET} {-811389600 7200 1 CEST} {-796870800 3600 0 CET} {-779940000 7200 1 CEST} {-765421200 3600 0 CET} {-748490400 7200 1 CEST} {-733971600 3600 0 CET} {-652327200 7200 1 CEST} {-639018000 3600 0 CET} {135122400 7200 1 CEST} {150246000 3600 0 CET} {166572000 7200 1 CEST} {181695600 3600 0 CET} {196812000 7200 1 CEST} {212540400 3600 0 CET} {228866400 7200 1 CEST} {243990000 3600 0 CET} {260326800 7200 1 CEST} {276051600 3600 0 CET} {283993200 3600 0 CET} {291776400 7200 1 CEST} {307501200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Luxembourg0000664000175000017500000000027215035744305020025 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Brussels)]} { LoadTimeZoneFile Europe/Brussels } set TZData(:Europe/Luxembourg) $TZData(:Europe/Brussels) tcl9.0.3/library/tzdata/Europe/London0000664000175000017500000002315715035744305017134 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/London) { {-9223372036854775808 -75 0 LMT} {-3852662325 0 0 GMT} {-1691964000 3600 1 BST} {-1680472800 0 0 GMT} {-1664143200 3600 1 BST} {-1650146400 0 0 GMT} {-1633903200 3600 1 BST} {-1617487200 0 0 GMT} {-1601848800 3600 1 BST} {-1586037600 0 0 GMT} {-1570399200 3600 1 BST} {-1552168800 0 0 GMT} {-1538344800 3600 1 BST} {-1522533600 0 0 GMT} {-1507500000 3600 1 BST} {-1490565600 0 0 GMT} {-1473631200 3600 1 BST} {-1460930400 0 0 GMT} {-1442786400 3600 1 BST} {-1428876000 0 0 GMT} {-1410732000 3600 1 BST} {-1396216800 0 0 GMT} {-1379282400 3600 1 BST} {-1364767200 0 0 GMT} {-1348437600 3600 1 BST} {-1333317600 0 0 GMT} {-1315778400 3600 1 BST} {-1301263200 0 0 GMT} {-1284328800 3600 1 BST} {-1269813600 0 0 GMT} {-1253484000 3600 1 BST} {-1238364000 0 0 GMT} {-1221429600 3600 1 BST} {-1206914400 0 0 GMT} {-1189980000 3600 1 BST} {-1175464800 0 0 GMT} {-1159135200 3600 1 BST} {-1143410400 0 0 GMT} {-1126476000 3600 1 BST} {-1111960800 0 0 GMT} {-1095631200 3600 1 BST} {-1080511200 0 0 GMT} {-1063576800 3600 1 BST} {-1049061600 0 0 GMT} {-1032127200 3600 1 BST} {-1017612000 0 0 GMT} {-1001282400 3600 1 BST} {-986162400 0 0 GMT} {-969228000 3600 1 BST} {-950479200 0 0 GMT} {-942012000 3600 1 BST} {-904518000 7200 1 BDST} {-896050800 3600 1 BST} {-875487600 7200 1 BDST} {-864601200 3600 1 BST} {-844038000 7200 1 BDST} {-832546800 3600 1 BST} {-812588400 7200 1 BDST} {-798073200 3600 1 BST} {-781052400 7200 1 BDST} {-772066800 3600 1 BST} {-764805600 0 0 GMT} {-748476000 3600 1 BST} {-733356000 0 0 GMT} {-719445600 3600 1 BST} {-717030000 7200 1 BDST} {-706748400 3600 1 BST} {-699487200 0 0 GMT} {-687996000 3600 1 BST} {-668037600 0 0 GMT} {-654732000 3600 1 BST} {-636588000 0 0 GMT} {-622072800 3600 1 BST} {-605743200 0 0 GMT} {-590623200 3600 1 BST} {-574293600 0 0 GMT} {-558568800 3600 1 BST} {-542239200 0 0 GMT} {-527119200 3600 1 BST} {-512604000 0 0 GMT} {-496274400 3600 1 BST} {-481154400 0 0 GMT} {-464220000 3600 1 BST} {-449704800 0 0 GMT} {-432165600 3600 1 BST} {-417650400 0 0 GMT} {-401320800 3600 1 BST} {-386200800 0 0 GMT} {-369266400 3600 1 BST} {-354751200 0 0 GMT} {-337816800 3600 1 BST} {-323301600 0 0 GMT} {-306972000 3600 1 BST} {-291852000 0 0 GMT} {-276732000 3600 1 BST} {-257983200 0 0 GMT} {-245282400 3600 1 BST} {-226533600 0 0 GMT} {-213228000 3600 1 BST} {-195084000 0 0 GMT} {-182383200 3600 1 BST} {-163634400 0 0 GMT} {-150933600 3600 1 BST} {-132184800 0 0 GMT} {-119484000 3600 1 BST} {-100735200 0 0 GMT} {-88034400 3600 1 BST} {-68680800 0 0 GMT} {-59004000 3600 1 BST} {-37238400 3600 0 BST} {57722400 0 0 GMT} {69818400 3600 1 BST} {89172000 0 0 GMT} {101268000 3600 1 BST} {120621600 0 0 GMT} {132717600 3600 1 BST} {152071200 0 0 GMT} {164167200 3600 1 BST} {183520800 0 0 GMT} {196221600 3600 1 BST} {214970400 0 0 GMT} {227671200 3600 1 BST} {246420000 0 0 GMT} {259120800 3600 1 BST} {278474400 0 0 GMT} {290570400 3600 1 BST} {309924000 0 0 GMT} {322020000 3600 1 BST} {341373600 0 0 GMT} {354675600 3600 1 BST} {372819600 0 0 GMT} {386125200 3600 1 BST} {404269200 0 0 GMT} {417574800 3600 1 BST} {435718800 0 0 GMT} {449024400 3600 1 BST} {467773200 0 0 GMT} {481078800 3600 1 BST} {499222800 0 0 GMT} {512528400 3600 1 BST} {530672400 0 0 GMT} {543978000 3600 1 BST} {562122000 0 0 GMT} {575427600 3600 1 BST} {593571600 0 0 GMT} {606877200 3600 1 BST} {625626000 0 0 GMT} {638326800 3600 1 BST} {657075600 0 0 GMT} {670381200 3600 1 BST} {688525200 0 0 GMT} {701830800 3600 1 BST} {719974800 0 0 GMT} {733280400 3600 1 BST} {751424400 0 0 GMT} {764730000 3600 1 BST} {782874000 0 0 GMT} {796179600 3600 1 BST} {814323600 0 0 GMT} {820454400 0 0 GMT} {828234000 3600 1 BST} {846378000 0 0 GMT} {859683600 3600 1 BST} {877827600 0 0 GMT} {891133200 3600 1 BST} {909277200 0 0 GMT} {922582800 3600 1 BST} {941331600 0 0 GMT} {954032400 3600 1 BST} {972781200 0 0 GMT} {985482000 3600 1 BST} {1004230800 0 0 GMT} {1017536400 3600 1 BST} {1035680400 0 0 GMT} {1048986000 3600 1 BST} {1067130000 0 0 GMT} {1080435600 3600 1 BST} {1099184400 0 0 GMT} {1111885200 3600 1 BST} {1130634000 0 0 GMT} {1143334800 3600 1 BST} {1162083600 0 0 GMT} {1174784400 3600 1 BST} {1193533200 0 0 GMT} {1206838800 3600 1 BST} {1224982800 0 0 GMT} {1238288400 3600 1 BST} {1256432400 0 0 GMT} {1269738000 3600 1 BST} {1288486800 0 0 GMT} {1301187600 3600 1 BST} {1319936400 0 0 GMT} {1332637200 3600 1 BST} {1351386000 0 0 GMT} {1364691600 3600 1 BST} {1382835600 0 0 GMT} {1396141200 3600 1 BST} {1414285200 0 0 GMT} {1427590800 3600 1 BST} {1445734800 0 0 GMT} {1459040400 3600 1 BST} {1477789200 0 0 GMT} {1490490000 3600 1 BST} {1509238800 0 0 GMT} {1521939600 3600 1 BST} {1540688400 0 0 GMT} {1553994000 3600 1 BST} {1572138000 0 0 GMT} {1585443600 3600 1 BST} {1603587600 0 0 GMT} {1616893200 3600 1 BST} {1635642000 0 0 GMT} {1648342800 3600 1 BST} {1667091600 0 0 GMT} {1679792400 3600 1 BST} {1698541200 0 0 GMT} {1711846800 3600 1 BST} {1729990800 0 0 GMT} {1743296400 3600 1 BST} {1761440400 0 0 GMT} {1774746000 3600 1 BST} {1792890000 0 0 GMT} {1806195600 3600 1 BST} {1824944400 0 0 GMT} {1837645200 3600 1 BST} {1856394000 0 0 GMT} {1869094800 3600 1 BST} {1887843600 0 0 GMT} {1901149200 3600 1 BST} {1919293200 0 0 GMT} {1932598800 3600 1 BST} {1950742800 0 0 GMT} {1964048400 3600 1 BST} {1982797200 0 0 GMT} {1995498000 3600 1 BST} {2014246800 0 0 GMT} {2026947600 3600 1 BST} {2045696400 0 0 GMT} {2058397200 3600 1 BST} {2077146000 0 0 GMT} {2090451600 3600 1 BST} {2108595600 0 0 GMT} {2121901200 3600 1 BST} {2140045200 0 0 GMT} {2153350800 3600 1 BST} {2172099600 0 0 GMT} {2184800400 3600 1 BST} {2203549200 0 0 GMT} {2216250000 3600 1 BST} {2234998800 0 0 GMT} {2248304400 3600 1 BST} {2266448400 0 0 GMT} {2279754000 3600 1 BST} {2297898000 0 0 GMT} {2311203600 3600 1 BST} {2329347600 0 0 GMT} {2342653200 3600 1 BST} {2361402000 0 0 GMT} {2374102800 3600 1 BST} {2392851600 0 0 GMT} {2405552400 3600 1 BST} {2424301200 0 0 GMT} {2437606800 3600 1 BST} {2455750800 0 0 GMT} {2469056400 3600 1 BST} {2487200400 0 0 GMT} {2500506000 3600 1 BST} {2519254800 0 0 GMT} {2531955600 3600 1 BST} {2550704400 0 0 GMT} {2563405200 3600 1 BST} {2582154000 0 0 GMT} {2595459600 3600 1 BST} {2613603600 0 0 GMT} {2626909200 3600 1 BST} {2645053200 0 0 GMT} {2658358800 3600 1 BST} {2676502800 0 0 GMT} {2689808400 3600 1 BST} {2708557200 0 0 GMT} {2721258000 3600 1 BST} {2740006800 0 0 GMT} {2752707600 3600 1 BST} {2771456400 0 0 GMT} {2784762000 3600 1 BST} {2802906000 0 0 GMT} {2816211600 3600 1 BST} {2834355600 0 0 GMT} {2847661200 3600 1 BST} {2866410000 0 0 GMT} {2879110800 3600 1 BST} {2897859600 0 0 GMT} {2910560400 3600 1 BST} {2929309200 0 0 GMT} {2942010000 3600 1 BST} {2960758800 0 0 GMT} {2974064400 3600 1 BST} {2992208400 0 0 GMT} {3005514000 3600 1 BST} {3023658000 0 0 GMT} {3036963600 3600 1 BST} {3055712400 0 0 GMT} {3068413200 3600 1 BST} {3087162000 0 0 GMT} {3099862800 3600 1 BST} {3118611600 0 0 GMT} {3131917200 3600 1 BST} {3150061200 0 0 GMT} {3163366800 3600 1 BST} {3181510800 0 0 GMT} {3194816400 3600 1 BST} {3212960400 0 0 GMT} {3226266000 3600 1 BST} {3245014800 0 0 GMT} {3257715600 3600 1 BST} {3276464400 0 0 GMT} {3289165200 3600 1 BST} {3307914000 0 0 GMT} {3321219600 3600 1 BST} {3339363600 0 0 GMT} {3352669200 3600 1 BST} {3370813200 0 0 GMT} {3384118800 3600 1 BST} {3402867600 0 0 GMT} {3415568400 3600 1 BST} {3434317200 0 0 GMT} {3447018000 3600 1 BST} {3465766800 0 0 GMT} {3479072400 3600 1 BST} {3497216400 0 0 GMT} {3510522000 3600 1 BST} {3528666000 0 0 GMT} {3541971600 3600 1 BST} {3560115600 0 0 GMT} {3573421200 3600 1 BST} {3592170000 0 0 GMT} {3604870800 3600 1 BST} {3623619600 0 0 GMT} {3636320400 3600 1 BST} {3655069200 0 0 GMT} {3668374800 3600 1 BST} {3686518800 0 0 GMT} {3699824400 3600 1 BST} {3717968400 0 0 GMT} {3731274000 3600 1 BST} {3750022800 0 0 GMT} {3762723600 3600 1 BST} {3781472400 0 0 GMT} {3794173200 3600 1 BST} {3812922000 0 0 GMT} {3825622800 3600 1 BST} {3844371600 0 0 GMT} {3857677200 3600 1 BST} {3875821200 0 0 GMT} {3889126800 3600 1 BST} {3907270800 0 0 GMT} {3920576400 3600 1 BST} {3939325200 0 0 GMT} {3952026000 3600 1 BST} {3970774800 0 0 GMT} {3983475600 3600 1 BST} {4002224400 0 0 GMT} {4015530000 3600 1 BST} {4033674000 0 0 GMT} {4046979600 3600 1 BST} {4065123600 0 0 GMT} {4078429200 3600 1 BST} {4096573200 0 0 GMT} } tcl9.0.3/library/tzdata/Europe/Ljubljana0000664000175000017500000000027115035744305017575 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Belgrade)]} { LoadTimeZoneFile Europe/Belgrade } set TZData(:Europe/Ljubljana) $TZData(:Europe/Belgrade) tcl9.0.3/library/tzdata/Europe/Lisbon0000664000175000017500000002260215035744305017123 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Lisbon) { {-9223372036854775808 -2205 0 LMT} {-2713908195 -2205 0 LMT} {-1830384000 0 0 WET} {-1689555600 3600 1 WEST} {-1677801600 0 0 WET} {-1667433600 3600 1 WEST} {-1647738000 0 0 WET} {-1635897600 3600 1 WEST} {-1616202000 0 0 WET} {-1604361600 3600 1 WEST} {-1584666000 0 0 WET} {-1572739200 3600 1 WEST} {-1553043600 0 0 WET} {-1541203200 3600 1 WEST} {-1521507600 0 0 WET} {-1442451600 3600 1 WEST} {-1427677200 0 0 WET} {-1379293200 3600 1 WEST} {-1364778000 0 0 WET} {-1348448400 3600 1 WEST} {-1333328400 0 0 WET} {-1316394000 3600 1 WEST} {-1301274000 0 0 WET} {-1284339600 3600 1 WEST} {-1269824400 0 0 WET} {-1221440400 3600 1 WEST} {-1206925200 0 0 WET} {-1191200400 3600 1 WEST} {-1175475600 0 0 WET} {-1127696400 3600 1 WEST} {-1111971600 0 0 WET} {-1096851600 3600 1 WEST} {-1080522000 0 0 WET} {-1063587600 3600 1 WEST} {-1049072400 0 0 WET} {-1033347600 3600 1 WEST} {-1017622800 0 0 WET} {-1002502800 3600 1 WEST} {-986173200 0 0 WET} {-969238800 3600 1 WEST} {-950490000 0 0 WET} {-942022800 3600 1 WEST} {-922496400 0 0 WET} {-906944400 3600 1 WEST} {-891133200 0 0 WET} {-877309200 3600 1 WEST} {-873684000 7200 1 WEMT} {-864007200 3600 1 WEST} {-857955600 0 0 WET} {-845859600 3600 1 WEST} {-842839200 7200 1 WEMT} {-831348000 3600 1 WEST} {-825901200 0 0 WET} {-814410000 3600 1 WEST} {-810784800 7200 1 WEMT} {-799898400 3600 1 WEST} {-794451600 0 0 WET} {-782960400 3600 1 WEST} {-779335200 7200 1 WEMT} {-768448800 3600 1 WEST} {-763002000 0 0 WET} {-749091600 3600 1 WEST} {-733366800 0 0 WET} {-717631200 3600 1 WEST} {-701906400 0 0 WET} {-686181600 3600 1 WEST} {-670456800 0 0 WET} {-654732000 3600 1 WEST} {-639007200 0 0 WET} {-623282400 3600 1 WEST} {-607557600 0 0 WET} {-591832800 3600 1 WEST} {-575503200 0 0 WET} {-559778400 3600 1 WEST} {-544053600 0 0 WET} {-528328800 3600 1 WEST} {-512604000 0 0 WET} {-496879200 3600 1 WEST} {-481154400 0 0 WET} {-465429600 3600 1 WEST} {-449704800 0 0 WET} {-433980000 3600 1 WEST} {-417650400 0 0 WET} {-401925600 3600 1 WEST} {-386200800 0 0 WET} {-370476000 3600 1 WEST} {-354751200 0 0 WET} {-339026400 3600 1 WEST} {-323301600 0 0 WET} {-307576800 3600 1 WEST} {-291852000 0 0 WET} {-276127200 3600 1 WEST} {-260402400 0 0 WET} {-244677600 3600 1 WEST} {-228348000 0 0 WET} {-212623200 3600 1 WEST} {-196898400 0 0 WET} {-181173600 3600 1 WEST} {-165448800 0 0 WET} {-149724000 3600 1 WEST} {-133999200 0 0 WET} {-118274400 3600 1 WEST} {-102549600 3600 0 CET} {212544000 0 0 WET} {212547600 0 0 WET} {228268800 3600 1 WEST} {243993600 0 0 WET} {260326800 3600 1 WEST} {276051600 0 0 WET} {291776400 3600 1 WEST} {307501200 0 0 WET} {323830800 3600 1 WEST} {338950800 0 0 WET} {354672000 3600 1 WEST} {370396800 0 0 WET} {386121600 3600 1 WEST} {401846400 0 0 WET} {417571200 3600 1 WEST} {433296000 0 0 WET} {449020800 3600 1 WEST} {465350400 0 0 WET} {481075200 3600 1 WEST} {496800000 0 0 WET} {504921600 0 0 WET} {512528400 3600 1 WEST} {528253200 0 0 WET} {543978000 3600 1 WEST} {559702800 0 0 WET} {575427600 3600 1 WEST} {591152400 0 0 WET} {606877200 3600 1 WEST} {622602000 0 0 WET} {638326800 3600 1 WEST} {654656400 0 0 WET} {670381200 3600 1 WEST} {686106000 0 0 WET} {701830800 3600 1 WEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 3600 0 WEST} {846378000 0 0 WET} {859683600 3600 1 WEST} {877827600 0 0 WET} {891133200 3600 1 WEST} {909277200 0 0 WET} {922582800 3600 1 WEST} {941331600 0 0 WET} {954032400 3600 1 WEST} {972781200 0 0 WET} {985482000 3600 1 WEST} {1004230800 0 0 WET} {1017536400 3600 1 WEST} {1035680400 0 0 WET} {1048986000 3600 1 WEST} {1067130000 0 0 WET} {1080435600 3600 1 WEST} {1099184400 0 0 WET} {1111885200 3600 1 WEST} {1130634000 0 0 WET} {1143334800 3600 1 WEST} {1162083600 0 0 WET} {1174784400 3600 1 WEST} {1193533200 0 0 WET} {1206838800 3600 1 WEST} {1224982800 0 0 WET} {1238288400 3600 1 WEST} {1256432400 0 0 WET} {1269738000 3600 1 WEST} {1288486800 0 0 WET} {1301187600 3600 1 WEST} {1319936400 0 0 WET} {1332637200 3600 1 WEST} {1351386000 0 0 WET} {1364691600 3600 1 WEST} {1382835600 0 0 WET} {1396141200 3600 1 WEST} {1414285200 0 0 WET} {1427590800 3600 1 WEST} {1445734800 0 0 WET} {1459040400 3600 1 WEST} {1477789200 0 0 WET} {1490490000 3600 1 WEST} {1509238800 0 0 WET} {1521939600 3600 1 WEST} {1540688400 0 0 WET} {1553994000 3600 1 WEST} {1572138000 0 0 WET} {1585443600 3600 1 WEST} {1603587600 0 0 WET} {1616893200 3600 1 WEST} {1635642000 0 0 WET} {1648342800 3600 1 WEST} {1667091600 0 0 WET} {1679792400 3600 1 WEST} {1698541200 0 0 WET} {1711846800 3600 1 WEST} {1729990800 0 0 WET} {1743296400 3600 1 WEST} {1761440400 0 0 WET} {1774746000 3600 1 WEST} {1792890000 0 0 WET} {1806195600 3600 1 WEST} {1824944400 0 0 WET} {1837645200 3600 1 WEST} {1856394000 0 0 WET} {1869094800 3600 1 WEST} {1887843600 0 0 WET} {1901149200 3600 1 WEST} {1919293200 0 0 WET} {1932598800 3600 1 WEST} {1950742800 0 0 WET} {1964048400 3600 1 WEST} {1982797200 0 0 WET} {1995498000 3600 1 WEST} {2014246800 0 0 WET} {2026947600 3600 1 WEST} {2045696400 0 0 WET} {2058397200 3600 1 WEST} {2077146000 0 0 WET} {2090451600 3600 1 WEST} {2108595600 0 0 WET} {2121901200 3600 1 WEST} {2140045200 0 0 WET} {2153350800 3600 1 WEST} {2172099600 0 0 WET} {2184800400 3600 1 WEST} {2203549200 0 0 WET} {2216250000 3600 1 WEST} {2234998800 0 0 WET} {2248304400 3600 1 WEST} {2266448400 0 0 WET} {2279754000 3600 1 WEST} {2297898000 0 0 WET} {2311203600 3600 1 WEST} {2329347600 0 0 WET} {2342653200 3600 1 WEST} {2361402000 0 0 WET} {2374102800 3600 1 WEST} {2392851600 0 0 WET} {2405552400 3600 1 WEST} {2424301200 0 0 WET} {2437606800 3600 1 WEST} {2455750800 0 0 WET} {2469056400 3600 1 WEST} {2487200400 0 0 WET} {2500506000 3600 1 WEST} {2519254800 0 0 WET} {2531955600 3600 1 WEST} {2550704400 0 0 WET} {2563405200 3600 1 WEST} {2582154000 0 0 WET} {2595459600 3600 1 WEST} {2613603600 0 0 WET} {2626909200 3600 1 WEST} {2645053200 0 0 WET} {2658358800 3600 1 WEST} {2676502800 0 0 WET} {2689808400 3600 1 WEST} {2708557200 0 0 WET} {2721258000 3600 1 WEST} {2740006800 0 0 WET} {2752707600 3600 1 WEST} {2771456400 0 0 WET} {2784762000 3600 1 WEST} {2802906000 0 0 WET} {2816211600 3600 1 WEST} {2834355600 0 0 WET} {2847661200 3600 1 WEST} {2866410000 0 0 WET} {2879110800 3600 1 WEST} {2897859600 0 0 WET} {2910560400 3600 1 WEST} {2929309200 0 0 WET} {2942010000 3600 1 WEST} {2960758800 0 0 WET} {2974064400 3600 1 WEST} {2992208400 0 0 WET} {3005514000 3600 1 WEST} {3023658000 0 0 WET} {3036963600 3600 1 WEST} {3055712400 0 0 WET} {3068413200 3600 1 WEST} {3087162000 0 0 WET} {3099862800 3600 1 WEST} {3118611600 0 0 WET} {3131917200 3600 1 WEST} {3150061200 0 0 WET} {3163366800 3600 1 WEST} {3181510800 0 0 WET} {3194816400 3600 1 WEST} {3212960400 0 0 WET} {3226266000 3600 1 WEST} {3245014800 0 0 WET} {3257715600 3600 1 WEST} {3276464400 0 0 WET} {3289165200 3600 1 WEST} {3307914000 0 0 WET} {3321219600 3600 1 WEST} {3339363600 0 0 WET} {3352669200 3600 1 WEST} {3370813200 0 0 WET} {3384118800 3600 1 WEST} {3402867600 0 0 WET} {3415568400 3600 1 WEST} {3434317200 0 0 WET} {3447018000 3600 1 WEST} {3465766800 0 0 WET} {3479072400 3600 1 WEST} {3497216400 0 0 WET} {3510522000 3600 1 WEST} {3528666000 0 0 WET} {3541971600 3600 1 WEST} {3560115600 0 0 WET} {3573421200 3600 1 WEST} {3592170000 0 0 WET} {3604870800 3600 1 WEST} {3623619600 0 0 WET} {3636320400 3600 1 WEST} {3655069200 0 0 WET} {3668374800 3600 1 WEST} {3686518800 0 0 WET} {3699824400 3600 1 WEST} {3717968400 0 0 WET} {3731274000 3600 1 WEST} {3750022800 0 0 WET} {3762723600 3600 1 WEST} {3781472400 0 0 WET} {3794173200 3600 1 WEST} {3812922000 0 0 WET} {3825622800 3600 1 WEST} {3844371600 0 0 WET} {3857677200 3600 1 WEST} {3875821200 0 0 WET} {3889126800 3600 1 WEST} {3907270800 0 0 WET} {3920576400 3600 1 WEST} {3939325200 0 0 WET} {3952026000 3600 1 WEST} {3970774800 0 0 WET} {3983475600 3600 1 WEST} {4002224400 0 0 WET} {4015530000 3600 1 WEST} {4033674000 0 0 WET} {4046979600 3600 1 WEST} {4065123600 0 0 WET} {4078429200 3600 1 WEST} {4096573200 0 0 WET} } tcl9.0.3/library/tzdata/Europe/Kyiv0000664000175000017500000001604415035744305016622 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Kyiv) { {-9223372036854775808 7324 0 LMT} {-2840148124 7324 0 KMT} {-1441159324 7200 0 EET} {-1247536800 10800 0 MSK} {-892522800 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-825382800 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {638319600 14400 1 MSD} {646786800 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {831938400 10800 0 EEST} {846378000 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Kirov0000664000175000017500000000371515035744305016773 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Kirov) { {-9223372036854775808 11928 0 LMT} {-1593820800 10800 0 +0300} {-1247540400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 10800 0 MSD} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {638319600 14400 1 MSD} {654649200 10800 0 MSK} {670374000 14400 0 +0400} {701820000 10800 0 MSD} {701823600 14400 1 MSD} {717548400 10800 0 MSK} {733273200 14400 1 MSD} {748998000 10800 0 MSK} {764722800 14400 1 MSD} {780447600 10800 0 MSK} {796172400 14400 1 MSD} {811897200 10800 0 MSK} {828226800 14400 1 MSD} {846370800 10800 0 MSK} {859676400 14400 1 MSD} {877820400 10800 0 MSK} {891126000 14400 1 MSD} {909270000 10800 0 MSK} {922575600 14400 1 MSD} {941324400 10800 0 MSK} {954025200 14400 1 MSD} {972774000 10800 0 MSK} {985474800 14400 1 MSD} {1004223600 10800 0 MSK} {1017529200 14400 1 MSD} {1035673200 10800 0 MSK} {1048978800 14400 1 MSD} {1067122800 10800 0 MSK} {1080428400 14400 1 MSD} {1099177200 10800 0 MSK} {1111878000 14400 1 MSD} {1130626800 10800 0 MSK} {1143327600 14400 1 MSD} {1162076400 10800 0 MSK} {1174777200 14400 1 MSD} {1193526000 10800 0 MSK} {1206831600 14400 1 MSD} {1224975600 10800 0 MSK} {1238281200 14400 1 MSD} {1256425200 10800 0 MSK} {1269730800 14400 1 MSD} {1288479600 10800 0 MSK} {1301180400 14400 0 MSK} {1414274400 10800 0 MSK} } tcl9.0.3/library/tzdata/Europe/Kiev0000664000175000017500000000025015035744305016566 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Kyiv)]} { LoadTimeZoneFile Europe/Kyiv } set TZData(:Europe/Kiev) $TZData(:Europe/Kyiv) tcl9.0.3/library/tzdata/Europe/Kaliningrad0000664000175000017500000000457415035744305020130 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Kaliningrad) { {-9223372036854775808 4920 0 LMT} {-2422056120 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-938905200 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-781052400 7200 1 CEST} {-780368400 7200 0 EET} {-778730400 10800 1 EEST} {-762663600 7200 0 EET} {-749095200 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 7200 0 EEMMTT} {606873600 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {670377600 10800 1 EEST} {686102400 7200 0 EET} {701827200 10800 1 EEST} {717552000 7200 0 EET} {733276800 10800 1 EEST} {749001600 7200 0 EET} {764726400 10800 1 EEST} {780451200 7200 0 EET} {796176000 10800 1 EEST} {811900800 7200 0 EET} {828230400 10800 1 EEST} {846374400 7200 0 EET} {859680000 10800 1 EEST} {877824000 7200 0 EET} {891129600 10800 1 EEST} {909273600 7200 0 EET} {922579200 10800 1 EEST} {941328000 7200 0 EET} {954028800 10800 1 EEST} {972777600 7200 0 EET} {985478400 10800 1 EEST} {1004227200 7200 0 EET} {1017532800 10800 1 EEST} {1035676800 7200 0 EET} {1048982400 10800 1 EEST} {1067126400 7200 0 EET} {1080432000 10800 1 EEST} {1099180800 7200 0 EET} {1111881600 10800 1 EEST} {1130630400 7200 0 EET} {1143331200 10800 1 EEST} {1162080000 7200 0 EET} {1174780800 10800 1 EEST} {1193529600 7200 0 EET} {1206835200 10800 1 EEST} {1224979200 7200 0 EET} {1238284800 10800 1 EEST} {1256428800 7200 0 EET} {1269734400 10800 1 EEST} {1288483200 7200 0 EET} {1301184000 10800 0 +0300} {1414278000 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Jersey0000664000175000017500000000026015035744305017132 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:Europe/Jersey) $TZData(:Europe/London) tcl9.0.3/library/tzdata/Europe/Istanbul0000664000175000017500000000676015035744305017465 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Istanbul) { {-9223372036854775808 6952 0 LMT} {-2840147752 7016 0 IMT} {-1869875816 7200 0 EET} {-1693706400 10800 1 EEST} {-1680490800 7200 0 EET} {-1570413600 10800 1 EEST} {-1552186800 7200 0 EET} {-1538359200 10800 1 EEST} {-1522551600 7200 0 EET} {-1507514400 10800 1 EEST} {-1490583600 7200 0 EET} {-1440208800 10800 1 EEST} {-1428030000 7200 0 EET} {-1409709600 10800 1 EEST} {-1396494000 7200 0 EET} {-931053600 10800 1 EEST} {-922676400 7200 0 EET} {-917834400 10800 1 EEST} {-892436400 7200 0 EET} {-875844000 10800 1 EEST} {-764737200 7200 0 EET} {-744343200 10800 1 EEST} {-733806000 7200 0 EET} {-716436000 10800 1 EEST} {-701924400 7200 0 EET} {-684986400 10800 1 EEST} {-670474800 7200 0 EET} {-654141600 10800 1 EEST} {-639025200 7200 0 EET} {-622087200 10800 1 EEST} {-606970800 7200 0 EET} {-590032800 10800 1 EEST} {-575521200 7200 0 EET} {-235620000 10800 1 EEST} {-194842800 7200 0 EET} {-177732000 10800 1 EEST} {-165726000 7200 0 EET} {107910000 10800 1 EEST} {121215600 7200 0 EET} {133920000 10800 1 EEST} {152665200 7200 0 EET} {164678400 10800 1 EEST} {184114800 7200 0 EET} {196214400 10800 1 EEST} {215564400 7200 0 EET} {228873600 10800 1 EEST} {245804400 7200 0 EET} {260323200 10800 1 EEST} {267919200 10800 0 +0300} {277254000 10800 0 +0300} {428454000 14400 1 +0400} {433893600 10800 0 +0300} {468111600 7200 0 EET} {482799600 10800 1 EEST} {496710000 7200 0 EET} {512521200 10800 1 EEST} {528246000 7200 0 EET} {543970800 10800 1 EEST} {559695600 7200 0 EET} {575420400 10800 1 EEST} {591145200 7200 0 EET} {606870000 10800 1 EEST} {622594800 7200 0 EET} {638319600 10800 1 EEST} {654649200 7200 0 EET} {670374000 10800 1 EEST} {686098800 7200 0 EET} {701823600 10800 1 EEST} {717548400 7200 0 EET} {733273200 10800 1 EEST} {748998000 7200 0 EET} {764118000 10800 1 EEST} {780447600 7200 0 EET} {796172400 10800 1 EEST} {811897200 7200 0 EET} {828226800 10800 1 EEST} {846370800 7200 0 EET} {859676400 10800 1 EEST} {877820400 7200 0 EET} {891126000 10800 1 EEST} {909270000 7200 0 EET} {922575600 10800 1 EEST} {941324400 7200 0 EET} {954025200 10800 1 EEST} {972774000 7200 0 EET} {985474800 10800 1 EEST} {1004223600 7200 0 EET} {1017529200 10800 1 EEST} {1035673200 7200 0 EET} {1048978800 10800 1 EEST} {1067122800 7200 0 EET} {1080428400 10800 1 EEST} {1099177200 7200 0 EET} {1111878000 10800 1 EEST} {1130626800 7200 0 EET} {1143327600 10800 1 EEST} {1162076400 7200 0 EET} {1167602400 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 7200 0 EET} {1301274000 10800 0 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 7200 0 EET} {1396227600 10800 0 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 10800 1 EEST} {1446944400 7200 0 EET} {1459040400 10800 1 EEST} {1473199200 10800 0 +0300} } tcl9.0.3/library/tzdata/Europe/Isle_of_Man0000664000175000017500000000026515035744305020051 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:Europe/Isle_of_Man) $TZData(:Europe/London) tcl9.0.3/library/tzdata/Europe/Helsinki0000664000175000017500000001572015035744305017446 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Helsinki) { {-9223372036854775808 5989 0 LMT} {-2890258789 5989 0 HMT} {-1535938789 7200 0 EET} {-875671200 10800 1 EEST} {-859773600 7200 0 EET} {354672000 10800 1 EEST} {370396800 7200 0 EET} {386121600 10800 1 EEST} {401846400 7200 0 EET} {410220000 7200 0 EET} {417574800 10800 1 EEST} {433299600 7200 0 EET} {449024400 10800 1 EEST} {465354000 7200 0 EET} {481078800 10800 1 EEST} {496803600 7200 0 EET} {512528400 10800 1 EEST} {528253200 7200 0 EET} {543978000 10800 1 EEST} {559702800 7200 0 EET} {575427600 10800 1 EEST} {591152400 7200 0 EET} {606877200 10800 1 EEST} {622602000 7200 0 EET} {638326800 10800 1 EEST} {654656400 7200 0 EET} {670381200 10800 1 EEST} {686106000 7200 0 EET} {701830800 10800 1 EEST} {717555600 7200 0 EET} {733280400 10800 1 EEST} {749005200 7200 0 EET} {764730000 10800 1 EEST} {780454800 7200 0 EET} {796179600 10800 1 EEST} {811904400 7200 0 EET} {828234000 10800 1 EEST} {846378000 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Guernsey0000664000175000017500000000026215035744305017474 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:Europe/Guernsey) $TZData(:Europe/London) tcl9.0.3/library/tzdata/Europe/Gibraltar0000664000175000017500000002173515035744305017612 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Gibraltar) { {-9223372036854775808 -1284 0 LMT} {-2821649916 0 0 GMT} {-1691964000 3600 1 BST} {-1680472800 0 0 GMT} {-1664143200 3600 1 BST} {-1650146400 0 0 GMT} {-1633903200 3600 1 BST} {-1617487200 0 0 GMT} {-1601848800 3600 1 BST} {-1586037600 0 0 GMT} {-1570399200 3600 1 BST} {-1552168800 0 0 GMT} {-1538344800 3600 1 BST} {-1522533600 0 0 GMT} {-1507500000 3600 1 BST} {-1490565600 0 0 GMT} {-1473631200 3600 1 BST} {-1460930400 0 0 GMT} {-1442786400 3600 1 BST} {-1428876000 0 0 GMT} {-1410732000 3600 1 BST} {-1396216800 0 0 GMT} {-1379282400 3600 1 BST} {-1364767200 0 0 GMT} {-1348437600 3600 1 BST} {-1333317600 0 0 GMT} {-1315778400 3600 1 BST} {-1301263200 0 0 GMT} {-1284328800 3600 1 BST} {-1269813600 0 0 GMT} {-1253484000 3600 1 BST} {-1238364000 0 0 GMT} {-1221429600 3600 1 BST} {-1206914400 0 0 GMT} {-1189980000 3600 1 BST} {-1175464800 0 0 GMT} {-1159135200 3600 1 BST} {-1143410400 0 0 GMT} {-1126476000 3600 1 BST} {-1111960800 0 0 GMT} {-1095631200 3600 1 BST} {-1080511200 0 0 GMT} {-1063576800 3600 1 BST} {-1049061600 0 0 GMT} {-1032127200 3600 1 BST} {-1017612000 0 0 GMT} {-1001282400 3600 1 BST} {-986162400 0 0 GMT} {-969228000 3600 1 BST} {-950479200 0 0 GMT} {-942012000 3600 1 BST} {-904518000 7200 1 BDST} {-896050800 3600 1 BST} {-875487600 7200 1 BDST} {-864601200 3600 1 BST} {-844038000 7200 1 BDST} {-832546800 3600 1 BST} {-812588400 7200 1 BDST} {-798073200 3600 1 BST} {-781052400 7200 1 BDST} {-772066800 3600 1 BST} {-764805600 0 0 GMT} {-748476000 3600 1 BST} {-733356000 0 0 GMT} {-719445600 3600 1 BST} {-717030000 7200 1 BDST} {-706748400 3600 1 BST} {-699487200 0 0 GMT} {-687996000 3600 1 BST} {-668037600 0 0 GMT} {-654732000 3600 1 BST} {-636588000 0 0 GMT} {-622072800 3600 1 BST} {-605743200 0 0 GMT} {-590623200 3600 1 BST} {-574293600 0 0 GMT} {-558568800 3600 1 BST} {-542239200 0 0 GMT} {-527119200 3600 1 BST} {-512604000 0 0 GMT} {-496274400 3600 1 BST} {-481154400 0 0 GMT} {-464220000 3600 1 BST} {-449704800 0 0 GMT} {-432165600 3600 1 BST} {-417650400 0 0 GMT} {-401320800 3600 0 CET} {378687600 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Dublin0000664000175000017500000002235415035744305017116 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Dublin) { {-9223372036854775808 -1521 0 LMT} {-2821649679 -1521 0 DMT} {-1691962479 2079 1 IST} {-1680471279 0 0 GMT} {-1664143200 3600 1 BST} {-1650146400 0 0 GMT} {-1633903200 3600 1 BST} {-1617487200 0 0 GMT} {-1601848800 3600 1 BST} {-1586037600 0 0 GMT} {-1570399200 3600 1 BST} {-1552168800 0 0 GMT} {-1538344800 3600 1 BST} {-1522533600 0 0 GMT} {-1517011200 0 0 IST} {-1507500000 3600 1 IST} {-1490565600 0 0 IST} {-1473631200 3600 1 IST} {-1460930400 0 0 IST} {-1442786400 3600 1 IST} {-1428876000 0 0 IST} {-1410732000 3600 1 IST} {-1396216800 0 0 IST} {-1379282400 3600 1 IST} {-1364767200 0 0 IST} {-1348437600 3600 1 IST} {-1333317600 0 0 IST} {-1315778400 3600 1 IST} {-1301263200 0 0 IST} {-1284328800 3600 1 IST} {-1269813600 0 0 IST} {-1253484000 3600 1 IST} {-1238364000 0 0 IST} {-1221429600 3600 1 IST} {-1206914400 0 0 IST} {-1189980000 3600 1 IST} {-1175464800 0 0 IST} {-1159135200 3600 1 IST} {-1143410400 0 0 IST} {-1126476000 3600 1 IST} {-1111960800 0 0 IST} {-1095631200 3600 1 IST} {-1080511200 0 0 IST} {-1063576800 3600 1 IST} {-1049061600 0 0 IST} {-1032127200 3600 1 IST} {-1017612000 0 0 IST} {-1001282400 3600 1 IST} {-986162400 0 0 IST} {-969228000 3600 1 IST} {-950479200 0 0 IST} {-942012000 3600 1 IST} {-733356000 0 0 GMT} {-719445600 3600 1 IST} {-699487200 0 0 GMT} {-684972000 3600 0 IST} {-668037600 0 0 IST} {-654732000 3600 1 IST} {-636588000 0 0 IST} {-622072800 3600 1 IST} {-605743200 0 0 IST} {-590623200 3600 1 IST} {-574293600 0 0 IST} {-558568800 3600 1 IST} {-542239200 0 0 IST} {-527119200 3600 1 IST} {-512604000 0 0 IST} {-496274400 3600 1 IST} {-481154400 0 0 IST} {-464220000 3600 1 IST} {-449704800 0 0 IST} {-432165600 3600 1 IST} {-417650400 0 0 IST} {-401320800 3600 1 IST} {-386200800 0 0 IST} {-369266400 3600 1 IST} {-354751200 0 0 IST} {-337816800 3600 1 IST} {-323301600 0 0 IST} {-306972000 3600 1 IST} {-291852000 0 0 IST} {-276732000 3600 1 IST} {-257983200 0 0 IST} {-245282400 3600 1 IST} {-226533600 0 0 IST} {-213228000 3600 1 IST} {-195084000 0 0 IST} {-182383200 3600 1 IST} {-163634400 0 0 IST} {-150933600 3600 1 IST} {-132184800 0 0 IST} {-119484000 3600 1 IST} {-100735200 0 0 IST} {-88034400 3600 1 IST} {-68680800 0 0 IST} {-59004000 3600 1 IST} {-37238400 3600 0 IST} {57722400 0 1 IST} {69818400 3600 0 IST} {89172000 0 1 IST} {101268000 3600 0 IST} {120621600 0 1 IST} {132717600 3600 0 IST} {152071200 0 1 IST} {164167200 3600 0 IST} {183520800 0 1 IST} {196221600 3600 0 IST} {214970400 0 1 IST} {227671200 3600 0 IST} {246420000 0 1 IST} {259120800 3600 0 IST} {278474400 0 1 IST} {290570400 3600 0 IST} {309924000 0 1 IST} {322020000 3600 0 IST} {341373600 0 1 IST} {354675600 3600 0 IST} {372819600 0 1 IST} {386125200 3600 0 IST} {404269200 0 1 IST} {417574800 3600 0 IST} {435718800 0 1 IST} {449024400 3600 0 IST} {467773200 0 1 IST} {481078800 3600 0 IST} {499222800 0 1 IST} {512528400 3600 0 IST} {530672400 0 1 IST} {543978000 3600 0 IST} {562122000 0 1 IST} {575427600 3600 0 IST} {593571600 0 1 IST} {606877200 3600 0 IST} {625626000 0 1 IST} {638326800 3600 0 IST} {657075600 0 1 IST} {670381200 3600 0 IST} {688525200 0 1 IST} {701830800 3600 0 IST} {719974800 0 1 IST} {733280400 3600 0 IST} {751424400 0 1 IST} {764730000 3600 0 IST} {782874000 0 1 IST} {796179600 3600 0 IST} {814323600 0 1 IST} {828234000 3600 0 IST} {846378000 0 1 IST} {859683600 3600 0 IST} {877827600 0 1 IST} {891133200 3600 0 IST} {909277200 0 1 IST} {922582800 3600 0 IST} {941331600 0 1 IST} {954032400 3600 0 IST} {972781200 0 1 IST} {985482000 3600 0 IST} {1004230800 0 1 IST} {1017536400 3600 0 IST} {1035680400 0 1 IST} {1048986000 3600 0 IST} {1067130000 0 1 IST} {1080435600 3600 0 IST} {1099184400 0 1 IST} {1111885200 3600 0 IST} {1130634000 0 1 IST} {1143334800 3600 0 IST} {1162083600 0 1 IST} {1174784400 3600 0 IST} {1193533200 0 1 IST} {1206838800 3600 0 IST} {1224982800 0 1 IST} {1238288400 3600 0 IST} {1256432400 0 1 IST} {1269738000 3600 0 IST} {1288486800 0 1 IST} {1301187600 3600 0 IST} {1319936400 0 1 IST} {1332637200 3600 0 IST} {1351386000 0 1 IST} {1364691600 3600 0 IST} {1382835600 0 1 IST} {1396141200 3600 0 IST} {1414285200 0 1 IST} {1427590800 3600 0 IST} {1445734800 0 1 IST} {1459040400 3600 0 IST} {1477789200 0 1 IST} {1490490000 3600 0 IST} {1509238800 0 1 IST} {1521939600 3600 0 IST} {1540688400 0 1 IST} {1553994000 3600 0 IST} {1572138000 0 1 IST} {1585443600 3600 0 IST} {1603587600 0 1 IST} {1616893200 3600 0 IST} {1635642000 0 1 IST} {1648342800 3600 0 IST} {1667091600 0 1 IST} {1679792400 3600 0 IST} {1698541200 0 1 IST} {1711846800 3600 0 IST} {1729990800 0 1 IST} {1743296400 3600 0 IST} {1761440400 0 1 IST} {1774746000 3600 0 IST} {1792890000 0 1 IST} {1806195600 3600 0 IST} {1824944400 0 1 IST} {1837645200 3600 0 IST} {1856394000 0 1 IST} {1869094800 3600 0 IST} {1887843600 0 1 IST} {1901149200 3600 0 IST} {1919293200 0 1 IST} {1932598800 3600 0 IST} {1950742800 0 1 IST} {1964048400 3600 0 IST} {1982797200 0 1 IST} {1995498000 3600 0 IST} {2014246800 0 1 IST} {2026947600 3600 0 IST} {2045696400 0 1 IST} {2058397200 3600 0 IST} {2077146000 0 1 IST} {2090451600 3600 0 IST} {2108595600 0 1 IST} {2121901200 3600 0 IST} {2140045200 0 1 IST} {2153350800 3600 0 IST} {2172099600 0 1 IST} {2184800400 3600 0 IST} {2203549200 0 1 IST} {2216250000 3600 0 IST} {2234998800 0 1 IST} {2248304400 3600 0 IST} {2266448400 0 1 IST} {2279754000 3600 0 IST} {2297898000 0 1 IST} {2311203600 3600 0 IST} {2329347600 0 1 IST} {2342653200 3600 0 IST} {2361402000 0 1 IST} {2374102800 3600 0 IST} {2392851600 0 1 IST} {2405552400 3600 0 IST} {2424301200 0 1 IST} {2437606800 3600 0 IST} {2455750800 0 1 IST} {2469056400 3600 0 IST} {2487200400 0 1 IST} {2500506000 3600 0 IST} {2519254800 0 1 IST} {2531955600 3600 0 IST} {2550704400 0 1 IST} {2563405200 3600 0 IST} {2582154000 0 1 IST} {2595459600 3600 0 IST} {2613603600 0 1 IST} {2626909200 3600 0 IST} {2645053200 0 1 IST} {2658358800 3600 0 IST} {2676502800 0 1 IST} {2689808400 3600 0 IST} {2708557200 0 1 IST} {2721258000 3600 0 IST} {2740006800 0 1 IST} {2752707600 3600 0 IST} {2771456400 0 1 IST} {2784762000 3600 0 IST} {2802906000 0 1 IST} {2816211600 3600 0 IST} {2834355600 0 1 IST} {2847661200 3600 0 IST} {2866410000 0 1 IST} {2879110800 3600 0 IST} {2897859600 0 1 IST} {2910560400 3600 0 IST} {2929309200 0 1 IST} {2942010000 3600 0 IST} {2960758800 0 1 IST} {2974064400 3600 0 IST} {2992208400 0 1 IST} {3005514000 3600 0 IST} {3023658000 0 1 IST} {3036963600 3600 0 IST} {3055712400 0 1 IST} {3068413200 3600 0 IST} {3087162000 0 1 IST} {3099862800 3600 0 IST} {3118611600 0 1 IST} {3131917200 3600 0 IST} {3150061200 0 1 IST} {3163366800 3600 0 IST} {3181510800 0 1 IST} {3194816400 3600 0 IST} {3212960400 0 1 IST} {3226266000 3600 0 IST} {3245014800 0 1 IST} {3257715600 3600 0 IST} {3276464400 0 1 IST} {3289165200 3600 0 IST} {3307914000 0 1 IST} {3321219600 3600 0 IST} {3339363600 0 1 IST} {3352669200 3600 0 IST} {3370813200 0 1 IST} {3384118800 3600 0 IST} {3402867600 0 1 IST} {3415568400 3600 0 IST} {3434317200 0 1 IST} {3447018000 3600 0 IST} {3465766800 0 1 IST} {3479072400 3600 0 IST} {3497216400 0 1 IST} {3510522000 3600 0 IST} {3528666000 0 1 IST} {3541971600 3600 0 IST} {3560115600 0 1 IST} {3573421200 3600 0 IST} {3592170000 0 1 IST} {3604870800 3600 0 IST} {3623619600 0 1 IST} {3636320400 3600 0 IST} {3655069200 0 1 IST} {3668374800 3600 0 IST} {3686518800 0 1 IST} {3699824400 3600 0 IST} {3717968400 0 1 IST} {3731274000 3600 0 IST} {3750022800 0 1 IST} {3762723600 3600 0 IST} {3781472400 0 1 IST} {3794173200 3600 0 IST} {3812922000 0 1 IST} {3825622800 3600 0 IST} {3844371600 0 1 IST} {3857677200 3600 0 IST} {3875821200 0 1 IST} {3889126800 3600 0 IST} {3907270800 0 1 IST} {3920576400 3600 0 IST} {3939325200 0 1 IST} {3952026000 3600 0 IST} {3970774800 0 1 IST} {3983475600 3600 0 IST} {4002224400 0 1 IST} {4015530000 3600 0 IST} {4033674000 0 1 IST} {4046979600 3600 0 IST} {4065123600 0 1 IST} {4078429200 3600 0 IST} {4096573200 0 1 IST} } tcl9.0.3/library/tzdata/Europe/Copenhagen0000664000175000017500000000026415035744305017744 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Berlin)]} { LoadTimeZoneFile Europe/Berlin } set TZData(:Europe/Copenhagen) $TZData(:Europe/Berlin) tcl9.0.3/library/tzdata/Europe/Chisinau0000664000175000017500000001722015035744305017440 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Chisinau) { {-9223372036854775808 6920 0 LMT} {-2840147720 6900 0 CMT} {-1637114100 6264 0 BMT} {-1213148664 7200 0 EET} {-1187056800 10800 1 EEST} {-1175479200 7200 0 EET} {-1159754400 10800 1 EEST} {-1144029600 7200 0 EET} {-1127700000 10800 1 EEST} {-1111975200 7200 0 EET} {-1096250400 10800 1 EEST} {-1080525600 7200 0 EET} {-1064800800 10800 1 EEST} {-1049076000 7200 0 EET} {-1033351200 10800 1 EEST} {-1017626400 7200 0 EET} {-1001901600 10800 1 EEST} {-986176800 7200 0 EET} {-970452000 10800 1 EEST} {-954727200 7200 0 EET} {-927165600 10800 1 EEST} {-898138800 7200 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-800154000 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} {402264000 10800 0 MSK} {417992400 14400 1 MSD} {433800000 10800 0 MSK} {449614800 14400 1 MSD} {465346800 10800 0 MSK} {481071600 14400 1 MSD} {496796400 10800 0 MSK} {512521200 14400 1 MSD} {528246000 10800 0 MSK} {543970800 14400 1 MSD} {559695600 10800 0 MSK} {575420400 14400 1 MSD} {591145200 10800 0 MSK} {606870000 14400 1 MSD} {622594800 10800 0 MSK} {638319600 14400 1 MSD} {641948400 10800 0 EEST} {654652800 7200 0 EET} {670377600 10800 1 EEST} {686102400 7200 0 EET} {694216800 7200 0 EET} {701820000 10800 1 EEST} {717541200 7200 0 EET} {733269600 10800 1 EEST} {748990800 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {846363600 7200 0 EET} {852069600 7200 0 EET} {859680000 10800 1 EEST} {877824000 7200 0 EET} {891129600 10800 1 EEST} {909273600 7200 0 EET} {922579200 10800 1 EEST} {941328000 7200 0 EET} {954028800 10800 1 EEST} {972777600 7200 0 EET} {985478400 10800 1 EEST} {1004227200 7200 0 EET} {1017532800 10800 1 EEST} {1035676800 7200 0 EET} {1048982400 10800 1 EEST} {1067126400 7200 0 EET} {1080432000 10800 1 EEST} {1099180800 7200 0 EET} {1111881600 10800 1 EEST} {1130630400 7200 0 EET} {1143331200 10800 1 EEST} {1162080000 7200 0 EET} {1174780800 10800 1 EEST} {1193529600 7200 0 EET} {1206835200 10800 1 EEST} {1224979200 7200 0 EET} {1238284800 10800 1 EEST} {1256428800 7200 0 EET} {1269734400 10800 1 EEST} {1288483200 7200 0 EET} {1301184000 10800 1 EEST} {1319932800 7200 0 EET} {1332633600 10800 1 EEST} {1351382400 7200 0 EET} {1364688000 10800 1 EEST} {1382832000 7200 0 EET} {1396137600 10800 1 EEST} {1414281600 7200 0 EET} {1427587200 10800 1 EEST} {1445731200 7200 0 EET} {1459036800 10800 1 EEST} {1477785600 7200 0 EET} {1490486400 10800 1 EEST} {1509235200 7200 0 EET} {1521936000 10800 1 EEST} {1540684800 7200 0 EET} {1553990400 10800 1 EEST} {1572134400 7200 0 EET} {1585440000 10800 1 EEST} {1603584000 7200 0 EET} {1616889600 10800 1 EEST} {1635638400 7200 0 EET} {1648339200 10800 1 EEST} {1667088000 7200 0 EET} {1679788800 10800 1 EEST} {1698537600 7200 0 EET} {1711843200 10800 1 EEST} {1729987200 7200 0 EET} {1743292800 10800 1 EEST} {1761436800 7200 0 EET} {1774742400 10800 1 EEST} {1792886400 7200 0 EET} {1806192000 10800 1 EEST} {1824940800 7200 0 EET} {1837641600 10800 1 EEST} {1856390400 7200 0 EET} {1869091200 10800 1 EEST} {1887840000 7200 0 EET} {1901145600 10800 1 EEST} {1919289600 7200 0 EET} {1932595200 10800 1 EEST} {1950739200 7200 0 EET} {1964044800 10800 1 EEST} {1982793600 7200 0 EET} {1995494400 10800 1 EEST} {2014243200 7200 0 EET} {2026944000 10800 1 EEST} {2045692800 7200 0 EET} {2058393600 10800 1 EEST} {2077142400 7200 0 EET} {2090448000 10800 1 EEST} {2108592000 7200 0 EET} {2121897600 10800 1 EEST} {2140041600 7200 0 EET} {2153347200 10800 1 EEST} {2172096000 7200 0 EET} {2184796800 10800 1 EEST} {2203545600 7200 0 EET} {2216246400 10800 1 EEST} {2234995200 7200 0 EET} {2248300800 10800 1 EEST} {2266444800 7200 0 EET} {2279750400 10800 1 EEST} {2297894400 7200 0 EET} {2311200000 10800 1 EEST} {2329344000 7200 0 EET} {2342649600 10800 1 EEST} {2361398400 7200 0 EET} {2374099200 10800 1 EEST} {2392848000 7200 0 EET} {2405548800 10800 1 EEST} {2424297600 7200 0 EET} {2437603200 10800 1 EEST} {2455747200 7200 0 EET} {2469052800 10800 1 EEST} {2487196800 7200 0 EET} {2500502400 10800 1 EEST} {2519251200 7200 0 EET} {2531952000 10800 1 EEST} {2550700800 7200 0 EET} {2563401600 10800 1 EEST} {2582150400 7200 0 EET} {2595456000 10800 1 EEST} {2613600000 7200 0 EET} {2626905600 10800 1 EEST} {2645049600 7200 0 EET} {2658355200 10800 1 EEST} {2676499200 7200 0 EET} {2689804800 10800 1 EEST} {2708553600 7200 0 EET} {2721254400 10800 1 EEST} {2740003200 7200 0 EET} {2752704000 10800 1 EEST} {2771452800 7200 0 EET} {2784758400 10800 1 EEST} {2802902400 7200 0 EET} {2816208000 10800 1 EEST} {2834352000 7200 0 EET} {2847657600 10800 1 EEST} {2866406400 7200 0 EET} {2879107200 10800 1 EEST} {2897856000 7200 0 EET} {2910556800 10800 1 EEST} {2929305600 7200 0 EET} {2942006400 10800 1 EEST} {2960755200 7200 0 EET} {2974060800 10800 1 EEST} {2992204800 7200 0 EET} {3005510400 10800 1 EEST} {3023654400 7200 0 EET} {3036960000 10800 1 EEST} {3055708800 7200 0 EET} {3068409600 10800 1 EEST} {3087158400 7200 0 EET} {3099859200 10800 1 EEST} {3118608000 7200 0 EET} {3131913600 10800 1 EEST} {3150057600 7200 0 EET} {3163363200 10800 1 EEST} {3181507200 7200 0 EET} {3194812800 10800 1 EEST} {3212956800 7200 0 EET} {3226262400 10800 1 EEST} {3245011200 7200 0 EET} {3257712000 10800 1 EEST} {3276460800 7200 0 EET} {3289161600 10800 1 EEST} {3307910400 7200 0 EET} {3321216000 10800 1 EEST} {3339360000 7200 0 EET} {3352665600 10800 1 EEST} {3370809600 7200 0 EET} {3384115200 10800 1 EEST} {3402864000 7200 0 EET} {3415564800 10800 1 EEST} {3434313600 7200 0 EET} {3447014400 10800 1 EEST} {3465763200 7200 0 EET} {3479068800 10800 1 EEST} {3497212800 7200 0 EET} {3510518400 10800 1 EEST} {3528662400 7200 0 EET} {3541968000 10800 1 EEST} {3560112000 7200 0 EET} {3573417600 10800 1 EEST} {3592166400 7200 0 EET} {3604867200 10800 1 EEST} {3623616000 7200 0 EET} {3636316800 10800 1 EEST} {3655065600 7200 0 EET} {3668371200 10800 1 EEST} {3686515200 7200 0 EET} {3699820800 10800 1 EEST} {3717964800 7200 0 EET} {3731270400 10800 1 EEST} {3750019200 7200 0 EET} {3762720000 10800 1 EEST} {3781468800 7200 0 EET} {3794169600 10800 1 EEST} {3812918400 7200 0 EET} {3825619200 10800 1 EEST} {3844368000 7200 0 EET} {3857673600 10800 1 EEST} {3875817600 7200 0 EET} {3889123200 10800 1 EEST} {3907267200 7200 0 EET} {3920572800 10800 1 EEST} {3939321600 7200 0 EET} {3952022400 10800 1 EEST} {3970771200 7200 0 EET} {3983472000 10800 1 EEST} {4002220800 7200 0 EET} {4015526400 10800 1 EEST} {4033670400 7200 0 EET} {4046976000 10800 1 EEST} {4065120000 7200 0 EET} {4078425600 10800 1 EEST} {4096569600 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Busingen0000664000175000017500000000026215035744305017445 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Zurich)]} { LoadTimeZoneFile Europe/Zurich } set TZData(:Europe/Busingen) $TZData(:Europe/Zurich) tcl9.0.3/library/tzdata/Europe/Budapest0000664000175000017500000001750415035744305017451 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Budapest) { {-9223372036854775808 4580 0 LMT} {-2498260580 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1640998800 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-1600470000 7200 1 CEST} {-1587250800 3600 0 CET} {-1569711600 7200 1 CEST} {-1555196400 3600 0 CET} {-906775200 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-788922000 3600 0 CET} {-778471200 7200 1 CEST} {-762656400 3600 0 CET} {-749689200 7200 1 CEST} {-733276800 3600 0 CET} {-717634800 7200 1 CEST} {-701910000 3600 0 CET} {-686185200 7200 1 CEST} {-670460400 3600 0 CET} {-654130800 7200 1 CEST} {-639010800 3600 0 CET} {-492656400 7200 1 CEST} {-481168800 3600 0 CET} {-461199600 7200 1 CEST} {-449708400 3600 0 CET} {-428540400 7200 1 CEST} {-418258800 3600 0 CET} {-397090800 7200 1 CEST} {-386809200 3600 0 CET} {323823600 7200 1 CEST} {338943600 3600 0 CET} {354668400 7200 1 CEST} {370393200 3600 0 CET} {386118000 7200 1 CEST} {401842800 3600 0 CET} {417567600 7200 1 CEST} {433292400 3600 0 CET} {441759600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Bucharest0000664000175000017500000001703215035744305017616 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Bucharest) { {-9223372036854775808 6264 0 LMT} {-2469404664 6264 0 BMT} {-1213148664 7200 0 EET} {-1187056800 10800 1 EEST} {-1175479200 7200 0 EET} {-1159754400 10800 1 EEST} {-1144029600 7200 0 EET} {-1127700000 10800 1 EEST} {-1111975200 7200 0 EET} {-1096250400 10800 1 EEST} {-1080525600 7200 0 EET} {-1064800800 10800 1 EEST} {-1049076000 7200 0 EET} {-1033351200 10800 1 EEST} {-1017626400 7200 0 EET} {-1001901600 10800 1 EEST} {-986176800 7200 0 EET} {-970452000 10800 1 EEST} {-954727200 7200 0 EET} {296604000 10800 1 EEST} {307486800 7200 0 EET} {323816400 10800 1 EEST} {338940000 7200 0 EET} {354672000 10800 0 EEST} {370396800 7200 0 EET} {386121600 10800 1 EEST} {401846400 7200 0 EET} {417571200 10800 1 EEST} {433296000 7200 0 EET} {449020800 10800 1 EEST} {465350400 7200 0 EET} {481075200 10800 1 EEST} {496800000 7200 0 EET} {512524800 10800 1 EEST} {528249600 7200 0 EET} {543974400 10800 1 EEST} {559699200 7200 0 EET} {575424000 10800 1 EEST} {591148800 7200 0 EET} {606873600 10800 1 EEST} {622598400 7200 0 EET} {638323200 10800 1 EEST} {654652800 7200 0 EET} {662680800 7200 0 EET} {670370400 10800 1 EEST} {686095200 7200 0 EET} {701820000 10800 1 EEST} {717544800 7200 0 EET} {733269600 10800 1 EEST} {748994400 7200 0 EET} {757375200 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {846363600 7200 0 EET} {852069600 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Brussels0000664000175000017500000002131315035744305017475 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Brussels) { {-9223372036854775808 1050 0 LMT} {-2840141850 1050 0 BMT} {-2450995200 0 0 WET} {-1740355200 3600 0 CET} {-1693702800 7200 0 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-1613826000 0 0 WET} {-1604278800 3600 1 WEST} {-1585530000 0 0 WET} {-1574038800 3600 1 WEST} {-1552266000 0 0 WET} {-1539997200 3600 1 WEST} {-1520557200 0 0 WET} {-1507510800 3600 1 WEST} {-1490576400 0 0 WET} {-1473642000 3600 1 WEST} {-1459126800 0 0 WET} {-1444006800 3600 1 WEST} {-1427677200 0 0 WET} {-1411952400 3600 1 WEST} {-1396227600 0 0 WET} {-1379293200 3600 1 WEST} {-1364778000 0 0 WET} {-1348448400 3600 1 WEST} {-1333328400 0 0 WET} {-1316394000 3600 1 WEST} {-1301263200 0 0 WET} {-1284328800 3600 1 WEST} {-1269813600 0 0 WET} {-1253484000 3600 1 WEST} {-1238364000 0 0 WET} {-1221429600 3600 1 WEST} {-1206914400 0 0 WET} {-1191189600 3600 1 WEST} {-1175464800 0 0 WET} {-1160344800 3600 1 WEST} {-1143410400 0 0 WET} {-1127685600 3600 1 WEST} {-1111960800 0 0 WET} {-1096840800 3600 1 WEST} {-1080511200 0 0 WET} {-1063576800 3600 1 WEST} {-1049061600 0 0 WET} {-1033336800 3600 1 WEST} {-1017612000 0 0 WET} {-1002492000 3600 1 WEST} {-986162400 0 0 WET} {-969228000 3600 1 WEST} {-950479200 0 0 WET} {-942012000 3600 1 WEST} {-934668000 7200 0 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-799290000 3600 0 CET} {-798073200 3600 0 CET} {-781052400 7200 1 CEST} {-766623600 3600 0 CET} {-745455600 7200 1 CEST} {-733273200 3600 0 CET} {220921200 3600 0 CET} {228877200 7200 1 CEST} {243997200 3600 0 CET} {260326800 7200 1 CEST} {276051600 3600 0 CET} {291776400 7200 1 CEST} {307501200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Bratislava0000664000175000017500000000026415035744305017765 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Prague)]} { LoadTimeZoneFile Europe/Prague } set TZData(:Europe/Bratislava) $TZData(:Europe/Prague) tcl9.0.3/library/tzdata/Europe/Berlin0000664000175000017500000001710215035744305017107 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Berlin) { {-9223372036854775808 3208 0 LMT} {-2422054408 3600 0 CET} {-1693706400 7200 1 CEST} {-1680483600 3600 0 CET} {-1663455600 7200 1 CEST} {-1650150000 3600 0 CET} {-1632006000 7200 1 CEST} {-1618700400 3600 0 CET} {-938905200 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-781052400 7200 1 CEST} {-776559600 10800 0 CEMT} {-765936000 7200 1 CEST} {-761180400 3600 0 CET} {-757386000 3600 0 CET} {-748479600 7200 1 CEST} {-733273200 3600 0 CET} {-717631200 7200 1 CEST} {-714610800 10800 1 CEMT} {-710380800 7200 1 CEST} {-701910000 3600 0 CET} {-684975600 7200 1 CEST} {-670460400 3600 0 CET} {-654130800 7200 1 CEST} {-639010800 3600 0 CET} {315529200 3600 0 CET} {323830800 7200 1 CEST} {338950800 3600 0 CET} {354675600 7200 1 CEST} {370400400 3600 0 CET} {386125200 7200 1 CEST} {401850000 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Belgrade0000664000175000017500000001562315035744305017407 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Belgrade) { {-9223372036854775808 4920 0 LMT} {-2713915320 3600 0 CET} {-905824800 3600 0 CET} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} {-788922000 3600 0 CET} {-777942000 7200 1 CEST} {-766623600 3600 0 CET} {407199600 3600 0 CET} {417574800 7200 1 CEST} {433299600 3600 0 CET} {449024400 7200 1 CEST} {465354000 3600 0 CET} {481078800 7200 1 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Belfast0000664000175000017500000000026115035744305017252 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/London)]} { LoadTimeZoneFile Europe/London } set TZData(:Europe/Belfast) $TZData(:Europe/London) tcl9.0.3/library/tzdata/Europe/Athens0000664000175000017500000001700615035744305017121 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Athens) { {-9223372036854775808 5692 0 LMT} {-2344642492 5692 0 AMT} {-1686101632 7200 0 EET} {-1182996000 10800 1 EEST} {-1178161200 7200 0 EET} {-906861600 10800 1 EEST} {-904878000 7200 0 CEST} {-857257200 3600 0 CET} {-844477200 7200 1 CEST} {-828237600 3600 0 CET} {-812422800 7200 0 EET} {-552362400 10800 1 EEST} {-541652400 7200 0 EET} {166485600 10800 1 EEST} {186184800 7200 0 EET} {198028800 10800 1 EEST} {213753600 7200 0 EET} {228873600 10800 1 EEST} {244080000 7200 0 EET} {260323200 10800 1 EEST} {275446800 7200 0 EET} {291798000 10800 1 EEST} {307407600 7200 0 EET} {323388000 10800 1 EEST} {338936400 7200 0 EET} {347148000 7200 0 EET} {354675600 10800 1 EEST} {370400400 7200 0 EET} {386125200 10800 1 EEST} {401850000 7200 0 EET} {417574800 10800 1 EEST} {433299600 7200 0 EET} {449024400 10800 1 EEST} {465354000 7200 0 EET} {481078800 10800 1 EEST} {496803600 7200 0 EET} {512528400 10800 1 EEST} {528253200 7200 0 EET} {543978000 10800 1 EEST} {559702800 7200 0 EET} {575427600 10800 1 EEST} {591152400 7200 0 EET} {606877200 10800 1 EEST} {622602000 7200 0 EET} {638326800 10800 1 EEST} {654656400 7200 0 EET} {670381200 10800 1 EEST} {686106000 7200 0 EET} {701830800 10800 1 EEST} {717555600 7200 0 EET} {733280400 10800 1 EEST} {749005200 7200 0 EET} {764730000 10800 1 EEST} {780454800 7200 0 EET} {796179600 10800 1 EEST} {811904400 7200 0 EET} {828234000 10800 1 EEST} {846378000 7200 0 EET} {859683600 10800 1 EEST} {877827600 7200 0 EET} {891133200 10800 1 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Europe/Astrakhan0000664000175000017500000000411415035744305017607 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Astrakhan) { {-9223372036854775808 11532 0 LMT} {-1441249932 10800 0 +0300} {-1247540400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 10800 0 +0300} {606870000 14400 1 +0400} {622594800 10800 0 +0300} {638319600 14400 1 +0400} {654649200 10800 0 +0300} {670374000 14400 0 +0400} {701820000 10800 0 +0300} {701823600 14400 1 +0400} {717548400 10800 0 +0300} {733273200 14400 1 +0400} {748998000 10800 0 +0300} {764722800 14400 1 +0400} {780447600 10800 0 +0300} {796172400 14400 1 +0400} {811897200 10800 0 +0300} {828226800 14400 1 +0400} {846370800 10800 0 +0300} {859676400 14400 1 +0400} {877820400 10800 0 +0300} {891126000 14400 1 +0400} {909270000 10800 0 +0300} {922575600 14400 1 +0400} {941324400 10800 0 +0300} {954025200 14400 1 +0400} {972774000 10800 0 +0300} {985474800 14400 1 +0400} {1004223600 10800 0 +0300} {1017529200 14400 1 +0400} {1035673200 10800 0 +0300} {1048978800 14400 1 +0400} {1067122800 10800 0 +0300} {1080428400 14400 1 +0400} {1099177200 10800 0 +0300} {1111878000 14400 1 +0400} {1130626800 10800 0 +0300} {1143327600 14400 1 +0400} {1162076400 10800 0 +0300} {1174777200 14400 1 +0400} {1193526000 10800 0 +0300} {1206831600 14400 1 +0400} {1224975600 10800 0 +0300} {1238281200 14400 1 +0400} {1256425200 10800 0 +0300} {1269730800 14400 1 +0400} {1288479600 10800 0 +0300} {1301180400 14400 0 +0400} {1414274400 10800 0 +0300} {1459033200 14400 0 +0400} } tcl9.0.3/library/tzdata/Europe/Andorra0000664000175000017500000001504215035744305017263 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Europe/Andorra) { {-9223372036854775808 364 0 LMT} {-2177453164 0 0 WET} {-733881600 3600 0 CET} {481078800 7200 0 CEST} {496803600 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Europe/Amsterdam0000664000175000017500000000027115035744305017610 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Brussels)]} { LoadTimeZoneFile Europe/Brussels } set TZData(:Europe/Amsterdam) $TZData(:Europe/Brussels) tcl9.0.3/library/tzdata/Etc/0000755000175000017500000000000015104662345015222 5ustar sergeisergeitcl9.0.3/library/tzdata/Etc/Zulu0000664000175000017500000000023115035744305016102 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:Etc/Zulu) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/Etc/UTC0000664000175000017500000000015115035744305015577 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/UTC) { {-9223372036854775808 0 0 UTC} } tcl9.0.3/library/tzdata/Etc/Universal0000664000175000017500000000023615035744305017120 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:Etc/Universal) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/Etc/UCT0000664000175000017500000000023015035744305015575 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/UTC)]} { LoadTimeZoneFile Etc/UTC } set TZData(:Etc/UCT) $TZData(:Etc/UTC) tcl9.0.3/library/tzdata/Etc/Greenwich0000664000175000017500000000023615035744305017063 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:Etc/Greenwich) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/Etc/GMT00000664000175000017500000000023115035744305015652 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:Etc/GMT0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/Etc/GMT-90000664000175000017500000000016115035744305015742 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-9) { {-9223372036854775808 32400 0 +0900} } tcl9.0.3/library/tzdata/Etc/GMT-80000664000175000017500000000016115035744305015741 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-8) { {-9223372036854775808 28800 0 +0800} } tcl9.0.3/library/tzdata/Etc/GMT-70000664000175000017500000000016115035744305015740 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-7) { {-9223372036854775808 25200 0 +0700} } tcl9.0.3/library/tzdata/Etc/GMT-60000664000175000017500000000016115035744305015737 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-6) { {-9223372036854775808 21600 0 +0600} } tcl9.0.3/library/tzdata/Etc/GMT-50000664000175000017500000000016115035744305015736 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-5) { {-9223372036854775808 18000 0 +0500} } tcl9.0.3/library/tzdata/Etc/GMT-40000664000175000017500000000016115035744305015735 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-4) { {-9223372036854775808 14400 0 +0400} } tcl9.0.3/library/tzdata/Etc/GMT-30000664000175000017500000000016115035744305015734 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-3) { {-9223372036854775808 10800 0 +0300} } tcl9.0.3/library/tzdata/Etc/GMT-20000664000175000017500000000016015035744305015732 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-2) { {-9223372036854775808 7200 0 +0200} } tcl9.0.3/library/tzdata/Etc/GMT-140000664000175000017500000000016215035744305016017 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-14) { {-9223372036854775808 50400 0 +1400} } tcl9.0.3/library/tzdata/Etc/GMT-130000664000175000017500000000016215035744305016016 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-13) { {-9223372036854775808 46800 0 +1300} } tcl9.0.3/library/tzdata/Etc/GMT-120000664000175000017500000000016215035744305016015 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-12) { {-9223372036854775808 43200 0 +1200} } tcl9.0.3/library/tzdata/Etc/GMT-110000664000175000017500000000016215035744305016014 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-11) { {-9223372036854775808 39600 0 +1100} } tcl9.0.3/library/tzdata/Etc/GMT-100000664000175000017500000000016215035744305016013 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-10) { {-9223372036854775808 36000 0 +1000} } tcl9.0.3/library/tzdata/Etc/GMT-10000664000175000017500000000016015035744305015731 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT-1) { {-9223372036854775808 3600 0 +0100} } tcl9.0.3/library/tzdata/Etc/GMT-00000664000175000017500000000023215035744305015730 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:Etc/GMT-0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/Etc/GMT+90000664000175000017500000000016215035744305015741 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+9) { {-9223372036854775808 -32400 0 -0900} } tcl9.0.3/library/tzdata/Etc/GMT+80000664000175000017500000000016215035744305015740 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+8) { {-9223372036854775808 -28800 0 -0800} } tcl9.0.3/library/tzdata/Etc/GMT+70000664000175000017500000000016215035744305015737 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+7) { {-9223372036854775808 -25200 0 -0700} } tcl9.0.3/library/tzdata/Etc/GMT+60000664000175000017500000000016215035744305015736 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+6) { {-9223372036854775808 -21600 0 -0600} } tcl9.0.3/library/tzdata/Etc/GMT+50000664000175000017500000000016215035744305015735 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+5) { {-9223372036854775808 -18000 0 -0500} } tcl9.0.3/library/tzdata/Etc/GMT+40000664000175000017500000000016215035744305015734 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+4) { {-9223372036854775808 -14400 0 -0400} } tcl9.0.3/library/tzdata/Etc/GMT+30000664000175000017500000000016215035744305015733 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+3) { {-9223372036854775808 -10800 0 -0300} } tcl9.0.3/library/tzdata/Etc/GMT+20000664000175000017500000000016115035744305015731 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+2) { {-9223372036854775808 -7200 0 -0200} } tcl9.0.3/library/tzdata/Etc/GMT+120000664000175000017500000000016315035744305016014 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+12) { {-9223372036854775808 -43200 0 -1200} } tcl9.0.3/library/tzdata/Etc/GMT+110000664000175000017500000000016315035744305016013 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+11) { {-9223372036854775808 -39600 0 -1100} } tcl9.0.3/library/tzdata/Etc/GMT+100000664000175000017500000000016315035744305016012 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+10) { {-9223372036854775808 -36000 0 -1000} } tcl9.0.3/library/tzdata/Etc/GMT+10000664000175000017500000000016115035744305015730 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT+1) { {-9223372036854775808 -3600 0 -0100} } tcl9.0.3/library/tzdata/Etc/GMT+00000664000175000017500000000023215035744305015726 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Etc/GMT)]} { LoadTimeZoneFile Etc/GMT } set TZData(:Etc/GMT+0) $TZData(:Etc/GMT) tcl9.0.3/library/tzdata/Etc/GMT0000664000175000017500000000015115035744305015573 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Etc/GMT) { {-9223372036854775808 0 0 GMT} } tcl9.0.3/library/tzdata/EST5EDT0000664000175000017500000000026315035744305015512 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/New_York)]} { LoadTimeZoneFile America/New_York } set TZData(:EST5EDT) $TZData(:America/New_York) tcl9.0.3/library/tzdata/EST0000664000175000017500000000025115035744305015065 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Panama)]} { LoadTimeZoneFile America/Panama } set TZData(:EST) $TZData(:America/Panama) tcl9.0.3/library/tzdata/Eire0000664000175000017500000000024715035744305015323 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Dublin)]} { LoadTimeZoneFile Europe/Dublin } set TZData(:Eire) $TZData(:Europe/Dublin) tcl9.0.3/library/tzdata/Egypt0000664000175000017500000000024515035744305015525 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Cairo)]} { LoadTimeZoneFile Africa/Cairo } set TZData(:Egypt) $TZData(:Africa/Cairo) tcl9.0.3/library/tzdata/EET0000664000175000017500000000024615035744305015053 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Athens)]} { LoadTimeZoneFile Europe/Athens } set TZData(:EET) $TZData(:Europe/Athens) tcl9.0.3/library/tzdata/Cuba0000664000175000017500000000025215035744305015305 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Havana)]} { LoadTimeZoneFile America/Havana } set TZData(:Cuba) $TZData(:America/Havana) tcl9.0.3/library/tzdata/CST6CDT0000664000175000017500000000026015035744305015504 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Chicago)]} { LoadTimeZoneFile America/Chicago } set TZData(:CST6CDT) $TZData(:America/Chicago) tcl9.0.3/library/tzdata/Chile/0000755000175000017500000000000015104662345015533 5ustar sergeisergeitcl9.0.3/library/tzdata/Chile/EasterIsland0000664000175000017500000000027015035744305020035 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Easter)]} { LoadTimeZoneFile Pacific/Easter } set TZData(:Chile/EasterIsland) $TZData(:Pacific/Easter) tcl9.0.3/library/tzdata/Chile/Continental0000664000175000017500000000027515035744305017742 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Santiago)]} { LoadTimeZoneFile America/Santiago } set TZData(:Chile/Continental) $TZData(:America/Santiago) tcl9.0.3/library/tzdata/CET0000664000175000017500000000025415035744305015050 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Brussels)]} { LoadTimeZoneFile Europe/Brussels } set TZData(:CET) $TZData(:Europe/Brussels) tcl9.0.3/library/tzdata/Canada/0000755000175000017500000000000015104662345015656 5ustar sergeisergeitcl9.0.3/library/tzdata/Canada/Yukon0000664000175000017500000000027615035744305016715 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Whitehorse)]} { LoadTimeZoneFile America/Whitehorse } set TZData(:Canada/Yukon) $TZData(:America/Whitehorse) tcl9.0.3/library/tzdata/Canada/Saskatchewan0000664000175000017500000000027115035744305020217 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Regina)]} { LoadTimeZoneFile America/Regina } set TZData(:Canada/Saskatchewan) $TZData(:America/Regina) tcl9.0.3/library/tzdata/Canada/Pacific0000664000175000017500000000027515035744305017145 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Vancouver)]} { LoadTimeZoneFile America/Vancouver } set TZData(:Canada/Pacific) $TZData(:America/Vancouver) tcl9.0.3/library/tzdata/Canada/Newfoundland0000664000175000017500000000027715035744305020235 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/St_Johns)]} { LoadTimeZoneFile America/St_Johns } set TZData(:Canada/Newfoundland) $TZData(:America/St_Johns) tcl9.0.3/library/tzdata/Canada/Mountain0000664000175000017500000000027315035744305017377 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Edmonton)]} { LoadTimeZoneFile America/Edmonton } set TZData(:Canada/Mountain) $TZData(:America/Edmonton) tcl9.0.3/library/tzdata/Canada/Eastern0000664000175000017500000000026715035744305017211 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Toronto)]} { LoadTimeZoneFile America/Toronto } set TZData(:Canada/Eastern) $TZData(:America/Toronto) tcl9.0.3/library/tzdata/Canada/Central0000664000175000017500000000027215035744305017174 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Winnipeg)]} { LoadTimeZoneFile America/Winnipeg } set TZData(:Canada/Central) $TZData(:America/Winnipeg) tcl9.0.3/library/tzdata/Canada/Atlantic0000664000175000017500000000027015035744305017341 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Halifax)]} { LoadTimeZoneFile America/Halifax } set TZData(:Canada/Atlantic) $TZData(:America/Halifax) tcl9.0.3/library/tzdata/Brazil/0000755000175000017500000000000015104662345015732 5ustar sergeisergeitcl9.0.3/library/tzdata/Brazil/West0000664000175000017500000000026115035744305016600 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Manaus)]} { LoadTimeZoneFile America/Manaus } set TZData(:Brazil/West) $TZData(:America/Manaus) tcl9.0.3/library/tzdata/Brazil/East0000664000175000017500000000027215035744305016554 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Sao_Paulo)]} { LoadTimeZoneFile America/Sao_Paulo } set TZData(:Brazil/East) $TZData(:America/Sao_Paulo) tcl9.0.3/library/tzdata/Brazil/DeNoronha0000664000175000017500000000027115035744305017534 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Noronha)]} { LoadTimeZoneFile America/Noronha } set TZData(:Brazil/DeNoronha) $TZData(:America/Noronha) tcl9.0.3/library/tzdata/Brazil/Acre0000664000175000017500000000027515035744305016535 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Rio_Branco)]} { LoadTimeZoneFile America/Rio_Branco } set TZData(:Brazil/Acre) $TZData(:America/Rio_Branco) tcl9.0.3/library/tzdata/Australia/0000755000175000017500000000000015104662345016434 5ustar sergeisergeitcl9.0.3/library/tzdata/Australia/Yancowinna0000664000175000017500000000031715035744305020470 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Broken_Hill)]} { LoadTimeZoneFile Australia/Broken_Hill } set TZData(:Australia/Yancowinna) $TZData(:Australia/Broken_Hill) tcl9.0.3/library/tzdata/Australia/West0000664000175000017500000000026715035744305017310 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Perth)]} { LoadTimeZoneFile Australia/Perth } set TZData(:Australia/West) $TZData(:Australia/Perth) tcl9.0.3/library/tzdata/Australia/Victoria0000664000175000017500000000030715035744305020141 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Melbourne)]} { LoadTimeZoneFile Australia/Melbourne } set TZData(:Australia/Victoria) $TZData(:Australia/Melbourne) tcl9.0.3/library/tzdata/Australia/Tasmania0000664000175000017500000000027615035744305020123 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Hobart)]} { LoadTimeZoneFile Australia/Hobart } set TZData(:Australia/Tasmania) $TZData(:Australia/Hobart) tcl9.0.3/library/tzdata/Australia/Sydney0000664000175000017500000001760215035744305017642 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Sydney) { {-9223372036854775808 36292 0 LMT} {-2364113092 36000 0 AEST} {-1672560000 39600 1 AEDT} {-1665388800 36000 0 AEST} {-883641600 39600 1 AEDT} {-876124800 36000 0 AEST} {-860400000 39600 1 AEDT} {-844675200 36000 0 AEST} {-828345600 39600 1 AEDT} {-813225600 36000 0 AEST} {31500000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {89136000 39600 1 AEDT} {100022400 36000 0 AEST} {120585600 39600 1 AEDT} {131472000 36000 0 AEST} {152035200 39600 1 AEDT} {162921600 36000 0 AEST} {183484800 39600 1 AEDT} {194976000 36000 0 AEST} {215539200 39600 1 AEDT} {226425600 36000 0 AEST} {246988800 39600 1 AEDT} {257875200 36000 0 AEST} {278438400 39600 1 AEDT} {289324800 36000 0 AEST} {309888000 39600 1 AEDT} {320774400 36000 0 AEST} {341337600 39600 1 AEDT} {352224000 36000 0 AEST} {372787200 39600 1 AEDT} {386697600 36000 0 AEST} {404841600 39600 1 AEDT} {415728000 36000 0 AEST} {436291200 39600 1 AEDT} {447177600 36000 0 AEST} {467740800 39600 1 AEDT} {478627200 36000 0 AEST} {499190400 39600 1 AEDT} {511286400 36000 0 AEST} {530035200 39600 1 AEDT} {542736000 36000 0 AEST} {562089600 39600 1 AEDT} {574790400 36000 0 AEST} {594144000 39600 1 AEDT} {606240000 36000 0 AEST} {625593600 39600 1 AEDT} {636480000 36000 0 AEST} {657043200 39600 1 AEDT} {667929600 36000 0 AEST} {688492800 39600 1 AEDT} {699379200 36000 0 AEST} {719942400 39600 1 AEDT} {731433600 36000 0 AEST} {751996800 39600 1 AEDT} {762883200 36000 0 AEST} {783446400 39600 1 AEDT} {794332800 36000 0 AEST} {814896000 39600 1 AEDT} {828201600 36000 0 AEST} {846345600 39600 1 AEDT} {859651200 36000 0 AEST} {877795200 39600 1 AEDT} {891100800 36000 0 AEST} {909244800 39600 1 AEDT} {922550400 36000 0 AEST} {941299200 39600 1 AEDT} {954000000 36000 0 AEST} {967305600 39600 1 AEDT} {985449600 36000 0 AEST} {1004198400 39600 1 AEDT} {1017504000 36000 0 AEST} {1035648000 39600 1 AEDT} {1048953600 36000 0 AEST} {1067097600 39600 1 AEDT} {1080403200 36000 0 AEST} {1099152000 39600 1 AEDT} {1111852800 36000 0 AEST} {1130601600 39600 1 AEDT} {1143907200 36000 0 AEST} {1162051200 39600 1 AEDT} {1174752000 36000 0 AEST} {1193500800 39600 1 AEDT} {1207411200 36000 0 AEST} {1223136000 39600 1 AEDT} {1238860800 36000 0 AEST} {1254585600 39600 1 AEDT} {1270310400 36000 0 AEST} {1286035200 39600 1 AEDT} {1301760000 36000 0 AEST} {1317484800 39600 1 AEDT} {1333209600 36000 0 AEST} {1349539200 39600 1 AEDT} {1365264000 36000 0 AEST} {1380988800 39600 1 AEDT} {1396713600 36000 0 AEST} {1412438400 39600 1 AEDT} {1428163200 36000 0 AEST} {1443888000 39600 1 AEDT} {1459612800 36000 0 AEST} {1475337600 39600 1 AEDT} {1491062400 36000 0 AEST} {1506787200 39600 1 AEDT} {1522512000 36000 0 AEST} {1538841600 39600 1 AEDT} {1554566400 36000 0 AEST} {1570291200 39600 1 AEDT} {1586016000 36000 0 AEST} {1601740800 39600 1 AEDT} {1617465600 36000 0 AEST} {1633190400 39600 1 AEDT} {1648915200 36000 0 AEST} {1664640000 39600 1 AEDT} {1680364800 36000 0 AEST} {1696089600 39600 1 AEDT} {1712419200 36000 0 AEST} {1728144000 39600 1 AEDT} {1743868800 36000 0 AEST} {1759593600 39600 1 AEDT} {1775318400 36000 0 AEST} {1791043200 39600 1 AEDT} {1806768000 36000 0 AEST} {1822492800 39600 1 AEDT} {1838217600 36000 0 AEST} {1853942400 39600 1 AEDT} {1869667200 36000 0 AEST} {1885996800 39600 1 AEDT} {1901721600 36000 0 AEST} {1917446400 39600 1 AEDT} {1933171200 36000 0 AEST} {1948896000 39600 1 AEDT} {1964620800 36000 0 AEST} {1980345600 39600 1 AEDT} {1996070400 36000 0 AEST} {2011795200 39600 1 AEDT} {2027520000 36000 0 AEST} {2043244800 39600 1 AEDT} {2058969600 36000 0 AEST} {2075299200 39600 1 AEDT} {2091024000 36000 0 AEST} {2106748800 39600 1 AEDT} {2122473600 36000 0 AEST} {2138198400 39600 1 AEDT} {2153923200 36000 0 AEST} {2169648000 39600 1 AEDT} {2185372800 36000 0 AEST} {2201097600 39600 1 AEDT} {2216822400 36000 0 AEST} {2233152000 39600 1 AEDT} {2248876800 36000 0 AEST} {2264601600 39600 1 AEDT} {2280326400 36000 0 AEST} {2296051200 39600 1 AEDT} {2311776000 36000 0 AEST} {2327500800 39600 1 AEDT} {2343225600 36000 0 AEST} {2358950400 39600 1 AEDT} {2374675200 36000 0 AEST} {2390400000 39600 1 AEDT} {2406124800 36000 0 AEST} {2422454400 39600 1 AEDT} {2438179200 36000 0 AEST} {2453904000 39600 1 AEDT} {2469628800 36000 0 AEST} {2485353600 39600 1 AEDT} {2501078400 36000 0 AEST} {2516803200 39600 1 AEDT} {2532528000 36000 0 AEST} {2548252800 39600 1 AEDT} {2563977600 36000 0 AEST} {2579702400 39600 1 AEDT} {2596032000 36000 0 AEST} {2611756800 39600 1 AEDT} {2627481600 36000 0 AEST} {2643206400 39600 1 AEDT} {2658931200 36000 0 AEST} {2674656000 39600 1 AEDT} {2690380800 36000 0 AEST} {2706105600 39600 1 AEDT} {2721830400 36000 0 AEST} {2737555200 39600 1 AEDT} {2753280000 36000 0 AEST} {2769609600 39600 1 AEDT} {2785334400 36000 0 AEST} {2801059200 39600 1 AEDT} {2816784000 36000 0 AEST} {2832508800 39600 1 AEDT} {2848233600 36000 0 AEST} {2863958400 39600 1 AEDT} {2879683200 36000 0 AEST} {2895408000 39600 1 AEDT} {2911132800 36000 0 AEST} {2926857600 39600 1 AEDT} {2942582400 36000 0 AEST} {2958912000 39600 1 AEDT} {2974636800 36000 0 AEST} {2990361600 39600 1 AEDT} {3006086400 36000 0 AEST} {3021811200 39600 1 AEDT} {3037536000 36000 0 AEST} {3053260800 39600 1 AEDT} {3068985600 36000 0 AEST} {3084710400 39600 1 AEDT} {3100435200 36000 0 AEST} {3116764800 39600 1 AEDT} {3132489600 36000 0 AEST} {3148214400 39600 1 AEDT} {3163939200 36000 0 AEST} {3179664000 39600 1 AEDT} {3195388800 36000 0 AEST} {3211113600 39600 1 AEDT} {3226838400 36000 0 AEST} {3242563200 39600 1 AEDT} {3258288000 36000 0 AEST} {3274012800 39600 1 AEDT} {3289737600 36000 0 AEST} {3306067200 39600 1 AEDT} {3321792000 36000 0 AEST} {3337516800 39600 1 AEDT} {3353241600 36000 0 AEST} {3368966400 39600 1 AEDT} {3384691200 36000 0 AEST} {3400416000 39600 1 AEDT} {3416140800 36000 0 AEST} {3431865600 39600 1 AEDT} {3447590400 36000 0 AEST} {3463315200 39600 1 AEDT} {3479644800 36000 0 AEST} {3495369600 39600 1 AEDT} {3511094400 36000 0 AEST} {3526819200 39600 1 AEDT} {3542544000 36000 0 AEST} {3558268800 39600 1 AEDT} {3573993600 36000 0 AEST} {3589718400 39600 1 AEDT} {3605443200 36000 0 AEST} {3621168000 39600 1 AEDT} {3636892800 36000 0 AEST} {3653222400 39600 1 AEDT} {3668947200 36000 0 AEST} {3684672000 39600 1 AEDT} {3700396800 36000 0 AEST} {3716121600 39600 1 AEDT} {3731846400 36000 0 AEST} {3747571200 39600 1 AEDT} {3763296000 36000 0 AEST} {3779020800 39600 1 AEDT} {3794745600 36000 0 AEST} {3810470400 39600 1 AEDT} {3826195200 36000 0 AEST} {3842524800 39600 1 AEDT} {3858249600 36000 0 AEST} {3873974400 39600 1 AEDT} {3889699200 36000 0 AEST} {3905424000 39600 1 AEDT} {3921148800 36000 0 AEST} {3936873600 39600 1 AEDT} {3952598400 36000 0 AEST} {3968323200 39600 1 AEDT} {3984048000 36000 0 AEST} {4000377600 39600 1 AEDT} {4016102400 36000 0 AEST} {4031827200 39600 1 AEDT} {4047552000 36000 0 AEST} {4063276800 39600 1 AEDT} {4079001600 36000 0 AEST} {4094726400 39600 1 AEDT} } tcl9.0.3/library/tzdata/Australia/South0000664000175000017500000000030115035744305017455 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Adelaide)]} { LoadTimeZoneFile Australia/Adelaide } set TZData(:Australia/South) $TZData(:Australia/Adelaide) tcl9.0.3/library/tzdata/Australia/Queensland0000664000175000017500000000030615035744305020457 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Brisbane)]} { LoadTimeZoneFile Australia/Brisbane } set TZData(:Australia/Queensland) $TZData(:Australia/Brisbane) tcl9.0.3/library/tzdata/Australia/Perth0000664000175000017500000000131215035744305017440 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Perth) { {-9223372036854775808 27804 0 LMT} {-2337925404 28800 0 AWST} {-1672552800 32400 1 AWDT} {-1665381600 28800 0 AWST} {-883634400 32400 1 AWDT} {-876117600 28800 0 AWST} {-860392800 32400 1 AWDT} {-844668000 28800 0 AWST} {-836470800 32400 0 AWST} {152042400 32400 1 AWDT} {162928800 28800 0 AWST} {436298400 32400 1 AWDT} {447184800 28800 0 AWST} {690314400 32400 1 AWDT} {699386400 28800 0 AWST} {1165082400 32400 1 AWDT} {1174759200 28800 0 AWST} {1193508000 32400 1 AWDT} {1206813600 28800 0 AWST} {1224957600 32400 1 AWDT} {1238263200 28800 0 AWST} } tcl9.0.3/library/tzdata/Australia/NSW0000664000175000017500000000027115035744305017030 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Sydney)]} { LoadTimeZoneFile Australia/Sydney } set TZData(:Australia/NSW) $TZData(:Australia/Sydney) tcl9.0.3/library/tzdata/Australia/North0000664000175000017500000000027315035744305017455 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Darwin)]} { LoadTimeZoneFile Australia/Darwin } set TZData(:Australia/North) $TZData(:Australia/Darwin) tcl9.0.3/library/tzdata/Australia/Melbourne0000664000175000017500000001760515035744305020322 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Melbourne) { {-9223372036854775808 34792 0 LMT} {-2364111592 36000 0 AEST} {-1672560000 39600 1 AEDT} {-1665388800 36000 0 AEST} {-883641600 39600 1 AEDT} {-876124800 36000 0 AEST} {-860400000 39600 1 AEDT} {-844675200 36000 0 AEST} {-828345600 39600 1 AEDT} {-813225600 36000 0 AEST} {31500000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {89136000 39600 1 AEDT} {100022400 36000 0 AEST} {120585600 39600 1 AEDT} {131472000 36000 0 AEST} {152035200 39600 1 AEDT} {162921600 36000 0 AEST} {183484800 39600 1 AEDT} {194976000 36000 0 AEST} {215539200 39600 1 AEDT} {226425600 36000 0 AEST} {246988800 39600 1 AEDT} {257875200 36000 0 AEST} {278438400 39600 1 AEDT} {289324800 36000 0 AEST} {309888000 39600 1 AEDT} {320774400 36000 0 AEST} {341337600 39600 1 AEDT} {352224000 36000 0 AEST} {372787200 39600 1 AEDT} {384278400 36000 0 AEST} {404841600 39600 1 AEDT} {415728000 36000 0 AEST} {436291200 39600 1 AEDT} {447177600 36000 0 AEST} {467740800 39600 1 AEDT} {478627200 36000 0 AEST} {499190400 39600 1 AEDT} {511286400 36000 0 AEST} {530035200 39600 1 AEDT} {542736000 36000 0 AEST} {561484800 39600 1 AEDT} {574790400 36000 0 AEST} {594144000 39600 1 AEDT} {606240000 36000 0 AEST} {625593600 39600 1 AEDT} {637689600 36000 0 AEST} {657043200 39600 1 AEDT} {667929600 36000 0 AEST} {688492800 39600 1 AEDT} {699379200 36000 0 AEST} {719942400 39600 1 AEDT} {731433600 36000 0 AEST} {751996800 39600 1 AEDT} {762883200 36000 0 AEST} {783446400 39600 1 AEDT} {796147200 36000 0 AEST} {814896000 39600 1 AEDT} {828201600 36000 0 AEST} {846345600 39600 1 AEDT} {859651200 36000 0 AEST} {877795200 39600 1 AEDT} {891100800 36000 0 AEST} {909244800 39600 1 AEDT} {922550400 36000 0 AEST} {941299200 39600 1 AEDT} {954000000 36000 0 AEST} {967305600 39600 1 AEDT} {985449600 36000 0 AEST} {1004198400 39600 1 AEDT} {1017504000 36000 0 AEST} {1035648000 39600 1 AEDT} {1048953600 36000 0 AEST} {1067097600 39600 1 AEDT} {1080403200 36000 0 AEST} {1099152000 39600 1 AEDT} {1111852800 36000 0 AEST} {1130601600 39600 1 AEDT} {1143907200 36000 0 AEST} {1162051200 39600 1 AEDT} {1174752000 36000 0 AEST} {1193500800 39600 1 AEDT} {1207411200 36000 0 AEST} {1223136000 39600 1 AEDT} {1238860800 36000 0 AEST} {1254585600 39600 1 AEDT} {1270310400 36000 0 AEST} {1286035200 39600 1 AEDT} {1301760000 36000 0 AEST} {1317484800 39600 1 AEDT} {1333209600 36000 0 AEST} {1349539200 39600 1 AEDT} {1365264000 36000 0 AEST} {1380988800 39600 1 AEDT} {1396713600 36000 0 AEST} {1412438400 39600 1 AEDT} {1428163200 36000 0 AEST} {1443888000 39600 1 AEDT} {1459612800 36000 0 AEST} {1475337600 39600 1 AEDT} {1491062400 36000 0 AEST} {1506787200 39600 1 AEDT} {1522512000 36000 0 AEST} {1538841600 39600 1 AEDT} {1554566400 36000 0 AEST} {1570291200 39600 1 AEDT} {1586016000 36000 0 AEST} {1601740800 39600 1 AEDT} {1617465600 36000 0 AEST} {1633190400 39600 1 AEDT} {1648915200 36000 0 AEST} {1664640000 39600 1 AEDT} {1680364800 36000 0 AEST} {1696089600 39600 1 AEDT} {1712419200 36000 0 AEST} {1728144000 39600 1 AEDT} {1743868800 36000 0 AEST} {1759593600 39600 1 AEDT} {1775318400 36000 0 AEST} {1791043200 39600 1 AEDT} {1806768000 36000 0 AEST} {1822492800 39600 1 AEDT} {1838217600 36000 0 AEST} {1853942400 39600 1 AEDT} {1869667200 36000 0 AEST} {1885996800 39600 1 AEDT} {1901721600 36000 0 AEST} {1917446400 39600 1 AEDT} {1933171200 36000 0 AEST} {1948896000 39600 1 AEDT} {1964620800 36000 0 AEST} {1980345600 39600 1 AEDT} {1996070400 36000 0 AEST} {2011795200 39600 1 AEDT} {2027520000 36000 0 AEST} {2043244800 39600 1 AEDT} {2058969600 36000 0 AEST} {2075299200 39600 1 AEDT} {2091024000 36000 0 AEST} {2106748800 39600 1 AEDT} {2122473600 36000 0 AEST} {2138198400 39600 1 AEDT} {2153923200 36000 0 AEST} {2169648000 39600 1 AEDT} {2185372800 36000 0 AEST} {2201097600 39600 1 AEDT} {2216822400 36000 0 AEST} {2233152000 39600 1 AEDT} {2248876800 36000 0 AEST} {2264601600 39600 1 AEDT} {2280326400 36000 0 AEST} {2296051200 39600 1 AEDT} {2311776000 36000 0 AEST} {2327500800 39600 1 AEDT} {2343225600 36000 0 AEST} {2358950400 39600 1 AEDT} {2374675200 36000 0 AEST} {2390400000 39600 1 AEDT} {2406124800 36000 0 AEST} {2422454400 39600 1 AEDT} {2438179200 36000 0 AEST} {2453904000 39600 1 AEDT} {2469628800 36000 0 AEST} {2485353600 39600 1 AEDT} {2501078400 36000 0 AEST} {2516803200 39600 1 AEDT} {2532528000 36000 0 AEST} {2548252800 39600 1 AEDT} {2563977600 36000 0 AEST} {2579702400 39600 1 AEDT} {2596032000 36000 0 AEST} {2611756800 39600 1 AEDT} {2627481600 36000 0 AEST} {2643206400 39600 1 AEDT} {2658931200 36000 0 AEST} {2674656000 39600 1 AEDT} {2690380800 36000 0 AEST} {2706105600 39600 1 AEDT} {2721830400 36000 0 AEST} {2737555200 39600 1 AEDT} {2753280000 36000 0 AEST} {2769609600 39600 1 AEDT} {2785334400 36000 0 AEST} {2801059200 39600 1 AEDT} {2816784000 36000 0 AEST} {2832508800 39600 1 AEDT} {2848233600 36000 0 AEST} {2863958400 39600 1 AEDT} {2879683200 36000 0 AEST} {2895408000 39600 1 AEDT} {2911132800 36000 0 AEST} {2926857600 39600 1 AEDT} {2942582400 36000 0 AEST} {2958912000 39600 1 AEDT} {2974636800 36000 0 AEST} {2990361600 39600 1 AEDT} {3006086400 36000 0 AEST} {3021811200 39600 1 AEDT} {3037536000 36000 0 AEST} {3053260800 39600 1 AEDT} {3068985600 36000 0 AEST} {3084710400 39600 1 AEDT} {3100435200 36000 0 AEST} {3116764800 39600 1 AEDT} {3132489600 36000 0 AEST} {3148214400 39600 1 AEDT} {3163939200 36000 0 AEST} {3179664000 39600 1 AEDT} {3195388800 36000 0 AEST} {3211113600 39600 1 AEDT} {3226838400 36000 0 AEST} {3242563200 39600 1 AEDT} {3258288000 36000 0 AEST} {3274012800 39600 1 AEDT} {3289737600 36000 0 AEST} {3306067200 39600 1 AEDT} {3321792000 36000 0 AEST} {3337516800 39600 1 AEDT} {3353241600 36000 0 AEST} {3368966400 39600 1 AEDT} {3384691200 36000 0 AEST} {3400416000 39600 1 AEDT} {3416140800 36000 0 AEST} {3431865600 39600 1 AEDT} {3447590400 36000 0 AEST} {3463315200 39600 1 AEDT} {3479644800 36000 0 AEST} {3495369600 39600 1 AEDT} {3511094400 36000 0 AEST} {3526819200 39600 1 AEDT} {3542544000 36000 0 AEST} {3558268800 39600 1 AEDT} {3573993600 36000 0 AEST} {3589718400 39600 1 AEDT} {3605443200 36000 0 AEST} {3621168000 39600 1 AEDT} {3636892800 36000 0 AEST} {3653222400 39600 1 AEDT} {3668947200 36000 0 AEST} {3684672000 39600 1 AEDT} {3700396800 36000 0 AEST} {3716121600 39600 1 AEDT} {3731846400 36000 0 AEST} {3747571200 39600 1 AEDT} {3763296000 36000 0 AEST} {3779020800 39600 1 AEDT} {3794745600 36000 0 AEST} {3810470400 39600 1 AEDT} {3826195200 36000 0 AEST} {3842524800 39600 1 AEDT} {3858249600 36000 0 AEST} {3873974400 39600 1 AEDT} {3889699200 36000 0 AEST} {3905424000 39600 1 AEDT} {3921148800 36000 0 AEST} {3936873600 39600 1 AEDT} {3952598400 36000 0 AEST} {3968323200 39600 1 AEDT} {3984048000 36000 0 AEST} {4000377600 39600 1 AEDT} {4016102400 36000 0 AEST} {4031827200 39600 1 AEDT} {4047552000 36000 0 AEST} {4063276800 39600 1 AEDT} {4079001600 36000 0 AEST} {4094726400 39600 1 AEDT} } tcl9.0.3/library/tzdata/Australia/Lord_Howe0000664000175000017500000001653715035744305020257 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Lord_Howe) { {-9223372036854775808 38180 0 LMT} {-2364114980 36000 0 AEST} {352216800 37800 0 +1030} {372785400 41400 1 +1130} {384273000 37800 0 +1030} {404839800 41400 1 +1130} {415722600 37800 0 +1030} {436289400 41400 1 +1130} {447172200 37800 0 +1030} {467739000 41400 1 +1130} {478621800 37800 0 +1030} {488984400 37800 0 +1030} {499188600 39600 1 +1100} {511282800 37800 0 +1030} {530033400 39600 1 +1100} {542732400 37800 0 +1030} {562087800 39600 1 +1100} {574786800 37800 0 +1030} {594142200 39600 1 +1100} {606236400 37800 0 +1030} {625591800 39600 1 +1100} {636476400 37800 0 +1030} {657041400 39600 1 +1100} {667926000 37800 0 +1030} {688491000 39600 1 +1100} {699375600 37800 0 +1030} {719940600 39600 1 +1100} {731430000 37800 0 +1030} {751995000 39600 1 +1100} {762879600 37800 0 +1030} {783444600 39600 1 +1100} {794329200 37800 0 +1030} {814894200 39600 1 +1100} {828198000 37800 0 +1030} {846343800 39600 1 +1100} {859647600 37800 0 +1030} {877793400 39600 1 +1100} {891097200 37800 0 +1030} {909243000 39600 1 +1100} {922546800 37800 0 +1030} {941297400 39600 1 +1100} {953996400 37800 0 +1030} {967303800 39600 1 +1100} {985446000 37800 0 +1030} {1004196600 39600 1 +1100} {1017500400 37800 0 +1030} {1035646200 39600 1 +1100} {1048950000 37800 0 +1030} {1067095800 39600 1 +1100} {1080399600 37800 0 +1030} {1099150200 39600 1 +1100} {1111849200 37800 0 +1030} {1130599800 39600 1 +1100} {1143903600 37800 0 +1030} {1162049400 39600 1 +1100} {1174748400 37800 0 +1030} {1193499000 39600 1 +1100} {1207407600 37800 0 +1030} {1223134200 39600 1 +1100} {1238857200 37800 0 +1030} {1254583800 39600 1 +1100} {1270306800 37800 0 +1030} {1286033400 39600 1 +1100} {1301756400 37800 0 +1030} {1317483000 39600 1 +1100} {1333206000 37800 0 +1030} {1349537400 39600 1 +1100} {1365260400 37800 0 +1030} {1380987000 39600 1 +1100} {1396710000 37800 0 +1030} {1412436600 39600 1 +1100} {1428159600 37800 0 +1030} {1443886200 39600 1 +1100} {1459609200 37800 0 +1030} {1475335800 39600 1 +1100} {1491058800 37800 0 +1030} {1506785400 39600 1 +1100} {1522508400 37800 0 +1030} {1538839800 39600 1 +1100} {1554562800 37800 0 +1030} {1570289400 39600 1 +1100} {1586012400 37800 0 +1030} {1601739000 39600 1 +1100} {1617462000 37800 0 +1030} {1633188600 39600 1 +1100} {1648911600 37800 0 +1030} {1664638200 39600 1 +1100} {1680361200 37800 0 +1030} {1696087800 39600 1 +1100} {1712415600 37800 0 +1030} {1728142200 39600 1 +1100} {1743865200 37800 0 +1030} {1759591800 39600 1 +1100} {1775314800 37800 0 +1030} {1791041400 39600 1 +1100} {1806764400 37800 0 +1030} {1822491000 39600 1 +1100} {1838214000 37800 0 +1030} {1853940600 39600 1 +1100} {1869663600 37800 0 +1030} {1885995000 39600 1 +1100} {1901718000 37800 0 +1030} {1917444600 39600 1 +1100} {1933167600 37800 0 +1030} {1948894200 39600 1 +1100} {1964617200 37800 0 +1030} {1980343800 39600 1 +1100} {1996066800 37800 0 +1030} {2011793400 39600 1 +1100} {2027516400 37800 0 +1030} {2043243000 39600 1 +1100} {2058966000 37800 0 +1030} {2075297400 39600 1 +1100} {2091020400 37800 0 +1030} {2106747000 39600 1 +1100} {2122470000 37800 0 +1030} {2138196600 39600 1 +1100} {2153919600 37800 0 +1030} {2169646200 39600 1 +1100} {2185369200 37800 0 +1030} {2201095800 39600 1 +1100} {2216818800 37800 0 +1030} {2233150200 39600 1 +1100} {2248873200 37800 0 +1030} {2264599800 39600 1 +1100} {2280322800 37800 0 +1030} {2296049400 39600 1 +1100} {2311772400 37800 0 +1030} {2327499000 39600 1 +1100} {2343222000 37800 0 +1030} {2358948600 39600 1 +1100} {2374671600 37800 0 +1030} {2390398200 39600 1 +1100} {2406121200 37800 0 +1030} {2422452600 39600 1 +1100} {2438175600 37800 0 +1030} {2453902200 39600 1 +1100} {2469625200 37800 0 +1030} {2485351800 39600 1 +1100} {2501074800 37800 0 +1030} {2516801400 39600 1 +1100} {2532524400 37800 0 +1030} {2548251000 39600 1 +1100} {2563974000 37800 0 +1030} {2579700600 39600 1 +1100} {2596028400 37800 0 +1030} {2611755000 39600 1 +1100} {2627478000 37800 0 +1030} {2643204600 39600 1 +1100} {2658927600 37800 0 +1030} {2674654200 39600 1 +1100} {2690377200 37800 0 +1030} {2706103800 39600 1 +1100} {2721826800 37800 0 +1030} {2737553400 39600 1 +1100} {2753276400 37800 0 +1030} {2769607800 39600 1 +1100} {2785330800 37800 0 +1030} {2801057400 39600 1 +1100} {2816780400 37800 0 +1030} {2832507000 39600 1 +1100} {2848230000 37800 0 +1030} {2863956600 39600 1 +1100} {2879679600 37800 0 +1030} {2895406200 39600 1 +1100} {2911129200 37800 0 +1030} {2926855800 39600 1 +1100} {2942578800 37800 0 +1030} {2958910200 39600 1 +1100} {2974633200 37800 0 +1030} {2990359800 39600 1 +1100} {3006082800 37800 0 +1030} {3021809400 39600 1 +1100} {3037532400 37800 0 +1030} {3053259000 39600 1 +1100} {3068982000 37800 0 +1030} {3084708600 39600 1 +1100} {3100431600 37800 0 +1030} {3116763000 39600 1 +1100} {3132486000 37800 0 +1030} {3148212600 39600 1 +1100} {3163935600 37800 0 +1030} {3179662200 39600 1 +1100} {3195385200 37800 0 +1030} {3211111800 39600 1 +1100} {3226834800 37800 0 +1030} {3242561400 39600 1 +1100} {3258284400 37800 0 +1030} {3274011000 39600 1 +1100} {3289734000 37800 0 +1030} {3306065400 39600 1 +1100} {3321788400 37800 0 +1030} {3337515000 39600 1 +1100} {3353238000 37800 0 +1030} {3368964600 39600 1 +1100} {3384687600 37800 0 +1030} {3400414200 39600 1 +1100} {3416137200 37800 0 +1030} {3431863800 39600 1 +1100} {3447586800 37800 0 +1030} {3463313400 39600 1 +1100} {3479641200 37800 0 +1030} {3495367800 39600 1 +1100} {3511090800 37800 0 +1030} {3526817400 39600 1 +1100} {3542540400 37800 0 +1030} {3558267000 39600 1 +1100} {3573990000 37800 0 +1030} {3589716600 39600 1 +1100} {3605439600 37800 0 +1030} {3621166200 39600 1 +1100} {3636889200 37800 0 +1030} {3653220600 39600 1 +1100} {3668943600 37800 0 +1030} {3684670200 39600 1 +1100} {3700393200 37800 0 +1030} {3716119800 39600 1 +1100} {3731842800 37800 0 +1030} {3747569400 39600 1 +1100} {3763292400 37800 0 +1030} {3779019000 39600 1 +1100} {3794742000 37800 0 +1030} {3810468600 39600 1 +1100} {3826191600 37800 0 +1030} {3842523000 39600 1 +1100} {3858246000 37800 0 +1030} {3873972600 39600 1 +1100} {3889695600 37800 0 +1030} {3905422200 39600 1 +1100} {3921145200 37800 0 +1030} {3936871800 39600 1 +1100} {3952594800 37800 0 +1030} {3968321400 39600 1 +1100} {3984044400 37800 0 +1030} {4000375800 39600 1 +1100} {4016098800 37800 0 +1030} {4031825400 39600 1 +1100} {4047548400 37800 0 +1030} {4063275000 39600 1 +1100} {4078998000 37800 0 +1030} {4094724600 39600 1 +1100} } tcl9.0.3/library/tzdata/Australia/Lindeman0000664000175000017500000000143415035744305020112 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Lindeman) { {-9223372036854775808 35756 0 LMT} {-2366790956 36000 0 AEST} {-1672560000 39600 1 AEDT} {-1665388800 36000 0 AEST} {-883641600 39600 1 AEDT} {-876124800 36000 0 AEST} {-860400000 39600 1 AEDT} {-844675200 36000 0 AEST} {-828345600 39600 1 AEDT} {-813225600 36000 0 AEST} {31500000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {625593600 39600 1 AEDT} {636480000 36000 0 AEST} {657043200 39600 1 AEDT} {667929600 36000 0 AEST} {688492800 39600 1 AEDT} {699379200 36000 0 AEST} {709912800 36000 0 AEST} {719942400 39600 1 AEDT} {731433600 36000 0 AEST} {751996800 39600 1 AEDT} {762883200 36000 0 AEST} } tcl9.0.3/library/tzdata/Australia/LHI0000664000175000017500000000030215035744305016770 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Lord_Howe)]} { LoadTimeZoneFile Australia/Lord_Howe } set TZData(:Australia/LHI) $TZData(:Australia/Lord_Howe) tcl9.0.3/library/tzdata/Australia/Hobart0000664000175000017500000002040115035744305017575 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Hobart) { {-9223372036854775808 35356 0 LMT} {-2345795356 36000 0 AEST} {-1680508800 39600 1 AEDT} {-1665388800 36000 0 AEST} {-1646640000 39600 1 AEDT} {-1635753600 36000 0 AEST} {-1615190400 39600 1 AEDT} {-1604304000 36000 0 AEST} {-1583920800 36000 0 AEST} {-883641600 39600 1 AEDT} {-876124800 36000 0 AEST} {-860400000 39600 1 AEDT} {-844675200 36000 0 AEST} {-828345600 39600 1 AEDT} {-813225600 36000 0 AEST} {-94730400 36000 0 AEST} {-71136000 39600 1 AEDT} {-55411200 36000 0 AEST} {-37267200 39600 1 AEDT} {-25776000 36000 0 AEST} {-5817600 39600 1 AEDT} {5673600 36000 0 AEST} {25632000 39600 1 AEDT} {37728000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {89136000 39600 1 AEDT} {100022400 36000 0 AEST} {120585600 39600 1 AEDT} {131472000 36000 0 AEST} {152035200 39600 1 AEDT} {162921600 36000 0 AEST} {183484800 39600 1 AEDT} {194976000 36000 0 AEST} {215539200 39600 1 AEDT} {226425600 36000 0 AEST} {246988800 39600 1 AEDT} {257875200 36000 0 AEST} {278438400 39600 1 AEDT} {289324800 36000 0 AEST} {309888000 39600 1 AEDT} {320774400 36000 0 AEST} {341337600 39600 1 AEDT} {352224000 36000 0 AEST} {372787200 39600 1 AEDT} {386092800 36000 0 AEST} {404841600 39600 1 AEDT} {417542400 36000 0 AEST} {436291200 39600 1 AEDT} {447177600 36000 0 AEST} {467740800 39600 1 AEDT} {478627200 36000 0 AEST} {499190400 39600 1 AEDT} {510076800 36000 0 AEST} {530035200 39600 1 AEDT} {542736000 36000 0 AEST} {562089600 39600 1 AEDT} {574790400 36000 0 AEST} {594144000 39600 1 AEDT} {606240000 36000 0 AEST} {625593600 39600 1 AEDT} {637689600 36000 0 AEST} {657043200 39600 1 AEDT} {670348800 36000 0 AEST} {686678400 39600 1 AEDT} {701798400 36000 0 AEST} {718128000 39600 1 AEDT} {733248000 36000 0 AEST} {749577600 39600 1 AEDT} {764697600 36000 0 AEST} {781027200 39600 1 AEDT} {796147200 36000 0 AEST} {812476800 39600 1 AEDT} {828201600 36000 0 AEST} {844531200 39600 1 AEDT} {859651200 36000 0 AEST} {875980800 39600 1 AEDT} {891100800 36000 0 AEST} {907430400 39600 1 AEDT} {922550400 36000 0 AEST} {938880000 39600 1 AEDT} {954000000 36000 0 AEST} {967305600 39600 1 AEDT} {985449600 36000 0 AEST} {1002384000 39600 1 AEDT} {1017504000 36000 0 AEST} {1033833600 39600 1 AEDT} {1048953600 36000 0 AEST} {1065283200 39600 1 AEDT} {1080403200 36000 0 AEST} {1096732800 39600 1 AEDT} {1111852800 36000 0 AEST} {1128182400 39600 1 AEDT} {1143907200 36000 0 AEST} {1159632000 39600 1 AEDT} {1174752000 36000 0 AEST} {1191686400 39600 1 AEDT} {1207411200 36000 0 AEST} {1223136000 39600 1 AEDT} {1238860800 36000 0 AEST} {1254585600 39600 1 AEDT} {1270310400 36000 0 AEST} {1286035200 39600 1 AEDT} {1301760000 36000 0 AEST} {1317484800 39600 1 AEDT} {1333209600 36000 0 AEST} {1349539200 39600 1 AEDT} {1365264000 36000 0 AEST} {1380988800 39600 1 AEDT} {1396713600 36000 0 AEST} {1412438400 39600 1 AEDT} {1428163200 36000 0 AEST} {1443888000 39600 1 AEDT} {1459612800 36000 0 AEST} {1475337600 39600 1 AEDT} {1491062400 36000 0 AEST} {1506787200 39600 1 AEDT} {1522512000 36000 0 AEST} {1538841600 39600 1 AEDT} {1554566400 36000 0 AEST} {1570291200 39600 1 AEDT} {1586016000 36000 0 AEST} {1601740800 39600 1 AEDT} {1617465600 36000 0 AEST} {1633190400 39600 1 AEDT} {1648915200 36000 0 AEST} {1664640000 39600 1 AEDT} {1680364800 36000 0 AEST} {1696089600 39600 1 AEDT} {1712419200 36000 0 AEST} {1728144000 39600 1 AEDT} {1743868800 36000 0 AEST} {1759593600 39600 1 AEDT} {1775318400 36000 0 AEST} {1791043200 39600 1 AEDT} {1806768000 36000 0 AEST} {1822492800 39600 1 AEDT} {1838217600 36000 0 AEST} {1853942400 39600 1 AEDT} {1869667200 36000 0 AEST} {1885996800 39600 1 AEDT} {1901721600 36000 0 AEST} {1917446400 39600 1 AEDT} {1933171200 36000 0 AEST} {1948896000 39600 1 AEDT} {1964620800 36000 0 AEST} {1980345600 39600 1 AEDT} {1996070400 36000 0 AEST} {2011795200 39600 1 AEDT} {2027520000 36000 0 AEST} {2043244800 39600 1 AEDT} {2058969600 36000 0 AEST} {2075299200 39600 1 AEDT} {2091024000 36000 0 AEST} {2106748800 39600 1 AEDT} {2122473600 36000 0 AEST} {2138198400 39600 1 AEDT} {2153923200 36000 0 AEST} {2169648000 39600 1 AEDT} {2185372800 36000 0 AEST} {2201097600 39600 1 AEDT} {2216822400 36000 0 AEST} {2233152000 39600 1 AEDT} {2248876800 36000 0 AEST} {2264601600 39600 1 AEDT} {2280326400 36000 0 AEST} {2296051200 39600 1 AEDT} {2311776000 36000 0 AEST} {2327500800 39600 1 AEDT} {2343225600 36000 0 AEST} {2358950400 39600 1 AEDT} {2374675200 36000 0 AEST} {2390400000 39600 1 AEDT} {2406124800 36000 0 AEST} {2422454400 39600 1 AEDT} {2438179200 36000 0 AEST} {2453904000 39600 1 AEDT} {2469628800 36000 0 AEST} {2485353600 39600 1 AEDT} {2501078400 36000 0 AEST} {2516803200 39600 1 AEDT} {2532528000 36000 0 AEST} {2548252800 39600 1 AEDT} {2563977600 36000 0 AEST} {2579702400 39600 1 AEDT} {2596032000 36000 0 AEST} {2611756800 39600 1 AEDT} {2627481600 36000 0 AEST} {2643206400 39600 1 AEDT} {2658931200 36000 0 AEST} {2674656000 39600 1 AEDT} {2690380800 36000 0 AEST} {2706105600 39600 1 AEDT} {2721830400 36000 0 AEST} {2737555200 39600 1 AEDT} {2753280000 36000 0 AEST} {2769609600 39600 1 AEDT} {2785334400 36000 0 AEST} {2801059200 39600 1 AEDT} {2816784000 36000 0 AEST} {2832508800 39600 1 AEDT} {2848233600 36000 0 AEST} {2863958400 39600 1 AEDT} {2879683200 36000 0 AEST} {2895408000 39600 1 AEDT} {2911132800 36000 0 AEST} {2926857600 39600 1 AEDT} {2942582400 36000 0 AEST} {2958912000 39600 1 AEDT} {2974636800 36000 0 AEST} {2990361600 39600 1 AEDT} {3006086400 36000 0 AEST} {3021811200 39600 1 AEDT} {3037536000 36000 0 AEST} {3053260800 39600 1 AEDT} {3068985600 36000 0 AEST} {3084710400 39600 1 AEDT} {3100435200 36000 0 AEST} {3116764800 39600 1 AEDT} {3132489600 36000 0 AEST} {3148214400 39600 1 AEDT} {3163939200 36000 0 AEST} {3179664000 39600 1 AEDT} {3195388800 36000 0 AEST} {3211113600 39600 1 AEDT} {3226838400 36000 0 AEST} {3242563200 39600 1 AEDT} {3258288000 36000 0 AEST} {3274012800 39600 1 AEDT} {3289737600 36000 0 AEST} {3306067200 39600 1 AEDT} {3321792000 36000 0 AEST} {3337516800 39600 1 AEDT} {3353241600 36000 0 AEST} {3368966400 39600 1 AEDT} {3384691200 36000 0 AEST} {3400416000 39600 1 AEDT} {3416140800 36000 0 AEST} {3431865600 39600 1 AEDT} {3447590400 36000 0 AEST} {3463315200 39600 1 AEDT} {3479644800 36000 0 AEST} {3495369600 39600 1 AEDT} {3511094400 36000 0 AEST} {3526819200 39600 1 AEDT} {3542544000 36000 0 AEST} {3558268800 39600 1 AEDT} {3573993600 36000 0 AEST} {3589718400 39600 1 AEDT} {3605443200 36000 0 AEST} {3621168000 39600 1 AEDT} {3636892800 36000 0 AEST} {3653222400 39600 1 AEDT} {3668947200 36000 0 AEST} {3684672000 39600 1 AEDT} {3700396800 36000 0 AEST} {3716121600 39600 1 AEDT} {3731846400 36000 0 AEST} {3747571200 39600 1 AEDT} {3763296000 36000 0 AEST} {3779020800 39600 1 AEDT} {3794745600 36000 0 AEST} {3810470400 39600 1 AEDT} {3826195200 36000 0 AEST} {3842524800 39600 1 AEDT} {3858249600 36000 0 AEST} {3873974400 39600 1 AEDT} {3889699200 36000 0 AEST} {3905424000 39600 1 AEDT} {3921148800 36000 0 AEST} {3936873600 39600 1 AEDT} {3952598400 36000 0 AEST} {3968323200 39600 1 AEDT} {3984048000 36000 0 AEST} {4000377600 39600 1 AEDT} {4016102400 36000 0 AEST} {4031827200 39600 1 AEDT} {4047552000 36000 0 AEST} {4063276800 39600 1 AEDT} {4079001600 36000 0 AEST} {4094726400 39600 1 AEDT} } tcl9.0.3/library/tzdata/Australia/Eucla0000664000175000017500000000133615035744305017415 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Eucla) { {-9223372036854775808 30928 0 LMT} {-2337928528 31500 0 +0845} {-1672555500 35100 1 +0945} {-1665384300 31500 0 +0845} {-883637100 35100 1 +0945} {-876120300 31500 0 +0845} {-860395500 35100 1 +0945} {-844670700 31500 0 +0845} {-836473500 35100 0 +0945} {152039700 35100 1 +0945} {162926100 31500 0 +0845} {436295700 35100 1 +0945} {447182100 31500 0 +0845} {690311700 35100 1 +0945} {699383700 31500 0 +0845} {1165079700 35100 1 +0945} {1174756500 31500 0 +0845} {1193505300 35100 1 +0945} {1206810900 31500 0 +0845} {1224954900 35100 1 +0945} {1238260500 31500 0 +0845} } tcl9.0.3/library/tzdata/Australia/Darwin0000664000175000017500000000064615035744305017613 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Darwin) { {-9223372036854775808 31400 0 LMT} {-2364108200 32400 0 ACST} {-2230189200 34200 0 ACST} {-1672558200 37800 1 ACDT} {-1665387000 34200 0 ACST} {-883639800 37800 1 ACDT} {-876123000 34200 0 ACST} {-860398200 37800 1 ACDT} {-844673400 34200 0 ACST} {-828343800 37800 1 ACDT} {-813223800 34200 0 ACST} } tcl9.0.3/library/tzdata/Australia/Currie0000664000175000017500000000027415035744305017615 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Hobart)]} { LoadTimeZoneFile Australia/Hobart } set TZData(:Australia/Currie) $TZData(:Australia/Hobart) tcl9.0.3/library/tzdata/Australia/Canberra0000664000175000017500000000027615035744305020103 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Sydney)]} { LoadTimeZoneFile Australia/Sydney } set TZData(:Australia/Canberra) $TZData(:Australia/Sydney) tcl9.0.3/library/tzdata/Australia/Broken_Hill0000664000175000017500000001774215035744305020564 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Broken_Hill) { {-9223372036854775808 33948 0 LMT} {-2364110748 36000 0 AEST} {-2314951200 32400 0 ACST} {-2230189200 34200 0 ACST} {-1672558200 37800 1 ACDT} {-1665387000 34200 0 ACST} {-883639800 37800 1 ACDT} {-876123000 34200 0 ACST} {-860398200 37800 1 ACDT} {-844673400 34200 0 ACST} {-828343800 37800 1 ACDT} {-813223800 34200 0 ACST} {31501800 34200 0 ACST} {57688200 37800 1 ACDT} {67969800 34200 0 ACST} {89137800 37800 1 ACDT} {100024200 34200 0 ACST} {120587400 37800 1 ACDT} {131473800 34200 0 ACST} {152037000 37800 1 ACDT} {162923400 34200 0 ACST} {183486600 37800 1 ACDT} {194977800 34200 0 ACST} {215541000 37800 1 ACDT} {226427400 34200 0 ACST} {246990600 37800 1 ACDT} {257877000 34200 0 ACST} {278440200 37800 1 ACDT} {289326600 34200 0 ACST} {309889800 37800 1 ACDT} {320776200 34200 0 ACST} {341339400 37800 1 ACDT} {352225800 34200 0 ACST} {372789000 37800 1 ACDT} {386699400 34200 0 ACST} {404843400 37800 1 ACDT} {415729800 34200 0 ACST} {436293000 37800 1 ACDT} {447179400 34200 0 ACST} {467742600 37800 1 ACDT} {478629000 34200 0 ACST} {499192200 37800 1 ACDT} {511288200 34200 0 ACST} {530037000 37800 1 ACDT} {542737800 34200 0 ACST} {562091400 37800 1 ACDT} {574792200 34200 0 ACST} {594145800 37800 1 ACDT} {606241800 34200 0 ACST} {625595400 37800 1 ACDT} {636481800 34200 0 ACST} {657045000 37800 1 ACDT} {667931400 34200 0 ACST} {688494600 37800 1 ACDT} {699381000 34200 0 ACST} {719944200 37800 1 ACDT} {731435400 34200 0 ACST} {751998600 37800 1 ACDT} {762885000 34200 0 ACST} {783448200 37800 1 ACDT} {794334600 34200 0 ACST} {814897800 37800 1 ACDT} {828203400 34200 0 ACST} {846347400 37800 1 ACDT} {859653000 34200 0 ACST} {877797000 37800 1 ACDT} {891102600 34200 0 ACST} {909246600 37800 1 ACDT} {922552200 34200 0 ACST} {941301000 37800 1 ACDT} {946647000 37800 0 ACST} {954001800 34200 0 ACST} {972750600 37800 1 ACDT} {985451400 34200 0 ACST} {1004200200 37800 1 ACDT} {1017505800 34200 0 ACST} {1035649800 37800 1 ACDT} {1048955400 34200 0 ACST} {1067099400 37800 1 ACDT} {1080405000 34200 0 ACST} {1099153800 37800 1 ACDT} {1111854600 34200 0 ACST} {1130603400 37800 1 ACDT} {1143909000 34200 0 ACST} {1162053000 37800 1 ACDT} {1174753800 34200 0 ACST} {1193502600 37800 1 ACDT} {1207413000 34200 0 ACST} {1223137800 37800 1 ACDT} {1238862600 34200 0 ACST} {1254587400 37800 1 ACDT} {1270312200 34200 0 ACST} {1286037000 37800 1 ACDT} {1301761800 34200 0 ACST} {1317486600 37800 1 ACDT} {1333211400 34200 0 ACST} {1349541000 37800 1 ACDT} {1365265800 34200 0 ACST} {1380990600 37800 1 ACDT} {1396715400 34200 0 ACST} {1412440200 37800 1 ACDT} {1428165000 34200 0 ACST} {1443889800 37800 1 ACDT} {1459614600 34200 0 ACST} {1475339400 37800 1 ACDT} {1491064200 34200 0 ACST} {1506789000 37800 1 ACDT} {1522513800 34200 0 ACST} {1538843400 37800 1 ACDT} {1554568200 34200 0 ACST} {1570293000 37800 1 ACDT} {1586017800 34200 0 ACST} {1601742600 37800 1 ACDT} {1617467400 34200 0 ACST} {1633192200 37800 1 ACDT} {1648917000 34200 0 ACST} {1664641800 37800 1 ACDT} {1680366600 34200 0 ACST} {1696091400 37800 1 ACDT} {1712421000 34200 0 ACST} {1728145800 37800 1 ACDT} {1743870600 34200 0 ACST} {1759595400 37800 1 ACDT} {1775320200 34200 0 ACST} {1791045000 37800 1 ACDT} {1806769800 34200 0 ACST} {1822494600 37800 1 ACDT} {1838219400 34200 0 ACST} {1853944200 37800 1 ACDT} {1869669000 34200 0 ACST} {1885998600 37800 1 ACDT} {1901723400 34200 0 ACST} {1917448200 37800 1 ACDT} {1933173000 34200 0 ACST} {1948897800 37800 1 ACDT} {1964622600 34200 0 ACST} {1980347400 37800 1 ACDT} {1996072200 34200 0 ACST} {2011797000 37800 1 ACDT} {2027521800 34200 0 ACST} {2043246600 37800 1 ACDT} {2058971400 34200 0 ACST} {2075301000 37800 1 ACDT} {2091025800 34200 0 ACST} {2106750600 37800 1 ACDT} {2122475400 34200 0 ACST} {2138200200 37800 1 ACDT} {2153925000 34200 0 ACST} {2169649800 37800 1 ACDT} {2185374600 34200 0 ACST} {2201099400 37800 1 ACDT} {2216824200 34200 0 ACST} {2233153800 37800 1 ACDT} {2248878600 34200 0 ACST} {2264603400 37800 1 ACDT} {2280328200 34200 0 ACST} {2296053000 37800 1 ACDT} {2311777800 34200 0 ACST} {2327502600 37800 1 ACDT} {2343227400 34200 0 ACST} {2358952200 37800 1 ACDT} {2374677000 34200 0 ACST} {2390401800 37800 1 ACDT} {2406126600 34200 0 ACST} {2422456200 37800 1 ACDT} {2438181000 34200 0 ACST} {2453905800 37800 1 ACDT} {2469630600 34200 0 ACST} {2485355400 37800 1 ACDT} {2501080200 34200 0 ACST} {2516805000 37800 1 ACDT} {2532529800 34200 0 ACST} {2548254600 37800 1 ACDT} {2563979400 34200 0 ACST} {2579704200 37800 1 ACDT} {2596033800 34200 0 ACST} {2611758600 37800 1 ACDT} {2627483400 34200 0 ACST} {2643208200 37800 1 ACDT} {2658933000 34200 0 ACST} {2674657800 37800 1 ACDT} {2690382600 34200 0 ACST} {2706107400 37800 1 ACDT} {2721832200 34200 0 ACST} {2737557000 37800 1 ACDT} {2753281800 34200 0 ACST} {2769611400 37800 1 ACDT} {2785336200 34200 0 ACST} {2801061000 37800 1 ACDT} {2816785800 34200 0 ACST} {2832510600 37800 1 ACDT} {2848235400 34200 0 ACST} {2863960200 37800 1 ACDT} {2879685000 34200 0 ACST} {2895409800 37800 1 ACDT} {2911134600 34200 0 ACST} {2926859400 37800 1 ACDT} {2942584200 34200 0 ACST} {2958913800 37800 1 ACDT} {2974638600 34200 0 ACST} {2990363400 37800 1 ACDT} {3006088200 34200 0 ACST} {3021813000 37800 1 ACDT} {3037537800 34200 0 ACST} {3053262600 37800 1 ACDT} {3068987400 34200 0 ACST} {3084712200 37800 1 ACDT} {3100437000 34200 0 ACST} {3116766600 37800 1 ACDT} {3132491400 34200 0 ACST} {3148216200 37800 1 ACDT} {3163941000 34200 0 ACST} {3179665800 37800 1 ACDT} {3195390600 34200 0 ACST} {3211115400 37800 1 ACDT} {3226840200 34200 0 ACST} {3242565000 37800 1 ACDT} {3258289800 34200 0 ACST} {3274014600 37800 1 ACDT} {3289739400 34200 0 ACST} {3306069000 37800 1 ACDT} {3321793800 34200 0 ACST} {3337518600 37800 1 ACDT} {3353243400 34200 0 ACST} {3368968200 37800 1 ACDT} {3384693000 34200 0 ACST} {3400417800 37800 1 ACDT} {3416142600 34200 0 ACST} {3431867400 37800 1 ACDT} {3447592200 34200 0 ACST} {3463317000 37800 1 ACDT} {3479646600 34200 0 ACST} {3495371400 37800 1 ACDT} {3511096200 34200 0 ACST} {3526821000 37800 1 ACDT} {3542545800 34200 0 ACST} {3558270600 37800 1 ACDT} {3573995400 34200 0 ACST} {3589720200 37800 1 ACDT} {3605445000 34200 0 ACST} {3621169800 37800 1 ACDT} {3636894600 34200 0 ACST} {3653224200 37800 1 ACDT} {3668949000 34200 0 ACST} {3684673800 37800 1 ACDT} {3700398600 34200 0 ACST} {3716123400 37800 1 ACDT} {3731848200 34200 0 ACST} {3747573000 37800 1 ACDT} {3763297800 34200 0 ACST} {3779022600 37800 1 ACDT} {3794747400 34200 0 ACST} {3810472200 37800 1 ACDT} {3826197000 34200 0 ACST} {3842526600 37800 1 ACDT} {3858251400 34200 0 ACST} {3873976200 37800 1 ACDT} {3889701000 34200 0 ACST} {3905425800 37800 1 ACDT} {3921150600 34200 0 ACST} {3936875400 37800 1 ACDT} {3952600200 34200 0 ACST} {3968325000 37800 1 ACDT} {3984049800 34200 0 ACST} {4000379400 37800 1 ACDT} {4016104200 34200 0 ACST} {4031829000 37800 1 ACDT} {4047553800 34200 0 ACST} {4063278600 37800 1 ACDT} {4079003400 34200 0 ACST} {4094728200 37800 1 ACDT} } tcl9.0.3/library/tzdata/Australia/Brisbane0000664000175000017500000000121315035744305020103 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Brisbane) { {-9223372036854775808 36728 0 LMT} {-2366791928 36000 0 AEST} {-1672560000 39600 1 AEDT} {-1665388800 36000 0 AEST} {-883641600 39600 1 AEDT} {-876124800 36000 0 AEST} {-860400000 39600 1 AEDT} {-844675200 36000 0 AEST} {-828345600 39600 1 AEDT} {-813225600 36000 0 AEST} {31500000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {625593600 39600 1 AEDT} {636480000 36000 0 AEST} {657043200 39600 1 AEDT} {667929600 36000 0 AEST} {688492800 39600 1 AEDT} {699379200 36000 0 AEST} } tcl9.0.3/library/tzdata/Australia/Adelaide0000664000175000017500000001764315035744305020064 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Australia/Adelaide) { {-9223372036854775808 33260 0 LMT} {-2364110060 32400 0 ACST} {-2230189200 34200 0 ACST} {-1672558200 37800 1 ACDT} {-1665387000 34200 0 ACST} {-883639800 37800 1 ACDT} {-876123000 34200 0 ACST} {-860398200 37800 1 ACDT} {-844673400 34200 0 ACST} {-828343800 37800 1 ACDT} {-813223800 34200 0 ACST} {31501800 34200 0 ACST} {57688200 37800 1 ACDT} {67969800 34200 0 ACST} {89137800 37800 1 ACDT} {100024200 34200 0 ACST} {120587400 37800 1 ACDT} {131473800 34200 0 ACST} {152037000 37800 1 ACDT} {162923400 34200 0 ACST} {183486600 37800 1 ACDT} {194977800 34200 0 ACST} {215541000 37800 1 ACDT} {226427400 34200 0 ACST} {246990600 37800 1 ACDT} {257877000 34200 0 ACST} {278440200 37800 1 ACDT} {289326600 34200 0 ACST} {309889800 37800 1 ACDT} {320776200 34200 0 ACST} {341339400 37800 1 ACDT} {352225800 34200 0 ACST} {372789000 37800 1 ACDT} {384280200 34200 0 ACST} {404843400 37800 1 ACDT} {415729800 34200 0 ACST} {436293000 37800 1 ACDT} {447179400 34200 0 ACST} {467742600 37800 1 ACDT} {478629000 34200 0 ACST} {499192200 37800 1 ACDT} {511288200 34200 0 ACST} {530037000 37800 1 ACDT} {542737800 34200 0 ACST} {562091400 37800 1 ACDT} {574792200 34200 0 ACST} {594145800 37800 1 ACDT} {606241800 34200 0 ACST} {625595400 37800 1 ACDT} {637691400 34200 0 ACST} {657045000 37800 1 ACDT} {667931400 34200 0 ACST} {688494600 37800 1 ACDT} {701195400 34200 0 ACST} {719944200 37800 1 ACDT} {731435400 34200 0 ACST} {751998600 37800 1 ACDT} {764094600 34200 0 ACST} {783448200 37800 1 ACDT} {796149000 34200 0 ACST} {814897800 37800 1 ACDT} {828203400 34200 0 ACST} {846347400 37800 1 ACDT} {859653000 34200 0 ACST} {877797000 37800 1 ACDT} {891102600 34200 0 ACST} {909246600 37800 1 ACDT} {922552200 34200 0 ACST} {941301000 37800 1 ACDT} {954001800 34200 0 ACST} {972750600 37800 1 ACDT} {985451400 34200 0 ACST} {1004200200 37800 1 ACDT} {1017505800 34200 0 ACST} {1035649800 37800 1 ACDT} {1048955400 34200 0 ACST} {1067099400 37800 1 ACDT} {1080405000 34200 0 ACST} {1099153800 37800 1 ACDT} {1111854600 34200 0 ACST} {1130603400 37800 1 ACDT} {1143909000 34200 0 ACST} {1162053000 37800 1 ACDT} {1174753800 34200 0 ACST} {1193502600 37800 1 ACDT} {1207413000 34200 0 ACST} {1223137800 37800 1 ACDT} {1238862600 34200 0 ACST} {1254587400 37800 1 ACDT} {1270312200 34200 0 ACST} {1286037000 37800 1 ACDT} {1301761800 34200 0 ACST} {1317486600 37800 1 ACDT} {1333211400 34200 0 ACST} {1349541000 37800 1 ACDT} {1365265800 34200 0 ACST} {1380990600 37800 1 ACDT} {1396715400 34200 0 ACST} {1412440200 37800 1 ACDT} {1428165000 34200 0 ACST} {1443889800 37800 1 ACDT} {1459614600 34200 0 ACST} {1475339400 37800 1 ACDT} {1491064200 34200 0 ACST} {1506789000 37800 1 ACDT} {1522513800 34200 0 ACST} {1538843400 37800 1 ACDT} {1554568200 34200 0 ACST} {1570293000 37800 1 ACDT} {1586017800 34200 0 ACST} {1601742600 37800 1 ACDT} {1617467400 34200 0 ACST} {1633192200 37800 1 ACDT} {1648917000 34200 0 ACST} {1664641800 37800 1 ACDT} {1680366600 34200 0 ACST} {1696091400 37800 1 ACDT} {1712421000 34200 0 ACST} {1728145800 37800 1 ACDT} {1743870600 34200 0 ACST} {1759595400 37800 1 ACDT} {1775320200 34200 0 ACST} {1791045000 37800 1 ACDT} {1806769800 34200 0 ACST} {1822494600 37800 1 ACDT} {1838219400 34200 0 ACST} {1853944200 37800 1 ACDT} {1869669000 34200 0 ACST} {1885998600 37800 1 ACDT} {1901723400 34200 0 ACST} {1917448200 37800 1 ACDT} {1933173000 34200 0 ACST} {1948897800 37800 1 ACDT} {1964622600 34200 0 ACST} {1980347400 37800 1 ACDT} {1996072200 34200 0 ACST} {2011797000 37800 1 ACDT} {2027521800 34200 0 ACST} {2043246600 37800 1 ACDT} {2058971400 34200 0 ACST} {2075301000 37800 1 ACDT} {2091025800 34200 0 ACST} {2106750600 37800 1 ACDT} {2122475400 34200 0 ACST} {2138200200 37800 1 ACDT} {2153925000 34200 0 ACST} {2169649800 37800 1 ACDT} {2185374600 34200 0 ACST} {2201099400 37800 1 ACDT} {2216824200 34200 0 ACST} {2233153800 37800 1 ACDT} {2248878600 34200 0 ACST} {2264603400 37800 1 ACDT} {2280328200 34200 0 ACST} {2296053000 37800 1 ACDT} {2311777800 34200 0 ACST} {2327502600 37800 1 ACDT} {2343227400 34200 0 ACST} {2358952200 37800 1 ACDT} {2374677000 34200 0 ACST} {2390401800 37800 1 ACDT} {2406126600 34200 0 ACST} {2422456200 37800 1 ACDT} {2438181000 34200 0 ACST} {2453905800 37800 1 ACDT} {2469630600 34200 0 ACST} {2485355400 37800 1 ACDT} {2501080200 34200 0 ACST} {2516805000 37800 1 ACDT} {2532529800 34200 0 ACST} {2548254600 37800 1 ACDT} {2563979400 34200 0 ACST} {2579704200 37800 1 ACDT} {2596033800 34200 0 ACST} {2611758600 37800 1 ACDT} {2627483400 34200 0 ACST} {2643208200 37800 1 ACDT} {2658933000 34200 0 ACST} {2674657800 37800 1 ACDT} {2690382600 34200 0 ACST} {2706107400 37800 1 ACDT} {2721832200 34200 0 ACST} {2737557000 37800 1 ACDT} {2753281800 34200 0 ACST} {2769611400 37800 1 ACDT} {2785336200 34200 0 ACST} {2801061000 37800 1 ACDT} {2816785800 34200 0 ACST} {2832510600 37800 1 ACDT} {2848235400 34200 0 ACST} {2863960200 37800 1 ACDT} {2879685000 34200 0 ACST} {2895409800 37800 1 ACDT} {2911134600 34200 0 ACST} {2926859400 37800 1 ACDT} {2942584200 34200 0 ACST} {2958913800 37800 1 ACDT} {2974638600 34200 0 ACST} {2990363400 37800 1 ACDT} {3006088200 34200 0 ACST} {3021813000 37800 1 ACDT} {3037537800 34200 0 ACST} {3053262600 37800 1 ACDT} {3068987400 34200 0 ACST} {3084712200 37800 1 ACDT} {3100437000 34200 0 ACST} {3116766600 37800 1 ACDT} {3132491400 34200 0 ACST} {3148216200 37800 1 ACDT} {3163941000 34200 0 ACST} {3179665800 37800 1 ACDT} {3195390600 34200 0 ACST} {3211115400 37800 1 ACDT} {3226840200 34200 0 ACST} {3242565000 37800 1 ACDT} {3258289800 34200 0 ACST} {3274014600 37800 1 ACDT} {3289739400 34200 0 ACST} {3306069000 37800 1 ACDT} {3321793800 34200 0 ACST} {3337518600 37800 1 ACDT} {3353243400 34200 0 ACST} {3368968200 37800 1 ACDT} {3384693000 34200 0 ACST} {3400417800 37800 1 ACDT} {3416142600 34200 0 ACST} {3431867400 37800 1 ACDT} {3447592200 34200 0 ACST} {3463317000 37800 1 ACDT} {3479646600 34200 0 ACST} {3495371400 37800 1 ACDT} {3511096200 34200 0 ACST} {3526821000 37800 1 ACDT} {3542545800 34200 0 ACST} {3558270600 37800 1 ACDT} {3573995400 34200 0 ACST} {3589720200 37800 1 ACDT} {3605445000 34200 0 ACST} {3621169800 37800 1 ACDT} {3636894600 34200 0 ACST} {3653224200 37800 1 ACDT} {3668949000 34200 0 ACST} {3684673800 37800 1 ACDT} {3700398600 34200 0 ACST} {3716123400 37800 1 ACDT} {3731848200 34200 0 ACST} {3747573000 37800 1 ACDT} {3763297800 34200 0 ACST} {3779022600 37800 1 ACDT} {3794747400 34200 0 ACST} {3810472200 37800 1 ACDT} {3826197000 34200 0 ACST} {3842526600 37800 1 ACDT} {3858251400 34200 0 ACST} {3873976200 37800 1 ACDT} {3889701000 34200 0 ACST} {3905425800 37800 1 ACDT} {3921150600 34200 0 ACST} {3936875400 37800 1 ACDT} {3952600200 34200 0 ACST} {3968325000 37800 1 ACDT} {3984049800 34200 0 ACST} {4000379400 37800 1 ACDT} {4016104200 34200 0 ACST} {4031829000 37800 1 ACDT} {4047553800 34200 0 ACST} {4063278600 37800 1 ACDT} {4079003400 34200 0 ACST} {4094728200 37800 1 ACDT} } tcl9.0.3/library/tzdata/Australia/ACT0000664000175000017500000000027115035744305016770 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Australia/Sydney)]} { LoadTimeZoneFile Australia/Sydney } set TZData(:Australia/ACT) $TZData(:Australia/Sydney) tcl9.0.3/library/tzdata/Atlantic/0000755000175000017500000000000015104662345016246 5ustar sergeisergeitcl9.0.3/library/tzdata/Atlantic/St_Helena0000664000175000017500000000027015035744305020034 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Atlantic/St_Helena) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Atlantic/Stanley0000664000175000017500000000441715035744305017620 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Stanley) { {-9223372036854775808 -13884 0 LMT} {-2524507716 -13884 0 SMT} {-1824235716 -14400 0 -0400} {-1018209600 -10800 1 -0300} {-1003093200 -14400 0 -0400} {-986760000 -10800 1 -0300} {-971643600 -14400 0 -0400} {-954705600 -10800 1 -0300} {-939589200 -14400 0 -0400} {-923256000 -10800 1 -0300} {-908139600 -14400 0 -0400} {-891806400 -10800 1 -0300} {-876690000 -14400 0 -0400} {-860356800 -10800 1 -0300} {420606000 -7200 0 -0200} {433303200 -7200 1 -0200} {452052000 -10800 0 -0300} {464151600 -7200 1 -0200} {483501600 -10800 0 -0300} {495597600 -14400 0 -0400} {495604800 -10800 1 -0300} {514350000 -14400 0 -0400} {527054400 -10800 1 -0300} {545799600 -14400 0 -0400} {558504000 -10800 1 -0300} {577249200 -14400 0 -0400} {589953600 -10800 1 -0300} {608698800 -14400 0 -0400} {621403200 -10800 1 -0300} {640753200 -14400 0 -0400} {652852800 -10800 1 -0300} {672202800 -14400 0 -0400} {684907200 -10800 1 -0300} {703652400 -14400 0 -0400} {716356800 -10800 1 -0300} {735102000 -14400 0 -0400} {747806400 -10800 1 -0300} {766551600 -14400 0 -0400} {779256000 -10800 1 -0300} {798001200 -14400 0 -0400} {810705600 -10800 1 -0300} {830055600 -14400 0 -0400} {842760000 -10800 1 -0300} {861505200 -14400 0 -0400} {874209600 -10800 1 -0300} {892954800 -14400 0 -0400} {905659200 -10800 1 -0300} {924404400 -14400 0 -0400} {937108800 -10800 1 -0300} {955854000 -14400 0 -0400} {968558400 -10800 1 -0300} {987310800 -14400 0 -0400} {999410400 -10800 1 -0300} {1019365200 -14400 0 -0400} {1030860000 -10800 1 -0300} {1050814800 -14400 0 -0400} {1062914400 -10800 1 -0300} {1082264400 -14400 0 -0400} {1094364000 -10800 1 -0300} {1113714000 -14400 0 -0400} {1125813600 -10800 1 -0300} {1145163600 -14400 0 -0400} {1157263200 -10800 1 -0300} {1176613200 -14400 0 -0400} {1188712800 -10800 1 -0300} {1208667600 -14400 0 -0400} {1220767200 -10800 1 -0300} {1240117200 -14400 0 -0400} {1252216800 -10800 1 -0300} {1271566800 -14400 0 -0400} {1283662800 -10800 0 -0300} } tcl9.0.3/library/tzdata/Atlantic/South_Georgia0000664000175000017500000000023415035744305020731 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/South_Georgia) { {-9223372036854775808 -8768 0 LMT} {-2524512832 -7200 0 -0200} } tcl9.0.3/library/tzdata/Atlantic/Reykjavik0000664000175000017500000000027015035744305020131 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Atlantic/Reykjavik) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Atlantic/Madeira0000664000175000017500000002237215035744305017543 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Madeira) { {-9223372036854775808 -4056 0 LMT} {-2713906344 -4056 0 FMT} {-1830380400 -3600 0 -0100} {-1689552000 0 1 +0000} {-1677798000 -3600 0 -0100} {-1667430000 0 1 +0000} {-1647734400 -3600 0 -0100} {-1635894000 0 1 +0000} {-1616198400 -3600 0 -0100} {-1604358000 0 1 +0000} {-1584662400 -3600 0 -0100} {-1572735600 0 1 +0000} {-1553040000 -3600 0 -0100} {-1541199600 0 1 +0000} {-1521504000 -3600 0 -0100} {-1442448000 0 1 +0000} {-1427673600 -3600 0 -0100} {-1379289600 0 1 +0000} {-1364774400 -3600 0 -0100} {-1348444800 0 1 +0000} {-1333324800 -3600 0 -0100} {-1316390400 0 1 +0000} {-1301270400 -3600 0 -0100} {-1284336000 0 1 +0000} {-1269820800 -3600 0 -0100} {-1221436800 0 1 +0000} {-1206921600 -3600 0 -0100} {-1191196800 0 1 +0000} {-1175472000 -3600 0 -0100} {-1127692800 0 1 +0000} {-1111968000 -3600 0 -0100} {-1096848000 0 1 +0000} {-1080518400 -3600 0 -0100} {-1063584000 0 1 +0000} {-1049068800 -3600 0 -0100} {-1033344000 0 1 +0000} {-1017619200 -3600 0 -0100} {-1002499200 0 1 +0000} {-986169600 -3600 0 -0100} {-969235200 0 1 +0000} {-950486400 -3600 0 -0100} {-942019200 0 1 +0000} {-922492800 -3600 0 -0100} {-906940800 0 1 +0000} {-891129600 -3600 0 -0100} {-877305600 0 1 +0000} {-873680400 3600 1 +0100} {-864003600 0 1 +0000} {-857952000 -3600 0 -0100} {-845856000 0 1 +0000} {-842835600 3600 1 +0100} {-831344400 0 1 +0000} {-825897600 -3600 0 -0100} {-814406400 0 1 +0000} {-810781200 3600 1 +0100} {-799894800 0 1 +0000} {-794448000 -3600 0 -0100} {-782956800 0 1 +0000} {-779331600 3600 1 +0100} {-768445200 0 1 +0000} {-762998400 -3600 0 -0100} {-749088000 0 1 +0000} {-733363200 -3600 0 -0100} {-717627600 0 1 +0000} {-701902800 -3600 0 -0100} {-686178000 0 1 +0000} {-670453200 -3600 0 -0100} {-654728400 0 1 +0000} {-639003600 -3600 0 -0100} {-623278800 0 1 +0000} {-607554000 -3600 0 -0100} {-591829200 0 1 +0000} {-575499600 -3600 0 -0100} {-559774800 0 1 +0000} {-544050000 -3600 0 -0100} {-528325200 0 1 +0000} {-512600400 -3600 0 -0100} {-496875600 0 1 +0000} {-481150800 -3600 0 -0100} {-465426000 0 1 +0000} {-449701200 -3600 0 -0100} {-433976400 0 1 +0000} {-417646800 -3600 0 -0100} {-401922000 0 1 +0000} {-386197200 -3600 0 -0100} {-370472400 0 1 +0000} {-354747600 -3600 0 -0100} {-339022800 0 1 +0000} {-323298000 -3600 0 -0100} {-307573200 0 1 +0000} {-291848400 -3600 0 -0100} {-276123600 0 1 +0000} {-260398800 -3600 0 -0100} {-244674000 0 1 +0000} {-228344400 -3600 0 -0100} {-212619600 0 1 +0000} {-196894800 -3600 0 -0100} {-181170000 0 1 +0000} {-165445200 -3600 0 -0100} {-149720400 0 1 +0000} {-133995600 -3600 0 -0100} {-118270800 0 1 +0000} {-102546000 0 0 WET} {386726400 3600 0 WEST} {401846400 0 0 WET} {417571200 3600 1 WEST} {433296000 0 0 WET} {449020800 3600 1 WEST} {465350400 0 0 WET} {481075200 3600 1 WEST} {496800000 0 0 WET} {512524800 3600 1 WEST} {523148400 3600 0 WEST} {528253200 0 0 WET} {543978000 3600 1 WEST} {559702800 0 0 WET} {575427600 3600 1 WEST} {591152400 0 0 WET} {606877200 3600 1 WEST} {622602000 0 0 WET} {638326800 3600 1 WEST} {654656400 0 0 WET} {670381200 3600 1 WEST} {686106000 0 0 WET} {701830800 3600 1 WEST} {717555600 0 0 WET} {733280400 3600 1 WEST} {749005200 0 0 WET} {764730000 3600 1 WEST} {780454800 0 0 WET} {796179600 3600 1 WEST} {811904400 0 0 WET} {828234000 3600 1 WEST} {846378000 0 0 WET} {859683600 3600 1 WEST} {877827600 0 0 WET} {891133200 3600 1 WEST} {909277200 0 0 WET} {922582800 3600 1 WEST} {941331600 0 0 WET} {954032400 3600 1 WEST} {972781200 0 0 WET} {985482000 3600 1 WEST} {1004230800 0 0 WET} {1017536400 3600 1 WEST} {1035680400 0 0 WET} {1048986000 3600 1 WEST} {1067130000 0 0 WET} {1080435600 3600 1 WEST} {1099184400 0 0 WET} {1111885200 3600 1 WEST} {1130634000 0 0 WET} {1143334800 3600 1 WEST} {1162083600 0 0 WET} {1174784400 3600 1 WEST} {1193533200 0 0 WET} {1206838800 3600 1 WEST} {1224982800 0 0 WET} {1238288400 3600 1 WEST} {1256432400 0 0 WET} {1269738000 3600 1 WEST} {1288486800 0 0 WET} {1301187600 3600 1 WEST} {1319936400 0 0 WET} {1332637200 3600 1 WEST} {1351386000 0 0 WET} {1364691600 3600 1 WEST} {1382835600 0 0 WET} {1396141200 3600 1 WEST} {1414285200 0 0 WET} {1427590800 3600 1 WEST} {1445734800 0 0 WET} {1459040400 3600 1 WEST} {1477789200 0 0 WET} {1490490000 3600 1 WEST} {1509238800 0 0 WET} {1521939600 3600 1 WEST} {1540688400 0 0 WET} {1553994000 3600 1 WEST} {1572138000 0 0 WET} {1585443600 3600 1 WEST} {1603587600 0 0 WET} {1616893200 3600 1 WEST} {1635642000 0 0 WET} {1648342800 3600 1 WEST} {1667091600 0 0 WET} {1679792400 3600 1 WEST} {1698541200 0 0 WET} {1711846800 3600 1 WEST} {1729990800 0 0 WET} {1743296400 3600 1 WEST} {1761440400 0 0 WET} {1774746000 3600 1 WEST} {1792890000 0 0 WET} {1806195600 3600 1 WEST} {1824944400 0 0 WET} {1837645200 3600 1 WEST} {1856394000 0 0 WET} {1869094800 3600 1 WEST} {1887843600 0 0 WET} {1901149200 3600 1 WEST} {1919293200 0 0 WET} {1932598800 3600 1 WEST} {1950742800 0 0 WET} {1964048400 3600 1 WEST} {1982797200 0 0 WET} {1995498000 3600 1 WEST} {2014246800 0 0 WET} {2026947600 3600 1 WEST} {2045696400 0 0 WET} {2058397200 3600 1 WEST} {2077146000 0 0 WET} {2090451600 3600 1 WEST} {2108595600 0 0 WET} {2121901200 3600 1 WEST} {2140045200 0 0 WET} {2153350800 3600 1 WEST} {2172099600 0 0 WET} {2184800400 3600 1 WEST} {2203549200 0 0 WET} {2216250000 3600 1 WEST} {2234998800 0 0 WET} {2248304400 3600 1 WEST} {2266448400 0 0 WET} {2279754000 3600 1 WEST} {2297898000 0 0 WET} {2311203600 3600 1 WEST} {2329347600 0 0 WET} {2342653200 3600 1 WEST} {2361402000 0 0 WET} {2374102800 3600 1 WEST} {2392851600 0 0 WET} {2405552400 3600 1 WEST} {2424301200 0 0 WET} {2437606800 3600 1 WEST} {2455750800 0 0 WET} {2469056400 3600 1 WEST} {2487200400 0 0 WET} {2500506000 3600 1 WEST} {2519254800 0 0 WET} {2531955600 3600 1 WEST} {2550704400 0 0 WET} {2563405200 3600 1 WEST} {2582154000 0 0 WET} {2595459600 3600 1 WEST} {2613603600 0 0 WET} {2626909200 3600 1 WEST} {2645053200 0 0 WET} {2658358800 3600 1 WEST} {2676502800 0 0 WET} {2689808400 3600 1 WEST} {2708557200 0 0 WET} {2721258000 3600 1 WEST} {2740006800 0 0 WET} {2752707600 3600 1 WEST} {2771456400 0 0 WET} {2784762000 3600 1 WEST} {2802906000 0 0 WET} {2816211600 3600 1 WEST} {2834355600 0 0 WET} {2847661200 3600 1 WEST} {2866410000 0 0 WET} {2879110800 3600 1 WEST} {2897859600 0 0 WET} {2910560400 3600 1 WEST} {2929309200 0 0 WET} {2942010000 3600 1 WEST} {2960758800 0 0 WET} {2974064400 3600 1 WEST} {2992208400 0 0 WET} {3005514000 3600 1 WEST} {3023658000 0 0 WET} {3036963600 3600 1 WEST} {3055712400 0 0 WET} {3068413200 3600 1 WEST} {3087162000 0 0 WET} {3099862800 3600 1 WEST} {3118611600 0 0 WET} {3131917200 3600 1 WEST} {3150061200 0 0 WET} {3163366800 3600 1 WEST} {3181510800 0 0 WET} {3194816400 3600 1 WEST} {3212960400 0 0 WET} {3226266000 3600 1 WEST} {3245014800 0 0 WET} {3257715600 3600 1 WEST} {3276464400 0 0 WET} {3289165200 3600 1 WEST} {3307914000 0 0 WET} {3321219600 3600 1 WEST} {3339363600 0 0 WET} {3352669200 3600 1 WEST} {3370813200 0 0 WET} {3384118800 3600 1 WEST} {3402867600 0 0 WET} {3415568400 3600 1 WEST} {3434317200 0 0 WET} {3447018000 3600 1 WEST} {3465766800 0 0 WET} {3479072400 3600 1 WEST} {3497216400 0 0 WET} {3510522000 3600 1 WEST} {3528666000 0 0 WET} {3541971600 3600 1 WEST} {3560115600 0 0 WET} {3573421200 3600 1 WEST} {3592170000 0 0 WET} {3604870800 3600 1 WEST} {3623619600 0 0 WET} {3636320400 3600 1 WEST} {3655069200 0 0 WET} {3668374800 3600 1 WEST} {3686518800 0 0 WET} {3699824400 3600 1 WEST} {3717968400 0 0 WET} {3731274000 3600 1 WEST} {3750022800 0 0 WET} {3762723600 3600 1 WEST} {3781472400 0 0 WET} {3794173200 3600 1 WEST} {3812922000 0 0 WET} {3825622800 3600 1 WEST} {3844371600 0 0 WET} {3857677200 3600 1 WEST} {3875821200 0 0 WET} {3889126800 3600 1 WEST} {3907270800 0 0 WET} {3920576400 3600 1 WEST} {3939325200 0 0 WET} {3952026000 3600 1 WEST} {3970774800 0 0 WET} {3983475600 3600 1 WEST} {4002224400 0 0 WET} {4015530000 3600 1 WEST} {4033674000 0 0 WET} {4046979600 3600 1 WEST} {4065123600 0 0 WET} {4078429200 3600 1 WEST} {4096573200 0 0 WET} } tcl9.0.3/library/tzdata/Atlantic/Jan_Mayen0000664000175000017500000000026515035744305020037 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Berlin)]} { LoadTimeZoneFile Europe/Berlin } set TZData(:Atlantic/Jan_Mayen) $TZData(:Europe/Berlin) tcl9.0.3/library/tzdata/Atlantic/Faroe0000664000175000017500000001462715035744305017241 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Faroe) { {-9223372036854775808 -1624 0 LMT} {-1955748776 0 0 WET} {347155200 0 0 WET} {354675600 3600 1 WEST} {370400400 0 0 WET} {386125200 3600 1 WEST} {401850000 0 0 WET} {417574800 3600 1 WEST} {433299600 0 0 WET} {449024400 3600 1 WEST} {465354000 0 0 WET} {481078800 3600 1 WEST} {496803600 0 0 WET} {512528400 3600 1 WEST} {528253200 0 0 WET} {543978000 3600 1 WEST} {559702800 0 0 WET} {575427600 3600 1 WEST} {591152400 0 0 WET} {606877200 3600 1 WEST} {622602000 0 0 WET} {638326800 3600 1 WEST} {654656400 0 0 WET} {670381200 3600 1 WEST} {686106000 0 0 WET} {701830800 3600 1 WEST} {717555600 0 0 WET} {733280400 3600 1 WEST} {749005200 0 0 WET} {764730000 3600 1 WEST} {780454800 0 0 WET} {796179600 3600 1 WEST} {811904400 0 0 WET} {828234000 3600 1 WEST} {846378000 0 0 WET} {859683600 3600 1 WEST} {877827600 0 0 WET} {891133200 3600 1 WEST} {909277200 0 0 WET} {922582800 3600 1 WEST} {941331600 0 0 WET} {954032400 3600 1 WEST} {972781200 0 0 WET} {985482000 3600 1 WEST} {1004230800 0 0 WET} {1017536400 3600 1 WEST} {1035680400 0 0 WET} {1048986000 3600 1 WEST} {1067130000 0 0 WET} {1080435600 3600 1 WEST} {1099184400 0 0 WET} {1111885200 3600 1 WEST} {1130634000 0 0 WET} {1143334800 3600 1 WEST} {1162083600 0 0 WET} {1174784400 3600 1 WEST} {1193533200 0 0 WET} {1206838800 3600 1 WEST} {1224982800 0 0 WET} {1238288400 3600 1 WEST} {1256432400 0 0 WET} {1269738000 3600 1 WEST} {1288486800 0 0 WET} {1301187600 3600 1 WEST} {1319936400 0 0 WET} {1332637200 3600 1 WEST} {1351386000 0 0 WET} {1364691600 3600 1 WEST} {1382835600 0 0 WET} {1396141200 3600 1 WEST} {1414285200 0 0 WET} {1427590800 3600 1 WEST} {1445734800 0 0 WET} {1459040400 3600 1 WEST} {1477789200 0 0 WET} {1490490000 3600 1 WEST} {1509238800 0 0 WET} {1521939600 3600 1 WEST} {1540688400 0 0 WET} {1553994000 3600 1 WEST} {1572138000 0 0 WET} {1585443600 3600 1 WEST} {1603587600 0 0 WET} {1616893200 3600 1 WEST} {1635642000 0 0 WET} {1648342800 3600 1 WEST} {1667091600 0 0 WET} {1679792400 3600 1 WEST} {1698541200 0 0 WET} {1711846800 3600 1 WEST} {1729990800 0 0 WET} {1743296400 3600 1 WEST} {1761440400 0 0 WET} {1774746000 3600 1 WEST} {1792890000 0 0 WET} {1806195600 3600 1 WEST} {1824944400 0 0 WET} {1837645200 3600 1 WEST} {1856394000 0 0 WET} {1869094800 3600 1 WEST} {1887843600 0 0 WET} {1901149200 3600 1 WEST} {1919293200 0 0 WET} {1932598800 3600 1 WEST} {1950742800 0 0 WET} {1964048400 3600 1 WEST} {1982797200 0 0 WET} {1995498000 3600 1 WEST} {2014246800 0 0 WET} {2026947600 3600 1 WEST} {2045696400 0 0 WET} {2058397200 3600 1 WEST} {2077146000 0 0 WET} {2090451600 3600 1 WEST} {2108595600 0 0 WET} {2121901200 3600 1 WEST} {2140045200 0 0 WET} {2153350800 3600 1 WEST} {2172099600 0 0 WET} {2184800400 3600 1 WEST} {2203549200 0 0 WET} {2216250000 3600 1 WEST} {2234998800 0 0 WET} {2248304400 3600 1 WEST} {2266448400 0 0 WET} {2279754000 3600 1 WEST} {2297898000 0 0 WET} {2311203600 3600 1 WEST} {2329347600 0 0 WET} {2342653200 3600 1 WEST} {2361402000 0 0 WET} {2374102800 3600 1 WEST} {2392851600 0 0 WET} {2405552400 3600 1 WEST} {2424301200 0 0 WET} {2437606800 3600 1 WEST} {2455750800 0 0 WET} {2469056400 3600 1 WEST} {2487200400 0 0 WET} {2500506000 3600 1 WEST} {2519254800 0 0 WET} {2531955600 3600 1 WEST} {2550704400 0 0 WET} {2563405200 3600 1 WEST} {2582154000 0 0 WET} {2595459600 3600 1 WEST} {2613603600 0 0 WET} {2626909200 3600 1 WEST} {2645053200 0 0 WET} {2658358800 3600 1 WEST} {2676502800 0 0 WET} {2689808400 3600 1 WEST} {2708557200 0 0 WET} {2721258000 3600 1 WEST} {2740006800 0 0 WET} {2752707600 3600 1 WEST} {2771456400 0 0 WET} {2784762000 3600 1 WEST} {2802906000 0 0 WET} {2816211600 3600 1 WEST} {2834355600 0 0 WET} {2847661200 3600 1 WEST} {2866410000 0 0 WET} {2879110800 3600 1 WEST} {2897859600 0 0 WET} {2910560400 3600 1 WEST} {2929309200 0 0 WET} {2942010000 3600 1 WEST} {2960758800 0 0 WET} {2974064400 3600 1 WEST} {2992208400 0 0 WET} {3005514000 3600 1 WEST} {3023658000 0 0 WET} {3036963600 3600 1 WEST} {3055712400 0 0 WET} {3068413200 3600 1 WEST} {3087162000 0 0 WET} {3099862800 3600 1 WEST} {3118611600 0 0 WET} {3131917200 3600 1 WEST} {3150061200 0 0 WET} {3163366800 3600 1 WEST} {3181510800 0 0 WET} {3194816400 3600 1 WEST} {3212960400 0 0 WET} {3226266000 3600 1 WEST} {3245014800 0 0 WET} {3257715600 3600 1 WEST} {3276464400 0 0 WET} {3289165200 3600 1 WEST} {3307914000 0 0 WET} {3321219600 3600 1 WEST} {3339363600 0 0 WET} {3352669200 3600 1 WEST} {3370813200 0 0 WET} {3384118800 3600 1 WEST} {3402867600 0 0 WET} {3415568400 3600 1 WEST} {3434317200 0 0 WET} {3447018000 3600 1 WEST} {3465766800 0 0 WET} {3479072400 3600 1 WEST} {3497216400 0 0 WET} {3510522000 3600 1 WEST} {3528666000 0 0 WET} {3541971600 3600 1 WEST} {3560115600 0 0 WET} {3573421200 3600 1 WEST} {3592170000 0 0 WET} {3604870800 3600 1 WEST} {3623619600 0 0 WET} {3636320400 3600 1 WEST} {3655069200 0 0 WET} {3668374800 3600 1 WEST} {3686518800 0 0 WET} {3699824400 3600 1 WEST} {3717968400 0 0 WET} {3731274000 3600 1 WEST} {3750022800 0 0 WET} {3762723600 3600 1 WEST} {3781472400 0 0 WET} {3794173200 3600 1 WEST} {3812922000 0 0 WET} {3825622800 3600 1 WEST} {3844371600 0 0 WET} {3857677200 3600 1 WEST} {3875821200 0 0 WET} {3889126800 3600 1 WEST} {3907270800 0 0 WET} {3920576400 3600 1 WEST} {3939325200 0 0 WET} {3952026000 3600 1 WEST} {3970774800 0 0 WET} {3983475600 3600 1 WEST} {4002224400 0 0 WET} {4015530000 3600 1 WEST} {4033674000 0 0 WET} {4046979600 3600 1 WEST} {4065123600 0 0 WET} {4078429200 3600 1 WEST} {4096573200 0 0 WET} } tcl9.0.3/library/tzdata/Atlantic/Faeroe0000664000175000017500000000026515035744305017377 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Atlantic/Faroe)]} { LoadTimeZoneFile Atlantic/Faroe } set TZData(:Atlantic/Faeroe) $TZData(:Atlantic/Faroe) tcl9.0.3/library/tzdata/Atlantic/Cape_Verde0000664000175000017500000000036515035744305020174 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Cape_Verde) { {-9223372036854775808 -5644 0 LMT} {-1830376800 -7200 0 -0200} {-862610400 -3600 1 -0100} {-764118000 -7200 0 -0200} {186120000 -3600 0 -0100} } tcl9.0.3/library/tzdata/Atlantic/Canary0000664000175000017500000001472315035744305017417 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Canary) { {-9223372036854775808 -3696 0 LMT} {-1509663504 -3600 0 -0100} {-733874400 0 0 WET} {323827200 3600 1 WEST} {338950800 0 0 WET} {354675600 3600 1 WEST} {370400400 0 0 WET} {386125200 3600 1 WEST} {401850000 0 0 WET} {417574800 3600 1 WEST} {433299600 0 0 WET} {449024400 3600 1 WEST} {465354000 0 0 WET} {481078800 3600 1 WEST} {496803600 0 0 WET} {512528400 3600 1 WEST} {528253200 0 0 WET} {543978000 3600 1 WEST} {559702800 0 0 WET} {575427600 3600 1 WEST} {591152400 0 0 WET} {606877200 3600 1 WEST} {622602000 0 0 WET} {638326800 3600 1 WEST} {654656400 0 0 WET} {670381200 3600 1 WEST} {686106000 0 0 WET} {701830800 3600 1 WEST} {717555600 0 0 WET} {733280400 3600 1 WEST} {749005200 0 0 WET} {764730000 3600 1 WEST} {780454800 0 0 WET} {796179600 3600 1 WEST} {811904400 0 0 WET} {828234000 3600 1 WEST} {846378000 0 0 WET} {859683600 3600 1 WEST} {877827600 0 0 WET} {891133200 3600 1 WEST} {909277200 0 0 WET} {922582800 3600 1 WEST} {941331600 0 0 WET} {954032400 3600 1 WEST} {972781200 0 0 WET} {985482000 3600 1 WEST} {1004230800 0 0 WET} {1017536400 3600 1 WEST} {1035680400 0 0 WET} {1048986000 3600 1 WEST} {1067130000 0 0 WET} {1080435600 3600 1 WEST} {1099184400 0 0 WET} {1111885200 3600 1 WEST} {1130634000 0 0 WET} {1143334800 3600 1 WEST} {1162083600 0 0 WET} {1174784400 3600 1 WEST} {1193533200 0 0 WET} {1206838800 3600 1 WEST} {1224982800 0 0 WET} {1238288400 3600 1 WEST} {1256432400 0 0 WET} {1269738000 3600 1 WEST} {1288486800 0 0 WET} {1301187600 3600 1 WEST} {1319936400 0 0 WET} {1332637200 3600 1 WEST} {1351386000 0 0 WET} {1364691600 3600 1 WEST} {1382835600 0 0 WET} {1396141200 3600 1 WEST} {1414285200 0 0 WET} {1427590800 3600 1 WEST} {1445734800 0 0 WET} {1459040400 3600 1 WEST} {1477789200 0 0 WET} {1490490000 3600 1 WEST} {1509238800 0 0 WET} {1521939600 3600 1 WEST} {1540688400 0 0 WET} {1553994000 3600 1 WEST} {1572138000 0 0 WET} {1585443600 3600 1 WEST} {1603587600 0 0 WET} {1616893200 3600 1 WEST} {1635642000 0 0 WET} {1648342800 3600 1 WEST} {1667091600 0 0 WET} {1679792400 3600 1 WEST} {1698541200 0 0 WET} {1711846800 3600 1 WEST} {1729990800 0 0 WET} {1743296400 3600 1 WEST} {1761440400 0 0 WET} {1774746000 3600 1 WEST} {1792890000 0 0 WET} {1806195600 3600 1 WEST} {1824944400 0 0 WET} {1837645200 3600 1 WEST} {1856394000 0 0 WET} {1869094800 3600 1 WEST} {1887843600 0 0 WET} {1901149200 3600 1 WEST} {1919293200 0 0 WET} {1932598800 3600 1 WEST} {1950742800 0 0 WET} {1964048400 3600 1 WEST} {1982797200 0 0 WET} {1995498000 3600 1 WEST} {2014246800 0 0 WET} {2026947600 3600 1 WEST} {2045696400 0 0 WET} {2058397200 3600 1 WEST} {2077146000 0 0 WET} {2090451600 3600 1 WEST} {2108595600 0 0 WET} {2121901200 3600 1 WEST} {2140045200 0 0 WET} {2153350800 3600 1 WEST} {2172099600 0 0 WET} {2184800400 3600 1 WEST} {2203549200 0 0 WET} {2216250000 3600 1 WEST} {2234998800 0 0 WET} {2248304400 3600 1 WEST} {2266448400 0 0 WET} {2279754000 3600 1 WEST} {2297898000 0 0 WET} {2311203600 3600 1 WEST} {2329347600 0 0 WET} {2342653200 3600 1 WEST} {2361402000 0 0 WET} {2374102800 3600 1 WEST} {2392851600 0 0 WET} {2405552400 3600 1 WEST} {2424301200 0 0 WET} {2437606800 3600 1 WEST} {2455750800 0 0 WET} {2469056400 3600 1 WEST} {2487200400 0 0 WET} {2500506000 3600 1 WEST} {2519254800 0 0 WET} {2531955600 3600 1 WEST} {2550704400 0 0 WET} {2563405200 3600 1 WEST} {2582154000 0 0 WET} {2595459600 3600 1 WEST} {2613603600 0 0 WET} {2626909200 3600 1 WEST} {2645053200 0 0 WET} {2658358800 3600 1 WEST} {2676502800 0 0 WET} {2689808400 3600 1 WEST} {2708557200 0 0 WET} {2721258000 3600 1 WEST} {2740006800 0 0 WET} {2752707600 3600 1 WEST} {2771456400 0 0 WET} {2784762000 3600 1 WEST} {2802906000 0 0 WET} {2816211600 3600 1 WEST} {2834355600 0 0 WET} {2847661200 3600 1 WEST} {2866410000 0 0 WET} {2879110800 3600 1 WEST} {2897859600 0 0 WET} {2910560400 3600 1 WEST} {2929309200 0 0 WET} {2942010000 3600 1 WEST} {2960758800 0 0 WET} {2974064400 3600 1 WEST} {2992208400 0 0 WET} {3005514000 3600 1 WEST} {3023658000 0 0 WET} {3036963600 3600 1 WEST} {3055712400 0 0 WET} {3068413200 3600 1 WEST} {3087162000 0 0 WET} {3099862800 3600 1 WEST} {3118611600 0 0 WET} {3131917200 3600 1 WEST} {3150061200 0 0 WET} {3163366800 3600 1 WEST} {3181510800 0 0 WET} {3194816400 3600 1 WEST} {3212960400 0 0 WET} {3226266000 3600 1 WEST} {3245014800 0 0 WET} {3257715600 3600 1 WEST} {3276464400 0 0 WET} {3289165200 3600 1 WEST} {3307914000 0 0 WET} {3321219600 3600 1 WEST} {3339363600 0 0 WET} {3352669200 3600 1 WEST} {3370813200 0 0 WET} {3384118800 3600 1 WEST} {3402867600 0 0 WET} {3415568400 3600 1 WEST} {3434317200 0 0 WET} {3447018000 3600 1 WEST} {3465766800 0 0 WET} {3479072400 3600 1 WEST} {3497216400 0 0 WET} {3510522000 3600 1 WEST} {3528666000 0 0 WET} {3541971600 3600 1 WEST} {3560115600 0 0 WET} {3573421200 3600 1 WEST} {3592170000 0 0 WET} {3604870800 3600 1 WEST} {3623619600 0 0 WET} {3636320400 3600 1 WEST} {3655069200 0 0 WET} {3668374800 3600 1 WEST} {3686518800 0 0 WET} {3699824400 3600 1 WEST} {3717968400 0 0 WET} {3731274000 3600 1 WEST} {3750022800 0 0 WET} {3762723600 3600 1 WEST} {3781472400 0 0 WET} {3794173200 3600 1 WEST} {3812922000 0 0 WET} {3825622800 3600 1 WEST} {3844371600 0 0 WET} {3857677200 3600 1 WEST} {3875821200 0 0 WET} {3889126800 3600 1 WEST} {3907270800 0 0 WET} {3920576400 3600 1 WEST} {3939325200 0 0 WET} {3952026000 3600 1 WEST} {3970774800 0 0 WET} {3983475600 3600 1 WEST} {4002224400 0 0 WET} {4015530000 3600 1 WEST} {4033674000 0 0 WET} {4046979600 3600 1 WEST} {4065123600 0 0 WET} {4078429200 3600 1 WEST} {4096573200 0 0 WET} } tcl9.0.3/library/tzdata/Atlantic/Bermuda0000664000175000017500000002046215035744305017556 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Bermuda) { {-9223372036854775808 -15558 0 LMT} {-2524506042 -15558 0 BMT} {-1664307642 -11958 1 BMT} {-1648932042 -15558 0 BMT} {-1632080442 -11958 1 BMT} {-1618692042 -15558 0 BST} {-1262281242 -14400 0 AT} {-882727200 -10800 1 ADT} {-858538800 -14400 0 AST} {-845229600 -10800 1 ADT} {-825879600 -14400 0 AST} {-814384800 -10800 1 ADT} {-793825200 -14400 0 AST} {-782935200 -10800 1 ADT} {-762375600 -14400 0 AST} {-713988000 -10800 1 ADT} {-703710000 -14400 0 AST} {-681933600 -10800 1 ADT} {-672865200 -14400 0 AST} {-650484000 -10800 1 ADT} {-641415600 -14400 0 AST} {-618429600 -10800 1 ADT} {-609966000 -14400 0 AST} {-586980000 -10800 1 ADT} {-578516400 -14400 0 AST} {-555530400 -10800 1 ADT} {-546462000 -14400 0 AST} {-429127200 -10800 1 ADT} {-415825200 -14400 0 AST} {136360800 -10800 0 ADT} {152082000 -14400 0 AST} {167810400 -10800 1 ADT} {183531600 -14400 0 AST} {189316800 -14400 0 AST} {199260000 -10800 1 ADT} {215586000 -14400 0 AST} {230709600 -10800 1 ADT} {247035600 -14400 0 AST} {262764000 -10800 1 ADT} {278485200 -14400 0 AST} {294213600 -10800 1 ADT} {309934800 -14400 0 AST} {325663200 -10800 1 ADT} {341384400 -14400 0 AST} {357112800 -10800 1 ADT} {372834000 -14400 0 AST} {388562400 -10800 1 ADT} {404888400 -14400 0 AST} {420012000 -10800 1 ADT} {436338000 -14400 0 AST} {452066400 -10800 1 ADT} {467787600 -14400 0 AST} {483516000 -10800 1 ADT} {499237200 -14400 0 AST} {514965600 -10800 1 ADT} {530686800 -14400 0 AST} {544600800 -10800 1 ADT} {562136400 -14400 0 AST} {576050400 -10800 1 ADT} {594190800 -14400 0 AST} {607500000 -10800 1 ADT} {625640400 -14400 0 AST} {638949600 -10800 1 ADT} {657090000 -14400 0 AST} {671004000 -10800 1 ADT} {688539600 -14400 0 AST} {702453600 -10800 1 ADT} {719989200 -14400 0 AST} {733903200 -10800 1 ADT} {752043600 -14400 0 AST} {765352800 -10800 1 ADT} {783493200 -14400 0 AST} {796802400 -10800 1 ADT} {814942800 -14400 0 AST} {828856800 -10800 1 ADT} {846392400 -14400 0 AST} {860306400 -10800 1 ADT} {877842000 -14400 0 AST} {891756000 -10800 1 ADT} {909291600 -14400 0 AST} {923205600 -10800 1 ADT} {941346000 -14400 0 AST} {954655200 -10800 1 ADT} {972795600 -14400 0 AST} {986104800 -10800 1 ADT} {1004245200 -14400 0 AST} {1018159200 -10800 1 ADT} {1035694800 -14400 0 AST} {1049608800 -10800 1 ADT} {1067144400 -14400 0 AST} {1081058400 -10800 1 ADT} {1099198800 -14400 0 AST} {1112508000 -10800 1 ADT} {1130648400 -14400 0 AST} {1143957600 -10800 1 ADT} {1162098000 -14400 0 AST} {1173592800 -10800 1 ADT} {1194152400 -14400 0 AST} {1205042400 -10800 1 ADT} {1225602000 -14400 0 AST} {1236492000 -10800 1 ADT} {1257051600 -14400 0 AST} {1268546400 -10800 1 ADT} {1289106000 -14400 0 AST} {1299996000 -10800 1 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/Atlantic/Azores0000664000175000017500000002371115035744305017442 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Atlantic/Azores) { {-9223372036854775808 -6160 0 LMT} {-2713904240 -6872 0 HMT} {-1830376800 -7200 0 -0200} {-1689548400 -3600 1 -0100} {-1677794400 -7200 0 -0200} {-1667426400 -3600 1 -0100} {-1647730800 -7200 0 -0200} {-1635890400 -3600 1 -0100} {-1616194800 -7200 0 -0200} {-1604354400 -3600 1 -0100} {-1584658800 -7200 0 -0200} {-1572732000 -3600 1 -0100} {-1553036400 -7200 0 -0200} {-1541196000 -3600 1 -0100} {-1521500400 -7200 0 -0200} {-1442444400 -3600 1 -0100} {-1427670000 -7200 0 -0200} {-1379286000 -3600 1 -0100} {-1364770800 -7200 0 -0200} {-1348441200 -3600 1 -0100} {-1333321200 -7200 0 -0200} {-1316386800 -3600 1 -0100} {-1301266800 -7200 0 -0200} {-1284332400 -3600 1 -0100} {-1269817200 -7200 0 -0200} {-1221433200 -3600 1 -0100} {-1206918000 -7200 0 -0200} {-1191193200 -3600 1 -0100} {-1175468400 -7200 0 -0200} {-1127689200 -3600 1 -0100} {-1111964400 -7200 0 -0200} {-1096844400 -3600 1 -0100} {-1080514800 -7200 0 -0200} {-1063580400 -3600 1 -0100} {-1049065200 -7200 0 -0200} {-1033340400 -3600 1 -0100} {-1017615600 -7200 0 -0200} {-1002495600 -3600 1 -0100} {-986166000 -7200 0 -0200} {-969231600 -3600 1 -0100} {-950482800 -7200 0 -0200} {-942015600 -3600 1 -0100} {-922489200 -7200 0 -0200} {-906937200 -3600 1 -0100} {-891126000 -7200 0 -0200} {-877302000 -3600 1 -0100} {-873676800 0 1 +0000} {-864000000 -3600 1 -0100} {-857948400 -7200 0 -0200} {-845852400 -3600 1 -0100} {-842832000 0 1 +0000} {-831340800 -3600 1 -0100} {-825894000 -7200 0 -0200} {-814402800 -3600 1 -0100} {-810777600 0 1 +0000} {-799891200 -3600 1 -0100} {-794444400 -7200 0 -0200} {-782953200 -3600 1 -0100} {-779328000 0 1 +0000} {-768441600 -3600 1 -0100} {-762994800 -7200 0 -0200} {-749084400 -3600 1 -0100} {-733359600 -7200 0 -0200} {-717624000 -3600 1 -0100} {-701899200 -7200 0 -0200} {-686174400 -3600 1 -0100} {-670449600 -7200 0 -0200} {-654724800 -3600 1 -0100} {-639000000 -7200 0 -0200} {-623275200 -3600 1 -0100} {-607550400 -7200 0 -0200} {-591825600 -3600 1 -0100} {-575496000 -7200 0 -0200} {-559771200 -3600 1 -0100} {-544046400 -7200 0 -0200} {-528321600 -3600 1 -0100} {-512596800 -7200 0 -0200} {-496872000 -3600 1 -0100} {-481147200 -7200 0 -0200} {-465422400 -3600 1 -0100} {-449697600 -7200 0 -0200} {-433972800 -3600 1 -0100} {-417643200 -7200 0 -0200} {-401918400 -3600 1 -0100} {-386193600 -7200 0 -0200} {-370468800 -3600 1 -0100} {-354744000 -7200 0 -0200} {-339019200 -3600 1 -0100} {-323294400 -7200 0 -0200} {-307569600 -3600 1 -0100} {-291844800 -7200 0 -0200} {-276120000 -3600 1 -0100} {-260395200 -7200 0 -0200} {-244670400 -3600 1 -0100} {-228340800 -7200 0 -0200} {-212616000 -3600 1 -0100} {-196891200 -7200 0 -0200} {-181166400 -3600 1 -0100} {-165441600 -7200 0 -0200} {-149716800 -3600 1 -0100} {-133992000 -7200 0 -0200} {-118267200 -3600 1 -0100} {-102542400 -3600 0 -0100} {386125200 0 0 +0000} {401850000 -3600 0 -0100} {417574800 0 1 +0000} {433299600 -3600 0 -0100} {449024400 0 1 +0000} {465354000 -3600 0 -0100} {481078800 0 1 +0000} {496803600 -3600 0 -0100} {504925200 -3600 0 -0100} {512528400 0 1 +0000} {528253200 -3600 0 -0100} {543978000 0 1 +0000} {559702800 -3600 0 -0100} {575427600 0 1 +0000} {591152400 -3600 0 -0100} {606877200 0 1 +0000} {622602000 -3600 0 -0100} {638326800 0 1 +0000} {654656400 -3600 0 -0100} {670381200 0 1 +0000} {686106000 -3600 0 -0100} {701830800 0 1 +0000} {717555600 -3600 0 -0100} {725421600 0 0 WET} {733280400 3600 1 WEST} {740278800 0 0 +0000} {749005200 -3600 0 -0100} {764730000 0 1 +0000} {780454800 -3600 0 -0100} {796179600 0 1 +0000} {811904400 -3600 0 -0100} {828234000 0 1 +0000} {846378000 -3600 0 -0100} {859683600 0 1 +0000} {877827600 -3600 0 -0100} {891133200 0 1 +0000} {909277200 -3600 0 -0100} {922582800 0 1 +0000} {941331600 -3600 0 -0100} {954032400 0 1 +0000} {972781200 -3600 0 -0100} {985482000 0 1 +0000} {1004230800 -3600 0 -0100} {1017536400 0 1 +0000} {1035680400 -3600 0 -0100} {1048986000 0 1 +0000} {1067130000 -3600 0 -0100} {1080435600 0 1 +0000} {1099184400 -3600 0 -0100} {1111885200 0 1 +0000} {1130634000 -3600 0 -0100} {1143334800 0 1 +0000} {1162083600 -3600 0 -0100} {1174784400 0 1 +0000} {1193533200 -3600 0 -0100} {1206838800 0 1 +0000} {1224982800 -3600 0 -0100} {1238288400 0 1 +0000} {1256432400 -3600 0 -0100} {1269738000 0 1 +0000} {1288486800 -3600 0 -0100} {1301187600 0 1 +0000} {1319936400 -3600 0 -0100} {1332637200 0 1 +0000} {1351386000 -3600 0 -0100} {1364691600 0 1 +0000} {1382835600 -3600 0 -0100} {1396141200 0 1 +0000} {1414285200 -3600 0 -0100} {1427590800 0 1 +0000} {1445734800 -3600 0 -0100} {1459040400 0 1 +0000} {1477789200 -3600 0 -0100} {1490490000 0 1 +0000} {1509238800 -3600 0 -0100} {1521939600 0 1 +0000} {1540688400 -3600 0 -0100} {1553994000 0 1 +0000} {1572138000 -3600 0 -0100} {1585443600 0 1 +0000} {1603587600 -3600 0 -0100} {1616893200 0 1 +0000} {1635642000 -3600 0 -0100} {1648342800 0 1 +0000} {1667091600 -3600 0 -0100} {1679792400 0 1 +0000} {1698541200 -3600 0 -0100} {1711846800 0 1 +0000} {1729990800 -3600 0 -0100} {1743296400 0 1 +0000} {1761440400 -3600 0 -0100} {1774746000 0 1 +0000} {1792890000 -3600 0 -0100} {1806195600 0 1 +0000} {1824944400 -3600 0 -0100} {1837645200 0 1 +0000} {1856394000 -3600 0 -0100} {1869094800 0 1 +0000} {1887843600 -3600 0 -0100} {1901149200 0 1 +0000} {1919293200 -3600 0 -0100} {1932598800 0 1 +0000} {1950742800 -3600 0 -0100} {1964048400 0 1 +0000} {1982797200 -3600 0 -0100} {1995498000 0 1 +0000} {2014246800 -3600 0 -0100} {2026947600 0 1 +0000} {2045696400 -3600 0 -0100} {2058397200 0 1 +0000} {2077146000 -3600 0 -0100} {2090451600 0 1 +0000} {2108595600 -3600 0 -0100} {2121901200 0 1 +0000} {2140045200 -3600 0 -0100} {2153350800 0 1 +0000} {2172099600 -3600 0 -0100} {2184800400 0 1 +0000} {2203549200 -3600 0 -0100} {2216250000 0 1 +0000} {2234998800 -3600 0 -0100} {2248304400 0 1 +0000} {2266448400 -3600 0 -0100} {2279754000 0 1 +0000} {2297898000 -3600 0 -0100} {2311203600 0 1 +0000} {2329347600 -3600 0 -0100} {2342653200 0 1 +0000} {2361402000 -3600 0 -0100} {2374102800 0 1 +0000} {2392851600 -3600 0 -0100} {2405552400 0 1 +0000} {2424301200 -3600 0 -0100} {2437606800 0 1 +0000} {2455750800 -3600 0 -0100} {2469056400 0 1 +0000} {2487200400 -3600 0 -0100} {2500506000 0 1 +0000} {2519254800 -3600 0 -0100} {2531955600 0 1 +0000} {2550704400 -3600 0 -0100} {2563405200 0 1 +0000} {2582154000 -3600 0 -0100} {2595459600 0 1 +0000} {2613603600 -3600 0 -0100} {2626909200 0 1 +0000} {2645053200 -3600 0 -0100} {2658358800 0 1 +0000} {2676502800 -3600 0 -0100} {2689808400 0 1 +0000} {2708557200 -3600 0 -0100} {2721258000 0 1 +0000} {2740006800 -3600 0 -0100} {2752707600 0 1 +0000} {2771456400 -3600 0 -0100} {2784762000 0 1 +0000} {2802906000 -3600 0 -0100} {2816211600 0 1 +0000} {2834355600 -3600 0 -0100} {2847661200 0 1 +0000} {2866410000 -3600 0 -0100} {2879110800 0 1 +0000} {2897859600 -3600 0 -0100} {2910560400 0 1 +0000} {2929309200 -3600 0 -0100} {2942010000 0 1 +0000} {2960758800 -3600 0 -0100} {2974064400 0 1 +0000} {2992208400 -3600 0 -0100} {3005514000 0 1 +0000} {3023658000 -3600 0 -0100} {3036963600 0 1 +0000} {3055712400 -3600 0 -0100} {3068413200 0 1 +0000} {3087162000 -3600 0 -0100} {3099862800 0 1 +0000} {3118611600 -3600 0 -0100} {3131917200 0 1 +0000} {3150061200 -3600 0 -0100} {3163366800 0 1 +0000} {3181510800 -3600 0 -0100} {3194816400 0 1 +0000} {3212960400 -3600 0 -0100} {3226266000 0 1 +0000} {3245014800 -3600 0 -0100} {3257715600 0 1 +0000} {3276464400 -3600 0 -0100} {3289165200 0 1 +0000} {3307914000 -3600 0 -0100} {3321219600 0 1 +0000} {3339363600 -3600 0 -0100} {3352669200 0 1 +0000} {3370813200 -3600 0 -0100} {3384118800 0 1 +0000} {3402867600 -3600 0 -0100} {3415568400 0 1 +0000} {3434317200 -3600 0 -0100} {3447018000 0 1 +0000} {3465766800 -3600 0 -0100} {3479072400 0 1 +0000} {3497216400 -3600 0 -0100} {3510522000 0 1 +0000} {3528666000 -3600 0 -0100} {3541971600 0 1 +0000} {3560115600 -3600 0 -0100} {3573421200 0 1 +0000} {3592170000 -3600 0 -0100} {3604870800 0 1 +0000} {3623619600 -3600 0 -0100} {3636320400 0 1 +0000} {3655069200 -3600 0 -0100} {3668374800 0 1 +0000} {3686518800 -3600 0 -0100} {3699824400 0 1 +0000} {3717968400 -3600 0 -0100} {3731274000 0 1 +0000} {3750022800 -3600 0 -0100} {3762723600 0 1 +0000} {3781472400 -3600 0 -0100} {3794173200 0 1 +0000} {3812922000 -3600 0 -0100} {3825622800 0 1 +0000} {3844371600 -3600 0 -0100} {3857677200 0 1 +0000} {3875821200 -3600 0 -0100} {3889126800 0 1 +0000} {3907270800 -3600 0 -0100} {3920576400 0 1 +0000} {3939325200 -3600 0 -0100} {3952026000 0 1 +0000} {3970774800 -3600 0 -0100} {3983475600 0 1 +0000} {4002224400 -3600 0 -0100} {4015530000 0 1 +0000} {4033674000 -3600 0 -0100} {4046979600 0 1 +0000} {4065123600 -3600 0 -0100} {4078429200 0 1 +0000} {4096573200 -3600 0 -0100} } tcl9.0.3/library/tzdata/Asia/0000755000175000017500000000000015104662345015364 5ustar sergeisergeitcl9.0.3/library/tzdata/Asia/Yerevan0000664000175000017500000000405115035744305016722 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Yerevan) { {-9223372036854775808 10680 0 LMT} {-1441162680 10800 0 +0300} {-405140400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 18000 1 +0500} {622591200 14400 0 +0400} {638316000 18000 1 +0500} {654645600 14400 0 +0400} {670370400 10800 0 +0300} {670374000 14400 1 +0400} {686098800 10800 0 +0300} {701823600 14400 1 +0400} {717548400 10800 0 +0300} {733273200 14400 1 +0400} {748998000 10800 0 +0300} {764722800 14400 1 +0400} {780447600 10800 0 +0300} {796172400 14400 1 +0400} {811897200 14400 0 +0400} {852062400 14400 0 +0400} {859672800 18000 1 +0500} {877816800 14400 0 +0400} {891122400 18000 1 +0500} {909266400 14400 0 +0400} {922572000 18000 1 +0500} {941320800 14400 0 +0400} {954021600 18000 1 +0500} {972770400 14400 0 +0400} {985471200 18000 1 +0500} {1004220000 14400 0 +0400} {1017525600 18000 1 +0500} {1035669600 14400 0 +0400} {1048975200 18000 1 +0500} {1067119200 14400 0 +0400} {1080424800 18000 1 +0500} {1099173600 14400 0 +0400} {1111874400 18000 1 +0500} {1130623200 14400 0 +0400} {1143324000 18000 1 +0500} {1162072800 14400 0 +0400} {1174773600 18000 1 +0500} {1193522400 14400 0 +0400} {1206828000 18000 1 +0500} {1224972000 14400 0 +0400} {1238277600 18000 1 +0500} {1256421600 14400 0 +0400} {1269727200 18000 1 +0500} {1288476000 14400 0 +0400} {1293825600 14400 0 +0400} {1301176800 18000 1 +0500} {1319925600 14400 0 +0400} } tcl9.0.3/library/tzdata/Asia/Yekaterinburg0000664000175000017500000000415315035744305020127 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Yekaterinburg) { {-9223372036854775808 14553 0 LMT} {-1688270553 13505 0 PMT} {-1592610305 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {796165200 21600 1 +0600} {811890000 18000 0 +0500} {828219600 21600 1 +0600} {846363600 18000 0 +0500} {859669200 21600 1 +0600} {877813200 18000 0 +0500} {891118800 21600 1 +0600} {909262800 18000 0 +0500} {922568400 21600 1 +0600} {941317200 18000 0 +0500} {954018000 21600 1 +0600} {972766800 18000 0 +0500} {985467600 21600 1 +0600} {1004216400 18000 0 +0500} {1017522000 21600 1 +0600} {1035666000 18000 0 +0500} {1048971600 21600 1 +0600} {1067115600 18000 0 +0500} {1080421200 21600 1 +0600} {1099170000 18000 0 +0500} {1111870800 21600 1 +0600} {1130619600 18000 0 +0500} {1143320400 21600 1 +0600} {1162069200 18000 0 +0500} {1174770000 21600 1 +0600} {1193518800 18000 0 +0500} {1206824400 21600 1 +0600} {1224968400 18000 0 +0500} {1238274000 21600 1 +0600} {1256418000 18000 0 +0500} {1269723600 21600 1 +0600} {1288472400 18000 0 +0500} {1301173200 21600 0 +0600} {1414267200 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Yangon0000664000175000017500000000035515035744305016547 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Yangon) { {-9223372036854775808 23087 0 LMT} {-2840163887 23087 0 RMT} {-1577946287 23400 0 +0630} {-873268200 32400 0 +0900} {-778410000 23400 0 +0630} } tcl9.0.3/library/tzdata/Asia/Yakutsk0000664000175000017500000000410715035744305016746 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Yakutsk) { {-9223372036854775808 31138 0 LMT} {-1579423138 28800 0 +0800} {-1247558400 32400 0 +0900} {354898800 36000 1 +1000} {370706400 32400 0 +0900} {386434800 36000 1 +1000} {402242400 32400 0 +0900} {417970800 36000 1 +1000} {433778400 32400 0 +0900} {449593200 36000 1 +1000} {465325200 32400 0 +0900} {481050000 36000 1 +1000} {496774800 32400 0 +0900} {512499600 36000 1 +1000} {528224400 32400 0 +0900} {543949200 36000 1 +1000} {559674000 32400 0 +0900} {575398800 36000 1 +1000} {591123600 32400 0 +0900} {606848400 36000 1 +1000} {622573200 32400 0 +0900} {638298000 36000 1 +1000} {654627600 32400 0 +0900} {670352400 28800 0 +0800} {670356000 32400 1 +0900} {686080800 28800 0 +0800} {695757600 32400 0 +0900} {701802000 36000 1 +1000} {717526800 32400 0 +0900} {733251600 36000 1 +1000} {748976400 32400 0 +0900} {764701200 36000 1 +1000} {780426000 32400 0 +0900} {796150800 36000 1 +1000} {811875600 32400 0 +0900} {828205200 36000 1 +1000} {846349200 32400 0 +0900} {859654800 36000 1 +1000} {877798800 32400 0 +0900} {891104400 36000 1 +1000} {909248400 32400 0 +0900} {922554000 36000 1 +1000} {941302800 32400 0 +0900} {954003600 36000 1 +1000} {972752400 32400 0 +0900} {985453200 36000 1 +1000} {1004202000 32400 0 +0900} {1017507600 36000 1 +1000} {1035651600 32400 0 +0900} {1048957200 36000 1 +1000} {1067101200 32400 0 +0900} {1080406800 36000 1 +1000} {1099155600 32400 0 +0900} {1111856400 36000 1 +1000} {1130605200 32400 0 +0900} {1143306000 36000 1 +1000} {1162054800 32400 0 +0900} {1174755600 36000 1 +1000} {1193504400 32400 0 +0900} {1206810000 36000 1 +1000} {1224954000 32400 0 +0900} {1238259600 36000 1 +1000} {1256403600 32400 0 +0900} {1269709200 36000 1 +1000} {1288458000 32400 0 +0900} {1301158800 36000 0 +1000} {1414252800 32400 0 +0900} } tcl9.0.3/library/tzdata/Asia/Vladivostok0000664000175000017500000000411315035744305017615 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Vladivostok) { {-9223372036854775808 31651 0 LMT} {-1487321251 32400 0 +0900} {-1247562000 36000 0 +1000} {354895200 39600 1 +1100} {370702800 36000 0 +1000} {386431200 39600 1 +1100} {402238800 36000 0 +1000} {417967200 39600 1 +1100} {433774800 36000 0 +1000} {449589600 39600 1 +1100} {465321600 36000 0 +1000} {481046400 39600 1 +1100} {496771200 36000 0 +1000} {512496000 39600 1 +1100} {528220800 36000 0 +1000} {543945600 39600 1 +1100} {559670400 36000 0 +1000} {575395200 39600 1 +1100} {591120000 36000 0 +1000} {606844800 39600 1 +1100} {622569600 36000 0 +1000} {638294400 39600 1 +1100} {654624000 36000 0 +1000} {670348800 32400 0 +0900} {670352400 36000 1 +1000} {686077200 32400 0 +0900} {695754000 36000 0 +1000} {701798400 39600 1 +1100} {717523200 36000 0 +1000} {733248000 39600 1 +1100} {748972800 36000 0 +1000} {764697600 39600 1 +1100} {780422400 36000 0 +1000} {796147200 39600 1 +1100} {811872000 36000 0 +1000} {828201600 39600 1 +1100} {846345600 36000 0 +1000} {859651200 39600 1 +1100} {877795200 36000 0 +1000} {891100800 39600 1 +1100} {909244800 36000 0 +1000} {922550400 39600 1 +1100} {941299200 36000 0 +1000} {954000000 39600 1 +1100} {972748800 36000 0 +1000} {985449600 39600 1 +1100} {1004198400 36000 0 +1000} {1017504000 39600 1 +1100} {1035648000 36000 0 +1000} {1048953600 39600 1 +1100} {1067097600 36000 0 +1000} {1080403200 39600 1 +1100} {1099152000 36000 0 +1000} {1111852800 39600 1 +1100} {1130601600 36000 0 +1000} {1143302400 39600 1 +1100} {1162051200 36000 0 +1000} {1174752000 39600 1 +1100} {1193500800 36000 0 +1000} {1206806400 39600 1 +1100} {1224950400 36000 0 +1000} {1238256000 39600 1 +1100} {1256400000 36000 0 +1000} {1269705600 39600 1 +1100} {1288454400 36000 0 +1000} {1301155200 39600 0 +1100} {1414249200 36000 0 +1000} } tcl9.0.3/library/tzdata/Asia/Vientiane0000664000175000017500000000025615035744305017236 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Bangkok)]} { LoadTimeZoneFile Asia/Bangkok } set TZData(:Asia/Vientiane) $TZData(:Asia/Bangkok) tcl9.0.3/library/tzdata/Asia/Ust-Nera0000664000175000017500000000410715035744305016751 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Ust-Nera) { {-9223372036854775808 34374 0 LMT} {-1579426374 28800 0 +0800} {354898800 43200 0 +1200} {370699200 39600 0 +1100} {386427600 43200 1 +1200} {402235200 39600 0 +1100} {417963600 43200 1 +1200} {433771200 39600 0 +1100} {449586000 43200 1 +1200} {465318000 39600 0 +1100} {481042800 43200 1 +1200} {496767600 39600 0 +1100} {512492400 43200 1 +1200} {528217200 39600 0 +1100} {543942000 43200 1 +1200} {559666800 39600 0 +1100} {575391600 43200 1 +1200} {591116400 39600 0 +1100} {606841200 43200 1 +1200} {622566000 39600 0 +1100} {638290800 43200 1 +1200} {654620400 39600 0 +1100} {670345200 36000 0 +1000} {670348800 39600 1 +1100} {686073600 36000 0 +1000} {695750400 39600 0 +1100} {701794800 43200 1 +1200} {717519600 39600 0 +1100} {733244400 43200 1 +1200} {748969200 39600 0 +1100} {764694000 43200 1 +1200} {780418800 39600 0 +1100} {796143600 43200 1 +1200} {811868400 39600 0 +1100} {828198000 43200 1 +1200} {846342000 39600 0 +1100} {859647600 43200 1 +1200} {877791600 39600 0 +1100} {891097200 43200 1 +1200} {909241200 39600 0 +1100} {922546800 43200 1 +1200} {941295600 39600 0 +1100} {953996400 43200 1 +1200} {972745200 39600 0 +1100} {985446000 43200 1 +1200} {1004194800 39600 0 +1100} {1017500400 43200 1 +1200} {1035644400 39600 0 +1100} {1048950000 43200 1 +1200} {1067094000 39600 0 +1100} {1080399600 43200 1 +1200} {1099148400 39600 0 +1100} {1111849200 43200 1 +1200} {1130598000 39600 0 +1100} {1143298800 43200 1 +1200} {1162047600 39600 0 +1100} {1174748400 43200 1 +1200} {1193497200 39600 0 +1100} {1206802800 43200 1 +1200} {1224946800 39600 0 +1100} {1238252400 43200 1 +1200} {1256396400 39600 0 +1100} {1269702000 43200 1 +1200} {1288450800 39600 0 +1100} {1301151600 43200 0 +1200} {1315828800 39600 0 +1100} {1414249200 36000 0 +1000} } tcl9.0.3/library/tzdata/Asia/Urumqi0000664000175000017500000000022115035744305016566 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Urumqi) { {-9223372036854775808 21020 0 LMT} {-1325483420 21600 0 +0600} } tcl9.0.3/library/tzdata/Asia/Ulan_Bator0000664000175000017500000000027315035744305017341 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Ulaanbaatar)]} { LoadTimeZoneFile Asia/Ulaanbaatar } set TZData(:Asia/Ulan_Bator) $TZData(:Asia/Ulaanbaatar) tcl9.0.3/library/tzdata/Asia/Ulaanbaatar0000664000175000017500000000314315035744305017525 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Ulaanbaatar) { {-9223372036854775808 25652 0 LMT} {-2032931252 25200 0 +0700} {252435600 28800 0 +0800} {417974400 32400 1 +0900} {433782000 28800 0 +0800} {449596800 32400 1 +0900} {465318000 28800 0 +0800} {481046400 32400 1 +0900} {496767600 28800 0 +0800} {512496000 32400 1 +0900} {528217200 28800 0 +0800} {543945600 32400 1 +0900} {559666800 28800 0 +0800} {575395200 32400 1 +0900} {591116400 28800 0 +0800} {606844800 32400 1 +0900} {622566000 28800 0 +0800} {638294400 32400 1 +0900} {654620400 28800 0 +0800} {670348800 32400 1 +0900} {686070000 28800 0 +0800} {701798400 32400 1 +0900} {717519600 28800 0 +0800} {733248000 32400 1 +0900} {748969200 28800 0 +0800} {764697600 32400 1 +0900} {780418800 28800 0 +0800} {796147200 32400 1 +0900} {811868400 28800 0 +0800} {828201600 32400 1 +0900} {843922800 28800 0 +0800} {859651200 32400 1 +0900} {875372400 28800 0 +0800} {891100800 32400 1 +0900} {906822000 28800 0 +0800} {988394400 32400 1 +0900} {1001696400 28800 0 +0800} {1017424800 32400 1 +0900} {1033146000 28800 0 +0800} {1048874400 32400 1 +0900} {1064595600 28800 0 +0800} {1080324000 32400 1 +0900} {1096045200 28800 0 +0800} {1111773600 32400 1 +0900} {1127494800 28800 0 +0800} {1143223200 32400 1 +0900} {1159549200 28800 0 +0800} {1427479200 32400 1 +0900} {1443193200 28800 0 +0800} {1458928800 32400 1 +0900} {1474642800 28800 0 +0800} } tcl9.0.3/library/tzdata/Asia/Ujung_Pandang0000664000175000017500000000026515035744305020034 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Makassar)]} { LoadTimeZoneFile Asia/Makassar } set TZData(:Asia/Ujung_Pandang) $TZData(:Asia/Makassar) tcl9.0.3/library/tzdata/Asia/Tomsk0000664000175000017500000000420315035744305016405 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Tomsk) { {-9223372036854775808 20391 0 LMT} {-1578807591 21600 0 +0600} {-1247551200 25200 0 +0700} {354906000 28800 1 +0800} {370713600 25200 0 +0700} {386442000 28800 1 +0800} {402249600 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465332400 25200 0 +0700} {481057200 28800 1 +0800} {496782000 25200 0 +0700} {512506800 28800 1 +0800} {528231600 25200 0 +0700} {543956400 28800 1 +0800} {559681200 25200 0 +0700} {575406000 28800 1 +0800} {591130800 25200 0 +0700} {606855600 28800 1 +0800} {622580400 25200 0 +0700} {638305200 28800 1 +0800} {654634800 25200 0 +0700} {670359600 21600 0 +0600} {670363200 25200 1 +0700} {686088000 21600 0 +0600} {695764800 25200 0 +0700} {701809200 28800 1 +0800} {717534000 25200 0 +0700} {733258800 28800 1 +0800} {748983600 25200 0 +0700} {764708400 28800 1 +0800} {780433200 25200 0 +0700} {796158000 28800 1 +0800} {811882800 25200 0 +0700} {828212400 28800 1 +0800} {846356400 25200 0 +0700} {859662000 28800 1 +0800} {877806000 25200 0 +0700} {891111600 28800 1 +0800} {909255600 25200 0 +0700} {922561200 28800 1 +0800} {941310000 25200 0 +0700} {954010800 28800 1 +0800} {972759600 25200 0 +0700} {985460400 28800 1 +0800} {1004209200 25200 0 +0700} {1017514800 28800 1 +0800} {1020196800 25200 0 +0700} {1035662400 21600 0 +0600} {1048968000 25200 1 +0700} {1067112000 21600 0 +0600} {1080417600 25200 1 +0700} {1099166400 21600 0 +0600} {1111867200 25200 1 +0700} {1130616000 21600 0 +0600} {1143316800 25200 1 +0700} {1162065600 21600 0 +0600} {1174766400 25200 1 +0700} {1193515200 21600 0 +0600} {1206820800 25200 1 +0700} {1224964800 21600 0 +0600} {1238270400 25200 1 +0700} {1256414400 21600 0 +0600} {1269720000 25200 1 +0700} {1288468800 21600 0 +0600} {1301169600 25200 0 +0700} {1414263600 21600 0 +0600} {1464465600 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Tokyo0000664000175000017500000000056615035744305016425 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Tokyo) { {-9223372036854775808 33539 0 LMT} {-2587712400 32400 0 JST} {-683802000 36000 1 JDT} {-672310800 32400 0 JST} {-654771600 36000 1 JDT} {-640861200 32400 0 JST} {-620298000 36000 1 JDT} {-609411600 32400 0 JST} {-588848400 36000 1 JDT} {-577962000 32400 0 JST} } tcl9.0.3/library/tzdata/Asia/Thimphu0000664000175000017500000000025715035744305016733 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Thimphu) { {-9223372036854775808 21516 0 LMT} {-706341516 19800 0 +0530} {560025000 21600 0 +0600} } tcl9.0.3/library/tzdata/Asia/Thimbu0000664000175000017500000000025315035744305016541 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Thimphu)]} { LoadTimeZoneFile Asia/Thimphu } set TZData(:Asia/Thimbu) $TZData(:Asia/Thimphu) tcl9.0.3/library/tzdata/Asia/Tel_Aviv0000664000175000017500000000026315035744305017023 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Jerusalem)]} { LoadTimeZoneFile Asia/Jerusalem } set TZData(:Asia/Tel_Aviv) $TZData(:Asia/Jerusalem) tcl9.0.3/library/tzdata/Asia/Tehran0000664000175000017500000000435415076154260016540 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Tehran) { {-9223372036854775808 12344 0 LMT} {-1704165944 12344 0 TMT} {-1090466744 12600 0 +0330} {227820600 16200 1 +0430} {246227400 14400 0 +0400} {259617600 18000 1 +0500} {271108800 14400 0 +0400} {279576000 12600 0 +0330} {296598600 16200 1 +0430} {306531000 12600 0 +0330} {322432200 16200 1 +0430} {338499000 12600 0 +0330} {673216200 16200 1 +0430} {685481400 12600 0 +0330} {701209800 16200 1 +0430} {717103800 12600 0 +0330} {732745800 16200 1 +0430} {748639800 12600 0 +0330} {764281800 16200 1 +0430} {780175800 12600 0 +0330} {795817800 16200 1 +0430} {811711800 12600 0 +0330} {827353800 16200 1 +0430} {843247800 12600 0 +0330} {858976200 16200 1 +0430} {874870200 12600 0 +0330} {890512200 16200 1 +0430} {906406200 12600 0 +0330} {922048200 16200 1 +0430} {937942200 12600 0 +0330} {953584200 16200 1 +0430} {969478200 12600 0 +0330} {985206600 16200 1 +0430} {1001100600 12600 0 +0330} {1016742600 16200 1 +0430} {1032636600 12600 0 +0330} {1048278600 16200 1 +0430} {1064172600 12600 0 +0330} {1079814600 16200 1 +0430} {1095708600 12600 0 +0330} {1111437000 16200 1 +0430} {1127331000 12600 0 +0330} {1206045000 16200 1 +0430} {1221939000 12600 0 +0330} {1237667400 16200 1 +0430} {1253561400 12600 0 +0330} {1269203400 16200 1 +0430} {1285097400 12600 0 +0330} {1300739400 16200 1 +0430} {1316633400 12600 0 +0330} {1332275400 16200 1 +0430} {1348169400 12600 0 +0330} {1363897800 16200 1 +0430} {1379791800 12600 0 +0330} {1395433800 16200 1 +0430} {1411327800 12600 0 +0330} {1426969800 16200 1 +0430} {1442863800 12600 0 +0330} {1458505800 16200 1 +0430} {1474399800 12600 0 +0330} {1490128200 16200 1 +0430} {1506022200 12600 0 +0330} {1521664200 16200 1 +0430} {1537558200 12600 0 +0330} {1553200200 16200 1 +0430} {1569094200 12600 0 +0330} {1584736200 16200 1 +0430} {1600630200 12600 0 +0330} {1616358600 16200 1 +0430} {1632252600 12600 0 +0330} {1647894600 16200 1 +0430} {1663788600 12600 0 +0330} } tcl9.0.3/library/tzdata/Asia/Tbilisi0000664000175000017500000000336115035744305016713 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Tbilisi) { {-9223372036854775808 10751 0 LMT} {-2840151551 10751 0 TBMT} {-1441162751 10800 0 +0300} {-405140400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 18000 1 +0500} {622591200 14400 0 +0400} {638316000 18000 1 +0500} {654645600 14400 0 +0400} {670370400 10800 0 +0300} {670374000 14400 1 +0400} {686098800 10800 0 +0300} {694213200 10800 0 +0300} {701816400 14400 1 +0400} {717537600 10800 0 +0300} {733266000 14400 1 +0400} {748987200 10800 0 +0300} {764715600 14400 1 +0400} {780440400 14400 0 +0400} {796161600 18000 1 +0500} {811882800 14400 0 +0400} {828216000 18000 1 +0500} {846360000 18000 1 +0500} {859662000 18000 0 +0500} {877806000 14400 0 +0400} {891115200 18000 1 +0500} {909255600 14400 0 +0400} {922564800 18000 1 +0500} {941310000 14400 0 +0400} {954014400 18000 1 +0500} {972759600 14400 0 +0400} {985464000 18000 1 +0500} {1004209200 14400 0 +0400} {1017518400 18000 1 +0500} {1035658800 14400 0 +0400} {1048968000 18000 1 +0500} {1067108400 14400 0 +0400} {1080417600 18000 1 +0500} {1088280000 14400 0 +0400} {1099177200 10800 0 +0300} {1111878000 14400 0 +0400} } tcl9.0.3/library/tzdata/Asia/Tashkent0000664000175000017500000000160315035744305017072 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Tashkent) { {-9223372036854775808 16631 0 LMT} {-1441168631 18000 0 +0500} {-1247547600 21600 0 +0600} {354909600 25200 1 +0700} {370717200 21600 0 +0600} {386445600 25200 1 +0700} {402253200 21600 0 +0600} {417981600 25200 1 +0700} {433789200 21600 0 +0600} {449604000 25200 1 +0700} {465336000 21600 0 +0600} {481060800 25200 1 +0700} {496785600 21600 0 +0600} {512510400 25200 1 +0700} {528235200 21600 0 +0600} {543960000 25200 1 +0700} {559684800 21600 0 +0600} {575409600 25200 1 +0700} {591134400 21600 0 +0600} {606859200 25200 1 +0700} {622584000 21600 0 +0600} {638308800 25200 1 +0700} {654638400 21600 0 +0600} {670363200 18000 0 +0500} {670366800 21600 1 +0600} {686091600 18000 0 +0500} {694206000 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Taipei0000664000175000017500000000242215035744305016524 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Taipei) { {-9223372036854775808 29160 0 LMT} {-2335248360 28800 0 CST} {-1017820800 32400 0 JST} {-766224000 28800 0 CST} {-745833600 32400 1 CDT} {-733827600 28800 0 CST} {-716889600 32400 1 CDT} {-699613200 28800 0 CST} {-683884800 32400 1 CDT} {-670669200 28800 0 CST} {-652348800 32400 1 CDT} {-639133200 28800 0 CST} {-620812800 32400 1 CDT} {-607597200 28800 0 CST} {-589276800 32400 1 CDT} {-576061200 28800 0 CST} {-562924800 32400 1 CDT} {-541760400 28800 0 CST} {-528710400 32400 1 CDT} {-510224400 28800 0 CST} {-497174400 32400 1 CDT} {-478688400 28800 0 CST} {-465638400 32400 1 CDT} {-449830800 28800 0 CST} {-434016000 32400 1 CDT} {-418208400 28800 0 CST} {-402480000 32400 1 CDT} {-386672400 28800 0 CST} {-370944000 32400 1 CDT} {-355136400 28800 0 CST} {-339408000 32400 1 CDT} {-323600400 28800 0 CST} {-302515200 32400 1 CDT} {-291978000 28800 0 CST} {-270979200 32400 1 CDT} {-260442000 28800 0 CST} {133977600 32400 1 CDT} {149785200 28800 0 CST} {165513600 32400 1 CDT} {181321200 28800 0 CST} {299606400 32400 1 CDT} {307551600 28800 0 CST} } tcl9.0.3/library/tzdata/Asia/Srednekolymsk0000664000175000017500000000411515035744305020144 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Srednekolymsk) { {-9223372036854775808 36892 0 LMT} {-1441188892 36000 0 +1000} {-1247565600 39600 0 +1100} {354891600 43200 1 +1200} {370699200 39600 0 +1100} {386427600 43200 1 +1200} {402235200 39600 0 +1100} {417963600 43200 1 +1200} {433771200 39600 0 +1100} {449586000 43200 1 +1200} {465318000 39600 0 +1100} {481042800 43200 1 +1200} {496767600 39600 0 +1100} {512492400 43200 1 +1200} {528217200 39600 0 +1100} {543942000 43200 1 +1200} {559666800 39600 0 +1100} {575391600 43200 1 +1200} {591116400 39600 0 +1100} {606841200 43200 1 +1200} {622566000 39600 0 +1100} {638290800 43200 1 +1200} {654620400 39600 0 +1100} {670345200 36000 0 +1000} {670348800 39600 1 +1100} {686073600 36000 0 +1000} {695750400 39600 0 +1100} {701794800 43200 1 +1200} {717519600 39600 0 +1100} {733244400 43200 1 +1200} {748969200 39600 0 +1100} {764694000 43200 1 +1200} {780418800 39600 0 +1100} {796143600 43200 1 +1200} {811868400 39600 0 +1100} {828198000 43200 1 +1200} {846342000 39600 0 +1100} {859647600 43200 1 +1200} {877791600 39600 0 +1100} {891097200 43200 1 +1200} {909241200 39600 0 +1100} {922546800 43200 1 +1200} {941295600 39600 0 +1100} {953996400 43200 1 +1200} {972745200 39600 0 +1100} {985446000 43200 1 +1200} {1004194800 39600 0 +1100} {1017500400 43200 1 +1200} {1035644400 39600 0 +1100} {1048950000 43200 1 +1200} {1067094000 39600 0 +1100} {1080399600 43200 1 +1200} {1099148400 39600 0 +1100} {1111849200 43200 1 +1200} {1130598000 39600 0 +1100} {1143298800 43200 1 +1200} {1162047600 39600 0 +1100} {1174748400 43200 1 +1200} {1193497200 39600 0 +1100} {1206802800 43200 1 +1200} {1224946800 39600 0 +1100} {1238252400 43200 1 +1200} {1256396400 39600 0 +1100} {1269702000 43200 1 +1200} {1288450800 39600 0 +1100} {1301151600 43200 0 +1200} {1414245600 39600 0 +1100} } tcl9.0.3/library/tzdata/Asia/Singapore0000664000175000017500000000055515035744305017245 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Singapore) { {-9223372036854775808 24925 0 LMT} {-2177477725 24925 0 SMT} {-2038200925 25200 0 +0700} {-1167634800 26400 1 +0720} {-1073028000 26400 0 +0720} {-894180000 27000 0 +0730} {-879665400 32400 0 +0900} {-767005200 27000 0 +0730} {378662400 28800 0 +0800} } tcl9.0.3/library/tzdata/Asia/Shanghai0000664000175000017500000000166315035744305017041 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Shanghai) { {-9223372036854775808 29143 0 LMT} {-2177481943 28800 0 CST} {-1600675200 32400 1 CDT} {-1585904400 28800 0 CST} {-933667200 32400 1 CDT} {-922093200 28800 0 CST} {-908870400 32400 1 CDT} {-888829200 28800 0 CST} {-881049600 32400 1 CDT} {-767869200 28800 0 CST} {-745833600 32400 1 CDT} {-733827600 28800 0 CST} {-716889600 32400 1 CDT} {-699613200 28800 0 CST} {-683884800 32400 1 CDT} {-670669200 28800 0 CST} {-652348800 32400 1 CDT} {-650016000 28800 0 CST} {515527200 32400 1 CDT} {527014800 28800 0 CST} {545162400 32400 1 CDT} {558464400 28800 0 CST} {577216800 32400 1 CDT} {589914000 28800 0 CST} {608666400 32400 1 CDT} {621968400 28800 0 CST} {640116000 32400 1 CDT} {653418000 28800 0 CST} {671565600 32400 1 CDT} {684867600 28800 0 CST} } tcl9.0.3/library/tzdata/Asia/Seoul0000664000175000017500000000166715035744305016412 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Seoul) { {-9223372036854775808 30472 0 LMT} {-1948782472 30600 0 KST} {-1830414600 32400 0 JST} {-767350800 32400 0 KST} {-681210000 36000 1 KDT} {-672228000 32400 0 KST} {-654771600 36000 1 KDT} {-640864800 32400 0 KST} {-623408400 36000 1 KDT} {-609415200 32400 0 KST} {-588848400 36000 1 KDT} {-577965600 32400 0 KST} {-498128400 30600 0 KST} {-462702600 34200 1 KDT} {-451733400 30600 0 KST} {-429784200 34200 1 KDT} {-418296600 30600 0 KST} {-399544200 34200 1 KDT} {-387451800 30600 0 KST} {-368094600 34200 1 KDT} {-356002200 30600 0 KST} {-336645000 34200 1 KDT} {-324552600 30600 0 KST} {-305195400 34200 1 KDT} {-293103000 30600 0 KST} {-264933000 32400 0 KST} {547578000 36000 1 KDT} {560883600 32400 0 KST} {579027600 36000 1 KDT} {592333200 32400 0 KST} } tcl9.0.3/library/tzdata/Asia/Samarkand0000664000175000017500000000160415035744305017213 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Samarkand) { {-9223372036854775808 16073 0 LMT} {-1441168073 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 21600 1 +0600} {686091600 18000 0 +0500} {694206000 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Sakhalin0000664000175000017500000000420415035744305017043 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Sakhalin) { {-9223372036854775808 34248 0 LMT} {-2031039048 32400 0 +0900} {-768560400 39600 0 +1100} {354891600 43200 1 +1200} {370699200 39600 0 +1100} {386427600 43200 1 +1200} {402235200 39600 0 +1100} {417963600 43200 1 +1200} {433771200 39600 0 +1100} {449586000 43200 1 +1200} {465318000 39600 0 +1100} {481042800 43200 1 +1200} {496767600 39600 0 +1100} {512492400 43200 1 +1200} {528217200 39600 0 +1100} {543942000 43200 1 +1200} {559666800 39600 0 +1100} {575391600 43200 1 +1200} {591116400 39600 0 +1100} {606841200 43200 1 +1200} {622566000 39600 0 +1100} {638290800 43200 1 +1200} {654620400 39600 0 +1100} {670345200 36000 0 +1000} {670348800 39600 1 +1100} {686073600 36000 0 +1000} {695750400 39600 0 +1100} {701794800 43200 1 +1200} {717519600 39600 0 +1100} {733244400 43200 1 +1200} {748969200 39600 0 +1100} {764694000 43200 1 +1200} {780418800 39600 0 +1100} {796143600 43200 1 +1200} {811868400 39600 0 +1100} {828198000 43200 1 +1200} {846342000 39600 0 +1100} {859647600 36000 0 +1000} {859651200 39600 1 +1100} {877795200 36000 0 +1000} {891100800 39600 1 +1100} {909244800 36000 0 +1000} {922550400 39600 1 +1100} {941299200 36000 0 +1000} {954000000 39600 1 +1100} {972748800 36000 0 +1000} {985449600 39600 1 +1100} {1004198400 36000 0 +1000} {1017504000 39600 1 +1100} {1035648000 36000 0 +1000} {1048953600 39600 1 +1100} {1067097600 36000 0 +1000} {1080403200 39600 1 +1100} {1099152000 36000 0 +1000} {1111852800 39600 1 +1100} {1130601600 36000 0 +1000} {1143302400 39600 1 +1100} {1162051200 36000 0 +1000} {1174752000 39600 1 +1100} {1193500800 36000 0 +1000} {1206806400 39600 1 +1100} {1224950400 36000 0 +1000} {1238256000 39600 1 +1100} {1256400000 36000 0 +1000} {1269705600 39600 1 +1100} {1288454400 36000 0 +1000} {1301155200 39600 0 +1100} {1414249200 36000 0 +1000} {1459008000 39600 0 +1100} } tcl9.0.3/library/tzdata/Asia/Saigon0000664000175000017500000000026715035744305016536 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Ho_Chi_Minh)]} { LoadTimeZoneFile Asia/Ho_Chi_Minh } set TZData(:Asia/Saigon) $TZData(:Asia/Ho_Chi_Minh) tcl9.0.3/library/tzdata/Asia/Riyadh0000664000175000017500000000022015035744305016523 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Riyadh) { {-9223372036854775808 11212 0 LMT} {-719636812 10800 0 +0300} } tcl9.0.3/library/tzdata/Asia/Rangoon0000664000175000017500000000025115035744305016712 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Yangon)]} { LoadTimeZoneFile Asia/Yangon } set TZData(:Asia/Rangoon) $TZData(:Asia/Yangon) tcl9.0.3/library/tzdata/Asia/Qyzylorda0000664000175000017500000000326615035744305017316 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Qyzylorda) { {-9223372036854775808 15712 0 LMT} {-1441167712 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {701812800 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {796165200 21600 1 +0600} {811890000 18000 0 +0500} {828219600 21600 1 +0600} {846363600 18000 0 +0500} {859669200 21600 1 +0600} {877813200 18000 0 +0500} {891118800 21600 1 +0600} {909262800 18000 0 +0500} {922568400 21600 1 +0600} {941317200 18000 0 +0500} {954018000 21600 1 +0600} {972766800 18000 0 +0500} {985467600 21600 1 +0600} {1004216400 18000 0 +0500} {1017522000 21600 1 +0600} {1035666000 18000 0 +0500} {1048971600 21600 1 +0600} {1067115600 18000 0 +0500} {1080421200 21600 1 +0600} {1099170000 21600 0 +0600} {1545328800 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Qostanay0000664000175000017500000000332315035744305017111 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Qostanay) { {-9223372036854775808 15268 0 LMT} {-1441167268 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {796165200 21600 1 +0600} {811890000 18000 0 +0500} {828219600 21600 1 +0600} {846363600 18000 0 +0500} {859669200 21600 1 +0600} {877813200 18000 0 +0500} {891118800 21600 1 +0600} {909262800 18000 0 +0500} {922568400 21600 1 +0600} {941317200 18000 0 +0500} {954018000 21600 1 +0600} {972766800 18000 0 +0500} {985467600 21600 1 +0600} {1004216400 18000 0 +0500} {1017522000 21600 1 +0600} {1035666000 18000 0 +0500} {1048971600 21600 1 +0600} {1067115600 18000 0 +0500} {1080421200 21600 1 +0600} {1099170000 21600 0 +0600} {1709229600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Qatar0000664000175000017500000000025515035744305016363 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Qatar) { {-9223372036854775808 12368 0 LMT} {-1577935568 14400 0 +0400} {76190400 10800 0 +0300} } tcl9.0.3/library/tzdata/Asia/Pyongyang0000664000175000017500000000040715035744305017265 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Pyongyang) { {-9223372036854775808 30180 0 LMT} {-1948782180 30600 0 KST} {-1830414600 32400 0 JST} {-768646800 32400 0 KST} {1439564400 30600 0 KST} {1525446000 32400 0 KST} } tcl9.0.3/library/tzdata/Asia/Pontianak0000664000175000017500000000055015035744305017235 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Pontianak) { {-9223372036854775808 26240 0 LMT} {-1946186240 26240 0 PMT} {-1172906240 27000 0 +0730} {-881220600 32400 0 +0900} {-766054800 27000 0 +0730} {-683883000 28800 0 +0800} {-620812800 27000 0 +0730} {-189415800 28800 0 WITA} {567964800 25200 0 WIB} } tcl9.0.3/library/tzdata/Asia/Phnom_Penh0000664000175000017500000000025715035744305017350 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Bangkok)]} { LoadTimeZoneFile Asia/Bangkok } set TZData(:Asia/Phnom_Penh) $TZData(:Asia/Bangkok) tcl9.0.3/library/tzdata/Asia/Oral0000664000175000017500000000326015035744305016207 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Oral) { {-9223372036854775808 12324 0 LMT} {-1441164324 10800 0 +0300} {-1247540400 18000 0 +0500} {354913200 21600 1 +0600} {370720800 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 14400 0 +0400} {606866400 18000 1 +0500} {622591200 14400 0 +0400} {638316000 18000 1 +0500} {654645600 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {701816400 14400 0 +0400} {701820000 18000 1 +0500} {717544800 14400 0 +0400} {733269600 18000 1 +0500} {748994400 14400 0 +0400} {764719200 18000 1 +0500} {780444000 14400 0 +0400} {796168800 18000 1 +0500} {811893600 14400 0 +0400} {828223200 18000 1 +0500} {846367200 14400 0 +0400} {859672800 18000 1 +0500} {877816800 14400 0 +0400} {891122400 18000 1 +0500} {909266400 14400 0 +0400} {922572000 18000 1 +0500} {941320800 14400 0 +0400} {954021600 18000 1 +0500} {972770400 14400 0 +0400} {985471200 18000 1 +0500} {1004220000 14400 0 +0400} {1017525600 18000 1 +0500} {1035669600 14400 0 +0400} {1048975200 18000 1 +0500} {1067119200 14400 0 +0400} {1080424800 18000 1 +0500} {1099173600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Omsk0000664000175000017500000000410415035744305016221 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Omsk) { {-9223372036854775808 17610 0 LMT} {-1582088010 18000 0 +0500} {-1247547600 21600 0 +0600} {354909600 25200 1 +0700} {370717200 21600 0 +0600} {386445600 25200 1 +0700} {402253200 21600 0 +0600} {417981600 25200 1 +0700} {433789200 21600 0 +0600} {449604000 25200 1 +0700} {465336000 21600 0 +0600} {481060800 25200 1 +0700} {496785600 21600 0 +0600} {512510400 25200 1 +0700} {528235200 21600 0 +0600} {543960000 25200 1 +0700} {559684800 21600 0 +0600} {575409600 25200 1 +0700} {591134400 21600 0 +0600} {606859200 25200 1 +0700} {622584000 21600 0 +0600} {638308800 25200 1 +0700} {654638400 21600 0 +0600} {670363200 18000 0 +0500} {670366800 21600 1 +0600} {686091600 18000 0 +0500} {695768400 21600 0 +0600} {701812800 25200 1 +0700} {717537600 21600 0 +0600} {733262400 25200 1 +0700} {748987200 21600 0 +0600} {764712000 25200 1 +0700} {780436800 21600 0 +0600} {796161600 25200 1 +0700} {811886400 21600 0 +0600} {828216000 25200 1 +0700} {846360000 21600 0 +0600} {859665600 25200 1 +0700} {877809600 21600 0 +0600} {891115200 25200 1 +0700} {909259200 21600 0 +0600} {922564800 25200 1 +0700} {941313600 21600 0 +0600} {954014400 25200 1 +0700} {972763200 21600 0 +0600} {985464000 25200 1 +0700} {1004212800 21600 0 +0600} {1017518400 25200 1 +0700} {1035662400 21600 0 +0600} {1048968000 25200 1 +0700} {1067112000 21600 0 +0600} {1080417600 25200 1 +0700} {1099166400 21600 0 +0600} {1111867200 25200 1 +0700} {1130616000 21600 0 +0600} {1143316800 25200 1 +0700} {1162065600 21600 0 +0600} {1174766400 25200 1 +0700} {1193515200 21600 0 +0600} {1206820800 25200 1 +0700} {1224964800 21600 0 +0600} {1238270400 25200 1 +0700} {1256414400 21600 0 +0600} {1269720000 25200 1 +0700} {1288468800 21600 0 +0600} {1301169600 25200 0 +0700} {1414263600 21600 0 +0600} } tcl9.0.3/library/tzdata/Asia/Novosibirsk0000664000175000017500000000421015035744305017616 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Novosibirsk) { {-9223372036854775808 19900 0 LMT} {-1579476700 21600 0 +0600} {-1247551200 25200 0 +0700} {354906000 28800 1 +0800} {370713600 25200 0 +0700} {386442000 28800 1 +0800} {402249600 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465332400 25200 0 +0700} {481057200 28800 1 +0800} {496782000 25200 0 +0700} {512506800 28800 1 +0800} {528231600 25200 0 +0700} {543956400 28800 1 +0800} {559681200 25200 0 +0700} {575406000 28800 1 +0800} {591130800 25200 0 +0700} {606855600 28800 1 +0800} {622580400 25200 0 +0700} {638305200 28800 1 +0800} {654634800 25200 0 +0700} {670359600 21600 0 +0600} {670363200 25200 1 +0700} {686088000 21600 0 +0600} {695764800 25200 0 +0700} {701809200 28800 1 +0800} {717534000 25200 0 +0700} {733258800 28800 1 +0800} {738090000 25200 0 +0700} {748987200 21600 0 +0600} {764712000 25200 1 +0700} {780436800 21600 0 +0600} {796161600 25200 1 +0700} {811886400 21600 0 +0600} {828216000 25200 1 +0700} {846360000 21600 0 +0600} {859665600 25200 1 +0700} {877809600 21600 0 +0600} {891115200 25200 1 +0700} {909259200 21600 0 +0600} {922564800 25200 1 +0700} {941313600 21600 0 +0600} {954014400 25200 1 +0700} {972763200 21600 0 +0600} {985464000 25200 1 +0700} {1004212800 21600 0 +0600} {1017518400 25200 1 +0700} {1035662400 21600 0 +0600} {1048968000 25200 1 +0700} {1067112000 21600 0 +0600} {1080417600 25200 1 +0700} {1099166400 21600 0 +0600} {1111867200 25200 1 +0700} {1130616000 21600 0 +0600} {1143316800 25200 1 +0700} {1162065600 21600 0 +0600} {1174766400 25200 1 +0700} {1193515200 21600 0 +0600} {1206820800 25200 1 +0700} {1224964800 21600 0 +0600} {1238270400 25200 1 +0700} {1256414400 21600 0 +0600} {1269720000 25200 1 +0700} {1288468800 21600 0 +0600} {1301169600 25200 0 +0700} {1414263600 21600 0 +0600} {1469304000 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Novokuznetsk0000664000175000017500000000411415035744305020031 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Novokuznetsk) { {-9223372036854775808 20928 0 LMT} {-1441259328 21600 0 +0600} {-1247551200 25200 0 +0700} {354906000 28800 1 +0800} {370713600 25200 0 +0700} {386442000 28800 1 +0800} {402249600 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465332400 25200 0 +0700} {481057200 28800 1 +0800} {496782000 25200 0 +0700} {512506800 28800 1 +0800} {528231600 25200 0 +0700} {543956400 28800 1 +0800} {559681200 25200 0 +0700} {575406000 28800 1 +0800} {591130800 25200 0 +0700} {606855600 28800 1 +0800} {622580400 25200 0 +0700} {638305200 28800 1 +0800} {654634800 25200 0 +0700} {670359600 21600 0 +0600} {670363200 25200 1 +0700} {686088000 21600 0 +0600} {695764800 25200 0 +0700} {701809200 28800 1 +0800} {717534000 25200 0 +0700} {733258800 28800 1 +0800} {748983600 25200 0 +0700} {764708400 28800 1 +0800} {780433200 25200 0 +0700} {796158000 28800 1 +0800} {811882800 25200 0 +0700} {828212400 28800 1 +0800} {846356400 25200 0 +0700} {859662000 28800 1 +0800} {877806000 25200 0 +0700} {891111600 28800 1 +0800} {909255600 25200 0 +0700} {922561200 28800 1 +0800} {941310000 25200 0 +0700} {954010800 28800 1 +0800} {972759600 25200 0 +0700} {985460400 28800 1 +0800} {1004209200 25200 0 +0700} {1017514800 28800 1 +0800} {1035658800 25200 0 +0700} {1048964400 28800 1 +0800} {1067108400 25200 0 +0700} {1080414000 28800 1 +0800} {1099162800 25200 0 +0700} {1111863600 28800 1 +0800} {1130612400 25200 0 +0700} {1143313200 28800 1 +0800} {1162062000 25200 0 +0700} {1174762800 28800 1 +0800} {1193511600 25200 0 +0700} {1206817200 28800 1 +0800} {1224961200 25200 0 +0700} {1238266800 28800 1 +0800} {1256410800 25200 0 +0700} {1269716400 21600 0 +0600} {1269720000 25200 1 +0700} {1288468800 21600 0 +0600} {1301169600 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Nicosia0000664000175000017500000001631015035744305016677 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Nicosia) { {-9223372036854775808 8008 0 LMT} {-1518920008 7200 0 EET} {166572000 10800 1 EEST} {182293200 7200 0 EET} {200959200 10800 1 EEST} {213829200 7200 0 EET} {228866400 10800 1 EEST} {243982800 7200 0 EET} {260316000 10800 1 EEST} {276123600 7200 0 EET} {291765600 10800 1 EEST} {307486800 7200 0 EET} {323820000 10800 1 EEST} {338936400 7200 0 EET} {354664800 10800 1 EEST} {370386000 7200 0 EET} {386114400 10800 1 EEST} {401835600 7200 0 EET} {417564000 10800 1 EEST} {433285200 7200 0 EET} {449013600 10800 1 EEST} {465339600 7200 0 EET} {481068000 10800 1 EEST} {496789200 7200 0 EET} {512517600 10800 1 EEST} {528238800 7200 0 EET} {543967200 10800 1 EEST} {559688400 7200 0 EET} {575416800 10800 1 EEST} {591138000 7200 0 EET} {606866400 10800 1 EEST} {622587600 7200 0 EET} {638316000 10800 1 EEST} {654642000 7200 0 EET} {670370400 10800 1 EEST} {686091600 7200 0 EET} {701820000 10800 1 EEST} {717541200 7200 0 EET} {733269600 10800 1 EEST} {748990800 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {843944400 7200 0 EET} {859672800 10800 1 EEST} {875394000 7200 0 EET} {891122400 10800 1 EEST} {904597200 10800 0 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1477789200 7200 0 EET} {1490490000 10800 1 EEST} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Asia/Muscat0000664000175000017500000000024515035744305016546 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Dubai)]} { LoadTimeZoneFile Asia/Dubai } set TZData(:Asia/Muscat) $TZData(:Asia/Dubai) tcl9.0.3/library/tzdata/Asia/Manila0000664000175000017500000000101015076154260016502 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Manila) { {-9223372036854775808 -57368 0 LMT} {-3944621032 29032 0 LMT} {-2219083200 28800 0 PST} {-1046678400 32400 1 PDT} {-1040115600 28800 0 PST} {-885024000 32400 1 PDT} {-880016400 32400 0 JST} {-783594000 28800 0 PST} {-760089600 28800 0 PST} {-496224000 32400 1 PDT} {-491562000 28800 0 PST} {228326400 32400 1 PDT} {243702000 28800 0 PST} {643219200 32400 1 PDT} {649177200 28800 0 PST} } tcl9.0.3/library/tzdata/Asia/Makassar0000664000175000017500000000035615035744305017057 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Makassar) { {-9223372036854775808 28656 0 LMT} {-1577951856 28656 0 MMT} {-1172908656 28800 0 +0800} {-880272000 32400 0 +0900} {-766054800 28800 0 WITA} } tcl9.0.3/library/tzdata/Asia/Magadan0000664000175000017500000000414615035744305016646 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Magadan) { {-9223372036854775808 36192 0 LMT} {-1441188192 36000 0 +1000} {-1247565600 39600 0 +1100} {354891600 43200 1 +1200} {370699200 39600 0 +1100} {386427600 43200 1 +1200} {402235200 39600 0 +1100} {417963600 43200 1 +1200} {433771200 39600 0 +1100} {449586000 43200 1 +1200} {465318000 39600 0 +1100} {481042800 43200 1 +1200} {496767600 39600 0 +1100} {512492400 43200 1 +1200} {528217200 39600 0 +1100} {543942000 43200 1 +1200} {559666800 39600 0 +1100} {575391600 43200 1 +1200} {591116400 39600 0 +1100} {606841200 43200 1 +1200} {622566000 39600 0 +1100} {638290800 43200 1 +1200} {654620400 39600 0 +1100} {670345200 36000 0 +1000} {670348800 39600 1 +1100} {686073600 36000 0 +1000} {695750400 39600 0 +1100} {701794800 43200 1 +1200} {717519600 39600 0 +1100} {733244400 43200 1 +1200} {748969200 39600 0 +1100} {764694000 43200 1 +1200} {780418800 39600 0 +1100} {796143600 43200 1 +1200} {811868400 39600 0 +1100} {828198000 43200 1 +1200} {846342000 39600 0 +1100} {859647600 43200 1 +1200} {877791600 39600 0 +1100} {891097200 43200 1 +1200} {909241200 39600 0 +1100} {922546800 43200 1 +1200} {941295600 39600 0 +1100} {953996400 43200 1 +1200} {972745200 39600 0 +1100} {985446000 43200 1 +1200} {1004194800 39600 0 +1100} {1017500400 43200 1 +1200} {1035644400 39600 0 +1100} {1048950000 43200 1 +1200} {1067094000 39600 0 +1100} {1080399600 43200 1 +1200} {1099148400 39600 0 +1100} {1111849200 43200 1 +1200} {1130598000 39600 0 +1100} {1143298800 43200 1 +1200} {1162047600 39600 0 +1100} {1174748400 43200 1 +1200} {1193497200 39600 0 +1100} {1206802800 43200 1 +1200} {1224946800 39600 0 +1100} {1238252400 43200 1 +1200} {1256396400 39600 0 +1100} {1269702000 43200 1 +1200} {1288450800 39600 0 +1100} {1301151600 43200 0 +1200} {1414245600 36000 0 +1000} {1461427200 39600 0 +1100} } tcl9.0.3/library/tzdata/Asia/Macau0000664000175000017500000000414715035744305016345 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Macau) { {-9223372036854775808 27250 0 LMT} {-2056692850 28800 0 CST} {-884509200 32400 0 +0900} {-873280800 36000 1 +1000} {-855918000 32400 0 +0900} {-841744800 36000 1 +1000} {-828529200 32400 0 +0900} {-765363600 28800 0 CT} {-747046800 32400 1 CDT} {-733827600 28800 0 CST} {-716461200 32400 1 CDT} {-697021200 28800 0 CST} {-683715600 32400 1 CDT} {-667990800 28800 0 CST} {-654771600 32400 1 CDT} {-636627600 28800 0 CST} {-623322000 32400 1 CDT} {-605178000 28800 0 CST} {-591872400 32400 1 CDT} {-573642000 28800 0 CST} {-559818000 32400 1 CDT} {-541674000 28800 0 CST} {-528368400 32400 1 CDT} {-510224400 28800 0 CST} {-498128400 32400 1 CDT} {-478774800 28800 0 CST} {-466678800 32400 1 CDT} {-446720400 28800 0 CST} {-435229200 32400 1 CDT} {-415258200 28800 0 CST} {-403158600 32400 1 CDT} {-383808600 28800 0 CST} {-371709000 32400 1 CDT} {-352359000 28800 0 CST} {-340259400 32400 1 CDT} {-320909400 28800 0 CST} {-308809800 32400 1 CDT} {-288855000 28800 0 CST} {-277360200 32400 1 CDT} {-257405400 28800 0 CST} {-245910600 32400 1 CDT} {-225955800 28800 0 CST} {-213856200 32400 1 CDT} {-194506200 28800 0 CST} {-182406600 32400 1 CDT} {-163056600 28800 0 CST} {-148537800 32400 1 CDT} {-132820200 28800 0 CST} {-117088200 32400 1 CDT} {-101370600 28800 0 CST} {-85638600 32400 1 CDT} {-69312600 28800 0 CST} {-53584200 32400 1 CDT} {-37863000 28800 0 CST} {-22134600 32400 1 CDT} {-6413400 28800 0 CST} {9315000 32400 1 CDT} {25036200 28800 0 CST} {40764600 32400 1 CDT} {56485800 28800 0 CST} {72214200 32400 1 CDT} {88540200 28800 0 CST} {104268600 32400 1 CDT} {119989800 28800 0 CST} {126041400 32400 1 CDT} {151439400 28800 0 CST} {167167800 32400 1 CDT} {182889000 28800 0 CST} {198617400 32400 1 CDT} {214338600 28800 0 CST} {295385400 32400 1 CDT} {309292200 28800 0 CST} } tcl9.0.3/library/tzdata/Asia/Macao0000664000175000017500000000024415035744305016331 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Macau)]} { LoadTimeZoneFile Asia/Macau } set TZData(:Asia/Macao) $TZData(:Asia/Macau) tcl9.0.3/library/tzdata/Asia/Kuwait0000664000175000017500000000025015035744305016552 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Riyadh)]} { LoadTimeZoneFile Asia/Riyadh } set TZData(:Asia/Kuwait) $TZData(:Asia/Riyadh) tcl9.0.3/library/tzdata/Asia/Kuching0000664000175000017500000000125015035744305016677 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Kuching) { {-9223372036854775808 26480 0 LMT} {-1383463280 27000 0 +0730} {-1167636600 28800 0 +0800} {-1082448000 30000 1 +0820} {-1074586800 28800 0 +0800} {-1050825600 30000 1 +0820} {-1042964400 28800 0 +0800} {-1019289600 30000 1 +0820} {-1011428400 28800 0 +0800} {-987753600 30000 1 +0820} {-979892400 28800 0 +0800} {-956217600 30000 1 +0820} {-948356400 28800 0 +0800} {-924595200 30000 1 +0820} {-916734000 28800 0 +0800} {-893059200 30000 1 +0820} {-885198000 28800 0 +0800} {-879667200 32400 0 +0900} {-767005200 28800 0 +0800} } tcl9.0.3/library/tzdata/Asia/Kuala_Lumpur0000664000175000017500000000026715035744305017717 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Singapore)]} { LoadTimeZoneFile Asia/Singapore } set TZData(:Asia/Kuala_Lumpur) $TZData(:Asia/Singapore) tcl9.0.3/library/tzdata/Asia/Krasnoyarsk0000664000175000017500000000411315035744305017617 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Krasnoyarsk) { {-9223372036854775808 22286 0 LMT} {-1577513486 21600 0 +0600} {-1247551200 25200 0 +0700} {354906000 28800 1 +0800} {370713600 25200 0 +0700} {386442000 28800 1 +0800} {402249600 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465332400 25200 0 +0700} {481057200 28800 1 +0800} {496782000 25200 0 +0700} {512506800 28800 1 +0800} {528231600 25200 0 +0700} {543956400 28800 1 +0800} {559681200 25200 0 +0700} {575406000 28800 1 +0800} {591130800 25200 0 +0700} {606855600 28800 1 +0800} {622580400 25200 0 +0700} {638305200 28800 1 +0800} {654634800 25200 0 +0700} {670359600 21600 0 +0600} {670363200 25200 1 +0700} {686088000 21600 0 +0600} {695764800 25200 0 +0700} {701809200 28800 1 +0800} {717534000 25200 0 +0700} {733258800 28800 1 +0800} {748983600 25200 0 +0700} {764708400 28800 1 +0800} {780433200 25200 0 +0700} {796158000 28800 1 +0800} {811882800 25200 0 +0700} {828212400 28800 1 +0800} {846356400 25200 0 +0700} {859662000 28800 1 +0800} {877806000 25200 0 +0700} {891111600 28800 1 +0800} {909255600 25200 0 +0700} {922561200 28800 1 +0800} {941310000 25200 0 +0700} {954010800 28800 1 +0800} {972759600 25200 0 +0700} {985460400 28800 1 +0800} {1004209200 25200 0 +0700} {1017514800 28800 1 +0800} {1035658800 25200 0 +0700} {1048964400 28800 1 +0800} {1067108400 25200 0 +0700} {1080414000 28800 1 +0800} {1099162800 25200 0 +0700} {1111863600 28800 1 +0800} {1130612400 25200 0 +0700} {1143313200 28800 1 +0800} {1162062000 25200 0 +0700} {1174762800 28800 1 +0800} {1193511600 25200 0 +0700} {1206817200 28800 1 +0800} {1224961200 25200 0 +0700} {1238266800 28800 1 +0800} {1256410800 25200 0 +0700} {1269716400 28800 1 +0800} {1288465200 25200 0 +0700} {1301166000 28800 0 +0800} {1414260000 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Kolkata0000664000175000017500000000050415035744305016676 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Kolkata) { {-9223372036854775808 21208 0 LMT} {-3645237208 21200 0 HMT} {-3155694800 19270 0 MMT} {-2019705670 19800 0 IST} {-891581400 23400 1 +0630} {-872058600 19800 0 IST} {-862637400 23400 1 +0630} {-764145000 19800 0 IST} } tcl9.0.3/library/tzdata/Asia/Khandyga0000664000175000017500000000420615035744305017041 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Khandyga) { {-9223372036854775808 32533 0 LMT} {-1579424533 28800 0 +0800} {-1247558400 32400 0 +0900} {354898800 36000 1 +1000} {370706400 32400 0 +0900} {386434800 36000 1 +1000} {402242400 32400 0 +0900} {417970800 36000 1 +1000} {433778400 32400 0 +0900} {449593200 36000 1 +1000} {465325200 32400 0 +0900} {481050000 36000 1 +1000} {496774800 32400 0 +0900} {512499600 36000 1 +1000} {528224400 32400 0 +0900} {543949200 36000 1 +1000} {559674000 32400 0 +0900} {575398800 36000 1 +1000} {591123600 32400 0 +0900} {606848400 36000 1 +1000} {622573200 32400 0 +0900} {638298000 36000 1 +1000} {654627600 32400 0 +0900} {670352400 28800 0 +0800} {670356000 32400 1 +0900} {686080800 28800 0 +0800} {695757600 32400 0 +0900} {701802000 36000 1 +1000} {717526800 32400 0 +0900} {733251600 36000 1 +1000} {748976400 32400 0 +0900} {764701200 36000 1 +1000} {780426000 32400 0 +0900} {796150800 36000 1 +1000} {811875600 32400 0 +0900} {828205200 36000 1 +1000} {846349200 32400 0 +0900} {859654800 36000 1 +1000} {877798800 32400 0 +0900} {891104400 36000 1 +1000} {909248400 32400 0 +0900} {922554000 36000 1 +1000} {941302800 32400 0 +0900} {954003600 36000 1 +1000} {972752400 32400 0 +0900} {985453200 36000 1 +1000} {1004202000 32400 0 +0900} {1017507600 36000 1 +1000} {1035651600 32400 0 +0900} {1048957200 36000 1 +1000} {1067101200 32400 0 +0900} {1072882800 36000 0 +1000} {1080403200 39600 1 +1100} {1099152000 36000 0 +1000} {1111852800 39600 1 +1100} {1130601600 36000 0 +1000} {1143302400 39600 1 +1100} {1162051200 36000 0 +1000} {1174752000 39600 1 +1100} {1193500800 36000 0 +1000} {1206806400 39600 1 +1100} {1224950400 36000 0 +1000} {1238256000 39600 1 +1100} {1256400000 36000 0 +1000} {1269705600 39600 1 +1100} {1288454400 36000 0 +1000} {1301155200 39600 0 +1100} {1315832400 36000 0 +1000} {1414252800 32400 0 +0900} } tcl9.0.3/library/tzdata/Asia/Katmandu0000664000175000017500000000026315035744305017056 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Kathmandu)]} { LoadTimeZoneFile Asia/Kathmandu } set TZData(:Asia/Katmandu) $TZData(:Asia/Kathmandu) tcl9.0.3/library/tzdata/Asia/Kathmandu0000664000175000017500000000026215035744305017225 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Kathmandu) { {-9223372036854775808 20476 0 LMT} {-1577943676 19800 0 +0530} {504901800 20700 0 +0545} } tcl9.0.3/library/tzdata/Asia/Kashgar0000664000175000017500000000025115035744305016667 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Urumqi)]} { LoadTimeZoneFile Asia/Urumqi } set TZData(:Asia/Kashgar) $TZData(:Asia/Urumqi) tcl9.0.3/library/tzdata/Asia/Karachi0000664000175000017500000000067315035744305016661 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Karachi) { {-9223372036854775808 16092 0 LMT} {-1988166492 19800 0 +0530} {-862637400 23400 1 +0630} {-764145000 19800 0 +0530} {-576135000 18000 0 +0500} {38775600 18000 0 PKT} {1018119600 21600 1 PKST} {1033840800 18000 0 PKT} {1212260400 21600 1 PKST} {1225476000 18000 0 PKT} {1239735600 21600 1 PKST} {1257012000 18000 0 PKT} } tcl9.0.3/library/tzdata/Asia/Kamchatka0000664000175000017500000000411115035744305017172 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Kamchatka) { {-9223372036854775808 38076 0 LMT} {-1487759676 39600 0 +1100} {-1247569200 43200 0 +1200} {354888000 46800 1 +1300} {370695600 43200 0 +1200} {386424000 46800 1 +1300} {402231600 43200 0 +1200} {417960000 46800 1 +1300} {433767600 43200 0 +1200} {449582400 46800 1 +1300} {465314400 43200 0 +1200} {481039200 46800 1 +1300} {496764000 43200 0 +1200} {512488800 46800 1 +1300} {528213600 43200 0 +1200} {543938400 46800 1 +1300} {559663200 43200 0 +1200} {575388000 46800 1 +1300} {591112800 43200 0 +1200} {606837600 46800 1 +1300} {622562400 43200 0 +1200} {638287200 46800 1 +1300} {654616800 43200 0 +1200} {670341600 39600 0 +1100} {670345200 43200 1 +1200} {686070000 39600 0 +1100} {695746800 43200 0 +1200} {701791200 46800 1 +1300} {717516000 43200 0 +1200} {733240800 46800 1 +1300} {748965600 43200 0 +1200} {764690400 46800 1 +1300} {780415200 43200 0 +1200} {796140000 46800 1 +1300} {811864800 43200 0 +1200} {828194400 46800 1 +1300} {846338400 43200 0 +1200} {859644000 46800 1 +1300} {877788000 43200 0 +1200} {891093600 46800 1 +1300} {909237600 43200 0 +1200} {922543200 46800 1 +1300} {941292000 43200 0 +1200} {953992800 46800 1 +1300} {972741600 43200 0 +1200} {985442400 46800 1 +1300} {1004191200 43200 0 +1200} {1017496800 46800 1 +1300} {1035640800 43200 0 +1200} {1048946400 46800 1 +1300} {1067090400 43200 0 +1200} {1080396000 46800 1 +1300} {1099144800 43200 0 +1200} {1111845600 46800 1 +1300} {1130594400 43200 0 +1200} {1143295200 46800 1 +1300} {1162044000 43200 0 +1200} {1174744800 46800 1 +1300} {1193493600 43200 0 +1200} {1206799200 46800 1 +1300} {1224943200 43200 0 +1200} {1238248800 46800 1 +1300} {1256392800 43200 0 +1200} {1269698400 39600 0 +1100} {1269702000 43200 1 +1200} {1288450800 39600 0 +1100} {1301151600 43200 0 +1200} } tcl9.0.3/library/tzdata/Asia/Kabul0000664000175000017500000000025715035744305016353 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Kabul) { {-9223372036854775808 16608 0 LMT} {-2524538208 14400 0 +0400} {-788932800 16200 0 +0430} } tcl9.0.3/library/tzdata/Asia/Jerusalem0000664000175000017500000001726115035744305017247 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Jerusalem) { {-9223372036854775808 8454 0 LMT} {-2840149254 8440 0 JMT} {-1641003640 7200 0 IST} {-933638400 10800 1 IDT} {-923097600 7200 0 IST} {-919036800 10800 1 IDT} {-857347200 7200 0 IST} {-844300800 10800 1 IDT} {-825811200 7200 0 IST} {-812678400 10800 1 IDT} {-794188800 7200 0 IST} {-779846400 10800 1 IDT} {-762652800 7200 0 IST} {-748310400 10800 1 IDT} {-731116800 7200 0 IST} {-681955200 14400 1 IDDT} {-673228800 10800 1 IDT} {-667958400 7200 0 IST} {-652320000 10800 1 IDT} {-636422400 7200 0 IST} {-622080000 10800 1 IDT} {-608947200 7200 0 IST} {-591840000 10800 1 IDT} {-572486400 7200 0 IST} {-558576000 10800 1 IDT} {-542851200 7200 0 IST} {-527731200 10800 1 IDT} {-514425600 7200 0 IST} {-490838400 10800 1 IDT} {-482976000 7200 0 IST} {-459388800 10800 1 IDT} {-451526400 7200 0 IST} {-428544000 10800 1 IDT} {-418262400 7200 0 IST} {-400118400 10800 1 IDT} {-387417600 7200 0 IST} {142380000 10800 1 IDT} {150843600 7200 0 IST} {167176800 10800 1 IDT} {178664400 7200 0 IST} {334101600 10800 1 IDT} {337730400 7200 0 IST} {452642400 10800 1 IDT} {462319200 7200 0 IST} {482277600 10800 1 IDT} {494370000 7200 0 IST} {516751200 10800 1 IDT} {526424400 7200 0 IST} {545436000 10800 1 IDT} {558478800 7200 0 IST} {576626400 10800 1 IDT} {589323600 7200 0 IST} {609890400 10800 1 IDT} {620773200 7200 0 IST} {638316000 10800 1 IDT} {651618000 7200 0 IST} {669765600 10800 1 IDT} {683672400 7200 0 IST} {701820000 10800 1 IDT} {715726800 7200 0 IST} {733701600 10800 1 IDT} {747176400 7200 0 IST} {765151200 10800 1 IDT} {778021200 7200 0 IST} {796600800 10800 1 IDT} {810075600 7200 0 IST} {826840800 10800 1 IDT} {842821200 7200 0 IST} {858895200 10800 1 IDT} {874184400 7200 0 IST} {890344800 10800 1 IDT} {905029200 7200 0 IST} {923011200 10800 1 IDT} {936313200 7200 0 IST} {955670400 10800 1 IDT} {970783200 7200 0 IST} {986770800 10800 1 IDT} {1001282400 7200 0 IST} {1017356400 10800 1 IDT} {1033941600 7200 0 IST} {1048806000 10800 1 IDT} {1065132000 7200 0 IST} {1081292400 10800 1 IDT} {1095804000 7200 0 IST} {1112313600 10800 1 IDT} {1128812400 7200 0 IST} {1143763200 10800 1 IDT} {1159657200 7200 0 IST} {1175212800 10800 1 IDT} {1189897200 7200 0 IST} {1206662400 10800 1 IDT} {1223161200 7200 0 IST} {1238112000 10800 1 IDT} {1254006000 7200 0 IST} {1269561600 10800 1 IDT} {1284246000 7200 0 IST} {1301616000 10800 1 IDT} {1317510000 7200 0 IST} {1333065600 10800 1 IDT} {1348354800 7200 0 IST} {1364515200 10800 1 IDT} {1382828400 7200 0 IST} {1395964800 10800 1 IDT} {1414278000 7200 0 IST} {1427414400 10800 1 IDT} {1445727600 7200 0 IST} {1458864000 10800 1 IDT} {1477782000 7200 0 IST} {1490313600 10800 1 IDT} {1509231600 7200 0 IST} {1521763200 10800 1 IDT} {1540681200 7200 0 IST} {1553817600 10800 1 IDT} {1572130800 7200 0 IST} {1585267200 10800 1 IDT} {1603580400 7200 0 IST} {1616716800 10800 1 IDT} {1635634800 7200 0 IST} {1648166400 10800 1 IDT} {1667084400 7200 0 IST} {1679616000 10800 1 IDT} {1698534000 7200 0 IST} {1711670400 10800 1 IDT} {1729983600 7200 0 IST} {1743120000 10800 1 IDT} {1761433200 7200 0 IST} {1774569600 10800 1 IDT} {1792882800 7200 0 IST} {1806019200 10800 1 IDT} {1824937200 7200 0 IST} {1837468800 10800 1 IDT} {1856386800 7200 0 IST} {1868918400 10800 1 IDT} {1887836400 7200 0 IST} {1900972800 10800 1 IDT} {1919286000 7200 0 IST} {1932422400 10800 1 IDT} {1950735600 7200 0 IST} {1963872000 10800 1 IDT} {1982790000 7200 0 IST} {1995321600 10800 1 IDT} {2014239600 7200 0 IST} {2026771200 10800 1 IDT} {2045689200 7200 0 IST} {2058220800 10800 1 IDT} {2077138800 7200 0 IST} {2090275200 10800 1 IDT} {2108588400 7200 0 IST} {2121724800 10800 1 IDT} {2140038000 7200 0 IST} {2153174400 10800 1 IDT} {2172092400 7200 0 IST} {2184624000 10800 1 IDT} {2203542000 7200 0 IST} {2216073600 10800 1 IDT} {2234991600 7200 0 IST} {2248128000 10800 1 IDT} {2266441200 7200 0 IST} {2279577600 10800 1 IDT} {2297890800 7200 0 IST} {2311027200 10800 1 IDT} {2329340400 7200 0 IST} {2342476800 10800 1 IDT} {2361394800 7200 0 IST} {2373926400 10800 1 IDT} {2392844400 7200 0 IST} {2405376000 10800 1 IDT} {2424294000 7200 0 IST} {2437430400 10800 1 IDT} {2455743600 7200 0 IST} {2468880000 10800 1 IDT} {2487193200 7200 0 IST} {2500329600 10800 1 IDT} {2519247600 7200 0 IST} {2531779200 10800 1 IDT} {2550697200 7200 0 IST} {2563228800 10800 1 IDT} {2582146800 7200 0 IST} {2595283200 10800 1 IDT} {2613596400 7200 0 IST} {2626732800 10800 1 IDT} {2645046000 7200 0 IST} {2658182400 10800 1 IDT} {2676495600 7200 0 IST} {2689632000 10800 1 IDT} {2708550000 7200 0 IST} {2721081600 10800 1 IDT} {2739999600 7200 0 IST} {2752531200 10800 1 IDT} {2771449200 7200 0 IST} {2784585600 10800 1 IDT} {2802898800 7200 0 IST} {2816035200 10800 1 IDT} {2834348400 7200 0 IST} {2847484800 10800 1 IDT} {2866402800 7200 0 IST} {2878934400 10800 1 IDT} {2897852400 7200 0 IST} {2910384000 10800 1 IDT} {2929302000 7200 0 IST} {2941833600 10800 1 IDT} {2960751600 7200 0 IST} {2973888000 10800 1 IDT} {2992201200 7200 0 IST} {3005337600 10800 1 IDT} {3023650800 7200 0 IST} {3036787200 10800 1 IDT} {3055705200 7200 0 IST} {3068236800 10800 1 IDT} {3087154800 7200 0 IST} {3099686400 10800 1 IDT} {3118604400 7200 0 IST} {3131740800 10800 1 IDT} {3150054000 7200 0 IST} {3163190400 10800 1 IDT} {3181503600 7200 0 IST} {3194640000 10800 1 IDT} {3212953200 7200 0 IST} {3226089600 10800 1 IDT} {3245007600 7200 0 IST} {3257539200 10800 1 IDT} {3276457200 7200 0 IST} {3288988800 10800 1 IDT} {3307906800 7200 0 IST} {3321043200 10800 1 IDT} {3339356400 7200 0 IST} {3352492800 10800 1 IDT} {3370806000 7200 0 IST} {3383942400 10800 1 IDT} {3402860400 7200 0 IST} {3415392000 10800 1 IDT} {3434310000 7200 0 IST} {3446841600 10800 1 IDT} {3465759600 7200 0 IST} {3478896000 10800 1 IDT} {3497209200 7200 0 IST} {3510345600 10800 1 IDT} {3528658800 7200 0 IST} {3541795200 10800 1 IDT} {3560108400 7200 0 IST} {3573244800 10800 1 IDT} {3592162800 7200 0 IST} {3604694400 10800 1 IDT} {3623612400 7200 0 IST} {3636144000 10800 1 IDT} {3655062000 7200 0 IST} {3668198400 10800 1 IDT} {3686511600 7200 0 IST} {3699648000 10800 1 IDT} {3717961200 7200 0 IST} {3731097600 10800 1 IDT} {3750015600 7200 0 IST} {3762547200 10800 1 IDT} {3781465200 7200 0 IST} {3793996800 10800 1 IDT} {3812914800 7200 0 IST} {3825446400 10800 1 IDT} {3844364400 7200 0 IST} {3857500800 10800 1 IDT} {3875814000 7200 0 IST} {3888950400 10800 1 IDT} {3907263600 7200 0 IST} {3920400000 10800 1 IDT} {3939318000 7200 0 IST} {3951849600 10800 1 IDT} {3970767600 7200 0 IST} {3983299200 10800 1 IDT} {4002217200 7200 0 IST} {4015353600 10800 1 IDT} {4033666800 7200 0 IST} {4046803200 10800 1 IDT} {4065116400 7200 0 IST} {4078252800 10800 1 IDT} {4096566000 7200 0 IST} } tcl9.0.3/library/tzdata/Asia/Jayapura0000664000175000017500000000031715035744305017066 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Jayapura) { {-9223372036854775808 33768 0 LMT} {-1172913768 32400 0 +0900} {-799491600 34200 0 +0930} {-189423000 32400 0 WIT} } tcl9.0.3/library/tzdata/Asia/Jakarta0000664000175000017500000000055115035744305016667 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Jakarta) { {-9223372036854775808 25632 0 LMT} {-3231299232 25632 0 BMT} {-1451719200 26400 0 +0720} {-1172906400 27000 0 +0730} {-876641400 32400 0 +0900} {-766054800 27000 0 +0730} {-683883000 28800 0 +0800} {-620812800 27000 0 +0730} {-189415800 25200 0 WIB} } tcl9.0.3/library/tzdata/Asia/Istanbul0000664000175000017500000000026615035744305017076 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Istanbul)]} { LoadTimeZoneFile Europe/Istanbul } set TZData(:Asia/Istanbul) $TZData(:Europe/Istanbul) tcl9.0.3/library/tzdata/Asia/Irkutsk0000664000175000017500000000414515035744305016751 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Irkutsk) { {-9223372036854775808 25025 0 LMT} {-2840165825 25025 0 IMT} {-1575874625 25200 0 +0700} {-1247554800 28800 0 +0800} {354902400 32400 1 +0900} {370710000 28800 0 +0800} {386438400 32400 1 +0900} {402246000 28800 0 +0800} {417974400 32400 1 +0900} {433782000 28800 0 +0800} {449596800 32400 1 +0900} {465328800 28800 0 +0800} {481053600 32400 1 +0900} {496778400 28800 0 +0800} {512503200 32400 1 +0900} {528228000 28800 0 +0800} {543952800 32400 1 +0900} {559677600 28800 0 +0800} {575402400 32400 1 +0900} {591127200 28800 0 +0800} {606852000 32400 1 +0900} {622576800 28800 0 +0800} {638301600 32400 1 +0900} {654631200 28800 0 +0800} {670356000 25200 0 +0700} {670359600 28800 1 +0800} {686084400 25200 0 +0700} {695761200 28800 0 +0800} {701805600 32400 1 +0900} {717530400 28800 0 +0800} {733255200 32400 1 +0900} {748980000 28800 0 +0800} {764704800 32400 1 +0900} {780429600 28800 0 +0800} {796154400 32400 1 +0900} {811879200 28800 0 +0800} {828208800 32400 1 +0900} {846352800 28800 0 +0800} {859658400 32400 1 +0900} {877802400 28800 0 +0800} {891108000 32400 1 +0900} {909252000 28800 0 +0800} {922557600 32400 1 +0900} {941306400 28800 0 +0800} {954007200 32400 1 +0900} {972756000 28800 0 +0800} {985456800 32400 1 +0900} {1004205600 28800 0 +0800} {1017511200 32400 1 +0900} {1035655200 28800 0 +0800} {1048960800 32400 1 +0900} {1067104800 28800 0 +0800} {1080410400 32400 1 +0900} {1099159200 28800 0 +0800} {1111860000 32400 1 +0900} {1130608800 28800 0 +0800} {1143309600 32400 1 +0900} {1162058400 28800 0 +0800} {1174759200 32400 1 +0900} {1193508000 28800 0 +0800} {1206813600 32400 1 +0900} {1224957600 28800 0 +0800} {1238263200 32400 1 +0900} {1256407200 28800 0 +0800} {1269712800 32400 1 +0900} {1288461600 28800 0 +0800} {1301162400 32400 0 +0900} {1414256400 28800 0 +0800} } tcl9.0.3/library/tzdata/Asia/Ho_Chi_Minh0000664000175000017500000000061515035744305017417 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Ho_Chi_Minh) { {-9223372036854775808 25590 0 LMT} {-2004073590 25590 0 PLMT} {-1851577590 25200 0 +0700} {-852105600 28800 0 +0800} {-782643600 32400 0 +0900} {-767869200 25200 0 +0700} {-718095600 28800 0 +0800} {-457772400 25200 0 +0700} {-315648000 28800 0 +0800} {171820800 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Hovd0000664000175000017500000000313415035744305016212 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Hovd) { {-9223372036854775808 21996 0 LMT} {-2032927596 21600 0 +0600} {252439200 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465321600 25200 0 +0700} {481050000 28800 1 +0800} {496771200 25200 0 +0700} {512499600 28800 1 +0800} {528220800 25200 0 +0700} {543949200 28800 1 +0800} {559670400 25200 0 +0700} {575398800 28800 1 +0800} {591120000 25200 0 +0700} {606848400 28800 1 +0800} {622569600 25200 0 +0700} {638298000 28800 1 +0800} {654624000 25200 0 +0700} {670352400 28800 1 +0800} {686073600 25200 0 +0700} {701802000 28800 1 +0800} {717523200 25200 0 +0700} {733251600 28800 1 +0800} {748972800 25200 0 +0700} {764701200 28800 1 +0800} {780422400 25200 0 +0700} {796150800 28800 1 +0800} {811872000 25200 0 +0700} {828205200 28800 1 +0800} {843926400 25200 0 +0700} {859654800 28800 1 +0800} {875376000 25200 0 +0700} {891104400 28800 1 +0800} {906825600 25200 0 +0700} {988398000 28800 1 +0800} {1001700000 25200 0 +0700} {1017428400 28800 1 +0800} {1033149600 25200 0 +0700} {1048878000 28800 1 +0800} {1064599200 25200 0 +0700} {1080327600 28800 1 +0800} {1096048800 25200 0 +0700} {1111777200 28800 1 +0800} {1127498400 25200 0 +0700} {1143226800 28800 1 +0800} {1159552800 25200 0 +0700} {1427482800 28800 1 +0800} {1443196800 25200 0 +0700} {1458932400 28800 1 +0800} {1474646400 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Hong_Kong0000664000175000017500000000414715035744305017170 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Hong_Kong) { {-9223372036854775808 27402 0 LMT} {-2056690800 28800 0 HKT} {-900910800 32400 1 HKST} {-891579600 30600 1 HKWT} {-884248200 32400 0 JST} {-761209200 28800 0 HKT} {-747907200 32400 1 HKST} {-728541000 28800 0 HKT} {-717049800 32400 1 HKST} {-697091400 28800 0 HKT} {-683785800 32400 1 HKST} {-668061000 28800 0 HKT} {-654755400 32400 1 HKST} {-636611400 28800 0 HKT} {-623305800 32400 1 HKST} {-605161800 28800 0 HKT} {-591856200 32400 1 HKST} {-573712200 28800 0 HKT} {-559801800 32400 1 HKST} {-541657800 28800 0 HKT} {-528352200 32400 1 HKST} {-510211800 28800 0 HKT} {-498112200 32400 1 HKST} {-478762200 28800 0 HKT} {-466662600 32400 1 HKST} {-446707800 28800 0 HKT} {-435213000 32400 1 HKST} {-415258200 28800 0 HKT} {-403158600 32400 1 HKST} {-383808600 28800 0 HKT} {-371709000 32400 1 HKST} {-352359000 28800 0 HKT} {-340259400 32400 1 HKST} {-320909400 28800 0 HKT} {-308809800 32400 1 HKST} {-288855000 28800 0 HKT} {-277360200 32400 1 HKST} {-257405400 28800 0 HKT} {-245910600 32400 1 HKST} {-225955800 28800 0 HKT} {-213856200 32400 1 HKST} {-194506200 28800 0 HKT} {-182406600 32400 1 HKST} {-163056600 28800 0 HKT} {-148537800 32400 1 HKST} {-132816600 28800 0 HKT} {-117088200 32400 1 HKST} {-101367000 28800 0 HKT} {-85638600 32400 1 HKST} {-69312600 28800 0 HKT} {-53584200 32400 1 HKST} {-37863000 28800 0 HKT} {-22134600 32400 1 HKST} {-6413400 28800 0 HKT} {9315000 32400 1 HKST} {25036200 28800 0 HKT} {40764600 32400 1 HKST} {56485800 28800 0 HKT} {72214200 32400 1 HKST} {88540200 28800 0 HKT} {104268600 32400 1 HKST} {119989800 28800 0 HKT} {126041400 32400 1 HKST} {135714600 32400 1 HKST} {151439400 28800 0 HKT} {167167800 32400 1 HKST} {182889000 28800 0 HKT} {198617400 32400 1 HKST} {214338600 28800 0 HKT} {295385400 32400 1 HKST} {309292200 28800 0 HKT} } tcl9.0.3/library/tzdata/Asia/Hebron0000664000175000017500000002320315035744305016526 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Hebron) { {-9223372036854775808 8423 0 LMT} {-2185410023 7200 0 EEST} {-933638400 10800 1 EEST} {-923097600 7200 0 EEST} {-919036800 10800 1 EEST} {-857347200 7200 0 EEST} {-844300800 10800 1 EEST} {-825811200 7200 0 EEST} {-812678400 10800 1 EEST} {-794188800 7200 0 EEST} {-779846400 10800 1 EEST} {-762652800 7200 0 EEST} {-748310400 10800 1 EEST} {-731116800 7200 0 EEST} {-682653600 7200 0 EET} {-399088800 10800 1 EEST} {-386650800 7200 0 EET} {-368330400 10800 1 EEST} {-355114800 7200 0 EET} {-336790800 10800 1 EEST} {-323654400 7200 0 EET} {-305168400 10800 1 EEST} {-292032000 7200 0 EET} {-273632400 10800 1 EEST} {-260496000 7200 0 EET} {-242096400 10800 1 EEST} {-228960000 7200 0 EET} {-210560400 10800 1 EEST} {-197424000 7200 0 EET} {-178938000 10800 1 EEST} {-165801600 7200 0 EET} {-147402000 10800 1 EEST} {-134265600 7200 0 EET} {-115866000 10800 1 EEST} {-102643200 7200 0 EET} {-84330000 10800 1 EEST} {-81313200 10800 0 IST} {142376400 10800 1 IDT} {150843600 7200 0 IST} {167176800 10800 1 IDT} {178664400 7200 0 IST} {334101600 10800 1 IDT} {337730400 7200 0 IST} {452642400 10800 1 IDT} {462319200 7200 0 IST} {482277600 10800 1 IDT} {494370000 7200 0 IST} {516751200 10800 1 IDT} {526424400 7200 0 IST} {545436000 10800 1 IDT} {558478800 7200 0 IST} {576626400 10800 1 IDT} {589323600 7200 0 IST} {609890400 10800 1 IDT} {620773200 7200 0 IST} {638316000 10800 1 IDT} {651618000 7200 0 IST} {669765600 10800 1 IDT} {683672400 7200 0 IST} {701820000 10800 1 IDT} {715726800 7200 0 IST} {733701600 10800 1 IDT} {747176400 7200 0 IST} {765151200 10800 1 IDT} {778021200 7200 0 IST} {796600800 10800 1 IDT} {810075600 7200 0 IST} {820447200 7200 0 EET} {828655200 10800 1 EEST} {843170400 7200 0 EET} {860104800 10800 1 EEST} {874620000 7200 0 EET} {891554400 10800 1 EEST} {906069600 7200 0 EET} {915141600 7200 0 EET} {924213600 10800 1 EEST} {939934800 7200 0 EET} {956268000 10800 1 EEST} {971989200 7200 0 EET} {987717600 10800 1 EEST} {1003438800 7200 0 EET} {1019167200 10800 1 EEST} {1034888400 7200 0 EET} {1050616800 10800 1 EEST} {1066338000 7200 0 EET} {1082066400 10800 1 EEST} {1096581600 7200 0 EET} {1113516000 10800 1 EEST} {1128380400 7200 0 EET} {1143842400 10800 1 EEST} {1158872400 7200 0 EET} {1175378400 10800 1 EEST} {1189638000 7200 0 EET} {1206655200 10800 1 EEST} {1220216400 7200 0 EET} {1238104800 10800 1 EEST} {1252015200 7200 0 EET} {1269554400 10800 1 EEST} {1281474000 7200 0 EET} {1301608860 10800 1 EEST} {1312146000 7200 0 EET} {1314655200 10800 1 EEST} {1317330000 7200 0 EET} {1333058400 10800 1 EEST} {1348178400 7200 0 EET} {1364508000 10800 1 EEST} {1380229200 7200 0 EET} {1395957600 10800 1 EEST} {1414098000 7200 0 EET} {1427493600 10800 1 EEST} {1445551200 7200 0 EET} {1458946800 10800 1 EEST} {1477692000 7200 0 EET} {1490396400 10800 1 EEST} {1509141600 7200 0 EET} {1521846000 10800 1 EEST} {1540591200 7200 0 EET} {1553810400 10800 1 EEST} {1572037200 7200 0 EET} {1585346400 10800 1 EEST} {1603490400 7200 0 EET} {1616796000 10800 1 EEST} {1635458400 7200 0 EET} {1648332000 10800 1 EEST} {1666998000 7200 0 EET} {1682726400 10800 1 EEST} {1698447600 7200 0 EET} {1713571200 10800 1 EEST} {1729897200 7200 0 EET} {1744416000 10800 1 EEST} {1761346800 7200 0 EET} {1774656000 10800 1 EEST} {1792796400 7200 0 EET} {1806105600 10800 1 EEST} {1824850800 7200 0 EET} {1837555200 10800 1 EEST} {1856300400 7200 0 EET} {1869004800 10800 1 EEST} {1887750000 7200 0 EET} {1901059200 10800 1 EEST} {1919199600 7200 0 EET} {1932508800 10800 1 EEST} {1950649200 7200 0 EET} {1963958400 10800 1 EEST} {1982703600 7200 0 EET} {1995408000 10800 1 EEST} {2014153200 7200 0 EET} {2026857600 10800 1 EEST} {2045602800 7200 0 EET} {2058307200 10800 1 EEST} {2077052400 7200 0 EET} {2090361600 10800 1 EEST} {2107897200 7200 0 EET} {2121811200 10800 1 EEST} {2138742000 7200 0 EET} {2153260800 10800 1 EEST} {2168982000 7200 0 EET} {2184710400 10800 1 EEST} {2199826800 7200 0 EET} {2216160000 10800 1 EEST} {2230066800 7200 0 EET} {2234304000 10800 1 EEST} {2234905200 7200 0 EET} {2248214400 10800 1 EEST} {2260911600 7200 0 EET} {2264544000 10800 1 EEST} {2266354800 7200 0 EET} {2279664000 10800 1 EEST} {2291756400 7200 0 EET} {2295388800 10800 1 EEST} {2297804400 7200 0 EET} {2311113600 10800 1 EEST} {2321996400 7200 0 EET} {2326233600 10800 1 EEST} {2329254000 7200 0 EET} {2342563200 10800 1 EEST} {2352841200 7200 0 EET} {2356473600 10800 1 EEST} {2361308400 7200 0 EET} {2374012800 10800 1 EEST} {2383686000 7200 0 EET} {2387318400 10800 1 EEST} {2392758000 7200 0 EET} {2405462400 10800 1 EEST} {2413926000 7200 0 EET} {2418163200 10800 1 EEST} {2424207600 7200 0 EET} {2437516800 10800 1 EEST} {2444770800 7200 0 EET} {2448403200 10800 1 EEST} {2455657200 7200 0 EET} {2468966400 10800 1 EEST} {2475010800 7200 0 EET} {2479248000 10800 1 EEST} {2487106800 7200 0 EET} {2500416000 10800 1 EEST} {2505855600 7200 0 EET} {2509488000 10800 1 EEST} {2519161200 7200 0 EET} {2531865600 10800 1 EEST} {2536700400 7200 0 EET} {2540332800 10800 1 EEST} {2550610800 7200 0 EET} {2563315200 10800 1 EEST} {2566940400 7200 0 EET} {2571177600 10800 1 EEST} {2582060400 7200 0 EET} {2595369600 10800 1 EEST} {2597785200 7200 0 EET} {2601417600 10800 1 EEST} {2613510000 7200 0 EET} {2626819200 10800 1 EEST} {2628025200 7200 0 EET} {2632262400 10800 1 EEST} {2644959600 7200 0 EET} {2658268800 10800 1 EEST} {2658870000 7200 0 EET} {2663107200 10800 1 EEST} {2676409200 7200 0 EET} {2693347200 10800 1 EEST} {2708463600 7200 0 EET} {2724192000 10800 1 EEST} {2739913200 7200 0 EET} {2754432000 10800 1 EEST} {2771362800 7200 0 EET} {2785276800 10800 1 EEST} {2802812400 7200 0 EET} {2816121600 10800 1 EEST} {2834262000 7200 0 EET} {2847571200 10800 1 EEST} {2866316400 7200 0 EET} {2879020800 10800 1 EEST} {2897766000 7200 0 EET} {2910470400 10800 1 EEST} {2929215600 7200 0 EET} {2941920000 10800 1 EEST} {2960665200 7200 0 EET} {2973974400 10800 1 EEST} {2992114800 7200 0 EET} {3005424000 10800 1 EEST} {3023564400 7200 0 EET} {3036873600 10800 1 EEST} {3055618800 7200 0 EET} {3068323200 10800 1 EEST} {3087068400 7200 0 EET} {3099772800 10800 1 EEST} {3117913200 7200 0 EET} {3131827200 10800 1 EEST} {3148758000 7200 0 EET} {3163276800 10800 1 EEST} {3179602800 7200 0 EET} {3194726400 10800 1 EEST} {3209842800 7200 0 EET} {3226176000 10800 1 EEST} {3240687600 7200 0 EET} {3244320000 10800 1 EEST} {3244921200 7200 0 EET} {3257625600 10800 1 EEST} {3271532400 7200 0 EET} {3275164800 10800 1 EEST} {3276370800 7200 0 EET} {3289075200 10800 1 EEST} {3301772400 7200 0 EET} {3306009600 10800 1 EEST} {3307820400 7200 0 EET} {3321129600 10800 1 EEST} {3332617200 7200 0 EET} {3336249600 10800 1 EEST} {3339270000 7200 0 EET} {3352579200 10800 1 EEST} {3362857200 7200 0 EET} {3367094400 10800 1 EEST} {3370719600 7200 0 EET} {3384028800 10800 1 EEST} {3393702000 7200 0 EET} {3397939200 10800 1 EEST} {3402774000 7200 0 EET} {3415478400 10800 1 EEST} {3424546800 7200 0 EET} {3428179200 10800 1 EEST} {3434223600 7200 0 EET} {3446928000 10800 1 EEST} {3454786800 7200 0 EET} {3459024000 10800 1 EEST} {3465673200 7200 0 EET} {3478982400 10800 1 EEST} {3485631600 7200 0 EET} {3489264000 10800 1 EEST} {3497122800 7200 0 EET} {3510432000 10800 1 EEST} {3516476400 7200 0 EET} {3520108800 10800 1 EEST} {3528572400 7200 0 EET} {3541881600 10800 1 EEST} {3546716400 7200 0 EET} {3550953600 10800 1 EEST} {3560022000 7200 0 EET} {3573331200 10800 1 EEST} {3577561200 7200 0 EET} {3581193600 10800 1 EEST} {3592076400 7200 0 EET} {3604780800 10800 1 EEST} {3607801200 7200 0 EET} {3612038400 10800 1 EEST} {3623526000 7200 0 EET} {3636230400 10800 1 EEST} {3638646000 7200 0 EET} {3642883200 10800 1 EEST} {3654975600 7200 0 EET} {3668284800 10800 1 EEST} {3669490800 7200 0 EET} {3673123200 10800 1 EEST} {3686425200 7200 0 EET} {3699734400 10800 1 EEST} {3717874800 7200 0 EET} {3731184000 10800 1 EEST} {3749929200 7200 0 EET} {3762633600 10800 1 EEST} {3781378800 7200 0 EET} {3794083200 10800 1 EEST} {3812828400 7200 0 EET} {3825532800 10800 1 EEST} {3844278000 7200 0 EET} {3857587200 10800 1 EEST} {3875727600 7200 0 EET} {3889036800 10800 1 EEST} {3907177200 7200 0 EET} {3920486400 10800 1 EEST} {3939231600 7200 0 EET} {3951936000 10800 1 EEST} {3970681200 7200 0 EET} {3983385600 10800 1 EEST} {4002130800 7200 0 EET} {4015440000 10800 1 EEST} {4033580400 7200 0 EET} {4046889600 10800 1 EEST} {4065030000 7200 0 EET} {4078339200 10800 1 EEST} {4096479600 7200 0 EET} } tcl9.0.3/library/tzdata/Asia/Harbin0000664000175000017500000000025615035744305016517 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Shanghai)]} { LoadTimeZoneFile Asia/Shanghai } set TZData(:Asia/Harbin) $TZData(:Asia/Shanghai) tcl9.0.3/library/tzdata/Asia/Gaza0000664000175000017500000002323315035744305016176 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Gaza) { {-9223372036854775808 8272 0 LMT} {-2185409872 7200 0 EEST} {-933638400 10800 1 EEST} {-923097600 7200 0 EEST} {-919036800 10800 1 EEST} {-857347200 7200 0 EEST} {-844300800 10800 1 EEST} {-825811200 7200 0 EEST} {-812678400 10800 1 EEST} {-794188800 7200 0 EEST} {-779846400 10800 1 EEST} {-762652800 7200 0 EEST} {-748310400 10800 1 EEST} {-731116800 7200 0 EEST} {-682653600 7200 0 EET} {-399088800 10800 1 EEST} {-386650800 7200 0 EET} {-368330400 10800 1 EEST} {-355114800 7200 0 EET} {-336790800 10800 1 EEST} {-323654400 7200 0 EET} {-305168400 10800 1 EEST} {-292032000 7200 0 EET} {-273632400 10800 1 EEST} {-260496000 7200 0 EET} {-242096400 10800 1 EEST} {-228960000 7200 0 EET} {-210560400 10800 1 EEST} {-197424000 7200 0 EET} {-178938000 10800 1 EEST} {-165801600 7200 0 EET} {-147402000 10800 1 EEST} {-134265600 7200 0 EET} {-115866000 10800 1 EEST} {-102643200 7200 0 EET} {-84330000 10800 1 EEST} {-81313200 10800 0 IST} {142376400 10800 1 IDT} {150843600 7200 0 IST} {167176800 10800 1 IDT} {178664400 7200 0 IST} {334101600 10800 1 IDT} {337730400 7200 0 IST} {452642400 10800 1 IDT} {462319200 7200 0 IST} {482277600 10800 1 IDT} {494370000 7200 0 IST} {516751200 10800 1 IDT} {526424400 7200 0 IST} {545436000 10800 1 IDT} {558478800 7200 0 IST} {576626400 10800 1 IDT} {589323600 7200 0 IST} {609890400 10800 1 IDT} {620773200 7200 0 IST} {638316000 10800 1 IDT} {651618000 7200 0 IST} {669765600 10800 1 IDT} {683672400 7200 0 IST} {701820000 10800 1 IDT} {715726800 7200 0 IST} {733701600 10800 1 IDT} {747176400 7200 0 IST} {765151200 10800 1 IDT} {778021200 7200 0 IST} {796600800 10800 1 IDT} {810075600 7200 0 IST} {820447200 7200 0 EET} {828655200 10800 1 EEST} {843170400 7200 0 EET} {860104800 10800 1 EEST} {874620000 7200 0 EET} {891554400 10800 1 EEST} {906069600 7200 0 EET} {915141600 7200 0 EET} {924213600 10800 1 EEST} {939934800 7200 0 EET} {956268000 10800 1 EEST} {971989200 7200 0 EET} {987717600 10800 1 EEST} {1003438800 7200 0 EET} {1019167200 10800 1 EEST} {1034888400 7200 0 EET} {1050616800 10800 1 EEST} {1066338000 7200 0 EET} {1082066400 10800 1 EEST} {1096581600 7200 0 EET} {1113516000 10800 1 EEST} {1128380400 7200 0 EET} {1143842400 10800 1 EEST} {1158872400 7200 0 EET} {1175378400 10800 1 EEST} {1189638000 7200 0 EET} {1206655200 10800 1 EEST} {1219960800 7200 0 EET} {1220220000 7200 0 EET} {1238104800 10800 1 EEST} {1252015200 7200 0 EET} {1262296800 7200 0 EET} {1269640860 10800 0 EEST} {1281474000 7200 0 EET} {1301608860 10800 1 EEST} {1312149600 7200 0 EET} {1325368800 7200 0 EET} {1333058400 10800 1 EEST} {1348178400 7200 0 EET} {1364508000 10800 1 EEST} {1380229200 7200 0 EET} {1395957600 10800 1 EEST} {1414098000 7200 0 EET} {1427493600 10800 1 EEST} {1445551200 7200 0 EET} {1458946800 10800 1 EEST} {1477692000 7200 0 EET} {1490396400 10800 1 EEST} {1509141600 7200 0 EET} {1521846000 10800 1 EEST} {1540591200 7200 0 EET} {1553810400 10800 1 EEST} {1572037200 7200 0 EET} {1585346400 10800 1 EEST} {1603490400 7200 0 EET} {1616796000 10800 1 EEST} {1635458400 7200 0 EET} {1648332000 10800 1 EEST} {1666998000 7200 0 EET} {1682726400 10800 1 EEST} {1698447600 7200 0 EET} {1713571200 10800 1 EEST} {1729897200 7200 0 EET} {1744416000 10800 1 EEST} {1761346800 7200 0 EET} {1774656000 10800 1 EEST} {1792796400 7200 0 EET} {1806105600 10800 1 EEST} {1824850800 7200 0 EET} {1837555200 10800 1 EEST} {1856300400 7200 0 EET} {1869004800 10800 1 EEST} {1887750000 7200 0 EET} {1901059200 10800 1 EEST} {1919199600 7200 0 EET} {1932508800 10800 1 EEST} {1950649200 7200 0 EET} {1963958400 10800 1 EEST} {1982703600 7200 0 EET} {1995408000 10800 1 EEST} {2014153200 7200 0 EET} {2026857600 10800 1 EEST} {2045602800 7200 0 EET} {2058307200 10800 1 EEST} {2077052400 7200 0 EET} {2090361600 10800 1 EEST} {2107897200 7200 0 EET} {2121811200 10800 1 EEST} {2138742000 7200 0 EET} {2153260800 10800 1 EEST} {2168982000 7200 0 EET} {2184710400 10800 1 EEST} {2199826800 7200 0 EET} {2216160000 10800 1 EEST} {2230066800 7200 0 EET} {2234304000 10800 1 EEST} {2234905200 7200 0 EET} {2248214400 10800 1 EEST} {2260911600 7200 0 EET} {2264544000 10800 1 EEST} {2266354800 7200 0 EET} {2279664000 10800 1 EEST} {2291756400 7200 0 EET} {2295388800 10800 1 EEST} {2297804400 7200 0 EET} {2311113600 10800 1 EEST} {2321996400 7200 0 EET} {2326233600 10800 1 EEST} {2329254000 7200 0 EET} {2342563200 10800 1 EEST} {2352841200 7200 0 EET} {2356473600 10800 1 EEST} {2361308400 7200 0 EET} {2374012800 10800 1 EEST} {2383686000 7200 0 EET} {2387318400 10800 1 EEST} {2392758000 7200 0 EET} {2405462400 10800 1 EEST} {2413926000 7200 0 EET} {2418163200 10800 1 EEST} {2424207600 7200 0 EET} {2437516800 10800 1 EEST} {2444770800 7200 0 EET} {2448403200 10800 1 EEST} {2455657200 7200 0 EET} {2468966400 10800 1 EEST} {2475010800 7200 0 EET} {2479248000 10800 1 EEST} {2487106800 7200 0 EET} {2500416000 10800 1 EEST} {2505855600 7200 0 EET} {2509488000 10800 1 EEST} {2519161200 7200 0 EET} {2531865600 10800 1 EEST} {2536700400 7200 0 EET} {2540332800 10800 1 EEST} {2550610800 7200 0 EET} {2563315200 10800 1 EEST} {2566940400 7200 0 EET} {2571177600 10800 1 EEST} {2582060400 7200 0 EET} {2595369600 10800 1 EEST} {2597785200 7200 0 EET} {2601417600 10800 1 EEST} {2613510000 7200 0 EET} {2626819200 10800 1 EEST} {2628025200 7200 0 EET} {2632262400 10800 1 EEST} {2644959600 7200 0 EET} {2658268800 10800 1 EEST} {2658870000 7200 0 EET} {2663107200 10800 1 EEST} {2676409200 7200 0 EET} {2693347200 10800 1 EEST} {2708463600 7200 0 EET} {2724192000 10800 1 EEST} {2739913200 7200 0 EET} {2754432000 10800 1 EEST} {2771362800 7200 0 EET} {2785276800 10800 1 EEST} {2802812400 7200 0 EET} {2816121600 10800 1 EEST} {2834262000 7200 0 EET} {2847571200 10800 1 EEST} {2866316400 7200 0 EET} {2879020800 10800 1 EEST} {2897766000 7200 0 EET} {2910470400 10800 1 EEST} {2929215600 7200 0 EET} {2941920000 10800 1 EEST} {2960665200 7200 0 EET} {2973974400 10800 1 EEST} {2992114800 7200 0 EET} {3005424000 10800 1 EEST} {3023564400 7200 0 EET} {3036873600 10800 1 EEST} {3055618800 7200 0 EET} {3068323200 10800 1 EEST} {3087068400 7200 0 EET} {3099772800 10800 1 EEST} {3117913200 7200 0 EET} {3131827200 10800 1 EEST} {3148758000 7200 0 EET} {3163276800 10800 1 EEST} {3179602800 7200 0 EET} {3194726400 10800 1 EEST} {3209842800 7200 0 EET} {3226176000 10800 1 EEST} {3240687600 7200 0 EET} {3244320000 10800 1 EEST} {3244921200 7200 0 EET} {3257625600 10800 1 EEST} {3271532400 7200 0 EET} {3275164800 10800 1 EEST} {3276370800 7200 0 EET} {3289075200 10800 1 EEST} {3301772400 7200 0 EET} {3306009600 10800 1 EEST} {3307820400 7200 0 EET} {3321129600 10800 1 EEST} {3332617200 7200 0 EET} {3336249600 10800 1 EEST} {3339270000 7200 0 EET} {3352579200 10800 1 EEST} {3362857200 7200 0 EET} {3367094400 10800 1 EEST} {3370719600 7200 0 EET} {3384028800 10800 1 EEST} {3393702000 7200 0 EET} {3397939200 10800 1 EEST} {3402774000 7200 0 EET} {3415478400 10800 1 EEST} {3424546800 7200 0 EET} {3428179200 10800 1 EEST} {3434223600 7200 0 EET} {3446928000 10800 1 EEST} {3454786800 7200 0 EET} {3459024000 10800 1 EEST} {3465673200 7200 0 EET} {3478982400 10800 1 EEST} {3485631600 7200 0 EET} {3489264000 10800 1 EEST} {3497122800 7200 0 EET} {3510432000 10800 1 EEST} {3516476400 7200 0 EET} {3520108800 10800 1 EEST} {3528572400 7200 0 EET} {3541881600 10800 1 EEST} {3546716400 7200 0 EET} {3550953600 10800 1 EEST} {3560022000 7200 0 EET} {3573331200 10800 1 EEST} {3577561200 7200 0 EET} {3581193600 10800 1 EEST} {3592076400 7200 0 EET} {3604780800 10800 1 EEST} {3607801200 7200 0 EET} {3612038400 10800 1 EEST} {3623526000 7200 0 EET} {3636230400 10800 1 EEST} {3638646000 7200 0 EET} {3642883200 10800 1 EEST} {3654975600 7200 0 EET} {3668284800 10800 1 EEST} {3669490800 7200 0 EET} {3673123200 10800 1 EEST} {3686425200 7200 0 EET} {3699734400 10800 1 EEST} {3717874800 7200 0 EET} {3731184000 10800 1 EEST} {3749929200 7200 0 EET} {3762633600 10800 1 EEST} {3781378800 7200 0 EET} {3794083200 10800 1 EEST} {3812828400 7200 0 EET} {3825532800 10800 1 EEST} {3844278000 7200 0 EET} {3857587200 10800 1 EEST} {3875727600 7200 0 EET} {3889036800 10800 1 EEST} {3907177200 7200 0 EET} {3920486400 10800 1 EEST} {3939231600 7200 0 EET} {3951936000 10800 1 EEST} {3970681200 7200 0 EET} {3983385600 10800 1 EEST} {4002130800 7200 0 EET} {4015440000 10800 1 EEST} {4033580400 7200 0 EET} {4046889600 10800 1 EEST} {4065030000 7200 0 EET} {4078339200 10800 1 EEST} {4096479600 7200 0 EET} } tcl9.0.3/library/tzdata/Asia/Famagusta0000664000175000017500000001625715035744305017234 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Famagusta) { {-9223372036854775808 8148 0 LMT} {-1518920148 7200 0 EET} {166572000 10800 1 EEST} {182293200 7200 0 EET} {200959200 10800 1 EEST} {213829200 7200 0 EET} {228866400 10800 1 EEST} {243982800 7200 0 EET} {260316000 10800 1 EEST} {276123600 7200 0 EET} {291765600 10800 1 EEST} {307486800 7200 0 EET} {323820000 10800 1 EEST} {338936400 7200 0 EET} {354664800 10800 1 EEST} {370386000 7200 0 EET} {386114400 10800 1 EEST} {401835600 7200 0 EET} {417564000 10800 1 EEST} {433285200 7200 0 EET} {449013600 10800 1 EEST} {465339600 7200 0 EET} {481068000 10800 1 EEST} {496789200 7200 0 EET} {512517600 10800 1 EEST} {528238800 7200 0 EET} {543967200 10800 1 EEST} {559688400 7200 0 EET} {575416800 10800 1 EEST} {591138000 7200 0 EET} {606866400 10800 1 EEST} {622587600 7200 0 EET} {638316000 10800 1 EEST} {654642000 7200 0 EET} {670370400 10800 1 EEST} {686091600 7200 0 EET} {701820000 10800 1 EEST} {717541200 7200 0 EET} {733269600 10800 1 EEST} {748990800 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {843944400 7200 0 EET} {859672800 10800 1 EEST} {875394000 7200 0 EET} {891122400 10800 1 EEST} {904597200 10800 0 EEST} {909277200 7200 0 EET} {922582800 10800 1 EEST} {941331600 7200 0 EET} {954032400 10800 1 EEST} {972781200 7200 0 EET} {985482000 10800 1 EEST} {1004230800 7200 0 EET} {1017536400 10800 1 EEST} {1035680400 7200 0 EET} {1048986000 10800 1 EEST} {1067130000 7200 0 EET} {1080435600 10800 1 EEST} {1099184400 7200 0 EET} {1111885200 10800 1 EEST} {1130634000 7200 0 EET} {1143334800 10800 1 EEST} {1162083600 7200 0 EET} {1174784400 10800 1 EEST} {1193533200 7200 0 EET} {1206838800 10800 1 EEST} {1224982800 7200 0 EET} {1238288400 10800 1 EEST} {1256432400 7200 0 EET} {1269738000 10800 1 EEST} {1288486800 7200 0 EET} {1301187600 10800 1 EEST} {1319936400 7200 0 EET} {1332637200 10800 1 EEST} {1351386000 7200 0 EET} {1364691600 10800 1 EEST} {1382835600 7200 0 EET} {1396141200 10800 1 EEST} {1414285200 7200 0 EET} {1427590800 10800 1 EEST} {1445734800 7200 0 EET} {1459040400 10800 1 EEST} {1473285600 10800 0 +0300} {1509238800 7200 0 EET} {1521939600 10800 1 EEST} {1540688400 7200 0 EET} {1553994000 10800 1 EEST} {1572138000 7200 0 EET} {1585443600 10800 1 EEST} {1603587600 7200 0 EET} {1616893200 10800 1 EEST} {1635642000 7200 0 EET} {1648342800 10800 1 EEST} {1667091600 7200 0 EET} {1679792400 10800 1 EEST} {1698541200 7200 0 EET} {1711846800 10800 1 EEST} {1729990800 7200 0 EET} {1743296400 10800 1 EEST} {1761440400 7200 0 EET} {1774746000 10800 1 EEST} {1792890000 7200 0 EET} {1806195600 10800 1 EEST} {1824944400 7200 0 EET} {1837645200 10800 1 EEST} {1856394000 7200 0 EET} {1869094800 10800 1 EEST} {1887843600 7200 0 EET} {1901149200 10800 1 EEST} {1919293200 7200 0 EET} {1932598800 10800 1 EEST} {1950742800 7200 0 EET} {1964048400 10800 1 EEST} {1982797200 7200 0 EET} {1995498000 10800 1 EEST} {2014246800 7200 0 EET} {2026947600 10800 1 EEST} {2045696400 7200 0 EET} {2058397200 10800 1 EEST} {2077146000 7200 0 EET} {2090451600 10800 1 EEST} {2108595600 7200 0 EET} {2121901200 10800 1 EEST} {2140045200 7200 0 EET} {2153350800 10800 1 EEST} {2172099600 7200 0 EET} {2184800400 10800 1 EEST} {2203549200 7200 0 EET} {2216250000 10800 1 EEST} {2234998800 7200 0 EET} {2248304400 10800 1 EEST} {2266448400 7200 0 EET} {2279754000 10800 1 EEST} {2297898000 7200 0 EET} {2311203600 10800 1 EEST} {2329347600 7200 0 EET} {2342653200 10800 1 EEST} {2361402000 7200 0 EET} {2374102800 10800 1 EEST} {2392851600 7200 0 EET} {2405552400 10800 1 EEST} {2424301200 7200 0 EET} {2437606800 10800 1 EEST} {2455750800 7200 0 EET} {2469056400 10800 1 EEST} {2487200400 7200 0 EET} {2500506000 10800 1 EEST} {2519254800 7200 0 EET} {2531955600 10800 1 EEST} {2550704400 7200 0 EET} {2563405200 10800 1 EEST} {2582154000 7200 0 EET} {2595459600 10800 1 EEST} {2613603600 7200 0 EET} {2626909200 10800 1 EEST} {2645053200 7200 0 EET} {2658358800 10800 1 EEST} {2676502800 7200 0 EET} {2689808400 10800 1 EEST} {2708557200 7200 0 EET} {2721258000 10800 1 EEST} {2740006800 7200 0 EET} {2752707600 10800 1 EEST} {2771456400 7200 0 EET} {2784762000 10800 1 EEST} {2802906000 7200 0 EET} {2816211600 10800 1 EEST} {2834355600 7200 0 EET} {2847661200 10800 1 EEST} {2866410000 7200 0 EET} {2879110800 10800 1 EEST} {2897859600 7200 0 EET} {2910560400 10800 1 EEST} {2929309200 7200 0 EET} {2942010000 10800 1 EEST} {2960758800 7200 0 EET} {2974064400 10800 1 EEST} {2992208400 7200 0 EET} {3005514000 10800 1 EEST} {3023658000 7200 0 EET} {3036963600 10800 1 EEST} {3055712400 7200 0 EET} {3068413200 10800 1 EEST} {3087162000 7200 0 EET} {3099862800 10800 1 EEST} {3118611600 7200 0 EET} {3131917200 10800 1 EEST} {3150061200 7200 0 EET} {3163366800 10800 1 EEST} {3181510800 7200 0 EET} {3194816400 10800 1 EEST} {3212960400 7200 0 EET} {3226266000 10800 1 EEST} {3245014800 7200 0 EET} {3257715600 10800 1 EEST} {3276464400 7200 0 EET} {3289165200 10800 1 EEST} {3307914000 7200 0 EET} {3321219600 10800 1 EEST} {3339363600 7200 0 EET} {3352669200 10800 1 EEST} {3370813200 7200 0 EET} {3384118800 10800 1 EEST} {3402867600 7200 0 EET} {3415568400 10800 1 EEST} {3434317200 7200 0 EET} {3447018000 10800 1 EEST} {3465766800 7200 0 EET} {3479072400 10800 1 EEST} {3497216400 7200 0 EET} {3510522000 10800 1 EEST} {3528666000 7200 0 EET} {3541971600 10800 1 EEST} {3560115600 7200 0 EET} {3573421200 10800 1 EEST} {3592170000 7200 0 EET} {3604870800 10800 1 EEST} {3623619600 7200 0 EET} {3636320400 10800 1 EEST} {3655069200 7200 0 EET} {3668374800 10800 1 EEST} {3686518800 7200 0 EET} {3699824400 10800 1 EEST} {3717968400 7200 0 EET} {3731274000 10800 1 EEST} {3750022800 7200 0 EET} {3762723600 10800 1 EEST} {3781472400 7200 0 EET} {3794173200 10800 1 EEST} {3812922000 7200 0 EET} {3825622800 10800 1 EEST} {3844371600 7200 0 EET} {3857677200 10800 1 EEST} {3875821200 7200 0 EET} {3889126800 10800 1 EEST} {3907270800 7200 0 EET} {3920576400 10800 1 EEST} {3939325200 7200 0 EET} {3952026000 10800 1 EEST} {3970774800 7200 0 EET} {3983475600 10800 1 EEST} {4002224400 7200 0 EET} {4015530000 10800 1 EEST} {4033674000 7200 0 EET} {4046979600 10800 1 EEST} {4065123600 7200 0 EET} {4078429200 10800 1 EEST} {4096573200 7200 0 EET} } tcl9.0.3/library/tzdata/Asia/Dushanbe0000664000175000017500000000150715035744305017045 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Dushanbe) { {-9223372036854775808 16512 0 LMT} {-1441168512 18000 0 +0500} {-1247547600 21600 0 +0600} {354909600 25200 1 +0700} {370717200 21600 0 +0600} {386445600 25200 1 +0700} {402253200 21600 0 +0600} {417981600 25200 1 +0700} {433789200 21600 0 +0600} {449604000 25200 1 +0700} {465336000 21600 0 +0600} {481060800 25200 1 +0700} {496785600 21600 0 +0600} {512510400 25200 1 +0700} {528235200 21600 0 +0600} {543960000 25200 1 +0700} {559684800 21600 0 +0600} {575409600 25200 1 +0700} {591134400 21600 0 +0600} {606859200 25200 1 +0700} {622584000 21600 0 +0600} {638308800 25200 1 +0700} {654638400 21600 0 +0600} {670363200 21600 1 +0600} {684363600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Dubai0000664000175000017500000000022015035744305016327 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Dubai) { {-9223372036854775808 13272 0 LMT} {-1577936472 14400 0 +0400} } tcl9.0.3/library/tzdata/Asia/Dili0000664000175000017500000000035215035744305016172 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Dili) { {-9223372036854775808 30140 0 LMT} {-1830412800 28800 0 +0800} {-879152400 32400 0 +0900} {199897200 28800 0 +0800} {969120000 32400 0 +0900} } tcl9.0.3/library/tzdata/Asia/Dhaka0000664000175000017500000000054715035744305016327 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Dhaka) { {-9223372036854775808 21700 0 LMT} {-2524543300 21200 0 HMT} {-891582800 23400 0 +0630} {-872058600 19800 0 +0530} {-862637400 23400 0 +0630} {-576138600 21600 0 +0600} {1230746400 21600 0 +0600} {1245430800 25200 1 +0700} {1262278800 21600 0 +0600} } tcl9.0.3/library/tzdata/Asia/Damascus0000664000175000017500000000676015035744305017062 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Damascus) { {-9223372036854775808 8712 0 LMT} {-1577931912 7200 0 EET} {-1568592000 10800 1 EEST} {-1554080400 7200 0 EET} {-1537142400 10800 1 EEST} {-1522630800 7200 0 EET} {-1505692800 10800 1 EEST} {-1491181200 7200 0 EET} {-1474243200 10800 1 EEST} {-1459126800 7200 0 EET} {-242265600 10800 1 EEST} {-228877200 7200 0 EET} {-210556800 10800 1 EEST} {-197427600 7200 0 EET} {-178934400 10800 1 EEST} {-165718800 7200 0 EET} {-147398400 10800 1 EEST} {-134269200 7200 0 EET} {-116467200 10800 1 EEST} {-102646800 7200 0 EET} {-84326400 10800 1 EEST} {-71110800 7200 0 EET} {-52704000 10800 1 EEST} {-39488400 7200 0 EET} {-21168000 10800 1 EEST} {-7952400 7200 0 EET} {10368000 10800 1 EEST} {23583600 7200 0 EET} {41904000 10800 1 EEST} {55119600 7200 0 EET} {73526400 10800 1 EEST} {86742000 7200 0 EET} {105062400 10800 1 EEST} {118278000 7200 0 EET} {136598400 10800 1 EEST} {149814000 7200 0 EET} {168134400 10800 1 EEST} {181350000 7200 0 EET} {199756800 10800 1 EEST} {212972400 7200 0 EET} {231292800 10800 1 EEST} {241916400 7200 0 EET} {262828800 10800 1 EEST} {273452400 7200 0 EET} {418694400 10800 1 EEST} {433810800 7200 0 EET} {450316800 10800 1 EEST} {465433200 7200 0 EET} {508896000 10800 1 EEST} {529196400 7200 0 EET} {541555200 10800 1 EEST} {562633200 7200 0 EET} {574387200 10800 1 EEST} {594255600 7200 0 EET} {607305600 10800 1 EEST} {623199600 7200 0 EET} {638928000 10800 1 EEST} {654649200 7200 0 EET} {670456800 10800 1 EEST} {686264400 7200 0 EET} {702684000 10800 1 EEST} {717886800 7200 0 EET} {733096800 10800 1 EEST} {748904400 7200 0 EET} {765151200 10800 1 EEST} {780958800 7200 0 EET} {796687200 10800 1 EEST} {812494800 7200 0 EET} {828309600 10800 1 EEST} {844117200 7200 0 EET} {859759200 10800 1 EEST} {875653200 7200 0 EET} {891208800 10800 1 EEST} {907189200 7200 0 EET} {922917600 10800 1 EEST} {938725200 7200 0 EET} {954540000 10800 1 EEST} {970347600 7200 0 EET} {986076000 10800 1 EEST} {1001883600 7200 0 EET} {1017612000 10800 1 EEST} {1033419600 7200 0 EET} {1049148000 10800 1 EEST} {1064955600 7200 0 EET} {1080770400 10800 1 EEST} {1096578000 7200 0 EET} {1112306400 10800 1 EEST} {1128114000 7200 0 EET} {1143842400 10800 1 EEST} {1158872400 7200 0 EET} {1175205600 10800 1 EEST} {1193950800 7200 0 EET} {1207260000 10800 1 EEST} {1225486800 7200 0 EET} {1238104800 10800 1 EEST} {1256850000 7200 0 EET} {1270159200 10800 1 EEST} {1288299600 7200 0 EET} {1301608800 10800 1 EEST} {1319749200 7200 0 EET} {1333058400 10800 1 EEST} {1351198800 7200 0 EET} {1364508000 10800 1 EEST} {1382648400 7200 0 EET} {1395957600 10800 1 EEST} {1414702800 7200 0 EET} {1427407200 10800 1 EEST} {1446152400 7200 0 EET} {1458856800 10800 1 EEST} {1477602000 7200 0 EET} {1490911200 10800 1 EEST} {1509051600 7200 0 EET} {1522360800 10800 1 EEST} {1540501200 7200 0 EET} {1553810400 10800 1 EEST} {1571950800 7200 0 EET} {1585260000 10800 1 EEST} {1604005200 7200 0 EET} {1616709600 10800 1 EEST} {1635454800 7200 0 EET} {1648159200 10800 1 EEST} {1666908000 10800 0 +0300} } tcl9.0.3/library/tzdata/Asia/Dacca0000664000175000017500000000024415035744305016304 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Dhaka)]} { LoadTimeZoneFile Asia/Dhaka } set TZData(:Asia/Dacca) $TZData(:Asia/Dhaka) tcl9.0.3/library/tzdata/Asia/Colombo0000664000175000017500000000055015035744305016703 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Colombo) { {-9223372036854775808 19164 0 LMT} {-2840159964 19172 0 MMT} {-2019705572 19800 0 +0530} {-883287000 21600 1 +0600} {-862639200 23400 1 +0630} {-764051400 19800 0 +0530} {832962600 23400 0 +0630} {846266400 21600 0 +0600} {1145039400 19800 0 +0530} } tcl9.0.3/library/tzdata/Asia/Chungking0000664000175000017500000000026115035744305017225 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Shanghai)]} { LoadTimeZoneFile Asia/Shanghai } set TZData(:Asia/Chungking) $TZData(:Asia/Shanghai) tcl9.0.3/library/tzdata/Asia/Chongqing0000664000175000017500000000026115035744305017225 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Shanghai)]} { LoadTimeZoneFile Asia/Shanghai } set TZData(:Asia/Chongqing) $TZData(:Asia/Shanghai) tcl9.0.3/library/tzdata/Asia/Choibalsan0000664000175000017500000000027315035744305017356 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Ulaanbaatar)]} { LoadTimeZoneFile Asia/Ulaanbaatar } set TZData(:Asia/Choibalsan) $TZData(:Asia/Ulaanbaatar) tcl9.0.3/library/tzdata/Asia/Chita0000664000175000017500000000414415035744305016344 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Chita) { {-9223372036854775808 27232 0 LMT} {-1579419232 28800 0 +0800} {-1247558400 32400 0 +0900} {354898800 36000 1 +1000} {370706400 32400 0 +0900} {386434800 36000 1 +1000} {402242400 32400 0 +0900} {417970800 36000 1 +1000} {433778400 32400 0 +0900} {449593200 36000 1 +1000} {465325200 32400 0 +0900} {481050000 36000 1 +1000} {496774800 32400 0 +0900} {512499600 36000 1 +1000} {528224400 32400 0 +0900} {543949200 36000 1 +1000} {559674000 32400 0 +0900} {575398800 36000 1 +1000} {591123600 32400 0 +0900} {606848400 36000 1 +1000} {622573200 32400 0 +0900} {638298000 36000 1 +1000} {654627600 32400 0 +0900} {670352400 28800 0 +0800} {670356000 32400 1 +0900} {686080800 28800 0 +0800} {695757600 32400 0 +0900} {701802000 36000 1 +1000} {717526800 32400 0 +0900} {733251600 36000 1 +1000} {748976400 32400 0 +0900} {764701200 36000 1 +1000} {780426000 32400 0 +0900} {796150800 36000 1 +1000} {811875600 32400 0 +0900} {828205200 36000 1 +1000} {846349200 32400 0 +0900} {859654800 36000 1 +1000} {877798800 32400 0 +0900} {891104400 36000 1 +1000} {909248400 32400 0 +0900} {922554000 36000 1 +1000} {941302800 32400 0 +0900} {954003600 36000 1 +1000} {972752400 32400 0 +0900} {985453200 36000 1 +1000} {1004202000 32400 0 +0900} {1017507600 36000 1 +1000} {1035651600 32400 0 +0900} {1048957200 36000 1 +1000} {1067101200 32400 0 +0900} {1080406800 36000 1 +1000} {1099155600 32400 0 +0900} {1111856400 36000 1 +1000} {1130605200 32400 0 +0900} {1143306000 36000 1 +1000} {1162054800 32400 0 +0900} {1174755600 36000 1 +1000} {1193504400 32400 0 +0900} {1206810000 36000 1 +1000} {1224954000 32400 0 +0900} {1238259600 36000 1 +1000} {1256403600 32400 0 +0900} {1269709200 36000 1 +1000} {1288458000 32400 0 +0900} {1301158800 36000 0 +1000} {1414252800 28800 0 +0800} {1459015200 32400 0 +0900} } tcl9.0.3/library/tzdata/Asia/Calcutta0000664000175000017500000000025515035744305017053 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Kolkata)]} { LoadTimeZoneFile Asia/Kolkata } set TZData(:Asia/Calcutta) $TZData(:Asia/Kolkata) tcl9.0.3/library/tzdata/Asia/Brunei0000664000175000017500000000025315035744305016535 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Kuching)]} { LoadTimeZoneFile Asia/Kuching } set TZData(:Asia/Brunei) $TZData(:Asia/Kuching) tcl9.0.3/library/tzdata/Asia/Bishkek0000664000175000017500000000326515035744305016677 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Bishkek) { {-9223372036854775808 17904 0 LMT} {-1441169904 18000 0 +0500} {-1247547600 21600 0 +0600} {354909600 25200 1 +0700} {370717200 21600 0 +0600} {386445600 25200 1 +0700} {402253200 21600 0 +0600} {417981600 25200 1 +0700} {433789200 21600 0 +0600} {449604000 25200 1 +0700} {465336000 21600 0 +0600} {481060800 25200 1 +0700} {496785600 21600 0 +0600} {512510400 25200 1 +0700} {528235200 21600 0 +0600} {543960000 25200 1 +0700} {559684800 21600 0 +0600} {575409600 25200 1 +0700} {591134400 21600 0 +0600} {606859200 25200 1 +0700} {622584000 21600 0 +0600} {638308800 25200 1 +0700} {654638400 21600 0 +0600} {670363200 18000 0 +0500} {670366800 21600 1 +0600} {683586000 18000 0 +0500} {703018800 21600 1 +0600} {717530400 18000 0 +0500} {734468400 21600 1 +0600} {748980000 18000 0 +0500} {765918000 21600 1 +0600} {780429600 18000 0 +0500} {797367600 21600 1 +0600} {811879200 18000 0 +0500} {828817200 21600 1 +0600} {843933600 18000 0 +0500} {859671000 21600 1 +0600} {877811400 18000 0 +0500} {891120600 21600 1 +0600} {909261000 18000 0 +0500} {922570200 21600 1 +0600} {941315400 18000 0 +0500} {954019800 21600 1 +0600} {972765000 18000 0 +0500} {985469400 21600 1 +0600} {1004214600 18000 0 +0500} {1017523800 21600 1 +0600} {1035664200 18000 0 +0500} {1048973400 21600 1 +0600} {1067113800 18000 0 +0500} {1080423000 21600 1 +0600} {1099168200 18000 0 +0500} {1111872600 21600 1 +0600} {1123783200 21600 0 +0600} } tcl9.0.3/library/tzdata/Asia/Beirut0000664000175000017500000001711215035744305016545 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Beirut) { {-9223372036854775808 8520 0 LMT} {-2840149320 7200 0 EET} {-1570413600 10800 1 EEST} {-1552186800 7200 0 EET} {-1538359200 10800 1 EEST} {-1522551600 7200 0 EET} {-1507514400 10800 1 EEST} {-1490583600 7200 0 EET} {-1473645600 10800 1 EEST} {-1460948400 7200 0 EET} {-399866400 10800 1 EEST} {-386650800 7200 0 EET} {-368330400 10800 1 EEST} {-355114800 7200 0 EET} {-336794400 10800 1 EEST} {-323578800 7200 0 EET} {-305172000 10800 1 EEST} {-291956400 7200 0 EET} {-273636000 10800 1 EEST} {-260420400 7200 0 EET} {78012000 10800 1 EEST} {86734800 7200 0 EET} {105055200 10800 1 EEST} {118270800 7200 0 EET} {136591200 10800 1 EEST} {149806800 7200 0 EET} {168127200 10800 1 EEST} {181342800 7200 0 EET} {199749600 10800 1 EEST} {212965200 7200 0 EET} {231285600 10800 1 EEST} {244501200 7200 0 EET} {262735200 10800 1 EEST} {275950800 7200 0 EET} {452210400 10800 1 EEST} {466722000 7200 0 EET} {483746400 10800 1 EEST} {498258000 7200 0 EET} {515282400 10800 1 EEST} {529794000 7200 0 EET} {546818400 10800 1 EEST} {561330000 7200 0 EET} {581119200 10800 1 EEST} {592952400 7200 0 EET} {610754400 10800 1 EEST} {624488400 7200 0 EET} {641512800 10800 1 EEST} {656024400 7200 0 EET} {673048800 10800 1 EEST} {687560400 7200 0 EET} {704671200 10800 1 EEST} {718146000 7200 0 EET} {733269600 10800 1 EEST} {748990800 7200 0 EET} {764719200 10800 1 EEST} {780440400 7200 0 EET} {796168800 10800 1 EEST} {811890000 7200 0 EET} {828223200 10800 1 EEST} {843944400 7200 0 EET} {859672800 10800 1 EEST} {875394000 7200 0 EET} {891122400 10800 1 EEST} {906843600 7200 0 EET} {922572000 10800 1 EEST} {941317200 7200 0 EET} {954021600 10800 1 EEST} {972766800 7200 0 EET} {985471200 10800 1 EEST} {1004216400 7200 0 EET} {1017525600 10800 1 EEST} {1035666000 7200 0 EET} {1048975200 10800 1 EEST} {1067115600 7200 0 EET} {1080424800 10800 1 EEST} {1099170000 7200 0 EET} {1111874400 10800 1 EEST} {1130619600 7200 0 EET} {1143324000 10800 1 EEST} {1162069200 7200 0 EET} {1174773600 10800 1 EEST} {1193518800 7200 0 EET} {1206828000 10800 1 EEST} {1224968400 7200 0 EET} {1238277600 10800 1 EEST} {1256418000 7200 0 EET} {1269727200 10800 1 EEST} {1288472400 7200 0 EET} {1301176800 10800 1 EEST} {1319922000 7200 0 EET} {1332626400 10800 1 EEST} {1351371600 7200 0 EET} {1364680800 10800 1 EEST} {1382821200 7200 0 EET} {1396130400 10800 1 EEST} {1414270800 7200 0 EET} {1427580000 10800 1 EEST} {1445720400 7200 0 EET} {1459029600 10800 1 EEST} {1477774800 7200 0 EET} {1490479200 10800 1 EEST} {1509224400 7200 0 EET} {1521928800 10800 1 EEST} {1540674000 7200 0 EET} {1553983200 10800 1 EEST} {1572123600 7200 0 EET} {1585432800 10800 1 EEST} {1603573200 7200 0 EET} {1616882400 10800 1 EEST} {1635627600 7200 0 EET} {1648332000 10800 1 EEST} {1667077200 7200 0 EET} {1679781600 10800 1 EEST} {1698526800 7200 0 EET} {1711836000 10800 1 EEST} {1729976400 7200 0 EET} {1743285600 10800 1 EEST} {1761426000 7200 0 EET} {1774735200 10800 1 EEST} {1792875600 7200 0 EET} {1806184800 10800 1 EEST} {1824930000 7200 0 EET} {1837634400 10800 1 EEST} {1856379600 7200 0 EET} {1869084000 10800 1 EEST} {1887829200 7200 0 EET} {1901138400 10800 1 EEST} {1919278800 7200 0 EET} {1932588000 10800 1 EEST} {1950728400 7200 0 EET} {1964037600 10800 1 EEST} {1982782800 7200 0 EET} {1995487200 10800 1 EEST} {2014232400 7200 0 EET} {2026936800 10800 1 EEST} {2045682000 7200 0 EET} {2058386400 10800 1 EEST} {2077131600 7200 0 EET} {2090440800 10800 1 EEST} {2108581200 7200 0 EET} {2121890400 10800 1 EEST} {2140030800 7200 0 EET} {2153340000 10800 1 EEST} {2172085200 7200 0 EET} {2184789600 10800 1 EEST} {2203534800 7200 0 EET} {2216239200 10800 1 EEST} {2234984400 7200 0 EET} {2248293600 10800 1 EEST} {2266434000 7200 0 EET} {2279743200 10800 1 EEST} {2297883600 7200 0 EET} {2311192800 10800 1 EEST} {2329333200 7200 0 EET} {2342642400 10800 1 EEST} {2361387600 7200 0 EET} {2374092000 10800 1 EEST} {2392837200 7200 0 EET} {2405541600 10800 1 EEST} {2424286800 7200 0 EET} {2437596000 10800 1 EEST} {2455736400 7200 0 EET} {2469045600 10800 1 EEST} {2487186000 7200 0 EET} {2500495200 10800 1 EEST} {2519240400 7200 0 EET} {2531944800 10800 1 EEST} {2550690000 7200 0 EET} {2563394400 10800 1 EEST} {2582139600 7200 0 EET} {2595448800 10800 1 EEST} {2613589200 7200 0 EET} {2626898400 10800 1 EEST} {2645038800 7200 0 EET} {2658348000 10800 1 EEST} {2676488400 7200 0 EET} {2689797600 10800 1 EEST} {2708542800 7200 0 EET} {2721247200 10800 1 EEST} {2739992400 7200 0 EET} {2752696800 10800 1 EEST} {2771442000 7200 0 EET} {2784751200 10800 1 EEST} {2802891600 7200 0 EET} {2816200800 10800 1 EEST} {2834341200 7200 0 EET} {2847650400 10800 1 EEST} {2866395600 7200 0 EET} {2879100000 10800 1 EEST} {2897845200 7200 0 EET} {2910549600 10800 1 EEST} {2929294800 7200 0 EET} {2941999200 10800 1 EEST} {2960744400 7200 0 EET} {2974053600 10800 1 EEST} {2992194000 7200 0 EET} {3005503200 10800 1 EEST} {3023643600 7200 0 EET} {3036952800 10800 1 EEST} {3055698000 7200 0 EET} {3068402400 10800 1 EEST} {3087147600 7200 0 EET} {3099852000 10800 1 EEST} {3118597200 7200 0 EET} {3131906400 10800 1 EEST} {3150046800 7200 0 EET} {3163356000 10800 1 EEST} {3181496400 7200 0 EET} {3194805600 10800 1 EEST} {3212946000 7200 0 EET} {3226255200 10800 1 EEST} {3245000400 7200 0 EET} {3257704800 10800 1 EEST} {3276450000 7200 0 EET} {3289154400 10800 1 EEST} {3307899600 7200 0 EET} {3321208800 10800 1 EEST} {3339349200 7200 0 EET} {3352658400 10800 1 EEST} {3370798800 7200 0 EET} {3384108000 10800 1 EEST} {3402853200 7200 0 EET} {3415557600 10800 1 EEST} {3434302800 7200 0 EET} {3447007200 10800 1 EEST} {3465752400 7200 0 EET} {3479061600 10800 1 EEST} {3497202000 7200 0 EET} {3510511200 10800 1 EEST} {3528651600 7200 0 EET} {3541960800 10800 1 EEST} {3560101200 7200 0 EET} {3573410400 10800 1 EEST} {3592155600 7200 0 EET} {3604860000 10800 1 EEST} {3623605200 7200 0 EET} {3636309600 10800 1 EEST} {3655054800 7200 0 EET} {3668364000 10800 1 EEST} {3686504400 7200 0 EET} {3699813600 10800 1 EEST} {3717954000 7200 0 EET} {3731263200 10800 1 EEST} {3750008400 7200 0 EET} {3762712800 10800 1 EEST} {3781458000 7200 0 EET} {3794162400 10800 1 EEST} {3812907600 7200 0 EET} {3825612000 10800 1 EEST} {3844357200 7200 0 EET} {3857666400 10800 1 EEST} {3875806800 7200 0 EET} {3889116000 10800 1 EEST} {3907256400 7200 0 EET} {3920565600 10800 1 EEST} {3939310800 7200 0 EET} {3952015200 10800 1 EEST} {3970760400 7200 0 EET} {3983464800 10800 1 EEST} {4002210000 7200 0 EET} {4015519200 10800 1 EEST} {4033659600 7200 0 EET} {4046968800 10800 1 EEST} {4065109200 7200 0 EET} {4078418400 10800 1 EEST} {4096558800 7200 0 EET} } tcl9.0.3/library/tzdata/Asia/Barnaul0000664000175000017500000000420415035744305016675 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Barnaul) { {-9223372036854775808 20100 0 LMT} {-1579844100 21600 0 +0600} {-1247551200 25200 0 +0700} {354906000 28800 1 +0800} {370713600 25200 0 +0700} {386442000 28800 1 +0800} {402249600 25200 0 +0700} {417978000 28800 1 +0800} {433785600 25200 0 +0700} {449600400 28800 1 +0800} {465332400 25200 0 +0700} {481057200 28800 1 +0800} {496782000 25200 0 +0700} {512506800 28800 1 +0800} {528231600 25200 0 +0700} {543956400 28800 1 +0800} {559681200 25200 0 +0700} {575406000 28800 1 +0800} {591130800 25200 0 +0700} {606855600 28800 1 +0800} {622580400 25200 0 +0700} {638305200 28800 1 +0800} {654634800 25200 0 +0700} {670359600 21600 0 +0600} {670363200 25200 1 +0700} {686088000 21600 0 +0600} {695764800 25200 0 +0700} {701809200 28800 1 +0800} {717534000 25200 0 +0700} {733258800 28800 1 +0800} {748983600 25200 0 +0700} {764708400 28800 1 +0800} {780433200 25200 0 +0700} {796158000 28800 1 +0800} {801594000 25200 0 +0700} {811886400 21600 0 +0600} {828216000 25200 1 +0700} {846360000 21600 0 +0600} {859665600 25200 1 +0700} {877809600 21600 0 +0600} {891115200 25200 1 +0700} {909259200 21600 0 +0600} {922564800 25200 1 +0700} {941313600 21600 0 +0600} {954014400 25200 1 +0700} {972763200 21600 0 +0600} {985464000 25200 1 +0700} {1004212800 21600 0 +0600} {1017518400 25200 1 +0700} {1035662400 21600 0 +0600} {1048968000 25200 1 +0700} {1067112000 21600 0 +0600} {1080417600 25200 1 +0700} {1099166400 21600 0 +0600} {1111867200 25200 1 +0700} {1130616000 21600 0 +0600} {1143316800 25200 1 +0700} {1162065600 21600 0 +0600} {1174766400 25200 1 +0700} {1193515200 21600 0 +0600} {1206820800 25200 1 +0700} {1224964800 21600 0 +0600} {1238270400 25200 1 +0700} {1256414400 21600 0 +0600} {1269720000 25200 1 +0700} {1288468800 21600 0 +0600} {1301169600 25200 0 +0700} {1414263600 21600 0 +0600} {1459022400 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Bangkok0000664000175000017500000000026015035744305016663 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Bangkok) { {-9223372036854775808 24124 0 LMT} {-2840164924 24124 0 BMT} {-1570084924 25200 0 +0700} } tcl9.0.3/library/tzdata/Asia/Baku0000664000175000017500000000424515035744305016200 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Baku) { {-9223372036854775808 11964 0 LMT} {-1441163964 10800 0 +0300} {-405140400 14400 0 +0400} {354916800 18000 1 +0500} {370724400 14400 0 +0400} {386452800 18000 1 +0500} {402260400 14400 0 +0400} {417988800 18000 1 +0500} {433796400 14400 0 +0400} {449611200 18000 1 +0500} {465343200 14400 0 +0400} {481068000 18000 1 +0500} {496792800 14400 0 +0400} {512517600 18000 1 +0500} {528242400 14400 0 +0400} {543967200 18000 1 +0500} {559692000 14400 0 +0400} {575416800 18000 1 +0500} {591141600 14400 0 +0400} {606866400 18000 1 +0500} {622591200 14400 0 +0400} {638316000 18000 1 +0500} {654645600 14400 0 +0400} {670370400 10800 0 +0300} {670374000 14400 1 +0400} {686098800 10800 0 +0300} {701823600 14400 1 +0400} {717548400 14400 0 +0400} {820440000 14400 0 +0400} {828234000 18000 1 +0500} {846378000 14400 0 +0400} {852062400 14400 0 +0400} {859680000 18000 1 +0500} {877824000 14400 0 +0400} {891129600 18000 1 +0500} {909273600 14400 0 +0400} {922579200 18000 1 +0500} {941328000 14400 0 +0400} {954028800 18000 1 +0500} {972777600 14400 0 +0400} {985478400 18000 1 +0500} {1004227200 14400 0 +0400} {1017532800 18000 1 +0500} {1035676800 14400 0 +0400} {1048982400 18000 1 +0500} {1067126400 14400 0 +0400} {1080432000 18000 1 +0500} {1099180800 14400 0 +0400} {1111881600 18000 1 +0500} {1130630400 14400 0 +0400} {1143331200 18000 1 +0500} {1162080000 14400 0 +0400} {1174780800 18000 1 +0500} {1193529600 14400 0 +0400} {1206835200 18000 1 +0500} {1224979200 14400 0 +0400} {1238284800 18000 1 +0500} {1256428800 14400 0 +0400} {1269734400 18000 1 +0500} {1288483200 14400 0 +0400} {1301184000 18000 1 +0500} {1319932800 14400 0 +0400} {1332633600 18000 1 +0500} {1351382400 14400 0 +0400} {1364688000 18000 1 +0500} {1382832000 14400 0 +0400} {1396137600 18000 1 +0500} {1414281600 14400 0 +0400} {1427587200 18000 1 +0500} {1445731200 14400 0 +0400} } tcl9.0.3/library/tzdata/Asia/Bahrain0000664000175000017500000000024615035744305016657 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Qatar)]} { LoadTimeZoneFile Asia/Qatar } set TZData(:Asia/Bahrain) $TZData(:Asia/Qatar) tcl9.0.3/library/tzdata/Asia/Baghdad0000664000175000017500000000332515035744305016626 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Baghdad) { {-9223372036854775808 10660 0 LMT} {-2524532260 10656 0 BMT} {-1641005856 10800 0 +0300} {389048400 14400 0 +0400} {402264000 10800 0 +0300} {417906000 14400 1 +0400} {433800000 10800 0 +0300} {449614800 14400 1 +0400} {465422400 10800 0 +0300} {481150800 14400 1 +0400} {496792800 10800 0 +0300} {512517600 14400 1 +0400} {528242400 10800 0 +0300} {543967200 14400 1 +0400} {559692000 10800 0 +0300} {575416800 14400 1 +0400} {591141600 10800 0 +0300} {606866400 14400 1 +0400} {622591200 10800 0 +0300} {638316000 14400 1 +0400} {654645600 10800 0 +0300} {670464000 14400 1 +0400} {686275200 10800 0 +0300} {702086400 14400 1 +0400} {717897600 10800 0 +0300} {733622400 14400 1 +0400} {749433600 10800 0 +0300} {765158400 14400 1 +0400} {780969600 10800 0 +0300} {796694400 14400 1 +0400} {812505600 10800 0 +0300} {828316800 14400 1 +0400} {844128000 10800 0 +0300} {859852800 14400 1 +0400} {875664000 10800 0 +0300} {891388800 14400 1 +0400} {907200000 10800 0 +0300} {922924800 14400 1 +0400} {938736000 10800 0 +0300} {954547200 14400 1 +0400} {970358400 10800 0 +0300} {986083200 14400 1 +0400} {1001894400 10800 0 +0300} {1017619200 14400 1 +0400} {1033430400 10800 0 +0300} {1049155200 14400 1 +0400} {1064966400 10800 0 +0300} {1080777600 14400 1 +0400} {1096588800 10800 0 +0300} {1112313600 14400 1 +0400} {1128124800 10800 0 +0300} {1143849600 14400 1 +0400} {1159660800 10800 0 +0300} {1175385600 14400 1 +0400} {1191196800 10800 0 +0300} } tcl9.0.3/library/tzdata/Asia/Atyrau0000664000175000017500000000326215035744305016561 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Atyrau) { {-9223372036854775808 12464 0 LMT} {-1441164464 10800 0 +0300} {-1247540400 18000 0 +0500} {370724400 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {796165200 21600 1 +0600} {811890000 18000 0 +0500} {828219600 21600 1 +0600} {846363600 18000 0 +0500} {859669200 21600 1 +0600} {877813200 18000 0 +0500} {891118800 21600 1 +0600} {909262800 18000 0 +0500} {922568400 14400 0 +0400} {922572000 18000 1 +0500} {941320800 14400 0 +0400} {954021600 18000 1 +0500} {972770400 14400 0 +0400} {985471200 18000 1 +0500} {1004220000 14400 0 +0400} {1017525600 18000 1 +0500} {1035669600 14400 0 +0400} {1048975200 18000 1 +0500} {1067119200 14400 0 +0400} {1080424800 18000 1 +0500} {1099173600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Ashkhabad0000664000175000017500000000026115035744305017156 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Ashgabat)]} { LoadTimeZoneFile Asia/Ashgabat } set TZData(:Asia/Ashkhabad) $TZData(:Asia/Ashgabat) tcl9.0.3/library/tzdata/Asia/Ashgabat0000664000175000017500000000160315035744305017023 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Ashgabat) { {-9223372036854775808 14012 0 LMT} {-1441166012 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Aqtobe0000664000175000017500000000326215035744305016527 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Aqtobe) { {-9223372036854775808 13720 0 LMT} {-1441165720 14400 0 +0400} {-1247544000 18000 0 +0500} {354913200 21600 1 +0600} {370720800 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {796165200 21600 1 +0600} {811890000 18000 0 +0500} {828219600 21600 1 +0600} {846363600 18000 0 +0500} {859669200 21600 1 +0600} {877813200 18000 0 +0500} {891118800 21600 1 +0600} {909262800 18000 0 +0500} {922568400 21600 1 +0600} {941317200 18000 0 +0500} {954018000 21600 1 +0600} {972766800 18000 0 +0500} {985467600 21600 1 +0600} {1004216400 18000 0 +0500} {1017522000 21600 1 +0600} {1035666000 18000 0 +0500} {1048971600 21600 1 +0600} {1067115600 18000 0 +0500} {1080421200 21600 1 +0600} {1099170000 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Aqtau0000664000175000017500000000326115035744305016366 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Aqtau) { {-9223372036854775808 12064 0 LMT} {-1441164064 14400 0 +0400} {-1247544000 18000 0 +0500} {370724400 21600 0 +0600} {386445600 18000 0 +0500} {386449200 21600 1 +0600} {402256800 18000 0 +0500} {417985200 21600 1 +0600} {433792800 18000 0 +0500} {449607600 21600 1 +0600} {465339600 18000 0 +0500} {481064400 21600 1 +0600} {496789200 18000 0 +0500} {512514000 21600 1 +0600} {528238800 18000 0 +0500} {543963600 21600 1 +0600} {559688400 18000 0 +0500} {575413200 21600 1 +0600} {591138000 18000 0 +0500} {606862800 21600 1 +0600} {622587600 18000 0 +0500} {638312400 21600 1 +0600} {654642000 18000 0 +0500} {670366800 14400 0 +0400} {670370400 18000 1 +0500} {686095200 14400 0 +0400} {695772000 18000 0 +0500} {701816400 21600 1 +0600} {717541200 18000 0 +0500} {733266000 21600 1 +0600} {748990800 18000 0 +0500} {764715600 21600 1 +0600} {780440400 18000 0 +0500} {780444000 14400 0 +0400} {796168800 18000 1 +0500} {811893600 14400 0 +0400} {828223200 18000 1 +0500} {846367200 14400 0 +0400} {859672800 18000 1 +0500} {877816800 14400 0 +0400} {891122400 18000 1 +0500} {909266400 14400 0 +0400} {922572000 18000 1 +0500} {941320800 14400 0 +0400} {954021600 18000 1 +0500} {972770400 14400 0 +0400} {985471200 18000 1 +0500} {1004220000 14400 0 +0400} {1017525600 18000 1 +0500} {1035669600 14400 0 +0400} {1048975200 18000 1 +0500} {1067119200 14400 0 +0400} {1080424800 18000 1 +0500} {1099173600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Anadyr0000664000175000017500000000414415035744305016532 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Anadyr) { {-9223372036854775808 42596 0 LMT} {-1441194596 43200 0 +1200} {-1247572800 46800 0 +1300} {354884400 50400 1 +1400} {370692000 46800 0 +1300} {386420400 43200 0 +1200} {386424000 46800 1 +1300} {402231600 43200 0 +1200} {417960000 46800 1 +1300} {433767600 43200 0 +1200} {449582400 46800 1 +1300} {465314400 43200 0 +1200} {481039200 46800 1 +1300} {496764000 43200 0 +1200} {512488800 46800 1 +1300} {528213600 43200 0 +1200} {543938400 46800 1 +1300} {559663200 43200 0 +1200} {575388000 46800 1 +1300} {591112800 43200 0 +1200} {606837600 46800 1 +1300} {622562400 43200 0 +1200} {638287200 46800 1 +1300} {654616800 43200 0 +1200} {670341600 39600 0 +1100} {670345200 43200 1 +1200} {686070000 39600 0 +1100} {695746800 43200 0 +1200} {701791200 46800 1 +1300} {717516000 43200 0 +1200} {733240800 46800 1 +1300} {748965600 43200 0 +1200} {764690400 46800 1 +1300} {780415200 43200 0 +1200} {796140000 46800 1 +1300} {811864800 43200 0 +1200} {828194400 46800 1 +1300} {846338400 43200 0 +1200} {859644000 46800 1 +1300} {877788000 43200 0 +1200} {891093600 46800 1 +1300} {909237600 43200 0 +1200} {922543200 46800 1 +1300} {941292000 43200 0 +1200} {953992800 46800 1 +1300} {972741600 43200 0 +1200} {985442400 46800 1 +1300} {1004191200 43200 0 +1200} {1017496800 46800 1 +1300} {1035640800 43200 0 +1200} {1048946400 46800 1 +1300} {1067090400 43200 0 +1200} {1080396000 46800 1 +1300} {1099144800 43200 0 +1200} {1111845600 46800 1 +1300} {1130594400 43200 0 +1200} {1143295200 46800 1 +1300} {1162044000 43200 0 +1200} {1174744800 46800 1 +1300} {1193493600 43200 0 +1200} {1206799200 46800 1 +1300} {1224943200 43200 0 +1200} {1238248800 46800 1 +1300} {1256392800 43200 0 +1200} {1269698400 39600 0 +1100} {1269702000 43200 1 +1200} {1288450800 39600 0 +1100} {1301151600 43200 0 +1200} } tcl9.0.3/library/tzdata/Asia/Amman0000664000175000017500000000504015035744305016341 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Amman) { {-9223372036854775808 8624 0 LMT} {-1230776624 7200 0 EET} {108165600 10800 1 EEST} {118270800 7200 0 EET} {136591200 10800 1 EEST} {149806800 7200 0 EET} {168127200 10800 1 EEST} {181342800 7200 0 EET} {199749600 10800 1 EEST} {215643600 7200 0 EET} {231285600 10800 1 EEST} {244501200 7200 0 EET} {262735200 10800 1 EEST} {275950800 7200 0 EET} {481154400 10800 1 EEST} {496962000 7200 0 EET} {512949600 10800 1 EEST} {528670800 7200 0 EET} {544399200 10800 1 EEST} {560120400 7200 0 EET} {575848800 10800 1 EEST} {592174800 7200 0 EET} {610581600 10800 1 EEST} {623624400 7200 0 EET} {641167200 10800 1 EEST} {655074000 7200 0 EET} {671839200 10800 1 EEST} {685918800 7200 0 EET} {702856800 10800 1 EEST} {717973200 7200 0 EET} {733701600 10800 1 EEST} {749422800 7200 0 EET} {765151200 10800 1 EEST} {779662800 7200 0 EET} {797205600 10800 1 EEST} {811116000 7200 0 EET} {828655200 10800 1 EEST} {843170400 7200 0 EET} {860104800 10800 1 EEST} {874620000 7200 0 EET} {891554400 10800 1 EEST} {906069600 7200 0 EET} {930780000 10800 1 EEST} {938124000 7200 0 EET} {954367200 10800 1 EEST} {970178400 7200 0 EET} {985816800 10800 1 EEST} {1001628000 7200 0 EET} {1017352800 10800 1 EEST} {1033077600 7200 0 EET} {1048802400 10800 1 EEST} {1066946400 7200 0 EET} {1080252000 10800 1 EEST} {1097791200 7200 0 EET} {1112306400 10800 1 EEST} {1128031200 7200 0 EET} {1143756000 10800 1 EEST} {1161900000 7200 0 EET} {1175205600 10800 1 EEST} {1193349600 7200 0 EET} {1206655200 10800 1 EEST} {1225404000 7200 0 EET} {1238104800 10800 1 EEST} {1256853600 7200 0 EET} {1269554400 10800 1 EEST} {1288303200 7200 0 EET} {1301608800 10800 1 EEST} {1319752800 7200 0 EET} {1333058400 10800 1 EEST} {1387486800 7200 0 EET} {1395957600 10800 1 EEST} {1414706400 7200 0 EET} {1427407200 10800 1 EEST} {1446156000 7200 0 EET} {1459461600 10800 1 EEST} {1477605600 7200 0 EET} {1490911200 10800 1 EEST} {1509055200 7200 0 EET} {1522360800 10800 1 EEST} {1540504800 7200 0 EET} {1553810400 10800 1 EEST} {1571954400 7200 0 EET} {1585260000 10800 1 EEST} {1604008800 7200 0 EET} {1616709600 10800 1 EEST} {1635458400 7200 0 EET} {1645740000 10800 1 EEST} {1666908000 10800 0 +0300} } tcl9.0.3/library/tzdata/Asia/Almaty0000664000175000017500000000326315035744305016544 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Almaty) { {-9223372036854775808 18468 0 LMT} {-1441170468 18000 0 +0500} {-1247547600 21600 0 +0600} {354909600 25200 1 +0700} {370717200 21600 0 +0600} {386445600 25200 1 +0700} {402253200 21600 0 +0600} {417981600 25200 1 +0700} {433789200 21600 0 +0600} {449604000 25200 1 +0700} {465336000 21600 0 +0600} {481060800 25200 1 +0700} {496785600 21600 0 +0600} {512510400 25200 1 +0700} {528235200 21600 0 +0600} {543960000 25200 1 +0700} {559684800 21600 0 +0600} {575409600 25200 1 +0700} {591134400 21600 0 +0600} {606859200 25200 1 +0700} {622584000 21600 0 +0600} {638308800 25200 1 +0700} {654638400 21600 0 +0600} {670363200 18000 0 +0500} {670366800 21600 1 +0600} {686091600 18000 0 +0500} {695768400 21600 0 +0600} {701812800 25200 1 +0700} {717537600 21600 0 +0600} {733262400 25200 1 +0700} {748987200 21600 0 +0600} {764712000 25200 1 +0700} {780436800 21600 0 +0600} {796161600 25200 1 +0700} {811886400 21600 0 +0600} {828216000 25200 1 +0700} {846360000 21600 0 +0600} {859665600 25200 1 +0700} {877809600 21600 0 +0600} {891115200 25200 1 +0700} {909259200 21600 0 +0600} {922564800 25200 1 +0700} {941313600 21600 0 +0600} {954014400 25200 1 +0700} {972763200 21600 0 +0600} {985464000 25200 1 +0700} {1004212800 21600 0 +0600} {1017518400 25200 1 +0700} {1035662400 21600 0 +0600} {1048968000 25200 1 +0700} {1067112000 21600 0 +0600} {1080417600 25200 1 +0700} {1099166400 21600 0 +0600} {1709229600 18000 0 +0500} } tcl9.0.3/library/tzdata/Asia/Aden0000664000175000017500000000024615035744305016162 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Riyadh)]} { LoadTimeZoneFile Asia/Riyadh } set TZData(:Asia/Aden) $TZData(:Asia/Riyadh) tcl9.0.3/library/tzdata/Arctic/0000755000175000017500000000000015104662345015714 5ustar sergeisergeitcl9.0.3/library/tzdata/Arctic/Longyearbyen0000664000175000017500000000026615035744305020303 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Europe/Berlin)]} { LoadTimeZoneFile Europe/Berlin } set TZData(:Arctic/Longyearbyen) $TZData(:Europe/Berlin) tcl9.0.3/library/tzdata/Antarctica/0000755000175000017500000000000015104662345016560 5ustar sergeisergeitcl9.0.3/library/tzdata/Antarctica/Vostok0000664000175000017500000000034715035744305017776 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Vostok) { {-9223372036854775808 0 0 -00} {-380073600 25200 0 +0700} {760035600 0 0 -00} {783648000 25200 0 +0700} {1702839600 18000 0 +0500} } tcl9.0.3/library/tzdata/Antarctica/Troll0000664000175000017500000001206615035744305017606 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Troll) { {-9223372036854775808 0 0 -00} {1108166400 0 0 +00} {1111885200 7200 1 +02} {1130634000 0 0 +00} {1143334800 7200 1 +02} {1162083600 0 0 +00} {1174784400 7200 1 +02} {1193533200 0 0 +00} {1206838800 7200 1 +02} {1224982800 0 0 +00} {1238288400 7200 1 +02} {1256432400 0 0 +00} {1269738000 7200 1 +02} {1288486800 0 0 +00} {1301187600 7200 1 +02} {1319936400 0 0 +00} {1332637200 7200 1 +02} {1351386000 0 0 +00} {1364691600 7200 1 +02} {1382835600 0 0 +00} {1396141200 7200 1 +02} {1414285200 0 0 +00} {1427590800 7200 1 +02} {1445734800 0 0 +00} {1459040400 7200 1 +02} {1477789200 0 0 +00} {1490490000 7200 1 +02} {1509238800 0 0 +00} {1521939600 7200 1 +02} {1540688400 0 0 +00} {1553994000 7200 1 +02} {1572138000 0 0 +00} {1585443600 7200 1 +02} {1603587600 0 0 +00} {1616893200 7200 1 +02} {1635642000 0 0 +00} {1648342800 7200 1 +02} {1667091600 0 0 +00} {1679792400 7200 1 +02} {1698541200 0 0 +00} {1711846800 7200 1 +02} {1729990800 0 0 +00} {1743296400 7200 1 +02} {1761440400 0 0 +00} {1774746000 7200 1 +02} {1792890000 0 0 +00} {1806195600 7200 1 +02} {1824944400 0 0 +00} {1837645200 7200 1 +02} {1856394000 0 0 +00} {1869094800 7200 1 +02} {1887843600 0 0 +00} {1901149200 7200 1 +02} {1919293200 0 0 +00} {1932598800 7200 1 +02} {1950742800 0 0 +00} {1964048400 7200 1 +02} {1982797200 0 0 +00} {1995498000 7200 1 +02} {2014246800 0 0 +00} {2026947600 7200 1 +02} {2045696400 0 0 +00} {2058397200 7200 1 +02} {2077146000 0 0 +00} {2090451600 7200 1 +02} {2108595600 0 0 +00} {2121901200 7200 1 +02} {2140045200 0 0 +00} {2153350800 7200 1 +02} {2172099600 0 0 +00} {2184800400 7200 1 +02} {2203549200 0 0 +00} {2216250000 7200 1 +02} {2234998800 0 0 +00} {2248304400 7200 1 +02} {2266448400 0 0 +00} {2279754000 7200 1 +02} {2297898000 0 0 +00} {2311203600 7200 1 +02} {2329347600 0 0 +00} {2342653200 7200 1 +02} {2361402000 0 0 +00} {2374102800 7200 1 +02} {2392851600 0 0 +00} {2405552400 7200 1 +02} {2424301200 0 0 +00} {2437606800 7200 1 +02} {2455750800 0 0 +00} {2469056400 7200 1 +02} {2487200400 0 0 +00} {2500506000 7200 1 +02} {2519254800 0 0 +00} {2531955600 7200 1 +02} {2550704400 0 0 +00} {2563405200 7200 1 +02} {2582154000 0 0 +00} {2595459600 7200 1 +02} {2613603600 0 0 +00} {2626909200 7200 1 +02} {2645053200 0 0 +00} {2658358800 7200 1 +02} {2676502800 0 0 +00} {2689808400 7200 1 +02} {2708557200 0 0 +00} {2721258000 7200 1 +02} {2740006800 0 0 +00} {2752707600 7200 1 +02} {2771456400 0 0 +00} {2784762000 7200 1 +02} {2802906000 0 0 +00} {2816211600 7200 1 +02} {2834355600 0 0 +00} {2847661200 7200 1 +02} {2866410000 0 0 +00} {2879110800 7200 1 +02} {2897859600 0 0 +00} {2910560400 7200 1 +02} {2929309200 0 0 +00} {2942010000 7200 1 +02} {2960758800 0 0 +00} {2974064400 7200 1 +02} {2992208400 0 0 +00} {3005514000 7200 1 +02} {3023658000 0 0 +00} {3036963600 7200 1 +02} {3055712400 0 0 +00} {3068413200 7200 1 +02} {3087162000 0 0 +00} {3099862800 7200 1 +02} {3118611600 0 0 +00} {3131917200 7200 1 +02} {3150061200 0 0 +00} {3163366800 7200 1 +02} {3181510800 0 0 +00} {3194816400 7200 1 +02} {3212960400 0 0 +00} {3226266000 7200 1 +02} {3245014800 0 0 +00} {3257715600 7200 1 +02} {3276464400 0 0 +00} {3289165200 7200 1 +02} {3307914000 0 0 +00} {3321219600 7200 1 +02} {3339363600 0 0 +00} {3352669200 7200 1 +02} {3370813200 0 0 +00} {3384118800 7200 1 +02} {3402867600 0 0 +00} {3415568400 7200 1 +02} {3434317200 0 0 +00} {3447018000 7200 1 +02} {3465766800 0 0 +00} {3479072400 7200 1 +02} {3497216400 0 0 +00} {3510522000 7200 1 +02} {3528666000 0 0 +00} {3541971600 7200 1 +02} {3560115600 0 0 +00} {3573421200 7200 1 +02} {3592170000 0 0 +00} {3604870800 7200 1 +02} {3623619600 0 0 +00} {3636320400 7200 1 +02} {3655069200 0 0 +00} {3668374800 7200 1 +02} {3686518800 0 0 +00} {3699824400 7200 1 +02} {3717968400 0 0 +00} {3731274000 7200 1 +02} {3750022800 0 0 +00} {3762723600 7200 1 +02} {3781472400 0 0 +00} {3794173200 7200 1 +02} {3812922000 0 0 +00} {3825622800 7200 1 +02} {3844371600 0 0 +00} {3857677200 7200 1 +02} {3875821200 0 0 +00} {3889126800 7200 1 +02} {3907270800 0 0 +00} {3920576400 7200 1 +02} {3939325200 0 0 +00} {3952026000 7200 1 +02} {3970774800 0 0 +00} {3983475600 7200 1 +02} {4002224400 0 0 +00} {4015530000 7200 1 +02} {4033674000 0 0 +00} {4046979600 7200 1 +02} {4065123600 0 0 +00} {4078429200 7200 1 +02} {4096573200 0 0 +00} } tcl9.0.3/library/tzdata/Antarctica/Syowa0000664000175000017500000000025515035744305017611 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Asia/Riyadh)]} { LoadTimeZoneFile Asia/Riyadh } set TZData(:Antarctica/Syowa) $TZData(:Asia/Riyadh) tcl9.0.3/library/tzdata/Antarctica/South_Pole0000664000175000017500000000030115035744305020560 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Auckland)]} { LoadTimeZoneFile Pacific/Auckland } set TZData(:Antarctica/South_Pole) $TZData(:Pacific/Auckland) tcl9.0.3/library/tzdata/Antarctica/Rothera0000664000175000017500000000022315035744305020106 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Rothera) { {-9223372036854775808 0 0 -00} {218246400 -10800 0 -0300} } tcl9.0.3/library/tzdata/Antarctica/Palmer0000664000175000017500000000520215035744305017724 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Palmer) { {-9223372036854775808 0 0 -00} {-157766400 -14400 0 -0400} {-152654400 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {389070000 -14400 0 -0400} {403070400 -10800 1 -0300} {416372400 -14400 0 -0400} {434520000 -10800 1 -0300} {447822000 -14400 0 -0400} {466574400 -10800 1 -0300} {479271600 -14400 0 -0400} {498024000 -10800 1 -0300} {510721200 -14400 0 -0400} {529473600 -10800 1 -0300} {545194800 -14400 0 -0400} {560923200 -10800 1 -0300} {574225200 -14400 0 -0400} {592372800 -10800 1 -0300} {605674800 -14400 0 -0400} {624427200 -10800 1 -0300} {637124400 -14400 0 -0400} {653457600 -10800 1 -0300} {668574000 -14400 0 -0400} {687326400 -10800 1 -0300} {700628400 -14400 0 -0400} {718776000 -10800 1 -0300} {732078000 -14400 0 -0400} {750225600 -10800 1 -0300} {763527600 -14400 0 -0400} {781675200 -10800 1 -0300} {794977200 -14400 0 -0400} {813729600 -10800 1 -0300} {826426800 -14400 0 -0400} {845179200 -10800 1 -0300} {859690800 -14400 0 -0400} {876628800 -10800 1 -0300} {889930800 -14400 0 -0400} {906868800 -10800 1 -0300} {923194800 -14400 0 -0400} {939528000 -10800 1 -0300} {952830000 -14400 0 -0400} {971582400 -10800 1 -0300} {984279600 -14400 0 -0400} {1003032000 -10800 1 -0300} {1015729200 -14400 0 -0400} {1034481600 -10800 1 -0300} {1047178800 -14400 0 -0400} {1065931200 -10800 1 -0300} {1079233200 -14400 0 -0400} {1097380800 -10800 1 -0300} {1110682800 -14400 0 -0400} {1128830400 -10800 1 -0300} {1142132400 -14400 0 -0400} {1160884800 -10800 1 -0300} {1173582000 -14400 0 -0400} {1192334400 -10800 1 -0300} {1206846000 -14400 0 -0400} {1223784000 -10800 1 -0300} {1237086000 -14400 0 -0400} {1255233600 -10800 1 -0300} {1270350000 -14400 0 -0400} {1286683200 -10800 1 -0300} {1304823600 -14400 0 -0400} {1313899200 -10800 1 -0300} {1335668400 -14400 0 -0400} {1346558400 -10800 1 -0300} {1367118000 -14400 0 -0400} {1378612800 -10800 1 -0300} {1398567600 -14400 0 -0400} {1410062400 -10800 1 -0300} {1463281200 -14400 0 -0400} {1471147200 -10800 1 -0300} {1480820400 -10800 0 -0300} } tcl9.0.3/library/tzdata/Antarctica/McMurdo0000664000175000017500000000027615035744305020060 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Auckland)]} { LoadTimeZoneFile Pacific/Auckland } set TZData(:Antarctica/McMurdo) $TZData(:Pacific/Auckland) tcl9.0.3/library/tzdata/Antarctica/Mawson0000664000175000017500000000026115035744305017750 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Mawson) { {-9223372036854775808 0 0 -00} {-501206400 21600 0 +0600} {1255809600 18000 0 +0500} } tcl9.0.3/library/tzdata/Antarctica/Macquarie0000664000175000017500000001775315035744305020431 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Macquarie) { {-9223372036854775808 0 0 -00} {-2214259200 36000 0 AEST} {-1680508800 39600 1 AEDT} {-1669892400 39600 0 AEDT} {-1665388800 36000 0 AEST} {-1601719200 0 0 -00} {-94730400 36000 0 AEST} {-71136000 39600 1 AEDT} {-55411200 36000 0 AEST} {-37267200 39600 1 AEDT} {-25776000 36000 0 AEST} {-5817600 39600 1 AEDT} {5673600 36000 0 AEST} {25632000 39600 1 AEDT} {37728000 36000 0 AEST} {57686400 39600 1 AEDT} {67968000 36000 0 AEST} {89136000 39600 1 AEDT} {100022400 36000 0 AEST} {120585600 39600 1 AEDT} {131472000 36000 0 AEST} {152035200 39600 1 AEDT} {162921600 36000 0 AEST} {183484800 39600 1 AEDT} {194976000 36000 0 AEST} {215539200 39600 1 AEDT} {226425600 36000 0 AEST} {246988800 39600 1 AEDT} {257875200 36000 0 AEST} {278438400 39600 1 AEDT} {289324800 36000 0 AEST} {309888000 39600 1 AEDT} {320774400 36000 0 AEST} {341337600 39600 1 AEDT} {352224000 36000 0 AEST} {372787200 39600 1 AEDT} {386092800 36000 0 AEST} {404841600 39600 1 AEDT} {417542400 36000 0 AEST} {436291200 39600 1 AEDT} {447177600 36000 0 AEST} {467740800 39600 1 AEDT} {478627200 36000 0 AEST} {499190400 39600 1 AEDT} {510076800 36000 0 AEST} {530035200 39600 1 AEDT} {542736000 36000 0 AEST} {562089600 39600 1 AEDT} {574790400 36000 0 AEST} {594144000 39600 1 AEDT} {606240000 36000 0 AEST} {625593600 39600 1 AEDT} {637689600 36000 0 AEST} {657043200 39600 1 AEDT} {670348800 36000 0 AEST} {686678400 39600 1 AEDT} {701798400 36000 0 AEST} {718128000 39600 1 AEDT} {733248000 36000 0 AEST} {749577600 39600 1 AEDT} {764697600 36000 0 AEST} {781027200 39600 1 AEDT} {796147200 36000 0 AEST} {812476800 39600 1 AEDT} {828201600 36000 0 AEST} {844531200 39600 1 AEDT} {859651200 36000 0 AEST} {875980800 39600 1 AEDT} {891100800 36000 0 AEST} {907430400 39600 1 AEDT} {922550400 36000 0 AEST} {938880000 39600 1 AEDT} {954000000 36000 0 AEST} {967305600 39600 1 AEDT} {985449600 36000 0 AEST} {1002384000 39600 1 AEDT} {1017504000 36000 0 AEST} {1033833600 39600 1 AEDT} {1048953600 36000 0 AEST} {1065283200 39600 1 AEDT} {1080403200 36000 0 AEST} {1096732800 39600 1 AEDT} {1111852800 36000 0 AEST} {1128182400 39600 1 AEDT} {1143907200 36000 0 AEST} {1159632000 39600 1 AEDT} {1174752000 36000 0 AEST} {1191686400 39600 1 AEDT} {1207411200 36000 0 AEST} {1223136000 39600 1 AEDT} {1238860800 36000 0 AEST} {1254585600 39600 1 AEDT} {1262264400 39600 1 AEDT} {1293800400 39600 0 AEST} {1301760000 36000 0 AEST} {1317484800 39600 1 AEDT} {1333209600 36000 0 AEST} {1349539200 39600 1 AEDT} {1365264000 36000 0 AEST} {1380988800 39600 1 AEDT} {1396713600 36000 0 AEST} {1412438400 39600 1 AEDT} {1428163200 36000 0 AEST} {1443888000 39600 1 AEDT} {1459612800 36000 0 AEST} {1475337600 39600 1 AEDT} {1491062400 36000 0 AEST} {1506787200 39600 1 AEDT} {1522512000 36000 0 AEST} {1538841600 39600 1 AEDT} {1554566400 36000 0 AEST} {1570291200 39600 1 AEDT} {1586016000 36000 0 AEST} {1601740800 39600 1 AEDT} {1617465600 36000 0 AEST} {1633190400 39600 1 AEDT} {1648915200 36000 0 AEST} {1664640000 39600 1 AEDT} {1680364800 36000 0 AEST} {1696089600 39600 1 AEDT} {1712419200 36000 0 AEST} {1728144000 39600 1 AEDT} {1743868800 36000 0 AEST} {1759593600 39600 1 AEDT} {1775318400 36000 0 AEST} {1791043200 39600 1 AEDT} {1806768000 36000 0 AEST} {1822492800 39600 1 AEDT} {1838217600 36000 0 AEST} {1853942400 39600 1 AEDT} {1869667200 36000 0 AEST} {1885996800 39600 1 AEDT} {1901721600 36000 0 AEST} {1917446400 39600 1 AEDT} {1933171200 36000 0 AEST} {1948896000 39600 1 AEDT} {1964620800 36000 0 AEST} {1980345600 39600 1 AEDT} {1996070400 36000 0 AEST} {2011795200 39600 1 AEDT} {2027520000 36000 0 AEST} {2043244800 39600 1 AEDT} {2058969600 36000 0 AEST} {2075299200 39600 1 AEDT} {2091024000 36000 0 AEST} {2106748800 39600 1 AEDT} {2122473600 36000 0 AEST} {2138198400 39600 1 AEDT} {2153923200 36000 0 AEST} {2169648000 39600 1 AEDT} {2185372800 36000 0 AEST} {2201097600 39600 1 AEDT} {2216822400 36000 0 AEST} {2233152000 39600 1 AEDT} {2248876800 36000 0 AEST} {2264601600 39600 1 AEDT} {2280326400 36000 0 AEST} {2296051200 39600 1 AEDT} {2311776000 36000 0 AEST} {2327500800 39600 1 AEDT} {2343225600 36000 0 AEST} {2358950400 39600 1 AEDT} {2374675200 36000 0 AEST} {2390400000 39600 1 AEDT} {2406124800 36000 0 AEST} {2422454400 39600 1 AEDT} {2438179200 36000 0 AEST} {2453904000 39600 1 AEDT} {2469628800 36000 0 AEST} {2485353600 39600 1 AEDT} {2501078400 36000 0 AEST} {2516803200 39600 1 AEDT} {2532528000 36000 0 AEST} {2548252800 39600 1 AEDT} {2563977600 36000 0 AEST} {2579702400 39600 1 AEDT} {2596032000 36000 0 AEST} {2611756800 39600 1 AEDT} {2627481600 36000 0 AEST} {2643206400 39600 1 AEDT} {2658931200 36000 0 AEST} {2674656000 39600 1 AEDT} {2690380800 36000 0 AEST} {2706105600 39600 1 AEDT} {2721830400 36000 0 AEST} {2737555200 39600 1 AEDT} {2753280000 36000 0 AEST} {2769609600 39600 1 AEDT} {2785334400 36000 0 AEST} {2801059200 39600 1 AEDT} {2816784000 36000 0 AEST} {2832508800 39600 1 AEDT} {2848233600 36000 0 AEST} {2863958400 39600 1 AEDT} {2879683200 36000 0 AEST} {2895408000 39600 1 AEDT} {2911132800 36000 0 AEST} {2926857600 39600 1 AEDT} {2942582400 36000 0 AEST} {2958912000 39600 1 AEDT} {2974636800 36000 0 AEST} {2990361600 39600 1 AEDT} {3006086400 36000 0 AEST} {3021811200 39600 1 AEDT} {3037536000 36000 0 AEST} {3053260800 39600 1 AEDT} {3068985600 36000 0 AEST} {3084710400 39600 1 AEDT} {3100435200 36000 0 AEST} {3116764800 39600 1 AEDT} {3132489600 36000 0 AEST} {3148214400 39600 1 AEDT} {3163939200 36000 0 AEST} {3179664000 39600 1 AEDT} {3195388800 36000 0 AEST} {3211113600 39600 1 AEDT} {3226838400 36000 0 AEST} {3242563200 39600 1 AEDT} {3258288000 36000 0 AEST} {3274012800 39600 1 AEDT} {3289737600 36000 0 AEST} {3306067200 39600 1 AEDT} {3321792000 36000 0 AEST} {3337516800 39600 1 AEDT} {3353241600 36000 0 AEST} {3368966400 39600 1 AEDT} {3384691200 36000 0 AEST} {3400416000 39600 1 AEDT} {3416140800 36000 0 AEST} {3431865600 39600 1 AEDT} {3447590400 36000 0 AEST} {3463315200 39600 1 AEDT} {3479644800 36000 0 AEST} {3495369600 39600 1 AEDT} {3511094400 36000 0 AEST} {3526819200 39600 1 AEDT} {3542544000 36000 0 AEST} {3558268800 39600 1 AEDT} {3573993600 36000 0 AEST} {3589718400 39600 1 AEDT} {3605443200 36000 0 AEST} {3621168000 39600 1 AEDT} {3636892800 36000 0 AEST} {3653222400 39600 1 AEDT} {3668947200 36000 0 AEST} {3684672000 39600 1 AEDT} {3700396800 36000 0 AEST} {3716121600 39600 1 AEDT} {3731846400 36000 0 AEST} {3747571200 39600 1 AEDT} {3763296000 36000 0 AEST} {3779020800 39600 1 AEDT} {3794745600 36000 0 AEST} {3810470400 39600 1 AEDT} {3826195200 36000 0 AEST} {3842524800 39600 1 AEDT} {3858249600 36000 0 AEST} {3873974400 39600 1 AEDT} {3889699200 36000 0 AEST} {3905424000 39600 1 AEDT} {3921148800 36000 0 AEST} {3936873600 39600 1 AEDT} {3952598400 36000 0 AEST} {3968323200 39600 1 AEDT} {3984048000 36000 0 AEST} {4000377600 39600 1 AEDT} {4016102400 36000 0 AEST} {4031827200 39600 1 AEDT} {4047552000 36000 0 AEST} {4063276800 39600 1 AEDT} {4079001600 36000 0 AEST} {4094726400 39600 1 AEDT} } tcl9.0.3/library/tzdata/Antarctica/DumontDUrville0000664000175000017500000000032115035744305021416 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Pacific/Port_Moresby)]} { LoadTimeZoneFile Pacific/Port_Moresby } set TZData(:Antarctica/DumontDUrville) $TZData(:Pacific/Port_Moresby) tcl9.0.3/library/tzdata/Antarctica/Davis0000664000175000017500000000050415035744305017552 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Davis) { {-9223372036854775808 0 0 -00} {-409190400 25200 0 +0700} {-163062000 0 0 -00} {-28857600 25200 0 +0700} {1255806000 18000 0 +0500} {1268251200 25200 0 +0700} {1319742000 18000 0 +0500} {1329854400 25200 0 +0700} } tcl9.0.3/library/tzdata/Antarctica/Casey0000664000175000017500000000120015035744305017542 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Antarctica/Casey) { {-9223372036854775808 0 0 -00} {-31536000 28800 0 +0800} {1255802400 39600 0 +1100} {1267714800 28800 0 +0800} {1319738400 39600 0 +1100} {1329843600 28800 0 +0800} {1477065600 39600 0 +1100} {1520701200 28800 0 +0800} {1538856000 39600 0 +1100} {1552752000 28800 0 +0800} {1570129200 39600 0 +1100} {1583596800 28800 0 +0800} {1601740860 39600 0 +1100} {1615640400 28800 0 +0800} {1633190460 39600 0 +1100} {1647090000 28800 0 +0800} {1664640060 39600 0 +1100} {1678291200 28800 0 +0800} } tcl9.0.3/library/tzdata/America/0000755000175000017500000000000015104662345016050 5ustar sergeisergeitcl9.0.3/library/tzdata/America/Yellowknife0000664000175000017500000000027715035744305020273 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Edmonton)]} { LoadTimeZoneFile America/Edmonton } set TZData(:America/Yellowknife) $TZData(:America/Edmonton) tcl9.0.3/library/tzdata/America/Yakutat0000664000175000017500000002032715035744305017423 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Yakutat) { {-9223372036854775808 52865 0 LMT} {-3225223727 -33535 0 LMT} {-2188953665 -32400 0 YST} {-883580400 -32400 0 YST} {-880203600 -28800 1 YWT} {-769395600 -28800 1 YPT} {-765381600 -32400 0 YST} {-757350000 -32400 0 YST} {-31503600 -32400 0 YST} {-21474000 -28800 1 YDT} {-5752800 -32400 0 YST} {9975600 -28800 1 YDT} {25696800 -32400 0 YST} {41425200 -28800 1 YDT} {57751200 -32400 0 YST} {73479600 -28800 1 YDT} {89200800 -32400 0 YST} {104929200 -28800 1 YDT} {120650400 -32400 0 YST} {126702000 -28800 1 YDT} {152100000 -32400 0 YST} {162385200 -28800 1 YDT} {183549600 -32400 0 YST} {199278000 -28800 1 YDT} {215604000 -32400 0 YST} {230727600 -28800 1 YDT} {247053600 -32400 0 YST} {262782000 -28800 1 YDT} {278503200 -32400 0 YST} {294231600 -28800 1 YDT} {309952800 -32400 0 YST} {325681200 -28800 1 YDT} {341402400 -32400 0 YST} {357130800 -28800 1 YDT} {372852000 -32400 0 YST} {388580400 -28800 1 YDT} {404906400 -32400 0 YST} {420030000 -28800 1 YDT} {436356000 -32400 0 YST} {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} } tcl9.0.3/library/tzdata/America/Winnipeg0000664000175000017500000002224315035744305017560 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Winnipeg) { {-9223372036854775808 -23316 0 LMT} {-2602258284 -21600 0 CST} {-1694368800 -18000 1 CDT} {-1681671600 -21600 0 CST} {-1632067200 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1029686400 -18000 1 CDT} {-1018198800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-746035200 -18000 1 CDT} {-732733200 -21600 0 CST} {-715795200 -18000 1 CDT} {-702493200 -21600 0 CST} {-684345600 -18000 1 CDT} {-671043600 -21600 0 CST} {-652896000 -18000 1 CDT} {-639594000 -21600 0 CST} {-620755200 -18000 1 CDT} {-607626000 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-418237200 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-321469200 -21600 0 CST} {-305740800 -18000 1 CDT} {-292438800 -21600 0 CST} {-210787200 -18000 1 CDT} {-198090000 -21600 0 CST} {-116438400 -18000 1 CDT} {-100108800 -21600 0 CST} {-84384000 -18000 1 CDT} {-68659200 -21600 0 CST} {-52934400 -18000 1 CDT} {-37209600 -21600 0 CST} {-21484800 -18000 1 CDT} {-5760000 -21600 0 CST} {9964800 -18000 1 CDT} {25689600 -21600 0 CST} {41414400 -18000 1 CDT} {57744000 -21600 0 CST} {73468800 -18000 1 CDT} {89193600 -21600 0 CST} {104918400 -18000 1 CDT} {120643200 -21600 0 CST} {136368000 -18000 1 CDT} {152092800 -21600 0 CST} {167817600 -18000 1 CDT} {183542400 -21600 0 CST} {199267200 -18000 1 CDT} {215596800 -21600 0 CST} {230716800 -18000 1 CDT} {247046400 -21600 0 CST} {262771200 -18000 1 CDT} {278496000 -21600 0 CST} {294220800 -18000 1 CDT} {309945600 -21600 0 CST} {325670400 -18000 1 CDT} {341395200 -21600 0 CST} {357120000 -18000 1 CDT} {372844800 -21600 0 CST} {388569600 -18000 1 CDT} {404899200 -21600 0 CST} {420019200 -18000 1 CDT} {436348800 -21600 0 CST} {452073600 -18000 1 CDT} {467798400 -21600 0 CST} {483523200 -18000 1 CDT} {499248000 -21600 0 CST} {514972800 -18000 1 CDT} {530697600 -21600 0 CST} {544608000 -18000 1 CDT} {562147200 -21600 0 CST} {576057600 -18000 1 CDT} {594201600 -21600 0 CST} {607507200 -18000 1 CDT} {625651200 -21600 0 CST} {638956800 -18000 1 CDT} {657100800 -21600 0 CST} {671011200 -18000 1 CDT} {688550400 -21600 0 CST} {702460800 -18000 1 CDT} {720000000 -21600 0 CST} {733910400 -18000 1 CDT} {752054400 -21600 0 CST} {765360000 -18000 1 CDT} {783504000 -21600 0 CST} {796809600 -18000 1 CDT} {814953600 -21600 0 CST} {828864000 -18000 1 CDT} {846403200 -21600 0 CST} {860313600 -18000 1 CDT} {877852800 -21600 0 CST} {891763200 -18000 1 CDT} {909302400 -21600 0 CST} {923212800 -18000 1 CDT} {941356800 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -21600 0 CST} {986112000 -18000 1 CDT} {1004256000 -21600 0 CST} {1018166400 -18000 1 CDT} {1035705600 -21600 0 CST} {1049616000 -18000 1 CDT} {1067155200 -21600 0 CST} {1081065600 -18000 1 CDT} {1099209600 -21600 0 CST} {1112515200 -18000 1 CDT} {1130659200 -21600 0 CST} {1136095200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Whitehorse0000664000175000017500000000556515035744305020131 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Whitehorse) { {-9223372036854775808 -32412 0 LMT} {-2188997988 -32400 0 YST} {-1632056400 -28800 1 YDT} {-1615125600 -32400 0 YST} {-1596978000 -28800 1 YDT} {-1583164800 -32400 0 YST} {-880203600 -28800 1 YWT} {-769395600 -28800 1 YPT} {-765381600 -32400 0 YST} {-157734000 -32400 0 YST} {-147884400 -25200 1 YDDT} {-131554800 -32400 0 YST} {-121273200 -28800 0 PST} {315561600 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1173607200 -25200 1 PDT} {1194166800 -28800 0 PST} {1205056800 -25200 1 PDT} {1225616400 -28800 0 PST} {1236506400 -25200 1 PDT} {1257066000 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 1 PDT} {1446368400 -28800 0 PST} {1457863200 -25200 1 PDT} {1478422800 -28800 0 PST} {1489312800 -25200 1 PDT} {1509872400 -28800 0 PST} {1520762400 -25200 1 PDT} {1541322000 -28800 0 PST} {1552212000 -25200 1 PDT} {1572771600 -28800 0 PST} {1583661600 -25200 1 PDT} {1604217600 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Virgin0000664000175000017500000000030315035744305017227 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Virgin) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Vancouver0000664000175000017500000002242715035744305017754 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Vancouver) { {-9223372036854775808 -29548 0 LMT} {-2713880852 -28800 0 PST} {-1632060000 -25200 1 PDT} {-1615129200 -28800 0 PST} {-880207200 -25200 1 PWT} {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-747237600 -25200 1 PDT} {-733935600 -28800 0 PST} {-715788000 -25200 1 PDT} {-702486000 -28800 0 PST} {-684338400 -25200 1 PDT} {-671036400 -28800 0 PST} {-652888800 -25200 1 PDT} {-639586800 -28800 0 PST} {-620834400 -25200 1 PDT} {-608137200 -28800 0 PST} {-589384800 -25200 1 PDT} {-576082800 -28800 0 PST} {-557935200 -25200 1 PDT} {-544633200 -28800 0 PST} {-526485600 -25200 1 PDT} {-513183600 -28800 0 PST} {-495036000 -25200 1 PDT} {-481734000 -28800 0 PST} {-463586400 -25200 1 PDT} {-450284400 -28800 0 PST} {-431532000 -25200 1 PDT} {-418230000 -28800 0 PST} {-400082400 -25200 1 PDT} {-386780400 -28800 0 PST} {-368632800 -25200 1 PDT} {-355330800 -28800 0 PST} {-337183200 -25200 1 PDT} {-323881200 -28800 0 PST} {-305733600 -25200 1 PDT} {-292431600 -28800 0 PST} {-273679200 -25200 1 PDT} {-260982000 -28800 0 PST} {-242229600 -25200 1 PDT} {-226508400 -28800 0 PST} {-210780000 -25200 1 PDT} {-195058800 -28800 0 PST} {-179330400 -25200 1 PDT} {-163609200 -28800 0 PST} {-147880800 -25200 1 PDT} {-131554800 -28800 0 PST} {-116431200 -25200 1 PDT} {-100105200 -28800 0 PST} {-84376800 -25200 1 PDT} {-68655600 -28800 0 PST} {-52927200 -25200 1 PDT} {-37206000 -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} {136375200 -25200 1 PDT} {152096400 -28800 0 PST} {167824800 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {536486400 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1173607200 -25200 1 PDT} {1194166800 -28800 0 PST} {1205056800 -25200 1 PDT} {1225616400 -28800 0 PST} {1236506400 -25200 1 PDT} {1257066000 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 1 PDT} {1446368400 -28800 0 PST} {1457863200 -25200 1 PDT} {1478422800 -28800 0 PST} {1489312800 -25200 1 PDT} {1509872400 -28800 0 PST} {1520762400 -25200 1 PDT} {1541322000 -28800 0 PST} {1552212000 -25200 1 PDT} {1572771600 -28800 0 PST} {1583661600 -25200 1 PDT} {1604221200 -28800 0 PST} {1615716000 -25200 1 PDT} {1636275600 -28800 0 PST} {1647165600 -25200 1 PDT} {1667725200 -28800 0 PST} {1678615200 -25200 1 PDT} {1699174800 -28800 0 PST} {1710064800 -25200 1 PDT} {1730624400 -28800 0 PST} {1741514400 -25200 1 PDT} {1762074000 -28800 0 PST} {1772964000 -25200 1 PDT} {1793523600 -28800 0 PST} {1805018400 -25200 1 PDT} {1825578000 -28800 0 PST} {1836468000 -25200 1 PDT} {1857027600 -28800 0 PST} {1867917600 -25200 1 PDT} {1888477200 -28800 0 PST} {1899367200 -25200 1 PDT} {1919926800 -28800 0 PST} {1930816800 -25200 1 PDT} {1951376400 -28800 0 PST} {1962871200 -25200 1 PDT} {1983430800 -28800 0 PST} {1994320800 -25200 1 PDT} {2014880400 -28800 0 PST} {2025770400 -25200 1 PDT} {2046330000 -28800 0 PST} {2057220000 -25200 1 PDT} {2077779600 -28800 0 PST} {2088669600 -25200 1 PDT} {2109229200 -28800 0 PST} {2120119200 -25200 1 PDT} {2140678800 -28800 0 PST} {2152173600 -25200 1 PDT} {2172733200 -28800 0 PST} {2183623200 -25200 1 PDT} {2204182800 -28800 0 PST} {2215072800 -25200 1 PDT} {2235632400 -28800 0 PST} {2246522400 -25200 1 PDT} {2267082000 -28800 0 PST} {2277972000 -25200 1 PDT} {2298531600 -28800 0 PST} {2309421600 -25200 1 PDT} {2329981200 -28800 0 PST} {2341476000 -25200 1 PDT} {2362035600 -28800 0 PST} {2372925600 -25200 1 PDT} {2393485200 -28800 0 PST} {2404375200 -25200 1 PDT} {2424934800 -28800 0 PST} {2435824800 -25200 1 PDT} {2456384400 -28800 0 PST} {2467274400 -25200 1 PDT} {2487834000 -28800 0 PST} {2499328800 -25200 1 PDT} {2519888400 -28800 0 PST} {2530778400 -25200 1 PDT} {2551338000 -28800 0 PST} {2562228000 -25200 1 PDT} {2582787600 -28800 0 PST} {2593677600 -25200 1 PDT} {2614237200 -28800 0 PST} {2625127200 -25200 1 PDT} {2645686800 -28800 0 PST} {2656576800 -25200 1 PDT} {2677136400 -28800 0 PST} {2688631200 -25200 1 PDT} {2709190800 -28800 0 PST} {2720080800 -25200 1 PDT} {2740640400 -28800 0 PST} {2751530400 -25200 1 PDT} {2772090000 -28800 0 PST} {2782980000 -25200 1 PDT} {2803539600 -28800 0 PST} {2814429600 -25200 1 PDT} {2834989200 -28800 0 PST} {2846484000 -25200 1 PDT} {2867043600 -28800 0 PST} {2877933600 -25200 1 PDT} {2898493200 -28800 0 PST} {2909383200 -25200 1 PDT} {2929942800 -28800 0 PST} {2940832800 -25200 1 PDT} {2961392400 -28800 0 PST} {2972282400 -25200 1 PDT} {2992842000 -28800 0 PST} {3003732000 -25200 1 PDT} {3024291600 -28800 0 PST} {3035786400 -25200 1 PDT} {3056346000 -28800 0 PST} {3067236000 -25200 1 PDT} {3087795600 -28800 0 PST} {3098685600 -25200 1 PDT} {3119245200 -28800 0 PST} {3130135200 -25200 1 PDT} {3150694800 -28800 0 PST} {3161584800 -25200 1 PDT} {3182144400 -28800 0 PST} {3193034400 -25200 1 PDT} {3213594000 -28800 0 PST} {3225088800 -25200 1 PDT} {3245648400 -28800 0 PST} {3256538400 -25200 1 PDT} {3277098000 -28800 0 PST} {3287988000 -25200 1 PDT} {3308547600 -28800 0 PST} {3319437600 -25200 1 PDT} {3339997200 -28800 0 PST} {3350887200 -25200 1 PDT} {3371446800 -28800 0 PST} {3382941600 -25200 1 PDT} {3403501200 -28800 0 PST} {3414391200 -25200 1 PDT} {3434950800 -28800 0 PST} {3445840800 -25200 1 PDT} {3466400400 -28800 0 PST} {3477290400 -25200 1 PDT} {3497850000 -28800 0 PST} {3508740000 -25200 1 PDT} {3529299600 -28800 0 PST} {3540189600 -25200 1 PDT} {3560749200 -28800 0 PST} {3572244000 -25200 1 PDT} {3592803600 -28800 0 PST} {3603693600 -25200 1 PDT} {3624253200 -28800 0 PST} {3635143200 -25200 1 PDT} {3655702800 -28800 0 PST} {3666592800 -25200 1 PDT} {3687152400 -28800 0 PST} {3698042400 -25200 1 PDT} {3718602000 -28800 0 PST} {3730096800 -25200 1 PDT} {3750656400 -28800 0 PST} {3761546400 -25200 1 PDT} {3782106000 -28800 0 PST} {3792996000 -25200 1 PDT} {3813555600 -28800 0 PST} {3824445600 -25200 1 PDT} {3845005200 -28800 0 PST} {3855895200 -25200 1 PDT} {3876454800 -28800 0 PST} {3887344800 -25200 1 PDT} {3907904400 -28800 0 PST} {3919399200 -25200 1 PDT} {3939958800 -28800 0 PST} {3950848800 -25200 1 PDT} {3971408400 -28800 0 PST} {3982298400 -25200 1 PDT} {4002858000 -28800 0 PST} {4013748000 -25200 1 PDT} {4034307600 -28800 0 PST} {4045197600 -25200 1 PDT} {4065757200 -28800 0 PST} {4076647200 -25200 1 PDT} {4097206800 -28800 0 PST} } tcl9.0.3/library/tzdata/America/Tortola0000664000175000017500000000030415035744305017416 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Tortola) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Toronto0000664000175000017500000002520315035744305017443 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Toronto) { {-9223372036854775808 -19052 0 LMT} {-2366736148 -18000 0 EST} {-1632070800 -14400 1 EDT} {-1615140000 -18000 0 EST} {-1609441200 -18000 0 EST} {-1601753400 -14400 1 EDT} {-1583697600 -18000 0 EST} {-1567357200 -14400 1 EDT} {-1554667200 -18000 0 EST} {-1534698000 -14400 1 EDT} {-1524074400 -18000 0 EST} {-1503248400 -14400 1 EDT} {-1492365600 -18000 0 EST} {-1471798800 -14400 1 EDT} {-1460916000 -18000 0 EST} {-1440954000 -14400 1 EDT} {-1428861600 -18000 0 EST} {-1409504400 -14400 1 EDT} {-1397412000 -18000 0 EST} {-1378054800 -14400 1 EDT} {-1365962400 -18000 0 EST} {-1346605200 -14400 1 EDT} {-1333908000 -18000 0 EST} {-1315155600 -14400 1 EDT} {-1301853600 -18000 0 EST} {-1283706000 -14400 1 EDT} {-1270404000 -18000 0 EST} {-1252256400 -14400 1 EDT} {-1238954400 -18000 0 EST} {-1220806800 -14400 1 EDT} {-1207504800 -18000 0 EST} {-1188752400 -14400 1 EDT} {-1176055200 -18000 0 EST} {-1157302800 -14400 1 EDT} {-1144000800 -18000 0 EST} {-1125853200 -14400 1 EDT} {-1112551200 -18000 0 EST} {-1094403600 -14400 1 EDT} {-1081101600 -18000 0 EST} {-1062954000 -14400 1 EDT} {-1049652000 -18000 0 EST} {-1031504400 -14400 1 EDT} {-1018202400 -18000 0 EST} {-1000054800 -14400 1 EDT} {-986752800 -18000 0 EST} {-968000400 -14400 1 EDT} {-955303200 -18000 0 EST} {-936550800 -14400 1 EDT} {-880218000 -14400 0 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} {-757364400 -18000 0 EST} {-747248400 -14400 1 EDT} {-733946400 -18000 0 EST} {-715798800 -14400 1 EDT} {-702496800 -18000 0 EST} {-684349200 -14400 1 EDT} {-671047200 -18000 0 EST} {-652899600 -14400 1 EDT} {-634154400 -18000 0 EST} {-620845200 -14400 1 EDT} {-602704800 -18000 0 EST} {-589395600 -14400 1 EDT} {-576093600 -18000 0 EST} {-557946000 -14400 1 EDT} {-544644000 -18000 0 EST} {-526496400 -14400 1 EDT} {-513194400 -18000 0 EST} {-495046800 -14400 1 EDT} {-481744800 -18000 0 EST} {-463597200 -14400 1 EDT} {-450295200 -18000 0 EST} {-431542800 -14400 1 EDT} {-418240800 -18000 0 EST} {-400093200 -14400 1 EDT} {-384372000 -18000 0 EST} {-368643600 -14400 1 EDT} {-352922400 -18000 0 EST} {-337194000 -14400 1 EDT} {-321472800 -18000 0 EST} {-305744400 -14400 1 EDT} {-289418400 -18000 0 EST} {-273690000 -14400 1 EDT} {-257968800 -18000 0 EST} {-242240400 -14400 1 EDT} {-226519200 -18000 0 EST} {-210790800 -14400 1 EDT} {-195069600 -18000 0 EST} {-179341200 -14400 1 EDT} {-163620000 -18000 0 EST} {-147891600 -14400 1 EDT} {-131565600 -18000 0 EST} {-116442000 -14400 1 EDT} {-100116000 -18000 0 EST} {-84387600 -14400 1 EDT} {-68666400 -18000 0 EST} {-52938000 -14400 1 EDT} {-37216800 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {41410800 -14400 1 EDT} {57736800 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {126248400 -18000 0 EST} {136364400 -14400 1 EDT} {152085600 -18000 0 EST} {167814000 -14400 1 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941349600 -18000 0 EST} {954658800 -14400 1 EDT} {972799200 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Tijuana0000664000175000017500000002071215035744305017372 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Tijuana) { {-9223372036854775808 -28084 0 LMT} {-1514739600 -25200 0 MST} {-1451667600 -28800 0 PST} {-1343145600 -25200 0 MST} {-1234803600 -28800 0 PST} {-1222963200 -25200 1 PDT} {-1207242000 -28800 0 PST} {-873820800 -25200 1 PWT} {-769395600 -25200 1 PPT} {-761418000 -28800 0 PST} {-686073600 -25200 1 PDT} {-661539600 -28800 0 PST} {-620755200 -25200 1 PDT} {-608144400 -28800 0 PST} {-589384800 -25200 1 PDT} {-576082800 -28800 0 PST} {-557935200 -25200 1 PDT} {-544633200 -28800 0 PST} {-504892800 -28800 0 PST} {-495039600 -25200 1 PDT} {-481734000 -28800 0 PST} {-463590000 -25200 1 PDT} {-450284400 -28800 0 PST} {-431535600 -25200 1 PDT} {-418230000 -28800 0 PST} {-400086000 -25200 1 PDT} {-386780400 -28800 0 PST} {-368636400 -25200 1 PDT} {-355330800 -28800 0 PST} {-337186800 -25200 1 PDT} {-323881200 -28800 0 PST} {-305737200 -25200 1 PDT} {-292431600 -28800 0 PST} {-283968000 -28800 0 PST} {189331200 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {820483200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {978336000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1014192000 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1175421600 -25200 1 PDT} {1193562000 -28800 0 PST} {1207476000 -25200 1 PDT} {1225011600 -28800 0 PST} {1238925600 -25200 1 PDT} {1256461200 -28800 0 PST} {1262332800 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 1 PDT} {1446368400 -28800 0 PST} {1457863200 -25200 1 PDT} {1478422800 -28800 0 PST} {1489312800 -25200 1 PDT} {1509872400 -28800 0 PST} {1520762400 -25200 1 PDT} {1541322000 -28800 0 PST} {1552212000 -25200 1 PDT} {1572771600 -28800 0 PST} {1583661600 -25200 1 PDT} {1604221200 -28800 0 PST} {1615716000 -25200 1 PDT} {1636275600 -28800 0 PST} {1647165600 -25200 1 PDT} {1667725200 -28800 0 PST} {1678615200 -25200 1 PDT} {1699174800 -28800 0 PST} {1710064800 -25200 1 PDT} {1730624400 -28800 0 PST} {1741514400 -25200 1 PDT} {1762074000 -28800 0 PST} {1772964000 -25200 1 PDT} {1793523600 -28800 0 PST} {1805018400 -25200 1 PDT} {1825578000 -28800 0 PST} {1836468000 -25200 1 PDT} {1857027600 -28800 0 PST} {1867917600 -25200 1 PDT} {1888477200 -28800 0 PST} {1899367200 -25200 1 PDT} {1919926800 -28800 0 PST} {1930816800 -25200 1 PDT} {1951376400 -28800 0 PST} {1962871200 -25200 1 PDT} {1983430800 -28800 0 PST} {1994320800 -25200 1 PDT} {2014880400 -28800 0 PST} {2025770400 -25200 1 PDT} {2046330000 -28800 0 PST} {2057220000 -25200 1 PDT} {2077779600 -28800 0 PST} {2088669600 -25200 1 PDT} {2109229200 -28800 0 PST} {2120119200 -25200 1 PDT} {2140678800 -28800 0 PST} {2152173600 -25200 1 PDT} {2172733200 -28800 0 PST} {2183623200 -25200 1 PDT} {2204182800 -28800 0 PST} {2215072800 -25200 1 PDT} {2235632400 -28800 0 PST} {2246522400 -25200 1 PDT} {2267082000 -28800 0 PST} {2277972000 -25200 1 PDT} {2298531600 -28800 0 PST} {2309421600 -25200 1 PDT} {2329981200 -28800 0 PST} {2341476000 -25200 1 PDT} {2362035600 -28800 0 PST} {2372925600 -25200 1 PDT} {2393485200 -28800 0 PST} {2404375200 -25200 1 PDT} {2424934800 -28800 0 PST} {2435824800 -25200 1 PDT} {2456384400 -28800 0 PST} {2467274400 -25200 1 PDT} {2487834000 -28800 0 PST} {2499328800 -25200 1 PDT} {2519888400 -28800 0 PST} {2530778400 -25200 1 PDT} {2551338000 -28800 0 PST} {2562228000 -25200 1 PDT} {2582787600 -28800 0 PST} {2593677600 -25200 1 PDT} {2614237200 -28800 0 PST} {2625127200 -25200 1 PDT} {2645686800 -28800 0 PST} {2656576800 -25200 1 PDT} {2677136400 -28800 0 PST} {2688631200 -25200 1 PDT} {2709190800 -28800 0 PST} {2720080800 -25200 1 PDT} {2740640400 -28800 0 PST} {2751530400 -25200 1 PDT} {2772090000 -28800 0 PST} {2782980000 -25200 1 PDT} {2803539600 -28800 0 PST} {2814429600 -25200 1 PDT} {2834989200 -28800 0 PST} {2846484000 -25200 1 PDT} {2867043600 -28800 0 PST} {2877933600 -25200 1 PDT} {2898493200 -28800 0 PST} {2909383200 -25200 1 PDT} {2929942800 -28800 0 PST} {2940832800 -25200 1 PDT} {2961392400 -28800 0 PST} {2972282400 -25200 1 PDT} {2992842000 -28800 0 PST} {3003732000 -25200 1 PDT} {3024291600 -28800 0 PST} {3035786400 -25200 1 PDT} {3056346000 -28800 0 PST} {3067236000 -25200 1 PDT} {3087795600 -28800 0 PST} {3098685600 -25200 1 PDT} {3119245200 -28800 0 PST} {3130135200 -25200 1 PDT} {3150694800 -28800 0 PST} {3161584800 -25200 1 PDT} {3182144400 -28800 0 PST} {3193034400 -25200 1 PDT} {3213594000 -28800 0 PST} {3225088800 -25200 1 PDT} {3245648400 -28800 0 PST} {3256538400 -25200 1 PDT} {3277098000 -28800 0 PST} {3287988000 -25200 1 PDT} {3308547600 -28800 0 PST} {3319437600 -25200 1 PDT} {3339997200 -28800 0 PST} {3350887200 -25200 1 PDT} {3371446800 -28800 0 PST} {3382941600 -25200 1 PDT} {3403501200 -28800 0 PST} {3414391200 -25200 1 PDT} {3434950800 -28800 0 PST} {3445840800 -25200 1 PDT} {3466400400 -28800 0 PST} {3477290400 -25200 1 PDT} {3497850000 -28800 0 PST} {3508740000 -25200 1 PDT} {3529299600 -28800 0 PST} {3540189600 -25200 1 PDT} {3560749200 -28800 0 PST} {3572244000 -25200 1 PDT} {3592803600 -28800 0 PST} {3603693600 -25200 1 PDT} {3624253200 -28800 0 PST} {3635143200 -25200 1 PDT} {3655702800 -28800 0 PST} {3666592800 -25200 1 PDT} {3687152400 -28800 0 PST} {3698042400 -25200 1 PDT} {3718602000 -28800 0 PST} {3730096800 -25200 1 PDT} {3750656400 -28800 0 PST} {3761546400 -25200 1 PDT} {3782106000 -28800 0 PST} {3792996000 -25200 1 PDT} {3813555600 -28800 0 PST} {3824445600 -25200 1 PDT} {3845005200 -28800 0 PST} {3855895200 -25200 1 PDT} {3876454800 -28800 0 PST} {3887344800 -25200 1 PDT} {3907904400 -28800 0 PST} {3919399200 -25200 1 PDT} {3939958800 -28800 0 PST} {3950848800 -25200 1 PDT} {3971408400 -28800 0 PST} {3982298400 -25200 1 PDT} {4002858000 -28800 0 PST} {4013748000 -25200 1 PDT} {4034307600 -28800 0 PST} {4045197600 -25200 1 PDT} {4065757200 -28800 0 PST} {4076647200 -25200 1 PDT} {4097206800 -28800 0 PST} } tcl9.0.3/library/tzdata/America/Thunder_Bay0000664000175000017500000000027415035744305020204 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Toronto)]} { LoadTimeZoneFile America/Toronto } set TZData(:America/Thunder_Bay) $TZData(:America/Toronto) tcl9.0.3/library/tzdata/America/Thule0000664000175000017500000001501215035744305017055 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Thule) { {-9223372036854775808 -16508 0 LMT} {-1686079492 -14400 0 AST} {670399200 -10800 1 ADT} {686120400 -14400 0 AST} {701848800 -10800 1 ADT} {717570000 -14400 0 AST} {733903200 -10800 1 ADT} {752043600 -14400 0 AST} {765352800 -10800 1 ADT} {783493200 -14400 0 AST} {796802400 -10800 1 ADT} {814942800 -14400 0 AST} {828856800 -10800 1 ADT} {846392400 -14400 0 AST} {860306400 -10800 1 ADT} {877842000 -14400 0 AST} {891756000 -10800 1 ADT} {909291600 -14400 0 AST} {923205600 -10800 1 ADT} {941346000 -14400 0 AST} {954655200 -10800 1 ADT} {972795600 -14400 0 AST} {986104800 -10800 1 ADT} {1004245200 -14400 0 AST} {1018159200 -10800 1 ADT} {1035694800 -14400 0 AST} {1049608800 -10800 1 ADT} {1067144400 -14400 0 AST} {1081058400 -10800 1 ADT} {1099198800 -14400 0 AST} {1112508000 -10800 1 ADT} {1130648400 -14400 0 AST} {1143957600 -10800 1 ADT} {1162098000 -14400 0 AST} {1173592800 -10800 1 ADT} {1194152400 -14400 0 AST} {1205042400 -10800 1 ADT} {1225602000 -14400 0 AST} {1236492000 -10800 1 ADT} {1257051600 -14400 0 AST} {1268546400 -10800 1 ADT} {1289106000 -14400 0 AST} {1299996000 -10800 1 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Tegucigalpa0000664000175000017500000000051115035744305020217 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Tegucigalpa) { {-9223372036854775808 -20932 0 LMT} {-1538503868 -21600 0 CST} {547020000 -18000 1 CDT} {559717200 -21600 0 CST} {578469600 -18000 1 CDT} {591166800 -21600 0 CST} {1146981600 -18000 1 CDT} {1154926800 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Swift_Current0000664000175000017500000000151515035744305020575 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Swift_Current) { {-9223372036854775808 -25880 0 LMT} {-2030201320 -25200 0 MST} {-1632063600 -21600 1 MDT} {-1615132800 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} {-765388800 -25200 0 MST} {-747241200 -21600 0 MDT} {-732729600 -25200 0 MST} {-715791600 -21600 1 MDT} {-702489600 -25200 0 MST} {-684342000 -21600 1 MDT} {-671040000 -25200 0 MST} {-652892400 -21600 1 MDT} {-639590400 -25200 0 MST} {-631126800 -25200 0 MST} {-400086000 -21600 1 MDT} {-384364800 -25200 0 MST} {-337186800 -21600 1 MDT} {-321465600 -25200 0 MST} {-305737200 -21600 1 MDT} {-292435200 -25200 0 MST} {-273682800 -21600 1 MDT} {-260985600 -25200 0 MST} {73472400 -21600 0 CST} } tcl9.0.3/library/tzdata/America/St_Vincent0000664000175000017500000000030715035744305020051 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/St_Vincent) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/St_Thomas0000664000175000017500000000030615035744305017675 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/St_Thomas) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/St_Lucia0000664000175000017500000000030515035744305017476 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/St_Lucia) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/St_Kitts0000664000175000017500000000030515035744305017537 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/St_Kitts) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/St_Johns0000664000175000017500000002524515035744305017534 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/St_Johns) { {-9223372036854775808 -12652 0 LMT} {-2713897748 -12652 0 NST} {-1664130548 -9052 1 NDT} {-1650137348 -12652 0 NST} {-1640982548 -12652 0 NST} {-1632076148 -9052 1 NDT} {-1615145348 -12652 0 NST} {-1609446548 -12652 0 NST} {-1598650148 -9052 1 NDT} {-1590100148 -12652 0 NST} {-1567286948 -9052 1 NDT} {-1551565748 -12652 0 NST} {-1535837348 -9052 1 NDT} {-1520116148 -12652 0 NST} {-1503782948 -9052 1 NDT} {-1488666548 -12652 0 NST} {-1472333348 -9052 1 NDT} {-1457216948 -12652 0 NST} {-1440883748 -9052 1 NDT} {-1425767348 -12652 0 NST} {-1409434148 -9052 1 NDT} {-1394317748 -12652 0 NST} {-1377984548 -9052 1 NDT} {-1362263348 -12652 0 NST} {-1346534948 -9052 1 NDT} {-1330813748 -12652 0 NST} {-1314480548 -9052 1 NDT} {-1299364148 -12652 0 NST} {-1283030948 -9052 1 NDT} {-1267914548 -12652 0 NST} {-1251581348 -9052 1 NDT} {-1236464948 -12652 0 NST} {-1220131748 -9052 1 NDT} {-1205015348 -12652 0 NST} {-1188682148 -9052 1 NDT} {-1172960948 -12652 0 NST} {-1156627748 -9052 1 NDT} {-1141511348 -12652 0 NST} {-1125178148 -9052 1 NDT} {-1110061748 -12652 0 NST} {-1096921748 -12600 0 NST} {-1093728600 -9000 1 NDT} {-1078612200 -12600 0 NST} {-1061670600 -9000 1 NDT} {-1048973400 -12600 0 NST} {-1030221000 -9000 1 NDT} {-1017523800 -12600 0 NST} {-998771400 -9000 1 NDT} {-986074200 -12600 0 NST} {-966717000 -9000 1 NDT} {-954624600 -12600 0 NST} {-935267400 -9000 1 NDT} {-922570200 -12600 0 NST} {-903817800 -9000 1 NDT} {-891120600 -12600 0 NST} {-872368200 -9000 0 NWT} {-769395600 -9000 1 NPT} {-765401400 -12600 0 NST} {-757369800 -12600 0 NST} {-746044200 -9000 1 NDT} {-733347000 -12600 0 NST} {-714594600 -9000 1 NDT} {-701897400 -12600 0 NST} {-683145000 -9000 1 NDT} {-670447800 -12600 0 NST} {-651695400 -9000 1 NDT} {-638998200 -12600 0 NST} {-619641000 -9000 1 NDT} {-606943800 -12600 0 NST} {-589401000 -9000 1 NDT} {-576099000 -12600 0 NST} {-557951400 -9000 1 NDT} {-544649400 -12600 0 NST} {-526501800 -9000 1 NDT} {-513199800 -12600 0 NST} {-495052200 -9000 1 NDT} {-481750200 -12600 0 NST} {-463602600 -9000 1 NDT} {-450300600 -12600 0 NST} {-431548200 -9000 1 NDT} {-418246200 -12600 0 NST} {-400098600 -9000 1 NDT} {-386796600 -12600 0 NST} {-368649000 -9000 1 NDT} {-355347000 -12600 0 NST} {-337199400 -9000 1 NDT} {-323897400 -12600 0 NST} {-305749800 -9000 1 NDT} {-289423800 -12600 0 NST} {-273695400 -9000 1 NDT} {-257974200 -12600 0 NST} {-242245800 -9000 1 NDT} {-226524600 -12600 0 NST} {-210796200 -9000 1 NDT} {-195075000 -12600 0 NST} {-179346600 -9000 1 NDT} {-163625400 -12600 0 NST} {-147897000 -9000 1 NDT} {-131571000 -12600 0 NST} {-116447400 -9000 1 NDT} {-100121400 -12600 0 NST} {-84393000 -9000 1 NDT} {-68671800 -12600 0 NST} {-52943400 -9000 1 NDT} {-37222200 -12600 0 NST} {-21493800 -9000 1 NDT} {-5772600 -12600 0 NST} {9955800 -9000 1 NDT} {25677000 -12600 0 NST} {41405400 -9000 1 NDT} {57731400 -12600 0 NST} {73459800 -9000 1 NDT} {89181000 -12600 0 NST} {104909400 -9000 1 NDT} {120630600 -12600 0 NST} {136359000 -9000 1 NDT} {152080200 -12600 0 NST} {167808600 -9000 1 NDT} {183529800 -12600 0 NST} {199258200 -9000 1 NDT} {215584200 -12600 0 NST} {230707800 -9000 1 NDT} {247033800 -12600 0 NST} {262762200 -9000 1 NDT} {278483400 -12600 0 NST} {294211800 -9000 1 NDT} {309933000 -12600 0 NST} {325661400 -9000 1 NDT} {341382600 -12600 0 NST} {357111000 -9000 1 NDT} {372832200 -12600 0 NST} {388560600 -9000 1 NDT} {404886600 -12600 0 NST} {420010200 -9000 1 NDT} {436336200 -12600 0 NST} {452064600 -9000 1 NDT} {467785800 -12600 0 NST} {483514200 -9000 1 NDT} {499235400 -12600 0 NST} {514963800 -9000 1 NDT} {530685000 -12600 0 NST} {544591860 -9000 1 NDT} {562127460 -12600 0 NST} {576041460 -5400 1 NDDT} {594178260 -12600 0 NST} {607491060 -9000 1 NDT} {625631460 -12600 0 NST} {638940660 -9000 1 NDT} {657081060 -12600 0 NST} {670995060 -9000 1 NDT} {688530660 -12600 0 NST} {702444660 -9000 1 NDT} {719980260 -12600 0 NST} {733894260 -9000 1 NDT} {752034660 -12600 0 NST} {765343860 -9000 1 NDT} {783484260 -12600 0 NST} {796793460 -9000 1 NDT} {814933860 -12600 0 NST} {828847860 -9000 1 NDT} {846383460 -12600 0 NST} {860297460 -9000 1 NDT} {877833060 -12600 0 NST} {891747060 -9000 1 NDT} {909282660 -12600 0 NST} {923196660 -9000 1 NDT} {941337060 -12600 0 NST} {954646260 -9000 1 NDT} {972786660 -12600 0 NST} {986095860 -9000 1 NDT} {1004236260 -12600 0 NST} {1018150260 -9000 1 NDT} {1035685860 -12600 0 NST} {1049599860 -9000 1 NDT} {1067135460 -12600 0 NST} {1081049460 -9000 1 NDT} {1099189860 -12600 0 NST} {1112499060 -9000 1 NDT} {1130639460 -12600 0 NST} {1143948660 -9000 1 NDT} {1162089060 -12600 0 NST} {1173583860 -9000 1 NDT} {1194143460 -12600 0 NST} {1205033460 -9000 1 NDT} {1225593060 -12600 0 NST} {1236483060 -9000 1 NDT} {1257042660 -12600 0 NST} {1268537460 -9000 1 NDT} {1289097060 -12600 0 NST} {1299987060 -9000 1 NDT} {1320114600 -9000 0 NDT} {1320553800 -12600 0 NST} {1331443800 -9000 1 NDT} {1352003400 -12600 0 NST} {1362893400 -9000 1 NDT} {1383453000 -12600 0 NST} {1394343000 -9000 1 NDT} {1414902600 -12600 0 NST} {1425792600 -9000 1 NDT} {1446352200 -12600 0 NST} {1457847000 -9000 1 NDT} {1478406600 -12600 0 NST} {1489296600 -9000 1 NDT} {1509856200 -12600 0 NST} {1520746200 -9000 1 NDT} {1541305800 -12600 0 NST} {1552195800 -9000 1 NDT} {1572755400 -12600 0 NST} {1583645400 -9000 1 NDT} {1604205000 -12600 0 NST} {1615699800 -9000 1 NDT} {1636259400 -12600 0 NST} {1647149400 -9000 1 NDT} {1667709000 -12600 0 NST} {1678599000 -9000 1 NDT} {1699158600 -12600 0 NST} {1710048600 -9000 1 NDT} {1730608200 -12600 0 NST} {1741498200 -9000 1 NDT} {1762057800 -12600 0 NST} {1772947800 -9000 1 NDT} {1793507400 -12600 0 NST} {1805002200 -9000 1 NDT} {1825561800 -12600 0 NST} {1836451800 -9000 1 NDT} {1857011400 -12600 0 NST} {1867901400 -9000 1 NDT} {1888461000 -12600 0 NST} {1899351000 -9000 1 NDT} {1919910600 -12600 0 NST} {1930800600 -9000 1 NDT} {1951360200 -12600 0 NST} {1962855000 -9000 1 NDT} {1983414600 -12600 0 NST} {1994304600 -9000 1 NDT} {2014864200 -12600 0 NST} {2025754200 -9000 1 NDT} {2046313800 -12600 0 NST} {2057203800 -9000 1 NDT} {2077763400 -12600 0 NST} {2088653400 -9000 1 NDT} {2109213000 -12600 0 NST} {2120103000 -9000 1 NDT} {2140662600 -12600 0 NST} {2152157400 -9000 1 NDT} {2172717000 -12600 0 NST} {2183607000 -9000 1 NDT} {2204166600 -12600 0 NST} {2215056600 -9000 1 NDT} {2235616200 -12600 0 NST} {2246506200 -9000 1 NDT} {2267065800 -12600 0 NST} {2277955800 -9000 1 NDT} {2298515400 -12600 0 NST} {2309405400 -9000 1 NDT} {2329965000 -12600 0 NST} {2341459800 -9000 1 NDT} {2362019400 -12600 0 NST} {2372909400 -9000 1 NDT} {2393469000 -12600 0 NST} {2404359000 -9000 1 NDT} {2424918600 -12600 0 NST} {2435808600 -9000 1 NDT} {2456368200 -12600 0 NST} {2467258200 -9000 1 NDT} {2487817800 -12600 0 NST} {2499312600 -9000 1 NDT} {2519872200 -12600 0 NST} {2530762200 -9000 1 NDT} {2551321800 -12600 0 NST} {2562211800 -9000 1 NDT} {2582771400 -12600 0 NST} {2593661400 -9000 1 NDT} {2614221000 -12600 0 NST} {2625111000 -9000 1 NDT} {2645670600 -12600 0 NST} {2656560600 -9000 1 NDT} {2677120200 -12600 0 NST} {2688615000 -9000 1 NDT} {2709174600 -12600 0 NST} {2720064600 -9000 1 NDT} {2740624200 -12600 0 NST} {2751514200 -9000 1 NDT} {2772073800 -12600 0 NST} {2782963800 -9000 1 NDT} {2803523400 -12600 0 NST} {2814413400 -9000 1 NDT} {2834973000 -12600 0 NST} {2846467800 -9000 1 NDT} {2867027400 -12600 0 NST} {2877917400 -9000 1 NDT} {2898477000 -12600 0 NST} {2909367000 -9000 1 NDT} {2929926600 -12600 0 NST} {2940816600 -9000 1 NDT} {2961376200 -12600 0 NST} {2972266200 -9000 1 NDT} {2992825800 -12600 0 NST} {3003715800 -9000 1 NDT} {3024275400 -12600 0 NST} {3035770200 -9000 1 NDT} {3056329800 -12600 0 NST} {3067219800 -9000 1 NDT} {3087779400 -12600 0 NST} {3098669400 -9000 1 NDT} {3119229000 -12600 0 NST} {3130119000 -9000 1 NDT} {3150678600 -12600 0 NST} {3161568600 -9000 1 NDT} {3182128200 -12600 0 NST} {3193018200 -9000 1 NDT} {3213577800 -12600 0 NST} {3225072600 -9000 1 NDT} {3245632200 -12600 0 NST} {3256522200 -9000 1 NDT} {3277081800 -12600 0 NST} {3287971800 -9000 1 NDT} {3308531400 -12600 0 NST} {3319421400 -9000 1 NDT} {3339981000 -12600 0 NST} {3350871000 -9000 1 NDT} {3371430600 -12600 0 NST} {3382925400 -9000 1 NDT} {3403485000 -12600 0 NST} {3414375000 -9000 1 NDT} {3434934600 -12600 0 NST} {3445824600 -9000 1 NDT} {3466384200 -12600 0 NST} {3477274200 -9000 1 NDT} {3497833800 -12600 0 NST} {3508723800 -9000 1 NDT} {3529283400 -12600 0 NST} {3540173400 -9000 1 NDT} {3560733000 -12600 0 NST} {3572227800 -9000 1 NDT} {3592787400 -12600 0 NST} {3603677400 -9000 1 NDT} {3624237000 -12600 0 NST} {3635127000 -9000 1 NDT} {3655686600 -12600 0 NST} {3666576600 -9000 1 NDT} {3687136200 -12600 0 NST} {3698026200 -9000 1 NDT} {3718585800 -12600 0 NST} {3730080600 -9000 1 NDT} {3750640200 -12600 0 NST} {3761530200 -9000 1 NDT} {3782089800 -12600 0 NST} {3792979800 -9000 1 NDT} {3813539400 -12600 0 NST} {3824429400 -9000 1 NDT} {3844989000 -12600 0 NST} {3855879000 -9000 1 NDT} {3876438600 -12600 0 NST} {3887328600 -9000 1 NDT} {3907888200 -12600 0 NST} {3919383000 -9000 1 NDT} {3939942600 -12600 0 NST} {3950832600 -9000 1 NDT} {3971392200 -12600 0 NST} {3982282200 -9000 1 NDT} {4002841800 -12600 0 NST} {4013731800 -9000 1 NDT} {4034291400 -12600 0 NST} {4045181400 -9000 1 NDT} {4065741000 -12600 0 NST} {4076631000 -9000 1 NDT} {4097190600 -12600 0 NST} } tcl9.0.3/library/tzdata/America/St_Barthelemy0000664000175000017500000000031215035744305020533 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/St_Barthelemy) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Sitka0000664000175000017500000002027015035744305017051 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Sitka) { {-9223372036854775808 53927 0 LMT} {-3225223727 -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} } tcl9.0.3/library/tzdata/America/Shiprock0000664000175000017500000000026615035744305017563 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Denver)]} { LoadTimeZoneFile America/Denver } set TZData(:America/Shiprock) $TZData(:America/Denver) tcl9.0.3/library/tzdata/America/Scoresbysund0000664000175000017500000001632315035744305020465 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Scoresbysund) { {-9223372036854775808 -5272 0 LMT} {-1686090728 -7200 0 -0200} {323841600 -3600 0 -0100} {338961600 -7200 0 -0200} {354679200 0 0 +0000} {370400400 -3600 0 -0100} {386125200 0 1 +0000} {401850000 -3600 0 -0100} {417574800 0 1 +0000} {433299600 -3600 0 -0100} {449024400 0 1 +0000} {465354000 -3600 0 -0100} {481078800 0 1 +0000} {496803600 -3600 0 -0100} {512528400 0 1 +0000} {528253200 -3600 0 -0100} {543978000 0 1 +0000} {559702800 -3600 0 -0100} {575427600 0 1 +0000} {591152400 -3600 0 -0100} {606877200 0 1 +0000} {622602000 -3600 0 -0100} {638326800 0 1 +0000} {654656400 -3600 0 -0100} {670381200 0 1 +0000} {686106000 -3600 0 -0100} {701830800 0 1 +0000} {717555600 -3600 0 -0100} {733280400 0 1 +0000} {749005200 -3600 0 -0100} {764730000 0 1 +0000} {780454800 -3600 0 -0100} {796179600 0 1 +0000} {811904400 -3600 0 -0100} {828234000 0 1 +0000} {846378000 -3600 0 -0100} {859683600 0 1 +0000} {877827600 -3600 0 -0100} {891133200 0 1 +0000} {909277200 -3600 0 -0100} {922582800 0 1 +0000} {941331600 -3600 0 -0100} {954032400 0 1 +0000} {972781200 -3600 0 -0100} {985482000 0 1 +0000} {1004230800 -3600 0 -0100} {1017536400 0 1 +0000} {1035680400 -3600 0 -0100} {1048986000 0 1 +0000} {1067130000 -3600 0 -0100} {1080435600 0 1 +0000} {1099184400 -3600 0 -0100} {1111885200 0 1 +0000} {1130634000 -3600 0 -0100} {1143334800 0 1 +0000} {1162083600 -3600 0 -0100} {1174784400 0 1 +0000} {1193533200 -3600 0 -0100} {1206838800 0 1 +0000} {1224982800 -3600 0 -0100} {1238288400 0 1 +0000} {1256432400 -3600 0 -0100} {1269738000 0 1 +0000} {1288486800 -3600 0 -0100} {1301187600 0 1 +0000} {1319936400 -3600 0 -0100} {1332637200 0 1 +0000} {1351386000 -3600 0 -0100} {1364691600 0 1 +0000} {1382835600 -3600 0 -0100} {1396141200 0 1 +0000} {1414285200 -3600 0 -0100} {1427590800 0 1 +0000} {1445734800 -3600 0 -0100} {1459040400 0 1 +0000} {1477789200 -3600 0 -0100} {1490490000 0 1 +0000} {1509238800 -3600 0 -0100} {1521939600 0 1 +0000} {1540688400 -3600 0 -0100} {1553994000 0 1 +0000} {1572138000 -3600 0 -0100} {1585443600 0 1 +0000} {1603587600 -3600 0 -0100} {1616893200 0 1 +0000} {1635642000 -3600 0 -0100} {1648342800 0 1 +0000} {1667091600 -3600 0 -0100} {1679792400 0 1 +0000} {1698541200 -3600 0 -0100} {1711846800 -3600 0 -0100} {1729990800 -7200 0 -0200} {1743296400 -3600 1 -0100} {1761440400 -7200 0 -0200} {1774746000 -3600 1 -0100} {1792890000 -7200 0 -0200} {1806195600 -3600 1 -0100} {1824944400 -7200 0 -0200} {1837645200 -3600 1 -0100} {1856394000 -7200 0 -0200} {1869094800 -3600 1 -0100} {1887843600 -7200 0 -0200} {1901149200 -3600 1 -0100} {1919293200 -7200 0 -0200} {1932598800 -3600 1 -0100} {1950742800 -7200 0 -0200} {1964048400 -3600 1 -0100} {1982797200 -7200 0 -0200} {1995498000 -3600 1 -0100} {2014246800 -7200 0 -0200} {2026947600 -3600 1 -0100} {2045696400 -7200 0 -0200} {2058397200 -3600 1 -0100} {2077146000 -7200 0 -0200} {2090451600 -3600 1 -0100} {2108595600 -7200 0 -0200} {2121901200 -3600 1 -0100} {2140045200 -7200 0 -0200} {2153350800 -3600 1 -0100} {2172099600 -7200 0 -0200} {2184800400 -3600 1 -0100} {2203549200 -7200 0 -0200} {2216250000 -3600 1 -0100} {2234998800 -7200 0 -0200} {2248304400 -3600 1 -0100} {2266448400 -7200 0 -0200} {2279754000 -3600 1 -0100} {2297898000 -7200 0 -0200} {2311203600 -3600 1 -0100} {2329347600 -7200 0 -0200} {2342653200 -3600 1 -0100} {2361402000 -7200 0 -0200} {2374102800 -3600 1 -0100} {2392851600 -7200 0 -0200} {2405552400 -3600 1 -0100} {2424301200 -7200 0 -0200} {2437606800 -3600 1 -0100} {2455750800 -7200 0 -0200} {2469056400 -3600 1 -0100} {2487200400 -7200 0 -0200} {2500506000 -3600 1 -0100} {2519254800 -7200 0 -0200} {2531955600 -3600 1 -0100} {2550704400 -7200 0 -0200} {2563405200 -3600 1 -0100} {2582154000 -7200 0 -0200} {2595459600 -3600 1 -0100} {2613603600 -7200 0 -0200} {2626909200 -3600 1 -0100} {2645053200 -7200 0 -0200} {2658358800 -3600 1 -0100} {2676502800 -7200 0 -0200} {2689808400 -3600 1 -0100} {2708557200 -7200 0 -0200} {2721258000 -3600 1 -0100} {2740006800 -7200 0 -0200} {2752707600 -3600 1 -0100} {2771456400 -7200 0 -0200} {2784762000 -3600 1 -0100} {2802906000 -7200 0 -0200} {2816211600 -3600 1 -0100} {2834355600 -7200 0 -0200} {2847661200 -3600 1 -0100} {2866410000 -7200 0 -0200} {2879110800 -3600 1 -0100} {2897859600 -7200 0 -0200} {2910560400 -3600 1 -0100} {2929309200 -7200 0 -0200} {2942010000 -3600 1 -0100} {2960758800 -7200 0 -0200} {2974064400 -3600 1 -0100} {2992208400 -7200 0 -0200} {3005514000 -3600 1 -0100} {3023658000 -7200 0 -0200} {3036963600 -3600 1 -0100} {3055712400 -7200 0 -0200} {3068413200 -3600 1 -0100} {3087162000 -7200 0 -0200} {3099862800 -3600 1 -0100} {3118611600 -7200 0 -0200} {3131917200 -3600 1 -0100} {3150061200 -7200 0 -0200} {3163366800 -3600 1 -0100} {3181510800 -7200 0 -0200} {3194816400 -3600 1 -0100} {3212960400 -7200 0 -0200} {3226266000 -3600 1 -0100} {3245014800 -7200 0 -0200} {3257715600 -3600 1 -0100} {3276464400 -7200 0 -0200} {3289165200 -3600 1 -0100} {3307914000 -7200 0 -0200} {3321219600 -3600 1 -0100} {3339363600 -7200 0 -0200} {3352669200 -3600 1 -0100} {3370813200 -7200 0 -0200} {3384118800 -3600 1 -0100} {3402867600 -7200 0 -0200} {3415568400 -3600 1 -0100} {3434317200 -7200 0 -0200} {3447018000 -3600 1 -0100} {3465766800 -7200 0 -0200} {3479072400 -3600 1 -0100} {3497216400 -7200 0 -0200} {3510522000 -3600 1 -0100} {3528666000 -7200 0 -0200} {3541971600 -3600 1 -0100} {3560115600 -7200 0 -0200} {3573421200 -3600 1 -0100} {3592170000 -7200 0 -0200} {3604870800 -3600 1 -0100} {3623619600 -7200 0 -0200} {3636320400 -3600 1 -0100} {3655069200 -7200 0 -0200} {3668374800 -3600 1 -0100} {3686518800 -7200 0 -0200} {3699824400 -3600 1 -0100} {3717968400 -7200 0 -0200} {3731274000 -3600 1 -0100} {3750022800 -7200 0 -0200} {3762723600 -3600 1 -0100} {3781472400 -7200 0 -0200} {3794173200 -3600 1 -0100} {3812922000 -7200 0 -0200} {3825622800 -3600 1 -0100} {3844371600 -7200 0 -0200} {3857677200 -3600 1 -0100} {3875821200 -7200 0 -0200} {3889126800 -3600 1 -0100} {3907270800 -7200 0 -0200} {3920576400 -3600 1 -0100} {3939325200 -7200 0 -0200} {3952026000 -3600 1 -0100} {3970774800 -7200 0 -0200} {3983475600 -3600 1 -0100} {4002224400 -7200 0 -0200} {4015530000 -3600 1 -0100} {4033674000 -7200 0 -0200} {4046979600 -3600 1 -0100} {4065123600 -7200 0 -0200} {4078429200 -3600 1 -0100} {4096573200 -7200 0 -0200} } tcl9.0.3/library/tzdata/America/Sao_Paulo0000664000175000017500000000565315035744305017670 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Sao_Paulo) { {-9223372036854775808 -11188 0 LMT} {-1767214412 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-195429600 -7200 1 -0200} {-189381600 -7200 0 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {656478000 -7200 1 -0200} {666756000 -10800 0 -0300} {687927600 -7200 1 -0200} {697600800 -10800 0 -0300} {719982000 -7200 1 -0200} {728445600 -10800 0 -0300} {750826800 -7200 1 -0200} {761709600 -10800 0 -0300} {782276400 -7200 1 -0200} {793159200 -10800 0 -0300} {813726000 -7200 1 -0200} {824004000 -10800 0 -0300} {844570800 -7200 1 -0200} {856058400 -10800 0 -0300} {876106800 -7200 1 -0200} {888717600 -10800 0 -0300} {908074800 -7200 1 -0200} {919562400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {982461600 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1036292400 -7200 1 -0200} {1045360800 -10800 0 -0300} {1066532400 -7200 1 -0200} {1076810400 -10800 0 -0300} {1099364400 -7200 1 -0200} {1108864800 -10800 0 -0300} {1129431600 -7200 1 -0200} {1140314400 -10800 0 -0300} {1162695600 -7200 1 -0200} {1172368800 -10800 0 -0300} {1192330800 -7200 1 -0200} {1203213600 -10800 0 -0300} {1224385200 -7200 1 -0200} {1234663200 -10800 0 -0300} {1255834800 -7200 1 -0200} {1266717600 -10800 0 -0300} {1287284400 -7200 1 -0200} {1298167200 -10800 0 -0300} {1318734000 -7200 1 -0200} {1330221600 -10800 0 -0300} {1350788400 -7200 1 -0200} {1361066400 -10800 0 -0300} {1382238000 -7200 1 -0200} {1392516000 -10800 0 -0300} {1413687600 -7200 1 -0200} {1424570400 -10800 0 -0300} {1445137200 -7200 1 -0200} {1456020000 -10800 0 -0300} {1476586800 -7200 1 -0200} {1487469600 -10800 0 -0300} {1508036400 -7200 1 -0200} {1518919200 -10800 0 -0300} {1541300400 -7200 1 -0200} {1550368800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Santo_Domingo0000664000175000017500000000112315035744305020532 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Santo_Domingo) { {-9223372036854775808 -16776 0 LMT} {-2524504824 -16800 0 SDMT} {-1159773600 -18000 0 EST} {-100119600 -14400 1 EDT} {-89668800 -18000 0 EST} {-5770800 -16200 1 -0430} {4422600 -18000 0 EST} {25678800 -16200 1 -0430} {33193800 -18000 0 EST} {57733200 -16200 1 -0430} {64816200 -18000 0 EST} {89182800 -16200 1 -0430} {96438600 -18000 0 EST} {120632400 -16200 1 -0430} {127974600 -18000 0 EST} {152082000 -14400 0 AST} {975823200 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Santiago0000664000175000017500000002167015035744305017550 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Santiago) { {-9223372036854775808 -16965 0 LMT} {-2524504635 -16965 0 SMT} {-1892661435 -18000 0 -0500} {-1688410800 -16965 0 SMT} {-1619205435 -14400 0 -0400} {-1593806400 -16965 0 SMT} {-1335986235 -18000 0 -0500} {-1335985200 -14400 1 -0400} {-1317585600 -18000 0 -0500} {-1304362800 -14400 1 -0400} {-1286049600 -18000 0 -0500} {-1272826800 -14400 1 -0400} {-1254513600 -18000 0 -0500} {-1241290800 -14400 1 -0400} {-1222977600 -18000 0 -0500} {-1209754800 -14400 1 -0400} {-1191355200 -18000 0 -0500} {-1178132400 -14400 0 -0400} {-870552000 -18000 0 -0500} {-865278000 -14400 0 -0400} {-740520000 -10800 1 -0300} {-736635600 -14400 1 -0400} {-718056000 -18000 0 -0500} {-713649600 -14400 0 -0400} {-36619200 -10800 1 -0300} {-23922000 -14400 0 -0400} {-3355200 -10800 1 -0300} {7527600 -14400 0 -0400} {24465600 -10800 1 -0300} {37767600 -14400 0 -0400} {55915200 -10800 1 -0300} {69217200 -14400 0 -0400} {87969600 -10800 1 -0300} {100666800 -14400 0 -0400} {118209600 -10800 1 -0300} {132116400 -14400 0 -0400} {150868800 -10800 1 -0300} {163566000 -14400 0 -0400} {182318400 -10800 1 -0300} {195620400 -14400 0 -0400} {213768000 -10800 1 -0300} {227070000 -14400 0 -0400} {245217600 -10800 1 -0300} {258519600 -14400 0 -0400} {277272000 -10800 1 -0300} {289969200 -14400 0 -0400} {308721600 -10800 1 -0300} {321418800 -14400 0 -0400} {340171200 -10800 1 -0300} {353473200 -14400 0 -0400} {371620800 -10800 1 -0300} {384922800 -14400 0 -0400} {403070400 -10800 1 -0300} {416372400 -14400 0 -0400} {434520000 -10800 1 -0300} {447822000 -14400 0 -0400} {466574400 -10800 1 -0300} {479271600 -14400 0 -0400} {498024000 -10800 1 -0300} {510721200 -14400 0 -0400} {529473600 -10800 1 -0300} {545194800 -14400 0 -0400} {560923200 -10800 1 -0300} {574225200 -14400 0 -0400} {592372800 -10800 1 -0300} {605674800 -14400 0 -0400} {624427200 -10800 1 -0300} {637124400 -14400 0 -0400} {653457600 -10800 1 -0300} {668574000 -14400 0 -0400} {687326400 -10800 1 -0300} {700628400 -14400 0 -0400} {718776000 -10800 1 -0300} {732078000 -14400 0 -0400} {750225600 -10800 1 -0300} {763527600 -14400 0 -0400} {781675200 -10800 1 -0300} {794977200 -14400 0 -0400} {813729600 -10800 1 -0300} {826426800 -14400 0 -0400} {845179200 -10800 1 -0300} {859690800 -14400 0 -0400} {876628800 -10800 1 -0300} {889930800 -14400 0 -0400} {906868800 -10800 1 -0300} {923194800 -14400 0 -0400} {939528000 -10800 1 -0300} {952830000 -14400 0 -0400} {971582400 -10800 1 -0300} {984279600 -14400 0 -0400} {1003032000 -10800 1 -0300} {1015729200 -14400 0 -0400} {1034481600 -10800 1 -0300} {1047178800 -14400 0 -0400} {1065931200 -10800 1 -0300} {1079233200 -14400 0 -0400} {1097380800 -10800 1 -0300} {1110682800 -14400 0 -0400} {1128830400 -10800 1 -0300} {1142132400 -14400 0 -0400} {1160884800 -10800 1 -0300} {1173582000 -14400 0 -0400} {1192334400 -10800 1 -0300} {1206846000 -14400 0 -0400} {1223784000 -10800 1 -0300} {1237086000 -14400 0 -0400} {1255233600 -10800 1 -0300} {1270350000 -14400 0 -0400} {1286683200 -10800 1 -0300} {1304823600 -14400 0 -0400} {1313899200 -10800 1 -0300} {1335668400 -14400 0 -0400} {1346558400 -10800 1 -0300} {1367118000 -14400 0 -0400} {1378612800 -10800 1 -0300} {1398567600 -14400 0 -0400} {1410062400 -10800 1 -0300} {1463281200 -14400 0 -0400} {1471147200 -10800 1 -0300} {1494730800 -14400 0 -0400} {1502596800 -10800 1 -0300} {1526180400 -14400 0 -0400} {1534046400 -10800 1 -0300} {1554606000 -14400 0 -0400} {1567915200 -10800 1 -0300} {1586055600 -14400 0 -0400} {1599364800 -10800 1 -0300} {1617505200 -14400 0 -0400} {1630814400 -10800 1 -0300} {1648954800 -14400 0 -0400} {1662868800 -10800 1 -0300} {1680404400 -14400 0 -0400} {1693713600 -10800 1 -0300} {1712458800 -14400 0 -0400} {1725768000 -10800 1 -0300} {1743908400 -14400 0 -0400} {1757217600 -10800 1 -0300} {1775358000 -14400 0 -0400} {1788667200 -10800 1 -0300} {1806807600 -14400 0 -0400} {1820116800 -10800 1 -0300} {1838257200 -14400 0 -0400} {1851566400 -10800 1 -0300} {1870311600 -14400 0 -0400} {1883016000 -10800 1 -0300} {1901761200 -14400 0 -0400} {1915070400 -10800 1 -0300} {1933210800 -14400 0 -0400} {1946520000 -10800 1 -0300} {1964660400 -14400 0 -0400} {1977969600 -10800 1 -0300} {1996110000 -14400 0 -0400} {2009419200 -10800 1 -0300} {2027559600 -14400 0 -0400} {2040868800 -10800 1 -0300} {2059614000 -14400 0 -0400} {2072318400 -10800 1 -0300} {2091063600 -14400 0 -0400} {2104372800 -10800 1 -0300} {2122513200 -14400 0 -0400} {2135822400 -10800 1 -0300} {2153962800 -14400 0 -0400} {2167272000 -10800 1 -0300} {2185412400 -14400 0 -0400} {2198721600 -10800 1 -0300} {2217466800 -14400 0 -0400} {2230171200 -10800 1 -0300} {2248916400 -14400 0 -0400} {2262225600 -10800 1 -0300} {2280366000 -14400 0 -0400} {2293675200 -10800 1 -0300} {2311815600 -14400 0 -0400} {2325124800 -10800 1 -0300} {2343265200 -14400 0 -0400} {2356574400 -10800 1 -0300} {2374714800 -14400 0 -0400} {2388024000 -10800 1 -0300} {2406769200 -14400 0 -0400} {2419473600 -10800 1 -0300} {2438218800 -14400 0 -0400} {2451528000 -10800 1 -0300} {2469668400 -14400 0 -0400} {2482977600 -10800 1 -0300} {2501118000 -14400 0 -0400} {2514427200 -10800 1 -0300} {2532567600 -14400 0 -0400} {2545876800 -10800 1 -0300} {2564017200 -14400 0 -0400} {2577326400 -10800 1 -0300} {2596071600 -14400 0 -0400} {2609380800 -10800 1 -0300} {2627521200 -14400 0 -0400} {2640830400 -10800 1 -0300} {2658970800 -14400 0 -0400} {2672280000 -10800 1 -0300} {2690420400 -14400 0 -0400} {2703729600 -10800 1 -0300} {2721870000 -14400 0 -0400} {2735179200 -10800 1 -0300} {2753924400 -14400 0 -0400} {2766628800 -10800 1 -0300} {2785374000 -14400 0 -0400} {2798683200 -10800 1 -0300} {2816823600 -14400 0 -0400} {2830132800 -10800 1 -0300} {2848273200 -14400 0 -0400} {2861582400 -10800 1 -0300} {2879722800 -14400 0 -0400} {2893032000 -10800 1 -0300} {2911172400 -14400 0 -0400} {2924481600 -10800 1 -0300} {2943226800 -14400 0 -0400} {2955931200 -10800 1 -0300} {2974676400 -14400 0 -0400} {2987985600 -10800 1 -0300} {3006126000 -14400 0 -0400} {3019435200 -10800 1 -0300} {3037575600 -14400 0 -0400} {3050884800 -10800 1 -0300} {3069025200 -14400 0 -0400} {3082334400 -10800 1 -0300} {3101079600 -14400 0 -0400} {3113784000 -10800 1 -0300} {3132529200 -14400 0 -0400} {3145838400 -10800 1 -0300} {3163978800 -14400 0 -0400} {3177288000 -10800 1 -0300} {3195428400 -14400 0 -0400} {3208737600 -10800 1 -0300} {3226878000 -14400 0 -0400} {3240187200 -10800 1 -0300} {3258327600 -14400 0 -0400} {3271636800 -10800 1 -0300} {3290382000 -14400 0 -0400} {3303086400 -10800 1 -0300} {3321831600 -14400 0 -0400} {3335140800 -10800 1 -0300} {3353281200 -14400 0 -0400} {3366590400 -10800 1 -0300} {3384730800 -14400 0 -0400} {3398040000 -10800 1 -0300} {3416180400 -14400 0 -0400} {3429489600 -10800 1 -0300} {3447630000 -14400 0 -0400} {3460939200 -10800 1 -0300} {3479684400 -14400 0 -0400} {3492993600 -10800 1 -0300} {3511134000 -14400 0 -0400} {3524443200 -10800 1 -0300} {3542583600 -14400 0 -0400} {3555892800 -10800 1 -0300} {3574033200 -14400 0 -0400} {3587342400 -10800 1 -0300} {3605482800 -14400 0 -0400} {3618792000 -10800 1 -0300} {3637537200 -14400 0 -0400} {3650241600 -10800 1 -0300} {3668986800 -14400 0 -0400} {3682296000 -10800 1 -0300} {3700436400 -14400 0 -0400} {3713745600 -10800 1 -0300} {3731886000 -14400 0 -0400} {3745195200 -10800 1 -0300} {3763335600 -14400 0 -0400} {3776644800 -10800 1 -0300} {3794785200 -14400 0 -0400} {3808094400 -10800 1 -0300} {3826839600 -14400 0 -0400} {3839544000 -10800 1 -0300} {3858289200 -14400 0 -0400} {3871598400 -10800 1 -0300} {3889738800 -14400 0 -0400} {3903048000 -10800 1 -0300} {3921188400 -14400 0 -0400} {3934497600 -10800 1 -0300} {3952638000 -14400 0 -0400} {3965947200 -10800 1 -0300} {3984692400 -14400 0 -0400} {3997396800 -10800 1 -0300} {4016142000 -14400 0 -0400} {4029451200 -10800 1 -0300} {4047591600 -14400 0 -0400} {4060900800 -10800 1 -0300} {4079041200 -14400 0 -0400} {4092350400 -10800 1 -0300} } tcl9.0.3/library/tzdata/America/Santa_Isabel0000664000175000017500000000027515035744305020326 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Tijuana)]} { LoadTimeZoneFile America/Tijuana } set TZData(:America/Santa_Isabel) $TZData(:America/Tijuana) tcl9.0.3/library/tzdata/America/Santarem0000664000175000017500000000212115035744305017543 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Santarem) { {-9223372036854775808 -13128 0 LMT} {-1767212472 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {590036400 -14400 0 -0400} {1214280000 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Rosario0000664000175000017500000000032615035744305017414 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Cordoba)]} { LoadTimeZoneFile America/Argentina/Cordoba } set TZData(:America/Rosario) $TZData(:America/Argentina/Cordoba) tcl9.0.3/library/tzdata/America/Rio_Branco0000664000175000017500000000216315035744305020014 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Rio_Branco) { {-9223372036854775808 -16272 0 LMT} {-1767209328 -18000 0 -0500} {-1206950400 -14400 1 -0400} {-1191355200 -18000 0 -0500} {-1175367600 -14400 1 -0400} {-1159819200 -18000 0 -0500} {-633812400 -14400 1 -0400} {-622062000 -18000 0 -0500} {-602276400 -14400 1 -0400} {-591825600 -18000 0 -0500} {-570740400 -14400 1 -0400} {-560203200 -18000 0 -0500} {-539118000 -14400 1 -0400} {-531345600 -18000 0 -0500} {-191358000 -14400 1 -0400} {-184190400 -18000 0 -0500} {-155156400 -14400 1 -0400} {-150062400 -18000 0 -0500} {-128890800 -14400 1 -0400} {-121118400 -18000 0 -0500} {-99946800 -14400 1 -0400} {-89582400 -18000 0 -0500} {-68410800 -14400 1 -0400} {-57960000 -18000 0 -0500} {499755600 -14400 1 -0400} {511243200 -18000 0 -0500} {530600400 -14400 1 -0400} {540273600 -18000 0 -0500} {562136400 -14400 1 -0400} {571204800 -18000 0 -0500} {590040000 -18000 0 -0500} {1214283600 -14400 0 -0400} {1384056000 -18000 0 -0500} } tcl9.0.3/library/tzdata/America/Resolute0000664000175000017500000001712315035744305017603 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Resolute) { {-9223372036854775808 0 0 -00} {-704937600 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {136368000 -18000 1 CDT} {152089200 -21600 0 CST} {167817600 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688546800 -21600 0 CST} {702460800 -18000 1 CDT} {719996400 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -18000 0 EST} {986112000 -18000 0 CDT} {1004252400 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162108800 -18000 0 EST} {1173600000 -18000 0 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Regina0000664000175000017500000000327315035744305017207 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Regina) { {-9223372036854775808 -25116 0 LMT} {-2030202084 -25200 0 MST} {-1632063600 -21600 1 MDT} {-1615132800 -25200 0 MST} {-1251651600 -21600 1 MDT} {-1238349600 -25200 0 MST} {-1220202000 -21600 1 MDT} {-1206900000 -25200 0 MST} {-1188752400 -21600 1 MDT} {-1175450400 -25200 0 MST} {-1156698000 -21600 1 MDT} {-1144000800 -25200 0 MST} {-1125248400 -21600 1 MDT} {-1111946400 -25200 0 MST} {-1032714000 -21600 1 MDT} {-1016992800 -25200 0 MST} {-1001264400 -21600 1 MDT} {-986148000 -25200 0 MST} {-969814800 -21600 1 MDT} {-954093600 -25200 0 MST} {-937760400 -21600 1 MDT} {-922039200 -25200 0 MST} {-906310800 -21600 1 MDT} {-890589600 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} {-765388800 -25200 0 MST} {-748450800 -21600 1 MDT} {-732729600 -25200 0 MST} {-715791600 -21600 1 MDT} {-702489600 -25200 0 MST} {-684342000 -21600 1 MDT} {-671040000 -25200 0 MST} {-652892400 -21600 1 MDT} {-639590400 -25200 0 MST} {-620838000 -21600 1 MDT} {-608140800 -25200 0 MST} {-589388400 -21600 1 MDT} {-576086400 -25200 0 MST} {-557938800 -21600 1 MDT} {-544636800 -25200 0 MST} {-526489200 -21600 1 MDT} {-513187200 -25200 0 MST} {-495039600 -21600 1 MDT} {-481737600 -25200 0 MST} {-463590000 -21600 1 MDT} {-450288000 -25200 0 MST} {-431535600 -21600 1 MDT} {-418233600 -25200 0 MST} {-400086000 -21600 1 MDT} {-386784000 -25200 0 MST} {-337186800 -21600 1 MDT} {-321465600 -25200 0 MST} {-305737200 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Recife0000664000175000017500000000266215035744305017200 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Recife) { {-9223372036854775808 -8376 0 LMT} {-1767217224 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {653536800 -10800 0 -0300} {938660400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {971575200 -10800 0 -0300} {1000350000 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1033437600 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Rankin_Inlet0000664000175000017500000001712715035744305020362 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Rankin_Inlet) { {-9223372036854775808 0 0 -00} {-410227200 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {136368000 -18000 1 CDT} {152089200 -21600 0 CST} {167817600 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688546800 -21600 0 CST} {702460800 -18000 1 CDT} {719996400 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -18000 0 EST} {986112000 -18000 0 CDT} {1004252400 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Rainy_River0000664000175000017500000000027715035744305020234 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Winnipeg)]} { LoadTimeZoneFile America/Winnipeg } set TZData(:America/Rainy_River) $TZData(:America/Winnipeg) tcl9.0.3/library/tzdata/America/Punta_Arenas0000664000175000017500000000737415035744305020370 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Punta_Arenas) { {-9223372036854775808 -17020 0 LMT} {-2524504580 -16965 0 SMT} {-1892661435 -18000 0 -0500} {-1688410800 -16965 0 SMT} {-1619205435 -14400 0 -0400} {-1593806400 -16965 0 SMT} {-1335986235 -18000 0 -0500} {-1335985200 -14400 1 -0400} {-1317585600 -18000 0 -0500} {-1304362800 -14400 1 -0400} {-1286049600 -18000 0 -0500} {-1272826800 -14400 1 -0400} {-1254513600 -18000 0 -0500} {-1241290800 -14400 1 -0400} {-1222977600 -18000 0 -0500} {-1209754800 -14400 1 -0400} {-1191355200 -18000 0 -0500} {-1178132400 -14400 0 -0400} {-870552000 -18000 0 -0500} {-865278000 -14400 0 -0400} {-736632000 -14400 1 -0400} {-718056000 -18000 0 -0500} {-713649600 -14400 0 -0400} {-36619200 -10800 1 -0300} {-23922000 -14400 0 -0400} {-3355200 -10800 1 -0300} {7527600 -14400 0 -0400} {24465600 -10800 1 -0300} {37767600 -14400 0 -0400} {55915200 -10800 1 -0300} {69217200 -14400 0 -0400} {87969600 -10800 1 -0300} {100666800 -14400 0 -0400} {118209600 -10800 1 -0300} {132116400 -14400 0 -0400} {150868800 -10800 1 -0300} {163566000 -14400 0 -0400} {182318400 -10800 1 -0300} {195620400 -14400 0 -0400} {213768000 -10800 1 -0300} {227070000 -14400 0 -0400} {245217600 -10800 1 -0300} {258519600 -14400 0 -0400} {277272000 -10800 1 -0300} {289969200 -14400 0 -0400} {308721600 -10800 1 -0300} {321418800 -14400 0 -0400} {340171200 -10800 1 -0300} {353473200 -14400 0 -0400} {371620800 -10800 1 -0300} {384922800 -14400 0 -0400} {403070400 -10800 1 -0300} {416372400 -14400 0 -0400} {434520000 -10800 1 -0300} {447822000 -14400 0 -0400} {466574400 -10800 1 -0300} {479271600 -14400 0 -0400} {498024000 -10800 1 -0300} {510721200 -14400 0 -0400} {529473600 -10800 1 -0300} {545194800 -14400 0 -0400} {560923200 -10800 1 -0300} {574225200 -14400 0 -0400} {592372800 -10800 1 -0300} {605674800 -14400 0 -0400} {624427200 -10800 1 -0300} {637124400 -14400 0 -0400} {653457600 -10800 1 -0300} {668574000 -14400 0 -0400} {687326400 -10800 1 -0300} {700628400 -14400 0 -0400} {718776000 -10800 1 -0300} {732078000 -14400 0 -0400} {750225600 -10800 1 -0300} {763527600 -14400 0 -0400} {781675200 -10800 1 -0300} {794977200 -14400 0 -0400} {813729600 -10800 1 -0300} {826426800 -14400 0 -0400} {845179200 -10800 1 -0300} {859690800 -14400 0 -0400} {876628800 -10800 1 -0300} {889930800 -14400 0 -0400} {906868800 -10800 1 -0300} {923194800 -14400 0 -0400} {939528000 -10800 1 -0300} {952830000 -14400 0 -0400} {971582400 -10800 1 -0300} {984279600 -14400 0 -0400} {1003032000 -10800 1 -0300} {1015729200 -14400 0 -0400} {1034481600 -10800 1 -0300} {1047178800 -14400 0 -0400} {1065931200 -10800 1 -0300} {1079233200 -14400 0 -0400} {1097380800 -10800 1 -0300} {1110682800 -14400 0 -0400} {1128830400 -10800 1 -0300} {1142132400 -14400 0 -0400} {1160884800 -10800 1 -0300} {1173582000 -14400 0 -0400} {1192334400 -10800 1 -0300} {1206846000 -14400 0 -0400} {1223784000 -10800 1 -0300} {1237086000 -14400 0 -0400} {1255233600 -10800 1 -0300} {1270350000 -14400 0 -0400} {1286683200 -10800 1 -0300} {1304823600 -14400 0 -0400} {1313899200 -10800 1 -0300} {1335668400 -14400 0 -0400} {1346558400 -10800 1 -0300} {1367118000 -14400 0 -0400} {1378612800 -10800 1 -0300} {1398567600 -14400 0 -0400} {1410062400 -10800 1 -0300} {1463281200 -14400 0 -0400} {1471147200 -10800 1 -0300} {1480820400 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Puerto_Rico0000664000175000017500000000042115035744305020224 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Puerto_Rico) { {-9223372036854775808 -15865 0 LMT} {-2233035335 -14400 0 AST} {-873057600 -10800 0 AWT} {-769395600 -10800 1 APT} {-765399600 -14400 0 AST} {-757368000 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Port_of_Spain0000664000175000017500000000031215035744305020533 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Port_of_Spain) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Porto_Velho0000664000175000017500000000206415035744305020237 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Porto_Velho) { {-9223372036854775808 -15336 0 LMT} {-1767210264 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {590036400 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Porto_Acre0000664000175000017500000000030415035744305020027 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Rio_Branco)]} { LoadTimeZoneFile America/Rio_Branco } set TZData(:America/Porto_Acre) $TZData(:America/Rio_Branco) tcl9.0.3/library/tzdata/America/Port-au-Prince0000664000175000017500000001437615035744305020555 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Port-au-Prince) { {-9223372036854775808 -17360 0 LMT} {-2524504240 -17340 0 PPMT} {-1670483460 -18000 0 EST} {421218000 -14400 1 EDT} {436334400 -18000 0 EST} {452062800 -14400 1 EDT} {467784000 -18000 0 EST} {483512400 -14400 1 EDT} {499233600 -18000 0 EST} {514962000 -14400 1 EDT} {530683200 -18000 0 EST} {546411600 -14400 1 EDT} {562132800 -18000 0 EST} {576050400 -14400 1 EDT} {594194400 -18000 0 EST} {607500000 -14400 1 EDT} {625644000 -18000 0 EST} {638949600 -14400 1 EDT} {657093600 -18000 0 EST} {671004000 -14400 1 EDT} {688543200 -18000 0 EST} {702453600 -14400 1 EDT} {719992800 -18000 0 EST} {733903200 -14400 1 EDT} {752047200 -18000 0 EST} {765352800 -14400 1 EDT} {783496800 -18000 0 EST} {796802400 -14400 1 EDT} {814946400 -18000 0 EST} {828856800 -14400 1 EDT} {846396000 -18000 0 EST} {860306400 -14400 1 EDT} {877845600 -18000 0 EST} {1112504400 -14400 1 EDT} {1130644800 -18000 0 EST} {1143954000 -14400 1 EDT} {1162094400 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Phoenix0000664000175000017500000000073715035744305017416 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Phoenix) { {-9223372036854775808 -26898 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} {-820519140 -25200 0 MST} {-796841940 -25200 0 MST} {-94669200 -25200 0 MST} {-84380400 -21600 1 MDT} {-68659200 -25200 0 MST} {-56221200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Paramaribo0000664000175000017500000000036615035744305020057 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Paramaribo) { {-9223372036854775808 -13240 0 LMT} {-1861906760 -13252 0 PMT} {-1104524348 -13236 0 PMT} {-765317964 -12600 0 -0430} {465449400 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Pangnirtung0000664000175000017500000000027415035744305020274 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Iqaluit)]} { LoadTimeZoneFile America/Iqaluit } set TZData(:America/Pangnirtung) $TZData(:America/Iqaluit) tcl9.0.3/library/tzdata/America/Panama0000664000175000017500000000026315035744305017173 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Panama) { {-9223372036854775808 -19088 0 LMT} {-2524502512 -19176 0 CMT} {-1946918424 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Ojinaga0000664000175000017500000001477315035744305017361 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Ojinaga) { {-9223372036854775808 -25060 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {820476000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {883634400 -21600 0 CST} {891766800 -21600 0 MDT} {909302400 -25200 0 MST} {923216400 -21600 1 MDT} {941356800 -25200 0 MST} {954666000 -21600 1 MDT} {972806400 -25200 0 MST} {989139600 -21600 1 MDT} {1001836800 -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} {1175418000 -21600 1 MDT} {1193558400 -25200 0 MST} {1207472400 -21600 1 MDT} {1225008000 -25200 0 MST} {1238922000 -21600 1 MDT} {1256457600 -25200 0 MST} {1262329200 -25200 0 MST} {1268557200 -21600 1 MDT} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667120400 -21600 0 CST} {1669788000 -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} } tcl9.0.3/library/tzdata/America/Nuuk0000664000175000017500000001664415035744305016732 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Nuuk) { {-9223372036854775808 -12416 0 LMT} {-1686083584 -10800 0 -0300} {323845200 -7200 0 -0200} {338950800 -10800 0 -0300} {354675600 -7200 1 -0200} {370400400 -10800 0 -0300} {386125200 -7200 1 -0200} {401850000 -10800 0 -0300} {417574800 -7200 1 -0200} {433299600 -10800 0 -0300} {449024400 -7200 1 -0200} {465354000 -10800 0 -0300} {481078800 -7200 1 -0200} {496803600 -10800 0 -0300} {512528400 -7200 1 -0200} {528253200 -10800 0 -0300} {543978000 -7200 1 -0200} {559702800 -10800 0 -0300} {575427600 -7200 1 -0200} {591152400 -10800 0 -0300} {606877200 -7200 1 -0200} {622602000 -10800 0 -0300} {638326800 -7200 1 -0200} {654656400 -10800 0 -0300} {670381200 -7200 1 -0200} {686106000 -10800 0 -0300} {701830800 -7200 1 -0200} {717555600 -10800 0 -0300} {733280400 -7200 1 -0200} {749005200 -10800 0 -0300} {764730000 -7200 1 -0200} {780454800 -10800 0 -0300} {796179600 -7200 1 -0200} {811904400 -10800 0 -0300} {828234000 -7200 1 -0200} {846378000 -10800 0 -0300} {859683600 -7200 1 -0200} {877827600 -10800 0 -0300} {891133200 -7200 1 -0200} {909277200 -10800 0 -0300} {922582800 -7200 1 -0200} {941331600 -10800 0 -0300} {954032400 -7200 1 -0200} {972781200 -10800 0 -0300} {985482000 -7200 1 -0200} {1004230800 -10800 0 -0300} {1017536400 -7200 1 -0200} {1035680400 -10800 0 -0300} {1048986000 -7200 1 -0200} {1067130000 -10800 0 -0300} {1080435600 -7200 1 -0200} {1099184400 -10800 0 -0300} {1111885200 -7200 1 -0200} {1130634000 -10800 0 -0300} {1143334800 -7200 1 -0200} {1162083600 -10800 0 -0300} {1174784400 -7200 1 -0200} {1193533200 -10800 0 -0300} {1206838800 -7200 1 -0200} {1224982800 -10800 0 -0300} {1238288400 -7200 1 -0200} {1256432400 -10800 0 -0300} {1269738000 -7200 1 -0200} {1288486800 -10800 0 -0300} {1301187600 -7200 1 -0200} {1319936400 -10800 0 -0300} {1332637200 -7200 1 -0200} {1351386000 -10800 0 -0300} {1364691600 -7200 1 -0200} {1382835600 -10800 0 -0300} {1396141200 -7200 1 -0200} {1414285200 -10800 0 -0300} {1427590800 -7200 1 -0200} {1445734800 -10800 0 -0300} {1459040400 -7200 1 -0200} {1477789200 -10800 0 -0300} {1490490000 -7200 1 -0200} {1509238800 -10800 0 -0300} {1521939600 -7200 1 -0200} {1540688400 -10800 0 -0300} {1553994000 -7200 1 -0200} {1572138000 -10800 0 -0300} {1585443600 -7200 1 -0200} {1603587600 -10800 0 -0300} {1616893200 -7200 1 -0200} {1635642000 -10800 0 -0300} {1648342800 -7200 1 -0200} {1667091600 -10800 0 -0300} {1679792400 -7200 0 -0200} {1698541200 -7200 0 -0200} {1711846800 -3600 1 -0100} {1729990800 -7200 0 -0200} {1743296400 -3600 1 -0100} {1761440400 -7200 0 -0200} {1774746000 -3600 1 -0100} {1792890000 -7200 0 -0200} {1806195600 -3600 1 -0100} {1824944400 -7200 0 -0200} {1837645200 -3600 1 -0100} {1856394000 -7200 0 -0200} {1869094800 -3600 1 -0100} {1887843600 -7200 0 -0200} {1901149200 -3600 1 -0100} {1919293200 -7200 0 -0200} {1932598800 -3600 1 -0100} {1950742800 -7200 0 -0200} {1964048400 -3600 1 -0100} {1982797200 -7200 0 -0200} {1995498000 -3600 1 -0100} {2014246800 -7200 0 -0200} {2026947600 -3600 1 -0100} {2045696400 -7200 0 -0200} {2058397200 -3600 1 -0100} {2077146000 -7200 0 -0200} {2090451600 -3600 1 -0100} {2108595600 -7200 0 -0200} {2121901200 -3600 1 -0100} {2140045200 -7200 0 -0200} {2153350800 -3600 1 -0100} {2172099600 -7200 0 -0200} {2184800400 -3600 1 -0100} {2203549200 -7200 0 -0200} {2216250000 -3600 1 -0100} {2234998800 -7200 0 -0200} {2248304400 -3600 1 -0100} {2266448400 -7200 0 -0200} {2279754000 -3600 1 -0100} {2297898000 -7200 0 -0200} {2311203600 -3600 1 -0100} {2329347600 -7200 0 -0200} {2342653200 -3600 1 -0100} {2361402000 -7200 0 -0200} {2374102800 -3600 1 -0100} {2392851600 -7200 0 -0200} {2405552400 -3600 1 -0100} {2424301200 -7200 0 -0200} {2437606800 -3600 1 -0100} {2455750800 -7200 0 -0200} {2469056400 -3600 1 -0100} {2487200400 -7200 0 -0200} {2500506000 -3600 1 -0100} {2519254800 -7200 0 -0200} {2531955600 -3600 1 -0100} {2550704400 -7200 0 -0200} {2563405200 -3600 1 -0100} {2582154000 -7200 0 -0200} {2595459600 -3600 1 -0100} {2613603600 -7200 0 -0200} {2626909200 -3600 1 -0100} {2645053200 -7200 0 -0200} {2658358800 -3600 1 -0100} {2676502800 -7200 0 -0200} {2689808400 -3600 1 -0100} {2708557200 -7200 0 -0200} {2721258000 -3600 1 -0100} {2740006800 -7200 0 -0200} {2752707600 -3600 1 -0100} {2771456400 -7200 0 -0200} {2784762000 -3600 1 -0100} {2802906000 -7200 0 -0200} {2816211600 -3600 1 -0100} {2834355600 -7200 0 -0200} {2847661200 -3600 1 -0100} {2866410000 -7200 0 -0200} {2879110800 -3600 1 -0100} {2897859600 -7200 0 -0200} {2910560400 -3600 1 -0100} {2929309200 -7200 0 -0200} {2942010000 -3600 1 -0100} {2960758800 -7200 0 -0200} {2974064400 -3600 1 -0100} {2992208400 -7200 0 -0200} {3005514000 -3600 1 -0100} {3023658000 -7200 0 -0200} {3036963600 -3600 1 -0100} {3055712400 -7200 0 -0200} {3068413200 -3600 1 -0100} {3087162000 -7200 0 -0200} {3099862800 -3600 1 -0100} {3118611600 -7200 0 -0200} {3131917200 -3600 1 -0100} {3150061200 -7200 0 -0200} {3163366800 -3600 1 -0100} {3181510800 -7200 0 -0200} {3194816400 -3600 1 -0100} {3212960400 -7200 0 -0200} {3226266000 -3600 1 -0100} {3245014800 -7200 0 -0200} {3257715600 -3600 1 -0100} {3276464400 -7200 0 -0200} {3289165200 -3600 1 -0100} {3307914000 -7200 0 -0200} {3321219600 -3600 1 -0100} {3339363600 -7200 0 -0200} {3352669200 -3600 1 -0100} {3370813200 -7200 0 -0200} {3384118800 -3600 1 -0100} {3402867600 -7200 0 -0200} {3415568400 -3600 1 -0100} {3434317200 -7200 0 -0200} {3447018000 -3600 1 -0100} {3465766800 -7200 0 -0200} {3479072400 -3600 1 -0100} {3497216400 -7200 0 -0200} {3510522000 -3600 1 -0100} {3528666000 -7200 0 -0200} {3541971600 -3600 1 -0100} {3560115600 -7200 0 -0200} {3573421200 -3600 1 -0100} {3592170000 -7200 0 -0200} {3604870800 -3600 1 -0100} {3623619600 -7200 0 -0200} {3636320400 -3600 1 -0100} {3655069200 -7200 0 -0200} {3668374800 -3600 1 -0100} {3686518800 -7200 0 -0200} {3699824400 -3600 1 -0100} {3717968400 -7200 0 -0200} {3731274000 -3600 1 -0100} {3750022800 -7200 0 -0200} {3762723600 -3600 1 -0100} {3781472400 -7200 0 -0200} {3794173200 -3600 1 -0100} {3812922000 -7200 0 -0200} {3825622800 -3600 1 -0100} {3844371600 -7200 0 -0200} {3857677200 -3600 1 -0100} {3875821200 -7200 0 -0200} {3889126800 -3600 1 -0100} {3907270800 -7200 0 -0200} {3920576400 -3600 1 -0100} {3939325200 -7200 0 -0200} {3952026000 -3600 1 -0100} {3970774800 -7200 0 -0200} {3983475600 -3600 1 -0100} {4002224400 -7200 0 -0200} {4015530000 -3600 1 -0100} {4033674000 -7200 0 -0200} {4046979600 -3600 1 -0100} {4065123600 -7200 0 -0200} {4078429200 -3600 1 -0100} {4096573200 -7200 0 -0200} } tcl9.0.3/library/tzdata/America/North_Dakota/0000755000175000017500000000000015104662345020425 5ustar sergeisergeitcl9.0.3/library/tzdata/America/North_Dakota/New_Salem0000664000175000017500000002013115035744305022221 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/North_Dakota/New_Salem) { {-9223372036854775808 -24339 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} {1067158800 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/North_Dakota/Center0000664000175000017500000002012615035744305021573 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/North_Dakota/Center) { {-9223372036854775808 -24312 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} {720003600 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {986112000 -18000 1 CDT} {1004252400 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/North_Dakota/Beulah0000664000175000017500000002012615035744305021553 0ustar sergeisergei# 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} } tcl9.0.3/library/tzdata/America/Noronha0000664000175000017500000000263315035744305017405 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Noronha) { {-9223372036854775808 -7780 0 LMT} {-1767217820 -7200 0 -0200} {-1206961200 -3600 1 -0100} {-1191366000 -7200 0 -0200} {-1175378400 -3600 1 -0100} {-1159830000 -7200 0 -0200} {-633823200 -3600 1 -0100} {-622072800 -7200 0 -0200} {-602287200 -3600 1 -0100} {-591836400 -7200 0 -0200} {-570751200 -3600 1 -0100} {-560214000 -7200 0 -0200} {-539128800 -3600 1 -0100} {-531356400 -7200 0 -0200} {-191368800 -3600 1 -0100} {-184201200 -7200 0 -0200} {-155167200 -3600 1 -0100} {-150073200 -7200 0 -0200} {-128901600 -3600 1 -0100} {-121129200 -7200 0 -0200} {-99957600 -3600 1 -0100} {-89593200 -7200 0 -0200} {-68421600 -3600 1 -0100} {-57970800 -7200 0 -0200} {499744800 -3600 1 -0100} {511232400 -7200 0 -0200} {530589600 -3600 1 -0100} {540262800 -7200 0 -0200} {562125600 -3600 1 -0100} {571194000 -7200 0 -0200} {592970400 -3600 1 -0100} {602038800 -7200 0 -0200} {624420000 -3600 1 -0100} {634698000 -7200 0 -0200} {653533200 -7200 0 -0200} {938656800 -7200 0 -0200} {938916000 -3600 1 -0100} {951613200 -7200 0 -0200} {970970400 -3600 1 -0100} {971571600 -7200 0 -0200} {1000346400 -7200 0 -0200} {1003024800 -3600 1 -0100} {1013907600 -7200 0 -0200} {1033434000 -7200 0 -0200} } tcl9.0.3/library/tzdata/America/Nome0000664000175000017500000002032415035744305016674 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Nome) { {-9223372036854775808 46702 0 LMT} {-3225223727 -39698 0 LMT} {-2188947502 -39600 0 NST} {-883573200 -39600 0 NST} {-880196400 -36000 1 NWT} {-769395600 -36000 1 NPT} {-765374400 -39600 0 NST} {-757342800 -39600 0 NST} {-86878800 -39600 0 BST} {-31496400 -39600 0 BST} {-21466800 -36000 1 BDT} {-5745600 -39600 0 BST} {9982800 -36000 1 BDT} {25704000 -39600 0 BST} {41432400 -36000 1 BDT} {57758400 -39600 0 BST} {73486800 -36000 1 BDT} {89208000 -39600 0 BST} {104936400 -36000 1 BDT} {120657600 -39600 0 BST} {126709200 -36000 1 BDT} {152107200 -39600 0 BST} {162392400 -36000 1 BDT} {183556800 -39600 0 BST} {199285200 -36000 1 BDT} {215611200 -39600 0 BST} {230734800 -36000 1 BDT} {247060800 -39600 0 BST} {262789200 -36000 1 BDT} {278510400 -39600 0 BST} {294238800 -36000 1 BDT} {309960000 -39600 0 BST} {325688400 -36000 1 BDT} {341409600 -39600 0 BST} {357138000 -36000 1 BDT} {372859200 -39600 0 BST} {388587600 -36000 1 BDT} {404913600 -39600 0 BST} {420037200 -36000 1 BDT} {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} } tcl9.0.3/library/tzdata/America/Nipigon0000664000175000017500000000027015035744305017377 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Toronto)]} { LoadTimeZoneFile America/Toronto } set TZData(:America/Nipigon) $TZData(:America/Toronto) tcl9.0.3/library/tzdata/America/New_York0000664000175000017500000002537415035744305017545 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/New_York) { {-9223372036854775808 -17762 0 LMT} {-2717650800 -18000 0 EST} {-1633280400 -14400 1 EDT} {-1615140000 -18000 0 EST} {-1601830800 -14400 1 EDT} {-1583690400 -18000 0 EST} {-1577905200 -18000 0 EST} {-1570381200 -14400 1 EDT} {-1551636000 -18000 0 EST} {-1536512400 -14400 1 EDT} {-1523210400 -18000 0 EST} {-1504458000 -14400 1 EDT} {-1491760800 -18000 0 EST} {-1473008400 -14400 1 EDT} {-1459706400 -18000 0 EST} {-1441558800 -14400 1 EDT} {-1428256800 -18000 0 EST} {-1410109200 -14400 1 EDT} {-1396807200 -18000 0 EST} {-1378659600 -14400 1 EDT} {-1365357600 -18000 0 EST} {-1347210000 -14400 1 EDT} {-1333908000 -18000 0 EST} {-1315155600 -14400 1 EDT} {-1301853600 -18000 0 EST} {-1283706000 -14400 1 EDT} {-1270404000 -18000 0 EST} {-1252256400 -14400 1 EDT} {-1238954400 -18000 0 EST} {-1220806800 -14400 1 EDT} {-1207504800 -18000 0 EST} {-1189357200 -14400 1 EDT} {-1176055200 -18000 0 EST} {-1157302800 -14400 1 EDT} {-1144605600 -18000 0 EST} {-1125853200 -14400 1 EDT} {-1112551200 -18000 0 EST} {-1094403600 -14400 1 EDT} {-1081101600 -18000 0 EST} {-1062954000 -14400 1 EDT} {-1049652000 -18000 0 EST} {-1031504400 -14400 1 EDT} {-1018202400 -18000 0 EST} {-1000054800 -14400 1 EDT} {-986752800 -18000 0 EST} {-968000400 -14400 1 EDT} {-955303200 -18000 0 EST} {-936550800 -14400 1 EDT} {-923248800 -18000 0 EST} {-905101200 -14400 1 EDT} {-891799200 -18000 0 EST} {-883594800 -18000 0 EST} {-880218000 -14400 1 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} {-757364400 -18000 0 EST} {-747248400 -14400 1 EDT} {-733946400 -18000 0 EST} {-715798800 -14400 1 EDT} {-702496800 -18000 0 EST} {-684349200 -14400 1 EDT} {-671047200 -18000 0 EST} {-652899600 -14400 1 EDT} {-639597600 -18000 0 EST} {-620845200 -14400 1 EDT} {-608148000 -18000 0 EST} {-589395600 -14400 1 EDT} {-576093600 -18000 0 EST} {-557946000 -14400 1 EDT} {-544644000 -18000 0 EST} {-526496400 -14400 1 EDT} {-513194400 -18000 0 EST} {-495046800 -14400 1 EDT} {-481744800 -18000 0 EST} {-463597200 -14400 1 EDT} {-447271200 -18000 0 EST} {-431542800 -14400 1 EDT} {-415821600 -18000 0 EST} {-400093200 -14400 1 EDT} {-384372000 -18000 0 EST} {-368643600 -14400 1 EDT} {-352922400 -18000 0 EST} {-337194000 -14400 1 EDT} {-321472800 -18000 0 EST} {-305744400 -14400 1 EDT} {-289418400 -18000 0 EST} {-273690000 -14400 1 EDT} {-257968800 -18000 0 EST} {-242240400 -14400 1 EDT} {-226519200 -18000 0 EST} {-210790800 -14400 1 EDT} {-195069600 -18000 0 EST} {-179341200 -14400 1 EDT} {-163620000 -18000 0 EST} {-147891600 -14400 1 EDT} {-131565600 -18000 0 EST} {-116442000 -14400 1 EDT} {-100116000 -18000 0 EST} {-94676400 -18000 0 EST} {-84387600 -14400 1 EDT} {-68666400 -18000 0 EST} {-52938000 -14400 1 EDT} {-37216800 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {41410800 -14400 1 EDT} {57736800 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {126687600 -14400 1 EDT} {152085600 -18000 0 EST} {162370800 -14400 1 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941349600 -18000 0 EST} {954658800 -14400 1 EDT} {972799200 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Nassau0000664000175000017500000000026715035744305017234 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Toronto)]} { LoadTimeZoneFile America/Toronto } set TZData(:America/Nassau) $TZData(:America/Toronto) tcl9.0.3/library/tzdata/America/Montserrat0000664000175000017500000000030715035744305020133 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Montserrat) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Montreal0000664000175000017500000000027115035744305017556 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Toronto)]} { LoadTimeZoneFile America/Toronto } set TZData(:America/Montreal) $TZData(:America/Toronto) tcl9.0.3/library/tzdata/America/Montevideo0000664000175000017500000000563615035744305020120 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Montevideo) { {-9223372036854775808 -13491 0 LMT} {-1942690509 -13491 0 MMT} {-1567455309 -14400 0 -0400} {-1459627200 -10800 0 -0300} {-1443819600 -12600 0 -0430} {-1428006600 -10800 1 -0300} {-1412283600 -12600 0 -0430} {-1396470600 -10800 1 -0300} {-1380747600 -12600 0 -0430} {-1141590600 -10800 1 -0300} {-1128286800 -12600 0 -0430} {-1110141000 -10800 1 -0300} {-1096837200 -12600 0 -0430} {-1078691400 -10800 1 -0300} {-1065387600 -12600 0 -0430} {-1047241800 -10800 1 -0300} {-1033938000 -12600 0 -0430} {-1015187400 -10800 1 -0300} {-1002488400 -12600 0 -0430} {-983737800 -10800 1 -0300} {-971038800 -12600 0 -0430} {-954707400 -10800 1 -0300} {-938984400 -12600 0 -0430} {-920838600 -10800 1 -0300} {-907534800 -12600 0 -0430} {-896819400 -10800 1 -0300} {-853621200 -9000 0 -0330} {-845847000 -10800 0 -0300} {-334789200 -9000 1 -0330} {-319671000 -10800 0 -0300} {-315608400 -10800 0 -0300} {-314226000 -7200 1 -0200} {-309996000 -10800 0 -0300} {-149720400 -7200 1 -0200} {-134604000 -10800 0 -0300} {-63147600 -10800 0 -0300} {-50446800 -9000 1 -0330} {-34205400 -10800 0 -0300} {10800 -10800 0 -0300} {9860400 -7200 1 -0200} {14176800 -10800 0 -0300} {72846000 -7200 1 -0200} {80100000 -10800 0 -0300} {126241200 -10800 0 -0300} {127278000 -5400 1 -0230} {132112800 -9000 0 -0330} {147234600 -10800 0 -0300} {156909600 -10800 0 -0300} {156913200 -7200 1 -0200} {165376800 -10800 0 -0300} {219812400 -7200 1 -0200} {226461600 -10800 0 -0300} {250052400 -7200 1 -0200} {257911200 -10800 0 -0300} {282711600 -7200 1 -0200} {289360800 -10800 0 -0300} {294202800 -7200 1 -0200} {322020000 -10800 0 -0300} {566449200 -7200 1 -0200} {573012000 -10800 0 -0300} {597812400 -7200 1 -0200} {605066400 -10800 0 -0300} {625633200 -7200 1 -0200} {635911200 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -10800 0 -0300} {688532400 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {730864800 -10800 0 -0300} {1095562800 -7200 1 -0200} {1111896000 -10800 0 -0300} {1128834000 -7200 1 -0200} {1142136000 -10800 0 -0300} {1159678800 -7200 1 -0200} {1173585600 -10800 0 -0300} {1191733200 -7200 1 -0200} {1205035200 -10800 0 -0300} {1223182800 -7200 1 -0200} {1236484800 -10800 0 -0300} {1254632400 -7200 1 -0200} {1268539200 -10800 0 -0300} {1286082000 -7200 1 -0200} {1299988800 -10800 0 -0300} {1317531600 -7200 1 -0200} {1331438400 -10800 0 -0300} {1349586000 -7200 1 -0200} {1362888000 -10800 0 -0300} {1381035600 -7200 1 -0200} {1394337600 -10800 0 -0300} {1412485200 -7200 1 -0200} {1425787200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Monterrey0000664000175000017500000000375715035744305017775 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Monterrey) { {-9223372036854775808 -24076 0 LMT} {-1514743200 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {568015200 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {599637600 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {989136000 -18000 1 CDT} {1001833200 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1175414400 -18000 1 CDT} {1193554800 -21600 0 CST} {1207468800 -18000 1 CDT} {1225004400 -21600 0 CST} {1238918400 -18000 1 CDT} {1256454000 -21600 0 CST} {1270368000 -18000 1 CDT} {1288508400 -21600 0 CST} {1301817600 -18000 1 CDT} {1319958000 -21600 0 CST} {1333267200 -18000 1 CDT} {1351407600 -21600 0 CST} {1365321600 -18000 1 CDT} {1382857200 -21600 0 CST} {1396771200 -18000 1 CDT} {1414306800 -21600 0 CST} {1428220800 -18000 1 CDT} {1445756400 -21600 0 CST} {1459670400 -18000 1 CDT} {1477810800 -21600 0 CST} {1491120000 -18000 1 CDT} {1509260400 -21600 0 CST} {1522569600 -18000 1 CDT} {1540710000 -21600 0 CST} {1554624000 -18000 1 CDT} {1572159600 -21600 0 CST} {1586073600 -18000 1 CDT} {1603609200 -21600 0 CST} {1617523200 -18000 1 CDT} {1635663600 -21600 0 CST} {1648972800 -18000 1 CDT} {1667113200 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Moncton0000664000175000017500000002366515035744305017426 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Moncton) { {-9223372036854775808 -15548 0 LMT} {-2715882052 -18000 0 EST} {-2131642800 -14400 0 AST} {-1632074400 -10800 1 ADT} {-1615143600 -14400 0 AST} {-1167595200 -14400 0 AST} {-1153681200 -10800 1 ADT} {-1145822400 -14400 0 AST} {-1122231600 -10800 1 ADT} {-1114372800 -14400 0 AST} {-1090782000 -10800 1 ADT} {-1082923200 -14400 0 AST} {-1059332400 -10800 1 ADT} {-1051473600 -14400 0 AST} {-1027882800 -10800 1 ADT} {-1020024000 -14400 0 AST} {-996433200 -10800 1 ADT} {-988574400 -14400 0 AST} {-965674800 -10800 1 ADT} {-955396800 -14400 0 AST} {-934743600 -10800 1 ADT} {-923947200 -14400 0 AST} {-904503600 -10800 1 ADT} {-891892800 -14400 0 AST} {-883598400 -14400 0 AST} {-880221600 -10800 1 AWT} {-769395600 -10800 1 APT} {-765399600 -14400 0 AST} {-757368000 -14400 0 AST} {-747252000 -10800 1 ADT} {-733950000 -14400 0 AST} {-715802400 -10800 1 ADT} {-702500400 -14400 0 AST} {-684352800 -10800 1 ADT} {-671050800 -14400 0 AST} {-652903200 -10800 1 ADT} {-639601200 -14400 0 AST} {-620848800 -10800 1 ADT} {-608151600 -14400 0 AST} {-589399200 -10800 1 ADT} {-576097200 -14400 0 AST} {-557949600 -10800 1 ADT} {-544647600 -14400 0 AST} {-526500000 -10800 1 ADT} {-513198000 -14400 0 AST} {-495050400 -10800 1 ADT} {-481748400 -14400 0 AST} {-463600800 -10800 1 ADT} {-450298800 -14400 0 AST} {-431546400 -10800 1 ADT} {-418244400 -14400 0 AST} {-400096800 -10800 1 ADT} {-384375600 -14400 0 AST} {-368647200 -10800 1 ADT} {-352926000 -14400 0 AST} {-337197600 -10800 1 ADT} {-321476400 -14400 0 AST} {-305748000 -10800 1 ADT} {-289422000 -14400 0 AST} {-273693600 -10800 1 ADT} {-257972400 -14400 0 AST} {-242244000 -10800 1 ADT} {-226522800 -14400 0 AST} {-210794400 -10800 1 ADT} {-195073200 -14400 0 AST} {-179344800 -10800 1 ADT} {-163623600 -14400 0 AST} {-147895200 -10800 1 ADT} {-131569200 -14400 0 AST} {-116445600 -10800 1 ADT} {-100119600 -14400 0 AST} {-84391200 -10800 1 ADT} {-68670000 -14400 0 AST} {-52941600 -10800 1 ADT} {-37220400 -14400 0 AST} {-21492000 -10800 1 ADT} {-5770800 -14400 0 AST} {9957600 -10800 1 ADT} {25678800 -14400 0 AST} {41407200 -10800 1 ADT} {57733200 -14400 0 AST} {73461600 -10800 1 ADT} {89182800 -14400 0 AST} {94708800 -14400 0 AST} {136360800 -10800 1 ADT} {152082000 -14400 0 AST} {167810400 -10800 1 ADT} {183531600 -14400 0 AST} {199260000 -10800 1 ADT} {215586000 -14400 0 AST} {230709600 -10800 1 ADT} {247035600 -14400 0 AST} {262764000 -10800 1 ADT} {278485200 -14400 0 AST} {294213600 -10800 1 ADT} {309934800 -14400 0 AST} {325663200 -10800 1 ADT} {341384400 -14400 0 AST} {357112800 -10800 1 ADT} {372834000 -14400 0 AST} {388562400 -10800 1 ADT} {404888400 -14400 0 AST} {420012000 -10800 1 ADT} {436338000 -14400 0 AST} {452066400 -10800 1 ADT} {467787600 -14400 0 AST} {483516000 -10800 1 ADT} {499237200 -14400 0 AST} {514965600 -10800 1 ADT} {530686800 -14400 0 AST} {544600800 -10800 1 ADT} {562136400 -14400 0 AST} {576050400 -10800 1 ADT} {594190800 -14400 0 AST} {607500000 -10800 1 ADT} {625640400 -14400 0 AST} {638949600 -10800 1 ADT} {657090000 -14400 0 AST} {671004000 -10800 1 ADT} {688539600 -14400 0 AST} {702453600 -10800 1 ADT} {719989200 -14400 0 AST} {725860800 -14400 0 AST} {733896060 -10800 1 ADT} {752036460 -14400 0 AST} {765345660 -10800 1 ADT} {783486060 -14400 0 AST} {796795260 -10800 1 ADT} {814935660 -14400 0 AST} {828849660 -10800 1 ADT} {846385260 -14400 0 AST} {860299260 -10800 1 ADT} {877834860 -14400 0 AST} {891748860 -10800 1 ADT} {909284460 -14400 0 AST} {923198460 -10800 1 ADT} {941338860 -14400 0 AST} {954648060 -10800 1 ADT} {972788460 -14400 0 AST} {986097660 -10800 1 ADT} {1004238060 -14400 0 AST} {1018152060 -10800 1 ADT} {1035687660 -14400 0 AST} {1049601660 -10800 1 ADT} {1067137260 -14400 0 AST} {1081051260 -10800 1 ADT} {1099191660 -14400 0 AST} {1112500860 -10800 1 ADT} {1130641260 -14400 0 AST} {1143950460 -10800 1 ADT} {1162090860 -14400 0 AST} {1167624000 -14400 0 AST} {1173592800 -10800 1 ADT} {1194152400 -14400 0 AST} {1205042400 -10800 1 ADT} {1225602000 -14400 0 AST} {1236492000 -10800 1 ADT} {1257051600 -14400 0 AST} {1268546400 -10800 1 ADT} {1289106000 -14400 0 AST} {1299996000 -10800 1 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Miquelon0000664000175000017500000001620615035744305017573 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Miquelon) { {-9223372036854775808 -13480 0 LMT} {-1847650520 -14400 0 AST} {326001600 -10800 0 -0300} {536468400 -10800 0 -0300} {544597200 -7200 1 -0200} {562132800 -10800 0 -0300} {576046800 -7200 1 -0200} {594187200 -10800 0 -0300} {607496400 -7200 1 -0200} {625636800 -10800 0 -0300} {638946000 -7200 1 -0200} {657086400 -10800 0 -0300} {671000400 -7200 1 -0200} {688536000 -10800 0 -0300} {702450000 -7200 1 -0200} {719985600 -10800 0 -0300} {733899600 -7200 1 -0200} {752040000 -10800 0 -0300} {765349200 -7200 1 -0200} {783489600 -10800 0 -0300} {796798800 -7200 1 -0200} {814939200 -10800 0 -0300} {828853200 -7200 1 -0200} {846388800 -10800 0 -0300} {860302800 -7200 1 -0200} {877838400 -10800 0 -0300} {891752400 -7200 1 -0200} {909288000 -10800 0 -0300} {923202000 -7200 1 -0200} {941342400 -10800 0 -0300} {954651600 -7200 1 -0200} {972792000 -10800 0 -0300} {986101200 -7200 1 -0200} {1004241600 -10800 0 -0300} {1018155600 -7200 1 -0200} {1035691200 -10800 0 -0300} {1049605200 -7200 1 -0200} {1067140800 -10800 0 -0300} {1081054800 -7200 1 -0200} {1099195200 -10800 0 -0300} {1112504400 -7200 1 -0200} {1130644800 -10800 0 -0300} {1143954000 -7200 1 -0200} {1162094400 -10800 0 -0300} {1173589200 -7200 1 -0200} {1194148800 -10800 0 -0300} {1205038800 -7200 1 -0200} {1225598400 -10800 0 -0300} {1236488400 -7200 1 -0200} {1257048000 -10800 0 -0300} {1268542800 -7200 1 -0200} {1289102400 -10800 0 -0300} {1299992400 -7200 1 -0200} {1320552000 -10800 0 -0300} {1331442000 -7200 1 -0200} {1352001600 -10800 0 -0300} {1362891600 -7200 1 -0200} {1383451200 -10800 0 -0300} {1394341200 -7200 1 -0200} {1414900800 -10800 0 -0300} {1425790800 -7200 1 -0200} {1446350400 -10800 0 -0300} {1457845200 -7200 1 -0200} {1478404800 -10800 0 -0300} {1489294800 -7200 1 -0200} {1509854400 -10800 0 -0300} {1520744400 -7200 1 -0200} {1541304000 -10800 0 -0300} {1552194000 -7200 1 -0200} {1572753600 -10800 0 -0300} {1583643600 -7200 1 -0200} {1604203200 -10800 0 -0300} {1615698000 -7200 1 -0200} {1636257600 -10800 0 -0300} {1647147600 -7200 1 -0200} {1667707200 -10800 0 -0300} {1678597200 -7200 1 -0200} {1699156800 -10800 0 -0300} {1710046800 -7200 1 -0200} {1730606400 -10800 0 -0300} {1741496400 -7200 1 -0200} {1762056000 -10800 0 -0300} {1772946000 -7200 1 -0200} {1793505600 -10800 0 -0300} {1805000400 -7200 1 -0200} {1825560000 -10800 0 -0300} {1836450000 -7200 1 -0200} {1857009600 -10800 0 -0300} {1867899600 -7200 1 -0200} {1888459200 -10800 0 -0300} {1899349200 -7200 1 -0200} {1919908800 -10800 0 -0300} {1930798800 -7200 1 -0200} {1951358400 -10800 0 -0300} {1962853200 -7200 1 -0200} {1983412800 -10800 0 -0300} {1994302800 -7200 1 -0200} {2014862400 -10800 0 -0300} {2025752400 -7200 1 -0200} {2046312000 -10800 0 -0300} {2057202000 -7200 1 -0200} {2077761600 -10800 0 -0300} {2088651600 -7200 1 -0200} {2109211200 -10800 0 -0300} {2120101200 -7200 1 -0200} {2140660800 -10800 0 -0300} {2152155600 -7200 1 -0200} {2172715200 -10800 0 -0300} {2183605200 -7200 1 -0200} {2204164800 -10800 0 -0300} {2215054800 -7200 1 -0200} {2235614400 -10800 0 -0300} {2246504400 -7200 1 -0200} {2267064000 -10800 0 -0300} {2277954000 -7200 1 -0200} {2298513600 -10800 0 -0300} {2309403600 -7200 1 -0200} {2329963200 -10800 0 -0300} {2341458000 -7200 1 -0200} {2362017600 -10800 0 -0300} {2372907600 -7200 1 -0200} {2393467200 -10800 0 -0300} {2404357200 -7200 1 -0200} {2424916800 -10800 0 -0300} {2435806800 -7200 1 -0200} {2456366400 -10800 0 -0300} {2467256400 -7200 1 -0200} {2487816000 -10800 0 -0300} {2499310800 -7200 1 -0200} {2519870400 -10800 0 -0300} {2530760400 -7200 1 -0200} {2551320000 -10800 0 -0300} {2562210000 -7200 1 -0200} {2582769600 -10800 0 -0300} {2593659600 -7200 1 -0200} {2614219200 -10800 0 -0300} {2625109200 -7200 1 -0200} {2645668800 -10800 0 -0300} {2656558800 -7200 1 -0200} {2677118400 -10800 0 -0300} {2688613200 -7200 1 -0200} {2709172800 -10800 0 -0300} {2720062800 -7200 1 -0200} {2740622400 -10800 0 -0300} {2751512400 -7200 1 -0200} {2772072000 -10800 0 -0300} {2782962000 -7200 1 -0200} {2803521600 -10800 0 -0300} {2814411600 -7200 1 -0200} {2834971200 -10800 0 -0300} {2846466000 -7200 1 -0200} {2867025600 -10800 0 -0300} {2877915600 -7200 1 -0200} {2898475200 -10800 0 -0300} {2909365200 -7200 1 -0200} {2929924800 -10800 0 -0300} {2940814800 -7200 1 -0200} {2961374400 -10800 0 -0300} {2972264400 -7200 1 -0200} {2992824000 -10800 0 -0300} {3003714000 -7200 1 -0200} {3024273600 -10800 0 -0300} {3035768400 -7200 1 -0200} {3056328000 -10800 0 -0300} {3067218000 -7200 1 -0200} {3087777600 -10800 0 -0300} {3098667600 -7200 1 -0200} {3119227200 -10800 0 -0300} {3130117200 -7200 1 -0200} {3150676800 -10800 0 -0300} {3161566800 -7200 1 -0200} {3182126400 -10800 0 -0300} {3193016400 -7200 1 -0200} {3213576000 -10800 0 -0300} {3225070800 -7200 1 -0200} {3245630400 -10800 0 -0300} {3256520400 -7200 1 -0200} {3277080000 -10800 0 -0300} {3287970000 -7200 1 -0200} {3308529600 -10800 0 -0300} {3319419600 -7200 1 -0200} {3339979200 -10800 0 -0300} {3350869200 -7200 1 -0200} {3371428800 -10800 0 -0300} {3382923600 -7200 1 -0200} {3403483200 -10800 0 -0300} {3414373200 -7200 1 -0200} {3434932800 -10800 0 -0300} {3445822800 -7200 1 -0200} {3466382400 -10800 0 -0300} {3477272400 -7200 1 -0200} {3497832000 -10800 0 -0300} {3508722000 -7200 1 -0200} {3529281600 -10800 0 -0300} {3540171600 -7200 1 -0200} {3560731200 -10800 0 -0300} {3572226000 -7200 1 -0200} {3592785600 -10800 0 -0300} {3603675600 -7200 1 -0200} {3624235200 -10800 0 -0300} {3635125200 -7200 1 -0200} {3655684800 -10800 0 -0300} {3666574800 -7200 1 -0200} {3687134400 -10800 0 -0300} {3698024400 -7200 1 -0200} {3718584000 -10800 0 -0300} {3730078800 -7200 1 -0200} {3750638400 -10800 0 -0300} {3761528400 -7200 1 -0200} {3782088000 -10800 0 -0300} {3792978000 -7200 1 -0200} {3813537600 -10800 0 -0300} {3824427600 -7200 1 -0200} {3844987200 -10800 0 -0300} {3855877200 -7200 1 -0200} {3876436800 -10800 0 -0300} {3887326800 -7200 1 -0200} {3907886400 -10800 0 -0300} {3919381200 -7200 1 -0200} {3939940800 -10800 0 -0300} {3950830800 -7200 1 -0200} {3971390400 -10800 0 -0300} {3982280400 -7200 1 -0200} {4002840000 -10800 0 -0300} {4013730000 -7200 1 -0200} {4034289600 -10800 0 -0300} {4045179600 -7200 1 -0200} {4065739200 -10800 0 -0300} {4076629200 -7200 1 -0200} {4097188800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Mexico_City0000664000175000017500000000421315035744305020211 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Mexico_City) { {-9223372036854775808 -23796 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {-975261600 -18000 1 CDT} {-963169200 -21600 0 CST} {-917114400 -18000 1 CDT} {-907354800 -21600 0 CST} {-821901600 -18000 1 CWT} {-810068400 -21600 0 CST} {-627501600 -18000 1 CDT} {-612990000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {989136000 -18000 1 CDT} {1001836800 -21600 0 CST} {1014184800 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1175414400 -18000 1 CDT} {1193554800 -21600 0 CST} {1207468800 -18000 1 CDT} {1225004400 -21600 0 CST} {1238918400 -18000 1 CDT} {1256454000 -21600 0 CST} {1270368000 -18000 1 CDT} {1288508400 -21600 0 CST} {1301817600 -18000 1 CDT} {1319958000 -21600 0 CST} {1333267200 -18000 1 CDT} {1351407600 -21600 0 CST} {1365321600 -18000 1 CDT} {1382857200 -21600 0 CST} {1396771200 -18000 1 CDT} {1414306800 -21600 0 CST} {1428220800 -18000 1 CDT} {1445756400 -21600 0 CST} {1459670400 -18000 1 CDT} {1477810800 -21600 0 CST} {1491120000 -18000 1 CDT} {1509260400 -21600 0 CST} {1522569600 -18000 1 CDT} {1540710000 -21600 0 CST} {1554624000 -18000 1 CDT} {1572159600 -21600 0 CST} {1586073600 -18000 1 CDT} {1603609200 -21600 0 CST} {1617523200 -18000 1 CDT} {1635663600 -21600 0 CST} {1648972800 -18000 1 CDT} {1667113200 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Metlakatla0000664000175000017500000001453415035744305020063 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Metlakatla) { {-9223372036854775808 54822 0 LMT} {-3225223727 -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 PST} {1446372000 -32400 0 AKST} {1457866800 -28800 1 AKDT} {1478426400 -32400 0 AKST} {1489316400 -28800 1 AKDT} {1509876000 -32400 0 AKST} {1520766000 -28800 1 AKDT} {1541329200 -28800 0 PST} {1547978400 -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} } tcl9.0.3/library/tzdata/America/Merida0000664000175000017500000000342715035744305017204 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Merida) { {-9223372036854775808 -21508 0 LMT} {-1514743200 -21600 0 CST} {378201600 -18000 0 EST} {405068400 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {989136000 -18000 1 CDT} {1001833200 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1175414400 -18000 1 CDT} {1193554800 -21600 0 CST} {1207468800 -18000 1 CDT} {1225004400 -21600 0 CST} {1238918400 -18000 1 CDT} {1256454000 -21600 0 CST} {1270368000 -18000 1 CDT} {1288508400 -21600 0 CST} {1301817600 -18000 1 CDT} {1319958000 -21600 0 CST} {1333267200 -18000 1 CDT} {1351407600 -21600 0 CST} {1365321600 -18000 1 CDT} {1382857200 -21600 0 CST} {1396771200 -18000 1 CDT} {1414306800 -21600 0 CST} {1428220800 -18000 1 CDT} {1445756400 -21600 0 CST} {1459670400 -18000 1 CDT} {1477810800 -21600 0 CST} {1491120000 -18000 1 CDT} {1509260400 -21600 0 CST} {1522569600 -18000 1 CDT} {1540710000 -21600 0 CST} {1554624000 -18000 1 CDT} {1572159600 -21600 0 CST} {1586073600 -18000 1 CDT} {1603609200 -21600 0 CST} {1617523200 -18000 1 CDT} {1635663600 -21600 0 CST} {1648972800 -18000 1 CDT} {1667113200 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Menominee0000664000175000017500000001771015035744305017717 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Menominee) { {-9223372036854775808 -21027 0 LMT} {-2659759773 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747244800 -18000 1 CDT} {-733942800 -21600 0 CST} {-116438400 -18000 1 CDT} {-100112400 -21600 0 CST} {-21484800 -18000 0 EST} {104914800 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {126691200 -18000 1 CDT} {152089200 -21600 0 CST} {162374400 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688546800 -21600 0 CST} {702460800 -18000 1 CDT} {719996400 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {986112000 -18000 1 CDT} {1004252400 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Mendoza0000664000175000017500000000032615035744305017373 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Mendoza)]} { LoadTimeZoneFile America/Argentina/Mendoza } set TZData(:America/Mendoza) $TZData(:America/Argentina/Mendoza) tcl9.0.3/library/tzdata/America/Mazatlan0000664000175000017500000000366115035744305017552 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Mazatlan) { {-9223372036854775808 -25540 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {-873828000 -25200 0 MST} {25200 -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} {989139600 -21600 1 MDT} {1001836800 -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} {1175418000 -21600 1 MDT} {1193558400 -25200 0 MST} {1207472400 -21600 1 MDT} {1225008000 -25200 0 MST} {1238922000 -21600 1 MDT} {1256457600 -25200 0 MST} {1270371600 -21600 1 MDT} {1288512000 -25200 0 MST} {1301821200 -21600 1 MDT} {1319961600 -25200 0 MST} {1333270800 -21600 1 MDT} {1351411200 -25200 0 MST} {1365325200 -21600 1 MDT} {1382860800 -25200 0 MST} {1396774800 -21600 1 MDT} {1414310400 -25200 0 MST} {1428224400 -21600 1 MDT} {1445760000 -25200 0 MST} {1459674000 -21600 1 MDT} {1477814400 -25200 0 MST} {1491123600 -21600 1 MDT} {1509264000 -25200 0 MST} {1522573200 -21600 1 MDT} {1540713600 -25200 0 MST} {1554627600 -21600 1 MDT} {1572163200 -25200 0 MST} {1586077200 -21600 1 MDT} {1603612800 -25200 0 MST} {1617526800 -21600 1 MDT} {1635667200 -25200 0 MST} {1648976400 -21600 1 MDT} {1667116800 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Matamoros0000664000175000017500000001457615035744305017754 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Matamoros) { {-9223372036854775808 -23400 0 LMT} {-1514743200 -21600 0 CST} {568015200 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {599637600 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {989136000 -18000 1 CDT} {1001833200 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1175414400 -18000 1 CDT} {1193554800 -21600 0 CST} {1207468800 -18000 1 CDT} {1225004400 -21600 0 CST} {1238918400 -18000 1 CDT} {1256454000 -21600 0 CST} {1262325600 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Martinique0000664000175000017500000000036215035744305020114 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Martinique) { {-9223372036854775808 -14660 0 LMT} {-2524506940 -14660 0 FFMT} {-1851537340 -14400 0 AST} {323841600 -10800 1 ADT} {338958000 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Marigot0000664000175000017500000000030415035744305017374 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Marigot) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Manaus0000664000175000017500000000225315035744305017223 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Manaus) { {-9223372036854775808 -14404 0 LMT} {-1767211196 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {590036400 -14400 0 -0400} {749188800 -14400 0 -0400} {750830400 -10800 1 -0300} {761713200 -14400 0 -0400} {780202800 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Managua0000664000175000017500000000111615035744305017345 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Managua) { {-9223372036854775808 -20708 0 LMT} {-2524500892 -20712 0 MMT} {-1121105688 -21600 0 CST} {105084000 -18000 0 EST} {161758800 -21600 0 CST} {290584800 -18000 1 CDT} {299134800 -21600 0 CST} {322034400 -18000 1 CDT} {330584400 -21600 0 CST} {694260000 -18000 0 EST} {717310800 -21600 0 CST} {725868000 -18000 0 EST} {852094800 -21600 0 CST} {1113112800 -18000 1 CDT} {1128229200 -21600 0 CST} {1146384000 -18000 1 CDT} {1159682400 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Maceio0000664000175000017500000000305515035744305017175 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Maceio) { {-9223372036854775808 -8572 0 LMT} {-1767217028 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {653536800 -10800 0 -0300} {813553200 -10800 0 -0300} {813726000 -7200 1 -0200} {824004000 -10800 0 -0300} {841802400 -10800 0 -0300} {938660400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {972180000 -10800 0 -0300} {1000350000 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1033437600 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Lower_Princes0000664000175000017500000000031215035744305020544 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Lower_Princes) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Louisville0000664000175000017500000000033715035744305020127 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Kentucky/Louisville)]} { LoadTimeZoneFile America/Kentucky/Louisville } set TZData(:America/Louisville) $TZData(:America/Kentucky/Louisville) tcl9.0.3/library/tzdata/America/Los_Angeles0000664000175000017500000002230115035744305020166 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Los_Angeles) { {-9223372036854775808 -28378 0 LMT} {-2717640000 -28800 0 PST} {-1633269600 -25200 1 PDT} {-1615129200 -28800 0 PST} {-1601820000 -25200 1 PDT} {-1583679600 -28800 0 PST} {-880207200 -25200 1 PWT} {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-757353600 -28800 0 PST} {-687967140 -25200 1 PDT} {-662655600 -28800 0 PST} {-620838000 -25200 1 PDT} {-608137200 -28800 0 PST} {-589388400 -25200 1 PDT} {-576082800 -28800 0 PST} {-557938800 -25200 1 PDT} {-544633200 -28800 0 PST} {-526489200 -25200 1 PDT} {-513183600 -28800 0 PST} {-495039600 -25200 1 PDT} {-481734000 -28800 0 PST} {-463590000 -25200 1 PDT} {-450284400 -28800 0 PST} {-431535600 -25200 1 PDT} {-418230000 -28800 0 PST} {-400086000 -25200 1 PDT} {-386780400 -28800 0 PST} {-368636400 -25200 1 PDT} {-355330800 -28800 0 PST} {-337186800 -25200 1 PDT} {-323881200 -28800 0 PST} {-305737200 -25200 1 PDT} {-292431600 -28800 0 PST} {-273682800 -25200 1 PDT} {-260982000 -28800 0 PST} {-242233200 -25200 1 PDT} {-226508400 -28800 0 PST} {-210783600 -25200 1 PDT} {-195058800 -28800 0 PST} {-179334000 -25200 1 PDT} {-163609200 -28800 0 PST} {-147884400 -25200 1 PDT} {-131554800 -28800 0 PST} {-116434800 -25200 1 PDT} {-100105200 -28800 0 PST} {-94665600 -28800 0 PST} {-84376800 -25200 1 PDT} {-68655600 -28800 0 PST} {-52927200 -25200 1 PDT} {-37206000 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1173607200 -25200 1 PDT} {1194166800 -28800 0 PST} {1205056800 -25200 1 PDT} {1225616400 -28800 0 PST} {1236506400 -25200 1 PDT} {1257066000 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 1 PDT} {1446368400 -28800 0 PST} {1457863200 -25200 1 PDT} {1478422800 -28800 0 PST} {1489312800 -25200 1 PDT} {1509872400 -28800 0 PST} {1520762400 -25200 1 PDT} {1541322000 -28800 0 PST} {1552212000 -25200 1 PDT} {1572771600 -28800 0 PST} {1583661600 -25200 1 PDT} {1604221200 -28800 0 PST} {1615716000 -25200 1 PDT} {1636275600 -28800 0 PST} {1647165600 -25200 1 PDT} {1667725200 -28800 0 PST} {1678615200 -25200 1 PDT} {1699174800 -28800 0 PST} {1710064800 -25200 1 PDT} {1730624400 -28800 0 PST} {1741514400 -25200 1 PDT} {1762074000 -28800 0 PST} {1772964000 -25200 1 PDT} {1793523600 -28800 0 PST} {1805018400 -25200 1 PDT} {1825578000 -28800 0 PST} {1836468000 -25200 1 PDT} {1857027600 -28800 0 PST} {1867917600 -25200 1 PDT} {1888477200 -28800 0 PST} {1899367200 -25200 1 PDT} {1919926800 -28800 0 PST} {1930816800 -25200 1 PDT} {1951376400 -28800 0 PST} {1962871200 -25200 1 PDT} {1983430800 -28800 0 PST} {1994320800 -25200 1 PDT} {2014880400 -28800 0 PST} {2025770400 -25200 1 PDT} {2046330000 -28800 0 PST} {2057220000 -25200 1 PDT} {2077779600 -28800 0 PST} {2088669600 -25200 1 PDT} {2109229200 -28800 0 PST} {2120119200 -25200 1 PDT} {2140678800 -28800 0 PST} {2152173600 -25200 1 PDT} {2172733200 -28800 0 PST} {2183623200 -25200 1 PDT} {2204182800 -28800 0 PST} {2215072800 -25200 1 PDT} {2235632400 -28800 0 PST} {2246522400 -25200 1 PDT} {2267082000 -28800 0 PST} {2277972000 -25200 1 PDT} {2298531600 -28800 0 PST} {2309421600 -25200 1 PDT} {2329981200 -28800 0 PST} {2341476000 -25200 1 PDT} {2362035600 -28800 0 PST} {2372925600 -25200 1 PDT} {2393485200 -28800 0 PST} {2404375200 -25200 1 PDT} {2424934800 -28800 0 PST} {2435824800 -25200 1 PDT} {2456384400 -28800 0 PST} {2467274400 -25200 1 PDT} {2487834000 -28800 0 PST} {2499328800 -25200 1 PDT} {2519888400 -28800 0 PST} {2530778400 -25200 1 PDT} {2551338000 -28800 0 PST} {2562228000 -25200 1 PDT} {2582787600 -28800 0 PST} {2593677600 -25200 1 PDT} {2614237200 -28800 0 PST} {2625127200 -25200 1 PDT} {2645686800 -28800 0 PST} {2656576800 -25200 1 PDT} {2677136400 -28800 0 PST} {2688631200 -25200 1 PDT} {2709190800 -28800 0 PST} {2720080800 -25200 1 PDT} {2740640400 -28800 0 PST} {2751530400 -25200 1 PDT} {2772090000 -28800 0 PST} {2782980000 -25200 1 PDT} {2803539600 -28800 0 PST} {2814429600 -25200 1 PDT} {2834989200 -28800 0 PST} {2846484000 -25200 1 PDT} {2867043600 -28800 0 PST} {2877933600 -25200 1 PDT} {2898493200 -28800 0 PST} {2909383200 -25200 1 PDT} {2929942800 -28800 0 PST} {2940832800 -25200 1 PDT} {2961392400 -28800 0 PST} {2972282400 -25200 1 PDT} {2992842000 -28800 0 PST} {3003732000 -25200 1 PDT} {3024291600 -28800 0 PST} {3035786400 -25200 1 PDT} {3056346000 -28800 0 PST} {3067236000 -25200 1 PDT} {3087795600 -28800 0 PST} {3098685600 -25200 1 PDT} {3119245200 -28800 0 PST} {3130135200 -25200 1 PDT} {3150694800 -28800 0 PST} {3161584800 -25200 1 PDT} {3182144400 -28800 0 PST} {3193034400 -25200 1 PDT} {3213594000 -28800 0 PST} {3225088800 -25200 1 PDT} {3245648400 -28800 0 PST} {3256538400 -25200 1 PDT} {3277098000 -28800 0 PST} {3287988000 -25200 1 PDT} {3308547600 -28800 0 PST} {3319437600 -25200 1 PDT} {3339997200 -28800 0 PST} {3350887200 -25200 1 PDT} {3371446800 -28800 0 PST} {3382941600 -25200 1 PDT} {3403501200 -28800 0 PST} {3414391200 -25200 1 PDT} {3434950800 -28800 0 PST} {3445840800 -25200 1 PDT} {3466400400 -28800 0 PST} {3477290400 -25200 1 PDT} {3497850000 -28800 0 PST} {3508740000 -25200 1 PDT} {3529299600 -28800 0 PST} {3540189600 -25200 1 PDT} {3560749200 -28800 0 PST} {3572244000 -25200 1 PDT} {3592803600 -28800 0 PST} {3603693600 -25200 1 PDT} {3624253200 -28800 0 PST} {3635143200 -25200 1 PDT} {3655702800 -28800 0 PST} {3666592800 -25200 1 PDT} {3687152400 -28800 0 PST} {3698042400 -25200 1 PDT} {3718602000 -28800 0 PST} {3730096800 -25200 1 PDT} {3750656400 -28800 0 PST} {3761546400 -25200 1 PDT} {3782106000 -28800 0 PST} {3792996000 -25200 1 PDT} {3813555600 -28800 0 PST} {3824445600 -25200 1 PDT} {3845005200 -28800 0 PST} {3855895200 -25200 1 PDT} {3876454800 -28800 0 PST} {3887344800 -25200 1 PDT} {3907904400 -28800 0 PST} {3919399200 -25200 1 PDT} {3939958800 -28800 0 PST} {3950848800 -25200 1 PDT} {3971408400 -28800 0 PST} {3982298400 -25200 1 PDT} {4002858000 -28800 0 PST} {4013748000 -25200 1 PDT} {4034307600 -28800 0 PST} {4045197600 -25200 1 PDT} {4065757200 -28800 0 PST} {4076647200 -25200 1 PDT} {4097206800 -28800 0 PST} } tcl9.0.3/library/tzdata/America/Lima0000664000175000017500000000072015035744305016656 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Lima) { {-9223372036854775808 -18492 0 LMT} {-2524503108 -18516 0 LMT} {-1938538284 -14400 0 -0400} {-1002052800 -18000 0 -0500} {-986756400 -14400 1 -0400} {-971035200 -18000 0 -0500} {-955306800 -14400 1 -0400} {-939585600 -18000 0 -0500} {512712000 -18000 0 -0500} {544248000 -18000 0 -0500} {638942400 -18000 0 -0500} {765172800 -18000 0 -0500} } tcl9.0.3/library/tzdata/America/La_Paz0000664000175000017500000000032415035744305017142 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/La_Paz) { {-9223372036854775808 -16356 0 LMT} {-2524505244 -16356 0 CMT} {-1205954844 -12756 1 BST} {-1192307244 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Kralendijk0000664000175000017500000000030715035744305020053 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Kralendijk) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Knox_IN0000664000175000017500000000030715035744305017302 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Indiana/Knox)]} { LoadTimeZoneFile America/Indiana/Knox } set TZData(:America/Knox_IN) $TZData(:America/Indiana/Knox) tcl9.0.3/library/tzdata/America/Kentucky/0000755000175000017500000000000015104662345017645 5ustar sergeisergeitcl9.0.3/library/tzdata/America/Kentucky/Monticello0000664000175000017500000002012715035744305021701 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Kentucky/Monticello) { {-9223372036854775808 -20364 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-63136800 -21600 0 CST} {-52934400 -18000 1 CDT} {-37213200 -21600 0 CST} {-21484800 -18000 1 CDT} {-5763600 -21600 0 CST} {9964800 -18000 1 CDT} {25686000 -21600 0 CST} {41414400 -18000 1 CDT} {57740400 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {126691200 -18000 1 CDT} {152089200 -21600 0 CST} {162374400 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688546800 -21600 0 CST} {702460800 -18000 1 CDT} {719996400 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Kentucky/Louisville0000664000175000017500000002203215035744305021720 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Kentucky/Louisville) { {-9223372036854775808 -20582 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-1546279200 -21600 0 CST} {-1535904000 -18000 1 CDT} {-1525280400 -21600 0 CST} {-905097600 -18000 1 CDT} {-891795600 -21600 0 CST} {-883591200 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747251940 -18000 1 CDT} {-744224400 -21600 0 CST} {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-415818000 -21600 0 CST} {-400089600 -18000 1 CDT} {-384368400 -21600 0 CST} {-368640000 -18000 1 CDT} {-352918800 -21600 0 CST} {-337190400 -18000 1 CDT} {-321469200 -21600 0 CST} {-305740800 -18000 1 CDT} {-289414800 -21600 0 CST} {-273686400 -18000 1 CDT} {-266428800 -18000 0 EST} {-63140400 -18000 0 EST} {-52938000 -14400 1 EDT} {-37216800 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {41410800 -14400 1 EDT} {57736800 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {126687600 -18000 1 CDT} {152089200 -18000 0 EST} {162370800 -14400 1 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941349600 -18000 0 EST} {954658800 -14400 1 EDT} {972799200 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Juneau0000664000175000017500000002032615035744305017227 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Juneau) { {-9223372036854775808 54139 0 LMT} {-3225223727 -32261 0 LMT} {-2188954939 -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 -32400 0 YST} {325681200 -28800 1 YDT} {341406000 -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} } tcl9.0.3/library/tzdata/America/Jujuy0000664000175000017500000000031615035744305017103 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Jujuy)]} { LoadTimeZoneFile America/Argentina/Jujuy } set TZData(:America/Jujuy) $TZData(:America/Argentina/Jujuy) tcl9.0.3/library/tzdata/America/Jamaica0000664000175000017500000000146215035744305017325 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Jamaica) { {-9223372036854775808 -18430 0 LMT} {-2524503170 -18430 0 KMT} {-1827687170 -18000 0 EST} {126248400 -18000 0 EST} {126687600 -14400 1 EDT} {152085600 -18000 0 EST} {162370800 -14400 1 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {441781200 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Iqaluit0000664000175000017500000001721615035744305017414 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Iqaluit) { {-9223372036854775808 0 0 -00} {-865296000 -14400 0 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {136364400 -14400 1 EDT} {152085600 -18000 0 EST} {167814000 -14400 1 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Inuvik0000664000175000017500000001715615035744305017254 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Inuvik) { {-9223372036854775808 0 0 -00} {-536457600 -28800 0 PST} {73476000 -25200 1 PDT} {89197200 -28800 0 PST} {104925600 -25200 1 PDT} {120646800 -28800 0 PST} {136375200 -25200 1 PDT} {152096400 -28800 0 PST} {167824800 -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 -21600 0 MDT} {309945600 -25200 0 MST} {315558000 -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} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667721600 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Indianapolis0000664000175000017500000000034415035744305020410 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Indiana/Indianapolis)]} { LoadTimeZoneFile America/Indiana/Indianapolis } set TZData(:America/Indianapolis) $TZData(:America/Indiana/Indianapolis) tcl9.0.3/library/tzdata/America/Indiana/0000755000175000017500000000000015104662345017413 5ustar sergeisergeitcl9.0.3/library/tzdata/America/Indiana/Winamac0000664000175000017500000001600215035744305020716 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Winamac) { {-9223372036854775808 -20785 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747244800 -18000 1 CDT} {-733942800 -21600 0 CST} {-715795200 -18000 1 CDT} {-702493200 -21600 0 CST} {-684345600 -18000 1 CDT} {-671043600 -21600 0 CST} {-652896000 -18000 1 CDT} {-639594000 -21600 0 CST} {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-447267600 -21600 0 CST} {-431539200 -18000 1 CDT} {-415818000 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} {-292438800 -21600 0 CST} {-273686400 -18000 0 EST} {-31518000 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {31554000 -18000 0 EST} {1143961200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -14400 0 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Indiana/Vincennes0000664000175000017500000001552015035744305021273 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Vincennes) { {-9223372036854775808 -21007 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747244800 -18000 1 CDT} {-733942800 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-462996000 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-418237200 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} {-289414800 -21600 0 CST} {-273686400 -18000 1 CDT} {-260989200 -21600 0 CST} {-242236800 -18000 1 CDT} {-226515600 -21600 0 CST} {-210787200 -18000 1 CDT} {-195066000 -21600 0 CST} {-179337600 -18000 0 EST} {-31518000 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {31554000 -18000 0 EST} {1143961200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194163200 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Indiana/Vevay0000664000175000017500000001431615035744305020437 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Vevay) { {-9223372036854775808 -20416 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-495043200 -18000 0 EST} {-31518000 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {41410800 -14400 1 EDT} {57736800 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {94712400 -18000 0 EST} {1136091600 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Indiana/Tell_City0000664000175000017500000001532615035744305021237 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Tell_City) { {-9223372036854775808 -20823 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-462996000 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-418237200 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} {-292438800 -21600 0 CST} {-273686400 -18000 1 CDT} {-257965200 -21600 0 CST} {-242236800 -18000 1 CDT} {-226515600 -21600 0 CST} {-210787200 -18000 1 CDT} {-195066000 -21600 0 CST} {-179337600 -18000 0 EST} {-68662800 -21600 0 CST} {-52934400 -18000 1 CDT} {-37213200 -21600 0 CST} {-21484800 -14400 0 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {31554000 -18000 0 EST} {1143961200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Indiana/Petersburg0000664000175000017500000001630415035744305021466 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Petersburg) { {-9223372036854775808 -20947 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-473364000 -21600 0 CST} {-462996000 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-418237200 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} {-292438800 -21600 0 CST} {-273686400 -18000 1 CDT} {-257965200 -21600 0 CST} {-242236800 -18000 1 CDT} {-226515600 -21600 0 CST} {-210787200 -18000 1 CDT} {-195066000 -21600 0 CST} {-179337600 -18000 1 CDT} {-163616400 -21600 0 CST} {-147888000 -18000 0 EST} {-100112400 -21600 0 CST} {-84384000 -18000 1 CDT} {-68662800 -21600 0 CST} {-52934400 -18000 1 CDT} {-37213200 -21600 0 CST} {-21484800 -18000 1 CDT} {-5763600 -21600 0 CST} {9964800 -18000 1 CDT} {25686000 -21600 0 CST} {41414400 -18000 1 CDT} {57740400 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {126691200 -18000 1 CDT} {152089200 -21600 0 CST} {162374400 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247046400 -18000 0 EST} {1143961200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194163200 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Indiana/Marengo0000664000175000017500000001557515035744305020745 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Marengo) { {-9223372036854775808 -20723 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-599594400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} {-418237200 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} {-292438800 -21600 0 CST} {-273686400 -18000 0 EST} {-31518000 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {41410800 -14400 1 EDT} {57736800 -18000 0 EST} {73465200 -14400 1 EDT} {89186400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {126687600 -18000 1 CDT} {152089200 -18000 0 EST} {162370800 -14400 1 EDT} {183535200 -18000 0 EST} {189320400 -18000 0 EST} {1136091600 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Indiana/Knox0000664000175000017500000002042615035744305020263 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Knox) { {-9223372036854775808 -20790 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-725824800 -21600 0 CST} {-715795200 -18000 1 CDT} {-702493200 -21600 0 CST} {-684345600 -18000 1 CDT} {-671043600 -21600 0 CST} {-652896000 -18000 1 CDT} {-639594000 -21600 0 CST} {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-447267600 -21600 0 CST} {-431539200 -18000 1 CDT} {-415818000 -21600 0 CST} {-400089600 -18000 1 CDT} {-386787600 -21600 0 CST} {-368640000 -18000 1 CDT} {-355338000 -21600 0 CST} {-337190400 -18000 1 CDT} {-321469200 -21600 0 CST} {-305740800 -18000 1 CDT} {-289414800 -21600 0 CST} {-273686400 -18000 1 CDT} {-257965200 -21600 0 CST} {-242236800 -18000 0 EST} {-195066000 -21600 0 CST} {-84384000 -18000 1 CDT} {-68662800 -21600 0 CST} {-52934400 -18000 1 CDT} {-37213200 -21600 0 CST} {-21484800 -18000 1 CDT} {-5763600 -21600 0 CST} {9964800 -18000 1 CDT} {25686000 -21600 0 CST} {41414400 -18000 1 CDT} {57740400 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {126691200 -18000 1 CDT} {152089200 -21600 0 CST} {162374400 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688550400 -18000 0 EST} {1143961200 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Indiana/Indianapolis0000664000175000017500000001552415035744305021761 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Indiana/Indianapolis) { {-9223372036854775808 -20678 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-1577901600 -21600 0 CST} {-900259200 -18000 1 CDT} {-891795600 -21600 0 CST} {-883591200 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747244800 -18000 1 CDT} {-733942800 -21600 0 CST} {-715795200 -18000 1 CDT} {-702493200 -21600 0 CST} {-684345600 -18000 1 CDT} {-671043600 -21600 0 CST} {-652896000 -18000 1 CDT} {-639594000 -21600 0 CST} {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 0 EST} {-386787600 -21600 0 CST} {-368640000 -18000 0 EST} {-31518000 -18000 0 EST} {-21488400 -14400 1 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} {31554000 -18000 0 EST} {1136091600 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Hermosillo0000664000175000017500000000107115035744305020111 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Hermosillo) { {-9223372036854775808 -26632 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {-873828000 -25200 0 MST} {820479600 -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} {915174000 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Havana0000664000175000017500000002037415035744305017201 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Havana) { {-9223372036854775808 -19768 0 LMT} {-2524501832 -19776 0 HMT} {-1402813824 -18000 0 CST} {-1311534000 -14400 1 CDT} {-1300996800 -18000 0 CST} {-933534000 -14400 1 CDT} {-925675200 -18000 0 CST} {-902084400 -14400 1 CDT} {-893620800 -18000 0 CST} {-870030000 -14400 1 CDT} {-862171200 -18000 0 CST} {-775681200 -14400 1 CDT} {-767822400 -18000 0 CST} {-744231600 -14400 1 CDT} {-736372800 -18000 0 CST} {-144702000 -14400 1 CDT} {-134251200 -18000 0 CST} {-113425200 -14400 1 CDT} {-102542400 -18000 0 CST} {-86295600 -14400 1 CDT} {-72907200 -18000 0 CST} {-54154800 -14400 1 CDT} {-41457600 -18000 0 CST} {-21495600 -14400 1 CDT} {-5774400 -18000 0 CST} {9954000 -14400 1 CDT} {25675200 -18000 0 CST} {41403600 -14400 1 CDT} {57729600 -18000 0 CST} {73458000 -14400 1 CDT} {87364800 -18000 0 CST} {104907600 -14400 1 CDT} {118900800 -18000 0 CST} {136357200 -14400 1 CDT} {150436800 -18000 0 CST} {167806800 -14400 1 CDT} {183528000 -18000 0 CST} {199256400 -14400 1 CDT} {215582400 -18000 0 CST} {230706000 -14400 1 CDT} {247032000 -18000 0 CST} {263365200 -14400 1 CDT} {276667200 -18000 0 CST} {290581200 -14400 1 CDT} {308721600 -18000 0 CST} {322030800 -14400 1 CDT} {340171200 -18000 0 CST} {358318800 -14400 1 CDT} {371620800 -18000 0 CST} {389768400 -14400 1 CDT} {403070400 -18000 0 CST} {421218000 -14400 1 CDT} {434520000 -18000 0 CST} {452667600 -14400 1 CDT} {466574400 -18000 0 CST} {484117200 -14400 1 CDT} {498024000 -18000 0 CST} {511333200 -14400 1 CDT} {529473600 -18000 0 CST} {542782800 -14400 1 CDT} {560923200 -18000 0 CST} {574837200 -14400 1 CDT} {592372800 -18000 0 CST} {606286800 -14400 1 CDT} {623822400 -18000 0 CST} {638946000 -14400 1 CDT} {655876800 -18000 0 CST} {671000400 -14400 1 CDT} {687330000 -18000 0 CST} {702450000 -14400 1 CDT} {718779600 -18000 0 CST} {733899600 -14400 1 CDT} {750229200 -18000 0 CST} {765349200 -14400 1 CDT} {781678800 -18000 0 CST} {796798800 -14400 1 CDT} {813128400 -18000 0 CST} {828853200 -14400 1 CDT} {844578000 -18000 0 CST} {860302800 -14400 1 CDT} {876632400 -18000 0 CST} {891147600 -14400 1 CDT} {909291600 -18000 0 CST} {922597200 -14400 1 CDT} {941346000 -18000 0 CST} {954651600 -14400 1 CDT} {972795600 -18000 0 CST} {986101200 -14400 1 CDT} {1004245200 -18000 0 CST} {1018155600 -14400 1 CDT} {1035694800 -18000 0 CST} {1049605200 -14400 1 CDT} {1067144400 -18000 0 CST} {1080450000 -14400 1 CDT} {1162098000 -18000 0 CST} {1173589200 -14400 1 CDT} {1193547600 -18000 0 CST} {1205643600 -14400 1 CDT} {1224997200 -18000 0 CST} {1236488400 -14400 1 CDT} {1256446800 -18000 0 CST} {1268542800 -14400 1 CDT} {1288501200 -18000 0 CST} {1300597200 -14400 1 CDT} {1321160400 -18000 0 CST} {1333256400 -14400 1 CDT} {1352005200 -18000 0 CST} {1362891600 -14400 1 CDT} {1383454800 -18000 0 CST} {1394341200 -14400 1 CDT} {1414904400 -18000 0 CST} {1425790800 -14400 1 CDT} {1446354000 -18000 0 CST} {1457845200 -14400 1 CDT} {1478408400 -18000 0 CST} {1489294800 -14400 1 CDT} {1509858000 -18000 0 CST} {1520744400 -14400 1 CDT} {1541307600 -18000 0 CST} {1552194000 -14400 1 CDT} {1572757200 -18000 0 CST} {1583643600 -14400 1 CDT} {1604206800 -18000 0 CST} {1615698000 -14400 1 CDT} {1636261200 -18000 0 CST} {1647147600 -14400 1 CDT} {1667710800 -18000 0 CST} {1678597200 -14400 1 CDT} {1699160400 -18000 0 CST} {1710046800 -14400 1 CDT} {1730610000 -18000 0 CST} {1741496400 -14400 1 CDT} {1762059600 -18000 0 CST} {1772946000 -14400 1 CDT} {1793509200 -18000 0 CST} {1805000400 -14400 1 CDT} {1825563600 -18000 0 CST} {1836450000 -14400 1 CDT} {1857013200 -18000 0 CST} {1867899600 -14400 1 CDT} {1888462800 -18000 0 CST} {1899349200 -14400 1 CDT} {1919912400 -18000 0 CST} {1930798800 -14400 1 CDT} {1951362000 -18000 0 CST} {1962853200 -14400 1 CDT} {1983416400 -18000 0 CST} {1994302800 -14400 1 CDT} {2014866000 -18000 0 CST} {2025752400 -14400 1 CDT} {2046315600 -18000 0 CST} {2057202000 -14400 1 CDT} {2077765200 -18000 0 CST} {2088651600 -14400 1 CDT} {2109214800 -18000 0 CST} {2120101200 -14400 1 CDT} {2140664400 -18000 0 CST} {2152155600 -14400 1 CDT} {2172718800 -18000 0 CST} {2183605200 -14400 1 CDT} {2204168400 -18000 0 CST} {2215054800 -14400 1 CDT} {2235618000 -18000 0 CST} {2246504400 -14400 1 CDT} {2267067600 -18000 0 CST} {2277954000 -14400 1 CDT} {2298517200 -18000 0 CST} {2309403600 -14400 1 CDT} {2329966800 -18000 0 CST} {2341458000 -14400 1 CDT} {2362021200 -18000 0 CST} {2372907600 -14400 1 CDT} {2393470800 -18000 0 CST} {2404357200 -14400 1 CDT} {2424920400 -18000 0 CST} {2435806800 -14400 1 CDT} {2456370000 -18000 0 CST} {2467256400 -14400 1 CDT} {2487819600 -18000 0 CST} {2499310800 -14400 1 CDT} {2519874000 -18000 0 CST} {2530760400 -14400 1 CDT} {2551323600 -18000 0 CST} {2562210000 -14400 1 CDT} {2582773200 -18000 0 CST} {2593659600 -14400 1 CDT} {2614222800 -18000 0 CST} {2625109200 -14400 1 CDT} {2645672400 -18000 0 CST} {2656558800 -14400 1 CDT} {2677122000 -18000 0 CST} {2688613200 -14400 1 CDT} {2709176400 -18000 0 CST} {2720062800 -14400 1 CDT} {2740626000 -18000 0 CST} {2751512400 -14400 1 CDT} {2772075600 -18000 0 CST} {2782962000 -14400 1 CDT} {2803525200 -18000 0 CST} {2814411600 -14400 1 CDT} {2834974800 -18000 0 CST} {2846466000 -14400 1 CDT} {2867029200 -18000 0 CST} {2877915600 -14400 1 CDT} {2898478800 -18000 0 CST} {2909365200 -14400 1 CDT} {2929928400 -18000 0 CST} {2940814800 -14400 1 CDT} {2961378000 -18000 0 CST} {2972264400 -14400 1 CDT} {2992827600 -18000 0 CST} {3003714000 -14400 1 CDT} {3024277200 -18000 0 CST} {3035768400 -14400 1 CDT} {3056331600 -18000 0 CST} {3067218000 -14400 1 CDT} {3087781200 -18000 0 CST} {3098667600 -14400 1 CDT} {3119230800 -18000 0 CST} {3130117200 -14400 1 CDT} {3150680400 -18000 0 CST} {3161566800 -14400 1 CDT} {3182130000 -18000 0 CST} {3193016400 -14400 1 CDT} {3213579600 -18000 0 CST} {3225070800 -14400 1 CDT} {3245634000 -18000 0 CST} {3256520400 -14400 1 CDT} {3277083600 -18000 0 CST} {3287970000 -14400 1 CDT} {3308533200 -18000 0 CST} {3319419600 -14400 1 CDT} {3339982800 -18000 0 CST} {3350869200 -14400 1 CDT} {3371432400 -18000 0 CST} {3382923600 -14400 1 CDT} {3403486800 -18000 0 CST} {3414373200 -14400 1 CDT} {3434936400 -18000 0 CST} {3445822800 -14400 1 CDT} {3466386000 -18000 0 CST} {3477272400 -14400 1 CDT} {3497835600 -18000 0 CST} {3508722000 -14400 1 CDT} {3529285200 -18000 0 CST} {3540171600 -14400 1 CDT} {3560734800 -18000 0 CST} {3572226000 -14400 1 CDT} {3592789200 -18000 0 CST} {3603675600 -14400 1 CDT} {3624238800 -18000 0 CST} {3635125200 -14400 1 CDT} {3655688400 -18000 0 CST} {3666574800 -14400 1 CDT} {3687138000 -18000 0 CST} {3698024400 -14400 1 CDT} {3718587600 -18000 0 CST} {3730078800 -14400 1 CDT} {3750642000 -18000 0 CST} {3761528400 -14400 1 CDT} {3782091600 -18000 0 CST} {3792978000 -14400 1 CDT} {3813541200 -18000 0 CST} {3824427600 -14400 1 CDT} {3844990800 -18000 0 CST} {3855877200 -14400 1 CDT} {3876440400 -18000 0 CST} {3887326800 -14400 1 CDT} {3907890000 -18000 0 CST} {3919381200 -14400 1 CDT} {3939944400 -18000 0 CST} {3950830800 -14400 1 CDT} {3971394000 -18000 0 CST} {3982280400 -14400 1 CDT} {4002843600 -18000 0 CST} {4013730000 -14400 1 CDT} {4034293200 -18000 0 CST} {4045179600 -14400 1 CDT} {4065742800 -18000 0 CST} {4076629200 -14400 1 CDT} {4097192400 -18000 0 CST} } tcl9.0.3/library/tzdata/America/Halifax0000664000175000017500000002501315035744305017352 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Halifax) { {-9223372036854775808 -15264 0 LMT} {-2131645536 -14400 0 AST} {-1696276800 -10800 1 ADT} {-1680469200 -14400 0 AST} {-1640980800 -14400 0 AST} {-1632074400 -10800 1 ADT} {-1615143600 -14400 0 AST} {-1609444800 -14400 0 AST} {-1566763200 -10800 1 ADT} {-1557090000 -14400 0 AST} {-1535486400 -10800 1 ADT} {-1524949200 -14400 0 AST} {-1504468800 -10800 1 ADT} {-1493413200 -14400 0 AST} {-1472414400 -10800 1 ADT} {-1461963600 -14400 0 AST} {-1440964800 -10800 1 ADT} {-1429390800 -14400 0 AST} {-1409515200 -10800 1 ADT} {-1396731600 -14400 0 AST} {-1376856000 -10800 1 ADT} {-1366491600 -14400 0 AST} {-1346616000 -10800 1 ADT} {-1333832400 -14400 0 AST} {-1313956800 -10800 1 ADT} {-1303678800 -14400 0 AST} {-1282507200 -10800 1 ADT} {-1272661200 -14400 0 AST} {-1251057600 -10800 1 ADT} {-1240088400 -14400 0 AST} {-1219608000 -10800 1 ADT} {-1207429200 -14400 0 AST} {-1188763200 -10800 1 ADT} {-1175979600 -14400 0 AST} {-1157313600 -10800 1 ADT} {-1143925200 -14400 0 AST} {-1124049600 -10800 1 ADT} {-1113771600 -14400 0 AST} {-1091390400 -10800 1 ADT} {-1081026000 -14400 0 AST} {-1059854400 -10800 1 ADT} {-1050786000 -14400 0 AST} {-1030910400 -10800 1 ADT} {-1018126800 -14400 0 AST} {-999460800 -10800 1 ADT} {-986677200 -14400 0 AST} {-965592000 -10800 1 ADT} {-955227600 -14400 0 AST} {-935956800 -10800 1 ADT} {-923173200 -14400 0 AST} {-904507200 -10800 1 ADT} {-891723600 -14400 0 AST} {-880221600 -10800 0 AWT} {-769395600 -10800 1 APT} {-765399600 -14400 0 AST} {-757368000 -14400 0 AST} {-747252000 -10800 1 ADT} {-733950000 -14400 0 AST} {-715802400 -10800 1 ADT} {-702500400 -14400 0 AST} {-684352800 -10800 1 ADT} {-671050800 -14400 0 AST} {-652903200 -10800 1 ADT} {-639601200 -14400 0 AST} {-589399200 -10800 1 ADT} {-576097200 -14400 0 AST} {-557949600 -10800 1 ADT} {-544647600 -14400 0 AST} {-526500000 -10800 1 ADT} {-513198000 -14400 0 AST} {-495050400 -10800 1 ADT} {-481748400 -14400 0 AST} {-431546400 -10800 1 ADT} {-418244400 -14400 0 AST} {-400096800 -10800 1 ADT} {-386794800 -14400 0 AST} {-368647200 -10800 1 ADT} {-355345200 -14400 0 AST} {-337197600 -10800 1 ADT} {-323895600 -14400 0 AST} {-242244000 -10800 1 ADT} {-226522800 -14400 0 AST} {-210794400 -10800 1 ADT} {-195073200 -14400 0 AST} {-179344800 -10800 1 ADT} {-163623600 -14400 0 AST} {-147895200 -10800 1 ADT} {-131569200 -14400 0 AST} {-116445600 -10800 1 ADT} {-100119600 -14400 0 AST} {-84391200 -10800 1 ADT} {-68670000 -14400 0 AST} {-52941600 -10800 1 ADT} {-37220400 -14400 0 AST} {-21492000 -10800 1 ADT} {-5770800 -14400 0 AST} {9957600 -10800 1 ADT} {25678800 -14400 0 AST} {41407200 -10800 1 ADT} {57733200 -14400 0 AST} {73461600 -10800 1 ADT} {89182800 -14400 0 AST} {104911200 -10800 1 ADT} {120632400 -14400 0 AST} {126244800 -14400 0 AST} {136360800 -10800 1 ADT} {152082000 -14400 0 AST} {167810400 -10800 1 ADT} {183531600 -14400 0 AST} {199260000 -10800 1 ADT} {215586000 -14400 0 AST} {230709600 -10800 1 ADT} {247035600 -14400 0 AST} {262764000 -10800 1 ADT} {278485200 -14400 0 AST} {294213600 -10800 1 ADT} {309934800 -14400 0 AST} {325663200 -10800 1 ADT} {341384400 -14400 0 AST} {357112800 -10800 1 ADT} {372834000 -14400 0 AST} {388562400 -10800 1 ADT} {404888400 -14400 0 AST} {420012000 -10800 1 ADT} {436338000 -14400 0 AST} {452066400 -10800 1 ADT} {467787600 -14400 0 AST} {483516000 -10800 1 ADT} {499237200 -14400 0 AST} {514965600 -10800 1 ADT} {530686800 -14400 0 AST} {544600800 -10800 1 ADT} {562136400 -14400 0 AST} {576050400 -10800 1 ADT} {594190800 -14400 0 AST} {607500000 -10800 1 ADT} {625640400 -14400 0 AST} {638949600 -10800 1 ADT} {657090000 -14400 0 AST} {671004000 -10800 1 ADT} {688539600 -14400 0 AST} {702453600 -10800 1 ADT} {719989200 -14400 0 AST} {733903200 -10800 1 ADT} {752043600 -14400 0 AST} {765352800 -10800 1 ADT} {783493200 -14400 0 AST} {796802400 -10800 1 ADT} {814942800 -14400 0 AST} {828856800 -10800 1 ADT} {846392400 -14400 0 AST} {860306400 -10800 1 ADT} {877842000 -14400 0 AST} {891756000 -10800 1 ADT} {909291600 -14400 0 AST} {923205600 -10800 1 ADT} {941346000 -14400 0 AST} {954655200 -10800 1 ADT} {972795600 -14400 0 AST} {986104800 -10800 1 ADT} {1004245200 -14400 0 AST} {1018159200 -10800 1 ADT} {1035694800 -14400 0 AST} {1049608800 -10800 1 ADT} {1067144400 -14400 0 AST} {1081058400 -10800 1 ADT} {1099198800 -14400 0 AST} {1112508000 -10800 1 ADT} {1130648400 -14400 0 AST} {1143957600 -10800 1 ADT} {1162098000 -14400 0 AST} {1173592800 -10800 1 ADT} {1194152400 -14400 0 AST} {1205042400 -10800 1 ADT} {1225602000 -14400 0 AST} {1236492000 -10800 1 ADT} {1257051600 -14400 0 AST} {1268546400 -10800 1 ADT} {1289106000 -14400 0 AST} {1299996000 -10800 1 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Guyana0000664000175000017500000000036515035744305017225 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Guyana) { {-9223372036854775808 -13959 0 LMT} {-1843589241 -14400 0 -0400} {-1730577600 -13500 0 -0445} {176096700 -10800 0 -0300} {701841600 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Guayaquil0000664000175000017500000000036615035744305017743 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Guayaquil) { {-9223372036854775808 -19160 0 LMT} {-2524502440 -18840 0 QMT} {-1230749160 -18000 0 -0500} {722926800 -14400 1 -0400} {728884800 -18000 0 -0500} } tcl9.0.3/library/tzdata/America/Guatemala0000664000175000017500000000060115035744305017672 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Guatemala) { {-9223372036854775808 -21724 0 LMT} {-1617040676 -21600 0 CST} {123055200 -18000 1 CDT} {130914000 -21600 0 CST} {422344800 -18000 1 CDT} {433054800 -21600 0 CST} {669708000 -18000 1 CDT} {684219600 -21600 0 CST} {1146376800 -18000 1 CDT} {1159678800 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Guadeloupe0000664000175000017500000000030715035744305020067 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Guadeloupe) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Grenada0000664000175000017500000000030415035744305017333 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Grenada) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Grand_Turk0000664000175000017500000001615515035744305020045 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Grand_Turk) { {-9223372036854775808 -17072 0 LMT} {-2524504528 -18430 0 KMT} {-1827687170 -18000 0 EST} {284014800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941349600 -18000 0 EST} {954658800 -14400 1 EDT} {972799200 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 0 AST} {1520751600 -14400 0 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Goose_Bay0000664000175000017500000002343715035744305017655 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Goose_Bay) { {-9223372036854775808 -14500 0 LMT} {-2713895900 -12652 0 NST} {-1640982548 -12652 0 NST} {-1632076148 -9052 1 NDT} {-1615145348 -12652 0 NST} {-1609446548 -12652 0 NST} {-1096921748 -12600 0 NST} {-1072989000 -12600 0 NST} {-1061670600 -9000 1 NDT} {-1048973400 -12600 0 NST} {-1030221000 -9000 1 NDT} {-1017523800 -12600 0 NST} {-998771400 -9000 1 NDT} {-986074200 -12600 0 NST} {-966717000 -9000 1 NDT} {-954624600 -12600 0 NST} {-935267400 -9000 1 NDT} {-922570200 -12600 0 NST} {-903817800 -9000 1 NDT} {-891120600 -12600 0 NST} {-872368200 -9000 0 NWT} {-769395600 -9000 1 NPT} {-765401400 -12600 0 NST} {-757369800 -12600 0 NST} {-746044200 -9000 1 NDT} {-733347000 -12600 0 NST} {-714594600 -9000 1 NDT} {-701897400 -12600 0 NST} {-683145000 -9000 1 NDT} {-670447800 -12600 0 NST} {-651695400 -9000 1 NDT} {-638998200 -12600 0 NST} {-619641000 -9000 1 NDT} {-606943800 -12600 0 NST} {-589401000 -9000 1 NDT} {-576099000 -12600 0 NST} {-557951400 -9000 1 NDT} {-544649400 -12600 0 NST} {-526501800 -9000 1 NDT} {-513199800 -12600 0 NST} {-495052200 -9000 1 NDT} {-481750200 -12600 0 NST} {-463602600 -9000 1 NDT} {-450300600 -12600 0 NST} {-431548200 -9000 1 NDT} {-418246200 -12600 0 NST} {-400098600 -9000 1 NDT} {-386796600 -12600 0 NST} {-368649000 -9000 1 NDT} {-355347000 -12600 0 NST} {-337199400 -9000 1 NDT} {-323897400 -12600 0 NST} {-305749800 -9000 1 NDT} {-289423800 -12600 0 NST} {-273695400 -9000 1 NDT} {-257974200 -12600 0 NST} {-242245800 -9000 1 NDT} {-226524600 -12600 0 NST} {-210796200 -9000 1 NDT} {-195075000 -12600 0 NST} {-179346600 -9000 1 NDT} {-163625400 -12600 0 NST} {-147897000 -9000 1 NDT} {-131571000 -12600 0 NST} {-119903400 -14400 0 AST} {-116445600 -10800 1 ADT} {-100119600 -14400 0 AST} {-84391200 -10800 1 ADT} {-68670000 -14400 0 AST} {-52941600 -10800 1 ADT} {-37220400 -14400 0 AST} {-21492000 -10800 1 ADT} {-5770800 -14400 0 AST} {9957600 -10800 1 ADT} {25678800 -14400 0 AST} {41407200 -10800 1 ADT} {57733200 -14400 0 AST} {73461600 -10800 1 ADT} {89182800 -14400 0 AST} {104911200 -10800 1 ADT} {120632400 -14400 0 AST} {136360800 -10800 1 ADT} {152082000 -14400 0 AST} {167810400 -10800 1 ADT} {183531600 -14400 0 AST} {199260000 -10800 1 ADT} {215586000 -14400 0 AST} {230709600 -10800 1 ADT} {247035600 -14400 0 AST} {262764000 -10800 1 ADT} {278485200 -14400 0 AST} {294213600 -10800 1 ADT} {309934800 -14400 0 AST} {325663200 -10800 1 ADT} {341384400 -14400 0 AST} {357112800 -10800 1 ADT} {372834000 -14400 0 AST} {388562400 -10800 1 ADT} {404888400 -14400 0 AST} {420012000 -10800 1 ADT} {436338000 -14400 0 AST} {452066400 -10800 1 ADT} {467787600 -14400 0 AST} {483516000 -10800 1 ADT} {499237200 -14400 0 AST} {514965600 -10800 1 ADT} {530686800 -14400 0 AST} {544593660 -10800 1 ADT} {562129260 -14400 0 AST} {576043260 -7200 1 ADDT} {594180060 -14400 0 AST} {607492860 -10800 1 ADT} {625633260 -14400 0 AST} {638942460 -10800 1 ADT} {657082860 -14400 0 AST} {670996860 -10800 1 ADT} {688532460 -14400 0 AST} {702446460 -10800 1 ADT} {719982060 -14400 0 AST} {733896060 -10800 1 ADT} {752036460 -14400 0 AST} {765345660 -10800 1 ADT} {783486060 -14400 0 AST} {796795260 -10800 1 ADT} {814935660 -14400 0 AST} {828849660 -10800 1 ADT} {846385260 -14400 0 AST} {860299260 -10800 1 ADT} {877834860 -14400 0 AST} {891748860 -10800 1 ADT} {909284460 -14400 0 AST} {923198460 -10800 1 ADT} {941338860 -14400 0 AST} {954648060 -10800 1 ADT} {972788460 -14400 0 AST} {986097660 -10800 1 ADT} {1004238060 -14400 0 AST} {1018152060 -10800 1 ADT} {1035687660 -14400 0 AST} {1049601660 -10800 1 ADT} {1067137260 -14400 0 AST} {1081051260 -10800 1 ADT} {1099191660 -14400 0 AST} {1112500860 -10800 1 ADT} {1130641260 -14400 0 AST} {1143950460 -10800 1 ADT} {1162090860 -14400 0 AST} {1173585660 -10800 1 ADT} {1194145260 -14400 0 AST} {1205035260 -10800 1 ADT} {1225594860 -14400 0 AST} {1236484860 -10800 1 ADT} {1257044460 -14400 0 AST} {1268539260 -10800 1 ADT} {1289098860 -14400 0 AST} {1299988860 -10800 1 ADT} {1320116400 -10800 0 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Godthab0000664000175000017500000000025715035744305017351 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Nuuk)]} { LoadTimeZoneFile America/Nuuk } set TZData(:America/Godthab) $TZData(:America/Nuuk) tcl9.0.3/library/tzdata/America/Glace_Bay0000664000175000017500000001764315035744305017616 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Glace_Bay) { {-9223372036854775808 -14388 0 LMT} {-2131646412 -14400 0 AST} {-1632074400 -10800 1 ADT} {-1615143600 -14400 0 AST} {-880221600 -10800 1 AWT} {-769395600 -10800 1 APT} {-765399600 -14400 0 AST} {-536443200 -14400 0 AST} {-526500000 -10800 1 ADT} {-513198000 -14400 0 AST} {-504907200 -14400 0 AST} {63086400 -14400 0 AST} {73461600 -10800 1 ADT} {89182800 -14400 0 AST} {104911200 -10800 1 ADT} {120632400 -14400 0 AST} {126244800 -14400 0 AST} {136360800 -10800 1 ADT} {152082000 -14400 0 AST} {167810400 -10800 1 ADT} {183531600 -14400 0 AST} {199260000 -10800 1 ADT} {215586000 -14400 0 AST} {230709600 -10800 1 ADT} {247035600 -14400 0 AST} {262764000 -10800 1 ADT} {278485200 -14400 0 AST} {294213600 -10800 1 ADT} {309934800 -14400 0 AST} {325663200 -10800 1 ADT} {341384400 -14400 0 AST} {357112800 -10800 1 ADT} {372834000 -14400 0 AST} {388562400 -10800 1 ADT} {404888400 -14400 0 AST} {420012000 -10800 1 ADT} {436338000 -14400 0 AST} {452066400 -10800 1 ADT} {467787600 -14400 0 AST} {483516000 -10800 1 ADT} {499237200 -14400 0 AST} {514965600 -10800 1 ADT} {530686800 -14400 0 AST} {544600800 -10800 1 ADT} {562136400 -14400 0 AST} {576050400 -10800 1 ADT} {594190800 -14400 0 AST} {607500000 -10800 1 ADT} {625640400 -14400 0 AST} {638949600 -10800 1 ADT} {657090000 -14400 0 AST} {671004000 -10800 1 ADT} {688539600 -14400 0 AST} {702453600 -10800 1 ADT} {719989200 -14400 0 AST} {733903200 -10800 1 ADT} {752043600 -14400 0 AST} {765352800 -10800 1 ADT} {783493200 -14400 0 AST} {796802400 -10800 1 ADT} {814942800 -14400 0 AST} {828856800 -10800 1 ADT} {846392400 -14400 0 AST} {860306400 -10800 1 ADT} {877842000 -14400 0 AST} {891756000 -10800 1 ADT} {909291600 -14400 0 AST} {923205600 -10800 1 ADT} {941346000 -14400 0 AST} {954655200 -10800 1 ADT} {972795600 -14400 0 AST} {986104800 -10800 1 ADT} {1004245200 -14400 0 AST} {1018159200 -10800 1 ADT} {1035694800 -14400 0 AST} {1049608800 -10800 1 ADT} {1067144400 -14400 0 AST} {1081058400 -10800 1 ADT} {1099198800 -14400 0 AST} {1112508000 -10800 1 ADT} {1130648400 -14400 0 AST} {1143957600 -10800 1 ADT} {1162098000 -14400 0 AST} {1173592800 -10800 1 ADT} {1194152400 -14400 0 AST} {1205042400 -10800 1 ADT} {1225602000 -14400 0 AST} {1236492000 -10800 1 ADT} {1257051600 -14400 0 AST} {1268546400 -10800 1 ADT} {1289106000 -14400 0 AST} {1299996000 -10800 1 ADT} {1320555600 -14400 0 AST} {1331445600 -10800 1 ADT} {1352005200 -14400 0 AST} {1362895200 -10800 1 ADT} {1383454800 -14400 0 AST} {1394344800 -10800 1 ADT} {1414904400 -14400 0 AST} {1425794400 -10800 1 ADT} {1446354000 -14400 0 AST} {1457848800 -10800 1 ADT} {1478408400 -14400 0 AST} {1489298400 -10800 1 ADT} {1509858000 -14400 0 AST} {1520748000 -10800 1 ADT} {1541307600 -14400 0 AST} {1552197600 -10800 1 ADT} {1572757200 -14400 0 AST} {1583647200 -10800 1 ADT} {1604206800 -14400 0 AST} {1615701600 -10800 1 ADT} {1636261200 -14400 0 AST} {1647151200 -10800 1 ADT} {1667710800 -14400 0 AST} {1678600800 -10800 1 ADT} {1699160400 -14400 0 AST} {1710050400 -10800 1 ADT} {1730610000 -14400 0 AST} {1741500000 -10800 1 ADT} {1762059600 -14400 0 AST} {1772949600 -10800 1 ADT} {1793509200 -14400 0 AST} {1805004000 -10800 1 ADT} {1825563600 -14400 0 AST} {1836453600 -10800 1 ADT} {1857013200 -14400 0 AST} {1867903200 -10800 1 ADT} {1888462800 -14400 0 AST} {1899352800 -10800 1 ADT} {1919912400 -14400 0 AST} {1930802400 -10800 1 ADT} {1951362000 -14400 0 AST} {1962856800 -10800 1 ADT} {1983416400 -14400 0 AST} {1994306400 -10800 1 ADT} {2014866000 -14400 0 AST} {2025756000 -10800 1 ADT} {2046315600 -14400 0 AST} {2057205600 -10800 1 ADT} {2077765200 -14400 0 AST} {2088655200 -10800 1 ADT} {2109214800 -14400 0 AST} {2120104800 -10800 1 ADT} {2140664400 -14400 0 AST} {2152159200 -10800 1 ADT} {2172718800 -14400 0 AST} {2183608800 -10800 1 ADT} {2204168400 -14400 0 AST} {2215058400 -10800 1 ADT} {2235618000 -14400 0 AST} {2246508000 -10800 1 ADT} {2267067600 -14400 0 AST} {2277957600 -10800 1 ADT} {2298517200 -14400 0 AST} {2309407200 -10800 1 ADT} {2329966800 -14400 0 AST} {2341461600 -10800 1 ADT} {2362021200 -14400 0 AST} {2372911200 -10800 1 ADT} {2393470800 -14400 0 AST} {2404360800 -10800 1 ADT} {2424920400 -14400 0 AST} {2435810400 -10800 1 ADT} {2456370000 -14400 0 AST} {2467260000 -10800 1 ADT} {2487819600 -14400 0 AST} {2499314400 -10800 1 ADT} {2519874000 -14400 0 AST} {2530764000 -10800 1 ADT} {2551323600 -14400 0 AST} {2562213600 -10800 1 ADT} {2582773200 -14400 0 AST} {2593663200 -10800 1 ADT} {2614222800 -14400 0 AST} {2625112800 -10800 1 ADT} {2645672400 -14400 0 AST} {2656562400 -10800 1 ADT} {2677122000 -14400 0 AST} {2688616800 -10800 1 ADT} {2709176400 -14400 0 AST} {2720066400 -10800 1 ADT} {2740626000 -14400 0 AST} {2751516000 -10800 1 ADT} {2772075600 -14400 0 AST} {2782965600 -10800 1 ADT} {2803525200 -14400 0 AST} {2814415200 -10800 1 ADT} {2834974800 -14400 0 AST} {2846469600 -10800 1 ADT} {2867029200 -14400 0 AST} {2877919200 -10800 1 ADT} {2898478800 -14400 0 AST} {2909368800 -10800 1 ADT} {2929928400 -14400 0 AST} {2940818400 -10800 1 ADT} {2961378000 -14400 0 AST} {2972268000 -10800 1 ADT} {2992827600 -14400 0 AST} {3003717600 -10800 1 ADT} {3024277200 -14400 0 AST} {3035772000 -10800 1 ADT} {3056331600 -14400 0 AST} {3067221600 -10800 1 ADT} {3087781200 -14400 0 AST} {3098671200 -10800 1 ADT} {3119230800 -14400 0 AST} {3130120800 -10800 1 ADT} {3150680400 -14400 0 AST} {3161570400 -10800 1 ADT} {3182130000 -14400 0 AST} {3193020000 -10800 1 ADT} {3213579600 -14400 0 AST} {3225074400 -10800 1 ADT} {3245634000 -14400 0 AST} {3256524000 -10800 1 ADT} {3277083600 -14400 0 AST} {3287973600 -10800 1 ADT} {3308533200 -14400 0 AST} {3319423200 -10800 1 ADT} {3339982800 -14400 0 AST} {3350872800 -10800 1 ADT} {3371432400 -14400 0 AST} {3382927200 -10800 1 ADT} {3403486800 -14400 0 AST} {3414376800 -10800 1 ADT} {3434936400 -14400 0 AST} {3445826400 -10800 1 ADT} {3466386000 -14400 0 AST} {3477276000 -10800 1 ADT} {3497835600 -14400 0 AST} {3508725600 -10800 1 ADT} {3529285200 -14400 0 AST} {3540175200 -10800 1 ADT} {3560734800 -14400 0 AST} {3572229600 -10800 1 ADT} {3592789200 -14400 0 AST} {3603679200 -10800 1 ADT} {3624238800 -14400 0 AST} {3635128800 -10800 1 ADT} {3655688400 -14400 0 AST} {3666578400 -10800 1 ADT} {3687138000 -14400 0 AST} {3698028000 -10800 1 ADT} {3718587600 -14400 0 AST} {3730082400 -10800 1 ADT} {3750642000 -14400 0 AST} {3761532000 -10800 1 ADT} {3782091600 -14400 0 AST} {3792981600 -10800 1 ADT} {3813541200 -14400 0 AST} {3824431200 -10800 1 ADT} {3844990800 -14400 0 AST} {3855880800 -10800 1 ADT} {3876440400 -14400 0 AST} {3887330400 -10800 1 ADT} {3907890000 -14400 0 AST} {3919384800 -10800 1 ADT} {3939944400 -14400 0 AST} {3950834400 -10800 1 ADT} {3971394000 -14400 0 AST} {3982284000 -10800 1 ADT} {4002843600 -14400 0 AST} {4013733600 -10800 1 ADT} {4034293200 -14400 0 AST} {4045183200 -10800 1 ADT} {4065742800 -14400 0 AST} {4076632800 -10800 1 ADT} {4097192400 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Fort_Wayne0000664000175000017500000000034215035744305020051 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Indiana/Indianapolis)]} { LoadTimeZoneFile America/Indiana/Indianapolis } set TZData(:America/Fort_Wayne) $TZData(:America/Indiana/Indianapolis) tcl9.0.3/library/tzdata/America/Fort_Nelson0000664000175000017500000001051315035744305020225 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Fort_Nelson) { {-9223372036854775808 -29447 0 LMT} {-2713880953 -28800 0 PST} {-1632060000 -25200 1 PDT} {-1615129200 -28800 0 PST} {-880207200 -25200 1 PWT} {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-757353600 -28800 0 PST} {-725817600 -28800 0 PST} {-715788000 -25200 1 PDT} {-702486000 -28800 0 PST} {-684338400 -25200 1 PDT} {-671036400 -28800 0 PST} {-652888800 -25200 1 PDT} {-639586800 -28800 0 PST} {-620834400 -25200 1 PDT} {-608137200 -28800 0 PST} {-589384800 -25200 1 PDT} {-576082800 -28800 0 PST} {-557935200 -25200 1 PDT} {-544633200 -28800 0 PST} {-526485600 -25200 1 PDT} {-513183600 -28800 0 PST} {-495036000 -25200 1 PDT} {-481734000 -28800 0 PST} {-463586400 -25200 1 PDT} {-450284400 -28800 0 PST} {-431532000 -25200 1 PDT} {-418230000 -28800 0 PST} {-400082400 -25200 1 PDT} {-386780400 -28800 0 PST} {-368632800 -25200 1 PDT} {-355330800 -28800 0 PST} {-337183200 -25200 1 PDT} {-323881200 -28800 0 PST} {-305733600 -25200 1 PDT} {-292431600 -28800 0 PST} {-273679200 -25200 1 PDT} {-260982000 -28800 0 PST} {-242229600 -25200 1 PDT} {-226508400 -28800 0 PST} {-210780000 -25200 1 PDT} {-195058800 -28800 0 PST} {-179330400 -25200 1 PDT} {-163609200 -28800 0 PST} {-147880800 -25200 1 PDT} {-131554800 -28800 0 PST} {-116431200 -25200 1 PDT} {-100105200 -28800 0 PST} {-84376800 -25200 1 PDT} {-68655600 -28800 0 PST} {-52927200 -25200 1 PDT} {-37206000 -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} {136375200 -25200 1 PDT} {152096400 -28800 0 PST} {167824800 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {536486400 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1173607200 -25200 1 PDT} {1194166800 -28800 0 PST} {1205056800 -25200 1 PDT} {1225616400 -28800 0 PST} {1236506400 -25200 1 PDT} {1257066000 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Fortaleza0000664000175000017500000000266515035744305017735 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Fortaleza) { {-9223372036854775808 -9240 0 LMT} {-1767216360 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {653536800 -10800 0 -0300} {938660400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {972180000 -10800 0 -0300} {1000350000 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1033437600 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Ensenada0000664000175000017500000000027115035744305017513 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Tijuana)]} { LoadTimeZoneFile America/Tijuana } set TZData(:America/Ensenada) $TZData(:America/Tijuana) tcl9.0.3/library/tzdata/America/El_Salvador0000664000175000017500000000041515035744305020170 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/El_Salvador) { {-9223372036854775808 -21408 0 LMT} {-1546279392 -21600 0 CST} {547020000 -18000 1 CDT} {559717200 -21600 0 CST} {578469600 -18000 1 CDT} {591166800 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Eirunepe0000664000175000017500000000235515035744305017556 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Eirunepe) { {-9223372036854775808 -16768 0 LMT} {-1767208832 -18000 0 -0500} {-1206950400 -14400 1 -0400} {-1191355200 -18000 0 -0500} {-1175367600 -14400 1 -0400} {-1159819200 -18000 0 -0500} {-633812400 -14400 1 -0400} {-622062000 -18000 0 -0500} {-602276400 -14400 1 -0400} {-591825600 -18000 0 -0500} {-570740400 -14400 1 -0400} {-560203200 -18000 0 -0500} {-539118000 -14400 1 -0400} {-531345600 -18000 0 -0500} {-191358000 -14400 1 -0400} {-184190400 -18000 0 -0500} {-155156400 -14400 1 -0400} {-150062400 -18000 0 -0500} {-128890800 -14400 1 -0400} {-121118400 -18000 0 -0500} {-99946800 -14400 1 -0400} {-89582400 -18000 0 -0500} {-68410800 -14400 1 -0400} {-57960000 -18000 0 -0500} {499755600 -14400 1 -0400} {511243200 -18000 0 -0500} {530600400 -14400 1 -0400} {540273600 -18000 0 -0500} {562136400 -14400 1 -0400} {571204800 -18000 0 -0500} {590040000 -18000 0 -0500} {749192400 -18000 0 -0500} {750834000 -14400 1 -0400} {761716800 -18000 0 -0500} {780206400 -18000 0 -0500} {1214283600 -14400 0 -0400} {1384056000 -18000 0 -0500} } tcl9.0.3/library/tzdata/America/Edmonton0000664000175000017500000002020015035744305017552 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Edmonton) { {-9223372036854775808 -27232 0 LMT} {-1998663968 -25200 0 MST} {-1632063600 -21600 1 MDT} {-1615132800 -25200 0 MST} {-1600614000 -21600 1 MDT} {-1596816000 -25200 0 MST} {-1567954800 -21600 1 MDT} {-1551628800 -25200 0 MST} {-1536505200 -21600 1 MDT} {-1523203200 -25200 0 MST} {-1504450800 -21600 1 MDT} {-1491753600 -25200 0 MST} {-1473001200 -21600 1 MDT} {-1459699200 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} {-765388800 -25200 0 MST} {-715791600 -21600 1 MDT} {-702489600 -25200 0 MST} {73472400 -21600 1 MDT} {89193600 -25200 0 MST} {104922000 -21600 1 MDT} {120643200 -25200 0 MST} {136371600 -21600 1 MDT} {152092800 -25200 0 MST} {167821200 -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} {536482800 -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} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667721600 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Dominica0000664000175000017500000000030515035744305017516 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Dominica) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Detroit0000664000175000017500000001773315035744305017422 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Detroit) { {-9223372036854775808 -19931 0 LMT} {-2051202469 -21600 0 CST} {-1724083200 -18000 0 EST} {-883594800 -18000 0 EST} {-880218000 -14400 1 EWT} {-769395600 -14400 1 EPT} {-765396000 -18000 0 EST} {-757364400 -18000 0 EST} {-684349200 -14400 1 EDT} {-671047200 -18000 0 EST} {-80506740 -14400 0 EDT} {-68666400 -18000 0 EST} {-52938000 -14400 1 EDT} {-37216800 -18000 0 EST} {-31518000 -18000 0 EST} {94712400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} {126687600 -14400 1 EDT} {152085600 -18000 0 EST} {157784400 -18000 0 EST} {167814000 -14400 0 EDT} {183535200 -18000 0 EST} {199263600 -14400 1 EDT} {215589600 -18000 0 EST} {230713200 -14400 1 EDT} {247039200 -18000 0 EST} {262767600 -14400 1 EDT} {278488800 -18000 0 EST} {294217200 -14400 1 EDT} {309938400 -18000 0 EST} {325666800 -14400 1 EDT} {341388000 -18000 0 EST} {357116400 -14400 1 EDT} {372837600 -18000 0 EST} {388566000 -14400 1 EDT} {404892000 -18000 0 EST} {420015600 -14400 1 EDT} {436341600 -18000 0 EST} {452070000 -14400 1 EDT} {467791200 -18000 0 EST} {483519600 -14400 1 EDT} {499240800 -18000 0 EST} {514969200 -14400 1 EDT} {530690400 -18000 0 EST} {544604400 -14400 1 EDT} {562140000 -18000 0 EST} {576054000 -14400 1 EDT} {594194400 -18000 0 EST} {607503600 -14400 1 EDT} {625644000 -18000 0 EST} {638953200 -14400 1 EDT} {657093600 -18000 0 EST} {671007600 -14400 1 EDT} {688543200 -18000 0 EST} {702457200 -14400 1 EDT} {719992800 -18000 0 EST} {733906800 -14400 1 EDT} {752047200 -18000 0 EST} {765356400 -14400 1 EDT} {783496800 -18000 0 EST} {796806000 -14400 1 EDT} {814946400 -18000 0 EST} {828860400 -14400 1 EDT} {846396000 -18000 0 EST} {860310000 -14400 1 EDT} {877845600 -18000 0 EST} {891759600 -14400 1 EDT} {909295200 -18000 0 EST} {923209200 -14400 1 EDT} {941349600 -18000 0 EST} {954658800 -14400 1 EDT} {972799200 -18000 0 EST} {986108400 -14400 1 EDT} {1004248800 -18000 0 EST} {1018162800 -14400 1 EDT} {1035698400 -18000 0 EST} {1049612400 -14400 1 EDT} {1067148000 -18000 0 EST} {1081062000 -14400 1 EDT} {1099202400 -18000 0 EST} {1112511600 -14400 1 EDT} {1130652000 -18000 0 EST} {1143961200 -14400 1 EDT} {1162101600 -18000 0 EST} {1173596400 -14400 1 EDT} {1194156000 -18000 0 EST} {1205046000 -14400 1 EDT} {1225605600 -18000 0 EST} {1236495600 -14400 1 EDT} {1257055200 -18000 0 EST} {1268550000 -14400 1 EDT} {1289109600 -18000 0 EST} {1299999600 -14400 1 EDT} {1320559200 -18000 0 EST} {1331449200 -14400 1 EDT} {1352008800 -18000 0 EST} {1362898800 -14400 1 EDT} {1383458400 -18000 0 EST} {1394348400 -14400 1 EDT} {1414908000 -18000 0 EST} {1425798000 -14400 1 EDT} {1446357600 -18000 0 EST} {1457852400 -14400 1 EDT} {1478412000 -18000 0 EST} {1489302000 -14400 1 EDT} {1509861600 -18000 0 EST} {1520751600 -14400 1 EDT} {1541311200 -18000 0 EST} {1552201200 -14400 1 EDT} {1572760800 -18000 0 EST} {1583650800 -14400 1 EDT} {1604210400 -18000 0 EST} {1615705200 -14400 1 EDT} {1636264800 -18000 0 EST} {1647154800 -14400 1 EDT} {1667714400 -18000 0 EST} {1678604400 -14400 1 EDT} {1699164000 -18000 0 EST} {1710054000 -14400 1 EDT} {1730613600 -18000 0 EST} {1741503600 -14400 1 EDT} {1762063200 -18000 0 EST} {1772953200 -14400 1 EDT} {1793512800 -18000 0 EST} {1805007600 -14400 1 EDT} {1825567200 -18000 0 EST} {1836457200 -14400 1 EDT} {1857016800 -18000 0 EST} {1867906800 -14400 1 EDT} {1888466400 -18000 0 EST} {1899356400 -14400 1 EDT} {1919916000 -18000 0 EST} {1930806000 -14400 1 EDT} {1951365600 -18000 0 EST} {1962860400 -14400 1 EDT} {1983420000 -18000 0 EST} {1994310000 -14400 1 EDT} {2014869600 -18000 0 EST} {2025759600 -14400 1 EDT} {2046319200 -18000 0 EST} {2057209200 -14400 1 EDT} {2077768800 -18000 0 EST} {2088658800 -14400 1 EDT} {2109218400 -18000 0 EST} {2120108400 -14400 1 EDT} {2140668000 -18000 0 EST} {2152162800 -14400 1 EDT} {2172722400 -18000 0 EST} {2183612400 -14400 1 EDT} {2204172000 -18000 0 EST} {2215062000 -14400 1 EDT} {2235621600 -18000 0 EST} {2246511600 -14400 1 EDT} {2267071200 -18000 0 EST} {2277961200 -14400 1 EDT} {2298520800 -18000 0 EST} {2309410800 -14400 1 EDT} {2329970400 -18000 0 EST} {2341465200 -14400 1 EDT} {2362024800 -18000 0 EST} {2372914800 -14400 1 EDT} {2393474400 -18000 0 EST} {2404364400 -14400 1 EDT} {2424924000 -18000 0 EST} {2435814000 -14400 1 EDT} {2456373600 -18000 0 EST} {2467263600 -14400 1 EDT} {2487823200 -18000 0 EST} {2499318000 -14400 1 EDT} {2519877600 -18000 0 EST} {2530767600 -14400 1 EDT} {2551327200 -18000 0 EST} {2562217200 -14400 1 EDT} {2582776800 -18000 0 EST} {2593666800 -14400 1 EDT} {2614226400 -18000 0 EST} {2625116400 -14400 1 EDT} {2645676000 -18000 0 EST} {2656566000 -14400 1 EDT} {2677125600 -18000 0 EST} {2688620400 -14400 1 EDT} {2709180000 -18000 0 EST} {2720070000 -14400 1 EDT} {2740629600 -18000 0 EST} {2751519600 -14400 1 EDT} {2772079200 -18000 0 EST} {2782969200 -14400 1 EDT} {2803528800 -18000 0 EST} {2814418800 -14400 1 EDT} {2834978400 -18000 0 EST} {2846473200 -14400 1 EDT} {2867032800 -18000 0 EST} {2877922800 -14400 1 EDT} {2898482400 -18000 0 EST} {2909372400 -14400 1 EDT} {2929932000 -18000 0 EST} {2940822000 -14400 1 EDT} {2961381600 -18000 0 EST} {2972271600 -14400 1 EDT} {2992831200 -18000 0 EST} {3003721200 -14400 1 EDT} {3024280800 -18000 0 EST} {3035775600 -14400 1 EDT} {3056335200 -18000 0 EST} {3067225200 -14400 1 EDT} {3087784800 -18000 0 EST} {3098674800 -14400 1 EDT} {3119234400 -18000 0 EST} {3130124400 -14400 1 EDT} {3150684000 -18000 0 EST} {3161574000 -14400 1 EDT} {3182133600 -18000 0 EST} {3193023600 -14400 1 EDT} {3213583200 -18000 0 EST} {3225078000 -14400 1 EDT} {3245637600 -18000 0 EST} {3256527600 -14400 1 EDT} {3277087200 -18000 0 EST} {3287977200 -14400 1 EDT} {3308536800 -18000 0 EST} {3319426800 -14400 1 EDT} {3339986400 -18000 0 EST} {3350876400 -14400 1 EDT} {3371436000 -18000 0 EST} {3382930800 -14400 1 EDT} {3403490400 -18000 0 EST} {3414380400 -14400 1 EDT} {3434940000 -18000 0 EST} {3445830000 -14400 1 EDT} {3466389600 -18000 0 EST} {3477279600 -14400 1 EDT} {3497839200 -18000 0 EST} {3508729200 -14400 1 EDT} {3529288800 -18000 0 EST} {3540178800 -14400 1 EDT} {3560738400 -18000 0 EST} {3572233200 -14400 1 EDT} {3592792800 -18000 0 EST} {3603682800 -14400 1 EDT} {3624242400 -18000 0 EST} {3635132400 -14400 1 EDT} {3655692000 -18000 0 EST} {3666582000 -14400 1 EDT} {3687141600 -18000 0 EST} {3698031600 -14400 1 EDT} {3718591200 -18000 0 EST} {3730086000 -14400 1 EDT} {3750645600 -18000 0 EST} {3761535600 -14400 1 EDT} {3782095200 -18000 0 EST} {3792985200 -14400 1 EDT} {3813544800 -18000 0 EST} {3824434800 -14400 1 EDT} {3844994400 -18000 0 EST} {3855884400 -14400 1 EDT} {3876444000 -18000 0 EST} {3887334000 -14400 1 EDT} {3907893600 -18000 0 EST} {3919388400 -14400 1 EDT} {3939948000 -18000 0 EST} {3950838000 -14400 1 EDT} {3971397600 -18000 0 EST} {3982287600 -14400 1 EDT} {4002847200 -18000 0 EST} {4013737200 -14400 1 EDT} {4034296800 -18000 0 EST} {4045186800 -14400 1 EDT} {4065746400 -18000 0 EST} {4076636400 -14400 1 EDT} {4097196000 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Denver0000664000175000017500000002066515035744305017231 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Denver) { {-9223372036854775808 -25196 0 LMT} {-2717643600 -25200 0 MST} {-1633273200 -21600 1 MDT} {-1615132800 -25200 0 MST} {-1601823600 -21600 1 MDT} {-1583683200 -25200 0 MST} {-1577898000 -25200 0 MST} {-1570374000 -21600 1 MDT} {-1551628800 -25200 0 MST} {-1538924400 -21600 1 MDT} {-1534089600 -25200 0 MST} {-883587600 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} {-765388800 -25200 0 MST} {-757357200 -25200 0 MST} {-147884400 -21600 1 MDT} {-131558400 -25200 0 MST} {-116434800 -21600 1 MDT} {-100108800 -25200 0 MST} {-94669200 -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} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667721600 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Dawson_Creek0000664000175000017500000000352415035744305020345 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Dawson_Creek) { {-9223372036854775808 -28856 0 LMT} {-2713881544 -28800 0 PST} {-1632060000 -25200 1 PDT} {-1615129200 -28800 0 PST} {-880207200 -25200 1 PWT} {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-725817600 -28800 0 PST} {-715788000 -25200 1 PDT} {-702486000 -28800 0 PST} {-684338400 -25200 1 PDT} {-671036400 -28800 0 PST} {-652888800 -25200 1 PDT} {-639586800 -28800 0 PST} {-620834400 -25200 1 PDT} {-608137200 -28800 0 PST} {-589384800 -25200 1 PDT} {-576082800 -28800 0 PST} {-557935200 -25200 1 PDT} {-544633200 -28800 0 PST} {-526485600 -25200 1 PDT} {-513183600 -28800 0 PST} {-495036000 -25200 1 PDT} {-481734000 -28800 0 PST} {-463586400 -25200 1 PDT} {-450284400 -28800 0 PST} {-431532000 -25200 1 PDT} {-418230000 -28800 0 PST} {-400082400 -25200 1 PDT} {-386780400 -28800 0 PST} {-368632800 -25200 1 PDT} {-355330800 -28800 0 PST} {-337183200 -25200 1 PDT} {-323881200 -28800 0 PST} {-305733600 -25200 1 PDT} {-292431600 -28800 0 PST} {-273679200 -25200 1 PDT} {-260982000 -28800 0 PST} {-242229600 -25200 1 PDT} {-226508400 -28800 0 PST} {-210780000 -25200 1 PDT} {-195058800 -28800 0 PST} {-179330400 -25200 1 PDT} {-163609200 -28800 0 PST} {-147880800 -25200 1 PDT} {-131554800 -28800 0 PST} {-116431200 -25200 1 PDT} {-100105200 -28800 0 PST} {-84376800 -25200 1 PDT} {-68655600 -28800 0 PST} {-52927200 -25200 1 PDT} {-37206000 -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} {84016800 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Dawson0000664000175000017500000000556015035744305017236 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Dawson) { {-9223372036854775808 -33460 0 LMT} {-2188996940 -32400 0 YST} {-1632056400 -28800 1 YDT} {-1615125600 -32400 0 YST} {-1596978000 -28800 1 YDT} {-1583164800 -32400 0 YST} {-880203600 -28800 1 YWT} {-769395600 -28800 1 YPT} {-765381600 -32400 0 YST} {-157734000 -32400 0 YST} {-147884400 -25200 1 YDDT} {-131554800 -32400 0 YST} {120646800 -28800 0 PST} {315561600 -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} {436352400 -28800 0 PST} {452080800 -25200 1 PDT} {467802000 -28800 0 PST} {483530400 -25200 1 PDT} {499251600 -28800 0 PST} {514980000 -25200 1 PDT} {530701200 -28800 0 PST} {544615200 -25200 1 PDT} {562150800 -28800 0 PST} {576064800 -25200 1 PDT} {594205200 -28800 0 PST} {607514400 -25200 1 PDT} {625654800 -28800 0 PST} {638964000 -25200 1 PDT} {657104400 -28800 0 PST} {671018400 -25200 1 PDT} {688554000 -28800 0 PST} {702468000 -25200 1 PDT} {720003600 -28800 0 PST} {733917600 -25200 1 PDT} {752058000 -28800 0 PST} {765367200 -25200 1 PDT} {783507600 -28800 0 PST} {796816800 -25200 1 PDT} {814957200 -28800 0 PST} {828871200 -25200 1 PDT} {846406800 -28800 0 PST} {860320800 -25200 1 PDT} {877856400 -28800 0 PST} {891770400 -25200 1 PDT} {909306000 -28800 0 PST} {923220000 -25200 1 PDT} {941360400 -28800 0 PST} {954669600 -25200 1 PDT} {972810000 -28800 0 PST} {986119200 -25200 1 PDT} {1004259600 -28800 0 PST} {1018173600 -25200 1 PDT} {1035709200 -28800 0 PST} {1049623200 -25200 1 PDT} {1067158800 -28800 0 PST} {1081072800 -25200 1 PDT} {1099213200 -28800 0 PST} {1112522400 -25200 1 PDT} {1130662800 -28800 0 PST} {1143972000 -25200 1 PDT} {1162112400 -28800 0 PST} {1173607200 -25200 1 PDT} {1194166800 -28800 0 PST} {1205056800 -25200 1 PDT} {1225616400 -28800 0 PST} {1236506400 -25200 1 PDT} {1257066000 -28800 0 PST} {1268560800 -25200 1 PDT} {1289120400 -28800 0 PST} {1300010400 -25200 1 PDT} {1320570000 -28800 0 PST} {1331460000 -25200 1 PDT} {1352019600 -28800 0 PST} {1362909600 -25200 1 PDT} {1383469200 -28800 0 PST} {1394359200 -25200 1 PDT} {1414918800 -28800 0 PST} {1425808800 -25200 1 PDT} {1446368400 -28800 0 PST} {1457863200 -25200 1 PDT} {1478422800 -28800 0 PST} {1489312800 -25200 1 PDT} {1509872400 -28800 0 PST} {1520762400 -25200 1 PDT} {1541322000 -28800 0 PST} {1552212000 -25200 1 PDT} {1572771600 -28800 0 PST} {1583661600 -25200 1 PDT} {1604217600 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Danmarkshavn0000664000175000017500000000220315035744305020407 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Danmarkshavn) { {-9223372036854775808 -4480 0 LMT} {-1686091520 -10800 0 -0300} {323845200 -7200 0 -0200} {338950800 -10800 0 -0300} {354675600 -7200 1 -0200} {370400400 -10800 0 -0300} {386125200 -7200 1 -0200} {401850000 -10800 0 -0300} {417574800 -7200 1 -0200} {433299600 -10800 0 -0300} {449024400 -7200 1 -0200} {465354000 -10800 0 -0300} {481078800 -7200 1 -0200} {496803600 -10800 0 -0300} {512528400 -7200 1 -0200} {528253200 -10800 0 -0300} {543978000 -7200 1 -0200} {559702800 -10800 0 -0300} {575427600 -7200 1 -0200} {591152400 -10800 0 -0300} {606877200 -7200 1 -0200} {622602000 -10800 0 -0300} {638326800 -7200 1 -0200} {654656400 -10800 0 -0300} {670381200 -7200 1 -0200} {686106000 -10800 0 -0300} {701830800 -7200 1 -0200} {717555600 -10800 0 -0300} {733280400 -7200 1 -0200} {749005200 -10800 0 -0300} {764730000 -7200 1 -0200} {780454800 -10800 0 -0300} {796179600 -7200 1 -0200} {811904400 -10800 0 -0300} {820465200 0 0 GMT} } tcl9.0.3/library/tzdata/America/Curacao0000664000175000017500000000030415035744305017347 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Curacao) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Cuiaba0000664000175000017500000000566615035744305017176 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Cuiaba) { {-9223372036854775808 -13460 0 LMT} {-1767212140 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {592977600 -10800 1 -0300} {602046000 -14400 0 -0400} {624427200 -10800 1 -0300} {634705200 -14400 0 -0400} {656481600 -10800 1 -0300} {666759600 -14400 0 -0400} {687931200 -10800 1 -0300} {697604400 -14400 0 -0400} {719985600 -10800 1 -0300} {728449200 -14400 0 -0400} {750830400 -10800 1 -0300} {761713200 -14400 0 -0400} {782280000 -10800 1 -0300} {793162800 -14400 0 -0400} {813729600 -10800 1 -0300} {824007600 -14400 0 -0400} {844574400 -10800 1 -0300} {856062000 -14400 0 -0400} {876110400 -10800 1 -0300} {888721200 -14400 0 -0400} {908078400 -10800 1 -0300} {919566000 -14400 0 -0400} {938923200 -10800 1 -0300} {951620400 -14400 0 -0400} {970977600 -10800 1 -0300} {982465200 -14400 0 -0400} {1003032000 -10800 1 -0300} {1013914800 -14400 0 -0400} {1036296000 -10800 1 -0300} {1045364400 -14400 0 -0400} {1064372400 -14400 0 -0400} {1096603200 -14400 0 -0400} {1099368000 -10800 1 -0300} {1108868400 -14400 0 -0400} {1129435200 -10800 1 -0300} {1140318000 -14400 0 -0400} {1162699200 -10800 1 -0300} {1172372400 -14400 0 -0400} {1192334400 -10800 1 -0300} {1203217200 -14400 0 -0400} {1224388800 -10800 1 -0300} {1234666800 -14400 0 -0400} {1255838400 -10800 1 -0300} {1266721200 -14400 0 -0400} {1287288000 -10800 1 -0300} {1298170800 -14400 0 -0400} {1318737600 -10800 1 -0300} {1330225200 -14400 0 -0400} {1350792000 -10800 1 -0300} {1361070000 -14400 0 -0400} {1382241600 -10800 1 -0300} {1392519600 -14400 0 -0400} {1413691200 -10800 1 -0300} {1424574000 -14400 0 -0400} {1445140800 -10800 1 -0300} {1456023600 -14400 0 -0400} {1476590400 -10800 1 -0300} {1487473200 -14400 0 -0400} {1508040000 -10800 1 -0300} {1518922800 -14400 0 -0400} {1541304000 -10800 1 -0300} {1550372400 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Creston0000664000175000017500000000027015035744305017411 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Phoenix)]} { LoadTimeZoneFile America/Phoenix } set TZData(:America/Creston) $TZData(:America/Phoenix) tcl9.0.3/library/tzdata/America/Coyhaique0000664000175000017500000001037115076154260017726 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Coyhaique) { {-9223372036854775808 -17296 0 LMT} {-2524504304 -16965 0 SMT} {-1892661435 -18000 0 -0500} {-1688410800 -16965 0 SMT} {-1619205435 -14400 0 -0400} {-1593806400 -16965 0 SMT} {-1335986235 -18000 0 -0500} {-1335985200 -14400 1 -0400} {-1317585600 -18000 0 -0500} {-1304362800 -14400 1 -0400} {-1286049600 -18000 0 -0500} {-1272826800 -14400 1 -0400} {-1254513600 -18000 0 -0500} {-1241290800 -14400 1 -0400} {-1222977600 -18000 0 -0500} {-1209754800 -14400 1 -0400} {-1191355200 -18000 0 -0500} {-1178132400 -14400 0 -0400} {-870552000 -18000 0 -0500} {-865278000 -14400 0 -0400} {-736632000 -14400 1 -0400} {-718056000 -18000 0 -0500} {-713649600 -14400 0 -0400} {-36619200 -10800 1 -0300} {-23922000 -14400 0 -0400} {-3355200 -10800 1 -0300} {7527600 -14400 0 -0400} {24465600 -10800 1 -0300} {37767600 -14400 0 -0400} {55915200 -10800 1 -0300} {69217200 -14400 0 -0400} {87969600 -10800 1 -0300} {100666800 -14400 0 -0400} {118209600 -10800 1 -0300} {132116400 -14400 0 -0400} {150868800 -10800 1 -0300} {163566000 -14400 0 -0400} {182318400 -10800 1 -0300} {195620400 -14400 0 -0400} {213768000 -10800 1 -0300} {227070000 -14400 0 -0400} {245217600 -10800 1 -0300} {258519600 -14400 0 -0400} {277272000 -10800 1 -0300} {289969200 -14400 0 -0400} {308721600 -10800 1 -0300} {321418800 -14400 0 -0400} {340171200 -10800 1 -0300} {353473200 -14400 0 -0400} {371620800 -10800 1 -0300} {384922800 -14400 0 -0400} {403070400 -10800 1 -0300} {416372400 -14400 0 -0400} {434520000 -10800 1 -0300} {447822000 -14400 0 -0400} {466574400 -10800 1 -0300} {479271600 -14400 0 -0400} {498024000 -10800 1 -0300} {510721200 -14400 0 -0400} {529473600 -10800 1 -0300} {545194800 -14400 0 -0400} {560923200 -10800 1 -0300} {574225200 -14400 0 -0400} {592372800 -10800 1 -0300} {605674800 -14400 0 -0400} {624427200 -10800 1 -0300} {637124400 -14400 0 -0400} {653457600 -10800 1 -0300} {668574000 -14400 0 -0400} {687326400 -10800 1 -0300} {700628400 -14400 0 -0400} {718776000 -10800 1 -0300} {732078000 -14400 0 -0400} {750225600 -10800 1 -0300} {763527600 -14400 0 -0400} {781675200 -10800 1 -0300} {794977200 -14400 0 -0400} {813729600 -10800 1 -0300} {826426800 -14400 0 -0400} {845179200 -10800 1 -0300} {859690800 -14400 0 -0400} {876628800 -10800 1 -0300} {889930800 -14400 0 -0400} {906868800 -10800 1 -0300} {923194800 -14400 0 -0400} {939528000 -10800 1 -0300} {952830000 -14400 0 -0400} {971582400 -10800 1 -0300} {984279600 -14400 0 -0400} {1003032000 -10800 1 -0300} {1015729200 -14400 0 -0400} {1034481600 -10800 1 -0300} {1047178800 -14400 0 -0400} {1065931200 -10800 1 -0300} {1079233200 -14400 0 -0400} {1097380800 -10800 1 -0300} {1110682800 -14400 0 -0400} {1128830400 -10800 1 -0300} {1142132400 -14400 0 -0400} {1160884800 -10800 1 -0300} {1173582000 -14400 0 -0400} {1192334400 -10800 1 -0300} {1206846000 -14400 0 -0400} {1223784000 -10800 1 -0300} {1237086000 -14400 0 -0400} {1255233600 -10800 1 -0300} {1270350000 -14400 0 -0400} {1286683200 -10800 1 -0300} {1304823600 -14400 0 -0400} {1313899200 -10800 1 -0300} {1335668400 -14400 0 -0400} {1346558400 -10800 1 -0300} {1367118000 -14400 0 -0400} {1378612800 -10800 1 -0300} {1398567600 -14400 0 -0400} {1410062400 -10800 1 -0300} {1463281200 -14400 0 -0400} {1471147200 -10800 1 -0300} {1494730800 -14400 0 -0400} {1502596800 -10800 1 -0300} {1526180400 -14400 0 -0400} {1534046400 -10800 1 -0300} {1554606000 -14400 0 -0400} {1567915200 -10800 1 -0300} {1586055600 -14400 0 -0400} {1599364800 -10800 1 -0300} {1617505200 -14400 0 -0400} {1630814400 -10800 1 -0300} {1648954800 -14400 0 -0400} {1662868800 -10800 1 -0300} {1680404400 -14400 0 -0400} {1693713600 -10800 1 -0300} {1712458800 -14400 0 -0400} {1725768000 -10800 1 -0300} {1742439600 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Costa_Rica0000664000175000017500000000064015035744305020004 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Costa_Rica) { {-9223372036854775808 -20173 0 LMT} {-2524501427 -20173 0 SJMT} {-1545071027 -21600 0 CST} {288770400 -18000 1 CDT} {297234000 -21600 0 CST} {320220000 -18000 1 CDT} {328683600 -21600 0 CST} {664264800 -18000 1 CDT} {678344400 -21600 0 CST} {695714400 -18000 1 CDT} {700635600 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Cordoba0000664000175000017500000000032615035744305017347 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Cordoba)]} { LoadTimeZoneFile America/Argentina/Cordoba } set TZData(:America/Cordoba) $TZData(:America/Argentina/Cordoba) tcl9.0.3/library/tzdata/America/Coral_Harbour0000664000175000017500000000027315035744305020521 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Panama)]} { LoadTimeZoneFile America/Panama } set TZData(:America/Coral_Harbour) $TZData(:America/Panama) tcl9.0.3/library/tzdata/America/Ciudad_Juarez0000664000175000017500000001500115035744305020503 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Ciudad_Juarez) { {-9223372036854775808 -25556 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {820476000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {883634400 -21600 0 CST} {891766800 -21600 0 MDT} {909302400 -25200 0 MST} {923216400 -21600 1 MDT} {941356800 -25200 0 MST} {954666000 -21600 1 MDT} {972806400 -25200 0 MST} {989139600 -21600 1 MDT} {1001836800 -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} {1175418000 -21600 1 MDT} {1193558400 -25200 0 MST} {1207472400 -21600 1 MDT} {1225008000 -25200 0 MST} {1238922000 -21600 1 MDT} {1256457600 -25200 0 MST} {1262329200 -25200 0 MST} {1268557200 -21600 1 MDT} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667120400 -21600 0 CST} {1669788000 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Chihuahua0000664000175000017500000000366515035744305017706 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Chihuahua) { {-9223372036854775808 -25460 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {820476000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {883634400 -21600 0 CST} {891766800 -21600 0 MDT} {909302400 -25200 0 MST} {923216400 -21600 1 MDT} {941356800 -25200 0 MST} {954666000 -21600 1 MDT} {972806400 -25200 0 MST} {989139600 -21600 1 MDT} {1001836800 -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} {1175418000 -21600 1 MDT} {1193558400 -25200 0 MST} {1207472400 -21600 1 MDT} {1225008000 -25200 0 MST} {1238922000 -21600 1 MDT} {1256457600 -25200 0 MST} {1270371600 -21600 1 MDT} {1288512000 -25200 0 MST} {1301821200 -21600 1 MDT} {1319961600 -25200 0 MST} {1333270800 -21600 1 MDT} {1351411200 -25200 0 MST} {1365325200 -21600 1 MDT} {1382860800 -25200 0 MST} {1396774800 -21600 1 MDT} {1414310400 -25200 0 MST} {1428224400 -21600 1 MDT} {1445760000 -25200 0 MST} {1459674000 -21600 1 MDT} {1477814400 -25200 0 MST} {1491123600 -21600 1 MDT} {1509264000 -25200 0 MST} {1522573200 -21600 1 MDT} {1540713600 -25200 0 MST} {1554627600 -21600 1 MDT} {1572163200 -25200 0 MST} {1586077200 -21600 1 MDT} {1603612800 -25200 0 MST} {1617526800 -21600 1 MDT} {1635667200 -25200 0 MST} {1648976400 -21600 1 MDT} {1667120400 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Chicago0000664000175000017500000002537315035744305017344 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Chicago) { {-9223372036854775808 -21036 0 LMT} {-2717647200 -21600 0 CST} {-1633276800 -18000 1 CDT} {-1615136400 -21600 0 CST} {-1601827200 -18000 1 CDT} {-1583686800 -21600 0 CST} {-1577901600 -21600 0 CST} {-1563724800 -18000 1 CDT} {-1551632400 -21600 0 CST} {-1538928000 -18000 1 CDT} {-1520182800 -21600 0 CST} {-1504454400 -18000 1 CDT} {-1491757200 -21600 0 CST} {-1473004800 -18000 1 CDT} {-1459702800 -21600 0 CST} {-1441555200 -18000 1 CDT} {-1428253200 -21600 0 CST} {-1410105600 -18000 1 CDT} {-1396803600 -21600 0 CST} {-1378656000 -18000 1 CDT} {-1365354000 -21600 0 CST} {-1347206400 -18000 1 CDT} {-1333904400 -21600 0 CST} {-1315152000 -18000 1 CDT} {-1301850000 -21600 0 CST} {-1283702400 -18000 1 CDT} {-1270400400 -21600 0 CST} {-1252252800 -18000 1 CDT} {-1238950800 -21600 0 CST} {-1220803200 -18000 1 CDT} {-1207501200 -21600 0 CST} {-1189353600 -18000 1 CDT} {-1176051600 -21600 0 CST} {-1157299200 -18000 1 CDT} {-1144602000 -21600 0 CST} {-1125849600 -18000 1 CDT} {-1112547600 -21600 0 CST} {-1094400000 -18000 1 CDT} {-1081098000 -21600 0 CST} {-1067788800 -18000 0 EST} {-1045414800 -21600 0 CST} {-1031500800 -18000 1 CDT} {-1018198800 -21600 0 CST} {-1000051200 -18000 1 CDT} {-986749200 -21600 0 CST} {-967996800 -18000 1 CDT} {-955299600 -21600 0 CST} {-936547200 -18000 1 CDT} {-923245200 -21600 0 CST} {-905097600 -18000 1 CDT} {-891795600 -21600 0 CST} {-883591200 -21600 0 CST} {-880214400 -18000 1 CWT} {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} {-747244800 -18000 1 CDT} {-733942800 -21600 0 CST} {-715795200 -18000 1 CDT} {-702493200 -21600 0 CST} {-684345600 -18000 1 CDT} {-671043600 -21600 0 CST} {-652896000 -18000 1 CDT} {-639594000 -21600 0 CST} {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} {-557942400 -18000 1 CDT} {-544640400 -21600 0 CST} {-526492800 -18000 1 CDT} {-513190800 -21600 0 CST} {-495043200 -18000 1 CDT} {-481741200 -21600 0 CST} {-463593600 -18000 1 CDT} {-447267600 -21600 0 CST} {-431539200 -18000 1 CDT} {-415818000 -21600 0 CST} {-400089600 -18000 1 CDT} {-384368400 -21600 0 CST} {-368640000 -18000 1 CDT} {-352918800 -21600 0 CST} {-337190400 -18000 1 CDT} {-321469200 -21600 0 CST} {-305740800 -18000 1 CDT} {-289414800 -21600 0 CST} {-273686400 -18000 1 CDT} {-257965200 -21600 0 CST} {-242236800 -18000 1 CDT} {-226515600 -21600 0 CST} {-210787200 -18000 1 CDT} {-195066000 -21600 0 CST} {-179337600 -18000 1 CDT} {-163616400 -21600 0 CST} {-147888000 -18000 1 CDT} {-131562000 -21600 0 CST} {-116438400 -18000 1 CDT} {-100112400 -21600 0 CST} {-94672800 -21600 0 CST} {-84384000 -18000 1 CDT} {-68662800 -21600 0 CST} {-52934400 -18000 1 CDT} {-37213200 -21600 0 CST} {-21484800 -18000 1 CDT} {-5763600 -21600 0 CST} {9964800 -18000 1 CDT} {25686000 -21600 0 CST} {41414400 -18000 1 CDT} {57740400 -21600 0 CST} {73468800 -18000 1 CDT} {89190000 -21600 0 CST} {104918400 -18000 1 CDT} {120639600 -21600 0 CST} {126691200 -18000 1 CDT} {152089200 -21600 0 CST} {162374400 -18000 1 CDT} {183538800 -21600 0 CST} {199267200 -18000 1 CDT} {215593200 -21600 0 CST} {230716800 -18000 1 CDT} {247042800 -21600 0 CST} {262771200 -18000 1 CDT} {278492400 -21600 0 CST} {294220800 -18000 1 CDT} {309942000 -21600 0 CST} {325670400 -18000 1 CDT} {341391600 -21600 0 CST} {357120000 -18000 1 CDT} {372841200 -21600 0 CST} {388569600 -18000 1 CDT} {404895600 -21600 0 CST} {420019200 -18000 1 CDT} {436345200 -21600 0 CST} {452073600 -18000 1 CDT} {467794800 -21600 0 CST} {483523200 -18000 1 CDT} {499244400 -21600 0 CST} {514972800 -18000 1 CDT} {530694000 -21600 0 CST} {544608000 -18000 1 CDT} {562143600 -21600 0 CST} {576057600 -18000 1 CDT} {594198000 -21600 0 CST} {607507200 -18000 1 CDT} {625647600 -21600 0 CST} {638956800 -18000 1 CDT} {657097200 -21600 0 CST} {671011200 -18000 1 CDT} {688546800 -21600 0 CST} {702460800 -18000 1 CDT} {719996400 -21600 0 CST} {733910400 -18000 1 CDT} {752050800 -21600 0 CST} {765360000 -18000 1 CDT} {783500400 -21600 0 CST} {796809600 -18000 1 CDT} {814950000 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877849200 -21600 0 CST} {891763200 -18000 1 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {986112000 -18000 1 CDT} {1004252400 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1173600000 -18000 1 CDT} {1194159600 -21600 0 CST} {1205049600 -18000 1 CDT} {1225609200 -21600 0 CST} {1236499200 -18000 1 CDT} {1257058800 -21600 0 CST} {1268553600 -18000 1 CDT} {1289113200 -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} } tcl9.0.3/library/tzdata/America/Cayman0000664000175000017500000000026415035744305017207 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Panama)]} { LoadTimeZoneFile America/Panama } set TZData(:America/Cayman) $TZData(:America/Panama) tcl9.0.3/library/tzdata/America/Cayenne0000664000175000017500000000026615035744305017363 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Cayenne) { {-9223372036854775808 -12560 0 LMT} {-1846269040 -14400 0 -0400} {-71092800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Catamarca0000664000175000017500000000033615035744305017653 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Catamarca)]} { LoadTimeZoneFile America/Argentina/Catamarca } set TZData(:America/Catamarca) $TZData(:America/Argentina/Catamarca) tcl9.0.3/library/tzdata/America/Caracas0000664000175000017500000000042615035744305017334 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Caracas) { {-9223372036854775808 -16064 0 LMT} {-2524505536 -16060 0 CMT} {-1826739140 -16200 0 -0530} {-157750200 -14400 0 -0400} {1197183600 -16200 0 -0530} {1462086000 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Cancun0000664000175000017500000000256215035744305017211 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Cancun) { {-9223372036854775808 -20824 0 LMT} {-1514743200 -21600 0 CST} {378201600 -18000 0 EST} {410504400 -21600 0 CST} {828864000 -18000 1 CDT} {846399600 -21600 0 CST} {860313600 -18000 1 CDT} {877852800 -18000 0 EST} {891759600 -14400 1 EDT} {902041200 -18000 0 CDT} {909298800 -21600 0 CST} {923212800 -18000 1 CDT} {941353200 -21600 0 CST} {954662400 -18000 1 CDT} {972802800 -21600 0 CST} {989136000 -18000 1 CDT} {1001833200 -21600 0 CST} {1018166400 -18000 1 CDT} {1035702000 -21600 0 CST} {1049616000 -18000 1 CDT} {1067151600 -21600 0 CST} {1081065600 -18000 1 CDT} {1099206000 -21600 0 CST} {1112515200 -18000 1 CDT} {1130655600 -21600 0 CST} {1143964800 -18000 1 CDT} {1162105200 -21600 0 CST} {1175414400 -18000 1 CDT} {1193554800 -21600 0 CST} {1207468800 -18000 1 CDT} {1225004400 -21600 0 CST} {1238918400 -18000 1 CDT} {1256454000 -21600 0 CST} {1270368000 -18000 1 CDT} {1288508400 -21600 0 CST} {1301817600 -18000 1 CDT} {1319958000 -21600 0 CST} {1333267200 -18000 1 CDT} {1351407600 -21600 0 CST} {1365321600 -18000 1 CDT} {1382857200 -21600 0 CST} {1396771200 -18000 1 CDT} {1414306800 -21600 0 CST} {1422777600 -18000 0 EST} } tcl9.0.3/library/tzdata/America/Campo_Grande0000664000175000017500000000567415035744305020330 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Campo_Grande) { {-9223372036854775808 -13108 0 LMT} {-1767212492 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {592977600 -10800 1 -0300} {602046000 -14400 0 -0400} {624427200 -10800 1 -0300} {634705200 -14400 0 -0400} {656481600 -10800 1 -0300} {666759600 -14400 0 -0400} {687931200 -10800 1 -0300} {697604400 -14400 0 -0400} {719985600 -10800 1 -0300} {728449200 -14400 0 -0400} {750830400 -10800 1 -0300} {761713200 -14400 0 -0400} {782280000 -10800 1 -0300} {793162800 -14400 0 -0400} {813729600 -10800 1 -0300} {824007600 -14400 0 -0400} {844574400 -10800 1 -0300} {856062000 -14400 0 -0400} {876110400 -10800 1 -0300} {888721200 -14400 0 -0400} {908078400 -10800 1 -0300} {919566000 -14400 0 -0400} {938923200 -10800 1 -0300} {951620400 -14400 0 -0400} {970977600 -10800 1 -0300} {982465200 -14400 0 -0400} {1003032000 -10800 1 -0300} {1013914800 -14400 0 -0400} {1036296000 -10800 1 -0300} {1045364400 -14400 0 -0400} {1066536000 -10800 1 -0300} {1076814000 -14400 0 -0400} {1099368000 -10800 1 -0300} {1108868400 -14400 0 -0400} {1129435200 -10800 1 -0300} {1140318000 -14400 0 -0400} {1162699200 -10800 1 -0300} {1172372400 -14400 0 -0400} {1192334400 -10800 1 -0300} {1203217200 -14400 0 -0400} {1224388800 -10800 1 -0300} {1234666800 -14400 0 -0400} {1255838400 -10800 1 -0300} {1266721200 -14400 0 -0400} {1287288000 -10800 1 -0300} {1298170800 -14400 0 -0400} {1318737600 -10800 1 -0300} {1330225200 -14400 0 -0400} {1350792000 -10800 1 -0300} {1361070000 -14400 0 -0400} {1382241600 -10800 1 -0300} {1392519600 -14400 0 -0400} {1413691200 -10800 1 -0300} {1424574000 -14400 0 -0400} {1445140800 -10800 1 -0300} {1456023600 -14400 0 -0400} {1476590400 -10800 1 -0300} {1487473200 -14400 0 -0400} {1508040000 -10800 1 -0300} {1518922800 -14400 0 -0400} {1541304000 -10800 1 -0300} {1550372400 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Cambridge_Bay0000664000175000017500000001732015035744305020450 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Cambridge_Bay) { {-9223372036854775808 0 0 -00} {-1577923200 -25200 0 MST} {-880210800 -21600 1 MWT} {-769395600 -21600 1 MPT} {-765388800 -25200 0 MST} {73472400 -21600 1 MDT} {89193600 -25200 0 MST} {104922000 -21600 1 MDT} {120643200 -25200 0 MST} {136371600 -21600 1 MDT} {152092800 -25200 0 MST} {167821200 -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} {941360400 -21600 0 CST} {954662400 -18000 1 CDT} {972806400 -18000 0 EST} {973400400 -21600 0 CST} {986115600 -21600 0 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} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667721600 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Buenos_Aires0000664000175000017500000000035215035744305020353 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Buenos_Aires)]} { LoadTimeZoneFile America/Argentina/Buenos_Aires } set TZData(:America/Buenos_Aires) $TZData(:America/Argentina/Buenos_Aires) tcl9.0.3/library/tzdata/America/Boise0000664000175000017500000002020415035744305017034 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Boise) { {-9223372036854775808 -27889 0 LMT} {-2717640000 -28800 0 PST} {-1633269600 -25200 1 PDT} {-1615129200 -28800 0 PST} {-1601820000 -25200 1 PDT} {-1583679600 -28800 0 PST} {-1471788000 -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} {126255600 -25200 0 MST} {129114000 -21600 0 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} {1289116800 -25200 0 MST} {1300006800 -21600 1 MDT} {1320566400 -25200 0 MST} {1331456400 -21600 1 MDT} {1352016000 -25200 0 MST} {1362906000 -21600 1 MDT} {1383465600 -25200 0 MST} {1394355600 -21600 1 MDT} {1414915200 -25200 0 MST} {1425805200 -21600 1 MDT} {1446364800 -25200 0 MST} {1457859600 -21600 1 MDT} {1478419200 -25200 0 MST} {1489309200 -21600 1 MDT} {1509868800 -25200 0 MST} {1520758800 -21600 1 MDT} {1541318400 -25200 0 MST} {1552208400 -21600 1 MDT} {1572768000 -25200 0 MST} {1583658000 -21600 1 MDT} {1604217600 -25200 0 MST} {1615712400 -21600 1 MDT} {1636272000 -25200 0 MST} {1647162000 -21600 1 MDT} {1667721600 -25200 0 MST} {1678611600 -21600 1 MDT} {1699171200 -25200 0 MST} {1710061200 -21600 1 MDT} {1730620800 -25200 0 MST} {1741510800 -21600 1 MDT} {1762070400 -25200 0 MST} {1772960400 -21600 1 MDT} {1793520000 -25200 0 MST} {1805014800 -21600 1 MDT} {1825574400 -25200 0 MST} {1836464400 -21600 1 MDT} {1857024000 -25200 0 MST} {1867914000 -21600 1 MDT} {1888473600 -25200 0 MST} {1899363600 -21600 1 MDT} {1919923200 -25200 0 MST} {1930813200 -21600 1 MDT} {1951372800 -25200 0 MST} {1962867600 -21600 1 MDT} {1983427200 -25200 0 MST} {1994317200 -21600 1 MDT} {2014876800 -25200 0 MST} {2025766800 -21600 1 MDT} {2046326400 -25200 0 MST} {2057216400 -21600 1 MDT} {2077776000 -25200 0 MST} {2088666000 -21600 1 MDT} {2109225600 -25200 0 MST} {2120115600 -21600 1 MDT} {2140675200 -25200 0 MST} {2152170000 -21600 1 MDT} {2172729600 -25200 0 MST} {2183619600 -21600 1 MDT} {2204179200 -25200 0 MST} {2215069200 -21600 1 MDT} {2235628800 -25200 0 MST} {2246518800 -21600 1 MDT} {2267078400 -25200 0 MST} {2277968400 -21600 1 MDT} {2298528000 -25200 0 MST} {2309418000 -21600 1 MDT} {2329977600 -25200 0 MST} {2341472400 -21600 1 MDT} {2362032000 -25200 0 MST} {2372922000 -21600 1 MDT} {2393481600 -25200 0 MST} {2404371600 -21600 1 MDT} {2424931200 -25200 0 MST} {2435821200 -21600 1 MDT} {2456380800 -25200 0 MST} {2467270800 -21600 1 MDT} {2487830400 -25200 0 MST} {2499325200 -21600 1 MDT} {2519884800 -25200 0 MST} {2530774800 -21600 1 MDT} {2551334400 -25200 0 MST} {2562224400 -21600 1 MDT} {2582784000 -25200 0 MST} {2593674000 -21600 1 MDT} {2614233600 -25200 0 MST} {2625123600 -21600 1 MDT} {2645683200 -25200 0 MST} {2656573200 -21600 1 MDT} {2677132800 -25200 0 MST} {2688627600 -21600 1 MDT} {2709187200 -25200 0 MST} {2720077200 -21600 1 MDT} {2740636800 -25200 0 MST} {2751526800 -21600 1 MDT} {2772086400 -25200 0 MST} {2782976400 -21600 1 MDT} {2803536000 -25200 0 MST} {2814426000 -21600 1 MDT} {2834985600 -25200 0 MST} {2846480400 -21600 1 MDT} {2867040000 -25200 0 MST} {2877930000 -21600 1 MDT} {2898489600 -25200 0 MST} {2909379600 -21600 1 MDT} {2929939200 -25200 0 MST} {2940829200 -21600 1 MDT} {2961388800 -25200 0 MST} {2972278800 -21600 1 MDT} {2992838400 -25200 0 MST} {3003728400 -21600 1 MDT} {3024288000 -25200 0 MST} {3035782800 -21600 1 MDT} {3056342400 -25200 0 MST} {3067232400 -21600 1 MDT} {3087792000 -25200 0 MST} {3098682000 -21600 1 MDT} {3119241600 -25200 0 MST} {3130131600 -21600 1 MDT} {3150691200 -25200 0 MST} {3161581200 -21600 1 MDT} {3182140800 -25200 0 MST} {3193030800 -21600 1 MDT} {3213590400 -25200 0 MST} {3225085200 -21600 1 MDT} {3245644800 -25200 0 MST} {3256534800 -21600 1 MDT} {3277094400 -25200 0 MST} {3287984400 -21600 1 MDT} {3308544000 -25200 0 MST} {3319434000 -21600 1 MDT} {3339993600 -25200 0 MST} {3350883600 -21600 1 MDT} {3371443200 -25200 0 MST} {3382938000 -21600 1 MDT} {3403497600 -25200 0 MST} {3414387600 -21600 1 MDT} {3434947200 -25200 0 MST} {3445837200 -21600 1 MDT} {3466396800 -25200 0 MST} {3477286800 -21600 1 MDT} {3497846400 -25200 0 MST} {3508736400 -21600 1 MDT} {3529296000 -25200 0 MST} {3540186000 -21600 1 MDT} {3560745600 -25200 0 MST} {3572240400 -21600 1 MDT} {3592800000 -25200 0 MST} {3603690000 -21600 1 MDT} {3624249600 -25200 0 MST} {3635139600 -21600 1 MDT} {3655699200 -25200 0 MST} {3666589200 -21600 1 MDT} {3687148800 -25200 0 MST} {3698038800 -21600 1 MDT} {3718598400 -25200 0 MST} {3730093200 -21600 1 MDT} {3750652800 -25200 0 MST} {3761542800 -21600 1 MDT} {3782102400 -25200 0 MST} {3792992400 -21600 1 MDT} {3813552000 -25200 0 MST} {3824442000 -21600 1 MDT} {3845001600 -25200 0 MST} {3855891600 -21600 1 MDT} {3876451200 -25200 0 MST} {3887341200 -21600 1 MDT} {3907900800 -25200 0 MST} {3919395600 -21600 1 MDT} {3939955200 -25200 0 MST} {3950845200 -21600 1 MDT} {3971404800 -25200 0 MST} {3982294800 -21600 1 MDT} {4002854400 -25200 0 MST} {4013744400 -21600 1 MDT} {4034304000 -25200 0 MST} {4045194000 -21600 1 MDT} {4065753600 -25200 0 MST} {4076643600 -21600 1 MDT} {4097203200 -25200 0 MST} } tcl9.0.3/library/tzdata/America/Bogota0000664000175000017500000000036315035744305017212 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Bogota) { {-9223372036854775808 -17776 0 LMT} {-2707671824 -17776 0 BMT} {-1739041424 -18000 0 -0500} {704869200 -14400 1 -0400} {729057600 -18000 0 -0500} } tcl9.0.3/library/tzdata/America/Boa_Vista0000664000175000017500000000231515035744305017645 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Boa_Vista) { {-9223372036854775808 -14560 0 LMT} {-1767211040 -14400 0 -0400} {-1206954000 -10800 1 -0300} {-1191358800 -14400 0 -0400} {-1175371200 -10800 1 -0300} {-1159822800 -14400 0 -0400} {-633816000 -10800 1 -0300} {-622065600 -14400 0 -0400} {-602280000 -10800 1 -0300} {-591829200 -14400 0 -0400} {-570744000 -10800 1 -0300} {-560206800 -14400 0 -0400} {-539121600 -10800 1 -0300} {-531349200 -14400 0 -0400} {-191361600 -10800 1 -0300} {-184194000 -14400 0 -0400} {-155160000 -10800 1 -0300} {-150066000 -14400 0 -0400} {-128894400 -10800 1 -0300} {-121122000 -14400 0 -0400} {-99950400 -10800 1 -0300} {-89586000 -14400 0 -0400} {-68414400 -10800 1 -0300} {-57963600 -14400 0 -0400} {499752000 -10800 1 -0300} {511239600 -14400 0 -0400} {530596800 -10800 1 -0300} {540270000 -14400 0 -0400} {562132800 -10800 1 -0300} {571201200 -14400 0 -0400} {590036400 -14400 0 -0400} {938664000 -14400 0 -0400} {938923200 -10800 1 -0300} {951620400 -14400 0 -0400} {970977600 -10800 1 -0300} {971578800 -14400 0 -0400} } tcl9.0.3/library/tzdata/America/Blanc-Sablon0000664000175000017500000000031115035744305020223 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Blanc-Sablon) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Belize0000664000175000017500000000615515035744305017216 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Belize) { {-9223372036854775808 -21168 0 LMT} {-1822500432 -21600 0 CST} {-1616954400 -19800 1 -0530} {-1606069800 -21600 0 CST} {-1585504800 -19800 1 -0530} {-1574015400 -21600 0 CST} {-1554055200 -19800 1 -0530} {-1542565800 -21600 0 CST} {-1522605600 -19800 1 -0530} {-1511116200 -21600 0 CST} {-1490551200 -19800 1 -0530} {-1479666600 -21600 0 CST} {-1459101600 -19800 1 -0530} {-1448217000 -21600 0 CST} {-1427652000 -19800 1 -0530} {-1416162600 -21600 0 CST} {-1396202400 -19800 1 -0530} {-1384713000 -21600 0 CST} {-1364752800 -19800 1 -0530} {-1353263400 -21600 0 CST} {-1333303200 -19800 1 -0530} {-1321813800 -21600 0 CST} {-1301248800 -19800 1 -0530} {-1290364200 -21600 0 CST} {-1269799200 -19800 1 -0530} {-1258914600 -21600 0 CST} {-1238349600 -19800 1 -0530} {-1226860200 -21600 0 CST} {-1206900000 -19800 1 -0530} {-1195410600 -21600 0 CST} {-1175450400 -19800 1 -0530} {-1163961000 -21600 0 CST} {-1143396000 -19800 1 -0530} {-1132511400 -21600 0 CST} {-1111946400 -19800 1 -0530} {-1101061800 -21600 0 CST} {-1080496800 -19800 1 -0530} {-1069612200 -21600 0 CST} {-1049047200 -19800 1 -0530} {-1037557800 -21600 0 CST} {-1017597600 -19800 1 -0530} {-1006108200 -21600 0 CST} {-986148000 -19800 1 -0530} {-974658600 -21600 0 CST} {-954093600 -19800 1 -0530} {-943209000 -21600 0 CST} {-922644000 -19800 1 -0530} {-911759400 -21600 0 CST} {-891194400 -19800 1 -0530} {-879705000 -21600 0 CST} {-868212000 -18000 1 CWT} {-769395600 -18000 1 CPT} {-758746800 -21600 0 CST} {-701892000 -19800 1 -0530} {-690402600 -21600 0 CST} {-670442400 -19800 1 -0530} {-658953000 -21600 0 CST} {-638992800 -19800 1 -0530} {-627503400 -21600 0 CST} {-606938400 -19800 1 -0530} {-596053800 -21600 0 CST} {-575488800 -19800 1 -0530} {-564604200 -21600 0 CST} {-544039200 -19800 1 -0530} {-532549800 -21600 0 CST} {-512589600 -19800 1 -0530} {-501100200 -21600 0 CST} {-481140000 -19800 1 -0530} {-469650600 -21600 0 CST} {-449690400 -19800 1 -0530} {-438201000 -21600 0 CST} {-417636000 -19800 1 -0530} {-406751400 -21600 0 CST} {-386186400 -19800 1 -0530} {-375301800 -21600 0 CST} {-354736800 -19800 1 -0530} {-343247400 -21600 0 CST} {-323287200 -19800 1 -0530} {-311797800 -21600 0 CST} {-291837600 -19800 1 -0530} {-280348200 -21600 0 CST} {-259783200 -19800 1 -0530} {-248898600 -21600 0 CST} {-228333600 -19800 1 -0530} {-217449000 -21600 0 CST} {-196884000 -19800 1 -0530} {-185999400 -21600 0 CST} {-165434400 -19800 1 -0530} {-153945000 -21600 0 CST} {-133984800 -19800 1 -0530} {-122495400 -21600 0 CST} {-102535200 -19800 1 -0530} {-91045800 -21600 0 CST} {-70480800 -19800 1 -0530} {-59596200 -21600 0 CST} {123919200 -18000 1 CDT} {129618000 -21600 0 CST} {409039200 -18000 1 CDT} {413874000 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Belem0000664000175000017500000000204015035744305017015 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Belem) { {-9223372036854775808 -11636 0 LMT} {-1767213964 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {590032800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Barbados0000664000175000017500000000116215035744305017512 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Barbados) { {-9223372036854775808 -14309 0 LMT} {-1841256091 -14400 0 AST} {-874263600 -10800 1 ADT} {-862682400 -14400 0 AST} {-841604400 -10800 1 ADT} {-830714400 -14400 0 AST} {-820526400 -14400 0 -0330} {-811882800 -12600 1 AST} {-798660000 -14400 0 -0330} {-788904000 -14400 0 AST} {234943200 -10800 1 ADT} {244616400 -14400 0 AST} {261554400 -10800 1 ADT} {276066000 -14400 0 AST} {293004000 -10800 1 ADT} {307515600 -14400 0 AST} {325058400 -10800 1 ADT} {338706000 -14400 0 AST} } tcl9.0.3/library/tzdata/America/Bahia_Banderas0000664000175000017500000000366715035744305020614 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Bahia_Banderas) { {-9223372036854775808 -25260 0 LMT} {-1514739600 -25200 0 MST} {-1343149200 -21600 0 CST} {-1234807200 -25200 0 MST} {-1220461200 -21600 1 MDT} {-1207159200 -25200 0 MST} {-1191344400 -21600 0 CST} {-873828000 -25200 0 MST} {25200 -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} {989139600 -21600 1 MDT} {1001836800 -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} {1175418000 -21600 1 MDT} {1193558400 -25200 0 MST} {1207472400 -21600 1 MDT} {1225008000 -25200 0 MST} {1238922000 -21600 1 MDT} {1256457600 -25200 0 MST} {1270371600 -18000 0 CDT} {1288508400 -21600 0 CST} {1301817600 -18000 1 CDT} {1319958000 -21600 0 CST} {1333267200 -18000 1 CDT} {1351407600 -21600 0 CST} {1365321600 -18000 1 CDT} {1382857200 -21600 0 CST} {1396771200 -18000 1 CDT} {1414306800 -21600 0 CST} {1428220800 -18000 1 CDT} {1445756400 -21600 0 CST} {1459670400 -18000 1 CDT} {1477810800 -21600 0 CST} {1491120000 -18000 1 CDT} {1509260400 -21600 0 CST} {1522569600 -18000 1 CDT} {1540710000 -21600 0 CST} {1554624000 -18000 1 CDT} {1572159600 -21600 0 CST} {1586073600 -18000 1 CDT} {1603609200 -21600 0 CST} {1617523200 -18000 1 CDT} {1635663600 -21600 0 CST} {1648972800 -18000 1 CDT} {1667113200 -21600 0 CST} } tcl9.0.3/library/tzdata/America/Bahia0000664000175000017500000000402615035744305017003 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Bahia) { {-9223372036854775808 -9244 0 LMT} {-1767216356 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {656478000 -7200 1 -0200} {666756000 -10800 0 -0300} {687927600 -7200 1 -0200} {697600800 -10800 0 -0300} {719982000 -7200 1 -0200} {728445600 -10800 0 -0300} {750826800 -7200 1 -0200} {761709600 -10800 0 -0300} {782276400 -7200 1 -0200} {793159200 -10800 0 -0300} {813726000 -7200 1 -0200} {824004000 -10800 0 -0300} {844570800 -7200 1 -0200} {856058400 -10800 0 -0300} {876106800 -7200 1 -0200} {888717600 -10800 0 -0300} {908074800 -7200 1 -0200} {919562400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {982461600 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1036292400 -7200 1 -0200} {1045360800 -10800 0 -0300} {1064368800 -10800 0 -0300} {1318734000 -7200 0 -0200} {1330221600 -10800 0 -0300} {1350784800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Atka0000664000175000017500000000025415035744305016656 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Adak)]} { LoadTimeZoneFile America/Adak } set TZData(:America/Atka) $TZData(:America/Adak) tcl9.0.3/library/tzdata/America/Atikokan0000664000175000017500000000026615035744305017542 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Panama)]} { LoadTimeZoneFile America/Panama } set TZData(:America/Atikokan) $TZData(:America/Panama) tcl9.0.3/library/tzdata/America/Asuncion0000664000175000017500000000653715076154260017567 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Asuncion) { {-9223372036854775808 -13840 0 LMT} {-2524507760 -13840 0 AMT} {-1206389360 -14400 0 -0400} {86760000 -10800 0 -0300} {134017200 -14400 0 -0400} {162878400 -14400 0 -0400} {181368000 -10800 1 -0300} {194497200 -14400 0 -0400} {212990400 -10800 1 -0300} {226033200 -14400 0 -0400} {244526400 -10800 1 -0300} {257569200 -14400 0 -0400} {276062400 -10800 1 -0300} {291783600 -14400 0 -0400} {307598400 -10800 1 -0300} {323406000 -14400 0 -0400} {339220800 -10800 1 -0300} {354942000 -14400 0 -0400} {370756800 -10800 1 -0300} {386478000 -14400 0 -0400} {402292800 -10800 1 -0300} {418014000 -14400 0 -0400} {433828800 -10800 1 -0300} {449636400 -14400 0 -0400} {465451200 -10800 1 -0300} {481172400 -14400 0 -0400} {496987200 -10800 1 -0300} {512708400 -14400 0 -0400} {528523200 -10800 1 -0300} {544244400 -14400 0 -0400} {560059200 -10800 1 -0300} {575866800 -14400 0 -0400} {591681600 -10800 1 -0300} {607402800 -14400 0 -0400} {625032000 -10800 1 -0300} {638938800 -14400 0 -0400} {654753600 -10800 1 -0300} {670474800 -14400 0 -0400} {686721600 -10800 1 -0300} {699418800 -14400 0 -0400} {718257600 -10800 1 -0300} {733546800 -14400 0 -0400} {749448000 -10800 1 -0300} {762318000 -14400 0 -0400} {780984000 -10800 1 -0300} {793767600 -14400 0 -0400} {812520000 -10800 1 -0300} {825649200 -14400 0 -0400} {844574400 -10800 1 -0300} {856666800 -14400 0 -0400} {876024000 -10800 1 -0300} {888721200 -14400 0 -0400} {907473600 -10800 1 -0300} {920775600 -14400 0 -0400} {938923200 -10800 1 -0300} {952225200 -14400 0 -0400} {970372800 -10800 1 -0300} {983674800 -14400 0 -0400} {1002427200 -10800 1 -0300} {1018148400 -14400 0 -0400} {1030852800 -10800 1 -0300} {1049598000 -14400 0 -0400} {1062907200 -10800 1 -0300} {1081047600 -14400 0 -0400} {1097985600 -10800 1 -0300} {1110682800 -14400 0 -0400} {1129435200 -10800 1 -0300} {1142132400 -14400 0 -0400} {1160884800 -10800 1 -0300} {1173582000 -14400 0 -0400} {1192939200 -10800 1 -0300} {1205031600 -14400 0 -0400} {1224388800 -10800 1 -0300} {1236481200 -14400 0 -0400} {1255838400 -10800 1 -0300} {1270954800 -14400 0 -0400} {1286078400 -10800 1 -0300} {1302404400 -14400 0 -0400} {1317528000 -10800 1 -0300} {1333854000 -14400 0 -0400} {1349582400 -10800 1 -0300} {1364094000 -14400 0 -0400} {1381032000 -10800 1 -0300} {1395543600 -14400 0 -0400} {1412481600 -10800 1 -0300} {1426993200 -14400 0 -0400} {1443931200 -10800 1 -0300} {1459047600 -14400 0 -0400} {1475380800 -10800 1 -0300} {1490497200 -14400 0 -0400} {1506830400 -10800 1 -0300} {1521946800 -14400 0 -0400} {1538884800 -10800 1 -0300} {1553396400 -14400 0 -0400} {1570334400 -10800 1 -0300} {1584846000 -14400 0 -0400} {1601784000 -10800 1 -0300} {1616900400 -14400 0 -0400} {1633233600 -10800 1 -0300} {1648350000 -14400 0 -0400} {1664683200 -10800 1 -0300} {1679799600 -14400 0 -0400} {1696132800 -10800 1 -0300} {1711249200 -14400 0 -0400} {1728187200 -10800 1 -0300} {1728961200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Aruba0000664000175000017500000000030215035744305017022 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Aruba) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Argentina/0000755000175000017500000000000015104662345017760 5ustar sergeisergeitcl9.0.3/library/tzdata/America/Argentina/Ushuaia0000664000175000017500000000412315035744305021304 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Ushuaia) { {-9223372036854775808 -16392 0 LMT} {-2372095608 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -10800 0 -0300} {687927600 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1085886000 -14400 0 -0400} {1087704000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Tucuman0000664000175000017500000000416215035744305021324 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Tucuman) { {-9223372036854775808 -15652 0 LMT} {-2372096348 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -14400 0 -0400} {687931200 -7200 0 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1086058800 -14400 0 -0400} {1087099200 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224385200 -7200 1 -0200} {1237082400 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/San_Luis0000664000175000017500000000413115035744305021421 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/San_Luis) { {-9223372036854775808 -15924 0 LMT} {-2372096076 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {631159200 -7200 1 -0200} {637380000 -14400 0 -0400} {655963200 -10800 1 -0300} {667796400 -14400 0 -0400} {675748800 -10800 0 -0300} {938919600 -10800 1 -0300} {952052400 -10800 0 -0300} {1085972400 -14400 0 -0400} {1090728000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1200880800 -10800 0 -0300} {1205031600 -14400 0 -0400} {1223784000 -10800 1 -0300} {1236481200 -14400 0 -0400} {1255233600 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/San_Juan0000664000175000017500000000416315035744305021407 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/San_Juan) { {-9223372036854775808 -16444 0 LMT} {-2372095556 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667792800 -14400 0 -0400} {673588800 -10800 0 -0300} {687927600 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1085972400 -14400 0 -0400} {1090728000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Salta0000664000175000017500000000402115035744305020746 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Salta) { {-9223372036854775808 -15700 0 LMT} {-2372096300 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -14400 0 -0400} {687931200 -7200 0 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Rio_Gallegos0000664000175000017500000000413015035744305022251 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Rio_Gallegos) { {-9223372036854775808 -16612 0 LMT} {-2372095388 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -10800 0 -0300} {687927600 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1086058800 -14400 0 -0400} {1087704000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Mendoza0000664000175000017500000000412515035744305021304 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Mendoza) { {-9223372036854775808 -16516 0 LMT} {-2372095484 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -14400 0 -0400} {655963200 -10800 1 -0300} {667796400 -14400 0 -0400} {687499200 -10800 1 -0300} {699418800 -14400 0 -0400} {719380800 -7200 0 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1085281200 -14400 0 -0400} {1096171200 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/La_Rioja0000664000175000017500000000416315035744305021371 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/La_Rioja) { {-9223372036854775808 -16044 0 LMT} {-2372095956 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667792800 -14400 0 -0400} {673588800 -10800 0 -0300} {687927600 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1086058800 -14400 0 -0400} {1087704000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Jujuy0000664000175000017500000000406015035744305021013 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Jujuy) { {-9223372036854775808 -15672 0 LMT} {-2372096328 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -14400 0 -0400} {657086400 -10800 1 -0300} {669178800 -14400 0 -0400} {686721600 -7200 1 -0200} {694231200 -7200 0 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Cordoba0000664000175000017500000000406215035744305021260 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Cordoba) { {-9223372036854775808 -15408 0 LMT} {-2372096592 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -14400 0 -0400} {687931200 -7200 0 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224385200 -7200 1 -0200} {1237082400 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/ComodRivadavia0000664000175000017500000000035515035744305022600 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Argentina/Catamarca)]} { LoadTimeZoneFile America/Argentina/Catamarca } set TZData(:America/Argentina/ComodRivadavia) $TZData(:America/Argentina/Catamarca) tcl9.0.3/library/tzdata/America/Argentina/Catamarca0000664000175000017500000000412515035744305021563 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Catamarca) { {-9223372036854775808 -15788 0 LMT} {-2372096212 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -14400 0 -0400} {687931200 -7200 0 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1086058800 -14400 0 -0400} {1087704000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224295200 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Argentina/Buenos_Aires0000664000175000017500000000406715035744305022272 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Argentina/Buenos_Aires) { {-9223372036854775808 -14028 0 LMT} {-2372097972 -15408 0 CMT} {-1567453392 -14400 0 -0400} {-1233432000 -10800 0 -0300} {-1222981200 -14400 0 -0400} {-1205956800 -10800 1 -0300} {-1194037200 -14400 0 -0400} {-1172865600 -10800 1 -0300} {-1162501200 -14400 0 -0400} {-1141329600 -10800 1 -0300} {-1130965200 -14400 0 -0400} {-1109793600 -10800 1 -0300} {-1099429200 -14400 0 -0400} {-1078257600 -10800 1 -0300} {-1067806800 -14400 0 -0400} {-1046635200 -10800 1 -0300} {-1036270800 -14400 0 -0400} {-1015099200 -10800 1 -0300} {-1004734800 -14400 0 -0400} {-983563200 -10800 1 -0300} {-973198800 -14400 0 -0400} {-952027200 -10800 1 -0300} {-941576400 -14400 0 -0400} {-931032000 -10800 1 -0300} {-900882000 -14400 0 -0400} {-890337600 -10800 1 -0300} {-833749200 -14400 0 -0400} {-827265600 -10800 1 -0300} {-752274000 -14400 0 -0400} {-733780800 -10800 1 -0300} {-197326800 -14400 0 -0400} {-190843200 -10800 1 -0300} {-184194000 -14400 0 -0400} {-164491200 -10800 1 -0300} {-152658000 -14400 0 -0400} {-132955200 -10800 1 -0300} {-121122000 -14400 0 -0400} {-101419200 -10800 1 -0300} {-86821200 -14400 0 -0400} {-71092800 -10800 1 -0300} {-54766800 -14400 0 -0400} {-39038400 -10800 1 -0300} {-23317200 -14400 0 -0400} {-7588800 -10800 0 -0300} {128142000 -7200 1 -0200} {136605600 -10800 0 -0300} {596948400 -7200 1 -0200} {605066400 -10800 0 -0300} {624423600 -7200 1 -0200} {636516000 -10800 0 -0300} {656478000 -7200 1 -0200} {667965600 -10800 0 -0300} {687927600 -7200 1 -0200} {699415200 -10800 0 -0300} {719377200 -7200 1 -0200} {731469600 -10800 0 -0300} {938916000 -10800 0 -0300} {938919600 -10800 1 -0300} {952056000 -10800 0 -0300} {1198983600 -7200 1 -0200} {1205632800 -10800 0 -0300} {1224385200 -7200 1 -0200} {1237082400 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Araguaina0000664000175000017500000000345015035744305017667 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Araguaina) { {-9223372036854775808 -11568 0 LMT} {-1767214032 -10800 0 -0300} {-1206957600 -7200 1 -0200} {-1191362400 -10800 0 -0300} {-1175374800 -7200 1 -0200} {-1159826400 -10800 0 -0300} {-633819600 -7200 1 -0200} {-622069200 -10800 0 -0300} {-602283600 -7200 1 -0200} {-591832800 -10800 0 -0300} {-570747600 -7200 1 -0200} {-560210400 -10800 0 -0300} {-539125200 -7200 1 -0200} {-531352800 -10800 0 -0300} {-191365200 -7200 1 -0200} {-184197600 -10800 0 -0300} {-155163600 -7200 1 -0200} {-150069600 -10800 0 -0300} {-128898000 -7200 1 -0200} {-121125600 -10800 0 -0300} {-99954000 -7200 1 -0200} {-89589600 -10800 0 -0300} {-68418000 -7200 1 -0200} {-57967200 -10800 0 -0300} {499748400 -7200 1 -0200} {511236000 -10800 0 -0300} {530593200 -7200 1 -0200} {540266400 -10800 0 -0300} {562129200 -7200 1 -0200} {571197600 -10800 0 -0300} {592974000 -7200 1 -0200} {602042400 -10800 0 -0300} {624423600 -7200 1 -0200} {634701600 -10800 0 -0300} {653536800 -10800 0 -0300} {811047600 -10800 0 -0300} {813726000 -7200 1 -0200} {824004000 -10800 0 -0300} {844570800 -7200 1 -0200} {856058400 -10800 0 -0300} {876106800 -7200 1 -0200} {888717600 -10800 0 -0300} {908074800 -7200 1 -0200} {919562400 -10800 0 -0300} {938919600 -7200 1 -0200} {951616800 -10800 0 -0300} {970974000 -7200 1 -0200} {982461600 -10800 0 -0300} {1003028400 -7200 1 -0200} {1013911200 -10800 0 -0300} {1036292400 -7200 1 -0200} {1045360800 -10800 0 -0300} {1064368800 -10800 0 -0300} {1350788400 -7200 0 -0200} {1361066400 -10800 0 -0300} {1378000800 -10800 0 -0300} } tcl9.0.3/library/tzdata/America/Antigua0000664000175000017500000000030415035744305017362 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Antigua) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Anguilla0000664000175000017500000000030515035744305017527 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(America/Puerto_Rico)]} { LoadTimeZoneFile America/Puerto_Rico } set TZData(:America/Anguilla) $TZData(:America/Puerto_Rico) tcl9.0.3/library/tzdata/America/Anchorage0000664000175000017500000002033215035744305017664 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Anchorage) { {-9223372036854775808 50424 0 LMT} {-3225223727 -35976 0 LMT} {-2188951224 -36000 0 AST} {-883576800 -36000 0 AST} {-880200000 -32400 1 AWT} {-769395600 -32400 1 APT} {-765378000 -36000 0 AST} {-86882400 -36000 0 AHST} {-31500000 -36000 0 AHST} {-21470400 -32400 1 AHDT} {-5749200 -36000 0 AHST} {9979200 -32400 1 AHDT} {25700400 -36000 0 AHST} {41428800 -32400 1 AHDT} {57754800 -36000 0 AHST} {73483200 -32400 1 AHDT} {89204400 -36000 0 AHST} {104932800 -32400 1 AHDT} {120654000 -36000 0 AHST} {126705600 -32400 1 AHDT} {152103600 -36000 0 AHST} {162388800 -32400 1 AHDT} {183553200 -36000 0 AHST} {199281600 -32400 1 AHDT} {215607600 -36000 0 AHST} {230731200 -32400 1 AHDT} {247057200 -36000 0 AHST} {262785600 -32400 1 AHDT} {278506800 -36000 0 AHST} {294235200 -32400 1 AHDT} {309956400 -36000 0 AHST} {325684800 -32400 1 AHDT} {341406000 -36000 0 AHST} {357134400 -32400 1 AHDT} {372855600 -36000 0 AHST} {388584000 -32400 1 AHDT} {404910000 -36000 0 AHST} {420033600 -32400 1 AHDT} {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} } tcl9.0.3/library/tzdata/America/Adak0000664000175000017500000001775315035744305016652 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:America/Adak) { {-9223372036854775808 44002 0 LMT} {-3225223727 -42398 0 LMT} {-2188944802 -39600 0 NST} {-883573200 -39600 0 NST} {-880196400 -36000 1 NWT} {-769395600 -36000 1 NPT} {-765374400 -39600 0 NST} {-757342800 -39600 0 NST} {-86878800 -39600 0 BST} {-31496400 -39600 0 BST} {-21466800 -36000 1 BDT} {-5745600 -39600 0 BST} {9982800 -36000 1 BDT} {25704000 -39600 0 BST} {41432400 -36000 1 BDT} {57758400 -39600 0 BST} {73486800 -36000 1 BDT} {89208000 -39600 0 BST} {104936400 -36000 1 BDT} {120657600 -39600 0 BST} {126709200 -36000 1 BDT} {152107200 -39600 0 BST} {162392400 -36000 1 BDT} {183556800 -39600 0 BST} {199285200 -36000 1 BDT} {215611200 -39600 0 BST} {230734800 -36000 1 BDT} {247060800 -39600 0 BST} {262789200 -36000 1 BDT} {278510400 -39600 0 BST} {294238800 -36000 1 BDT} {309960000 -39600 0 BST} {325688400 -36000 1 BDT} {341409600 -39600 0 BST} {357138000 -36000 1 BDT} {372859200 -39600 0 BST} {388587600 -36000 1 BDT} {404913600 -39600 0 BST} {420037200 -36000 1 BDT} {439034400 -36000 0 HST} {452088000 -32400 1 HDT} {467809200 -36000 0 HST} {483537600 -32400 1 HDT} {499258800 -36000 0 HST} {514987200 -32400 1 HDT} {530708400 -36000 0 HST} {544622400 -32400 1 HDT} {562158000 -36000 0 HST} {576072000 -32400 1 HDT} {594212400 -36000 0 HST} {607521600 -32400 1 HDT} {625662000 -36000 0 HST} {638971200 -32400 1 HDT} {657111600 -36000 0 HST} {671025600 -32400 1 HDT} {688561200 -36000 0 HST} {702475200 -32400 1 HDT} {720010800 -36000 0 HST} {733924800 -32400 1 HDT} {752065200 -36000 0 HST} {765374400 -32400 1 HDT} {783514800 -36000 0 HST} {796824000 -32400 1 HDT} {814964400 -36000 0 HST} {828878400 -32400 1 HDT} {846414000 -36000 0 HST} {860328000 -32400 1 HDT} {877863600 -36000 0 HST} {891777600 -32400 1 HDT} {909313200 -36000 0 HST} {923227200 -32400 1 HDT} {941367600 -36000 0 HST} {954676800 -32400 1 HDT} {972817200 -36000 0 HST} {986126400 -32400 1 HDT} {1004266800 -36000 0 HST} {1018180800 -32400 1 HDT} {1035716400 -36000 0 HST} {1049630400 -32400 1 HDT} {1067166000 -36000 0 HST} {1081080000 -32400 1 HDT} {1099220400 -36000 0 HST} {1112529600 -32400 1 HDT} {1130670000 -36000 0 HST} {1143979200 -32400 1 HDT} {1162119600 -36000 0 HST} {1173614400 -32400 1 HDT} {1194174000 -36000 0 HST} {1205064000 -32400 1 HDT} {1225623600 -36000 0 HST} {1236513600 -32400 1 HDT} {1257073200 -36000 0 HST} {1268568000 -32400 1 HDT} {1289127600 -36000 0 HST} {1300017600 -32400 1 HDT} {1320577200 -36000 0 HST} {1331467200 -32400 1 HDT} {1352026800 -36000 0 HST} {1362916800 -32400 1 HDT} {1383476400 -36000 0 HST} {1394366400 -32400 1 HDT} {1414926000 -36000 0 HST} {1425816000 -32400 1 HDT} {1446375600 -36000 0 HST} {1457870400 -32400 1 HDT} {1478430000 -36000 0 HST} {1489320000 -32400 1 HDT} {1509879600 -36000 0 HST} {1520769600 -32400 1 HDT} {1541329200 -36000 0 HST} {1552219200 -32400 1 HDT} {1572778800 -36000 0 HST} {1583668800 -32400 1 HDT} {1604228400 -36000 0 HST} {1615723200 -32400 1 HDT} {1636282800 -36000 0 HST} {1647172800 -32400 1 HDT} {1667732400 -36000 0 HST} {1678622400 -32400 1 HDT} {1699182000 -36000 0 HST} {1710072000 -32400 1 HDT} {1730631600 -36000 0 HST} {1741521600 -32400 1 HDT} {1762081200 -36000 0 HST} {1772971200 -32400 1 HDT} {1793530800 -36000 0 HST} {1805025600 -32400 1 HDT} {1825585200 -36000 0 HST} {1836475200 -32400 1 HDT} {1857034800 -36000 0 HST} {1867924800 -32400 1 HDT} {1888484400 -36000 0 HST} {1899374400 -32400 1 HDT} {1919934000 -36000 0 HST} {1930824000 -32400 1 HDT} {1951383600 -36000 0 HST} {1962878400 -32400 1 HDT} {1983438000 -36000 0 HST} {1994328000 -32400 1 HDT} {2014887600 -36000 0 HST} {2025777600 -32400 1 HDT} {2046337200 -36000 0 HST} {2057227200 -32400 1 HDT} {2077786800 -36000 0 HST} {2088676800 -32400 1 HDT} {2109236400 -36000 0 HST} {2120126400 -32400 1 HDT} {2140686000 -36000 0 HST} {2152180800 -32400 1 HDT} {2172740400 -36000 0 HST} {2183630400 -32400 1 HDT} {2204190000 -36000 0 HST} {2215080000 -32400 1 HDT} {2235639600 -36000 0 HST} {2246529600 -32400 1 HDT} {2267089200 -36000 0 HST} {2277979200 -32400 1 HDT} {2298538800 -36000 0 HST} {2309428800 -32400 1 HDT} {2329988400 -36000 0 HST} {2341483200 -32400 1 HDT} {2362042800 -36000 0 HST} {2372932800 -32400 1 HDT} {2393492400 -36000 0 HST} {2404382400 -32400 1 HDT} {2424942000 -36000 0 HST} {2435832000 -32400 1 HDT} {2456391600 -36000 0 HST} {2467281600 -32400 1 HDT} {2487841200 -36000 0 HST} {2499336000 -32400 1 HDT} {2519895600 -36000 0 HST} {2530785600 -32400 1 HDT} {2551345200 -36000 0 HST} {2562235200 -32400 1 HDT} {2582794800 -36000 0 HST} {2593684800 -32400 1 HDT} {2614244400 -36000 0 HST} {2625134400 -32400 1 HDT} {2645694000 -36000 0 HST} {2656584000 -32400 1 HDT} {2677143600 -36000 0 HST} {2688638400 -32400 1 HDT} {2709198000 -36000 0 HST} {2720088000 -32400 1 HDT} {2740647600 -36000 0 HST} {2751537600 -32400 1 HDT} {2772097200 -36000 0 HST} {2782987200 -32400 1 HDT} {2803546800 -36000 0 HST} {2814436800 -32400 1 HDT} {2834996400 -36000 0 HST} {2846491200 -32400 1 HDT} {2867050800 -36000 0 HST} {2877940800 -32400 1 HDT} {2898500400 -36000 0 HST} {2909390400 -32400 1 HDT} {2929950000 -36000 0 HST} {2940840000 -32400 1 HDT} {2961399600 -36000 0 HST} {2972289600 -32400 1 HDT} {2992849200 -36000 0 HST} {3003739200 -32400 1 HDT} {3024298800 -36000 0 HST} {3035793600 -32400 1 HDT} {3056353200 -36000 0 HST} {3067243200 -32400 1 HDT} {3087802800 -36000 0 HST} {3098692800 -32400 1 HDT} {3119252400 -36000 0 HST} {3130142400 -32400 1 HDT} {3150702000 -36000 0 HST} {3161592000 -32400 1 HDT} {3182151600 -36000 0 HST} {3193041600 -32400 1 HDT} {3213601200 -36000 0 HST} {3225096000 -32400 1 HDT} {3245655600 -36000 0 HST} {3256545600 -32400 1 HDT} {3277105200 -36000 0 HST} {3287995200 -32400 1 HDT} {3308554800 -36000 0 HST} {3319444800 -32400 1 HDT} {3340004400 -36000 0 HST} {3350894400 -32400 1 HDT} {3371454000 -36000 0 HST} {3382948800 -32400 1 HDT} {3403508400 -36000 0 HST} {3414398400 -32400 1 HDT} {3434958000 -36000 0 HST} {3445848000 -32400 1 HDT} {3466407600 -36000 0 HST} {3477297600 -32400 1 HDT} {3497857200 -36000 0 HST} {3508747200 -32400 1 HDT} {3529306800 -36000 0 HST} {3540196800 -32400 1 HDT} {3560756400 -36000 0 HST} {3572251200 -32400 1 HDT} {3592810800 -36000 0 HST} {3603700800 -32400 1 HDT} {3624260400 -36000 0 HST} {3635150400 -32400 1 HDT} {3655710000 -36000 0 HST} {3666600000 -32400 1 HDT} {3687159600 -36000 0 HST} {3698049600 -32400 1 HDT} {3718609200 -36000 0 HST} {3730104000 -32400 1 HDT} {3750663600 -36000 0 HST} {3761553600 -32400 1 HDT} {3782113200 -36000 0 HST} {3793003200 -32400 1 HDT} {3813562800 -36000 0 HST} {3824452800 -32400 1 HDT} {3845012400 -36000 0 HST} {3855902400 -32400 1 HDT} {3876462000 -36000 0 HST} {3887352000 -32400 1 HDT} {3907911600 -36000 0 HST} {3919406400 -32400 1 HDT} {3939966000 -36000 0 HST} {3950856000 -32400 1 HDT} {3971415600 -36000 0 HST} {3982305600 -32400 1 HDT} {4002865200 -36000 0 HST} {4013755200 -32400 1 HDT} {4034314800 -36000 0 HST} {4045204800 -32400 1 HDT} {4065764400 -36000 0 HST} {4076654400 -32400 1 HDT} {4097214000 -36000 0 HST} } tcl9.0.3/library/tzdata/Africa/0000755000175000017500000000000015104662345015674 5ustar sergeisergeitcl9.0.3/library/tzdata/Africa/Windhoek0000664000175000017500000000306715035744305017377 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Windhoek) { {-9223372036854775808 4104 0 LMT} {-2458170504 5400 0 +0130} {-2109288600 7200 0 SAST} {-860976000 10800 1 SAST} {-845254800 7200 0 SAST} {637970400 7200 0 CAT} {764200800 3600 1 WAT} {778640400 7200 0 CAT} {796780800 3600 1 WAT} {810090000 7200 0 CAT} {828835200 3600 1 WAT} {841539600 7200 0 CAT} {860284800 3600 1 WAT} {873594000 7200 0 CAT} {891734400 3600 1 WAT} {905043600 7200 0 CAT} {923184000 3600 1 WAT} {936493200 7200 0 CAT} {954633600 3600 1 WAT} {967942800 7200 0 CAT} {986083200 3600 1 WAT} {999392400 7200 0 CAT} {1018137600 3600 1 WAT} {1030842000 7200 0 CAT} {1049587200 3600 1 WAT} {1062896400 7200 0 CAT} {1081036800 3600 1 WAT} {1094346000 7200 0 CAT} {1112486400 3600 1 WAT} {1125795600 7200 0 CAT} {1143936000 3600 1 WAT} {1157245200 7200 0 CAT} {1175385600 3600 1 WAT} {1188694800 7200 0 CAT} {1207440000 3600 1 WAT} {1220749200 7200 0 CAT} {1238889600 3600 1 WAT} {1252198800 7200 0 CAT} {1270339200 3600 1 WAT} {1283648400 7200 0 CAT} {1301788800 3600 1 WAT} {1315098000 7200 0 CAT} {1333238400 3600 1 WAT} {1346547600 7200 0 CAT} {1365292800 3600 1 WAT} {1377997200 7200 0 CAT} {1396742400 3600 1 WAT} {1410051600 7200 0 CAT} {1428192000 3600 1 WAT} {1441501200 7200 0 CAT} {1459641600 3600 1 WAT} {1472950800 7200 0 CAT} {1491091200 3600 1 WAT} {1504400400 7200 0 CAT} } tcl9.0.3/library/tzdata/Africa/Tunis0000664000175000017500000000206015035744305016721 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Tunis) { {-9223372036854775808 2444 0 LMT} {-2797202444 561 0 PMT} {-1855958961 3600 0 CET} {-969242400 7200 1 CEST} {-950493600 3600 0 CET} {-941940000 7200 1 CEST} {-891136800 3600 0 CET} {-877827600 7200 1 CEST} {-857257200 3600 0 CET} {-844556400 7200 1 CEST} {-842918400 3600 0 CET} {-842223600 7200 1 CEST} {-828230400 3600 0 CET} {-812502000 7200 1 CEST} {-796269600 3600 0 CET} {-781052400 7200 1 CEST} {-766634400 3600 0 CET} {231202800 7200 1 CEST} {243903600 3600 0 CET} {262825200 7200 1 CEST} {276044400 3600 0 CET} {581122800 7200 1 CEST} {591145200 3600 0 CET} {606870000 7200 1 CEST} {622594800 3600 0 CET} {641516400 7200 1 CEST} {654649200 3600 0 CET} {1114902000 7200 1 CEST} {1128038400 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} } tcl9.0.3/library/tzdata/Africa/Tripoli0000664000175000017500000000163015035744305017243 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Tripoli) { {-9223372036854775808 3164 0 LMT} {-1577926364 3600 0 CET} {-574902000 7200 1 CEST} {-512175600 7200 1 CEST} {-449888400 7200 1 CEST} {-347158800 7200 0 EET} {378684000 3600 0 CET} {386463600 7200 1 CEST} {402271200 3600 0 CET} {417999600 7200 1 CEST} {433807200 3600 0 CET} {449622000 7200 1 CEST} {465429600 3600 0 CET} {481590000 7200 1 CEST} {496965600 3600 0 CET} {512953200 7200 1 CEST} {528674400 3600 0 CET} {544230000 7200 1 CEST} {560037600 3600 0 CET} {575852400 7200 1 CEST} {591660000 3600 0 CET} {607388400 7200 1 CEST} {623196000 3600 0 CET} {641775600 7200 0 EET} {844034400 3600 0 CET} {860108400 7200 1 CEST} {875919600 7200 0 EET} {1352505600 3600 0 CET} {1364515200 7200 1 CEST} {1382662800 7200 0 EET} } tcl9.0.3/library/tzdata/Africa/Timbuktu0000664000175000017500000000026515035744305017430 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Timbuktu) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Sao_Tome0000664000175000017500000000034115035744305017325 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Sao_Tome) { {-9223372036854775808 1616 0 LMT} {-2713912016 -2205 0 LMT} {-1830384000 0 0 GMT} {1514768400 3600 0 WAT} {1546304400 0 0 GMT} } tcl9.0.3/library/tzdata/Africa/Porto-Novo0000664000175000017500000000026115035744305017642 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Porto-Novo) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Ouagadougou0000664000175000017500000000027015035744305020077 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Ouagadougou) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Nouakchott0000664000175000017500000000026715035744305017745 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Nouakchott) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Niamey0000664000175000017500000000025515035744305017045 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Niamey) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Ndjamena0000664000175000017500000000031015035744305017330 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Ndjamena) { {-9223372036854775808 3612 0 LMT} {-1830387612 3600 0 WAT} {308703600 7200 1 WAST} {321314400 3600 0 WAT} } tcl9.0.3/library/tzdata/Africa/Nairobi0000664000175000017500000000041315035744305017202 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Nairobi) { {-9223372036854775808 8836 0 LMT} {-1946168836 9000 0 +0230} {-1309746600 10800 0 EAT} {-1261969200 9000 0 +0230} {-1041388200 9900 0 +0245} {-865305900 10800 0 EAT} } tcl9.0.3/library/tzdata/Africa/Monrovia0000664000175000017500000000031015035744305017405 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Monrovia) { {-9223372036854775808 -2588 0 LMT} {-2776979812 -2588 0 MMT} {-1604359012 -2670 0 MMT} {63593070 0 0 GMT} } tcl9.0.3/library/tzdata/Africa/Mogadishu0000664000175000017500000000026615035744304017544 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Mogadishu) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Mbabane0000664000175000017500000000030315035744304017141 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Johannesburg)]} { LoadTimeZoneFile Africa/Johannesburg } set TZData(:Africa/Mbabane) $TZData(:Africa/Johannesburg) tcl9.0.3/library/tzdata/Africa/Maseru0000664000175000017500000000030215035744304017047 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Johannesburg)]} { LoadTimeZoneFile Africa/Johannesburg } set TZData(:Africa/Maseru) $TZData(:Africa/Johannesburg) tcl9.0.3/library/tzdata/Africa/Maputo0000664000175000017500000000021715035744304017065 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Maputo) { {-9223372036854775808 7818 0 LMT} {-1924999818 7200 0 CAT} } tcl9.0.3/library/tzdata/Africa/Malabo0000664000175000017500000000025515035744304017015 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Malabo) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Lusaka0000664000175000017500000000026015035744304017036 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Lusaka) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Lubumbashi0000664000175000017500000000026415035744304017715 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Lubumbashi) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Luanda0000664000175000017500000000025515035744304017026 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Luanda) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Lome0000664000175000017500000000026115035744304016513 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Lome) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Libreville0000664000175000017500000000026115035744304017710 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Libreville) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Lagos0000664000175000017500000000034215035744304016664 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Lagos) { {-9223372036854775808 815 0 LMT} {-2035584815 0 0 GMT} {-1940889600 815 0 LMT} {-1767226415 1800 0 +0030} {-1588465800 3600 0 WAT} } tcl9.0.3/library/tzdata/Africa/Kinshasa0000664000175000017500000000025715035744304017365 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Kinshasa) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Kigali0000664000175000017500000000026015035744304017016 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Kigali) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Khartoum0000664000175000017500000000210315035744304017406 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Khartoum) { {-9223372036854775808 7808 0 LMT} {-1230775808 7200 0 CAT} {10360800 10800 1 CAST} {24786000 7200 0 CAT} {41810400 10800 1 CAST} {56322000 7200 0 CAT} {73432800 10800 1 CAST} {87944400 7200 0 CAT} {104882400 10800 1 CAST} {119480400 7200 0 CAT} {136332000 10800 1 CAST} {151016400 7200 0 CAT} {167781600 10800 1 CAST} {182552400 7200 0 CAT} {199231200 10800 1 CAST} {214174800 7200 0 CAT} {230680800 10800 1 CAST} {245710800 7200 0 CAT} {262735200 10800 1 CAST} {277246800 7200 0 CAT} {294184800 10800 1 CAST} {308782800 7200 0 CAT} {325634400 10800 1 CAST} {340405200 7200 0 CAT} {357084000 10800 1 CAST} {371941200 7200 0 CAT} {388533600 10800 1 CAST} {403477200 7200 0 CAT} {419983200 10800 1 CAST} {435013200 7200 0 CAT} {452037600 10800 1 CAST} {466635600 7200 0 CAT} {483487200 10800 1 CAST} {498171600 7200 0 CAT} {947930400 10800 0 EAT} {1509483600 7200 0 CAT} } tcl9.0.3/library/tzdata/Africa/Kampala0000664000175000017500000000026415035744304017170 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Kampala) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Juba0000664000175000017500000000207715035744304016507 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Juba) { {-9223372036854775808 7588 0 LMT} {-1230775588 7200 0 CAT} {10360800 10800 1 CAST} {24786000 7200 0 CAT} {41810400 10800 1 CAST} {56322000 7200 0 CAT} {73432800 10800 1 CAST} {87944400 7200 0 CAT} {104882400 10800 1 CAST} {119480400 7200 0 CAT} {136332000 10800 1 CAST} {151016400 7200 0 CAT} {167781600 10800 1 CAST} {182552400 7200 0 CAT} {199231200 10800 1 CAST} {214174800 7200 0 CAT} {230680800 10800 1 CAST} {245710800 7200 0 CAT} {262735200 10800 1 CAST} {277246800 7200 0 CAT} {294184800 10800 1 CAST} {308782800 7200 0 CAT} {325634400 10800 1 CAST} {340405200 7200 0 CAT} {357084000 10800 1 CAST} {371941200 7200 0 CAT} {388533600 10800 1 CAST} {403477200 7200 0 CAT} {419983200 10800 1 CAST} {435013200 7200 0 CAT} {452037600 10800 1 CAST} {466635600 7200 0 CAT} {483487200 10800 1 CAST} {498171600 7200 0 CAT} {947930400 10800 0 EAT} {1612126800 7200 0 CAT} } tcl9.0.3/library/tzdata/Africa/Johannesburg0000664000175000017500000000045215035744304020246 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Johannesburg) { {-9223372036854775808 6720 0 LMT} {-2458173120 5400 0 SAST} {-2109288600 7200 0 SAST} {-860976000 10800 1 SAST} {-845254800 7200 0 SAST} {-829526400 10800 1 SAST} {-813805200 7200 0 SAST} } tcl9.0.3/library/tzdata/Africa/Harare0000664000175000017500000000026015035744304017020 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Harare) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Gaborone0000664000175000017500000000026215035744304017354 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Gaborone) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Freetown0000664000175000017500000000026515035744304017414 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Freetown) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/El_Aaiun0000664000175000017500000001245015035744304017277 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/El_Aaiun) { {-9223372036854775808 -3168 0 LMT} {-1136070432 -3600 0 -0100} {198291600 0 0 +0000} {199756800 3600 1 +0100} {207702000 0 0 +0000} {231292800 3600 1 +0100} {244249200 0 0 +0000} {265507200 3600 1 +0100} {271033200 0 0 +0000} {1212278400 3600 1 +0100} {1220223600 0 0 +0000} {1243814400 3600 1 +0100} {1250809200 0 0 +0000} {1272758400 3600 1 +0100} {1281222000 0 0 +0000} {1301788800 3600 1 +0100} {1312066800 0 0 +0000} {1335664800 3600 1 +0100} {1342749600 0 0 +0000} {1345428000 3600 1 +0100} {1348970400 0 0 +0000} {1367114400 3600 1 +0100} {1373162400 0 0 +0000} {1376100000 3600 1 +0100} {1382839200 0 0 +0000} {1396144800 3600 1 +0100} {1403920800 0 0 +0000} {1406944800 3600 1 +0100} {1414288800 0 0 +0000} {1427594400 3600 1 +0100} {1434247200 0 0 +0000} {1437271200 3600 1 +0100} {1445738400 0 0 +0000} {1459044000 3600 1 +0100} {1465092000 0 0 +0000} {1468116000 3600 1 +0100} {1477792800 0 0 +0000} {1490493600 3600 1 +0100} {1495332000 0 0 +0000} {1498960800 3600 1 +0100} {1509242400 0 0 +0000} {1521943200 3600 1 +0100} {1526176800 0 0 +0000} {1529200800 3600 1 +0100} {1540695600 3600 0 +0100} {1557021600 0 1 +0000} {1560045600 3600 0 +0100} {1587261600 0 1 +0000} {1590890400 3600 0 +0100} {1618106400 0 1 +0000} {1621130400 3600 0 +0100} {1648346400 0 1 +0000} {1651975200 3600 0 +0100} {1679191200 0 1 +0000} {1682215200 3600 0 +0100} {1710036000 0 1 +0000} {1713060000 3600 0 +0100} {1740276000 0 1 +0000} {1743904800 3600 0 +0100} {1771120800 0 1 +0000} {1774144800 3600 0 +0100} {1801965600 0 1 +0000} {1804989600 3600 0 +0100} {1832205600 0 1 +0000} {1835834400 3600 0 +0100} {1863050400 0 1 +0000} {1866074400 3600 0 +0100} {1893290400 0 1 +0000} {1896919200 3600 0 +0100} {1924135200 0 1 +0000} {1927159200 3600 0 +0100} {1954980000 0 1 +0000} {1958004000 3600 0 +0100} {1985220000 0 1 +0000} {1988848800 3600 0 +0100} {2016064800 0 1 +0000} {2019088800 3600 0 +0100} {2046304800 0 1 +0000} {2049933600 3600 0 +0100} {2077149600 0 1 +0000} {2080778400 3600 0 +0100} {2107994400 0 1 +0000} {2111018400 3600 0 +0100} {2138234400 0 1 +0000} {2141863200 3600 0 +0100} {2169079200 0 1 +0000} {2172103200 3600 0 +0100} {2199924000 0 1 +0000} {2202948000 3600 0 +0100} {2230164000 0 1 +0000} {2233792800 3600 0 +0100} {2261008800 0 1 +0000} {2264032800 3600 0 +0100} {2291248800 0 1 +0000} {2294877600 3600 0 +0100} {2322093600 0 1 +0000} {2325722400 3600 0 +0100} {2352938400 0 1 +0000} {2355962400 3600 0 +0100} {2383178400 0 1 +0000} {2386807200 3600 0 +0100} {2414023200 0 1 +0000} {2417047200 3600 0 +0100} {2444868000 0 1 +0000} {2447892000 3600 0 +0100} {2475108000 0 1 +0000} {2478736800 3600 0 +0100} {2505952800 0 1 +0000} {2508976800 3600 0 +0100} {2536192800 0 1 +0000} {2539821600 3600 0 +0100} {2567037600 0 1 +0000} {2570666400 3600 0 +0100} {2597882400 0 1 +0000} {2600906400 3600 0 +0100} {2628122400 0 1 +0000} {2631751200 3600 0 +0100} {2658967200 0 1 +0000} {2661991200 3600 0 +0100} {2689812000 0 1 +0000} {2692836000 3600 0 +0100} {2720052000 0 1 +0000} {2723680800 3600 0 +0100} {2750896800 0 1 +0000} {2753920800 3600 0 +0100} {2781136800 0 1 +0000} {2784765600 3600 0 +0100} {2811981600 0 1 +0000} {2815610400 3600 0 +0100} {2842826400 0 1 +0000} {2845850400 3600 0 +0100} {2873066400 0 1 +0000} {2876695200 3600 0 +0100} {2903911200 0 1 +0000} {2906935200 3600 0 +0100} {2934756000 0 1 +0000} {2937780000 3600 0 +0100} {2964996000 0 1 +0000} {2968624800 3600 0 +0100} {2995840800 0 1 +0000} {2998864800 3600 0 +0100} {3026080800 0 1 +0000} {3029709600 3600 0 +0100} {3056925600 0 1 +0000} {3060554400 3600 0 +0100} {3087770400 0 1 +0000} {3090794400 3600 0 +0100} {3118010400 0 1 +0000} {3121639200 3600 0 +0100} {3148855200 0 1 +0000} {3151879200 3600 0 +0100} {3179700000 0 1 +0000} {3182724000 3600 0 +0100} {3209940000 0 1 +0000} {3213568800 3600 0 +0100} {3240784800 0 1 +0000} {3243808800 3600 0 +0100} {3271024800 0 1 +0000} {3274653600 3600 0 +0100} {3301869600 0 1 +0000} {3305498400 3600 0 +0100} {3332714400 0 1 +0000} {3335738400 3600 0 +0100} {3362954400 0 1 +0000} {3366583200 3600 0 +0100} {3393799200 0 1 +0000} {3396823200 3600 0 +0100} {3424644000 0 1 +0000} {3427668000 3600 0 +0100} {3454884000 0 1 +0000} {3458512800 3600 0 +0100} {3485728800 0 1 +0000} {3488752800 3600 0 +0100} {3515968800 0 1 +0000} {3519597600 3600 0 +0100} {3546813600 0 1 +0000} {3549837600 3600 0 +0100} {3577658400 0 1 +0000} {3580682400 3600 0 +0100} {3607898400 0 1 +0000} {3611527200 3600 0 +0100} {3638743200 0 1 +0000} {3641767200 3600 0 +0100} {3669588000 0 1 +0000} {3672612000 3600 0 +0100} {3699828000 0 1 +0000} {3703456800 3600 0 +0100} } tcl9.0.3/library/tzdata/Africa/Douala0000664000175000017500000000025515035744304017027 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Douala) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Djibouti0000664000175000017500000000026515035744304017374 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Djibouti) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Dar_es_Salaam0000664000175000017500000000027215035744304020274 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Dar_es_Salaam) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Dakar0000664000175000017500000000026215035744304016642 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Dakar) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Conakry0000664000175000017500000000026415035744304017230 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Conakry) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Ceuta0000664000175000017500000001615515035744304016671 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Ceuta) { {-9223372036854775808 -1276 0 LMT} {-2177452800 0 0 WET} {-1630112400 3600 1 WEST} {-1616810400 0 0 WET} {-1451692800 0 0 WET} {-1442451600 3600 1 WEST} {-1427673600 0 0 WET} {-1379293200 3600 1 WEST} {-1364774400 0 0 WET} {-1348448400 3600 1 WEST} {-1333324800 0 0 WET} {-1316390400 3600 1 WEST} {-1301270400 0 0 WET} {-1293840000 0 0 WET} {-94694400 0 0 WET} {-81432000 3600 1 WEST} {-71110800 0 0 WET} {141264000 3600 1 WEST} {147222000 0 0 WET} {199756800 3600 1 WEST} {207702000 0 0 WET} {231292800 3600 1 WEST} {244249200 0 0 WET} {265507200 3600 1 WEST} {271033200 0 0 WET} {448243200 3600 0 CET} {504918000 3600 0 CET} {512528400 7200 1 CEST} {528253200 3600 0 CET} {543978000 7200 1 CEST} {559702800 3600 0 CET} {575427600 7200 1 CEST} {591152400 3600 0 CET} {606877200 7200 1 CEST} {622602000 3600 0 CET} {638326800 7200 1 CEST} {654656400 3600 0 CET} {670381200 7200 1 CEST} {686106000 3600 0 CET} {701830800 7200 1 CEST} {717555600 3600 0 CET} {733280400 7200 1 CEST} {749005200 3600 0 CET} {764730000 7200 1 CEST} {780454800 3600 0 CET} {796179600 7200 1 CEST} {811904400 3600 0 CET} {828234000 7200 1 CEST} {846378000 3600 0 CET} {859683600 7200 1 CEST} {877827600 3600 0 CET} {891133200 7200 1 CEST} {909277200 3600 0 CET} {922582800 7200 1 CEST} {941331600 3600 0 CET} {954032400 7200 1 CEST} {972781200 3600 0 CET} {985482000 7200 1 CEST} {1004230800 3600 0 CET} {1017536400 7200 1 CEST} {1035680400 3600 0 CET} {1048986000 7200 1 CEST} {1067130000 3600 0 CET} {1080435600 7200 1 CEST} {1099184400 3600 0 CET} {1111885200 7200 1 CEST} {1130634000 3600 0 CET} {1143334800 7200 1 CEST} {1162083600 3600 0 CET} {1174784400 7200 1 CEST} {1193533200 3600 0 CET} {1206838800 7200 1 CEST} {1224982800 3600 0 CET} {1238288400 7200 1 CEST} {1256432400 3600 0 CET} {1269738000 7200 1 CEST} {1288486800 3600 0 CET} {1301187600 7200 1 CEST} {1319936400 3600 0 CET} {1332637200 7200 1 CEST} {1351386000 3600 0 CET} {1364691600 7200 1 CEST} {1382835600 3600 0 CET} {1396141200 7200 1 CEST} {1414285200 3600 0 CET} {1427590800 7200 1 CEST} {1445734800 3600 0 CET} {1459040400 7200 1 CEST} {1477789200 3600 0 CET} {1490490000 7200 1 CEST} {1509238800 3600 0 CET} {1521939600 7200 1 CEST} {1540688400 3600 0 CET} {1553994000 7200 1 CEST} {1572138000 3600 0 CET} {1585443600 7200 1 CEST} {1603587600 3600 0 CET} {1616893200 7200 1 CEST} {1635642000 3600 0 CET} {1648342800 7200 1 CEST} {1667091600 3600 0 CET} {1679792400 7200 1 CEST} {1698541200 3600 0 CET} {1711846800 7200 1 CEST} {1729990800 3600 0 CET} {1743296400 7200 1 CEST} {1761440400 3600 0 CET} {1774746000 7200 1 CEST} {1792890000 3600 0 CET} {1806195600 7200 1 CEST} {1824944400 3600 0 CET} {1837645200 7200 1 CEST} {1856394000 3600 0 CET} {1869094800 7200 1 CEST} {1887843600 3600 0 CET} {1901149200 7200 1 CEST} {1919293200 3600 0 CET} {1932598800 7200 1 CEST} {1950742800 3600 0 CET} {1964048400 7200 1 CEST} {1982797200 3600 0 CET} {1995498000 7200 1 CEST} {2014246800 3600 0 CET} {2026947600 7200 1 CEST} {2045696400 3600 0 CET} {2058397200 7200 1 CEST} {2077146000 3600 0 CET} {2090451600 7200 1 CEST} {2108595600 3600 0 CET} {2121901200 7200 1 CEST} {2140045200 3600 0 CET} {2153350800 7200 1 CEST} {2172099600 3600 0 CET} {2184800400 7200 1 CEST} {2203549200 3600 0 CET} {2216250000 7200 1 CEST} {2234998800 3600 0 CET} {2248304400 7200 1 CEST} {2266448400 3600 0 CET} {2279754000 7200 1 CEST} {2297898000 3600 0 CET} {2311203600 7200 1 CEST} {2329347600 3600 0 CET} {2342653200 7200 1 CEST} {2361402000 3600 0 CET} {2374102800 7200 1 CEST} {2392851600 3600 0 CET} {2405552400 7200 1 CEST} {2424301200 3600 0 CET} {2437606800 7200 1 CEST} {2455750800 3600 0 CET} {2469056400 7200 1 CEST} {2487200400 3600 0 CET} {2500506000 7200 1 CEST} {2519254800 3600 0 CET} {2531955600 7200 1 CEST} {2550704400 3600 0 CET} {2563405200 7200 1 CEST} {2582154000 3600 0 CET} {2595459600 7200 1 CEST} {2613603600 3600 0 CET} {2626909200 7200 1 CEST} {2645053200 3600 0 CET} {2658358800 7200 1 CEST} {2676502800 3600 0 CET} {2689808400 7200 1 CEST} {2708557200 3600 0 CET} {2721258000 7200 1 CEST} {2740006800 3600 0 CET} {2752707600 7200 1 CEST} {2771456400 3600 0 CET} {2784762000 7200 1 CEST} {2802906000 3600 0 CET} {2816211600 7200 1 CEST} {2834355600 3600 0 CET} {2847661200 7200 1 CEST} {2866410000 3600 0 CET} {2879110800 7200 1 CEST} {2897859600 3600 0 CET} {2910560400 7200 1 CEST} {2929309200 3600 0 CET} {2942010000 7200 1 CEST} {2960758800 3600 0 CET} {2974064400 7200 1 CEST} {2992208400 3600 0 CET} {3005514000 7200 1 CEST} {3023658000 3600 0 CET} {3036963600 7200 1 CEST} {3055712400 3600 0 CET} {3068413200 7200 1 CEST} {3087162000 3600 0 CET} {3099862800 7200 1 CEST} {3118611600 3600 0 CET} {3131917200 7200 1 CEST} {3150061200 3600 0 CET} {3163366800 7200 1 CEST} {3181510800 3600 0 CET} {3194816400 7200 1 CEST} {3212960400 3600 0 CET} {3226266000 7200 1 CEST} {3245014800 3600 0 CET} {3257715600 7200 1 CEST} {3276464400 3600 0 CET} {3289165200 7200 1 CEST} {3307914000 3600 0 CET} {3321219600 7200 1 CEST} {3339363600 3600 0 CET} {3352669200 7200 1 CEST} {3370813200 3600 0 CET} {3384118800 7200 1 CEST} {3402867600 3600 0 CET} {3415568400 7200 1 CEST} {3434317200 3600 0 CET} {3447018000 7200 1 CEST} {3465766800 3600 0 CET} {3479072400 7200 1 CEST} {3497216400 3600 0 CET} {3510522000 7200 1 CEST} {3528666000 3600 0 CET} {3541971600 7200 1 CEST} {3560115600 3600 0 CET} {3573421200 7200 1 CEST} {3592170000 3600 0 CET} {3604870800 7200 1 CEST} {3623619600 3600 0 CET} {3636320400 7200 1 CEST} {3655069200 3600 0 CET} {3668374800 7200 1 CEST} {3686518800 3600 0 CET} {3699824400 7200 1 CEST} {3717968400 3600 0 CET} {3731274000 7200 1 CEST} {3750022800 3600 0 CET} {3762723600 7200 1 CEST} {3781472400 3600 0 CET} {3794173200 7200 1 CEST} {3812922000 3600 0 CET} {3825622800 7200 1 CEST} {3844371600 3600 0 CET} {3857677200 7200 1 CEST} {3875821200 3600 0 CET} {3889126800 7200 1 CEST} {3907270800 3600 0 CET} {3920576400 7200 1 CEST} {3939325200 3600 0 CET} {3952026000 7200 1 CEST} {3970774800 3600 0 CET} {3983475600 7200 1 CEST} {4002224400 3600 0 CET} {4015530000 7200 1 CEST} {4033674000 3600 0 CET} {4046979600 7200 1 CEST} {4065123600 3600 0 CET} {4078429200 7200 1 CEST} {4096573200 3600 0 CET} } tcl9.0.3/library/tzdata/Africa/Casablanca0000664000175000017500000001313415035744304017632 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Casablanca) { {-9223372036854775808 -1820 0 LMT} {-1773012580 0 0 +0000} {-956361600 3600 1 +0100} {-950490000 0 0 +0000} {-942019200 3600 1 +0100} {-761187600 0 0 +0000} {-617241600 3600 1 +0100} {-605149200 0 0 +0000} {-81432000 3600 1 +0100} {-71110800 0 0 +0000} {141264000 3600 1 +0100} {147222000 0 0 +0000} {199756800 3600 1 +0100} {207702000 0 0 +0000} {231292800 3600 1 +0100} {244249200 0 0 +0000} {265507200 3600 1 +0100} {271033200 0 0 +0000} {448243200 3600 0 +0100} {504918000 0 0 +0000} {1212278400 3600 1 +0100} {1220223600 0 0 +0000} {1243814400 3600 1 +0100} {1250809200 0 0 +0000} {1272758400 3600 1 +0100} {1281222000 0 0 +0000} {1301788800 3600 1 +0100} {1312066800 0 0 +0000} {1335664800 3600 1 +0100} {1342749600 0 0 +0000} {1345428000 3600 1 +0100} {1348970400 0 0 +0000} {1367114400 3600 1 +0100} {1373162400 0 0 +0000} {1376100000 3600 1 +0100} {1382839200 0 0 +0000} {1396144800 3600 1 +0100} {1403920800 0 0 +0000} {1406944800 3600 1 +0100} {1414288800 0 0 +0000} {1427594400 3600 1 +0100} {1434247200 0 0 +0000} {1437271200 3600 1 +0100} {1445738400 0 0 +0000} {1459044000 3600 1 +0100} {1465092000 0 0 +0000} {1468116000 3600 1 +0100} {1477792800 0 0 +0000} {1490493600 3600 1 +0100} {1495332000 0 0 +0000} {1498960800 3600 1 +0100} {1509242400 0 0 +0000} {1521943200 3600 1 +0100} {1526176800 0 0 +0000} {1529200800 3600 1 +0100} {1540695600 3600 0 +0100} {1557021600 0 1 +0000} {1560045600 3600 0 +0100} {1587261600 0 1 +0000} {1590890400 3600 0 +0100} {1618106400 0 1 +0000} {1621130400 3600 0 +0100} {1648346400 0 1 +0000} {1651975200 3600 0 +0100} {1679191200 0 1 +0000} {1682215200 3600 0 +0100} {1710036000 0 1 +0000} {1713060000 3600 0 +0100} {1740276000 0 1 +0000} {1743904800 3600 0 +0100} {1771120800 0 1 +0000} {1774144800 3600 0 +0100} {1801965600 0 1 +0000} {1804989600 3600 0 +0100} {1832205600 0 1 +0000} {1835834400 3600 0 +0100} {1863050400 0 1 +0000} {1866074400 3600 0 +0100} {1893290400 0 1 +0000} {1896919200 3600 0 +0100} {1924135200 0 1 +0000} {1927159200 3600 0 +0100} {1954980000 0 1 +0000} {1958004000 3600 0 +0100} {1985220000 0 1 +0000} {1988848800 3600 0 +0100} {2016064800 0 1 +0000} {2019088800 3600 0 +0100} {2046304800 0 1 +0000} {2049933600 3600 0 +0100} {2077149600 0 1 +0000} {2080778400 3600 0 +0100} {2107994400 0 1 +0000} {2111018400 3600 0 +0100} {2138234400 0 1 +0000} {2141863200 3600 0 +0100} {2169079200 0 1 +0000} {2172103200 3600 0 +0100} {2199924000 0 1 +0000} {2202948000 3600 0 +0100} {2230164000 0 1 +0000} {2233792800 3600 0 +0100} {2261008800 0 1 +0000} {2264032800 3600 0 +0100} {2291248800 0 1 +0000} {2294877600 3600 0 +0100} {2322093600 0 1 +0000} {2325722400 3600 0 +0100} {2352938400 0 1 +0000} {2355962400 3600 0 +0100} {2383178400 0 1 +0000} {2386807200 3600 0 +0100} {2414023200 0 1 +0000} {2417047200 3600 0 +0100} {2444868000 0 1 +0000} {2447892000 3600 0 +0100} {2475108000 0 1 +0000} {2478736800 3600 0 +0100} {2505952800 0 1 +0000} {2508976800 3600 0 +0100} {2536192800 0 1 +0000} {2539821600 3600 0 +0100} {2567037600 0 1 +0000} {2570666400 3600 0 +0100} {2597882400 0 1 +0000} {2600906400 3600 0 +0100} {2628122400 0 1 +0000} {2631751200 3600 0 +0100} {2658967200 0 1 +0000} {2661991200 3600 0 +0100} {2689812000 0 1 +0000} {2692836000 3600 0 +0100} {2720052000 0 1 +0000} {2723680800 3600 0 +0100} {2750896800 0 1 +0000} {2753920800 3600 0 +0100} {2781136800 0 1 +0000} {2784765600 3600 0 +0100} {2811981600 0 1 +0000} {2815610400 3600 0 +0100} {2842826400 0 1 +0000} {2845850400 3600 0 +0100} {2873066400 0 1 +0000} {2876695200 3600 0 +0100} {2903911200 0 1 +0000} {2906935200 3600 0 +0100} {2934756000 0 1 +0000} {2937780000 3600 0 +0100} {2964996000 0 1 +0000} {2968624800 3600 0 +0100} {2995840800 0 1 +0000} {2998864800 3600 0 +0100} {3026080800 0 1 +0000} {3029709600 3600 0 +0100} {3056925600 0 1 +0000} {3060554400 3600 0 +0100} {3087770400 0 1 +0000} {3090794400 3600 0 +0100} {3118010400 0 1 +0000} {3121639200 3600 0 +0100} {3148855200 0 1 +0000} {3151879200 3600 0 +0100} {3179700000 0 1 +0000} {3182724000 3600 0 +0100} {3209940000 0 1 +0000} {3213568800 3600 0 +0100} {3240784800 0 1 +0000} {3243808800 3600 0 +0100} {3271024800 0 1 +0000} {3274653600 3600 0 +0100} {3301869600 0 1 +0000} {3305498400 3600 0 +0100} {3332714400 0 1 +0000} {3335738400 3600 0 +0100} {3362954400 0 1 +0000} {3366583200 3600 0 +0100} {3393799200 0 1 +0000} {3396823200 3600 0 +0100} {3424644000 0 1 +0000} {3427668000 3600 0 +0100} {3454884000 0 1 +0000} {3458512800 3600 0 +0100} {3485728800 0 1 +0000} {3488752800 3600 0 +0100} {3515968800 0 1 +0000} {3519597600 3600 0 +0100} {3546813600 0 1 +0000} {3549837600 3600 0 +0100} {3577658400 0 1 +0000} {3580682400 3600 0 +0100} {3607898400 0 1 +0000} {3611527200 3600 0 +0100} {3638743200 0 1 +0000} {3641767200 3600 0 +0100} {3669588000 0 1 +0000} {3672612000 3600 0 +0100} {3699828000 0 1 +0000} {3703456800 3600 0 +0100} } tcl9.0.3/library/tzdata/Africa/Cairo0000664000175000017500000001777215035744304016673 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Cairo) { {-9223372036854775808 7509 0 LMT} {-2185409109 7200 0 EET} {-929844000 10800 1 EEST} {-923108400 7200 0 EET} {-906170400 10800 1 EEST} {-892868400 7200 0 EET} {-875844000 10800 1 EEST} {-857790000 7200 0 EET} {-844308000 10800 1 EEST} {-825822000 7200 0 EET} {-812685600 10800 1 EEST} {-794199600 7200 0 EET} {-779853600 10800 1 EEST} {-762663600 7200 0 EET} {-399088800 10800 1 EEST} {-386650800 7200 0 EET} {-368330400 10800 1 EEST} {-355114800 7200 0 EET} {-336790800 10800 1 EEST} {-323654400 7200 0 EET} {-305168400 10800 1 EEST} {-292032000 7200 0 EET} {-273632400 10800 1 EEST} {-260496000 7200 0 EET} {-242096400 10800 1 EEST} {-228960000 7200 0 EET} {-210560400 10800 1 EEST} {-197424000 7200 0 EET} {-178938000 10800 1 EEST} {-165801600 7200 0 EET} {-147402000 10800 1 EEST} {-134265600 7200 0 EET} {-115866000 10800 1 EEST} {-102643200 7200 0 EET} {-84330000 10800 1 EEST} {-71107200 7200 0 EET} {-52707600 10800 1 EEST} {-39484800 7200 0 EET} {-21171600 10800 1 EEST} {-7948800 7200 0 EET} {10364400 10800 1 EEST} {23587200 7200 0 EET} {41900400 10800 1 EEST} {55123200 7200 0 EET} {73522800 10800 1 EEST} {86745600 7200 0 EET} {105058800 10800 1 EEST} {118281600 7200 0 EET} {136594800 10800 1 EEST} {149817600 7200 0 EET} {168130800 10800 1 EEST} {181353600 7200 0 EET} {199753200 10800 1 EEST} {212976000 7200 0 EET} {231289200 10800 1 EEST} {244512000 7200 0 EET} {262825200 10800 1 EEST} {276048000 7200 0 EET} {294361200 10800 1 EEST} {307584000 7200 0 EET} {325983600 10800 1 EEST} {339206400 7200 0 EET} {357519600 10800 1 EEST} {370742400 7200 0 EET} {396399600 10800 1 EEST} {402278400 7200 0 EET} {426812400 10800 1 EEST} {433814400 7200 0 EET} {452214000 10800 1 EEST} {465436800 7200 0 EET} {483750000 10800 1 EEST} {496972800 7200 0 EET} {515286000 10800 1 EEST} {528508800 7200 0 EET} {546822000 10800 1 EEST} {560044800 7200 0 EET} {578444400 10800 1 EEST} {591667200 7200 0 EET} {610412400 10800 1 EEST} {623203200 7200 0 EET} {641516400 10800 1 EEST} {654739200 7200 0 EET} {673052400 10800 1 EEST} {686275200 7200 0 EET} {704674800 10800 1 EEST} {717897600 7200 0 EET} {736210800 10800 1 EEST} {749433600 7200 0 EET} {767746800 10800 1 EEST} {780969600 7200 0 EET} {799020000 10800 1 EEST} {812322000 7200 0 EET} {830469600 10800 1 EEST} {843771600 7200 0 EET} {861919200 10800 1 EEST} {875221200 7200 0 EET} {893368800 10800 1 EEST} {906670800 7200 0 EET} {925423200 10800 1 EEST} {938725200 7200 0 EET} {956872800 10800 1 EEST} {970174800 7200 0 EET} {988322400 10800 1 EEST} {1001624400 7200 0 EET} {1019772000 10800 1 EEST} {1033074000 7200 0 EET} {1051221600 10800 1 EEST} {1064523600 7200 0 EET} {1083276000 10800 1 EEST} {1096578000 7200 0 EET} {1114725600 10800 1 EEST} {1128027600 7200 0 EET} {1146175200 10800 1 EEST} {1158872400 7200 0 EET} {1177624800 10800 1 EEST} {1189112400 7200 0 EET} {1209074400 10800 1 EEST} {1219957200 7200 0 EET} {1240524000 10800 1 EEST} {1250802000 7200 0 EET} {1272578400 10800 1 EEST} {1281474000 7200 0 EET} {1284069600 10800 1 EEST} {1285880400 7200 0 EET} {1400191200 10800 1 EEST} {1403816400 7200 0 EET} {1406844000 10800 1 EEST} {1411678800 7200 0 EET} {1682632800 10800 1 EEST} {1698354000 7200 0 EET} {1714082400 10800 1 EEST} {1730408400 7200 0 EET} {1745532000 10800 1 EEST} {1761858000 7200 0 EET} {1776981600 10800 1 EEST} {1793307600 7200 0 EET} {1809036000 10800 1 EEST} {1824757200 7200 0 EET} {1840485600 10800 1 EEST} {1856206800 7200 0 EET} {1871935200 10800 1 EEST} {1887656400 7200 0 EET} {1903384800 10800 1 EEST} {1919710800 7200 0 EET} {1934834400 10800 1 EEST} {1951160400 7200 0 EET} {1966888800 10800 1 EEST} {1982610000 7200 0 EET} {1998338400 10800 1 EEST} {2014059600 7200 0 EET} {2029788000 10800 1 EEST} {2045509200 7200 0 EET} {2061237600 10800 1 EEST} {2076958800 7200 0 EET} {2092687200 10800 1 EEST} {2109013200 7200 0 EET} {2124136800 10800 1 EEST} {2140462800 7200 0 EET} {2156191200 10800 1 EEST} {2171912400 7200 0 EET} {2187640800 10800 1 EEST} {2203362000 7200 0 EET} {2219090400 10800 1 EEST} {2234811600 7200 0 EET} {2250540000 10800 1 EEST} {2266866000 7200 0 EET} {2281989600 10800 1 EEST} {2298315600 7200 0 EET} {2313439200 10800 1 EEST} {2329765200 7200 0 EET} {2345493600 10800 1 EEST} {2361214800 7200 0 EET} {2376943200 10800 1 EEST} {2392664400 7200 0 EET} {2408392800 10800 1 EEST} {2424114000 7200 0 EET} {2439842400 10800 1 EEST} {2456168400 7200 0 EET} {2471292000 10800 1 EEST} {2487618000 7200 0 EET} {2503346400 10800 1 EEST} {2519067600 7200 0 EET} {2534796000 10800 1 EEST} {2550517200 7200 0 EET} {2566245600 10800 1 EEST} {2581966800 7200 0 EET} {2597695200 10800 1 EEST} {2614021200 7200 0 EET} {2629144800 10800 1 EEST} {2645470800 7200 0 EET} {2660594400 10800 1 EEST} {2676920400 7200 0 EET} {2692648800 10800 1 EEST} {2708370000 7200 0 EET} {2724098400 10800 1 EEST} {2739819600 7200 0 EET} {2755548000 10800 1 EEST} {2771269200 7200 0 EET} {2786997600 10800 1 EEST} {2803323600 7200 0 EET} {2818447200 10800 1 EEST} {2834773200 7200 0 EET} {2850501600 10800 1 EEST} {2866222800 7200 0 EET} {2881951200 10800 1 EEST} {2897672400 7200 0 EET} {2913400800 10800 1 EEST} {2929122000 7200 0 EET} {2944850400 10800 1 EEST} {2960571600 7200 0 EET} {2976300000 10800 1 EEST} {2992626000 7200 0 EET} {3007749600 10800 1 EEST} {3024075600 7200 0 EET} {3039804000 10800 1 EEST} {3055525200 7200 0 EET} {3071253600 10800 1 EEST} {3086974800 7200 0 EET} {3102703200 10800 1 EEST} {3118424400 7200 0 EET} {3134152800 10800 1 EEST} {3150478800 7200 0 EET} {3165602400 10800 1 EEST} {3181928400 7200 0 EET} {3197052000 10800 1 EEST} {3213378000 7200 0 EET} {3229106400 10800 1 EEST} {3244827600 7200 0 EET} {3260556000 10800 1 EEST} {3276277200 7200 0 EET} {3292005600 10800 1 EEST} {3307726800 7200 0 EET} {3323455200 10800 1 EEST} {3339781200 7200 0 EET} {3354904800 10800 1 EEST} {3371230800 7200 0 EET} {3386959200 10800 1 EEST} {3402680400 7200 0 EET} {3418408800 10800 1 EEST} {3434130000 7200 0 EET} {3449858400 10800 1 EEST} {3465579600 7200 0 EET} {3481308000 10800 1 EEST} {3497634000 7200 0 EET} {3512757600 10800 1 EEST} {3529083600 7200 0 EET} {3544207200 10800 1 EEST} {3560533200 7200 0 EET} {3576261600 10800 1 EEST} {3591982800 7200 0 EET} {3607711200 10800 1 EEST} {3623432400 7200 0 EET} {3639160800 10800 1 EEST} {3654882000 7200 0 EET} {3670610400 10800 1 EEST} {3686936400 7200 0 EET} {3702060000 10800 1 EEST} {3718386000 7200 0 EET} {3734114400 10800 1 EEST} {3749835600 7200 0 EET} {3765564000 10800 1 EEST} {3781285200 7200 0 EET} {3797013600 10800 1 EEST} {3812734800 7200 0 EET} {3828463200 10800 1 EEST} {3844184400 7200 0 EET} {3859912800 10800 1 EEST} {3876238800 7200 0 EET} {3891362400 10800 1 EEST} {3907688400 7200 0 EET} {3923416800 10800 1 EEST} {3939138000 7200 0 EET} {3954866400 10800 1 EEST} {3970587600 7200 0 EET} {3986316000 10800 1 EEST} {4002037200 7200 0 EET} {4017765600 10800 1 EEST} {4034091600 7200 0 EET} {4049215200 10800 1 EEST} {4065541200 7200 0 EET} {4080664800 10800 1 EEST} {4096990800 7200 0 EET} } tcl9.0.3/library/tzdata/Africa/Bujumbura0000664000175000017500000000026315035744304017555 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Bujumbura) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Brazzaville0000664000175000017500000000026215035744304020105 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Brazzaville) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Blantyre0000664000175000017500000000026215035744304017400 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Maputo)]} { LoadTimeZoneFile Africa/Maputo } set TZData(:Africa/Blantyre) $TZData(:Africa/Maputo) tcl9.0.3/library/tzdata/Africa/Bissau0000664000175000017500000000025315035744304017046 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Bissau) { {-9223372036854775808 -3740 0 LMT} {-1830380400 -3600 0 -0100} {157770000 0 0 GMT} } tcl9.0.3/library/tzdata/Africa/Banjul0000664000175000017500000000026315035744304017034 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Banjul) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Bangui0000664000175000017500000000025515035744304017027 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Lagos)]} { LoadTimeZoneFile Africa/Lagos } set TZData(:Africa/Bangui) $TZData(:Africa/Lagos) tcl9.0.3/library/tzdata/Africa/Bamako0000664000175000017500000000026315035744304017013 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Bamako) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Asmera0000664000175000017500000000026315035744304017031 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Asmera) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Asmara0000664000175000017500000000026315035744304017025 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Asmara) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Algiers0000664000175000017500000000202115035744304017201 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Algiers) { {-9223372036854775808 732 0 LMT} {-2486592732 561 0 PMT} {-1855958961 0 0 WET} {-1689814800 3600 1 WEST} {-1680397200 0 0 WET} {-1665363600 3600 1 WEST} {-1648342800 0 0 WET} {-1635123600 3600 1 WEST} {-1616893200 0 0 WET} {-1604278800 3600 1 WEST} {-1585443600 0 0 WET} {-1574038800 3600 1 WEST} {-1552266000 0 0 WET} {-1539997200 3600 1 WEST} {-1531443600 0 0 WET} {-956365200 3600 1 WEST} {-950486400 0 0 WET} {-942012000 3600 0 CET} {-812502000 7200 1 CEST} {-796262400 3600 0 CET} {-781052400 7200 1 CEST} {-766630800 3600 0 CET} {-733280400 0 0 WET} {-439430400 3600 0 CET} {-212029200 0 0 WET} {41468400 3600 1 WEST} {54774000 0 0 WET} {231724800 3600 1 WEST} {246240000 3600 0 CET} {259545600 7200 1 CEST} {275274000 3600 0 CET} {309740400 0 0 WET} {325468800 3600 1 WEST} {341802000 0 0 WET} {357523200 3600 0 CET} } tcl9.0.3/library/tzdata/Africa/Addis_Ababa0000664000175000017500000000027015035744304017711 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Nairobi)]} { LoadTimeZoneFile Africa/Nairobi } set TZData(:Africa/Addis_Ababa) $TZData(:Africa/Nairobi) tcl9.0.3/library/tzdata/Africa/Accra0000664000175000017500000000026215035744304016631 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit if {![info exists TZData(Africa/Abidjan)]} { LoadTimeZoneFile Africa/Abidjan } set TZData(:Africa/Accra) $TZData(:Africa/Abidjan) tcl9.0.3/library/tzdata/Africa/Abidjan0000664000175000017500000000021515035744304017146 0ustar sergeisergei# created by tools/tclZIC.tcl - do not edit set TZData(:Africa/Abidjan) { {-9223372036854775808 -968 0 LMT} {-1830383032 0 0 GMT} } tcl9.0.3/library/tm.tcl0000644000175000017500000002720015104661341014340 0ustar sergeisergei# -*- tcl -*- # # Searching for Tcl Modules. Defines a procedure, declares it as the primary # command for finding packages, however also uses the former 'package unknown' # command as a fallback. # # Locates all possible packages in a directory via a less restricted glob. The # targeted directory is derived from the name of the requested package, i.e. # the TM scan will look only at directories which can contain the requested # package. It will register all packages it found in the directory so that # future requests have a higher chance of being fulfilled by the ifneeded # database without having to come to us again. # # We do not remember where we have been and simply rescan targeted directories # when invoked again. The reasoning is this: # # - The only way we get back to the same directory is if someone is trying to # [package require] something that wasn't there on the first scan. # # Either # 1) It is there now: If we rescan, you get it; if not you don't. # # This covers the possibility that the application asked for a package # late, and the package was actually added to the installation after the # application was started. It should still be able to find it. # # 2) It still is not there: Either way, you don't get it, but the rescan # takes time. This is however an error case and we don't care that much # about it # # 3) It was there the first time; but for some reason a "package forget" has # been run, and "package" doesn't know about it anymore. # # This can be an indication that the application wishes to reload some # functionality. And should work as well. # # Note that this also strikes a balance between doing a glob targeting a # single package, and thus most likely requiring multiple globs of the same # directory when the application is asking for many packages, and trying to # glob for _everything_ in all subdirectories when looking for a package, # which comes with a heavy startup cost. # # We scan for regular packages only if no satisfying module was found. namespace eval ::tcl::tm { # Default paths. None yet. variable paths {} # The regex pattern a file name has to match to make it a Tcl Module. set pkgpattern {^([_[:alpha:]][:_[:alnum:]]*)-([[:digit:]].*)[.]tm$} # Export the public API namespace export path namespace ensemble create -command path -subcommands {add remove list} } # ::tcl::tm::path implementations -- # # Public API to the module path. See specification. # # Arguments # cmd - The subcommand to execute # args - The paths to add/remove. Must not appear querying the # path with 'list'. # # Results # No result for subcommands 'add' and 'remove'. A list of paths for # 'list'. # # Side effects # The subcommands 'add' and 'remove' manipulate the list of paths to # search for Tcl Modules. The subcommand 'list' has no side effects. proc ::tcl::tm::add {args} { # PART OF THE ::tcl::tm::path ENSEMBLE # # The path is added at the head to the list of module paths. # # The command enforces the restriction that no path may be an ancestor # directory of any other path on the list. If the new path violates this # restriction an error will be raised. # # If the path is already present as is no error will be raised and no # action will be taken. variable paths # We use a copy of the path as source during validation, and extend it as # well. Because we not only have to detect if the new paths are bogus with # respect to the existing paths, but also between themselves. Otherwise we # can still add bogus paths, by specifying them in a single call. This # makes the use of the new paths simpler as well, a trivial assignment of # the collected paths to the official state var. set newpaths $paths foreach p $args { if {($p eq "") || ($p in $newpaths)} { # Ignore any path which is empty or already on the list. continue } # Search for paths which are subdirectories of the new one. If there # are any then the new path violates the restriction about ancestors. set pos [lsearch -glob $newpaths ${p}/*] # Cannot use "in", we need the position for the message. if {$pos >= 0} { return -code error \ "$p is ancestor of existing module path [lindex $newpaths $pos]." } # Now look for existing paths which are ancestors of the new one. This # reverse question forces us to loop over the existing paths, as each # element is the pattern, not the new path :( foreach ep $newpaths { if {[string match ${ep}/* $p]} { return -code error \ "$p is subdirectory of existing module path $ep." } } set newpaths [linsert $newpaths 0 $p] } # The validation of the input is complete and successful, and everything # in newpaths is either an old path, or added. We can now extend the # official list of paths, a simple assignment is sufficient. set paths $newpaths return } proc ::tcl::tm::remove {args} { # PART OF THE ::tcl::tm::path ENSEMBLE # # Removes the path from the list of module paths. The command is silently # ignored if the path is not on the list. variable paths foreach p $args { set pos [lsearch -exact $paths $p] if {$pos >= 0} { set paths [lreplace $paths $pos $pos] } } } proc ::tcl::tm::list {} { # PART OF THE ::tcl::tm::path ENSEMBLE variable paths return $paths } # ::tcl::tm::UnknownHandler -- # # Unknown handler for Tcl Modules, i.e. packages in module form. # # Arguments # original - Original [package unknown] procedure. # name - Name of desired package. # version - Version of desired package. Can be the # empty string. # exact - Either -exact or omitted. # # Name, version, and exact are used to determine satisfaction. The # original is called iff no satisfaction was achieved. The name is also # used to compute the directory to target in the search. # # Results # None. # # Side effects # May populate the package ifneeded database with additional provide # scripts. proc ::tcl::tm::UnknownHandler {original name args} { # Import the list of paths to search for packages in module form. # Import the pattern used to check package names in detail. variable paths variable pkgpattern # Without paths to search we can do nothing. (Except falling back to the # regular search). if {[llength $paths]} { set pkgpath [string map {:: /} $name] set pkgroot [file dirname $pkgpath] if {$pkgroot eq "."} { set pkgroot "" } # We don't remember a copy of the paths while looping. Tcl Modules are # unable to change the list while we are searching for them. This also # simplifies the loop, as we cannot get additional directories while # iterating over the list. A simple foreach is sufficient. set satisfied 0 foreach path $paths { if {![interp issafe] && ![file exists $path]} { continue } set currentsearchpath [file join $path $pkgroot] if {![interp issafe] && ![file exists $currentsearchpath]} { continue } set strip [llength [file split $path]] # Get the module files out of the subdirectories. # - Safe Base interpreters have a restricted "glob" command that # works in this case. # - The "catch" was essential when there was no safe glob and every # call in a safe interp failed; it is retained only for corner # cases in which the eventual call to glob returns an error. catch { # We always look for _all_ possible modules in the current # path, to get the max result out of the glob. foreach file [glob -nocomplain -directory $currentsearchpath *.tm] { set pkgfilename [join [lrange [file split $file] $strip end] ::] if {![regexp -- $pkgpattern $pkgfilename --> pkgname pkgversion]} { # Ignore everything not matching our pattern for # package names. continue } try { package vcompare $pkgversion 0 } on error {} { # Ignore everything where the version part is not # acceptable to "package vcompare". continue } if {([package ifneeded $pkgname $pkgversion] ne {}) && (![interp issafe]) } { # There's already a provide script registered for # this version of this package. Since all units of # code claiming to be the same version of the same # package ought to be identical, just stick with # the one we already have. # This does not apply to Safe Base interpreters because # the token-to-directory mapping may have changed. continue } # We have found a candidate, generate a "provide script" # for it, and remember it. Note that we are using ::list # to do this; locally [list] means something else without # the namespace specifier. # NOTE. When making changes to the format of the provide # command generated below CHECK that the 'LOCATE' # procedure in core file 'platform/shell.tcl' still # understands it, or, if not, update its implementation # appropriately. # # Right now LOCATE's implementation assumes that the path # of the package file is the last element in the list. package ifneeded $pkgname $pkgversion \ "[::list package provide $pkgname $pkgversion];[::list source $file]" # We abort in this unknown handler only if we got a # satisfying candidate for the requested package. # Otherwise we still have to fallback to the regular # package search to complete the processing. if {($pkgname eq $name) && [package vsatisfies $pkgversion {*}$args]} { set satisfied 1 # We do not abort the loop, and keep adding provide # scripts for every candidate in the directory, just # remember to not fall back to the regular search # anymore. } } } } if {$satisfied} { return } } # Fallback to previous command, if existing. See comment above about # ::list... if {[llength $original]} { uplevel 1 $original [::linsert $args 0 $name] } } # ::tcl::tm::Defaults -- # # Determines the default search paths. # # Arguments # None # # Results # None. # # Side effects # May add paths to the list of defaults. proc ::tcl::tm::Defaults {} { global env tcl_platform regexp {^(\d+)\.(\d+)} [package provide tcl] - major minor set exe [file normalize [info nameofexecutable]] # Note that we're using [::list], not [list] because [list] means # something other than [::list] in this namespace. roots [::list \ [file dirname [info library]] \ [file join [file dirname [file dirname $exe]] lib] \ ] for {set n $minor} {$n >= 0} {incr n -1} { foreach ev [::list \ TCL${major}.${n}_TM_PATH \ TCL${major}_${n}_TM_PATH \ ] { if {![info exists env($ev)]} continue foreach p [split $env($ev) $::tcl_platform(pathSeparator)] { # Paths relative to unresolvable home dirs are ignored if {![catch {file tildeexpand $p} expanded_path]} { path add $expanded_path } } } } return } # ::tcl::tm::roots -- # # Public API to the module path. See specification. # # Arguments # paths - List of 'root' paths to derive search paths from. # # Results # No result. # # Side effects # Calls 'path add' to paths to the list of module search paths. proc ::tcl::tm::roots {paths} { regexp {^(\d+)\.(\d+)} [package provide tcl] - major minor foreach pa $paths { set p [file join $pa tcl$major] for {set n $minor} {$n >= 0} {incr n -1} { set px [file join $p ${major}.${n}] if {![interp issafe]} {set px [file normalize $px]} path add $px } set px [file join $p site-tcl] if {![interp issafe]} {set px [file normalize $px]} path add $px } return } # Initialization. Set up the default paths, then insert the new handler into # the chain. if {![interp issafe]} {::tcl::tm::Defaults} tcl9.0.3/library/tcltest/0000755000175000017500000000000015104662217014700 5ustar sergeisergeitcl9.0.3/library/tcltest/tcltest.tcl0000644000175000017500000031451715104661341017076 0ustar sergeisergei# tcltest.tcl -- # # This file contains support code for the Tcl test suite. It # defines the tcltest namespace and finds and defines the output # directory, constraints available, output and error channels, # etc. used by Tcl tests. See the tcltest man page for more # details. # # This design was based on the Tcl testing approach designed and # initially implemented by Mary Ann May-Pumphrey of Sun # Microsystems. # # Copyright © 1994-1997 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # Copyright © 2000 Ajuba Solutions # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. variable Version 2.5.10 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package require] and [info patchlevel] # yourself. You don't need tcltest to wrap it for you. variable version [package require Tcl 8.5-] variable patchLevel [info patchlevel] # Detect if we can use code points >= \U10000 variable fullutf [package vsatisfies $version 9.0-] ##### Export the public tcltest procs; several categories # # Export the main functional commands that do useful things namespace export cleanupTests loadTestedCommands makeDirectory \ makeFile removeDirectory removeFile runAllTests test # Export configuration commands that control the functional commands namespace export configure customMatch errorChannel interpreter \ outputChannel testConstraint # Export commands that are duplication (candidates for deprecation) if {![package vsatisfies [package provide Tcl] 9.0-]} { namespace export bytestring ;# dups [encoding convertfrom identity] } namespace export debug ;# [configure -debug] namespace export errorFile ;# [configure -errfile] namespace export limitConstraints ;# [configure -limitconstraints] namespace export loadFile ;# [configure -loadfile] namespace export loadScript ;# [configure -load] namespace export match ;# [configure -match] namespace export matchFiles ;# [configure -file] namespace export matchDirectories ;# [configure -relateddir] namespace export normalizeMsg ;# application of [customMatch] namespace export normalizePath ;# [file normalize] (8.4) namespace export outputFile ;# [configure -outfile] namespace export preserveCore ;# [configure -preservecore] namespace export singleProcess ;# [configure -singleproc] namespace export skip ;# [configure -skip] namespace export skipFiles ;# [configure -notfile] namespace export skipDirectories ;# [configure -asidefromdir] namespace export temporaryDirectory ;# [configure -tmpdir] namespace export testsDirectory ;# [configure -testdir] namespace export verbose ;# [configure -verbose] namespace export viewFile ;# binary encoding [read] namespace export workingDirectory ;# [cd] [pwd] # Export deprecated commands for tcltest 1 compatibility namespace export getMatchingFiles mainThread restoreState saveState \ threadReap # tcltest::normalizePath -- # # This procedure resolves any symlinks in the path thus creating # a path without internal redirection. It assumes that the # incoming path is absolute. # # Arguments # pathVar - name of variable containing path to modify. # # Results # The path is modified in place. # # Side Effects: # None. # proc normalizePath {pathVar} { upvar 1 $pathVar path set oldpwd [pwd] catch {cd $path} set path [pwd] cd $oldpwd return $path } ##### Verification commands used to test values of variables and options # # Verification command that accepts everything proc AcceptAll {value} { return $value } # Verification command that accepts valid Tcl lists proc AcceptList { list } { return [lrange $list 0 end] } # Verification command that accepts a glob pattern proc AcceptPattern { pattern } { return [AcceptAll $pattern] } # Verification command that accepts integers proc AcceptInteger { level } { return [incr level 0] } # Verification command that accepts boolean values proc AcceptBoolean { boolean } { return [expr {$boolean && $boolean}] } # Verification command that accepts (syntactically) valid Tcl scripts proc AcceptScript { script } { if {![info complete $script]} { return -code error "invalid Tcl script: $script" } return $script } # Verification command that accepts (converts to) absolute pathnames proc AcceptAbsolutePath { path } { return [file join [pwd] $path] } # Verification command that accepts existing readable directories proc AcceptReadable { path } { if {![file readable $path]} { return -code error "\"$path\" is not readable" } return $path } proc AcceptDirectory { directory } { set directory [AcceptAbsolutePath $directory] if {![file exists $directory]} { return -code error "\"$directory\" does not exist" } if {![file isdir $directory]} { return -code error "\"$directory\" is not a directory" } return [AcceptReadable $directory] } ##### Initialize internal arrays of tcltest, but only if the caller # has not already preinitialized them. This is done to support # compatibility with older tests that directly access internals # rather than go through command interfaces. # proc ArrayDefault {varName value} { variable $varName if {[array exists $varName]} { return } if {[info exists $varName]} { # Preinitialized value is a scalar: Destroy it! unset $varName } array set $varName $value } # save the original environment so that it can be restored later ArrayDefault originalEnv [array get ::env] # initialize numTests array to keep track of the number of tests # that pass, fail, and are skipped. ArrayDefault numTests [list Total 0 Passed 0 Skipped 0 Failed 0] # createdNewFiles will store test files as indices and the list of # files (that should not have been) left behind by the test files # as values. ArrayDefault createdNewFiles {} # initialize skippedBecause array to keep track of constraints that # kept tests from running; a constraint name of "userSpecifiedSkip" # means that the test appeared on the list of tests that matched the # -skip value given to the flag; "userSpecifiedNonMatch" means that # the test didn't match the argument given to the -match flag; both # of these constraints are counted only if tcltest::debug is set to # true. ArrayDefault skippedBecause {} # initialize the testConstraints array to keep track of valid # predefined constraints (see the explanation for the # InitConstraints proc for more details). ArrayDefault testConstraints {} ##### Initialize internal variables of tcltest, but only if the caller # has not already preinitialized them. This is done to support # compatibility with older tests that directly access internals # rather than go through command interfaces. # proc Default {varName value {verify AcceptAll}} { variable $varName if {![info exists $varName]} { variable $varName [$verify $value] } else { variable $varName [$verify [set $varName]] } } # Save any arguments that we might want to pass through to other # programs. This is used by the -args flag. # FINDUSER Default parameters {} # Count the number of files tested (0 if runAllTests wasn't called). # runAllTests will set testSingleFile to false, so stats will # not be printed until runAllTests calls the cleanupTests proc. # The currentFailure var stores the boolean value of whether the # current test file has had any failures. The failFiles list # stores the names of test files that had failures. Default numTestFiles 0 AcceptInteger Default testSingleFile true AcceptBoolean Default currentFailure false AcceptBoolean Default failFiles {} AcceptList # Tests should remove all files they create. The test suite will # check the current working dir for files created by the tests. # filesMade keeps track of such files created using the makeFile and # makeDirectory procedures. filesExisted stores the names of # preexisting files. # # Note that $filesExisted lists only those files that exist in # the original [temporaryDirectory]. Default filesMade {} AcceptList Default filesExisted {} AcceptList proc FillFilesExisted {} { variable filesExisted # Save the names of files that already exist in the scratch directory. foreach file [glob -nocomplain -directory [temporaryDirectory] *] { lappend filesExisted [file tail $file] } # After successful filling, turn this into a no-op. proc FillFilesExisted args {} } # Kept only for compatibility Default constraintsSpecified {} AcceptList trace add variable constraintsSpecified read [namespace code { set constraintsSpecified [array names testConstraints] ;#}] # tests that use threads need to know which is the main thread Default mainThread 1 variable mainThread if {[info commands thread::id] ne {}} { set mainThread [thread::id] } elseif {[info commands testthread] ne {}} { set mainThread [testthread id] } # Set workingDirectory to [pwd]. The default output directory for # Tcl tests is the working directory. Whenever this value changes # change to that directory. variable workingDirectory trace add variable workingDirectory write \ [namespace code {cd $workingDirectory ;#}] Default workingDirectory [pwd] AcceptAbsolutePath proc workingDirectory { {dir ""} } { variable workingDirectory if {[llength [info level 0]] == 1} { return $workingDirectory } set workingDirectory [AcceptAbsolutePath $dir] } # Set the location of the execuatble Default tcltest [info nameofexecutable] trace add variable tcltest write [namespace code {testConstraint stdio \ [eval [ConstraintInitializer stdio]] ;#}] # save the platform information so it can be restored later Default originalTclPlatform [array get ::tcl_platform] # If a core file exists, save its modification time. if {[file exists [file join [workingDirectory] core]]} { Default coreModTime \ [file mtime [file join [workingDirectory] core]] } # stdout and stderr buffers for use when we want to store them Default outData {} Default errData {} # keep track of test level for nested test commands variable testLevel 0 # the variables and procedures that existed when saveState was called are # stored in a variable of the same name Default saveState {} # Internationalization support -- used in [SetIso8859_1_Locale] and # [RestoreLocale]. Those commands are used in cmdIL.test. if {![info exists [namespace current]::isoLocale]} { variable isoLocale fr switch -- $::tcl_platform(platform) { "unix" { # Try some 'known' values for some platforms: switch -exact -- $::tcl_platform(os) { "FreeBSD" { set isoLocale fr_FR.ISO_8859-1 } HP-UX { set isoLocale fr_FR.iso88591 } Linux - IRIX { set isoLocale fr } default { # Works on SunOS 4 and Solaris, and maybe # others... Define it to something else on your # system if you want to test those. set isoLocale iso_8859_1 } } } "windows" { set isoLocale French } } } variable ChannelsWeOpened; array set ChannelsWeOpened {} # output goes to stdout by default Default outputChannel stdout proc outputChannel { {filename ""} } { variable outputChannel variable ChannelsWeOpened variable fullutf # This is very subtle and tricky, so let me try to explain. # (Hopefully this longer comment will be clear when I come # back in a few months, unlike its predecessor :) ) # # The [outputChannel] command (and underlying variable) have to # be kept in sync with the [configure -outfile] configuration # option ( and underlying variable Option(-outfile) ). This is # accomplished with a write trace on Option(-outfile) that will # update [outputChannel] whenever a new value is written. That # much is easy. # # The trick is that in order to maintain compatibility with # version 1 of tcltest, we must allow every configuration option # to get its initial value from command line arguments. This is # accomplished by setting initial read traces on all the # configuration options to parse the command line option the first # time they are read. These traces are cancelled whenever the # program itself calls [configure]. # # OK, then so to support tcltest 1 compatibility, it seems we want # to get the return from [outputFile] to trigger the read traces, # just in case. # # BUT! A little known feature of Tcl variable traces is that # traces are disabled during the handling of other traces. So, # if we trigger read traces on Option(-outfile) and that triggers # command line parsing which turns around and sets an initial # value for Option(-outfile) -- -- the write trace that # would keep [outputChannel] in sync with that new initial value # would not fire! # # SO, finally, as a workaround, instead of triggering read traces # by invoking [outputFile], we instead trigger the same set of # read traces by invoking [debug]. Any command that reads a # configuration option would do. [debug] is just a handy one. # The end result is that we support tcltest 1 compatibility and # keep outputChannel and -outfile in sync in all cases. debug if {[llength [info level 0]] == 1} { return $outputChannel } if {[info exists ChannelsWeOpened($outputChannel)]} { close $outputChannel unset ChannelsWeOpened($outputChannel) } switch -exact -- $filename { stderr - stdout { set outputChannel $filename } default { set outputChannel [open $filename a] if {$fullutf} { fconfigure $outputChannel -profile tcl8 -encoding utf-8 } set ChannelsWeOpened($outputChannel) 1 # If we created the file in [temporaryDirectory], then # [cleanupTests] will delete it, unless we claim it was # already there. set outdir [normalizePath [file dirname \ [file join [pwd] $filename]]] if {$outdir eq [temporaryDirectory]} { variable filesExisted FillFilesExisted set filename [file tail $filename] if {$filename ni $filesExisted} { lappend filesExisted $filename } } } } return $outputChannel } # errors go to stderr by default Default errorChannel stderr proc errorChannel { {filename ""} } { variable errorChannel variable ChannelsWeOpened variable fullutf # This is subtle and tricky. See the comment above in # [outputChannel] for a detailed explanation. debug if {[llength [info level 0]] == 1} { return $errorChannel } if {[info exists ChannelsWeOpened($errorChannel)]} { close $errorChannel unset ChannelsWeOpened($errorChannel) } switch -exact -- $filename { stderr - stdout { set errorChannel $filename } default { set errorChannel [open $filename a] if {$fullutf} { fconfigure $errorChannel -profile tcl8 -encoding utf-8 } set ChannelsWeOpened($errorChannel) 1 # If we created the file in [temporaryDirectory], then # [cleanupTests] will delete it, unless we claim it was # already there. set outdir [normalizePath [file dirname \ [file join [pwd] $filename]]] if {$outdir eq [temporaryDirectory]} { variable filesExisted FillFilesExisted set filename [file tail $filename] if {$filename ni $filesExisted} { lappend filesExisted $filename } } } } return $errorChannel } ##### Set up the configurable options # # The configurable options of the package variable Option; array set Option {} # Usage strings for those options variable Usage; array set Usage {} # Verification commands for those options variable Verify; array set Verify {} # Initialize the default values of the configurable options that are # historically associated with an exported variable. If that variable # is already set, support compatibility by accepting its preset value. # Use [trace] to establish ongoing connection between the deprecated # exported variable and the modern option kept as a true internal var. # Also set up usage string and value testing for the option. proc Option {option value usage {verify AcceptAll} {varName {}}} { variable Option variable Verify variable Usage variable OptionControlledVariables variable DefaultValue set Usage($option) $usage set Verify($option) $verify set DefaultValue($option) $value if {[catch {$verify $value} msg]} { return -code error $msg } else { set Option($option) $msg } if {[string length $varName]} { variable $varName if {[info exists $varName]} { if {[catch {$verify [set $varName]} msg]} { return -code error $msg } else { set Option($option) $msg } unset $varName } namespace eval [namespace current] \ [list upvar 0 Option($option) $varName] # Workaround for Bug (now Feature Request) 572889. Grrrr.... # Track all the variables tied to options lappend OptionControlledVariables $varName # Later, set auto-configure read traces on all # of them, since a single trace on Option does not work. proc $varName {{value {}}} [subst -nocommands { if {[llength [info level 0]] == 2} { Configure $option [set value] } return [Configure $option] }] } } proc MatchingOption {option} { variable Option set match [array names Option $option*] switch -- [llength $match] { 0 { set sorted [lsort [array names Option]] set values [join [lrange $sorted 0 end-1] ", "] append values ", or [lindex $sorted end]" return -code error "unknown option $option: should be\ one of $values" } 1 { return [lindex $match 0] } default { # Exact match trumps ambiguity if {$option in $match} { return $option } set values [join [lrange $match 0 end-1] ", "] append values ", or [lindex $match end]" return -code error "ambiguous option $option:\ could match $values" } } } proc EstablishAutoConfigureTraces {} { variable OptionControlledVariables foreach varName [concat $OptionControlledVariables Option] { variable $varName trace add variable $varName read [namespace code { ProcessCmdLineArgs ;#}] } } proc RemoveAutoConfigureTraces {} { variable OptionControlledVariables foreach varName [concat $OptionControlledVariables Option] { variable $varName foreach pair [trace info variable $varName] { lassign $pair op cmd if {($op eq "read") && [string match *ProcessCmdLineArgs* $cmd]} { trace remove variable $varName $op $cmd } } } # Once the traces are removed, this can become a no-op proc RemoveAutoConfigureTraces {} {} } proc Configure args { variable Option variable Verify set n [llength $args] if {$n == 0} { return [lsort [array names Option]] } if {$n == 1} { if {[catch {MatchingOption [lindex $args 0]} option]} { return -code error $option } return $Option($option) } while {[llength $args] > 1} { if {[catch {MatchingOption [lindex $args 0]} option]} { return -code error $option } if {[catch {$Verify($option) [lindex $args 1]} value]} { return -code error "invalid $option\ value \"[lindex $args 1]\": $value" } set Option($option) $value set args [lrange $args 2 end] } if {[llength $args]} { if {[catch {MatchingOption [lindex $args 0]} option]} { return -code error $option } return -code error "missing value for option $option" } } proc configure args { if {[llength $args] > 1} { RemoveAutoConfigureTraces } set code [catch {Configure {*}$args} msg] return -code $code $msg } proc AcceptVerbose { level } { set level [AcceptList $level] set levelMap { l list p pass b body s skip t start e error l line m msec u usec } set levelRegexp "^([join [dict values $levelMap] |])\$" if {[llength $level] == 1} { if {![regexp $levelRegexp $level]} { # translate single characters abbreviations to expanded list set level [string map $levelMap [split $level {}]] } } set valid [list] foreach v $level { if {[regexp $levelRegexp $v]} { lappend valid $v } } return $valid } proc IsVerbose {level} { variable Option return [expr {$level in $Option(-verbose)}] } # Default verbosity is to show bodies of failed tests Option -verbose {body error} { Takes any combination of the values 'p', 's', 'b', 't', 'e' and 'l'. Test suite will display all passed tests if 'p' is specified, all skipped tests if 's' is specified, the bodies of failed tests if 'b' is specified, and when tests start if 't' is specified. ErrorInfo is displayed if 'e' is specified. Source file line information of failed tests is displayed if 'l' is specified. } AcceptVerbose verbose # Match and skip patterns default to the empty list, except for # matchFiles, which defaults to all .test files in the # testsDirectory and matchDirectories, which defaults to all # directories. Option -match * { Run all tests within the specified files that match one of the list of glob patterns given. } AcceptList match Option -skip {} { Skip all tests within the specified tests (via -match) and files that match one of the list of glob patterns given. } AcceptList skip Option -file *.test { Run tests in all test files that match the glob pattern given. } AcceptPattern matchFiles # By default, skip files that appear to be SCCS lock files. Option -notfile l.*.test { Skip all test files that match the glob pattern given. } AcceptPattern skipFiles Option -relateddir * { Run tests in directories that match the glob pattern given. } AcceptPattern matchDirectories Option -asidefromdir {} { Skip tests in directories that match the glob pattern given. } AcceptPattern skipDirectories # By default, don't save core files Option -preservecore 0 { If 2, save any core files produced during testing in the directory specified by -tmpdir. If 1, notify the user if core files are created. } AcceptInteger preserveCore # debug output doesn't get printed by default; debug level 1 spits # up only the tests that were skipped because they didn't match or # were specifically skipped. A debug level of 2 would spit up the # tcltest variables and flags provided; a debug level of 3 causes # some additional output regarding operations of the test harness. # The tcltest package currently implements only up to debug level 3. Option -debug 0 { Internal debug level } AcceptInteger debug proc SetSelectedConstraints args { variable Option foreach c $Option(-constraints) { testConstraint $c 1 } } Option -constraints {} { Do not skip the listed constraints listed in -constraints. } AcceptList trace add variable Option(-constraints) write \ [namespace code {SetSelectedConstraints ;#}] # Don't run only the "-constraint" specified tests by default proc ClearUnselectedConstraints args { variable Option variable testConstraints if {!$Option(-limitconstraints)} {return} foreach c [array names testConstraints] { if {$c ni $Option(-constraints)} { testConstraint $c 0 } } } Option -limitconstraints 0 { whether to run only tests with the constraints } AcceptBoolean limitConstraints trace add variable Option(-limitconstraints) write \ [namespace code {ClearUnselectedConstraints ;#}] # A test application has to know how to load the tested commands # into the interpreter. Option -load {} { Specifies the script to load the tested commands. } AcceptScript loadScript # Default is to run each test file in a separate process Option -singleproc 0 { whether to run all tests in one process } AcceptBoolean singleProcess proc AcceptTemporaryDirectory { directory } { set directory [AcceptAbsolutePath $directory] if {![file exists $directory]} { file mkdir $directory } set directory [AcceptDirectory $directory] if {![file writable $directory]} { if {[workingDirectory] eq $directory} { # Special exception: accept the default value # even if the directory is not writable return $directory } return -code error "\"$directory\" is not writable" } return $directory } # Directory where files should be created Option -tmpdir [workingDirectory] { Save temporary files in the specified directory. } AcceptTemporaryDirectory temporaryDirectory trace add variable Option(-tmpdir) write \ [namespace code {normalizePath Option(-tmpdir) ;#}] # Tests should not rely on the current working directory. # Files that are part of the test suite should be accessed relative # to [testsDirectory] Option -testdir [workingDirectory] { Search tests in the specified directory. } AcceptDirectory testsDirectory trace add variable Option(-testdir) write \ [namespace code {normalizePath Option(-testdir) ;#}] proc AcceptLoadFile { file } { if {$file eq {}} {return $file} set file [file join [temporaryDirectory] $file] return [AcceptReadable $file] } proc ReadLoadScript {args} { variable Option variable fullutf if {$Option(-loadfile) eq {}} {return} set tmp [open $Option(-loadfile) r] if {$fullutf} { fconfigure $tmp -profile tcl8 -encoding utf-8 } loadScript [read $tmp] close $tmp } Option -loadfile {} { Read the script to load the tested commands from the specified file. } AcceptLoadFile loadFile trace add variable Option(-loadfile) write [namespace code ReadLoadScript] proc AcceptOutFile { file } { if {[string equal stderr $file]} {return $file} if {[string equal stdout $file]} {return $file} return [file join [temporaryDirectory] $file] } # output goes to stdout by default Option -outfile stdout { Send output from test runs to the specified file. } AcceptOutFile outputFile trace add variable Option(-outfile) write \ [namespace code {outputChannel $Option(-outfile) ;#}] # errors go to stderr by default Option -errfile stderr { Send errors from test runs to the specified file. } AcceptOutFile errorFile trace add variable Option(-errfile) write \ [namespace code {errorChannel $Option(-errfile) ;#}] proc loadIntoChildInterpreter {child args} { variable Version interp eval $child [package ifneeded tcltest $Version] interp eval $child "tcltest::configure {*}{$args}" interp alias $child ::tcltest::ReportToParent \ {} ::tcltest::ReportedFromChild } proc ReportedFromChild {total passed skipped failed because newfiles} { variable numTests variable skippedBecause variable createdNewFiles incr numTests(Total) $total incr numTests(Passed) $passed incr numTests(Skipped) $skipped incr numTests(Failed) $failed foreach {constraint count} $because { incr skippedBecause($constraint) $count } foreach {testfile created} $newfiles { lappend createdNewFiles($testfile) {*}$created } return } } ##################################################################### # tcltest::Debug* -- # # Internal helper procedures to write out debug information # dependent on the chosen level. A test shell may override # them, f.e. to redirect the output into a different # channel, or even into a GUI. # tcltest::DebugPuts -- # # Prints the specified string if the current debug level is # higher than the provided level argument. # # Arguments: # level The lowest debug level triggering the output # string The string to print out. # # Results: # Prints the string. Nothing else is allowed. # # Side Effects: # None. # proc tcltest::DebugPuts {level string} { variable debug if {$debug >= $level} { puts $string } return } # tcltest::DebugPArray -- # # Prints the contents of the specified array if the current # debug level is higher than the provided level argument # # Arguments: # level The lowest debug level triggering the output # arrayvar The name of the array to print out. # # Results: # Prints the contents of the array. Nothing else is allowed. # # Side Effects: # None. # proc tcltest::DebugPArray {level arrayvar} { variable debug if {$debug >= $level} { catch {upvar 1 $arrayvar $arrayvar} parray $arrayvar } return } # Define our own [parray] in ::tcltest that will inherit use of the [puts] # defined in ::tcltest. NOTE: Ought to construct with [info args] and # [info default], but can't be bothered now. If [parray] changes, then # this will need changing too. auto_load ::parray proc tcltest::parray {a {pattern *}} [info body ::parray] # tcltest::DebugDo -- # # Executes the script if the current debug level is greater than # the provided level argument # # Arguments: # level The lowest debug level triggering the execution. # script The tcl script executed upon a debug level high enough. # # Results: # Arbitrary side effects, dependent on the executed script. # # Side Effects: # None. # proc tcltest::DebugDo {level script} { variable debug if {$debug >= $level} { uplevel 1 $script } return } ##################################################################### proc tcltest::Warn {msg} { puts [outputChannel] "WARNING: $msg" } # tcltest::mainThread # # Accessor command for tcltest variable mainThread. # proc tcltest::mainThread { {new ""} } { variable mainThread if {[llength [info level 0]] == 1} { return $mainThread } set mainThread $new } # tcltest::testConstraint -- # # sets a test constraint to a value; to do multiple constraints, # call this proc multiple times. also returns the value of the # named constraint if no value was supplied. # # Arguments: # constraint - name of the constraint # value - new value for constraint (should be boolean) - if not # supplied, this is a query # # Results: # content of tcltest::testConstraints($constraint) # # Side effects: # none proc tcltest::testConstraint {constraint {value ""}} { variable testConstraints variable Option DebugPuts 3 "entering testConstraint $constraint $value" if {[llength [info level 0]] == 2} { return $testConstraints($constraint) } # Check for boolean values if {[catch {expr {$value && 1}} msg]} { return -code error $msg } if {[limitConstraints] && ($constraint ni $Option(-constraints))} { set value 0 } set testConstraints($constraint) $value } # tcltest::interpreter -- # # the interpreter name stored in tcltest::tcltest # # Arguments: # executable name # # Results: # content of tcltest::tcltest # # Side effects: # None. proc tcltest::interpreter { {interp ""} } { variable tcltest if {[llength [info level 0]] == 1} { return $tcltest } set tcltest $interp } ##################################################################### # tcltest::AddToSkippedBecause -- # # Increments the variable used to track how many tests were # skipped because of a particular constraint. # # Arguments: # constraint The name of the constraint to be modified # # Results: # Modifies tcltest::skippedBecause; sets the variable to 1 if # didn't previously exist - otherwise, it just increments it. # # Side effects: # None. proc tcltest::AddToSkippedBecause { constraint {value 1}} { # add the constraint to the list of constraints that kept tests # from running variable skippedBecause if {[info exists skippedBecause($constraint)]} { incr skippedBecause($constraint) $value } else { set skippedBecause($constraint) $value } return } # tcltest::PrintError -- # # Prints errors to tcltest::errorChannel and then flushes that # channel, making sure that all messages are < 80 characters per # line. # # Arguments: # errorMsg String containing the error to be printed # # Results: # None. # # Side effects: # None. proc tcltest::PrintError {errorMsg} { set InitialMessage "Error: " set InitialMsgLen [string length $InitialMessage] puts -nonewline [errorChannel] $InitialMessage # Keep track of where the end of the string is. set endingIndex [string length $errorMsg] if {$endingIndex < (80 - $InitialMsgLen)} { puts [errorChannel] $errorMsg } else { # Print up to 80 characters on the first line, including the # InitialMessage. set beginningIndex [string last " " [string range $errorMsg 0 \ [expr {80 - $InitialMsgLen}]]] puts [errorChannel] [string range $errorMsg 0 $beginningIndex] while {$beginningIndex ne "end"} { puts -nonewline [errorChannel] \ [string repeat " " $InitialMsgLen] if {($endingIndex - $beginningIndex) < (80 - $InitialMsgLen)} { puts [errorChannel] [string trim \ [string range $errorMsg $beginningIndex end]] break } else { set newEndingIndex [expr {[string last " " \ [string range $errorMsg $beginningIndex \ [expr {$beginningIndex + (80 - $InitialMsgLen)}] ]] + $beginningIndex}] if {($newEndingIndex <= 0) || ($newEndingIndex <= $beginningIndex)} { set newEndingIndex end } puts [errorChannel] [string trim \ [string range $errorMsg \ $beginningIndex $newEndingIndex]] set beginningIndex $newEndingIndex } } } flush [errorChannel] return } # tcltest::SafeFetch -- # # The following trace procedure makes it so that we can safely # refer to non-existent members of the testConstraints array # without causing an error. Instead, reading a non-existent # member will return 0. This is necessary because tests are # allowed to use constraint "X" without ensuring that # testConstraints("X") is defined. # # Arguments: # n1 - name of the array (testConstraints) # n2 - array key value (constraint name) # op - operation performed on testConstraints (generally r) # # Results: # none # # Side effects: # sets testConstraints($n2) to 0 if it's referenced but never # before used proc tcltest::SafeFetch {n1 n2 op} { variable testConstraints DebugPuts 3 "entering SafeFetch $n1 $n2 $op" if {$n2 eq {}} {return} if {![info exists testConstraints($n2)]} { if {[catch {testConstraint $n2 [eval [ConstraintInitializer $n2]]}]} { testConstraint $n2 0 } } } # tcltest::Asciify -- # # Transforms the passed string to contain only printable ascii characters. # Useful for printing to terminals. Non-printables are mapped to # \x, \u or \U sequences, except \n. # # Arguments: # s - string to transform # # Results: # The transformed strings # # Side effects: # None. proc tcltest::Asciify {s} { set print "" foreach c [split $s ""] { if {(($c < "\x7F") && [string is print $c]) || ($c eq "\n")} { append print $c } elseif {$c < "\u0100"} { append print \\x[format %02X [scan $c %c]] } elseif {$c > "\uFFFF"} { append print \\U[format %08X [scan $c %c]] } else { append print \\u[format %04X [scan $c %c]] } } return $print } # tcltest::ConstraintInitializer -- # # Get or set a script that when evaluated in the tcltest namespace # will return a boolean value with which to initialize the # associated constraint. # # Arguments: # constraint - name of the constraint initialized by the script # script - the initializer script # # Results # boolean value of the constraint - enabled or disabled # # Side effects: # Constraint is initialized for future reference by [test] proc tcltest::ConstraintInitializer {constraint {script ""}} { variable ConstraintInitializer DebugPuts 3 "entering ConstraintInitializer $constraint $script" if {[llength [info level 0]] == 2} { return $ConstraintInitializer($constraint) } # Check for boolean values if {![info complete $script]} { return -code error "ConstraintInitializer must be complete script" } set ConstraintInitializer($constraint) $script } # tcltest::InitConstraints -- # # Call all registered constraint initializers to force initialization # of all known constraints. # See the tcltest man page for the list of built-in constraints defined # in this procedure. # # Arguments: # none # # Results: # The testConstraints array is reset to have an index for each # built-in test constraint. # # Side Effects: # None. # proc tcltest::InitConstraints {} { variable ConstraintInitializer initConstraintsHook foreach constraint [array names ConstraintInitializer] { testConstraint $constraint } } proc tcltest::DefineConstraintInitializers {} { ConstraintInitializer singleTestInterp {singleProcess} # All the 'pc' constraints are here for backward compatibility and # are not documented. They have been replaced with equivalent 'win' # constraints. ConstraintInitializer unixOnly \ {string equal $::tcl_platform(platform) unix} ConstraintInitializer macOnly \ {string equal $::tcl_platform(platform) macintosh} ConstraintInitializer pcOnly \ {string equal $::tcl_platform(platform) windows} ConstraintInitializer winOnly \ {string equal $::tcl_platform(platform) windows} ConstraintInitializer unix {testConstraint unixOnly} ConstraintInitializer mac {testConstraint macOnly} ConstraintInitializer pc {testConstraint pcOnly} ConstraintInitializer win {testConstraint winOnly} ConstraintInitializer unixOrPc \ {expr {[testConstraint unix] || [testConstraint pc]}} ConstraintInitializer macOrPc \ {expr {[testConstraint mac] || [testConstraint pc]}} ConstraintInitializer unixOrWin \ {expr {[testConstraint unix] || [testConstraint win]}} ConstraintInitializer macOrWin \ {expr {[testConstraint mac] || [testConstraint win]}} ConstraintInitializer macOrUnix \ {expr {[testConstraint mac] || [testConstraint unix]}} ConstraintInitializer nt {string equal $::tcl_platform(os) "Windows NT"} ConstraintInitializer 95 {string equal $::tcl_platform(os) "Windows 95"} ConstraintInitializer 98 {string equal $::tcl_platform(os) "Windows 98"} # The following Constraints switches are used to mark tests that # should work, but have been temporarily disabled on certain # platforms because they don't and we haven't gotten around to # fixing the underlying problem. ConstraintInitializer tempNotPc {expr {![testConstraint pc]}} ConstraintInitializer tempNotWin {expr {![testConstraint win]}} ConstraintInitializer tempNotMac {expr {![testConstraint mac]}} ConstraintInitializer tempNotUnix {expr {![testConstraint unix]}} # The following Constraints switches are used to mark tests that # crash on certain platforms, so that they can be reactivated again # when the underlying problem is fixed. ConstraintInitializer pcCrash {expr {![testConstraint pc]}} ConstraintInitializer winCrash {expr {![testConstraint win]}} ConstraintInitializer macCrash {expr {![testConstraint mac]}} ConstraintInitializer unixCrash {expr {![testConstraint unix]}} # Skip empty tests ConstraintInitializer emptyTest {expr 0} # By default, tests that expose known bugs are skipped. ConstraintInitializer knownBug {expr 0} # By default, non-portable tests are skipped. ConstraintInitializer nonPortable {expr 0} # By default, extremely slow, extensive or IO-aggressive tests are skipped. ConstraintInitializer extensive {expr 0} # Some tests require user interaction. ConstraintInitializer userInteraction {expr 0} # Some tests must be skipped if the interpreter is not in # interactive mode ConstraintInitializer interactive \ {expr {[info exists ::tcl_interactive] && $::tcl_interactive}} # Some tests can only be run if the installation came from a CD # image instead of a web image. Some tests must be skipped if you # are running as root on Unix. Other tests can only be run if you # are running as root on Unix. ConstraintInitializer root {expr \ {($::tcl_platform(platform) eq "unix") && ($::tcl_platform(user) in {root {}})}} ConstraintInitializer notRoot {expr {![testConstraint root]}} # Set nonBlockFiles constraint: 1 means this platform supports # setting files into nonblocking mode. ConstraintInitializer nonBlockFiles { set code [expr {[catch {set f [open defs r]}] || [catch {fconfigure $f -blocking off}]}] catch {close $f} set code } # Set asyncPipeClose constraint: 1 means this platform supports # async flush and async close on a pipe. # # Test for SCO Unix - cannot run async flushing tests because a # potential problem with select is apparently interfering. # (Mark Diekhans). ConstraintInitializer asyncPipeClose {expr { !([string equal unix $::tcl_platform(platform)] && ([catch {exec uname -X | fgrep {Release = 3.2v}}] == 0))}} # Test to see if we have a broken version of sprintf with respect # to the "e" format of floating-point numbers. ConstraintInitializer eformat {string equal [format %g 5e-5] 5e-05} # Test to see if execed commands such as cat, echo, rm and so forth # are present on this machine. ConstraintInitializer unixExecs { set code 1 if {$::tcl_platform(platform) eq "macintosh"} { set code 0 } if {$::tcl_platform(platform) eq "windows"} { if {[catch { set file _tcl_test_remove_me.txt makeFile {hello} $file }]} { set code 0 } elseif { [catch {exec cat $file}] || [catch {exec echo hello}] || [catch {exec sh -c echo hello}] || [catch {exec wc $file}] || [catch {exec sleep 1}] || [catch {exec echo abc > $file}] || [catch {exec chmod 644 $file}] || [catch {exec rm $file}] || [llength [auto_execok mkdir]] == 0 || [llength [auto_execok fgrep]] == 0 || [llength [auto_execok grep]] == 0 || [llength [auto_execok ps]] == 0 } { set code 0 } removeFile $file } set code } ConstraintInitializer stdio { variable fullutf set code 0 if {![catch {set f [open "|[list [interpreter]]" w]}]} { if {$fullutf} { fconfigure $f -profile tcl8 -encoding utf-8 } if {![catch {puts $f exit}]} { if {![catch {close $f}]} { set code 1 } } } set code } # Deliberately call socket with the wrong number of arguments. The # error message you get will indicate whether sockets are available # on this system. ConstraintInitializer socket { catch {socket} msg string compare $msg "sockets are not available on this system" } # Check for internationalization ConstraintInitializer hasIsoLocale { if {[llength [info commands testlocale]] == 0} { set code 0 } else { set code [string length [SetIso8859_1_Locale]] RestoreLocale } set code } } ##################################################################### # Usage and command line arguments processing. # tcltest::PrintUsageInfo # # Prints out the usage information for package tcltest. This can # be customized with the redefinition of [PrintUsageInfoHook]. # # Arguments: # none # # Results: # none # # Side Effects: # none proc tcltest::PrintUsageInfo {} { puts [Usage] PrintUsageInfoHook } proc tcltest::Usage { {option ""} } { variable Usage variable Verify if {[llength [info level 0]] == 1} { set msg "Usage: [file tail [info nameofexecutable]] script " append msg "?-help? ?flag value? ... \n" append msg "Available flags (and valid input values) are:" set max 0 set allOpts [concat -help [Configure]] foreach opt $allOpts { set foo [Usage $opt] lassign $foo x type($opt) usage($opt) set line($opt) " $opt $type($opt) " set length($opt) [string length $line($opt)] if {$length($opt) > $max} {set max $length($opt)} } set rest [expr {72 - $max}] foreach opt $allOpts { append msg \n$line($opt) append msg [string repeat " " [expr {$max - $length($opt)}]] set u [string trim $usage($opt)] catch {append u " (default: \[[Configure $opt]])"} regsub -all {\s*\n\s*} $u " " u while {[string length $u] > $rest} { set break [string wordstart $u $rest] if {$break == 0} { set break [string wordend $u 0] } append msg [string range $u 0 [expr {$break - 1}]] set u [string trim [string range $u $break end]] append msg \n[string repeat " " $max] } append msg $u } return $msg\n } elseif {$option eq "-help"} { return [list -help "" "Display this usage information."] } else { set type [lindex [info args $Verify($option)] 0] return [list $option $type $Usage($option)] } } # tcltest::ProcessFlags -- # # process command line arguments supplied in the flagArray - this # is called by processCmdLineArgs. Modifies tcltest variables # according to the content of the flagArray. # # Arguments: # flagArray - array containing name/value pairs of flags # # Results: # sets tcltest variables according to their values as defined by # flagArray # # Side effects: # None. proc tcltest::ProcessFlags {flagArray} { # Process -help first if {"-help" in $flagArray} { PrintUsageInfo exit 1 } if {[llength $flagArray] == 0} { RemoveAutoConfigureTraces } else { set args $flagArray while {[llength $args] > 1 && [catch {configure {*}$args} msg]} { # Something went wrong parsing $args for tcltest options # Check whether the problem is "unknown option" if {[regexp {^unknown option (\S+):} $msg -> option]} { # Could be this is an option the Hook knows about set moreOptions [processCmdLineArgsAddFlagsHook] if {$option ni $moreOptions} { # Nope. Report the error, including additional options, # but keep going if {[llength $moreOptions]} { append msg ", " append msg [join [lrange $moreOptions 0 end-1] ", "] append msg "or [lindex $moreOptions end]" } Warn $msg } } else { # error is something other than "unknown option" # notify user of the error; and exit puts [errorChannel] $msg exit 1 } # To recover, find that unknown option and remove up to it. # then retry while {[lindex $args 0] ne $option} { set args [lrange $args 2 end] } set args [lrange $args 2 end] } if {[llength $args] == 1} { puts [errorChannel] \ "missing value for option [lindex $args 0]" exit 1 } } # Call the hook catch { array set flag $flagArray processCmdLineArgsHook [array get flag] } return } # tcltest::ProcessCmdLineArgs -- # # This procedure must be run after constraint initialization is # set up (by [DefineConstraintInitializers]) because some constraints # can be overridden. # # Perform configuration according to the command-line options. # # Arguments: # none # # Results: # Sets the above-named variables in the tcltest namespace. # # Side Effects: # None. # proc tcltest::ProcessCmdLineArgs {} { variable originalEnv variable testConstraints # The "argv" var doesn't exist in some cases, so use {}. if {![info exists ::argv]} { ProcessFlags {} } else { ProcessFlags $::argv } # Spit out everything you know if we're at a debug level 2 or # greater DebugPuts 2 "Flags passed into tcltest:" if {[info exists ::env(TCLTEST_OPTIONS)]} { DebugPuts 2 \ " ::env(TCLTEST_OPTIONS): $::env(TCLTEST_OPTIONS)" } if {[info exists ::argv]} { DebugPuts 2 " argv: $::argv" } DebugPuts 2 "tcltest::debug = [debug]" DebugPuts 2 "tcltest::testsDirectory = [testsDirectory]" DebugPuts 2 "tcltest::workingDirectory = [workingDirectory]" DebugPuts 2 "tcltest::temporaryDirectory = [temporaryDirectory]" DebugPuts 2 "tcltest::outputChannel = [outputChannel]" DebugPuts 2 "tcltest::errorChannel = [errorChannel]" DebugPuts 2 "Original environment (tcltest::originalEnv):" DebugPArray 2 originalEnv DebugPuts 2 "Constraints:" DebugPArray 2 testConstraints } ##################################################################### # Code to run the tests goes here. # tcltest::TestPuts -- # # Used to redefine puts in test environment. Stores whatever goes # out on stdout in tcltest::outData and stderr in errData before # sending it on to the regular puts. # # Arguments: # same as standard puts # # Results: # none # # Side effects: # Intercepts puts; data that would otherwise go to stdout, stderr, # or file channels specified in outputChannel and errorChannel # does not get sent to the normal puts function. namespace eval tcltest::Replace { namespace export puts } proc tcltest::Replace::puts {args} { variable [namespace parent]::outData variable [namespace parent]::errData switch [llength $args] { 1 { # Only the string to be printed is specified append outData [lindex $args 0]\n return # return [Puts [lindex $args 0]] } 2 { # Either -nonewline or channel has been specified if {[lindex $args 0] eq "-nonewline"} { append outData [lindex $args end] return # return [Puts -nonewline [lindex $args end]] } else { set channel [lindex $args 0] set newline \n } } 3 { if {[lindex $args 0] eq "-nonewline"} { # Both -nonewline and channel are specified, unless # it's an error. -nonewline is supposed to be argv[0]. set channel [lindex $args 1] set newline "" } } } if {[info exists channel]} { if {$channel in [list [[namespace parent]::outputChannel] stdout]} { append outData [lindex $args end]$newline return } elseif {$channel in [list [[namespace parent]::errorChannel] stderr]} { append errData [lindex $args end]$newline return } } # If we haven't returned by now, we don't know how to handle the # input. Let puts handle it. return [Puts {*}$args] } # tcltest::Eval -- # # Evaluate the script in the test environment. If ignoreOutput is # false, store data sent to stderr and stdout in outData and # errData. Otherwise, ignore this output altogether. # # Arguments: # script Script to evaluate # ?ignoreOutput? Indicates whether or not to ignore output # sent to stdout & stderr # # Results: # result from running the script # # Side effects: # Empties the contents of outData and errData before running a # test if ignoreOutput is set to 0. proc tcltest::Eval {script {ignoreOutput 1}} { variable outData variable errData DebugPuts 3 "[lindex [info level 0] 0] called" if {!$ignoreOutput} { set outData {} set errData {} rename ::puts [namespace current]::Replace::Puts namespace eval :: [list namespace import [namespace origin Replace::puts]] namespace import Replace::puts } set result [uplevel 1 $script] if {!$ignoreOutput} { namespace forget puts namespace eval :: namespace forget puts rename [namespace current]::Replace::Puts ::puts } return $result } # tcltest::CompareStrings -- # # compares the expected answer to the actual answer, depending on # the mode provided. Mode determines whether a regexp, exact, # glob or custom comparison is done. # # Arguments: # actual - string containing the actual result # expected - pattern to be matched against # mode - type of comparison to be done # # Results: # result of the match # # Side effects: # None. proc tcltest::CompareStrings {actual expected mode} { variable CustomMatch if {![info exists CustomMatch($mode)]} { return -code error "No matching command registered for `-match $mode'" } set match [namespace eval :: $CustomMatch($mode) [list $expected $actual]] if {[catch {expr {$match && $match}} result]} { return -code error "Invalid result from `-match $mode' command: $result" } return $match } # tcltest::customMatch -- # # registers a command to be called when a particular type of # matching is required. # # Arguments: # nickname - Keyword for the type of matching # cmd - Incomplete command that implements that type of matching # when completed with expected string and actual string # and then evaluated. # # Results: # None. # # Side effects: # Sets the variable tcltest::CustomMatch proc tcltest::customMatch {mode script} { variable CustomMatch if {![info complete $script]} { return -code error \ "invalid customMatch script; can't evaluate after completion" } set CustomMatch($mode) $script } # tcltest::SubstArguments list # # This helper function takes in a list of words, then perform a # substitution on the list as though each word in the list is a separate # argument to the Tcl function. For example, if this function is # invoked as: # # SubstArguments {$a {$a}} # # Then it is as though the function is invoked as: # # SubstArguments $a {$a} # # This code is adapted from Paul Duffin's function "SplitIntoWords". # The original function can be found on: # # http://purl.org/thecliff/tcl/wiki/858.html # # Results: # a list containing the result of the substitution # # Exceptions: # An error may occur if the list containing unbalanced quote or # unknown variable. # # Side Effects: # None. # proc tcltest::SubstArguments {argList} { # We need to split the argList up into tokens but cannot use list # operations as they throw away some significant quoting, and # [split] ignores braces as it should. Therefore what we do is # gradually build up a string out of whitespace-separated strings. # We cannot use [split] to split the argList into whitespace # separated strings as it throws away the whitespace which maybe # important so we have to do it all by hand. set result {} set token "" while {[string length $argList]} { # Look for the next word containing a quote: " { } if {[regexp -indices {[^ \t\n]*[\"\{\}]+[^ \t\n]*} \ $argList all]} { # Get the text leading up to this word, but not including # this word, from the argList. set text [string range $argList 0 \ [expr {[lindex $all 0] - 1}]] # Get the word with the quote set word [string range $argList \ [lindex $all 0] [lindex $all 1]] # Remove all text up to and including the word from the # argList. set argList [string range $argList \ [expr {[lindex $all 1] + 1}] end] } else { # Take everything up to the end of the argList. set text $argList set word {} set argList {} } if {$token ne {}} { # If we saw a word with quote before, then there is a # multi-word token starting with that word. In this case, # add the text and the current word to this token. append token $text $word } else { # Add the text to the result. There is no need to parse # the text because it couldn't be a part of any multi-word # token. Then start a new multi-word token with the word # because we need to pass this token to the Tcl parser to # check for balancing quotes append result $text set token $word } if { [catch {llength $token} length] == 0 && $length == 1} { # The token is a valid list so add it to the result. # lappend result [string trim $token] append result \{$token\} set token {} } } # If the last token has not been added to the list then there # is a problem. if { [string length $token] } { error "incomplete token \"$token\"" } return $result } # tcltest::test -- # # This procedure runs a test and prints an error message if the test # fails. If verbose has been set, it also prints a message even if the # test succeeds. The test will be skipped if it doesn't match the # match variable, if it matches an element in skip, or if one of the # elements of "constraints" turns out not to be true. # # If testLevel is 1, then this is a top level test, and we record # pass/fail information; otherwise, this information is not logged and # is not added to running totals. # # Attributes: # Only description is a required attribute. All others are optional. # Default values are indicated. # # constraints - A list of one or more keywords, each of which # must be the name of an element in the array # "testConstraints". If any of these elements is # zero, the test is skipped. This attribute is # optional; default is {} # body - Script to run to carry out the test. It must # return a result that can be checked for # correctness. This attribute is optional; # default is {} # result - Expected result from script. This attribute is # optional; default is {}. # output - Expected output sent to stdout. This attribute # is optional; default is {}. # errorOutput - Expected output sent to stderr. This attribute # is optional; default is {}. # returnCodes - Expected return codes. This attribute is # optional; default is {0 2}. # errorCode - Expected error code. This attribute is # optional; default is {*}. It is a glob pattern. # If given, returnCodes defaults to {1}. # setup - Code to run before $script (above). This # attribute is optional; default is {}. # cleanup - Code to run after $script (above). This # attribute is optional; default is {}. # match - specifies type of matching to do on result, # output, errorOutput; this must be a string # previously registered by a call to [customMatch]. # The strings exact, glob, and regexp are preregistered # by the tcltest package. Default value is exact. # # Arguments: # name - Name of test, in the form foo-1.2. # description - Short textual description of the test, to # help humans understand what it does. # # Results: # None. # # Side effects: # Just about anything is possible depending on the test. # proc tcltest::test {name description args} { global tcl_platform variable testLevel variable coreModTime variable fullutf DebugPuts 3 "test $name $args" DebugDo 1 { variable TestNames catch { puts "test name '$name' re-used; prior use in $TestNames($name)" } set TestNames($name) [info script] } FillFilesExisted incr testLevel # Predefine everything to null except output and errorOutput. We # determine whether or not to trap output based on whether or not # these variables (output & errorOutput) are defined. lassign {} constraints setup cleanup body result returnCodes errorCode match # Set the default match mode set match exact # Set the default match values for return codes (0 is the standard # expected return value if everything went well; 2 represents # 'return' being used in the test script). set returnCodes [list 0 2] # Set the default error code pattern set errorCode "*" # The old test format can't have a 3rd argument (constraints or # script) that starts with '-'. if {[string match -* [lindex $args 0]] || ([llength $args] <= 1)} { if {[llength $args] == 1} { set list [SubstArguments [lindex $args 0]] foreach {element value} $list { set testAttributes($element) $value } foreach item {constraints match setup body cleanup \ result returnCodes errorCode output errorOutput} { if {[info exists testAttributes(-$item)]} { set testAttributes(-$item) [uplevel 1 \ ::concat $testAttributes(-$item)] } } } else { array set testAttributes $args } set validFlags {-setup -cleanup -body -result -returnCodes \ -errorCode -match -output -errorOutput -constraints} foreach flag [array names testAttributes] { if {$flag ni $validFlags} { incr testLevel -1 set sorted [lsort $validFlags] set options [join [lrange $sorted 0 end-1] ", "] append options ", or [lindex $sorted end]" return -code error "bad option \"$flag\": must be $options" } } # store whatever the user gave us foreach item [array names testAttributes] { set [string trimleft $item "-"] $testAttributes($item) } # Check the values supplied for -match variable CustomMatch if {$match ni [array names CustomMatch]} { incr testLevel -1 set sorted [lsort [array names CustomMatch]] set values [join [lrange $sorted 0 end-1] ", "] append values ", or [lindex $sorted end]" return -code error "bad -match value \"$match\":\ must be $values" } # Replace symbolic valies supplied for -returnCodes foreach {strcode numcode} {ok 0 normal 0 error 1 return 2 break 3 continue 4} { set returnCodes [string map -nocase [list $strcode $numcode] $returnCodes] } # errorCode without returnCode 1 is meaningless if {$errorCode ne "*" && 1 ni $returnCodes} { set returnCodes 1 } } else { # This is parsing for the old test command format; it is here # for backward compatibility. set result [lindex $args end] if {[llength $args] == 2} { set body [lindex $args 0] } elseif {[llength $args] == 3} { set constraints [lindex $args 0] set body [lindex $args 1] } else { incr testLevel -1 return -code error "wrong # args:\ should be \"test name desc ?options?\"" } } if {[Skipped $name $constraints]} { incr testLevel -1 return } # Save information about the core file. if {[preserveCore]} { if {[file exists [file join [workingDirectory] core]]} { set coreModTime [file mtime [file join [workingDirectory] core]] } } # First, run the setup script (or a hook if it presents): if {[set cmd [namespace which -command [namespace current]::SetupTest]] ne ""} { set setup [list $cmd $setup] } set processTest 1 set code [catch {uplevel 1 $setup} setupMsg] if {$code == 1} { set errorInfo(setup) $::errorInfo set errorCodeRes(setup) $::errorCode if {$errorCodeRes(setup) eq "BYPASS-SKIPPED-TEST"} { _noticeSkipped $name $setupMsg set processTest [set code 0] } } set setupFailure [expr {$code != 0}] # Only run the test body if the setup was successful if {$processTest && !$setupFailure} { # Register startup time if {[IsVerbose msec] || [IsVerbose usec]} { set timeStart [clock microseconds] } # Verbose notification of $body start if {[IsVerbose start]} { puts [outputChannel] "---- $name start" flush [outputChannel] } set command [list [namespace origin RunTest] $name $body] if {[info exists output] || [info exists errorOutput]} { set testResult [uplevel 1 [list [namespace origin Eval] $command 0]] } else { set testResult [uplevel 1 [list [namespace origin Eval] $command 1]] } lassign $testResult actualAnswer returnCode if {$returnCode == 1} { set errorInfo(body) $::errorInfo set errorCodeRes(body) $::errorCode if {$errorCodeRes(body) eq "BYPASS-SKIPPED-TEST"} { _noticeSkipped $name $actualAnswer set processTest [set returnCode 0] } } } # check if the return code matched the expected return code set codeFailure 0 if {$processTest && !$setupFailure && ($returnCode ni $returnCodes)} { set codeFailure 1 } set errorCodeFailure 0 if {$processTest && !$setupFailure && !$codeFailure && $returnCode == 1 && \ ![string match $errorCode $errorCodeRes(body)]} { set errorCodeFailure 1 } # If expected output/error strings exist, we have to compare # them. If the comparison fails, then so did the test. set outputFailure 0 variable outData if {$processTest && [info exists output] && !$codeFailure} { if {[set outputCompare [catch { CompareStrings $outData $output $match } outputMatch]] == 0} { set outputFailure [expr {!$outputMatch}] } else { set outputFailure 1 } } set errorFailure 0 variable errData if {$processTest && [info exists errorOutput] && !$codeFailure} { if {[set errorCompare [catch { CompareStrings $errData $errorOutput $match } errorMatch]] == 0} { set errorFailure [expr {!$errorMatch}] } else { set errorFailure 1 } } # check if the answer matched the expected answer # Only check if we ran the body of the test (no setup failure) if {!$processTest} { set scriptFailure 0 } elseif {$setupFailure || $codeFailure} { set scriptFailure 0 } elseif {[set scriptCompare [catch { CompareStrings $actualAnswer $result $match } scriptMatch]] == 0} { set scriptFailure [expr {!$scriptMatch}] } else { set scriptFailure 1 } # Always run the cleanup script (or a hook if it presents): if {[set cmd [namespace which -command [namespace current]::CleanupTest]] ne ""} { set cleanup [list $cmd $cleanup] } set code [catch {uplevel 1 $cleanup} cleanupMsg] if {$code == 1} { set errorInfo(cleanup) $::errorInfo set errorCodeRes(cleanup) $::errorCode } set cleanupFailure [expr {$code != 0}] set coreFailure 0 set coreMsg "" # check for a core file first - if one was created by the test, # then the test failed if {[preserveCore]} { if {[file exists [file join [workingDirectory] core]]} { # There's only a test failure if there is a core file # and (1) there previously wasn't one or (2) the new # one is different from the old one. if {[info exists coreModTime]} { if {$coreModTime != [file mtime \ [file join [workingDirectory] core]]} { set coreFailure 1 } } else { set coreFailure 1 } if {([preserveCore] > 1) && ($coreFailure)} { append coreMsg "\nMoving file to:\ [file join [temporaryDirectory] core-$name]" catch {file rename -force -- \ [file join [workingDirectory] core] \ [file join [temporaryDirectory] core-$name] } msg if {$msg ne {}} { append coreMsg "\nError:\ Problem renaming core file: $msg" } } } } if {[IsVerbose msec] || [IsVerbose usec]} { set t [expr {[clock microseconds] - $timeStart}] if {[IsVerbose usec]} { puts [outputChannel] "++++ $name took $t \xB5s" } if {[IsVerbose msec]} { puts [outputChannel] "++++ $name took [expr {round($t/1000.)}] ms" } } # if skipped, it is safe to return here if {!$processTest} { incr testLevel -1 return } # if we didn't experience any failures, then we passed variable numTests if {!($setupFailure || $cleanupFailure || $coreFailure || $outputFailure || $errorFailure || $codeFailure || $errorCodeFailure || $scriptFailure)} { if {$testLevel == 1} { incr numTests(Passed) if {[IsVerbose pass]} { puts [outputChannel] "++++ $name PASSED" } } incr testLevel -1 return } # We know the test failed, tally it... if {$testLevel == 1} { incr numTests(Failed) } # ... then report according to the type of failure variable currentFailure true if {![IsVerbose body]} { set body "" } puts [outputChannel] "\n" if {[IsVerbose line]} { if {![catch {set testFrame [info frame -1]}] && [dict get $testFrame type] eq "source"} { set testFile [dict get $testFrame file] set testLine [dict get $testFrame line] } else { set testFile [file normalize [uplevel 1 {info script}]] if {[file readable $testFile]} { set testFd [open $testFile r] if {$fullutf} { fconfigure $testFd -profile tcl8 -encoding utf-8 } set testLine [expr {[lsearch -regexp \ [split [read $testFd] "\n"] \ "^\[ \t\]*test [string map {. \\.} $name] "] + 1}] close $testFd } } if {[info exists testLine]} { puts [outputChannel] "$testFile:$testLine: error: test failed:\ $name [string trim $description]" } } puts [outputChannel] "==== $name\ [string trim $description] FAILED" if {[string length $body]} { puts [outputChannel] "==== Contents of test case:" puts [outputChannel] $body } if {$setupFailure} { puts [outputChannel] "---- Test setup\ failed:\n$setupMsg" if {[info exists errorInfo(setup)]} { puts [outputChannel] "---- errorInfo(setup): $errorInfo(setup)" puts [outputChannel] "---- errorCode(setup): $errorCodeRes(setup)" } } if {$processTest && $scriptFailure} { if {$scriptCompare} { puts [outputChannel] "---- Error testing result: $scriptMatch" } else { if {[catch { puts [outputChannel] "---- Result was:\n[Asciify $actualAnswer]" } errMsg]} { puts [outputChannel] "\n---- Result was:\n" } puts [outputChannel] "---- Result should have been\ ($match matching):\n[Asciify $result]" } } if {$errorCodeFailure} { puts [outputChannel] "---- Error code was: '$errorCodeRes(body)'" puts [outputChannel] "---- Error code should have been: '$errorCode'" } if {$codeFailure} { switch -- $returnCode { 0 { set msg "Test completed normally" } 1 { set msg "Test generated error" } 2 { set msg "Test generated return exception" } 3 { set msg "Test generated break exception" } 4 { set msg "Test generated continue exception" } default { set msg "Test generated exception" } } puts [outputChannel] "---- $msg; Return code was: $returnCode" puts [outputChannel] "---- Return code should have been\ one of: $returnCodes" if {[IsVerbose error]} { if {[info exists errorInfo(body)] && (1 ni $returnCodes)} { puts [outputChannel] "---- errorInfo: $errorInfo(body)" puts [outputChannel] "---- errorCode: $errorCodeRes(body)" } } } if {$outputFailure} { if {$outputCompare} { puts [outputChannel] "---- Error testing output: $outputMatch" } else { puts [outputChannel] "---- Output was:\n$outData" puts [outputChannel] "---- Output should have been\ ($match matching):\n$output" } } if {$errorFailure} { if {$errorCompare} { puts [outputChannel] "---- Error testing errorOutput: $errorMatch" } else { puts [outputChannel] "---- Error output was:\n$errData" puts [outputChannel] "---- Error output should have\ been ($match matching):\n$errorOutput" } } if {$cleanupFailure} { puts [outputChannel] "---- Test cleanup failed:\n$cleanupMsg" if {[info exists errorInfo(cleanup)]} { puts [outputChannel] "---- errorInfo(cleanup): $errorInfo(cleanup)" puts [outputChannel] "---- errorCode(cleanup): $errorCodeRes(cleanup)" } } if {$coreFailure} { puts [outputChannel] "---- Core file produced while running\ test! $coreMsg" } puts [outputChannel] "==== $name FAILED\n" incr testLevel -1 return } # Skip -- # # Skips a running test and add a reason to skipped "constraints". Can be used # to conditional intended abort of the test. # # Side Effects: Maintains tally of total tests seen and tests skipped. # proc tcltest::Skip {reason} { return -code error -errorcode BYPASS-SKIPPED-TEST $reason } proc tcltest::_noticeSkipped {name reason} { variable testLevel variable numTests if {[IsVerbose skip]} { puts [outputChannel] "++++ $name SKIPPED: $reason" } if {$testLevel == 1} { incr numTests(Skipped) AddToSkippedBecause $reason } } # Skipped -- # # Given a test name and it constraints, returns a boolean indicating # whether the current configuration says the test should be skipped. # # Side Effects: Maintains tally of total tests seen and tests skipped. # proc tcltest::Skipped {name constraints} { variable testLevel variable numTests variable testConstraints if {$testLevel == 1} { incr numTests(Total) } # skip the test if it's name matches an element of skip foreach pattern [skip] { if {[string match $pattern $name]} { if {$testLevel == 1} { incr numTests(Skipped) DebugDo 1 {AddToSkippedBecause userSpecifiedSkip} } return 1 } } # skip the test if it's name doesn't match any element of match set ok 0 foreach pattern [match] { if {[string match $pattern $name]} { set ok 1 break } } if {!$ok} { if {$testLevel == 1} { incr numTests(Skipped) DebugDo 1 {AddToSkippedBecause userSpecifiedNonMatch} } return 1 } if {$constraints eq {}} { # If we're limited to the listed constraints and there aren't # any listed, then we shouldn't run the test. if {[limitConstraints]} { AddToSkippedBecause userSpecifiedLimitConstraint if {$testLevel == 1} { incr numTests(Skipped) } return 1 } } else { # "constraints" argument exists; # make sure that the constraints are satisfied. set doTest 0 set constraints [string trim $constraints] if {[string match {*[$\[]*} $constraints] != 0} { # full expression, e.g. {$foo > [info tclversion]} catch {set doTest [uplevel #0 [list expr $constraints]]} } elseif {[regexp {[^.:_a-zA-Z0-9 \n\r\t]+} $constraints] != 0} { # something like {a || b} should be turned into # $testConstraints(a) || $testConstraints(b). regsub -all {[.\w]+} $constraints {$testConstraints(&)} c catch {set doTest [eval [list expr $c]]} } elseif {![catch {llength $constraints}]} { # just simple constraints such as {unixOnly fonts}. set doTest 1 foreach constraint $constraints { if {(![info exists testConstraints($constraint)]) \ || (!$testConstraints($constraint))} { set doTest 0 # store the constraint that kept the test from # running set constraints $constraint break } } } if {!$doTest} { _noticeSkipped $name $constraints return 1 } } return 0 } # RunTest -- # # This is where the body of a test is evaluated. The combination of # [RunTest] and [Eval] allows the output and error output of the test # body to be captured for comparison against the expected values. proc tcltest::RunTest {name script} { DebugPuts 3 "Running $name {$script}" # If there is no "memory" command (because memory debugging isn't # enabled), then don't attempt to use the command. if {[llength [info commands memory]] == 1} { memory tag $name } # run the test script (or a hook if it presents): if {[set cmd [namespace which -command [namespace current]::EvalTest]] ne ""} { set script [list $cmd $script] } set code [catch {uplevel 1 $script} actualAnswer] return [list $actualAnswer $code] } ##################################################################### # tcltest::cleanupTestsHook -- # # This hook allows a harness that builds upon tcltest to specify # additional things that should be done at cleanup. # if {[llength [info commands tcltest::cleanupTestsHook]] == 0} { proc tcltest::cleanupTestsHook {} {} } # tcltest::cleanupTests -- # # Remove files and dirs created using the makeFile and makeDirectory # commands since the last time this proc was invoked. # # Print the names of the files created without the makeFile command # since the tests were invoked. # # Print the number tests (total, passed, failed, and skipped) since the # tests were invoked. # # Restore original environment (as reported by special variable env). # # Arguments: # calledFromAllFile - if 0, behave as if we are running a single # test file within an entire suite of tests. if we aren't running # a single test file, then don't report status. check for new # files created during the test run and report on them. if 1, # report collated status from all the test file runs. # # Results: # None. # # Side Effects: # None # proc tcltest::cleanupTests {{calledFromAllFile 0}} { variable filesMade variable filesExisted variable createdNewFiles variable testSingleFile variable numTests variable numTestFiles variable failFiles variable skippedBecause variable currentFailure variable originalEnv variable originalTclPlatform variable coreModTime FillFilesExisted set testFileName [file tail [info script]] # Hook to handle reporting to a parent interpreter if {[llength [info commands [namespace current]::ReportToParent]]} { ReportToParent $numTests(Total) $numTests(Passed) $numTests(Skipped) \ $numTests(Failed) [array get skippedBecause] \ [array get createdNewFiles] set testSingleFile false } # Call the cleanup hook cleanupTestsHook # Remove files and directories created by the makeFile and # makeDirectory procedures. Record the names of files in # workingDirectory that were not preexisting, and associate them # with the test file that created them. if {!$calledFromAllFile} { foreach file $filesMade { if {[file exists $file]} { DebugDo 1 {Warn "cleanupTests deleting $file..."} catch {file delete -force -- $file} } } set currentFiles {} foreach file [glob -nocomplain \ -directory [temporaryDirectory] *] { lappend currentFiles [file tail $file] } set newFiles {} foreach file $currentFiles { if {$file ni $filesExisted} { lappend newFiles $file } } set filesExisted $currentFiles if {[llength $newFiles] > 0} { set createdNewFiles($testFileName) $newFiles } } if {$calledFromAllFile || $testSingleFile} { # print stats puts -nonewline [outputChannel] "$testFileName:" foreach index [list "Total" "Passed" "Skipped" "Failed"] { puts -nonewline [outputChannel] \ "\t$index\t$numTests($index)" } puts [outputChannel] "" # print number test files sourced # print names of files that ran tests which failed if {$calledFromAllFile} { puts [outputChannel] \ "Sourced $numTestFiles Test Files." set numTestFiles 0 if {[llength $failFiles] > 0} { puts [outputChannel] \ "Files with failing tests: $failFiles" set failFiles {} } } # if any tests were skipped, print the constraints that kept # them from running. set constraintList [array names skippedBecause] if {[llength $constraintList] > 0} { puts [outputChannel] \ "Number of tests skipped for each constraint:" foreach constraint [lsort $constraintList] { puts [outputChannel] \ "\t$skippedBecause($constraint)\t$constraint" unset skippedBecause($constraint) } } # report the names of test files in createdNewFiles, and reset # the array to be empty. set testFilesThatTurded [lsort [array names createdNewFiles]] if {[llength $testFilesThatTurded] > 0} { puts [outputChannel] "Warning: files left behind:" foreach testFile $testFilesThatTurded { puts [outputChannel] \ "\t$testFile:\t$createdNewFiles($testFile)" unset createdNewFiles($testFile) } } # reset filesMade, filesExisted, and numTests set filesMade {} foreach index [list "Total" "Passed" "Skipped" "Failed"] { set numTests($index) 0 } # exit only if running Tk in non-interactive mode # This should be changed to determine if an event # loop is running, which is the real issue. # Actually, this doesn't belong here at all. A package # really has no business [exit]-ing an application. if {[info exists ::tk_version] && ![testConstraint interactive]} { exit } } else { # if we're deferring stat-reporting until all files are sourced, # then add current file to failFile list if any tests in this # file failed if {$currentFailure && ($testFileName ni $failFiles)} { lappend failFiles $testFileName } set currentFailure false # restore the environment to the state it was in before this package # was loaded set newEnv {} set changedEnv {} set removedEnv {} foreach index [array names ::env] { if {![info exists originalEnv($index)]} { lappend newEnv $index unset ::env($index) } } foreach index [array names originalEnv] { if {![info exists ::env($index)]} { lappend removedEnv $index set ::env($index) $originalEnv($index) } elseif {$::env($index) ne $originalEnv($index)} { lappend changedEnv $index set ::env($index) $originalEnv($index) } } if {[llength $newEnv] > 0} { puts [outputChannel] \ "env array elements created:\t$newEnv" } if {[llength $changedEnv] > 0} { puts [outputChannel] \ "env array elements changed:\t$changedEnv" } if {[llength $removedEnv] > 0} { puts [outputChannel] \ "env array elements removed:\t$removedEnv" } set changedTclPlatform {} foreach index [array names originalTclPlatform] { if {$::tcl_platform($index) \ != $originalTclPlatform($index)} { lappend changedTclPlatform $index set ::tcl_platform($index) $originalTclPlatform($index) } } if {[llength $changedTclPlatform] > 0} { puts [outputChannel] "tcl_platform array elements\ changed:\t$changedTclPlatform" } if {[file exists [file join [workingDirectory] core]]} { if {[preserveCore] > 1} { puts "rename core file (> 1)" puts [outputChannel] "produced core file! \ Moving file to: \ [file join [temporaryDirectory] core-$testFileName]" catch {file rename -force -- \ [file join [workingDirectory] core] \ [file join [temporaryDirectory] core-$testFileName] } msg if {$msg ne {}} { PrintError "Problem renaming file: $msg" } } else { # Print a message if there is a core file and (1) there # previously wasn't one or (2) the new one is different # from the old one. if {[info exists coreModTime]} { if {$coreModTime != [file mtime \ [file join [workingDirectory] core]]} { puts [outputChannel] "A core file was created!" } } else { puts [outputChannel] "A core file was created!" } } } } flush [outputChannel] flush [errorChannel] return } ##################################################################### # Procs that determine which tests/test files to run # tcltest::GetMatchingFiles # # Looks at the patterns given to match and skip files and uses # them to put together a list of the tests that will be run. # # Arguments: # directory to search # # Results: # The constructed list is returned to the user. This will # primarily be used in 'all.tcl' files. It is used in # runAllTests. # # Side Effects: # None # a lower case version is needed for compatibility with tcltest 1.0 proc tcltest::getMatchingFiles args {GetMatchingFiles {*}$args} proc tcltest::GetMatchingFiles { args } { if {[llength $args]} { set dirList $args } else { # Finding tests only in [testsDirectory] is normal operation. # This procedure is written to accept multiple directory arguments # only to satisfy version 1 compatibility. set dirList [list [testsDirectory]] } set matchingFiles [list] foreach directory $dirList { # List files in $directory that match patterns to run. set matchFileList [list] foreach match [matchFiles] { set matchFileList [concat $matchFileList \ [glob -directory $directory -types {b c f p s} \ -nocomplain -- $match]] } # List files in $directory that match patterns to skip. set skipFileList [list] foreach skip [skipFiles] { set skipFileList [concat $skipFileList \ [glob -directory $directory -types {b c f p s} \ -nocomplain -- $skip]] } # Add to result list all files in match list and not in skip list foreach file $matchFileList { if {$file ni $skipFileList} { lappend matchingFiles $file } } } if {[llength $matchingFiles] == 0} { PrintError "No test files remain after applying your match and\ skip patterns!" } return $matchingFiles } # tcltest::GetMatchingDirectories -- # # Looks at the patterns given to match and skip directories and # uses them to put together a list of the test directories that we # should attempt to run. (Only subdirectories containing an # "all.tcl" file are put into the list.) # # Arguments: # root directory from which to search # # Results: # The constructed list is returned to the user. This is used in # the primary all.tcl file. # # Side Effects: # None. proc tcltest::GetMatchingDirectories {rootdir} { # Determine the skip list first, to avoid [glob]-ing over subdirectories # we're going to throw away anyway. Be sure we skip the $rootdir if it # comes up to avoid infinite loops. set skipDirs [list $rootdir] foreach pattern [skipDirectories] { set skipDirs [concat $skipDirs [glob -directory $rootdir -types d \ -nocomplain -- $pattern]] } # Now step through the matching directories, prune out the skipped ones # as you go. set matchDirs [list] foreach pattern [matchDirectories] { foreach path [glob -directory $rootdir -types d -nocomplain -- \ $pattern] { if {$path ni $skipDirs && [file readable $path]} { set matchDirs [concat $matchDirs [GetMatchingDirectories $path]] if {[file exists [file join $path all.tcl]]} { lappend matchDirs $path } } } } if {[llength $matchDirs] == 0} { DebugPuts 1 "No test directories remain after applying match\ and skip patterns!" } return [lsort $matchDirs] } # tcltest::runAllTests -- # # prints output and sources test files according to the match and # skip patterns provided. after sourcing test files, it goes on # to source all.tcl files in matching test subdirectories. # # Arguments: # shell being tested # # Results: # Whether there were any failures. # # Side effects: # None. proc tcltest::runAllTests { {shell ""} } { variable testSingleFile variable numTestFiles variable numTests variable failFiles variable DefaultValue variable fullutf FillFilesExisted if {[llength [info level 0]] == 1} { set shell [interpreter] } set testSingleFile false puts [outputChannel] "Tests running in interp: $shell" puts [outputChannel] "Tests located in: [testsDirectory]" puts [outputChannel] "Tests running in: [workingDirectory]" puts [outputChannel] "Temporary files stored in\ [temporaryDirectory]" # [file system] first available in Tcl 8.4 if {![catch {file system [testsDirectory]} result] && ([lindex $result 0] ne "native")} { # If we aren't running in the native filesystem, then we must # run the tests in a single process (via 'source'), because # trying to run then via a pipe will fail since the files don't # really exist. singleProcess 1 } if {[singleProcess]} { puts [outputChannel] \ "Test files sourced into current interpreter" } else { puts [outputChannel] \ "Test files run in separate interpreters" } if {[llength [skip]] > 0} { puts [outputChannel] "Skipping tests that match: [skip]" } puts [outputChannel] "Running tests that match: [match]" if {[llength [skipFiles]] > 0} { puts [outputChannel] \ "Skipping test files that match: [skipFiles]" } if {[llength [matchFiles]] > 0} { puts [outputChannel] \ "Only running test files that match: [matchFiles]" } set timeCmd {clock format now -format "%Y-%m-%d %H:%M:%S %Z" -locale en} puts [outputChannel] "Tests began at [eval $timeCmd]" # Run each of the specified tests foreach file [lsort [GetMatchingFiles]] { set tail [file tail $file] puts [outputChannel] $tail flush [outputChannel] if {[singleProcess]} { if {[catch { incr numTestFiles uplevel 1 [list ::source -encoding utf-8 $file] } msg]} { puts [outputChannel] "Test file error: $msg" # append the name of the test to a list to be reported # later lappend testFileFailures $file } if {$numTests(Failed) > 0} { set failFilesSet 1 } } else { # Pass along our configuration to the child processes. # EXCEPT for the -outfile, because the parent process # needs to read and process output of children. set childargv [list] foreach opt [Configure] { if {$opt eq "-outfile"} {continue} set value [Configure $opt] # Don't bother passing default configuration options if {$value eq $DefaultValue($opt)} { continue } lappend childargv $opt $value } set cmd [linsert $childargv 0 | $shell $file] if {[catch { incr numTestFiles set pipeFd [open $cmd "r"] if {$fullutf} { fconfigure $pipeFd -profile tcl8 -encoding utf-8 } while {[gets $pipeFd line] >= 0} { if {[regexp [join { {^([^:]+):\t} {Total\t([0-9]+)\t} {Passed\t([0-9]+)\t} {Skipped\t([0-9]+)\t} {Failed\t([0-9]+)} } ""] $line null testFile \ Total Passed Skipped Failed]} { foreach index {Total Passed Skipped Failed} { incr numTests($index) [set $index] } if {$Failed > 0} { lappend failFiles $testFile set failFilesSet 1 } } elseif {[regexp [join { {^Number of tests skipped } {for each constraint:} {|^\t(\d+)\t(.+)$} } ""] $line match skipped constraint]} { if {[string match \t* $match]} { AddToSkippedBecause $constraint $skipped } } else { puts [outputChannel] $line } } close $pipeFd } msg]} { puts [outputChannel] "Test file error: $msg" # append the name of the test to a list to be reported # later lappend testFileFailures $file } } } # cleanup puts [outputChannel] "\nTests ended at [eval $timeCmd]" cleanupTests 1 if {[info exists testFileFailures]} { puts [outputChannel] "\nTest files exiting with errors: \n" foreach file $testFileFailures { puts [outputChannel] " [file tail $file]\n" } } # Checking for subdirectories in which to run tests foreach directory [GetMatchingDirectories [testsDirectory]] { set dir [file tail $directory] puts [outputChannel] [string repeat ~ 44] puts [outputChannel] "$dir test began at [eval $timeCmd]\n" uplevel 1 [list ::source -encoding utf-8 [file join $directory all.tcl]] set endTime [eval $timeCmd] puts [outputChannel] "\n$dir test ended at $endTime" puts [outputChannel] "" puts [outputChannel] [string repeat ~ 44] } return [expr {[info exists testFileFailures] || [info exists failFilesSet]}] } ##################################################################### # Test utility procs - not used in tcltest, but may be useful for # testing. # tcltest::loadTestedCommands -- # # Uses the specified script to load the commands to test. Allowed to # be empty, as the tested commands could have been compiled into the # interpreter. # # Arguments # none # # Results # none # # Side Effects: # none. proc tcltest::loadTestedCommands {} { return [uplevel 1 [loadScript]] } # tcltest::saveState -- # # Save information regarding what procs and variables exist. # # Arguments: # none # # Results: # Modifies the variable saveState # # Side effects: # None. proc tcltest::saveState {} { variable saveState uplevel 1 [list ::set [namespace which -variable saveState]] \ {[::list [::info procs] [::info vars]]} DebugPuts 2 "[lindex [info level 0] 0]: $saveState" return } # tcltest::restoreState -- # # Remove procs and variables that didn't exist before the call to # [saveState]. # # Arguments: # none # # Results: # Removes procs and variables from your environment if they don't # exist in the saveState variable. # # Side effects: # None. proc tcltest::restoreState {} { variable saveState foreach p [uplevel 1 {::info procs}] { if {($p ni [lindex $saveState 0]) && ("[namespace current]::$p" ne [uplevel 1 [list ::namespace origin $p]])} { DebugPuts 2 "[lindex [info level 0] 0]: Removing proc $p" uplevel 1 [list ::catch [list ::rename $p {}]] } } foreach p [uplevel 1 {::info vars}] { if {$p ni [lindex $saveState 1]} { DebugPuts 2 "[lindex [info level 0] 0]:\ Removing variable $p" uplevel 1 [list ::catch [list ::unset $p]] } } return } # tcltest::normalizeMsg -- # # Removes "extra" newlines from a string. # # Arguments: # msg String to be modified # # Results: # string with extra newlines removed # # Side effects: # None. proc tcltest::normalizeMsg {msg} { regsub "\n$" [string tolower $msg] "" msg set msg [string map [list "\n\n" "\n"] $msg] return [string map [list "\n\}" "\}"] $msg] } # tcltest::makeFile -- # # Create a new file with the name , and write to it. # # If this file hasn't been created via makeFile since the last time # cleanupTests was called, add it to the $filesMade list, so it will be # removed by the next call to cleanupTests. # # Arguments: # contents content of the new file # name name of the new file # directory directory name for new file # # Results: # absolute path to the file created # # Side effects: # None. proc tcltest::makeFile {contents name {directory ""}} { variable filesMade variable fullutf FillFilesExisted if {[llength [info level 0]] == 3} { set directory [temporaryDirectory] } set fullName [file join $directory $name] DebugPuts 3 "[lindex [info level 0] 0]:\ putting ``$contents'' into $fullName" set fd [open $fullName w] fconfigure $fd -translation lf if {$fullutf} { fconfigure $fd -profile tcl8 -encoding utf-8 } if {[string index $contents end] eq "\n"} { puts -nonewline $fd $contents } else { puts $fd $contents } close $fd if {$fullName ni $filesMade} { lappend filesMade $fullName } return $fullName } # tcltest::removeFile -- # # Removes the named file from the filesystem # # Arguments: # name file to be removed # directory directory from which to remove file # # Results: # return value from [file delete] # # Side effects: # None. proc tcltest::removeFile {name {directory ""}} { variable filesMade FillFilesExisted if {[llength [info level 0]] == 2} { set directory [temporaryDirectory] } set fullName [file join $directory $name] DebugPuts 3 "[lindex [info level 0] 0]: removing $fullName" set idx [lsearch -exact $filesMade $fullName] if {$idx < 0} { DebugDo 1 { Warn "removeFile removing \"$fullName\":\n not created by makeFile" } } else { set filesMade [lreplace $filesMade $idx $idx] } if {![file isfile $fullName]} { DebugDo 1 { Warn "removeFile removing \"$fullName\":\n not a file" } } if {[catch {file delete -- $fullName} msg ]} { DebugDo 1 { Warn "removeFile removing \"$fullName\":\n failed: $msg" } } return } # tcltest::makeDirectory -- # # Create a new dir with the name . # # If this dir hasn't been created via makeDirectory since the last time # cleanupTests was called, add it to the $directoriesMade list, so it # will be removed by the next call to cleanupTests. # # Arguments: # name name of the new directory # directory directory in which to create new dir # # Results: # absolute path to the directory created # # Side effects: # None. proc tcltest::makeDirectory {name {directory ""}} { variable filesMade FillFilesExisted if {[llength [info level 0]] == 2} { set directory [temporaryDirectory] } set fullName [file join $directory $name] DebugPuts 3 "[lindex [info level 0] 0]: creating $fullName" file mkdir $fullName if {$fullName ni $filesMade} { lappend filesMade $fullName } return $fullName } # tcltest::removeDirectory -- # # Removes a named directory from the file system. # # Arguments: # name Name of the directory to remove # directory Directory from which to remove # # Results: # return value from [file delete] # # Side effects: # None proc tcltest::removeDirectory {name {directory ""}} { variable filesMade FillFilesExisted if {[llength [info level 0]] == 2} { set directory [temporaryDirectory] } set fullName [file join $directory $name] DebugPuts 3 "[lindex [info level 0] 0]: deleting $fullName" set idx [lsearch -exact $filesMade $fullName] set filesMade [lreplace $filesMade $idx $idx] if {$idx < 0} { DebugDo 1 { Warn "removeDirectory removing \"$fullName\":\n not created\ by makeDirectory" } } if {![file isdirectory $fullName]} { DebugDo 1 { Warn "removeDirectory removing \"$fullName\":\n not a directory" } } return [file delete -force -- $fullName] } # tcltest::viewFile -- # # reads the content of a file and returns it # # Arguments: # name of the file to read # directory in which file is located # # Results: # content of the named file # # Side effects: # None. proc tcltest::viewFile {name {directory ""}} { variable fullutf FillFilesExisted if {[llength [info level 0]] == 2} { set directory [temporaryDirectory] } set fullName [file join $directory $name] set f [open $fullName] if {$fullutf} { fconfigure $f -profile tcl8 -encoding utf-8 } set data [read -nonewline $f] close $f return $data } # tcltest::bytestring -- # # Construct a string that consists of the requested sequence of bytes, # as opposed to a string of properly formed UTF-8 characters. # This allows the tester to # 1. Create denormalized or improperly formed strings to pass to C # procedures that are supposed to accept strings with embedded NULL # bytes. # 2. Confirm that a string result has a certain pattern of bytes, for # instance to confirm that "\xE0\0" in a Tcl script is stored # internally in UTF-8 as the sequence of bytes "\xC3\xA0\xC0\x80". # # Generally, it's a bad idea to examine the bytes in a Tcl string or to # construct improperly formed strings in this manner, because it involves # exposing that Tcl uses UTF-8 internally. # # This function doesn't work any more in Tcl 9.0, since the 'identity' # is gone (TIP #345) # # Arguments: # string being converted # # Results: # result fom encoding # # Side effects: # None if {![package vsatisfies [package provide Tcl] 9.0-]} { proc tcltest::bytestring {string} { return [encoding convertfrom identity $string] } } # tcltest::OpenFiles -- # # used in io tests, uses testchannel # # Arguments: # None. # # Results: # ??? # # Side effects: # None. proc tcltest::OpenFiles {} { if {[catch {testchannel open} result]} { return {} } return $result } # tcltest::LeakFiles -- # # used in io tests, uses testchannel # # Arguments: # None. # # Results: # ??? # # Side effects: # None. proc tcltest::LeakFiles {old} { if {[catch {testchannel open} new]} { return {} } set leak {} foreach p $new { if {$p ni $old} { lappend leak $p } } return $leak } # # Internationalization / ISO support procs -- dl # # tcltest::SetIso8859_1_Locale -- # # used in cmdIL.test, uses testlocale # # Arguments: # None. # # Results: # None. # # Side effects: # None. proc tcltest::SetIso8859_1_Locale {} { variable previousLocale variable isoLocale if {[info commands testlocale] != ""} { set previousLocale [testlocale ctype] testlocale ctype $isoLocale } return } # tcltest::RestoreLocale -- # # used in cmdIL.test, uses testlocale # # Arguments: # None. # # Results: # None. # # Side effects: # None. proc tcltest::RestoreLocale {} { variable previousLocale if {[info commands testlocale] != ""} { testlocale ctype $previousLocale } return } # tcltest::threadReap -- # # Kill all threads except for the main thread. # Do nothing if testthread is not defined. # # Arguments: # none. # # Results: # Returns the number of existing threads. # # Side Effects: # none. # proc tcltest::threadReap {} { if {[info commands testthread] ne {}} { # testthread built into tcltest testthread errorproc ThreadNullError while {[llength [testthread names]] > 1} { foreach tid [testthread names] { if {$tid != [mainThread]} { catch { testthread send -async $tid {testthread exit} } } } ## Enter a bit a sleep to give the threads enough breathing ## room to kill themselves off, otherwise the end up with a ## massive queue of repeated events after 1 } testthread errorproc ThreadError return [llength [testthread names]] } elseif {[info commands thread::id] ne {}} { # Thread extension thread::errorproc ThreadNullError while {[llength [thread::names]] > 1} { foreach tid [thread::names] { if {$tid != [mainThread]} { catch {thread::send -async $tid {thread::exit}} } } ## Enter a bit a sleep to give the threads enough breathing ## room to kill themselves off, otherwise the end up with a ## massive queue of repeated events after 1 } thread::errorproc ThreadError return [llength [thread::names]] } else { return 1 } return 0 } # Initialize the constraints and set up command line arguments namespace eval tcltest { # Define initializers for all the built-in constraint definitions DefineConstraintInitializers # Set up the constraints in the testConstraints array to be lazily # initialized by a registered initializer, or by "false" if no # initializer is registered. trace add variable testConstraints read [namespace code SafeFetch] # Only initialize constraints at package load time if an # [initConstraintsHook] has been predefined. This is only # for compatibility support. The modern way to add a custom # test constraint is to just call the [testConstraint] command # straight away, without all this "hook" nonsense. if {[namespace current] eq [namespace qualifiers [namespace which initConstraintsHook]]} { InitConstraints } else { proc initConstraintsHook {} {} } # Define the standard match commands customMatch exact [list string equal] customMatch glob [list string match] customMatch regexp [list regexp --] # If the TCLTEST_OPTIONS environment variable exists, configure # tcltest according to the option values it specifies. This has # the effect of resetting tcltest's default configuration. proc ConfigureFromEnvironment {} { upvar #0 env(TCLTEST_OPTIONS) options if {[catch {llength $options} msg]} { Warn "invalid TCLTEST_OPTIONS \"$options\":\n invalid\ Tcl list: $msg" return } if {[llength $options] % 2} { Warn "invalid TCLTEST_OPTIONS: \"$options\":\n should be\ -option value ?-option value ...?" return } if {[catch {Configure {*}$options} msg]} { Warn "invalid TCLTEST_OPTIONS: \"$options\":\n $msg" return } } if {[info exists ::env(TCLTEST_OPTIONS)]} { ConfigureFromEnvironment } proc LoadTimeCmdLineArgParsingRequired {} { set required false if {[info exists ::argv] && ("-help" in $::argv)} { # The command line asks for -help, so give it (and exit) # right now. ([configure] does not process -help) set required true } foreach hook { PrintUsageInfoHook processCmdLineArgsHook processCmdLineArgsAddFlagsHook } { if {[namespace current] eq [namespace qualifiers [namespace which $hook]]} { set required true } else { proc $hook args {} } } return $required } # Only initialize configurable options from the command line arguments # at package load time if necessary for backward compatibility. This # lets the tcltest user call [configure] for themselves if they wish. # Traces are established for auto-configuration from the command line # if any configurable options are accessed before the user calls # [configure]. if {[LoadTimeCmdLineArgParsingRequired]} { ProcessCmdLineArgs } else { EstablishAutoConfigureTraces } package provide [namespace tail [namespace current]] $Version } tcl9.0.3/library/tcltest/pkgIndex.tcl0000644000175000017500000000116415076154257017167 0ustar sergeisergei# Tcl package index file, version 1.1 # This file is generated by the "pkg_mkIndex -direct" command # and sourced either when an application starts up or # by a "package unknown" script. It invokes the # "package ifneeded" command to set up package-related # information so that packages will be loaded automatically # in response to "package require" commands. When this # script is sourced, the variable $dir must contain the # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} package ifneeded tcltest 2.5.10 [list source -encoding utf-8 [file join $dir tcltest.tcl]] tcl9.0.3/library/tclIndex0000644000175000017500000002321215104661341014710 0ustar sergeisergei# Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(auto_reset) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(tcl_findLibrary) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(auto_mkindex) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(auto_mkindex_old) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::init) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::cleanup) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::mkindex) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::hook) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::childhook) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::command) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::commandInit) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::fullname) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::auto_mkindex_parser::indexEntry) [list ::tcl::Pkg::source [file join $dir auto.tcl]] set auto_index(::tcl::clock::Initialize) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::mcget) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::mcMerge) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::GetSystemLocale) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::EnterLocale) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::_hasRegistry) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::LoadWindowsDateTimeFormats) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::LocalizeFormat) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::GetSystemTimeZone) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::SetupTimeZone) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::GuessWindowsTimeZone) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::LoadTimeZoneFile) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::LoadZoneinfoFile) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::ReadZoneinfoFile) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::ParsePosixTimeZone) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::ProcessPosixTimeZone) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::DeterminePosixDSTTime) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::GetJulianDayFromEraYearDay) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::GetJulianDayFromEraYearMonthWeekDay) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::IsGregorianLeapYear) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::WeekdayOnOrBefore) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::ChangeCurrentLocale) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(::tcl::clock::ClearCaches) [list ::tcl::Pkg::source [file join $dir clock.tcl]] set auto_index(foreachLine) [list ::tcl::Pkg::source [file join $dir foreachline.tcl]] set auto_index(::tcl::history) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(history) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistAdd) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistKeep) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistClear) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistInfo) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistRedo) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistIndex) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistEvent) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistChange) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::HistNextID) [list ::tcl::Pkg::source [file join $dir history.tcl]] set auto_index(::tcl::Pkg::CompareExtension) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(pkg_mkIndex) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(tclPkgSetup) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(tclPkgUnknown) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(::tcl::MacOSXPkgUnknown) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(::pkg::create) [list ::tcl::Pkg::source [file join $dir package.tcl]] set auto_index(parray) [list ::tcl::Pkg::source [file join $dir parray.tcl]] set auto_index(readFile) [list ::tcl::Pkg::source [file join $dir readfile.tcl]] set auto_index(::safe::InterpStatics) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::InterpNested) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpCreate) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpInit) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::CheckInterp) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpConfigure) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::InterpCreate) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::InterpSetConfig) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::DetokPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpFindInAccessPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpAddToAccessPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::InterpInit) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AddSubDirs) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::interpDelete) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::setLogCmd) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::SyncAccessPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::PathToken) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::TranslatePath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::Log) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::CheckFileName) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasFileSubcommand) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasGlob) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasSource) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasLoad) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::FileInAccessPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::DirInAccessPath) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::BadSubcommand) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasEncodingSystem) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::AliasExeName) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::RejectExcessColons) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::VarName) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::Setup) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::safe::setSyncMode) [list ::tcl::Pkg::source [file join $dir safe.tcl]] set auto_index(::tcl::tm::path) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::add) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::remove) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::list) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::UnknownHandler) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::Defaults) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::tm::roots) [list ::tcl::Pkg::source [file join $dir tm.tcl]] set auto_index(::tcl::UpdateWordBreakREs) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(tcl_wordBreakAfter) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(tcl_wordBreakBefore) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(tcl_endOfWord) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(tcl_startOfNextWord) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(tcl_startOfPreviousWord) [list ::tcl::Pkg::source [file join $dir word.tcl]] set auto_index(writeFile) [list ::tcl::Pkg::source [file join $dir writefile.tcl]] set auto_index(::tcl::unsupported::icu) [list ::tcl::Pkg::source [file join $dir icu.tcl]]tcl9.0.3/library/safe.tcl0000644000175000017500000013362515104661341014647 0ustar sergeisergei# safe.tcl -- # # This file provide a safe loading/sourcing mechanism for safe interpreters. # It implements a virtual path mecanism to hide the real pathnames from the # child. It runs in a parent interpreter and sets up data structure and # aliases that will be invoked when used from a child interpreter. # # See the safe.n man page for details. # # Copyright © 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. # # The implementation is based on namespaces. These naming conventions are # followed: # Private procs starts with uppercase. # Public procs are exported and starts with lowercase # # Needed utilities package package require opt 0.4.10 # Create the safe namespace namespace eval ::safe { # Exported API: namespace export interpCreate interpInit interpConfigure interpDelete \ interpAddToAccessPath interpFindInAccessPath setLogCmd } # Helper function to resolve the dual way of specifying staticsok (either # by -noStatics or -statics 0) proc ::safe::InterpStatics {} { foreach v {Args statics noStatics} { upvar $v $v } set flag [::tcl::OptProcArgGiven -noStatics] if {$flag && (!$noStatics == !$statics) && ([::tcl::OptProcArgGiven -statics])} { return -code error\ "conflicting values given for -statics and -noStatics" } if {$flag} { return [expr {!$noStatics}] } else { return $statics } } # Helper function to resolve the dual way of specifying nested loading # (either by -nestedLoadOk or -nested 1) proc ::safe::InterpNested {} { foreach v {Args nested nestedLoadOk} { upvar $v $v } set flag [::tcl::OptProcArgGiven -nestedLoadOk] # note that the test here is the opposite of the "InterpStatics" one # (it is not -noNested... because of the wanted default value) if {$flag && (!$nestedLoadOk != !$nested) && ([::tcl::OptProcArgGiven -nested])} { return -code error\ "conflicting values given for -nested and -nestedLoadOk" } if {$flag} { # another difference with "InterpStatics" return $nestedLoadOk } else { return $nested } } #### # # API entry points that needs argument parsing : # #### # Interface/entry point function and front end for "Create" proc ::safe::interpCreate {args} { variable AutoPathSync if {$AutoPathSync} { set autoPath {} } set Args [::tcl::OptKeyParse ::safe::interpCreate $args] RejectExcessColons $child set withAutoPath [::tcl::OptProcArgGiven -autoPath] InterpCreate $child $accessPath \ [InterpStatics] [InterpNested] $deleteHook $autoPath $withAutoPath } proc ::safe::interpInit {args} { variable AutoPathSync if {$AutoPathSync} { set autoPath {} } set Args [::tcl::OptKeyParse ::safe::interpIC $args] if {![::interp exists $child]} { return -code error "\"$child\" is not an interpreter" } RejectExcessColons $child set withAutoPath [::tcl::OptProcArgGiven -autoPath] InterpInit $child $accessPath \ [InterpStatics] [InterpNested] $deleteHook $autoPath $withAutoPath } # Check that the given child is "one of us" proc ::safe::CheckInterp {child} { namespace upvar ::safe [VarName $child] state if {![info exists state] || ![::interp exists $child]} { return -code error \ "\"$child\" is not an interpreter managed by ::safe::" } } # Interface/entry point function and front end for "Configure". This code # is awfully pedestrian because it would need more coupling and support # between the way we store the configuration values in safe::interp's and # the Opt package. Obviously we would like an OptConfigure to avoid # duplicating all this code everywhere. # -> TODO (the app should share or access easily the program/value stored # by opt) # This is even more complicated by the boolean flags with no values that # we had the bad idea to support for the sake of user simplicity in # create/init but which makes life hard in configure... # So this will be hopefully written and some integrated with opt1.0 # (hopefully for tcl9.0 ?) proc ::safe::interpConfigure {args} { variable AutoPathSync switch [llength $args] { 1 { # If we have exactly 1 argument the semantic is to return all # the current configuration. We still call OptKeyParse though # we know that "child" is our given argument because it also # checks for the "-help" option. set Args [::tcl::OptKeyParse ::safe::interpIC $args] CheckInterp $child namespace upvar ::safe [VarName $child] state set TMP [list \ [list -accessPath $state(access_path)] \ [list -statics $state(staticsok)] \ [list -nested $state(nestedok)] \ [list -deleteHook $state(cleanupHook)] \ ] if {!$AutoPathSync} { lappend TMP [list -autoPath $state(auto_path)] } return [join $TMP] } 2 { # If we have exactly 2 arguments the semantic is a "configure # get" lassign $args child arg # get the flag sub program (we 'know' about Opt's internal # representation of data) set desc [lindex [::tcl::OptKeyGetDesc ::safe::interpIC] 2] set hits [::tcl::OptHits desc $arg] if {$hits > 1} { return -code error [::tcl::OptAmbigous $desc $arg] } elseif {$hits == 0} { return -code error [::tcl::OptFlagUsage $desc $arg] } CheckInterp $child namespace upvar ::safe [VarName $child] state set item [::tcl::OptCurDesc $desc] set name [::tcl::OptName $item] switch -exact -- $name { -accessPath { return [list -accessPath $state(access_path)] } -autoPath { if {$AutoPathSync} { return -code error "unknown flag $name (bug)" } else { return [list -autoPath $state(auto_path)] } } -statics { return [list -statics $state(staticsok)] } -nested { return [list -nested $state(nestedok)] } -deleteHook { return [list -deleteHook $state(cleanupHook)] } -noStatics { # it is most probably a set in fact but we would need # then to jump to the set part and it is not *sure* # that it is a set action that the user want, so force # it to use the unambiguous -statics ?value? instead: return -code error\ "ambigous query (get or set -noStatics ?)\ use -statics instead" } -nestedLoadOk { return -code error\ "ambigous query (get or set -nestedLoadOk ?)\ use -nested instead" } default { return -code error "unknown flag $name (bug)" } } } default { # Otherwise we want to parse the arguments like init and # create did set Args [::tcl::OptKeyParse ::safe::interpIC $args] CheckInterp $child namespace upvar ::safe [VarName $child] state # Get the current (and not the default) values of whatever has # not been given: if {![::tcl::OptProcArgGiven -accessPath]} { set doreset 0 set accessPath $state(access_path) } else { set doreset 1 } if {(!$AutoPathSync) && (![::tcl::OptProcArgGiven -autoPath])} { set autoPath $state(auto_path) } elseif {$AutoPathSync} { set autoPath {} } else { } if { ![::tcl::OptProcArgGiven -statics] && ![::tcl::OptProcArgGiven -noStatics] } then { set statics $state(staticsok) } else { set statics [InterpStatics] } if { [::tcl::OptProcArgGiven -nested] || [::tcl::OptProcArgGiven -nestedLoadOk] } then { set nested [InterpNested] } else { set nested $state(nestedok) } if {![::tcl::OptProcArgGiven -deleteHook]} { set deleteHook $state(cleanupHook) } # Now reconfigure set withAutoPath [::tcl::OptProcArgGiven -autoPath] InterpSetConfig $child $accessPath $statics $nested $deleteHook $autoPath $withAutoPath # auto_reset the child (to completely sync the new access_path) tests safe-9.8 safe-9.9 if {$doreset} { if {[catch {::interp eval $child {auto_reset}} msg]} { Log $child "auto_reset failed: $msg" } else { Log $child "successful auto_reset" NOTICE } # Sync the paths used to search for Tcl modules. ::interp eval $child {tcl::tm::path remove {*}[tcl::tm::list]} if {[llength $state(tm_path_child)] > 0} { ::interp eval $child [list \ ::tcl::tm::add {*}[lreverse $state(tm_path_child)]] } # Remove stale "package ifneeded" data for non-loaded packages. # - Not for loaded packages, because "package forget" erases # data from "package provide" as well as "package ifneeded". # - This is OK because the script cannot reload any version of # the package unless it first does "package forget". foreach pkg [::interp eval $child {package names}] { if {[::interp eval $child [list package provide $pkg]] eq ""} { ::interp eval $child [list package forget $pkg] } } } return } } } #### # # Functions that actually implements the exported APIs # #### # # safe::InterpCreate : doing the real job # # This procedure creates a safe interpreter and initializes it with the safe # base aliases. # NB: child name must be simple alphanumeric string, no spaces, no (), no # {},... {because the state array is stored as part of the name} # # Returns the child name. # # Optional Arguments : # + child name : if empty, generated name will be used # + access_path: path list controlling where load/source can occur, # if empty: the parent auto_path and its subdirectories will be # used. # + staticsok : flag, if 0 :no static package can be loaded (load {} Xxx) # if 1 :static packages are ok. # + nestedok : flag, if 0 :no loading to sub-sub interps (load xx xx sub) # if 1 : multiple levels are ok. # use the full name and no indent so auto_mkIndex can find us proc ::safe::InterpCreate { child access_path staticsok nestedok deletehook autoPath withAutoPath } { # Create the child. # If evaluated in ::safe, the interpreter command for foo is ::foo; # but for foo::bar is safe::foo::bar. So evaluate in :: instead. if {$child ne ""} { namespace eval :: [list ::interp create -safe $child] } else { # empty argument: generate child name set child [::interp create -safe] } Log $child "Created" NOTICE # Initialize it. (returns child name) InterpInit $child $access_path $staticsok $nestedok $deletehook $autoPath $withAutoPath } # # InterpSetConfig (was setAccessPath) : # Sets up child virtual access path and corresponding structure within # the parent. Also sets the tcl_library in the child to be the first # directory in the path. # NB: If you change the path after the child has been initialized you # probably need to call "auto_reset" in the child in order that it gets # the right auto_index() array values. # # It is the caller's responsibility, if it supplies a non-empty value for # access_path, to make the first directory in the path suitable for use as # tcl_library, and (if ![setSyncMode]), to set the child's ::auto_path. proc ::safe::InterpSetConfig {child access_path staticsok nestedok deletehook autoPath withAutoPath} { global auto_path variable AutoPathSync # determine and store the access path if empty if {$access_path eq ""} { set access_path $auto_path # Make sure that tcl_library is in auto_path and at the first # position (needed by setAccessPath) set where [lsearch -exact $access_path [info library]] if {$where < 0} { # not found, add it. set access_path [linsert $access_path 0 [info library]] Log $child "tcl_library was not in auto_path,\ added it to child's access_path" NOTICE } elseif {$where != 0} { # not first, move it first set access_path [linsert \ [lreplace $access_path $where $where] \ 0 [info library]] Log $child "tcl_libray was not in first in auto_path,\ moved it to front of child's access_path" NOTICE } set raw_auto_path $access_path # Add 1st level subdirs (will searched by auto loading from tcl # code in the child using glob and thus fail, so we add them here # so by default it works the same). set access_path [AddSubDirs $access_path] } else { set raw_auto_path $autoPath } if {$withAutoPath} { set raw_auto_path $autoPath } Log $child "Setting accessPath=($access_path) staticsok=$staticsok\ nestedok=$nestedok deletehook=($deletehook)" NOTICE if {!$AutoPathSync} { Log $child "Setting auto_path=($raw_auto_path)" NOTICE } namespace upvar ::safe [VarName $child] state # clear old autopath if it existed # build new one # Extend the access list with the paths used to look for Tcl Modules. # We save the virtual form separately as well, as syncing it with the # child has to be defered until the necessary commands are present for # setup. set norm_access_path {} set child_access_path {} set map_access_path {} set remap_access_path {} set child_tm_path {} set i 0 foreach dir $access_path { set token [PathToken $i] lappend child_access_path $token lappend map_access_path $token $dir lappend remap_access_path $dir $token lappend norm_access_path [file normalize $dir] incr i } # Set the child auto_path to a tokenized raw_auto_path. # Silently ignore any directories that are not in the access path. # If [setSyncMode], SyncAccessPath will overwrite this value with the # full access path. # If ![setSyncMode], Safe Base code will not change this value. set tokens_auto_path {} foreach dir $raw_auto_path { if {[dict exists $remap_access_path $dir]} { lappend tokens_auto_path [dict get $remap_access_path $dir] } } ::interp eval $child [list set auto_path $tokens_auto_path] # Add the tcl::tm directories to the access path. set morepaths [::tcl::tm::list] set firstpass 1 while {[llength $morepaths]} { set addpaths $morepaths set morepaths {} foreach dir $addpaths { # Prevent the addition of dirs on the tm list to the # result if they are already known. if {[dict exists $remap_access_path $dir]} { if {$firstpass} { # $dir is in [::tcl::tm::list] and belongs in the child_tm_path. # Later passes handle subdirectories, which belong in the # access path but not in the module path. lappend child_tm_path [dict get $remap_access_path $dir] } continue } set token [PathToken $i] lappend access_path $dir lappend child_access_path $token lappend map_access_path $token $dir lappend remap_access_path $dir $token lappend norm_access_path [file normalize $dir] if {$firstpass} { # $dir is in [::tcl::tm::list] and belongs in the child_tm_path. # Later passes handle subdirectories, which belong in the # access path but not in the module path. lappend child_tm_path $token } incr i # [Bug 2854929] # Recursively find deeper paths which may contain # modules. Required to handle modules with names like # 'platform::shell', which translate into # 'platform/shell-X.tm', i.e arbitrarily deep # subdirectories. lappend morepaths {*}[glob -nocomplain -directory $dir -type d *] } set firstpass 0 } set state(access_path) $access_path set state(access_path,map) $map_access_path set state(access_path,remap) $remap_access_path set state(access_path,norm) $norm_access_path set state(access_path,child) $child_access_path set state(tm_path_child) $child_tm_path set state(staticsok) $staticsok set state(nestedok) $nestedok set state(cleanupHook) $deletehook if {!$AutoPathSync} { set state(auto_path) $raw_auto_path } SyncAccessPath $child return } # # DetokPath: # Convert tokens to directories where possible. # Leave undefined tokens unconverted. They are # nonsense in both the child and the parent. # proc ::safe::DetokPath {child tokenPath} { namespace upvar ::safe [VarName $child] state set childPath {} foreach token $tokenPath { if {[dict exists $state(access_path,map) $token]} { lappend childPath [dict get $state(access_path,map) $token] } else { lappend childPath $token } } return $childPath } # # # interpFindInAccessPath: # Search for a real directory and returns its virtual Id (including the # "$") # # When debugging, use TranslatePath for the inverse operation. proc ::safe::interpFindInAccessPath {child path} { CheckInterp $child namespace upvar ::safe [VarName $child] state if {![dict exists $state(access_path,remap) $path]} { return -code error "$path not found in access path" } return [dict get $state(access_path,remap) $path] } # # addToAccessPath: # add (if needed) a real directory to access path and return its # virtual token (including the "$"). proc ::safe::interpAddToAccessPath {child path} { # first check if the directory is already in there # (inlined interpFindInAccessPath). CheckInterp $child namespace upvar ::safe [VarName $child] state if {[dict exists $state(access_path,remap) $path]} { return [dict get $state(access_path,remap) $path] } # new one, add it: set token [PathToken [llength $state(access_path)]] lappend state(access_path) $path lappend state(access_path,child) $token lappend state(access_path,map) $token $path lappend state(access_path,remap) $path $token lappend state(access_path,norm) [file normalize $path] SyncAccessPath $child return $token } # This procedure applies the initializations to an already existing # interpreter. It is useful when you want to install the safe base aliases # into a preexisting safe interpreter. proc ::safe::InterpInit { child access_path staticsok nestedok deletehook autoPath withAutoPath } { # Configure will generate an access_path when access_path is empty. InterpSetConfig $child $access_path $staticsok $nestedok $deletehook $autoPath $withAutoPath # NB we need to add [namespace current], aliases are always absolute # paths. # These aliases let the child load files to define new commands # This alias lets the child use the encoding names, convertfrom, # convertto, and system, but not "encoding system " to set the # system encoding. # Handling Tcl Modules, we need a restricted form of Glob. # This alias interposes on the 'exit' command and cleanly terminates # the child. foreach {command alias} { source AliasSource load AliasLoad exit interpDelete glob AliasGlob } { ::interp alias $child $command {} [namespace current]::$alias $child } # UGLY POINT! These commands are safe (they're ensembles with unsafe # subcommands), but is assumed to not be by existing policies so it is # hidden by default. Hack it... foreach command {encoding file} { ::interp alias $child $command {} interp invokehidden $child $command } # This alias lets the child have access to a subset of the 'file' # command functionality. foreach subcommand {dirname extension rootname tail} { ::interp alias $child ::tcl::file::$subcommand {} \ ::safe::AliasFileSubcommand $child $subcommand } # Subcommand of 'encoding' that has special handling; [encoding system] is # OK provided it has no other arguments passed to it. ::interp alias $child ::tcl::encoding::system {} \ ::safe::AliasEncodingSystem $child # Subcommands of info ::interp alias $child ::tcl::info::nameofexecutable {} \ ::safe::AliasExeName $child # Source init.tcl and tm.tcl into the child, to get auto_load and # other procedures defined: if {[catch {::interp eval $child { source [file join $tcl_library init.tcl] }} msg opt]} { Log $child "can't source init.tcl ($msg)" return -options $opt "can't source init.tcl into child $child ($msg)" } if {[catch {::interp eval $child { source [file join $tcl_library tm.tcl] }} msg opt]} { Log $child "can't source tm.tcl ($msg)" return -options $opt "can't source tm.tcl into child $child ($msg)" } # Sync the paths used to search for Tcl modules. This can be done only # now, after tm.tcl was loaded. namespace upvar ::safe [VarName $child] state if {[llength $state(tm_path_child)] > 0} { ::interp eval $child [list \ ::tcl::tm::add {*}[lreverse $state(tm_path_child)]] } return $child } # Add (only if needed, avoid duplicates) 1 level of sub directories to an # existing path list. Also removes non directories from the returned # list. proc ::safe::AddSubDirs {pathList} { set res {} foreach dir $pathList { if {[file isdirectory $dir]} { # check that we don't have it yet as a children of a previous # dir if {$dir ni $res} { lappend res $dir } foreach sub [glob -directory $dir -nocomplain *] { if {[file isdirectory $sub] && ($sub ni $res)} { # new sub dir, add it ! lappend res $sub } } } } return $res } # This procedure deletes a safe interpreter managed by Safe Tcl and cleans up # associated state. # - The command will also delete non-Safe-Base interpreters. # - This is regrettable, but to avoid breaking existing code this should be # amended at the next major revision by uncommenting "CheckInterp". proc ::safe::interpDelete {child} { Log $child "About to delete" NOTICE # CheckInterp $child namespace upvar ::safe [VarName $child] state # When an interpreter is deleted with [interp delete], any sub-interpreters # are deleted automatically, but this leaves behind their data in the Safe # Base. To clean up properly, we call safe::interpDelete recursively on each # Safe Base sub-interpreter, so each one is deleted cleanly and not by # the automatic mechanism built into [interp delete]. foreach sub [interp children $child] { if {[info exists ::safe::[VarName [list $child $sub]]]} { ::safe::interpDelete [list $child $sub] } } # If the child has a cleanup hook registered, call it. Check the # existence because we might be called to delete an interp which has # not been registered with us at all if {[info exists state(cleanupHook)]} { set hook $state(cleanupHook) if {[llength $hook]} { # remove the hook now, otherwise if the hook calls us somehow, # we'll loop unset state(cleanupHook) try { {*}$hook $child } on error err { Log $child "Delete hook error ($err)" } } } # Discard the global array of state associated with the child, and # delete the interpreter. if {[info exists state]} { unset state } # if we have been called twice, the interp might have been deleted # already if {[::interp exists $child]} { ::interp delete $child Log $child "Deleted" NOTICE } return } # Set (or get) the logging mechanism proc ::safe::setLogCmd {args} { variable Log set la [llength $args] if {$la == 0} { return $Log } elseif {$la == 1} { set Log [lindex $args 0] } else { set Log $args } if {$Log eq ""} { # Disable logging completely. Calls to it will be compiled out # of all users. proc ::safe::Log {args} {} } else { # Activate logging, define proper command. proc ::safe::Log {child msg {type ERROR}} { variable Log {*}$Log "$type for child $child : $msg" return } } } # ------------------- END OF PUBLIC METHODS ------------ # # Sets the child auto_path to its recorded access path. Also sets # tcl_library to the first token of the access path. # proc ::safe::SyncAccessPath {child} { variable AutoPathSync namespace upvar ::safe [VarName $child] state set child_access_path $state(access_path,child) if {$AutoPathSync} { ::interp eval $child [list set auto_path $child_access_path] Log $child "auto_path in $child has been set to $child_access_path"\ NOTICE } # This code assumes that info library is the first element in the # list of access path's. See -> InterpSetConfig for the code which # ensures this condition. ::interp eval $child [list \ set tcl_library [lindex $child_access_path 0]] return } # Returns the virtual token for directory number N. proc ::safe::PathToken {n} { # We need to have a ":" in the token string so [file join] on the # mac won't turn it into a relative path. return "\$p(:$n:)" ;# Form tested by case 7.2 } # # translate virtual path into real path # proc ::safe::TranslatePath {child path} { namespace upvar ::safe [VarName $child] state # somehow strip the namespaces 'functionality' out (the danger is that # we would strip valid macintosh "../" queries... : if {[string match "*::*" $path] || [string match "*..*" $path]} { return -code error "invalid characters in path $path" } # Use a cached map instead of computed local vars and subst. return [string map $state(access_path,map) $path] } # file name control (limit access to files/resources that should be a # valid tcl source file) proc ::safe::CheckFileName {child file} { # This used to limit what can be sourced to ".tcl" and forbid files # with more than 1 dot and longer than 14 chars, but I changed that # for 8.4 as a safe interp has enough internal protection already to # allow sourcing anything. - hobbs if {![file exists $file]} { # don't tell the file path return -code error "no such file or directory" } if {![file readable $file]} { # don't tell the file path return -code error "not readable" } } # AliasFileSubcommand handles selected subcommands of [file] in safe # interpreters that are *almost* safe. In particular, it just acts to # prevent discovery of what home directories exist. proc ::safe::AliasFileSubcommand {child subcommand name} { tailcall ::interp invokehidden $child tcl:file:$subcommand $name } # AliasGlob is the target of the "glob" alias in safe interpreters. proc ::safe::AliasGlob {child args} { variable AutoPathSync Log $child "GLOB ! $args" NOTICE set cmd {} set at 0 array set got { -directory 0 -nocomplain 0 -join 0 -tails 0 -- 0 } if {$::tcl_platform(platform) eq "windows"} { set dirPartRE {^(.*)[\\/]([^\\/]*)$} } else { set dirPartRE {^(.*)/([^/]*)$} } set dir {} set virtualdir {} while {$at < [llength $args]} { switch -glob -- [set opt [lindex $args $at]] { -nocomplain - -- - -tails { lappend cmd $opt set got($opt) 1 incr at } -join { set got($opt) 1 incr at } -types - -type { lappend cmd -types [lindex $args [incr at]] incr at } -directory { if {$got($opt)} { return -code error \ {"-directory" cannot be used with "-path"} } set got($opt) 1 set virtualdir [lindex $args [incr at]] incr at } -* { Log $child "Safe base rejecting glob option '$opt'" return -code error "Safe base rejecting glob option '$opt'" # unsafe/unnecessary options rejected: -path } default { break } } if {$got(--)} break } # Get the real path from the virtual one and check that the path is in the # access path of that child. Done after basic argument processing so that # we know if -nocomplain is set. if {$got(-directory)} { try { set dir [TranslatePath $child $virtualdir] DirInAccessPath $child $dir } on error msg { Log $child $msg if {$got(-nocomplain)} return return -code error "permission denied" } if {$got(--)} { set cmd [linsert $cmd end-1 -directory $dir] } else { lappend cmd -directory $dir } } else { # The code after this "if ... else" block would conspire to return with # no results in this case, if it were allowed to proceed. Instead, # return now and reduce the number of cases to be considered later. Log $child {option -directory must be supplied} if {$got(-nocomplain)} return return -code error "permission denied" } # Apply the -join semantics ourselves (hence -join not copied to $cmd) if {$got(-join)} { set args [lreplace $args $at end [join [lrange $args $at end] "/"]] } # Process the pattern arguments. If we've done a join there is only one # pattern argument. set firstPattern [llength $cmd] foreach opt [lrange $args $at end] { if {![regexp $dirPartRE $opt -> thedir thefile]} { set thedir . # The *.tm search comes here. } # "Special" treatment for (joined) argument {*/pkgIndex.tcl}. # Do the expansion of "*" here, and filter out any directories that are # not in the access path. The outcome is to lappend to cmd a path of # the form $virtualdir/subdir/pkgIndex.tcl for each subdirectory subdir, # after removing any subdir that are not in the access path. if {($thedir eq "*") && ($thefile eq "pkgIndex.tcl")} { set mapped 0 foreach d [glob -directory [TranslatePath $child $virtualdir] \ -types d -tails *] { catch { DirInAccessPath $child \ [TranslatePath $child [file join $virtualdir $d]] lappend cmd [file join $d $thefile] set mapped 1 } } if {$mapped} continue # Don't [continue] if */pkgIndex.tcl has no matches in the access # path. The pattern will now receive the same treatment as a # "non-special" pattern (and will fail because it includes a "*" in # the directory name). } # Any directory pattern that is not an exact (i.e. non-glob) match to a # directory in the access path will be rejected here. # - Rejections include any directory pattern that has glob matching # patterns "*", "?", backslashes, braces or square brackets, (UNLESS # it corresponds to a genuine directory name AND that directory is in # the access path). # - The only "special matching characters" that remain in patterns for # processing by glob are in the filename tail. # - [file join $anything ~${foo}] is ~${foo}, which is not an exact # match to any directory in the access path. Hence directory patterns # that begin with "~" are rejected here. Tests safe-16.[5-8] check # that "file join" remains as required and does not expand ~${foo}. # - Bug [3529949] relates to unwanted expansion of ~${foo} and this is # how the present code avoids the bug. All tests safe-16.* relate. try { DirInAccessPath $child [TranslatePath $child \ [file join $virtualdir $thedir]] } on error msg { Log $child $msg if {$got(-nocomplain)} continue return -code error "permission denied" } lappend cmd $opt } Log $child "GLOB = $cmd" NOTICE if {$got(-nocomplain) && [llength $cmd] eq $firstPattern} { return } try { # >>>>>>>>>> HERE'S THE CALL TO SAFE INTERP GLOB <<<<<<<<<< # - Pattern arguments added to cmd have NOT been translated from tokens. # Only the virtualdir is translated (to dir). # - In the pkgIndex.tcl case, there is no "*" in the pattern arguments, # which are a list of names each with tail pkgIndex.tcl. The purpose # of the call to glob is to remove the names for which the file does # not exist. set entries [::interp invokehidden $child glob {*}$cmd] } on error msg { # This is the only place that a call with -nocomplain and no invalid # "dash-options" can return an error. Log $child $msg return -code error "script error" } Log $child "GLOB < $entries" NOTICE # Translate path back to what the child should see. set res {} set l [string length $dir] foreach p $entries { if {[string equal -length $l $dir $p]} { set p [string replace $p 0 [expr {$l-1}] $virtualdir] } lappend res $p } Log $child "GLOB > $res" NOTICE return $res } # AliasSource is the target of the "source" alias in safe interpreters. proc ::safe::AliasSource {child args} { set argc [llength $args] # Extended for handling of Tcl Modules to allow not only "source # filename", but "source -encoding E filename" as well. if {[lindex $args 0] eq "-encoding"} { incr argc -2 set encoding [lindex $args 1] set at 2 if {$encoding eq "identity"} { Log $child "attempt to use the identity encoding" return -code error "permission denied" } } else { set at 0 set encoding utf-8 } if {$argc != 1} { set msg "wrong # args: should be \"source ?-encoding E? fileName\"" Log $child "$msg ($args)" return -code error $msg } set file [lindex $args $at] # get the real path from the virtual one. if {[catch { set realfile [TranslatePath $child $file] } msg]} { Log $child $msg return -code error "permission denied" } # check that the path is in the access path of that child if {[catch { FileInAccessPath $child $realfile } msg]} { Log $child $msg return -code error "permission denied" } # Check that the filename exists and is readable. If it is not, deliver # this -errorcode so that caller in tclPkgUnknown does not write a message # to tclLog. Has no effect on other callers of ::source, which are in # "package ifneeded" scripts. if {[catch { CheckFileName $child $realfile } msg]} { Log $child "$realfile:$msg" return -code error -errorcode {POSIX EACCES} $msg } # Passed all the tests, lets source it. Note that we do this all manually # because we want to control [info script] in the child so information # doesn't leak so much. [Bug 2913625] set old [::interp eval $child {info script}] set replacementMsg "script error" set code [catch { set f [open $realfile] fconfigure $f -encoding $encoding -eofchar \x1A set contents [read $f] close $f ::interp eval $child [list info script $file] } msg opt] if {$code == 0} { # See [Bug 1d26e580cf] if {[string index $contents 0] eq "\uFEFF"} { set contents [string range $contents 1 end] } set code [catch {::interp eval $child $contents} msg opt] set replacementMsg $msg } catch {interp eval $child [list info script $old]} # Note that all non-errors are fine result codes from [source], so we must # take a little care to do it properly. [Bug 2923613] if {$code == 1} { Log $child $msg return -code error $replacementMsg } return -code $code -options $opt $msg } # AliasLoad is the target of the "load" alias in safe interpreters. proc ::safe::AliasLoad {child file args} { set argc [llength $args] if {$argc > 2} { set msg "load error: too many arguments" Log $child "$msg ($argc) {$file $args}" return -code error $msg } # prefix (can be empty if file is not). set prefix [lindex $args 0] namespace upvar ::safe [VarName $child] state # Determine where to load. load use a relative interp path and {} # means self, so we can directly and safely use passed arg. set target [lindex $args 1] if {$target ne ""} { # we will try to load into a sub sub interp; check that we want to # authorize that. if {!$state(nestedok)} { Log $child "loading to a sub interp (nestedok)\ disabled (trying to load $prefix to $target)" return -code error "permission denied (nested load)" } } # Determine what kind of load is requested if {$file eq ""} { # static loading if {$prefix eq ""} { set msg "load error: empty filename and no prefix" Log $child $msg return -code error $msg } if {!$state(staticsok)} { Log $child "static loading disabled\ (trying to load $prefix to $target)" return -code error "permission denied (static library)" } } else { # file loading # get the real path from the virtual one. try { set file [TranslatePath $child $file] } on error msg { Log $child $msg return -code error "permission denied" } # check the translated path try { FileInAccessPath $child $file } on error msg { Log $child $msg return -code error "permission denied (path)" } } try { return [::interp invokehidden $child load $file $prefix $target] } on error msg { # Some libraries return no error message. set msg0 "load of library for prefix $prefix failed" if {$msg eq {}} { set msg $msg0 } else { set msg "$msg0: $msg" } Log $child $msg return -code error $msg } } # FileInAccessPath raises an error if the file is not found in the list of # directories contained in the (parent side recorded) child's access path. # the security here relies on "file dirname" answering the proper # result... needs checking ? proc ::safe::FileInAccessPath {child file} { namespace upvar ::safe [VarName $child] state set access_path $state(access_path) if {[file isdirectory $file]} { return -code error "\"$file\": is a directory" } set parent [file dirname $file] # Normalize paths for comparison since lsearch knows nothing of # potential pathname anomalies. set norm_parent [file normalize $parent] namespace upvar ::safe [VarName $child] state if {$norm_parent ni $state(access_path,norm)} { return -code error "\"$file\": not in access_path" } } proc ::safe::DirInAccessPath {child dir} { namespace upvar ::safe [VarName $child] state set access_path $state(access_path) if {[file isfile $dir]} { return -code error "\"$dir\": is a file" } # Normalize paths for comparison since lsearch knows nothing of # potential pathname anomalies. set norm_dir [file normalize $dir] namespace upvar ::safe [VarName $child] state if {$norm_dir ni $state(access_path,norm)} { return -code error "\"$dir\": not in access_path" } } # This procedure is used to report an attempt to use an unsafe member of an # ensemble command. proc ::safe::BadSubcommand {child command subcommand args} { set msg "not allowed to invoke subcommand $subcommand of $command" Log $child $msg return -code error -errorcode {TCL SAFE SUBCOMMAND} $msg } # AliasEncodingSystem is the target of the "encoding system" alias in safe # interpreters. proc ::safe::AliasEncodingSystem {child args} { try { # Must not pass extra arguments; safe interpreters may not set the # system encoding but they may read it. if {[llength $args]} { return -code error -errorcode {TCL WRONGARGS} \ "wrong # args: should be \"encoding system\"" } } on error {msg options} { Log $child $msg return -options $options $msg } tailcall ::interp invokehidden $child tcl:encoding:system } # Various minor hiding of platform features. [Bug 2913625] proc ::safe::AliasExeName {child} { return "" } # ------------------------------------------------------------------------------ # Using Interpreter Names with Namespace Qualifiers # ------------------------------------------------------------------------------ # (1) We wish to preserve compatibility with existing code, in which Safe Base # interpreter names have no namespace qualifiers. # (2) safe::interpCreate and the rest of the Safe Base previously could not # accept namespace qualifiers in an interpreter name. # (3) The interp command will accept namespace qualifiers in an interpreter # name, but accepts distinct interpreters that will have the same command # name (e.g. foo, ::foo, and :::foo) (bug 66c2e8c974). # (4) To satisfy these constraints, Safe Base interpreter names will be fully # qualified namespace names with no excess colons and with the leading "::" # omitted. # (5) Trailing "::" implies a namespace tail {}, which interp reads as {{}}. # Reject such names. # (6) We could: # (a) EITHER reject usable but non-compliant names (e.g. excess colons) in # interpCreate, interpInit; # (b) OR accept such names and then translate to a compliant name in every # command. # The problem with (b) is that the user will expect to use the name with the # interp command and will find that it is not recognised. # E.g "interpCreate ::foo" creates interpreter "foo", and the user's name # "::foo" works with all the Safe Base commands, but "interp eval ::foo" # fails. # So we choose (a). # (7) The command # namespace upvar ::safe S$child state # becomes # namespace upvar ::safe [VarName $child] state # ------------------------------------------------------------------------------ proc ::safe::RejectExcessColons {child} { set stripped [regsub -all -- {:::*} $child ::] if {[string range $stripped end-1 end] eq {::}} { return -code error {interpreter name must not end in "::"} } if {$stripped ne $child} { set msg {interpreter name has excess colons in namespace separators} return -code error $msg } if {[string range $stripped 0 1] eq {::}} { return -code error {interpreter name must not begin "::"} } return } proc ::safe::VarName {child} { # return S$child return S[string map {:: @N @ @A} $child] } proc ::safe::Setup {} { #### # # Setup the arguments parsing # #### variable AutoPathSync # Share the descriptions set OptList { {-accessPath -list {} "access path for the child"} {-noStatics "prevent loading of statically linked pkgs"} {-statics true "loading of statically linked pkgs"} {-nestedLoadOk "allow nested loading"} {-nested false "nested loading"} {-deleteHook -script {} "delete hook"} } if {!$AutoPathSync} { lappend OptList {-autoPath -list {} "::auto_path for the child"} } set temp [::tcl::OptKeyRegister $OptList] # create case (child is optional) ::tcl::OptKeyRegister { {?child? -name {} "name of the child (optional)"} } ::safe::interpCreate # adding the flags sub programs to the command program (relying on Opt's # internal implementation details) lappend ::tcl::OptDesc(::safe::interpCreate) $::tcl::OptDesc($temp) # init and configure (child is needed) ::tcl::OptKeyRegister { {child -name {} "name of the child"} } ::safe::interpIC # adding the flags sub programs to the command program (relying on Opt's # internal implementation details) lappend ::tcl::OptDesc(::safe::interpIC) $::tcl::OptDesc($temp) # temp not needed anymore ::tcl::OptKeyDelete $temp #### # # Default: No logging. # #### setLogCmd {} # Log eventually. # To enable error logging, set Log to {puts stderr} for instance, # via setLogCmd. return } # Accessor method for ::safe::AutoPathSync # Usage: ::safe::setSyncMode ?newValue? # Respond to changes by calling Setup again, preserving any # caller-defined logging. This allows complete equivalence with # prior Safe Base behavior if AutoPathSync is true. # # >>> WARNING <<< # # DO NOT CHANGE AutoPathSync EXCEPT BY THIS COMMAND - IT IS VITAL THAT WHENEVER # THE VALUE CHANGES, THE EXISTING PARSE TOKENS ARE DELETED AND Setup IS CALLED # AGAIN. # (The initialization of AutoPathSync at the end of this file is acceptable # because Setup has not yet been called.) proc ::safe::setSyncMode {args} { variable AutoPathSync if {[llength $args] == 0} { } elseif {[llength $args] == 1} { set newValue [lindex $args 0] if {![string is boolean -strict $newValue]} { return -code error "new value must be a valid boolean" } set args [expr {$newValue && $newValue}] if {([info vars ::safe::S*] ne {}) && ($args != $AutoPathSync)} { return -code error \ "cannot set new value while Safe Base child interpreters exist" } if {($args != $AutoPathSync)} { set AutoPathSync {*}$args ::tcl::OptKeyDelete ::safe::interpCreate ::tcl::OptKeyDelete ::safe::interpIC set TmpLog [setLogCmd] Setup setLogCmd $TmpLog } } else { set msg {wrong # args: should be "safe::setSyncMode ?newValue?"} return -code error $msg } return $AutoPathSync } namespace eval ::safe { # internal variables (must not begin with "S") # AutoPathSync # # Set AutoPathSync to 0 to give a child's ::auto_path the same meaning as # for an unsafe interpreter: the package command will search its directories # and first-level subdirectories for pkgIndex.tcl files; the auto-loader # will search its directories for tclIndex files. The access path and # module path will be maintained as separate values, and ::auto_path will # not be updated when the user calls ::safe::interpAddToAccessPath to add to # the access path. If the user specifies an access path when calling # interpCreate, interpInit or interpConfigure, it is the user's # responsibility to define the child's auto_path. If these commands are # called with no (or empty) access path, the child's auto_path will be set # to a tokenized form of the parent's auto_path, and these directories and # their first-level subdirectories will be added to the access path. # # Set to 1 for "traditional" behavior: a child's entire access path and # module path are copied to its ::auto_path, which is updated whenever # the user calls ::safe::interpAddToAccessPath to add to the access path. variable AutoPathSync 0 # Log command, set via 'setLogCmd'. Logging is disabled when empty. variable Log {} # The package maintains a state array per child interp under its # control. The name of this array is S. This array is # brought into scope where needed, using 'namespace upvar'. The S # prefix is used to avoid that a child interp called "Log" smashes # the "Log" variable. # # The array's elements are: # # access_path : List of paths accessible to the child. # access_path,norm : Ditto, in normalized form. # access_path,child : Ditto, as the path tokens as seen by the child. # access_path,map : dict ( token -> path ) # access_path,remap : dict ( path -> token ) # auto_path : List of paths requested by the caller as child's ::auto_path. # tm_path_child : List of TM root directories, as tokens seen by the child. # staticsok : Value of option -statics # nestedok : Value of option -nested # cleanupHook : Value of option -deleteHook # # In principle, the child can change its value of ::auto_path - # - a package might add a path (that is already in the access path) for # access to tclIndex files; # - the script might remove some elements of the auto_path. # However, this is really the business of the parent, and the auto_path will # be reset whenever the token mapping changes (i.e. when option -accessPath is # used to change the access path). # -autoPath is now stored in the array and is no longer obtained from # the child. } ::safe::Setup tcl9.0.3/library/registry/0000755000175000017500000000000015104662214015063 5ustar sergeisergeitcl9.0.3/library/registry/pkgIndex.tcl0000644000175000017500000000056615104661341017347 0ustar sergeisergeiif {![package vsatisfies [package provide Tcl] 8.5-]} return if {[info sharedlibextension] != ".dll"} return if {[package vsatisfies [package provide Tcl] 9.0-]} { package ifneeded registry 1.3.7 \ [list load [file join $dir tcl9registry13.dll] Registry] } else { package ifneeded registry 1.3.7 \ [list load [file join $dir tclregistry13.dll] Registry] } tcl9.0.3/library/readfile.tcl0000644000175000017500000000112715104661341015473 0ustar sergeisergei# readFile: # Read the contents of a file. # # Copyright © 2023 Donal K Fellows. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # proc readFile {filename {mode text}} { # Parse the arguments set MODES {binary text} set ERR [list -level 1 -errorcode [list TCL LOOKUP MODE $mode]] set mode [tcl::prefix match -message "mode" -error $ERR $MODES $mode] # Read the file set f [open $filename [dict get {text r binary rb} $mode]] try { return [read $f] } finally { close $f } } tcl9.0.3/library/platform/0000755000175000017500000000000015104662221015035 5ustar sergeisergeitcl9.0.3/library/platform/shell.tcl0000644000175000017500000001352715104661341016662 0ustar sergeisergei # -*- tcl -*- # ### ### ### ######### ######### ######### ## Overview # Higher-level commands which invoke the functionality of this package # for an arbitrary tcl shell (tclsh, wish, ...). This is required by a # repository as while the tcl shell executing packages uses the same # platform in general as a repository application there can be # differences in detail (i.e. 32/64 bit builds). # ### ### ### ######### ######### ######### ## Requirements package require platform namespace eval ::platform::shell {} # ### ### ### ######### ######### ######### ## Implementation # -- platform::shell::generic proc ::platform::shell::generic {shell} { # Argument is the path to a tcl shell. CHECK $shell LOCATE base out set code {} # Forget any preexisting platform package, it might be in # conflict with this one. lappend code {package forget platform} # Inject our platform package lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::generic]} # And done lappend code {exit 0} set arch [RUN $shell [join $code \n]] if {$out} {file delete -force $base} return $arch } # -- platform::shell::identify proc ::platform::shell::identify {shell} { # Argument is the path to a tcl shell. CHECK $shell LOCATE base out set code {} # Forget any preexisting platform package, it might be in # conflict with this one. lappend code {package forget platform} # Inject our platform package lappend code [list source -encoding utf-8 $base] # Query and print the architecture lappend code {puts [platform::identify]} # And done lappend code {exit 0} set arch [RUN $shell [join $code \n]] if {$out} {file delete -force $base} return $arch } # -- platform::shell::platform proc ::platform::shell::platform {shell} { # Argument is the path to a tcl shell. CHECK $shell set code {} lappend code {puts $tcl_platform(platform)} lappend code {exit 0} return [RUN $shell [join $code \n]] } # ### ### ### ######### ######### ######### ## Internal helper commands. proc ::platform::shell::CHECK {shell} { if {![file exists $shell]} { return -code error "Shell \"$shell\" does not exist" } if {![file executable $shell]} { return -code error "Shell \"$shell\" is not executable (permissions)" } return } proc ::platform::shell::LOCATE {bv ov} { upvar 1 $bv base $ov out # Locate the platform package for injection into the specified # shell. We are using package management to find it, wherever it # is, instead of using hardwired relative paths. This allows us to # install the two packages as TMs without breaking the code # here. If the found package is wrapped we copy the code somewhere # where the spawned shell will be able to read it. # This code is brittle, it needs has to adapt to whatever changes # are made to the TM code, i.e. the "provide" statement generated by # tm.tcl set pl [package ifneeded platform [package require platform]] set base [lindex $pl end] set out 0 if {[lindex [file system $base]] ne "native"} { set temp [TEMP] file copy -force $base $temp set base $temp set out 1 } return } proc ::platform::shell::RUN {shell code} { set c [TEMP] set cc [open $c w] puts $cc $code close $cc set e [TEMP] set code [catch { exec $shell $c 2> $e } res] file delete $c if {$code} { append res \n[read [set chan [open $e r]]][close $chan] file delete $e return -code error "Shell \"$shell\" is not executable ($res)" } file delete $e return $res } proc ::platform::shell::TEMP {} { set prefix platform # This code is copied out of Tcllib's fileutil package. # (TempFile/tempfile) set tmpdir [DIR] set chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" set nrand_chars 10 set maxtries 10 set access [list RDWR CREAT EXCL TRUNC] set permission 0600 set channel "" set checked_dir_writable 0 set mypid [pid] for {set i 0} {$i < $maxtries} {incr i} { set newname $prefix for {set j 0} {$j < $nrand_chars} {incr j} { append newname [string index $chars \ [expr {int(rand()*62)}]] } set newname [file join $tmpdir $newname] if {[file exists $newname]} { after 1 } else { if {[catch {open $newname $access $permission} channel]} { if {!$checked_dir_writable} { set dirname [file dirname $newname] if {![file writable $dirname]} { return -code error "Directory $dirname is not writable" } set checked_dir_writable 1 } } else { # Success close $channel return [file normalize $newname] } } } if {$channel ne ""} { return -code error "Failed to open a temporary file: $channel" } else { return -code error "Failed to find an unused temporary file name" } } proc ::platform::shell::DIR {} { # This code is copied out of Tcllib's fileutil package. # (TempDir/tempdir) global tcl_platform env set attempdirs [list] foreach tmp {TMPDIR TEMP TMP} { if { [info exists env($tmp)] } { lappend attempdirs $env($tmp) } } switch $tcl_platform(platform) { windows { lappend attempdirs "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP" } macintosh { set tmpdir $env(TRASH_FOLDER) ;# a better place? } default { lappend attempdirs \ [file join / tmp] \ [file join / var tmp] \ [file join / usr tmp] } } lappend attempdirs [pwd] foreach tmp $attempdirs { if { [file isdirectory $tmp] && [file writable $tmp] } { return [file normalize $tmp] } } # Fail if nothing worked. return -code error "Unable to determine a proper directory for temporary files" } # ### ### ### ######### ######### ######### ## Ready package provide platform::shell 1.1.4 tcl9.0.3/library/platform/platform.tcl0000644000175000017500000002545515076154257017415 0ustar sergeisergei# -*- tcl -*- # ### ### ### ######### ######### ######### ## Overview # Heuristics to assemble a platform identifier from publicly available # information. The identifier describes the platform of the currently # running tcl shell. This is a mixture of the runtime environment and # of build-time properties of the executable itself. # # Examples: # <1> A tcl shell executing on a x86_64 processor, but having a # wordsize of 4 was compiled for the x86 environment, i.e. 32 # bit, and loaded packages have to match that, and not the # actual cpu. # # <2> The hp/solaris 32/64 bit builds of the core cannot be # distinguished by looking at tcl_platform. As packages have to # match the 32/64 information we have to look in more places. In # this case we inspect the executable itself (magic numbers, # i.e. fileutil::magic::filetype). # # The basic information used comes out of the 'os' and 'machine' # entries of the 'tcl_platform' array. A number of general and # os/machine specific transformation are applied to get a canonical # result. # # General # Only the first element of 'os' is used - we don't care whether we # are on "Windows NT" or "Windows XP" or whatever. # # Machine specific # % amd64 -> x86_64 # % arm* -> arm # % sun4* -> sparc # % ia32* -> ix86 # % intel -> ix86 # % i*86* -> ix86 # % Power* -> powerpc # % x86_64 + wordSize 4 => x86 code # # OS specific # % AIX are always powerpc machines # % HP-UX 9000/800 etc means parisc # % linux has to take glibc version into account # % sunos -> solaris, and keep version number # # NOTE: A platform like linux glibc 2.3, which can use glibc 2.2 stuff # has to provide all possible allowed platform identifiers when # searching search. Ditto a solaris 2.8 platform can use solaris 2.6 # packages. Etc. This is handled by the other procedure, see below. # ### ### ### ######### ######### ######### ## Requirements namespace eval ::platform {} # ### ### ### ######### ######### ######### ## Implementation # -- platform::generic # # Assembles an identifier for the generic platform. It leaves out # details like kernel version, libc version, etc. proc ::platform::generic {} { global tcl_platform set plat [string tolower [lindex $tcl_platform(os) 0]] set cpu $tcl_platform(machine) switch -glob -- $cpu { sun4* { set cpu sparc } intel - ia32* - i*86* { set cpu ix86 } x86_64 { if {$tcl_platform(wordSize) == 4} { # See Example <1> at the top of this file. set cpu ix86 } } ppc - "Power*" { set cpu powerpc } "arm*" { set cpu arm } ia64 { if {$tcl_platform(wordSize) == 4} { append cpu _32 } } } switch -glob -- $plat { windows { if {$tcl_platform(platform) eq "unix"} { set plat cygwin } else { set plat win32 } if {$cpu eq "amd64"} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 } } sunos { set plat solaris if {[string match "ix86" $cpu]} { if {$tcl_platform(wordSize) == 8} { set cpu x86_64 } } elseif {![string match "ia64*" $cpu]} { # sparc if {$tcl_platform(wordSize) == 8} { append cpu 64 } } } darwin { set major [lindex [split $tcl_platform(osVersion) .] 0] if {$major > 19} { set plat macos } else { set plat macosx } # Correctly identify the cpu when running as a 64bit # process on a machine with a 32bit kernel if {$cpu eq "ix86"} { if {$tcl_platform(wordSize) == 8} { set cpu x86_64 } } } aix { set cpu powerpc if {$tcl_platform(wordSize) == 8} { append cpu 64 } } hp-ux { set plat hpux if {![string match "ia64*" $cpu]} { set cpu parisc if {$tcl_platform(wordSize) == 8} { append cpu 64 } } } osf1 { set plat tru64 } default { set plat [lindex [split $plat _-] 0] } } return "${plat}-${cpu}" } # -- platform::identify # # Assembles an identifier for the exact platform, by extending the # generic identifier. I.e. it adds in details like kernel version, # libc version, etc., if they are relevant for the loading of # packages on the platform. proc ::platform::identify {} { global tcl_platform set id [generic] regexp {^([^-]+)-([^-]+)$} $id -> plat cpu switch -glob -- $plat { solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text return "${plat}-${cpu}" } macos* { set major [lindex [split $tcl_platform(osVersion) .] 0] if {$major > 19} { incr major if {$major < 26} { incr major -10 } append plat $major } else { incr major -4 append plat 10.$major } return "${plat}-${cpu}" } linux { # Look for the libc*.so and determine its version # (libc5/6, libc6 further glibc 2.X) set v unknown # Determine in which directory to look. /lib, or /lib64. # For that we use the tcl_platform(wordSize). # # We could use the 'cpu' info, per the equivalence below, # that however would be restricted to intel. And this may # be a arm, mips, etc. system. The wordsize is more # fundamental. # # ix86 <=> (wordSize == 4) <=> 32 bit ==> /lib # x86_64 <=> (wordSize == 8) <=> 64 bit ==> /lib64 # # Do not look into /lib64 even if present, if the cpu # doesn't fit. # TODO: Determine the prefixes (i386, x86_64, ...) for # other cpus. The path after the generic one is utterly # specific to intel right now. Ok, on Ubuntu, possibly # other Debian systems we may apparently be able to query # the necessary CPU code. If we can't we simply use the # hardwired fallback. switch -- $tcl_platform(wordSize) { 4 { lappend bases /lib try { set res [exec dpkg-architecture -qDEB_HOST_MULTIARCH] # dpkg-arch returns the full triple, not just cpu. lappend bases /lib/$res } on error {} { lappend bases /lib/i386-linux-gnu } } 8 { lappend bases /lib64 try { set res [exec dpkg-architecture -qDEB_HOST_MULTIARCH] # dpkg-arch returns the full triple, not just cpu. lappend bases /lib/$res } on error {} { lappend bases /lib/x86_64-linux-gnu } } default { return -code error "Bad wordSize $tcl_platform(wordSize), expected 4 or 8" } } foreach base $bases { if {[LibcVersion $base -> v]} break } append plat -$v return "${plat}-${cpu}" } } return $id } proc ::platform::LibcVersion {base _->_ vv} { upvar 1 $vv v set libclist [lsort [glob -nocomplain -directory $base libc*]] if {![llength $libclist]} { return 0 } set libc [lindex $libclist 0] # Try executing the library first. This should succeed # for a glibc library, and return the version information. try { set vdata [lindex [split [exec $libc] \n] 0] } on ok {} { regexp {version ([0-9]+(\.[0-9]+)*)} $vdata -> v lassign [split $v .] major minor set v glibc${major}.${minor} return 1 } on error {} { # We had trouble executing the library. We are now # inspecting its name to determine the version # number. This code by Larry McVoy. if {[regexp -- {libc-([0-9]+)\.([0-9]+)} $libc -> major minor]} { set v glibc${major}.${minor} return 1 } } return 0 } # -- platform::patterns # # Given an exact platform identifier, i.e. _not_ the generic # identifier it assembles a list of exact platform identifier # describing platform which should be compatible with the # input. # # I.e. packages for all platforms in the result list should be # loadable on the specified platform. # << Should we add the generic identifier to the list as well ? In # general it is not compatible I believe. So better not. In many # cases the exact identifier is identical to the generic one # anyway. # >> proc ::platform::patterns {id} { set res [list $id] if {$id eq "tcl"} {return $res} switch -glob -- $id { solaris*-* { if {[regexp {solaris([^-]*)-(.*)} $id -> v cpu]} { if {$v eq ""} {return $id} lassign [split $v .] major minor incr minor -1 for {set j $minor} {$j >= 6} {incr j -1} { lappend res solaris${major}.${j}-${cpu} } } } linux*-* { if {[regexp {linux-glibc([^-]*)-(.*)} $id -> v cpu]} { lassign [split $v .] major minor incr minor -1 for {set j $minor} {$j >= 0} {incr j -1} { lappend res linux-glibc${major}.${j}-${cpu} } } } macosx-powerpc { lappend res macosx-universal } macosx-x86_64 { lappend res macosx-i386-x86_64 } macosx-ix86 { lappend res macosx-universal macosx-i386-x86_64 } macos*-* { # 10.5+,11.0+ if {[regexp {macosx?([^-]*)-(.*)} $id -> v cpu]} { lassign [split $v.15 .] major minor switch -exact -- $cpu { ix86 { lappend alt i386-x86_64 lappend alt universal } x86_64 { if {$major < 11 && $minor < 15} { set alt i386-x86_64 } else { set alt {} } } arm { lappend alt x86_64 } default { set alt {} } } if {$v ne ""} { set res {} while {$major > 10} { # Add $major to patterns. lappend res macos${major}-${cpu} foreach a $alt { lappend res macos${major}-$a } incr major -1 if {$major == 25} { set major 15 } } # Add 10.9 to 10.minor to patterns. for {set j $minor} {$j >= 9} {incr j -1} { if {$cpu ne "arm"} { lappend res macosx${major}.${j}-${cpu} } if {($cpu eq "x86_64") && ($j == 14) && ![package vsatisfies [package provide Tcl] 9.0-]} { set alt i386-x86_64 } foreach a $alt { lappend res macosx${major}.${j}-$a } } if {![package vsatisfies [package provide Tcl] 9.0-]} { # Continue up to 10.5. for {} {$j >= 5} {incr j -1} { if {$cpu ne "arm"} { lappend res macosx${major}.${j}-${cpu} } foreach a $alt { lappend res macosx${major}.${j}-$a } } # Add unversioned patterns for 10.3/10.4 builds. lappend res macosx-${cpu} foreach a $alt { lappend res macosx-$a } } } else { # No version, just do unversioned patterns. foreach a $alt { lappend res macosx-$a } } } else { # no v, no cpu ... nothing } } } lappend res tcl ; # Pure tcl packages are always compatible. return $res } # ### ### ### ######### ######### ######### ## Ready package provide platform 1.1.0 # ### ### ### ######### ######### ######### ## Demo application if {[info exists argv0] && ($argv0 eq [info script])} { puts ==================================== parray tcl_platform puts ==================================== puts Generic\ identification:\ [::platform::generic] puts Exact\ identification:\ \ \ [::platform::identify] puts ==================================== puts Search\ patterns: puts *\ [join [::platform::patterns [::platform::identify]] \n*\ ] puts ==================================== exit 0 } tcl9.0.3/library/platform/pkgIndex.tcl0000644000175000017500000000040215076154257017323 0ustar sergeisergeiif {![package vsatisfies [package provide Tcl] 8.6-]} {return} package ifneeded platform 1.1.0 [list source -encoding utf-8 [file join $dir platform.tcl]] package ifneeded platform::shell 1.1.4 [list source -encoding utf-8 [file join $dir shell.tcl]] tcl9.0.3/library/parray.tcl0000644000175000017500000000145615104661341015223 0ustar sergeisergei# parray: # Print the contents of a global array on stdout. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # proc parray {a {pattern *}} { upvar 1 $a array if {![array exists array]} { return -code error "\"$a\" isn't an array" } set maxl 0 set names [lsort [array names array $pattern]] foreach name $names { if {[string length $name] > $maxl} { set maxl [string length $name] } } set maxl [expr {$maxl + [string length $a] + 2}] foreach name $names { set nameString [format %s(%s) $a $name] puts stdout [format "%-*s = %s" $maxl $nameString $array($name)] } } tcl9.0.3/library/package.tcl0000644000175000017500000005630515104661341015323 0ustar sergeisergei# package.tcl -- # # utility procs formerly in init.tcl which can be loaded on demand # for package management. # # Copyright © 1991-1993 The Regents of the University of California. # Copyright © 1994-1998 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # namespace eval tcl::Pkg {} # ::tcl::Pkg::CompareExtension -- # # Used internally by pkg_mkIndex to compare the extension of a file to a given # extension. On Windows, it uses a case-insensitive comparison because the # file system can be file insensitive. # # Arguments: # fileName name of a file whose extension is compared # ext (optional) The extension to compare against; you must # provide the starting dot. # Defaults to [info sharedlibextension] # # Results: # Returns 1 if the extension matches, 0 otherwise proc tcl::Pkg::CompareExtension {fileName {ext {}}} { global tcl_platform if {$ext eq ""} {set ext [info sharedlibextension]} if {$tcl_platform(platform) eq "windows"} { return [string equal -nocase [file extension $fileName] $ext] } else { # Some unices add trailing numbers after the .so, so # we could have something like '.so.1.2'. set root $fileName while {1} { set currExt [file extension $root] if {$currExt eq $ext} { return 1 } # The current extension does not match; if it is not a numeric # value, quit, as we are only looking to ignore version number # extensions. Otherwise we might return 1 in this case: # tcl::Pkg::CompareExtension foo.so.bar .so # which should not match. if {![string is integer -strict [string range $currExt 1 end]]} { return 0 } set root [file rootname $root] } } } # pkg_mkIndex -- # This procedure creates a package index in a given directory. The package # index consists of a "pkgIndex.tcl" file whose contents are a Tcl script that # sets up package information with "package require" commands. The commands # describe all of the packages defined by the files given as arguments. # # Arguments: # -direct (optional) If this flag is present, the generated # code in pkgMkIndex.tcl will cause the package to be # loaded when "package require" is executed, rather # than lazily when the first reference to an exported # procedure in the package is made. # -verbose (optional) Verbose output; the name of each file that # was successfully processed is printed out. Additionally, # if processing of a file failed a message is printed. # -load pat (optional) Preload any packages whose names match # the pattern. Used to handle DLLs that depend on # other packages during their Init procedure. # dir - Name of the directory in which to create the index. # args - Any number of additional arguments, each giving # a glob pattern that matches the names of one or # more shared libraries or Tcl script files in # dir. proc pkg_mkIndex {args} { set usage {"pkg_mkIndex ?-direct? ?-lazy? ?-load pattern? ?-verbose? ?--? dir ?pattern ...?"} set argCount [llength $args] if {$argCount < 1} { return -code error "wrong # args: should be\n$usage" } set more "" set direct 1 set doVerbose 0 set loadPat "" for {set idx 0} {$idx < $argCount} {incr idx} { set flag [lindex $args $idx] switch -glob -- $flag { -- { # done with the flags incr idx break } -verbose { set doVerbose 1 } -lazy { set direct 0 append more " -lazy" } -direct { append more " -direct" } -load { incr idx set loadPat [lindex $args $idx] append more " -load $loadPat" } -* { return -code error "unknown flag $flag: should be\n$usage" } default { # done with the flags break } } } set dir [lindex $args $idx] set patternList [lrange $args [expr {$idx + 1}] end] if {![llength $patternList]} { set patternList [list "*.tcl" "*[info sharedlibextension]"] } try { set fileList [glob -directory $dir -tails -types {r f} -- \ {*}$patternList] } on error {msg opt} { return -options $opt $msg } if {[llength $fileList] == 0} { return -code error "no files matched glob pattern \"$patternList\"" } foreach file $fileList { # For each file, figure out what commands and packages it provides. # To do this, create a child interpreter, load the file into the # interpreter, and get a list of the new commands and packages that # are defined. if {$file eq "pkgIndex.tcl"} { continue } set c [interp create] # Load into the child any packages currently loaded in the parent # interpreter that match the -load pattern. if {$loadPat ne ""} { if {$doVerbose} { tclLog "currently loaded packages: '[info loaded]'" tclLog "trying to load all packages matching $loadPat" } if {![llength [info loaded]]} { tclLog "warning: no packages are currently loaded, nothing" tclLog "can possibly match '$loadPat'" } } foreach pkg [info loaded] { if {![string match -nocase $loadPat [lindex $pkg 1]]} { continue } if {$doVerbose} { tclLog "package [lindex $pkg 1] matches '$loadPat'" } try { load [lindex $pkg 0] [lindex $pkg 1] $c } on error err { if {$doVerbose} { tclLog "warning: load [lindex $pkg 0]\ [lindex $pkg 1]\nfailed with: $err" } } on ok {} { if {$doVerbose} { tclLog "loaded [lindex $pkg 0] [lindex $pkg 1]" } } if {[lindex $pkg 1] eq "Tk"} { # Withdraw . if Tk was loaded, to avoid showing a window. $c eval [list wm withdraw .] } } $c eval { # Stub out the package command so packages can require other # packages. rename package __package_orig proc package {what args} { switch -- $what { require { return; # Ignore transitive requires } default { __package_orig $what {*}$args } } } proc tclPkgUnknown args {} package unknown tclPkgUnknown # Stub out the unknown command so package can call into each other # during their initialization. proc unknown {args} {} # Stub out the auto_import mechanism proc auto_import {args} {} # reserve the ::tcl namespace for support procs and temporary # variables. This might make it awkward to generate a # pkgIndex.tcl file for the ::tcl namespace. namespace eval ::tcl { variable dir ;# Current directory being processed variable file ;# Current file being processed variable direct ;# -direct flag value variable x ;# Loop variable variable debug ;# For debugging variable type ;# "load" or "source", for -direct variable namespaces ;# Existing namespaces (e.g., ::tcl) variable packages ;# Existing packages (e.g., Tcl) variable origCmds ;# Existing commands variable newCmds ;# Newly created commands variable newPkgs {} ;# Newly created packages } } $c eval [list set ::tcl::dir $dir] $c eval [list set ::tcl::file $file] $c eval [list set ::tcl::direct $direct] # Download needed procedures into the child because we've just deleted # the unknown procedure. This doesn't handle procedures with default # arguments. foreach p {::tcl::Pkg::CompareExtension} { $c eval [list namespace eval [namespace qualifiers $p] {}] $c eval [list proc $p [info args $p] [info body $p]] } try { $c eval { set ::tcl::debug "loading or sourcing" # we need to track command defined by each package even in the # -direct case, because they are needed internally by the # "partial pkgIndex.tcl" step above. proc ::tcl::GetAllNamespaces {{root ::}} { set list $root foreach ns [namespace children $root] { lappend list {*}[::tcl::GetAllNamespaces $ns] } return $list } # init the list of existing namespaces, packages, commands foreach ::tcl::x [::tcl::GetAllNamespaces] { set ::tcl::namespaces($::tcl::x) 1 } foreach ::tcl::x [package names] { if {[package provide $::tcl::x] ne ""} { set ::tcl::packages($::tcl::x) 1 } } set ::tcl::origCmds [info commands] # Try to load the file if it has the shared library extension, # otherwise source it. It's important not to try to load # files that aren't shared libraries, because on some systems # (like SunOS) the loader will abort the whole application # when it gets an error. if {[::tcl::Pkg::CompareExtension $::tcl::file [info sharedlibextension]]} { # The "file join ." command below is necessary. Without # it, if the file name has no \'s and we're on UNIX, the # load command will invoke the LD_LIBRARY_PATH search # mechanism, which could cause the wrong file to be used. set ::tcl::debug loading load [file join $::tcl::dir $::tcl::file] set ::tcl::type load } else { set ::tcl::debug sourcing source [file join $::tcl::dir $::tcl::file] set ::tcl::type source } # As a performance optimization, if we are creating direct # load packages, don't bother figuring out the set of commands # created by the new packages. We only need that list for # setting up the autoloading used in the non-direct case. if {!$::tcl::direct} { # See what new namespaces appeared, and import commands # from them. Only exported commands go into the index. foreach ::tcl::x [::tcl::GetAllNamespaces] { if {![info exists ::tcl::namespaces($::tcl::x)]} { namespace import -force ${::tcl::x}::* } # Figure out what commands appeared foreach ::tcl::x [info commands] { set ::tcl::newCmds($::tcl::x) 1 } foreach ::tcl::x $::tcl::origCmds { unset -nocomplain ::tcl::newCmds($::tcl::x) } foreach ::tcl::x [array names ::tcl::newCmds] { # determine which namespace a command comes from set ::tcl::abs [namespace origin $::tcl::x] # special case so that global names have no # leading ::, this is required by the unknown # command set ::tcl::abs \ [lindex [auto_qualify $::tcl::abs ::] 0] if {$::tcl::x ne $::tcl::abs} { # Name changed during qualification set ::tcl::newCmds($::tcl::abs) 1 unset ::tcl::newCmds($::tcl::x) } } } } # Look through the packages that appeared, and if there is a # version provided, then record it foreach ::tcl::x [package names] { if {[package provide $::tcl::x] ne "" && ![info exists ::tcl::packages($::tcl::x)]} { lappend ::tcl::newPkgs \ [list $::tcl::x [package provide $::tcl::x]] } } } } on error msg { set what [$c eval set ::tcl::debug] if {$doVerbose} { tclLog "warning: error while $what $file: $msg" } } on ok {} { set what [$c eval set ::tcl::debug] if {$doVerbose} { tclLog "successful $what of $file" } set type [$c eval set ::tcl::type] set cmds [lsort [$c eval array names ::tcl::newCmds]] set pkgs [$c eval set ::tcl::newPkgs] if {$doVerbose} { if {!$direct} { tclLog "commands provided were $cmds" } tclLog "packages provided were $pkgs" } if {[llength $pkgs] > 1} { tclLog "warning: \"$file\" provides more than one package ($pkgs)" } foreach pkg $pkgs { # cmds is empty/not used in the direct case lappend files($pkg) [list $file $type $cmds] } if {$doVerbose} { tclLog "processed $file" } } interp delete $c } append index "# Tcl package index file, version 1.1\n" append index "# This file is generated by the \"pkg_mkIndex$more\" command\n" append index "# and sourced either when an application starts up or\n" append index "# by a \"package unknown\" script. It invokes the\n" append index "# \"package ifneeded\" command to set up package-related\n" append index "# information so that packages will be loaded automatically\n" append index "# in response to \"package require\" commands. When this\n" append index "# script is sourced, the variable \$dir must contain the\n" append index "# full path name of this file's directory.\n" foreach pkg [lsort [array names files]] { set cmd {} lassign $pkg name version lappend cmd ::tcl::Pkg::Create -name $name -version $version foreach spec [lsort -index 0 $files($pkg)] { foreach {file type procs} $spec { if {$direct} { set procs {} } lappend cmd "-$type" [list $file $procs] } } append index "\n[eval $cmd]" } set f [open [file join $dir pkgIndex.tcl] w] fconfigure $f -encoding utf-8 -translation lf puts $f $index close $f } # tclPkgSetup -- # This is a utility procedure use by pkgIndex.tcl files. It is invoked as # part of a "package ifneeded" script. It calls "package provide" to indicate # that a package is available, then sets entries in the auto_index array so # that the package's files will be auto-loaded when the commands are used. # # Arguments: # dir - Directory containing all the files for this package. # pkg - Name of the package (no version number). # version - Version number for the package, such as 2.1.3. # files - List of files that constitute the package. Each # element is a sub-list with three elements. The first # is the name of a file relative to $dir, the second is # "load" or "source", indicating whether the file is a # loadable binary or a script to source, and the third # is a list of commands defined by this file. proc tclPkgSetup {dir pkg version files} { global auto_index package provide $pkg $version foreach fileInfo $files { set f [lindex $fileInfo 0] set type [lindex $fileInfo 1] foreach cmd [lindex $fileInfo 2] { if {$type eq "load"} { set auto_index($cmd) [list load [file join $dir $f] $pkg] } else { set auto_index($cmd) [list source [file join $dir $f]] } } } } # tclPkgUnknown -- # This procedure provides the default for the "package unknown" function. It # is invoked when a package that's needed can't be found. It scans the # auto_path directories and their immediate children looking for pkgIndex.tcl # files and sources any such files that are found to setup the package # database. As it searches, it will recognize changes to the auto_path and # scan any new directories. # # Arguments: # name - Name of desired package. Not used. # version - Version of desired package. Not used. # exact - Either "-exact" or omitted. Not used. proc tclPkgUnknown {name args} { global auto_path env if {![info exists auto_path]} { return } # Cache the auto_path, because it may change while we run through the # first set of pkgIndex.tcl files set old_path [set use_path $auto_path] while {[llength $use_path]} { set dir [lindex $use_path end] # Make sure we only scan each directory one time. if {[info exists tclSeenPath($dir)]} { set use_path [lrange $use_path 0 end-1] continue } set tclSeenPath($dir) 1 # Get the pkgIndex.tcl files in subdirectories of auto_path directories. # - Safe Base interpreters have a restricted "glob" command that # works in this case. # - The "catch" was essential when there was no safe glob and every # call in a safe interp failed; it is retained only for corner # cases in which the eventual call to glob returns an error. catch { foreach file [glob -directory $dir -join -nocomplain \ * pkgIndex.tcl] { set dir [file dirname $file] if {![info exists procdDirs($dir)]} { try { ::tcl::Pkg::source $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue } on error msg { if {[regexp {version conflict for package} $msg]} { # In case of version conflict, silently ignore continue } tclLog "error reading package index file $file: $msg" } on ok {} { set procdDirs($dir) 1 } } } } set dir [lindex $use_path end] if {![info exists procdDirs($dir)]} { set file [file join $dir pkgIndex.tcl] # safe interps usually don't have "file exists", if {([interp issafe] || [file exists $file])} { try { ::tcl::Pkg::source $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue } on error msg { if {[regexp {version conflict for package} $msg]} { # In case of version conflict, silently ignore continue } tclLog "error reading package index file $file: $msg" } on ok {} { set procdDirs($dir) 1 } } } set use_path [lrange $use_path 0 end-1] # Check whether any of the index scripts we [source]d above set a new # value for $::auto_path. If so, then find any new directories on the # $::auto_path, and lappend them to the $use_path we are working from. # This gives index scripts the (arguably unwise) power to expand the # index script search path while the search is in progress. set index 0 if {[llength $old_path] == [llength $auto_path]} { foreach dir $auto_path old $old_path { if {$dir ne $old} { # This entry in $::auto_path has changed. break } incr index } } # $index now points to the first element of $auto_path that has # changed, or the beginning if $auto_path has changed length Scan the # new elements of $auto_path for directories to add to $use_path. # Don't add directories we've already seen, or ones already on the # $use_path. foreach dir [lrange $auto_path $index end] { if {![info exists tclSeenPath($dir)] && ($dir ni $use_path)} { lappend use_path $dir } } set old_path $auto_path } } # tcl::MacOSXPkgUnknown -- # This procedure extends the "package unknown" function for MacOSX. It scans # the Resources/Scripts directories of the immediate children of the auto_path # directories for pkgIndex files. # # Arguments: # original - original [package unknown] procedure # name - Name of desired package. Not used. # version - Version of desired package. Not used. # exact - Either "-exact" or omitted. Not used. proc tcl::MacOSXPkgUnknown {original name args} { # First do the cross-platform default search uplevel 1 $original [linsert $args 0 $name] # Now do MacOSX specific searching global auto_path if {![info exists auto_path]} { return } # Cache the auto_path, because it may change while we run through the # first set of pkgIndex.tcl files set old_path [set use_path $auto_path] while {[llength $use_path]} { set dir [lindex $use_path end] # Make sure we only scan each directory one time. if {[info exists tclSeenPath($dir)]} { set use_path [lrange $use_path 0 end-1] continue } set tclSeenPath($dir) 1 # get the pkgIndex files out of the subdirectories # Safe interpreters do not use tcl::MacOSXPkgUnknown - see init.tcl. foreach file [glob -directory $dir -join -nocomplain \ * Resources Scripts pkgIndex.tcl] { set dir [file dirname $file] if {![info exists procdDirs($dir)]} { try { ::tcl::Pkg::source $file } trap {POSIX EACCES} {} { # $file was not readable; silently ignore continue } on error msg { if {[regexp {version conflict for package} $msg]} { # In case of version conflict, silently ignore continue } tclLog "error reading package index file $file: $msg" } on ok {} { set procdDirs($dir) 1 } } } set use_path [lrange $use_path 0 end-1] # Check whether any of the index scripts we [source]d above set a new # value for $::auto_path. If so, then find any new directories on the # $::auto_path, and lappend them to the $use_path we are working from. # This gives index scripts the (arguably unwise) power to expand the # index script search path while the search is in progress. set index 0 if {[llength $old_path] == [llength $auto_path]} { foreach dir $auto_path old $old_path { if {$dir ne $old} { # This entry in $::auto_path has changed. break } incr index } } # $index now points to the first element of $auto_path that has # changed, or the beginning if $auto_path has changed length Scan the # new elements of $auto_path for directories to add to $use_path. # Don't add directories we've already seen, or ones already on the # $use_path. foreach dir [lrange $auto_path $index end] { if {![info exists tclSeenPath($dir)] && ($dir ni $use_path)} { lappend use_path $dir } } set old_path $auto_path } } # ::tcl::Pkg::Create -- # # Given a package specification generate a "package ifneeded" statement # for the package, suitable for inclusion in a pkgIndex.tcl file. # # Arguments: # args arguments used by the Create function: # -name packageName # -version packageVersion # -load {filename ?{procs}?} # ... # -source {filename ?{procs}?} # ... # # Any number of -load and -source parameters may be # specified, so long as there is at least one -load or # -source parameter. If the procs component of a module # specifier is left off, that module will be set up for # direct loading; otherwise, it will be set up for lazy # loading. If both -source and -load are specified, the # -load'ed files will be loaded first, followed by the # -source'd files. # # Results: # An appropriate "package ifneeded" statement for the package. proc ::tcl::Pkg::Create {args} { append err(usage) "[lindex [info level 0] 0] " append err(usage) "-name packageName -version packageVersion" append err(usage) "?-load {filename ?{procs}?}? ... " append err(usage) "?-source {filename ?{procs}?}? ..." set err(wrongNumArgs) "wrong # args: should be \"$err(usage)\"" set err(valueMissing) "value for \"%s\" missing: should be \"$err(usage)\"" set err(unknownOpt) "unknown option \"%s\": should be \"$err(usage)\"" set err(noLoadOrSource) "at least one of -load and -source must be given" # process arguments set len [llength $args] if {$len < 6} { error $err(wrongNumArgs) } # Initialize parameters array set opts {-name {} -version {} -source {} -load {}} # process parameters for {set i 0} {$i < $len} {incr i} { set flag [lindex $args $i] incr i switch -glob -- $flag { "-name" - "-version" { if {$i >= $len} { error [format $err(valueMissing) $flag] } set opts($flag) [lindex $args $i] } "-source" - "-load" { if {$i >= $len} { error [format $err(valueMissing) $flag] } lappend opts($flag) [lindex $args $i] } default { error [format $err(unknownOpt) [lindex $args $i]] } } } # Validate the parameters if {![llength $opts(-name)]} { error [format $err(valueMissing) "-name"] } if {![llength $opts(-version)]} { error [format $err(valueMissing) "-version"] } if {!([llength $opts(-source)] || [llength $opts(-load)])} { error $err(noLoadOrSource) } # OK, now everything is good. Generate the package ifneeded statement. set cmdline "package ifneeded $opts(-name) $opts(-version) " set cmdList {} set lazyFileList {} # Handle -load and -source specs foreach key {load source} { foreach filespec $opts(-$key) { lassign $filespec filename proclist if { [llength $proclist] == 0 } { set cmd "\[list $key \[file join \$dir [list $filename]\]\]" lappend cmdList $cmd } else { lappend lazyFileList [list $filename $key $proclist] } } } if {[llength $lazyFileList]} { lappend cmdList "\[list tclPkgSetup \$dir $opts(-name)\ $opts(-version) [list $lazyFileList]\]" } append cmdline [join $cmdList "\\n"] return $cmdline } interp alias {} ::pkg::create {} ::tcl::Pkg::Create tcl9.0.3/library/opt/0000755000175000017500000000000015104662211014012 5ustar sergeisergeitcl9.0.3/library/opt/pkgIndex.tcl0000644000175000017500000000116115104661341016271 0ustar sergeisergei# Tcl package index file, version 1.1 # This file is generated by the "pkg_mkIndex -direct" command # and sourced either when an application starts up or # by a "package unknown" script. It invokes the # "package ifneeded" command to set up package-related # information so that packages will be loaded automatically # in response to "package require" commands. When this # script is sourced, the variable $dir must contain the # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.6-]} {return} package ifneeded opt 0.4.10 [list source -encoding utf-8 [file join $dir optparse.tcl]] tcl9.0.3/library/opt/optparse.tcl0000644000175000017500000007332615104661341016371 0ustar sergeisergei# optparse.tcl -- # # (private) Option parsing package # Primarily used internally by the safe:: code. # # WARNING: This code will go away in a future release # of Tcl. It is NOT supported and you should not rely # on it. If your code does rely on this package you # may directly incorporate this code into your application. package require Tcl 8.5- # When this version number changes, update the pkgIndex.tcl file # and the install directory in the Makefiles. package provide opt 0.4.10 namespace eval ::tcl { # Exported APIs namespace export OptKeyRegister OptKeyDelete OptKeyError OptKeyParse \ OptProc OptProcArgGiven OptParse \ Lempty Lget \ Lassign Lvarpop Lvarpop1 Lvarset Lvarincr \ SetMax SetMin ################# Example of use / 'user documentation' ################### proc OptCreateTestProc {} { # Defines ::tcl::OptParseTest as a test proc with parsed arguments # (can't be defined before the code below is loaded (before "OptProc")) # Every OptProc give usage information on "procname -help". # Try "tcl::OptParseTest -help" and "tcl::OptParseTest -a" and # then other arguments. # # example of 'valid' call: # ::tcl::OptParseTest save -4 -pr 23 -libsok SybTcl\ # -nostatics false ch1 OptProc OptParseTest { {subcommand -choice {save print} "sub command"} {arg1 3 "some number"} {-aflag} {-intflag 7} {-weirdflag "help string"} {-noStatics "Not ok to load static packages"} {-nestedloading1 true "OK to load into nested children"} {-nestedloading2 -boolean true "OK to load into nested children"} {-libsOK -choice {Tk SybTcl} "List of packages that can be loaded"} {-precision -int 12 "Number of digits of precision"} {-intval 7 "An integer"} {-scale -float 1.0 "Scale factor"} {-zoom 1.0 "Zoom factor"} {-arbitrary foobar "Arbitrary string"} {-random -string 12 "Random string"} {-listval -list {} "List value"} {-blahflag -blah abc "Funny type"} {arg2 -boolean "a boolean"} {arg3 -choice "ch1 ch2"} {?optarg? -list {} "optional argument"} } { foreach v [info locals] { puts stderr [format "%14s : %s" $v [set $v]] } } } ################### No User serviceable part below ! ############### # Array storing the parsed descriptions variable OptDesc array set OptDesc {} # Next potentially free key id (numeric) variable OptDescN 0 # Inside algorithm/mechanism description: # (not for the faint-hearted ;-) # # The argument description is parsed into a "program tree" # It is called a "program" because it is the program used by # the state machine interpreter that use that program to # actually parse the arguments at run time. # # The general structure of a "program" is # notation (pseudo bnf like) # name :== definition defines "name" as being "definition" # { x y z } means list of x, y, and z # x* means x repeated 0 or more time # x+ means "x x*" # x? means optionally x # x | y means x or y # "cccc" means the literal string # # program :== { programCounter programStep* } # # programStep :== program | singleStep # # programCounter :== {"P" integer+ } # # singleStep :== { instruction parameters* } # # instruction :== single element list # # (the difference between singleStep and program is that \ # llength [lindex $program 0] >= 2 # while # llength [lindex $singleStep 0] == 1 # ) # # And for this application: # # singleStep :== { instruction varname {hasBeenSet currentValue} type # typeArgs help } # instruction :== "flags" | "value" # type :== knowType | anyword # knowType :== "string" | "int" | "boolean" | "boolflag" | "float" # | "choice" # # for type "choice" typeArgs is a list of possible choices, the first one # is the default value. for all other types the typeArgs is the default value # # a "boolflag" is the type for a flag whose presence or absence, without # additional arguments means respectively true or false (default flag type). # # programCounter is the index in the list of the currently processed # programStep (thus starting at 1 (0 is {"P" prgCounterValue}). # If it is a list it points toward each currently selected programStep. # (like for "flags", as they are optional, form a set and programStep). # Performance/Implementation issues # --------------------------------- # We use tcl lists instead of arrays because with tcl8.0 # they should start to be much faster. # But this code use a lot of helper procs (like Lvarset) # which are quite slow and would be helpfully optimized # for instance by being written in C. Also our structure # is complex and there is maybe some places where the # string rep might be calculated at great expense. to be checked. # # Parse a given description and saves it here under the given key # generate a unused keyid if not given # proc ::tcl::OptKeyRegister {desc {key ""}} { variable OptDesc variable OptDescN if {$key eq ""} { # in case a key given to us as a parameter was a number while {[info exists OptDesc($OptDescN)]} {incr OptDescN} set key $OptDescN incr OptDescN } # program counter set program [list [list "P" 1]] # are we processing flags (which makes a single program step) set inflags 0 set state {} # flag used to detect that we just have a single (flags set) subprogram. set empty 1 foreach item $desc { if {$state eq "args"} { # more items after 'args'... return -code error "'args' special argument must be the last one" } set res [OptNormalizeOne $item] set state [lindex $res 0] if {$inflags} { if {$state eq "flags"} { # add to 'subprogram' lappend flagsprg $res } else { # put in the flags # structure for flag programs items is a list of # {subprgcounter {prg flag 1} {prg flag 2} {...}} lappend program $flagsprg # put the other regular stuff lappend program $res set inflags 0 set empty 0 } } else { if {$state eq "flags"} { set inflags 1 # sub program counter + first sub program set flagsprg [list [list "P" 1] $res] } else { lappend program $res set empty 0 } } } if {$inflags} { if {$empty} { # We just have the subprogram, optimize and remove # unneeded level: set program $flagsprg } else { lappend program $flagsprg } } set OptDesc($key) $program return $key } # # Free the storage for that given key # proc ::tcl::OptKeyDelete {key} { variable OptDesc unset OptDesc($key) } # Get the parsed description stored under the given key. proc OptKeyGetDesc {descKey} { variable OptDesc if {![info exists OptDesc($descKey)]} { return -code error "Unknown option description key \"$descKey\"" } set OptDesc($descKey) } # Parse entry point for people who don't want to register with a key, # for instance because the description changes dynamically. # (otherwise one should really use OptKeyRegister once + OptKeyParse # as it is way faster or simply OptProc which does it all) # Assign a temporary key, call OptKeyParse and then free the storage proc ::tcl::OptParse {desc arglist} { set tempkey [OptKeyRegister $desc] set ret [catch {uplevel 1 [list ::tcl::OptKeyParse $tempkey $arglist]} res] OptKeyDelete $tempkey return -code $ret $res } # Helper function, replacement for proc that both # register the description under a key which is the name of the proc # (and thus unique to that code) # and add a first line to the code to call the OptKeyParse proc # Stores the list of variables that have been actually given by the user # (the other will be sets to their default value) # into local variable named "Args". proc ::tcl::OptProc {name desc body} { set namespace [uplevel 1 [list ::namespace current]] if {[string match "::*" $name] || $namespace eq "::"} { # absolute name or global namespace, name is the key set key $name } else { # we are relative to some non top level namespace: set key "${namespace}::${name}" } OptKeyRegister $desc $key uplevel 1 [list ::proc $name args "set Args \[::tcl::OptKeyParse [list $key] \$args\]\n$body"] return $key } # Check that a argument has been given # assumes that "OptProc" has been used as it will check in "Args" list proc ::tcl::OptProcArgGiven {argname} { upvar 1 Args alist expr {$argname in $alist} } ####### # Programs/Descriptions manipulation # Return the instruction word/list of a given step/(sub)program proc OptInstr {lst} { lindex $lst 0 } # Is a (sub) program or a plain instruction ? proc OptIsPrg {lst} { expr {[llength [OptInstr $lst]]>=2} } # Is this instruction a program counter or a real instr proc OptIsCounter {item} { expr {[lindex $item 0] eq "P"} } # Current program counter (2nd word of first word) proc OptGetPrgCounter {lst} { Lget $lst {0 1} } # Current program counter (2nd word of first word) proc OptSetPrgCounter {lstName newValue} { upvar 1 $lstName lst set lst [lreplace $lst 0 0 [concat "P" $newValue]] } # returns a list of currently selected items. proc OptSelection {lst} { set res {} foreach idx [lrange [lindex $lst 0] 1 end] { lappend res [Lget $lst $idx] } return $res } # Advance to next description proc OptNextDesc {descName} { uplevel 1 [list Lvarincr $descName {0 1}] } # Get the current description, eventually descend proc OptCurDesc {descriptions} { lindex $descriptions [OptGetPrgCounter $descriptions] } # get the current description, eventually descend # through sub programs as needed. proc OptCurDescFinal {descriptions} { set item [OptCurDesc $descriptions] # Descend untill we get the actual item and not a sub program while {[OptIsPrg $item]} { set item [OptCurDesc $item] } return $item } # Current final instruction adress proc OptCurAddr {descriptions {start {}}} { set adress [OptGetPrgCounter $descriptions] lappend start $adress set item [lindex $descriptions $adress] if {[OptIsPrg $item]} { return [OptCurAddr $item $start] } else { return $start } } # Set the value field of the current instruction. proc OptCurSetValue {descriptionsName value} { upvar 1 $descriptionsName descriptions # Get the current item full address. set adress [OptCurAddr $descriptions] # Use the 3rd field of the item (see OptValue / OptNewInst). lappend adress 2 Lvarset descriptions $adress [list 1 $value] # ^hasBeenSet flag } # Empty state means done/paste the end of the program. proc OptState {item} { lindex $item 0 } # current state proc OptCurState {descriptions} { OptState [OptCurDesc $descriptions] } ####### # Arguments manipulation # Returns the argument that has to be processed now. proc OptCurrentArg {lst} { lindex $lst 0 } # Advance to next argument. proc OptNextArg {argsName} { uplevel 1 [list Lvarpop1 $argsName] } ####### # Loop over all descriptions, calling OptDoOne which will # eventually eat all the arguments. proc OptDoAll {descriptionsName argumentsName} { upvar 1 $descriptionsName descriptions $argumentsName arguments # puts "entered DoAll" # Nb: the places where "state" can be set are tricky to figure # because DoOne sets the state to flagsValue and return -continue # when needed... set state [OptCurState $descriptions] # We'll exit the loop in "OptDoOne" or when state is empty. while 1 { set curitem [OptCurDesc $descriptions] # Do subprograms if needed, call ourselves on the sub branch while {[OptIsPrg $curitem]} { OptDoAll curitem arguments # puts "done DoAll sub" # Insert back the results in current tree Lvarset1nc descriptions [OptGetPrgCounter $descriptions]\ $curitem OptNextDesc descriptions set curitem [OptCurDesc $descriptions] set state [OptCurState $descriptions] } # puts "state = \"$state\" - arguments=($arguments)" if {[Lempty $state]} { # Nothing left to do, we are done in this branch: break } # The following statement can make us terminate/continue # as it use return -code {break, continue, return and error} # codes OptDoOne descriptions state arguments # If we are here, no special return code where issued, # we'll step to next instruction : # puts "new state = \"$state\"" OptNextDesc descriptions set state [OptCurState $descriptions] } } # Process one step for the state machine, # eventually consuming the current argument. proc OptDoOne {descriptionsName stateName argumentsName} { upvar 1 $argumentsName arguments \ $descriptionsName descriptions \ $stateName state # the special state/instruction "args" eats all # the remaining args (if any) if {($state eq "args")} { if {![Lempty $arguments]} { # If there is no additional arguments, leave the default value # in. OptCurSetValue descriptions $arguments set arguments {} } # puts "breaking out ('args' state: consuming every reminding args)" return -code break } if {[Lempty $arguments]} { if {$state eq "flags"} { # no argument and no flags : we're done # puts "returning to previous (sub)prg (no more args)" return -code return } elseif {$state eq "optValue"} { set state next; # not used, for debug only # go to next state return } else { return -code error [OptMissingValue $descriptions] } } else { set arg [OptCurrentArg $arguments] } switch $state { flags { # A non-dash argument terminates the options, as does -- # Still a flag ? if {![OptIsFlag $arg]} { # don't consume the argument, return to previous prg return -code return } # consume the flag OptNextArg arguments if {"--" eq $arg} { # return from 'flags' state return -code return } set hits [OptHits descriptions $arg] if {$hits > 1} { return -code error [OptAmbigous $descriptions $arg] } elseif {$hits == 0} { return -code error [OptFlagUsage $descriptions $arg] } set item [OptCurDesc $descriptions] if {[OptNeedValue $item]} { # we need a value, next state is set state flagValue } else { OptCurSetValue descriptions 1 } # continue return -code continue } flagValue - value { set item [OptCurDesc $descriptions] # Test the values against their required type if {[catch {OptCheckType $arg\ [OptType $item] [OptTypeArgs $item]} val]} { return -code error [OptBadValue $item $arg $val] } # consume the value OptNextArg arguments # set the value OptCurSetValue descriptions $val # go to next state if {$state eq "flagValue"} { set state flags return -code continue } else { set state next; # not used, for debug only return ; # will go on next step } } optValue { set item [OptCurDesc $descriptions] # Test the values against their required type if {![catch {OptCheckType $arg\ [OptType $item] [OptTypeArgs $item]} val]} { # right type, so : # consume the value OptNextArg arguments # set the value OptCurSetValue descriptions $val } # go to next state set state next; # not used, for debug only return ; # will go on next step } } # If we reach this point: an unknown # state as been entered ! return -code error "Bug! unknown state in DoOne \"$state\"\ (prg counter [OptGetPrgCounter $descriptions]:\ [OptCurDesc $descriptions])" } # Parse the options given the key to previously registered description # and arguments list proc ::tcl::OptKeyParse {descKey arglist} { set desc [OptKeyGetDesc $descKey] # make sure -help always give usage if {"-help" eq [string tolower $arglist]} { return -code error [OptError "Usage information:" $desc 1] } OptDoAll desc arglist if {![Lempty $arglist]} { return -code error [OptTooManyArgs $desc $arglist] } # Analyse the result # Walk through the tree: OptTreeVars $desc "#[expr {[info level]-1}]" } # determine string length for nice tabulated output proc OptTreeVars {desc level {vnamesLst {}}} { foreach item $desc { if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { set vnamesLst [OptTreeVars $item $level $vnamesLst] } else { set vname [OptVarName $item] upvar $level $vname var if {[OptHasBeenSet $item]} { # puts "adding $vname" # lets use the input name for the returned list # it is more useful, for instance you can check that # no flags at all was given with expr # {![string match "*-*" $Args]} lappend vnamesLst [OptName $item] set var [OptValue $item] } else { set var [OptDefaultValue $item] } } } return $vnamesLst } # Check the type of a value # and emit an error if arg is not of the correct type # otherwise returns the canonical value of that arg (ie 0/1 for booleans) proc ::tcl::OptCheckType {arg type {typeArgs ""}} { # puts "checking '$arg' against '$type' ($typeArgs)" # only types "any", "choice", and numbers can have leading "-" switch -exact -- $type { int { if {![string is integer -strict $arg]} { error "not an integer" } return $arg } float { return [expr {double($arg)}] } script - list { # if llength fail : malformed list if {[llength $arg]==0 && [OptIsFlag $arg]} { error "no values with leading -" } return $arg } boolean { if {![string is boolean -strict $arg]} { error "non canonic boolean" } # convert true/false because expr/if is broken with "!,... return [expr {$arg ? 1 : 0}] } choice { if {$arg ni $typeArgs} { error "invalid choice" } return $arg } any { return $arg } string - default { if {[OptIsFlag $arg]} { error "no values with leading -" } return $arg } } return neverReached } # internal utilities # returns the number of flags matching the given arg # sets the (local) prg counter to the list of matches proc OptHits {descName arg} { upvar 1 $descName desc set hits 0 set hitems {} set i 1 set larg [string tolower $arg] set len [string length $larg] set last [expr {$len-1}] foreach item [lrange $desc 1 end] { set flag [OptName $item] # lets try to match case insensitively # (string length ought to be cheap) set lflag [string tolower $flag] if {$len == [string length $lflag]} { if {$larg eq $lflag} { # Exact match case OptSetPrgCounter desc $i return 1 } } elseif {$larg eq [string range $lflag 0 $last]} { lappend hitems $i incr hits } incr i } if {$hits} { OptSetPrgCounter desc $hitems } return $hits } # Extract fields from the list structure: proc OptName {item} { lindex $item 1 } proc OptHasBeenSet {item} { Lget $item {2 0} } proc OptValue {item} { Lget $item {2 1} } proc OptIsFlag {name} { string match "-*" $name } proc OptIsOpt {name} { string match {\?*} $name } proc OptVarName {item} { set name [OptName $item] if {[OptIsFlag $name]} { return [string range $name 1 end] } elseif {[OptIsOpt $name]} { return [string trim $name "?"] } else { return $name } } proc OptType {item} { lindex $item 3 } proc OptTypeArgs {item} { lindex $item 4 } proc OptHelp {item} { lindex $item 5 } proc OptNeedValue {item} { expr {[OptType $item] ne "boolflag"} } proc OptDefaultValue {item} { set val [OptTypeArgs $item] switch -exact -- [OptType $item] { choice {return [lindex $val 0]} boolean - boolflag { # convert back false/true to 0/1 because expr !$bool # is broken.. if {$val} { return 1 } else { return 0 } } } return $val } # Description format error helper proc OptOptUsage {item {what ""}} { return -code error "invalid description format$what: $item\n\ should be a list of {varname|-flagname ?-type? ?defaultvalue?\ ?helpstring?}" } # Generate a canonical form single instruction proc OptNewInst {state varname type typeArgs help} { list $state $varname [list 0 {}] $type $typeArgs $help # ^ ^ # | | # hasBeenSet=+ +=currentValue } # Translate one item to canonical form proc OptNormalizeOne {item} { set lg [Lassign $item varname arg1 arg2 arg3] # puts "called optnormalizeone '$item' v=($varname), lg=$lg" set isflag [OptIsFlag $varname] set isopt [OptIsOpt $varname] if {$isflag} { set state "flags" } elseif {$isopt} { set state "optValue" } elseif {$varname ne "args"} { set state "value" } else { set state "args" } # apply 'smart' 'fuzzy' logic to try to make # description writer's life easy, and our's difficult : # let's guess the missing arguments :-) switch $lg { 1 { if {$isflag} { return [OptNewInst $state $varname boolflag false ""] } else { return [OptNewInst $state $varname any "" ""] } } 2 { # varname default # varname help set type [OptGuessType $arg1] if {$type eq "string"} { if {$isflag} { set type boolflag set def false } else { set type any set def "" } set help $arg1 } else { set help "" set def $arg1 } return [OptNewInst $state $varname $type $def $help] } 3 { # varname type value # varname value comment if {[regexp {^-(.+)$} $arg1 x type]} { # flags/optValue as they are optional, need a "value", # on the contrary, for a variable (non optional), # default value is pointless, 'cept for choices : if {$isflag || $isopt || ($type eq "choice")} { return [OptNewInst $state $varname $type $arg2 ""] } else { return [OptNewInst $state $varname $type "" $arg2] } } else { return [OptNewInst $state $varname\ [OptGuessType $arg1] $arg1 $arg2] } } 4 { if {[regexp {^-(.+)$} $arg1 x type]} { return [OptNewInst $state $varname $type $arg2 $arg3] } else { return -code error [OptOptUsage $item] } } default { return -code error [OptOptUsage $item] } } } # Auto magic lazy type determination proc OptGuessType {arg} { if { $arg in {true false} } { return boolean } if {[string is integer -strict $arg]} { return int } if {[string is double -strict $arg]} { return float } return string } # Error messages front ends proc OptAmbigous {desc arg} { OptError "ambigous option \"$arg\", choose from:" [OptSelection $desc] } proc OptFlagUsage {desc arg} { OptError "bad flag \"$arg\", must be one of" $desc } proc OptTooManyArgs {desc arguments} { OptError "too many arguments (unexpected argument(s): $arguments),\ usage:"\ $desc 1 } proc OptParamType {item} { if {[OptIsFlag $item]} { return "flag" } else { return "parameter" } } proc OptBadValue {item arg {err {}}} { # puts "bad val err = \"$err\"" OptError "bad value \"$arg\" for [OptParamType $item]"\ [list $item] } proc OptMissingValue {descriptions} { # set item [OptCurDescFinal $descriptions] set item [OptCurDesc $descriptions] OptError "no value given for [OptParamType $item] \"[OptName $item]\"\ (use -help for full usage) :"\ [list $item] } proc ::tcl::OptKeyError {prefix descKey {header 0}} { OptError $prefix [OptKeyGetDesc $descKey] $header } # determine string length for nice tabulated output proc OptLengths {desc nlName tlName dlName} { upvar 1 $nlName nl $tlName tl $dlName dl foreach item $desc { if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { OptLengths $item nl tl dl } else { SetMax nl [string length [OptName $item]] SetMax tl [string length [OptType $item]] set dv [OptTypeArgs $item] if {[OptState $item] ne "header"} { set dv "($dv)" } set l [string length $dv] # limit the space allocated to potentially big "choices" if {([OptType $item] ne "choice") || ($l<=12)} { SetMax dl $l } else { if {![info exists dl]} { set dl 0 } } } } } # output the tree proc OptTree {desc nl tl dl} { set res "" foreach item $desc { if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { append res [OptTree $item $nl $tl $dl] } else { set dv [OptTypeArgs $item] if {[OptState $item] ne "header"} { set dv "($dv)" } append res [string trimright [format "\n %-*s %-*s %-*s %s" \ $nl [OptName $item] $tl [OptType $item] \ $dl $dv [OptHelp $item]]] } } return $res } # Give nice usage string proc ::tcl::OptError {prefix desc {header 0}} { # determine length if {$header} { # add faked instruction set h [list [OptNewInst header Var/FlagName Type Value Help]] lappend h [OptNewInst header ------------ ---- ----- ----] lappend h [OptNewInst header {(-help} "" "" {gives this help)}] set desc [concat $h $desc] } OptLengths $desc nl tl dl # actually output return "$prefix[OptTree $desc $nl $tl $dl]" } ################ General Utility functions ####################### # # List utility functions # Naming convention: # "Lvarxxx" take the list VARiable name as argument # "Lxxxx" take the list value as argument # (which is not costly with Tcl8 objects system # as it's still a reference and not a copy of the values) # # Is that list empty ? proc ::tcl::Lempty {list} { expr {[llength $list]==0} } # Gets the value of one leaf of a lists tree proc ::tcl::Lget {list indexLst} { if {[llength $indexLst] <= 1} { return [lindex $list $indexLst] } Lget [lindex $list [lindex $indexLst 0]] [lrange $indexLst 1 end] } # Sets the value of one leaf of a lists tree # (we use the version that does not create the elements because # it would be even slower... needs to be written in C !) # (nb: there is a non trivial recursive problem with indexes 0, # which appear because there is no difference between a list # of 1 element and 1 element alone : [list "a"] == "a" while # it should be {a} and [listp a] should be 0 while [listp {a b}] would be 1 # and [listp "a b"] maybe 0. listp does not exist either...) proc ::tcl::Lvarset {listName indexLst newValue} { upvar 1 $listName list if {[llength $indexLst] <= 1} { Lvarset1nc list $indexLst $newValue } else { set idx [lindex $indexLst 0] set targetList [lindex $list $idx] # reduce refcount on targetList (not really usefull now, # could be with optimizing compiler) # Lvarset1 list $idx {} # recursively replace in targetList Lvarset targetList [lrange $indexLst 1 end] $newValue # put updated sub list back in the tree Lvarset1nc list $idx $targetList } } # Set one cell to a value, eventually create all the needed elements # (on level-1 of lists) variable emptyList {} proc ::tcl::Lvarset1 {listName index newValue} { upvar 1 $listName list if {$index < 0} {return -code error "invalid negative index"} set lg [llength $list] if {$index >= $lg} { variable emptyList for {set i $lg} {$i<$index} {incr i} { lappend list $emptyList } lappend list $newValue } else { set list [lreplace $list $index $index $newValue] } } # same as Lvarset1 but no bound checking / creation proc ::tcl::Lvarset1nc {listName index newValue} { upvar 1 $listName list set list [lreplace $list $index $index $newValue] } # Increments the value of one leaf of a lists tree # (which must exists) proc ::tcl::Lvarincr {listName indexLst {howMuch 1}} { upvar 1 $listName list if {[llength $indexLst] <= 1} { Lvarincr1 list $indexLst $howMuch } else { set idx [lindex $indexLst 0] set targetList [lindex $list $idx] # reduce refcount on targetList Lvarset1nc list $idx {} # recursively replace in targetList Lvarincr targetList [lrange $indexLst 1 end] $howMuch # put updated sub list back in the tree Lvarset1nc list $idx $targetList } } # Increments the value of one cell of a list proc ::tcl::Lvarincr1 {listName index {howMuch 1}} { upvar 1 $listName list set newValue [expr {[lindex $list $index]+$howMuch}] set list [lreplace $list $index $index $newValue] return $newValue } # Removes the first element of a list # and returns the new list value proc ::tcl::Lvarpop1 {listName} { upvar 1 $listName list set list [lrange $list 1 end] } # Same but returns the removed element # (Like the tclX version) proc ::tcl::Lvarpop {listName} { upvar 1 $listName list set el [lindex $list 0] set list [lrange $list 1 end] return $el } # Assign list elements to variables and return the length of the list proc ::tcl::Lassign {list args} { # faster than direct blown foreach (which does not byte compile) set i 0 set lg [llength $list] foreach vname $args { if {$i>=$lg} break uplevel 1 [list ::set $vname [lindex $list $i]] incr i } return $lg } # Misc utilities # Set the varname to value if value is greater than varname's current value # or if varname is undefined proc ::tcl::SetMax {varname value} { upvar 1 $varname var if {![info exists var] || $value > $var} { set var $value } } # Set the varname to value if value is smaller than varname's current value # or if varname is undefined proc ::tcl::SetMin {varname value} { upvar 1 $varname var if {![info exists var] || $value < $var} { set var $value } } # everything loaded fine, lets create the test proc: # OptCreateTestProc # Don't need the create temp proc anymore: # rename OptCreateTestProc {} } tcl9.0.3/library/msgs/0000755000175000017500000000000015104662345014171 5ustar sergeisergeitcl9.0.3/library/msgs/zh_tw.msg0000644000175000017500000000051315104661341016026 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset zh_TW BCE "民國前" ::msgcat::mcset zh_TW CE "民國" ::msgcat::mcset zh_TW DATE_FORMAT "%Y/%m/%e" ::msgcat::mcset zh_TW TIME_FORMAT_12 "%P %I:%M:%S" ::msgcat::mcset zh_TW DATE_TIME_FORMAT "%Y/%m/%e %P %I:%M:%S %z" } tcl9.0.3/library/msgs/zh_sg.msg0000644000175000017500000000050715104661341016010 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset zh_SG AM "上午" ::msgcat::mcset zh_SG PM "中午" ::msgcat::mcset zh_SG DATE_FORMAT "%d %B %Y" ::msgcat::mcset zh_SG TIME_FORMAT_12 "%P %I:%M:%S" ::msgcat::mcset zh_SG DATE_TIME_FORMAT "%d %B %Y %P %I:%M:%S %z" } tcl9.0.3/library/msgs/zh_hk.msg0000644000175000017500000000124515104661341016001 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset zh_HK DAYS_OF_WEEK_ABBREV [list \ "日"\ "一"\ "二"\ "三"\ "四"\ "五"\ "六"] ::msgcat::mcset zh_HK MONTHS_ABBREV [list \ "1月"\ "2月"\ "3月"\ "4月"\ "5月"\ "6月"\ "7月"\ "8月"\ "9月"\ "10月"\ "11月"\ "12月"\ ""] ::msgcat::mcset zh_HK DATE_FORMAT "%Y年%m月%e日" ::msgcat::mcset zh_HK TIME_FORMAT_12 "%P%I:%M:%S" ::msgcat::mcset zh_HK DATE_TIME_FORMAT "%Y年%m月%e日 %P%I:%M:%S %z" } tcl9.0.3/library/msgs/zh_cn.msg0000644000175000017500000000045715104661341016003 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset zh_CN DATE_FORMAT "%Y-%m-%e" ::msgcat::mcset zh_CN TIME_FORMAT "%k:%M:%S" ::msgcat::mcset zh_CN TIME_FORMAT_12 "%P%I时%M分%S秒" ::msgcat::mcset zh_CN DATE_TIME_FORMAT "%Y-%m-%e %k:%M:%S %z" } tcl9.0.3/library/msgs/zh.msg0000644000175000017500000000432015104661341015314 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset zh DAYS_OF_WEEK_ABBREV [list \ "星期日"\ "星期一"\ "星期二"\ "星期三"\ "星期四"\ "星期五"\ "星期六"] ::msgcat::mcset zh DAYS_OF_WEEK_FULL [list \ "星期日"\ "星期一"\ "星期二"\ "星期三"\ "星期四"\ "星期五"\ "星期六"] ::msgcat::mcset zh MONTHS_ABBREV [list \ "一月"\ "二月"\ "三月"\ "四月"\ "五月"\ "六月"\ "七月"\ "八月"\ "九月"\ "十月"\ "十一月"\ "十二月"\ ""] ::msgcat::mcset zh MONTHS_FULL [list \ "一月"\ "二月"\ "三月"\ "四月"\ "五月"\ "六月"\ "七月"\ "八月"\ "九月"\ "十月"\ "十一月"\ "十二月"\ ""] ::msgcat::mcset zh BCE "公元前" ::msgcat::mcset zh CE "公元" ::msgcat::mcset zh AM "上午" ::msgcat::mcset zh PM "下午" ::msgcat::mcset zh LOCALE_NUMERALS "〇 一 二 三 四 五 六 七 八 九 十 十一 十二 十三 十四 十五 十六 十七 十八 十九 二十 廿一 廿二 廿三 廿四 廿五 廿六 廿七 廿八 廿九 三十 卅一 卅二 卅三 卅四 卅五 卅六 卅七 卅八 卅九 四十 四十一 四十二 四十三 四十四 四十五 四十六 四十七 四十八 四十九 五十 五十一 五十二 五十三 五十四 五十五 五十六 五十七 五十八 五十九 六十 六十一 六十二 六十三 六十四 六十五 六十六 六十七 六十八 六十九 七十 七十一 七十二 七十三 七十四 七十五 七十六 七十七 七十八 七十九 八十 八十一 八十二 八十三 八十四 八十五 八十六 八十七 八十八 八十九 九十 九十一 九十二 九十三 九十四 九十五 九十六 九十七 九十八 九十九" ::msgcat::mcset zh LOCALE_DATE_FORMAT "公元%Y年%B%Od日" ::msgcat::mcset zh LOCALE_TIME_FORMAT "%OH时%OM分%OS秒" ::msgcat::mcset zh LOCALE_DATE_TIME_FORMAT "%A %Y年%B%Od日%OH时%OM分%OS秒 %z" } tcl9.0.3/library/msgs/vi.msg0000644000175000017500000000230515104661341015312 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset vi DAYS_OF_WEEK_ABBREV [list \ "Th 2"\ "Th 3"\ "Th 4"\ "Th 5"\ "Th 6"\ "Th 7"\ "CN"] ::msgcat::mcset vi DAYS_OF_WEEK_FULL [list \ "Thứ hai"\ "Thứ ba"\ "Thứ tư"\ "Thứ năm"\ "Thứ sáu"\ "Thứ bảy"\ "Chủ nhật"] ::msgcat::mcset vi MONTHS_ABBREV [list \ "Thg 1"\ "Thg 2"\ "Thg 3"\ "Thg 4"\ "Thg 5"\ "Thg 6"\ "Thg 7"\ "Thg 8"\ "Thg 9"\ "Thg 10"\ "Thg 11"\ "Thg 12"\ ""] ::msgcat::mcset vi MONTHS_FULL [list \ "Tháng một"\ "Tháng hai"\ "Tháng ba"\ "Tháng tư"\ "Tháng năm"\ "Tháng sáu"\ "Tháng bảy"\ "Tháng tám"\ "Tháng chín"\ "Tháng mười"\ "Tháng mười một"\ "Tháng mười hai"\ ""] ::msgcat::mcset vi DATE_FORMAT "%d %b %Y" ::msgcat::mcset vi TIME_FORMAT "%H:%M:%S" ::msgcat::mcset vi DATE_TIME_FORMAT "%d %b %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/uk.msg0000644000175000017500000000250515104661341015315 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset uk DAYS_OF_WEEK_ABBREV [list \ "нд"\ "пн"\ "вт"\ "ср"\ "чт"\ "пт"\ "сб"] ::msgcat::mcset uk DAYS_OF_WEEK_FULL [list \ "неділя"\ "понеділок"\ "вівторок"\ "середа"\ "четвер"\ "п'ятниця"\ "субота"] ::msgcat::mcset uk MONTHS_ABBREV [list \ "січ"\ "лют"\ "бер"\ "квіт"\ "трав"\ "черв"\ "лип"\ "серп"\ "вер"\ "жовт"\ "лист"\ "груд"\ ""] ::msgcat::mcset uk MONTHS_FULL [list \ "січня"\ "лютого"\ "березня"\ "квітня"\ "травня"\ "червня"\ "липня"\ "серпня"\ "вересня"\ "жовтня"\ "листопада"\ "грудня"\ ""] ::msgcat::mcset uk BCE "до н.е." ::msgcat::mcset uk CE "після н.е." ::msgcat::mcset uk DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset uk TIME_FORMAT "%k:%M:%S" ::msgcat::mcset uk DATE_TIME_FORMAT "%e/%m/%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/tr.msg0000644000175000017500000000207115104661341015321 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset tr DAYS_OF_WEEK_ABBREV [list \ "Paz"\ "Pzt"\ "Sal"\ "Çar"\ "Per"\ "Cum"\ "Cmt"] ::msgcat::mcset tr DAYS_OF_WEEK_FULL [list \ "Pazar"\ "Pazartesi"\ "Salı"\ "Çarşamba"\ "Perşembe"\ "Cuma"\ "Cumartesi"] ::msgcat::mcset tr MONTHS_ABBREV [list \ "Oca"\ "Şub"\ "Mar"\ "Nis"\ "May"\ "Haz"\ "Tem"\ "Ağu"\ "Eyl"\ "Eki"\ "Kas"\ "Ara"\ ""] ::msgcat::mcset tr MONTHS_FULL [list \ "Ocak"\ "Şubat"\ "Mart"\ "Nisan"\ "Mayıs"\ "Haziran"\ "Temmuz"\ "Ağustos"\ "Eylül"\ "Ekim"\ "Kasım"\ "Aralık"\ ""] ::msgcat::mcset tr DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset tr TIME_FORMAT "%H:%M:%S" ::msgcat::mcset tr DATE_TIME_FORMAT "%d.%m.%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/th.msg0000644000175000017500000000321615104661341015311 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset th DAYS_OF_WEEK_ABBREV [list \ "อา."\ "จ."\ "อ."\ "พ."\ "พฤ."\ "ศ."\ "ส."] ::msgcat::mcset th DAYS_OF_WEEK_FULL [list \ "วันอาทิตย์"\ "วันจันทร์"\ "วันอังคาร"\ "วันพุธ"\ "วันพฤหัสบดี"\ "วันศุกร์"\ "วันเสาร์"] ::msgcat::mcset th MONTHS_ABBREV [list \ "ม.ค."\ "ก.พ."\ "มี.ค."\ "เม.ย."\ "พ.ค."\ "มิ.ย."\ "ก.ค."\ "ส.ค."\ "ก.ย."\ "ต.ค."\ "พ.ย."\ "ธ.ค."\ ""] ::msgcat::mcset th MONTHS_FULL [list \ "มกราคม"\ "กุมภาพันธ์"\ "มีนาคม"\ "เมษายน"\ "พฤษภาคม"\ "มิถุนายน"\ "กรกฎาคม"\ "สิงหาคม"\ "กันยายน"\ "ตุลาคม"\ "พฤศจิกายน"\ "ธันวาคม"\ ""] ::msgcat::mcset th BCE "ลที่" ::msgcat::mcset th CE "ค.ศ." ::msgcat::mcset th AM "ก่อนเที่ยง" ::msgcat::mcset th PM "หลังเที่ยง" ::msgcat::mcset th DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset th TIME_FORMAT "%k:%M:%S" ::msgcat::mcset th DATE_TIME_FORMAT "%e/%m/%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/te_in.msg0000644000175000017500000000055315104661341015775 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset te_IN AM "పూర్వాహ్న" ::msgcat::mcset te_IN PM "అపరాహ్న" ::msgcat::mcset te_IN DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset te_IN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset te_IN DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/te.msg0000644000175000017500000000262015104661341015304 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset te DAYS_OF_WEEK_ABBREV [list \ "ఆది"\ "సోమ"\ "మంగళ"\ "బుధ"\ "గురు"\ "శుక్ర"\ "శని"] ::msgcat::mcset te DAYS_OF_WEEK_FULL [list \ "ఆదివారం"\ "సోమవారం"\ "మంగళవారం"\ "బుధవారం"\ "గురువారం"\ "శుక్రవారం"\ "శనివారం"] ::msgcat::mcset te MONTHS_ABBREV [list \ "జనవరి"\ "ఫిబ్రవరి"\ "మార్చి"\ "ఏప్రిల్"\ "మే"\ "జూన్"\ "జూలై"\ "ఆగస్టు"\ "సెప్టెంబర్"\ "అక్టోబర్"\ "నవంబర్"\ "డిసెంబర్"\ ""] ::msgcat::mcset te MONTHS_FULL [list \ "జనవరి"\ "ఫిబ్రవరి"\ "మార్చి"\ "ఏప్రిల్"\ "మే"\ "జూన్"\ "జూలై"\ "ఆగస్టు"\ "సెప్టెంబర్"\ "అక్టోబర్"\ "నవంబర్"\ "డిసెంబర్"\ ""] } tcl9.0.3/library/msgs/ta_in.msg0000644000175000017500000000037315035744304015775 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ta_IN DATE_FORMAT "%d %M %Y" ::msgcat::mcset ta_IN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset ta_IN DATE_TIME_FORMAT "%d %M %Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/ta.msg0000644000175000017500000000233115104661341015277 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ta DAYS_OF_WEEK_FULL [list \ "ஞாயிறு"\ "திங்கள்"\ "செவ்வாய்"\ "புதன்"\ "வியாழன்"\ "வெள்ளி"\ "சனி"] ::msgcat::mcset ta MONTHS_ABBREV [list \ "ஜனவரி"\ "பெப்ரவரி"\ "மார்ச்"\ "ஏப்ரல்"\ "மே"\ "ஜூன்"\ "ஜூலை"\ "ஆகஸ்ட்"\ "செப்டம்பர்"\ "அக்டோபர்"\ "நவம்பர்"\ "டிசம்பர்r"] ::msgcat::mcset ta MONTHS_FULL [list \ "ஜனவரி"\ "பெப்ரவரி"\ "மார்ச்"\ "ஏப்ரல்"\ "மே"\ "ஜூன்"\ "ஜூலை"\ "ஆகஸ்ட்"\ "செப்டம்பர்"\ "அக்டோபர்"\ "நவம்பர்"\ "டிசம்பர்r"] ::msgcat::mcset ta AM "கிமு" ::msgcat::mcset ta PM "கிபி" } tcl9.0.3/library/msgs/sw.msg0000644000175000017500000000173715035744304015341 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sw DAYS_OF_WEEK_ABBREV [list \ "Jpi"\ "Jtt"\ "Jnn"\ "Jtn"\ "Alh"\ "Iju"\ "Jmo"] ::msgcat::mcset sw DAYS_OF_WEEK_FULL [list \ "Jumapili"\ "Jumatatu"\ "Jumanne"\ "Jumatano"\ "Alhamisi"\ "Ijumaa"\ "Jumamosi"] ::msgcat::mcset sw MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mar"\ "Apr"\ "Mei"\ "Jun"\ "Jul"\ "Ago"\ "Sep"\ "Okt"\ "Nov"\ "Des"\ ""] ::msgcat::mcset sw MONTHS_FULL [list \ "Januari"\ "Februari"\ "Machi"\ "Aprili"\ "Mei"\ "Juni"\ "Julai"\ "Agosti"\ "Septemba"\ "Oktoba"\ "Novemba"\ "Desemba"\ ""] ::msgcat::mcset sw BCE "KK" ::msgcat::mcset sw CE "BK" } tcl9.0.3/library/msgs/sv.msg0000644000175000017500000000216715104661341015332 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sv DAYS_OF_WEEK_ABBREV [list \ "sö"\ "må"\ "ti"\ "on"\ "to"\ "fr"\ "lö"] ::msgcat::mcset sv DAYS_OF_WEEK_FULL [list \ "söndag"\ "måndag"\ "tisdag"\ "onsdag"\ "torsdag"\ "fredag"\ "lördag"] ::msgcat::mcset sv MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "maj"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset sv MONTHS_FULL [list \ "januari"\ "februari"\ "mars"\ "april"\ "maj"\ "juni"\ "juli"\ "augusti"\ "september"\ "oktober"\ "november"\ "december"\ ""] ::msgcat::mcset sv BCE "f.Kr." ::msgcat::mcset sv CE "e.Kr." ::msgcat::mcset sv DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset sv TIME_FORMAT "%H:%M:%S" ::msgcat::mcset sv DATE_TIME_FORMAT "%Y-%m-%d %H:%M:%S %z" } tcl9.0.3/library/msgs/sr.msg0000644000175000017500000000245315104661341015324 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sr DAYS_OF_WEEK_ABBREV [list \ "Нед"\ "Пон"\ "Уто"\ "Сре"\ "Чет"\ "Пет"\ "Суб"] ::msgcat::mcset sr DAYS_OF_WEEK_FULL [list \ "Недеља"\ "Понедељак"\ "Уторак"\ "Среда"\ "Четвртак"\ "Петак"\ "Субота"] ::msgcat::mcset sr MONTHS_ABBREV [list \ "Јан"\ "Феб"\ "Мар"\ "Апр"\ "Мај"\ "Јун"\ "Јул"\ "Авг"\ "Сеп"\ "Окт"\ "Нов"\ "Дец"\ ""] ::msgcat::mcset sr MONTHS_FULL [list \ "Јануар"\ "Фебруар"\ "Март"\ "Април"\ "Мај"\ "Јуни"\ "Јули"\ "Август"\ "Септембар"\ "Октобар"\ "Новембар"\ "Децембар"\ ""] ::msgcat::mcset sr BCE "п. н. е." ::msgcat::mcset sr CE "н. е" ::msgcat::mcset sr DATE_FORMAT "%Y.%m.%e" ::msgcat::mcset sr TIME_FORMAT "%k.%M.%S" ::msgcat::mcset sr DATE_TIME_FORMAT "%Y.%m.%e %k.%M.%S %z" } tcl9.0.3/library/msgs/sq.msg0000644000175000017500000000231315104661341015316 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sq DAYS_OF_WEEK_ABBREV [list \ "Die"\ "Hën"\ "Mar"\ "Mër"\ "Enj"\ "Pre"\ "Sht"] ::msgcat::mcset sq DAYS_OF_WEEK_FULL [list \ "e diel"\ "e hënë"\ "e martë"\ "e mërkurë"\ "e enjte"\ "e premte"\ "e shtunë"] ::msgcat::mcset sq MONTHS_ABBREV [list \ "Jan"\ "Shk"\ "Mar"\ "Pri"\ "Maj"\ "Qer"\ "Kor"\ "Gsh"\ "Sht"\ "Tet"\ "Nën"\ "Dhj"\ ""] ::msgcat::mcset sq MONTHS_FULL [list \ "janar"\ "shkurt"\ "mars"\ "prill"\ "maj"\ "qershor"\ "korrik"\ "gusht"\ "shtator"\ "tetor"\ "nëntor"\ "dhjetor"\ ""] ::msgcat::mcset sq BCE "p.e.r." ::msgcat::mcset sq CE "n.e.r." ::msgcat::mcset sq AM "PD" ::msgcat::mcset sq PM "MD" ::msgcat::mcset sq DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset sq TIME_FORMAT_12 "%l:%M:%S.%P" ::msgcat::mcset sq DATE_TIME_FORMAT "%Y-%m-%d %l:%M:%S.%P %z" } tcl9.0.3/library/msgs/sl.msg0000644000175000017500000000220015104661341015304 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sl DAYS_OF_WEEK_ABBREV [list \ "Ned"\ "Pon"\ "Tor"\ "Sre"\ "Čet"\ "Pet"\ "Sob"] ::msgcat::mcset sl DAYS_OF_WEEK_FULL [list \ "Nedelja"\ "Ponedeljek"\ "Torek"\ "Sreda"\ "Četrtek"\ "Petek"\ "Sobota"] ::msgcat::mcset sl MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "maj"\ "jun"\ "jul"\ "avg"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset sl MONTHS_FULL [list \ "januar"\ "februar"\ "marec"\ "april"\ "maj"\ "junij"\ "julij"\ "avgust"\ "september"\ "oktober"\ "november"\ "december"\ ""] ::msgcat::mcset sl BCE "pr.n.š." ::msgcat::mcset sl CE "po Kr." ::msgcat::mcset sl DATE_FORMAT "%Y.%m.%e" ::msgcat::mcset sl TIME_FORMAT "%k:%M:%S" ::msgcat::mcset sl DATE_TIME_FORMAT "%Y.%m.%e %k:%M:%S %z" } tcl9.0.3/library/msgs/sk.msg0000644000175000017500000000217715104661341015320 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sk DAYS_OF_WEEK_ABBREV [list \ "Ne"\ "Po"\ "Ut"\ "St"\ "Št"\ "Pa"\ "So"] ::msgcat::mcset sk DAYS_OF_WEEK_FULL [list \ "Nedeľe"\ "Pondelok"\ "Utorok"\ "Streda"\ "Štvrtok"\ "Piatok"\ "Sobota"] ::msgcat::mcset sk MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "máj"\ "jún"\ "júl"\ "aug"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset sk MONTHS_FULL [list \ "január"\ "február"\ "marec"\ "apríl"\ "máj"\ "jún"\ "júl"\ "august"\ "september"\ "október"\ "november"\ "december"\ ""] ::msgcat::mcset sk BCE "pred n.l." ::msgcat::mcset sk CE "n.l." ::msgcat::mcset sk DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset sk TIME_FORMAT "%k:%M:%S" ::msgcat::mcset sk DATE_TIME_FORMAT "%e.%m.%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/sh.msg0000644000175000017500000000220015104661341015300 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset sh DAYS_OF_WEEK_ABBREV [list \ "Ned"\ "Pon"\ "Uto"\ "Sre"\ "Čet"\ "Pet"\ "Sub"] ::msgcat::mcset sh DAYS_OF_WEEK_FULL [list \ "Nedelja"\ "Ponedeljak"\ "Utorak"\ "Sreda"\ "Četvrtak"\ "Petak"\ "Subota"] ::msgcat::mcset sh MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mar"\ "Apr"\ "Maj"\ "Jun"\ "Jul"\ "Avg"\ "Sep"\ "Okt"\ "Nov"\ "Dec"\ ""] ::msgcat::mcset sh MONTHS_FULL [list \ "Januar"\ "Februar"\ "Mart"\ "April"\ "Maj"\ "Juni"\ "Juli"\ "Avgust"\ "Septembar"\ "Oktobar"\ "Novembar"\ "Decembar"\ ""] ::msgcat::mcset sh BCE "p. n. e." ::msgcat::mcset sh CE "n. e." ::msgcat::mcset sh DATE_FORMAT "%d.%m.%Y." ::msgcat::mcset sh TIME_FORMAT "%k.%M.%S" ::msgcat::mcset sh DATE_TIME_FORMAT "%d.%m.%Y. %k.%M.%S %z" } tcl9.0.3/library/msgs/ru_ua.msg0000644000175000017500000000036215035744304016014 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ru_UA DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset ru_UA TIME_FORMAT "%k:%M:%S" ::msgcat::mcset ru_UA DATE_TIME_FORMAT "%d.%m.%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/ru.msg0000644000175000017500000000245315104661341015326 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ru DAYS_OF_WEEK_ABBREV [list \ "Вс"\ "Пн"\ "Вт"\ "Ср"\ "Чт"\ "Пт"\ "Сб"] ::msgcat::mcset ru DAYS_OF_WEEK_FULL [list \ "воскресенье"\ "понедельник"\ "вторник"\ "среда"\ "четверг"\ "пятница"\ "суббота"] ::msgcat::mcset ru MONTHS_ABBREV [list \ "янв"\ "фев"\ "мар"\ "апр"\ "май"\ "июн"\ "июл"\ "авг"\ "сен"\ "окт"\ "ноя"\ "дек"\ ""] ::msgcat::mcset ru MONTHS_FULL [list \ "Январь"\ "Февраль"\ "Март"\ "Апрель"\ "Май"\ "Июнь"\ "Июль"\ "Август"\ "Сентябрь"\ "Октябрь"\ "Ноябрь"\ "Декабрь"\ ""] ::msgcat::mcset ru BCE "до н.э." ::msgcat::mcset ru CE "н.э." ::msgcat::mcset ru DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset ru TIME_FORMAT "%k:%M:%S" ::msgcat::mcset ru DATE_TIME_FORMAT "%d.%m.%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/ro.msg0000644000175000017500000000217415104661341015320 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ro DAYS_OF_WEEK_ABBREV [list \ "D"\ "L"\ "Ma"\ "Mi"\ "J"\ "V"\ "S"] ::msgcat::mcset ro DAYS_OF_WEEK_FULL [list \ "duminică"\ "luni"\ "marţi"\ "miercuri"\ "joi"\ "vineri"\ "sîmbătă"] ::msgcat::mcset ro MONTHS_ABBREV [list \ "Ian"\ "Feb"\ "Mar"\ "Apr"\ "Mai"\ "Iun"\ "Iul"\ "Aug"\ "Sep"\ "Oct"\ "Nov"\ "Dec"\ ""] ::msgcat::mcset ro MONTHS_FULL [list \ "ianuarie"\ "februarie"\ "martie"\ "aprilie"\ "mai"\ "iunie"\ "iulie"\ "august"\ "septembrie"\ "octombrie"\ "noiembrie"\ "decembrie"\ ""] ::msgcat::mcset ro BCE "d.C." ::msgcat::mcset ro CE "î.d.C." ::msgcat::mcset ro DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset ro TIME_FORMAT "%H:%M:%S" ::msgcat::mcset ro DATE_TIME_FORMAT "%d.%m.%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/pt_br.msg0000644000175000017500000000042715035744304016011 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset pt_BR DATE_FORMAT "%d-%m-%Y" ::msgcat::mcset pt_BR TIME_FORMAT "%T" ::msgcat::mcset pt_BR TIME_FORMAT_12 "%T" ::msgcat::mcset pt_BR DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/pt.msg0000644000175000017500000000212715104661341015321 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset pt DAYS_OF_WEEK_ABBREV [list \ "Dom"\ "Seg"\ "Ter"\ "Qua"\ "Qui"\ "Sex"\ "Sáb"] ::msgcat::mcset pt DAYS_OF_WEEK_FULL [list \ "Domingo"\ "Segunda-feira"\ "Terça-feira"\ "Quarta-feira"\ "Quinta-feira"\ "Sexta-feira"\ "Sábado"] ::msgcat::mcset pt MONTHS_ABBREV [list \ "Jan"\ "Fev"\ "Mar"\ "Abr"\ "Mai"\ "Jun"\ "Jul"\ "Ago"\ "Set"\ "Out"\ "Nov"\ "Dez"\ ""] ::msgcat::mcset pt MONTHS_FULL [list \ "Janeiro"\ "Fevereiro"\ "Março"\ "Abril"\ "Maio"\ "Junho"\ "Julho"\ "Agosto"\ "Setembro"\ "Outubro"\ "Novembro"\ "Dezembro"\ ""] ::msgcat::mcset pt DATE_FORMAT "%d-%m-%Y" ::msgcat::mcset pt TIME_FORMAT "%k:%M:%S" ::msgcat::mcset pt DATE_TIME_FORMAT "%d-%m-%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/pl.msg0000644000175000017500000000221715104661341015311 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset pl DAYS_OF_WEEK_ABBREV [list \ "N"\ "Pn"\ "Wt"\ "Śr"\ "Cz"\ "Pt"\ "So"] ::msgcat::mcset pl DAYS_OF_WEEK_FULL [list \ "niedziela"\ "poniedziałek"\ "wtorek"\ "środa"\ "czwartek"\ "piątek"\ "sobota"] ::msgcat::mcset pl MONTHS_ABBREV [list \ "sty"\ "lut"\ "mar"\ "kwi"\ "maj"\ "cze"\ "lip"\ "sie"\ "wrz"\ "paź"\ "lis"\ "gru"\ ""] ::msgcat::mcset pl MONTHS_FULL [list \ "styczeń"\ "luty"\ "marzec"\ "kwiecień"\ "maj"\ "czerwiec"\ "lipiec"\ "sierpień"\ "wrzesień"\ "październik"\ "listopad"\ "grudzień"\ ""] ::msgcat::mcset pl BCE "p.n.e." ::msgcat::mcset pl CE "n.e." ::msgcat::mcset pl DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset pl TIME_FORMAT "%H:%M:%S" ::msgcat::mcset pl DATE_TIME_FORMAT "%Y-%m-%d %H:%M:%S %z" } tcl9.0.3/library/msgs/nn.msg0000644000175000017500000000216415104661341015312 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset nn DAYS_OF_WEEK_ABBREV [list \ "su"\ "må"\ "ty"\ "on"\ "to"\ "fr"\ "lau"] ::msgcat::mcset nn DAYS_OF_WEEK_FULL [list \ "sundag"\ "måndag"\ "tysdag"\ "onsdag"\ "torsdag"\ "fredag"\ "laurdag"] ::msgcat::mcset nn MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "mai"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "des"\ ""] ::msgcat::mcset nn MONTHS_FULL [list \ "januar"\ "februar"\ "mars"\ "april"\ "mai"\ "juni"\ "juli"\ "august"\ "september"\ "oktober"\ "november"\ "desember"\ ""] ::msgcat::mcset nn BCE "f.Kr." ::msgcat::mcset nn CE "e.Kr." ::msgcat::mcset nn DATE_FORMAT "%e. %B %Y" ::msgcat::mcset nn TIME_FORMAT "%H:%M:%S" ::msgcat::mcset nn DATE_TIME_FORMAT "%e. %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/nl_be.msg0000644000175000017500000000042715035744304015762 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset nl_BE DATE_FORMAT "%d-%m-%y" ::msgcat::mcset nl_BE TIME_FORMAT "%T" ::msgcat::mcset nl_BE TIME_FORMAT_12 "%T" ::msgcat::mcset nl_BE DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/nl.msg0000644000175000017500000000206715035744304015316 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset nl DAYS_OF_WEEK_ABBREV [list \ "zo"\ "ma"\ "di"\ "wo"\ "do"\ "vr"\ "za"] ::msgcat::mcset nl DAYS_OF_WEEK_FULL [list \ "zondag"\ "maandag"\ "dinsdag"\ "woensdag"\ "donderdag"\ "vrijdag"\ "zaterdag"] ::msgcat::mcset nl MONTHS_ABBREV [list \ "jan"\ "feb"\ "mrt"\ "apr"\ "mei"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset nl MONTHS_FULL [list \ "januari"\ "februari"\ "maart"\ "april"\ "mei"\ "juni"\ "juli"\ "augustus"\ "september"\ "oktober"\ "november"\ "december"\ ""] ::msgcat::mcset nl DATE_FORMAT "%e %B %Y" ::msgcat::mcset nl TIME_FORMAT "%k:%M:%S" ::msgcat::mcset nl DATE_TIME_FORMAT "%e %B %Y %k:%M:%S %z" } tcl9.0.3/library/msgs/nb.msg0000644000175000017500000000216515104661341015277 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset nb DAYS_OF_WEEK_ABBREV [list \ "sø"\ "ma"\ "ti"\ "on"\ "to"\ "fr"\ "lø"] ::msgcat::mcset nb DAYS_OF_WEEK_FULL [list \ "søndag"\ "mandag"\ "tirsdag"\ "onsdag"\ "torsdag"\ "fredag"\ "lørdag"] ::msgcat::mcset nb MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "mai"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "des"\ ""] ::msgcat::mcset nb MONTHS_FULL [list \ "januar"\ "februar"\ "mars"\ "april"\ "mai"\ "juni"\ "juli"\ "august"\ "september"\ "oktober"\ "november"\ "desember"\ ""] ::msgcat::mcset nb BCE "f.Kr." ::msgcat::mcset nb CE "e.Kr." ::msgcat::mcset nb DATE_FORMAT "%e. %B %Y" ::msgcat::mcset nb TIME_FORMAT "%H:%M:%S" ::msgcat::mcset nb DATE_TIME_FORMAT "%e. %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/mt.msg0000644000175000017500000000124215104661341015313 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset mt DAYS_OF_WEEK_ABBREV [list \ "Ħad"\ "Tne"\ "Tli"\ "Erb"\ "Ħam"\ "Ġim"] ::msgcat::mcset mt MONTHS_ABBREV [list \ "Jan"\ "Fra"\ "Mar"\ "Apr"\ "Mej"\ "Ġun"\ "Lul"\ "Awi"\ "Set"\ "Ott"\ "Nov"] ::msgcat::mcset mt BCE "QK" ::msgcat::mcset mt CE "" ::msgcat::mcset mt DATE_FORMAT "%A, %e ta %B, %Y" ::msgcat::mcset mt TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset mt DATE_TIME_FORMAT "%A, %e ta %B, %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/ms_my.msg0000644000175000017500000000040315035744304016021 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ms_MY DATE_FORMAT "%A %d %b %Y" ::msgcat::mcset ms_MY TIME_FORMAT_12 "%I:%M:%S %z" ::msgcat::mcset ms_MY DATE_TIME_FORMAT "%A %d %b %Y %I:%M:%S %z %z" } tcl9.0.3/library/msgs/ms.msg0000644000175000017500000000161615035744304015323 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ms DAYS_OF_WEEK_ABBREV [list \ "Aha"\ "Isn"\ "Sei"\ "Rab"\ "Kha"\ "Jum"\ "Sab"] ::msgcat::mcset ms DAYS_OF_WEEK_FULL [list \ "Ahad"\ "Isnin"\ "Selasa"\ "Rahu"\ "Khamis"\ "Jumaat"\ "Sabtu"] ::msgcat::mcset ms MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mac"\ "Apr"\ "Mei"\ "Jun"\ "Jul"\ "Ogos"\ "Sep"\ "Okt"\ "Nov"\ "Dis"\ ""] ::msgcat::mcset ms MONTHS_FULL [list \ "Januari"\ "Februari"\ "Mac"\ "April"\ "Mei"\ "Jun"\ "Julai"\ "Ogos"\ "September"\ "Oktober"\ "November"\ "Disember"\ ""] } tcl9.0.3/library/msgs/mr_in.msg0000644000175000017500000000037315035744304016007 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset mr_IN DATE_FORMAT "%d %M %Y" ::msgcat::mcset mr_IN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset mr_IN DATE_TIME_FORMAT "%d %M %Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/mr.msg0000644000175000017500000000231415104661341015312 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset mr DAYS_OF_WEEK_FULL [list \ "रविवार"\ "सोमवार"\ "मंगळवार"\ "मंगळवार"\ "गुरुवार"\ "शुक्रवार"\ "शनिवार"] ::msgcat::mcset mr MONTHS_ABBREV [list \ "जानेवारी"\ "फेबृवारी"\ "मार्च"\ "एप्रिल"\ "मे"\ "जून"\ "जुलै"\ "ओगस्ट"\ "सेप्टेंबर"\ "ओक्टोबर"\ "नोव्हेंबर"\ "डिसेंबर"] ::msgcat::mcset mr MONTHS_FULL [list \ "जानेवारी"\ "फेबृवारी"\ "मार्च"\ "एप्रिल"\ "मे"\ "जून"\ "जुलै"\ "ओगस्ट"\ "सेप्टेंबर"\ "ओक्टोबर"\ "नोव्हेंबर"\ "डिसेंबर"] ::msgcat::mcset mr AM "BC" ::msgcat::mcset mr PM "AD" } tcl9.0.3/library/msgs/mk.msg0000644000175000017500000000252115104661341015303 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset mk DAYS_OF_WEEK_ABBREV [list \ "нед."\ "пон."\ "вт."\ "сре."\ "чет."\ "пет."\ "саб."] ::msgcat::mcset mk DAYS_OF_WEEK_FULL [list \ "недела"\ "понеделник"\ "вторник"\ "среда"\ "четврток"\ "петок"\ "сабота"] ::msgcat::mcset mk MONTHS_ABBREV [list \ "јан."\ "фев."\ "мар."\ "апр."\ "мај."\ "јун."\ "јул."\ "авг."\ "септ."\ "окт."\ "ноем."\ "декем."\ ""] ::msgcat::mcset mk MONTHS_FULL [list \ "јануари"\ "февруари"\ "март"\ "април"\ "мај"\ "јуни"\ "јули"\ "август"\ "септември"\ "октомври"\ "ноември"\ "декември"\ ""] ::msgcat::mcset mk BCE "пр.н.е." ::msgcat::mcset mk CE "ае." ::msgcat::mcset mk DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset mk TIME_FORMAT "%H:%M:%S %z" ::msgcat::mcset mk DATE_TIME_FORMAT "%e.%m.%Y %H:%M:%S %z %z" } tcl9.0.3/library/msgs/lv.msg0000644000175000017500000000222715104661341015320 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset lv DAYS_OF_WEEK_ABBREV [list \ "Sv"\ "P"\ "O"\ "T"\ "C"\ "Pk"\ "S"] ::msgcat::mcset lv DAYS_OF_WEEK_FULL [list \ "svētdiena"\ "pirmdiena"\ "otrdiena"\ "trešdiena"\ "ceturdien"\ "piektdiena"\ "sestdiena"] ::msgcat::mcset lv MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mar"\ "Apr"\ "Maijs"\ "Jūn"\ "Jūl"\ "Aug"\ "Sep"\ "Okt"\ "Nov"\ "Dec"\ ""] ::msgcat::mcset lv MONTHS_FULL [list \ "janvāris"\ "februāris"\ "marts"\ "aprīlis"\ "maijs"\ "jūnijs"\ "jūlijs"\ "augusts"\ "septembris"\ "oktobris"\ "novembris"\ "decembris"\ ""] ::msgcat::mcset lv BCE "pmē" ::msgcat::mcset lv CE "mē" ::msgcat::mcset lv DATE_FORMAT "%Y.%e.%m" ::msgcat::mcset lv TIME_FORMAT "%H:%M:%S" ::msgcat::mcset lv DATE_TIME_FORMAT "%Y.%e.%m %H:%M:%S %z" } tcl9.0.3/library/msgs/lt.msg0000644000175000017500000000226315104661341015316 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset lt DAYS_OF_WEEK_ABBREV [list \ "Sk"\ "Pr"\ "An"\ "Tr"\ "Kt"\ "Pn"\ "Št"] ::msgcat::mcset lt DAYS_OF_WEEK_FULL [list \ "Sekmadienis"\ "Pirmadienis"\ "Antradienis"\ "Trečiadienis"\ "Ketvirtadienis"\ "Penktadienis"\ "Šeštadienis"] ::msgcat::mcset lt MONTHS_ABBREV [list \ "Sau"\ "Vas"\ "Kov"\ "Bal"\ "Geg"\ "Bir"\ "Lie"\ "Rgp"\ "Rgs"\ "Spa"\ "Lap"\ "Grd"\ ""] ::msgcat::mcset lt MONTHS_FULL [list \ "Sausio"\ "Vasario"\ "Kovo"\ "Balandžio"\ "Gegužės"\ "Birželio"\ "Liepos"\ "Rugpjūčio"\ "Rugsėjo"\ "Spalio"\ "Lapkričio"\ "Gruodžio"\ ""] ::msgcat::mcset lt BCE "pr.Kr." ::msgcat::mcset lt CE "po.Kr." ::msgcat::mcset lt DATE_FORMAT "%Y.%m.%e" ::msgcat::mcset lt TIME_FORMAT "%H.%M.%S" ::msgcat::mcset lt DATE_TIME_FORMAT "%Y.%m.%e %H.%M.%S %z" } tcl9.0.3/library/msgs/kw_gb.msg0000644000175000017500000000037315035744304015774 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kw_GB DATE_FORMAT "%d %B %Y" ::msgcat::mcset kw_GB TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset kw_GB DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/kw.msg0000644000175000017500000000170615035744304015325 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kw DAYS_OF_WEEK_ABBREV [list \ "Sul"\ "Lun"\ "Mth"\ "Mhr"\ "Yow"\ "Gwe"\ "Sad"] ::msgcat::mcset kw DAYS_OF_WEEK_FULL [list \ "De Sul"\ "De Lun"\ "De Merth"\ "De Merher"\ "De Yow"\ "De Gwener"\ "De Sadorn"] ::msgcat::mcset kw MONTHS_ABBREV [list \ "Gen"\ "Whe"\ "Mer"\ "Ebr"\ "Me"\ "Evn"\ "Gor"\ "Est"\ "Gwn"\ "Hed"\ "Du"\ "Kev"\ ""] ::msgcat::mcset kw MONTHS_FULL [list \ "Mys Genver"\ "Mys Whevrel"\ "Mys Merth"\ "Mys Ebrel"\ "Mys Me"\ "Mys Evan"\ "Mys Gortheren"\ "Mye Est"\ "Mys Gwyngala"\ "Mys Hedra"\ "Mys Du"\ "Mys Kevardhu"\ ""] } tcl9.0.3/library/msgs/ko_kr.msg0000644000175000017500000000051315104661341016000 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ko_KR BCE "기원전" ::msgcat::mcset ko_KR CE "서기" ::msgcat::mcset ko_KR DATE_FORMAT "%Y.%m.%d" ::msgcat::mcset ko_KR TIME_FORMAT_12 "%P %l:%M:%S" ::msgcat::mcset ko_KR DATE_TIME_FORMAT "%Y.%m.%d %P %l:%M:%S %z" } tcl9.0.3/library/msgs/kok_in.msg0000644000175000017500000000037615035744304016160 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kok_IN DATE_FORMAT "%d %M %Y" ::msgcat::mcset kok_IN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset kok_IN DATE_TIME_FORMAT "%d %M %Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/kok.msg0000644000175000017500000000243015104661341015457 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kok DAYS_OF_WEEK_FULL [list \ "आदित्यवार"\ "सोमवार"\ "मंगळार"\ "बुधवार"\ "गुरुवार"\ "शुक्रवार"\ "शनिवार"] ::msgcat::mcset kok MONTHS_ABBREV [list \ "जानेवारी"\ "फेबृवारी"\ "मार्च"\ "एप्रिल"\ "मे"\ "जून"\ "जुलै"\ "ओगस्ट"\ "सेप्टेंबर"\ "ओक्टोबर"\ "नोव्हेंबर"\ "डिसेंबर"] ::msgcat::mcset kok MONTHS_FULL [list \ "जानेवारी"\ "फेब्रुवारी"\ "मार्च"\ "एप्रिल"\ "मे"\ "जून"\ "जुलै"\ "ओगस्ट"\ "सेप्टेंबर"\ "ओक्टोबर"\ "नोव्हेंबर"\ "डिसेंबर"] ::msgcat::mcset kok AM "क्रिस्तपूर्व" ::msgcat::mcset kok PM "क्रिस्तशखा" } tcl9.0.3/library/msgs/ko.msg0000644000175000017500000000253015104661341015305 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ko DAYS_OF_WEEK_ABBREV [list \ "일"\ "월"\ "화"\ "수"\ "목"\ "금"\ "토"] ::msgcat::mcset ko DAYS_OF_WEEK_FULL [list \ "일요일"\ "월요일"\ "화요일"\ "수요일"\ "목요일"\ "금요일"\ "토요일"] ::msgcat::mcset ko MONTHS_ABBREV [list \ "1월"\ "2월"\ "3월"\ "4월"\ "5월"\ "6월"\ "7월"\ "8월"\ "9월"\ "10월"\ "11월"\ "12월"\ ""] ::msgcat::mcset ko MONTHS_FULL [list \ "1월"\ "2월"\ "3월"\ "4월"\ "5월"\ "6월"\ "7월"\ "8월"\ "9월"\ "10월"\ "11월"\ "12월"\ ""] ::msgcat::mcset ko AM "오전" ::msgcat::mcset ko PM "오후" ::msgcat::mcset ko DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset ko TIME_FORMAT_12 "%P %l:%M:%S" ::msgcat::mcset ko DATE_TIME_FORMAT "%Y-%m-%d %P %l:%M:%S %z" ::msgcat::mcset ko LOCALE_DATE_FORMAT "%Y년%B%Od일" ::msgcat::mcset ko LOCALE_TIME_FORMAT "%H시%M분%S초" ::msgcat::mcset ko LOCALE_DATE_TIME_FORMAT "%A %Y년%B%Od일%H시%M분%S초 %z" } tcl9.0.3/library/msgs/kl_gl.msg0000644000175000017500000000042715035744304015773 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kl_GL DATE_FORMAT "%d %b %Y" ::msgcat::mcset kl_GL TIME_FORMAT "%T" ::msgcat::mcset kl_GL TIME_FORMAT_12 "%T" ::msgcat::mcset kl_GL DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/kl.msg0000644000175000017500000000172215035744304015310 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset kl DAYS_OF_WEEK_ABBREV [list \ "sab"\ "ata"\ "mar"\ "pin"\ "sis"\ "tal"\ "arf"] ::msgcat::mcset kl DAYS_OF_WEEK_FULL [list \ "sabaat"\ "ataasinngorneq"\ "marlunngorneq"\ "pingasunngorneq"\ "sisamanngorneq"\ "tallimanngorneq"\ "arfininngorneq"] ::msgcat::mcset kl MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "maj"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset kl MONTHS_FULL [list \ "januari"\ "februari"\ "martsi"\ "aprili"\ "maji"\ "juni"\ "juli"\ "augustusi"\ "septemberi"\ "oktoberi"\ "novemberi"\ "decemberi"\ ""] } tcl9.0.3/library/msgs/ja.msg0000644000175000017500000000262215104661341015270 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ja DAYS_OF_WEEK_ABBREV [list \ "日"\ "月"\ "火"\ "水"\ "木"\ "金"\ "土"] ::msgcat::mcset ja DAYS_OF_WEEK_FULL [list \ "日曜日"\ "月曜日"\ "火曜日"\ "水曜日"\ "木曜日"\ "金曜日"\ "土曜日"] ::msgcat::mcset ja MONTHS_FULL [list \ "1月"\ "2月"\ "3月"\ "4月"\ "5月"\ "6月"\ "7月"\ "8月"\ "9月"\ "10月"\ "11月"\ "12月"] ::msgcat::mcset ja BCE "紀元前" ::msgcat::mcset ja CE "西暦" ::msgcat::mcset ja AM "午前" ::msgcat::mcset ja PM "午後" ::msgcat::mcset ja DATE_FORMAT "%Y/%m/%d" ::msgcat::mcset ja TIME_FORMAT "%k:%M:%S" ::msgcat::mcset ja TIME_FORMAT_12 "%P %I:%M:%S" ::msgcat::mcset ja DATE_TIME_FORMAT "%Y/%m/%d %k:%M:%S %z" ::msgcat::mcset ja LOCALE_DATE_FORMAT "%EY年%m月%d日" ::msgcat::mcset ja LOCALE_TIME_FORMAT "%H時%M分%S秒" ::msgcat::mcset ja LOCALE_DATE_TIME_FORMAT "%EY年%m月%d日 (%a) %H時%M分%S秒 %z" ::msgcat::mcset ja LOCALE_ERAS "{-9223372036854775808 西暦 0} {-3061011600 明治 1867} {-1812186000 大正 1911} {-1357635600 昭和 1925} {600220800 平成 1988} {1556668800 令和 2018}" } tcl9.0.3/library/msgs/it_ch.msg0000644000175000017500000000036415035744304015771 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset it_CH DATE_FORMAT "%e. %B %Y" ::msgcat::mcset it_CH TIME_FORMAT "%H:%M:%S" ::msgcat::mcset it_CH DATE_TIME_FORMAT "%e. %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/it.msg0000644000175000017500000000230415104661341015307 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset it DAYS_OF_WEEK_ABBREV [list \ "dom"\ "lun"\ "mar"\ "mer"\ "gio"\ "ven"\ "sab"] ::msgcat::mcset it DAYS_OF_WEEK_FULL [list \ "domenica"\ "lunedì"\ "martedì"\ "mercoledì"\ "giovedì"\ "venerdì"\ "sabato"] ::msgcat::mcset it MONTHS_ABBREV [list \ "gen"\ "feb"\ "mar"\ "apr"\ "mag"\ "giu"\ "lug"\ "ago"\ "set"\ "ott"\ "nov"\ "dic"\ ""] ::msgcat::mcset it MONTHS_FULL [list \ "gennaio"\ "febbraio"\ "marzo"\ "aprile"\ "maggio"\ "giugno"\ "luglio"\ "agosto"\ "settembre"\ "ottobre"\ "novembre"\ "dicembre"\ ""] ::msgcat::mcset it BCE "aC" ::msgcat::mcset it CE "dC" ::msgcat::mcset it AM "m." ::msgcat::mcset it PM "p." ::msgcat::mcset it DATE_FORMAT "%d %B %Y" ::msgcat::mcset it TIME_FORMAT "%H:%M:%S" ::msgcat::mcset it DATE_TIME_FORMAT "%d %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/is.msg0000644000175000017500000000217315104661341015312 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset is DAYS_OF_WEEK_ABBREV [list \ "sun."\ "mán."\ "þri."\ "mið."\ "fim."\ "fös."\ "lau."] ::msgcat::mcset is DAYS_OF_WEEK_FULL [list \ "sunnudagur"\ "mánudagur"\ "þriðjudagur"\ "miðvikudagur"\ "fimmtudagur"\ "föstudagur"\ "laugardagur"] ::msgcat::mcset is MONTHS_ABBREV [list \ "jan."\ "feb."\ "mar."\ "apr."\ "maí"\ "jún."\ "júl."\ "ágú."\ "sep."\ "okt."\ "nóv."\ "des."\ ""] ::msgcat::mcset is MONTHS_FULL [list \ "janúar"\ "febrúar"\ "mars"\ "apríl"\ "maí"\ "júní"\ "júlí"\ "ágúst"\ "september"\ "október"\ "nóvember"\ "desember"\ ""] ::msgcat::mcset is DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset is TIME_FORMAT "%H:%M:%S" ::msgcat::mcset is DATE_TIME_FORMAT "%e.%m.%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/id_id.msg0000644000175000017500000000037315035744304015753 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset id_ID DATE_FORMAT "%d %B %Y" ::msgcat::mcset id_ID TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset id_ID DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/id.msg0000644000175000017500000000162215035744304015275 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset id DAYS_OF_WEEK_ABBREV [list \ "Min"\ "Sen"\ "Sel"\ "Rab"\ "Kam"\ "Jum"\ "Sab"] ::msgcat::mcset id DAYS_OF_WEEK_FULL [list \ "Minggu"\ "Senin"\ "Selasa"\ "Rabu"\ "Kamis"\ "Jumat"\ "Sabtu"] ::msgcat::mcset id MONTHS_ABBREV [list \ "Jan"\ "Peb"\ "Mar"\ "Apr"\ "Mei"\ "Jun"\ "Jul"\ "Agu"\ "Sep"\ "Okt"\ "Nov"\ "Des"\ ""] ::msgcat::mcset id MONTHS_FULL [list \ "Januari"\ "Pebruari"\ "Maret"\ "April"\ "Mei"\ "Juni"\ "Juli"\ "Agustus"\ "September"\ "Oktober"\ "November"\ "Desember"\ ""] } tcl9.0.3/library/msgs/hu.msg0000644000175000017500000000233715104661341015315 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset hu DAYS_OF_WEEK_ABBREV [list \ "V"\ "H"\ "K"\ "Sze"\ "Cs"\ "P"\ "Szo"] ::msgcat::mcset hu DAYS_OF_WEEK_FULL [list \ "vasárnap"\ "hétfő"\ "kedd"\ "szerda"\ "csütörtök"\ "péntek"\ "szombat"] ::msgcat::mcset hu MONTHS_ABBREV [list \ "jan."\ "febr."\ "márc."\ "ápr."\ "máj."\ "jún."\ "júl."\ "aug."\ "szept."\ "okt."\ "nov."\ "dec."\ ""] ::msgcat::mcset hu MONTHS_FULL [list \ "január"\ "február"\ "március"\ "április"\ "május"\ "június"\ "július"\ "augusztus"\ "szeptember"\ "október"\ "november"\ "december"\ ""] ::msgcat::mcset hu BCE "i.e." ::msgcat::mcset hu CE "i.u." ::msgcat::mcset hu AM "DE" ::msgcat::mcset hu PM "DU" ::msgcat::mcset hu DATE_FORMAT "%Y.%m.%d." ::msgcat::mcset hu TIME_FORMAT "%k:%M:%S" ::msgcat::mcset hu DATE_TIME_FORMAT "%Y.%m.%d. %k:%M:%S %z" } tcl9.0.3/library/msgs/hr.msg0000644000175000017500000000211115104661341015300 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset hr DAYS_OF_WEEK_ABBREV [list \ "ned"\ "pon"\ "uto"\ "sri"\ "čet"\ "pet"\ "sub"] ::msgcat::mcset hr DAYS_OF_WEEK_FULL [list \ "nedjelja"\ "ponedjeljak"\ "utorak"\ "srijeda"\ "četvrtak"\ "petak"\ "subota"] ::msgcat::mcset hr MONTHS_ABBREV [list \ "sij"\ "vel"\ "ožu"\ "tra"\ "svi"\ "lip"\ "srp"\ "kol"\ "ruj"\ "lis"\ "stu"\ "pro"\ ""] ::msgcat::mcset hr MONTHS_FULL [list \ "siječanj"\ "veljača"\ "ožujak"\ "travanj"\ "svibanj"\ "lipanj"\ "srpanj"\ "kolovoz"\ "rujan"\ "listopad"\ "studeni"\ "prosinac"\ ""] ::msgcat::mcset hr DATE_FORMAT "%Y.%m.%d" ::msgcat::mcset hr TIME_FORMAT "%H:%M:%S" ::msgcat::mcset hr DATE_TIME_FORMAT "%Y.%m.%d %H:%M:%S %z" } tcl9.0.3/library/msgs/hi_in.msg0000644000175000017500000000037315035744304015771 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset hi_IN DATE_FORMAT "%d %M %Y" ::msgcat::mcset hi_IN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset hi_IN DATE_TIME_FORMAT "%d %M %Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/hi.msg0000644000175000017500000000225015104661341015273 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset hi DAYS_OF_WEEK_FULL [list \ "रविवार"\ "सोमवार"\ "मंगलवार"\ "बुधवार"\ "गुरुवार"\ "शुक्रवार"\ "शनिवार"] ::msgcat::mcset hi MONTHS_ABBREV [list \ "जनवरी"\ "फ़रवरी"\ "मार्च"\ "अप्रेल"\ "मई"\ "जून"\ "जुलाई"\ "अगस्त"\ "सितम्बर"\ "अक्टूबर"\ "नवम्बर"\ "दिसम्बर"] ::msgcat::mcset hi MONTHS_FULL [list \ "जनवरी"\ "फ़रवरी"\ "मार्च"\ "अप्रेल"\ "मई"\ "जून"\ "जुलाई"\ "अगस्त"\ "सितम्बर"\ "अक्टूबर"\ "नवम्बर"\ "दिसम्बर"] ::msgcat::mcset hi AM "ईसापूर्व" ::msgcat::mcset hi PM "." } tcl9.0.3/library/msgs/he.msg0000644000175000017500000000241015104661341015265 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset he DAYS_OF_WEEK_ABBREV [list \ "א"\ "ב"\ "ג"\ "ד"\ "ה"\ "ו"\ "ש"] ::msgcat::mcset he DAYS_OF_WEEK_FULL [list \ "יום ראשון"\ "יום שני"\ "יום שלישי"\ "יום רביעי"\ "יום חמישי"\ "יום שישי"\ "שבת"] ::msgcat::mcset he MONTHS_ABBREV [list \ "ינו"\ "פבר"\ "מרץ"\ "אפר"\ "מאי"\ "יונ"\ "יול"\ "אוג"\ "ספט"\ "אוק"\ "נוב"\ "דצמ"\ ""] ::msgcat::mcset he MONTHS_FULL [list \ "ינואר"\ "פברואר"\ "מרץ"\ "אפריל"\ "מאי"\ "יוני"\ "יולי"\ "אוגוסט"\ "ספטמבר"\ "אוקטובר"\ "נובמבר"\ "דצמבר"\ ""] ::msgcat::mcset he BCE "לסה"נ" ::msgcat::mcset he CE "לפסה"נ" ::msgcat::mcset he DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset he TIME_FORMAT "%H:%M:%S" ::msgcat::mcset he DATE_TIME_FORMAT "%d/%m/%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/gv_gb.msg0000644000175000017500000000037315035744304015767 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset gv_GB DATE_FORMAT "%d %B %Y" ::msgcat::mcset gv_GB TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset gv_GB DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/gv.msg0000644000175000017500000000201515035744304015312 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset gv DAYS_OF_WEEK_ABBREV [list \ "Jed"\ "Jel"\ "Jem"\ "Jerc"\ "Jerd"\ "Jeh"\ "Jes"] ::msgcat::mcset gv DAYS_OF_WEEK_FULL [list \ "Jedoonee"\ "Jelhein"\ "Jemayrt"\ "Jercean"\ "Jerdein"\ "Jeheiney"\ "Jesarn"] ::msgcat::mcset gv MONTHS_ABBREV [list \ "J-guer"\ "T-arree"\ "Mayrnt"\ "Avrril"\ "Boaldyn"\ "M-souree"\ "J-souree"\ "Luanistyn"\ "M-fouyir"\ "J-fouyir"\ "M.Houney"\ "M.Nollick"\ ""] ::msgcat::mcset gv MONTHS_FULL [list \ "Jerrey-geuree"\ "Toshiaght-arree"\ "Mayrnt"\ "Averil"\ "Boaldyn"\ "Mean-souree"\ "Jerrey-souree"\ "Luanistyn"\ "Mean-fouyir"\ "Jerrey-fouyir"\ "Mee Houney"\ "Mee ny Nollick"\ ""] } tcl9.0.3/library/msgs/gl_es.msg0000644000175000017500000000037315035744304015774 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset gl_ES DATE_FORMAT "%d %B %Y" ::msgcat::mcset gl_ES TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset gl_ES DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/gl.msg0000644000175000017500000000163615104661341015304 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset gl DAYS_OF_WEEK_ABBREV [list \ "Dom"\ "Lun"\ "Mar"\ "Mér"\ "Xov"\ "Ven"\ "Sáb"] ::msgcat::mcset gl DAYS_OF_WEEK_FULL [list \ "Domingo"\ "Luns"\ "Martes"\ "Mércores"\ "Xoves"\ "Venres"\ "Sábado"] ::msgcat::mcset gl MONTHS_ABBREV [list \ "Xan"\ "Feb"\ "Mar"\ "Abr"\ "Mai"\ "Xuñ"\ "Xul"\ "Ago"\ "Set"\ "Out"\ "Nov"\ "Dec"\ ""] ::msgcat::mcset gl MONTHS_FULL [list \ "Xaneiro"\ "Febreiro"\ "Marzo"\ "Abril"\ "Maio"\ "Xuño"\ "Xullo"\ "Agosto"\ "Setembro"\ "Outubro"\ "Novembro"\ "Decembro"\ ""] } tcl9.0.3/library/msgs/ga_ie.msg0000644000175000017500000000042715035744304015747 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ga_IE DATE_FORMAT "%d.%m.%y" ::msgcat::mcset ga_IE TIME_FORMAT "%T" ::msgcat::mcset ga_IE TIME_FORMAT_12 "%T" ::msgcat::mcset ga_IE DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/ga.msg0000644000175000017500000000200515104661341015260 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ga DAYS_OF_WEEK_ABBREV [list \ "Domh"\ "Luan"\ "Máirt"\ "Céad"\ "Déar"\ "Aoine"\ "Sath"] ::msgcat::mcset ga DAYS_OF_WEEK_FULL [list \ "Dé Domhnaigh"\ "Dé Luain"\ "Dé Máirt"\ "Dé Céadaoin"\ "Déardaoin"\ "Dé hAoine"\ "Dé Sathairn"] ::msgcat::mcset ga MONTHS_ABBREV [list \ "Ean"\ "Feabh"\ "Márta"\ "Aib"\ "Beal"\ "Meith"\ "Iúil"\ "Lún"\ "MFómh"\ "DFómh"\ "Samh"\ "Noll"\ ""] ::msgcat::mcset ga MONTHS_FULL [list \ "Eanáir"\ "Feabhra"\ "Márta"\ "Aibreán"\ "Mí na Bealtaine"\ "Meith"\ "Iúil"\ "Lúnasa"\ "Meán Fómhair"\ "Deireadh Fómhair"\ "Mí na Samhna"\ "Mí na Nollag"\ ""] } tcl9.0.3/library/msgs/fr_ch.msg0000644000175000017500000000043115035744304015757 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fr_CH DATE_FORMAT "%d. %m. %y" ::msgcat::mcset fr_CH TIME_FORMAT "%T" ::msgcat::mcset fr_CH TIME_FORMAT_12 "%T" ::msgcat::mcset fr_CH DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/fr_ca.msg0000644000175000017500000000042715035744304015755 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fr_CA DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset fr_CA TIME_FORMAT "%T" ::msgcat::mcset fr_CA TIME_FORMAT_12 "%T" ::msgcat::mcset fr_CA DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/fr_be.msg0000644000175000017500000000042715035744304015760 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fr_BE DATE_FORMAT "%d/%m/%y" ::msgcat::mcset fr_BE TIME_FORMAT "%T" ::msgcat::mcset fr_BE TIME_FORMAT_12 "%T" ::msgcat::mcset fr_BE DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/fr.msg0000644000175000017500000000223515104661341015305 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fr DAYS_OF_WEEK_ABBREV [list \ "dim."\ "lun."\ "mar."\ "mer."\ "jeu."\ "ven."\ "sam."] ::msgcat::mcset fr DAYS_OF_WEEK_FULL [list \ "dimanche"\ "lundi"\ "mardi"\ "mercredi"\ "jeudi"\ "vendredi"\ "samedi"] ::msgcat::mcset fr MONTHS_ABBREV [list \ "janv."\ "févr."\ "mars"\ "avr."\ "mai"\ "juin"\ "juil."\ "août"\ "sept."\ "oct."\ "nov."\ "déc."\ ""] ::msgcat::mcset fr MONTHS_FULL [list \ "janvier"\ "février"\ "mars"\ "avril"\ "mai"\ "juin"\ "juillet"\ "août"\ "septembre"\ "octobre"\ "novembre"\ "décembre"\ ""] ::msgcat::mcset fr BCE "av. J.-C." ::msgcat::mcset fr CE "ap. J.-C." ::msgcat::mcset fr DATE_FORMAT "%e %B %Y" ::msgcat::mcset fr TIME_FORMAT "%H:%M:%S" ::msgcat::mcset fr DATE_TIME_FORMAT "%e %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/fo_fo.msg0000644000175000017500000000042715035744304015773 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fo_FO DATE_FORMAT "%d/%m-%Y" ::msgcat::mcset fo_FO TIME_FORMAT "%T" ::msgcat::mcset fo_FO TIME_FORMAT_12 "%T" ::msgcat::mcset fo_FO DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/fo.msg0000644000175000017500000000166615104661341015311 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fo DAYS_OF_WEEK_ABBREV [list \ "sun"\ "mán"\ "týs"\ "mik"\ "hós"\ "frí"\ "ley"] ::msgcat::mcset fo DAYS_OF_WEEK_FULL [list \ "sunnudagur"\ "mánadagur"\ "týsdagur"\ "mikudagur"\ "hósdagur"\ "fríggjadagur"\ "leygardagur"] ::msgcat::mcset fo MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "mai"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "des"\ ""] ::msgcat::mcset fo MONTHS_FULL [list \ "januar"\ "februar"\ "mars"\ "apríl"\ "mai"\ "juni"\ "juli"\ "august"\ "september"\ "oktober"\ "november"\ "desember"\ ""] } tcl9.0.3/library/msgs/fi.msg0000644000175000017500000000215115104661341015271 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fi DAYS_OF_WEEK_ABBREV [list \ "su"\ "ma"\ "ti"\ "ke"\ "to"\ "pe"\ "la"] ::msgcat::mcset fi DAYS_OF_WEEK_FULL [list \ "sunnuntai"\ "maanantai"\ "tiistai"\ "keskiviikko"\ "torstai"\ "perjantai"\ "lauantai"] ::msgcat::mcset fi MONTHS_ABBREV [list \ "tammi"\ "helmi"\ "maalis"\ "huhti"\ "touko"\ "kesä"\ "heinä"\ "elo"\ "syys"\ "loka"\ "marras"\ "joulu"\ ""] ::msgcat::mcset fi MONTHS_FULL [list \ "tammikuu"\ "helmikuu"\ "maaliskuu"\ "huhtikuu"\ "toukokuu"\ "kesäkuu"\ "heinäkuu"\ "elokuu"\ "syyskuu"\ "lokakuu"\ "marraskuu"\ "joulukuu"\ ""] ::msgcat::mcset fi DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset fi TIME_FORMAT "%k:%M:%S" ::msgcat::mcset fi DATE_TIME_FORMAT "%e.%m.%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/fa_ir.msg0000644000175000017500000000057515104661341015763 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fa_IR AM "صبح" ::msgcat::mcset fa_IR PM "عصر" ::msgcat::mcset fa_IR DATE_FORMAT "%d⁄%m⁄%Y" ::msgcat::mcset fa_IR TIME_FORMAT "%S:%M:%H" ::msgcat::mcset fa_IR TIME_FORMAT_12 "%S:%M:%l %P" ::msgcat::mcset fa_IR DATE_TIME_FORMAT "%d⁄%m⁄%Y %S:%M:%H %z" } tcl9.0.3/library/msgs/fa_in.msg0000644000175000017500000000246315104661341015755 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fa_IN DAYS_OF_WEEK_ABBREV [list \ "ی∔"\ "د∔"\ "س∔"\ "چ∔"\ "پ∔"\ "ج∔"\ "ش∔"] ::msgcat::mcset fa_IN DAYS_OF_WEEK_FULL [list \ "یی‌شنبه"\ "دوشنبه"\ "سه‌شنبه"\ "چهارشنبه"\ "پنج‌شنبه"\ "جمعه"\ "شنبه"] ::msgcat::mcset fa_IN MONTHS_ABBREV [list \ "ژان"\ "فور"\ "مار"\ "آور"\ "مـه"\ "ژون"\ "ژوی"\ "اوت"\ "سپت"\ "اكت"\ "نوا"\ "دسا"\ ""] ::msgcat::mcset fa_IN MONTHS_FULL [list \ "ژانویه"\ "فورویه"\ "مارس"\ "آوریل"\ "مه"\ "ژوئن"\ "ژوئیه"\ "اوت"\ "سپتامبر"\ "اكتبر"\ "نوامبر"\ "دسامبر"\ ""] ::msgcat::mcset fa_IN AM "صبح" ::msgcat::mcset fa_IN PM "عصر" ::msgcat::mcset fa_IN DATE_FORMAT "%A %d %B %Y" ::msgcat::mcset fa_IN TIME_FORMAT_12 "%I:%M:%S %z" ::msgcat::mcset fa_IN DATE_TIME_FORMAT "%A %d %B %Y %I:%M:%S %z %z" } tcl9.0.3/library/msgs/fa.msg0000644000175000017500000000204615104661341015264 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset fa DAYS_OF_WEEK_ABBREV [list \ "ی∔"\ "د∔"\ "س∔"\ "چ∔"\ "پ∔"\ "ج∔"\ "ش∔"] ::msgcat::mcset fa DAYS_OF_WEEK_FULL [list \ "یی‌شنبه"\ "دوشنبه"\ "سه‌شنبه"\ "چهارشنبه"\ "پنج‌شنبه"\ "جمعه"\ "شنبه"] ::msgcat::mcset fa MONTHS_ABBREV [list \ "ژان"\ "فور"\ "مار"\ "آور"\ "مـه"\ "ژون"\ "ژوی"\ "اوت"\ "سپت"\ "اكت"\ "نوا"\ "دسا"\ ""] ::msgcat::mcset fa MONTHS_FULL [list \ "ژانویه"\ "فورویه"\ "مارس"\ "آوریل"\ "مه"\ "ژوئن"\ "ژوئیه"\ "اوت"\ "سپتامبر"\ "اكتبر"\ "نوامبر"\ "دسامبر"\ ""] } tcl9.0.3/library/msgs/eu_es.msg0000644000175000017500000000043715035744304016004 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset eu_ES DATE_FORMAT "%a, %Yeko %bren %da" ::msgcat::mcset eu_ES TIME_FORMAT "%T" ::msgcat::mcset eu_ES TIME_FORMAT_12 "%T" ::msgcat::mcset eu_ES DATE_TIME_FORMAT "%y-%m-%d %T %z" } tcl9.0.3/library/msgs/eu.msg0000644000175000017500000000173115035744304015313 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset eu DAYS_OF_WEEK_ABBREV [list \ "igandea"\ "astelehena"\ "asteartea"\ "asteazkena"\ "osteguna"\ "ostirala"\ "larunbata"] ::msgcat::mcset eu DAYS_OF_WEEK_FULL [list \ "igandea"\ "astelehena"\ "asteartea"\ "asteazkena"\ "osteguna"\ "ostirala"\ "larunbata"] ::msgcat::mcset eu MONTHS_ABBREV [list \ "urt"\ "ots"\ "mar"\ "api"\ "mai"\ "eka"\ "uzt"\ "abu"\ "ira"\ "urr"\ "aza"\ "abe"\ ""] ::msgcat::mcset eu MONTHS_FULL [list \ "urtarrila"\ "otsaila"\ "martxoa"\ "apirila"\ "maiatza"\ "ekaina"\ "uztaila"\ "abuztua"\ "iraila"\ "urria"\ "azaroa"\ "abendua"\ ""] } tcl9.0.3/library/msgs/et.msg0000644000175000017500000000222215104661341015302 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset et DAYS_OF_WEEK_ABBREV [list \ "P"\ "E"\ "T"\ "K"\ "N"\ "R"\ "L"] ::msgcat::mcset et DAYS_OF_WEEK_FULL [list \ "pühapäev"\ "esmaspäev"\ "teisipäev"\ "kolmapäev"\ "neljapäev"\ "reede"\ "laupäev"] ::msgcat::mcset et MONTHS_ABBREV [list \ "Jaan"\ "Veebr"\ "Märts"\ "Apr"\ "Mai"\ "Juuni"\ "Juuli"\ "Aug"\ "Sept"\ "Okt"\ "Nov"\ "Dets"\ ""] ::msgcat::mcset et MONTHS_FULL [list \ "Jaanuar"\ "Veebruar"\ "Märts"\ "Aprill"\ "Mai"\ "Juuni"\ "Juuli"\ "August"\ "September"\ "Oktoober"\ "November"\ "Detsember"\ ""] ::msgcat::mcset et BCE "e.m.a." ::msgcat::mcset et CE "m.a.j." ::msgcat::mcset et DATE_FORMAT "%e-%m-%Y" ::msgcat::mcset et TIME_FORMAT "%k:%M:%S" ::msgcat::mcset et DATE_TIME_FORMAT "%e-%m-%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/es_ve.msg0000644000175000017500000000037315035744304016004 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_VE DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_VE TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_VE DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_uy.msg0000644000175000017500000000037315035744304016027 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_UY DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_UY TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_UY DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_sv.msg0000644000175000017500000000037315035744304016022 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_SV DATE_FORMAT "%m-%d-%Y" ::msgcat::mcset es_SV TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_SV DATE_TIME_FORMAT "%m-%d-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_py.msg0000644000175000017500000000037315035744304016022 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_PY DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_PY TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_PY DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_pr.msg0000644000175000017500000000037315035744304016013 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_PR DATE_FORMAT "%m-%d-%Y" ::msgcat::mcset es_PR TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_PR DATE_TIME_FORMAT "%m-%d-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_pe.msg0000644000175000017500000000037315035744304015776 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_PE DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_PE TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_PE DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_pa.msg0000644000175000017500000000037315035744304015772 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_PA DATE_FORMAT "%m/%d/%Y" ::msgcat::mcset es_PA TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_PA DATE_TIME_FORMAT "%m/%d/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_ni.msg0000644000175000017500000000037315035744304016000 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_NI DATE_FORMAT "%m-%d-%Y" ::msgcat::mcset es_NI TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_NI DATE_TIME_FORMAT "%m-%d-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_mx.msg0000644000175000017500000000037315035744304016016 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_MX DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset es_MX TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_MX DATE_TIME_FORMAT "%e/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_hn.msg0000644000175000017500000000037315035744304015777 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_HN DATE_FORMAT "%m-%d-%Y" ::msgcat::mcset es_HN TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_HN DATE_TIME_FORMAT "%m-%d-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_gt.msg0000644000175000017500000000037315035744304016004 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_GT DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset es_GT TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_GT DATE_TIME_FORMAT "%e/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_ec.msg0000644000175000017500000000037315035744304015761 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_EC DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_EC TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_EC DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_do.msg0000644000175000017500000000037315035744304015774 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_DO DATE_FORMAT "%m/%d/%Y" ::msgcat::mcset es_DO TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_DO DATE_TIME_FORMAT "%m/%d/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_cr.msg0000644000175000017500000000037315035744304015776 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_CR DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_CR TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_CR DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_co.msg0000644000175000017500000000037315035744304015773 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_CO DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset es_CO TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_CO DATE_TIME_FORMAT "%e/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_cl.msg0000644000175000017500000000037315035744304015770 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_CL DATE_FORMAT "%d-%m-%Y" ::msgcat::mcset es_CL TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_CL DATE_TIME_FORMAT "%d-%m-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_bo.msg0000644000175000017500000000037315035744304015772 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_BO DATE_FORMAT "%d-%m-%Y" ::msgcat::mcset es_BO TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset es_BO DATE_TIME_FORMAT "%d-%m-%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/es_ar.msg0000644000175000017500000000036215035744304015772 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es_AR DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset es_AR TIME_FORMAT "%H:%M:%S" ::msgcat::mcset es_AR DATE_TIME_FORMAT "%d/%m/%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/es.msg0000644000175000017500000000221415104661341015302 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset es DAYS_OF_WEEK_ABBREV [list \ "dom"\ "lun"\ "mar"\ "mié"\ "jue"\ "vie"\ "sáb"] ::msgcat::mcset es DAYS_OF_WEEK_FULL [list \ "domingo"\ "lunes"\ "martes"\ "miércoles"\ "jueves"\ "viernes"\ "sábado"] ::msgcat::mcset es MONTHS_ABBREV [list \ "ene"\ "feb"\ "mar"\ "abr"\ "may"\ "jun"\ "jul"\ "ago"\ "sep"\ "oct"\ "nov"\ "dic"\ ""] ::msgcat::mcset es MONTHS_FULL [list \ "enero"\ "febrero"\ "marzo"\ "abril"\ "mayo"\ "junio"\ "julio"\ "agosto"\ "septiembre"\ "octubre"\ "noviembre"\ "diciembre"\ ""] ::msgcat::mcset es BCE "a.C." ::msgcat::mcset es CE "d.C." ::msgcat::mcset es DATE_FORMAT "%e de %B de %Y" ::msgcat::mcset es TIME_FORMAT "%k:%M:%S" ::msgcat::mcset es DATE_TIME_FORMAT "%e de %B de %Y %k:%M:%S %z" } tcl9.0.3/library/msgs/eo.msg0000644000175000017500000000226715104661341015306 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset eo DAYS_OF_WEEK_ABBREV [list \ "di"\ "lu"\ "ma"\ "me"\ "ĵa"\ "ve"\ "sa"] ::msgcat::mcset eo DAYS_OF_WEEK_FULL [list \ "dimanĉo"\ "lundo"\ "mardo"\ "merkredo"\ "ĵaŭdo"\ "vendredo"\ "sabato"] ::msgcat::mcset eo MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "maj"\ "jun"\ "jul"\ "aŭg"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset eo MONTHS_FULL [list \ "januaro"\ "februaro"\ "marto"\ "aprilo"\ "majo"\ "junio"\ "julio"\ "aŭgusto"\ "septembro"\ "oktobro"\ "novembro"\ "decembro"\ ""] ::msgcat::mcset eo BCE "aK" ::msgcat::mcset eo CE "pK" ::msgcat::mcset eo AM "atm" ::msgcat::mcset eo PM "ptm" ::msgcat::mcset eo DATE_FORMAT "%Y-%b-%d" ::msgcat::mcset eo TIME_FORMAT "%H:%M:%S" ::msgcat::mcset eo DATE_TIME_FORMAT "%Y-%b-%d %H:%M:%S %z" } tcl9.0.3/library/msgs/en_zw.msg0000644000175000017500000000037315035744304016025 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_ZW DATE_FORMAT "%d %B %Y" ::msgcat::mcset en_ZW TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset en_ZW DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/en_za.msg0000644000175000017500000000036515035744304016000 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_ZA DATE_FORMAT "%Y/%m/%d" ::msgcat::mcset en_ZA TIME_FORMAT_12 "%I:%M:%S" ::msgcat::mcset en_ZA DATE_TIME_FORMAT "%Y/%m/%d %I:%M:%S %z" } tcl9.0.3/library/msgs/en_sg.msg0000644000175000017500000000037315035744304015776 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_SG DATE_FORMAT "%d %b %Y" ::msgcat::mcset en_SG TIME_FORMAT_12 "%P %I:%M:%S" ::msgcat::mcset en_SG DATE_TIME_FORMAT "%d %b %Y %P %I:%M:%S %z" } tcl9.0.3/library/msgs/en_ph.msg0000644000175000017500000000050115035744304015765 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_PH AM "AM" ::msgcat::mcset en_PH PM "PM" ::msgcat::mcset en_PH DATE_FORMAT "%B %e, %Y" ::msgcat::mcset en_PH TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset en_PH DATE_TIME_FORMAT "%B %e, %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/en_nz.msg0000644000175000017500000000045415035744304016014 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_NZ DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset en_NZ TIME_FORMAT "%H:%M:%S" ::msgcat::mcset en_NZ TIME_FORMAT_12 "%I:%M:%S %P %z" ::msgcat::mcset en_NZ DATE_TIME_FORMAT "%e/%m/%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/en_in.msg0000644000175000017500000000046615035744304015776 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_IN AM "AM" ::msgcat::mcset en_IN PM "PM" ::msgcat::mcset en_IN DATE_FORMAT "%d %B %Y" ::msgcat::mcset en_IN TIME_FORMAT "%H:%M:%S" ::msgcat::mcset en_IN DATE_TIME_FORMAT "%d %B %Y %H:%M:%S %z" } tcl9.0.3/library/msgs/en_ie.msg0000644000175000017500000000042715035744304015762 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_IE DATE_FORMAT "%d/%m/%y" ::msgcat::mcset en_IE TIME_FORMAT "%T" ::msgcat::mcset en_IE TIME_FORMAT_12 "%T" ::msgcat::mcset en_IE DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/en_hk.msg0000644000175000017500000000050115035744304015760 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_HK AM "AM" ::msgcat::mcset en_HK PM "PM" ::msgcat::mcset en_HK DATE_FORMAT "%B %e, %Y" ::msgcat::mcset en_HK TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset en_HK DATE_TIME_FORMAT "%B %e, %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/en_gb.msg0000644000175000017500000000042715035744304015755 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_GB DATE_FORMAT "%d/%m/%y" ::msgcat::mcset en_GB TIME_FORMAT "%T" ::msgcat::mcset en_GB TIME_FORMAT_12 "%T" ::msgcat::mcset en_GB DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/en_ca.msg0000644000175000017500000000044015035744304015743 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_CA DATE_FORMAT "%d/%m/%y" ::msgcat::mcset en_CA TIME_FORMAT "%r" ::msgcat::mcset en_CA TIME_FORMAT_12 "%I:%M:%S %p" ::msgcat::mcset en_CA DATE_TIME_FORMAT "%a %d %b %Y %r %z" } tcl9.0.3/library/msgs/en_bw.msg0000644000175000017500000000037315035744304015775 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_BW DATE_FORMAT "%d %B %Y" ::msgcat::mcset en_BW TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset en_BW DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/en_be.msg0000644000175000017500000000046115035744304015751 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_BE DATE_FORMAT "%d %b %Y" ::msgcat::mcset en_BE TIME_FORMAT "%k:%M:%S" ::msgcat::mcset en_BE TIME_FORMAT_12 "%k h %M min %S s %z" ::msgcat::mcset en_BE DATE_TIME_FORMAT "%d %b %Y %k:%M:%S %z" } tcl9.0.3/library/msgs/en_au.msg0000644000175000017500000000045415035744304015772 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset en_AU DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset en_AU TIME_FORMAT "%H:%M:%S" ::msgcat::mcset en_AU TIME_FORMAT_12 "%I:%M:%S %P %z" ::msgcat::mcset en_AU DATE_TIME_FORMAT "%e/%m/%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/el.msg0000644000175000017500000000256415104661341015303 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset el DAYS_OF_WEEK_ABBREV [list \ "Κυρ"\ "Δευ"\ "Τρι"\ "Τετ"\ "Πεμ"\ "Παρ"\ "Σαβ"] ::msgcat::mcset el DAYS_OF_WEEK_FULL [list \ "Κυριακή"\ "Δευτέρα"\ "Τρίτη"\ "Τετάρτη"\ "Πέμπτη"\ "Παρασκευή"\ "Σάββατο"] ::msgcat::mcset el MONTHS_ABBREV [list \ "Ιαν"\ "Φεβ"\ "Μαρ"\ "Απρ"\ "Μαϊ"\ "Ιουν"\ "Ιουλ"\ "Αυγ"\ "Σεπ"\ "Οκτ"\ "Νοε"\ "Δεκ"\ ""] ::msgcat::mcset el MONTHS_FULL [list \ "Ιανουάριος"\ "Φεβρουάριος"\ "Μάρτιος"\ "Απρίλιος"\ "Μάϊος"\ "Ιούνιος"\ "Ιούλιος"\ "Αύγουστος"\ "Σεπτέμβριος"\ "Οκτώβριος"\ "Νοέμβριος"\ "Δεκέμβριος"\ ""] ::msgcat::mcset el AM "πμ" ::msgcat::mcset el PM "μμ" ::msgcat::mcset el DATE_FORMAT "%e/%m/%Y" ::msgcat::mcset el TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset el DATE_TIME_FORMAT "%e/%m/%Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/de_be.msg0000644000175000017500000000227715104661341015742 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset de_BE DAYS_OF_WEEK_ABBREV [list \ "Son"\ "Mon"\ "Die"\ "Mit"\ "Don"\ "Fre"\ "Sam"] ::msgcat::mcset de_BE DAYS_OF_WEEK_FULL [list \ "Sonntag"\ "Montag"\ "Dienstag"\ "Mittwoch"\ "Donnerstag"\ "Freitag"\ "Samstag"] ::msgcat::mcset de_BE MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mär"\ "Apr"\ "Mai"\ "Jun"\ "Jul"\ "Aug"\ "Sep"\ "Okt"\ "Nov"\ "Dez"\ ""] ::msgcat::mcset de_BE MONTHS_FULL [list \ "Januar"\ "Februar"\ "März"\ "April"\ "Mai"\ "Juni"\ "Juli"\ "August"\ "September"\ "Oktober"\ "November"\ "Dezember"\ ""] ::msgcat::mcset de_BE AM "vorm" ::msgcat::mcset de_BE PM "nachm" ::msgcat::mcset de_BE DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset de_BE TIME_FORMAT "%T" ::msgcat::mcset de_BE TIME_FORMAT_12 "%T" ::msgcat::mcset de_BE DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/de_at.msg0000644000175000017500000000143415104661341015752 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset de_AT MONTHS_ABBREV [list \ "Jän"\ "Feb"\ "Mär"\ "Apr"\ "Mai"\ "Jun"\ "Jul"\ "Aug"\ "Sep"\ "Okt"\ "Nov"\ "Dez"\ ""] ::msgcat::mcset de_AT MONTHS_FULL [list \ "Jänner"\ "Februar"\ "März"\ "April"\ "Mai"\ "Juni"\ "Juli"\ "August"\ "September"\ "Oktober"\ "November"\ "Dezember"\ ""] ::msgcat::mcset de_AT DATE_FORMAT "%Y-%m-%d" ::msgcat::mcset de_AT TIME_FORMAT "%T" ::msgcat::mcset de_AT TIME_FORMAT_12 "%T" ::msgcat::mcset de_AT DATE_TIME_FORMAT "%a %d %b %Y %T %z" } tcl9.0.3/library/msgs/de.msg0000644000175000017500000000230215104661341015261 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset de DAYS_OF_WEEK_ABBREV [list \ "So"\ "Mo"\ "Di"\ "Mi"\ "Do"\ "Fr"\ "Sa"] ::msgcat::mcset de DAYS_OF_WEEK_FULL [list \ "Sonntag"\ "Montag"\ "Dienstag"\ "Mittwoch"\ "Donnerstag"\ "Freitag"\ "Samstag"] ::msgcat::mcset de MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mrz"\ "Apr"\ "Mai"\ "Jun"\ "Jul"\ "Aug"\ "Sep"\ "Okt"\ "Nov"\ "Dez"\ ""] ::msgcat::mcset de MONTHS_FULL [list \ "Januar"\ "Februar"\ "März"\ "April"\ "Mai"\ "Juni"\ "Juli"\ "August"\ "September"\ "Oktober"\ "November"\ "Dezember"\ ""] ::msgcat::mcset de BCE "v. Chr." ::msgcat::mcset de CE "n. Chr." ::msgcat::mcset de AM "vorm." ::msgcat::mcset de PM "nachm." ::msgcat::mcset de DATE_FORMAT "%d.%m.%Y" ::msgcat::mcset de TIME_FORMAT "%H:%M:%S" ::msgcat::mcset de DATE_TIME_FORMAT "%d.%m.%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/da.msg0000644000175000017500000000216415104661341015263 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset da DAYS_OF_WEEK_ABBREV [list \ "sø"\ "ma"\ "ti"\ "on"\ "to"\ "fr"\ "lø"] ::msgcat::mcset da DAYS_OF_WEEK_FULL [list \ "søndag"\ "mandag"\ "tirsdag"\ "onsdag"\ "torsdag"\ "fredag"\ "lørdag"] ::msgcat::mcset da MONTHS_ABBREV [list \ "jan"\ "feb"\ "mar"\ "apr"\ "maj"\ "jun"\ "jul"\ "aug"\ "sep"\ "okt"\ "nov"\ "dec"\ ""] ::msgcat::mcset da MONTHS_FULL [list \ "januar"\ "februar"\ "marts"\ "april"\ "maj"\ "juni"\ "juli"\ "august"\ "september"\ "oktober"\ "november"\ "december"\ ""] ::msgcat::mcset da BCE "f.Kr." ::msgcat::mcset da CE "e.Kr." ::msgcat::mcset da DATE_FORMAT "%d-%m-%Y" ::msgcat::mcset da TIME_FORMAT "%H:%M:%S" ::msgcat::mcset da DATE_TIME_FORMAT "%d-%m-%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/cs.msg0000644000175000017500000000227415104661340015305 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset cs DAYS_OF_WEEK_ABBREV [list \ "Ne"\ "Po"\ "Út"\ "St"\ "Čt"\ "Pá"\ "So"] ::msgcat::mcset cs DAYS_OF_WEEK_FULL [list \ "Neděle"\ "Pondělí"\ "Úterý"\ "Středa"\ "Čtvrtek"\ "Pátek"\ "Sobota"] ::msgcat::mcset cs MONTHS_ABBREV [list \ "I"\ "II"\ "III"\ "IV"\ "V"\ "VI"\ "VII"\ "VIII"\ "IX"\ "X"\ "XI"\ "XII"\ ""] ::msgcat::mcset cs MONTHS_FULL [list \ "leden"\ "únor"\ "březen"\ "duben"\ "květen"\ "červen"\ "červenec"\ "srpen"\ "září"\ "říjen"\ "listopad"\ "prosinec"\ ""] ::msgcat::mcset cs BCE "př.Kr." ::msgcat::mcset cs CE "po Kr." ::msgcat::mcset cs AM "dop." ::msgcat::mcset cs PM "odp." ::msgcat::mcset cs DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset cs TIME_FORMAT "%k:%M:%S" ::msgcat::mcset cs DATE_TIME_FORMAT "%e.%m.%Y %k:%M:%S %z" } tcl9.0.3/library/msgs/ca.msg0000644000175000017500000000210615104661340015255 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ca DAYS_OF_WEEK_ABBREV [list \ "dg."\ "dl."\ "dt."\ "dc."\ "dj."\ "dv."\ "ds."] ::msgcat::mcset ca DAYS_OF_WEEK_FULL [list \ "diumenge"\ "dilluns"\ "dimarts"\ "dimecres"\ "dijous"\ "divendres"\ "dissabte"] ::msgcat::mcset ca MONTHS_ABBREV [list \ "gen."\ "feb."\ "març"\ "abr."\ "maig"\ "juny"\ "jul."\ "ag."\ "set."\ "oct."\ "nov."\ "des."\ ""] ::msgcat::mcset ca MONTHS_FULL [list \ "gener"\ "febrer"\ "març"\ "abril"\ "maig"\ "juny"\ "juliol"\ "agost"\ "setembre"\ "octubre"\ "novembre"\ "desembre"\ ""] ::msgcat::mcset ca DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset ca TIME_FORMAT "%H:%M:%S" ::msgcat::mcset ca DATE_TIME_FORMAT "%d/%m/%Y %H:%M:%S %z" } tcl9.0.3/library/msgs/bn_in.msg0000644000175000017500000000040315035744304015762 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset bn_IN DATE_FORMAT "%A %d %b %Y" ::msgcat::mcset bn_IN TIME_FORMAT_12 "%I:%M:%S %z" ::msgcat::mcset bn_IN DATE_TIME_FORMAT "%A %d %b %Y %I:%M:%S %z %z" } tcl9.0.3/library/msgs/bn.msg0000644000175000017500000000301115104661340015265 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset bn DAYS_OF_WEEK_ABBREV [list \ "রবি"\ "সোম"\ "মঙগল"\ "বুধ"\ "বৃহস্পতি"\ "শুক্র"\ "শনি"] ::msgcat::mcset bn DAYS_OF_WEEK_FULL [list \ "রবিবার"\ "সোমবার"\ "মঙগলবার"\ "বুধবার"\ "বৃহস্পতিবার"\ "শুক্রবার"\ "শনিবার"] ::msgcat::mcset bn MONTHS_ABBREV [list \ "জানুয়ারী"\ "ফেব্রুয়ারী"\ "মার্চ"\ "এপ্রিল"\ "মে"\ "জুন"\ "জুলাই"\ "আগস্ট"\ "সেপ্টেম্বর"\ "অক্টোবর"\ "নভেম্বর"\ "ডিসেম্বর"\ ""] ::msgcat::mcset bn MONTHS_FULL [list \ "জানুয়ারী"\ "ফেব্রুয়ারী"\ "মার্চ"\ "এপ্রিল"\ "মে"\ "জুন"\ "জুলাই"\ "আগস্ট"\ "সেপ্টেম্বর"\ "অক্টোবর"\ "নভেম্বর"\ "ডিসেম্বর"\ ""] ::msgcat::mcset bn AM "পূর্বাহ্ণ" ::msgcat::mcset bn PM "অপরাহ্ণ" } tcl9.0.3/library/msgs/bg.msg0000644000175000017500000000236315104661340015267 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset bg DAYS_OF_WEEK_ABBREV [list \ "Нд"\ "Пн"\ "Вт"\ "Ср"\ "Чт"\ "Пт"\ "Сб"] ::msgcat::mcset bg DAYS_OF_WEEK_FULL [list \ "Неделя"\ "Понеделник"\ "Вторник"\ "Сряда"\ "Четвъртък"\ "Петък"\ "Събота"] ::msgcat::mcset bg MONTHS_ABBREV [list \ "I"\ "II"\ "III"\ "IV"\ "V"\ "VI"\ "VII"\ "VIII"\ "IX"\ "X"\ "XI"\ "XII"\ ""] ::msgcat::mcset bg MONTHS_FULL [list \ "Януари"\ "Февруари"\ "Март"\ "Април"\ "Май"\ "Юни"\ "Юли"\ "Август"\ "Септември"\ "Октомври"\ "Ноември"\ "Декември"\ ""] ::msgcat::mcset bg BCE "пр.н.е." ::msgcat::mcset bg CE "н.е." ::msgcat::mcset bg DATE_FORMAT "%Y-%m-%e" ::msgcat::mcset bg TIME_FORMAT "%k:%M:%S" ::msgcat::mcset bg DATE_TIME_FORMAT "%Y-%m-%e %k:%M:%S %z" } tcl9.0.3/library/msgs/be.msg0000644000175000017500000000250115104661340015257 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset be DAYS_OF_WEEK_ABBREV [list \ "нд"\ "пн"\ "ат"\ "ср"\ "чц"\ "пт"\ "сб"] ::msgcat::mcset be DAYS_OF_WEEK_FULL [list \ "нядзеля"\ "панядзелак"\ "аўторак"\ "серада"\ "чацвер"\ "пятніца"\ "субота"] ::msgcat::mcset be MONTHS_ABBREV [list \ "стд"\ "лют"\ "скв"\ "крс"\ "май"\ "чрв"\ "лпн"\ "жнв"\ "врс"\ "кст"\ "лст"\ "снж"\ ""] ::msgcat::mcset be MONTHS_FULL [list \ "студзеня"\ "лютага"\ "сакавіка"\ "красавіка"\ "мая"\ "чрвеня"\ "ліпеня"\ "жніўня"\ "верасня"\ "кастрычніка"\ "листапада"\ "снежня"\ ""] ::msgcat::mcset be BCE "да н.е." ::msgcat::mcset be CE "н.е." ::msgcat::mcset be DATE_FORMAT "%e.%m.%Y" ::msgcat::mcset be TIME_FORMAT "%k.%M.%S" ::msgcat::mcset be DATE_TIME_FORMAT "%e.%m.%Y %k.%M.%S %z" } tcl9.0.3/library/msgs/ar_sy.msg0000644000175000017500000000200015104661340016000 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ar_SY DAYS_OF_WEEK_ABBREV [list \ "الأحد"\ "الاثنين"\ "الثلاثاء"\ "الأربعاء"\ "الخميس"\ "الجمعة"\ "السبت"] ::msgcat::mcset ar_SY MONTHS_ABBREV [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نوار"\ "حزيران"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] ::msgcat::mcset ar_SY MONTHS_FULL [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نواران"\ "حزير"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] } tcl9.0.3/library/msgs/ar_lb.msg0000644000175000017500000000200015104661340015742 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ar_LB DAYS_OF_WEEK_ABBREV [list \ "الأحد"\ "الاثنين"\ "الثلاثاء"\ "الأربعاء"\ "الخميس"\ "الجمعة"\ "السبت"] ::msgcat::mcset ar_LB MONTHS_ABBREV [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نوار"\ "حزيران"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] ::msgcat::mcset ar_LB MONTHS_FULL [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نوار"\ "حزيران"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] } tcl9.0.3/library/msgs/ar_jo.msg0000644000175000017500000000200015104661340015755 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ar_JO DAYS_OF_WEEK_ABBREV [list \ "الأحد"\ "الاثنين"\ "الثلاثاء"\ "الأربعاء"\ "الخميس"\ "الجمعة"\ "السبت"] ::msgcat::mcset ar_JO MONTHS_ABBREV [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نوار"\ "حزيران"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] ::msgcat::mcset ar_JO MONTHS_FULL [list \ "كانون الثاني"\ "شباط"\ "آذار"\ "نيسان"\ "نوار"\ "حزيران"\ "تموز"\ "آب"\ "أيلول"\ "تشرين الأول"\ "تشرين الثاني"\ "كانون الأول"\ ""] } tcl9.0.3/library/msgs/ar_in.msg0000644000175000017500000000040315035744304015765 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ar_IN DATE_FORMAT "%A %d %B %Y" ::msgcat::mcset ar_IN TIME_FORMAT_12 "%I:%M:%S %z" ::msgcat::mcset ar_IN DATE_TIME_FORMAT "%A %d %B %Y %I:%M:%S %z %z" } tcl9.0.3/library/msgs/ar.msg0000644000175000017500000000247415104661340015304 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset ar DAYS_OF_WEEK_ABBREV [list \ "ح"\ "ن"\ "ث"\ "ر"\ "خ"\ "ج"\ "س"] ::msgcat::mcset ar DAYS_OF_WEEK_FULL [list \ "الأحد"\ "الاثنين"\ "الثلاثاء"\ "الأربعاء"\ "الخميس"\ "الجمعة"\ "السبت"] ::msgcat::mcset ar MONTHS_ABBREV [list \ "ينا"\ "فبر"\ "مار"\ "أبر"\ "ماي"\ "يون"\ "يول"\ "أغس"\ "سبت"\ "أكت"\ "نوف"\ "ديس"\ ""] ::msgcat::mcset ar MONTHS_FULL [list \ "يناير"\ "فبراير"\ "مارس"\ "أبريل"\ "مايو"\ "يونيو"\ "يوليو"\ "أغسطس"\ "سبتمبر"\ "أكتوبر"\ "نوفمبر"\ "ديسمبر"\ ""] ::msgcat::mcset ar BCE "ق.م" ::msgcat::mcset ar CE "م" ::msgcat::mcset ar AM "ص" ::msgcat::mcset ar PM "م" ::msgcat::mcset ar DATE_FORMAT "%d/%m/%Y" ::msgcat::mcset ar TIME_FORMAT_12 "%I:%M:%S %P" ::msgcat::mcset ar DATE_TIME_FORMAT "%d/%m/%Y %I:%M:%S %P %z" } tcl9.0.3/library/msgs/af_za.msg0000644000175000017500000000037315035744304015763 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset af_ZA DATE_FORMAT "%d %B %Y" ::msgcat::mcset af_ZA TIME_FORMAT_12 "%l:%M:%S %P" ::msgcat::mcset af_ZA DATE_TIME_FORMAT "%d %B %Y %l:%M:%S %P %z" } tcl9.0.3/library/msgs/af.msg0000644000175000017500000000173515035744304015274 0ustar sergeisergei# created by tools/loadICU.tcl -- do not edit namespace eval ::tcl::clock { ::msgcat::mcset af DAYS_OF_WEEK_ABBREV [list \ "So"\ "Ma"\ "Di"\ "Wo"\ "Do"\ "Vr"\ "Sa"] ::msgcat::mcset af DAYS_OF_WEEK_FULL [list \ "Sondag"\ "Maandag"\ "Dinsdag"\ "Woensdag"\ "Donderdag"\ "Vrydag"\ "Saterdag"] ::msgcat::mcset af MONTHS_ABBREV [list \ "Jan"\ "Feb"\ "Mar"\ "Apr"\ "Mei"\ "Jun"\ "Jul"\ "Aug"\ "Sep"\ "Okt"\ "Nov"\ "Des"\ ""] ::msgcat::mcset af MONTHS_FULL [list \ "Januarie"\ "Februarie"\ "Maart"\ "April"\ "Mei"\ "Junie"\ "Julie"\ "Augustus"\ "September"\ "Oktober"\ "November"\ "Desember"\ ""] ::msgcat::mcset af AM "VM" ::msgcat::mcset af PM "NM" } tcl9.0.3/library/msgcat/0000755000175000017500000000000015104662213014470 5ustar sergeisergeitcl9.0.3/library/msgcat/pkgIndex.tcl0000644000175000017500000000022715104661340016746 0ustar sergeisergeiif {![package vsatisfies [package provide Tcl] 9.0-]} {return} package ifneeded msgcat 1.7.1 [list source -encoding utf-8 [file join $dir msgcat.tcl]] tcl9.0.3/library/msgcat/msgcat.tcl0000644000175000017500000011103715104661340016455 0ustar sergeisergei# msgcat.tcl -- # # This file defines various procedures which implement a # message catalog facility for Tcl programs. It should be # loaded with the command "package require msgcat". # # Copyright © 2010-2018 Harald Oehlmann. # Copyright © 1998-2000 Ajuba Solutions. # Copyright © 1998 Mark Harrison. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # We use oo::define::self, which is new in Tcl 9.0 package require Tcl 9.0- # When the version number changes, be sure to update the pkgIndex.tcl file, # and the installation directory in the Makefiles. package provide msgcat 1.7.1 namespace eval msgcat { namespace export mc mcn mcexists mcload mclocale mcmax\ mcmset mcpreferences mcset\ mcunknown mcflset mcflmset mcloadedlocales mcforgetpackage\ mcpackagenamespaceget mcpackageconfig mcpackagelocale mcutil # Records the list of locales to search variable Loclist {} # List of currently loaded locales variable LoadedLocales {} # Records the locale of the currently sourced message catalogue file variable FileLocale # Configuration values per Package (e.g. client namespace). # The dict key is of the form "